markstream-vue2 2.0.14 → 2.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +36 -13
- package/dist/index.px.css +1 -1
- package/dist/index.tailwind.css +1 -1
- package/dist/tailwind.ts +1 -1
- package/dist/types/utils/d2RenderSalt.d.ts +1 -0
- package/dist/types/utils/footnoteTarget.d.ts +1 -0
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.create;var e,t=Object.defineProperty,n=Object.defineProperties,o=(Object.getOwnPropertyDescriptor,Object.getOwnPropertyDescriptors),r=(Object.getOwnPropertyNames,Object.getOwnPropertySymbols),l=(Object.getPrototypeOf,Object.prototype.hasOwnProperty),i=Object.prototype.propertyIsEnumerable,a=(e,n,o)=>n in e?t(e,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[n]=o,s=(e,t)=>{for(var n in t||(t={}))l.call(t,n)&&a(e,n,t[n]);if(r)for(var n of r(t))i.call(t,n)&&a(e,n,t[n]);return e},u=(e,t)=>n(e,o(t)),d=(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())});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("stream-markdown-parser"),m=require("vue-demi"),p=require("markstream-core"),f=require("@floating-ui/dom");var v="undefined"!=typeof document?document.currentScript:null;function h(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const n in e)if("default"!==n){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>e[n]})}return t.default=e,Object.freeze(t)}const g=h(m);function y(e,t){if(null==e)return!1;const n=typeof e;return("object"===n||"function"===n)&&t in e}function w(e){return function(e){const t=function(e){const t="string"==typeof e?e:"",[n,o]=t.split(".").map(Number);return Number.isFinite(n)&&Number.isFinite(o)&&2===n?o:null}(e);return null!=t&&t<7}(function(e){var t,n,o,r,l,i,a,s,u;const d=null==(n=null==(t=null==e?void 0:e.$options)?void 0:t._base)?void 0:n.version;if("string"==typeof d&&d)return d;const c=null==(l=null==(r=null==(o=null==e?void 0:e.$root)?void 0:o.$options)?void 0:r._base)?void 0:l.version;if("string"==typeof c&&c)return c;if(y(e,"$")){const t=null==(s=null==(a=null==(i=e.$)?void 0:i.appContext)?void 0:a.app)?void 0:s.version;if("string"==typeof t&&t)return t}if(y(e,"constructor")){const t=null==(u=e.constructor)?void 0:u.version;if("string"==typeof t&&t)return t}if(y(e,"version")){const t=e.version;if("string"==typeof t&&t)return t}return""}(e))}function x(e){return e.slice(2).replace(/^[A-Z]/,e=>e.toLowerCase()).replace(/([A-Z])/g,"-$1").toLowerCase()}function k(e){if(y(e,"$listeners")){const t=e.$listeners;if(t&&"object"==typeof t)return t}if(!y(e,"$attrs"))return{};const t=e.$attrs;if(!t||"object"!=typeof t)return{};const n={};for(const[o,r]of Object.entries(t))/^on[A-Z]/.test(o)&&("function"==typeof r||Array.isArray(r)&&r.every(e=>"function"==typeof e))&&(n[x(o)]=r);return n}function M(e,t,n,o,r,l,i,a){var s,u="function"==typeof e?e.options:e;if(t&&(u.render=t,u.staticRenderFns=n,u._compiled=!0),o&&(u.functional=!0),l&&(u._scopeId="data-v-"+l),i?(s=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),r&&r.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(i)},u._ssrRegister=s):r&&(s=a?function(){r.call(this,(u.functional?this.parent:this).$root.$options.shadowRoot)}:r),s)if(u.functional){u._injectStyles=s;var d=u.render;u.render=function(e,t){return s.call(t),d(e,t)}}else{var c=u.beforeCreate;u.beforeCreate=c?[].concat(c,s):[s]}return{exports:e,options:u}}const b=M(m.defineComponent({__name:"CheckboxNode",props:{node:null},setup:e=>({__sfc:!0})}),function(){var e=this,t=e._self._c;return e._self._setupProxy,t("span",{staticClass:"checkbox-node"},[t("input",{staticClass:"checkbox-input",attrs:{type:"checkbox",disabled:""},domProps:{checked:e.node.checked}})])},[],!1,null,"8dc6c46f",null,null).exports,C=M(m.defineComponent({__name:"DefinitionListNode",props:{node:null,indexKey:null,typewriter:{type:Boolean},customId:null},emits:["copy"],setup(e){const t=e,n=m.getCurrentInstance(),o=m.computed(()=>w(null==n?void 0:n.proxy)?Pt:Zt),r=m.computed(()=>t.node.items.flatMap((e,n)=>[{key:`definition-term-${t.indexKey}-${n}`,tag:"dt",className:"definition-term",nodes:e.term},{key:`definition-desc-${t.indexKey}-${n}`,tag:"dd",className:"definition-desc",nodes:e.definition}]));return{__sfc:!0,props:t,instance:n,nestedRenderer:o,definitionEntries:r}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("dl",{staticClass:"definition-list"},e._l(n.definitionEntries,function(o){return t(o.tag,{key:o.key,tag:"component",class:o.className},[t(n.nestedRenderer,{tag:"component",attrs:{"index-key":o.key,nodes:o.nodes,"custom-id":n.props.customId,typewriter:n.props.typewriter},on:{copy:function(t){return e.$emit("copy",t)}}})],1)}),1)},[],!1,null,"b089ea12",null,null).exports,T=M(m.defineComponent({__name:"EmojiNode",props:{node:null},setup:e=>({__sfc:!0})}),function(){var e=this,t=e._self._c;return e._self._setupProxy,t("span",{staticClass:"emoji-node"},[e._v(e._s(e.node.name))])},[],!1,null,"de55dc97",null,null).exports,N="__global__",_="__MARKSTREAM_VUE2_CUSTOM_COMPONENTS_STORE__",D=(()=>{const e=globalThis;if(e[_])return e[_];const t={scopedCustomComponents:{},revision:m.shallowRef(0)};return e[_]=t,t})(),I=D.revision;function S(e){const t=D.scopedCustomComponents[N]||{};if(!e)return t;const n=D.scopedCustomComponents[e]||{};return t&&0!==Object.keys(t).length?n&&0!==Object.keys(n).length?s(s({},t),n):t:n}const j=M(m.defineComponent({__name:"FootnoteReferenceNode",props:{node:null},setup(e){const t=e,n=`#fnref--${t.node.id}`;return{__sfc:!0,props:t,href:n,handleScroll:function(){if("undefined"==typeof document)return;const e=document.querySelector(n);e?e.scrollIntoView({behavior:"smooth"}):console.warn(`Element with href: ${n} not found`)}}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("sup",{staticClass:"footnote-reference",attrs:{id:`fnref-${e.node.id}`},on:{click:n.handleScroll}},[t("span",{staticClass:"footnote-link cursor-pointer",attrs:{href:n.href,title:`查看脚注 ${e.node.id}`}},[e._v("["+e._s(e.node.id)+"]")])])},[],!1,null,"4da20e16",null,null).exports,E=function(){var e,t,n;const o=g,r=e=>"function"==typeof e&&"function"==typeof e.extend,l=[o,null==o?void 0:o.default,null==(e=null==o?void 0:o.default)?void 0:e.default,null==(n=null!=(t=null==o?void 0:o.default)?t:o)?void 0:n.default,null==o?void 0:o.Vue2,null==o?void 0:o.Vue];for(const a of l){const e=r(a)?a:r(null==a?void 0:a.default)?a.default:null;if(e)try{const t=new e;if("function"==typeof t.$createElement)return t.$createElement.bind(t)}catch(i){}}return null}();function L(e,t,n,o){if(e)return e(t,n,o);try{return m.h(t,n,o)}catch(r){}try{return m.h(t,n,o)}catch(r){}return E?E(t,n,o):null}const B=(()=>{var e;try{return Boolean(null==(e={BASE_URL:"/",MODE:"npm",DEV:!1,PROD:!0,SSR:!1})?void 0:e.DEV)}catch(t){}return!1})();function A(e){B&&console.warn(e)}function O(e){return c.sanitizeHtmlAttrs(e)}function z(e,t,n=!1){const o=Object.entries(null!=t?t:{}),r=o.length>0?o.map(([e,t])=>""===t?` ${e}`:` ${e}="${t}"`).join(""):"";return n?`<${e}${r} />`:`<${e}${r}>`}function P(e,t){Array.isArray(t)?e.push(...t):null!=t&&e.push(t)}function R(e,t,n,o,a,s="safe",u=!1){const d=function(e,t){return c.isCustomHtmlComponentTag(e,t)}(e,o);if(c.BLOCKED_HTML_TAGS.has(e.toLowerCase())||!d&&c.isHtmlTagHardBlocked(e,s))return null;if(!d&&c.isHtmlTagBlocked(e,s))return u?[z(e,t,!0)]:[z(e,t),...n,`</${e}>`];const m=c.sanitizeHtmlAttrs(t,s,e);if(d){const t=o[e]||o[e.toLowerCase()],r=function(e){return c.convertHtmlAttrsToProps(e)}(m);return L(a,t,r,n.length>0?n:void 0)}{const t=m,{innerHTML:o}=t;return L(a,e,((e,t)=>{var n={};for(var o in e)l.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&r)for(var o of r(e))t.indexOf(o)<0&&i.call(e,o)&&(n[o]=e[o]);return n})(t,["innerHTML"]),n.length>0?n:void 0)}}function H(e,t){return c.hasCustomHtmlComponents(e,t)}function $(e,t,n,o="safe"){if(!e)return[];try{const r=function(e,t,n,o="safe"){const r=[],l=[];for(const i of e)if("text"===i.type)(r.length>0?r[r.length-1].children:l).push(i.content);else if("self_closing"===i.type){const e=R(i.tagName,i.attrs||{},[],t,n,o,!0);P(r.length>0?r[r.length-1].children:l,e)}else if("tag_open"===i.type)r.push({tagName:i.tagName,children:[],attrs:i.attrs});else if("tag_close"===i.type){const e=i.tagName.toLowerCase();let a=-1;for(let t=r.length-1;t>=0;t--)if(r[t].tagName.toLowerCase()===e){a=t;break}if(-1!==a)for(;r.length>a;){const i=r.pop(),s=R(i.tagName,i.attrs||{},i.children,t,n,o);r.length>0?P(r[r.length-1].children,s):P(l,s),i.tagName.toLowerCase()!==e&&r.length>a&&A(`Auto-closing unclosed tag: <${i.tagName}>`)}else A(`Ignoring closing tag with no matching opening tag: </${i.tagName}>`)}for(;r.length>0;){const e=r.pop();P(l,R(e.tagName,e.attrs||{},e.children,t,n,o)),A(`Auto-closing unclosed tag: <${e.tagName}>`)}return l}(c.tokenizeHtml(e),t,n,o);return r}catch(l){return r=l,B&&console.error("Failed to parse HTML to VNodes:",r),null}var r}const U=M(m.defineComponent({__name:"HtmlInlineNode",props:{node:null,customId:null,htmlPolicy:null},setup(e){const t=e,n=m.inject("markstreamHtmlPolicy",void 0),o=m.computed(()=>{var e,o;return null!=(o=null!=(e=t.htmlPolicy)?e:null==n?void 0:n.value)?o:"safe"}),r=m.computed(()=>S(t.customId)),l=m.defineComponent({name:"DynamicRenderer",props:{content:{type:String,required:!0},customComponents:{type:Object,required:!0},htmlPolicy:{type:String,default:"safe"}},render(){return $(this.content,this.customComponents,void 0,this.htmlPolicy)||[]}}),i=m.computed(()=>{const e=t.node.content;return e?"escape"===o.value?{mode:"html",content:c.sanitizeHtmlContent(e,o.value)}:t.node.loading&&!t.node.autoClosed?{mode:"text",content:e}:H(e,r.value)?{mode:"dynamic",content:e}:{mode:"html",content:c.sanitizeHtmlContent(e,o.value)}:{mode:"html",content:""}});return{__sfc:!0,props:t,inheritedHtmlPolicy:n,resolvedHtmlPolicy:o,customComponents:r,DynamicRenderer:l,renderMode:i}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return"dynamic"===n.renderMode.mode?t("span",{staticClass:"html-inline-node",class:{"html-inline-node--loading":n.props.node.loading}},[t(n.DynamicRenderer,{attrs:{content:n.renderMode.content,"custom-components":n.customComponents,"html-policy":n.resolvedHtmlPolicy}})],1):"text"===n.renderMode.mode?t("span",{staticClass:"html-inline-node",class:{"html-inline-node--loading":n.props.node.loading}},[e._v(e._s(n.renderMode.content))]):t("span",{staticClass:"html-inline-node",class:{"html-inline-node--loading":n.props.node.loading},domProps:{innerHTML:e._s(n.renderMode.content)}})},[],!1,null,"e6ed4c9f",null,null).exports,F=M(m.defineComponent({__name:"InlineCodeNode",props:{node:null},setup(e){const t=e;function n(e,t){return e.reduce((e,n)=>{const o=n.id===t?u(s({},n),{fading:!1}):n,r=e[e.length-1];return!r||r.fading||o.fading?e.push(o):e[e.length-1]=u(s({},r),{content:r.content+o.content}),e},[])}const o=m.getCurrentInstance(),r=m.computed(()=>{var e,t;return null!=(t=null==(e=null==o?void 0:o.proxy)?void 0:e.$attrs)?t:{}}),l=m.inject("markstreamFade",void 0),i=m.inject("markstreamTextStreamState",void 0),a=m.computed(()=>{const e=r.value.fade;return""===e||!0===e||"true"===e||!1!==e&&"false"!==e&&void 0}),d=m.computed(()=>"boolean"==typeof a.value?a.value:"boolean"!=typeof(null==l?void 0:l.value)||l.value),c=m.computed(()=>{var e;const t=null!=(e=r.value["index-key"])?e:r.value.indexKey;return null==t||""===t?"":String(t)}),p=m.ref(t.node.code?[{id:0,content:t.node.code,fading:!1}]:[]),f=m.ref(t.node.code);let v=1;function h(e){var t;(1!==p.value.length||(null==(t=p.value[0])?void 0:t.fading)||p.value[0].content!==e)&&(p.value=e?[{id:v++,content:e,fading:!1}]:[])}return m.watch([()=>t.node.code,c,d],([e])=>{const t=String(null!=e?e:""),n=c.value,o=n?null==i?void 0:i.get(n):void 0,r=null!=o?o:f.value,l=void 0!==o&&o!==f.value;if(d.value){if(t!==r)if(r&&t.startsWith(r)){const e=t.slice(r.length),n=p.value[p.value.length-1];l?p.value=[{id:v++,content:r,fading:!1},{id:v++,content:e,fading:!0}]:(null==n?void 0:n.fading)?p.value=[...p.value.slice(0,-1),u(s({},n),{content:n.content+e})]:p.value=[...p.value,{id:v++,content:e,fading:!0}]}else h(t)}else h(t);f.value=t,n&&(null==i||i.set(n,t))},{immediate:!0}),m.watch(d,e=>{e||h(f.value)}),{__sfc:!0,props:t,settleAndMergeSegments:n,instance:o,attrs:r,inheritedFade:l,inheritedTextStreamState:i,explicitFade:a,fadeEnabled:d,streamStateKey:c,segments:p,renderedCode:f,nextSegmentId:v,setFullContent:h,settleSegment:function(e){p.value.some(t=>t.id===e&&t.fading)&&(p.value=n(p.value,e))},streamedDeltaClass:function(e){return e.id%2==0?"inline-code-stream-delta--a":"inline-code-stream-delta--b"}}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("code",{staticClass:"inline text-[85%] px-1 py-0.5 rounded font-mono bg-[hsl(var(--secondary))] whitespace-normal break-words max-w-full before:content-[''] after:content-['']"},e._l(n.segments,function(o){return t("span",{key:o.id,class:o.fading?["inline-code-stream-delta",n.streamedDeltaClass(o)]:void 0,on:{animationend:function(e){o.fading&&n.settleSegment(o.id)}}},[e._v(" "+e._s(o.content)+" ")])}),0)},[],!1,null,"8b374652",null,null).exports,Y=m.ref(!1),K=m.ref(""),W=m.ref("top"),Q=m.ref(null),V=m.ref(null),X=m.ref(null),q=m.ref(null),G=m.ref(null);let Z=null,J=null;function ee(){Z&&(clearTimeout(Z),Z=null),J&&(clearTimeout(J),J=null)}let te=!1,ne=null;function oe(){return te||"undefined"==typeof document?Promise.resolve():ne||(ne=Promise.resolve().then(()=>to).then(e=>{var t;te=!0;const n=null!=(t=null==e?void 0:e.default)?t:e,o=document.createElement("div");o.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(o);const r=function(){var e,t,n,o;const r=g,l=e=>"function"==typeof e&&"function"==typeof e.extend,i=[r,null==r?void 0:r.default,null==(e=null==r?void 0:r.default)?void 0:e.default,null==(n=null!=(t=null==r?void 0:r.default)?t:r)?void 0:n.default,null==r?void 0:r.Vue2,null==r?void 0:r.Vue];for(const a of i){if(l(a))return a;if(l(null==a?void 0:a.default))return a.default}return null!=(o=null==r?void 0:r.default)?o:r}();(new(r.extend({render(e){var t;return e(n,{props:{visible:Y.value,anchorEl:Q.value,content:K.value,placement:W.value,id:V.value,originX:X.value,originY:q.value,isDark:null!=(t=G.value)?t:void 0}})}}))).$mount(o)}).catch(e=>{ne=null,te=!1,console.warn("[markstream-vue2] Failed to load Tooltip component. Tooltips will be disabled.",e)}),ne)}function re(e,t,n="top",o=!1,r,l){if(!e)return;oe(),ee();const i=()=>{var o,i;V.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,Q.value=e,K.value=t,W.value=n,X.value=null!=(o=null==r?void 0:r.x)?o:null,q.value=null!=(i=null==r?void 0:r.y)?i:null,G.value="boolean"==typeof l?l:null,Y.value=!0;try{e.setAttribute("aria-describedby",V.value)}catch(a){}};o?i():Z=setTimeout(i,80)}function le(e=!1){ee();const t=()=>{if(Q.value&&V.value)try{Q.value.removeAttribute("aria-describedby")}catch(e){}Y.value=!1,Q.value=null,V.value=null,X.value=null,q.value=null};e?t():J=setTimeout(t,120)}const ie={"common.copy":"Copy","common.copied":"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.minimize":"Minimize","common.zoomIn":"Zoom in","common.zoomOut":"Zoom out","common.resetZoom":"Reset zoom","image.loadError":"Image failed to load","image.loading":"Loading image..."},ae=e=>{var t;return null!=(t=ie[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)};function se(){try{const n=globalThis.$vueI18nUse||null;if(n&&"function"==typeof n)try{const t=n();if(t&&"function"==typeof t.t)return e={t:t.t.bind(t),te:"function"==typeof t.te?t.te.bind(t):void 0},{t(t){if(e.te&&ie[t]&&!e.te(t))return ae(t);const n=e.t(t);return n===t&&ie[t]?ae(t):n}}}catch(t){}}catch(t){}var e;return{t:ae}}const ue=M(m.defineComponent({__name:"ImageNode",props:{node:null,fallbackSrc:{default:""},lazy:{type:Boolean,default:!0},usePlaceholder:{type:Boolean,default:!0}},emits:["load","error","click"],setup(e,{emit:t}){const n=e,o=m.ref(!1),r=m.ref(!1),l=m.ref(""),i=m.ref("primary"),a=m.computed(()=>c.sanitizeImageSrc(n.node.src)),s=m.computed(()=>c.sanitizeImageSrc(n.fallbackSrc)),u=m.computed(()=>l.value),d=m.computed(()=>!n.node.loading&&"failed"!==i.value&&l.value.length>0),p=m.computed(()=>!n.node.loading&&"failed"===i.value),{t:f}=se();return m.watch([a,s,()=>n.node.loading],()=>(o.value=!1,r.value=!1,n.node.loading||a.value?(l.value=a.value,void(i.value="primary")):s.value?(l.value=s.value,void(i.value="fallback")):(l.value="",i.value="failed",void(r.value=!0))),{immediate:!0}),{__sfc:!0,props:n,emit:t,imageLoaded:o,hasError:r,activeSrc:l,imageStage:i,safeNodeSrc:a,safeFallbackSrc:s,displaySrc:u,showImage:d,showError:p,handleImageError:function(){if("primary"===i.value&&s.value&&s.value!==l.value)return i.value="fallback",l.value=s.value,o.value=!1,void(r.value=!1);i.value="failed",r.value=!0,t("error",l.value)},handleImageLoad:function(){o.value=!0,r.value=!1,t("load",u.value)},handleClick:function(e){e.preventDefault(),o.value&&!r.value&&t("click",[e,u.value])},t:f}}}),function(){var e,t,n,o,r,l=this,i=l._self._c,a=l._self._setupProxy;return i("transition",{attrs:{name:"img-switch",mode:"out-in"}},[a.showImage?i("img",{key:"image",staticClass:"image-node__img h-auto rounded-lg transition-opacity duration-200 ease-in-out image-node__img--inline",class:{"opacity-0":!a.imageLoaded,"opacity-100":a.imageLoaded,"cursor-pointer":a.imageLoaded},attrs:{src:a.displaySrc,alt:String(null!=(t=null!=(e=a.props.node.alt)?e:a.props.node.title)?t:""),title:String(null!=(o=null!=(n=a.props.node.title)?n:a.props.node.alt)?o:""),loading:a.props.lazy?"lazy":"eager",decoding:"async",tabindex:a.imageLoaded?0:-1,"aria-label":null!=(r=a.props.node.alt)?r:a.t("image.preview")},on:{error:a.handleImageError,load:a.handleImageLoad,click:a.handleClick}}):l.node.loading&&!a.hasError?i("span",{key:"placeholder",staticClass:"placeholder-layer placeholder-layer--inline inline-flex items-center justify-center gap-2"},[a.props.usePlaceholder?[l._t("placeholder",function(){return[i("div",{staticClass:"w-4 h-4 rounded-full border-2 border-solid border-current border-t-transparent animate-spin",attrs:{"aria-hidden":"true"}}),i("span",{staticClass:"text-sm whitespace-nowrap"},[l._v(l._s(a.t("image.loading")))])]},{node:a.props.node,displaySrc:a.displaySrc,imageLoaded:a.imageLoaded,hasError:a.hasError,fallbackSrc:a.props.fallbackSrc,lazy:a.props.lazy})]:[i("span",{staticClass:"text-sm text-gray-500"},[l._v(l._s(l.node.raw))])]],2):a.showError?i("span",{key:"error",staticClass:"image-node__error image-node__error--inline px-4 py-2 bg-gray-100 flex items-center justify-center rounded-lg gap-2 text-red-500"},[l._t("error",function(){return[i("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"}},[i("path",{attrs:{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"}})]),i("span",{staticClass:"text-sm whitespace-nowrap"},[l._v(l._s(a.t("image.loadError")))])]},{node:a.props.node,displaySrc:a.displaySrc,imageLoaded:a.imageLoaded,hasError:a.hasError,fallbackSrc:a.props.fallbackSrc,lazy:a.props.lazy})],2):l._e()])},[],!1,null,"05ffe4c4",null,null).exports;let de=null,ce=!1,me=ve;function pe(e){var t;const n=null!=(t=null==e?void 0:e.default)?t:e;return n&&"function"==typeof n.renderToString?n:null}function fe(){try{const e=globalThis;return pe(null==e?void 0:e.katex)}catch(e){return null}}function ve(){return(()=>d(this,null,function*(){const e=fe();if(e)return e;const t=yield import("katex");try{yield Promise.resolve().then(()=>require("./chunks/mhchem-4785e7bc.cjs"))}catch(n){}return pe(t)}))()}function he(e){me=e,de=null,ce=!1}function ge(){return"function"==typeof me}function ye(){return d(this,null,function*(){var e;const t=fe();if(t)return de=t,de;if(de)return de;if(ce)return null;const n=me;if(!n)return ce=!0,null;try{const t=yield n();if(t)return de=null!=(e=pe(t))?e:t,de}catch(o){}return ce=!0,null})}const we=m.shallowRef(!1);let xe=null;const ke=M(m.defineComponent({__name:"TextNode",props:{node:null},emits:["copy"],setup(e){const t=e;function n(e,t){return e.reduce((e,n)=>{const o=null==t||n.id===t?u(s({},n),{fading:!1}):n,r=e[e.length-1];return!r||r.fading||o.fading?e.push(o):e[e.length-1]=u(s({},r),{content:r.content+o.content}),e},[])}const o=(xe||(xe=ye().then(e=>{we.value=!!e}).catch(()=>{we.value=!1})),m.readonly(we)),r=m.getCurrentInstance(),l=m.computed(()=>{var e,t;return null!=(t=null==(e=null==r?void 0:r.proxy)?void 0:e.$attrs)?t:{}}),i=m.inject("markstreamFade",void 0),a=m.inject("markstreamTextStreamState",void 0),d=m.inject("markstreamStreamVersion",void 0),c=m.computed(()=>{const e=l.value.fade;return""===e||!0===e||"true"===e||!1!==e&&"false"!==e&&void 0}),p=m.computed(()=>"boolean"==typeof c.value?c.value:"boolean"!=typeof(null==i?void 0:i.value)||i.value),f=m.computed(()=>{var e;const t=null!=(e=l.value["index-key"])?e:l.value.indexKey;return null==t||""===t?"":String(t)}),v=m.ref(t.node.content?[{id:0,content:t.node.content,fading:!1}]:[]),h=m.ref(t.node.content);let g=1;function y(e){var t;(1!==v.value.length||(null==(t=v.value[0])?void 0:t.fading)||v.value[0].content!==e)&&(v.value=e?[{id:g++,content:e,fading:!1}]:[])}function w(){v.value.some(e=>e.fading)&&(v.value=n(v.value))}return m.watch([()=>t.node.content,f,p,()=>null==d?void 0:d.value],([e])=>{const t=String(null!=e?e:""),n=f.value,o=n?null==a?void 0:a.get(n):void 0,r=null!=o?o:h.value,l=void 0!==o&&o!==h.value;if(!p.value)return y(t),h.value=t,void(n&&(null==a||a.set(n,t)));if(t===r)return v.value.some(e=>e.fading)?w():h.value!==t&&y(t),n&&(null==a||a.set(n,t)),void(h.value=t);if(r&&t.startsWith(r)){const e=t.slice(r.length),n=v.value[v.value.length-1];l?v.value=[{id:g++,content:r,fading:!1},{id:g++,content:e,fading:!0}]:(null==n?void 0:n.fading)?v.value=[...v.value.slice(0,-1),u(s({},n),{content:n.content+e})]:v.value=[...v.value,{id:g++,content:e,fading:!0}]}else y(t);h.value=t,n&&(null==a||a.set(n,t))},{immediate:!0}),m.watch(p,e=>{e||y(h.value)}),{__sfc:!0,props:t,settleAndMergeSegments:n,katexReady:o,instance:r,attrs:l,inheritedFade:i,inheritedTextStreamState:a,inheritedStreamVersion:d,explicitFade:c,fadeEnabled:p,streamStateKey:f,segments:v,renderedContent:h,nextSegmentId:g,setFullContent:y,settleSegment:function(e){v.value.some(t=>t.id===e&&t.fading)&&(v.value=n(v.value,e))},settleFadingSegments:w,streamedDeltaClass:function(e){return e.id%2==0?"text-node-stream-delta--a":"text-node-stream-delta--b"}}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("span",{staticClass:"whitespace-pre-wrap break-words text-node",class:[n.katexReady&&e.node.center?"text-node-center":""]},e._l(n.segments,function(o){return t("span",{key:o.id,class:o.fading?["text-node-stream-delta",n.streamedDeltaClass(o)]:void 0,on:{animationend:function(e){o.fading&&n.settleSegment(o.id)}}},[e._v(" "+e._s(o.content)+" ")])}),0)},[],!1,null,"152fed75",null,null).exports;let Me=!1,be=null,Ce=!1;function Te(){return d(this,null,function*(){if(be)return be;if(Ce)return null;try{const e=function(e){var t,n,o;const r="function"==typeof(null==e?void 0:e.createCodeBlockRuntime)||"function"==typeof(null==e?void 0:e.useMonaco)?e:null==e?void 0:e.default,l=null!=(t=null==r?void 0:r.createCodeBlockRuntime)?t:null==r?void 0:r.useMonaco;return"function"!=typeof l?null:{createCodeBlockRuntime:e=>l.call(r,e),detectLanguage:null==(n=null==r?void 0:r.detectLanguage)?void 0:n.bind(r),preloadStreamDiffs:null==(o=null==r?void 0:r.preloadStreamDiffs)?void 0:o.bind(r)}}(yield import("stream-diffs/markstream"));if(e)return be=e,yield function(e){return d(this,null,function*(){var t;if(!Me)return Me=!0,null==(t=e.preloadStreamDiffs)?void 0:t.call(e)})}(be),be}catch(e){}return Ce=!0,null})}const Ne='<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',_e='<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',De='<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';let Ie=null,Se=null,je=null;const Ee=m.ref(0),Le={"":De,plain:De,text:De,javascript:'<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',typescript:'<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" viewBox="0 0 16 16"><path fill="#0288d1" d="M2 2v12h12V2zm4 6h3v1H8v4H7V9H6zm5 0h2v1h-2v1h1a1.003 1.003 0 0 1 1 1v1a1.003 1.003 0 0 1-1 1h-2v-1h2v-1h-1a1.003 1.003 0 0 1-1-1V9a1.003 1.003 0 0 1 1-1"/></svg>\n',jsx:'<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',tsx:'<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',html:'<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',css:'<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',scss:'<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',json:'<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',python:'<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',ruby:'<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',go:'<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',java:'<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',kotlin:'<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',c:'<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',cpp:'<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',cs:Ne,csharp:Ne,php:'<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',shell:_e,powershell:_e,sql:'<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',yaml:'<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',markdown:'<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',xml:'<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',rust:'<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',vue:'<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',mermaid:'<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',svg:'<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'},Be={"":"",javascript:"javascript",js:"javascript",mjs:"javascript",cjs:"javascript",typescript:"typescript",ts:"typescript",jsx:"jsx",tsx:"tsx",golang:"go",py:"python",rb:"ruby",sh:"shell",bash:"shell",zsh:"shell",shellscript:"shell",bat:"shell",batch:"shell",ps1:"powershell",plaintext:"plain",text:"plain",txt:"plain","c++":"cpp","c#":"csharp",cs:"csharp","objective-c":"objectivec","objective-c++":"objectivecpp",yml:"yaml",md:"markdown",rs:"rust",kt:"kotlin",d:"dlang",vbnet:"vb.net"};function Ae(){return d(this,null,function*(){return Se||(je||(je=Promise.resolve().then(()=>require("./chunks/languageIconExtended-4baf8bdb.cjs")).then(e=>(Se=e.EXTENDED_LANGUAGE_ICON_MAP,Ee.value++,Se)).catch(()=>null)),je)})}function Oe(e){Ie=null!=e?e:null}function ze(e){var t;const n=function(e){if(!e)return"";const t=e.trim();if(!t)return"";const[n]=t.split(/\s+/),[o]=n.split(":");return o.toLowerCase()}(e);return null!=(t=Be[n])?t:n}function Pe(e){const t=ze(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"shell":return"zsh";case"objectivec":return"objective-c";case"objectivecpp":return"objective-cpp";default:return t}}function Re(e){if(Ie){const t=Ie(e);if(null!=t&&""!==t)return t}const t=ze(e),n=Le[t];if(n)return n;return(null==Se?void 0:Se[t])||(Ae(),'<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 He={js:"JavaScript",javascript:"JavaScript",ts:"TypeScript",typescript:"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#",csharp:"C#",php:"PHP",sh:"Shell",bash:"Bash",sql:"SQL",yaml:"YAML",md:"Markdown",d2:"D2",d2lang:"D2","":"Plain Text",plain:"Plain Text"},$e=new Map,Ue=new Set(["admonition","blockquote","checkbox","checkbox_input","code_block","definition_item","definition_list","emoji","emphasis","footnote","footnote_reference","footnote_anchor","hardbreak","heading","highlight","html_block","html_inline","image","inline_code","insert","link","list","list_item","math_block","math_inline","paragraph","reference","strikethrough","strong","subscript","superscript","table","table_cell","table_row","text","thematic_break"]);function Fe(e,t={}){return Ke(e,Ye(t))}function Ye(e){var t;const n=c.normalizeCustomHtmlTags(e.customHtmlTags),o=`${e.cacheKey||"markstream-vue2-nested-html"}::${n.join(",")}`;let r=$e.get(o);return r||(r=c.getMarkdown(o,{customHtmlTags:n}),$e.set(o,r)),{markdown:r,options:{allowHtml:!1!==e.allowHtml,htmlPolicy:null!=(t=e.htmlPolicy)?t:"safe",customNodeTag:c.normalizeCustomHtmlTagName(e.customNodeTag)||"div",customNodeClass:e.customNodeClass}}}function Ke(e,t){return(Array.isArray(e)?e:[]).map(e=>We(e,t)).join("")}function We(e,t){if(!e||"object"!=typeof e)return"";switch(e.type){case"text":return rt(tt(e.content));case"paragraph":return`<p>${Ke(et(e.children),t)}</p>`;case"strong":return`<strong>${Ke(et(e.children),t)}</strong>`;case"emphasis":return`<em>${Ke(et(e.children),t)}</em>`;case"strikethrough":return`<del>${Ke(et(e.children),t)}</del>`;case"highlight":return`<mark>${Ke(et(e.children),t)}</mark>`;case"insert":return`<ins>${Ke(et(e.children),t)}</ins>`;case"subscript":return`<sub>${Ke(et(e.children),t)}</sub>`;case"superscript":return`<sup>${Ke(et(e.children),t)}</sup>`;case"inline_code":return`<code>${rt(tt(e.code))}</code>`;case"hardbreak":return"<br>";case"link":return function(e,t){const n=tt(e.href),o=tt(e.title),r=et(e.children).length>0?Ke(et(e.children),t):rt(tt(e.text||n)),l=o?` title="${lt(o)}"`:"",i=n&&!c.isUnsafeHtmlUrl(n)?n:"";return`<a${i?` href="${lt(i)}"`:""}${l}${c.shouldOpenLinkInNewTab(i)?' target="_blank" rel="noreferrer noopener"':""}>${r}</a>`}(e,t);case"image":return function(e){const t=c.sanitizeImageSrc(e.src);if(!t)return"";const n=tt(e.alt),o=tt(e.title),r=o?` title="${lt(o)}"`:"";return`<img src="${lt(t)}" alt="${lt(n)}"${r}>`}(e);case"list":return function(e,t){const n=e.ordered?"ol":"ul";return`<${n}${e.ordered&&Number.isFinite(e.start)?` start="${Number(e.start)}"`:""}>${Ke(et(e.items),t)}</${n}>`}(e,t);case"list_item":return`<li>${Ke(et(e.children),t)}</li>`;case"blockquote":return`<blockquote>${Ke(et(e.children),t)}</blockquote>`;case"heading":return function(e,t){const n=function(e){const t=Math.trunc(Number(e)||1);return Math.min(6,Math.max(1,t))}(e.level);return`<h${n}>${Ke(et(e.children),t)}</h${n}>`}(e,t);case"code_block":return function(e){const t=ot(tt(e.language));return`<pre><code${t?` class="language-${t}"`:""}>${rt(tt(e.code))}</code></pre>`}(e);case"thematic_break":return"<hr>";case"table":return function(e,t){const n=e.header?Qe(e.header,t,!0):"",o=Ke(et(e.rows),t);return`<table>${n?`<thead>${n}</thead>`:""}${o?`<tbody>${o}</tbody>`:""}</table>`}(e,t);case"table_row":return Qe(e,t);case"table_cell":return Ve(e,t);case"definition_list":return function(e,t){return`<dl>${et(e.items).map(e=>Xe(e,t)).join("")}</dl>`}(e,t);case"definition_item":return Xe(e,t);case"footnote":return function(e,t){return`<div id="fnref--${lt(tt(e.id))}" class="footnote-node markstream-nested-footnote"><div class="footnote-node__content">${Ke(et(e.children),t)}</div></div>`}(e,t);case"footnote_reference":return function(e){const t=rt(tt(e.id)),n=lt(tt(e.id));return`<sup id="fnref-${n}" class="footnote-reference markstream-nested-footnote-ref"><span href="#fnref--${n}" title="查看脚注 ${n}" class="footnote-link cursor-pointer">[${t}]</span></sup>`}(e);case"footnote_anchor":return function(e){const t=lt(tt(e.id));return`<a class="footnote-anchor" href="#fnref-${t}" title="返回引用 ${t}" aria-label="返回引用 ${t}">↩︎</a>`}(e);case"admonition":return function(e,t){const n=ot(tt(e.kind||"note"))||"note";var o;return`<div class="markstream-nested-admonition markstream-nested-admonition--${n}"><div class="markstream-nested-admonition__title">${rt(tt(e.title)||((o=n)?`${o[0].toUpperCase()}${o.slice(1)}`:""))}</div><div class="markstream-nested-admonition__content">${Ke(et(e.children),t)}</div></div>`}(e,t);case"checkbox":case"checkbox_input":return`<input type="checkbox" disabled${e.checked?" checked":""}>`;case"emoji":return rt(tt(e.raw||e.markup||e.content||e.name));case"math_inline":return`<span class="markstream-nested-math" data-display="inline">${rt(tt(e.content||e.markup||e.raw))}</span>`;case"math_block":return`<pre class="markstream-nested-math-block"><code>${rt(tt(e.content||e.markup||e.raw))}</code></pre>`;case"reference":return`<sup class="markstream-nested-reference">[${rt(tt(e.id))}]</sup>`;case"html_inline":case"html_block":return function(e,t){const n=tt(e.content)||tt(e.raw),o=tt(e.tag).trim().toLowerCase(),r=et(e.children);return t.options.allowHtml?"escape"===t.options.htmlPolicy||e.loading&&!e.autoClosed?rt(n):o&&r.length>0&&!c.NON_STRUCTURING_HTML_TAGS.has(o)&&!c.isHtmlTagBlocked(o,t.options.htmlPolicy)?`<${o}${Je(e.attrs)}>${Ke(r,t)}</${o}>`:c.sanitizeHtmlContent(n,t.options.htmlPolicy):rt(n)}(e,t);default:return function(e,t){const n=tt(e.tag||e.type);if(!n||Ue.has(n))return rt(tt(e.content||e.raw));const o=["markstream-nested-custom",`markstream-nested-custom--${ot(n)||"node"}`,Ge(e,t.options.customNodeClass)].filter(Boolean).join(" "),r=Je(e.attrs,o),l=function(e,t){const n=et(e.children);if(n.length>0)return Ke(n,t);const o=tt(e.content);return o?qe(o,t):rt(tt(e.raw))}(e,t),i=t.options.customNodeTag;return`<${i}${r} data-markstream-custom-tag="${lt(n)}">${l}</${i}>`}(e,t)}}function Qe(e,t,n=!1){return`<tr>${et(e.cells).map(e=>Ve(e,t,n)).join("")}</tr>`}function Ve(e,t,n=!1){const o=n||e.header?"th":"td",r=tt(e.align);return`<${o}${r?` style="text-align:${lt(r)}"`:""}>${Ke(et(e.children),t)}</${o}>`}function Xe(e,t){return`<dt>${Ke(et(e.term),t)}</dt><dd>${Ke(et(e.definition),t)}</dd>`}function qe(e,t){return e?t.markdown.render(e):""}function Ge(e,t){return t?Ze("function"==typeof t?t(e):t):""}function Ze(e){return Array.isArray(e)?e.map(e=>Ze(e)).filter(Boolean).join(" "):"string"==typeof e?e.trim():""}function Je(e,t=""){const n=function(e){if(!e)return[];if(Array.isArray(e)){if(0===e.length)return[];const t=e[0];return Array.isArray(t)?e.map(([e,t])=>[String(e),t]):e.map(e=>[String(e.name),e.value])}return Object.entries(e).map(([e,t])=>[e,t])}(e),o=[],r=[t];for(const[i,a]of n){const e=String(i).trim(),t=e.toLowerCase();e&&nt(e)&&(c.DANGEROUS_HTML_ATTRS.has(t)||!0!==a&&c.URL_HTML_ATTRS.has(t)&&a&&c.isUnsafeHtmlUrl(String(a),{attrName:t})||("class"!==t?!0===a?o.push(` ${e}`):o.push(` ${e}="${lt(String(a))}"`):r.push(String(a))))}const l=r.map(e=>e.trim()).filter(Boolean).join(" ");return l&&o.unshift(` class="${lt(l)}"`),o.join("")}function et(e){return Array.isArray(e)?e.filter(e=>!!e&&"object"==typeof e):[]}function tt(e){return"string"==typeof e?e:null==e?"":String(e)}function nt(e){return/^[^\s"'<>`=]+$/.test(e)&&!/^on/i.test(e)}function ot(e){return e.trim().toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"")}function rt(e){return tt(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function lt(e){return rt(e).replace(/`/g,"`")}const it=new Map;function at(e,t={}){if(Array.isArray(e.nodes))return e.nodes.slice();const n=e.node;if(n){const e=(o=n.children,Array.isArray(o)?o:[]);if(e.length>0)return e.slice()}var o;const r=function(e){var t;return"string"==typeof e.content?e.content:"string"==typeof(null==(t=e.node)?void 0:t.content)?e.node.content:""}(e);if(!r)return[];const l=function(e,t){var n,o;const r=null!=(n=t.parseOptions)?n:{},l=null!=(o=t.final)?o:(a=e.node)&&"object"==typeof a&&"boolean"==typeof a.loading?!a.loading:void 0,i=c.mergeCustomHtmlTags(t.customHtmlTags,r.customHtmlTags);var a;return null==l&&0===i.length?r:s(s(s({},r),null==l?{}:{final:l}),0===i.length?{}:{customHtmlTags:i})}(e,t),i=function(e){var t;const n=c.mergeCustomHtmlTags(e.customHtmlTags,null==(t=e.parseOptions)?void 0:t.customHtmlTags),o=`${e.cacheKey||"markstream-vue2-nested-nodes"}::${n.join(",")}`;let r=it.get(o);return r||(r=c.getMarkdown(o,{customHtmlTags:n}),it.set(o,r)),e.customMarkdownIt?e.customMarkdownIt(r):r}(t);return c.parseMarkdownToStructure(r,i,l)}const st=M(m.defineComponent({__name:"PreCodeNode",props:{node:null,showLineNumbers:{type:Boolean},diffInline:{type:Boolean}},setup(e){const t=e,n=m.computed(()=>{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:"").split(":")[0].toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),o=m.computed(()=>`language-${n.value}`),r=m.computed(()=>{var e;return!0===t.showLineNumbers&&!0===(null==(e=t.node)?void 0:e.diff)}),l=m.computed(()=>r.value&&!0===t.diffInline),i=m.computed(()=>{var e,n,o,r,l,i;if(!0===(null==(e=t.node)?void 0:e.diff))return String(null!=(o=null==(n=t.node)?void 0:n.code)?o:"");const a=String(null!=(l=null==(r=t.node)?void 0:r.code)?l:"");return!0===(null==(i=t.node)?void 0:i.loading)?a:a.replace(/\r\n$|\n$|\r$/,"")});let a="",s=1;function u(e){let t=0,n=1;e.startsWith(a)&&(t=a.length,n=s,t>0&&"\r"===e[t-1]&&"\n"===e[t]&&t++);for(let o=t;o<e.length;o++)"\n"===e[o]?n++:"\r"===e[o]&&(n++,"\n"===e[o+1]&&o++);return a=e,s=n,n}const d=m.computed(()=>u(i.value));let c=0,p="";const f=m.computed(()=>{const e=d.value;e<c&&(c=0,p="");for(let t=c+1;t<=e;t++)p+=`${p?"\n":""}${t}`;return c=e,p}),v=m.computed(()=>{if(!0!==t.showLineNumbers||r.value)return;const e=d.value;return{"--markstream-pre-line-number-width":`${Math.max(2,String(e).length)}ch`,"--markstream-code-padding-left":"calc(var(--markstream-pre-line-number-padding-left, 2ch) + var(--markstream-pre-line-number-width, 2ch) + var(--markstream-pre-line-number-padding-right, 1ch) + var(--markstream-pre-line-number-separator-width, 2px) + var(--markstream-pre-line-number-gap-to-code, 1ch))"}}),h=m.computed(()=>{const e=n.value;return e?`Code block: ${e}`:"Code block"});function g(e){return String(null!=e?e:"").split(/\r\n|\n|\r/)}function y(e){const t=String(null!=e?e:"");return t?t.split(/\r\n|\n|\r/):[]}function w(e){return e.startsWith("-")&&!e.startsWith("---")}function x(e){return e.startsWith("+")&&!e.startsWith("+++")}function k(){var e,o,r,l;if("diff"===n.value)return!0;const i=null!=(l=null==(r=String(null!=(o=null==(e=t.node)?void 0:e.raw)?o:"").split(/\r?\n/,1)[0])?void 0:r.trim())?l:"";return/^`{3,}\s*diff(?:\s|$)|^~{3,}\s*diff(?:\s|$)/.test(i)}function M(e){const t=e.some(e=>w(e)),n=e.some(e=>x(e));return t&&n||k()&&(t||n)}function b(){var e,n;return null!=(null==(e=t.node)?void 0:e.originalCode)||null!=(null==(n=t.node)?void 0:n.updatedCode)}function C(e,t){return!T(e[t])||t<e.length-1}function T(e){return 0===String(null!=e?e:"").trim().length}function N(e,t,n,o,r={}){const l=0===String(null!=e?e:"").trim().length;return{code:e,empty:l,kind:l&&"hunk"!==t&&!r.preserveBlankKind?"context":t,key:n,number:o}}function _(e,t){const n=e.length,o=t.length;if((n+1)*(o+1)>15e5)return null;const r=o+1,l=new Uint16Array((n+1)*(o+1));for(let u=n-1;u>=0;u--)for(let n=o-1;n>=0;n--){const o=u*r+n;e[u]===t[n]?l[o]=l[(u+1)*r+n+1]+1:l[o]=Math.max(l[(u+1)*r+n],l[u*r+n+1])}const i=[];let a=0,s=0;for(;a<n&&s<o;)e[a]===t[s]?(i.push({originalIndex:a,modifiedIndex:s}),a++,s++):l[(a+1)*r+s]>=l[a*r+s+1]?a++:s++;return i}function D(e){let t=1;return e.map((e,n)=>e.startsWith("@@")?N(e,"hunk",`inline-hunk-${n}`,""):w(e)?N(e.slice(1),"removed",`inline-removed-${n}`,"",{preserveBlankKind:!0}):x(e)?N(e.slice(1),"added",`inline-added-${n}`,t++,{preserveBlankKind:!0}):N(e.startsWith(" ")?e.slice(1):e,"context",`inline-context-${n}`,t++))}function I(e,t){const n=y(e),o=y(t),r=_(n,o);if(r){const e=[];let t=0,l=0;for(const i of r){for(;t<i.originalIndex;)e.push(N(n[t],"removed",`inline-removed-source-${t}`,"",{preserveBlankKind:C(n,t)})),t++;for(;l<i.modifiedIndex;)e.push(N(o[l],"added",`inline-added-source-${l}`,l+1,{preserveBlankKind:C(o,l)})),l++;e.push(N(o[i.modifiedIndex],"context",`inline-context-source-${i.originalIndex}-${i.modifiedIndex}`,i.modifiedIndex+1)),t=i.originalIndex+1,l=i.modifiedIndex+1}for(;t<n.length;)e.push(N(n[t],"removed",`inline-removed-source-${t}`,"",{preserveBlankKind:C(n,t)})),t++;for(;l<o.length;)e.push(N(o[l],"added",`inline-added-source-${l}`,l+1,{preserveBlankKind:C(o,l)})),l++;return e}const l=[];let i=0,a=n.length-1,s=o.length-1;for(;i<=a&&i<=s&&n[i]===o[i];)l.push(N(o[i],"context",`inline-prefix-${i}`,i+1)),i++;const u=[];for(;a>=i&&s>=i&&n[a]===o[s];)u.unshift(N(o[s],"context",`inline-suffix-${s}`,s+1)),a--,s--;for(let d=i;d<=a;d++)l.push(N(n[d],"removed",`inline-removed-source-${d}`,"",{preserveBlankKind:C(n,d)}));for(let d=i;d<=s;d++)l.push(N(o[d],"added",`inline-added-source-${d}`,d+1,{preserveBlankKind:C(o,d)}));return l.concat(u)}function S(e=!1){var n,o,r,l,i;const a=g(null==(n=t.node)?void 0:n.code);if(!M(a)&&b()){if(e)return[{key:"inline",className:"markstream-pre__diff-pane--inline",lines:I(null==(o=t.node)?void 0:o.originalCode,null==(r=t.node)?void 0:r.updatedCode)}];const n=y(null==(l=t.node)?void 0:l.originalCode),a=y(null==(i=t.node)?void 0:i.updatedCode);return[{key:"original",className:"markstream-pre__diff-pane--original",lines:n.map((e,t)=>N(e,a[t]===e?"context":"removed",`original-${t}`,t+1,{preserveBlankKind:C(n,t)}))},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:a.map((e,t)=>N(e,n[t]===e?"context":"added",`modified-${t}`,t+1,{preserveBlankKind:C(a,t)}))}]}if(e)return[{key:"inline",className:"markstream-pre__diff-pane--inline",lines:D(a)}];const s=[],u=[];let d=1,c=1;for(const[t,m]of a.entries())if(m.startsWith("@@"))s.push(N(m,"hunk",`original-hunk-${t}`,"")),u.push(N(m,"hunk",`modified-hunk-${t}`,""));else if(w(m))s.push(N(m.slice(1),"removed",`original-removed-${t}`,d++,{preserveBlankKind:!0}));else if(x(m))u.push(N(m.slice(1),"added",`modified-added-${t}`,c++,{preserveBlankKind:!0}));else{const e=m.startsWith(" ")?m.slice(1):m;s.push(N(e,"context",`original-context-${t}`,d++)),u.push(N(e,"context",`modified-context-${t}`,c++))}return[{key:"original",className:"markstream-pre__diff-pane--original",lines:s},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:u}]}const j=m.computed(()=>r.value?S(l.value):[]);return{__sfc:!0,props:t,normalizedLanguage:n,languageClass:o,isDiffPreview:r,isInlineDiffPreview:l,displayCode:i,countedCode:a,countedLines:s,countCodeLines:u,codeLineCount:d,lineNumbersTextCount:c,lineNumbersTextCache:p,lineNumbersText:f,lineNumberLayoutStyle:v,ariaLabel:h,splitLines:g,splitDiffSource:y,isRemovedDiffLine:w,isAddedDiffLine:x,isExplicitDiffLanguage:k,hasPatchLines:M,hasDiffSourcePair:b,shouldPreserveSourceBlankDiffKind:C,isBlankDiffLine:T,toDiffLine:N,computeSourceLineMatches:_,buildInlinePatchPreviewLines:D,buildInlineSourcePreviewLines:I,buildDiffPanes:S,diffPreviewPanes:j}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("pre",{class:[n.languageClass,{"markstream-pre--line-numbers":n.props.showLineNumbers,"markstream-pre--diff-preview":n.isDiffPreview,"markstream-pre--diff-inline":n.isInlineDiffPreview}],style:n.lineNumberLayoutStyle,attrs:{"aria-busy":!0===e.node.loading,"aria-label":n.ariaLabel,"data-language":n.normalizedLanguage,"data-markstream-line-numbers":n.props.showLineNumbers?"1":void 0,"data-markstream-pre":"1",tabindex:"0"}},[n.isDiffPreview?t("code",{staticClass:"markstream-pre__diff-code",attrs:{translate:"no"}},e._l(n.diffPreviewPanes,function(n){return t("span",{key:n.key,staticClass:"markstream-pre__diff-pane",class:n.className},e._l(n.lines,function(n){return t("span",{key:n.key,staticClass:"markstream-pre__diff-line",class:[`markstream-pre__diff-line--${n.kind}`,{"markstream-pre__diff-line--empty":n.empty}]},[t("span",{staticClass:"markstream-pre__diff-rail",attrs:{"aria-hidden":"true"}}),t("span",{staticClass:"markstream-pre__diff-number",attrs:{"aria-hidden":"true"}},[e._v(e._s(n.number))]),t("span",{staticClass:"markstream-pre__diff-content"},[t("span",{staticClass:"markstream-pre__diff-content-inner"},[e._v(e._s(n.code))])])])}),0)}),0):[n.props.showLineNumbers?t("span",{staticClass:"markstream-pre__line-numbers",attrs:{"aria-hidden":"true"}},[t("span",{staticClass:"markstream-pre__line-numbers-text",domProps:{textContent:e._s(n.lineNumbersText)}})]):e._e(),t("code",{staticClass:"markstream-pre__code",attrs:{translate:"no"},domProps:{textContent:e._s(n.displayCode)}})]],2)},[],!1,null,null,null,null).exports;function ut(e){return t=>{var n,o;return m.h(ke,u(s({},t),{node:u(s({},t.node),{content:null!=(o=t.node.raw)?o:e(String(null!=(n=t.node.content)?n:""))})}))}}function dt(){return d(this,null,function*(){var e,t,n;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 ut(e=>`$${e}$`);try{if(yield ye()){const e=yield Promise.resolve().then(()=>require("./chunks/index-11432088.cjs"));return null!=(n=e.default)?n:e}}catch(o){console.warn('[markstream-vue2] Optional peer dependencies for MathInlineNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',o)}return ut(e=>`$${e}$`)})}function ct(){return d(this,null,function*(){var e;try{if(yield ye()){const t=yield Promise.resolve().then(()=>require("./chunks/index-fb457079.cjs"));return null!=(e=t.default)?e:t}}catch(t){console.warn('[markstream-vue2] Optional peer dependencies for MathBlockNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',t)}return ut(e=>`$$${e}$$`)})}const mt=M(m.defineComponent({__name:"ReferenceNode",props:{node:null,messageId:null,threadId:null},emits:["click","mouseEnter","mouseLeave"],setup:e=>({__sfc:!0})}),function(){var e=this,t=e._self._c;return e._self._setupProxy,t("span",{staticClass:"reference-node cursor-pointer bg-[hsl(var(--muted))] text-xs rounded-md px-1.5 mx-0.5 hover:bg-[hsl(var(--secondary))]",attrs:{role:"button",tabindex:"0"},on:{click:function(t){return e.$emit("click",t,e.node.id,e.messageId,e.threadId)},mouseenter:function(t){return e.$emit("mouseEnter",t,e.node.id,e.messageId,e.threadId)},mouseleave:function(t){return e.$emit("mouseLeave",t,e.node.id,e.messageId,e.threadId)}}},[e._v(" "+e._s(e.node.id)+" ")])},[],!1,null,null,null,null).exports,pt=M(m.defineComponent({__name:"SuperscriptNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=S(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:s({text:ke,inline_code:F,link:gt,html_inline:U,strong:vt,emphasis:xt,footnote_reference:j,strikethrough:ht,highlight:wt,insert:yt,subscript:ft,emoji:T,math_inline:dt,reference:mt},n)}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("sup",{staticClass:"superscript-node"},e._l(e.node.children,function(o,r){return t("span",{key:`${e.indexKey||"superscript"}-${r}`,staticClass:"superscript-child"},[n.nodeComponents[o.type]?t(n.nodeComponents[o.type],{tag:"component",attrs:{node:o,"custom-id":n.props.customId,"index-key":`${e.indexKey||"superscript"}-${r}`}}):t("span",[e._v(e._s(o.content||o.raw||""))])],1)}),0)},[],!1,null,"ef2512b4",null,null).exports,ft=M(m.defineComponent({__name:"SubscriptNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=S(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:s({text:ke,inline_code:F,link:gt,html_inline:U,strong:vt,emphasis:xt,footnote_reference:j,strikethrough:ht,highlight:wt,insert:yt,superscript:pt,emoji:T,math_inline:dt,reference:mt},n)}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("sub",{staticClass:"subscript-node"},e._l(e.node.children,function(o,r){return t("span",{key:`${e.indexKey||"subscript"}-${r}`,staticClass:"subscript-child"},[n.nodeComponents[o.type]?t(n.nodeComponents[o.type],{tag:"component",attrs:{node:o,"custom-id":n.props.customId,"index-key":`${e.indexKey||"subscript"}-${r}`}}):t("span",[e._v(e._s(o.content||o.raw||""))])],1)}),0)},[],!1,null,"3d49d031",null,null).exports,vt=M(m.defineComponent({__name:"StrongNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=S(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:s({text:ke,inline_code:F,link:gt,html_inline:U,emphasis:xt,strikethrough:ht,highlight:wt,insert:yt,subscript:ft,superscript:pt,emoji:T,footnote_reference:j,math_inline:dt,reference:mt},n)}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("strong",{staticClass:"strong-node"},e._l(e.node.children,function(o,r){return t(n.nodeComponents[o.type],{key:`${e.indexKey||"strong"}-${r}`,tag:"component",attrs:{"index-key":`${e.indexKey||"strong"}-${r}`,node:o,"custom-id":n.props.customId}})}),1)},[],!1,null,"af3ce037",null,null).exports,ht=M(m.defineComponent({__name:"StrikethroughNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=S(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:s({text:ke,inline_code:F,link:gt,html_inline:U,strong:vt,emphasis:xt,highlight:wt,insert:yt,subscript:ft,superscript:pt,emoji:T,footnote_reference:j,math_inline:dt,reference:mt},n)}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("del",{staticClass:"strikethrough-node"},e._l(e.node.children,function(o,r){return t(n.nodeComponents[o.type],{key:`${e.indexKey||"strikethrough"}-${r}`,tag:"component",attrs:{node:o,"custom-id":n.props.customId,"index-key":`${e.indexKey||"strikethrough"}-${r}`}})}),1)},[],!1,null,"904d5bd1",null,null).exports,gt=M(m.defineComponent({__name:"LinkNode",props:{node:null,indexKey:null,customId:null,showTooltip:{type:Boolean,default:!0},color:null,underlineHeight:null,underlineBottom:null,animationDuration:null,animationOpacity:null,animationTiming:null,animationIteration:null},setup(e){const t=e,n={x:0,y:0,hasValue:!1};let o=0,r=null;function l(){if(r||"undefined"==typeof window)return;const e=e=>{"number"==typeof e.clientX&&"number"==typeof e.clientY&&(n.x=e.clientX,n.y=e.clientY,n.hasValue=!0)};window.addEventListener("pointermove",e,!0),window.addEventListener("mousemove",e,!0),r=()=>{window.removeEventListener("pointermove",e,!0),window.removeEventListener("mousemove",e,!0)}}function i(){l(),o+=1}function a(){o=Math.max(0,o-1),!o&&r&&(r(),r=null)}const u=m.computed(()=>{var e,n,o,r,l,i;const a=void 0!==t.underlineBottom?"number"==typeof t.underlineBottom?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px",s=null!=(e=t.animationOpacity)?e:.35,u=Math.max(.12,Math.min(.5*s,s));return{"--link-color":null!=(n=t.color)?n:"#0366d6","--underline-height":`${null!=(o=t.underlineHeight)?o:2}px`,"--underline-bottom":a,"--underline-opacity":String(s),"--underline-rest-opacity":String(u),"--underline-duration":`${null!=(r=t.animationDuration)?r:1.6}s`,"--underline-timing":null!=(l=t.animationTiming)?l:"ease-in-out","--underline-iteration":"number"==typeof t.animationIteration?String(t.animationIteration):null!=(i=t.animationIteration)?i:"infinite"}}),d={text:ke,strong:vt,strikethrough:ht,emphasis:xt,image:ue,html_inline:U},p=m.useAttrs(),f=m.computed(()=>{var e,n;const o=null==(e=t.node)?void 0:e.attrs;if(!o||"object"!=typeof o)return{};const r={};if(Array.isArray(o))for(const t of o)Array.isArray(t)&&t[0]&&(r[String(t[0])]=String(null!=(n=t[1])?n:""));else for(const[t,l]of Object.entries(o))t&&null!=l&&!1!==l&&(r[t]=!0===l?"":String(l));return O(r)}),v=m.ref(null),h=m.ref(!1),g=m.computed(()=>{const e=s(s({},p),f.value);return delete e.title,delete e.href,delete e.target,delete e.rel,e}),y=m.computed(()=>{var e,n;return O({href:String(null!=(n=null==(e=t.node)?void 0:e.href)?n:"")}).href}),w=m.computed(()=>c.shouldOpenLinkInNewTab(y.value));function x(){var e,n;return(null==(e=t.node)?void 0:e.title)||y.value||(null==(n=t.node)?void 0:n.text)||""}function k(e){if(!e||!n.hasValue)return!1;const t=e.getBoundingClientRect();return n.x>=t.left&&n.x<=t.right&&n.y>=t.top&&n.y<=t.bottom}function M(){t.showTooltip&&v.value&&k(v.value)&&(h.value=!0,re(v.value,x(),"top",!0,{x:n.x,y:n.y}))}const b=m.computed(()=>{var e,n;const o=null==(e=t.node)?void 0:e.title;return"string"==typeof o&&o.trim().length>0?o:String(null!=(n=y.value)?n:"")});return m.onMounted(()=>{i(),t.showTooltip&&oe(),m.nextTick(()=>{M()})}),m.onUpdated(()=>{M()}),m.onBeforeUnmount(()=>{a(),h.value&&(h.value=!1,le(!0))}),{__sfc:!0,props:t,lastPointerPosition:n,pointerTrackerRefCount:o,pointerTrackerCleanup:r,ensurePointerTracker:l,retainPointerTracker:i,releasePointerTracker:a,cssVars:u,nodeComponents:d,attrs:p,nodeAttrs:f,anchorEl:v,isHovering:h,anchorAttrs:g,safeHref:y,openInNewTab:w,getTooltipText:x,isPointerInsideAnchor:k,syncTooltipForHoveredAnchor:M,onAnchorEnter:function(e){if(!t.showTooltip)return;h.value=!0;const 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;re(v.value||e.currentTarget,x(),"top",!0,o)},onAnchorLeave:function(){t.showTooltip&&(h.value=!1,le())},title:b,TextNode:ke}}}),function(){var e,t,n=this,o=n._self._c,r=n._self._setupProxy;return n.node.loading?o("span",n._b({staticClass:"link-loading inline-flex items-baseline gap-1.5",style:r.cssVars,attrs:{"aria-hidden":n.node.loading?"false":"true"}},"span",r.attrs,!1),[o("span",{staticClass:"link-text-wrapper relative inline-flex"},[o("span",{staticClass:"leading-[normal] link-text"},[o(r.TextNode,{staticClass:"leading-[normal] link-text",attrs:{node:{type:"text",content:String(null!=(e=n.node.text)?e:""),raw:String(null!=(t=n.node.text)?t:"")},"index-key":`${n.indexKey||"link-text"}-loading`}})],1),o("span",{staticClass:"link-loading-indicator",attrs:{"aria-hidden":"true"}})])]):o("a",n._b({ref:"anchorEl",staticClass:"link-node",style:r.cssVars,attrs:{href:r.safeHref,title:n.showTooltip?"":r.title,"aria-label":`Link: ${r.title}`,"aria-hidden":n.node.loading?"true":"false",target:r.openInNewTab?"_blank":void 0,rel:r.openInNewTab?"noopener noreferrer":void 0},on:{mouseenter:e=>r.onAnchorEnter(e),mouseleave:r.onAnchorLeave}},"a",r.anchorAttrs,!1),n._l(n.node.children,function(e,t){return o(r.nodeComponents[e.type],{key:`${n.indexKey||"emphasis"}-${t}`,tag:"component",attrs:{node:e,"custom-id":r.props.customId,"index-key":`${n.indexKey||"link-text"}-${t}`}})}),1)},[],!1,null,"df7a5c00",null,null).exports,yt=M(m.defineComponent({__name:"InsertNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=S(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:s({text:ke,inline_code:F,link:gt,html_inline:U,strong:vt,emphasis:xt,strikethrough:ht,highlight:wt,subscript:ft,superscript:pt,emoji:T,footnote_reference:j,math_inline:dt,reference:mt},n)}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("ins",{staticClass:"insert-node"},e._l(e.node.children,function(o,r){return t(n.nodeComponents[o.type],{key:`${e.indexKey||"insert"}-${r}`,tag:"component",attrs:{node:o,"custom-id":n.props.customId,"index-key":`${e.indexKey||"insert"}-${r}`}})}),1)},[],!1,null,"ab1ec9bc",null,null).exports,wt=M(m.defineComponent({__name:"HighlightNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=S(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:s({text:ke,inline_code:F,link:gt,html_inline:U,strong:vt,emphasis:xt,strikethrough:ht,insert:yt,subscript:ft,superscript:pt,emoji:T,footnote_reference:j,math_inline:dt,reference:mt},n)}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("mark",{staticClass:"highlight-node"},e._l(e.node.children,function(o,r){return t(n.nodeComponents[o.type],{key:`${e.indexKey||"highlight"}-${r}`,tag:"component",attrs:{node:o,"custom-id":n.props.customId,"index-key":`${e.indexKey||"highlight"}-${r}`}})}),1)},[],!1,null,"38e31bf6",null,null).exports,xt=M(m.defineComponent({__name:"EmphasisNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=S(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:s({text:ke,inline_code:F,link:gt,html_inline:U,strong:vt,strikethrough:ht,highlight:wt,insert:yt,subscript:ft,superscript:pt,emoji:T,footnote_reference:j,math_inline:dt,reference:mt},n)}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("em",{staticClass:"emphasis-node"},e._l(e.node.children,function(o,r){return t(n.nodeComponents[o.type],{key:`${e.indexKey||"emphasis"}-${r}`,tag:"component",attrs:{node:o,"custom-id":n.props.customId,"index-key":`${e.indexKey||"emphasis"}-${r}`}})}),1)},[],!1,null,"8264674d",null,null).exports,kt=M(m.defineComponent({__name:"FootnoteAnchorNode",props:{node:null},setup(e){const t=e;return{__sfc:!0,props:t,scrollToReference:function(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"})}}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("a",{staticClass:"footnote-anchor text-sm hover:underline cursor-pointer",attrs:{href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`},on:{click:n.scrollToReference}},[e._v(" ↩︎ ")])},[],!1,null,"4a90fe82",null,null).exports,Mt=M(m.defineComponent({__name:"FootnoteNode",props:{node:null,indexKey:null,typewriter:{type:Boolean},customId:null},emits:["copy"],setup(e){const t=e,n=m.getCurrentInstance(),o=m.computed(()=>w(null==n?void 0:n.proxy)?Pt:Zt);return{__sfc:!0,props:t,instance:n,nestedRenderer:o}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("div",{staticClass:"footnote-node flex text-sm leading-relaxed border-t border-[var(--footnote-border,#eaecef)] pt-2",attrs:{id:`fnref--${e.node.id}`}},[t("div",{staticClass:"flex-1"},[t(n.nestedRenderer,{tag:"component",attrs:{"index-key":`footnote-${n.props.indexKey}`,nodes:n.props.node.children,"custom-id":n.props.customId,typewriter:n.props.typewriter},on:{copy:function(t){return e.$emit("copy",t)}}})],1)])},[],!1,null,null,null,null).exports,bt=M(m.defineComponent({__name:"HardBreakNode",props:{node:null},setup:e=>({__sfc:!0})}),function(){var e=this._self._c;return this._self._setupProxy,e("br",{staticClass:"hard-break"})},[],!1,null,"50c58f70",null,null).exports,Ct=M(m.defineComponent({__name:"HeadingNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=S(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:s({text:ke,inline_code:F,link:gt,image:ue,strong:vt,emphasis:xt,strikethrough:ht,highlight:wt,insert:yt,subscript:ft,superscript:pt,emoji:T,checkbox:b,checkbox_input:b,footnote_reference:j,hardbreak:bt,math_inline:dt,reference:mt},n)}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t(`h${e.node.level}`,e._b({tag:"component",staticClass:"heading-node",class:[`heading-${e.node.level}`],attrs:{dir:"auto"}},"component",e.node.attrs,!1),e._l(e.node.children,function(o,r){return t(n.nodeComponents[o.type],{key:`${e.indexKey||"heading"}-${r}`,tag:"component",attrs:{"custom-id":n.props.customId,node:o,"index-key":`${e.indexKey||"heading"}-${r}`}})}),1)},[],!1,null,"ffb7cf51",null,null).exports,Tt=M(m.defineComponent({__name:"ListItemNode",props:{node:null,item:null,indexKey:null,value:null,customId:null,typewriter:{type:Boolean},showTooltips:{type:Boolean}},setup(e){const t=e,n=m.computed(()=>{var e;return null!=(e=t.node)?e:t.item}),o=m.computed(()=>null==t.value?{}:{value:t.value}),r=m.getCurrentInstance(),l=m.computed(()=>w(null==r?void 0:r.proxy)?Pt:Zt);return{__sfc:!0,props:t,itemNode:n,liValueAttr:o,instance:r,nestedRenderer:l}}}),function(){var e,t,n=this,o=n._self._c,r=n._self._setupProxy;return o("li",n._b({staticClass:"list-item pl-1.5 my-2",attrs:{dir:"auto"}},"li",r.liValueAttr,!1),[o(r.nestedRenderer,n._b({tag:"component",attrs:{"index-key":`list-item-${r.props.indexKey}`,nodes:null!=(t=null==(e=r.itemNode)?void 0:e.children)?t:[],"custom-id":r.props.customId,typewriter:r.props.typewriter,"batch-rendering":!1},on:{copy:function(e){return n.$emit("copy",e)}}},"component",{showTooltips:r.props.showTooltips},!1))],1)},[],!1,null,"5c58ad56",null,null).exports,Nt=M(m.defineComponent({__name:"ListNode",props:{node:null,customId:null,indexKey:null,typewriter:{type:Boolean},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const{node:t,customId:n,indexKey:o,typewriter:r,showTooltips:l}=e;return{__sfc:!0,listItemComponent:m.computed(()=>(I.value,S(n).list_item||Tt))}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t(e.node.ordered?"ol":"ul",{tag:"component",staticClass:"list-node",class:{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}},e._l(e.node.items,function(o,r){var l;return t(n.listItemComponent,e._b({key:`${e.indexKey||"list"}-${r}`,tag:"component",attrs:{node:o,"custom-id":e.customId,"index-key":`${e.indexKey||"list"}-${r}`,typewriter:e.typewriter,value:e.node.ordered?(null!=(l=e.node.start)?l:1)+r:void 0},on:{copy:function(t){return e.$emit("copy",t)}}},"component",{showTooltips:e.showTooltips},!1))}),1)},[],!1,null,"91e6dafc",null,null).exports,_t=Symbol("ViewportPriority");function Dt(e,t){var n,o;const r="undefined"!=typeof window&&"undefined"!=typeof document,l="boolean"==typeof t?m.ref(t):t,i=r?null!=(n=window.requestIdleCallback)?n:e=>window.setTimeout(()=>e({didTimeout:!0,timeRemaining:()=>0}),16):null,a=r?null!=(o=window.cancelIdleCallback)?o:e=>window.clearTimeout(e):null;let s=null,u=null;const d=new Map,c=new Set;let p=null;function f(){if(!d.size){try{null==s||s.disconnect()}catch(e){}s=null,u=null,c.size||function(){if(null!=p){try{null==a||a(p)}catch(e){}p=null}}()}}function v(e){const t=d.get(e);if(t){if(!t.visible.value){t.visible.value=!0;try{t.resolve()}catch(n){}}try{null==s||s.unobserve(e)}catch(n){}d.delete(e),c.delete(e),f()}}function h(){i&&null==p&&c.size&&(p=i(()=>{p=null;const e=c.values().next().value;e&&(c.delete(e),v(e),c.size&&h())},{timeout:1200}))}const g=(t,n)=>{const o=m.ref(!1);let i,a=!1;const p=new Promise(e=>{i=()=>{a||(a=!0,e())}}),g=()=>{try{null==s||s.unobserve(t)}catch(e){}d.delete(t),c.delete(t),f()};if(!r||!l.value)return o.value=!0,i(),{isVisible:o,whenVisible:p,destroy:g};const y=function(t,n){if(!r)return s;if("undefined"==typeof IntersectionObserver)return null;const o=function(t,n){var o,r,l;return{root:null!=(o=null==e?void 0:e(null!=t?t:null))?o:null,rootMargin:null!=(r=null==n?void 0:n.rootMargin)?r:"300px",threshold:null!=(l=null==n?void 0:n.threshold)?l:0}}(t,n);if(s&&(i=o,(l=u)&&l.root===i.root&&l.rootMargin===i.rootMargin&&l.threshold===i.threshold))return s;var l,i;if(s)try{s.disconnect()}catch(a){}s=new IntersectionObserver(e=>{for(const t of e)(t.isIntersecting||t.intersectionRatio>0)&&v(t.target)},{root:o.root,rootMargin:o.rootMargin,threshold:o.threshold}),u=o;for(const e of d.keys())s.observe(e);return s}(t,n);return y?(d.set(t,{resolve:i,visible:o}),y.observe(t),c.add(t),h(),{isVisible:o,whenVisible:p,destroy:g}):(o.value=!0,i(),{isVisible:o,whenVisible:p,destroy:g})};return m.provide(_t,g),g}function It(){var e,t;const n=m.inject(_t,void 0);if(n)return n;const o=new WeakMap;let r=null;const l=new Set;let i=null;const a="undefined"!=typeof window?null!=(e=window.requestIdleCallback)?e:e=>window.setTimeout(()=>e({didTimeout:!0,timeRemaining:()=>0}),16):null,s="undefined"!=typeof window?null!=(t=window.cancelIdleCallback)?t:e=>window.clearTimeout(e):null,u=()=>{if(null!=i){try{null==s||s(i)}catch(e){}i=null}},d=e=>{const t=o.get(e);if(t){if(!t.visible.value){t.visible.value=!0;try{t.resolve()}catch(n){}}try{null==r||r.unobserve(e)}catch(n){}o.delete(e),l.delete(e),l.size||u()}},c=()=>{a&&null==i&&l.size&&(i=a(()=>{i=null;const e=l.values().next().value;e&&(l.delete(e),d(e),l.size&&c())},{timeout:1200}))};return e=>{const t=m.ref(!1);let n,i=!1;const a=new Promise(e=>{n=()=>{i||(i=!0,e())}}),s=()=>{try{null==r||r.unobserve(e)}catch(t){}o.delete(e),l.delete(e),l.size||u()},p=r||("undefined"==typeof window||"undefined"==typeof IntersectionObserver?null:(r=new IntersectionObserver(e=>{for(const t of e)(t.isIntersecting||t.intersectionRatio>0)&&d(t.target)},{root:null,rootMargin:"300px",threshold:0}),r));return p?(o.set(e,{resolve:n,visible:t}),p.observe(e),l.add(e),c(),{isVisible:t,whenVisible:a,destroy:s}):(t.value=!0,n(),{isVisible:t,whenVisible:a,destroy:s})}}const St=M(m.defineComponent({__name:"HtmlBlockNode",props:{node:null,customId:null,htmlPolicy:null},setup(e){const t=e,n=m.inject("markstreamHtmlPolicy",void 0),o=m.computed(()=>{var e,o;return null!=(o=null!=(e=t.htmlPolicy)?e:null==n?void 0:n.value)?o:"safe"}),r=m.computed(()=>{const e=c.sanitizeHtmlTokenAttrs(t.node.attrs,o.value);if(!e)return;const n=c.tokenAttrsToRecord(e);return Object.keys(n).length>0?n:void 0}),l=m.computed(()=>{const e=String(t.node.tag||"").trim(),n=c.sanitizeHtmlTokenAttrs(t.node.attrs,o.value,e);if(!n)return;const r=c.tokenAttrsToRecord(n);return Object.keys(r).length>0?r:void 0}),i=m.computed(()=>S(t.customId)),a=m.defineComponent({name:"DynamicRenderer",props:{content:{type:String,required:!0},customComponents:{type:Object,required:!0},htmlPolicy:{type:String,default:"safe"}},render(){return $(this.content,this.customComponents,void 0,this.htmlPolicy)||[]}}),s=m.computed(()=>Array.isArray(t.node.children)?t.node.children:[]),u=m.computed(()=>String(t.node.tag||"div")),d=m.computed(()=>{const e=u.value.trim().toLowerCase();return c.NON_STRUCTURING_HTML_TAGS.has(e)||c.isHtmlTagBlocked(e,o.value)}),p=m.computed(()=>0===s.value.length||!t.node.tag||d.value?"":Fe(s.value,{htmlPolicy:o.value})),f=m.computed(()=>{if(s.value.length>0&&t.node.tag&&!d.value)return{mode:"structured"};const e=t.node.content;return e?"escape"===o.value?{mode:"html",content:c.sanitizeHtmlContent(e,o.value)}:H(e,i.value)?{mode:"dynamic",content:e}:{mode:"html",content:c.sanitizeHtmlContent(e,o.value)}:{mode:"html",content:""}}),v=m.ref(null),h=m.ref("undefined"==typeof window),g=m.ref(t.node.content),y=It();let w=null;const x=!!t.node.loading;return"undefined"!=typeof window?(m.watch(v,e=>{var n;if(null==(n=null==w?void 0:w.destroy)||n.call(w),w=null,!x)return h.value=!0,void(g.value=t.node.content);if(!e)return void(h.value=!1);const o=y(e,{rootMargin:"400px"});w=o,h.value=o.isVisible.value,o.whenVisible.then(()=>{h.value=!0})},{immediate:!0}),m.watch(()=>t.node.content,e=>{x&&!h.value||(g.value=e)})):h.value=!0,m.onBeforeUnmount(()=>{var e;null==(e=null==w?void 0:w.destroy)||e.call(w),w=null}),{__sfc:!0,props:t,inheritedHtmlPolicy:n,resolvedHtmlPolicy:o,boundAttrs:r,structuredBoundAttrs:l,customComponents:i,DynamicRenderer:a,structuredChildren:s,structuredTag:u,isBlockedStructuredTag:d,structuredHtml:p,renderMode:f,htmlRef:v,shouldRender:h,renderContent:g,registerVisibility:y,visibilityHandle:w,isDeferred:x}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return"structured"===n.renderMode.mode&&n.shouldRender?t(n.structuredTag,e._b({ref:"htmlRef",tag:"component",staticClass:"html-block-node",domProps:{innerHTML:e._s(n.structuredHtml)}},"component",n.structuredBoundAttrs,!1)):"structured"===n.renderMode.mode?t(n.structuredTag,e._b({ref:"htmlRef",tag:"component",staticClass:"html-block-node"},"component",n.structuredBoundAttrs,!1),[t("div",{staticClass:"html-block-node__placeholder"},[e._t("placeholder",function(){return[t("span",{staticClass:"html-block-node__placeholder-bar"}),t("span",{staticClass:"html-block-node__placeholder-bar w-4/5"}),t("span",{staticClass:"html-block-node__placeholder-bar w-2/3"})]},{node:e.node})],2)]):t("div",{ref:"htmlRef",staticClass:"html-block-node"},[n.shouldRender?["dynamic"===n.renderMode.mode?t(n.DynamicRenderer,{attrs:{content:n.renderMode.content,"custom-components":n.customComponents,"html-policy":n.resolvedHtmlPolicy}}):t("div",e._b({domProps:{innerHTML:e._s(n.renderMode.content)}},"div",n.boundAttrs,!1))]:t("div",{staticClass:"html-block-node__placeholder"},[e._t("placeholder",function(){return[t("span",{staticClass:"html-block-node__placeholder-bar"}),t("span",{staticClass:"html-block-node__placeholder-bar w-4/5"}),t("span",{staticClass:"html-block-node__placeholder-bar w-2/3"})]},{node:e.node})],2)],2)},[],!1,null,"25a9000d",null,null).exports,jt=M(m.defineComponent({__name:"ParagraphNode",props:{node:null,customId:null,indexKey:null,customHtmlTags:null},setup(e){const t=e,n=S(t.customId);function o(e){var t;return"text"===e.type&&""===String(null!=(t=e.content)?t:"").trim()}function r(e){return"link"===e.type&&Array.isArray(e.children)?e.children.filter(e=>!o(e)):[]}function l(e){var t;const n=r(e);return 1===n.length&&"image"===(null==(t=n[0])?void 0:t.type)}const i=m.computed(()=>t.node.children.filter(e=>!o(e))),a=m.computed(()=>i.value.length>0&&i.value.every(e=>"image"===e.type||l(e))),d=m.computed(()=>new Set(c.normalizeCustomHtmlTags(t.customHtmlTags))),p=m.computed(()=>{if(!a.value||i.value.length<=1)return t.node.children;const e=[];for(let n=0;n<t.node.children.length;n++){const r=t.node.children[n];if(!o(r)){e.push(r);continue}const l=e.length>0,i=t.node.children.slice(n+1).some(e=>!o(e));l&&i&&e.push(u(s({},r),{content:" ",raw:" "}))}return e}),f=s({inline_code:F,image:ue,link:gt,hardbreak:bt,emphasis:xt,strong:vt,strikethrough:ht,highlight:wt,insert:yt,subscript:ft,superscript:pt,html_inline:U,html_block:St,emoji:T,checkbox:b,math_inline:dt,checkbox_input:b,reference:mt,footnote_anchor:kt,footnote_reference:j,text:ke},n);return{__sfc:!0,props:t,overrides:n,isWhitespaceText:o,getTextContent:function(e){var t;return String(null!=(t=e.content)?t:"")},getMeaningfulLinkChildren:r,isImageOnlyLink:l,meaningfulChildren:i,isMediaOnlyParagraph:a,customHtmlTagsSet:d,renderedChildren:p,getChildProps:function(e,n){var o;return{node:e,"index-key":`${null!=(o=t.indexKey)?o:"paragraph"}-${n}`,"custom-id":t.customId,"custom-html-tags":t.customHtmlTags}},nodeComponents:f,processChild:function(e){var t,n,o,r;if("html_block"===e.type||"html_inline"===e.type){const l=String(null!=(t=e.tag)?t:"").trim().toLowerCase()||c.getHtmlTagFromContent(e.content);if(l&&!d.value.has(l)&&c.shouldRenderUnknownHtmlTagAsText(null!=(n=e.content)?n:e.raw,l)){const t=String(null!=(r=null!=(o=e.content)?o:e.raw)?r:"");return{child:{type:"text",content:t,raw:t},component:ke}}}return{child:e,component:f[e.type]}}}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("p",{staticClass:"paragraph-node",attrs:{dir:"auto"}},[e._l(n.renderedChildren,function(o,r){return[n.isMediaOnlyParagraph&&n.isWhitespaceText(o)?[e._v(" "+e._s(n.getTextContent(o))+" ")]:t(n.processChild(o).component,e._b({key:`${e.indexKey||"paragraph"}-${r}`,tag:"component"},"component",n.getChildProps(n.processChild(o).child,r),!1))]})],2)},[],!1,null,"3275cbf4",null,null).exports,Et=M(m.defineComponent({__name:"TableNode",props:{node:null,indexKey:null,isDark:{type:Boolean},typewriter:{type:Boolean},customId:null},emits:["copy"],setup(e){const t=e,n=m.computed(()=>{var e;return null!=(e=t.node.loading)&&e}),o=m.computed(()=>{var e;return null!=(e=t.node.rows)?e:[]}),r=m.ref(null),l=m.ref([]),i=m.getCurrentInstance(),a=m.computed(()=>w(null==i?void 0:i.proxy)?Pt:Zt);let s=null;const u=m.computed(()=>l.value.map(e=>e>0?{width:`${e}px`}:void 0)),d=m.computed(()=>l.value.length>0);function c(){var e;const t=null==(e=r.value)?void 0:e.querySelectorAll("thead th");return Array.from(null!=t?t:[],e=>Math.round(e.getBoundingClientRect().width))}function p(e){if(!s)return;e.preventDefault();const t=s.startWidth+s.nextStartWidth,n=Math.min(48,Math.floor(t/2)),o=Math.max(n,Math.min(t-n,Math.round(s.startWidth+e.clientX-s.startX))),r=[...s.widths];r[s.index]=o,r[s.index+1]=t-o,l.value=r}function f(){s&&(window.removeEventListener("pointermove",p),window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",f),s=null)}return m.watch(()=>t.node.header.cells.length,()=>{f(),l.value=[]}),m.onBeforeUnmount(f),{__sfc:!0,props:t,isLoading:n,bodyRows:o,tableRef:r,columnWidths:l,instance:i,nestedRenderer:a,MIN_COLUMN_WIDTH:48,resizeState:s,columnStyles:u,hasColumnWidths:d,measureHeaderWidths:c,onColumnResizeMove:p,stopColumnResize:f,startColumnResize:function(e,t){if(0!==t.button)return;const n=c(),o=n[e],r=n[e+1];o&&r&&(t.preventDefault(),s={index:e,startX:t.clientX,startWidth:o,nextStartWidth:r,widths:n},l.value=n,window.addEventListener("pointermove",p),window.addEventListener("pointerup",f),window.addEventListener("pointercancel",f))}}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("div",{staticClass:"table-node-wrapper"},[t("table",{ref:"tableRef",staticClass:"my-8 text-sm table-node",class:{"table-node--loading":n.isLoading},attrs:{"aria-busy":n.isLoading}},[n.hasColumnWidths?t("colgroup",e._l(e.node.header.cells,function(e,o){return t("col",{key:`col-${o}`,style:n.columnStyles[o]})}),0):e._e(),t("thead",{staticClass:"border-[var(--table-border,#cbd5e1)] border-solid"},[t("tr",{staticClass:"border-b border-solid"},e._l(e.node.header.cells,function(o,r){return t("th",{key:`header-${r}`,staticClass:"font-semibold p-[calc(4/7*1em)]",class:["right"===o.align?"text-right":"center"===o.align?"text-center":"text-left"],attrs:{dir:"auto"}},[t(n.nestedRenderer,{tag:"component",attrs:{nodes:o.children,"index-key":`table-th-${n.props.indexKey}`,"custom-id":n.props.customId,typewriter:n.props.typewriter},on:{copy:function(t){return e.$emit("copy",t)}}}),r<e.node.header.cells.length-1?t("button",{staticClass:"table-node__resize-handle",attrs:{type:"button","aria-label":`Resize columns ${r+1} and ${r+2}`},on:{pointerdown:function(e){return n.startColumnResize(r,e)}}}):e._e()],1)}),0)]),t("tbody",e._l(n.bodyRows,function(o,r){return t("tr",{key:`row-${r}`,staticClass:"border-[var(--table-border,#cbd5e1)] border-solid",class:[r<n.bodyRows.length-1?"border-b":""]},e._l(o.cells,function(o,l){return t("td",{key:`cell-${r}-${l}`,staticClass:"p-[calc(4/7*1em)]",class:["right"===o.align?"text-right":"center"===o.align?"text-center":"text-left"],attrs:{dir:"auto"}},[t(n.nestedRenderer,{tag:"component",attrs:{nodes:o.children,"index-key":`table-td-${n.props.indexKey}`,"custom-id":n.props.customId,typewriter:n.props.typewriter},on:{copy:function(t){return e.$emit("copy",t)}}})],1)}),0)}),0)]),t("transition",{attrs:{name:"table-node-fade"}},[n.isLoading?t("div",{staticClass:"table-node__loading",attrs:{role:"status","aria-live":"polite"}},[e._t("loading",function(){return[t("span",{staticClass:"table-node__spinner animate-spin",attrs:{"aria-hidden":"true"}}),t("span",{staticClass:"sr-only"},[e._v("Loading")])]},{isLoading:n.isLoading})],2):e._e()])],1)},[],!1,null,"e80ddef6",null,null).exports,Lt=M(m.defineComponent({__name:"ThematicBreakNode",setup:e=>({__sfc:!0})}),function(){var e=this._self._c;return this._self._setupProxy,e("hr",{staticClass:"hr-node"})},[],!1,null,"639cbad9",null,null).exports,Bt=M(m.defineComponent({__name:"FallbackComponent",props:{node:null},setup:e=>({__sfc:!0})}),function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",{staticClass:"unknown-node"},[e._v(" "+e._s(e.node.raw)+" ")])},[],!1,null,"89aff01f",null,null).exports,At=M(m.defineComponent({__name:"VmrContainerNode",props:{node:null,indexKey:null,isDark:{type:Boolean},typewriter:{type:Boolean},customId:null},setup(e){const t=e,n=m.computed(()=>`vmr-container vmr-container-${t.node.name}`),o=S(t.customId),r=s({text:ke,paragraph:jt,heading:Ct,inline_code:F,link:gt,image:ue,strong:vt,emphasis:xt,strikethrough:ht,insert:yt,subscript:ft,superscript:pt,checkbox:b,checkbox_input:b,hardbreak:bt,math_inline:dt,reference:mt,list:Nt,math_block:ct,table:Et},o);return{__sfc:!0,props:t,containerClass:n,overrides:o,nodeComponents:r,getNodeComponent:function(e){return r[e]||Bt}}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("div",e._b({class:n.containerClass},"div",e.node.attrs,!1),e._l(e.node.children,function(o,r){return t(n.getNodeComponent(o.type),{key:`${e.indexKey||"vmr-container"}-${r}`,tag:"component",attrs:{"custom-id":n.props.customId,node:o,"index-key":`${e.indexKey||"vmr-container"}-${r}`}})}),1)},[],!1,null,"3cd2aff2",null,null).exports,Ot=new Set(["node","key","ref","ctx","renderNode","indexKey","__proto__","prototype","constructor"]);function zt(e,t={}){var n;const o={},r=new Set(null!=(n=t.omit)?n:[]);if(!e||"object"!=typeof e)return o;const l=Object.getOwnPropertyDescriptors(e);for(const[i,a]of Object.entries(l))Ot.has(i)||r.has(i)||a.enumerable&&"value"in a&&(o[i]=a.value);return o}const Pt=M(m.defineComponent({__name:"LegacyNodesRenderer",props:{nodes:null,customId:null,indexKey:null,typewriter:{type:Boolean,default:!1},fade:{type:Boolean,default:!0},showTooltips:{type:Boolean,default:!0},codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:null,codeBlockLightTheme:null,codeBlockMinWidth:null,codeBlockMaxWidth:null,codeBlockOptions:null,codeBlockProps:null,renderCodeBlocksAsPre:{type:Boolean},themes:null,isDark:{type:Boolean},customHtmlTags:null,htmlPolicy:null},emits:["copy","copy-code","handleArtifactClick","click"],setup(e,{emit:t}){const n=e;function o(e){return"undefined"!=typeof Event&&e instanceof Event}m.provide("markstreamTypewriter",m.computed(()=>!0===n.typewriter)),m.provide("markstreamFade",m.computed(()=>!1!==n.fade));const r={text:ke,paragraph:jt,heading:Ct,code_block:st,list:Nt,list_item:Tt,blockquote:Rt,table:Et,definition_list:C,footnote:Mt,footnote_reference:j,footnote_anchor:kt,admonition:Jt,vmr_container:At,hardbreak:bt,link:gt,image:ue,thematic_break:Lt,math_inline:dt,math_block:ct,strong:vt,emphasis:xt,strikethrough:ht,highlight:wt,insert:yt,subscript:ft,superscript:pt,emoji:T,checkbox:b,checkbox_input:b,inline_code:F,html_inline:U,html_block:St,reference:mt},l=m.computed(()=>(I.value,S(n.customId))),i=m.computed(()=>null!=n.indexKey?String(n.indexKey):"legacy-renderer"),a=m.computed(()=>zt(n.codeBlockProps)),d=m.computed(()=>zt(n.codeBlockProps)),f=m.computed(()=>{var e,t;return u(s(u(s({stream:n.codeBlockStream,darkTheme:n.codeBlockDarkTheme,lightTheme:n.codeBlockLightTheme,themes:n.themes,minWidth:n.codeBlockMinWidth,maxWidth:n.codeBlockMaxWidth},d.value),{showLineNumbers:"boolean"==typeof d.value.showLineNumbers?d.value.showLineNumbers:"boolean"==typeof(null==(e=n.codeBlockOptions)?void 0:e.disableLineNumbers)&&!n.codeBlockOptions.disableLineNumbers}),(null==(t=n.codeBlockOptions)?void 0:t.overflow)?{style:{whiteSpace:"scroll"===n.codeBlockOptions.overflow?"pre":"pre-wrap"}}:{}),{codeBlockOptions:n.codeBlockOptions})}),v=m.computed(()=>u(s(s({},f.value),a.value),{codeBlockOptions:n.codeBlockOptions})),h=m.computed(()=>{var e;return{typewriter:n.typewriter,fade:n.fade,htmlPolicy:null!=(e=n.htmlPolicy)?e:"safe"}}),g=m.computed(()=>s(s({},h.value),"boolean"==typeof n.showTooltips?{showTooltip:n.showTooltips}:{})),y=m.computed(()=>s(s({},h.value),"boolean"==typeof n.showTooltips?{showTooltips:n.showTooltips}:{})),w=m.computed(()=>new Set(c.normalizeCustomHtmlTags(n.customHtmlTags))),x=m.computed(()=>(Array.isArray(n.nodes)?n.nodes:[]).map((e,t)=>{var n,o,a,d;let m=e;const p=String((null==e?void 0:e.type)||"unknown"),f=k(m);let v=N(m,f);if(("html_block"===m.type||"html_inline"===m.type)&&v===r[m.type]){const e=String(null!=(n=m.tag)?n:"").trim().toLowerCase()||c.getHtmlTagFromContent(m.content);if(e)if(w.value.has(e)){const t=l.value[e];t&&(v=t,m=u(s({},m),{type:e,tag:e,content:c.stripCustomHtmlWrapper(m.content,e)}))}else if(c.shouldRenderUnknownHtmlTagAsText(null!=(o=m.content)?o:m.raw,e)){const e=String(null!=(d=null!=(a=m.content)?a:m.raw)?d:"");"html_inline"===m.type?(v=ke,m={type:"text",content:e,raw:e}):(v=jt,m={type:"paragraph",children:[{type:"text",content:e,raw:e}],raw:e})}}return{index:t,indexKey:`${i.value}-${t}`,renderKey:"code_block"===p?`${i.value}-${t}-${p}`:`${i.value}-${t}-${p}-${String((null==e?void 0:e.raw)||"").length}`,node:m,isCodeBlock:"code_block"===(null==m?void 0:m.type),component:v,bindings:E(m,f,v)}}));function k(e){var t;return"code_block"===(null==e?void 0:e.type)?String(null!=(t=e.language)?t:"").trim().toLowerCase():""}function M(e,t){const n=t.trim().toLowerCase();if(n)for(const o of[n,ze(n),p.normalizeShikiLanguage(n)]){const t=o&&e[o];if(t)return t}}function N(e,t){if(!e)return Bt;const o=l.value,i=o[String(e.type)];if("code_block"===e.type){const r=null!=t?t:k(e),l=r?M(o,r):void 0;return l||("mermaid"===r?o.mermaid||st:"infographic"===r?o.infographic||st:"d2"===r||"d2lang"===r?o.d2||st:i||(o.code_block||(n.renderCodeBlocksAsPre,st)))}return i||r[String(e.type)]||Bt}function _(e){return Boolean(e&&e===l.value.code_block)}function D(e,t){return Boolean(e&&t&&e===M(l.value,t))}function E(e,t,n){const o=null!=t?t:k(e);return"code_block"===e.type&&D(n,o)?"mermaid"===o||"infographic"===o||"d2"===o||"d2lang"===o?{}:v.value:"code_block"===e.type&&_(n)?v.value:"mermaid"===o||"infographic"===o||"d2"===o||"d2lang"===o?{}:"link"===e.type?g.value:"list"===e.type?y.value:"code_block"===e.type?f.value:h.value}return{__sfc:!0,props:n,emit:t,isNativeDomEvent:o,handleCopy:function(e){if(!o(e))return"string"==typeof e?(t("copy-code",e),void t("copy",e)):void t("copy",e)},handleArtifactClick:function(e){t("handleArtifactClick",e)},nodeComponents:r,customComponentsMap:l,indexPrefix:i,codeBlockExtraProps:a,builtinCodeBlockExtraProps:d,codeBlockBindings:f,customCodeBlockBindings:v,nonCodeBindings:h,linkBindings:g,listBindings:y,effectiveCustomHtmlTagsSet:w,renderedItems:x,getCodeBlockLanguage:k,getCustomCodeLanguageComponent:M,getNodeComponent:N,isCustomCodeBlockComponent:_,isCustomLanguageCodeBlockComponent:D,getBindingsFor:E,handleClick:function(e){t("click",e)}}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("div",{staticClass:"markstream-vue2 markdown-renderer legacy-nodes-renderer",class:{dark:n.props.isDark},on:{click:n.handleClick}},e._l(n.renderedItems,function(o){return t("div",{key:o.renderKey,staticClass:"node-slot",attrs:{"data-node-index":o.index,"data-node-type":o.node.type}},[t("div",{staticClass:"node-content"},[t(o.component,e._b({key:`${o.renderKey}-component`,tag:"component",attrs:{node:o.node,loading:o.node.loading,"index-key":o.indexKey,"custom-id":n.props.customId,"is-dark":n.props.isDark},on:{copy:n.handleCopy,"handle-artifact-click":n.handleArtifactClick}},"component",o.bindings,!1))],1)])}),0)},[],!1,null,null,null,null).exports,Rt=M(m.defineComponent({__name:"BlockquoteNode",props:{node:null,indexKey:null,typewriter:{type:Boolean},customId:null},setup(e){const t=e,n=m.getCurrentInstance(),o=m.computed(()=>w(null==n?void 0:n.proxy)?Pt:Zt);return{__sfc:!0,props:t,instance:n,nestedRenderer:o}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("blockquote",{staticClass:"blockquote",attrs:{dir:"auto",cite:e.node.cite}},[t(n.nestedRenderer,{tag:"component",attrs:{"index-key":`blockquote-${n.props.indexKey}`,nodes:n.props.node.children||[],"custom-id":n.props.customId,typewriter:n.props.typewriter},on:{copy:function(t){return e.$emit("copy",t)}}})],1)},[],!1,null,"0bfb818f",null,null).exports;function Ht(e){try{if("undefined"!=typeof globalThis&&"function"==typeof globalThis.requestAnimationFrame)return globalThis.requestAnimationFrame(e)}catch(t){}return globalThis.setTimeout(e,0)}function $t(e){try{if(null==e)return;if("undefined"!=typeof globalThis&&"function"==typeof globalThis.cancelAnimationFrame)return void globalThis.cancelAnimationFrame(e)}catch(t){}try{globalThis.clearTimeout(e)}catch(t){}}const Ut=M(m.defineComponent({__name:"Portal",props:{to:null},setup(e){const t=e,n=m.ref(null);function o(){return"undefined"==typeof document?null:t.to&&"body"!==t.to?document.querySelector(t.to):document.body}function r(){const e=n.value;if(!e)return;const t=o();t&&e.parentElement!==t&&t.appendChild(e)}return m.onMounted(()=>{r()}),m.watch(()=>t.to,()=>{r()}),m.onBeforeUnmount(()=>{}),{__sfc:!0,props:t,rootRef:n,resolveTarget:o,moveToTarget:r}}}),function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",{ref:"rootRef",staticClass:"portal-root"},[e._t("default")],2)},[],!1,null,"5b7455c5",null,null).exports,Ft=M(m.defineComponent({__name:"HtmlPreviewFrame",props:{code:null,isDark:{type:Boolean},htmlPreviewAllowScripts:{type:Boolean},htmlPreviewSandbox:null,onClose:null,title:null},setup(e){var t;const n=e,o=void 0!=={url:"undefined"==typeof document?require("url").pathToFileURL(__filename).href:v&&"SCRIPT"===v.tagName.toUpperCase()&&v.src||new URL("index.cjs",document.baseURI).href}&&Boolean(null==(t={BASE_URL:"/",MODE:"npm",DEV:!1,PROD:!0,SSR:!1})?void 0:t.DEV);let r=null;function l(e){return new Set(e.trim().toLowerCase().split(/\s+/).filter(Boolean))}function i(e){if(!o||"undefined"==typeof console||r===e)return;const t=l(e);t.has("allow-scripts")&&t.has("allow-same-origin")&&(r=e,console.warn("[markstream-vue2] htmlPreviewSandbox contains both allow-scripts and allow-same-origin. Use this only for fully trusted content served from an isolated origin."))}function a(e,t){return"string"==typeof e?(i(e),e):void 0!==e?"":!0===t?"allow-scripts":""}const{t:s}=se(),u=m.computed(()=>{const e=n.code||"",t=e.trim().toLowerCase();return t.startsWith("<!doctype")||t.startsWith("<html")||t.startsWith("<body")?e:`<!doctype html>\n<html lang="en">\n <head>\n <meta charset="utf-8" />\n <meta name="viewport" content="width=device-width, initial-scale=1" />\n <style>\n html, body {\n margin: 0;\n padding: 0;\n height: 100%;\n background-color: ${n.isDark?"#020617":"#ffffff"};\n color: ${n.isDark?"#e5e7eb":"#020617"};\n }\n body {\n font-family: system-ui, -apple-system, BlinkMacSystemFont, 'SF Pro Text', ui-sans-serif, sans-serif;\n }\n </style>\n </head>\n <body>\n ${e}\n </body>\n</html>`}),d=m.computed(()=>a(n.htmlPreviewSandbox,n.htmlPreviewAllowScripts));function c(e){var t;"Escape"!==e.key&&"Esc"!==e.key||null==(t=n.onClose)||t.call(n)}return m.onMounted(()=>{"undefined"!=typeof window&&window.addEventListener("keydown",c)}),m.onUnmounted(()=>{"undefined"!=typeof window&&window.removeEventListener("keydown",c)}),{__sfc:!0,props:n,isDevEnv:o,lastWarnedDangerousSandbox:r,normalizeSandboxTokens:l,warnDangerousHtmlPreviewSandbox:i,resolveHtmlPreviewSandboxValue:a,t:s,srcdoc:u,sandboxValue:d,handleKeydown:c,Portal:Ut}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t(n.Portal,{attrs:{to:"body"}},[t("div",{staticClass:"markstream-vue2"},[t("div",{staticClass:"html-preview-frame__backdrop",class:{"html-preview-frame__backdrop--dark":n.props.isDark},on:{click:function(e){var t,o;null==(o=(t=n.props).onClose)||o.call(t)}}},[t("div",{staticClass:"html-preview-frame",class:{"html-preview-frame--dark":n.props.isDark},on:{click:function(e){e.stopPropagation()}}},[t("div",{staticClass:"html-preview-frame__header"},[t("div",{staticClass:"html-preview-frame__title"},[t("span",{staticClass:"html-preview-frame__dot"}),t("span",{staticClass:"html-preview-frame__label"},[e._v(e._s(n.props.title||n.t("common.preview")||"Preview"))])]),t("button",{staticClass:"html-preview-frame__close",class:{"html-preview-frame__close--dark":n.props.isDark},attrs:{type:"button"},on:{click:function(e){var t,o;null==(o=(t=n.props).onClose)||o.call(t)}}},[e._v(" × ")])]),t("iframe",{staticClass:"html-preview-frame__iframe",attrs:{sandbox:n.sandboxValue,referrerpolicy:"no-referrer",srcdoc:n.srcdoc}})])])])])},[],!1,null,"56f5a269",null,null).exports,Yt=M(m.defineComponent({__name:"CodeBlockNode",props:{node:{type:Object,required:!0},isDark:{type:Boolean,default:!1},loading:{type:Boolean,default:!0},stream:{type:Boolean,default:!0},codeBlockOptions:{type:Object,default:void 0},showLineNumbers:{type:Boolean,default:void 0},theme:{type:[Object,String],default:void 0},darkTheme:{type:String,default:void 0},lightTheme:{type:String,default:void 0},isShowPreview:{type:Boolean,default:!0},enableFontSizeControl:{type:Boolean,default:!0},minWidth:{type:[String,Number],default:void 0},maxWidth:{type:[String,Number],default:void 0},themes:{type:Array,default:void 0},showHeader:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExpandButton:{type:Boolean,default:!0},showPreviewButton:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},showFontSizeButtons:{type:Boolean,default:!0},showTooltips:{type:Boolean,default:void 0},htmlPreviewAllowScripts:{type:Boolean,default:void 0},htmlPreviewSandbox:{type:String,default:void 0},customId:{type:String,default:void 0},estimatedHeightPx:{type:Number,default:void 0},estimatedContentHeightPx:{type:Number,default:void 0},estimatedDiffInline:{type:Boolean,default:void 0}},emits:["previewCode","copy"],setup(e,{emit:t}){var n,o;const r=e,l=m.getCurrentInstance(),i=m.computed(()=>{var e,t,n,o,r,i,a,s,u,d;const c=null==l?void 0:l.proxy,m=null!=(e=null==c?void 0:c.$listeners)?e:{};if(m.previewCode||m["preview-code"])return!0;const p=null!=(a=null!=(i=null==(n=null==(t=null==c?void 0:c.$vnode)?void 0:t.data)?void 0:n.on)?i:null==(r=null==(o=null==c?void 0:c.$vnode)?void 0:o.componentOptions)?void 0:r.listeners)?a:{};if(p.previewCode||p["preview-code"])return!0;const f=null!=(d=null==(s=null==c?void 0:c.$vnode)?void 0:s.props)?d:null==(u=null==l?void 0:l.vnode)?void 0:u.props;return!(!f||!f.onPreviewCode&&!f.onPreviewcode)}),{t:a}=se(),c=m.ref(null),p=m.ref(null),f=m.ref(!1),h=m.ref(ze(r.node.language)),g=m.computed(()=>Pe(h.value)),y=m.computed(()=>"plaintext"===g.value),w=m.ref(!1),x=m.ref(!1),k=m.ref(!1),M=m.ref(!1),b=m.ref(!1),C=m.ref(null);let T=0;const N=It();let _=null;const D=m.ref("undefined"==typeof window);"undefined"!=typeof window&&m.watch(()=>p.value,e=>{if(null==_||_.destroy(),_=null,!e)return void(D.value=!1);const t=N(e,{rootMargin:"400px"});_=t,D.value=t.isVisible.value,t.whenVisible.then(()=>{D.value=!0})},{immediate:!0}),m.onBeforeUnmount(()=>{null==_||_.destroy(),_=null});let I=null,S=null,j=()=>{},E=()=>{},L=()=>null,B=()=>({getModel:()=>({getLineCount:()=>1}),getOption:()=>14,updateOptions:()=>{}}),A=()=>({getModel:()=>({getLineCount:()=>1}),getOption:()=>14,updateOptions:()=>{}}),O=()=>{},z=()=>{},P=()=>{},R=null,H=0,$=()=>{var e;return String(null!=(e=r.node.language)?e:"plaintext")},U=()=>d(this,null,function*(){}),F=null,Y=null,K=null,W=!1,Q=null;const V=m.computed(()=>r.node.diff),X='"SF Mono", Monaco, Consolas, "Ubuntu Mono", "Liberation Mono", "Courier New", monospace',q=12;function G(e){return"number"==typeof e&&Number.isFinite(e)&&e>0?e:void 0}function Z(e){var t;const n=null!=(t=G(e))?t:0;return{top:n,bottom:n}}const J=m.computed(()=>{var e;return null!=(e=r.codeBlockOptions)?e:{}}),ee=m.computed(()=>{var e;return null!=(e=r.showLineNumbers)?e:!0!==J.value.disableLineNumbers}),te=m.computed(()=>{const e=s({},J.value);for(const n of["maxHeight","padding","tabSize","theme","themes","themeType","language","languages","stream","disableFileHeader","onThemeChange","renderCustomHeader","renderHeaderMetadata","renderHeaderPrefix"])delete e[n];if(!V.value)return e;const t=e.parseDiffOptions&&"object"==typeof e.parseDiffOptions?e.parseDiffOptions:{};return u(s({diffStyle:"split",expandUnchanged:!1,collapsedContextThreshold:5,hunkSeparators:"line-info"},e),{parseDiffOptions:s({context:2},t)})}),ne=m.computed(()=>V.value?"diff":"single"),oe=m.ref(ne.value),ie=m.ref(!1),ae=m.ref(!1),ue=void 0!=={url:"undefined"==typeof document?require("url").pathToFileURL(__filename).href:v&&"SCRIPT"===v.tagName.toUpperCase()&&v.src||new URL("index.cjs",document.baseURI).href}&&Boolean(null==(n={BASE_URL:"/",MODE:"npm",DEV:!1,PROD:!0,SSR:!1})?void 0:n.DEV);function de(e){K=e,Y=lt();const t=e(Y);I=t.createEditor||I,S=t.createDiffEditor||S,j=t.updateCode||j,E=t.updateDiff||E,L=t.getEditor||L,B=t.getEditorView||B,A=t.getDiffEditorView||A,O=t.cleanupEditor||O,z=t.safeClean||t.cleanupEditor||z,P=t.refreshDiffPresentation||P,U=t.setTheme||U,F=t.whenVisualReady||null,b.value=!0}"undefined"!=typeof window&&(()=>{d(this,null,function*(){try{const e=yield Te();if(!e)return ue&&console.warn("[markstream-vue2] stream-diffs is not installed. Code blocks will use basic rendering. Install stream-diffs for enhanced code editor features."),void(ie.value=!0);const t=e.createCodeBlockRuntime,n=e.detectLanguage;"function"==typeof n&&($=n),"function"==typeof t&&(de(t),c.value&&(yield Fe(c.value)))}catch(e){ue&&console.warn("[markstream-vue2] Failed to initialize stream-diffs:",e),ie.value=!0}})})();const ce=m.ref("number"==typeof(null==(o=te.value)?void 0:o.fontSize)?te.value.fontSize:q),me=m.ref(ce.value),pe=m.computed(()=>{const e=ce.value,t=me.value;return"number"==typeof e&&Number.isFinite(e)&&e>0&&"number"==typeof t&&Number.isFinite(t)&&t>0});function fe(){return new Promise(e=>{let t=!1,n=null,o=null;const r=()=>{t||(t=!0,null!=o&&globalThis.clearTimeout(o),null!=n&&$t(n),e())};o=globalThis.setTimeout(r,50),n=Ht(r)})}function ve(){return d(this,null,function*(){var e;if(F)try{return!!(yield F())&&(yield m.nextTick(),yield fe(),!W)}catch(t){return!1}for(let n=0;n<30;n++){if(W)return!1;if(null==(e=c.value)?void 0:e.querySelector("diffs-container, .stream-diffs-shell"))return yield m.nextTick(),yield fe(),!W;yield m.nextTick(),yield fe()}return!1})}function he(){var e,t,n,o,r;try{const l=V.value?null!=(n=null==(t=null==(e=A())?void 0:e.getModifiedEditor)?void 0:t.call(e))?n:A():B(),i=L(),a=null==(o=null==i?void 0:i.EditorOption)?void 0:o.fontInfo;if(l&&null!=a){const e=null==(r=l.getOption)?void 0:r.call(l,a),t=null==e?void 0:e.fontSize;if("number"==typeof t&&Number.isFinite(t)&&t>0)return t}}catch(l){}return null}function ge(e){var t,n;try{const o=L(),r=null==(t=null==o?void 0:o.EditorOption)?void 0:t.lineHeight;if(null!=r){const t=null==(n=null==e?void 0:e.getOption)?void 0:n.call(e,r);if("number"==typeof t&&t>0)return t}}catch(r){}const o=Number.isFinite(me.value)&&me.value>0?me.value:12;return Math.max(12,Math.round(1.35*o))}function ye(){var e;if(Number.isFinite(me.value)&&me.value>0&&Number.isFinite(ce.value))return me.value;const t=he();return"number"==typeof(null==(e=te.value)?void 0:e.fontSize)?(ce.value=te.value.fontSize,me.value=te.value.fontSize,me.value):t&&t>0?(ce.value=t,me.value=t,t):(ce.value=12,me.value=12,12)}function we(){var e,t;const n=c.value;if(!n)return null;const o=n.querySelector("diffs-container"),r=null==o?void 0:o.shadowRoot,l=null!=(e=null==r?void 0:r.querySelector("pre[data-file], [data-diff]"))?e:n.querySelector(".stream-diffs-shell"),i=null!=(t=null==l?void 0:l.getBoundingClientRect().height)?t:0;return Number.isFinite(i)&&i>0?Math.ceil(i):null}function xe(){var e,t,n,o,r,l,i,a,s,u,d,c,m,p;const f=we();if(null!=f)return f;try{const f=V.value?A():B();if(!f)return null;if(V.value&&(null==f?void 0:f.getOriginalEditor)&&(null==f?void 0:f.getModifiedEditor)){const m=null==(e=f.getOriginalEditor)?void 0:e.call(f),p=null==(t=f.getModifiedEditor)?void 0:t.call(f);null==(n=null==m?void 0:m.layout)||n.call(m),null==(o=null==p?void 0:p.layout)||o.call(p);const v=(null==(r=null==m?void 0:m.getContentHeight)?void 0:r.call(m))||0,h=(null==(l=null==p?void 0:p.getContentHeight)?void 0:l.call(p))||0,g=Math.max(v,h);if(g>0)return Math.ceil(g+1);const y=(null==(s=null==(a=null==(i=null==m?void 0:m.getModel)?void 0:i.call(m))?void 0:a.getLineCount)?void 0:s.call(a))||1,w=(null==(c=null==(d=null==(u=null==p?void 0:p.getModel)?void 0:u.call(p))?void 0:d.getLineCount)?void 0:c.call(d))||1,x=Math.max(y,w),k=Math.max(ge(m),ge(p));return Math.ceil(x*(k+1.5)+0+1)}if(null==f?void 0:f.getContentHeight){null==(m=null==f?void 0:f.layout)||m.call(f);const e=f.getContentHeight();if(e>0)return Math.ceil(e+1)}const v=null==(p=null==f?void 0:f.getModel)?void 0:p.call(f);let h=1;v&&"function"==typeof v.getLineCount&&(h=v.getLineCount());const g=ge(f);return Math.ceil(h*(g+1.5)+0+1)}catch(v){return null}}function ke(){var e;const t=c.value,n=p.value;if(!t||!n)return;const o=t,r=J.value,l=null!=(e=G(r.tabSize))?e:4;o.style.setProperty("--diffs-tab-size",String(l));const i=r.padding;"number"==typeof i?o.style.setProperty("--diffs-gap-block",`${i}px`):o.style.removeProperty("--diffs-gap-block")}const Me=/auto|scroll|overlay/i;function be(e){var t,n;if("undefined"==typeof window)return null;const o=null!=(t=null==e?void 0:e.ownerDocument)?t:document,r=o.scrollingElement||o.documentElement||o.body;let l=null!=(n=null==e?void 0:e.parentElement)?n:null;for(;l&&l!==o.body&&l!==r;){const e=window.getComputedStyle(l),t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();if(Me.test(t)||Me.test(n))return l;l=l.parentElement}return r}function Ce(e,t,n){var o;if("undefined"==typeof window)return;const r=Math.ceil(t),l=Math.ceil(n)-r;if(!l)return;const i=be(e);if(!i)return;const a=null!=(o=e.ownerDocument)?o:document,s=i===a.body||i===a.documentElement||i===a.scrollingElement,u=s?0:i.getBoundingClientRect().top;e.getBoundingClientRect().top-u>=0||(s&&"function"==typeof window.scrollBy?window.scrollBy(0,l):i.scrollTop+=l)}function Ne(){try{const e=c.value;if(!e)return;const t=e.getBoundingClientRect().height,n=xe();if(null!=n&&n>0){const o=Math.ceil(n);e.style.minHeight="0px",e.style.height=`${o}px`,e.style.maxHeight="none",e.style.overflow="visible",Ce(e,t,o)}}catch(e){}}function _e(){null==Q&&(Q=Ht(()=>{Q=null,Ht(()=>{x.value||(w.value?Ne():Ie())})}))}function De(e,t,n){const o=Math.min(t,n),r=t>n+1;return e.style.minHeight="0px",e.style.height=`${Math.ceil(o)}px`,e.style.maxHeight=`${Math.ceil(n)}px`,e.style.overflow=r?"auto":"hidden",Math.ceil(o)}function Ie(){var e;try{const t=c.value;if(!t)return;const n=t.getBoundingClientRect().height,o=Se();if(T>0&&(T--,null!=C.value))return void Ce(t,n,De(t,C.value,o));const r=xe();if(null!=r&&r>0)return void Ce(t,n,De(t,r,o));if(null!=C.value)return void Ce(t,n,De(t,C.value,o));const l=Math.ceil((null==(e=t.getBoundingClientRect)?void 0:e.call(t).height)||0);if(l>0)return void Ce(t,n,De(t,l,o));const i=Number.parseFloat(t.style.height);!Number.isNaN(i)&&i>0?Ce(t,n,De(t,i,o)):Ce(t,n,De(t,o,o))}catch(t){}}function Se(){var e;return null!=(e=J.value.maxHeight)?e:500}const je=m.computed(()=>r.isShowPreview&&("html"===h.value||"svg"===h.value));m.watch(()=>r.node.language,e=>{h.value=ze(e)}),m.watch(()=>[r.node.originalCode,r.node.updatedCode,g.value,V.value],e=>d(this,[e],function*([e,t,n,o]){if(!1!==r.stream&&o){if(I&&!k.value&&c.value)try{yield Fe(c.value)}catch(l){}E(String(null!=e?e:""),String(null!=t?t:""),g.value),_e()}})),m.watch(()=>r.node.code,e=>d(this,null,function*(){if(!1!==r.stream&&(h.value||(h.value=ze($(e))),!V.value)){if(I&&!k.value&&c.value)try{yield Fe(c.value)}catch(t){}j(e,g.value),w.value&&_e()}}));const Le=m.computed(()=>{const e=h.value;return e?He[e]||e.charAt(0).toUpperCase()+e.slice(1):He[""]||"Plain Text"}),Be=m.computed(()=>(Ee.value,Re(h.value||""))),Ae=m.computed(()=>{if(!V.value)return{color:"var(--code-fg, var(--markstream-code-fallback-fg))",backgroundColor:"var(--code-header-bg, transparent)"}}),Oe=m.computed(()=>!1!==r.showTooltips);function $e(e){const t=e.currentTarget||e.target;return!t||t.disabled?null:t}function Ue(e,t){return d(this,null,function*(){var n,o,l;if(!I||W||t!==H)return;if(it(),V.value?(z(),S?yield S(e,String(null!=(n=r.node.originalCode)?n:""),String(null!=(o=r.node.updatedCode)?o:""),g.value):yield I(e,r.node.code,g.value)):yield I(e,r.node.code,g.value),W||t!==H)return;const i=V.value?A():B();if("number"==typeof(null==(l=te.value)?void 0:l.fontSize))null==i||i.updateOptions({fontSize:te.value.fontSize}),ce.value=te.value.fontSize,me.value=te.value.fontSize;else{const e=he();e&&e>0?(ce.value=e,me.value=e):(ce.value=12,me.value=12)}if(w.value||x.value||_e(),!1===r.loading){if(yield m.nextTick(),W||t!==H)return;Ht(()=>{W||t!==H||_e()})}const a=yield ve();W||t!==H||(!a||x.value||w.value||Ie(),M.value=a)})}function Fe(e){if(!I)return null;if(R)return R;k.value=!0,M.value=!1;const t=H,n=(()=>d(this,null,function*(){yield Ue(e,t)}))().finally(()=>{R===n&&(R=null)});return R=n,n}m.watch(Oe,e=>{e||le()}),m.watch(()=>me.value,(e,t)=>{const n=V.value?A():B();n&&"number"==typeof e&&Number.isFinite(e)&&e>0&&(n.updateOptions({fontSize:e}),w.value&&!x.value&&_e())},{flush:"post",immediate:!1});const Ye=m.watch(()=>[c.value,V.value,r.stream,r.loading,b.value,D.value],e=>d(this,[e],function*([e,t,n,o,r,l]){if(!e||!I)return;if(!l)return;if(!1===n&&!1!==o)return;const i=Fe(e);if(!i)return;const a=H;try{yield i}catch(s){if(!W&&a===H)throw s;return}W||a!==H||Ye()}));function Ke(){return"string"==typeof r.theme?r.theme:r.theme&&"object"==typeof r.theme?r.isDark?r.theme.dark:r.theme.light:r.isDark?r.darkTheme:r.lightTheme}function We(e){return"string"==typeof e?e:null}m.watch(ne,(e,t)=>d(this,null,function*(){if(e!==t&&(oe.value=e,I&&c.value&&k.value&&(!1!==r.stream||!1===r.loading)&&D.value))try{k.value=!1,H+=1,R=null,z(),yield m.nextTick(),yield Fe(c.value)}catch(n){k.value=!1}}));const Qe=m.computed(()=>{var e,t;return Array.isArray(r.themes)&&"string"==typeof r.themes[0]&&"string"==typeof r.themes[1]?[r.themes[0],r.themes[1]]:[null!=(e=r.darkTheme)?e:"vitesse-dark",null!=(t=r.lightTheme)?t:"vitesse-light"]});function Ve(){var e;return null!=(e=Ke())?e:r.isDark?Qe.value[0]:Qe.value[1]}function Xe(){it();const e=Ve(),t=()=>{V.value&&P(),Ht(()=>{ke(),_e()})};e?Promise.resolve(U(e)).then(t).catch(()=>{}):t()}function qe(e){var t;const n=(null!=(t=We(e))?t:"").toLowerCase();return n?["dark","night","moon","black","dracula","mocha","frappe","macchiato","palenight","ocean","poimandres","monokai","laserwave","tokyo","slack-dark","rose-pine","github-dark","material-theme","one-dark","catppuccin-mocha","catppuccin-frappe","catppuccin-macchiato"].some(e=>n.includes(e))&&!["light","latte","dawn","lotus"].some(e=>n.includes(e)):!!r.isDark}const Ge=m.computed(()=>qe(Ve())),Ze=m.computed(()=>Ge.value?"dark":"light"),Je=m.computed(()=>V.value?"dark"===Ze.value:Ge.value),et=m.computed(()=>{var e,t,n;const o=J.value,r=Number.isFinite(me.value)&&me.value>0?me.value:q,l=null!=(e=G(null==o?void 0:o.fontSize))?e:r,i=null!=(t=G(null==o?void 0:o.lineHeight))?t:l===q?18:Math.max(12,Math.round(1.5*l)),a="string"==typeof(null==o?void 0:o.fontFamily)&&o.fontFamily.trim()?o.fontFamily.trim():X,s=Z(null==o?void 0:o.padding),u=V.value?0:8,d="number"==typeof o.padding,c=null!=(n=G(null==o?void 0:o.tabSize))?n:4;return{fontFamily:a,fontSize:l,lineHeight:i,paddingBottom:d?s.bottom:u,paddingTop:d?s.top:u,tabSize:c}}),tt=m.computed(()=>{var e;return!!V.value&&("boolean"==typeof r.estimatedDiffInline?r.estimatedDiffInline:"unified"===(null==(e=te.value)?void 0:e.diffStyle))}),nt=m.computed(()=>{const e=et.value,t={"--markstream-pre-line-number-top":`${e.paddingTop}px`,fontSize:`${e.fontSize}px`,lineHeight:`${e.lineHeight}px`,paddingBottom:`${e.paddingBottom}px`,paddingTop:`${e.paddingTop}px`,tabSize:e.tabSize,maxHeight:`${Se()}px`,overflow:"auto",whiteSpace:"scroll"===J.value.overflow?"pre":"pre-wrap"};return V.value&&(t["--markstream-code-padding-left"]="62px",t["--markstream-pre-diff-line-height"]=`${e.lineHeight}px`,t["--markstream-pre-line-number-width"]="36px",t["--markstream-pre-line-number-gap"]="0px"),e.fontFamily&&(t.fontFamily=e.fontFamily),t}),ot=m.computed(()=>{var e;const t={},n=e=>{if(null!=e)return"number"==typeof e?`${e}px`:String(e)},o=n(r.minWidth),l=n(r.maxWidth);if(o&&(t.minWidth=o),l&&(t.maxWidth=l),!M.value&&!x.value){const n=G(r.estimatedHeightPx);if(null!=n)t.minHeight=`${Math.ceil(n)}px`;else if(!V.value){const n=et.value,o=String(null!=(e=r.node.code)?e:"").replace(/(?:\r\n|\n|\r)$/,""),l=o?o.split(/\r\n|\n|\r/).length:1,i=Math.min(Se(),l*n.lineHeight+n.paddingTop+n.paddingBottom),a=2+(r.showHeader?41:0);t.minHeight=`${Math.ceil(i+a)}px`}}return V.value?(t.color="var(--markstream-diff-shell-fg)",t.borderColor="var(--markstream-diff-shell-border)"):(t.color="var(--vscode-editor-foreground, var(--markstream-code-fallback-fg))",t.backgroundColor="var(--vscode-editor-background, var(--markstream-code-fallback-bg))",t.borderColor="var(--markstream-code-border-color)"),t}),rt=m.computed(()=>{if(M.value||x.value)return;const e=G(r.estimatedContentHeightPx);return null==e?void 0:{minHeight:`${Math.ceil(Math.min(e,Se()))}px`}});function lt(){var e;const t=et.value,n=u(s(u(s({overflow:"wrap"},te.value||{}),{themes:[...Qe.value],stream:!1,disableFileHeader:!0,MAX_HEIGHT:null!=(e=J.value.maxHeight)?e:500,fontSize:t.fontSize,lineHeight:t.lineHeight}),t.fontFamily?{fontFamily:t.fontFamily}:{}),{disableLineNumbers:!ee.value,theme:Ve(),themeType:r.isDark?"dark":"light",onThemeChange(){ke()}}),o="string"==typeof n.unsafeCSS?n.unsafeCSS:"";return n.unsafeCSS=`[data-file], [data-diff] { --diffs-min-number-column-width-default: 2ch !important; }\n${o}`.trim(),n}function it(){const e=lt();if(!Y)return Y=e,Y;for(const t of Object.keys(Y))t in e||delete Y[t];return Object.assign(Y,e),Y}const at=m.ref(0),ut=m.computed(()=>String(at.value));let dt=!1;m.watch(()=>[r.codeBlockOptions,r.showLineNumbers],()=>{at.value+=1,!1===r.stream&&!1!==r.loading&&(dt=!0);const e=J.value.fontSize;"number"==typeof e?(ce.value=e,me.value=e):(ce.value=q,me.value=q)},{deep:!0}),m.watch(()=>[D.value],()=>{var e;if(it(),!I||!D.value)return;const t=V.value?A():B(),n=Number.isFinite(me.value)?me.value:void 0;"number"==typeof n&&Number.isFinite(n)&&n>0&&(null==(e=null==t?void 0:t.updateOptions)||e.call(t,{fontSize:n})),_e()},{deep:!0}),m.watch(()=>[r.isDark,r.darkTheme,r.lightTheme,r.themes,r.theme,b.value,k.value,D.value],()=>{b.value&&Xe()},{flush:"post"}),m.watch(()=>[ut.value,b.value,D.value],(e,t)=>d(this,[e,t],function*([e,t,n],[o]){if(it(),t&&n&&I&&c.value&&k.value&&e!==o)if(!1!==r.stream||!1===r.loading){dt=!1;try{k.value=!1,H+=1,R=null,z(),K&&de(K),yield m.nextTick(),yield Fe(c.value)}catch(l){k.value=!1}}else dt=!0}),{flush:"post"}),m.watch(()=>[r.loading,D.value],e=>d(this,[e],function*([e,t]){if(!1===e&&t&&dt&&(dt=!1,it(),yield m.nextTick(),I&&c.value&&k.value))try{k.value=!1,H+=1,R=null,z(),K&&de(K),yield m.nextTick(),yield Fe(c.value)}catch(n){k.value=!1}}),{flush:"post"});const ct=m.watch(()=>[r.loading,D.value],e=>d(this,[e],function*([e,t]){t&&(e||(yield m.nextTick(),Ht(()=>{x.value||(w.value?Ne():Ie()),ct()})))}),{immediate:!0,flush:"post"});return m.onUnmounted(()=>{W=!0,H+=1,R=null,null!=Q&&($t(Q),Q=null),O()}),{__sfc:!0,props:r,emits:t,instance:l,hasPreviewListener:i,t:a,codeEditor:c,container:p,copyText:f,codeLanguage:h,languageId:g,isPlainTextLanguage:y,isExpanded:w,isCollapsed:x,editorCreated:k,editorReady:M,runtimeReady:b,expandRafId:null,heightBeforeCollapse:C,resumeGuardFrames:T,registerVisibility:N,viewportHandle:_,viewportReady:D,createEditor:I,createDiffEditor:S,updateCode:j,updateDiffCode:E,getEditor:L,getEditorView:B,getDiffEditorView:A,cleanupEditor:O,safeClean:z,refreshDiffPresentation:P,createEditorPromise:R,editorCreationGeneration:H,detectLanguage:$,setTheme:U,whenRuntimeVisualReady:F,runtimeOptions:Y,createRuntimeHelpersFactory:K,isUnmounted:W,deferredEditorVisualSyncRafId:Q,isDiff:V,defaultPreFallbackFontFamily:X,defaultPreFallbackFontSize:q,defaultPreFallbackLineHeight:18,readPositiveNumber:G,readPadding:Z,resolvedCodeBlockOptions:J,effectiveShowLineNumbers:ee,resolvedRuntimeOptions:te,desiredEditorKind:ne,currentEditorKind:oe,usePreCodeRender:ie,showInlinePreview:ae,isDevEnv:ue,initializeRuntimeHelpers:de,codeFontMin:10,codeFontMax:36,codeFontStep:1,defaultCodeFontSize:ce,codeFontSize:me,fontBaselineReady:pe,CONTENT_PADDING:0,LINE_EXTRA_PER_LINE:1.5,PIXEL_EPSILON:1,waitForAnimationFrame:fe,waitForEditorVisualReady:ve,readActualFontSizeFromEditor:he,getLineHeightSafe:ge,ensureFontBaseline:ye,increaseCodeFont:function(){const e=ye(),t=Math.min(36,e+1);me.value=t},decreaseCodeFont:function(){const e=ye(),t=Math.max(10,e-1);me.value=t},resetCodeFont:function(){ye(),Number.isFinite(ce.value)&&(me.value=ce.value)},measureRenderedStaticSurfaceHeight:we,computeContentHeight:xe,syncEditorCssVars:ke,resizeSyncHandler:null,SCROLL_PARENT_OVERFLOW_RE:Me,resolveScrollRootElement:be,adjustScrollAfterHeightChange:Ce,updateExpandedHeight:Ne,scheduleEditorVisualSync:_e,applyCollapsedContainerHeight:De,updateCollapsedHeight:Ie,getMaxHeightValue:Se,isPreviewable:je,displayLanguage:Le,languageIcon:Be,headerStyle:Ae,tooltipsEnabled:Oe,copy:function(){return d(this,null,function*(){try{"undefined"!=typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.writeText&&(yield navigator.clipboard.writeText(r.node.code)),f.value=!0,t("copy",r.node.code),setTimeout(()=>{f.value=!1},1e3)}catch(e){console.error("复制失败:",e)}})},resolveTooltipTarget:$e,onBtnHover:function(e,t,n="top"){if(!Oe.value)return;const o=$e(e);if(!o)return;const l=e;re(o,t,n,!1,null!=(null==l?void 0:l.clientX)&&null!=(null==l?void 0:l.clientY)?{x:l.clientX,y:l.clientY}:void 0,r.isDark)},onBtnLeave:function(){Oe.value&&le()},onCopyHover:function(e){if(!Oe.value)return;const t=$e(e);if(!t)return;const n=e;re(t,f.value?a("common.copied")||"Copied":a("common.copy")||"Copy","top",!1,null!=(null==n?void 0:n.clientX)&&null!=(null==n?void 0:n.clientY)?{x:n.clientX,y:n.clientY}:void 0,r.isDark)},toggleExpand:function(e){if(w.value=!w.value,e&&Oe.value){const t=$e(e);t&&re(t,w.value?a("common.collapse")||"Collapse":a("common.expand")||"Expand","top",!1,void 0,r.isDark)}const t=V.value?A():B(),n=c.value;t&&n&&(w.value?(n.style.maxHeight="none",n.style.overflow="visible",Ne()):(n.style.overflow="auto",Ie()))},toggleHeaderCollapse:function(){var e,t,n;if(x.value=!x.value,x.value){if(c.value){const n=Math.ceil((null==(t=(e=c.value).getBoundingClientRect)?void 0:t.call(e).height)||0);n>0&&(C.value=n)}}else{c.value&&null!=C.value&&(c.value.style.height=`${C.value}px`);const e=V.value?A():B();try{null==(n=null==e?void 0:e.layout)||n.call(e)}catch(o){}T=2,_e()}},previewCode:function(){if(!je.value)return;const e=h.value;if(i.value){const n="html"===e?"text/html":"image/svg+xml",o="html"===e?a("artifacts.htmlPreviewTitle")||"HTML Preview":a("artifacts.svgPreviewTitle")||"SVG Preview";return void t("previewCode",{node:r.node,artifactType:n,artifactTitle:o,id:`temp-${e}-${Date.now()}`})}"html"===e&&(ae.value=!ae.value)},runEditorCreation:Ue,ensureEditorCreation:Fe,stopCreateEditorWatch:Ye,getPreferredColorScheme:Ke,getThemeName:We,runtimeThemes:Qe,resolveRequestedTheme:Ve,themeUpdate:Xe,themeLooksDark:qe,resolvedChromeIsDark:Ge,effectiveDiffAppearance:Ze,resolvedSurfaceIsDark:Je,preFallbackMetrics:et,preFallbackDiffInline:tt,preFallbackStyle:nt,containerStyle:ot,codeEditorContainerStyle:rt,buildRuntimeOptions:lt,syncRuntimeOptions:it,runtimeOptionsRevision:at,runtimeStructuralSignature:ut,deferredRuntimeOptionsRecreation:dt,stopLoadingWatch:ct,stopExpandAutoResize:function(){},PreCodeNode:st,HtmlPreviewFrame:Ft}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return n.usePreCodeRender?t(n.PreCodeNode,{staticClass:"code-pre-fallback",style:n.preFallbackStyle,attrs:{node:e.node,"show-line-numbers":n.effectiveShowLineNumbers,"diff-inline":n.preFallbackDiffInline}}):t("div",{ref:"container",staticClass:"code-block-container my-4 rounded-lg border overflow-hidden shadow-sm",class:[n.resolvedSurfaceIsDark?"border-gray-700/30 bg-gray-900":"border-gray-200 bg-white",{"is-rendering":n.props.loading,"is-dark":n.resolvedSurfaceIsDark,"is-diff":n.isDiff,"is-plain-text":n.isPlainTextLanguage}],style:n.containerStyle,attrs:{"data-markstream-code-block":"1","data-markstream-enhanced":n.editorReady?"true":"false","data-markstream-enhancement-state":n.editorReady?"ready":"pending"}},[n.props.showHeader?t("div",{staticClass:"code-block-header flex justify-between items-center",style:n.headerStyle},[e._t("header-left",function(){return[t("div",{staticClass:"code-header-main"},[t("span",{staticClass:"icon-slot h-4 w-4 flex-shrink-0",domProps:{innerHTML:e._s(n.languageIcon)}}),t("div",{staticClass:"code-header-copy"},[t("div",{staticClass:"code-header-title"},[e._v(" "+e._s(n.displayLanguage)+" ")])])])]}),e._t("header-right",function(){return[t("div",{staticClass:"code-header-actions"},[n.props.showCollapseButton?t("button",{staticClass:"code-action-btn transition-colors",attrs:{type:"button","aria-pressed":n.isCollapsed},on:{click:n.toggleHeaderCollapse,mouseenter:function(e){n.onBtnHover(e,n.isCollapsed?n.t("common.expand")||"Expand":n.t("common.collapse")||"Collapse")},focus:function(e){n.onBtnHover(e,n.isCollapsed?n.t("common.expand")||"Expand":n.t("common.collapse")||"Collapse")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"action-icon",style:{rotate:n.isCollapsed?"0deg":"90deg"},attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"}})])]):e._e(),n.props.showFontSizeButtons&&n.props.enableFontSizeControl?[t("button",{staticClass:"code-action-btn transition-colors",attrs:{type:"button",disabled:!!Number.isFinite(n.codeFontSize)&&n.codeFontSize<=n.codeFontMin},on:{click:function(e){return n.decreaseCodeFont()},mouseenter:function(e){n.onBtnHover(e,n.t("common.decrease")||"Decrease")},focus:function(e){n.onBtnHover(e,n.t("common.decrease")||"Decrease")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"action-icon",attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14"}})])]),t("button",{staticClass:"code-action-btn transition-colors",attrs:{type:"button",disabled:!n.fontBaselineReady||n.codeFontSize===n.defaultCodeFontSize},on:{click:function(e){return n.resetCodeFont()},mouseenter:function(e){n.onBtnHover(e,n.t("common.reset")||"Reset")},focus:function(e){n.onBtnHover(e,n.t("common.reset")||"Reset")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"action-icon",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("path",{attrs:{d:"M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8"}}),t("path",{attrs:{d:"M3 3v5h5"}})])])]),t("button",{staticClass:"code-action-btn transition-colors",attrs:{type:"button",disabled:!!Number.isFinite(n.codeFontSize)&&n.codeFontSize>=n.codeFontMax},on:{click:function(e){return n.increaseCodeFont()},mouseenter:function(e){n.onBtnHover(e,n.t("common.increase")||"Increase")},focus:function(e){n.onBtnHover(e,n.t("common.increase")||"Increase")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"action-icon",attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14m-7-7v14"}})])])]:e._e(),n.props.showCopyButton?t("button",{staticClass:"code-action-btn transition-colors",attrs:{type:"button","aria-label":n.copyText?n.t("common.copied")||"Copied":n.t("common.copy")||"Copy"},on:{click:n.copy,mouseenter:function(e){return n.onCopyHover(e)},focus:function(e){return n.onCopyHover(e)},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[n.copyText?t("svg",{staticClass:"action-icon",attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"}})]):t("svg",{staticClass:"action-icon",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("rect",{attrs:{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}}),t("path",{attrs:{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"}})])])]):e._e(),n.props.showExpandButton?t("button",{staticClass:"code-action-btn transition-colors",attrs:{type:"button","aria-pressed":n.isExpanded},on:{click:function(e){return n.toggleExpand(e)},mouseenter:function(e){n.onBtnHover(e,n.isExpanded?n.t("common.collapse")||"Collapse":n.t("common.expand")||"Expand")},focus:function(e){n.onBtnHover(e,n.isExpanded?n.t("common.collapse")||"Collapse":n.t("common.expand")||"Expand")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[n.isExpanded?t("svg",{staticClass:"action-icon",attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"}})]):t("svg",{staticClass:"action-icon",attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"}})])]):e._e(),n.isPreviewable&&n.props.showPreviewButton?t("button",{staticClass:"code-action-btn transition-colors",attrs:{type:"button","aria-label":n.t("common.preview")||"Preview"},on:{click:n.previewCode,mouseenter:function(e){n.onBtnHover(e,n.t("common.preview")||"Preview")},focus:function(e){n.onBtnHover(e,n.t("common.preview")||"Preview")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24"}},[t("g",{attrs:{fill:"currentColor","fill-rule":"evenodd","clip-rule":"evenodd"}},[t("path",{attrs:{d:"M23.628 7.41c-.12-1.172-.08-3.583-.9-4.233c-1.921-1.51-6.143-1.11-8.815-1.19c-3.481-.15-7.193.14-10.625.24a.34.34 0 0 0 0 .67c3.472-.05 7.074-.29 10.575-.09c2.471.15 6.653-.14 8.254 1.16c.4.33.41 2.732.49 3.582a42 42 0 0 1 .08 9.005a13.8 13.8 0 0 1-.45 3.001c-2.42 1.4-19.69 2.381-20.72.55a21 21 0 0 1-.65-4.632a41.5 41.5 0 0 1 .12-7.964c.08 0 7.334.33 12.586.24c2.331 0 4.682-.13 6.764-.21a.33.33 0 0 0 0-.66c-7.714-.16-12.897-.43-19.31.05c.11-1.38.48-3.922.38-4.002a.3.3 0 0 0-.42 0c-.37.41-.29 1.77-.36 2.251s-.14 1.07-.2 1.6a45 45 0 0 0-.36 8.645a21.8 21.8 0 0 0 .66 5.002c1.46 2.702 17.248 1.461 20.95.43c1.45-.4 1.69-.8 1.871-1.95c.575-3.809.602-7.68.08-11.496"}}),t("path",{attrs:{d:"M4.528 5.237a.84.84 0 0 0-.21-1c-.77-.41-1.71.39-1 1.1a.83.83 0 0 0 1.21-.1m2.632-.25c.14-.14.19-.84-.2-1c-.77-.41-1.71.39-1 1.09a.82.82 0 0 0 1.2-.09m2.88 0a.83.83 0 0 0-.21-1c-.77-.41-1.71.39-1 1.09a.82.82 0 0 0 1.21-.09m-4.29 8.735c0 .08.23 2.471.31 2.561a.371.371 0 0 0 .63-.14c0-.09 0 0 .15-1.72a10 10 0 0 0-.11-2.232a5.3 5.3 0 0 1-.26-1.37a.3.3 0 0 0-.54-.24a6.8 6.8 0 0 0-.2 2.33c-1.281-.38-1.121.13-1.131-.42a15 15 0 0 0-.19-1.93c-.16-.17-.36-.17-.51.14a20 20 0 0 0-.43 3.471c.04.773.18 1.536.42 2.272c.26.4.7.22.7-.1c0-.09-.16-.09 0-1.862c.06-1.18-.23-.3 1.16-.76m5.033-2.552c.32-.07.41-.28.39-.37c0-.55-3.322-.34-3.462-.24s-.2.18-.18.28s0 .11 0 .16a3.8 3.8 0 0 0 1.591.361v.82a15 15 0 0 0-.13 3.132c0 .2-.09.94.17 1.16a.34.34 0 0 0 .48 0c.125-.35.196-.718.21-1.09a8 8 0 0 0 .14-3.232c0-.13.05-.7-.1-.89a8 8 0 0 0 .89-.09m5.544-.181a.69.69 0 0 0-.89-.44a2.8 2.8 0 0 0-1.252 1.001a2.3 2.3 0 0 0-.41-.83a1 1 0 0 0-1.6.27a7 7 0 0 0-.35 2.07c0 .571 0 2.642.06 2.762c.14 1.09 1 .51.63.13a17.6 17.6 0 0 1 .38-3.962c.32-1.18.32.2.39.51s.11 1.081.73 1.081s.48-.93 1.401-1.78q.075 1.345 0 2.69a15 15 0 0 0 0 1.811a.34.34 0 0 0 .68 0q.112-.861.11-1.73a16.7 16.7 0 0 0 .12-3.582m1.441-.201c-.05.16-.3 3.002-.31 3.202a6.3 6.3 0 0 0 .21 1.741c.33 1 1.21 1.07 2.291.82a3.7 3.7 0 0 0 1.14-.23c.21-.22.10-.59-.41-.64q-.817.096-1.64.07c-.44-.07-.34 0-.67-4.442q.015-.185 0-.37a.316.316 0 0 0-.23-.38a.316.316 0 0 0-.38.23"}})])])]):e._e()],2)]})],2):e._e(),t("div",{directives:[{name:"show",rawName:"v-show",value:!(n.isCollapsed||!e.stream&&e.loading),expression:"!isCollapsed && (stream ? true : !loading)"}],staticClass:"code-editor-layer"},[t("div",{ref:"codeEditor",staticClass:"code-editor-container",class:[e.stream?"":"code-height-placeholder"],style:n.codeEditorContainerStyle,attrs:{"data-markstream-host-hidden":n.editorReady?void 0:"true","aria-hidden":n.editorReady?void 0:"true"}}),n.editorReady?e._e():t(n.PreCodeNode,{staticClass:"code-pre-fallback",style:n.preFallbackStyle,attrs:{node:e.node,"show-line-numbers":n.effectiveShowLineNumbers,"diff-inline":n.preFallbackDiffInline}})],1),n.showInlinePreview&&!n.hasPreviewListener&&n.isPreviewable&&"html"===n.codeLanguage?t(n.HtmlPreviewFrame,{attrs:{code:e.node.code,"html-preview-allow-scripts":n.props.htmlPreviewAllowScripts,"html-preview-sandbox":n.props.htmlPreviewSandbox,"is-dark":n.props.isDark,"on-close":()=>n.showInlinePreview=!1}}):e._e(),t("div",{directives:[{name:"show",rawName:"v-show",value:!e.stream&&e.loading,expression:"!stream && loading"}],staticClass:"code-loading-placeholder"},[e._t("loading",function(){return[t("div",{staticClass:"loading-skeleton"},[t("div",{staticClass:"skeleton-line"}),t("div",{staticClass:"skeleton-line"}),t("div",{staticClass:"skeleton-line short"})])]},{loading:e.loading,stream:e.stream})],2),t("span",{staticClass:"sr-only",attrs:{"aria-live":"polite",role:"status"}},[e._v(e._s(n.copyText?n.t("common.copied")||"Copied":""))])],1)},[],!1,null,"398d3767",null,null).exports;function Kt(e={}){const t=m.ref(""),n=m.ref(""),o=m.ref(!1),r=p.createSmoothMarkdownStream(e),l=()=>{const e=r.getSnapshot();t.value=e.source,n.value=e.visible,o.value=e.done},i=r.subscribe(l);l();const a=m.computed(()=>Math.max(0,t.value.length-n.value.length)),s=m.computed(()=>0===a.value),u=m.computed(()=>o.value&&s.value);return m.getCurrentScope()&&m.onScopeDispose(()=>{i(),r.destroy()}),{source:t,visible:n,done:o,final:u,caughtUp:s,pendingChars:a,enqueue:e=>r.enqueue(e),finish:e=>r.finish(e),flush:()=>r.flush(),reset:e=>r.reset(e),pause:()=>r.pause(),resume:()=>r.resume()}}function Wt(e){const t="number"==typeof e?e:Number.parseFloat(String(null!=e?e:""));return Number.isFinite(t)&&t>0?t:null}function Qt(e){const t=e.split(/\r?\n/).map(e=>e.trim()).filter(e=>e&&!e.startsWith("%%")),n=Math.max(1,t.length),o=function(e){var t;for(const n of e.split(/\r?\n/)){const e=n.trim();if(!e||e.startsWith("%%"))continue;const o=e.match(/^([A-Z][\w-]*)\b/i);return(null==(t=null==o?void 0:o[1])?void 0:t.toLowerCase())||""}return""}(e);return"gantt"===o?220+28*n:"sequencediagram"===o?180+26*n:"classdiagram"===o||"statediagram"===o||"erdiagram"===o?180+24*n:"flowchart"===o||"graph"===o?170+28*n:200+22*n}function Vt(e){const t=e.split(/\r?\n/).filter(e=>/^\s*-\s+/.test(e)).length;return t>=3?500:t>0?280+60*t:360}function Xt(e,t=360,n=500){return null==n?Math.max(t,e):Math.min(Math.max(t,e),n)}function qt(e,t=360,n=500){return Xt(e,t,n)}function Gt(e,t=360,n=500){return Xt(e,t,n)}const Zt=M(m.defineComponent({__name:"NodeRenderer",props:{content:null,nodes:null,final:{type:Boolean},parseOptions:null,customMarkdownIt:null,debugPerformance:{type:Boolean,default:!1},customHtmlTags:null,htmlPolicy:null,viewportPriority:{type:Boolean},codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:null,codeBlockLightTheme:null,renderCodeBlocksAsPre:{type:Boolean},codeBlockMinWidth:null,codeBlockMaxWidth:null,codeBlockOptions:null,codeBlockProps:null,mermaidProps:null,d2Props:null,infographicProps:null,showTooltips:{type:Boolean,default:!0},themes:null,isDark:{type:Boolean},customId:null,indexKey:null,typewriter:{type:Boolean,default:!1},fade:{type:Boolean,default:!0},smoothStreaming:{type:[Boolean,String],default:"auto"},smoothStreamingOptions:null,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","copy-code","handleArtifactClick","click","mouseover","mouseout"],setup(e,{emit:t}){var n,o,r;const l=e;function i(e){return"undefined"!=typeof Event&&e instanceof Event}const a=m.ref(),f=m.ref(!1),h=/auto|scroll|overlay/i,g="undefined"!=typeof window,y=m.getCurrentInstance(),x=m.computed(()=>l.debugPerformance&&g&&"undefined"!=typeof console),k=m.computed(()=>{var e,t;return null!=(t=null==(e=null==y?void 0:y.proxy)?void 0:e.$attrs)?t:{}}),M=new Map,N=m.ref(0),_=Kt(l.smoothStreamingOptions),D=m.computed(()=>{var e;if("boolean"==typeof l.showTooltips)return l.showTooltips;const t=null!=(e=k.value.showTooltips)?e:k.value["show-tooltips"];return""===t||!0===t||"true"===t||!1!==t&&"false"!==t&&void 0}),E=m.inject("markstreamHtmlPolicy",void 0),L=m.inject("markstreamSmoothStreaming",void 0),B=m.computed(()=>{var e,t;return null!=(t=null!=(e=l.htmlPolicy)?e:null==E?void 0:E.value)?t:"safe"});m.provide("markstreamShowTooltips",D),m.provide("markstreamHtmlPolicy",B),m.provide("markstreamTypewriter",m.computed(()=>!0===l.typewriter)),m.provide("markstreamFade",m.computed(()=>!1!==l.fade)),m.provide("markstreamTextStreamState",M),m.provide("markstreamStreamVersion",N);const A=m.computed(()=>{var e,t;return!1!==l.smoothStreaming&&!(null==(e=l.nodes)?void 0:e.length)&&(!0===l.smoothStreaming||!(null==L?void 0:L.value))&&(!0===l.smoothStreaming||!0===l.typewriter||(null!=(t=l.maxLiveNodes)?t:0)<=0)}),O=m.ref(!g||!0===l.smoothStreaming);m.onMounted(()=>{O.value=!0});const z=m.computed(()=>O.value&&A.value);m.provide("markstreamSmoothStreaming",z);const P=m.computed(()=>{var e;return z.value?_.visible.value:null!=(e=l.content)?e:""}),R=m.computed(()=>{var e;return null!=(e=l.content)?e:""}),H=m.computed(()=>{var e;return Boolean(null==(e=l.nodes)?void 0:e.length)||_.source.value===R.value}),$=m.computed(()=>{var e,t;const n=null!=(e=l.parseOptions)?e:{};return null!=(t=l.final)?t:n.final}),Y=m.computed(()=>{const e=$.value;return z.value&&null!=e?Boolean(e&&H.value&&_.caughtUp.value):e}),K=m.computed(()=>{var e;return(null==(e=l.nodes)?void 0:e.length)?l.nodes:P.value});function W(e,t){x.value&&console.info(`[markstream-vue2][perf] ${e}`,t)}function Q(e){if("undefined"==typeof window)return null;const t=null!=e?e:a.value;if(!t)return null;const n=t.ownerDocument||document,o=n.scrollingElement||n.documentElement;let r=t;for(;r&&r!==n.body&&r!==o;){const e=window.getComputedStyle(r),t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();if(h.test(t)||h.test(n))return r;r=r.parentElement}return null}m.watch([()=>l.content,()=>l.nodes,z,$],([e,t,n,o])=>{if(null==t?void 0:t.length)return void _.reset("");const r=null!=e?e:"";if(!n)return _.reset(r),void(o&&_.finish({flush:!0}));const l=_.source.value;r?r===l||(r.startsWith(l)?_.enqueue(r.slice(l.length)):_.reset(r)):_.reset(""),o&&_.finish()},{immediate:!0}),m.watch(K,()=>{N.value+=1},{immediate:!0});const V=l.customId?`renderer-${l.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,X=c.getMarkdown(V),q=new Map,G=m.markRaw([]),Z=m.computed(()=>(I.value,S(l.customId))),J=m.computed(()=>{var e;return c.mergeCustomHtmlTags(l.customHtmlTags,null==(e=l.parseOptions)?void 0:e.customHtmlTags)}),ee=m.computed(()=>{const{key:e,tags:t}=c.resolveCustomHtmlTags(J.value);if(!e)return X;const n=q.get(e);if(n)return n;const o=c.getMarkdown(V,{customHtmlTags:t});return q.set(e,o),o}),te=m.computed(()=>{const e=ee.value;return l.customMarkdownIt?l.customMarkdownIt(e):e});function ne(e){if(Array.isArray(e))return Object.freeze(e.map(e=>ne(e)));if(!e||"object"!=typeof e)return e;const t={};for(const[n,o]of Object.entries(e))t[n]=ne(o);return Object.freeze(t)}function oe(e){return e.map(e=>ne(e))}const re=m.computed(()=>{var e;const t=null!=(e=l.parseOptions)?e:{},n=Y.value,o=J.value,r=null!=n,i=o.length>0;return r||i?s(s(s({},t),r?{final:n}:{}),i?{customHtmlTags:o}:{}):t}),le=m.computed(()=>{var e;const t=null!=(e=re.value.customHtmlTags)?e:[];return new Set(t.map(e=>String(e).trim().toLowerCase()).filter(Boolean))}),ie=m.computed(()=>{var e;if(w(null==y?void 0:y.proxy)&&!l.content&&Array.isArray(l.nodes))return G;if(null==(e=l.nodes)?void 0:e.length)return m.markRaw(oe(l.nodes));const t=P.value;if(t){const e=x.value?performance.now():0,n=c.parseMarkdownToStructure(t,te.value,re.value);return x.value&&W("parse(sync)",{ms:Math.round(performance.now()-e),nodes:n.length,contentLength:t.length}),m.markRaw(oe(n))}return[]}),ae=m.computed(()=>{var e;return Math.max(1,null!=(e=l.maxLiveNodes)?e:320)}),se=m.computed(()=>{var e;return!((null!=(e=l.maxLiveNodes)?e:0)<=0)&&ie.value.length>ae.value}),de=m.computed(()=>!1!==l.viewportPriority&&!f.value),ce=Dt(e=>{var t;return Q(null!=(t=null!=e?e:a.value)?t:null)},de),me=g&&"function"==typeof window.requestAnimationFrame?window.requestAnimationFrame.bind(window):null,pe=g&&"function"==typeof window.cancelAnimationFrame?window.cancelAnimationFrame.bind(window):null,fe="undefined"!=typeof globalThis&&void 0!==globalThis.process&&"test"===(null==(o=null==(n=globalThis.process)?void 0:n.env)?void 0:o.NODE_ENV),ve=g&&"function"==typeof window.requestIdleCallback,he=m.computed(()=>{var e;const t=Math.trunc(null!=(e=l.renderBatchSize)?e:80);return Number.isFinite(t)?Math.max(0,t):0}),ge=m.computed(()=>{var e;const t=Math.trunc(null!=(e=l.initialRenderBatchSize)?e:he.value);return Number.isFinite(t)?Math.max(0,t):he.value}),ye=m.computed(()=>!1!==l.batchRendering&&he.value>0&&g&&!fe),we=m.ref(0),xe=m.ref({key:l.indexKey,total:0}),Me=m.ref(Math.max(1,he.value||1)),be=m.reactive({}),Ce=new Map,Te=new Map,Ne=new Map,_e=[];m.watch(()=>ie.value.length,e=>{_e.length>e&&(_e.length=e)});const De=m.ref(0),Ie=m.computed(()=>(De.value,Array.from(Ne.entries()).sort((e,t)=>e[0]-t[0]))),Se=m.ref(null);let je=null,Ee=null;const Le=m.reactive({start:0,end:0}),Be=m.computed(()=>{if(!se.value)return ie.value.map((e,t)=>({node:e,index:t}));const e=ie.value.length,t=rt(Le.start,0,e),n=rt(Le.end,t,e);return ie.value.slice(t,n).map((e,n)=>({node:e,index:t+n}))}),Ae=m.computed(()=>{var e;return!1!==l.deferNodesUntilVisible&&!((null!=(e=l.maxLiveNodes)?e:0)<=0)&&!se.value&&!(ie.value.length>900)&&de.value}),Oe=m.computed(()=>{var e;return ye.value&&(null!=(e=l.maxLiveNodes)?e:0)<=0}),Pe=m.ref({batchSize:he.value,initial:ge.value,delay:null!=(r=l.renderBatchDelay)?r:16,enabled:Oe.value}),Re=m.computed(()=>!!ce&&(Ae.value||se.value)),He=m.computed(()=>{var e;return Math.max(0,null!=(e=l.liveNodeBuffer)?e:60)}),$e=m.ref(0),Ue=new Map,Fe=m.computed(()=>w(null==y?void 0:y.proxy)),Ye=m.computed(()=>Fe.value&&!l.content&&Array.isArray(l.nodes)),Ke=m.computed(()=>Ye.value?m.markRaw(oe(l.nodes||[])):G);function We(){var e,t;const n=null==y?void 0:y.proxy;if(!n||!n.$refs)return;const o=n.$refs,r=new Set;for(const l of Be.value){const n=Qe(o[`node-slot-${l.index}`]),i=Qe(o[`node-content-${l.index}`]);(null!=(e=Ne.get(l.index))?e:null)!==n&&cn(l.index,n),(null!=(t=Ue.get(l.index))?t:null)!==i&&pn(l.index,i),r.add(l.index)}for(const l of Array.from(Ne.keys()))r.has(l)||cn(l,null);for(const l of Array.from(Ue.keys()))r.has(l)||pn(l,null)}function Qe(e){if(Array.isArray(e)){for(const t of e)if(t)return t;return null}return null!=e?e:null}const Ve=m.computed(()=>{if(!se.value)return ie.value.length;const e=He.value,t=Math.max(Le.end+e,ge.value),n=Math.min(ie.value.length,t);return Math.max(we.value,n)});function Xe(e){var t,n,o,r;const l=Q(null!=(t=null!=e?e:a.value)?t:null);if(l)return l;const i=null!=(r=null!=(o=null==e?void 0:e.ownerDocument)?o:null==(n=a.value)?void 0:n.ownerDocument)?r:"undefined"!=typeof document?document:null;return(null==i?void 0:i.scrollingElement)||(null==i?void 0:i.documentElement)||null}function qe(e){if(!g)return!1;try{const t=window.getComputedStyle(e);return!!(t.display||"").toLowerCase().includes("flex")&&(t.flexDirection||"").toLowerCase().endsWith("reverse")}catch(t){return!1}}function Ge(e,t,n){var o,r,l,i,a,s;if(n)return null!=(i=null!=(l=null==(o=null==t?void 0:t.documentElement)?void 0:o.scrollTop)?l:null==(r=null==t?void 0:t.body)?void 0:r.scrollTop)?i:0;const u=e.scrollTop;if(!qe(e))return u;const d=u<0?-u:u;return Math.max(0,(null!=(a=e.scrollHeight)?a:0)-(null!=(s=e.clientHeight)?s:0))-d}function Ze(e,t){let n=e,o=0,r=0;for(;n&&n!==t&&r++<64;)o+=n.offsetTop||0,n=n.offsetParent;return o}function Je(){je&&(je(),je=null),Se.value=null}function et(){if(!g||!se.value)return;const e=Xe();if(!e||Se.value===e)return;Je();const t=()=>nt();e.addEventListener("scroll",t,{passive:!0}),Se.value=e,je=()=>{e.removeEventListener("scroll",t)}}function tt(){var e,t,n;if(!Ee)return;const o=null!=(n=null==(t=null==(e=a.value)?void 0:e.ownerDocument)?void 0:t.defaultView)?n:"undefined"!=typeof window?window:null;Ee.viaTimeout?o?o.clearTimeout(Ee.id):clearTimeout(Ee.id):null==pe||pe(Ee.id),Ee=null}function nt(e={}){var t,n,o;if(!se.value)return;if(!g)return void ot(!0);if(e.immediate)return tt(),void ot(!0);if(Ee)return;const r=()=>{Ee=null,ot()};if(me)Ee={id:me(r),viaTimeout:!1};else{const e=null!=(o=null==(n=null==(t=a.value)?void 0:t.ownerDocument)?void 0:n.defaultView)?o:"undefined"!=typeof window?window:null,l=e?e.setTimeout(r,16):setTimeout(r,16);Ee={id:l,viaTimeout:!0}}}function ot(e=!1){var t,n,o,r,l,i,s;if(!se.value)return;const u=Se.value||Xe();if(!u)return;const d=u.ownerDocument||(null==(t=a.value)?void 0:t.ownerDocument)||document,c=(null==d?void 0:d.defaultView)||("undefined"!=typeof window?window:null),m=u===(null==d?void 0:d.documentElement)||u===(null==d?void 0:d.body),p=ie.value.length;if(!m&&p>0&&qe(u)){const t=u.clientHeight||0,n=u.scrollTop,o=n<0?-n:n,r=rt(an(Math.max(0,o)+.5*Math.max(0,t)),0,Math.max(0,p-1));return void((e||Math.abs(r-$e.value)>1)&&($e.value=r))}const f=m?null:u.getBoundingClientRect(),v=m?0:f.top,h=m?null!=(o=null!=(n=null==c?void 0:c.innerHeight)?n:u.clientHeight)?o:0:f.bottom,g=Ie.value;let y=null,w=null;for(const[a,k]of g){if(!k)continue;const e=k.getBoundingClientRect();e.bottom<=v||e.top>=h||(null==y&&(y=a),w=a)}if(null==y||null==w){const e=a.value;if(!e)return;const t=m?{top:0}:u.getBoundingClientRect(),n=Ge(u,d,m),o=m?(()=>{const n=e.getBoundingClientRect(),o=(m?0:t.top)-n.top;return Math.max(0,o)})():(()=>{const t=Ze(e,u);return Math.max(0,n-t)})(),p=m?null!=(s=null!=(i=null!=(l=null==c?void 0:c.innerHeight)?l:null==(r=null==d?void 0:d.documentElement)?void 0:r.clientHeight)?i:u.clientHeight)?s:0:u.clientHeight,f=rn(o+.5*Math.max(0,p));return void($e.value=rt(f,0,Math.max(0,ie.value.length-1)))}const x=Math.round((y+w)/2);!e&&Math.abs(x-$e.value)<=1||($e.value=rt(x,0,Math.max(0,ie.value.length-1)))}function rt(e,t,n){return Math.min(Math.max(e,t),n)}function lt(){const e=ie.value.length;if(!se.value||0===e)return Le.start=0,void(Le.end=e);const t=Math.min(ae.value,e),n=He.value,o=rt($e.value-n,0,Math.max(0,e-t));Le.start=o,Le.end=Math.min(e,o+t)}const it=m.reactive({}),at=m.reactive({total:0,count:0}),ut=m.ref(0),_t=m.ref([]),It=m.ref([]);function Ot(){for(const e of Object.keys(it))delete it[Number(e)];at.total=0,at.count=0,ut.value=0,_t.value=[],It.value=[]}function Ht(e){if(e<=0)return void Ot();let t=0,n=0;for(const[o,r]of Object.entries(it)){const l=Number(o),i=Number(r);!Number.isFinite(l)||l<0||l>=e||!Number.isFinite(i)||i<=0?delete it[l]:(t+=i,n++)}at.total=t,at.count=n}function $t(e,t,n){for(let o=t+1;o<e.length;o+=o&-o)e[o]+=n}function Ut(e,t){let n=0;for(let o=t+1;o>0;o-=o&-o)n+=e[o];return n}function Ft(e,t,n){if(n<=t)return 0;const o=Ut(e,n-1);return t<=0?o:o-Ut(e,t-1)}function Xt(e){ut.value=e;const t=new Array(e+1).fill(0),n=new Array(e+1).fill(0);for(const[o,r]of Object.entries(it)){const l=Number(o),i=Number(r);!Number.isFinite(l)||l<0||l>=e||!Number.isFinite(i)||i<=0||($t(t,l,i),$t(n,l,1))}_t.value=t,It.value=n}function Zt(e,t){if(!Number.isFinite(t)||t<=0)return;const n=it[e];if(it[e]=t,n?at.total+=t-n:(at.total+=t,at.count++),ut.value>e){const o=_t.value,r=It.value;if(o.length&&r.length)if(n){const r=t-n;0!==r&&$t(o,e,r)}else $t(o,e,t),$t(r,e,1)}}const en=m.computed(()=>at.count>0?Math.max(12,at.total/at.count):32);function tn(e,t){var n,o;if(e>=t)return 0;if(ut.value!==ie.value.length){let o=0;for(let r=e;r<t;r++)o+=null!=(n=it[r])?n:en.value;return o}const r=_t.value,l=It.value;if(!r.length||!l.length){let n=0;for(let r=e;r<t;r++)n+=null!=(o=it[r])?o:en.value;return n}return Ft(r,e,t)+(t-e-Ft(l,e,t))*en.value}m.watch(()=>ie.value.length,e=>{e<=0?Ot():(e<ut.value&&Ht(e),e!==ut.value&&Xt(e))},{immediate:!0});const nn=m.computed(()=>se.value?tn(0,Math.min(Le.start,ie.value.length)):0),on=m.computed(()=>{if(!se.value)return 0;const e=ie.value.length;return tn(Math.min(Le.end,e),e)});function rn(e){var t;if(e<=0)return 0;const n=ie.value;if(ut.value===n.length&&_t.value.length&&It.value.length){const t=en.value,o=_t.value,r=It.value,l=e=>e<=0?0:Ut(o,e-1)+(e-Ut(r,e-1))*t;let i=0,a=n.length-1,s=n.length-1;for(;i<=a;){const t=i+a>>1;l(t+1)>=e?(s=t,a=t-1):i=t+1}return s}let o=e;for(let r=0;r<n.length;r++){const e=null!=(t=it[r])?t:en.value;if(o<=e)return r;o-=e}return Math.max(0,n.length-1)}function an(e){var t;const n=ie.value;if(!n.length)return 0;if(e<=0)return Math.max(0,n.length-1);if(ut.value===n.length){const t=tn(0,n.length);return rn(Math.max(0,t-e))}let o=e;for(let r=n.length-1;r>=0;r--){const e=null!=(t=it[r])?t:en.value;if(o<=e)return r;o-=e}return 0}function sn(e){if(!Ce.size)return;if(!se.value)return;let t=!1;for(const[n,o]of Ce)n>=e&&(o.destroy(),Ce.delete(n),Ae.value&&delete be[n],xn(n),Ne.delete(n)&&(t=!0));t&&mn()}function un(e,t){Ae.value&&(be[e]=t),t&&(se.value?nt():$e.value=rt(e,0,Math.max(0,ie.value.length-1)))}function dn(e){const t=Ce.get(e);t&&(t.destroy(),Ce.delete(e)),xn(e)}function cn(e,t){let n=!1;if(t){const o=Ne.get(e);Ne.set(e,t),o!==t&&(n=!0)}else Ne.delete(e)&&(n=!0);if(n&&mn(),t||xn(e),!Re.value||!ce)return dn(e),void(t?un(e,!0):Ae.value&&delete be[e]);if(!se.value&&Ae.value&&!f.value&&Ce.size>=640&&(Mn("too-many-targets"),!Re.value||!ce))return dn(e),void(t?un(e,!0):Ae.value&&delete be[e]);if(e<ge.value&&!se.value)return dn(e),void un(e,!0);if(!t)return dn(e),void(Ae.value&&delete be[e]);dn(e);const o=ce(t,{rootMargin:"400px"});o&&(Ce.set(e,o),un(e,o.isVisible.value),Ae.value&&kn(e),o.whenVisible.then(()=>{xn(e),un(e,!0)}).catch(()=>{}).finally(()=>{Ce.get(e)===o&&Ce.delete(e);try{o.destroy()}catch(t){}}),se.value&&nt())}function mn(){De.value+=1}function pn(e,t){t?(Ue.set(e,t),queueMicrotask(()=>{Zt(e,t.offsetHeight)})):Ue.delete(e)}m.onMounted(()=>{g&&m.nextTick(We)}),m.watch(Be,()=>{g&&m.nextTick(We)}),m.watch(we,()=>{g&&m.nextTick(We)}),m.watch(se,()=>{g&&m.nextTick(We)});let fn=null,vn=null,hn=!1,gn=null,yn=null;function wn(){g&&(null!=fn&&(null==pe||pe(fn),fn=null),null!=vn&&(window.clearTimeout(vn),vn=null),null!=yn&&"function"==typeof window.cancelIdleCallback&&(window.cancelIdleCallback(yn),yn=null),hn=!1,gn=null)}function xn(e){if(!g)return;const t=Te.get(e);null!=t&&(window.clearTimeout(t),Te.delete(e))}function kn(e){if(!g||!Ae.value)return;xn(e);const t=e%17*23,n=window.setTimeout(()=>{var t,n;if(Te.delete(e),!Ae.value)return;if(!0===be[e])return;const o=Ne.get(e);if(!o)return void delete be[e];const r=Xe(o),l=o.ownerDocument||document,i=l.defaultView||window,a=!r||r===l.documentElement||r===l.body,s=!a&&r?r.getBoundingClientRect():null,u=a?0:s.top,d=a?null!=(n=null!=(t=i.innerHeight)?t:null==r?void 0:r.clientHeight)?n:0:s.bottom,c=o.getBoundingClientRect();c.bottom>=u-500&&c.top<=d+500&&un(e,!0)},1800+t);Te.set(e,n)}function Mn(e){var t;if(!f.value){f.value=!0,void 0!=={url:"undefined"==typeof document?require("url").pathToFileURL(__filename).href:v&&"SCRIPT"===v.tagName.toUpperCase()&&v.src||new URL("index.cjs",document.baseURI).href}&&(null==(t={BASE_URL:"/",MODE:"npm",DEV:!1,PROD:!0,SSR:!1})?void 0:t.DEV)&&"undefined"!=typeof console&&console.warn("[markstream-vue2] viewportPriority auto-disabled:",e);for(const e of Ce.values())e.destroy();if(Ce.clear(),g)for(const e of Te.values())window.clearTimeout(e);Te.clear();for(const e of Object.keys(be))delete be[e]}}function bn(e,t={}){var n,o;if(!Oe.value)return;const r=Ve.value;if(we.value>=r)return;const i=Math.max(1,e),a=e=>{var t;fn=null,vn=null,yn=null,hn=!1;const n=null!=gn?gn:i;gn=null;const o=Math.max(2,null!=(t=l.renderBatchBudgetMs)?t:6),a=e=>{const t="undefined"!=typeof performance?performance.now():Date.now();we.value=Math.min(r,we.value+Math.max(1,e)),sn(we.value);const n=("undefined"!=typeof performance?performance.now():Date.now())-t;return Tn(n),n};let s=n;for(;(a(s),!(we.value>=r)&&e)&&!(("function"==typeof e.timeRemaining?e.timeRemaining():0)<=.5*o);)s=Math.max(1,Math.round(Me.value));we.value<r&&Cn()};if(!g||t.immediate)return void a();const s=Math.max(0,null!=(n=l.renderBatchDelay)?n:16);if(gn=null!=gn?Math.max(gn,i):i,!hn){if(hn=!0,!fe&&ve&&window.requestIdleCallback){const e=Math.max(0,null!=(o=l.renderBatchIdleTimeoutMs)?o:120);return void(yn=window.requestIdleCallback(e=>{a(e)},{timeout:e}))}me&&!fe?fn=me(()=>{0!==s?vn=window.setTimeout(()=>a(),s):a()}):vn=window.setTimeout(()=>a(),s)}}function Cn(){Oe.value&&bn(ye.value?Math.max(1,Math.round(Me.value)):Math.max(1,he.value))}function Tn(e){var t;if(!Oe.value)return;const n=Math.max(2,null!=(t=l.renderBatchBudgetMs)?t:6),o=Math.max(1,he.value||1),r=Math.max(1,Math.floor(o/4));e>1.2*n?Me.value=Math.max(r,Math.floor(.7*Me.value)):e<.5*n&&Me.value<o&&(Me.value=Math.min(o,Math.ceil(1.2*Me.value)))}m.watch([()=>ie.value,()=>ie.value.length,()=>Oe.value,()=>he.value,()=>ge.value,()=>l.renderBatchDelay,()=>l.indexKey],()=>{var e;const t=ie.value.length,n=xe.value,o=l.indexKey,r=void 0!==o&&o!==n.key,i=t!==n.total,a=r||i;xe.value={key:o,total:t};const s=Pe.value,u=null!=(e=l.renderBatchDelay)?e:16,d=s.batchSize!==he.value||s.initial!==ge.value||s.delay!==u||s.enabled!==Oe.value;Pe.value={batchSize:he.value,initial:ge.value,delay:u,enabled:Oe.value},(a||d||!Oe.value)&&wn(),(a||d)&&(Me.value=Math.max(1,he.value||1)),a&&se.value&&nt({immediate:!0});const c=Ve.value;if(!t)return 0!==we.value&&(we.value=0),void sn(0);if(!Oe.value)return we.value!==c&&(we.value=c),void sn(we.value);if(r||0===n.total||d){const e=Math.min(c,ge.value);we.value!==e&&(we.value=e)}else{const e=Math.min(we.value,c);we.value!==e&&(we.value=e)}const m=Math.max(1,ge.value||he.value||t);we.value<c?bn(m,{immediate:!g}):sn(we.value)},{immediate:!0}),m.watch(()=>se.value,e=>{if(!e)return Je(),void tt();et(),nt({immediate:!0})},{immediate:!0}),m.watch([()=>ie.value.length,()=>se.value],e=>d(this,[e],function*([e,t]){t&&e&&g&&(yield m.nextTick(),nt({immediate:!0}))}),{flush:"post"}),m.watch(()=>a.value,()=>{se.value&&(et(),nt({immediate:!0}))}),m.watch(()=>ie.value.length,()=>{se.value&&nt({immediate:!0})}),m.watch(()=>Ae.value,e=>{if(e)for(const[t,n]of Ne)cn(t,n);else{for(const e of Ce.values())e.destroy();Ce.clear();for(const e of Array.from(Te.keys()))xn(e);for(const e of Object.keys(be))delete be[e];for(const[e,t]of Ne)t&&un(e,!0)}},{immediate:!1}),m.watch([()=>l.viewportPriority,()=>ie.value.length],([e,t])=>{!1!==e?f.value&&t<=200&&(f.value=!1):f.value=!1}),m.watch(()=>we.value,()=>{se.value&&nt({immediate:!0})}),m.watch([$e,ae,He,()=>ie.value.length,se],()=>{lt()},{immediate:!0}),m.watch([()=>ie.value.length,se,ae,He,()=>Le.start,()=>Le.end],([e,t,n,o,r,l])=>{x.value&&W("virtualization",{nodes:e,virtualization:t,maxLiveNodes:n,buffer:o,focusIndex:$e.value,scroll:t?(()=>{const e=Se.value||Xe();return e?{reverse:qe(e),scrollTop:Math.round(e.scrollTop),scrollTopAbs:Math.round(Math.abs(e.scrollTop)),scrollHeight:Math.round(e.scrollHeight),clientHeight:Math.round(e.clientHeight)}:null})():null,liveRange:{start:r,end:l},rendered:we.value})}),m.watch(()=>Ve.value,(e,t)=>{Oe.value&&("number"==typeof t&&e<=t||e>we.value&&Cn())}),m.onBeforeUnmount(()=>{wn();for(const e of Ce.values())e.destroy();Ce.clear();for(const e of Array.from(Te.keys()))xn(e);Je(),tt(),To()});const Nn={name:"MermaidBlockNodeLoading",props:{estimatedPreviewHeightPx:Number,isDark:Boolean,showHeader:{type:Boolean,default:!0}},render(e){var t;const n="function"==typeof e?e:m.h,o="function"==typeof e?{attrs:{"data-markstream-mermaid":"1","data-markstream-mode":"pending"}}:{"data-markstream-mermaid":"1","data-markstream-mode":"pending"},r=`${null!=(t=Wt(this.estimatedPreviewHeightPx))?t:360}px`;return n("div",u(s({},o),{class:["my-4 rounded-lg border overflow-hidden shadow-sm",this.isDark?"border-gray-700/30":"border-gray-200"]}),[!1===this.showHeader?null:n("div",{class:["mermaid-block-header flex justify-between items-center px-4 py-2.5 border-b",this.isDark?"bg-gray-800 border-gray-700/30":"bg-gray-50 border-gray-200"]},[n("div",{class:"flex items-center gap-x-2 overflow-hidden"},[n("span",{class:this.isDark?"text-sm font-medium font-mono truncate text-gray-400":"text-sm font-medium font-mono truncate text-gray-600"},"Mermaid")])]),n("div",{class:["mermaid-preview-area min-h-[360px] relative overflow-hidden block",this.isDark?"bg-gray-900":"bg-gray-50"],style:{height:r}})])}},_n=m.ref(null);let Dn=null;function In(){_n.value||Dn||(Dn=Promise.resolve().then(()=>require("./chunks/index-6013a5b2.cjs")).then(e=>{var t;return null!=(t=e.default)?t:e}).then(e=>{_n.value=e}).catch(e=>{console.warn('[markstream-vue2] Optional peer dependencies for MermaidBlockNode are missing. Falling back to preformatted code rendering. To enable Mermaid rendering, please install "mermaid".',e),_n.value=st}))}function Sn(){return In(),_n.value||Nn}const jn={name:"InfographicBlockNodeLoading",props:{estimatedPreviewHeightPx:Number,isDark:Boolean,showHeader:{type:Boolean,default:!0}},render(e){var t;const n="function"==typeof e?e:m.h,o="function"==typeof e?{attrs:{"data-markstream-infographic":"1","data-markstream-mode":"pending"}}:{"data-markstream-infographic":"1","data-markstream-mode":"pending"},r=`${null!=(t=Wt(this.estimatedPreviewHeightPx))?t:360}px`;return n("div",u(s({},o),{class:["my-4 rounded-lg border overflow-hidden shadow-sm",this.isDark?"border-gray-700/30":"border-gray-200"]}),[!1===this.showHeader?null:n("div",{class:["infographic-block-header flex justify-between items-center px-4 py-2.5 border-b",this.isDark?"bg-gray-800 border-gray-700/30":"bg-gray-50 border-gray-200"]},[n("div",{class:"flex items-center gap-x-2 overflow-hidden"},[n("span",{class:this.isDark?"text-sm font-medium font-mono truncate text-gray-400":"text-sm font-medium font-mono truncate text-gray-600"},"Infographic")])]),n("div",{class:["infographic-preview min-h-[360px] relative overflow-hidden block",this.isDark?"bg-gray-900":"bg-gray-50"],style:{height:r}})])}},En=m.ref(null);let Ln=null;function Bn(){En.value||Ln||(Ln=Promise.resolve().then(()=>require("./chunks/index-e0125777.cjs")).then(e=>{var t;return null!=(t=e.default)?t:e}).then(e=>{En.value=e}).catch(e=>{console.warn("[markstream-vue2] Optional peer dependencies for InfographicBlockNode are missing. Falling back to preformatted code rendering.",e),En.value=st}))}function An(){return Bn(),En.value||jn}function On(){return d(this,null,function*(){var e;try{const t=yield Promise.resolve().then(()=>ln);return null!=(e=t.default)?e:t}catch(t){return console.warn('[markstream-vue2] Optional peer dependencies for D2BlockNode are missing. Falling back to preformatted code rendering. To enable D2 rendering, please install "@terrastruct/d2".',t),st}})}const zn=m.computed(()=>l.renderCodeBlocksAsPre?st:Yt),Pn={text:ke,paragraph:jt,heading:Ct,code_block:Yt,list:Nt,list_item:Tt,blockquote:Rt,table:Et,definition_list:C,footnote:Mt,footnote_reference:j,footnote_anchor:kt,admonition:Jt,vmr_container:At,hardbreak:bt,link:gt,image:ue,thematic_break:Lt,math_inline:dt,math_block:ct,strong:vt,emphasis:xt,strikethrough:ht,highlight:wt,insert:yt,subscript:ft,superscript:pt,emoji:T,checkbox:b,checkbox_input:b,inline_code:F,html_inline:U,reference:mt,html_block:St},Rn=m.computed(()=>null!=l.indexKey?String(l.indexKey):"markdown-renderer"),Hn=m.computed(()=>zt(l.codeBlockProps)),$n=m.computed(()=>zt(l.codeBlockProps)),Un=m.computed(()=>u(s(s({stream:l.codeBlockStream,darkTheme:l.codeBlockDarkTheme,lightTheme:l.codeBlockLightTheme,themes:l.themes,minWidth:l.codeBlockMinWidth,maxWidth:l.codeBlockMaxWidth},"boolean"==typeof l.showTooltips?{showTooltips:l.showTooltips}:{}),$n.value),{codeBlockOptions:l.codeBlockOptions})),Fn=m.computed(()=>u(s(s({},Un.value),Hn.value),{codeBlockOptions:l.codeBlockOptions}));function Yn(e){const t=String(null!=e?e:"").replace(/(?:\r\n|\n|\r)$/,"");return t?t.split(/\r\n|\n|\r/).length:1}function Kn(e){var t,n,o,r,i,a,s;const u=null!=(n=null==(t=l.codeBlockOptions)?void 0:t.lineHeight)?n:18,d=Boolean(e.diff),c=Wn($n.value.diffInline),m=d&&(null!=c?c:"unified"===(null==(o=l.codeBlockOptions)?void 0:o.diffStyle)),p=d?m?Yn(e.originalCode)+Yn(e.updatedCode):Math.max(Yn(e.originalCode),Yn(e.updatedCode)):Yn(e.code),f=d?0:8,v=null!=(i=null==(r=l.codeBlockOptions)?void 0:r.padding)?i:f,h=v,g=v,y=null!=(s=null==(a=l.codeBlockOptions)?void 0:a.maxHeight)?s:500,w=Math.max(1,Math.min(y,Math.round(p*u+h+g)));return{estimatedContentHeightPx:w,estimatedHeightPx:w+(!1!==$n.value.showHeader?41:0)+2,estimatedDiffInline:m}}function Wn(e){return"boolean"==typeof e?e:void 0}const Qn=m.computed(()=>{var e,t;const n=l.codeBlockProps||{},o={},r=Wn(n.showLineNumbers),i=null==(e=l.codeBlockOptions)?void 0:e.disableLineNumbers;o.showLineNumbers=null!=r?r:"boolean"==typeof i&&!i,(null==(t=l.codeBlockOptions)?void 0:t.overflow)&&(o.style={whiteSpace:"scroll"===l.codeBlockOptions.overflow?"pre":"pre-wrap"});const a=Wn(n.diffInline);return void 0!==a&&(o.diffInline=a),o}),Vn=m.computed(()=>s({},l.mermaidProps||{})),Xn=m.computed(()=>s({},l.d2Props||{})),qn=m.computed(()=>s({},l.infographicProps||{})),Gn=m.computed(()=>({typewriter:l.typewriter,fade:l.fade,customHtmlTags:re.value.customHtmlTags,htmlPolicy:B.value})),Zn=m.computed(()=>s(s({},Gn.value),"boolean"==typeof l.showTooltips?{showTooltip:l.showTooltips}:{})),Jn=m.computed(()=>s(s({},Gn.value),"boolean"==typeof l.showTooltips?{showTooltips:l.showTooltips}:{})),eo=m.computed(()=>Ke.value.map((e,t)=>{var n,o,r,l;const i=oo(e,t),a=ro(i);let d=i,m=co(i,a);if(("html_block"===i.type||"html_inline"===i.type)&&m===Pn[i.type]){const e=String(null!=(n=i.tag)?n:"").trim().toLowerCase()||c.getHtmlTagFromContent(i.content);if(e)if(le.value.has(e)){const t=Z.value[e];t&&(m=t,d=u(s({},i),{type:e,tag:e,content:c.stripCustomHtmlWrapper(i.content,e)}))}else if(c.shouldRenderUnknownHtmlTagAsText(null!=(o=i.content)?o:i.raw,e)){const e=String(null!=(l=null!=(r=i.content)?r:i.raw)?l:"");"html_inline"===i.type?(m=ke,d={type:"text",content:e,raw:e}):(m=jt,d={type:"paragraph",children:[{type:"text",content:e,raw:e}],raw:e})}}return{node:d,component:m,bindings:fo(d,a,m),isCodeBlock:"code_block"===d.type,index:t,indexKey:`${Rn.value}-${t}`,renderKey:ao(d,t)}})),to=m.computed(()=>!(!Fe.value||!l.content)&&ie.value.some(e=>io(e))),no=m.computed(()=>Be.value.map(e=>{var t,n,o,r;let l=oo(e.node,e.index);const i=ro(l);let a=co(l,i);if(("html_block"===l.type||"html_inline"===l.type)&&a===Pn[l.type]){const e=String(null!=(t=l.tag)?t:"").trim().toLowerCase()||c.getHtmlTagFromContent(l.content);if(e)if(le.value.has(e)){const t=Z.value[e];t&&(a=t,l=u(s({},l),{type:e,tag:e,content:c.stripCustomHtmlWrapper(l.content,e)}))}else if(c.shouldRenderUnknownHtmlTagAsText(null!=(n=l.content)?n:l.raw,e)){const e=String(null!=(r=null!=(o=l.content)?o:l.raw)?r:"");"html_inline"===l.type?(a=ke,l={type:"text",content:e,raw:e}):(a=jt,l={type:"paragraph",children:[{type:"text",content:e,raw:e}],raw:e})}}return u(s({},e),{node:l,component:a,bindings:fo(l,i,a),isCodeBlock:"code_block"===l.type,indexKey:`${Rn.value}-${e.index}`,renderKey:ao(l,e.index)})}));function oo(e,t){var n,o;if("code_block"!==e.type)return _e[t]=void 0,e;const r=e,l=[r.language,r.loading,r.diff,r.code,r.originalCode,r.updatedCode,r.raw,r.startLine,r.endLine,null==(n=r.sourceMap)?void 0:n.startLine,null==(o=r.sourceMap)?void 0:o.endLine],i=_e[t];if(i&&l.every((e,t)=>e===i.signature[t]))return i.node;const a=s({},r);return _e[t]={signature:l,node:a},a}function ro(e){var t;return"code_block"===(null==e?void 0:e.type)?String(null!=(t=e.language)?t:"").trim().toLowerCase():""}function lo(e,t){const n=t.trim().toLowerCase();if(n)for(const o of[n,ze(n),p.normalizeShikiLanguage(n)]){const t=o&&e[o];if(t)return t}}function io(e){if(!e)return!1;const t=String(e.type||"");return!!["blockquote","list","list_item","table","definition_list","footnote","admonition"].includes(t)||Array.isArray(e.items)||Array.isArray(e.rows)||Array.isArray(e.children)&&!1===["paragraph","heading","text"].includes(t)}function ao(e,t){const n=`${Rn.value}-${t}`;if(!e)return n;const o=String(e.type||"unknown");if("code_block"===o)return n;const r=!0===e.loading,l="string"==typeof e.raw?e.raw.length:0,i="string"==typeof e.content?e.content.length:0,a=Array.isArray(e.children)?e.children.length:0,s=Array.isArray(e.items)?e.items.length:0,u=Array.isArray(e.rows)?e.rows.length:0;return(Fe.value||r)&&(r||a>0||s>0||u>0)?`${n}-${o}-${r?"l":"r"}-${l}-${i}-${a}-${s}-${u}`:n}function so(e){var t,n;const o=s({},Vn.value);return null==Wt(o.estimatedPreviewHeightPx)&&(o.estimatedPreviewHeightPx=qt(Qt(String(null!=(t=null==e?void 0:e.code)?t:"")),void 0,"none"===o.maxHeight?null:null!=(n=Wt(o.maxHeight))?n:void 0)),o}function uo(e){var t,n;const o=s({},qn.value);return null==Wt(o.estimatedPreviewHeightPx)&&(o.estimatedPreviewHeightPx=Gt(Vt(String(null!=(t=null==e?void 0:e.code)?t:"")),void 0,"none"===o.maxHeight?null:null!=(n=Wt(o.maxHeight))?n:void 0)),o}function co(e,t){if(!e)return Bt;const n=Z.value,o=n[String(e.type)];if("code_block"===e.type){const r=null!=t?t:ro(e),l=r?lo(n,r):void 0;if(l)return l;if("mermaid"===r)return n.mermaid||Sn();if("infographic"===r)return n.infographic||An();if("d2"===r||"d2lang"===r)return n.d2||On;if(o)return o;return n.code_block||zn.value}return o||Pn[String(e.type)]||Bt}function mo(e){return Boolean(e&&e===Z.value.code_block)}function po(e,t){return Boolean(e&&t&&e===lo(Z.value,t))}function fo(e,t,n){const o=null!=t?t:ro(e);return"code_block"===e.type&&po(n,o)?"mermaid"===o?so(e):"infographic"===o?uo(e):"d2"===o||"d2lang"===o?Xn.value:Fn.value:"code_block"===e.type&&mo(n)?Fn.value:"code_block"===e.type&&l.renderCodeBlocksAsPre&&n===st?Qn.value:"mermaid"===o?so(e):"infographic"===o?uo(e):"d2"===o||"d2lang"===o?Xn.value:"link"===e.type?Zn.value:"list"===e.type?Jn.value:"code_block"===e.type?n===Yt?s(s({},Un.value),Kn(e)):Un.value:Gn.value}const vo=m.computed(()=>Array.isArray(l.nodes)&&l.nodes.length>0),ho=m.ref(null),go=m.ref(!1);let yo,wo=0;const xo=new Set(["code_block","admonition","table","math_block","html_block","image"]);function ko(e){if(!e||"object"!=typeof e)return!1;const t=e.type;return"string"==typeof t&&xo.has(t)}function Mo(){return!ko(ie.value[ie.value.length-1])}function bo(e){var t,n;if(!e||"object"!=typeof e)return 0;const o=e,r=null!=(n=null!=(t=o.raw)?t:o.content)?n:o.code;if("string"==typeof r)return r.length;const l=o.children;if(Array.isArray(l))return l.reduce((e,t)=>e+bo(t),0);const i=o.items;return Array.isArray(i)?i.reduce((e,t)=>e+bo(t),0):0}function Co(){var e;return(null==(e=l.nodes)?void 0:e.length)?l.nodes.reduce((e,t)=>e+bo(t),0):R.value.length}function To(){yo&&(clearTimeout(yo),yo=void 0)}function No(e){const t=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode(e){var t;if(!(null!=(t=e.textContent)?t:"").trim())return NodeFilter.FILTER_REJECT;const n=e.parentElement;return n?n.closest('.typewriter-cursor, .height-estimation-probes, [data-node-type="code_block"], [data-node-type="admonition"], [data-node-type="table"], [data-node-type="math_block"], [data-node-type="html_block"], [data-node-type="image"], script, style')?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}});let n=null,o=t.nextNode();for(;o;)n=o,o=t.nextNode();return n}function _o(){var e,t;if("undefined"==typeof window||!go.value||!a.value||!ho.value)return;const n=a.value,o=ho.value,r=No(n),l=n.getBoundingClientRect();let i=0,s=0,u=20;if(null==r?void 0:r.textContent){const o=document.createRange(),a=r.textContent.length;o.setStart(r,Math.max(0,a-1)),o.setEnd(r,a);const d="function"==typeof o.getClientRects?o.getClientRects():void 0,c=null!=(t=null==d?void 0:d[d.length-1])?t:null==(e=r.parentElement)?void 0:e.getBoundingClientRect();c&&(i=c.right-l.left+n.scrollLeft,s=c.top-l.top+n.scrollTop,u=c.height||u),o.detach()}o.style.transform=`translate(${Math.max(0,i)}px, ${Math.max(0,s)}px)`,o.style.height=`${u}px`}return m.watch([P,R,()=>l.nodes,()=>l.typewriter,Y],()=>d(this,null,function*(){if("undefined"==typeof window||vo.value)return;if(Y.value)return go.value=!1,void To();const e=Co(),t=Mo();if(!1===l.typewriter||!t||e<=wo)return!1!==l.typewriter&&t||(go.value=!1),void(wo=e);wo=e,go.value=!0,To(),yield m.nextTick(),_o(),yo=setTimeout(()=>{go.value=!1},3e3)}),{flush:"post",immediate:!0}),m.watch(go,e=>d(this,null,function*(){e&&(yield m.nextTick(),_o())}),{flush:"post"}),{__sfc:!0,props:l,emit:t,isNativeDomEvent:i,emitCodeCopy:function(e){if(!i(e))return"string"==typeof e?(t("copy-code",e),void t("copy",e)):void t("copy",e)},MAX_DEFERRED_NODE_COUNT:900,MAX_VIEWPORT_OBSERVER_TARGETS:640,VIEWPORT_PRIORITY_RECOVERY_COUNT:200,containerRef:a,viewportPriorityAutoDisabled:f,SCROLL_PARENT_OVERFLOW_RE:h,isClient:g,instance:y,debugPerformanceEnabled:x,attrs:k,textStreamState:M,streamRenderVersion:N,smoothStream:_,resolvedShowTooltips:D,inheritedHtmlPolicy:E,inheritedSmoothStreaming:L,resolvedHtmlPolicy:B,smoothStreamingEligible:A,hasMountedForSmoothStreaming:O,smoothStreamingEnabled:z,renderContent:P,rawContent:R,smoothSourceSynced:H,requestedFinal:$,effectiveFinal:Y,renderVersionSource:K,logPerf:W,resolveViewportRoot:Q,instanceMsgId:V,defaultMd:X,customTagCache:q,EMPTY_PARSED_NODES:G,customComponentsMap:Z,effectiveCustomHtmlTags:J,mdBase:ee,mdInstance:te,cloneNodeValue:ne,cloneParsedNodeList:oe,mergedParseOptions:re,effectiveCustomHtmlTagsSet:le,parsedNodes:ie,maxLiveNodesResolved:ae,virtualizationEnabled:se,viewportPriorityEnabled:de,registerNodeVisibility:ce,requestFrame:me,cancelFrame:pe,isTestEnv:fe,hasIdleCallback:ve,resolvedBatchSize:he,resolvedInitialBatch:ge,batchingEnabled:ye,renderedCount:we,previousRenderContext:xe,adaptiveBatchSize:Me,nodeVisibilityState:be,nodeVisibilityHandles:Ce,nodeVisibilityFallbackTimers:Te,nodeSlotElements:Ne,codeBlockRenderCache:_e,nodeSlotVersion:De,sortedNodeSlots:Ie,scrollRootElement:Se,detachScrollHandler:je,pendingFocusSync:Ee,liveRange:Le,visibleNodes:Be,deferNodes:Ae,incrementalRenderingActive:Oe,previousBatchConfig:Pe,shouldObserveSlots:Re,liveNodeBufferResolved:He,focusIndex:$e,nodeContentElements:Ue,legacyVue26:Fe,legacyNodesMode:Ye,legacyNodeItems:Ke,syncNodeRefs:We,resolveTemplateRef:Qe,desiredRenderedCount:Ve,resolveScrollContainer:Xe,isReverseFlexScrollRoot:qe,getNormalizedScrollTop:Ge,getOffsetTopWithinRoot:Ze,cleanupScrollListener:Je,setupScrollListener:et,cancelScheduledFocusSync:tt,scheduleFocusSync:nt,syncFocusToScroll:ot,clamp:rt,updateLiveRange:lt,nodeHeights:it,heightStats:at,heightTreeSize:ut,heightSumTree:_t,heightKnownTree:It,resetHeightMeasurements:Ot,pruneHeightMeasurements:Ht,fenwickUpdate:$t,fenwickQuery:Ut,fenwickRangeSum:Ft,rebuildHeightTrees:Xt,recordNodeHeight:Zt,averageNodeHeight:en,estimateHeightRange:tn,topSpacerHeight:nn,bottomSpacerHeight:on,estimateIndexForOffset:rn,estimateIndexForOffsetFromEnd:an,cleanupNodeVisibility:sn,markNodeVisible:un,shouldRenderNode:function(e){return!(Oe.value&&e>=we.value)&&(!Ae.value||e<ge.value||!0===be[e])},destroyNodeHandle:dn,setNodeSlotElement:cn,bumpNodeSlotVersion:mn,setNodeContentRef:pn,batchRaf:fn,batchTimeout:vn,batchPending:hn,pendingIncrement:gn,batchIdle:yn,VIEWPORT_FALLBACK_DELAY:1800,VIEWPORT_FALLBACK_MARGIN_PX:500,cancelBatchTimers:wn,clearVisibilityFallback:xn,scheduleVisibilityFallback:kn,autoDisableViewportPriority:Mn,scheduleBatch:bn,queueNextBatch:Cn,adjustAdaptiveBatchSize:Tn,MermaidBlockNodeLoading:Nn,mermaidBlockNodeComponent:_n,mermaidBlockNodeImport:Dn,loadMermaidBlockNode:In,resolveMermaidBlockNodeComponent:Sn,InfographicBlockNodeLoading:jn,infographicBlockNodeComponent:En,infographicBlockNodeImport:Ln,loadInfographicBlockNode:Bn,resolveInfographicBlockNodeComponent:An,D2BlockNodeAsync:On,codeBlockComponent:zn,nodeComponents:Pn,indexPrefix:Rn,codeBlockExtraProps:Hn,builtinCodeBlockExtraProps:$n,codeBlockBindings:Un,customCodeBlockBindings:Fn,countCodeLines:Yn,estimateBuiltinCodeBlockHeight:Kn,pickBoolean:Wn,preCodeBlockBindings:Qn,mermaidBindings:Vn,d2Bindings:Xn,infographicBindings:qn,nonCodeBindings:Gn,linkBindings:Zn,listBindings:Jn,legacyRenderedItems:eo,legacyStructuredContentMode:to,renderedItems:no,getCodeBlockRenderNode:oo,getCodeBlockLanguage:ro,getCustomCodeLanguageComponent:lo,isLegacyStructuredNode:io,getRenderKey:ao,getMermaidBindingsFor:so,getInfographicBindingsFor:uo,getNodeComponent:co,isCustomCodeBlockComponent:mo,isCustomLanguageCodeBlockComponent:po,getBindingsFor:fo,handleContainerClick:function(e){t("click",e)},handleContainerMouseover:function(e){var n;(null==(n=e.target)?void 0:n.closest("[data-node-index]"))&&t("mouseover",e)},handleContainerMouseout:function(e){var n;(null==(n=e.target)?void 0:n.closest("[data-node-index]"))&&t("mouseout",e)},hasExplicitNodes:vo,typewriterCursorRef:ho,showTypewriterCursor:go,typewriterCursorTimeout:yo,lastTypewriterContentLength:wo,TYPEWRITER_CURSOR_EXCLUDED_NODE_TYPES:xo,shouldSkipTypewriterCursorForNode:ko,shouldShowTypewriterCursorForCurrentNodes:Mo,getNodeTextLength:bo,getTypewriterContentLength:Co,clearTypewriterCursorTimeout:To,getLastTextNode:No,updateTypewriterCursorPosition:_o,LegacyNodesRenderer:Pt}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("div",{ref:"containerRef",staticClass:"markstream-vue2 markdown-renderer",class:[{dark:n.props.isDark},{virtualized:n.virtualizationEnabled}],attrs:{"data-custom-id":n.props.customId},on:{click:n.handleContainerClick,mouseover:n.handleContainerMouseover,mouseout:n.handleContainerMouseout}},[n.legacyNodesMode?e._l(n.legacyRenderedItems,function(o){return t("div",{key:o.renderKey,staticClass:"node-slot",attrs:{"data-node-index":o.index,"data-node-type":o.node.type}},[t("div",{staticClass:"node-content"},[o.isCodeBlock||!1===n.props.fade?t(o.component,e._b({tag:"component",attrs:{node:o.node,loading:o.node.loading,"index-key":o.indexKey,"custom-id":n.props.customId,"is-dark":n.props.isDark},on:{copy:function(e){return n.emitCodeCopy(e)},"handle-artifact-click":function(e){return n.emit("handleArtifactClick",e)}}},"component",o.bindings,!1)):t("transition",{attrs:{name:"fade",appear:""}},[t(o.component,e._b({tag:"component",attrs:{node:o.node,loading:o.node.loading,"index-key":o.indexKey,"custom-id":n.props.customId,"is-dark":n.props.isDark},on:{copy:function(e){return n.emitCodeCopy(e)},"handle-artifact-click":function(e){return n.emit("handleArtifactClick",e)}}},"component",o.bindings,!1))],1)],1)])}):n.legacyStructuredContentMode?t(n.LegacyNodesRenderer,{attrs:{nodes:n.parsedNodes,"custom-id":n.props.customId,"index-key":n.props.indexKey,typewriter:n.props.typewriter,fade:n.props.fade,"show-tooltips":n.props.showTooltips,"code-block-stream":n.props.codeBlockStream,"code-block-dark-theme":n.props.codeBlockDarkTheme,"code-block-light-theme":n.props.codeBlockLightTheme,"render-code-blocks-as-pre":n.props.renderCodeBlocksAsPre,"code-block-min-width":n.props.codeBlockMinWidth,"code-block-max-width":n.props.codeBlockMaxWidth,"code-block-options":n.props.codeBlockOptions,"code-block-props":n.props.codeBlockProps,themes:n.props.themes,"is-dark":n.props.isDark,"custom-html-tags":n.mergedParseOptions.customHtmlTags,"html-policy":n.resolvedHtmlPolicy},on:{copy:function(e){return n.emitCodeCopy(e)},"handle-artifact-click":function(e){return n.emit("handleArtifactClick",e)}}}):[n.virtualizationEnabled?t("div",{staticClass:"node-spacer",style:{height:`${n.topSpacerHeight}px`},attrs:{"aria-hidden":"true"}}):e._e(),e._l(n.renderedItems,function(o){var r;return t("div",{key:o.renderKey,ref:`node-slot-${o.index}`,refInFor:!0,staticClass:"node-slot",attrs:{"data-node-index":o.index,"data-node-type":o.node.type}},[n.shouldRenderNode(o.index)?t("div",{ref:`node-content-${o.index}`,refInFor:!0,staticClass:"node-content"},[o.isCodeBlock||!1===n.props.fade?t(o.component,e._b({tag:"component",attrs:{node:o.node,loading:o.node.loading,"index-key":o.indexKey,"custom-id":n.props.customId,"is-dark":n.props.isDark},on:{copy:function(e){return n.emitCodeCopy(e)},"handle-artifact-click":function(e){return n.emit("handleArtifactClick",e)}}},"component",o.bindings,!1)):t("transition",{attrs:{name:"fade",appear:""}},[t(o.component,e._b({tag:"component",attrs:{node:o.node,loading:o.node.loading,"index-key":o.indexKey,"custom-id":n.props.customId,"is-dark":n.props.isDark},on:{copy:function(e){return n.emitCodeCopy(e)},"handle-artifact-click":function(e){return n.emit("handleArtifactClick",e)}}},"component",o.bindings,!1))],1)],1):t("div",{staticClass:"node-placeholder",style:{height:`${null!=(r=n.nodeHeights[o.index])?r:n.averageNodeHeight}px`}})])}),n.virtualizationEnabled?t("div",{staticClass:"node-spacer",style:{height:`${n.bottomSpacerHeight}px`},attrs:{"aria-hidden":"true"}}):e._e()],n.showTypewriterCursor?t("span",{ref:"typewriterCursorRef",staticClass:"typewriter-cursor",attrs:{"aria-hidden":"true"}}):e._e()],2)},[],!1,null,"c219138d",null,null).exports,Jt=M(m.defineComponent({__name:"AdmonitionNode",props:{node:null,indexKey:null,isDark:{type:Boolean},typewriter:{type:Boolean},customId:null},emits:["copy"],setup(e,{emit:t}){var n;const o=e,r=m.computed(()=>{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)}),l=m.ref(!!o.node.collapsible&&!(null==(n=o.node.open)||n)),i=`admonition-${Math.random().toString(36).slice(2,9)}`,a=m.getCurrentInstance(),s=m.computed(()=>w(null==a?void 0:a.proxy)?Pt:Zt);return{__sfc:!0,props:o,emit:t,iconMap:{note:"ℹ️",info:"ℹ️",tip:"💡",warning:"⚠️",danger:"❗",error:"⛔",caution:"⚠️"},displayTitle:r,collapsed:l,toggleCollapse:function(){o.node.collapsible&&(l.value=!l.value)},headerId:i,instance:a,nestedRenderer:s}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("div",{staticClass:"admonition",class:[`admonition-${n.props.node.kind}`,n.props.isDark?"is-dark":""]},[t("div",{staticClass:"admonition-header",attrs:{id:n.headerId}},[n.iconMap[n.props.node.kind]?t("span",{staticClass:"admonition-icon"},[e._v(e._s(n.iconMap[n.props.node.kind]))]):e._e(),t("span",{staticClass:"admonition-title"},[e._v(e._s(n.displayTitle))]),n.props.node.collapsible?t("button",{staticClass:"admonition-toggle",attrs:{"aria-expanded":!n.collapsed,"aria-controls":`${n.headerId}-content`,title:n.collapsed?"Expand":"Collapse"},on:{click:n.toggleCollapse}},[n.collapsed?t("span",[e._v("▶")]):t("span",[e._v("▼")])]):e._e()]),t("div",{directives:[{name:"show",rawName:"v-show",value:!n.collapsed,expression:"!collapsed"}],staticClass:"admonition-content",attrs:{id:`${n.headerId}-content`,"aria-labelledby":n.headerId}},[t(n.nestedRenderer,{tag:"component",attrs:{"index-key":`admonition-${e.indexKey}`,nodes:n.props.node.children,"custom-id":n.props.customId,typewriter:n.props.typewriter},on:{copy:function(e){return n.emit("copy",e)}}})],1)])},[],!1,null,"f9c1d6b9",null,null).exports,en=()=>import("@terrastruct/d2");let tn=null,nn=en;function on(e){nn=e,tn=null}const rn=M(m.defineComponent({__name:"D2BlockNode",props:{node:null,maxHeight:{default:void 0},loading:{type:Boolean,default:!0},isDark:{type:Boolean},progressiveRender:{type:Boolean,default:!0},progressiveIntervalMs:{default:700},themeId:null,darkThemeId:null,showHeader:{type:Boolean,default:!0},showModeToggle:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExportButton:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0}},setup(e){const t=e,{t:n}=se(),o=m.ref(!1),r=m.ref(!1),l=m.ref(!1),i=m.ref(!1),a=m.ref(null),u=m.ref(!1),c=m.ref(""),p=m.ref(0),f=m.ref(null),v=m.ref(null),h=m.computed(()=>{var e;return null!=(e=t.node.code)?e:""}),g=m.computed(()=>l.value||!i.value||!c.value),y=m.computed(()=>!!c.value),w=m.computed(()=>{if(g.value&&v.value)return{minHeight:`${v.value}px`}}),x=m.computed(()=>{if("none"===t.maxHeight)return{maxHeight:"none","--ms-d2-render-max-height":"none"};if(null!=t.maxHeight){const e="number"==typeof t.maxHeight?`${t.maxHeight}px`:String(t.maxHeight);return{maxHeight:e,"--ms-d2-render-max-height":e}}}),k="undefined"!=typeof window;let M=null,b=!1,C=!1,T=0,N=null,_=!1,D=null;const I={N1:"#E5E7EB",N2:"#CBD5E1",N3:"#94A3B8",N4:"#64748B",N5:"#475569",N6:"#334155",N7:"#0B1220",B1:"#60A5FA",B2:"#3B82F6",B3:"#2563EB",B4:"#1D4ED8",B5:"#1E40AF",B6:"#111827",AA2:"#22D3EE",AA4:"#0EA5E9",AA5:"#0284C7",AB4:"#FBBF24",AB5:"#F59E0B"};function S(e){return!e||e.disabled}const j=[/javascript:/i,/expression\s*\(/i,/url\s*\(\s*javascript:/i,/@import/i],E=/^(?:https?:|mailto:|tel:|#|\/|data:image\/(?:png|gif|jpe?g|webp);)/i;function L(e){return e.replace(/["']\s*javascript:/gi,"#").replace(/\bjavascript:/gi,"#").replace(/["']\s*vbscript:/gi,"#").replace(/\bvbscript:/gi,"#").replace(/\bdata:text\/html/gi,"#")}function B(e){if(!e)return"";const t=e.trim();return E.test(t)?t:""}function A(e){const t=new Set(["script"]),n=[e,...Array.from(e.querySelectorAll("*"))];for(const o of n){if(t.has(o.tagName.toLowerCase())){o.remove();continue}const e=Array.from(o.attributes);for(const t of e){const e=t.name;if(/^on/i.test(e))o.removeAttribute(e);else{if("style"===e&&t.value){const n=t.value;if(j.some(e=>e.test(n))){o.removeAttribute(e);continue}}if(("href"===e||"xlink:href"===e)&&t.value){const n=B(t.value);if(!n){o.removeAttribute(e);continue}n!==t.value&&o.setAttribute(e,n)}}}}}function O(e){if("undefined"==typeof window||"undefined"==typeof DOMParser)return"";if(!e)return"";const t=L(e),n=(new DOMParser).parseFromString(t,"image/svg+xml").documentElement;if(!n||"svg"!==n.nodeName.toLowerCase())return"";const o=n;return A(o),o.classList.add("markstream-d2-root-svg"),o.outerHTML}function z(e){const t=O(e);c.value=t||""}function P(){c.value=""}function R(e){return e?"string"==typeof e?e:"string"==typeof e.svg?e.svg:"string"==typeof e.data?e.data:"":""}function H(){return d(this,null,function*(){if(M)return M;const e=yield function(){return d(this,null,function*(){if(tn)return tn;const e=nn;if(!e)return null;let t;try{t=yield e()}catch(n){if(e===en)throw new Error('Optional dependency "@terrastruct/d2" is not installed. Please install it to enable D2 diagrams.');throw n}return t?(tn=function(e){var t;if(!e)return e;if(e.D2&&"function"==typeof e.D2)return e.D2;if(e.default&&e.default.D2&&"function"==typeof e.default.D2)return e.default.D2;const n=null!=(t=e.default)?t:e;return"function"==typeof n?n:(null==n?void 0:n.D2)&&"function"==typeof n.D2?n.D2:n}(t),tn):null})}();if(!e)return null;if("function"==typeof e){const t=new e;return t&&"function"==typeof t.compile?M=t:"function"==typeof e.compile&&(M=e),M}return(null==e?void 0:e.D2)&&"function"==typeof e.D2?(M=new e.D2,M):("function"==typeof e.compile&&(M=e),M)})}function $(){return d(this,null,function*(){var e,n,o,r,d;if(!k||C)return;if(t.loading&&!t.progressiveRender)return;const c=h.value;if(!c)return P(),void(a.value=null);const m=++p.value;u.value=!0,a.value=null;try{const u=yield H();if(!u)return i.value=!1,l.value=!0,P(),void(a.value="D2 is not available.");if("function"!=typeof u.compile||"function"!=typeof u.render)throw new TypeError("D2 instance is missing compile/render methods.");i.value=!0;const f=yield u.compile(c);if(m!==p.value)return;const v=null!=(e=null==f?void 0:f.diagram)?e:f,h=null!=(o=null!=(n=null==f?void 0:f.renderOptions)?n:null==f?void 0:f.options)?o:{},g=null!=(r=t.themeId)?r:h.themeID,y=null!=(d=t.darkThemeId)?d:h.darkThemeID,w=s({},h);if(w.themeID=t.isDark&&null!=y?y:g,w.darkThemeID=null,w.darkThemeOverrides=null,t.isDark){const e=h.themeOverrides&&"object"==typeof h.themeOverrides?h.themeOverrides:null;w.themeOverrides=s(s({},I),e||{})}const x=yield u.render(v,w);if(m!==p.value)return;const k=R(x);if(!k)throw new Error("D2 render returned empty output.");z(k),t.loading&&(l.value=!1),a.value=null}catch(f){if(m!==p.value)return;const e=(null==f?void 0:f.message)?String(f.message):"D2 render failed.";t.loading||(a.value=e),e.includes("@terrastruct/d2")&&(i.value=!1,l.value=!0)}finally{m===p.value&&(u.value=!1,_&&(_=!1,U()))}})}function U(e=!1){if(b)return;if(!k)return;if(C)return;if(u.value)return void(_=!0);const n=Math.max(120,Number(t.progressiveIntervalMs)||0),o=Date.now()-T;if(!e&&o<n)return _=!0,void(null==N&&(N=window.setTimeout(()=>{N=null,_&&(_=!1,U(!0))},Math.max(0,n-o))));b=!0;const r=()=>{b=!1,T=Date.now(),$()};"undefined"!=typeof window&&"function"==typeof window.requestAnimationFrame?window.requestAnimationFrame(r):setTimeout(r,0)}function F(){const e=f.value;if(!e)return;const t=e.getBoundingClientRect().height;t>0&&(v.value=t)}return m.watch(()=>[t.node.code,t.loading,t.isDark],()=>{U()},{immediate:!0}),m.watch(()=>t.loading,(e,t)=>{t&&!e&&U(!0)}),m.watch(()=>[g.value,c.value,h.value],()=>{m.nextTick(()=>{F()})}),m.onMounted(()=>{U(),m.nextTick(()=>{F()}),"undefined"!=typeof ResizeObserver&&(D=new ResizeObserver(()=>{F()}),f.value&&D.observe(f.value))}),m.onBeforeUnmount(()=>{C=!0,null!=N&&(clearTimeout(N),N=null),null==D||D.disconnect(),D=null}),{__sfc:!0,props:t,t:n,copyText:o,isCollapsed:r,showSource:l,d2Available:i,renderError:a,isRendering:u,svgMarkup:c,renderToken:p,bodyRef:f,bodyMinHeight:v,baseCode:h,showSourceFallback:g,hasPreview:y,bodyStyle:w,renderStyle:x,isClient:k,d2Instance:M,scheduled:b,unmounted:C,lastRenderAt:T,throttleTimer:N,pendingRender:_,bodyObserver:D,DARK_THEME_OVERRIDES:I,shouldSkipEventTarget:S,onBtnHover:function(e,n,o="top"){if(S(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;re(e.currentTarget,n,o,!1,l,t.isDark)},onBtnLeave:function(){le()},onCopyHover:function(e){if(S(e.currentTarget))return;const r=o.value?n("common.copied")||"Copied":n("common.copy")||"Copy",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;re(e.currentTarget,r,"top",!1,i,t.isDark)},copy:function(){return d(this,null,function*(){try{const e=h.value;"undefined"!=typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.writeText&&(yield navigator.clipboard.writeText(e)),o.value=!0,setTimeout(()=>{o.value=!1},1e3)}catch(e){console.error("Copy failed:",e)}})},toggleCollapse:function(){r.value=!r.value},handleSwitchMode:function(e){l.value="source"===e},DISALLOWED_STYLE_PATTERNS:j,SAFE_URL_PROTOCOLS:E,neutralizeScriptProtocols:L,sanitizeUrl:B,scrubSvgElement:A,toSafeSvgMarkup:O,setSvg:z,clearSvg:P,extractSvg:R,ensureD2Instance:H,renderDiagram:$,scheduleRender:U,exportSvg:function(){if(c.value)try{const e=new Blob([c.value],{type:"image/svg+xml;charset=utf-8"}),t=URL.createObjectURL(e);if("undefined"!=typeof document){const e=document.createElement("a");e.href=t,e.download=`d2-diagram-${Date.now()}.svg`,document.body.appendChild(e),e.click(),document.body.removeChild(e)}URL.revokeObjectURL(t)}catch(e){console.error("Failed to export SVG:",e)}},updateBodyMinHeight:F}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("div",{staticClass:"d2-block-container my-4 rounded-lg border overflow-hidden shadow-sm",class:n.props.isDark?"border-gray-700/30 bg-gray-900 text-gray-100":"border-gray-200 bg-white text-gray-900"},[n.props.showHeader?t("div",{staticClass:"d2-block-header flex justify-between items-center px-4 py-2.5 border-b border-gray-400/5",staticStyle:{color:"var(--vscode-editor-foreground)","background-color":"var(--vscode-editor-background)"}},[e._m(0),t("div",{staticClass:"flex items-center gap-x-2"},[n.props.showModeToggle?t("div",{staticClass:"flex items-center gap-x-1 rounded-md p-0.5",class:n.props.isDark?"bg-gray-700":"bg-gray-100"},[t("button",{staticClass:"mode-btn px-2 py-1 text-xs rounded",class:n.showSource?"":"is-active",attrs:{type:"button"},on:{click:function(e){return n.handleSwitchMode("preview")},mouseenter:function(e){n.onBtnHover(e,n.t("common.preview")||"Preview")},focus:function(e){n.onBtnHover(e,n.t("common.preview")||"Preview")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[e._v(" "+e._s(n.t("common.preview")||"Preview")+" ")]),t("button",{staticClass:"mode-btn px-2 py-1 text-xs rounded",class:n.showSource?"is-active":"",attrs:{type:"button"},on:{click:function(e){return n.handleSwitchMode("source")},mouseenter:function(e){n.onBtnHover(e,n.t("common.source")||"Source")},focus:function(e){n.onBtnHover(e,n.t("common.source")||"Source")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[e._v(" "+e._s(n.t("common.source")||"Source")+" ")])]):e._e(),n.props.showCopyButton?t("button",{staticClass:"d2-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",attrs:{type:"button","aria-label":n.copyText?n.t("common.copied")||"Copied":n.t("common.copy")||"Copy"},on:{click:n.copy,mouseenter:function(e){return n.onCopyHover(e)},focus:function(e){return n.onCopyHover(e)},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[n.copyText?t("svg",{staticClass:"w-3 h-3",attrs:{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"}})]):t("svg",{staticClass:"w-3 h-3",attrs:{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("rect",{attrs:{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}}),t("path",{attrs:{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"}})])])]):e._e(),n.props.showExportButton&&n.svgMarkup?t("button",{staticClass:"d2-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",attrs:{type:"button","aria-label":n.t("common.export")||"Export"},on:{click:n.exportSvg,mouseenter:function(e){n.onBtnHover(e,n.t("common.export")||"Export")},focus:function(e){n.onBtnHover(e,n.t("common.export")||"Export")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"w-3 h-3",attrs:{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 3v12m0-12l-4 4m4-4l4 4M4 14v4a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-4"}})])]):e._e(),n.props.showCollapseButton?t("button",{staticClass:"d2-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",attrs:{type:"button","aria-pressed":n.isCollapsed},on:{click:n.toggleCollapse,mouseenter:function(e){n.onBtnHover(e,n.isCollapsed?n.t("common.expand")||"Expand":n.t("common.collapse")||"Collapse")},focus:function(e){n.onBtnHover(e,n.isCollapsed?n.t("common.expand")||"Expand":n.t("common.collapse")||"Collapse")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"w-3 h-3",style:{rotate:n.isCollapsed?"0deg":"90deg"},attrs:{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"}})])]):e._e()])]):e._e(),t("div",{directives:[{name:"show",rawName:"v-show",value:!n.isCollapsed,expression:"!isCollapsed"}],ref:"bodyRef",staticClass:"d2-block-body",style:n.bodyStyle},[n.props.loading&&!n.hasPreview?t("div",{staticClass:"d2-source px-4 py-4"},[t("pre",{staticClass:"d2-code"},[t("code",[e._v(e._s(n.baseCode))])]),n.renderError?t("p",{staticClass:"d2-error mt-2 text-xs"},[e._v(" "+e._s(n.renderError)+" ")]):e._e()]):t("div",[n.showSourceFallback?t("div",{staticClass:"d2-source px-4 py-4"},[t("pre",{staticClass:"d2-code"},[t("code",[e._v(e._s(n.baseCode))])]),n.renderError?t("p",{staticClass:"d2-error mt-2 text-xs"},[e._v(" "+e._s(n.renderError)+" ")]):e._e()]):t("div",{staticClass:"d2-render",style:n.renderStyle},[t("div",{staticClass:"d2-svg",domProps:{innerHTML:e._s(n.svgMarkup)}}),n.renderError?t("p",{staticClass:"d2-error px-4 pb-3 text-xs"},[e._v(" "+e._s(n.renderError)+" ")]):e._e()])])])])},[function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",{staticClass:"flex items-center gap-x-2"},[t("span",{staticClass:"text-sm font-medium font-mono"},[e._v("D2")])])}],!1,null,"9fa97269",null,null).exports;rn.install=e=>{e.component(rn.__name,rn)};const ln=Object.freeze(Object.defineProperty({__proto__:null,default:rn},Symbol.toStringTag,{value:"Module"}));let an=null,sn=null;const un=M(m.defineComponent({__name:"InfographicBlockNode",props:{node:null,maxHeight:{default:"500px"},estimatedPreviewHeightPx:null,loading:{type:Boolean,default:!0},isDark:{type:Boolean},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"],setup(e,{emit:t}){const n=e,{t:o}=se(),r=m.ref(!1),l=m.ref(!1),i=m.ref(),a=m.ref(!1),s=m.ref(!1),u=m.ref(),c=m.ref(null),f=m.computed(()=>n.node.code),v=m.ref(!1),h=m.ref(!1),g=m.computed(()=>n.maxHeight&&"none"!==n.maxHeight?Wt(n.maxHeight):null),y=m.computed(()=>{var e;return null!=(e=Wt(n.estimatedPreviewHeightPx))?e:Vt(f.value)});function w(){var e;return null!=(e=Wt(i.value?getComputedStyle(i.value).getPropertyValue("--ms-size-diagram-min-height").trim():""))?e:360}function x(){return Gt(y.value,w(),g.value)}const k=m.ref(`${x()}px`);function M(e){const t=x();if(!n.maxHeight||"none"===n.maxHeight)return`${Math.max(e,t)}px`;const o=g.value;return null==o?`${Math.max(e,t)}px`:`${Math.max(Math.min(e,o),t)}px`}function b(){if(!i.value)return;const e=i.value.scrollHeight;e>0&&(k.value=M(e))}const C=m.ref(1),T=m.ref(0),N=m.ref(0),_=m.ref(!1);function D(e){return!e||e.disabled}function I(e){return d(this,null,function*(){try{const n=(new XMLSerializer).serializeToString(e),o=new Blob([n],{type:"image/svg+xml;charset=utf-8"}),r=URL.createObjectURL(o);if("undefined"!=typeof document){const e=document.createElement("a");e.href=r,e.download=`infographic-${Date.now()}.svg`;try{document.body.appendChild(e),e.click(),document.body.removeChild(e)}catch(t){}URL.revokeObjectURL(r)}}catch(n){console.error("Failed to export SVG:",n)}})}function S(e){"Escape"===e.key&&s.value&&E()}function j(){if(s.value=!0,"undefined"!=typeof document)try{document.body.style.overflow="hidden"}catch(e){}if("undefined"!=typeof window)try{window.addEventListener("keydown",S)}catch(e){}m.nextTick(()=>{if(i.value&&u.value){u.value.innerHTML="";const e=document.createElement("div");e.style.transition="transform 0.1s ease",e.style.transformOrigin="center center",e.style.width="100%",e.style.height="100%",e.style.display="flex",e.style.alignItems="center",e.style.justifyContent="center";const t=i.value.cloneNode(!0);t.classList.add("fullscreen"),t.style.height="auto",e.appendChild(t),u.value.appendChild(e),c.value=e,e.style.transform=`translate(${T.value}px, ${N.value}px) scale(${C.value})`}})}function E(){if(s.value=!1,u.value&&(u.value.innerHTML=""),c.value=null,"undefined"!=typeof document)try{document.body.style.overflow=""}catch(e){}if("undefined"!=typeof window)try{window.removeEventListener("keydown",S)}catch(e){}}m.watch(y,()=>{if(a.value||l.value)return;const e=x(),t=Wt(k.value);(null==t||t<e)&&(k.value=`${e}px`)});const L=m.computed(()=>s.value||C.value>1),B=p.createPanGesture({getTranslate:()=>({x:T.value,y:N.value}),setTranslate:e=>{T.value=e.x,N.value=e.y},canStart:e=>!!v.value&&("touch"!==e.pointerType||L.value),onActiveChange:e=>_.value=e}),A=B.start,O=B.stop;m.onBeforeUnmount(O);let z=null,P=!1,R=!1,H=!1,$=!1,U=!1,F="",Y=!1,K=0;function W(e=!1){return d(this,null,function*(){var t,o,r,l,a,s;if(Y||!i.value)return;if(P)return R=!0,void(H=H||e);const u=f.value;if(!e&&u===F&&v.value)return;const c=f.value,p=!1===n.loading,g=++K;P=!0;let y=null,w=null;try{const e=yield function(){return d(this,null,function*(){return sn||an||(an=import("@antv/infographic").then(e=>{const t=e&&e.default?e.default:e;let n=t;return"function"==typeof t&&t.prototype&&t.prototype.render?n=t:e.Infographic?n=e.Infographic:t&&t.Infographic&&(n=t.Infographic),sn=n,n}).catch(e=>(console.warn("Failed to load @antv/infographic",e),null)),an)})}();if(Y||g!==K)return;if(!e)throw new Error("Infographic library failed to load.");const l=i.value;if(!l)return;const a=!0===n.loading;if(!(u===f.value||!p&&a&&f.value.startsWith(c)))return;w=Array.from(l.childNodes),y=new e({container:l,width:"100%",height:"100%"});let s="",x=!1;if(null==(t=y.on)||t.call(y,"error",e=>{const t=Array.isArray(e)?e:[e];s=t.map(e=>{var t;return e instanceof Error?e.message:"string"==typeof e?e:String(e&&"object"==typeof e&&"message"in e?null!=(t=e.message)?t:"":null!=e?e:"")}).filter(Boolean).join("; ")}),null==(o=y.on)||o.call(y,"rendered",()=>{x=!0}),y.render(c),s)throw new Error(s);const k=Array.from(l.childNodes),M=k.length>0&&(k.length!==w.length||k.some((e,t)=>e!==(null==w?void 0:w[t])));if(!x&&!M)throw new Error("Infographic render returned empty output.");null==(r=null==z?void 0:z.destroy)||r.call(z),z=y,y=null,v.value=!0,h.value=!1,F=u,m.nextTick(()=>{Y||g!==K||b()})}catch(x){if(Y||g!==K)return;null==(l=null==y?void 0:y.destroy)||l.call(y),y=null,p&&!1===n.loading&&u===f.value?(console.error("Failed to render infographic:",x),null==(a=null==z?void 0:z.destroy)||a.call(z),z=null,v.value=!1,h.value=!0,F="",i.value&&(i.value.innerHTML=`<div class="text-red-500 p-4">Failed to render infographic: ${x instanceof Error?x.message:"Unknown error"}</div>`)):w&&i.value&&i.value.replaceChildren(...w)}finally{if(null==(s=null==y?void 0:y.destroy)||s.call(y),P=!1,!Y&&g===K&&R){const e=H;R=!1,H=!1,Q(e)}}})}function Q(e=!1){Y||a.value||l.value||(U=U||e,$||($=!0,m.nextTick(()=>{$=!1;const e=U;U=!1,Y||W(e)})))}m.watch(()=>f.value,()=>{Q(!0)}),m.watch(()=>n.loading,(e,t)=>{t&&!e&&Q(!0)}),m.watch(()=>a.value,e=>{e||Q(!0)}),m.watch(()=>l.value,e=>{e||Q()}),m.watch(()=>n.maxHeight,()=>{m.nextTick(b)}),m.onMounted(()=>{Q()}),m.onBeforeUnmount(()=>{var e;if(Y=!0,K+=1,R=!1,H=!1,$=!1,U=!1,z&&(null==(e=z.destroy)||e.call(z),z=null),"undefined"!=typeof window)try{window.removeEventListener("keydown",S)}catch(t){}});const V=m.computed(()=>n.isDark?"infographic-action-btn p-2 text-xs rounded text-gray-400 hover:bg-gray-700 hover:text-gray-200":"infographic-action-btn p-2 text-xs rounded text-gray-600 hover:bg-gray-200 hover:text-gray-700"),X=m.computed(()=>a.value||l.value),q=m.computed(()=>({transform:`translate(${T.value}px, ${N.value}px) scale(${C.value})`}));return m.watch(q,e=>{s.value&&c.value&&(c.value.style.transform=e.transform)}),{__sfc:!0,props:n,_emits:t,t:o,copyText:r,isCollapsed:l,infographicContainer:i,showSource:a,isModalOpen:s,modalContent:u,modalCloneWrapper:c,baseCode:f,hasPreview:v,hasRenderError:h,maxPreviewHeight:g,estimatedPreviewHeight:y,resolveMinContainerHeight:w,resolveEstimatedPreviewHeight:x,containerHeight:k,resolveContainerHeight:M,updateContainerHeight:b,zoom:C,translateX:T,translateY:N,isDragging:_,shouldSkipEventTarget:D,onBtnHover:function(e,t,o="top"){if(D(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;re(e.currentTarget,t,o,!1,l,n.isDark)},onBtnLeave:function(){le()},onCopyHover:function(e){if(D(e.currentTarget))return;const t=r.value?o("common.copied")||"Copied":o("common.copy")||"Copy",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;re(e.currentTarget,t,"top",!1,i,n.isDark)},copy:function(){return d(this,null,function*(){try{const e=f.value;"undefined"!=typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.writeText&&(yield navigator.clipboard.writeText(e)),r.value=!0,setTimeout(()=>{r.value=!1},1e3)}catch(e){console.error("Failed to copy:",e)}})},handleSwitchMode:function(e){a.value="source"===e},handleExportClick:function(){var e;const t=null==(e=i.value)?void 0:e.querySelector("svg");t?I(t):console.error("SVG element not found")},exportSvg:I,handleKeydown:S,openModal:j,closeModal:E,handleOpenModalClick:function(){j()},zoomIn:function(){C.value<3&&(C.value+=.1)},zoomOut:function(){C.value>.5&&(C.value-=.1)},resetZoom:function(){C.value=1,T.value=0,N.value=0},panSurfaceClaimsTouch:L,panGesture:B,startDrag:A,stopDrag:O,infographicInstance:z,renderInFlight:P,rerenderQueued:R,rerenderForce:H,renderScheduled:$,renderScheduledForce:U,lastCompletedRenderSignature:F,unmounted:Y,renderGeneration:K,renderInfographic:W,queueInfographicRender:Q,computedButtonStyle:V,isFullscreenDisabled:X,transformStyle:q,infographicIconUrl:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTUuNTIiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAyOTEgMzAwIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxnPjxwYXRoIGQ9Ik0xNDAuOTA0IDIzOS4zNzZDMTI4LjgzIDIzOS42ODMgMTE5LjY3NSAyMzkuMjk5IDExNS40NDggMjQzLjg0M0MxMTAuOTAyIDI0OC4wNyAxMTEuMjg4IDI1Ny4yMjcgMTEwLjk3OSAyNjkuMzAyQzExMS4xMTggMjc0LjY3NSAxMTEuMTE4IDI3OS40NzggMTExLjQ3MiAyODMuNTJDMTExLjY2MiAyODUuNjM4IDExMS45NSAyODcuNTQ3IDExMi40MDYgMjg5LjIyNEMxMTIuNDExIDI4OS4yNDMgMTEyLjQxNiAyODkuMjU5IDExMi40MjIgMjg5LjI4QzExMi40NjIgMjg5LjQxOSAxMTIuNDk2IDI4OS41NTggMTEyLjUzOSAyODkuNjkxQzExMy4xNjggMjkxLjc4NyAxMTQuMDg4IDI5My40OTEgMTE1LjQ0NiAyOTQuNzU4QzExNi42NjIgMjk2LjA2NCAxMTguMjgzIDI5Ni45NjMgMTIwLjI2NCAyOTcuNjlDMTIwLjM2IDI5Ny42MTQgMTIwLjQ2NCAyOTcuNjQ2IDEyMC41NTUgMjk3LjY3NUMxMjAuNTYgMjk3LjY4IDEyMC41NiAyOTcuNjggMTIwLjU2NiAyOTcuNjhDMTIwLjg0OCAyOTcuNzY4IDEyMS4xNDIgMjk3Ljg0NiAxMjEuNDQzIDI5Ny45MjNDMTIxLjQ1NCAyOTcuOTIzIDEyMS40NjQgMjk3LjkyOCAxMjEuNDc4IDI5Ny45MzRDMTIyLjg3NSAyOTguMjcyIDEyNC40MjQgMjk4LjUwNyAxMjYuMTEgMjk4LjY3OEMxMjYuMzI2IDI5OC42OTYgMTI2LjU0MiAyOTguNzE4IDEyNi43NjMgMjk4LjczOUMxMzAuNzkgMjk5LjA4NiAxMzUuNTU4IDI5OS4wODggMTQwLjkwNCAyOTkuMjIyQzE1Mi45NzQgMjk4LjkxMiAxNjIuMTI4IDI5OS4zMDIgMTY2LjM2IDI5NC43NThDMTcwLjkwNCAyOTAuNTI2IDE3MC41MTUgMjgxLjM3MSAxNzAuODI0IDI2OS4zMDJDMTcwLjUxNSAyNTcuMjI3IDE3MC45MDcgMjQ4LjA3IDE2Ni4zNiAyNDMuODQzQzE2Mi4xMzEgMjM5LjI5OSAxNTIuOTc0IDIzOS42ODMgMTQwLjkwNCAyMzkuMzc2WiIgZmlsbD0iI0ZGNjM3NiI+PC9wYXRoPjxwYXRoIGQ9Ik0yMS4yMTU1IDEyOC4zOThDMTIuNjU1NSAxMjguNjE2IDYuMTY0ODQgMTI4LjMzOSAzLjE2NzUxIDEzMS41NkMtMC4wNTM4MjIyIDEzNC41NiAwLjIxODE3OCAxNDEuMDU0IC0wLjAwMDQ4ODI4MSAxNDkuNjA4QzAuMjE4MTc4IDE1OC4xNjggLTAuMDUzODIyMiAxNjQuNjU5IDMuMTY3NTEgMTY3LjY1NkM2LjE2NDg0IDE3MC44NzggMTIuNjU1NSAxNzAuNjA2IDIxLjIxNTUgMTcwLjgyNEMyNS4wMjYyIDE3MC43MjYgMjguNDI4OCAxNzAuNzI2IDMxLjI5NTUgMTcwLjQ3NUMzMi43OTY4IDE3MC4zNDIgMzQuMTQ4OCAxNzAuMTM2IDM1LjMzODIgMTY5LjgxNEMzNS4zNTQyIDE2OS44MTEgMzUuMzY0OCAxNjkuODA2IDM1LjM3ODIgMTY5LjgwM0MzNS40NzY4IDE2OS43NzQgMzUuNTc1NSAxNjkuNzQ3IDM1LjY2ODggMTY5LjcxOEMzNy4xNTY4IDE2OS4yNzIgMzguMzY0OCAxNjguNjIyIDM5LjI2MzUgMTY3LjY1NkM0MC4xOTE1IDE2Ni43OTUgNDAuODI2MiAxNjUuNjQ2IDQxLjI3MTUgMTY0LjI0M0M0MS4yODc1IDE2NC4xNzQgNDEuMzExNSAxNjQuMTAyIDQxLjMzMjggMTY0LjAzNUM0MS4zMzI4IDE2NC4wMzUgNDEuMzM1NSAxNjQuMDMyIDQxLjMzNTUgMTY0LjAyN0M0MS4zOTY4IDE2My44MjcgNDEuNDUyOSAxNjMuNjIyIDQxLjUwNjIgMTYzLjQwNkM0MS41MDYyIDE2My4zOTggNDEuNTExNSAxNjMuMzkyIDQxLjUxNDIgMTYzLjM4MkM0MS43NTQyIDE2Mi4zOTIgNDEuOTIyMiAxNjEuMjk0IDQyLjA0MjIgMTYwLjA5NkM0Mi4wNTU1IDE1OS45NDQgNDIuMDcxNSAxNTkuNzkyIDQyLjA4NDggMTU5LjYzNUM0Mi4zMzI4IDE1Ni43NzkgNDIuMzMyOCAxNTMuMzk4IDQyLjQyNjIgMTQ5LjYwOEM0Mi4yMDc1IDE0MS4wNTQgNDIuNDg0OCAxMzQuNTYgMzkuMjYzNSAxMzEuNTZDMzYuMjYzNSAxMjguMzM5IDI5Ljc3MjggMTI4LjYxNiAyMS4yMTU1IDEyOC4zOThaIiBmaWxsPSIjRkZDQ0NDIj48L3BhdGg+PHBhdGggZD0iTTgxLjA1OTUgMTg0LjE3MUM3MC44NTY4IDE4NC40MzMgNjMuMTIwOCAxODQuMTAyIDU5LjU0NzUgMTg3Ljk0MkM1NS43MDc1IDE5MS41MTggNTYuMDMyOCAxOTkuMjU0IDU1Ljc3NDIgMjA5LjQ1NEM1Ni4wMzI4IDIxOS42NTcgNTUuNzA3NSAyMjcuMzkzIDU5LjU0NzUgMjMwLjk2M0M2My4xMjA4IDIzNC44MDMgNzAuODU2OCAyMzQuNDc4IDgxLjA1OTUgMjM0LjczOUM4NS42MDA4IDIzNC42MjIgODkuNjU5NSAyMzQuNjIyIDkzLjA3MjggMjM0LjMyM0M5NC44NjQ4IDIzNC4xNjMgOTYuNDc1NSAyMzMuOTIxIDk3Ljg5NDIgMjMzLjUzNEM5Ny45MTAyIDIzMy41MjkgOTcuOTIzNSAyMzMuNTI2IDk3Ljk0MjIgMjMzLjUyMUM5OC4wNTY4IDIzMy40ODYgOTguMTc0MiAyMzMuNDU3IDk4LjI4ODggMjMzLjQyMkMxMDAuMDYgMjMyLjg4OSAxMDEuNSAyMzIuMTEzIDEwMi41NjkgMjMwLjk2M0MxMDMuNjc2IDIyOS45MzcgMTA0LjQzMyAyMjguNTY2IDEwNC45NjQgMjI2Ljg5NEMxMDQuOTg1IDIyNi44MTEgMTA1LjAxMiAyMjYuNzI2IDEwNS4wMzYgMjI2LjY0NkMxMDUuMDQxIDIyNi42NDMgMTA1LjA0MSAyMjYuNjQzIDEwNS4wNDEgMjI2LjYzOEMxMDUuMTE2IDIyNi40MDEgMTA1LjE4IDIyNi4xNTMgMTA1LjI0NCAyMjUuODk3QzEwNS4yNDQgMjI1Ljg4OSAxMDUuMjQ5IDIyNS44ODEgMTA1LjI1NCAyMjUuODY3QzEwNS41NCAyMjQuNjg5IDEwNS43NCAyMjMuMzc5IDEwNS44ODEgMjIxLjk1M0MxMDUuOSAyMjEuNzcxIDEwNS45MTYgMjIxLjU5IDEwNS45MzQgMjIxLjQwM0MxMDYuMjI4IDIxOC4wMDEgMTA2LjIyOCAyMTMuOTY5IDEwNi4zNDIgMjA5LjQ1NEMxMDYuMDgxIDE5OS4yNTQgMTA2LjQxMiAxOTEuNTE4IDEwMi41NzIgMTg3Ljk0MkM5OC45OTU1IDE4NC4xMDIgOTEuMjU2OCAxODQuNDMzIDgxLjA1OTUgMTg0LjE3MVoiIGZpbGw9IiNGRjkzOUYiPjwvcGF0aD48cGF0aCBkPSJNMjYwLjU5MSAxNTEuODdDMjE1LjY1MiAxNTEuODcgMjAzLjAyIDE2NC41MjMgMjAzLjAyIDIwOS40NjJIMTk4LjQ3NkMxOTguNDc2IDE2NC41MjMgMTg1LjgzNiAxNTEuODgxIDE0MC44OTUgMTUxLjg4MVYxNDcuMzM3QzE4NS44MzYgMTQ3LjMzNyAxOTguNDg3IDEzNC43MDUgMTk4LjQ4NyA4OS43NjU5SDIwMy4wMkMyMDMuMDIgMTM0LjcwNSAyMTUuNjUyIDE0Ny4zMzcgMjYwLjU5MSAxNDcuMzM3VjE1MS44N1pNMjg2LjA1MiAxMjQuMTU4QzI4MS44MiAxMTkuNjE0IDI3Mi42NiAxMjAuMDAxIDI2MC41OTEgMTE5LjY4OUMyNDguNTIxIDExOS4zODUgMjM5LjM2MSAxMTkuNzcxIDIzNS4xMjkgMTE1LjIyN0MyMzAuNTg1IDExMC45OTUgMjMwLjk4MyAxMDEuODQ2IDIzMC42NzEgODkuNzY1OUMyMzAuNTEzIDgzLjczMTIgMjMwLjUzNSA3OC40MjcyIDIzMC4wMjMgNzQuMTAxOUMyMjkuNTEzIDY5Ljc2NTkgMjI4LjQ4MSA2Ni40MjE5IDIyNi4yMDkgNjQuMzA0NkMyMjEuOTY3IDU5Ljc2MDYgMjEyLjgxNyA2MC4xNDcyIDIwMC43NDggNTkuODQ1OUMxODguNjgxIDYwLjE0NzIgMTc5LjUxOSA1OS43NjA2IDE3NS4yODcgNjQuMzA0NkMxNzAuNzUzIDY4LjUzNjYgMTcxLjEyOSA3Ny42OTY2IDE3MC44MjggODkuNzY1OUMxNzAuNTE2IDEwMS44MzUgMTcwLjkgMTEwLjk5NSAxNjYuMzU2IDExNS4yMjdDMTYyLjEyNCAxMTkuNzcxIDE1Mi45ODUgMTE5LjM3NCAxNDAuOTA1IDExOS42ODlDMTM4Ljg3MyAxMTkuNzM5IDEzNi45MjQgMTE5Ljc3MSAxMzUuMDcxIDExOS44MTFDMTE5LjMxMyAxMTguNjk3IDEwNi4zMzcgMTEyLjMxOCAxMDYuMzM3IDg5Ljc2NTlDMTA2LjIxMiA4NC42Njk5IDEwNi4yMzMgODAuMTc5MiAxMDUuODA3IDc2LjUyMDZDMTA1LjM2NyA3Mi44NzI2IDEwNC40OTIgNzAuMDM3OSAxMDIuNTc1IDY4LjI1NjZDOTkuMDAxMyA2NC40MTEyIDkxLjI1NzMgNjQuNzQ0NiA4MS4wNjUzIDY0LjQ4MzJDNzAuODYgNjQuNzQ0NiA2My4xMTg2IDY0LjQxMTIgNTkuNTUzMyA2OC4yNTY2QzU1LjcwOCA3MS44Mjk5IDU2LjAzMDYgNzkuNTYzMiA1NS43NjkzIDg5Ljc2NTlDNTYuMDMwNiA5OS45Njg2IDU1LjcwOCAxMDcuNzAyIDU5LjU1MzMgMTExLjI3OEM2My4xMTg2IDExNS4xMTMgNzAuODYgMTE0Ljc5IDgxLjA2NTMgMTE1LjA0OUMxMDMuNjE3IDExNS4wNDkgMTA5Ljk5NiAxMjguMDM1IDExMS4xIDE0My44MDNDMTExLjA2OCAxNDUuNjU5IDExMS4wMjggMTQ3LjU4NyAxMTAuOTc1IDE0OS42MTlDMTExLjEyMSAxNTQuOTg3IDExMS4xMjEgMTU5Ljc5IDExMS40NzYgMTYzLjgzNUMxMTEuNjYzIDE2NS45NSAxMTEuOTQ1IDE2Ny44NTcgMTEyLjQwNCAxNjkuNTM0QzExMi40MTIgMTY5LjU1NSAxMTIuNDEyIDE2OS41NjYgMTEyLjQyMyAxNjkuNTk4QzExMi40NjUgMTY5LjczNCAxMTIuNDk3IDE2OS44NjcgMTEyLjUzNyAxNzAuMDAzQzExMy4xNjQgMTcyLjA5OSAxMTQuMDkyIDE3My44MDkgMTE1LjQ0NyAxNzUuMDdDMTE2LjY2NSAxNzYuMzcxIDExOC4yODEgMTc3LjI3OCAxMjAuMjcxIDE3Ny45MDVDMTIwLjM2NCAxNzcuOTM0IDEyMC40NiAxNzcuOTU1IDEyMC41NjQgMTc3Ljk4N0MxMjAuODU1IDE3OC4wODEgMTIxLjE0NSAxNzguMTUzIDEyMS40MzkgMTc4LjIzOEMxMjEuNDYgMTc4LjIzOCAxMjEuNDcxIDE3OC4yMzggMTIxLjQ3OSAxNzguMjQ5QzEyMi44NzYgMTc4LjU4MiAxMjQuNDIgMTc4LjgyMiAxMjYuMTA4IDE3OC45ODdDMTI2LjMyNyAxNzkuMDA5IDEyNi41NDUgMTc5LjAzIDEyNi43NjQgMTc5LjA1MUMxMzAuNzg4IDE3OS4zOTUgMTM1LjU1OSAxNzkuMzk1IDE0MC45MDUgMTc5LjUyOUMxNTIuOTc1IDE3OS44NDMgMTYyLjEyNCAxNzkuNDU3IDE2Ni4zNTYgMTg0LjAwMUMxNzAuOSAxODguMjMzIDE3MC41MTYgMTk3LjM3MSAxNzAuODI4IDIwOS40NTFDMTcxLjEyOSAyMjEuNTI5IDE3MC43NDMgMjMwLjY4MSAxNzUuMjg3IDIzNC45MUMxNzkuNTE5IDIzOS40NTQgMTg4LjY4MSAyMzkuMDcgMjAwLjc0OCAyMzkuMzcxQzIwNi4xMjcgMjM5LjIzNSAyMTAuOTIxIDIzOS4yMzUgMjE0Ljk3NSAyMzguODgxQzIxNy4wNzkgMjM4LjY5NCAyMTguOTg1IDIzOC40MDMgMjIwLjY3NiAyMzcuOTU1QzIyMC42OTUgMjM3Ljk0NSAyMjAuNzA1IDIzNy45MzQgMjIwLjcyNyAyMzcuOTM0QzIyMC44NzMgMjM3Ljg5MSAyMjAuOTk5IDIzNy44NTkgMjIxLjEzNSAyMzcuODE5QzIyMy4yMjggMjM3LjE5MyAyMjQuOTM3IDIzNi4yNjUgMjI2LjIwOSAyMzQuOTFDMjI3LjUxMSAyMzMuNjkxIDIyOC40MDkgMjMyLjA2NSAyMjkuMDQ0IDIzMC4wOTdDMjI5LjA2NSAyMzAuMDAzIDIyOS4wOTUgMjI5Ljg5OSAyMjkuMTI3IDIyOS44MDNWMjI5Ljc5M0MyMjkuMjIgMjI5LjUxMyAyMjkuMjk1IDIyOS4yMjIgMjI5LjM2NyAyMjguOTE4QzIyOS4zNjcgMjI4Ljg5NyAyMjkuMzc3IDIyOC44OTcgMjI5LjM3NyAyMjguODc4QzIyOS43MjEgMjI3LjQ4MSAyMjkuOTUxIDIyNS45MzcgMjMwLjEyNyAyMjQuMjQ5QzIzMC4xMzcgMjI0LjAzIDIzMC4xNjkgMjIzLjgxMSAyMzAuMTkxIDIyMy41OTNDMjMwLjUzNSAyMTkuNTcxIDIzMC41MzUgMjE0Ljc5OCAyMzAuNjcxIDIwOS40NTFDMjMwLjk3MiAxOTcuMzcxIDIzMC41ODUgMTg4LjIzMyAyMzUuMTI5IDE4NC4wMDFDMjM5LjM2MSAxNzkuNDU3IDI0OC41MTEgMTc5Ljg0MyAyNjAuNTkxIDE3OS41MjlDMjcyLjY2IDE3OS4yMjcgMjgxLjgyIDE3OS42MTQgMjg2LjA1MiAxNzUuMDdDMjkwLjU5NiAxNzAuODM4IDI5MC4yMDkgMTYxLjY4OSAyOTAuNTExIDE0OS42MTlDMjkwLjIwOSAxMzcuNTM5IDI5MC41OTYgMTI4LjM3OSAyODYuMDUyIDEyNC4xNThaIiBmaWxsPSIjRkYzNTZBIj48L3BhdGg+PHBhdGggZD0iTTExMi40MDUgNDkuODQ4QzExMi40MTEgNDkuODY5NCAxMTIuNDE2IDQ5Ljg4MjcgMTEyLjQyMSA0OS45MDRDMTEyLjQ2MSA1MC4wNDI3IDExMi40OTkgNTAuMTgxNCAxMTIuNTM5IDUwLjMxNDdDMTEzLjE3MSA1Mi40MTM0IDExNC4wODggNTQuMTE0NyAxMTUuNDQ4IDU1LjM4NEMxMTYuNjYxIDU2LjY5MDcgMTE4LjI4MyA1Ny41ODk0IDEyMC4yNjQgNTguMjEzNEMxMjAuMzYgNTguMjQgMTIwLjQ2NCA1OC4yNjk0IDEyMC41NTUgNTguMzAxNEMxMjAuNTYgNTguMzA2NyAxMjAuNTYgNTguMzA2NyAxMjAuNTY1IDU4LjMwNjdDMTIwLjg0OCA1OC4zOTQ3IDEyMS4xNDEgNTguNDY5NCAxMjEuNDQzIDU4LjU0NjdDMTIxLjQ1MyA1OC41NDY3IDEyMS40NjQgNTguNTUyIDEyMS40OCA1OC41NTc0QzEyMi44NzUgNTguODk2IDEyNC40MjQgNTkuMTMzNCAxMjYuMTEyIDU5LjMwMTRDMTI2LjMyNSA1OS4zMjI3IDEyNi41NDEgNTkuMzQxNCAxMjYuNzYzIDU5LjM2MjdDMTMwLjc4OSA1OS43MTIgMTM1LjU2IDU5LjcxMiAxNDAuOTA0IDU5Ljg0NTRDMTUyLjk3MyA1OS41Mzg3IDE2Mi4xMjggNTkuOTI4IDE2Ni4zNiA1NS4zODRDMTcwLjkwNyA1MS4xNTIgMTcwLjUxNSA0MS45OTQ3IDE3MC44MjQgMjkuOTI1NEMxNzAuNTE3IDE3Ljg1MDcgMTcwLjkwNyA4LjY5NjAyIDE2Ni4zNjMgNC40NjkzNUMxNjIuMTMxIC0wLjA3NDY1MTEgMTUyLjk3MyAwLjMwOTM0OSAxNDAuOTA0IDEuNTI1ODhlLTA1QzEyOC44MjkgMC4zMDkzNDkgMTE5LjY3NSAtMC4wNzQ2NTExIDExNS40NDggNC40NjkzNUMxMTAuOTA0IDguNjk2MDIgMTExLjI4OCAxNy44NTA3IDExMC45NzkgMjkuOTI1NEMxMTEuMTE3IDM1LjMwMTQgMTExLjExNyA0MC4xMDE0IDExMS40NzIgNDQuMTQ0QzExMS42NjEgNDYuMjYxNCAxMTEuOTQ5IDQ4LjE3MDcgMTEyLjQwNSA0OS44NDhaIiBmaWxsPSIjRkY2Mzc2Ij48L3BhdGg+PC9nPjwvc3ZnPgo=",Portal:Ut}}}),function(){var e,t=this,n=t._self._c,o=t._self._setupProxy;return n("div",{staticClass:"my-4 rounded-lg border overflow-hidden shadow-sm",class:[o.props.isDark?"border-gray-700/30":"border-gray-200",{"is-rendering":o.props.loading}],attrs:{"data-markstream-infographic":"1","data-markstream-mode":o.showSource?"source":o.hasRenderError?"error":o.hasPreview?"preview":"pending"}},[o.props.showHeader?n("div",{staticClass:"infographic-block-header flex justify-between items-center px-4 py-2.5 border-b",class:o.props.isDark?"bg-gray-800 border-gray-700/30":"bg-gray-50 border-gray-200"},[t.$slots["header-left"]?n("div",[t._t("header-left")],2):n("div",{staticClass:"flex items-center gap-x-2 overflow-hidden"},[n("img",{staticClass:"w-4 h-4 my-0",attrs:{src:o.infographicIconUrl,alt:"Infographic"}}),n("span",{staticClass:"text-sm font-medium font-mono truncate",class:o.props.isDark?"text-gray-400":"text-gray-600"},[t._v("Infographic")])]),t.$slots["header-center"]?n("div",[t._t("header-center")],2):o.props.showModeToggle?n("div",{staticClass:"flex items-center gap-x-1 rounded-md p-0.5",class:o.props.isDark?"bg-gray-700":"bg-gray-100"},[n("button",{staticClass:"px-2.5 py-1 text-xs rounded transition-colors",class:[o.showSource?o.props.isDark?"text-gray-400 hover:text-gray-200":"text-gray-500 hover:text-gray-700":o.props.isDark?"bg-gray-600 text-gray-200 shadow-sm":"bg-white text-gray-700 shadow-sm"],on:{click:()=>o.handleSwitchMode("preview"),mouseenter:function(e){o.onBtnHover(e,o.t("common.preview")||"Preview")},focus:function(e){o.onBtnHover(e,o.t("common.preview")||"Preview")},mouseleave:o.onBtnLeave,blur:o.onBtnLeave}},[n("div",{staticClass:"flex items-center gap-x-1"},[n("svg",{staticClass:"w-3 h-3",attrs:{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"}},[n("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[n("path",{attrs:{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"}}),n("circle",{attrs:{cx:"12",cy:"12",r:"3"}})])]),n("span",[t._v(t._s(o.t("common.preview")||"Preview"))])])]),n("button",{staticClass:"px-2.5 py-1 text-xs rounded transition-colors",class:[o.showSource?o.props.isDark?"bg-gray-600 text-gray-200 shadow-sm":"bg-white text-gray-700 shadow-sm":o.props.isDark?"text-gray-400 hover:text-gray-200":"text-gray-500 hover:text-gray-700"],on:{click:()=>o.handleSwitchMode("source"),mouseenter:function(e){o.onBtnHover(e,o.t("common.source")||"Source")},focus:function(e){o.onBtnHover(e,o.t("common.source")||"Source")},mouseleave:o.onBtnLeave,blur:o.onBtnLeave}},[n("div",{staticClass:"flex items-center gap-x-1"},[n("svg",{staticClass:"w-3 h-3",attrs:{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"}},[n("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m16 18l6-6l-6-6M8 6l-6 6l6 6"}})]),n("span",[t._v(t._s(o.t("common.source")||"Source"))])])])]):t._e(),t.$slots["header-right"]?n("div",[t._t("header-right")],2):n("div",{staticClass:"flex items-center gap-x-1"},[o.props.showCollapseButton?n("button",{class:o.computedButtonStyle,attrs:{"aria-pressed":o.isCollapsed},on:{click:function(e){o.isCollapsed=!o.isCollapsed},mouseenter:function(e){o.onBtnHover(e,o.isCollapsed?o.t("common.expand")||"Expand":o.t("common.collapse")||"Collapse")},focus:function(e){o.onBtnHover(e,o.isCollapsed?o.t("common.expand")||"Expand":o.t("common.collapse")||"Collapse")},mouseleave:o.onBtnLeave,blur:o.onBtnLeave}},[n("svg",{staticClass:"w-3 h-3",style:{rotate:o.isCollapsed?"0deg":"90deg"},attrs:{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"}},[n("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"}})])]):t._e(),o.props.showCopyButton?n("button",{class:o.computedButtonStyle,on:{click:o.copy,mouseenter:function(e){return o.onCopyHover(e)},focus:function(e){return o.onCopyHover(e)},mouseleave:o.onBtnLeave,blur:o.onBtnLeave}},[o.copyText?n("svg",{staticClass:"w-3 h-3",attrs:{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"}},[n("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"}})]):n("svg",{staticClass:"w-3 h-3",attrs:{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"}},[n("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[n("rect",{attrs:{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}}),n("path",{attrs:{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"}})])])]):t._e(),o.props.showExportButton?n("button",{class:`${o.computedButtonStyle} ${o.isFullscreenDisabled?"opacity-50 cursor-not-allowed":""}`,attrs:{disabled:o.isFullscreenDisabled},on:{click:o.handleExportClick,mouseenter:function(e){o.onBtnHover(e,o.t("common.export")||"Export")},focus:function(e){o.onBtnHover(e,o.t("common.export")||"Export")},mouseleave:o.onBtnLeave,blur:o.onBtnLeave}},[n("svg",{staticClass:"w-3 h-3",attrs:{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"}},[n("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[n("path",{attrs:{d:"M12 15V3m9 12v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}}),n("path",{attrs:{d:"m7 10l5 5l5-5"}})])])]):t._e(),o.props.showFullscreenButton?n("button",{class:`${o.computedButtonStyle} ${o.isFullscreenDisabled?"opacity-50 cursor-not-allowed":""}`,attrs:{disabled:o.isFullscreenDisabled},on:{click:o.handleOpenModalClick,mouseenter:function(e){o.onBtnHover(e,o.isModalOpen?o.t("common.minimize")||"Minimize":o.t("common.open")||"Open")},focus:function(e){o.onBtnHover(e,o.isModalOpen?o.t("common.minimize")||"Minimize":o.t("common.open")||"Open")},mouseleave:o.onBtnLeave,blur:o.onBtnLeave}},[o.isModalOpen?n("svg",{attrs:{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"}},[n("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"}})]):n("svg",{attrs:{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"}},[n("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"}})])]):t._e()])]):t._e(),n("div",{directives:[{name:"show",rawName:"v-show",value:!o.isCollapsed,expression:"!isCollapsed"}]},[o.showSource?n("div",{staticClass:"p-4",class:o.props.isDark?"bg-gray-900":"bg-gray-50"},[n("pre",{staticClass:"text-sm font-mono whitespace-pre-wrap",class:o.props.isDark?"text-gray-300":"text-gray-700"},[t._v(t._s(o.baseCode))])]):n("div",{staticClass:"relative"},[o.props.showZoomControls?n("div",{staticClass:"absolute top-2 right-2 z-10 rounded-lg"},[n("div",{staticClass:"flex items-center gap-2 backdrop-blur rounded-lg"},[n("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[o.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:o.zoomIn,mouseenter:function(e){o.onBtnHover(e,o.t("common.zoomIn")||"Zoom in")},focus:function(e){o.onBtnHover(e,o.t("common.zoomIn")||"Zoom in")},mouseleave:o.onBtnLeave,blur:o.onBtnLeave}},[n("svg",{staticClass:"w-3 h-3",attrs:{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"}},[n("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[n("circle",{attrs:{cx:"11",cy:"11",r:"8"}}),n("path",{attrs:{d:"m21 21l-4.35-4.35M11 8v6m-3-3h6"}})])])]),n("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[o.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:o.zoomOut,mouseenter:function(e){o.onBtnHover(e,o.t("common.zoomOut")||"Zoom out")},focus:function(e){o.onBtnHover(e,o.t("common.zoomOut")||"Zoom out")},mouseleave:o.onBtnLeave,blur:o.onBtnLeave}},[n("svg",{staticClass:"w-3 h-3",attrs:{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"}},[n("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[n("circle",{attrs:{cx:"11",cy:"11",r:"8"}}),n("path",{attrs:{d:"m21 21l-4.35-4.35M8 11h6"}})])])]),n("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[o.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:o.resetZoom,mouseenter:function(e){o.onBtnHover(e,o.t("common.resetZoom")||"Reset zoom")},focus:function(e){o.onBtnHover(e,o.t("common.resetZoom")||"Reset zoom")},mouseleave:o.onBtnLeave,blur:o.onBtnLeave}},[t._v(" "+t._s(Math.round(100*o.zoom))+"% ")])])]):t._e(),n("div",{staticClass:"infographic-preview min-h-[var(--ms-size-diagram-min-height,360px)] relative transition-all duration-100 overflow-hidden block",class:[o.props.isDark?"bg-gray-900":"bg-gray-50",{"infographic-pan-touch":o.panSurfaceClaimsTouch}],style:{height:o.containerHeight,maxHeight:null!=(e=o.props.maxHeight)?e:void 0},on:{pointerdown:o.startDrag}},[o.hasPreview||o.hasRenderError?t._e():n("pre",{staticClass:"absolute inset-0 overflow-auto p-4 text-left text-sm font-mono whitespace-pre-wrap"},[t._v(t._s(o.baseCode))]),n("div",{staticClass:"absolute inset-0 cursor-grab",class:{"cursor-grabbing":o.isDragging},style:o.transformStyle},[n("div",{ref:"infographicContainer",staticClass:"w-full text-center flex items-center justify-center min-h-full"})])])])]),n(o.Portal,{attrs:{to:"body"}},[n("div",{staticClass:"markstream-vue"},[n("transition",{attrs:{name:"infographic-dialog",appear:""}},[o.isModalOpen?n("div",{staticClass:"fixed inset-0 z-50 flex items-center justify-center bg-black/70 p-4",on:{click:function(e){return e.target!==e.currentTarget?null:o.closeModal.apply(null,arguments)}}},[n("div",{staticClass:"dialog-panel relative w-full h-full max-w-full max-h-full rounded shadow-lg overflow-hidden",class:o.props.isDark?"bg-gray-900":"bg-white"},[n("div",{staticClass:"absolute top-6 right-6 z-50 flex items-center gap-2"},[n("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[o.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:o.zoomIn}},[n("svg",{staticClass:"w-3 h-3",attrs:{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"}},[n("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[n("circle",{attrs:{cx:"11",cy:"11",r:"8"}}),n("path",{attrs:{d:"m21 21l-4.35-4.35M11 8v6m-3-3h6"}})])])]),n("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[o.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:o.zoomOut}},[n("svg",{staticClass:"w-3 h-3",attrs:{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"}},[n("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[n("circle",{attrs:{cx:"11",cy:"11",r:"8"}}),n("path",{attrs:{d:"m21 21l-4.35-4.35M8 11h6"}})])])]),n("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[o.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:o.resetZoom}},[t._v(" "+t._s(Math.round(100*o.zoom))+"% ")]),n("button",{staticClass:"inline-flex items-center justify-center p-2 rounded transition-colors",class:[o.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:o.closeModal}},[n("svg",{staticClass:"w-3 h-3",attrs:{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"}},[n("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18 6L6 18M6 6l12 12"}})])])]),n("div",{ref:"modalContent",staticClass:"w-full h-full flex items-center justify-center p-4 overflow-hidden",class:{"cursor-grab":!o.isDragging,"cursor-grabbing":o.isDragging,"infographic-pan-touch":o.panSurfaceClaimsTouch},on:{pointerdown:o.startDrag}})])]):t._e()])],1)])],1)},[],!1,null,"e6357a0d",null,null).exports,dn=M(m.defineComponent({name:"MarkdownRender",components:{LegacyNodesRenderer:Pt,NodeRenderer:Zt},props:{content:String,nodes:Array,final:Boolean,parseOptions:Object,customMarkdownIt:Function,debugPerformance:Boolean,customHtmlTags:Array,viewportPriority:Boolean,codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:String,codeBlockLightTheme:String,renderCodeBlocksAsPre:Boolean,codeBlockMinWidth:[String,Number],codeBlockMaxWidth:[String,Number],codeBlockOptions:Object,codeBlockProps:Object,showTooltips:Boolean,themes:Array,isDark:Boolean,customId:[String,Number],indexKey:[String,Number],typewriter:Boolean,fade:{type:Boolean,default:!0},batchRendering:Boolean,initialRenderBatchSize:Number,renderBatchSize:Number,renderBatchDelay:Number,renderBatchBudgetMs:Number,renderBatchIdleTimeoutMs:Number,deferNodesUntilVisible:Boolean,maxLiveNodes:Number,liveNodeBuffer:Number},data(){return{instanceMsgId:this.customId?`renderer-${this.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`}},computed:{legacyVue26(){return w(this)},mergedParseOptions(){var e,t;const n=null!=(e=this.parseOptions)?e:{},o=null!=(t=this.final)?t:n.final,r=c.mergeCustomHtmlTags(this.customHtmlTags,n.customHtmlTags),l=null!=o,i=r.length>0;return l||i?s(s(s({},n),l?{final:o}:{}),i?{customHtmlTags:r}:{}):n},parsedLegacyNodes(){var e;if(Array.isArray(this.nodes)&&this.nodes.length>0)return this.nodes;if(!this.content)return[];const{key:t,tags:n}=c.resolveCustomHtmlTags(null==(e=this.mergedParseOptions)?void 0:e.customHtmlTags),o=c.getMarkdown(t?`${this.instanceMsgId}:${t}`:this.instanceMsgId,{customHtmlTags:n}),r=this.customMarkdownIt?this.customMarkdownIt(o):o;return c.parseMarkdownToStructure(this.content,r,this.mergedParseOptions)},forwardedProps(){return{content:this.content,nodes:this.nodes,final:this.final,parseOptions:this.parseOptions,customMarkdownIt:this.customMarkdownIt,debugPerformance:this.debugPerformance,customHtmlTags:this.customHtmlTags,viewportPriority:this.viewportPriority,codeBlockStream:this.codeBlockStream,codeBlockDarkTheme:this.codeBlockDarkTheme,codeBlockLightTheme:this.codeBlockLightTheme,renderCodeBlocksAsPre:this.renderCodeBlocksAsPre,codeBlockMinWidth:this.codeBlockMinWidth,codeBlockMaxWidth:this.codeBlockMaxWidth,codeBlockOptions:this.codeBlockOptions,codeBlockProps:this.codeBlockProps,showTooltips:this.showTooltips,themes:this.themes,isDark:this.isDark,customId:this.customId,indexKey:this.indexKey,typewriter:this.typewriter,fade:this.fade,batchRendering:this.batchRendering,initialRenderBatchSize:this.initialRenderBatchSize,renderBatchSize:this.renderBatchSize,renderBatchDelay:this.renderBatchDelay,renderBatchBudgetMs:this.renderBatchBudgetMs,renderBatchIdleTimeoutMs:this.renderBatchIdleTimeoutMs,deferNodesUntilVisible:this.deferNodesUntilVisible,maxLiveNodes:this.maxLiveNodes,liveNodeBuffer:this.liveNodeBuffer}}},render(e){const t=k(this);return this.legacyVue26?e(Pt,s({props:{nodes:this.parsedLegacyNodes,customId:this.customId,indexKey:this.indexKey,typewriter:this.typewriter,fade:this.fade,showTooltips:this.showTooltips,codeBlockStream:this.codeBlockStream,codeBlockDarkTheme:this.codeBlockDarkTheme,codeBlockLightTheme:this.codeBlockLightTheme,renderCodeBlocksAsPre:this.renderCodeBlocksAsPre,codeBlockMinWidth:this.codeBlockMinWidth,codeBlockMaxWidth:this.codeBlockMaxWidth,codeBlockOptions:this.codeBlockOptions,codeBlockProps:this.codeBlockProps,themes:this.themes,isDark:this.isDark}},Object.keys(t).length>0?{on:t}:{})):e(Zt,s({props:this.forwardedProps},Object.keys(t).length>0?{on:t}:{}))}}),null,null,!1,null,null,null,null).exports,cn=new Map;function mn(e,t){if(cn.delete(e),cn.set(e,t),cn.size>200){const e=cn.keys().next().value;e&&cn.delete(e)}}function pn(e){if(!e)return null;const t=cn.get(e)||null;return t&&mn(e,t),t}function fn(e,t){e&&t&&mn(e,{html:t})}function vn(e){return e?e.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}let hn=null,gn=null,yn=!1;const wn=new Map,xn=new Map;let kn=5;const Mn=new Set;function bn(){if(wn.size<kn&&Mn.size){const t=Array.from(Mn);Mn.clear();for(const n of t)try{n()}catch(e){}}}let Cn=null;const Tn=void 0!=={url:"undefined"==typeof document?require("url").pathToFileURL(__filename).href:v&&"SCRIPT"===v.tagName.toUpperCase()&&v.src||new URL("index.cjs",document.baseURI).href}&&Boolean(null==(e={BASE_URL:"/",MODE:"npm",DEV:!1,PROD:!0,SSR:!1})?void 0:e.DEV);try{"undefined"!=typeof window&&Tn&&Promise.resolve().then(()=>require("./chunks/performance-monitor-698d0e66.cjs")).then(e=>{Cn=e.perfMonitor})}catch(uo){}function Nn(e,t=!0,n=2e3,o){return d(this,null,function*(){const r=performance.now(),l=vn(e);if(!ge()){const e=new Error("KaTeX rendering disabled");return e.name="KaTeXDisabled",e.code="KATEX_DISABLED",Promise.reject(e)}if(gn)return Promise.reject(gn);const i=`${t?"d":"i"}:${l}`,a=xn.get(i);if(a)return Cn&&Cn.recordRender({type:"cache-hit",duration:performance.now()-r,formulaLength:l.length,timestamp:Date.now(),success:!0}),Promise.resolve(a);const s=hn||(gn=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),gn.name="WorkerInitError",gn.code="WORKER_INIT_ERROR",null);if(!s)return Promise.reject(gn);if(wn.size>=kn){const e=new Error("Worker busy");return e.name="WorkerBusy",e.code="WORKER_BUSY",e.busy=!0,e.inFlight=wn.size,e.max=kn,Cn&&Cn.recordRender({type:"worker",duration:performance.now()-r,formulaLength:l.length,timestamp:Date.now(),success:!1,error:"busy"}),Promise.reject(e)}return new Promise((e,i)=>{if(null==o?void 0:o.aborted){const e=new Error("Aborted");return e.name="AbortError",void i(e)}const a=Math.random().toString(36).slice(2),u=globalThis.setTimeout(()=>{wn.delete(a);const e=new Error("Worker render timed out");e.name="WorkerTimeout",e.code="WORKER_TIMEOUT",Cn&&Cn.recordRender({type:"worker",duration:performance.now()-r,formulaLength:l.length,timestamp:Date.now(),success:!1,error:"timeout"}),i(e),bn()},n);o&&o.addEventListener("abort",()=>{globalThis.clearTimeout(u),wn.has(a)&&wn.delete(a);const e=new Error("Aborted");e.name="AbortError",i(e),bn()},{once:!0});const d=e,c=i;wn.set(a,{resolve:e=>{Cn&&Cn.recordRender({type:"worker",duration:performance.now()-r,formulaLength:l.length,timestamp:Date.now(),success:!0}),d(e)},reject:e=>{Cn&&Cn.recordRender({type:"worker",duration:performance.now()-r,formulaLength:l.length,timestamp:Date.now(),success:!1,error:(null==e?void 0:e.message)||String(e)}),c(e)},timeoutId:u}),s.postMessage({id:a,content:l,displayMode:t})})})}function _n(e,t=!0,n){const o=`${t?"d":"i"}:${vn(e)}`;if(xn.set(o,n),xn.size>200){const e=xn.keys().next().value;xn.delete(e)}}const Dn="WORKER_BUSY";function In(e=2e3,t){return wn.size<kn?Promise.resolve():new Promise((n,o)=>{let r,l=!1;const i=()=>{l||(l=!0,r&&globalThis.clearTimeout(r),Mn.delete(i),n())};if(Mn.add(i),r=globalThis.setTimeout(()=>{if(l)return;l=!0,Mn.delete(i);const e=new Error("Wait for worker slot timed out");e.name="WorkerBusyTimeout",e.code="WORKER_BUSY_TIMEOUT",o(e)},e),queueMicrotask(()=>bn()),t){const e=()=>{if(l)return;l=!0,r&&globalThis.clearTimeout(r),Mn.delete(i);const e=new Error("Aborted");e.name="AbortError",o(e)};t.aborted?e():t.addEventListener("abort",e,{once:!0})}})}const Sn={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function jn(e){return d(this,arguments,function*(e,t=!0,n={}){var o,r,l,i;if(!ge()){const e=new Error("KaTeX rendering disabled");throw e.name="KaTeXDisabled",e.code="KATEX_DISABLED",e}const a=null!=(o=n.timeout)?o:Sn.timeout,s=null!=(r=n.waitTimeout)?r:Sn.waitTimeout,u=null!=(l=n.backoffMs)?l:Sn.backoffMs,d=null!=(i=n.maxRetries)?i:Sn.maxRetries,c=Number.isFinite(d)?Math.max(0,Math.min(Math.floor(d),8)):Sn.maxRetries,m=n.signal;let p=0;for(;;){if(null==m?void 0:m.aborted){const e=new Error("Aborted");throw e.name="AbortError",e}try{return yield Nn(e,t,a,m)}catch(f){if((null==f?void 0:f.code)!==Dn||p>=c)throw f;if(p++,yield In(s,m).catch(()=>{}),null==m?void 0:m.aborted){const e=new Error("Aborted");throw e.name="AbortError",e}u>0&&(yield new Promise(e=>globalThis.setTimeout(e,u*p)))}}})}const En=M(m.defineComponent({__name:"MathBlockNode",props:{node:null,indexKey:null},setup(e){const t=e,n=m.computed(()=>vn(t.node.content)),o=m.ref(null),r=It();let l=null,i=0,a=!1,s=null;const u=m.computed(()=>null==t.indexKey?null:`block:${String(t.indexKey)}`),c=pn(u.value),p=m.ref((null==c?void 0:c.html)||""),f=m.ref(""),v=m.ref(!(null==c?void 0:c.html));let h=Boolean(null==c?void 0:c.html);function g(){return d(this,null,function*(){const e=yield ye();if(!e)return!1;try{const o=e.renderToString(n.value,{throwOnError:t.node.loading,displayMode:!0});return y(o),_n(n.value,!0,o),!0}catch(uo){return!1}})}function y(e){p.value=e,f.value="",v.value=!1,h=!0,fn(u.value,e)}function w(){p.value="",f.value=t.node.raw,v.value=!1}function x(){return d(this,null,function*(){if(a)return;if(!t.node.content)return w(),void(h=!0);const e=pn(u.value);if((null==e?void 0:e.html)&&!p.value&&(p.value=e.html,h=!0,v.value=!1),!h){v.value=!0;try{!l&&o.value&&(l=r(o.value)),yield null==l?void 0:l.whenVisible}catch(uo){}}s&&(s.abort(),s=null);const d=++i,c=new AbortController;s=c;try{const e=yield jn(n.value,!0,{timeout:3e3,waitTimeout:2e3,maxRetries:1,signal:c.signal});if(a||d!==i)return;y(e)}catch(m){if(a||d!==i)return;if("AbortError"===(null==m?void 0:m.name))return;const e=(null==m?void 0:m.code)||(null==m?void 0:m.name),n="KATEX_DISABLED"===e;if(("WORKER_INIT_ERROR"===e||(null==m?void 0:m.fallbackToRenderer)||e===Dn||"WORKER_TIMEOUT"===e)&&(yield g()))return;if(h||p.value)return;n||!t.node.loading?w():v.value=!0}})}return m.watch(()=>[t.node.content,t.node.loading,t.node.raw,t.indexKey],()=>x()),m.onMounted(()=>{x()}),m.onBeforeUnmount(()=>{var e;a=!0,s&&(s.abort(),s=null),null==(e=null==l?void 0:l.destroy)||e.call(l),l=null}),{__sfc:!0,props:t,mathContent:n,containerEl:o,registerVisibility:r,visibilityHandle:l,currentRenderId:i,isUnmounted:a,currentAbortController:s,cacheKey:u,initialCached:c,renderedHtml:p,fallbackText:f,renderingLoading:v,hasRenderedOnce:h,renderWithMainThreadFallback:g,applySuccessfulRender:y,applyRawFallback:w,renderMath:x}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("div",{ref:"containerEl",staticClass:"math-block text-center overflow-x-auto relative min-h-[40px]"},[n.renderedHtml?t("div",{staticClass:"math-block__content",domProps:{innerHTML:e._s(n.renderedHtml)}}):n.fallbackText?t("div",{staticClass:"math-block__fallback"},[e._v(" "+e._s(n.fallbackText)+" ")]):e._e(),!n.renderingLoading||n.renderedHtml||n.fallbackText?e._e():t("div",{staticClass:"math-loading-overlay"},[t("div",{staticClass:"math-loading-spinner"})])])},[],!1,null,"50fb5666",null,null).exports,Ln=M(m.defineComponent({__name:"MathInlineNode",props:{node:null,indexKey:null},setup(e){const t=e,n=m.ref(null),o=It();let r=null,l=0,i=!1,a=null;const s=m.computed(()=>"$$"===t.node.markup),u=m.computed(()=>vn(t.node.content)),c=m.computed(()=>null==t.indexKey?null:`inline:${String(t.indexKey)}`),p=pn(c.value),f=m.ref((null==p?void 0:p.html)||""),v=m.ref(""),h=m.ref(!(null==p?void 0:p.html));let g=Boolean(null==p?void 0:p.html);function y(){return d(this,null,function*(){const e=yield ye();if(!e)return!1;try{const n=e.renderToString(u.value,{throwOnError:t.node.loading,displayMode:s.value});return w(n),_n(u.value,s.value,n),!0}catch(uo){return!1}})}function w(e){f.value=e,v.value="",h.value=!1,g=!0,fn(c.value,e)}function x(){f.value="",v.value=t.node.raw,h.value=!1}function k(){return d(this,null,function*(){if(i)return;if(!t.node.content)return f.value="",v.value=t.node.loading?"":t.node.raw,h.value=!!t.node.loading,void(g=!t.node.loading);const e=pn(c.value);(null==e?void 0:e.html)&&!f.value&&(f.value=e.html,g=!0,h.value=!1),a&&(a.abort(),a=null);const d=++l,m=new AbortController;if(a=m,!g){h.value=!0;try{!r&&n.value&&(r=o(n.value)),yield null==r?void 0:r.whenVisible}catch(uo){}}try{const e=yield jn(u.value,s.value,{timeout:1500,waitTimeout:0,maxRetries:0,signal:m.signal});if(i||d!==l)return;w(e)}catch(p){if(i||d!==l)return;if("AbortError"===(null==p?void 0:p.name))return;const e=(null==p?void 0:p.code)||(null==p?void 0:p.name),n="KATEX_DISABLED"===e;if(("WORKER_INIT_ERROR"===e||(null==p?void 0:p.fallbackToRenderer)||e===Dn||"WORKER_TIMEOUT"===e)&&(yield y()))return;if(g||f.value)return;n||!t.node.loading?x():h.value=!0}})}return m.watch(()=>[t.node.content,t.node.loading,t.node.markup,t.node.raw,t.indexKey],()=>k()),m.onMounted(()=>{k()}),m.onBeforeUnmount(()=>{var e;i=!0,a&&(a.abort(),a=null),null==(e=null==r?void 0:r.destroy)||e.call(r),r=null}),{__sfc:!0,props:t,containerEl:n,registerVisibility:o,visibilityHandle:r,currentRenderId:l,isUnmounted:i,currentAbortController:a,displayMode:s,mathContent:u,cacheKey:c,initialCached:p,renderedHtml:f,fallbackText:v,renderingLoading:h,hasRenderedOnce:g,renderWithMainThreadFallback:y,applySuccessfulRender:w,applyRawFallback:x,renderMath:k}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("span",{ref:"containerEl",staticClass:"math-inline-wrapper"},[n.renderedHtml?t("span",{staticClass:"math-inline",domProps:{innerHTML:e._s(n.renderedHtml)}}):n.fallbackText?t("span",{staticClass:"math-inline math-inline--fallback"},[e._v(e._s(n.fallbackText))]):e._e(),!n.renderingLoading||n.renderedHtml||n.fallbackText?e._e():t("span",{staticClass:"math-inline__loading",attrs:{role:"status","aria-live":"polite"}},[e._t("loading",function(){return[t("span",{staticClass:"math-inline__spinner animate-spin",attrs:{"aria-hidden":"true"}}),t("span",{staticClass:"sr-only"},[e._v("Loading")])]},{isLoading:n.renderingLoading})],2)])},[],!1,null,"6e33b527",null,null).exports,Bn=()=>import("mermaid");let An=null,On=Bn;function zn(e){On=e,An=null}function Pn(){return"function"==typeof On}function Rn(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 u(s({},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}function Hn(e){if(e)try{const t=null==e?void 0:e.initialize;e.initialize=n=>{const o=s({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(uo){}}let $n=null,Un=null;const Fn=new Map;let Yn=5,Kn=!1;const Wn="WORKER_BUSY",Qn="MERMAID_DISABLED";function Vn(e,t,n=1400){if(!Pn()){const e=new Error("Mermaid rendering disabled");return e.name="MermaidDisabled",e.code=Qn,Promise.reject(e)}if(Un)return Promise.reject(Un);const o=$n||(Un=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),Un.name="WorkerInitError",Un.code="WORKER_INIT_ERROR",null);if(!o)return Promise.reject(Un);if(Fn.size>=Yn){const e=new Error("Worker busy");return e.name="WorkerBusy",e.code=Wn,e.inFlight=Fn.size,e.max=Yn,Promise.reject(e)}return new Promise((r,l)=>{const i=Math.random().toString(36).slice(2);let a,s=!1;const u=()=>{s||(s=!0,null!=a&&globalThis.clearTimeout(a),Fn.delete(i))},d={resolve:e=>{u(),r(e)},reject:e=>{u(),l(e)}};Fn.set(i,d);try{o.postMessage({id:i,action:e,payload:t})}catch(c){return Fn.delete(i),void l(c)}a=globalThis.setTimeout(()=>{const e=new Error("Worker call timed out");e.name="WorkerTimeout",e.code="WORKER_TIMEOUT";const t=Fn.get(i);t&&t.reject(e)},n)})}function Xn(e,t,n=1400){return d(this,null,function*(){try{return yield Vn("canParse",{code:e,theme:t},n)}catch(uo){return Promise.reject(uo)}})}function qn(e,t,n=1400){return d(this,null,function*(){try{return yield Vn("findPrefix",{code:e,theme:t},n)}catch(uo){return Promise.reject(uo)}})}function Gn(){if($n)try{for(const[e,t]of Fn.entries())t.reject(new Error("Worker terminated"));Fn.clear(),$n.terminate()}finally{$n=null}}const Zn=M(m.defineComponent({__name:"MermaidBlockNode",props:{node:null,maxHeight:{default:"500px"},estimatedPreviewHeightPx:null,loading:{type:Boolean,default:!0},isDark:{type:Boolean},workerTimeoutMs:{default:1400},parseTimeoutMs:{default:1800},renderTimeoutMs:{default:2500},fullRenderTimeoutMs:{default:4e3},renderDebounceMs:{default:300},contentStableDelayMs:{default:500},previewPollDelayMs:{default:800},previewPollMaxDelayMs:{default:4e3},previewPollMaxAttempts:{default:12},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},enableWheelZoom:{type:Boolean,default:!1},isStrict:{type:Boolean,default:!0},enableMermaidInteractions:{type:Boolean,default:!1},onRenderError:null},emits:["copy","export","openModal","toggleMode"],setup(e,{emit:t}){var n,o;const r=e,l={USE_PROFILES:{svg:!0},FORBID_TAGS:["script"],FORBID_ATTR:[/^on/i],ADD_TAGS:["style"],ADD_ATTR:["style"],SAFE_FOR_TEMPLATES:!0},i=m.ref(!1),a=m.computed(()=>r.isStrict?"strict":"loose"),f=m.computed(()=>({startOnLoad:!1,securityLevel:a.value,dompurifyConfig:"strict"===a.value?l:void 0,flowchart:"strict"===a.value?{htmlLabels:!1}:void 0}));function h(e,t){if(!e)return null;const n=c.toSafeSvgElement(t);return n?(g(e),e.appendChild(n),{svg:e.innerHTML,bindTarget:e}):null}function g(e){if(e)try{e.replaceChildren()}catch(uo){e.innerHTML=""}}function y(e,t,n={}){if(!e)return null;const o=h(e,t);return o||n.keepPreviousOnFailure||g(e),o}let w=null;function x(e){if(r.enableMermaidInteractions&&(null==e?void 0:e.querySelector("svg")))try{null==w||w(e)}catch(uo){}}const{t:k}=se();function M(){return d(this,null,function*(){try{const e=yield function(){return d(this,null,function*(){if(An)return An;const e=function(){try{const e=globalThis;return Rn(null==e?void 0:e.mermaid)}catch(uo){return null}}();if(e)return An=e,Hn(An),An;const t=On;if(!t)return null;let n;try{n=yield t()}catch(o){if(t===Bn)throw new Error('Optional dependency "mermaid" is not installed. Please install it to enable mermaid diagrams.');throw o}return n?(An=Rn(n),Hn(An),An):null})}();return i.value=!!e,e}catch(e){throw i.value=!1,e}})}"undefined"!=typeof window&&(()=>{d(this,null,function*(){var e;try{const t=yield M();if(!t)return;null==(e=null==t?void 0:t.initialize)||e.call(t,s({},f.value))}catch(t){i.value=!1,console.warn("[markstream-vue2] Failed to initialize mermaid renderer. Call enableMermaid() to configure a loader.",t)}})})();const b=m.ref(!1),C=m.ref(!1),T=m.ref(),N=m.ref(),_=m.ref(),D=m.ref(null),I=It();let S=null;const j=m.ref("undefined"==typeof window),E=m.ref(),L=m.computed(()=>r.node.code.replace(/\]::([^:])/g,"]:::$1").replace(/:::subgraphNode$/gm,"::subgraphNode")),B=m.computed(()=>r.maxHeight&&"none"!==r.maxHeight?Wt(r.maxHeight):null),A=m.computed(()=>{var e;return null!=(e=Wt(r.estimatedPreviewHeightPx))?e:Qt(L.value)});function O(){var e;return null!=(e=Wt(T.value?getComputedStyle(T.value).getPropertyValue("--ms-size-diagram-min-height").trim():""))?e:360}function z(e){return qt(e,O(),B.value)}function P(){return z(A.value)}function R(e,t=L.value){const n=t,o=`%%{init: {"theme": "${"dark"===e?"dark":"default"}"}}%%\n`;return n.trim().startsWith("%%{")?n:o+n}function H(e){var t;for(const n of e.split(/\r?\n/)){const e=n.trim();if(!e||e.startsWith("%%"))continue;const o=e.match(/^([A-Z][\w-]*)\b/i);return(null==(t=null==o?void 0:o[1])?void 0:t.toLowerCase())||""}return""}const $=m.ref(1),U=m.ref(0),F=m.ref(0),Y=m.ref(!1),K=m.ref("undefined"==typeof window),W=m.ref(!1),Q=m.ref(!1),V=m.ref(null),X=m.ref(0),q=m.ref(!1),G=m.computed(()=>{var e;return Math.max(0,null!=(e=r.renderDebounceMs)?e:300)}),Z=m.computed(()=>{var e;return Math.max(0,null!=(e=r.contentStableDelayMs)?e:500)}),J=m.computed(()=>{var e;return Math.max(120,null!=(e=r.previewPollDelayMs)?e:800)}),ee=m.computed(()=>{var e;return Math.max(J.value,null!=(e=r.previewPollMaxDelayMs)?e:4e3)}),te=m.computed(()=>{var e;return Math.max(1,Math.trunc(null!=(e=r.previewPollMaxAttempts)?e:12))});let ne=null,oe=null,ie=null,ae=0;const ue=null!=(n=globalThis.requestIdleCallback)?n:(e,t)=>setTimeout(()=>e({didTimeout:!0}),16);function de(){return j.value&&!C.value}function ce(){null!=ie&&(globalThis.clearTimeout(ie),ie=null)}function me(){ce(),ie=globalThis.setTimeout(()=>{ie=null,de()&&ue(()=>{de()&&vt()},{timeout:500})},G.value)}function pe(){null!=oe&&(globalThis.clearTimeout(oe),oe=null)}function fe(e=600){if("undefined"==typeof globalThis)return;const t=Math.max(0,e);pe(),oe=globalThis.setTimeout(()=>{oe=null,r.loading||Q.value||!de()?fe(Math.min(1200,Math.max(300,1.2*t))):me()},t)}const ve=m.ref(`${P()}px`);let he=null;m.watch(A,e=>{if(K.value||C.value)return;const t=z(e),n=Wt(ve.value);(null==n||n<t)&&(ve.value=`${t}px`)});const ge=m.ref(!1),ye=m.ref(!1),we=m.ref({}),xe=m.ref(null),ke=m.ref(""),Me=m.ref(0);let be=null;const Ce=m.ref(!1),Te=m.ref({zoom:1,translateX:0,translateY:0,containerHeight:`${P()}px`}),Ne=m.computed(()=>r.enableWheelZoom?{wheel:dt}:{}),_e=m.computed(()=>{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}}),De=null!=(o=globalThis.cancelIdleCallback)?o:e=>clearTimeout(e);let Ie=null,Se=null,je=!1,Ee=J.value,Le=null,Be=0,Ae=!0,Oe=0;function ze(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 Pe(e){if("undefined"==typeof document)return;if(!N.value)return;if("function"==typeof r.onRenderError&&!0===r.onRenderError(e,L.value,N.value))return Ce.value=!0,void ht();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),g(N.value),N.value.appendChild(t),ve.value=`${P()}px`,Ce.value=!0,ht()}function Re(e){const t="string"==typeof e?e:"string"==typeof(null==e?void 0:e.message)?e.message:"";return"string"==typeof t&&/timed out/i.test(t)}function He(e){return!e||e.disabled}function $e(e,t){const n=`%%{init: {"theme": "${"dark"===t?"dark":"default"}"}}%%\n`;return e.trimStart().startsWith("%%{")?e:n+e}function Ue(){return Ae&&!K.value&&!ge.value&&!Ce.value}function Fe(e){const t=e.trim();return!(!t||t.startsWith("%%"))&&!/^(?:gantt|title|dateformat|axisformat|tickinterval|excludes|section|todaymarker|topaxis|weekday|weekend|acctitle|accdescr|accdescrmultiline)\b/i.test(t)&&t.includes(":")}function Ye(e){var t;const n=e.split(/\r?\n/);for(!/\r?\n$/.test(e)&&n.length>0&&n.pop();n.length>0;){const e=null==(t=n[n.length-1])?void 0:t.trim();if(e&&!e.startsWith("%%")){if(Fe(e))break;n.pop()}else n.pop()}return n.some(Fe)?n.join("\n"):""}function Ke(e){if("gantt"===H(e))return Ye(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 We(e,t,n){return d(this,null,function*(){var o,r;const l=yield M();if(!l)return;const i=l,a=$e(e,t);if("function"==typeof i.parse)return yield ze(()=>i.parse(a),{timeoutMs:null!=(o=null==n?void 0:n.timeoutMs)?o:_e.value.parse,signal:null==n?void 0:n.signal}),!0;const s=`mermaid-parse-${Math.random().toString(36).slice(2,9)}`;return yield ze(()=>l.render(s,a),{timeoutMs:null!=(r=null==n?void 0:n.timeoutMs)?r:_e.value.render,signal:null==n?void 0:n.signal}),!0})}function Qe(e,t,n){return d(this,null,function*(){var o;try{return yield Xn(e,t,null!=(o=null==n?void 0:n.timeoutMs)?o:_e.value.worker)}catch(uo){return yield We(e,t,n)}})}function Ve(e,t,n){return d(this,null,function*(){var o;if("gantt"===H(e)){const o=Ke(e);if(!o.trim())return{fullOk:!1,prefixOk:!1};try{if(yield Qe(o,t,n))return o===e?{fullOk:!0,prefixOk:!1}:{fullOk:!1,prefixOk:!0,prefix:o}}catch(uo){if("AbortError"===(null==uo?void 0:uo.name))throw uo}return{fullOk:!1,prefixOk:!1}}try{if(yield Qe(e,t,n))return{fullOk:!0,prefixOk:!1}}catch(uo){if("AbortError"===(null==uo?void 0:uo.name))throw uo}let r=Ke(e);if(r&&r.trim()&&r!==e)try{try{const l=yield qn(e,t,null!=(o=null==n?void 0:n.timeoutMs)?o:_e.value.worker);l&&l.trim()&&(r=l)}catch(uo){}if(yield Qe(r,t,n))return{fullOk:!1,prefixOk:!0,prefix:r}}catch(uo){if("AbortError"===(null==uo?void 0:uo.name))throw uo}return{fullOk:!1,prefixOk:!1}})}"undefined"!=typeof window&&m.watch(()=>T.value,e=>{if(null==S||S.destroy(),S=null,!e)return void(j.value=!1);const t=I(e,{rootMargin:"400px"});S=t,j.value=t.isVisible.value,t.whenVisible.then(()=>{j.value=!0})},{immediate:!0}),m.onBeforeUnmount(()=>{null==S||S.destroy(),S=null,ce()});const Xe=m.computed(()=>K.value||Q.value||C.value);function qe(){return B.value}function Ge(e){if(!T.value||!N.value)return;const t=N.value.querySelector("svg");if(!t)return;let n=0,o=0;const l=t.getAttribute("viewBox"),i=t.getAttribute("width"),a=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||i&&a&&(n=Number.parseFloat(i),o=Number.parseFloat(a)),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(uo){return void console.error("Failed to get SVG BBox:",uo)}if(n>0&&o>0){const t=o/n,l=null!=e?e:T.value.clientWidth,i=qe(),a=l*t,s=null==i?a:Math.min(a,i);ve.value=`${"none"===r.maxHeight?s:Math.max(s,P())}px`}}const Ze=m.ref(!1),Je=m.computed(()=>({transform:`translate(${U.value}px, ${F.value}px) scale(${$.value})`}));function et(e){"Escape"===e.key&&Ze.value&&ot()}function tt(){var e;if(!T.value||!_.value)return!1;if("1"===(null==(e=_.value.firstElementChild)?void 0:e.getAttribute("data-mermaid-modal-clone")))return!0;const t=T.value.cloneNode(!0);t.dataset.mermaidModalClone="1",t.classList.add("fullscreen"),t.style.height="100%",t.style.maxHeight="100%";const n=t.querySelector("[data-mermaid-wrapper]");return n&&(D.value=n,n.style.transform=Je.value.transform),g(_.value),_.value.appendChild(t),x(t),!0}function nt(){if(Ze.value=!0,"undefined"!=typeof document)try{document.body.style.overflow="hidden"}catch(uo){}if("undefined"!=typeof window)try{window.addEventListener("keydown",et)}catch(uo){}m.nextTick(()=>{tt()||m.nextTick(tt)})}function ot(){if(Ze.value=!1,_.value&&g(_.value),D.value=null,"undefined"!=typeof document)try{document.body.style.overflow=""}catch(uo){}if("undefined"!=typeof window)try{window.removeEventListener("keydown",et)}catch(uo){}}function rt(){if(!K.value)return;if(!i.value)return;const e=L.value.length;e!==X.value&&(q.value=!0,X.value=e,ne&&clearTimeout(ne),ne=setTimeout(()=>{q.value&&K.value&&L.value.trim()&&(q.value=!1,mt("preview"))},Z.value))}m.watch(_,e=>{Ze.value&&e&&tt()}),m.watch(Je,e=>{Ze.value&&D.value&&(D.value.style.transform=e.transform)},{immediate:!0});const lt=m.computed(()=>Ze.value||$.value>1);function it(){var e;return!!(null==(e=N.value)?void 0:e.querySelector("svg"))}const at=p.createPanGesture({getTranslate:()=>({x:U.value,y:F.value}),setTranslate:e=>{U.value=e.x,F.value=e.y},canStart:e=>!!it()&&("touch"!==e.pointerType||lt.value),onActiveChange:e=>Y.value=e}),st=at.start,ut=at.stop;function dt(e){if(r.enableWheelZoom&&(e.ctrlKey||e.metaKey)){if(e.preventDefault(),!T.value)return;const t=T.value.getBoundingClientRect(),n=e.clientX-t.left,o=e.clientY-t.top,r=n-t.width/2,l=o-t.height/2,i=(r-U.value)/$.value,a=(l-F.value)/$.value,s=.01,u=-e.deltaY*s,d=Math.min(Math.max($.value+u,.5),3);d!==$.value&&(U.value=r-i*d,F.value=l-a*d,$.value=d)}}function ct(e,t=null){return d(this,null,function*(){try{const n=null!=t?t:(new XMLSerializer).serializeToString(e),o=new Blob([n],{type:"image/svg+xml;charset=utf-8"}),r=URL.createObjectURL(o);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(uo){}URL.revokeObjectURL(r)}}catch(n){console.error("Failed to export SVG:",n)}})}function mt(e){return d(this,null,function*(){const t=E.value;if(!t)return W.value=!0,void(K.value="source"===e);const n=t.getBoundingClientRect().height;t.style.height=`${n}px`,t.style.overflow="hidden",W.value=!0,K.value="source"===e,yield m.nextTick();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 pt(){return d(this,null,function*(){return Q.value?V.value:N.value||(yield m.nextTick(),N.value)?(Q.value=!0,V.value=(()=>d(this,null,function*(){var e,t,n;try{const n=yield M();if(!n)return;const o=`mermaid-${Date.now()}-${Math.random().toString(36).substring(2,11)}`;ge.value||ye.value||null==(e=n.initialize)||e.call(n,u(s({},f.value),{dompurifyConfig:s({},l)}));const i=R(r.isDark?"dark":"light"),a=yield ze(()=>n.render(o,i),{timeoutMs:_e.value.fullRender}),d=null==a?void 0:a.svg;if(N.value){const e=y(N.value,d);if(!e)return ye.value&&(ye.value=!1),!1;const n=null!=(t=null==a?void 0:a.bindFunctions)?t:null;w=n,x(e.bindTarget),ge.value||ye.value||(Ge(),ge.value=!0,Te.value={zoom:$.value,translateX:U.value,translateY:F.value,containerHeight:ve.value});const o=r.isDark?"dark":"light";e&&(we.value[o]={svg:e.svg,bindFunctions:n}),ye.value&&(ye.value=!1),Ce.value=!1,ae=0,pe()}return!0}catch(o){const e=Re(o),t=ae+1;return e&&t<=3?(ae=t,fe(Math.min(1200,600*t)),void 0!=={url:"undefined"==typeof document?require("url").pathToFileURL(__filename).href:v&&"SCRIPT"===v.tagName.toUpperCase()&&v.src||new URL("index.cjs",document.baseURI).href}&&(null==(n={BASE_URL:"/",MODE:"npm",DEV:!1,PROD:!0,SSR:!1})?void 0:n.DEV)&&console.warn("[markstream-vue2] Mermaid render timed out, retry scheduled:",t)):(ae=0,pe(),!1===r.loading&&console.error("Failed to render mermaid diagram:",o),!1===r.loading&&Pe(o)),!1}finally{Q.value=!1,V.value=null}}))(),V.value):void console.warn("Mermaid container not ready")})}function ft(e){return d(this,null,function*(){var t;if(Ue()&&(N.value||(yield m.nextTick(),N.value))&&!Q.value){Q.value=!0;try{const n=yield M();if(!n)return;const o=`mermaid-partial-${Date.now()}-${Math.random().toString(36).slice(2,9)}`,l=r.isDark?"dark":"light",i=Ke(e),a=$e(i&&i.trim()?i:e,l),s=yield ze(()=>n.render(o,a),{timeoutMs:_e.value.render}),u=null==s?void 0:s.svg;if(N.value&&u){const e=y(N.value,u,{keepPreviousOnFailure:!0});e&&(w=null!=(t=null==s?void 0:s.bindFunctions)?t:null,x(e.bindTarget),Ge())}}catch(uo){}finally{Q.value=!1}}})}function vt(){return d(this,null,function*(){var e,t,n;const o=Date.now(),l=++Me.value;be&&be.abort(),be=new AbortController;const i=be.signal,a=r.isDark?"dark":"light",s=L.value,u=s.replace(/\s+/g,"");if(!s.trim())return N.value&&g(N.value),xe.value=null,ke.value="",void(Ce.value=!1);if(u===ke.value)return;try{const n=yield Ve(s,a,{signal:i,timeoutMs:_e.value.worker});if(n.fullOk){if(!(yield pt()))return;return void(Me.value===l&&(xe.value=null!=(t=null==(e=N.value)?void 0:e.innerHTML)?t:null,ke.value=u,Ce.value=!1))}const r=Be&&o<=Be;if(n.prefixOk&&n.prefix&&Ue()&&!r)return void(yield ft(n.prefix))}catch(uo){if("AbortError"===(null==uo?void 0:uo.name))return}if(Me.value!==l)return;if(Ce.value)return;const d=we.value[a];if(d&&N.value){const e=y(N.value,d.svg);e&&(w=null!=(n=d.bindFunctions)?n:null,x(e.bindTarget))}})}function ht(){je&&(je=!1,Ee=J.value,Ae=!1,Le&&(Le.abort(),Le=null),Ie&&(globalThis.clearTimeout(Ie),Ie=null),Se&&(De(Se),Se=null),Be=Date.now())}function gt(){if(ht(),ce(),be){try{be.abort()}catch(uo){}be=null}if(Le){try{Le.abort()}catch(uo){}Le=null}Gn(),pe(),ae=0}function yt(e=J.value){je&&(Oe>=te.value?ht():(Ie&&globalThis.clearTimeout(Ie),Ie=globalThis.setTimeout(()=>{Se=ue(()=>d(this,null,function*(){if(!je)return;if(!de())return void ht();if(K.value||ge.value)return void ht();const e=r.isDark?"dark":"light",t=L.value;if(!t.trim())return!1===r.loading?void ht():void yt(Ee);if(Oe++,Oe>te.value)ht();else{Le&&Le.abort(),Le=new AbortController;try{const n=yield Ve(t,e,{signal:Le.signal,timeoutMs:_e.value.worker});if(n.fullOk){if((yield pt())&&ge.value)return void ht()}else n.prefixOk&&n.prefix&&Ue()&&(yield ft(n.prefix))}catch(uo){}Ee=Math.min(Math.floor(1.5*Ee),ee.value),yt(Ee)}}),{timeout:500})},e)))}function wt(){je||i.value&&de()&&(K.value||ge.value||(je=!0,Be=0,Ae=!0,Oe=0,Ee=J.value,yt(Ee)))}m.onBeforeUnmount(ut),m.watch(()=>L.value,()=>{ge.value=!1,we.value={},de()&&me(),!K.value&&i.value&&de()?wt():ht(),rt()}),m.watch(()=>r.isDark,()=>d(this,null,function*(){var e;if(!ge.value)return;if(Ce.value)return;const t=r.isDark?"dark":"light",n=we.value[t];if(n){if(N.value){const t=y(N.value,n.svg);t&&(w=null!=(e=n.bindFunctions)?e:null,x(t.bindTarget))}return}const o={zoom:$.value,translateX:U.value,translateY:F.value,containerHeight:ve.value},l=1!==$.value||0!==U.value||0!==F.value;ye.value=!0,l&&($.value=1,U.value=0,F.value=0,yield m.nextTick()),(yield pt())&&l&&(yield m.nextTick(),$.value=o.zoom,U.value=o.translateX,F.value=o.translateY,ve.value=o.containerHeight,Te.value=o)})),m.watch(()=>K.value,e=>d(this,null,function*(){var t;if(e)ht(),ge.value&&(Te.value={zoom:$.value,translateX:U.value,translateY:F.value,containerHeight:ve.value});else{if(Ce.value)return;const e=r.isDark?"dark":"light";if(ge.value&&we.value[e]){if(yield m.nextTick(),N.value){const n=we.value[e],o=y(N.value,n.svg);o&&(w=null!=(t=n.bindFunctions)?t:null,x(o.bindTarget))}return $.value=Te.value.zoom,U.value=Te.value.translateX,F.value=Te.value.translateY,void(ve.value=Te.value.containerHeight)}if(yield m.nextTick(),!i.value||!de())return;wt(),yield vt()}})),m.watch(()=>r.loading,(e,t)=>d(this,null,function*(){var n;if(!0===t&&!1===e){const e=L.value.trim();if(!e)return gt();const t=r.isDark?"dark":"light",l=e.replace(/\s+/g,"");if(ge.value&&l===ke.value){if(yield m.nextTick(),N.value&&!N.value.querySelector("svg")&&we.value[t]){const e=we.value[t],o=y(N.value,e.svg);o&&(w=null!=(n=e.bindFunctions)?n:null,x(o.bindTarget))}return void gt()}try{if(yield Qe(e,t,{timeoutMs:_e.value.worker}),!(yield pt()))return;ke.value=l,Ce.value=!1,gt()}catch(o){gt(),Pe(o)}}})),m.watch(T,e=>{he&&he.disconnect(),e&&(he=new ResizeObserver(e=>{e&&e.length>0&&!K.value&&!C.value&&Ht(()=>{Ge(e[0].contentRect.width)})}),he.observe(e))},{immediate:!0}),m.onMounted(()=>d(this,null,function*(){yield m.nextTick(),W.value||(K.value=!i.value),de()&&(me(),X.value=L.value.length)})),m.watch(()=>i.value,e=>{W.value||(K.value=!e)}),m.watch(()=>j.value,e=>{e&&(ge.value||(me(),X.value=L.value.length),r.loading||ge.value||me(),!K.value&&i.value&&wt())},{immediate:!1}),m.watch(()=>r.maxHeight,()=>{m.nextTick(()=>{Ge()})}),m.onUnmounted(()=>{ne&&clearTimeout(ne),ce(),he&&he.disconnect(),be&&(be.abort(),be=null),Gn(),ht(),pe()}),m.watch(()=>C.value,e=>d(this,null,function*(){e?(ht(),be&&be.abort()):de()&&!ge.value&&(yield m.nextTick(),me(),K.value||wt())}),{immediate:!1});const xt=m.computed(()=>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{__sfc:!0,props:r,emits:t,DOMPURIFY_CONFIG:l,mermaidAvailable:i,mermaidSecurityLevel:a,mermaidInitConfig:f,setSafeSvg:h,clearElement:g,renderSvgToTarget:y,lastMermaidBindFunctions:w,bindMermaidInteractions:x,t:k,resolveMermaidInstance:M,copyText:b,isCollapsed:C,mermaidContainer:T,mermaidContent:N,modalContent:_,modalCloneWrapper:D,registerViewport:I,viewportHandle:S,viewportReady:j,modeContainerRef:E,baseFixedCode:L,maxPreviewHeight:B,estimatedPreviewHeight:A,resolveMinContainerHeight:O,clampPreviewHeight:z,resolveEstimatedPreviewHeight:P,getCodeWithTheme:R,getMermaidDiagramKind:H,zoom:$,translateX:U,translateY:F,isDragging:Y,showSource:K,userToggledShowSource:W,isRendering:Q,renderQueue:V,lastContentLength:X,isContentGenerating:q,renderDebounceDelay:G,contentStableDelay:Z,previewPollInitialDelay:J,previewPollMaxDelay:ee,previewPollMaxAttempts:te,contentStableTimer:ne,renderRetryTimer:oe,progressiveRenderDebounceTimer:ie,consecutiveRenderTimeouts:ae,MAX_RENDER_TIMEOUT_RETRIES:3,requestIdle:ue,canScheduleViewportWork:de,clearProgressiveRenderDebounceTimer:ce,debouncedProgressiveRender:me,clearRenderRetryTimer:pe,scheduleRenderRetry:fe,containerHeight:ve,resizeObserver:he,hasRenderedOnce:ge,isThemeRendering:ye,svgCache:we,lastSvgSnapshot:xe,lastRenderedCode:ke,renderToken:Me,currentWorkController:be,hasRenderError:Ce,savedTransformState:Te,wheelListeners:Ne,timeouts:_e,cancelIdle:De,previewPollTimeoutId:Ie,previewPollIdleId:Se,isPreviewPolling:je,previewPollDelay:Ee,previewPollController:Le,lastPreviewStopAt:Be,allowPartialPreview:Ae,previewPollAttempts:Oe,withTimeoutSignal:ze,renderErrorToContainer:Pe,isTimeoutError:Re,shouldSkipEventTarget:He,onBtnHover:function(e,t,n="top"){if(He(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;re(e.currentTarget,t,n,!1,l,r.isDark)},onBtnLeave:function(){le()},onCopyHover:function(e){if(He(e.currentTarget))return;const t=b.value?k("common.copied")||"Copied":k("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;re(e.currentTarget,t,"top",!1,o,r.isDark)},applyThemeTo:$e,canApplyPartialPreview:Ue,isGanttTaskLine:Fe,getSafeGanttPreviewCandidate:Ye,getSafePrefixCandidate:Ke,canParseOnMain:We,canParseOffthread:Qe,canParseOrPrefix:Ve,isFullscreenDisabled:Xe,resolveMaxContainerHeight:qe,updateContainerHeight:Ge,isModalOpen:Ze,transformStyle:Je,handleKeydown:et,mountModalClone:tt,openModal:nt,closeModal:ot,checkContentStability:rt,zoomIn:function(){$.value<3&&($.value+=.1)},zoomOut:function(){$.value>.5&&($.value-=.1)},resetZoom:function(){$.value=1,U.value=0,F.value=0},panSurfaceClaimsTouch:lt,hasPreviewSvg:it,panGesture:at,startDrag:st,stopDrag:ut,handleWheel:dt,copy:function(){return d(this,null,function*(){try{"undefined"!=typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.writeText&&(yield navigator.clipboard.writeText(L.value)),b.value=!0,t("copy",L.value),setTimeout(()=>{b.value=!1},1e3)}catch(e){console.error("Failed to copy:",e)}})},exportSvg:ct,handleExportClick:function(){var e;const n=null==(e=N.value)?void 0:e.querySelector("svg");if(!n)return void console.error("SVG element not found");const o=(new XMLSerializer).serializeToString(n),r={payload:{type:"export"},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0},svgElement:n,svgString:o};t("export",r),r.defaultPrevented||ct(n,o)},handleOpenModalClick:function(){var e,n;const o=null!=(n=null==(e=N.value)?void 0:e.querySelector("svg"))?n:null,r=o?(new XMLSerializer).serializeToString(o):null,l={payload:{type:"open-modal"},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0},svgElement:o,svgString:r};t("openModal",l),l.defaultPrevented||nt()},handleSwitchMode:function(e){const n={payload:{type:"toggle-mode",target:e},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0}};t("toggleMode",e,n),n.defaultPrevented||mt(e)},switchMode:mt,initMermaid:pt,renderPartial:ft,progressiveRender:vt,stopPreviewPolling:ht,cleanupAfterLoadingSettled:gt,scheduleNextPreviewPoll:yt,startPreviewPolling:wt,computedButtonStyle:xt,mermaidIconUrl:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiIgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2Ij4KICA8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9IiNjYTllZTYiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgZD0iTTEuNSAyLjVjMCA2IDIuMjUgNS43NSA0IDcgLjgzLjY3IDEuMTcgMiAxIDRoM2MtLjE3LTIgLjE3LTMuMzMgMS00IDEuNzUtMS4yNSA0LTEgNC03QzEyIDIuNSAxMCAzIDggNyA2IDMgNCAyLjUgMS41IDIuNSIgLz4KPC9zdmc+Cg==",Portal:Ut}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("div",{staticClass:"my-4 rounded-lg border overflow-hidden shadow-sm",class:[n.props.isDark?"border-gray-700/30":"border-gray-200",{"is-rendering":n.props.loading}],attrs:{"data-markstream-mermaid":"1","data-markstream-mode":n.showSource?"source":n.hasRenderedOnce?"preview":"pending"}},[n.props.showHeader?t("div",{staticClass:"mermaid-block-header flex justify-between items-center px-4 py-2.5 border-b",class:n.props.isDark?"bg-gray-800 border-gray-700/30":"bg-gray-50 border-gray-200"},[e.$slots["header-left"]?t("div",[e._t("header-left")],2):t("div",{staticClass:"flex items-center space-x-2 overflow-hidden"},[t("img",{staticClass:"w-4 h-4 my-0",attrs:{src:n.mermaidIconUrl,alt:"Mermaid"}}),t("span",{staticClass:"text-sm font-medium font-mono truncate",class:n.props.isDark?"text-gray-400":"text-gray-600"},[e._v("Mermaid")])]),e.$slots["header-center"]?t("div",[e._t("header-center")],2):n.props.showModeToggle&&n.mermaidAvailable?t("div",{staticClass:"flex items-center space-x-1 rounded-md p-0.5",class:n.props.isDark?"bg-gray-700":"bg-gray-100"},[t("button",{staticClass:"px-2.5 py-1 text-xs rounded transition-colors",class:[n.showSource?n.props.isDark?"text-gray-400 hover:text-gray-200":"text-gray-500 hover:text-gray-700":n.props.isDark?"bg-gray-600 text-gray-200 shadow-sm":"bg-white text-gray-700 shadow-sm"],on:{click:()=>n.handleSwitchMode("preview"),mouseenter:function(e){n.onBtnHover(e,n.t("common.preview")||"Preview")},focus:function(e){n.onBtnHover(e,n.t("common.preview")||"Preview")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("div",{staticClass:"flex items-center space-x-1"},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("path",{attrs:{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"}}),t("circle",{attrs:{cx:"12",cy:"12",r:"3"}})])]),t("span",[e._v(e._s(n.t("common.preview")||"Preview"))])])]),t("button",{staticClass:"px-2.5 py-1 text-xs rounded transition-colors",class:[n.showSource?n.props.isDark?"bg-gray-600 text-gray-200 shadow-sm":"bg-white text-gray-700 shadow-sm":n.props.isDark?"text-gray-400 hover:text-gray-200":"text-gray-500 hover:text-gray-700"],on:{click:()=>n.handleSwitchMode("source"),mouseenter:function(e){n.onBtnHover(e,n.t("common.source")||"Source")},focus:function(e){n.onBtnHover(e,n.t("common.source")||"Source")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("div",{staticClass:"flex items-center space-x-1"},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m16 18l6-6l-6-6M8 6l-6 6l6 6"}})]),t("span",[e._v(e._s(n.t("common.source")||"Source"))])])])]):e._e(),e.$slots["header-right"]?t("div",[e._t("header-right")],2):t("div",{staticClass:"flex items-center space-x-1"},[n.props.showCollapseButton?t("button",{class:n.computedButtonStyle,attrs:{"aria-pressed":n.isCollapsed},on:{click:function(e){n.isCollapsed=!n.isCollapsed},mouseenter:function(e){n.onBtnHover(e,n.isCollapsed?n.t("common.expand")||"Expand":n.t("common.collapse")||"Collapse")},focus:function(e){n.onBtnHover(e,n.isCollapsed?n.t("common.expand")||"Expand":n.t("common.collapse")||"Collapse")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"w-3 h-3",style:{rotate:n.isCollapsed?"0deg":"90deg"},attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"}})])]):e._e(),n.props.showCopyButton?t("button",{class:n.computedButtonStyle,on:{click:n.copy,mouseenter:function(e){return n.onCopyHover(e)},focus:function(e){return n.onCopyHover(e)},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[n.copyText?t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"}})]):t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("rect",{attrs:{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}}),t("path",{attrs:{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"}})])])]):e._e(),n.props.showExportButton&&n.mermaidAvailable?t("button",{class:`${n.computedButtonStyle} ${n.isFullscreenDisabled?"opacity-50 cursor-not-allowed":""}`,attrs:{disabled:n.isFullscreenDisabled},on:{click:n.handleExportClick,mouseenter:function(e){n.onBtnHover(e,n.t("common.export")||"Export")},focus:function(e){n.onBtnHover(e,n.t("common.export")||"Export")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("path",{attrs:{d:"M12 15V3m9 12v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}}),t("path",{attrs:{d:"m7 10l5 5l5-5"}})])])]):e._e(),n.props.showFullscreenButton&&n.mermaidAvailable?t("button",{class:`${n.computedButtonStyle} ${n.isFullscreenDisabled?"opacity-50 cursor-not-allowed":""}`,attrs:{disabled:n.isFullscreenDisabled},on:{click:n.handleOpenModalClick,mouseenter:function(e){n.onBtnHover(e,n.isModalOpen?n.t("common.minimize")||"Minimize":n.t("common.open")||"Open")},focus:function(e){n.onBtnHover(e,n.isModalOpen?n.t("common.minimize")||"Minimize":n.t("common.open")||"Open")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[n.isModalOpen?t("svg",{attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"}})]):t("svg",{attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"}})])]):e._e()])]):e._e(),t("div",{directives:[{name:"show",rawName:"v-show",value:!n.isCollapsed,expression:"!isCollapsed"}],ref:"modeContainerRef"},[n.showSource?t("div",{staticClass:"p-4",class:n.props.isDark?"bg-gray-900":"bg-gray-50"},[t("pre",{staticClass:"text-sm font-mono whitespace-pre-wrap",class:n.props.isDark?"text-gray-300":"text-gray-700"},[e._v(e._s(n.baseFixedCode))])]):t("div",{staticClass:"relative"},[n.props.showZoomControls?t("div",{staticClass:"absolute top-2 right-2 z-10 rounded-lg"},[t("div",{staticClass:"flex items-center gap-2 backdrop-blur rounded-lg"},[t("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[n.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:n.zoomIn,mouseenter:function(e){n.onBtnHover(e,n.t("common.zoomIn")||"Zoom in")},focus:function(e){n.onBtnHover(e,n.t("common.zoomIn")||"Zoom in")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("circle",{attrs:{cx:"11",cy:"11",r:"8"}}),t("path",{attrs:{d:"m21 21l-4.35-4.35M11 8v6m-3-3h6"}})])])]),t("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[n.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:n.zoomOut,mouseenter:function(e){n.onBtnHover(e,n.t("common.zoomOut")||"Zoom out")},focus:function(e){n.onBtnHover(e,n.t("common.zoomOut")||"Zoom out")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("circle",{attrs:{cx:"11",cy:"11",r:"8"}}),t("path",{attrs:{d:"m21 21l-4.35-4.35M8 11h6"}})])])]),t("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[n.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:n.resetZoom,mouseenter:function(e){n.onBtnHover(e,n.t("common.resetZoom")||"Reset zoom")},focus:function(e){n.onBtnHover(e,n.t("common.resetZoom")||"Reset zoom")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[e._v(" "+e._s(Math.round(100*n.zoom))+"% ")])])]):e._e(),t("div",e._g({ref:"mermaidContainer",staticClass:"min-h-[var(--ms-size-diagram-min-height,360px)] relative overflow-hidden block transition-[height] duration-150 ease-out",class:[n.props.isDark?"bg-gray-900":"bg-gray-50",{"mermaid-pan-touch":n.panSurfaceClaimsTouch}],style:{height:n.containerHeight},on:{pointerdown:n.startDrag}},n.wheelListeners),[t("div",{staticClass:"absolute inset-0 cursor-grab",class:{"cursor-grabbing":n.isDragging},style:n.transformStyle,attrs:{"data-mermaid-wrapper":""}},[t("div",{ref:"mermaidContent",staticClass:"_mermaid w-full text-center flex items-center justify-center min-h-full"})])]),t(n.Portal,{attrs:{to:"body"}},[t("div",{staticClass:"markstream-vue2"},[t("transition",{attrs:{name:"mermaid-dialog",appear:""}},[n.isModalOpen?t("div",{staticClass:"fixed inset-0 z-50 flex items-center justify-center bg-black/70 p-4",on:{click:function(e){return e.target!==e.currentTarget?null:n.closeModal.apply(null,arguments)}}},[t("div",{staticClass:"dialog-panel relative w-full h-full max-w-full max-h-full rounded shadow-lg overflow-hidden",class:n.props.isDark?"bg-gray-900":"bg-white"},[t("div",{staticClass:"absolute top-6 right-6 z-50 flex items-center gap-2"},[t("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[n.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:n.zoomIn}},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("circle",{attrs:{cx:"11",cy:"11",r:"8"}}),t("path",{attrs:{d:"m21 21l-4.35-4.35M11 8v6m-3-3h6"}})])])]),t("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[n.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:n.zoomOut}},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("circle",{attrs:{cx:"11",cy:"11",r:"8"}}),t("path",{attrs:{d:"m21 21l-4.35-4.35M8 11h6"}})])])]),t("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[n.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:n.resetZoom}},[e._v(" "+e._s(Math.round(100*n.zoom))+"% ")]),t("button",{staticClass:"inline-flex items-center justify-center p-2 rounded transition-colors",class:[n.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:n.closeModal}},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18 6L6 18M6 6l12 12"}})])])]),t("div",e._g({ref:"modalContent",staticClass:"w-full h-full flex items-center justify-center p-4 overflow-hidden",class:{"mermaid-pan-touch":n.panSurfaceClaimsTouch},on:{pointerdown:n.startDrag}},n.wheelListeners))])]):e._e()])],1)])],1)])])},[],!1,null,"8d36a948",null,null).exports,Jn=M(m.defineComponent({name:"NestedRenderer",components:{MarkdownRender:dn},inheritAttrs:!1,props:{node:Object,nodes:Array,content:String,loading:Boolean,final:Boolean,cacheKey:String,parseOptions:Object,customHtmlTags:Array,customMarkdownIt:Function},setup(e){const t=m.getCurrentInstance(),n=m.computed(()=>{var t;return null!=e.final?e.final:"boolean"==typeof e.loading?!e.loading:"boolean"==typeof(null==(t=e.node)?void 0:t.loading)?!e.node.loading:void 0}),o=m.computed(()=>at({node:e.node,nodes:e.nodes,content:e.content},{cacheKey:e.cacheKey,final:n.value,parseOptions:e.parseOptions,customHtmlTags:e.customHtmlTags,customMarkdownIt:e.customMarkdownIt}));return{forwardedListeners:m.computed(()=>k(null==t?void 0:t.proxy)),resolvedFinal:n,resolvedNodes:o}}}),function(){var e=this,t=e._self._c;return e._self._setupProxy,t("MarkdownRender",e._g(e._b({attrs:{nodes:e.resolvedNodes,final:e.resolvedFinal,"custom-html-tags":e.customHtmlTags}},"MarkdownRender",e.$attrs,!1),e.forwardedListeners))},[],!1,null,null,null,null).exports,eo=M(m.defineComponent({__name:"Tooltip",props:{visible:{type:Boolean},anchorEl:null,content:null,placement:null,offset:null,originX:null,originY:null,id:null,isDark:{type:[Boolean,null]}},setup(e){const t=e,n=m.computed(()=>{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(uo){}return!1}),o=m.ref(null),r=m.ref({transform:"translate3d(0px, 0px, 0px)",left:"0px",top:"0px"}),l=m.ref(!1);let i=null;function a(){return d(this,null,function*(){var e,n;if(!t.anchorEl||!o.value)return;const l=[f.offset(null!=(e=t.offset)?e:8),f.flip(),f.shift({padding:8})],{x:i,y:a}=yield f.computePosition(t.anchorEl,o.value,{placement:null!=(n=t.placement)?n:"top",middleware:l,strategy:"fixed"});r.value.transform=`translate3d(${Math.round(i)}px, ${Math.round(a)}px, 0)`,r.value.left="0px",r.value.top="0px"})}return m.watch(()=>t.visible,e=>d(this,null,function*(){if(e)if(l.value=!1,yield m.nextTick(),t.anchorEl&&o.value)try{const e=t.anchorEl.getBoundingClientRect();yield a();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 m.nextTick(),l.value=!0,yield m.nextTick(),r.value.transform=n):l.value=!0}else l.value=!0;i=f.autoUpdate(t.anchorEl,o.value,a)}catch(uo){yield a(),l.value=!0,i=f.autoUpdate(t.anchorEl,o.value,a)}else l.value=!0;else l.value=!1,i&&(i(),i=null)})),m.watch([()=>t.anchorEl,()=>t.placement,()=>t.content],()=>d(this,null,function*(){t.visible&&t.anchorEl&&o.value&&(yield m.nextTick(),yield a())})),m.onBeforeUnmount(()=>{i&&i()}),{__sfc:!0,props:t,isDarkEffective:n,tooltip:o,style:r,ready:l,cleanupAutoUpdate:i,updatePosition:a,Portal:Ut}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t(n.Portal,{attrs:{to:"body"}},[t("div",{staticClass:"markstream-vue2"},[t("transition",{attrs:{name:"tooltip",appear:""}},[t("div",{directives:[{name:"show",rawName:"v-show",value:e.visible&&n.ready,expression:"visible && ready"}],ref:"tooltip",staticClass:"z-[9999] inline-block text-base py-2 px-3 rounded-md shadow-md whitespace-nowrap pointer-events-none tooltip-element border",class:[n.isDarkEffective?"bg-gray-900 text-white border-gray-700 border is-dark":"bg-white text-gray-900 border-gray-200 border"],style:{position:"fixed",left:n.style.left,top:n.style.top,transform:n.style.transform},attrs:{id:n.props.id,role:"tooltip"}},[e._v(" "+e._s(e.content)+" ")])])],1)])},[],!1,null,"703da293",null,null).exports,to=Object.freeze(Object.defineProperty({__proto__:null,default:eo},Symbol.toStringTag,{value:"Module"}));function no(e){return JSON.stringify(e)}function oo(e){var t;const n=null!=(t=e.mode)?t:"classic",o=e.katexUrl,r=e.mhchemUrl,l=no(s({throwOnError:!0,displayMode:!0,output:"html",strict:"ignore"},e.renderOptions||{})),i=no(o),a=r?no(r):'""';return"module"===n?`\nlet DEBUG = false\nlet katex = null\nlet katexLoadError = null\nlet loadPromise = null\n\nfunction normalizeKaTeX(mod) {\n const resolved = (mod && mod.default) ? mod.default : mod\n if (resolved && typeof resolved.renderToString === 'function')\n return resolved\n return null\n}\n\nasync function loadKaTeX() {\n if (katex || katexLoadError)\n return\n if (!loadPromise) {\n loadPromise = (async () => {\n try {\n const mod = await import(${i})\n katex = normalizeKaTeX(mod) || null\n const mhchemUrl = ${a}\n if (mhchemUrl) {\n try {\n await import(mhchemUrl)\n }\n catch (e) {\n // ignore optional mhchem load failures\n if (DEBUG)\n console.warn('[katex-cdn-worker] failed to load mhchem', e)\n }\n }\n }\n catch (e) {\n katexLoadError = e\n }\n })()\n }\n await loadPromise\n}\n\nglobalThis.addEventListener('message', async (ev) => {\n const data = ev.data || {}\n if (data.type === 'init') {\n DEBUG = !!data.debug\n if (DEBUG)\n console.debug('[katex-cdn-worker] debug enabled')\n return\n }\n const id = data.id ?? ''\n const content = data.content ?? ''\n const displayMode = data.displayMode ?? true\n\n await loadKaTeX()\n\n if (!katex) {\n const reason = katexLoadError ? String(katexLoadError?.message || katexLoadError) : 'KaTeX is not available in worker'\n globalThis.postMessage({ id, error: reason, content, displayMode })\n return\n }\n\n try {\n const opts = ${l}\n const html = katex.renderToString(content, { ...opts, displayMode: !!displayMode })\n globalThis.postMessage({ id, html, content, displayMode })\n }\n catch (err) {\n const msg = String(err?.message || err)\n globalThis.postMessage({ id, error: msg, content, displayMode })\n }\n})\n`.trimStart():`\nlet DEBUG = false\nlet katex = null\nlet katexLoadError = null\n\nfunction normalizeKaTeX(val) {\n const resolved = (val && val.default) ? val.default : val\n if (resolved && typeof resolved.renderToString === 'function')\n return resolved\n return null\n}\n\nfunction loadKaTeXClassic() {\n if (katex || katexLoadError)\n return\n try {\n importScripts(${i})\n const mhchemUrl = ${a}\n if (mhchemUrl) {\n try {\n importScripts(mhchemUrl)\n }\n catch (e) {\n // ignore optional mhchem load failures\n if (DEBUG)\n console.warn('[katex-cdn-worker] failed to load mhchem', e)\n }\n }\n katex = normalizeKaTeX(globalThis.katex)\n }\n catch (e) {\n katexLoadError = e\n }\n}\n\nloadKaTeXClassic()\n\nglobalThis.addEventListener('message', (ev) => {\n const data = ev.data || {}\n if (data.type === 'init') {\n DEBUG = !!data.debug\n if (DEBUG)\n console.debug('[katex-cdn-worker] debug enabled')\n return\n }\n const id = data.id ?? ''\n const content = data.content ?? ''\n const displayMode = data.displayMode ?? true\n\n if (!katex && !katexLoadError)\n loadKaTeXClassic()\n\n if (!katex) {\n const reason = katexLoadError ? String(katexLoadError?.message || katexLoadError) : 'KaTeX is not available in worker'\n globalThis.postMessage({ id, error: reason, content, displayMode })\n return\n }\n\n try {\n const opts = ${l}\n const html = katex.renderToString(content, { ...opts, displayMode: !!displayMode })\n globalThis.postMessage({ id, html, content, displayMode })\n }\n catch (err) {\n const msg = String(err?.message || err)\n globalThis.postMessage({ id, error: msg, content, displayMode })\n }\n})\n`.trimStart()}function ro(e){return JSON.stringify(e)}function lo(e){var t;const n=null!=(t=e.mode)?t:"module",o=ro(e.mermaidUrl),r=`\nlet DEBUG = false\nlet mermaid = null\nlet mermaidLoadError = null\n\nfunction normalizeMermaidModule(mod) {\n if (!mod)\n return mod\n const candidate = (mod && mod.default) ? mod.default : mod\n if (candidate && (typeof candidate.render === 'function' || typeof candidate.parse === 'function' || typeof candidate.initialize === 'function'))\n return candidate\n if (candidate && candidate.mermaidAPI && (typeof candidate.mermaidAPI.render === 'function' || typeof candidate.mermaidAPI.parse === 'function')) {\n const api = candidate.mermaidAPI\n return {\n ...candidate,\n render: api.render ? api.render.bind(api) : undefined,\n parse: api.parse ? api.parse.bind(api) : undefined,\n initialize: (opts) => {\n if (typeof candidate.initialize === 'function')\n return candidate.initialize(opts)\n return api.initialize ? api.initialize(opts) : undefined\n },\n }\n }\n if (mod && mod.mermaid && typeof mod.mermaid.parse === 'function')\n return mod.mermaid\n return candidate\n}\n\nfunction applyThemeTo(code, theme) {\n const themeValue = theme === 'dark' ? 'dark' : 'default'\n const themeConfig = \`%%{init: {"theme": "\${themeValue}"}}%%\\n\`\n const trimmed = (code || '').trimStart()\n if (trimmed.startsWith('%%{'))\n return code\n return themeConfig + code\n}\n\nfunction findHeaderIndex(lines) {\n const headerRe = /^(?:graph|flowchart|flowchart\\s+tb|flowchart\\s+lr|sequenceDiagram|gantt|classDiagram|stateDiagram(?:-v2)?|erDiagram|journey|pie|quadrantChart|timeline|xychart(?:-beta)?)\\b/\n for (let i = 0; i < lines.length; i++) {\n const l = (lines[i] || '').trim()\n if (!l)\n continue\n if (l.startsWith('%%'))\n continue\n if (headerRe.test(l))\n return i\n }\n return -1\n}\n\nasync function canParse(code, theme) {\n const themed = applyThemeTo(code, theme)\n const anyMermaid = mermaid\n if (anyMermaid && typeof anyMermaid.parse === 'function') {\n await anyMermaid.parse(themed)\n return true\n }\n throw new Error('mermaid.parse not available in worker')\n}\n\nasync function findLastRenderablePrefix(baseCode, theme) {\n const lines = String(baseCode || '').split('\\n')\n const headerIdx = findHeaderIndex(lines)\n if (headerIdx === -1)\n return null\n const head = lines.slice(0, headerIdx + 1)\n await canParse(head.join('\\n'), theme)\n\n let low = headerIdx + 1\n let high = lines.length\n let lastGood = headerIdx + 1\n let tries = 0\n const MAX_TRIES = 12\n\n while (low <= high && tries < MAX_TRIES) {\n const mid = Math.floor((low + high) / 2)\n const candidate = [...head, ...lines.slice(headerIdx + 1, mid)].join('\\n')\n tries++\n try {\n await canParse(candidate, theme)\n lastGood = mid\n low = mid + 1\n }\n catch {\n high = mid - 1\n }\n }\n\n return [...head, ...lines.slice(headerIdx + 1, lastGood)].join('\\n')\n}\n\nfunction initMermaidOnce() {\n if (!mermaid)\n return\n try {\n if (typeof mermaid.initialize === 'function')\n mermaid.initialize(${ro(s({startOnLoad:!1,securityLevel:"strict",flowchart:{htmlLabels:!1}},e.initializeOptions||{}))})\n }\n catch (e) {\n if (DEBUG)\n console.warn('[mermaid-cdn-worker] initialize failed', e)\n }\n}\n\nglobalThis.addEventListener('message', async (ev) => {\n const msg = ev.data || {}\n if (msg.type === 'init') {\n DEBUG = !!msg.debug\n if (DEBUG)\n console.debug('[mermaid-cdn-worker] debug enabled')\n return\n }\n\n const id = msg.id\n const action = msg.action\n const payload = msg.payload || {}\n\n if (!mermaid) {\n const errMsg = mermaidLoadError ? String(mermaidLoadError?.message || mermaidLoadError) : 'Mermaid is not available in worker'\n globalThis.postMessage({ id, ok: false, error: errMsg })\n return\n }\n\n try {\n if (action === 'canParse') {\n const ok = await canParse(payload.code, payload.theme)\n globalThis.postMessage({ id, ok: true, result: ok })\n return\n }\n if (action === 'findPrefix') {\n const res = await findLastRenderablePrefix(payload.code, payload.theme)\n globalThis.postMessage({ id, ok: true, result: res })\n return\n }\n globalThis.postMessage({ id, ok: false, error: 'Unknown action' })\n }\n catch (e) {\n globalThis.postMessage({ id, ok: false, error: String(e?.message || e) })\n }\n})\n`.trimStart();return"module"===n?`\n${r}\n\nlet loadPromise = null\nasync function loadMermaid() {\n if (mermaid || mermaidLoadError)\n return\n if (!loadPromise) {\n loadPromise = (async () => {\n try {\n const mod = await import(${o})\n mermaid = normalizeMermaidModule(mod) || null\n initMermaidOnce()\n }\n catch (e) {\n mermaidLoadError = e\n }\n })()\n }\n await loadPromise\n}\n\n// Load immediately; failures are reported per-request\nawait loadMermaid()\n`.trimStart():`\n${r}\n\nfunction loadMermaidClassic() {\n if (mermaid || mermaidLoadError)\n return\n try {\n importScripts(${o})\n mermaid = normalizeMermaidModule(globalThis.mermaid) || null\n initMermaidOnce()\n }\n catch (e) {\n mermaidLoadError = e\n }\n}\n\nloadMermaidClassic()\n`.trimStart()}function io(e){const t="string"==typeof(null==e?void 0:e.version)?e.version:"",[n,o]=t.split(".").map(Number);return Number.isFinite(n)&&Number.isFinite(o)&&2===n?o:null}const ao={AdmonitionNode:Jt,BlockquoteNode:Rt,CheckboxNode:b,CodeBlockNode:Yt,DefinitionListNode:C,EmojiNode:T,EmphasisNode:xt,FootnoteNode:Mt,FootnoteReferenceNode:j,FootnoteAnchorNode:kt,HardBreakNode:bt,HeadingNode:Ct,HtmlBlockNode:St,HtmlInlineNode:U,HighlightNode:wt,ImageNode:ue,D2BlockNode:rn,InlineCodeNode:F,PreCodeNode:st,InsertNode:yt,LinkNode:gt,ListItemNode:Tt,ListNode:Nt,MathBlockNode:En,MathInlineNode:Ln,MermaidBlockNode:Zn,NestedRenderer:Jn,InfographicBlockNode:un,ParagraphNode:jt,StrikethroughNode:ht,StrongNode:vt,SubscriptNode:ft,SuperscriptNode:pt,TableNode:Et,TextNode:ke,ThematicBreakNode:Lt,VmrContainerNode:At,ReferenceNode:mt},so={install(e,t){!function(e){const t=io(e);if(!(null==t||t>=7||(null==e?void 0:e.__composition_api_installed__)||(null==e?void 0:e.__compositionApiInstalled)))throw new Error("[markstream-vue2] Vue 2.6.x requires @vue/composition-api. Install it and call Vue.use(VueCompositionAPI) before using markstream-vue2.")}(e),function(e){const t=io(e);if(null==t||t>=7)return;if(null==e?void 0:e.__markstreamVue2SetupProxyPatched)return;e.__markstreamVue2SetupProxyPatched=!0;const n=e.prototype;Object.prototype.hasOwnProperty.call(n,"_setupProxy")||Object.defineProperty(n,"_setupProxy",{configurable:!0,get(){return this},set(e){Object.defineProperty(this,"_setupProxy",{value:e,configurable:!0,writable:!0})}}),e.mixin({beforeCreate(){if(!this._setupProxy)try{this._setupProxy=this}catch(uo){}}})}(e),Object.entries(ao).forEach(([t,n])=>{e.component(t,n)}),e.component("MarkdownRender",dn),e.component("NodeRenderer",dn),(null==t?void 0:t.getLanguageIcon)&&Oe(t.getLanguageIcon),(null==t?void 0:t.mathOptions)&&c.setDefaultMathOptions(t.mathOptions)}};Object.defineProperty(exports,"KATEX_COMMANDS",{enumerable:!0,get:()=>c.KATEX_COMMANDS}),Object.defineProperty(exports,"normalizeStandaloneBackslashT",{enumerable:!0,get:()=>c.normalizeStandaloneBackslashT}),Object.defineProperty(exports,"setDefaultMathOptions",{enumerable:!0,get:()=>c.setDefaultMathOptions}),exports.AdmonitionNode=Jt,exports.BlockquoteNode=Rt,exports.CheckboxNode=b,exports.CodeBlockNode=Yt,exports.D2BlockNode=rn,exports.DefinitionListNode=C,exports.EmojiNode=T,exports.EmphasisNode=xt,exports.FootnoteAnchorNode=kt,exports.FootnoteNode=Mt,exports.FootnoteReferenceNode=j,exports.HardBreakNode=bt,exports.HeadingNode=Ct,exports.HighlightNode=wt,exports.HtmlBlockNode=St,exports.HtmlInlineNode=U,exports.ImageNode=ue,exports.InfographicBlockNode=un,exports.InlineCodeNode=F,exports.InsertNode=yt,exports.LinkNode=gt,exports.ListItemNode=Tt,exports.ListNode=Nt,exports.MERMAID_DISABLED_CODE=Qn,exports.MERMAID_WORKER_BUSY_CODE=Wn,exports.MarkdownRender=dn,exports.MathBlockNode=En,exports.MathInlineNode=Ln,exports.MermaidBlockNode=Zn,exports.NestedRenderer=Jn,exports.ParagraphNode=jt,exports.PreCodeNode=st,exports.ReferenceNode=mt,exports.StrikethroughNode=ht,exports.StrongNode=vt,exports.SubscriptNode=ft,exports.SuperscriptNode=pt,exports.TableNode=Et,exports.TextNode=ke,exports.ThematicBreakNode=Lt,exports.Tooltip=eo,exports.VmrContainerNode=At,exports.VueRendererMarkdown=so,exports.WORKER_BUSY_CODE=Dn,exports.buildKaTeXCDNWorkerSource=oo,exports.buildMermaidCDNWorkerSource=lo,exports.canParseOffthread=Xn,exports.clearGlobalCustomComponents=function(){delete D.scopedCustomComponents[N],I.value++},exports.clearKaTeXWorker=function(){var e;hn&&(null==(e=hn.terminate)||e.call(hn)),hn=null,gn=null},exports.clearMermaidWorker=function(){var e;if($n)try{for(const[e,t]of Fn.entries())t.reject(new Error("Worker cleared"));Fn.clear(),null==(e=$n.terminate)||e.call($n)}catch(uo){}$n=null,Un=null},exports.createKaTeXWorkerFromCDN=function(e){var t,n;const o=oo(e);if("undefined"==typeof Worker||"undefined"==typeof URL||"undefined"==typeof Blob)return{worker:null,dispose:()=>{},source:o};const r=new Blob([o],{type:"text/javascript"}),l=URL.createObjectURL(r);let i=!1;const a="module"===(null!=(t=e.mode)?t:"classic")?u(s({},null!=(n=e.workerOptions)?n:{}),{type:"module"}):e.workerOptions,d=new Worker(l,a);if(e.debug)try{d.postMessage({type:"init",debug:!0})}catch(uo){}return{worker:d,dispose:()=>{if(!i){i=!0;try{URL.revokeObjectURL(l)}catch(uo){}}},source:o}},exports.createMermaidWorkerFromCDN=function(e){var t,n;const o=lo(e);if("undefined"==typeof Worker||"undefined"==typeof URL||"undefined"==typeof Blob)return{worker:null,dispose:()=>{},source:o};const r=new Blob([o],{type:"text/javascript"}),l=URL.createObjectURL(r);let i=!1;const a="module"===(null!=(t=e.mode)?t:"module")?u(s({},null!=(n=e.workerOptions)?n:{}),{type:"module"}):e.workerOptions,d=new Worker(l,a);if(e.debug)try{d.postMessage({type:"init",debug:!0})}catch(uo){}return{worker:d,dispose:()=>{if(!i){i=!0;try{URL.revokeObjectURL(l)}catch(uo){}}},source:o}},exports.default=dn,exports.disableD2=function(){on(null)},exports.disableKatex=function(){he(null)},exports.disableMermaid=function(){zn(null)},exports.enableD2=function(e){on(null!=e?e:en)},exports.enableKatex=function(e){he(null!=e?e:ve)},exports.enableMermaid=function(e){zn(null!=e?e:Bn)},exports.findPrefixOffthread=qn,exports.getCustomNodeComponents=S,exports.getKaTeXBackpressureDefaults=function(){return s({},Sn)},exports.getKaTeXWorkerLoad=function(){return{inFlight:wn.size,max:kn}},exports.getLanguageIcon=Re,exports.getMermaidWorkerLoad=function(){return{inFlight:Fn.size,max:Yn}},exports.isD2Enabled=function(){return"function"==typeof nn},exports.isKaTeXWorkerBusy=function(){return wn.size>=kn},exports.isKatexEnabled=ge,exports.isMermaidEnabled=Pn,exports.languageIconsRevision=Ee,exports.languageMap=He,exports.normalizeLanguageIdentifier=ze,exports.parseNestedMarkdownToNodes=at,exports.preloadCodeBlockRuntime=function(){return d(this,null,function*(){return Boolean(yield Te())})},exports.preloadExtendedLanguageIcons=function(){return d(this,null,function*(){yield Ae()})},exports.removeCustomComponents=function(e){if(e===N)throw new Error("removeCustomComponents: use clearGlobalCustomComponents() to clear the global mapping");delete D.scopedCustomComponents[e],I.value++},exports.renderKaTeXInWorker=Nn,exports.renderKaTeXWithBackpressure=jn,exports.renderMarkdownNodeToHtml=function(e,t={}){return We(e,Ye(t))},exports.renderMarkdownNodesToHtml=Fe,exports.renderNestedMarkdownToHtml=function(e,t={}){return function(e,t){if(Array.isArray(e.nodes)&&e.nodes.length>0)return Ke(e.nodes,t);const n=e.node;if(n){const e=et(n.children);if(e.length>0)return Ke(e,t);const o=tt(n.content);if(o)return qe(o,t);if(null!=n.raw)return rt(tt(n.raw))}return e.content?qe(tt(e.content),t):""}(e,Ye(t))},exports.resolveLanguageId=Pe,exports.setCustomComponents=function(e,t){"string"==typeof e?D.scopedCustomComponents[e]=t||{}:D.scopedCustomComponents[N]=e||{},I.value++},exports.setD2Loader=on,exports.setDefaultI18nMap=function(e){Object.assign(ie,e)},exports.setKaTeXBackpressureDefaults=function(e){null!=e.timeout&&(Sn.timeout=Math.max(0,Math.floor(e.timeout))),null!=e.waitTimeout&&(Sn.waitTimeout=Math.max(0,Math.floor(e.waitTimeout))),null!=e.backoffMs&&(Sn.backoffMs=Math.max(0,Math.floor(e.backoffMs))),null!=e.maxRetries&&(Sn.maxRetries=Math.max(0,Math.floor(e.maxRetries)))},exports.setKaTeXCache=_n,exports.setKaTeXWorker=function(e){hn=e,gn=null,hn.onmessage=e=>{const{id:t,html:n,error:o}=e.data,r=wn.get(t);if(r)if(wn.delete(t),clearTimeout(r.timeoutId),bn(),o)r.reject(new Error(o));else{const{content:t,displayMode:o}=e.data;if(t){const e=`${o?"d":"i"}:${t}`;if(xn.set(e,n),xn.size>200){const e=xn.keys().next().value;xn.delete(e)}}r.resolve(n)}},hn.onerror=e=>{console.error("[katexWorkerClient] Worker error:",e);for(const[t,n]of wn.entries())clearTimeout(n.timeoutId),n.reject(new Error(`Worker error: ${e.message}`));wn.clear(),bn()}},exports.setKaTeXWorkerDebug=function(e){yn=!!e,hn&&hn.postMessage({type:"init",debug:yn})},exports.setKaTeXWorkerMaxConcurrency=function(e){Number.isFinite(e)&&e>0&&(kn=Math.floor(e))},exports.setKatexLoader=he,exports.setLanguageIconResolver=Oe,exports.setMermaidLoader=zn,exports.setMermaidWorker=function(e){$n=e,Un=null;const t=e;$n.onmessage=e=>{if($n!==t)return;const{id:n,ok:o,result:r,error:l}=e.data,i=Fn.get(n);i&&(!1===o||l?i.reject(new Error(l||"Unknown error")):i.resolve(r))},$n.onerror=e=>{var n,o;if($n===t)if(0!==Fn.size){try{Kn?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 Fn.entries())n.reject(new Error(`Worker error: ${e.message}`));Fn.clear()}else null==(n=console.debug)||n.call(console,"[mermaidWorkerClient] Worker error (no pending):",(null==e?void 0:e.message)||e)},$n.onmessageerror=e=>{var n,o;if($n===t)if(0!==Fn.size){try{Kn?console.error("[mermaidWorkerClient] Worker messageerror:",e):null==(o=console.debug)||o.call(console,"[mermaidWorkerClient] Worker messageerror:",e)}catch(uo){}for(const[e,t]of Fn.entries())t.reject(new Error("Worker messageerror"));Fn.clear()}else null==(n=console.debug)||n.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",e)}},exports.setMermaidWorkerClientDebug=function(e){Kn=!!e},exports.setMermaidWorkerMaxConcurrency=function(e){Number.isFinite(e)&&e>0&&(Yn=Math.floor(e))},exports.terminateWorker=Gn,exports.useSmoothMarkdownStream=Kt,exports.waitForKaTeXWorkerSlot=In,Object.keys(c).forEach(e=>{"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:()=>c[e]})});
|
|
1
|
+
"use strict";Object.create;var e,t=Object.defineProperty,n=Object.defineProperties,o=(Object.getOwnPropertyDescriptor,Object.getOwnPropertyDescriptors),r=(Object.getOwnPropertyNames,Object.getOwnPropertySymbols),l=(Object.getPrototypeOf,Object.prototype.hasOwnProperty),i=Object.prototype.propertyIsEnumerable,a=(e,n,o)=>n in e?t(e,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[n]=o,s=(e,t)=>{for(var n in t||(t={}))l.call(t,n)&&a(e,n,t[n]);if(r)for(var n of r(t))i.call(t,n)&&a(e,n,t[n]);return e},u=(e,t)=>n(e,o(t)),d=(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())});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("stream-markdown-parser"),m=require("vue-demi"),p=require("markstream-core"),f=require("@floating-ui/dom");var v="undefined"!=typeof document?document.currentScript:null;function h(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const n in e)if("default"!==n){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>e[n]})}return t.default=e,Object.freeze(t)}const g=h(m);function y(e,t){if(null==e)return!1;const n=typeof e;return("object"===n||"function"===n)&&t in e}function w(e){return function(e){const t=function(e){const t="string"==typeof e?e:"",[n,o]=t.split(".").map(Number);return Number.isFinite(n)&&Number.isFinite(o)&&2===n?o:null}(e);return null!=t&&t<7}(function(e){var t,n,o,r,l,i,a,s,u;const d=null==(n=null==(t=null==e?void 0:e.$options)?void 0:t._base)?void 0:n.version;if("string"==typeof d&&d)return d;const c=null==(l=null==(r=null==(o=null==e?void 0:e.$root)?void 0:o.$options)?void 0:r._base)?void 0:l.version;if("string"==typeof c&&c)return c;if(y(e,"$")){const t=null==(s=null==(a=null==(i=e.$)?void 0:i.appContext)?void 0:a.app)?void 0:s.version;if("string"==typeof t&&t)return t}if(y(e,"constructor")){const t=null==(u=e.constructor)?void 0:u.version;if("string"==typeof t&&t)return t}if(y(e,"version")){const t=e.version;if("string"==typeof t&&t)return t}return""}(e))}function x(e){return e.slice(2).replace(/^[A-Z]/,e=>e.toLowerCase()).replace(/([A-Z])/g,"-$1").toLowerCase()}function k(e){if(y(e,"$listeners")){const t=e.$listeners;if(t&&"object"==typeof t)return t}if(!y(e,"$attrs"))return{};const t=e.$attrs;if(!t||"object"!=typeof t)return{};const n={};for(const[o,r]of Object.entries(t))/^on[A-Z]/.test(o)&&("function"==typeof r||Array.isArray(r)&&r.every(e=>"function"==typeof e))&&(n[x(o)]=r);return n}function M(e,t,n,o,r,l,i,a){var s,u="function"==typeof e?e.options:e;if(t&&(u.render=t,u.staticRenderFns=n,u._compiled=!0),o&&(u.functional=!0),l&&(u._scopeId="data-v-"+l),i?(s=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),r&&r.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(i)},u._ssrRegister=s):r&&(s=a?function(){r.call(this,(u.functional?this.parent:this).$root.$options.shadowRoot)}:r),s)if(u.functional){u._injectStyles=s;var d=u.render;u.render=function(e,t){return s.call(t),d(e,t)}}else{var c=u.beforeCreate;u.beforeCreate=c?[].concat(c,s):[s]}return{exports:e,options:u}}const b=M(m.defineComponent({__name:"CheckboxNode",props:{node:null},setup:e=>({__sfc:!0})}),function(){var e=this,t=e._self._c;return e._self._setupProxy,t("span",{staticClass:"checkbox-node"},[t("input",{staticClass:"checkbox-input",attrs:{type:"checkbox",disabled:""},domProps:{checked:e.node.checked}})])},[],!1,null,"8dc6c46f",null,null).exports,C=M(m.defineComponent({__name:"DefinitionListNode",props:{node:null,indexKey:null,typewriter:{type:Boolean},customId:null},emits:["copy"],setup(e){const t=e,n=m.getCurrentInstance(),o=m.computed(()=>w(null==n?void 0:n.proxy)?Ht:en),r=m.computed(()=>t.node.items.flatMap((e,n)=>[{key:`definition-term-${t.indexKey}-${n}`,tag:"dt",className:"definition-term",nodes:e.term},{key:`definition-desc-${t.indexKey}-${n}`,tag:"dd",className:"definition-desc",nodes:e.definition}]));return{__sfc:!0,props:t,instance:n,nestedRenderer:o,definitionEntries:r}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("dl",{staticClass:"definition-list"},e._l(n.definitionEntries,function(o){return t(o.tag,{key:o.key,tag:"component",class:o.className},[t(n.nestedRenderer,{tag:"component",attrs:{"index-key":o.key,nodes:o.nodes,"custom-id":n.props.customId,typewriter:n.props.typewriter},on:{copy:function(t){return e.$emit("copy",t)}}})],1)}),1)},[],!1,null,"b089ea12",null,null).exports,T=M(m.defineComponent({__name:"EmojiNode",props:{node:null},setup:e=>({__sfc:!0})}),function(){var e=this,t=e._self._c;return e._self._setupProxy,t("span",{staticClass:"emoji-node"},[e._v(e._s(e.node.name))])},[],!1,null,"de55dc97",null,null).exports,N="__global__",_="__MARKSTREAM_VUE2_CUSTOM_COMPONENTS_STORE__",D=(()=>{const e=globalThis;if(e[_])return e[_];const t={scopedCustomComponents:{},revision:m.shallowRef(0)};return e[_]=t,t})(),I=D.revision;function S(e){const t=D.scopedCustomComponents[N]||{};if(!e)return t;const n=D.scopedCustomComponents[e]||{};return t&&0!==Object.keys(t).length?n&&0!==Object.keys(n).length?s(s({},t),n):t:n}const j=".markdown-renderer";function E(e,t){var n,o;if("undefined"==typeof document||"undefined"==typeof Element)return null;const r=function(e){return`[id="${e.replace(/["\\]/g,"\\$&")}"]`}(t);let l=e instanceof Element?e.closest(j):null;for(;l;){const e=l.querySelector(r);if(e)return e;l=null!=(o=null==(n=l.parentElement)?void 0:n.closest(j))?o:null}return document.querySelector(r)}const L=M(m.defineComponent({__name:"FootnoteReferenceNode",props:{node:null},setup(e){const t=e,n=`#fnref--${t.node.id}`;return{__sfc:!0,props:t,href:n,handleScroll:function(e){if("undefined"==typeof document)return;const o=E(e.currentTarget,`fnref--${t.node.id}`);o?o.scrollIntoView({behavior:"smooth"}):console.warn(`Element with href: ${n} not found`)}}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("sup",{staticClass:"footnote-reference",attrs:{id:`fnref-${e.node.id}`},on:{click:n.handleScroll}},[t("span",{staticClass:"footnote-link cursor-pointer",attrs:{href:n.href,title:`查看脚注 ${e.node.id}`}},[e._v("["+e._s(e.node.id)+"]")])])},[],!1,null,"7f0fa4a6",null,null).exports,B=function(){var e,t,n;const o=g,r=e=>"function"==typeof e&&"function"==typeof e.extend,l=[o,null==o?void 0:o.default,null==(e=null==o?void 0:o.default)?void 0:e.default,null==(n=null!=(t=null==o?void 0:o.default)?t:o)?void 0:n.default,null==o?void 0:o.Vue2,null==o?void 0:o.Vue];for(const a of l){const e=r(a)?a:r(null==a?void 0:a.default)?a.default:null;if(e)try{const t=new e;if("function"==typeof t.$createElement)return t.$createElement.bind(t)}catch(i){}}return null}();function A(e,t,n,o){if(e)return e(t,n,o);try{return m.h(t,n,o)}catch(r){}try{return m.h(t,n,o)}catch(r){}return B?B(t,n,o):null}const O=(()=>{var e;try{return Boolean(null==(e={BASE_URL:"/",MODE:"npm",DEV:!1,PROD:!0,SSR:!1})?void 0:e.DEV)}catch(t){}return!1})();function z(e){O&&console.warn(e)}function P(e){return c.sanitizeHtmlAttrs(e)}function R(e,t,n=!1){const o=Object.entries(null!=t?t:{}),r=o.length>0?o.map(([e,t])=>""===t?` ${e}`:` ${e}="${t}"`).join(""):"";return n?`<${e}${r} />`:`<${e}${r}>`}function H(e,t){Array.isArray(t)?e.push(...t):null!=t&&e.push(t)}function $(e,t,n,o,a,s="safe",u=!1){const d=function(e,t){return c.isCustomHtmlComponentTag(e,t)}(e,o);if(c.BLOCKED_HTML_TAGS.has(e.toLowerCase())||!d&&c.isHtmlTagHardBlocked(e,s))return null;if(!d&&c.isHtmlTagBlocked(e,s))return u?[R(e,t,!0)]:[R(e,t),...n,`</${e}>`];const m=c.sanitizeHtmlAttrs(t,s,e);if(d){const t=o[e]||o[e.toLowerCase()],r=function(e){return c.convertHtmlAttrsToProps(e)}(m);return A(a,t,r,n.length>0?n:void 0)}{const t=m,{innerHTML:o}=t;return A(a,e,((e,t)=>{var n={};for(var o in e)l.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&r)for(var o of r(e))t.indexOf(o)<0&&i.call(e,o)&&(n[o]=e[o]);return n})(t,["innerHTML"]),n.length>0?n:void 0)}}function U(e,t){return c.hasCustomHtmlComponents(e,t)}function F(e,t,n,o="safe"){if(!e)return[];try{const r=function(e,t,n,o="safe"){const r=[],l=[];for(const i of e)if("text"===i.type)(r.length>0?r[r.length-1].children:l).push(i.content);else if("self_closing"===i.type){const e=$(i.tagName,i.attrs||{},[],t,n,o,!0);H(r.length>0?r[r.length-1].children:l,e)}else if("tag_open"===i.type)r.push({tagName:i.tagName,children:[],attrs:i.attrs});else if("tag_close"===i.type){const e=i.tagName.toLowerCase();let a=-1;for(let t=r.length-1;t>=0;t--)if(r[t].tagName.toLowerCase()===e){a=t;break}if(-1!==a)for(;r.length>a;){const i=r.pop(),s=$(i.tagName,i.attrs||{},i.children,t,n,o);r.length>0?H(r[r.length-1].children,s):H(l,s),i.tagName.toLowerCase()!==e&&r.length>a&&z(`Auto-closing unclosed tag: <${i.tagName}>`)}else z(`Ignoring closing tag with no matching opening tag: </${i.tagName}>`)}for(;r.length>0;){const e=r.pop();H(l,$(e.tagName,e.attrs||{},e.children,t,n,o)),z(`Auto-closing unclosed tag: <${e.tagName}>`)}return l}(c.tokenizeHtml(e),t,n,o);return r}catch(l){return r=l,O&&console.error("Failed to parse HTML to VNodes:",r),null}var r}const Y=M(m.defineComponent({__name:"HtmlInlineNode",props:{node:null,customId:null,htmlPolicy:null},setup(e){const t=e,n=m.inject("markstreamHtmlPolicy",void 0),o=m.computed(()=>{var e,o;return null!=(o=null!=(e=t.htmlPolicy)?e:null==n?void 0:n.value)?o:"safe"}),r=m.computed(()=>S(t.customId)),l=m.defineComponent({name:"DynamicRenderer",props:{content:{type:String,required:!0},customComponents:{type:Object,required:!0},htmlPolicy:{type:String,default:"safe"}},render(){return F(this.content,this.customComponents,void 0,this.htmlPolicy)||[]}}),i=m.computed(()=>{const e=t.node.content;return e?"escape"===o.value?{mode:"html",content:c.sanitizeHtmlContent(e,o.value)}:t.node.loading&&!t.node.autoClosed?{mode:"text",content:e}:U(e,r.value)?{mode:"dynamic",content:e}:{mode:"html",content:c.sanitizeHtmlContent(e,o.value)}:{mode:"html",content:""}});return{__sfc:!0,props:t,inheritedHtmlPolicy:n,resolvedHtmlPolicy:o,customComponents:r,DynamicRenderer:l,renderMode:i}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return"dynamic"===n.renderMode.mode?t("span",{staticClass:"html-inline-node",class:{"html-inline-node--loading":n.props.node.loading}},[t(n.DynamicRenderer,{attrs:{content:n.renderMode.content,"custom-components":n.customComponents,"html-policy":n.resolvedHtmlPolicy}})],1):"text"===n.renderMode.mode?t("span",{staticClass:"html-inline-node",class:{"html-inline-node--loading":n.props.node.loading}},[e._v(e._s(n.renderMode.content))]):t("span",{staticClass:"html-inline-node",class:{"html-inline-node--loading":n.props.node.loading},domProps:{innerHTML:e._s(n.renderMode.content)}})},[],!1,null,"e6ed4c9f",null,null).exports,K=M(m.defineComponent({__name:"InlineCodeNode",props:{node:null},setup(e){const t=e;function n(e,t){return e.reduce((e,n)=>{const o=n.id===t?u(s({},n),{fading:!1}):n,r=e[e.length-1];return!r||r.fading||o.fading?e.push(o):e[e.length-1]=u(s({},r),{content:r.content+o.content}),e},[])}const o=m.getCurrentInstance(),r=m.computed(()=>{var e,t;return null!=(t=null==(e=null==o?void 0:o.proxy)?void 0:e.$attrs)?t:{}}),l=m.inject("markstreamFade",void 0),i=m.inject("markstreamTextStreamState",void 0),a=m.computed(()=>{const e=r.value.fade;return""===e||!0===e||"true"===e||!1!==e&&"false"!==e&&void 0}),d=m.computed(()=>"boolean"==typeof a.value?a.value:"boolean"!=typeof(null==l?void 0:l.value)||l.value),c=m.computed(()=>{var e;const t=null!=(e=r.value["index-key"])?e:r.value.indexKey;return null==t||""===t?"":String(t)}),p=m.ref(t.node.code?[{id:0,content:t.node.code,fading:!1}]:[]),f=m.ref(t.node.code);let v=1;function h(e){var t;(1!==p.value.length||(null==(t=p.value[0])?void 0:t.fading)||p.value[0].content!==e)&&(p.value=e?[{id:v++,content:e,fading:!1}]:[])}return m.watch([()=>t.node.code,c,d],([e])=>{const t=String(null!=e?e:""),n=c.value,o=n?null==i?void 0:i.get(n):void 0,r=null!=o?o:f.value,l=void 0!==o&&o!==f.value;if(d.value){if(t!==r)if(r&&t.startsWith(r)){const e=t.slice(r.length),n=p.value[p.value.length-1];l?p.value=[{id:v++,content:r,fading:!1},{id:v++,content:e,fading:!0}]:(null==n?void 0:n.fading)?p.value=[...p.value.slice(0,-1),u(s({},n),{content:n.content+e})]:p.value=[...p.value,{id:v++,content:e,fading:!0}]}else h(t)}else h(t);f.value=t,n&&(null==i||i.set(n,t))},{immediate:!0}),m.watch(d,e=>{e||h(f.value)}),{__sfc:!0,props:t,settleAndMergeSegments:n,instance:o,attrs:r,inheritedFade:l,inheritedTextStreamState:i,explicitFade:a,fadeEnabled:d,streamStateKey:c,segments:p,renderedCode:f,nextSegmentId:v,setFullContent:h,settleSegment:function(e){p.value.some(t=>t.id===e&&t.fading)&&(p.value=n(p.value,e))},streamedDeltaClass:function(e){return e.id%2==0?"inline-code-stream-delta--a":"inline-code-stream-delta--b"}}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("code",{staticClass:"inline text-[85%] px-1 py-0.5 rounded font-mono bg-[hsl(var(--secondary))] whitespace-normal break-words max-w-full before:content-[''] after:content-['']"},e._l(n.segments,function(o){return t("span",{key:o.id,class:o.fading?["inline-code-stream-delta",n.streamedDeltaClass(o)]:void 0,on:{animationend:function(e){o.fading&&n.settleSegment(o.id)}}},[e._v(" "+e._s(o.content)+" ")])}),0)},[],!1,null,"8b374652",null,null).exports,W=m.ref(!1),Q=m.ref(""),V=m.ref("top"),X=m.ref(null),q=m.ref(null),G=m.ref(null),Z=m.ref(null),J=m.ref(null);let ee=null,te=null;function ne(){ee&&(clearTimeout(ee),ee=null),te&&(clearTimeout(te),te=null)}let oe=!1,re=null;function le(){return oe||"undefined"==typeof document?Promise.resolve():re||(re=Promise.resolve().then(()=>ro).then(e=>{var t;oe=!0;const n=null!=(t=null==e?void 0:e.default)?t:e,o=document.createElement("div");o.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(o);const r=function(){var e,t,n,o;const r=g,l=e=>"function"==typeof e&&"function"==typeof e.extend,i=[r,null==r?void 0:r.default,null==(e=null==r?void 0:r.default)?void 0:e.default,null==(n=null!=(t=null==r?void 0:r.default)?t:r)?void 0:n.default,null==r?void 0:r.Vue2,null==r?void 0:r.Vue];for(const a of i){if(l(a))return a;if(l(null==a?void 0:a.default))return a.default}return null!=(o=null==r?void 0:r.default)?o:r}();(new(r.extend({render(e){var t;return e(n,{props:{visible:W.value,anchorEl:X.value,content:Q.value,placement:V.value,id:q.value,originX:G.value,originY:Z.value,isDark:null!=(t=J.value)?t:void 0}})}}))).$mount(o)}).catch(e=>{re=null,oe=!1,console.warn("[markstream-vue2] Failed to load Tooltip component. Tooltips will be disabled.",e)}),re)}function ie(e,t,n="top",o=!1,r,l){if(!e)return;le(),ne();const i=()=>{var o,i;q.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,X.value=e,Q.value=t,V.value=n,G.value=null!=(o=null==r?void 0:r.x)?o:null,Z.value=null!=(i=null==r?void 0:r.y)?i:null,J.value="boolean"==typeof l?l:null,W.value=!0;try{e.setAttribute("aria-describedby",q.value)}catch(a){}};o?i():ee=setTimeout(i,80)}function ae(e=!1){ne();const t=()=>{if(X.value&&q.value)try{X.value.removeAttribute("aria-describedby")}catch(e){}W.value=!1,X.value=null,q.value=null,G.value=null,Z.value=null};e?t():te=setTimeout(t,120)}const se={"common.copy":"Copy","common.copied":"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.minimize":"Minimize","common.zoomIn":"Zoom in","common.zoomOut":"Zoom out","common.resetZoom":"Reset zoom","image.loadError":"Image failed to load","image.loading":"Loading image..."},ue=e=>{var t;return null!=(t=se[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)};function de(){try{const n=globalThis.$vueI18nUse||null;if(n&&"function"==typeof n)try{const t=n();if(t&&"function"==typeof t.t)return e={t:t.t.bind(t),te:"function"==typeof t.te?t.te.bind(t):void 0},{t(t){if(e.te&&se[t]&&!e.te(t))return ue(t);const n=e.t(t);return n===t&&se[t]?ue(t):n}}}catch(t){}}catch(t){}var e;return{t:ue}}const ce=M(m.defineComponent({__name:"ImageNode",props:{node:null,fallbackSrc:{default:""},lazy:{type:Boolean,default:!0},usePlaceholder:{type:Boolean,default:!0}},emits:["load","error","click"],setup(e,{emit:t}){const n=e,o=m.ref(!1),r=m.ref(!1),l=m.ref(""),i=m.ref("primary"),a=m.computed(()=>c.sanitizeImageSrc(n.node.src)),s=m.computed(()=>c.sanitizeImageSrc(n.fallbackSrc)),u=m.computed(()=>l.value),d=m.computed(()=>!n.node.loading&&"failed"!==i.value&&l.value.length>0),p=m.computed(()=>!n.node.loading&&"failed"===i.value),{t:f}=de();return m.watch([a,s,()=>n.node.loading],()=>(o.value=!1,r.value=!1,n.node.loading||a.value?(l.value=a.value,void(i.value="primary")):s.value?(l.value=s.value,void(i.value="fallback")):(l.value="",i.value="failed",void(r.value=!0))),{immediate:!0}),{__sfc:!0,props:n,emit:t,imageLoaded:o,hasError:r,activeSrc:l,imageStage:i,safeNodeSrc:a,safeFallbackSrc:s,displaySrc:u,showImage:d,showError:p,handleImageError:function(){if("primary"===i.value&&s.value&&s.value!==l.value)return i.value="fallback",l.value=s.value,o.value=!1,void(r.value=!1);i.value="failed",r.value=!0,t("error",l.value)},handleImageLoad:function(){o.value=!0,r.value=!1,t("load",u.value)},handleClick:function(e){e.preventDefault(),o.value&&!r.value&&t("click",[e,u.value])},t:f}}}),function(){var e,t,n,o,r,l=this,i=l._self._c,a=l._self._setupProxy;return i("transition",{attrs:{name:"img-switch",mode:"out-in"}},[a.showImage?i("img",{key:"image",staticClass:"image-node__img h-auto rounded-lg transition-opacity duration-200 ease-in-out image-node__img--inline",class:{"opacity-0":!a.imageLoaded,"opacity-100":a.imageLoaded,"cursor-pointer":a.imageLoaded},attrs:{src:a.displaySrc,alt:String(null!=(t=null!=(e=a.props.node.alt)?e:a.props.node.title)?t:""),title:String(null!=(o=null!=(n=a.props.node.title)?n:a.props.node.alt)?o:""),loading:a.props.lazy?"lazy":"eager",decoding:"async",tabindex:a.imageLoaded?0:-1,"aria-label":null!=(r=a.props.node.alt)?r:a.t("image.preview")},on:{error:a.handleImageError,load:a.handleImageLoad,click:a.handleClick}}):l.node.loading&&!a.hasError?i("span",{key:"placeholder",staticClass:"placeholder-layer placeholder-layer--inline inline-flex items-center justify-center gap-2"},[a.props.usePlaceholder?[l._t("placeholder",function(){return[i("div",{staticClass:"w-4 h-4 rounded-full border-2 border-solid border-current border-t-transparent animate-spin",attrs:{"aria-hidden":"true"}}),i("span",{staticClass:"text-sm whitespace-nowrap"},[l._v(l._s(a.t("image.loading")))])]},{node:a.props.node,displaySrc:a.displaySrc,imageLoaded:a.imageLoaded,hasError:a.hasError,fallbackSrc:a.props.fallbackSrc,lazy:a.props.lazy})]:[i("span",{staticClass:"text-sm text-gray-500"},[l._v(l._s(l.node.raw))])]],2):a.showError?i("span",{key:"error",staticClass:"image-node__error image-node__error--inline px-4 py-2 bg-gray-100 flex items-center justify-center rounded-lg gap-2 text-red-500"},[l._t("error",function(){return[i("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"}},[i("path",{attrs:{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"}})]),i("span",{staticClass:"text-sm whitespace-nowrap"},[l._v(l._s(a.t("image.loadError")))])]},{node:a.props.node,displaySrc:a.displaySrc,imageLoaded:a.imageLoaded,hasError:a.hasError,fallbackSrc:a.props.fallbackSrc,lazy:a.props.lazy})],2):l._e()])},[],!1,null,"05ffe4c4",null,null).exports;let me=null,pe=!1,fe=ge;function ve(e){var t;const n=null!=(t=null==e?void 0:e.default)?t:e;return n&&"function"==typeof n.renderToString?n:null}function he(){try{const e=globalThis;return ve(null==e?void 0:e.katex)}catch(e){return null}}function ge(){return(()=>d(this,null,function*(){const e=he();if(e)return e;const t=yield import("katex");try{yield Promise.resolve().then(()=>require("./chunks/mhchem-4785e7bc.cjs"))}catch(n){}return ve(t)}))()}function ye(e){fe=e,me=null,pe=!1}function we(){return"function"==typeof fe}function xe(){return d(this,null,function*(){var e;const t=he();if(t)return me=t,me;if(me)return me;if(pe)return null;const n=fe;if(!n)return pe=!0,null;try{const t=yield n();if(t)return me=null!=(e=ve(t))?e:t,me}catch(o){}return pe=!0,null})}const ke=m.shallowRef(!1);let Me=null;const be=M(m.defineComponent({__name:"TextNode",props:{node:null},emits:["copy"],setup(e){const t=e;function n(e,t){return e.reduce((e,n)=>{const o=null==t||n.id===t?u(s({},n),{fading:!1}):n,r=e[e.length-1];return!r||r.fading||o.fading?e.push(o):e[e.length-1]=u(s({},r),{content:r.content+o.content}),e},[])}const o=(Me||(Me=xe().then(e=>{ke.value=!!e}).catch(()=>{ke.value=!1})),m.readonly(ke)),r=m.getCurrentInstance(),l=m.computed(()=>{var e,t;return null!=(t=null==(e=null==r?void 0:r.proxy)?void 0:e.$attrs)?t:{}}),i=m.inject("markstreamFade",void 0),a=m.inject("markstreamTextStreamState",void 0),d=m.inject("markstreamStreamVersion",void 0),c=m.computed(()=>{const e=l.value.fade;return""===e||!0===e||"true"===e||!1!==e&&"false"!==e&&void 0}),p=m.computed(()=>"boolean"==typeof c.value?c.value:"boolean"!=typeof(null==i?void 0:i.value)||i.value),f=m.computed(()=>{var e;const t=null!=(e=l.value["index-key"])?e:l.value.indexKey;return null==t||""===t?"":String(t)}),v=m.ref(t.node.content?[{id:0,content:t.node.content,fading:!1}]:[]),h=m.ref(t.node.content);let g=1;function y(e){var t;(1!==v.value.length||(null==(t=v.value[0])?void 0:t.fading)||v.value[0].content!==e)&&(v.value=e?[{id:g++,content:e,fading:!1}]:[])}function w(){v.value.some(e=>e.fading)&&(v.value=n(v.value))}return m.watch([()=>t.node.content,f,p,()=>null==d?void 0:d.value],([e])=>{const t=String(null!=e?e:""),n=f.value,o=n?null==a?void 0:a.get(n):void 0,r=null!=o?o:h.value,l=void 0!==o&&o!==h.value;if(!p.value)return y(t),h.value=t,void(n&&(null==a||a.set(n,t)));if(t===r)return v.value.some(e=>e.fading)?w():h.value!==t&&y(t),n&&(null==a||a.set(n,t)),void(h.value=t);if(r&&t.startsWith(r)){const e=t.slice(r.length),n=v.value[v.value.length-1];l?v.value=[{id:g++,content:r,fading:!1},{id:g++,content:e,fading:!0}]:(null==n?void 0:n.fading)?v.value=[...v.value.slice(0,-1),u(s({},n),{content:n.content+e})]:v.value=[...v.value,{id:g++,content:e,fading:!0}]}else y(t);h.value=t,n&&(null==a||a.set(n,t))},{immediate:!0}),m.watch(p,e=>{e||y(h.value)}),{__sfc:!0,props:t,settleAndMergeSegments:n,katexReady:o,instance:r,attrs:l,inheritedFade:i,inheritedTextStreamState:a,inheritedStreamVersion:d,explicitFade:c,fadeEnabled:p,streamStateKey:f,segments:v,renderedContent:h,nextSegmentId:g,setFullContent:y,settleSegment:function(e){v.value.some(t=>t.id===e&&t.fading)&&(v.value=n(v.value,e))},settleFadingSegments:w,streamedDeltaClass:function(e){return e.id%2==0?"text-node-stream-delta--a":"text-node-stream-delta--b"}}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("span",{staticClass:"whitespace-pre-wrap break-words text-node",class:[n.katexReady&&e.node.center?"text-node-center":""]},e._l(n.segments,function(o){return t("span",{key:o.id,class:o.fading?["text-node-stream-delta",n.streamedDeltaClass(o)]:void 0,on:{animationend:function(e){o.fading&&n.settleSegment(o.id)}}},[e._v(" "+e._s(o.content)+" ")])}),0)},[],!1,null,"152fed75",null,null).exports;let Ce=!1,Te=null,Ne=!1;function _e(){return d(this,null,function*(){if(Te)return Te;if(Ne)return null;try{const e=function(e){var t,n,o;const r="function"==typeof(null==e?void 0:e.createCodeBlockRuntime)||"function"==typeof(null==e?void 0:e.useMonaco)?e:null==e?void 0:e.default,l=null!=(t=null==r?void 0:r.createCodeBlockRuntime)?t:null==r?void 0:r.useMonaco;return"function"!=typeof l?null:{createCodeBlockRuntime:e=>l.call(r,e),detectLanguage:null==(n=null==r?void 0:r.detectLanguage)?void 0:n.bind(r),preloadStreamDiffs:null==(o=null==r?void 0:r.preloadStreamDiffs)?void 0:o.bind(r)}}(yield import("stream-diffs/markstream"));if(e)return Te=e,yield function(e){return d(this,null,function*(){var t;if(!Ce)return Ce=!0,null==(t=e.preloadStreamDiffs)?void 0:t.call(e)})}(Te),Te}catch(e){}return Ne=!0,null})}const De='<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',Ie='<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',Se='<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';let je=null,Ee=null,Le=null;const Be=m.ref(0),Ae={"":Se,plain:Se,text:Se,javascript:'<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',typescript:'<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" viewBox="0 0 16 16"><path fill="#0288d1" d="M2 2v12h12V2zm4 6h3v1H8v4H7V9H6zm5 0h2v1h-2v1h1a1.003 1.003 0 0 1 1 1v1a1.003 1.003 0 0 1-1 1h-2v-1h2v-1h-1a1.003 1.003 0 0 1-1-1V9a1.003 1.003 0 0 1 1-1"/></svg>\n',jsx:'<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',tsx:'<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',html:'<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',css:'<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',scss:'<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',json:'<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',python:'<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',ruby:'<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',go:'<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',java:'<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',kotlin:'<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',c:'<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',cpp:'<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',cs:De,csharp:De,php:'<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',shell:Ie,powershell:Ie,sql:'<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',yaml:'<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',markdown:'<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',xml:'<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',rust:'<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',vue:'<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',mermaid:'<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',svg:'<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'},Oe={"":"",javascript:"javascript",js:"javascript",mjs:"javascript",cjs:"javascript",typescript:"typescript",ts:"typescript",jsx:"jsx",tsx:"tsx",golang:"go",py:"python",rb:"ruby",sh:"shell",bash:"shell",zsh:"shell",shellscript:"shell",bat:"shell",batch:"shell",ps1:"powershell",plaintext:"plain",text:"plain",txt:"plain","c++":"cpp","c#":"csharp",cs:"csharp","objective-c":"objectivec","objective-c++":"objectivecpp",yml:"yaml",md:"markdown",rs:"rust",kt:"kotlin",d:"dlang",vbnet:"vb.net"};function ze(){return d(this,null,function*(){return Ee||(Le||(Le=Promise.resolve().then(()=>require("./chunks/languageIconExtended-4baf8bdb.cjs")).then(e=>(Ee=e.EXTENDED_LANGUAGE_ICON_MAP,Be.value++,Ee)).catch(()=>null)),Le)})}function Pe(e){je=null!=e?e:null}function Re(e){var t;const n=function(e){if(!e)return"";const t=e.trim();if(!t)return"";const[n]=t.split(/\s+/),[o]=n.split(":");return o.toLowerCase()}(e);return null!=(t=Oe[n])?t:n}function He(e){const t=Re(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"shell":return"zsh";case"objectivec":return"objective-c";case"objectivecpp":return"objective-cpp";default:return t}}function $e(e){if(je){const t=je(e);if(null!=t&&""!==t)return t}const t=Re(e),n=Ae[t];if(n)return n;return(null==Ee?void 0:Ee[t])||(ze(),'<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 Ue={js:"JavaScript",javascript:"JavaScript",ts:"TypeScript",typescript:"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#",csharp:"C#",php:"PHP",sh:"Shell",bash:"Bash",sql:"SQL",yaml:"YAML",md:"Markdown",d2:"D2",d2lang:"D2","":"Plain Text",plain:"Plain Text"},Fe=new Map,Ye=new Set(["admonition","blockquote","checkbox","checkbox_input","code_block","definition_item","definition_list","emoji","emphasis","footnote","footnote_reference","footnote_anchor","hardbreak","heading","highlight","html_block","html_inline","image","inline_code","insert","link","list","list_item","math_block","math_inline","paragraph","reference","strikethrough","strong","subscript","superscript","table","table_cell","table_row","text","thematic_break"]);function Ke(e,t={}){return Qe(e,We(t))}function We(e){var t;const n=c.normalizeCustomHtmlTags(e.customHtmlTags),o=`${e.cacheKey||"markstream-vue2-nested-html"}::${n.join(",")}`;let r=Fe.get(o);return r||(r=c.getMarkdown(o,{customHtmlTags:n}),Fe.set(o,r)),{markdown:r,options:{allowHtml:!1!==e.allowHtml,htmlPolicy:null!=(t=e.htmlPolicy)?t:"safe",customNodeTag:c.normalizeCustomHtmlTagName(e.customNodeTag)||"div",customNodeClass:e.customNodeClass}}}function Qe(e,t){return(Array.isArray(e)?e:[]).map(e=>Ve(e,t)).join("")}function Ve(e,t){if(!e||"object"!=typeof e)return"";switch(e.type){case"text":return it(ot(e.content));case"paragraph":return`<p>${Qe(nt(e.children),t)}</p>`;case"strong":return`<strong>${Qe(nt(e.children),t)}</strong>`;case"emphasis":return`<em>${Qe(nt(e.children),t)}</em>`;case"strikethrough":return`<del>${Qe(nt(e.children),t)}</del>`;case"highlight":return`<mark>${Qe(nt(e.children),t)}</mark>`;case"insert":return`<ins>${Qe(nt(e.children),t)}</ins>`;case"subscript":return`<sub>${Qe(nt(e.children),t)}</sub>`;case"superscript":return`<sup>${Qe(nt(e.children),t)}</sup>`;case"inline_code":return`<code>${it(ot(e.code))}</code>`;case"hardbreak":return"<br>";case"link":return function(e,t){const n=ot(e.href),o=ot(e.title),r=nt(e.children).length>0?Qe(nt(e.children),t):it(ot(e.text||n)),l=o?` title="${at(o)}"`:"",i=n&&!c.isUnsafeHtmlUrl(n)?n:"";return`<a${i?` href="${at(i)}"`:""}${l}${c.shouldOpenLinkInNewTab(i)?' target="_blank" rel="noreferrer noopener"':""}>${r}</a>`}(e,t);case"image":return function(e){const t=c.sanitizeImageSrc(e.src);if(!t)return"";const n=ot(e.alt),o=ot(e.title),r=o?` title="${at(o)}"`:"";return`<img src="${at(t)}" alt="${at(n)}"${r}>`}(e);case"list":return function(e,t){const n=e.ordered?"ol":"ul";return`<${n}${e.ordered&&Number.isFinite(e.start)?` start="${Number(e.start)}"`:""}>${Qe(nt(e.items),t)}</${n}>`}(e,t);case"list_item":return`<li>${Qe(nt(e.children),t)}</li>`;case"blockquote":return`<blockquote>${Qe(nt(e.children),t)}</blockquote>`;case"heading":return function(e,t){const n=function(e){const t=Math.trunc(Number(e)||1);return Math.min(6,Math.max(1,t))}(e.level);return`<h${n}>${Qe(nt(e.children),t)}</h${n}>`}(e,t);case"code_block":return function(e){const t=lt(ot(e.language));return`<pre><code${t?` class="language-${t}"`:""}>${it(ot(e.code))}</code></pre>`}(e);case"thematic_break":return"<hr>";case"table":return function(e,t){const n=e.header?Xe(e.header,t,!0):"",o=Qe(nt(e.rows),t);return`<table>${n?`<thead>${n}</thead>`:""}${o?`<tbody>${o}</tbody>`:""}</table>`}(e,t);case"table_row":return Xe(e,t);case"table_cell":return qe(e,t);case"definition_list":return function(e,t){return`<dl>${nt(e.items).map(e=>Ge(e,t)).join("")}</dl>`}(e,t);case"definition_item":return Ge(e,t);case"footnote":return function(e,t){return`<div id="fnref--${at(ot(e.id))}" class="footnote-node markstream-nested-footnote"><div class="footnote-node__content">${Qe(nt(e.children),t)}</div></div>`}(e,t);case"footnote_reference":return function(e){const t=it(ot(e.id)),n=at(ot(e.id));return`<sup id="fnref-${n}" class="footnote-reference markstream-nested-footnote-ref"><span href="#fnref--${n}" title="查看脚注 ${n}" class="footnote-link cursor-pointer">[${t}]</span></sup>`}(e);case"footnote_anchor":return function(e){const t=at(ot(e.id));return`<a class="footnote-anchor" href="#fnref-${t}" title="返回引用 ${t}" aria-label="返回引用 ${t}">↩︎</a>`}(e);case"admonition":return function(e,t){const n=lt(ot(e.kind||"note"))||"note";var o;return`<div class="markstream-nested-admonition markstream-nested-admonition--${n}"><div class="markstream-nested-admonition__title">${it(ot(e.title)||((o=n)?`${o[0].toUpperCase()}${o.slice(1)}`:""))}</div><div class="markstream-nested-admonition__content">${Qe(nt(e.children),t)}</div></div>`}(e,t);case"checkbox":case"checkbox_input":return`<input type="checkbox" disabled${e.checked?" checked":""}>`;case"emoji":return it(ot(e.raw||e.markup||e.content||e.name));case"math_inline":return`<span class="markstream-nested-math" data-display="inline">${it(ot(e.content||e.markup||e.raw))}</span>`;case"math_block":return`<pre class="markstream-nested-math-block"><code>${it(ot(e.content||e.markup||e.raw))}</code></pre>`;case"reference":return`<sup class="markstream-nested-reference">[${it(ot(e.id))}]</sup>`;case"html_inline":case"html_block":return function(e,t){const n=ot(e.content)||ot(e.raw),o=ot(e.tag).trim().toLowerCase(),r=nt(e.children);return t.options.allowHtml?"escape"===t.options.htmlPolicy||e.loading&&!e.autoClosed?it(n):o&&r.length>0&&!c.NON_STRUCTURING_HTML_TAGS.has(o)&&!c.isHtmlTagBlocked(o,t.options.htmlPolicy)?`<${o}${tt(e.attrs)}>${Qe(r,t)}</${o}>`:c.sanitizeHtmlContent(n,t.options.htmlPolicy):it(n)}(e,t);default:return function(e,t){const n=ot(e.tag||e.type);if(!n||Ye.has(n))return it(ot(e.content||e.raw));const o=["markstream-nested-custom",`markstream-nested-custom--${lt(n)||"node"}`,Je(e,t.options.customNodeClass)].filter(Boolean).join(" "),r=tt(e.attrs,o),l=function(e,t){const n=nt(e.children);if(n.length>0)return Qe(n,t);const o=ot(e.content);return o?Ze(o,t):it(ot(e.raw))}(e,t),i=t.options.customNodeTag;return`<${i}${r} data-markstream-custom-tag="${at(n)}">${l}</${i}>`}(e,t)}}function Xe(e,t,n=!1){return`<tr>${nt(e.cells).map(e=>qe(e,t,n)).join("")}</tr>`}function qe(e,t,n=!1){const o=n||e.header?"th":"td",r=ot(e.align);return`<${o}${r?` style="text-align:${at(r)}"`:""}>${Qe(nt(e.children),t)}</${o}>`}function Ge(e,t){return`<dt>${Qe(nt(e.term),t)}</dt><dd>${Qe(nt(e.definition),t)}</dd>`}function Ze(e,t){return e?t.markdown.render(e):""}function Je(e,t){return t?et("function"==typeof t?t(e):t):""}function et(e){return Array.isArray(e)?e.map(e=>et(e)).filter(Boolean).join(" "):"string"==typeof e?e.trim():""}function tt(e,t=""){const n=function(e){if(!e)return[];if(Array.isArray(e)){if(0===e.length)return[];const t=e[0];return Array.isArray(t)?e.map(([e,t])=>[String(e),t]):e.map(e=>[String(e.name),e.value])}return Object.entries(e).map(([e,t])=>[e,t])}(e),o=[],r=[t];for(const[i,a]of n){const e=String(i).trim(),t=e.toLowerCase();e&&rt(e)&&(c.DANGEROUS_HTML_ATTRS.has(t)||!0!==a&&c.URL_HTML_ATTRS.has(t)&&a&&c.isUnsafeHtmlUrl(String(a),{attrName:t})||("class"!==t?!0===a?o.push(` ${e}`):o.push(` ${e}="${at(String(a))}"`):r.push(String(a))))}const l=r.map(e=>e.trim()).filter(Boolean).join(" ");return l&&o.unshift(` class="${at(l)}"`),o.join("")}function nt(e){return Array.isArray(e)?e.filter(e=>!!e&&"object"==typeof e):[]}function ot(e){return"string"==typeof e?e:null==e?"":String(e)}function rt(e){return/^[^\s"'<>`=]+$/.test(e)&&!/^on/i.test(e)}function lt(e){return e.trim().toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"")}function it(e){return ot(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function at(e){return it(e).replace(/`/g,"`")}const st=new Map;function ut(e,t={}){if(Array.isArray(e.nodes))return e.nodes.slice();const n=e.node;if(n){const e=(o=n.children,Array.isArray(o)?o:[]);if(e.length>0)return e.slice()}var o;const r=function(e){var t;return"string"==typeof e.content?e.content:"string"==typeof(null==(t=e.node)?void 0:t.content)?e.node.content:""}(e);if(!r)return[];const l=function(e,t){var n,o;const r=null!=(n=t.parseOptions)?n:{},l=null!=(o=t.final)?o:(a=e.node)&&"object"==typeof a&&"boolean"==typeof a.loading?!a.loading:void 0,i=c.mergeCustomHtmlTags(t.customHtmlTags,r.customHtmlTags);var a;return null==l&&0===i.length?r:s(s(s({},r),null==l?{}:{final:l}),0===i.length?{}:{customHtmlTags:i})}(e,t),i=function(e){var t;const n=c.mergeCustomHtmlTags(e.customHtmlTags,null==(t=e.parseOptions)?void 0:t.customHtmlTags),o=`${e.cacheKey||"markstream-vue2-nested-nodes"}::${n.join(",")}`;let r=st.get(o);return r||(r=c.getMarkdown(o,{customHtmlTags:n}),st.set(o,r)),e.customMarkdownIt?e.customMarkdownIt(r):r}(t);return c.parseMarkdownToStructure(r,i,l)}const dt=M(m.defineComponent({__name:"PreCodeNode",props:{node:null,showLineNumbers:{type:Boolean},diffInline:{type:Boolean}},setup(e){const t=e,n=m.computed(()=>{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:"").split(":")[0].toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),o=m.computed(()=>`language-${n.value}`),r=m.computed(()=>{var e;return!0===t.showLineNumbers&&!0===(null==(e=t.node)?void 0:e.diff)}),l=m.computed(()=>r.value&&!0===t.diffInline),i=m.computed(()=>{var e,n,o,r,l,i;if(!0===(null==(e=t.node)?void 0:e.diff))return String(null!=(o=null==(n=t.node)?void 0:n.code)?o:"");const a=String(null!=(l=null==(r=t.node)?void 0:r.code)?l:"");return!0===(null==(i=t.node)?void 0:i.loading)?a:a.replace(/\r\n$|\n$|\r$/,"")});let a="",s=1;function u(e){let t=0,n=1;e.startsWith(a)&&(t=a.length,n=s,t>0&&"\r"===e[t-1]&&"\n"===e[t]&&t++);for(let o=t;o<e.length;o++)"\n"===e[o]?n++:"\r"===e[o]&&(n++,"\n"===e[o+1]&&o++);return a=e,s=n,n}const d=m.computed(()=>u(i.value));let c=0,p="";const f=m.computed(()=>{const e=d.value;e<c&&(c=0,p="");for(let t=c+1;t<=e;t++)p+=`${p?"\n":""}${t}`;return c=e,p}),v=m.computed(()=>{if(!0!==t.showLineNumbers||r.value)return;const e=d.value;return{"--markstream-pre-line-number-width":`${Math.max(2,String(e).length)}ch`,"--markstream-code-padding-left":"calc(var(--markstream-pre-line-number-padding-left, 2ch) + var(--markstream-pre-line-number-width, 2ch) + var(--markstream-pre-line-number-padding-right, 1ch) + var(--markstream-pre-line-number-separator-width, 2px) + var(--markstream-pre-line-number-gap-to-code, 1ch))"}}),h=m.computed(()=>{const e=n.value;return e?`Code block: ${e}`:"Code block"});function g(e){return String(null!=e?e:"").split(/\r\n|\n|\r/)}function y(e){const t=String(null!=e?e:"");return t?t.split(/\r\n|\n|\r/):[]}function w(e){return e.startsWith("-")&&!e.startsWith("---")}function x(e){return e.startsWith("+")&&!e.startsWith("+++")}function k(){var e,o,r,l;if("diff"===n.value)return!0;const i=null!=(l=null==(r=String(null!=(o=null==(e=t.node)?void 0:e.raw)?o:"").split(/\r?\n/,1)[0])?void 0:r.trim())?l:"";return/^`{3,}\s*diff(?:\s|$)|^~{3,}\s*diff(?:\s|$)/.test(i)}function M(e){const t=e.some(e=>w(e)),n=e.some(e=>x(e));return t&&n||k()&&(t||n)}function b(){var e,n;return null!=(null==(e=t.node)?void 0:e.originalCode)||null!=(null==(n=t.node)?void 0:n.updatedCode)}function C(e,t){return!T(e[t])||t<e.length-1}function T(e){return 0===String(null!=e?e:"").trim().length}function N(e,t,n,o,r={}){const l=0===String(null!=e?e:"").trim().length;return{code:e,empty:l,kind:l&&"hunk"!==t&&!r.preserveBlankKind?"context":t,key:n,number:o}}function _(e,t){const n=e.length,o=t.length;if((n+1)*(o+1)>15e5)return null;const r=o+1,l=new Uint16Array((n+1)*(o+1));for(let u=n-1;u>=0;u--)for(let n=o-1;n>=0;n--){const o=u*r+n;e[u]===t[n]?l[o]=l[(u+1)*r+n+1]+1:l[o]=Math.max(l[(u+1)*r+n],l[u*r+n+1])}const i=[];let a=0,s=0;for(;a<n&&s<o;)e[a]===t[s]?(i.push({originalIndex:a,modifiedIndex:s}),a++,s++):l[(a+1)*r+s]>=l[a*r+s+1]?a++:s++;return i}function D(e){let t=1;return e.map((e,n)=>e.startsWith("@@")?N(e,"hunk",`inline-hunk-${n}`,""):w(e)?N(e.slice(1),"removed",`inline-removed-${n}`,"",{preserveBlankKind:!0}):x(e)?N(e.slice(1),"added",`inline-added-${n}`,t++,{preserveBlankKind:!0}):N(e.startsWith(" ")?e.slice(1):e,"context",`inline-context-${n}`,t++))}function I(e,t){const n=y(e),o=y(t),r=_(n,o);if(r){const e=[];let t=0,l=0;for(const i of r){for(;t<i.originalIndex;)e.push(N(n[t],"removed",`inline-removed-source-${t}`,"",{preserveBlankKind:C(n,t)})),t++;for(;l<i.modifiedIndex;)e.push(N(o[l],"added",`inline-added-source-${l}`,l+1,{preserveBlankKind:C(o,l)})),l++;e.push(N(o[i.modifiedIndex],"context",`inline-context-source-${i.originalIndex}-${i.modifiedIndex}`,i.modifiedIndex+1)),t=i.originalIndex+1,l=i.modifiedIndex+1}for(;t<n.length;)e.push(N(n[t],"removed",`inline-removed-source-${t}`,"",{preserveBlankKind:C(n,t)})),t++;for(;l<o.length;)e.push(N(o[l],"added",`inline-added-source-${l}`,l+1,{preserveBlankKind:C(o,l)})),l++;return e}const l=[];let i=0,a=n.length-1,s=o.length-1;for(;i<=a&&i<=s&&n[i]===o[i];)l.push(N(o[i],"context",`inline-prefix-${i}`,i+1)),i++;const u=[];for(;a>=i&&s>=i&&n[a]===o[s];)u.unshift(N(o[s],"context",`inline-suffix-${s}`,s+1)),a--,s--;for(let d=i;d<=a;d++)l.push(N(n[d],"removed",`inline-removed-source-${d}`,"",{preserveBlankKind:C(n,d)}));for(let d=i;d<=s;d++)l.push(N(o[d],"added",`inline-added-source-${d}`,d+1,{preserveBlankKind:C(o,d)}));return l.concat(u)}function S(e=!1){var n,o,r,l,i;const a=g(null==(n=t.node)?void 0:n.code);if(!M(a)&&b()){if(e)return[{key:"inline",className:"markstream-pre__diff-pane--inline",lines:I(null==(o=t.node)?void 0:o.originalCode,null==(r=t.node)?void 0:r.updatedCode)}];const n=y(null==(l=t.node)?void 0:l.originalCode),a=y(null==(i=t.node)?void 0:i.updatedCode);return[{key:"original",className:"markstream-pre__diff-pane--original",lines:n.map((e,t)=>N(e,a[t]===e?"context":"removed",`original-${t}`,t+1,{preserveBlankKind:C(n,t)}))},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:a.map((e,t)=>N(e,n[t]===e?"context":"added",`modified-${t}`,t+1,{preserveBlankKind:C(a,t)}))}]}if(e)return[{key:"inline",className:"markstream-pre__diff-pane--inline",lines:D(a)}];const s=[],u=[];let d=1,c=1;for(const[t,m]of a.entries())if(m.startsWith("@@"))s.push(N(m,"hunk",`original-hunk-${t}`,"")),u.push(N(m,"hunk",`modified-hunk-${t}`,""));else if(w(m))s.push(N(m.slice(1),"removed",`original-removed-${t}`,d++,{preserveBlankKind:!0}));else if(x(m))u.push(N(m.slice(1),"added",`modified-added-${t}`,c++,{preserveBlankKind:!0}));else{const e=m.startsWith(" ")?m.slice(1):m;s.push(N(e,"context",`original-context-${t}`,d++)),u.push(N(e,"context",`modified-context-${t}`,c++))}return[{key:"original",className:"markstream-pre__diff-pane--original",lines:s},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:u}]}const j=m.computed(()=>r.value?S(l.value):[]);return{__sfc:!0,props:t,normalizedLanguage:n,languageClass:o,isDiffPreview:r,isInlineDiffPreview:l,displayCode:i,countedCode:a,countedLines:s,countCodeLines:u,codeLineCount:d,lineNumbersTextCount:c,lineNumbersTextCache:p,lineNumbersText:f,lineNumberLayoutStyle:v,ariaLabel:h,splitLines:g,splitDiffSource:y,isRemovedDiffLine:w,isAddedDiffLine:x,isExplicitDiffLanguage:k,hasPatchLines:M,hasDiffSourcePair:b,shouldPreserveSourceBlankDiffKind:C,isBlankDiffLine:T,toDiffLine:N,computeSourceLineMatches:_,buildInlinePatchPreviewLines:D,buildInlineSourcePreviewLines:I,buildDiffPanes:S,diffPreviewPanes:j}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("pre",{class:[n.languageClass,{"markstream-pre--line-numbers":n.props.showLineNumbers,"markstream-pre--diff-preview":n.isDiffPreview,"markstream-pre--diff-inline":n.isInlineDiffPreview}],style:n.lineNumberLayoutStyle,attrs:{"aria-busy":!0===e.node.loading,"aria-label":n.ariaLabel,"data-language":n.normalizedLanguage,"data-markstream-line-numbers":n.props.showLineNumbers?"1":void 0,"data-markstream-pre":"1",tabindex:"0"}},[n.isDiffPreview?t("code",{staticClass:"markstream-pre__diff-code",attrs:{translate:"no"}},e._l(n.diffPreviewPanes,function(n){return t("span",{key:n.key,staticClass:"markstream-pre__diff-pane",class:n.className},e._l(n.lines,function(n){return t("span",{key:n.key,staticClass:"markstream-pre__diff-line",class:[`markstream-pre__diff-line--${n.kind}`,{"markstream-pre__diff-line--empty":n.empty}]},[t("span",{staticClass:"markstream-pre__diff-rail",attrs:{"aria-hidden":"true"}}),t("span",{staticClass:"markstream-pre__diff-number",attrs:{"aria-hidden":"true"}},[e._v(e._s(n.number))]),t("span",{staticClass:"markstream-pre__diff-content"},[t("span",{staticClass:"markstream-pre__diff-content-inner"},[e._v(e._s(n.code))])])])}),0)}),0):[n.props.showLineNumbers?t("span",{staticClass:"markstream-pre__line-numbers",attrs:{"aria-hidden":"true"}},[t("span",{staticClass:"markstream-pre__line-numbers-text",domProps:{textContent:e._s(n.lineNumbersText)}})]):e._e(),t("code",{staticClass:"markstream-pre__code",attrs:{translate:"no"},domProps:{textContent:e._s(n.displayCode)}})]],2)},[],!1,null,null,null,null).exports;function ct(e){return t=>{var n,o;return m.h(be,u(s({},t),{node:u(s({},t.node),{content:null!=(o=t.node.raw)?o:e(String(null!=(n=t.node.content)?n:""))})}))}}function mt(){return d(this,null,function*(){var e,t,n;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 ct(e=>`$${e}$`);try{if(yield xe()){const e=yield Promise.resolve().then(()=>require("./chunks/index-11432088.cjs"));return null!=(n=e.default)?n:e}}catch(o){console.warn('[markstream-vue2] Optional peer dependencies for MathInlineNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',o)}return ct(e=>`$${e}$`)})}function pt(){return d(this,null,function*(){var e;try{if(yield xe()){const t=yield Promise.resolve().then(()=>require("./chunks/index-fb457079.cjs"));return null!=(e=t.default)?e:t}}catch(t){console.warn('[markstream-vue2] Optional peer dependencies for MathBlockNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',t)}return ct(e=>`$$${e}$$`)})}const ft=M(m.defineComponent({__name:"ReferenceNode",props:{node:null,messageId:null,threadId:null},emits:["click","mouseEnter","mouseLeave"],setup:e=>({__sfc:!0})}),function(){var e=this,t=e._self._c;return e._self._setupProxy,t("span",{staticClass:"reference-node cursor-pointer bg-[hsl(var(--muted))] text-xs rounded-md px-1.5 mx-0.5 hover:bg-[hsl(var(--secondary))]",attrs:{role:"button",tabindex:"0"},on:{click:function(t){return e.$emit("click",t,e.node.id,e.messageId,e.threadId)},mouseenter:function(t){return e.$emit("mouseEnter",t,e.node.id,e.messageId,e.threadId)},mouseleave:function(t){return e.$emit("mouseLeave",t,e.node.id,e.messageId,e.threadId)}}},[e._v(" "+e._s(e.node.id)+" ")])},[],!1,null,null,null,null).exports,vt=M(m.defineComponent({__name:"SuperscriptNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=S(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:s({text:be,inline_code:K,link:wt,html_inline:Y,strong:gt,emphasis:Mt,footnote_reference:L,strikethrough:yt,highlight:kt,insert:xt,subscript:ht,emoji:T,math_inline:mt,reference:ft},n)}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("sup",{staticClass:"superscript-node"},e._l(e.node.children,function(o,r){return t("span",{key:`${e.indexKey||"superscript"}-${r}`,staticClass:"superscript-child"},[n.nodeComponents[o.type]?t(n.nodeComponents[o.type],{tag:"component",attrs:{node:o,"custom-id":n.props.customId,"index-key":`${e.indexKey||"superscript"}-${r}`}}):t("span",[e._v(e._s(o.content||o.raw||""))])],1)}),0)},[],!1,null,"ef2512b4",null,null).exports,ht=M(m.defineComponent({__name:"SubscriptNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=S(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:s({text:be,inline_code:K,link:wt,html_inline:Y,strong:gt,emphasis:Mt,footnote_reference:L,strikethrough:yt,highlight:kt,insert:xt,superscript:vt,emoji:T,math_inline:mt,reference:ft},n)}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("sub",{staticClass:"subscript-node"},e._l(e.node.children,function(o,r){return t("span",{key:`${e.indexKey||"subscript"}-${r}`,staticClass:"subscript-child"},[n.nodeComponents[o.type]?t(n.nodeComponents[o.type],{tag:"component",attrs:{node:o,"custom-id":n.props.customId,"index-key":`${e.indexKey||"subscript"}-${r}`}}):t("span",[e._v(e._s(o.content||o.raw||""))])],1)}),0)},[],!1,null,"3d49d031",null,null).exports,gt=M(m.defineComponent({__name:"StrongNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=S(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:s({text:be,inline_code:K,link:wt,html_inline:Y,emphasis:Mt,strikethrough:yt,highlight:kt,insert:xt,subscript:ht,superscript:vt,emoji:T,footnote_reference:L,math_inline:mt,reference:ft},n)}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("strong",{staticClass:"strong-node"},e._l(e.node.children,function(o,r){return t(n.nodeComponents[o.type],{key:`${e.indexKey||"strong"}-${r}`,tag:"component",attrs:{"index-key":`${e.indexKey||"strong"}-${r}`,node:o,"custom-id":n.props.customId}})}),1)},[],!1,null,"af3ce037",null,null).exports,yt=M(m.defineComponent({__name:"StrikethroughNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=S(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:s({text:be,inline_code:K,link:wt,html_inline:Y,strong:gt,emphasis:Mt,highlight:kt,insert:xt,subscript:ht,superscript:vt,emoji:T,footnote_reference:L,math_inline:mt,reference:ft},n)}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("del",{staticClass:"strikethrough-node"},e._l(e.node.children,function(o,r){return t(n.nodeComponents[o.type],{key:`${e.indexKey||"strikethrough"}-${r}`,tag:"component",attrs:{node:o,"custom-id":n.props.customId,"index-key":`${e.indexKey||"strikethrough"}-${r}`}})}),1)},[],!1,null,"904d5bd1",null,null).exports,wt=M(m.defineComponent({__name:"LinkNode",props:{node:null,indexKey:null,customId:null,showTooltip:{type:Boolean,default:!0},color:null,underlineHeight:null,underlineBottom:null,animationDuration:null,animationOpacity:null,animationTiming:null,animationIteration:null},setup(e){const t=e,n={x:0,y:0,hasValue:!1};let o=0,r=null;function l(){if(r||"undefined"==typeof window)return;const e=e=>{"number"==typeof e.clientX&&"number"==typeof e.clientY&&(n.x=e.clientX,n.y=e.clientY,n.hasValue=!0)};window.addEventListener("pointermove",e,!0),window.addEventListener("mousemove",e,!0),r=()=>{window.removeEventListener("pointermove",e,!0),window.removeEventListener("mousemove",e,!0)}}function i(){l(),o+=1}function a(){o=Math.max(0,o-1),!o&&r&&(r(),r=null)}const u=m.computed(()=>{var e,n,o,r,l,i;const a=void 0!==t.underlineBottom?"number"==typeof t.underlineBottom?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px",s=null!=(e=t.animationOpacity)?e:.35,u=Math.max(.12,Math.min(.5*s,s));return{"--link-color":null!=(n=t.color)?n:"#0366d6","--underline-height":`${null!=(o=t.underlineHeight)?o:2}px`,"--underline-bottom":a,"--underline-opacity":String(s),"--underline-rest-opacity":String(u),"--underline-duration":`${null!=(r=t.animationDuration)?r:1.6}s`,"--underline-timing":null!=(l=t.animationTiming)?l:"ease-in-out","--underline-iteration":"number"==typeof t.animationIteration?String(t.animationIteration):null!=(i=t.animationIteration)?i:"infinite"}}),d={text:be,strong:gt,strikethrough:yt,emphasis:Mt,image:ce,html_inline:Y},p=m.useAttrs(),f=m.computed(()=>{var e,n;const o=null==(e=t.node)?void 0:e.attrs;if(!o||"object"!=typeof o)return{};const r={};if(Array.isArray(o))for(const t of o)Array.isArray(t)&&t[0]&&(r[String(t[0])]=String(null!=(n=t[1])?n:""));else for(const[t,l]of Object.entries(o))t&&null!=l&&!1!==l&&(r[t]=!0===l?"":String(l));return P(r)}),v=m.ref(null),h=m.ref(!1),g=m.computed(()=>{const e=s(s({},p),f.value);return delete e.title,delete e.href,delete e.target,delete e.rel,e}),y=m.computed(()=>{var e,n;return P({href:String(null!=(n=null==(e=t.node)?void 0:e.href)?n:"")}).href}),w=m.computed(()=>c.shouldOpenLinkInNewTab(y.value));function x(){var e,n;return(null==(e=t.node)?void 0:e.title)||y.value||(null==(n=t.node)?void 0:n.text)||""}function k(e){if(!e||!n.hasValue)return!1;const t=e.getBoundingClientRect();return n.x>=t.left&&n.x<=t.right&&n.y>=t.top&&n.y<=t.bottom}function M(){t.showTooltip&&v.value&&k(v.value)&&(h.value=!0,ie(v.value,x(),"top",!0,{x:n.x,y:n.y}))}const b=m.computed(()=>{var e,n;const o=null==(e=t.node)?void 0:e.title;return"string"==typeof o&&o.trim().length>0?o:String(null!=(n=y.value)?n:"")});return m.onMounted(()=>{i(),t.showTooltip&&le(),m.nextTick(()=>{M()})}),m.onUpdated(()=>{M()}),m.onBeforeUnmount(()=>{a(),h.value&&(h.value=!1,ae(!0))}),{__sfc:!0,props:t,lastPointerPosition:n,pointerTrackerRefCount:o,pointerTrackerCleanup:r,ensurePointerTracker:l,retainPointerTracker:i,releasePointerTracker:a,cssVars:u,nodeComponents:d,attrs:p,nodeAttrs:f,anchorEl:v,isHovering:h,anchorAttrs:g,safeHref:y,openInNewTab:w,getTooltipText:x,isPointerInsideAnchor:k,syncTooltipForHoveredAnchor:M,onAnchorEnter:function(e){if(!t.showTooltip)return;h.value=!0;const 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;ie(v.value||e.currentTarget,x(),"top",!0,o)},onAnchorLeave:function(){t.showTooltip&&(h.value=!1,ae())},title:b,TextNode:be}}}),function(){var e,t,n=this,o=n._self._c,r=n._self._setupProxy;return n.node.loading?o("span",n._b({staticClass:"link-loading inline-flex items-baseline gap-1.5",style:r.cssVars,attrs:{"aria-hidden":n.node.loading?"false":"true"}},"span",r.attrs,!1),[o("span",{staticClass:"link-text-wrapper relative inline-flex"},[o("span",{staticClass:"leading-[normal] link-text"},[o(r.TextNode,{staticClass:"leading-[normal] link-text",attrs:{node:{type:"text",content:String(null!=(e=n.node.text)?e:""),raw:String(null!=(t=n.node.text)?t:"")},"index-key":`${n.indexKey||"link-text"}-loading`}})],1),o("span",{staticClass:"link-loading-indicator",attrs:{"aria-hidden":"true"}})])]):o("a",n._b({ref:"anchorEl",staticClass:"link-node",style:r.cssVars,attrs:{href:r.safeHref,title:n.showTooltip?"":r.title,"aria-label":`Link: ${r.title}`,"aria-hidden":n.node.loading?"true":"false",target:r.openInNewTab?"_blank":void 0,rel:r.openInNewTab?"noopener noreferrer":void 0},on:{mouseenter:e=>r.onAnchorEnter(e),mouseleave:r.onAnchorLeave}},"a",r.anchorAttrs,!1),n._l(n.node.children,function(e,t){return o(r.nodeComponents[e.type],{key:`${n.indexKey||"emphasis"}-${t}`,tag:"component",attrs:{node:e,"custom-id":r.props.customId,"index-key":`${n.indexKey||"link-text"}-${t}`}})}),1)},[],!1,null,"df7a5c00",null,null).exports,xt=M(m.defineComponent({__name:"InsertNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=S(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:s({text:be,inline_code:K,link:wt,html_inline:Y,strong:gt,emphasis:Mt,strikethrough:yt,highlight:kt,subscript:ht,superscript:vt,emoji:T,footnote_reference:L,math_inline:mt,reference:ft},n)}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("ins",{staticClass:"insert-node"},e._l(e.node.children,function(o,r){return t(n.nodeComponents[o.type],{key:`${e.indexKey||"insert"}-${r}`,tag:"component",attrs:{node:o,"custom-id":n.props.customId,"index-key":`${e.indexKey||"insert"}-${r}`}})}),1)},[],!1,null,"ab1ec9bc",null,null).exports,kt=M(m.defineComponent({__name:"HighlightNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=S(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:s({text:be,inline_code:K,link:wt,html_inline:Y,strong:gt,emphasis:Mt,strikethrough:yt,insert:xt,subscript:ht,superscript:vt,emoji:T,footnote_reference:L,math_inline:mt,reference:ft},n)}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("mark",{staticClass:"highlight-node"},e._l(e.node.children,function(o,r){return t(n.nodeComponents[o.type],{key:`${e.indexKey||"highlight"}-${r}`,tag:"component",attrs:{node:o,"custom-id":n.props.customId,"index-key":`${e.indexKey||"highlight"}-${r}`}})}),1)},[],!1,null,"38e31bf6",null,null).exports,Mt=M(m.defineComponent({__name:"EmphasisNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=S(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:s({text:be,inline_code:K,link:wt,html_inline:Y,strong:gt,strikethrough:yt,highlight:kt,insert:xt,subscript:ht,superscript:vt,emoji:T,footnote_reference:L,math_inline:mt,reference:ft},n)}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("em",{staticClass:"emphasis-node"},e._l(e.node.children,function(o,r){return t(n.nodeComponents[o.type],{key:`${e.indexKey||"emphasis"}-${r}`,tag:"component",attrs:{node:o,"custom-id":n.props.customId,"index-key":`${e.indexKey||"emphasis"}-${r}`}})}),1)},[],!1,null,"8264674d",null,null).exports,bt=M(m.defineComponent({__name:"FootnoteAnchorNode",props:{node:null},setup(e){const t=e;return{__sfc:!0,props:t,scrollToReference:function(e){var n;if(e.preventDefault(),"undefined"==typeof document)return;const o=E(e.currentTarget,`fnref-${String(null!=(n=t.node.id)?n:"")}`);o&&o.scrollIntoView({behavior:"smooth"})}}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("a",{staticClass:"footnote-anchor text-sm hover:underline cursor-pointer",attrs:{href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`},on:{click:n.scrollToReference}},[e._v(" ↩︎ ")])},[],!1,null,"88cb7458",null,null).exports,Ct=M(m.defineComponent({__name:"FootnoteNode",props:{node:null,indexKey:null,typewriter:{type:Boolean},customId:null},emits:["copy"],setup(e){const t=e,n=m.getCurrentInstance(),o=m.computed(()=>w(null==n?void 0:n.proxy)?Ht:en);return{__sfc:!0,props:t,instance:n,nestedRenderer:o}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("div",{staticClass:"footnote-node flex text-sm leading-relaxed border-t border-[var(--footnote-border,#eaecef)] pt-2",attrs:{id:`fnref--${e.node.id}`}},[t("div",{staticClass:"flex-1"},[t(n.nestedRenderer,{tag:"component",attrs:{"index-key":`footnote-${n.props.indexKey}`,nodes:n.props.node.children,"custom-id":n.props.customId,typewriter:n.props.typewriter},on:{copy:function(t){return e.$emit("copy",t)}}})],1)])},[],!1,null,null,null,null).exports,Tt=M(m.defineComponent({__name:"HardBreakNode",props:{node:null},setup:e=>({__sfc:!0})}),function(){var e=this._self._c;return this._self._setupProxy,e("br",{staticClass:"hard-break"})},[],!1,null,"50c58f70",null,null).exports,Nt=M(m.defineComponent({__name:"HeadingNode",props:{node:null,customId:null,indexKey:null},setup(e){const t=e,n=S(t.customId);return{__sfc:!0,props:t,overrides:n,nodeComponents:s({text:be,inline_code:K,link:wt,image:ce,strong:gt,emphasis:Mt,strikethrough:yt,highlight:kt,insert:xt,subscript:ht,superscript:vt,emoji:T,checkbox:b,checkbox_input:b,footnote_reference:L,hardbreak:Tt,math_inline:mt,reference:ft},n)}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t(`h${e.node.level}`,e._b({tag:"component",staticClass:"heading-node",class:[`heading-${e.node.level}`],attrs:{dir:"auto"}},"component",e.node.attrs,!1),e._l(e.node.children,function(o,r){return t(n.nodeComponents[o.type],{key:`${e.indexKey||"heading"}-${r}`,tag:"component",attrs:{"custom-id":n.props.customId,node:o,"index-key":`${e.indexKey||"heading"}-${r}`}})}),1)},[],!1,null,"ffb7cf51",null,null).exports,_t=M(m.defineComponent({__name:"ListItemNode",props:{node:null,item:null,indexKey:null,value:null,customId:null,typewriter:{type:Boolean},showTooltips:{type:Boolean}},setup(e){const t=e,n=m.computed(()=>{var e;return null!=(e=t.node)?e:t.item}),o=m.computed(()=>null==t.value?{}:{value:t.value}),r=m.getCurrentInstance(),l=m.computed(()=>w(null==r?void 0:r.proxy)?Ht:en);return{__sfc:!0,props:t,itemNode:n,liValueAttr:o,instance:r,nestedRenderer:l}}}),function(){var e,t,n=this,o=n._self._c,r=n._self._setupProxy;return o("li",n._b({staticClass:"list-item pl-1.5 my-2",attrs:{dir:"auto"}},"li",r.liValueAttr,!1),[o(r.nestedRenderer,n._b({tag:"component",attrs:{"index-key":`list-item-${r.props.indexKey}`,nodes:null!=(t=null==(e=r.itemNode)?void 0:e.children)?t:[],"custom-id":r.props.customId,typewriter:r.props.typewriter,"batch-rendering":!1},on:{copy:function(e){return n.$emit("copy",e)}}},"component",{showTooltips:r.props.showTooltips},!1))],1)},[],!1,null,"5c58ad56",null,null).exports,Dt=M(m.defineComponent({__name:"ListNode",props:{node:null,customId:null,indexKey:null,typewriter:{type:Boolean},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const{node:t,customId:n,indexKey:o,typewriter:r,showTooltips:l}=e;return{__sfc:!0,listItemComponent:m.computed(()=>(I.value,S(n).list_item||_t))}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t(e.node.ordered?"ol":"ul",{tag:"component",staticClass:"list-node",class:{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}},e._l(e.node.items,function(o,r){var l;return t(n.listItemComponent,e._b({key:`${e.indexKey||"list"}-${r}`,tag:"component",attrs:{node:o,"custom-id":e.customId,"index-key":`${e.indexKey||"list"}-${r}`,typewriter:e.typewriter,value:e.node.ordered?(null!=(l=e.node.start)?l:1)+r:void 0},on:{copy:function(t){return e.$emit("copy",t)}}},"component",{showTooltips:e.showTooltips},!1))}),1)},[],!1,null,"91e6dafc",null,null).exports,It=Symbol("ViewportPriority");function St(e,t){var n,o;const r="undefined"!=typeof window&&"undefined"!=typeof document,l="boolean"==typeof t?m.ref(t):t,i=r?null!=(n=window.requestIdleCallback)?n:e=>window.setTimeout(()=>e({didTimeout:!0,timeRemaining:()=>0}),16):null,a=r?null!=(o=window.cancelIdleCallback)?o:e=>window.clearTimeout(e):null;let s=null,u=null;const d=new Map,c=new Set;let p=null;function f(){if(!d.size){try{null==s||s.disconnect()}catch(e){}s=null,u=null,c.size||function(){if(null!=p){try{null==a||a(p)}catch(e){}p=null}}()}}function v(e){const t=d.get(e);if(t){if(!t.visible.value){t.visible.value=!0;try{t.resolve()}catch(n){}}try{null==s||s.unobserve(e)}catch(n){}d.delete(e),c.delete(e),f()}}function h(){i&&null==p&&c.size&&(p=i(()=>{p=null;const e=c.values().next().value;e&&(c.delete(e),v(e),c.size&&h())},{timeout:1200}))}const g=(t,n)=>{const o=m.ref(!1);let i,a=!1;const p=new Promise(e=>{i=()=>{a||(a=!0,e())}}),g=()=>{try{null==s||s.unobserve(t)}catch(e){}d.delete(t),c.delete(t),f()};if(!r||!l.value)return o.value=!0,i(),{isVisible:o,whenVisible:p,destroy:g};const y=function(t,n){if(!r)return s;if("undefined"==typeof IntersectionObserver)return null;const o=function(t,n){var o,r,l;return{root:null!=(o=null==e?void 0:e(null!=t?t:null))?o:null,rootMargin:null!=(r=null==n?void 0:n.rootMargin)?r:"300px",threshold:null!=(l=null==n?void 0:n.threshold)?l:0}}(t,n);if(s&&(i=o,(l=u)&&l.root===i.root&&l.rootMargin===i.rootMargin&&l.threshold===i.threshold))return s;var l,i;if(s)try{s.disconnect()}catch(a){}s=new IntersectionObserver(e=>{for(const t of e)(t.isIntersecting||t.intersectionRatio>0)&&v(t.target)},{root:o.root,rootMargin:o.rootMargin,threshold:o.threshold}),u=o;for(const e of d.keys())s.observe(e);return s}(t,n);return y?(d.set(t,{resolve:i,visible:o}),y.observe(t),c.add(t),h(),{isVisible:o,whenVisible:p,destroy:g}):(o.value=!0,i(),{isVisible:o,whenVisible:p,destroy:g})};return m.provide(It,g),g}function jt(){var e,t;const n=m.inject(It,void 0);if(n)return n;const o=new WeakMap;let r=null;const l=new Set;let i=null;const a="undefined"!=typeof window?null!=(e=window.requestIdleCallback)?e:e=>window.setTimeout(()=>e({didTimeout:!0,timeRemaining:()=>0}),16):null,s="undefined"!=typeof window?null!=(t=window.cancelIdleCallback)?t:e=>window.clearTimeout(e):null,u=()=>{if(null!=i){try{null==s||s(i)}catch(e){}i=null}},d=e=>{const t=o.get(e);if(t){if(!t.visible.value){t.visible.value=!0;try{t.resolve()}catch(n){}}try{null==r||r.unobserve(e)}catch(n){}o.delete(e),l.delete(e),l.size||u()}},c=()=>{a&&null==i&&l.size&&(i=a(()=>{i=null;const e=l.values().next().value;e&&(l.delete(e),d(e),l.size&&c())},{timeout:1200}))};return e=>{const t=m.ref(!1);let n,i=!1;const a=new Promise(e=>{n=()=>{i||(i=!0,e())}}),s=()=>{try{null==r||r.unobserve(e)}catch(t){}o.delete(e),l.delete(e),l.size||u()},p=r||("undefined"==typeof window||"undefined"==typeof IntersectionObserver?null:(r=new IntersectionObserver(e=>{for(const t of e)(t.isIntersecting||t.intersectionRatio>0)&&d(t.target)},{root:null,rootMargin:"300px",threshold:0}),r));return p?(o.set(e,{resolve:n,visible:t}),p.observe(e),l.add(e),c(),{isVisible:t,whenVisible:a,destroy:s}):(t.value=!0,n(),{isVisible:t,whenVisible:a,destroy:s})}}const Et=M(m.defineComponent({__name:"HtmlBlockNode",props:{node:null,customId:null,htmlPolicy:null},setup(e){const t=e,n=m.inject("markstreamHtmlPolicy",void 0),o=m.computed(()=>{var e,o;return null!=(o=null!=(e=t.htmlPolicy)?e:null==n?void 0:n.value)?o:"safe"}),r=m.computed(()=>{const e=c.sanitizeHtmlTokenAttrs(t.node.attrs,o.value);if(!e)return;const n=c.tokenAttrsToRecord(e);return Object.keys(n).length>0?n:void 0}),l=m.computed(()=>{const e=String(t.node.tag||"").trim(),n=c.sanitizeHtmlTokenAttrs(t.node.attrs,o.value,e);if(!n)return;const r=c.tokenAttrsToRecord(n);return Object.keys(r).length>0?r:void 0}),i=m.computed(()=>S(t.customId)),a=m.defineComponent({name:"DynamicRenderer",props:{content:{type:String,required:!0},customComponents:{type:Object,required:!0},htmlPolicy:{type:String,default:"safe"}},render(){return F(this.content,this.customComponents,void 0,this.htmlPolicy)||[]}}),s=m.computed(()=>Array.isArray(t.node.children)?t.node.children:[]),u=m.computed(()=>String(t.node.tag||"div")),d=m.computed(()=>{const e=u.value.trim().toLowerCase();return c.NON_STRUCTURING_HTML_TAGS.has(e)||c.isHtmlTagBlocked(e,o.value)}),p=m.computed(()=>0===s.value.length||!t.node.tag||d.value?"":Ke(s.value,{htmlPolicy:o.value})),f=m.computed(()=>{if(s.value.length>0&&t.node.tag&&!d.value)return{mode:"structured"};const e=t.node.content;return e?"escape"===o.value?{mode:"html",content:c.sanitizeHtmlContent(e,o.value)}:U(e,i.value)?{mode:"dynamic",content:e}:{mode:"html",content:c.sanitizeHtmlContent(e,o.value)}:{mode:"html",content:""}}),v=m.ref(null),h=m.ref("undefined"==typeof window),g=m.ref(t.node.content),y=jt();let w=null;const x=!!t.node.loading;return"undefined"!=typeof window?(m.watch(v,e=>{var n;if(null==(n=null==w?void 0:w.destroy)||n.call(w),w=null,!x)return h.value=!0,void(g.value=t.node.content);if(!e)return void(h.value=!1);const o=y(e,{rootMargin:"400px"});w=o,h.value=o.isVisible.value,o.whenVisible.then(()=>{h.value=!0})},{immediate:!0}),m.watch(()=>t.node.content,e=>{x&&!h.value||(g.value=e)})):h.value=!0,m.onBeforeUnmount(()=>{var e;null==(e=null==w?void 0:w.destroy)||e.call(w),w=null}),{__sfc:!0,props:t,inheritedHtmlPolicy:n,resolvedHtmlPolicy:o,boundAttrs:r,structuredBoundAttrs:l,customComponents:i,DynamicRenderer:a,structuredChildren:s,structuredTag:u,isBlockedStructuredTag:d,structuredHtml:p,renderMode:f,htmlRef:v,shouldRender:h,renderContent:g,registerVisibility:y,visibilityHandle:w,isDeferred:x}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return"structured"===n.renderMode.mode&&n.shouldRender?t(n.structuredTag,e._b({ref:"htmlRef",tag:"component",staticClass:"html-block-node",domProps:{innerHTML:e._s(n.structuredHtml)}},"component",n.structuredBoundAttrs,!1)):"structured"===n.renderMode.mode?t(n.structuredTag,e._b({ref:"htmlRef",tag:"component",staticClass:"html-block-node"},"component",n.structuredBoundAttrs,!1),[t("div",{staticClass:"html-block-node__placeholder"},[e._t("placeholder",function(){return[t("span",{staticClass:"html-block-node__placeholder-bar"}),t("span",{staticClass:"html-block-node__placeholder-bar w-4/5"}),t("span",{staticClass:"html-block-node__placeholder-bar w-2/3"})]},{node:e.node})],2)]):t("div",{ref:"htmlRef",staticClass:"html-block-node"},[n.shouldRender?["dynamic"===n.renderMode.mode?t(n.DynamicRenderer,{attrs:{content:n.renderMode.content,"custom-components":n.customComponents,"html-policy":n.resolvedHtmlPolicy}}):t("div",e._b({domProps:{innerHTML:e._s(n.renderMode.content)}},"div",n.boundAttrs,!1))]:t("div",{staticClass:"html-block-node__placeholder"},[e._t("placeholder",function(){return[t("span",{staticClass:"html-block-node__placeholder-bar"}),t("span",{staticClass:"html-block-node__placeholder-bar w-4/5"}),t("span",{staticClass:"html-block-node__placeholder-bar w-2/3"})]},{node:e.node})],2)],2)},[],!1,null,"25a9000d",null,null).exports,Lt=M(m.defineComponent({__name:"ParagraphNode",props:{node:null,customId:null,indexKey:null,customHtmlTags:null},setup(e){const t=e,n=S(t.customId);function o(e){var t;return"text"===e.type&&""===String(null!=(t=e.content)?t:"").trim()}function r(e){return"link"===e.type&&Array.isArray(e.children)?e.children.filter(e=>!o(e)):[]}function l(e){var t;const n=r(e);return 1===n.length&&"image"===(null==(t=n[0])?void 0:t.type)}const i=m.computed(()=>t.node.children.filter(e=>!o(e))),a=m.computed(()=>i.value.length>0&&i.value.every(e=>"image"===e.type||l(e))),d=m.computed(()=>new Set(c.normalizeCustomHtmlTags(t.customHtmlTags))),p=m.computed(()=>{if(!a.value||i.value.length<=1)return t.node.children;const e=[];for(let n=0;n<t.node.children.length;n++){const r=t.node.children[n];if(!o(r)){e.push(r);continue}const l=e.length>0,i=t.node.children.slice(n+1).some(e=>!o(e));l&&i&&e.push(u(s({},r),{content:" ",raw:" "}))}return e}),f=s({inline_code:K,image:ce,link:wt,hardbreak:Tt,emphasis:Mt,strong:gt,strikethrough:yt,highlight:kt,insert:xt,subscript:ht,superscript:vt,html_inline:Y,html_block:Et,emoji:T,checkbox:b,math_inline:mt,checkbox_input:b,reference:ft,footnote_anchor:bt,footnote_reference:L,text:be},n);return{__sfc:!0,props:t,overrides:n,isWhitespaceText:o,getTextContent:function(e){var t;return String(null!=(t=e.content)?t:"")},getMeaningfulLinkChildren:r,isImageOnlyLink:l,meaningfulChildren:i,isMediaOnlyParagraph:a,customHtmlTagsSet:d,renderedChildren:p,getChildProps:function(e,n){var o;return{node:e,"index-key":`${null!=(o=t.indexKey)?o:"paragraph"}-${n}`,"custom-id":t.customId,"custom-html-tags":t.customHtmlTags}},nodeComponents:f,processChild:function(e){var t,n,o,r;if("html_block"===e.type||"html_inline"===e.type){const l=String(null!=(t=e.tag)?t:"").trim().toLowerCase()||c.getHtmlTagFromContent(e.content);if(l&&!d.value.has(l)&&c.shouldRenderUnknownHtmlTagAsText(null!=(n=e.content)?n:e.raw,l)){const t=String(null!=(r=null!=(o=e.content)?o:e.raw)?r:"");return{child:{type:"text",content:t,raw:t},component:be}}}return{child:e,component:f[e.type]}}}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("p",{staticClass:"paragraph-node",attrs:{dir:"auto"}},[e._l(n.renderedChildren,function(o,r){return[n.isMediaOnlyParagraph&&n.isWhitespaceText(o)?[e._v(" "+e._s(n.getTextContent(o))+" ")]:t(n.processChild(o).component,e._b({key:`${e.indexKey||"paragraph"}-${r}`,tag:"component"},"component",n.getChildProps(n.processChild(o).child,r),!1))]})],2)},[],!1,null,"3275cbf4",null,null).exports,Bt=M(m.defineComponent({__name:"TableNode",props:{node:null,indexKey:null,isDark:{type:Boolean},typewriter:{type:Boolean},customId:null},emits:["copy"],setup(e){const t=e,n=m.computed(()=>{var e;return null!=(e=t.node.loading)&&e}),o=m.computed(()=>{var e;return null!=(e=t.node.rows)?e:[]}),r=m.ref(null),l=m.ref([]),i=m.getCurrentInstance(),a=m.computed(()=>w(null==i?void 0:i.proxy)?Ht:en);let s=null;const u=m.computed(()=>l.value.map(e=>e>0?{width:`${e}px`}:void 0)),d=m.computed(()=>l.value.length>0);function c(){var e;const t=null==(e=r.value)?void 0:e.querySelectorAll("thead th");return Array.from(null!=t?t:[],e=>Math.round(e.getBoundingClientRect().width))}function p(e){if(!s)return;e.preventDefault();const t=s.startWidth+s.nextStartWidth,n=Math.min(48,Math.floor(t/2)),o=Math.max(n,Math.min(t-n,Math.round(s.startWidth+e.clientX-s.startX))),r=[...s.widths];r[s.index]=o,r[s.index+1]=t-o,l.value=r}function f(){s&&(window.removeEventListener("pointermove",p),window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",f),s=null)}return m.watch(()=>t.node.header.cells.length,()=>{f(),l.value=[]}),m.onBeforeUnmount(f),{__sfc:!0,props:t,isLoading:n,bodyRows:o,tableRef:r,columnWidths:l,instance:i,nestedRenderer:a,MIN_COLUMN_WIDTH:48,resizeState:s,columnStyles:u,hasColumnWidths:d,measureHeaderWidths:c,onColumnResizeMove:p,stopColumnResize:f,startColumnResize:function(e,t){if(0!==t.button)return;const n=c(),o=n[e],r=n[e+1];o&&r&&(t.preventDefault(),s={index:e,startX:t.clientX,startWidth:o,nextStartWidth:r,widths:n},l.value=n,window.addEventListener("pointermove",p),window.addEventListener("pointerup",f),window.addEventListener("pointercancel",f))}}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("div",{staticClass:"table-node-wrapper"},[t("table",{ref:"tableRef",staticClass:"my-8 text-sm table-node",class:{"table-node--loading":n.isLoading},attrs:{"aria-busy":n.isLoading}},[n.hasColumnWidths?t("colgroup",e._l(e.node.header.cells,function(e,o){return t("col",{key:`col-${o}`,style:n.columnStyles[o]})}),0):e._e(),t("thead",{staticClass:"border-[var(--table-border,#cbd5e1)] border-solid"},[t("tr",{staticClass:"border-b border-solid"},e._l(e.node.header.cells,function(o,r){return t("th",{key:`header-${r}`,staticClass:"font-semibold p-[calc(4/7*1em)]",class:["right"===o.align?"text-right":"center"===o.align?"text-center":"text-left"],attrs:{dir:"auto"}},[t(n.nestedRenderer,{tag:"component",attrs:{nodes:o.children,"index-key":`table-th-${n.props.indexKey}`,"custom-id":n.props.customId,typewriter:n.props.typewriter},on:{copy:function(t){return e.$emit("copy",t)}}}),r<e.node.header.cells.length-1?t("button",{staticClass:"table-node__resize-handle",attrs:{type:"button","aria-label":`Resize columns ${r+1} and ${r+2}`},on:{pointerdown:function(e){return n.startColumnResize(r,e)}}}):e._e()],1)}),0)]),t("tbody",e._l(n.bodyRows,function(o,r){return t("tr",{key:`row-${r}`,staticClass:"border-[var(--table-border,#cbd5e1)] border-solid",class:[r<n.bodyRows.length-1?"border-b":""]},e._l(o.cells,function(o,l){return t("td",{key:`cell-${r}-${l}`,staticClass:"p-[calc(4/7*1em)]",class:["right"===o.align?"text-right":"center"===o.align?"text-center":"text-left"],attrs:{dir:"auto"}},[t(n.nestedRenderer,{tag:"component",attrs:{nodes:o.children,"index-key":`table-td-${n.props.indexKey}`,"custom-id":n.props.customId,typewriter:n.props.typewriter},on:{copy:function(t){return e.$emit("copy",t)}}})],1)}),0)}),0)]),t("transition",{attrs:{name:"table-node-fade"}},[n.isLoading?t("div",{staticClass:"table-node__loading",attrs:{role:"status","aria-live":"polite"}},[e._t("loading",function(){return[t("span",{staticClass:"table-node__spinner animate-spin",attrs:{"aria-hidden":"true"}}),t("span",{staticClass:"sr-only"},[e._v("Loading")])]},{isLoading:n.isLoading})],2):e._e()])],1)},[],!1,null,"e80ddef6",null,null).exports,At=M(m.defineComponent({__name:"ThematicBreakNode",setup:e=>({__sfc:!0})}),function(){var e=this._self._c;return this._self._setupProxy,e("hr",{staticClass:"hr-node"})},[],!1,null,"639cbad9",null,null).exports,Ot=M(m.defineComponent({__name:"FallbackComponent",props:{node:null},setup:e=>({__sfc:!0})}),function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",{staticClass:"unknown-node"},[e._v(" "+e._s(e.node.raw)+" ")])},[],!1,null,"89aff01f",null,null).exports,zt=M(m.defineComponent({__name:"VmrContainerNode",props:{node:null,indexKey:null,isDark:{type:Boolean},typewriter:{type:Boolean},customId:null},setup(e){const t=e,n=m.computed(()=>`vmr-container vmr-container-${t.node.name}`),o=S(t.customId),r=s({text:be,paragraph:Lt,heading:Nt,inline_code:K,link:wt,image:ce,strong:gt,emphasis:Mt,strikethrough:yt,insert:xt,subscript:ht,superscript:vt,checkbox:b,checkbox_input:b,hardbreak:Tt,math_inline:mt,reference:ft,list:Dt,math_block:pt,table:Bt},o);return{__sfc:!0,props:t,containerClass:n,overrides:o,nodeComponents:r,getNodeComponent:function(e){return r[e]||Ot}}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("div",e._b({class:n.containerClass},"div",e.node.attrs,!1),e._l(e.node.children,function(o,r){return t(n.getNodeComponent(o.type),{key:`${e.indexKey||"vmr-container"}-${r}`,tag:"component",attrs:{"custom-id":n.props.customId,node:o,"index-key":`${e.indexKey||"vmr-container"}-${r}`}})}),1)},[],!1,null,"3cd2aff2",null,null).exports,Pt=new Set(["node","key","ref","ctx","renderNode","indexKey","__proto__","prototype","constructor"]);function Rt(e,t={}){var n;const o={},r=new Set(null!=(n=t.omit)?n:[]);if(!e||"object"!=typeof e)return o;const l=Object.getOwnPropertyDescriptors(e);for(const[i,a]of Object.entries(l))Pt.has(i)||r.has(i)||a.enumerable&&"value"in a&&(o[i]=a.value);return o}const Ht=M(m.defineComponent({__name:"LegacyNodesRenderer",props:{nodes:null,customId:null,indexKey:null,typewriter:{type:Boolean,default:!1},fade:{type:Boolean,default:!0},showTooltips:{type:Boolean,default:!0},codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:null,codeBlockLightTheme:null,codeBlockMinWidth:null,codeBlockMaxWidth:null,codeBlockOptions:null,codeBlockProps:null,renderCodeBlocksAsPre:{type:Boolean},themes:null,isDark:{type:Boolean},customHtmlTags:null,htmlPolicy:null},emits:["copy","copy-code","handleArtifactClick","click"],setup(e,{emit:t}){const n=e;function o(e){return"undefined"!=typeof Event&&e instanceof Event}m.provide("markstreamTypewriter",m.computed(()=>!0===n.typewriter)),m.provide("markstreamFade",m.computed(()=>!1!==n.fade));const r={text:be,paragraph:Lt,heading:Nt,code_block:dt,list:Dt,list_item:_t,blockquote:$t,table:Bt,definition_list:C,footnote:Ct,footnote_reference:L,footnote_anchor:bt,admonition:tn,vmr_container:zt,hardbreak:Tt,link:wt,image:ce,thematic_break:At,math_inline:mt,math_block:pt,strong:gt,emphasis:Mt,strikethrough:yt,highlight:kt,insert:xt,subscript:ht,superscript:vt,emoji:T,checkbox:b,checkbox_input:b,inline_code:K,html_inline:Y,html_block:Et,reference:ft},l=m.computed(()=>(I.value,S(n.customId))),i=m.computed(()=>null!=n.indexKey?String(n.indexKey):"legacy-renderer"),a=m.computed(()=>Rt(n.codeBlockProps)),d=m.computed(()=>Rt(n.codeBlockProps)),f=m.computed(()=>{var e,t;return u(s(u(s({stream:n.codeBlockStream,darkTheme:n.codeBlockDarkTheme,lightTheme:n.codeBlockLightTheme,themes:n.themes,minWidth:n.codeBlockMinWidth,maxWidth:n.codeBlockMaxWidth},d.value),{showLineNumbers:"boolean"==typeof d.value.showLineNumbers?d.value.showLineNumbers:"boolean"==typeof(null==(e=n.codeBlockOptions)?void 0:e.disableLineNumbers)&&!n.codeBlockOptions.disableLineNumbers}),(null==(t=n.codeBlockOptions)?void 0:t.overflow)?{style:{whiteSpace:"scroll"===n.codeBlockOptions.overflow?"pre":"pre-wrap"}}:{}),{codeBlockOptions:n.codeBlockOptions})}),v=m.computed(()=>u(s(s({},f.value),a.value),{codeBlockOptions:n.codeBlockOptions})),h=m.computed(()=>{var e;return{typewriter:n.typewriter,fade:n.fade,htmlPolicy:null!=(e=n.htmlPolicy)?e:"safe"}}),g=m.computed(()=>s(s({},h.value),"boolean"==typeof n.showTooltips?{showTooltip:n.showTooltips}:{})),y=m.computed(()=>s(s({},h.value),"boolean"==typeof n.showTooltips?{showTooltips:n.showTooltips}:{})),w=m.computed(()=>new Set(c.normalizeCustomHtmlTags(n.customHtmlTags))),x=m.computed(()=>(Array.isArray(n.nodes)?n.nodes:[]).map((e,t)=>{var n,o,a,d;let m=e;const p=String((null==e?void 0:e.type)||"unknown"),f=k(m);let v=N(m,f);if(("html_block"===m.type||"html_inline"===m.type)&&v===r[m.type]){const e=String(null!=(n=m.tag)?n:"").trim().toLowerCase()||c.getHtmlTagFromContent(m.content);if(e)if(w.value.has(e)){const t=l.value[e];t&&(v=t,m=u(s({},m),{type:e,tag:e,content:c.stripCustomHtmlWrapper(m.content,e)}))}else if(c.shouldRenderUnknownHtmlTagAsText(null!=(o=m.content)?o:m.raw,e)){const e=String(null!=(d=null!=(a=m.content)?a:m.raw)?d:"");"html_inline"===m.type?(v=be,m={type:"text",content:e,raw:e}):(v=Lt,m={type:"paragraph",children:[{type:"text",content:e,raw:e}],raw:e})}}return{index:t,indexKey:`${i.value}-${t}`,renderKey:"code_block"===p?`${i.value}-${t}-${p}`:`${i.value}-${t}-${p}-${String((null==e?void 0:e.raw)||"").length}`,node:m,isCodeBlock:"code_block"===(null==m?void 0:m.type),component:v,bindings:j(m,f,v)}}));function k(e){var t;return"code_block"===(null==e?void 0:e.type)?String(null!=(t=e.language)?t:"").trim().toLowerCase():""}function M(e,t){const n=t.trim().toLowerCase();if(n)for(const o of[n,Re(n),p.normalizeShikiLanguage(n)]){const t=o&&e[o];if(t)return t}}function N(e,t){if(!e)return Ot;const o=l.value,i=o[String(e.type)];if("code_block"===e.type){const r=null!=t?t:k(e),l=r?M(o,r):void 0;return l||("mermaid"===r?o.mermaid||dt:"infographic"===r?o.infographic||dt:"d2"===r||"d2lang"===r?o.d2||dt:i||(o.code_block||(n.renderCodeBlocksAsPre,dt)))}return i||r[String(e.type)]||Ot}function _(e){return Boolean(e&&e===l.value.code_block)}function D(e,t){return Boolean(e&&t&&e===M(l.value,t))}function j(e,t,n){const o=null!=t?t:k(e);return"code_block"===e.type&&D(n,o)?"mermaid"===o||"infographic"===o||"d2"===o||"d2lang"===o?{}:v.value:"code_block"===e.type&&_(n)?v.value:"mermaid"===o||"infographic"===o||"d2"===o||"d2lang"===o?{}:"link"===e.type?g.value:"list"===e.type?y.value:"code_block"===e.type?f.value:h.value}return{__sfc:!0,props:n,emit:t,isNativeDomEvent:o,handleCopy:function(e){if(!o(e))return"string"==typeof e?(t("copy-code",e),void t("copy",e)):void t("copy",e)},handleArtifactClick:function(e){t("handleArtifactClick",e)},nodeComponents:r,customComponentsMap:l,indexPrefix:i,codeBlockExtraProps:a,builtinCodeBlockExtraProps:d,codeBlockBindings:f,customCodeBlockBindings:v,nonCodeBindings:h,linkBindings:g,listBindings:y,effectiveCustomHtmlTagsSet:w,renderedItems:x,getCodeBlockLanguage:k,getCustomCodeLanguageComponent:M,getNodeComponent:N,isCustomCodeBlockComponent:_,isCustomLanguageCodeBlockComponent:D,getBindingsFor:j,handleClick:function(e){t("click",e)}}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("div",{staticClass:"markstream-vue2 markdown-renderer legacy-nodes-renderer",class:{dark:n.props.isDark},on:{click:n.handleClick}},e._l(n.renderedItems,function(o){return t("div",{key:o.renderKey,staticClass:"node-slot",attrs:{"data-node-index":o.index,"data-node-type":o.node.type}},[t("div",{staticClass:"node-content"},[t(o.component,e._b({key:`${o.renderKey}-component`,tag:"component",attrs:{node:o.node,loading:o.node.loading,"index-key":o.indexKey,"custom-id":n.props.customId,"is-dark":n.props.isDark},on:{copy:n.handleCopy,"handle-artifact-click":n.handleArtifactClick}},"component",o.bindings,!1))],1)])}),0)},[],!1,null,null,null,null).exports,$t=M(m.defineComponent({__name:"BlockquoteNode",props:{node:null,indexKey:null,typewriter:{type:Boolean},customId:null},setup(e){const t=e,n=m.getCurrentInstance(),o=m.computed(()=>w(null==n?void 0:n.proxy)?Ht:en);return{__sfc:!0,props:t,instance:n,nestedRenderer:o}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("blockquote",{staticClass:"blockquote",attrs:{dir:"auto",cite:e.node.cite}},[t(n.nestedRenderer,{tag:"component",attrs:{"index-key":`blockquote-${n.props.indexKey}`,nodes:n.props.node.children||[],"custom-id":n.props.customId,typewriter:n.props.typewriter},on:{copy:function(t){return e.$emit("copy",t)}}})],1)},[],!1,null,"0bfb818f",null,null).exports;function Ut(e){try{if("undefined"!=typeof globalThis&&"function"==typeof globalThis.requestAnimationFrame)return globalThis.requestAnimationFrame(e)}catch(t){}return globalThis.setTimeout(e,0)}function Ft(e){try{if(null==e)return;if("undefined"!=typeof globalThis&&"function"==typeof globalThis.cancelAnimationFrame)return void globalThis.cancelAnimationFrame(e)}catch(t){}try{globalThis.clearTimeout(e)}catch(t){}}const Yt=M(m.defineComponent({__name:"Portal",props:{to:null},setup(e){const t=e,n=m.ref(null);function o(){return"undefined"==typeof document?null:t.to&&"body"!==t.to?document.querySelector(t.to):document.body}function r(){const e=n.value;if(!e)return;const t=o();t&&e.parentElement!==t&&t.appendChild(e)}return m.onMounted(()=>{r()}),m.watch(()=>t.to,()=>{r()}),m.onBeforeUnmount(()=>{}),{__sfc:!0,props:t,rootRef:n,resolveTarget:o,moveToTarget:r}}}),function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",{ref:"rootRef",staticClass:"portal-root"},[e._t("default")],2)},[],!1,null,"5b7455c5",null,null).exports,Kt=M(m.defineComponent({__name:"HtmlPreviewFrame",props:{code:null,isDark:{type:Boolean},htmlPreviewAllowScripts:{type:Boolean},htmlPreviewSandbox:null,onClose:null,title:null},setup(e){var t;const n=e,o=void 0!=={url:"undefined"==typeof document?require("url").pathToFileURL(__filename).href:v&&"SCRIPT"===v.tagName.toUpperCase()&&v.src||new URL("index.cjs",document.baseURI).href}&&Boolean(null==(t={BASE_URL:"/",MODE:"npm",DEV:!1,PROD:!0,SSR:!1})?void 0:t.DEV);let r=null;function l(e){return new Set(e.trim().toLowerCase().split(/\s+/).filter(Boolean))}function i(e){if(!o||"undefined"==typeof console||r===e)return;const t=l(e);t.has("allow-scripts")&&t.has("allow-same-origin")&&(r=e,console.warn("[markstream-vue2] htmlPreviewSandbox contains both allow-scripts and allow-same-origin. Use this only for fully trusted content served from an isolated origin."))}function a(e,t){return"string"==typeof e?(i(e),e):void 0!==e?"":!0===t?"allow-scripts":""}const{t:s}=de(),u=m.computed(()=>{const e=n.code||"",t=e.trim().toLowerCase();return t.startsWith("<!doctype")||t.startsWith("<html")||t.startsWith("<body")?e:`<!doctype html>\n<html lang="en">\n <head>\n <meta charset="utf-8" />\n <meta name="viewport" content="width=device-width, initial-scale=1" />\n <style>\n html, body {\n margin: 0;\n padding: 0;\n height: 100%;\n background-color: ${n.isDark?"#020617":"#ffffff"};\n color: ${n.isDark?"#e5e7eb":"#020617"};\n }\n body {\n font-family: system-ui, -apple-system, BlinkMacSystemFont, 'SF Pro Text', ui-sans-serif, sans-serif;\n }\n </style>\n </head>\n <body>\n ${e}\n </body>\n</html>`}),d=m.computed(()=>a(n.htmlPreviewSandbox,n.htmlPreviewAllowScripts));function c(e){var t;"Escape"!==e.key&&"Esc"!==e.key||null==(t=n.onClose)||t.call(n)}return m.onMounted(()=>{"undefined"!=typeof window&&window.addEventListener("keydown",c)}),m.onUnmounted(()=>{"undefined"!=typeof window&&window.removeEventListener("keydown",c)}),{__sfc:!0,props:n,isDevEnv:o,lastWarnedDangerousSandbox:r,normalizeSandboxTokens:l,warnDangerousHtmlPreviewSandbox:i,resolveHtmlPreviewSandboxValue:a,t:s,srcdoc:u,sandboxValue:d,handleKeydown:c,Portal:Yt}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t(n.Portal,{attrs:{to:"body"}},[t("div",{staticClass:"markstream-vue2"},[t("div",{staticClass:"html-preview-frame__backdrop",class:{"html-preview-frame__backdrop--dark":n.props.isDark},on:{click:function(e){var t,o;null==(o=(t=n.props).onClose)||o.call(t)}}},[t("div",{staticClass:"html-preview-frame",class:{"html-preview-frame--dark":n.props.isDark},on:{click:function(e){e.stopPropagation()}}},[t("div",{staticClass:"html-preview-frame__header"},[t("div",{staticClass:"html-preview-frame__title"},[t("span",{staticClass:"html-preview-frame__dot"}),t("span",{staticClass:"html-preview-frame__label"},[e._v(e._s(n.props.title||n.t("common.preview")||"Preview"))])]),t("button",{staticClass:"html-preview-frame__close",class:{"html-preview-frame__close--dark":n.props.isDark},attrs:{type:"button"},on:{click:function(e){var t,o;null==(o=(t=n.props).onClose)||o.call(t)}}},[e._v(" × ")])]),t("iframe",{staticClass:"html-preview-frame__iframe",attrs:{sandbox:n.sandboxValue,referrerpolicy:"no-referrer",srcdoc:n.srcdoc}})])])])])},[],!1,null,"56f5a269",null,null).exports,Wt=M(m.defineComponent({__name:"CodeBlockNode",props:{node:{type:Object,required:!0},isDark:{type:Boolean,default:!1},loading:{type:Boolean,default:!0},stream:{type:Boolean,default:!0},codeBlockOptions:{type:Object,default:void 0},showLineNumbers:{type:Boolean,default:void 0},theme:{type:[Object,String],default:void 0},darkTheme:{type:String,default:void 0},lightTheme:{type:String,default:void 0},isShowPreview:{type:Boolean,default:!0},enableFontSizeControl:{type:Boolean,default:!0},minWidth:{type:[String,Number],default:void 0},maxWidth:{type:[String,Number],default:void 0},themes:{type:Array,default:void 0},showHeader:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExpandButton:{type:Boolean,default:!0},showPreviewButton:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},showFontSizeButtons:{type:Boolean,default:!0},showTooltips:{type:Boolean,default:void 0},htmlPreviewAllowScripts:{type:Boolean,default:void 0},htmlPreviewSandbox:{type:String,default:void 0},customId:{type:String,default:void 0},estimatedHeightPx:{type:Number,default:void 0},estimatedContentHeightPx:{type:Number,default:void 0},estimatedDiffInline:{type:Boolean,default:void 0}},emits:["previewCode","copy"],setup(e,{emit:t}){var n,o;const r=e,l=m.getCurrentInstance(),i=m.computed(()=>{var e,t,n,o,r,i,a,s,u,d;const c=null==l?void 0:l.proxy,m=null!=(e=null==c?void 0:c.$listeners)?e:{};if(m.previewCode||m["preview-code"])return!0;const p=null!=(a=null!=(i=null==(n=null==(t=null==c?void 0:c.$vnode)?void 0:t.data)?void 0:n.on)?i:null==(r=null==(o=null==c?void 0:c.$vnode)?void 0:o.componentOptions)?void 0:r.listeners)?a:{};if(p.previewCode||p["preview-code"])return!0;const f=null!=(d=null==(s=null==c?void 0:c.$vnode)?void 0:s.props)?d:null==(u=null==l?void 0:l.vnode)?void 0:u.props;return!(!f||!f.onPreviewCode&&!f.onPreviewcode)}),{t:a}=de(),c=m.ref(null),p=m.ref(null),f=m.ref(!1),h=m.ref(Re(r.node.language)),g=m.computed(()=>He(h.value)),y=m.computed(()=>"plaintext"===g.value),w=m.ref(!1),x=m.ref(!1),k=m.ref(!1),M=m.ref(!1),b=m.ref(!1),C=m.ref(null);let T=0;const N=jt();let _=null;const D=m.ref("undefined"==typeof window);"undefined"!=typeof window&&m.watch(()=>p.value,e=>{if(null==_||_.destroy(),_=null,!e)return void(D.value=!1);const t=N(e,{rootMargin:"400px"});_=t,D.value=t.isVisible.value,t.whenVisible.then(()=>{D.value=!0})},{immediate:!0}),m.onBeforeUnmount(()=>{null==_||_.destroy(),_=null});let I=null,S=null,j=()=>{},E=()=>{},L=()=>null,B=()=>({getModel:()=>({getLineCount:()=>1}),getOption:()=>14,updateOptions:()=>{}}),A=()=>({getModel:()=>({getLineCount:()=>1}),getOption:()=>14,updateOptions:()=>{}}),O=()=>{},z=()=>{},P=()=>{},R=null,H=0,$=()=>{var e;return String(null!=(e=r.node.language)?e:"plaintext")},U=()=>d(this,null,function*(){}),F=null,Y=null,K=null,W=!1,Q=null;const V=m.computed(()=>r.node.diff),X='"SF Mono", Monaco, Consolas, "Ubuntu Mono", "Liberation Mono", "Courier New", monospace',q=12;function G(e){return"number"==typeof e&&Number.isFinite(e)&&e>0?e:void 0}function Z(e){var t;const n=null!=(t=G(e))?t:0;return{top:n,bottom:n}}const J=m.computed(()=>{var e;return null!=(e=r.codeBlockOptions)?e:{}}),ee=m.computed(()=>{var e;return null!=(e=r.showLineNumbers)?e:!0!==J.value.disableLineNumbers}),te=m.computed(()=>{const e=s({},J.value);for(const n of["maxHeight","padding","tabSize","theme","themes","themeType","language","languages","stream","disableFileHeader","onThemeChange","renderCustomHeader","renderHeaderMetadata","renderHeaderPrefix"])delete e[n];if(!V.value)return e;const t=e.parseDiffOptions&&"object"==typeof e.parseDiffOptions?e.parseDiffOptions:{};return u(s({diffStyle:"split",expandUnchanged:!1,collapsedContextThreshold:5,hunkSeparators:"line-info"},e),{parseDiffOptions:s({context:2},t)})}),ne=m.computed(()=>V.value?"diff":"single"),oe=m.ref(ne.value),re=m.ref(!1),le=m.ref(!1),se=void 0!=={url:"undefined"==typeof document?require("url").pathToFileURL(__filename).href:v&&"SCRIPT"===v.tagName.toUpperCase()&&v.src||new URL("index.cjs",document.baseURI).href}&&Boolean(null==(n={BASE_URL:"/",MODE:"npm",DEV:!1,PROD:!0,SSR:!1})?void 0:n.DEV);function ue(e){K=e,Y=lt();const t=e(Y);I=t.createEditor||I,S=t.createDiffEditor||S,j=t.updateCode||j,E=t.updateDiff||E,L=t.getEditor||L,B=t.getEditorView||B,A=t.getDiffEditorView||A,O=t.cleanupEditor||O,z=t.safeClean||t.cleanupEditor||z,P=t.refreshDiffPresentation||P,U=t.setTheme||U,F=t.whenVisualReady||null,b.value=!0}"undefined"!=typeof window&&(()=>{d(this,null,function*(){try{const e=yield _e();if(!e)return se&&console.warn("[markstream-vue2] stream-diffs is not installed. Code blocks will use basic rendering. Install stream-diffs for enhanced code editor features."),void(re.value=!0);const t=e.createCodeBlockRuntime,n=e.detectLanguage;"function"==typeof n&&($=n),"function"==typeof t&&(ue(t),c.value&&(yield Fe(c.value)))}catch(e){se&&console.warn("[markstream-vue2] Failed to initialize stream-diffs:",e),re.value=!0}})})();const ce=m.ref("number"==typeof(null==(o=te.value)?void 0:o.fontSize)?te.value.fontSize:q),me=m.ref(ce.value),pe=m.computed(()=>{const e=ce.value,t=me.value;return"number"==typeof e&&Number.isFinite(e)&&e>0&&"number"==typeof t&&Number.isFinite(t)&&t>0});function fe(){return new Promise(e=>{let t=!1,n=null,o=null;const r=()=>{t||(t=!0,null!=o&&globalThis.clearTimeout(o),null!=n&&Ft(n),e())};o=globalThis.setTimeout(r,50),n=Ut(r)})}function ve(){return d(this,null,function*(){var e;if(F)try{return!!(yield F())&&(yield m.nextTick(),yield fe(),!W)}catch(t){return!1}for(let n=0;n<30;n++){if(W)return!1;if(null==(e=c.value)?void 0:e.querySelector("diffs-container, .stream-diffs-shell"))return yield m.nextTick(),yield fe(),!W;yield m.nextTick(),yield fe()}return!1})}function he(){var e,t,n,o,r;try{const l=V.value?null!=(n=null==(t=null==(e=A())?void 0:e.getModifiedEditor)?void 0:t.call(e))?n:A():B(),i=L(),a=null==(o=null==i?void 0:i.EditorOption)?void 0:o.fontInfo;if(l&&null!=a){const e=null==(r=l.getOption)?void 0:r.call(l,a),t=null==e?void 0:e.fontSize;if("number"==typeof t&&Number.isFinite(t)&&t>0)return t}}catch(l){}return null}function ge(e){var t,n;try{const o=L(),r=null==(t=null==o?void 0:o.EditorOption)?void 0:t.lineHeight;if(null!=r){const t=null==(n=null==e?void 0:e.getOption)?void 0:n.call(e,r);if("number"==typeof t&&t>0)return t}}catch(r){}const o=Number.isFinite(me.value)&&me.value>0?me.value:12;return Math.max(12,Math.round(1.35*o))}function ye(){var e;if(Number.isFinite(me.value)&&me.value>0&&Number.isFinite(ce.value))return me.value;const t=he();return"number"==typeof(null==(e=te.value)?void 0:e.fontSize)?(ce.value=te.value.fontSize,me.value=te.value.fontSize,me.value):t&&t>0?(ce.value=t,me.value=t,t):(ce.value=12,me.value=12,12)}function we(){var e,t;const n=c.value;if(!n)return null;const o=n.querySelector("diffs-container"),r=null==o?void 0:o.shadowRoot,l=null!=(e=null==r?void 0:r.querySelector("pre[data-file], [data-diff]"))?e:n.querySelector(".stream-diffs-shell"),i=null!=(t=null==l?void 0:l.getBoundingClientRect().height)?t:0;return Number.isFinite(i)&&i>0?Math.ceil(i):null}function xe(){var e,t,n,o,r,l,i,a,s,u,d,c,m,p;const f=we();if(null!=f)return f;try{const f=V.value?A():B();if(!f)return null;if(V.value&&(null==f?void 0:f.getOriginalEditor)&&(null==f?void 0:f.getModifiedEditor)){const m=null==(e=f.getOriginalEditor)?void 0:e.call(f),p=null==(t=f.getModifiedEditor)?void 0:t.call(f);null==(n=null==m?void 0:m.layout)||n.call(m),null==(o=null==p?void 0:p.layout)||o.call(p);const v=(null==(r=null==m?void 0:m.getContentHeight)?void 0:r.call(m))||0,h=(null==(l=null==p?void 0:p.getContentHeight)?void 0:l.call(p))||0,g=Math.max(v,h);if(g>0)return Math.ceil(g+1);const y=(null==(s=null==(a=null==(i=null==m?void 0:m.getModel)?void 0:i.call(m))?void 0:a.getLineCount)?void 0:s.call(a))||1,w=(null==(c=null==(d=null==(u=null==p?void 0:p.getModel)?void 0:u.call(p))?void 0:d.getLineCount)?void 0:c.call(d))||1,x=Math.max(y,w),k=Math.max(ge(m),ge(p));return Math.ceil(x*(k+1.5)+0+1)}if(null==f?void 0:f.getContentHeight){null==(m=null==f?void 0:f.layout)||m.call(f);const e=f.getContentHeight();if(e>0)return Math.ceil(e+1)}const v=null==(p=null==f?void 0:f.getModel)?void 0:p.call(f);let h=1;v&&"function"==typeof v.getLineCount&&(h=v.getLineCount());const g=ge(f);return Math.ceil(h*(g+1.5)+0+1)}catch(v){return null}}function ke(){var e;const t=c.value,n=p.value;if(!t||!n)return;const o=t,r=J.value,l=null!=(e=G(r.tabSize))?e:4;o.style.setProperty("--diffs-tab-size",String(l));const i=r.padding;"number"==typeof i?o.style.setProperty("--diffs-gap-block",`${i}px`):o.style.removeProperty("--diffs-gap-block")}const Me=/auto|scroll|overlay/i;function be(e){var t,n;if("undefined"==typeof window)return null;const o=null!=(t=null==e?void 0:e.ownerDocument)?t:document,r=o.scrollingElement||o.documentElement||o.body;let l=null!=(n=null==e?void 0:e.parentElement)?n:null;for(;l&&l!==o.body&&l!==r;){const e=window.getComputedStyle(l),t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();if(Me.test(t)||Me.test(n))return l;l=l.parentElement}return r}function Ce(e,t,n){var o;if("undefined"==typeof window)return;const r=Math.ceil(t),l=Math.ceil(n)-r;if(!l)return;const i=be(e);if(!i)return;const a=null!=(o=e.ownerDocument)?o:document,s=i===a.body||i===a.documentElement||i===a.scrollingElement,u=s?0:i.getBoundingClientRect().top;e.getBoundingClientRect().top-u>=0||(s&&"function"==typeof window.scrollBy?window.scrollBy(0,l):i.scrollTop+=l)}function Te(){try{const e=c.value;if(!e)return;const t=e.getBoundingClientRect().height,n=xe();if(null!=n&&n>0){const o=Math.ceil(n);e.style.minHeight="0px",e.style.height=`${o}px`,e.style.maxHeight="none",e.style.overflow="visible",Ce(e,t,o)}}catch(e){}}function Ne(){null==Q&&(Q=Ut(()=>{Q=null,Ut(()=>{x.value||(w.value?Te():Ie())})}))}function De(e,t,n){const o=Math.min(t,n),r=t>n+1;return e.style.minHeight="0px",e.style.height=`${Math.ceil(o)}px`,e.style.maxHeight=`${Math.ceil(n)}px`,e.style.overflow=r?"auto":"hidden",Math.ceil(o)}function Ie(){var e;try{const t=c.value;if(!t)return;const n=t.getBoundingClientRect().height,o=Se();if(T>0&&(T--,null!=C.value))return void Ce(t,n,De(t,C.value,o));const r=xe();if(null!=r&&r>0)return void Ce(t,n,De(t,r,o));if(null!=C.value)return void Ce(t,n,De(t,C.value,o));const l=Math.ceil((null==(e=t.getBoundingClientRect)?void 0:e.call(t).height)||0);if(l>0)return void Ce(t,n,De(t,l,o));const i=Number.parseFloat(t.style.height);!Number.isNaN(i)&&i>0?Ce(t,n,De(t,i,o)):Ce(t,n,De(t,o,o))}catch(t){}}function Se(){var e;return null!=(e=J.value.maxHeight)?e:500}const je=m.computed(()=>r.isShowPreview&&("html"===h.value||"svg"===h.value));m.watch(()=>r.node.language,e=>{h.value=Re(e)}),m.watch(()=>[r.node.originalCode,r.node.updatedCode,g.value,V.value],e=>d(this,[e],function*([e,t,n,o]){if(!1!==r.stream&&o){if(I&&!k.value&&c.value)try{yield Fe(c.value)}catch(l){}E(String(null!=e?e:""),String(null!=t?t:""),g.value),Ne()}})),m.watch(()=>r.node.code,e=>d(this,null,function*(){if(!1!==r.stream&&(h.value||(h.value=Re($(e))),!V.value)){if(I&&!k.value&&c.value)try{yield Fe(c.value)}catch(t){}j(e,g.value),w.value&&Ne()}}));const Ee=m.computed(()=>{const e=h.value;return e?Ue[e]||e.charAt(0).toUpperCase()+e.slice(1):Ue[""]||"Plain Text"}),Le=m.computed(()=>(Be.value,$e(h.value||""))),Ae=m.computed(()=>{if(!V.value)return{color:"var(--code-fg, var(--markstream-code-fallback-fg))",backgroundColor:"var(--code-header-bg, transparent)"}}),Oe=m.computed(()=>!1!==r.showTooltips);function ze(e){const t=e.currentTarget||e.target;return!t||t.disabled?null:t}function Pe(e,t){return d(this,null,function*(){var n,o,l;if(!I||W||t!==H)return;if(it(),V.value?(z(),S?yield S(e,String(null!=(n=r.node.originalCode)?n:""),String(null!=(o=r.node.updatedCode)?o:""),g.value):yield I(e,r.node.code,g.value)):yield I(e,r.node.code,g.value),W||t!==H)return;const i=V.value?A():B();if("number"==typeof(null==(l=te.value)?void 0:l.fontSize))null==i||i.updateOptions({fontSize:te.value.fontSize}),ce.value=te.value.fontSize,me.value=te.value.fontSize;else{const e=he();e&&e>0?(ce.value=e,me.value=e):(ce.value=12,me.value=12)}if(w.value||x.value||Ne(),!1===r.loading){if(yield m.nextTick(),W||t!==H)return;Ut(()=>{W||t!==H||Ne()})}const a=yield ve();W||t!==H||(!a||x.value||w.value||Ie(),M.value=a)})}function Fe(e){if(!I)return null;if(R)return R;k.value=!0,M.value=!1;const t=H,n=(()=>d(this,null,function*(){yield Pe(e,t)}))().finally(()=>{R===n&&(R=null)});return R=n,n}m.watch(Oe,e=>{e||ae()}),m.watch(()=>me.value,(e,t)=>{const n=V.value?A():B();n&&"number"==typeof e&&Number.isFinite(e)&&e>0&&(n.updateOptions({fontSize:e}),w.value&&!x.value&&Ne())},{flush:"post",immediate:!1});const Ye=m.watch(()=>[c.value,V.value,r.stream,r.loading,b.value,D.value],e=>d(this,[e],function*([e,t,n,o,r,l]){if(!e||!I)return;if(!l)return;if(!1===n&&!1!==o)return;const i=Fe(e);if(!i)return;const a=H;try{yield i}catch(s){if(!W&&a===H)throw s;return}W||a!==H||Ye()}));function Ke(){return"string"==typeof r.theme?r.theme:r.theme&&"object"==typeof r.theme?r.isDark?r.theme.dark:r.theme.light:r.isDark?r.darkTheme:r.lightTheme}function We(e){return"string"==typeof e?e:null}m.watch(ne,(e,t)=>d(this,null,function*(){if(e!==t&&(oe.value=e,I&&c.value&&k.value&&(!1!==r.stream||!1===r.loading)&&D.value))try{k.value=!1,H+=1,R=null,z(),yield m.nextTick(),yield Fe(c.value)}catch(n){k.value=!1}}));const Qe=m.computed(()=>{var e,t;return Array.isArray(r.themes)&&"string"==typeof r.themes[0]&&"string"==typeof r.themes[1]?[r.themes[0],r.themes[1]]:[null!=(e=r.darkTheme)?e:"vitesse-dark",null!=(t=r.lightTheme)?t:"vitesse-light"]});function Ve(){var e;return null!=(e=Ke())?e:r.isDark?Qe.value[0]:Qe.value[1]}function Xe(){it();const e=Ve(),t=()=>{V.value&&P(),Ut(()=>{ke(),Ne()})};e?Promise.resolve(U(e)).then(t).catch(()=>{}):t()}function qe(e){var t;const n=(null!=(t=We(e))?t:"").toLowerCase();return n?["dark","night","moon","black","dracula","mocha","frappe","macchiato","palenight","ocean","poimandres","monokai","laserwave","tokyo","slack-dark","rose-pine","github-dark","material-theme","one-dark","catppuccin-mocha","catppuccin-frappe","catppuccin-macchiato"].some(e=>n.includes(e))&&!["light","latte","dawn","lotus"].some(e=>n.includes(e)):!!r.isDark}const Ge=m.computed(()=>qe(Ve())),Ze=m.computed(()=>Ge.value?"dark":"light"),Je=m.computed(()=>V.value?"dark"===Ze.value:Ge.value),et=m.computed(()=>{var e,t,n;const o=J.value,r=Number.isFinite(me.value)&&me.value>0?me.value:q,l=null!=(e=G(null==o?void 0:o.fontSize))?e:r,i=null!=(t=G(null==o?void 0:o.lineHeight))?t:l===q?18:Math.max(12,Math.round(1.5*l)),a="string"==typeof(null==o?void 0:o.fontFamily)&&o.fontFamily.trim()?o.fontFamily.trim():X,s=Z(null==o?void 0:o.padding),u=V.value?0:8,d="number"==typeof o.padding,c=null!=(n=G(null==o?void 0:o.tabSize))?n:4;return{fontFamily:a,fontSize:l,lineHeight:i,paddingBottom:d?s.bottom:u,paddingTop:d?s.top:u,tabSize:c}}),tt=m.computed(()=>{var e;return!!V.value&&("boolean"==typeof r.estimatedDiffInline?r.estimatedDiffInline:"unified"===(null==(e=te.value)?void 0:e.diffStyle))}),nt=m.computed(()=>{const e=et.value,t={"--markstream-pre-line-number-top":`${e.paddingTop}px`,fontSize:`${e.fontSize}px`,lineHeight:`${e.lineHeight}px`,paddingBottom:`${e.paddingBottom}px`,paddingTop:`${e.paddingTop}px`,tabSize:e.tabSize,maxHeight:`${Se()}px`,overflow:"auto",whiteSpace:"scroll"===J.value.overflow?"pre":"pre-wrap"};return V.value&&(t["--markstream-code-padding-left"]="62px",t["--markstream-pre-diff-line-height"]=`${e.lineHeight}px`,t["--markstream-pre-line-number-width"]="36px",t["--markstream-pre-line-number-gap"]="0px"),e.fontFamily&&(t.fontFamily=e.fontFamily),t}),ot=m.computed(()=>{var e;const t={},n=e=>{if(null!=e)return"number"==typeof e?`${e}px`:String(e)},o=n(r.minWidth),l=n(r.maxWidth);if(o&&(t.minWidth=o),l&&(t.maxWidth=l),!M.value&&!x.value){const n=G(r.estimatedHeightPx);if(null!=n)t.minHeight=`${Math.ceil(n)}px`;else if(!V.value){const n=et.value,o=String(null!=(e=r.node.code)?e:"").replace(/(?:\r\n|\n|\r)$/,""),l=o?o.split(/\r\n|\n|\r/).length:1,i=Math.min(Se(),l*n.lineHeight+n.paddingTop+n.paddingBottom),a=2+(r.showHeader?41:0);t.minHeight=`${Math.ceil(i+a)}px`}}return V.value?(t.color="var(--markstream-diff-shell-fg)",t.borderColor="var(--markstream-diff-shell-border)"):(t.color="var(--vscode-editor-foreground, var(--markstream-code-fallback-fg))",t.backgroundColor="var(--vscode-editor-background, var(--markstream-code-fallback-bg))",t.borderColor="var(--markstream-code-border-color)"),t}),rt=m.computed(()=>{if(M.value||x.value)return;const e=G(r.estimatedContentHeightPx);return null==e?void 0:{minHeight:`${Math.ceil(Math.min(e,Se()))}px`}});function lt(){var e;const t=et.value,n=u(s(u(s({overflow:"wrap"},te.value||{}),{themes:[...Qe.value],stream:!1,disableFileHeader:!0,MAX_HEIGHT:null!=(e=J.value.maxHeight)?e:500,fontSize:t.fontSize,lineHeight:t.lineHeight}),t.fontFamily?{fontFamily:t.fontFamily}:{}),{disableLineNumbers:!ee.value,theme:Ve(),themeType:r.isDark?"dark":"light",onThemeChange(){ke()}}),o="string"==typeof n.unsafeCSS?n.unsafeCSS:"";return n.unsafeCSS=`[data-file], [data-diff] { --diffs-min-number-column-width-default: 2ch !important; }\n${o}`.trim(),n}function it(){const e=lt();if(!Y)return Y=e,Y;for(const t of Object.keys(Y))t in e||delete Y[t];return Object.assign(Y,e),Y}const at=m.ref(0),st=m.computed(()=>String(at.value));let ut=!1;m.watch(()=>[r.codeBlockOptions,r.showLineNumbers],()=>{at.value+=1,!1===r.stream&&!1!==r.loading&&(ut=!0);const e=J.value.fontSize;"number"==typeof e?(ce.value=e,me.value=e):(ce.value=q,me.value=q)},{deep:!0}),m.watch(()=>[D.value],()=>{var e;if(it(),!I||!D.value)return;const t=V.value?A():B(),n=Number.isFinite(me.value)?me.value:void 0;"number"==typeof n&&Number.isFinite(n)&&n>0&&(null==(e=null==t?void 0:t.updateOptions)||e.call(t,{fontSize:n})),Ne()},{deep:!0}),m.watch(()=>[r.isDark,r.darkTheme,r.lightTheme,r.themes,r.theme,b.value,k.value,D.value],()=>{b.value&&Xe()},{flush:"post"}),m.watch(()=>[st.value,b.value,D.value],(e,t)=>d(this,[e,t],function*([e,t,n],[o]){if(it(),t&&n&&I&&c.value&&k.value&&e!==o)if(!1!==r.stream||!1===r.loading){ut=!1;try{k.value=!1,H+=1,R=null,z(),K&&ue(K),yield m.nextTick(),yield Fe(c.value)}catch(l){k.value=!1}}else ut=!0}),{flush:"post"}),m.watch(()=>[r.loading,D.value],e=>d(this,[e],function*([e,t]){if(!1===e&&t&&ut&&(ut=!1,it(),yield m.nextTick(),I&&c.value&&k.value))try{k.value=!1,H+=1,R=null,z(),K&&ue(K),yield m.nextTick(),yield Fe(c.value)}catch(n){k.value=!1}}),{flush:"post"});const ct=m.watch(()=>[r.loading,D.value],e=>d(this,[e],function*([e,t]){t&&(e||(yield m.nextTick(),Ut(()=>{x.value||(w.value?Te():Ie()),ct()})))}),{immediate:!0,flush:"post"});return m.onUnmounted(()=>{W=!0,H+=1,R=null,null!=Q&&(Ft(Q),Q=null),O()}),{__sfc:!0,props:r,emits:t,instance:l,hasPreviewListener:i,t:a,codeEditor:c,container:p,copyText:f,codeLanguage:h,languageId:g,isPlainTextLanguage:y,isExpanded:w,isCollapsed:x,editorCreated:k,editorReady:M,runtimeReady:b,expandRafId:null,heightBeforeCollapse:C,resumeGuardFrames:T,registerVisibility:N,viewportHandle:_,viewportReady:D,createEditor:I,createDiffEditor:S,updateCode:j,updateDiffCode:E,getEditor:L,getEditorView:B,getDiffEditorView:A,cleanupEditor:O,safeClean:z,refreshDiffPresentation:P,createEditorPromise:R,editorCreationGeneration:H,detectLanguage:$,setTheme:U,whenRuntimeVisualReady:F,runtimeOptions:Y,createRuntimeHelpersFactory:K,isUnmounted:W,deferredEditorVisualSyncRafId:Q,isDiff:V,defaultPreFallbackFontFamily:X,defaultPreFallbackFontSize:q,defaultPreFallbackLineHeight:18,readPositiveNumber:G,readPadding:Z,resolvedCodeBlockOptions:J,effectiveShowLineNumbers:ee,resolvedRuntimeOptions:te,desiredEditorKind:ne,currentEditorKind:oe,usePreCodeRender:re,showInlinePreview:le,isDevEnv:se,initializeRuntimeHelpers:ue,codeFontMin:10,codeFontMax:36,codeFontStep:1,defaultCodeFontSize:ce,codeFontSize:me,fontBaselineReady:pe,CONTENT_PADDING:0,LINE_EXTRA_PER_LINE:1.5,PIXEL_EPSILON:1,waitForAnimationFrame:fe,waitForEditorVisualReady:ve,readActualFontSizeFromEditor:he,getLineHeightSafe:ge,ensureFontBaseline:ye,increaseCodeFont:function(){const e=ye(),t=Math.min(36,e+1);me.value=t},decreaseCodeFont:function(){const e=ye(),t=Math.max(10,e-1);me.value=t},resetCodeFont:function(){ye(),Number.isFinite(ce.value)&&(me.value=ce.value)},measureRenderedStaticSurfaceHeight:we,computeContentHeight:xe,syncEditorCssVars:ke,resizeSyncHandler:null,SCROLL_PARENT_OVERFLOW_RE:Me,resolveScrollRootElement:be,adjustScrollAfterHeightChange:Ce,updateExpandedHeight:Te,scheduleEditorVisualSync:Ne,applyCollapsedContainerHeight:De,updateCollapsedHeight:Ie,getMaxHeightValue:Se,isPreviewable:je,displayLanguage:Ee,languageIcon:Le,headerStyle:Ae,tooltipsEnabled:Oe,copy:function(){return d(this,null,function*(){try{"undefined"!=typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.writeText&&(yield navigator.clipboard.writeText(r.node.code)),f.value=!0,t("copy",r.node.code),setTimeout(()=>{f.value=!1},1e3)}catch(e){console.error("复制失败:",e)}})},resolveTooltipTarget:ze,onBtnHover:function(e,t,n="top"){if(!Oe.value)return;const o=ze(e);if(!o)return;const l=e;ie(o,t,n,!1,null!=(null==l?void 0:l.clientX)&&null!=(null==l?void 0:l.clientY)?{x:l.clientX,y:l.clientY}:void 0,r.isDark)},onBtnLeave:function(){Oe.value&&ae()},onCopyHover:function(e){if(!Oe.value)return;const t=ze(e);if(!t)return;const n=e;ie(t,f.value?a("common.copied")||"Copied":a("common.copy")||"Copy","top",!1,null!=(null==n?void 0:n.clientX)&&null!=(null==n?void 0:n.clientY)?{x:n.clientX,y:n.clientY}:void 0,r.isDark)},toggleExpand:function(e){if(w.value=!w.value,e&&Oe.value){const t=ze(e);t&&ie(t,w.value?a("common.collapse")||"Collapse":a("common.expand")||"Expand","top",!1,void 0,r.isDark)}const t=V.value?A():B(),n=c.value;t&&n&&(w.value?(n.style.maxHeight="none",n.style.overflow="visible",Te()):(n.style.overflow="auto",Ie()))},toggleHeaderCollapse:function(){var e,t,n;if(x.value=!x.value,x.value){if(c.value){const n=Math.ceil((null==(t=(e=c.value).getBoundingClientRect)?void 0:t.call(e).height)||0);n>0&&(C.value=n)}}else{c.value&&null!=C.value&&(c.value.style.height=`${C.value}px`);const e=V.value?A():B();try{null==(n=null==e?void 0:e.layout)||n.call(e)}catch(o){}T=2,Ne()}},previewCode:function(){if(!je.value)return;const e=h.value;if(i.value){const n="html"===e?"text/html":"image/svg+xml",o="html"===e?a("artifacts.htmlPreviewTitle")||"HTML Preview":a("artifacts.svgPreviewTitle")||"SVG Preview";return void t("previewCode",{node:r.node,artifactType:n,artifactTitle:o,id:`temp-${e}-${Date.now()}`})}"html"===e&&(le.value=!le.value)},runEditorCreation:Pe,ensureEditorCreation:Fe,stopCreateEditorWatch:Ye,getPreferredColorScheme:Ke,getThemeName:We,runtimeThemes:Qe,resolveRequestedTheme:Ve,themeUpdate:Xe,themeLooksDark:qe,resolvedChromeIsDark:Ge,effectiveDiffAppearance:Ze,resolvedSurfaceIsDark:Je,preFallbackMetrics:et,preFallbackDiffInline:tt,preFallbackStyle:nt,containerStyle:ot,codeEditorContainerStyle:rt,buildRuntimeOptions:lt,syncRuntimeOptions:it,runtimeOptionsRevision:at,runtimeStructuralSignature:st,deferredRuntimeOptionsRecreation:ut,stopLoadingWatch:ct,stopExpandAutoResize:function(){},PreCodeNode:dt,HtmlPreviewFrame:Kt}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return n.usePreCodeRender?t(n.PreCodeNode,{staticClass:"code-pre-fallback",style:n.preFallbackStyle,attrs:{node:e.node,"show-line-numbers":n.effectiveShowLineNumbers,"diff-inline":n.preFallbackDiffInline}}):t("div",{ref:"container",staticClass:"code-block-container my-4 rounded-lg border overflow-hidden shadow-sm",class:[n.resolvedSurfaceIsDark?"border-gray-700/30 bg-gray-900":"border-gray-200 bg-white",{"is-rendering":n.props.loading,"is-dark":n.resolvedSurfaceIsDark,"is-diff":n.isDiff,"is-plain-text":n.isPlainTextLanguage}],style:n.containerStyle,attrs:{"data-markstream-code-block":"1","data-markstream-enhanced":n.editorReady?"true":"false","data-markstream-enhancement-state":n.editorReady?"ready":"pending"}},[n.props.showHeader?t("div",{staticClass:"code-block-header flex justify-between items-center",style:n.headerStyle},[e._t("header-left",function(){return[t("div",{staticClass:"code-header-main"},[t("span",{staticClass:"icon-slot h-4 w-4 flex-shrink-0",domProps:{innerHTML:e._s(n.languageIcon)}}),t("div",{staticClass:"code-header-copy"},[t("div",{staticClass:"code-header-title"},[e._v(" "+e._s(n.displayLanguage)+" ")])])])]}),e._t("header-right",function(){return[t("div",{staticClass:"code-header-actions"},[n.props.showCollapseButton?t("button",{staticClass:"code-action-btn transition-colors",attrs:{type:"button","aria-pressed":n.isCollapsed},on:{click:n.toggleHeaderCollapse,mouseenter:function(e){n.onBtnHover(e,n.isCollapsed?n.t("common.expand")||"Expand":n.t("common.collapse")||"Collapse")},focus:function(e){n.onBtnHover(e,n.isCollapsed?n.t("common.expand")||"Expand":n.t("common.collapse")||"Collapse")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"action-icon",style:{rotate:n.isCollapsed?"0deg":"90deg"},attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"}})])]):e._e(),n.props.showFontSizeButtons&&n.props.enableFontSizeControl?[t("button",{staticClass:"code-action-btn transition-colors",attrs:{type:"button",disabled:!!Number.isFinite(n.codeFontSize)&&n.codeFontSize<=n.codeFontMin},on:{click:function(e){return n.decreaseCodeFont()},mouseenter:function(e){n.onBtnHover(e,n.t("common.decrease")||"Decrease")},focus:function(e){n.onBtnHover(e,n.t("common.decrease")||"Decrease")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"action-icon",attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14"}})])]),t("button",{staticClass:"code-action-btn transition-colors",attrs:{type:"button",disabled:!n.fontBaselineReady||n.codeFontSize===n.defaultCodeFontSize},on:{click:function(e){return n.resetCodeFont()},mouseenter:function(e){n.onBtnHover(e,n.t("common.reset")||"Reset")},focus:function(e){n.onBtnHover(e,n.t("common.reset")||"Reset")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"action-icon",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("path",{attrs:{d:"M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8"}}),t("path",{attrs:{d:"M3 3v5h5"}})])])]),t("button",{staticClass:"code-action-btn transition-colors",attrs:{type:"button",disabled:!!Number.isFinite(n.codeFontSize)&&n.codeFontSize>=n.codeFontMax},on:{click:function(e){return n.increaseCodeFont()},mouseenter:function(e){n.onBtnHover(e,n.t("common.increase")||"Increase")},focus:function(e){n.onBtnHover(e,n.t("common.increase")||"Increase")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"action-icon",attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14m-7-7v14"}})])])]:e._e(),n.props.showCopyButton?t("button",{staticClass:"code-action-btn transition-colors",attrs:{type:"button","aria-label":n.copyText?n.t("common.copied")||"Copied":n.t("common.copy")||"Copy"},on:{click:n.copy,mouseenter:function(e){return n.onCopyHover(e)},focus:function(e){return n.onCopyHover(e)},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[n.copyText?t("svg",{staticClass:"action-icon",attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"}})]):t("svg",{staticClass:"action-icon",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("rect",{attrs:{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}}),t("path",{attrs:{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"}})])])]):e._e(),n.props.showExpandButton?t("button",{staticClass:"code-action-btn transition-colors",attrs:{type:"button","aria-pressed":n.isExpanded},on:{click:function(e){return n.toggleExpand(e)},mouseenter:function(e){n.onBtnHover(e,n.isExpanded?n.t("common.collapse")||"Collapse":n.t("common.expand")||"Expand")},focus:function(e){n.onBtnHover(e,n.isExpanded?n.t("common.collapse")||"Collapse":n.t("common.expand")||"Expand")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[n.isExpanded?t("svg",{staticClass:"action-icon",attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"}})]):t("svg",{staticClass:"action-icon",attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"}})])]):e._e(),n.isPreviewable&&n.props.showPreviewButton?t("button",{staticClass:"code-action-btn transition-colors",attrs:{type:"button","aria-label":n.t("common.preview")||"Preview"},on:{click:n.previewCode,mouseenter:function(e){n.onBtnHover(e,n.t("common.preview")||"Preview")},focus:function(e){n.onBtnHover(e,n.t("common.preview")||"Preview")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24"}},[t("g",{attrs:{fill:"currentColor","fill-rule":"evenodd","clip-rule":"evenodd"}},[t("path",{attrs:{d:"M23.628 7.41c-.12-1.172-.08-3.583-.9-4.233c-1.921-1.51-6.143-1.11-8.815-1.19c-3.481-.15-7.193.14-10.625.24a.34.34 0 0 0 0 .67c3.472-.05 7.074-.29 10.575-.09c2.471.15 6.653-.14 8.254 1.16c.4.33.41 2.732.49 3.582a42 42 0 0 1 .08 9.005a13.8 13.8 0 0 1-.45 3.001c-2.42 1.4-19.69 2.381-20.72.55a21 21 0 0 1-.65-4.632a41.5 41.5 0 0 1 .12-7.964c.08 0 7.334.33 12.586.24c2.331 0 4.682-.13 6.764-.21a.33.33 0 0 0 0-.66c-7.714-.16-12.897-.43-19.31.05c.11-1.38.48-3.922.38-4.002a.3.3 0 0 0-.42 0c-.37.41-.29 1.77-.36 2.251s-.14 1.07-.2 1.6a45 45 0 0 0-.36 8.645a21.8 21.8 0 0 0 .66 5.002c1.46 2.702 17.248 1.461 20.95.43c1.45-.4 1.69-.8 1.871-1.95c.575-3.809.602-7.68.08-11.496"}}),t("path",{attrs:{d:"M4.528 5.237a.84.84 0 0 0-.21-1c-.77-.41-1.71.39-1 1.1a.83.83 0 0 0 1.21-.1m2.632-.25c.14-.14.19-.84-.2-1c-.77-.41-1.71.39-1 1.09a.82.82 0 0 0 1.2-.09m2.88 0a.83.83 0 0 0-.21-1c-.77-.41-1.71.39-1 1.09a.82.82 0 0 0 1.21-.09m-4.29 8.735c0 .08.23 2.471.31 2.561a.371.371 0 0 0 .63-.14c0-.09 0 0 .15-1.72a10 10 0 0 0-.11-2.232a5.3 5.3 0 0 1-.26-1.37a.3.3 0 0 0-.54-.24a6.8 6.8 0 0 0-.2 2.33c-1.281-.38-1.121.13-1.131-.42a15 15 0 0 0-.19-1.93c-.16-.17-.36-.17-.51.14a20 20 0 0 0-.43 3.471c.04.773.18 1.536.42 2.272c.26.4.7.22.7-.1c0-.09-.16-.09 0-1.862c.06-1.18-.23-.3 1.16-.76m5.033-2.552c.32-.07.41-.28.39-.37c0-.55-3.322-.34-3.462-.24s-.2.18-.18.28s0 .11 0 .16a3.8 3.8 0 0 0 1.591.361v.82a15 15 0 0 0-.13 3.132c0 .2-.09.94.17 1.16a.34.34 0 0 0 .48 0c.125-.35.196-.718.21-1.09a8 8 0 0 0 .14-3.232c0-.13.05-.7-.1-.89a8 8 0 0 0 .89-.09m5.544-.181a.69.69 0 0 0-.89-.44a2.8 2.8 0 0 0-1.252 1.001a2.3 2.3 0 0 0-.41-.83a1 1 0 0 0-1.6.27a7 7 0 0 0-.35 2.07c0 .571 0 2.642.06 2.762c.14 1.09 1 .51.63.13a17.6 17.6 0 0 1 .38-3.962c.32-1.18.32.2.39.51s.11 1.081.73 1.081s.48-.93 1.401-1.78q.075 1.345 0 2.69a15 15 0 0 0 0 1.811a.34.34 0 0 0 .68 0q.112-.861.11-1.73a16.7 16.7 0 0 0 .12-3.582m1.441-.201c-.05.16-.3 3.002-.31 3.202a6.3 6.3 0 0 0 .21 1.741c.33 1 1.21 1.07 2.291.82a3.7 3.7 0 0 0 1.14-.23c.21-.22.10-.59-.41-.64q-.817.096-1.64.07c-.44-.07-.34 0-.67-4.442q.015-.185 0-.37a.316.316 0 0 0-.23-.38a.316.316 0 0 0-.38.23"}})])])]):e._e()],2)]})],2):e._e(),t("div",{directives:[{name:"show",rawName:"v-show",value:!(n.isCollapsed||!e.stream&&e.loading),expression:"!isCollapsed && (stream ? true : !loading)"}],staticClass:"code-editor-layer"},[t("div",{ref:"codeEditor",staticClass:"code-editor-container",class:[e.stream?"":"code-height-placeholder"],style:n.codeEditorContainerStyle,attrs:{"data-markstream-host-hidden":n.editorReady?void 0:"true","aria-hidden":n.editorReady?void 0:"true"}}),n.editorReady?e._e():t(n.PreCodeNode,{staticClass:"code-pre-fallback",style:n.preFallbackStyle,attrs:{node:e.node,"show-line-numbers":n.effectiveShowLineNumbers,"diff-inline":n.preFallbackDiffInline}})],1),n.showInlinePreview&&!n.hasPreviewListener&&n.isPreviewable&&"html"===n.codeLanguage?t(n.HtmlPreviewFrame,{attrs:{code:e.node.code,"html-preview-allow-scripts":n.props.htmlPreviewAllowScripts,"html-preview-sandbox":n.props.htmlPreviewSandbox,"is-dark":n.props.isDark,"on-close":()=>n.showInlinePreview=!1}}):e._e(),t("div",{directives:[{name:"show",rawName:"v-show",value:!e.stream&&e.loading,expression:"!stream && loading"}],staticClass:"code-loading-placeholder"},[e._t("loading",function(){return[t("div",{staticClass:"loading-skeleton"},[t("div",{staticClass:"skeleton-line"}),t("div",{staticClass:"skeleton-line"}),t("div",{staticClass:"skeleton-line short"})])]},{loading:e.loading,stream:e.stream})],2),t("span",{staticClass:"sr-only",attrs:{"aria-live":"polite",role:"status"}},[e._v(e._s(n.copyText?n.t("common.copied")||"Copied":""))])],1)},[],!1,null,"52efdd86",null,null).exports;function Qt(e={}){const t=m.ref(""),n=m.ref(""),o=m.ref(!1),r=p.createSmoothMarkdownStream(e),l=()=>{const e=r.getSnapshot();t.value=e.source,n.value=e.visible,o.value=e.done},i=r.subscribe(l);l();const a=m.computed(()=>Math.max(0,t.value.length-n.value.length)),s=m.computed(()=>0===a.value),u=m.computed(()=>o.value&&s.value);return m.getCurrentScope()&&m.onScopeDispose(()=>{i(),r.destroy()}),{source:t,visible:n,done:o,final:u,caughtUp:s,pendingChars:a,enqueue:e=>r.enqueue(e),finish:e=>r.finish(e),flush:()=>r.flush(),reset:e=>r.reset(e),pause:()=>r.pause(),resume:()=>r.resume()}}function Vt(e){const t="number"==typeof e?e:Number.parseFloat(String(null!=e?e:""));return Number.isFinite(t)&&t>0?t:null}function Xt(e){const t=e.split(/\r?\n/).map(e=>e.trim()).filter(e=>e&&!e.startsWith("%%")),n=Math.max(1,t.length),o=function(e){var t;for(const n of e.split(/\r?\n/)){const e=n.trim();if(!e||e.startsWith("%%"))continue;const o=e.match(/^([A-Z][\w-]*)\b/i);return(null==(t=null==o?void 0:o[1])?void 0:t.toLowerCase())||""}return""}(e);return"gantt"===o?220+28*n:"sequencediagram"===o?180+26*n:"classdiagram"===o||"statediagram"===o||"erdiagram"===o?180+24*n:"flowchart"===o||"graph"===o?170+28*n:200+22*n}function qt(e){const t=e.split(/\r?\n/).filter(e=>/^\s*-\s+/.test(e)).length;return t>=3?500:t>0?280+60*t:360}function Gt(e,t=360,n=500){return null==n?Math.max(t,e):Math.min(Math.max(t,e),n)}function Zt(e,t=360,n=500){return Gt(e,t,n)}function Jt(e,t=360,n=500){return Gt(e,t,n)}const en=M(m.defineComponent({__name:"NodeRenderer",props:{content:null,nodes:null,final:{type:Boolean},parseOptions:null,customMarkdownIt:null,debugPerformance:{type:Boolean,default:!1},customHtmlTags:null,htmlPolicy:null,viewportPriority:{type:Boolean},codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:null,codeBlockLightTheme:null,renderCodeBlocksAsPre:{type:Boolean},codeBlockMinWidth:null,codeBlockMaxWidth:null,codeBlockOptions:null,codeBlockProps:null,mermaidProps:null,d2Props:null,infographicProps:null,showTooltips:{type:Boolean,default:!0},themes:null,isDark:{type:Boolean},customId:null,indexKey:null,typewriter:{type:Boolean,default:!1},fade:{type:Boolean,default:!0},smoothStreaming:{type:[Boolean,String],default:"auto"},smoothStreamingOptions:null,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","copy-code","handleArtifactClick","click","mouseover","mouseout"],setup(e,{emit:t}){var n,o,r;const l=e;function i(e){return"undefined"!=typeof Event&&e instanceof Event}const a=m.ref(),f=m.ref(!1),h=/auto|scroll|overlay/i,g="undefined"!=typeof window,y=m.getCurrentInstance(),x=m.computed(()=>l.debugPerformance&&g&&"undefined"!=typeof console),k=m.computed(()=>{var e,t;return null!=(t=null==(e=null==y?void 0:y.proxy)?void 0:e.$attrs)?t:{}}),M=new Map,N=m.ref(0),_=Qt(l.smoothStreamingOptions),D=m.computed(()=>{var e;if("boolean"==typeof l.showTooltips)return l.showTooltips;const t=null!=(e=k.value.showTooltips)?e:k.value["show-tooltips"];return""===t||!0===t||"true"===t||!1!==t&&"false"!==t&&void 0}),j=m.inject("markstreamHtmlPolicy",void 0),E=m.inject("markstreamSmoothStreaming",void 0),B=m.computed(()=>{var e,t;return null!=(t=null!=(e=l.htmlPolicy)?e:null==j?void 0:j.value)?t:"safe"});m.provide("markstreamShowTooltips",D),m.provide("markstreamHtmlPolicy",B),m.provide("markstreamTypewriter",m.computed(()=>!0===l.typewriter)),m.provide("markstreamFade",m.computed(()=>!1!==l.fade)),m.provide("markstreamTextStreamState",M),m.provide("markstreamStreamVersion",N);const A=m.computed(()=>{var e,t;return!1!==l.smoothStreaming&&!(null==(e=l.nodes)?void 0:e.length)&&(!0===l.smoothStreaming||!(null==E?void 0:E.value))&&(!0===l.smoothStreaming||!0===l.typewriter||(null!=(t=l.maxLiveNodes)?t:0)<=0)}),O=m.ref(!g||!0===l.smoothStreaming);m.onMounted(()=>{O.value=!0});const z=m.computed(()=>O.value&&A.value);m.provide("markstreamSmoothStreaming",z);const P=m.computed(()=>{var e;return z.value?_.visible.value:null!=(e=l.content)?e:""}),R=m.computed(()=>{var e;return null!=(e=l.content)?e:""}),H=m.computed(()=>{var e;return Boolean(null==(e=l.nodes)?void 0:e.length)||_.source.value===R.value}),$=m.computed(()=>{var e,t;const n=null!=(e=l.parseOptions)?e:{};return null!=(t=l.final)?t:n.final}),U=m.computed(()=>{const e=$.value;return z.value&&null!=e?Boolean(e&&H.value&&_.caughtUp.value):e}),F=m.computed(()=>{var e;return(null==(e=l.nodes)?void 0:e.length)?l.nodes:P.value});function W(e,t){x.value&&console.info(`[markstream-vue2][perf] ${e}`,t)}function Q(e){if("undefined"==typeof window)return null;const t=null!=e?e:a.value;if(!t)return null;const n=t.ownerDocument||document,o=n.scrollingElement||n.documentElement;let r=t;for(;r&&r!==n.body&&r!==o;){const e=window.getComputedStyle(r),t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();if(h.test(t)||h.test(n))return r;r=r.parentElement}return null}m.watch([()=>l.content,()=>l.nodes,z,$],([e,t,n,o])=>{if(null==t?void 0:t.length)return void _.reset("");const r=null!=e?e:"";if(!n)return _.reset(r),void(o&&_.finish({flush:!0}));const l=_.source.value;r?r===l||(r.startsWith(l)?_.enqueue(r.slice(l.length)):_.reset(r)):_.reset(""),o&&_.finish()},{immediate:!0}),m.watch(F,()=>{N.value+=1},{immediate:!0});const V=l.customId?`renderer-${l.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,X=c.getMarkdown(V),q=new Map,G=m.markRaw([]),Z=m.computed(()=>(I.value,S(l.customId))),J=m.computed(()=>{var e;return c.mergeCustomHtmlTags(l.customHtmlTags,null==(e=l.parseOptions)?void 0:e.customHtmlTags)}),ee=m.computed(()=>{const{key:e,tags:t}=c.resolveCustomHtmlTags(J.value);if(!e)return X;const n=q.get(e);if(n)return n;const o=c.getMarkdown(V,{customHtmlTags:t});return q.set(e,o),o}),te=m.computed(()=>{const e=ee.value;return l.customMarkdownIt?l.customMarkdownIt(e):e});function ne(e){if(Array.isArray(e))return Object.freeze(e.map(e=>ne(e)));if(!e||"object"!=typeof e)return e;const t={};for(const[n,o]of Object.entries(e))t[n]=ne(o);return Object.freeze(t)}function oe(e){return e.map(e=>ne(e))}const re=m.computed(()=>{var e;const t=null!=(e=l.parseOptions)?e:{},n=U.value,o=J.value,r=null!=n,i=o.length>0;return r||i?s(s(s({},t),r?{final:n}:{}),i?{customHtmlTags:o}:{}):t}),le=m.computed(()=>{var e;const t=null!=(e=re.value.customHtmlTags)?e:[];return new Set(t.map(e=>String(e).trim().toLowerCase()).filter(Boolean))}),ie=m.computed(()=>{var e;if(w(null==y?void 0:y.proxy)&&!l.content&&Array.isArray(l.nodes))return G;if(null==(e=l.nodes)?void 0:e.length)return m.markRaw(oe(l.nodes));const t=P.value;if(t){const e=x.value?performance.now():0,n=c.parseMarkdownToStructure(t,te.value,re.value);return x.value&&W("parse(sync)",{ms:Math.round(performance.now()-e),nodes:n.length,contentLength:t.length}),m.markRaw(oe(n))}return[]}),ae=m.computed(()=>{var e;return Math.max(1,null!=(e=l.maxLiveNodes)?e:320)}),se=m.computed(()=>{var e;return!((null!=(e=l.maxLiveNodes)?e:0)<=0)&&ie.value.length>ae.value}),ue=m.computed(()=>!1!==l.viewportPriority&&!f.value),de=St(e=>{var t;return Q(null!=(t=null!=e?e:a.value)?t:null)},ue),me=g&&"function"==typeof window.requestAnimationFrame?window.requestAnimationFrame.bind(window):null,pe=g&&"function"==typeof window.cancelAnimationFrame?window.cancelAnimationFrame.bind(window):null,fe="undefined"!=typeof globalThis&&void 0!==globalThis.process&&"test"===(null==(o=null==(n=globalThis.process)?void 0:n.env)?void 0:o.NODE_ENV),ve=g&&"function"==typeof window.requestIdleCallback,he=m.computed(()=>{var e;const t=Math.trunc(null!=(e=l.renderBatchSize)?e:80);return Number.isFinite(t)?Math.max(0,t):0}),ge=m.computed(()=>{var e;const t=Math.trunc(null!=(e=l.initialRenderBatchSize)?e:he.value);return Number.isFinite(t)?Math.max(0,t):he.value}),ye=m.computed(()=>!1!==l.batchRendering&&he.value>0&&g&&!fe),we=m.ref(0),xe=m.ref({key:l.indexKey,total:0}),ke=m.ref(Math.max(1,he.value||1)),Me=m.reactive({}),Ce=new Map,Te=new Map,Ne=new Map,_e=[];m.watch(()=>ie.value.length,e=>{_e.length>e&&(_e.length=e)});const De=m.ref(0),Ie=m.computed(()=>(De.value,Array.from(Ne.entries()).sort((e,t)=>e[0]-t[0]))),Se=m.ref(null);let je=null,Ee=null;const Le=m.reactive({start:0,end:0}),Be=m.computed(()=>{if(!se.value)return ie.value.map((e,t)=>({node:e,index:t}));const e=ie.value.length,t=rt(Le.start,0,e),n=rt(Le.end,t,e);return ie.value.slice(t,n).map((e,n)=>({node:e,index:t+n}))}),Ae=m.computed(()=>{var e;return!1!==l.deferNodesUntilVisible&&!((null!=(e=l.maxLiveNodes)?e:0)<=0)&&!se.value&&!(ie.value.length>900)&&ue.value}),Oe=m.computed(()=>{var e;return ye.value&&(null!=(e=l.maxLiveNodes)?e:0)<=0}),ze=m.ref({batchSize:he.value,initial:ge.value,delay:null!=(r=l.renderBatchDelay)?r:16,enabled:Oe.value}),Pe=m.computed(()=>!!de&&(Ae.value||se.value)),He=m.computed(()=>{var e;return Math.max(0,null!=(e=l.liveNodeBuffer)?e:60)}),$e=m.ref(0),Ue=new Map,Fe=m.computed(()=>w(null==y?void 0:y.proxy)),Ye=m.computed(()=>Fe.value&&!l.content&&Array.isArray(l.nodes)),Ke=m.computed(()=>Ye.value?m.markRaw(oe(l.nodes||[])):G);function We(){var e,t;const n=null==y?void 0:y.proxy;if(!n||!n.$refs)return;const o=n.$refs,r=new Set;for(const l of Be.value){const n=Qe(o[`node-slot-${l.index}`]),i=Qe(o[`node-content-${l.index}`]);(null!=(e=Ne.get(l.index))?e:null)!==n&&cn(l.index,n),(null!=(t=Ue.get(l.index))?t:null)!==i&&pn(l.index,i),r.add(l.index)}for(const l of Array.from(Ne.keys()))r.has(l)||cn(l,null);for(const l of Array.from(Ue.keys()))r.has(l)||pn(l,null)}function Qe(e){if(Array.isArray(e)){for(const t of e)if(t)return t;return null}return null!=e?e:null}const Ve=m.computed(()=>{if(!se.value)return ie.value.length;const e=He.value,t=Math.max(Le.end+e,ge.value),n=Math.min(ie.value.length,t);return Math.max(we.value,n)});function Xe(e){var t,n,o,r;const l=Q(null!=(t=null!=e?e:a.value)?t:null);if(l)return l;const i=null!=(r=null!=(o=null==e?void 0:e.ownerDocument)?o:null==(n=a.value)?void 0:n.ownerDocument)?r:"undefined"!=typeof document?document:null;return(null==i?void 0:i.scrollingElement)||(null==i?void 0:i.documentElement)||null}function qe(e){if(!g)return!1;try{const t=window.getComputedStyle(e);return!!(t.display||"").toLowerCase().includes("flex")&&(t.flexDirection||"").toLowerCase().endsWith("reverse")}catch(t){return!1}}function Ge(e,t,n){var o,r,l,i,a,s;if(n)return null!=(i=null!=(l=null==(o=null==t?void 0:t.documentElement)?void 0:o.scrollTop)?l:null==(r=null==t?void 0:t.body)?void 0:r.scrollTop)?i:0;const u=e.scrollTop;if(!qe(e))return u;const d=u<0?-u:u;return Math.max(0,(null!=(a=e.scrollHeight)?a:0)-(null!=(s=e.clientHeight)?s:0))-d}function Ze(e,t){let n=e,o=0,r=0;for(;n&&n!==t&&r++<64;)o+=n.offsetTop||0,n=n.offsetParent;return o}function Je(){je&&(je(),je=null),Se.value=null}function et(){if(!g||!se.value)return;const e=Xe();if(!e||Se.value===e)return;Je();const t=()=>nt();e.addEventListener("scroll",t,{passive:!0}),Se.value=e,je=()=>{e.removeEventListener("scroll",t)}}function tt(){var e,t,n;if(!Ee)return;const o=null!=(n=null==(t=null==(e=a.value)?void 0:e.ownerDocument)?void 0:t.defaultView)?n:"undefined"!=typeof window?window:null;Ee.viaTimeout?o?o.clearTimeout(Ee.id):clearTimeout(Ee.id):null==pe||pe(Ee.id),Ee=null}function nt(e={}){var t,n,o;if(!se.value)return;if(!g)return void ot(!0);if(e.immediate)return tt(),void ot(!0);if(Ee)return;const r=()=>{Ee=null,ot()};if(me)Ee={id:me(r),viaTimeout:!1};else{const e=null!=(o=null==(n=null==(t=a.value)?void 0:t.ownerDocument)?void 0:n.defaultView)?o:"undefined"!=typeof window?window:null,l=e?e.setTimeout(r,16):setTimeout(r,16);Ee={id:l,viaTimeout:!0}}}function ot(e=!1){var t,n,o,r,l,i,s;if(!se.value)return;const u=Se.value||Xe();if(!u)return;const d=u.ownerDocument||(null==(t=a.value)?void 0:t.ownerDocument)||document,c=(null==d?void 0:d.defaultView)||("undefined"!=typeof window?window:null),m=u===(null==d?void 0:d.documentElement)||u===(null==d?void 0:d.body),p=ie.value.length;if(!m&&p>0&&qe(u)){const t=u.clientHeight||0,n=u.scrollTop,o=n<0?-n:n,r=rt(ln(Math.max(0,o)+.5*Math.max(0,t)),0,Math.max(0,p-1));return void((e||Math.abs(r-$e.value)>1)&&($e.value=r))}const f=m?null:u.getBoundingClientRect(),v=m?0:f.top,h=m?null!=(o=null!=(n=null==c?void 0:c.innerHeight)?n:u.clientHeight)?o:0:f.bottom,g=Ie.value;let y=null,w=null;for(const[a,k]of g){if(!k)continue;const e=k.getBoundingClientRect();e.bottom<=v||e.top>=h||(null==y&&(y=a),w=a)}if(null==y||null==w){const e=a.value;if(!e)return;const t=m?{top:0}:u.getBoundingClientRect(),n=Ge(u,d,m),o=m?(()=>{const n=e.getBoundingClientRect(),o=(m?0:t.top)-n.top;return Math.max(0,o)})():(()=>{const t=Ze(e,u);return Math.max(0,n-t)})(),p=m?null!=(s=null!=(i=null!=(l=null==c?void 0:c.innerHeight)?l:null==(r=null==d?void 0:d.documentElement)?void 0:r.clientHeight)?i:u.clientHeight)?s:0:u.clientHeight,f=rn(o+.5*Math.max(0,p));return void($e.value=rt(f,0,Math.max(0,ie.value.length-1)))}const x=Math.round((y+w)/2);!e&&Math.abs(x-$e.value)<=1||($e.value=rt(x,0,Math.max(0,ie.value.length-1)))}function rt(e,t,n){return Math.min(Math.max(e,t),n)}function lt(){const e=ie.value.length;if(!se.value||0===e)return Le.start=0,void(Le.end=e);const t=Math.min(ae.value,e),n=He.value,o=rt($e.value-n,0,Math.max(0,e-t));Le.start=o,Le.end=Math.min(e,o+t)}const it=m.reactive({}),at=m.reactive({total:0,count:0}),st=m.ref(0),ut=m.ref([]),ct=m.ref([]);function It(){for(const e of Object.keys(it))delete it[Number(e)];at.total=0,at.count=0,st.value=0,ut.value=[],ct.value=[]}function jt(e){if(e<=0)return void It();let t=0,n=0;for(const[o,r]of Object.entries(it)){const l=Number(o),i=Number(r);!Number.isFinite(l)||l<0||l>=e||!Number.isFinite(i)||i<=0?delete it[l]:(t+=i,n++)}at.total=t,at.count=n}function Pt(e,t,n){for(let o=t+1;o<e.length;o+=o&-o)e[o]+=n}function Ut(e,t){let n=0;for(let o=t+1;o>0;o-=o&-o)n+=e[o];return n}function Ft(e,t,n){if(n<=t)return 0;const o=Ut(e,n-1);return t<=0?o:o-Ut(e,t-1)}function Yt(e){st.value=e;const t=new Array(e+1).fill(0),n=new Array(e+1).fill(0);for(const[o,r]of Object.entries(it)){const l=Number(o),i=Number(r);!Number.isFinite(l)||l<0||l>=e||!Number.isFinite(i)||i<=0||(Pt(t,l,i),Pt(n,l,1))}ut.value=t,ct.value=n}function Kt(e,t){if(!Number.isFinite(t)||t<=0)return;const n=it[e];if(it[e]=t,n?at.total+=t-n:(at.total+=t,at.count++),st.value>e){const o=ut.value,r=ct.value;if(o.length&&r.length)if(n){const r=t-n;0!==r&&Pt(o,e,r)}else Pt(o,e,t),Pt(r,e,1)}}const Gt=m.computed(()=>at.count>0?Math.max(12,at.total/at.count):32);function en(e,t){var n,o;if(e>=t)return 0;if(st.value!==ie.value.length){let o=0;for(let r=e;r<t;r++)o+=null!=(n=it[r])?n:Gt.value;return o}const r=ut.value,l=ct.value;if(!r.length||!l.length){let n=0;for(let r=e;r<t;r++)n+=null!=(o=it[r])?o:Gt.value;return n}return Ft(r,e,t)+(t-e-Ft(l,e,t))*Gt.value}m.watch(()=>ie.value.length,e=>{e<=0?It():(e<st.value&&jt(e),e!==st.value&&Yt(e))},{immediate:!0});const nn=m.computed(()=>se.value?en(0,Math.min(Le.start,ie.value.length)):0),on=m.computed(()=>{if(!se.value)return 0;const e=ie.value.length;return en(Math.min(Le.end,e),e)});function rn(e){var t;if(e<=0)return 0;const n=ie.value;if(st.value===n.length&&ut.value.length&&ct.value.length){const t=Gt.value,o=ut.value,r=ct.value,l=e=>e<=0?0:Ut(o,e-1)+(e-Ut(r,e-1))*t;let i=0,a=n.length-1,s=n.length-1;for(;i<=a;){const t=i+a>>1;l(t+1)>=e?(s=t,a=t-1):i=t+1}return s}let o=e;for(let r=0;r<n.length;r++){const e=null!=(t=it[r])?t:Gt.value;if(o<=e)return r;o-=e}return Math.max(0,n.length-1)}function ln(e){var t;const n=ie.value;if(!n.length)return 0;if(e<=0)return Math.max(0,n.length-1);if(st.value===n.length){const t=en(0,n.length);return rn(Math.max(0,t-e))}let o=e;for(let r=n.length-1;r>=0;r--){const e=null!=(t=it[r])?t:Gt.value;if(o<=e)return r;o-=e}return 0}function an(e){if(!Ce.size)return;if(!se.value)return;let t=!1;for(const[n,o]of Ce)n>=e&&(o.destroy(),Ce.delete(n),Ae.value&&delete Me[n],xn(n),Ne.delete(n)&&(t=!0));t&&mn()}function sn(e,t){Ae.value&&(Me[e]=t),t&&(se.value?nt():$e.value=rt(e,0,Math.max(0,ie.value.length-1)))}function dn(e){const t=Ce.get(e);t&&(t.destroy(),Ce.delete(e)),xn(e)}function cn(e,t){let n=!1;if(t){const o=Ne.get(e);Ne.set(e,t),o!==t&&(n=!0)}else Ne.delete(e)&&(n=!0);if(n&&mn(),t||xn(e),!Pe.value||!de)return dn(e),void(t?sn(e,!0):Ae.value&&delete Me[e]);if(!se.value&&Ae.value&&!f.value&&Ce.size>=640&&(Mn("too-many-targets"),!Pe.value||!de))return dn(e),void(t?sn(e,!0):Ae.value&&delete Me[e]);if(e<ge.value&&!se.value)return dn(e),void sn(e,!0);if(!t)return dn(e),void(Ae.value&&delete Me[e]);dn(e);const o=de(t,{rootMargin:"400px"});o&&(Ce.set(e,o),sn(e,o.isVisible.value),Ae.value&&kn(e),o.whenVisible.then(()=>{xn(e),sn(e,!0)}).catch(()=>{}).finally(()=>{Ce.get(e)===o&&Ce.delete(e);try{o.destroy()}catch(t){}}),se.value&&nt())}function mn(){De.value+=1}function pn(e,t){t?(Ue.set(e,t),queueMicrotask(()=>{Kt(e,t.offsetHeight)})):Ue.delete(e)}m.onMounted(()=>{g&&m.nextTick(We)}),m.watch(Be,()=>{g&&m.nextTick(We)}),m.watch(we,()=>{g&&m.nextTick(We)}),m.watch(se,()=>{g&&m.nextTick(We)});let fn=null,vn=null,hn=!1,gn=null,yn=null;function wn(){g&&(null!=fn&&(null==pe||pe(fn),fn=null),null!=vn&&(window.clearTimeout(vn),vn=null),null!=yn&&"function"==typeof window.cancelIdleCallback&&(window.cancelIdleCallback(yn),yn=null),hn=!1,gn=null)}function xn(e){if(!g)return;const t=Te.get(e);null!=t&&(window.clearTimeout(t),Te.delete(e))}function kn(e){if(!g||!Ae.value)return;xn(e);const t=e%17*23,n=window.setTimeout(()=>{var t,n;if(Te.delete(e),!Ae.value)return;if(!0===Me[e])return;const o=Ne.get(e);if(!o)return void delete Me[e];const r=Xe(o),l=o.ownerDocument||document,i=l.defaultView||window,a=!r||r===l.documentElement||r===l.body,s=!a&&r?r.getBoundingClientRect():null,u=a?0:s.top,d=a?null!=(n=null!=(t=i.innerHeight)?t:null==r?void 0:r.clientHeight)?n:0:s.bottom,c=o.getBoundingClientRect();c.bottom>=u-500&&c.top<=d+500&&sn(e,!0)},1800+t);Te.set(e,n)}function Mn(e){var t;if(!f.value){f.value=!0,void 0!=={url:"undefined"==typeof document?require("url").pathToFileURL(__filename).href:v&&"SCRIPT"===v.tagName.toUpperCase()&&v.src||new URL("index.cjs",document.baseURI).href}&&(null==(t={BASE_URL:"/",MODE:"npm",DEV:!1,PROD:!0,SSR:!1})?void 0:t.DEV)&&"undefined"!=typeof console&&console.warn("[markstream-vue2] viewportPriority auto-disabled:",e);for(const e of Ce.values())e.destroy();if(Ce.clear(),g)for(const e of Te.values())window.clearTimeout(e);Te.clear();for(const e of Object.keys(Me))delete Me[e]}}function bn(e,t={}){var n,o;if(!Oe.value)return;const r=Ve.value;if(we.value>=r)return;const i=Math.max(1,e),a=e=>{var t;fn=null,vn=null,yn=null,hn=!1;const n=null!=gn?gn:i;gn=null;const o=Math.max(2,null!=(t=l.renderBatchBudgetMs)?t:6),a=e=>{const t="undefined"!=typeof performance?performance.now():Date.now();we.value=Math.min(r,we.value+Math.max(1,e)),an(we.value);const n=("undefined"!=typeof performance?performance.now():Date.now())-t;return Tn(n),n};let s=n;for(;(a(s),!(we.value>=r)&&e)&&!(("function"==typeof e.timeRemaining?e.timeRemaining():0)<=.5*o);)s=Math.max(1,Math.round(ke.value));we.value<r&&Cn()};if(!g||t.immediate)return void a();const s=Math.max(0,null!=(n=l.renderBatchDelay)?n:16);if(gn=null!=gn?Math.max(gn,i):i,!hn){if(hn=!0,!fe&&ve&&window.requestIdleCallback){const e=Math.max(0,null!=(o=l.renderBatchIdleTimeoutMs)?o:120);return void(yn=window.requestIdleCallback(e=>{a(e)},{timeout:e}))}me&&!fe?fn=me(()=>{0!==s?vn=window.setTimeout(()=>a(),s):a()}):vn=window.setTimeout(()=>a(),s)}}function Cn(){Oe.value&&bn(ye.value?Math.max(1,Math.round(ke.value)):Math.max(1,he.value))}function Tn(e){var t;if(!Oe.value)return;const n=Math.max(2,null!=(t=l.renderBatchBudgetMs)?t:6),o=Math.max(1,he.value||1),r=Math.max(1,Math.floor(o/4));e>1.2*n?ke.value=Math.max(r,Math.floor(.7*ke.value)):e<.5*n&&ke.value<o&&(ke.value=Math.min(o,Math.ceil(1.2*ke.value)))}m.watch([()=>ie.value,()=>ie.value.length,()=>Oe.value,()=>he.value,()=>ge.value,()=>l.renderBatchDelay,()=>l.indexKey],()=>{var e;const t=ie.value.length,n=xe.value,o=l.indexKey,r=void 0!==o&&o!==n.key,i=t!==n.total,a=r||i;xe.value={key:o,total:t};const s=ze.value,u=null!=(e=l.renderBatchDelay)?e:16,d=s.batchSize!==he.value||s.initial!==ge.value||s.delay!==u||s.enabled!==Oe.value;ze.value={batchSize:he.value,initial:ge.value,delay:u,enabled:Oe.value},(a||d||!Oe.value)&&wn(),(a||d)&&(ke.value=Math.max(1,he.value||1)),a&&se.value&&nt({immediate:!0});const c=Ve.value;if(!t)return 0!==we.value&&(we.value=0),void an(0);if(!Oe.value)return we.value!==c&&(we.value=c),void an(we.value);if(r||0===n.total||d){const e=Math.min(c,ge.value);we.value!==e&&(we.value=e)}else{const e=Math.min(we.value,c);we.value!==e&&(we.value=e)}const m=Math.max(1,ge.value||he.value||t);we.value<c?bn(m,{immediate:!g}):an(we.value)},{immediate:!0}),m.watch(()=>se.value,e=>{if(!e)return Je(),void tt();et(),nt({immediate:!0})},{immediate:!0}),m.watch([()=>ie.value.length,()=>se.value],e=>d(this,[e],function*([e,t]){t&&e&&g&&(yield m.nextTick(),nt({immediate:!0}))}),{flush:"post"}),m.watch(()=>a.value,()=>{se.value&&(et(),nt({immediate:!0}))}),m.watch(()=>ie.value.length,()=>{se.value&&nt({immediate:!0})}),m.watch(()=>Ae.value,e=>{if(e)for(const[t,n]of Ne)cn(t,n);else{for(const e of Ce.values())e.destroy();Ce.clear();for(const e of Array.from(Te.keys()))xn(e);for(const e of Object.keys(Me))delete Me[e];for(const[e,t]of Ne)t&&sn(e,!0)}},{immediate:!1}),m.watch([()=>l.viewportPriority,()=>ie.value.length],([e,t])=>{!1!==e?f.value&&t<=200&&(f.value=!1):f.value=!1}),m.watch(()=>we.value,()=>{se.value&&nt({immediate:!0})}),m.watch([$e,ae,He,()=>ie.value.length,se],()=>{lt()},{immediate:!0}),m.watch([()=>ie.value.length,se,ae,He,()=>Le.start,()=>Le.end],([e,t,n,o,r,l])=>{x.value&&W("virtualization",{nodes:e,virtualization:t,maxLiveNodes:n,buffer:o,focusIndex:$e.value,scroll:t?(()=>{const e=Se.value||Xe();return e?{reverse:qe(e),scrollTop:Math.round(e.scrollTop),scrollTopAbs:Math.round(Math.abs(e.scrollTop)),scrollHeight:Math.round(e.scrollHeight),clientHeight:Math.round(e.clientHeight)}:null})():null,liveRange:{start:r,end:l},rendered:we.value})}),m.watch(()=>Ve.value,(e,t)=>{Oe.value&&("number"==typeof t&&e<=t||e>we.value&&Cn())}),m.onBeforeUnmount(()=>{wn();for(const e of Ce.values())e.destroy();Ce.clear();for(const e of Array.from(Te.keys()))xn(e);Je(),tt(),To()});const Nn={name:"MermaidBlockNodeLoading",props:{estimatedPreviewHeightPx:Number,isDark:Boolean,showHeader:{type:Boolean,default:!0}},render(e){var t;const n="function"==typeof e?e:m.h,o="function"==typeof e?{attrs:{"data-markstream-mermaid":"1","data-markstream-mode":"pending"}}:{"data-markstream-mermaid":"1","data-markstream-mode":"pending"},r=`${null!=(t=Vt(this.estimatedPreviewHeightPx))?t:360}px`;return n("div",u(s({},o),{class:["my-4 rounded-lg border overflow-hidden shadow-sm",this.isDark?"border-gray-700/30":"border-gray-200"]}),[!1===this.showHeader?null:n("div",{class:["mermaid-block-header flex justify-between items-center px-4 py-2.5 border-b",this.isDark?"bg-gray-800 border-gray-700/30":"bg-gray-50 border-gray-200"]},[n("div",{class:"flex items-center gap-x-2 overflow-hidden"},[n("span",{class:this.isDark?"text-sm font-medium font-mono truncate text-gray-400":"text-sm font-medium font-mono truncate text-gray-600"},"Mermaid")])]),n("div",{class:["mermaid-preview-area min-h-[360px] relative overflow-hidden block",this.isDark?"bg-gray-900":"bg-gray-50"],style:{height:r}})])}},_n=m.ref(null);let Dn=null;function In(){_n.value||Dn||(Dn=Promise.resolve().then(()=>require("./chunks/index-6013a5b2.cjs")).then(e=>{var t;return null!=(t=e.default)?t:e}).then(e=>{_n.value=e}).catch(e=>{console.warn('[markstream-vue2] Optional peer dependencies for MermaidBlockNode are missing. Falling back to preformatted code rendering. To enable Mermaid rendering, please install "mermaid".',e),_n.value=dt}))}function Sn(){return In(),_n.value||Nn}const jn={name:"InfographicBlockNodeLoading",props:{estimatedPreviewHeightPx:Number,isDark:Boolean,showHeader:{type:Boolean,default:!0}},render(e){var t;const n="function"==typeof e?e:m.h,o="function"==typeof e?{attrs:{"data-markstream-infographic":"1","data-markstream-mode":"pending"}}:{"data-markstream-infographic":"1","data-markstream-mode":"pending"},r=`${null!=(t=Vt(this.estimatedPreviewHeightPx))?t:360}px`;return n("div",u(s({},o),{class:["my-4 rounded-lg border overflow-hidden shadow-sm",this.isDark?"border-gray-700/30":"border-gray-200"]}),[!1===this.showHeader?null:n("div",{class:["infographic-block-header flex justify-between items-center px-4 py-2.5 border-b",this.isDark?"bg-gray-800 border-gray-700/30":"bg-gray-50 border-gray-200"]},[n("div",{class:"flex items-center gap-x-2 overflow-hidden"},[n("span",{class:this.isDark?"text-sm font-medium font-mono truncate text-gray-400":"text-sm font-medium font-mono truncate text-gray-600"},"Infographic")])]),n("div",{class:["infographic-preview min-h-[360px] relative overflow-hidden block",this.isDark?"bg-gray-900":"bg-gray-50"],style:{height:r}})])}},En=m.ref(null);let Ln=null;function Bn(){En.value||Ln||(Ln=Promise.resolve().then(()=>require("./chunks/index-e0125777.cjs")).then(e=>{var t;return null!=(t=e.default)?t:e}).then(e=>{En.value=e}).catch(e=>{console.warn("[markstream-vue2] Optional peer dependencies for InfographicBlockNode are missing. Falling back to preformatted code rendering.",e),En.value=dt}))}function An(){return Bn(),En.value||jn}function On(){return d(this,null,function*(){var e;try{const t=yield Promise.resolve().then(()=>un);return null!=(e=t.default)?e:t}catch(t){return console.warn('[markstream-vue2] Optional peer dependencies for D2BlockNode are missing. Falling back to preformatted code rendering. To enable D2 rendering, please install "@terrastruct/d2".',t),dt}})}const zn=m.computed(()=>l.renderCodeBlocksAsPre?dt:Wt),Pn={text:be,paragraph:Lt,heading:Nt,code_block:Wt,list:Dt,list_item:_t,blockquote:$t,table:Bt,definition_list:C,footnote:Ct,footnote_reference:L,footnote_anchor:bt,admonition:tn,vmr_container:zt,hardbreak:Tt,link:wt,image:ce,thematic_break:At,math_inline:mt,math_block:pt,strong:gt,emphasis:Mt,strikethrough:yt,highlight:kt,insert:xt,subscript:ht,superscript:vt,emoji:T,checkbox:b,checkbox_input:b,inline_code:K,html_inline:Y,reference:ft,html_block:Et},Rn=m.computed(()=>null!=l.indexKey?String(l.indexKey):"markdown-renderer"),Hn=m.computed(()=>Rt(l.codeBlockProps)),$n=m.computed(()=>Rt(l.codeBlockProps)),Un=m.computed(()=>u(s(s({stream:l.codeBlockStream,darkTheme:l.codeBlockDarkTheme,lightTheme:l.codeBlockLightTheme,themes:l.themes,minWidth:l.codeBlockMinWidth,maxWidth:l.codeBlockMaxWidth},"boolean"==typeof l.showTooltips?{showTooltips:l.showTooltips}:{}),$n.value),{codeBlockOptions:l.codeBlockOptions})),Fn=m.computed(()=>u(s(s({},Un.value),Hn.value),{codeBlockOptions:l.codeBlockOptions}));function Yn(e){const t=String(null!=e?e:"").replace(/(?:\r\n|\n|\r)$/,"");return t?t.split(/\r\n|\n|\r/).length:1}function Kn(e){var t,n,o,r,i,a,s;const u=null!=(n=null==(t=l.codeBlockOptions)?void 0:t.lineHeight)?n:18,d=Boolean(e.diff),c=Wn($n.value.diffInline),m=d&&(null!=c?c:"unified"===(null==(o=l.codeBlockOptions)?void 0:o.diffStyle)),p=d?m?Yn(e.originalCode)+Yn(e.updatedCode):Math.max(Yn(e.originalCode),Yn(e.updatedCode)):Yn(e.code),f=d?0:8,v=null!=(i=null==(r=l.codeBlockOptions)?void 0:r.padding)?i:f,h=v,g=v,y=null!=(s=null==(a=l.codeBlockOptions)?void 0:a.maxHeight)?s:500,w=Math.max(1,Math.min(y,Math.round(p*u+h+g)));return{estimatedContentHeightPx:w,estimatedHeightPx:w+(!1!==$n.value.showHeader?41:0)+2,estimatedDiffInline:m}}function Wn(e){return"boolean"==typeof e?e:void 0}const Qn=m.computed(()=>{var e,t;const n=l.codeBlockProps||{},o={},r=Wn(n.showLineNumbers),i=null==(e=l.codeBlockOptions)?void 0:e.disableLineNumbers;o.showLineNumbers=null!=r?r:"boolean"==typeof i&&!i,(null==(t=l.codeBlockOptions)?void 0:t.overflow)&&(o.style={whiteSpace:"scroll"===l.codeBlockOptions.overflow?"pre":"pre-wrap"});const a=Wn(n.diffInline);return void 0!==a&&(o.diffInline=a),o}),Vn=m.computed(()=>s({},l.mermaidProps||{})),Xn=m.computed(()=>s({},l.d2Props||{})),qn=m.computed(()=>s({},l.infographicProps||{})),Gn=m.computed(()=>({typewriter:l.typewriter,fade:l.fade,customHtmlTags:re.value.customHtmlTags,htmlPolicy:B.value})),Zn=m.computed(()=>s(s({},Gn.value),"boolean"==typeof l.showTooltips?{showTooltip:l.showTooltips}:{})),Jn=m.computed(()=>s(s({},Gn.value),"boolean"==typeof l.showTooltips?{showTooltips:l.showTooltips}:{})),eo=m.computed(()=>Ke.value.map((e,t)=>{var n,o,r,l;const i=oo(e,t),a=ro(i);let d=i,m=co(i,a);if(("html_block"===i.type||"html_inline"===i.type)&&m===Pn[i.type]){const e=String(null!=(n=i.tag)?n:"").trim().toLowerCase()||c.getHtmlTagFromContent(i.content);if(e)if(le.value.has(e)){const t=Z.value[e];t&&(m=t,d=u(s({},i),{type:e,tag:e,content:c.stripCustomHtmlWrapper(i.content,e)}))}else if(c.shouldRenderUnknownHtmlTagAsText(null!=(o=i.content)?o:i.raw,e)){const e=String(null!=(l=null!=(r=i.content)?r:i.raw)?l:"");"html_inline"===i.type?(m=be,d={type:"text",content:e,raw:e}):(m=Lt,d={type:"paragraph",children:[{type:"text",content:e,raw:e}],raw:e})}}return{node:d,component:m,bindings:fo(d,a,m),isCodeBlock:"code_block"===d.type,index:t,indexKey:`${Rn.value}-${t}`,renderKey:ao(d,t)}})),to=m.computed(()=>!(!Fe.value||!l.content)&&ie.value.some(e=>io(e))),no=m.computed(()=>Be.value.map(e=>{var t,n,o,r;let l=oo(e.node,e.index);const i=ro(l);let a=co(l,i);if(("html_block"===l.type||"html_inline"===l.type)&&a===Pn[l.type]){const e=String(null!=(t=l.tag)?t:"").trim().toLowerCase()||c.getHtmlTagFromContent(l.content);if(e)if(le.value.has(e)){const t=Z.value[e];t&&(a=t,l=u(s({},l),{type:e,tag:e,content:c.stripCustomHtmlWrapper(l.content,e)}))}else if(c.shouldRenderUnknownHtmlTagAsText(null!=(n=l.content)?n:l.raw,e)){const e=String(null!=(r=null!=(o=l.content)?o:l.raw)?r:"");"html_inline"===l.type?(a=be,l={type:"text",content:e,raw:e}):(a=Lt,l={type:"paragraph",children:[{type:"text",content:e,raw:e}],raw:e})}}return u(s({},e),{node:l,component:a,bindings:fo(l,i,a),isCodeBlock:"code_block"===l.type,indexKey:`${Rn.value}-${e.index}`,renderKey:ao(l,e.index)})}));function oo(e,t){var n,o;if("code_block"!==e.type)return _e[t]=void 0,e;const r=e,l=[r.language,r.loading,r.diff,r.code,r.originalCode,r.updatedCode,r.raw,r.startLine,r.endLine,null==(n=r.sourceMap)?void 0:n.startLine,null==(o=r.sourceMap)?void 0:o.endLine],i=_e[t];if(i&&l.every((e,t)=>e===i.signature[t]))return i.node;const a=s({},r);return _e[t]={signature:l,node:a},a}function ro(e){var t;return"code_block"===(null==e?void 0:e.type)?String(null!=(t=e.language)?t:"").trim().toLowerCase():""}function lo(e,t){const n=t.trim().toLowerCase();if(n)for(const o of[n,Re(n),p.normalizeShikiLanguage(n)]){const t=o&&e[o];if(t)return t}}function io(e){if(!e)return!1;const t=String(e.type||"");return!!["blockquote","list","list_item","table","definition_list","footnote","admonition"].includes(t)||Array.isArray(e.items)||Array.isArray(e.rows)||Array.isArray(e.children)&&!1===["paragraph","heading","text"].includes(t)}function ao(e,t){const n=`${Rn.value}-${t}`;if(!e)return n;const o=String(e.type||"unknown");if("code_block"===o)return n;const r=!0===e.loading,l="string"==typeof e.raw?e.raw.length:0,i="string"==typeof e.content?e.content.length:0,a=Array.isArray(e.children)?e.children.length:0,s=Array.isArray(e.items)?e.items.length:0,u=Array.isArray(e.rows)?e.rows.length:0;return(Fe.value||r)&&(r||a>0||s>0||u>0)?`${n}-${o}-${r?"l":"r"}-${l}-${i}-${a}-${s}-${u}`:n}function so(e){var t,n;const o=s({},Vn.value);return null==Vt(o.estimatedPreviewHeightPx)&&(o.estimatedPreviewHeightPx=Zt(Xt(String(null!=(t=null==e?void 0:e.code)?t:"")),void 0,"none"===o.maxHeight?null:null!=(n=Vt(o.maxHeight))?n:void 0)),o}function uo(e){var t,n;const o=s({},qn.value);return null==Vt(o.estimatedPreviewHeightPx)&&(o.estimatedPreviewHeightPx=Jt(qt(String(null!=(t=null==e?void 0:e.code)?t:"")),void 0,"none"===o.maxHeight?null:null!=(n=Vt(o.maxHeight))?n:void 0)),o}function co(e,t){if(!e)return Ot;const n=Z.value,o=n[String(e.type)];if("code_block"===e.type){const r=null!=t?t:ro(e),l=r?lo(n,r):void 0;if(l)return l;if("mermaid"===r)return n.mermaid||Sn();if("infographic"===r)return n.infographic||An();if("d2"===r||"d2lang"===r)return n.d2||On;if(o)return o;return n.code_block||zn.value}return o||Pn[String(e.type)]||Ot}function mo(e){return Boolean(e&&e===Z.value.code_block)}function po(e,t){return Boolean(e&&t&&e===lo(Z.value,t))}function fo(e,t,n){const o=null!=t?t:ro(e);return"code_block"===e.type&&po(n,o)?"mermaid"===o?so(e):"infographic"===o?uo(e):"d2"===o||"d2lang"===o?Xn.value:Fn.value:"code_block"===e.type&&mo(n)?Fn.value:"code_block"===e.type&&l.renderCodeBlocksAsPre&&n===dt?Qn.value:"mermaid"===o?so(e):"infographic"===o?uo(e):"d2"===o||"d2lang"===o?Xn.value:"link"===e.type?Zn.value:"list"===e.type?Jn.value:"code_block"===e.type?n===Wt?s(s({},Un.value),Kn(e)):Un.value:Gn.value}const vo=m.computed(()=>Array.isArray(l.nodes)&&l.nodes.length>0),ho=m.ref(null),go=m.ref(!1);let yo,wo=0;const xo=new Set(["code_block","admonition","table","math_block","html_block","image"]);function ko(e){if(!e||"object"!=typeof e)return!1;const t=e.type;return"string"==typeof t&&xo.has(t)}function Mo(){return!ko(ie.value[ie.value.length-1])}function bo(e){var t,n;if(!e||"object"!=typeof e)return 0;const o=e,r=null!=(n=null!=(t=o.raw)?t:o.content)?n:o.code;if("string"==typeof r)return r.length;const l=o.children;if(Array.isArray(l))return l.reduce((e,t)=>e+bo(t),0);const i=o.items;return Array.isArray(i)?i.reduce((e,t)=>e+bo(t),0):0}function Co(){var e;return(null==(e=l.nodes)?void 0:e.length)?l.nodes.reduce((e,t)=>e+bo(t),0):R.value.length}function To(){yo&&(clearTimeout(yo),yo=void 0)}function No(e){const t=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode(e){var t;if(!(null!=(t=e.textContent)?t:"").trim())return NodeFilter.FILTER_REJECT;const n=e.parentElement;return n?n.closest('.typewriter-cursor, .height-estimation-probes, [data-node-type="code_block"], [data-node-type="admonition"], [data-node-type="table"], [data-node-type="math_block"], [data-node-type="html_block"], [data-node-type="image"], script, style')?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}});let n=null,o=t.nextNode();for(;o;)n=o,o=t.nextNode();return n}function _o(){var e,t;if("undefined"==typeof window||!go.value||!a.value||!ho.value)return;const n=a.value,o=ho.value,r=No(n),l=n.getBoundingClientRect();let i=0,s=0,u=20;if(null==r?void 0:r.textContent){const o=document.createRange(),a=r.textContent.length;o.setStart(r,Math.max(0,a-1)),o.setEnd(r,a);const d="function"==typeof o.getClientRects?o.getClientRects():void 0,c=null!=(t=null==d?void 0:d[d.length-1])?t:null==(e=r.parentElement)?void 0:e.getBoundingClientRect();c&&(i=c.right-l.left+n.scrollLeft,s=c.top-l.top+n.scrollTop,u=c.height||u),o.detach()}o.style.transform=`translate(${Math.max(0,i)}px, ${Math.max(0,s)}px)`,o.style.height=`${u}px`}return m.watch([P,R,()=>l.nodes,()=>l.typewriter,U],()=>d(this,null,function*(){if("undefined"==typeof window||vo.value)return;if(U.value)return go.value=!1,void To();const e=Co(),t=Mo();if(!1===l.typewriter||!t||e<=wo)return!1!==l.typewriter&&t||(go.value=!1),void(wo=e);wo=e,go.value=!0,To(),yield m.nextTick(),_o(),yo=setTimeout(()=>{go.value=!1},3e3)}),{flush:"post",immediate:!0}),m.watch(go,e=>d(this,null,function*(){e&&(yield m.nextTick(),_o())}),{flush:"post"}),{__sfc:!0,props:l,emit:t,isNativeDomEvent:i,emitCodeCopy:function(e){if(!i(e))return"string"==typeof e?(t("copy-code",e),void t("copy",e)):void t("copy",e)},MAX_DEFERRED_NODE_COUNT:900,MAX_VIEWPORT_OBSERVER_TARGETS:640,VIEWPORT_PRIORITY_RECOVERY_COUNT:200,containerRef:a,viewportPriorityAutoDisabled:f,SCROLL_PARENT_OVERFLOW_RE:h,isClient:g,instance:y,debugPerformanceEnabled:x,attrs:k,textStreamState:M,streamRenderVersion:N,smoothStream:_,resolvedShowTooltips:D,inheritedHtmlPolicy:j,inheritedSmoothStreaming:E,resolvedHtmlPolicy:B,smoothStreamingEligible:A,hasMountedForSmoothStreaming:O,smoothStreamingEnabled:z,renderContent:P,rawContent:R,smoothSourceSynced:H,requestedFinal:$,effectiveFinal:U,renderVersionSource:F,logPerf:W,resolveViewportRoot:Q,instanceMsgId:V,defaultMd:X,customTagCache:q,EMPTY_PARSED_NODES:G,customComponentsMap:Z,effectiveCustomHtmlTags:J,mdBase:ee,mdInstance:te,cloneNodeValue:ne,cloneParsedNodeList:oe,mergedParseOptions:re,effectiveCustomHtmlTagsSet:le,parsedNodes:ie,maxLiveNodesResolved:ae,virtualizationEnabled:se,viewportPriorityEnabled:ue,registerNodeVisibility:de,requestFrame:me,cancelFrame:pe,isTestEnv:fe,hasIdleCallback:ve,resolvedBatchSize:he,resolvedInitialBatch:ge,batchingEnabled:ye,renderedCount:we,previousRenderContext:xe,adaptiveBatchSize:ke,nodeVisibilityState:Me,nodeVisibilityHandles:Ce,nodeVisibilityFallbackTimers:Te,nodeSlotElements:Ne,codeBlockRenderCache:_e,nodeSlotVersion:De,sortedNodeSlots:Ie,scrollRootElement:Se,detachScrollHandler:je,pendingFocusSync:Ee,liveRange:Le,visibleNodes:Be,deferNodes:Ae,incrementalRenderingActive:Oe,previousBatchConfig:ze,shouldObserveSlots:Pe,liveNodeBufferResolved:He,focusIndex:$e,nodeContentElements:Ue,legacyVue26:Fe,legacyNodesMode:Ye,legacyNodeItems:Ke,syncNodeRefs:We,resolveTemplateRef:Qe,desiredRenderedCount:Ve,resolveScrollContainer:Xe,isReverseFlexScrollRoot:qe,getNormalizedScrollTop:Ge,getOffsetTopWithinRoot:Ze,cleanupScrollListener:Je,setupScrollListener:et,cancelScheduledFocusSync:tt,scheduleFocusSync:nt,syncFocusToScroll:ot,clamp:rt,updateLiveRange:lt,nodeHeights:it,heightStats:at,heightTreeSize:st,heightSumTree:ut,heightKnownTree:ct,resetHeightMeasurements:It,pruneHeightMeasurements:jt,fenwickUpdate:Pt,fenwickQuery:Ut,fenwickRangeSum:Ft,rebuildHeightTrees:Yt,recordNodeHeight:Kt,averageNodeHeight:Gt,estimateHeightRange:en,topSpacerHeight:nn,bottomSpacerHeight:on,estimateIndexForOffset:rn,estimateIndexForOffsetFromEnd:ln,cleanupNodeVisibility:an,markNodeVisible:sn,shouldRenderNode:function(e){return!(Oe.value&&e>=we.value)&&(!Ae.value||e<ge.value||!0===Me[e])},destroyNodeHandle:dn,setNodeSlotElement:cn,bumpNodeSlotVersion:mn,setNodeContentRef:pn,batchRaf:fn,batchTimeout:vn,batchPending:hn,pendingIncrement:gn,batchIdle:yn,VIEWPORT_FALLBACK_DELAY:1800,VIEWPORT_FALLBACK_MARGIN_PX:500,cancelBatchTimers:wn,clearVisibilityFallback:xn,scheduleVisibilityFallback:kn,autoDisableViewportPriority:Mn,scheduleBatch:bn,queueNextBatch:Cn,adjustAdaptiveBatchSize:Tn,MermaidBlockNodeLoading:Nn,mermaidBlockNodeComponent:_n,mermaidBlockNodeImport:Dn,loadMermaidBlockNode:In,resolveMermaidBlockNodeComponent:Sn,InfographicBlockNodeLoading:jn,infographicBlockNodeComponent:En,infographicBlockNodeImport:Ln,loadInfographicBlockNode:Bn,resolveInfographicBlockNodeComponent:An,D2BlockNodeAsync:On,codeBlockComponent:zn,nodeComponents:Pn,indexPrefix:Rn,codeBlockExtraProps:Hn,builtinCodeBlockExtraProps:$n,codeBlockBindings:Un,customCodeBlockBindings:Fn,countCodeLines:Yn,estimateBuiltinCodeBlockHeight:Kn,pickBoolean:Wn,preCodeBlockBindings:Qn,mermaidBindings:Vn,d2Bindings:Xn,infographicBindings:qn,nonCodeBindings:Gn,linkBindings:Zn,listBindings:Jn,legacyRenderedItems:eo,legacyStructuredContentMode:to,renderedItems:no,getCodeBlockRenderNode:oo,getCodeBlockLanguage:ro,getCustomCodeLanguageComponent:lo,isLegacyStructuredNode:io,getRenderKey:ao,getMermaidBindingsFor:so,getInfographicBindingsFor:uo,getNodeComponent:co,isCustomCodeBlockComponent:mo,isCustomLanguageCodeBlockComponent:po,getBindingsFor:fo,handleContainerClick:function(e){t("click",e)},handleContainerMouseover:function(e){var n;(null==(n=e.target)?void 0:n.closest("[data-node-index]"))&&t("mouseover",e)},handleContainerMouseout:function(e){var n;(null==(n=e.target)?void 0:n.closest("[data-node-index]"))&&t("mouseout",e)},hasExplicitNodes:vo,typewriterCursorRef:ho,showTypewriterCursor:go,typewriterCursorTimeout:yo,lastTypewriterContentLength:wo,TYPEWRITER_CURSOR_EXCLUDED_NODE_TYPES:xo,shouldSkipTypewriterCursorForNode:ko,shouldShowTypewriterCursorForCurrentNodes:Mo,getNodeTextLength:bo,getTypewriterContentLength:Co,clearTypewriterCursorTimeout:To,getLastTextNode:No,updateTypewriterCursorPosition:_o,LegacyNodesRenderer:Ht}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("div",{ref:"containerRef",staticClass:"markstream-vue2 markdown-renderer",class:[{dark:n.props.isDark},{virtualized:n.virtualizationEnabled}],attrs:{"data-custom-id":n.props.customId},on:{click:n.handleContainerClick,mouseover:n.handleContainerMouseover,mouseout:n.handleContainerMouseout}},[n.legacyNodesMode?e._l(n.legacyRenderedItems,function(o){return t("div",{key:o.renderKey,staticClass:"node-slot",attrs:{"data-node-index":o.index,"data-node-type":o.node.type}},[t("div",{staticClass:"node-content"},[o.isCodeBlock||!1===n.props.fade?t(o.component,e._b({tag:"component",attrs:{node:o.node,loading:o.node.loading,"index-key":o.indexKey,"custom-id":n.props.customId,"is-dark":n.props.isDark},on:{copy:function(e){return n.emitCodeCopy(e)},"handle-artifact-click":function(e){return n.emit("handleArtifactClick",e)}}},"component",o.bindings,!1)):t("transition",{attrs:{name:"fade",appear:""}},[t(o.component,e._b({tag:"component",attrs:{node:o.node,loading:o.node.loading,"index-key":o.indexKey,"custom-id":n.props.customId,"is-dark":n.props.isDark},on:{copy:function(e){return n.emitCodeCopy(e)},"handle-artifact-click":function(e){return n.emit("handleArtifactClick",e)}}},"component",o.bindings,!1))],1)],1)])}):n.legacyStructuredContentMode?t(n.LegacyNodesRenderer,{attrs:{nodes:n.parsedNodes,"custom-id":n.props.customId,"index-key":n.props.indexKey,typewriter:n.props.typewriter,fade:n.props.fade,"show-tooltips":n.props.showTooltips,"code-block-stream":n.props.codeBlockStream,"code-block-dark-theme":n.props.codeBlockDarkTheme,"code-block-light-theme":n.props.codeBlockLightTheme,"render-code-blocks-as-pre":n.props.renderCodeBlocksAsPre,"code-block-min-width":n.props.codeBlockMinWidth,"code-block-max-width":n.props.codeBlockMaxWidth,"code-block-options":n.props.codeBlockOptions,"code-block-props":n.props.codeBlockProps,themes:n.props.themes,"is-dark":n.props.isDark,"custom-html-tags":n.mergedParseOptions.customHtmlTags,"html-policy":n.resolvedHtmlPolicy},on:{copy:function(e){return n.emitCodeCopy(e)},"handle-artifact-click":function(e){return n.emit("handleArtifactClick",e)}}}):[n.virtualizationEnabled?t("div",{staticClass:"node-spacer",style:{height:`${n.topSpacerHeight}px`},attrs:{"aria-hidden":"true"}}):e._e(),e._l(n.renderedItems,function(o){var r;return t("div",{key:o.renderKey,ref:`node-slot-${o.index}`,refInFor:!0,staticClass:"node-slot",attrs:{"data-node-index":o.index,"data-node-type":o.node.type}},[n.shouldRenderNode(o.index)?t("div",{ref:`node-content-${o.index}`,refInFor:!0,staticClass:"node-content"},[o.isCodeBlock||!1===n.props.fade?t(o.component,e._b({tag:"component",attrs:{node:o.node,loading:o.node.loading,"index-key":o.indexKey,"custom-id":n.props.customId,"is-dark":n.props.isDark},on:{copy:function(e){return n.emitCodeCopy(e)},"handle-artifact-click":function(e){return n.emit("handleArtifactClick",e)}}},"component",o.bindings,!1)):t("transition",{attrs:{name:"fade",appear:""}},[t(o.component,e._b({tag:"component",attrs:{node:o.node,loading:o.node.loading,"index-key":o.indexKey,"custom-id":n.props.customId,"is-dark":n.props.isDark},on:{copy:function(e){return n.emitCodeCopy(e)},"handle-artifact-click":function(e){return n.emit("handleArtifactClick",e)}}},"component",o.bindings,!1))],1)],1):t("div",{staticClass:"node-placeholder",style:{height:`${null!=(r=n.nodeHeights[o.index])?r:n.averageNodeHeight}px`}})])}),n.virtualizationEnabled?t("div",{staticClass:"node-spacer",style:{height:`${n.bottomSpacerHeight}px`},attrs:{"aria-hidden":"true"}}):e._e()],n.showTypewriterCursor?t("span",{ref:"typewriterCursorRef",staticClass:"typewriter-cursor",attrs:{"aria-hidden":"true"}}):e._e()],2)},[],!1,null,"c219138d",null,null).exports,tn=M(m.defineComponent({__name:"AdmonitionNode",props:{node:null,indexKey:null,isDark:{type:Boolean},typewriter:{type:Boolean},customId:null},emits:["copy"],setup(e,{emit:t}){var n;const o=e,r=m.computed(()=>{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)}),l=m.ref(!!o.node.collapsible&&!(null==(n=o.node.open)||n)),i=`admonition-${Math.random().toString(36).slice(2,9)}`,a=m.getCurrentInstance(),s=m.computed(()=>w(null==a?void 0:a.proxy)?Ht:en);return{__sfc:!0,props:o,emit:t,iconMap:{note:"ℹ️",info:"ℹ️",tip:"💡",warning:"⚠️",danger:"❗",error:"⛔",caution:"⚠️"},displayTitle:r,collapsed:l,toggleCollapse:function(){o.node.collapsible&&(l.value=!l.value)},headerId:i,instance:a,nestedRenderer:s}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("div",{staticClass:"admonition",class:[`admonition-${n.props.node.kind}`,n.props.isDark?"is-dark":""]},[t("div",{staticClass:"admonition-header",attrs:{id:n.headerId}},[n.iconMap[n.props.node.kind]?t("span",{staticClass:"admonition-icon"},[e._v(e._s(n.iconMap[n.props.node.kind]))]):e._e(),t("span",{staticClass:"admonition-title"},[e._v(e._s(n.displayTitle))]),n.props.node.collapsible?t("button",{staticClass:"admonition-toggle",attrs:{"aria-expanded":!n.collapsed,"aria-controls":`${n.headerId}-content`,title:n.collapsed?"Expand":"Collapse"},on:{click:n.toggleCollapse}},[n.collapsed?t("span",[e._v("▶")]):t("span",[e._v("▼")])]):e._e()]),t("div",{directives:[{name:"show",rawName:"v-show",value:!n.collapsed,expression:"!collapsed"}],staticClass:"admonition-content",attrs:{id:`${n.headerId}-content`,"aria-labelledby":n.headerId}},[t(n.nestedRenderer,{tag:"component",attrs:{"index-key":`admonition-${e.indexKey}`,nodes:n.props.node.children,"custom-id":n.props.customId,typewriter:n.props.typewriter},on:{copy:function(e){return n.emit("copy",e)}}})],1)])},[],!1,null,"f9c1d6b9",null,null).exports;let nn=0;const on=()=>import("@terrastruct/d2");let rn=null,ln=on;function an(e){ln=e,rn=null}const sn=M(m.defineComponent({__name:"D2BlockNode",props:{node:null,maxHeight:{default:void 0},loading:{type:Boolean,default:!0},isDark:{type:Boolean},progressiveRender:{type:Boolean,default:!0},progressiveIntervalMs:{default:700},themeId:null,darkThemeId:null,showHeader:{type:Boolean,default:!0},showModeToggle:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExportButton:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0}},setup(e){const t=e,{t:n}=de(),o=m.ref(!1),r=m.ref(!1),l=m.ref(!1),i=m.ref(!1),a=m.ref(null),u=m.ref(!1),c=m.ref(""),p=m.ref(0),f=m.ref(null),v=m.ref(null),h=m.computed(()=>{var e;return null!=(e=t.node.code)?e:""}),g=m.computed(()=>l.value||!i.value||!c.value),y=m.computed(()=>!!c.value),w=m.computed(()=>{if(g.value&&v.value)return{minHeight:`${v.value}px`}}),x=m.computed(()=>{if("none"===t.maxHeight)return{maxHeight:"none","--ms-d2-render-max-height":"none"};if(null!=t.maxHeight){const e="number"==typeof t.maxHeight?`${t.maxHeight}px`:String(t.maxHeight);return{maxHeight:e,"--ms-d2-render-max-height":e}}}),k="undefined"!=typeof window;let M=null,b=!1,C=!1,T=0,N=null,_=!1,D=null;const I={N1:"#E5E7EB",N2:"#CBD5E1",N3:"#94A3B8",N4:"#64748B",N5:"#475569",N6:"#334155",N7:"#0B1220",B1:"#60A5FA",B2:"#3B82F6",B3:"#2563EB",B4:"#1D4ED8",B5:"#1E40AF",B6:"#111827",AA2:"#22D3EE",AA4:"#0EA5E9",AA5:"#0284C7",AB4:"#FBBF24",AB5:"#F59E0B"};function S(e){return!e||e.disabled}const j=[/javascript:/i,/expression\s*\(/i,/url\s*\(\s*javascript:/i,/@import/i],E=/^(?:https?:|mailto:|tel:|#|\/|data:image\/(?:png|gif|jpe?g|webp);)/i;function L(e){return e.replace(/["']\s*javascript:/gi,"#").replace(/\bjavascript:/gi,"#").replace(/["']\s*vbscript:/gi,"#").replace(/\bvbscript:/gi,"#").replace(/\bdata:text\/html/gi,"#")}function B(e){if(!e)return"";const t=e.trim();return E.test(t)?t:""}function A(e){const t=new Set(["script"]),n=[e,...Array.from(e.querySelectorAll("*"))];for(const o of n){if(t.has(o.tagName.toLowerCase())){o.remove();continue}const e=Array.from(o.attributes);for(const t of e){const e=t.name;if(/^on/i.test(e))o.removeAttribute(e);else{if("style"===e&&t.value){const n=t.value;if(j.some(e=>e.test(n))){o.removeAttribute(e);continue}}if(("href"===e||"xlink:href"===e)&&t.value){const n=B(t.value);if(!n){o.removeAttribute(e);continue}n!==t.value&&o.setAttribute(e,n)}}}}}function O(e){if("undefined"==typeof window||"undefined"==typeof DOMParser)return"";if(!e)return"";const t=L(e),n=(new DOMParser).parseFromString(t,"image/svg+xml").documentElement;if(!n||"svg"!==n.nodeName.toLowerCase())return"";const o=n;return A(o),o.classList.add("markstream-d2-root-svg"),o.outerHTML}function z(e){const t=O(e);c.value=t||""}function P(){c.value=""}function R(e){return e?"string"==typeof e?e:"string"==typeof e.svg?e.svg:"string"==typeof e.data?e.data:"":""}function H(){return d(this,null,function*(){if(M)return M;const e=yield function(){return d(this,null,function*(){if(rn)return rn;const e=ln;if(!e)return null;let t;try{t=yield e()}catch(n){if(e===on)throw new Error('Optional dependency "@terrastruct/d2" is not installed. Please install it to enable D2 diagrams.');throw n}return t?(rn=function(e){var t;if(!e)return e;if(e.D2&&"function"==typeof e.D2)return e.D2;if(e.default&&e.default.D2&&"function"==typeof e.default.D2)return e.default.D2;const n=null!=(t=e.default)?t:e;return"function"==typeof n?n:(null==n?void 0:n.D2)&&"function"==typeof n.D2?n.D2:n}(t),rn):null})}();if(!e)return null;if("function"==typeof e){const t=new e;return t&&"function"==typeof t.compile?M=t:"function"==typeof e.compile&&(M=e),M}return(null==e?void 0:e.D2)&&"function"==typeof e.D2?(M=new e.D2,M):("function"==typeof e.compile&&(M=e),M)})}function $(){return d(this,null,function*(){var e,n,o,r,d,c;if(!k||C)return;if(t.loading&&!t.progressiveRender)return;const m=h.value;if(!m)return P(),void(a.value=null);const f=++p.value;u.value=!0,a.value=null;try{const u=yield H();if(!u)return i.value=!1,l.value=!0,P(),void(a.value="D2 is not available.");if("function"!=typeof u.compile||"function"!=typeof u.render)throw new TypeError("D2 instance is missing compile/render methods.");i.value=!0;const v=yield u.compile(m);if(f!==p.value)return;const h=null!=(e=null==v?void 0:v.diagram)?e:v,g=null!=(o=null!=(n=null==v?void 0:v.renderOptions)?n:null==v?void 0:v.options)?o:{},y=null!=(r=t.themeId)?r:g.themeID,w=null!=(d=t.darkThemeId)?d:g.darkThemeID,x=s({},g);if(x.themeID=t.isDark&&null!=w?w:y,x.darkThemeID=null,x.darkThemeOverrides=null,t.isDark){const e=g.themeOverrides&&"object"==typeof g.themeOverrides?g.themeOverrides:null;x.themeOverrides=s(s({},I),e||{})}x.salt=null!=(c=x.salt)?c:function(e="markstream-vue2-d2"){return nn+=1,`${e}-${nn}`}();const k=yield u.render(h,x);if(f!==p.value)return;const M=R(k);if(!M)throw new Error("D2 render returned empty output.");z(M),t.loading&&(l.value=!1),a.value=null}catch(v){if(f!==p.value)return;const e=(null==v?void 0:v.message)?String(v.message):"D2 render failed.";t.loading||(a.value=e),e.includes("@terrastruct/d2")&&(i.value=!1,l.value=!0)}finally{f===p.value&&(u.value=!1,_&&(_=!1,U()))}})}function U(e=!1){if(b)return;if(!k)return;if(C)return;if(u.value)return void(_=!0);const n=Math.max(120,Number(t.progressiveIntervalMs)||0),o=Date.now()-T;if(!e&&o<n)return _=!0,void(null==N&&(N=window.setTimeout(()=>{N=null,_&&(_=!1,U(!0))},Math.max(0,n-o))));b=!0;const r=()=>{b=!1,T=Date.now(),$()};"undefined"!=typeof window&&"function"==typeof window.requestAnimationFrame?window.requestAnimationFrame(r):setTimeout(r,0)}function F(){const e=f.value;if(!e)return;const t=e.getBoundingClientRect().height;t>0&&(v.value=t)}return m.watch(()=>[t.node.code,t.loading,t.isDark],()=>{U()},{immediate:!0}),m.watch(()=>t.loading,(e,t)=>{t&&!e&&U(!0)}),m.watch(()=>[g.value,c.value,h.value],()=>{m.nextTick(()=>{F()})}),m.onMounted(()=>{U(),m.nextTick(()=>{F()}),"undefined"!=typeof ResizeObserver&&(D=new ResizeObserver(()=>{F()}),f.value&&D.observe(f.value))}),m.onBeforeUnmount(()=>{C=!0,null!=N&&(clearTimeout(N),N=null),null==D||D.disconnect(),D=null}),{__sfc:!0,props:t,t:n,copyText:o,isCollapsed:r,showSource:l,d2Available:i,renderError:a,isRendering:u,svgMarkup:c,renderToken:p,bodyRef:f,bodyMinHeight:v,baseCode:h,showSourceFallback:g,hasPreview:y,bodyStyle:w,renderStyle:x,isClient:k,d2Instance:M,scheduled:b,unmounted:C,lastRenderAt:T,throttleTimer:N,pendingRender:_,bodyObserver:D,DARK_THEME_OVERRIDES:I,shouldSkipEventTarget:S,onBtnHover:function(e,n,o="top"){if(S(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;ie(e.currentTarget,n,o,!1,l,t.isDark)},onBtnLeave:function(){ae()},onCopyHover:function(e){if(S(e.currentTarget))return;const r=o.value?n("common.copied")||"Copied":n("common.copy")||"Copy",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;ie(e.currentTarget,r,"top",!1,i,t.isDark)},copy:function(){return d(this,null,function*(){try{const e=h.value;"undefined"!=typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.writeText&&(yield navigator.clipboard.writeText(e)),o.value=!0,setTimeout(()=>{o.value=!1},1e3)}catch(e){console.error("Copy failed:",e)}})},toggleCollapse:function(){r.value=!r.value},handleSwitchMode:function(e){l.value="source"===e},DISALLOWED_STYLE_PATTERNS:j,SAFE_URL_PROTOCOLS:E,neutralizeScriptProtocols:L,sanitizeUrl:B,scrubSvgElement:A,toSafeSvgMarkup:O,setSvg:z,clearSvg:P,extractSvg:R,ensureD2Instance:H,renderDiagram:$,scheduleRender:U,exportSvg:function(){if(c.value)try{const e=new Blob([c.value],{type:"image/svg+xml;charset=utf-8"}),t=URL.createObjectURL(e);if("undefined"!=typeof document){const e=document.createElement("a");e.href=t,e.download=`d2-diagram-${Date.now()}.svg`,document.body.appendChild(e),e.click(),document.body.removeChild(e)}URL.revokeObjectURL(t)}catch(e){console.error("Failed to export SVG:",e)}},updateBodyMinHeight:F}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("div",{staticClass:"d2-block-container my-4 rounded-lg border overflow-hidden shadow-sm",class:n.props.isDark?"border-gray-700/30 bg-gray-900 text-gray-100":"border-gray-200 bg-white text-gray-900"},[n.props.showHeader?t("div",{staticClass:"d2-block-header flex justify-between items-center px-4 py-2.5 border-b border-gray-400/5",staticStyle:{color:"var(--vscode-editor-foreground)","background-color":"var(--vscode-editor-background)"}},[e._m(0),t("div",{staticClass:"flex items-center gap-x-2"},[n.props.showModeToggle?t("div",{staticClass:"flex items-center gap-x-1 rounded-md p-0.5",class:n.props.isDark?"bg-gray-700":"bg-gray-100"},[t("button",{staticClass:"mode-btn px-2 py-1 text-xs rounded",class:n.showSource?"":"is-active",attrs:{type:"button"},on:{click:function(e){return n.handleSwitchMode("preview")},mouseenter:function(e){n.onBtnHover(e,n.t("common.preview")||"Preview")},focus:function(e){n.onBtnHover(e,n.t("common.preview")||"Preview")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[e._v(" "+e._s(n.t("common.preview")||"Preview")+" ")]),t("button",{staticClass:"mode-btn px-2 py-1 text-xs rounded",class:n.showSource?"is-active":"",attrs:{type:"button"},on:{click:function(e){return n.handleSwitchMode("source")},mouseenter:function(e){n.onBtnHover(e,n.t("common.source")||"Source")},focus:function(e){n.onBtnHover(e,n.t("common.source")||"Source")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[e._v(" "+e._s(n.t("common.source")||"Source")+" ")])]):e._e(),n.props.showCopyButton?t("button",{staticClass:"d2-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",attrs:{type:"button","aria-label":n.copyText?n.t("common.copied")||"Copied":n.t("common.copy")||"Copy"},on:{click:n.copy,mouseenter:function(e){return n.onCopyHover(e)},focus:function(e){return n.onCopyHover(e)},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[n.copyText?t("svg",{staticClass:"w-3 h-3",attrs:{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"}})]):t("svg",{staticClass:"w-3 h-3",attrs:{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("rect",{attrs:{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}}),t("path",{attrs:{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"}})])])]):e._e(),n.props.showExportButton&&n.svgMarkup?t("button",{staticClass:"d2-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",attrs:{type:"button","aria-label":n.t("common.export")||"Export"},on:{click:n.exportSvg,mouseenter:function(e){n.onBtnHover(e,n.t("common.export")||"Export")},focus:function(e){n.onBtnHover(e,n.t("common.export")||"Export")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"w-3 h-3",attrs:{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 3v12m0-12l-4 4m4-4l4 4M4 14v4a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-4"}})])]):e._e(),n.props.showCollapseButton?t("button",{staticClass:"d2-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]",attrs:{type:"button","aria-pressed":n.isCollapsed},on:{click:n.toggleCollapse,mouseenter:function(e){n.onBtnHover(e,n.isCollapsed?n.t("common.expand")||"Expand":n.t("common.collapse")||"Collapse")},focus:function(e){n.onBtnHover(e,n.isCollapsed?n.t("common.expand")||"Expand":n.t("common.collapse")||"Collapse")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"w-3 h-3",style:{rotate:n.isCollapsed?"0deg":"90deg"},attrs:{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"}})])]):e._e()])]):e._e(),t("div",{directives:[{name:"show",rawName:"v-show",value:!n.isCollapsed,expression:"!isCollapsed"}],ref:"bodyRef",staticClass:"d2-block-body",style:n.bodyStyle},[n.props.loading&&!n.hasPreview?t("div",{staticClass:"d2-source px-4 py-4"},[t("pre",{staticClass:"d2-code"},[t("code",[e._v(e._s(n.baseCode))])]),n.renderError?t("p",{staticClass:"d2-error mt-2 text-xs"},[e._v(" "+e._s(n.renderError)+" ")]):e._e()]):t("div",[n.showSourceFallback?t("div",{staticClass:"d2-source px-4 py-4"},[t("pre",{staticClass:"d2-code"},[t("code",[e._v(e._s(n.baseCode))])]),n.renderError?t("p",{staticClass:"d2-error mt-2 text-xs"},[e._v(" "+e._s(n.renderError)+" ")]):e._e()]):t("div",{staticClass:"d2-render",style:n.renderStyle},[t("div",{staticClass:"d2-svg",domProps:{innerHTML:e._s(n.svgMarkup)}}),n.renderError?t("p",{staticClass:"d2-error px-4 pb-3 text-xs"},[e._v(" "+e._s(n.renderError)+" ")]):e._e()])])])])},[function(){var e=this,t=e._self._c;return e._self._setupProxy,t("div",{staticClass:"flex items-center gap-x-2"},[t("span",{staticClass:"text-sm font-medium font-mono"},[e._v("D2")])])}],!1,null,"3e7181d6",null,null).exports;sn.install=e=>{e.component(sn.__name,sn)};const un=Object.freeze(Object.defineProperty({__proto__:null,default:sn},Symbol.toStringTag,{value:"Module"}));let dn=null,cn=null;const mn=M(m.defineComponent({__name:"InfographicBlockNode",props:{node:null,maxHeight:{default:"500px"},estimatedPreviewHeightPx:null,loading:{type:Boolean,default:!0},isDark:{type:Boolean},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"],setup(e,{emit:t}){const n=e,{t:o}=de(),r=m.ref(!1),l=m.ref(!1),i=m.ref(),a=m.ref(!1),s=m.ref(!1),u=m.ref(),c=m.ref(null),f=m.computed(()=>n.node.code),v=m.ref(!1),h=m.ref(!1),g=m.computed(()=>n.maxHeight&&"none"!==n.maxHeight?Vt(n.maxHeight):null),y=m.computed(()=>{var e;return null!=(e=Vt(n.estimatedPreviewHeightPx))?e:qt(f.value)});function w(){var e;return null!=(e=Vt(i.value?getComputedStyle(i.value).getPropertyValue("--ms-size-diagram-min-height").trim():""))?e:360}function x(){return Jt(y.value,w(),g.value)}const k=m.ref(`${x()}px`);function M(e){const t=x();if(!n.maxHeight||"none"===n.maxHeight)return`${Math.max(e,t)}px`;const o=g.value;return null==o?`${Math.max(e,t)}px`:`${Math.max(Math.min(e,o),t)}px`}function b(){if(!i.value)return;const e=i.value.scrollHeight;e>0&&(k.value=M(e))}const C=m.ref(1),T=m.ref(0),N=m.ref(0),_=m.ref(!1);function D(e){return!e||e.disabled}function I(e){return d(this,null,function*(){try{const n=(new XMLSerializer).serializeToString(e),o=new Blob([n],{type:"image/svg+xml;charset=utf-8"}),r=URL.createObjectURL(o);if("undefined"!=typeof document){const e=document.createElement("a");e.href=r,e.download=`infographic-${Date.now()}.svg`;try{document.body.appendChild(e),e.click(),document.body.removeChild(e)}catch(t){}URL.revokeObjectURL(r)}}catch(n){console.error("Failed to export SVG:",n)}})}function S(e){"Escape"===e.key&&s.value&&E()}function j(){if(s.value=!0,"undefined"!=typeof document)try{document.body.style.overflow="hidden"}catch(e){}if("undefined"!=typeof window)try{window.addEventListener("keydown",S)}catch(e){}m.nextTick(()=>{if(i.value&&u.value){u.value.innerHTML="";const e=document.createElement("div");e.style.transition="transform 0.1s ease",e.style.transformOrigin="center center",e.style.width="100%",e.style.height="100%",e.style.display="flex",e.style.alignItems="center",e.style.justifyContent="center";const t=i.value.cloneNode(!0);t.classList.add("fullscreen"),t.style.height="auto",e.appendChild(t),u.value.appendChild(e),c.value=e,e.style.transform=`translate(${T.value}px, ${N.value}px) scale(${C.value})`}})}function E(){if(s.value=!1,u.value&&(u.value.innerHTML=""),c.value=null,"undefined"!=typeof document)try{document.body.style.overflow=""}catch(e){}if("undefined"!=typeof window)try{window.removeEventListener("keydown",S)}catch(e){}}m.watch(y,()=>{if(a.value||l.value)return;const e=x(),t=Vt(k.value);(null==t||t<e)&&(k.value=`${e}px`)});const L=m.computed(()=>s.value||C.value>1),B=p.createPanGesture({getTranslate:()=>({x:T.value,y:N.value}),setTranslate:e=>{T.value=e.x,N.value=e.y},canStart:e=>!!v.value&&("touch"!==e.pointerType||L.value),onActiveChange:e=>_.value=e}),A=B.start,O=B.stop;m.onBeforeUnmount(O);let z=null,P=!1,R=!1,H=!1,$=!1,U=!1,F="",Y=!1,K=0;function W(e=!1){return d(this,null,function*(){var t,o,r,l,a,s;if(Y||!i.value)return;if(P)return R=!0,void(H=H||e);const u=f.value;if(!e&&u===F&&v.value)return;const c=f.value,p=!1===n.loading,g=++K;P=!0;let y=null,w=null;try{const e=yield function(){return d(this,null,function*(){return cn||dn||(dn=import("@antv/infographic").then(e=>{const t=e&&e.default?e.default:e;let n=t;return"function"==typeof t&&t.prototype&&t.prototype.render?n=t:e.Infographic?n=e.Infographic:t&&t.Infographic&&(n=t.Infographic),cn=n,n}).catch(e=>(console.warn("Failed to load @antv/infographic",e),null)),dn)})}();if(Y||g!==K)return;if(!e)throw new Error("Infographic library failed to load.");const l=i.value;if(!l)return;const a=!0===n.loading;if(!(u===f.value||!p&&a&&f.value.startsWith(c)))return;w=Array.from(l.childNodes),y=new e({container:l,width:"100%",height:"100%"});let s="",x=!1;if(null==(t=y.on)||t.call(y,"error",e=>{const t=Array.isArray(e)?e:[e];s=t.map(e=>{var t;return e instanceof Error?e.message:"string"==typeof e?e:String(e&&"object"==typeof e&&"message"in e?null!=(t=e.message)?t:"":null!=e?e:"")}).filter(Boolean).join("; ")}),null==(o=y.on)||o.call(y,"rendered",()=>{x=!0}),y.render(c),s)throw new Error(s);const k=Array.from(l.childNodes),M=k.length>0&&(k.length!==w.length||k.some((e,t)=>e!==(null==w?void 0:w[t])));if(!x&&!M)throw new Error("Infographic render returned empty output.");null==(r=null==z?void 0:z.destroy)||r.call(z),z=y,y=null,v.value=!0,h.value=!1,F=u,m.nextTick(()=>{Y||g!==K||b()})}catch(x){if(Y||g!==K)return;null==(l=null==y?void 0:y.destroy)||l.call(y),y=null,p&&!1===n.loading&&u===f.value?(console.error("Failed to render infographic:",x),null==(a=null==z?void 0:z.destroy)||a.call(z),z=null,v.value=!1,h.value=!0,F="",i.value&&(i.value.innerHTML=`<div class="text-red-500 p-4">Failed to render infographic: ${x instanceof Error?x.message:"Unknown error"}</div>`)):w&&i.value&&i.value.replaceChildren(...w)}finally{if(null==(s=null==y?void 0:y.destroy)||s.call(y),P=!1,!Y&&g===K&&R){const e=H;R=!1,H=!1,Q(e)}}})}function Q(e=!1){Y||a.value||l.value||(U=U||e,$||($=!0,m.nextTick(()=>{$=!1;const e=U;U=!1,Y||W(e)})))}m.watch(()=>f.value,()=>{Q(!0)}),m.watch(()=>n.loading,(e,t)=>{t&&!e&&Q(!0)}),m.watch(()=>a.value,e=>{e||Q(!0)}),m.watch(()=>l.value,e=>{e||Q()}),m.watch(()=>n.maxHeight,()=>{m.nextTick(b)}),m.onMounted(()=>{Q()}),m.onBeforeUnmount(()=>{var e;if(Y=!0,K+=1,R=!1,H=!1,$=!1,U=!1,z&&(null==(e=z.destroy)||e.call(z),z=null),"undefined"!=typeof window)try{window.removeEventListener("keydown",S)}catch(t){}});const V=m.computed(()=>n.isDark?"infographic-action-btn p-2 text-xs rounded text-gray-400 hover:bg-gray-700 hover:text-gray-200":"infographic-action-btn p-2 text-xs rounded text-gray-600 hover:bg-gray-200 hover:text-gray-700"),X=m.computed(()=>a.value||l.value),q=m.computed(()=>({transform:`translate(${T.value}px, ${N.value}px) scale(${C.value})`}));return m.watch(q,e=>{s.value&&c.value&&(c.value.style.transform=e.transform)}),{__sfc:!0,props:n,_emits:t,t:o,copyText:r,isCollapsed:l,infographicContainer:i,showSource:a,isModalOpen:s,modalContent:u,modalCloneWrapper:c,baseCode:f,hasPreview:v,hasRenderError:h,maxPreviewHeight:g,estimatedPreviewHeight:y,resolveMinContainerHeight:w,resolveEstimatedPreviewHeight:x,containerHeight:k,resolveContainerHeight:M,updateContainerHeight:b,zoom:C,translateX:T,translateY:N,isDragging:_,shouldSkipEventTarget:D,onBtnHover:function(e,t,o="top"){if(D(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;ie(e.currentTarget,t,o,!1,l,n.isDark)},onBtnLeave:function(){ae()},onCopyHover:function(e){if(D(e.currentTarget))return;const t=r.value?o("common.copied")||"Copied":o("common.copy")||"Copy",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;ie(e.currentTarget,t,"top",!1,i,n.isDark)},copy:function(){return d(this,null,function*(){try{const e=f.value;"undefined"!=typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.writeText&&(yield navigator.clipboard.writeText(e)),r.value=!0,setTimeout(()=>{r.value=!1},1e3)}catch(e){console.error("Failed to copy:",e)}})},handleSwitchMode:function(e){a.value="source"===e},handleExportClick:function(){var e;const t=null==(e=i.value)?void 0:e.querySelector("svg");t?I(t):console.error("SVG element not found")},exportSvg:I,handleKeydown:S,openModal:j,closeModal:E,handleOpenModalClick:function(){j()},zoomIn:function(){C.value<3&&(C.value+=.1)},zoomOut:function(){C.value>.5&&(C.value-=.1)},resetZoom:function(){C.value=1,T.value=0,N.value=0},panSurfaceClaimsTouch:L,panGesture:B,startDrag:A,stopDrag:O,infographicInstance:z,renderInFlight:P,rerenderQueued:R,rerenderForce:H,renderScheduled:$,renderScheduledForce:U,lastCompletedRenderSignature:F,unmounted:Y,renderGeneration:K,renderInfographic:W,queueInfographicRender:Q,computedButtonStyle:V,isFullscreenDisabled:X,transformStyle:q,infographicIconUrl:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTUuNTIiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAyOTEgMzAwIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxnPjxwYXRoIGQ9Ik0xNDAuOTA0IDIzOS4zNzZDMTI4LjgzIDIzOS42ODMgMTE5LjY3NSAyMzkuMjk5IDExNS40NDggMjQzLjg0M0MxMTAuOTAyIDI0OC4wNyAxMTEuMjg4IDI1Ny4yMjcgMTEwLjk3OSAyNjkuMzAyQzExMS4xMTggMjc0LjY3NSAxMTEuMTE4IDI3OS40NzggMTExLjQ3MiAyODMuNTJDMTExLjY2MiAyODUuNjM4IDExMS45NSAyODcuNTQ3IDExMi40MDYgMjg5LjIyNEMxMTIuNDExIDI4OS4yNDMgMTEyLjQxNiAyODkuMjU5IDExMi40MjIgMjg5LjI4QzExMi40NjIgMjg5LjQxOSAxMTIuNDk2IDI4OS41NTggMTEyLjUzOSAyODkuNjkxQzExMy4xNjggMjkxLjc4NyAxMTQuMDg4IDI5My40OTEgMTE1LjQ0NiAyOTQuNzU4QzExNi42NjIgMjk2LjA2NCAxMTguMjgzIDI5Ni45NjMgMTIwLjI2NCAyOTcuNjlDMTIwLjM2IDI5Ny42MTQgMTIwLjQ2NCAyOTcuNjQ2IDEyMC41NTUgMjk3LjY3NUMxMjAuNTYgMjk3LjY4IDEyMC41NiAyOTcuNjggMTIwLjU2NiAyOTcuNjhDMTIwLjg0OCAyOTcuNzY4IDEyMS4xNDIgMjk3Ljg0NiAxMjEuNDQzIDI5Ny45MjNDMTIxLjQ1NCAyOTcuOTIzIDEyMS40NjQgMjk3LjkyOCAxMjEuNDc4IDI5Ny45MzRDMTIyLjg3NSAyOTguMjcyIDEyNC40MjQgMjk4LjUwNyAxMjYuMTEgMjk4LjY3OEMxMjYuMzI2IDI5OC42OTYgMTI2LjU0MiAyOTguNzE4IDEyNi43NjMgMjk4LjczOUMxMzAuNzkgMjk5LjA4NiAxMzUuNTU4IDI5OS4wODggMTQwLjkwNCAyOTkuMjIyQzE1Mi45NzQgMjk4LjkxMiAxNjIuMTI4IDI5OS4zMDIgMTY2LjM2IDI5NC43NThDMTcwLjkwNCAyOTAuNTI2IDE3MC41MTUgMjgxLjM3MSAxNzAuODI0IDI2OS4zMDJDMTcwLjUxNSAyNTcuMjI3IDE3MC45MDcgMjQ4LjA3IDE2Ni4zNiAyNDMuODQzQzE2Mi4xMzEgMjM5LjI5OSAxNTIuOTc0IDIzOS42ODMgMTQwLjkwNCAyMzkuMzc2WiIgZmlsbD0iI0ZGNjM3NiI+PC9wYXRoPjxwYXRoIGQ9Ik0yMS4yMTU1IDEyOC4zOThDMTIuNjU1NSAxMjguNjE2IDYuMTY0ODQgMTI4LjMzOSAzLjE2NzUxIDEzMS41NkMtMC4wNTM4MjIyIDEzNC41NiAwLjIxODE3OCAxNDEuMDU0IC0wLjAwMDQ4ODI4MSAxNDkuNjA4QzAuMjE4MTc4IDE1OC4xNjggLTAuMDUzODIyMiAxNjQuNjU5IDMuMTY3NTEgMTY3LjY1NkM2LjE2NDg0IDE3MC44NzggMTIuNjU1NSAxNzAuNjA2IDIxLjIxNTUgMTcwLjgyNEMyNS4wMjYyIDE3MC43MjYgMjguNDI4OCAxNzAuNzI2IDMxLjI5NTUgMTcwLjQ3NUMzMi43OTY4IDE3MC4zNDIgMzQuMTQ4OCAxNzAuMTM2IDM1LjMzODIgMTY5LjgxNEMzNS4zNTQyIDE2OS44MTEgMzUuMzY0OCAxNjkuODA2IDM1LjM3ODIgMTY5LjgwM0MzNS40NzY4IDE2OS43NzQgMzUuNTc1NSAxNjkuNzQ3IDM1LjY2ODggMTY5LjcxOEMzNy4xNTY4IDE2OS4yNzIgMzguMzY0OCAxNjguNjIyIDM5LjI2MzUgMTY3LjY1NkM0MC4xOTE1IDE2Ni43OTUgNDAuODI2MiAxNjUuNjQ2IDQxLjI3MTUgMTY0LjI0M0M0MS4yODc1IDE2NC4xNzQgNDEuMzExNSAxNjQuMTAyIDQxLjMzMjggMTY0LjAzNUM0MS4zMzI4IDE2NC4wMzUgNDEuMzM1NSAxNjQuMDMyIDQxLjMzNTUgMTY0LjAyN0M0MS4zOTY4IDE2My44MjcgNDEuNDUyOSAxNjMuNjIyIDQxLjUwNjIgMTYzLjQwNkM0MS41MDYyIDE2My4zOTggNDEuNTExNSAxNjMuMzkyIDQxLjUxNDIgMTYzLjM4MkM0MS43NTQyIDE2Mi4zOTIgNDEuOTIyMiAxNjEuMjk0IDQyLjA0MjIgMTYwLjA5NkM0Mi4wNTU1IDE1OS45NDQgNDIuMDcxNSAxNTkuNzkyIDQyLjA4NDggMTU5LjYzNUM0Mi4zMzI4IDE1Ni43NzkgNDIuMzMyOCAxNTMuMzk4IDQyLjQyNjIgMTQ5LjYwOEM0Mi4yMDc1IDE0MS4wNTQgNDIuNDg0OCAxMzQuNTYgMzkuMjYzNSAxMzEuNTZDMzYuMjYzNSAxMjguMzM5IDI5Ljc3MjggMTI4LjYxNiAyMS4yMTU1IDEyOC4zOThaIiBmaWxsPSIjRkZDQ0NDIj48L3BhdGg+PHBhdGggZD0iTTgxLjA1OTUgMTg0LjE3MUM3MC44NTY4IDE4NC40MzMgNjMuMTIwOCAxODQuMTAyIDU5LjU0NzUgMTg3Ljk0MkM1NS43MDc1IDE5MS41MTggNTYuMDMyOCAxOTkuMjU0IDU1Ljc3NDIgMjA5LjQ1NEM1Ni4wMzI4IDIxOS42NTcgNTUuNzA3NSAyMjcuMzkzIDU5LjU0NzUgMjMwLjk2M0M2My4xMjA4IDIzNC44MDMgNzAuODU2OCAyMzQuNDc4IDgxLjA1OTUgMjM0LjczOUM4NS42MDA4IDIzNC42MjIgODkuNjU5NSAyMzQuNjIyIDkzLjA3MjggMjM0LjMyM0M5NC44NjQ4IDIzNC4xNjMgOTYuNDc1NSAyMzMuOTIxIDk3Ljg5NDIgMjMzLjUzNEM5Ny45MTAyIDIzMy41MjkgOTcuOTIzNSAyMzMuNTI2IDk3Ljk0MjIgMjMzLjUyMUM5OC4wNTY4IDIzMy40ODYgOTguMTc0MiAyMzMuNDU3IDk4LjI4ODggMjMzLjQyMkMxMDAuMDYgMjMyLjg4OSAxMDEuNSAyMzIuMTEzIDEwMi41NjkgMjMwLjk2M0MxMDMuNjc2IDIyOS45MzcgMTA0LjQzMyAyMjguNTY2IDEwNC45NjQgMjI2Ljg5NEMxMDQuOTg1IDIyNi44MTEgMTA1LjAxMiAyMjYuNzI2IDEwNS4wMzYgMjI2LjY0NkMxMDUuMDQxIDIyNi42NDMgMTA1LjA0MSAyMjYuNjQzIDEwNS4wNDEgMjI2LjYzOEMxMDUuMTE2IDIyNi40MDEgMTA1LjE4IDIyNi4xNTMgMTA1LjI0NCAyMjUuODk3QzEwNS4yNDQgMjI1Ljg4OSAxMDUuMjQ5IDIyNS44ODEgMTA1LjI1NCAyMjUuODY3QzEwNS41NCAyMjQuNjg5IDEwNS43NCAyMjMuMzc5IDEwNS44ODEgMjIxLjk1M0MxMDUuOSAyMjEuNzcxIDEwNS45MTYgMjIxLjU5IDEwNS45MzQgMjIxLjQwM0MxMDYuMjI4IDIxOC4wMDEgMTA2LjIyOCAyMTMuOTY5IDEwNi4zNDIgMjA5LjQ1NEMxMDYuMDgxIDE5OS4yNTQgMTA2LjQxMiAxOTEuNTE4IDEwMi41NzIgMTg3Ljk0MkM5OC45OTU1IDE4NC4xMDIgOTEuMjU2OCAxODQuNDMzIDgxLjA1OTUgMTg0LjE3MVoiIGZpbGw9IiNGRjkzOUYiPjwvcGF0aD48cGF0aCBkPSJNMjYwLjU5MSAxNTEuODdDMjE1LjY1MiAxNTEuODcgMjAzLjAyIDE2NC41MjMgMjAzLjAyIDIwOS40NjJIMTk4LjQ3NkMxOTguNDc2IDE2NC41MjMgMTg1LjgzNiAxNTEuODgxIDE0MC44OTUgMTUxLjg4MVYxNDcuMzM3QzE4NS44MzYgMTQ3LjMzNyAxOTguNDg3IDEzNC43MDUgMTk4LjQ4NyA4OS43NjU5SDIwMy4wMkMyMDMuMDIgMTM0LjcwNSAyMTUuNjUyIDE0Ny4zMzcgMjYwLjU5MSAxNDcuMzM3VjE1MS44N1pNMjg2LjA1MiAxMjQuMTU4QzI4MS44MiAxMTkuNjE0IDI3Mi42NiAxMjAuMDAxIDI2MC41OTEgMTE5LjY4OUMyNDguNTIxIDExOS4zODUgMjM5LjM2MSAxMTkuNzcxIDIzNS4xMjkgMTE1LjIyN0MyMzAuNTg1IDExMC45OTUgMjMwLjk4MyAxMDEuODQ2IDIzMC42NzEgODkuNzY1OUMyMzAuNTEzIDgzLjczMTIgMjMwLjUzNSA3OC40MjcyIDIzMC4wMjMgNzQuMTAxOUMyMjkuNTEzIDY5Ljc2NTkgMjI4LjQ4MSA2Ni40MjE5IDIyNi4yMDkgNjQuMzA0NkMyMjEuOTY3IDU5Ljc2MDYgMjEyLjgxNyA2MC4xNDcyIDIwMC43NDggNTkuODQ1OUMxODguNjgxIDYwLjE0NzIgMTc5LjUxOSA1OS43NjA2IDE3NS4yODcgNjQuMzA0NkMxNzAuNzUzIDY4LjUzNjYgMTcxLjEyOSA3Ny42OTY2IDE3MC44MjggODkuNzY1OUMxNzAuNTE2IDEwMS44MzUgMTcwLjkgMTEwLjk5NSAxNjYuMzU2IDExNS4yMjdDMTYyLjEyNCAxMTkuNzcxIDE1Mi45ODUgMTE5LjM3NCAxNDAuOTA1IDExOS42ODlDMTM4Ljg3MyAxMTkuNzM5IDEzNi45MjQgMTE5Ljc3MSAxMzUuMDcxIDExOS44MTFDMTE5LjMxMyAxMTguNjk3IDEwNi4zMzcgMTEyLjMxOCAxMDYuMzM3IDg5Ljc2NTlDMTA2LjIxMiA4NC42Njk5IDEwNi4yMzMgODAuMTc5MiAxMDUuODA3IDc2LjUyMDZDMTA1LjM2NyA3Mi44NzI2IDEwNC40OTIgNzAuMDM3OSAxMDIuNTc1IDY4LjI1NjZDOTkuMDAxMyA2NC40MTEyIDkxLjI1NzMgNjQuNzQ0NiA4MS4wNjUzIDY0LjQ4MzJDNzAuODYgNjQuNzQ0NiA2My4xMTg2IDY0LjQxMTIgNTkuNTUzMyA2OC4yNTY2QzU1LjcwOCA3MS44Mjk5IDU2LjAzMDYgNzkuNTYzMiA1NS43NjkzIDg5Ljc2NTlDNTYuMDMwNiA5OS45Njg2IDU1LjcwOCAxMDcuNzAyIDU5LjU1MzMgMTExLjI3OEM2My4xMTg2IDExNS4xMTMgNzAuODYgMTE0Ljc5IDgxLjA2NTMgMTE1LjA0OUMxMDMuNjE3IDExNS4wNDkgMTA5Ljk5NiAxMjguMDM1IDExMS4xIDE0My44MDNDMTExLjA2OCAxNDUuNjU5IDExMS4wMjggMTQ3LjU4NyAxMTAuOTc1IDE0OS42MTlDMTExLjEyMSAxNTQuOTg3IDExMS4xMjEgMTU5Ljc5IDExMS40NzYgMTYzLjgzNUMxMTEuNjYzIDE2NS45NSAxMTEuOTQ1IDE2Ny44NTcgMTEyLjQwNCAxNjkuNTM0QzExMi40MTIgMTY5LjU1NSAxMTIuNDEyIDE2OS41NjYgMTEyLjQyMyAxNjkuNTk4QzExMi40NjUgMTY5LjczNCAxMTIuNDk3IDE2OS44NjcgMTEyLjUzNyAxNzAuMDAzQzExMy4xNjQgMTcyLjA5OSAxMTQuMDkyIDE3My44MDkgMTE1LjQ0NyAxNzUuMDdDMTE2LjY2NSAxNzYuMzcxIDExOC4yODEgMTc3LjI3OCAxMjAuMjcxIDE3Ny45MDVDMTIwLjM2NCAxNzcuOTM0IDEyMC40NiAxNzcuOTU1IDEyMC41NjQgMTc3Ljk4N0MxMjAuODU1IDE3OC4wODEgMTIxLjE0NSAxNzguMTUzIDEyMS40MzkgMTc4LjIzOEMxMjEuNDYgMTc4LjIzOCAxMjEuNDcxIDE3OC4yMzggMTIxLjQ3OSAxNzguMjQ5QzEyMi44NzYgMTc4LjU4MiAxMjQuNDIgMTc4LjgyMiAxMjYuMTA4IDE3OC45ODdDMTI2LjMyNyAxNzkuMDA5IDEyNi41NDUgMTc5LjAzIDEyNi43NjQgMTc5LjA1MUMxMzAuNzg4IDE3OS4zOTUgMTM1LjU1OSAxNzkuMzk1IDE0MC45MDUgMTc5LjUyOUMxNTIuOTc1IDE3OS44NDMgMTYyLjEyNCAxNzkuNDU3IDE2Ni4zNTYgMTg0LjAwMUMxNzAuOSAxODguMjMzIDE3MC41MTYgMTk3LjM3MSAxNzAuODI4IDIwOS40NTFDMTcxLjEyOSAyMjEuNTI5IDE3MC43NDMgMjMwLjY4MSAxNzUuMjg3IDIzNC45MUMxNzkuNTE5IDIzOS40NTQgMTg4LjY4MSAyMzkuMDcgMjAwLjc0OCAyMzkuMzcxQzIwNi4xMjcgMjM5LjIzNSAyMTAuOTIxIDIzOS4yMzUgMjE0Ljk3NSAyMzguODgxQzIxNy4wNzkgMjM4LjY5NCAyMTguOTg1IDIzOC40MDMgMjIwLjY3NiAyMzcuOTU1QzIyMC42OTUgMjM3Ljk0NSAyMjAuNzA1IDIzNy45MzQgMjIwLjcyNyAyMzcuOTM0QzIyMC44NzMgMjM3Ljg5MSAyMjAuOTk5IDIzNy44NTkgMjIxLjEzNSAyMzcuODE5QzIyMy4yMjggMjM3LjE5MyAyMjQuOTM3IDIzNi4yNjUgMjI2LjIwOSAyMzQuOTFDMjI3LjUxMSAyMzMuNjkxIDIyOC40MDkgMjMyLjA2NSAyMjkuMDQ0IDIzMC4wOTdDMjI5LjA2NSAyMzAuMDAzIDIyOS4wOTUgMjI5Ljg5OSAyMjkuMTI3IDIyOS44MDNWMjI5Ljc5M0MyMjkuMjIgMjI5LjUxMyAyMjkuMjk1IDIyOS4yMjIgMjI5LjM2NyAyMjguOTE4QzIyOS4zNjcgMjI4Ljg5NyAyMjkuMzc3IDIyOC44OTcgMjI5LjM3NyAyMjguODc4QzIyOS43MjEgMjI3LjQ4MSAyMjkuOTUxIDIyNS45MzcgMjMwLjEyNyAyMjQuMjQ5QzIzMC4xMzcgMjI0LjAzIDIzMC4xNjkgMjIzLjgxMSAyMzAuMTkxIDIyMy41OTNDMjMwLjUzNSAyMTkuNTcxIDIzMC41MzUgMjE0Ljc5OCAyMzAuNjcxIDIwOS40NTFDMjMwLjk3MiAxOTcuMzcxIDIzMC41ODUgMTg4LjIzMyAyMzUuMTI5IDE4NC4wMDFDMjM5LjM2MSAxNzkuNDU3IDI0OC41MTEgMTc5Ljg0MyAyNjAuNTkxIDE3OS41MjlDMjcyLjY2IDE3OS4yMjcgMjgxLjgyIDE3OS42MTQgMjg2LjA1MiAxNzUuMDdDMjkwLjU5NiAxNzAuODM4IDI5MC4yMDkgMTYxLjY4OSAyOTAuNTExIDE0OS42MTlDMjkwLjIwOSAxMzcuNTM5IDI5MC41OTYgMTI4LjM3OSAyODYuMDUyIDEyNC4xNThaIiBmaWxsPSIjRkYzNTZBIj48L3BhdGg+PHBhdGggZD0iTTExMi40MDUgNDkuODQ4QzExMi40MTEgNDkuODY5NCAxMTIuNDE2IDQ5Ljg4MjcgMTEyLjQyMSA0OS45MDRDMTEyLjQ2MSA1MC4wNDI3IDExMi40OTkgNTAuMTgxNCAxMTIuNTM5IDUwLjMxNDdDMTEzLjE3MSA1Mi40MTM0IDExNC4wODggNTQuMTE0NyAxMTUuNDQ4IDU1LjM4NEMxMTYuNjYxIDU2LjY5MDcgMTE4LjI4MyA1Ny41ODk0IDEyMC4yNjQgNTguMjEzNEMxMjAuMzYgNTguMjQgMTIwLjQ2NCA1OC4yNjk0IDEyMC41NTUgNTguMzAxNEMxMjAuNTYgNTguMzA2NyAxMjAuNTYgNTguMzA2NyAxMjAuNTY1IDU4LjMwNjdDMTIwLjg0OCA1OC4zOTQ3IDEyMS4xNDEgNTguNDY5NCAxMjEuNDQzIDU4LjU0NjdDMTIxLjQ1MyA1OC41NDY3IDEyMS40NjQgNTguNTUyIDEyMS40OCA1OC41NTc0QzEyMi44NzUgNTguODk2IDEyNC40MjQgNTkuMTMzNCAxMjYuMTEyIDU5LjMwMTRDMTI2LjMyNSA1OS4zMjI3IDEyNi41NDEgNTkuMzQxNCAxMjYuNzYzIDU5LjM2MjdDMTMwLjc4OSA1OS43MTIgMTM1LjU2IDU5LjcxMiAxNDAuOTA0IDU5Ljg0NTRDMTUyLjk3MyA1OS41Mzg3IDE2Mi4xMjggNTkuOTI4IDE2Ni4zNiA1NS4zODRDMTcwLjkwNyA1MS4xNTIgMTcwLjUxNSA0MS45OTQ3IDE3MC44MjQgMjkuOTI1NEMxNzAuNTE3IDE3Ljg1MDcgMTcwLjkwNyA4LjY5NjAyIDE2Ni4zNjMgNC40NjkzNUMxNjIuMTMxIC0wLjA3NDY1MTEgMTUyLjk3MyAwLjMwOTM0OSAxNDAuOTA0IDEuNTI1ODhlLTA1QzEyOC44MjkgMC4zMDkzNDkgMTE5LjY3NSAtMC4wNzQ2NTExIDExNS40NDggNC40NjkzNUMxMTAuOTA0IDguNjk2MDIgMTExLjI4OCAxNy44NTA3IDExMC45NzkgMjkuOTI1NEMxMTEuMTE3IDM1LjMwMTQgMTExLjExNyA0MC4xMDE0IDExMS40NzIgNDQuMTQ0QzExMS42NjEgNDYuMjYxNCAxMTEuOTQ5IDQ4LjE3MDcgMTEyLjQwNSA0OS44NDhaIiBmaWxsPSIjRkY2Mzc2Ij48L3BhdGg+PC9nPjwvc3ZnPgo=",Portal:Yt}}}),function(){var e,t=this,n=t._self._c,o=t._self._setupProxy;return n("div",{staticClass:"my-4 rounded-lg border overflow-hidden shadow-sm",class:[o.props.isDark?"border-gray-700/30":"border-gray-200",{"is-rendering":o.props.loading}],attrs:{"data-markstream-infographic":"1","data-markstream-mode":o.showSource?"source":o.hasRenderError?"error":o.hasPreview?"preview":"pending"}},[o.props.showHeader?n("div",{staticClass:"infographic-block-header flex justify-between items-center px-4 py-2.5 border-b",class:o.props.isDark?"bg-gray-800 border-gray-700/30":"bg-gray-50 border-gray-200"},[t.$slots["header-left"]?n("div",[t._t("header-left")],2):n("div",{staticClass:"flex items-center gap-x-2 overflow-hidden"},[n("img",{staticClass:"w-4 h-4 my-0",attrs:{src:o.infographicIconUrl,alt:"Infographic"}}),n("span",{staticClass:"text-sm font-medium font-mono truncate",class:o.props.isDark?"text-gray-400":"text-gray-600"},[t._v("Infographic")])]),t.$slots["header-center"]?n("div",[t._t("header-center")],2):o.props.showModeToggle?n("div",{staticClass:"flex items-center gap-x-1 rounded-md p-0.5",class:o.props.isDark?"bg-gray-700":"bg-gray-100"},[n("button",{staticClass:"px-2.5 py-1 text-xs rounded transition-colors",class:[o.showSource?o.props.isDark?"text-gray-400 hover:text-gray-200":"text-gray-500 hover:text-gray-700":o.props.isDark?"bg-gray-600 text-gray-200 shadow-sm":"bg-white text-gray-700 shadow-sm"],on:{click:()=>o.handleSwitchMode("preview"),mouseenter:function(e){o.onBtnHover(e,o.t("common.preview")||"Preview")},focus:function(e){o.onBtnHover(e,o.t("common.preview")||"Preview")},mouseleave:o.onBtnLeave,blur:o.onBtnLeave}},[n("div",{staticClass:"flex items-center gap-x-1"},[n("svg",{staticClass:"w-3 h-3",attrs:{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"}},[n("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[n("path",{attrs:{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"}}),n("circle",{attrs:{cx:"12",cy:"12",r:"3"}})])]),n("span",[t._v(t._s(o.t("common.preview")||"Preview"))])])]),n("button",{staticClass:"px-2.5 py-1 text-xs rounded transition-colors",class:[o.showSource?o.props.isDark?"bg-gray-600 text-gray-200 shadow-sm":"bg-white text-gray-700 shadow-sm":o.props.isDark?"text-gray-400 hover:text-gray-200":"text-gray-500 hover:text-gray-700"],on:{click:()=>o.handleSwitchMode("source"),mouseenter:function(e){o.onBtnHover(e,o.t("common.source")||"Source")},focus:function(e){o.onBtnHover(e,o.t("common.source")||"Source")},mouseleave:o.onBtnLeave,blur:o.onBtnLeave}},[n("div",{staticClass:"flex items-center gap-x-1"},[n("svg",{staticClass:"w-3 h-3",attrs:{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"}},[n("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m16 18l6-6l-6-6M8 6l-6 6l6 6"}})]),n("span",[t._v(t._s(o.t("common.source")||"Source"))])])])]):t._e(),t.$slots["header-right"]?n("div",[t._t("header-right")],2):n("div",{staticClass:"flex items-center gap-x-1"},[o.props.showCollapseButton?n("button",{class:o.computedButtonStyle,attrs:{"aria-pressed":o.isCollapsed},on:{click:function(e){o.isCollapsed=!o.isCollapsed},mouseenter:function(e){o.onBtnHover(e,o.isCollapsed?o.t("common.expand")||"Expand":o.t("common.collapse")||"Collapse")},focus:function(e){o.onBtnHover(e,o.isCollapsed?o.t("common.expand")||"Expand":o.t("common.collapse")||"Collapse")},mouseleave:o.onBtnLeave,blur:o.onBtnLeave}},[n("svg",{staticClass:"w-3 h-3",style:{rotate:o.isCollapsed?"0deg":"90deg"},attrs:{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"}},[n("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"}})])]):t._e(),o.props.showCopyButton?n("button",{class:o.computedButtonStyle,on:{click:o.copy,mouseenter:function(e){return o.onCopyHover(e)},focus:function(e){return o.onCopyHover(e)},mouseleave:o.onBtnLeave,blur:o.onBtnLeave}},[o.copyText?n("svg",{staticClass:"w-3 h-3",attrs:{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"}},[n("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"}})]):n("svg",{staticClass:"w-3 h-3",attrs:{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"}},[n("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[n("rect",{attrs:{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}}),n("path",{attrs:{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"}})])])]):t._e(),o.props.showExportButton?n("button",{class:`${o.computedButtonStyle} ${o.isFullscreenDisabled?"opacity-50 cursor-not-allowed":""}`,attrs:{disabled:o.isFullscreenDisabled},on:{click:o.handleExportClick,mouseenter:function(e){o.onBtnHover(e,o.t("common.export")||"Export")},focus:function(e){o.onBtnHover(e,o.t("common.export")||"Export")},mouseleave:o.onBtnLeave,blur:o.onBtnLeave}},[n("svg",{staticClass:"w-3 h-3",attrs:{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"}},[n("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[n("path",{attrs:{d:"M12 15V3m9 12v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}}),n("path",{attrs:{d:"m7 10l5 5l5-5"}})])])]):t._e(),o.props.showFullscreenButton?n("button",{class:`${o.computedButtonStyle} ${o.isFullscreenDisabled?"opacity-50 cursor-not-allowed":""}`,attrs:{disabled:o.isFullscreenDisabled},on:{click:o.handleOpenModalClick,mouseenter:function(e){o.onBtnHover(e,o.isModalOpen?o.t("common.minimize")||"Minimize":o.t("common.open")||"Open")},focus:function(e){o.onBtnHover(e,o.isModalOpen?o.t("common.minimize")||"Minimize":o.t("common.open")||"Open")},mouseleave:o.onBtnLeave,blur:o.onBtnLeave}},[o.isModalOpen?n("svg",{attrs:{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"}},[n("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"}})]):n("svg",{attrs:{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"}},[n("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"}})])]):t._e()])]):t._e(),n("div",{directives:[{name:"show",rawName:"v-show",value:!o.isCollapsed,expression:"!isCollapsed"}]},[o.showSource?n("div",{staticClass:"p-4",class:o.props.isDark?"bg-gray-900":"bg-gray-50"},[n("pre",{staticClass:"text-sm font-mono whitespace-pre-wrap",class:o.props.isDark?"text-gray-300":"text-gray-700"},[t._v(t._s(o.baseCode))])]):n("div",{staticClass:"relative"},[o.props.showZoomControls?n("div",{staticClass:"absolute top-2 right-2 z-10 rounded-lg"},[n("div",{staticClass:"flex items-center gap-2 backdrop-blur rounded-lg"},[n("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[o.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:o.zoomIn,mouseenter:function(e){o.onBtnHover(e,o.t("common.zoomIn")||"Zoom in")},focus:function(e){o.onBtnHover(e,o.t("common.zoomIn")||"Zoom in")},mouseleave:o.onBtnLeave,blur:o.onBtnLeave}},[n("svg",{staticClass:"w-3 h-3",attrs:{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"}},[n("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[n("circle",{attrs:{cx:"11",cy:"11",r:"8"}}),n("path",{attrs:{d:"m21 21l-4.35-4.35M11 8v6m-3-3h6"}})])])]),n("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[o.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:o.zoomOut,mouseenter:function(e){o.onBtnHover(e,o.t("common.zoomOut")||"Zoom out")},focus:function(e){o.onBtnHover(e,o.t("common.zoomOut")||"Zoom out")},mouseleave:o.onBtnLeave,blur:o.onBtnLeave}},[n("svg",{staticClass:"w-3 h-3",attrs:{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"}},[n("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[n("circle",{attrs:{cx:"11",cy:"11",r:"8"}}),n("path",{attrs:{d:"m21 21l-4.35-4.35M8 11h6"}})])])]),n("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[o.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:o.resetZoom,mouseenter:function(e){o.onBtnHover(e,o.t("common.resetZoom")||"Reset zoom")},focus:function(e){o.onBtnHover(e,o.t("common.resetZoom")||"Reset zoom")},mouseleave:o.onBtnLeave,blur:o.onBtnLeave}},[t._v(" "+t._s(Math.round(100*o.zoom))+"% ")])])]):t._e(),n("div",{staticClass:"infographic-preview min-h-[var(--ms-size-diagram-min-height,360px)] relative transition-all duration-100 overflow-hidden block",class:[o.props.isDark?"bg-gray-900":"bg-gray-50",{"infographic-pan-touch":o.panSurfaceClaimsTouch}],style:{height:o.containerHeight,maxHeight:null!=(e=o.props.maxHeight)?e:void 0},on:{pointerdown:o.startDrag}},[o.hasPreview||o.hasRenderError?t._e():n("pre",{staticClass:"absolute inset-0 overflow-auto p-4 text-left text-sm font-mono whitespace-pre-wrap"},[t._v(t._s(o.baseCode))]),n("div",{staticClass:"absolute inset-0 cursor-grab",class:{"cursor-grabbing":o.isDragging},style:o.transformStyle},[n("div",{ref:"infographicContainer",staticClass:"w-full text-center flex items-center justify-center min-h-full"})])])])]),n(o.Portal,{attrs:{to:"body"}},[n("div",{staticClass:"markstream-vue"},[n("transition",{attrs:{name:"infographic-dialog",appear:""}},[o.isModalOpen?n("div",{staticClass:"fixed inset-0 z-50 flex items-center justify-center bg-black/70 p-4",on:{click:function(e){return e.target!==e.currentTarget?null:o.closeModal.apply(null,arguments)}}},[n("div",{staticClass:"dialog-panel relative w-full h-full max-w-full max-h-full rounded shadow-lg overflow-hidden",class:o.props.isDark?"bg-gray-900":"bg-white"},[n("div",{staticClass:"absolute top-6 right-6 z-50 flex items-center gap-2"},[n("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[o.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:o.zoomIn}},[n("svg",{staticClass:"w-3 h-3",attrs:{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"}},[n("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[n("circle",{attrs:{cx:"11",cy:"11",r:"8"}}),n("path",{attrs:{d:"m21 21l-4.35-4.35M11 8v6m-3-3h6"}})])])]),n("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[o.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:o.zoomOut}},[n("svg",{staticClass:"w-3 h-3",attrs:{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"}},[n("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[n("circle",{attrs:{cx:"11",cy:"11",r:"8"}}),n("path",{attrs:{d:"m21 21l-4.35-4.35M8 11h6"}})])])]),n("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[o.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:o.resetZoom}},[t._v(" "+t._s(Math.round(100*o.zoom))+"% ")]),n("button",{staticClass:"inline-flex items-center justify-center p-2 rounded transition-colors",class:[o.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:o.closeModal}},[n("svg",{staticClass:"w-3 h-3",attrs:{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"}},[n("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18 6L6 18M6 6l12 12"}})])])]),n("div",{ref:"modalContent",staticClass:"w-full h-full flex items-center justify-center p-4 overflow-hidden",class:{"cursor-grab":!o.isDragging,"cursor-grabbing":o.isDragging,"infographic-pan-touch":o.panSurfaceClaimsTouch},on:{pointerdown:o.startDrag}})])]):t._e()])],1)])],1)},[],!1,null,"e6357a0d",null,null).exports,pn=M(m.defineComponent({name:"MarkdownRender",components:{LegacyNodesRenderer:Ht,NodeRenderer:en},props:{content:String,nodes:Array,final:Boolean,parseOptions:Object,customMarkdownIt:Function,debugPerformance:Boolean,customHtmlTags:Array,viewportPriority:Boolean,codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:String,codeBlockLightTheme:String,renderCodeBlocksAsPre:Boolean,codeBlockMinWidth:[String,Number],codeBlockMaxWidth:[String,Number],codeBlockOptions:Object,codeBlockProps:Object,showTooltips:Boolean,themes:Array,isDark:Boolean,customId:[String,Number],indexKey:[String,Number],typewriter:Boolean,fade:{type:Boolean,default:!0},batchRendering:Boolean,initialRenderBatchSize:Number,renderBatchSize:Number,renderBatchDelay:Number,renderBatchBudgetMs:Number,renderBatchIdleTimeoutMs:Number,deferNodesUntilVisible:Boolean,maxLiveNodes:Number,liveNodeBuffer:Number},data(){return{instanceMsgId:this.customId?`renderer-${this.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`}},computed:{legacyVue26(){return w(this)},mergedParseOptions(){var e,t;const n=null!=(e=this.parseOptions)?e:{},o=null!=(t=this.final)?t:n.final,r=c.mergeCustomHtmlTags(this.customHtmlTags,n.customHtmlTags),l=null!=o,i=r.length>0;return l||i?s(s(s({},n),l?{final:o}:{}),i?{customHtmlTags:r}:{}):n},parsedLegacyNodes(){var e;if(Array.isArray(this.nodes)&&this.nodes.length>0)return this.nodes;if(!this.content)return[];const{key:t,tags:n}=c.resolveCustomHtmlTags(null==(e=this.mergedParseOptions)?void 0:e.customHtmlTags),o=c.getMarkdown(t?`${this.instanceMsgId}:${t}`:this.instanceMsgId,{customHtmlTags:n}),r=this.customMarkdownIt?this.customMarkdownIt(o):o;return c.parseMarkdownToStructure(this.content,r,this.mergedParseOptions)},forwardedProps(){return{content:this.content,nodes:this.nodes,final:this.final,parseOptions:this.parseOptions,customMarkdownIt:this.customMarkdownIt,debugPerformance:this.debugPerformance,customHtmlTags:this.customHtmlTags,viewportPriority:this.viewportPriority,codeBlockStream:this.codeBlockStream,codeBlockDarkTheme:this.codeBlockDarkTheme,codeBlockLightTheme:this.codeBlockLightTheme,renderCodeBlocksAsPre:this.renderCodeBlocksAsPre,codeBlockMinWidth:this.codeBlockMinWidth,codeBlockMaxWidth:this.codeBlockMaxWidth,codeBlockOptions:this.codeBlockOptions,codeBlockProps:this.codeBlockProps,showTooltips:this.showTooltips,themes:this.themes,isDark:this.isDark,customId:this.customId,indexKey:this.indexKey,typewriter:this.typewriter,fade:this.fade,batchRendering:this.batchRendering,initialRenderBatchSize:this.initialRenderBatchSize,renderBatchSize:this.renderBatchSize,renderBatchDelay:this.renderBatchDelay,renderBatchBudgetMs:this.renderBatchBudgetMs,renderBatchIdleTimeoutMs:this.renderBatchIdleTimeoutMs,deferNodesUntilVisible:this.deferNodesUntilVisible,maxLiveNodes:this.maxLiveNodes,liveNodeBuffer:this.liveNodeBuffer}}},render(e){const t=k(this);return this.legacyVue26?e(Ht,s({props:{nodes:this.parsedLegacyNodes,customId:this.customId,indexKey:this.indexKey,typewriter:this.typewriter,fade:this.fade,showTooltips:this.showTooltips,codeBlockStream:this.codeBlockStream,codeBlockDarkTheme:this.codeBlockDarkTheme,codeBlockLightTheme:this.codeBlockLightTheme,renderCodeBlocksAsPre:this.renderCodeBlocksAsPre,codeBlockMinWidth:this.codeBlockMinWidth,codeBlockMaxWidth:this.codeBlockMaxWidth,codeBlockOptions:this.codeBlockOptions,codeBlockProps:this.codeBlockProps,themes:this.themes,isDark:this.isDark}},Object.keys(t).length>0?{on:t}:{})):e(en,s({props:this.forwardedProps},Object.keys(t).length>0?{on:t}:{}))}}),null,null,!1,null,null,null,null).exports,fn=new Map;function vn(e,t){if(fn.delete(e),fn.set(e,t),fn.size>200){const e=fn.keys().next().value;e&&fn.delete(e)}}function hn(e){if(!e)return null;const t=fn.get(e)||null;return t&&vn(e,t),t}function gn(e,t){e&&t&&vn(e,{html:t})}function yn(e){return e?e.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}let wn=null,xn=null,kn=!1;const Mn=new Map,bn=new Map;let Cn=5;const Tn=new Set;function Nn(){if(Mn.size<Cn&&Tn.size){const t=Array.from(Tn);Tn.clear();for(const n of t)try{n()}catch(e){}}}let _n=null;const Dn=void 0!=={url:"undefined"==typeof document?require("url").pathToFileURL(__filename).href:v&&"SCRIPT"===v.tagName.toUpperCase()&&v.src||new URL("index.cjs",document.baseURI).href}&&Boolean(null==(e={BASE_URL:"/",MODE:"npm",DEV:!1,PROD:!0,SSR:!1})?void 0:e.DEV);try{"undefined"!=typeof window&&Dn&&Promise.resolve().then(()=>require("./chunks/performance-monitor-698d0e66.cjs")).then(e=>{_n=e.perfMonitor})}catch(po){}function In(e,t=!0,n=2e3,o){return d(this,null,function*(){const r=performance.now(),l=yn(e);if(!we()){const e=new Error("KaTeX rendering disabled");return e.name="KaTeXDisabled",e.code="KATEX_DISABLED",Promise.reject(e)}if(xn)return Promise.reject(xn);const i=`${t?"d":"i"}:${l}`,a=bn.get(i);if(a)return _n&&_n.recordRender({type:"cache-hit",duration:performance.now()-r,formulaLength:l.length,timestamp:Date.now(),success:!0}),Promise.resolve(a);const s=wn||(xn=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),xn.name="WorkerInitError",xn.code="WORKER_INIT_ERROR",null);if(!s)return Promise.reject(xn);if(Mn.size>=Cn){const e=new Error("Worker busy");return e.name="WorkerBusy",e.code="WORKER_BUSY",e.busy=!0,e.inFlight=Mn.size,e.max=Cn,_n&&_n.recordRender({type:"worker",duration:performance.now()-r,formulaLength:l.length,timestamp:Date.now(),success:!1,error:"busy"}),Promise.reject(e)}return new Promise((e,i)=>{if(null==o?void 0:o.aborted){const e=new Error("Aborted");return e.name="AbortError",void i(e)}const a=Math.random().toString(36).slice(2),u=globalThis.setTimeout(()=>{Mn.delete(a);const e=new Error("Worker render timed out");e.name="WorkerTimeout",e.code="WORKER_TIMEOUT",_n&&_n.recordRender({type:"worker",duration:performance.now()-r,formulaLength:l.length,timestamp:Date.now(),success:!1,error:"timeout"}),i(e),Nn()},n);o&&o.addEventListener("abort",()=>{globalThis.clearTimeout(u),Mn.has(a)&&Mn.delete(a);const e=new Error("Aborted");e.name="AbortError",i(e),Nn()},{once:!0});const d=e,c=i;Mn.set(a,{resolve:e=>{_n&&_n.recordRender({type:"worker",duration:performance.now()-r,formulaLength:l.length,timestamp:Date.now(),success:!0}),d(e)},reject:e=>{_n&&_n.recordRender({type:"worker",duration:performance.now()-r,formulaLength:l.length,timestamp:Date.now(),success:!1,error:(null==e?void 0:e.message)||String(e)}),c(e)},timeoutId:u}),s.postMessage({id:a,content:l,displayMode:t})})})}function Sn(e,t=!0,n){const o=`${t?"d":"i"}:${yn(e)}`;if(bn.set(o,n),bn.size>200){const e=bn.keys().next().value;bn.delete(e)}}const jn="WORKER_BUSY";function En(e=2e3,t){return Mn.size<Cn?Promise.resolve():new Promise((n,o)=>{let r,l=!1;const i=()=>{l||(l=!0,r&&globalThis.clearTimeout(r),Tn.delete(i),n())};if(Tn.add(i),r=globalThis.setTimeout(()=>{if(l)return;l=!0,Tn.delete(i);const e=new Error("Wait for worker slot timed out");e.name="WorkerBusyTimeout",e.code="WORKER_BUSY_TIMEOUT",o(e)},e),queueMicrotask(()=>Nn()),t){const e=()=>{if(l)return;l=!0,r&&globalThis.clearTimeout(r),Tn.delete(i);const e=new Error("Aborted");e.name="AbortError",o(e)};t.aborted?e():t.addEventListener("abort",e,{once:!0})}})}const Ln={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function Bn(e){return d(this,arguments,function*(e,t=!0,n={}){var o,r,l,i;if(!we()){const e=new Error("KaTeX rendering disabled");throw e.name="KaTeXDisabled",e.code="KATEX_DISABLED",e}const a=null!=(o=n.timeout)?o:Ln.timeout,s=null!=(r=n.waitTimeout)?r:Ln.waitTimeout,u=null!=(l=n.backoffMs)?l:Ln.backoffMs,d=null!=(i=n.maxRetries)?i:Ln.maxRetries,c=Number.isFinite(d)?Math.max(0,Math.min(Math.floor(d),8)):Ln.maxRetries,m=n.signal;let p=0;for(;;){if(null==m?void 0:m.aborted){const e=new Error("Aborted");throw e.name="AbortError",e}try{return yield In(e,t,a,m)}catch(f){if((null==f?void 0:f.code)!==jn||p>=c)throw f;if(p++,yield En(s,m).catch(()=>{}),null==m?void 0:m.aborted){const e=new Error("Aborted");throw e.name="AbortError",e}u>0&&(yield new Promise(e=>globalThis.setTimeout(e,u*p)))}}})}const An=M(m.defineComponent({__name:"MathBlockNode",props:{node:null,indexKey:null},setup(e){const t=e,n=m.computed(()=>yn(t.node.content)),o=m.ref(null),r=jt();let l=null,i=0,a=!1,s=null;const u=m.computed(()=>null==t.indexKey?null:`block:${String(t.indexKey)}`),c=hn(u.value),p=m.ref((null==c?void 0:c.html)||""),f=m.ref(""),v=m.ref(!(null==c?void 0:c.html));let h=Boolean(null==c?void 0:c.html);function g(){return d(this,null,function*(){const e=yield xe();if(!e)return!1;try{const o=e.renderToString(n.value,{throwOnError:t.node.loading,displayMode:!0});return y(o),Sn(n.value,!0,o),!0}catch(po){return!1}})}function y(e){p.value=e,f.value="",v.value=!1,h=!0,gn(u.value,e)}function w(){p.value="",f.value=t.node.raw,v.value=!1}function x(){return d(this,null,function*(){if(a)return;if(!t.node.content)return w(),void(h=!0);const e=hn(u.value);if((null==e?void 0:e.html)&&!p.value&&(p.value=e.html,h=!0,v.value=!1),!h){v.value=!0;try{!l&&o.value&&(l=r(o.value)),yield null==l?void 0:l.whenVisible}catch(po){}}s&&(s.abort(),s=null);const d=++i,c=new AbortController;s=c;try{const e=yield Bn(n.value,!0,{timeout:3e3,waitTimeout:2e3,maxRetries:1,signal:c.signal});if(a||d!==i)return;y(e)}catch(m){if(a||d!==i)return;if("AbortError"===(null==m?void 0:m.name))return;const e=(null==m?void 0:m.code)||(null==m?void 0:m.name),n="KATEX_DISABLED"===e;if(("WORKER_INIT_ERROR"===e||(null==m?void 0:m.fallbackToRenderer)||e===jn||"WORKER_TIMEOUT"===e)&&(yield g()))return;if(h||p.value)return;n||!t.node.loading?w():v.value=!0}})}return m.watch(()=>[t.node.content,t.node.loading,t.node.raw,t.indexKey],()=>x()),m.onMounted(()=>{x()}),m.onBeforeUnmount(()=>{var e;a=!0,s&&(s.abort(),s=null),null==(e=null==l?void 0:l.destroy)||e.call(l),l=null}),{__sfc:!0,props:t,mathContent:n,containerEl:o,registerVisibility:r,visibilityHandle:l,currentRenderId:i,isUnmounted:a,currentAbortController:s,cacheKey:u,initialCached:c,renderedHtml:p,fallbackText:f,renderingLoading:v,hasRenderedOnce:h,renderWithMainThreadFallback:g,applySuccessfulRender:y,applyRawFallback:w,renderMath:x}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("div",{ref:"containerEl",staticClass:"math-block text-center overflow-x-auto relative min-h-[40px]"},[n.renderedHtml?t("div",{staticClass:"math-block__content",domProps:{innerHTML:e._s(n.renderedHtml)}}):n.fallbackText?t("div",{staticClass:"math-block__fallback"},[e._v(" "+e._s(n.fallbackText)+" ")]):e._e(),!n.renderingLoading||n.renderedHtml||n.fallbackText?e._e():t("div",{staticClass:"math-loading-overlay"},[t("div",{staticClass:"math-loading-spinner"})])])},[],!1,null,"50fb5666",null,null).exports,On=M(m.defineComponent({__name:"MathInlineNode",props:{node:null,indexKey:null},setup(e){const t=e,n=m.ref(null),o=jt();let r=null,l=0,i=!1,a=null;const s=m.computed(()=>"$$"===t.node.markup),u=m.computed(()=>yn(t.node.content)),c=m.computed(()=>null==t.indexKey?null:`inline:${String(t.indexKey)}`),p=hn(c.value),f=m.ref((null==p?void 0:p.html)||""),v=m.ref(""),h=m.ref(!(null==p?void 0:p.html));let g=Boolean(null==p?void 0:p.html);function y(){return d(this,null,function*(){const e=yield xe();if(!e)return!1;try{const n=e.renderToString(u.value,{throwOnError:t.node.loading,displayMode:s.value});return w(n),Sn(u.value,s.value,n),!0}catch(po){return!1}})}function w(e){f.value=e,v.value="",h.value=!1,g=!0,gn(c.value,e)}function x(){f.value="",v.value=t.node.raw,h.value=!1}function k(){return d(this,null,function*(){if(i)return;if(!t.node.content)return f.value="",v.value=t.node.loading?"":t.node.raw,h.value=!!t.node.loading,void(g=!t.node.loading);const e=hn(c.value);(null==e?void 0:e.html)&&!f.value&&(f.value=e.html,g=!0,h.value=!1),a&&(a.abort(),a=null);const d=++l,m=new AbortController;if(a=m,!g){h.value=!0;try{!r&&n.value&&(r=o(n.value)),yield null==r?void 0:r.whenVisible}catch(po){}}try{const e=yield Bn(u.value,s.value,{timeout:1500,waitTimeout:0,maxRetries:0,signal:m.signal});if(i||d!==l)return;w(e)}catch(p){if(i||d!==l)return;if("AbortError"===(null==p?void 0:p.name))return;const e=(null==p?void 0:p.code)||(null==p?void 0:p.name),n="KATEX_DISABLED"===e;if(("WORKER_INIT_ERROR"===e||(null==p?void 0:p.fallbackToRenderer)||e===jn||"WORKER_TIMEOUT"===e)&&(yield y()))return;if(g||f.value)return;n||!t.node.loading?x():h.value=!0}})}return m.watch(()=>[t.node.content,t.node.loading,t.node.markup,t.node.raw,t.indexKey],()=>k()),m.onMounted(()=>{k()}),m.onBeforeUnmount(()=>{var e;i=!0,a&&(a.abort(),a=null),null==(e=null==r?void 0:r.destroy)||e.call(r),r=null}),{__sfc:!0,props:t,containerEl:n,registerVisibility:o,visibilityHandle:r,currentRenderId:l,isUnmounted:i,currentAbortController:a,displayMode:s,mathContent:u,cacheKey:c,initialCached:p,renderedHtml:f,fallbackText:v,renderingLoading:h,hasRenderedOnce:g,renderWithMainThreadFallback:y,applySuccessfulRender:w,applyRawFallback:x,renderMath:k}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("span",{ref:"containerEl",staticClass:"math-inline-wrapper"},[n.renderedHtml?t("span",{staticClass:"math-inline",domProps:{innerHTML:e._s(n.renderedHtml)}}):n.fallbackText?t("span",{staticClass:"math-inline math-inline--fallback"},[e._v(e._s(n.fallbackText))]):e._e(),!n.renderingLoading||n.renderedHtml||n.fallbackText?e._e():t("span",{staticClass:"math-inline__loading",attrs:{role:"status","aria-live":"polite"}},[e._t("loading",function(){return[t("span",{staticClass:"math-inline__spinner animate-spin",attrs:{"aria-hidden":"true"}}),t("span",{staticClass:"sr-only"},[e._v("Loading")])]},{isLoading:n.renderingLoading})],2)])},[],!1,null,"6e33b527",null,null).exports,zn=()=>import("mermaid");let Pn=null,Rn=zn;function Hn(e){Rn=e,Pn=null}function $n(){return"function"==typeof Rn}function Un(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 u(s({},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}function Fn(e){if(e)try{const t=null==e?void 0:e.initialize;e.initialize=n=>{const o=s({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(po){}}let Yn=null,Kn=null;const Wn=new Map;let Qn=5,Vn=!1;const Xn="WORKER_BUSY",qn="MERMAID_DISABLED";function Gn(e,t,n=1400){if(!$n()){const e=new Error("Mermaid rendering disabled");return e.name="MermaidDisabled",e.code=qn,Promise.reject(e)}if(Kn)return Promise.reject(Kn);const o=Yn||(Kn=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),Kn.name="WorkerInitError",Kn.code="WORKER_INIT_ERROR",null);if(!o)return Promise.reject(Kn);if(Wn.size>=Qn){const e=new Error("Worker busy");return e.name="WorkerBusy",e.code=Xn,e.inFlight=Wn.size,e.max=Qn,Promise.reject(e)}return new Promise((r,l)=>{const i=Math.random().toString(36).slice(2);let a,s=!1;const u=()=>{s||(s=!0,null!=a&&globalThis.clearTimeout(a),Wn.delete(i))},d={resolve:e=>{u(),r(e)},reject:e=>{u(),l(e)}};Wn.set(i,d);try{o.postMessage({id:i,action:e,payload:t})}catch(c){return Wn.delete(i),void l(c)}a=globalThis.setTimeout(()=>{const e=new Error("Worker call timed out");e.name="WorkerTimeout",e.code="WORKER_TIMEOUT";const t=Wn.get(i);t&&t.reject(e)},n)})}function Zn(e,t,n=1400){return d(this,null,function*(){try{return yield Gn("canParse",{code:e,theme:t},n)}catch(po){return Promise.reject(po)}})}function Jn(e,t,n=1400){return d(this,null,function*(){try{return yield Gn("findPrefix",{code:e,theme:t},n)}catch(po){return Promise.reject(po)}})}function eo(){if(Yn)try{for(const[e,t]of Wn.entries())t.reject(new Error("Worker terminated"));Wn.clear(),Yn.terminate()}finally{Yn=null}}const to=M(m.defineComponent({__name:"MermaidBlockNode",props:{node:null,maxHeight:{default:"500px"},estimatedPreviewHeightPx:null,loading:{type:Boolean,default:!0},isDark:{type:Boolean},workerTimeoutMs:{default:1400},parseTimeoutMs:{default:1800},renderTimeoutMs:{default:2500},fullRenderTimeoutMs:{default:4e3},renderDebounceMs:{default:300},contentStableDelayMs:{default:500},previewPollDelayMs:{default:800},previewPollMaxDelayMs:{default:4e3},previewPollMaxAttempts:{default:12},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},enableWheelZoom:{type:Boolean,default:!1},isStrict:{type:Boolean,default:!0},enableMermaidInteractions:{type:Boolean,default:!1},onRenderError:null},emits:["copy","export","openModal","toggleMode"],setup(e,{emit:t}){var n,o;const r=e,l={USE_PROFILES:{svg:!0},FORBID_TAGS:["script"],FORBID_ATTR:[/^on/i],ADD_TAGS:["style"],ADD_ATTR:["style"],SAFE_FOR_TEMPLATES:!0},i=m.ref(!1),a=m.computed(()=>r.isStrict?"strict":"loose"),f=m.computed(()=>({startOnLoad:!1,securityLevel:a.value,dompurifyConfig:"strict"===a.value?l:void 0,flowchart:"strict"===a.value?{htmlLabels:!1}:void 0}));function h(e,t){if(!e)return null;const n=c.toSafeSvgElement(t);return n?(g(e),e.appendChild(n),{svg:e.innerHTML,bindTarget:e}):null}function g(e){if(e)try{e.replaceChildren()}catch(po){e.innerHTML=""}}function y(e,t,n={}){if(!e)return null;const o=h(e,t);return o||n.keepPreviousOnFailure||g(e),o}let w=null;function x(e){if(r.enableMermaidInteractions&&(null==e?void 0:e.querySelector("svg")))try{null==w||w(e)}catch(po){}}const{t:k}=de();function M(){return d(this,null,function*(){try{const e=yield function(){return d(this,null,function*(){if(Pn)return Pn;const e=function(){try{const e=globalThis;return Un(null==e?void 0:e.mermaid)}catch(po){return null}}();if(e)return Pn=e,Fn(Pn),Pn;const t=Rn;if(!t)return null;let n;try{n=yield t()}catch(o){if(t===zn)throw new Error('Optional dependency "mermaid" is not installed. Please install it to enable mermaid diagrams.');throw o}return n?(Pn=Un(n),Fn(Pn),Pn):null})}();return i.value=!!e,e}catch(e){throw i.value=!1,e}})}"undefined"!=typeof window&&(()=>{d(this,null,function*(){var e;try{const t=yield M();if(!t)return;null==(e=null==t?void 0:t.initialize)||e.call(t,s({},f.value))}catch(t){i.value=!1,console.warn("[markstream-vue2] Failed to initialize mermaid renderer. Call enableMermaid() to configure a loader.",t)}})})();const b=m.ref(!1),C=m.ref(!1),T=m.ref(),N=m.ref(),_=m.ref(),D=m.ref(null),I=jt();let S=null;const j=m.ref("undefined"==typeof window),E=m.ref(),L=m.computed(()=>r.node.code.replace(/\]::([^:])/g,"]:::$1").replace(/:::subgraphNode$/gm,"::subgraphNode")),B=m.computed(()=>r.maxHeight&&"none"!==r.maxHeight?Vt(r.maxHeight):null),A=m.computed(()=>{var e;return null!=(e=Vt(r.estimatedPreviewHeightPx))?e:Xt(L.value)});function O(){var e;return null!=(e=Vt(T.value?getComputedStyle(T.value).getPropertyValue("--ms-size-diagram-min-height").trim():""))?e:360}function z(e){return Zt(e,O(),B.value)}function P(){return z(A.value)}function R(e,t=L.value){const n=t,o=`%%{init: {"theme": "${"dark"===e?"dark":"default"}"}}%%\n`;return n.trim().startsWith("%%{")?n:o+n}function H(e){var t;for(const n of e.split(/\r?\n/)){const e=n.trim();if(!e||e.startsWith("%%"))continue;const o=e.match(/^([A-Z][\w-]*)\b/i);return(null==(t=null==o?void 0:o[1])?void 0:t.toLowerCase())||""}return""}const $=m.ref(1),U=m.ref(0),F=m.ref(0),Y=m.ref(!1),K=m.ref("undefined"==typeof window),W=m.ref(!1),Q=m.ref(!1),V=m.ref(null),X=m.ref(0),q=m.ref(!1),G=m.computed(()=>{var e;return Math.max(0,null!=(e=r.renderDebounceMs)?e:300)}),Z=m.computed(()=>{var e;return Math.max(0,null!=(e=r.contentStableDelayMs)?e:500)}),J=m.computed(()=>{var e;return Math.max(120,null!=(e=r.previewPollDelayMs)?e:800)}),ee=m.computed(()=>{var e;return Math.max(J.value,null!=(e=r.previewPollMaxDelayMs)?e:4e3)}),te=m.computed(()=>{var e;return Math.max(1,Math.trunc(null!=(e=r.previewPollMaxAttempts)?e:12))});let ne=null,oe=null,re=null,le=0;const se=null!=(n=globalThis.requestIdleCallback)?n:(e,t)=>setTimeout(()=>e({didTimeout:!0}),16);function ue(){return j.value&&!C.value}function ce(){null!=re&&(globalThis.clearTimeout(re),re=null)}function me(){ce(),re=globalThis.setTimeout(()=>{re=null,ue()&&se(()=>{ue()&&vt()},{timeout:500})},G.value)}function pe(){null!=oe&&(globalThis.clearTimeout(oe),oe=null)}function fe(e=600){if("undefined"==typeof globalThis)return;const t=Math.max(0,e);pe(),oe=globalThis.setTimeout(()=>{oe=null,r.loading||Q.value||!ue()?fe(Math.min(1200,Math.max(300,1.2*t))):me()},t)}const ve=m.ref(`${P()}px`);let he=null;m.watch(A,e=>{if(K.value||C.value)return;const t=z(e),n=Vt(ve.value);(null==n||n<t)&&(ve.value=`${t}px`)});const ge=m.ref(!1),ye=m.ref(!1),we=m.ref({}),xe=m.ref(null),ke=m.ref(""),Me=m.ref(0);let be=null;const Ce=m.ref(!1),Te=m.ref({zoom:1,translateX:0,translateY:0,containerHeight:`${P()}px`}),Ne=m.computed(()=>r.enableWheelZoom?{wheel:dt}:{}),_e=m.computed(()=>{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}}),De=null!=(o=globalThis.cancelIdleCallback)?o:e=>clearTimeout(e);let Ie=null,Se=null,je=!1,Ee=J.value,Le=null,Be=0,Ae=!0,Oe=0;function ze(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 Pe(e){if("undefined"==typeof document)return;if(!N.value)return;if("function"==typeof r.onRenderError&&!0===r.onRenderError(e,L.value,N.value))return Ce.value=!0,void ht();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),g(N.value),N.value.appendChild(t),ve.value=`${P()}px`,Ce.value=!0,ht()}function Re(e){const t="string"==typeof e?e:"string"==typeof(null==e?void 0:e.message)?e.message:"";return"string"==typeof t&&/timed out/i.test(t)}function He(e){return!e||e.disabled}function $e(e,t){const n=`%%{init: {"theme": "${"dark"===t?"dark":"default"}"}}%%\n`;return e.trimStart().startsWith("%%{")?e:n+e}function Ue(){return Ae&&!K.value&&!ge.value&&!Ce.value}function Fe(e){const t=e.trim();return!(!t||t.startsWith("%%"))&&!/^(?:gantt|title|dateformat|axisformat|tickinterval|excludes|section|todaymarker|topaxis|weekday|weekend|acctitle|accdescr|accdescrmultiline)\b/i.test(t)&&t.includes(":")}function Ye(e){var t;const n=e.split(/\r?\n/);for(!/\r?\n$/.test(e)&&n.length>0&&n.pop();n.length>0;){const e=null==(t=n[n.length-1])?void 0:t.trim();if(e&&!e.startsWith("%%")){if(Fe(e))break;n.pop()}else n.pop()}return n.some(Fe)?n.join("\n"):""}function Ke(e){if("gantt"===H(e))return Ye(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 We(e,t,n){return d(this,null,function*(){var o,r;const l=yield M();if(!l)return;const i=l,a=$e(e,t);if("function"==typeof i.parse)return yield ze(()=>i.parse(a),{timeoutMs:null!=(o=null==n?void 0:n.timeoutMs)?o:_e.value.parse,signal:null==n?void 0:n.signal}),!0;const s=`mermaid-parse-${Math.random().toString(36).slice(2,9)}`;return yield ze(()=>l.render(s,a),{timeoutMs:null!=(r=null==n?void 0:n.timeoutMs)?r:_e.value.render,signal:null==n?void 0:n.signal}),!0})}function Qe(e,t,n){return d(this,null,function*(){var o;try{return yield Zn(e,t,null!=(o=null==n?void 0:n.timeoutMs)?o:_e.value.worker)}catch(po){return yield We(e,t,n)}})}function Ve(e,t,n){return d(this,null,function*(){var o;if("gantt"===H(e)){const o=Ke(e);if(!o.trim())return{fullOk:!1,prefixOk:!1};try{if(yield Qe(o,t,n))return o===e?{fullOk:!0,prefixOk:!1}:{fullOk:!1,prefixOk:!0,prefix:o}}catch(po){if("AbortError"===(null==po?void 0:po.name))throw po}return{fullOk:!1,prefixOk:!1}}try{if(yield Qe(e,t,n))return{fullOk:!0,prefixOk:!1}}catch(po){if("AbortError"===(null==po?void 0:po.name))throw po}let r=Ke(e);if(r&&r.trim()&&r!==e)try{try{const l=yield Jn(e,t,null!=(o=null==n?void 0:n.timeoutMs)?o:_e.value.worker);l&&l.trim()&&(r=l)}catch(po){}if(yield Qe(r,t,n))return{fullOk:!1,prefixOk:!0,prefix:r}}catch(po){if("AbortError"===(null==po?void 0:po.name))throw po}return{fullOk:!1,prefixOk:!1}})}"undefined"!=typeof window&&m.watch(()=>T.value,e=>{if(null==S||S.destroy(),S=null,!e)return void(j.value=!1);const t=I(e,{rootMargin:"400px"});S=t,j.value=t.isVisible.value,t.whenVisible.then(()=>{j.value=!0})},{immediate:!0}),m.onBeforeUnmount(()=>{null==S||S.destroy(),S=null,ce()});const Xe=m.computed(()=>K.value||Q.value||C.value);function qe(){return B.value}function Ge(e){if(!T.value||!N.value)return;const t=N.value.querySelector("svg");if(!t)return;let n=0,o=0;const l=t.getAttribute("viewBox"),i=t.getAttribute("width"),a=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||i&&a&&(n=Number.parseFloat(i),o=Number.parseFloat(a)),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(po){return void console.error("Failed to get SVG BBox:",po)}if(n>0&&o>0){const t=o/n,l=null!=e?e:T.value.clientWidth,i=qe(),a=l*t,s=null==i?a:Math.min(a,i);ve.value=`${"none"===r.maxHeight?s:Math.max(s,P())}px`}}const Ze=m.ref(!1),Je=m.computed(()=>({transform:`translate(${U.value}px, ${F.value}px) scale(${$.value})`}));function et(e){"Escape"===e.key&&Ze.value&&ot()}function tt(){var e;if(!T.value||!_.value)return!1;if("1"===(null==(e=_.value.firstElementChild)?void 0:e.getAttribute("data-mermaid-modal-clone")))return!0;const t=T.value.cloneNode(!0);t.dataset.mermaidModalClone="1",t.classList.add("fullscreen"),t.style.height="100%",t.style.maxHeight="100%";const n=t.querySelector("[data-mermaid-wrapper]");return n&&(D.value=n,n.style.transform=Je.value.transform),g(_.value),_.value.appendChild(t),x(t),!0}function nt(){if(Ze.value=!0,"undefined"!=typeof document)try{document.body.style.overflow="hidden"}catch(po){}if("undefined"!=typeof window)try{window.addEventListener("keydown",et)}catch(po){}m.nextTick(()=>{tt()||m.nextTick(tt)})}function ot(){if(Ze.value=!1,_.value&&g(_.value),D.value=null,"undefined"!=typeof document)try{document.body.style.overflow=""}catch(po){}if("undefined"!=typeof window)try{window.removeEventListener("keydown",et)}catch(po){}}function rt(){if(!K.value)return;if(!i.value)return;const e=L.value.length;e!==X.value&&(q.value=!0,X.value=e,ne&&clearTimeout(ne),ne=setTimeout(()=>{q.value&&K.value&&L.value.trim()&&(q.value=!1,mt("preview"))},Z.value))}m.watch(_,e=>{Ze.value&&e&&tt()}),m.watch(Je,e=>{Ze.value&&D.value&&(D.value.style.transform=e.transform)},{immediate:!0});const lt=m.computed(()=>Ze.value||$.value>1);function it(){var e;return!!(null==(e=N.value)?void 0:e.querySelector("svg"))}const at=p.createPanGesture({getTranslate:()=>({x:U.value,y:F.value}),setTranslate:e=>{U.value=e.x,F.value=e.y},canStart:e=>!!it()&&("touch"!==e.pointerType||lt.value),onActiveChange:e=>Y.value=e}),st=at.start,ut=at.stop;function dt(e){if(r.enableWheelZoom&&(e.ctrlKey||e.metaKey)){if(e.preventDefault(),!T.value)return;const t=T.value.getBoundingClientRect(),n=e.clientX-t.left,o=e.clientY-t.top,r=n-t.width/2,l=o-t.height/2,i=(r-U.value)/$.value,a=(l-F.value)/$.value,s=.01,u=-e.deltaY*s,d=Math.min(Math.max($.value+u,.5),3);d!==$.value&&(U.value=r-i*d,F.value=l-a*d,$.value=d)}}function ct(e,t=null){return d(this,null,function*(){try{const n=null!=t?t:(new XMLSerializer).serializeToString(e),o=new Blob([n],{type:"image/svg+xml;charset=utf-8"}),r=URL.createObjectURL(o);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(po){}URL.revokeObjectURL(r)}}catch(n){console.error("Failed to export SVG:",n)}})}function mt(e){return d(this,null,function*(){const t=E.value;if(!t)return W.value=!0,void(K.value="source"===e);const n=t.getBoundingClientRect().height;t.style.height=`${n}px`,t.style.overflow="hidden",W.value=!0,K.value="source"===e,yield m.nextTick();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 pt(){return d(this,null,function*(){return Q.value?V.value:N.value||(yield m.nextTick(),N.value)?(Q.value=!0,V.value=(()=>d(this,null,function*(){var e,t,n;try{const n=yield M();if(!n)return;const o=`mermaid-${Date.now()}-${Math.random().toString(36).substring(2,11)}`;ge.value||ye.value||null==(e=n.initialize)||e.call(n,u(s({},f.value),{dompurifyConfig:s({},l)}));const i=R(r.isDark?"dark":"light"),a=yield ze(()=>n.render(o,i),{timeoutMs:_e.value.fullRender}),d=null==a?void 0:a.svg;if(N.value){const e=y(N.value,d);if(!e)return ye.value&&(ye.value=!1),!1;const n=null!=(t=null==a?void 0:a.bindFunctions)?t:null;w=n,x(e.bindTarget),ge.value||ye.value||(Ge(),ge.value=!0,Te.value={zoom:$.value,translateX:U.value,translateY:F.value,containerHeight:ve.value});const o=r.isDark?"dark":"light";e&&(we.value[o]={svg:e.svg,bindFunctions:n}),ye.value&&(ye.value=!1),Ce.value=!1,le=0,pe()}return!0}catch(o){const e=Re(o),t=le+1;return e&&t<=3?(le=t,fe(Math.min(1200,600*t)),void 0!=={url:"undefined"==typeof document?require("url").pathToFileURL(__filename).href:v&&"SCRIPT"===v.tagName.toUpperCase()&&v.src||new URL("index.cjs",document.baseURI).href}&&(null==(n={BASE_URL:"/",MODE:"npm",DEV:!1,PROD:!0,SSR:!1})?void 0:n.DEV)&&console.warn("[markstream-vue2] Mermaid render timed out, retry scheduled:",t)):(le=0,pe(),!1===r.loading&&console.error("Failed to render mermaid diagram:",o),!1===r.loading&&Pe(o)),!1}finally{Q.value=!1,V.value=null}}))(),V.value):void console.warn("Mermaid container not ready")})}function ft(e){return d(this,null,function*(){var t;if(Ue()&&(N.value||(yield m.nextTick(),N.value))&&!Q.value){Q.value=!0;try{const n=yield M();if(!n)return;const o=`mermaid-partial-${Date.now()}-${Math.random().toString(36).slice(2,9)}`,l=r.isDark?"dark":"light",i=Ke(e),a=$e(i&&i.trim()?i:e,l),s=yield ze(()=>n.render(o,a),{timeoutMs:_e.value.render}),u=null==s?void 0:s.svg;if(N.value&&u){const e=y(N.value,u,{keepPreviousOnFailure:!0});e&&(w=null!=(t=null==s?void 0:s.bindFunctions)?t:null,x(e.bindTarget),Ge())}}catch(po){}finally{Q.value=!1}}})}function vt(){return d(this,null,function*(){var e,t,n;const o=Date.now(),l=++Me.value;be&&be.abort(),be=new AbortController;const i=be.signal,a=r.isDark?"dark":"light",s=L.value,u=s.replace(/\s+/g,"");if(!s.trim())return N.value&&g(N.value),xe.value=null,ke.value="",void(Ce.value=!1);if(u===ke.value)return;try{const n=yield Ve(s,a,{signal:i,timeoutMs:_e.value.worker});if(n.fullOk){if(!(yield pt()))return;return void(Me.value===l&&(xe.value=null!=(t=null==(e=N.value)?void 0:e.innerHTML)?t:null,ke.value=u,Ce.value=!1))}const r=Be&&o<=Be;if(n.prefixOk&&n.prefix&&Ue()&&!r)return void(yield ft(n.prefix))}catch(po){if("AbortError"===(null==po?void 0:po.name))return}if(Me.value!==l)return;if(Ce.value)return;const d=we.value[a];if(d&&N.value){const e=y(N.value,d.svg);e&&(w=null!=(n=d.bindFunctions)?n:null,x(e.bindTarget))}})}function ht(){je&&(je=!1,Ee=J.value,Ae=!1,Le&&(Le.abort(),Le=null),Ie&&(globalThis.clearTimeout(Ie),Ie=null),Se&&(De(Se),Se=null),Be=Date.now())}function gt(){if(ht(),ce(),be){try{be.abort()}catch(po){}be=null}if(Le){try{Le.abort()}catch(po){}Le=null}eo(),pe(),le=0}function yt(e=J.value){je&&(Oe>=te.value?ht():(Ie&&globalThis.clearTimeout(Ie),Ie=globalThis.setTimeout(()=>{Se=se(()=>d(this,null,function*(){if(!je)return;if(!ue())return void ht();if(K.value||ge.value)return void ht();const e=r.isDark?"dark":"light",t=L.value;if(!t.trim())return!1===r.loading?void ht():void yt(Ee);if(Oe++,Oe>te.value)ht();else{Le&&Le.abort(),Le=new AbortController;try{const n=yield Ve(t,e,{signal:Le.signal,timeoutMs:_e.value.worker});if(n.fullOk){if((yield pt())&&ge.value)return void ht()}else n.prefixOk&&n.prefix&&Ue()&&(yield ft(n.prefix))}catch(po){}Ee=Math.min(Math.floor(1.5*Ee),ee.value),yt(Ee)}}),{timeout:500})},e)))}function wt(){je||i.value&&ue()&&(K.value||ge.value||(je=!0,Be=0,Ae=!0,Oe=0,Ee=J.value,yt(Ee)))}m.onBeforeUnmount(ut),m.watch(()=>L.value,()=>{ge.value=!1,we.value={},ue()&&me(),!K.value&&i.value&&ue()?wt():ht(),rt()}),m.watch(()=>r.isDark,()=>d(this,null,function*(){var e;if(!ge.value)return;if(Ce.value)return;const t=r.isDark?"dark":"light",n=we.value[t];if(n){if(N.value){const t=y(N.value,n.svg);t&&(w=null!=(e=n.bindFunctions)?e:null,x(t.bindTarget))}return}const o={zoom:$.value,translateX:U.value,translateY:F.value,containerHeight:ve.value},l=1!==$.value||0!==U.value||0!==F.value;ye.value=!0,l&&($.value=1,U.value=0,F.value=0,yield m.nextTick()),(yield pt())&&l&&(yield m.nextTick(),$.value=o.zoom,U.value=o.translateX,F.value=o.translateY,ve.value=o.containerHeight,Te.value=o)})),m.watch(()=>K.value,e=>d(this,null,function*(){var t;if(e)ht(),ge.value&&(Te.value={zoom:$.value,translateX:U.value,translateY:F.value,containerHeight:ve.value});else{if(Ce.value)return;const e=r.isDark?"dark":"light";if(ge.value&&we.value[e]){if(yield m.nextTick(),N.value){const n=we.value[e],o=y(N.value,n.svg);o&&(w=null!=(t=n.bindFunctions)?t:null,x(o.bindTarget))}return $.value=Te.value.zoom,U.value=Te.value.translateX,F.value=Te.value.translateY,void(ve.value=Te.value.containerHeight)}if(yield m.nextTick(),!i.value||!ue())return;wt(),yield vt()}})),m.watch(()=>r.loading,(e,t)=>d(this,null,function*(){var n;if(!0===t&&!1===e){const e=L.value.trim();if(!e)return gt();const t=r.isDark?"dark":"light",l=e.replace(/\s+/g,"");if(ge.value&&l===ke.value){if(yield m.nextTick(),N.value&&!N.value.querySelector("svg")&&we.value[t]){const e=we.value[t],o=y(N.value,e.svg);o&&(w=null!=(n=e.bindFunctions)?n:null,x(o.bindTarget))}return void gt()}try{if(yield Qe(e,t,{timeoutMs:_e.value.worker}),!(yield pt()))return;ke.value=l,Ce.value=!1,gt()}catch(o){gt(),Pe(o)}}})),m.watch(T,e=>{he&&he.disconnect(),e&&(he=new ResizeObserver(e=>{e&&e.length>0&&!K.value&&!C.value&&Ut(()=>{Ge(e[0].contentRect.width)})}),he.observe(e))},{immediate:!0}),m.onMounted(()=>d(this,null,function*(){yield m.nextTick(),W.value||(K.value=!i.value),ue()&&(me(),X.value=L.value.length)})),m.watch(()=>i.value,e=>{W.value||(K.value=!e)}),m.watch(()=>j.value,e=>{e&&(ge.value||(me(),X.value=L.value.length),r.loading||ge.value||me(),!K.value&&i.value&&wt())},{immediate:!1}),m.watch(()=>r.maxHeight,()=>{m.nextTick(()=>{Ge()})}),m.onUnmounted(()=>{ne&&clearTimeout(ne),ce(),he&&he.disconnect(),be&&(be.abort(),be=null),eo(),ht(),pe()}),m.watch(()=>C.value,e=>d(this,null,function*(){e?(ht(),be&&be.abort()):ue()&&!ge.value&&(yield m.nextTick(),me(),K.value||wt())}),{immediate:!1});const xt=m.computed(()=>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{__sfc:!0,props:r,emits:t,DOMPURIFY_CONFIG:l,mermaidAvailable:i,mermaidSecurityLevel:a,mermaidInitConfig:f,setSafeSvg:h,clearElement:g,renderSvgToTarget:y,lastMermaidBindFunctions:w,bindMermaidInteractions:x,t:k,resolveMermaidInstance:M,copyText:b,isCollapsed:C,mermaidContainer:T,mermaidContent:N,modalContent:_,modalCloneWrapper:D,registerViewport:I,viewportHandle:S,viewportReady:j,modeContainerRef:E,baseFixedCode:L,maxPreviewHeight:B,estimatedPreviewHeight:A,resolveMinContainerHeight:O,clampPreviewHeight:z,resolveEstimatedPreviewHeight:P,getCodeWithTheme:R,getMermaidDiagramKind:H,zoom:$,translateX:U,translateY:F,isDragging:Y,showSource:K,userToggledShowSource:W,isRendering:Q,renderQueue:V,lastContentLength:X,isContentGenerating:q,renderDebounceDelay:G,contentStableDelay:Z,previewPollInitialDelay:J,previewPollMaxDelay:ee,previewPollMaxAttempts:te,contentStableTimer:ne,renderRetryTimer:oe,progressiveRenderDebounceTimer:re,consecutiveRenderTimeouts:le,MAX_RENDER_TIMEOUT_RETRIES:3,requestIdle:se,canScheduleViewportWork:ue,clearProgressiveRenderDebounceTimer:ce,debouncedProgressiveRender:me,clearRenderRetryTimer:pe,scheduleRenderRetry:fe,containerHeight:ve,resizeObserver:he,hasRenderedOnce:ge,isThemeRendering:ye,svgCache:we,lastSvgSnapshot:xe,lastRenderedCode:ke,renderToken:Me,currentWorkController:be,hasRenderError:Ce,savedTransformState:Te,wheelListeners:Ne,timeouts:_e,cancelIdle:De,previewPollTimeoutId:Ie,previewPollIdleId:Se,isPreviewPolling:je,previewPollDelay:Ee,previewPollController:Le,lastPreviewStopAt:Be,allowPartialPreview:Ae,previewPollAttempts:Oe,withTimeoutSignal:ze,renderErrorToContainer:Pe,isTimeoutError:Re,shouldSkipEventTarget:He,onBtnHover:function(e,t,n="top"){if(He(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;ie(e.currentTarget,t,n,!1,l,r.isDark)},onBtnLeave:function(){ae()},onCopyHover:function(e){if(He(e.currentTarget))return;const t=b.value?k("common.copied")||"Copied":k("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;ie(e.currentTarget,t,"top",!1,o,r.isDark)},applyThemeTo:$e,canApplyPartialPreview:Ue,isGanttTaskLine:Fe,getSafeGanttPreviewCandidate:Ye,getSafePrefixCandidate:Ke,canParseOnMain:We,canParseOffthread:Qe,canParseOrPrefix:Ve,isFullscreenDisabled:Xe,resolveMaxContainerHeight:qe,updateContainerHeight:Ge,isModalOpen:Ze,transformStyle:Je,handleKeydown:et,mountModalClone:tt,openModal:nt,closeModal:ot,checkContentStability:rt,zoomIn:function(){$.value<3&&($.value+=.1)},zoomOut:function(){$.value>.5&&($.value-=.1)},resetZoom:function(){$.value=1,U.value=0,F.value=0},panSurfaceClaimsTouch:lt,hasPreviewSvg:it,panGesture:at,startDrag:st,stopDrag:ut,handleWheel:dt,copy:function(){return d(this,null,function*(){try{"undefined"!=typeof navigator&&navigator.clipboard&&"function"==typeof navigator.clipboard.writeText&&(yield navigator.clipboard.writeText(L.value)),b.value=!0,t("copy",L.value),setTimeout(()=>{b.value=!1},1e3)}catch(e){console.error("Failed to copy:",e)}})},exportSvg:ct,handleExportClick:function(){var e;const n=null==(e=N.value)?void 0:e.querySelector("svg");if(!n)return void console.error("SVG element not found");const o=(new XMLSerializer).serializeToString(n),r={payload:{type:"export"},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0},svgElement:n,svgString:o};t("export",r),r.defaultPrevented||ct(n,o)},handleOpenModalClick:function(){var e,n;const o=null!=(n=null==(e=N.value)?void 0:e.querySelector("svg"))?n:null,r=o?(new XMLSerializer).serializeToString(o):null,l={payload:{type:"open-modal"},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0},svgElement:o,svgString:r};t("openModal",l),l.defaultPrevented||nt()},handleSwitchMode:function(e){const n={payload:{type:"toggle-mode",target:e},defaultPrevented:!1,preventDefault(){this.defaultPrevented=!0}};t("toggleMode",e,n),n.defaultPrevented||mt(e)},switchMode:mt,initMermaid:pt,renderPartial:ft,progressiveRender:vt,stopPreviewPolling:ht,cleanupAfterLoadingSettled:gt,scheduleNextPreviewPoll:yt,startPreviewPolling:wt,computedButtonStyle:xt,mermaidIconUrl:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiIgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2Ij4KICA8cGF0aCBmaWxsPSJub25lIiBzdHJva2U9IiNjYTllZTYiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgZD0iTTEuNSAyLjVjMCA2IDIuMjUgNS43NSA0IDcgLjgzLjY3IDEuMTcgMiAxIDRoM2MtLjE3LTIgLjE3LTMuMzMgMS00IDEuNzUtMS4yNSA0LTEgNC03QzEyIDIuNSAxMCAzIDggNyA2IDMgNCAyLjUgMS41IDIuNSIgLz4KPC9zdmc+Cg==",Portal:Yt}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t("div",{staticClass:"my-4 rounded-lg border overflow-hidden shadow-sm",class:[n.props.isDark?"border-gray-700/30":"border-gray-200",{"is-rendering":n.props.loading}],attrs:{"data-markstream-mermaid":"1","data-markstream-mode":n.showSource?"source":n.hasRenderedOnce?"preview":"pending"}},[n.props.showHeader?t("div",{staticClass:"mermaid-block-header flex justify-between items-center px-4 py-2.5 border-b",class:n.props.isDark?"bg-gray-800 border-gray-700/30":"bg-gray-50 border-gray-200"},[e.$slots["header-left"]?t("div",[e._t("header-left")],2):t("div",{staticClass:"flex items-center space-x-2 overflow-hidden"},[t("img",{staticClass:"w-4 h-4 my-0",attrs:{src:n.mermaidIconUrl,alt:"Mermaid"}}),t("span",{staticClass:"text-sm font-medium font-mono truncate",class:n.props.isDark?"text-gray-400":"text-gray-600"},[e._v("Mermaid")])]),e.$slots["header-center"]?t("div",[e._t("header-center")],2):n.props.showModeToggle&&n.mermaidAvailable?t("div",{staticClass:"flex items-center space-x-1 rounded-md p-0.5",class:n.props.isDark?"bg-gray-700":"bg-gray-100"},[t("button",{staticClass:"px-2.5 py-1 text-xs rounded transition-colors",class:[n.showSource?n.props.isDark?"text-gray-400 hover:text-gray-200":"text-gray-500 hover:text-gray-700":n.props.isDark?"bg-gray-600 text-gray-200 shadow-sm":"bg-white text-gray-700 shadow-sm"],on:{click:()=>n.handleSwitchMode("preview"),mouseenter:function(e){n.onBtnHover(e,n.t("common.preview")||"Preview")},focus:function(e){n.onBtnHover(e,n.t("common.preview")||"Preview")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("div",{staticClass:"flex items-center space-x-1"},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("path",{attrs:{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"}}),t("circle",{attrs:{cx:"12",cy:"12",r:"3"}})])]),t("span",[e._v(e._s(n.t("common.preview")||"Preview"))])])]),t("button",{staticClass:"px-2.5 py-1 text-xs rounded transition-colors",class:[n.showSource?n.props.isDark?"bg-gray-600 text-gray-200 shadow-sm":"bg-white text-gray-700 shadow-sm":n.props.isDark?"text-gray-400 hover:text-gray-200":"text-gray-500 hover:text-gray-700"],on:{click:()=>n.handleSwitchMode("source"),mouseenter:function(e){n.onBtnHover(e,n.t("common.source")||"Source")},focus:function(e){n.onBtnHover(e,n.t("common.source")||"Source")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("div",{staticClass:"flex items-center space-x-1"},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m16 18l6-6l-6-6M8 6l-6 6l6 6"}})]),t("span",[e._v(e._s(n.t("common.source")||"Source"))])])])]):e._e(),e.$slots["header-right"]?t("div",[e._t("header-right")],2):t("div",{staticClass:"flex items-center space-x-1"},[n.props.showCollapseButton?t("button",{class:n.computedButtonStyle,attrs:{"aria-pressed":n.isCollapsed},on:{click:function(e){n.isCollapsed=!n.isCollapsed},mouseenter:function(e){n.onBtnHover(e,n.isCollapsed?n.t("common.expand")||"Expand":n.t("common.collapse")||"Collapse")},focus:function(e){n.onBtnHover(e,n.isCollapsed?n.t("common.expand")||"Expand":n.t("common.collapse")||"Collapse")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"w-3 h-3",style:{rotate:n.isCollapsed?"0deg":"90deg"},attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"}})])]):e._e(),n.props.showCopyButton?t("button",{class:n.computedButtonStyle,on:{click:n.copy,mouseenter:function(e){return n.onCopyHover(e)},focus:function(e){return n.onCopyHover(e)},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[n.copyText?t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"}})]):t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("rect",{attrs:{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}}),t("path",{attrs:{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"}})])])]):e._e(),n.props.showExportButton&&n.mermaidAvailable?t("button",{class:`${n.computedButtonStyle} ${n.isFullscreenDisabled?"opacity-50 cursor-not-allowed":""}`,attrs:{disabled:n.isFullscreenDisabled},on:{click:n.handleExportClick,mouseenter:function(e){n.onBtnHover(e,n.t("common.export")||"Export")},focus:function(e){n.onBtnHover(e,n.t("common.export")||"Export")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("path",{attrs:{d:"M12 15V3m9 12v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}}),t("path",{attrs:{d:"m7 10l5 5l5-5"}})])])]):e._e(),n.props.showFullscreenButton&&n.mermaidAvailable?t("button",{class:`${n.computedButtonStyle} ${n.isFullscreenDisabled?"opacity-50 cursor-not-allowed":""}`,attrs:{disabled:n.isFullscreenDisabled},on:{click:n.handleOpenModalClick,mouseenter:function(e){n.onBtnHover(e,n.isModalOpen?n.t("common.minimize")||"Minimize":n.t("common.open")||"Open")},focus:function(e){n.onBtnHover(e,n.isModalOpen?n.t("common.minimize")||"Minimize":n.t("common.open")||"Open")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[n.isModalOpen?t("svg",{attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"}})]):t("svg",{attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"}})])]):e._e()])]):e._e(),t("div",{directives:[{name:"show",rawName:"v-show",value:!n.isCollapsed,expression:"!isCollapsed"}],ref:"modeContainerRef"},[n.showSource?t("div",{staticClass:"p-4",class:n.props.isDark?"bg-gray-900":"bg-gray-50"},[t("pre",{staticClass:"text-sm font-mono whitespace-pre-wrap",class:n.props.isDark?"text-gray-300":"text-gray-700"},[e._v(e._s(n.baseFixedCode))])]):t("div",{staticClass:"relative"},[n.props.showZoomControls?t("div",{staticClass:"absolute top-2 right-2 z-10 rounded-lg"},[t("div",{staticClass:"flex items-center gap-2 backdrop-blur rounded-lg"},[t("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[n.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:n.zoomIn,mouseenter:function(e){n.onBtnHover(e,n.t("common.zoomIn")||"Zoom in")},focus:function(e){n.onBtnHover(e,n.t("common.zoomIn")||"Zoom in")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("circle",{attrs:{cx:"11",cy:"11",r:"8"}}),t("path",{attrs:{d:"m21 21l-4.35-4.35M11 8v6m-3-3h6"}})])])]),t("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[n.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:n.zoomOut,mouseenter:function(e){n.onBtnHover(e,n.t("common.zoomOut")||"Zoom out")},focus:function(e){n.onBtnHover(e,n.t("common.zoomOut")||"Zoom out")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("circle",{attrs:{cx:"11",cy:"11",r:"8"}}),t("path",{attrs:{d:"m21 21l-4.35-4.35M8 11h6"}})])])]),t("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[n.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:n.resetZoom,mouseenter:function(e){n.onBtnHover(e,n.t("common.resetZoom")||"Reset zoom")},focus:function(e){n.onBtnHover(e,n.t("common.resetZoom")||"Reset zoom")},mouseleave:n.onBtnLeave,blur:n.onBtnLeave}},[e._v(" "+e._s(Math.round(100*n.zoom))+"% ")])])]):e._e(),t("div",e._g({ref:"mermaidContainer",staticClass:"min-h-[var(--ms-size-diagram-min-height,360px)] relative overflow-hidden block transition-[height] duration-150 ease-out",class:[n.props.isDark?"bg-gray-900":"bg-gray-50",{"mermaid-pan-touch":n.panSurfaceClaimsTouch}],style:{height:n.containerHeight},on:{pointerdown:n.startDrag}},n.wheelListeners),[t("div",{staticClass:"absolute inset-0 cursor-grab",class:{"cursor-grabbing":n.isDragging},style:n.transformStyle,attrs:{"data-mermaid-wrapper":""}},[t("div",{ref:"mermaidContent",staticClass:"_mermaid w-full text-center flex items-center justify-center min-h-full"})])]),t(n.Portal,{attrs:{to:"body"}},[t("div",{staticClass:"markstream-vue2"},[t("transition",{attrs:{name:"mermaid-dialog",appear:""}},[n.isModalOpen?t("div",{staticClass:"fixed inset-0 z-50 flex items-center justify-center bg-black/70 p-4",on:{click:function(e){return e.target!==e.currentTarget?null:n.closeModal.apply(null,arguments)}}},[t("div",{staticClass:"dialog-panel relative w-full h-full max-w-full max-h-full rounded shadow-lg overflow-hidden",class:n.props.isDark?"bg-gray-900":"bg-white"},[t("div",{staticClass:"absolute top-6 right-6 z-50 flex items-center gap-2"},[t("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[n.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:n.zoomIn}},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("circle",{attrs:{cx:"11",cy:"11",r:"8"}}),t("path",{attrs:{d:"m21 21l-4.35-4.35M11 8v6m-3-3h6"}})])])]),t("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[n.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:n.zoomOut}},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("g",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}},[t("circle",{attrs:{cx:"11",cy:"11",r:"8"}}),t("path",{attrs:{d:"m21 21l-4.35-4.35M8 11h6"}})])])]),t("button",{staticClass:"p-2 text-xs rounded transition-colors",class:[n.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:n.resetZoom}},[e._v(" "+e._s(Math.round(100*n.zoom))+"% ")]),t("button",{staticClass:"inline-flex items-center justify-center p-2 rounded transition-colors",class:[n.props.isDark?"text-gray-400 hover:bg-gray-700":"text-gray-600 hover:bg-gray-200"],on:{click:n.closeModal}},[t("svg",{staticClass:"w-3 h-3",attrs:{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"}},[t("path",{attrs:{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18 6L6 18M6 6l12 12"}})])])]),t("div",e._g({ref:"modalContent",staticClass:"w-full h-full flex items-center justify-center p-4 overflow-hidden",class:{"mermaid-pan-touch":n.panSurfaceClaimsTouch},on:{pointerdown:n.startDrag}},n.wheelListeners))])]):e._e()])],1)])],1)])])},[],!1,null,"8d36a948",null,null).exports,no=M(m.defineComponent({name:"NestedRenderer",components:{MarkdownRender:pn},inheritAttrs:!1,props:{node:Object,nodes:Array,content:String,loading:Boolean,final:Boolean,cacheKey:String,parseOptions:Object,customHtmlTags:Array,customMarkdownIt:Function},setup(e){const t=m.getCurrentInstance(),n=m.computed(()=>{var t;return null!=e.final?e.final:"boolean"==typeof e.loading?!e.loading:"boolean"==typeof(null==(t=e.node)?void 0:t.loading)?!e.node.loading:void 0}),o=m.computed(()=>ut({node:e.node,nodes:e.nodes,content:e.content},{cacheKey:e.cacheKey,final:n.value,parseOptions:e.parseOptions,customHtmlTags:e.customHtmlTags,customMarkdownIt:e.customMarkdownIt}));return{forwardedListeners:m.computed(()=>k(null==t?void 0:t.proxy)),resolvedFinal:n,resolvedNodes:o}}}),function(){var e=this,t=e._self._c;return e._self._setupProxy,t("MarkdownRender",e._g(e._b({attrs:{nodes:e.resolvedNodes,final:e.resolvedFinal,"custom-html-tags":e.customHtmlTags}},"MarkdownRender",e.$attrs,!1),e.forwardedListeners))},[],!1,null,null,null,null).exports,oo=M(m.defineComponent({__name:"Tooltip",props:{visible:{type:Boolean},anchorEl:null,content:null,placement:null,offset:null,originX:null,originY:null,id:null,isDark:{type:[Boolean,null]}},setup(e){const t=e,n=m.computed(()=>{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(po){}return!1}),o=m.ref(null),r=m.ref({transform:"translate3d(0px, 0px, 0px)",left:"0px",top:"0px"}),l=m.ref(!1);let i=null;function a(){return d(this,null,function*(){var e,n;if(!t.anchorEl||!o.value)return;const l=[f.offset(null!=(e=t.offset)?e:8),f.flip(),f.shift({padding:8})],{x:i,y:a}=yield f.computePosition(t.anchorEl,o.value,{placement:null!=(n=t.placement)?n:"top",middleware:l,strategy:"fixed"});r.value.transform=`translate3d(${Math.round(i)}px, ${Math.round(a)}px, 0)`,r.value.left="0px",r.value.top="0px"})}return m.watch(()=>t.visible,e=>d(this,null,function*(){if(e)if(l.value=!1,yield m.nextTick(),t.anchorEl&&o.value)try{const e=t.anchorEl.getBoundingClientRect();yield a();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 m.nextTick(),l.value=!0,yield m.nextTick(),r.value.transform=n):l.value=!0}else l.value=!0;i=f.autoUpdate(t.anchorEl,o.value,a)}catch(po){yield a(),l.value=!0,i=f.autoUpdate(t.anchorEl,o.value,a)}else l.value=!0;else l.value=!1,i&&(i(),i=null)})),m.watch([()=>t.anchorEl,()=>t.placement,()=>t.content],()=>d(this,null,function*(){t.visible&&t.anchorEl&&o.value&&(yield m.nextTick(),yield a())})),m.onBeforeUnmount(()=>{i&&i()}),{__sfc:!0,props:t,isDarkEffective:n,tooltip:o,style:r,ready:l,cleanupAutoUpdate:i,updatePosition:a,Portal:Yt}}}),function(){var e=this,t=e._self._c,n=e._self._setupProxy;return t(n.Portal,{attrs:{to:"body"}},[t("div",{staticClass:"markstream-vue2"},[t("transition",{attrs:{name:"tooltip",appear:""}},[t("div",{directives:[{name:"show",rawName:"v-show",value:e.visible&&n.ready,expression:"visible && ready"}],ref:"tooltip",staticClass:"z-[9999] inline-block text-base py-2 px-3 rounded-md shadow-md whitespace-nowrap pointer-events-none tooltip-element border",class:[n.isDarkEffective?"bg-gray-900 text-white border-gray-700 border is-dark":"bg-white text-gray-900 border-gray-200 border"],style:{position:"fixed",left:n.style.left,top:n.style.top,transform:n.style.transform},attrs:{id:n.props.id,role:"tooltip"}},[e._v(" "+e._s(e.content)+" ")])])],1)])},[],!1,null,"703da293",null,null).exports,ro=Object.freeze(Object.defineProperty({__proto__:null,default:oo},Symbol.toStringTag,{value:"Module"}));function lo(e){return JSON.stringify(e)}function io(e){var t;const n=null!=(t=e.mode)?t:"classic",o=e.katexUrl,r=e.mhchemUrl,l=lo(s({throwOnError:!0,displayMode:!0,output:"html",strict:"ignore"},e.renderOptions||{})),i=lo(o),a=r?lo(r):'""';return"module"===n?`\nlet DEBUG = false\nlet katex = null\nlet katexLoadError = null\nlet loadPromise = null\n\nfunction normalizeKaTeX(mod) {\n const resolved = (mod && mod.default) ? mod.default : mod\n if (resolved && typeof resolved.renderToString === 'function')\n return resolved\n return null\n}\n\nasync function loadKaTeX() {\n if (katex || katexLoadError)\n return\n if (!loadPromise) {\n loadPromise = (async () => {\n try {\n const mod = await import(${i})\n katex = normalizeKaTeX(mod) || null\n const mhchemUrl = ${a}\n if (mhchemUrl) {\n try {\n await import(mhchemUrl)\n }\n catch (e) {\n // ignore optional mhchem load failures\n if (DEBUG)\n console.warn('[katex-cdn-worker] failed to load mhchem', e)\n }\n }\n }\n catch (e) {\n katexLoadError = e\n }\n })()\n }\n await loadPromise\n}\n\nglobalThis.addEventListener('message', async (ev) => {\n const data = ev.data || {}\n if (data.type === 'init') {\n DEBUG = !!data.debug\n if (DEBUG)\n console.debug('[katex-cdn-worker] debug enabled')\n return\n }\n const id = data.id ?? ''\n const content = data.content ?? ''\n const displayMode = data.displayMode ?? true\n\n await loadKaTeX()\n\n if (!katex) {\n const reason = katexLoadError ? String(katexLoadError?.message || katexLoadError) : 'KaTeX is not available in worker'\n globalThis.postMessage({ id, error: reason, content, displayMode })\n return\n }\n\n try {\n const opts = ${l}\n const html = katex.renderToString(content, { ...opts, displayMode: !!displayMode })\n globalThis.postMessage({ id, html, content, displayMode })\n }\n catch (err) {\n const msg = String(err?.message || err)\n globalThis.postMessage({ id, error: msg, content, displayMode })\n }\n})\n`.trimStart():`\nlet DEBUG = false\nlet katex = null\nlet katexLoadError = null\n\nfunction normalizeKaTeX(val) {\n const resolved = (val && val.default) ? val.default : val\n if (resolved && typeof resolved.renderToString === 'function')\n return resolved\n return null\n}\n\nfunction loadKaTeXClassic() {\n if (katex || katexLoadError)\n return\n try {\n importScripts(${i})\n const mhchemUrl = ${a}\n if (mhchemUrl) {\n try {\n importScripts(mhchemUrl)\n }\n catch (e) {\n // ignore optional mhchem load failures\n if (DEBUG)\n console.warn('[katex-cdn-worker] failed to load mhchem', e)\n }\n }\n katex = normalizeKaTeX(globalThis.katex)\n }\n catch (e) {\n katexLoadError = e\n }\n}\n\nloadKaTeXClassic()\n\nglobalThis.addEventListener('message', (ev) => {\n const data = ev.data || {}\n if (data.type === 'init') {\n DEBUG = !!data.debug\n if (DEBUG)\n console.debug('[katex-cdn-worker] debug enabled')\n return\n }\n const id = data.id ?? ''\n const content = data.content ?? ''\n const displayMode = data.displayMode ?? true\n\n if (!katex && !katexLoadError)\n loadKaTeXClassic()\n\n if (!katex) {\n const reason = katexLoadError ? String(katexLoadError?.message || katexLoadError) : 'KaTeX is not available in worker'\n globalThis.postMessage({ id, error: reason, content, displayMode })\n return\n }\n\n try {\n const opts = ${l}\n const html = katex.renderToString(content, { ...opts, displayMode: !!displayMode })\n globalThis.postMessage({ id, html, content, displayMode })\n }\n catch (err) {\n const msg = String(err?.message || err)\n globalThis.postMessage({ id, error: msg, content, displayMode })\n }\n})\n`.trimStart()}function ao(e){return JSON.stringify(e)}function so(e){var t;const n=null!=(t=e.mode)?t:"module",o=ao(e.mermaidUrl),r=`\nlet DEBUG = false\nlet mermaid = null\nlet mermaidLoadError = null\n\nfunction normalizeMermaidModule(mod) {\n if (!mod)\n return mod\n const candidate = (mod && mod.default) ? mod.default : mod\n if (candidate && (typeof candidate.render === 'function' || typeof candidate.parse === 'function' || typeof candidate.initialize === 'function'))\n return candidate\n if (candidate && candidate.mermaidAPI && (typeof candidate.mermaidAPI.render === 'function' || typeof candidate.mermaidAPI.parse === 'function')) {\n const api = candidate.mermaidAPI\n return {\n ...candidate,\n render: api.render ? api.render.bind(api) : undefined,\n parse: api.parse ? api.parse.bind(api) : undefined,\n initialize: (opts) => {\n if (typeof candidate.initialize === 'function')\n return candidate.initialize(opts)\n return api.initialize ? api.initialize(opts) : undefined\n },\n }\n }\n if (mod && mod.mermaid && typeof mod.mermaid.parse === 'function')\n return mod.mermaid\n return candidate\n}\n\nfunction applyThemeTo(code, theme) {\n const themeValue = theme === 'dark' ? 'dark' : 'default'\n const themeConfig = \`%%{init: {"theme": "\${themeValue}"}}%%\\n\`\n const trimmed = (code || '').trimStart()\n if (trimmed.startsWith('%%{'))\n return code\n return themeConfig + code\n}\n\nfunction findHeaderIndex(lines) {\n const headerRe = /^(?:graph|flowchart|flowchart\\s+tb|flowchart\\s+lr|sequenceDiagram|gantt|classDiagram|stateDiagram(?:-v2)?|erDiagram|journey|pie|quadrantChart|timeline|xychart(?:-beta)?)\\b/\n for (let i = 0; i < lines.length; i++) {\n const l = (lines[i] || '').trim()\n if (!l)\n continue\n if (l.startsWith('%%'))\n continue\n if (headerRe.test(l))\n return i\n }\n return -1\n}\n\nasync function canParse(code, theme) {\n const themed = applyThemeTo(code, theme)\n const anyMermaid = mermaid\n if (anyMermaid && typeof anyMermaid.parse === 'function') {\n await anyMermaid.parse(themed)\n return true\n }\n throw new Error('mermaid.parse not available in worker')\n}\n\nasync function findLastRenderablePrefix(baseCode, theme) {\n const lines = String(baseCode || '').split('\\n')\n const headerIdx = findHeaderIndex(lines)\n if (headerIdx === -1)\n return null\n const head = lines.slice(0, headerIdx + 1)\n await canParse(head.join('\\n'), theme)\n\n let low = headerIdx + 1\n let high = lines.length\n let lastGood = headerIdx + 1\n let tries = 0\n const MAX_TRIES = 12\n\n while (low <= high && tries < MAX_TRIES) {\n const mid = Math.floor((low + high) / 2)\n const candidate = [...head, ...lines.slice(headerIdx + 1, mid)].join('\\n')\n tries++\n try {\n await canParse(candidate, theme)\n lastGood = mid\n low = mid + 1\n }\n catch {\n high = mid - 1\n }\n }\n\n return [...head, ...lines.slice(headerIdx + 1, lastGood)].join('\\n')\n}\n\nfunction initMermaidOnce() {\n if (!mermaid)\n return\n try {\n if (typeof mermaid.initialize === 'function')\n mermaid.initialize(${ao(s({startOnLoad:!1,securityLevel:"strict",flowchart:{htmlLabels:!1}},e.initializeOptions||{}))})\n }\n catch (e) {\n if (DEBUG)\n console.warn('[mermaid-cdn-worker] initialize failed', e)\n }\n}\n\nglobalThis.addEventListener('message', async (ev) => {\n const msg = ev.data || {}\n if (msg.type === 'init') {\n DEBUG = !!msg.debug\n if (DEBUG)\n console.debug('[mermaid-cdn-worker] debug enabled')\n return\n }\n\n const id = msg.id\n const action = msg.action\n const payload = msg.payload || {}\n\n if (!mermaid) {\n const errMsg = mermaidLoadError ? String(mermaidLoadError?.message || mermaidLoadError) : 'Mermaid is not available in worker'\n globalThis.postMessage({ id, ok: false, error: errMsg })\n return\n }\n\n try {\n if (action === 'canParse') {\n const ok = await canParse(payload.code, payload.theme)\n globalThis.postMessage({ id, ok: true, result: ok })\n return\n }\n if (action === 'findPrefix') {\n const res = await findLastRenderablePrefix(payload.code, payload.theme)\n globalThis.postMessage({ id, ok: true, result: res })\n return\n }\n globalThis.postMessage({ id, ok: false, error: 'Unknown action' })\n }\n catch (e) {\n globalThis.postMessage({ id, ok: false, error: String(e?.message || e) })\n }\n})\n`.trimStart();return"module"===n?`\n${r}\n\nlet loadPromise = null\nasync function loadMermaid() {\n if (mermaid || mermaidLoadError)\n return\n if (!loadPromise) {\n loadPromise = (async () => {\n try {\n const mod = await import(${o})\n mermaid = normalizeMermaidModule(mod) || null\n initMermaidOnce()\n }\n catch (e) {\n mermaidLoadError = e\n }\n })()\n }\n await loadPromise\n}\n\n// Load immediately; failures are reported per-request\nawait loadMermaid()\n`.trimStart():`\n${r}\n\nfunction loadMermaidClassic() {\n if (mermaid || mermaidLoadError)\n return\n try {\n importScripts(${o})\n mermaid = normalizeMermaidModule(globalThis.mermaid) || null\n initMermaidOnce()\n }\n catch (e) {\n mermaidLoadError = e\n }\n}\n\nloadMermaidClassic()\n`.trimStart()}function uo(e){const t="string"==typeof(null==e?void 0:e.version)?e.version:"",[n,o]=t.split(".").map(Number);return Number.isFinite(n)&&Number.isFinite(o)&&2===n?o:null}const co={AdmonitionNode:tn,BlockquoteNode:$t,CheckboxNode:b,CodeBlockNode:Wt,DefinitionListNode:C,EmojiNode:T,EmphasisNode:Mt,FootnoteNode:Ct,FootnoteReferenceNode:L,FootnoteAnchorNode:bt,HardBreakNode:Tt,HeadingNode:Nt,HtmlBlockNode:Et,HtmlInlineNode:Y,HighlightNode:kt,ImageNode:ce,D2BlockNode:sn,InlineCodeNode:K,PreCodeNode:dt,InsertNode:xt,LinkNode:wt,ListItemNode:_t,ListNode:Dt,MathBlockNode:An,MathInlineNode:On,MermaidBlockNode:to,NestedRenderer:no,InfographicBlockNode:mn,ParagraphNode:Lt,StrikethroughNode:yt,StrongNode:gt,SubscriptNode:ht,SuperscriptNode:vt,TableNode:Bt,TextNode:be,ThematicBreakNode:At,VmrContainerNode:zt,ReferenceNode:ft},mo={install(e,t){!function(e){const t=uo(e);if(!(null==t||t>=7||(null==e?void 0:e.__composition_api_installed__)||(null==e?void 0:e.__compositionApiInstalled)))throw new Error("[markstream-vue2] Vue 2.6.x requires @vue/composition-api. Install it and call Vue.use(VueCompositionAPI) before using markstream-vue2.")}(e),function(e){const t=uo(e);if(null==t||t>=7)return;if(null==e?void 0:e.__markstreamVue2SetupProxyPatched)return;e.__markstreamVue2SetupProxyPatched=!0;const n=e.prototype;Object.prototype.hasOwnProperty.call(n,"_setupProxy")||Object.defineProperty(n,"_setupProxy",{configurable:!0,get(){return this},set(e){Object.defineProperty(this,"_setupProxy",{value:e,configurable:!0,writable:!0})}}),e.mixin({beforeCreate(){if(!this._setupProxy)try{this._setupProxy=this}catch(po){}}})}(e),Object.entries(co).forEach(([t,n])=>{e.component(t,n)}),e.component("MarkdownRender",pn),e.component("NodeRenderer",pn),(null==t?void 0:t.getLanguageIcon)&&Pe(t.getLanguageIcon),(null==t?void 0:t.mathOptions)&&c.setDefaultMathOptions(t.mathOptions)}};Object.defineProperty(exports,"KATEX_COMMANDS",{enumerable:!0,get:()=>c.KATEX_COMMANDS}),Object.defineProperty(exports,"normalizeStandaloneBackslashT",{enumerable:!0,get:()=>c.normalizeStandaloneBackslashT}),Object.defineProperty(exports,"setDefaultMathOptions",{enumerable:!0,get:()=>c.setDefaultMathOptions}),exports.AdmonitionNode=tn,exports.BlockquoteNode=$t,exports.CheckboxNode=b,exports.CodeBlockNode=Wt,exports.D2BlockNode=sn,exports.DefinitionListNode=C,exports.EmojiNode=T,exports.EmphasisNode=Mt,exports.FootnoteAnchorNode=bt,exports.FootnoteNode=Ct,exports.FootnoteReferenceNode=L,exports.HardBreakNode=Tt,exports.HeadingNode=Nt,exports.HighlightNode=kt,exports.HtmlBlockNode=Et,exports.HtmlInlineNode=Y,exports.ImageNode=ce,exports.InfographicBlockNode=mn,exports.InlineCodeNode=K,exports.InsertNode=xt,exports.LinkNode=wt,exports.ListItemNode=_t,exports.ListNode=Dt,exports.MERMAID_DISABLED_CODE=qn,exports.MERMAID_WORKER_BUSY_CODE=Xn,exports.MarkdownRender=pn,exports.MathBlockNode=An,exports.MathInlineNode=On,exports.MermaidBlockNode=to,exports.NestedRenderer=no,exports.ParagraphNode=Lt,exports.PreCodeNode=dt,exports.ReferenceNode=ft,exports.StrikethroughNode=yt,exports.StrongNode=gt,exports.SubscriptNode=ht,exports.SuperscriptNode=vt,exports.TableNode=Bt,exports.TextNode=be,exports.ThematicBreakNode=At,exports.Tooltip=oo,exports.VmrContainerNode=zt,exports.VueRendererMarkdown=mo,exports.WORKER_BUSY_CODE=jn,exports.buildKaTeXCDNWorkerSource=io,exports.buildMermaidCDNWorkerSource=so,exports.canParseOffthread=Zn,exports.clearGlobalCustomComponents=function(){delete D.scopedCustomComponents[N],I.value++},exports.clearKaTeXWorker=function(){var e;wn&&(null==(e=wn.terminate)||e.call(wn)),wn=null,xn=null},exports.clearMermaidWorker=function(){var e;if(Yn)try{for(const[e,t]of Wn.entries())t.reject(new Error("Worker cleared"));Wn.clear(),null==(e=Yn.terminate)||e.call(Yn)}catch(po){}Yn=null,Kn=null},exports.createKaTeXWorkerFromCDN=function(e){var t,n;const o=io(e);if("undefined"==typeof Worker||"undefined"==typeof URL||"undefined"==typeof Blob)return{worker:null,dispose:()=>{},source:o};const r=new Blob([o],{type:"text/javascript"}),l=URL.createObjectURL(r);let i=!1;const a="module"===(null!=(t=e.mode)?t:"classic")?u(s({},null!=(n=e.workerOptions)?n:{}),{type:"module"}):e.workerOptions,d=new Worker(l,a);if(e.debug)try{d.postMessage({type:"init",debug:!0})}catch(po){}return{worker:d,dispose:()=>{if(!i){i=!0;try{URL.revokeObjectURL(l)}catch(po){}}},source:o}},exports.createMermaidWorkerFromCDN=function(e){var t,n;const o=so(e);if("undefined"==typeof Worker||"undefined"==typeof URL||"undefined"==typeof Blob)return{worker:null,dispose:()=>{},source:o};const r=new Blob([o],{type:"text/javascript"}),l=URL.createObjectURL(r);let i=!1;const a="module"===(null!=(t=e.mode)?t:"module")?u(s({},null!=(n=e.workerOptions)?n:{}),{type:"module"}):e.workerOptions,d=new Worker(l,a);if(e.debug)try{d.postMessage({type:"init",debug:!0})}catch(po){}return{worker:d,dispose:()=>{if(!i){i=!0;try{URL.revokeObjectURL(l)}catch(po){}}},source:o}},exports.default=pn,exports.disableD2=function(){an(null)},exports.disableKatex=function(){ye(null)},exports.disableMermaid=function(){Hn(null)},exports.enableD2=function(e){an(null!=e?e:on)},exports.enableKatex=function(e){ye(null!=e?e:ge)},exports.enableMermaid=function(e){Hn(null!=e?e:zn)},exports.findPrefixOffthread=Jn,exports.getCustomNodeComponents=S,exports.getKaTeXBackpressureDefaults=function(){return s({},Ln)},exports.getKaTeXWorkerLoad=function(){return{inFlight:Mn.size,max:Cn}},exports.getLanguageIcon=$e,exports.getMermaidWorkerLoad=function(){return{inFlight:Wn.size,max:Qn}},exports.isD2Enabled=function(){return"function"==typeof ln},exports.isKaTeXWorkerBusy=function(){return Mn.size>=Cn},exports.isKatexEnabled=we,exports.isMermaidEnabled=$n,exports.languageIconsRevision=Be,exports.languageMap=Ue,exports.normalizeLanguageIdentifier=Re,exports.parseNestedMarkdownToNodes=ut,exports.preloadCodeBlockRuntime=function(){return d(this,null,function*(){return Boolean(yield _e())})},exports.preloadExtendedLanguageIcons=function(){return d(this,null,function*(){yield ze()})},exports.removeCustomComponents=function(e){if(e===N)throw new Error("removeCustomComponents: use clearGlobalCustomComponents() to clear the global mapping");delete D.scopedCustomComponents[e],I.value++},exports.renderKaTeXInWorker=In,exports.renderKaTeXWithBackpressure=Bn,exports.renderMarkdownNodeToHtml=function(e,t={}){return Ve(e,We(t))},exports.renderMarkdownNodesToHtml=Ke,exports.renderNestedMarkdownToHtml=function(e,t={}){return function(e,t){if(Array.isArray(e.nodes)&&e.nodes.length>0)return Qe(e.nodes,t);const n=e.node;if(n){const e=nt(n.children);if(e.length>0)return Qe(e,t);const o=ot(n.content);if(o)return Ze(o,t);if(null!=n.raw)return it(ot(n.raw))}return e.content?Ze(ot(e.content),t):""}(e,We(t))},exports.resolveLanguageId=He,exports.setCustomComponents=function(e,t){"string"==typeof e?D.scopedCustomComponents[e]=t||{}:D.scopedCustomComponents[N]=e||{},I.value++},exports.setD2Loader=an,exports.setDefaultI18nMap=function(e){Object.assign(se,e)},exports.setKaTeXBackpressureDefaults=function(e){null!=e.timeout&&(Ln.timeout=Math.max(0,Math.floor(e.timeout))),null!=e.waitTimeout&&(Ln.waitTimeout=Math.max(0,Math.floor(e.waitTimeout))),null!=e.backoffMs&&(Ln.backoffMs=Math.max(0,Math.floor(e.backoffMs))),null!=e.maxRetries&&(Ln.maxRetries=Math.max(0,Math.floor(e.maxRetries)))},exports.setKaTeXCache=Sn,exports.setKaTeXWorker=function(e){wn=e,xn=null,wn.onmessage=e=>{const{id:t,html:n,error:o}=e.data,r=Mn.get(t);if(r)if(Mn.delete(t),clearTimeout(r.timeoutId),Nn(),o)r.reject(new Error(o));else{const{content:t,displayMode:o}=e.data;if(t){const e=`${o?"d":"i"}:${t}`;if(bn.set(e,n),bn.size>200){const e=bn.keys().next().value;bn.delete(e)}}r.resolve(n)}},wn.onerror=e=>{console.error("[katexWorkerClient] Worker error:",e);for(const[t,n]of Mn.entries())clearTimeout(n.timeoutId),n.reject(new Error(`Worker error: ${e.message}`));Mn.clear(),Nn()}},exports.setKaTeXWorkerDebug=function(e){kn=!!e,wn&&wn.postMessage({type:"init",debug:kn})},exports.setKaTeXWorkerMaxConcurrency=function(e){Number.isFinite(e)&&e>0&&(Cn=Math.floor(e))},exports.setKatexLoader=ye,exports.setLanguageIconResolver=Pe,exports.setMermaidLoader=Hn,exports.setMermaidWorker=function(e){Yn=e,Kn=null;const t=e;Yn.onmessage=e=>{if(Yn!==t)return;const{id:n,ok:o,result:r,error:l}=e.data,i=Wn.get(n);i&&(!1===o||l?i.reject(new Error(l||"Unknown error")):i.resolve(r))},Yn.onerror=e=>{var n,o;if(Yn===t)if(0!==Wn.size){try{Vn?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 Wn.entries())n.reject(new Error(`Worker error: ${e.message}`));Wn.clear()}else null==(n=console.debug)||n.call(console,"[mermaidWorkerClient] Worker error (no pending):",(null==e?void 0:e.message)||e)},Yn.onmessageerror=e=>{var n,o;if(Yn===t)if(0!==Wn.size){try{Vn?console.error("[mermaidWorkerClient] Worker messageerror:",e):null==(o=console.debug)||o.call(console,"[mermaidWorkerClient] Worker messageerror:",e)}catch(po){}for(const[e,t]of Wn.entries())t.reject(new Error("Worker messageerror"));Wn.clear()}else null==(n=console.debug)||n.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",e)}},exports.setMermaidWorkerClientDebug=function(e){Vn=!!e},exports.setMermaidWorkerMaxConcurrency=function(e){Number.isFinite(e)&&e>0&&(Qn=Math.floor(e))},exports.terminateWorker=eo,exports.useSmoothMarkdownStream=Qt,exports.waitForKaTeXWorkerSlot=En,Object.keys(c).forEach(e=>{"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:()=>c[e]})});
|