diff --git a/.changeset/secondary-model-always-on.md b/.changeset/secondary-model-always-on.md new file mode 100644 index 00000000000..7655c14b688 --- /dev/null +++ b/.changeset/secondary-model-always-on.md @@ -0,0 +1,5 @@ +--- +"@moonshot-ai/kimi-code": minor +--- + +The subagent model pool (`[secondary_model]`) is now always on; the experimental secondary-model flag and the `KIMI_CODE_EXPERIMENTAL_SECONDARY_MODEL` opt-out have been removed. diff --git a/apps/kimi-code/dist-web/assets/CodeBlockNode-Dh6YGbd1.js b/apps/kimi-code/dist-web/assets/CodeBlockNode-nOFvAmOq.js similarity index 99% rename from apps/kimi-code/dist-web/assets/CodeBlockNode-Dh6YGbd1.js rename to apps/kimi-code/dist-web/assets/CodeBlockNode-nOFvAmOq.js index 862017924e5..c9662c09dae 100644 --- a/apps/kimi-code/dist-web/assets/CodeBlockNode-Dh6YGbd1.js +++ b/apps/kimi-code/dist-web/assets/CodeBlockNode-nOFvAmOq.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-W-09C5Mb.js","assets/index-CiHMlsuo.js","assets/index-CqjkU7Bl.css"])))=>i.map(i=>d[i]); -import{bR as xi,cb as Si,bQ as Ho,M as pl,bl as Ci,af as fl,bY as Mi,cc as Bi,b$ as hl,aU as $,c0 as Ei,c1 as Fi,c2 as Pi,a0 as Mo,aD as No,bE as ue,az as Li,cd as wn,c8 as mt,aI as To,aL as Y,s as Sn,aw as Vt,au as pt,bk as J,ce as Bo,u as ie,I as Ro,A as Oi,bJ as Gt,aY as ht,bL as vl,v as w,t as we,bB as ml,bb as Be,q as b,b7 as $i,cf as zi,cg as bn,ch as Hi,ci as Ni,cj as Ti,ck as Ri,as as A,cl as Eo,cm as Di,cn as Ai,co as Wt,cp as Fo,bO as Do,T as ji,G as qi,F as Po,g as Wi,c7 as _i,b_ as Ii}from"./index-CiHMlsuo.js";import{i as fe,t as kn}from"./safeRaf-DGuzXxDK.js";var xn=(k,M,y)=>new Promise((te,ne)=>{var be=P=>{try{r(y.next(P))}catch(H){ne(H)}},ke=P=>{try{r(y.throw(P))}catch(H){ne(H)}},r=P=>P.done?te(P.value):Promise.resolve(P.value).then(be,ke);r((y=y.apply(k,M)).next())});let Lo=!1,_t=null,It=null,Ut=null;function Ui(){return xn(this,null,function*(){if(Ut)return Ut;Ut=xn(null,null,function*(){if(!It)try{if(It=(function(k){const M=k;if(typeof M?.useMonaco=="function")return M;const y=k?.default;return typeof y?.useMonaco=="function"?y:null})(yield xi(()=>import("./index-W-09C5Mb.js"),__vite__mapDeps([0,1,2]))),!It)return null}catch{return null}try{return yield(function(k){return xn(this,null,function*(){return Lo?void 0:_t||(_t=xn(null,null,function*(){const y=globalThis?.MonacoEnvironment;y&&(typeof y.getWorker=="function"||typeof y.getWorkerUrl=="function")||typeof k?.preloadMonacoWorkers!="function"||(yield k.preloadMonacoWorkers()),Lo=!0}).finally(()=>{_t=null}),_t)})})(It),Si(),It}catch{return null}});try{return yield Ut}finally{Ut=null}})}var Vi=Object.defineProperty,Gi=Object.defineProperties,Ji=Object.getOwnPropertyDescriptors,Oo=Object.getOwnPropertySymbols,Yi=Object.prototype.hasOwnProperty,Qi=Object.prototype.propertyIsEnumerable,$o=(k,M,y)=>M in k?Vi(k,M,{enumerable:!0,configurable:!0,writable:!0,value:y}):k[M]=y,U=(k,M)=>{for(var y in M||(M={}))Yi.call(M,y)&&$o(k,y,M[y]);if(Oo)for(var y of Oo(M))Qi.call(M,y)&&$o(k,y,M[y]);return k},Me=(k,M)=>Gi(k,Ji(M)),j=(k,M,y)=>new Promise((te,ne)=>{var be=P=>{try{r(y.next(P))}catch(H){ne(H)}},ke=P=>{try{r(y.throw(P))}catch(H){ne(H)}},r=P=>P.done?te(P.value):Promise.resolve(P.value).then(be,ke);r((y=y.apply(k,M)).next())});const Xi={key:0,class:"code-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)] border-[var(--code-border)] bg-[var(--code-header-bg)] text-[var(--code-fg)]"},Ki={class:"flex items-center gap-0.5"},Zi=["aria-label"],er={class:"code-diff-stat removed"},tr={class:"code-diff-stat added"},nr=["aria-label"],lr={key:0,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},or={key:1,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},ir=["aria-pressed"],rr={key:3,class:"relative"},ar=["aria-expanded"],ur=["disabled"],sr=["disabled"],dr=["disabled"],cr={key:0,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},fr={key:1,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},vr={class:"code-loading-placeholder"},mr={class:"sr-only","aria-live":"polite",role:"status"},pr=pl({__name:"CodeBlockShell",props:{showHeader:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},showFontSizeButtons:{type:Boolean,default:!0},enableFontSizeControl:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExpandButton:{type:Boolean,default:!0},showPreviewButton:{type:Boolean,default:!0},showTooltips:{type:Boolean,default:!0},isDark:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},stream:{type:Boolean,default:!1},isCollapsed:{type:Boolean,default:!1},isExpanded:{type:Boolean,default:!1},copyText:{type:Boolean,default:!1},isPreviewable:{type:Boolean,default:!1},codeFontSize:{},codeFontMin:{},codeFontMax:{},defaultCodeFontSize:{},fontBaselineReady:{type:Boolean,default:!1},diffStats:{},diffStatsAriaLabel:{}},emits:["toggleCollapse","decreaseFont","resetFont","increaseFont","copy","toggleExpand","preview"],setup(k,{emit:M}){const y=k,te=M,ne=$(!1),be=$(null),ke=$(null);function r(){mt(!0),ne.value=!ne.value,ne.value&&document.addEventListener("click",H,{once:!0,capture:!0})}function P(){mt(!0),ne.value=!1}function H(Q){var v,z;const wt=Q.target;(v=be.value)!=null&&v.contains(wt)||(z=ke.value)!=null&&z.contains(wt)?document.addEventListener("click",H,{once:!0,capture:!0}):P()}const re=b(()=>y.showFontSizeButtons&&y.enableFontSizeControl||y.showExpandButton||y.isPreviewable&&y.showPreviewButton),{t:T}=hl(),gt=b(()=>y.showTooltips!==!1);function Ge(Q,v){gt.value&&_i(Q.currentTarget,v,"top",!1,void 0,y.isDark)}function Ee(){gt.value&&mt()}function yt(Q){Ge(Q,y.copyText?T("common.copied")||"Copied":T("common.copy")||"Copy")}const gl=b(()=>{var Q,v;return!!Number.isFinite(y.codeFontSize)&&((Q=y.codeFontSize)!=null?Q:0)<=((v=y.codeFontMin)!=null?v:0)}),Jt=b(()=>!y.fontBaselineReady||y.codeFontSize===y.defaultCodeFontSize),Yt=b(()=>{var Q,v;return!!Number.isFinite(y.codeFontSize)&&((Q=y.codeFontSize)!=null?Q:0)>=((v=y.codeFontMax)!=null?v:100)});return(Q,v)=>(Y(),ie(Po,null,[y.showHeader?(Y(),ie("div",Xi,[ht(Q.$slots,"header-left"),ht(Q.$slots,"header-right",{},()=>[w("div",Ki,[k.diffStats?(Y(),ie("div",{key:0,class:"code-diff-stats","aria-label":k.diffStatsAriaLabel},[w("span",er,"-"+Be(k.diffStats.removed),1),w("span",tr,"+"+Be(k.diffStats.added),1)],8,Zi)):we("",!0),y.showCopyButton?(Y(),ie("button",{key:1,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] disabled:opacity-40 disabled:cursor-not-allowed transition-colors","aria-label":k.copyText?J(T)("common.copied")||"Copied":J(T)("common.copy")||"Copy",onClick:v[0]||(v[0]=z=>te("copy")),onMouseenter:v[1]||(v[1]=z=>yt(z)),onFocus:v[2]||(v[2]=z=>yt(z)),onMouseleave:Ee,onBlur:Ee},[k.copyText?(Y(),ie("svg",or,[...v[14]||(v[14]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"},null,-1)])])):(Y(),ie("svg",lr,[...v[13]||(v[13]=[w("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[w("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),w("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})],-1)])]))],40,nr)):we("",!0),y.showCollapseButton?(Y(),ie("button",{key:2,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] disabled:opacity-40 disabled:cursor-not-allowed transition-colors","aria-pressed":k.isCollapsed,onClick:v[3]||(v[3]=z=>te("toggleCollapse")),onMouseenter:v[4]||(v[4]=z=>Ge(z,k.isCollapsed?J(T)("common.expand")||"Expand":J(T)("common.collapse")||"Collapse")),onFocus:v[5]||(v[5]=z=>Ge(z,k.isCollapsed?J(T)("common.expand")||"Expand":J(T)("common.collapse")||"Collapse")),onMouseleave:Ee,onBlur:Ee},[(Y(),ie("svg",{style:Vt({rotate:k.isCollapsed?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[...v[15]||(v[15]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"},null,-1)])],4))],40,ir)):we("",!0),re.value?(Y(),ie("div",rr,[w("button",{ref_key:"moreBtnRef",ref:ke,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] transition-colors","aria-expanded":ne.value,"aria-haspopup":"true",onClick:Do(r,["stop"]),onMouseenter:v[6]||(v[6]=z=>Ge(z,J(T)("common.more")||"More")),onFocus:v[7]||(v[7]=z=>Ge(z,J(T)("common.more")||"More")),onMouseleave:Ee,onBlur:Ee},[...v[16]||(v[16]=[qi('',1)])],40,ar),Ro(Wi,{name:"code-menu"},{default:Gt(()=>[ne.value?(Y(),ie("div",{key:0,ref_key:"moreMenuRef",ref:be,class:"code-more-menu min-w-[10rem] p-1 bg-[hsl(var(--ms-popover))] text-[hsl(var(--ms-popover-foreground))] border border-[var(--code-border)] shadow-[var(--ms-shadow-popover)]",role:"menu"},[y.showFontSizeButtons&&y.enableFontSizeControl?(Y(),ie(Po,{key:0},[w("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:gl.value,onClick:v[8]||(v[8]=z=>{J(mt)(!0),te("decreaseFont")})},[v[17]||(v[17]=w("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14"})],-1)),w("span",null,Be(J(T)("common.fontSmaller")||"Font size −"),1)],8,ur),w("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:Jt.value,onClick:v[9]||(v[9]=z=>{J(mt)(!0),te("resetFont")})},[v[18]||(v[18]=w("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[w("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[w("path",{d:"M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8"}),w("path",{d:"M3 3v5h5"})])],-1)),w("span",null,Be(J(T)("common.fontReset")||"Font size reset"),1)],8,sr),w("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:Yt.value,onClick:v[10]||(v[10]=z=>{J(mt)(!0),te("increaseFont")})},[v[19]||(v[19]=w("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14m-7-7v14"})],-1)),w("span",null,Be(J(T)("common.fontLarger")||"Font size +"),1)],8,dr)],64)):we("",!0),y.showExpandButton?(Y(),ie("button",{key:1,type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] transition-colors",onClick:v[11]||(v[11]=z=>{P(),te("toggleExpand")})},[k.isExpanded?(Y(),ie("svg",cr,[...v[20]||(v[20]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"},null,-1)])])):(Y(),ie("svg",fr,[...v[21]||(v[21]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"},null,-1)])])),w("span",null,Be(k.isExpanded?J(T)("common.collapse")||"Collapse":J(T)("common.expand")||"Expand"),1)])):we("",!0),k.isPreviewable&&y.showPreviewButton?(Y(),ie("button",{key:2,type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] transition-colors",onClick:v[12]||(v[12]=z=>{P(),te("preview")})},[v[22]||(v[22]=w("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[w("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[w("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 19.876 0a1 1 0 0 1 0 .696a10.75 10.75 0 0 1-19.876 0"}),w("circle",{cx:"12",cy:"12",r:"3"})])],-1)),w("span",null,Be(J(T)("common.preview")||"Preview"),1)])):we("",!0)],512)):we("",!0)]),_:1})])):we("",!0)])])])):we("",!0),vl(w("div",{class:pt(["code-block-shell-content",{"code-block-shell-content--collapsed":k.isCollapsed}])},[ht(Q.$slots,"default")],2),[[ml,!!k.stream||!k.loading]]),vl(w("div",vr,[ht(Q.$slots,"loading",{},()=>[v[23]||(v[23]=w("div",{class:"loading-skeleton"},[w("div",{class:"skeleton-line"}),w("div",{class:"skeleton-line"}),w("div",{class:"skeleton-line short"})],-1))])],512),[[ml,!k.stream&&k.loading]]),w("span",mr,Be(k.copyText?J(T)("common.copied")||"Copied":""),1)],64))}}),hr={class:"html-preview-frame__header"},gr={class:"html-preview-frame__title"},yr={class:"html-preview-frame__label"},wr=["sandbox","srcdoc"],br=Ho(pl({__name:"HtmlPreviewFrame",props:{code:{},isDark:{type:Boolean},htmlPreviewAllowScripts:{type:Boolean},htmlPreviewSandbox:{},onClose:{type:Function},title:{}},setup(k){const M=k,y=import.meta!==void 0&&!1;let te=null;const{t:ne}=hl(),be=b(()=>{const P=M.code||"",H=P.trim().toLowerCase();return H.startsWith(" +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DGWK8yiH.js","assets/index-BIElaaEN.js","assets/index-BLa5-qfx.css"])))=>i.map(i=>d[i]); +import{bR as xi,cb as Si,bQ as Ho,M as pl,bl as Ci,af as fl,bY as Mi,cc as Bi,b$ as hl,aU as $,c0 as Ei,c1 as Fi,c2 as Pi,a0 as Mo,aD as No,bE as ue,az as Li,cd as wn,c8 as mt,aI as To,aL as Y,s as Sn,aw as Vt,au as pt,bk as J,ce as Bo,u as ie,I as Ro,A as Oi,bJ as Gt,aY as ht,bL as vl,v as w,t as we,bB as ml,bb as Be,q as b,b7 as $i,cf as zi,cg as bn,ch as Hi,ci as Ni,cj as Ti,ck as Ri,as as A,cl as Eo,cm as Di,cn as Ai,co as Wt,cp as Fo,bO as Do,T as ji,G as qi,F as Po,g as Wi,c7 as _i,b_ as Ii}from"./index-BIElaaEN.js";import{i as fe,t as kn}from"./safeRaf-DGuzXxDK.js";var xn=(k,M,y)=>new Promise((te,ne)=>{var be=P=>{try{r(y.next(P))}catch(H){ne(H)}},ke=P=>{try{r(y.throw(P))}catch(H){ne(H)}},r=P=>P.done?te(P.value):Promise.resolve(P.value).then(be,ke);r((y=y.apply(k,M)).next())});let Lo=!1,_t=null,It=null,Ut=null;function Ui(){return xn(this,null,function*(){if(Ut)return Ut;Ut=xn(null,null,function*(){if(!It)try{if(It=(function(k){const M=k;if(typeof M?.useMonaco=="function")return M;const y=k?.default;return typeof y?.useMonaco=="function"?y:null})(yield xi(()=>import("./index-DGWK8yiH.js"),__vite__mapDeps([0,1,2]))),!It)return null}catch{return null}try{return yield(function(k){return xn(this,null,function*(){return Lo?void 0:_t||(_t=xn(null,null,function*(){const y=globalThis?.MonacoEnvironment;y&&(typeof y.getWorker=="function"||typeof y.getWorkerUrl=="function")||typeof k?.preloadMonacoWorkers!="function"||(yield k.preloadMonacoWorkers()),Lo=!0}).finally(()=>{_t=null}),_t)})})(It),Si(),It}catch{return null}});try{return yield Ut}finally{Ut=null}})}var Vi=Object.defineProperty,Gi=Object.defineProperties,Ji=Object.getOwnPropertyDescriptors,Oo=Object.getOwnPropertySymbols,Yi=Object.prototype.hasOwnProperty,Qi=Object.prototype.propertyIsEnumerable,$o=(k,M,y)=>M in k?Vi(k,M,{enumerable:!0,configurable:!0,writable:!0,value:y}):k[M]=y,U=(k,M)=>{for(var y in M||(M={}))Yi.call(M,y)&&$o(k,y,M[y]);if(Oo)for(var y of Oo(M))Qi.call(M,y)&&$o(k,y,M[y]);return k},Me=(k,M)=>Gi(k,Ji(M)),j=(k,M,y)=>new Promise((te,ne)=>{var be=P=>{try{r(y.next(P))}catch(H){ne(H)}},ke=P=>{try{r(y.throw(P))}catch(H){ne(H)}},r=P=>P.done?te(P.value):Promise.resolve(P.value).then(be,ke);r((y=y.apply(k,M)).next())});const Xi={key:0,class:"code-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)] border-[var(--code-border)] bg-[var(--code-header-bg)] text-[var(--code-fg)]"},Ki={class:"flex items-center gap-0.5"},Zi=["aria-label"],er={class:"code-diff-stat removed"},tr={class:"code-diff-stat added"},nr=["aria-label"],lr={key:0,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},or={key:1,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},ir=["aria-pressed"],rr={key:3,class:"relative"},ar=["aria-expanded"],ur=["disabled"],sr=["disabled"],dr=["disabled"],cr={key:0,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},fr={key:1,xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},vr={class:"code-loading-placeholder"},mr={class:"sr-only","aria-live":"polite",role:"status"},pr=pl({__name:"CodeBlockShell",props:{showHeader:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},showFontSizeButtons:{type:Boolean,default:!0},enableFontSizeControl:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExpandButton:{type:Boolean,default:!0},showPreviewButton:{type:Boolean,default:!0},showTooltips:{type:Boolean,default:!0},isDark:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},stream:{type:Boolean,default:!1},isCollapsed:{type:Boolean,default:!1},isExpanded:{type:Boolean,default:!1},copyText:{type:Boolean,default:!1},isPreviewable:{type:Boolean,default:!1},codeFontSize:{},codeFontMin:{},codeFontMax:{},defaultCodeFontSize:{},fontBaselineReady:{type:Boolean,default:!1},diffStats:{},diffStatsAriaLabel:{}},emits:["toggleCollapse","decreaseFont","resetFont","increaseFont","copy","toggleExpand","preview"],setup(k,{emit:M}){const y=k,te=M,ne=$(!1),be=$(null),ke=$(null);function r(){mt(!0),ne.value=!ne.value,ne.value&&document.addEventListener("click",H,{once:!0,capture:!0})}function P(){mt(!0),ne.value=!1}function H(Q){var v,z;const wt=Q.target;(v=be.value)!=null&&v.contains(wt)||(z=ke.value)!=null&&z.contains(wt)?document.addEventListener("click",H,{once:!0,capture:!0}):P()}const re=b(()=>y.showFontSizeButtons&&y.enableFontSizeControl||y.showExpandButton||y.isPreviewable&&y.showPreviewButton),{t:T}=hl(),gt=b(()=>y.showTooltips!==!1);function Ge(Q,v){gt.value&&_i(Q.currentTarget,v,"top",!1,void 0,y.isDark)}function Ee(){gt.value&&mt()}function yt(Q){Ge(Q,y.copyText?T("common.copied")||"Copied":T("common.copy")||"Copy")}const gl=b(()=>{var Q,v;return!!Number.isFinite(y.codeFontSize)&&((Q=y.codeFontSize)!=null?Q:0)<=((v=y.codeFontMin)!=null?v:0)}),Jt=b(()=>!y.fontBaselineReady||y.codeFontSize===y.defaultCodeFontSize),Yt=b(()=>{var Q,v;return!!Number.isFinite(y.codeFontSize)&&((Q=y.codeFontSize)!=null?Q:0)>=((v=y.codeFontMax)!=null?v:100)});return(Q,v)=>(Y(),ie(Po,null,[y.showHeader?(Y(),ie("div",Xi,[ht(Q.$slots,"header-left"),ht(Q.$slots,"header-right",{},()=>[w("div",Ki,[k.diffStats?(Y(),ie("div",{key:0,class:"code-diff-stats","aria-label":k.diffStatsAriaLabel},[w("span",er,"-"+Be(k.diffStats.removed),1),w("span",tr,"+"+Be(k.diffStats.added),1)],8,Zi)):we("",!0),y.showCopyButton?(Y(),ie("button",{key:1,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] disabled:opacity-40 disabled:cursor-not-allowed transition-colors","aria-label":k.copyText?J(T)("common.copied")||"Copied":J(T)("common.copy")||"Copy",onClick:v[0]||(v[0]=z=>te("copy")),onMouseenter:v[1]||(v[1]=z=>yt(z)),onFocus:v[2]||(v[2]=z=>yt(z)),onMouseleave:Ee,onBlur:Ee},[k.copyText?(Y(),ie("svg",or,[...v[14]||(v[14]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"},null,-1)])])):(Y(),ie("svg",lr,[...v[13]||(v[13]=[w("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[w("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),w("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})],-1)])]))],40,nr)):we("",!0),y.showCollapseButton?(Y(),ie("button",{key:2,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] disabled:opacity-40 disabled:cursor-not-allowed transition-colors","aria-pressed":k.isCollapsed,onClick:v[3]||(v[3]=z=>te("toggleCollapse")),onMouseenter:v[4]||(v[4]=z=>Ge(z,k.isCollapsed?J(T)("common.expand")||"Expand":J(T)("common.collapse")||"Collapse")),onFocus:v[5]||(v[5]=z=>Ge(z,k.isCollapsed?J(T)("common.expand")||"Expand":J(T)("common.collapse")||"Collapse")),onMouseleave:Ee,onBlur:Ee},[(Y(),ie("svg",{style:Vt({rotate:k.isCollapsed?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[...v[15]||(v[15]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"},null,-1)])],4))],40,ir)):we("",!0),re.value?(Y(),ie("div",rr,[w("button",{ref_key:"moreBtnRef",ref:ke,type:"button",class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0 cursor-pointer text-[var(--code-action-fg)] hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] active:scale-[0.96] transition-colors","aria-expanded":ne.value,"aria-haspopup":"true",onClick:Do(r,["stop"]),onMouseenter:v[6]||(v[6]=z=>Ge(z,J(T)("common.more")||"More")),onFocus:v[7]||(v[7]=z=>Ge(z,J(T)("common.more")||"More")),onMouseleave:Ee,onBlur:Ee},[...v[16]||(v[16]=[qi('',1)])],40,ar),Ro(Wi,{name:"code-menu"},{default:Gt(()=>[ne.value?(Y(),ie("div",{key:0,ref_key:"moreMenuRef",ref:be,class:"code-more-menu min-w-[10rem] p-1 bg-[hsl(var(--ms-popover))] text-[hsl(var(--ms-popover-foreground))] border border-[var(--code-border)] shadow-[var(--ms-shadow-popover)]",role:"menu"},[y.showFontSizeButtons&&y.enableFontSizeControl?(Y(),ie(Po,{key:0},[w("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:gl.value,onClick:v[8]||(v[8]=z=>{J(mt)(!0),te("decreaseFont")})},[v[17]||(v[17]=w("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14"})],-1)),w("span",null,Be(J(T)("common.fontSmaller")||"Font size −"),1)],8,ur),w("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:Jt.value,onClick:v[9]||(v[9]=z=>{J(mt)(!0),te("resetFont")})},[v[18]||(v[18]=w("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[w("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[w("path",{d:"M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8"}),w("path",{d:"M3 3v5h5"})])],-1)),w("span",null,Be(J(T)("common.fontReset")||"Font size reset"),1)],8,sr),w("button",{type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] disabled:opacity-40 disabled:cursor-not-allowed transition-colors",disabled:Yt.value,onClick:v[10]||(v[10]=z=>{J(mt)(!0),te("increaseFont")})},[v[19]||(v[19]=w("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14m-7-7v14"})],-1)),w("span",null,Be(J(T)("common.fontLarger")||"Font size +"),1)],8,dr)],64)):we("",!0),y.showExpandButton?(Y(),ie("button",{key:1,type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] transition-colors",onClick:v[11]||(v[11]=z=>{P(),te("toggleExpand")})},[k.isExpanded?(Y(),ie("svg",cr,[...v[20]||(v[20]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6"},null,-1)])])):(Y(),ie("svg",fr,[...v[21]||(v[21]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6"},null,-1)])])),w("span",null,Be(k.isExpanded?J(T)("common.collapse")||"Collapse":J(T)("common.expand")||"Expand"),1)])):we("",!0),k.isPreviewable&&y.showPreviewButton?(Y(),ie("button",{key:2,type:"button",role:"menuitem",class:"flex items-center gap-2 w-full py-1.5 px-2 rounded text-xs text-[var(--code-action-fg)] cursor-pointer whitespace-nowrap hover:bg-[var(--code-action-hover-bg)] hover:text-[var(--code-action-hover-fg)] transition-colors",onClick:v[12]||(v[12]=z=>{P(),te("preview")})},[v[22]||(v[22]=w("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24",class:"action-icon"},[w("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[w("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 19.876 0a1 1 0 0 1 0 .696a10.75 10.75 0 0 1-19.876 0"}),w("circle",{cx:"12",cy:"12",r:"3"})])],-1)),w("span",null,Be(J(T)("common.preview")||"Preview"),1)])):we("",!0)],512)):we("",!0)]),_:1})])):we("",!0)])])])):we("",!0),vl(w("div",{class:pt(["code-block-shell-content",{"code-block-shell-content--collapsed":k.isCollapsed}])},[ht(Q.$slots,"default")],2),[[ml,!!k.stream||!k.loading]]),vl(w("div",vr,[ht(Q.$slots,"loading",{},()=>[v[23]||(v[23]=w("div",{class:"loading-skeleton"},[w("div",{class:"skeleton-line"}),w("div",{class:"skeleton-line"}),w("div",{class:"skeleton-line short"})],-1))])],512),[[ml,!k.stream&&k.loading]]),w("span",mr,Be(k.copyText?J(T)("common.copied")||"Copied":""),1)],64))}}),hr={class:"html-preview-frame__header"},gr={class:"html-preview-frame__title"},yr={class:"html-preview-frame__label"},wr=["sandbox","srcdoc"],br=Ho(pl({__name:"HtmlPreviewFrame",props:{code:{},isDark:{type:Boolean},htmlPreviewAllowScripts:{type:Boolean},htmlPreviewSandbox:{},onClose:{type:Function},title:{}},setup(k){const M=k,y=import.meta!==void 0&&!1;let te=null;const{t:ne}=hl(),be=b(()=>{const P=M.code||"",H=P.trim().toLowerCase();return H.startsWith(" diff --git a/apps/kimi-code/dist-web/assets/Tooltip-Da35cfam.js b/apps/kimi-code/dist-web/assets/Tooltip-M0G64eNn.js similarity index 98% rename from apps/kimi-code/dist-web/assets/Tooltip-Da35cfam.js rename to apps/kimi-code/dist-web/assets/Tooltip-M0G64eNn.js index 9723d6798c2..55eb334e595 100644 --- a/apps/kimi-code/dist-web/assets/Tooltip-Da35cfam.js +++ b/apps/kimi-code/dist-web/assets/Tooltip-M0G64eNn.js @@ -1 +1 @@ -import{bQ as A,M as H,aU as b,bE as V,az as J,aL as O,s as Q,v as R,I as F,bJ as G,bL as K,aw as L,H as W,bb as Z,bB as ee,g as te,au as le,T as ae,as as B,bR as ne}from"./index-CiHMlsuo.js";var k=(h,E,e)=>new Promise((o,p)=>{var i=a=>{try{d(e.next(a))}catch(c){p(c)}},y=a=>{try{d(e.throw(a))}catch(c){p(c)}},d=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,y);d((e=e.apply(h,E)).next())});const oe=["id"],ie=["data-placement"],ue=A(H({__name:"Tooltip",props:{visible:{type:Boolean},anchorEl:{},content:{},placement:{},offset:{},originX:{},originY:{},id:{},isDark:{type:[Boolean,null]}},setup(h){var E;const e=h,o=b(null),p=b(null),i=b({transform:"translate3d(0px, 0px, 0px)",left:"0px",top:"0px"}),y=b({}),d=b((E=e.placement)!=null?E:"top"),a=b(!1);let c=null,$=null,T=null,C=null,w=null,s=0;function X(){return C?Promise.resolve(C):(w||(w=ne(()=>import("./floating-ui.dom-xGUaHE3m.js"),[]).then(l=>(C=l,l)).catch(l=>{throw w=null,l})),w)}function D(){c&&(c(),c=null),$=null,T=null}function P(l){return k(this,null,function*(){const t=e.anchorEl,n=o.value;if(!e.visible||!t||!n||$===t&&T===n)return;const{autoUpdate:r}=yield X();l()&&e.visible&&e.anchorEl===t&&o.value===n&&(D(),$=t,T=n,c=r(t,n,()=>{N().catch(()=>{_()})}))})}function N(){return k(this,null,function*(){var l,t;const n=e.anchorEl,r=o.value;if(!e.visible||!n||!r)return!1;const{arrow:u,computePosition:m,flip:v,offset:f,shift:x}=yield X();if(!e.visible||e.anchorEl!==n||o.value!==r)return!1;const g=[f((l=e.offset)!=null?l:6),v(),x({padding:6}),...p.value?[u({element:p.value,padding:4})]:[]],{x:S,y:j,placement:Y,middlewareData:z}=yield m(n,r,{placement:(t=e.placement)!=null?t:"top",middleware:g,strategy:"fixed"});if(!e.visible||e.anchorEl!==n||o.value!==r)return!1;if(i.value.transform=`translate3d(${Math.round(S)}px, ${Math.round(j)}px, 0)`,i.value.left="0px",i.value.top="0px",d.value=Y,z.arrow&&p.value){const{x:I,y:U}=z.arrow,q={top:"bottom",bottom:"top",left:"right",right:"left"}[Y.split("-")[0]];y.value={left:I!=null?`${I}px`:"",top:U!=null?`${U}px`:"",[q]:"-3px"}}return!0})}function _(){var l,t;const n=e.anchorEl,r=o.value;if(!n||!r)return!1;const u=n.getBoundingClientRect(),m=r.getBoundingClientRect(),v=(l=e.offset)!=null?l:6,f=(t=e.placement)!=null?t:"top";let x=u.left,g=u.top;return f==="bottom"?g=u.bottom+v:f==="left"?x=u.left-m.width-v:f==="right"?x=u.right+v:g=u.top-m.height-v,i.value.transform=`translate3d(${Math.round(Math.max(0,x))}px, ${Math.round(Math.max(0,g))}px, 0)`,i.value.left="0px",i.value.top="0px",d.value=f,y.value={},!0}V(()=>e.visible,l=>k(null,null,function*(){const t=++s;if(l){if(a.value=!1,yield B(),t!==s||!e.visible)return;if(e.anchorEl&&o.value)try{const n=e.anchorEl,r=o.value,u=n.getBoundingClientRect();if(!(yield N())||t!==s||!e.visible||e.anchorEl!==n||o.value!==r)return;const m=i.value.transform;if(e.originX!=null&&e.originY!=null){const v=Math.abs(Number(e.originX)-u.left),f=Math.abs(Number(e.originY)-u.top);if(Math.hypot(v,f)>120){if(i.value.transform=`translate3d(${Math.round(e.originX)}px, ${Math.round(e.originY)}px, 0)`,yield B(),t!==s||!e.visible||(a.value=!0,yield B(),t!==s||!e.visible))return;i.value.transform=m}else a.value=!0}else a.value=!0;yield P(()=>t===s)}catch{if(t!==s||!e.visible)return;if(a.value=_(),e.anchorEl&&o.value)try{yield P(()=>t===s)}catch{}}else a.value=!0}else a.value=!1,D()}));let M=0;return V([()=>e.anchorEl,()=>e.placement,()=>e.content],()=>k(null,null,function*(){const l=++M;if(e.visible&&e.anchorEl&&o.value){if(yield B(),l!==M||!e.visible||!e.anchorEl||!o.value)return;try{const t=yield N();if(l!==M||!e.visible||!e.anchorEl||!o.value)return;t||_()}catch{_()}yield P(()=>l===M)}})),J(()=>{s+=1,D()}),(l,t)=>(O(),Q(ae,{to:"body"},[R("div",{class:le(["markstream-vue",{dark:h.isDark}])},[F(te,{name:"tooltip",appear:""},{default:G(()=>[K(R("div",{id:e.id,ref_key:"tooltip",ref:o,style:L({position:"fixed",left:i.value.left,top:i.value.top,transform:i.value.transform,visibility:a.value?"visible":"hidden",pointerEvents:a.value?void 0:"none"}),class:"tooltip-element",role:"tooltip"},[W(Z(h.content)+" ",1),R("div",{ref_key:"arrowEl",ref:p,class:"tooltip-arrow","data-placement":d.value,style:L(y.value)},null,12,ie)],12,oe),[[ee,h.visible]])]),_:1})],2)]))}}),[["__scopeId","data-v-c606ee4c"]]);export{ue as default}; +import{bQ as A,M as H,aU as b,bE as V,az as J,aL as O,s as Q,v as R,I as F,bJ as G,bL as K,aw as L,H as W,bb as Z,bB as ee,g as te,au as le,T as ae,as as B,bR as ne}from"./index-BIElaaEN.js";var k=(h,E,e)=>new Promise((o,p)=>{var i=a=>{try{d(e.next(a))}catch(c){p(c)}},y=a=>{try{d(e.throw(a))}catch(c){p(c)}},d=a=>a.done?o(a.value):Promise.resolve(a.value).then(i,y);d((e=e.apply(h,E)).next())});const oe=["id"],ie=["data-placement"],ue=A(H({__name:"Tooltip",props:{visible:{type:Boolean},anchorEl:{},content:{},placement:{},offset:{},originX:{},originY:{},id:{},isDark:{type:[Boolean,null]}},setup(h){var E;const e=h,o=b(null),p=b(null),i=b({transform:"translate3d(0px, 0px, 0px)",left:"0px",top:"0px"}),y=b({}),d=b((E=e.placement)!=null?E:"top"),a=b(!1);let c=null,$=null,T=null,C=null,w=null,s=0;function X(){return C?Promise.resolve(C):(w||(w=ne(()=>import("./floating-ui.dom-xGUaHE3m.js"),[]).then(l=>(C=l,l)).catch(l=>{throw w=null,l})),w)}function D(){c&&(c(),c=null),$=null,T=null}function P(l){return k(this,null,function*(){const t=e.anchorEl,n=o.value;if(!e.visible||!t||!n||$===t&&T===n)return;const{autoUpdate:r}=yield X();l()&&e.visible&&e.anchorEl===t&&o.value===n&&(D(),$=t,T=n,c=r(t,n,()=>{N().catch(()=>{_()})}))})}function N(){return k(this,null,function*(){var l,t;const n=e.anchorEl,r=o.value;if(!e.visible||!n||!r)return!1;const{arrow:u,computePosition:m,flip:v,offset:f,shift:x}=yield X();if(!e.visible||e.anchorEl!==n||o.value!==r)return!1;const g=[f((l=e.offset)!=null?l:6),v(),x({padding:6}),...p.value?[u({element:p.value,padding:4})]:[]],{x:S,y:j,placement:Y,middlewareData:z}=yield m(n,r,{placement:(t=e.placement)!=null?t:"top",middleware:g,strategy:"fixed"});if(!e.visible||e.anchorEl!==n||o.value!==r)return!1;if(i.value.transform=`translate3d(${Math.round(S)}px, ${Math.round(j)}px, 0)`,i.value.left="0px",i.value.top="0px",d.value=Y,z.arrow&&p.value){const{x:I,y:U}=z.arrow,q={top:"bottom",bottom:"top",left:"right",right:"left"}[Y.split("-")[0]];y.value={left:I!=null?`${I}px`:"",top:U!=null?`${U}px`:"",[q]:"-3px"}}return!0})}function _(){var l,t;const n=e.anchorEl,r=o.value;if(!n||!r)return!1;const u=n.getBoundingClientRect(),m=r.getBoundingClientRect(),v=(l=e.offset)!=null?l:6,f=(t=e.placement)!=null?t:"top";let x=u.left,g=u.top;return f==="bottom"?g=u.bottom+v:f==="left"?x=u.left-m.width-v:f==="right"?x=u.right+v:g=u.top-m.height-v,i.value.transform=`translate3d(${Math.round(Math.max(0,x))}px, ${Math.round(Math.max(0,g))}px, 0)`,i.value.left="0px",i.value.top="0px",d.value=f,y.value={},!0}V(()=>e.visible,l=>k(null,null,function*(){const t=++s;if(l){if(a.value=!1,yield B(),t!==s||!e.visible)return;if(e.anchorEl&&o.value)try{const n=e.anchorEl,r=o.value,u=n.getBoundingClientRect();if(!(yield N())||t!==s||!e.visible||e.anchorEl!==n||o.value!==r)return;const m=i.value.transform;if(e.originX!=null&&e.originY!=null){const v=Math.abs(Number(e.originX)-u.left),f=Math.abs(Number(e.originY)-u.top);if(Math.hypot(v,f)>120){if(i.value.transform=`translate3d(${Math.round(e.originX)}px, ${Math.round(e.originY)}px, 0)`,yield B(),t!==s||!e.visible||(a.value=!0,yield B(),t!==s||!e.visible))return;i.value.transform=m}else a.value=!0}else a.value=!0;yield P(()=>t===s)}catch{if(t!==s||!e.visible)return;if(a.value=_(),e.anchorEl&&o.value)try{yield P(()=>t===s)}catch{}}else a.value=!0}else a.value=!1,D()}));let M=0;return V([()=>e.anchorEl,()=>e.placement,()=>e.content],()=>k(null,null,function*(){const l=++M;if(e.visible&&e.anchorEl&&o.value){if(yield B(),l!==M||!e.visible||!e.anchorEl||!o.value)return;try{const t=yield N();if(l!==M||!e.visible||!e.anchorEl||!o.value)return;t||_()}catch{_()}yield P(()=>l===M)}})),J(()=>{s+=1,D()}),(l,t)=>(O(),Q(ae,{to:"body"},[R("div",{class:le(["markstream-vue",{dark:h.isDark}])},[F(te,{name:"tooltip",appear:""},{default:G(()=>[K(R("div",{id:e.id,ref_key:"tooltip",ref:o,style:L({position:"fixed",left:i.value.left,top:i.value.top,transform:i.value.transform,visibility:a.value?"visible":"hidden",pointerEvents:a.value?void 0:"none"}),class:"tooltip-element",role:"tooltip"},[W(Z(h.content)+" ",1),R("div",{ref_key:"arrowEl",ref:p,class:"tooltip-arrow","data-placement":d.value,style:L(y.value)},null,12,ie)],12,oe),[[ee,h.visible]])]),_:1})],2)]))}}),[["__scopeId","data-v-c606ee4c"]]);export{ue as default}; diff --git a/apps/kimi-code/dist-web/assets/abnfDiagram-VRR7QNED-C6R_sAbc.js b/apps/kimi-code/dist-web/assets/abnfDiagram-VRR7QNED-DmLgMs0J.js similarity index 86% rename from apps/kimi-code/dist-web/assets/abnfDiagram-VRR7QNED-C6R_sAbc.js rename to apps/kimi-code/dist-web/assets/abnfDiagram-VRR7QNED-DmLgMs0J.js index 5d9414f74aa..caba2d19f24 100644 --- a/apps/kimi-code/dist-web/assets/abnfDiagram-VRR7QNED-C6R_sAbc.js +++ b/apps/kimi-code/dist-web/assets/abnfDiagram-VRR7QNED-DmLgMs0J.js @@ -1 +1 @@ -import{g as p,r as u,d as a}from"./chunk-MOJQB5TN-DmVMZHwQ.js";import{p as f}from"./chunk-JWPE2WC7-BJMJfnyy.js";import{_ as n,l as o}from"./mermaid.core-WW7RuneT.js";import{M as c,b as d}from"./cynefin-VYW2F7L2-DI-9Z5R0.js";import"./index-CiHMlsuo.js";import"./_commonjsHelpers-CqkleIqs.js";var v=d().RailroadAbnf.parser.LangiumParser,i=n(e=>{const r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=n(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=n(e=>{if(e.includes("*")){const[t,s]=e.split("*"),l=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:l,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),y=n(e=>{const r=A(e.primary);if(!e.repeat)return r;const{min:t,max:s}=b(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),A=n(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return i(e.element);case"AbnfOptionalGroup":return{type:"optional",element:i(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),P=n(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=n(e=>{f(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(P(r)))},"populateDb"),R={parse:n(e=>{a.clear(),o.debug("[ABNF Parser] Starting Langium parse");const r=v.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new c(r);const t=r.value;o.debug("[ABNF Parser] Parsed rules:",t.rules.length),h(t),o.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:a}},F={parser:R,db:a,renderer:u,styles:p};export{F as diagram}; +import{g as p,r as u,d as a}from"./chunk-MOJQB5TN-n_KgTrfq.js";import{p as f}from"./chunk-JWPE2WC7-CI-VQAzP.js";import{_ as n,l as o}from"./mermaid.core-mH2pk-lc.js";import{M as c,b as d}from"./cynefin-VYW2F7L2-BD8Xugtm.js";import"./index-BIElaaEN.js";import"./_commonjsHelpers-CqkleIqs.js";var v=d().RailroadAbnf.parser.LangiumParser,i=n(e=>{const r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=n(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=n(e=>{if(e.includes("*")){const[t,s]=e.split("*"),l=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:l,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),y=n(e=>{const r=A(e.primary);if(!e.repeat)return r;const{min:t,max:s}=b(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),A=n(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return i(e.element);case"AbnfOptionalGroup":return{type:"optional",element:i(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),P=n(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=n(e=>{f(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(P(r)))},"populateDb"),R={parse:n(e=>{a.clear(),o.debug("[ABNF Parser] Starting Langium parse");const r=v.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new c(r);const t=r.value;o.debug("[ABNF Parser] Parsed rules:",t.rules.length),h(t),o.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:a}},F={parser:R,db:a,renderer:u,styles:p};export{F as diagram}; diff --git a/apps/kimi-code/dist-web/assets/arc-CPC2gY0w.js b/apps/kimi-code/dist-web/assets/arc-mza1S6-9.js similarity index 98% rename from apps/kimi-code/dist-web/assets/arc-CPC2gY0w.js rename to apps/kimi-code/dist-web/assets/arc-mza1S6-9.js index ecd4bdd5077..467e0aa3e54 100644 --- a/apps/kimi-code/dist-web/assets/arc-CPC2gY0w.js +++ b/apps/kimi-code/dist-web/assets/arc-mza1S6-9.js @@ -1 +1 @@ -import{P as ln,Q as an,R as j,S,T as W,V as un,W as y,X as tn,Y as C,$ as _,a0 as rn,a1 as o,a2 as on,a3 as sn,a4 as fn}from"./mermaid.core-WW7RuneT.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,E,q,v,R,X,a){var I=E-l,i=q-h,n=X-v,d=a-R,u=d*I-n*i;if(!(u*ur*r+$*$&&(Q=w,V=p),{cx:Q,cy:V,x01:-n,y01:-d,x11:Q*(v/T-1),y11:V*(v/T-1)}}function hn(){var l=cn,h=yn,E=W(0),q=null,v=gn,R=dn,X=mn,a=null,I=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=R.apply(this,arguments)-un,Y=rn(c-f),t=c>f;if(a||(a=n=I()),sy))a.moveTo(0,0);else if(Y>tn-y)a.moveTo(s*j(f),s*S(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*j(c),u*S(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,A=f,T=c,P=Y,O=Y,Q=X.apply(this,arguments)/2,V=Q>y&&(q?+q.apply(this,arguments):C(u*u+s*s)),w=_(rn(s-u)/2,+E.apply(this,arguments)),p=w,x=w,e,r;if(V>y){var $=sn(V/u*S(Q)),F=sn(V/s*S(Q));(P-=$*2)>y?($*=t?1:-1,A+=$,T-=$):(P=0,A=T=(f+c)/2),(O-=F*2)>y?(F*=t?1:-1,m+=F,g-=F):(O=0,m=g=(f+c)/2)}var z=s*j(m),B=s*S(m),G=u*j(T),H=u*S(T);if(w>y){var J=s*j(g),K=s*S(g),M=u*j(A),N=u*S(A),D;if(Yy?x>y?(e=L(M,N,z,B,s,x,t),r=L(J,K,G,H,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),xy)||!(P>y)?a.lineTo(G,H):p>y?(e=L(G,H,J,K,u,-p,t),r=L(z,B,M,N,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),pr*r+$*$&&(Q=w,V=p),{cx:Q,cy:V,x01:-n,y01:-d,x11:Q*(v/T-1),y11:V*(v/T-1)}}function hn(){var l=cn,h=yn,E=W(0),q=null,v=gn,R=dn,X=mn,a=null,I=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=R.apply(this,arguments)-un,Y=rn(c-f),t=c>f;if(a||(a=n=I()),sy))a.moveTo(0,0);else if(Y>tn-y)a.moveTo(s*j(f),s*S(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*j(c),u*S(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,A=f,T=c,P=Y,O=Y,Q=X.apply(this,arguments)/2,V=Q>y&&(q?+q.apply(this,arguments):C(u*u+s*s)),w=_(rn(s-u)/2,+E.apply(this,arguments)),p=w,x=w,e,r;if(V>y){var $=sn(V/u*S(Q)),F=sn(V/s*S(Q));(P-=$*2)>y?($*=t?1:-1,A+=$,T-=$):(P=0,A=T=(f+c)/2),(O-=F*2)>y?(F*=t?1:-1,m+=F,g-=F):(O=0,m=g=(f+c)/2)}var z=s*j(m),B=s*S(m),G=u*j(T),H=u*S(T);if(w>y){var J=s*j(g),K=s*S(g),M=u*j(A),N=u*S(A),D;if(Yy?x>y?(e=L(M,N,z,B,s,x,t),r=L(J,K,G,H,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),xy)||!(P>y)?a.lineTo(G,H):p>y?(e=L(G,H,J,K,u,-p,t),r=L(z,B,M,N,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),ps?(this.rect.x-=(this.labelWidth-s)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(s+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(o+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>o?(this.rect.y-=(this.labelHeight-o)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(o+this.labelHeight))}}},e.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==h.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},e.prototype.transform=function(t){var s=this.rect.x;s>r.WORLD_BOUNDARY?s=r.WORLD_BOUNDARY:s<-r.WORLD_BOUNDARY&&(s=-r.WORLD_BOUNDARY);var o=this.rect.y;o>r.WORLD_BOUNDARY?o=r.WORLD_BOUNDARY:o<-r.WORLD_BOUNDARY&&(o=-r.WORLD_BOUNDARY);var c=new f(s,o),l=t.inverseTransformPoint(c);this.setLocation(l.x,l.y)},e.prototype.getLeft=function(){return this.rect.x},e.prototype.getRight=function(){return this.rect.x+this.rect.width},e.prototype.getTop=function(){return this.rect.y},e.prototype.getBottom=function(){return this.rect.y+this.rect.height},e.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},A.exports=e}),(function(A,G,N){var v=N(0);function h(){}for(var i in v)h[i]=v[i];h.MAX_ITERATIONS=2500,h.DEFAULT_EDGE_LENGTH=50,h.DEFAULT_SPRING_STRENGTH=.45,h.DEFAULT_REPULSION_STRENGTH=4500,h.DEFAULT_GRAVITY_STRENGTH=.4,h.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,h.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,h.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,h.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,h.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,h.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,h.COOLING_ADAPTATION_FACTOR=.33,h.ADAPTATION_LOWER_NODE_LIMIT=1e3,h.ADAPTATION_UPPER_NODE_LIMIT=5e3,h.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,h.MAX_NODE_DISPLACEMENT=h.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,h.MIN_REPULSION_DIST=h.DEFAULT_EDGE_LENGTH/10,h.CONVERGENCE_CHECK_PERIOD=100,h.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,h.MIN_EDGE_LENGTH=1,h.GRID_CALCULATION_CHECK_PERIOD=10,A.exports=h}),(function(A,G,N){function v(h,i){h==null&&i==null?(this.x=0,this.y=0):(this.x=h,this.y=i)}v.prototype.getX=function(){return this.x},v.prototype.getY=function(){return this.y},v.prototype.setX=function(h){this.x=h},v.prototype.setY=function(h){this.y=h},v.prototype.getDifference=function(h){return new DimensionD(this.x-h.x,this.y-h.y)},v.prototype.getCopy=function(){return new v(this.x,this.y)},v.prototype.translate=function(h){return this.x+=h.width,this.y+=h.height,this},A.exports=v}),(function(A,G,N){var v=N(2),h=N(10),i=N(0),r=N(7),a=N(3),f=N(1),e=N(13),u=N(12),t=N(11);function s(c,l,T){v.call(this,T),this.estimatedSize=h.MIN_VALUE,this.margin=i.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=c,l!=null&&l instanceof r?this.graphManager=l:l!=null&&l instanceof Layout&&(this.graphManager=l.graphManager)}s.prototype=Object.create(v.prototype);for(var o in v)s[o]=v[o];s.prototype.getNodes=function(){return this.nodes},s.prototype.getEdges=function(){return this.edges},s.prototype.getGraphManager=function(){return this.graphManager},s.prototype.getParent=function(){return this.parent},s.prototype.getLeft=function(){return this.left},s.prototype.getRight=function(){return this.right},s.prototype.getTop=function(){return this.top},s.prototype.getBottom=function(){return this.bottom},s.prototype.isConnected=function(){return this.isConnected},s.prototype.add=function(c,l,T){if(l==null&&T==null){var g=c;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(g)>-1)throw"Node already in graph!";return g.owner=this,this.getNodes().push(g),g}else{var d=c;if(!(this.getNodes().indexOf(l)>-1&&this.getNodes().indexOf(T)>-1))throw"Source or target not in graph!";if(!(l.owner==T.owner&&l.owner==this))throw"Both owners must be this graph!";return l.owner!=T.owner?null:(d.source=l,d.target=T,d.isInterGraph=!1,this.getEdges().push(d),l.edges.push(d),T!=l&&T.edges.push(d),d)}},s.prototype.remove=function(c){var l=c;if(c instanceof a){if(l==null)throw"Node is null!";if(!(l.owner!=null&&l.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var T=l.edges.slice(),g,d=T.length,C=0;C-1&&P>-1))throw"Source and/or target doesn't know this edge!";g.source.edges.splice(w,1),g.target!=g.source&&g.target.edges.splice(P,1);var S=g.source.owner.getEdges().indexOf(g);if(S==-1)throw"Not in owner's edge list!";g.source.owner.getEdges().splice(S,1)}},s.prototype.updateLeftTop=function(){for(var c=h.MAX_VALUE,l=h.MAX_VALUE,T,g,d,C=this.getNodes(),S=C.length,w=0;wT&&(c=T),l>g&&(l=g)}return c==h.MAX_VALUE?null:(C[0].getParent().paddingLeft!=null?d=C[0].getParent().paddingLeft:d=this.margin,this.left=l-d,this.top=c-d,new u(this.left,this.top))},s.prototype.updateBounds=function(c){for(var l=h.MAX_VALUE,T=-h.MAX_VALUE,g=h.MAX_VALUE,d=-h.MAX_VALUE,C,S,w,P,B,U=this.nodes,V=U.length,M=0;MC&&(l=C),Tw&&(g=w),dC&&(l=C),Tw&&(g=w),d=this.nodes.length){var V=0;T.forEach(function(M){M.owner==c&&V++}),V==this.nodes.length&&(this.isConnected=!0)}},A.exports=s}),(function(A,G,N){var v,h=N(1);function i(r){v=N(6),this.layout=r,this.graphs=[],this.edges=[]}i.prototype.addRoot=function(){var r=this.layout.newGraph(),a=this.layout.newNode(null),f=this.add(r,a);return this.setRootGraph(f),this.rootGraph},i.prototype.add=function(r,a,f,e,u){if(f==null&&e==null&&u==null){if(r==null)throw"Graph is null!";if(a==null)throw"Parent node is null!";if(this.graphs.indexOf(r)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(r),r.parent!=null)throw"Already has a parent!";if(a.child!=null)throw"Already has a child!";return r.parent=a,a.child=r,r}else{u=f,e=a,f=r;var t=e.getOwner(),s=u.getOwner();if(!(t!=null&&t.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(s!=null&&s.getGraphManager()==this))throw"Target not in this graph mgr!";if(t==s)return f.isInterGraph=!1,t.add(f,e,u);if(f.isInterGraph=!0,f.source=e,f.target=u,this.edges.indexOf(f)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(f),!(f.source!=null&&f.target!=null))throw"Edge source and/or target is null!";if(!(f.source.edges.indexOf(f)==-1&&f.target.edges.indexOf(f)==-1))throw"Edge already in source and/or target incidency list!";return f.source.edges.push(f),f.target.edges.push(f),f}},i.prototype.remove=function(r){if(r instanceof v){var a=r;if(a.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(a==this.rootGraph||a.parent!=null&&a.parent.graphManager==this))throw"Invalid parent node!";var f=[];f=f.concat(a.getEdges());for(var e,u=f.length,t=0;t=r.getRight()?a[0]+=Math.min(r.getX()-i.getX(),i.getRight()-r.getRight()):r.getX()<=i.getX()&&r.getRight()>=i.getRight()&&(a[0]+=Math.min(i.getX()-r.getX(),r.getRight()-i.getRight())),i.getY()<=r.getY()&&i.getBottom()>=r.getBottom()?a[1]+=Math.min(r.getY()-i.getY(),i.getBottom()-r.getBottom()):r.getY()<=i.getY()&&r.getBottom()>=i.getBottom()&&(a[1]+=Math.min(i.getY()-r.getY(),r.getBottom()-i.getBottom()));var u=Math.abs((r.getCenterY()-i.getCenterY())/(r.getCenterX()-i.getCenterX()));r.getCenterY()===i.getCenterY()&&r.getCenterX()===i.getCenterX()&&(u=1);var t=u*a[0],s=a[1]/u;a[0]t)return a[0]=f,a[1]=o,a[2]=u,a[3]=U,!1;if(eu)return a[0]=s,a[1]=e,a[2]=P,a[3]=t,!1;if(fu?(a[0]=l,a[1]=T,n=!0):(a[0]=c,a[1]=o,n=!0):p===y&&(f>u?(a[0]=s,a[1]=o,n=!0):(a[0]=g,a[1]=T,n=!0)),-m===y?u>f?(a[2]=B,a[3]=U,E=!0):(a[2]=P,a[3]=w,E=!0):m===y&&(u>f?(a[2]=S,a[3]=w,E=!0):(a[2]=V,a[3]=U,E=!0)),n&&E)return!1;if(f>u?e>t?(I=this.getCardinalDirection(p,y,4),O=this.getCardinalDirection(m,y,2)):(I=this.getCardinalDirection(-p,y,3),O=this.getCardinalDirection(-m,y,1)):e>t?(I=this.getCardinalDirection(-p,y,1),O=this.getCardinalDirection(-m,y,3)):(I=this.getCardinalDirection(p,y,2),O=this.getCardinalDirection(m,y,4)),!n)switch(I){case 1:W=o,R=f+-C/y,a[0]=R,a[1]=W;break;case 2:R=g,W=e+d*y,a[0]=R,a[1]=W;break;case 3:W=T,R=f+C/y,a[0]=R,a[1]=W;break;case 4:R=l,W=e+-d*y,a[0]=R,a[1]=W;break}if(!E)switch(O){case 1:Q=w,x=u+-_/y,a[2]=x,a[3]=Q;break;case 2:x=V,Q=t+M*y,a[2]=x,a[3]=Q;break;case 3:Q=U,x=u+_/y,a[2]=x,a[3]=Q;break;case 4:x=B,Q=t+-M*y,a[2]=x,a[3]=Q;break}}return!1},h.getCardinalDirection=function(i,r,a){return i>r?a:1+a%4},h.getIntersection=function(i,r,a,f){if(f==null)return this.getIntersection2(i,r,a);var e=i.x,u=i.y,t=r.x,s=r.y,o=a.x,c=a.y,l=f.x,T=f.y,g=void 0,d=void 0,C=void 0,S=void 0,w=void 0,P=void 0,B=void 0,U=void 0,V=void 0;return C=s-u,w=e-t,B=t*u-e*s,S=T-c,P=o-l,U=l*c-o*T,V=C*P-S*w,V===0?null:(g=(w*U-P*B)/V,d=(S*B-C*U)/V,new v(g,d))},h.angleOfVector=function(i,r,a,f){var e=void 0;return i!==a?(e=Math.atan((f-r)/(a-i)),a=0){var T=(-o+Math.sqrt(o*o-4*s*c))/(2*s),g=(-o-Math.sqrt(o*o-4*s*c))/(2*s),d=null;return T>=0&&T<=1?[T]:g>=0&&g<=1?[g]:d}else return null},h.HALF_PI=.5*Math.PI,h.ONE_AND_HALF_PI=1.5*Math.PI,h.TWO_PI=2*Math.PI,h.THREE_PI=3*Math.PI,A.exports=h}),(function(A,G,N){function v(){}v.sign=function(h){return h>0?1:h<0?-1:0},v.floor=function(h){return h<0?Math.ceil(h):Math.floor(h)},v.ceil=function(h){return h<0?Math.floor(h):Math.ceil(h)},A.exports=v}),(function(A,G,N){function v(){}v.MAX_VALUE=2147483647,v.MIN_VALUE=-2147483648,A.exports=v}),(function(A,G,N){var v=(function(){function e(u,t){for(var s=0;s"u"?"undefined":v(i);return i==null||r!="object"&&r!="function"},A.exports=h}),(function(A,G,N){function v(o){if(Array.isArray(o)){for(var c=0,l=Array(o.length);c0&&c;){for(C.push(w[0]);C.length>0&&c;){var P=C[0];C.splice(0,1),d.add(P);for(var B=P.getEdges(),g=0;g-1&&w.splice(_,1)}d=new Set,S=new Map}}return o},s.prototype.createDummyNodesForBendpoints=function(o){for(var c=[],l=o.source,T=this.graphManager.calcLowestCommonAncestor(o.source,o.target),g=0;g0){for(var T=this.edgeToDummyNodes.get(l),g=0;g=0&&c.splice(U,1);var V=S.getNeighborsList();V.forEach(function(n){if(l.indexOf(n)<0){var E=T.get(n),p=E-1;p==1&&P.push(n),T.set(n,p)}})}l=l.concat(P),(c.length==1||c.length==2)&&(g=!0,d=c[0])}return d},s.prototype.setGraphManager=function(o){this.graphManager=o},A.exports=s}),(function(A,G,N){function v(){}v.seed=1,v.x=0,v.nextDouble=function(){return v.x=Math.sin(v.seed++)*1e4,v.x-Math.floor(v.x)},A.exports=v}),(function(A,G,N){var v=N(5);function h(i,r){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}h.prototype.getWorldOrgX=function(){return this.lworldOrgX},h.prototype.setWorldOrgX=function(i){this.lworldOrgX=i},h.prototype.getWorldOrgY=function(){return this.lworldOrgY},h.prototype.setWorldOrgY=function(i){this.lworldOrgY=i},h.prototype.getWorldExtX=function(){return this.lworldExtX},h.prototype.setWorldExtX=function(i){this.lworldExtX=i},h.prototype.getWorldExtY=function(){return this.lworldExtY},h.prototype.setWorldExtY=function(i){this.lworldExtY=i},h.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},h.prototype.setDeviceOrgX=function(i){this.ldeviceOrgX=i},h.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},h.prototype.setDeviceOrgY=function(i){this.ldeviceOrgY=i},h.prototype.getDeviceExtX=function(){return this.ldeviceExtX},h.prototype.setDeviceExtX=function(i){this.ldeviceExtX=i},h.prototype.getDeviceExtY=function(){return this.ldeviceExtY},h.prototype.setDeviceExtY=function(i){this.ldeviceExtY=i},h.prototype.transformX=function(i){var r=0,a=this.lworldExtX;return a!=0&&(r=this.ldeviceOrgX+(i-this.lworldOrgX)*this.ldeviceExtX/a),r},h.prototype.transformY=function(i){var r=0,a=this.lworldExtY;return a!=0&&(r=this.ldeviceOrgY+(i-this.lworldOrgY)*this.ldeviceExtY/a),r},h.prototype.inverseTransformX=function(i){var r=0,a=this.ldeviceExtX;return a!=0&&(r=this.lworldOrgX+(i-this.ldeviceOrgX)*this.lworldExtX/a),r},h.prototype.inverseTransformY=function(i){var r=0,a=this.ldeviceExtY;return a!=0&&(r=this.lworldOrgY+(i-this.ldeviceOrgY)*this.lworldExtY/a),r},h.prototype.inverseTransformPoint=function(i){var r=new v(this.inverseTransformX(i.x),this.inverseTransformY(i.y));return r},A.exports=h}),(function(A,G,N){function v(t){if(Array.isArray(t)){for(var s=0,o=Array(t.length);si.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*i.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(t-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-i.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT_INCREMENTAL):(t>i.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(i.COOLING_ADAPTATION_FACTOR,1-(t-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*(1-i.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*i.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},e.prototype.calcSpringForces=function(){for(var t=this.getAllEdges(),s,o=0;o0&&arguments[0]!==void 0?arguments[0]:!0,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,o,c,l,T,g=this.getAllNodes(),d;if(this.useFRGridVariant)for(this.totalIterations%i.GRID_CALCULATION_CHECK_PERIOD==1&&t&&this.updateGrid(),d=new Set,o=0;oC||d>C)&&(t.gravitationForceX=-this.gravityConstant*l,t.gravitationForceY=-this.gravityConstant*T)):(C=s.getEstimatedSize()*this.compoundGravityRangeFactor,(g>C||d>C)&&(t.gravitationForceX=-this.gravityConstant*l*this.compoundGravityConstant,t.gravitationForceY=-this.gravityConstant*T*this.compoundGravityConstant))},e.prototype.isConverged=function(){var t,s=!1;return this.totalIterations>this.maxIterations/3&&(s=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),t=this.totalDisplacement=g.length||C>=g[0].length)){for(var S=0;Se}}]),a})();A.exports=r}),(function(A,G,N){function v(){}v.svd=function(h){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=h.length,this.n=h[0].length;var i=Math.min(this.m,this.n);this.s=(function(Tt){for(var Ct=[];Tt-- >0;)Ct.push(0);return Ct})(Math.min(this.m+1,this.n)),this.U=(function(Tt){var Ct=function Bt(bt){if(bt.length==0)return 0;for(var zt=[],St=0;St0;)Ct.push(0);return Ct})(this.n),a=(function(Tt){for(var Ct=[];Tt-- >0;)Ct.push(0);return Ct})(this.m),f=!0,e=Math.min(this.m-1,this.n),u=Math.max(0,Math.min(this.n-2,this.m)),t=0;t=0;m--)if(this.s[m]!==0){for(var y=m+1;y=0;z--){if((function(Tt,Ct){return Tt&&Ct})(z0;){var J=void 0,It=void 0;for(J=n-2;J>=-1&&J!==-1;J--)if(Math.abs(r[J])<=ht+tt*(Math.abs(this.s[J])+Math.abs(this.s[J+1]))){r[J]=0;break}if(J===n-2)It=4;else{var Nt=void 0;for(Nt=n-1;Nt>=J&&Nt!==J;Nt--){var vt=(Nt!==n?Math.abs(r[Nt]):0)+(Nt!==J+1?Math.abs(r[Nt-1]):0);if(Math.abs(this.s[Nt])<=ht+tt*vt){this.s[Nt]=0;break}}Nt===J?It=3:Nt===n-1?It=1:(It=2,J=Nt)}switch(J++,It){case 1:{var it=r[n-2];r[n-2]=0;for(var ut=n-2;ut>=J;ut--){var Et=v.hypot(this.s[ut],it),wt=this.s[ut]/Et,Ot=it/Et;this.s[ut]=Et,ut!==J&&(it=-Ot*r[ut-1],r[ut-1]=wt*r[ut-1]);for(var mt=0;mt=this.s[J+1]);){var Lt=this.s[J];if(this.s[J]=this.s[J+1],this.s[J+1]=Lt,JMath.abs(i)?(r=i/h,r=Math.abs(h)*Math.sqrt(1+r*r)):i!=0?(r=h/i,r=Math.abs(i)*Math.sqrt(1+r*r)):r=0,r},A.exports=v}),(function(A,G,N){var v=(function(){function r(a,f){for(var e=0;e2&&arguments[2]!==void 0?arguments[2]:1,u=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,t=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;h(this,r),this.sequence1=a,this.sequence2=f,this.match_score=e,this.mismatch_penalty=u,this.gap_penalty=t,this.iMax=a.length+1,this.jMax=f.length+1,this.grid=new Array(this.iMax);for(var s=0;s=0;a--){var f=this.listeners[a];f.event===i&&f.callback===r&&this.listeners.splice(a,1)}},h.emit=function(i,r){for(var a=0;a{var G={45:((i,r,a)=>{var f={};f.layoutBase=a(551),f.CoSEConstants=a(806),f.CoSEEdge=a(767),f.CoSEGraph=a(880),f.CoSEGraphManager=a(578),f.CoSELayout=a(765),f.CoSENode=a(991),f.ConstraintHandler=a(902),i.exports=f}),806:((i,r,a)=>{var f=a(551).FDLayoutConstants;function e(){}for(var u in f)e[u]=f[u];e.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,e.DEFAULT_RADIAL_SEPARATION=f.DEFAULT_EDGE_LENGTH,e.DEFAULT_COMPONENT_SEPERATION=60,e.TILE=!0,e.TILING_PADDING_VERTICAL=10,e.TILING_PADDING_HORIZONTAL=10,e.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,e.ENFORCE_CONSTRAINTS=!0,e.APPLY_LAYOUT=!0,e.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,e.TREE_REDUCTION_ON_INCREMENTAL=!0,e.PURE_INCREMENTAL=e.DEFAULT_INCREMENTAL,i.exports=e}),767:((i,r,a)=>{var f=a(551).FDLayoutEdge;function e(t,s,o){f.call(this,t,s,o)}e.prototype=Object.create(f.prototype);for(var u in f)e[u]=f[u];i.exports=e}),880:((i,r,a)=>{var f=a(551).LGraph;function e(t,s,o){f.call(this,t,s,o)}e.prototype=Object.create(f.prototype);for(var u in f)e[u]=f[u];i.exports=e}),578:((i,r,a)=>{var f=a(551).LGraphManager;function e(t){f.call(this,t)}e.prototype=Object.create(f.prototype);for(var u in f)e[u]=f[u];i.exports=e}),765:((i,r,a)=>{var f=a(551).FDLayout,e=a(578),u=a(880),t=a(991),s=a(767),o=a(806),c=a(902),l=a(551).FDLayoutConstants,T=a(551).LayoutConstants,g=a(551).Point,d=a(551).PointD,C=a(551).DimensionD,S=a(551).Layout,w=a(551).Integer,P=a(551).IGeometry,B=a(551).LGraph,U=a(551).Transform,V=a(551).LinkedList;function M(){f.call(this),this.toBeTiled={},this.constraints={}}M.prototype=Object.create(f.prototype);for(var _ in f)M[_]=f[_];M.prototype.newGraphManager=function(){var n=new e(this);return this.graphManager=n,n},M.prototype.newGraph=function(n){return new u(null,this.graphManager,n)},M.prototype.newNode=function(n){return new t(this.graphManager,n)},M.prototype.newEdge=function(n){return new s(null,null,n)},M.prototype.initParameters=function(){f.prototype.initParameters.call(this,arguments),this.isSubLayout||(o.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=o.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=l.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=l.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=l.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},M.prototype.initSpringEmbedder=function(){f.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/l.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},M.prototype.layout=function(){var n=T.DEFAULT_CREATE_BENDS_AS_NEEDED;return n&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},M.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(o.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(I){return E.has(I)});this.graphManager.setAllNodesToApplyGravitation(p)}}else{var n=this.getFlatForest();if(n.length>0)this.positionNodesRadially(n);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(m){return E.has(m)});this.graphManager.setAllNodesToApplyGravitation(p),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(c.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),o.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},M.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%l.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var n=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(y){return n.has(y)});this.graphManager.setAllNodesToApplyGravitation(E),this.graphManager.updateBounds(),this.updateGrid(),o.PURE_INCREMENTAL?this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),o.PURE_INCREMENTAL?this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var p=!this.isTreeGrowing&&!this.isGrowthFinished,m=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(p,m),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},M.prototype.getPositionsData=function(){for(var n=this.graphManager.getAllNodes(),E={},p=0;p0&&this.updateDisplacements();for(var p=0;p0&&(m.fixedNodeWeight=I)}}if(this.constraints.relativePlacementConstraint){var O=new Map,R=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(D){n.fixedNodesOnHorizontal.add(D),n.fixedNodesOnVertical.add(D)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var W=this.constraints.alignmentConstraint.vertical,p=0;p=2*D.length/3;tt--)H=Math.floor(Math.random()*(tt+1)),k=D[tt],D[tt]=D[H],D[H]=k;return D},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(D){if(D.left){var H=O.has(D.left)?O.get(D.left):D.left,k=O.has(D.right)?O.get(D.right):D.right;n.nodesInRelativeHorizontal.includes(H)||(n.nodesInRelativeHorizontal.push(H),n.nodeToRelativeConstraintMapHorizontal.set(H,[]),n.dummyToNodeForVerticalAlignment.has(H)?n.nodeToTempPositionMapHorizontal.set(H,n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(H)[0]).getCenterX()):n.nodeToTempPositionMapHorizontal.set(H,n.idToNodeMap.get(H).getCenterX())),n.nodesInRelativeHorizontal.includes(k)||(n.nodesInRelativeHorizontal.push(k),n.nodeToRelativeConstraintMapHorizontal.set(k,[]),n.dummyToNodeForVerticalAlignment.has(k)?n.nodeToTempPositionMapHorizontal.set(k,n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(k)[0]).getCenterX()):n.nodeToTempPositionMapHorizontal.set(k,n.idToNodeMap.get(k).getCenterX())),n.nodeToRelativeConstraintMapHorizontal.get(H).push({right:k,gap:D.gap}),n.nodeToRelativeConstraintMapHorizontal.get(k).push({left:H,gap:D.gap})}else{var tt=R.has(D.top)?R.get(D.top):D.top,ht=R.has(D.bottom)?R.get(D.bottom):D.bottom;n.nodesInRelativeVertical.includes(tt)||(n.nodesInRelativeVertical.push(tt),n.nodeToRelativeConstraintMapVertical.set(tt,[]),n.dummyToNodeForHorizontalAlignment.has(tt)?n.nodeToTempPositionMapVertical.set(tt,n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(tt)[0]).getCenterY()):n.nodeToTempPositionMapVertical.set(tt,n.idToNodeMap.get(tt).getCenterY())),n.nodesInRelativeVertical.includes(ht)||(n.nodesInRelativeVertical.push(ht),n.nodeToRelativeConstraintMapVertical.set(ht,[]),n.dummyToNodeForHorizontalAlignment.has(ht)?n.nodeToTempPositionMapVertical.set(ht,n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(ht)[0]).getCenterY()):n.nodeToTempPositionMapVertical.set(ht,n.idToNodeMap.get(ht).getCenterY())),n.nodeToRelativeConstraintMapVertical.get(tt).push({bottom:ht,gap:D.gap}),n.nodeToRelativeConstraintMapVertical.get(ht).push({top:tt,gap:D.gap})}});else{var Q=new Map,z=new Map;this.constraints.relativePlacementConstraint.forEach(function(D){if(D.left){var H=O.has(D.left)?O.get(D.left):D.left,k=O.has(D.right)?O.get(D.right):D.right;Q.has(H)?Q.get(H).push(k):Q.set(H,[k]),Q.has(k)?Q.get(k).push(H):Q.set(k,[H])}else{var tt=R.has(D.top)?R.get(D.top):D.top,ht=R.has(D.bottom)?R.get(D.bottom):D.bottom;z.has(tt)?z.get(tt).push(ht):z.set(tt,[ht]),z.has(ht)?z.get(ht).push(tt):z.set(ht,[tt])}});var X=function(H,k){var tt=[],ht=[],J=new V,It=new Set,Nt=0;return H.forEach(function(vt,it){if(!It.has(it)){tt[Nt]=[],ht[Nt]=!1;var ut=it;for(J.push(ut),It.add(ut),tt[Nt].push(ut);J.length!=0;){ut=J.shift(),k.has(ut)&&(ht[Nt]=!0);var Et=H.get(ut);Et.forEach(function(wt){It.has(wt)||(J.push(wt),It.add(wt),tt[Nt].push(wt))})}Nt++}}),{components:tt,isFixed:ht}},rt=X(Q,n.fixedNodesOnHorizontal);this.componentsOnHorizontal=rt.components,this.fixedComponentsOnHorizontal=rt.isFixed;var $=X(z,n.fixedNodesOnVertical);this.componentsOnVertical=$.components,this.fixedComponentsOnVertical=$.isFixed}}},M.prototype.updateDisplacements=function(){var n=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function($){var D=n.idToNodeMap.get($.nodeId);D.displacementX=0,D.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var E=this.constraints.alignmentConstraint.vertical,p=0;p1){var R;for(R=0;Rm&&(m=Math.floor(O.y)),I=Math.floor(O.x+o.DEFAULT_COMPONENT_SEPERATION)}this.transform(new d(T.WORLD_CENTER_X-O.x/2,T.WORLD_CENTER_Y-O.y/2))},M.radialLayout=function(n,E,p){var m=Math.max(this.maxDiagonalInTree(n),o.DEFAULT_RADIAL_SEPARATION);M.branchRadialLayout(E,null,0,359,0,m);var y=B.calculateBounds(n),I=new U;I.setDeviceOrgX(y.getMinX()),I.setDeviceOrgY(y.getMinY()),I.setWorldOrgX(p.x),I.setWorldOrgY(p.y);for(var O=0;O1;){var k=H[0];H.splice(0,1);var tt=z.indexOf(k);tt>=0&&z.splice(tt,1),$--,X--}E!=null?D=(z.indexOf(H[0])+1)%$:D=0;for(var ht=Math.abs(m-p)/X,J=D;rt!=X;J=++J%$){var It=z[J].getOtherEnd(n);if(It!=E){var Nt=(p+rt*ht)%360,vt=(Nt+ht)%360;M.branchRadialLayout(It,n,Nt,vt,y+I,I),rt++}}},M.maxDiagonalInTree=function(n){for(var E=w.MIN_VALUE,p=0;pE&&(E=y)}return E},M.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},M.prototype.groupZeroDegreeMembers=function(){var n=this,E={};this.memberGroups={},this.idToDummyNode={};for(var p=[],m=this.graphManager.getAllNodes(),y=0;y"u"&&(E[R]=[]),E[R]=E[R].concat(I)}Object.keys(E).forEach(function(W){if(E[W].length>1){var x="DummyCompound_"+W;n.memberGroups[x]=E[W];var Q=E[W][0].getParent(),z=new t(n.graphManager);z.id=x,z.paddingLeft=Q.paddingLeft||0,z.paddingRight=Q.paddingRight||0,z.paddingBottom=Q.paddingBottom||0,z.paddingTop=Q.paddingTop||0,n.idToDummyNode[x]=z;var X=n.getGraphManager().add(n.newGraph(),z),rt=Q.getChild();rt.add(z);for(var $=0;$y?(m.rect.x-=(m.labelWidth-y)/2,m.setWidth(m.labelWidth),m.labelMarginLeft=(m.labelWidth-y)/2):m.labelPosHorizontal=="right"&&m.setWidth(y+m.labelWidth)),m.labelHeight&&(m.labelPosVertical=="top"?(m.rect.y-=m.labelHeight,m.setHeight(I+m.labelHeight),m.labelMarginTop=m.labelHeight):m.labelPosVertical=="center"&&m.labelHeight>I?(m.rect.y-=(m.labelHeight-I)/2,m.setHeight(m.labelHeight),m.labelMarginTop=(m.labelHeight-I)/2):m.labelPosVertical=="bottom"&&m.setHeight(I+m.labelHeight))}})},M.prototype.repopulateCompounds=function(){for(var n=this.compoundOrder.length-1;n>=0;n--){var E=this.compoundOrder[n],p=E.id,m=E.paddingLeft,y=E.paddingTop,I=E.labelMarginLeft,O=E.labelMarginTop;this.adjustLocations(this.tiledMemberPack[p],E.rect.x,E.rect.y,m,y,I,O)}},M.prototype.repopulateZeroDegreeMembers=function(){var n=this,E=this.tiledZeroDegreePack;Object.keys(E).forEach(function(p){var m=n.idToDummyNode[p],y=m.paddingLeft,I=m.paddingTop,O=m.labelMarginLeft,R=m.labelMarginTop;n.adjustLocations(E[p],m.rect.x,m.rect.y,y,I,O,R)})},M.prototype.getToBeTiled=function(n){var E=n.id;if(this.toBeTiled[E]!=null)return this.toBeTiled[E];var p=n.getChild();if(p==null)return this.toBeTiled[E]=!1,!1;for(var m=p.getNodes(),y=0;y0)return this.toBeTiled[E]=!1,!1;if(I.getChild()==null){this.toBeTiled[I.id]=!1;continue}if(!this.getToBeTiled(I))return this.toBeTiled[E]=!1,!1}return this.toBeTiled[E]=!0,!0},M.prototype.getNodeDegree=function(n){n.id;for(var E=n.getEdges(),p=0,m=0;mQ&&(Q=X.rect.height)}p+=Q+n.verticalPadding}},M.prototype.tileCompoundMembers=function(n,E){var p=this;this.tiledMemberPack=[],Object.keys(n).forEach(function(m){var y=E[m];if(p.tiledMemberPack[m]=p.tileNodes(n[m],y.paddingLeft+y.paddingRight),y.rect.width=p.tiledMemberPack[m].width,y.rect.height=p.tiledMemberPack[m].height,y.setCenter(p.tiledMemberPack[m].centerX,p.tiledMemberPack[m].centerY),y.labelMarginLeft=0,y.labelMarginTop=0,o.NODE_DIMENSIONS_INCLUDE_LABELS){var I=y.rect.width,O=y.rect.height;y.labelWidth&&(y.labelPosHorizontal=="left"?(y.rect.x-=y.labelWidth,y.setWidth(I+y.labelWidth),y.labelMarginLeft=y.labelWidth):y.labelPosHorizontal=="center"&&y.labelWidth>I?(y.rect.x-=(y.labelWidth-I)/2,y.setWidth(y.labelWidth),y.labelMarginLeft=(y.labelWidth-I)/2):y.labelPosHorizontal=="right"&&y.setWidth(I+y.labelWidth)),y.labelHeight&&(y.labelPosVertical=="top"?(y.rect.y-=y.labelHeight,y.setHeight(O+y.labelHeight),y.labelMarginTop=y.labelHeight):y.labelPosVertical=="center"&&y.labelHeight>O?(y.rect.y-=(y.labelHeight-O)/2,y.setHeight(y.labelHeight),y.labelMarginTop=(y.labelHeight-O)/2):y.labelPosVertical=="bottom"&&y.setHeight(O+y.labelHeight))}})},M.prototype.tileNodes=function(n,E){var p=this.tileNodesByFavoringDim(n,E,!0),m=this.tileNodesByFavoringDim(n,E,!1),y=this.getOrgRatio(p),I=this.getOrgRatio(m),O;return IR&&(R=$.getWidth())});var W=I/y,x=O/y,Q=Math.pow(p-m,2)+4*(W+m)*(x+p)*y,z=(m-p+Math.sqrt(Q))/(2*(W+m)),X;E?(X=Math.ceil(z),X==z&&X++):X=Math.floor(z);var rt=X*(W+m)-m;return R>rt&&(rt=R),rt+=m*2,rt},M.prototype.tileNodesByFavoringDim=function(n,E,p){var m=o.TILING_PADDING_VERTICAL,y=o.TILING_PADDING_HORIZONTAL,I=o.TILING_COMPARE_BY,O={rows:[],rowWidth:[],rowHeight:[],width:0,height:E,verticalPadding:m,horizontalPadding:y,centerX:0,centerY:0};I&&(O.idealRowWidth=this.calcIdealRowWidth(n,p));var R=function(D){return D.rect.width*D.rect.height},W=function(D,H){return R(H)-R(D)};n.sort(function($,D){var H=W;return O.idealRowWidth?(H=I,H($.id,D.id)):H($,D)});for(var x=0,Q=0,z=0;z0&&(O+=n.horizontalPadding),n.rowWidth[p]=O,n.width0&&(R+=n.verticalPadding);var W=0;R>n.rowHeight[p]&&(W=n.rowHeight[p],n.rowHeight[p]=R,W=n.rowHeight[p]-W),n.height+=W,n.rows[p].push(E)},M.prototype.getShortestRowIndex=function(n){for(var E=-1,p=Number.MAX_VALUE,m=0;mp&&(E=m,p=n.rowWidth[m]);return E},M.prototype.canAddHorizontal=function(n,E,p){if(n.idealRowWidth){var m=n.rows.length-1,y=n.rowWidth[m];return y+E+n.horizontalPadding<=n.idealRowWidth}var I=this.getShortestRowIndex(n);if(I<0)return!0;var O=n.rowWidth[I];if(O+n.horizontalPadding+E<=n.width)return!0;var R=0;n.rowHeight[I]0&&(R=p+n.verticalPadding-n.rowHeight[I]);var W;n.width-O>=E+n.horizontalPadding?W=(n.height+R)/(O+E+n.horizontalPadding):W=(n.height+R)/n.width,R=p+n.verticalPadding;var x;return n.widthI&&E!=p){m.splice(-1,1),n.rows[p].push(y),n.rowWidth[E]=n.rowWidth[E]-I,n.rowWidth[p]=n.rowWidth[p]+I,n.width=n.rowWidth[instance.getLongestRowIndex(n)];for(var O=Number.MIN_VALUE,R=0;RO&&(O=m[R].height);E>0&&(O+=n.verticalPadding);var W=n.rowHeight[E]+n.rowHeight[p];n.rowHeight[E]=O,n.rowHeight[p]0)for(var rt=y;rt<=I;rt++)X[0]+=this.grid[rt][O-1].length+this.grid[rt][O].length-1;if(I0)for(var rt=O;rt<=R;rt++)X[3]+=this.grid[y-1][rt].length+this.grid[y][rt].length-1;for(var $=w.MAX_VALUE,D,H,k=0;k{var f=a(551).FDLayoutNode,e=a(551).IMath;function u(s,o,c,l){f.call(this,s,o,c,l)}u.prototype=Object.create(f.prototype);for(var t in f)u[t]=f[t];u.prototype.calculateDisplacement=function(){var s=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=s.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=s.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=s.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=s.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementX=s.coolingFactor*s.maxNodeDisplacement*e.sign(this.displacementX)),Math.abs(this.displacementY)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementY=s.coolingFactor*s.maxNodeDisplacement*e.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},u.prototype.propogateDisplacementToChildren=function(s,o){for(var c=this.getChild().getNodes(),l,T=0;T{function f(c){if(Array.isArray(c)){for(var l=0,T=Array(c.length);l0){var Lt=0;ot.forEach(function(st){Z=="horizontal"?(et.set(st,g.has(st)?d[g.get(st)]:q.get(st)),Lt+=et.get(st)):(et.set(st,g.has(st)?C[g.get(st)]:q.get(st)),Lt+=et.get(st))}),Lt=Lt/ot.length,lt.forEach(function(st){K.has(st)||et.set(st,Lt)})}else{var ft=0;lt.forEach(function(st){Z=="horizontal"?ft+=g.has(st)?d[g.get(st)]:q.get(st):ft+=g.has(st)?C[g.get(st)]:q.get(st)}),ft=ft/lt.length,lt.forEach(function(st){et.set(st,ft)})}});for(var At=function(){var ot=dt.shift(),Lt=Y.get(ot);Lt.forEach(function(ft){if(et.get(ft.id)st&&(st=kt),KtXt&&(Xt=Kt)}}catch(ee){Ct=!0,Bt=ee}finally{try{!Tt&&bt.return&&bt.return()}finally{if(Ct)throw Bt}}var fe=(Lt+st)/2-(ft+Xt)/2,Qt=!0,jt=!1,_t=void 0;try{for(var Jt=lt[Symbol.iterator](),ne;!(Qt=(ne=Jt.next()).done);Qt=!0){var te=ne.value;et.set(te,et.get(te)+fe)}}catch(ee){jt=!0,_t=ee}finally{try{!Qt&&Jt.return&&Jt.return()}finally{if(jt)throw _t}}})}return et},_=function(Y){var Z=0,K=0,q=0,at=0;if(Y.forEach(function(j){j.left?d[g.get(j.left)]-d[g.get(j.right)]>=0?Z++:K++:C[g.get(j.top)]-C[g.get(j.bottom)]>=0?q++:at++}),Z>K&&q>at)for(var ct=0;ctK)for(var nt=0;ntat)for(var et=0;et1)l.fixedNodeConstraint.forEach(function(F,Y){m[Y]=[F.position.x,F.position.y],y[Y]=[d[g.get(F.nodeId)],C[g.get(F.nodeId)]]}),I=!0;else if(l.alignmentConstraint)(function(){var F=0;if(l.alignmentConstraint.vertical){for(var Y=l.alignmentConstraint.vertical,Z=function(et){var j=new Set;Y[et].forEach(function(pt){j.add(pt)});var dt=new Set([].concat(f(j)).filter(function(pt){return R.has(pt)})),At=void 0;dt.size>0?At=d[g.get(dt.values().next().value)]:At=V(j).x,Y[et].forEach(function(pt){m[F]=[At,C[g.get(pt)]],y[F]=[d[g.get(pt)],C[g.get(pt)]],F++})},K=0;K0?At=d[g.get(dt.values().next().value)]:At=V(j).y,q[et].forEach(function(pt){m[F]=[d[g.get(pt)],At],y[F]=[d[g.get(pt)],C[g.get(pt)]],F++})},ct=0;ctz&&(z=Q[rt].length,X=rt);if(z0){var mt={x:0,y:0};l.fixedNodeConstraint.forEach(function(F,Y){var Z={x:d[g.get(F.nodeId)],y:C[g.get(F.nodeId)]},K=F.position,q=U(K,Z);mt.x+=q.x,mt.y+=q.y}),mt.x/=l.fixedNodeConstraint.length,mt.y/=l.fixedNodeConstraint.length,d.forEach(function(F,Y){d[Y]+=mt.x}),C.forEach(function(F,Y){C[Y]+=mt.y}),l.fixedNodeConstraint.forEach(function(F){d[g.get(F.nodeId)]=F.position.x,C[g.get(F.nodeId)]=F.position.y})}if(l.alignmentConstraint){if(l.alignmentConstraint.vertical)for(var Dt=l.alignmentConstraint.vertical,Rt=function(Y){var Z=new Set;Dt[Y].forEach(function(at){Z.add(at)});var K=new Set([].concat(f(Z)).filter(function(at){return R.has(at)})),q=void 0;K.size>0?q=d[g.get(K.values().next().value)]:q=V(Z).x,Z.forEach(function(at){R.has(at)||(d[g.get(at)]=q)})},Ht=0;Ht0?q=C[g.get(K.values().next().value)]:q=V(Z).y,Z.forEach(function(at){R.has(at)||(C[g.get(at)]=q)})},Ft=0;Ft{i.exports=A})},N={};function v(i){var r=N[i];if(r!==void 0)return r.exports;var a=N[i]={exports:{}};return G[i](a,a.exports,v),a.exports}var h=v(45);return h})()})})(he)),he.exports}var pr=se.exports,De;function yr(){return De||(De=1,(function(L,b){(function(G,N){L.exports=N(vr())})(pr,function(A){return(()=>{var G={658:(i=>{i.exports=Object.assign!=null?Object.assign.bind(Object):function(r){for(var a=arguments.length,f=Array(a>1?a-1:0),e=1;e{var f=(function(){function t(s,o){var c=[],l=!0,T=!1,g=void 0;try{for(var d=s[Symbol.iterator](),C;!(l=(C=d.next()).done)&&(c.push(C.value),!(o&&c.length===o));l=!0);}catch(S){T=!0,g=S}finally{try{!l&&d.return&&d.return()}finally{if(T)throw g}}return c}return function(s,o){if(Array.isArray(s))return s;if(Symbol.iterator in Object(s))return t(s,o);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),e=a(140).layoutBase.LinkedList,u={};u.getTopMostNodes=function(t){for(var s={},o=0;o0&&I.merge(x)});for(var O=0;O1){C=g[0],S=C.connectedEdges().length,g.forEach(function(y){y.connectedEdges().length0&&c.set("dummy"+(c.size+1),B),U},u.relocateComponent=function(t,s,o){if(!o.fixedNodeConstraint){var c=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,T=Number.POSITIVE_INFINITY,g=Number.NEGATIVE_INFINITY;if(o.quality=="draft"){var d=!0,C=!1,S=void 0;try{for(var w=s.nodeIndexes[Symbol.iterator](),P;!(d=(P=w.next()).done);d=!0){var B=P.value,U=f(B,2),V=U[0],M=U[1],_=o.cy.getElementById(V);if(_){var n=_.boundingBox(),E=s.xCoords[M]-n.w/2,p=s.xCoords[M]+n.w/2,m=s.yCoords[M]-n.h/2,y=s.yCoords[M]+n.h/2;El&&(l=p),mg&&(g=y)}}}catch(x){C=!0,S=x}finally{try{!d&&w.return&&w.return()}finally{if(C)throw S}}var I=t.x-(l+c)/2,O=t.y-(g+T)/2;s.xCoords=s.xCoords.map(function(x){return x+I}),s.yCoords=s.yCoords.map(function(x){return x+O})}else{Object.keys(s).forEach(function(x){var Q=s[x],z=Q.getRect().x,X=Q.getRect().x+Q.getRect().width,rt=Q.getRect().y,$=Q.getRect().y+Q.getRect().height;zl&&(l=X),rtg&&(g=$)});var R=t.x-(l+c)/2,W=t.y-(g+T)/2;Object.keys(s).forEach(function(x){var Q=s[x];Q.setCenter(Q.getCenterX()+R,Q.getCenterY()+W)})}}},u.calcBoundingBox=function(t,s,o,c){for(var l=Number.MAX_SAFE_INTEGER,T=Number.MIN_SAFE_INTEGER,g=Number.MAX_SAFE_INTEGER,d=Number.MIN_SAFE_INTEGER,C=void 0,S=void 0,w=void 0,P=void 0,B=t.descendants().not(":parent"),U=B.length,V=0;VC&&(l=C),Tw&&(g=w),d{var f=a(548),e=a(140).CoSELayout,u=a(140).CoSENode,t=a(140).layoutBase.PointD,s=a(140).layoutBase.DimensionD,o=a(140).layoutBase.LayoutConstants,c=a(140).layoutBase.FDLayoutConstants,l=a(140).CoSEConstants,T=function(d,C){var S=d.cy,w=d.eles,P=w.nodes(),B=w.edges(),U=void 0,V=void 0,M=void 0,_={};d.randomize&&(U=C.nodeIndexes,V=C.xCoords,M=C.yCoords);var n=function(x){return typeof x=="function"},E=function(x,Q){return n(x)?x(Q):x},p=f.calcParentsWithoutChildren(S,w),m=function W(x,Q,z,X){for(var rt=Q.length,$=0;$0){var J=void 0;J=z.getGraphManager().add(z.newGraph(),k),W(J,H,z,X)}}},y=function(x,Q,z){for(var X=0,rt=0,$=0;$0?l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=X/rt:n(d.idealEdgeLength)?l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=50:l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=d.idealEdgeLength,l.MIN_REPULSION_DIST=c.MIN_REPULSION_DIST=c.DEFAULT_EDGE_LENGTH/10,l.DEFAULT_RADIAL_SEPARATION=c.DEFAULT_EDGE_LENGTH)},I=function(x,Q){Q.fixedNodeConstraint&&(x.constraints.fixedNodeConstraint=Q.fixedNodeConstraint),Q.alignmentConstraint&&(x.constraints.alignmentConstraint=Q.alignmentConstraint),Q.relativePlacementConstraint&&(x.constraints.relativePlacementConstraint=Q.relativePlacementConstraint)};d.nestingFactor!=null&&(l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=c.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=d.nestingFactor),d.gravity!=null&&(l.DEFAULT_GRAVITY_STRENGTH=c.DEFAULT_GRAVITY_STRENGTH=d.gravity),d.numIter!=null&&(l.MAX_ITERATIONS=c.MAX_ITERATIONS=d.numIter),d.gravityRange!=null&&(l.DEFAULT_GRAVITY_RANGE_FACTOR=c.DEFAULT_GRAVITY_RANGE_FACTOR=d.gravityRange),d.gravityCompound!=null&&(l.DEFAULT_COMPOUND_GRAVITY_STRENGTH=c.DEFAULT_COMPOUND_GRAVITY_STRENGTH=d.gravityCompound),d.gravityRangeCompound!=null&&(l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=d.gravityRangeCompound),d.initialEnergyOnIncremental!=null&&(l.DEFAULT_COOLING_FACTOR_INCREMENTAL=c.DEFAULT_COOLING_FACTOR_INCREMENTAL=d.initialEnergyOnIncremental),d.tilingCompareBy!=null&&(l.TILING_COMPARE_BY=d.tilingCompareBy),d.quality=="proof"?o.QUALITY=2:o.QUALITY=0,l.NODE_DIMENSIONS_INCLUDE_LABELS=c.NODE_DIMENSIONS_INCLUDE_LABELS=o.NODE_DIMENSIONS_INCLUDE_LABELS=d.nodeDimensionsIncludeLabels,l.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!d.randomize,l.ANIMATE=c.ANIMATE=o.ANIMATE=d.animate,l.TILE=d.tile,l.TILING_PADDING_VERTICAL=typeof d.tilingPaddingVertical=="function"?d.tilingPaddingVertical.call():d.tilingPaddingVertical,l.TILING_PADDING_HORIZONTAL=typeof d.tilingPaddingHorizontal=="function"?d.tilingPaddingHorizontal.call():d.tilingPaddingHorizontal,l.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!0,l.PURE_INCREMENTAL=!d.randomize,o.DEFAULT_UNIFORM_LEAF_NODE_SIZES=d.uniformNodeDimensions,d.step=="transformed"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,l.ENFORCE_CONSTRAINTS=!1,l.APPLY_LAYOUT=!1),d.step=="enforced"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!0,l.APPLY_LAYOUT=!1),d.step=="cose"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!1,l.APPLY_LAYOUT=!0),d.step=="all"&&(d.randomize?l.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!0,l.APPLY_LAYOUT=!0),d.fixedNodeConstraint||d.alignmentConstraint||d.relativePlacementConstraint?l.TREE_REDUCTION_ON_INCREMENTAL=!1:l.TREE_REDUCTION_ON_INCREMENTAL=!0;var O=new e,R=O.newGraphManager();return m(R.addRoot(),f.getTopMostNodes(P),O,d),y(O,R,B),I(O,d),O.runLayout(),_};i.exports={coseLayout:T}}),212:((i,r,a)=>{var f=(function(){function d(C,S){for(var w=0;w0)if(p){var I=t.getTopMostNodes(w.eles.nodes());if(M=t.connectComponents(P,w.eles,I),M.forEach(function(vt){var it=vt.boundingBox();_.push({x:it.x1+it.w/2,y:it.y1+it.h/2})}),w.randomize&&M.forEach(function(vt){w.eles=vt,U.push(o(w))}),w.quality=="default"||w.quality=="proof"){var O=P.collection();if(w.tile){var R=new Map,W=[],x=[],Q=0,z={nodeIndexes:R,xCoords:W,yCoords:x},X=[];if(M.forEach(function(vt,it){vt.edges().length==0&&(vt.nodes().forEach(function(ut,Et){O.merge(vt.nodes()[Et]),ut.isParent()||(z.nodeIndexes.set(vt.nodes()[Et].id(),Q++),z.xCoords.push(vt.nodes()[0].position().x),z.yCoords.push(vt.nodes()[0].position().y))}),X.push(it))}),O.length>1){var rt=O.boundingBox();_.push({x:rt.x1+rt.w/2,y:rt.y1+rt.h/2}),M.push(O),U.push(z);for(var $=X.length-1;$>=0;$--)M.splice(X[$],1),U.splice(X[$],1),_.splice(X[$],1)}}M.forEach(function(vt,it){w.eles=vt,V.push(l(w,U[it])),t.relocateComponent(_[it],V[it],w)})}else M.forEach(function(vt,it){t.relocateComponent(_[it],U[it],w)});var D=new Set;if(M.length>1){var H=[],k=B.filter(function(vt){return vt.css("display")=="none"});M.forEach(function(vt,it){var ut=void 0;if(w.quality=="draft"&&(ut=U[it].nodeIndexes),vt.nodes().not(k).length>0){var Et={};Et.edges=[],Et.nodes=[];var wt=void 0;vt.nodes().not(k).forEach(function(Ot){if(w.quality=="draft")if(!Ot.isParent())wt=ut.get(Ot.id()),Et.nodes.push({x:U[it].xCoords[wt]-Ot.boundingbox().w/2,y:U[it].yCoords[wt]-Ot.boundingbox().h/2,width:Ot.boundingbox().w,height:Ot.boundingbox().h});else{var mt=t.calcBoundingBox(Ot,U[it].xCoords,U[it].yCoords,ut);Et.nodes.push({x:mt.topLeftX,y:mt.topLeftY,width:mt.width,height:mt.height})}else V[it][Ot.id()]&&Et.nodes.push({x:V[it][Ot.id()].getLeft(),y:V[it][Ot.id()].getTop(),width:V[it][Ot.id()].getWidth(),height:V[it][Ot.id()].getHeight()})}),vt.edges().forEach(function(Ot){var mt=Ot.source(),Dt=Ot.target();if(mt.css("display")!="none"&&Dt.css("display")!="none")if(w.quality=="draft"){var Rt=ut.get(mt.id()),Ht=ut.get(Dt.id()),Ut=[],Pt=[];if(mt.isParent()){var Ft=t.calcBoundingBox(mt,U[it].xCoords,U[it].yCoords,ut);Ut.push(Ft.topLeftX+Ft.width/2),Ut.push(Ft.topLeftY+Ft.height/2)}else Ut.push(U[it].xCoords[Rt]),Ut.push(U[it].yCoords[Rt]);if(Dt.isParent()){var Yt=t.calcBoundingBox(Dt,U[it].xCoords,U[it].yCoords,ut);Pt.push(Yt.topLeftX+Yt.width/2),Pt.push(Yt.topLeftY+Yt.height/2)}else Pt.push(U[it].xCoords[Ht]),Pt.push(U[it].yCoords[Ht]);Et.edges.push({startX:Ut[0],startY:Ut[1],endX:Pt[0],endY:Pt[1]})}else V[it][mt.id()]&&V[it][Dt.id()]&&Et.edges.push({startX:V[it][mt.id()].getCenterX(),startY:V[it][mt.id()].getCenterY(),endX:V[it][Dt.id()].getCenterX(),endY:V[it][Dt.id()].getCenterY()})}),Et.nodes.length>0&&(H.push(Et),D.add(it))}});var tt=E.packComponents(H,w.randomize).shifts;if(w.quality=="draft")U.forEach(function(vt,it){var ut=vt.xCoords.map(function(wt){return wt+tt[it].dx}),Et=vt.yCoords.map(function(wt){return wt+tt[it].dy});vt.xCoords=ut,vt.yCoords=Et});else{var ht=0;D.forEach(function(vt){Object.keys(V[vt]).forEach(function(it){var ut=V[vt][it];ut.setCenter(ut.getCenterX()+tt[ht].dx,ut.getCenterY()+tt[ht].dy)}),ht++})}}}else{var m=w.eles.boundingBox();if(_.push({x:m.x1+m.w/2,y:m.y1+m.h/2}),w.randomize){var y=o(w);U.push(y)}w.quality=="default"||w.quality=="proof"?(V.push(l(w,U[0])),t.relocateComponent(_[0],V[0],w)):t.relocateComponent(_[0],U[0],w)}var J=function(it,ut){if(w.quality=="default"||w.quality=="proof"){typeof it=="number"&&(it=ut);var Et=void 0,wt=void 0,Ot=it.data("id");return V.forEach(function(Dt){Ot in Dt&&(Et={x:Dt[Ot].getRect().getCenterX(),y:Dt[Ot].getRect().getCenterY()},wt=Dt[Ot])}),w.nodeDimensionsIncludeLabels&&(wt.labelWidth&&(wt.labelPosHorizontal=="left"?Et.x+=wt.labelWidth/2:wt.labelPosHorizontal=="right"&&(Et.x-=wt.labelWidth/2)),wt.labelHeight&&(wt.labelPosVertical=="top"?Et.y+=wt.labelHeight/2:wt.labelPosVertical=="bottom"&&(Et.y-=wt.labelHeight/2))),Et==null&&(Et={x:it.position("x"),y:it.position("y")}),{x:Et.x,y:Et.y}}else{var mt=void 0;return U.forEach(function(Dt){var Rt=Dt.nodeIndexes.get(it.id());Rt!=null&&(mt={x:Dt.xCoords[Rt],y:Dt.yCoords[Rt]})}),mt==null&&(mt={x:it.position("x"),y:it.position("y")}),{x:mt.x,y:mt.y}}};if(w.quality=="default"||w.quality=="proof"||w.randomize){var It=t.calcParentsWithoutChildren(P,B),Nt=B.filter(function(vt){return vt.css("display")=="none"});w.eles=B.not(Nt),B.nodes().not(":parent").not(Nt).layoutPositions(S,w,J),It.length>0&&It.forEach(function(vt){vt.position(J(vt))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),d})();i.exports=g}),657:((i,r,a)=>{var f=a(548),e=a(140).layoutBase.Matrix,u=a(140).layoutBase.SVD,t=function(o){var c=o.cy,l=o.eles,T=l.nodes(),g=l.nodes(":parent"),d=new Map,C=new Map,S=new Map,w=[],P=[],B=[],U=[],V=[],M=[],_=[],n=[],E=void 0,p=1e8,m=1e-9,y=o.piTol,I=o.samplingType,O=o.nodeSeparation,R=void 0,W=function(){for(var Y=0,Z=0,K=!1;Z=at;){nt=q[at++];for(var xt=w[nt],lt=0;ltdt&&(dt=V[Lt],At=Lt)}return At},Q=function(Y){var Z=void 0;if(Y){Z=Math.floor(Math.random()*E);for(var q=0;q=1)break;j=et}for(var pt=0;pt=1)break;j=et}for(var lt=0;lt0&&(Z.isParent()?w[Y].push(S.get(Z.id())):w[Y].push(Z.id()))})});var Nt=function(Y){var Z=C.get(Y),K=void 0;d.get(Y).forEach(function(q){c.getElementById(q).isParent()?K=S.get(q):K=q,w[Z].push(K),w[C.get(K)].push(Y)})},vt=!0,it=!1,ut=void 0;try{for(var Et=d.keys()[Symbol.iterator](),wt;!(vt=(wt=Et.next()).done);vt=!0){var Ot=wt.value;Nt(Ot)}}catch(F){it=!0,ut=F}finally{try{!vt&&Et.return&&Et.return()}finally{if(it)throw ut}}E=C.size;var mt=void 0;if(E>2){R=E{var f=a(212),e=function(t){t&&t("layout","fcose",f)};typeof cytoscape<"u"&&e(cytoscape),i.exports=e}),140:(i=>{i.exports=A})},N={};function v(i){var r=N[i];if(r!==void 0)return r.exports;var a=N[i]={exports:{}};return G[i](a,a.exports,v),a.exports}var h=v(579);return h})()})})(se)),se.exports}var mr=yr();const Er=cr(mr);var xe={L:"left",R:"right",T:"top",B:"bottom"},Ie={L:gt(L=>`${L},${L/2} 0,${L} 0,0`,"L"),R:gt(L=>`0,${L/2} ${L},0 ${L},${L}`,"R"),T:gt(L=>`0,0 ${L},0 ${L/2},${L}`,"T"),B:gt(L=>`${L/2},0 ${L},${L} 0,${L}`,"B")},oe={L:gt((L,b)=>L-b+2,"L"),R:gt((L,b)=>L-2,"R"),T:gt((L,b)=>L-b+2,"T"),B:gt((L,b)=>L-2,"B")},Tr=gt(function(L){return Wt(L)?L==="L"?"R":"L":L==="T"?"B":"T"},"getOppositeArchitectureDirection"),Re=gt(function(L){const b=L;return b==="L"||b==="R"||b==="T"||b==="B"},"isArchitectureDirection"),Wt=gt(function(L){const b=L;return b==="L"||b==="R"},"isArchitectureDirectionX"),qt=gt(function(L){const b=L;return b==="T"||b==="B"},"isArchitectureDirectionY"),Te=gt(function(L,b){const A=Wt(L)&&qt(b),G=qt(L)&&Wt(b);return A||G},"isArchitectureDirectionXY"),Nr=gt(function(L){const b=L[0],A=L[1],G=Wt(b)&&qt(A),N=qt(b)&&Wt(A);return G||N},"isArchitecturePairXY"),Lr=gt(function(L){return L!=="LL"&&L!=="RR"&&L!=="TT"&&L!=="BB"},"isValidArchitectureDirectionPair"),pe=gt(function(L,b){const A=`${L}${b}`;return Lr(A)?A:void 0},"getArchitectureDirectionPair"),Cr=gt(function([L,b],A){const G=A[0],N=A[1];return Wt(G)?qt(N)?[L+(G==="L"?-1:1),b+(N==="T"?1:-1)]:[L+(G==="L"?-1:1),b]:Wt(N)?[L+(N==="L"?1:-1),b+(G==="T"?1:-1)]:[L,b+(G==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),wr=gt(function(L){return L==="LT"||L==="TL"?[1,1]:L==="BL"||L==="LB"?[1,-1]:L==="BR"||L==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),Ar=gt(function(L,b){return Te(L,b)?"bend":Wt(L)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),Mr=gt(function(L){return L.type==="service"},"isArchitectureService"),Or=gt(function(L){return L.type==="junction"},"isArchitectureJunction"),be=gt(L=>L.data(),"edgeData"),ie=gt(L=>L.data(),"nodeData"),Dr=ar.architecture,Pe=class{constructor(){this.nodes={},this.groups={},this.edges=[],this.layoutHints=[],this.registeredIds={},this.elements={},this.diagramId="",this.setAccTitle=Qe,this.getAccTitle=Je,this.setDiagramTitle=Ke,this.getDiagramTitle=je,this.getAccDescription=_e,this.setAccDescription=tr,this.clear()}static{gt(this,"ArchitectureDB")}setDiagramId(L){this.diagramId=L}getDiagramId(){return this.diagramId}clear(){this.nodes={},this.groups={},this.edges=[],this.layoutHints=[],this.registeredIds={},this.dataStructures=void 0,this.elements={},this.diagramId="",er()}addService({id:L,icon:b,in:A,title:G,iconText:N}){if(this.registeredIds[L]!==void 0)throw new Error(`The service id [${L}] is already in use by another ${this.registeredIds[L]}`);if(A!==void 0){if(L===A)throw new Error(`The service [${L}] cannot be placed within itself`);if(this.registeredIds[A]===void 0)throw new Error(`The service [${L}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds[A]==="node")throw new Error(`The service [${L}]'s parent is not a group`)}this.registeredIds[L]="node",this.nodes[L]={id:L,type:"service",icon:b,iconText:N,title:G,edges:[],in:A}}getServices(){return Object.values(this.nodes).filter(Mr)}addJunction({id:L,in:b}){if(this.registeredIds[L]!==void 0)throw new Error(`The junction id [${L}] is already in use by another ${this.registeredIds[L]}`);if(b!==void 0){if(L===b)throw new Error(`The junction [${L}] cannot be placed within itself`);if(this.registeredIds[b]===void 0)throw new Error(`The junction [${L}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds[b]==="node")throw new Error(`The junction [${L}]'s parent is not a group`)}this.registeredIds[L]="node",this.nodes[L]={id:L,type:"junction",edges:[],in:b}}getJunctions(){return Object.values(this.nodes).filter(Or)}getNodes(){return Object.values(this.nodes)}getNode(L){return this.nodes[L]??null}addGroup({id:L,icon:b,in:A,title:G}){if(this.registeredIds?.[L]!==void 0)throw new Error(`The group id [${L}] is already in use by another ${this.registeredIds[L]}`);if(A!==void 0){if(L===A)throw new Error(`The group [${L}] cannot be placed within itself`);if(this.registeredIds?.[A]===void 0)throw new Error(`The group [${L}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds?.[A]==="node")throw new Error(`The group [${L}]'s parent is not a group`)}this.registeredIds[L]="group",this.groups[L]={id:L,icon:b,title:G,in:A}}getGroups(){return Object.values(this.groups)}addEdge({lhsId:L,rhsId:b,lhsDir:A,rhsDir:G,lhsInto:N,rhsInto:v,lhsGroup:h,rhsGroup:i,title:r}){if(!Re(A))throw new Error(`Invalid direction given for left hand side of edge ${L}--${b}. Expected (L,R,T,B) got ${String(A)}`);if(!Re(G))throw new Error(`Invalid direction given for right hand side of edge ${L}--${b}. Expected (L,R,T,B) got ${String(G)}`);if(this.nodes[L]===void 0&&this.groups[L]===void 0)throw new Error(`The left-hand id [${L}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(this.nodes[b]===void 0&&this.groups[b]===void 0)throw new Error(`The right-hand id [${b}] does not yet exist. Please create the service/group before declaring an edge to it.`);const a=this.nodes[L].in,f=this.nodes[b].in;if(h&&a&&f&&a==f)throw new Error(`The left-hand id [${L}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(i&&a&&f&&a==f)throw new Error(`The right-hand id [${b}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const e={lhsId:L,lhsDir:A,lhsInto:N,lhsGroup:h,rhsId:b,rhsDir:G,rhsInto:v,rhsGroup:i,title:r};this.edges.push(e),this.nodes[L]&&this.nodes[b]&&(this.nodes[L].edges.push(this.edges[this.edges.length-1]),this.nodes[b].edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}addLayoutHint(L){if(L.members.length<2)throw new Error(`An align directive requires at least two members; got ${L.members.length}`);const b=new Set;L.members.forEach(A=>{if(this.registeredIds[A]!=="node")throw new Error(`align ${L.direction} references [${A}], which is not a service or junction`);if(b.has(A))throw new Error(`align ${L.direction} lists [${A}] more than once`);b.add(A)}),this.layoutHints.push(L)}getLayoutHints(){return this.layoutHints}getDataStructures(){if(this.dataStructures===void 0){const L={},b=Object.entries(this.nodes).reduce((i,[r,a])=>(i[r]=a.edges.reduce((f,e)=>{const u=this.getNode(e.lhsId)?.in,t=this.getNode(e.rhsId)?.in;if(u&&t&&u!==t){const s=Ar(e.lhsDir,e.rhsDir);s!=="bend"&&(L[u]??={},L[u][t]=s,L[t]??={},L[t][u]=s)}if(e.lhsId===r){const s=pe(e.lhsDir,e.rhsDir);s&&(f[s]=e.rhsId)}else{const s=pe(e.rhsDir,e.lhsDir);s&&(f[s]=e.lhsId)}return f},{}),i),{}),A=Object.keys(b)[0],G={[A]:1},N=Object.keys(b).reduce((i,r)=>r===A?i:{...i,[r]:1},{}),v=gt(i=>{const r={[i]:[0,0]},a=[i];for(;a.length>0;){const f=a.shift();if(f){G[f]=1,delete N[f];const e=b[f],[u,t]=r[f];Object.entries(e).forEach(([s,o])=>{G[o]||(r[o]=Cr([u,t],s),a.push(o))})}}return r},"BFS"),h=[v(A)];for(;Object.keys(N).length>0;)h.push(v(Object.keys(N)[0]));this.dataStructures={adjList:b,spatialMaps:h,groupAlignments:L}}return this.dataStructures}setElementForId(L,b){this.elements[L]=b}getElementById(L){return this.elements[L]}getConfig(){return rr({...Dr,...ir().architecture})}getConfigField(L){return this.getConfig()[L]}},xr=gt((L,b)=>{ke(L,b),L.groups.map(A=>b.addGroup(A)),L.services.map(A=>b.addService({...A,type:"service"})),L.junctions.map(A=>b.addJunction({...A,type:"junction"})),L.edges.map(A=>b.addEdge(A)),L.alignments?.map(A=>b.addLayoutHint({direction:A.direction,members:[...A.members]}))},"populateDb"),Ge={parser:{yy:void 0},parse:gt(async L=>{const b=await fr("architecture",L);Se.debug(b);const A=Ge.parser?.yy;if(!(A instanceof Pe))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");xr(b,A)},"parse")},Ir=gt(L=>` +import{p as ke}from"./chunk-JWPE2WC7-CI-VQAzP.js";import{_ as gt,D as Ze,ad as qe,l as Se,b as Qe,a as Je,n as Ke,o as je,g as _e,s as tr,p as er,A as rr,y as ir,B as ar,c as me,a$ as Ee,ai as ve,i as nr,d as or,q as sr,aj as hr,b7 as lr}from"./mermaid.core-mH2pk-lc.js";import{p as fr}from"./cynefin-VYW2F7L2-BD8Xugtm.js";import{c as Fe}from"./cytoscape.esm-OyMbaexL.js";import{g as cr}from"./_commonjsHelpers-CqkleIqs.js";import"./index-BIElaaEN.js";var se={exports:{}},he={exports:{}},le={exports:{}},gr=le.exports,Me;function ur(){return Me||(Me=1,(function(L,b){(function(G,N){L.exports=N()})(gr,function(){return(function(A){var G={};function N(v){if(G[v])return G[v].exports;var h=G[v]={i:v,l:!1,exports:{}};return A[v].call(h.exports,h,h.exports,N),h.l=!0,h.exports}return N.m=A,N.c=G,N.i=function(v){return v},N.d=function(v,h,i){N.o(v,h)||Object.defineProperty(v,h,{configurable:!1,enumerable:!0,get:i})},N.n=function(v){var h=v&&v.__esModule?function(){return v.default}:function(){return v};return N.d(h,"a",h),h},N.o=function(v,h){return Object.prototype.hasOwnProperty.call(v,h)},N.p="",N(N.s=28)})([(function(A,G,N){function v(){}v.QUALITY=1,v.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,v.DEFAULT_INCREMENTAL=!1,v.DEFAULT_ANIMATION_ON_LAYOUT=!0,v.DEFAULT_ANIMATION_DURING_LAYOUT=!1,v.DEFAULT_ANIMATION_PERIOD=50,v.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,v.DEFAULT_GRAPH_MARGIN=15,v.NODE_DIMENSIONS_INCLUDE_LABELS=!1,v.SIMPLE_NODE_SIZE=40,v.SIMPLE_NODE_HALF_SIZE=v.SIMPLE_NODE_SIZE/2,v.EMPTY_COMPOUND_NODE_SIZE=40,v.MIN_EDGE_LENGTH=1,v.WORLD_BOUNDARY=1e6,v.INITIAL_WORLD_BOUNDARY=v.WORLD_BOUNDARY/1e3,v.WORLD_CENTER_X=1200,v.WORLD_CENTER_Y=900,A.exports=v}),(function(A,G,N){var v=N(2),h=N(8),i=N(9);function r(f,e,u){v.call(this,u),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=u,this.bendpoints=[],this.source=f,this.target=e}r.prototype=Object.create(v.prototype);for(var a in v)r[a]=v[a];r.prototype.getSource=function(){return this.source},r.prototype.getTarget=function(){return this.target},r.prototype.isInterGraph=function(){return this.isInterGraph},r.prototype.getLength=function(){return this.length},r.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},r.prototype.getBendpoints=function(){return this.bendpoints},r.prototype.getLca=function(){return this.lca},r.prototype.getSourceInLca=function(){return this.sourceInLca},r.prototype.getTargetInLca=function(){return this.targetInLca},r.prototype.getOtherEnd=function(f){if(this.source===f)return this.target;if(this.target===f)return this.source;throw"Node is not incident with this edge"},r.prototype.getOtherEndInGraph=function(f,e){for(var u=this.getOtherEnd(f),t=e.getGraphManager().getRoot();;){if(u.getOwner()==e)return u;if(u.getOwner()==t)break;u=u.getOwner().getParent()}return null},r.prototype.updateLength=function(){var f=new Array(4);this.isOverlapingSourceAndTarget=h.getIntersection(this.target.getRect(),this.source.getRect(),f),this.isOverlapingSourceAndTarget||(this.lengthX=f[0]-f[2],this.lengthY=f[1]-f[3],Math.abs(this.lengthX)<1&&(this.lengthX=i.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=i.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},r.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=i.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=i.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},A.exports=r}),(function(A,G,N){function v(h){this.vGraphObject=h}A.exports=v}),(function(A,G,N){var v=N(2),h=N(10),i=N(13),r=N(0),a=N(16),f=N(5);function e(t,s,o,c){o==null&&c==null&&(c=s),v.call(this,c),t.graphManager!=null&&(t=t.graphManager),this.estimatedSize=h.MIN_VALUE,this.inclusionTreeDepth=h.MAX_VALUE,this.vGraphObject=c,this.edges=[],this.graphManager=t,o!=null&&s!=null?this.rect=new i(s.x,s.y,o.width,o.height):this.rect=new i}e.prototype=Object.create(v.prototype);for(var u in v)e[u]=v[u];e.prototype.getEdges=function(){return this.edges},e.prototype.getChild=function(){return this.child},e.prototype.getOwner=function(){return this.owner},e.prototype.getWidth=function(){return this.rect.width},e.prototype.setWidth=function(t){this.rect.width=t},e.prototype.getHeight=function(){return this.rect.height},e.prototype.setHeight=function(t){this.rect.height=t},e.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},e.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},e.prototype.getCenter=function(){return new f(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},e.prototype.getLocation=function(){return new f(this.rect.x,this.rect.y)},e.prototype.getRect=function(){return this.rect},e.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},e.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},e.prototype.setRect=function(t,s){this.rect.x=t.x,this.rect.y=t.y,this.rect.width=s.width,this.rect.height=s.height},e.prototype.setCenter=function(t,s){this.rect.x=t-this.rect.width/2,this.rect.y=s-this.rect.height/2},e.prototype.setLocation=function(t,s){this.rect.x=t,this.rect.y=s},e.prototype.moveBy=function(t,s){this.rect.x+=t,this.rect.y+=s},e.prototype.getEdgeListToNode=function(t){var s=[],o=this;return o.edges.forEach(function(c){if(c.target==t){if(c.source!=o)throw"Incorrect edge source!";s.push(c)}}),s},e.prototype.getEdgesBetween=function(t){var s=[],o=this;return o.edges.forEach(function(c){if(!(c.source==o||c.target==o))throw"Incorrect edge source and/or target";(c.target==t||c.source==t)&&s.push(c)}),s},e.prototype.getNeighborsList=function(){var t=new Set,s=this;return s.edges.forEach(function(o){if(o.source==s)t.add(o.target);else{if(o.target!=s)throw"Incorrect incidency!";t.add(o.source)}}),t},e.prototype.withChildren=function(){var t=new Set,s,o;if(t.add(this),this.child!=null)for(var c=this.child.getNodes(),l=0;ls?(this.rect.x-=(this.labelWidth-s)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(s+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(o+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>o?(this.rect.y-=(this.labelHeight-o)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(o+this.labelHeight))}}},e.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==h.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},e.prototype.transform=function(t){var s=this.rect.x;s>r.WORLD_BOUNDARY?s=r.WORLD_BOUNDARY:s<-r.WORLD_BOUNDARY&&(s=-r.WORLD_BOUNDARY);var o=this.rect.y;o>r.WORLD_BOUNDARY?o=r.WORLD_BOUNDARY:o<-r.WORLD_BOUNDARY&&(o=-r.WORLD_BOUNDARY);var c=new f(s,o),l=t.inverseTransformPoint(c);this.setLocation(l.x,l.y)},e.prototype.getLeft=function(){return this.rect.x},e.prototype.getRight=function(){return this.rect.x+this.rect.width},e.prototype.getTop=function(){return this.rect.y},e.prototype.getBottom=function(){return this.rect.y+this.rect.height},e.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},A.exports=e}),(function(A,G,N){var v=N(0);function h(){}for(var i in v)h[i]=v[i];h.MAX_ITERATIONS=2500,h.DEFAULT_EDGE_LENGTH=50,h.DEFAULT_SPRING_STRENGTH=.45,h.DEFAULT_REPULSION_STRENGTH=4500,h.DEFAULT_GRAVITY_STRENGTH=.4,h.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,h.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,h.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,h.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,h.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,h.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,h.COOLING_ADAPTATION_FACTOR=.33,h.ADAPTATION_LOWER_NODE_LIMIT=1e3,h.ADAPTATION_UPPER_NODE_LIMIT=5e3,h.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,h.MAX_NODE_DISPLACEMENT=h.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,h.MIN_REPULSION_DIST=h.DEFAULT_EDGE_LENGTH/10,h.CONVERGENCE_CHECK_PERIOD=100,h.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,h.MIN_EDGE_LENGTH=1,h.GRID_CALCULATION_CHECK_PERIOD=10,A.exports=h}),(function(A,G,N){function v(h,i){h==null&&i==null?(this.x=0,this.y=0):(this.x=h,this.y=i)}v.prototype.getX=function(){return this.x},v.prototype.getY=function(){return this.y},v.prototype.setX=function(h){this.x=h},v.prototype.setY=function(h){this.y=h},v.prototype.getDifference=function(h){return new DimensionD(this.x-h.x,this.y-h.y)},v.prototype.getCopy=function(){return new v(this.x,this.y)},v.prototype.translate=function(h){return this.x+=h.width,this.y+=h.height,this},A.exports=v}),(function(A,G,N){var v=N(2),h=N(10),i=N(0),r=N(7),a=N(3),f=N(1),e=N(13),u=N(12),t=N(11);function s(c,l,T){v.call(this,T),this.estimatedSize=h.MIN_VALUE,this.margin=i.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=c,l!=null&&l instanceof r?this.graphManager=l:l!=null&&l instanceof Layout&&(this.graphManager=l.graphManager)}s.prototype=Object.create(v.prototype);for(var o in v)s[o]=v[o];s.prototype.getNodes=function(){return this.nodes},s.prototype.getEdges=function(){return this.edges},s.prototype.getGraphManager=function(){return this.graphManager},s.prototype.getParent=function(){return this.parent},s.prototype.getLeft=function(){return this.left},s.prototype.getRight=function(){return this.right},s.prototype.getTop=function(){return this.top},s.prototype.getBottom=function(){return this.bottom},s.prototype.isConnected=function(){return this.isConnected},s.prototype.add=function(c,l,T){if(l==null&&T==null){var g=c;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(g)>-1)throw"Node already in graph!";return g.owner=this,this.getNodes().push(g),g}else{var d=c;if(!(this.getNodes().indexOf(l)>-1&&this.getNodes().indexOf(T)>-1))throw"Source or target not in graph!";if(!(l.owner==T.owner&&l.owner==this))throw"Both owners must be this graph!";return l.owner!=T.owner?null:(d.source=l,d.target=T,d.isInterGraph=!1,this.getEdges().push(d),l.edges.push(d),T!=l&&T.edges.push(d),d)}},s.prototype.remove=function(c){var l=c;if(c instanceof a){if(l==null)throw"Node is null!";if(!(l.owner!=null&&l.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var T=l.edges.slice(),g,d=T.length,C=0;C-1&&P>-1))throw"Source and/or target doesn't know this edge!";g.source.edges.splice(w,1),g.target!=g.source&&g.target.edges.splice(P,1);var S=g.source.owner.getEdges().indexOf(g);if(S==-1)throw"Not in owner's edge list!";g.source.owner.getEdges().splice(S,1)}},s.prototype.updateLeftTop=function(){for(var c=h.MAX_VALUE,l=h.MAX_VALUE,T,g,d,C=this.getNodes(),S=C.length,w=0;wT&&(c=T),l>g&&(l=g)}return c==h.MAX_VALUE?null:(C[0].getParent().paddingLeft!=null?d=C[0].getParent().paddingLeft:d=this.margin,this.left=l-d,this.top=c-d,new u(this.left,this.top))},s.prototype.updateBounds=function(c){for(var l=h.MAX_VALUE,T=-h.MAX_VALUE,g=h.MAX_VALUE,d=-h.MAX_VALUE,C,S,w,P,B,U=this.nodes,V=U.length,M=0;MC&&(l=C),Tw&&(g=w),dC&&(l=C),Tw&&(g=w),d=this.nodes.length){var V=0;T.forEach(function(M){M.owner==c&&V++}),V==this.nodes.length&&(this.isConnected=!0)}},A.exports=s}),(function(A,G,N){var v,h=N(1);function i(r){v=N(6),this.layout=r,this.graphs=[],this.edges=[]}i.prototype.addRoot=function(){var r=this.layout.newGraph(),a=this.layout.newNode(null),f=this.add(r,a);return this.setRootGraph(f),this.rootGraph},i.prototype.add=function(r,a,f,e,u){if(f==null&&e==null&&u==null){if(r==null)throw"Graph is null!";if(a==null)throw"Parent node is null!";if(this.graphs.indexOf(r)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(r),r.parent!=null)throw"Already has a parent!";if(a.child!=null)throw"Already has a child!";return r.parent=a,a.child=r,r}else{u=f,e=a,f=r;var t=e.getOwner(),s=u.getOwner();if(!(t!=null&&t.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(s!=null&&s.getGraphManager()==this))throw"Target not in this graph mgr!";if(t==s)return f.isInterGraph=!1,t.add(f,e,u);if(f.isInterGraph=!0,f.source=e,f.target=u,this.edges.indexOf(f)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(f),!(f.source!=null&&f.target!=null))throw"Edge source and/or target is null!";if(!(f.source.edges.indexOf(f)==-1&&f.target.edges.indexOf(f)==-1))throw"Edge already in source and/or target incidency list!";return f.source.edges.push(f),f.target.edges.push(f),f}},i.prototype.remove=function(r){if(r instanceof v){var a=r;if(a.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(a==this.rootGraph||a.parent!=null&&a.parent.graphManager==this))throw"Invalid parent node!";var f=[];f=f.concat(a.getEdges());for(var e,u=f.length,t=0;t=r.getRight()?a[0]+=Math.min(r.getX()-i.getX(),i.getRight()-r.getRight()):r.getX()<=i.getX()&&r.getRight()>=i.getRight()&&(a[0]+=Math.min(i.getX()-r.getX(),r.getRight()-i.getRight())),i.getY()<=r.getY()&&i.getBottom()>=r.getBottom()?a[1]+=Math.min(r.getY()-i.getY(),i.getBottom()-r.getBottom()):r.getY()<=i.getY()&&r.getBottom()>=i.getBottom()&&(a[1]+=Math.min(i.getY()-r.getY(),r.getBottom()-i.getBottom()));var u=Math.abs((r.getCenterY()-i.getCenterY())/(r.getCenterX()-i.getCenterX()));r.getCenterY()===i.getCenterY()&&r.getCenterX()===i.getCenterX()&&(u=1);var t=u*a[0],s=a[1]/u;a[0]t)return a[0]=f,a[1]=o,a[2]=u,a[3]=U,!1;if(eu)return a[0]=s,a[1]=e,a[2]=P,a[3]=t,!1;if(fu?(a[0]=l,a[1]=T,n=!0):(a[0]=c,a[1]=o,n=!0):p===y&&(f>u?(a[0]=s,a[1]=o,n=!0):(a[0]=g,a[1]=T,n=!0)),-m===y?u>f?(a[2]=B,a[3]=U,E=!0):(a[2]=P,a[3]=w,E=!0):m===y&&(u>f?(a[2]=S,a[3]=w,E=!0):(a[2]=V,a[3]=U,E=!0)),n&&E)return!1;if(f>u?e>t?(I=this.getCardinalDirection(p,y,4),O=this.getCardinalDirection(m,y,2)):(I=this.getCardinalDirection(-p,y,3),O=this.getCardinalDirection(-m,y,1)):e>t?(I=this.getCardinalDirection(-p,y,1),O=this.getCardinalDirection(-m,y,3)):(I=this.getCardinalDirection(p,y,2),O=this.getCardinalDirection(m,y,4)),!n)switch(I){case 1:W=o,R=f+-C/y,a[0]=R,a[1]=W;break;case 2:R=g,W=e+d*y,a[0]=R,a[1]=W;break;case 3:W=T,R=f+C/y,a[0]=R,a[1]=W;break;case 4:R=l,W=e+-d*y,a[0]=R,a[1]=W;break}if(!E)switch(O){case 1:Q=w,x=u+-_/y,a[2]=x,a[3]=Q;break;case 2:x=V,Q=t+M*y,a[2]=x,a[3]=Q;break;case 3:Q=U,x=u+_/y,a[2]=x,a[3]=Q;break;case 4:x=B,Q=t+-M*y,a[2]=x,a[3]=Q;break}}return!1},h.getCardinalDirection=function(i,r,a){return i>r?a:1+a%4},h.getIntersection=function(i,r,a,f){if(f==null)return this.getIntersection2(i,r,a);var e=i.x,u=i.y,t=r.x,s=r.y,o=a.x,c=a.y,l=f.x,T=f.y,g=void 0,d=void 0,C=void 0,S=void 0,w=void 0,P=void 0,B=void 0,U=void 0,V=void 0;return C=s-u,w=e-t,B=t*u-e*s,S=T-c,P=o-l,U=l*c-o*T,V=C*P-S*w,V===0?null:(g=(w*U-P*B)/V,d=(S*B-C*U)/V,new v(g,d))},h.angleOfVector=function(i,r,a,f){var e=void 0;return i!==a?(e=Math.atan((f-r)/(a-i)),a=0){var T=(-o+Math.sqrt(o*o-4*s*c))/(2*s),g=(-o-Math.sqrt(o*o-4*s*c))/(2*s),d=null;return T>=0&&T<=1?[T]:g>=0&&g<=1?[g]:d}else return null},h.HALF_PI=.5*Math.PI,h.ONE_AND_HALF_PI=1.5*Math.PI,h.TWO_PI=2*Math.PI,h.THREE_PI=3*Math.PI,A.exports=h}),(function(A,G,N){function v(){}v.sign=function(h){return h>0?1:h<0?-1:0},v.floor=function(h){return h<0?Math.ceil(h):Math.floor(h)},v.ceil=function(h){return h<0?Math.floor(h):Math.ceil(h)},A.exports=v}),(function(A,G,N){function v(){}v.MAX_VALUE=2147483647,v.MIN_VALUE=-2147483648,A.exports=v}),(function(A,G,N){var v=(function(){function e(u,t){for(var s=0;s"u"?"undefined":v(i);return i==null||r!="object"&&r!="function"},A.exports=h}),(function(A,G,N){function v(o){if(Array.isArray(o)){for(var c=0,l=Array(o.length);c0&&c;){for(C.push(w[0]);C.length>0&&c;){var P=C[0];C.splice(0,1),d.add(P);for(var B=P.getEdges(),g=0;g-1&&w.splice(_,1)}d=new Set,S=new Map}}return o},s.prototype.createDummyNodesForBendpoints=function(o){for(var c=[],l=o.source,T=this.graphManager.calcLowestCommonAncestor(o.source,o.target),g=0;g0){for(var T=this.edgeToDummyNodes.get(l),g=0;g=0&&c.splice(U,1);var V=S.getNeighborsList();V.forEach(function(n){if(l.indexOf(n)<0){var E=T.get(n),p=E-1;p==1&&P.push(n),T.set(n,p)}})}l=l.concat(P),(c.length==1||c.length==2)&&(g=!0,d=c[0])}return d},s.prototype.setGraphManager=function(o){this.graphManager=o},A.exports=s}),(function(A,G,N){function v(){}v.seed=1,v.x=0,v.nextDouble=function(){return v.x=Math.sin(v.seed++)*1e4,v.x-Math.floor(v.x)},A.exports=v}),(function(A,G,N){var v=N(5);function h(i,r){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}h.prototype.getWorldOrgX=function(){return this.lworldOrgX},h.prototype.setWorldOrgX=function(i){this.lworldOrgX=i},h.prototype.getWorldOrgY=function(){return this.lworldOrgY},h.prototype.setWorldOrgY=function(i){this.lworldOrgY=i},h.prototype.getWorldExtX=function(){return this.lworldExtX},h.prototype.setWorldExtX=function(i){this.lworldExtX=i},h.prototype.getWorldExtY=function(){return this.lworldExtY},h.prototype.setWorldExtY=function(i){this.lworldExtY=i},h.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},h.prototype.setDeviceOrgX=function(i){this.ldeviceOrgX=i},h.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},h.prototype.setDeviceOrgY=function(i){this.ldeviceOrgY=i},h.prototype.getDeviceExtX=function(){return this.ldeviceExtX},h.prototype.setDeviceExtX=function(i){this.ldeviceExtX=i},h.prototype.getDeviceExtY=function(){return this.ldeviceExtY},h.prototype.setDeviceExtY=function(i){this.ldeviceExtY=i},h.prototype.transformX=function(i){var r=0,a=this.lworldExtX;return a!=0&&(r=this.ldeviceOrgX+(i-this.lworldOrgX)*this.ldeviceExtX/a),r},h.prototype.transformY=function(i){var r=0,a=this.lworldExtY;return a!=0&&(r=this.ldeviceOrgY+(i-this.lworldOrgY)*this.ldeviceExtY/a),r},h.prototype.inverseTransformX=function(i){var r=0,a=this.ldeviceExtX;return a!=0&&(r=this.lworldOrgX+(i-this.ldeviceOrgX)*this.lworldExtX/a),r},h.prototype.inverseTransformY=function(i){var r=0,a=this.ldeviceExtY;return a!=0&&(r=this.lworldOrgY+(i-this.ldeviceOrgY)*this.lworldExtY/a),r},h.prototype.inverseTransformPoint=function(i){var r=new v(this.inverseTransformX(i.x),this.inverseTransformY(i.y));return r},A.exports=h}),(function(A,G,N){function v(t){if(Array.isArray(t)){for(var s=0,o=Array(t.length);si.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*i.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(t-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-i.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT_INCREMENTAL):(t>i.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(i.COOLING_ADAPTATION_FACTOR,1-(t-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*(1-i.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*i.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},e.prototype.calcSpringForces=function(){for(var t=this.getAllEdges(),s,o=0;o0&&arguments[0]!==void 0?arguments[0]:!0,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,o,c,l,T,g=this.getAllNodes(),d;if(this.useFRGridVariant)for(this.totalIterations%i.GRID_CALCULATION_CHECK_PERIOD==1&&t&&this.updateGrid(),d=new Set,o=0;oC||d>C)&&(t.gravitationForceX=-this.gravityConstant*l,t.gravitationForceY=-this.gravityConstant*T)):(C=s.getEstimatedSize()*this.compoundGravityRangeFactor,(g>C||d>C)&&(t.gravitationForceX=-this.gravityConstant*l*this.compoundGravityConstant,t.gravitationForceY=-this.gravityConstant*T*this.compoundGravityConstant))},e.prototype.isConverged=function(){var t,s=!1;return this.totalIterations>this.maxIterations/3&&(s=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),t=this.totalDisplacement=g.length||C>=g[0].length)){for(var S=0;Se}}]),a})();A.exports=r}),(function(A,G,N){function v(){}v.svd=function(h){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=h.length,this.n=h[0].length;var i=Math.min(this.m,this.n);this.s=(function(Tt){for(var Ct=[];Tt-- >0;)Ct.push(0);return Ct})(Math.min(this.m+1,this.n)),this.U=(function(Tt){var Ct=function Bt(bt){if(bt.length==0)return 0;for(var zt=[],St=0;St0;)Ct.push(0);return Ct})(this.n),a=(function(Tt){for(var Ct=[];Tt-- >0;)Ct.push(0);return Ct})(this.m),f=!0,e=Math.min(this.m-1,this.n),u=Math.max(0,Math.min(this.n-2,this.m)),t=0;t=0;m--)if(this.s[m]!==0){for(var y=m+1;y=0;z--){if((function(Tt,Ct){return Tt&&Ct})(z0;){var J=void 0,It=void 0;for(J=n-2;J>=-1&&J!==-1;J--)if(Math.abs(r[J])<=ht+tt*(Math.abs(this.s[J])+Math.abs(this.s[J+1]))){r[J]=0;break}if(J===n-2)It=4;else{var Nt=void 0;for(Nt=n-1;Nt>=J&&Nt!==J;Nt--){var vt=(Nt!==n?Math.abs(r[Nt]):0)+(Nt!==J+1?Math.abs(r[Nt-1]):0);if(Math.abs(this.s[Nt])<=ht+tt*vt){this.s[Nt]=0;break}}Nt===J?It=3:Nt===n-1?It=1:(It=2,J=Nt)}switch(J++,It){case 1:{var it=r[n-2];r[n-2]=0;for(var ut=n-2;ut>=J;ut--){var Et=v.hypot(this.s[ut],it),wt=this.s[ut]/Et,Ot=it/Et;this.s[ut]=Et,ut!==J&&(it=-Ot*r[ut-1],r[ut-1]=wt*r[ut-1]);for(var mt=0;mt=this.s[J+1]);){var Lt=this.s[J];if(this.s[J]=this.s[J+1],this.s[J+1]=Lt,JMath.abs(i)?(r=i/h,r=Math.abs(h)*Math.sqrt(1+r*r)):i!=0?(r=h/i,r=Math.abs(i)*Math.sqrt(1+r*r)):r=0,r},A.exports=v}),(function(A,G,N){var v=(function(){function r(a,f){for(var e=0;e2&&arguments[2]!==void 0?arguments[2]:1,u=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,t=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;h(this,r),this.sequence1=a,this.sequence2=f,this.match_score=e,this.mismatch_penalty=u,this.gap_penalty=t,this.iMax=a.length+1,this.jMax=f.length+1,this.grid=new Array(this.iMax);for(var s=0;s=0;a--){var f=this.listeners[a];f.event===i&&f.callback===r&&this.listeners.splice(a,1)}},h.emit=function(i,r){for(var a=0;a{var G={45:((i,r,a)=>{var f={};f.layoutBase=a(551),f.CoSEConstants=a(806),f.CoSEEdge=a(767),f.CoSEGraph=a(880),f.CoSEGraphManager=a(578),f.CoSELayout=a(765),f.CoSENode=a(991),f.ConstraintHandler=a(902),i.exports=f}),806:((i,r,a)=>{var f=a(551).FDLayoutConstants;function e(){}for(var u in f)e[u]=f[u];e.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,e.DEFAULT_RADIAL_SEPARATION=f.DEFAULT_EDGE_LENGTH,e.DEFAULT_COMPONENT_SEPERATION=60,e.TILE=!0,e.TILING_PADDING_VERTICAL=10,e.TILING_PADDING_HORIZONTAL=10,e.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,e.ENFORCE_CONSTRAINTS=!0,e.APPLY_LAYOUT=!0,e.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,e.TREE_REDUCTION_ON_INCREMENTAL=!0,e.PURE_INCREMENTAL=e.DEFAULT_INCREMENTAL,i.exports=e}),767:((i,r,a)=>{var f=a(551).FDLayoutEdge;function e(t,s,o){f.call(this,t,s,o)}e.prototype=Object.create(f.prototype);for(var u in f)e[u]=f[u];i.exports=e}),880:((i,r,a)=>{var f=a(551).LGraph;function e(t,s,o){f.call(this,t,s,o)}e.prototype=Object.create(f.prototype);for(var u in f)e[u]=f[u];i.exports=e}),578:((i,r,a)=>{var f=a(551).LGraphManager;function e(t){f.call(this,t)}e.prototype=Object.create(f.prototype);for(var u in f)e[u]=f[u];i.exports=e}),765:((i,r,a)=>{var f=a(551).FDLayout,e=a(578),u=a(880),t=a(991),s=a(767),o=a(806),c=a(902),l=a(551).FDLayoutConstants,T=a(551).LayoutConstants,g=a(551).Point,d=a(551).PointD,C=a(551).DimensionD,S=a(551).Layout,w=a(551).Integer,P=a(551).IGeometry,B=a(551).LGraph,U=a(551).Transform,V=a(551).LinkedList;function M(){f.call(this),this.toBeTiled={},this.constraints={}}M.prototype=Object.create(f.prototype);for(var _ in f)M[_]=f[_];M.prototype.newGraphManager=function(){var n=new e(this);return this.graphManager=n,n},M.prototype.newGraph=function(n){return new u(null,this.graphManager,n)},M.prototype.newNode=function(n){return new t(this.graphManager,n)},M.prototype.newEdge=function(n){return new s(null,null,n)},M.prototype.initParameters=function(){f.prototype.initParameters.call(this,arguments),this.isSubLayout||(o.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=o.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=l.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=l.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=l.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},M.prototype.initSpringEmbedder=function(){f.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/l.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},M.prototype.layout=function(){var n=T.DEFAULT_CREATE_BENDS_AS_NEEDED;return n&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},M.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(o.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(I){return E.has(I)});this.graphManager.setAllNodesToApplyGravitation(p)}}else{var n=this.getFlatForest();if(n.length>0)this.positionNodesRadially(n);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),p=this.nodesWithGravity.filter(function(m){return E.has(m)});this.graphManager.setAllNodesToApplyGravitation(p),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(c.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),o.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},M.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%l.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var n=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(y){return n.has(y)});this.graphManager.setAllNodesToApplyGravitation(E),this.graphManager.updateBounds(),this.updateGrid(),o.PURE_INCREMENTAL?this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),o.PURE_INCREMENTAL?this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var p=!this.isTreeGrowing&&!this.isGrowthFinished,m=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(p,m),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},M.prototype.getPositionsData=function(){for(var n=this.graphManager.getAllNodes(),E={},p=0;p0&&this.updateDisplacements();for(var p=0;p0&&(m.fixedNodeWeight=I)}}if(this.constraints.relativePlacementConstraint){var O=new Map,R=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(D){n.fixedNodesOnHorizontal.add(D),n.fixedNodesOnVertical.add(D)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var W=this.constraints.alignmentConstraint.vertical,p=0;p=2*D.length/3;tt--)H=Math.floor(Math.random()*(tt+1)),k=D[tt],D[tt]=D[H],D[H]=k;return D},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(D){if(D.left){var H=O.has(D.left)?O.get(D.left):D.left,k=O.has(D.right)?O.get(D.right):D.right;n.nodesInRelativeHorizontal.includes(H)||(n.nodesInRelativeHorizontal.push(H),n.nodeToRelativeConstraintMapHorizontal.set(H,[]),n.dummyToNodeForVerticalAlignment.has(H)?n.nodeToTempPositionMapHorizontal.set(H,n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(H)[0]).getCenterX()):n.nodeToTempPositionMapHorizontal.set(H,n.idToNodeMap.get(H).getCenterX())),n.nodesInRelativeHorizontal.includes(k)||(n.nodesInRelativeHorizontal.push(k),n.nodeToRelativeConstraintMapHorizontal.set(k,[]),n.dummyToNodeForVerticalAlignment.has(k)?n.nodeToTempPositionMapHorizontal.set(k,n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(k)[0]).getCenterX()):n.nodeToTempPositionMapHorizontal.set(k,n.idToNodeMap.get(k).getCenterX())),n.nodeToRelativeConstraintMapHorizontal.get(H).push({right:k,gap:D.gap}),n.nodeToRelativeConstraintMapHorizontal.get(k).push({left:H,gap:D.gap})}else{var tt=R.has(D.top)?R.get(D.top):D.top,ht=R.has(D.bottom)?R.get(D.bottom):D.bottom;n.nodesInRelativeVertical.includes(tt)||(n.nodesInRelativeVertical.push(tt),n.nodeToRelativeConstraintMapVertical.set(tt,[]),n.dummyToNodeForHorizontalAlignment.has(tt)?n.nodeToTempPositionMapVertical.set(tt,n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(tt)[0]).getCenterY()):n.nodeToTempPositionMapVertical.set(tt,n.idToNodeMap.get(tt).getCenterY())),n.nodesInRelativeVertical.includes(ht)||(n.nodesInRelativeVertical.push(ht),n.nodeToRelativeConstraintMapVertical.set(ht,[]),n.dummyToNodeForHorizontalAlignment.has(ht)?n.nodeToTempPositionMapVertical.set(ht,n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(ht)[0]).getCenterY()):n.nodeToTempPositionMapVertical.set(ht,n.idToNodeMap.get(ht).getCenterY())),n.nodeToRelativeConstraintMapVertical.get(tt).push({bottom:ht,gap:D.gap}),n.nodeToRelativeConstraintMapVertical.get(ht).push({top:tt,gap:D.gap})}});else{var Q=new Map,z=new Map;this.constraints.relativePlacementConstraint.forEach(function(D){if(D.left){var H=O.has(D.left)?O.get(D.left):D.left,k=O.has(D.right)?O.get(D.right):D.right;Q.has(H)?Q.get(H).push(k):Q.set(H,[k]),Q.has(k)?Q.get(k).push(H):Q.set(k,[H])}else{var tt=R.has(D.top)?R.get(D.top):D.top,ht=R.has(D.bottom)?R.get(D.bottom):D.bottom;z.has(tt)?z.get(tt).push(ht):z.set(tt,[ht]),z.has(ht)?z.get(ht).push(tt):z.set(ht,[tt])}});var X=function(H,k){var tt=[],ht=[],J=new V,It=new Set,Nt=0;return H.forEach(function(vt,it){if(!It.has(it)){tt[Nt]=[],ht[Nt]=!1;var ut=it;for(J.push(ut),It.add(ut),tt[Nt].push(ut);J.length!=0;){ut=J.shift(),k.has(ut)&&(ht[Nt]=!0);var Et=H.get(ut);Et.forEach(function(wt){It.has(wt)||(J.push(wt),It.add(wt),tt[Nt].push(wt))})}Nt++}}),{components:tt,isFixed:ht}},rt=X(Q,n.fixedNodesOnHorizontal);this.componentsOnHorizontal=rt.components,this.fixedComponentsOnHorizontal=rt.isFixed;var $=X(z,n.fixedNodesOnVertical);this.componentsOnVertical=$.components,this.fixedComponentsOnVertical=$.isFixed}}},M.prototype.updateDisplacements=function(){var n=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function($){var D=n.idToNodeMap.get($.nodeId);D.displacementX=0,D.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var E=this.constraints.alignmentConstraint.vertical,p=0;p1){var R;for(R=0;Rm&&(m=Math.floor(O.y)),I=Math.floor(O.x+o.DEFAULT_COMPONENT_SEPERATION)}this.transform(new d(T.WORLD_CENTER_X-O.x/2,T.WORLD_CENTER_Y-O.y/2))},M.radialLayout=function(n,E,p){var m=Math.max(this.maxDiagonalInTree(n),o.DEFAULT_RADIAL_SEPARATION);M.branchRadialLayout(E,null,0,359,0,m);var y=B.calculateBounds(n),I=new U;I.setDeviceOrgX(y.getMinX()),I.setDeviceOrgY(y.getMinY()),I.setWorldOrgX(p.x),I.setWorldOrgY(p.y);for(var O=0;O1;){var k=H[0];H.splice(0,1);var tt=z.indexOf(k);tt>=0&&z.splice(tt,1),$--,X--}E!=null?D=(z.indexOf(H[0])+1)%$:D=0;for(var ht=Math.abs(m-p)/X,J=D;rt!=X;J=++J%$){var It=z[J].getOtherEnd(n);if(It!=E){var Nt=(p+rt*ht)%360,vt=(Nt+ht)%360;M.branchRadialLayout(It,n,Nt,vt,y+I,I),rt++}}},M.maxDiagonalInTree=function(n){for(var E=w.MIN_VALUE,p=0;pE&&(E=y)}return E},M.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},M.prototype.groupZeroDegreeMembers=function(){var n=this,E={};this.memberGroups={},this.idToDummyNode={};for(var p=[],m=this.graphManager.getAllNodes(),y=0;y"u"&&(E[R]=[]),E[R]=E[R].concat(I)}Object.keys(E).forEach(function(W){if(E[W].length>1){var x="DummyCompound_"+W;n.memberGroups[x]=E[W];var Q=E[W][0].getParent(),z=new t(n.graphManager);z.id=x,z.paddingLeft=Q.paddingLeft||0,z.paddingRight=Q.paddingRight||0,z.paddingBottom=Q.paddingBottom||0,z.paddingTop=Q.paddingTop||0,n.idToDummyNode[x]=z;var X=n.getGraphManager().add(n.newGraph(),z),rt=Q.getChild();rt.add(z);for(var $=0;$y?(m.rect.x-=(m.labelWidth-y)/2,m.setWidth(m.labelWidth),m.labelMarginLeft=(m.labelWidth-y)/2):m.labelPosHorizontal=="right"&&m.setWidth(y+m.labelWidth)),m.labelHeight&&(m.labelPosVertical=="top"?(m.rect.y-=m.labelHeight,m.setHeight(I+m.labelHeight),m.labelMarginTop=m.labelHeight):m.labelPosVertical=="center"&&m.labelHeight>I?(m.rect.y-=(m.labelHeight-I)/2,m.setHeight(m.labelHeight),m.labelMarginTop=(m.labelHeight-I)/2):m.labelPosVertical=="bottom"&&m.setHeight(I+m.labelHeight))}})},M.prototype.repopulateCompounds=function(){for(var n=this.compoundOrder.length-1;n>=0;n--){var E=this.compoundOrder[n],p=E.id,m=E.paddingLeft,y=E.paddingTop,I=E.labelMarginLeft,O=E.labelMarginTop;this.adjustLocations(this.tiledMemberPack[p],E.rect.x,E.rect.y,m,y,I,O)}},M.prototype.repopulateZeroDegreeMembers=function(){var n=this,E=this.tiledZeroDegreePack;Object.keys(E).forEach(function(p){var m=n.idToDummyNode[p],y=m.paddingLeft,I=m.paddingTop,O=m.labelMarginLeft,R=m.labelMarginTop;n.adjustLocations(E[p],m.rect.x,m.rect.y,y,I,O,R)})},M.prototype.getToBeTiled=function(n){var E=n.id;if(this.toBeTiled[E]!=null)return this.toBeTiled[E];var p=n.getChild();if(p==null)return this.toBeTiled[E]=!1,!1;for(var m=p.getNodes(),y=0;y0)return this.toBeTiled[E]=!1,!1;if(I.getChild()==null){this.toBeTiled[I.id]=!1;continue}if(!this.getToBeTiled(I))return this.toBeTiled[E]=!1,!1}return this.toBeTiled[E]=!0,!0},M.prototype.getNodeDegree=function(n){n.id;for(var E=n.getEdges(),p=0,m=0;mQ&&(Q=X.rect.height)}p+=Q+n.verticalPadding}},M.prototype.tileCompoundMembers=function(n,E){var p=this;this.tiledMemberPack=[],Object.keys(n).forEach(function(m){var y=E[m];if(p.tiledMemberPack[m]=p.tileNodes(n[m],y.paddingLeft+y.paddingRight),y.rect.width=p.tiledMemberPack[m].width,y.rect.height=p.tiledMemberPack[m].height,y.setCenter(p.tiledMemberPack[m].centerX,p.tiledMemberPack[m].centerY),y.labelMarginLeft=0,y.labelMarginTop=0,o.NODE_DIMENSIONS_INCLUDE_LABELS){var I=y.rect.width,O=y.rect.height;y.labelWidth&&(y.labelPosHorizontal=="left"?(y.rect.x-=y.labelWidth,y.setWidth(I+y.labelWidth),y.labelMarginLeft=y.labelWidth):y.labelPosHorizontal=="center"&&y.labelWidth>I?(y.rect.x-=(y.labelWidth-I)/2,y.setWidth(y.labelWidth),y.labelMarginLeft=(y.labelWidth-I)/2):y.labelPosHorizontal=="right"&&y.setWidth(I+y.labelWidth)),y.labelHeight&&(y.labelPosVertical=="top"?(y.rect.y-=y.labelHeight,y.setHeight(O+y.labelHeight),y.labelMarginTop=y.labelHeight):y.labelPosVertical=="center"&&y.labelHeight>O?(y.rect.y-=(y.labelHeight-O)/2,y.setHeight(y.labelHeight),y.labelMarginTop=(y.labelHeight-O)/2):y.labelPosVertical=="bottom"&&y.setHeight(O+y.labelHeight))}})},M.prototype.tileNodes=function(n,E){var p=this.tileNodesByFavoringDim(n,E,!0),m=this.tileNodesByFavoringDim(n,E,!1),y=this.getOrgRatio(p),I=this.getOrgRatio(m),O;return IR&&(R=$.getWidth())});var W=I/y,x=O/y,Q=Math.pow(p-m,2)+4*(W+m)*(x+p)*y,z=(m-p+Math.sqrt(Q))/(2*(W+m)),X;E?(X=Math.ceil(z),X==z&&X++):X=Math.floor(z);var rt=X*(W+m)-m;return R>rt&&(rt=R),rt+=m*2,rt},M.prototype.tileNodesByFavoringDim=function(n,E,p){var m=o.TILING_PADDING_VERTICAL,y=o.TILING_PADDING_HORIZONTAL,I=o.TILING_COMPARE_BY,O={rows:[],rowWidth:[],rowHeight:[],width:0,height:E,verticalPadding:m,horizontalPadding:y,centerX:0,centerY:0};I&&(O.idealRowWidth=this.calcIdealRowWidth(n,p));var R=function(D){return D.rect.width*D.rect.height},W=function(D,H){return R(H)-R(D)};n.sort(function($,D){var H=W;return O.idealRowWidth?(H=I,H($.id,D.id)):H($,D)});for(var x=0,Q=0,z=0;z0&&(O+=n.horizontalPadding),n.rowWidth[p]=O,n.width0&&(R+=n.verticalPadding);var W=0;R>n.rowHeight[p]&&(W=n.rowHeight[p],n.rowHeight[p]=R,W=n.rowHeight[p]-W),n.height+=W,n.rows[p].push(E)},M.prototype.getShortestRowIndex=function(n){for(var E=-1,p=Number.MAX_VALUE,m=0;mp&&(E=m,p=n.rowWidth[m]);return E},M.prototype.canAddHorizontal=function(n,E,p){if(n.idealRowWidth){var m=n.rows.length-1,y=n.rowWidth[m];return y+E+n.horizontalPadding<=n.idealRowWidth}var I=this.getShortestRowIndex(n);if(I<0)return!0;var O=n.rowWidth[I];if(O+n.horizontalPadding+E<=n.width)return!0;var R=0;n.rowHeight[I]0&&(R=p+n.verticalPadding-n.rowHeight[I]);var W;n.width-O>=E+n.horizontalPadding?W=(n.height+R)/(O+E+n.horizontalPadding):W=(n.height+R)/n.width,R=p+n.verticalPadding;var x;return n.widthI&&E!=p){m.splice(-1,1),n.rows[p].push(y),n.rowWidth[E]=n.rowWidth[E]-I,n.rowWidth[p]=n.rowWidth[p]+I,n.width=n.rowWidth[instance.getLongestRowIndex(n)];for(var O=Number.MIN_VALUE,R=0;RO&&(O=m[R].height);E>0&&(O+=n.verticalPadding);var W=n.rowHeight[E]+n.rowHeight[p];n.rowHeight[E]=O,n.rowHeight[p]0)for(var rt=y;rt<=I;rt++)X[0]+=this.grid[rt][O-1].length+this.grid[rt][O].length-1;if(I0)for(var rt=O;rt<=R;rt++)X[3]+=this.grid[y-1][rt].length+this.grid[y][rt].length-1;for(var $=w.MAX_VALUE,D,H,k=0;k{var f=a(551).FDLayoutNode,e=a(551).IMath;function u(s,o,c,l){f.call(this,s,o,c,l)}u.prototype=Object.create(f.prototype);for(var t in f)u[t]=f[t];u.prototype.calculateDisplacement=function(){var s=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=s.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=s.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=s.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=s.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementX=s.coolingFactor*s.maxNodeDisplacement*e.sign(this.displacementX)),Math.abs(this.displacementY)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementY=s.coolingFactor*s.maxNodeDisplacement*e.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},u.prototype.propogateDisplacementToChildren=function(s,o){for(var c=this.getChild().getNodes(),l,T=0;T{function f(c){if(Array.isArray(c)){for(var l=0,T=Array(c.length);l0){var Lt=0;ot.forEach(function(st){Z=="horizontal"?(et.set(st,g.has(st)?d[g.get(st)]:q.get(st)),Lt+=et.get(st)):(et.set(st,g.has(st)?C[g.get(st)]:q.get(st)),Lt+=et.get(st))}),Lt=Lt/ot.length,lt.forEach(function(st){K.has(st)||et.set(st,Lt)})}else{var ft=0;lt.forEach(function(st){Z=="horizontal"?ft+=g.has(st)?d[g.get(st)]:q.get(st):ft+=g.has(st)?C[g.get(st)]:q.get(st)}),ft=ft/lt.length,lt.forEach(function(st){et.set(st,ft)})}});for(var At=function(){var ot=dt.shift(),Lt=Y.get(ot);Lt.forEach(function(ft){if(et.get(ft.id)st&&(st=kt),KtXt&&(Xt=Kt)}}catch(ee){Ct=!0,Bt=ee}finally{try{!Tt&&bt.return&&bt.return()}finally{if(Ct)throw Bt}}var fe=(Lt+st)/2-(ft+Xt)/2,Qt=!0,jt=!1,_t=void 0;try{for(var Jt=lt[Symbol.iterator](),ne;!(Qt=(ne=Jt.next()).done);Qt=!0){var te=ne.value;et.set(te,et.get(te)+fe)}}catch(ee){jt=!0,_t=ee}finally{try{!Qt&&Jt.return&&Jt.return()}finally{if(jt)throw _t}}})}return et},_=function(Y){var Z=0,K=0,q=0,at=0;if(Y.forEach(function(j){j.left?d[g.get(j.left)]-d[g.get(j.right)]>=0?Z++:K++:C[g.get(j.top)]-C[g.get(j.bottom)]>=0?q++:at++}),Z>K&&q>at)for(var ct=0;ctK)for(var nt=0;ntat)for(var et=0;et1)l.fixedNodeConstraint.forEach(function(F,Y){m[Y]=[F.position.x,F.position.y],y[Y]=[d[g.get(F.nodeId)],C[g.get(F.nodeId)]]}),I=!0;else if(l.alignmentConstraint)(function(){var F=0;if(l.alignmentConstraint.vertical){for(var Y=l.alignmentConstraint.vertical,Z=function(et){var j=new Set;Y[et].forEach(function(pt){j.add(pt)});var dt=new Set([].concat(f(j)).filter(function(pt){return R.has(pt)})),At=void 0;dt.size>0?At=d[g.get(dt.values().next().value)]:At=V(j).x,Y[et].forEach(function(pt){m[F]=[At,C[g.get(pt)]],y[F]=[d[g.get(pt)],C[g.get(pt)]],F++})},K=0;K0?At=d[g.get(dt.values().next().value)]:At=V(j).y,q[et].forEach(function(pt){m[F]=[d[g.get(pt)],At],y[F]=[d[g.get(pt)],C[g.get(pt)]],F++})},ct=0;ctz&&(z=Q[rt].length,X=rt);if(z0){var mt={x:0,y:0};l.fixedNodeConstraint.forEach(function(F,Y){var Z={x:d[g.get(F.nodeId)],y:C[g.get(F.nodeId)]},K=F.position,q=U(K,Z);mt.x+=q.x,mt.y+=q.y}),mt.x/=l.fixedNodeConstraint.length,mt.y/=l.fixedNodeConstraint.length,d.forEach(function(F,Y){d[Y]+=mt.x}),C.forEach(function(F,Y){C[Y]+=mt.y}),l.fixedNodeConstraint.forEach(function(F){d[g.get(F.nodeId)]=F.position.x,C[g.get(F.nodeId)]=F.position.y})}if(l.alignmentConstraint){if(l.alignmentConstraint.vertical)for(var Dt=l.alignmentConstraint.vertical,Rt=function(Y){var Z=new Set;Dt[Y].forEach(function(at){Z.add(at)});var K=new Set([].concat(f(Z)).filter(function(at){return R.has(at)})),q=void 0;K.size>0?q=d[g.get(K.values().next().value)]:q=V(Z).x,Z.forEach(function(at){R.has(at)||(d[g.get(at)]=q)})},Ht=0;Ht0?q=C[g.get(K.values().next().value)]:q=V(Z).y,Z.forEach(function(at){R.has(at)||(C[g.get(at)]=q)})},Ft=0;Ft{i.exports=A})},N={};function v(i){var r=N[i];if(r!==void 0)return r.exports;var a=N[i]={exports:{}};return G[i](a,a.exports,v),a.exports}var h=v(45);return h})()})})(he)),he.exports}var pr=se.exports,De;function yr(){return De||(De=1,(function(L,b){(function(G,N){L.exports=N(vr())})(pr,function(A){return(()=>{var G={658:(i=>{i.exports=Object.assign!=null?Object.assign.bind(Object):function(r){for(var a=arguments.length,f=Array(a>1?a-1:0),e=1;e{var f=(function(){function t(s,o){var c=[],l=!0,T=!1,g=void 0;try{for(var d=s[Symbol.iterator](),C;!(l=(C=d.next()).done)&&(c.push(C.value),!(o&&c.length===o));l=!0);}catch(S){T=!0,g=S}finally{try{!l&&d.return&&d.return()}finally{if(T)throw g}}return c}return function(s,o){if(Array.isArray(s))return s;if(Symbol.iterator in Object(s))return t(s,o);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),e=a(140).layoutBase.LinkedList,u={};u.getTopMostNodes=function(t){for(var s={},o=0;o0&&I.merge(x)});for(var O=0;O1){C=g[0],S=C.connectedEdges().length,g.forEach(function(y){y.connectedEdges().length0&&c.set("dummy"+(c.size+1),B),U},u.relocateComponent=function(t,s,o){if(!o.fixedNodeConstraint){var c=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,T=Number.POSITIVE_INFINITY,g=Number.NEGATIVE_INFINITY;if(o.quality=="draft"){var d=!0,C=!1,S=void 0;try{for(var w=s.nodeIndexes[Symbol.iterator](),P;!(d=(P=w.next()).done);d=!0){var B=P.value,U=f(B,2),V=U[0],M=U[1],_=o.cy.getElementById(V);if(_){var n=_.boundingBox(),E=s.xCoords[M]-n.w/2,p=s.xCoords[M]+n.w/2,m=s.yCoords[M]-n.h/2,y=s.yCoords[M]+n.h/2;El&&(l=p),mg&&(g=y)}}}catch(x){C=!0,S=x}finally{try{!d&&w.return&&w.return()}finally{if(C)throw S}}var I=t.x-(l+c)/2,O=t.y-(g+T)/2;s.xCoords=s.xCoords.map(function(x){return x+I}),s.yCoords=s.yCoords.map(function(x){return x+O})}else{Object.keys(s).forEach(function(x){var Q=s[x],z=Q.getRect().x,X=Q.getRect().x+Q.getRect().width,rt=Q.getRect().y,$=Q.getRect().y+Q.getRect().height;zl&&(l=X),rtg&&(g=$)});var R=t.x-(l+c)/2,W=t.y-(g+T)/2;Object.keys(s).forEach(function(x){var Q=s[x];Q.setCenter(Q.getCenterX()+R,Q.getCenterY()+W)})}}},u.calcBoundingBox=function(t,s,o,c){for(var l=Number.MAX_SAFE_INTEGER,T=Number.MIN_SAFE_INTEGER,g=Number.MAX_SAFE_INTEGER,d=Number.MIN_SAFE_INTEGER,C=void 0,S=void 0,w=void 0,P=void 0,B=t.descendants().not(":parent"),U=B.length,V=0;VC&&(l=C),Tw&&(g=w),d{var f=a(548),e=a(140).CoSELayout,u=a(140).CoSENode,t=a(140).layoutBase.PointD,s=a(140).layoutBase.DimensionD,o=a(140).layoutBase.LayoutConstants,c=a(140).layoutBase.FDLayoutConstants,l=a(140).CoSEConstants,T=function(d,C){var S=d.cy,w=d.eles,P=w.nodes(),B=w.edges(),U=void 0,V=void 0,M=void 0,_={};d.randomize&&(U=C.nodeIndexes,V=C.xCoords,M=C.yCoords);var n=function(x){return typeof x=="function"},E=function(x,Q){return n(x)?x(Q):x},p=f.calcParentsWithoutChildren(S,w),m=function W(x,Q,z,X){for(var rt=Q.length,$=0;$0){var J=void 0;J=z.getGraphManager().add(z.newGraph(),k),W(J,H,z,X)}}},y=function(x,Q,z){for(var X=0,rt=0,$=0;$0?l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=X/rt:n(d.idealEdgeLength)?l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=50:l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=d.idealEdgeLength,l.MIN_REPULSION_DIST=c.MIN_REPULSION_DIST=c.DEFAULT_EDGE_LENGTH/10,l.DEFAULT_RADIAL_SEPARATION=c.DEFAULT_EDGE_LENGTH)},I=function(x,Q){Q.fixedNodeConstraint&&(x.constraints.fixedNodeConstraint=Q.fixedNodeConstraint),Q.alignmentConstraint&&(x.constraints.alignmentConstraint=Q.alignmentConstraint),Q.relativePlacementConstraint&&(x.constraints.relativePlacementConstraint=Q.relativePlacementConstraint)};d.nestingFactor!=null&&(l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=c.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=d.nestingFactor),d.gravity!=null&&(l.DEFAULT_GRAVITY_STRENGTH=c.DEFAULT_GRAVITY_STRENGTH=d.gravity),d.numIter!=null&&(l.MAX_ITERATIONS=c.MAX_ITERATIONS=d.numIter),d.gravityRange!=null&&(l.DEFAULT_GRAVITY_RANGE_FACTOR=c.DEFAULT_GRAVITY_RANGE_FACTOR=d.gravityRange),d.gravityCompound!=null&&(l.DEFAULT_COMPOUND_GRAVITY_STRENGTH=c.DEFAULT_COMPOUND_GRAVITY_STRENGTH=d.gravityCompound),d.gravityRangeCompound!=null&&(l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=d.gravityRangeCompound),d.initialEnergyOnIncremental!=null&&(l.DEFAULT_COOLING_FACTOR_INCREMENTAL=c.DEFAULT_COOLING_FACTOR_INCREMENTAL=d.initialEnergyOnIncremental),d.tilingCompareBy!=null&&(l.TILING_COMPARE_BY=d.tilingCompareBy),d.quality=="proof"?o.QUALITY=2:o.QUALITY=0,l.NODE_DIMENSIONS_INCLUDE_LABELS=c.NODE_DIMENSIONS_INCLUDE_LABELS=o.NODE_DIMENSIONS_INCLUDE_LABELS=d.nodeDimensionsIncludeLabels,l.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!d.randomize,l.ANIMATE=c.ANIMATE=o.ANIMATE=d.animate,l.TILE=d.tile,l.TILING_PADDING_VERTICAL=typeof d.tilingPaddingVertical=="function"?d.tilingPaddingVertical.call():d.tilingPaddingVertical,l.TILING_PADDING_HORIZONTAL=typeof d.tilingPaddingHorizontal=="function"?d.tilingPaddingHorizontal.call():d.tilingPaddingHorizontal,l.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!0,l.PURE_INCREMENTAL=!d.randomize,o.DEFAULT_UNIFORM_LEAF_NODE_SIZES=d.uniformNodeDimensions,d.step=="transformed"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,l.ENFORCE_CONSTRAINTS=!1,l.APPLY_LAYOUT=!1),d.step=="enforced"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!0,l.APPLY_LAYOUT=!1),d.step=="cose"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!1,l.APPLY_LAYOUT=!0),d.step=="all"&&(d.randomize?l.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!0,l.APPLY_LAYOUT=!0),d.fixedNodeConstraint||d.alignmentConstraint||d.relativePlacementConstraint?l.TREE_REDUCTION_ON_INCREMENTAL=!1:l.TREE_REDUCTION_ON_INCREMENTAL=!0;var O=new e,R=O.newGraphManager();return m(R.addRoot(),f.getTopMostNodes(P),O,d),y(O,R,B),I(O,d),O.runLayout(),_};i.exports={coseLayout:T}}),212:((i,r,a)=>{var f=(function(){function d(C,S){for(var w=0;w0)if(p){var I=t.getTopMostNodes(w.eles.nodes());if(M=t.connectComponents(P,w.eles,I),M.forEach(function(vt){var it=vt.boundingBox();_.push({x:it.x1+it.w/2,y:it.y1+it.h/2})}),w.randomize&&M.forEach(function(vt){w.eles=vt,U.push(o(w))}),w.quality=="default"||w.quality=="proof"){var O=P.collection();if(w.tile){var R=new Map,W=[],x=[],Q=0,z={nodeIndexes:R,xCoords:W,yCoords:x},X=[];if(M.forEach(function(vt,it){vt.edges().length==0&&(vt.nodes().forEach(function(ut,Et){O.merge(vt.nodes()[Et]),ut.isParent()||(z.nodeIndexes.set(vt.nodes()[Et].id(),Q++),z.xCoords.push(vt.nodes()[0].position().x),z.yCoords.push(vt.nodes()[0].position().y))}),X.push(it))}),O.length>1){var rt=O.boundingBox();_.push({x:rt.x1+rt.w/2,y:rt.y1+rt.h/2}),M.push(O),U.push(z);for(var $=X.length-1;$>=0;$--)M.splice(X[$],1),U.splice(X[$],1),_.splice(X[$],1)}}M.forEach(function(vt,it){w.eles=vt,V.push(l(w,U[it])),t.relocateComponent(_[it],V[it],w)})}else M.forEach(function(vt,it){t.relocateComponent(_[it],U[it],w)});var D=new Set;if(M.length>1){var H=[],k=B.filter(function(vt){return vt.css("display")=="none"});M.forEach(function(vt,it){var ut=void 0;if(w.quality=="draft"&&(ut=U[it].nodeIndexes),vt.nodes().not(k).length>0){var Et={};Et.edges=[],Et.nodes=[];var wt=void 0;vt.nodes().not(k).forEach(function(Ot){if(w.quality=="draft")if(!Ot.isParent())wt=ut.get(Ot.id()),Et.nodes.push({x:U[it].xCoords[wt]-Ot.boundingbox().w/2,y:U[it].yCoords[wt]-Ot.boundingbox().h/2,width:Ot.boundingbox().w,height:Ot.boundingbox().h});else{var mt=t.calcBoundingBox(Ot,U[it].xCoords,U[it].yCoords,ut);Et.nodes.push({x:mt.topLeftX,y:mt.topLeftY,width:mt.width,height:mt.height})}else V[it][Ot.id()]&&Et.nodes.push({x:V[it][Ot.id()].getLeft(),y:V[it][Ot.id()].getTop(),width:V[it][Ot.id()].getWidth(),height:V[it][Ot.id()].getHeight()})}),vt.edges().forEach(function(Ot){var mt=Ot.source(),Dt=Ot.target();if(mt.css("display")!="none"&&Dt.css("display")!="none")if(w.quality=="draft"){var Rt=ut.get(mt.id()),Ht=ut.get(Dt.id()),Ut=[],Pt=[];if(mt.isParent()){var Ft=t.calcBoundingBox(mt,U[it].xCoords,U[it].yCoords,ut);Ut.push(Ft.topLeftX+Ft.width/2),Ut.push(Ft.topLeftY+Ft.height/2)}else Ut.push(U[it].xCoords[Rt]),Ut.push(U[it].yCoords[Rt]);if(Dt.isParent()){var Yt=t.calcBoundingBox(Dt,U[it].xCoords,U[it].yCoords,ut);Pt.push(Yt.topLeftX+Yt.width/2),Pt.push(Yt.topLeftY+Yt.height/2)}else Pt.push(U[it].xCoords[Ht]),Pt.push(U[it].yCoords[Ht]);Et.edges.push({startX:Ut[0],startY:Ut[1],endX:Pt[0],endY:Pt[1]})}else V[it][mt.id()]&&V[it][Dt.id()]&&Et.edges.push({startX:V[it][mt.id()].getCenterX(),startY:V[it][mt.id()].getCenterY(),endX:V[it][Dt.id()].getCenterX(),endY:V[it][Dt.id()].getCenterY()})}),Et.nodes.length>0&&(H.push(Et),D.add(it))}});var tt=E.packComponents(H,w.randomize).shifts;if(w.quality=="draft")U.forEach(function(vt,it){var ut=vt.xCoords.map(function(wt){return wt+tt[it].dx}),Et=vt.yCoords.map(function(wt){return wt+tt[it].dy});vt.xCoords=ut,vt.yCoords=Et});else{var ht=0;D.forEach(function(vt){Object.keys(V[vt]).forEach(function(it){var ut=V[vt][it];ut.setCenter(ut.getCenterX()+tt[ht].dx,ut.getCenterY()+tt[ht].dy)}),ht++})}}}else{var m=w.eles.boundingBox();if(_.push({x:m.x1+m.w/2,y:m.y1+m.h/2}),w.randomize){var y=o(w);U.push(y)}w.quality=="default"||w.quality=="proof"?(V.push(l(w,U[0])),t.relocateComponent(_[0],V[0],w)):t.relocateComponent(_[0],U[0],w)}var J=function(it,ut){if(w.quality=="default"||w.quality=="proof"){typeof it=="number"&&(it=ut);var Et=void 0,wt=void 0,Ot=it.data("id");return V.forEach(function(Dt){Ot in Dt&&(Et={x:Dt[Ot].getRect().getCenterX(),y:Dt[Ot].getRect().getCenterY()},wt=Dt[Ot])}),w.nodeDimensionsIncludeLabels&&(wt.labelWidth&&(wt.labelPosHorizontal=="left"?Et.x+=wt.labelWidth/2:wt.labelPosHorizontal=="right"&&(Et.x-=wt.labelWidth/2)),wt.labelHeight&&(wt.labelPosVertical=="top"?Et.y+=wt.labelHeight/2:wt.labelPosVertical=="bottom"&&(Et.y-=wt.labelHeight/2))),Et==null&&(Et={x:it.position("x"),y:it.position("y")}),{x:Et.x,y:Et.y}}else{var mt=void 0;return U.forEach(function(Dt){var Rt=Dt.nodeIndexes.get(it.id());Rt!=null&&(mt={x:Dt.xCoords[Rt],y:Dt.yCoords[Rt]})}),mt==null&&(mt={x:it.position("x"),y:it.position("y")}),{x:mt.x,y:mt.y}}};if(w.quality=="default"||w.quality=="proof"||w.randomize){var It=t.calcParentsWithoutChildren(P,B),Nt=B.filter(function(vt){return vt.css("display")=="none"});w.eles=B.not(Nt),B.nodes().not(":parent").not(Nt).layoutPositions(S,w,J),It.length>0&&It.forEach(function(vt){vt.position(J(vt))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),d})();i.exports=g}),657:((i,r,a)=>{var f=a(548),e=a(140).layoutBase.Matrix,u=a(140).layoutBase.SVD,t=function(o){var c=o.cy,l=o.eles,T=l.nodes(),g=l.nodes(":parent"),d=new Map,C=new Map,S=new Map,w=[],P=[],B=[],U=[],V=[],M=[],_=[],n=[],E=void 0,p=1e8,m=1e-9,y=o.piTol,I=o.samplingType,O=o.nodeSeparation,R=void 0,W=function(){for(var Y=0,Z=0,K=!1;Z=at;){nt=q[at++];for(var xt=w[nt],lt=0;ltdt&&(dt=V[Lt],At=Lt)}return At},Q=function(Y){var Z=void 0;if(Y){Z=Math.floor(Math.random()*E);for(var q=0;q=1)break;j=et}for(var pt=0;pt=1)break;j=et}for(var lt=0;lt0&&(Z.isParent()?w[Y].push(S.get(Z.id())):w[Y].push(Z.id()))})});var Nt=function(Y){var Z=C.get(Y),K=void 0;d.get(Y).forEach(function(q){c.getElementById(q).isParent()?K=S.get(q):K=q,w[Z].push(K),w[C.get(K)].push(Y)})},vt=!0,it=!1,ut=void 0;try{for(var Et=d.keys()[Symbol.iterator](),wt;!(vt=(wt=Et.next()).done);vt=!0){var Ot=wt.value;Nt(Ot)}}catch(F){it=!0,ut=F}finally{try{!vt&&Et.return&&Et.return()}finally{if(it)throw ut}}E=C.size;var mt=void 0;if(E>2){R=E{var f=a(212),e=function(t){t&&t("layout","fcose",f)};typeof cytoscape<"u"&&e(cytoscape),i.exports=e}),140:(i=>{i.exports=A})},N={};function v(i){var r=N[i];if(r!==void 0)return r.exports;var a=N[i]={exports:{}};return G[i](a,a.exports,v),a.exports}var h=v(579);return h})()})})(se)),se.exports}var mr=yr();const Er=cr(mr);var xe={L:"left",R:"right",T:"top",B:"bottom"},Ie={L:gt(L=>`${L},${L/2} 0,${L} 0,0`,"L"),R:gt(L=>`0,${L/2} ${L},0 ${L},${L}`,"R"),T:gt(L=>`0,0 ${L},0 ${L/2},${L}`,"T"),B:gt(L=>`${L/2},0 ${L},${L} 0,${L}`,"B")},oe={L:gt((L,b)=>L-b+2,"L"),R:gt((L,b)=>L-2,"R"),T:gt((L,b)=>L-b+2,"T"),B:gt((L,b)=>L-2,"B")},Tr=gt(function(L){return Wt(L)?L==="L"?"R":"L":L==="T"?"B":"T"},"getOppositeArchitectureDirection"),Re=gt(function(L){const b=L;return b==="L"||b==="R"||b==="T"||b==="B"},"isArchitectureDirection"),Wt=gt(function(L){const b=L;return b==="L"||b==="R"},"isArchitectureDirectionX"),qt=gt(function(L){const b=L;return b==="T"||b==="B"},"isArchitectureDirectionY"),Te=gt(function(L,b){const A=Wt(L)&&qt(b),G=qt(L)&&Wt(b);return A||G},"isArchitectureDirectionXY"),Nr=gt(function(L){const b=L[0],A=L[1],G=Wt(b)&&qt(A),N=qt(b)&&Wt(A);return G||N},"isArchitecturePairXY"),Lr=gt(function(L){return L!=="LL"&&L!=="RR"&&L!=="TT"&&L!=="BB"},"isValidArchitectureDirectionPair"),pe=gt(function(L,b){const A=`${L}${b}`;return Lr(A)?A:void 0},"getArchitectureDirectionPair"),Cr=gt(function([L,b],A){const G=A[0],N=A[1];return Wt(G)?qt(N)?[L+(G==="L"?-1:1),b+(N==="T"?1:-1)]:[L+(G==="L"?-1:1),b]:Wt(N)?[L+(N==="L"?1:-1),b+(G==="T"?1:-1)]:[L,b+(G==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),wr=gt(function(L){return L==="LT"||L==="TL"?[1,1]:L==="BL"||L==="LB"?[1,-1]:L==="BR"||L==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),Ar=gt(function(L,b){return Te(L,b)?"bend":Wt(L)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),Mr=gt(function(L){return L.type==="service"},"isArchitectureService"),Or=gt(function(L){return L.type==="junction"},"isArchitectureJunction"),be=gt(L=>L.data(),"edgeData"),ie=gt(L=>L.data(),"nodeData"),Dr=ar.architecture,Pe=class{constructor(){this.nodes={},this.groups={},this.edges=[],this.layoutHints=[],this.registeredIds={},this.elements={},this.diagramId="",this.setAccTitle=Qe,this.getAccTitle=Je,this.setDiagramTitle=Ke,this.getDiagramTitle=je,this.getAccDescription=_e,this.setAccDescription=tr,this.clear()}static{gt(this,"ArchitectureDB")}setDiagramId(L){this.diagramId=L}getDiagramId(){return this.diagramId}clear(){this.nodes={},this.groups={},this.edges=[],this.layoutHints=[],this.registeredIds={},this.dataStructures=void 0,this.elements={},this.diagramId="",er()}addService({id:L,icon:b,in:A,title:G,iconText:N}){if(this.registeredIds[L]!==void 0)throw new Error(`The service id [${L}] is already in use by another ${this.registeredIds[L]}`);if(A!==void 0){if(L===A)throw new Error(`The service [${L}] cannot be placed within itself`);if(this.registeredIds[A]===void 0)throw new Error(`The service [${L}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds[A]==="node")throw new Error(`The service [${L}]'s parent is not a group`)}this.registeredIds[L]="node",this.nodes[L]={id:L,type:"service",icon:b,iconText:N,title:G,edges:[],in:A}}getServices(){return Object.values(this.nodes).filter(Mr)}addJunction({id:L,in:b}){if(this.registeredIds[L]!==void 0)throw new Error(`The junction id [${L}] is already in use by another ${this.registeredIds[L]}`);if(b!==void 0){if(L===b)throw new Error(`The junction [${L}] cannot be placed within itself`);if(this.registeredIds[b]===void 0)throw new Error(`The junction [${L}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds[b]==="node")throw new Error(`The junction [${L}]'s parent is not a group`)}this.registeredIds[L]="node",this.nodes[L]={id:L,type:"junction",edges:[],in:b}}getJunctions(){return Object.values(this.nodes).filter(Or)}getNodes(){return Object.values(this.nodes)}getNode(L){return this.nodes[L]??null}addGroup({id:L,icon:b,in:A,title:G}){if(this.registeredIds?.[L]!==void 0)throw new Error(`The group id [${L}] is already in use by another ${this.registeredIds[L]}`);if(A!==void 0){if(L===A)throw new Error(`The group [${L}] cannot be placed within itself`);if(this.registeredIds?.[A]===void 0)throw new Error(`The group [${L}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds?.[A]==="node")throw new Error(`The group [${L}]'s parent is not a group`)}this.registeredIds[L]="group",this.groups[L]={id:L,icon:b,title:G,in:A}}getGroups(){return Object.values(this.groups)}addEdge({lhsId:L,rhsId:b,lhsDir:A,rhsDir:G,lhsInto:N,rhsInto:v,lhsGroup:h,rhsGroup:i,title:r}){if(!Re(A))throw new Error(`Invalid direction given for left hand side of edge ${L}--${b}. Expected (L,R,T,B) got ${String(A)}`);if(!Re(G))throw new Error(`Invalid direction given for right hand side of edge ${L}--${b}. Expected (L,R,T,B) got ${String(G)}`);if(this.nodes[L]===void 0&&this.groups[L]===void 0)throw new Error(`The left-hand id [${L}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(this.nodes[b]===void 0&&this.groups[b]===void 0)throw new Error(`The right-hand id [${b}] does not yet exist. Please create the service/group before declaring an edge to it.`);const a=this.nodes[L].in,f=this.nodes[b].in;if(h&&a&&f&&a==f)throw new Error(`The left-hand id [${L}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(i&&a&&f&&a==f)throw new Error(`The right-hand id [${b}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const e={lhsId:L,lhsDir:A,lhsInto:N,lhsGroup:h,rhsId:b,rhsDir:G,rhsInto:v,rhsGroup:i,title:r};this.edges.push(e),this.nodes[L]&&this.nodes[b]&&(this.nodes[L].edges.push(this.edges[this.edges.length-1]),this.nodes[b].edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}addLayoutHint(L){if(L.members.length<2)throw new Error(`An align directive requires at least two members; got ${L.members.length}`);const b=new Set;L.members.forEach(A=>{if(this.registeredIds[A]!=="node")throw new Error(`align ${L.direction} references [${A}], which is not a service or junction`);if(b.has(A))throw new Error(`align ${L.direction} lists [${A}] more than once`);b.add(A)}),this.layoutHints.push(L)}getLayoutHints(){return this.layoutHints}getDataStructures(){if(this.dataStructures===void 0){const L={},b=Object.entries(this.nodes).reduce((i,[r,a])=>(i[r]=a.edges.reduce((f,e)=>{const u=this.getNode(e.lhsId)?.in,t=this.getNode(e.rhsId)?.in;if(u&&t&&u!==t){const s=Ar(e.lhsDir,e.rhsDir);s!=="bend"&&(L[u]??={},L[u][t]=s,L[t]??={},L[t][u]=s)}if(e.lhsId===r){const s=pe(e.lhsDir,e.rhsDir);s&&(f[s]=e.rhsId)}else{const s=pe(e.rhsDir,e.lhsDir);s&&(f[s]=e.lhsId)}return f},{}),i),{}),A=Object.keys(b)[0],G={[A]:1},N=Object.keys(b).reduce((i,r)=>r===A?i:{...i,[r]:1},{}),v=gt(i=>{const r={[i]:[0,0]},a=[i];for(;a.length>0;){const f=a.shift();if(f){G[f]=1,delete N[f];const e=b[f],[u,t]=r[f];Object.entries(e).forEach(([s,o])=>{G[o]||(r[o]=Cr([u,t],s),a.push(o))})}}return r},"BFS"),h=[v(A)];for(;Object.keys(N).length>0;)h.push(v(Object.keys(N)[0]));this.dataStructures={adjList:b,spatialMaps:h,groupAlignments:L}}return this.dataStructures}setElementForId(L,b){this.elements[L]=b}getElementById(L){return this.elements[L]}getConfig(){return rr({...Dr,...ir().architecture})}getConfigField(L){return this.getConfig()[L]}},xr=gt((L,b)=>{ke(L,b),L.groups.map(A=>b.addGroup(A)),L.services.map(A=>b.addService({...A,type:"service"})),L.junctions.map(A=>b.addJunction({...A,type:"junction"})),L.edges.map(A=>b.addEdge(A)),L.alignments?.map(A=>b.addLayoutHint({direction:A.direction,members:[...A.members]}))},"populateDb"),Ge={parser:{yy:void 0},parse:gt(async L=>{const b=await fr("architecture",L);Se.debug(b);const A=Ge.parser?.yy;if(!(A instanceof Pe))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");xr(b,A)},"parse")},Ir=gt(L=>` .edge { stroke-width: ${L.archEdgeWidth}; stroke: ${L.archEdgeColor}; diff --git a/apps/kimi-code/dist-web/assets/blockDiagram-677ZJIJ3-fPyJR28f.js b/apps/kimi-code/dist-web/assets/blockDiagram-677ZJIJ3-CWaLAgSM.js similarity index 99% rename from apps/kimi-code/dist-web/assets/blockDiagram-677ZJIJ3-fPyJR28f.js rename to apps/kimi-code/dist-web/assets/blockDiagram-677ZJIJ3-CWaLAgSM.js index 71266bc5f8d..befad3548a1 100644 --- a/apps/kimi-code/dist-web/assets/blockDiagram-677ZJIJ3-fPyJR28f.js +++ b/apps/kimi-code/dist-web/assets/blockDiagram-677ZJIJ3-CWaLAgSM.js @@ -1,4 +1,4 @@ -import{g as de}from"./chunk-5VM5RSS4-BJR-VYAu.js";import{aA as pe,aB as Kt,aC as fe,aD as xe,aE as ye,aF as be,aG as we,aH as me,aI as Se,aJ as Le,aK as ke,aL as ve,aM as Ee,aN as _e,aO as Te,aP as De,aQ as Be,aR as Ne,aS as Ie,aT as Ce,aU as Oe,aV as Re,aW as Ae,aX as ze,aY as Me,_ as g,y as rt,d as D,e as Pe,l as k,p as Fe,r as We,c as R,aZ as Ye,a7 as He,a8 as Ke,L as Ue,a_ as M,a$ as kt,b0 as Q,as as Xe,x as $,k as Ve,b1 as je,i as Ct,b2 as Ot,b3 as Ge}from"./mermaid.core-WW7RuneT.js";import{G as Ze}from"./graph-DOmOIIwC.js";import{c as qe}from"./channel-8Bt6a0tz.js";import"./index-CiHMlsuo.js";import"./_commonjsHelpers-CqkleIqs.js";function Je(e){return Array.isArray(e)}function Qe(e){if(pe(e))return e;const t=Kt(e);if(!$e(e))return{};if(Je(e)){const s=Array.from(e);return e.length>0&&typeof e[0]=="string"&&Object.hasOwn(e,"index")&&(s.index=e.index,s.input=e.input),s}if(fe(e)){const s=e,i=s.constructor;return new i(s.buffer,s.byteOffset,s.length)}if(t==="[object ArrayBuffer]")return new ArrayBuffer(e.byteLength);if(t==="[object DataView]"){const s=e,i=s.buffer,c=s.byteOffset,r=s.byteLength,n=new ArrayBuffer(r),l=new Uint8Array(i,c,r);return new Uint8Array(n).set(l),new DataView(n)}if(t==="[object Boolean]"||t==="[object Number]"||t==="[object String]"){const s=e.constructor,i=new s(e.valueOf());return t==="[object String]"?er(i,e):xt(i,e),i}if(t==="[object Date]")return new Date(Number(e));if(t==="[object RegExp]"){const s=e,i=new RegExp(s.source,s.flags);return i.lastIndex=s.lastIndex,i}if(t==="[object Symbol]")return Object(Symbol.prototype.valueOf.call(e));if(t==="[object Map]"){const s=e,i=new Map;return s.forEach((c,r)=>{i.set(r,c)}),i}if(t==="[object Set]"){const s=e,i=new Set;return s.forEach(c=>{i.add(c)}),i}if(t==="[object Arguments]"){const s=e,i={};return xt(i,s),i.length=s.length,i[Symbol.iterator]=s[Symbol.iterator],i}const a={};return rr(a,e),xt(a,e),tr(a,e),a}function $e(e){switch(Kt(e)){case Me:case ze:case Ae:case Re:case Oe:case Ce:case Ie:case Ne:case Be:case De:case Te:case _e:case Ee:case ve:case ke:case Le:case Se:case me:case we:case be:case ye:case xe:return!0;default:return!1}}function xt(e,t){for(const a in t)Object.hasOwn(t,a)&&(e[a]=t[a])}function tr(e,t){const a=Object.getOwnPropertySymbols(t);for(let s=0;s=a)&&(e[s]=t[s])}function rr(e,t){const a=Object.getPrototypeOf(t);a!==null&&typeof t.constructor=="function"&&Object.setPrototypeOf(e,a)}var bt=(function(){var e=g(function(T,m,p,x){for(p=p||{},x=T.length;x--;p[T[x]]=m);return p},"o"),t=[1,15],a=[1,7],s=[1,13],i=[1,14],c=[1,19],r=[1,16],n=[1,17],l=[1,18],u=[8,30],h=[8,10,21,28,29,30,31,39,43,46],d=[1,23],b=[1,24],w=[8,10,15,16,21,28,29,30,31,39,43,46],y=[8,10,15,16,21,27,28,29,30,31,39,43,46],v=[1,49],S={trace:g(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:g(function(m,p,x,L,E,o,F){var f=o.length-1;switch(E){case 4:L.getLogger().debug("Rule: separator (NL) ");break;case 5:L.getLogger().debug("Rule: separator (Space) ");break;case 6:L.getLogger().debug("Rule: separator (EOF) ");break;case 7:L.getLogger().debug("Rule: hierarchy: ",o[f-1]),L.setHierarchy(o[f-1]);break;case 8:L.getLogger().debug("Stop NL ");break;case 9:L.getLogger().debug("Stop EOF ");break;case 10:L.getLogger().debug("Stop NL2 ");break;case 11:L.getLogger().debug("Stop EOF2 ");break;case 12:L.getLogger().debug("Rule: statement: ",o[f]),typeof o[f].length=="number"?this.$=o[f]:this.$=[o[f]];break;case 13:L.getLogger().debug("Rule: statement #2: ",o[f-1]),this.$=[o[f-1]].concat(o[f]);break;case 14:L.getLogger().debug("Rule: link: ",o[f],m),this.$={edgeTypeStr:o[f],label:""};break;case 15:L.getLogger().debug("Rule: LABEL link: ",o[f-3],o[f-1],o[f]),this.$={edgeTypeStr:o[f],label:o[f-1]};break;case 18:const C=parseInt(o[f]),Z=L.generateId();this.$={id:Z,type:"space",label:"",width:C,children:[]};break;case 23:L.getLogger().debug("Rule: (nodeStatement link node) ",o[f-2],o[f-1],o[f]," typestr: ",o[f-1].edgeTypeStr);const V=L.edgeStrToEdgeData(o[f-1].edgeTypeStr),at=L.edgeStrToEdgeStartData(o[f-1].edgeTypeStr),gt=L.edgeStrToThickness(o[f-1].edgeTypeStr),O=L.edgeStrToPattern(o[f-1].edgeTypeStr);this.$=[{id:o[f-2].id,label:o[f-2].label,type:o[f-2].type,directions:o[f-2].directions},{id:o[f-2].id+"-"+o[f].id,start:o[f-2].id,end:o[f].id,label:o[f-1].label,type:"edge",thickness:gt,pattern:O,directions:o[f].directions,arrowTypeEnd:V,arrowTypeStart:at},{id:o[f].id,label:o[f].label,type:L.typeStr2Type(o[f].typeStr),directions:o[f].directions}];break;case 24:L.getLogger().debug("Rule: nodeStatement (abc88 node size) ",o[f-1],o[f]),this.$={id:o[f-1].id,label:o[f-1].label,type:L.typeStr2Type(o[f-1].typeStr),directions:o[f-1].directions,widthInColumns:parseInt(o[f],10)};break;case 25:L.getLogger().debug("Rule: nodeStatement (node) ",o[f]),this.$={id:o[f].id,label:o[f].label,type:L.typeStr2Type(o[f].typeStr),directions:o[f].directions,widthInColumns:1};break;case 26:L.getLogger().debug("APA123",this?this:"na"),L.getLogger().debug("COLUMNS: ",o[f]),this.$={type:"column-setting",columns:o[f]==="auto"?-1:parseInt(o[f])};break;case 27:L.getLogger().debug("Rule: id-block statement : ",o[f-2],o[f-1]),L.generateId(),this.$={...o[f-2],type:"composite",children:o[f-1]};break;case 28:L.getLogger().debug("Rule: blockStatement : ",o[f-2],o[f-1],o[f]);const j=L.generateId();this.$={id:j,type:"composite",label:"",children:o[f-1]};break;case 29:L.getLogger().debug("Rule: node (NODE_ID separator): ",o[f]),this.$={id:o[f]};break;case 30:L.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",o[f-1],o[f]),this.$={id:o[f-1],label:o[f].label,typeStr:o[f].typeStr,directions:o[f].directions};break;case 31:L.getLogger().debug("Rule: dirList: ",o[f]),this.$=[o[f]];break;case 32:L.getLogger().debug("Rule: dirList: ",o[f-1],o[f]),this.$=[o[f-1]].concat(o[f]);break;case 33:L.getLogger().debug("Rule: nodeShapeNLabel: ",o[f-2],o[f-1],o[f]),this.$={typeStr:o[f-2]+o[f],label:o[f-1]};break;case 34:L.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",o[f-3],o[f-2]," #3:",o[f-1],o[f]),this.$={typeStr:o[f-3]+o[f],label:o[f-2],directions:o[f-1]};break;case 35:case 36:this.$={type:"classDef",id:o[f-1].trim(),css:o[f].trim()};break;case 37:this.$={type:"applyClass",id:o[f-1].trim(),styleClass:o[f].trim()};break;case 38:this.$={type:"applyStyles",id:o[f-1].trim(),stylesStr:o[f].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:t,11:3,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{8:[1,20]},e(u,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:t,21:a,28:s,29:i,31:c,39:r,43:n,46:l}),e(h,[2,16],{14:22,15:d,16:b}),e(h,[2,17]),e(h,[2,18]),e(h,[2,19]),e(h,[2,20]),e(h,[2,21]),e(h,[2,22]),e(w,[2,25],{27:[1,25]}),e(h,[2,26]),{19:26,26:12,31:c},{10:t,11:27,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},e(y,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},e(u,[2,13]),{26:35,31:c},{31:[2,14]},{17:[1,36]},e(w,[2,24]),{10:t,11:37,13:4,14:22,15:d,16:b,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},e(y,[2,30]),{18:[1,43]},{18:[1,44]},e(w,[2,23]),{18:[1,45]},{30:[1,46]},e(h,[2,28]),e(h,[2,35]),e(h,[2,36]),e(h,[2,37]),e(h,[2,38]),{36:[1,47]},{33:48,34:v},{15:[1,50]},e(h,[2,27]),e(y,[2,33]),{38:[1,51]},{33:52,34:v,38:[2,31]},{31:[2,15]},e(y,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:g(function(m,p){if(p.recoverable)this.trace(m);else{var x=new Error(m);throw x.hash=p,x}},"parseError"),parse:g(function(m){var p=this,x=[0],L=[],E=[null],o=[],F=this.table,f="",C=0,Z=0,V=2,at=1,gt=o.slice.call(arguments,1),O=Object.create(this.lexer),j={yy:{}};for(var ut in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ut)&&(j.yy[ut]=this.yy[ut]);O.setInput(m,j.yy),j.yy.lexer=O,j.yy.parser=this,typeof O.yylloc>"u"&&(O.yylloc={});var dt=O.yylloc;o.push(dt);var ge=O.options&&O.options.ranges;typeof j.yy.parseError=="function"?this.parseError=j.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ue(W){x.length=x.length-2*W,E.length=E.length-W,o.length=o.length-W}g(ue,"popStack");function Nt(){var W;return W=L.pop()||O.lex()||at,typeof W!="number"&&(W instanceof Array&&(L=W,W=L.pop()),W=p.symbols_[W]||W),W}g(Nt,"lex");for(var P,q,H,pt,J={},st,G,It,it;;){if(q=x[x.length-1],this.defaultActions[q]?H=this.defaultActions[q]:((P===null||typeof P>"u")&&(P=Nt()),H=F[q]&&F[q][P]),typeof H>"u"||!H.length||!H[0]){var ft="";it=[];for(st in F[q])this.terminals_[st]&&st>V&&it.push("'"+this.terminals_[st]+"'");O.showPosition?ft="Parse error on line "+(C+1)+`: +import{g as de}from"./chunk-5VM5RSS4-CRxkKkdS.js";import{aA as pe,aB as Kt,aC as fe,aD as xe,aE as ye,aF as be,aG as we,aH as me,aI as Se,aJ as Le,aK as ke,aL as ve,aM as Ee,aN as _e,aO as Te,aP as De,aQ as Be,aR as Ne,aS as Ie,aT as Ce,aU as Oe,aV as Re,aW as Ae,aX as ze,aY as Me,_ as g,y as rt,d as D,e as Pe,l as k,p as Fe,r as We,c as R,aZ as Ye,a7 as He,a8 as Ke,L as Ue,a_ as M,a$ as kt,b0 as Q,as as Xe,x as $,k as Ve,b1 as je,i as Ct,b2 as Ot,b3 as Ge}from"./mermaid.core-mH2pk-lc.js";import{G as Ze}from"./graph-DOmOIIwC.js";import{c as qe}from"./channel-D-WAU0ZU.js";import"./index-BIElaaEN.js";import"./_commonjsHelpers-CqkleIqs.js";function Je(e){return Array.isArray(e)}function Qe(e){if(pe(e))return e;const t=Kt(e);if(!$e(e))return{};if(Je(e)){const s=Array.from(e);return e.length>0&&typeof e[0]=="string"&&Object.hasOwn(e,"index")&&(s.index=e.index,s.input=e.input),s}if(fe(e)){const s=e,i=s.constructor;return new i(s.buffer,s.byteOffset,s.length)}if(t==="[object ArrayBuffer]")return new ArrayBuffer(e.byteLength);if(t==="[object DataView]"){const s=e,i=s.buffer,c=s.byteOffset,r=s.byteLength,n=new ArrayBuffer(r),l=new Uint8Array(i,c,r);return new Uint8Array(n).set(l),new DataView(n)}if(t==="[object Boolean]"||t==="[object Number]"||t==="[object String]"){const s=e.constructor,i=new s(e.valueOf());return t==="[object String]"?er(i,e):xt(i,e),i}if(t==="[object Date]")return new Date(Number(e));if(t==="[object RegExp]"){const s=e,i=new RegExp(s.source,s.flags);return i.lastIndex=s.lastIndex,i}if(t==="[object Symbol]")return Object(Symbol.prototype.valueOf.call(e));if(t==="[object Map]"){const s=e,i=new Map;return s.forEach((c,r)=>{i.set(r,c)}),i}if(t==="[object Set]"){const s=e,i=new Set;return s.forEach(c=>{i.add(c)}),i}if(t==="[object Arguments]"){const s=e,i={};return xt(i,s),i.length=s.length,i[Symbol.iterator]=s[Symbol.iterator],i}const a={};return rr(a,e),xt(a,e),tr(a,e),a}function $e(e){switch(Kt(e)){case Me:case ze:case Ae:case Re:case Oe:case Ce:case Ie:case Ne:case Be:case De:case Te:case _e:case Ee:case ve:case ke:case Le:case Se:case me:case we:case be:case ye:case xe:return!0;default:return!1}}function xt(e,t){for(const a in t)Object.hasOwn(t,a)&&(e[a]=t[a])}function tr(e,t){const a=Object.getOwnPropertySymbols(t);for(let s=0;s=a)&&(e[s]=t[s])}function rr(e,t){const a=Object.getPrototypeOf(t);a!==null&&typeof t.constructor=="function"&&Object.setPrototypeOf(e,a)}var bt=(function(){var e=g(function(T,m,p,x){for(p=p||{},x=T.length;x--;p[T[x]]=m);return p},"o"),t=[1,15],a=[1,7],s=[1,13],i=[1,14],c=[1,19],r=[1,16],n=[1,17],l=[1,18],u=[8,30],h=[8,10,21,28,29,30,31,39,43,46],d=[1,23],b=[1,24],w=[8,10,15,16,21,28,29,30,31,39,43,46],y=[8,10,15,16,21,27,28,29,30,31,39,43,46],v=[1,49],S={trace:g(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:g(function(m,p,x,L,E,o,F){var f=o.length-1;switch(E){case 4:L.getLogger().debug("Rule: separator (NL) ");break;case 5:L.getLogger().debug("Rule: separator (Space) ");break;case 6:L.getLogger().debug("Rule: separator (EOF) ");break;case 7:L.getLogger().debug("Rule: hierarchy: ",o[f-1]),L.setHierarchy(o[f-1]);break;case 8:L.getLogger().debug("Stop NL ");break;case 9:L.getLogger().debug("Stop EOF ");break;case 10:L.getLogger().debug("Stop NL2 ");break;case 11:L.getLogger().debug("Stop EOF2 ");break;case 12:L.getLogger().debug("Rule: statement: ",o[f]),typeof o[f].length=="number"?this.$=o[f]:this.$=[o[f]];break;case 13:L.getLogger().debug("Rule: statement #2: ",o[f-1]),this.$=[o[f-1]].concat(o[f]);break;case 14:L.getLogger().debug("Rule: link: ",o[f],m),this.$={edgeTypeStr:o[f],label:""};break;case 15:L.getLogger().debug("Rule: LABEL link: ",o[f-3],o[f-1],o[f]),this.$={edgeTypeStr:o[f],label:o[f-1]};break;case 18:const C=parseInt(o[f]),Z=L.generateId();this.$={id:Z,type:"space",label:"",width:C,children:[]};break;case 23:L.getLogger().debug("Rule: (nodeStatement link node) ",o[f-2],o[f-1],o[f]," typestr: ",o[f-1].edgeTypeStr);const V=L.edgeStrToEdgeData(o[f-1].edgeTypeStr),at=L.edgeStrToEdgeStartData(o[f-1].edgeTypeStr),gt=L.edgeStrToThickness(o[f-1].edgeTypeStr),O=L.edgeStrToPattern(o[f-1].edgeTypeStr);this.$=[{id:o[f-2].id,label:o[f-2].label,type:o[f-2].type,directions:o[f-2].directions},{id:o[f-2].id+"-"+o[f].id,start:o[f-2].id,end:o[f].id,label:o[f-1].label,type:"edge",thickness:gt,pattern:O,directions:o[f].directions,arrowTypeEnd:V,arrowTypeStart:at},{id:o[f].id,label:o[f].label,type:L.typeStr2Type(o[f].typeStr),directions:o[f].directions}];break;case 24:L.getLogger().debug("Rule: nodeStatement (abc88 node size) ",o[f-1],o[f]),this.$={id:o[f-1].id,label:o[f-1].label,type:L.typeStr2Type(o[f-1].typeStr),directions:o[f-1].directions,widthInColumns:parseInt(o[f],10)};break;case 25:L.getLogger().debug("Rule: nodeStatement (node) ",o[f]),this.$={id:o[f].id,label:o[f].label,type:L.typeStr2Type(o[f].typeStr),directions:o[f].directions,widthInColumns:1};break;case 26:L.getLogger().debug("APA123",this?this:"na"),L.getLogger().debug("COLUMNS: ",o[f]),this.$={type:"column-setting",columns:o[f]==="auto"?-1:parseInt(o[f])};break;case 27:L.getLogger().debug("Rule: id-block statement : ",o[f-2],o[f-1]),L.generateId(),this.$={...o[f-2],type:"composite",children:o[f-1]};break;case 28:L.getLogger().debug("Rule: blockStatement : ",o[f-2],o[f-1],o[f]);const j=L.generateId();this.$={id:j,type:"composite",label:"",children:o[f-1]};break;case 29:L.getLogger().debug("Rule: node (NODE_ID separator): ",o[f]),this.$={id:o[f]};break;case 30:L.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",o[f-1],o[f]),this.$={id:o[f-1],label:o[f].label,typeStr:o[f].typeStr,directions:o[f].directions};break;case 31:L.getLogger().debug("Rule: dirList: ",o[f]),this.$=[o[f]];break;case 32:L.getLogger().debug("Rule: dirList: ",o[f-1],o[f]),this.$=[o[f-1]].concat(o[f]);break;case 33:L.getLogger().debug("Rule: nodeShapeNLabel: ",o[f-2],o[f-1],o[f]),this.$={typeStr:o[f-2]+o[f],label:o[f-1]};break;case 34:L.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",o[f-3],o[f-2]," #3:",o[f-1],o[f]),this.$={typeStr:o[f-3]+o[f],label:o[f-2],directions:o[f-1]};break;case 35:case 36:this.$={type:"classDef",id:o[f-1].trim(),css:o[f].trim()};break;case 37:this.$={type:"applyClass",id:o[f-1].trim(),styleClass:o[f].trim()};break;case 38:this.$={type:"applyStyles",id:o[f-1].trim(),stylesStr:o[f].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:t,11:3,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{8:[1,20]},e(u,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:t,21:a,28:s,29:i,31:c,39:r,43:n,46:l}),e(h,[2,16],{14:22,15:d,16:b}),e(h,[2,17]),e(h,[2,18]),e(h,[2,19]),e(h,[2,20]),e(h,[2,21]),e(h,[2,22]),e(w,[2,25],{27:[1,25]}),e(h,[2,26]),{19:26,26:12,31:c},{10:t,11:27,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},e(y,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},e(u,[2,13]),{26:35,31:c},{31:[2,14]},{17:[1,36]},e(w,[2,24]),{10:t,11:37,13:4,14:22,15:d,16:b,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:s,29:i,31:c,39:r,43:n,46:l},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},e(y,[2,30]),{18:[1,43]},{18:[1,44]},e(w,[2,23]),{18:[1,45]},{30:[1,46]},e(h,[2,28]),e(h,[2,35]),e(h,[2,36]),e(h,[2,37]),e(h,[2,38]),{36:[1,47]},{33:48,34:v},{15:[1,50]},e(h,[2,27]),e(y,[2,33]),{38:[1,51]},{33:52,34:v,38:[2,31]},{31:[2,15]},e(y,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:g(function(m,p){if(p.recoverable)this.trace(m);else{var x=new Error(m);throw x.hash=p,x}},"parseError"),parse:g(function(m){var p=this,x=[0],L=[],E=[null],o=[],F=this.table,f="",C=0,Z=0,V=2,at=1,gt=o.slice.call(arguments,1),O=Object.create(this.lexer),j={yy:{}};for(var ut in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ut)&&(j.yy[ut]=this.yy[ut]);O.setInput(m,j.yy),j.yy.lexer=O,j.yy.parser=this,typeof O.yylloc>"u"&&(O.yylloc={});var dt=O.yylloc;o.push(dt);var ge=O.options&&O.options.ranges;typeof j.yy.parseError=="function"?this.parseError=j.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ue(W){x.length=x.length-2*W,E.length=E.length-W,o.length=o.length-W}g(ue,"popStack");function Nt(){var W;return W=L.pop()||O.lex()||at,typeof W!="number"&&(W instanceof Array&&(L=W,W=L.pop()),W=p.symbols_[W]||W),W}g(Nt,"lex");for(var P,q,H,pt,J={},st,G,It,it;;){if(q=x[x.length-1],this.defaultActions[q]?H=this.defaultActions[q]:((P===null||typeof P>"u")&&(P=Nt()),H=F[q]&&F[q][P]),typeof H>"u"||!H.length||!H[0]){var ft="";it=[];for(st in F[q])this.terminals_[st]&&st>V&&it.push("'"+this.terminals_[st]+"'");O.showPosition?ft="Parse error on line "+(C+1)+`: `+O.showPosition()+` Expecting `+it.join(", ")+", got '"+(this.terminals_[P]||P)+"'":ft="Parse error on line "+(C+1)+": Unexpected "+(P==at?"end of input":"'"+(this.terminals_[P]||P)+"'"),this.parseError(ft,{text:O.match,token:this.terminals_[P]||P,line:O.yylineno,loc:dt,expected:it})}if(H[0]instanceof Array&&H.length>1)throw new Error("Parse Error: multiple actions possible at state: "+q+", token: "+P);switch(H[0]){case 1:x.push(P),E.push(O.yytext),o.push(O.yylloc),x.push(H[1]),P=null,Z=O.yyleng,f=O.yytext,C=O.yylineno,dt=O.yylloc;break;case 2:if(G=this.productions_[H[1]][1],J.$=E[E.length-G],J._$={first_line:o[o.length-(G||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(G||1)].first_column,last_column:o[o.length-1].last_column},ge&&(J._$.range=[o[o.length-(G||1)].range[0],o[o.length-1].range[1]]),pt=this.performAction.apply(J,[f,Z,C,j.yy,H[1],E,o].concat(gt)),typeof pt<"u")return pt;G&&(x=x.slice(0,-1*G*2),E=E.slice(0,-1*G),o=o.slice(0,-1*G)),x.push(this.productions_[H[1]][0]),E.push(J.$),o.push(J._$),It=F[x[x.length-2]][x[x.length-1]],x.push(It);break;case 3:return!0}}return!0},"parse")},N=(function(){var T={EOF:1,parseError:g(function(p,x){if(this.yy.parser)this.yy.parser.parseError(p,x);else throw new Error(p)},"parseError"),setInput:g(function(m,p){return this.yy=p||this.yy||{},this._input=m,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:g(function(){var m=this._input[0];this.yytext+=m,this.yyleng++,this.offset++,this.match+=m,this.matched+=m;var p=m.match(/(?:\r\n?|\n).*/g);return p?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),m},"input"),unput:g(function(m){var p=m.length,x=m.split(/(?:\r\n?|\n)/g);this._input=m+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-p),this.offset-=p;var L=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),x.length-1&&(this.yylineno-=x.length-1);var E=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:x?(x.length===L.length?this.yylloc.first_column:0)+L[L.length-x.length].length-x[0].length:this.yylloc.first_column-p},this.options.ranges&&(this.yylloc.range=[E[0],E[0]+this.yyleng-p]),this.yyleng=this.yytext.length,this},"unput"),more:g(function(){return this._more=!0,this},"more"),reject:g(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:g(function(m){this.unput(this.match.slice(m))},"less"),pastInput:g(function(){var m=this.matched.substr(0,this.matched.length-this.match.length);return(m.length>20?"...":"")+m.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:g(function(){var m=this.match;return m.length<20&&(m+=this._input.substr(0,20-m.length)),(m.substr(0,20)+(m.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:g(function(){var m=this.pastInput(),p=new Array(m.length+1).join("-");return m+this.upcomingInput()+` diff --git a/apps/kimi-code/dist-web/assets/c4Diagram-LMCZKHZV-BAAq1RMs.js b/apps/kimi-code/dist-web/assets/c4Diagram-LMCZKHZV-BfGS3XUw.js similarity index 99% rename from apps/kimi-code/dist-web/assets/c4Diagram-LMCZKHZV-BAAq1RMs.js rename to apps/kimi-code/dist-web/assets/c4Diagram-LMCZKHZV-BfGS3XUw.js index 5395daf7eeb..4cea0378711 100644 --- a/apps/kimi-code/dist-web/assets/c4Diagram-LMCZKHZV-BAAq1RMs.js +++ b/apps/kimi-code/dist-web/assets/c4Diagram-LMCZKHZV-BfGS3XUw.js @@ -1,4 +1,4 @@ -import{g as Oe,d as Re}from"./chunk-32BRIVSS-CRTrWqUr.js";import{s as Se,g as De,a as Pe,b as Be,_ as y,c as Dt,d as Nt,l as he,e as Ie,f as Me,h as Tt,i as pe,j as Le,w as Ne,k as Jt,m as ue}from"./mermaid.core-WW7RuneT.js";import"./index-CiHMlsuo.js";import"./_commonjsHelpers-CqkleIqs.js";var jt=(function(){var e=y(function(_t,x,v,E){for(v=v||{},E=_t.length;E--;v[_t[E]]=x);return v},"o"),t=[1,24],s=[1,25],o=[1,26],l=[1,27],r=[1,28],a=[1,63],n=[1,64],i=[1,65],u=[1,66],d=[1,67],p=[1,68],g=[1,69],m=[1,29],O=[1,30],S=[1,31],P=[1,32],M=[1,33],U=[1,34],H=[1,35],q=[1,36],G=[1,37],K=[1,38],J=[1,39],Z=[1,40],$=[1,41],tt=[1,42],et=[1,43],at=[1,44],it=[1,45],nt=[1,46],st=[1,47],rt=[1,48],lt=[1,50],ot=[1,51],ct=[1,52],ht=[1,53],ut=[1,54],dt=[1,55],ft=[1,56],pt=[1,57],yt=[1,58],gt=[1,59],bt=[1,60],Ct=[14,42],Xt=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Ot=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],A=[1,82],k=[1,83],C=[1,84],w=[1,85],T=[12,14,42],se=[12,14,33,42],Bt=[12,14,33,42,76,77,79,80],vt=[12,33],Wt=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Qt={trace:y(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:"error",6:"direction_tb",7:"direction_bt",8:"direction_rl",9:"direction_lr",11:"C4_CONTEXT",12:"NEWLINE",14:"EOF",15:"C4_CONTAINER",16:"C4_COMPONENT",17:"C4_DYNAMIC",18:"C4_DEPLOYMENT",22:"title",23:"accDescription",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"LBRACE",34:"ENTERPRISE_BOUNDARY",36:"SYSTEM_BOUNDARY",37:"BOUNDARY",38:"CONTAINER_BOUNDARY",39:"NODE",40:"NODE_L",41:"NODE_R",42:"RBRACE",44:"PERSON",45:"PERSON_EXT",46:"SYSTEM",47:"SYSTEM_DB",48:"SYSTEM_QUEUE",49:"SYSTEM_EXT",50:"SYSTEM_EXT_DB",51:"SYSTEM_EXT_QUEUE",52:"CONTAINER",53:"CONTAINER_DB",54:"CONTAINER_QUEUE",55:"CONTAINER_EXT",56:"CONTAINER_EXT_DB",57:"CONTAINER_EXT_QUEUE",58:"COMPONENT",59:"COMPONENT_DB",60:"COMPONENT_QUEUE",61:"COMPONENT_EXT",62:"COMPONENT_EXT_DB",63:"COMPONENT_EXT_QUEUE",64:"REL",65:"BIREL",66:"REL_U",67:"REL_D",68:"REL_L",69:"REL_R",70:"REL_B",71:"REL_INDEX",72:"UPDATE_EL_STYLE",73:"UPDATE_REL_STYLE",74:"UPDATE_LAYOUT_CONFIG",76:"STR",77:"STR_KEY",78:"STR_VALUE",79:"ATTRIBUTE",80:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:y(function(x,v,E,b,R,h,Rt){var f=h.length-1;switch(R){case 3:b.setDirection("TB");break;case 4:b.setDirection("BT");break;case 5:b.setDirection("RL");break;case 6:b.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:b.setC4Type(h[f-3]);break;case 19:b.setTitle(h[f].substring(6)),this.$=h[f].substring(6);break;case 20:b.setAccDescription(h[f].substring(15)),this.$=h[f].substring(15);break;case 21:this.$=h[f].trim(),b.setTitle(this.$);break;case 22:case 23:this.$=h[f].trim(),b.setAccDescription(this.$);break;case 28:h[f].splice(2,0,"ENTERPRISE"),b.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 29:h[f].splice(2,0,"SYSTEM"),b.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 30:b.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 31:h[f].splice(2,0,"CONTAINER"),b.addContainerBoundary(...h[f]),this.$=h[f];break;case 32:b.addDeploymentNode("node",...h[f]),this.$=h[f];break;case 33:b.addDeploymentNode("nodeL",...h[f]),this.$=h[f];break;case 34:b.addDeploymentNode("nodeR",...h[f]),this.$=h[f];break;case 35:b.popBoundaryParseStack();break;case 39:b.addPersonOrSystem("person",...h[f]),this.$=h[f];break;case 40:b.addPersonOrSystem("external_person",...h[f]),this.$=h[f];break;case 41:b.addPersonOrSystem("system",...h[f]),this.$=h[f];break;case 42:b.addPersonOrSystem("system_db",...h[f]),this.$=h[f];break;case 43:b.addPersonOrSystem("system_queue",...h[f]),this.$=h[f];break;case 44:b.addPersonOrSystem("external_system",...h[f]),this.$=h[f];break;case 45:b.addPersonOrSystem("external_system_db",...h[f]),this.$=h[f];break;case 46:b.addPersonOrSystem("external_system_queue",...h[f]),this.$=h[f];break;case 47:b.addContainer("container",...h[f]),this.$=h[f];break;case 48:b.addContainer("container_db",...h[f]),this.$=h[f];break;case 49:b.addContainer("container_queue",...h[f]),this.$=h[f];break;case 50:b.addContainer("external_container",...h[f]),this.$=h[f];break;case 51:b.addContainer("external_container_db",...h[f]),this.$=h[f];break;case 52:b.addContainer("external_container_queue",...h[f]),this.$=h[f];break;case 53:b.addComponent("component",...h[f]),this.$=h[f];break;case 54:b.addComponent("component_db",...h[f]),this.$=h[f];break;case 55:b.addComponent("component_queue",...h[f]),this.$=h[f];break;case 56:b.addComponent("external_component",...h[f]),this.$=h[f];break;case 57:b.addComponent("external_component_db",...h[f]),this.$=h[f];break;case 58:b.addComponent("external_component_queue",...h[f]),this.$=h[f];break;case 60:b.addRel("rel",...h[f]),this.$=h[f];break;case 61:b.addRel("birel",...h[f]),this.$=h[f];break;case 62:b.addRel("rel_u",...h[f]),this.$=h[f];break;case 63:b.addRel("rel_d",...h[f]),this.$=h[f];break;case 64:b.addRel("rel_l",...h[f]),this.$=h[f];break;case 65:b.addRel("rel_r",...h[f]),this.$=h[f];break;case 66:b.addRel("rel_b",...h[f]),this.$=h[f];break;case 67:h[f].splice(0,1),b.addRel("rel",...h[f]),this.$=h[f];break;case 68:b.updateElStyle("update_el_style",...h[f]),this.$=h[f];break;case 69:b.updateRelStyle("update_rel_style",...h[f]),this.$=h[f];break;case 70:b.updateLayoutConfig("update_layout_config",...h[f]),this.$=h[f];break;case 71:this.$=[h[f]];break;case 72:h[f].unshift(h[f-1]),this.$=h[f];break;case 73:case 75:this.$=h[f].trim();break;case 74:let Et={};Et[h[f-1].trim()]=h[f].trim(),this.$=Et;break;case 76:this.$="";break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:70,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:71,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:72,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:73,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{14:[1,74]},e(Ct,[2,13],{43:23,29:49,30:61,32:62,20:75,34:a,36:n,37:i,38:u,39:d,40:p,41:g,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt}),e(Ct,[2,14]),e(Xt,[2,16],{12:[1,76]}),e(Ct,[2,36],{12:[1,77]}),e(Ot,[2,19]),e(Ot,[2,20]),{25:[1,78]},{27:[1,79]},e(Ot,[2,23]),{35:80,75:81,76:A,77:k,79:C,80:w},{35:86,75:81,76:A,77:k,79:C,80:w},{35:87,75:81,76:A,77:k,79:C,80:w},{35:88,75:81,76:A,77:k,79:C,80:w},{35:89,75:81,76:A,77:k,79:C,80:w},{35:90,75:81,76:A,77:k,79:C,80:w},{35:91,75:81,76:A,77:k,79:C,80:w},{35:92,75:81,76:A,77:k,79:C,80:w},{35:93,75:81,76:A,77:k,79:C,80:w},{35:94,75:81,76:A,77:k,79:C,80:w},{35:95,75:81,76:A,77:k,79:C,80:w},{35:96,75:81,76:A,77:k,79:C,80:w},{35:97,75:81,76:A,77:k,79:C,80:w},{35:98,75:81,76:A,77:k,79:C,80:w},{35:99,75:81,76:A,77:k,79:C,80:w},{35:100,75:81,76:A,77:k,79:C,80:w},{35:101,75:81,76:A,77:k,79:C,80:w},{35:102,75:81,76:A,77:k,79:C,80:w},{35:103,75:81,76:A,77:k,79:C,80:w},{35:104,75:81,76:A,77:k,79:C,80:w},e(T,[2,59]),{35:105,75:81,76:A,77:k,79:C,80:w},{35:106,75:81,76:A,77:k,79:C,80:w},{35:107,75:81,76:A,77:k,79:C,80:w},{35:108,75:81,76:A,77:k,79:C,80:w},{35:109,75:81,76:A,77:k,79:C,80:w},{35:110,75:81,76:A,77:k,79:C,80:w},{35:111,75:81,76:A,77:k,79:C,80:w},{35:112,75:81,76:A,77:k,79:C,80:w},{35:113,75:81,76:A,77:k,79:C,80:w},{35:114,75:81,76:A,77:k,79:C,80:w},{35:115,75:81,76:A,77:k,79:C,80:w},{20:116,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{12:[1,118],33:[1,117]},{35:119,75:81,76:A,77:k,79:C,80:w},{35:120,75:81,76:A,77:k,79:C,80:w},{35:121,75:81,76:A,77:k,79:C,80:w},{35:122,75:81,76:A,77:k,79:C,80:w},{35:123,75:81,76:A,77:k,79:C,80:w},{35:124,75:81,76:A,77:k,79:C,80:w},{35:125,75:81,76:A,77:k,79:C,80:w},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},e(Ct,[2,15]),e(Xt,[2,17],{21:22,19:130,22:t,23:s,24:o,26:l,28:r}),e(Ct,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:t,23:s,24:o,26:l,28:r,34:a,36:n,37:i,38:u,39:d,40:p,41:g,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt}),e(Ot,[2,21]),e(Ot,[2,22]),e(T,[2,39]),e(se,[2,71],{75:81,35:132,76:A,77:k,79:C,80:w}),e(Bt,[2,73]),{78:[1,133]},e(Bt,[2,75]),e(Bt,[2,76]),e(T,[2,40]),e(T,[2,41]),e(T,[2,42]),e(T,[2,43]),e(T,[2,44]),e(T,[2,45]),e(T,[2,46]),e(T,[2,47]),e(T,[2,48]),e(T,[2,49]),e(T,[2,50]),e(T,[2,51]),e(T,[2,52]),e(T,[2,53]),e(T,[2,54]),e(T,[2,55]),e(T,[2,56]),e(T,[2,57]),e(T,[2,58]),e(T,[2,60]),e(T,[2,61]),e(T,[2,62]),e(T,[2,63]),e(T,[2,64]),e(T,[2,65]),e(T,[2,66]),e(T,[2,67]),e(T,[2,68]),e(T,[2,69]),e(T,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},e(vt,[2,28]),e(vt,[2,29]),e(vt,[2,30]),e(vt,[2,31]),e(vt,[2,32]),e(vt,[2,33]),e(vt,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},e(Xt,[2,18]),e(Ct,[2,38]),e(se,[2,72]),e(Bt,[2,74]),e(T,[2,24]),e(T,[2,35]),e(Wt,[2,25]),e(Wt,[2,26],{12:[1,138]}),e(Wt,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:y(function(x,v){if(v.recoverable)this.trace(x);else{var E=new Error(x);throw E.hash=v,E}},"parseError"),parse:y(function(x){var v=this,E=[0],b=[],R=[null],h=[],Rt=this.table,f="",Et=0,re=0,ke=2,le=1,Ce=h.slice.call(arguments,1),D=Object.create(this.lexer),At={yy:{}};for(var Ht in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ht)&&(At.yy[Ht]=this.yy[Ht]);D.setInput(x,At.yy),At.yy.lexer=D,At.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var qt=D.yylloc;h.push(qt);var we=D.options&&D.options.ranges;typeof At.yy.parseError=="function"?this.parseError=At.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Te(L){E.length=E.length-2*L,R.length=R.length-L,h.length=h.length-L}y(Te,"popStack");function oe(){var L;return L=b.pop()||D.lex()||le,typeof L!="number"&&(L instanceof Array&&(b=L,L=b.pop()),L=v.symbols_[L]||L),L}y(oe,"lex");for(var I,kt,N,Gt,wt={},Mt,W,ce,Lt;;){if(kt=E[E.length-1],this.defaultActions[kt]?N=this.defaultActions[kt]:((I===null||typeof I>"u")&&(I=oe()),N=Rt[kt]&&Rt[kt][I]),typeof N>"u"||!N.length||!N[0]){var Kt="";Lt=[];for(Mt in Rt[kt])this.terminals_[Mt]&&Mt>ke&&Lt.push("'"+this.terminals_[Mt]+"'");D.showPosition?Kt="Parse error on line "+(Et+1)+`: +import{g as Oe,d as Re}from"./chunk-32BRIVSS-BM7i2tA8.js";import{s as Se,g as De,a as Pe,b as Be,_ as y,c as Dt,d as Nt,l as he,e as Ie,f as Me,h as Tt,i as pe,j as Le,w as Ne,k as Jt,m as ue}from"./mermaid.core-mH2pk-lc.js";import"./index-BIElaaEN.js";import"./_commonjsHelpers-CqkleIqs.js";var jt=(function(){var e=y(function(_t,x,v,E){for(v=v||{},E=_t.length;E--;v[_t[E]]=x);return v},"o"),t=[1,24],s=[1,25],o=[1,26],l=[1,27],r=[1,28],a=[1,63],n=[1,64],i=[1,65],u=[1,66],d=[1,67],p=[1,68],g=[1,69],m=[1,29],O=[1,30],S=[1,31],P=[1,32],M=[1,33],U=[1,34],H=[1,35],q=[1,36],G=[1,37],K=[1,38],J=[1,39],Z=[1,40],$=[1,41],tt=[1,42],et=[1,43],at=[1,44],it=[1,45],nt=[1,46],st=[1,47],rt=[1,48],lt=[1,50],ot=[1,51],ct=[1,52],ht=[1,53],ut=[1,54],dt=[1,55],ft=[1,56],pt=[1,57],yt=[1,58],gt=[1,59],bt=[1,60],Ct=[14,42],Xt=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Ot=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],A=[1,82],k=[1,83],C=[1,84],w=[1,85],T=[12,14,42],se=[12,14,33,42],Bt=[12,14,33,42,76,77,79,80],vt=[12,33],Wt=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Qt={trace:y(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:"error",6:"direction_tb",7:"direction_bt",8:"direction_rl",9:"direction_lr",11:"C4_CONTEXT",12:"NEWLINE",14:"EOF",15:"C4_CONTAINER",16:"C4_COMPONENT",17:"C4_DYNAMIC",18:"C4_DEPLOYMENT",22:"title",23:"accDescription",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"LBRACE",34:"ENTERPRISE_BOUNDARY",36:"SYSTEM_BOUNDARY",37:"BOUNDARY",38:"CONTAINER_BOUNDARY",39:"NODE",40:"NODE_L",41:"NODE_R",42:"RBRACE",44:"PERSON",45:"PERSON_EXT",46:"SYSTEM",47:"SYSTEM_DB",48:"SYSTEM_QUEUE",49:"SYSTEM_EXT",50:"SYSTEM_EXT_DB",51:"SYSTEM_EXT_QUEUE",52:"CONTAINER",53:"CONTAINER_DB",54:"CONTAINER_QUEUE",55:"CONTAINER_EXT",56:"CONTAINER_EXT_DB",57:"CONTAINER_EXT_QUEUE",58:"COMPONENT",59:"COMPONENT_DB",60:"COMPONENT_QUEUE",61:"COMPONENT_EXT",62:"COMPONENT_EXT_DB",63:"COMPONENT_EXT_QUEUE",64:"REL",65:"BIREL",66:"REL_U",67:"REL_D",68:"REL_L",69:"REL_R",70:"REL_B",71:"REL_INDEX",72:"UPDATE_EL_STYLE",73:"UPDATE_REL_STYLE",74:"UPDATE_LAYOUT_CONFIG",76:"STR",77:"STR_KEY",78:"STR_VALUE",79:"ATTRIBUTE",80:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:y(function(x,v,E,b,R,h,Rt){var f=h.length-1;switch(R){case 3:b.setDirection("TB");break;case 4:b.setDirection("BT");break;case 5:b.setDirection("RL");break;case 6:b.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:b.setC4Type(h[f-3]);break;case 19:b.setTitle(h[f].substring(6)),this.$=h[f].substring(6);break;case 20:b.setAccDescription(h[f].substring(15)),this.$=h[f].substring(15);break;case 21:this.$=h[f].trim(),b.setTitle(this.$);break;case 22:case 23:this.$=h[f].trim(),b.setAccDescription(this.$);break;case 28:h[f].splice(2,0,"ENTERPRISE"),b.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 29:h[f].splice(2,0,"SYSTEM"),b.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 30:b.addPersonOrSystemBoundary(...h[f]),this.$=h[f];break;case 31:h[f].splice(2,0,"CONTAINER"),b.addContainerBoundary(...h[f]),this.$=h[f];break;case 32:b.addDeploymentNode("node",...h[f]),this.$=h[f];break;case 33:b.addDeploymentNode("nodeL",...h[f]),this.$=h[f];break;case 34:b.addDeploymentNode("nodeR",...h[f]),this.$=h[f];break;case 35:b.popBoundaryParseStack();break;case 39:b.addPersonOrSystem("person",...h[f]),this.$=h[f];break;case 40:b.addPersonOrSystem("external_person",...h[f]),this.$=h[f];break;case 41:b.addPersonOrSystem("system",...h[f]),this.$=h[f];break;case 42:b.addPersonOrSystem("system_db",...h[f]),this.$=h[f];break;case 43:b.addPersonOrSystem("system_queue",...h[f]),this.$=h[f];break;case 44:b.addPersonOrSystem("external_system",...h[f]),this.$=h[f];break;case 45:b.addPersonOrSystem("external_system_db",...h[f]),this.$=h[f];break;case 46:b.addPersonOrSystem("external_system_queue",...h[f]),this.$=h[f];break;case 47:b.addContainer("container",...h[f]),this.$=h[f];break;case 48:b.addContainer("container_db",...h[f]),this.$=h[f];break;case 49:b.addContainer("container_queue",...h[f]),this.$=h[f];break;case 50:b.addContainer("external_container",...h[f]),this.$=h[f];break;case 51:b.addContainer("external_container_db",...h[f]),this.$=h[f];break;case 52:b.addContainer("external_container_queue",...h[f]),this.$=h[f];break;case 53:b.addComponent("component",...h[f]),this.$=h[f];break;case 54:b.addComponent("component_db",...h[f]),this.$=h[f];break;case 55:b.addComponent("component_queue",...h[f]),this.$=h[f];break;case 56:b.addComponent("external_component",...h[f]),this.$=h[f];break;case 57:b.addComponent("external_component_db",...h[f]),this.$=h[f];break;case 58:b.addComponent("external_component_queue",...h[f]),this.$=h[f];break;case 60:b.addRel("rel",...h[f]),this.$=h[f];break;case 61:b.addRel("birel",...h[f]),this.$=h[f];break;case 62:b.addRel("rel_u",...h[f]),this.$=h[f];break;case 63:b.addRel("rel_d",...h[f]),this.$=h[f];break;case 64:b.addRel("rel_l",...h[f]),this.$=h[f];break;case 65:b.addRel("rel_r",...h[f]),this.$=h[f];break;case 66:b.addRel("rel_b",...h[f]),this.$=h[f];break;case 67:h[f].splice(0,1),b.addRel("rel",...h[f]),this.$=h[f];break;case 68:b.updateElStyle("update_el_style",...h[f]),this.$=h[f];break;case 69:b.updateRelStyle("update_rel_style",...h[f]),this.$=h[f];break;case 70:b.updateLayoutConfig("update_layout_config",...h[f]),this.$=h[f];break;case 71:this.$=[h[f]];break;case 72:h[f].unshift(h[f-1]),this.$=h[f];break;case 73:case 75:this.$=h[f].trim();break;case 74:let Et={};Et[h[f-1].trim()]=h[f].trim(),this.$=Et;break;case 76:this.$="";break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:70,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:71,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:72,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{13:73,19:20,20:21,21:22,22:t,23:s,24:o,26:l,28:r,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{14:[1,74]},e(Ct,[2,13],{43:23,29:49,30:61,32:62,20:75,34:a,36:n,37:i,38:u,39:d,40:p,41:g,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt}),e(Ct,[2,14]),e(Xt,[2,16],{12:[1,76]}),e(Ct,[2,36],{12:[1,77]}),e(Ot,[2,19]),e(Ot,[2,20]),{25:[1,78]},{27:[1,79]},e(Ot,[2,23]),{35:80,75:81,76:A,77:k,79:C,80:w},{35:86,75:81,76:A,77:k,79:C,80:w},{35:87,75:81,76:A,77:k,79:C,80:w},{35:88,75:81,76:A,77:k,79:C,80:w},{35:89,75:81,76:A,77:k,79:C,80:w},{35:90,75:81,76:A,77:k,79:C,80:w},{35:91,75:81,76:A,77:k,79:C,80:w},{35:92,75:81,76:A,77:k,79:C,80:w},{35:93,75:81,76:A,77:k,79:C,80:w},{35:94,75:81,76:A,77:k,79:C,80:w},{35:95,75:81,76:A,77:k,79:C,80:w},{35:96,75:81,76:A,77:k,79:C,80:w},{35:97,75:81,76:A,77:k,79:C,80:w},{35:98,75:81,76:A,77:k,79:C,80:w},{35:99,75:81,76:A,77:k,79:C,80:w},{35:100,75:81,76:A,77:k,79:C,80:w},{35:101,75:81,76:A,77:k,79:C,80:w},{35:102,75:81,76:A,77:k,79:C,80:w},{35:103,75:81,76:A,77:k,79:C,80:w},{35:104,75:81,76:A,77:k,79:C,80:w},e(T,[2,59]),{35:105,75:81,76:A,77:k,79:C,80:w},{35:106,75:81,76:A,77:k,79:C,80:w},{35:107,75:81,76:A,77:k,79:C,80:w},{35:108,75:81,76:A,77:k,79:C,80:w},{35:109,75:81,76:A,77:k,79:C,80:w},{35:110,75:81,76:A,77:k,79:C,80:w},{35:111,75:81,76:A,77:k,79:C,80:w},{35:112,75:81,76:A,77:k,79:C,80:w},{35:113,75:81,76:A,77:k,79:C,80:w},{35:114,75:81,76:A,77:k,79:C,80:w},{35:115,75:81,76:A,77:k,79:C,80:w},{20:116,29:49,30:61,32:62,34:a,36:n,37:i,38:u,39:d,40:p,41:g,43:23,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt},{12:[1,118],33:[1,117]},{35:119,75:81,76:A,77:k,79:C,80:w},{35:120,75:81,76:A,77:k,79:C,80:w},{35:121,75:81,76:A,77:k,79:C,80:w},{35:122,75:81,76:A,77:k,79:C,80:w},{35:123,75:81,76:A,77:k,79:C,80:w},{35:124,75:81,76:A,77:k,79:C,80:w},{35:125,75:81,76:A,77:k,79:C,80:w},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},e(Ct,[2,15]),e(Xt,[2,17],{21:22,19:130,22:t,23:s,24:o,26:l,28:r}),e(Ct,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:t,23:s,24:o,26:l,28:r,34:a,36:n,37:i,38:u,39:d,40:p,41:g,44:m,45:O,46:S,47:P,48:M,49:U,50:H,51:q,52:G,53:K,54:J,55:Z,56:$,57:tt,58:et,59:at,60:it,61:nt,62:st,63:rt,64:lt,65:ot,66:ct,67:ht,68:ut,69:dt,70:ft,71:pt,72:yt,73:gt,74:bt}),e(Ot,[2,21]),e(Ot,[2,22]),e(T,[2,39]),e(se,[2,71],{75:81,35:132,76:A,77:k,79:C,80:w}),e(Bt,[2,73]),{78:[1,133]},e(Bt,[2,75]),e(Bt,[2,76]),e(T,[2,40]),e(T,[2,41]),e(T,[2,42]),e(T,[2,43]),e(T,[2,44]),e(T,[2,45]),e(T,[2,46]),e(T,[2,47]),e(T,[2,48]),e(T,[2,49]),e(T,[2,50]),e(T,[2,51]),e(T,[2,52]),e(T,[2,53]),e(T,[2,54]),e(T,[2,55]),e(T,[2,56]),e(T,[2,57]),e(T,[2,58]),e(T,[2,60]),e(T,[2,61]),e(T,[2,62]),e(T,[2,63]),e(T,[2,64]),e(T,[2,65]),e(T,[2,66]),e(T,[2,67]),e(T,[2,68]),e(T,[2,69]),e(T,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},e(vt,[2,28]),e(vt,[2,29]),e(vt,[2,30]),e(vt,[2,31]),e(vt,[2,32]),e(vt,[2,33]),e(vt,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},e(Xt,[2,18]),e(Ct,[2,38]),e(se,[2,72]),e(Bt,[2,74]),e(T,[2,24]),e(T,[2,35]),e(Wt,[2,25]),e(Wt,[2,26],{12:[1,138]}),e(Wt,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:y(function(x,v){if(v.recoverable)this.trace(x);else{var E=new Error(x);throw E.hash=v,E}},"parseError"),parse:y(function(x){var v=this,E=[0],b=[],R=[null],h=[],Rt=this.table,f="",Et=0,re=0,ke=2,le=1,Ce=h.slice.call(arguments,1),D=Object.create(this.lexer),At={yy:{}};for(var Ht in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ht)&&(At.yy[Ht]=this.yy[Ht]);D.setInput(x,At.yy),At.yy.lexer=D,At.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var qt=D.yylloc;h.push(qt);var we=D.options&&D.options.ranges;typeof At.yy.parseError=="function"?this.parseError=At.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Te(L){E.length=E.length-2*L,R.length=R.length-L,h.length=h.length-L}y(Te,"popStack");function oe(){var L;return L=b.pop()||D.lex()||le,typeof L!="number"&&(L instanceof Array&&(b=L,L=b.pop()),L=v.symbols_[L]||L),L}y(oe,"lex");for(var I,kt,N,Gt,wt={},Mt,W,ce,Lt;;){if(kt=E[E.length-1],this.defaultActions[kt]?N=this.defaultActions[kt]:((I===null||typeof I>"u")&&(I=oe()),N=Rt[kt]&&Rt[kt][I]),typeof N>"u"||!N.length||!N[0]){var Kt="";Lt=[];for(Mt in Rt[kt])this.terminals_[Mt]&&Mt>ke&&Lt.push("'"+this.terminals_[Mt]+"'");D.showPosition?Kt="Parse error on line "+(Et+1)+`: `+D.showPosition()+` Expecting `+Lt.join(", ")+", got '"+(this.terminals_[I]||I)+"'":Kt="Parse error on line "+(Et+1)+": Unexpected "+(I==le?"end of input":"'"+(this.terminals_[I]||I)+"'"),this.parseError(Kt,{text:D.match,token:this.terminals_[I]||I,line:D.yylineno,loc:qt,expected:Lt})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+kt+", token: "+I);switch(N[0]){case 1:E.push(I),R.push(D.yytext),h.push(D.yylloc),E.push(N[1]),I=null,re=D.yyleng,f=D.yytext,Et=D.yylineno,qt=D.yylloc;break;case 2:if(W=this.productions_[N[1]][1],wt.$=R[R.length-W],wt._$={first_line:h[h.length-(W||1)].first_line,last_line:h[h.length-1].last_line,first_column:h[h.length-(W||1)].first_column,last_column:h[h.length-1].last_column},we&&(wt._$.range=[h[h.length-(W||1)].range[0],h[h.length-1].range[1]]),Gt=this.performAction.apply(wt,[f,re,Et,At.yy,N[1],R,h].concat(Ce)),typeof Gt<"u")return Gt;W&&(E=E.slice(0,-1*W*2),R=R.slice(0,-1*W),h=h.slice(0,-1*W)),E.push(this.productions_[N[1]][0]),R.push(wt.$),h.push(wt._$),ce=Rt[E[E.length-2]][E[E.length-1]],E.push(ce);break;case 3:return!0}}return!0},"parse")},Ae=(function(){var _t={EOF:1,parseError:y(function(v,E){if(this.yy.parser)this.yy.parser.parseError(v,E);else throw new Error(v)},"parseError"),setInput:y(function(x,v){return this.yy=v||this.yy||{},this._input=x,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:y(function(){var x=this._input[0];this.yytext+=x,this.yyleng++,this.offset++,this.match+=x,this.matched+=x;var v=x.match(/(?:\r\n?|\n).*/g);return v?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),x},"input"),unput:y(function(x){var v=x.length,E=x.split(/(?:\r\n?|\n)/g);this._input=x+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-v),this.offset-=v;var b=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),E.length-1&&(this.yylineno-=E.length-1);var R=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:E?(E.length===b.length?this.yylloc.first_column:0)+b[b.length-E.length].length-E[0].length:this.yylloc.first_column-v},this.options.ranges&&(this.yylloc.range=[R[0],R[0]+this.yyleng-v]),this.yyleng=this.yytext.length,this},"unput"),more:y(function(){return this._more=!0,this},"more"),reject:y(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:y(function(x){this.unput(this.match.slice(x))},"less"),pastInput:y(function(){var x=this.matched.substr(0,this.matched.length-this.match.length);return(x.length>20?"...":"")+x.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:y(function(){var x=this.match;return x.length<20&&(x+=this._input.substr(0,20-x.length)),(x.substr(0,20)+(x.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:y(function(){var x=this.pastInput(),v=new Array(x.length+1).join("-");return x+this.upcomingInput()+` diff --git a/apps/kimi-code/dist-web/assets/channel-8Bt6a0tz.js b/apps/kimi-code/dist-web/assets/channel-8Bt6a0tz.js deleted file mode 100644 index 40aeb804126..00000000000 --- a/apps/kimi-code/dist-web/assets/channel-8Bt6a0tz.js +++ /dev/null @@ -1 +0,0 @@ -import{U as a,O as n}from"./mermaid.core-WW7RuneT.js";const t=(r,o)=>a.lang.round(n.parse(r)[o]);export{t as c}; diff --git a/apps/kimi-code/dist-web/assets/channel-D-WAU0ZU.js b/apps/kimi-code/dist-web/assets/channel-D-WAU0ZU.js new file mode 100644 index 00000000000..bb42bdf3bfd --- /dev/null +++ b/apps/kimi-code/dist-web/assets/channel-D-WAU0ZU.js @@ -0,0 +1 @@ +import{U as a,O as n}from"./mermaid.core-mH2pk-lc.js";const t=(r,o)=>a.lang.round(n.parse(r)[o]);export{t as c}; diff --git a/apps/kimi-code/dist-web/assets/chunk-2Q5K7J3B-NzojNxDT.js b/apps/kimi-code/dist-web/assets/chunk-2Q5K7J3B-Ba9Nj6dt.js similarity index 67% rename from apps/kimi-code/dist-web/assets/chunk-2Q5K7J3B-NzojNxDT.js rename to apps/kimi-code/dist-web/assets/chunk-2Q5K7J3B-Ba9Nj6dt.js index 152d15d4229..50f18bb459a 100644 --- a/apps/kimi-code/dist-web/assets/chunk-2Q5K7J3B-NzojNxDT.js +++ b/apps/kimi-code/dist-web/assets/chunk-2Q5K7J3B-Ba9Nj6dt.js @@ -1 +1 @@ -import{_ as i}from"./mermaid.core-WW7RuneT.js";var r=class{constructor(t){this.init=t,this.records=this.init()}static{i(this,"ImperativeState")}reset(){this.records=this.init()}};export{r as I}; +import{_ as i}from"./mermaid.core-mH2pk-lc.js";var r=class{constructor(t){this.init=t,this.records=this.init()}static{i(this,"ImperativeState")}reset(){this.records=this.init()}};export{r as I}; diff --git a/apps/kimi-code/dist-web/assets/chunk-32BRIVSS-CRTrWqUr.js b/apps/kimi-code/dist-web/assets/chunk-32BRIVSS-BM7i2tA8.js similarity index 96% rename from apps/kimi-code/dist-web/assets/chunk-32BRIVSS-CRTrWqUr.js rename to apps/kimi-code/dist-web/assets/chunk-32BRIVSS-BM7i2tA8.js index 15d85f94f25..57781875a72 100644 --- a/apps/kimi-code/dist-web/assets/chunk-32BRIVSS-CRTrWqUr.js +++ b/apps/kimi-code/dist-web/assets/chunk-32BRIVSS-BM7i2tA8.js @@ -1 +1 @@ -import{_ as i,d as l,N as d,j as o}from"./mermaid.core-WW7RuneT.js";var x=i((r,t)=>{const e=r.append("rect");if(e.attr("x",t.x),e.attr("y",t.y),e.attr("fill",t.fill),e.attr("stroke",t.stroke),e.attr("width",t.width),e.attr("height",t.height),t.name&&e.attr("name",t.name),t.rx&&e.attr("rx",t.rx),t.ry&&e.attr("ry",t.ry),t.attrs!==void 0)for(const s in t.attrs)e.attr(s,t.attrs[s]);return t.class&&e.attr("class",t.class),e},"drawRect"),p=i((r,t)=>{const e={x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,stroke:t.stroke,class:"rect"};x(r,e).lower()},"drawBackgroundRect"),y=i((r,t)=>{const e=t.text.replace(d," "),s=r.append("text");s.attr("x",t.x),s.attr("y",t.y),s.attr("class","legend"),s.style("text-anchor",t.anchor),t.class&&s.attr("class",t.class);const a=s.append("tspan");return a.attr("x",t.x+t.textMargin*2),a.text(e),s},"drawText"),m=i((r,t,e,s)=>{const a=r.append("image");a.attr("x",t),a.attr("y",e);const n=o.sanitizeUrl(s);a.attr("xlink:href",n)},"drawImage"),g=i((r,t,e,s)=>{const a=r.append("use");a.attr("x",t),a.attr("y",e);const n=o.sanitizeUrl(s);a.attr("xlink:href",`#${n}`)},"drawEmbeddedImage"),h=i(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),f=i(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),w=i(()=>{let r=l(".mermaidTooltip");return r.empty()&&(r=l("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100")),r},"createTooltip");export{p as a,f as b,g as c,x as d,m as e,w as f,h as g,y as h}; +import{_ as i,d as l,N as d,j as o}from"./mermaid.core-mH2pk-lc.js";var x=i((r,t)=>{const e=r.append("rect");if(e.attr("x",t.x),e.attr("y",t.y),e.attr("fill",t.fill),e.attr("stroke",t.stroke),e.attr("width",t.width),e.attr("height",t.height),t.name&&e.attr("name",t.name),t.rx&&e.attr("rx",t.rx),t.ry&&e.attr("ry",t.ry),t.attrs!==void 0)for(const s in t.attrs)e.attr(s,t.attrs[s]);return t.class&&e.attr("class",t.class),e},"drawRect"),p=i((r,t)=>{const e={x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,stroke:t.stroke,class:"rect"};x(r,e).lower()},"drawBackgroundRect"),y=i((r,t)=>{const e=t.text.replace(d," "),s=r.append("text");s.attr("x",t.x),s.attr("y",t.y),s.attr("class","legend"),s.style("text-anchor",t.anchor),t.class&&s.attr("class",t.class);const a=s.append("tspan");return a.attr("x",t.x+t.textMargin*2),a.text(e),s},"drawText"),m=i((r,t,e,s)=>{const a=r.append("image");a.attr("x",t),a.attr("y",e);const n=o.sanitizeUrl(s);a.attr("xlink:href",n)},"drawImage"),g=i((r,t,e,s)=>{const a=r.append("use");a.attr("x",t),a.attr("y",e);const n=o.sanitizeUrl(s);a.attr("xlink:href",`#${n}`)},"drawEmbeddedImage"),h=i(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),f=i(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),w=i(()=>{let r=l(".mermaidTooltip");return r.empty()&&(r=l("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100")),r},"createTooltip");export{p as a,f as b,g as c,x as d,m as e,w as f,h as g,y as h}; diff --git a/apps/kimi-code/dist-web/assets/chunk-5VM5RSS4-BJR-VYAu.js b/apps/kimi-code/dist-web/assets/chunk-5VM5RSS4-CRxkKkdS.js similarity index 83% rename from apps/kimi-code/dist-web/assets/chunk-5VM5RSS4-BJR-VYAu.js rename to apps/kimi-code/dist-web/assets/chunk-5VM5RSS4-CRxkKkdS.js index 2668fd1daea..e3b5b5cbe4e 100644 --- a/apps/kimi-code/dist-web/assets/chunk-5VM5RSS4-BJR-VYAu.js +++ b/apps/kimi-code/dist-web/assets/chunk-5VM5RSS4-CRxkKkdS.js @@ -1,4 +1,4 @@ -import{_ as e}from"./mermaid.core-WW7RuneT.js";var l=e(()=>` +import{_ as e}from"./mermaid.core-mH2pk-lc.js";var l=e(()=>` /* Font Awesome icon styling - consolidated */ .label-icon { display: inline-block; diff --git a/apps/kimi-code/dist-web/assets/chunk-EX3LRPZG-B-vU1qLF.js b/apps/kimi-code/dist-web/assets/chunk-EX3LRPZG-Z-6dLUyN.js similarity index 99% rename from apps/kimi-code/dist-web/assets/chunk-EX3LRPZG-B-vU1qLF.js rename to apps/kimi-code/dist-web/assets/chunk-EX3LRPZG-Z-6dLUyN.js index 19a0b216cad..59ef0ee3c0b 100644 --- a/apps/kimi-code/dist-web/assets/chunk-EX3LRPZG-B-vU1qLF.js +++ b/apps/kimi-code/dist-web/assets/chunk-EX3LRPZG-Z-6dLUyN.js @@ -1,4 +1,4 @@ -import{g as te}from"./chunk-XXDRQBXY-D_bv9kM4.js";import{s as ee}from"./chunk-VR4S4FIN-C_RujyXt.js";import{_ as f,l as _,c as $,v as se,x as ie,a as re,b as ae,g as ne,s as oe,n as le,o as ce,a9 as he,k as j,p as ue,d as bt,a5 as de}from"./mermaid.core-WW7RuneT.js";import{f as fe}from"./chunk-32BRIVSS-CRTrWqUr.js";var vt=(function(){var t=f(function(V,a,d,r){for(d=d||{},r=V.length;r--;d[V[r]]=a);return d},"o"),e=[1,2],o=[1,3],s=[1,4],c=[2,4],h=[1,9],p=[1,11],y=[1,16],n=[1,17],T=[1,18],m=[1,19],O=[1,33],x=[1,20],k=[1,21],u=[1,22],L=[1,23],I=[1,24],v=[1,26],F=[1,27],C=[1,28],P=[1,29],w=[1,30],H=[1,31],it=[1,32],rt=[1,35],at=[1,36],nt=[1,37],ot=[1,38],z=[1,34],S=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],lt=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],xt=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],yt={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"-->":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"-->",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"CLICK",39:"STRING",40:"HREF",41:"classDef",42:"CLASSDEF_ID",43:"CLASSDEF_STYLEOPTS",44:"DEFAULT",45:"style",46:"STYLE_IDS",47:"STYLEDEF_STYLEOPTS",48:"class",49:"CLASSENTITY_IDS",50:"STYLECLASS",51:"direction_tb",52:"direction_bt",53:"direction_rl",54:"direction_lr",56:";",57:"EDGE_STATE",58:"STYLE_SEPARATOR",59:"left_of",60:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:f(function(a,d,r,g,E,i,B){var l=i.length-1;switch(E){case 3:return g.setRootDoc(i[l]),i[l];case 4:this.$=[];break;case 5:i[l]!="nl"&&(i[l-1].push(i[l]),this.$=i[l-1]);break;case 6:case 7:this.$=i[l];break;case 8:this.$="nl";break;case 12:this.$=i[l];break;case 13:const Q=i[l-1];Q.description=g.trimColon(i[l]),this.$=Q;break;case 14:this.$={stmt:"relation",state1:i[l-2],state2:i[l]};break;case 15:const gt=g.trimColon(i[l]);this.$={stmt:"relation",state1:i[l-3],state2:i[l-1],description:gt};break;case 19:this.$={stmt:"state",id:i[l-3],type:"default",description:"",doc:i[l-1]};break;case 20:var Y=i[l],K=i[l-2].trim();if(i[l].match(":")){var ht=i[l].split(":");Y=ht[0],K=[K,ht[1]]}this.$={stmt:"state",id:Y,type:"default",description:K};break;case 21:this.$={stmt:"state",id:i[l-3],type:"default",description:i[l-5],doc:i[l-1]};break;case 22:this.$={stmt:"state",id:i[l],type:"fork"};break;case 23:this.$={stmt:"state",id:i[l],type:"join"};break;case 24:this.$={stmt:"state",id:i[l],type:"choice"};break;case 25:this.$={stmt:"state",id:g.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:i[l-1].trim(),note:{position:i[l-2].trim(),text:i[l].trim()}};break;case 29:this.$=i[l].trim(),g.setAccTitle(this.$);break;case 30:case 31:this.$=i[l].trim(),g.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:i[l-3],url:i[l-2],tooltip:i[l-1]};break;case 33:this.$={stmt:"click",id:i[l-3],url:i[l-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:i[l-1].trim(),classes:i[l].trim()};break;case 36:this.$={stmt:"style",id:i[l-1].trim(),styleClass:i[l].trim()};break;case 37:this.$={stmt:"applyClass",id:i[l-1].trim(),styleClass:i[l].trim()};break;case 38:g.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:g.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:g.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:g.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:i[l].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:i[l-2].trim(),classes:[i[l].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:i[l-2].trim(),classes:[i[l].trim()],type:"default",description:""};break}},"anonymous"),table:[{3:1,4:e,5:o,6:s},{1:[3]},{3:5,4:e,5:o,6:s},{3:6,4:e,5:o,6:s},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],c,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:h,5:p,8:8,9:10,10:12,11:13,12:14,13:15,16:y,17:n,19:T,22:m,24:O,25:x,26:k,27:u,28:L,29:I,32:25,33:v,35:F,37:C,38:P,41:w,45:H,48:it,51:rt,52:at,53:nt,54:ot,57:z},t(S,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:y,17:n,19:T,22:m,24:O,25:x,26:k,27:u,28:L,29:I,32:25,33:v,35:F,37:C,38:P,41:w,45:H,48:it,51:rt,52:at,53:nt,54:ot,57:z},t(S,[2,7]),t(S,[2,8]),t(S,[2,9]),t(S,[2,10]),t(S,[2,11]),t(S,[2,12],{14:[1,40],15:[1,41]}),t(S,[2,16]),{18:[1,42]},t(S,[2,18],{20:[1,43]}),{23:[1,44]},t(S,[2,22]),t(S,[2,23]),t(S,[2,24]),t(S,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(S,[2,28]),{34:[1,49]},{36:[1,50]},t(S,[2,31]),{13:51,24:O,57:z},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(lt,[2,44],{58:[1,56]}),t(lt,[2,45],{58:[1,57]}),t(S,[2,38]),t(S,[2,39]),t(S,[2,40]),t(S,[2,41]),t(S,[2,6]),t(S,[2,13]),{13:58,24:O,57:z},t(S,[2,17]),t(xt,c,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(S,[2,29]),t(S,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},t(S,[2,14],{14:[1,71]}),{4:h,5:p,8:8,9:10,10:12,11:13,12:14,13:15,16:y,17:n,19:T,21:[1,72],22:m,24:O,25:x,26:k,27:u,28:L,29:I,32:25,33:v,35:F,37:C,38:P,41:w,45:H,48:it,51:rt,52:at,53:nt,54:ot,57:z},t(S,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(S,[2,34]),t(S,[2,35]),t(S,[2,36]),t(S,[2,37]),t(lt,[2,46]),t(lt,[2,47]),t(S,[2,15]),t(S,[2,19]),t(xt,c,{7:78}),t(S,[2,26]),t(S,[2,27]),{5:[1,79]},{5:[1,80]},{4:h,5:p,8:8,9:10,10:12,11:13,12:14,13:15,16:y,17:n,19:T,21:[1,81],22:m,24:O,25:x,26:k,27:u,28:L,29:I,32:25,33:v,35:F,37:C,38:P,41:w,45:H,48:it,51:rt,52:at,53:nt,54:ot,57:z},t(S,[2,32]),t(S,[2,33]),t(S,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:f(function(a,d){if(d.recoverable)this.trace(a);else{var r=new Error(a);throw r.hash=d,r}},"parseError"),parse:f(function(a){var d=this,r=[0],g=[],E=[null],i=[],B=this.table,l="",Y=0,K=0,ht=2,Q=1,gt=i.slice.call(arguments,1),b=Object.create(this.lexer),U={yy:{}};for(var Tt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Tt)&&(U.yy[Tt]=this.yy[Tt]);b.setInput(a,U.yy),U.yy.lexer=b,U.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var Et=b.yylloc;i.push(Et);var Qt=b.options&&b.options.ranges;typeof U.yy.parseError=="function"?this.parseError=U.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Zt(N){r.length=r.length-2*N,E.length=E.length-N,i.length=i.length-N}f(Zt,"popStack");function Lt(){var N;return N=g.pop()||b.lex()||Q,typeof N!="number"&&(N instanceof Array&&(g=N,N=g.pop()),N=d.symbols_[N]||N),N}f(Lt,"lex");for(var A,W,R,_t,X={},ut,G,It,dt;;){if(W=r[r.length-1],this.defaultActions[W]?R=this.defaultActions[W]:((A===null||typeof A>"u")&&(A=Lt()),R=B[W]&&B[W][A]),typeof R>"u"||!R.length||!R[0]){var mt="";dt=[];for(ut in B[W])this.terminals_[ut]&&ut>ht&&dt.push("'"+this.terminals_[ut]+"'");b.showPosition?mt="Parse error on line "+(Y+1)+`: +import{g as te}from"./chunk-XXDRQBXY-Dc-6ZO6_.js";import{s as ee}from"./chunk-VR4S4FIN-Dwk6LZpd.js";import{_ as f,l as _,c as $,v as se,x as ie,a as re,b as ae,g as ne,s as oe,n as le,o as ce,a9 as he,k as j,p as ue,d as bt,a5 as de}from"./mermaid.core-mH2pk-lc.js";import{f as fe}from"./chunk-32BRIVSS-BM7i2tA8.js";var vt=(function(){var t=f(function(V,a,d,r){for(d=d||{},r=V.length;r--;d[V[r]]=a);return d},"o"),e=[1,2],o=[1,3],s=[1,4],c=[2,4],h=[1,9],p=[1,11],y=[1,16],n=[1,17],T=[1,18],m=[1,19],O=[1,33],x=[1,20],k=[1,21],u=[1,22],L=[1,23],I=[1,24],v=[1,26],F=[1,27],C=[1,28],P=[1,29],w=[1,30],H=[1,31],it=[1,32],rt=[1,35],at=[1,36],nt=[1,37],ot=[1,38],z=[1,34],S=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],lt=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],xt=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],yt={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"-->":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"-->",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"CLICK",39:"STRING",40:"HREF",41:"classDef",42:"CLASSDEF_ID",43:"CLASSDEF_STYLEOPTS",44:"DEFAULT",45:"style",46:"STYLE_IDS",47:"STYLEDEF_STYLEOPTS",48:"class",49:"CLASSENTITY_IDS",50:"STYLECLASS",51:"direction_tb",52:"direction_bt",53:"direction_rl",54:"direction_lr",56:";",57:"EDGE_STATE",58:"STYLE_SEPARATOR",59:"left_of",60:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:f(function(a,d,r,g,E,i,B){var l=i.length-1;switch(E){case 3:return g.setRootDoc(i[l]),i[l];case 4:this.$=[];break;case 5:i[l]!="nl"&&(i[l-1].push(i[l]),this.$=i[l-1]);break;case 6:case 7:this.$=i[l];break;case 8:this.$="nl";break;case 12:this.$=i[l];break;case 13:const Q=i[l-1];Q.description=g.trimColon(i[l]),this.$=Q;break;case 14:this.$={stmt:"relation",state1:i[l-2],state2:i[l]};break;case 15:const gt=g.trimColon(i[l]);this.$={stmt:"relation",state1:i[l-3],state2:i[l-1],description:gt};break;case 19:this.$={stmt:"state",id:i[l-3],type:"default",description:"",doc:i[l-1]};break;case 20:var Y=i[l],K=i[l-2].trim();if(i[l].match(":")){var ht=i[l].split(":");Y=ht[0],K=[K,ht[1]]}this.$={stmt:"state",id:Y,type:"default",description:K};break;case 21:this.$={stmt:"state",id:i[l-3],type:"default",description:i[l-5],doc:i[l-1]};break;case 22:this.$={stmt:"state",id:i[l],type:"fork"};break;case 23:this.$={stmt:"state",id:i[l],type:"join"};break;case 24:this.$={stmt:"state",id:i[l],type:"choice"};break;case 25:this.$={stmt:"state",id:g.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:i[l-1].trim(),note:{position:i[l-2].trim(),text:i[l].trim()}};break;case 29:this.$=i[l].trim(),g.setAccTitle(this.$);break;case 30:case 31:this.$=i[l].trim(),g.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:i[l-3],url:i[l-2],tooltip:i[l-1]};break;case 33:this.$={stmt:"click",id:i[l-3],url:i[l-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:i[l-1].trim(),classes:i[l].trim()};break;case 36:this.$={stmt:"style",id:i[l-1].trim(),styleClass:i[l].trim()};break;case 37:this.$={stmt:"applyClass",id:i[l-1].trim(),styleClass:i[l].trim()};break;case 38:g.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:g.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:g.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:g.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:i[l].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:i[l-2].trim(),classes:[i[l].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:i[l-2].trim(),classes:[i[l].trim()],type:"default",description:""};break}},"anonymous"),table:[{3:1,4:e,5:o,6:s},{1:[3]},{3:5,4:e,5:o,6:s},{3:6,4:e,5:o,6:s},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],c,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:h,5:p,8:8,9:10,10:12,11:13,12:14,13:15,16:y,17:n,19:T,22:m,24:O,25:x,26:k,27:u,28:L,29:I,32:25,33:v,35:F,37:C,38:P,41:w,45:H,48:it,51:rt,52:at,53:nt,54:ot,57:z},t(S,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:y,17:n,19:T,22:m,24:O,25:x,26:k,27:u,28:L,29:I,32:25,33:v,35:F,37:C,38:P,41:w,45:H,48:it,51:rt,52:at,53:nt,54:ot,57:z},t(S,[2,7]),t(S,[2,8]),t(S,[2,9]),t(S,[2,10]),t(S,[2,11]),t(S,[2,12],{14:[1,40],15:[1,41]}),t(S,[2,16]),{18:[1,42]},t(S,[2,18],{20:[1,43]}),{23:[1,44]},t(S,[2,22]),t(S,[2,23]),t(S,[2,24]),t(S,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(S,[2,28]),{34:[1,49]},{36:[1,50]},t(S,[2,31]),{13:51,24:O,57:z},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(lt,[2,44],{58:[1,56]}),t(lt,[2,45],{58:[1,57]}),t(S,[2,38]),t(S,[2,39]),t(S,[2,40]),t(S,[2,41]),t(S,[2,6]),t(S,[2,13]),{13:58,24:O,57:z},t(S,[2,17]),t(xt,c,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(S,[2,29]),t(S,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},t(S,[2,14],{14:[1,71]}),{4:h,5:p,8:8,9:10,10:12,11:13,12:14,13:15,16:y,17:n,19:T,21:[1,72],22:m,24:O,25:x,26:k,27:u,28:L,29:I,32:25,33:v,35:F,37:C,38:P,41:w,45:H,48:it,51:rt,52:at,53:nt,54:ot,57:z},t(S,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(S,[2,34]),t(S,[2,35]),t(S,[2,36]),t(S,[2,37]),t(lt,[2,46]),t(lt,[2,47]),t(S,[2,15]),t(S,[2,19]),t(xt,c,{7:78}),t(S,[2,26]),t(S,[2,27]),{5:[1,79]},{5:[1,80]},{4:h,5:p,8:8,9:10,10:12,11:13,12:14,13:15,16:y,17:n,19:T,21:[1,81],22:m,24:O,25:x,26:k,27:u,28:L,29:I,32:25,33:v,35:F,37:C,38:P,41:w,45:H,48:it,51:rt,52:at,53:nt,54:ot,57:z},t(S,[2,32]),t(S,[2,33]),t(S,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:f(function(a,d){if(d.recoverable)this.trace(a);else{var r=new Error(a);throw r.hash=d,r}},"parseError"),parse:f(function(a){var d=this,r=[0],g=[],E=[null],i=[],B=this.table,l="",Y=0,K=0,ht=2,Q=1,gt=i.slice.call(arguments,1),b=Object.create(this.lexer),U={yy:{}};for(var Tt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Tt)&&(U.yy[Tt]=this.yy[Tt]);b.setInput(a,U.yy),U.yy.lexer=b,U.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var Et=b.yylloc;i.push(Et);var Qt=b.options&&b.options.ranges;typeof U.yy.parseError=="function"?this.parseError=U.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Zt(N){r.length=r.length-2*N,E.length=E.length-N,i.length=i.length-N}f(Zt,"popStack");function Lt(){var N;return N=g.pop()||b.lex()||Q,typeof N!="number"&&(N instanceof Array&&(g=N,N=g.pop()),N=d.symbols_[N]||N),N}f(Lt,"lex");for(var A,W,R,_t,X={},ut,G,It,dt;;){if(W=r[r.length-1],this.defaultActions[W]?R=this.defaultActions[W]:((A===null||typeof A>"u")&&(A=Lt()),R=B[W]&&B[W][A]),typeof R>"u"||!R.length||!R[0]){var mt="";dt=[];for(ut in B[W])this.terminals_[ut]&&ut>ht&&dt.push("'"+this.terminals_[ut]+"'");b.showPosition?mt="Parse error on line "+(Y+1)+`: `+b.showPosition()+` Expecting `+dt.join(", ")+", got '"+(this.terminals_[A]||A)+"'":mt="Parse error on line "+(Y+1)+": Unexpected "+(A==Q?"end of input":"'"+(this.terminals_[A]||A)+"'"),this.parseError(mt,{text:b.match,token:this.terminals_[A]||A,line:b.yylineno,loc:Et,expected:dt})}if(R[0]instanceof Array&&R.length>1)throw new Error("Parse Error: multiple actions possible at state: "+W+", token: "+A);switch(R[0]){case 1:r.push(A),E.push(b.yytext),i.push(b.yylloc),r.push(R[1]),A=null,K=b.yyleng,l=b.yytext,Y=b.yylineno,Et=b.yylloc;break;case 2:if(G=this.productions_[R[1]][1],X.$=E[E.length-G],X._$={first_line:i[i.length-(G||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(G||1)].first_column,last_column:i[i.length-1].last_column},Qt&&(X._$.range=[i[i.length-(G||1)].range[0],i[i.length-1].range[1]]),_t=this.performAction.apply(X,[l,K,Y,U.yy,R[1],E,i].concat(gt)),typeof _t<"u")return _t;G&&(r=r.slice(0,-1*G*2),E=E.slice(0,-1*G),i=i.slice(0,-1*G)),r.push(this.productions_[R[1]][0]),E.push(X.$),i.push(X._$),It=B[r[r.length-2]][r[r.length-1]],r.push(It);break;case 3:return!0}}return!0},"parse")},qt=(function(){var V={EOF:1,parseError:f(function(d,r){if(this.yy.parser)this.yy.parser.parseError(d,r);else throw new Error(d)},"parseError"),setInput:f(function(a,d){return this.yy=d||this.yy||{},this._input=a,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:f(function(){var a=this._input[0];this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a;var d=a.match(/(?:\r\n?|\n).*/g);return d?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a},"input"),unput:f(function(a){var d=a.length,r=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-d),this.offset-=d;var g=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var E=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===g.length?this.yylloc.first_column:0)+g[g.length-r.length].length-r[0].length:this.yylloc.first_column-d},this.options.ranges&&(this.yylloc.range=[E[0],E[0]+this.yyleng-d]),this.yyleng=this.yytext.length,this},"unput"),more:f(function(){return this._more=!0,this},"more"),reject:f(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:f(function(a){this.unput(this.match.slice(a))},"less"),pastInput:f(function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:f(function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:f(function(){var a=this.pastInput(),d=new Array(a.length+1).join("-");return a+this.upcomingInput()+` diff --git a/apps/kimi-code/dist-web/assets/chunk-JWPE2WC7-BJMJfnyy.js b/apps/kimi-code/dist-web/assets/chunk-JWPE2WC7-CI-VQAzP.js similarity index 71% rename from apps/kimi-code/dist-web/assets/chunk-JWPE2WC7-BJMJfnyy.js rename to apps/kimi-code/dist-web/assets/chunk-JWPE2WC7-CI-VQAzP.js index b7b772f3ef7..961d0c9b32e 100644 --- a/apps/kimi-code/dist-web/assets/chunk-JWPE2WC7-BJMJfnyy.js +++ b/apps/kimi-code/dist-web/assets/chunk-JWPE2WC7-CI-VQAzP.js @@ -1 +1 @@ -import{_ as i}from"./mermaid.core-WW7RuneT.js";function t(c,e){c.accDescr&&e.setAccDescription?.(c.accDescr),c.accTitle&&e.setAccTitle?.(c.accTitle),c.title&&e.setDiagramTitle?.(c.title)}i(t,"populateCommonDb");export{t as p}; +import{_ as i}from"./mermaid.core-mH2pk-lc.js";function t(c,e){c.accDescr&&e.setAccDescription?.(c.accDescr),c.accTitle&&e.setAccTitle?.(c.accTitle),c.title&&e.setDiagramTitle?.(c.title)}i(t,"populateCommonDb");export{t as p}; diff --git a/apps/kimi-code/dist-web/assets/chunk-MOJQB5TN-DmVMZHwQ.js b/apps/kimi-code/dist-web/assets/chunk-MOJQB5TN-n_KgTrfq.js similarity index 99% rename from apps/kimi-code/dist-web/assets/chunk-MOJQB5TN-DmVMZHwQ.js rename to apps/kimi-code/dist-web/assets/chunk-MOJQB5TN-n_KgTrfq.js index fa350c5091c..3e68200fcff 100644 --- a/apps/kimi-code/dist-web/assets/chunk-MOJQB5TN-DmVMZHwQ.js +++ b/apps/kimi-code/dist-web/assets/chunk-MOJQB5TN-n_KgTrfq.js @@ -1,4 +1,4 @@ -import{_ as p,l as w,D as L,y as E,p as I,E as X,e as H,i as q,c as G}from"./mermaid.core-WW7RuneT.js";var z="",b="",N="",A=[],R=new Map,k=p(e=>q(e,G()),"sanitizeText"),F=p(e=>{switch(e.type){case"terminal":return{...e,value:k(e.value)};case"nonterminal":return{...e,name:k(e.name)};case"sequence":return{...e,elements:e.elements.map(F)};case"choice":return{...e,alternatives:e.alternatives.map(F)};case"optional":return{...e,element:F(e.element)};case"repetition":return{...e,element:F(e.element),separator:e.separator?F(e.separator):void 0};case"special":return{...e,text:k(e.text)}}},"sanitizeAstNode"),U=p(()=>{z="",b="",N="",A.length=0,R.clear(),I(),w.debug("[Railroad] Database cleared")},"clear"),_=p(e=>{z=k(e),w.debug("[Railroad] Title set:",e)},"setTitle"),W=p(()=>z,"getTitle"),j=p(e=>{const i={...e,name:k(e.name),definition:F(e.definition),comment:e.comment?k(e.comment):void 0};w.debug("[Railroad] Adding rule:",i.name),R.has(i.name)&&w.warn(`[Railroad] Rule '${i.name}' is already defined. Overwriting.`),A.push(i),R.set(i.name,i)},"addRule"),K=p(()=>A,"getRules"),J=p(e=>R.get(e),"getRule"),Q=p(e=>{b=k(e).replace(/^\s+/g,""),w.debug("[Railroad] Accessibility title set:",e)},"setAccTitle"),Z=p(()=>b,"getAccTitle"),V=p(e=>{N=k(e).replace(/\n\s+/g,` +import{_ as p,l as w,D as L,y as E,p as I,E as X,e as H,i as q,c as G}from"./mermaid.core-mH2pk-lc.js";var z="",b="",N="",A=[],R=new Map,k=p(e=>q(e,G()),"sanitizeText"),F=p(e=>{switch(e.type){case"terminal":return{...e,value:k(e.value)};case"nonterminal":return{...e,name:k(e.name)};case"sequence":return{...e,elements:e.elements.map(F)};case"choice":return{...e,alternatives:e.alternatives.map(F)};case"optional":return{...e,element:F(e.element)};case"repetition":return{...e,element:F(e.element),separator:e.separator?F(e.separator):void 0};case"special":return{...e,text:k(e.text)}}},"sanitizeAstNode"),U=p(()=>{z="",b="",N="",A.length=0,R.clear(),I(),w.debug("[Railroad] Database cleared")},"clear"),_=p(e=>{z=k(e),w.debug("[Railroad] Title set:",e)},"setTitle"),W=p(()=>z,"getTitle"),j=p(e=>{const i={...e,name:k(e.name),definition:F(e.definition),comment:e.comment?k(e.comment):void 0};w.debug("[Railroad] Adding rule:",i.name),R.has(i.name)&&w.warn(`[Railroad] Rule '${i.name}' is already defined. Overwriting.`),A.push(i),R.set(i.name,i)},"addRule"),K=p(()=>A,"getRules"),J=p(e=>R.get(e),"getRule"),Q=p(e=>{b=k(e).replace(/^\s+/g,""),w.debug("[Railroad] Accessibility title set:",e)},"setAccTitle"),Z=p(()=>b,"getAccTitle"),V=p(e=>{N=k(e).replace(/\n\s+/g,` `),w.debug("[Railroad] Accessibility description set:",e)},"setAccDescription"),ee=p(()=>N,"getAccDescription"),te=_,re=W,ie={clear:U,setTitle:_,getTitle:W,addRule:j,getRules:K,getRule:J,setAccTitle:Q,getAccTitle:Z,setAccDescription:V,getAccDescription:ee,setDiagramTitle:te,getDiagramTitle:re},g={compactMode:!1,padding:10,verticalSeparation:8,horizontalSeparation:10,arcRadius:10,fontSize:14,fontFamily:"monospace",terminalFill:"#FFFFC0",terminalStroke:"#000000",terminalTextColor:"#000000",nonTerminalFill:"#FFFFFF",nonTerminalStroke:"#000000",nonTerminalTextColor:"#000000",lineColor:"#000000",strokeWidth:2,markerFill:"#000000",commentFill:"#E8E8E8",commentStroke:"#888888",commentTextColor:"#666666",specialFill:"#F0E0FF",specialStroke:"#8800CC",ruleNameColor:"#000066",showMarkers:!0,markerRadius:5},ne=/^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$|^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\([\d\s%+,./-]+\)$|^[a-z]+$/i,ae=/^[\w "',.-]+$/,oe=new Set(["compactMode","padding","verticalSeparation","horizontalSeparation","arcRadius","fontSize","fontFamily","terminalFill","terminalStroke","terminalTextColor","nonTerminalFill","nonTerminalStroke","nonTerminalTextColor","lineColor","strokeWidth","markerFill","commentFill","commentStroke","commentTextColor","specialFill","specialStroke","ruleNameColor","showMarkers","markerRadius"]),B=p(e=>e?Object.keys(e).every(i=>i==="railroad"||oe.has(i)):!1,"isRailroadStyleOptions"),le=p(e=>e?"railroad"in e&&e.railroad?e.railroad:B(e)?e:{}:{},"extractRailroadOverrides"),se=p(e=>{if(!e||B(e))return{};const{railroad:i,svgId:a,theme:r,look:t,...n}=e;return n},"extractThemeOverrides"),m=p((e,i)=>{if(typeof e!="string")return i;const a=e.trim();return ne.test(a)?a:i},"sanitizeColorValue"),Y=p((e,i)=>{if(typeof e!="string")return i;const a=e.trim();return ae.test(a)?a:i},"sanitizeFontFamilyValue"),S=p((e,i)=>{const a=typeof e=="number"?e:typeof e=="string"?Number.parseFloat(e):Number.NaN;return Number.isFinite(a)&&a>=0?a:i},"sanitizeNumberValue"),de=p(e=>{const i=typeof e=="number"?e:typeof e=="string"?Number.parseFloat(e):Number.NaN;return Number.isFinite(i)&&i>0?i:void 0},"parseThemeFontSize"),ce=p(e=>{const i=Y(e.fontFamily,g.fontFamily),a=de(e.fontSize)??g.fontSize;return{...g,fontFamily:i,fontSize:a,terminalFill:m(e.secondBkg??e.secondaryColor,g.terminalFill),terminalStroke:m(e.secondaryBorderColor??e.lineColor,g.terminalStroke),terminalTextColor:m(e.secondaryTextColor??e.textColor,g.terminalTextColor),nonTerminalFill:m(e.mainBkg??e.background,g.nonTerminalFill),nonTerminalStroke:m(e.primaryBorderColor??e.lineColor,g.nonTerminalStroke),nonTerminalTextColor:m(e.primaryTextColor??e.textColor,g.nonTerminalTextColor),lineColor:m(e.lineColor,g.lineColor),markerFill:m(e.lineColor,g.markerFill),commentFill:m(e.labelBackground??e.tertiaryColor,g.commentFill),commentStroke:m(e.tertiaryBorderColor??e.lineColor,g.commentStroke),commentTextColor:m(e.tertiaryTextColor??e.textColor,g.commentTextColor),specialFill:m(e.tertiaryColor??e.secondaryColor,g.specialFill),specialStroke:m(e.tertiaryBorderColor??e.secondaryBorderColor,g.specialStroke),ruleNameColor:m(e.titleColor??e.textColor,g.ruleNameColor)}},"buildThemeDefaults"),M=p(e=>{const i=E(),a={...X(),...i.themeVariables??{},...se(e)},r=ce(a),t={...i.railroad??{},...le(e)};return{compactMode:t.compactMode??r.compactMode,padding:S(t.padding,r.padding),verticalSeparation:S(t.verticalSeparation,r.verticalSeparation),horizontalSeparation:S(t.horizontalSeparation,r.horizontalSeparation),arcRadius:S(t.arcRadius,r.arcRadius),fontSize:S(t.fontSize,r.fontSize),fontFamily:Y(t.fontFamily,r.fontFamily),terminalFill:m(t.terminalFill,r.terminalFill),terminalStroke:m(t.terminalStroke,r.terminalStroke),terminalTextColor:m(t.terminalTextColor,r.terminalTextColor),nonTerminalFill:m(t.nonTerminalFill,r.nonTerminalFill),nonTerminalStroke:m(t.nonTerminalStroke,r.nonTerminalStroke),nonTerminalTextColor:m(t.nonTerminalTextColor,r.nonTerminalTextColor),lineColor:m(t.lineColor,r.lineColor),strokeWidth:S(t.strokeWidth,r.strokeWidth),markerFill:m(t.markerFill,r.markerFill),commentFill:m(t.commentFill,r.commentFill),commentStroke:m(t.commentStroke,r.commentStroke),commentTextColor:m(t.commentTextColor,r.commentTextColor),specialFill:m(t.specialFill,r.specialFill),specialStroke:m(t.specialStroke,r.specialStroke),ruleNameColor:m(t.ruleNameColor,r.ruleNameColor),showMarkers:t.showMarkers??r.showMarkers,markerRadius:S(t.markerRadius,r.markerRadius)}},"buildRailroadStyleOptions"),ue=p(e=>{const{fontFamily:i,fontSize:a,terminalFill:r,terminalStroke:t,terminalTextColor:n,nonTerminalFill:h,nonTerminalStroke:s,nonTerminalTextColor:o,lineColor:u,strokeWidth:c,markerFill:d,commentFill:x,commentStroke:l,commentTextColor:f,specialFill:y,specialStroke:v,ruleNameColor:C}=M(e);return` .railroad-diagram { font-family: ${i}; diff --git a/apps/kimi-code/dist-web/assets/chunk-RYQCIY6F-LhAgalr3.js b/apps/kimi-code/dist-web/assets/chunk-RYQCIY6F-C-i4N3ne.js similarity index 99% rename from apps/kimi-code/dist-web/assets/chunk-RYQCIY6F-LhAgalr3.js rename to apps/kimi-code/dist-web/assets/chunk-RYQCIY6F-C-i4N3ne.js index e6179843264..8f8962869e5 100644 --- a/apps/kimi-code/dist-web/assets/chunk-RYQCIY6F-LhAgalr3.js +++ b/apps/kimi-code/dist-web/assets/chunk-RYQCIY6F-C-i4N3ne.js @@ -1 +1 @@ -import{_ as u,l as i}from"./mermaid.core-WW7RuneT.js";import{i as m,G as y}from"./graph-DOmOIIwC.js";import{b as _,m as X}from"./map-DxJ2ADlA.js";var j=4;function p(e){return _(e,j)}function C(e){var r={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:F(e),edges:M(e)};return m(e.graph())||(r.value=p(e.graph())),r}function F(e){return X(e.nodes(),function(r){var n=e.node(r),s=e.parent(r),t={v:r};return m(n)||(t.value=n),m(s)||(t.parent=s),t})}function M(e){return X(e.edges(),function(r){var n=e.edge(r),s={v:r.v,w:r.w};return m(r.name)||(s.name=r.name),m(n)||(s.value=n),s})}var c=new Map,w=new Map,A=new Map,J=u(()=>{w.clear(),A.clear(),c.clear()},"clear"),v=u((e,r)=>{const n=w.get(r)||[];return i.trace("In isDescendant",r," ",e," = ",n.includes(e)),n.includes(e)},"isDescendant"),R=u((e,r)=>{const n=w.get(r)||[];return i.info("Descendants of ",r," is ",n),i.info("Edge is ",e),e.v===r||e.w===r?!1:n?n.includes(e.v)||v(e.v,r)||v(e.w,r)||n.includes(e.w):(i.debug("Tilt, ",r,",not in descendants"),!1)},"edgeInCluster"),b=u((e,r,n,s)=>{i.warn("Copying children of ",e,"root",s,"data",r.node(e),s);const t=r.children(e)||[];e!==s&&t.push(e),i.warn("Copying (nodes) clusterId",e,"nodes",t),t.forEach(o=>{if(r.children(o).length>0)b(o,r,n,s);else{const l=r.node(o);i.info("cp ",o," to ",s," with parent ",e),n.setNode(o,l),s!==r.parent(o)&&(i.warn("Setting parent",o,r.parent(o)),n.setParent(o,r.parent(o))),e!==s&&o!==e?(i.debug("Setting parent",o,e),n.setParent(o,e)):(i.info("In copy ",e,"root",s,"data",r.node(e),s),i.debug("Not Setting parent for node=",o,"cluster!==rootId",e!==s,"node!==clusterId",o!==e));const f=r.edges(o);i.debug("Copying Edges",f),f.forEach(a=>{i.info("Edge",a);const d=r.edge(a.v,a.w,a.name);i.info("Edge data",d,s);try{if(R(a,s)){const g=w.get(s)||[],E=g.includes(a.v)||v(a.v,s)||a.v===s,x=g.includes(a.w)||v(a.w,s)||a.w===s;if(E&&x)i.info("Copying as ",a.v,a.w,d,a.name),n.setEdge(a.v,a.w,d,a.name),i.info("newGraph edges ",n.edges(),n.edge(n.edges()[0]));else{const N=E?s:a.v,h=x?s:a.w;i.info("Rebinding cross-boundary edge as ",N,h,d,a.name),r.setEdge(N,h,d,a.name)}}else i.info("Skipping copy of edge ",a.v,"-->",a.w," rootId: ",s," clusterId:",e)}catch(g){i.error(g)}})}i.debug("Removing node",o),r.removeNode(o)})},"copy"),O=u((e,r)=>{const n=r.children(e);let s=[...n];for(const t of n)A.set(t,e),s=[...s,...O(t,r)];return s},"extractDescendants"),P=u((e,r,n)=>{const s=e.edges().filter(a=>a.v===r||a.w===r),t=e.edges().filter(a=>a.v===n||a.w===n),o=s.map(a=>({v:a.v===r?n:a.v,w:a.w===r?r:a.w})),l=t.map(a=>({v:a.v,w:a.w}));return o.filter(a=>l.some(d=>a.v===d.v&&a.w===d.w))},"findCommonEdges"),D=u((e,r,n)=>{const s=r.children(e);if(i.trace("Searching children of id ",e,s),s.length<1)return e;let t;for(const o of s){const l=D(o,r,n),f=P(r,n,l);if(l)if(f.length>0)t=l;else return l}return t},"findNonClusterChild"),S=u(e=>!c.has(e)||!c.get(e).externalConnections?e:c.has(e)?c.get(e).id:e,"getAnchorId"),U=u((e,r)=>{if(!e||r>10){i.debug("Opting out, no graph ");return}else i.debug("Opting in, graph ");e.nodes().forEach(function(n){e.children(n).length>0&&(i.warn("Cluster identified",n," Replacement id in edges: ",D(n,e,n)),w.set(n,O(n,e)),c.set(n,{id:D(n,e,n),clusterData:e.node(n)}))}),e.nodes().forEach(function(n){const s=e.children(n),t=e.edges();s.length>0?(i.debug("Cluster identified",n,w),t.forEach(o=>{const l=v(o.v,n),f=v(o.w,n);l^f&&(i.warn("Edge: ",o," leaves cluster ",n),i.warn("Descendants of XXX ",n,": ",w.get(n)),c.get(n).externalConnections=!0)})):i.debug("Not a cluster ",n,w)});for(let n of c.keys()){const s=c.get(n).id,t=e.parent(s);t!==n&&c.has(t)&&!c.get(t).externalConnections&&(c.get(n).id=t);const o=e.edges().some(l=>l.v===n);if(s&&c.get(n)?.externalConnections&&o&&L(e,s,n)){const l=T(e,n,e.parent(s));l&&(c.get(n).id=l)}}e.edges().forEach(function(n){const s=e.edge(n);i.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),i.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(e.edge(n)));let t=n.v,o=n.w;if(i.warn("Fix XXX",c,"ids:",n.v,n.w,"Translating: ",c.get(n.v)," --- ",c.get(n.w)),c.get(n.v)||c.get(n.w)){if(i.warn("Fixing and trying - removing XXX",n.v,n.w,n.name),t=S(n.v),o=S(n.w),e.removeEdge(n.v,n.w,n.name),t!==n.v){const l=e.parent(t);c.get(l).externalConnections=!0,s.fromCluster=n.v}if(o!==n.w){const l=e.parent(o);c.get(l).externalConnections=!0,s.toCluster=n.w}i.warn("Fix Replacing with XXX",t,o,n.name),e.setEdge(t,o,s,n.name)}}),i.warn("Adjusted Graph",C(e)),k(e,0),i.trace(c)},"adjustClustersAndEdges"),k=u((e,r)=>{if(i.warn("extractor - ",r,C(e),e.children("D")),r>10){i.error("Bailing out");return}let n=e.nodes(),s=!1;for(const t of n){const o=e.children(t);s=s||o.length>0}if(!s){i.debug("Done, no node has children",e.nodes());return}i.debug("Nodes = ",n,r);for(const t of n)if(i.debug("Extracting node",t,c,c.has(t)&&!c.get(t).externalConnections,!e.parent(t),e.node(t),e.children("D")," Depth ",r),!c.has(t))i.debug("Not a cluster",t,r);else if(c.get(t)?.clusterData?.explicitDir&&e.children(t)&&e.children(t).length>0){i.warn("Cluster with explicit dir, creating subgraph for children",t,r);const o=c.get(t).clusterData.dir,l=new y({multigraph:!0,compound:!0}).setGraph({rankdir:o,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});b(t,e,l,t);const f=e.node(t)||{};e.setNode(t,{...f,clusterNode:!0,id:t,clusterData:c.get(t).clusterData,label:c.get(t).label,graph:l}),i.warn("Subgraph for cluster with explicit dir created:",t,C(l))}else if(!c.get(t).externalConnections&&e.children(t)&&e.children(t).length>0){i.warn("Cluster without external connections, without a parent and with children",t,r);let l=e.graph().rankdir==="TB"?"LR":"TB";c.get(t)?.clusterData?.dir&&(l=c.get(t).clusterData.dir,i.warn("Fixing dir",c.get(t).clusterData.dir,l));const f=new y({multigraph:!0,compound:!0}).setGraph({rankdir:l,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});b(t,e,f,t);const a=e.node(t)||{};e.setNode(t,{...a,clusterNode:!0,id:t,clusterData:c.get(t).clusterData,label:c.get(t).label,graph:f}),i.debug("Old graph after copy",C(e))}else i.warn("Cluster ** ",t," **not meeting the criteria !externalConnections:",!c.get(t).externalConnections," no parent: ",!e.parent(t)," children ",e.children(t)&&e.children(t).length>0,e.children("D"),r),i.debug(c);n=e.nodes(),i.warn("New list of nodes",n);for(const t of n){const o=e.node(t);i.warn(" Now next level",t,o),o?.clusterNode&&k(o.graph,r+1)}},"extractor"),B=u((e,r)=>{if(r.length===0)return[];let n=Object.assign([],r);return r.forEach(s=>{const t=e.children(s),o=B(e,t);n=[...n,...o]}),n},"sorter"),W=u(e=>B(e,e.children()),"sortNodesByHierarchy"),L=u((e,r,n)=>{let s=e.parent(r);for(;s&&s!==n;){const t=c.get(s);if(t&&!t.externalConnections)return!0;s=e.parent(s)}return!1},"isNodeInExtractableCluster"),T=u((e,r,n)=>{const s=e.children(r)??[];for(const t of s){if(t===n||v(t,n))continue;const o=D(t,e,r);if(o&&!L(e,o,r))return o}return null},"findSafeAnchorNode");export{U as a,c as b,J as c,D as f,W as s,C as w}; +import{_ as u,l as i}from"./mermaid.core-mH2pk-lc.js";import{i as m,G as y}from"./graph-DOmOIIwC.js";import{b as _,m as X}from"./map-DxJ2ADlA.js";var j=4;function p(e){return _(e,j)}function C(e){var r={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:F(e),edges:M(e)};return m(e.graph())||(r.value=p(e.graph())),r}function F(e){return X(e.nodes(),function(r){var n=e.node(r),s=e.parent(r),t={v:r};return m(n)||(t.value=n),m(s)||(t.parent=s),t})}function M(e){return X(e.edges(),function(r){var n=e.edge(r),s={v:r.v,w:r.w};return m(r.name)||(s.name=r.name),m(n)||(s.value=n),s})}var c=new Map,w=new Map,A=new Map,J=u(()=>{w.clear(),A.clear(),c.clear()},"clear"),v=u((e,r)=>{const n=w.get(r)||[];return i.trace("In isDescendant",r," ",e," = ",n.includes(e)),n.includes(e)},"isDescendant"),R=u((e,r)=>{const n=w.get(r)||[];return i.info("Descendants of ",r," is ",n),i.info("Edge is ",e),e.v===r||e.w===r?!1:n?n.includes(e.v)||v(e.v,r)||v(e.w,r)||n.includes(e.w):(i.debug("Tilt, ",r,",not in descendants"),!1)},"edgeInCluster"),b=u((e,r,n,s)=>{i.warn("Copying children of ",e,"root",s,"data",r.node(e),s);const t=r.children(e)||[];e!==s&&t.push(e),i.warn("Copying (nodes) clusterId",e,"nodes",t),t.forEach(o=>{if(r.children(o).length>0)b(o,r,n,s);else{const l=r.node(o);i.info("cp ",o," to ",s," with parent ",e),n.setNode(o,l),s!==r.parent(o)&&(i.warn("Setting parent",o,r.parent(o)),n.setParent(o,r.parent(o))),e!==s&&o!==e?(i.debug("Setting parent",o,e),n.setParent(o,e)):(i.info("In copy ",e,"root",s,"data",r.node(e),s),i.debug("Not Setting parent for node=",o,"cluster!==rootId",e!==s,"node!==clusterId",o!==e));const f=r.edges(o);i.debug("Copying Edges",f),f.forEach(a=>{i.info("Edge",a);const d=r.edge(a.v,a.w,a.name);i.info("Edge data",d,s);try{if(R(a,s)){const g=w.get(s)||[],E=g.includes(a.v)||v(a.v,s)||a.v===s,x=g.includes(a.w)||v(a.w,s)||a.w===s;if(E&&x)i.info("Copying as ",a.v,a.w,d,a.name),n.setEdge(a.v,a.w,d,a.name),i.info("newGraph edges ",n.edges(),n.edge(n.edges()[0]));else{const N=E?s:a.v,h=x?s:a.w;i.info("Rebinding cross-boundary edge as ",N,h,d,a.name),r.setEdge(N,h,d,a.name)}}else i.info("Skipping copy of edge ",a.v,"-->",a.w," rootId: ",s," clusterId:",e)}catch(g){i.error(g)}})}i.debug("Removing node",o),r.removeNode(o)})},"copy"),O=u((e,r)=>{const n=r.children(e);let s=[...n];for(const t of n)A.set(t,e),s=[...s,...O(t,r)];return s},"extractDescendants"),P=u((e,r,n)=>{const s=e.edges().filter(a=>a.v===r||a.w===r),t=e.edges().filter(a=>a.v===n||a.w===n),o=s.map(a=>({v:a.v===r?n:a.v,w:a.w===r?r:a.w})),l=t.map(a=>({v:a.v,w:a.w}));return o.filter(a=>l.some(d=>a.v===d.v&&a.w===d.w))},"findCommonEdges"),D=u((e,r,n)=>{const s=r.children(e);if(i.trace("Searching children of id ",e,s),s.length<1)return e;let t;for(const o of s){const l=D(o,r,n),f=P(r,n,l);if(l)if(f.length>0)t=l;else return l}return t},"findNonClusterChild"),S=u(e=>!c.has(e)||!c.get(e).externalConnections?e:c.has(e)?c.get(e).id:e,"getAnchorId"),U=u((e,r)=>{if(!e||r>10){i.debug("Opting out, no graph ");return}else i.debug("Opting in, graph ");e.nodes().forEach(function(n){e.children(n).length>0&&(i.warn("Cluster identified",n," Replacement id in edges: ",D(n,e,n)),w.set(n,O(n,e)),c.set(n,{id:D(n,e,n),clusterData:e.node(n)}))}),e.nodes().forEach(function(n){const s=e.children(n),t=e.edges();s.length>0?(i.debug("Cluster identified",n,w),t.forEach(o=>{const l=v(o.v,n),f=v(o.w,n);l^f&&(i.warn("Edge: ",o," leaves cluster ",n),i.warn("Descendants of XXX ",n,": ",w.get(n)),c.get(n).externalConnections=!0)})):i.debug("Not a cluster ",n,w)});for(let n of c.keys()){const s=c.get(n).id,t=e.parent(s);t!==n&&c.has(t)&&!c.get(t).externalConnections&&(c.get(n).id=t);const o=e.edges().some(l=>l.v===n);if(s&&c.get(n)?.externalConnections&&o&&L(e,s,n)){const l=T(e,n,e.parent(s));l&&(c.get(n).id=l)}}e.edges().forEach(function(n){const s=e.edge(n);i.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),i.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(e.edge(n)));let t=n.v,o=n.w;if(i.warn("Fix XXX",c,"ids:",n.v,n.w,"Translating: ",c.get(n.v)," --- ",c.get(n.w)),c.get(n.v)||c.get(n.w)){if(i.warn("Fixing and trying - removing XXX",n.v,n.w,n.name),t=S(n.v),o=S(n.w),e.removeEdge(n.v,n.w,n.name),t!==n.v){const l=e.parent(t);c.get(l).externalConnections=!0,s.fromCluster=n.v}if(o!==n.w){const l=e.parent(o);c.get(l).externalConnections=!0,s.toCluster=n.w}i.warn("Fix Replacing with XXX",t,o,n.name),e.setEdge(t,o,s,n.name)}}),i.warn("Adjusted Graph",C(e)),k(e,0),i.trace(c)},"adjustClustersAndEdges"),k=u((e,r)=>{if(i.warn("extractor - ",r,C(e),e.children("D")),r>10){i.error("Bailing out");return}let n=e.nodes(),s=!1;for(const t of n){const o=e.children(t);s=s||o.length>0}if(!s){i.debug("Done, no node has children",e.nodes());return}i.debug("Nodes = ",n,r);for(const t of n)if(i.debug("Extracting node",t,c,c.has(t)&&!c.get(t).externalConnections,!e.parent(t),e.node(t),e.children("D")," Depth ",r),!c.has(t))i.debug("Not a cluster",t,r);else if(c.get(t)?.clusterData?.explicitDir&&e.children(t)&&e.children(t).length>0){i.warn("Cluster with explicit dir, creating subgraph for children",t,r);const o=c.get(t).clusterData.dir,l=new y({multigraph:!0,compound:!0}).setGraph({rankdir:o,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});b(t,e,l,t);const f=e.node(t)||{};e.setNode(t,{...f,clusterNode:!0,id:t,clusterData:c.get(t).clusterData,label:c.get(t).label,graph:l}),i.warn("Subgraph for cluster with explicit dir created:",t,C(l))}else if(!c.get(t).externalConnections&&e.children(t)&&e.children(t).length>0){i.warn("Cluster without external connections, without a parent and with children",t,r);let l=e.graph().rankdir==="TB"?"LR":"TB";c.get(t)?.clusterData?.dir&&(l=c.get(t).clusterData.dir,i.warn("Fixing dir",c.get(t).clusterData.dir,l));const f=new y({multigraph:!0,compound:!0}).setGraph({rankdir:l,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});b(t,e,f,t);const a=e.node(t)||{};e.setNode(t,{...a,clusterNode:!0,id:t,clusterData:c.get(t).clusterData,label:c.get(t).label,graph:f}),i.debug("Old graph after copy",C(e))}else i.warn("Cluster ** ",t," **not meeting the criteria !externalConnections:",!c.get(t).externalConnections," no parent: ",!e.parent(t)," children ",e.children(t)&&e.children(t).length>0,e.children("D"),r),i.debug(c);n=e.nodes(),i.warn("New list of nodes",n);for(const t of n){const o=e.node(t);i.warn(" Now next level",t,o),o?.clusterNode&&k(o.graph,r+1)}},"extractor"),B=u((e,r)=>{if(r.length===0)return[];let n=Object.assign([],r);return r.forEach(s=>{const t=e.children(s),o=B(e,t);n=[...n,...o]}),n},"sorter"),W=u(e=>B(e,e.children()),"sortNodesByHierarchy"),L=u((e,r,n)=>{let s=e.parent(r);for(;s&&s!==n;){const t=c.get(s);if(t&&!t.externalConnections)return!0;s=e.parent(s)}return!1},"isNodeInExtractableCluster"),T=u((e,r,n)=>{const s=e.children(r)??[];for(const t of s){if(t===n||v(t,n))continue;const o=D(t,e,r);if(o&&!L(e,o,r))return o}return null},"findSafeAnchorNode");export{U as a,c as b,J as c,D as f,W as s,C as w}; diff --git a/apps/kimi-code/dist-web/assets/chunk-V7JOEXUC-BBRs-W-z.js b/apps/kimi-code/dist-web/assets/chunk-V7JOEXUC--nWNNlQZ.js similarity index 99% rename from apps/kimi-code/dist-web/assets/chunk-V7JOEXUC-BBRs-W-z.js rename to apps/kimi-code/dist-web/assets/chunk-V7JOEXUC--nWNNlQZ.js index 4b425774cc5..caca2ea8f4b 100644 --- a/apps/kimi-code/dist-web/assets/chunk-V7JOEXUC-BBRs-W-z.js +++ b/apps/kimi-code/dist-web/assets/chunk-V7JOEXUC--nWNNlQZ.js @@ -1,4 +1,4 @@ -import{g as tt}from"./chunk-5VM5RSS4-BJR-VYAu.js";import{g as st}from"./chunk-XXDRQBXY-D_bv9kM4.js";import{s as it}from"./chunk-VR4S4FIN-C_RujyXt.js";import{_ as f,l as Ie,c as F,u as at,v as nt,x as Oe,d as de,a5 as rt,b as ut,a as lt,s as ct,g as ot,n as ht,o as dt,k as I,p as pt,q as At,i as ft,a6 as G}from"./mermaid.core-WW7RuneT.js";import{f as gt}from"./chunk-32BRIVSS-CRTrWqUr.js";var we=(function(){var t=f(function(O,o,h,p){for(h=h||{},p=O.length;p--;h[O[p]]=o);return h},"o"),i=[1,18],a=[1,19],n=[1,20],r=[1,41],c=[1,26],u=[1,42],d=[1,24],m=[1,25],g=[1,32],N=[1,33],Ae=[1,34],b=[1,45],fe=[1,35],ge=[1,36],me=[1,37],Ce=[1,38],be=[1,27],ke=[1,28],Ee=[1,29],Te=[1,30],ye=[1,31],k=[1,44],E=[1,46],T=[1,43],y=[1,47],De=[1,9],A=[1,8,9],Z=[1,58],$=[1,59],ee=[1,60],te=[1,61],se=[1,62],Fe=[1,63],Be=[1,64],_=[1,8,9,41],Pe=[1,77],M=[1,8,9,12,13,22,39,41,44,46,68,69,70,71,72,73,74,79,81],ie=[1,8,9,12,13,18,20,22,39,41,44,46,47,60,68,69,70,71,72,73,74,79,81,86,100,102,103],ae=[13,60,86,100,102,103],U=[13,60,73,74,86,100,102,103],Me=[13,60,68,69,70,71,72,86,100,102,103],ne=[1,103],z=[1,121],Y=[1,117],K=[1,113],W=[1,119],Q=[1,114],j=[1,115],X=[1,116],q=[1,118],H=[1,120],Re=[22,50,60,61,82,86,87,88,89,90],Ge=[1,128],re=[12,39],_e=[1,8,9,39,41,44,46],ue=[1,8,9,22],Ue=[1,153],ze=[1,8,9,61],x=[1,8,9,22,50,60,61,82,86,87,88,89,90],Se={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,statements:5,graphConfig:6,CLASS_DIAGRAM:7,NEWLINE:8,EOF:9,statement:10,classLabel:11,SQS:12,STR:13,SQE:14,namespaceName:15,alphaNumToken:16,classLiteralName:17,DOT:18,className:19,GENERICTYPE:20,relationStatement:21,LABEL:22,namespaceStatement:23,classStatement:24,memberStatement:25,annotationStatement:26,clickStatement:27,styleStatement:28,cssClassStatement:29,noteStatement:30,classDefStatement:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,namespaceIdentifier:38,STRUCT_START:39,classStatements:40,STRUCT_STOP:41,NAMESPACE:42,classIdentifier:43,STYLE_SEPARATOR:44,members:45,ANNOTATION_START:46,ANNOTATION_END:47,CLASS:48,emptyBody:49,SPACE:50,MEMBER:51,SEPARATOR:52,relation:53,NOTE_FOR:54,noteText:55,NOTE:56,CLASSDEF:57,classList:58,stylesOpt:59,ALPHA:60,COMMA:61,direction_tb:62,direction_bt:63,direction_rl:64,direction_lr:65,relationType:66,lineType:67,AGGREGATION:68,EXTENSION:69,COMPOSITION:70,DEPENDENCY:71,LOLLIPOP:72,LINE:73,DOTTED_LINE:74,CALLBACK:75,LINK:76,LINK_TARGET:77,CLICK:78,CALLBACK_NAME:79,CALLBACK_ARGS:80,HREF:81,STYLE:82,CSSCLASS:83,style:84,styleComponent:85,NUM:86,COLON:87,UNIT:88,BRKT:89,PCT:90,commentToken:91,textToken:92,graphCodeTokens:93,textNoTagsToken:94,TAGSTART:95,TAGEND:96,"==":97,"--":98,DEFAULT:99,MINUS:100,keywords:101,UNICODE_TEXT:102,BQUOTE_STR:103,$accept:0,$end:1},terminals_:{2:"error",7:"CLASS_DIAGRAM",8:"NEWLINE",9:"EOF",12:"SQS",13:"STR",14:"SQE",18:"DOT",20:"GENERICTYPE",22:"LABEL",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",39:"STRUCT_START",41:"STRUCT_STOP",42:"NAMESPACE",44:"STYLE_SEPARATOR",46:"ANNOTATION_START",47:"ANNOTATION_END",48:"CLASS",50:"SPACE",51:"MEMBER",52:"SEPARATOR",54:"NOTE_FOR",56:"NOTE",57:"CLASSDEF",60:"ALPHA",61:"COMMA",62:"direction_tb",63:"direction_bt",64:"direction_rl",65:"direction_lr",68:"AGGREGATION",69:"EXTENSION",70:"COMPOSITION",71:"DEPENDENCY",72:"LOLLIPOP",73:"LINE",74:"DOTTED_LINE",75:"CALLBACK",76:"LINK",77:"LINK_TARGET",78:"CLICK",79:"CALLBACK_NAME",80:"CALLBACK_ARGS",81:"HREF",82:"STYLE",83:"CSSCLASS",86:"NUM",87:"COLON",88:"UNIT",89:"BRKT",90:"PCT",93:"graphCodeTokens",95:"TAGSTART",96:"TAGEND",97:"==",98:"--",99:"DEFAULT",100:"MINUS",101:"keywords",102:"UNICODE_TEXT",103:"BQUOTE_STR"},productions_:[0,[3,1],[3,1],[4,1],[6,4],[5,1],[5,2],[5,3],[11,3],[15,1],[15,1],[15,3],[15,2],[19,1],[19,3],[19,1],[19,2],[19,2],[19,2],[10,1],[10,2],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[23,4],[23,5],[38,2],[38,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[24,1],[24,3],[24,4],[24,3],[24,6],[24,4],[24,7],[24,6],[43,2],[43,3],[49,0],[49,2],[49,2],[26,4],[45,1],[45,2],[25,1],[25,2],[25,1],[25,1],[21,3],[21,4],[21,4],[21,5],[30,3],[30,2],[31,3],[58,1],[58,3],[32,1],[32,1],[32,1],[32,1],[53,3],[53,2],[53,2],[53,1],[66,1],[66,1],[66,1],[66,1],[66,1],[67,1],[67,1],[27,3],[27,4],[27,3],[27,4],[27,4],[27,5],[27,3],[27,4],[27,4],[27,5],[27,4],[27,5],[27,5],[27,6],[28,3],[29,3],[59,1],[59,3],[84,1],[84,2],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[91,1],[91,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[94,1],[94,1],[94,1],[94,1],[16,1],[16,1],[16,1],[16,1],[17,1],[55,1]],performAction:f(function(o,h,p,l,C,e,J){var s=e.length-1;switch(C){case 8:this.$=e[s-1];break;case 9:case 10:case 13:case 15:this.$=e[s];break;case 11:case 14:this.$=e[s-2]+"."+e[s];break;case 12:case 16:this.$=e[s-1]+e[s];break;case 17:case 18:this.$=e[s-1]+"~"+e[s]+"~";break;case 19:l.addRelation(e[s]);break;case 20:e[s-1].title=l.cleanupLabel(e[s]),l.addRelation(e[s-1]);break;case 31:this.$=e[s].trim(),l.setAccTitle(this.$);break;case 32:case 33:this.$=e[s].trim(),l.setAccDescription(this.$);break;case 34:l.addClassesToNamespace(e[s-3],e[s-1][0],e[s-1][1]),l.popNamespace();break;case 35:l.addClassesToNamespace(e[s-4],e[s-1][0],e[s-1][1]),l.popNamespace();break;case 36:this.$=l.addNamespace(e[s]);break;case 37:this.$=l.addNamespace(e[s-1],e[s]);break;case 38:this.$=[[e[s]],[]];break;case 39:this.$=[[e[s-1]],[]];break;case 40:e[s][0].unshift(e[s-2]),this.$=e[s];break;case 41:this.$=[[],[e[s]]];break;case 42:this.$=[[],[e[s-1]]];break;case 43:e[s][1].unshift(e[s-2]),this.$=e[s];break;case 44:case 45:this.$=[[],[]];break;case 46:this.$=e[s];break;case 48:l.setCssClass(e[s-2],e[s]);break;case 49:l.addMembers(e[s-3],e[s-1]);break;case 51:l.setCssClass(e[s-5],e[s-3]),l.addMembers(e[s-5],e[s-1]);break;case 52:l.addAnnotation(e[s-3],e[s-1]);break;case 53:l.addAnnotation(e[s-6],e[s-4]),l.addMembers(e[s-6],e[s-1]);break;case 54:l.addAnnotation(e[s-5],e[s-3]);break;case 55:this.$=e[s],l.addClass(e[s]);break;case 56:this.$=e[s-1],l.addClass(e[s-1]),l.setClassLabel(e[s-1],e[s]);break;case 60:l.addAnnotation(e[s],e[s-2]);break;case 61:case 74:this.$=[e[s]];break;case 62:e[s].push(e[s-1]),this.$=e[s];break;case 63:break;case 64:l.addMember(e[s-1],l.cleanupLabel(e[s]));break;case 65:break;case 66:break;case 67:this.$={id1:e[s-2],id2:e[s],relation:e[s-1],relationTitle1:"none",relationTitle2:"none"};break;case 68:this.$={id1:e[s-3],id2:e[s],relation:e[s-1],relationTitle1:e[s-2],relationTitle2:"none"};break;case 69:this.$={id1:e[s-3],id2:e[s],relation:e[s-2],relationTitle1:"none",relationTitle2:e[s-1]};break;case 70:this.$={id1:e[s-4],id2:e[s],relation:e[s-2],relationTitle1:e[s-3],relationTitle2:e[s-1]};break;case 71:this.$=l.addNote(e[s],e[s-1]);break;case 72:this.$=l.addNote(e[s]);break;case 73:this.$=e[s-2],l.defineClass(e[s-1],e[s]);break;case 75:this.$=e[s-2].concat([e[s]]);break;case 76:l.setDirection("TB");break;case 77:l.setDirection("BT");break;case 78:l.setDirection("RL");break;case 79:l.setDirection("LR");break;case 80:this.$={type1:e[s-2],type2:e[s],lineType:e[s-1]};break;case 81:this.$={type1:"none",type2:e[s],lineType:e[s-1]};break;case 82:this.$={type1:e[s-1],type2:"none",lineType:e[s]};break;case 83:this.$={type1:"none",type2:"none",lineType:e[s]};break;case 84:this.$=l.relationType.AGGREGATION;break;case 85:this.$=l.relationType.EXTENSION;break;case 86:this.$=l.relationType.COMPOSITION;break;case 87:this.$=l.relationType.DEPENDENCY;break;case 88:this.$=l.relationType.LOLLIPOP;break;case 89:this.$=l.lineType.LINE;break;case 90:this.$=l.lineType.DOTTED_LINE;break;case 91:case 97:this.$=e[s-2],l.setClickEvent(e[s-1],e[s]);break;case 92:case 98:this.$=e[s-3],l.setClickEvent(e[s-2],e[s-1]),l.setTooltip(e[s-2],e[s]);break;case 93:this.$=e[s-2],l.setLink(e[s-1],e[s]);break;case 94:this.$=e[s-3],l.setLink(e[s-2],e[s-1],e[s]);break;case 95:this.$=e[s-3],l.setLink(e[s-2],e[s-1]),l.setTooltip(e[s-2],e[s]);break;case 96:this.$=e[s-4],l.setLink(e[s-3],e[s-2],e[s]),l.setTooltip(e[s-3],e[s-1]);break;case 99:this.$=e[s-3],l.setClickEvent(e[s-2],e[s-1],e[s]);break;case 100:this.$=e[s-4],l.setClickEvent(e[s-3],e[s-2],e[s-1]),l.setTooltip(e[s-3],e[s]);break;case 101:this.$=e[s-3],l.setLink(e[s-2],e[s]);break;case 102:this.$=e[s-4],l.setLink(e[s-3],e[s-1],e[s]);break;case 103:this.$=e[s-4],l.setLink(e[s-3],e[s-1]),l.setTooltip(e[s-3],e[s]);break;case 104:this.$=e[s-5],l.setLink(e[s-4],e[s-2],e[s]),l.setTooltip(e[s-4],e[s-1]);break;case 105:this.$=e[s-2],l.setCssStyle(e[s-1],e[s]);break;case 106:l.setCssClass(e[s-1],e[s]);break;case 107:this.$=[e[s]];break;case 108:e[s-2].push(e[s]),this.$=e[s-2];break;case 110:this.$=e[s-1]+e[s];break}},"anonymous"),table:[{3:1,4:2,5:3,6:4,7:[1,6],10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:i,35:a,37:n,38:22,42:r,43:23,46:c,48:u,51:d,52:m,54:g,56:N,57:Ae,60:b,62:fe,63:ge,64:me,65:Ce,75:be,76:ke,78:Ee,82:Te,83:ye,86:k,100:E,102:T,103:y},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},t(De,[2,5],{8:[1,48]}),{8:[1,49]},t(A,[2,19],{22:[1,50]}),t(A,[2,21]),t(A,[2,22]),t(A,[2,23]),t(A,[2,24]),t(A,[2,25]),t(A,[2,26]),t(A,[2,27]),t(A,[2,28]),t(A,[2,29]),t(A,[2,30]),{34:[1,51]},{36:[1,52]},t(A,[2,33]),t(A,[2,63],{53:53,66:56,67:57,13:[1,54],22:[1,55],68:Z,69:$,70:ee,71:te,72:se,73:Fe,74:Be}),{39:[1,65]},t(_,[2,47],{39:[1,67],44:[1,66],46:[1,68]}),t(A,[2,65]),t(A,[2,66]),{16:69,60:b,86:k,100:E,102:T},{16:39,17:40,19:70,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:71,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:72,60:b,86:k,100:E,102:T,103:y},{60:[1,73]},{13:[1,74]},{16:39,17:40,19:75,60:b,86:k,100:E,102:T,103:y},{13:Pe,55:76},{58:78,60:[1,79]},t(A,[2,76]),t(A,[2,77]),t(A,[2,78]),t(A,[2,79]),t(M,[2,13],{16:39,17:40,19:81,18:[1,80],20:[1,82],60:b,86:k,100:E,102:T,103:y}),t(M,[2,15],{20:[1,83]}),{15:84,16:85,17:86,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:87,60:b,86:k,100:E,102:T,103:y},t(ie,[2,133]),t(ie,[2,134]),t(ie,[2,135]),t(ie,[2,136]),t([1,8,9,12,13,20,22,39,41,44,46,68,69,70,71,72,73,74,79,81],[2,137]),t(De,[2,6],{10:5,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,19:21,38:22,43:23,16:39,17:40,5:88,33:i,35:a,37:n,42:r,46:c,48:u,51:d,52:m,54:g,56:N,57:Ae,60:b,62:fe,63:ge,64:me,65:Ce,75:be,76:ke,78:Ee,82:Te,83:ye,86:k,100:E,102:T,103:y}),{5:89,10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:i,35:a,37:n,38:22,42:r,43:23,46:c,48:u,51:d,52:m,54:g,56:N,57:Ae,60:b,62:fe,63:ge,64:me,65:Ce,75:be,76:ke,78:Ee,82:Te,83:ye,86:k,100:E,102:T,103:y},t(A,[2,20]),t(A,[2,31]),t(A,[2,32]),{13:[1,91],16:39,17:40,19:90,60:b,86:k,100:E,102:T,103:y},{53:92,66:56,67:57,68:Z,69:$,70:ee,71:te,72:se,73:Fe,74:Be},t(A,[2,64]),{67:93,73:Fe,74:Be},t(ae,[2,83],{66:94,68:Z,69:$,70:ee,71:te,72:se}),t(U,[2,84]),t(U,[2,85]),t(U,[2,86]),t(U,[2,87]),t(U,[2,88]),t(Me,[2,89]),t(Me,[2,90]),{8:[1,96],23:99,24:97,30:98,38:22,40:95,42:r,43:23,48:u,54:g,56:N},{16:100,60:b,86:k,100:E,102:T},{41:[1,102],45:101,51:ne},{16:104,60:b,86:k,100:E,102:T},{47:[1,105]},{13:[1,106]},{13:[1,107]},{79:[1,108],81:[1,109]},{22:z,50:Y,59:110,60:K,82:W,84:111,85:112,86:Q,87:j,88:X,89:q,90:H},{60:[1,122]},{13:Pe,55:123},t(_,[2,72]),t(_,[2,138]),{22:z,50:Y,59:124,60:K,61:[1,125],82:W,84:111,85:112,86:Q,87:j,88:X,89:q,90:H},t(Re,[2,74]),{16:39,17:40,19:126,60:b,86:k,100:E,102:T,103:y},t(M,[2,16]),t(M,[2,17]),t(M,[2,18]),{11:127,12:Ge,39:[2,36]},t(re,[2,9],{16:85,17:86,15:130,18:[1,129],60:b,86:k,100:E,102:T,103:y}),t(re,[2,10]),t(_e,[2,55],{11:131,12:Ge}),t(De,[2,7]),{9:[1,132]},t(ue,[2,67]),{16:39,17:40,19:133,60:b,86:k,100:E,102:T,103:y},{13:[1,135],16:39,17:40,19:134,60:b,86:k,100:E,102:T,103:y},t(ae,[2,82],{66:136,68:Z,69:$,70:ee,71:te,72:se}),t(ae,[2,81]),{41:[1,137]},{23:99,24:97,30:98,38:22,40:138,42:r,43:23,48:u,54:g,56:N},{8:[1,139],41:[2,38]},{8:[1,140],41:[2,41]},{8:[1,141],41:[2,44]},t(_,[2,48],{39:[1,142]}),{41:[1,143]},t(_,[2,50]),{41:[2,61],45:144,51:ne},{47:[1,145]},{16:39,17:40,19:146,60:b,86:k,100:E,102:T,103:y},t(A,[2,91],{13:[1,147]}),t(A,[2,93],{13:[1,149],77:[1,148]}),t(A,[2,97],{13:[1,150],80:[1,151]}),{13:[1,152]},t(A,[2,105],{61:Ue}),t(ze,[2,107],{85:154,22:z,50:Y,60:K,82:W,86:Q,87:j,88:X,89:q,90:H}),t(x,[2,109]),t(x,[2,111]),t(x,[2,112]),t(x,[2,113]),t(x,[2,114]),t(x,[2,115]),t(x,[2,116]),t(x,[2,117]),t(x,[2,118]),t(x,[2,119]),t(A,[2,106]),t(_,[2,71]),t(A,[2,73],{61:Ue}),{60:[1,155]},t(M,[2,14]),{39:[2,37]},{13:[1,156]},{15:157,16:85,17:86,60:b,86:k,100:E,102:T,103:y},t(re,[2,12]),t(_e,[2,56]),{1:[2,4]},t(ue,[2,69]),t(ue,[2,68]),{16:39,17:40,19:158,60:b,86:k,100:E,102:T,103:y},t(ae,[2,80]),t(_,[2,34]),{41:[1,159]},{23:99,24:97,30:98,38:22,40:160,41:[2,39],42:r,43:23,48:u,54:g,56:N},{23:99,24:97,30:98,38:22,40:161,41:[2,42],42:r,43:23,48:u,54:g,56:N},{23:99,24:97,30:98,38:22,40:162,41:[2,45],42:r,43:23,48:u,54:g,56:N},{45:163,51:ne},t(_,[2,49]),{41:[2,62]},t(_,[2,52],{39:[1,164]}),t(A,[2,60]),t(A,[2,92]),t(A,[2,94]),t(A,[2,95],{77:[1,165]}),t(A,[2,98]),t(A,[2,99],{13:[1,166]}),t(A,[2,101],{13:[1,168],77:[1,167]}),{22:z,50:Y,60:K,82:W,84:169,85:112,86:Q,87:j,88:X,89:q,90:H},t(x,[2,110]),t(Re,[2,75]),{14:[1,170]},t(re,[2,11]),t(ue,[2,70]),t(_,[2,35]),{41:[2,40]},{41:[2,43]},{41:[2,46]},{41:[1,171]},{41:[1,173],45:172,51:ne},t(A,[2,96]),t(A,[2,100]),t(A,[2,102]),t(A,[2,103],{77:[1,174]}),t(ze,[2,108],{85:154,22:z,50:Y,60:K,82:W,86:Q,87:j,88:X,89:q,90:H}),t(_e,[2,8]),t(_,[2,51]),{41:[1,175]},t(_,[2,54]),t(A,[2,104]),t(_,[2,53])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],127:[2,37],132:[2,4],144:[2,62],160:[2,40],161:[2,43],162:[2,46]},parseError:f(function(o,h){if(h.recoverable)this.trace(o);else{var p=new Error(o);throw p.hash=h,p}},"parseError"),parse:f(function(o){var h=this,p=[0],l=[],C=[null],e=[],J=this.table,s="",ce=0,Ye=0,Je=2,Ke=1,Ze=e.slice.call(arguments,1),D=Object.create(this.lexer),w={yy:{}};for(var Ne in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ne)&&(w.yy[Ne]=this.yy[Ne]);D.setInput(o,w.yy),w.yy.lexer=D,w.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var Le=D.yylloc;e.push(Le);var $e=D.options&&D.options.ranges;typeof w.yy.parseError=="function"?this.parseError=w.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function et(S){p.length=p.length-2*S,C.length=C.length-S,e.length=e.length-S}f(et,"popStack");function We(){var S;return S=l.pop()||D.lex()||Ke,typeof S!="number"&&(S instanceof Array&&(l=S,S=l.pop()),S=h.symbols_[S]||S),S}f(We,"lex");for(var B,V,L,xe,R={},oe,v,Qe,he;;){if(V=p[p.length-1],this.defaultActions[V]?L=this.defaultActions[V]:((B===null||typeof B>"u")&&(B=We()),L=J[V]&&J[V][B]),typeof L>"u"||!L.length||!L[0]){var ve="";he=[];for(oe in J[V])this.terminals_[oe]&&oe>Je&&he.push("'"+this.terminals_[oe]+"'");D.showPosition?ve="Parse error on line "+(ce+1)+`: +import{g as tt}from"./chunk-5VM5RSS4-CRxkKkdS.js";import{g as st}from"./chunk-XXDRQBXY-Dc-6ZO6_.js";import{s as it}from"./chunk-VR4S4FIN-Dwk6LZpd.js";import{_ as f,l as Ie,c as F,u as at,v as nt,x as Oe,d as de,a5 as rt,b as ut,a as lt,s as ct,g as ot,n as ht,o as dt,k as I,p as pt,q as At,i as ft,a6 as G}from"./mermaid.core-mH2pk-lc.js";import{f as gt}from"./chunk-32BRIVSS-BM7i2tA8.js";var we=(function(){var t=f(function(O,o,h,p){for(h=h||{},p=O.length;p--;h[O[p]]=o);return h},"o"),i=[1,18],a=[1,19],n=[1,20],r=[1,41],c=[1,26],u=[1,42],d=[1,24],m=[1,25],g=[1,32],N=[1,33],Ae=[1,34],b=[1,45],fe=[1,35],ge=[1,36],me=[1,37],Ce=[1,38],be=[1,27],ke=[1,28],Ee=[1,29],Te=[1,30],ye=[1,31],k=[1,44],E=[1,46],T=[1,43],y=[1,47],De=[1,9],A=[1,8,9],Z=[1,58],$=[1,59],ee=[1,60],te=[1,61],se=[1,62],Fe=[1,63],Be=[1,64],_=[1,8,9,41],Pe=[1,77],M=[1,8,9,12,13,22,39,41,44,46,68,69,70,71,72,73,74,79,81],ie=[1,8,9,12,13,18,20,22,39,41,44,46,47,60,68,69,70,71,72,73,74,79,81,86,100,102,103],ae=[13,60,86,100,102,103],U=[13,60,73,74,86,100,102,103],Me=[13,60,68,69,70,71,72,86,100,102,103],ne=[1,103],z=[1,121],Y=[1,117],K=[1,113],W=[1,119],Q=[1,114],j=[1,115],X=[1,116],q=[1,118],H=[1,120],Re=[22,50,60,61,82,86,87,88,89,90],Ge=[1,128],re=[12,39],_e=[1,8,9,39,41,44,46],ue=[1,8,9,22],Ue=[1,153],ze=[1,8,9,61],x=[1,8,9,22,50,60,61,82,86,87,88,89,90],Se={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,statements:5,graphConfig:6,CLASS_DIAGRAM:7,NEWLINE:8,EOF:9,statement:10,classLabel:11,SQS:12,STR:13,SQE:14,namespaceName:15,alphaNumToken:16,classLiteralName:17,DOT:18,className:19,GENERICTYPE:20,relationStatement:21,LABEL:22,namespaceStatement:23,classStatement:24,memberStatement:25,annotationStatement:26,clickStatement:27,styleStatement:28,cssClassStatement:29,noteStatement:30,classDefStatement:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,namespaceIdentifier:38,STRUCT_START:39,classStatements:40,STRUCT_STOP:41,NAMESPACE:42,classIdentifier:43,STYLE_SEPARATOR:44,members:45,ANNOTATION_START:46,ANNOTATION_END:47,CLASS:48,emptyBody:49,SPACE:50,MEMBER:51,SEPARATOR:52,relation:53,NOTE_FOR:54,noteText:55,NOTE:56,CLASSDEF:57,classList:58,stylesOpt:59,ALPHA:60,COMMA:61,direction_tb:62,direction_bt:63,direction_rl:64,direction_lr:65,relationType:66,lineType:67,AGGREGATION:68,EXTENSION:69,COMPOSITION:70,DEPENDENCY:71,LOLLIPOP:72,LINE:73,DOTTED_LINE:74,CALLBACK:75,LINK:76,LINK_TARGET:77,CLICK:78,CALLBACK_NAME:79,CALLBACK_ARGS:80,HREF:81,STYLE:82,CSSCLASS:83,style:84,styleComponent:85,NUM:86,COLON:87,UNIT:88,BRKT:89,PCT:90,commentToken:91,textToken:92,graphCodeTokens:93,textNoTagsToken:94,TAGSTART:95,TAGEND:96,"==":97,"--":98,DEFAULT:99,MINUS:100,keywords:101,UNICODE_TEXT:102,BQUOTE_STR:103,$accept:0,$end:1},terminals_:{2:"error",7:"CLASS_DIAGRAM",8:"NEWLINE",9:"EOF",12:"SQS",13:"STR",14:"SQE",18:"DOT",20:"GENERICTYPE",22:"LABEL",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",39:"STRUCT_START",41:"STRUCT_STOP",42:"NAMESPACE",44:"STYLE_SEPARATOR",46:"ANNOTATION_START",47:"ANNOTATION_END",48:"CLASS",50:"SPACE",51:"MEMBER",52:"SEPARATOR",54:"NOTE_FOR",56:"NOTE",57:"CLASSDEF",60:"ALPHA",61:"COMMA",62:"direction_tb",63:"direction_bt",64:"direction_rl",65:"direction_lr",68:"AGGREGATION",69:"EXTENSION",70:"COMPOSITION",71:"DEPENDENCY",72:"LOLLIPOP",73:"LINE",74:"DOTTED_LINE",75:"CALLBACK",76:"LINK",77:"LINK_TARGET",78:"CLICK",79:"CALLBACK_NAME",80:"CALLBACK_ARGS",81:"HREF",82:"STYLE",83:"CSSCLASS",86:"NUM",87:"COLON",88:"UNIT",89:"BRKT",90:"PCT",93:"graphCodeTokens",95:"TAGSTART",96:"TAGEND",97:"==",98:"--",99:"DEFAULT",100:"MINUS",101:"keywords",102:"UNICODE_TEXT",103:"BQUOTE_STR"},productions_:[0,[3,1],[3,1],[4,1],[6,4],[5,1],[5,2],[5,3],[11,3],[15,1],[15,1],[15,3],[15,2],[19,1],[19,3],[19,1],[19,2],[19,2],[19,2],[10,1],[10,2],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[23,4],[23,5],[38,2],[38,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[24,1],[24,3],[24,4],[24,3],[24,6],[24,4],[24,7],[24,6],[43,2],[43,3],[49,0],[49,2],[49,2],[26,4],[45,1],[45,2],[25,1],[25,2],[25,1],[25,1],[21,3],[21,4],[21,4],[21,5],[30,3],[30,2],[31,3],[58,1],[58,3],[32,1],[32,1],[32,1],[32,1],[53,3],[53,2],[53,2],[53,1],[66,1],[66,1],[66,1],[66,1],[66,1],[67,1],[67,1],[27,3],[27,4],[27,3],[27,4],[27,4],[27,5],[27,3],[27,4],[27,4],[27,5],[27,4],[27,5],[27,5],[27,6],[28,3],[29,3],[59,1],[59,3],[84,1],[84,2],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[91,1],[91,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[94,1],[94,1],[94,1],[94,1],[16,1],[16,1],[16,1],[16,1],[17,1],[55,1]],performAction:f(function(o,h,p,l,C,e,J){var s=e.length-1;switch(C){case 8:this.$=e[s-1];break;case 9:case 10:case 13:case 15:this.$=e[s];break;case 11:case 14:this.$=e[s-2]+"."+e[s];break;case 12:case 16:this.$=e[s-1]+e[s];break;case 17:case 18:this.$=e[s-1]+"~"+e[s]+"~";break;case 19:l.addRelation(e[s]);break;case 20:e[s-1].title=l.cleanupLabel(e[s]),l.addRelation(e[s-1]);break;case 31:this.$=e[s].trim(),l.setAccTitle(this.$);break;case 32:case 33:this.$=e[s].trim(),l.setAccDescription(this.$);break;case 34:l.addClassesToNamespace(e[s-3],e[s-1][0],e[s-1][1]),l.popNamespace();break;case 35:l.addClassesToNamespace(e[s-4],e[s-1][0],e[s-1][1]),l.popNamespace();break;case 36:this.$=l.addNamespace(e[s]);break;case 37:this.$=l.addNamespace(e[s-1],e[s]);break;case 38:this.$=[[e[s]],[]];break;case 39:this.$=[[e[s-1]],[]];break;case 40:e[s][0].unshift(e[s-2]),this.$=e[s];break;case 41:this.$=[[],[e[s]]];break;case 42:this.$=[[],[e[s-1]]];break;case 43:e[s][1].unshift(e[s-2]),this.$=e[s];break;case 44:case 45:this.$=[[],[]];break;case 46:this.$=e[s];break;case 48:l.setCssClass(e[s-2],e[s]);break;case 49:l.addMembers(e[s-3],e[s-1]);break;case 51:l.setCssClass(e[s-5],e[s-3]),l.addMembers(e[s-5],e[s-1]);break;case 52:l.addAnnotation(e[s-3],e[s-1]);break;case 53:l.addAnnotation(e[s-6],e[s-4]),l.addMembers(e[s-6],e[s-1]);break;case 54:l.addAnnotation(e[s-5],e[s-3]);break;case 55:this.$=e[s],l.addClass(e[s]);break;case 56:this.$=e[s-1],l.addClass(e[s-1]),l.setClassLabel(e[s-1],e[s]);break;case 60:l.addAnnotation(e[s],e[s-2]);break;case 61:case 74:this.$=[e[s]];break;case 62:e[s].push(e[s-1]),this.$=e[s];break;case 63:break;case 64:l.addMember(e[s-1],l.cleanupLabel(e[s]));break;case 65:break;case 66:break;case 67:this.$={id1:e[s-2],id2:e[s],relation:e[s-1],relationTitle1:"none",relationTitle2:"none"};break;case 68:this.$={id1:e[s-3],id2:e[s],relation:e[s-1],relationTitle1:e[s-2],relationTitle2:"none"};break;case 69:this.$={id1:e[s-3],id2:e[s],relation:e[s-2],relationTitle1:"none",relationTitle2:e[s-1]};break;case 70:this.$={id1:e[s-4],id2:e[s],relation:e[s-2],relationTitle1:e[s-3],relationTitle2:e[s-1]};break;case 71:this.$=l.addNote(e[s],e[s-1]);break;case 72:this.$=l.addNote(e[s]);break;case 73:this.$=e[s-2],l.defineClass(e[s-1],e[s]);break;case 75:this.$=e[s-2].concat([e[s]]);break;case 76:l.setDirection("TB");break;case 77:l.setDirection("BT");break;case 78:l.setDirection("RL");break;case 79:l.setDirection("LR");break;case 80:this.$={type1:e[s-2],type2:e[s],lineType:e[s-1]};break;case 81:this.$={type1:"none",type2:e[s],lineType:e[s-1]};break;case 82:this.$={type1:e[s-1],type2:"none",lineType:e[s]};break;case 83:this.$={type1:"none",type2:"none",lineType:e[s]};break;case 84:this.$=l.relationType.AGGREGATION;break;case 85:this.$=l.relationType.EXTENSION;break;case 86:this.$=l.relationType.COMPOSITION;break;case 87:this.$=l.relationType.DEPENDENCY;break;case 88:this.$=l.relationType.LOLLIPOP;break;case 89:this.$=l.lineType.LINE;break;case 90:this.$=l.lineType.DOTTED_LINE;break;case 91:case 97:this.$=e[s-2],l.setClickEvent(e[s-1],e[s]);break;case 92:case 98:this.$=e[s-3],l.setClickEvent(e[s-2],e[s-1]),l.setTooltip(e[s-2],e[s]);break;case 93:this.$=e[s-2],l.setLink(e[s-1],e[s]);break;case 94:this.$=e[s-3],l.setLink(e[s-2],e[s-1],e[s]);break;case 95:this.$=e[s-3],l.setLink(e[s-2],e[s-1]),l.setTooltip(e[s-2],e[s]);break;case 96:this.$=e[s-4],l.setLink(e[s-3],e[s-2],e[s]),l.setTooltip(e[s-3],e[s-1]);break;case 99:this.$=e[s-3],l.setClickEvent(e[s-2],e[s-1],e[s]);break;case 100:this.$=e[s-4],l.setClickEvent(e[s-3],e[s-2],e[s-1]),l.setTooltip(e[s-3],e[s]);break;case 101:this.$=e[s-3],l.setLink(e[s-2],e[s]);break;case 102:this.$=e[s-4],l.setLink(e[s-3],e[s-1],e[s]);break;case 103:this.$=e[s-4],l.setLink(e[s-3],e[s-1]),l.setTooltip(e[s-3],e[s]);break;case 104:this.$=e[s-5],l.setLink(e[s-4],e[s-2],e[s]),l.setTooltip(e[s-4],e[s-1]);break;case 105:this.$=e[s-2],l.setCssStyle(e[s-1],e[s]);break;case 106:l.setCssClass(e[s-1],e[s]);break;case 107:this.$=[e[s]];break;case 108:e[s-2].push(e[s]),this.$=e[s-2];break;case 110:this.$=e[s-1]+e[s];break}},"anonymous"),table:[{3:1,4:2,5:3,6:4,7:[1,6],10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:i,35:a,37:n,38:22,42:r,43:23,46:c,48:u,51:d,52:m,54:g,56:N,57:Ae,60:b,62:fe,63:ge,64:me,65:Ce,75:be,76:ke,78:Ee,82:Te,83:ye,86:k,100:E,102:T,103:y},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},t(De,[2,5],{8:[1,48]}),{8:[1,49]},t(A,[2,19],{22:[1,50]}),t(A,[2,21]),t(A,[2,22]),t(A,[2,23]),t(A,[2,24]),t(A,[2,25]),t(A,[2,26]),t(A,[2,27]),t(A,[2,28]),t(A,[2,29]),t(A,[2,30]),{34:[1,51]},{36:[1,52]},t(A,[2,33]),t(A,[2,63],{53:53,66:56,67:57,13:[1,54],22:[1,55],68:Z,69:$,70:ee,71:te,72:se,73:Fe,74:Be}),{39:[1,65]},t(_,[2,47],{39:[1,67],44:[1,66],46:[1,68]}),t(A,[2,65]),t(A,[2,66]),{16:69,60:b,86:k,100:E,102:T},{16:39,17:40,19:70,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:71,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:72,60:b,86:k,100:E,102:T,103:y},{60:[1,73]},{13:[1,74]},{16:39,17:40,19:75,60:b,86:k,100:E,102:T,103:y},{13:Pe,55:76},{58:78,60:[1,79]},t(A,[2,76]),t(A,[2,77]),t(A,[2,78]),t(A,[2,79]),t(M,[2,13],{16:39,17:40,19:81,18:[1,80],20:[1,82],60:b,86:k,100:E,102:T,103:y}),t(M,[2,15],{20:[1,83]}),{15:84,16:85,17:86,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:87,60:b,86:k,100:E,102:T,103:y},t(ie,[2,133]),t(ie,[2,134]),t(ie,[2,135]),t(ie,[2,136]),t([1,8,9,12,13,20,22,39,41,44,46,68,69,70,71,72,73,74,79,81],[2,137]),t(De,[2,6],{10:5,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,19:21,38:22,43:23,16:39,17:40,5:88,33:i,35:a,37:n,42:r,46:c,48:u,51:d,52:m,54:g,56:N,57:Ae,60:b,62:fe,63:ge,64:me,65:Ce,75:be,76:ke,78:Ee,82:Te,83:ye,86:k,100:E,102:T,103:y}),{5:89,10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:i,35:a,37:n,38:22,42:r,43:23,46:c,48:u,51:d,52:m,54:g,56:N,57:Ae,60:b,62:fe,63:ge,64:me,65:Ce,75:be,76:ke,78:Ee,82:Te,83:ye,86:k,100:E,102:T,103:y},t(A,[2,20]),t(A,[2,31]),t(A,[2,32]),{13:[1,91],16:39,17:40,19:90,60:b,86:k,100:E,102:T,103:y},{53:92,66:56,67:57,68:Z,69:$,70:ee,71:te,72:se,73:Fe,74:Be},t(A,[2,64]),{67:93,73:Fe,74:Be},t(ae,[2,83],{66:94,68:Z,69:$,70:ee,71:te,72:se}),t(U,[2,84]),t(U,[2,85]),t(U,[2,86]),t(U,[2,87]),t(U,[2,88]),t(Me,[2,89]),t(Me,[2,90]),{8:[1,96],23:99,24:97,30:98,38:22,40:95,42:r,43:23,48:u,54:g,56:N},{16:100,60:b,86:k,100:E,102:T},{41:[1,102],45:101,51:ne},{16:104,60:b,86:k,100:E,102:T},{47:[1,105]},{13:[1,106]},{13:[1,107]},{79:[1,108],81:[1,109]},{22:z,50:Y,59:110,60:K,82:W,84:111,85:112,86:Q,87:j,88:X,89:q,90:H},{60:[1,122]},{13:Pe,55:123},t(_,[2,72]),t(_,[2,138]),{22:z,50:Y,59:124,60:K,61:[1,125],82:W,84:111,85:112,86:Q,87:j,88:X,89:q,90:H},t(Re,[2,74]),{16:39,17:40,19:126,60:b,86:k,100:E,102:T,103:y},t(M,[2,16]),t(M,[2,17]),t(M,[2,18]),{11:127,12:Ge,39:[2,36]},t(re,[2,9],{16:85,17:86,15:130,18:[1,129],60:b,86:k,100:E,102:T,103:y}),t(re,[2,10]),t(_e,[2,55],{11:131,12:Ge}),t(De,[2,7]),{9:[1,132]},t(ue,[2,67]),{16:39,17:40,19:133,60:b,86:k,100:E,102:T,103:y},{13:[1,135],16:39,17:40,19:134,60:b,86:k,100:E,102:T,103:y},t(ae,[2,82],{66:136,68:Z,69:$,70:ee,71:te,72:se}),t(ae,[2,81]),{41:[1,137]},{23:99,24:97,30:98,38:22,40:138,42:r,43:23,48:u,54:g,56:N},{8:[1,139],41:[2,38]},{8:[1,140],41:[2,41]},{8:[1,141],41:[2,44]},t(_,[2,48],{39:[1,142]}),{41:[1,143]},t(_,[2,50]),{41:[2,61],45:144,51:ne},{47:[1,145]},{16:39,17:40,19:146,60:b,86:k,100:E,102:T,103:y},t(A,[2,91],{13:[1,147]}),t(A,[2,93],{13:[1,149],77:[1,148]}),t(A,[2,97],{13:[1,150],80:[1,151]}),{13:[1,152]},t(A,[2,105],{61:Ue}),t(ze,[2,107],{85:154,22:z,50:Y,60:K,82:W,86:Q,87:j,88:X,89:q,90:H}),t(x,[2,109]),t(x,[2,111]),t(x,[2,112]),t(x,[2,113]),t(x,[2,114]),t(x,[2,115]),t(x,[2,116]),t(x,[2,117]),t(x,[2,118]),t(x,[2,119]),t(A,[2,106]),t(_,[2,71]),t(A,[2,73],{61:Ue}),{60:[1,155]},t(M,[2,14]),{39:[2,37]},{13:[1,156]},{15:157,16:85,17:86,60:b,86:k,100:E,102:T,103:y},t(re,[2,12]),t(_e,[2,56]),{1:[2,4]},t(ue,[2,69]),t(ue,[2,68]),{16:39,17:40,19:158,60:b,86:k,100:E,102:T,103:y},t(ae,[2,80]),t(_,[2,34]),{41:[1,159]},{23:99,24:97,30:98,38:22,40:160,41:[2,39],42:r,43:23,48:u,54:g,56:N},{23:99,24:97,30:98,38:22,40:161,41:[2,42],42:r,43:23,48:u,54:g,56:N},{23:99,24:97,30:98,38:22,40:162,41:[2,45],42:r,43:23,48:u,54:g,56:N},{45:163,51:ne},t(_,[2,49]),{41:[2,62]},t(_,[2,52],{39:[1,164]}),t(A,[2,60]),t(A,[2,92]),t(A,[2,94]),t(A,[2,95],{77:[1,165]}),t(A,[2,98]),t(A,[2,99],{13:[1,166]}),t(A,[2,101],{13:[1,168],77:[1,167]}),{22:z,50:Y,60:K,82:W,84:169,85:112,86:Q,87:j,88:X,89:q,90:H},t(x,[2,110]),t(Re,[2,75]),{14:[1,170]},t(re,[2,11]),t(ue,[2,70]),t(_,[2,35]),{41:[2,40]},{41:[2,43]},{41:[2,46]},{41:[1,171]},{41:[1,173],45:172,51:ne},t(A,[2,96]),t(A,[2,100]),t(A,[2,102]),t(A,[2,103],{77:[1,174]}),t(ze,[2,108],{85:154,22:z,50:Y,60:K,82:W,86:Q,87:j,88:X,89:q,90:H}),t(_e,[2,8]),t(_,[2,51]),{41:[1,175]},t(_,[2,54]),t(A,[2,104]),t(_,[2,53])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],127:[2,37],132:[2,4],144:[2,62],160:[2,40],161:[2,43],162:[2,46]},parseError:f(function(o,h){if(h.recoverable)this.trace(o);else{var p=new Error(o);throw p.hash=h,p}},"parseError"),parse:f(function(o){var h=this,p=[0],l=[],C=[null],e=[],J=this.table,s="",ce=0,Ye=0,Je=2,Ke=1,Ze=e.slice.call(arguments,1),D=Object.create(this.lexer),w={yy:{}};for(var Ne in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ne)&&(w.yy[Ne]=this.yy[Ne]);D.setInput(o,w.yy),w.yy.lexer=D,w.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var Le=D.yylloc;e.push(Le);var $e=D.options&&D.options.ranges;typeof w.yy.parseError=="function"?this.parseError=w.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function et(S){p.length=p.length-2*S,C.length=C.length-S,e.length=e.length-S}f(et,"popStack");function We(){var S;return S=l.pop()||D.lex()||Ke,typeof S!="number"&&(S instanceof Array&&(l=S,S=l.pop()),S=h.symbols_[S]||S),S}f(We,"lex");for(var B,V,L,xe,R={},oe,v,Qe,he;;){if(V=p[p.length-1],this.defaultActions[V]?L=this.defaultActions[V]:((B===null||typeof B>"u")&&(B=We()),L=J[V]&&J[V][B]),typeof L>"u"||!L.length||!L[0]){var ve="";he=[];for(oe in J[V])this.terminals_[oe]&&oe>Je&&he.push("'"+this.terminals_[oe]+"'");D.showPosition?ve="Parse error on line "+(ce+1)+`: `+D.showPosition()+` Expecting `+he.join(", ")+", got '"+(this.terminals_[B]||B)+"'":ve="Parse error on line "+(ce+1)+": Unexpected "+(B==Ke?"end of input":"'"+(this.terminals_[B]||B)+"'"),this.parseError(ve,{text:D.match,token:this.terminals_[B]||B,line:D.yylineno,loc:Le,expected:he})}if(L[0]instanceof Array&&L.length>1)throw new Error("Parse Error: multiple actions possible at state: "+V+", token: "+B);switch(L[0]){case 1:p.push(B),C.push(D.yytext),e.push(D.yylloc),p.push(L[1]),B=null,Ye=D.yyleng,s=D.yytext,ce=D.yylineno,Le=D.yylloc;break;case 2:if(v=this.productions_[L[1]][1],R.$=C[C.length-v],R._$={first_line:e[e.length-(v||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(v||1)].first_column,last_column:e[e.length-1].last_column},$e&&(R._$.range=[e[e.length-(v||1)].range[0],e[e.length-1].range[1]]),xe=this.performAction.apply(R,[s,Ye,ce,w.yy,L[1],C,e].concat(Ze)),typeof xe<"u")return xe;v&&(p=p.slice(0,-1*v*2),C=C.slice(0,-1*v),e=e.slice(0,-1*v)),p.push(this.productions_[L[1]][0]),C.push(R.$),e.push(R._$),Qe=J[p[p.length-2]][p[p.length-1]],p.push(Qe);break;case 3:return!0}}return!0},"parse")},He=(function(){var O={EOF:1,parseError:f(function(h,p){if(this.yy.parser)this.yy.parser.parseError(h,p);else throw new Error(h)},"parseError"),setInput:f(function(o,h){return this.yy=h||this.yy||{},this._input=o,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:f(function(){var o=this._input[0];this.yytext+=o,this.yyleng++,this.offset++,this.match+=o,this.matched+=o;var h=o.match(/(?:\r\n?|\n).*/g);return h?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),o},"input"),unput:f(function(o){var h=o.length,p=o.split(/(?:\r\n?|\n)/g);this._input=o+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-h),this.offset-=h;var l=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),p.length-1&&(this.yylineno-=p.length-1);var C=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:p?(p.length===l.length?this.yylloc.first_column:0)+l[l.length-p.length].length-p[0].length:this.yylloc.first_column-h},this.options.ranges&&(this.yylloc.range=[C[0],C[0]+this.yyleng-h]),this.yyleng=this.yytext.length,this},"unput"),more:f(function(){return this._more=!0,this},"more"),reject:f(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:f(function(o){this.unput(this.match.slice(o))},"less"),pastInput:f(function(){var o=this.matched.substr(0,this.matched.length-this.match.length);return(o.length>20?"...":"")+o.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:f(function(){var o=this.match;return o.length<20&&(o+=this._input.substr(0,20-o.length)),(o.substr(0,20)+(o.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:f(function(){var o=this.pastInput(),h=new Array(o.length+1).join("-");return o+this.upcomingInput()+` diff --git a/apps/kimi-code/dist-web/assets/chunk-VR4S4FIN-C_RujyXt.js b/apps/kimi-code/dist-web/assets/chunk-VR4S4FIN-Dwk6LZpd.js similarity index 87% rename from apps/kimi-code/dist-web/assets/chunk-VR4S4FIN-C_RujyXt.js rename to apps/kimi-code/dist-web/assets/chunk-VR4S4FIN-Dwk6LZpd.js index fdb77d45628..19fb8f561ac 100644 --- a/apps/kimi-code/dist-web/assets/chunk-VR4S4FIN-C_RujyXt.js +++ b/apps/kimi-code/dist-web/assets/chunk-VR4S4FIN-Dwk6LZpd.js @@ -1 +1 @@ -import{_ as a,e as w,l as x}from"./mermaid.core-WW7RuneT.js";var d=a((e,t,i,r)=>{e.attr("class",i);const{width:o,height:h,x:n,y:c}=u(e,t);w(e,h,o,r);const s=l(n,c,o,h,t);e.attr("viewBox",s),x.debug(`viewBox configured: ${s} with padding: ${t}`)},"setupViewPortForSVG"),u=a((e,t)=>{const i=e.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:i.width+t*2,height:i.height+t*2,x:i.x,y:i.y}},"calculateDimensionsWithPadding"),l=a((e,t,i,r,o)=>`${e-o} ${t-o} ${i} ${r}`,"createViewBox");export{d as s}; +import{_ as a,e as w,l as x}from"./mermaid.core-mH2pk-lc.js";var d=a((e,t,i,r)=>{e.attr("class",i);const{width:o,height:h,x:n,y:c}=u(e,t);w(e,h,o,r);const s=l(n,c,o,h,t);e.attr("viewBox",s),x.debug(`viewBox configured: ${s} with padding: ${t}`)},"setupViewPortForSVG"),u=a((e,t)=>{const i=e.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:i.width+t*2,height:i.height+t*2,x:i.x,y:i.y}},"calculateDimensionsWithPadding"),l=a((e,t,i,r,o)=>`${e-o} ${t-o} ${i} ${r}`,"createViewBox");export{d as s}; diff --git a/apps/kimi-code/dist-web/assets/chunk-XXDRQBXY-D_bv9kM4.js b/apps/kimi-code/dist-web/assets/chunk-XXDRQBXY-Dc-6ZO6_.js similarity index 72% rename from apps/kimi-code/dist-web/assets/chunk-XXDRQBXY-D_bv9kM4.js rename to apps/kimi-code/dist-web/assets/chunk-XXDRQBXY-Dc-6ZO6_.js index 921e62e77fa..afc7de839f6 100644 --- a/apps/kimi-code/dist-web/assets/chunk-XXDRQBXY-D_bv9kM4.js +++ b/apps/kimi-code/dist-web/assets/chunk-XXDRQBXY-Dc-6ZO6_.js @@ -1 +1 @@ -import{_ as a,d as o}from"./mermaid.core-WW7RuneT.js";var d=a((t,e)=>{let n;return e==="sandbox"&&(n=o("#i"+t)),(e==="sandbox"?o(n.nodes()[0].contentDocument.body):o("body")).select(`[id="${t}"]`)},"getDiagramElement");export{d as g}; +import{_ as a,d as o}from"./mermaid.core-mH2pk-lc.js";var d=a((t,e)=>{let n;return e==="sandbox"&&(n=o("#i"+t)),(e==="sandbox"?o(n.nodes()[0].contentDocument.body):o("body")).select(`[id="${t}"]`)},"getDiagramElement");export{d as g}; diff --git a/apps/kimi-code/dist-web/assets/classDiagram-OUVF2IWQ-D3GWbmB6.js b/apps/kimi-code/dist-web/assets/classDiagram-OUVF2IWQ-D3GWbmB6.js new file mode 100644 index 00000000000..45c8ceecb10 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/classDiagram-OUVF2IWQ-D3GWbmB6.js @@ -0,0 +1 @@ +import{s as a,c as s,a as e,C as t}from"./chunk-V7JOEXUC--nWNNlQZ.js";import{_ as i}from"./mermaid.core-mH2pk-lc.js";import"./chunk-5VM5RSS4-CRxkKkdS.js";import"./chunk-XXDRQBXY-Dc-6ZO6_.js";import"./chunk-VR4S4FIN-Dwk6LZpd.js";import"./chunk-32BRIVSS-BM7i2tA8.js";import"./index-BIElaaEN.js";import"./_commonjsHelpers-CqkleIqs.js";var f={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{f as diagram}; diff --git a/apps/kimi-code/dist-web/assets/classDiagram-OUVF2IWQ-DLwxkoRX.js b/apps/kimi-code/dist-web/assets/classDiagram-OUVF2IWQ-DLwxkoRX.js deleted file mode 100644 index 931a051ed28..00000000000 --- a/apps/kimi-code/dist-web/assets/classDiagram-OUVF2IWQ-DLwxkoRX.js +++ /dev/null @@ -1 +0,0 @@ -import{s as a,c as s,a as e,C as t}from"./chunk-V7JOEXUC-BBRs-W-z.js";import{_ as i}from"./mermaid.core-WW7RuneT.js";import"./chunk-5VM5RSS4-BJR-VYAu.js";import"./chunk-XXDRQBXY-D_bv9kM4.js";import"./chunk-VR4S4FIN-C_RujyXt.js";import"./chunk-32BRIVSS-CRTrWqUr.js";import"./index-CiHMlsuo.js";import"./_commonjsHelpers-CqkleIqs.js";var f={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{f as diagram}; diff --git a/apps/kimi-code/dist-web/assets/classDiagram-v2-EOCWNBFH-D3GWbmB6.js b/apps/kimi-code/dist-web/assets/classDiagram-v2-EOCWNBFH-D3GWbmB6.js new file mode 100644 index 00000000000..45c8ceecb10 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/classDiagram-v2-EOCWNBFH-D3GWbmB6.js @@ -0,0 +1 @@ +import{s as a,c as s,a as e,C as t}from"./chunk-V7JOEXUC--nWNNlQZ.js";import{_ as i}from"./mermaid.core-mH2pk-lc.js";import"./chunk-5VM5RSS4-CRxkKkdS.js";import"./chunk-XXDRQBXY-Dc-6ZO6_.js";import"./chunk-VR4S4FIN-Dwk6LZpd.js";import"./chunk-32BRIVSS-BM7i2tA8.js";import"./index-BIElaaEN.js";import"./_commonjsHelpers-CqkleIqs.js";var f={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{f as diagram}; diff --git a/apps/kimi-code/dist-web/assets/classDiagram-v2-EOCWNBFH-DLwxkoRX.js b/apps/kimi-code/dist-web/assets/classDiagram-v2-EOCWNBFH-DLwxkoRX.js deleted file mode 100644 index 931a051ed28..00000000000 --- a/apps/kimi-code/dist-web/assets/classDiagram-v2-EOCWNBFH-DLwxkoRX.js +++ /dev/null @@ -1 +0,0 @@ -import{s as a,c as s,a as e,C as t}from"./chunk-V7JOEXUC-BBRs-W-z.js";import{_ as i}from"./mermaid.core-WW7RuneT.js";import"./chunk-5VM5RSS4-BJR-VYAu.js";import"./chunk-XXDRQBXY-D_bv9kM4.js";import"./chunk-VR4S4FIN-C_RujyXt.js";import"./chunk-32BRIVSS-CRTrWqUr.js";import"./index-CiHMlsuo.js";import"./_commonjsHelpers-CqkleIqs.js";var f={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{f as diagram}; diff --git a/apps/kimi-code/dist-web/assets/cose-bilkent-JH36ORCC-DzQyBzbl.js b/apps/kimi-code/dist-web/assets/cose-bilkent-JH36ORCC-BY6KByok.js similarity index 99% rename from apps/kimi-code/dist-web/assets/cose-bilkent-JH36ORCC-DzQyBzbl.js rename to apps/kimi-code/dist-web/assets/cose-bilkent-JH36ORCC-BY6KByok.js index 4fcc151f954..80744ac5735 100644 --- a/apps/kimi-code/dist-web/assets/cose-bilkent-JH36ORCC-DzQyBzbl.js +++ b/apps/kimi-code/dist-web/assets/cose-bilkent-JH36ORCC-BY6KByok.js @@ -1 +1 @@ -import{_ as V,l as k,d as lt}from"./mermaid.core-WW7RuneT.js";import{c as tt}from"./cytoscape.esm-OyMbaexL.js";import{g as gt}from"./_commonjsHelpers-CqkleIqs.js";import"./index-CiHMlsuo.js";var Z={exports:{}},$={exports:{}},Q={exports:{}},ut=Q.exports,j;function ft(){return j||(j=1,(function(G,b){(function(I,L){G.exports=L()})(ut,function(){return(function(N){var I={};function L(o){if(I[o])return I[o].exports;var e=I[o]={i:o,l:!1,exports:{}};return N[o].call(e.exports,e,e.exports,L),e.l=!0,e.exports}return L.m=N,L.c=I,L.i=function(o){return o},L.d=function(o,e,t){L.o(o,e)||Object.defineProperty(o,e,{configurable:!1,enumerable:!0,get:t})},L.n=function(o){var e=o&&o.__esModule?function(){return o.default}:function(){return o};return L.d(e,"a",e),e},L.o=function(o,e){return Object.prototype.hasOwnProperty.call(o,e)},L.p="",L(L.s=26)})([(function(N,I,L){function o(){}o.QUALITY=1,o.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,o.DEFAULT_INCREMENTAL=!1,o.DEFAULT_ANIMATION_ON_LAYOUT=!0,o.DEFAULT_ANIMATION_DURING_LAYOUT=!1,o.DEFAULT_ANIMATION_PERIOD=50,o.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,o.DEFAULT_GRAPH_MARGIN=15,o.NODE_DIMENSIONS_INCLUDE_LABELS=!1,o.SIMPLE_NODE_SIZE=40,o.SIMPLE_NODE_HALF_SIZE=o.SIMPLE_NODE_SIZE/2,o.EMPTY_COMPOUND_NODE_SIZE=40,o.MIN_EDGE_LENGTH=1,o.WORLD_BOUNDARY=1e6,o.INITIAL_WORLD_BOUNDARY=o.WORLD_BOUNDARY/1e3,o.WORLD_CENTER_X=1200,o.WORLD_CENTER_Y=900,N.exports=o}),(function(N,I,L){var o=L(2),e=L(8),t=L(9);function i(g,n,d){o.call(this,d),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=d,this.bendpoints=[],this.source=g,this.target=n}i.prototype=Object.create(o.prototype);for(var l in o)i[l]=o[l];i.prototype.getSource=function(){return this.source},i.prototype.getTarget=function(){return this.target},i.prototype.isInterGraph=function(){return this.isInterGraph},i.prototype.getLength=function(){return this.length},i.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},i.prototype.getBendpoints=function(){return this.bendpoints},i.prototype.getLca=function(){return this.lca},i.prototype.getSourceInLca=function(){return this.sourceInLca},i.prototype.getTargetInLca=function(){return this.targetInLca},i.prototype.getOtherEnd=function(g){if(this.source===g)return this.target;if(this.target===g)return this.source;throw"Node is not incident with this edge"},i.prototype.getOtherEndInGraph=function(g,n){for(var d=this.getOtherEnd(g),r=n.getGraphManager().getRoot();;){if(d.getOwner()==n)return d;if(d.getOwner()==r)break;d=d.getOwner().getParent()}return null},i.prototype.updateLength=function(){var g=new Array(4);this.isOverlapingSourceAndTarget=e.getIntersection(this.target.getRect(),this.source.getRect(),g),this.isOverlapingSourceAndTarget||(this.lengthX=g[0]-g[2],this.lengthY=g[1]-g[3],Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},i.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},N.exports=i}),(function(N,I,L){function o(e){this.vGraphObject=e}N.exports=o}),(function(N,I,L){var o=L(2),e=L(10),t=L(13),i=L(0),l=L(16),g=L(4);function n(r,h,a,p){a==null&&p==null&&(p=h),o.call(this,p),r.graphManager!=null&&(r=r.graphManager),this.estimatedSize=e.MIN_VALUE,this.inclusionTreeDepth=e.MAX_VALUE,this.vGraphObject=p,this.edges=[],this.graphManager=r,a!=null&&h!=null?this.rect=new t(h.x,h.y,a.width,a.height):this.rect=new t}n.prototype=Object.create(o.prototype);for(var d in o)n[d]=o[d];n.prototype.getEdges=function(){return this.edges},n.prototype.getChild=function(){return this.child},n.prototype.getOwner=function(){return this.owner},n.prototype.getWidth=function(){return this.rect.width},n.prototype.setWidth=function(r){this.rect.width=r},n.prototype.getHeight=function(){return this.rect.height},n.prototype.setHeight=function(r){this.rect.height=r},n.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},n.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},n.prototype.getCenter=function(){return new g(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},n.prototype.getLocation=function(){return new g(this.rect.x,this.rect.y)},n.prototype.getRect=function(){return this.rect},n.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},n.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},n.prototype.setRect=function(r,h){this.rect.x=r.x,this.rect.y=r.y,this.rect.width=h.width,this.rect.height=h.height},n.prototype.setCenter=function(r,h){this.rect.x=r-this.rect.width/2,this.rect.y=h-this.rect.height/2},n.prototype.setLocation=function(r,h){this.rect.x=r,this.rect.y=h},n.prototype.moveBy=function(r,h){this.rect.x+=r,this.rect.y+=h},n.prototype.getEdgeListToNode=function(r){var h=[],a=this;return a.edges.forEach(function(p){if(p.target==r){if(p.source!=a)throw"Incorrect edge source!";h.push(p)}}),h},n.prototype.getEdgesBetween=function(r){var h=[],a=this;return a.edges.forEach(function(p){if(!(p.source==a||p.target==a))throw"Incorrect edge source and/or target";(p.target==r||p.source==r)&&h.push(p)}),h},n.prototype.getNeighborsList=function(){var r=new Set,h=this;return h.edges.forEach(function(a){if(a.source==h)r.add(a.target);else{if(a.target!=h)throw"Incorrect incidency!";r.add(a.source)}}),r},n.prototype.withChildren=function(){var r=new Set,h,a;if(r.add(this),this.child!=null)for(var p=this.child.getNodes(),v=0;vh&&(this.rect.x-=(this.labelWidth-h)/2,this.setWidth(this.labelWidth)),this.labelHeight>a&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-a)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-a),this.setHeight(this.labelHeight))}}},n.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==e.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},n.prototype.transform=function(r){var h=this.rect.x;h>i.WORLD_BOUNDARY?h=i.WORLD_BOUNDARY:h<-i.WORLD_BOUNDARY&&(h=-i.WORLD_BOUNDARY);var a=this.rect.y;a>i.WORLD_BOUNDARY?a=i.WORLD_BOUNDARY:a<-i.WORLD_BOUNDARY&&(a=-i.WORLD_BOUNDARY);var p=new g(h,a),v=r.inverseTransformPoint(p);this.setLocation(v.x,v.y)},n.prototype.getLeft=function(){return this.rect.x},n.prototype.getRight=function(){return this.rect.x+this.rect.width},n.prototype.getTop=function(){return this.rect.y},n.prototype.getBottom=function(){return this.rect.y+this.rect.height},n.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},N.exports=n}),(function(N,I,L){function o(e,t){e==null&&t==null?(this.x=0,this.y=0):(this.x=e,this.y=t)}o.prototype.getX=function(){return this.x},o.prototype.getY=function(){return this.y},o.prototype.setX=function(e){this.x=e},o.prototype.setY=function(e){this.y=e},o.prototype.getDifference=function(e){return new DimensionD(this.x-e.x,this.y-e.y)},o.prototype.getCopy=function(){return new o(this.x,this.y)},o.prototype.translate=function(e){return this.x+=e.width,this.y+=e.height,this},N.exports=o}),(function(N,I,L){var o=L(2),e=L(10),t=L(0),i=L(6),l=L(3),g=L(1),n=L(13),d=L(12),r=L(11);function h(p,v,D){o.call(this,D),this.estimatedSize=e.MIN_VALUE,this.margin=t.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=p,v!=null&&v instanceof i?this.graphManager=v:v!=null&&v instanceof Layout&&(this.graphManager=v.graphManager)}h.prototype=Object.create(o.prototype);for(var a in o)h[a]=o[a];h.prototype.getNodes=function(){return this.nodes},h.prototype.getEdges=function(){return this.edges},h.prototype.getGraphManager=function(){return this.graphManager},h.prototype.getParent=function(){return this.parent},h.prototype.getLeft=function(){return this.left},h.prototype.getRight=function(){return this.right},h.prototype.getTop=function(){return this.top},h.prototype.getBottom=function(){return this.bottom},h.prototype.isConnected=function(){return this.isConnected},h.prototype.add=function(p,v,D){if(v==null&&D==null){var u=p;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(u)>-1)throw"Node already in graph!";return u.owner=this,this.getNodes().push(u),u}else{var T=p;if(!(this.getNodes().indexOf(v)>-1&&this.getNodes().indexOf(D)>-1))throw"Source or target not in graph!";if(!(v.owner==D.owner&&v.owner==this))throw"Both owners must be this graph!";return v.owner!=D.owner?null:(T.source=v,T.target=D,T.isInterGraph=!1,this.getEdges().push(T),v.edges.push(T),D!=v&&D.edges.push(T),T)}},h.prototype.remove=function(p){var v=p;if(p instanceof l){if(v==null)throw"Node is null!";if(!(v.owner!=null&&v.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var D=v.edges.slice(),u,T=D.length,y=0;y-1&&f>-1))throw"Source and/or target doesn't know this edge!";u.source.edges.splice(s,1),u.target!=u.source&&u.target.edges.splice(f,1);var O=u.source.owner.getEdges().indexOf(u);if(O==-1)throw"Not in owner's edge list!";u.source.owner.getEdges().splice(O,1)}},h.prototype.updateLeftTop=function(){for(var p=e.MAX_VALUE,v=e.MAX_VALUE,D,u,T,y=this.getNodes(),O=y.length,s=0;sD&&(p=D),v>u&&(v=u)}return p==e.MAX_VALUE?null:(y[0].getParent().paddingLeft!=null?T=y[0].getParent().paddingLeft:T=this.margin,this.left=v-T,this.top=p-T,new d(this.left,this.top))},h.prototype.updateBounds=function(p){for(var v=e.MAX_VALUE,D=-e.MAX_VALUE,u=e.MAX_VALUE,T=-e.MAX_VALUE,y,O,s,f,c,E=this.nodes,A=E.length,m=0;my&&(v=y),Ds&&(u=s),Ty&&(v=y),Ds&&(u=s),T=this.nodes.length){var A=0;D.forEach(function(m){m.owner==p&&A++}),A==this.nodes.length&&(this.isConnected=!0)}},N.exports=h}),(function(N,I,L){var o,e=L(1);function t(i){o=L(5),this.layout=i,this.graphs=[],this.edges=[]}t.prototype.addRoot=function(){var i=this.layout.newGraph(),l=this.layout.newNode(null),g=this.add(i,l);return this.setRootGraph(g),this.rootGraph},t.prototype.add=function(i,l,g,n,d){if(g==null&&n==null&&d==null){if(i==null)throw"Graph is null!";if(l==null)throw"Parent node is null!";if(this.graphs.indexOf(i)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(i),i.parent!=null)throw"Already has a parent!";if(l.child!=null)throw"Already has a child!";return i.parent=l,l.child=i,i}else{d=g,n=l,g=i;var r=n.getOwner(),h=d.getOwner();if(!(r!=null&&r.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(h!=null&&h.getGraphManager()==this))throw"Target not in this graph mgr!";if(r==h)return g.isInterGraph=!1,r.add(g,n,d);if(g.isInterGraph=!0,g.source=n,g.target=d,this.edges.indexOf(g)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(g),!(g.source!=null&&g.target!=null))throw"Edge source and/or target is null!";if(!(g.source.edges.indexOf(g)==-1&&g.target.edges.indexOf(g)==-1))throw"Edge already in source and/or target incidency list!";return g.source.edges.push(g),g.target.edges.push(g),g}},t.prototype.remove=function(i){if(i instanceof o){var l=i;if(l.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(l==this.rootGraph||l.parent!=null&&l.parent.graphManager==this))throw"Invalid parent node!";var g=[];g=g.concat(l.getEdges());for(var n,d=g.length,r=0;r=i.getRight()?l[0]+=Math.min(i.getX()-t.getX(),t.getRight()-i.getRight()):i.getX()<=t.getX()&&i.getRight()>=t.getRight()&&(l[0]+=Math.min(t.getX()-i.getX(),i.getRight()-t.getRight())),t.getY()<=i.getY()&&t.getBottom()>=i.getBottom()?l[1]+=Math.min(i.getY()-t.getY(),t.getBottom()-i.getBottom()):i.getY()<=t.getY()&&i.getBottom()>=t.getBottom()&&(l[1]+=Math.min(t.getY()-i.getY(),i.getBottom()-t.getBottom()));var d=Math.abs((i.getCenterY()-t.getCenterY())/(i.getCenterX()-t.getCenterX()));i.getCenterY()===t.getCenterY()&&i.getCenterX()===t.getCenterX()&&(d=1);var r=d*l[0],h=l[1]/d;l[0]r)return l[0]=g,l[1]=a,l[2]=d,l[3]=E,!1;if(nd)return l[0]=h,l[1]=n,l[2]=f,l[3]=r,!1;if(gd?(l[0]=v,l[1]=D,R=!0):(l[0]=p,l[1]=a,R=!0):S===w&&(g>d?(l[0]=h,l[1]=a,R=!0):(l[0]=u,l[1]=D,R=!0)),-Y===w?d>g?(l[2]=c,l[3]=E,M=!0):(l[2]=f,l[3]=s,M=!0):Y===w&&(d>g?(l[2]=O,l[3]=s,M=!0):(l[2]=A,l[3]=E,M=!0)),R&&M)return!1;if(g>d?n>r?(x=this.getCardinalDirection(S,w,4),F=this.getCardinalDirection(Y,w,2)):(x=this.getCardinalDirection(-S,w,3),F=this.getCardinalDirection(-Y,w,1)):n>r?(x=this.getCardinalDirection(-S,w,1),F=this.getCardinalDirection(-Y,w,3)):(x=this.getCardinalDirection(S,w,2),F=this.getCardinalDirection(Y,w,4)),!R)switch(x){case 1:P=a,U=g+-y/w,l[0]=U,l[1]=P;break;case 2:U=u,P=n+T*w,l[0]=U,l[1]=P;break;case 3:P=D,U=g+y/w,l[0]=U,l[1]=P;break;case 4:U=v,P=n+-T*w,l[0]=U,l[1]=P;break}if(!M)switch(F){case 1:X=s,_=d+-C/w,l[2]=_,l[3]=X;break;case 2:_=A,X=r+m*w,l[2]=_,l[3]=X;break;case 3:X=E,_=d+C/w,l[2]=_,l[3]=X;break;case 4:_=c,X=r+-m*w,l[2]=_,l[3]=X;break}}return!1},e.getCardinalDirection=function(t,i,l){return t>i?l:1+l%4},e.getIntersection=function(t,i,l,g){if(g==null)return this.getIntersection2(t,i,l);var n=t.x,d=t.y,r=i.x,h=i.y,a=l.x,p=l.y,v=g.x,D=g.y,u=void 0,T=void 0,y=void 0,O=void 0,s=void 0,f=void 0,c=void 0,E=void 0,A=void 0;return y=h-d,s=n-r,c=r*d-n*h,O=D-p,f=a-v,E=v*p-a*D,A=y*f-O*s,A===0?null:(u=(s*E-f*c)/A,T=(O*c-y*E)/A,new o(u,T))},e.angleOfVector=function(t,i,l,g){var n=void 0;return t!==l?(n=Math.atan((g-i)/(l-t)),l0?1:e<0?-1:0},o.floor=function(e){return e<0?Math.ceil(e):Math.floor(e)},o.ceil=function(e){return e<0?Math.floor(e):Math.ceil(e)},N.exports=o}),(function(N,I,L){function o(){}o.MAX_VALUE=2147483647,o.MIN_VALUE=-2147483648,N.exports=o}),(function(N,I,L){var o=(function(){function n(d,r){for(var h=0;h"u"?"undefined":o(t);return t==null||i!="object"&&i!="function"},N.exports=e}),(function(N,I,L){function o(a){if(Array.isArray(a)){for(var p=0,v=Array(a.length);p0&&p;){for(y.push(s[0]);y.length>0&&p;){var f=y[0];y.splice(0,1),T.add(f);for(var c=f.getEdges(),u=0;u-1&&s.splice(C,1)}T=new Set,O=new Map}}return a},h.prototype.createDummyNodesForBendpoints=function(a){for(var p=[],v=a.source,D=this.graphManager.calcLowestCommonAncestor(a.source,a.target),u=0;u0){for(var D=this.edgeToDummyNodes.get(v),u=0;u=0&&p.splice(E,1);var A=O.getNeighborsList();A.forEach(function(R){if(v.indexOf(R)<0){var M=D.get(R),S=M-1;S==1&&f.push(R),D.set(R,S)}})}v=v.concat(f),(p.length==1||p.length==2)&&(u=!0,T=p[0])}return T},h.prototype.setGraphManager=function(a){this.graphManager=a},N.exports=h}),(function(N,I,L){function o(){}o.seed=1,o.x=0,o.nextDouble=function(){return o.x=Math.sin(o.seed++)*1e4,o.x-Math.floor(o.x)},N.exports=o}),(function(N,I,L){var o=L(4);function e(t,i){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}e.prototype.getWorldOrgX=function(){return this.lworldOrgX},e.prototype.setWorldOrgX=function(t){this.lworldOrgX=t},e.prototype.getWorldOrgY=function(){return this.lworldOrgY},e.prototype.setWorldOrgY=function(t){this.lworldOrgY=t},e.prototype.getWorldExtX=function(){return this.lworldExtX},e.prototype.setWorldExtX=function(t){this.lworldExtX=t},e.prototype.getWorldExtY=function(){return this.lworldExtY},e.prototype.setWorldExtY=function(t){this.lworldExtY=t},e.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},e.prototype.setDeviceOrgX=function(t){this.ldeviceOrgX=t},e.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},e.prototype.setDeviceOrgY=function(t){this.ldeviceOrgY=t},e.prototype.getDeviceExtX=function(){return this.ldeviceExtX},e.prototype.setDeviceExtX=function(t){this.ldeviceExtX=t},e.prototype.getDeviceExtY=function(){return this.ldeviceExtY},e.prototype.setDeviceExtY=function(t){this.ldeviceExtY=t},e.prototype.transformX=function(t){var i=0,l=this.lworldExtX;return l!=0&&(i=this.ldeviceOrgX+(t-this.lworldOrgX)*this.ldeviceExtX/l),i},e.prototype.transformY=function(t){var i=0,l=this.lworldExtY;return l!=0&&(i=this.ldeviceOrgY+(t-this.lworldOrgY)*this.ldeviceExtY/l),i},e.prototype.inverseTransformX=function(t){var i=0,l=this.ldeviceExtX;return l!=0&&(i=this.lworldOrgX+(t-this.ldeviceOrgX)*this.lworldExtX/l),i},e.prototype.inverseTransformY=function(t){var i=0,l=this.ldeviceExtY;return l!=0&&(i=this.lworldOrgY+(t-this.ldeviceOrgY)*this.lworldExtY/l),i},e.prototype.inverseTransformPoint=function(t){var i=new o(this.inverseTransformX(t.x),this.inverseTransformY(t.y));return i},N.exports=e}),(function(N,I,L){function o(r){if(Array.isArray(r)){for(var h=0,a=Array(r.length);ht.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*t.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(r-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-t.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT_INCREMENTAL):(r>t.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(t.COOLING_ADAPTATION_FACTOR,1-(r-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*(1-t.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},n.prototype.calcSpringForces=function(){for(var r=this.getAllEdges(),h,a=0;a0&&arguments[0]!==void 0?arguments[0]:!0,h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a,p,v,D,u=this.getAllNodes(),T;if(this.useFRGridVariant)for(this.totalIterations%t.GRID_CALCULATION_CHECK_PERIOD==1&&r&&this.updateGrid(),T=new Set,a=0;ay||T>y)&&(r.gravitationForceX=-this.gravityConstant*v,r.gravitationForceY=-this.gravityConstant*D)):(y=h.getEstimatedSize()*this.compoundGravityRangeFactor,(u>y||T>y)&&(r.gravitationForceX=-this.gravityConstant*v*this.compoundGravityConstant,r.gravitationForceY=-this.gravityConstant*D*this.compoundGravityConstant))},n.prototype.isConverged=function(){var r,h=!1;return this.totalIterations>this.maxIterations/3&&(h=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),r=this.totalDisplacement=u.length||y>=u[0].length)){for(var O=0;On}}]),l})();N.exports=i}),(function(N,I,L){var o=(function(){function i(l,g){for(var n=0;n2&&arguments[2]!==void 0?arguments[2]:1,d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;e(this,i),this.sequence1=l,this.sequence2=g,this.match_score=n,this.mismatch_penalty=d,this.gap_penalty=r,this.iMax=l.length+1,this.jMax=g.length+1,this.grid=new Array(this.iMax);for(var h=0;h=0;l--){var g=this.listeners[l];g.event===t&&g.callback===i&&this.listeners.splice(l,1)}},e.emit=function(t,i){for(var l=0;lg.coolingFactor*g.maxNodeDisplacement&&(this.displacementX=g.coolingFactor*g.maxNodeDisplacement*t.sign(this.displacementX)),Math.abs(this.displacementY)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementY=g.coolingFactor*g.maxNodeDisplacement*t.sign(this.displacementY)),this.child==null?this.moveBy(this.displacementX,this.displacementY):this.child.getNodes().length==0?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),g.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},i.prototype.propogateDisplacementToChildren=function(g,n){for(var d=this.getChild().getNodes(),r,h=0;h0)this.positionNodesRadially(s);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var f=new Set(this.getAllNodes()),c=this.nodesWithGravity.filter(function(E){return f.has(E)});this.graphManager.setAllNodesToApplyGravitation(c),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},y.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%d.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var s=new Set(this.getAllNodes()),f=this.nodesWithGravity.filter(function(A){return s.has(A)});this.graphManager.setAllNodesToApplyGravitation(f),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var c=!this.isTreeGrowing&&!this.isGrowthFinished,E=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(c,E),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},y.prototype.getPositionsData=function(){for(var s=this.graphManager.getAllNodes(),f={},c=0;c1){var R;for(R=0;RE&&(E=Math.floor(C.y)),m=Math.floor(C.x+n.DEFAULT_COMPONENT_SEPERATION)}this.transform(new a(r.WORLD_CENTER_X-C.x/2,r.WORLD_CENTER_Y-C.y/2))},y.radialLayout=function(s,f,c){var E=Math.max(this.maxDiagonalInTree(s),n.DEFAULT_RADIAL_SEPARATION);y.branchRadialLayout(f,null,0,359,0,E);var A=u.calculateBounds(s),m=new T;m.setDeviceOrgX(A.getMinX()),m.setDeviceOrgY(A.getMinY()),m.setWorldOrgX(c.x),m.setWorldOrgY(c.y);for(var C=0;C1;){var X=_[0];_.splice(0,1);var H=w.indexOf(X);H>=0&&w.splice(H,1),U--,x--}f!=null?P=(w.indexOf(_[0])+1)%U:P=0;for(var W=Math.abs(E-c)/x,B=P;F!=x;B=++B%U){var K=w[B].getOtherEnd(s);if(K!=f){var q=(c+F*W)%360,ht=(q+W)%360;y.branchRadialLayout(K,s,q,ht,A+m,m),F++}}},y.maxDiagonalInTree=function(s){for(var f=v.MIN_VALUE,c=0;cf&&(f=A)}return f},y.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},y.prototype.groupZeroDegreeMembers=function(){var s=this,f={};this.memberGroups={},this.idToDummyNode={};for(var c=[],E=this.graphManager.getAllNodes(),A=0;A"u"&&(f[R]=[]),f[R]=f[R].concat(m)}Object.keys(f).forEach(function(M){if(f[M].length>1){var S="DummyCompound_"+M;s.memberGroups[S]=f[M];var Y=f[M][0].getParent(),w=new l(s.graphManager);w.id=S,w.paddingLeft=Y.paddingLeft||0,w.paddingRight=Y.paddingRight||0,w.paddingBottom=Y.paddingBottom||0,w.paddingTop=Y.paddingTop||0,s.idToDummyNode[S]=w;var x=s.getGraphManager().add(s.newGraph(),w),F=Y.getChild();F.add(w);for(var U=0;U=0;s--){var f=this.compoundOrder[s],c=f.id,E=f.paddingLeft,A=f.paddingTop;this.adjustLocations(this.tiledMemberPack[c],f.rect.x,f.rect.y,E,A)}},y.prototype.repopulateZeroDegreeMembers=function(){var s=this,f=this.tiledZeroDegreePack;Object.keys(f).forEach(function(c){var E=s.idToDummyNode[c],A=E.paddingLeft,m=E.paddingTop;s.adjustLocations(f[c],E.rect.x,E.rect.y,A,m)})},y.prototype.getToBeTiled=function(s){var f=s.id;if(this.toBeTiled[f]!=null)return this.toBeTiled[f];var c=s.getChild();if(c==null)return this.toBeTiled[f]=!1,!1;for(var E=c.getNodes(),A=0;A0)return this.toBeTiled[f]=!1,!1;if(m.getChild()==null){this.toBeTiled[m.id]=!1;continue}if(!this.getToBeTiled(m))return this.toBeTiled[f]=!1,!1}return this.toBeTiled[f]=!0,!0},y.prototype.getNodeDegree=function(s){s.id;for(var f=s.getEdges(),c=0,E=0;EM&&(M=Y.rect.height)}c+=M+s.verticalPadding}},y.prototype.tileCompoundMembers=function(s,f){var c=this;this.tiledMemberPack=[],Object.keys(s).forEach(function(E){var A=f[E];c.tiledMemberPack[E]=c.tileNodes(s[E],A.paddingLeft+A.paddingRight),A.rect.width=c.tiledMemberPack[E].width,A.rect.height=c.tiledMemberPack[E].height})},y.prototype.tileNodes=function(s,f){var c=n.TILING_PADDING_VERTICAL,E=n.TILING_PADDING_HORIZONTAL,A={rows:[],rowWidth:[],rowHeight:[],width:0,height:f,verticalPadding:c,horizontalPadding:E};s.sort(function(R,M){return R.rect.width*R.rect.height>M.rect.width*M.rect.height?-1:R.rect.width*R.rect.height0&&(C+=s.horizontalPadding),s.rowWidth[c]=C,s.width0&&(R+=s.verticalPadding);var M=0;R>s.rowHeight[c]&&(M=s.rowHeight[c],s.rowHeight[c]=R,M=s.rowHeight[c]-M),s.height+=M,s.rows[c].push(f)},y.prototype.getShortestRowIndex=function(s){for(var f=-1,c=Number.MAX_VALUE,E=0;Ec&&(f=E,c=s.rowWidth[E]);return f},y.prototype.canAddHorizontal=function(s,f,c){var E=this.getShortestRowIndex(s);if(E<0)return!0;var A=s.rowWidth[E];if(A+s.horizontalPadding+f<=s.width)return!0;var m=0;s.rowHeight[E]0&&(m=c+s.verticalPadding-s.rowHeight[E]);var C;s.width-A>=f+s.horizontalPadding?C=(s.height+m)/(A+f+s.horizontalPadding):C=(s.height+m)/s.width,m=c+s.verticalPadding;var R;return s.widthm&&f!=c){E.splice(-1,1),s.rows[c].push(A),s.rowWidth[f]=s.rowWidth[f]-m,s.rowWidth[c]=s.rowWidth[c]+m,s.width=s.rowWidth[instance.getLongestRowIndex(s)];for(var C=Number.MIN_VALUE,R=0;RC&&(C=E[R].height);f>0&&(C+=s.verticalPadding);var M=s.rowHeight[f]+s.rowHeight[c];s.rowHeight[f]=C,s.rowHeight[c]0)for(var F=A;F<=m;F++)x[0]+=this.grid[F][C-1].length+this.grid[F][C].length-1;if(m0)for(var F=C;F<=R;F++)x[3]+=this.grid[A-1][F].length+this.grid[A][F].length-1;for(var U=v.MAX_VALUE,P,_,X=0;X0){var R;R=T.getGraphManager().add(T.newGraph(),c),this.processChildrenList(R,f,T)}}},a.prototype.stop=function(){return this.stopped=!0,this};var v=function(u){u("layout","cose-bilkent",a)};typeof cytoscape<"u"&&v(cytoscape),I.exports=v})])})})(Z)),Z.exports}var yt=vt();const Et=gt(yt);tt.use(Et);function et(G,b){G.forEach(N=>{const I={id:N.id,labelText:N.label,height:N.height,width:N.width,padding:N.padding??0};Object.keys(N).forEach(L=>{["id","label","height","width","padding","x","y"].includes(L)||(I[L]=N[L])}),b.add({group:"nodes",data:I,position:{x:N.x??0,y:N.y??0}})})}V(et,"addNodes");function rt(G,b){G.forEach(N=>{const I={id:N.id,source:N.start,target:N.end};Object.keys(N).forEach(L=>{["id","start","end"].includes(L)||(I[L]=N[L])}),b.add({group:"edges",data:I})})}V(rt,"addEdges");function it(G){return new Promise(b=>{const N=lt("body").append("div").attr("id","cy").attr("style","display:none"),I=tt({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});N.remove(),et(G.nodes,I),rt(G.edges,I),I.nodes().forEach(function(o){o.layoutDimensions=()=>{const e=o.data();return{w:e.width,h:e.height}}});const L={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};I.layout(L).run(),I.ready(o=>{k.info("Cytoscape ready",o),b(I)})})}V(it,"createCytoscapeInstance");function nt(G){return G.nodes().map(b=>{const N=b.data(),I=b.position(),L={id:N.id,x:I.x,y:I.y};return Object.keys(N).forEach(o=>{o!=="id"&&(L[o]=N[o])}),L})}V(nt,"extractPositionedNodes");function ot(G){return G.edges().map(b=>{const N=b.data(),I=b._private.rscratch,L={id:N.id,source:N.source,target:N.target,startX:I.startX,startY:I.startY,midX:I.midX,midY:I.midY,endX:I.endX,endY:I.endY};return Object.keys(N).forEach(o=>{["id","source","target"].includes(o)||(L[o]=N[o])}),L})}V(ot,"extractPositionedEdges");async function st(G,b){k.debug("Starting cose-bilkent layout algorithm");try{at(G);const N=await it(G),I=nt(N),L=ot(N);return k.debug(`Layout completed: ${I.length} nodes, ${L.length} edges`),{nodes:I,edges:L}}catch(N){throw k.error("Error in cose-bilkent layout algorithm:",N),N}}V(st,"executeCoseBilkentLayout");function at(G){if(!G)throw new Error("Layout data is required");if(!G.config)throw new Error("Configuration is required in layout data");if(!G.rootNode)throw new Error("Root node is required");if(!G.nodes||!Array.isArray(G.nodes))throw new Error("No nodes found in layout data");if(!Array.isArray(G.edges))throw new Error("Edges array is required in layout data");return!0}V(at,"validateLayoutData");var Lt=V(async(G,b,{insertCluster:N,insertEdge:I,insertEdgeLabel:L,insertMarkers:o,insertNode:e,log:t,positionEdgeLabel:i},{algorithm:l})=>{const g={},n={},d=b.select("g");o(d,G.markers,G.type,G.diagramId);const r=d.insert("g").attr("class","subgraphs"),h=d.insert("g").attr("class","edgePaths"),a=d.insert("g").attr("class","edgeLabels"),p=d.insert("g").attr("class","nodes");t.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(G.nodes.map(async u=>{if(u.isGroup){const T={...u};n[u.id]=T,g[u.id]=T,await N(r,u)}else{const T={...u};g[u.id]=T;const y=await e(p,u,{config:G.config,dir:G.direction||"TB"}),O=y.node().getBBox();T.width=O.width,T.height=O.height,T.domId=y,t.debug(`Node ${u.id} dimensions: ${O.width}x${O.height}`)}})),t.debug("Running cose-bilkent layout algorithm");const v={...G,nodes:G.nodes.map(u=>{const T=g[u.id];return{...u,width:T.width,height:T.height}})},D=await st(v,G.config);t.debug("Positioning nodes based on layout results"),D.nodes.forEach(u=>{const T=g[u.id];T?.domId&&(T.domId.attr("transform",`translate(${u.x}, ${u.y})`),T.x=u.x,T.y=u.y,t.debug(`Positioned node ${T.id} at center (${u.x}, ${u.y})`))}),D.edges.forEach(u=>{const T=G.edges.find(y=>y.id===u.id);T&&(T.points=[{x:u.startX,y:u.startY},{x:u.midX,y:u.midY},{x:u.endX,y:u.endY}])}),t.debug("Inserting and positioning edges"),await Promise.all(G.edges.map(async u=>{await L(a,u);const T=g[u.start??""],y=g[u.end??""];if(T&&y){const O=D.edges.find(s=>s.id===u.id);if(O){t.debug("APA01 positionedEdge",O);const s={...u},f=I(h,s,n,G.type,T,y,G.diagramId);i(s,f)}else{const s={...u,points:[{x:T.x||0,y:T.y||0},{x:y.x||0,y:y.y||0}]},f=I(h,s,n,G.type,T,y,G.diagramId);i(s,f)}}})),t.debug("Cose-bilkent rendering completed")},"render"),Ot=Lt;export{Ot as render}; +import{_ as V,l as k,d as lt}from"./mermaid.core-mH2pk-lc.js";import{c as tt}from"./cytoscape.esm-OyMbaexL.js";import{g as gt}from"./_commonjsHelpers-CqkleIqs.js";import"./index-BIElaaEN.js";var Z={exports:{}},$={exports:{}},Q={exports:{}},ut=Q.exports,j;function ft(){return j||(j=1,(function(G,b){(function(I,L){G.exports=L()})(ut,function(){return(function(N){var I={};function L(o){if(I[o])return I[o].exports;var e=I[o]={i:o,l:!1,exports:{}};return N[o].call(e.exports,e,e.exports,L),e.l=!0,e.exports}return L.m=N,L.c=I,L.i=function(o){return o},L.d=function(o,e,t){L.o(o,e)||Object.defineProperty(o,e,{configurable:!1,enumerable:!0,get:t})},L.n=function(o){var e=o&&o.__esModule?function(){return o.default}:function(){return o};return L.d(e,"a",e),e},L.o=function(o,e){return Object.prototype.hasOwnProperty.call(o,e)},L.p="",L(L.s=26)})([(function(N,I,L){function o(){}o.QUALITY=1,o.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,o.DEFAULT_INCREMENTAL=!1,o.DEFAULT_ANIMATION_ON_LAYOUT=!0,o.DEFAULT_ANIMATION_DURING_LAYOUT=!1,o.DEFAULT_ANIMATION_PERIOD=50,o.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,o.DEFAULT_GRAPH_MARGIN=15,o.NODE_DIMENSIONS_INCLUDE_LABELS=!1,o.SIMPLE_NODE_SIZE=40,o.SIMPLE_NODE_HALF_SIZE=o.SIMPLE_NODE_SIZE/2,o.EMPTY_COMPOUND_NODE_SIZE=40,o.MIN_EDGE_LENGTH=1,o.WORLD_BOUNDARY=1e6,o.INITIAL_WORLD_BOUNDARY=o.WORLD_BOUNDARY/1e3,o.WORLD_CENTER_X=1200,o.WORLD_CENTER_Y=900,N.exports=o}),(function(N,I,L){var o=L(2),e=L(8),t=L(9);function i(g,n,d){o.call(this,d),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=d,this.bendpoints=[],this.source=g,this.target=n}i.prototype=Object.create(o.prototype);for(var l in o)i[l]=o[l];i.prototype.getSource=function(){return this.source},i.prototype.getTarget=function(){return this.target},i.prototype.isInterGraph=function(){return this.isInterGraph},i.prototype.getLength=function(){return this.length},i.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},i.prototype.getBendpoints=function(){return this.bendpoints},i.prototype.getLca=function(){return this.lca},i.prototype.getSourceInLca=function(){return this.sourceInLca},i.prototype.getTargetInLca=function(){return this.targetInLca},i.prototype.getOtherEnd=function(g){if(this.source===g)return this.target;if(this.target===g)return this.source;throw"Node is not incident with this edge"},i.prototype.getOtherEndInGraph=function(g,n){for(var d=this.getOtherEnd(g),r=n.getGraphManager().getRoot();;){if(d.getOwner()==n)return d;if(d.getOwner()==r)break;d=d.getOwner().getParent()}return null},i.prototype.updateLength=function(){var g=new Array(4);this.isOverlapingSourceAndTarget=e.getIntersection(this.target.getRect(),this.source.getRect(),g),this.isOverlapingSourceAndTarget||(this.lengthX=g[0]-g[2],this.lengthY=g[1]-g[3],Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},i.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},N.exports=i}),(function(N,I,L){function o(e){this.vGraphObject=e}N.exports=o}),(function(N,I,L){var o=L(2),e=L(10),t=L(13),i=L(0),l=L(16),g=L(4);function n(r,h,a,p){a==null&&p==null&&(p=h),o.call(this,p),r.graphManager!=null&&(r=r.graphManager),this.estimatedSize=e.MIN_VALUE,this.inclusionTreeDepth=e.MAX_VALUE,this.vGraphObject=p,this.edges=[],this.graphManager=r,a!=null&&h!=null?this.rect=new t(h.x,h.y,a.width,a.height):this.rect=new t}n.prototype=Object.create(o.prototype);for(var d in o)n[d]=o[d];n.prototype.getEdges=function(){return this.edges},n.prototype.getChild=function(){return this.child},n.prototype.getOwner=function(){return this.owner},n.prototype.getWidth=function(){return this.rect.width},n.prototype.setWidth=function(r){this.rect.width=r},n.prototype.getHeight=function(){return this.rect.height},n.prototype.setHeight=function(r){this.rect.height=r},n.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},n.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},n.prototype.getCenter=function(){return new g(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},n.prototype.getLocation=function(){return new g(this.rect.x,this.rect.y)},n.prototype.getRect=function(){return this.rect},n.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},n.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},n.prototype.setRect=function(r,h){this.rect.x=r.x,this.rect.y=r.y,this.rect.width=h.width,this.rect.height=h.height},n.prototype.setCenter=function(r,h){this.rect.x=r-this.rect.width/2,this.rect.y=h-this.rect.height/2},n.prototype.setLocation=function(r,h){this.rect.x=r,this.rect.y=h},n.prototype.moveBy=function(r,h){this.rect.x+=r,this.rect.y+=h},n.prototype.getEdgeListToNode=function(r){var h=[],a=this;return a.edges.forEach(function(p){if(p.target==r){if(p.source!=a)throw"Incorrect edge source!";h.push(p)}}),h},n.prototype.getEdgesBetween=function(r){var h=[],a=this;return a.edges.forEach(function(p){if(!(p.source==a||p.target==a))throw"Incorrect edge source and/or target";(p.target==r||p.source==r)&&h.push(p)}),h},n.prototype.getNeighborsList=function(){var r=new Set,h=this;return h.edges.forEach(function(a){if(a.source==h)r.add(a.target);else{if(a.target!=h)throw"Incorrect incidency!";r.add(a.source)}}),r},n.prototype.withChildren=function(){var r=new Set,h,a;if(r.add(this),this.child!=null)for(var p=this.child.getNodes(),v=0;vh&&(this.rect.x-=(this.labelWidth-h)/2,this.setWidth(this.labelWidth)),this.labelHeight>a&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-a)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-a),this.setHeight(this.labelHeight))}}},n.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==e.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},n.prototype.transform=function(r){var h=this.rect.x;h>i.WORLD_BOUNDARY?h=i.WORLD_BOUNDARY:h<-i.WORLD_BOUNDARY&&(h=-i.WORLD_BOUNDARY);var a=this.rect.y;a>i.WORLD_BOUNDARY?a=i.WORLD_BOUNDARY:a<-i.WORLD_BOUNDARY&&(a=-i.WORLD_BOUNDARY);var p=new g(h,a),v=r.inverseTransformPoint(p);this.setLocation(v.x,v.y)},n.prototype.getLeft=function(){return this.rect.x},n.prototype.getRight=function(){return this.rect.x+this.rect.width},n.prototype.getTop=function(){return this.rect.y},n.prototype.getBottom=function(){return this.rect.y+this.rect.height},n.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},N.exports=n}),(function(N,I,L){function o(e,t){e==null&&t==null?(this.x=0,this.y=0):(this.x=e,this.y=t)}o.prototype.getX=function(){return this.x},o.prototype.getY=function(){return this.y},o.prototype.setX=function(e){this.x=e},o.prototype.setY=function(e){this.y=e},o.prototype.getDifference=function(e){return new DimensionD(this.x-e.x,this.y-e.y)},o.prototype.getCopy=function(){return new o(this.x,this.y)},o.prototype.translate=function(e){return this.x+=e.width,this.y+=e.height,this},N.exports=o}),(function(N,I,L){var o=L(2),e=L(10),t=L(0),i=L(6),l=L(3),g=L(1),n=L(13),d=L(12),r=L(11);function h(p,v,D){o.call(this,D),this.estimatedSize=e.MIN_VALUE,this.margin=t.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=p,v!=null&&v instanceof i?this.graphManager=v:v!=null&&v instanceof Layout&&(this.graphManager=v.graphManager)}h.prototype=Object.create(o.prototype);for(var a in o)h[a]=o[a];h.prototype.getNodes=function(){return this.nodes},h.prototype.getEdges=function(){return this.edges},h.prototype.getGraphManager=function(){return this.graphManager},h.prototype.getParent=function(){return this.parent},h.prototype.getLeft=function(){return this.left},h.prototype.getRight=function(){return this.right},h.prototype.getTop=function(){return this.top},h.prototype.getBottom=function(){return this.bottom},h.prototype.isConnected=function(){return this.isConnected},h.prototype.add=function(p,v,D){if(v==null&&D==null){var u=p;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(u)>-1)throw"Node already in graph!";return u.owner=this,this.getNodes().push(u),u}else{var T=p;if(!(this.getNodes().indexOf(v)>-1&&this.getNodes().indexOf(D)>-1))throw"Source or target not in graph!";if(!(v.owner==D.owner&&v.owner==this))throw"Both owners must be this graph!";return v.owner!=D.owner?null:(T.source=v,T.target=D,T.isInterGraph=!1,this.getEdges().push(T),v.edges.push(T),D!=v&&D.edges.push(T),T)}},h.prototype.remove=function(p){var v=p;if(p instanceof l){if(v==null)throw"Node is null!";if(!(v.owner!=null&&v.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var D=v.edges.slice(),u,T=D.length,y=0;y-1&&f>-1))throw"Source and/or target doesn't know this edge!";u.source.edges.splice(s,1),u.target!=u.source&&u.target.edges.splice(f,1);var O=u.source.owner.getEdges().indexOf(u);if(O==-1)throw"Not in owner's edge list!";u.source.owner.getEdges().splice(O,1)}},h.prototype.updateLeftTop=function(){for(var p=e.MAX_VALUE,v=e.MAX_VALUE,D,u,T,y=this.getNodes(),O=y.length,s=0;sD&&(p=D),v>u&&(v=u)}return p==e.MAX_VALUE?null:(y[0].getParent().paddingLeft!=null?T=y[0].getParent().paddingLeft:T=this.margin,this.left=v-T,this.top=p-T,new d(this.left,this.top))},h.prototype.updateBounds=function(p){for(var v=e.MAX_VALUE,D=-e.MAX_VALUE,u=e.MAX_VALUE,T=-e.MAX_VALUE,y,O,s,f,c,E=this.nodes,A=E.length,m=0;my&&(v=y),Ds&&(u=s),Ty&&(v=y),Ds&&(u=s),T=this.nodes.length){var A=0;D.forEach(function(m){m.owner==p&&A++}),A==this.nodes.length&&(this.isConnected=!0)}},N.exports=h}),(function(N,I,L){var o,e=L(1);function t(i){o=L(5),this.layout=i,this.graphs=[],this.edges=[]}t.prototype.addRoot=function(){var i=this.layout.newGraph(),l=this.layout.newNode(null),g=this.add(i,l);return this.setRootGraph(g),this.rootGraph},t.prototype.add=function(i,l,g,n,d){if(g==null&&n==null&&d==null){if(i==null)throw"Graph is null!";if(l==null)throw"Parent node is null!";if(this.graphs.indexOf(i)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(i),i.parent!=null)throw"Already has a parent!";if(l.child!=null)throw"Already has a child!";return i.parent=l,l.child=i,i}else{d=g,n=l,g=i;var r=n.getOwner(),h=d.getOwner();if(!(r!=null&&r.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(h!=null&&h.getGraphManager()==this))throw"Target not in this graph mgr!";if(r==h)return g.isInterGraph=!1,r.add(g,n,d);if(g.isInterGraph=!0,g.source=n,g.target=d,this.edges.indexOf(g)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(g),!(g.source!=null&&g.target!=null))throw"Edge source and/or target is null!";if(!(g.source.edges.indexOf(g)==-1&&g.target.edges.indexOf(g)==-1))throw"Edge already in source and/or target incidency list!";return g.source.edges.push(g),g.target.edges.push(g),g}},t.prototype.remove=function(i){if(i instanceof o){var l=i;if(l.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(l==this.rootGraph||l.parent!=null&&l.parent.graphManager==this))throw"Invalid parent node!";var g=[];g=g.concat(l.getEdges());for(var n,d=g.length,r=0;r=i.getRight()?l[0]+=Math.min(i.getX()-t.getX(),t.getRight()-i.getRight()):i.getX()<=t.getX()&&i.getRight()>=t.getRight()&&(l[0]+=Math.min(t.getX()-i.getX(),i.getRight()-t.getRight())),t.getY()<=i.getY()&&t.getBottom()>=i.getBottom()?l[1]+=Math.min(i.getY()-t.getY(),t.getBottom()-i.getBottom()):i.getY()<=t.getY()&&i.getBottom()>=t.getBottom()&&(l[1]+=Math.min(t.getY()-i.getY(),i.getBottom()-t.getBottom()));var d=Math.abs((i.getCenterY()-t.getCenterY())/(i.getCenterX()-t.getCenterX()));i.getCenterY()===t.getCenterY()&&i.getCenterX()===t.getCenterX()&&(d=1);var r=d*l[0],h=l[1]/d;l[0]r)return l[0]=g,l[1]=a,l[2]=d,l[3]=E,!1;if(nd)return l[0]=h,l[1]=n,l[2]=f,l[3]=r,!1;if(gd?(l[0]=v,l[1]=D,R=!0):(l[0]=p,l[1]=a,R=!0):S===w&&(g>d?(l[0]=h,l[1]=a,R=!0):(l[0]=u,l[1]=D,R=!0)),-Y===w?d>g?(l[2]=c,l[3]=E,M=!0):(l[2]=f,l[3]=s,M=!0):Y===w&&(d>g?(l[2]=O,l[3]=s,M=!0):(l[2]=A,l[3]=E,M=!0)),R&&M)return!1;if(g>d?n>r?(x=this.getCardinalDirection(S,w,4),F=this.getCardinalDirection(Y,w,2)):(x=this.getCardinalDirection(-S,w,3),F=this.getCardinalDirection(-Y,w,1)):n>r?(x=this.getCardinalDirection(-S,w,1),F=this.getCardinalDirection(-Y,w,3)):(x=this.getCardinalDirection(S,w,2),F=this.getCardinalDirection(Y,w,4)),!R)switch(x){case 1:P=a,U=g+-y/w,l[0]=U,l[1]=P;break;case 2:U=u,P=n+T*w,l[0]=U,l[1]=P;break;case 3:P=D,U=g+y/w,l[0]=U,l[1]=P;break;case 4:U=v,P=n+-T*w,l[0]=U,l[1]=P;break}if(!M)switch(F){case 1:X=s,_=d+-C/w,l[2]=_,l[3]=X;break;case 2:_=A,X=r+m*w,l[2]=_,l[3]=X;break;case 3:X=E,_=d+C/w,l[2]=_,l[3]=X;break;case 4:_=c,X=r+-m*w,l[2]=_,l[3]=X;break}}return!1},e.getCardinalDirection=function(t,i,l){return t>i?l:1+l%4},e.getIntersection=function(t,i,l,g){if(g==null)return this.getIntersection2(t,i,l);var n=t.x,d=t.y,r=i.x,h=i.y,a=l.x,p=l.y,v=g.x,D=g.y,u=void 0,T=void 0,y=void 0,O=void 0,s=void 0,f=void 0,c=void 0,E=void 0,A=void 0;return y=h-d,s=n-r,c=r*d-n*h,O=D-p,f=a-v,E=v*p-a*D,A=y*f-O*s,A===0?null:(u=(s*E-f*c)/A,T=(O*c-y*E)/A,new o(u,T))},e.angleOfVector=function(t,i,l,g){var n=void 0;return t!==l?(n=Math.atan((g-i)/(l-t)),l0?1:e<0?-1:0},o.floor=function(e){return e<0?Math.ceil(e):Math.floor(e)},o.ceil=function(e){return e<0?Math.floor(e):Math.ceil(e)},N.exports=o}),(function(N,I,L){function o(){}o.MAX_VALUE=2147483647,o.MIN_VALUE=-2147483648,N.exports=o}),(function(N,I,L){var o=(function(){function n(d,r){for(var h=0;h"u"?"undefined":o(t);return t==null||i!="object"&&i!="function"},N.exports=e}),(function(N,I,L){function o(a){if(Array.isArray(a)){for(var p=0,v=Array(a.length);p0&&p;){for(y.push(s[0]);y.length>0&&p;){var f=y[0];y.splice(0,1),T.add(f);for(var c=f.getEdges(),u=0;u-1&&s.splice(C,1)}T=new Set,O=new Map}}return a},h.prototype.createDummyNodesForBendpoints=function(a){for(var p=[],v=a.source,D=this.graphManager.calcLowestCommonAncestor(a.source,a.target),u=0;u0){for(var D=this.edgeToDummyNodes.get(v),u=0;u=0&&p.splice(E,1);var A=O.getNeighborsList();A.forEach(function(R){if(v.indexOf(R)<0){var M=D.get(R),S=M-1;S==1&&f.push(R),D.set(R,S)}})}v=v.concat(f),(p.length==1||p.length==2)&&(u=!0,T=p[0])}return T},h.prototype.setGraphManager=function(a){this.graphManager=a},N.exports=h}),(function(N,I,L){function o(){}o.seed=1,o.x=0,o.nextDouble=function(){return o.x=Math.sin(o.seed++)*1e4,o.x-Math.floor(o.x)},N.exports=o}),(function(N,I,L){var o=L(4);function e(t,i){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}e.prototype.getWorldOrgX=function(){return this.lworldOrgX},e.prototype.setWorldOrgX=function(t){this.lworldOrgX=t},e.prototype.getWorldOrgY=function(){return this.lworldOrgY},e.prototype.setWorldOrgY=function(t){this.lworldOrgY=t},e.prototype.getWorldExtX=function(){return this.lworldExtX},e.prototype.setWorldExtX=function(t){this.lworldExtX=t},e.prototype.getWorldExtY=function(){return this.lworldExtY},e.prototype.setWorldExtY=function(t){this.lworldExtY=t},e.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},e.prototype.setDeviceOrgX=function(t){this.ldeviceOrgX=t},e.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},e.prototype.setDeviceOrgY=function(t){this.ldeviceOrgY=t},e.prototype.getDeviceExtX=function(){return this.ldeviceExtX},e.prototype.setDeviceExtX=function(t){this.ldeviceExtX=t},e.prototype.getDeviceExtY=function(){return this.ldeviceExtY},e.prototype.setDeviceExtY=function(t){this.ldeviceExtY=t},e.prototype.transformX=function(t){var i=0,l=this.lworldExtX;return l!=0&&(i=this.ldeviceOrgX+(t-this.lworldOrgX)*this.ldeviceExtX/l),i},e.prototype.transformY=function(t){var i=0,l=this.lworldExtY;return l!=0&&(i=this.ldeviceOrgY+(t-this.lworldOrgY)*this.ldeviceExtY/l),i},e.prototype.inverseTransformX=function(t){var i=0,l=this.ldeviceExtX;return l!=0&&(i=this.lworldOrgX+(t-this.ldeviceOrgX)*this.lworldExtX/l),i},e.prototype.inverseTransformY=function(t){var i=0,l=this.ldeviceExtY;return l!=0&&(i=this.lworldOrgY+(t-this.ldeviceOrgY)*this.lworldExtY/l),i},e.prototype.inverseTransformPoint=function(t){var i=new o(this.inverseTransformX(t.x),this.inverseTransformY(t.y));return i},N.exports=e}),(function(N,I,L){function o(r){if(Array.isArray(r)){for(var h=0,a=Array(r.length);ht.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*t.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(r-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-t.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT_INCREMENTAL):(r>t.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(t.COOLING_ADAPTATION_FACTOR,1-(r-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*(1-t.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},n.prototype.calcSpringForces=function(){for(var r=this.getAllEdges(),h,a=0;a0&&arguments[0]!==void 0?arguments[0]:!0,h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a,p,v,D,u=this.getAllNodes(),T;if(this.useFRGridVariant)for(this.totalIterations%t.GRID_CALCULATION_CHECK_PERIOD==1&&r&&this.updateGrid(),T=new Set,a=0;ay||T>y)&&(r.gravitationForceX=-this.gravityConstant*v,r.gravitationForceY=-this.gravityConstant*D)):(y=h.getEstimatedSize()*this.compoundGravityRangeFactor,(u>y||T>y)&&(r.gravitationForceX=-this.gravityConstant*v*this.compoundGravityConstant,r.gravitationForceY=-this.gravityConstant*D*this.compoundGravityConstant))},n.prototype.isConverged=function(){var r,h=!1;return this.totalIterations>this.maxIterations/3&&(h=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),r=this.totalDisplacement=u.length||y>=u[0].length)){for(var O=0;On}}]),l})();N.exports=i}),(function(N,I,L){var o=(function(){function i(l,g){for(var n=0;n2&&arguments[2]!==void 0?arguments[2]:1,d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;e(this,i),this.sequence1=l,this.sequence2=g,this.match_score=n,this.mismatch_penalty=d,this.gap_penalty=r,this.iMax=l.length+1,this.jMax=g.length+1,this.grid=new Array(this.iMax);for(var h=0;h=0;l--){var g=this.listeners[l];g.event===t&&g.callback===i&&this.listeners.splice(l,1)}},e.emit=function(t,i){for(var l=0;lg.coolingFactor*g.maxNodeDisplacement&&(this.displacementX=g.coolingFactor*g.maxNodeDisplacement*t.sign(this.displacementX)),Math.abs(this.displacementY)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementY=g.coolingFactor*g.maxNodeDisplacement*t.sign(this.displacementY)),this.child==null?this.moveBy(this.displacementX,this.displacementY):this.child.getNodes().length==0?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),g.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},i.prototype.propogateDisplacementToChildren=function(g,n){for(var d=this.getChild().getNodes(),r,h=0;h0)this.positionNodesRadially(s);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var f=new Set(this.getAllNodes()),c=this.nodesWithGravity.filter(function(E){return f.has(E)});this.graphManager.setAllNodesToApplyGravitation(c),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},y.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%d.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var s=new Set(this.getAllNodes()),f=this.nodesWithGravity.filter(function(A){return s.has(A)});this.graphManager.setAllNodesToApplyGravitation(f),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var c=!this.isTreeGrowing&&!this.isGrowthFinished,E=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(c,E),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},y.prototype.getPositionsData=function(){for(var s=this.graphManager.getAllNodes(),f={},c=0;c1){var R;for(R=0;RE&&(E=Math.floor(C.y)),m=Math.floor(C.x+n.DEFAULT_COMPONENT_SEPERATION)}this.transform(new a(r.WORLD_CENTER_X-C.x/2,r.WORLD_CENTER_Y-C.y/2))},y.radialLayout=function(s,f,c){var E=Math.max(this.maxDiagonalInTree(s),n.DEFAULT_RADIAL_SEPARATION);y.branchRadialLayout(f,null,0,359,0,E);var A=u.calculateBounds(s),m=new T;m.setDeviceOrgX(A.getMinX()),m.setDeviceOrgY(A.getMinY()),m.setWorldOrgX(c.x),m.setWorldOrgY(c.y);for(var C=0;C1;){var X=_[0];_.splice(0,1);var H=w.indexOf(X);H>=0&&w.splice(H,1),U--,x--}f!=null?P=(w.indexOf(_[0])+1)%U:P=0;for(var W=Math.abs(E-c)/x,B=P;F!=x;B=++B%U){var K=w[B].getOtherEnd(s);if(K!=f){var q=(c+F*W)%360,ht=(q+W)%360;y.branchRadialLayout(K,s,q,ht,A+m,m),F++}}},y.maxDiagonalInTree=function(s){for(var f=v.MIN_VALUE,c=0;cf&&(f=A)}return f},y.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},y.prototype.groupZeroDegreeMembers=function(){var s=this,f={};this.memberGroups={},this.idToDummyNode={};for(var c=[],E=this.graphManager.getAllNodes(),A=0;A"u"&&(f[R]=[]),f[R]=f[R].concat(m)}Object.keys(f).forEach(function(M){if(f[M].length>1){var S="DummyCompound_"+M;s.memberGroups[S]=f[M];var Y=f[M][0].getParent(),w=new l(s.graphManager);w.id=S,w.paddingLeft=Y.paddingLeft||0,w.paddingRight=Y.paddingRight||0,w.paddingBottom=Y.paddingBottom||0,w.paddingTop=Y.paddingTop||0,s.idToDummyNode[S]=w;var x=s.getGraphManager().add(s.newGraph(),w),F=Y.getChild();F.add(w);for(var U=0;U=0;s--){var f=this.compoundOrder[s],c=f.id,E=f.paddingLeft,A=f.paddingTop;this.adjustLocations(this.tiledMemberPack[c],f.rect.x,f.rect.y,E,A)}},y.prototype.repopulateZeroDegreeMembers=function(){var s=this,f=this.tiledZeroDegreePack;Object.keys(f).forEach(function(c){var E=s.idToDummyNode[c],A=E.paddingLeft,m=E.paddingTop;s.adjustLocations(f[c],E.rect.x,E.rect.y,A,m)})},y.prototype.getToBeTiled=function(s){var f=s.id;if(this.toBeTiled[f]!=null)return this.toBeTiled[f];var c=s.getChild();if(c==null)return this.toBeTiled[f]=!1,!1;for(var E=c.getNodes(),A=0;A0)return this.toBeTiled[f]=!1,!1;if(m.getChild()==null){this.toBeTiled[m.id]=!1;continue}if(!this.getToBeTiled(m))return this.toBeTiled[f]=!1,!1}return this.toBeTiled[f]=!0,!0},y.prototype.getNodeDegree=function(s){s.id;for(var f=s.getEdges(),c=0,E=0;EM&&(M=Y.rect.height)}c+=M+s.verticalPadding}},y.prototype.tileCompoundMembers=function(s,f){var c=this;this.tiledMemberPack=[],Object.keys(s).forEach(function(E){var A=f[E];c.tiledMemberPack[E]=c.tileNodes(s[E],A.paddingLeft+A.paddingRight),A.rect.width=c.tiledMemberPack[E].width,A.rect.height=c.tiledMemberPack[E].height})},y.prototype.tileNodes=function(s,f){var c=n.TILING_PADDING_VERTICAL,E=n.TILING_PADDING_HORIZONTAL,A={rows:[],rowWidth:[],rowHeight:[],width:0,height:f,verticalPadding:c,horizontalPadding:E};s.sort(function(R,M){return R.rect.width*R.rect.height>M.rect.width*M.rect.height?-1:R.rect.width*R.rect.height0&&(C+=s.horizontalPadding),s.rowWidth[c]=C,s.width0&&(R+=s.verticalPadding);var M=0;R>s.rowHeight[c]&&(M=s.rowHeight[c],s.rowHeight[c]=R,M=s.rowHeight[c]-M),s.height+=M,s.rows[c].push(f)},y.prototype.getShortestRowIndex=function(s){for(var f=-1,c=Number.MAX_VALUE,E=0;Ec&&(f=E,c=s.rowWidth[E]);return f},y.prototype.canAddHorizontal=function(s,f,c){var E=this.getShortestRowIndex(s);if(E<0)return!0;var A=s.rowWidth[E];if(A+s.horizontalPadding+f<=s.width)return!0;var m=0;s.rowHeight[E]0&&(m=c+s.verticalPadding-s.rowHeight[E]);var C;s.width-A>=f+s.horizontalPadding?C=(s.height+m)/(A+f+s.horizontalPadding):C=(s.height+m)/s.width,m=c+s.verticalPadding;var R;return s.widthm&&f!=c){E.splice(-1,1),s.rows[c].push(A),s.rowWidth[f]=s.rowWidth[f]-m,s.rowWidth[c]=s.rowWidth[c]+m,s.width=s.rowWidth[instance.getLongestRowIndex(s)];for(var C=Number.MIN_VALUE,R=0;RC&&(C=E[R].height);f>0&&(C+=s.verticalPadding);var M=s.rowHeight[f]+s.rowHeight[c];s.rowHeight[f]=C,s.rowHeight[c]0)for(var F=A;F<=m;F++)x[0]+=this.grid[F][C-1].length+this.grid[F][C].length-1;if(m0)for(var F=C;F<=R;F++)x[3]+=this.grid[A-1][F].length+this.grid[A][F].length-1;for(var U=v.MAX_VALUE,P,_,X=0;X0){var R;R=T.getGraphManager().add(T.newGraph(),c),this.processChildrenList(R,f,T)}}},a.prototype.stop=function(){return this.stopped=!0,this};var v=function(u){u("layout","cose-bilkent",a)};typeof cytoscape<"u"&&v(cytoscape),I.exports=v})])})})(Z)),Z.exports}var yt=vt();const Et=gt(yt);tt.use(Et);function et(G,b){G.forEach(N=>{const I={id:N.id,labelText:N.label,height:N.height,width:N.width,padding:N.padding??0};Object.keys(N).forEach(L=>{["id","label","height","width","padding","x","y"].includes(L)||(I[L]=N[L])}),b.add({group:"nodes",data:I,position:{x:N.x??0,y:N.y??0}})})}V(et,"addNodes");function rt(G,b){G.forEach(N=>{const I={id:N.id,source:N.start,target:N.end};Object.keys(N).forEach(L=>{["id","start","end"].includes(L)||(I[L]=N[L])}),b.add({group:"edges",data:I})})}V(rt,"addEdges");function it(G){return new Promise(b=>{const N=lt("body").append("div").attr("id","cy").attr("style","display:none"),I=tt({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});N.remove(),et(G.nodes,I),rt(G.edges,I),I.nodes().forEach(function(o){o.layoutDimensions=()=>{const e=o.data();return{w:e.width,h:e.height}}});const L={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};I.layout(L).run(),I.ready(o=>{k.info("Cytoscape ready",o),b(I)})})}V(it,"createCytoscapeInstance");function nt(G){return G.nodes().map(b=>{const N=b.data(),I=b.position(),L={id:N.id,x:I.x,y:I.y};return Object.keys(N).forEach(o=>{o!=="id"&&(L[o]=N[o])}),L})}V(nt,"extractPositionedNodes");function ot(G){return G.edges().map(b=>{const N=b.data(),I=b._private.rscratch,L={id:N.id,source:N.source,target:N.target,startX:I.startX,startY:I.startY,midX:I.midX,midY:I.midY,endX:I.endX,endY:I.endY};return Object.keys(N).forEach(o=>{["id","source","target"].includes(o)||(L[o]=N[o])}),L})}V(ot,"extractPositionedEdges");async function st(G,b){k.debug("Starting cose-bilkent layout algorithm");try{at(G);const N=await it(G),I=nt(N),L=ot(N);return k.debug(`Layout completed: ${I.length} nodes, ${L.length} edges`),{nodes:I,edges:L}}catch(N){throw k.error("Error in cose-bilkent layout algorithm:",N),N}}V(st,"executeCoseBilkentLayout");function at(G){if(!G)throw new Error("Layout data is required");if(!G.config)throw new Error("Configuration is required in layout data");if(!G.rootNode)throw new Error("Root node is required");if(!G.nodes||!Array.isArray(G.nodes))throw new Error("No nodes found in layout data");if(!Array.isArray(G.edges))throw new Error("Edges array is required in layout data");return!0}V(at,"validateLayoutData");var Lt=V(async(G,b,{insertCluster:N,insertEdge:I,insertEdgeLabel:L,insertMarkers:o,insertNode:e,log:t,positionEdgeLabel:i},{algorithm:l})=>{const g={},n={},d=b.select("g");o(d,G.markers,G.type,G.diagramId);const r=d.insert("g").attr("class","subgraphs"),h=d.insert("g").attr("class","edgePaths"),a=d.insert("g").attr("class","edgeLabels"),p=d.insert("g").attr("class","nodes");t.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(G.nodes.map(async u=>{if(u.isGroup){const T={...u};n[u.id]=T,g[u.id]=T,await N(r,u)}else{const T={...u};g[u.id]=T;const y=await e(p,u,{config:G.config,dir:G.direction||"TB"}),O=y.node().getBBox();T.width=O.width,T.height=O.height,T.domId=y,t.debug(`Node ${u.id} dimensions: ${O.width}x${O.height}`)}})),t.debug("Running cose-bilkent layout algorithm");const v={...G,nodes:G.nodes.map(u=>{const T=g[u.id];return{...u,width:T.width,height:T.height}})},D=await st(v,G.config);t.debug("Positioning nodes based on layout results"),D.nodes.forEach(u=>{const T=g[u.id];T?.domId&&(T.domId.attr("transform",`translate(${u.x}, ${u.y})`),T.x=u.x,T.y=u.y,t.debug(`Positioned node ${T.id} at center (${u.x}, ${u.y})`))}),D.edges.forEach(u=>{const T=G.edges.find(y=>y.id===u.id);T&&(T.points=[{x:u.startX,y:u.startY},{x:u.midX,y:u.midY},{x:u.endX,y:u.endY}])}),t.debug("Inserting and positioning edges"),await Promise.all(G.edges.map(async u=>{await L(a,u);const T=g[u.start??""],y=g[u.end??""];if(T&&y){const O=D.edges.find(s=>s.id===u.id);if(O){t.debug("APA01 positionedEdge",O);const s={...u},f=I(h,s,n,G.type,T,y,G.diagramId);i(s,f)}else{const s={...u,points:[{x:T.x||0,y:T.y||0},{x:y.x||0,y:y.y||0}]},f=I(h,s,n,G.type,T,y,G.diagramId);i(s,f)}}})),t.debug("Cose-bilkent rendering completed")},"render"),Ot=Lt;export{Ot as render}; diff --git a/apps/kimi-code/dist-web/assets/cynefin-VYW2F7L2-DI-9Z5R0.js b/apps/kimi-code/dist-web/assets/cynefin-VYW2F7L2-BD8Xugtm.js similarity index 99% rename from apps/kimi-code/dist-web/assets/cynefin-VYW2F7L2-DI-9Z5R0.js rename to apps/kimi-code/dist-web/assets/cynefin-VYW2F7L2-BD8Xugtm.js index e219db65b91..dc749eb6316 100644 --- a/apps/kimi-code/dist-web/assets/cynefin-VYW2F7L2-DI-9Z5R0.js +++ b/apps/kimi-code/dist-web/assets/cynefin-VYW2F7L2-BD8Xugtm.js @@ -1,4 +1,4 @@ -import{bR as et}from"./index-CiHMlsuo.js";var RI=Object.create,Ds=Object.defineProperty,AI=Object.getOwnPropertyDescriptor,Ad=Object.getOwnPropertyNames,EI=Object.getPrototypeOf,CI=Object.prototype.hasOwnProperty,i=(e,t)=>Ds(e,"name",{value:t,configurable:!0}),bI=(e,t)=>function(){return e&&(t=(0,e[Ad(e)[0]])(e=0)),t},H=(e,t)=>function(){return t||(0,e[Ad(e)[0]])((t={exports:{}}).exports,t),t.exports},Vr=(e,t)=>{for(var r in t)Ds(e,r,{get:t[r],enumerable:!0})},Ed=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Ad(t))!CI.call(e,a)&&a!==r&&Ds(e,a,{get:()=>t[a],enumerable:!(n=AI(t,a))||n.enumerable});return e},Ll=(e,t,r)=>(Ed(e,t,"default"),r),Cd=(e,t,r)=>(r=e!=null?RI(EI(e)):{},Ed(Ds(r,"default",{value:e,enumerable:!0}),e)),bd=e=>Ed(Ds({},"__esModule",{value:!0}),e),Dl={};Vr(Dl,{AnnotatedTextEdit:()=>mr,ChangeAnnotation:()=>an,ChangeAnnotationIdentifier:()=>Ke,CodeAction:()=>ef,CodeActionContext:()=>Qc,CodeActionKind:()=>Zc,CodeActionTriggerKind:()=>Xi,CodeDescription:()=>Nc,CodeLens:()=>tf,Color:()=>Co,ColorInformation:()=>Cc,ColorPresentation:()=>bc,Command:()=>nn,CompletionItem:()=>zc,CompletionItemKind:()=>Lc,CompletionItemLabelDetails:()=>Fc,CompletionItemTag:()=>xc,CompletionList:()=>jc,CreateFile:()=>ya,DeleteFile:()=>va,Diagnostic:()=>Vi,DiagnosticRelatedInformation:()=>bo,DiagnosticSeverity:()=>wc,DiagnosticTag:()=>Ic,DocumentHighlight:()=>Vc,DocumentHighlightKind:()=>Wc,DocumentLink:()=>nf,DocumentSymbol:()=>Jc,DocumentUri:()=>Rc,EOL:()=>zg,FoldingRange:()=>Sc,FoldingRangeKind:()=>_c,FormattingOptions:()=>rf,Hover:()=>Bc,InlayHint:()=>pf,InlayHintKind:()=>wo,InlayHintLabelPart:()=>Io,InlineCompletionContext:()=>Tf,InlineCompletionItem:()=>hf,InlineCompletionList:()=>yf,InlineCompletionTriggerKind:()=>gf,InlineValueContext:()=>df,InlineValueEvaluatableExpression:()=>ff,InlineValueText:()=>uf,InlineValueVariableLookup:()=>cf,InsertReplaceEdit:()=>Mc,InsertTextFormat:()=>Dc,InsertTextMode:()=>Gc,Location:()=>Wi,LocationLink:()=>Ec,MarkedString:()=>Yi,MarkupContent:()=>Ta,MarkupKind:()=>So,OptionalVersionedTextDocumentIdentifier:()=>Hi,ParameterInformation:()=>Uc,Position:()=>ie,Range:()=>Q,RenameFile:()=>ga,SelectedCompletionInfo:()=>vf,SelectionRange:()=>af,SemanticTokenModifiers:()=>of,SemanticTokenTypes:()=>sf,SemanticTokens:()=>lf,SignatureInformation:()=>Kc,StringValue:()=>mf,SymbolInformation:()=>Yc,SymbolKind:()=>qc,SymbolTag:()=>Hc,TextDocument:()=>Rf,TextDocumentEdit:()=>qi,TextDocumentIdentifier:()=>Pc,TextDocumentItem:()=>Oc,TextEdit:()=>Yt,URI:()=>Eo,VersionedTextDocumentIdentifier:()=>kc,WorkspaceChange:()=>Fg,WorkspaceEdit:()=>_o,WorkspaceFolder:()=>$f,WorkspaceSymbol:()=>Xc,integer:()=>Ac,uinteger:()=>Ki});var Rc,Eo,Ac,Ki,ie,Q,Wi,Ec,Co,Cc,bc,_c,Sc,bo,wc,Ic,Nc,Vi,nn,Yt,an,Ke,mr,qi,ya,ga,va,_o,ki,Ku,Fg,Pc,kc,Hi,Oc,So,Ta,Lc,Dc,xc,Mc,Gc,Fc,zc,jc,Yi,Bc,Uc,Kc,Wc,Vc,qc,Hc,Yc,Xc,Jc,Zc,Xi,Qc,ef,tf,rf,nf,af,sf,of,lf,uf,cf,ff,df,wo,Io,pf,mf,hf,yf,gf,vf,Tf,$f,zg,Rf,lh,A,xs=bI({"../../node_modules/.pnpm/vscode-languageserver-types@3.17.5/node_modules/vscode-languageserver-types/lib/esm/main.js"(){(function(e){function t(r){return typeof r=="string"}i(t,"is"),e.is=t})(Rc||(Rc={})),(function(e){function t(r){return typeof r=="string"}i(t,"is"),e.is=t})(Eo||(Eo={})),(function(e){e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647;function t(r){return typeof r=="number"&&e.MIN_VALUE<=r&&r<=e.MAX_VALUE}i(t,"is"),e.is=t})(Ac||(Ac={})),(function(e){e.MIN_VALUE=0,e.MAX_VALUE=2147483647;function t(r){return typeof r=="number"&&e.MIN_VALUE<=r&&r<=e.MAX_VALUE}i(t,"is"),e.is=t})(Ki||(Ki={})),(function(e){function t(n,a){return n===Number.MAX_VALUE&&(n=Ki.MAX_VALUE),a===Number.MAX_VALUE&&(a=Ki.MAX_VALUE),{line:n,character:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&A.uinteger(a.line)&&A.uinteger(a.character)}i(r,"is"),e.is=r})(ie||(ie={})),(function(e){function t(n,a,s,o){if(A.uinteger(n)&&A.uinteger(a)&&A.uinteger(s)&&A.uinteger(o))return{start:ie.create(n,a),end:ie.create(s,o)};if(ie.is(n)&&ie.is(a))return{start:n,end:a};throw new Error(`Range#create called with invalid arguments[${n}, ${a}, ${s}, ${o}]`)}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&ie.is(a.start)&&ie.is(a.end)}i(r,"is"),e.is=r})(Q||(Q={})),(function(e){function t(n,a){return{uri:n,range:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&Q.is(a.range)&&(A.string(a.uri)||A.undefined(a.uri))}i(r,"is"),e.is=r})(Wi||(Wi={})),(function(e){function t(n,a,s,o){return{targetUri:n,targetRange:a,targetSelectionRange:s,originSelectionRange:o}}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&Q.is(a.targetRange)&&A.string(a.targetUri)&&Q.is(a.targetSelectionRange)&&(Q.is(a.originSelectionRange)||A.undefined(a.originSelectionRange))}i(r,"is"),e.is=r})(Ec||(Ec={})),(function(e){function t(n,a,s,o){return{red:n,green:a,blue:s,alpha:o}}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&A.numberRange(a.red,0,1)&&A.numberRange(a.green,0,1)&&A.numberRange(a.blue,0,1)&&A.numberRange(a.alpha,0,1)}i(r,"is"),e.is=r})(Co||(Co={})),(function(e){function t(n,a){return{range:n,color:a}}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&Q.is(a.range)&&Co.is(a.color)}i(r,"is"),e.is=r})(Cc||(Cc={})),(function(e){function t(n,a,s){return{label:n,textEdit:a,additionalTextEdits:s}}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&A.string(a.label)&&(A.undefined(a.textEdit)||Yt.is(a))&&(A.undefined(a.additionalTextEdits)||A.typedArray(a.additionalTextEdits,Yt.is))}i(r,"is"),e.is=r})(bc||(bc={})),(function(e){e.Comment="comment",e.Imports="imports",e.Region="region"})(_c||(_c={})),(function(e){function t(n,a,s,o,l,u){const c={startLine:n,endLine:a};return A.defined(s)&&(c.startCharacter=s),A.defined(o)&&(c.endCharacter=o),A.defined(l)&&(c.kind=l),A.defined(u)&&(c.collapsedText=u),c}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&A.uinteger(a.startLine)&&A.uinteger(a.startLine)&&(A.undefined(a.startCharacter)||A.uinteger(a.startCharacter))&&(A.undefined(a.endCharacter)||A.uinteger(a.endCharacter))&&(A.undefined(a.kind)||A.string(a.kind))}i(r,"is"),e.is=r})(Sc||(Sc={})),(function(e){function t(n,a){return{location:n,message:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&Wi.is(a.location)&&A.string(a.message)}i(r,"is"),e.is=r})(bo||(bo={})),(function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4})(wc||(wc={})),(function(e){e.Unnecessary=1,e.Deprecated=2})(Ic||(Ic={})),(function(e){function t(r){const n=r;return A.objectLiteral(n)&&A.string(n.href)}i(t,"is"),e.is=t})(Nc||(Nc={})),(function(e){function t(n,a,s,o,l,u){let c={range:n,message:a};return A.defined(s)&&(c.severity=s),A.defined(o)&&(c.code=o),A.defined(l)&&(c.source=l),A.defined(u)&&(c.relatedInformation=u),c}i(t,"create"),e.create=t;function r(n){var a;let s=n;return A.defined(s)&&Q.is(s.range)&&A.string(s.message)&&(A.number(s.severity)||A.undefined(s.severity))&&(A.integer(s.code)||A.string(s.code)||A.undefined(s.code))&&(A.undefined(s.codeDescription)||A.string((a=s.codeDescription)===null||a===void 0?void 0:a.href))&&(A.string(s.source)||A.undefined(s.source))&&(A.undefined(s.relatedInformation)||A.typedArray(s.relatedInformation,bo.is))}i(r,"is"),e.is=r})(Vi||(Vi={})),(function(e){function t(n,a,...s){let o={title:n,command:a};return A.defined(s)&&s.length>0&&(o.arguments=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.title)&&A.string(a.command)}i(r,"is"),e.is=r})(nn||(nn={})),(function(e){function t(s,o){return{range:s,newText:o}}i(t,"replace"),e.replace=t;function r(s,o){return{range:{start:s,end:s},newText:o}}i(r,"insert"),e.insert=r;function n(s){return{range:s,newText:""}}i(n,"del"),e.del=n;function a(s){const o=s;return A.objectLiteral(o)&&A.string(o.newText)&&Q.is(o.range)}i(a,"is"),e.is=a})(Yt||(Yt={})),(function(e){function t(n,a,s){const o={label:n};return a!==void 0&&(o.needsConfirmation=a),s!==void 0&&(o.description=s),o}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&A.string(a.label)&&(A.boolean(a.needsConfirmation)||a.needsConfirmation===void 0)&&(A.string(a.description)||a.description===void 0)}i(r,"is"),e.is=r})(an||(an={})),(function(e){function t(r){const n=r;return A.string(n)}i(t,"is"),e.is=t})(Ke||(Ke={})),(function(e){function t(s,o,l){return{range:s,newText:o,annotationId:l}}i(t,"replace"),e.replace=t;function r(s,o,l){return{range:{start:s,end:s},newText:o,annotationId:l}}i(r,"insert"),e.insert=r;function n(s,o){return{range:s,newText:"",annotationId:o}}i(n,"del"),e.del=n;function a(s){const o=s;return Yt.is(o)&&(an.is(o.annotationId)||Ke.is(o.annotationId))}i(a,"is"),e.is=a})(mr||(mr={})),(function(e){function t(n,a){return{textDocument:n,edits:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&Hi.is(a.textDocument)&&Array.isArray(a.edits)}i(r,"is"),e.is=r})(qi||(qi={})),(function(e){function t(n,a,s){let o={kind:"create",uri:n};return a!==void 0&&(a.overwrite!==void 0||a.ignoreIfExists!==void 0)&&(o.options=a),s!==void 0&&(o.annotationId=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return a&&a.kind==="create"&&A.string(a.uri)&&(a.options===void 0||(a.options.overwrite===void 0||A.boolean(a.options.overwrite))&&(a.options.ignoreIfExists===void 0||A.boolean(a.options.ignoreIfExists)))&&(a.annotationId===void 0||Ke.is(a.annotationId))}i(r,"is"),e.is=r})(ya||(ya={})),(function(e){function t(n,a,s,o){let l={kind:"rename",oldUri:n,newUri:a};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(l.options=s),o!==void 0&&(l.annotationId=o),l}i(t,"create"),e.create=t;function r(n){let a=n;return a&&a.kind==="rename"&&A.string(a.oldUri)&&A.string(a.newUri)&&(a.options===void 0||(a.options.overwrite===void 0||A.boolean(a.options.overwrite))&&(a.options.ignoreIfExists===void 0||A.boolean(a.options.ignoreIfExists)))&&(a.annotationId===void 0||Ke.is(a.annotationId))}i(r,"is"),e.is=r})(ga||(ga={})),(function(e){function t(n,a,s){let o={kind:"delete",uri:n};return a!==void 0&&(a.recursive!==void 0||a.ignoreIfNotExists!==void 0)&&(o.options=a),s!==void 0&&(o.annotationId=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return a&&a.kind==="delete"&&A.string(a.uri)&&(a.options===void 0||(a.options.recursive===void 0||A.boolean(a.options.recursive))&&(a.options.ignoreIfNotExists===void 0||A.boolean(a.options.ignoreIfNotExists)))&&(a.annotationId===void 0||Ke.is(a.annotationId))}i(r,"is"),e.is=r})(va||(va={})),(function(e){function t(r){let n=r;return n&&(n.changes!==void 0||n.documentChanges!==void 0)&&(n.documentChanges===void 0||n.documentChanges.every(a=>A.string(a.kind)?ya.is(a)||ga.is(a)||va.is(a):qi.is(a)))}i(t,"is"),e.is=t})(_o||(_o={})),ki=class{static{i(this,"TextEditChangeImpl")}constructor(e,t){this.edits=e,this.changeAnnotations=t}insert(e,t,r){let n,a;if(r===void 0?n=Yt.insert(e,t):Ke.is(r)?(a=r,n=mr.insert(e,t,r)):(this.assertChangeAnnotations(this.changeAnnotations),a=this.changeAnnotations.manage(r),n=mr.insert(e,t,a)),this.edits.push(n),a!==void 0)return a}replace(e,t,r){let n,a;if(r===void 0?n=Yt.replace(e,t):Ke.is(r)?(a=r,n=mr.replace(e,t,r)):(this.assertChangeAnnotations(this.changeAnnotations),a=this.changeAnnotations.manage(r),n=mr.replace(e,t,a)),this.edits.push(n),a!==void 0)return a}delete(e,t){let r,n;if(t===void 0?r=Yt.del(e):Ke.is(t)?(n=t,r=mr.del(e,t)):(this.assertChangeAnnotations(this.changeAnnotations),n=this.changeAnnotations.manage(t),r=mr.del(e,n)),this.edits.push(r),n!==void 0)return n}add(e){this.edits.push(e)}all(){return this.edits}clear(){this.edits.splice(0,this.edits.length)}assertChangeAnnotations(e){if(e===void 0)throw new Error("Text edit change is not configured to manage change annotations.")}},Ku=class{static{i(this,"ChangeAnnotations")}constructor(e){this._annotations=e===void 0?Object.create(null):e,this._counter=0,this._size=0}all(){return this._annotations}get size(){return this._size}manage(e,t){let r;if(Ke.is(e)?r=e:(r=this.nextId(),t=e),this._annotations[r]!==void 0)throw new Error(`Id ${r} is already in use.`);if(t===void 0)throw new Error(`No annotation provided for id ${r}`);return this._annotations[r]=t,this._size++,r}nextId(){return this._counter++,this._counter.toString()}},Fg=class{static{i(this,"WorkspaceChange")}constructor(e){this._textEditChanges=Object.create(null),e!==void 0?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new Ku(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach(t=>{if(qi.is(t)){const r=new ki(t.edits,this._changeAnnotations);this._textEditChanges[t.textDocument.uri]=r}})):e.changes&&Object.keys(e.changes).forEach(t=>{const r=new ki(e.changes[t]);this._textEditChanges[t]=r})):this._workspaceEdit={}}get edit(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit}getTextEditChange(e){if(Hi.is(e)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");const t={uri:e.uri,version:e.version};let r=this._textEditChanges[t.uri];if(!r){const n=[],a={textDocument:t,edits:n};this._workspaceEdit.documentChanges.push(a),r=new ki(n,this._changeAnnotations),this._textEditChanges[t.uri]=r}return r}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");let t=this._textEditChanges[e];if(!t){let r=[];this._workspaceEdit.changes[e]=r,t=new ki(r),this._textEditChanges[e]=t}return t}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Ku,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())}initChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))}createFile(e,t,r){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let n;an.is(t)||Ke.is(t)?n=t:r=t;let a,s;if(n===void 0?a=ya.create(e,r):(s=Ke.is(n)?n:this._changeAnnotations.manage(n),a=ya.create(e,r,s)),this._workspaceEdit.documentChanges.push(a),s!==void 0)return s}renameFile(e,t,r,n){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let a;an.is(r)||Ke.is(r)?a=r:n=r;let s,o;if(a===void 0?s=ga.create(e,t,n):(o=Ke.is(a)?a:this._changeAnnotations.manage(a),s=ga.create(e,t,n,o)),this._workspaceEdit.documentChanges.push(s),o!==void 0)return o}deleteFile(e,t,r){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let n;an.is(t)||Ke.is(t)?n=t:r=t;let a,s;if(n===void 0?a=va.create(e,r):(s=Ke.is(n)?n:this._changeAnnotations.manage(n),a=va.create(e,r,s)),this._workspaceEdit.documentChanges.push(a),s!==void 0)return s}},(function(e){function t(n){return{uri:n}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.uri)}i(r,"is"),e.is=r})(Pc||(Pc={})),(function(e){function t(n,a){return{uri:n,version:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.uri)&&A.integer(a.version)}i(r,"is"),e.is=r})(kc||(kc={})),(function(e){function t(n,a){return{uri:n,version:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.uri)&&(a.version===null||A.integer(a.version))}i(r,"is"),e.is=r})(Hi||(Hi={})),(function(e){function t(n,a,s,o){return{uri:n,languageId:a,version:s,text:o}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.uri)&&A.string(a.languageId)&&A.integer(a.version)&&A.string(a.text)}i(r,"is"),e.is=r})(Oc||(Oc={})),(function(e){e.PlainText="plaintext",e.Markdown="markdown";function t(r){const n=r;return n===e.PlainText||n===e.Markdown}i(t,"is"),e.is=t})(So||(So={})),(function(e){function t(r){const n=r;return A.objectLiteral(r)&&So.is(n.kind)&&A.string(n.value)}i(t,"is"),e.is=t})(Ta||(Ta={})),(function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25})(Lc||(Lc={})),(function(e){e.PlainText=1,e.Snippet=2})(Dc||(Dc={})),(function(e){e.Deprecated=1})(xc||(xc={})),(function(e){function t(n,a,s){return{newText:n,insert:a,replace:s}}i(t,"create"),e.create=t;function r(n){const a=n;return a&&A.string(a.newText)&&Q.is(a.insert)&&Q.is(a.replace)}i(r,"is"),e.is=r})(Mc||(Mc={})),(function(e){e.asIs=1,e.adjustIndentation=2})(Gc||(Gc={})),(function(e){function t(r){const n=r;return n&&(A.string(n.detail)||n.detail===void 0)&&(A.string(n.description)||n.description===void 0)}i(t,"is"),e.is=t})(Fc||(Fc={})),(function(e){function t(r){return{label:r}}i(t,"create"),e.create=t})(zc||(zc={})),(function(e){function t(r,n){return{items:r||[],isIncomplete:!!n}}i(t,"create"),e.create=t})(jc||(jc={})),(function(e){function t(n){return n.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}i(t,"fromPlainText"),e.fromPlainText=t;function r(n){const a=n;return A.string(a)||A.objectLiteral(a)&&A.string(a.language)&&A.string(a.value)}i(r,"is"),e.is=r})(Yi||(Yi={})),(function(e){function t(r){let n=r;return!!n&&A.objectLiteral(n)&&(Ta.is(n.contents)||Yi.is(n.contents)||A.typedArray(n.contents,Yi.is))&&(r.range===void 0||Q.is(r.range))}i(t,"is"),e.is=t})(Bc||(Bc={})),(function(e){function t(r,n){return n?{label:r,documentation:n}:{label:r}}i(t,"create"),e.create=t})(Uc||(Uc={})),(function(e){function t(r,n,...a){let s={label:r};return A.defined(n)&&(s.documentation=n),A.defined(a)?s.parameters=a:s.parameters=[],s}i(t,"create"),e.create=t})(Kc||(Kc={})),(function(e){e.Text=1,e.Read=2,e.Write=3})(Wc||(Wc={})),(function(e){function t(r,n){let a={range:r};return A.number(n)&&(a.kind=n),a}i(t,"create"),e.create=t})(Vc||(Vc={})),(function(e){e.File=1,e.Module=2,e.Namespace=3,e.Package=4,e.Class=5,e.Method=6,e.Property=7,e.Field=8,e.Constructor=9,e.Enum=10,e.Interface=11,e.Function=12,e.Variable=13,e.Constant=14,e.String=15,e.Number=16,e.Boolean=17,e.Array=18,e.Object=19,e.Key=20,e.Null=21,e.EnumMember=22,e.Struct=23,e.Event=24,e.Operator=25,e.TypeParameter=26})(qc||(qc={})),(function(e){e.Deprecated=1})(Hc||(Hc={})),(function(e){function t(r,n,a,s,o){let l={name:r,kind:n,location:{uri:s,range:a}};return o&&(l.containerName=o),l}i(t,"create"),e.create=t})(Yc||(Yc={})),(function(e){function t(r,n,a,s){return s!==void 0?{name:r,kind:n,location:{uri:a,range:s}}:{name:r,kind:n,location:{uri:a}}}i(t,"create"),e.create=t})(Xc||(Xc={})),(function(e){function t(n,a,s,o,l,u){let c={name:n,detail:a,kind:s,range:o,selectionRange:l};return u!==void 0&&(c.children=u),c}i(t,"create"),e.create=t;function r(n){let a=n;return a&&A.string(a.name)&&A.number(a.kind)&&Q.is(a.range)&&Q.is(a.selectionRange)&&(a.detail===void 0||A.string(a.detail))&&(a.deprecated===void 0||A.boolean(a.deprecated))&&(a.children===void 0||Array.isArray(a.children))&&(a.tags===void 0||Array.isArray(a.tags))}i(r,"is"),e.is=r})(Jc||(Jc={})),(function(e){e.Empty="",e.QuickFix="quickfix",e.Refactor="refactor",e.RefactorExtract="refactor.extract",e.RefactorInline="refactor.inline",e.RefactorRewrite="refactor.rewrite",e.Source="source",e.SourceOrganizeImports="source.organizeImports",e.SourceFixAll="source.fixAll"})(Zc||(Zc={})),(function(e){e.Invoked=1,e.Automatic=2})(Xi||(Xi={})),(function(e){function t(n,a,s){let o={diagnostics:n};return a!=null&&(o.only=a),s!=null&&(o.triggerKind=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.typedArray(a.diagnostics,Vi.is)&&(a.only===void 0||A.typedArray(a.only,A.string))&&(a.triggerKind===void 0||a.triggerKind===Xi.Invoked||a.triggerKind===Xi.Automatic)}i(r,"is"),e.is=r})(Qc||(Qc={})),(function(e){function t(n,a,s){let o={title:n},l=!0;return typeof a=="string"?(l=!1,o.kind=a):nn.is(a)?o.command=a:o.edit=a,l&&s!==void 0&&(o.kind=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return a&&A.string(a.title)&&(a.diagnostics===void 0||A.typedArray(a.diagnostics,Vi.is))&&(a.kind===void 0||A.string(a.kind))&&(a.edit!==void 0||a.command!==void 0)&&(a.command===void 0||nn.is(a.command))&&(a.isPreferred===void 0||A.boolean(a.isPreferred))&&(a.edit===void 0||_o.is(a.edit))}i(r,"is"),e.is=r})(ef||(ef={})),(function(e){function t(n,a){let s={range:n};return A.defined(a)&&(s.data=a),s}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&Q.is(a.range)&&(A.undefined(a.command)||nn.is(a.command))}i(r,"is"),e.is=r})(tf||(tf={})),(function(e){function t(n,a){return{tabSize:n,insertSpaces:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.uinteger(a.tabSize)&&A.boolean(a.insertSpaces)}i(r,"is"),e.is=r})(rf||(rf={})),(function(e){function t(n,a,s){return{range:n,target:a,data:s}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&Q.is(a.range)&&(A.undefined(a.target)||A.string(a.target))}i(r,"is"),e.is=r})(nf||(nf={})),(function(e){function t(n,a){return{range:n,parent:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&Q.is(a.range)&&(a.parent===void 0||e.is(a.parent))}i(r,"is"),e.is=r})(af||(af={})),(function(e){e.namespace="namespace",e.type="type",e.class="class",e.enum="enum",e.interface="interface",e.struct="struct",e.typeParameter="typeParameter",e.parameter="parameter",e.variable="variable",e.property="property",e.enumMember="enumMember",e.event="event",e.function="function",e.method="method",e.macro="macro",e.keyword="keyword",e.modifier="modifier",e.comment="comment",e.string="string",e.number="number",e.regexp="regexp",e.operator="operator",e.decorator="decorator"})(sf||(sf={})),(function(e){e.declaration="declaration",e.definition="definition",e.readonly="readonly",e.static="static",e.deprecated="deprecated",e.abstract="abstract",e.async="async",e.modification="modification",e.documentation="documentation",e.defaultLibrary="defaultLibrary"})(of||(of={})),(function(e){function t(r){const n=r;return A.objectLiteral(n)&&(n.resultId===void 0||typeof n.resultId=="string")&&Array.isArray(n.data)&&(n.data.length===0||typeof n.data[0]=="number")}i(t,"is"),e.is=t})(lf||(lf={})),(function(e){function t(n,a){return{range:n,text:a}}i(t,"create"),e.create=t;function r(n){const a=n;return a!=null&&Q.is(a.range)&&A.string(a.text)}i(r,"is"),e.is=r})(uf||(uf={})),(function(e){function t(n,a,s){return{range:n,variableName:a,caseSensitiveLookup:s}}i(t,"create"),e.create=t;function r(n){const a=n;return a!=null&&Q.is(a.range)&&A.boolean(a.caseSensitiveLookup)&&(A.string(a.variableName)||a.variableName===void 0)}i(r,"is"),e.is=r})(cf||(cf={})),(function(e){function t(n,a){return{range:n,expression:a}}i(t,"create"),e.create=t;function r(n){const a=n;return a!=null&&Q.is(a.range)&&(A.string(a.expression)||a.expression===void 0)}i(r,"is"),e.is=r})(ff||(ff={})),(function(e){function t(n,a){return{frameId:n,stoppedLocation:a}}i(t,"create"),e.create=t;function r(n){const a=n;return A.defined(a)&&Q.is(n.stoppedLocation)}i(r,"is"),e.is=r})(df||(df={})),(function(e){e.Type=1,e.Parameter=2;function t(r){return r===1||r===2}i(t,"is"),e.is=t})(wo||(wo={})),(function(e){function t(n){return{value:n}}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&(a.tooltip===void 0||A.string(a.tooltip)||Ta.is(a.tooltip))&&(a.location===void 0||Wi.is(a.location))&&(a.command===void 0||nn.is(a.command))}i(r,"is"),e.is=r})(Io||(Io={})),(function(e){function t(n,a,s){const o={position:n,label:a};return s!==void 0&&(o.kind=s),o}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&ie.is(a.position)&&(A.string(a.label)||A.typedArray(a.label,Io.is))&&(a.kind===void 0||wo.is(a.kind))&&a.textEdits===void 0||A.typedArray(a.textEdits,Yt.is)&&(a.tooltip===void 0||A.string(a.tooltip)||Ta.is(a.tooltip))&&(a.paddingLeft===void 0||A.boolean(a.paddingLeft))&&(a.paddingRight===void 0||A.boolean(a.paddingRight))}i(r,"is"),e.is=r})(pf||(pf={})),(function(e){function t(r){return{kind:"snippet",value:r}}i(t,"createSnippet"),e.createSnippet=t})(mf||(mf={})),(function(e){function t(r,n,a,s){return{insertText:r,filterText:n,range:a,command:s}}i(t,"create"),e.create=t})(hf||(hf={})),(function(e){function t(r){return{items:r}}i(t,"create"),e.create=t})(yf||(yf={})),(function(e){e.Invoked=0,e.Automatic=1})(gf||(gf={})),(function(e){function t(r,n){return{range:r,text:n}}i(t,"create"),e.create=t})(vf||(vf={})),(function(e){function t(r,n){return{triggerKind:r,selectedCompletionInfo:n}}i(t,"create"),e.create=t})(Tf||(Tf={})),(function(e){function t(r){const n=r;return A.objectLiteral(n)&&Eo.is(n.uri)&&A.string(n.name)}i(t,"is"),e.is=t})($f||($f={})),zg=[` +import{bR as et}from"./index-BIElaaEN.js";var RI=Object.create,Ds=Object.defineProperty,AI=Object.getOwnPropertyDescriptor,Ad=Object.getOwnPropertyNames,EI=Object.getPrototypeOf,CI=Object.prototype.hasOwnProperty,i=(e,t)=>Ds(e,"name",{value:t,configurable:!0}),bI=(e,t)=>function(){return e&&(t=(0,e[Ad(e)[0]])(e=0)),t},H=(e,t)=>function(){return t||(0,e[Ad(e)[0]])((t={exports:{}}).exports,t),t.exports},Vr=(e,t)=>{for(var r in t)Ds(e,r,{get:t[r],enumerable:!0})},Ed=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Ad(t))!CI.call(e,a)&&a!==r&&Ds(e,a,{get:()=>t[a],enumerable:!(n=AI(t,a))||n.enumerable});return e},Ll=(e,t,r)=>(Ed(e,t,"default"),r),Cd=(e,t,r)=>(r=e!=null?RI(EI(e)):{},Ed(Ds(r,"default",{value:e,enumerable:!0}),e)),bd=e=>Ed(Ds({},"__esModule",{value:!0}),e),Dl={};Vr(Dl,{AnnotatedTextEdit:()=>mr,ChangeAnnotation:()=>an,ChangeAnnotationIdentifier:()=>Ke,CodeAction:()=>ef,CodeActionContext:()=>Qc,CodeActionKind:()=>Zc,CodeActionTriggerKind:()=>Xi,CodeDescription:()=>Nc,CodeLens:()=>tf,Color:()=>Co,ColorInformation:()=>Cc,ColorPresentation:()=>bc,Command:()=>nn,CompletionItem:()=>zc,CompletionItemKind:()=>Lc,CompletionItemLabelDetails:()=>Fc,CompletionItemTag:()=>xc,CompletionList:()=>jc,CreateFile:()=>ya,DeleteFile:()=>va,Diagnostic:()=>Vi,DiagnosticRelatedInformation:()=>bo,DiagnosticSeverity:()=>wc,DiagnosticTag:()=>Ic,DocumentHighlight:()=>Vc,DocumentHighlightKind:()=>Wc,DocumentLink:()=>nf,DocumentSymbol:()=>Jc,DocumentUri:()=>Rc,EOL:()=>zg,FoldingRange:()=>Sc,FoldingRangeKind:()=>_c,FormattingOptions:()=>rf,Hover:()=>Bc,InlayHint:()=>pf,InlayHintKind:()=>wo,InlayHintLabelPart:()=>Io,InlineCompletionContext:()=>Tf,InlineCompletionItem:()=>hf,InlineCompletionList:()=>yf,InlineCompletionTriggerKind:()=>gf,InlineValueContext:()=>df,InlineValueEvaluatableExpression:()=>ff,InlineValueText:()=>uf,InlineValueVariableLookup:()=>cf,InsertReplaceEdit:()=>Mc,InsertTextFormat:()=>Dc,InsertTextMode:()=>Gc,Location:()=>Wi,LocationLink:()=>Ec,MarkedString:()=>Yi,MarkupContent:()=>Ta,MarkupKind:()=>So,OptionalVersionedTextDocumentIdentifier:()=>Hi,ParameterInformation:()=>Uc,Position:()=>ie,Range:()=>Q,RenameFile:()=>ga,SelectedCompletionInfo:()=>vf,SelectionRange:()=>af,SemanticTokenModifiers:()=>of,SemanticTokenTypes:()=>sf,SemanticTokens:()=>lf,SignatureInformation:()=>Kc,StringValue:()=>mf,SymbolInformation:()=>Yc,SymbolKind:()=>qc,SymbolTag:()=>Hc,TextDocument:()=>Rf,TextDocumentEdit:()=>qi,TextDocumentIdentifier:()=>Pc,TextDocumentItem:()=>Oc,TextEdit:()=>Yt,URI:()=>Eo,VersionedTextDocumentIdentifier:()=>kc,WorkspaceChange:()=>Fg,WorkspaceEdit:()=>_o,WorkspaceFolder:()=>$f,WorkspaceSymbol:()=>Xc,integer:()=>Ac,uinteger:()=>Ki});var Rc,Eo,Ac,Ki,ie,Q,Wi,Ec,Co,Cc,bc,_c,Sc,bo,wc,Ic,Nc,Vi,nn,Yt,an,Ke,mr,qi,ya,ga,va,_o,ki,Ku,Fg,Pc,kc,Hi,Oc,So,Ta,Lc,Dc,xc,Mc,Gc,Fc,zc,jc,Yi,Bc,Uc,Kc,Wc,Vc,qc,Hc,Yc,Xc,Jc,Zc,Xi,Qc,ef,tf,rf,nf,af,sf,of,lf,uf,cf,ff,df,wo,Io,pf,mf,hf,yf,gf,vf,Tf,$f,zg,Rf,lh,A,xs=bI({"../../node_modules/.pnpm/vscode-languageserver-types@3.17.5/node_modules/vscode-languageserver-types/lib/esm/main.js"(){(function(e){function t(r){return typeof r=="string"}i(t,"is"),e.is=t})(Rc||(Rc={})),(function(e){function t(r){return typeof r=="string"}i(t,"is"),e.is=t})(Eo||(Eo={})),(function(e){e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647;function t(r){return typeof r=="number"&&e.MIN_VALUE<=r&&r<=e.MAX_VALUE}i(t,"is"),e.is=t})(Ac||(Ac={})),(function(e){e.MIN_VALUE=0,e.MAX_VALUE=2147483647;function t(r){return typeof r=="number"&&e.MIN_VALUE<=r&&r<=e.MAX_VALUE}i(t,"is"),e.is=t})(Ki||(Ki={})),(function(e){function t(n,a){return n===Number.MAX_VALUE&&(n=Ki.MAX_VALUE),a===Number.MAX_VALUE&&(a=Ki.MAX_VALUE),{line:n,character:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&A.uinteger(a.line)&&A.uinteger(a.character)}i(r,"is"),e.is=r})(ie||(ie={})),(function(e){function t(n,a,s,o){if(A.uinteger(n)&&A.uinteger(a)&&A.uinteger(s)&&A.uinteger(o))return{start:ie.create(n,a),end:ie.create(s,o)};if(ie.is(n)&&ie.is(a))return{start:n,end:a};throw new Error(`Range#create called with invalid arguments[${n}, ${a}, ${s}, ${o}]`)}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&ie.is(a.start)&&ie.is(a.end)}i(r,"is"),e.is=r})(Q||(Q={})),(function(e){function t(n,a){return{uri:n,range:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&Q.is(a.range)&&(A.string(a.uri)||A.undefined(a.uri))}i(r,"is"),e.is=r})(Wi||(Wi={})),(function(e){function t(n,a,s,o){return{targetUri:n,targetRange:a,targetSelectionRange:s,originSelectionRange:o}}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&Q.is(a.targetRange)&&A.string(a.targetUri)&&Q.is(a.targetSelectionRange)&&(Q.is(a.originSelectionRange)||A.undefined(a.originSelectionRange))}i(r,"is"),e.is=r})(Ec||(Ec={})),(function(e){function t(n,a,s,o){return{red:n,green:a,blue:s,alpha:o}}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&A.numberRange(a.red,0,1)&&A.numberRange(a.green,0,1)&&A.numberRange(a.blue,0,1)&&A.numberRange(a.alpha,0,1)}i(r,"is"),e.is=r})(Co||(Co={})),(function(e){function t(n,a){return{range:n,color:a}}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&Q.is(a.range)&&Co.is(a.color)}i(r,"is"),e.is=r})(Cc||(Cc={})),(function(e){function t(n,a,s){return{label:n,textEdit:a,additionalTextEdits:s}}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&A.string(a.label)&&(A.undefined(a.textEdit)||Yt.is(a))&&(A.undefined(a.additionalTextEdits)||A.typedArray(a.additionalTextEdits,Yt.is))}i(r,"is"),e.is=r})(bc||(bc={})),(function(e){e.Comment="comment",e.Imports="imports",e.Region="region"})(_c||(_c={})),(function(e){function t(n,a,s,o,l,u){const c={startLine:n,endLine:a};return A.defined(s)&&(c.startCharacter=s),A.defined(o)&&(c.endCharacter=o),A.defined(l)&&(c.kind=l),A.defined(u)&&(c.collapsedText=u),c}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&A.uinteger(a.startLine)&&A.uinteger(a.startLine)&&(A.undefined(a.startCharacter)||A.uinteger(a.startCharacter))&&(A.undefined(a.endCharacter)||A.uinteger(a.endCharacter))&&(A.undefined(a.kind)||A.string(a.kind))}i(r,"is"),e.is=r})(Sc||(Sc={})),(function(e){function t(n,a){return{location:n,message:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&Wi.is(a.location)&&A.string(a.message)}i(r,"is"),e.is=r})(bo||(bo={})),(function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4})(wc||(wc={})),(function(e){e.Unnecessary=1,e.Deprecated=2})(Ic||(Ic={})),(function(e){function t(r){const n=r;return A.objectLiteral(n)&&A.string(n.href)}i(t,"is"),e.is=t})(Nc||(Nc={})),(function(e){function t(n,a,s,o,l,u){let c={range:n,message:a};return A.defined(s)&&(c.severity=s),A.defined(o)&&(c.code=o),A.defined(l)&&(c.source=l),A.defined(u)&&(c.relatedInformation=u),c}i(t,"create"),e.create=t;function r(n){var a;let s=n;return A.defined(s)&&Q.is(s.range)&&A.string(s.message)&&(A.number(s.severity)||A.undefined(s.severity))&&(A.integer(s.code)||A.string(s.code)||A.undefined(s.code))&&(A.undefined(s.codeDescription)||A.string((a=s.codeDescription)===null||a===void 0?void 0:a.href))&&(A.string(s.source)||A.undefined(s.source))&&(A.undefined(s.relatedInformation)||A.typedArray(s.relatedInformation,bo.is))}i(r,"is"),e.is=r})(Vi||(Vi={})),(function(e){function t(n,a,...s){let o={title:n,command:a};return A.defined(s)&&s.length>0&&(o.arguments=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.title)&&A.string(a.command)}i(r,"is"),e.is=r})(nn||(nn={})),(function(e){function t(s,o){return{range:s,newText:o}}i(t,"replace"),e.replace=t;function r(s,o){return{range:{start:s,end:s},newText:o}}i(r,"insert"),e.insert=r;function n(s){return{range:s,newText:""}}i(n,"del"),e.del=n;function a(s){const o=s;return A.objectLiteral(o)&&A.string(o.newText)&&Q.is(o.range)}i(a,"is"),e.is=a})(Yt||(Yt={})),(function(e){function t(n,a,s){const o={label:n};return a!==void 0&&(o.needsConfirmation=a),s!==void 0&&(o.description=s),o}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&A.string(a.label)&&(A.boolean(a.needsConfirmation)||a.needsConfirmation===void 0)&&(A.string(a.description)||a.description===void 0)}i(r,"is"),e.is=r})(an||(an={})),(function(e){function t(r){const n=r;return A.string(n)}i(t,"is"),e.is=t})(Ke||(Ke={})),(function(e){function t(s,o,l){return{range:s,newText:o,annotationId:l}}i(t,"replace"),e.replace=t;function r(s,o,l){return{range:{start:s,end:s},newText:o,annotationId:l}}i(r,"insert"),e.insert=r;function n(s,o){return{range:s,newText:"",annotationId:o}}i(n,"del"),e.del=n;function a(s){const o=s;return Yt.is(o)&&(an.is(o.annotationId)||Ke.is(o.annotationId))}i(a,"is"),e.is=a})(mr||(mr={})),(function(e){function t(n,a){return{textDocument:n,edits:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&Hi.is(a.textDocument)&&Array.isArray(a.edits)}i(r,"is"),e.is=r})(qi||(qi={})),(function(e){function t(n,a,s){let o={kind:"create",uri:n};return a!==void 0&&(a.overwrite!==void 0||a.ignoreIfExists!==void 0)&&(o.options=a),s!==void 0&&(o.annotationId=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return a&&a.kind==="create"&&A.string(a.uri)&&(a.options===void 0||(a.options.overwrite===void 0||A.boolean(a.options.overwrite))&&(a.options.ignoreIfExists===void 0||A.boolean(a.options.ignoreIfExists)))&&(a.annotationId===void 0||Ke.is(a.annotationId))}i(r,"is"),e.is=r})(ya||(ya={})),(function(e){function t(n,a,s,o){let l={kind:"rename",oldUri:n,newUri:a};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(l.options=s),o!==void 0&&(l.annotationId=o),l}i(t,"create"),e.create=t;function r(n){let a=n;return a&&a.kind==="rename"&&A.string(a.oldUri)&&A.string(a.newUri)&&(a.options===void 0||(a.options.overwrite===void 0||A.boolean(a.options.overwrite))&&(a.options.ignoreIfExists===void 0||A.boolean(a.options.ignoreIfExists)))&&(a.annotationId===void 0||Ke.is(a.annotationId))}i(r,"is"),e.is=r})(ga||(ga={})),(function(e){function t(n,a,s){let o={kind:"delete",uri:n};return a!==void 0&&(a.recursive!==void 0||a.ignoreIfNotExists!==void 0)&&(o.options=a),s!==void 0&&(o.annotationId=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return a&&a.kind==="delete"&&A.string(a.uri)&&(a.options===void 0||(a.options.recursive===void 0||A.boolean(a.options.recursive))&&(a.options.ignoreIfNotExists===void 0||A.boolean(a.options.ignoreIfNotExists)))&&(a.annotationId===void 0||Ke.is(a.annotationId))}i(r,"is"),e.is=r})(va||(va={})),(function(e){function t(r){let n=r;return n&&(n.changes!==void 0||n.documentChanges!==void 0)&&(n.documentChanges===void 0||n.documentChanges.every(a=>A.string(a.kind)?ya.is(a)||ga.is(a)||va.is(a):qi.is(a)))}i(t,"is"),e.is=t})(_o||(_o={})),ki=class{static{i(this,"TextEditChangeImpl")}constructor(e,t){this.edits=e,this.changeAnnotations=t}insert(e,t,r){let n,a;if(r===void 0?n=Yt.insert(e,t):Ke.is(r)?(a=r,n=mr.insert(e,t,r)):(this.assertChangeAnnotations(this.changeAnnotations),a=this.changeAnnotations.manage(r),n=mr.insert(e,t,a)),this.edits.push(n),a!==void 0)return a}replace(e,t,r){let n,a;if(r===void 0?n=Yt.replace(e,t):Ke.is(r)?(a=r,n=mr.replace(e,t,r)):(this.assertChangeAnnotations(this.changeAnnotations),a=this.changeAnnotations.manage(r),n=mr.replace(e,t,a)),this.edits.push(n),a!==void 0)return a}delete(e,t){let r,n;if(t===void 0?r=Yt.del(e):Ke.is(t)?(n=t,r=mr.del(e,t)):(this.assertChangeAnnotations(this.changeAnnotations),n=this.changeAnnotations.manage(t),r=mr.del(e,n)),this.edits.push(r),n!==void 0)return n}add(e){this.edits.push(e)}all(){return this.edits}clear(){this.edits.splice(0,this.edits.length)}assertChangeAnnotations(e){if(e===void 0)throw new Error("Text edit change is not configured to manage change annotations.")}},Ku=class{static{i(this,"ChangeAnnotations")}constructor(e){this._annotations=e===void 0?Object.create(null):e,this._counter=0,this._size=0}all(){return this._annotations}get size(){return this._size}manage(e,t){let r;if(Ke.is(e)?r=e:(r=this.nextId(),t=e),this._annotations[r]!==void 0)throw new Error(`Id ${r} is already in use.`);if(t===void 0)throw new Error(`No annotation provided for id ${r}`);return this._annotations[r]=t,this._size++,r}nextId(){return this._counter++,this._counter.toString()}},Fg=class{static{i(this,"WorkspaceChange")}constructor(e){this._textEditChanges=Object.create(null),e!==void 0?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new Ku(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach(t=>{if(qi.is(t)){const r=new ki(t.edits,this._changeAnnotations);this._textEditChanges[t.textDocument.uri]=r}})):e.changes&&Object.keys(e.changes).forEach(t=>{const r=new ki(e.changes[t]);this._textEditChanges[t]=r})):this._workspaceEdit={}}get edit(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit}getTextEditChange(e){if(Hi.is(e)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");const t={uri:e.uri,version:e.version};let r=this._textEditChanges[t.uri];if(!r){const n=[],a={textDocument:t,edits:n};this._workspaceEdit.documentChanges.push(a),r=new ki(n,this._changeAnnotations),this._textEditChanges[t.uri]=r}return r}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");let t=this._textEditChanges[e];if(!t){let r=[];this._workspaceEdit.changes[e]=r,t=new ki(r),this._textEditChanges[e]=t}return t}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Ku,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())}initChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))}createFile(e,t,r){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let n;an.is(t)||Ke.is(t)?n=t:r=t;let a,s;if(n===void 0?a=ya.create(e,r):(s=Ke.is(n)?n:this._changeAnnotations.manage(n),a=ya.create(e,r,s)),this._workspaceEdit.documentChanges.push(a),s!==void 0)return s}renameFile(e,t,r,n){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let a;an.is(r)||Ke.is(r)?a=r:n=r;let s,o;if(a===void 0?s=ga.create(e,t,n):(o=Ke.is(a)?a:this._changeAnnotations.manage(a),s=ga.create(e,t,n,o)),this._workspaceEdit.documentChanges.push(s),o!==void 0)return o}deleteFile(e,t,r){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let n;an.is(t)||Ke.is(t)?n=t:r=t;let a,s;if(n===void 0?a=va.create(e,r):(s=Ke.is(n)?n:this._changeAnnotations.manage(n),a=va.create(e,r,s)),this._workspaceEdit.documentChanges.push(a),s!==void 0)return s}},(function(e){function t(n){return{uri:n}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.uri)}i(r,"is"),e.is=r})(Pc||(Pc={})),(function(e){function t(n,a){return{uri:n,version:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.uri)&&A.integer(a.version)}i(r,"is"),e.is=r})(kc||(kc={})),(function(e){function t(n,a){return{uri:n,version:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.uri)&&(a.version===null||A.integer(a.version))}i(r,"is"),e.is=r})(Hi||(Hi={})),(function(e){function t(n,a,s,o){return{uri:n,languageId:a,version:s,text:o}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.string(a.uri)&&A.string(a.languageId)&&A.integer(a.version)&&A.string(a.text)}i(r,"is"),e.is=r})(Oc||(Oc={})),(function(e){e.PlainText="plaintext",e.Markdown="markdown";function t(r){const n=r;return n===e.PlainText||n===e.Markdown}i(t,"is"),e.is=t})(So||(So={})),(function(e){function t(r){const n=r;return A.objectLiteral(r)&&So.is(n.kind)&&A.string(n.value)}i(t,"is"),e.is=t})(Ta||(Ta={})),(function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25})(Lc||(Lc={})),(function(e){e.PlainText=1,e.Snippet=2})(Dc||(Dc={})),(function(e){e.Deprecated=1})(xc||(xc={})),(function(e){function t(n,a,s){return{newText:n,insert:a,replace:s}}i(t,"create"),e.create=t;function r(n){const a=n;return a&&A.string(a.newText)&&Q.is(a.insert)&&Q.is(a.replace)}i(r,"is"),e.is=r})(Mc||(Mc={})),(function(e){e.asIs=1,e.adjustIndentation=2})(Gc||(Gc={})),(function(e){function t(r){const n=r;return n&&(A.string(n.detail)||n.detail===void 0)&&(A.string(n.description)||n.description===void 0)}i(t,"is"),e.is=t})(Fc||(Fc={})),(function(e){function t(r){return{label:r}}i(t,"create"),e.create=t})(zc||(zc={})),(function(e){function t(r,n){return{items:r||[],isIncomplete:!!n}}i(t,"create"),e.create=t})(jc||(jc={})),(function(e){function t(n){return n.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}i(t,"fromPlainText"),e.fromPlainText=t;function r(n){const a=n;return A.string(a)||A.objectLiteral(a)&&A.string(a.language)&&A.string(a.value)}i(r,"is"),e.is=r})(Yi||(Yi={})),(function(e){function t(r){let n=r;return!!n&&A.objectLiteral(n)&&(Ta.is(n.contents)||Yi.is(n.contents)||A.typedArray(n.contents,Yi.is))&&(r.range===void 0||Q.is(r.range))}i(t,"is"),e.is=t})(Bc||(Bc={})),(function(e){function t(r,n){return n?{label:r,documentation:n}:{label:r}}i(t,"create"),e.create=t})(Uc||(Uc={})),(function(e){function t(r,n,...a){let s={label:r};return A.defined(n)&&(s.documentation=n),A.defined(a)?s.parameters=a:s.parameters=[],s}i(t,"create"),e.create=t})(Kc||(Kc={})),(function(e){e.Text=1,e.Read=2,e.Write=3})(Wc||(Wc={})),(function(e){function t(r,n){let a={range:r};return A.number(n)&&(a.kind=n),a}i(t,"create"),e.create=t})(Vc||(Vc={})),(function(e){e.File=1,e.Module=2,e.Namespace=3,e.Package=4,e.Class=5,e.Method=6,e.Property=7,e.Field=8,e.Constructor=9,e.Enum=10,e.Interface=11,e.Function=12,e.Variable=13,e.Constant=14,e.String=15,e.Number=16,e.Boolean=17,e.Array=18,e.Object=19,e.Key=20,e.Null=21,e.EnumMember=22,e.Struct=23,e.Event=24,e.Operator=25,e.TypeParameter=26})(qc||(qc={})),(function(e){e.Deprecated=1})(Hc||(Hc={})),(function(e){function t(r,n,a,s,o){let l={name:r,kind:n,location:{uri:s,range:a}};return o&&(l.containerName=o),l}i(t,"create"),e.create=t})(Yc||(Yc={})),(function(e){function t(r,n,a,s){return s!==void 0?{name:r,kind:n,location:{uri:a,range:s}}:{name:r,kind:n,location:{uri:a}}}i(t,"create"),e.create=t})(Xc||(Xc={})),(function(e){function t(n,a,s,o,l,u){let c={name:n,detail:a,kind:s,range:o,selectionRange:l};return u!==void 0&&(c.children=u),c}i(t,"create"),e.create=t;function r(n){let a=n;return a&&A.string(a.name)&&A.number(a.kind)&&Q.is(a.range)&&Q.is(a.selectionRange)&&(a.detail===void 0||A.string(a.detail))&&(a.deprecated===void 0||A.boolean(a.deprecated))&&(a.children===void 0||Array.isArray(a.children))&&(a.tags===void 0||Array.isArray(a.tags))}i(r,"is"),e.is=r})(Jc||(Jc={})),(function(e){e.Empty="",e.QuickFix="quickfix",e.Refactor="refactor",e.RefactorExtract="refactor.extract",e.RefactorInline="refactor.inline",e.RefactorRewrite="refactor.rewrite",e.Source="source",e.SourceOrganizeImports="source.organizeImports",e.SourceFixAll="source.fixAll"})(Zc||(Zc={})),(function(e){e.Invoked=1,e.Automatic=2})(Xi||(Xi={})),(function(e){function t(n,a,s){let o={diagnostics:n};return a!=null&&(o.only=a),s!=null&&(o.triggerKind=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.typedArray(a.diagnostics,Vi.is)&&(a.only===void 0||A.typedArray(a.only,A.string))&&(a.triggerKind===void 0||a.triggerKind===Xi.Invoked||a.triggerKind===Xi.Automatic)}i(r,"is"),e.is=r})(Qc||(Qc={})),(function(e){function t(n,a,s){let o={title:n},l=!0;return typeof a=="string"?(l=!1,o.kind=a):nn.is(a)?o.command=a:o.edit=a,l&&s!==void 0&&(o.kind=s),o}i(t,"create"),e.create=t;function r(n){let a=n;return a&&A.string(a.title)&&(a.diagnostics===void 0||A.typedArray(a.diagnostics,Vi.is))&&(a.kind===void 0||A.string(a.kind))&&(a.edit!==void 0||a.command!==void 0)&&(a.command===void 0||nn.is(a.command))&&(a.isPreferred===void 0||A.boolean(a.isPreferred))&&(a.edit===void 0||_o.is(a.edit))}i(r,"is"),e.is=r})(ef||(ef={})),(function(e){function t(n,a){let s={range:n};return A.defined(a)&&(s.data=a),s}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&Q.is(a.range)&&(A.undefined(a.command)||nn.is(a.command))}i(r,"is"),e.is=r})(tf||(tf={})),(function(e){function t(n,a){return{tabSize:n,insertSpaces:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&A.uinteger(a.tabSize)&&A.boolean(a.insertSpaces)}i(r,"is"),e.is=r})(rf||(rf={})),(function(e){function t(n,a,s){return{range:n,target:a,data:s}}i(t,"create"),e.create=t;function r(n){let a=n;return A.defined(a)&&Q.is(a.range)&&(A.undefined(a.target)||A.string(a.target))}i(r,"is"),e.is=r})(nf||(nf={})),(function(e){function t(n,a){return{range:n,parent:a}}i(t,"create"),e.create=t;function r(n){let a=n;return A.objectLiteral(a)&&Q.is(a.range)&&(a.parent===void 0||e.is(a.parent))}i(r,"is"),e.is=r})(af||(af={})),(function(e){e.namespace="namespace",e.type="type",e.class="class",e.enum="enum",e.interface="interface",e.struct="struct",e.typeParameter="typeParameter",e.parameter="parameter",e.variable="variable",e.property="property",e.enumMember="enumMember",e.event="event",e.function="function",e.method="method",e.macro="macro",e.keyword="keyword",e.modifier="modifier",e.comment="comment",e.string="string",e.number="number",e.regexp="regexp",e.operator="operator",e.decorator="decorator"})(sf||(sf={})),(function(e){e.declaration="declaration",e.definition="definition",e.readonly="readonly",e.static="static",e.deprecated="deprecated",e.abstract="abstract",e.async="async",e.modification="modification",e.documentation="documentation",e.defaultLibrary="defaultLibrary"})(of||(of={})),(function(e){function t(r){const n=r;return A.objectLiteral(n)&&(n.resultId===void 0||typeof n.resultId=="string")&&Array.isArray(n.data)&&(n.data.length===0||typeof n.data[0]=="number")}i(t,"is"),e.is=t})(lf||(lf={})),(function(e){function t(n,a){return{range:n,text:a}}i(t,"create"),e.create=t;function r(n){const a=n;return a!=null&&Q.is(a.range)&&A.string(a.text)}i(r,"is"),e.is=r})(uf||(uf={})),(function(e){function t(n,a,s){return{range:n,variableName:a,caseSensitiveLookup:s}}i(t,"create"),e.create=t;function r(n){const a=n;return a!=null&&Q.is(a.range)&&A.boolean(a.caseSensitiveLookup)&&(A.string(a.variableName)||a.variableName===void 0)}i(r,"is"),e.is=r})(cf||(cf={})),(function(e){function t(n,a){return{range:n,expression:a}}i(t,"create"),e.create=t;function r(n){const a=n;return a!=null&&Q.is(a.range)&&(A.string(a.expression)||a.expression===void 0)}i(r,"is"),e.is=r})(ff||(ff={})),(function(e){function t(n,a){return{frameId:n,stoppedLocation:a}}i(t,"create"),e.create=t;function r(n){const a=n;return A.defined(a)&&Q.is(n.stoppedLocation)}i(r,"is"),e.is=r})(df||(df={})),(function(e){e.Type=1,e.Parameter=2;function t(r){return r===1||r===2}i(t,"is"),e.is=t})(wo||(wo={})),(function(e){function t(n){return{value:n}}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&(a.tooltip===void 0||A.string(a.tooltip)||Ta.is(a.tooltip))&&(a.location===void 0||Wi.is(a.location))&&(a.command===void 0||nn.is(a.command))}i(r,"is"),e.is=r})(Io||(Io={})),(function(e){function t(n,a,s){const o={position:n,label:a};return s!==void 0&&(o.kind=s),o}i(t,"create"),e.create=t;function r(n){const a=n;return A.objectLiteral(a)&&ie.is(a.position)&&(A.string(a.label)||A.typedArray(a.label,Io.is))&&(a.kind===void 0||wo.is(a.kind))&&a.textEdits===void 0||A.typedArray(a.textEdits,Yt.is)&&(a.tooltip===void 0||A.string(a.tooltip)||Ta.is(a.tooltip))&&(a.paddingLeft===void 0||A.boolean(a.paddingLeft))&&(a.paddingRight===void 0||A.boolean(a.paddingRight))}i(r,"is"),e.is=r})(pf||(pf={})),(function(e){function t(r){return{kind:"snippet",value:r}}i(t,"createSnippet"),e.createSnippet=t})(mf||(mf={})),(function(e){function t(r,n,a,s){return{insertText:r,filterText:n,range:a,command:s}}i(t,"create"),e.create=t})(hf||(hf={})),(function(e){function t(r){return{items:r}}i(t,"create"),e.create=t})(yf||(yf={})),(function(e){e.Invoked=0,e.Automatic=1})(gf||(gf={})),(function(e){function t(r,n){return{range:r,text:n}}i(t,"create"),e.create=t})(vf||(vf={})),(function(e){function t(r,n){return{triggerKind:r,selectedCompletionInfo:n}}i(t,"create"),e.create=t})(Tf||(Tf={})),(function(e){function t(r){const n=r;return A.objectLiteral(n)&&Eo.is(n.uri)&&A.string(n.name)}i(t,"is"),e.is=t})($f||($f={})),zg=[` `,`\r `,"\r"],(function(e){function t(s,o,l,u){return new lh(s,o,l,u)}i(t,"create"),e.create=t;function r(s){let o=s;return!!(A.defined(o)&&A.string(o.uri)&&(A.undefined(o.languageId)||A.string(o.languageId))&&A.uinteger(o.lineCount)&&A.func(o.getText)&&A.func(o.positionAt)&&A.func(o.offsetAt))}i(r,"is"),e.is=r;function n(s,o){let l=s.getText(),u=a(o,(f,d)=>{let m=f.range.start.line-d.range.start.line;return m===0?f.range.start.character-d.range.start.character:m}),c=l.length;for(let f=u.length-1;f>=0;f--){let d=u[f],m=s.offsetAt(d.range.start),g=s.offsetAt(d.range.end);if(g<=c)l=l.substring(0,m)+d.newText+l.substring(g,l.length);else throw new Error("Overlapping edit");c=m}return l}i(n,"applyEdits"),e.applyEdits=n;function a(s,o){if(s.length<=1)return s;const l=s.length/2|0,u=s.slice(0,l),c=s.slice(l);a(u,o),a(c,o);let f=0,d=0,m=0;for(;f({domains:new Map,transitions:[]}),"createDefaultData"),H=rt(),St=s(()=>H.domains,"getDomains"),Mt=s(()=>H.transitions,"getTransitions"),zt=s(t=>{if(t)for(const e of t){const n=e.domain,a=(e.items??[]).map(c=>({label:c.label}));H.domains.set(n,{name:n,items:a})}},"setDomains"),Lt=s(t=>{t&&(H.transitions=t.filter(e=>e.from===e.to?(O.warn(`Cynefin: self-loop transition on domain "${e.from}" is not meaningful and will be skipped.`),!1):!0).map(e=>({from:e.from,to:e.to,label:e.label||void 0})))},"setTransitions"),Nt=s(()=>U({...Tt.cynefin,...Q().cynefin}),"getConfig"),Pt=s(()=>{At(),H=rt()},"clear"),Y={getDomains:St,getTransitions:Mt,setDomains:zt,setTransitions:Lt,getConfig:Nt,clear:Pt,setAccTitle:vt,getAccTitle:Ct,setDiagramTitle:wt,getDiagramTitle:bt,getAccDescription:$t,setAccDescription:gt},It=s(t=>{xt(t,Y),Y.setDomains(t.domains),Y.setTransitions(t.transitions)},"populate"),Wt={parse:s(async t=>{const e=await Bt("cynefin",t);O.debug(e),It(e)},"parse")};function V(t){let e=t+1831565813|0;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}s(V,"seededRandom");function st(t){let e=0;for(let n=0;n{const n=t/2,a=e/2;return{complex:{cx:n/2,cy:a/2,x:0,y:0,w:n,h:a},complicated:{cx:n+n/2,cy:a/2,x:n,y:0,w:n,h:a},chaotic:{cx:n/2,cy:a+a/2,x:0,y:a,w:n,h:a},clear:{cx:n+n/2,cy:a+a/2,x:n,y:a,w:n,h:a},confusion:{cx:n,cy:a,x:n*.7,y:a*.7,w:n*.6,h:a*.6}}},"getDomainLayouts"),_t=s(()=>{const t=ot(),e=Q();return U(t,e.themeVariables).cynefin},"getCynefinDomainColors"),q=3,Et=s((t,e,n,a)=>{const c=a.db,m=c.getDomains(),v=c.getTransitions(),W=c.getDiagramTitle(),d=c.getAccTitle(),D=c.getAccDescription(),o=c.getConfig(),p=_t();O.debug("Rendering Cynefin diagram");const i=o.width,f=o.height,b=o.padding,h=o.showDomainDescriptions,R=o.boundaryAmplitude,_=i+b*2,E=f+b*2,z={complex:p.complexBg,complicated:p.complicatedBg,clear:p.clearBg,chaotic:p.chaoticBg,confusion:p.confusionBg},k=Dt(e);kt(k,E,_,o.useMaxWidth??!0),k.attr("viewBox",`0 0 ${_} ${E}`),d&&k.append("title").text(d),D&&k.append("desc").text(D);const A=k.append("g").attr("transform",`translate(${b}, ${b})`),F=Rt(i,f),Z=it(o.seed,e),mt=A.append("g").attr("class","cynefin-backgrounds"),X=["complex","complicated","chaotic","clear"];for(const l of X){const r=F[l];mt.append("rect").attr("class","cynefinDomain").attr("x",r.x).attr("y",r.y).attr("width",r.w).attr("height",r.h).attr("fill",z[l]).attr("fill-opacity",.4).attr("stroke","none")}const j=A.append("g").attr("class","cynefin-boundaries");j.append("path").attr("class","cynefinBoundary").attr("d",ct(i,f,Z,R)).attr("fill","none"),j.append("path").attr("class","cynefinBoundary").attr("d",lt(i,f,Z+100,R)).attr("fill","none"),j.append("path").attr("class","cynefinCliff").attr("d",dt(i,f)).attr("fill","none");const pt=i*.15,yt=f*.15;A.append("path").attr("class","cynefinConfusion").attr("d",ft(i/2,f/2,pt,yt)).attr("fill",z.confusion).attr("fill-opacity",.5);const J=A.append("g").attr("class","cynefin-labels");for(const l of X){const r=F[l];J.append("text").attr("class","cynefinDomainLabel").attr("x",r.cx).attr("y",h?r.cy-30:r.cy).attr("text-anchor","middle").attr("dominant-baseline","middle").text(l.charAt(0).toUpperCase()+l.slice(1))}if(J.append("text").attr("class","cynefinDomainLabel").attr("x",i/2).attr("y",h?f/2-10:f/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text("Confusion"),h){const l=A.append("g").attr("class","cynefin-subtitles");for(const r of X){const u=F[r],y=at[r];l.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy-10).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.model),l.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy+5).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.practice)}l.append("text").attr("class","cynefinSubtitle").attr("x",i/2).attr("y",f/2+8).attr("text-anchor","middle").attr("dominant-baseline","middle").text(at.confusion.practice)}const K=A.append("g").attr("class","cynefin-items"),T=26,tt=10,ut=["complex","complicated","chaotic","clear","confusion"];for(const l of ut){const r=m.get(l);if(!r||r.items.length===0)continue;const u=F[l],y=l==="confusion";let L=r.items,N=0;y&&r.items.length>q&&(N=r.items.length-q,L=r.items.slice(0,q));let B;if(y){const g=h?22:14;B=u.cy+g}else B=u.cy+(h?25:15);if([...L].forEach((g,S)=>{const w=B+S*(T+4),M=K.append("g"),P=M.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",T/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(g.label);let $=g.label.length*7;const x=P.node();if(x&&typeof x.getBBox=="function"){const G=x.getBBox();G.width>0&&($=G.width)}const C=$+tt*2,I=u.cx-C/2;M.attr("transform",`translate(${I}, ${w})`),M.insert("rect","text").attr("class","cynefinItem").attr("x",0).attr("y",0).attr("width",C).attr("height",T).attr("rx",4).attr("ry",4).attr("fill",z[l]).attr("fill-opacity",.95),P.attr("x",C/2).attr("y",T/2)}),N>0){const g=B+L.length*(T+4),S=`+${N} more`,w=K.append("g"),M=w.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",T/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(S);let P=S.length*7;const $=M.node();if($&&typeof $.getBBox=="function"){const I=$.getBBox();I.width>0&&(P=I.width)}const x=P+tt*2,C=u.cx-x/2;w.attr("transform",`translate(${C}, ${g})`),w.insert("rect","text").attr("class","cynefinItemOverflow").attr("x",0).attr("y",0).attr("width",x).attr("height",T).attr("rx",4).attr("ry",4).attr("fill",z[l]).attr("fill-opacity",.6),M.attr("x",x/2).attr("y",T/2)}}if(v.length>0){const l=k.select("defs").empty()?k.append("defs"):k.select("defs"),r=`cynefin-arrow-${e}`;l.append("marker").attr("id",r).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","cynefinArrowHead");const u=A.append("g").attr("class","cynefin-arrows");v.forEach(y=>{const L=F[y.from],N=F[y.to];if(!L||!N)return;if(y.from===y.to){O.warn(`Cynefin renderer: skipping self-loop on domain "${y.from}"`);return}const B=L.cx,g=L.cy,S=N.cx,w=N.cy,M=(B+S)/2,P=(g+w)/2,$=S-B,x=w-g,C=Math.sqrt($*$+x*x),I=C*.15,G=-x/C,ht=$/C,et=M+G*I,nt=P+ht*I;u.append("path").attr("class","cynefinArrowLine").attr("d",`M${B},${g} Q${et},${nt} ${S},${w}`).attr("fill","none").attr("marker-end",`url(#${r})`),y.label&&u.append("text").attr("class","cynefinArrowLabel").attr("x",et).attr("y",nt-6).attr("text-anchor","middle").attr("dominant-baseline","auto").text(y.label)})}W&&A.append("text").attr("class","cynefinTitle").attr("x",i/2).attr("y",-b/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text(W)},"draw"),Ft={draw:Et},Vt=s(()=>{const t=ot(),e=Q();return U(t,e.themeVariables).cynefin},"getCynefinTheme"),Ht=s(()=>{const t=Vt();return` +import{p as xt}from"./chunk-JWPE2WC7-CI-VQAzP.js";import{s as gt,g as $t,o as bt,n as wt,a as Ct,b as vt,_ as s,l as O,D as Dt,e as kt,p as At,A as U,y as Q,B as Tt,E as ot}from"./mermaid.core-mH2pk-lc.js";import{p as Bt}from"./cynefin-VYW2F7L2-BD8Xugtm.js";import"./index-BIElaaEN.js";import"./_commonjsHelpers-CqkleIqs.js";var rt=s(()=>({domains:new Map,transitions:[]}),"createDefaultData"),H=rt(),St=s(()=>H.domains,"getDomains"),Mt=s(()=>H.transitions,"getTransitions"),zt=s(t=>{if(t)for(const e of t){const n=e.domain,a=(e.items??[]).map(c=>({label:c.label}));H.domains.set(n,{name:n,items:a})}},"setDomains"),Lt=s(t=>{t&&(H.transitions=t.filter(e=>e.from===e.to?(O.warn(`Cynefin: self-loop transition on domain "${e.from}" is not meaningful and will be skipped.`),!1):!0).map(e=>({from:e.from,to:e.to,label:e.label||void 0})))},"setTransitions"),Nt=s(()=>U({...Tt.cynefin,...Q().cynefin}),"getConfig"),Pt=s(()=>{At(),H=rt()},"clear"),Y={getDomains:St,getTransitions:Mt,setDomains:zt,setTransitions:Lt,getConfig:Nt,clear:Pt,setAccTitle:vt,getAccTitle:Ct,setDiagramTitle:wt,getDiagramTitle:bt,getAccDescription:$t,setAccDescription:gt},It=s(t=>{xt(t,Y),Y.setDomains(t.domains),Y.setTransitions(t.transitions)},"populate"),Wt={parse:s(async t=>{const e=await Bt("cynefin",t);O.debug(e),It(e)},"parse")};function V(t){let e=t+1831565813|0;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}s(V,"seededRandom");function st(t){let e=0;for(let n=0;n{const n=t/2,a=e/2;return{complex:{cx:n/2,cy:a/2,x:0,y:0,w:n,h:a},complicated:{cx:n+n/2,cy:a/2,x:n,y:0,w:n,h:a},chaotic:{cx:n/2,cy:a+a/2,x:0,y:a,w:n,h:a},clear:{cx:n+n/2,cy:a+a/2,x:n,y:a,w:n,h:a},confusion:{cx:n,cy:a,x:n*.7,y:a*.7,w:n*.6,h:a*.6}}},"getDomainLayouts"),_t=s(()=>{const t=ot(),e=Q();return U(t,e.themeVariables).cynefin},"getCynefinDomainColors"),q=3,Et=s((t,e,n,a)=>{const c=a.db,m=c.getDomains(),v=c.getTransitions(),W=c.getDiagramTitle(),d=c.getAccTitle(),D=c.getAccDescription(),o=c.getConfig(),p=_t();O.debug("Rendering Cynefin diagram");const i=o.width,f=o.height,b=o.padding,h=o.showDomainDescriptions,R=o.boundaryAmplitude,_=i+b*2,E=f+b*2,z={complex:p.complexBg,complicated:p.complicatedBg,clear:p.clearBg,chaotic:p.chaoticBg,confusion:p.confusionBg},k=Dt(e);kt(k,E,_,o.useMaxWidth??!0),k.attr("viewBox",`0 0 ${_} ${E}`),d&&k.append("title").text(d),D&&k.append("desc").text(D);const A=k.append("g").attr("transform",`translate(${b}, ${b})`),F=Rt(i,f),Z=it(o.seed,e),mt=A.append("g").attr("class","cynefin-backgrounds"),X=["complex","complicated","chaotic","clear"];for(const l of X){const r=F[l];mt.append("rect").attr("class","cynefinDomain").attr("x",r.x).attr("y",r.y).attr("width",r.w).attr("height",r.h).attr("fill",z[l]).attr("fill-opacity",.4).attr("stroke","none")}const j=A.append("g").attr("class","cynefin-boundaries");j.append("path").attr("class","cynefinBoundary").attr("d",ct(i,f,Z,R)).attr("fill","none"),j.append("path").attr("class","cynefinBoundary").attr("d",lt(i,f,Z+100,R)).attr("fill","none"),j.append("path").attr("class","cynefinCliff").attr("d",dt(i,f)).attr("fill","none");const pt=i*.15,yt=f*.15;A.append("path").attr("class","cynefinConfusion").attr("d",ft(i/2,f/2,pt,yt)).attr("fill",z.confusion).attr("fill-opacity",.5);const J=A.append("g").attr("class","cynefin-labels");for(const l of X){const r=F[l];J.append("text").attr("class","cynefinDomainLabel").attr("x",r.cx).attr("y",h?r.cy-30:r.cy).attr("text-anchor","middle").attr("dominant-baseline","middle").text(l.charAt(0).toUpperCase()+l.slice(1))}if(J.append("text").attr("class","cynefinDomainLabel").attr("x",i/2).attr("y",h?f/2-10:f/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text("Confusion"),h){const l=A.append("g").attr("class","cynefin-subtitles");for(const r of X){const u=F[r],y=at[r];l.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy-10).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.model),l.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy+5).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.practice)}l.append("text").attr("class","cynefinSubtitle").attr("x",i/2).attr("y",f/2+8).attr("text-anchor","middle").attr("dominant-baseline","middle").text(at.confusion.practice)}const K=A.append("g").attr("class","cynefin-items"),T=26,tt=10,ut=["complex","complicated","chaotic","clear","confusion"];for(const l of ut){const r=m.get(l);if(!r||r.items.length===0)continue;const u=F[l],y=l==="confusion";let L=r.items,N=0;y&&r.items.length>q&&(N=r.items.length-q,L=r.items.slice(0,q));let B;if(y){const g=h?22:14;B=u.cy+g}else B=u.cy+(h?25:15);if([...L].forEach((g,S)=>{const w=B+S*(T+4),M=K.append("g"),P=M.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",T/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(g.label);let $=g.label.length*7;const x=P.node();if(x&&typeof x.getBBox=="function"){const G=x.getBBox();G.width>0&&($=G.width)}const C=$+tt*2,I=u.cx-C/2;M.attr("transform",`translate(${I}, ${w})`),M.insert("rect","text").attr("class","cynefinItem").attr("x",0).attr("y",0).attr("width",C).attr("height",T).attr("rx",4).attr("ry",4).attr("fill",z[l]).attr("fill-opacity",.95),P.attr("x",C/2).attr("y",T/2)}),N>0){const g=B+L.length*(T+4),S=`+${N} more`,w=K.append("g"),M=w.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",T/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(S);let P=S.length*7;const $=M.node();if($&&typeof $.getBBox=="function"){const I=$.getBBox();I.width>0&&(P=I.width)}const x=P+tt*2,C=u.cx-x/2;w.attr("transform",`translate(${C}, ${g})`),w.insert("rect","text").attr("class","cynefinItemOverflow").attr("x",0).attr("y",0).attr("width",x).attr("height",T).attr("rx",4).attr("ry",4).attr("fill",z[l]).attr("fill-opacity",.6),M.attr("x",x/2).attr("y",T/2)}}if(v.length>0){const l=k.select("defs").empty()?k.append("defs"):k.select("defs"),r=`cynefin-arrow-${e}`;l.append("marker").attr("id",r).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","cynefinArrowHead");const u=A.append("g").attr("class","cynefin-arrows");v.forEach(y=>{const L=F[y.from],N=F[y.to];if(!L||!N)return;if(y.from===y.to){O.warn(`Cynefin renderer: skipping self-loop on domain "${y.from}"`);return}const B=L.cx,g=L.cy,S=N.cx,w=N.cy,M=(B+S)/2,P=(g+w)/2,$=S-B,x=w-g,C=Math.sqrt($*$+x*x),I=C*.15,G=-x/C,ht=$/C,et=M+G*I,nt=P+ht*I;u.append("path").attr("class","cynefinArrowLine").attr("d",`M${B},${g} Q${et},${nt} ${S},${w}`).attr("fill","none").attr("marker-end",`url(#${r})`),y.label&&u.append("text").attr("class","cynefinArrowLabel").attr("x",et).attr("y",nt-6).attr("text-anchor","middle").attr("dominant-baseline","auto").text(y.label)})}W&&A.append("text").attr("class","cynefinTitle").attr("x",i/2).attr("y",-b/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text(W)},"draw"),Ft={draw:Et},Vt=s(()=>{const t=ot(),e=Q();return U(t,e.themeVariables).cynefin},"getCynefinTheme"),Ht=s(()=>{const t=Vt();return` .cynefinDomain { stroke: none; } diff --git a/apps/kimi-code/dist-web/assets/dagre-VKFMJZFB-G1--45o_.js b/apps/kimi-code/dist-web/assets/dagre-VKFMJZFB-KF-u0oL9.js similarity index 97% rename from apps/kimi-code/dist-web/assets/dagre-VKFMJZFB-G1--45o_.js rename to apps/kimi-code/dist-web/assets/dagre-VKFMJZFB-KF-u0oL9.js index 65e6290cd48..534f801cc44 100644 --- a/apps/kimi-code/dist-web/assets/dagre-VKFMJZFB-G1--45o_.js +++ b/apps/kimi-code/dist-web/assets/dagre-VKFMJZFB-KF-u0oL9.js @@ -1,4 +1,4 @@ -import{c as O,w as I,a as J,f as P,b as E,s as A}from"./chunk-RYQCIY6F-LhAgalr3.js";import{_ as w,am as v,an as D,ao as H,ap as Y,l,c as _,aq as W,ar as $,ag as j,as as q,ah as R,af as F,at as z,au as K,av as G}from"./mermaid.core-WW7RuneT.js";import{G as Q}from"./graph-DOmOIIwC.js";import{l as U}from"./layout-D-LzfAck.js";import"./map-DxJ2ADlA.js";import"./index-CiHMlsuo.js";import"./_commonjsHelpers-CqkleIqs.js";var C=w((s,t,g)=>Math.max(t,Math.min(g,s)),"clamp"),B=w((s="TB")=>{switch(s){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),V=w(s=>s==="flowchart"||s==="flowchart-v2"||s==="stateDiagram","shouldMergeSelfLoopSegments"),Z=w((s,t,g,m,c)=>{const o=[],r=new Set;if(g.forEach(({start:i,end:n})=>{i!==m&&r.add(i),n!==m&&r.add(n)}),r.forEach(i=>{const n=s.node(i);typeof n?.x=="number"&&typeof n?.y=="number"&&o.push(n)}),o.length===0&&g.forEach(({edge:i})=>{(i.points??[]).forEach(n=>{typeof n?.x=="number"&&typeof n?.y=="number"&&o.push(n)})}),o.length===0)return B(c);const f=o.reduce((i,n)=>({x:i.x+n.x/o.length,y:i.y+n.y/o.length}),{x:0,y:0}),h=f.x-t.x,a=f.y-t.y;return Math.abs(h)>Math.abs(a)?h>0?"right":"left":Math.abs(a)>0?a>0?"bottom":"top":B(c)},"getSelfLoopSide"),ee=w((s,t="top",g=0,m=0)=>{const c=s.x,o=s.y-g,r=s.width/2,f=s.height/2,h=Math.max(36,Math.min(100,s.width*.8)),a=C(Math.max(m,s.width*.35),36,h),i=C(Math.min(s.width,s.height)*.45,24,48);switch(t){case"bottom":{const n=o+f;return[{x:c-a/2,y:n},{x:c-a/2,y:n+i},{x:c+a/2,y:n+i},{x:c+a/2,y:n}]}case"right":{const n=c+r;return[{x:n,y:o-a/2},{x:n+i,y:o-a/2},{x:n+i,y:o+a/2},{x:n,y:o+a/2}]}case"left":{const n=c-r;return[{x:n,y:o-a/2},{x:n-i,y:o-a/2},{x:n-i,y:o+a/2},{x:n,y:o+a/2}]}case"top":default:{const n=o-f;return[{x:c-a/2,y:n},{x:c-a/2,y:n-i},{x:c+a/2,y:n-i},{x:c+a/2,y:n}]}}},"getSelfLoopPoints"),te=w((s,t,g="top",m=0,c={})=>{const r=s.x,f=s.y-m,h=c.width??0,a=c.height??0;switch(g){case"bottom":return{x:r,y:Math.max(...t.map(i=>i.y))+a/2+4};case"right":return{x:Math.max(...t.map(i=>i.x))+h/2+4,y:f};case"left":return{x:Math.min(...t.map(i=>i.x))-h/2-4,y:f};case"top":default:return{x:r,y:Math.min(...t.map(i=>i.y))-a/2-4}}},"getSelfLoopLabelPosition"),ne=w((s,t=0,{mergeSelfLoops:g=!0}={})=>{const m=new Map,c=[],o=s.graph()?.rankdir;return s.edges().forEach(r=>{const f=s.edge(r);if(g&&f.selfLoop){const h=f.selfLoop.id;m.has(h)||m.set(h,[]),m.get(h).push({edge:f,start:r.v,end:r.w})}else c.push({edge:f,start:r.v,end:r.w})}),m.forEach(r=>{if(r.length!==3){r.forEach(L=>c.push(L));return}r.sort((L,d)=>L.edge.selfLoop.order-d.edge.selfLoop.order);const[f,h,a]=r,i=f.edge.originalEdge??h.edge.originalEdge??a.edge.originalEdge??h.edge,n=s.node(i.start);if(!n){r.forEach(L=>c.push(L));return}const p={width:h.edge.width,height:h.edge.height},y=Z(s,n,r,i.start,o),X=ee(n,y,t,p.width??0),S=te(n,X,y,t,p),b={...h.edge,...i,id:i.id,points:X,start:i.start,end:i.end,x:S.x,y:S.y,width:p.width,height:p.height,labelStyle:h.edge.labelStyle,fromCluster:f.edge.fromCluster??h.edge.fromCluster??a.edge.fromCluster,toCluster:f.edge.toCluster??h.edge.toCluster??a.edge.toCluster};delete b.selfLoop,delete b.originalEdge,c.push({edge:b,start:b.start,end:b.end})}),c},"getEdgesToRender"),T=w(async(s,t,g,m,c,o)=>{l.warn("Graph in recursive render:XAX",I(t),c);const r=t.graph().rankdir;l.trace("Dir in recursive render - dir:",r);const f=s.insert("g").attr("class","root");t.nodes()?l.info("Recursive render XXX",t.nodes()):l.info("No nodes found for",t),t.edges().length>0&&l.info("Recursive edges",t.edge(t.edges()[0]));const h=f.insert("g").attr("class","clusters"),a=f.insert("g").attr("class","edgePaths"),i=f.insert("g").attr("class","edgeLabels"),n=f.insert("g").attr("class","nodes"),p=V(g);await Promise.all(t.nodes().map(async function(d){const e=t.node(d);if(c!==void 0){const u=JSON.parse(JSON.stringify(c.clusterData));l.trace(`Setting data for parent cluster XXX +import{c as O,w as I,a as J,f as P,b as E,s as A}from"./chunk-RYQCIY6F-C-i4N3ne.js";import{_ as w,am as v,an as D,ao as H,ap as Y,l,c as _,aq as W,ar as $,ag as j,as as q,ah as R,af as F,at as z,au as K,av as G}from"./mermaid.core-mH2pk-lc.js";import{G as Q}from"./graph-DOmOIIwC.js";import{l as U}from"./layout-D-LzfAck.js";import"./map-DxJ2ADlA.js";import"./index-BIElaaEN.js";import"./_commonjsHelpers-CqkleIqs.js";var C=w((s,t,g)=>Math.max(t,Math.min(g,s)),"clamp"),B=w((s="TB")=>{switch(s){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";case"TB":default:return"top"}},"getDefaultSelfLoopSide"),V=w(s=>s==="flowchart"||s==="flowchart-v2"||s==="stateDiagram","shouldMergeSelfLoopSegments"),Z=w((s,t,g,m,c)=>{const o=[],r=new Set;if(g.forEach(({start:i,end:n})=>{i!==m&&r.add(i),n!==m&&r.add(n)}),r.forEach(i=>{const n=s.node(i);typeof n?.x=="number"&&typeof n?.y=="number"&&o.push(n)}),o.length===0&&g.forEach(({edge:i})=>{(i.points??[]).forEach(n=>{typeof n?.x=="number"&&typeof n?.y=="number"&&o.push(n)})}),o.length===0)return B(c);const f=o.reduce((i,n)=>({x:i.x+n.x/o.length,y:i.y+n.y/o.length}),{x:0,y:0}),h=f.x-t.x,a=f.y-t.y;return Math.abs(h)>Math.abs(a)?h>0?"right":"left":Math.abs(a)>0?a>0?"bottom":"top":B(c)},"getSelfLoopSide"),ee=w((s,t="top",g=0,m=0)=>{const c=s.x,o=s.y-g,r=s.width/2,f=s.height/2,h=Math.max(36,Math.min(100,s.width*.8)),a=C(Math.max(m,s.width*.35),36,h),i=C(Math.min(s.width,s.height)*.45,24,48);switch(t){case"bottom":{const n=o+f;return[{x:c-a/2,y:n},{x:c-a/2,y:n+i},{x:c+a/2,y:n+i},{x:c+a/2,y:n}]}case"right":{const n=c+r;return[{x:n,y:o-a/2},{x:n+i,y:o-a/2},{x:n+i,y:o+a/2},{x:n,y:o+a/2}]}case"left":{const n=c-r;return[{x:n,y:o-a/2},{x:n-i,y:o-a/2},{x:n-i,y:o+a/2},{x:n,y:o+a/2}]}case"top":default:{const n=o-f;return[{x:c-a/2,y:n},{x:c-a/2,y:n-i},{x:c+a/2,y:n-i},{x:c+a/2,y:n}]}}},"getSelfLoopPoints"),te=w((s,t,g="top",m=0,c={})=>{const r=s.x,f=s.y-m,h=c.width??0,a=c.height??0;switch(g){case"bottom":return{x:r,y:Math.max(...t.map(i=>i.y))+a/2+4};case"right":return{x:Math.max(...t.map(i=>i.x))+h/2+4,y:f};case"left":return{x:Math.min(...t.map(i=>i.x))-h/2-4,y:f};case"top":default:return{x:r,y:Math.min(...t.map(i=>i.y))-a/2-4}}},"getSelfLoopLabelPosition"),ne=w((s,t=0,{mergeSelfLoops:g=!0}={})=>{const m=new Map,c=[],o=s.graph()?.rankdir;return s.edges().forEach(r=>{const f=s.edge(r);if(g&&f.selfLoop){const h=f.selfLoop.id;m.has(h)||m.set(h,[]),m.get(h).push({edge:f,start:r.v,end:r.w})}else c.push({edge:f,start:r.v,end:r.w})}),m.forEach(r=>{if(r.length!==3){r.forEach(L=>c.push(L));return}r.sort((L,d)=>L.edge.selfLoop.order-d.edge.selfLoop.order);const[f,h,a]=r,i=f.edge.originalEdge??h.edge.originalEdge??a.edge.originalEdge??h.edge,n=s.node(i.start);if(!n){r.forEach(L=>c.push(L));return}const p={width:h.edge.width,height:h.edge.height},y=Z(s,n,r,i.start,o),X=ee(n,y,t,p.width??0),S=te(n,X,y,t,p),b={...h.edge,...i,id:i.id,points:X,start:i.start,end:i.end,x:S.x,y:S.y,width:p.width,height:p.height,labelStyle:h.edge.labelStyle,fromCluster:f.edge.fromCluster??h.edge.fromCluster??a.edge.fromCluster,toCluster:f.edge.toCluster??h.edge.toCluster??a.edge.toCluster};delete b.selfLoop,delete b.originalEdge,c.push({edge:b,start:b.start,end:b.end})}),c},"getEdgesToRender"),T=w(async(s,t,g,m,c,o)=>{l.warn("Graph in recursive render:XAX",I(t),c);const r=t.graph().rankdir;l.trace("Dir in recursive render - dir:",r);const f=s.insert("g").attr("class","root");t.nodes()?l.info("Recursive render XXX",t.nodes()):l.info("No nodes found for",t),t.edges().length>0&&l.info("Recursive edges",t.edge(t.edges()[0]));const h=f.insert("g").attr("class","clusters"),a=f.insert("g").attr("class","edgePaths"),i=f.insert("g").attr("class","edgeLabels"),n=f.insert("g").attr("class","nodes"),p=V(g);await Promise.all(t.nodes().map(async function(d){const e=t.node(d);if(c!==void 0){const u=JSON.parse(JSON.stringify(c.clusterData));l.trace(`Setting data for parent cluster XXX Node.id = `,d,` data=`,u.height,` Parent cluster`,c.height),t.setNode(c.id,u),t.parent(d)||(l.trace("Setting parent",d,c.id),t.setParent(d,c.id,u))}if(l.info("(Insert) Node XXX"+d+": "+JSON.stringify(t.node(d))),e?.clusterNode){l.info("Cluster identified XBX",d,e.width,t.node(d));const{ranksep:u,nodesep:x}=t.graph();e.graph.setGraph({...e.graph.graph(),ranksep:u+25,nodesep:x});const N=await T(n,e.graph,g,m,t.node(d),o),M=N.elem;W(e,M),e.diff=N.diff||0,l.info("New compound node after recursive render XAX",d,"width",e.width,"height",e.height),$(M,e)}else t.children(d).length>0?(l.trace("Cluster - the non recursive path XBX",d,e.id,e,e.width,"Graph:",t),l.trace(P(e.id,t)),E.set(e.id,{id:P(e.id,t),node:e})):(l.trace("Node - the non recursive path XAX",d,n,t.node(d),r),await j(n,t.node(d),{config:o,dir:r}))})),await w(async()=>{const d=t.edges().map(async function(e){const u=t.edge(e.v,e.w,e.name);if(l.info("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(e)),l.info("Edge "+e.v+" -> "+e.w+": ",e," ",JSON.stringify(t.edge(e))),l.info("Fix",E,"ids:",e.v,e.w,"Translating: ",E.get(e.v),E.get(e.w)),p&&u.selfLoop){if(u.selfLoop.order!==1)return;const x=u.id;u.id=u.selfLoop.id,await G(i,u),u.id=x;return}await G(i,u)});await Promise.all(d)},"processEdges")(),l.info("Graph before layout:",JSON.stringify(I(t))),l.info("############################################# XXX"),l.info("### Layout ### XXX"),l.info("############################################# XXX"),U(t),l.info("Graph after layout:",JSON.stringify(I(t)));let X=0,{subGraphTitleTotalMargin:S}=q(o);await Promise.all(A(t).map(async function(d){const e=t.node(d);if(l.info("Position XBX => "+d+": ("+e.x,","+e.y,") width: ",e.width," height: ",e.height),e?.clusterNode)e.y+=S,l.info("A tainted cluster node XBX1",d,e.id,e.width,e.height,e.x,e.y,t.parent(d)),E.get(e.id).node=e,R(e);else if(t.children(d).length>0){l.info("A pure cluster node XBX1",d,e.id,e.x,e.y,e.width,e.height,t.parent(d)),e.height+=S,t.node(e.parentId);const u=e?.padding/2||0,x=e?.labelBBox?.height||0,N=x-u||0;l.debug("OffsetY",N,"labelHeight",x,"halfPadding",u),await F(h,e),E.get(e.id).node=e}else{const u=t.node(e.parentId);e.y+=S/2,l.info("A regular node XBX1 - using the padding",e.id,"parent",e.parentId,e.width,e.height,e.x,e.y,"offsetY",e.offsetY,"parent",u,u?.offsetY,e),R(e)}}));const b=S/2;return ne(t,b,{mergeSelfLoops:p}).forEach(function({edge:d,start:e,end:u}){l.info("Edge "+e+" -> "+u+": "+JSON.stringify(d),d),d.points.forEach(k=>k.y+=b);const x=t.node(e),N=t.node(u),M=z(a,d,E,g,x,N,m);K(d,M)}),t.nodes().forEach(function(d){const e=t.node(d);l.info(d,e.type,e.diff),e.isGroup&&(X=e.diff)}),l.warn("Returning from recursive render XAX",f,X),{elem:f,diff:X}},"recursiveRender"),le=w(async(s,t)=>{const g=new Q({multigraph:!0,compound:!0}).setGraph({rankdir:s.direction,nodesep:s.config?.nodeSpacing||s.config?.flowchart?.nodeSpacing||s.nodeSpacing,ranksep:s.config?.rankSpacing||s.config?.flowchart?.rankSpacing||s.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),m=t.select("g");v(m,s.markers,s.type,s.diagramId),D(),H(),Y(),O(),s.nodes.forEach(o=>{g.setNode(o.id,{...o}),o.parentId&&g.setParent(o.id,o.parentId)}),l.debug("Edges:",s.edges),s.edges.forEach(o=>{if(o.start===o.end){const r=o.start,f=r+"---"+r+"---1",h=r+"---"+r+"---2",a=g.node(r);g.setNode(f,{domId:f,id:f,parentId:a.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),g.setParent(f,a.parentId),g.setNode(h,{domId:h,id:h,parentId:a.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),g.setParent(h,a.parentId);const i=structuredClone(o),n=structuredClone(o),p=structuredClone(o),y=structuredClone(o);n.originalEdge=i,n.selfLoop={id:i.id,order:0},p.originalEdge=i,p.selfLoop={id:i.id,order:1},y.originalEdge=i,y.selfLoop={id:i.id,order:2},n.label="",n.arrowTypeEnd="none",n.endLabelLeft="",n.endLabelRight="",n.startLabelLeft="",n.id=r+"-cyclic-special-1",p.startLabelRight="",p.startLabelLeft="",p.endLabelLeft="",p.endLabelRight="",p.arrowTypeStart="none",p.arrowTypeEnd="none",p.id=r+"-cyclic-special-mid",y.label="",y.startLabelRight="",y.startLabelLeft="",y.arrowTypeStart="none",a.isGroup&&(n.fromCluster=r,y.toCluster=r),y.id=r+"-cyclic-special-2",y.arrowTypeStart="none",g.setEdge(r,f,n,r+"-cyclic-special-0"),g.setEdge(f,h,p,r+"-cyclic-special-1"),g.setEdge(h,r,y,r+"-cyclic-special-2")}else g.setEdge(o.start,o.end,{...o},o.id)}),l.warn("Graph at first:",JSON.stringify(I(g))),J(g),l.warn("Graph after XAX:",JSON.stringify(I(g)));const c=_();await T(m,g,s.type,s.diagramId,void 0,c)},"render");export{ne as getEdgesToRender,le as render}; diff --git a/apps/kimi-code/dist-web/assets/diagram-FQU43EPY-DlPR1W9u.js b/apps/kimi-code/dist-web/assets/diagram-FQU43EPY-BzHlNi2t.js similarity index 98% rename from apps/kimi-code/dist-web/assets/diagram-FQU43EPY-DlPR1W9u.js rename to apps/kimi-code/dist-web/assets/diagram-FQU43EPY-BzHlNi2t.js index f51ffcc9327..cc1fa16b6bd 100644 --- a/apps/kimi-code/dist-web/assets/diagram-FQU43EPY-DlPR1W9u.js +++ b/apps/kimi-code/dist-web/assets/diagram-FQU43EPY-BzHlNi2t.js @@ -1,3 +1,3 @@ -import{p as re}from"./chunk-JWPE2WC7-BJMJfnyy.js";import{o as oe,n as se,s as de,g as le,a as ce,b as me,_ as o,l as g,c as T,d as ue,z as xe,p as fe,A as ge,y as M,B as he,i as y,w as P,ak as pe}from"./mermaid.core-WW7RuneT.js";import{p as be,i as ve}from"./cynefin-VYW2F7L2-DI-9Z5R0.js";import"./index-CiHMlsuo.js";import"./_commonjsHelpers-CqkleIqs.js";var $="position frame",D="frame positioned",S="position relation",N="relation positioned",we=o(function(e){g.debug("options str",e)},"setOptions"),ye=o(function(){return{}},"getOptions"),Pe=o(function(){C(),fe()},"clear");function C(){B={}}o(C,"reset");var Se=he.eventmodeling,ke=o(()=>ge({...Se,...M().eventmodeling}),"getConfig"),B={};function O(){let e=Fe;const{ast:n}=B,t=E();if(!n)throw new Error("No data for EventModel");return n.frames.forEach((i,a)=>{const r=G(i,n.dataEntities,t);e=v(e,{$kind:$,index:a,frame:i,textProps:r});let d;K(i)?(g.debug("source frame",i.sourceFrames),d=n.frames.filter(l=>i.sourceFrames.some(c=>c.$refText===l.name)),d.forEach(l=>{e=v(e,{$kind:S,index:a,frame:i,sourceFrame:l})})):e=v(e,{$kind:S,index:a,frame:i})}),e={...e,sortedSwimlanesArray:A(e.swimlanes)},e}o(O,"getState");function I(e){B.ast=e}o(I,"setAst");var s={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextFontWeight:"bold",boxTextPadding:10,swimlaneTextFontWeight:"bold",labelUiAutomation:"UI/Automation",labelUiAutomationPrefix:"UI/A: ",labelCommandReadModel:"Command/Read Model",labelCommandReadModelPrefix:"C/RM: ",labelEvents:"Events",labelEventsPrefix:"Stream: "};function E(){return s}o(E,"getDiagramProps");var Fe={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function W(e){const n=e.split(".");if(n.length===2)return n[0]}o(W,"extractNamespace");function H(e){const n=e.split(".");return n.length===2?n[1]:e}o(H,"extractName");function U(e,n){if(!(!n||n.length===0))return Object.values(e).find(t=>t.namespace===n)}o(U,"findSwimlaneByNamespace");function b(e,n,t){return Math.max(n,...Object.keys(e).filter(i=>{const a=Number.parseInt(i);return a>n&&aNumber.parseInt(i)))+1}o(b,"findNextAvailableIndex");function _(e,n){const t=W(e.entityIdentifier),i=U(n,t);switch(e.modelEntityType){case"ui":case"pcr":case"processor":return i?{index:i.index,label:i.namespace||s.labelUiAutomation}:t?{index:b(n,0,100),label:s.labelUiAutomationPrefix+t}:{index:0,label:s.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return i?{index:i.index,label:i.namespace||s.labelCommandReadModel}:t?{index:b(n,100,200),label:s.labelCommandReadModelPrefix+t}:{index:100,label:s.labelCommandReadModel};case"evt":case"event":default:return i?{index:i.index,label:i.namespace||s.labelEvents}:t?{index:b(n,200,300),label:s.labelEventsPrefix+t}:{index:200,label:s.labelEvents}}}o(_,"calculateSwimlaneProps");function L(e){const{themeVariables:n}=M();switch(e.modelEntityType){case"ui":return{fill:n.emUiFill??"white",stroke:n.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:n.emProcessorFill??"#edb3f6",stroke:n.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:n.emReadModelFill??"#d3f1a2",stroke:n.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:n.emCommandFill??"#bcd6fe",stroke:n.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:n.emEventFill??"#ffb778",stroke:n.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}o(L,"calculateEntityVisualProps");function G(e,n,t){const i=M(),a=y(H(e.entityIdentifier)??"",i);let r;const d={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"
"};let c=`${P(a,t.textMaxWidth,d)}`;if(e.dataInlineValue&&(r=e.dataInlineValue,r=r.substring(r.indexOf("{")+1),r=r.substring(0,r.lastIndexOf("}")-1),r=y(r,i),r=P(r,t.textMaxWidth,d),r=r.replaceAll(" "," ")),e.dataReference){const p=n.find(w=>w.name===e.dataReference?.$refText);p&&(r=p.dataBlockValue,r=r.substring(r.indexOf(`{ +import{p as re}from"./chunk-JWPE2WC7-CI-VQAzP.js";import{o as oe,n as se,s as de,g as le,a as ce,b as me,_ as o,l as g,c as T,d as ue,z as xe,p as fe,A as ge,y as M,B as he,i as y,w as P,ak as pe}from"./mermaid.core-mH2pk-lc.js";import{p as be,i as ve}from"./cynefin-VYW2F7L2-BD8Xugtm.js";import"./index-BIElaaEN.js";import"./_commonjsHelpers-CqkleIqs.js";var $="position frame",D="frame positioned",S="position relation",N="relation positioned",we=o(function(e){g.debug("options str",e)},"setOptions"),ye=o(function(){return{}},"getOptions"),Pe=o(function(){C(),fe()},"clear");function C(){B={}}o(C,"reset");var Se=he.eventmodeling,ke=o(()=>ge({...Se,...M().eventmodeling}),"getConfig"),B={};function O(){let e=Fe;const{ast:n}=B,t=E();if(!n)throw new Error("No data for EventModel");return n.frames.forEach((i,a)=>{const r=G(i,n.dataEntities,t);e=v(e,{$kind:$,index:a,frame:i,textProps:r});let d;K(i)?(g.debug("source frame",i.sourceFrames),d=n.frames.filter(l=>i.sourceFrames.some(c=>c.$refText===l.name)),d.forEach(l=>{e=v(e,{$kind:S,index:a,frame:i,sourceFrame:l})})):e=v(e,{$kind:S,index:a,frame:i})}),e={...e,sortedSwimlanesArray:A(e.swimlanes)},e}o(O,"getState");function I(e){B.ast=e}o(I,"setAst");var s={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextFontWeight:"bold",boxTextPadding:10,swimlaneTextFontWeight:"bold",labelUiAutomation:"UI/Automation",labelUiAutomationPrefix:"UI/A: ",labelCommandReadModel:"Command/Read Model",labelCommandReadModelPrefix:"C/RM: ",labelEvents:"Events",labelEventsPrefix:"Stream: "};function E(){return s}o(E,"getDiagramProps");var Fe={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function W(e){const n=e.split(".");if(n.length===2)return n[0]}o(W,"extractNamespace");function H(e){const n=e.split(".");return n.length===2?n[1]:e}o(H,"extractName");function U(e,n){if(!(!n||n.length===0))return Object.values(e).find(t=>t.namespace===n)}o(U,"findSwimlaneByNamespace");function b(e,n,t){return Math.max(n,...Object.keys(e).filter(i=>{const a=Number.parseInt(i);return a>n&&aNumber.parseInt(i)))+1}o(b,"findNextAvailableIndex");function _(e,n){const t=W(e.entityIdentifier),i=U(n,t);switch(e.modelEntityType){case"ui":case"pcr":case"processor":return i?{index:i.index,label:i.namespace||s.labelUiAutomation}:t?{index:b(n,0,100),label:s.labelUiAutomationPrefix+t}:{index:0,label:s.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return i?{index:i.index,label:i.namespace||s.labelCommandReadModel}:t?{index:b(n,100,200),label:s.labelCommandReadModelPrefix+t}:{index:100,label:s.labelCommandReadModel};case"evt":case"event":default:return i?{index:i.index,label:i.namespace||s.labelEvents}:t?{index:b(n,200,300),label:s.labelEventsPrefix+t}:{index:200,label:s.labelEvents}}}o(_,"calculateSwimlaneProps");function L(e){const{themeVariables:n}=M();switch(e.modelEntityType){case"ui":return{fill:n.emUiFill??"white",stroke:n.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:n.emProcessorFill??"#edb3f6",stroke:n.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:n.emReadModelFill??"#d3f1a2",stroke:n.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:n.emCommandFill??"#bcd6fe",stroke:n.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:n.emEventFill??"#ffb778",stroke:n.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}o(L,"calculateEntityVisualProps");function G(e,n,t){const i=M(),a=y(H(e.entityIdentifier)??"",i);let r;const d={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"
"};let c=`${P(a,t.textMaxWidth,d)}`;if(e.dataInlineValue&&(r=e.dataInlineValue,r=r.substring(r.indexOf("{")+1),r=r.substring(0,r.lastIndexOf("}")-1),r=y(r,i),r=P(r,t.textMaxWidth,d),r=r.replaceAll(" "," ")),e.dataReference){const p=n.find(w=>w.name===e.dataReference?.$refText);p&&(r=p.dataBlockValue,r=r.substring(r.indexOf(`{ `)+2),r=r.substring(0,r.lastIndexOf("}")-1),r=y(r,i),r=P(r,t.textMaxWidth,d),r=r.replaceAll(" "," "),r+="
")}const m=r!==void 0;m&&(c+=`

${r}`);const x={fontSize:d.fontSize,fontWeight:d.fontWeight,fontFamily:d.fontFamily},u=pe(c,x),h=m?u.width/3:u.width,f={content:c,width:h,height:u.height};return g.debug(`[${e.name}] ${e.entityIdentifier} text`,f),f}o(G,"calculateTextProps");function V(e,n){const t=n,i=L(t.frame),a={width:t.textProps.width+2*s.boxTextPadding,height:t.textProps.height+2*s.boxTextPadding};return[{$kind:D,frame:t.frame,index:t.index,visual:i,dimension:a,textProps:t.textProps}]}o(V,"decidePositionFrame");function X(e,n,t){return n===void 0?s.contentStartX:n.index===e.index&&e.r?e.r+s.boxPadding:t===void 0?s.contentStartX:t.r-s.boxOverlap+s.boxPadding}o(X,"calculateX");function j(e,n){const t=[...e.map(i=>i.r),n];return Math.max(...t)}o(j,"calculateMaxRight");function A(e){return Object.values(e).sort((n,t)=>n.index-t.index)}o(A,"sortedSwimlanesArray");function Y(e,n){const t=n,i=_(t.frame,e.swimlanes);let a;i.index in e.swimlanes?a=e.swimlanes[i.index]:a={index:i.index,label:i.label,r:0,y:i.index*s.swimlaneMinHeight+s.swimlaneGap,height:s.swimlaneMinHeight,maxHeight:s.swimlaneMinHeight};const r=e.boxes.length>0?e.boxes[e.boxes.length-1]:void 0,d=e.previousSwimlaneNumber!==void 0?e.swimlanes[e.previousSwimlaneNumber]:void 0,l={width:Math.max(s.boxMinWidth,Math.min(s.boxMaxWidth,t.dimension.width))+2*s.boxPadding,height:Math.max(s.boxMinHeight,Math.min(s.boxMaxHeight,t.dimension.height))+2*s.boxPadding},c=X(a,d,r),m=c+l.width+s.boxPadding,x=j(Object.values(e.swimlanes),m);a.r=c+l.width,a.maxHeight=Math.max(a.maxHeight,l.height),a.height=Math.max(s.swimlaneMinHeight,a.maxHeight)+2*s.swimlanePadding;const u={x:c,y:s.swimlanePadding+a.y,r:m,dimension:l,leftSibling:!1,swimlane:a,visual:t.visual,text:t.textProps.content,frame:t.frame,index:t.index},h={...e,boxes:[...e.boxes,u],swimlanes:{...e.swimlanes,[`${a.index}`]:a},previousSwimlaneNumber:i.index,previousFrame:t.frame,maxR:x},f=A(h.swimlanes);f.length>0&&(f[0].y=0);for(let p=1;p0}o(K,"hasSourceFrame");function k(e,n){if(n!=null)return e.find(t=>t.frame.name===n.name)}o(k,"findBoxByFrame");function q(e,n,t){if(!(t<0))for(let i=t;i>=0;i--){const a=e[i];if(a.swimlane.index!==n)return a}}o(q,"findBoxByLineIndex");function J(e,n){const t=n;if(ve(t.frame)||z(t.index,t.frame))return[];const i=k(e.boxes,t.frame);if(i===void 0)throw new Error(`Target box not found for frame ${t.frame.name}`);let a;return t.sourceFrame?a=k(e.boxes,t.sourceFrame):a=q(e.boxes,i.swimlane.index,t.index-1),a===void 0?[]:[{$kind:N,frame:t.frame,index:t.index,sourceBox:a,targetBox:i}]}o(J,"decidePositionRelation");function Q(e,n){const t=n,i={visual:{fill:"none",stroke:"#000"},source:{x:t.sourceBox.x,y:t.sourceBox.y},target:{x:t.targetBox.x,y:t.targetBox.y},sourceBox:t.sourceBox,targetBox:t.targetBox};return{...e,relations:[...e.relations,i]}}o(Q,"evolveRelationPositioned");var Me={[$]:V,[S]:J},Be={[D]:Y,[N]:Q};function Z(e,n){const t=Me[n.$kind];if(t==null)return[];const i=t(e,n);return g.debug("decided events",i),i}o(Z,"decide");function ee(e,n){const t=n.reduce((i,a)=>{const r=Be[a.$kind];return r==null?i:r(i,a)},e);return g.debug("evolve events",{state:e,newState:t,events:n}),t}o(ee,"evolve");function v(e,n){const t=Z(e,n);return ee(e,t)}o(v,"dispatch");var F={getConfig:ke,setOptions:we,getOptions:ye,clear:Pe,setAccTitle:me,getAccTitle:ce,getAccDescription:le,setAccDescription:de,setDiagramTitle:se,getDiagramTitle:oe,setAst:I,getDiagramProps:E,getState:O},Ee={parse:o(async e=>{const n=await be("eventmodeling",e);g.debug(n),F.setAst(n),re(n,F)},"parse")},Ae=T(),Re=Ae?.eventmodeling;function te(e,n){return t=>{const i=t.swimlane.y+n.swimlanePadding,a=e.append("g").attr("class","em-box");a.append("rect").attr("x",t.x).attr("y",i).attr("rx","3").attr("width",t.dimension.width).attr("height",t.dimension.height).attr("stroke",t.visual.stroke).attr("fill",t.visual.fill),a.append("foreignObject").attr("x",t.x+n.boxPadding).attr("y",i+10).attr("width",t.dimension.width-2*n.boxPadding).attr("height",t.dimension.height-2*n.boxPadding).append("xhtml:div").style("display","table").style("height","100%").style("width","100%").append("span").style("display","table-cell").style("text-align","center").style("vertical-align","middle").html(t.text)}}o(te,"renderD3Box");function ne(e,n){return e>n}o(ne,"dirUpwards");function ie(e,n,t,i){return a=>{const r=a.sourceBox.swimlane.y+n.swimlanePadding,d=a.targetBox.swimlane.y+n.swimlanePadding,l=ne(r,d),c=a.sourceBox.x+a.sourceBox.dimension.width*2/3,m=a.targetBox.x+a.targetBox.dimension.width/3;let x,u;g.debug(`rendering relation up=${l} for `,{sourceBox:a.sourceBox,targetBox:a.targetBox}),l?(x=r,u=d+a.targetBox.dimension.height):(x=r+a.sourceBox.dimension.height,u=d);const h=i.emRelationStroke??a.visual.stroke;e.append("path").attr("class","em-relation").attr("fill",a.visual.fill).attr("stroke",h).attr("stroke-width","1").attr("marker-end",`url(#${t})`).attr("d",`M${c} ${x} L${m} ${u}`)}}o(ie,"renderD3Relation");function ae(e,n,t,i){return a=>{const r=e.append("g").attr("class","em-swimlane"),d=i.emSwimlaneBackgroundOdd??"rgb(250,250,250)",l=i.emSwimlaneBackgroundStroke??"rgb(240,240,240)";r.append("rect").attr("x",0).attr("y",a.y).attr("rx","3").attr("width",n+t.swimlanePadding).attr("height",a.height).attr("fill",d).attr("stroke",l),r.append("text").attr("font-weight",t.swimlaneTextFontWeight).attr("x",30).attr("y",a.y+30).text(a.label)}}o(ae,"renderD3Swimlane");var Te=o(function(e,n,t,i){if(g.debug("in eventmodeling renderer",e+` `,"id:",n,t),!Re)throw new Error("EventModeling config not found");const a=i.db,{themeVariables:r,eventmodeling:d}=T(),l=ue(`[id="${n}"]`),c=a.getDiagramProps(),m=a.getState(),x=`em-arrowhead-${n}`,u=r.emArrowhead??"#000000";m.sortedSwimlanesArray.forEach(ae(l,m.maxR,c,r)),m.boxes.forEach(te(l,c)),m.relations.forEach(ie(l,c,x,r)),l.append("defs").append("marker").attr("id",x).attr("markerWidth","10").attr("markerHeight","7").attr("refX","10").attr("refY","3.5").attr("orient","auto").append("polygon").attr("points","0 0, 10 3.5, 0 7").attr("fill",u),xe(void 0,l,d?.padding??30,d?.useMaxWidth)},"draw"),$e={draw:Te},De=o(e=>"","getStyles"),Ne=De,Ue={parser:Ee,db:F,renderer:$e,styles:Ne};export{Ue as diagram}; diff --git a/apps/kimi-code/dist-web/assets/diagram-G47NLZAW-Bj3iAwJq.js b/apps/kimi-code/dist-web/assets/diagram-G47NLZAW-DhqYYg2I.js similarity index 97% rename from apps/kimi-code/dist-web/assets/diagram-G47NLZAW-Bj3iAwJq.js rename to apps/kimi-code/dist-web/assets/diagram-G47NLZAW-DhqYYg2I.js index cb6e45620ce..80d846b1428 100644 --- a/apps/kimi-code/dist-web/assets/diagram-G47NLZAW-Bj3iAwJq.js +++ b/apps/kimi-code/dist-web/assets/diagram-G47NLZAW-DhqYYg2I.js @@ -1,4 +1,4 @@ -import{p as me}from"./chunk-JWPE2WC7-BJMJfnyy.js";import{_ as w,E as ge,y as te,A as Q,D as ye,e as Se,l as ee,be as B,d as j,b as ve,a as xe,n as be,o as we,g as Ce,s as Te,B as Le,bf as $e,p as Ae}from"./mermaid.core-WW7RuneT.js";import{s as Fe}from"./chunk-VR4S4FIN-C_RujyXt.js";import{p as Ne}from"./cynefin-VYW2F7L2-DI-9Z5R0.js";import{b as I}from"./defaultLocale-DX6XiGOO.js";import{o as K}from"./ordinal-Cboi1Yqb.js";import"./index-CiHMlsuo.js";import"./_commonjsHelpers-CqkleIqs.js";import"./init-Gi6I4Gst.js";function Me(e){var a=0,n=e.children,l=n&&n.length;if(!l)a=1;else for(;--l>=0;)a+=n[l].value;e.value=a}function _e(){return this.eachAfter(Me)}function ke(e,a){let n=-1;for(const l of this)e.call(a,l,++n,this);return this}function ze(e,a){for(var n=this,l=[n],r,o,h=-1;n=l.pop();)if(e.call(a,n,++h,this),r=n.children)for(o=r.length-1;o>=0;--o)l.push(r[o]);return this}function Ve(e,a){for(var n=this,l=[n],r=[],o,h,d,g=-1;n=l.pop();)if(r.push(n),o=n.children)for(h=0,d=o.length;h=0;)n+=l[r].value;a.value=n})}function Be(e){return this.eachBefore(function(a){a.children&&a.children.sort(e)})}function Ee(e){for(var a=this,n=Re(a,e),l=[a];a!==n;)a=a.parent,l.push(a);for(var r=l.length;e!==n;)l.splice(r,0,e),e=e.parent;return l}function Re(e,a){if(e===a)return e;var n=e.ancestors(),l=a.ancestors(),r=null;for(e=n.pop(),a=l.pop();e===a;)r=e,e=n.pop(),a=l.pop();return r}function We(){for(var e=this,a=[e];e=e.parent;)a.push(e);return a}function He(){return Array.from(this)}function Ie(){var e=[];return this.eachBefore(function(a){a.children||e.push(a)}),e}function Oe(){var e=this,a=[];return e.each(function(n){n!==e&&a.push({source:n.parent,target:n})}),a}function*Ge(){var e=this,a,n=[e],l,r,o;do for(a=n.reverse(),n=[];e=a.pop();)if(yield e,l=e.children)for(r=0,o=l.length;r=0;--d)r.push(o=h[d]=new U(h[d])),o.parent=l,o.depth=l.depth+1;return n.eachBefore(Ue)}function qe(){return ae(this).eachBefore(je)}function Xe(e){return e.children}function Ye(e){return Array.isArray(e)?e[1]:null}function je(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function Ue(e){var a=0;do e.height=a;while((e=e.parent)&&e.height<++a)}function U(e){this.data=e,this.depth=this.height=0,this.parent=null}U.prototype=ae.prototype={constructor:U,count:_e,each:ke,eachAfter:Ve,eachBefore:ze,find:De,sum:Pe,sort:Be,path:Ee,ancestors:We,descendants:He,leaves:Ie,links:Oe,copy:qe,[Symbol.iterator]:Ge};function Ze(e){if(typeof e!="function")throw new Error;return e}function O(){return 0}function G(e){return function(){return e}}function Je(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function Ke(e,a,n,l,r){for(var o=e.children,h,d=-1,g=o.length,c=e.value&&(l-a)/e.value;++dN&&(N=c),M=u*u*R,$=Math.max(N/M,M/y),$>V){u-=c;break}V=$}h.push(g={value:u,dice:x1?l:1)},n})(et);function nt(){var e=at,a=!1,n=1,l=1,r=[0],o=O,h=O,d=O,g=O,c=O;function p(s){return s.x0=s.y0=0,s.x1=n,s.y1=l,s.eachBefore(b),r=[0],a&&s.eachBefore(Je),s}function b(s){var x=r[s.depth],S=s.x0+x,v=s.y0+x,u=s.x1-x,y=s.y1-x;u{$e(r)&&(n?.textStyles?n.textStyles.push(r):n.textStyles=[r]),n?.styles?n.styles.push(r):n.styles=[r]}),this.classes.set(e,n)}getClasses(){return this.classes}getStylesForClass(e){return this.classes.get(e)?.styles??[]}clear(){Ae(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}};function oe(e){if(!e.length)return[];const a=[],n=[];return e.forEach(l=>{const r={name:l.name,children:l.type==="Leaf"?void 0:[]};for(r.classSelector=l?.classSelector,l?.cssCompiledStyles&&(r.cssCompiledStyles=l.cssCompiledStyles),l.type==="Leaf"&&l.value!==void 0&&(r.value=l.value);n.length>0&&n[n.length-1].level>=l.level;)n.pop();if(n.length===0)a.push(r);else{const o=n[n.length-1].node;o.children?o.children.push(r):o.children=[r]}l.type!=="Leaf"&&n.push({node:r,level:l.level})}),a}w(oe,"buildHierarchy");var lt=w((e,a)=>{me(e,a);const n=[];for(const o of e.TreemapRows??[])o.$type==="ClassDefStatement"&&a.addClass(o.className??"",o.styleText??"");for(const o of e.TreemapRows??[]){const h=o.item;if(!h)continue;const d=o.indent?parseInt(o.indent):0,g=rt(h),c=h.classSelector?a.getStylesForClass(h.classSelector):[],p=c.length>0?c:void 0,b={level:d,name:g,type:h.$type,value:h.value,classSelector:h.classSelector,cssCompiledStyles:p};n.push(b)}const l=oe(n),r=w((o,h)=>{for(const d of o)a.addNode(d,h),d.children&&d.children.length>0&&r(d.children,h+1)},"addNodesRecursively");r(l,0)},"populate"),rt=w(e=>e.name?String(e.name):"","getItemName"),ce={parser:{yy:void 0},parse:w(async e=>{try{const n=await Ne("treemap",e);ee.debug("Treemap AST:",n);const l=ce.parser?.yy;if(!(l instanceof ie))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");lt(n,l)}catch(a){throw ee.error("Error parsing treemap:",a),a}},"parse")},st=10,E=10,q=25,it=w((e,a,n,l)=>{const r=l.db,o=r.getConfig(),h=o.padding??st,d=r.getDiagramTitle(),g=r.getRoot(),{themeVariables:c}=te();if(!g)return;const p=d?30:0,b=ye(a),s=o.nodeWidth?o.nodeWidth*E:960,x=o.nodeHeight?o.nodeHeight*E:500,S=s,v=x+p;b.attr("viewBox",`0 0 ${S} ${v}`),Se(b,v,S,o.useMaxWidth);let u;try{const t=o.valueFormat||",";if(t==="$0,0")u=w(i=>"$"+I(",")(i),"valueFormat");else if(t.startsWith("$")&&t.includes(",")){const i=/\.\d+/.exec(t),f=i?i[0]:"";u=w(C=>"$"+I(","+f)(C),"valueFormat")}else if(t.startsWith("$")){const i=t.substring(1);u=w(f=>"$"+I(i||"")(f),"valueFormat")}else u=I(t)}catch(t){ee.error("Error creating format function:",t),u=I(",")}const y=K().range(["transparent",c.cScale0,c.cScale1,c.cScale2,c.cScale3,c.cScale4,c.cScale5,c.cScale6,c.cScale7,c.cScale8,c.cScale9,c.cScale10,c.cScale11]),N=K().range(["transparent",c.cScalePeer0,c.cScalePeer1,c.cScalePeer2,c.cScalePeer3,c.cScalePeer4,c.cScalePeer5,c.cScalePeer6,c.cScalePeer7,c.cScalePeer8,c.cScalePeer9,c.cScalePeer10,c.cScalePeer11]),$=K().range([c.cScaleLabel0,c.cScaleLabel1,c.cScaleLabel2,c.cScaleLabel3,c.cScaleLabel4,c.cScaleLabel5,c.cScaleLabel6,c.cScaleLabel7,c.cScaleLabel8,c.cScaleLabel9,c.cScaleLabel10,c.cScaleLabel11]);d&&b.append("text").attr("x",S/2).attr("y",p/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(d);const V=b.append("g").attr("transform",`translate(0, ${p})`).attr("class","treemapContainer"),R=ae(g).sum(t=>t.value??0).sort((t,i)=>(i.value??0)-(t.value??0)),ne=nt().size([s,x]).paddingTop(t=>t.children&&t.children.length>0?q+E:0).paddingInner(h).paddingLeft(t=>t.children&&t.children.length>0?E:0).paddingRight(t=>t.children&&t.children.length>0?E:0).paddingBottom(t=>t.children&&t.children.length>0?E:0).round(!0)(R),he=ne.descendants().filter(t=>t.children&&t.children.length>0),W=V.selectAll(".treemapSection").data(he).enter().append("g").attr("class","treemapSection").attr("transform",t=>`translate(${t.x0},${t.y0})`);W.append("rect").attr("width",t=>t.x1-t.x0).attr("height",q).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",t=>t.depth===0?"display: none;":""),W.append("clipPath").attr("id",(t,i)=>`clip-section-${a}-${i}`).append("rect").attr("width",t=>Math.max(0,t.x1-t.x0-12)).attr("height",q),W.append("rect").attr("width",t=>t.x1-t.x0).attr("height",t=>t.y1-t.y0).attr("class",(t,i)=>`treemapSection section${i}`).attr("fill",t=>y(t.data.name)).attr("fill-opacity",.6).attr("stroke",t=>N(t.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",t=>{if(t.depth===0)return"display: none;";const i=B({cssCompiledStyles:t.data.cssCompiledStyles});return i.nodeStyles+";"+i.borderStyles.join(";")}),W.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",q/2).attr("dominant-baseline","middle").text(t=>t.depth===0?"":t.data.name).attr("font-weight","bold").attr("clip-path",(t,i)=>`url(#clip-section-${a}-${i})`).attr("style",t=>{if(t.depth===0)return"display: none;";const i="dominant-baseline: middle; font-size: 12px; fill:"+$(t.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=B({cssCompiledStyles:t.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")}).each(function(t){if(t.depth===0)return;const i=j(this),f=t.data.name;i.text(f);const C=t.x1-t.x0,L=6;let T;o.showValues!==!1&&t.value?T=C-10-30-10-L:T=C-L-6;const m=Math.max(15,T),_=i.node();if(_.getComputedTextLength()>m){let z=f;for(;z.length>0;){if(z=f.substring(0,z.length-1),z.length===0){i.text("..."),_.getComputedTextLength()>m&&i.text("");break}if(i.text(z+"..."),_.getComputedTextLength()<=m)break}}}),o.showValues!==!1&&W.append("text").attr("class","treemapSectionValue").attr("x",t=>t.x1-t.x0-10).attr("y",q/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(t=>t.value?u(t.value):"").attr("font-style","italic").attr("style",t=>{if(t.depth===0)return"display: none;";const i="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+$(t.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=B({cssCompiledStyles:t.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")});const le=ne.leaves(),A=le.length>20,de=A?16:38,X=A?14:28,D=A?4:8,H=A?4:6,Z=A?2:4,re=A?8:10,J=A?1:2,Y=V.selectAll(".treemapLeafGroup").data(le).enter().append("g").attr("class",(t,i)=>`treemapNode treemapLeafGroup leaf${i}${t.data.classSelector?` ${t.data.classSelector}`:""}x`).attr("transform",t=>`translate(${t.x0},${t.y0})`);Y.append("rect").attr("width",t=>t.x1-t.x0).attr("height",t=>t.y1-t.y0).attr("class","treemapLeaf").attr("fill",t=>t.parent?y(t.parent.data.name):y(t.data.name)).attr("style",t=>B({cssCompiledStyles:t.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",t=>t.parent?y(t.parent.data.name):y(t.data.name)).attr("stroke-width",3),Y.append("clipPath").attr("id",(t,i)=>`clip-${a}-${i}`).append("rect").attr("width",t=>Math.max(0,t.x1-t.x0-4)).attr("height",t=>Math.max(0,t.y1-t.y0-4)),Y.append("text").attr("class","treemapLabel").attr("x",t=>(t.x1-t.x0)/2).attr("y",t=>(t.y1-t.y0)/2).attr("style",t=>{const i=`text-anchor: middle; dominant-baseline: middle; font-size: ${de}px;fill:`+$(t.data.name)+";",f=B({cssCompiledStyles:t.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")}).attr("clip-path",(t,i)=>`url(#clip-${a}-${i})`).text(t=>t.data.name).each(function(t){const i=j(this),f=t.x1-t.x0,C=t.y1-t.y0,L=i.node(),T=f-2*Z,P=C-2*Z;if(TT&&m>D;)m--,i.style("font-size",`${m}px`);let F=Math.max(H,Math.min(X,Math.round(m*_))),k=m+J+F;for(;k>P&&m>D&&(m--,F=Math.max(H,Math.min(X,Math.round(m*_))),!(FT||m(i.x1-i.x0)/2).attr("y",function(i){return(i.y1-i.y0)/2}).attr("style",i=>{const f=`text-anchor: middle; dominant-baseline: hanging; font-size: ${X}px;fill:`+$(i.data.name)+";",C=B({cssCompiledStyles:i.data.cssCompiledStyles});return f+C.labelStyles.replace("color:","fill:")}).attr("clip-path",(i,f)=>`url(#clip-${a}-${f})`).text(i=>i.value?u(i.value):"").each(function(i){const f=j(this),C=this.parentNode;if(!C){f.style("display","none");return}const L=j(C).select(".treemapLabel");if(L.empty()||L.style("display")==="none"){f.style("display","none");return}const T=parseFloat(L.style("font-size")),m=Math.max(H,Math.min(X,Math.round(T*.6)));f.style("font-size",`${m}px`);const F=(i.y1-i.y0)/2+T/2+J;f.attr("y",F);const k=i.x1-i.x0,se=i.y1-i.y0-4,fe=k-2*Z;f.node().getComputedTextLength()>fe||F+m>se||m{const a=ge(),n=te(),l=Q(a,n.themeVariables),r=Q(ht,e),o=r.titleColor??l.titleColor,h=r.labelColor??l.textColor,d=r.valueColor??l.textColor;return` +import{p as me}from"./chunk-JWPE2WC7-CI-VQAzP.js";import{_ as w,E as ge,y as te,A as Q,D as ye,e as Se,l as ee,be as B,d as j,b as ve,a as xe,n as be,o as we,g as Ce,s as Te,B as Le,bf as $e,p as Ae}from"./mermaid.core-mH2pk-lc.js";import{s as Fe}from"./chunk-VR4S4FIN-Dwk6LZpd.js";import{p as Ne}from"./cynefin-VYW2F7L2-BD8Xugtm.js";import{b as I}from"./defaultLocale-DX6XiGOO.js";import{o as K}from"./ordinal-Cboi1Yqb.js";import"./index-BIElaaEN.js";import"./_commonjsHelpers-CqkleIqs.js";import"./init-Gi6I4Gst.js";function Me(e){var a=0,n=e.children,l=n&&n.length;if(!l)a=1;else for(;--l>=0;)a+=n[l].value;e.value=a}function _e(){return this.eachAfter(Me)}function ke(e,a){let n=-1;for(const l of this)e.call(a,l,++n,this);return this}function ze(e,a){for(var n=this,l=[n],r,o,h=-1;n=l.pop();)if(e.call(a,n,++h,this),r=n.children)for(o=r.length-1;o>=0;--o)l.push(r[o]);return this}function Ve(e,a){for(var n=this,l=[n],r=[],o,h,d,g=-1;n=l.pop();)if(r.push(n),o=n.children)for(h=0,d=o.length;h=0;)n+=l[r].value;a.value=n})}function Be(e){return this.eachBefore(function(a){a.children&&a.children.sort(e)})}function Ee(e){for(var a=this,n=Re(a,e),l=[a];a!==n;)a=a.parent,l.push(a);for(var r=l.length;e!==n;)l.splice(r,0,e),e=e.parent;return l}function Re(e,a){if(e===a)return e;var n=e.ancestors(),l=a.ancestors(),r=null;for(e=n.pop(),a=l.pop();e===a;)r=e,e=n.pop(),a=l.pop();return r}function We(){for(var e=this,a=[e];e=e.parent;)a.push(e);return a}function He(){return Array.from(this)}function Ie(){var e=[];return this.eachBefore(function(a){a.children||e.push(a)}),e}function Oe(){var e=this,a=[];return e.each(function(n){n!==e&&a.push({source:n.parent,target:n})}),a}function*Ge(){var e=this,a,n=[e],l,r,o;do for(a=n.reverse(),n=[];e=a.pop();)if(yield e,l=e.children)for(r=0,o=l.length;r=0;--d)r.push(o=h[d]=new U(h[d])),o.parent=l,o.depth=l.depth+1;return n.eachBefore(Ue)}function qe(){return ae(this).eachBefore(je)}function Xe(e){return e.children}function Ye(e){return Array.isArray(e)?e[1]:null}function je(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function Ue(e){var a=0;do e.height=a;while((e=e.parent)&&e.height<++a)}function U(e){this.data=e,this.depth=this.height=0,this.parent=null}U.prototype=ae.prototype={constructor:U,count:_e,each:ke,eachAfter:Ve,eachBefore:ze,find:De,sum:Pe,sort:Be,path:Ee,ancestors:We,descendants:He,leaves:Ie,links:Oe,copy:qe,[Symbol.iterator]:Ge};function Ze(e){if(typeof e!="function")throw new Error;return e}function O(){return 0}function G(e){return function(){return e}}function Je(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function Ke(e,a,n,l,r){for(var o=e.children,h,d=-1,g=o.length,c=e.value&&(l-a)/e.value;++dN&&(N=c),M=u*u*R,$=Math.max(N/M,M/y),$>V){u-=c;break}V=$}h.push(g={value:u,dice:x1?l:1)},n})(et);function nt(){var e=at,a=!1,n=1,l=1,r=[0],o=O,h=O,d=O,g=O,c=O;function p(s){return s.x0=s.y0=0,s.x1=n,s.y1=l,s.eachBefore(b),r=[0],a&&s.eachBefore(Je),s}function b(s){var x=r[s.depth],S=s.x0+x,v=s.y0+x,u=s.x1-x,y=s.y1-x;u{$e(r)&&(n?.textStyles?n.textStyles.push(r):n.textStyles=[r]),n?.styles?n.styles.push(r):n.styles=[r]}),this.classes.set(e,n)}getClasses(){return this.classes}getStylesForClass(e){return this.classes.get(e)?.styles??[]}clear(){Ae(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}};function oe(e){if(!e.length)return[];const a=[],n=[];return e.forEach(l=>{const r={name:l.name,children:l.type==="Leaf"?void 0:[]};for(r.classSelector=l?.classSelector,l?.cssCompiledStyles&&(r.cssCompiledStyles=l.cssCompiledStyles),l.type==="Leaf"&&l.value!==void 0&&(r.value=l.value);n.length>0&&n[n.length-1].level>=l.level;)n.pop();if(n.length===0)a.push(r);else{const o=n[n.length-1].node;o.children?o.children.push(r):o.children=[r]}l.type!=="Leaf"&&n.push({node:r,level:l.level})}),a}w(oe,"buildHierarchy");var lt=w((e,a)=>{me(e,a);const n=[];for(const o of e.TreemapRows??[])o.$type==="ClassDefStatement"&&a.addClass(o.className??"",o.styleText??"");for(const o of e.TreemapRows??[]){const h=o.item;if(!h)continue;const d=o.indent?parseInt(o.indent):0,g=rt(h),c=h.classSelector?a.getStylesForClass(h.classSelector):[],p=c.length>0?c:void 0,b={level:d,name:g,type:h.$type,value:h.value,classSelector:h.classSelector,cssCompiledStyles:p};n.push(b)}const l=oe(n),r=w((o,h)=>{for(const d of o)a.addNode(d,h),d.children&&d.children.length>0&&r(d.children,h+1)},"addNodesRecursively");r(l,0)},"populate"),rt=w(e=>e.name?String(e.name):"","getItemName"),ce={parser:{yy:void 0},parse:w(async e=>{try{const n=await Ne("treemap",e);ee.debug("Treemap AST:",n);const l=ce.parser?.yy;if(!(l instanceof ie))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");lt(n,l)}catch(a){throw ee.error("Error parsing treemap:",a),a}},"parse")},st=10,E=10,q=25,it=w((e,a,n,l)=>{const r=l.db,o=r.getConfig(),h=o.padding??st,d=r.getDiagramTitle(),g=r.getRoot(),{themeVariables:c}=te();if(!g)return;const p=d?30:0,b=ye(a),s=o.nodeWidth?o.nodeWidth*E:960,x=o.nodeHeight?o.nodeHeight*E:500,S=s,v=x+p;b.attr("viewBox",`0 0 ${S} ${v}`),Se(b,v,S,o.useMaxWidth);let u;try{const t=o.valueFormat||",";if(t==="$0,0")u=w(i=>"$"+I(",")(i),"valueFormat");else if(t.startsWith("$")&&t.includes(",")){const i=/\.\d+/.exec(t),f=i?i[0]:"";u=w(C=>"$"+I(","+f)(C),"valueFormat")}else if(t.startsWith("$")){const i=t.substring(1);u=w(f=>"$"+I(i||"")(f),"valueFormat")}else u=I(t)}catch(t){ee.error("Error creating format function:",t),u=I(",")}const y=K().range(["transparent",c.cScale0,c.cScale1,c.cScale2,c.cScale3,c.cScale4,c.cScale5,c.cScale6,c.cScale7,c.cScale8,c.cScale9,c.cScale10,c.cScale11]),N=K().range(["transparent",c.cScalePeer0,c.cScalePeer1,c.cScalePeer2,c.cScalePeer3,c.cScalePeer4,c.cScalePeer5,c.cScalePeer6,c.cScalePeer7,c.cScalePeer8,c.cScalePeer9,c.cScalePeer10,c.cScalePeer11]),$=K().range([c.cScaleLabel0,c.cScaleLabel1,c.cScaleLabel2,c.cScaleLabel3,c.cScaleLabel4,c.cScaleLabel5,c.cScaleLabel6,c.cScaleLabel7,c.cScaleLabel8,c.cScaleLabel9,c.cScaleLabel10,c.cScaleLabel11]);d&&b.append("text").attr("x",S/2).attr("y",p/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(d);const V=b.append("g").attr("transform",`translate(0, ${p})`).attr("class","treemapContainer"),R=ae(g).sum(t=>t.value??0).sort((t,i)=>(i.value??0)-(t.value??0)),ne=nt().size([s,x]).paddingTop(t=>t.children&&t.children.length>0?q+E:0).paddingInner(h).paddingLeft(t=>t.children&&t.children.length>0?E:0).paddingRight(t=>t.children&&t.children.length>0?E:0).paddingBottom(t=>t.children&&t.children.length>0?E:0).round(!0)(R),he=ne.descendants().filter(t=>t.children&&t.children.length>0),W=V.selectAll(".treemapSection").data(he).enter().append("g").attr("class","treemapSection").attr("transform",t=>`translate(${t.x0},${t.y0})`);W.append("rect").attr("width",t=>t.x1-t.x0).attr("height",q).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",t=>t.depth===0?"display: none;":""),W.append("clipPath").attr("id",(t,i)=>`clip-section-${a}-${i}`).append("rect").attr("width",t=>Math.max(0,t.x1-t.x0-12)).attr("height",q),W.append("rect").attr("width",t=>t.x1-t.x0).attr("height",t=>t.y1-t.y0).attr("class",(t,i)=>`treemapSection section${i}`).attr("fill",t=>y(t.data.name)).attr("fill-opacity",.6).attr("stroke",t=>N(t.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",t=>{if(t.depth===0)return"display: none;";const i=B({cssCompiledStyles:t.data.cssCompiledStyles});return i.nodeStyles+";"+i.borderStyles.join(";")}),W.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",q/2).attr("dominant-baseline","middle").text(t=>t.depth===0?"":t.data.name).attr("font-weight","bold").attr("clip-path",(t,i)=>`url(#clip-section-${a}-${i})`).attr("style",t=>{if(t.depth===0)return"display: none;";const i="dominant-baseline: middle; font-size: 12px; fill:"+$(t.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=B({cssCompiledStyles:t.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")}).each(function(t){if(t.depth===0)return;const i=j(this),f=t.data.name;i.text(f);const C=t.x1-t.x0,L=6;let T;o.showValues!==!1&&t.value?T=C-10-30-10-L:T=C-L-6;const m=Math.max(15,T),_=i.node();if(_.getComputedTextLength()>m){let z=f;for(;z.length>0;){if(z=f.substring(0,z.length-1),z.length===0){i.text("..."),_.getComputedTextLength()>m&&i.text("");break}if(i.text(z+"..."),_.getComputedTextLength()<=m)break}}}),o.showValues!==!1&&W.append("text").attr("class","treemapSectionValue").attr("x",t=>t.x1-t.x0-10).attr("y",q/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(t=>t.value?u(t.value):"").attr("font-style","italic").attr("style",t=>{if(t.depth===0)return"display: none;";const i="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+$(t.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=B({cssCompiledStyles:t.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")});const le=ne.leaves(),A=le.length>20,de=A?16:38,X=A?14:28,D=A?4:8,H=A?4:6,Z=A?2:4,re=A?8:10,J=A?1:2,Y=V.selectAll(".treemapLeafGroup").data(le).enter().append("g").attr("class",(t,i)=>`treemapNode treemapLeafGroup leaf${i}${t.data.classSelector?` ${t.data.classSelector}`:""}x`).attr("transform",t=>`translate(${t.x0},${t.y0})`);Y.append("rect").attr("width",t=>t.x1-t.x0).attr("height",t=>t.y1-t.y0).attr("class","treemapLeaf").attr("fill",t=>t.parent?y(t.parent.data.name):y(t.data.name)).attr("style",t=>B({cssCompiledStyles:t.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",t=>t.parent?y(t.parent.data.name):y(t.data.name)).attr("stroke-width",3),Y.append("clipPath").attr("id",(t,i)=>`clip-${a}-${i}`).append("rect").attr("width",t=>Math.max(0,t.x1-t.x0-4)).attr("height",t=>Math.max(0,t.y1-t.y0-4)),Y.append("text").attr("class","treemapLabel").attr("x",t=>(t.x1-t.x0)/2).attr("y",t=>(t.y1-t.y0)/2).attr("style",t=>{const i=`text-anchor: middle; dominant-baseline: middle; font-size: ${de}px;fill:`+$(t.data.name)+";",f=B({cssCompiledStyles:t.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")}).attr("clip-path",(t,i)=>`url(#clip-${a}-${i})`).text(t=>t.data.name).each(function(t){const i=j(this),f=t.x1-t.x0,C=t.y1-t.y0,L=i.node(),T=f-2*Z,P=C-2*Z;if(TT&&m>D;)m--,i.style("font-size",`${m}px`);let F=Math.max(H,Math.min(X,Math.round(m*_))),k=m+J+F;for(;k>P&&m>D&&(m--,F=Math.max(H,Math.min(X,Math.round(m*_))),!(FT||m(i.x1-i.x0)/2).attr("y",function(i){return(i.y1-i.y0)/2}).attr("style",i=>{const f=`text-anchor: middle; dominant-baseline: hanging; font-size: ${X}px;fill:`+$(i.data.name)+";",C=B({cssCompiledStyles:i.data.cssCompiledStyles});return f+C.labelStyles.replace("color:","fill:")}).attr("clip-path",(i,f)=>`url(#clip-${a}-${f})`).text(i=>i.value?u(i.value):"").each(function(i){const f=j(this),C=this.parentNode;if(!C){f.style("display","none");return}const L=j(C).select(".treemapLabel");if(L.empty()||L.style("display")==="none"){f.style("display","none");return}const T=parseFloat(L.style("font-size")),m=Math.max(H,Math.min(X,Math.round(T*.6)));f.style("font-size",`${m}px`);const F=(i.y1-i.y0)/2+T/2+J;f.attr("y",F);const k=i.x1-i.x0,se=i.y1-i.y0-4,fe=k-2*Z;f.node().getComputedTextLength()>fe||F+m>se||m{const a=ge(),n=te(),l=Q(a,n.themeVariables),r=Q(ht,e),o=r.titleColor??l.titleColor,h=r.labelColor??l.textColor,d=r.valueColor??l.textColor;return` .treemapNode.section { stroke: ${r.sectionStrokeColor}; stroke-width: ${r.sectionStrokeWidth}; diff --git a/apps/kimi-code/dist-web/assets/diagram-NH7WQ7WH-D0p601mB.js b/apps/kimi-code/dist-web/assets/diagram-NH7WQ7WH-Hd5_7fL-.js similarity index 93% rename from apps/kimi-code/dist-web/assets/diagram-NH7WQ7WH-D0p601mB.js rename to apps/kimi-code/dist-web/assets/diagram-NH7WQ7WH-Hd5_7fL-.js index 76b28fd0a61..1d5959aa080 100644 --- a/apps/kimi-code/dist-web/assets/diagram-NH7WQ7WH-D0p601mB.js +++ b/apps/kimi-code/dist-web/assets/diagram-NH7WQ7WH-Hd5_7fL-.js @@ -1,4 +1,4 @@ -import{p as B}from"./chunk-JWPE2WC7-BJMJfnyy.js";import{_ as b,A as u,D as $,e as C,l as m,b as S,a as D,n as T,o as P,g as z,s as A,y as E,B as F,p as W}from"./mermaid.core-WW7RuneT.js";import{p as _}from"./cynefin-VYW2F7L2-DI-9Z5R0.js";import"./index-CiHMlsuo.js";import"./_commonjsHelpers-CqkleIqs.js";var N=F.packet,w=class{constructor(){this.packet=[],this.setAccTitle=S,this.getAccTitle=D,this.setDiagramTitle=T,this.getDiagramTitle=P,this.getAccDescription=z,this.setAccDescription=A}static{b(this,"PacketDB")}getConfig(){const t=u({...N,...E().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(t){t.length>0&&this.packet.push(t)}clear(){W(),this.packet=[]}},L=1e4,M=b((t,e)=>{B(t,e);let r=-1,o=[],n=1;const{bitsPerRow:l}=e.getConfig();for(let{start:a,end:i,bits:d,label:c}of t.blocks){if(a!==void 0&&i!==void 0&&i{if(t.start===void 0)throw new Error("start should have been set during first phase");if(t.end===void 0)throw new Error("end should have been set during first phase");if(t.start>t.end)throw new Error(`Block start ${t.start} is greater than block end ${t.end}.`);if(t.end+1<=e*r)return[t,void 0];const o=e*r-1,n=e*r;return[{start:t.start,end:o,label:t.label,bits:o-t.start},{start:n,end:t.end,label:t.label,bits:t.end-n}]},"getNextFittingBlock"),v={parser:{yy:void 0},parse:b(async t=>{const e=await _("packet",t),r=v.parser?.yy;if(!(r instanceof w))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");m.debug(e),M(e,r)},"parse")},I=b((t,e,r,o)=>{const n=o.db,l=n.getConfig(),{rowHeight:a,paddingY:i,bitWidth:d,bitsPerRow:c}=l,p=n.getPacket(),s=n.getDiagramTitle(),h=a+i,g=h*(p.length+1)-(s?0:a),k=d*c+2,f=$(e);f.attr("viewBox",`0 0 ${k} ${g}`),C(f,g,k,l.useMaxWidth);for(const[x,y]of p.entries())O(f,y,x,l);f.append("text").text(s).attr("x",k/2).attr("y",g-h/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),O=b((t,e,r,{rowHeight:o,paddingX:n,paddingY:l,bitWidth:a,bitsPerRow:i,showBits:d})=>{const c=t.append("g"),p=r*(o+l)+l;for(const s of e){const h=s.start%i*a+1,g=(s.end-s.start+1)*a-n;if(c.append("rect").attr("x",h).attr("y",p).attr("width",g).attr("height",o).attr("class","packetBlock"),c.append("text").attr("x",h+g/2).attr("y",p+o/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(s.label),!d)continue;const k=s.end===s.start,f=p-2;c.append("text").attr("x",h+(k?g/2:0)).attr("y",f).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",k?"middle":"start").text(s.start),k||c.append("text").attr("x",h+g).attr("y",f).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(s.end)}},"drawWord"),j={draw:I},G={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},H=b(({packet:t}={})=>{const e=u(G,t);return` +import{p as B}from"./chunk-JWPE2WC7-CI-VQAzP.js";import{_ as b,A as u,D as $,e as C,l as m,b as S,a as D,n as T,o as P,g as z,s as A,y as E,B as F,p as W}from"./mermaid.core-mH2pk-lc.js";import{p as _}from"./cynefin-VYW2F7L2-BD8Xugtm.js";import"./index-BIElaaEN.js";import"./_commonjsHelpers-CqkleIqs.js";var N=F.packet,w=class{constructor(){this.packet=[],this.setAccTitle=S,this.getAccTitle=D,this.setDiagramTitle=T,this.getDiagramTitle=P,this.getAccDescription=z,this.setAccDescription=A}static{b(this,"PacketDB")}getConfig(){const t=u({...N,...E().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(t){t.length>0&&this.packet.push(t)}clear(){W(),this.packet=[]}},L=1e4,M=b((t,e)=>{B(t,e);let r=-1,o=[],n=1;const{bitsPerRow:l}=e.getConfig();for(let{start:a,end:i,bits:d,label:c}of t.blocks){if(a!==void 0&&i!==void 0&&i{if(t.start===void 0)throw new Error("start should have been set during first phase");if(t.end===void 0)throw new Error("end should have been set during first phase");if(t.start>t.end)throw new Error(`Block start ${t.start} is greater than block end ${t.end}.`);if(t.end+1<=e*r)return[t,void 0];const o=e*r-1,n=e*r;return[{start:t.start,end:o,label:t.label,bits:o-t.start},{start:n,end:t.end,label:t.label,bits:t.end-n}]},"getNextFittingBlock"),v={parser:{yy:void 0},parse:b(async t=>{const e=await _("packet",t),r=v.parser?.yy;if(!(r instanceof w))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");m.debug(e),M(e,r)},"parse")},I=b((t,e,r,o)=>{const n=o.db,l=n.getConfig(),{rowHeight:a,paddingY:i,bitWidth:d,bitsPerRow:c}=l,p=n.getPacket(),s=n.getDiagramTitle(),h=a+i,g=h*(p.length+1)-(s?0:a),k=d*c+2,f=$(e);f.attr("viewBox",`0 0 ${k} ${g}`),C(f,g,k,l.useMaxWidth);for(const[x,y]of p.entries())O(f,y,x,l);f.append("text").text(s).attr("x",k/2).attr("y",g-h/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),O=b((t,e,r,{rowHeight:o,paddingX:n,paddingY:l,bitWidth:a,bitsPerRow:i,showBits:d})=>{const c=t.append("g"),p=r*(o+l)+l;for(const s of e){const h=s.start%i*a+1,g=(s.end-s.start+1)*a-n;if(c.append("rect").attr("x",h).attr("y",p).attr("width",g).attr("height",o).attr("class","packetBlock"),c.append("text").attr("x",h+g/2).attr("y",p+o/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(s.label),!d)continue;const k=s.end===s.start,f=p-2;c.append("text").attr("x",h+(k?g/2:0)).attr("y",f).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",k?"middle":"start").text(s.start),k||c.append("text").attr("x",h+g).attr("y",f).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(s.end)}},"drawWord"),j={draw:I},G={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},H=b(({packet:t}={})=>{const e=u(G,t);return` .packetByte { font-size: ${e.byteFontSize}; } diff --git a/apps/kimi-code/dist-web/assets/diagram-OA4YK3LP-BLpvk7p_.js b/apps/kimi-code/dist-web/assets/diagram-OA4YK3LP-CH2NIou2.js similarity index 96% rename from apps/kimi-code/dist-web/assets/diagram-OA4YK3LP-BLpvk7p_.js rename to apps/kimi-code/dist-web/assets/diagram-OA4YK3LP-CH2NIou2.js index e390e481578..a8d5bf6f01c 100644 --- a/apps/kimi-code/dist-web/assets/diagram-OA4YK3LP-BLpvk7p_.js +++ b/apps/kimi-code/dist-web/assets/diagram-OA4YK3LP-CH2NIou2.js @@ -1,4 +1,4 @@ -import{I as X}from"./chunk-2Q5K7J3B-NzojNxDT.js";import{p as O}from"./chunk-JWPE2WC7-BJMJfnyy.js";import{n as G,b as Y,s as P,o as j,g as F,a as Z,_ as f,A,l as D,D as q,e as U,y as N,p as J,i as K,ai as Q,B as ee,aj as te}from"./mermaid.core-WW7RuneT.js";import{p as ne}from"./cynefin-VYW2F7L2-DI-9Z5R0.js";import"./index-CiHMlsuo.js";import"./_commonjsHelpers-CqkleIqs.js";var E=/[─━│┃└┗├┣]/,S=/[└┗├┣]/,re=/[─━]/,V=/^[\s│┃]+$/,$=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,k=/^\s*%%/,ie=" ";function L(n){return n.some(e=>E.test(e))}f(L,"isBoxDrawingFormat");function _(n){for(const e of n){const t=S.exec(e);if(t?.index&&t.index>0)return t.index}return 4}f(_,"inferSegmentWidth");function M(n,e){return n.replace(/\bline\s+(\d+)\b/gi,(t,r)=>{const i=parseInt(r,10),a=e.get(i);return a?`line ${a}`:t})}f(M,"remapErrorLines");function R(n){const e=n.split(` +import{I as X}from"./chunk-2Q5K7J3B-Ba9Nj6dt.js";import{p as O}from"./chunk-JWPE2WC7-CI-VQAzP.js";import{n as G,b as Y,s as P,o as j,g as F,a as Z,_ as f,A,l as D,D as q,e as U,y as N,p as J,i as K,ai as Q,B as ee,aj as te}from"./mermaid.core-mH2pk-lc.js";import{p as ne}from"./cynefin-VYW2F7L2-BD8Xugtm.js";import"./index-BIElaaEN.js";import"./_commonjsHelpers-CqkleIqs.js";var E=/[─━│┃└┗├┣]/,S=/[└┗├┣]/,re=/[─━]/,V=/^[\s│┃]+$/,$=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,k=/^\s*%%/,ie=" ";function L(n){return n.some(e=>E.test(e))}f(L,"isBoxDrawingFormat");function _(n){for(const e of n){const t=S.exec(e);if(t?.index&&t.index>0)return t.index}return 4}f(_,"inferSegmentWidth");function M(n,e){return n.replace(/\bline\s+(\d+)\b/gi,(t,r)=>{const i=parseInt(r,10),a=e.get(i);return a?`line ${a}`:t})}f(M,"remapErrorLines");function R(n){const e=n.split(` `),t=new Map;let r=-1;for(const[s,o]of e.entries())if(o.trim()==="treeView-beta"){r=s;break}if(r===-1)return{text:n,lineMap:t};const i=[];for(let s=r+1;s({cnt:1,stack:[{id:0,level:-1,name:"/",nodeType:"directory",children:[]}]})),oe=f(()=>{x.reset(),J()},"clear"),se=f(()=>x.records.stack[0],"getRoot"),ae=f(()=>x.records.cnt,"getCount"),ce=ee.treeView,le=f(()=>A(ce,N().treeView),"getConfig"),de=f((n,e,t,r,i,a)=>{for(;n<=x.records.stack[x.records.stack.length-1].level;)x.records.stack.pop();const c={id:x.records.cnt++,level:n,name:e,nodeType:t,icon:i,cssClass:r,description:a,children:[]};x.records.stack[x.records.stack.length-1].children.push(c),x.records.stack.push(c)},"addNode"),he={clear:oe,addNode:de,getRoot:se,getCount:ae,getConfig:le,getAccTitle:Z,getAccDescription:F,getDiagramTitle:j,setAccDescription:P,setAccTitle:Y,setDiagramTitle:G},I=he,pe=f(n=>{O(n,I);for(const e of n.nodes){const t=typeof e.indent=="number"?e.indent:0;let r=e.name;const i=r.endsWith("/");i&&(r=r.slice(0,-1));const a=i?"directory":"file",c=e.classAnnotation||void 0,l=e.iconAnnotation,s=l!==void 0?l||"none":void 0,o=e.descAnnotation||void 0,h=o?K(o,N()):void 0;I.addNode(t,r,a,c,s,h)}},"populate"),fe={parse:f(async n=>{const{text:e,lineMap:t}=R(n);try{const r=await ne("treeView",e);D.debug(r),pe(r)}catch(r){throw t.size>0&&r instanceof Error&&(r.message=M(r.message,t)),r}},"parse")},b={prefix:"mermaid-treeview",height:24,width:24,icons:{folder:{body:''},file:{body:''}}};function H(n,e){const t=e?.filenameIcons?.[n];if(t)return t;const r=n.lastIndexOf(".");if(r>0){const i=n.substring(r).toLowerCase(),a=e?.extensionIcons;return a?.[i]??a?.[i.slice(1)]}}f(H,"detectIcon");function C(n,e){return n.includes(":")?n:n in b.icons||!e?`${b.prefix}:${n}`:`${e}:${n}`}f(C,"qualifyIcon");function B(n,e){if(n.icon!=="none"){if(n.icon)return C(n.icon,e.defaultIconPack);if(e.showIcons){if(n.nodeType==="file"){const t=H(n.name,e);if(t==="none")return;if(t)return C(t,e.defaultIconPack)}return`${b.prefix}:${n.nodeType==="directory"?"folder":"file"}`}}}f(B,"getNodeIcon");te([{name:b.prefix,icons:b}]);var y=14,ge=4,ue=16,z=f((n,e)=>`tv-icon-${n}-${e.replace(/[^\w-]/g,"-")}`,"iconSymbolId"),we=f(async(n,e,t,r)=>{const i=new Set,a=f(s=>{const o=B(s,t);o&&i.add(o),s.children.forEach(a)},"collect");if(a(e),i.size===0)return;const c=await Promise.all([...i].map(async s=>({icon:s,svg:await Q(s,{height:y,width:y})}))),l=n.append("defs");for(const{icon:s,svg:o}of c)l.append("g").attr("id",z(r,s)).html(o)},"injectIconDefs"),me=f((n,e,t,r,i,a)=>{const c=r.append("g");let l="treeView-node-label";t.nodeType==="directory"&&(l+=" treeView-node-dir"),t.cssClass&&(l+=` ${t.cssClass}`);const s=y+ge,o=B(t,i),h=o!==void 0;o&&c.append("use").attr("xlink:href",`#${z(a,o)}`).attr("x",n+i.paddingX).attr("y",e+i.paddingY).attr("class","treeView-node-icon");const p=c.append("text").text(t.name).attr("dominant-baseline","middle").attr("class",l),{height:d,width:w}=p.node().getBBox(),g=d+i.paddingY*2,m=n+i.paddingX+(h?s:0);p.attr("x",m),p.attr("y",e+g/2);const u=m+w,v=w+i.paddingX*2+(h?s:0);return t.BBox={x:n,y:e,width:v,height:g},t.cssClass?.split(/\s+/).includes("highlight")&&c.insert("rect",":first-child").attr("x",n).attr("y",e+1).attr("width",0).attr("height",g-2).attr("rx",3).attr("class","treeView-highlight-bg"),{node:t,nodeGroup:c,labelRightEdge:u,centerY:e+g/2}},"positionLabel"),T=f((n,e,t,r,i,a)=>n.append("line").attr("x1",e).attr("y1",t).attr("x2",r).attr("y2",i).attr("stroke-width",a).attr("class","treeView-node-line"),"positionLine"),xe=f((n,e,t,r)=>{let i=0,a=0;const c=[],l=f((h,p,d,w)=>{const g=w*(d.rowIndent+d.paddingX),m=me(g,i,p,h,d,r);c.push(m);const{height:u,width:v}=p.BBox;T(h,g-d.rowIndent,i+u/2,g,i+u/2,d.lineThickness),a=Math.max(a,g+v),i+=u},"drawNode"),s=f((h,p=0)=>{l(n,h,t,p),h.children.forEach(m=>{s(m,p+1)});const{x:d,y:w,height:g}=h.BBox;if(h.children.length){const{y:m,height:u}=h.children[h.children.length-1].BBox;T(n,d+t.paddingX,w+g,d+t.paddingX,m+u/2+t.lineThickness/2,t.lineThickness)}},"processNode");s(e);const o=c.filter(h=>h.node.description);if(o.length>0){const p=Math.max(...c.map(d=>d.labelRightEdge))+ue;for(const d of o){const g=d.nodeGroup.append("text").text(d.node.description).attr("dominant-baseline","middle").attr("class","treeView-node-description").attr("x",p).attr("y",d.centerY).node().getBBox();a=Math.max(a,p+g.width+t.paddingX)}}for(const h of c)if(h.node.cssClass?.split(/\s+/).includes("highlight")){const p=h.nodeGroup.select(".treeView-highlight-bg");if(!p.empty()){const d=a-h.node.BBox.x+8;p.attr("width",d),a=Math.max(a,h.node.BBox.x+d+2)}}return{totalHeight:i,totalWidth:a}},"drawTree"),ve=f(async(n,e,t,r)=>{D.debug(`Rendering treeView diagram `+n);const i=r.db,a=i.getRoot(),c=i.getConfig(),l=q(e);await we(l,a,c,e);const s=l.append("g");s.attr("class","tree-view");const{totalHeight:o,totalWidth:h}=xe(s,a,c,e);l.attr("viewBox",`-${c.lineThickness/2} 0 ${h} ${o}`),U(l,o,h,c.useMaxWidth)},"draw"),be={draw:ve},Ie=be,Ce={labelFontSize:"16px",labelColor:"black",lineColor:"black",iconColor:"#546e7a",descriptionColor:"#6a9955",highlightBg:"rgba(255, 193, 7, 0.15)",highlightStroke:"#ffc107"},ye=f(({treeView:n})=>{const{labelFontSize:e,labelColor:t,lineColor:r,iconColor:i,descriptionColor:a,highlightBg:c,highlightStroke:l}=A(Ce,n);return` diff --git a/apps/kimi-code/dist-web/assets/diagram-WEI45ONY-DKRP3hVn.js b/apps/kimi-code/dist-web/assets/diagram-WEI45ONY-C8rhXrKH.js similarity index 95% rename from apps/kimi-code/dist-web/assets/diagram-WEI45ONY-DKRP3hVn.js rename to apps/kimi-code/dist-web/assets/diagram-WEI45ONY-C8rhXrKH.js index 38d04dbe8e2..b1e715ba3ae 100644 --- a/apps/kimi-code/dist-web/assets/diagram-WEI45ONY-DKRP3hVn.js +++ b/apps/kimi-code/dist-web/assets/diagram-WEI45ONY-C8rhXrKH.js @@ -1,4 +1,4 @@ -import{p as k}from"./chunk-JWPE2WC7-BJMJfnyy.js";import{s as R,g as E,o as I,n as _,a as D,b as F,_ as c,D as P,p as z,A as y,y as C,B as G,l as B,E as W,e as V}from"./mermaid.core-WW7RuneT.js";import{p as H}from"./cynefin-VYW2F7L2-DI-9Z5R0.js";import"./index-CiHMlsuo.js";import"./_commonjsHelpers-CqkleIqs.js";var m={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},w={axes:[],curves:[],options:m},x=structuredClone(w),j=G.radar,N=c(()=>y({...j,...C().radar}),"getConfig"),b=c(()=>x.axes,"getAxes"),U=c(()=>x.curves,"getCurves"),X=c(()=>x.options,"getOptions"),Y=c(a=>{x.axes=a.map(t=>({name:t.name,label:t.label??t.name}))},"setAxes"),Z=c(a=>{x.curves=a.map(t=>({name:t.name,label:t.label??t.name,entries:q(t.entries)}))},"setCurves"),q=c(a=>{if(a[0].axis==null)return a.map(e=>e.value);const t=b();if(t.length===0)throw new Error("Axes must be populated before curves for reference entries");return t.map(e=>{const r=a.find(s=>s.axis?.$refText===e.name);if(r===void 0)throw new Error("Missing entry for axis "+e.label);return r.value})},"computeCurveEntries"),J=c(a=>{const t=a.reduce((e,r)=>(e[r.name]=r,e),{});x.options={showLegend:t.showLegend?.value??m.showLegend,ticks:t.ticks?.value??m.ticks,max:t.max?.value??m.max,min:t.min?.value??m.min,graticule:t.graticule?.value??m.graticule}},"setOptions"),K=c(()=>{z(),x=structuredClone(w)},"clear"),$={getAxes:b,getCurves:U,getOptions:X,setAxes:Y,setCurves:Z,setOptions:J,getConfig:N,clear:K,setAccTitle:F,getAccTitle:D,setDiagramTitle:_,getDiagramTitle:I,getAccDescription:E,setAccDescription:R},Q=c(a=>{k(a,$);const{axes:t,curves:e,options:r}=a;$.setAxes(t),$.setCurves(e),$.setOptions(r)},"populate"),tt={parse:c(async a=>{const t=await H("radar",a);B.debug(t),Q(t)},"parse")},et=c((a,t,e,r)=>{const s=r.db,i=s.getAxes(),l=s.getCurves(),n=s.getOptions(),o=s.getConfig(),d=s.getDiagramTitle(),p=P(t),u=at(p,o),g=n.max??Math.max(...l.map(f=>Math.max(...f.entries))),h=n.min,v=Math.min(o.width,o.height)/2;rt(u,i,v,n.ticks,n.graticule),st(u,i,v,o),A(u,i,l,h,g,n.graticule,o),T(u,l,n.showLegend,o),u.append("text").attr("class","radarTitle").text(d).attr("x",0).attr("y",-o.height/2-o.marginTop)},"draw"),at=c((a,t)=>{const e=t.width+t.marginLeft+t.marginRight,r=t.height+t.marginTop+t.marginBottom,s={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return V(a,r,e,t.useMaxWidth??!0),a.attr("viewBox",`0 0 ${e} ${r}`).attr("overflow","visible"),a.append("g").attr("transform",`translate(${s.x}, ${s.y})`)},"drawFrame"),rt=c((a,t,e,r,s)=>{if(s==="circle")for(let i=0;i{const u=2*p*Math.PI/i-Math.PI/2,g=n*Math.cos(u),h=n*Math.sin(u);return`${g},${h}`}).join(" ");a.append("polygon").attr("points",o).attr("class","radarGraticule")}}},"drawGraticule"),st=c((a,t,e,r)=>{const s=t.length;for(let i=0;i.01?"start":o<-.01?"end":"middle",u=d>.01?"hanging":d<-.01?"auto":"central",g=4;a.append("text").text(l).attr("x",e*r.axisLabelFactor*o+g*o).attr("y",e*r.axisLabelFactor*d+g*d).attr("text-anchor",p).attr("dominant-baseline",u).attr("class","radarAxisLabel")}},"drawAxes");function A(a,t,e,r,s,i,l){const n=t.length,o=Math.min(l.width,l.height)/2;e.forEach((d,p)=>{if(d.entries.length!==n)return;const u=d.entries.map((g,h)=>{const v=2*Math.PI*h/n-Math.PI/2,f=M(g,r,s,o),S=f*Math.cos(v),O=f*Math.sin(v);return{x:S,y:O}});i==="circle"?a.append("path").attr("d",L(u,l.curveTension)).attr("class",`radarCurve-${p}`):i==="polygon"&&a.append("polygon").attr("points",u.map(g=>`${g.x},${g.y}`).join(" ")).attr("class",`radarCurve-${p}`)})}c(A,"drawCurves");function M(a,t,e,r){const s=Math.min(Math.max(a,t),e);return r*(s-t)/(e-t)}c(M,"relativeRadius");function L(a,t){const e=a.length;let r=`M${a[0].x},${a[0].y}`;for(let s=0;s{const d=a.append("g").attr("transform",`translate(${s}, ${i+o*l})`);d.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${o}`),d.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(n.label)})}c(T,"drawLegend");var nt={draw:et},ot=c((a,t)=>{let e="";for(let r=0;ry({...j,...C().radar}),"getConfig"),b=c(()=>x.axes,"getAxes"),U=c(()=>x.curves,"getCurves"),X=c(()=>x.options,"getOptions"),Y=c(a=>{x.axes=a.map(t=>({name:t.name,label:t.label??t.name}))},"setAxes"),Z=c(a=>{x.curves=a.map(t=>({name:t.name,label:t.label??t.name,entries:q(t.entries)}))},"setCurves"),q=c(a=>{if(a[0].axis==null)return a.map(e=>e.value);const t=b();if(t.length===0)throw new Error("Axes must be populated before curves for reference entries");return t.map(e=>{const r=a.find(s=>s.axis?.$refText===e.name);if(r===void 0)throw new Error("Missing entry for axis "+e.label);return r.value})},"computeCurveEntries"),J=c(a=>{const t=a.reduce((e,r)=>(e[r.name]=r,e),{});x.options={showLegend:t.showLegend?.value??m.showLegend,ticks:t.ticks?.value??m.ticks,max:t.max?.value??m.max,min:t.min?.value??m.min,graticule:t.graticule?.value??m.graticule}},"setOptions"),K=c(()=>{z(),x=structuredClone(w)},"clear"),$={getAxes:b,getCurves:U,getOptions:X,setAxes:Y,setCurves:Z,setOptions:J,getConfig:N,clear:K,setAccTitle:F,getAccTitle:D,setDiagramTitle:_,getDiagramTitle:I,getAccDescription:E,setAccDescription:R},Q=c(a=>{k(a,$);const{axes:t,curves:e,options:r}=a;$.setAxes(t),$.setCurves(e),$.setOptions(r)},"populate"),tt={parse:c(async a=>{const t=await H("radar",a);B.debug(t),Q(t)},"parse")},et=c((a,t,e,r)=>{const s=r.db,i=s.getAxes(),l=s.getCurves(),n=s.getOptions(),o=s.getConfig(),d=s.getDiagramTitle(),p=P(t),u=at(p,o),g=n.max??Math.max(...l.map(f=>Math.max(...f.entries))),h=n.min,v=Math.min(o.width,o.height)/2;rt(u,i,v,n.ticks,n.graticule),st(u,i,v,o),A(u,i,l,h,g,n.graticule,o),T(u,l,n.showLegend,o),u.append("text").attr("class","radarTitle").text(d).attr("x",0).attr("y",-o.height/2-o.marginTop)},"draw"),at=c((a,t)=>{const e=t.width+t.marginLeft+t.marginRight,r=t.height+t.marginTop+t.marginBottom,s={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return V(a,r,e,t.useMaxWidth??!0),a.attr("viewBox",`0 0 ${e} ${r}`).attr("overflow","visible"),a.append("g").attr("transform",`translate(${s.x}, ${s.y})`)},"drawFrame"),rt=c((a,t,e,r,s)=>{if(s==="circle")for(let i=0;i{const u=2*p*Math.PI/i-Math.PI/2,g=n*Math.cos(u),h=n*Math.sin(u);return`${g},${h}`}).join(" ");a.append("polygon").attr("points",o).attr("class","radarGraticule")}}},"drawGraticule"),st=c((a,t,e,r)=>{const s=t.length;for(let i=0;i.01?"start":o<-.01?"end":"middle",u=d>.01?"hanging":d<-.01?"auto":"central",g=4;a.append("text").text(l).attr("x",e*r.axisLabelFactor*o+g*o).attr("y",e*r.axisLabelFactor*d+g*d).attr("text-anchor",p).attr("dominant-baseline",u).attr("class","radarAxisLabel")}},"drawAxes");function A(a,t,e,r,s,i,l){const n=t.length,o=Math.min(l.width,l.height)/2;e.forEach((d,p)=>{if(d.entries.length!==n)return;const u=d.entries.map((g,h)=>{const v=2*Math.PI*h/n-Math.PI/2,f=M(g,r,s,o),S=f*Math.cos(v),O=f*Math.sin(v);return{x:S,y:O}});i==="circle"?a.append("path").attr("d",L(u,l.curveTension)).attr("class",`radarCurve-${p}`):i==="polygon"&&a.append("polygon").attr("points",u.map(g=>`${g.x},${g.y}`).join(" ")).attr("class",`radarCurve-${p}`)})}c(A,"drawCurves");function M(a,t,e,r){const s=Math.min(Math.max(a,t),e);return r*(s-t)/(e-t)}c(M,"relativeRadius");function L(a,t){const e=a.length;let r=`M${a[0].x},${a[0].y}`;for(let s=0;s{const d=a.append("g").attr("transform",`translate(${s}, ${i+o*l})`);d.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${o}`),d.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(n.label)})}c(T,"drawLegend");var nt={draw:et},ot=c((a,t)=>{let e="";for(let r=0;r{const r=e.alternatives.map(E);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformChoice"),E=t(e=>{const r=e.elements.map(d);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformSequence"),i=t(e=>{switch(e.$type){case"EbnfTerminal":return{type:"terminal",value:e.value};case"EbnfNonTerminal":return{type:"nonterminal",name:e.name};case"EbnfSpecial":return{type:"special",text:e.text};case"EbnfGroup":return s(e.element);case"EbnfOptional":return{type:"optional",element:s(e.element)};case"EbnfRepetition":return{type:"repetition",element:s(e.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${e.$type}`)}},"transformPrimary"),b=t((e,r)=>{switch(r.$type){case"EbnfOptionalPostfix":return{type:"optional",element:e};case"EbnfZeroOrMorePostfix":return{type:"repetition",element:e,min:0,max:1/0};case"EbnfOneOrMorePostfix":return{type:"repetition",element:e,min:1,max:1/0};case"EbnfExceptionPostfix":return{type:"sequence",elements:[e,{type:"terminal",value:"-"},i(r.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${r.$type}`)}},"transformPostfix"),d=t(e=>e.postfixes.reduce((r,a)=>b(r,a),i(e.base)),"transformTerm"),y=t(e=>({name:e.name,definition:s(e.definition)}),"transformRule"),v=t(e=>{p(e,n),e.title&&n.setTitle(e.title),e.rules.map(r=>n.addRule(y(r)))},"populateDb"),g={parse:t(e=>{n.clear(),o.debug("[EBNF Parser] Starting Langium parse");const r=c.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new u(r);const a=r.value;o.debug("[EBNF Parser] Parsed rules:",a.rules.length),v(a),o.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:n}},S={parser:g,db:n,renderer:m,styles:l};export{S as diagram}; +import{g as l,r as m,d as n}from"./chunk-MOJQB5TN-n_KgTrfq.js";import{p}from"./chunk-JWPE2WC7-CI-VQAzP.js";import{_ as t,l as o}from"./mermaid.core-mH2pk-lc.js";import{M as u,a as f}from"./cynefin-VYW2F7L2-BD8Xugtm.js";import"./index-BIElaaEN.js";import"./_commonjsHelpers-CqkleIqs.js";var c=f().RailroadEbnf.parser.LangiumParser,s=t(e=>{const r=e.alternatives.map(E);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformChoice"),E=t(e=>{const r=e.elements.map(d);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformSequence"),i=t(e=>{switch(e.$type){case"EbnfTerminal":return{type:"terminal",value:e.value};case"EbnfNonTerminal":return{type:"nonterminal",name:e.name};case"EbnfSpecial":return{type:"special",text:e.text};case"EbnfGroup":return s(e.element);case"EbnfOptional":return{type:"optional",element:s(e.element)};case"EbnfRepetition":return{type:"repetition",element:s(e.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${e.$type}`)}},"transformPrimary"),b=t((e,r)=>{switch(r.$type){case"EbnfOptionalPostfix":return{type:"optional",element:e};case"EbnfZeroOrMorePostfix":return{type:"repetition",element:e,min:0,max:1/0};case"EbnfOneOrMorePostfix":return{type:"repetition",element:e,min:1,max:1/0};case"EbnfExceptionPostfix":return{type:"sequence",elements:[e,{type:"terminal",value:"-"},i(r.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${r.$type}`)}},"transformPostfix"),d=t(e=>e.postfixes.reduce((r,a)=>b(r,a),i(e.base)),"transformTerm"),y=t(e=>({name:e.name,definition:s(e.definition)}),"transformRule"),v=t(e=>{p(e,n),e.title&&n.setTitle(e.title),e.rules.map(r=>n.addRule(y(r)))},"populateDb"),g={parse:t(e=>{n.clear(),o.debug("[EBNF Parser] Starting Langium parse");const r=c.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new u(r);const a=r.value;o.debug("[EBNF Parser] Parsed rules:",a.rules.length),v(a),o.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:n}},S={parser:g,db:n,renderer:m,styles:l};export{S as diagram}; diff --git a/apps/kimi-code/dist-web/assets/erDiagram-Q63AITRT-DPLVpHbv.js b/apps/kimi-code/dist-web/assets/erDiagram-Q63AITRT-R300HT6W.js similarity index 99% rename from apps/kimi-code/dist-web/assets/erDiagram-Q63AITRT-DPLVpHbv.js rename to apps/kimi-code/dist-web/assets/erDiagram-Q63AITRT-R300HT6W.js index f55d23e8377..2f386fb9fe6 100644 --- a/apps/kimi-code/dist-web/assets/erDiagram-Q63AITRT-DPLVpHbv.js +++ b/apps/kimi-code/dist-web/assets/erDiagram-Q63AITRT-R300HT6W.js @@ -1,4 +1,4 @@ -import{g as Mt}from"./chunk-XXDRQBXY-D_bv9kM4.js";import{s as Bt}from"./chunk-VR4S4FIN-C_RujyXt.js";import{_ as l,b as Ft,a as Yt,s as Pt,g as zt,n as Gt,o as Kt,c as it,l as V,p as Ut,q as Zt,r as jt,t as Wt,u as qt,v as Qt,d as Xt,x as Ht}from"./mermaid.core-WW7RuneT.js";import{c as Jt}from"./channel-8Bt6a0tz.js";import"./index-CiHMlsuo.js";import"./_commonjsHelpers-CqkleIqs.js";var _t=(function(){var e=l(function(I,n,c,o){for(c=c||{},o=I.length;o--;c[I[o]]=n);return c},"o"),i=[6,8,10,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52],h=[1,10],a=[1,11],u=[1,12],d=[1,13],y=[1,23],f=[1,24],m=[1,25],j=[1,26],W=[1,27],S=[1,19],q=[1,28],M=[1,29],D=[1,20],R=[1,18],T=[1,21],C=[1,22],nt=[1,36],at=[1,37],ct=[1,38],ot=[1,39],lt=[1,40],B=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52,66,67,68,69,70],O=[1,45],N=[1,46],F=[1,55],Y=[40,48,50,51,52,71,72],P=[1,66],z=[1,64],A=[1,61],G=[1,65],K=[1,67],Q=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,51,52,66,67,68,69,70],gt=[66,67,68,69,70],bt=[1,85],kt=[1,84],mt=[1,82],Et=[1,83],St=[6,10,42,47],L=[6,10,13,41,42,47,48,49],X=[1,93],H=[1,92],J=[1,91],U=[19,58],Tt=[1,102],Ot=[1,101],ht=[19,58,61,63],ut={trace:l(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,entityName:11,relSpec:12,COLON:13,role:14,STYLE_SEPARATOR:15,idList:16,BLOCK_START:17,attributes:18,BLOCK_STOP:19,SQS:20,SQE:21,title:22,title_value:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,direction:29,classDefStatement:30,classStatement:31,styleStatement:32,direction_tb:33,direction_bt:34,direction_rl:35,direction_lr:36,CLASSDEF:37,stylesOpt:38,separator:39,UNICODE_TEXT:40,STYLE_TEXT:41,COMMA:42,CLASS:43,STYLE:44,style:45,styleComponent:46,SEMI:47,NUM:48,BRKT:49,ENTITY_NAME:50,DECIMAL_NUM:51,ENTITY_ONE:52,attribute:53,attributeType:54,attributeName:55,attributeKeyTypeList:56,attributeComment:57,ATTRIBUTE_WORD:58,"?":59,attributeKeyType:60,",":61,ATTRIBUTE_KEY:62,COMMENT:63,cardinality:64,relType:65,ZERO_OR_ONE:66,ZERO_OR_MORE:67,ONE_OR_MORE:68,ONLY_ONE:69,MD_PARENT:70,NON_IDENTIFYING:71,IDENTIFYING:72,WORD:73,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",8:"SPACE",10:"NEWLINE",13:"COLON",15:"STYLE_SEPARATOR",17:"BLOCK_START",19:"BLOCK_STOP",20:"SQS",21:"SQE",22:"title",23:"title_value",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"direction_tb",34:"direction_bt",35:"direction_rl",36:"direction_lr",37:"CLASSDEF",40:"UNICODE_TEXT",41:"STYLE_TEXT",42:"COMMA",43:"CLASS",44:"STYLE",47:"SEMI",48:"NUM",49:"BRKT",50:"ENTITY_NAME",51:"DECIMAL_NUM",52:"ENTITY_ONE",58:"ATTRIBUTE_WORD",59:"?",61:",",62:"ATTRIBUTE_KEY",63:"COMMENT",66:"ZERO_OR_ONE",67:"ZERO_OR_MORE",68:"ONE_OR_MORE",69:"ONLY_ONE",70:"MD_PARENT",71:"NON_IDENTIFYING",72:"IDENTIFYING",73:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,9],[9,7],[9,7],[9,4],[9,6],[9,3],[9,5],[9,1],[9,3],[9,7],[9,9],[9,6],[9,8],[9,4],[9,6],[9,2],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[9,1],[29,1],[29,1],[29,1],[29,1],[30,4],[16,1],[16,1],[16,3],[16,3],[31,3],[32,4],[38,1],[38,3],[45,1],[45,2],[39,1],[39,1],[39,1],[46,1],[46,1],[46,1],[46,1],[11,1],[11,1],[11,1],[11,1],[11,1],[18,1],[18,2],[53,2],[53,3],[53,3],[53,4],[54,1],[54,2],[55,1],[56,1],[56,3],[60,1],[57,1],[12,3],[64,1],[64,1],[64,1],[64,1],[64,1],[65,1],[65,1],[14,1],[14,1],[14,1]],performAction:l(function(n,c,o,r,p,t,Z){var s=t.length-1;switch(p){case 1:break;case 2:this.$=[];break;case 3:t[s-1].push(t[s]),this.$=t[s-1];break;case 4:case 5:this.$=t[s];break;case 6:case 7:this.$=[];break;case 8:r.addEntity(t[s-4]),r.addEntity(t[s-2]),r.addRelationship(t[s-4],t[s],t[s-2],t[s-3]);break;case 9:r.addEntity(t[s-8]),r.addEntity(t[s-4]),r.addRelationship(t[s-8],t[s],t[s-4],t[s-5]),r.setClass([t[s-8]],t[s-6]),r.setClass([t[s-4]],t[s-2]);break;case 10:r.addEntity(t[s-6]),r.addEntity(t[s-2]),r.addRelationship(t[s-6],t[s],t[s-2],t[s-3]),r.setClass([t[s-6]],t[s-4]);break;case 11:r.addEntity(t[s-6]),r.addEntity(t[s-4]),r.addRelationship(t[s-6],t[s],t[s-4],t[s-5]),r.setClass([t[s-4]],t[s-2]);break;case 12:r.addEntity(t[s-3]),r.addAttributes(t[s-3],t[s-1]);break;case 13:r.addEntity(t[s-5]),r.addAttributes(t[s-5],t[s-1]),r.setClass([t[s-5]],t[s-3]);break;case 14:r.addEntity(t[s-2]);break;case 15:r.addEntity(t[s-4]),r.setClass([t[s-4]],t[s-2]);break;case 16:r.addEntity(t[s]);break;case 17:r.addEntity(t[s-2]),r.setClass([t[s-2]],t[s]);break;case 18:r.addEntity(t[s-6],t[s-4]),r.addAttributes(t[s-6],t[s-1]);break;case 19:r.addEntity(t[s-8],t[s-6]),r.addAttributes(t[s-8],t[s-1]),r.setClass([t[s-8]],t[s-3]);break;case 20:r.addEntity(t[s-5],t[s-3]);break;case 21:r.addEntity(t[s-7],t[s-5]),r.setClass([t[s-7]],t[s-2]);break;case 22:r.addEntity(t[s-3],t[s-1]);break;case 23:r.addEntity(t[s-5],t[s-3]),r.setClass([t[s-5]],t[s]);break;case 24:case 25:this.$=t[s].trim(),r.setAccTitle(this.$);break;case 26:case 27:this.$=t[s].trim(),r.setAccDescription(this.$);break;case 32:r.setDirection("TB");break;case 33:r.setDirection("BT");break;case 34:r.setDirection("RL");break;case 35:r.setDirection("LR");break;case 36:this.$=t[s-3],r.addClass(t[s-2],t[s-1]);break;case 37:case 38:case 59:case 68:this.$=[t[s]];break;case 39:case 40:this.$=t[s-2].concat([t[s]]);break;case 41:this.$=t[s-2],r.setClass(t[s-1],t[s]);break;case 42:this.$=t[s-3],r.addCssStyles(t[s-2],t[s-1]);break;case 43:this.$=[t[s]];break;case 44:t[s-2].push(t[s]),this.$=t[s-2];break;case 46:this.$=t[s-1]+t[s];break;case 54:case 80:case 81:this.$=t[s].replace(/"/g,"");break;case 55:case 56:case 57:case 58:case 82:this.$=t[s];break;case 60:t[s].push(t[s-1]),this.$=t[s];break;case 61:this.$={type:t[s-1],name:t[s]};break;case 62:this.$={type:t[s-2],name:t[s-1],keys:t[s]};break;case 63:this.$={type:t[s-2],name:t[s-1],comment:t[s]};break;case 64:this.$={type:t[s-3],name:t[s-2],keys:t[s-1],comment:t[s]};break;case 65:case 67:case 70:this.$=t[s];break;case 66:this.$=t[s-1]+t[s];break;case 69:t[s-2].push(t[s]),this.$=t[s-2];break;case 71:this.$=t[s].replace(/"/g,"");break;case 72:this.$={cardA:t[s],relType:t[s-1],cardB:t[s-2]};break;case 73:this.$=r.Cardinality.ZERO_OR_ONE;break;case 74:this.$=r.Cardinality.ZERO_OR_MORE;break;case 75:this.$=r.Cardinality.ONE_OR_MORE;break;case 76:this.$=r.Cardinality.ONLY_ONE;break;case 77:this.$=r.Cardinality.MD_PARENT;break;case 78:this.$=r.Identification.NON_IDENTIFYING;break;case 79:this.$=r.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},e(i,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,22:h,24:a,26:u,28:d,29:14,30:15,31:16,32:17,33:y,34:f,35:m,36:j,37:W,40:S,43:q,44:M,48:D,50:R,51:T,52:C},e(i,[2,7],{1:[2,1]}),e(i,[2,3]),{9:30,11:9,22:h,24:a,26:u,28:d,29:14,30:15,31:16,32:17,33:y,34:f,35:m,36:j,37:W,40:S,43:q,44:M,48:D,50:R,51:T,52:C},e(i,[2,5]),e(i,[2,6]),e(i,[2,16],{12:31,64:35,15:[1,32],17:[1,33],20:[1,34],66:nt,67:at,68:ct,69:ot,70:lt}),{23:[1,41]},{25:[1,42]},{27:[1,43]},e(i,[2,27]),e(i,[2,28]),e(i,[2,29]),e(i,[2,30]),e(i,[2,31]),e(B,[2,54]),e(B,[2,55]),e(B,[2,56]),e(B,[2,57]),e(B,[2,58]),e(i,[2,32]),e(i,[2,33]),e(i,[2,34]),e(i,[2,35]),{16:44,40:O,41:N},{16:47,40:O,41:N},{16:48,40:O,41:N},e(i,[2,4]),{11:49,40:S,48:D,50:R,51:T,52:C},{16:50,40:O,41:N},{18:51,19:[1,52],53:53,54:54,58:F},{11:56,40:S,48:D,50:R,51:T,52:C},{65:57,71:[1,58],72:[1,59]},e(Y,[2,73]),e(Y,[2,74]),e(Y,[2,75]),e(Y,[2,76]),e(Y,[2,77]),e(i,[2,24]),e(i,[2,25]),e(i,[2,26]),{13:P,38:60,41:z,42:A,45:62,46:63,48:G,49:K},e(Q,[2,37]),e(Q,[2,38]),{16:68,40:O,41:N,42:A},{13:P,38:69,41:z,42:A,45:62,46:63,48:G,49:K},{13:[1,70],15:[1,71]},e(i,[2,17],{64:35,12:72,17:[1,73],42:A,66:nt,67:at,68:ct,69:ot,70:lt}),{19:[1,74]},e(i,[2,14]),{18:75,19:[2,59],53:53,54:54,58:F},{55:76,58:[1,77]},{58:[2,65],59:[1,78]},{21:[1,79]},{64:80,66:nt,67:at,68:ct,69:ot,70:lt},e(gt,[2,78]),e(gt,[2,79]),{6:bt,10:kt,39:81,42:mt,47:Et},{40:[1,86],41:[1,87]},e(St,[2,43],{46:88,13:P,41:z,48:G,49:K}),e(L,[2,45]),e(L,[2,50]),e(L,[2,51]),e(L,[2,52]),e(L,[2,53]),e(i,[2,41],{42:A}),{6:bt,10:kt,39:89,42:mt,47:Et},{14:90,40:X,50:H,73:J},{16:94,40:O,41:N},{11:95,40:S,48:D,50:R,51:T,52:C},{18:96,19:[1,97],53:53,54:54,58:F},e(i,[2,12]),{19:[2,60]},e(U,[2,61],{56:98,57:99,60:100,62:Tt,63:Ot}),e([19,58,62,63],[2,67]),{58:[2,66]},e(i,[2,22],{15:[1,104],17:[1,103]}),e([40,48,50,51,52],[2,72]),e(i,[2,36]),{13:P,41:z,45:105,46:63,48:G,49:K},e(i,[2,47]),e(i,[2,48]),e(i,[2,49]),e(Q,[2,39]),e(Q,[2,40]),e(L,[2,46]),e(i,[2,42]),e(i,[2,8]),e(i,[2,80]),e(i,[2,81]),e(i,[2,82]),{13:[1,106],42:A},{13:[1,108],15:[1,107]},{19:[1,109]},e(i,[2,15]),e(U,[2,62],{57:110,61:[1,111],63:Ot}),e(U,[2,63]),e(ht,[2,68]),e(U,[2,71]),e(ht,[2,70]),{18:112,19:[1,113],53:53,54:54,58:F},{16:114,40:O,41:N},e(St,[2,44],{46:88,13:P,41:z,48:G,49:K}),{14:115,40:X,50:H,73:J},{16:116,40:O,41:N},{14:117,40:X,50:H,73:J},e(i,[2,13]),e(U,[2,64]),{60:118,62:Tt},{19:[1,119]},e(i,[2,20]),e(i,[2,23],{17:[1,120],42:A}),e(i,[2,11]),{13:[1,121],42:A},e(i,[2,10]),e(ht,[2,69]),e(i,[2,18]),{18:122,19:[1,123],53:53,54:54,58:F},{14:124,40:X,50:H,73:J},{19:[1,125]},e(i,[2,21]),e(i,[2,9]),e(i,[2,19])],defaultActions:{75:[2,60],78:[2,66]},parseError:l(function(n,c){if(c.recoverable)this.trace(n);else{var o=new Error(n);throw o.hash=c,o}},"parseError"),parse:l(function(n){var c=this,o=[0],r=[],p=[null],t=[],Z=this.table,s="",tt=0,Nt=0,Dt=2,At=1,Lt=t.slice.call(arguments,1),_=Object.create(this.lexer),x={yy:{}};for(var dt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,dt)&&(x.yy[dt]=this.yy[dt]);_.setInput(n,x.yy),x.yy.lexer=_,x.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var pt=_.yylloc;t.push(pt);var wt=_.options&&_.options.ranges;typeof x.yy.parseError=="function"?this.parseError=x.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Vt(b){o.length=o.length-2*b,p.length=p.length-b,t.length=t.length-b}l(Vt,"popStack");function It(){var b;return b=r.pop()||_.lex()||At,typeof b!="number"&&(b instanceof Array&&(r=b,b=r.pop()),b=c.symbols_[b]||b),b}l(It,"lex");for(var g,v,k,ft,w={},et,E,Rt,st;;){if(v=o[o.length-1],this.defaultActions[v]?k=this.defaultActions[v]:((g===null||typeof g>"u")&&(g=It()),k=Z[v]&&Z[v][g]),typeof k>"u"||!k.length||!k[0]){var yt="";st=[];for(et in Z[v])this.terminals_[et]&&et>Dt&&st.push("'"+this.terminals_[et]+"'");_.showPosition?yt="Parse error on line "+(tt+1)+`: +import{g as Mt}from"./chunk-XXDRQBXY-Dc-6ZO6_.js";import{s as Bt}from"./chunk-VR4S4FIN-Dwk6LZpd.js";import{_ as l,b as Ft,a as Yt,s as Pt,g as zt,n as Gt,o as Kt,c as it,l as V,p as Ut,q as Zt,r as jt,t as Wt,u as qt,v as Qt,d as Xt,x as Ht}from"./mermaid.core-mH2pk-lc.js";import{c as Jt}from"./channel-D-WAU0ZU.js";import"./index-BIElaaEN.js";import"./_commonjsHelpers-CqkleIqs.js";var _t=(function(){var e=l(function(I,n,c,o){for(c=c||{},o=I.length;o--;c[I[o]]=n);return c},"o"),i=[6,8,10,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52],h=[1,10],a=[1,11],u=[1,12],d=[1,13],y=[1,23],f=[1,24],m=[1,25],j=[1,26],W=[1,27],S=[1,19],q=[1,28],M=[1,29],D=[1,20],R=[1,18],T=[1,21],C=[1,22],nt=[1,36],at=[1,37],ct=[1,38],ot=[1,39],lt=[1,40],B=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52,66,67,68,69,70],O=[1,45],N=[1,46],F=[1,55],Y=[40,48,50,51,52,71,72],P=[1,66],z=[1,64],A=[1,61],G=[1,65],K=[1,67],Q=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,51,52,66,67,68,69,70],gt=[66,67,68,69,70],bt=[1,85],kt=[1,84],mt=[1,82],Et=[1,83],St=[6,10,42,47],L=[6,10,13,41,42,47,48,49],X=[1,93],H=[1,92],J=[1,91],U=[19,58],Tt=[1,102],Ot=[1,101],ht=[19,58,61,63],ut={trace:l(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,entityName:11,relSpec:12,COLON:13,role:14,STYLE_SEPARATOR:15,idList:16,BLOCK_START:17,attributes:18,BLOCK_STOP:19,SQS:20,SQE:21,title:22,title_value:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,direction:29,classDefStatement:30,classStatement:31,styleStatement:32,direction_tb:33,direction_bt:34,direction_rl:35,direction_lr:36,CLASSDEF:37,stylesOpt:38,separator:39,UNICODE_TEXT:40,STYLE_TEXT:41,COMMA:42,CLASS:43,STYLE:44,style:45,styleComponent:46,SEMI:47,NUM:48,BRKT:49,ENTITY_NAME:50,DECIMAL_NUM:51,ENTITY_ONE:52,attribute:53,attributeType:54,attributeName:55,attributeKeyTypeList:56,attributeComment:57,ATTRIBUTE_WORD:58,"?":59,attributeKeyType:60,",":61,ATTRIBUTE_KEY:62,COMMENT:63,cardinality:64,relType:65,ZERO_OR_ONE:66,ZERO_OR_MORE:67,ONE_OR_MORE:68,ONLY_ONE:69,MD_PARENT:70,NON_IDENTIFYING:71,IDENTIFYING:72,WORD:73,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",8:"SPACE",10:"NEWLINE",13:"COLON",15:"STYLE_SEPARATOR",17:"BLOCK_START",19:"BLOCK_STOP",20:"SQS",21:"SQE",22:"title",23:"title_value",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"direction_tb",34:"direction_bt",35:"direction_rl",36:"direction_lr",37:"CLASSDEF",40:"UNICODE_TEXT",41:"STYLE_TEXT",42:"COMMA",43:"CLASS",44:"STYLE",47:"SEMI",48:"NUM",49:"BRKT",50:"ENTITY_NAME",51:"DECIMAL_NUM",52:"ENTITY_ONE",58:"ATTRIBUTE_WORD",59:"?",61:",",62:"ATTRIBUTE_KEY",63:"COMMENT",66:"ZERO_OR_ONE",67:"ZERO_OR_MORE",68:"ONE_OR_MORE",69:"ONLY_ONE",70:"MD_PARENT",71:"NON_IDENTIFYING",72:"IDENTIFYING",73:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,9],[9,7],[9,7],[9,4],[9,6],[9,3],[9,5],[9,1],[9,3],[9,7],[9,9],[9,6],[9,8],[9,4],[9,6],[9,2],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[9,1],[29,1],[29,1],[29,1],[29,1],[30,4],[16,1],[16,1],[16,3],[16,3],[31,3],[32,4],[38,1],[38,3],[45,1],[45,2],[39,1],[39,1],[39,1],[46,1],[46,1],[46,1],[46,1],[11,1],[11,1],[11,1],[11,1],[11,1],[18,1],[18,2],[53,2],[53,3],[53,3],[53,4],[54,1],[54,2],[55,1],[56,1],[56,3],[60,1],[57,1],[12,3],[64,1],[64,1],[64,1],[64,1],[64,1],[65,1],[65,1],[14,1],[14,1],[14,1]],performAction:l(function(n,c,o,r,p,t,Z){var s=t.length-1;switch(p){case 1:break;case 2:this.$=[];break;case 3:t[s-1].push(t[s]),this.$=t[s-1];break;case 4:case 5:this.$=t[s];break;case 6:case 7:this.$=[];break;case 8:r.addEntity(t[s-4]),r.addEntity(t[s-2]),r.addRelationship(t[s-4],t[s],t[s-2],t[s-3]);break;case 9:r.addEntity(t[s-8]),r.addEntity(t[s-4]),r.addRelationship(t[s-8],t[s],t[s-4],t[s-5]),r.setClass([t[s-8]],t[s-6]),r.setClass([t[s-4]],t[s-2]);break;case 10:r.addEntity(t[s-6]),r.addEntity(t[s-2]),r.addRelationship(t[s-6],t[s],t[s-2],t[s-3]),r.setClass([t[s-6]],t[s-4]);break;case 11:r.addEntity(t[s-6]),r.addEntity(t[s-4]),r.addRelationship(t[s-6],t[s],t[s-4],t[s-5]),r.setClass([t[s-4]],t[s-2]);break;case 12:r.addEntity(t[s-3]),r.addAttributes(t[s-3],t[s-1]);break;case 13:r.addEntity(t[s-5]),r.addAttributes(t[s-5],t[s-1]),r.setClass([t[s-5]],t[s-3]);break;case 14:r.addEntity(t[s-2]);break;case 15:r.addEntity(t[s-4]),r.setClass([t[s-4]],t[s-2]);break;case 16:r.addEntity(t[s]);break;case 17:r.addEntity(t[s-2]),r.setClass([t[s-2]],t[s]);break;case 18:r.addEntity(t[s-6],t[s-4]),r.addAttributes(t[s-6],t[s-1]);break;case 19:r.addEntity(t[s-8],t[s-6]),r.addAttributes(t[s-8],t[s-1]),r.setClass([t[s-8]],t[s-3]);break;case 20:r.addEntity(t[s-5],t[s-3]);break;case 21:r.addEntity(t[s-7],t[s-5]),r.setClass([t[s-7]],t[s-2]);break;case 22:r.addEntity(t[s-3],t[s-1]);break;case 23:r.addEntity(t[s-5],t[s-3]),r.setClass([t[s-5]],t[s]);break;case 24:case 25:this.$=t[s].trim(),r.setAccTitle(this.$);break;case 26:case 27:this.$=t[s].trim(),r.setAccDescription(this.$);break;case 32:r.setDirection("TB");break;case 33:r.setDirection("BT");break;case 34:r.setDirection("RL");break;case 35:r.setDirection("LR");break;case 36:this.$=t[s-3],r.addClass(t[s-2],t[s-1]);break;case 37:case 38:case 59:case 68:this.$=[t[s]];break;case 39:case 40:this.$=t[s-2].concat([t[s]]);break;case 41:this.$=t[s-2],r.setClass(t[s-1],t[s]);break;case 42:this.$=t[s-3],r.addCssStyles(t[s-2],t[s-1]);break;case 43:this.$=[t[s]];break;case 44:t[s-2].push(t[s]),this.$=t[s-2];break;case 46:this.$=t[s-1]+t[s];break;case 54:case 80:case 81:this.$=t[s].replace(/"/g,"");break;case 55:case 56:case 57:case 58:case 82:this.$=t[s];break;case 60:t[s].push(t[s-1]),this.$=t[s];break;case 61:this.$={type:t[s-1],name:t[s]};break;case 62:this.$={type:t[s-2],name:t[s-1],keys:t[s]};break;case 63:this.$={type:t[s-2],name:t[s-1],comment:t[s]};break;case 64:this.$={type:t[s-3],name:t[s-2],keys:t[s-1],comment:t[s]};break;case 65:case 67:case 70:this.$=t[s];break;case 66:this.$=t[s-1]+t[s];break;case 69:t[s-2].push(t[s]),this.$=t[s-2];break;case 71:this.$=t[s].replace(/"/g,"");break;case 72:this.$={cardA:t[s],relType:t[s-1],cardB:t[s-2]};break;case 73:this.$=r.Cardinality.ZERO_OR_ONE;break;case 74:this.$=r.Cardinality.ZERO_OR_MORE;break;case 75:this.$=r.Cardinality.ONE_OR_MORE;break;case 76:this.$=r.Cardinality.ONLY_ONE;break;case 77:this.$=r.Cardinality.MD_PARENT;break;case 78:this.$=r.Identification.NON_IDENTIFYING;break;case 79:this.$=r.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},e(i,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,22:h,24:a,26:u,28:d,29:14,30:15,31:16,32:17,33:y,34:f,35:m,36:j,37:W,40:S,43:q,44:M,48:D,50:R,51:T,52:C},e(i,[2,7],{1:[2,1]}),e(i,[2,3]),{9:30,11:9,22:h,24:a,26:u,28:d,29:14,30:15,31:16,32:17,33:y,34:f,35:m,36:j,37:W,40:S,43:q,44:M,48:D,50:R,51:T,52:C},e(i,[2,5]),e(i,[2,6]),e(i,[2,16],{12:31,64:35,15:[1,32],17:[1,33],20:[1,34],66:nt,67:at,68:ct,69:ot,70:lt}),{23:[1,41]},{25:[1,42]},{27:[1,43]},e(i,[2,27]),e(i,[2,28]),e(i,[2,29]),e(i,[2,30]),e(i,[2,31]),e(B,[2,54]),e(B,[2,55]),e(B,[2,56]),e(B,[2,57]),e(B,[2,58]),e(i,[2,32]),e(i,[2,33]),e(i,[2,34]),e(i,[2,35]),{16:44,40:O,41:N},{16:47,40:O,41:N},{16:48,40:O,41:N},e(i,[2,4]),{11:49,40:S,48:D,50:R,51:T,52:C},{16:50,40:O,41:N},{18:51,19:[1,52],53:53,54:54,58:F},{11:56,40:S,48:D,50:R,51:T,52:C},{65:57,71:[1,58],72:[1,59]},e(Y,[2,73]),e(Y,[2,74]),e(Y,[2,75]),e(Y,[2,76]),e(Y,[2,77]),e(i,[2,24]),e(i,[2,25]),e(i,[2,26]),{13:P,38:60,41:z,42:A,45:62,46:63,48:G,49:K},e(Q,[2,37]),e(Q,[2,38]),{16:68,40:O,41:N,42:A},{13:P,38:69,41:z,42:A,45:62,46:63,48:G,49:K},{13:[1,70],15:[1,71]},e(i,[2,17],{64:35,12:72,17:[1,73],42:A,66:nt,67:at,68:ct,69:ot,70:lt}),{19:[1,74]},e(i,[2,14]),{18:75,19:[2,59],53:53,54:54,58:F},{55:76,58:[1,77]},{58:[2,65],59:[1,78]},{21:[1,79]},{64:80,66:nt,67:at,68:ct,69:ot,70:lt},e(gt,[2,78]),e(gt,[2,79]),{6:bt,10:kt,39:81,42:mt,47:Et},{40:[1,86],41:[1,87]},e(St,[2,43],{46:88,13:P,41:z,48:G,49:K}),e(L,[2,45]),e(L,[2,50]),e(L,[2,51]),e(L,[2,52]),e(L,[2,53]),e(i,[2,41],{42:A}),{6:bt,10:kt,39:89,42:mt,47:Et},{14:90,40:X,50:H,73:J},{16:94,40:O,41:N},{11:95,40:S,48:D,50:R,51:T,52:C},{18:96,19:[1,97],53:53,54:54,58:F},e(i,[2,12]),{19:[2,60]},e(U,[2,61],{56:98,57:99,60:100,62:Tt,63:Ot}),e([19,58,62,63],[2,67]),{58:[2,66]},e(i,[2,22],{15:[1,104],17:[1,103]}),e([40,48,50,51,52],[2,72]),e(i,[2,36]),{13:P,41:z,45:105,46:63,48:G,49:K},e(i,[2,47]),e(i,[2,48]),e(i,[2,49]),e(Q,[2,39]),e(Q,[2,40]),e(L,[2,46]),e(i,[2,42]),e(i,[2,8]),e(i,[2,80]),e(i,[2,81]),e(i,[2,82]),{13:[1,106],42:A},{13:[1,108],15:[1,107]},{19:[1,109]},e(i,[2,15]),e(U,[2,62],{57:110,61:[1,111],63:Ot}),e(U,[2,63]),e(ht,[2,68]),e(U,[2,71]),e(ht,[2,70]),{18:112,19:[1,113],53:53,54:54,58:F},{16:114,40:O,41:N},e(St,[2,44],{46:88,13:P,41:z,48:G,49:K}),{14:115,40:X,50:H,73:J},{16:116,40:O,41:N},{14:117,40:X,50:H,73:J},e(i,[2,13]),e(U,[2,64]),{60:118,62:Tt},{19:[1,119]},e(i,[2,20]),e(i,[2,23],{17:[1,120],42:A}),e(i,[2,11]),{13:[1,121],42:A},e(i,[2,10]),e(ht,[2,69]),e(i,[2,18]),{18:122,19:[1,123],53:53,54:54,58:F},{14:124,40:X,50:H,73:J},{19:[1,125]},e(i,[2,21]),e(i,[2,9]),e(i,[2,19])],defaultActions:{75:[2,60],78:[2,66]},parseError:l(function(n,c){if(c.recoverable)this.trace(n);else{var o=new Error(n);throw o.hash=c,o}},"parseError"),parse:l(function(n){var c=this,o=[0],r=[],p=[null],t=[],Z=this.table,s="",tt=0,Nt=0,Dt=2,At=1,Lt=t.slice.call(arguments,1),_=Object.create(this.lexer),x={yy:{}};for(var dt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,dt)&&(x.yy[dt]=this.yy[dt]);_.setInput(n,x.yy),x.yy.lexer=_,x.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var pt=_.yylloc;t.push(pt);var wt=_.options&&_.options.ranges;typeof x.yy.parseError=="function"?this.parseError=x.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Vt(b){o.length=o.length-2*b,p.length=p.length-b,t.length=t.length-b}l(Vt,"popStack");function It(){var b;return b=r.pop()||_.lex()||At,typeof b!="number"&&(b instanceof Array&&(r=b,b=r.pop()),b=c.symbols_[b]||b),b}l(It,"lex");for(var g,v,k,ft,w={},et,E,Rt,st;;){if(v=o[o.length-1],this.defaultActions[v]?k=this.defaultActions[v]:((g===null||typeof g>"u")&&(g=It()),k=Z[v]&&Z[v][g]),typeof k>"u"||!k.length||!k[0]){var yt="";st=[];for(et in Z[v])this.terminals_[et]&&et>Dt&&st.push("'"+this.terminals_[et]+"'");_.showPosition?yt="Parse error on line "+(tt+1)+`: `+_.showPosition()+` Expecting `+st.join(", ")+", got '"+(this.terminals_[g]||g)+"'":yt="Parse error on line "+(tt+1)+": Unexpected "+(g==At?"end of input":"'"+(this.terminals_[g]||g)+"'"),this.parseError(yt,{text:_.match,token:this.terminals_[g]||g,line:_.yylineno,loc:pt,expected:st})}if(k[0]instanceof Array&&k.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+g);switch(k[0]){case 1:o.push(g),p.push(_.yytext),t.push(_.yylloc),o.push(k[1]),g=null,Nt=_.yyleng,s=_.yytext,tt=_.yylineno,pt=_.yylloc;break;case 2:if(E=this.productions_[k[1]][1],w.$=p[p.length-E],w._$={first_line:t[t.length-(E||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(E||1)].first_column,last_column:t[t.length-1].last_column},wt&&(w._$.range=[t[t.length-(E||1)].range[0],t[t.length-1].range[1]]),ft=this.performAction.apply(w,[s,Nt,tt,x.yy,k[1],p,t].concat(Lt)),typeof ft<"u")return ft;E&&(o=o.slice(0,-1*E*2),p=p.slice(0,-1*E),t=t.slice(0,-1*E)),o.push(this.productions_[k[1]][0]),p.push(w.$),t.push(w._$),Rt=Z[o[o.length-2]][o[o.length-1]],o.push(Rt);break;case 3:return!0}}return!0},"parse")},vt=(function(){var I={EOF:1,parseError:l(function(c,o){if(this.yy.parser)this.yy.parser.parseError(c,o);else throw new Error(c)},"parseError"),setInput:l(function(n,c){return this.yy=c||this.yy||{},this._input=n,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:l(function(){var n=this._input[0];this.yytext+=n,this.yyleng++,this.offset++,this.match+=n,this.matched+=n;var c=n.match(/(?:\r\n?|\n).*/g);return c?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),n},"input"),unput:l(function(n){var c=n.length,o=n.split(/(?:\r\n?|\n)/g);this._input=n+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-c),this.offset-=c;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),o.length-1&&(this.yylineno-=o.length-1);var p=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:o?(o.length===r.length?this.yylloc.first_column:0)+r[r.length-o.length].length-o[0].length:this.yylloc.first_column-c},this.options.ranges&&(this.yylloc.range=[p[0],p[0]+this.yyleng-c]),this.yyleng=this.yytext.length,this},"unput"),more:l(function(){return this._more=!0,this},"more"),reject:l(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:l(function(n){this.unput(this.match.slice(n))},"less"),pastInput:l(function(){var n=this.matched.substr(0,this.matched.length-this.match.length);return(n.length>20?"...":"")+n.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:l(function(){var n=this.match;return n.length<20&&(n+=this._input.substr(0,20-n.length)),(n.substr(0,20)+(n.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:l(function(){var n=this.pastInput(),c=new Array(n.length+1).join("-");return n+this.upcomingInput()+` diff --git a/apps/kimi-code/dist-web/assets/flowDiagram-23GEKE2U-eOlMNTnl.js b/apps/kimi-code/dist-web/assets/flowDiagram-23GEKE2U-Dr-4JgZi.js similarity index 99% rename from apps/kimi-code/dist-web/assets/flowDiagram-23GEKE2U-eOlMNTnl.js rename to apps/kimi-code/dist-web/assets/flowDiagram-23GEKE2U-Dr-4JgZi.js index 2f19e73a9b7..300c1ecfefc 100644 --- a/apps/kimi-code/dist-web/assets/flowDiagram-23GEKE2U-eOlMNTnl.js +++ b/apps/kimi-code/dist-web/assets/flowDiagram-23GEKE2U-Dr-4JgZi.js @@ -1,4 +1,4 @@ -import{g as He}from"./chunk-5VM5RSS4-BJR-VYAu.js";import{g as Xe}from"./chunk-XXDRQBXY-D_bv9kM4.js";import{s as Qe}from"./chunk-VR4S4FIN-C_RujyXt.js";import{_ as b,b6 as Je,F as Oe,l as J,c as g1,u as Ze,v as $e,x as ie,b as et,s as tt,n as st,a as it,g as rt,o as at,k as nt,G as ut,J as ot,bo as lt,q as te,d as se,a5 as ct,p as ht,b8 as dt,r as pt}from"./mermaid.core-WW7RuneT.js";import{f as ft}from"./chunk-32BRIVSS-CRTrWqUr.js";import{c as gt}from"./channel-8Bt6a0tz.js";var bt="flowchart-",At=class{constructor(){this.vertexCounter=0,this.config=g1(),this.diagramId="",this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=et,this.setAccDescription=tt,this.setDiagramTitle=st,this.getAccTitle=it,this.getAccDescription=rt,this.getDiagramTitle=at,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}static{b(this,"FlowDB")}sanitizeText(e){return nt.sanitizeText(e,this.config)}sanitizeNodeLabelType(e){switch(e){case"markdown":case"string":case"text":return e;default:return"markdown"}}setDiagramId(e){this.diagramId=e}lookUpDomId(e){for(const i of this.vertices.values())if(i.id===e)return this.diagramId?`${this.diagramId}-${i.domId}`:i.domId;return this.diagramId?`${this.diagramId}-${e}`:e}addVertex(e,i,r,a,o,d,l={},A){if(!e||e.trim().length===0)return;let n;if(A!==void 0){let k;A.includes(` +import{g as He}from"./chunk-5VM5RSS4-CRxkKkdS.js";import{g as Xe}from"./chunk-XXDRQBXY-Dc-6ZO6_.js";import{s as Qe}from"./chunk-VR4S4FIN-Dwk6LZpd.js";import{_ as b,b6 as Je,F as Oe,l as J,c as g1,u as Ze,v as $e,x as ie,b as et,s as tt,n as st,a as it,g as rt,o as at,k as nt,G as ut,J as ot,bo as lt,q as te,d as se,a5 as ct,p as ht,b8 as dt,r as pt}from"./mermaid.core-mH2pk-lc.js";import{f as ft}from"./chunk-32BRIVSS-BM7i2tA8.js";import{c as gt}from"./channel-D-WAU0ZU.js";var bt="flowchart-",At=class{constructor(){this.vertexCounter=0,this.config=g1(),this.diagramId="",this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=et,this.setAccDescription=tt,this.setDiagramTitle=st,this.getAccTitle=it,this.getAccDescription=rt,this.getDiagramTitle=at,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}static{b(this,"FlowDB")}sanitizeText(e){return nt.sanitizeText(e,this.config)}sanitizeNodeLabelType(e){switch(e){case"markdown":case"string":case"text":return e;default:return"markdown"}}setDiagramId(e){this.diagramId=e}lookUpDomId(e){for(const i of this.vertices.values())if(i.id===e)return this.diagramId?`${this.diagramId}-${i.domId}`:i.domId;return this.diagramId?`${this.diagramId}-${e}`:e}addVertex(e,i,r,a,o,d,l={},A){if(!e||e.trim().length===0)return;let n;if(A!==void 0){let k;A.includes(` `)?k=A+` `:k=`{ `+A+` diff --git a/apps/kimi-code/dist-web/assets/ganttDiagram-NO4QXBWP-D1u5oYVA.js b/apps/kimi-code/dist-web/assets/ganttDiagram-NO4QXBWP-D4dB32UL.js similarity index 99% rename from apps/kimi-code/dist-web/assets/ganttDiagram-NO4QXBWP-D1u5oYVA.js rename to apps/kimi-code/dist-web/assets/ganttDiagram-NO4QXBWP-D4dB32UL.js index 93a9f28759f..17288ba68b5 100644 --- a/apps/kimi-code/dist-web/assets/ganttDiagram-NO4QXBWP-D1u5oYVA.js +++ b/apps/kimi-code/dist-web/assets/ganttDiagram-NO4QXBWP-D4dB32UL.js @@ -1,4 +1,4 @@ -import{bg as on,bh as On,bi as cn,bj as un,bk as ln,bl as ue,bm as Hn,g as Nn,s as Pn,o as Vn,n as Rn,a as zn,b as qn,_ as d,c as Yt,d as Zt,e as Bn,bn as it,l as Tt,k as Zn,j as Xn,p as Gn,x as jn}from"./mermaid.core-WW7RuneT.js";import{g as oe}from"./_commonjsHelpers-CqkleIqs.js";import{b as Qn,t as Ne,c as Jn,a as Kn,l as tr}from"./linear-UIDPGx_K.js";import{i as er}from"./init-Gi6I4Gst.js";import"./index-CiHMlsuo.js";import"./defaultLocale-DX6XiGOO.js";function nr(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n=i)&&(n=i)}return n}function rr(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function ir(t){return t}var Gt=1,le=2,xe=3,Xt=4,Pe=1e-6;function sr(t){return"translate("+t+",0)"}function ar(t){return"translate(0,"+t+")"}function or(t){return e=>+t(e)}function cr(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function ur(){return!this.__axis}function fn(t,e){var n=[],r=null,i=null,s=6,a=6,y=3,F=typeof window<"u"&&window.devicePixelRatio>1?0:.5,S=t===Gt||t===Xt?-1:1,w=t===Xt||t===le?"x":"y",P=t===Gt||t===xe?sr:ar;function _(Y){var X=r??(e.ticks?e.ticks.apply(e,n):e.domain()),B=i??(e.tickFormat?e.tickFormat.apply(e,n):ir),v=Math.max(s,0)+y,U=e.range(),R=+U[0]+F,E=+U[U.length-1]+F,z=(e.bandwidth?cr:or)(e.copy(),F),G=Y.selection?Y.selection():Y,T=G.selectAll(".domain").data([null]),k=G.selectAll(".tick").data(X,e).order(),p=k.exit(),L=k.enter().append("g").attr("class","tick"),x=k.select("line"),C=k.select("text");T=T.merge(T.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),k=k.merge(L),x=x.merge(L.append("line").attr("stroke","currentColor").attr(w+"2",S*s)),C=C.merge(L.append("text").attr("fill","currentColor").attr(w,S*v).attr("dy",t===Gt?"0em":t===xe?"0.71em":"0.32em")),Y!==G&&(T=T.transition(Y),k=k.transition(Y),x=x.transition(Y),C=C.transition(Y),p=p.transition(Y).attr("opacity",Pe).attr("transform",function(M){return isFinite(M=z(M))?P(M+F):this.getAttribute("transform")}),L.attr("opacity",Pe).attr("transform",function(M){var D=this.parentNode.__axis;return P((D&&isFinite(D=D(M))?D:z(M))+F)})),p.remove(),T.attr("d",t===Xt||t===le?a?"M"+S*a+","+R+"H"+F+"V"+E+"H"+S*a:"M"+F+","+R+"V"+E:a?"M"+R+","+S*a+"V"+F+"H"+E+"V"+S*a:"M"+R+","+F+"H"+E),k.attr("opacity",1).attr("transform",function(M){return P(z(M)+F)}),x.attr(w+"2",S*s),C.attr(w,S*v).text(B),G.filter(ur).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===le?"start":t===Xt?"end":"middle"),G.each(function(){this.__axis=z})}return _.scale=function(Y){return arguments.length?(e=Y,_):e},_.ticks=function(){return n=Array.from(arguments),_},_.tickArguments=function(Y){return arguments.length?(n=Y==null?[]:Array.from(Y),_):n.slice()},_.tickValues=function(Y){return arguments.length?(r=Y==null?null:Array.from(Y),_):r&&r.slice()},_.tickFormat=function(Y){return arguments.length?(i=Y,_):i},_.tickSize=function(Y){return arguments.length?(s=a=+Y,_):s},_.tickSizeInner=function(Y){return arguments.length?(s=+Y,_):s},_.tickSizeOuter=function(Y){return arguments.length?(a=+Y,_):a},_.tickPadding=function(Y){return arguments.length?(y=+Y,_):y},_.offset=function(Y){return arguments.length?(F=+Y,_):F},_}function lr(t){return fn(Gt,t)}function fr(t){return fn(xe,t)}const dr=Math.PI/180,hr=180/Math.PI,ne=18,dn=.96422,hn=1,mn=.82521,gn=4/29,Ft=6/29,yn=3*Ft*Ft,mr=Ft*Ft*Ft;function kn(t){if(t instanceof ft)return new ft(t.l,t.a,t.b,t.opacity);if(t instanceof ht)return pn(t);t instanceof on||(t=On(t));var e=me(t.r),n=me(t.g),r=me(t.b),i=fe((.2225045*e+.7168786*n+.0606169*r)/hn),s,a;return e===n&&n===r?s=a=i:(s=fe((.4360747*e+.3850649*n+.1430804*r)/dn),a=fe((.0139322*e+.0971045*n+.7141733*r)/mn)),new ft(116*i-16,500*(s-i),200*(i-a),t.opacity)}function gr(t,e,n,r){return arguments.length===1?kn(t):new ft(t,e,n,r??1)}function ft(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}cn(ft,gr,un(ln,{brighter(t){return new ft(this.l+ne*(t??1),this.a,this.b,this.opacity)},darker(t){return new ft(this.l-ne*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return e=dn*de(e),t=hn*de(t),n=mn*de(n),new on(he(3.1338561*e-1.6168667*t-.4906146*n),he(-.9787684*e+1.9161415*t+.033454*n),he(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}}));function fe(t){return t>mr?Math.pow(t,1/3):t/yn+gn}function de(t){return t>Ft?t*t*t:yn*(t-gn)}function he(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function me(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function yr(t){if(t instanceof ht)return new ht(t.h,t.c,t.l,t.opacity);if(t instanceof ft||(t=kn(t)),t.a===0&&t.b===0)return new ht(NaN,0(t(s=new Date(+s)),s),i.ceil=s=>(t(s=new Date(s-1)),e(s,1),t(s),s),i.round=s=>{const a=i(s),y=i.ceil(s);return s-a(e(s=new Date(+s),a==null?1:Math.floor(a)),s),i.range=(s,a,y)=>{const F=[];if(s=i.ceil(s),y=y==null?1:Math.floor(y),!(s0))return F;let S;do F.push(S=new Date(+s)),e(s,y),t(s);while(Snt(a=>{if(a>=a)for(;t(a),!s(a);)a.setTime(a-1)},(a,y)=>{if(a>=a)if(y<0)for(;++y<=0;)for(;e(a,-1),!s(a););else for(;--y>=0;)for(;e(a,1),!s(a););}),n&&(i.count=(s,a)=>(ge.setTime(+s),ye.setTime(+a),t(ge),t(ye),Math.floor(n(ge,ye))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(r?a=>r(a)%s===0:a=>i.count(0,a)%s===0):i)),i}const Et=nt(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);Et.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?nt(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):Et);Et.range;const mt=1e3,ct=mt*60,gt=ct*60,yt=gt*24,Se=yt*7,Ve=yt*30,ke=yt*365,vt=nt(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*mt)},(t,e)=>(e-t)/mt,t=>t.getUTCSeconds());vt.range;const Nt=nt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mt)},(t,e)=>{t.setTime(+t+e*ct)},(t,e)=>(e-t)/ct,t=>t.getMinutes());Nt.range;const Tr=nt(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*ct)},(t,e)=>(e-t)/ct,t=>t.getUTCMinutes());Tr.range;const Pt=nt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mt-t.getMinutes()*ct)},(t,e)=>{t.setTime(+t+e*gt)},(t,e)=>(e-t)/gt,t=>t.getHours());Pt.range;const xr=nt(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*gt)},(t,e)=>(e-t)/gt,t=>t.getUTCHours());xr.range;const xt=nt(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*ct)/yt,t=>t.getDate()-1);xt.range;const _e=nt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yt,t=>t.getUTCDate()-1);_e.range;const br=nt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yt,t=>Math.floor(t/yt));br.range;function Dt(t){return nt(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*ct)/Se)}const zt=Dt(0),Vt=Dt(1),vn=Dt(2),Tn=Dt(3),bt=Dt(4),xn=Dt(5),bn=Dt(6);zt.range;Vt.range;vn.range;Tn.range;bt.range;xn.range;bn.range;function Mt(t){return nt(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/Se)}const wn=Mt(0),re=Mt(1),wr=Mt(2),Dr=Mt(3),It=Mt(4),Mr=Mt(5),Cr=Mt(6);wn.range;re.range;wr.range;Dr.range;It.range;Mr.range;Cr.range;const Rt=nt(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());Rt.range;const Sr=nt(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());Sr.range;const kt=nt(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());kt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:nt(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});kt.range;const wt=nt(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());wt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:nt(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});wt.range;function _r(t,e,n,r,i,s){const a=[[vt,1,mt],[vt,5,5*mt],[vt,15,15*mt],[vt,30,30*mt],[s,1,ct],[s,5,5*ct],[s,15,15*ct],[s,30,30*ct],[i,1,gt],[i,3,3*gt],[i,6,6*gt],[i,12,12*gt],[r,1,yt],[r,2,2*yt],[n,1,Se],[e,1,Ve],[e,3,3*Ve],[t,1,ke]];function y(S,w,P){const _=wv).right(a,_);if(Y===a.length)return t.every(Ne(S/ke,w/ke,P));if(Y===0)return Et.every(Math.max(Ne(S,w,P),1));const[X,B]=a[_/a[Y-1][2]53)return null;"w"in f||(f.w=1),"Z"in f?(A=ve($t(f.y,0,1)),Q=A.getUTCDay(),A=Q>4||Q===0?re.ceil(A):re(A),A=_e.offset(A,(f.V-1)*7),f.y=A.getUTCFullYear(),f.m=A.getUTCMonth(),f.d=A.getUTCDate()+(f.w+6)%7):(A=pe($t(f.y,0,1)),Q=A.getDay(),A=Q>4||Q===0?Vt.ceil(A):Vt(A),A=xt.offset(A,(f.V-1)*7),f.y=A.getFullYear(),f.m=A.getMonth(),f.d=A.getDate()+(f.w+6)%7)}else("W"in f||"U"in f)&&("w"in f||(f.w="u"in f?f.u%7:"W"in f?1:0),Q="Z"in f?ve($t(f.y,0,1)).getUTCDay():pe($t(f.y,0,1)).getDay(),f.m=0,f.d="W"in f?(f.w+6)%7+f.W*7-(Q+5)%7:f.w+f.U*7-(Q+6)%7);return"Z"in f?(f.H+=f.Z/100|0,f.M+=f.Z%100,ve(f)):pe(f)}}function p(h,N,V,f){for(var tt=0,A=N.length,Q=V.length,Z,st;tt=Q)return-1;if(Z=N.charCodeAt(tt++),Z===37){if(Z=N.charAt(tt++),st=G[Z in Re?N.charAt(tt++):Z],!st||(f=st(h,V,f))<0)return-1}else if(Z!=V.charCodeAt(f++))return-1}return f}function L(h,N,V){var f=S.exec(N.slice(V));return f?(h.p=w.get(f[0].toLowerCase()),V+f[0].length):-1}function x(h,N,V){var f=Y.exec(N.slice(V));return f?(h.w=X.get(f[0].toLowerCase()),V+f[0].length):-1}function C(h,N,V){var f=P.exec(N.slice(V));return f?(h.w=_.get(f[0].toLowerCase()),V+f[0].length):-1}function M(h,N,V){var f=U.exec(N.slice(V));return f?(h.m=R.get(f[0].toLowerCase()),V+f[0].length):-1}function D(h,N,V){var f=B.exec(N.slice(V));return f?(h.m=v.get(f[0].toLowerCase()),V+f[0].length):-1}function c(h,N,V){return p(h,e,N,V)}function g(h,N,V){return p(h,n,N,V)}function b(h,N,V){return p(h,r,N,V)}function m(h){return a[h.getDay()]}function I(h){return s[h.getDay()]}function o(h){return F[h.getMonth()]}function W(h){return y[h.getMonth()]}function u(h){return i[+(h.getHours()>=12)]}function K(h){return 1+~~(h.getMonth()/3)}function l(h){return a[h.getUTCDay()]}function $(h){return s[h.getUTCDay()]}function O(h){return F[h.getUTCMonth()]}function j(h){return y[h.getUTCMonth()]}function H(h){return i[+(h.getUTCHours()>=12)]}function J(h){return 1+~~(h.getUTCMonth()/3)}return{format:function(h){var N=T(h+="",E);return N.toString=function(){return h},N},parse:function(h){var N=k(h+="",!1);return N.toString=function(){return h},N},utcFormat:function(h){var N=T(h+="",z);return N.toString=function(){return h},N},utcParse:function(h){var N=k(h+="",!0);return N.toString=function(){return h},N}}}var Re={"-":"",_:" ",0:"0"},rt=/^\s*\d+/,Er=/^%/,Ir=/[\\^$*+?|[\]().{}]/g;function q(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",s=i.length;return r+(s[e.toLowerCase(),n]))}function Ar(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function Wr(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function $r(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function Or(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function Hr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function ze(t,e,n){var r=rt.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function qe(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Nr(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Pr(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.q=r[0]*3-3,n+r[0].length):-1}function Vr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function Be(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function Rr(t,e,n){var r=rt.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function Ze(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function zr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function qr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function Br(t,e,n){var r=rt.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function Zr(t,e,n){var r=rt.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Xr(t,e,n){var r=Er.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function Gr(t,e,n){var r=rt.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function jr(t,e,n){var r=rt.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function Xe(t,e){return q(t.getDate(),e,2)}function Qr(t,e){return q(t.getHours(),e,2)}function Jr(t,e){return q(t.getHours()%12||12,e,2)}function Kr(t,e){return q(1+xt.count(kt(t),t),e,3)}function Dn(t,e){return q(t.getMilliseconds(),e,3)}function ti(t,e){return Dn(t,e)+"000"}function ei(t,e){return q(t.getMonth()+1,e,2)}function ni(t,e){return q(t.getMinutes(),e,2)}function ri(t,e){return q(t.getSeconds(),e,2)}function ii(t){var e=t.getDay();return e===0?7:e}function si(t,e){return q(zt.count(kt(t)-1,t),e,2)}function Mn(t){var e=t.getDay();return e>=4||e===0?bt(t):bt.ceil(t)}function ai(t,e){return t=Mn(t),q(bt.count(kt(t),t)+(kt(t).getDay()===4),e,2)}function oi(t){return t.getDay()}function ci(t,e){return q(Vt.count(kt(t)-1,t),e,2)}function ui(t,e){return q(t.getFullYear()%100,e,2)}function li(t,e){return t=Mn(t),q(t.getFullYear()%100,e,2)}function fi(t,e){return q(t.getFullYear()%1e4,e,4)}function di(t,e){var n=t.getDay();return t=n>=4||n===0?bt(t):bt.ceil(t),q(t.getFullYear()%1e4,e,4)}function hi(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+q(e/60|0,"0",2)+q(e%60,"0",2)}function Ge(t,e){return q(t.getUTCDate(),e,2)}function mi(t,e){return q(t.getUTCHours(),e,2)}function gi(t,e){return q(t.getUTCHours()%12||12,e,2)}function yi(t,e){return q(1+_e.count(wt(t),t),e,3)}function Cn(t,e){return q(t.getUTCMilliseconds(),e,3)}function ki(t,e){return Cn(t,e)+"000"}function pi(t,e){return q(t.getUTCMonth()+1,e,2)}function vi(t,e){return q(t.getUTCMinutes(),e,2)}function Ti(t,e){return q(t.getUTCSeconds(),e,2)}function xi(t){var e=t.getUTCDay();return e===0?7:e}function bi(t,e){return q(wn.count(wt(t)-1,t),e,2)}function Sn(t){var e=t.getUTCDay();return e>=4||e===0?It(t):It.ceil(t)}function wi(t,e){return t=Sn(t),q(It.count(wt(t),t)+(wt(t).getUTCDay()===4),e,2)}function Di(t){return t.getUTCDay()}function Mi(t,e){return q(re.count(wt(t)-1,t),e,2)}function Ci(t,e){return q(t.getUTCFullYear()%100,e,2)}function Si(t,e){return t=Sn(t),q(t.getUTCFullYear()%100,e,2)}function _i(t,e){return q(t.getUTCFullYear()%1e4,e,4)}function Yi(t,e){var n=t.getUTCDay();return t=n>=4||n===0?It(t):It.ceil(t),q(t.getUTCFullYear()%1e4,e,4)}function Fi(){return"+0000"}function je(){return"%"}function Qe(t){return+t}function Je(t){return Math.floor(+t/1e3)}var St,ie;Ui({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Ui(t){return St=Ur(t),ie=St.format,St.parse,St.utcFormat,St.utcParse,St}function Ei(t){return new Date(t)}function Ii(t){return t instanceof Date?+t:+new Date(+t)}function _n(t,e,n,r,i,s,a,y,F,S){var w=Jn(),P=w.invert,_=w.domain,Y=S(".%L"),X=S(":%S"),B=S("%I:%M"),v=S("%I %p"),U=S("%a %d"),R=S("%b %d"),E=S("%B"),z=S("%Y");function G(T){return(F(T)4&&(Y+=7),_.add(Y,n));return X.diff(B,"week")+1},y.isoWeekday=function(S){return this.$utils().u(S)?this.day()||7:this.day(this.day()%7?S:S-7)};var F=y.startOf;y.startOf=function(S,w){var P=this.$utils(),_=!!P.u(w)||w;return P.p(S)==="isoweek"?_?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):F.bind(this)(S,w)}}}))})(jt)),jt.exports}var $i=Wi();const Oi=oe($i);var Qt={exports:{}},Hi=Qt.exports,tn;function Ni(){return tn||(tn=1,(function(t,e){(function(n,r){t.exports=r()})(Hi,(function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d/,s=/\d\d/,a=/\d\d?/,y=/\d*[^-_:/,()\s\d]+/,F={},S=function(v){return(v=+v)+(v>68?1900:2e3)},w=function(v){return function(U){this[v]=+U}},P=[/[+-]\d\d:?(\d\d)?|Z/,function(v){(this.zone||(this.zone={})).offset=(function(U){if(!U||U==="Z")return 0;var R=U.match(/([+-]|\d\d)/g),E=60*R[1]+(+R[2]||0);return E===0?0:R[0]==="+"?-E:E})(v)}],_=function(v){var U=F[v];return U&&(U.indexOf?U:U.s.concat(U.f))},Y=function(v,U){var R,E=F.meridiem;if(E){for(var z=1;z<=24;z+=1)if(v.indexOf(E(z,0,U))>-1){R=z>12;break}}else R=v===(U?"pm":"PM");return R},X={A:[y,function(v){this.afternoon=Y(v,!1)}],a:[y,function(v){this.afternoon=Y(v,!0)}],Q:[i,function(v){this.month=3*(v-1)+1}],S:[i,function(v){this.milliseconds=100*+v}],SS:[s,function(v){this.milliseconds=10*+v}],SSS:[/\d{3}/,function(v){this.milliseconds=+v}],s:[a,w("seconds")],ss:[a,w("seconds")],m:[a,w("minutes")],mm:[a,w("minutes")],H:[a,w("hours")],h:[a,w("hours")],HH:[a,w("hours")],hh:[a,w("hours")],D:[a,w("day")],DD:[s,w("day")],Do:[y,function(v){var U=F.ordinal,R=v.match(/\d+/);if(this.day=R[0],U)for(var E=1;E<=31;E+=1)U(E).replace(/\[|\]/g,"")===v&&(this.day=E)}],w:[a,w("week")],ww:[s,w("week")],M:[a,w("month")],MM:[s,w("month")],MMM:[y,function(v){var U=_("months"),R=(_("monthsShort")||U.map((function(E){return E.slice(0,3)}))).indexOf(v)+1;if(R<1)throw new Error;this.month=R%12||R}],MMMM:[y,function(v){var U=_("months").indexOf(v)+1;if(U<1)throw new Error;this.month=U%12||U}],Y:[/[+-]?\d+/,w("year")],YY:[s,function(v){this.year=S(v)}],YYYY:[/\d{4}/,w("year")],Z:P,ZZ:P};function B(v){var U,R;U=v,R=F&&F.formats;for(var E=(v=U.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(x,C,M){var D=M&&M.toUpperCase();return C||R[M]||n[M]||R[D].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(c,g,b){return g||b.slice(1)}))}))).match(r),z=E.length,G=0;G-1)return new Date((I==="X"?1e3:1)*m);var u=B(I)(m),K=u.year,l=u.month,$=u.day,O=u.hours,j=u.minutes,H=u.seconds,J=u.milliseconds,h=u.zone,N=u.week,V=new Date,f=$||(K||l?1:V.getDate()),tt=K||V.getFullYear(),A=0;K&&!l||(A=l>0?l-1:V.getMonth());var Q,Z=O||0,st=j||0,at=H||0,pt=J||0;return h?new Date(Date.UTC(tt,A,f,Z,st,at,pt+60*h.offset*1e3)):o?new Date(Date.UTC(tt,A,f,Z,st,at,pt)):(Q=new Date(tt,A,f,Z,st,at,pt),N&&(Q=W(Q).week(N).toDate()),Q)}catch{return new Date("")}})(T,L,k,R),this.init(),D&&D!==!0&&(this.$L=this.locale(D).$L),M&&T!=this.format(L)&&(this.$d=new Date("")),F={}}else if(L instanceof Array)for(var c=L.length,g=1;g<=c;g+=1){p[1]=L[g-1];var b=R.apply(this,p);if(b.isValid()){this.$d=b.$d,this.$L=b.$L,this.init();break}g===c&&(this.$d=new Date(""))}else z.call(this,G)}}}))})(Qt)),Qt.exports}var Pi=Ni();const Vi=oe(Pi);var Jt={exports:{}},Ri=Jt.exports,en;function zi(){return en||(en=1,(function(t,e){(function(n,r){t.exports=r()})(Ri,(function(){return function(n,r){var i=r.prototype,s=i.format;i.format=function(a){var y=this,F=this.$locale();if(!this.isValid())return s.bind(this)(a);var S=this.$utils(),w=(a||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(P){switch(P){case"Q":return Math.ceil((y.$M+1)/3);case"Do":return F.ordinal(y.$D);case"gggg":return y.weekYear();case"GGGG":return y.isoWeekYear();case"wo":return F.ordinal(y.week(),"W");case"w":case"ww":return S.s(y.week(),P==="w"?1:2,"0");case"W":case"WW":return S.s(y.isoWeek(),P==="W"?1:2,"0");case"k":case"kk":return S.s(String(y.$H===0?24:y.$H),P==="k"?1:2,"0");case"X":return Math.floor(y.$d.getTime()/1e3);case"x":return y.$d.getTime();case"z":return"["+y.offsetName()+"]";case"zzz":return"["+y.offsetName("long")+"]";default:return P}}));return s.bind(this)(w)}}}))})(Jt)),Jt.exports}var qi=zi();const Bi=oe(qi);var Kt={exports:{}},Zi=Kt.exports,nn;function Xi(){return nn||(nn=1,(function(t,e){(function(n,r){t.exports=r()})(Zi,(function(){var n,r,i=1e3,s=6e4,a=36e5,y=864e5,F=31536e6,S=2628e6,w=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,P=/\[([^\]]+)]|YYYY|YY|Y|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS/g,_={years:F,months:S,days:y,hours:a,minutes:s,seconds:i,milliseconds:1,weeks:6048e5},Y=function(T){return T instanceof z},X=function(T,k,p){return new z(T,p,k.$l)},B=function(T){return r.p(T)+"s"},v=function(T){return T<0},U=function(T){return v(T)?Math.ceil(T):Math.floor(T)},R=function(T){return Math.abs(T)},E=function(T,k){return T?v(T)?{negative:!0,format:""+R(T)+k}:{negative:!1,format:""+T+k}:{negative:!1,format:""}},z=(function(){function T(p,L,x){var C=this;if(this.$d={},this.$l=x,p===void 0&&(this.$ms=0,this.parseFromMilliseconds()),L)return X(p*_[B(L)],this);if(typeof p=="number")return this.$ms=p,this.parseFromMilliseconds(),this;if(typeof p=="object")return Object.keys(p).forEach((function(c){C.$d[B(c)]=p[c]})),this.calMilliseconds(),this;if(typeof p=="string"){var M=p.match(w);if(M){var D=M.slice(2).map((function(c){return c!=null?Number(c):0}));return this.$d.years=D[0],this.$d.months=D[1],this.$d.weeks=D[2],this.$d.days=D[3],this.$d.hours=D[4],this.$d.minutes=D[5],this.$d.seconds=D[6],this.calMilliseconds(),this}}return this}var k=T.prototype;return k.calMilliseconds=function(){var p=this;this.$ms=Object.keys(this.$d).reduce((function(L,x){return L+(p.$d[x]||0)*_[x]}),0)},k.parseFromMilliseconds=function(){var p=this.$ms;this.$d.years=U(p/F),p%=F,this.$d.months=U(p/S),p%=S,this.$d.days=U(p/y),p%=y,this.$d.hours=U(p/a),p%=a,this.$d.minutes=U(p/s),p%=s,this.$d.seconds=U(p/i),p%=i,this.$d.milliseconds=p},k.toISOString=function(){var p=E(this.$d.years,"Y"),L=E(this.$d.months,"M"),x=+this.$d.days||0;this.$d.weeks&&(x+=7*this.$d.weeks);var C=E(x,"D"),M=E(this.$d.hours,"H"),D=E(this.$d.minutes,"M"),c=this.$d.seconds||0;this.$d.milliseconds&&(c+=this.$d.milliseconds/1e3,c=Math.round(1e3*c)/1e3);var g=E(c,"S"),b=p.negative||L.negative||C.negative||M.negative||D.negative||g.negative,m=M.format||D.format||g.format?"T":"",I=(b?"-":"")+"P"+p.format+L.format+C.format+m+M.format+D.format+g.format;return I==="P"||I==="-P"?"P0D":I},k.toJSON=function(){return this.toISOString()},k.format=function(p){var L=p||"YYYY-MM-DDTHH:mm:ss",x={Y:this.$d.years,YY:r.s(this.$d.years,2,"0"),YYYY:r.s(this.$d.years,4,"0"),M:this.$d.months,MM:r.s(this.$d.months,2,"0"),D:this.$d.days,DD:r.s(this.$d.days,2,"0"),H:this.$d.hours,HH:r.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:r.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:r.s(this.$d.seconds,2,"0"),SSS:r.s(this.$d.milliseconds,3,"0")};return L.replace(P,(function(C,M){return M||String(x[C])}))},k.as=function(p){return this.$ms/_[B(p)]},k.get=function(p){var L=this.$ms,x=B(p);return x==="milliseconds"?L%=1e3:L=x==="weeks"?U(L/_[x]):this.$d[x],L||0},k.add=function(p,L,x){var C;return C=L?p*_[B(L)]:Y(p)?p.$ms:X(p,this).$ms,X(this.$ms+C*(x?-1:1),this)},k.subtract=function(p,L){return this.add(p,L,!0)},k.locale=function(p){var L=this.clone();return L.$l=p,L},k.clone=function(){return X(this.$ms,this)},k.humanize=function(p){return n().add(this.$ms,"ms").locale(this.$l).fromNow(!p)},k.valueOf=function(){return this.asMilliseconds()},k.milliseconds=function(){return this.get("milliseconds")},k.asMilliseconds=function(){return this.as("milliseconds")},k.seconds=function(){return this.get("seconds")},k.asSeconds=function(){return this.as("seconds")},k.minutes=function(){return this.get("minutes")},k.asMinutes=function(){return this.as("minutes")},k.hours=function(){return this.get("hours")},k.asHours=function(){return this.as("hours")},k.days=function(){return this.get("days")},k.asDays=function(){return this.as("days")},k.weeks=function(){return this.get("weeks")},k.asWeeks=function(){return this.as("weeks")},k.months=function(){return this.get("months")},k.asMonths=function(){return this.as("months")},k.years=function(){return this.get("years")},k.asYears=function(){return this.as("years")},T})(),G=function(T,k,p){return T.add(k.years()*p,"y").add(k.months()*p,"M").add(k.days()*p,"d").add(k.hours()*p,"h").add(k.minutes()*p,"m").add(k.seconds()*p,"s").add(k.milliseconds()*p,"ms")};return function(T,k,p){n=p,r=p().$utils(),p.duration=function(C,M){var D=p.locale();return X(C,{$l:D},M)},p.isDuration=Y;var L=k.prototype.add,x=k.prototype.subtract;k.prototype.add=function(C,M){return Y(C)?G(this,C,1):L.bind(this)(C,M)},k.prototype.subtract=function(C,M){return Y(C)?G(this,C,-1):x.bind(this)(C,M)}}}))})(Kt)),Kt.exports}var Gi=Xi();const ji=oe(Gi);var we=(function(){var t=d(function(D,c,g,b){for(g=g||{},b=D.length;b--;g[D[b]]=c);return g},"o"),e=[6,8,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,33,35,36,38,40],n=[1,26],r=[1,27],i=[1,28],s=[1,29],a=[1,30],y=[1,31],F=[1,32],S=[1,33],w=[1,34],P=[1,9],_=[1,10],Y=[1,11],X=[1,12],B=[1,13],v=[1,14],U=[1,15],R=[1,16],E=[1,19],z=[1,20],G=[1,21],T=[1,22],k=[1,23],p=[1,25],L=[1,35],x={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,start:3,gantt:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,weekday:11,weekday_monday:12,weekday_tuesday:13,weekday_wednesday:14,weekday_thursday:15,weekday_friday:16,weekday_saturday:17,weekday_sunday:18,weekend:19,weekend_friday:20,weekend_saturday:21,dateFormat:22,inclusiveEndDates:23,topAxis:24,axisFormat:25,tickInterval:26,excludes:27,includes:28,todayMarker:29,title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,section:36,clickStatement:37,taskTxt:38,taskData:39,click:40,callbackname:41,callbackargs:42,href:43,clickStatementDebug:44,$accept:0,$end:1},terminals_:{2:"error",4:"gantt",6:"EOF",8:"SPACE",10:"NL",12:"weekday_monday",13:"weekday_tuesday",14:"weekday_wednesday",15:"weekday_thursday",16:"weekday_friday",17:"weekday_saturday",18:"weekday_sunday",20:"weekend_friday",21:"weekend_saturday",22:"dateFormat",23:"inclusiveEndDates",24:"topAxis",25:"axisFormat",26:"tickInterval",27:"excludes",28:"includes",29:"todayMarker",30:"title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"section",38:"taskTxt",39:"taskData",40:"click",41:"callbackname",42:"callbackargs",43:"href"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[19,1],[19,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,2],[37,2],[37,3],[37,3],[37,4],[37,3],[37,4],[37,2],[44,2],[44,3],[44,3],[44,4],[44,3],[44,4],[44,2]],performAction:d(function(c,g,b,m,I,o,W){var u=o.length-1;switch(I){case 1:return o[u-1];case 2:this.$=[];break;case 3:o[u-1].push(o[u]),this.$=o[u-1];break;case 4:case 5:this.$=o[u];break;case 6:case 7:this.$=[];break;case 8:m.setWeekday("monday");break;case 9:m.setWeekday("tuesday");break;case 10:m.setWeekday("wednesday");break;case 11:m.setWeekday("thursday");break;case 12:m.setWeekday("friday");break;case 13:m.setWeekday("saturday");break;case 14:m.setWeekday("sunday");break;case 15:m.setWeekend("friday");break;case 16:m.setWeekend("saturday");break;case 17:m.setDateFormat(o[u].substr(11)),this.$=o[u].substr(11);break;case 18:m.enableInclusiveEndDates(),this.$=o[u].substr(18);break;case 19:m.TopAxis(),this.$=o[u].substr(8);break;case 20:m.setAxisFormat(o[u].substr(11)),this.$=o[u].substr(11);break;case 21:m.setTickInterval(o[u].substr(13)),this.$=o[u].substr(13);break;case 22:m.setExcludes(o[u].substr(9)),this.$=o[u].substr(9);break;case 23:m.setIncludes(o[u].substr(9)),this.$=o[u].substr(9);break;case 24:m.setTodayMarker(o[u].substr(12)),this.$=o[u].substr(12);break;case 27:m.setDiagramTitle(o[u].substr(6)),this.$=o[u].substr(6);break;case 28:this.$=o[u].trim(),m.setAccTitle(this.$);break;case 29:case 30:this.$=o[u].trim(),m.setAccDescription(this.$);break;case 31:m.addSection(o[u].substr(8)),this.$=o[u].substr(8);break;case 33:m.addTask(o[u-1],o[u]),this.$="task";break;case 34:this.$=o[u-1],m.setClickEvent(o[u-1],o[u],null);break;case 35:this.$=o[u-2],m.setClickEvent(o[u-2],o[u-1],o[u]);break;case 36:this.$=o[u-2],m.setClickEvent(o[u-2],o[u-1],null),m.setLink(o[u-2],o[u]);break;case 37:this.$=o[u-3],m.setClickEvent(o[u-3],o[u-2],o[u-1]),m.setLink(o[u-3],o[u]);break;case 38:this.$=o[u-2],m.setClickEvent(o[u-2],o[u],null),m.setLink(o[u-2],o[u-1]);break;case 39:this.$=o[u-3],m.setClickEvent(o[u-3],o[u-1],o[u]),m.setLink(o[u-3],o[u-2]);break;case 40:this.$=o[u-1],m.setLink(o[u-1],o[u]);break;case 41:case 47:this.$=o[u-1]+" "+o[u];break;case 42:case 43:case 45:this.$=o[u-2]+" "+o[u-1]+" "+o[u];break;case 44:case 46:this.$=o[u-3]+" "+o[u-2]+" "+o[u-1]+" "+o[u];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:n,13:r,14:i,15:s,16:a,17:y,18:F,19:18,20:S,21:w,22:P,23:_,24:Y,25:X,26:B,27:v,28:U,29:R,30:E,31:z,33:G,35:T,36:k,37:24,38:p,40:L},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:36,11:17,12:n,13:r,14:i,15:s,16:a,17:y,18:F,19:18,20:S,21:w,22:P,23:_,24:Y,25:X,26:B,27:v,28:U,29:R,30:E,31:z,33:G,35:T,36:k,37:24,38:p,40:L},t(e,[2,5]),t(e,[2,6]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,20]),t(e,[2,21]),t(e,[2,22]),t(e,[2,23]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),t(e,[2,27]),{32:[1,37]},{34:[1,38]},t(e,[2,30]),t(e,[2,31]),t(e,[2,32]),{39:[1,39]},t(e,[2,8]),t(e,[2,9]),t(e,[2,10]),t(e,[2,11]),t(e,[2,12]),t(e,[2,13]),t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),{41:[1,40],43:[1,41]},t(e,[2,4]),t(e,[2,28]),t(e,[2,29]),t(e,[2,33]),t(e,[2,34],{42:[1,42],43:[1,43]}),t(e,[2,40],{41:[1,44]}),t(e,[2,35],{43:[1,45]}),t(e,[2,36]),t(e,[2,38],{42:[1,46]}),t(e,[2,37]),t(e,[2,39])],defaultActions:{},parseError:d(function(c,g){if(g.recoverable)this.trace(c);else{var b=new Error(c);throw b.hash=g,b}},"parseError"),parse:d(function(c){var g=this,b=[0],m=[],I=[null],o=[],W=this.table,u="",K=0,l=0,$=2,O=1,j=o.slice.call(arguments,1),H=Object.create(this.lexer),J={yy:{}};for(var h in this.yy)Object.prototype.hasOwnProperty.call(this.yy,h)&&(J.yy[h]=this.yy[h]);H.setInput(c,J.yy),J.yy.lexer=H,J.yy.parser=this,typeof H.yylloc>"u"&&(H.yylloc={});var N=H.yylloc;o.push(N);var V=H.options&&H.options.ranges;typeof J.yy.parseError=="function"?this.parseError=J.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function f(ot){b.length=b.length-2*ot,I.length=I.length-ot,o.length=o.length-ot}d(f,"popStack");function tt(){var ot;return ot=m.pop()||H.lex()||O,typeof ot!="number"&&(ot instanceof Array&&(m=ot,ot=m.pop()),ot=g.symbols_[ot]||ot),ot}d(tt,"lex");for(var A,Q,Z,st,at={},pt,ut,He,Bt;;){if(Q=b[b.length-1],this.defaultActions[Q]?Z=this.defaultActions[Q]:((A===null||typeof A>"u")&&(A=tt()),Z=W[Q]&&W[Q][A]),typeof Z>"u"||!Z.length||!Z[0]){var ce="";Bt=[];for(pt in W[Q])this.terminals_[pt]&&pt>$&&Bt.push("'"+this.terminals_[pt]+"'");H.showPosition?ce="Parse error on line "+(K+1)+`: +import{bg as on,bh as On,bi as cn,bj as un,bk as ln,bl as ue,bm as Hn,g as Nn,s as Pn,o as Vn,n as Rn,a as zn,b as qn,_ as d,c as Yt,d as Zt,e as Bn,bn as it,l as Tt,k as Zn,j as Xn,p as Gn,x as jn}from"./mermaid.core-mH2pk-lc.js";import{g as oe}from"./_commonjsHelpers-CqkleIqs.js";import{b as Qn,t as Ne,c as Jn,a as Kn,l as tr}from"./linear-DqQ15sao.js";import{i as er}from"./init-Gi6I4Gst.js";import"./index-BIElaaEN.js";import"./defaultLocale-DX6XiGOO.js";function nr(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n=i)&&(n=i)}return n}function rr(t,e){let n;if(e===void 0)for(const r of t)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of t)(i=e(i,++r,t))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function ir(t){return t}var Gt=1,le=2,xe=3,Xt=4,Pe=1e-6;function sr(t){return"translate("+t+",0)"}function ar(t){return"translate(0,"+t+")"}function or(t){return e=>+t(e)}function cr(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function ur(){return!this.__axis}function fn(t,e){var n=[],r=null,i=null,s=6,a=6,y=3,F=typeof window<"u"&&window.devicePixelRatio>1?0:.5,S=t===Gt||t===Xt?-1:1,w=t===Xt||t===le?"x":"y",P=t===Gt||t===xe?sr:ar;function _(Y){var X=r??(e.ticks?e.ticks.apply(e,n):e.domain()),B=i??(e.tickFormat?e.tickFormat.apply(e,n):ir),v=Math.max(s,0)+y,U=e.range(),R=+U[0]+F,E=+U[U.length-1]+F,z=(e.bandwidth?cr:or)(e.copy(),F),G=Y.selection?Y.selection():Y,T=G.selectAll(".domain").data([null]),k=G.selectAll(".tick").data(X,e).order(),p=k.exit(),L=k.enter().append("g").attr("class","tick"),x=k.select("line"),C=k.select("text");T=T.merge(T.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),k=k.merge(L),x=x.merge(L.append("line").attr("stroke","currentColor").attr(w+"2",S*s)),C=C.merge(L.append("text").attr("fill","currentColor").attr(w,S*v).attr("dy",t===Gt?"0em":t===xe?"0.71em":"0.32em")),Y!==G&&(T=T.transition(Y),k=k.transition(Y),x=x.transition(Y),C=C.transition(Y),p=p.transition(Y).attr("opacity",Pe).attr("transform",function(M){return isFinite(M=z(M))?P(M+F):this.getAttribute("transform")}),L.attr("opacity",Pe).attr("transform",function(M){var D=this.parentNode.__axis;return P((D&&isFinite(D=D(M))?D:z(M))+F)})),p.remove(),T.attr("d",t===Xt||t===le?a?"M"+S*a+","+R+"H"+F+"V"+E+"H"+S*a:"M"+F+","+R+"V"+E:a?"M"+R+","+S*a+"V"+F+"H"+E+"V"+S*a:"M"+R+","+F+"H"+E),k.attr("opacity",1).attr("transform",function(M){return P(z(M)+F)}),x.attr(w+"2",S*s),C.attr(w,S*v).text(B),G.filter(ur).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===le?"start":t===Xt?"end":"middle"),G.each(function(){this.__axis=z})}return _.scale=function(Y){return arguments.length?(e=Y,_):e},_.ticks=function(){return n=Array.from(arguments),_},_.tickArguments=function(Y){return arguments.length?(n=Y==null?[]:Array.from(Y),_):n.slice()},_.tickValues=function(Y){return arguments.length?(r=Y==null?null:Array.from(Y),_):r&&r.slice()},_.tickFormat=function(Y){return arguments.length?(i=Y,_):i},_.tickSize=function(Y){return arguments.length?(s=a=+Y,_):s},_.tickSizeInner=function(Y){return arguments.length?(s=+Y,_):s},_.tickSizeOuter=function(Y){return arguments.length?(a=+Y,_):a},_.tickPadding=function(Y){return arguments.length?(y=+Y,_):y},_.offset=function(Y){return arguments.length?(F=+Y,_):F},_}function lr(t){return fn(Gt,t)}function fr(t){return fn(xe,t)}const dr=Math.PI/180,hr=180/Math.PI,ne=18,dn=.96422,hn=1,mn=.82521,gn=4/29,Ft=6/29,yn=3*Ft*Ft,mr=Ft*Ft*Ft;function kn(t){if(t instanceof ft)return new ft(t.l,t.a,t.b,t.opacity);if(t instanceof ht)return pn(t);t instanceof on||(t=On(t));var e=me(t.r),n=me(t.g),r=me(t.b),i=fe((.2225045*e+.7168786*n+.0606169*r)/hn),s,a;return e===n&&n===r?s=a=i:(s=fe((.4360747*e+.3850649*n+.1430804*r)/dn),a=fe((.0139322*e+.0971045*n+.7141733*r)/mn)),new ft(116*i-16,500*(s-i),200*(i-a),t.opacity)}function gr(t,e,n,r){return arguments.length===1?kn(t):new ft(t,e,n,r??1)}function ft(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}cn(ft,gr,un(ln,{brighter(t){return new ft(this.l+ne*(t??1),this.a,this.b,this.opacity)},darker(t){return new ft(this.l-ne*(t??1),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return e=dn*de(e),t=hn*de(t),n=mn*de(n),new on(he(3.1338561*e-1.6168667*t-.4906146*n),he(-.9787684*e+1.9161415*t+.033454*n),he(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}}));function fe(t){return t>mr?Math.pow(t,1/3):t/yn+gn}function de(t){return t>Ft?t*t*t:yn*(t-gn)}function he(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function me(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function yr(t){if(t instanceof ht)return new ht(t.h,t.c,t.l,t.opacity);if(t instanceof ft||(t=kn(t)),t.a===0&&t.b===0)return new ht(NaN,0(t(s=new Date(+s)),s),i.ceil=s=>(t(s=new Date(s-1)),e(s,1),t(s),s),i.round=s=>{const a=i(s),y=i.ceil(s);return s-a(e(s=new Date(+s),a==null?1:Math.floor(a)),s),i.range=(s,a,y)=>{const F=[];if(s=i.ceil(s),y=y==null?1:Math.floor(y),!(s0))return F;let S;do F.push(S=new Date(+s)),e(s,y),t(s);while(Snt(a=>{if(a>=a)for(;t(a),!s(a);)a.setTime(a-1)},(a,y)=>{if(a>=a)if(y<0)for(;++y<=0;)for(;e(a,-1),!s(a););else for(;--y>=0;)for(;e(a,1),!s(a););}),n&&(i.count=(s,a)=>(ge.setTime(+s),ye.setTime(+a),t(ge),t(ye),Math.floor(n(ge,ye))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(r?a=>r(a)%s===0:a=>i.count(0,a)%s===0):i)),i}const Et=nt(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);Et.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?nt(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):Et);Et.range;const mt=1e3,ct=mt*60,gt=ct*60,yt=gt*24,Se=yt*7,Ve=yt*30,ke=yt*365,vt=nt(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*mt)},(t,e)=>(e-t)/mt,t=>t.getUTCSeconds());vt.range;const Nt=nt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mt)},(t,e)=>{t.setTime(+t+e*ct)},(t,e)=>(e-t)/ct,t=>t.getMinutes());Nt.range;const Tr=nt(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*ct)},(t,e)=>(e-t)/ct,t=>t.getUTCMinutes());Tr.range;const Pt=nt(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*mt-t.getMinutes()*ct)},(t,e)=>{t.setTime(+t+e*gt)},(t,e)=>(e-t)/gt,t=>t.getHours());Pt.range;const xr=nt(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*gt)},(t,e)=>(e-t)/gt,t=>t.getUTCHours());xr.range;const xt=nt(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*ct)/yt,t=>t.getDate()-1);xt.range;const _e=nt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yt,t=>t.getUTCDate()-1);_e.range;const br=nt(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/yt,t=>Math.floor(t/yt));br.range;function Dt(t){return nt(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*ct)/Se)}const zt=Dt(0),Vt=Dt(1),vn=Dt(2),Tn=Dt(3),bt=Dt(4),xn=Dt(5),bn=Dt(6);zt.range;Vt.range;vn.range;Tn.range;bt.range;xn.range;bn.range;function Mt(t){return nt(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/Se)}const wn=Mt(0),re=Mt(1),wr=Mt(2),Dr=Mt(3),It=Mt(4),Mr=Mt(5),Cr=Mt(6);wn.range;re.range;wr.range;Dr.range;It.range;Mr.range;Cr.range;const Rt=nt(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());Rt.range;const Sr=nt(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());Sr.range;const kt=nt(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());kt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:nt(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});kt.range;const wt=nt(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());wt.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:nt(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});wt.range;function _r(t,e,n,r,i,s){const a=[[vt,1,mt],[vt,5,5*mt],[vt,15,15*mt],[vt,30,30*mt],[s,1,ct],[s,5,5*ct],[s,15,15*ct],[s,30,30*ct],[i,1,gt],[i,3,3*gt],[i,6,6*gt],[i,12,12*gt],[r,1,yt],[r,2,2*yt],[n,1,Se],[e,1,Ve],[e,3,3*Ve],[t,1,ke]];function y(S,w,P){const _=wv).right(a,_);if(Y===a.length)return t.every(Ne(S/ke,w/ke,P));if(Y===0)return Et.every(Math.max(Ne(S,w,P),1));const[X,B]=a[_/a[Y-1][2]53)return null;"w"in f||(f.w=1),"Z"in f?(A=ve($t(f.y,0,1)),Q=A.getUTCDay(),A=Q>4||Q===0?re.ceil(A):re(A),A=_e.offset(A,(f.V-1)*7),f.y=A.getUTCFullYear(),f.m=A.getUTCMonth(),f.d=A.getUTCDate()+(f.w+6)%7):(A=pe($t(f.y,0,1)),Q=A.getDay(),A=Q>4||Q===0?Vt.ceil(A):Vt(A),A=xt.offset(A,(f.V-1)*7),f.y=A.getFullYear(),f.m=A.getMonth(),f.d=A.getDate()+(f.w+6)%7)}else("W"in f||"U"in f)&&("w"in f||(f.w="u"in f?f.u%7:"W"in f?1:0),Q="Z"in f?ve($t(f.y,0,1)).getUTCDay():pe($t(f.y,0,1)).getDay(),f.m=0,f.d="W"in f?(f.w+6)%7+f.W*7-(Q+5)%7:f.w+f.U*7-(Q+6)%7);return"Z"in f?(f.H+=f.Z/100|0,f.M+=f.Z%100,ve(f)):pe(f)}}function p(h,N,V,f){for(var tt=0,A=N.length,Q=V.length,Z,st;tt=Q)return-1;if(Z=N.charCodeAt(tt++),Z===37){if(Z=N.charAt(tt++),st=G[Z in Re?N.charAt(tt++):Z],!st||(f=st(h,V,f))<0)return-1}else if(Z!=V.charCodeAt(f++))return-1}return f}function L(h,N,V){var f=S.exec(N.slice(V));return f?(h.p=w.get(f[0].toLowerCase()),V+f[0].length):-1}function x(h,N,V){var f=Y.exec(N.slice(V));return f?(h.w=X.get(f[0].toLowerCase()),V+f[0].length):-1}function C(h,N,V){var f=P.exec(N.slice(V));return f?(h.w=_.get(f[0].toLowerCase()),V+f[0].length):-1}function M(h,N,V){var f=U.exec(N.slice(V));return f?(h.m=R.get(f[0].toLowerCase()),V+f[0].length):-1}function D(h,N,V){var f=B.exec(N.slice(V));return f?(h.m=v.get(f[0].toLowerCase()),V+f[0].length):-1}function c(h,N,V){return p(h,e,N,V)}function g(h,N,V){return p(h,n,N,V)}function b(h,N,V){return p(h,r,N,V)}function m(h){return a[h.getDay()]}function I(h){return s[h.getDay()]}function o(h){return F[h.getMonth()]}function W(h){return y[h.getMonth()]}function u(h){return i[+(h.getHours()>=12)]}function K(h){return 1+~~(h.getMonth()/3)}function l(h){return a[h.getUTCDay()]}function $(h){return s[h.getUTCDay()]}function O(h){return F[h.getUTCMonth()]}function j(h){return y[h.getUTCMonth()]}function H(h){return i[+(h.getUTCHours()>=12)]}function J(h){return 1+~~(h.getUTCMonth()/3)}return{format:function(h){var N=T(h+="",E);return N.toString=function(){return h},N},parse:function(h){var N=k(h+="",!1);return N.toString=function(){return h},N},utcFormat:function(h){var N=T(h+="",z);return N.toString=function(){return h},N},utcParse:function(h){var N=k(h+="",!0);return N.toString=function(){return h},N}}}var Re={"-":"",_:" ",0:"0"},rt=/^\s*\d+/,Er=/^%/,Ir=/[\\^$*+?|[\]().{}]/g;function q(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",s=i.length;return r+(s[e.toLowerCase(),n]))}function Ar(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function Wr(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function $r(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function Or(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function Hr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function ze(t,e,n){var r=rt.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function qe(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Nr(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Pr(t,e,n){var r=rt.exec(e.slice(n,n+1));return r?(t.q=r[0]*3-3,n+r[0].length):-1}function Vr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function Be(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function Rr(t,e,n){var r=rt.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function Ze(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function zr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function qr(t,e,n){var r=rt.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function Br(t,e,n){var r=rt.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function Zr(t,e,n){var r=rt.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Xr(t,e,n){var r=Er.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function Gr(t,e,n){var r=rt.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function jr(t,e,n){var r=rt.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function Xe(t,e){return q(t.getDate(),e,2)}function Qr(t,e){return q(t.getHours(),e,2)}function Jr(t,e){return q(t.getHours()%12||12,e,2)}function Kr(t,e){return q(1+xt.count(kt(t),t),e,3)}function Dn(t,e){return q(t.getMilliseconds(),e,3)}function ti(t,e){return Dn(t,e)+"000"}function ei(t,e){return q(t.getMonth()+1,e,2)}function ni(t,e){return q(t.getMinutes(),e,2)}function ri(t,e){return q(t.getSeconds(),e,2)}function ii(t){var e=t.getDay();return e===0?7:e}function si(t,e){return q(zt.count(kt(t)-1,t),e,2)}function Mn(t){var e=t.getDay();return e>=4||e===0?bt(t):bt.ceil(t)}function ai(t,e){return t=Mn(t),q(bt.count(kt(t),t)+(kt(t).getDay()===4),e,2)}function oi(t){return t.getDay()}function ci(t,e){return q(Vt.count(kt(t)-1,t),e,2)}function ui(t,e){return q(t.getFullYear()%100,e,2)}function li(t,e){return t=Mn(t),q(t.getFullYear()%100,e,2)}function fi(t,e){return q(t.getFullYear()%1e4,e,4)}function di(t,e){var n=t.getDay();return t=n>=4||n===0?bt(t):bt.ceil(t),q(t.getFullYear()%1e4,e,4)}function hi(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+q(e/60|0,"0",2)+q(e%60,"0",2)}function Ge(t,e){return q(t.getUTCDate(),e,2)}function mi(t,e){return q(t.getUTCHours(),e,2)}function gi(t,e){return q(t.getUTCHours()%12||12,e,2)}function yi(t,e){return q(1+_e.count(wt(t),t),e,3)}function Cn(t,e){return q(t.getUTCMilliseconds(),e,3)}function ki(t,e){return Cn(t,e)+"000"}function pi(t,e){return q(t.getUTCMonth()+1,e,2)}function vi(t,e){return q(t.getUTCMinutes(),e,2)}function Ti(t,e){return q(t.getUTCSeconds(),e,2)}function xi(t){var e=t.getUTCDay();return e===0?7:e}function bi(t,e){return q(wn.count(wt(t)-1,t),e,2)}function Sn(t){var e=t.getUTCDay();return e>=4||e===0?It(t):It.ceil(t)}function wi(t,e){return t=Sn(t),q(It.count(wt(t),t)+(wt(t).getUTCDay()===4),e,2)}function Di(t){return t.getUTCDay()}function Mi(t,e){return q(re.count(wt(t)-1,t),e,2)}function Ci(t,e){return q(t.getUTCFullYear()%100,e,2)}function Si(t,e){return t=Sn(t),q(t.getUTCFullYear()%100,e,2)}function _i(t,e){return q(t.getUTCFullYear()%1e4,e,4)}function Yi(t,e){var n=t.getUTCDay();return t=n>=4||n===0?It(t):It.ceil(t),q(t.getUTCFullYear()%1e4,e,4)}function Fi(){return"+0000"}function je(){return"%"}function Qe(t){return+t}function Je(t){return Math.floor(+t/1e3)}var St,ie;Ui({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Ui(t){return St=Ur(t),ie=St.format,St.parse,St.utcFormat,St.utcParse,St}function Ei(t){return new Date(t)}function Ii(t){return t instanceof Date?+t:+new Date(+t)}function _n(t,e,n,r,i,s,a,y,F,S){var w=Jn(),P=w.invert,_=w.domain,Y=S(".%L"),X=S(":%S"),B=S("%I:%M"),v=S("%I %p"),U=S("%a %d"),R=S("%b %d"),E=S("%B"),z=S("%Y");function G(T){return(F(T)4&&(Y+=7),_.add(Y,n));return X.diff(B,"week")+1},y.isoWeekday=function(S){return this.$utils().u(S)?this.day()||7:this.day(this.day()%7?S:S-7)};var F=y.startOf;y.startOf=function(S,w){var P=this.$utils(),_=!!P.u(w)||w;return P.p(S)==="isoweek"?_?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):F.bind(this)(S,w)}}}))})(jt)),jt.exports}var $i=Wi();const Oi=oe($i);var Qt={exports:{}},Hi=Qt.exports,tn;function Ni(){return tn||(tn=1,(function(t,e){(function(n,r){t.exports=r()})(Hi,(function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d/,s=/\d\d/,a=/\d\d?/,y=/\d*[^-_:/,()\s\d]+/,F={},S=function(v){return(v=+v)+(v>68?1900:2e3)},w=function(v){return function(U){this[v]=+U}},P=[/[+-]\d\d:?(\d\d)?|Z/,function(v){(this.zone||(this.zone={})).offset=(function(U){if(!U||U==="Z")return 0;var R=U.match(/([+-]|\d\d)/g),E=60*R[1]+(+R[2]||0);return E===0?0:R[0]==="+"?-E:E})(v)}],_=function(v){var U=F[v];return U&&(U.indexOf?U:U.s.concat(U.f))},Y=function(v,U){var R,E=F.meridiem;if(E){for(var z=1;z<=24;z+=1)if(v.indexOf(E(z,0,U))>-1){R=z>12;break}}else R=v===(U?"pm":"PM");return R},X={A:[y,function(v){this.afternoon=Y(v,!1)}],a:[y,function(v){this.afternoon=Y(v,!0)}],Q:[i,function(v){this.month=3*(v-1)+1}],S:[i,function(v){this.milliseconds=100*+v}],SS:[s,function(v){this.milliseconds=10*+v}],SSS:[/\d{3}/,function(v){this.milliseconds=+v}],s:[a,w("seconds")],ss:[a,w("seconds")],m:[a,w("minutes")],mm:[a,w("minutes")],H:[a,w("hours")],h:[a,w("hours")],HH:[a,w("hours")],hh:[a,w("hours")],D:[a,w("day")],DD:[s,w("day")],Do:[y,function(v){var U=F.ordinal,R=v.match(/\d+/);if(this.day=R[0],U)for(var E=1;E<=31;E+=1)U(E).replace(/\[|\]/g,"")===v&&(this.day=E)}],w:[a,w("week")],ww:[s,w("week")],M:[a,w("month")],MM:[s,w("month")],MMM:[y,function(v){var U=_("months"),R=(_("monthsShort")||U.map((function(E){return E.slice(0,3)}))).indexOf(v)+1;if(R<1)throw new Error;this.month=R%12||R}],MMMM:[y,function(v){var U=_("months").indexOf(v)+1;if(U<1)throw new Error;this.month=U%12||U}],Y:[/[+-]?\d+/,w("year")],YY:[s,function(v){this.year=S(v)}],YYYY:[/\d{4}/,w("year")],Z:P,ZZ:P};function B(v){var U,R;U=v,R=F&&F.formats;for(var E=(v=U.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(x,C,M){var D=M&&M.toUpperCase();return C||R[M]||n[M]||R[D].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(c,g,b){return g||b.slice(1)}))}))).match(r),z=E.length,G=0;G-1)return new Date((I==="X"?1e3:1)*m);var u=B(I)(m),K=u.year,l=u.month,$=u.day,O=u.hours,j=u.minutes,H=u.seconds,J=u.milliseconds,h=u.zone,N=u.week,V=new Date,f=$||(K||l?1:V.getDate()),tt=K||V.getFullYear(),A=0;K&&!l||(A=l>0?l-1:V.getMonth());var Q,Z=O||0,st=j||0,at=H||0,pt=J||0;return h?new Date(Date.UTC(tt,A,f,Z,st,at,pt+60*h.offset*1e3)):o?new Date(Date.UTC(tt,A,f,Z,st,at,pt)):(Q=new Date(tt,A,f,Z,st,at,pt),N&&(Q=W(Q).week(N).toDate()),Q)}catch{return new Date("")}})(T,L,k,R),this.init(),D&&D!==!0&&(this.$L=this.locale(D).$L),M&&T!=this.format(L)&&(this.$d=new Date("")),F={}}else if(L instanceof Array)for(var c=L.length,g=1;g<=c;g+=1){p[1]=L[g-1];var b=R.apply(this,p);if(b.isValid()){this.$d=b.$d,this.$L=b.$L,this.init();break}g===c&&(this.$d=new Date(""))}else z.call(this,G)}}}))})(Qt)),Qt.exports}var Pi=Ni();const Vi=oe(Pi);var Jt={exports:{}},Ri=Jt.exports,en;function zi(){return en||(en=1,(function(t,e){(function(n,r){t.exports=r()})(Ri,(function(){return function(n,r){var i=r.prototype,s=i.format;i.format=function(a){var y=this,F=this.$locale();if(!this.isValid())return s.bind(this)(a);var S=this.$utils(),w=(a||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(P){switch(P){case"Q":return Math.ceil((y.$M+1)/3);case"Do":return F.ordinal(y.$D);case"gggg":return y.weekYear();case"GGGG":return y.isoWeekYear();case"wo":return F.ordinal(y.week(),"W");case"w":case"ww":return S.s(y.week(),P==="w"?1:2,"0");case"W":case"WW":return S.s(y.isoWeek(),P==="W"?1:2,"0");case"k":case"kk":return S.s(String(y.$H===0?24:y.$H),P==="k"?1:2,"0");case"X":return Math.floor(y.$d.getTime()/1e3);case"x":return y.$d.getTime();case"z":return"["+y.offsetName()+"]";case"zzz":return"["+y.offsetName("long")+"]";default:return P}}));return s.bind(this)(w)}}}))})(Jt)),Jt.exports}var qi=zi();const Bi=oe(qi);var Kt={exports:{}},Zi=Kt.exports,nn;function Xi(){return nn||(nn=1,(function(t,e){(function(n,r){t.exports=r()})(Zi,(function(){var n,r,i=1e3,s=6e4,a=36e5,y=864e5,F=31536e6,S=2628e6,w=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,P=/\[([^\]]+)]|YYYY|YY|Y|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS/g,_={years:F,months:S,days:y,hours:a,minutes:s,seconds:i,milliseconds:1,weeks:6048e5},Y=function(T){return T instanceof z},X=function(T,k,p){return new z(T,p,k.$l)},B=function(T){return r.p(T)+"s"},v=function(T){return T<0},U=function(T){return v(T)?Math.ceil(T):Math.floor(T)},R=function(T){return Math.abs(T)},E=function(T,k){return T?v(T)?{negative:!0,format:""+R(T)+k}:{negative:!1,format:""+T+k}:{negative:!1,format:""}},z=(function(){function T(p,L,x){var C=this;if(this.$d={},this.$l=x,p===void 0&&(this.$ms=0,this.parseFromMilliseconds()),L)return X(p*_[B(L)],this);if(typeof p=="number")return this.$ms=p,this.parseFromMilliseconds(),this;if(typeof p=="object")return Object.keys(p).forEach((function(c){C.$d[B(c)]=p[c]})),this.calMilliseconds(),this;if(typeof p=="string"){var M=p.match(w);if(M){var D=M.slice(2).map((function(c){return c!=null?Number(c):0}));return this.$d.years=D[0],this.$d.months=D[1],this.$d.weeks=D[2],this.$d.days=D[3],this.$d.hours=D[4],this.$d.minutes=D[5],this.$d.seconds=D[6],this.calMilliseconds(),this}}return this}var k=T.prototype;return k.calMilliseconds=function(){var p=this;this.$ms=Object.keys(this.$d).reduce((function(L,x){return L+(p.$d[x]||0)*_[x]}),0)},k.parseFromMilliseconds=function(){var p=this.$ms;this.$d.years=U(p/F),p%=F,this.$d.months=U(p/S),p%=S,this.$d.days=U(p/y),p%=y,this.$d.hours=U(p/a),p%=a,this.$d.minutes=U(p/s),p%=s,this.$d.seconds=U(p/i),p%=i,this.$d.milliseconds=p},k.toISOString=function(){var p=E(this.$d.years,"Y"),L=E(this.$d.months,"M"),x=+this.$d.days||0;this.$d.weeks&&(x+=7*this.$d.weeks);var C=E(x,"D"),M=E(this.$d.hours,"H"),D=E(this.$d.minutes,"M"),c=this.$d.seconds||0;this.$d.milliseconds&&(c+=this.$d.milliseconds/1e3,c=Math.round(1e3*c)/1e3);var g=E(c,"S"),b=p.negative||L.negative||C.negative||M.negative||D.negative||g.negative,m=M.format||D.format||g.format?"T":"",I=(b?"-":"")+"P"+p.format+L.format+C.format+m+M.format+D.format+g.format;return I==="P"||I==="-P"?"P0D":I},k.toJSON=function(){return this.toISOString()},k.format=function(p){var L=p||"YYYY-MM-DDTHH:mm:ss",x={Y:this.$d.years,YY:r.s(this.$d.years,2,"0"),YYYY:r.s(this.$d.years,4,"0"),M:this.$d.months,MM:r.s(this.$d.months,2,"0"),D:this.$d.days,DD:r.s(this.$d.days,2,"0"),H:this.$d.hours,HH:r.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:r.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:r.s(this.$d.seconds,2,"0"),SSS:r.s(this.$d.milliseconds,3,"0")};return L.replace(P,(function(C,M){return M||String(x[C])}))},k.as=function(p){return this.$ms/_[B(p)]},k.get=function(p){var L=this.$ms,x=B(p);return x==="milliseconds"?L%=1e3:L=x==="weeks"?U(L/_[x]):this.$d[x],L||0},k.add=function(p,L,x){var C;return C=L?p*_[B(L)]:Y(p)?p.$ms:X(p,this).$ms,X(this.$ms+C*(x?-1:1),this)},k.subtract=function(p,L){return this.add(p,L,!0)},k.locale=function(p){var L=this.clone();return L.$l=p,L},k.clone=function(){return X(this.$ms,this)},k.humanize=function(p){return n().add(this.$ms,"ms").locale(this.$l).fromNow(!p)},k.valueOf=function(){return this.asMilliseconds()},k.milliseconds=function(){return this.get("milliseconds")},k.asMilliseconds=function(){return this.as("milliseconds")},k.seconds=function(){return this.get("seconds")},k.asSeconds=function(){return this.as("seconds")},k.minutes=function(){return this.get("minutes")},k.asMinutes=function(){return this.as("minutes")},k.hours=function(){return this.get("hours")},k.asHours=function(){return this.as("hours")},k.days=function(){return this.get("days")},k.asDays=function(){return this.as("days")},k.weeks=function(){return this.get("weeks")},k.asWeeks=function(){return this.as("weeks")},k.months=function(){return this.get("months")},k.asMonths=function(){return this.as("months")},k.years=function(){return this.get("years")},k.asYears=function(){return this.as("years")},T})(),G=function(T,k,p){return T.add(k.years()*p,"y").add(k.months()*p,"M").add(k.days()*p,"d").add(k.hours()*p,"h").add(k.minutes()*p,"m").add(k.seconds()*p,"s").add(k.milliseconds()*p,"ms")};return function(T,k,p){n=p,r=p().$utils(),p.duration=function(C,M){var D=p.locale();return X(C,{$l:D},M)},p.isDuration=Y;var L=k.prototype.add,x=k.prototype.subtract;k.prototype.add=function(C,M){return Y(C)?G(this,C,1):L.bind(this)(C,M)},k.prototype.subtract=function(C,M){return Y(C)?G(this,C,-1):x.bind(this)(C,M)}}}))})(Kt)),Kt.exports}var Gi=Xi();const ji=oe(Gi);var we=(function(){var t=d(function(D,c,g,b){for(g=g||{},b=D.length;b--;g[D[b]]=c);return g},"o"),e=[6,8,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,33,35,36,38,40],n=[1,26],r=[1,27],i=[1,28],s=[1,29],a=[1,30],y=[1,31],F=[1,32],S=[1,33],w=[1,34],P=[1,9],_=[1,10],Y=[1,11],X=[1,12],B=[1,13],v=[1,14],U=[1,15],R=[1,16],E=[1,19],z=[1,20],G=[1,21],T=[1,22],k=[1,23],p=[1,25],L=[1,35],x={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,start:3,gantt:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,weekday:11,weekday_monday:12,weekday_tuesday:13,weekday_wednesday:14,weekday_thursday:15,weekday_friday:16,weekday_saturday:17,weekday_sunday:18,weekend:19,weekend_friday:20,weekend_saturday:21,dateFormat:22,inclusiveEndDates:23,topAxis:24,axisFormat:25,tickInterval:26,excludes:27,includes:28,todayMarker:29,title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,section:36,clickStatement:37,taskTxt:38,taskData:39,click:40,callbackname:41,callbackargs:42,href:43,clickStatementDebug:44,$accept:0,$end:1},terminals_:{2:"error",4:"gantt",6:"EOF",8:"SPACE",10:"NL",12:"weekday_monday",13:"weekday_tuesday",14:"weekday_wednesday",15:"weekday_thursday",16:"weekday_friday",17:"weekday_saturday",18:"weekday_sunday",20:"weekend_friday",21:"weekend_saturday",22:"dateFormat",23:"inclusiveEndDates",24:"topAxis",25:"axisFormat",26:"tickInterval",27:"excludes",28:"includes",29:"todayMarker",30:"title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"section",38:"taskTxt",39:"taskData",40:"click",41:"callbackname",42:"callbackargs",43:"href"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[19,1],[19,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,2],[37,2],[37,3],[37,3],[37,4],[37,3],[37,4],[37,2],[44,2],[44,3],[44,3],[44,4],[44,3],[44,4],[44,2]],performAction:d(function(c,g,b,m,I,o,W){var u=o.length-1;switch(I){case 1:return o[u-1];case 2:this.$=[];break;case 3:o[u-1].push(o[u]),this.$=o[u-1];break;case 4:case 5:this.$=o[u];break;case 6:case 7:this.$=[];break;case 8:m.setWeekday("monday");break;case 9:m.setWeekday("tuesday");break;case 10:m.setWeekday("wednesday");break;case 11:m.setWeekday("thursday");break;case 12:m.setWeekday("friday");break;case 13:m.setWeekday("saturday");break;case 14:m.setWeekday("sunday");break;case 15:m.setWeekend("friday");break;case 16:m.setWeekend("saturday");break;case 17:m.setDateFormat(o[u].substr(11)),this.$=o[u].substr(11);break;case 18:m.enableInclusiveEndDates(),this.$=o[u].substr(18);break;case 19:m.TopAxis(),this.$=o[u].substr(8);break;case 20:m.setAxisFormat(o[u].substr(11)),this.$=o[u].substr(11);break;case 21:m.setTickInterval(o[u].substr(13)),this.$=o[u].substr(13);break;case 22:m.setExcludes(o[u].substr(9)),this.$=o[u].substr(9);break;case 23:m.setIncludes(o[u].substr(9)),this.$=o[u].substr(9);break;case 24:m.setTodayMarker(o[u].substr(12)),this.$=o[u].substr(12);break;case 27:m.setDiagramTitle(o[u].substr(6)),this.$=o[u].substr(6);break;case 28:this.$=o[u].trim(),m.setAccTitle(this.$);break;case 29:case 30:this.$=o[u].trim(),m.setAccDescription(this.$);break;case 31:m.addSection(o[u].substr(8)),this.$=o[u].substr(8);break;case 33:m.addTask(o[u-1],o[u]),this.$="task";break;case 34:this.$=o[u-1],m.setClickEvent(o[u-1],o[u],null);break;case 35:this.$=o[u-2],m.setClickEvent(o[u-2],o[u-1],o[u]);break;case 36:this.$=o[u-2],m.setClickEvent(o[u-2],o[u-1],null),m.setLink(o[u-2],o[u]);break;case 37:this.$=o[u-3],m.setClickEvent(o[u-3],o[u-2],o[u-1]),m.setLink(o[u-3],o[u]);break;case 38:this.$=o[u-2],m.setClickEvent(o[u-2],o[u],null),m.setLink(o[u-2],o[u-1]);break;case 39:this.$=o[u-3],m.setClickEvent(o[u-3],o[u-1],o[u]),m.setLink(o[u-3],o[u-2]);break;case 40:this.$=o[u-1],m.setLink(o[u-1],o[u]);break;case 41:case 47:this.$=o[u-1]+" "+o[u];break;case 42:case 43:case 45:this.$=o[u-2]+" "+o[u-1]+" "+o[u];break;case 44:case 46:this.$=o[u-3]+" "+o[u-2]+" "+o[u-1]+" "+o[u];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:n,13:r,14:i,15:s,16:a,17:y,18:F,19:18,20:S,21:w,22:P,23:_,24:Y,25:X,26:B,27:v,28:U,29:R,30:E,31:z,33:G,35:T,36:k,37:24,38:p,40:L},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:36,11:17,12:n,13:r,14:i,15:s,16:a,17:y,18:F,19:18,20:S,21:w,22:P,23:_,24:Y,25:X,26:B,27:v,28:U,29:R,30:E,31:z,33:G,35:T,36:k,37:24,38:p,40:L},t(e,[2,5]),t(e,[2,6]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,20]),t(e,[2,21]),t(e,[2,22]),t(e,[2,23]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),t(e,[2,27]),{32:[1,37]},{34:[1,38]},t(e,[2,30]),t(e,[2,31]),t(e,[2,32]),{39:[1,39]},t(e,[2,8]),t(e,[2,9]),t(e,[2,10]),t(e,[2,11]),t(e,[2,12]),t(e,[2,13]),t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),{41:[1,40],43:[1,41]},t(e,[2,4]),t(e,[2,28]),t(e,[2,29]),t(e,[2,33]),t(e,[2,34],{42:[1,42],43:[1,43]}),t(e,[2,40],{41:[1,44]}),t(e,[2,35],{43:[1,45]}),t(e,[2,36]),t(e,[2,38],{42:[1,46]}),t(e,[2,37]),t(e,[2,39])],defaultActions:{},parseError:d(function(c,g){if(g.recoverable)this.trace(c);else{var b=new Error(c);throw b.hash=g,b}},"parseError"),parse:d(function(c){var g=this,b=[0],m=[],I=[null],o=[],W=this.table,u="",K=0,l=0,$=2,O=1,j=o.slice.call(arguments,1),H=Object.create(this.lexer),J={yy:{}};for(var h in this.yy)Object.prototype.hasOwnProperty.call(this.yy,h)&&(J.yy[h]=this.yy[h]);H.setInput(c,J.yy),J.yy.lexer=H,J.yy.parser=this,typeof H.yylloc>"u"&&(H.yylloc={});var N=H.yylloc;o.push(N);var V=H.options&&H.options.ranges;typeof J.yy.parseError=="function"?this.parseError=J.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function f(ot){b.length=b.length-2*ot,I.length=I.length-ot,o.length=o.length-ot}d(f,"popStack");function tt(){var ot;return ot=m.pop()||H.lex()||O,typeof ot!="number"&&(ot instanceof Array&&(m=ot,ot=m.pop()),ot=g.symbols_[ot]||ot),ot}d(tt,"lex");for(var A,Q,Z,st,at={},pt,ut,He,Bt;;){if(Q=b[b.length-1],this.defaultActions[Q]?Z=this.defaultActions[Q]:((A===null||typeof A>"u")&&(A=tt()),Z=W[Q]&&W[Q][A]),typeof Z>"u"||!Z.length||!Z[0]){var ce="";Bt=[];for(pt in W[Q])this.terminals_[pt]&&pt>$&&Bt.push("'"+this.terminals_[pt]+"'");H.showPosition?ce="Parse error on line "+(K+1)+`: `+H.showPosition()+` Expecting `+Bt.join(", ")+", got '"+(this.terminals_[A]||A)+"'":ce="Parse error on line "+(K+1)+": Unexpected "+(A==O?"end of input":"'"+(this.terminals_[A]||A)+"'"),this.parseError(ce,{text:H.match,token:this.terminals_[A]||A,line:H.yylineno,loc:N,expected:Bt})}if(Z[0]instanceof Array&&Z.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Q+", token: "+A);switch(Z[0]){case 1:b.push(A),I.push(H.yytext),o.push(H.yylloc),b.push(Z[1]),A=null,l=H.yyleng,u=H.yytext,K=H.yylineno,N=H.yylloc;break;case 2:if(ut=this.productions_[Z[1]][1],at.$=I[I.length-ut],at._$={first_line:o[o.length-(ut||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(ut||1)].first_column,last_column:o[o.length-1].last_column},V&&(at._$.range=[o[o.length-(ut||1)].range[0],o[o.length-1].range[1]]),st=this.performAction.apply(at,[u,l,K,J.yy,Z[1],I,o].concat(j)),typeof st<"u")return st;ut&&(b=b.slice(0,-1*ut*2),I=I.slice(0,-1*ut),o=o.slice(0,-1*ut)),b.push(this.productions_[Z[1]][0]),I.push(at.$),o.push(at._$),He=W[b[b.length-2]][b[b.length-1]],b.push(He);break;case 3:return!0}}return!0},"parse")},C=(function(){var D={EOF:1,parseError:d(function(g,b){if(this.yy.parser)this.yy.parser.parseError(g,b);else throw new Error(g)},"parseError"),setInput:d(function(c,g){return this.yy=g||this.yy||{},this._input=c,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:d(function(){var c=this._input[0];this.yytext+=c,this.yyleng++,this.offset++,this.match+=c,this.matched+=c;var g=c.match(/(?:\r\n?|\n).*/g);return g?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),c},"input"),unput:d(function(c){var g=c.length,b=c.split(/(?:\r\n?|\n)/g);this._input=c+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-g),this.offset-=g;var m=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),b.length-1&&(this.yylineno-=b.length-1);var I=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:b?(b.length===m.length?this.yylloc.first_column:0)+m[m.length-b.length].length-b[0].length:this.yylloc.first_column-g},this.options.ranges&&(this.yylloc.range=[I[0],I[0]+this.yyleng-g]),this.yyleng=this.yytext.length,this},"unput"),more:d(function(){return this._more=!0,this},"more"),reject:d(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:d(function(c){this.unput(this.match.slice(c))},"less"),pastInput:d(function(){var c=this.matched.substr(0,this.matched.length-this.match.length);return(c.length>20?"...":"")+c.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:d(function(){var c=this.match;return c.length<20&&(c+=this._input.substr(0,20-c.length)),(c.substr(0,20)+(c.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:d(function(){var c=this.pastInput(),g=new Array(c.length+1).join("-");return c+this.upcomingInput()+` diff --git a/apps/kimi-code/dist-web/assets/gitGraphDiagram-IHSO6WYX-B9_pldp9.js b/apps/kimi-code/dist-web/assets/gitGraphDiagram-IHSO6WYX-DsWIcYr0.js similarity index 99% rename from apps/kimi-code/dist-web/assets/gitGraphDiagram-IHSO6WYX-B9_pldp9.js rename to apps/kimi-code/dist-web/assets/gitGraphDiagram-IHSO6WYX-DsWIcYr0.js index e31149b2184..0b4b35f6e9f 100644 --- a/apps/kimi-code/dist-web/assets/gitGraphDiagram-IHSO6WYX-B9_pldp9.js +++ b/apps/kimi-code/dist-web/assets/gitGraphDiagram-IHSO6WYX-DsWIcYr0.js @@ -1,4 +1,4 @@ -import{I as le}from"./chunk-2Q5K7J3B-NzojNxDT.js";import{p as he}from"./chunk-JWPE2WC7-BJMJfnyy.js";import{o as $e,n as fe,s as ge,g as ue,a as ye,b as xe,_ as h,y as J,l as w,d as me,c as q,x as pe,z as be,p as we,k as B,A as ke,B as ve,C as Ce}from"./mermaid.core-WW7RuneT.js";import{p as Ee}from"./cynefin-VYW2F7L2-DI-9Z5R0.js";import"./index-CiHMlsuo.js";import"./_commonjsHelpers-CqkleIqs.js";var m={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},Be=ve.gitGraph,S=h(()=>ke({...Be,...J().gitGraph}),"getConfig"),d=new le(()=>{const e=S(),r=e.mainBranchName,t=e.mainBranchOrder;return{mainBranchName:r,commits:new Map,head:null,branchConfig:new Map([[r,{name:r,order:t}]]),branches:new Map([[r,null]]),currBranch:r,direction:"LR",seq:0,options:{}}});function Y(){return Ce({length:7})}h(Y,"getID");function te(e,r){const t=Object.create(null);return e.reduce((s,o)=>{const i=r(o);return t[i]||(t[i]=!0,s.push(o)),s},[])}h(te,"uniqBy");var Te=h(function(e){d.records.direction=e},"setDirection"),Le=h(function(e){w.debug("options str",e),e=e?.trim(),e=e||"{}";try{d.records.options=JSON.parse(e)}catch(r){w.error("error while parsing gitGraph options",r.message)}},"setOptions"),Me=h(function(){return d.records.options},"getOptions"),Re=h(function(e){let r=e.msg,t=e.id;const s=e.type;let o=e.tags;w.info("commit",r,t,s,o),w.debug("Entering commit:",r,t,s,o);const i=S();t=B.sanitizeText(t,i),r=B.sanitizeText(r,i),o=o?.map(a=>B.sanitizeText(a,i));const n={id:t||d.records.seq+"-"+Y(),message:r,seq:d.records.seq++,type:s??m.NORMAL,tags:o??[],parents:d.records.head==null?[]:[d.records.head.id],branch:d.records.currBranch};d.records.head=n,w.info("main branch",i.mainBranchName),d.records.commits.has(n.id)&&w.warn(`Commit ID ${n.id} already exists`),d.records.commits.set(n.id,n),d.records.branches.set(d.records.currBranch,n.id),w.debug("in pushCommit "+n.id)},"commit"),Ie=h(function(e){let r=e.name;const t=e.order;if(r=B.sanitizeText(r,S()),d.records.branches.has(r))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${r}")`);d.records.branches.set(r,d.records.head!=null?d.records.head.id:null),d.records.branchConfig.set(r,{name:r,order:t}),ae(r),w.debug("in createBranch")},"branch"),Oe=h(e=>{let r=e.branch,t=e.id;const s=e.type,o=e.tags,i=S();r=B.sanitizeText(r,i),t&&(t=B.sanitizeText(t,i));const n=d.records.branches.get(d.records.currBranch),a=d.records.branches.get(r),l=n?d.records.commits.get(n):void 0,f=a?d.records.commits.get(a):void 0;if(l&&f&&l.branch===r)throw new Error(`Cannot merge branch '${r}' into itself.`);if(d.records.currBranch===r){const c=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(l===void 0||!l){const c=new Error(`Incorrect usage of "merge". Current branch (${d.records.currBranch})has no commits`);throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["commit"]},c}if(!d.records.branches.has(r)){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") does not exist");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:[`branch ${r}`]},c}if(f===void 0||!f){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") has no commits");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:['"commit"']},c}if(l===f){const c=new Error('Incorrect usage of "merge". Both branches have same head');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(t&&d.records.commits.has(t)){const c=new Error('Incorrect usage of "merge". Commit with id:'+t+" already exists, use different custom id");throw c.hash={text:`merge ${r} ${t} ${s} ${o?.join(" ")}`,token:`merge ${r} ${t} ${s} ${o?.join(" ")}`,expected:[`merge ${r} ${t}_UNIQUE ${s} ${o?.join(" ")}`]},c}const g=a||"",$={id:t||`${d.records.seq}-${Y()}`,message:`merged branch ${r} into ${d.records.currBranch}`,seq:d.records.seq++,parents:d.records.head==null?[]:[d.records.head.id,g],branch:d.records.currBranch,type:m.MERGE,customType:s,customId:!!t,tags:o??[]};d.records.head=$,d.records.commits.set($.id,$),d.records.branches.set(d.records.currBranch,$.id),w.debug(d.records.branches),w.debug("in mergeBranch")},"merge"),_e=h(function(e){let r=e.id,t=e.targetId,s=e.tags,o=e.parent;w.debug("Entering cherryPick:",r,t,s);const i=S();if(r=B.sanitizeText(r,i),t=B.sanitizeText(t,i),s=s?.map(l=>B.sanitizeText(l,i)),o=B.sanitizeText(o,i),!r||!d.records.commits.has(r)){const l=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw l.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},l}const n=d.records.commits.get(r);if(n===void 0||!n)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(o&&!(Array.isArray(n.parents)&&n.parents.includes(o)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const a=n.branch;if(n.type===m.MERGE&&!o)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!t||!d.records.commits.has(t)){if(a===d.records.currBranch){const $=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const l=d.records.branches.get(d.records.currBranch);if(l===void 0||!l){const $=new Error(`Incorrect usage of "cherry-pick". Current branch (${d.records.currBranch})has no commits`);throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const f=d.records.commits.get(l);if(f===void 0||!f){const $=new Error(`Incorrect usage of "cherry-pick". Current branch (${d.records.currBranch})has no commits`);throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const g={id:d.records.seq+"-"+Y(),message:`cherry-picked ${n?.message} into ${d.records.currBranch}`,seq:d.records.seq++,parents:d.records.head==null?[]:[d.records.head.id,n.id],branch:d.records.currBranch,type:m.CHERRY_PICK,tags:s?s.filter(Boolean):[`cherry-pick:${n.id}${n.type===m.MERGE?`|parent:${o}`:""}`]};d.records.head=g,d.records.commits.set(g.id,g),d.records.branches.set(d.records.currBranch,g.id),w.debug(d.records.branches),w.debug("in cherryPick")}},"cherryPick"),ae=h(function(e){if(e=B.sanitizeText(e,S()),d.records.branches.has(e)){d.records.currBranch=e;const r=d.records.branches.get(d.records.currBranch);r===void 0||!r?d.records.head=null:d.records.head=d.records.commits.get(r)??null}else{const r=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${e}")`);throw r.hash={text:`checkout ${e}`,token:`checkout ${e}`,expected:[`branch ${e}`]},r}},"checkout");function V(e,r,t){const s=e.indexOf(r);s===-1?e.push(t):e.splice(s,1,t)}h(V,"upsert");function Q(e){const r=e.reduce((o,i)=>o.seq>i.seq?o:i,e[0]);let t="";e.forEach(function(o){o===r?t+=" *":t+=" |"});const s=[t,r.id,r.seq];for(const o in d.records.branches)d.records.branches.get(o)===r.id&&s.push(o);if(w.debug(s.join(" ")),r.parents&&r.parents.length==2&&r.parents[0]&&r.parents[1]){const o=d.records.commits.get(r.parents[0]);V(e,r,o),r.parents[1]&&e.push(d.records.commits.get(r.parents[1]))}else{if(r.parents.length==0)return;if(r.parents[0]){const o=d.records.commits.get(r.parents[0]);V(e,r,o)}}e=te(e,o=>o.id),Q(e)}h(Q,"prettyPrintCommitHistory");var Ge=h(function(){w.debug(d.records.commits);const e=ne()[0];Q([e])},"prettyPrint"),He=h(function(){d.reset(),we()},"clear"),Se=h(function(){return[...d.records.branchConfig.values()].map((r,t)=>r.order!==null&&r.order!==void 0?r:{...r,order:parseFloat(`0.${t}`)}).sort((r,t)=>(r.order??0)-(t.order??0)).map(({name:r})=>({name:r}))},"getBranchesAsObjArray"),Ae=h(function(){return d.records.branches},"getBranches"),De=h(function(){return d.records.commits},"getCommits"),ne=h(function(){const e=[...d.records.commits.values()];return e.forEach(function(r){w.debug(r.id)}),e.sort((r,t)=>r.seq-t.seq),e},"getCommitsArray"),Pe=h(function(){return d.records.currBranch},"getCurrentBranch"),We=h(function(){return d.records.direction},"getDirection"),qe=h(function(){return d.records.head},"getHead"),se={commitType:m,getConfig:S,setDirection:Te,setOptions:Le,getOptions:Me,commit:Re,branch:Ie,merge:Oe,cherryPick:_e,checkout:ae,prettyPrint:Ge,clear:He,getBranchesAsObjArray:Se,getBranches:Ae,getCommits:De,getCommitsArray:ne,getCurrentBranch:Pe,getDirection:We,getHead:qe,setAccTitle:xe,getAccTitle:ye,getAccDescription:ue,setAccDescription:ge,setDiagramTitle:fe,getDiagramTitle:$e},Ne=h((e,r)=>{he(e,r),e.dir&&r.setDirection(e.dir);for(const t of e.statements)Fe(t,r)},"populate"),Fe=h((e,r)=>{const s={Commit:h(o=>r.commit(ze(o)),"Commit"),Branch:h(o=>r.branch(Ye(o)),"Branch"),Merge:h(o=>r.merge(je(o)),"Merge"),Checkout:h(o=>r.checkout(Ue(o)),"Checkout"),CherryPicking:h(o=>r.cherryPick(Ke(o)),"CherryPicking")}[e.$type];s?s(e):w.error(`Unknown statement type: ${e.$type}`)},"parseStatement"),ze=h(e=>({id:e.id,msg:e.message??"",type:e.type!==void 0?m[e.type]:m.NORMAL,tags:e.tags??void 0}),"parseCommit"),Ye=h(e=>({name:e.name,order:e.order??0}),"parseBranch"),je=h(e=>({branch:e.branch,id:e.id??"",type:e.type!==void 0?m[e.type]:void 0,tags:e.tags??void 0}),"parseMerge"),Ue=h(e=>e.branch,"parseCheckout"),Ke=h(e=>({id:e.id,targetId:"",tags:e.tags?.length===0?void 0:e.tags,parent:e.parent}),"parseCherryPicking"),Ve={parse:h(async e=>{const r=await Ee("gitGraph",e);w.debug(r),Ne(r,se)},"parse")},O=10,_=40,L=4,R=2,G=8,j=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),X=12,Z=new Set(["redux-color","redux-dark-color"]),Xe=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),H=h((e,r,t=!1)=>t&&e>0?(e-1)%(r-1)+1:e%r,"calcColorIndex"),C=new Map,E=new Map,F=30,P=new Map,z=[],I=0,y="LR",Je=h(()=>{C.clear(),E.clear(),P.clear(),I=0,z=[],y="LR"},"clear"),oe=h(e=>{const r=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof e=="string"?e.split(/\\n|\n|/gi):e).forEach(s=>{const o=document.createElementNS("http://www.w3.org/2000/svg","tspan");o.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),o.setAttribute("dy","1em"),o.setAttribute("x","0"),o.setAttribute("class","row"),o.textContent=s.trim(),r.appendChild(o)}),r},"drawText"),ce=h(e=>{let r,t,s;return y==="BT"?(t=h((o,i)=>o<=i,"comparisonFunc"),s=1/0):(t=h((o,i)=>o>=i,"comparisonFunc"),s=0),e.forEach(o=>{const i=y==="TB"||y=="BT"?E.get(o)?.y:E.get(o)?.x;i!==void 0&&t(i,s)&&(r=o,s=i)}),r},"findClosestParent"),Qe=h(e=>{let r="",t=1/0;return e.forEach(s=>{const o=E.get(s).y;o<=t&&(r=s,t=o)}),r||void 0},"findClosestParentBT"),Ze=h((e,r,t)=>{let s=t,o=t;const i=[];e.forEach(n=>{const a=r.get(n);if(!a)throw new Error(`Commit not found for key ${n}`);a.parents.length?(s=rr(a),o=Math.max(s,o)):i.push(a),tr(a,s)}),s=o,i.forEach(n=>{ar(n,s,t)}),e.forEach(n=>{const a=r.get(n);if(a?.parents.length){const l=Qe(a.parents);s=E.get(l).y-_,s<=o&&(o=s);const f=C.get(a.branch).pos,g=s-O;E.set(a.id,{x:f,y:g})}})},"setParallelBTPos"),er=h(e=>{const r=ce(e.parents.filter(s=>s!==null));if(!r)throw new Error(`Closest parent not found for commit ${e.id}`);const t=E.get(r)?.y;if(t===void 0)throw new Error(`Closest parent position not found for commit ${e.id}`);return t},"findClosestParentPos"),rr=h(e=>er(e)+_,"calculateCommitPosition"),tr=h((e,r)=>{const t=C.get(e.branch);if(!t)throw new Error(`Branch not found for commit ${e.id}`);const s=t.pos,o=r+O;return E.set(e.id,{x:s,y:o}),{x:s,y:o}},"setCommitPosition"),ar=h((e,r,t)=>{const s=C.get(e.branch);if(!s)throw new Error(`Branch not found for commit ${e.id}`);const o=r+t,i=s.pos;E.set(e.id,{x:i,y:o})},"setRootPosition"),nr=h((e,r,t,s,o,i)=>{const{theme:n}=q(),a=j.has(n??""),l=Z.has(n??""),f=Xe.has(n??"");if(i===m.HIGHLIGHT)e.append("rect").attr("x",t.x-10+(a?3:0)).attr("y",t.y-10+(a?3:0)).attr("width",a?14:20).attr("height",a?14:20).attr("class",`commit ${r.id} commit-highlight${H(o,G,l)} ${s}-outer`),e.append("rect").attr("x",t.x-6+(a?2:0)).attr("y",t.y-6+(a?2:0)).attr("width",a?8:12).attr("height",a?8:12).attr("class",`commit ${r.id} commit${H(o,G,l)} ${s}-inner`);else if(i===m.CHERRY_PICK)e.append("circle").attr("cx",t.x).attr("cy",t.y).attr("r",a?7:10).attr("class",`commit ${r.id} ${s}`),e.append("circle").attr("cx",t.x-3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("circle").attr("cx",t.x+3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("line").attr("x1",t.x+3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("line").attr("x1",t.x-3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`);else{const g=e.append("circle");if(g.attr("cx",t.x),g.attr("cy",t.y),g.attr("r",a?7:10),g.attr("class",`commit ${r.id} commit${H(o,G,l)}`),i===m.MERGE){const $=e.append("circle");$.attr("cx",t.x),$.attr("cy",t.y),$.attr("r",a?5:6),$.attr("class",`commit ${s} ${r.id} commit${H(o,G,l)}`)}if(i===m.REVERSE){const $=e.append("path"),c=a?4:5;$.attr("d",`M ${t.x-c},${t.y-c}L${t.x+c},${t.y+c}M${t.x-c},${t.y+c}L${t.x+c},${t.y-c}`).attr("class",`commit ${s} ${r.id} commit${H(o,G,l)}`)}}},"drawCommitBullet"),sr=h((e,r,t,s,o)=>{if(r.type!==m.CHERRY_PICK&&(r.customId&&r.type===m.MERGE||r.type!==m.MERGE)&&o.showCommitLabel){const i=e.append("g"),n=i.insert("rect").attr("class","commit-label-bkg"),a=i.append("text").attr("x",s).attr("y",t.y+25).attr("class","commit-label").text(r.id),l=a.node()?.getBBox();if(l&&(n.attr("x",t.posWithOffset-l.width/2-R).attr("y",t.y+13.5).attr("width",l.width+2*R).attr("height",l.height+2*R),y==="TB"||y==="BT"?(n.attr("x",t.x-(l.width+4*L+5)).attr("y",t.y-12),a.attr("x",t.x-(l.width+4*L)).attr("y",t.y+l.height-12)):a.attr("x",t.posWithOffset-l.width/2),o.rotateCommitLabel))if(y==="TB"||y==="BT")a.attr("transform","rotate(-45, "+t.x+", "+t.y+")"),n.attr("transform","rotate(-45, "+t.x+", "+t.y+")");else{const f=-7.5-(l.width+10)/25*9.5,g=10+l.width/25*8.5;i.attr("transform","translate("+f+", "+g+") rotate(-45, "+s+", "+t.y+")")}}},"drawCommitLabel"),or=h((e,r,t,s)=>{if(r.tags.length>0){let o=0,i=0,n=0;const a=[];for(const l of r.tags.reverse()){const f=e.insert("polygon"),g=e.append("circle"),$=e.append("text").attr("y",t.y-16-o).attr("class","tag-label").text(l),c=$.node()?.getBBox();if(!c)throw new Error("Tag bbox not found");i=Math.max(i,c.width),n=Math.max(n,c.height),$.attr("x",t.posWithOffset-c.width/2),a.push({tag:$,hole:g,rect:f,yOffset:o}),o+=20}for(const{tag:l,hole:f,rect:g,yOffset:$}of a){const c=n/2,x=t.y-19.2-$;if(g.attr("class","tag-label-bkg").attr("points",` +import{I as le}from"./chunk-2Q5K7J3B-Ba9Nj6dt.js";import{p as he}from"./chunk-JWPE2WC7-CI-VQAzP.js";import{o as $e,n as fe,s as ge,g as ue,a as ye,b as xe,_ as h,y as J,l as w,d as me,c as q,x as pe,z as be,p as we,k as B,A as ke,B as ve,C as Ce}from"./mermaid.core-mH2pk-lc.js";import{p as Ee}from"./cynefin-VYW2F7L2-BD8Xugtm.js";import"./index-BIElaaEN.js";import"./_commonjsHelpers-CqkleIqs.js";var m={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},Be=ve.gitGraph,S=h(()=>ke({...Be,...J().gitGraph}),"getConfig"),d=new le(()=>{const e=S(),r=e.mainBranchName,t=e.mainBranchOrder;return{mainBranchName:r,commits:new Map,head:null,branchConfig:new Map([[r,{name:r,order:t}]]),branches:new Map([[r,null]]),currBranch:r,direction:"LR",seq:0,options:{}}});function Y(){return Ce({length:7})}h(Y,"getID");function te(e,r){const t=Object.create(null);return e.reduce((s,o)=>{const i=r(o);return t[i]||(t[i]=!0,s.push(o)),s},[])}h(te,"uniqBy");var Te=h(function(e){d.records.direction=e},"setDirection"),Le=h(function(e){w.debug("options str",e),e=e?.trim(),e=e||"{}";try{d.records.options=JSON.parse(e)}catch(r){w.error("error while parsing gitGraph options",r.message)}},"setOptions"),Me=h(function(){return d.records.options},"getOptions"),Re=h(function(e){let r=e.msg,t=e.id;const s=e.type;let o=e.tags;w.info("commit",r,t,s,o),w.debug("Entering commit:",r,t,s,o);const i=S();t=B.sanitizeText(t,i),r=B.sanitizeText(r,i),o=o?.map(a=>B.sanitizeText(a,i));const n={id:t||d.records.seq+"-"+Y(),message:r,seq:d.records.seq++,type:s??m.NORMAL,tags:o??[],parents:d.records.head==null?[]:[d.records.head.id],branch:d.records.currBranch};d.records.head=n,w.info("main branch",i.mainBranchName),d.records.commits.has(n.id)&&w.warn(`Commit ID ${n.id} already exists`),d.records.commits.set(n.id,n),d.records.branches.set(d.records.currBranch,n.id),w.debug("in pushCommit "+n.id)},"commit"),Ie=h(function(e){let r=e.name;const t=e.order;if(r=B.sanitizeText(r,S()),d.records.branches.has(r))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${r}")`);d.records.branches.set(r,d.records.head!=null?d.records.head.id:null),d.records.branchConfig.set(r,{name:r,order:t}),ae(r),w.debug("in createBranch")},"branch"),Oe=h(e=>{let r=e.branch,t=e.id;const s=e.type,o=e.tags,i=S();r=B.sanitizeText(r,i),t&&(t=B.sanitizeText(t,i));const n=d.records.branches.get(d.records.currBranch),a=d.records.branches.get(r),l=n?d.records.commits.get(n):void 0,f=a?d.records.commits.get(a):void 0;if(l&&f&&l.branch===r)throw new Error(`Cannot merge branch '${r}' into itself.`);if(d.records.currBranch===r){const c=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(l===void 0||!l){const c=new Error(`Incorrect usage of "merge". Current branch (${d.records.currBranch})has no commits`);throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["commit"]},c}if(!d.records.branches.has(r)){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") does not exist");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:[`branch ${r}`]},c}if(f===void 0||!f){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") has no commits");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:['"commit"']},c}if(l===f){const c=new Error('Incorrect usage of "merge". Both branches have same head');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(t&&d.records.commits.has(t)){const c=new Error('Incorrect usage of "merge". Commit with id:'+t+" already exists, use different custom id");throw c.hash={text:`merge ${r} ${t} ${s} ${o?.join(" ")}`,token:`merge ${r} ${t} ${s} ${o?.join(" ")}`,expected:[`merge ${r} ${t}_UNIQUE ${s} ${o?.join(" ")}`]},c}const g=a||"",$={id:t||`${d.records.seq}-${Y()}`,message:`merged branch ${r} into ${d.records.currBranch}`,seq:d.records.seq++,parents:d.records.head==null?[]:[d.records.head.id,g],branch:d.records.currBranch,type:m.MERGE,customType:s,customId:!!t,tags:o??[]};d.records.head=$,d.records.commits.set($.id,$),d.records.branches.set(d.records.currBranch,$.id),w.debug(d.records.branches),w.debug("in mergeBranch")},"merge"),_e=h(function(e){let r=e.id,t=e.targetId,s=e.tags,o=e.parent;w.debug("Entering cherryPick:",r,t,s);const i=S();if(r=B.sanitizeText(r,i),t=B.sanitizeText(t,i),s=s?.map(l=>B.sanitizeText(l,i)),o=B.sanitizeText(o,i),!r||!d.records.commits.has(r)){const l=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw l.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},l}const n=d.records.commits.get(r);if(n===void 0||!n)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(o&&!(Array.isArray(n.parents)&&n.parents.includes(o)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const a=n.branch;if(n.type===m.MERGE&&!o)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!t||!d.records.commits.has(t)){if(a===d.records.currBranch){const $=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const l=d.records.branches.get(d.records.currBranch);if(l===void 0||!l){const $=new Error(`Incorrect usage of "cherry-pick". Current branch (${d.records.currBranch})has no commits`);throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const f=d.records.commits.get(l);if(f===void 0||!f){const $=new Error(`Incorrect usage of "cherry-pick". Current branch (${d.records.currBranch})has no commits`);throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const g={id:d.records.seq+"-"+Y(),message:`cherry-picked ${n?.message} into ${d.records.currBranch}`,seq:d.records.seq++,parents:d.records.head==null?[]:[d.records.head.id,n.id],branch:d.records.currBranch,type:m.CHERRY_PICK,tags:s?s.filter(Boolean):[`cherry-pick:${n.id}${n.type===m.MERGE?`|parent:${o}`:""}`]};d.records.head=g,d.records.commits.set(g.id,g),d.records.branches.set(d.records.currBranch,g.id),w.debug(d.records.branches),w.debug("in cherryPick")}},"cherryPick"),ae=h(function(e){if(e=B.sanitizeText(e,S()),d.records.branches.has(e)){d.records.currBranch=e;const r=d.records.branches.get(d.records.currBranch);r===void 0||!r?d.records.head=null:d.records.head=d.records.commits.get(r)??null}else{const r=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${e}")`);throw r.hash={text:`checkout ${e}`,token:`checkout ${e}`,expected:[`branch ${e}`]},r}},"checkout");function V(e,r,t){const s=e.indexOf(r);s===-1?e.push(t):e.splice(s,1,t)}h(V,"upsert");function Q(e){const r=e.reduce((o,i)=>o.seq>i.seq?o:i,e[0]);let t="";e.forEach(function(o){o===r?t+=" *":t+=" |"});const s=[t,r.id,r.seq];for(const o in d.records.branches)d.records.branches.get(o)===r.id&&s.push(o);if(w.debug(s.join(" ")),r.parents&&r.parents.length==2&&r.parents[0]&&r.parents[1]){const o=d.records.commits.get(r.parents[0]);V(e,r,o),r.parents[1]&&e.push(d.records.commits.get(r.parents[1]))}else{if(r.parents.length==0)return;if(r.parents[0]){const o=d.records.commits.get(r.parents[0]);V(e,r,o)}}e=te(e,o=>o.id),Q(e)}h(Q,"prettyPrintCommitHistory");var Ge=h(function(){w.debug(d.records.commits);const e=ne()[0];Q([e])},"prettyPrint"),He=h(function(){d.reset(),we()},"clear"),Se=h(function(){return[...d.records.branchConfig.values()].map((r,t)=>r.order!==null&&r.order!==void 0?r:{...r,order:parseFloat(`0.${t}`)}).sort((r,t)=>(r.order??0)-(t.order??0)).map(({name:r})=>({name:r}))},"getBranchesAsObjArray"),Ae=h(function(){return d.records.branches},"getBranches"),De=h(function(){return d.records.commits},"getCommits"),ne=h(function(){const e=[...d.records.commits.values()];return e.forEach(function(r){w.debug(r.id)}),e.sort((r,t)=>r.seq-t.seq),e},"getCommitsArray"),Pe=h(function(){return d.records.currBranch},"getCurrentBranch"),We=h(function(){return d.records.direction},"getDirection"),qe=h(function(){return d.records.head},"getHead"),se={commitType:m,getConfig:S,setDirection:Te,setOptions:Le,getOptions:Me,commit:Re,branch:Ie,merge:Oe,cherryPick:_e,checkout:ae,prettyPrint:Ge,clear:He,getBranchesAsObjArray:Se,getBranches:Ae,getCommits:De,getCommitsArray:ne,getCurrentBranch:Pe,getDirection:We,getHead:qe,setAccTitle:xe,getAccTitle:ye,getAccDescription:ue,setAccDescription:ge,setDiagramTitle:fe,getDiagramTitle:$e},Ne=h((e,r)=>{he(e,r),e.dir&&r.setDirection(e.dir);for(const t of e.statements)Fe(t,r)},"populate"),Fe=h((e,r)=>{const s={Commit:h(o=>r.commit(ze(o)),"Commit"),Branch:h(o=>r.branch(Ye(o)),"Branch"),Merge:h(o=>r.merge(je(o)),"Merge"),Checkout:h(o=>r.checkout(Ue(o)),"Checkout"),CherryPicking:h(o=>r.cherryPick(Ke(o)),"CherryPicking")}[e.$type];s?s(e):w.error(`Unknown statement type: ${e.$type}`)},"parseStatement"),ze=h(e=>({id:e.id,msg:e.message??"",type:e.type!==void 0?m[e.type]:m.NORMAL,tags:e.tags??void 0}),"parseCommit"),Ye=h(e=>({name:e.name,order:e.order??0}),"parseBranch"),je=h(e=>({branch:e.branch,id:e.id??"",type:e.type!==void 0?m[e.type]:void 0,tags:e.tags??void 0}),"parseMerge"),Ue=h(e=>e.branch,"parseCheckout"),Ke=h(e=>({id:e.id,targetId:"",tags:e.tags?.length===0?void 0:e.tags,parent:e.parent}),"parseCherryPicking"),Ve={parse:h(async e=>{const r=await Ee("gitGraph",e);w.debug(r),Ne(r,se)},"parse")},O=10,_=40,L=4,R=2,G=8,j=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),X=12,Z=new Set(["redux-color","redux-dark-color"]),Xe=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),H=h((e,r,t=!1)=>t&&e>0?(e-1)%(r-1)+1:e%r,"calcColorIndex"),C=new Map,E=new Map,F=30,P=new Map,z=[],I=0,y="LR",Je=h(()=>{C.clear(),E.clear(),P.clear(),I=0,z=[],y="LR"},"clear"),oe=h(e=>{const r=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof e=="string"?e.split(/\\n|\n|/gi):e).forEach(s=>{const o=document.createElementNS("http://www.w3.org/2000/svg","tspan");o.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),o.setAttribute("dy","1em"),o.setAttribute("x","0"),o.setAttribute("class","row"),o.textContent=s.trim(),r.appendChild(o)}),r},"drawText"),ce=h(e=>{let r,t,s;return y==="BT"?(t=h((o,i)=>o<=i,"comparisonFunc"),s=1/0):(t=h((o,i)=>o>=i,"comparisonFunc"),s=0),e.forEach(o=>{const i=y==="TB"||y=="BT"?E.get(o)?.y:E.get(o)?.x;i!==void 0&&t(i,s)&&(r=o,s=i)}),r},"findClosestParent"),Qe=h(e=>{let r="",t=1/0;return e.forEach(s=>{const o=E.get(s).y;o<=t&&(r=s,t=o)}),r||void 0},"findClosestParentBT"),Ze=h((e,r,t)=>{let s=t,o=t;const i=[];e.forEach(n=>{const a=r.get(n);if(!a)throw new Error(`Commit not found for key ${n}`);a.parents.length?(s=rr(a),o=Math.max(s,o)):i.push(a),tr(a,s)}),s=o,i.forEach(n=>{ar(n,s,t)}),e.forEach(n=>{const a=r.get(n);if(a?.parents.length){const l=Qe(a.parents);s=E.get(l).y-_,s<=o&&(o=s);const f=C.get(a.branch).pos,g=s-O;E.set(a.id,{x:f,y:g})}})},"setParallelBTPos"),er=h(e=>{const r=ce(e.parents.filter(s=>s!==null));if(!r)throw new Error(`Closest parent not found for commit ${e.id}`);const t=E.get(r)?.y;if(t===void 0)throw new Error(`Closest parent position not found for commit ${e.id}`);return t},"findClosestParentPos"),rr=h(e=>er(e)+_,"calculateCommitPosition"),tr=h((e,r)=>{const t=C.get(e.branch);if(!t)throw new Error(`Branch not found for commit ${e.id}`);const s=t.pos,o=r+O;return E.set(e.id,{x:s,y:o}),{x:s,y:o}},"setCommitPosition"),ar=h((e,r,t)=>{const s=C.get(e.branch);if(!s)throw new Error(`Branch not found for commit ${e.id}`);const o=r+t,i=s.pos;E.set(e.id,{x:i,y:o})},"setRootPosition"),nr=h((e,r,t,s,o,i)=>{const{theme:n}=q(),a=j.has(n??""),l=Z.has(n??""),f=Xe.has(n??"");if(i===m.HIGHLIGHT)e.append("rect").attr("x",t.x-10+(a?3:0)).attr("y",t.y-10+(a?3:0)).attr("width",a?14:20).attr("height",a?14:20).attr("class",`commit ${r.id} commit-highlight${H(o,G,l)} ${s}-outer`),e.append("rect").attr("x",t.x-6+(a?2:0)).attr("y",t.y-6+(a?2:0)).attr("width",a?8:12).attr("height",a?8:12).attr("class",`commit ${r.id} commit${H(o,G,l)} ${s}-inner`);else if(i===m.CHERRY_PICK)e.append("circle").attr("cx",t.x).attr("cy",t.y).attr("r",a?7:10).attr("class",`commit ${r.id} ${s}`),e.append("circle").attr("cx",t.x-3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("circle").attr("cx",t.x+3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("line").attr("x1",t.x+3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("line").attr("x1",t.x-3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`);else{const g=e.append("circle");if(g.attr("cx",t.x),g.attr("cy",t.y),g.attr("r",a?7:10),g.attr("class",`commit ${r.id} commit${H(o,G,l)}`),i===m.MERGE){const $=e.append("circle");$.attr("cx",t.x),$.attr("cy",t.y),$.attr("r",a?5:6),$.attr("class",`commit ${s} ${r.id} commit${H(o,G,l)}`)}if(i===m.REVERSE){const $=e.append("path"),c=a?4:5;$.attr("d",`M ${t.x-c},${t.y-c}L${t.x+c},${t.y+c}M${t.x-c},${t.y+c}L${t.x+c},${t.y-c}`).attr("class",`commit ${s} ${r.id} commit${H(o,G,l)}`)}}},"drawCommitBullet"),sr=h((e,r,t,s,o)=>{if(r.type!==m.CHERRY_PICK&&(r.customId&&r.type===m.MERGE||r.type!==m.MERGE)&&o.showCommitLabel){const i=e.append("g"),n=i.insert("rect").attr("class","commit-label-bkg"),a=i.append("text").attr("x",s).attr("y",t.y+25).attr("class","commit-label").text(r.id),l=a.node()?.getBBox();if(l&&(n.attr("x",t.posWithOffset-l.width/2-R).attr("y",t.y+13.5).attr("width",l.width+2*R).attr("height",l.height+2*R),y==="TB"||y==="BT"?(n.attr("x",t.x-(l.width+4*L+5)).attr("y",t.y-12),a.attr("x",t.x-(l.width+4*L)).attr("y",t.y+l.height-12)):a.attr("x",t.posWithOffset-l.width/2),o.rotateCommitLabel))if(y==="TB"||y==="BT")a.attr("transform","rotate(-45, "+t.x+", "+t.y+")"),n.attr("transform","rotate(-45, "+t.x+", "+t.y+")");else{const f=-7.5-(l.width+10)/25*9.5,g=10+l.width/25*8.5;i.attr("transform","translate("+f+", "+g+") rotate(-45, "+s+", "+t.y+")")}}},"drawCommitLabel"),or=h((e,r,t,s)=>{if(r.tags.length>0){let o=0,i=0,n=0;const a=[];for(const l of r.tags.reverse()){const f=e.insert("polygon"),g=e.append("circle"),$=e.append("text").attr("y",t.y-16-o).attr("class","tag-label").text(l),c=$.node()?.getBBox();if(!c)throw new Error("Tag bbox not found");i=Math.max(i,c.width),n=Math.max(n,c.height),$.attr("x",t.posWithOffset-c.width/2),a.push({tag:$,hole:g,rect:f,yOffset:o}),o+=20}for(const{tag:l,hole:f,rect:g,yOffset:$}of a){const c=n/2,x=t.y-19.2-$;if(g.attr("class","tag-label-bkg").attr("points",` ${s-i/2-L/2},${x+R} ${s-i/2-L/2},${x-R} ${t.posWithOffset-i/2-L},${x-c-R} diff --git a/apps/kimi-code/dist-web/assets/index-BIElaaEN.js b/apps/kimi-code/dist-web/assets/index-BIElaaEN.js new file mode 100644 index 00000000000..8ff3c885491 --- /dev/null +++ b/apps/kimi-code/dist-web/assets/index-BIElaaEN.js @@ -0,0 +1,828 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mhchem-DtR62fUK.js","assets/katex-DnlPpQZa.js","assets/mermaid.core-mH2pk-lc.js","assets/_commonjsHelpers-CqkleIqs.js","assets/CodeBlockNode-nOFvAmOq.js","assets/safeRaf-DGuzXxDK.js","assets/index5-BWZLeih7.js","assets/index11-DknOc_PX.js","assets/rive-CeXCFBdn.js"])))=>i.map(i=>d[i]); +(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const r of s.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&i(r)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();/** +* @vue/shared v3.5.39 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/function dw(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const fi={},bm=[],Xl=()=>{},iz=()=>!1,U2=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),fw=e=>e.startsWith("onUpdate:"),Ki=Object.assign,zx=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},$X=Object.prototype.hasOwnProperty,Ei=(e,t)=>$X.call(e,t),_n=Array.isArray,wm=e=>pg(e)==="[object Map]",o1=e=>pg(e)==="[object Set]",CT=e=>pg(e)==="[object Date]",zX=e=>pg(e)==="[object RegExp]",Bn=e=>typeof e=="function",Ji=e=>typeof e=="string",bl=e=>typeof e=="symbol",Fi=e=>e!==null&&typeof e=="object",jx=e=>(Fi(e)||Bn(e))&&Bn(e.then)&&Bn(e.catch),oz=Object.prototype.toString,pg=e=>oz.call(e),jX=e=>pg(e).slice(8,-1),hw=e=>pg(e)==="[object Object]",pw=e=>Ji(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Sp=dw(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),mw=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},HX=/-\w/g,Bs=mw(e=>e.replace(HX,t=>t.slice(1).toUpperCase())),WX=/\B([A-Z])/g,Ra=mw(e=>e.replace(WX,"-$1").toLowerCase()),gw=mw(e=>e.charAt(0).toUpperCase()+e.slice(1)),fk=mw(e=>e?`on${gw(e)}`:""),Zs=(e,t)=>!Object.is(e,t),Am=(e,...t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:i,value:n})},vw=e=>{const t=parseFloat(e);return isNaN(t)?e:t},ab=e=>{const t=Ji(e)?Number(e):NaN;return isNaN(t)?e:t};let xT;const yw=()=>xT||(xT=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),qX="Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol",UX=dw(qX);function an(e){if(_n(e)){const t={};for(let n=0;n{if(n){const i=n.split(KX);i.length>1&&(t[i[0].trim()]=i[1].trim())}}),t}function De(e){let t="";if(Ji(e))t=e;else if(_n(e))for(let n=0;nSd(n,t))}const az=e=>!!(e&&e.__v_isRef===!0),z=e=>Ji(e)?e:e==null?"":_n(e)||Fi(e)&&(e.toString===oz||!Bn(e.toString))?az(e)?z(e.value):JSON.stringify(e,lz,2):String(e),lz=(e,t)=>az(t)?lz(e,t.value):wm(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[i,o],s)=>(n[y8(i,s)+" =>"]=o,n),{})}:o1(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>y8(n))}:bl(t)?y8(t):Fi(t)&&!_n(t)&&!hw(t)?String(t):t,y8=(e,t="")=>{var n;return bl(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};function eee(e){return e==null?"initial":typeof e=="string"?e===""?" ":e:String(e)}/** +* @vue/reactivity v3.5.39 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/let Ns;class uz{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&Ns&&(Ns.active?(this.parent=Ns,this.index=(Ns.scopes||(Ns.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t0&&--this._on===0){if(Ns===this)Ns=this.prevScope;else{let t=Ns;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let n,i;for(n=0,i=this.effects.length;n0)return;if(uv){let t=uv;for(uv=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;lv;){let t=lv;for(lv=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(i){e||(e=i)}t=n}}if(e)throw e}function fz(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function hz(e){let t,n=e.depsTail,i=n;for(;i;){const o=i.prevDep;i.version===-1?(i===n&&(n=o),qx(i),tee(i)):t=i,i.dep.activeLink=i.prevActiveLink,i.prevActiveLink=void 0,i=o}e.deps=t,e.depsTail=n}function cC(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(pz(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function pz(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Qv)||(e.globalVersion=Qv,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!cC(e))))return;e.flags|=2;const t=e.dep,n=ro,i=Ru;ro=e,Ru=!0;try{fz(e);const o=e.fn(e._value);(t.version===0||Zs(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{ro=n,Ru=i,hz(e),e.flags&=-3}}function qx(e,t=!1){const{dep:n,prevSub:i,nextSub:o}=e;if(i&&(i.nextSub=o,e.prevSub=void 0),o&&(o.prevSub=i,e.nextSub=void 0),n.subs===e&&(n.subs=i,!i&&n.computed)){n.computed.flags&=-5;for(let s=n.computed.deps;s;s=s.nextDep)qx(s,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function tee(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}function QAt(e,t){e.effect instanceof lb&&(e=e.effect.fn);const n=new lb(e);t&&Ki(n,t);try{n.run()}catch(o){throw n.stop(),o}const i=n.run.bind(n);return i.effect=n,i}function YAt(e){e.effect.stop()}let Ru=!0;const mz=[];function Nc(){mz.push(Ru),Ru=!1}function Fc(){const e=mz.pop();Ru=e===void 0?!0:e}function ST(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=ro;ro=void 0;try{t()}finally{ro=n}}}let Qv=0,nee=class{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}};class ww{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!ro||!Ru||ro===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==ro)n=this.activeLink=new nee(ro,this),ro.deps?(n.prevDep=ro.depsTail,ro.depsTail.nextDep=n,ro.depsTail=n):ro.deps=ro.depsTail=n,gz(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const i=n.nextDep;i.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=i),n.prevDep=ro.depsTail,n.nextDep=void 0,ro.depsTail.nextDep=n,ro.depsTail=n,ro.deps===n&&(ro.deps=i)}return n}trigger(t){this.version++,Qv++,this.notify(t)}notify(t){Hx();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Wx()}}}function gz(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let i=t.deps;i;i=i.nextDep)gz(i)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const ub=new WeakMap,_p=Symbol(""),dC=Symbol(""),Yv=Symbol("");function Br(e,t,n){if(Ru&&ro){let i=ub.get(e);i||ub.set(e,i=new Map);let o=i.get(n);o||(i.set(n,o=new ww),o.map=i,o.key=n),o.track()}}function ud(e,t,n,i,o,s){const r=ub.get(e);if(!r){Qv++;return}const a=l=>{l&&l.trigger()};if(Hx(),t==="clear")r.forEach(a);else{const l=_n(e),u=l&&pw(n);if(l&&n==="length"){const c=Number(i);r.forEach((d,f)=>{(f==="length"||f===Yv||!bl(f)&&f>=c)&&a(d)})}else switch((n!==void 0||r.has(void 0))&&a(r.get(n)),u&&a(r.get(Yv)),t){case"add":l?u&&a(r.get("length")):(a(r.get(_p)),wm(e)&&a(r.get(dC)));break;case"delete":l||(a(r.get(_p)),wm(e)&&a(r.get(dC)));break;case"set":wm(e)&&a(r.get(_p));break}}Wx()}function iee(e,t){const n=ub.get(e);return n&&n.get(t)}function I1(e){const t=vi(e);return t===e?t:(Br(t,"iterate",Yv),hl(e)?t:t.map($u))}function Aw(e){return Br(e=vi(e),"iterate",Yv),e}function fc(e,t){return _d(e)?Um(Du(e)?$u(t):t):$u(t)}const oee={__proto__:null,[Symbol.iterator](){return b8(this,Symbol.iterator,e=>fc(this,e))},concat(...e){return I1(this).concat(...e.map(t=>_n(t)?I1(t):t))},entries(){return b8(this,"entries",e=>(e[1]=fc(this,e[1]),e))},every(e,t){return Yc(this,"every",e,t,void 0,arguments)},filter(e,t){return Yc(this,"filter",e,t,n=>n.map(i=>fc(this,i)),arguments)},find(e,t){return Yc(this,"find",e,t,n=>fc(this,n),arguments)},findIndex(e,t){return Yc(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Yc(this,"findLast",e,t,n=>fc(this,n),arguments)},findLastIndex(e,t){return Yc(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Yc(this,"forEach",e,t,void 0,arguments)},includes(...e){return w8(this,"includes",e)},indexOf(...e){return w8(this,"indexOf",e)},join(e){return I1(this).join(e)},lastIndexOf(...e){return w8(this,"lastIndexOf",e)},map(e,t){return Yc(this,"map",e,t,void 0,arguments)},pop(){return l0(this,"pop")},push(...e){return l0(this,"push",e)},reduce(e,...t){return _T(this,"reduce",e,t)},reduceRight(e,...t){return _T(this,"reduceRight",e,t)},shift(){return l0(this,"shift")},some(e,t){return Yc(this,"some",e,t,void 0,arguments)},splice(...e){return l0(this,"splice",e)},toReversed(){return I1(this).toReversed()},toSorted(e){return I1(this).toSorted(e)},toSpliced(...e){return I1(this).toSpliced(...e)},unshift(...e){return l0(this,"unshift",e)},values(){return b8(this,"values",e=>fc(this,e))}};function b8(e,t,n){const i=Aw(e),o=i[t]();return i!==e&&!hl(e)&&(o._next=o.next,o.next=()=>{const s=o._next();return s.done||(s.value=n(s.value)),s}),o}const see=Array.prototype;function Yc(e,t,n,i,o,s){const r=Aw(e),a=r!==e&&!hl(e),l=r[t];if(l!==see[t]){const d=l.apply(e,s);return a?$u(d):d}let u=n;r!==e&&(a?u=function(d,f){return n.call(this,fc(e,d),f,e)}:n.length>2&&(u=function(d,f){return n.call(this,d,f,e)}));const c=l.call(r,u,i);return a&&o?o(c):c}function _T(e,t,n,i){const o=Aw(e),s=o!==e&&!hl(e);let r=n,a=!1;o!==e&&(s?(a=i.length===0,r=function(u,c,d){return a&&(a=!1,u=fc(e,u)),n.call(this,u,fc(e,c),d,e)}):n.length>3&&(r=function(u,c,d){return n.call(this,u,c,d,e)}));const l=o[t](r,...i);return a?fc(e,l):l}function w8(e,t,n){const i=vi(e);Br(i,"iterate",Yv);const o=i[t](...n);return(o===-1||o===!1)&&Sw(n[0])?(n[0]=vi(n[0]),i[t](...n)):o}function l0(e,t,n=[]){Nc(),Hx();const i=vi(e)[t].apply(e,n);return Wx(),Fc(),i}const ree=dw("__proto__,__v_isRef,__isVue"),vz=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(bl));function aee(e){bl(e)||(e=String(e));const t=vi(this);return Br(t,"has",e),t.hasOwnProperty(e)}class yz{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,i){if(n==="__v_skip")return t.__v_skip;const o=this._isReadonly,s=this._isShallow;if(n==="__v_isReactive")return!o;if(n==="__v_isReadonly")return o;if(n==="__v_isShallow")return s;if(n==="__v_raw")return i===(o?s?xz:Cz:s?Az:wz).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(i)?t:void 0;const r=_n(t);if(!o){let l;if(r&&(l=oee[n]))return l;if(n==="hasOwnProperty")return aee}const a=Reflect.get(t,n,Xi(t)?t:i);if((bl(n)?vz.has(n):ree(n))||(o||Br(t,"get",n),s))return a;if(Xi(a)){const l=r&&pw(n)?a:a.value;return o&&Fi(l)?cb(l):l}return Fi(a)?o?cb(a):bo(a):a}}class kz extends yz{constructor(t=!1){super(!1,t)}set(t,n,i,o){let s=t[n];const r=_n(t)&&pw(n);if(!this._isShallow){const u=_d(s);if(!hl(i)&&!_d(i)&&(s=vi(s),i=vi(i)),!r&&Xi(s)&&!Xi(i))return u||(s.value=i),!0}const a=r?Number(n)e,Ky=e=>Reflect.getPrototypeOf(e);function fee(e,t,n){return function(...i){const o=this.__v_raw,s=vi(o),r=wm(s),a=e==="entries"||e===Symbol.iterator&&r,l=e==="keys"&&r,u=o[e](...i),c=n?fC:t?Um:$u;return!t&&Br(s,"iterate",l?dC:_p),Ki(Object.create(u),{next(){const{value:d,done:f}=u.next();return f?{value:d,done:f}:{value:a?[c(d[0]),c(d[1])]:c(d),done:f}}})}}function Zy(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function hee(e,t){const n={get(o){const s=this.__v_raw,r=vi(s),a=vi(o);e||(Zs(o,a)&&Br(r,"get",o),Br(r,"get",a));const{has:l}=Ky(r),u=t?fC:e?Um:$u;if(l.call(r,o))return u(s.get(o));if(l.call(r,a))return u(s.get(a));s!==r&&s.get(o)},get size(){const o=this.__v_raw;return!e&&Br(vi(o),"iterate",_p),o.size},has(o){const s=this.__v_raw,r=vi(s),a=vi(o);return e||(Zs(o,a)&&Br(r,"has",o),Br(r,"has",a)),o===a?s.has(o):s.has(o)||s.has(a)},forEach(o,s){const r=this,a=r.__v_raw,l=vi(a),u=t?fC:e?Um:$u;return!e&&Br(l,"iterate",_p),a.forEach((c,d)=>o.call(s,u(c),u(d),r))}};return Ki(n,e?{add:Zy("add"),set:Zy("set"),delete:Zy("delete"),clear:Zy("clear")}:{add(o){const s=vi(this),r=Ky(s),a=vi(o),l=!t&&!hl(o)&&!_d(o)?a:o;return r.has.call(s,l)||Zs(o,l)&&r.has.call(s,o)||Zs(a,l)&&r.has.call(s,a)||(s.add(l),ud(s,"add",l,l)),this},set(o,s){!t&&!hl(s)&&!_d(s)&&(s=vi(s));const r=vi(this),{has:a,get:l}=Ky(r);let u=a.call(r,o);u||(o=vi(o),u=a.call(r,o));const c=l.call(r,o);return r.set(o,s),u?Zs(s,c)&&ud(r,"set",o,s):ud(r,"add",o,s),this},delete(o){const s=vi(this),{has:r,get:a}=Ky(s);let l=r.call(s,o);l||(o=vi(o),l=r.call(s,o)),a&&a.call(s,o);const u=s.delete(o);return l&&ud(s,"delete",o,void 0),u},clear(){const o=vi(this),s=o.size!==0,r=o.clear();return s&&ud(o,"clear",void 0,void 0),r}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=fee(o,e,t)}),n}function Cw(e,t){const n=hee(e,t);return(i,o,s)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?i:Reflect.get(Ei(n,o)&&o in i?n:i,o,s)}const pee={get:Cw(!1,!1)},mee={get:Cw(!1,!0)},gee={get:Cw(!0,!1)},vee={get:Cw(!0,!0)},wz=new WeakMap,Az=new WeakMap,Cz=new WeakMap,xz=new WeakMap;function yee(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function bo(e){return _d(e)?e:xw(e,!1,lee,pee,wz)}function zp(e){return xw(e,!1,cee,mee,Az)}function cb(e){return xw(e,!0,uee,gee,Cz)}function XAt(e){return xw(e,!0,dee,vee,xz)}function xw(e,t,n,i,o){if(!Fi(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const s=o.get(e);if(s)return s;const r=yee(jX(e));if(r===0)return e;const a=new Proxy(e,r===2?i:n);return o.set(e,a),a}function Du(e){return _d(e)?Du(e.__v_raw):!!(e&&e.__v_isReactive)}function _d(e){return!!(e&&e.__v_isReadonly)}function hl(e){return!!(e&&e.__v_isShallow)}function Sw(e){return e?!!e.__v_raw:!1}function vi(e){const t=e&&e.__v_raw;return t?vi(t):e}function Tt(e){return!Ei(e,"__v_skip")&&Object.isExtensible(e)&&sz(e,"__v_skip",!0),e}const $u=e=>Fi(e)?bo(e):e,Um=e=>Fi(e)?cb(e):e;function Xi(e){return e?e.__v_isRef===!0:!1}function q(e){return Sz(e,!1)}function au(e){return Sz(e,!0)}function Sz(e,t){return Xi(e)?e:new kee(e,t)}class kee{constructor(t,n){this.dep=new ww,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:vi(t),this._value=n?t:$u(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,i=this.__v_isShallow||hl(t)||_d(t);t=i?t:vi(t),Zs(t,n)&&(this._rawValue=t,this._value=i?t:$u(t),this.dep.trigger())}}function bee(e){e.dep&&e.dep.trigger()}function p(e){return Xi(e)?e.value:e}function xu(e){return Bn(e)?e():p(e)}const wee={get:(e,t,n)=>t==="__v_raw"?e:p(Reflect.get(e,t,n)),set:(e,t,n,i)=>{const o=e[t];return Xi(o)&&!Xi(n)?(o.value=n,!0):Reflect.set(e,t,n,i)}};function _z(e){return Du(e)?e:new Proxy(e,wee)}class Aee{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new ww,{get:i,set:o}=t(n.track.bind(n),n.trigger.bind(n));this._get=i,this._set=o}get value(){return this._value=this._get()}set value(t){this._set(t)}}function Cee(e){return new Aee(e)}function xee(e){const t=_n(e)?new Array(e.length):{};for(const n in e)t[n]=Iz(e,n);return t}class See{constructor(t,n,i){this._object=t,this._defaultValue=i,this.__v_isRef=!0,this._value=void 0,this._key=bl(n)?n:String(n),this._raw=vi(t);let o=!0,s=t;if(!_n(t)||bl(this._key)||!pw(this._key))do o=!Sw(s)||hl(s);while(o&&(s=s.__v_raw));this._shallow=o}get value(){let t=this._object[this._key];return this._shallow&&(t=p(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&Xi(this._raw[this._key])){const n=this._object[this._key];if(Xi(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return iee(this._raw,this._key)}}class _ee{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function Iee(e,t,n){return Xi(e)?e:Bn(e)?new _ee(e):Fi(e)&&arguments.length>1?Iz(e,t,n):q(e)}function Iz(e,t,n){return new See(e,t,n)}class Mee{constructor(t,n,i){this.fn=t,this.setter=n,this._value=void 0,this.dep=new ww(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Qv-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=i}notify(){if(this.flags|=16,!(this.flags&8)&&ro!==this)return dz(this,!0),!0}get value(){const t=this.dep.track();return pz(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function Tee(e,t,n=!1){let i,o;return Bn(e)?i=e:(i=e.get,o=e.set),new Mee(i,o,n)}const eCt={GET:"get",HAS:"has",ITERATE:"iterate"},tCt={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},Gy={},db=new WeakMap;let hf;function nCt(){return hf}function Eee(e,t=!1,n=hf){if(n){let i=db.get(n);i||db.set(n,i=[]),i.push(e)}}function Lee(e,t,n=fi){const{immediate:i,deep:o,once:s,scheduler:r,augmentJob:a,call:l}=n,u=A=>o?A:hl(A)||o===!1||o===0?cd(A,1):cd(A);let c,d,f,h,m=!1,g=!1;if(Xi(e)?(d=()=>e.value,m=hl(e)):Du(e)?(d=()=>u(e),m=!0):_n(e)?(g=!0,m=e.some(A=>Du(A)||hl(A)),d=()=>e.map(A=>{if(Xi(A))return A.value;if(Du(A))return u(A);if(Bn(A))return l?l(A,2):A()})):Bn(e)?t?d=l?()=>l(e,2):e:d=()=>{if(f){Nc();try{f()}finally{Fc()}}const A=hf;hf=c;try{return l?l(e,3,[h]):e(h)}finally{hf=A}}:d=Xl,t&&o){const A=d,M=o===!0?1/0:o;d=()=>cd(A(),M)}const y=mg(),b=()=>{c.stop(),y&&y.active&&zx(y.effects,c)};if(s&&t){const A=t;t=(...M)=>{const L=A(...M);return b(),L}}let v=g?new Array(e.length).fill(Gy):Gy;const w=A=>{if(!(!(c.flags&1)||!c.dirty&&!A))if(t){const M=c.run();if(A||o||m||(g?M.some((L,E)=>Zs(L,v[E])):Zs(M,v))){f&&f();const L=hf;hf=c;try{const E=[M,v===Gy?void 0:g&&v[0]===Gy?[]:v,h];v=M,l?l(t,3,E):t(...E)}finally{hf=L}}}else c.run()};return a&&a(w),c=new lb(d),c.scheduler=r?()=>r(w,!1):w,h=A=>Eee(A,!1,c),f=c.onStop=()=>{const A=db.get(c);if(A){if(l)l(A,4);else for(const M of A)M();db.delete(c)}},t?i?w(!0):v=c.run():r?r(w.bind(null,!0),!0):c.run(),b.pause=c.pause.bind(c),b.resume=c.resume.bind(c),b.stop=b,b}function cd(e,t=1/0,n){if(t<=0||!Fi(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Xi(e))cd(e.value,t,n);else if(_n(e))for(let i=0;i{cd(i,t,n)});else if(hw(e)){for(const i in e)cd(e[i],t,n);for(const i of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,i)&&cd(e[i],t,n)}return e}/** +* @vue/runtime-core v3.5.39 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/const Mz=[];function Nee(e){Mz.push(e)}function Fee(){Mz.pop()}function iCt(e,t){}const oCt={SETUP_FUNCTION:0,0:"SETUP_FUNCTION",RENDER_FUNCTION:1,1:"RENDER_FUNCTION",NATIVE_EVENT_HANDLER:5,5:"NATIVE_EVENT_HANDLER",COMPONENT_EVENT_HANDLER:6,6:"COMPONENT_EVENT_HANDLER",VNODE_HOOK:7,7:"VNODE_HOOK",DIRECTIVE_HOOK:8,8:"DIRECTIVE_HOOK",TRANSITION_HOOK:9,9:"TRANSITION_HOOK",APP_ERROR_HANDLER:10,10:"APP_ERROR_HANDLER",APP_WARN_HANDLER:11,11:"APP_WARN_HANDLER",FUNCTION_REF:12,12:"FUNCTION_REF",ASYNC_COMPONENT_LOADER:13,13:"ASYNC_COMPONENT_LOADER",SCHEDULER:14,14:"SCHEDULER",COMPONENT_UPDATE:15,15:"COMPONENT_UPDATE",APP_UNMOUNT_CLEANUP:16,16:"APP_UNMOUNT_CLEANUP"},Ree={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush",15:"component update",16:"app unmount cleanup function"};function V2(e,t,n,i){try{return i?e(...i):e()}catch(o){gg(o,t,n)}}function iu(e,t,n,i){if(Bn(e)){const o=V2(e,t,n,i);return o&&jx(o)&&o.catch(s=>{gg(s,t,n)}),o}if(_n(e)){const o=[];for(let s=0;s>>1,o=sa[i],s=Jv(o);s=Jv(n)?sa.push(e):sa.splice(Oee(t),0,e),e.flags|=1,Ez()}}function Ez(){fb||(fb=Tz.then(Lz))}function hb(e){_n(e)?Cm.push(...e):pf&&e.id===-1?pf.splice(V1+1,0,e):e.flags&1||(Cm.push(e),e.flags|=1),Ez()}function IT(e,t,n=lc+1){for(;nJv(n)-Jv(i));if(Cm.length=0,pf){pf.push(...t);return}for(pf=t,V1=0;V1e.id==null?e.flags&2?-1:1/0:e.id;function Lz(e){try{for(lc=0;lcK1.emit(o,...s)),Qy=[]):typeof window<"u"&&window.HTMLElement&&!((i=(n=window.navigator)==null?void 0:n.userAgent)!=null&&i.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(s=>{Nz(s,t)}),setTimeout(()=>{K1||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,Qy=[])},3e3)):Qy=[]}let wr=null,_w=null;function Xv(e){const t=wr;return wr=e,_w=e&&e.type.__scopeId||null,t}function sCt(e){_w=e}function rCt(){_w=null}const aCt=e=>de;function de(e,t=wr,n){if(!t||e._n)return e;const i=(...o)=>{i._d&&bb(-1);const s=Xv(t);let r;try{r=e(...o)}finally{Xv(s),i._d&&bb(1)}return r};return i._n=!0,i._c=!0,i._d=!0,i}function ri(e,t){if(wr===null)return e;const n=G2(wr),i=e.dirs||(e.dirs=[]);for(let o=0;o1)return n&&Bn(t)?t.call(i&&i.proxy):t}}function Pee(){return!!(Is()||Ip)}const Bee=Symbol.for("v-scx"),$ee=()=>en(Bee);function xm(e,t){return K2(e,null,t)}function lCt(e,t){return K2(e,null,{flush:"post"})}function zee(e,t){return K2(e,null,{flush:"sync"})}function Be(e,t,n){return K2(e,t,n)}function K2(e,t,n=fi){const{immediate:i,deep:o,flush:s,once:r}=n,a=Ki({},n),l=t&&i||!t&&s!=="post";let u;if(Hp){if(s==="sync"){const h=$ee();u=h.__watcherHandles||(h.__watcherHandles=[])}else if(!l){const h=()=>{};return h.stop=Xl,h.resume=Xl,h.pause=Xl,h}}const c=yr;a.call=(h,m,g)=>iu(h,c,m,g);let d=!1;s==="post"?a.scheduler=h=>{ps(h,c&&c.suspense)}:s!=="sync"&&(d=!0,a.scheduler=(h,m)=>{m?h():Ux(h)}),a.augmentJob=h=>{t&&(h.flags|=4),d&&(h.flags|=2,c&&(h.id=c.uid,h.i=c))};const f=Lee(e,t,a);return Hp&&(u?u.push(f):l&&f()),f}function jee(e,t,n){const i=this.proxy,o=Ji(e)?e.includes(".")?Fz(i,e):()=>i[e]:e.bind(i,i);let s;Bn(t)?s=t:(s=t.handler,n=t);const r=kg(this),a=K2(o,s.bind(i),n);return r(),a}function Fz(e,t){const n=t.split(".");return()=>{let i=e;for(let o=0;oe.__isTeleport,tp=e=>e&&(e.disabled||e.disabled===""),Hee=e=>e&&(e.defer||e.defer===""),MT=e=>typeof SVGElement<"u"&&e instanceof SVGElement,TT=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,hC=(e,t)=>{const n=e&&e.to;return Ji(n)?t?t(n):null:n},Wee={name:"Teleport",__isTeleport:!0,process(e,t,n,i,o,s,r,a,l,u){const{mc:c,pc:d,pbc:f,o:{insert:h,querySelector:m,createText:g,createComment:y,parentNode:b}}=u,v=tp(t.props);let{dynamicChildren:w}=t;const A=(E,C,x)=>{E.shapeFlag&16&&c(E.children,C,x,o,s,r,a,l)},M=(E=t)=>{const C=tp(E.props),x=E.target=hC(E.props,m),_=pC(x,E,g,h);x&&(r!=="svg"&&MT(x)?r="svg":r!=="mathml"&&TT(x)&&(r="mathml"),o&&o.isCE&&(o.ce._teleportTargets||(o.ce._teleportTargets=new Set)).add(x),C||(A(E,x,_),D0(E,!1)))},L=E=>{const C=()=>{if(rf.get(E)===C){if(rf.delete(E),tp(E.props)){const x=b(E.el)||n;A(E,x,E.anchor),D0(E,!0)}M(E)}};rf.set(E,C),ps(C,s)};if(e==null){const E=t.el=g(""),C=t.anchor=g("");if(h(E,n,i),h(C,n,i),Hee(t.props)||s&&s.pendingBranch){L(t);return}v&&(A(t,n,C),D0(t,!0)),M()}else{t.el=e.el;const E=t.anchor=e.anchor,C=rf.get(e);if(C){C.flags|=8,rf.delete(e),L(t);return}t.targetStart=e.targetStart;const x=t.target=e.target,_=t.targetAnchor=e.targetAnchor,F=tp(e.props),I=F?n:x,D=F?E:_;if(r==="svg"||MT(x)?r="svg":(r==="mathml"||TT(x))&&(r="mathml"),w?(f(e.dynamicChildren,w,I,o,s,r,a),tS(e,t,!0)):l||d(e,t,I,D,o,s,r,a,!1),v)F?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):Yy(t,n,E,u,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const H=hC(t.props,m);H&&(t.target=H,Yy(t,H,null,u,0))}else F&&Yy(t,x,_,u,1);D0(t,v)}},remove(e,t,n,{um:i,o:{remove:o}},s){const{shapeFlag:r,children:a,anchor:l,targetStart:u,targetAnchor:c,target:d,props:f}=e,h=tp(f),m=s||!h,g=rf.get(e);if(g&&(g.flags|=8,rf.delete(e)),d&&(o(u),o(c)),s&&o(l),!g&&(h||d)&&r&16)for(let y=0;y{e.isMounted=!0}),ii(()=>{e.isUnmounting=!0}),e}const Dl=[Function,Array],Pz={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Dl,onEnter:Dl,onAfterEnter:Dl,onEnterCancelled:Dl,onBeforeLeave:Dl,onLeave:Dl,onAfterLeave:Dl,onLeaveCancelled:Dl,onBeforeAppear:Dl,onAppear:Dl,onAfterAppear:Dl,onAppearCancelled:Dl},Bz=e=>{const t=e.subTree;return t.component?Bz(t.component):t},Uee={name:"BaseTransition",props:Pz,setup(e,{slots:t}){const n=Is(),i=Oz();return()=>{const o=t.default&&Vx(t.default(),!0),s=o&&o.length?$z(o):n.subTree?ne():void 0;if(!s)return;const r=vi(e),{mode:a}=r;if(i.isLeaving)return A8(s);const l=ET(s);if(!l)return A8(s);let u=e2(l,r,i,n,d=>u=d);l.type!==ws&&Hf(l,u);let c=n.subTree&&ET(n.subTree);if(c&&c.type!==ws&&!Iu(c,l)&&Bz(n).type!==ws){let d=e2(c,r,i,n);if(Hf(c,d),a==="out-in"&&l.type!==ws)return i.isLeaving=!0,d.afterLeave=()=>{i.isLeaving=!1,n.job.flags&8||n.update(),delete d.afterLeave,c=void 0},A8(s);a==="in-out"&&l.type!==ws?d.delayLeave=(f,h,m)=>{const g=zz(i,c);g[String(c.key)]=c,f[Hl]=()=>{h(),f[Hl]=void 0,delete u.delayedLeave,c=void 0},u.delayedLeave=()=>{m(),delete u.delayedLeave,c=void 0}}:c=void 0}else c&&(c=void 0);return s}}};function $z(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==ws){t=n;break}}return t}const Vee=Uee;function zz(e,t){const{leavingVNodes:n}=e;let i=n.get(t.type);return i||(i=Object.create(null),n.set(t.type,i)),i}function e2(e,t,n,i,o){const{appear:s,mode:r,persisted:a=!1,onBeforeEnter:l,onEnter:u,onAfterEnter:c,onEnterCancelled:d,onBeforeLeave:f,onLeave:h,onAfterLeave:m,onLeaveCancelled:g,onBeforeAppear:y,onAppear:b,onAfterAppear:v,onAppearCancelled:w}=t,A=String(e.key),M=zz(n,e),L=(x,_)=>{x&&iu(x,i,9,_)},E=(x,_)=>{const F=_[1];L(x,_),_n(x)?x.every(I=>I.length<=1)&&F():x.length<=1&&F()},C={mode:r,persisted:a,beforeEnter(x){let _=l;if(!n.isMounted)if(s)_=y||l;else return;x[Hl]&&x[Hl](!0);const F=M[A];F&&Iu(e,F)&&F.el[Hl]&&F.el[Hl](),L(_,[x])},enter(x){if(M[A]===e)return;let _=u,F=c,I=d;if(!n.isMounted)if(s)_=b||u,F=v||c,I=w||d;else return;let D=!1;x[u0]=$=>{D||(D=!0,$?L(I,[x]):L(F,[x]),C.delayedLeave&&C.delayedLeave(),x[u0]=void 0)};const H=x[u0].bind(null,!1);_?E(_,[x,H]):H()},leave(x,_){const F=String(e.key);if(x[u0]&&x[u0](!0),n.isUnmounting)return _();L(f,[x]);let I=!1;x[Hl]=H=>{I||(I=!0,_(),H?L(g,[x]):L(m,[x]),x[Hl]=void 0,M[F]===e&&delete M[F])};const D=x[Hl].bind(null,!1);M[F]=e,h?E(h,[x,D]):D()},clone(x){const _=e2(x,t,n,i,o);return o&&o(_),_}};return C}function A8(e){if(Z2(e))return e=Id(e),e.children=null,e}function ET(e){if(!Z2(e))return Dz(e.type)&&e.children?$z(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&Bn(n.default))return n.default()}}function Hf(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Hf(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Vx(e,t=!1,n){let i=[],o=0;for(let s=0;s1)for(let s=0;sn.value,set:s=>n.value=s})}return n}function LT(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const mb=new WeakMap;function Sm(e,t,n,i,o=!1){if(_n(e)){e.forEach((g,y)=>Sm(g,t&&(_n(t)?t[y]:t),n,i,o));return}if(kd(i)&&!o){i.shapeFlag&512&&i.type.__asyncResolved&&i.component.subTree.component&&Sm(e,t,n,i.component.subTree);return}const s=i.shapeFlag&4?G2(i.component):i.el,r=o?null:s,{i:a,r:l}=e,u=t&&t.r,c=a.refs===fi?a.refs={}:a.refs,d=a.setupState,f=vi(d),h=d===fi?iz:g=>LT(c,g)?!1:Ei(f,g),m=(g,y)=>!(y&<(c,y));if(u!=null&&u!==l){if(NT(t),Ji(u))c[u]=null,h(u)&&(d[u]=null);else if(Xi(u)){const g=t;m(u,g.k)&&(u.value=null),g.k&&(c[g.k]=null)}}if(Bn(l)){Nc();try{V2(l,a,12,[r,c])}finally{Fc()}}else{const g=Ji(l),y=Xi(l);if(g||y){const b=()=>{if(e.f){const v=g?h(l)?d[l]:c[l]:m()||!e.k?l.value:c[e.k];if(o)_n(v)&&zx(v,s);else if(_n(v))v.includes(s)||v.push(s);else if(g)c[l]=[s],h(l)&&(d[l]=c[l]);else{const w=[s];m(l,e.k)&&(l.value=w),e.k&&(c[e.k]=w)}}else g?(c[l]=r,h(l)&&(d[l]=r)):y&&(m(l,e.k)&&(l.value=r),e.k&&(c[e.k]=r))};if(r){const v=()=>{b(),mb.delete(e)};v.id=-1,mb.set(e,v),ps(v,n)}else NT(e),b()}}}function NT(e){const t=mb.get(e);t&&(t.flags|=8,mb.delete(e))}let FT=!1;const M1=()=>{FT||(console.error("Hydration completed but contains mismatches."),FT=!0)},Zee=e=>e.namespaceURI.includes("svg")&&e.tagName!=="foreignObject",Gee=e=>e.namespaceURI.includes("MathML"),Jy=e=>{if(e.nodeType===1){if(Zee(e))return"svg";if(Gee(e))return"mathml"}},sm=e=>e.nodeType===8;function Qee(e){const{mt:t,p:n,o:{patchProp:i,createText:o,nextSibling:s,parentNode:r,remove:a,insert:l,createComment:u}}=e,c=(w,A)=>{if(!A.hasChildNodes()){n(null,w,A),pb(),A._vnode=w;return}d(A.firstChild,w,null,null,null),pb(),A._vnode=w},d=(w,A,M,L,E,C=!1)=>{C=C||!!A.dynamicChildren;const x=sm(w)&&w.data==="[",_=()=>g(w,A,M,L,E,x),{type:F,ref:I,shapeFlag:D,patchFlag:H}=A;let $=w.nodeType;A.el=w,H===-2&&(C=!1,A.dynamicChildren=null);let T=null;switch(F){case Lf:$!==3?A.children===""?(l(A.el=o(""),r(w),w),T=w):T=_():(w.data!==A.children&&(M1(),w.data=A.children),T=s(w));break;case ws:v(w)?(T=s(w),b(A.el=w.content.firstChild,w,M)):$!==8||x?T=_():T=s(w);break;case Im:if(x&&(w=s(w),$=w.nodeType),$===1||$===3){T=w;const R=!A.children.length;for(let P=0;P{C=C||!!A.dynamicChildren;const{type:x,dynamicProps:_,props:F,patchFlag:I,shapeFlag:D,dirs:H,transition:$}=A,T=x==="input"||x==="option",R=!!_;if(T||R||I!==-1){H&&dc(A,null,M,"created");let P=!1;if(v(w)){P=lj(null,$)&&M&&M.vnode.props&&M.vnode.props.appear;const B=w.content.firstChild;if(P){const K=B.getAttribute("class");K&&(B.$cls=K),$.beforeEnter(B)}b(B,w,M),A.el=w=B}if(D&16&&!(F&&(F.innerHTML||F.textContent))){let B=h(w.firstChild,A,w,M,L,E,C);for(B&&!hk(w,1)&&M1();B;){const K=B;B=B.nextSibling,a(K)}}else if(D&8){let B=A.children;B[0]===` +`&&(w.tagName==="PRE"||w.tagName==="TEXTAREA")&&(B=B.slice(1));const{textContent:K}=w;K!==B&&K!==B.replace(/\r\n|\r/g,` +`)&&(hk(w,0)||M1(),w.textContent=A.children)}if(F){if(T||R||!C||I&48){const B=w.tagName.includes("-");for(const K in F)(T&&(K.endsWith("value")||K==="indeterminate")||U2(K)&&!Sp(K)||K[0]==="."||B&&!Sp(K)||_&&_.includes(K))&&i(w,K,null,F[K],void 0,M)}else if(F.onClick)i(w,"onClick",null,F.onClick,void 0,M);else if(I&4&&Du(F.style))for(const B in F.style)F.style[B]}let j;(j=F&&F.onVnodeBeforeMount)&&Ea(j,M,A),H&&dc(A,null,M,"beforeMount"),((j=F&&F.onVnodeMounted)||H||P)&&fj(()=>{j&&Ea(j,M,A),P&&$.enter(w),H&&dc(A,null,M,"mounted")},L)}return w.nextSibling},h=(w,A,M,L,E,C,x)=>{x=x||!!A.dynamicChildren;const _=A.children,F=_.length;let I=!1;for(let D=0;D{const{slotScopeIds:x}=A;x&&(E=E?E.concat(x):x);const _=r(w),F=h(s(w),A,_,M,L,E,C);return F&&sm(F)&&F.data==="]"?s(A.anchor=F):(M1(),l(A.anchor=u("]"),_,F),F)},g=(w,A,M,L,E,C)=>{if(Jee(w,A)||M1(),A.el=null,C){const F=y(w);for(;;){const I=s(w);if(I&&I!==F)a(I);else break}}const x=s(w),_=r(w);return a(w),n(null,A,_,x,M,L,Jy(_),E),M&&(M.vnode.el=A.el,Tw(M,A.el)),x},y=(w,A="[",M="]")=>{let L=0;for(;w;)if(w=s(w),w&&sm(w)&&(w.data===A&&L++,w.data===M)){if(L===0)return s(w);L--}return w},b=(w,A,M)=>{const L=A.parentNode;L&&L.replaceChild(w,A);let E=M;for(;E;)E.vnode.el===A&&(E.vnode.el=E.subTree.el=w),E=E.parent},v=w=>w.nodeType===1&&w.tagName==="TEMPLATE";return[c,d]}const gb="data-allow-mismatch",Yee={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function hk(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(gb);)e=e.parentElement;return Zx(e&&e.getAttribute(gb),t)}function Zx(e,t){if(e==null)return!1;if(e==="")return!0;{const n=e.split(",");return t===0&&n.includes("children")?!0:n.includes(Yee[t])}}function Jee(e,t){return hk(e.parentElement,1)||Xee(e)||ete(t)}function Xee(e){return e.nodeType===1&&Zx(e.getAttribute(gb),1)}function ete({props:e}){const t=e&&e[gb];return typeof t=="string"&&Zx(t,1)}const tte=yw().requestIdleCallback||(e=>setTimeout(e,1)),nte=yw().cancelIdleCallback||(e=>clearTimeout(e)),cCt=(e=1e4)=>t=>{const n=tte(t,{timeout:e});return()=>nte(n)};function ite(e){const{top:t,left:n,bottom:i,right:o}=e.getBoundingClientRect(),{innerHeight:s,innerWidth:r}=window;return(t>0&&t0&&i0&&n0&&o(t,n)=>{const i=new IntersectionObserver(o=>{for(const s of o)if(s.isIntersecting){i.disconnect(),t();break}},e);return n(o=>{if(o instanceof Element){if(ite(o))return t(),i.disconnect(),!1;i.observe(o)}}),()=>i.disconnect()},fCt=e=>t=>{if(e){const n=matchMedia(e);if(n.matches)t();else return n.addEventListener("change",t,{once:!0}),()=>n.removeEventListener("change",t)}},hCt=(e=[])=>(t,n)=>{Ji(e)&&(e=[e]);let i=!1;const o=r=>{i||(i=!0,s(),t(),r.target.dispatchEvent(new r.constructor(r.type,r)))},s=()=>{n(r=>{for(const a of e)r.removeEventListener(a,o)})};return n(r=>{for(const a of e)r.addEventListener(a,o,{once:!0})}),s};function ote(e,t){if(sm(e)&&e.data==="["){let n=1,i=e.nextSibling;for(;i;){if(i.nodeType===1){if(t(i)===!1)break}else if(sm(i))if(i.data==="]"){if(--n===0)break}else i.data==="["&&n++;i=i.nextSibling}}else t(e)}const kd=e=>!!e.type.__asyncLoader;function Ac(e){Bn(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:i,delay:o=200,hydrate:s,timeout:r,suspensible:a=!0,onError:l}=e;let u=null,c,d=0;const f=()=>(d++,u=null,h()),h=()=>{let m;return u||(m=u=t().catch(g=>{if(g=g instanceof Error?g:new Error(String(g)),l)return new Promise((y,b)=>{l(g,()=>y(f()),()=>b(g),d+1)});throw g}).then(g=>m!==u&&u?u:(g&&(g.__esModule||g[Symbol.toStringTag]==="Module")&&(g=g.default),c=g,g)))};return ot({name:"AsyncComponentWrapper",__asyncLoader:h,__asyncHydrate(m,g,y){let b=!1;(g.bu||(g.bu=[])).push(()=>b=!0);const v=()=>{b||y()},w=s?()=>{const A=s(v,M=>ote(m,M));A&&(g.bum||(g.bum=[])).push(A)}:v;c?w():h().then(()=>!g.isUnmounted&&w())},get __asyncResolved(){return c},setup(){const m=yr;if(Kx(m),c)return()=>Xy(c,m);const g=M=>{u=null,gg(M,m,13,!i)};if(a&&m.suspense||Hp)return h().then(M=>()=>Xy(M,m)).catch(M=>(g(M),()=>i?G(i,{error:M}):null));const y=q(!1),b=q(),v=q(!!o);let w,A;return Nn(()=>{w!=null&&clearTimeout(w),A!=null&&clearTimeout(A)}),o&&(A=setTimeout(()=>{m.isUnmounted||(v.value=!1)},o)),r!=null&&(w=setTimeout(()=>{if(!m.isUnmounted&&!y.value&&!b.value){const M=new Error(`Async component timed out after ${r}ms.`);g(M),b.value=M}},r)),h().then(()=>{m.isUnmounted||(y.value=!0,m.parent&&Z2(m.parent.vnode)&&m.parent.update())}).catch(M=>{if(m.isUnmounted){u=null;return}g(M),b.value=M}),()=>{if(y.value&&c)return Xy(c,m);if(b.value&&i)return G(i,{error:b.value});if(n&&!v.value)return Xy(n,m)}}})}function Xy(e,t){const{ref:n,props:i,children:o,ce:s}=t.vnode,r=G(e,i,o);return r.ref=n,r.ce=s,delete t.vnode.ce,r}const Z2=e=>e.type.__isKeepAlive,ste={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const n=Is(),i=n.ctx;if(!i.renderer)return()=>{const v=t.default&&t.default();return v&&v.length===1?v[0]:v};const o=new Map,s=new Set;let r=null;const a=n.suspense,{renderer:{p:l,m:u,um:c,o:{createElement:d}}}=i,f=d("div");i.activate=(v,w,A,M,L)=>{const E=v.component;u(v,w,A,0,a),l(E.vnode,v,w,A,E,a,M,v.slotScopeIds,L),ps(()=>{E.isDeactivated=!1,E.a&&Am(E.a);const C=v.props&&v.props.onVnodeMounted;C&&Ea(C,E.parent,v)},a)},i.deactivate=v=>{const w=v.component;yb(w.m),yb(w.a),u(v,f,null,1,a),ps(()=>{w.da&&Am(w.da);const A=v.props&&v.props.onVnodeUnmounted;A&&Ea(A,w.parent,v),w.isDeactivated=!0},a)};function h(v){C8(v),c(v,n,a,!0)}function m(v){o.forEach((w,A)=>{const M=CC(kd(w)?w.type.__asyncResolved||{}:w.type);M&&!v(M)&&g(A)})}function g(v){const w=o.get(v);w&&(!r||!Iu(w,r))?h(w):r&&C8(r),o.delete(v),s.delete(v)}Be(()=>[e.include,e.exclude],([v,w])=>{v&&m(A=>O0(v,A)),w&&m(A=>!O0(w,A))},{flush:"post",deep:!0});let y=null;const b=()=>{y!=null&&(kb(n.subTree.type)?ps(()=>{o.set(y,e9(n.subTree))},n.subTree.suspense):o.set(y,e9(n.subTree)))};return wn(b),vg(b),ii(()=>{o.forEach(v=>{const{subTree:w,suspense:A}=n,M=e9(w);if(v.type===M.type&&v.key===M.key){C8(M);const L=M.component.da;L&&ps(L,A);return}h(v)})}),()=>{if(y=null,!t.default)return r=null;const v=t.default(),w=v[0];if(v.length>1)return r=null,v;if(!Wf(w)||!(w.shapeFlag&4)&&!(w.shapeFlag&128))return r=null,w;let A=e9(w);if(A.type===ws)return r=null,A;const M=A.type,L=CC(kd(A)?A.type.__asyncResolved||{}:M),{include:E,exclude:C,max:x}=e;if(E&&(!L||!O0(E,L))||C&&L&&O0(C,L))return A.shapeFlag&=-257,r=A,w;const _=A.key==null?M:A.key,F=o.get(_);return A.el&&(A=Id(A),w.shapeFlag&128&&(w.ssContent=A)),y=_,F?(A.el=F.el,A.component=F.component,A.transition&&Hf(A,A.transition),A.shapeFlag|=512,s.delete(_),s.add(_)):(s.add(_),x&&s.size>parseInt(x,10)&&g(s.values().next().value)),A.shapeFlag|=256,r=A,kb(w.type)?w:A}}},pCt=ste;function O0(e,t){return _n(e)?e.some(n=>O0(n,t)):Ji(e)?e.split(",").includes(t):zX(e)?(e.lastIndex=0,e.test(t)):!1}function rte(e,t){jz(e,"a",t)}function ate(e,t){jz(e,"da",t)}function jz(e,t,n=yr){const i=e.__wdc||(e.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(Iw(t,i,n),n){let o=n.parent;for(;o&&o.parent;)Z2(o.parent.vnode)&<e(i,t,n,o),o=o.parent}}function lte(e,t,n,i){const o=Iw(t,e,i,!0);Nn(()=>{zx(i[t],o)},n)}function C8(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function e9(e){return e.shapeFlag&128?e.ssContent:e}function Iw(e,t,n=yr,i=!1){if(n){const o=n[e]||(n[e]=[]),s=t.__weh||(t.__weh=(...r)=>{Nc();const a=kg(n),l=iu(t,n,e,r);return a(),Fc(),l});return i?o.unshift(s):o.push(s),s}}const Rd=e=>(t,n=yr)=>{(!Hp||e==="sp")&&Iw(e,(...i)=>t(...i),n)},ute=Rd("bm"),wn=Rd("m"),Hz=Rd("bu"),vg=Rd("u"),ii=Rd("bum"),Nn=Rd("um"),cte=Rd("sp"),dte=Rd("rtg"),fte=Rd("rtc");function Wz(e,t=yr){Iw("ec",e,t)}const Gx="components",hte="directives";function qz(e,t){return Qx(Gx,e,!0,t)||e}const Uz=Symbol.for("v-ndc");function zo(e){return Ji(e)?Qx(Gx,e,!1)||e:e||Uz}function mCt(e){return Qx(hte,e)}function Qx(e,t,n=!0,i=!1){const o=wr||yr;if(o){const s=o.type;if(e===Gx){const a=CC(s,!1);if(a&&(a===t||a===Bs(t)||a===gw(Bs(t))))return s}const r=RT(o[e]||s[e],t)||RT(o.appContext[e],t);return!r&&i?s:r}}function RT(e,t){return e&&(e[t]||e[Bs(t)]||e[gw(Bs(t))])}function wt(e,t,n,i){let o;const s=n&&n[i],r=_n(e);if(r||Ji(e)){const a=r&&Du(e);let l=!1,u=!1;a&&(l=!hl(e),u=_d(e),e=Aw(e)),o=new Array(e.length);for(let c=0,d=e.length;ct(a,l,void 0,s&&s[l]));else{const a=Object.keys(e);o=new Array(a.length);for(let l=0,u=a.length;l{const s=i.fn(...o);return s&&(s.key=i.key),s}:i.fn)}return e}function Kn(e,t,n={},i,o){if(wr.ce||wr.parent&&kd(wr.parent)&&wr.parent.ce){const u=Object.keys(n).length>0;return t!=="default"&&(n.name=t),k(),fe(Ne,null,[G("slot",n,i&&i())],u?-2:64)}let s=e[t];s&&s._c&&(s._d=!1),k();const r=s&&Yx(s(n)),a=n.key||r&&r.key,l=fe(Ne,{key:(a&&!bl(a)?a:`_${t}`)+(!r&&i?"_fb":"")},r||(i?i():[]),r&&e._===1?64:-2);return!o&&l.scopeId&&(l.slotScopeIds=[l.scopeId+"-s"]),s&&s._c&&(s._d=!0),l}function Yx(e){return e.some(t=>Wf(t)?!(t.type===ws||t.type===Ne&&!Yx(t.children)):!0)?e:null}function gCt(e,t){const n={};for(const i in e)n[t&&/[A-Z]/.test(i)?`on:${i}`:fk(i)]=e[i];return n}const mC=e=>e?yj(e)?G2(e):mC(e.parent):null,cv=Ki(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>mC(e.parent),$root:e=>mC(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Jx(e),$forceUpdate:e=>e.f||(e.f=()=>{Ux(e.update)}),$nextTick:e=>e.n||(e.n=pt.bind(e.proxy)),$watch:e=>jee.bind(e)}),x8=(e,t)=>e!==fi&&!e.__isScriptSetup&&Ei(e,t),gC={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:i,data:o,props:s,accessCache:r,type:a,appContext:l}=e;if(t[0]!=="$"){const f=r[t];if(f!==void 0)switch(f){case 1:return i[t];case 2:return o[t];case 4:return n[t];case 3:return s[t]}else{if(x8(i,t))return r[t]=1,i[t];if(o!==fi&&Ei(o,t))return r[t]=2,o[t];if(Ei(s,t))return r[t]=3,s[t];if(n!==fi&&Ei(n,t))return r[t]=4,n[t];vC&&(r[t]=0)}}const u=cv[t];let c,d;if(u)return t==="$attrs"&&Br(e.attrs,"get",""),u(e);if((c=a.__cssModules)&&(c=c[t]))return c;if(n!==fi&&Ei(n,t))return r[t]=4,n[t];if(d=l.config.globalProperties,Ei(d,t))return d[t]},set({_:e},t,n){const{data:i,setupState:o,ctx:s}=e;return x8(o,t)?(o[t]=n,!0):i!==fi&&Ei(i,t)?(i[t]=n,!0):Ei(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(s[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:i,appContext:o,props:s,type:r}},a){let l;return!!(n[a]||e!==fi&&a[0]!=="$"&&Ei(e,a)||x8(t,a)||Ei(s,a)||Ei(i,a)||Ei(cv,a)||Ei(o.config.globalProperties,a)||(l=r.__cssModules)&&l[a])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:Ei(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}},pte=Ki({},gC,{get(e,t){if(t!==Symbol.unscopables)return gC.get(e,t,e)},has(e,t){return t[0]!=="_"&&!UX(t)}});function vCt(){return null}function yCt(){return null}function kCt(e){}function bCt(e){}function wCt(){return null}function ACt(){}function CCt(e,t){return null}function xCt(){return Kz().slots}function yg(){return Kz().attrs}function Kz(e){const t=Is();return t.setupContext||(t.setupContext=wj(t))}function t2(e){return _n(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function SCt(e,t){const n=t2(e);for(const i in t){if(i.startsWith("__skip"))continue;let o=n[i];o?_n(o)||Bn(o)?o=n[i]={type:o,default:t[i]}:o.default=t[i]:o===null&&(o=n[i]={default:t[i]}),o&&t[`__skip_${i}`]&&(o.skipFactory=!0)}return n}function _Ct(e,t){return!e||!t?e||t:_n(e)&&_n(t)?e.concat(t):Ki({},t2(e),t2(t))}function ICt(e,t){const n={};for(const i in e)t.includes(i)||Object.defineProperty(n,i,{enumerable:!0,get:()=>e[i]});return n}function MCt(e){const t=Is(),n=Hp;let i=e();i2(),n&&Mm(!1);const o=()=>{kg(t),n&&Mm(!0)},s=()=>{Is()!==t&&t.scope.off(),i2(),n&&Mm(!1)};return jx(i)&&(i=i.catch(r=>{throw o(),Promise.resolve().then(()=>Promise.resolve().then(s)),r})),[i,()=>{o(),Promise.resolve().then(s)}]}let vC=!0;function mte(e){const t=Jx(e),n=e.proxy,i=e.ctx;vC=!1,t.beforeCreate&&DT(t.beforeCreate,e,"bc");const{data:o,computed:s,methods:r,watch:a,provide:l,inject:u,created:c,beforeMount:d,mounted:f,beforeUpdate:h,updated:m,activated:g,deactivated:y,beforeDestroy:b,beforeUnmount:v,destroyed:w,unmounted:A,render:M,renderTracked:L,renderTriggered:E,errorCaptured:C,serverPrefetch:x,expose:_,inheritAttrs:F,components:I,directives:D,filters:H}=t;if(u&>e(u,i,null),r)for(const R in r){const P=r[R];Bn(P)&&(i[R]=P.bind(n))}if(o){const R=o.call(n,n);Fi(R)&&(e.data=bo(R))}if(vC=!0,s)for(const R in s){const P=s[R],j=Bn(P)?P.bind(n,n):Bn(P.get)?P.get.bind(n,n):Xl,B=!Bn(P)&&Bn(P.set)?P.set.bind(n):Xl,K=O({get:j,set:B});Object.defineProperty(i,R,{enumerable:!0,configurable:!0,get:()=>K.value,set:X=>K.value=X})}if(a)for(const R in a)Zz(a[R],i,n,R);if(l){const R=Bn(l)?l.call(n):l;Reflect.ownKeys(R).forEach(P=>{Qn(P,R[P])})}c&&DT(c,e,"c");function T(R,P){_n(P)?P.forEach(j=>R(j.bind(n))):P&&R(P.bind(n))}if(T(ute,d),T(wn,f),T(Hz,h),T(vg,m),T(rte,g),T(ate,y),T(Wz,C),T(fte,L),T(dte,E),T(ii,v),T(Nn,A),T(cte,x),_n(_))if(_.length){const R=e.exposed||(e.exposed={});_.forEach(P=>{Object.defineProperty(R,P,{get:()=>n[P],set:j=>n[P]=j,enumerable:!0})})}else e.exposed||(e.exposed={});M&&e.render===Xl&&(e.render=M),F!=null&&(e.inheritAttrs=F),I&&(e.components=I),D&&(e.directives=D),x&&Kx(e)}function gte(e,t,n=Xl){_n(e)&&(e=yC(e));for(const i in e){const o=e[i];let s;Fi(o)?"default"in o?s=en(o.from||i,o.default,!0):s=en(o.from||i):s=en(o),Xi(s)?Object.defineProperty(t,i,{enumerable:!0,configurable:!0,get:()=>s.value,set:r=>s.value=r}):t[i]=s}}function DT(e,t,n){iu(_n(e)?e.map(i=>i.bind(t.proxy)):e.bind(t.proxy),t,n)}function Zz(e,t,n,i){let o=i.includes(".")?Fz(n,i):()=>n[i];if(Ji(e)){const s=t[e];Bn(s)&&Be(o,s)}else if(Bn(e))Be(o,e.bind(n));else if(Fi(e))if(_n(e))e.forEach(s=>Zz(s,t,n,i));else{const s=Bn(e.handler)?e.handler.bind(n):t[e.handler];Bn(s)&&Be(o,s,e)}}function Jx(e){const t=e.type,{mixins:n,extends:i}=t,{mixins:o,optionsCache:s,config:{optionMergeStrategies:r}}=e.appContext,a=s.get(t);let l;return a?l=a:!o.length&&!n&&!i?l=t:(l={},o.length&&o.forEach(u=>vb(l,u,r,!0)),vb(l,t,r)),Fi(t)&&s.set(t,l),l}function vb(e,t,n,i=!1){const{mixins:o,extends:s}=t;s&&vb(e,s,n,!0),o&&o.forEach(r=>vb(e,r,n,!0));for(const r in t)if(!(i&&r==="expose")){const a=vte[r]||n&&n[r];e[r]=a?a(e[r],t[r]):t[r]}return e}const vte={data:OT,props:PT,emits:PT,methods:P0,computed:P0,beforeCreate:Xr,created:Xr,beforeMount:Xr,mounted:Xr,beforeUpdate:Xr,updated:Xr,beforeDestroy:Xr,beforeUnmount:Xr,destroyed:Xr,unmounted:Xr,activated:Xr,deactivated:Xr,errorCaptured:Xr,serverPrefetch:Xr,components:P0,directives:P0,watch:kte,provide:OT,inject:yte};function OT(e,t){return t?e?function(){return Ki(Bn(e)?e.call(this,this):e,Bn(t)?t.call(this,this):t)}:t:e}function yte(e,t){return P0(yC(e),yC(t))}function yC(e){if(_n(e)){const t={};for(let n=0;n{let c,d=fi,f;return zee(()=>{const h=e[o];Zs(c,h)&&(c=h,u())}),{get(){return l(),n.get?n.get(c):c},set(h){const m=n.set?n.set(h):h;if(!Zs(m,c)&&!(d!==fi&&Zs(h,d)))return;const g=i.vnode.props,y=!!(g&&(t in g||o in g||s in g)&&(`onUpdate:${t}`in g||`onUpdate:${o}`in g||`onUpdate:${s}`in g));y||(c=h,u()),i.emit(`update:${t}`,m),Zs(h,d)&&(Zs(h,m)&&!Zs(m,f)||y&&d!==fi&&!Zs(m,c))&&u(),d=h,f=m}}});return a[Symbol.iterator]=()=>{let l=0;return{next(){return l<2?{value:l++?r||fi:a,done:!1}:{done:!0}}}},a}const Qz=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Bs(t)}Modifiers`]||e[`${Ra(t)}Modifiers`];function Ate(e,t,...n){if(e.isUnmounted)return;const i=e.vnode.props||fi;let o=n;const s=t.startsWith("update:"),r=s&&Qz(i,t.slice(7));r&&(r.trim&&(o=n.map(c=>Ji(c)?c.trim():c)),r.number&&(o=n.map(vw)));let a,l=i[a=fk(t)]||i[a=fk(Bs(t))];!l&&s&&(l=i[a=fk(Ra(t))]),l&&iu(l,e,6,o);const u=i[a+"Once"];if(u){if(!e.emitted)e.emitted={};else if(e.emitted[a])return;e.emitted[a]=!0,iu(u,e,6,o)}}const Cte=new WeakMap;function Yz(e,t,n=!1){const i=n?Cte:t.emitsCache,o=i.get(e);if(o!==void 0)return o;const s=e.emits;let r={},a=!1;if(!Bn(e)){const l=u=>{const c=Yz(u,t,!0);c&&(a=!0,Ki(r,c))};!n&&t.mixins.length&&t.mixins.forEach(l),e.extends&&l(e.extends),e.mixins&&e.mixins.forEach(l)}return!s&&!a?(Fi(e)&&i.set(e,null),null):(_n(s)?s.forEach(l=>r[l]=null):Ki(r,s),Fi(e)&&i.set(e,r),r)}function Mw(e,t){return!e||!U2(t)?!1:(t=t.slice(2),t=t==="Once"?t:t.replace(/Once$/,""),Ei(e,t[0].toLowerCase()+t.slice(1))||Ei(e,Ra(t))||Ei(e,t))}function pk(e){const{type:t,vnode:n,proxy:i,withProxy:o,propsOptions:[s],slots:r,attrs:a,emit:l,render:u,renderCache:c,props:d,data:f,setupState:h,ctx:m,inheritAttrs:g}=e,y=Xv(e);let b,v;try{if(n.shapeFlag&4){const A=o||i,M=A;b=Fa(u.call(M,A,c,d,h,f,m)),v=a}else{const A=t;b=Fa(A.length>1?A(d,{attrs:a,slots:r,emit:l}):A(d,null)),v=t.props?a:Ste(a)}}catch(A){dv.length=0,gg(A,e,1),b=G(ws)}let w=b;if(v&&g!==!1){const A=Object.keys(v),{shapeFlag:M}=w;A.length&&M&7&&(s&&A.some(fw)&&(v=_te(v,s)),w=Id(w,v,!1,!0))}return n.dirs&&(w=Id(w,null,!1,!0),w.dirs=w.dirs?w.dirs.concat(n.dirs):n.dirs),n.transition&&Hf(w,n.transition),b=w,Xv(y),b}function xte(e,t=!0){let n;for(let i=0;i{let t;for(const n in e)(n==="class"||n==="style"||U2(n))&&((t||(t={}))[n]=e[n]);return t},_te=(e,t)=>{const n={};for(const i in e)(!fw(i)||!(i.slice(9)in t))&&(n[i]=e[i]);return n};function Ite(e,t,n){const{props:i,children:o,component:s}=e,{props:r,children:a,patchFlag:l}=t,u=s.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return i?BT(i,r,u):!!r;if(l&8){const c=t.dynamicProps;for(let d=0;dObject.create(Xz),tj=e=>Object.getPrototypeOf(e)===Xz;function Mte(e,t,n,i=!1){const o={},s=ej();e.propsDefaults=Object.create(null),nj(e,t,o,s);for(const r in e.propsOptions[0])r in o||(o[r]=void 0);n?e.props=i?o:zp(o):e.type.props?e.props=o:e.props=s,e.attrs=s}function Tte(e,t,n,i){const{props:o,attrs:s,vnode:{patchFlag:r}}=e,a=vi(o),[l]=e.propsOptions;let u=!1;if((i||r>0)&&!(r&16)){if(r&8){const c=e.vnode.dynamicProps;for(let d=0;d{l=!0;const[f,h]=ij(d,t,!0);Ki(r,f),h&&a.push(...h)};!n&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}if(!s&&!l)return Fi(e)&&i.set(e,bm),bm;if(_n(s))for(let c=0;ce==="_"||e==="_ctx"||e==="$stable",eS=e=>_n(e)?e.map(Fa):[Fa(e)],Lte=(e,t,n)=>{if(t._n)return t;const i=de((...o)=>eS(t(...o)),n);return i._c=!1,i},oj=(e,t,n)=>{const i=e._ctx;for(const o in e){if(Xx(o))continue;const s=e[o];if(Bn(s))t[o]=Lte(o,s,i);else if(s!=null){const r=eS(s);t[o]=()=>r}}},sj=(e,t)=>{const n=eS(t);e.slots.default=()=>n},rj=(e,t,n)=>{for(const i in t)(n||!Xx(i))&&(e[i]=t[i])},Nte=(e,t,n)=>{const i=e.slots=ej();if(e.vnode.shapeFlag&32){const o=t._;o?(rj(i,t,n),n&&sz(i,"_",o,!0)):oj(t,i)}else t&&sj(e,t)},Fte=(e,t,n)=>{const{vnode:i,slots:o}=e;let s=!0,r=fi;if(i.shapeFlag&32){const a=t._;a?n&&a===1?s=!1:rj(o,t,n):(s=!t.$stable,oj(t,o)),r=t}else t&&(sj(e,t),r={default:1});if(s)for(const a in o)!Xx(a)&&r[a]==null&&delete o[a]},ps=fj;function Rte(e){return aj(e)}function Dte(e){return aj(e,Qee)}function aj(e,t){const n=yw();n.__VUE__=!0;const{insert:i,remove:o,patchProp:s,createElement:r,createText:a,createComment:l,setText:u,setElementText:c,parentNode:d,nextSibling:f,setScopeId:h=Xl,insertStaticContent:m}=e,g=(U,Y,ce,me=null,ge=null,oe=null,re=void 0,ve=null,le=!!Y.dynamicChildren)=>{if(U===Y)return;U&&!Iu(U,Y)&&(me=Ce(U),X(U,ge,oe,!0),U=null),Y.patchFlag===-2&&(le=!1,Y.dynamicChildren=null);const{type:xe,ref:be,shapeFlag:pe}=Y;switch(xe){case Lf:y(U,Y,ce,me);break;case ws:b(U,Y,ce,me);break;case Im:U==null&&v(Y,ce,me,re);break;case Ne:I(U,Y,ce,me,ge,oe,re,ve,le);break;default:pe&1?M(U,Y,ce,me,ge,oe,re,ve,le):pe&6?D(U,Y,ce,me,ge,oe,re,ve,le):(pe&64||pe&128)&&xe.process(U,Y,ce,me,ge,oe,re,ve,le,he)}be!=null&&ge?Sm(be,U&&U.ref,oe,Y||U,!Y):be==null&&U&&U.ref!=null&&Sm(U.ref,null,oe,U,!0)},y=(U,Y,ce,me)=>{if(U==null)i(Y.el=a(Y.children),ce,me);else{const ge=Y.el=U.el;Y.children!==U.children&&u(ge,Y.children)}},b=(U,Y,ce,me)=>{U==null?i(Y.el=l(Y.children||""),ce,me):Y.el=U.el},v=(U,Y,ce,me)=>{[U.el,U.anchor]=m(U.children,Y,ce,me,U.el,U.anchor)},w=({el:U,anchor:Y},ce,me)=>{let ge;for(;U&&U!==Y;)ge=f(U),i(U,ce,me),U=ge;i(Y,ce,me)},A=({el:U,anchor:Y})=>{let ce;for(;U&&U!==Y;)ce=f(U),o(U),U=ce;o(Y)},M=(U,Y,ce,me,ge,oe,re,ve,le)=>{if(Y.type==="svg"?re="svg":Y.type==="math"&&(re="mathml"),U==null)L(Y,ce,me,ge,oe,re,ve,le);else{const xe=U.el&&U.el._isVueCE?U.el:null;try{xe&&xe._beginPatch(),x(U,Y,ge,oe,re,ve,le)}finally{xe&&xe._endPatch()}}},L=(U,Y,ce,me,ge,oe,re,ve)=>{let le,xe;const{props:be,shapeFlag:pe,transition:Te,dirs:Ae}=U;if(le=U.el=r(U.type,oe,be&&be.is,be),pe&8?c(le,U.children):pe&16&&C(U.children,le,null,me,ge,S8(U,oe),re,ve),Ae&&dc(U,null,me,"created"),E(le,U,U.scopeId,re,me),be){for(const Fe in be)Fe!=="value"&&!Sp(Fe)&&s(le,Fe,null,be[Fe],oe,me);"value"in be&&s(le,"value",null,be.value,oe),(xe=be.onVnodeBeforeMount)&&Ea(xe,me,U)}Ae&&dc(U,null,me,"beforeMount");const _e=lj(ge,Te);_e&&Te.beforeEnter(le),i(le,Y,ce),((xe=be&&be.onVnodeMounted)||_e||Ae)&&ps(()=>{try{xe&&Ea(xe,me,U),_e&&Te.enter(le),Ae&&dc(U,null,me,"mounted")}finally{}},ge)},E=(U,Y,ce,me,ge)=>{if(ce&&h(U,ce),me)for(let oe=0;oe{for(let xe=le;xe{const ve=Y.el=U.el;let{patchFlag:le,dynamicChildren:xe,dirs:be}=Y;le|=U.patchFlag&16;const pe=U.props||fi,Te=Y.props||fi;let Ae;if(ce&&Oh(ce,!1),(Ae=Te.onVnodeBeforeUpdate)&&Ea(Ae,ce,Y,U),be&&dc(Y,U,ce,"beforeUpdate"),ce&&Oh(ce,!0),xe&&(!U.dynamicChildren||U.dynamicChildren.length!==xe.length)&&(le=0,re=!1,xe=null),(pe.innerHTML&&Te.innerHTML==null||pe.textContent&&Te.textContent==null)&&c(ve,""),xe?_(U.dynamicChildren,xe,ve,ce,me,S8(Y,ge),oe):re||P(U,Y,ve,null,ce,me,S8(Y,ge),oe,!1),le>0){if(le&16)F(ve,pe,Te,ce,ge);else if(le&2&&pe.class!==Te.class&&s(ve,"class",null,Te.class,ge),le&4&&s(ve,"style",pe.style,Te.style,ge),le&8){const _e=Y.dynamicProps;for(let Fe=0;Fe<_e.length;Fe++){const $e=_e[Fe],Je=pe[$e],ht=Te[$e];(ht!==Je||$e==="value")&&s(ve,$e,Je,ht,ge,ce)}}le&1&&U.children!==Y.children&&c(ve,Y.children)}else!re&&xe==null&&F(ve,pe,Te,ce,ge);((Ae=Te.onVnodeUpdated)||be)&&ps(()=>{Ae&&Ea(Ae,ce,Y,U),be&&dc(Y,U,ce,"updated")},me)},_=(U,Y,ce,me,ge,oe,re)=>{for(let ve=0;ve{if(Y!==ce){if(Y!==fi)for(const oe in Y)!Sp(oe)&&!(oe in ce)&&s(U,oe,Y[oe],null,ge,me);for(const oe in ce){if(Sp(oe))continue;const re=ce[oe],ve=Y[oe];re!==ve&&oe!=="value"&&s(U,oe,ve,re,ge,me)}"value"in ce&&s(U,"value",Y.value,ce.value,ge)}},I=(U,Y,ce,me,ge,oe,re,ve,le)=>{const xe=Y.el=U?U.el:a(""),be=Y.anchor=U?U.anchor:a("");let{patchFlag:pe,dynamicChildren:Te,slotScopeIds:Ae}=Y;Ae&&(ve=ve?ve.concat(Ae):Ae),U==null?(i(xe,ce,me),i(be,ce,me),C(Y.children||[],ce,be,ge,oe,re,ve,le)):pe>0&&pe&64&&Te&&U.dynamicChildren&&U.dynamicChildren.length===Te.length?(_(U.dynamicChildren,Te,ce,ge,oe,re,ve),(Y.key!=null||ge&&Y===ge.subTree)&&tS(U,Y,!0)):P(U,Y,ce,be,ge,oe,re,ve,le)},D=(U,Y,ce,me,ge,oe,re,ve,le)=>{Y.slotScopeIds=ve,U==null?Y.shapeFlag&512?ge.ctx.activate(Y,ce,me,re,le):H(Y,ce,me,ge,oe,re,le):$(U,Y,le)},H=(U,Y,ce,me,ge,oe,re)=>{const ve=U.component=vj(U,me,ge);if(Z2(U)&&(ve.ctx.renderer=he),kj(ve,!1,re),ve.asyncDep){if(ge&&ge.registerDep(ve,T,re),!U.el){const le=ve.subTree=G(ws);b(null,le,Y,ce),U.placeholder=le.el}}else T(ve,U,Y,ce,ge,oe,re)},$=(U,Y,ce)=>{const me=Y.component=U.component;if(Ite(U,Y,ce))if(me.asyncDep&&!me.asyncResolved){R(me,Y,ce);return}else me.next=Y,me.update();else Y.el=U.el,me.vnode=Y},T=(U,Y,ce,me,ge,oe,re)=>{const ve=()=>{if(U.isMounted){let{next:pe,bu:Te,u:Ae,parent:_e,vnode:Fe}=U;{const Ot=uj(U);if(Ot){pe&&(pe.el=Fe.el,R(U,pe,re)),Ot.asyncDep.then(()=>{ps(()=>{U.isUnmounted||xe()},ge)});return}}let $e=pe,Je;Oh(U,!1),pe?(pe.el=Fe.el,R(U,pe,re)):pe=Fe,Te&&Am(Te),(Je=pe.props&&pe.props.onVnodeBeforeUpdate)&&Ea(Je,_e,pe,Fe),Oh(U,!0);const ht=pk(U),Nt=U.subTree;U.subTree=ht,g(Nt,ht,d(Nt.el),Ce(Nt),U,ge,oe),pe.el=ht.el,$e===null&&Tw(U,ht.el),Ae&&ps(Ae,ge),(Je=pe.props&&pe.props.onVnodeUpdated)&&ps(()=>Ea(Je,_e,pe,Fe),ge)}else{let pe;const{el:Te,props:Ae}=Y,{bm:_e,m:Fe,parent:$e,root:Je,type:ht}=U,Nt=kd(Y);if(Oh(U,!1),_e&&Am(_e),!Nt&&(pe=Ae&&Ae.onVnodeBeforeMount)&&Ea(pe,$e,Y),Oh(U,!0),Te&&te){const Ot=()=>{U.subTree=pk(U),te(Te,U.subTree,U,ge,null)};Nt&&ht.__asyncHydrate?ht.__asyncHydrate(Te,U,Ot):Ot()}else{Je.ce&&Je.ce._hasShadowRoot()&&Je.ce._injectChildStyle(ht,U.parent?U.parent.type:void 0);const Ot=U.subTree=pk(U);g(null,Ot,ce,me,U,ge,oe),Y.el=Ot.el}if(Fe&&ps(Fe,ge),!Nt&&(pe=Ae&&Ae.onVnodeMounted)){const Ot=Y;ps(()=>Ea(pe,$e,Ot),ge)}(Y.shapeFlag&256||$e&&kd($e.vnode)&&$e.vnode.shapeFlag&256)&&U.a&&ps(U.a,ge),U.isMounted=!0,Y=ce=me=null}};U.scope.on();const le=U.effect=new lb(ve);U.scope.off();const xe=U.update=le.run.bind(le),be=U.job=le.runIfDirty.bind(le);be.i=U,be.id=U.uid,le.scheduler=()=>Ux(be),Oh(U,!0),xe()},R=(U,Y,ce)=>{Y.component=U;const me=U.vnode.props;U.vnode=Y,U.next=null,Tte(U,Y.props,me,ce),Fte(U,Y.children,ce),Nc(),IT(U),Fc()},P=(U,Y,ce,me,ge,oe,re,ve,le=!1)=>{const xe=U&&U.children,be=U?U.shapeFlag:0,pe=Y.children,{patchFlag:Te,shapeFlag:Ae}=Y;if(Te>0){if(Te&128){B(xe,pe,ce,me,ge,oe,re,ve,le);return}else if(Te&256){j(xe,pe,ce,me,ge,oe,re,ve,le);return}}Ae&8?(be&16&&ee(xe,ge,oe),pe!==xe&&c(ce,pe)):be&16?Ae&16?B(xe,pe,ce,me,ge,oe,re,ve,le):ee(xe,ge,oe,!0):(be&8&&c(ce,""),Ae&16&&C(pe,ce,me,ge,oe,re,ve,le))},j=(U,Y,ce,me,ge,oe,re,ve,le)=>{U=U||bm,Y=Y||bm;const xe=U.length,be=Y.length,pe=Math.min(xe,be);let Te;for(Te=0;Tebe?ee(U,ge,oe,!0,!1,pe):C(Y,ce,me,ge,oe,re,ve,le,pe)},B=(U,Y,ce,me,ge,oe,re,ve,le)=>{let xe=0;const be=Y.length;let pe=U.length-1,Te=be-1;for(;xe<=pe&&xe<=Te;){const Ae=U[xe],_e=Y[xe]=le?rd(Y[xe]):Fa(Y[xe]);if(Iu(Ae,_e))g(Ae,_e,ce,null,ge,oe,re,ve,le);else break;xe++}for(;xe<=pe&&xe<=Te;){const Ae=U[pe],_e=Y[Te]=le?rd(Y[Te]):Fa(Y[Te]);if(Iu(Ae,_e))g(Ae,_e,ce,null,ge,oe,re,ve,le);else break;pe--,Te--}if(xe>pe){if(xe<=Te){const Ae=Te+1,_e=AeTe)for(;xe<=pe;)X(U[xe],ge,oe,!0),xe++;else{const Ae=xe,_e=xe,Fe=new Map;for(xe=_e;xe<=Te;xe++){const ue=Y[xe]=le?rd(Y[xe]):Fa(Y[xe]);ue.key!=null&&Fe.set(ue.key,xe)}let $e,Je=0;const ht=Te-_e+1;let Nt=!1,Ot=0;const _t=new Array(ht);for(xe=0;xe=ht){X(ue,ge,oe,!0);continue}let Le;if(ue.key!=null)Le=Fe.get(ue.key);else for($e=_e;$e<=Te;$e++)if(_t[$e-_e]===0&&Iu(ue,Y[$e])){Le=$e;break}Le===void 0?X(ue,ge,oe,!0):(_t[Le-_e]=xe+1,Le>=Ot?Ot=Le:Nt=!0,g(ue,Y[Le],ce,null,ge,oe,re,ve,le),Je++)}const dt=Nt?Ote(_t):bm;for($e=dt.length-1,xe=ht-1;xe>=0;xe--){const ue=_e+xe,Le=Y[ue],Oe=Y[ue+1],Ge=ue+1{const{el:oe,type:re,transition:ve,children:le,shapeFlag:xe}=U;if(xe&6){K(U.component.subTree,Y,ce,me);return}if(xe&128){U.suspense.move(Y,ce,me);return}if(xe&64){re.move(U,Y,ce,he);return}if(re===Ne){i(oe,Y,ce);for(let pe=0;peve.enter(oe),ge));else{const{leave:pe,delayLeave:Te,afterLeave:Ae}=ve,_e=()=>{U.ctx.isUnmounted?o(oe):i(oe,Y,ce)},Fe=()=>{const $e=oe._isLeaving||!!oe[Hl];oe._isLeaving&&oe[Hl](!0),ve.persisted&&!$e?_e():pe(oe,()=>{_e(),Ae&&Ae()})};Te?Te(oe,_e,Fe):Fe()}else i(oe,Y,ce)},X=(U,Y,ce,me=!1,ge=!1)=>{const{type:oe,props:re,ref:ve,children:le,dynamicChildren:xe,shapeFlag:be,patchFlag:pe,dirs:Te,cacheIndex:Ae,memo:_e}=U;if(pe===-2&&(ge=!1),ve!=null&&(Nc(),Sm(ve,null,ce,U,!0),Fc()),Ae!=null&&(Y.renderCache[Ae]=void 0),be&256){Y.ctx.deactivate(U);return}const Fe=be&1&&Te,$e=!kd(U);let Je;if($e&&(Je=re&&re.onVnodeBeforeUnmount)&&Ea(Je,Y,U),be&6)ie(U.component,ce,me);else{if(be&128){U.suspense.unmount(ce,me);return}Fe&&dc(U,null,Y,"beforeUnmount"),be&64?U.type.remove(U,Y,ce,he,me):xe&&!xe.hasOnce&&(oe!==Ne||pe>0&&pe&64)?ee(xe,Y,ce,!1,!0):(oe===Ne&&pe&384||!ge&&be&16)&&ee(le,Y,ce),me&&V(U)}const ht=_e!=null&&Ae==null;($e&&(Je=re&&re.onVnodeUnmounted)||Fe||ht)&&ps(()=>{Je&&Ea(Je,Y,U),Fe&&dc(U,null,Y,"unmounted"),ht&&(U.el=null)},ce)},V=U=>{const{type:Y,el:ce,anchor:me,transition:ge}=U;if(Y===Ne){Q(ce,me);return}if(Y===Im){A(U);return}const oe=()=>{o(ce),ge&&!ge.persisted&&ge.afterLeave&&ge.afterLeave()};if(U.shapeFlag&1&&ge&&!ge.persisted){const{leave:re,delayLeave:ve}=ge,le=()=>re(ce,oe);ve?ve(U.el,oe,le):le()}else oe()},Q=(U,Y)=>{let ce;for(;U!==Y;)ce=f(U),o(U),U=ce;o(Y)},ie=(U,Y,ce)=>{const{bum:me,scope:ge,job:oe,subTree:re,um:ve,m:le,a:xe}=U;yb(le),yb(xe),me&&Am(me),ge.stop(),oe&&(oe.flags|=8,X(re,U,Y,ce)),ve&&ps(ve,Y),ps(()=>{U.isUnmounted=!0},Y)},ee=(U,Y,ce,me=!1,ge=!1,oe=0)=>{for(let re=oe;re{if(U.shapeFlag&6)return Ce(U.component.subTree);if(U.shapeFlag&128)return U.suspense.next();const Y=f(U.anchor||U.el),ce=Y&&Y[Rz];return ce?f(ce):Y};let Z=!1;const ae=(U,Y,ce)=>{let me;U==null?Y._vnode&&(X(Y._vnode,null,null,!0),me=Y._vnode.component):g(Y._vnode||null,U,Y,null,null,null,ce),Y._vnode=U,Z||(Z=!0,IT(me),pb(),Z=!1)},he={p:g,um:X,m:K,r:V,mt:H,mc:C,pc:P,pbc:_,n:Ce,o:e};let J,te;return t&&([J,te]=t(he)),{render:ae,hydrate:J,createApp:wte(ae,J)}}function S8({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function Oh({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function lj(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function tS(e,t,n=!1){const i=e.children,o=t.children;if(_n(i)&&_n(o))for(let s=0;s>1,e[n[a]]0&&(t[i]=n[s-1]),n[s]=i)}}for(s=n.length,r=n[s-1];s-- >0;)n[s]=r,r=t[r];return n}function uj(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:uj(t)}function yb(e){if(e)for(let t=0;te.__isSuspense;let bC=0;const Pte={name:"Suspense",__isSuspense:!0,process(e,t,n,i,o,s,r,a,l,u){if(e==null)Bte(t,n,i,o,s,r,a,l,u);else{if(s&&s.deps>0&&!e.suspense.isInFallback){t.suspense=e.suspense,t.suspense.vnode=t,t.el=e.el;return}$te(e,t,n,i,o,r,a,l,u)}},hydrate:zte,normalize:jte},ECt=Pte;function n2(e,t){const n=e.props&&e.props[t];Bn(n)&&n()}function Bte(e,t,n,i,o,s,r,a,l){const{p:u,o:{createElement:c}}=l,d=c("div"),f=e.suspense=dj(e,o,i,t,d,n,s,r,a,l);u(null,f.pendingBranch=e.ssContent,d,null,i,f,s,r),f.deps>0?(n2(e,"onPending"),n2(e,"onFallback"),u(null,e.ssFallback,t,n,i,null,s,r),_m(f,e.ssFallback)):f.resolve(!1,!0)}function $te(e,t,n,i,o,s,r,a,{p:l,um:u,o:{createElement:c}}){const d=t.suspense=e.suspense;d.vnode=t,t.el=e.el;const f=t.ssContent,h=t.ssFallback,{activeBranch:m,pendingBranch:g,isInFallback:y,isHydrating:b}=d;if(g)d.pendingBranch=f,Iu(g,f)?(l(g,f,d.hiddenContainer,null,o,d,s,r,a),d.deps<=0?d.resolve():y&&(b||(l(m,h,n,i,o,null,s,r,a),_m(d,h)))):(d.pendingId=bC++,b?(d.isHydrating=!1,d.activeBranch=g):u(g,o,d),d.deps=0,d.effects.length=0,d.hiddenContainer=c("div"),y?(l(null,f,d.hiddenContainer,null,o,d,s,r,a),d.deps<=0?d.resolve():(l(m,h,n,i,o,null,s,r,a),_m(d,h))):m&&Iu(m,f)?(l(m,f,n,i,o,d,s,r,a),d.resolve(!0)):(l(null,f,d.hiddenContainer,null,o,d,s,r,a),d.deps<=0&&d.resolve()));else if(m&&Iu(m,f))l(m,f,n,i,o,d,s,r,a),_m(d,f);else if(n2(t,"onPending"),d.pendingBranch=f,f.shapeFlag&512?d.pendingId=f.component.suspenseId:d.pendingId=bC++,l(null,f,d.hiddenContainer,null,o,d,s,r,a),d.deps<=0)d.resolve();else{const{timeout:v,pendingId:w}=d;v>0?setTimeout(()=>{d.pendingId===w&&d.fallback(h)},v):v===0&&d.fallback(h)}}function dj(e,t,n,i,o,s,r,a,l,u,c=!1){const{p:d,m:f,um:h,n:m,o:{parentNode:g,remove:y}}=u;let b;const v=Hte(e);v&&t&&t.pendingBranch&&(b=t.pendingId,t.deps++);const w=e.props?ab(e.props.timeout):void 0,A=s,M={vnode:e,parent:t,parentComponent:n,namespace:r,container:i,hiddenContainer:o,deps:0,pendingId:bC++,timeout:typeof w=="number"?w:-1,activeBranch:null,isFallbackMountPending:!1,pendingBranch:null,isInFallback:!c,isHydrating:c,isUnmounted:!1,effects:[],resolve(L=!1,E=!1){const{vnode:C,activeBranch:x,pendingBranch:_,pendingId:F,effects:I,parentComponent:D,container:H,isInFallback:$}=M;let T=!1;if(M.isHydrating)M.isHydrating=!1;else if(!L){T=x&&_.transition&&_.transition.mode==="out-in";let j=!1;T&&(x.transition.afterLeave=()=>{F===M.pendingId&&(f(_,H,s===A&&!j?m(x):s,0),hb(I),$&&C.ssFallback&&(C.ssFallback.el=null))}),x&&!M.isFallbackMountPending&&(g(x.el)===H&&(s=m(x),j=!0),h(x,D,M,!0),!T&&$&&C.ssFallback&&ps(()=>C.ssFallback.el=null,M)),T||f(_,H,s,0)}M.isFallbackMountPending=!1,_m(M,_),M.pendingBranch=null,M.isInFallback=!1;let R=M.parent,P=!1;for(;R;){if(R.pendingBranch){R.effects.push(...I),P=!0;break}R=R.parent}!P&&!T&&hb(I),M.effects=[],v&&t&&t.pendingBranch&&b===t.pendingId&&(t.deps--,t.deps===0&&!E&&t.resolve()),n2(C,"onResolve")},fallback(L){if(!M.pendingBranch)return;const{vnode:E,activeBranch:C,parentComponent:x,container:_,namespace:F}=M;n2(E,"onFallback");const I=m(C),D=()=>{M.isFallbackMountPending=!1,M.isInFallback&&(d(null,L,_,I,x,null,F,a,l),_m(M,L))},H=L.transition&&L.transition.mode==="out-in";H&&(M.isFallbackMountPending=!0,C.transition.afterLeave=D),M.isInFallback=!0,h(C,x,null,!0),H||D()},move(L,E,C){M.activeBranch&&f(M.activeBranch,L,E,C),M.container=L},next(){return M.activeBranch&&m(M.activeBranch)},registerDep(L,E,C){const x=!!M.pendingBranch;x&&M.deps++;const _=L.vnode.el;L.asyncDep.catch(F=>{gg(F,L,0)}).then(F=>{if(L.isUnmounted||M.isUnmounted||M.pendingId!==L.suspenseId)return;i2(),L.asyncResolved=!0;const{vnode:I}=L;wC(L,F,!1),_&&(I.el=_);const D=!_&&L.subTree.el;E(L,I,g(_||L.subTree.el),_?null:m(L.subTree),M,r,C),D&&(I.placeholder=null,y(D)),Tw(L,I.el),x&&--M.deps===0&&M.resolve()})},unmount(L,E){M.isUnmounted=!0,M.activeBranch&&h(M.activeBranch,n,L,E),M.pendingBranch&&h(M.pendingBranch,n,L,E)}};return M}function zte(e,t,n,i,o,s,r,a,l){const u=t.suspense=dj(t,i,n,e.parentNode,document.createElement("div"),null,o,s,r,a,!0),c=l(e,u.pendingBranch=t.ssContent,n,u,s,r);return u.deps===0&&u.resolve(!1,!0),c}function jte(e){const{shapeFlag:t,children:n}=e,i=t&32;e.ssContent=zT(i?n.default:n),e.ssFallback=i?zT(n.fallback):G(ws)}function zT(e){let t;if(Bn(e)){const n=jp&&e._c;n&&(e._d=!1,k()),e=e(),n&&(e._d=!0,t=zr,hj())}return _n(e)&&(e=xte(e)),e=Fa(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(n=>n!==e)),e}function fj(e,t){t&&t.pendingBranch?_n(e)?t.effects.push(...e):t.effects.push(e):hb(e)}function _m(e,t){e.activeBranch=t;const{vnode:n,parentComponent:i}=e;let o=t.el;for(;!o&&t.component;)t=t.component.subTree,o=t.el;n.el=o,i&&i.subTree===n&&(i.vnode.el=o,Tw(i,o))}function Hte(e){const t=e.props&&e.props.suspensible;return t!=null&&t!==!1}const Ne=Symbol.for("v-fgt"),Lf=Symbol.for("v-txt"),ws=Symbol.for("v-cmt"),Im=Symbol.for("v-stc"),dv=[];let zr=null;function k(e=!1){dv.push(zr=e?null:[])}function hj(){dv.pop(),zr=dv[dv.length-1]||null}let jp=1;function bb(e,t=!1){jp+=e,e<0&&zr&&t&&(zr.hasOnce=!0)}function pj(e){return e.dynamicChildren=jp>0?zr||bm:null,hj(),jp>0&&zr&&zr.push(e),e}function N(e,t,n,i,o,s){return pj(S(e,t,n,i,o,s,!0))}function fe(e,t,n,i,o){return pj(G(e,t,n,i,o,!0))}function Wf(e){return e?e.__v_isVNode===!0:!1}function Iu(e,t){return e.type===t.type&&e.key===t.key}function LCt(e){}const mj=({key:e})=>e??null,mk=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Ji(e)||Xi(e)||Bn(e)?{i:wr,r:e,k:t,f:!!n}:e:null);function S(e,t=null,n=null,i=0,o=null,s=e===Ne?0:1,r=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&mj(t),ref:t&&mk(t),scopeId:_w,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:s,patchFlag:i,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:wr};return a?(wb(l,n),s&128&&e.normalize(l)):n&&(l.shapeFlag|=Ji(n)?8:16),jp>0&&!r&&zr&&(l.patchFlag>0||s&6)&&l.patchFlag!==32&&zr.push(l),l}const G=Wte;function Wte(e,t=null,n=null,i=0,o=null,s=!1){if((!e||e===Uz)&&(e=ws),Wf(e)){const a=Id(e,t,!0);return n&&wb(a,n),jp>0&&!s&&zr&&(a.shapeFlag&6?zr[zr.indexOf(e)]=a:zr.push(a)),a.patchFlag=-2,a}if(Zte(e)&&(e=e.__vccOpts),t){t=gj(t);let{class:a,style:l}=t;a&&!Ji(a)&&(t.class=De(a)),Fi(l)&&(Sw(l)&&!_n(l)&&(l=Ki({},l)),t.style=an(l))}const r=Ji(e)?1:kb(e)?128:Dz(e)?64:Fi(e)?4:Bn(e)?2:0;return S(e,t,n,i,o,r,s,!0)}function gj(e){return e?Sw(e)||tj(e)?Ki({},e):e:null}function Id(e,t,n=!1,i=!1){const{props:o,ref:s,patchFlag:r,children:a,transition:l}=e,u=t?ci(o||{},t):o,c={__v_isVNode:!0,__v_skip:!0,type:e.type,props:u,key:u&&mj(u),ref:t&&t.ref?n&&s?_n(s)?s.concat(mk(t)):[s,mk(t)]:mk(t):s,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:a,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Ne?r===-1?16:r|16:r,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:l,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Id(e.ssContent),ssFallback:e.ssFallback&&Id(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&i&&Hf(c,l.clone(c)),c}function Pe(e=" ",t=0){return G(Lf,null,e,t)}function lh(e,t){const n=G(Im,null,e);return n.staticCount=t,n}function ne(e="",t=!1){return t?(k(),fe(ws,null,e)):G(ws,null,e)}function Fa(e){return e==null||typeof e=="boolean"?G(ws):_n(e)?G(Ne,null,e.slice()):Wf(e)?rd(e):G(Lf,null,String(e))}function rd(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Id(e)}function wb(e,t){let n=0;const{shapeFlag:i}=e;if(t==null)t=null;else if(_n(t))n=16;else if(typeof t=="object")if(i&65){const o=t.default;o&&(o._c&&(o._d=!1),wb(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!tj(t)?t._ctx=wr:o===3&&wr&&(wr.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else if(Bn(t)){if(i&65){wb(e,{default:t});return}t={default:t,_ctx:wr},n=32}else t=String(t),i&64?(n=16,t=[Pe(t)]):n=8;e.children=t,e.shapeFlag|=n}function ci(...e){const t={};for(let n=0;nyr||wr;let Ab,Mm;{const e=yw(),t=(n,i)=>{let o;return(o=e[n])||(o=e[n]=[]),o.push(i),s=>{o.length>1?o.forEach(r=>r(s)):o[0](s)}};Ab=t("__VUE_INSTANCE_SETTERS__",n=>yr=n),Mm=t("__VUE_SSR_SETTERS__",n=>Hp=n)}const kg=e=>{const t=yr;return Ab(e),e.scope.on(),()=>{e.scope.off(),Ab(t)}},i2=()=>{yr&&yr.scope.off(),Ab(null)};function yj(e){return e.vnode.shapeFlag&4}let Hp=!1;function kj(e,t=!1,n=!1){t&&Mm(t);const{props:i,children:o}=e.vnode,s=yj(e);Mte(e,i,s,t),Nte(e,o,n||t);const r=s?Vte(e,t):void 0;return t&&Mm(!1),r}function Vte(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,gC);const{setup:i}=n;if(i){Nc();const o=e.setupContext=i.length>1?wj(e):null,s=kg(e),r=V2(i,e,0,[e.props,o]),a=jx(r);if(Fc(),s(),(a||e.sp)&&!kd(e)&&Kx(e),a){if(r.then(i2,i2),t)return r.then(l=>{wC(e,l,t)}).catch(l=>{gg(l,e,0)});e.asyncDep=r}else wC(e,r,t)}else bj(e,t)}function wC(e,t,n){Bn(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Fi(t)&&(e.setupState=_z(t)),bj(e,n)}let Cb,AC;function NCt(e){Cb=e,AC=t=>{t.render._rc&&(t.withProxy=new Proxy(t.ctx,pte))}}const FCt=()=>!Cb;function bj(e,t,n){const i=e.type;if(!e.render){if(!t&&Cb&&!i.render){const o=i.template||Jx(e).template;if(o){const{isCustomElement:s,compilerOptions:r}=e.appContext.config,{delimiters:a,compilerOptions:l}=i,u=Ki(Ki({isCustomElement:s,delimiters:a},r),l);i.render=Cb(o,u)}}e.render=i.render||Xl,AC&&AC(e)}{const o=kg(e);Nc();try{mte(e)}finally{Fc(),o()}}}const Kte={get(e,t){return Br(e,"get",""),e[t]}};function wj(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,Kte),slots:e.slots,emit:e.emit,expose:t}}function G2(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(_z(Tt(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in cv)return cv[n](e)},has(t,n){return n in t||n in cv}})):e.proxy}function CC(e,t=!0){return Bn(e)?e.displayName||e.name:e.name||t&&e.__name}function Zte(e){return Bn(e)&&"__vccOpts"in e}const O=(e,t)=>Tee(e,t,Hp);function On(e,t,n){try{bb(-1);const i=arguments.length;return i===2?Fi(t)&&!_n(t)?Wf(t)?G(e,null,[t]):G(e,t):G(e,null,t):(i>3?n=Array.prototype.slice.call(arguments,2):i===3&&Wf(n)&&(n=[n]),G(e,t,n))}finally{bb(1)}}function RCt(){}function DCt(e,t,n,i){const o=n[i];if(o&&Gte(o,e))return o;const s=t();return s.memo=e.slice(),s.cacheIndex=i,n[i]=s}function Gte(e,t){const n=e.memo;if(n.length!=t.length)return!1;for(let i=0;i0&&zr&&zr.push(e),!0}const Qte="3.5.39",OCt=Xl,PCt=Ree,BCt=K1,$Ct=Nz,Yte={createComponentInstance:vj,setupComponent:kj,renderComponentRoot:pk,setCurrentRenderingInstance:Xv,isVNode:Wf,normalizeVNode:Fa,getComponentPublicInstance:G2,ensureValidVNode:Yx,pushWarningContext:Nee,popWarningContext:Fee},zCt=Yte,jCt=null,HCt=null,WCt=null;/** +* @vue/runtime-dom v3.5.39 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/let xC;const jT=typeof window<"u"&&window.trustedTypes;if(jT)try{xC=jT.createPolicy("vue",{createHTML:e=>e})}catch{}const Aj=xC?e=>xC.createHTML(e):e=>e,Jte="http://www.w3.org/2000/svg",Xte="http://www.w3.org/1998/Math/MathML",id=typeof document<"u"?document:null,HT=id&&id.createElement("template"),ene={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,i)=>{const o=t==="svg"?id.createElementNS(Jte,e):t==="mathml"?id.createElementNS(Xte,e):n?id.createElement(e,{is:n}):id.createElement(e);return e==="select"&&i&&i.multiple!=null&&o.setAttribute("multiple",i.multiple),o},createText:e=>id.createTextNode(e),createComment:e=>id.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>id.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,i,o,s){const r=n?n.previousSibling:t.lastChild;if(o&&(o===s||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),n),!(o===s||!(o=o.nextSibling)););else{HT.innerHTML=Aj(i==="svg"?`${e}`:i==="mathml"?`${e}`:e);const a=HT.content;if(i==="svg"||i==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}t.insertBefore(a,n)}return[r?r.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Yd="transition",c0="animation",Vm=Symbol("_vtc"),Cj={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},xj=Ki({},Pz,Cj),tne=e=>(e.displayName="Transition",e.props=xj,e),wo=tne((e,{slots:t})=>On(Vee,Sj(e),t)),Ph=(e,t=[])=>{_n(e)?e.forEach(n=>n(...t)):e&&e(...t)},WT=e=>e?_n(e)?e.some(t=>t.length>1):e.length>1:!1;function Sj(e){const t={};for(const I in e)I in Cj||(t[I]=e[I]);if(e.css===!1)return t;const{name:n="v",type:i,duration:o,enterFromClass:s=`${n}-enter-from`,enterActiveClass:r=`${n}-enter-active`,enterToClass:a=`${n}-enter-to`,appearFromClass:l=s,appearActiveClass:u=r,appearToClass:c=a,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:f=`${n}-leave-active`,leaveToClass:h=`${n}-leave-to`}=e,m=nne(o),g=m&&m[0],y=m&&m[1],{onBeforeEnter:b,onEnter:v,onEnterCancelled:w,onLeave:A,onLeaveCancelled:M,onBeforeAppear:L=b,onAppear:E=v,onAppearCancelled:C=w}=t,x=(I,D,H,$)=>{I._enterCancelled=$,af(I,D?c:a),af(I,D?u:r),H&&H()},_=(I,D)=>{I._isLeaving=!1,af(I,d),af(I,h),af(I,f),D&&D()},F=I=>(D,H)=>{const $=I?E:v,T=()=>x(D,I,H);Ph($,[D,T]),qT(()=>{af(D,I?l:s),sc(D,I?c:a),WT($)||UT(D,i,g,T)})};return Ki(t,{onBeforeEnter(I){Ph(b,[I]),sc(I,s),sc(I,r)},onBeforeAppear(I){Ph(L,[I]),sc(I,l),sc(I,u)},onEnter:F(!1),onAppear:F(!0),onLeave(I,D){I._isLeaving=!0;const H=()=>_(I,D);sc(I,d),I._enterCancelled?(sc(I,f),SC(I)):(SC(I),sc(I,f)),qT(()=>{I._isLeaving&&(af(I,d),sc(I,h),WT(A)||UT(I,i,y,H))}),Ph(A,[I,H])},onEnterCancelled(I){x(I,!1,void 0,!0),Ph(w,[I])},onAppearCancelled(I){x(I,!0,void 0,!0),Ph(C,[I])},onLeaveCancelled(I){_(I),Ph(M,[I])}})}function nne(e){if(e==null)return null;if(Fi(e))return[_8(e.enter),_8(e.leave)];{const t=_8(e);return[t,t]}}function _8(e){return ab(e)}function sc(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[Vm]||(e[Vm]=new Set)).add(t)}function af(e,t){t.split(/\s+/).forEach(i=>i&&e.classList.remove(i));const n=e[Vm];n&&(n.delete(t),n.size||(e[Vm]=void 0))}function qT(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let ine=0;function UT(e,t,n,i){const o=e._endId=++ine,s=()=>{o===e._endId&&i()};if(n!=null)return setTimeout(s,n);const{type:r,timeout:a,propCount:l}=_j(e,t);if(!r)return i();const u=r+"end";let c=0;const d=()=>{e.removeEventListener(u,f),s()},f=h=>{h.target===e&&++c>=l&&d()};setTimeout(()=>{c(n[m]||"").split(", "),o=i(`${Yd}Delay`),s=i(`${Yd}Duration`),r=VT(o,s),a=i(`${c0}Delay`),l=i(`${c0}Duration`),u=VT(a,l);let c=null,d=0,f=0;t===Yd?r>0&&(c=Yd,d=r,f=s.length):t===c0?u>0&&(c=c0,d=u,f=l.length):(d=Math.max(r,u),c=d>0?r>u?Yd:c0:null,f=c?c===Yd?s.length:l.length:0);const h=c===Yd&&/\b(?:transform|all)(?:,|$)/.test(i(`${Yd}Property`).toString());return{type:c,timeout:d,propCount:f,hasTransform:h}}function VT(e,t){for(;e.lengthKT(n)+KT(e[i])))}function KT(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function SC(e){return(e?e.ownerDocument:document).body.offsetHeight}function one(e,t,n){const i=e[Vm];i&&(t=(t?[t,...i]:[...i]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const xb=Symbol("_vod"),nS=Symbol("_vsh"),jo={name:"show",beforeMount(e,{value:t},{transition:n}){e[xb]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):d0(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:i}){!t!=!n&&(i?t?(i.beforeEnter(e),d0(e,!0),i.enter(e)):i.leave(e,()=>{d0(e,!1)}):d0(e,t))},beforeUnmount(e,{value:t}){d0(e,t)}};function d0(e,t){e.style.display=t?e[xb]:"none",e[nS]=!t}function sne(){jo.getSSRProps=({value:e})=>{if(!e)return{style:{display:"none"}}}}const Ij=Symbol("");function qCt(e){const t=Is();if(!t)return;const n=t.ut=(o=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(s=>Sb(s,o))},i=()=>{const o=e(t.proxy);t.ce?Sb(t.ce,o):_C(t.subTree,o),n(o)};Hz(()=>{hb(i)}),wn(()=>{Be(i,Xl,{flush:"post"});const o=new MutationObserver(i);o.observe(t.subTree.el.parentNode,{childList:!0}),Nn(()=>o.disconnect())})}function _C(e,t){if(e.shapeFlag&128){const n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{_C(n.activeBranch,t)})}for(;e.component;)e=e.component.subTree;if(e.shapeFlag&1&&e.el)Sb(e.el,t);else if(e.type===Ne)e.children.forEach(n=>_C(n,t));else if(e.type===Im){let{el:n,anchor:i}=e;for(;n&&(Sb(n,t),n!==i);)n=n.nextSibling}}function Sb(e,t){if(e.nodeType===1){const n=e.style;let i="";for(const o in t){const s=eee(t[o]);n.setProperty(`--${o}`,s),i+=`--${o}: ${s};`}n[Ij]=i}}const rne=/(?:^|;)\s*display\s*:/;function ane(e,t,n){const i=e.style,o=Ji(n);let s=!1;if(n&&!o){if(t)if(Ji(t))for(const r of t.split(";")){const a=r.slice(0,r.indexOf(":")).trim();n[a]==null&&B0(i,a,"")}else for(const r in t)n[r]==null&&B0(i,r,"");for(const r in n){r==="display"&&(s=!0);const a=n[r];a!=null?une(e,r,!Ji(t)&&t?t[r]:void 0,a)||B0(i,r,a):B0(i,r,"")}}else if(o){if(t!==n){const r=i[Ij];r&&(n+=";"+r),i.cssText=n,s=rne.test(n)}}else t&&e.removeAttribute("style");xb in e&&(e[xb]=s?i.display:"",e[nS]&&(i.display="none"))}const ZT=/\s*!important$/;function B0(e,t,n){if(_n(n))n.forEach(i=>B0(e,t,i));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const i=lne(e,t);ZT.test(n)?e.setProperty(Ra(i),n.replace(ZT,""),"important"):e[i]=n}}const GT=["Webkit","Moz","ms"],I8={};function lne(e,t){const n=I8[t];if(n)return n;let i=Bs(t);if(i!=="filter"&&i in e)return I8[t]=i;i=gw(i);for(let o=0;oM8||(mne.then(()=>M8=0),M8=Date.now());function vne(e,t){const n=i=>{if(!i._vts)i._vts=Date.now();else if(i._vts<=n.attached)return;const o=n.value;if(_n(o)){const s=i.stopImmediatePropagation;i.stopImmediatePropagation=()=>{s.call(i),i._stopped=!0};const r=o.slice(),a=[i];for(let l=0;le.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,yne=(e,t,n,i,o,s)=>{const r=o==="svg";t==="class"?one(e,i,r):t==="style"?ane(e,n,i):U2(t)?fw(t)||dne(e,t,n,i,s):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):kne(e,t,i,r))?(JT(e,t,i),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&YT(e,t,i,r,s,t!=="value")):e._isVueCE&&(bne(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!Ji(i)))?JT(e,Bs(t),i,s,t):(t==="true-value"?e._trueValue=i:t==="false-value"&&(e._falseValue=i),YT(e,t,i,r))};function kne(e,t,n,i){if(i)return!!(t==="innerHTML"||t==="textContent"||t in e&&eE(t)&&Bn(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const o=e.tagName;if(o==="IMG"||o==="VIDEO"||o==="CANVAS"||o==="SOURCE")return!1}return eE(t)&&Ji(n)?!1:t in e}function bne(e,t){const n=e._def.props;if(!n)return!1;const i=Bs(t);return Array.isArray(n)?n.some(o=>Bs(o)===i):Object.keys(n).some(o=>Bs(o)===i)}const tE={};function wne(e,t,n){let i=ot(e,t);hw(i)&&(i=Ki({},i,t));class o extends iS{constructor(r){super(i,r,n)}}return o.def=i,o}const UCt=((e,t)=>wne(e,t,Pne)),Ane=typeof HTMLElement<"u"?HTMLElement:class{};class iS extends Ane{constructor(t,n={},i=Mb){super(),this._def=t,this._props=n,this._createApp=i,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._patching=!1,this._dirty=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._styleAnchors=new WeakMap,this._ob=null,this.shadowRoot&&i!==Mb?this._root=this.shadowRoot:t.shadowRoot!==!1?(this.attachShadow(Ki({},t.shadowRootOptions,{mode:"open"})),this._root=this.shadowRoot):this._root=this}connectedCallback(){if(!this.isConnected)return;!this.shadowRoot&&!this._resolved&&this._parseSlots(),this._connected=!0;let t=this;for(;t=t&&(t.assignedSlot||t.parentNode||t.host);)if(t instanceof iS){this._parent=t;break}this._instance||(this._resolved?this._mount(this._def):t&&t._pendingResolve?this._pendingResolve=t._pendingResolve.then(()=>{this._pendingResolve=void 0,this._resolveDef()}):this._resolveDef())}_setParent(t=this._parent){t&&(this._instance.parent=t._instance,this._inheritParentContext(t))}_inheritParentContext(t=this._parent){t&&this._app&&Object.setPrototypeOf(this._app._context.provides,t._instance.provides)}disconnectedCallback(){this._connected=!1,pt(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null,this._teleportTargets&&(this._teleportTargets.clear(),this._teleportTargets=void 0))})}_processMutations(t){for(const n of t)this._setAttr(n.attributeName)}_resolveDef(){if(this._pendingResolve)return;for(let i=0;i{this._resolved=!0,this._pendingResolve=void 0;const{props:s,styles:r}=i;let a;if(s&&!_n(s))for(const l in s){const u=s[l];(u===Number||u&&u.type===Number)&&(l in this._props&&(this._props[l]=ab(this._props[l])),(a||(a=Object.create(null)))[Bs(l)]=!0)}this._numberProps=a,this._resolveProps(i),this.shadowRoot&&this._applyStyles(r),this._mount(i)},n=this._def.__asyncLoader;n?this._pendingResolve=n().then(i=>{i.configureApp=this._def.configureApp,t(this._def=i,!0)}):t(this._def)}_mount(t){this._app=this._createApp(t),this._inheritParentContext(),t.configureApp&&t.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);const n=this._instance&&this._instance.exposed;if(n)for(const i in n)Ei(this,i)||Object.defineProperty(this,i,{get:()=>p(n[i])})}_resolveProps(t){const{props:n}=t,i=_n(n)?n:Object.keys(n||{});for(const o of Object.keys(this))o[0]!=="_"&&i.includes(o)&&this._setProp(o,this[o]);for(const o of i.map(Bs))Object.defineProperty(this,o,{get(){return this._getProp(o)},set(s){this._setProp(o,s,!0,!this._patching)}})}_setAttr(t){if(t.startsWith("data-v-"))return;const n=this.hasAttribute(t);let i=n?this.getAttribute(t):tE;const o=Bs(t);n&&this._numberProps&&this._numberProps[o]&&(i=ab(i)),this._setProp(o,i,!1,!0)}_getProp(t){return this._props[t]}_setProp(t,n,i=!0,o=!1){if(n!==this._props[t]&&(this._dirty=!0,n===tE?delete this._props[t]:(this._props[t]=n,t==="key"&&this._app&&(this._app._ceVNode.key=n)),o&&this._instance&&this._update(),i)){const s=this._ob;s&&(this._processMutations(s.takeRecords()),s.disconnect()),n===!0?this.setAttribute(Ra(t),""):typeof n=="string"||typeof n=="number"?this.setAttribute(Ra(t),n+""):n||this.removeAttribute(Ra(t)),s&&s.observe(this,{attributes:!0})}}_update(){const t=this._createVNode();this._app&&(t.appContext=this._app._context),One(t,this._root)}_createVNode(){const t={};this.shadowRoot||(t.onVnodeMounted=t.onVnodeUpdated=this._renderSlots.bind(this));const n=G(this._def,Ki(t,this._props));return this._instance||(n.ce=i=>{this._instance=i,i.ce=this,i.isCE=!0;const o=(s,r)=>{this.dispatchEvent(new CustomEvent(s,hw(r[0])?Ki({detail:r},r[0]):{detail:r}))};i.emit=(s,...r)=>{o(s,r),Ra(s)!==s&&o(Ra(s),r)},this._setParent()}),n}_applyStyles(t,n,i){if(!t)return;if(n){if(n===this._def||this._styleChildren.has(n))return;this._styleChildren.add(n)}const o=this._nonce,s=this.shadowRoot,r=i?this._getStyleAnchor(i)||this._getStyleAnchor(this._def):this._getRootStyleInsertionAnchor(s);let a=null;for(let l=t.length-1;l>=0;l--){const u=document.createElement("style");o&&u.setAttribute("nonce",o),u.textContent=t[l],s.insertBefore(u,a||r),a=u,l===0&&(i||this._styleAnchors.set(this._def,u),n&&this._styleAnchors.set(n,u))}}_getStyleAnchor(t){if(!t)return null;const n=this._styleAnchors.get(t);return n&&n.parentNode===this.shadowRoot?n:(n&&this._styleAnchors.delete(t),null)}_getRootStyleInsertionAnchor(t){for(let n=0;n(delete e.props.mode,e),Sne=xne({name:"TransitionGroup",props:Ki({},xj,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=Is(),i=Oz();let o,s;return vg(()=>{if(!o.length)return;const r=e.moveClass||`${e.name||"v"}-move`;if(!Tne(o[0].el,n.vnode.el,r)){o=[];return}o.forEach(_ne),o.forEach(Ine);const a=o.filter(Mne);SC(n.vnode.el),a.forEach(l=>{const u=l.el,c=u.style;sc(u,r),c.transform=c.webkitTransform=c.transitionDuration="";const d=u[_b]=f=>{f&&f.target!==u||(!f||f.propertyName.endsWith("transform"))&&(u.removeEventListener("transitionend",d),u[_b]=null,af(u,r))};u.addEventListener("transitionend",d)}),o=[]}),()=>{const r=vi(e),a=Sj(r);let l=r.tag||Ne;if(o=[],s)for(let u=0;u{a.split(/\s+/).forEach(l=>l&&i.classList.remove(l))}),n.split(/\s+/).forEach(a=>a&&i.classList.add(a)),i.style.display="none";const s=t.nodeType===1?t:t.parentNode;s.appendChild(i);const{hasTransform:r}=_j(i);return s.removeChild(i),r}const qf=e=>{const t=e.props["onUpdate:modelValue"]||!1;return _n(t)?n=>Am(t,n):t};function Ene(e){e.target.composing=!0}function iE(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const eu=Symbol("_assign");function oE(e,t,n){return t&&(e=e.trim()),n&&(e=vw(e)),e}const Cr={created(e,{modifiers:{lazy:t,trim:n,number:i}},o){e[eu]=qf(o);const s=i||o.props&&o.props.type==="number";dd(e,t?"change":"input",r=>{r.target.composing||e[eu](oE(e.value,n,s))}),(n||s)&&dd(e,"change",()=>{e.value=oE(e.value,n,s)}),t||(dd(e,"compositionstart",Ene),dd(e,"compositionend",iE),dd(e,"change",iE))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:i,trim:o,number:s}},r){if(e[eu]=qf(r),e.composing)return;const a=(s||e.type==="number")&&!/^0\d/.test(e.value)?vw(e.value):e.value,l=t??"";if(a===l)return;const u=e.getRootNode();(u instanceof Document||u instanceof ShadowRoot)&&u.activeElement===e&&e.type!=="range"&&(i&&t===n||o&&e.value.trim()===l)||(e.value=l)}},Ib={deep:!0,created(e,t,n){e[eu]=qf(n),dd(e,"change",()=>{const i=e._modelValue,o=Km(e),s=e.checked,r=e[eu];if(_n(i)){const a=kw(i,o),l=a!==-1;if(s&&!l)r(i.concat(o));else if(!s&&l){const u=[...i];u.splice(a,1),r(u)}}else if(o1(i)){const a=new Set(i);s?a.add(o):a.delete(o),r(a)}else r(Fj(e,s))})},mounted:sE,beforeUpdate(e,t,n){e[eu]=qf(n),sE(e,t,n)}};function sE(e,{value:t,oldValue:n},i){e._modelValue=t;let o;if(_n(t))o=kw(t,i.props.value)>-1;else if(o1(t))o=t.has(i.props.value);else{if(t===n)return;o=Sd(t,Fj(e,!0))}e.checked!==o&&(e.checked=o)}const Nj={created(e,{value:t},n){e.checked=Sd(t,n.props.value),e[eu]=qf(n),dd(e,"change",()=>{e[eu](Km(e))})},beforeUpdate(e,{value:t,oldValue:n},i){e[eu]=qf(i),t!==n&&(e.checked=Sd(t,i.props.value))}},IC={deep:!0,created(e,{value:t,modifiers:{number:n}},i){const o=o1(t);dd(e,"change",()=>{const s=Array.prototype.filter.call(e.options,r=>r.selected).map(r=>n?vw(Km(r)):Km(r));e[eu](e.multiple?o?new Set(s):s:s[0]),e._assigning=!0,pt(()=>{e._assigning=!1})}),e[eu]=qf(i)},mounted(e,{value:t}){rE(e,t)},beforeUpdate(e,t,n){e[eu]=qf(n)},updated(e,{value:t}){e._assigning||rE(e,t)}};function rE(e,t){const n=e.multiple,i=_n(t);if(!(n&&!i&&!o1(t))){for(let o=0,s=e.options.length;oString(u)===String(a)):r.selected=kw(t,a)>-1}else r.selected=t.has(a);else if(Sd(Km(r),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Km(e){return"_value"in e?e._value:e.value}function Fj(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const Lne={created(e,t,n){t9(e,t,n,null,"created")},mounted(e,t,n){t9(e,t,n,null,"mounted")},beforeUpdate(e,t,n,i){t9(e,t,n,i,"beforeUpdate")},updated(e,t,n,i){t9(e,t,n,i,"updated")}};function Rj(e,t){switch(e){case"SELECT":return IC;case"TEXTAREA":return Cr;default:switch(t){case"checkbox":return Ib;case"radio":return Nj;default:return Cr}}}function t9(e,t,n,i,o){const r=Rj(e.tagName,n.props&&n.props.type)[o];r&&r(e,t,n,i)}function Nne(){Cr.getSSRProps=({value:e})=>({value:e}),Nj.getSSRProps=({value:e},t)=>{if(t.props&&Sd(t.props.value,e))return{checked:!0}},Ib.getSSRProps=({value:e},t)=>{if(_n(e)){if(t.props&&kw(e,t.props.value)>-1)return{checked:!0}}else if(o1(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},Lne.getSSRProps=(e,t)=>{if(typeof t.type!="string")return;const n=Rj(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}const Fne=["ctrl","shift","alt","meta"],Rne={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>Fne.some(n=>e[`${n}Key`]&&!t.includes(n))},Mt=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),i=t.join(".");return n[i]||(n[i]=((o,...s)=>{for(let r=0;r{const n=e._withKeys||(e._withKeys={}),i=t.join(".");return n[i]||(n[i]=(o=>{if(!("key"in o))return;const s=Ra(o.key);if(t.some(r=>r===s||Dne[r]===s))return e(o)}))},Dj=Ki({patchProp:yne},ene);let fv,aE=!1;function Oj(){return fv||(fv=Rte(Dj))}function Pj(){return fv=aE?fv:Dte(Dj),aE=!0,fv}const One=((...e)=>{Oj().render(...e)}),ZCt=((...e)=>{Pj().hydrate(...e)}),Mb=((...e)=>{const t=Oj().createApp(...e),{mount:n}=t;return t.mount=i=>{const o=$j(i);if(!o)return;const s=t._component;!Bn(s)&&!s.render&&!s.template&&(s.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const r=n(o,!1,Bj(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),r},t}),Pne=((...e)=>{const t=Pj().createApp(...e),{mount:n}=t;return t.mount=i=>{const o=$j(i);if(o)return n(o,!0,Bj(o))},t});function Bj(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function $j(e){return Ji(e)?document.querySelector(e):e}let lE=!1;const GCt=()=>{lE||(lE=!0,Nne(),sne())},zj=Symbol("IconResolver"),Bne={sm:14,md:16,lg:20},Ie=ot({__name:"Icon",props:{name:{},size:{default:"md"},label:{}},setup(e){const t=e,n=en(zj,()=>{}),i=O(()=>n(t.name)),o=O(()=>Bne[t.size]);return(s,r)=>i.value?(k(),fe(zo(i.value),{key:0,class:"kw-icon",width:o.value,height:o.value,"aria-label":e.label,"aria-hidden":e.label?void 0:!0},null,8,["width","height","aria-label","aria-hidden"])):ne("",!0)}}),$ne=["disabled"],zne={key:0,class:"ui-action-card__leading"},jne={class:"ui-action-card__text"},Hne={class:"ui-action-card__title"},Wne={key:0,class:"ui-action-card__hint"},qne=ot({__name:"ActionCard",props:{disabled:{type:Boolean,default:!1}},emits:["select"],setup(e){return(t,n)=>(k(),N("button",{class:"ui-action-card",type:"button",disabled:e.disabled,onClick:n[0]||(n[0]=i=>t.$emit("select"))},[t.$slots.leading?(k(),N("span",zne,[Kn(t.$slots,"leading",{},void 0,!0)])):ne("",!0),S("span",jne,[S("span",Hne,[Kn(t.$slots,"default",{},void 0,!0),Kn(t.$slots,"badge",{},void 0,!0)]),t.$slots.hint?(k(),N("span",Wne,[Kn(t.$slots,"hint",{},void 0,!0)])):ne("",!0)]),G(Ie,{name:"chevron-right",size:"lg",class:"ui-action-card__chevron"})],8,$ne))}}),xt=(e,t)=>{const n=e.__vccOpts||e;for(const[i,o]of t)n[i]=o;return n},MC=xt(qne,[["__scopeId","data-v-e52e7748"]]);/*! + * shared v11.4.6 + * (c) 2026 kazuya kawaguchi + * Released under the MIT License. + */function Une(e,t){typeof console<"u"&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}const Tb=typeof window<"u",uh=(e,t=!1)=>t?Symbol.for(e):Symbol(e),Vne=(e,t,n)=>Kne({l:e,k:t,s:n}),Kne=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),Cs=e=>typeof e=="number"&&isFinite(e),jj=e=>sS(e)==="[object Date]",Zm=e=>sS(e)==="[object RegExp]",Ew=e=>wi(e)&&Object.keys(e).length===0,xs=Object.assign,Zne=Object.create,Yi=(e=null)=>Zne(e);let uE;const fp=()=>uE||(uE=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:Yi());function cE(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/").replace(/=/g,"=")}function Gne(e){return e.replace(/&(?![a-zA-Z0-9#]{2,6};)/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}const Qne=/^\s*javascript\s*(?::|�*58;?|�*3a;?|:?)/i,Yne=/^(?:href|src|action|formaction)$/i;function oS(e){return Qne.test(e)}function Jne(e){const t=/url\s*\(/gi;let n="",i=0,o;for(;(o=t.exec(e))!==null;){const s=o.index,r=t.lastIndex-1;let a=r+1,l=1,u=null;for(;a`${i}="${dE(i,o)}"`),e=e.replace(/([\w:-]+)\s*=\s*'([^']*)'/g,(n,i,o)=>`${i}='${dE(i,o)}'`),/\s*on\w+\s*=\s*["']?[^"'>]+["']?/gi.test(e)&&(e=e.replace(/(\s+)(on)(\w+\s*=)/gi,"$1on$3")),e=e.replace(/(\s+(?:href|src|action|formaction)\s*=\s*)([^\s"'=<>`]+)/gi,(n,i,o)=>oS(o)?`${i}about:blank`:n),e}const eie=Object.prototype.hasOwnProperty;function Zl(e,t){return eie.call(e,t)}const Ho=Array.isArray,ko=e=>typeof e=="function",yn=e=>typeof e=="string",Ii=e=>typeof e=="boolean",Mi=e=>e!==null&&typeof e=="object",tie=e=>Mi(e)&&ko(e.then)&&ko(e.catch),Hj=Object.prototype.toString,sS=e=>Hj.call(e),wi=e=>sS(e)==="[object Object]",nie=e=>e==null?"":Ho(e)||wi(e)&&e.toString===Hj?JSON.stringify(e,null,2):String(e);function rS(e,t=""){return e.reduce((n,i,o)=>o===0?n+i:n+t+i,"")}const n9=e=>!Mi(e)||Ho(e);function gk(e,t){if(n9(e)||n9(t))throw new Error("Invalid value");const n=[{src:e,des:t}];for(;n.length;){const{src:i,des:o}=n.pop();Object.keys(i).forEach(s=>{s!=="__proto__"&&(Mi(i[s])&&!Mi(o[s])&&(o[s]=Array.isArray(i[s])?[]:Yi()),n9(o[s])||n9(i[s])?o[s]=i[s]:n.push({src:i[s],des:o[s]}))})}}/*! + * message-compiler v11.4.6 + * (c) 2026 kazuya kawaguchi + * Released under the MIT License. + */function iie(e,t,n){return{line:e,column:t,offset:n}}function TC(e,t,n){return{start:e,end:t}}const $i={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14},oie=17;function Lw(e,t,n={}){const{domain:i,messages:o,args:s}=n,r=e,a=new SyntaxError(String(r));return a.code=e,t&&(a.location=t),a.domain=i,a}function sie(e){throw e}const tc=" ",rie="\r",Dr=` +`,aie="\u2028",lie="\u2029";function uie(e){const t=e;let n=0,i=1,o=1,s=0;const r=E=>t[E]===rie&&t[E+1]===Dr,a=E=>t[E]===Dr,l=E=>t[E]===lie,u=E=>t[E]===aie,c=E=>r(E)||a(E)||l(E)||u(E),d=()=>n,f=()=>i,h=()=>o,m=()=>s,g=E=>r(E)||l(E)||u(E)?Dr:t[E],y=()=>g(n),b=()=>g(n+s);function v(){return s=0,c(n)&&(i++,o=0),r(n)&&n++,n++,o++,t[n]}function w(){return r(n+s)&&s++,s++,t[n+s]}function A(){n=0,i=1,o=1,s=0}function M(E=0){s=E}function L(){const E=n+s;for(;E!==n;)v();s=0}return{index:d,line:f,column:h,peekOffset:m,charAt:g,currentChar:y,currentPeek:b,next:v,peek:w,reset:A,resetPeek:M,skipToPeek:L}}const Jc=void 0,cie=".",fE="'",die="tokenizer";function fie(e,t={}){const n=t.location!==!1,i=uie(e),o=()=>i.index(),s=()=>iie(i.line(),i.column(),i.index()),r=s(),a=o(),l={currentType:13,offset:a,startLoc:r,endLoc:r,lastType:13,lastOffset:a,lastStartLoc:r,lastEndLoc:r,braceNest:0,inLinked:!1,text:""},u=()=>l,{onError:c}=t;function d(oe,re,ve,...le){const xe=u();if(re.column+=ve,re.offset+=ve,c){const be=n?TC(xe.startLoc,re):null,pe=Lw(oe,be,{domain:die,args:le});c(pe)}}function f(oe,re,ve){oe.endLoc=s(),oe.currentType=re;const le={type:re};return n&&(le.loc=TC(oe.startLoc,oe.endLoc)),ve!=null&&(le.value=ve),le}const h=oe=>f(oe,13);function m(oe,re){return oe.currentChar()===re?(oe.next(),re):(d($i.EXPECTED_TOKEN,s(),0,re),"")}function g(oe){let re="";for(;oe.currentPeek()===tc||oe.currentPeek()===Dr;)re+=oe.currentPeek(),oe.peek();return re}function y(oe){const re=g(oe);return oe.skipToPeek(),re}function b(oe){if(oe===Jc)return!1;const re=oe.charCodeAt(0);return re>=97&&re<=122||re>=65&&re<=90||re===95}function v(oe){if(oe===Jc)return!1;const re=oe.charCodeAt(0);return re>=48&&re<=57}function w(oe,re){const{currentType:ve}=re;if(ve!==2)return!1;g(oe);const le=b(oe.currentPeek());return oe.resetPeek(),le}function A(oe,re){const{currentType:ve}=re;if(ve!==2)return!1;g(oe);const le=oe.currentPeek()==="-"?oe.peek():oe.currentPeek(),xe=v(le);return oe.resetPeek(),xe}function M(oe,re){const{currentType:ve}=re;if(ve!==2)return!1;g(oe);const le=oe.currentPeek()===fE;return oe.resetPeek(),le}function L(oe,re){const{currentType:ve}=re;if(ve!==7)return!1;g(oe);const le=oe.currentPeek()===".";return oe.resetPeek(),le}function E(oe,re){const{currentType:ve}=re;if(ve!==8)return!1;g(oe);const le=b(oe.currentPeek());return oe.resetPeek(),le}function C(oe,re){const{currentType:ve}=re;if(!(ve===7||ve===11))return!1;g(oe);const le=oe.currentPeek()===":";return oe.resetPeek(),le}function x(oe,re){const{currentType:ve}=re;if(ve!==9)return!1;const le=()=>{const be=oe.currentPeek();return be==="{"?b(oe.peek()):be==="@"||be==="|"||be===":"||be==="."||be===tc||!be?!1:be===Dr?(oe.peek(),le()):F(oe,!1)},xe=le();return oe.resetPeek(),xe}function _(oe){g(oe);const re=oe.currentPeek()==="|";return oe.resetPeek(),re}function F(oe,re=!0){const ve=(xe=!1,be="")=>{const pe=oe.currentPeek();return pe==="{"||pe==="@"||!pe?xe:pe==="|"?!(be===tc||be===Dr):pe===tc?(oe.peek(),ve(!0,tc)):pe===Dr?(oe.peek(),ve(!0,Dr)):!0},le=ve();return re&&oe.resetPeek(),le}function I(oe,re){const ve=oe.currentChar();return ve===Jc?Jc:re(ve)?(oe.next(),ve):null}function D(oe){const re=oe.charCodeAt(0);return re>=97&&re<=122||re>=65&&re<=90||re>=48&&re<=57||re===95||re===36}function H(oe){return I(oe,D)}function $(oe){const re=oe.charCodeAt(0);return re>=97&&re<=122||re>=65&&re<=90||re>=48&&re<=57||re===95||re===36||re===45}function T(oe){return I(oe,$)}function R(oe){const re=oe.charCodeAt(0);return re>=48&&re<=57}function P(oe){return I(oe,R)}function j(oe){const re=oe.charCodeAt(0);return re>=48&&re<=57||re>=65&&re<=70||re>=97&&re<=102}function B(oe){return I(oe,j)}function K(oe){let re="",ve="";for(;re=P(oe);)ve+=re;return ve}function X(oe){let re="";for(;;){const ve=oe.currentChar();if(ve==="\\"){const le=oe.peek();le==="{"||le==="}"||le==="@"||le==="|"||le==="\\"?(re+=ve+le,oe.next(),oe.next()):(oe.resetPeek(),re+=ve,oe.next())}else{if(ve==="{"||ve==="}"||ve==="@"||ve==="|"||!ve)break;if(ve===tc||ve===Dr)if(F(oe))re+=ve,oe.next();else{if(_(oe))break;re+=ve,oe.next()}else re+=ve,oe.next()}}return re}function V(oe){y(oe);let re="",ve="";for(;re=T(oe);)ve+=re;const le=oe.currentChar();if(le&&le!=="}"&&le!==Jc&&le!==tc&&le!==Dr&&le!==" "){const xe=he(oe);return d($i.INVALID_TOKEN_IN_PLACEHOLDER,s(),0,ve+xe),ve+xe}return oe.currentChar()===Jc&&d($i.UNTERMINATED_CLOSING_BRACE,s(),0),ve}function Q(oe){y(oe);let re="";return oe.currentChar()==="-"?(oe.next(),re+=`-${K(oe)}`):re+=K(oe),oe.currentChar()===Jc&&d($i.UNTERMINATED_CLOSING_BRACE,s(),0),re}function ie(oe){return oe!==fE&&oe!==Dr}function ee(oe){y(oe),m(oe,"'");let re="",ve="";for(;re=I(oe,ie);)re==="\\"?ve+=Ce(oe):ve+=re;const le=oe.currentChar();return le===Dr||le===Jc?(d($i.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,s(),0),le===Dr&&(oe.next(),m(oe,"'")),ve):(m(oe,"'"),ve)}function Ce(oe){const re=oe.currentChar();switch(re){case"\\":case"'":return oe.next(),`\\${re}`;case"u":return Z(oe,re,4);case"U":return Z(oe,re,6);default:return d($i.UNKNOWN_ESCAPE_SEQUENCE,s(),0,re),""}}function Z(oe,re,ve){m(oe,re);let le="";for(let xe=0;xe{const le=oe.currentChar();return le==="{"||le==="@"||le==="|"||le==="("||le===")"||!le||le===tc?ve:(ve+=le,oe.next(),re(ve))};return re("")}function U(oe){y(oe);const re=m(oe,"|");return y(oe),re}function Y(oe,re){let ve=null;switch(oe.currentChar()){case"{":return re.braceNest>=1&&d($i.NOT_ALLOW_NEST_PLACEHOLDER,s(),0),oe.next(),ve=f(re,2,"{"),y(oe),re.braceNest++,ve;case"}":return re.braceNest>0&&re.currentType===2&&d($i.EMPTY_PLACEHOLDER,s(),0),oe.next(),ve=f(re,3,"}"),re.braceNest--,re.braceNest>0&&y(oe),re.inLinked&&re.braceNest===0&&(re.inLinked=!1),ve;case"@":return re.braceNest>0&&d($i.UNTERMINATED_CLOSING_BRACE,s(),0),ve=ce(oe,re)||h(re),re.braceNest=0,ve;default:{let xe=!0,be=!0,pe=!0;if(_(oe))return re.braceNest>0&&d($i.UNTERMINATED_CLOSING_BRACE,s(),0),ve=f(re,1,U(oe)),re.braceNest=0,re.inLinked=!1,ve;if(re.braceNest>0&&(re.currentType===4||re.currentType===5||re.currentType===6))return d($i.UNTERMINATED_CLOSING_BRACE,s(),0),re.braceNest=0,me(oe,re);if(xe=w(oe,re))return ve=f(re,4,V(oe)),y(oe),ve;if(be=A(oe,re))return ve=f(re,5,Q(oe)),y(oe),ve;if(pe=M(oe,re))return ve=f(re,6,ee(oe)),y(oe),ve;if(!xe&&!be&&!pe)return ve=f(re,12,he(oe)),d($i.INVALID_TOKEN_IN_PLACEHOLDER,s(),0,ve.value),y(oe),ve;break}}return ve}function ce(oe,re){const{currentType:ve}=re;let le=null;const xe=oe.currentChar();switch((ve===7||ve===8||ve===11||ve===9)&&(xe===Dr||xe===tc)&&d($i.INVALID_LINKED_FORMAT,s(),0),xe){case"@":return oe.next(),le=f(re,7,"@"),re.inLinked=!0,le;case".":return y(oe),oe.next(),f(re,8,".");case":":return y(oe),oe.next(),f(re,9,":");default:return _(oe)?(le=f(re,1,U(oe)),re.braceNest=0,re.inLinked=!1,le):L(oe,re)||C(oe,re)?(y(oe),ce(oe,re)):E(oe,re)?(y(oe),f(re,11,J(oe))):x(oe,re)?(y(oe),xe==="{"?Y(oe,re)||le:f(re,10,te(oe))):(ve===7&&d($i.INVALID_LINKED_FORMAT,s(),0),re.braceNest=0,re.inLinked=!1,me(oe,re))}}function me(oe,re){let ve={type:13};if(re.braceNest>0)return Y(oe,re)||h(re);if(re.inLinked)return ce(oe,re)||h(re);switch(oe.currentChar()){case"{":return Y(oe,re)||h(re);case"}":return d($i.UNBALANCED_CLOSING_BRACE,s(),0),oe.next(),f(re,3,"}");case"@":return ce(oe,re)||h(re);default:{if(_(oe))return ve=f(re,1,U(oe)),re.braceNest=0,re.inLinked=!1,ve;if(F(oe))return f(re,0,X(oe));break}}return ve}function ge(){const{currentType:oe,offset:re,startLoc:ve,endLoc:le}=l;return l.lastType=oe,l.lastOffset=re,l.lastStartLoc=ve,l.lastEndLoc=le,l.offset=o(),l.startLoc=s(),i.currentChar()===Jc?f(l,13):me(i,l)}return{nextToken:ge,currentOffset:o,currentPosition:s,context:u}}const hie="parser",pie=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g,mie=/\\([\\@{}|])/g;function gie(e,t){return t}function vie(e,t,n){switch(e){case"\\\\":return"\\";case"\\'":return"'";default:{const i=parseInt(t||n,16);return i<=55295||i>=57344?String.fromCodePoint(i):"�"}}}function yie(e={}){const t=e.location!==!1,{onError:n}=e;function i(b,v,w,A,...M){const L=b.currentPosition();if(L.offset+=A,L.column+=A,n){const E=t?TC(w,L):null,C=Lw(v,E,{domain:hie,args:M});n(C)}}function o(b,v,w){const A={type:b};return t&&(A.start=v,A.end=v,A.loc={start:w,end:w}),A}function s(b,v,w,A){t&&(b.end=v,b.loc&&(b.loc.end=w))}function r(b,v){const w=b.context(),A=o(3,w.offset,w.startLoc);return A.value=v.replace(mie,gie),s(A,b.currentOffset(),b.currentPosition()),A}function a(b,v){const w=b.context(),{lastOffset:A,lastStartLoc:M}=w,L=o(5,A,M);return L.index=parseInt(v,10),b.nextToken(),s(L,b.currentOffset(),b.currentPosition()),L}function l(b,v){const w=b.context(),{lastOffset:A,lastStartLoc:M}=w,L=o(4,A,M);return L.key=v,b.nextToken(),s(L,b.currentOffset(),b.currentPosition()),L}function u(b,v){const w=b.context(),{lastOffset:A,lastStartLoc:M}=w,L=o(9,A,M);return L.value=v.replace(pie,vie),b.nextToken(),s(L,b.currentOffset(),b.currentPosition()),L}function c(b){const v=b.nextToken(),w=b.context(),{lastOffset:A,lastStartLoc:M}=w,L=o(8,A,M);return v.type!==11?(i(b,$i.UNEXPECTED_EMPTY_LINKED_MODIFIER,w.lastStartLoc,0),L.value="",s(L,A,M),{nextConsumeToken:v,node:L}):(v.value==null&&i(b,$i.UNEXPECTED_LEXICAL_ANALYSIS,w.lastStartLoc,0,nc(v)),L.value=v.value||"",s(L,b.currentOffset(),b.currentPosition()),{node:L})}function d(b,v){const w=b.context(),A=o(7,w.offset,w.startLoc);return A.value=v,s(A,b.currentOffset(),b.currentPosition()),A}function f(b){const v=b.context(),w=o(6,v.offset,v.startLoc);let A=b.nextToken();if(A.type===8){const M=c(b);w.modifier=M.node,A=M.nextConsumeToken||b.nextToken()}switch(A.type!==9&&i(b,$i.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,nc(A)),A=b.nextToken(),A.type===2&&(A=b.nextToken()),A.type){case 10:A.value==null&&i(b,$i.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,nc(A)),w.key=d(b,A.value||"");break;case 4:A.value==null&&i(b,$i.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,nc(A)),w.key=l(b,A.value||"");break;case 5:A.value==null&&i(b,$i.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,nc(A)),w.key=a(b,A.value||"");break;case 6:A.value==null&&i(b,$i.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,nc(A)),w.key=u(b,A.value||"");break;default:{i(b,$i.UNEXPECTED_EMPTY_LINKED_KEY,v.lastStartLoc,0);const M=b.context(),L=o(7,M.offset,M.startLoc);return L.value="",s(L,M.offset,M.startLoc),w.key=L,s(w,M.offset,M.startLoc),{nextConsumeToken:A,node:w}}}return s(w,b.currentOffset(),b.currentPosition()),{node:w}}function h(b){const v=b.context(),w=v.currentType===1?b.currentOffset():v.offset,A=v.currentType===1?v.endLoc:v.startLoc,M=o(2,w,A);M.items=[];let L=null;do{const x=L||b.nextToken();switch(L=null,x.type){case 0:x.value==null&&i(b,$i.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,nc(x)),M.items.push(r(b,x.value||""));break;case 5:x.value==null&&i(b,$i.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,nc(x)),M.items.push(a(b,x.value||""));break;case 4:x.value==null&&i(b,$i.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,nc(x)),M.items.push(l(b,x.value||""));break;case 6:x.value==null&&i(b,$i.UNEXPECTED_LEXICAL_ANALYSIS,v.lastStartLoc,0,nc(x)),M.items.push(u(b,x.value||""));break;case 7:{const _=f(b);M.items.push(_.node),L=_.nextConsumeToken||null;break}}}while(v.currentType!==13&&v.currentType!==1);const E=v.currentType===1?v.lastOffset:b.currentOffset(),C=v.currentType===1?v.lastEndLoc:b.currentPosition();return s(M,E,C),M}function m(b,v,w,A){const M=b.context();let L=A.items.length===0;const E=o(1,v,w);E.cases=[],E.cases.push(A);do{const C=h(b);L||(L=C.items.length===0),E.cases.push(C)}while(M.currentType!==13);return L&&i(b,$i.MUST_HAVE_MESSAGES_IN_PLURAL,w,0),s(E,b.currentOffset(),b.currentPosition()),E}function g(b){const v=b.context(),{offset:w,startLoc:A}=v,M=h(b);return v.currentType===13?M:m(b,w,A,M)}function y(b){const v=fie(b,xs({},e)),w=v.context(),A=o(0,w.offset,w.startLoc);return t&&A.loc&&(A.loc.source=b),A.body=g(v),e.onCacheKey&&(A.cacheKey=e.onCacheKey(b)),w.currentType!==13&&i(v,$i.UNEXPECTED_LEXICAL_ANALYSIS,w.lastStartLoc,0,b[w.offset]||""),s(A,v.currentOffset(),v.currentPosition()),A}return{parse:y}}function nc(e){if(e.type===13)return"EOF";const t=(e.value||"").replace(/\r?\n/gu,"\\n");return t.length>10?t.slice(0,9)+"…":t}function kie(e,t={}){const n={ast:e,helpers:new Set};return{context:()=>n,helper:s=>(n.helpers.add(s),s)}}function hE(e,t){for(let n=0;npE(n)),e}function pE(e){if(e.items.length===1){const t=e.items[0];(t.type===3||t.type===9)&&(e.static=t.value,delete t.value)}else{const t=[];for(let n=0;nr;function l(g,y){r.code+=g}function u(g,y=!0){const b=y?i:"";l(o?b+" ".repeat(g):b)}function c(g=!0){const y=++r.indentLevel;g&&u(y)}function d(g=!0){const y=--r.indentLevel;g&&u(y)}function f(){u(r.indentLevel)}return{context:a,push:l,indent:c,deindent:d,newline:f,helper:g=>`_${g}`,needIndent:()=>r.needIndent}}function Cie(e,t){const{helper:n}=e;e.push(`${n("linked")}(`),Gm(e,t.key),t.modifier?(e.push(", "),Gm(e,t.modifier),e.push(", _type")):e.push(", undefined, _type"),e.push(")")}function xie(e,t){const{helper:n,needIndent:i}=e;e.push(`${n("normalize")}([`),e.indent(i());const o=t.items.length;for(let s=0;s1){e.push(`${n("plural")}([`),e.indent(i());const o=t.cases.length;for(let s=0;s{const n=yn(t.mode)?t.mode:"normal",i=yn(t.filename)?t.filename:"message.intl";t.sourceMap;const o=t.breakLineCode!=null?t.breakLineCode:n==="arrow"?";":` +`,s=t.needIndent?t.needIndent:n!=="arrow",r=e.helpers||[],a=Aie(e,{filename:i,breakLineCode:o,needIndent:s});a.push(n==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),a.indent(s),r.length>0&&(a.push(`const { ${rS(r.map(c=>`${c}: _${c}`),", ")} } = ctx`),a.newline()),a.push("return "),Gm(a,e),a.deindent(s),a.push("}"),delete e.helpers;const{code:l,map:u}=a.context();return{ast:e,code:l,map:u?u.toJSON():void 0}};function Mie(e,t={}){const n=xs({},t),i=!!n.jit,o=!!n.minify,s=n.optimize==null?!0:n.optimize,a=yie(n).parse(e);return i?(s&&wie(a),o&&Z1(a),{ast:a,code:""}):(bie(a,n),Iie(a,n))}/*! + * core-base v11.4.6 + * (c) 2026 kazuya kawaguchi + * Released under the MIT License. + */function Tie(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(fp().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(fp().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function Tc(e){return Mi(e)&&lS(e)===0&&(Zl(e,"b")||Zl(e,"body"))}const Wj=["b","body"];function Eie(e){return ch(e,Wj)}const qj=["c","cases"];function Lie(e){return ch(e,qj,[])}const Uj=["s","static"];function Nie(e){return ch(e,Uj)}const Vj=["i","items"];function Fie(e){return ch(e,Vj,[])}const Kj=["t","type"];function lS(e){return ch(e,Kj)}const Zj=["v","value"];function i9(e,t){const n=ch(e,Zj);if(n!=null)return n;throw o2(t)}const Gj=["m","modifier"];function Rie(e){return ch(e,Gj)}const Qj=["k","key"];function Die(e){const t=ch(e,Qj);if(t)return t;throw o2(6)}function ch(e,t,n){for(let i=0;iOie(n,e)}function Oie(e,t){const n=Eie(t);if(n==null)throw o2(0);if(lS(n)===1){const s=Lie(n);return e.plural(s.reduce((r,a)=>[...r,mE(e,a)],[]))}else return mE(e,n)}function mE(e,t){const n=Nie(t);if(n!=null)return e.type==="text"?n:e.normalize([n]);{const i=Fie(t).reduce((o,s)=>[...o,EC(e,s)],[]);return e.normalize(i)}}function EC(e,t){const n=lS(t);switch(n){case 3:return i9(t,n);case 9:return i9(t,n);case 4:{const i=t;if(Zl(i,"k")&&i.k)return e.interpolate(e.named(i.k));if(Zl(i,"key")&&i.key)return e.interpolate(e.named(i.key));throw o2(n)}case 5:{const i=t;if(Zl(i,"i")&&Cs(i.i))return e.interpolate(e.list(i.i));if(Zl(i,"index")&&Cs(i.index))return e.interpolate(e.list(i.index));throw o2(n)}case 6:{const i=t,o=Rie(i),s=Die(i);return e.linked(EC(e,s),o?EC(e,o):void 0,e.type)}case 7:return i9(t,n);case 8:return i9(t,n);default:throw new Error(`unhandled node on format message part: ${n}`)}}const Pie=e=>e;let o9=Yi();function Bie(e,t={}){let n=!1;const i=t.onError||sie;return t.onError=o=>{n=!0,i(o)},{...Mie(e,t),detectError:n}}function $ie(e,t){if(!__INTLIFY_DROP_MESSAGE_COMPILER__&&yn(e)){Ii(t.warnHtmlMessage)&&t.warnHtmlMessage;const i=(t.onCacheKey||Pie)(e),o=o9[i];if(o)return o;const{ast:s,detectError:r}=Bie(e,{...t,location:!1,jit:!0}),a=T8(s);return r?a:o9[i]=a}else{const n=e.cacheKey;if(n){const i=o9[n];return i||(o9[n]=T8(e))}else return T8(e)}}let s2=null;function zie(e){s2=e}function jie(e,t,n){s2&&s2.emit("i18n:init",{timestamp:Date.now(),i18n:e,version:t,meta:n})}const Hie=Wie("function:translate");function Wie(e){return t=>s2&&s2.emit(e,t)}const hd={INVALID_ARGUMENT:oie,INVALID_DATE_ARGUMENT:18,INVALID_ISO_DATE_ARGUMENT:19,NOT_SUPPORT_LOCALE_PROMISE_VALUE:21,NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:22,NOT_SUPPORT_LOCALE_TYPE:23},qie=24;function pd(e){return Lw(e,null,void 0)}function uS(e,t){return t.locale!=null?gE(t.locale):gE(e.locale)}let E8;function gE(e){if(yn(e))return e;if(ko(e)){if(e.resolvedOnce&&E8!=null)return E8;if(e.constructor.name==="Function"){const t=e();if(tie(t))throw pd(hd.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return E8=t}else throw pd(hd.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw pd(hd.NOT_SUPPORT_LOCALE_TYPE)}function Uie(e,t,n){return[...new Set([n,...Ho(t)?t:Mi(t)?Object.keys(t):yn(t)?[t]:[n]])]}function LC(e,t,n){const i=yn(n)?n:r2,o=e;o.__localeChainCache||(o.__localeChainCache=new Map);let s=o.__localeChainCache.get(i);if(!s){s=[];let r=[n];for(;Ho(r);)r=vE(s,r,t);const a=Ho(t)||!wi(t)?t:t.default?t.default:null;r=yn(a)?[a]:a,Ho(r)&&vE(s,r,!1),o.__localeChainCache.set(i,s)}return s}function vE(e,t,n){let i=!0;for(let o=0;o{r===void 0?r=a:r+=a},f[1]=()=>{r!==void 0&&(t.push(r),r=void 0)},f[2]=()=>{f[0](),o++},f[3]=()=>{if(o>0)o--,i=4,f[0]();else{if(o=0,r===void 0||(r=Jie(r),r===!1))return!1;f[1]()}};function h(){const m=e[n+1];if(i===5&&m==="'"||i===6&&m==='"')return n++,a="\\"+m,f[0](),!0}for(;i!==null;)if(n++,s=e[n],!(s==="\\"&&h())){if(l=Yie(s),d=dh[i],u=d[l]||d.l||8,u===8||(i=u[0],u[1]!==void 0&&(c=f[u[1]],c&&(a=s,c()===!1))))return;if(i===7)return t}}const yE=new Map;function eoe(e,t){return Mi(e)?e[t]:null}function toe(e,t){if(!Mi(e))return null;let n=yE.get(t);if(n||(n=Xie(t),n&&yE.set(t,n)),!n)return null;const i=n.length;let o=e,s=0;for(;s`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;function ioe(){return{upper:(e,t)=>t==="text"&&yn(e)?e.toUpperCase():t==="vnode"&&Mi(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>t==="text"&&yn(e)?e.toLowerCase():t==="vnode"&&Mi(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>t==="text"&&yn(e)?kE(e):t==="vnode"&&Mi(e)&&"__v_isVNode"in e?kE(e.children):e}}let Jj;function ooe(e){Jj=e}let Xj;function soe(e){Xj=e}let eH;function roe(e){eH=e}let tH=null;const aoe=e=>{tH=e},loe=()=>tH;let nH=null;const bE=e=>{nH=e},uoe=()=>nH;let wE=0;function coe(e={}){const t=ko(e.onWarn)?e.onWarn:Une,n=yn(e.version)?e.version:noe,i=yn(e.locale)||ko(e.locale)?e.locale:r2,o=ko(i)?r2:i,s=Ho(e.fallbackLocale)||wi(e.fallbackLocale)||yn(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:o,r=wi(e.messages)?e.messages:L8(o),a=wi(e.datetimeFormats)?e.datetimeFormats:L8(o),l=wi(e.numberFormats)?e.numberFormats:L8(o),u=xs(Yi(),e.modifiers,ioe()),c=e.pluralRules||Yi(),d=ko(e.missing)?e.missing:null,f=Ii(e.missingWarn)||Zm(e.missingWarn)?e.missingWarn:!0,h=Ii(e.fallbackWarn)||Zm(e.fallbackWarn)?e.fallbackWarn:!0,m=!!e.fallbackFormat,g=!!e.unresolving,y=ko(e.postTranslation)?e.postTranslation:null,b=wi(e.processor)?e.processor:null,v=Ii(e.warnHtmlMessage)?e.warnHtmlMessage:!0,w=!!e.escapeParameter,A=ko(e.messageCompiler)?e.messageCompiler:Jj,M=ko(e.messageResolver)?e.messageResolver:Xj||eoe,L=ko(e.localeFallbacker)?e.localeFallbacker:eH||Uie,E=Mi(e.fallbackContext)?e.fallbackContext:void 0,C=e,x=Mi(C.__datetimeFormatters)?C.__datetimeFormatters:new Map,_=Mi(C.__numberFormatters)?C.__numberFormatters:new Map,F=Mi(C.__meta)?C.__meta:{};wE++;const I={version:n,cid:wE,locale:i,fallbackLocale:s,messages:r,modifiers:u,pluralRules:c,missing:d,missingWarn:f,fallbackWarn:h,fallbackFormat:m,unresolving:g,postTranslation:y,processor:b,warnHtmlMessage:v,escapeParameter:w,messageCompiler:A,messageResolver:M,localeFallbacker:L,fallbackContext:E,onWarn:t,__meta:F};return I.datetimeFormats=a,I.numberFormats=l,I.__datetimeFormatters=x,I.__numberFormatters=_,__INTLIFY_PROD_DEVTOOLS__&&jie(I,n,F),I}const L8=e=>({[e]:Yi()});function cS(e,t,n,i,o){const{missing:s,onWarn:r}=e;if(s!==null){const a=s(e,n,t,o);return yn(a)?a:t}else return t}function f0(e,t,n){const i=e;i.__localeChainCache=new Map,e.localeFallbacker(e,n,t)}function doe(e,t){return e===t?!1:e.split("-")[0]===t.split("-")[0]}function foe(e,t){const n=t.indexOf(e);if(n===-1)return!1;for(let i=n+1;i{iH.includes(l)?r[l]=n[l]:s[l]=n[l]}),yn(i)?s.locale=i:wi(i)&&(r=i),wi(o)&&(r=o),[s.key||"",a,s,r]}function CE(e,t,n){const i=e;for(const o in n){const s=`${t}__${o}`;i.__datetimeFormatters.has(s)&&i.__datetimeFormatters.delete(s)}}function xE(e,...t){const{numberFormats:n,unresolving:i,fallbackLocale:o,onWarn:s,localeFallbacker:r}=e,{__numberFormatters:a}=e;if(!Cs(t[0]))return Eb;const[l,u,c,d]=FC(...t),f=Ii(c.missingWarn)?c.missingWarn:e.missingWarn;Ii(c.fallbackWarn)?c.fallbackWarn:e.fallbackWarn;const h=!!c.part,m=uS(e,c),g=r(e,o,m);if(!yn(l)||l===""){const L=new Intl.NumberFormat(m.replace(/!/g,""),d);return h?L.formatToParts(u):L.format(u)}let y={},b,v=null;const w="number format";for(let L=0;L{oH.includes(l)?r[l]=n[l]:s[l]=n[l]}),yn(i)?s.locale=i:wi(i)&&(r=i),wi(o)&&(r=o),[s.key||"",a,s,r]}function SE(e,t,n){const i=e;for(const o in n){const s=`${t}__${o}`;i.__numberFormatters.has(s)&&i.__numberFormatters.delete(s)}}const hoe=e=>e,poe=e=>"",moe="text",goe=e=>e.length===0?"":rS(e),voe=nie;function N8(e,t){return e=Math.abs(e),t===2?e===1?0:1:Math.min(e,2)}function yoe(e){const t=Cs(e.pluralIndex)?e.pluralIndex:-1;return Cs(e.named?.count)?e.named.count:Cs(e.named?.n)?e.named.n:t}function koe(e={}){const t=e.locale,n=yoe(e),i=yn(t)&&ko(e.pluralRules?.[t])?e.pluralRules[t]:N8,o=i===N8?void 0:N8,s=b=>b[i(n,b.length,o)],r=e.list||[],a=b=>r[b],l=e.named||Yi();Cs(e.pluralIndex)&&(l.count||=e.pluralIndex,l.n||=e.pluralIndex);const u=b=>l[b];function c(b,v){const w=ko(e.messages)?e.messages(b,!!v):Mi(e.messages)?e.messages[b]:!1;return w||(e.parent?e.parent.message(b):poe)}const d=b=>e.modifiers?e.modifiers[b]:hoe,f=ko(e.processor?.normalize)?e.processor.normalize:goe,h=ko(e.processor?.interpolate)?e.processor.interpolate:voe,m=yn(e.processor?.type)?e.processor.type:moe,y={list:a,named:u,plural:s,linked:(b,...v)=>{const[w,A]=v;let M="text",L="";v.length===1?Mi(w)?(L=w.modifier||L,M=w.type||M):yn(w)&&(L=w||L):v.length===2&&(yn(w)&&(L=w||L),yn(A)&&(M=A||M));const E=c(b,!0)(y),C=E===""||E===void 0?b:E,x=M==="vnode"&&Ho(C)&&L?C[0]:C;return L?d(L)(x,M):x},message:c,type:m,interpolate:h,normalize:f,values:xs(Yi(),r,l)};return y}const _E=()=>"",ql=e=>ko(e);function IE(e,...t){const{fallbackFormat:n,postTranslation:i,unresolving:o,messageCompiler:s,fallbackLocale:r,messages:a}=e,[l,u]=RC(...t),c=Ii(u.missingWarn)?u.missingWarn:e.missingWarn,d=Ii(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn,f=Ii(u.escapeParameter)?u.escapeParameter:e.escapeParameter,h=!!u.resolvedMessage,m=yn(u.default)||Ii(u.default)?Ii(u.default)?s?l:()=>l:u.default:n?s?l:()=>l:null,g=n||m!=null&&(yn(m)||ko(m)),y=uS(e,u);f&&boe(u);let[b,v,w]=h?[l,y,a[y]||Yi()]:sH(e,l,y,r,d,c),A=b,M=l;if(!h&&!(yn(A)||Tc(A)||ql(A))&&g&&(A=m,M=A),!h&&(!(yn(A)||Tc(A)||ql(A))||!yn(v)))return o?Nw:l;let L=!1;const E=()=>{L=!0},C=ql(A)?A:rH(e,l,v,A,M,E);if(L)return A;const x=Coe(e,v,w,u),_=koe(x),F=woe(e,C,_);let I=i?i(F,l):F;if(f&&yn(I)&&(I=Xne(I)),__INTLIFY_PROD_DEVTOOLS__){const D={timestamp:Date.now(),key:yn(l)?l:ql(A)?A.key:"",locale:v||(ql(A)?A.locale:""),format:yn(A)?A:ql(A)?A.source:"",message:I};D.meta=xs({},e.__meta,loe()||{}),Hie(D)}return I}function boe(e){Ho(e.list)?e.list=e.list.map(t=>yn(t)?cE(t):t):Mi(e.named)&&Object.keys(e.named).forEach(t=>{yn(e.named[t])&&(e.named[t]=cE(e.named[t]))})}function sH(e,t,n,i,o,s){const{messages:r,onWarn:a,messageResolver:l,localeFallbacker:u}=e,c=u(e,i,n);let d=Yi(),f,h=null;const m="translate";for(let g=0;gi);return u.locale=n,u.key=t,u}const l=r(i,Aoe(e,n,o,i,a,s));return l.locale=n,l.key=t,l.source=i,l}function woe(e,t,n){return t(n)}function RC(...e){const[t,n,i]=e,o=Yi();if(!yn(t)&&!Cs(t)&&!ql(t)&&!Tc(t))throw pd(hd.INVALID_ARGUMENT);const s=Cs(t)?String(t):(ql(t),t);return Cs(n)?o.plural=n:yn(n)?o.default=n:wi(n)&&!Ew(n)?o.named=n:Ho(n)&&(o.list=n),Cs(i)?o.plural=i:yn(i)?o.default=i:wi(i)&&xs(o,i),[s,o]}function Aoe(e,t,n,i,o,s){return{locale:t,key:n,warnHtmlMessage:o,onError:r=>{throw s&&s(r),r},onCacheKey:r=>Vne(t,n,r)}}function Coe(e,t,n,i){const{modifiers:o,pluralRules:s,messageResolver:r,fallbackLocale:a,fallbackWarn:l,missingWarn:u,fallbackContext:c}=e,f={locale:t,modifiers:o,pluralRules:s,messages:(h,m)=>{let g=r(n,h);if(g==null&&(c||m)){const[y,,b]=sH(c||e,h,t,a,l,u);g=y??r(b,h)}if(yn(g)||Tc(g)){let y=!1;const v=rH(e,h,t,g,h,()=>{y=!0});return y?_E:v}else return ql(g)?g:_E}};return e.processor&&(f.processor=e.processor),i.list&&(f.list=i.list),i.named&&(f.named=i.named),Cs(i.plural)&&(f.pluralIndex=i.plural),f}Tie();/*! + * vue-i18n v11.4.6 + * (c) 2026 kazuya kawaguchi + * Released under the MIT License. + */const xoe="11.4.6";function Soe(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(fp().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(fp().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(fp().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(fp().__INTLIFY_PROD_DEVTOOLS__=!1)}const aa={UNEXPECTED_RETURN_TYPE:qie,INVALID_ARGUMENT:25,MUST_BE_CALL_SETUP_TOP:26,NOT_INSTALLED:27,REQUIRED_VALUE:28,INVALID_VALUE:29,NOT_INSTALLED_WITH_PROVIDE:31,UNEXPECTED_ERROR:32,NOT_AVAILABLE_COMPOSITION_IN_LEGACY:34};function Oa(e,...t){return Lw(e,null,void 0)}const DC=uh("__translateVNode"),OC=uh("__datetimeParts"),PC=uh("__numberParts"),aH=uh("__setPluralRules"),lH=uh("__injectWithOption"),rm=uh("__dispose");function a2(e){if(!Mi(e)||Tc(e))return e;for(const t in e)if(Zl(e,t))if(!t.includes("."))Mi(e[t])&&a2(e[t]);else{const n=t.split("."),i=n.length-1;let o=e,s=!1;for(let r=0;r{if("locale"in a&&"resource"in a){const{locale:l,resource:u}=a;l?(r[l]=r[l]||Yi(),gk(u,r[l])):gk(u,r)}else yn(a)&&gk(JSON.parse(a),r)}),o==null&&s)for(const a in r)Zl(r,a)&&a2(r[a]);return r}function uH(e){return e.type}function cH(e,t,n){let i=Mi(t.messages)?t.messages:Yi();"__i18nGlobal"in n&&(i=dS(e.locale.value,{messages:i,__i18n:n.__i18nGlobal}));const o=Object.keys(i);o.length&&o.forEach(s=>{e.mergeLocaleMessage(s,i[s])});{if(Mi(t.datetimeFormats)){const s=Object.keys(t.datetimeFormats);s.length&&s.forEach(r=>{e.mergeDateTimeFormat(r,t.datetimeFormats[r])})}if(Mi(t.numberFormats)){const s=Object.keys(t.numberFormats);s.length&&s.forEach(r=>{e.mergeNumberFormat(r,t.numberFormats[r])})}}}function ME(e){return G(Lf,null,e,0)}function l2(){return Is()}const TE="__INTLIFY_META__",EE=()=>[],_oe=()=>!1;let LE=0;function NE(e){return((t,n,i,o)=>e(n,i,l2()||void 0,o))}const Ioe=()=>{const e=l2();let t=null;return e&&(t=uH(e)[TE])?{[TE]:t}:null};function Lb(e={}){const{__root:t,__injectWithOption:n}=e,i=t===void 0,o=e.flatJson,s=Tb?q:au;let r=Ii(e.inheritLocale)?e.inheritLocale:!0;const a=s(t&&r?t.locale.value:yn(e.locale)?e.locale:r2),l=s(t&&r?t.fallbackLocale.value:yn(e.fallbackLocale)||Ho(e.fallbackLocale)||wi(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:a.value),u=s(dS(a.value,e)),c=s(wi(e.datetimeFormats)?e.datetimeFormats:{[a.value]:{}}),d=s(wi(e.numberFormats)?e.numberFormats:{[a.value]:{}});let f=t?t.missingWarn:Ii(e.missingWarn)||Zm(e.missingWarn)?e.missingWarn:!0,h=t?t.fallbackWarn:Ii(e.fallbackWarn)||Zm(e.fallbackWarn)?e.fallbackWarn:!0,m=t?t.fallbackRoot:Ii(e.fallbackRoot)?e.fallbackRoot:!0,g=!!e.fallbackFormat,y=ko(e.missing)?e.missing:null,b=ko(e.missing)?NE(e.missing):null,v=ko(e.postTranslation)?e.postTranslation:null,w=t?t.warnHtmlMessage:Ii(e.warnHtmlMessage)?e.warnHtmlMessage:!0,A=!!e.escapeParameter;const M=t?t.modifiers:wi(e.modifiers)?e.modifiers:{};let L=e.pluralRules||t&&t.pluralRules,E;E=(()=>{i&&bE(null);const pe={version:xoe,locale:a.value,fallbackLocale:l.value,messages:u.value,modifiers:M,pluralRules:L,missing:b===null?void 0:b,missingWarn:f,fallbackWarn:h,fallbackFormat:g,unresolving:!0,postTranslation:v===null?void 0:v,warnHtmlMessage:w,escapeParameter:A,messageResolver:e.messageResolver,messageCompiler:e.messageCompiler,__meta:{framework:"vue"}};pe.datetimeFormats=c.value,pe.numberFormats=d.value,pe.__datetimeFormatters=wi(E)?E.__datetimeFormatters:void 0,pe.__numberFormatters=wi(E)?E.__numberFormatters:void 0;const Te=coe(pe);return i&&bE(Te),Te})(),f0(E,a.value,l.value);function x(){return[a.value,l.value,u.value,c.value,d.value]}const _=O({get:()=>a.value,set:pe=>{E.locale=pe,a.value=pe}}),F=O({get:()=>l.value,set:pe=>{E.fallbackLocale=pe,l.value=pe,f0(E,a.value,pe)}}),I=O(()=>u.value),D=O(()=>c.value),H=O(()=>d.value);function $(){return ko(v)?v:null}function T(pe){v=pe,E.postTranslation=pe}function R(){return y}function P(pe){pe!==null&&(b=NE(pe)),y=pe,E.missing=b}const j=(pe,Te,Ae,_e,Fe,$e)=>{x();let Je;try{__INTLIFY_PROD_DEVTOOLS__,i||(E.fallbackContext=t?uoe():void 0),Je=pe(E)}finally{__INTLIFY_PROD_DEVTOOLS__,i||(E.fallbackContext=void 0)}if(Ae!=="translate exists"&&Cs(Je)&&Je===Nw||Ae==="translate exists"&&!Je){const[ht,Nt]=Te();return t&&m?_e(t):Fe(ht)}else{if($e(Je))return Je;throw Oa(aa.UNEXPECTED_RETURN_TYPE)}};function B(...pe){return j(Te=>Reflect.apply(IE,null,[Te,...pe]),()=>RC(...pe),"translate",Te=>Reflect.apply(Te.t,Te,[...pe]),Te=>Te,Te=>yn(Te))}function K(...pe){const[Te,Ae,_e]=pe;if(_e&&!Mi(_e))throw Oa(aa.INVALID_ARGUMENT);return B(Te,Ae,xs({resolvedMessage:!0},_e||{}))}function X(...pe){return j(Te=>Reflect.apply(AE,null,[Te,...pe]),()=>NC(...pe),"datetime format",Te=>Reflect.apply(Te.d,Te,[...pe]),()=>Eb,Te=>yn(Te)||Ho(Te))}function V(...pe){return j(Te=>Reflect.apply(xE,null,[Te,...pe]),()=>FC(...pe),"number format",Te=>Reflect.apply(Te.n,Te,[...pe]),()=>Eb,Te=>yn(Te)||Ho(Te))}function Q(pe){return pe.map(Te=>yn(Te)||Cs(Te)||Ii(Te)?ME(String(Te)):Te)}const ee={normalize:Q,interpolate:pe=>pe,type:"vnode"};function Ce(...pe){return j(Te=>{let Ae;const _e=Te;try{_e.processor=ee,Ae=Reflect.apply(IE,null,[_e,...pe])}finally{_e.processor=null}return Ae},()=>RC(...pe),"translate",Te=>Te[DC](...pe),Te=>[ME(Te)],Te=>Ho(Te))}function Z(...pe){return j(Te=>Reflect.apply(xE,null,[Te,...pe]),()=>FC(...pe),"number format",Te=>Te[PC](...pe),EE,Te=>yn(Te)||Ho(Te))}function ae(...pe){return j(Te=>Reflect.apply(AE,null,[Te,...pe]),()=>NC(...pe),"datetime format",Te=>Te[OC](...pe),EE,Te=>yn(Te)||Ho(Te))}function he(pe){L=pe,E.pluralRules=L}function J(pe,Te){return j(()=>{if(!pe)return!1;const Ae=yn(Te)?Te:a.value,_e=yn(Te)?[Ae]:LC(E,l.value,Ae);for(let Fe=0;Fe<_e.length;Fe++){const $e=Y(_e[Fe]);let Je=E.messageResolver($e,pe);if(Je===null&&(Je=$e[pe]),Tc(Je)||ql(Je)||yn(Je))return!0}return!1},()=>[pe],"translate exists",Ae=>Reflect.apply(Ae.te,Ae,[pe,Te]),_oe,Ae=>Ii(Ae))}function te(pe){let Te=null;const Ae=LC(E,l.value,a.value);for(let _e=0;_e{r&&(a.value=pe,E.locale=pe,f0(E,a.value,l.value))}),Be(t.fallbackLocale,pe=>{r&&(l.value=pe,E.fallbackLocale=pe,f0(E,a.value,l.value))}));const be={id:LE,locale:_,fallbackLocale:F,get inheritLocale(){return r},set inheritLocale(pe){r=pe,pe&&t&&(a.value=t.locale.value,l.value=t.fallbackLocale.value,f0(E,a.value,l.value))},get availableLocales(){return Object.keys(u.value).sort()},messages:I,get modifiers(){return M},get pluralRules(){return L||{}},get isGlobal(){return i},get missingWarn(){return f},set missingWarn(pe){f=pe,E.missingWarn=f},get fallbackWarn(){return h},set fallbackWarn(pe){h=pe,E.fallbackWarn=h},get fallbackRoot(){return m},set fallbackRoot(pe){m=pe},get fallbackFormat(){return g},set fallbackFormat(pe){g=pe,E.fallbackFormat=g},get warnHtmlMessage(){return w},set warnHtmlMessage(pe){w=pe,E.warnHtmlMessage=pe},get escapeParameter(){return A},set escapeParameter(pe){A=pe,E.escapeParameter=pe},t:B,getLocaleMessage:Y,setLocaleMessage:ce,mergeLocaleMessage:me,getPostTranslationHandler:$,setPostTranslationHandler:T,getMissingHandler:R,setMissingHandler:P,[aH]:he};return be.datetimeFormats=D,be.numberFormats=H,be.rt=K,be.te=J,be.tm=U,be.d=X,be.n=V,be.getDateTimeFormat=ge,be.setDateTimeFormat=oe,be.mergeDateTimeFormat=re,be.getNumberFormat=ve,be.setNumberFormat=le,be.mergeNumberFormat=xe,be[lH]=n,be[DC]=Ce,be[OC]=ae,be[PC]=Z,be}function Moe(e){const t=yn(e.locale)?e.locale:r2,n=yn(e.fallbackLocale)||Ho(e.fallbackLocale)||wi(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:t,i=ko(e.missing)?e.missing:void 0,o=Ii(e.silentTranslationWarn)||Zm(e.silentTranslationWarn)?!e.silentTranslationWarn:!0,s=Ii(e.silentFallbackWarn)||Zm(e.silentFallbackWarn)?!e.silentFallbackWarn:!0,r=Ii(e.fallbackRoot)?e.fallbackRoot:!0,a=!!e.formatFallbackMessages,l=wi(e.modifiers)?e.modifiers:{},u=e.pluralizationRules,c=ko(e.postTranslation)?e.postTranslation:void 0,d=yn(e.warnHtmlInMessage)?e.warnHtmlInMessage!=="off":!0,f=!!e.escapeParameterHtml,h=Ii(e.sync)?e.sync:!0;let m=e.messages;if(wi(e.sharedMessages)){const M=e.sharedMessages;m=Object.keys(M).reduce((E,C)=>{const x=E[C]||(E[C]={});return xs(x,M[C]),E},m||{})}const{__i18n:g,__root:y,__injectWithOption:b}=e,v=e.datetimeFormats,w=e.numberFormats,A=e.flatJson;return{locale:t,fallbackLocale:n,messages:m,flatJson:A,datetimeFormats:v,numberFormats:w,missing:i,missingWarn:o,fallbackWarn:s,fallbackRoot:r,fallbackFormat:a,modifiers:l,pluralRules:u,postTranslation:c,warnHtmlMessage:d,escapeParameter:f,messageResolver:e.messageResolver,inheritLocale:h,__i18n:g,__root:y,__injectWithOption:b}}function BC(e={}){const t=Lb(Moe(e)),{__extender:n}=e,i={id:t.id,get locale(){return t.locale.value},set locale(o){t.locale.value=o},get fallbackLocale(){return t.fallbackLocale.value},set fallbackLocale(o){t.fallbackLocale.value=o},get messages(){return t.messages.value},get datetimeFormats(){return t.datetimeFormats.value},get numberFormats(){return t.numberFormats.value},get availableLocales(){return t.availableLocales},get missing(){return t.getMissingHandler()},set missing(o){t.setMissingHandler(o)},get silentTranslationWarn(){return Ii(t.missingWarn)?!t.missingWarn:t.missingWarn},set silentTranslationWarn(o){t.missingWarn=Ii(o)?!o:o},get silentFallbackWarn(){return Ii(t.fallbackWarn)?!t.fallbackWarn:t.fallbackWarn},set silentFallbackWarn(o){t.fallbackWarn=Ii(o)?!o:o},get modifiers(){return t.modifiers},get formatFallbackMessages(){return t.fallbackFormat},set formatFallbackMessages(o){t.fallbackFormat=o},get postTranslation(){return t.getPostTranslationHandler()},set postTranslation(o){t.setPostTranslationHandler(o)},get sync(){return t.inheritLocale},set sync(o){t.inheritLocale=o},get warnHtmlInMessage(){return t.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(o){t.warnHtmlMessage=o!=="off"},get escapeParameterHtml(){return t.escapeParameter},set escapeParameterHtml(o){t.escapeParameter=o},get pluralizationRules(){return t.pluralRules||{}},__composer:t,t(...o){return Reflect.apply(t.t,t,[...o])},rt(...o){return Reflect.apply(t.rt,t,[...o])},te(o,s){return t.te(o,s)},tm(o){return t.tm(o)},getLocaleMessage(o){return t.getLocaleMessage(o)},setLocaleMessage(o,s){t.setLocaleMessage(o,s)},mergeLocaleMessage(o,s){t.mergeLocaleMessage(o,s)},d(...o){return Reflect.apply(t.d,t,[...o])},getDateTimeFormat(o){return t.getDateTimeFormat(o)},setDateTimeFormat(o,s){t.setDateTimeFormat(o,s)},mergeDateTimeFormat(o,s){t.mergeDateTimeFormat(o,s)},n(...o){return Reflect.apply(t.n,t,[...o])},getNumberFormat(o){return t.getNumberFormat(o)},setNumberFormat(o,s){t.setNumberFormat(o,s)},mergeNumberFormat(o,s){t.mergeNumberFormat(o,s)}};return i.__extender=n,i}function Toe(e,t,n){return{beforeCreate(){const i=l2();if(!i)throw Oa(aa.UNEXPECTED_ERROR);const o=this.$options;if(o.i18n){const s=o.i18n;if(o.__i18n&&(s.__i18n=o.__i18n),s.__root=t,this===this.$root)this.$i18n=FE(e,s);else{s.__injectWithOption=!0,s.__extender=n.__vueI18nExtend,this.$i18n=BC(s);const r=this.$i18n;r.__extender&&(r.__disposer=r.__extender(this.$i18n))}}else if(o.__i18n)if(this===this.$root)this.$i18n=FE(e,o);else{this.$i18n=BC({__i18n:o.__i18n,__injectWithOption:!0,__extender:n.__vueI18nExtend,__root:t});const s=this.$i18n;s.__extender&&(s.__disposer=s.__extender(this.$i18n))}else this.$i18n=e;o.__i18nGlobal&&cH(t,o,o),this.$t=(...s)=>this.$i18n.t(...s),this.$rt=(...s)=>this.$i18n.rt(...s),this.$te=(s,r)=>this.$i18n.te(s,r),this.$d=(...s)=>this.$i18n.d(...s),this.$n=(...s)=>this.$i18n.n(...s),this.$tm=s=>this.$i18n.tm(s),n.__setInstance(i,this.$i18n)},mounted(){},unmounted(){const i=l2();if(!i)throw Oa(aa.UNEXPECTED_ERROR);const o=this.$i18n;o&&(delete this.$t,delete this.$rt,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,o?.__disposer&&(o.__disposer(),delete o.__disposer,delete o.__extender),n.__deleteInstance(i),delete this.$i18n)}}}function FE(e,t){e.locale=t.locale||e.locale,e.fallbackLocale=t.fallbackLocale||e.fallbackLocale,e.missing=t.missing||e.missing,e.silentTranslationWarn=t.silentTranslationWarn||e.silentFallbackWarn,e.silentFallbackWarn=t.silentFallbackWarn||e.silentFallbackWarn,e.formatFallbackMessages=t.formatFallbackMessages||e.formatFallbackMessages,e.postTranslation=t.postTranslation||e.postTranslation,e.warnHtmlInMessage=t.warnHtmlInMessage||e.warnHtmlInMessage,e.escapeParameterHtml=t.escapeParameterHtml||e.escapeParameterHtml,e.sync=t.sync||e.sync,e.__composer[aH](t.pluralizationRules||e.pluralizationRules);const n=dS(e.locale,{messages:t.messages,__i18n:t.__i18n});return Object.keys(n).forEach(i=>e.mergeLocaleMessage(i,n[i])),t.datetimeFormats&&Object.keys(t.datetimeFormats).forEach(i=>e.mergeDateTimeFormat(i,t.datetimeFormats[i])),t.numberFormats&&Object.keys(t.numberFormats).forEach(i=>e.mergeNumberFormat(i,t.numberFormats[i])),e}const fS={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:e=>e==="parent"||e==="global",default:"parent"},i18n:{type:Object}};function Eoe({slots:e},t){return t.length===1&&t[0]==="default"?(e.default?e.default():[]).reduce((i,o)=>[...i,...o.type===Ne?o.children:[o]],[]):t.reduce((n,i)=>{const o=e[i];return o&&(n[i]=o()),n},Yi())}function dH(){return Ne}const Loe=ot({name:"i18n-t",props:xs({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:e=>Cs(e)||!isNaN(e)}},fS),setup(e,t){const{slots:n,attrs:i}=t,o=e.i18n||qt({useScope:e.scope,__useComponent:!0});return()=>{const s=()=>{const l=Object.keys(n).filter(d=>d[0]!=="_"),u=Yi();e.locale&&(u.locale=e.locale),e.plural!==void 0&&(u.plural=yn(e.plural)?+e.plural:e.plural);const c=Eoe(t,l);return o[DC](e.keypath,c,u)},r=xs(Yi(),i),a=yn(e.tag)||Mi(e.tag)?e.tag:dH();return Mi(a)?On(a,r,{default:s}):On(a,r,s())}}}),RE=Loe;function Noe(e){return Ho(e)&&!yn(e[0])}function fH(e,t,n,i){const{slots:o,attrs:s}=t;return()=>{const r=()=>{const u={part:!0};let c=Yi();e.locale&&(u.locale=e.locale),yn(e.format)?u.key=e.format:Mi(e.format)&&(yn(e.format.key)&&(u.key=e.format.key),c=Object.keys(e.format).reduce((h,m)=>n.includes(m)?xs(Yi(),h,{[m]:e.format[m]}):h,Yi()));const d=i(e.value,u,c);let f=[u.key];return Ho(d)?f=d.map((h,m)=>{const g=o[h.type],y=g?g({[h.type]:h.value,index:m,parts:d}):[h.value];return Noe(y)&&(y[0].key=`${h.type}-${m}`),y}):yn(d)&&(f=[d]),f},a=xs(Yi(),s),l=yn(e.tag)||Mi(e.tag)?e.tag:dH();return Mi(l)?On(l,a,{default:r}):On(l,a,r())}}const Foe=ot({name:"i18n-n",props:xs({value:{type:Number,required:!0},format:{type:[String,Object]}},fS),setup(e,t){const n=e.i18n||qt({useScope:e.scope,__useComponent:!0});return fH(e,t,oH,(...i)=>n[PC](...i))}}),DE=Foe;function Roe(e,t){const n=e;if(e.mode==="composition")return n.__getInstance(t)||e.global;{const i=n.__getInstance(t);return i!=null?i.__composer:e.global.__composer}}function Doe(e){const t=r=>{const{instance:a,value:l}=r;if(!a||!a.$)throw Oa(aa.UNEXPECTED_ERROR);const u=Roe(e,a.$),c=OE(l);return[Reflect.apply(u.t,u,[...PE(c)]),u]};return{created:(r,a)=>{const[l,u]=t(a);Tb&&(r.__i18nWatcher=Be(u.locale,()=>{a.instance&&a.instance.$forceUpdate()})),r.__composer=u,r.textContent=l},unmounted:r=>{Tb&&r.__i18nWatcher&&(r.__i18nWatcher(),r.__i18nWatcher=void 0,delete r.__i18nWatcher),r.__composer&&(r.__composer=void 0,delete r.__composer)},beforeUpdate:(r,{value:a})=>{if(r.__composer){const l=r.__composer,u=OE(a);r.textContent=Reflect.apply(l.t,l,[...PE(u)])}},getSSRProps:r=>{const[a]=t(r);return{textContent:a}}}}function OE(e){if(yn(e))return{path:e};if(wi(e)){if(!("path"in e))throw Oa(aa.REQUIRED_VALUE,"path");return e}else throw Oa(aa.INVALID_VALUE)}function PE(e){const{path:t,locale:n,args:i,choice:o,plural:s}=e,r={},a=i||{};return yn(n)&&(r.locale=n),Cs(o)&&(r.plural=o),Cs(s)&&(r.plural=s),[t,a,r]}function Ooe(e,t,...n){const i=wi(n[0])?n[0]:{};(Ii(i.globalInstall)?i.globalInstall:!0)&&([RE.name,"I18nT"].forEach(s=>e.component(s,RE)),[DE.name,"I18nN"].forEach(s=>e.component(s,DE)),[zE.name,"I18nD"].forEach(s=>e.component(s,zE))),e.directive("t",Doe(t))}const Poe=uh("global-vue-i18n");function Boe(e={}){const t=__VUE_I18N_LEGACY_API__&&Ii(e.legacy)?e.legacy:__VUE_I18N_LEGACY_API__,n=Ii(e.globalInjection)?e.globalInjection:!0,i=new Map,[o,s]=$oe(e,t),r=uh("");function a(d){return i.get(d)||null}function l(d,f){i.set(d,f)}function u(d){i.delete(d)}const c={get mode(){return __VUE_I18N_LEGACY_API__&&t?"legacy":"composition"},async install(d,...f){if(d.__VUE_I18N_SYMBOL__=r,d.provide(d.__VUE_I18N_SYMBOL__,c),wi(f[0])){const g=f[0];c.__composerExtend=g.__composerExtend,c.__vueI18nExtend=g.__vueI18nExtend}let h=null;!t&&n&&(h=Voe(d,c.global)),__VUE_I18N_FULL_INSTALL__&&Ooe(d,c,...f),__VUE_I18N_LEGACY_API__&&t&&d.mixin(Toe(s,s.__composer,c));const m=d.unmount;d.unmount=()=>{h&&h(),c.dispose(),m()}},get global(){return s},dispose(){o.stop()},__instances:i,__getInstance:a,__setInstance:l,__deleteInstance:u};return c}function qt(e={}){const t=l2();if(t==null)throw Oa(aa.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&t.appContext.app!=null&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw Oa(aa.NOT_INSTALLED);const n=zoe(t),i=Hoe(n),o=uH(t),s=joe(e,o);if(s==="global")return cH(i,e,o),i;if(s==="parent"){let l=BE(n,t,e.__useComponent);return l==null&&(l=i),l}if(s==="isolated"){if(n.mode!=="composition")throw Oa(aa.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const l=n,u=xs({},e),c=BE(n,t);u.__root=c||i;const d=Lb(u);return l.__composerExtend&&(d[rm]=l.__composerExtend(d)),mg()&&Fd(()=>{const h=d[rm];h&&(h(),delete d[rm])}),d}const r=n;let a=r.__getInstance(t);if(a==null){const l=xs({},e);"__i18n"in o&&(l.__i18n=o.__i18n),i&&(l.__root=i),a=Lb(l),r.__composerExtend&&(a[rm]=r.__composerExtend(a)),qoe(r,t,a),r.__setInstance(t,a)}return a}function $oe(e,t){const n=bw(),i=__VUE_I18N_LEGACY_API__&&t?n.run(()=>BC(e)):n.run(()=>Lb(e));if(i==null)throw Oa(aa.UNEXPECTED_ERROR);return[n,i]}function zoe(e){const t=en(e.isCE?Poe:e.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw Oa(e.isCE?aa.NOT_INSTALLED_WITH_PROVIDE:aa.UNEXPECTED_ERROR);return t}function joe(e,t){return Ew(e)?"__i18n"in t?"local":"global":e.useScope?e.useScope:"local"}function Hoe(e){return e.mode==="composition"?e.global:e.global.__composer}function BE(e,t,n=!1){let i=null;const o=t.root;let s=Woe(t,n);for(;s!=null;){const r=e;if(e.mode==="composition")i=r.__getInstance(s);else if(__VUE_I18N_LEGACY_API__){const a=r.__getInstance(s);a!=null&&(i=a.__composer,n&&i&&!i[lH]&&(i=null))}if(i!=null||o===s)break;s=s.parent}return i}function Woe(e,t=!1){return e==null?null:t&&e.vnode.ctx||e.parent}function qoe(e,t,n){wn(()=>{},t),Nn(()=>{const i=n;e.__deleteInstance(t);const o=i[rm];o&&(o(),delete i[rm])},t)}const Uoe=["locale","fallbackLocale","availableLocales"],$E=["t","rt","d","n","tm","te"];function Voe(e,t){const n=Object.create(null);return Uoe.forEach(o=>{const s=Object.getOwnPropertyDescriptor(t,o);if(!s)throw Oa(aa.UNEXPECTED_ERROR);const r=Xi(s.value)?{get(){return s.value.value},set(a){s.value.value=a}}:{get(){return s.get&&s.get()}};Object.defineProperty(n,o,r)}),e.config.globalProperties.$i18n=n,$E.forEach(o=>{const s=Object.getOwnPropertyDescriptor(t,o);if(!s||!s.value)throw Oa(aa.UNEXPECTED_ERROR);Object.defineProperty(e.config.globalProperties,`$${o}`,s)}),()=>{delete e.config.globalProperties.$i18n,$E.forEach(o=>{delete e.config.globalProperties[`$${o}`]})}}const Koe=ot({name:"i18n-d",props:xs({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},fS),setup(e,t){const n=e.i18n||qt({useScope:e.scope,__useComponent:!0});return fH(e,t,iH,(...i)=>n[OC](...i))}}),zE=Koe;Soe();ooe($ie);soe(toe);roe(LC);if(__INTLIFY_PROD_DEVTOOLS__){const e=fp();e.__INTLIFY__=!0,zie(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const Zoe={confirm:"Confirm",cancel:"Cancel",close:"Close",dismiss:"Dismiss",loading:"Loading",copy:"Copy",errorBoundaryTitle:"Something went wrong",errorBoundaryRetry:"Try again",asyncLoadFailed:"Failed to load. Close this view and try again."},Goe={connecting:"Connecting…",connectingStageAuth:"Checking sign-in…",connectingStageServer:"Connecting to server…",connectingStageConfig:"Loading configuration…",connectingStageSessions:"Loading sessions…",connectingStageSession:"Opening session…",connectingRetrySuffix:" (retry {n})",connectingIssueNetworkTitle:"Cannot connect to the Kimi server",connectingIssueNetworkMessage:"Check your network connection and make sure the server is still running.",connectingIssueTimeoutTitle:"The Kimi server is taking too long to respond",connectingIssueTimeoutMessage:"Still retrying automatically — please wait.",connectingIssueApiTitle:"The Kimi server returned an error",connectingIssueUnknownTitle:"Connection problem",internalBuildBanner:"Internal testing only",menuFile:"File",menuEdit:"Edit",menuView:"View",menuHelp:"Help",applicationMenu:"Application menu"},Qoe={workspaceMeta:"workspace · {branch}",sessionsHeader:"sessions",workspaces:"workspaces",viewSwitcher:"List options",viewGroup:"View",viewFlat:"Flat list",viewGrouped:"Group by workspace",sortGroup:"Sort order",sortManual:"Manual",sortRecent:"Recent activity",sessionAdmin:"Manage Sessions",collapseAll:"Collapse all workspaces",expandAll:"Expand all workspaces",newSession:"New Session",newChat:"New Session",newWorkspace:"New Workspace",dropToAddWorkspace:"Drop to add workspace",emptyState:"No sessions yet · click New Session to start",options:"Options",rename:"Rename",genTitle:"Gen Title",genTitleUnavailable:"Title generation unavailable — needs a managed Kimi Code login and at least one message",setEmoji:"Set Emoji…",sessionEmojiTitle:"Pick an emoji",removeEmoji:"Remove emoji",randomEmoji:"Random",searchEmoji:"Search emoji",recentEmojis:"Recently used",noEmojiResults:"No matching emoji",emojiGroupFaces:"Smileys & People",emojiGroupNature:"Animals & Nature",emojiGroupFood:"Food & Drink",emojiGroupActivity:"Activities & Travel",emojiGroupObjects:"Objects & Work",emojiGroupSymbols:"Symbols & Status",copyPath:"Copy path",copySessionId:"Copy session ID",copied:"Copied ✓",copyFailed:"Copy failed",archive:"Archive",archiveToastUndo:"Undo",archiveToastMid:"or view archived chats in",archiveToastSettings:"Settings",archiveToastTail:"",tabOpen:"Open",tabDone:"Done",tabWorkspaces:"Workspaces",tagOpen:"Open",tagDone:"Done",complete:"Done",markDone:"Mark as done",reopen:"Mark as open",noDoneSessions:"No completed sessions yet",noOpenSessions:"No open sessions yet",completeToastLead:"Done",reopenToastLead:"Back to open",fork:"Fork session",export:"Export session",pin:"Pin",unpin:"Unpin",lastActive:"Last updated: {time}",pinned:"Pinned",collapsePinned:"Collapse pinned",expandPinned:"Expand pinned",resizePinnedAria:"Resize pinned section height",delete:"Delete",removeWorkspace:"Remove workspace",brand:"Kimi Code",signedIn:"Signed in",signOut:"Sign out",notSignedIn:"Not signed in",signIn:"Sign in",defaultUserName:"Kimi User",upgrade:"Upgrade",upgradeMembership:"Upgrade membership",logoutConfirmTitle:"Sign out",logoutConfirmMessage:"Are you sure you want to sign out?",language:"Language",backendTitle:"Backend {backend} · {endpoint} — click to switch",noSessions:"No conversations yet",allPinned:"{count} conversations pinned",showMore:"Show more",loadMore:"Load more",showLess:"Show less",loadingMore:"Loading…",collapseSidebar:"Collapse sidebar",expandSidebar:"Expand sidebar",searchPlaceholder:"Search sessions and workspaces",search:"Search",searchHint:"↑↓ navigate · ↵ open · Esc close",searchHintSelect:"navigate",searchHintOpen:"open",searchHintClose:"close",searchClear:"Clear search",searchNoResults:"No matching sessions or workspaces",searchEmpty:"No sessions yet",update:"Upgrade",updateAvailable:"v{version} available",updateDownloadingButton:"Downloading… ({percent}%)",updateReady:"v{version} ready",updateDone:"Restart",updateFailed:"Download failed",updateRetry:"Retry",updateDownloadNow:"Download & Update",updateSkip:"Skip This Version",updateRestartNow:"Restart Now",updateRestartLater:"Later",updateReleaseDate:"Released {date}",updateCurrentVersion:"Current v{version}",updateWhatsNew:"What’s new",updateBackground:"Download in Background",updateAutoDownload:"Automatically download and install updates",rcSelectDevice:"Select device",rcCurrentDevice:"Current device: {name}",rcConnectable:"Connectable",rcUnavailable:"Unavailable",rcOnline:"Online",rcOffline:"Offline",rcDevicesLoadFailed:"Failed to load devices"},Yoe={title:"Session Management",subtitle:"Manage all sessions. Mark the finished ones as done. Filter by last updated to clean up old sessions in bulk.",back:"Back",filterWorkspace:"Workspace",filterStatus:"Status",filterTime:"Updated",allWorkspaces:"All workspaces",selectAll:"Select all",searchWorkspace:"Search workspaces",noWorkspaceMatch:"No matching workspaces",removeTag:"Remove {name}",statusAll:"All statuses",statusOpen:"Open",statusDone:"Done",timeAll:"Any time",timeDaysAgo:"{n} days ago",query:"Query",reset:"Reset",colStatus:"Status",colTitle:"Title",colWorkspace:"Workspace",colPrompt:"Last prompt",colUpdated:"Updated",colCompleted:"Completed",colActions:"Actions",empty:"No sessions match the current filters",loading:"Loading…",total:"{n} total",pageSize:"{n} / page",prevPage:"Previous page",nextPage:"Next page",selectPageAll:"Select all on this page",batchSelected:"{n} selected",selectAllMatching:"Select all {total} matching sessions",materializingAll:"Selecting…",allMatchingSelected:"All {n} selected",clearSelection:"Clear selection",markDone:"Mark as done",reopen:"Mark as open",markDoneCount:"Mark as done ({n})",reopenCount:"Mark as open ({n})",batchDoneToast:"{n} marked as done",batchReopenedToast:"{n} moved back to open",batchFailedSuffix:", {n} failed",batchDoneFailedNotice:"Could not mark {n} as done",batchReopenFailedNotice:"Could not move {n} back to open",undo:"Undo",open:"Open session",rename:"Rename…",fork:"Fork",export:"Export",moreActions:"More actions"},Joe={switcherTitle:"Switch workspace",switchTooltip:"Switch workspace",eyebrow:"Workspace",branchLabel:"branch: {branch}",noBranch:"no branch",sessionCount:"{count} session | {count} sessions",allWorkspaces:"All workspaces",currentWorkspace:"Current workspace only",addWorkspace:"Add workspace…",noWorkspace:"No workspace",deleteHasSessions:"This workspace still has sessions — archive them before deleting it",removeWorkspaceConfirm:'Remove workspace "{name}"?',swarmEnableTitle:"Enable swarm mode?",swarmEnableConfirm:"The agent will run multiple sub-agents in parallel.",goalStartTitle:"Start goal?",goalStartConfirm:'"{objective}" — the agent will run autonomously toward it.',scopeCurrent:"this workspace",scopeAll:"all workspaces",newInGroup:"New session in this workspace",addTitle:"Add workspace",pathLabel:"Path",pathPlaceholder:"/absolute/path/to/project",recentLabel:"Recent folders",add:"Add",cancel:"Cancel",addHint:"Paste an absolute folder path, or pick a recent one.",addFailed:"Couldn't open this folder. Check the path and try again.",requiredTitle:"Choose a workspace first",requiredMessage:"Pick a folder to use as your workspace before sending a message.",openThisFolder:"Open this folder",up:"Up",browsing:"Browsing…",filterPlaceholder:"Filter subfolders…",searchPlaceholder:"Fuzzy-search under this folder…",searching:"Searching…",pasteToggle:"Enter an absolute path",noFilterMatch:"No subfolders match “{q}”",noSubfolders:"No subfolders here",browseHint:'Click a folder to enter it, then "Open this folder" to add it as a workspace.',attentionTitle:"{count} item needs your attention | {count} items need your attention",awaitingAnswer:"Answer",awaitingAnswerTitle:"A question is waiting for your answer",awaitingPermission:"Approve",awaitingPermissionTitle:"An action is waiting for your approval",aborted:"Failed",abortedTitle:"This session's latest turn ended on an error"},Xoe={jumpToLatestAria:"Jump to latest message",backToBottom:"Back to bottom",toc:"Conversation outline",newMessages:"Latest messages",loading:"Loading…",starting:"Starting conversation…",requesting:"Requesting…",working:"Working…",workingRetry:"Model request failed — retrying ({n}/{max})…",emptyWorkspaceHint:"Send in {name}",switchWorkspace:"Switch workspace",recentSessions:"Recent sessions",viewMoreSessions:"View more",sessionAdminTooltip:"View and manage more sessions in Session Management",addWorkspace:"New workspace",moreWorkspaces:"More workspaces ({count})",pickFolder:"Choose folder…",compacting:"Compacting context…",compactedPlain:"Context compacted",compactedAuto:"Context auto-compacted",compactedTokens:" ({before} → {after} tokens)",viewSummary:"View summary",undo:"Undo",undoTooltip:"Undo edit",undoConfirm:"Undo back to this message?",escUndoHintPre:"Press",escUndoHintPost:"again to undo",undone:"Undone — the message is back in the composer",turnInterrupted:"Manually stopped",turnFailed:"Model request failed — this turn was interrupted",turnFailedMaxSteps:"Step limit reached — this turn was interrupted",turnFailedResume:"Continue",turnFailedResumeText:"Continue",yesterday:"Yesterday",loadOlder:"Load earlier messages",loadingOlder:"Loading earlier messages…",widenTable:"Widen table",restoreTableWidth:"Restore default width",wrapCode:"Enable word wrap",unwrapCode:"Disable word wrap",showLineNumbers:"Show line numbers",hideLineNumbers:"Hide line numbers",cron:{fired:"Scheduled reminder fired",missed:"Missed scheduled reminders",job:"job {id}",oneShot:"one-shot",coalesced:"{n} fires coalesced",missedCount:"{n} missed",finalDelivery:"final delivery",expand:"Show more",collapse:"Show less"},fold:{worked:"Worked {duration}",workedUnknown:"Work details"},turnFiles:{titleOne:"{number} file changed",titleOther:"{number} files changed",more:"{number} more files",moreOne:"1 more file",showLess:"Show less",diffUnavailable:"This file’s changes can’t be shown line by line",rebuilding:"Loading this turn’s changes…",openFile:"Open file"},goal:{continuation:"Goal continuation"},notification:{sentBy:{task:"From background (Bash)",subagent:"From background (Agent)"},bodyLine:"{status}: {description}",reason:"Reason: {reason}",userStopped:"Stopped by user",statusTitle:{completed:"Completed",failed:"Failed",timed_out:"Timed out",killed:"Stopped",lost:"Lost",info:"Notification"},status:{completed:"completed",failed:"failed",timed_out:"timed out",killed:"killed",lost:"lost",info:"info"},groupTitle:"{n} notifications",copyPath:"Copy path",copied:"Copied",rawPayload:"Raw payload",outputTruncated:"Output truncated — showing the tail",fields:{type:"Type",source:"Source",severity:"Severity"}},userMessage:{expand:"Show more",collapse:"Show less"},search:{placeholder:"Search chat…",searching:"Searching…",results:"{current}/{total} results",resultsCapped:"{current}/{total}+ results",noResults:"No results",previous:"Previous match",next:"Next match",close:"Close search"}},ese={connectionConnected:"Connected",connectionConnecting:"Connecting…",connectionDisconnected:"Disconnected",ctxTooltip:"Used {used} / {max} tokens ({pct}%)",modelLabel:"Model",permissionManual:"Always Ask",permissionAuto:"Never Ask",permissionYolo:"Ask When Needed",permissionManualDesc:"Auto-read only; everything else needs your approval first",permissionAutoDesc:"Never interrupts you; everything runs and is decided automatically",permissionYoloDesc:"Routine edits and commands run automatically; risky actions, questions, and plans still ask",planLabel:"Plan",planOn:"on",planOff:"off",planTooltip:"Toggle plan mode (research before editing)",workModeDismiss:"Exit mode",goalLabel:"Goal",timeUnitHour:"h",timeUnitMinute:"m",timeUnitSecond:"s",planEmptyArmed:"Plan mode is on — the plan the agent writes will show up here.",planEmptyIdle:"No plan yet — turn plan mode on and the agent’s plan will show up here.",swarmLabel:"Swarm",swarmDismiss:"Turn off Swarm",towerLabel:"Tower",towerDismiss:"Turn off Tower",modeOff:"Off",goalPlaceholder:"What should the agent achieve?",planPlaceholder:"What should the agent plan for?",goalStart:"Start",goalPause:"Pause",goalResume:"Resume",goalCancel:"Cancel",goalCancelConfirm:"Cancel this goal? It cannot be resumed afterwards.",goalCancelConfirmYes:"Yes",goalCancelConfirmNo:"No",goalDoneWhen:"Done when",goalStatusActive:"Active",goalStatusPaused:"Paused",goalStatusBlocked:"Blocked",goalStatusComplete:"Complete",modeNotSupported:"Not supported",thinkingLabel:"Thinking",thinkingTooltip:"Toggle thinking mode",cacheNote:"Note: Switching models or thinking effort invalidates the existing prompt cache. Start a new chat to avoid extra token costs.",starredModels:"Starred",moreModels:"More models…",statusPanelTitle:"Session status",statusPanelClose:"Close",statusModel:"Model",statusThinking:"Thinking",statusPermission:"Permission",statusPlanMode:"Plan mode",statusSwarmMode:"Swarm mode",statusTowerMode:"Tower mode",swarmOn:"on",swarmOff:"off",towerOn:"on",towerOff:"off",statusContext:"Context",statusCost:"Cost",statusContextValue:"{used} / {max} ({pct}%)",statusNone:"—",activityRunning:"Running…",activityAwaitingApproval:"Awaiting approval",activityAwaitingQuestion:"Awaiting answer",interrupt:"Interrupt",runningShort:"in progress"},tse={inputLabel:"Message input",placeholder:"Type a message…",send:"Send ↵",queueLabel:"Queue",placeholderRunning:"Press Enter to queue · Ctrl+S to inject into the running turn",placeholderRunningMobile:"Press Enter to queue",starting:"Sending…",queuePending:"{n} waiting to send",queueSteer:"Send into the running turn",queueDragTitle:"Drag to reorder",editQueued:"Edit (load back into the input)",queuedAttachments:"attachment ×{n}",queuedHasImage:"Contains {n} image(s) — remove only, not editable",attachmentImage:"Image",attachmentVideo:"Video",attachments:"Attachments",imagesAndVideos:"Images and videos",mentionNamed:"Mention {name}",attachmentOpenUnsupported:"Can’t open {name} — this file type isn’t supported",dropToAttach:"Drop files to attach",remove:"Remove",removeNamed:"Remove {name}",mediaAttachments:"Media rail",uploading:"Preparing",uploadFailed:"Failed",attachFile:"Attach file",addMenu:"Add",addFiles:"Files",addFilesDesc:"Upload files",addGoalDesc:"Set a goal to keep pursuing",addPlanDesc:"Turn plan mode on",addSwarmDesc:"Turn swarm mode on",addTowerDesc:"Turn tower mode on",noCommands:"No commands",slashSheetTitle:"Commands",slashSearchPlaceholder:"Search commands…",mentionSheetTitle:"Mention",mentionSearchPlaceholder:"Search attachments, files, or skills…",addSlash:"Commands",addSlashDesc:"Built-in commands or skills",addMention:"Mention",addMentionDesc:"Mention attachments, project files, or skills",interrupt:"Interrupt",interruptTitle:"Interrupt current operation",expandTitle:"Expand input for multi-line editing",collapseTitle:"Collapse input",emptyConversationTitle:"Kimi Code",emptyConversation:"No messages yet — type below to start the conversation",upgradeBanner:"Upgrade your Kimi account to use Kimi Code",quickStartPlaceholder:"Type a message to start a new conversation…",thinkingSuffix:" · thinking",thinkingSuffixEffort:" · {level}",noArgCommand:"{cmd} takes no arguments"},nse={title:"Sign in to Kimi Code",close:"Close (Esc)",regionCnTitle:"Kimi Code",regionCnHint:"Sign in with your kimi.com account",regionOverseasTitle:"Kimi Code",regionOverseasHint:"Sign in with your kimi.ai account",oauthTitle:"Sign in with Kimi",oauthHint:"Finish authorizing in your browser to sign in",starting:"Starting sign-in flow…",openedHint:"Finish authorizing in your browser ({time}).",blockedTitle:"Could not open the login page",blockedHint:"The browser blocked the automatic opening — use the button below to continue authorizing.",notOpened:"Didn't open in your browser?",authorizeInBrowser:"Sign in via browser",orDivider:"or",fallbackPrefix:"On another device? Open ",fallbackSuffix:" and enter the device code:",copy:"Copy",copied:"Copied",copyLink:"Copy link",success:"Signed in",successHint:"Loading, will close automatically…",expiredTitle:"Device code expired",expiredHint:"Please restart the sign-in flow",deniedTitle:"Sign-in cancelled",retry:"Retry",closeBtn:"Close",failedTitle:"Login failed",errorHint:"Please upgrade kimi-code and try again",pollErrorTitle:"Lost connection",pollErrorHint:"Sign-in polling failed repeatedly. Check the kimi-code process and try again.",action:"Sign in",requiredTitle:"Sign in required",requiredMessage:"Sign in to your Kimi account and set up a model to start chatting.",goToLogin:"Sign in",upgradeRequiredTitle:"Upgrade required",upgradeRequiredMessage:"Your account is on the free plan. Upgrade to a membership to start chatting with Kimi models.",pickModelTitle:"Choose a model",pickModelMessage:"Models are available. Pick a default model to start chatting.",pickModelAction:"Choose",configureModelsTitle:"Set up a model",configureModelsMessage:"You're signed in, but no model is available yet. Set up a model to start chatting.",configureModelsGenericMessage:"No model is available yet. Set up a model to start chatting.",configureModelsAction:"Set up",rcSubtitle:"Remote Control session",rcChecking:"Checking sign-in status…",rcLead:"This Remote Control session requires authorization. Sign in with your Kimi account to continue.",rcSuccessHint:"Redirecting…",rcExpiredTitle:"Authorization expired or declined",rcDeniedTitle:"Authorization cancelled",rcStartErrorTitle:"Could not start sign-in",rcSessionErrorTitle:"Could not create your session",rcConnectionErrorHint:"Check your connection and try again.",rcSuccessNoRedirect:"You can close this page now."},ise={title:"Provider management",loading:"Loading providers…",unavailable:"Provider management is not available yet",empty:"No providers yet",status:{connected:"Connected",error:"Error",unconfigured:"Not configured"},keySet:"key set",keyNotSet:"key not set",managedBadge:"OAuth",modelCount:"{count} models",confirmDelete:"Confirm delete?",refresh:"Refresh",delete:"Delete",refreshTitle:"Refresh {type}",deleteTitle:"Delete {type}",loginKimi:"Sign in to Kimi",loginAnthropic:"Sign in to Anthropic",addProvider:"Add provider",added:"Provider added",enterApiKey:"Enter API Key",optional:"Optional",apiKeyRequired:"API Key cannot be empty",fieldId:"Name",fieldType:"API Protocol",types:{kimi:"Kimi",openai:"OpenAI",openai_responses:"OpenAI Responses",anthropic:"Anthropic","google-genai":"Google GenAI",vertexai:"Vertex AI"},fieldApiKey:"API Key",apiKeyManaged:"Signed in with OAuth",apiKeySet:"Set — enter a new key to replace",showApiKey:"Show API key",hideApiKey:"Hide API key",fieldBaseUrl:"Base URL",baseUrlPlaceholder:"https://api.example.com/v1",fieldModels:"Models",colModelId:"Model ID",colContext:"Context",colDisplayName:"Display name",modelIdPlaceholder:"kimi-k3",modelContextPlaceholder:"1048576",modelNamePlaceholder:"Optional",noModels:"No models",addModel:"Add model",removeModel:"Remove model",fieldDefaultModel:"Default model",save:"Save",saved:"Provider saved",deleteProvider:"Delete provider",deleteConfirm:"Delete {id} and its {count} models?",deleteConfirmYes:"Delete",managedHint:"Managed providers sign in and out on the Account tab",unsavedGuard:"You have unsaved changes.",guardStay:"Keep editing",guardDiscard:"Discard",add:"Add",catalog:{sourceCatalog:"From directory",sourceManual:"Manual",sourceRegistry:"Registry",registryHint:"Import providers and models from an api.json registry; re-importing the same URL refreshes it",registryUrlLabel:"Registry URL",registryImported:"{count} providers imported",searchPlaceholder:"Search providers",loading:"Loading directory…",loadError:"Failed to load the directory. Check your network and retry.",retry:"Retry",empty:"No matching providers",rejected:"Not importable",rejectReason:{"unknown-explicit-type":"Unsupported protocol","proprietary-sdk":"Proprietary SDK — cannot be imported","empty-base-url":"Blank base URL","placeholder-base-url":"Endpoint contains an env placeholder"},backToList:"Back to directory",willImport:"{count} models will be imported from the directory",overwriteWarning:"A provider with this name already exists; importing overwrites its config and models",importAction:"Import"},error:{idRequired:"Name cannot be empty",idInvalid:'Name must start with a letter or digit and may only contain letters, digits, "-", "_" and spaces',apiKeyRequired:"API Key cannot be empty",baseUrlRequired:"Base URL cannot be empty",registryUrlRequired:"Registry URL cannot be empty",modelRequired:"Model ID cannot be empty",contextSizeRequired:"Max context size cannot be empty",contextSizeInvalid:"Max context size must be a positive integer"},hintClose:"Close"},ose={dialogLabel:"Switch model",title:"Switch model",close:"Close (Esc)",allTab:"All",providerTabs:"Model providers",searchPlaceholder:"Search models or providers…",clearSearch:"Clear search",loading:"Loading models…",unavailable:"Model list is unavailable",contextSuffix:"{size} ctx",capabilityImageInput:"Image input",capabilityVideoInput:"Video input",capabilityToolUse:"Tool use",capabilityThinking:"Thinking",capabilityAlwaysThinking:"Always thinking",emptyNoModels:"No models available",emptyNoMatch:"No matching models",starTitle:"Add to favorites",unstarTitle:"Remove from favorites",hintNavigate:"Navigate",hintSelect:"Select",hintClose:"Close"},sse={justNow:"just now"},rse={title:{shell:"Run command?",diff:"Apply changes?",file:"Write file?",fileop:"File operation?",url:"Fetch URL?",search:"Search?",invocation:"Invoke?",todo:"Update todo?",plan_review:"Ready to build with this plan?",generic:"Approve action?"},subagentBadge:"sub agent · {name}",danger:"Danger: {detail}",searchQueryLabel:"query",searchScope:"scope: {scope}",feedbackPlaceholder:"Explain why you are rejecting… (Enter to submit, Shift+Enter for a new line, Esc to cancel)",feedbackHint:"Enter to submit · Shift+Enter for a new line · Esc to cancel",approve:"Approve",approveSession:"Approve for session",reject:"Reject",feedback:"Feedback",feedbackSubmit:"Reject with feedback",feedbackCancel:"Cancel",approvePlan:"Approve plan",revise:"Revise",rejectAndExit:"Reject and Exit",expandPlan:"Expand",collapsePlan:"Collapse"},ase={back:"‹ Previous question",nextQuestion:"Next question ›",otherDefault:"Other…",submit:"Submit",dismiss:"Dismiss",minimize:"Minimize",expand:"Expand",hint:"↑↓ to choose · Enter to confirm"},lse={tag:"tasks",summary:"{run} running · {done} done",copy:"Copy",calling:"Calling {label}",fieldTask:"Task",fieldOutput:"Output",fieldProgress:"Progress",fieldResult:"Result",moreLines:"… ({count} more)",copied:"Copied",stop:"stop",defaultDescription:"Background task",dockTasks:"Background tasks",dockBash:"Bash",dockSubagent:"Background Agent",dockTodos:"Todos",todoProgressTitle:"Progress",stateDone:"Done",stateFail:"Failed",stateCancelled:"Cancelled",filterRecent:"Recent",filterRunning:"Running",filterDone:"Done",filterAll:"All",running:"running",closePanel:"Close panel",openPanel:"Open in the side panel",timingRunning:"Running · {time}",timingDone:"Done · {time}",emptyTasks:"No background tasks running",emptyRecent:"No recent tasks",emptyRunning:"No running tasks",emptyDone:"No completed tasks",emptyBash:"No bash tasks running",emptySubagent:"No background agent tasks running",emptyTodo:"No todos yet",openTab:"Open the tasks tab",openDetail:"Open",toBackground:"To background",collapse:"Collapse",expand:"Expand",transcriptLoadError:"Failed to load this sub agent’s conversation.",copyCommand:"Copy command",copyOutput:"Copy output",copyAll:"Copy all"},use={panelTitle:"Thinking",streaming:"Thinking…"},cse={aheadTitle:"ahead of remote",behindTitle:"behind remote",fileCountOne:"{number} file",fileCountOther:"{number} files",empty:"No git changes",clean:"Working tree clean, no changes",back:"Back",loading:"Loading diff…",noDiff:"No line changes for this file",emptyFile:"Empty file",list:"List",tree:"Tree"},dse={},fse={empty:"Select a file on the left to preview",loading:"Loading…",lineCount:"{count} lines",copy:"Copy",copied:"Copied",copyPath:"Copy path",openInEditor:"Open",reveal:"Reveal",download:"Download",close:"Close",moreActions:"More actions",refresh:"Refresh",htmlMode:"HTML preview mode",markdownMode:"Markdown preview mode",preview:"Preview",source:"Source",imageFit:"Image sizing",fit:"Fit",actual:"Actual",pdfNoPreview:"This PDF cannot be embedded here. Download it to view.",imageNoPreview:"Image file · {mime} · {size} · preview unavailable",binaryNoPreview:"Can't preview this file ({mime} · {size}). Open with another app",unknownType:"unknown type",copyCode:"Copy code",enlargeImage:"Enlarge image",errors:{emptyPath:"File path is empty",unsupportedPath:"URLs and remote paths cannot be previewed",outsideWorkspace:"Only files inside the current workspace can be previewed",isDirectory:"Select a file instead of a directory",notFound:"File no longer exists or was moved",tooLarge:"File is too large to preview",loadFailed:"Unable to read this file"}},hse={searching:"Searching…",noMatch:"No matches",files:"Files",skills:"Skills",openSkill:"Open skill file",copyPath:"Copy path",attachmentUploadFailed:"Couldn’t add attachment. Remove it or drop the file in again to retry",attachmentUploadInterrupted:"Adding attachment was interrupted. Remove it or drop the file in again to retry",viewFullscreen:"View fullscreen",mediaPreviewLoading:"Loading preview…",mediaPreviewUploading:"Adding attachment — preview when ready",mediaPreviewUnavailable:"Preview unavailable",stateUploading:"Preparing",stateUploaded:"Ready to send",stateUploadFailed:"Failed"},pse={dismiss:"Close",errorLabel:"Error",noteLabel:"Note",agentWarningFallback:"agent warning",unhandledEvent:"Unhandled event: {type}",agentError:{title:"Model request failed",connection:"Cannot connect to the model service",auth:"Model authentication failed",rateLimit:"Model rate limit reached",overloaded:"Model overloaded",filtered:"Response filtered by the provider",api:"Model API error",contextOverflow:"Context size exceeded"},details:{cause:"Cause",code:"Error code",connection:"Connection",contentType:"Content type",details:"Server details",duration:"Duration",endpoint:"Endpoint",errorName:"Error type",message:"Message",operation:"Operation",phase:"Failure phase",request:"Request",requestId:"Request ID",responsePreview:"Response preview",sessionId:"Session ID",stack:"Stack",status:"HTTP status",timeout:"Timeout",timestamp:"Time"},daemonApiTitle:"Kimi server returned an error",daemonNetworkMessage:"Web did not receive a response from the Kimi server. Check that it is still running, or refresh the page.",daemonNetworkTitle:"Cannot connect to Kimi server",daemonTimeoutMessage:"The Kimi server did not respond within the wait limit. The operation may still complete in the background — refresh later to check, or try again.",daemonTimeoutTitle:"Kimi server response timed out",diagnostics:"Diagnostics",hideDetails:"Hide details",operationFailedMessage:"The last operation did not finish. Try again later.",operationFailedTitle:"Operation failed",sendFailedTitle:"Send failed",sendFailedNoDefaultModelMessage:"No default model is configured. Choose a model again in Settings",sessionSnapshotMessage:"Web could not load the current conversation. Check that the Kimi server is still running, or refresh the page.",sessionSnapshotTitle:"Cannot load current conversation",showDetails:"Show details",copyDetails:"Copy diagnostics",copied:"Copied",wsTitle:"Realtime connection error",goal:{alreadyExists:"This session already has an active goal. Cancel it before starting a new one.",notFound:"No goal to act on — it may have already finished or been cancelled.",statusInvalid:"The current goal state does not allow this action.",notResumable:"This goal cannot be resumed (it may be cancelled or completed).",objectiveTooLong:"The objective is too long. Please shorten it and try again."}},mse={new:{desc:"Create a new session"},clear:{desc:"Clear and start a new session"},login:{desc:"Sign in to Kimi in the browser"},plan:{desc:"Toggle plan mode on/off"},swarm:{desc:"Toggle swarm mode; /swarm runs a task in swarm"},tower:{desc:"Toggle tower mode; /tower turns it on with a base branch"},goal:{desc:"Create/control a goal: /goal , /goal pause{'|'}resume{'|'}cancel"},btw:{desc:"Side chat: /btw asks a forked side session"},compact:{desc:"Compact the conversation history"},fork:{desc:"Fork this session into a new one"},export:{desc:"Download this session and troubleshooting logs as a ZIP",noSession:"Open a session before exporting it.",started:"Exporting session…",done:"Session exported.",tooLarge:"Session data exceeds the export size limit. Export it from a terminal instead: kimi export {sessionId} -o session.zip"},status:{desc:"View session status"},undo:{desc:"Undo the last message"}},gse={label:{read:"Read",bash:"Run",edit:"Edit",write:"Write",grep:"Search",glob:"Find",ls:"List",web_fetch:"Fetch",search:"Search",todo:"Todo",task:"Task",swarm:"Swarm",ask_user:"Question",plan:"Plan",goal_create:"Start Goal",goal_get:"Read Goal",goal_budget:"Set Goal Budget",goal_update:"Update Goal",waitfor:"Wait"},waitfor:{waitingAny:"Waiting for any background task",waitingTask:"Waiting for {id}",noTasks:"No background tasks running",timedOut:"Timed out",stillRunning:"{count} still running",moreFinished:"+{count} finished during wait",moreRunning:"+{count} more"},swarm:{progress:"{done} / {total}",runningSub:"{count} in progress",doneSub:"{completed} completed · {failed} failed",doneSubWithCancelled:"{completed} completed · {failed} failed · {cancelled} cancelled",phaseQueued:"Queued",phaseWorking:"Working",phaseSuspended:"Suspended",phaseCompleted:"Completed",phaseFailed:"Failed",phaseCancelled:"Cancelled",waiting:"Waiting for subagents…"},chip:{lines:"{count} lines",results:"{count} results",files:"{count} files",edited:"edited",created:"created",todos:"{count} items"},disclosure:{expand:"Expand details",collapse:"Collapse details"},agent:{foreground:"Foreground",background:"Background",status:{running:"Running",ok:"Completed",error:"Failed",cancelled:"Cancelled"}},output:{waiting:"Waiting for output…",empty:"No output",saved:"Saved result"},plan:{review:{pending:"Pending review",approved:"Approved",rejected:"Rejected",cancelled:"Cancelled"},selectedOption:"Selected",pathOnlyHint:"No inline content — open it in the side panel:",feedback:"Feedback"},summary:{inScope:"{value} in {scope}"},goal:{objectiveWithCriterion:"{objective} · {criterion}",status:"Status: {status}",budget:"{value} {unit}",turns:"{value} turns",tokens:"{value} tokens",milliseconds:"{value} ms",seconds:"{value} sec",minutes:"{value} min",hours:"{value} hr"},group:{countOther:"{count} tool call | {count} tool calls",typed:{read:{done:"Read {count} file | Read {count} files"},bash:{done:"Ran {count} command | Ran {count} commands"},grep:{done:"Searched {count} pattern | Searched {count} patterns"},search:{done:"Ran {count} web search | Ran {count} web searches"},glob:{done:"Matched {count} file pattern | Matched {count} file patterns"},ls:{done:"Listed {count} directory | Listed {count} directories"},web_fetch:{done:"Fetched {count} page | Fetched {count} pages"},edit:{done:"Made {count} edit | Made {count} edits"},write:{done:"Wrote {count} file | Wrote {count} files"}}},activity:{failedClause:" ({count} failed)",liveDonePrefix:"",busy:"Working…",doing:{read:"Reading {subject}",bash:"Running {subject}",grep:"Searching {subject}",search:"Searching {subject}",glob:"Matching {subject}",ls:"Listing {subject}",web_fetch:"Fetching {subject}",edit:"Editing {subject}",write:"Writing {subject}"}},ask:{dismissed:"Dismissed",answer:"{count} answer",answers:"{count} answers",answered:"Answered",more:"(+{count} more)",collected:"Collected your answers",question:"{count} question",questions:"{count} questions",freeInput:"(free text)",unanswered:"No answer"}},vse={resizeHandleAria:"Resize sidebar width",resizePreviewAria:"Resize preview panel width",detailPanelAria:"Detail panel"},yse={openSwitcher:"Switch session / workspace",openSettings:"Session settings",settingsTitle:"Settings",groupSession:"Current session",groupApp:"App preferences",groupAccount:"Account",sheetLabel:"Sheet",closeSheet:"Close",tapToCycle:"tap to cycle",running:"running",idle:"idle",sessionCount:"{n} sessions",newSession:"New session",permManualSub:"Auto-read only; everything else needs your approval first",permAutoSub:"Never interrupts you; everything runs and is decided automatically",permYoloSub:"Routine edits and commands run automatically; risky actions, questions, and plans still ask",planModeSub:"Plan mode",goalModeSub:"Goal mode",swarmModeSub:"Swarm mode",towerModeSub:"Tower mode",archivedSessions:"Archived sessions",archivedSessionsSub:"Browse and restore archived sessions",archivedBack:"Back",viewFlat:"Flat",viewGrouped:"By workspace"},kse={colorSchemeLabel:"Appearance",light:"Moon bright",dark:"Moon dark",system:"System"},bse={continue:"Continue",back:"Back",skip:"Skip",welcome:{title:"Welcome to Kimi Code",subtitle:"The AI coding workbench for professional developers",languageLabel:"Language",themeLabel:"Appearance"},login:{title:"Configure Model",subtitle:"Choose the model service that powers Kimi Code. You can change it later in Settings",kimiTitle:"Sign in with Kimi",kimiHint:"Ready out of the box with Kimi membership benefits",kimiCnTitle:"Kimi Code",kimiCnHint:"Sign in with your kimi.com account",kimiOverseasTitle:"Kimi Code",kimiOverseasHint:"Sign in with your kimi.ai account",customProviderTitle:"Add a custom provider",customProviderHint:"Bring your own API key for OpenAI-compatible and other services",loggedInTitle:"Logged in with Kimi",loggedInHint:"Your model service is ready to use",finish:"Finish",skip:"Skip for now"}},wse={title:"Settings",internalTest:"Internal Test",close:"Close (Esc)",tabs:{general:"General",agent:"Agent",account:"Account",providers:"Providers",advanced:"Advanced",archived:"Archived",shortcuts:"Hotkeys",plugins:"Plugins",lab:"Lab"},lab:{sidebarTabs:"Multi-tab sidebar",sidebarTabsHint:"The sidebar shows Open / Done / Workspaces tabs"},plugins:{retry:"Retry",builtIn:"Built-in",official:"Official",thirdParty:"Third-party",installed:"Installed",install:"Install",update:"Update",remove:"Remove",enabled:"Enabled",homepage:"Homepage",empty:"No plugins found",hasErrors:"Error",customInstall:"Install custom plugin",customInstallPlaceholder:"https://… or /path/to/plugin",customInstallHint:"Accepts an https zip URL, a GitHub repo URL, or a local directory path.",extensionHintTitle:"One step left: install the browser extension",extensionGuide:"Manual install",dismissHint:"Dismiss",catalogUnavailable:"The marketplace catalog is currently unreachable; installed plugins remain manageable below.",source:{"local-path":"Local","zip-url":"ZIP",github:"GitHub"},counts:{skill:"1 skill | {n} skills",mcp:"1 MCP server | {n} MCP servers",mcpEnabled:"{n} on",hook:"1 hook | {n} hooks",command:"1 command | {n} commands"}},appearance:"Appearance",notifications:"Notifications",notifyEnabled:"System notifications",notifyEnabledHint:"Send a system notification when a turn completes, needs an answer, or needs approval",notifySound:"Notification sound",notifySoundHint:"Play the system sound with notifications",notifyDenied:"Blocked in browser settings",notifyTitle:"Kimi Code · Turn finished",notifyQuestionTitle:"Kimi Code · Needs answer",notifyApprovalTitle:"Kimi Code · Approval required",notifyFallback:"View result",notifyQuestionFallback:"A question is waiting for your answer",notifyApprovalFallback:"A tool needs your approval",account:"Account",signedIn:"Signed in",signedOutHint:"Sign in to view your account and model access",planUsage:{title:"Plan Usage",retry:"Retry",loadFailed:"Failed to load",empty:"No usage data yet",weekLimit:"Weekly limit",genericLimit:"Limit",hourLimit:"{n}h limit",dayLimit:"{n}d limit",minuteLimit:"{n}m limit",resetsIn:"resets in {duration}",resetDone:"reset",durationDay:"{n}d",durationHour:"{n}h",durationMinute:"{n}m",durationSecond:"{n}s",usedPct:"{pct}% used",boosterTitle:"Booster",boosterBalance:"Balance",monthlyUsed:"Used this month",monthlyLimit:"Monthly limit",unlimited:"Unlimited",freeTitle:"Free account",freeHint:"Upgrade to a membership to use Kimi models and see plan usage"},colorSchemeHint:"Choose the app’s light or dark appearance",appIcon:"Dock icon",appIconHint:"Choose the icon shown in the Dock",appIconDefault:"Default",appIconBlack:"Black",uiFontSize:"Font size",uiFontSizeHint:"Adjust interface and message text size",vibrancy:"Frosted sidebar",vibrancyHint:"Use the native macOS frosted-glass material behind the sidebar — turn it off if the translucency is hard to read",languageHint:"Choose the interface language",defaultOpenInApp:"Default open-in app",defaultOpenInAppHint:"App used when opening files and folders from the header menu",openWith:"Open with",agentDefaults:"Agent defaults",saving:"Saving",defaultModel:"Default model",defaultModelHint:"New sessions prefer this model",noDefaultModel:"No default model",defaultPermission:"Default permission",defaultPermissionHint:"Only affects newly-created sessions",defaultThinking:"Thinking by default",defaultThinkingHint:"Whether new sessions start with thinking enabled",defaultPlanMode:"Plan mode by default",defaultPlanModeHint:"Whether new sessions start in plan mode",secondaryModelSection:"Subagents",secondaryModel:"Subagent model",secondaryModelHint:"Model and thinking effort that subagents use by default",secondaryModelEffort:"Thinking effort",noSecondaryModel:"Not set (inherit primary)",secondaryModelEffortAuto:"Model default",telemetry:"Improve product with usage data",telemetryHint:"When on, we collect anonymous interaction data (such as clicks, interruptions, and feature usage) to improve the product experience. You can turn it off at any time.",telemetryRestartHint:"Takes effect after restarting the service.",credentialReady:"Credential configured",credentialMissing:"Missing credential",configUnavailable:"The server did not return config yet. These settings are unavailable.",versionAndUpdates:"Version & updates",appVersion:"App version",appVersionHint:"The running app’s version and build time",checkUpdate:"Check for updates",checkUpdateHint:"Manually check whether a new version is available",checkUpdateBtn:"Check now",updateChecking:"Checking…",updateCheckLatest:"You’re on the latest version",updateCheckAvailable:"Version {version} is available — download it from the update entry in the sidebar",updateCheckUnsupported:"This build does not support update checks",updateCheckFailed:"Check failed. Please try again later.",updateCheckAvailableAuto:"Version {version} found — downloading in the background",updateCheckDownloaded:"Version {version} is ready — restart from the update entry in the sidebar",autoDownloadUpdate:"Auto-download updates",autoDownloadUpdateHint:"Download new versions in the background and install them on the next restart",canaryUpdate:"Update Canary",canaryGhMissing:"GitHub CLI not found — install it first (brew install gh) and sign in",canaryGhUnauthenticated:"GitHub CLI is not signed in — run gh auth login in a terminal first",canaryTrigger:"Repackage Canary",canaryTriggerHint:"Trigger the macOS arm64 build pipeline to produce a new canary build",canaryTriggerBtn:"Repackage Canary",canaryTriggerConfirm:"Click again to confirm",canaryTriggerDone:"Triggered — the build takes about 20–30 minutes",canaryTriggerFailed:"Failed to trigger: {error}",canaryViewWorkflow:"View workflow",canaryImportStable:"Import UI Settings from Stable…",canaryImportStableTitle:"Import UI Settings from Stable",canaryImportStableHint:"Copies the stable app’s UI settings (pinned sessions, appearance, and other localStorage preferences) into Canary, replacing the current ones (the existing copy is backed up as leveldb.bak). Canary restarts to finish the import; the stable app must stay quit.",canaryImportStableBtn:"Import & Restart",canaryImportStableRunning:"The stable app (Kimi Code) is running — quit it first, then import again.",canaryImportStableNoData:"No UI settings data from the stable app was found.",canaryImportStableFailed:"Import failed: {error}",privacy:"Data & privacy",diagnostics:"Diagnostics",messageFolding:"Message folding",turnFolding:"Auto-fold messages",turnFoldingHint:"When a turn ends, the work folds away automatically, leaving only the summary",activityRunFolding:"Tool call summary",activityRunFoldingHint:"During the answer, consecutive tool calls are summarized into one row",build:"Build",serverVersion:"Server version",serverAddress:"Server address",serverAddressHint:"The address of the connected server",serverVersionHint:"The version of the connected service",copyServerVersion:"Copy server version",copyServerAddress:"Copy server address",copied:"Copied",exportLog:"Troubleshooting log",exportLogHint:"Export the troubleshooting log collected by the app",logHint:"Enable with ?debug=1 to capture",exportLogBtn:"Export log",archivedTitle:"Archived sessions",archivedDesc:"Browse archived sessions, see their workspace path, name, and archive time, and restore them to the session list.",archivedSearch:"Search archived sessions",archivedAllWorkspaces:"All workspaces",archivedSortLabel:"Sort by",archivedSortArchived:"Archive time",archivedSortCreated:"Created time",archivedSortName:"Name",archivedRestore:"Restore",archivedEmpty:"No archived sessions yet",archivedNoMatch:"No matching archived sessions",archivedSessionsCount:"{count} sessions",archivedAt:"Archived {time}",archivedLoadMore:"Load more",archivedLoading:"Loading…",archivedLoadingAll:"Loading all archived sessions…"},Ase={openInEditor:"Open in editor",openInEditorShort:"Open",openInApp:"Open in {app}",chooseOpenApp:"Choose application",copyAll:"Copy all as Markdown",copyFinalSummary:"Copy final summary",copied:"Copied",lastUsed:"Last used",copyPath:"Copy path",changed:"{n} changed",gitTooltip:"Open Files > Changed",detached:"detached",openPr:"Open pull request",prStatusOpen:"open",prStatusClosed:"closed",prStatusMerged:"merged",prStatusDraft:"draft",prStatusUnknown:"unknown",options:"Options",copySessionId:"Copy session ID",pinSession:"Pin",unpinSession:"Unpin",renameSession:"Rename",forkSession:"Fork session",archiveSession:"Archive",markSessionDone:"Mark as done",reopenSession:"Mark as open",exportSession:"Export session",devBadge:"Running in development mode"},Cse={title:"Side chat",empty:"Ask a quick question on the side — it shares this session’s context.",placeholder:"Ask the side chat…",send:"Send"},xse={comment:"Comment",addToChat:"Add to chat",commentPlaceholder:"Write a comment…",confirm:"Add",copyQuote:"Copy quote",copyComment:"Copy comment",quoteLabel:"Quote"},Sse={actions:{summonApp:{label:"Show App Window",desc:"Bring the app window to the foreground from anywhere"},newSession:{label:"New Session",desc:"Start a new session in the current workspace"},searchSessions:{label:"Search Chats",desc:"Open the session search dialog"},archiveSession:{label:"Complete Chat",desc:"Mark the current chat as done right away (find it under Done)"},toggleSideChat:{label:"Toggle Side Chat",desc:"Open or close the /btw side chat"},toggleSidebar:{label:"Toggle Sidebar",desc:"Collapse or expand the session sidebar"},openFolder:{label:"Open Folder",desc:"Add a workspace folder with the native picker"},openInDefaultApp:{label:"Open in App",desc:"Open the workspace in your default editor/terminal"},openSettings:{label:"Open Settings",desc:"Show or hide the settings dialog"},toggleTerminal:{label:"Toggle Terminal",desc:"Show or hide the bottom terminal panel"},openDiffTab:{label:"Open Changes",desc:"Open or activate the workspace changes tab"},sidebarTabOpen:{label:"Open Tab",desc:"Switch to the Open list in the sidebar"},sidebarTabDone:{label:"Done Tab",desc:"Switch to the Done list in the sidebar"},sidebarTabWorkspaces:{label:"Workspaces Tab",desc:"Switch to the workspace directory in the sidebar"},selectPrevSibling:{label:"Previous Item",desc:"Select the previous chat / workspace in the current tab"},selectNextSibling:{label:"Next Item",desc:"Select the next chat / workspace in the current tab"},send:{label:"Send Message",desc:"Send the composer input"},newline:{label:"Newline",desc:"Insert a newline in the composer"}},searchPlaceholder:"Search shortcuts",unassigned:"Unassigned",unassign:"Unassign shortcut",edit:"Edit shortcut",reset:"Reset to default",resetAll:"Reset all to defaults",recording:"Press the new shortcut…",invalid:"This key combination can’t be used as a shortcut",notGlobal:"This key combination can’t be registered as a system-wide shortcut",globalTaken:"This shortcut is already taken by the system or another app",reserved:"Reserved by the system menu",reservedSteer:"Reserved for steer (Ctrl/Cmd+S)",reservedFind:"Reserved for transcript find (Ctrl/Cmd+F)",conflict:"Already used by “{action}”",customBadge:"Custom"},_se={panelAria:"Terminal",toolbarAria:"Terminal tabs",resizeAria:"Resize terminal panel height",toggle:"Toggle terminal",open:"Open terminal",close:"Close terminal",newTab:"New terminal",closeTab:"Close terminal",restartTab:"Restart terminal",collapse:"Collapse terminal panel",empty:"No terminal yet — click to start one",processExited:"[process exited]",processExitedWithCode:"[process exited with code {code}]"},Ise={tabs:{diff:"Changes",file:"File",turnDiff:"Turn diff",compaction:"Compaction summary",agent:"Subagent",term:"Terminal"},newTab:"New tab",closeTab:"Close tab",expand:"Expand panel",collapse:"Restore panel",hide:"Close right panel",openPanel:"Open right panel",launcherAria:"Quick open"},Mse={title:"PR Preview",intro:"Build a pull request or branch of this repo in an isolated worktree and open its UI in a separate window. The first build can take a few minutes.",prLabel:"Preview target",customRefPlaceholder:"PR number, branch, tag, or commit SHA",invalidRef:"Enter a valid branch name, tag, or commit SHA",start:"Start preview",cleanup:"Clean up preview cache",cleanupConfirm:"Delete all cached previews except the one currently being previewed? They will be rebuilt on demand next time.",cleanupDone:"Removed {count} cached preview(s)",fetching:"Fetching {pr}…",installing:"Installing dependencies…",building:"Building renderer…",activeText:"Previewing {pr}",stop:"Exit preview",rebuild:"Fetch & rebuild",errorTitle:"Preview failed",retry:"Retry",stageFetch:"fetch the code",stageInstall:"install dependencies",stageBuild:"build the renderer",stageFailed:"Failed to {stage}",stageHung:"Building the preview hung while trying to {stage} (no output for 5 minutes, killed — check the network/proxy)"},Tse={title:"Server token required",hint:"This server is protected. Enter the bearer token printed when the server started (or the password set via {env}).",tokenPlaceholder:"Token",connect:"Connect",connecting:"Connecting…"},Ese={common:Zoe,app:Goe,sidebar:Qoe,admin:Yoe,workspace:Joe,conversation:Xoe,status:ese,composer:tse,login:nse,providers:ise,model:ose,sessions:sse,approval:rse,question:ase,tasks:lse,thinking:use,diff:cse,fileTree:dse,filePreview:fse,mention:hse,warnings:pse,commands:mse,tools:gse,layout:vse,mobile:yse,theme:kse,onboarding:bse,settings:wse,header:Ase,sideChat:Cse,selection:xse,shortcuts:Sse,terminal:_se,panel:Ise,prPreview:Mse,serverAuth:Tse},Lse={confirm:"确认",cancel:"取消",close:"关闭",dismiss:"关闭",loading:"加载中",copy:"复制",errorBoundaryTitle:"出错了",errorBoundaryRetry:"重试",asyncLoadFailed:"加载失败,请关闭后重试"},Nse={connecting:"连接中…",connectingStageAuth:"正在检查登录状态…",connectingStageServer:"正在连接服务器…",connectingStageConfig:"正在加载配置…",connectingStageSessions:"正在加载会话列表…",connectingStageSession:"正在打开会话…",connectingRetrySuffix:"(第 {n} 次重试)",connectingIssueNetworkTitle:"无法连接到 Kimi 服务器",connectingIssueNetworkMessage:"请检查网络连接,确认服务器仍在运行",connectingIssueTimeoutTitle:"Kimi 服务器响应超时",connectingIssueTimeoutMessage:"仍在自动重试,请稍候",connectingIssueApiTitle:"Kimi 服务器返回错误",connectingIssueUnknownTitle:"连接出现问题",internalBuildBanner:"仅供内部测试",menuFile:"文件",menuEdit:"编辑",menuView:"视图",menuHelp:"帮助",applicationMenu:"应用菜单"},Fse={workspaceMeta:"工作空间 · {branch}",sessionsHeader:"会话",workspaces:"工作区",viewSwitcher:"列表管理",viewGroup:"视图",viewFlat:"平铺列表",viewGrouped:"按工作区分组",sortGroup:"排序",sortManual:"手动排序",sortRecent:"按最近活动",sessionAdmin:"会话管理",collapseAll:"折叠全部工作区",expandAll:"展开全部工作区",newSession:"新建会话",newChat:"新建会话",newWorkspace:"新建工作空间",dropToAddWorkspace:"松开鼠标添加工作区",emptyState:"还没有会话 · 点击 新建会话 开始",options:"选项",rename:"重命名",genTitle:"生成标题",genTitleUnavailable:"无法生成标题:需要登录 Kimi Code 托管账号,且会话中已有消息",setEmoji:"设置 Emoji…",sessionEmojiTitle:"选择 Emoji",removeEmoji:"移除 Emoji",randomEmoji:"随机",searchEmoji:"搜索 Emoji",recentEmojis:"最近使用",noEmojiResults:"没有匹配的 Emoji",emojiGroupFaces:"笑脸与人物",emojiGroupNature:"动物与自然",emojiGroupFood:"美食饮品",emojiGroupActivity:"活动与出行",emojiGroupObjects:"物品与工作",emojiGroupSymbols:"符号与状态",copyPath:"复制路径",copySessionId:"复制 Session ID",copied:"已复制 ✓",copyFailed:"复制失败",archive:"归档",archiveToastUndo:"撤销",archiveToastMid:"或到",archiveToastSettings:"设置",archiveToastTail:"查看已归档的会话",tabOpen:"进行中",tabDone:"已完成",tabWorkspaces:"工作空间",tagOpen:"进行中",tagDone:"已完成",complete:"完成",markDone:"标记为完成",reopen:"恢复进行中",noDoneSessions:"还没有已完成的会话",noOpenSessions:"还没有进行中的会话",completeToastLead:"已完成",reopenToastLead:"已恢复进行中",fork:"分叉会话",export:"导出会话",pin:"置顶",unpin:"取消置顶",lastActive:"最后更新:{time}",pinned:"置顶",collapsePinned:"折叠置顶区",expandPinned:"展开置顶区",resizePinnedAria:"调整置顶区高度",delete:"删除",removeWorkspace:"移除工作区",brand:"Kimi Code",signedIn:"已登录",signOut:"退出登录",notSignedIn:"未登录",signIn:"登录",defaultUserName:"Kimi 用户",upgrade:"升级",upgradeMembership:"会员升级",logoutConfirmTitle:"退出登录",logoutConfirmMessage:"确定要退出当前账号吗?",language:"语言",backendTitle:"后端 {backend} · {endpoint} — 点击切换",noSessions:"暂无对话",allPinned:"有 {count} 条对话被置顶",showMore:"展开更多",loadMore:"加载更多",showLess:"收起",loadingMore:"加载中…",collapseSidebar:"收起侧边栏",expandSidebar:"展开侧边栏",searchPlaceholder:"搜索会话或工作区",search:"搜索",searchHint:"↑↓ 选择 · ↵ 打开 · Esc 关闭",searchHintSelect:"选择",searchHintOpen:"打开",searchHintClose:"关闭",searchClear:"清除搜索",searchNoResults:"没有匹配的会话或工作区",searchEmpty:"暂无会话",update:"更新",updateAvailable:"发现新版本 v{version}",updateDownloadingButton:"下载中({percent}%)",updateReady:"v{version} 已就绪",updateDone:"重启并更新",updateFailed:"下载失败",updateRetry:"重试",updateDownloadNow:"下载并更新",updateSkip:"本次跳过",updateRestartNow:"立即重启",updateRestartLater:"下次启动",updateReleaseDate:"发布于 {date}",updateCurrentVersion:"当前版本 v{version}",updateWhatsNew:"更新内容",updateBackground:"后台下载",updateAutoDownload:"以后自动下载并安装更新",rcSelectDevice:"选择设备",rcCurrentDevice:"当前设备:{name}",rcConnectable:"可连接",rcUnavailable:"不可用",rcOnline:"在线",rcOffline:"离线",rcDevicesLoadFailed:"设备列表加载失败"},Rse={title:"会话管理",subtitle:"管理所有会话,把任务完成的会话标记完成。旧会话按更新时间筛选,即可批量清理。",back:"返回",filterWorkspace:"工作空间",filterStatus:"状态",filterTime:"更新时间",allWorkspaces:"全部工作空间",selectAll:"全选",searchWorkspace:"搜索工作空间",noWorkspaceMatch:"没有匹配的工作空间",removeTag:"移除 {name}",statusAll:"全部状态",statusOpen:"进行中",statusDone:"已完成",timeAll:"全部时间",timeDaysAgo:"{n} 天以前",query:"查询",reset:"重置",colStatus:"状态",colTitle:"会话名",colWorkspace:"工作空间",colPrompt:"最后一条 prompt",colUpdated:"最后更新",colCompleted:"完成时间",colActions:"操作",empty:"没有符合当前筛选条件的会话",loading:"加载中…",total:"共 {n} 条",pageSize:"{n} 条/页",prevPage:"上一页",nextPage:"下一页",selectPageAll:"全选本页",batchSelected:"已选 {n} 项",selectAllMatching:"选中当前条件下的全部 {total} 项",materializingAll:"正在选中…",allMatchingSelected:"已选中全部 {n} 项",clearSelection:"清除选择",markDone:"标记完成",reopen:"恢复进行中",markDoneCount:"标记完成({n})",reopenCount:"恢复进行中({n})",batchDoneToast:"已标记完成 {n} 个会话",batchReopenedToast:"已将 {n} 个会话恢复为进行中",batchFailedSuffix:",{n} 个失败",batchDoneFailedNotice:"{n} 个会话未能标记完成",batchReopenFailedNotice:"{n} 个会话未能恢复为进行中",undo:"撤销",open:"打开会话",rename:"重命名…",fork:"分叉会话",export:"导出",moreActions:"更多操作"},Dse={switcherTitle:"切换工作区",switchTooltip:"切换工作区",eyebrow:"工作区",branchLabel:"分支: {branch}",noBranch:"无分支",sessionCount:"{count} 个会话",allWorkspaces:"全部工作区",currentWorkspace:"仅当前工作区",addWorkspace:"添加工作区…",noWorkspace:"暂无工作区",deleteHasSessions:"工作区内还有会话,请先归档这些会话再删除",removeWorkspaceConfirm:"移除工作区「{name}」?",swarmEnableTitle:"启用 swarm 模式?",swarmEnableConfirm:"Agent 将并行运行多个子 agent。",goalStartTitle:"启动 goal?",goalStartConfirm:"「{objective}」——Agent 将自主执行。",scopeCurrent:"当前工作区",scopeAll:"全部工作区",newInGroup:"在此工作区新建会话",addTitle:"添加工作区",pathLabel:"路径",pathPlaceholder:"/项目的绝对路径",recentLabel:"最近的文件夹",add:"添加",cancel:"取消",addHint:"粘贴一个绝对路径,或从最近用过的文件夹中选择。",addFailed:"无法打开此文件夹,请检查路径后重试。",requiredTitle:"请先选择工作空间",requiredMessage:"发送消息前,需要先选择一个文件夹作为工作区。",openThisFolder:"打开此文件夹",up:"上一级",browsing:"加载中…",filterPlaceholder:"过滤子文件夹…",searchPlaceholder:"在此目录下模糊搜索…",searching:"搜索中…",pasteToggle:"直接输入绝对路径",noFilterMatch:"没有匹配「{q}」的子文件夹",noSubfolders:"此处没有子文件夹",browseHint:'点击文件夹进入,再点"打开此文件夹"将其添加为工作区。',attentionTitle:"{count} 项待处理",awaitingAnswer:"待回答",awaitingAnswerTitle:"有提问等待你回答",awaitingPermission:"待授权",awaitingPermissionTitle:"有操作等待你授权",aborted:"失败",abortedTitle:"此会话的上一轮对话因错误中断"},Ose={jumpToLatestAria:"跳到最新消息",backToBottom:"回到底部",toc:"对话目录",newMessages:"最新消息",loading:"加载中…",starting:"正在创建对话…",requesting:"请求中…",working:"工作中…",workingRetry:"模型请求失败,正在重试(第 {n}/{max} 次)…",emptyWorkspaceHint:"在 {name} 中发送",switchWorkspace:"切换工作区",recentSessions:"最近会话",viewMoreSessions:"查看更多",sessionAdminTooltip:"在会话管理页面查看并管理更多会话",addWorkspace:"添加工作区",moreWorkspaces:"更多工作区 ({count})",pickFolder:"选择文件夹…",compacting:"正在压缩上下文…",compactedPlain:"上下文已压缩",compactedAuto:"已自动压缩上下文",compactedTokens:"({before} → {after} tokens)",viewSummary:"查看摘要",undo:"撤销",undoTooltip:"撤回编辑",undoConfirm:"撤回到这条消息?",escUndoHintPre:"再按",escUndoHintPost:"撤销本条",undone:"已撤销,原文已放回输入框",turnInterrupted:"已手动终止",turnFailed:"模型请求失败,本轮对话已中断",turnFailedMaxSteps:"达到本轮步数上限,对话已中断",turnFailedResume:"继续",turnFailedResumeText:"继续",yesterday:"昨天",loadOlder:"加载更早的消息",loadingOlder:"正在加载更早的消息…",widenTable:"加宽表格",restoreTableWidth:"恢复默认宽度",wrapCode:"开启自动换行",unwrapCode:"关闭自动换行",showLineNumbers:"显示行号",hideLineNumbers:"隐藏行号",cron:{fired:"定时任务已触发",missed:"错过的定时提醒",job:"任务 {id}",oneShot:"单次",coalesced:"已合并 {n} 次触发",missedCount:"错过 {n} 次",finalDelivery:"最后一次投递",expand:"展开",collapse:"收起"},fold:{worked:"已工作 {duration}",workedUnknown:"工作过程"},turnFiles:{titleOne:"{number} 个文件已修改",titleOther:"{number} 个文件已修改",more:"还有 {number} 个文件",moreOne:"还有 1 个文件",showLess:"收起",diffUnavailable:"此文件的改动无法逐项展示",rebuilding:"正在加载本轮改动…",openFile:"打开文件"},goal:{continuation:"目标续跑"},notification:{sentBy:{task:"由后台发送(Bash)",subagent:"由后台发送(Agent)"},bodyLine:"{status}:{description}",reason:"原因:{reason}",userStopped:"已被用户终止",statusTitle:{completed:"已完成",failed:"失败",timed_out:"超时",killed:"已终止",lost:"丢失",info:"通知"},status:{completed:"完成",failed:"失败",timed_out:"超时",killed:"已终止",lost:"丢失",info:"信息"},groupTitle:"{n} 条通知",copyPath:"复制路径",copied:"已复制",rawPayload:"原始 payload",outputTruncated:"输出已截断,仅显示末尾",fields:{type:"类型",source:"来源",severity:"严重度"}},userMessage:{expand:"展开",collapse:"收起"},search:{placeholder:"搜索对话…",searching:"搜索中…",results:"{current}/{total} 条结果",resultsCapped:"{current}/{total}+ 条结果",noResults:"无结果",previous:"上一个匹配",next:"下一个匹配",close:"关闭搜索"}},Pse={connectionConnected:"已连接",connectionConnecting:"连接中…",connectionDisconnected:"未连接",ctxTooltip:"使用 {used} / {max} tokens ({pct}%)",modelLabel:"模型",permissionManual:"始终询问",permissionAuto:"完全自动",permissionYolo:"必要时询问",permissionManualDesc:"仅自动读取,其余操作逐一向你确认",permissionAutoDesc:"完全不打断,所有操作和判断自动完成",permissionYoloDesc:"自动完成常规修改和命令;高危操作、提问和计划仍会问你",planLabel:"计划",planOn:"开",planOff:"关",planTooltip:"切换计划模式(先调研再修改)",workModeDismiss:"退出模式",goalLabel:"目标",timeUnitHour:"小时",timeUnitMinute:"分",timeUnitSecond:"秒",planEmptyArmed:"计划模式已开启,智能体写出计划后会显示在这里",planEmptyIdle:"还没有计划——开启计划模式后,智能体写出的计划会显示在这里",swarmLabel:"Swarm",swarmDismiss:"关闭 Swarm",towerLabel:"Tower",towerDismiss:"关闭 Tower",modeOff:"未启用",goalPlaceholder:"让智能体完成什么目标?",planPlaceholder:"让智能体先规划什么?",goalStart:"开始",goalPause:"暂停",goalResume:"继续",goalCancel:"取消",goalCancelConfirm:"是否需要取消当前目标?取消后将无法恢复。",goalCancelConfirmYes:"是",goalCancelConfirmNo:"否",goalDoneWhen:"完成条件",goalStatusActive:"进行中",goalStatusPaused:"已暂停",goalStatusBlocked:"已阻塞",goalStatusComplete:"已完成",modeNotSupported:"暂不支持",thinkingLabel:"思考",thinkingTooltip:"切换思考模式",cacheNote:"提示:切换模型或思考程度会使已有的提示词缓存失效。建议新建会话,避免额外的 token 消耗。",starredModels:"收藏",moreModels:"更多模型…",statusPanelTitle:"会话状态",statusPanelClose:"关闭",statusModel:"模型",statusThinking:"思考强度",statusPermission:"权限",statusPlanMode:"计划模式",statusSwarmMode:"Swarm 模式",statusTowerMode:"Tower 模式",swarmOn:"开",swarmOff:"关",towerOn:"开",towerOff:"关",statusContext:"上下文",statusCost:"花费",statusContextValue:"{used} / {max} ({pct}%)",statusNone:"—",activityRunning:"运行中…",activityAwaitingApproval:"等待批准",activityAwaitingQuestion:"等待回答",interrupt:"中断",runningShort:"进行中"},Bse={inputLabel:"消息输入框",placeholder:"输入消息…",send:"发送 ↵",queueLabel:"队列",placeholderRunning:"输入会加入队列 · Ctrl+S 立即插入运行中的回合",placeholderRunningMobile:"输入会加入队列",starting:"正在发送…",queuePending:"{n} 个任务等待发送",queueSteer:"立即发送到当前回合",queueDragTitle:"拖拽排序",editQueued:"编辑(载入到输入框)",queuedAttachments:"附件 ×{n}",queuedHasImage:"包含 {n} 张图片 — 只能移除,不能编辑",attachmentImage:"图片",attachmentVideo:"视频",attachments:"附件",imagesAndVideos:"图片和视频",mentionNamed:"提及{name}",attachmentOpenUnsupported:"无法打开 {name}:暂不支持此文件类型",dropToAttach:"松开鼠标添加附件",remove:"移除",removeNamed:"移除{name}",mediaAttachments:"媒体栏",uploading:"准备中",uploadFailed:"准备失败",attachFile:"添加附件",addMenu:"添加",addFiles:"文件",addFilesDesc:"上传文件",addGoalDesc:"设定目标并持续推进",addPlanDesc:"启用计划模式",addSwarmDesc:"启用 swarm 模式",addTowerDesc:"启用 tower 模式",noCommands:"无匹配命令",slashSheetTitle:"命令",slashSearchPlaceholder:"搜索命令…",mentionSheetTitle:"提及",mentionSearchPlaceholder:"搜索附件、文件或技能…",addSlash:"命令",addSlashDesc:"内置命令或技能",addMention:"提及",addMentionDesc:"提及附件、项目文件或技能",interrupt:"中断",interruptTitle:"中断当前操作",expandTitle:"展开输入框进行多行编辑",collapseTitle:"收起输入框",emptyConversationTitle:"Kimi Code",emptyConversation:"还没有消息 —— 在下方输入开始对话",upgradeBanner:"升级你的 Kimi 账户来使用 Kimi Code",quickStartPlaceholder:"输入消息开始新对话…",thinkingSuffix:" · 思考",thinkingSuffixEffort:" · {level}",noArgCommand:"{cmd} 不接受任何参数"},$se={title:"登录 Kimi Code",close:"关闭 (Esc)",regionCnTitle:"Kimi Code",regionCnHint:"使用 kimi.com 账号登录",regionOverseasTitle:"Kimi Code",regionOverseasHint:"使用 kimi.ai 账号登录",oauthTitle:"登录 Kimi 账号",oauthHint:"在浏览器中完成授权即可登录",starting:"正在启动登录流程…",openedHint:"请在浏览器中完成授权({time})",blockedTitle:"未能自动打开登录页",blockedHint:"浏览器拦截了自动打开,请点击下方按钮继续完成授权。",notOpened:"没有自动打开浏览器?",authorizeInBrowser:"在浏览器中登录",orDivider:"或者",fallbackPrefix:"换个设备?在浏览器打开 ",fallbackSuffix:" 输入设备码:",copy:"复制",copied:"已复制",copyLink:"复制链接",success:"已登录",successHint:"正在加载,稍后自动关闭…",expiredTitle:"设备码已过期",expiredHint:"请重新开始登录流程",deniedTitle:"登录已取消",retry:"重试",closeBtn:"关闭",failedTitle:"登录失败",errorHint:"请升级 kimi-code 后重试",pollErrorTitle:"连接已断开",pollErrorHint:"登录轮询连续失败,请检查 kimi-code 进程后重试",action:"登录",requiredTitle:"请先登录",requiredMessage:"登录 Kimi 账号并配置模型后,才能开始对话。",goToLogin:"去登录",upgradeRequiredTitle:"请升级会员",upgradeRequiredMessage:"当前为免费账户,升级会员后即可使用 Kimi 模型开始对话。",pickModelTitle:"请选择模型",pickModelMessage:"已有可用模型,选择一个默认模型后即可开始对话。",pickModelAction:"选择模型",configureModelsTitle:"请配置模型",configureModelsMessage:"账号已登录,但还没有可用模型。配置模型后即可开始对话。",configureModelsGenericMessage:"还没有可用模型。配置模型后即可开始对话。",configureModelsAction:"去配置",rcSubtitle:"远程控制会话",rcChecking:"正在检查登录状态…",rcLead:"远程控制功能需要登录后使用。使用 Kimi 账号登录即可继续。",rcSuccessHint:"正在跳转…",rcExpiredTitle:"授权已过期或被取消",rcDeniedTitle:"已取消授权",rcStartErrorTitle:"无法开始登录",rcSessionErrorTitle:"无法创建登录会话",rcConnectionErrorHint:"请检查网络连接后重试。",rcSuccessNoRedirect:"现在可以关闭本页了。"},zse={title:"供应商管理",loading:"加载提供商中…",unavailable:"暂不支持提供商管理",empty:"暂无提供商",status:{connected:"已连接",error:"错误",unconfigured:"未配置"},keySet:"key 已设置",keyNotSet:"未设置 key",managedBadge:"OAuth",modelCount:"{count} 个模型",confirmDelete:"确认删除?",refresh:"刷新",delete:"删除",refreshTitle:"刷新 {type}",deleteTitle:"删除 {type}",loginKimi:"登录 Kimi",loginAnthropic:"登录 Anthropic",addProvider:"添加供应商",added:"已添加",enterApiKey:"填写 API Key",optional:"可选",apiKeyRequired:"API Key 不能为空",fieldId:"名称",fieldType:"API 协议",types:{kimi:"Kimi",openai:"OpenAI",openai_responses:"OpenAI Responses",anthropic:"Anthropic","google-genai":"Google GenAI",vertexai:"Vertex AI"},fieldApiKey:"API Key",apiKeyManaged:"OAuth 托管登录",apiKeySet:"已设置,输入以更换",showApiKey:"显示 API Key",hideApiKey:"隐藏 API Key",fieldBaseUrl:"Base URL",baseUrlPlaceholder:"https://api.example.com/v1",fieldModels:"模型",colModelId:"模型 ID",colContext:"上下文",colDisplayName:"显示名",modelIdPlaceholder:"kimi-k3",modelContextPlaceholder:"1048576",modelNamePlaceholder:"可选",noModels:"暂无模型",addModel:"添加模型",removeModel:"移除模型",fieldDefaultModel:"默认模型",save:"保存",saved:"已保存",deleteProvider:"删除供应商",deleteConfirm:"确认删除 {id} 及其 {count} 个模型?",deleteConfirmYes:"确认删除",managedHint:"托管供应商在账户页登录 / 登出",unsavedGuard:"有未保存的修改。",guardStay:"继续编辑",guardDiscard:"丢弃",add:"添加",catalog:{sourceCatalog:"从目录添加",sourceManual:"手动添加",sourceRegistry:"注册表",registryHint:"从 api.json 注册表导入供应商与模型;同一 URL 重复导入即为刷新",registryUrlLabel:"注册表 URL",registryImported:"已导入 {count} 个供应商",searchPlaceholder:"搜索供应商",loading:"加载目录中…",loadError:"目录加载失败,请检查网络后重试",retry:"重试",empty:"没有匹配的供应商",rejected:"不可导入",rejectReason:{"unknown-explicit-type":"协议不受支持","proprietary-sdk":"私有协议,无法导入","empty-base-url":"Base URL 为空","placeholder-base-url":"端点包含环境变量占位符"},backToList:"返回目录列表",willImport:"将从目录导入 {count} 个模型",overwriteWarning:"已存在同名供应商,导入将覆盖其配置与模型",importAction:"导入"},error:{idRequired:"名称不能为空",idInvalid:'名称需以字母或数字开头,只能包含字母、数字、"-"、"_" 和空格',apiKeyRequired:"API Key 不能为空",baseUrlRequired:"Base URL 不能为空",registryUrlRequired:"注册表 URL 不能为空",modelRequired:"模型 ID 不能为空",contextSizeRequired:"上下文长度不能为空",contextSizeInvalid:"上下文长度需为正整数"},hintClose:"关闭"},jse={dialogLabel:"切换模型",title:"切换模型",close:"关闭 (Esc)",allTab:"全部",providerTabs:"模型提供商",searchPlaceholder:"搜索模型或提供商…",clearSearch:"清除搜索",loading:"加载模型中…",unavailable:"暂无可用模型列表",contextSuffix:"{size} ctx",capabilityImageInput:"图片输入",capabilityVideoInput:"视频输入",capabilityToolUse:"工具调用",capabilityThinking:"思考",capabilityAlwaysThinking:"始终思考",emptyNoModels:"暂无可用模型",emptyNoMatch:"无匹配模型",starTitle:"添加到收藏",unstarTitle:"取消收藏",hintNavigate:"导航",hintSelect:"选择",hintClose:"关闭"},Hse={justNow:"刚刚"},Wse={title:{shell:"运行命令?",diff:"应用修改?",file:"写入文件?",fileop:"文件操作?",url:"抓取 URL?",search:"搜索?",invocation:"调用?",todo:"更新 todo?",plan_review:"按这份 plan 开始实现?",generic:"批准操作?"},subagentBadge:"子 agent · {name}",danger:"危险: {detail}",searchQueryLabel:"查询",searchScope:"范围:{scope}",feedbackPlaceholder:"说明拒绝原因… (Enter 提交, Shift+Enter 换行, Esc 取消)",feedbackHint:"Enter 提交 · Shift+Enter 换行 · Esc 取消",approve:"批准",approveSession:"本会话内批准",reject:"拒绝",feedback:"反馈",feedbackSubmit:"提交并拒绝",feedbackCancel:"取消",approvePlan:"批准 plan",revise:"修改",rejectAndExit:"拒绝并退出",expandPlan:"放大",collapsePlan:"还原"},qse={back:"‹ 上一题",nextQuestion:"下一题 ›",otherDefault:"其他…",submit:"提交",dismiss:"放弃",minimize:"最小化",expand:"展开",hint:"↑↓ 选择 · Enter 确认"},Use={tag:"任务",summary:"{run} 运行中 · {done} 完成",copy:"复制",calling:"调用 {label}",fieldTask:"任务",fieldOutput:"输出",fieldProgress:"进度",fieldResult:"结果",moreLines:"…(还有 {count} 行)",copied:"已复制",stop:"停止",defaultDescription:"后台任务",dockTasks:"后台任务",dockBash:"后台 Bash",dockSubagent:"后台 Agent",dockTodos:"待办",todoProgressTitle:"当前进度",stateDone:"完成",stateFail:"失败",stateCancelled:"已取消",filterRecent:"最近",filterRunning:"进行中",filterDone:"已完成",filterAll:"全部",running:"运行中",closePanel:"关闭面板",openPanel:"在侧边栏打开",timingRunning:"运行中 · {time}",timingDone:"完成 · {time}",emptyTasks:"暂无后台任务",emptyRecent:"暂无最近任务",emptyRunning:"暂无运行中的任务",emptyDone:"暂无已完成的任务",emptyBash:"暂无后台 Bash 任务",emptySubagent:"暂无后台 Agent 任务",emptyTodo:"暂无待办事项",openTab:"查看全部后台任务",openDetail:"查看",toBackground:"转后台",collapse:"折叠",expand:"展开",transcriptLoadError:"无法加载这个子 Agent 的对话。",copyCommand:"复制命令",copyOutput:"复制输出",copyAll:"复制全部"},Vse={panelTitle:"思考过程",streaming:"思考中…"},Kse={aheadTitle:"领先远程",behindTitle:"落后远程",fileCountOne:"{number} 个文件",fileCountOther:"{number} 个文件",empty:"无 git 改动",clean:"工作区干净,无改动",back:"返回",loading:"正在加载 diff…",noDiff:"该文件没有行级改动",emptyFile:"空文件",list:"列表",tree:"树形"},Zse={},Gse={empty:"选择左侧文件预览",loading:"加载中…",lineCount:"{count} 行",copy:"复制",copied:"已复制",copyPath:"复制路径",openInEditor:"打开",reveal:"显示",download:"下载",close:"关闭",moreActions:"更多操作",refresh:"刷新",htmlMode:"HTML 预览模式",markdownMode:"Markdown 预览模式",preview:"预览",source:"源码",imageFit:"图片缩放",fit:"适应",actual:"原始",pdfNoPreview:"无法内嵌预览此 PDF,可以下载后查看",imageNoPreview:"图片文件 · {mime} · {size} · 暂不预览",binaryNoPreview:"无法预览此文件({mime} · {size}),可用其他应用打开",unknownType:"未知类型",copyCode:"复制代码",enlargeImage:"放大图片",errors:{emptyPath:"文件路径为空",unsupportedPath:"不支持预览 URL 或远程路径",outsideWorkspace:"只能预览当前 workspace 内的文件",isDirectory:"请选择具体文件,而不是目录",notFound:"文件不存在或已被移动",tooLarge:"文件过大,暂不支持预览",loadFailed:"无法读取这个文件"}},Qse={searching:"搜索中…",noMatch:"无匹配",files:"文件",skills:"技能",openSkill:"打开技能文件",copyPath:"复制路径",attachmentUploadFailed:"添加附件失败,删除该附件或重新拖入文件重试",attachmentUploadInterrupted:"添加附件中断,删除该附件或重新拖入文件重试",viewFullscreen:"全屏查看",mediaPreviewLoading:"预览加载中…",mediaPreviewUploading:"正在添加附件,完成后可预览",mediaPreviewUnavailable:"预览不可用",stateUploading:"准备中",stateUploaded:"待发送",stateUploadFailed:"准备失败"},Yse={dismiss:"关闭",errorLabel:"错误",noteLabel:"提示",agentWarningFallback:"agent 警告",unhandledEvent:"未处理的事件:{type}",agentError:{title:"模型请求失败",connection:"无法连接模型服务",auth:"模型认证失败",rateLimit:"模型请求被限流",overloaded:"模型服务过载",filtered:"响应被提供方过滤",api:"模型接口返回错误",contextOverflow:"上下文超出模型限制"},details:{cause:"底层原因",code:"错误码",connection:"连接状态",contentType:"响应类型",details:"服务端详情",duration:"耗时",endpoint:"请求地址",errorName:"错误类型",message:"错误信息",operation:"操作",phase:"失败阶段",request:"请求",requestId:"Request ID",responsePreview:"响应预览",sessionId:"Session ID",stack:"堆栈",status:"HTTP 状态",timeout:"超时设置",timestamp:"时间"},daemonApiTitle:"Kimi 服务器返回错误",daemonNetworkMessage:"Web 没有拿到 Kimi 服务器的响应。请确认它仍在运行,或刷新页面重试。",daemonNetworkTitle:"无法连接到 Kimi 服务器",daemonTimeoutMessage:"Kimi 服务器在等待时限内没有响应。操作可能仍在后台执行,请稍后刷新确认结果,或重试。",daemonTimeoutTitle:"Kimi 服务器响应超时",diagnostics:"诊断信息",hideDetails:"收起详情",operationFailedMessage:"刚才的操作没有完成,请稍后重试。",operationFailedTitle:"操作失败",sendFailedTitle:"发送失败",sendFailedNoDefaultModelMessage:"默认模型未配置,请到设置中重新选择模型",sessionSnapshotMessage:"Web 没能加载当前会话内容。请确认 Kimi 服务器仍在运行,或刷新页面重试。",sessionSnapshotTitle:"无法加载当前会话内容",showDetails:"查看详情",copyDetails:"复制诊断信息",copied:"已复制",wsTitle:"实时连接出错",goal:{alreadyExists:"当前会话已有一个进行中的目标,请先取消它再创建新目标。",notFound:"没有找到可操作的目标,可能它已经结束或被取消。",statusInvalid:"当前目标状态不支持这个操作。",notResumable:"这个目标无法恢复(可能已取消或已完成)。",objectiveTooLong:"目标描述太长了,请精简后重试。"}},Jse={new:{desc:"创建新会话"},clear:{desc:"清空并新建会话"},login:{desc:"在浏览器中登录 Kimi"},plan:{desc:"切换计划模式 开/关"},swarm:{desc:"切换 swarm 模式;/swarm <任务> 直接在 swarm 下执行"},tower:{desc:"切换 tower 模式;/tower 以指定 base 分支开启"},goal:{desc:"创建/控制目标:/goal <目标>、/goal pause{'|'}resume{'|'}cancel"},btw:{desc:"侧边聊天:/btw <问题> 向 fork 的侧边会话提问"},compact:{desc:"压缩会话历史"},fork:{desc:"把当前会话 fork 出一个新会话"},export:{desc:"将当前会话和排障日志下载为 ZIP 压缩包",noSession:"请先打开一个会话再导出。",started:"正在导出会话…",done:"会话导出完成。",tooLarge:"会话数据超过导出大小限制,可在终端用 CLI 导出:kimi export {sessionId} -o session.zip"},status:{desc:"查看会话状态"},undo:{desc:"撤销上一条消息"}},Xse={label:{read:"读取",bash:"运行",edit:"编辑",write:"写入",grep:"搜索",glob:"查找",ls:"列目录",web_fetch:"抓取",search:"搜索",todo:"待办",task:"任务",swarm:"Swarm",ask_user:"提问",plan:"计划",goal_create:"启动目标",goal_get:"读取目标",goal_budget:"设置目标预算",goal_update:"更新目标",waitfor:"等待"},waitfor:{waitingAny:"等待任一后台任务",waitingTask:"等待 {id}",noTasks:"没有后台任务在运行",timedOut:"等待超时",stillRunning:"{count} 个仍在运行",moreFinished:"另有 {count} 个在等待期间完成",moreRunning:"还有 {count} 个"},swarm:{progress:"{done} / {total}",runningSub:"{count} 个进行中",doneSub:"完成 {completed} · 失败 {failed}",doneSubWithCancelled:"完成 {completed} · 失败 {failed} · 已取消 {cancelled}",phaseQueued:"排队",phaseWorking:"运行中",phaseSuspended:"暂停",phaseCompleted:"完成",phaseFailed:"失败",phaseCancelled:"已取消",waiting:"等待子任务加入…"},chip:{lines:"{count} 行",results:"{count} 结果",files:"{count} 个文件",edited:"已编辑",created:"已创建",todos:"{count} 项"},disclosure:{expand:"展开详情",collapse:"收起详情"},agent:{foreground:"前台",background:"后台",status:{running:"运行中",ok:"已完成",error:"失败",cancelled:"已取消"}},output:{waiting:"等待输出…",empty:"(无输出)",saved:"已保存的结果"},plan:{review:{pending:"待确认",approved:"已通过",rejected:"已拒绝",cancelled:"已取消"},selectedOption:"已选择",pathOnlyHint:"该计划未保存内联内容,可在侧边栏打开:",feedback:"反馈"},summary:{inScope:"{value} 在 {scope} 中"},goal:{objectiveWithCriterion:"{objective} · {criterion}",status:"状态:{status}",budget:"{value} {unit}",turns:"{value} 轮",tokens:"{value} token",milliseconds:"{value} 毫秒",seconds:"{value} 秒",minutes:"{value} 分钟",hours:"{value} 小时"},group:{countOther:"执行了 {count} 次工具调用",typed:{read:{done:"读取了 {count} 个文件"},bash:{done:"运行了 {count} 条命令"},grep:{done:"搜索了 {count} 个模式"},search:{done:"网络搜索了 {count} 次"},glob:{done:"找了 {count} 次文件"},ls:{done:"列出了 {count} 个目录"},web_fetch:{done:"抓取了 {count} 个页面"},edit:{done:"编辑了 {count} 处"},write:{done:"写入了 {count} 个文件"}}},activity:{failedClause:"({count} 失败)",liveDonePrefix:"已",busy:"正在执行…",doing:{read:"正在读取 {subject}",bash:"正在运行 {subject}",grep:"正在搜索 {subject}",search:"正在搜索 {subject}",glob:"正在匹配 {subject}",ls:"正在列出 {subject}",web_fetch:"正在抓取 {subject}",edit:"正在编辑 {subject}",write:"正在写入 {subject}"}},ask:{dismissed:"已忽略",answer:"{count} 个回答",answers:"{count} 个回答",answered:"已回答",more:"(还有 {count} 个)",collected:"已收集回答",question:"{count} 个问题",questions:"{count} 个问题",freeInput:"(自由输入)",unanswered:"未作答"}},ere={resizeHandleAria:"调整侧栏宽度",resizePreviewAria:"调整预览面板宽度",detailPanelAria:"详情面板"},tre={openSwitcher:"切换会话 / 工作区",openSettings:"会话设置",settingsTitle:"设置",groupSession:"当前会话",groupApp:"应用偏好",groupAccount:"账号",sheetLabel:"面板",closeSheet:"关闭",tapToCycle:"点击切换",running:"运行中",idle:"空闲",sessionCount:"{n} 个会话",newSession:"新建会话",permManualSub:"仅自动读取,其余操作逐一向你确认",permAutoSub:"完全不打断,所有操作和判断自动完成",permYoloSub:"自动完成常规修改和命令;高危操作、提问和计划仍会问你",planModeSub:"计划模式",goalModeSub:"目标模式",swarmModeSub:"Swarm 模式",towerModeSub:"Tower 模式",archivedSessions:"已归档会话",archivedSessionsSub:"查看并恢复已归档会话",archivedBack:"返回",viewFlat:"平铺",viewGrouped:"按工作区"},nre={colorSchemeLabel:"外观",light:"月之亮面",dark:"月之暗面",system:"跟随系统"},ire={continue:"继续",back:"上一步",skip:"跳过",welcome:{title:"欢迎使用 Kimi Code",subtitle:"为专业开发者打造的 AI 编程工作台",languageLabel:"语言",themeLabel:"外观"},login:{title:"选择配置模型",subtitle:"选择驱动 Kimi Code 的模型服务,之后可在「设置」中更改。",kimiTitle:"登录 Kimi 账号",kimiHint:"使用 Kimi 会员权益,开箱即用",kimiCnTitle:"Kimi Code",kimiCnHint:"使用 kimi.com 账号登录",kimiOverseasTitle:"Kimi Code",kimiOverseasHint:"使用 kimi.ai 账号登录",customProviderTitle:"添加自定义供应商",customProviderHint:"使用自己的 API Key,接入 OpenAI 兼容等模型服务",loggedInTitle:"已登录 Kimi 账号",loggedInHint:"模型服务已就绪,可以开始使用",finish:"完成",skip:"跳过,稍后再说"}},ore={title:"设置",internalTest:"内部测试",close:"关闭 (Esc)",tabs:{general:"通用",agent:"Agent",account:"账户",providers:"供应商",advanced:"高级",archived:"已归档",shortcuts:"快捷键",plugins:"插件",lab:"实验室"},lab:{sidebarTabs:"多标签页侧边栏",sidebarTabsHint:"侧边栏显示「进行中 / 已完成 / 工作空间」三个标签页"},plugins:{retry:"重试",builtIn:"内置",official:"官方",thirdParty:"第三方",installed:"已安装",install:"安装",update:"更新",remove:"移除",enabled:"启用",homepage:"主页",empty:"没有找到插件",hasErrors:"错误",customInstall:"安装自定义插件",customInstallPlaceholder:"https://… 或 /本地/目录",customInstallHint:"支持 https zip 链接、GitHub 仓库地址或本地目录路径。",extensionHintTitle:"还差一步:安装浏览器扩展",extensionGuide:"手动安装",dismissHint:"知道了",catalogUnavailable:"插件市场目录暂时不可达;已安装的插件仍可正常管理。",source:{"local-path":"本地","zip-url":"ZIP",github:"GitHub"},counts:{skill:"{n} 个技能",mcp:"{n} 个 MCP 服务",mcpEnabled:"启用 {n} 个",hook:"{n} 个钩子",command:"{n} 个命令"}},appearance:"外观",notifications:"通知",notifyEnabled:"系统通知",notifyEnabledHint:"回合完成、待回答或待审批时发送系统通知",notifySound:"通知提示音",notifySoundHint:"系统通知随附提示音",notifyDenied:"已在浏览器设置中被阻止",notifyTitle:"Kimi Code · 回合完成",notifyQuestionTitle:"Kimi Code · 待回答",notifyApprovalTitle:"Kimi Code · 等待审批",notifyFallback:"点击查看结果",notifyQuestionFallback:"有提问等待你回答",notifyApprovalFallback:"有工具等待你审批",account:"账户",signedIn:"已登录",signedOutHint:"登录后可查看账户和模型权益",planUsage:{title:"套餐用量",retry:"重试",loadFailed:"加载失败",empty:"暂无用量数据",weekLimit:"每周限额",genericLimit:"限额",hourLimit:"{n} 小时限额",dayLimit:"{n} 天限额",minuteLimit:"{n} 分钟限额",resetsIn:"{duration}后重置",resetDone:"已重置",durationDay:"{n} 天",durationHour:"{n} 小时",durationMinute:"{n} 分钟",durationSecond:"{n} 秒",usedPct:"已使用 {pct}%",boosterTitle:"加油包",boosterBalance:"余额",monthlyUsed:"本月已用",monthlyLimit:"每月上限",unlimited:"不限",freeTitle:"免费账户",freeHint:"升级会员后即可使用 Kimi 模型并查看套餐用量"},colorSchemeHint:"选择应用的明暗外观",appIcon:"程序坞图标",appIconHint:"选择程序坞中显示的图标",appIconDefault:"默认",appIconBlack:"黑色",uiFontSize:"字体大小",uiFontSizeHint:"调整界面和消息文字大小",vibrancy:"毛玻璃侧栏",vibrancyHint:"在侧栏使用 macOS 原生毛玻璃材质——如果半透明影响阅读可以关闭",languageHint:"选择界面显示语言",defaultOpenInApp:"默认打开应用",defaultOpenInAppHint:"从顶栏菜单打开文件和文件夹时默认使用的应用",openWith:"打开方式",agentDefaults:"Agent 默认值",saving:"保存中",defaultModel:"默认模型",defaultModelHint:"新会话会优先使用这个模型",noDefaultModel:"未设置默认模型",defaultPermission:"默认权限",defaultPermissionHint:"只影响之后新建的会话",defaultThinking:"默认开启思考",defaultThinkingHint:"新会话默认是否开启思考",defaultPlanMode:"默认计划模式",defaultPlanModeHint:"新会话默认进入计划模式",secondaryModelSection:"子智能体",secondaryModel:"子智能体模型",secondaryModelHint:"子智能体默认使用的模型与思考强度",secondaryModelEffort:"思考强度",noSecondaryModel:"未设置(跟随主模型)",secondaryModelEffortAuto:"模型默认",telemetry:"使用数据改进产品",telemetryHint:"开启后,我们会收集您的匿名交互数据(如点击、打断、功能使用等),用于改进产品体验。您可以随时关闭。",telemetryRestartHint:"更改后需重启服务生效。",credentialReady:"凭据已配置",credentialMissing:"缺少凭据",configUnavailable:"当前服务端没有返回 config,设置项暂不可用。",versionAndUpdates:"版本与更新",appVersion:"应用版本",appVersionHint:"当前应用的版本号和构建时间",checkUpdate:"检查更新",checkUpdateHint:"手动检查是否有新版本",checkUpdateBtn:"立即检查",updateChecking:"检查中…",updateCheckLatest:"已是最新版本",updateCheckAvailable:"发现新版本 {version},可从侧边栏的更新入口下载",updateCheckUnsupported:"当前构建不支持检查更新",updateCheckFailed:"检查失败,请稍后重试",updateCheckAvailableAuto:"发现新版本 {version},正在后台下载",updateCheckDownloaded:"新版本 {version} 已就绪,可从侧边栏的更新入口重启安装",autoDownloadUpdate:"自动下载更新",autoDownloadUpdateHint:"发现新版本时在后台自动下载,重启后完成安装",canaryUpdate:"更新 Canary",canaryGhMissing:"未检测到 GitHub CLI,请先安装(brew install gh)并登录",canaryGhUnauthenticated:"GitHub CLI 未登录,请先在终端运行 gh auth login",canaryTrigger:"重新打包 Canary",canaryTriggerHint:"触发 macOS arm64 构建流水线,产出新的 Canary 内测版",canaryTriggerBtn:"重新打包 Canary",canaryTriggerConfirm:"再点一次确认触发",canaryTriggerDone:"已触发,构建约需 20–30 分钟",canaryTriggerFailed:"触发失败:{error}",canaryViewWorkflow:"查看流水线",canaryImportStable:"从正式版导入界面设置…",canaryImportStableTitle:"从正式版导入界面设置",canaryImportStableHint:"把正式版的界面设置(置顶、外观等 localStorage 偏好)复制到 Canary 并覆盖当前设置(原设置自动备份为 leveldb.bak)。确认后 Canary 会重启完成导入;正式版需保持退出状态。",canaryImportStableBtn:"导入并重启",canaryImportStableRunning:"正式版(Kimi Code)正在运行——请先退出它,再重新导入。",canaryImportStableNoData:"没有找到正式版的界面设置数据。",canaryImportStableFailed:"导入失败:{error}",privacy:"数据与隐私",diagnostics:"诊断",messageFolding:"消息折叠",turnFolding:"消息自动折叠",turnFoldingHint:"回合结束时自动折叠工作过程,仅展示总结",activityRunFolding:"工具调用汇总",activityRunFoldingHint:"回答过程中,连续的工具调用自动汇总为一行摘要",build:"构建",serverVersion:"服务端版本",serverAddress:"服务器地址",serverAddressHint:"当前连接的服务器地址",serverVersionHint:"当前连接服务的版本",copyServerVersion:"复制服务端版本",copyServerAddress:"复制服务器地址",copied:"已复制",exportLog:"故障排查日志",exportLogHint:"导出已采集的故障排查日志",logHint:"加 ?debug=1 开启采集",exportLogBtn:"导出日志",archivedTitle:"已归档会话",archivedDesc:"查看已归档会话,确认其所属工作区路径、会话名称和归档时间,并可恢复到会话列表。",archivedSearch:"搜索已归档会话",archivedAllWorkspaces:"所有工作区",archivedSortLabel:"排序方式",archivedSortArchived:"归档时间",archivedSortCreated:"创建时间",archivedSortName:"按字母顺序",archivedRestore:"恢复",archivedEmpty:"还没有归档的会话",archivedNoMatch:"没有匹配的已归档会话",archivedSessionsCount:"{count} 个会话",archivedAt:"归档于 {time}",archivedLoadMore:"加载更多",archivedLoading:"加载中…",archivedLoadingAll:"正在加载全部归档会话…"},sre={openInEditor:"在编辑器中打开",openInEditorShort:"打开",openInApp:"用 {app} 打开",chooseOpenApp:"选择应用",copyAll:"复制全部对话为 Markdown",copyFinalSummary:"仅复制最终总结",copied:"已复制",lastUsed:"上次使用",copyPath:"复制路径",changed:"{n} 处改动",gitTooltip:"打开「文件 > 改动」",detached:"游离",openPr:"打开 Pull Request",prStatusOpen:"已打开",prStatusClosed:"已关闭",prStatusMerged:"已合并",prStatusDraft:"草稿",prStatusUnknown:"未知",options:"选项",copySessionId:"复制 Session ID",pinSession:"置顶",unpinSession:"取消置顶",renameSession:"重命名",forkSession:"分叉会话",archiveSession:"归档",markSessionDone:"标记为完成",reopenSession:"恢复进行中",exportSession:"导出会话",devBadge:"开发环境运行中"},rre={title:"侧边聊天",empty:"在侧边随手问一句 —— 它共享当前会话的上下文。",placeholder:"问问侧边聊天…",send:"发送"},are={comment:"评论",addToChat:"添加到对话",commentPlaceholder:"写一句评论…",confirm:"确定",copyQuote:"复制引用",copyComment:"复制评论",quoteLabel:"引用"},lre={actions:{summonApp:{label:"显示应用窗口",desc:"从任意位置将应用窗口唤起到前台"},newSession:{label:"新建会话",desc:"在当前工作区开始一个新会话"},searchSessions:{label:"搜索会话",desc:"打开会话搜索弹窗"},archiveSession:{label:"完成任务",desc:"立即完成当前会话(可在已完成列表找回)"},toggleSideChat:{label:"侧边聊天",desc:"打开或关闭 /btw 侧边聊天"},toggleSidebar:{label:"展开/收起侧边栏",desc:"收起或展开会话侧边栏"},openFolder:{label:"打开文件夹",desc:"通过系统原生选择器添加工作目录"},openInDefaultApp:{label:"在默认应用中打开",desc:"在默认编辑器或终端中打开当前工作目录"},openSettings:{label:"打开设置",desc:"显示或隐藏设置窗口"},toggleTerminal:{label:"切换终端",desc:"显示或隐藏底部终端面板"},openDiffTab:{label:"打开改动",desc:"打开或激活工作区改动标签页"},sidebarTabOpen:{label:"进行中标签页",desc:"切换到侧栏的进行中列表"},sidebarTabDone:{label:"已完成标签页",desc:"切换到侧栏的已完成列表"},sidebarTabWorkspaces:{label:"工作空间标签页",desc:"切换到侧栏的工作空间目录"},selectPrevSibling:{label:"上一条",desc:"在当前标签页中选中上一条会话 / 上一个工作空间"},selectNextSibling:{label:"下一条",desc:"在当前标签页中选中下一条会话 / 下一个工作空间"},send:{label:"发送消息",desc:"发送输入框中的内容"},newline:{label:"换行",desc:"在输入框中插入换行"}},searchPlaceholder:"搜索快捷键",unassigned:"未分配",unassign:"取消分配",edit:"编辑快捷键",reset:"恢复默认",resetAll:"全部恢复默认",recording:"按下新的快捷键…",invalid:"该按键组合不能用作快捷键",notGlobal:"该按键组合无法注册为系统级快捷键",globalTaken:"该快捷键已被系统或其他应用占用",reserved:"系统菜单已占用该快捷键",reservedSteer:"steer 固定快捷键(Ctrl/Cmd+S),不可占用",reservedFind:"对话搜索固定快捷键(Ctrl/Cmd+F),不可占用",conflict:"已被「{action}」占用",customBadge:"自定义"},ure={panelAria:"终端",toolbarAria:"终端标签页",resizeAria:"调整终端面板高度",toggle:"切换终端",open:"打开终端",close:"关闭终端",newTab:"新建终端",closeTab:"关闭终端",restartTab:"重启终端",collapse:"收起终端面板",empty:"还没有终端,点击新建一个",processExited:"[进程已退出]",processExitedWithCode:"[进程已退出,退出码 {code}]"},cre={tabs:{diff:"改动",file:"文件",turnDiff:"本轮改动",compaction:"压缩摘要",agent:"子 Agent",term:"终端"},newTab:"新建标签页",closeTab:"关闭标签页",expand:"展开面板",collapse:"恢复面板",hide:"关闭右侧面板",openPanel:"打开右侧面板",launcherAria:"快速打开"},dre={title:"PR 预览",intro:"在隔离 worktree 中构建本仓库某个 PR 或分支的代码,构建完成后在独立窗口中打开它的界面。首次构建可能需要几分钟。",prLabel:"预览目标",customRefPlaceholder:"PR 编号、分支名、tag 或 commit sha",invalidRef:"请输入有效的分支名、tag 或 commit sha",start:"开始预览",cleanup:"清理预览缓存",cleanupConfirm:"删除除当前预览外的全部预览缓存?下次预览时会按需重新构建。",cleanupDone:"已清理 {count} 个预览缓存",fetching:"正在拉取 {pr} 的代码…",installing:"正在安装依赖…",building:"正在构建渲染产物…",activeText:"正在预览 {pr}",stop:"退出预览",rebuild:"重新拉取构建",errorTitle:"预览失败",retry:"重试",stageFetch:"拉取代码",stageInstall:"安装依赖",stageBuild:"构建渲染产物",stageFailed:"{stage}失败",stageHung:"{stage}时卡住超过 5 分钟,已终止(请检查网络/代理)"},fre={title:"需要服务器 token",hint:"此服务器已开启访问保护。输入服务器启动时打印的 bearer token(或通过 {env} 设置的密码)。",tokenPlaceholder:"Token",connect:"连接",connecting:"连接中…"},hre={common:Lse,app:Nse,sidebar:Fse,admin:Rse,workspace:Dse,conversation:Ose,status:Pse,composer:Bse,login:$se,providers:zse,model:jse,sessions:Hse,approval:Wse,question:qse,tasks:Use,thinking:Vse,diff:Kse,fileTree:Zse,filePreview:Gse,mention:Qse,warnings:Yse,commands:Jse,tools:Xse,layout:ere,mobile:tre,theme:nre,onboarding:ire,settings:ore,header:sre,sideChat:rre,selection:are,shortcuts:lre,terminal:ure,panel:cre,prPreview:dre,serverAuth:fre},pre={en:Ese,zh:hre},mre="kimi-locale";function hH(){let e=null;try{e=globalThis.localStorage?.getItem(mre)??null}catch{e=null}return e==="en"||e==="zh"?e:globalThis.navigator?.language?.toLowerCase().startsWith("zh")?"zh":"en"}function gre(e){const t=e.locale??hH();return Boe({legacy:!1,locale:t,fallbackLocale:"en",messages:pre})}const pH=Symbol("KimiI18n"),vre={t:e=>e};function bg(){const e=en(pH,null);if(e)return e;try{const t=qt();return{t:(n,i)=>t.t(n,i),locale:t.locale.value}}catch{return vre}}const $C=q(0),Nb=O(()=>$C.value>0),zC=new Set;function mH(e){zC.add(e),$C.value+=1;let t=!1;return()=>{t||(t=!0,zC.delete(e)&&($C.value-=1))}}function jE(e){if(!e)return!1;for(const t of zC)if(t===e||t.contains(e))return!0;return!1}function yre(e){return typeof e=="object"&&e!==null&&typeof e.contains=="function"}function Tm(e,t){let n;Be([e,t],([i,o])=>{n?.(),n=void 0,i&&yre(o)&&(n=mH(o))},{flush:"post",immediate:!0}),Fd(()=>{n?.(),n=void 0})}let jC=-1,HC=-1,s9=-1,F8=-1,gH=!1,HE=!1;function kre(e){const t=s9>=0;jC=s9,HC=F8,s9=e.clientX,F8=e.clientY,t&&(s9!==jC||F8!==HC)&&(gH=!0)}function hS(){HE||typeof document>"u"||(HE=!0,document.addEventListener("pointermove",kre,{capture:!0,passive:!0}))}function Fb(e){return gH?e.clientX===jC&&e.clientY===HC:!0}const Jd=6,Xd=8,bre=150,wre=ot({__name:"TooltipBubble",props:{target:{default:null},delegate:{default:null},text:{},placement:{default:"top"},maxWidth:{default:280},maxLines:{default:6}},setup(e){const t=e,n=q(),i=q(!1),o=q(!1),s=q({maxWidth:`${t.maxWidth}px`});let r,a=null,l,u=!1;function c(){if(t.target)return t.target;const _=t.delegate;return _?_.firstElementChild??_:null}function d(_){const F=n.value;if(!F)return;const I=_.getBoundingClientRect(),D=F.offsetWidth,H=F.offsetHeight,$=window.innerWidth,T=window.innerHeight;let R=t.placement;R==="top"&&I.top-Jd-HT-Xd?R="top":R==="left"&&I.left-Jd-D$-Xd&&(R="left");let P=0,j=0;R==="top"?(P=I.top-Jd-H,j=I.left+I.width/2-D/2):R==="bottom"?(P=I.bottom+Jd,j=I.left+I.width/2-D/2):R==="left"?(P=I.top+I.height/2-H/2,j=I.left-Jd-D):(P=I.top+I.height/2-H/2,j=I.right+Jd),j=Math.min(Math.max(j,Xd),$-Xd-D),P=Math.min(Math.max(P,Xd),T-Xd-H),s.value={maxWidth:`${t.maxWidth}px`,top:`${Math.round(P)}px`,left:`${Math.round(j)}px`}}function f(){return Nb.value&&!jE(c())}function h(){if(!t.text||f())return;const _=c();_&&(window.clearTimeout(r),r=window.setTimeout(()=>{i.value=!0,o.value=!1,pt(()=>{d(_),o.value=!0})},bre))}function m(){window.clearTimeout(r),u=!1,i.value=!1,o.value=!1}function g(_){u||Fb(_)||(u=!0,h())}function y(){h()}function b(){m()}function v(_){return _ instanceof Element?_.closest(".ui-tip"):null}function w(_){const F=t.delegate;if(F){if(v(_.target)!==F){m();return}u||Fb(_)||(u=!0,h())}}function A(_){const F=t.delegate;if(!F)return;const I=_.relatedTarget;I instanceof Element&&F.contains(I)||m()}function M(_){v(_.target)===t.delegate&&h()}function L(){m()}function E(){a&&(t.delegate?(a.removeEventListener("pointermove",w),a.removeEventListener("mouseout",A),a.removeEventListener("focusin",M),a.removeEventListener("focusout",L)):(a.removeEventListener("pointermove",g),a.removeEventListener("mouseleave",b),a.removeEventListener("focusin",y),a.removeEventListener("focusout",b)),a=null)}function C(){E(),l?.disconnect(),l=void 0;const _=t.target??t.delegate;_&&(a=_,t.delegate?(_.addEventListener("pointermove",w,{passive:!0}),_.addEventListener("mouseout",A),_.addEventListener("focusin",M),_.addEventListener("focusout",L),l=new MutationObserver(()=>{i.value&&m()}),l.observe(_,{childList:!0})):(_.addEventListener("pointermove",g,{passive:!0}),_.addEventListener("mouseleave",b),_.addEventListener("focusin",y),_.addEventListener("focusout",b)))}Be(()=>[t.target,t.delegate],()=>{m(),C()}),Be(Nb,_=>{_&&!jE(c())&&m()});function x(){i.value&&m()}return wn(()=>{hS(),C(),window.addEventListener("scroll",x,!0),window.addEventListener("resize",x)}),ii(()=>{window.clearTimeout(r),l?.disconnect(),E(),window.removeEventListener("scroll",x,!0),window.removeEventListener("resize",x)}),(_,F)=>i.value?(k(),fe($s,{key:0,to:"body"},[S("div",{ref_key:"bubble",ref:n,class:De(["ui-tip__bubble",{positioned:o.value}]),style:an([s.value,{"--tip-lines":e.maxLines}]),role:"tooltip"},z(e.text),7)])):ne("",!0)}}),vH=xt(wre,[["__scopeId","data-v-da3fc01a"]]),Are=["type","disabled","aria-label"],Cre=ot({__name:"IconButton",props:{size:{default:"md"},disabled:{type:Boolean},label:{},tooltip:{},type:{default:"button"}},setup(e,{expose:t}){const n=q();return t({el:n}),(i,o)=>(k(),N("button",{ref_key:"el",ref:n,class:De(["ui-icon-button",`ui-icon-button--${e.size}`]),type:e.type,disabled:e.disabled,"aria-label":e.label},[Kn(i.$slots,"default",{},void 0,!0),e.tooltip?(k(),fe(vH,{key:0,target:n.value??null,text:e.tooltip},null,8,["target","text"])):ne("",!0)],10,Are))}}),rn=xt(Cre,[["__scopeId","data-v-279bf6ac"]]),xre={class:"ui-action-toast-host"},Sre={class:"ui-action-toast__body"},_re=ot({__name:"ActionToast",props:{duration:{default:8e3},dismissLabel:{},dismissToken:{}},emits:["dismiss"],setup(e,{emit:t}){const n=e,i=t,{t:o}=bg();let s=null,r=0,a=0;function l(d){s=setTimeout(()=>i("dismiss",n.dismissToken),d),r=Date.now()+d}function u(){s!==null&&(clearTimeout(s),s=null,a=Math.max(0,r-Date.now()))}function c(){s===null&&l(a)}return l(n.duration),Nn(()=>{s!==null&&clearTimeout(s)}),(d,f)=>(k(),N("div",xre,[S("div",{class:"ui-action-toast",role:"status",onPointerenter:u,onPointerleave:c},[S("span",Sre,[Kn(d.$slots,"default")]),G(rn,{class:"ui-action-toast__close",size:"sm",label:e.dismissLabel??p(o)("common.dismiss"),tooltip:e.dismissLabel??p(o)("common.dismiss"),onClick:f[0]||(f[0]=h=>i("dismiss",e.dismissToken))},{default:de(()=>[G(Ie,{name:"close",size:"sm"})]),_:1},8,["label","tooltip"])],32)]))}}),Ire=xt(_re,[["__scopeId","data-v-5464eaec"]]),Mre={key:0,width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",stroke:"var(--color-success)","stroke-width":"2","aria-hidden":"true"},Tre={key:1,width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--color-danger)","stroke-width":"1.5","aria-hidden":"true"},Ere={key:2,width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",stroke:"var(--color-warning)","stroke-width":"1.5","aria-hidden":"true"},Sf=ot({__name:"AuthStateIcon",props:{kind:{}},setup(e){return(t,n)=>e.kind==="success"?(k(),N("svg",Mre,[...n[0]||(n[0]=[S("circle",{cx:"18",cy:"18",r:"15"},null,-1),S("polyline",{points:"10,18 15,24 26,12"},null,-1)])])):e.kind==="expired"?(k(),N("svg",Tre,[...n[1]||(n[1]=[S("circle",{cx:"14",cy:"14",r:"12"},null,-1),S("line",{x1:"14",y1:"8",x2:"14",y2:"15"},null,-1),S("circle",{cx:"14",cy:"19",r:"1.2",fill:"var(--color-danger)"},null,-1)])])):(k(),N("svg",Ere,[...n[2]||(n[2]=[S("path",{d:"M14 3 L26 24 H2 Z"},null,-1),S("line",{x1:"14",y1:"12",x2:"14",y2:"18"},null,-1),S("circle",{cx:"14",cy:"21.5",r:"1",fill:"var(--color-warning)"},null,-1)])]))}}),Lre={key:0,class:"ui-badge__dot","aria-hidden":"true"},Nre=ot({__name:"Badge",props:{variant:{default:"neutral"},size:{default:"md"},dot:{type:Boolean}},setup(e){return(t,n)=>(k(),N("span",{class:De(["ui-badge",[`ui-badge--${e.variant}`,`ui-badge--${e.size}`]])},[e.dot?(k(),N("span",Lre)):ne("",!0),Kn(t.$slots,"default",{},void 0,!0)],2))}}),Pa=xt(Nre,[["__scopeId","data-v-7b8349ab"]]),Fre={class:"ui-banner__icon","aria-hidden":"true"},Rre={class:"ui-banner__text"},Dre=ot({__name:"Banner",props:{variant:{default:"info"}},setup(e){return(t,n)=>(k(),N("div",{class:De(["ui-banner",`ui-banner--${e.variant}`]),role:"status"},[S("span",Fre,[Kn(t.$slots,"icon",{},()=>[e.variant==="info"?(k(),fe(Ie,{key:0,name:"info",size:"md"})):(k(),fe(Ie,{key:1,name:"alert-triangle",size:"md"}))],!0)]),S("span",Rre,[Kn(t.$slots,"default",{},void 0,!0)])],2))}}),np=xt(Dre,[["__scopeId","data-v-8fb5232f"]]),Ore=["aria-label"],Pre=ot({__name:"Spinner",props:{size:{default:"md"},label:{}},setup(e){const{t}=bg(),n=q(null);let i,o;function s(){const r=n.value;if(r){if(o?.matches){i?.cancel(),i=void 0;return}i||(i=r.animate([{transform:"rotate(0deg)"},{transform:"rotate(360deg)"}],{duration:850,iterations:1/0}),i.startTime=0)}}return wn(()=>{const r=n.value;!r||typeof r.animate!="function"||(o=window.matchMedia("(prefers-reduced-motion: reduce)"),o.addEventListener("change",s),s())}),ii(()=>{o?.removeEventListener("change",s),o=void 0,i?.cancel(),i=void 0}),(r,a)=>(k(),N("span",{ref_key:"boxRef",ref:n,class:De(["ui-spinner",`ui-spinner--${e.size}`]),role:"status","aria-label":e.label??p(t)("common.loading")},[...a[0]||(a[0]=[S("svg",{class:"ui-spinner__svg",viewBox:"0 0 24 24","aria-hidden":"true"},[S("circle",{class:"ui-spinner__track",cx:"12",cy:"12",r:"9"}),S("circle",{class:"ui-spinner__arc",cx:"12",cy:"12",r:"9"})],-1)])],10,Ore))}}),_i=xt(Pre,[["__scopeId","data-v-bf7852f3"]]),Bre=["type","disabled"],$re={class:"ui-button__content"},zre=ot({__name:"Button",props:{variant:{default:"primary"},size:{default:"md"},disabled:{type:Boolean},loading:{type:Boolean},type:{default:"button"}},setup(e){return(t,n)=>(k(),N("button",{class:De(["ui-button",[`ui-button--${e.variant}`,`ui-button--${e.size}`,{"is-loading":e.loading}]]),type:e.type,disabled:e.disabled||e.loading},[e.loading?(k(),fe(_i,{key:0,size:"sm",class:"ui-button__spinner"})):ne("",!0),S("span",$re,[Kn(t.$slots,"default",{},void 0,!0)])],10,Bre))}}),nn=xt(zre,[["__scopeId","data-v-e04dd6a0"]]),jre={key:0,class:"ui-card__head"},Hre={class:"ui-card__body"},Wre={key:1,class:"ui-card__foot"},qre=ot({__name:"Card",props:{elevated:{type:Boolean,default:!1}},setup(e){return(t,n)=>(k(),N("div",{class:De(["ui-card",{"is-elevated":e.elevated}])},[t.$slots.head?(k(),N("div",jre,[Kn(t.$slots,"head",{},void 0,!0)])):ne("",!0),S("div",Hre,[Kn(t.$slots,"default",{},void 0,!0)]),t.$slots.foot?(k(),N("div",Wre,[Kn(t.$slots,"foot",{},void 0,!0)])):ne("",!0)],2))}}),Ure=xt(qre,[["__scopeId","data-v-d0de153b"]]),Vre={class:"ctx-ring",viewBox:"0 0 20 20","aria-hidden":"true"},Kre=["stroke-dasharray","stroke-dashoffset"],R8=7,Zre=ot({__name:"ContextRing",props:{pct:{}},setup(e){const t=e,n=2*Math.PI*R8;return(i,o)=>(k(),N("svg",Vre,[S("circle",{class:"ctx-ring-track",cx:"10",cy:"10",r:R8,fill:"none","stroke-width":"2.5"}),S("circle",{class:"ctx-ring-fill",cx:"10",cy:"10",r:R8,fill:"none","stroke-width":"2.5","stroke-linecap":"round","stroke-dasharray":`${n}`,"stroke-dashoffset":`${n*(1-t.pct/100)}`},null,8,Kre)]))}}),Gre=xt(Zre,[["__scopeId","data-v-5a6777b1"]]),kr=q(0),G1=q(0),Qre=["aria-label"],Yre={key:0,class:"ui-dialog__head"},Jre={class:"ui-dialog__titles"},Xre={key:0,class:"ui-dialog__title"},eae={key:1,class:"ui-dialog__desc"},tae={class:"ui-dialog__body"},nae={key:1,class:"ui-dialog__foot"},iae='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])',oae=ot({__name:"Dialog",props:{open:{type:Boolean},title:{},ariaLabel:{},description:{},closeOnOverlay:{type:Boolean,default:!0},closeOnEsc:{type:Boolean,default:!0},size:{default:"md"},height:{default:"auto"},padded:{type:Boolean,default:!0},hideClose:{type:Boolean},level:{default:"raised"},initialFocus:{},focusOnOpen:{type:Boolean,default:!0}},emits:["update:open","close"],setup(e,{emit:t}){const n=e,i=t,{t:o}=bg(),s=q(null);let r=null;function a(){i("update:open",!1),i("close")}function l(){return s.value?Array.from(s.value.querySelectorAll(iae)):[]}function u(){const{initialFocus:f}=n;return f?typeof f=="function"?f()??null:typeof f=="string"?s.value?.querySelector(f)??null:s.value?.contains(f)?f:null:null}function c(f){if(!n.open)return;if(f.key==="Escape"&&n.closeOnEsc){f.preventDefault(),a();return}if(f.key!=="Tab")return;const h=l(),m=h[0],g=h[h.length-1];if(!m||!g){f.preventDefault(),s.value?.focus();return}const y=document.activeElement;f.shiftKey&&y===m?(f.preventDefault(),g.focus()):!f.shiftKey&&y===g&&(f.preventDefault(),m.focus())}function d(f){n.closeOnOverlay&&f.target===f.currentTarget&&a()}return Be(()=>n.open,async f=>{if(f){if(kr.value+=1,r=document.activeElement,n.focusOnOpen){await pt();const h=u(),m=l();(h??m[0]??s.value)?.focus()}}else kr.value=Math.max(0,kr.value-1),r instanceof HTMLElement&&(r.focus(),r=null)},{immediate:!0}),typeof window<"u"&&window.addEventListener("keydown",c),ii(()=>{typeof window<"u"&&window.removeEventListener("keydown",c),n.open&&(kr.value=Math.max(0,kr.value-1),r instanceof HTMLElement&&r.focus())}),(f,h)=>(k(),fe($s,{to:"body"},[e.open?(k(),N("div",{key:0,class:"ui-dialog__overlay",onMousedown:d},[S("div",{ref_key:"panel",ref:s,class:De(["ui-dialog",[`ui-dialog--${e.size}`,{"ui-dialog--flush":!e.padded,"ui-dialog--fixed-height":e.height==="fixed","ui-dialog--grouped":e.level==="grouped"}]]),role:"dialog","aria-modal":"true","aria-label":e.ariaLabel??e.title,tabindex:"-1"},[e.title||f.$slots.head?(k(),N("div",Yre,[Kn(f.$slots,"head",{},()=>[S("div",Jre,[e.title?(k(),N("div",Xre,z(e.title),1)):ne("",!0),e.description?(k(),N("div",eae,z(e.description),1)):ne("",!0)])],!0),e.hideClose?ne("",!0):(k(),fe(rn,{key:0,class:"ui-dialog__close",size:"sm",label:p(o)("common.close"),tooltip:p(o)("common.close"),onClick:a},{default:de(()=>[G(Ie,{name:"close",size:"md"})]),_:1},8,["label","tooltip"]))])):ne("",!0),S("div",tae,[Kn(f.$slots,"default",{},void 0,!0)]),f.$slots.foot?(k(),N("div",nae,[Kn(f.$slots,"foot",{},void 0,!0)])):ne("",!0)],10,Qre)],32)):ne("",!0)]))}}),fh=xt(oae,[["__scopeId","data-v-87c1966f"]]),sae={class:"ui-empty"},rae={key:0,class:"ui-empty__icon","aria-hidden":"true"},aae={key:1,class:"ui-empty__title"},lae={key:2,class:"ui-empty__hint"},uae=ot({__name:"EmptyState",props:{title:{},hint:{}},setup(e){return(t,n)=>(k(),N("div",sae,[t.$slots.icon?(k(),N("span",rae,[Kn(t.$slots,"icon",{},void 0,!0)])):ne("",!0),e.title?(k(),N("div",aae,z(e.title),1)):ne("",!0),e.hint?(k(),N("div",lae,z(e.hint),1)):ne("",!0),Kn(t.$slots,"default",{},void 0,!0)]))}}),yH=xt(uae,[["__scopeId","data-v-66c019cd"]]),cae={key:0,class:"ui-field__label"},dae={key:1,class:"ui-field__error"},fae={key:2,class:"ui-field__hint"},hae=ot({__name:"Field",props:{label:{},hint:{},error:{}},setup(e){return(t,n)=>(k(),N("div",{class:De(["ui-field",{"has-error":!!e.error}])},[e.label?(k(),N("label",cae,z(e.label),1)):ne("",!0),Kn(t.$slots,"default",{},void 0,!0),e.error?(k(),N("span",dae,z(e.error),1)):e.hint?(k(),N("span",fae,z(e.hint),1)):ne("",!0)],2))}}),pae=xt(hae,[["__scopeId","data-v-a6fe84a4"]]),mae=["type","value","placeholder","disabled","readonly"],gae=ot({__name:"Input",props:{modelValue:{},size:{default:"md"},type:{default:"text"},placeholder:{},disabled:{type:Boolean},readonly:{type:Boolean},error:{type:Boolean}},emits:["update:modelValue","focus","blur"],setup(e,{expose:t,emit:n}){const i=n,o=q();function s(l){i("update:modelValue",l.target.value)}function r(){o.value?.focus()}function a(){o.value?.select()}return t({focus:r,select:a,el:o}),(l,u)=>(k(),N("input",{ref_key:"el",ref:o,class:De(["ui-input",[`ui-input--${e.size}`,{"has-error":e.error}]]),type:e.type,value:e.modelValue,placeholder:e.placeholder,disabled:e.disabled,readonly:e.readonly,onInput:s,onFocus:u[0]||(u[0]=c=>l.$emit("focus",c)),onBlur:u[1]||(u[1]=c=>l.$emit("blur",c))},null,42,mae))}}),Rs=xt(gae,[["__scopeId","data-v-3093c190"]]),vae={class:"ui-kbd"},yae=ot({__name:"Kbd",props:{keys:{}},setup(e){return(t,n)=>(k(),N("span",vae,[(k(!0),N(Ne,null,wt(e.keys,i=>(k(),N("kbd",{key:i,class:"ui-kbd__key"},z(i),1))),128))]))}}),bd=xt(yae,[["__scopeId","data-v-f33c235d"]]),kae=["href","target","rel"],bae=ot({__name:"Link",props:{href:{},variant:{default:"default"},external:{type:Boolean}},setup(e){return(t,n)=>e.href?(k(),N("a",{key:0,class:De(["ui-link",`ui-link--${e.variant}`]),href:e.href,target:e.external?"_blank":void 0,rel:e.external?"noopener noreferrer":void 0},[Kn(t.$slots,"default",{},void 0,!0)],10,kae)):(k(),N("span",{key:1,class:De(["ui-link",`ui-link--${e.variant}`])},[Kn(t.$slots,"default",{},void 0,!0)],2))}}),wae=xt(bae,[["__scopeId","data-v-2c379b58"]]),Aae=["role"],Cae=ot({__name:"Menu",props:{role:{default:"menu"}},setup(e,{expose:t}){const n=q();t({el:n});let i;return wn(()=>{n.value&&(i=mH(n.value))}),ii(()=>i?.()),(o,s)=>(k(),N("div",{ref_key:"el",ref:n,class:"ui-menu",role:e.role},[Kn(o.$slots,"default",{},void 0,!0)],8,Aae))}}),is=xt(Cae,[["__scopeId","data-v-a8172c5d"]]),xae={key:0,class:"ui-menu-sep",role:"separator"},Sae=["role","disabled"],_ae=ot({__name:"MenuItem",props:{active:{type:Boolean},danger:{type:Boolean},disabled:{type:Boolean},separator:{type:Boolean},size:{default:"md"},role:{default:"menuitem"}},emits:["click"],setup(e){return(t,n)=>e.separator?(k(),N("div",xae)):(k(),N("button",{key:1,class:De(["ui-menu-item",[`ui-menu-item--${e.size}`,{"is-active":e.active,"is-danger":e.danger}]]),type:"button",role:e.role,disabled:e.disabled,onClick:n[0]||(n[0]=i=>t.$emit("click",i))},[Kn(t.$slots,"default",{},void 0,!0)],10,Sae))}}),Xt=xt(_ae,[["__scopeId","data-v-6cbd2f47"]]),Iae=ot({__name:"Tooltip",props:{text:{},placement:{default:"top"},maxWidth:{default:280},maxLines:{default:6}},setup(e){const t=q();return(n,i)=>(k(),N(Ne,null,[S("span",{ref_key:"trigger",ref:t,class:"ui-tip"},[Kn(n.$slots,"default",{},void 0,!0)],512),G(vH,{delegate:t.value??null,text:e.text,placement:e.placement,"max-width":e.maxWidth,"max-lines":e.maxLines},null,8,["delegate","text","placement","max-width","max-lines"])],64))}}),Ln=xt(Iae,[["__scopeId","data-v-4f57efde"]]),Mae={class:"ui-panel-header__title"},Tae={key:0,class:"ui-panel-header__sub"},Eae=ot({__name:"PanelHeader",props:{title:{},titleTooltip:{},subtitle:{},closable:{type:Boolean,default:!0},closeLabel:{},closeIcon:{default:"close"},wrap:{type:Boolean}},emits:["close"],setup(e){const{t}=bg();return(n,i)=>(k(),N("div",{class:De(["ui-panel-header",{wrap:e.wrap}])},[Kn(n.$slots,"leading",{},void 0,!0),e.title?(k(),fe(Ln,{key:0,text:e.titleTooltip??e.title},{default:de(()=>[S("span",Mae,z(e.title),1)]),_:1},8,["text"])):ne("",!0),G(Ln,{text:e.subtitle},{default:de(()=>[e.subtitle?(k(),N("span",Tae,z(e.subtitle),1)):ne("",!0)]),_:1},8,["text"]),Kn(n.$slots,"default",{},void 0,!0),e.closable?(k(),fe(rn,{key:1,class:"ui-panel-header__close",size:"sm",label:e.closeLabel??p(t)("common.close"),tooltip:e.closeLabel??p(t)("common.close"),onClick:i[0]||(i[0]=o=>n.$emit("close"))},{default:de(()=>[G(Ie,{name:e.closeIcon,size:"sm"},null,8,["name"])]),_:1},8,["label","tooltip"])):ne("",!0)],2))}}),Rb=xt(Eae,[["__scopeId","data-v-bb2b5e64"]]),Lae=["disabled","aria-pressed"],Nae=ot({__name:"Pill",props:{clickable:{type:Boolean,default:!0},active:{type:Boolean},disabled:{type:Boolean},ariaPressed:{type:Boolean}},emits:["click"],setup(e){return(t,n)=>e.clickable?(k(),N("button",{key:0,class:De(["ui-pill",{"is-active":e.active}]),type:"button",disabled:e.disabled,"aria-pressed":e.ariaPressed,onClick:n[0]||(n[0]=i=>t.$emit("click",i))},[Kn(t.$slots,"default",{},void 0,!0)],10,Lae)):(k(),N("span",{key:1,class:De(["ui-pill",{"is-active":e.active}])},[Kn(t.$slots,"default",{},void 0,!0)],2))}}),kH=xt(Nae,[["__scopeId","data-v-9fe3e0c7"]]),Fae=ot({__name:"ScrollArea",props:{orientation:{default:"vertical"},hideDelay:{default:600}},setup(e,{expose:t}){const n=e,i=q(null),o=q(null),s=q(!1),r=q({overflow:!1,size:0,offset:0}),a=q({overflow:!1,size:0,offset:0}),l=q(null);let u=null,c=null,d=null;const f=O(()=>({overflowX:n.orientation==="vertical"?"hidden":"auto",overflowY:n.orientation==="horizontal"?"hidden":"auto"})),h=O(()=>({height:`${r.value.size}px`,transform:`translateY(${r.value.offset}px)`})),m=O(()=>({width:`${a.value.size}px`,transform:`translateX(${a.value.offset}px)`}));function g(x,_,F){if(!(_>x+1)||x<=0)return{overflow:!1,size:0,offset:0};const D=Math.max(0,x-4),H=Math.min(D,Math.max(24,D*x/_)),$=Math.max(0,D-H),T=Math.max(1,_-x);return{overflow:!0,size:H,offset:$*F/T}}function y(){const x=o.value;if(!x)return;const _=g(x.clientHeight,x.scrollHeight,x.scrollTop),F=g(x.clientWidth,x.scrollWidth,x.scrollLeft);(_.overflow!==r.value.overflow||_.size!==r.value.size||_.offset!==r.value.offset)&&(r.value=_),(F.overflow!==a.value.overflow||F.size!==a.value.size||F.offset!==a.value.offset)&&(a.value=F)}function b(){u!==null&&clearTimeout(u),u=null}function v(){b(),s.value=!0}function w(){b(),!(l.value||i.value?.matches(":hover, :focus-within"))&&(u=setTimeout(()=>{s.value=!1,u=null},n.hideDelay))}function A(){y(),v(),w()}function M(x,_){const F=o.value;F&&(_.preventDefault(),v(),l.value={axis:x,pointerId:_.pointerId,startPointer:x==="vertical"?_.clientY:_.clientX,startScroll:x==="vertical"?F.scrollTop:F.scrollLeft},_.currentTarget.setPointerCapture(_.pointerId))}function L(x){const _=l.value,F=o.value;if(!_||_.pointerId!==x.pointerId||!F)return;const I=_.axis==="vertical"?x.clientY:x.clientX,D=_.axis==="vertical"?F.clientHeight:F.clientWidth,H=_.axis==="vertical"?F.scrollHeight:F.scrollWidth,$=_.axis==="vertical"?r.value.size:a.value.size,T=Math.max(1,D-4-$),R=(I-_.startPointer)*(H-D)/T;_.axis==="vertical"?F.scrollTop=_.startScroll+R:F.scrollLeft=_.startScroll+R}function E(x){!l.value||l.value.pointerId!==x.pointerId||(l.value=null,w())}function C(){const x=o.value;if(!(!x||!c))for(const _ of x.children)c.observe(_)}return wn(async()=>{await pt();const x=o.value;x&&(c=new ResizeObserver(y),c.observe(x),C(),d=new MutationObserver(()=>{C(),y()}),d.observe(x,{childList:!0,subtree:!0,characterData:!0}),y())}),ii(()=>{b(),c?.disconnect(),d?.disconnect()}),t({viewport:o,updateMetrics:y}),(x,_)=>(k(),N("div",{ref_key:"root",ref:i,class:"ui-scroll-area",onPointerenter:v,onPointerleave:w,onFocusin:v,onFocusout:w},[S("div",{ref_key:"viewport",ref:o,class:"ui-scroll-area__viewport",style:an(f.value),tabindex:"0",onScroll:A},[Kn(x.$slots,"default",{},void 0,!0)],36),r.value.overflow&&n.orientation!=="horizontal"?(k(),N("div",{key:0,class:De(["ui-scroll-area__bar ui-scroll-area__bar--vertical",{"is-visible":s.value}]),"aria-hidden":"true"},[S("span",{class:"ui-scroll-area__thumb",style:an(h.value),onPointerdown:_[0]||(_[0]=F=>M("vertical",F)),onPointermove:L,onPointerup:E,onPointercancel:E},null,36)],2)):ne("",!0),a.value.overflow&&n.orientation!=="vertical"?(k(),N("div",{key:1,class:De(["ui-scroll-area__bar ui-scroll-area__bar--horizontal",{"is-visible":s.value}]),"aria-hidden":"true"},[S("span",{class:"ui-scroll-area__thumb",style:an(m.value),onPointerdown:_[1]||(_[1]=F=>M("horizontal",F)),onPointermove:L,onPointerup:E,onPointercancel:E},null,36)],2)):ne("",!0)],544))}}),WE=xt(Fae,[["__scopeId","data-v-797269ad"]]),Rae=["data-icon","aria-selected","onClick"],Dae=ot({__name:"SegmentedControl",props:{modelValue:{},options:{},size:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,i=t,o=q(null),s=q([]),r=q(!1),a=q({});let l=null;function u(d,f){d instanceof HTMLElement&&(s.value[f]=d)}async function c(){await pt();const d=n.options.findIndex(h=>h.value===n.modelValue),f=s.value[d];f&&(a.value={width:`${f.offsetWidth}px`,height:`${f.offsetHeight}px`,transform:`translate(${f.offsetLeft}px, ${f.offsetTop}px)`},r.value=!0)}return Be(()=>[n.modelValue,n.options.length],c,{immediate:!0}),wn(()=>{l=new ResizeObserver(()=>c()),o.value&&l.observe(o.value);for(const d of s.value)l.observe(d);c()}),ii(()=>l?.disconnect()),(d,f)=>(k(),N("div",{ref_key:"root",ref:o,class:De(["ui-seg",`ui-seg--${e.size??"md"}`]),role:"tablist"},[S("span",{class:De(["ui-seg__indicator",{"is-ready":r.value}]),style:an(a.value),"aria-hidden":"true"},null,6),(k(!0),N(Ne,null,wt(e.options,(h,m)=>(k(),N("button",{key:h.value,ref_for:!0,ref:g=>u(g,m),class:De(["ui-seg__item",{"is-on":h.value===e.modelValue}]),"data-icon":h.icon,type:"button",role:"tab","aria-selected":h.value===e.modelValue,onClick:g=>i("update:modelValue",h.value)},[h.icon?(k(),fe(Ie,{key:0,class:"ui-seg__icon",name:h.icon,size:"sm"},null,8,["name"])):ne("",!0),h.swatch?(k(),N("span",{key:1,class:"ui-seg__swatch",style:an({backgroundColor:h.swatch})},null,4)):ne("",!0),Pe(" "+z(h.label),1)],10,Rae))),128))],2))}}),Ds=xt(Dae,[["__scopeId","data-v-c5824392"]]);function Oae(e){const{anchor:t,menuHeight:n,viewportWidth:i,viewportHeight:o,gap:s,margin:r}=e,a=o-r-(t.bottom+s),l=t.top-s-r,u=aa,c=u?l:a,d=Math.min(t.width,Math.max(0,i-2*r)),f=Math.min(Math.max(t.left,r),Math.max(r,i-r-d)),h={left:`${Math.round(f)}px`,width:`${Math.round(d)}px`};return cn.options.findIndex(ie=>String(ie.value)===String(n.modelValue??""))),A=O(()=>n.options[w.value]),M=O(()=>A.value?.label??n.placeholder);function L(ie,ee){l.value[ee]=ie instanceof HTMLElement?ie:null}function E(){const ie=a.value,ee=l.value[c.value];!ie||!ee||(ie.scrollTop=ee.offsetTop-(ie.clientHeight-ee.offsetHeight)/2)}function C(){const ie=r.value,ee=a.value;if(!ie||!ee)return;ee.style.maxHeight="";const Ce=ie.getBoundingClientRect();f.value=Oae({anchor:Ce,menuHeight:ee.offsetHeight,viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,gap:y,margin:b}).style}function x(){n.disabled||u.value||(u.value=!0,c.value=w.value>=0?w.value:n.options.findIndex(ie=>!ie.disabled),y=v("--space-1",qE),b=v("--space-2",UE),X(),pt(()=>{C(),pt(E)}))}function _({restoreFocus:ie=!1}={}){u.value&&(u.value=!1,Q(),ie&&pt(()=>r.value?.focus()))}function F(){u.value?_():x()}function I(ie){ie.disabled||(String(ie.value)!==String(n.modelValue??"")&&i("update:modelValue",ie.value),_({restoreFocus:!0}))}function D(ie){if(u.value||x(),n.options.length===0)return;let ee=c.value;for(let Ce=0;CeCe.disabled?-1:Z).filter(Ce=>Ce>=0);c.value=ie.key==="Home"?ee[0]??-1:ee.at(-1)??-1,pt(E)}}function $(ie){m=u.value;const ee=ie.target;s.value?.contains(ee)||a.value?.contains(ee)||_()}function T(){const ie=g;m=!1,g=!1,Q(),ie&&u.value&&r.value?.focus()}function R(){g=!0}function P(ie){const ee=ie.relatedTarget;ee instanceof Node&&(s.value?.contains(ee)||a.value?.contains(ee))||requestAnimationFrame(()=>{if(!u.value||g)return;const Ce=document.activeElement;Ce&&(s.value?.contains(Ce)||a.value?.contains(Ce))||_()})}function j(ie){u.value&&(a.value?.contains(ie.target)||C())}function B(){u.value&&C()}Be(()=>n.options.length,()=>{u.value&&pt(C)});function K(ie){(ie.type==="touchmove"?u.value||m:u.value)&&Pae(ie.target,a.value)&&ie.preventDefault()}function X(){h||(h=!0,document.addEventListener("wheel",K,{capture:!0,passive:!1}),document.addEventListener("touchmove",K,{capture:!0,passive:!1}))}function V(){h&&(h=!1,document.removeEventListener("wheel",K,{capture:!0}),document.removeEventListener("touchmove",K,{capture:!0}))}function Q(){u.value||m||V()}return wn(()=>{document.addEventListener("pointerdown",$,{passive:!0}),document.addEventListener("pointerup",T,{passive:!0}),document.addEventListener("pointercancel",T,{passive:!0}),document.addEventListener("scroll",j,!0),window.addEventListener("resize",B)}),Nn(()=>{m=!1,V(),document.removeEventListener("pointerdown",$),document.removeEventListener("pointerup",T),document.removeEventListener("pointercancel",T),document.removeEventListener("scroll",j,!0),window.removeEventListener("resize",B)}),(ie,ee)=>(k(),N("div",{ref_key:"rootRef",ref:s,class:De(["ui-select",[`ui-select--${e.size}`,{"has-error":e.error,"is-open":u.value,"is-disabled":e.disabled}]])},[S("button",ci({ref_key:"triggerRef",ref:r},p(o),{class:"ui-select__trigger",type:"button",role:"combobox","aria-controls":d,"aria-expanded":u.value,"aria-haspopup":"listbox",disabled:e.disabled,onClick:F,onKeydown:H,onFocusout:P}),[S("span",{class:De(["ui-select__value",{"is-placeholder":!A.value}])},[A.value?.icon?(k(),N("img",{key:0,class:"ui-select__icon",src:A.value.icon,alt:""},null,8,$ae)):ne("",!0),S("span",zae,z(M.value),1)],2),G(Ie,{class:"ui-select__chevron",name:"chevron-down",size:"sm"})],16,Bae),(k(),fe($s,{to:"body"},[u.value?(k(),N("div",{key:0,id:d,ref_key:"listRef",ref:a,class:"ui-select__menu",style:an(f.value),role:"listbox",onPointerdown:R,onFocusout:P},[(k(!0),N(Ne,null,wt(e.options,(Ce,Z)=>(k(),N(Ne,{key:`${Ce.group??""}:${Ce.value}`},[Ce.group&&Ce.group!==e.options[Z-1]?.group?(k(),N("div",jae,z(Ce.group),1)):ne("",!0),S("button",{ref_for:!0,ref:ae=>L(ae,Z),class:De(["ui-select__option",{"is-selected":Z===w.value,"is-active":Z===c.value}]),type:"button",role:"option","aria-selected":Z===w.value,disabled:Ce.disabled,onMouseenter:ae=>c.value=Z,onClick:ae=>I(Ce)},[G(Ie,{class:"ui-select__check",name:"check",size:"sm"}),Ce.icon?(k(),N("img",{key:0,class:"ui-select__icon ui-select__icon--option",src:Ce.icon,alt:""},null,8,Wae)):ne("",!0),S("span",null,z(Ce.label),1)],42,Hae)],64))),128))],36)):ne("",!0)]))],2))}}),WC=xt(qae,[["__scopeId","data-v-e7628e92"]]),Uae=ot({__name:"StatusDot",props:{status:{}},setup(e){const t=e;function n(o){switch(o){case"ok":case"done":case"completed":case"success":return"ok";case"error":case"failed":case"fail":case"danger":return"error";case"running":case"run":case"working":case"in_progress":case"active":return"running";case"suspended":return"suspended";default:return"idle"}}const i=O(()=>n(t.status));return(o,s)=>(k(),N("span",{class:De(["kw-dot",`kw-dot--${i.value}`]),"aria-hidden":"true"},null,2))}}),wl=xt(Uae,[["__scopeId","data-v-ddf97fc4"]]),Vae=["aria-checked","aria-label","disabled"],Kae=ot({__name:"Switch",props:{modelValue:{type:Boolean},disabled:{type:Boolean},label:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t;return(i,o)=>(k(),N("button",{class:De(["ui-switch",{"is-on":e.modelValue}]),type:"button",role:"switch","aria-checked":e.modelValue,"aria-label":e.label,disabled:e.disabled,onClick:o[0]||(o[0]=s=>n("update:modelValue",!e.modelValue))},[...o[1]||(o[1]=[S("span",{class:"ui-switch__thumb"},null,-1)])],10,Vae))}}),Au=xt(Kae,[["__scopeId","data-v-eb53165a"]]),Zae=["value","rows","placeholder","disabled","readonly"],Gae=ot({__name:"Textarea",props:{modelValue:{},rows:{default:3},placeholder:{},disabled:{type:Boolean},readonly:{type:Boolean},error:{type:Boolean},resize:{type:Boolean,default:!0}},emits:["update:modelValue","focus","blur"],setup(e,{expose:t,emit:n}){const i=n;function o(r){i("update:modelValue",r.target.value)}const s=q(null);return t({el:s}),(r,a)=>(k(),N("textarea",{ref_key:"textareaRef",ref:s,class:De(["ui-textarea",{"has-error":e.error,"no-resize":!e.resize}]),value:e.modelValue,rows:e.rows,placeholder:e.placeholder,disabled:e.disabled,readonly:e.readonly,onInput:o,onFocus:a[0]||(a[0]=l=>r.$emit("focus",l)),onBlur:a[1]||(a[1]=l=>r.$emit("blur",l))},null,42,Zae))}}),Qae=xt(Gae,[["__scopeId","data-v-1da4a9a7"]]),Yae={class:"ui-toast__icon","aria-hidden":"true"},Jae={class:"ui-toast__body"},Xae={class:"ui-toast__title"},ele={key:0,class:"ui-toast__msg"},tle=ot({__name:"Toast",props:{variant:{default:"info"},title:{},message:{},dismissLabel:{}},emits:["dismiss"],setup(e){const{t}=bg();return(n,i)=>(k(),N("div",{class:De(["ui-toast",`ui-toast--${e.variant}`])},[S("span",Yae,[Kn(n.$slots,"icon",{},()=>[e.variant==="success"?(k(),fe(Ie,{key:0,name:"check"})):e.variant==="danger"?(k(),fe(Ie,{key:1,name:"close"})):e.variant==="warning"?(k(),fe(Ie,{key:2,name:"alert-triangle"})):(k(),fe(Ie,{key:3,name:"info"}))],!0)]),S("div",Jae,[S("div",Xae,z(e.title),1),e.message?(k(),N("div",ele,z(e.message),1)):ne("",!0),Kn(n.$slots,"default",{},void 0,!0)]),G(rn,{class:"ui-toast__close",size:"sm",label:e.dismissLabel??p(t)("common.dismiss"),tooltip:e.dismissLabel??p(t)("common.dismiss"),onClick:i[0]||(i[0]=o=>n.$emit("dismiss"))},{default:de(()=>[G(Ie,{name:"close",size:"sm"})]),_:1},8,["label","tooltip"])],2))}}),nle=xt(tle,[["__scopeId","data-v-09e5bc42"]]),ile=100;function Ka(){let e=!1,t=0;function n(){e=!0,t=0}function i(){e=!1,t=Date.now()}function o(){e=!1,t=0}function s(r){return e||r.isComposing||r.keyCode===229||Date.now()-t{typeof window<"u"&&(window.removeEventListener("focusin",o,!0),window.removeEventListener("focusout",o,!0))}),{handleCompositionStart:n,handleCompositionEnd:i,resetComposition:o,isComposingKeyEvent:s}}/*! + * pinia v4.0.3 + * (c) 2026 Eduardo San Martin Morote + * @license MIT + */let bH;const Fw=e=>bH=e,wH=Symbol();function VE(e){return e&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"&&typeof e.toJSON!="function"}function ole(){const e=bw(!0),t=e.run(()=>q({}));let n=[],i=[];const o=Tt({install(s){Fw(o),o._a=s,s.provide(wH,o),s.config.globalProperties.$pinia=o,i.forEach(r=>n.push(r)),i=[]},use(s){return this._a?n.push(s):i.push(s),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return o}const qC=()=>{};function KE(e,t,n,i=qC){e.add(t);const o=()=>{e.delete(t)&&i()};return!n&&mg()&&Fd(o),o}function T1(e,...t){e.forEach(n=>{n(...t)})}const sle=e=>e(),ZE=Symbol(),D8=Symbol();function UC(e,t){e instanceof Map&&t instanceof Map?t.forEach((n,i)=>e.set(i,n)):e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(const n in t){if(!Object.hasOwn(t,n))continue;const i=t[n],o=e[n];VE(o)&&VE(i)&&Object.hasOwn(e,n)&&!Xi(i)&&!Du(i)?e[n]=UC(o,i):e[n]=i}return e}const rle=Symbol();function ale(e){return!e||typeof e!="object"||!Object.hasOwn(e,rle)}const{assign:lf}=Object;function lle(e){return!!(Xi(e)&&e.effect)}function ule(e,t,n,i){const{state:o,actions:s,getters:r}=t,a=n.state.value[e];let l;function u(){a||(n.state.value[e]=o?o():{});const c=xee(n.state.value[e]);return lf(c,s,Object.keys(r||{}).reduce((d,f)=>(d[f]=Tt(O(()=>{Fw(n);const h=n._s.get(e);return r[f].call(h,h)})),d),{}))}return l=AH(e,u,t,n,i,!0),l}function AH(e,t,n={},i,o,s){let r;const a=lf({actions:{}},n),l={deep:!0};let u,c,d=new Set,f=new Set,h;const m=i.state.value[e];!s&&!m&&(i.state.value[e]={});let g;function y(E){let C;u=c=!1,typeof E=="function"?(E(i.state.value[e]),C={type:"patch function",storeId:e,events:h}):(UC(i.state.value[e],E),C={type:"patch object",payload:E,storeId:e,events:h});const x=g=Symbol();pt().then(()=>{g===x&&(u=!0)}),c=!0,T1(d,C,i.state.value[e])}const b=s?function(){const{state:C}=n,x=C?C():{};this.$patch(_=>{lf(_,x)})}:qC;function v(){r.stop(),d.clear(),f.clear(),i._s.delete(e)}const w=(E,C="")=>{if(ZE in E)return E[D8]=C,E;const x=function(){Fw(i);const _=Array.from(arguments),F=new Set,I=new Set;function D(T){F.add(T)}function H(T){I.add(T)}T1(f,{args:_,name:x[D8],store:M,after:D,onError:H});let $;try{$=E.apply(this&&this.$id===e?this:M,_)}catch(T){throw T1(I,T),T}return $ instanceof Promise?$.then(T=>(T1(F,T),T)).catch(T=>(T1(I,T),Promise.reject(T))):(T1(F,$),$)};return x[ZE]=!0,x[D8]=C,x},A={_p:i,$id:e,$onAction:KE.bind(null,f),$patch:y,$reset:b,$subscribe(E,C={}){if(d.has(E))return qC;const x=KE(d,E,C.detached,()=>_()),_=r.run(()=>Be(()=>i.state.value[e],F=>{(C.flush==="sync"?c:u)&&E({storeId:e,type:"direct",events:h},F)},lf({},l,C)));return x},$dispose:v},M=bo(A);i._s.set(e,M);const L=(i._a&&i._a.runWithContext||sle)(()=>i._e.run(()=>(r=bw()).run(()=>t({action:w}))));for(const E in L){const C=L[E];Xi(C)&&!lle(C)||Du(C)?s||(m&&ale(C)&&(Xi(C)?C.value=m[E]:((C instanceof Set||C instanceof Map)&&C.clear(),UC(C,m[E]))),i.state.value[e][E]=C):typeof C=="function"&&(L[E]=w(C,E),a.actions[E]=C)}return lf(M,L),lf(vi(M),L),Object.defineProperty(M,"$state",{get:()=>i.state.value[e],set:E=>{y(C=>{lf(C,E)})}}),i._p.forEach(E=>{const C=r.run(()=>E({store:M,app:i._a,pinia:i,options:a}));lf(M,C)}),m&&s&&n.hydrate&&n.hydrate(M.$state,m),u=!0,c=!0,M}/*! #__NO_SIDE_EFFECTS__ */function zs(e,t,n){let i;const o=typeof t=="function";i=o?n:t;function s(r,a){const l=Pee();return r=r||(l?en(wH,null):null),r&&Fw(r),r=bH,r._s.has(e)||(o?AH(e,t,i,r):ule(e,i,r)),r._s.get(e)}return s.$id=e,s}function E1(e){const t=vi(e),n={};for(const i in t){const o=t[i];o?.effect?n[i]=O({get:()=>e[i],set(s){e[i]=s}}):(Xi(o)||Du(o))&&(n[i]=Iee(e,i))}return n}function Rc(e,t){const n=t??{h:"h",m:"m",s:"s"},i=Math.max(0,Math.floor(e/1e3));if(i<60)return i===0?"":`${i}${n.s}`;const o=Math.floor(i/60);if(o<60){const a=i%60;return a===0?`${o}${n.m}`:`${o}${n.m}${a}${n.s}`}const s=Math.floor(o/60),r=o%60;return r===0?`${s}${n.h}`:`${s}${n.h}${r}${n.m}`}const cle={multiedit:"multi_edit",multiedits:"multi_edit",shell:"bash",run:"bash",exec:"bash",ripgrep:"grep",rg:"grep",find:"glob",fetch:"web_fetch",webfetch:"web_fetch",url_fetch:"web_fetch",urlfetch:"web_fetch",list:"ls",listdir:"ls",list_dir:"ls",todowrite:"todo",todo_write:"todo",todoread:"todo",todolist:"todo",todo_list:"todo",agent:"task",subagent:"task",websearch:"search",web_search:"search",create_goal:"creategoal",get_goal:"getgoal",set_goal_budget:"setgoalbudget",update_goal:"updategoal",wait_for:"waitfor"};function Sr(e){const t=(e??"").trim().toLowerCase().replace(/[\s-]+/g,"_");return cle[t]??t}const dle={read:"tools.label.read",bash:"tools.label.bash",edit:"tools.label.edit",multi_edit:"tools.label.edit",write:"tools.label.write",grep:"tools.label.grep",glob:"tools.label.glob",ls:"tools.label.ls",web_fetch:"tools.label.web_fetch",search:"tools.label.search",todo:"tools.label.todo",task:"tools.label.task",agentswarm:"tools.label.swarm",askuserquestion:"tools.label.ask_user",exitplanmode:"tools.label.plan",creategoal:"tools.label.goal_create",getgoal:"tools.label.goal_get",setgoalbudget:"tools.label.goal_budget",updategoal:"tools.label.goal_update",waitfor:"tools.label.waitfor"};function CH(e,t){const n=dle[Sr(t)];return n?e(n):t}const xH=80;function fle(e,t=xH){const n=e.trim();return n.length>t?n.slice(0,t-1)+"…":n}function hle(e,t){const n=e.trim();return!!(n===""||n==="{}"||n==="[]"||n==="null"||t&&Object.keys(t).length===0)}function ple(e){const t=e.trim();if(!t.startsWith("{"))return null;try{const n=JSON.parse(t);return n&&typeof n=="object"&&!Array.isArray(n)?n:null}catch{return null}}function gi(e){return typeof e=="string"&&e.length>0?e:void 0}function uf(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function mle(e){try{const t=new URL(e),n=t.pathname.split("/").filter(Boolean)[0];return n?`${t.host}/${n}`:t.host}catch{return e.replace(/^https?:\/\//,"")}}function O8(e){return gi(e.path)??gi(e.file_path)??gi(e.filePath)??gi(e.filename)}const gle={active:"status.goalStatusActive",blocked:"status.goalStatusBlocked",complete:"status.goalStatusComplete"};function vle(e,t){const n=gi(t);if(!n)return;const i=gle[n];return i?e(i):n}function yle(e,t){const n=uf(t.value),i=gi(t.unit);if(!(n===void 0||!i))switch(i){case"turns":return e("tools.goal.turns",{value:n});case"tokens":return e("tools.goal.tokens",{value:n});case"milliseconds":return e("tools.goal.milliseconds",{value:n});case"seconds":return e("tools.goal.seconds",{value:n});case"minutes":return e("tools.goal.minutes",{value:n});case"hours":return e("tools.goal.hours",{value:n});default:return e("tools.goal.budget",{value:n,unit:i})}}function pS(e,t,n,i=!1){const o=(s,r=xH)=>i?s.trim():fle(s,r);try{const s=ple(n);if(!i&&hle(n,s))return"";const r=()=>o(n.replace(/^·\s*/,""));if(!s)return r();switch(Sr(t)){case"read":{const a=O8(s);if(!a)return r();const l=uf(s.offset)??uf(s.line_start)??uf(s.start_line),u=uf(s.limit)??uf(s.length),c=uf(s.line_end)??uf(s.end_line)??(l!==void 0&&u!==void 0?l+u:void 0);return o(l!==void 0&&c!==void 0?`${a}:${l}-${c}`:l!==void 0?`${a}:${l}`:a)}case"write":{const a=O8(s);return a?o(`${a} ${e("tools.chip.created")}`):r()}case"edit":case"multi_edit":{const a=O8(s);return a?o(a):r()}case"bash":{const a=gi(s.command)??gi(s.cmd)??gi(s.script);return a?a.trim():r()}case"grep":case"search":{const a=gi(s.pattern)??gi(s.query)??gi(s.regex),l=gi(s.path)??gi(s.glob)??gi(s.include);return a&&l?o(e("tools.summary.inScope",{value:a,scope:l})):a?o(a):r()}case"glob":{const a=gi(s.pattern)??gi(s.glob)??gi(s.query),l=gi(s.path)??gi(s.cwd);return a&&l?o(e("tools.summary.inScope",{value:a,scope:l})):a?o(a):gi(s.path)?o(gi(s.path)):r()}case"ls":{const a=gi(s.path)??gi(s.dir)??gi(s.directory)??gi(s.cwd);return a?o(a):r()}case"web_fetch":{const a=gi(s.url)??gi(s.uri);return a?o(mle(a)):r()}case"todo":case"task":{const a=gi(s.description)??gi(s.title)??gi(s.prompt)??gi(s.name)??gi(s.subagent_type);if(a)return o(a);const l=Array.isArray(s.todos)?s.todos:Array.isArray(s.items)?s.items:void 0;return l?o(e("tools.chip.todos",{count:l.length})):r()}case"creategoal":{if(i)return r();const a=gi(s.objective),l=gi(s.completionCriterion);return a&&l?o(e("tools.goal.objectiveWithCriterion",{objective:a,criterion:l})):a?o(a):r()}case"getgoal":return i?r():"";case"setgoalbudget":{if(i)return r();const a=yle(e,s);return a?o(a):r()}case"updategoal":{if(i)return r();const a=vle(e,s.status);return a?o(e("tools.goal.status",{status:a})):r()}default:return r()}}catch{return n}}function kle(e,t){try{switch(Sr(t.name)){case"bash":return t.timing?t.timing:"";case"read":{if(t.output&&t.output.length>0){const n=t.output.length;return e("tools.chip.lines",{count:n})}return""}case"edit":case"multi_edit":case"write":{if(t.output){for(const i of t.output){const o=i.match(/\+(\d+).*[-−](\d+)/);if(o)return`+${o[1]} −${o[2]}`}const n=t.output.find(i=>/\d+/.test(i));if(n){const i=n.match(/\+(\d+)/),o=n.match(/[-−](\d+)/);if(i||o)return`${i?`+${i[1]}`:""} ${o?`−${o[1]}`:""}`.trim()}if(t.status!=="error")return e("tools.chip.edited")}return""}case"grep":case"search":return t.output&&t.output.length>0?e("tools.chip.results",{count:t.output.length}):"";default:return""}}catch{return""}}const SH=new Set(["read","bash","grep","search","glob","ls","web_fetch","edit","write"]);function _H(e){const t=Sr(e);return t==="multi_edit"?"edit":t}function IH(e){const t=[],n=new Map;for(const i of e){if(i.kind==="thinking")continue;const o=_H(i.tool.name);let s=n.get(o);s||(s={count:0,errors:0},n.set(o,s),t.push(o)),s.count++,i.tool.status==="error"&&s.errors++}return{order:t,byKind:n}}function MH(e,t,n){return SH.has(t)?e(`tools.group.typed.${t}.done`,{count:n}):e("tools.group.countOther",{count:n})}function TH(e,t){return{text:e("tools.activity.failedClause",{count:t}),tone:"danger"}}function EH(e){return e.map(t=>t.fragments.map(n=>n.text).join("")).join(" · ")}function ble(e,t,n={}){const{order:i,byKind:o}=IH(t),s=[];let r=!1;for(const a of i){const l=o.get(a);if(!l)continue;const u=[{text:MH(e,a,l.count),tone:"normal"}];l.errors>0&&(r=!0,u.push(TH(e,l.errors))),s.push({fragments:u})}if(n.durationMs!==void 0){const a=Rc(n.durationMs);a&&s.push({fragments:[{text:a,tone:"faint"}]})}return{clauses:s,plain:EH(s),hasError:r}}function wle(e,t){if(t.kind==="thinking")return{fragments:[{text:e("thinking.streaming"),tone:"normal"}]};const n=_H(t.tool.name);let i=pS(e,t.tool.name,t.tool.arg);if(n==="write"&&i){const s=e("tools.chip.created");i.endsWith(s)&&(i=i.slice(0,i.length-s.length).trimEnd())}return{fragments:[{text:i&&SH.has(n)?e(`tools.activity.doing.${n}`,{subject:i}):e("tools.activity.busy"),tone:"normal"}]}}function Ale(e,t,n){const i=t.filter(c=>c!==n&&!(c.kind==="tool"&&c.tool.status==="running")),{order:o,byKind:s}=IH(i),r=e("tools.activity.liveDonePrefix"),a=[];for(const c of o){const d=s.get(c);if(!d)continue;const f=[{text:`${r}${MH(e,c,d.count)}`,tone:"faint"}];d.errors>0&&f.push(TH(e,d.errors)),a.push({fragments:f})}const l=n===null?null:wle(e,n),u=l?[l,...a]:a;return{current:l,done:a,plain:EH(u)}}async function ss(e){const t=typeof navigator<"u"?navigator.clipboard:void 0;if(t&&typeof t.writeText=="function")try{return await t.writeText(e),!0}catch{}return Cle(e)}function Cle(e){if(typeof document>"u"||typeof document.execCommand!="function")return!1;const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="fixed",t.style.top="-9999px",t.style.left="-9999px",t.style.opacity="0",document.body.appendChild(t);let n=!1;try{t.focus(),t.select(),n=document.execCommand("copy")}catch{n=!1}finally{document.body.removeChild(t)}return n}const xle={ts:"ts",tsx:"tsx",js:"js",jsx:"jsx",mjs:"js",cjs:"js",vue:"vue",svelte:"svelte",py:"py",rb:"rb",go:"go",rs:"rs",java:"java",kt:"kt",kts:"kts",scala:"scala",swift:"swift",c:"c",h:"c",cpp:"cpp",cc:"cpp",cxx:"cpp",hpp:"cpp",cs:"cs",php:"php",sh:"sh",bash:"bash",zsh:"zsh",fish:"fish",ps1:"ps1",bat:"bat",cmd:"bat",sql:"sql",graphql:"graphql",prisma:"prisma",html:"html",htm:"html",xml:"xml",svg:"xml",css:"css",scss:"scss",sass:"sass",less:"less",json:"json",jsonc:"jsonc",json5:"json5",yaml:"yaml",yml:"yml",toml:"toml",ini:"ini",md:"md",markdown:"markdown",mdx:"mdx",lua:"lua",r:"r",dart:"dart",zig:"zig",mk:"makefile",cmake:"cmake",diff:"diff",proto:"proto"},Sle={dockerfile:"dockerfile",makefile:"makefile","cmakelists.txt":"cmake"};function _le(e){const t=e?.split(/[\\/]/).pop()?.toLowerCase()??"";if(!t)return;const n=Sle[t];if(n)return n;const i=t.lastIndexOf(".");if(!(i<=0))return xle[t.slice(i+1)]}class mc extends Error{code;requestId;details;timestamp;durationMs;constructor(t){super(t.msg),this.name="DaemonApiError",this.code=t.code,this.requestId=t.requestId,this.details=t.details,this.timestamp=t.timestamp,this.durationMs=t.durationMs}}class rl extends Error{cause;method;path;url;requestId;phase;timeoutMs;status;statusText;contentType;bodyPreview;timestamp;durationMs;constructor(t){super(t.message),this.name="DaemonNetworkError",this.cause=t.cause,this.method=t.method,this.path=t.path,this.url=t.url,this.requestId=t.requestId,this.phase=t.phase,this.timeoutMs=t.timeoutMs,this.status=t.status,this.statusText=t.statusText,this.contentType=t.contentType,this.bodyPreview=t.bodyPreview,this.timestamp=t.timestamp,this.durationMs=t.durationMs}}class Db extends Error{size;limit;constructor(t){super(`file too large to preview: ${t.size} bytes (limit ${t.limit})`),this.name="FileTooLargeError",this.size=t.size,this.limit=t.limit}}function ai(e){return e instanceof mc||typeof e=="object"&&e!==null&&e.name==="DaemonApiError"&&typeof e.code=="number"}function Q2(e){return e instanceof rl||typeof e=="object"&&e!==null&&e.name==="DaemonNetworkError"&&typeof e.method=="string"&&typeof e.path=="string"}function LH(e){return Q2(e)&&typeof e.cause=="object"&&e.cause!==null&&e.cause.name==="TimeoutError"}function Ile(e){return e instanceof Db||typeof e=="object"&&e!==null&&e.name==="FileTooLargeError"&&typeof e.limit=="number"}const Mle=41301,Tle=40922;function GE(e){return ai(e)&&e.code===Tle}function Ele(e){const t=(e instanceof Error?e.message:String(e)).slice(0,140);return LH(e)?{kind:"timeout",message:t}:Q2(e)?{kind:"network",message:t}:ai(e)?{kind:"api",message:t}:{kind:"unknown",message:t}}const Lle="kimi_desktop",Nle="platform",QE="kimi-desktop",YE="kimi-desktop-platform";function Fle(){let e=!1,t=null;try{const n=new URLSearchParams(window.location.search);n.has(Lle)?(sessionStorage.setItem(QE,"1"),e=!0):e=e||sessionStorage.getItem(QE)==="1";const i=n.get(Nle);i?(sessionStorage.setItem(YE,i),t=i):t=sessionStorage.getItem(YE)}catch{}return{isDesktop:e,platform:t}}const VC=Fle(),s1=VC.isDesktop,Nf=VC.isDesktop&&VC.platform==="darwin",Rle=["faces","nature","food","activity","objects","symbols"],Dle=[["😀","faces","grinning smile happy 笑 开心"],["😄","faces","smile happy joy 笑 开心 高兴"],["😁","faces","grin beaming 咧嘴笑 开心"],["😂","faces","joy laugh tears 笑哭 爆笑"],["🤣","faces","rofl laugh rolling 笑翻 爆笑"],["😊","faces","blush shy happy 微笑 害羞"],["😉","faces","wink 眨眼"],["😍","faces","heart eyes love 爱心眼 喜欢 爱"],["🥰","faces","smiling hearts love 爱心 喜欢"],["😘","faces","kiss 飞吻 亲亲"],["😋","faces","yum tongue 好吃 馋"],["🤪","faces","zany crazy 鬼脸 疯"],["🤔","faces","thinking hmm consider 思考 想"],["🤨","faces","skeptical eyebrow 怀疑 挑眉"],["😐","faces","neutral meh 面无表情 无语"],["😑","faces","expressionless 面无表情 无语"],["🙄","faces","eye roll 翻白眼 无语"],["😶","faces","no mouth silent 无言 沉默"],["🫡","faces","salute 敬礼 收到"],["🤫","faces","shush quiet 嘘 安静"],["🤭","faces","oops giggle 捂嘴 偷笑"],["😴","faces","sleeping sleepy 睡觉 困"],["😪","faces","sleepy tired 困 疲惫"],["😷","faces","mask sick 口罩 生病"],["🤒","faces","sick fever 生病 发烧"],["🤕","faces","hurt bandage 受伤"],["🤢","faces","nauseated 恶心"],["🤯","faces","mind blown explode 震惊 爆炸"],["🥳","faces","party celebrate 庆祝 派对"],["🤩","faces","star struck 星星眼 激动"],["😎","faces","cool sunglasses 酷 墨镜"],["🥸","faces","disguise 伪装 假扮"],["🤓","faces","nerd geek 书呆子 学霸"],["😢","faces","cry sad 哭 难过"],["😭","faces","sob cry loudly 大哭 痛哭"],["😤","faces","triumph huff 哼 生气"],["😡","faces","angry rage mad 生气 愤怒"],["🤬","faces","swearing cursing 骂人 爆粗"],["😱","faces","scream fear 尖叫 害怕"],["😨","faces","fearful 害怕 恐惧"],["🥵","faces","hot heat 热 出汗"],["🥶","faces","cold freezing 冷 冻"],["🥴","faces","woozy drunk 晕 醉"],["😇","faces","angel innocent 天使 无辜"],["🙃","faces","upside down silly 倒脸 哭笑不得"],["💀","faces","skull dead 骷髅 笑死"],["👻","faces","ghost 鬼 幽灵"],["👍","faces","thumbs up like good 赞 好"],["👎","faces","thumbs down dislike 踩 差"],["👏","faces","clap applause 鼓掌 厉害"],["🙌","faces","raise hands celebrate 举手 庆祝"],["🙏","faces","pray thanks please 拜托 感谢 祈祷"],["💪","faces","muscle strong flex 加油 强壮 肌肉"],["👀","faces","eyes look watch 看 围观 眼睛"],["🤝","faces","handshake deal 握手 合作"],["✌️","faces","victory peace 胜利 耶"],["👋","faces","wave hello bye 挥手 你好 再见"],["🤞","faces","crossed fingers luck 祈祷 好运"],["👌","faces","ok okay 好的 可以"],["🫶","faces","heart hands love 比心 爱心"],["✍️","faces","writing hand 写字 记录"],["🧠","faces","brain smart 大脑 聪明"],["🦾","faces","mechanical arm 机械臂 力量"],["👤","faces","person user profile 个人 用户"],["👥","faces","people team group 团队 多人"],["🐶","nature","dog puppy 狗 小狗"],["🐱","nature","cat kitten 猫 小猫"],["🐭","nature","mouse rat 老鼠"],["🐹","nature","hamster 仓鼠"],["🐰","nature","rabbit bunny 兔子"],["🦊","nature","fox 狐狸"],["🐻","nature","bear 熊"],["🐼","nature","panda 熊猫"],["🐨","nature","koala 考拉"],["🐯","nature","tiger 老虎"],["🦁","nature","lion 狮子"],["🐮","nature","cow 牛"],["🐷","nature","pig 猪"],["🐸","nature","frog 青蛙"],["🐵","nature","monkey 猴子"],["🐔","nature","chicken 鸡"],["🐧","nature","penguin 企鹅"],["🐦","nature","bird 鸟"],["🐣","nature","chick hatching 小鸡 孵化"],["🦆","nature","duck 鸭子"],["🦉","nature","owl 猫头鹰"],["🐝","nature","bee 蜜蜂"],["🐛","nature","bug caterpillar 虫子 毛虫"],["🦋","nature","butterfly 蝴蝶"],["🐌","nature","snail slow 蜗牛 慢"],["🐢","nature","turtle slow 乌龟 慢"],["🐍","nature","snake 蛇"],["🐙","nature","octopus 章鱼"],["🦑","nature","squid 鱿鱼"],["🦐","nature","shrimp 虾"],["🦀","nature","crab 螃蟹"],["🐠","nature","tropical fish 鱼 热带鱼"],["🐳","nature","whale 鲸鱼"],["🦈","nature","shark 鲨鱼"],["🐊","nature","crocodile 鳄鱼"],["🦄","nature","unicorn 独角兽"],["🐴","nature","horse 马"],["🐑","nature","sheep 羊 绵羊"],["🐐","nature","goat 山羊"],["🦜","nature","parrot 鹦鹉"],["🌸","nature","blossom flower sakura 樱花 花"],["🌹","nature","rose flower 玫瑰 花"],["🌻","nature","sunflower 向日葵"],["🌷","nature","tulip 郁金香"],["🌱","nature","seedling sprout 发芽 幼苗"],["🌲","nature","tree evergreen 树 松树"],["🌳","nature","deciduous tree 树 大树"],["🌵","nature","cactus 仙人掌"],["🍀","nature","clover luck 四叶草 幸运"],["🍁","nature","maple leaf autumn 枫叶 秋天"],["🍄","nature","mushroom 蘑菇"],["🌈","nature","rainbow 彩虹"],["☀️","nature","sun sunny 太阳 晴"],["🌙","nature","moon crescent 月亮"],["⭐","nature","star 星星"],["🌟","nature","glowing star 星星 闪亮"],["☁️","nature","cloud 云"],["⛅","nature","partly cloudy 多云"],["🌧️","nature","rain rainy 下雨"],["❄️","nature","snowflake snow 雪 雪花"],["⛄","nature","snowman 雪人"],["⚡","nature","lightning bolt 闪电"],["🔥","nature","fire hot 火 燃"],["🌊","nature","wave ocean sea 海浪"],["🏔️","nature","mountain snow 雪山 山"],["☕","food","coffee 咖啡"],["🍵","food","tea 茶"],["🧋","food","bubble tea boba 奶茶"],["🥛","food","milk 牛奶"],["🍺","food","beer 啤酒"],["🍷","food","wine 红酒"],["🥂","food","champagne cheers 香槟 干杯"],["🥤","food","cup straw soda 饮料 可乐"],["🧃","food","juice box 果汁"],["🍎","food","apple 苹果"],["🍊","food","orange tangerine 橙子 橘子"],["🍋","food","lemon 柠檬"],["🍉","food","watermelon 西瓜"],["🍓","food","strawberry 草莓"],["🍑","food","peach 桃子"],["🥭","food","mango 芒果"],["🍍","food","pineapple 菠萝"],["🥝","food","kiwi 猕猴桃"],["🍇","food","grapes 葡萄"],["🍒","food","cherries 樱桃"],["🥑","food","avocado 牛油果"],["🥦","food","broccoli 西兰花"],["🌽","food","corn 玉米"],["🌶️","food","hot pepper spicy 辣椒 辣"],["🍔","food","burger hamburger 汉堡"],["🍟","food","fries 薯条"],["🍕","food","pizza 披萨"],["🌭","food","hot dog 热狗"],["🥪","food","sandwich 三明治"],["🌮","food","taco 墨西哥卷"],["🍜","food","ramen noodles 拉面 面条"],["🍝","food","spaghetti pasta 意面"],["🍣","food","sushi 寿司"],["🍱","food","bento 便当"],["🥟","food","dumpling 饺子"],["🍚","food","rice 米饭"],["🍞","food","bread 面包"],["🥐","food","croissant 可颂 牛角包"],["🧀","food","cheese 奶酪 芝士"],["🍳","food","cooking egg 煎蛋 做饭"],["🍦","food","ice cream 冰淇淋"],["🍰","food","cake 蛋糕"],["🎂","food","birthday cake 生日蛋糕"],["🍫","food","chocolate 巧克力"],["🍩","food","donut doughnut 甜甜圈"],["🍪","food","cookie 饼干"],["🍭","food","lollipop 棒棒糖"],["⚽","activity","soccer football 足球"],["🏀","activity","basketball 篮球"],["🏈","activity","american football 橄榄球"],["⚾","activity","baseball 棒球"],["🎾","activity","tennis 网球"],["🏐","activity","volleyball 排球"],["🏓","activity","ping pong 乒乓球"],["🏸","activity","badminton 羽毛球"],["🥊","activity","boxing 拳击"],["⛳","activity","golf 高尔夫"],["🎣","activity","fishing 钓鱼"],["🏊","activity","swim 游泳"],["🏄","activity","surf 冲浪"],["🚴","activity","cycling 骑行"],["🏋️","activity","weightlifting gym 举重 健身"],["🧘","activity","yoga meditation 瑜伽 冥想"],["🎮","activity","video game controller 游戏 游戏机"],["🎲","activity","dice 骰子"],["🎯","activity","target bullseye 目标 靶心"],["🎳","activity","bowling 保龄球"],["🎰","activity","slot machine 老虎机"],["♟️","activity","chess 国际象棋 棋"],["🎸","activity","guitar 吉他"],["🎹","activity","piano keyboard 钢琴"],["🥁","activity","drum 鼓"],["🎤","activity","microphone sing 麦克风 唱歌"],["🎧","activity","headphones 耳机"],["🎬","activity","clapper movie 电影 拍摄"],["🎨","activity","art palette paint 画画 艺术"],["🎭","activity","theater masks 戏剧 面具"],["🎪","activity","circus 马戏团"],["🎡","activity","ferris wheel 摩天轮"],["✈️","activity","airplane travel flight 飞机 旅行"],["🚗","activity","car drive 汽车 车"],["🚕","activity","taxi 出租车"],["🚌","activity","bus 公交车"],["🚑","activity","ambulance 救护车"],["🚒","activity","fire engine 消防车"],["🚀","activity","rocket launch ship 火箭 发射"],["🛸","activity","ufo flying saucer 飞碟"],["🚲","activity","bicycle bike 自行车"],["🛴","activity","scooter 滑板车"],["🚄","activity","bullet train 高铁 动车"],["🚢","activity","ship 船 轮船"],["⛵","activity","sailboat 帆船"],["🏠","activity","house home 房子 家"],["🏢","activity","office building 公司 办公楼"],["🏥","activity","hospital 医院"],["🏫","activity","school 学校"],["🏖️","activity","beach vacation 海滩 度假"],["⛺","activity","camping tent 露营 帐篷"],["🌋","activity","volcano 火山"],["🗺️","activity","map world 地图"],["🧭","activity","compass 指南针"],["💻","objects","laptop computer 电脑 笔记本"],["🖥️","objects","desktop computer 台式机 电脑"],["⌨️","objects","keyboard 键盘"],["🖱️","objects","computer mouse 鼠标"],["📱","objects","phone mobile 手机"],["🔋","objects","battery 电池"],["🔌","objects","plug electric 插头"],["💾","objects","floppy save 软盘 保存"],["📀","objects","cd disc 光盘"],["🎥","objects","movie camera 摄像机"],["📷","objects","camera 相机"],["🔭","objects","telescope 望远镜"],["📡","objects","satellite antenna 卫星 天线"],["🌐","objects","globe web internet 网络 全球 互联网"],["🕯️","objects","candle 蜡烛"],["💡","objects","bulb idea light 灯泡 点子"],["🔦","objects","flashlight 手电筒"],["📁","objects","folder 文件夹"],["📂","objects","open folder 文件夹 打开"],["🗂️","objects","card index archive 归档 索引"],["📅","objects","calendar date 日历 日期"],["📌","objects","pin pushpin 图钉 置顶"],["📍","objects","round pin location 定位 位置"],["📎","objects","paperclip attachment 回形针 附件"],["✂️","objects","scissors cut 剪刀 剪切"],["📏","objects","ruler 尺子"],["📝","objects","memo note write 备忘 记录"],["✏️","objects","pencil edit write 铅笔 编辑"],["📄","objects","document page 文档 文件"],["📃","objects","page curl 文档 文件"],["📑","objects","bookmark tabs 标签页 文档"],["📚","objects","books 书 书籍"],["📖","objects","open book 打开的书 阅读"],["🔖","objects","bookmark 书签"],["🏷️","objects","label tag 标签"],["📊","objects","bar chart stats 图表 统计"],["📈","objects","chart up growth 上涨 增长"],["📉","objects","chart down 下跌 下降"],["🔍","objects","search magnifier 搜索 查找"],["🔎","objects","search magnifier right 搜索 查找"],["🔒","objects","lock locked 锁 锁定"],["🔓","objects","unlock open 解锁"],["🔑","objects","key 钥匙 密钥"],["🔧","objects","wrench tool 扳手 工具"],["🔨","objects","hammer 锤子"],["🛠️","objects","tools hammer wrench 工具 修理"],["🧰","objects","toolbox 工具箱 工具"],["🪛","objects","screwdriver 螺丝刀 工具"],["🔩","objects","nut and bolt screw 螺母 螺栓"],["🏗️","objects","building construction crane 施工 建造"],["⚙️","objects","gear settings 齿轮 设置"],["🧲","objects","magnet 磁铁"],["⚗️","objects","alembic 蒸馏器 实验"],["🧪","objects","test tube experiment 实验 试管"],["🔬","objects","microscope science 显微镜 科学"],["🤖","objects","robot bot 机器人"],["👾","objects","alien monster game 外星人 游戏"],["💣","objects","bomb 炸弹"],["🧨","objects","firecracker 爆竹"],["🗑️","objects","trash delete 垃圾桶 删除"],["🧹","objects","broom clean 扫帚 清理"],["🧻","objects","toilet paper 纸巾"],["🧽","objects","sponge 海绵"],["📦","objects","package box 包裹 箱子"],["✉️","objects","envelope mail 邮件 信封"],["📮","objects","mailbox postbox 邮箱"],["📧","objects","email mail 邮件"],["📥","objects","inbox tray receive 收件箱 接收"],["📤","objects","outbox tray send 发件箱 发送"],["📞","objects","telephone receiver call phone 电话 通话"],["💬","objects","speech balloon chat message bubble 聊天 对话 气泡 消息"],["💭","objects","thought balloon thinking 思考 想法 气泡"],["📣","objects","megaphone announcement 喇叭 公告"],["📢","objects","loudspeaker broadcast 广播 喇叭 通知"],["🚨","objects","police light alert emergency 警报 告警 紧急"],["🗳️","objects","ballot box vote 投票箱 投票"],["🔗","objects","link chain 链接 连接"],["🧩","objects","puzzle piece plugin 拼图 插件"],["🪄","objects","magic wand 魔法 魔杖"],["🛡️","objects","shield security 盾牌 安全"],["⚔️","objects","crossed swords 交叉剑 战斗"],["💳","objects","credit card 信用卡"],["💰","objects","money bag 钱袋 钱"],["🧾","objects","receipt 收据 小票"],["📿","objects","prayer beads 念珠"],["💍","objects","ring 戒指"],["👑","objects","crown 皇冠"],["🎩","objects","top hat 礼帽"],["🎒","objects","backpack 背包 书包"],["👓","objects","glasses 眼镜"],["🌂","objects","umbrella 雨伞"],["🕰️","objects","mantel clock 座钟"],["⌚","objects","watch 手表"],["⏱️","objects","stopwatch 秒表"],["🧯","objects","fire extinguisher 灭火器"],["🩹","objects","bandage patch fix 创可贴 补丁 修复"],["🎓","objects","graduation cap study learn 毕业 学习"],["🎫","objects","ticket 票 门票 工单"],["✅","symbols","check done complete 完成 对勾"],["✔️","symbols","checkmark correct 对勾 正确"],["❌","symbols","cross x wrong 错误 叉"],["❓","symbols","question help 问题 问号"],["❔","symbols","white question 问题 问号"],["❗","symbols","exclamation important 感叹号 重要"],["❕","symbols","white exclamation 感叹号"],["⚠️","symbols","warning caution 警告 注意"],["🚧","symbols","construction wip 施工 进行中"],["🚫","symbols","prohibited no 禁止"],["💥","symbols","boom explosion 爆炸"],["✨","symbols","sparkles shiny 闪亮 星星"],["🎉","symbols","tada party celebrate 庆祝 撒花"],["🎊","symbols","confetti party 庆祝 彩带"],["🏆","symbols","trophy champion 奖杯 冠军"],["🥇","symbols","gold medal first 金牌 第一"],["🥈","symbols","silver medal second 银牌 第二"],["🥉","symbols","bronze medal third 铜牌 第三"],["🎖️","symbols","military medal 勋章"],["🚩","symbols","red flag mark 红旗 标记"],["🏁","symbols","checkered flag finish 终点 完成"],["⏳","symbols","hourglass time waiting 沙漏 时间"],["⌛","symbols","hourglass done 沙漏 时间"],["🕐","symbols","clock one time 时钟 一点"],["⏰","symbols","alarm clock 闹钟"],["🔔","symbols","bell notification 铃铛 通知"],["🔕","symbols","bell slash mute 静音 免打扰"],["🕹️","symbols","joystick game 摇杆 游戏"],["🔴","symbols","red circle record 红圆 录制"],["🟢","symbols","green circle online 绿圆 在线"],["🟡","symbols","yellow circle 黄圆"],["🟠","symbols","orange circle 橙圆"],["🔵","symbols","blue circle 蓝圆"],["🟣","symbols","purple circle 紫圆"],["⚫","symbols","black circle 黑圆"],["⚪","symbols","white circle 白圆"],["🟥","symbols","red square 红方"],["🟩","symbols","green square 绿方"],["🟦","symbols","blue square 蓝方"],["🔺","symbols","red triangle up 三角 上"],["🔻","symbols","triangle down 三角 下"],["🔸","symbols","diamond orange 菱形"],["🔹","symbols","diamond blue 菱形"],["💠","symbols","diamond dot 菱形 花"],["🔶","symbols","diamond orange big 菱形"],["🔷","symbols","diamond blue big 菱形"],["▶️","symbols","play 播放"],["⏸️","symbols","pause 暂停"],["⏹️","symbols","stop 停止"],["⏺️","symbols","record 录制"],["⏩","symbols","fast forward 快进"],["⏪","symbols","rewind 快退"],["🔀","symbols","shuffle 随机 打乱"],["🔁","symbols","repeat 重复 循环"],["🔂","symbols","repeat one 单曲循环"],["🔄","symbols","refresh sync 刷新 同步"],["🔃","symbols","reload 重载"],["➕","symbols","plus add 加 新增"],["➖","symbols","minus 减"],["➗","symbols","divide 除"],["✖️","symbols","multiply 乘"],["💲","symbols","dollar money 美元 钱"],["™️","symbols","trademark 商标"],["©️","symbols","copyright 版权"],["®️","symbols","registered 注册商标"],["↔️","symbols","left right arrow 左右箭头"],["⬆️","symbols","up arrow 上箭头"],["⬇️","symbols","down arrow 下箭头"],["➡️","symbols","right arrow 右箭头"],["⬅️","symbols","left arrow 左箭头"],["🔙","symbols","back 返回"],["🔜","symbols","soon 很快"],["🔝","symbols","top 置顶 顶部"],["💤","symbols","zzz sleep 睡觉"],["🆕","symbols","new 新 新品"],["🆒","symbols","cool 酷"],["🆓","symbols","free 免费"],["🆗","symbols","ok 可以"],["🆙","symbols","up 提升"],["🆚","symbols","vs versus 对比"],["♾️","symbols","infinity 无限"],["💯","symbols","hundred perfect 满分 一百"],["💢","symbols","anger 生气"],["♨️","symbols","hot springs 温泉"],["🚸","symbols","children crossing 注意儿童"],["🔞","symbols","no one under eighteen 十八禁"],["📵","symbols","no mobile phones 禁止手机"],["❤️","symbols","red heart love 红心 爱"],["🧡","symbols","orange heart 橙心"],["💛","symbols","yellow heart 黄心"],["💚","symbols","green heart 绿心"],["💙","symbols","blue heart 蓝心"],["💜","symbols","purple heart 紫心"],["🖤","symbols","black heart 黑心"],["🤍","symbols","white heart 白心"],["🤎","symbols","brown heart 棕心"],["💔","symbols","broken heart 心碎"],["💕","symbols","two hearts 双心 爱心"],["💖","symbols","sparkling heart 闪亮的心"],["💗","symbols","growing heart 心动"]],NH=Dle.map(([e,t,n])=>({emoji:e,group:t,keywords:n}));function Ole(e,t=24){const n=e.trim().toLowerCase();if(!n)return[];const i=[];for(const o of NH)if((o.keywords.includes(n)||o.emoji===n)&&(i.push(o.emoji),i.length>=t))break;return i}const Ple=8;function Ble(e,t,n=Ple){return[t,...e.filter(i=>i!==t)].slice(0,n)}function FH(e,t){try{const n=new Date(e);if(Number.isNaN(n.getTime()))return e;const i=new Date,o=c=>String(c).padStart(2,"0"),s=`${o(n.getHours())}:${o(n.getMinutes())}`,r=n.getFullYear()===i.getFullYear(),a=n.getMonth()===i.getMonth(),l=n.getDate()===i.getDate();if(r&&a&&l)return s;const u=new Date(i);return u.setDate(i.getDate()-1),n.getFullYear()===u.getFullYear()&&n.getMonth()===u.getMonth()&&n.getDate()===u.getDate()?`${t} ${s}`:r?`${o(n.getMonth()+1)}-${o(n.getDate())} ${s}`:`${n.getFullYear()}-${o(n.getMonth()+1)}-${o(n.getDate())} ${s}`}catch{return e}}function Md(e){if(e>=1024*1024)return`${JE(e/(1024*1024))}M`;if(e>=1024){const t=e/1024;return`${t>=100?Math.round(t):JE(t)}k`}return String(e)}function JE(e){const t=e.toFixed(1);return t.endsWith(".0")?t.slice(0,-2):t}function $le(){return window.kimiDesktop}function RH(e,t,n){const i=n.length===0?void 0:n.length===1?n[0]:n;try{$le()?.log?.(e,t,i)}catch{}}function Al(e,...t){console.warn(e,...t),RH("warn",e,t)}function gc(e,...t){console.error(e,...t),RH("error",e,t)}function wd(e){const t=e.split("/").filter(Boolean);return t.length>0?t[t.length-1]:e}const zle=/^(?:[A-Za-z]:[\\/]|\\\\|\/\/)/;function al(e){const t=e.replaceAll("\\","/"),n=zle.test(t),i=t.replace(/\/+$/,"");return n?i.toLowerCase():i}function jle(e){const{workspaces:t,sessions:n,hiddenWorkspaceRoots:i,sessionsHasMoreByWorkspace:o}=e,s=new Set(i.map(al)),r=new Map;for(const f of t){const h=al(f.root);s.has(h)||r.has(h)||r.set(h,{...f})}for(const f of n){const h=f.cwd;if(!h)continue;const m=al(h);s.has(m)||r.has(m)||r.set(m,{id:f.workspaceId??h,root:h,name:wd(h),sessionCount:0})}const a=new Map;for(const f of t){const h=al(f.root);a.has(h)||a.set(h,f.id)}const l=new Map;for(const f of n){const h=a.get(al(f.cwd))??f.workspaceId??f.cwd;l.set(h,(l.get(h)??0)+1)}const u=[];for(const f of t){const h=al(f.root);!s.has(h)&&!u.includes(h)&&u.push(h)}const c=[...r.keys()].filter(f=>!u.includes(f));c.sort((f,h)=>r.get(f).root.localeCompare(r.get(h).root));const d=[];for(const f of[...u,...c]){const h=r.get(f),m=l.get(h.id)??l.get(h.root)??0,g=o[h.id]===!1?m:Math.max(h.sessionCount,m);d.push({...h,sessionCount:g})}return d}const Hle=new Set(["image/png","image/jpeg","image/gif","image/webp"]);function mS(e){const t=e.split(";",1)[0].trim().toLowerCase();return Hle.has(t==="image/jpg"?"image/jpeg":t)}function Wle(e,t){if(e===void 0||e.length===0)return;const n=t?.find(i=>i.id===e)??t?.find(i=>i.model===e);return n?.displayName||n?.model||(e.includes("/")?e.split("/").pop():e)}function qle(e){if(!(e===void 0||e.length===0||e==="off"||e==="on"))return e}function wg(e){if(e===void 0)return"toggle";const t=e.capabilities??[];return t.includes("always_thinking")?"always-on":t.includes("thinking")||e.adaptiveThinking===!0?"toggle":"unsupported"}function DH(e){return e?.supportEfforts??[]}function Ule(e){return e[Math.floor(e.length/2)]}function Mp(e){if(wg(e)==="unsupported")return"off";const t=DH(e);return t.length>0?e?.defaultEffort??Ule(t):"on"}function Ag(e){const t=DH(e),n=wg(e);return t.length>0?n==="always-on"?[...t]:["off",...t]:n==="always-on"?["on"]:n==="unsupported"?["off"]:["on","off"]}function Uf(e){return e.length===0?e:e.charAt(0).toUpperCase()+e.slice(1)}function Vle(e){return e!=="off"}function Ob(e,t){return Ag(e).includes(t)}function Rw(e,t){return t==="off"?"off":t==="on"?Mp(e):t}function gS(e,t){return t??Mp(e)}function Kle(e){return e==="off"?{enabled:!1}:e==="on"?{enabled:!0}:{enabled:!0,effort:e}}function vS(e,t){if(!e||typeof e!="object")return;const{enabled:n,effort:i}=e;if(n===!1)return Ob(t,"off")?"off":void 0;if(typeof i=="string"&&Ob(t,i))return i}function XE(e,t,n,i){return!n||e===void 0?t:vS(i,e)??Mp(e)}let Zle=0;function vk(e,t){const n=++Zle;return e.pendingThinkingBySession[t]=n,n}function Gl(e,t,n){return n===void 0||e.pendingThinkingBySession[t]!==n?!1:(delete e.pendingThinkingBySession[t],!0)}function yS(e,t,n){e.pendingThinkingBySession[t]===void 0&&(e.thinkingBySession[t]=n)}function OH(){if(!(typeof window>"u"))return window.kimiDesktop}function r9(){return typeof OH()?.getPathForFile=="function"}function Dw(e){const t=OH()?.getPathForFile;if(typeof t!="function")return null;try{return t(e)}catch{return null}}function P8(e){return Dw(e)}function B8(e){return Array.from(e.dataTransfer?.items??[]).some(t=>t.kind==="file"&&t.type==="")}function KC(e,t=Dw){const n=Array.from(e.dataTransfer?.items??[]);if(n.length===0){const a=Array.from(e.dataTransfer?.files??[]);return{files:a,folderPaths:[],items:a.map(l=>({kind:"file",file:l}))}}const i=[],o=[],s=[],r=new Set;for(const a of n){if(a.kind!=="file")continue;const l=a.getAsFile();if(l)if(a.webkitGetAsEntry()?.isDirectory===!0){const u=t(l);if(!u||r.has(u))continue;r.add(u),o.push(u),s.push({kind:"folder",path:u})}else i.push(l),s.push({kind:"file",file:l})}return{files:i,folderPaths:o,items:s}}function Gle(e,t=Dw){return KC(e,t).folderPaths}function Qle(e,t=Dw){const n=c=>`${c.size}:${c.type}:${c.name}`,i=[],o=new Set,s=new Set,r=[],a=new Set,l=[];let u=!1;for(const c of Array.from(e.items??[])){if(c.kind!=="file")continue;const d=c.getAsFile();if(c.webkitGetAsEntry?.()?.isDirectory===!0){u=!0,d&&s.add(n(d));const h=d?t(d):null;if(!h||a.has(h))continue;a.add(h),r.push(h),l.push({kind:"folder",path:h});continue}if(!d)continue;const f=n(d);o.has(f)||(o.add(f),i.push(d),l.push({kind:"file",file:d}))}for(const c of Array.from(e.files??[])){const d=n(c);s.has(d)||o.has(d)||(o.add(d),i.push(c),l.push({kind:"file",file:c}))}return{files:i,folderPaths:r,hasFolders:u,items:l}}function PH(e,t,n){return e==="unsupported"?[{titleKey:n.titleKey,hintKey:n.hintKey,disabled:!1}]:t.map(i=>({...i,disabled:e==="pending"}))}function Yle(e,t,n){return n?e.filter(i=>i.sessions.length>0||i.workspace.id===t):e}const Jle=/([\s\S]*?)<\/summary>/,Xle=/([\s\S]*?)<\/resume_hint>/,$8=/]*)>|<\/subagent>/g,eue="",eL=/(completed|failed|aborted):\s*(\d+)/g,tL=/([a-z_]+)="([^"]*)"/g;function tue(e){return e.replaceAll(""",'"').replaceAll("<","<").replaceAll(">",">").replaceAll("&","&")}function nue(e){const t={};tL.lastIndex=0;let n;for(;(n=tL.exec(e))!==null;)t[n[1]]=tue(n[2]);return t}function iue(e){const t={completed:0,failed:0,aborted:0};eL.lastIndex=0;let n;for(;(n=eL.exec(e))!==null;){const i=n[1];t[i]=Number(n[2])}return t}function oue(e,t){const n=nue(e);return{outcome:n.outcome??"completed",item:n.item,agentId:n.agent_id,mode:n.mode,state:n.state,body:t.trim()}}function sue(e){const t=[],n=[];$8.lastIndex=0;let i;for(;(i=$8.exec(e))!==null;)if(i[0]===eue){if(n.length===0)continue;const o=n.pop();o&&n.length===0&&t.push(oue(o.attrs,e.slice(o.bodyStart,i.index)))}else n.length===0?n.push({attrs:i[1]??"",bodyStart:$8.lastIndex}):n.push(null);return t}function rue(e){if(e==null)return null;const t=Array.isArray(e)?e.join(` +`):e;if(!t.includes(""))return null;const n=Jle.exec(t)?.[1]?.trim()??"",{completed:i,failed:o,aborted:s}=iue(n),r=Xle.exec(t)?.[1]?.trim(),a=sue(t),l=i+o+s;return{summary:n,completed:i,failed:o,aborted:s,total:l>0?l:a.length,subagents:a,resumeHint:r}}const aue=3,lue="Use TaskOutput with one of the task_id values above to read the full output.";function ip(e,t){return new RegExp(`^${t}: (.+)$`,"m").exec(e)?.[1]}function uue(e,t){const n=Number(ip(e,t)??0);return Number.isFinite(n)?n:0}function BH(e,t){return e.match(t)?.length??0}function nL(e,t,n){const i=new RegExp(`^\\[${t}\\]$`,"gm"),o=[];let s;for(;(s=i.exec(e))!==null;)s.index>=n&&o.push(s.index);return o}function iL(e,t){return t>=2&&e[t-1]===` +`&&e[t-2]===` +`}function oL(e,t,n){const i=e.slice(t+n.length+2),o=/^\[/m.exec(i);return(o===null?i:i.slice(0,o.index)).trim()}function cue(e){return e.endsWith(lue)}function due(e){const t=ip(e,"active_background_tasks");if(t===void 0)return!1;const n=Number(t);return Number.isFinite(n)?BH(e,/^task_id: /gm)===n:!1}function fue(e,t){return[...e.matchAll(/^description: (.+)$/gm)].map(i=>i[1]??"").slice(0,Math.min(aue,t))}function hue(e){if(e==null)return null;const t=Array.isArray(e)?e.join(` +`):e,n=/^\[/m.exec(t),i=n===null?t:t.slice(0,n.index),o=ip(i,"wait_status");if(o!=="completed"&&o!=="timed_out"&&o!=="no_tasks")return null;const s=Number(ip(i,"waited_ms")??0);let r,a=n?.index??t.length;o==="completed"&&n!==null&&t.slice(n.index).startsWith("[finished]")&&(r=oL(t,n.index,"finished"),a=n.index+10);let l=0,u=-1;for(const f of nL(t,"completed_during_wait",a)){if(!iL(t,f))continue;const h=oL(t,f,"completed_during_wait");cue(h)&&(l=BH(h,/^task_id: /gm),u=f)}let c=0,d=[];for(const f of nL(t,"still_running",a)){if(u>=0&&fc.replace(/\\/g,"/"),i=n(e);let o=n(t);o.length>1&&(o=o.replace(/\/+$/,""));const s=sL(o)||sL(i),r=s?o.toLowerCase():o,a=s?i.toLowerCase():i,l=r.endsWith("/")?r:`${r}/`;if(a!==r&&!a.startsWith(l))return null;const u=a===r?"":i.slice(l.length);return u.split("/").includes("..")?null:u||null}const on={permission:"kimi-web.permission",permissionBySession:"kimi-web.permission-by-session",permissionExplicit:"kimi-web.permission-explicit",permissionStickyAt:"kimi-web.permission-sticky-at",permissionDaemonDefault:"kimi-web.permission-daemon-default",nonComposerPromptIds:"kimi-web.non-composer-prompt-ids",activeWorkspace:"kimi-active-workspace",planArmed:"kimi-web.plan-armed",swarmMode:"kimi-web.swarm-mode",towerMode:"kimi-web.tower-mode",goalMode:"kimi-web.goal-mode",fontScale:"kimi-web.font-scale",starredModels:"kimi-web.starred-models",unread:"kimi-web.unread",onboarded:"kimi-web.onboarded",colorScheme:"kimi-web.color-scheme",hiddenWorkspaces:"kimi-web.hidden-workspaces",collapsedWorkspaces:"kimi-web.collapsed-workspaces",workspaceOrder:"kimi-web.workspace-order",workspaceSort:"kimi-web.workspace-sort",workspaceRecencyFloor:"kimi-web.workspace-recency-floor",pinnedSessions:"kimi-web.pinned-sessions",pinnedCollapsed:"kimi-web.pinned-collapsed",workspaceNameOverrides:"kimi-web.workspace-name-overrides",notifyEnabled:"kimi-web.notify-enabled",notifySound:"kimi-web.notify-sound",inputHistory:"kimi-web.input-history",locale:"kimi-locale",clientId:"kimi-web.client-id",debug:"kimi-web.debug",openInDefaultTarget:"kimi-web.open-in.default-target",openInLastTarget:"kimi-web.open-in.last-target",sidebarCollapsed:"kimi-web.sidebar-collapsed",sidebarWidth:"kimi-web.sidebar-width",sidebarViewMode:"kimi-web.sidebar-view-mode",mobileSwitcherViewMode:"kimi-web.mobile-switcher-view-mode",diffViewMode:"kimi-web.diff-view-mode",sidebarPinnedHeight:"kimi-web.sidebar-pinned-height",shortcutOverrides:"kimi-web.shortcut-overrides",dockIconChoice:"kimi-web.dock-icon-choice",updateSkippedVersion:"kimi-web.update-skipped-version",canarySkippedVersion:"kimi-web.canary-skipped-version",planMode:"kimi-web.plan-mode",codeFont:"kimi-web.code-font",contentAlign:"kimi-web.content-align",theme:"kimi-web.theme",thinking:"kimi-web.thinking",accent:"kimi-web.accent",notifyOnComplete:"kimi-web.notify-on-complete",notifyOnQuestion:"kimi-web.notify-on-question",notifyOnApproval:"kimi-web.notify-on-approval",soundOnComplete:"kimi-web.sound-on-complete"},gue="__new__";function vc(e){return e&&e.length>0?e:gue}function Pb(e){return`kimi-web.draft.${vc(e)}`}function rL(e){return`kimi-web.attachment-draft.${vc(e)}`}function Bb(e){return`kimi-web.draft-atts.${vc(e)}`}function uo(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function po(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function xr(e){try{globalThis.localStorage.removeItem(e)}catch{}}function $c(e){const t=uo(e);if(t===null)return null;try{return JSON.parse(t)}catch{return null}}function ou(e,t){try{globalThis.localStorage.setItem(e,JSON.stringify(t))}catch{}}function ZC(){const e=uo(on.unread);if(!e)return{};try{const t=JSON.parse(e);if(!t||typeof t!="object")return{};const n={};for(const[i,o]of Object.entries(t))o===!0&&(n[i]=!0);return n}catch{return{}}}function aL(e){const n={...ZC()};for(const[i,o]of Object.entries(e))o?n[i]=!0:delete n[i];po(on.unread,JSON.stringify(n))}function vue(){const e=$c(on.collapsedWorkspaces);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function z8(e){ou(on.collapsedWorkspaces,Array.from(e))}function yue(){return $c(on.pinnedCollapsed)===!0}function GC(e){ou(on.pinnedCollapsed,e)}function kue(){return uo(on.sidebarViewMode)==="flat"?"flat":"grouped"}function bue(e){po(on.sidebarViewMode,e)}function wue(){return uo(on.mobileSwitcherViewMode)==="grouped"?"grouped":"flat"}function Aue(e){po(on.mobileSwitcherViewMode,e)}function Cue(){return uo(on.diffViewMode)==="tree"?"tree":"list"}function xue(e){po(on.diffViewMode,e)}function Sue(){const e=$c(on.workspaceOrder);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function lL(e){ou(on.workspaceOrder,Array.from(e))}function _ue(){return uo(on.workspaceSort)==="recent"?"recent":"manual"}function Iue(e){po(on.workspaceSort,e)}function Mue(){const e=$c(on.workspaceRecencyFloor);if(!e||typeof e!="object")return{};const t={};for(const[n,i]of Object.entries(e))typeof i=="number"&&Number.isFinite(i)&&(t[n]=i);return t}function uL(e){ou(on.workspaceRecencyFloor,e)}function Tue(){try{return uo(on.activeWorkspace)}catch{return null}}function cL(e){try{po(on.activeWorkspace,e)}catch{}}function Eue(){try{const e=uo(on.hiddenWorkspaces);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function dL(e){try{po(on.hiddenWorkspaces,JSON.stringify(e))}catch{}}function $H(){const e=$c(on.pinnedSessions);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function j8(e){ou(on.pinnedSessions,Array.from(e))}function yk(){const e=$c(on.workspaceNameOverrides);if(!e||typeof e!="object")return{};const t={};for(const[n,i]of Object.entries(e))typeof i=="string"&&(t[n]=i);return t}function fL(e){ou(on.workspaceNameOverrides,e)}function Vf(e){return e==="manual"||e==="auto"||e==="yolo"?e:void 0}function hL(){return Vf(uo(on.permission))??"manual"}function Lue(e){po(on.permission,e)}function pL(){const e=uo(on.permissionStickyAt),t=Number(e);return Number.isFinite(t)&&t>0?t:e===null&&uo(on.permission)!==null?1:0}function L1(e){po(on.permissionStickyAt,String(e))}function zH(e){const t=uo(e);if(!t)return{};try{const n=JSON.parse(t);if(!n||typeof n!="object"||Array.isArray(n))return{};const i={};for(const[o,s]of Object.entries(n)){const r=Vf(s);r!==void 0&&(i[o]=r)}return i}catch{return{}}}function jH(e,t){po(e,JSON.stringify(t))}function mL(){return zH(on.permissionBySession)}function H8(e){jH(on.permissionBySession,e)}function gL(){return zH(on.permissionExplicit)}function Nue(e){jH(on.permissionExplicit,e)}const vL={manual:0,yolo:1,auto:2};function Fue(e){let t="auto",n=!1;for(const i of e)i!==void 0&&(n=!0,vL[i]typeof n=="number"&&Number.isFinite(n)&&n>0).slice(0,2);return t.length===0?HH:Math.round(t.reduce((n,i)=>n+i,0))}function WH(e){return e==null||!Number.isFinite(e)||e<=0?HH:Math.round(e)}const QC=96;function Pue(e,t,n){const i=e.filter(r=>r.visible),o=i[0],s=i[2];return{firstRowHeight:o?o.height:null,spanToThirdRow:s?s.viewportBottom-t+n:null}}function Bue(e,t,n){const i=s=>s!=null&&Number.isFinite(s)&&s>0;return(s=>s!=null&&Number.isFinite(s)&&s>=0)(t)?i(e)?Math.round(e)+Math.round(t):i(n)?Math.round(n)*3+Math.round(t):QC:QC}function $ue(e){return e>Due}function yL(e){return Math.round(e*.4)}function zue(e){return e==null||!Number.isFinite(e)||e<=0?QC:Math.round(e)}function jue(e,t,n,i){const o=WH(n),s=zue(i),r=Math.max(o,Math.round(e*.6));if(t===void 0||!Number.isFinite(t))return r;const a=Math.round(t)-s;return Math.max(o,Math.min(r,a))}function W8(e,t,n){return t==null||!Number.isFinite(t)?e:Math.max(WH(n),Math.min(e,Math.round(t)))}function Hue(e,t,n,i){return Math.max(Math.round(i),Math.min(Math.round(e+t),Math.round(n)))}function Wue(e,t){return t===null||t===e}const bS="application/x-kimi-session-row";function que(e,t){return e.includes(t)?e:[...e,t]}function Uue(e,t){return e.includes(t)?e.filter(n=>n!==t):e}function Vue(e,t){const n=new Set(t),i=new Map,o=[];for(const r of e)n.has(r.id)?i.set(r.id,r):o.push(r);const s=[];for(const r of t){const a=i.get(r);a!==void 0&&s.push(a)}return{pinned:s,unpinned:o}}const Kue={"&":"&","<":"<",">":">",'"':""","'":"'"};function hv(e){return e.replace(/[&<>"']/g,t=>Kue[t]??t)}function Zue(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Gue(e,t,n=40){const i=e.replace(/\s+/g," ").trim();if(i.length===0)return"";const o=t.trim();if(o.length===0)return kL(i,n*2);const s=i.toLowerCase().indexOf(o.toLowerCase());if(s<0)return kL(i,n*2);const r=Math.max(0,s-n),a=Math.min(i.length,s+o.length+n),l=r>0,u=a`${s}`)}const qH=/([\s\S]*?)<\/kbd>/g;function UH(e){let t="",n=0;for(const i of e.matchAll(qH))t+=hv(e.slice(n,i.index)),t+=`${hv(i[1]??"")}`,n=i.index+i[0].length;return t+hv(e.slice(n))}function Que(e){return e.replace(qH,"$1")}let Yue=0;function bL(e,t){const n=++Yue;return e.pendingPlanBySession[t]=n,n}function wS(e,t,n){return n===void 0||e.pendingPlanBySession[t]!==n?!1:(delete e.pendingPlanBySession[t],!0)}function YC(e,t,n){e.pendingPlanBySession[t]===void 0&&(e.planModeBySession[t]=n)}function Jue(e,t,n){return e.find(i=>i.window?.duration===t&&i.window?.unit===n)}const Xue=30;function ece(e){return e!==void 0&&e0?(a.push(t("settings.planUsage.durationDay",{n:o})),a.push(t("settings.planUsage.durationHour",{n:s})),a.push(t("settings.planUsage.durationMinute",{n:r}))):s>0?(a.push(t("settings.planUsage.durationHour",{n:s})),a.push(t("settings.planUsage.durationMinute",{n:r}))):r>0?a.push(t("settings.planUsage.durationMinute",{n:r})):a.push(t("settings.planUsage.durationSecond",{n:i})),t("settings.planUsage.resetsIn",{duration:a.join(" ")})}function JC(e,t){if(t<=0)return"ok";const n=e/t;return n>=.85?"danger":n>=.5?"warn":"ok"}function kk(e,t){return t<=0?0:Math.min(100,Math.round(e/t*100))}function tce(e,t){const n=(e/100).toFixed(2);switch(t.toUpperCase()){case"CNY":return{symbol:"¥",number:n};case"USD":return{symbol:"$",number:n};default:return{symbol:"",number:`${n} ${t}`}}}const ZH="kimiWeb.compaction",GH="managed:kimi-code",nce=["kimi","openai","openai_responses","anthropic","google-genai","vertexai"];function a9(){return{model:"",maxContextSize:"",displayName:"",capabilities:["tool_use","thinking"],supportEfforts:[],adaptiveThinking:!0}}function XC(e,t){const n=[];for(const i of Object.values(t??{})){if(i===null||typeof i!="object")continue;const o=i;o.provider===e.id&&n.push({model:typeof o.model=="string"?o.model:"",maxContextSize:typeof o.maxContextSize=="number"?String(o.maxContextSize):"",displayName:typeof o.displayName=="string"?o.displayName:"",capabilities:Array.isArray(o.capabilities)?o.capabilities.filter(s=>typeof s=="string"):[],supportEfforts:Array.isArray(o.supportEfforts)?o.supportEfforts.filter(s=>typeof s=="string"):[],...typeof o.adaptiveThinking=="boolean"?{adaptiveThinking:o.adaptiveThinking}:{}})}return n}const QH=/^[\p{L}\p{N}][\p{L}\p{N}\-_ ]*$/u;function ice(e,t={}){const n=e.id.trim();if(n==="")return"idRequired";if(!QH.test(n))return"idInvalid";if(t.requireApiKey===!0&&e.apiKey.trim()==="")return"apiKeyRequired";if(t.requireBaseUrl===!0&&e.baseUrl.trim()==="")return"baseUrlRequired";if(e.models.length===0)return"modelRequired";for(const i of e.models){if(i.model.trim()==="")return"modelRequired";const o=i.maxContextSize.trim();if(o==="")return"contextSizeRequired";if(!/^\d+$/.test(o)||Number(o)<1)return"contextSizeInvalid"}return null}function YH(e){return e.map(t=>{const n=t.displayName.trim();return{model:t.model.trim(),maxContextSize:Number(t.maxContextSize.trim()),...t.capabilities.length>0?{capabilities:[...t.capabilities]}:{},...t.supportEfforts.length>0?{supportEfforts:[...t.supportEfforts]}:{},...t.adaptiveThinking!==void 0?{adaptiveThinking:t.adaptiveThinking}:{},...n===""?{}:{displayName:n}}})}function oce(e){const t=e.apiKey.trim(),n=e.baseUrl.trim();return{id:e.id.trim(),type:e.type,models:YH(e.models),...t===""?{}:{apiKey:t},...n===""?{}:{baseUrl:n}}}function sce(e,t,n){const i=YH(e.models),o=e.id.trim(),s=e.apiKey.trim(),r=e.baseUrl.trim(),a=n?.existingDefaultModel?.trim()??"",l=a.indexOf("/")>=0?a.slice(a.indexOf("/")+1):a;return{...t!==void 0&&o!==""&&o!==t.id?{newId:o}:{},type:e.type,models:i,...s===""&&n?.includeBlankApiKey!==!0?{}:{apiKey:s},...r===""?{}:{baseUrl:r},...l!==""&&i.some(u=>u.model===l)?{defaultModel:l}:{}}}function JH(e){return e.id===GH&&e.type==="kimi"}function rce(e,t){return t.startsWith("image/")||t==="application/pdf"?!0:e.toLowerCase().endsWith(".pdf")}const $b="/devices/",XH="kimi-rc-device-id";function ace(e){return new URLSearchParams(e.search).get("rc")==="1"}function eW(e){const{pathname:t}=e;if(!t.startsWith($b))return;const n=t.slice($b.length).split("/")[0];if(n)try{const i=decodeURIComponent(n);return i.length>0?i:void 0}catch{return}}function lce(e){if(eW({pathname:e})===void 0)return e;const t=e.slice($b.length),n=t.indexOf("/");return n<0?"/":t.slice(n)}function uce(e){return`${$b}${encodeURIComponent(e)}/`}function tW(e,t){const n=new URLSearchParams(t),i=n.get("rc"),o=n.get("from");if(i===null&&o===null)return e;const s=new URLSearchParams;return i!==null&&s.set("rc",i),o!==null&&s.set("from",o),`${e}?${s.toString()}`}function cce(e){const t=eW(e);return t!==void 0?(fce(t),t):dce()}function dce(){try{return window.sessionStorage.getItem(XH)??void 0}catch{return}}function fce(e){try{window.sessionStorage.setItem(XH,e)}catch{}}const hce=/^(\d+)\t(.*)$/;function pce(e){const t=e.at(-1)===""?e.slice(0,-1):e;if(t.length===0)return null;const n=[],i=[];for(const o of t){const s=hce.exec(o);if(!s)return null;i.push(Number(s[1])),n.push(s[2]??"")}return{contents:n,lineNumbers:i}}function wL(e,t){let n="",i=t;const o=/^((?:\\\\|\/\/)[^\\/]+[\\/][^\\/]+)/.exec(t),s=/^([a-zA-Z]:)[\\/]?/.exec(t);o?(n=o[1],i=t.slice(o[1].length)):t.startsWith("/")?(n="/",i=t.slice(1)):s&&(n=s[1],i=t.slice(s[0].length));const r=n!=="",a=i.split(/[\\/]+/).filter(Boolean);for(const u of e.split("/"))u===""||u==="."||(u===".."?a.length>0&&a[a.length-1]!==".."?a.pop():r||a.push(".."):a.push(u));const l=a.join("/");return n==="/"?`/${l}`:n!==""?l?`${n}/${l}`:`${n}/`:l}function nW(e,t){for(const n of e.stateMachineNames){const i=(e.stateMachineInputs(n)??[]).find(o=>o.name===t);if(i!==void 0)return i}return null}function mce(e,t){const n=nW(e,t);return n!==null&&typeof n.fire=="function"?(n.fire(),!0):!1}function AL(e,t,n){const i=nW(e,t);return i!==null&&typeof i.value==typeof n?(i.value=n,!0):!1}const q8={isPageHidden:()=>typeof document<"u"&&document.hidden,onVisibilityChange:e=>typeof document>"u"?()=>{}:(document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)),observeIntersection:(e,t)=>{if(typeof IntersectionObserver!="function")return()=>{};const n=new IntersectionObserver(i=>{const o=i[0];o!==void 0&&t(o.isIntersecting)});return n.observe(e),()=>n.disconnect()}};function iW(e,t,n={}){const i=n.isPageHidden??q8.isPageHidden,o=n.onVisibilityChange??q8.onVisibilityChange,s=n.observeIntersection??q8.observeIntersection;let r=!i(),a=!0,l=!1;function u(){const f=!r||!a;f!==l&&(l=f,l?e.pause():e.play())}const c=o(()=>{r=!i(),u()}),d=s(t,f=>{a=f,u()});return u(),()=>{c(),d()}}const mr="kimi-web.server-credential",gce="token",vce=10080*60*1e3;let Cc;const e6=new Set;function yce(){if(typeof window>"u")return;const e=window.location.hash??"";if(!e.startsWith("#"))return;const n=new URLSearchParams(e.slice(1)).get(gce);if(!n)return;const i=new URL(window.location.href);return i.hash="",window.history.replaceState(window.history.state,"",`${i.pathname}${i.search}`),n}function t6(e){return{version:1,credential:e,expiresAt:Date.now()+vce}}function kce(e){return JSON.stringify(e)}function AS(e){try{const t=JSON.parse(e);if(typeof t!="object"||t===null)return;const n=t;return n.version!==1||typeof n.credential!="string"||n.credential.length===0||typeof n.expiresAt!="number"||!Number.isFinite(n.expiresAt)?void 0:{version:1,credential:n.credential,expiresAt:n.expiresAt}}catch{return}}function n6(e){globalThis.localStorage?.setItem(mr,kce(e))}function bce(){try{const e=globalThis.localStorage?.getItem(mr);if(e){const n=AS(e);if(n===void 0){const i=t6(e);let o=!1;try{n6(i),o=!0}catch{}if(!o)try{globalThis.localStorage?.getItem(mr)===e&&globalThis.localStorage?.removeItem(mr),o=!0}catch{}try{globalThis.sessionStorage?.removeItem(mr)}catch{}return o?i:void 0}if(n.expiresAt>Date.now())return n;globalThis.sessionStorage?.removeItem(mr),globalThis.localStorage?.getItem(mr)===e&&globalThis.localStorage?.removeItem(mr);return}const t=globalThis.sessionStorage?.getItem(mr);if(t){const n=t6(t);let i=!1;try{n6(n),i=!0}catch{}try{globalThis.sessionStorage?.removeItem(mr),i=!0}catch{}return i?n:void 0}return}catch{return}}function wce(){const e=yce();return e?(oW(e),!0):(Cc=bce(),Cc!==void 0)}function Ace(){if(Cc!==void 0){if(Cc.expiresAt<=Date.now()){Cce(Cc);return}return Cc.credential}}function Cce(e){Cc=void 0;try{globalThis.sessionStorage?.removeItem(mr);const t=globalThis.localStorage?.getItem(mr),n=t==null?void 0:AS(t);(n===void 0?t===e.credential:n.credential===e.credential&&n.expiresAt===e.expiresAt)&&globalThis.localStorage?.removeItem(mr)}catch{}}function oW(e){const t=t6(e);Cc=t;try{n6(t)}catch{}try{globalThis.sessionStorage?.removeItem(mr)}catch{}}function xce(){const e=Cc;Cc=void 0;try{const t=globalThis.localStorage?.getItem(mr),i=(t==null?void 0:AS(t))?.credential??t;e!==void 0&&i===e.credential&&globalThis.localStorage?.removeItem(mr),globalThis.sessionStorage?.removeItem(mr)}catch{}}function Sce(e){return e6.add(e),()=>{e6.delete(e)}}function _ce(){xce();for(const e of e6)try{e()}catch{}}function Y2(e){return e.approvalCount>0?"awaiting-approval":e.questionCount>0?"awaiting-question":e.pendingInteraction==="approval"?"awaiting-approval":e.pendingInteraction==="question"?"awaiting-question":e.busy?"running":e.lastTurnReason==="failed"?"aborted":e.unread?"unread":"idle"}function CL(e){let t=null;for(const n of e){const i=Y2(n);if(i==="awaiting-approval")return"approval";i==="awaiting-question"?t="question":i==="aborted"?t!=="question"&&(t="aborted"):i==="unread"&&t===null&&(t="unread")}return t}let xL;function Ice(e){if(typeof Intl.Segmenter=="function")return xL??=new Intl.Segmenter("und",{granularity:"grapheme"}),xL.segment(e)}const Mce=/\p{Emoji_Presentation}/u,Tce=/\p{Regional_Indicator}/u,Ece=/\p{Extended_Pictographic}/u,Lce="️";function Nce(e){return Mce.test(e)||Tce.test(e)?!0:Ece.test(e)&&e.includes(Lce)}function sW(e){const t=Ice(e)?.[Symbol.iterator]().next().value;if(t===void 0||!Nce(t.segment))return{emoji:null,rest:e};const n=e.slice(t.index+t.segment.length).replace(/^\s+/,"");return{emoji:t.segment,rest:n}}function Fce(e,t){const{rest:n}=sW(e),i=t?.trim()??"";return i?n?`${i} ${n}`:i:n}function rW(e,t){const n=e.findIndex(s=>s.id===t.id);if(n!==-1&&e[n].updatedAt===t.updatedAt)return e.map(s=>s.id===t.id?t:s);const i=e.filter(s=>s.id!==t.id),o=i.findIndex(s=>s.updatedAt0?i:void 0}catch{return}}function Rce(e){return e===void 0||e.length===0?"/":`${i6}${encodeURIComponent(e)}`}function CS(){if(typeof navigator>"u")return!1;if(/Mac|iPod|iPhone|iPad/.test(navigator.platform))return!0;const e=navigator.userAgentData;return e?.platform==="macOS"||e?.platform==="iOS"}function cW(e,t=CS()){return(t?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey)&&!e.altKey&&!e.shiftKey&&(e.code==="KeyA"||e.key.toLowerCase()==="a")&&!e.defaultPrevented}function Dce(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement&&(e.isContentEditable||e.closest("input, textarea")!==null)}function Oce(e,t){return typeof Element>"u"||!(e instanceof Element)?null:e.closest(t)}function SL(e){e.ownerDocument.getSelection()?.selectAllChildren(e)}function Pce(e,t=CS()){return(t?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey)&&!e.altKey&&!e.shiftKey&&(e.code==="KeyK"||e.key.toLowerCase()==="k")&&!e.defaultPrevented}const Bce=[{pattern:/\brm\s+(?:-[a-zA-Z]*[rf][a-zA-Z]*|--recursive|--force)\b/,detail:"rm -rf"},{pattern:/\bsudo\b/,detail:"sudo"},{pattern:/\bmkfs(?:\.[a-z0-9]+)?\b/,detail:"mkfs"},{pattern:/\bdd\b[^|;&]*\bof=/,detail:"dd of=…"},{pattern:/>\s*\/dev\/(?:sd|nvme|disk|hd)/,detail:"> /dev/…"},{pattern:/:\(\)\s*\{/,detail:"fork bomb"},{pattern:/\bgit\s+push\b[^|;&]*(?:--force(?:-with-lease)?\b|\s-f\b)/,detail:"git push --force"},{pattern:/\bchmod\s+(?:-[a-zA-Z]+\s+)*777\b/,detail:"chmod 777"},{pattern:/\b(?:curl|wget)\b[^|;&]*\|\s*(?:sudo\s+)?(?:ba|z)?sh\b/,detail:"curl | sh"},{pattern:/\b(?:shutdown|reboot|poweroff|halt)\b/,detail:"shutdown / reboot"}];function $ce(e){const t=e.replace(/"[^"]*"|'[^']*'/g," ");for(const{pattern:n,detail:i}of Bce)if(n.test(t))return i}function hh(e){return Array.isArray?Array.isArray(e):fW(e)==="[object Array]"}function zce(e){if(typeof e=="string")return e;if(typeof e=="bigint")return e.toString();const t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function o6(e){return e==null?"":zce(e)}function $r(e){return typeof e=="string"}function bk(e){return typeof e=="number"}function jce(e){return e===!0||e===!1||Hce(e)&&fW(e)=="[object Boolean]"}function dW(e){return typeof e=="object"}function Hce(e){return dW(e)&&e!==null}function ll(e){return e!=null}function l9(e){return!e.trim().length}function fW(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const Wce="Incorrect 'index' type",s6="Invalid doc index: must be a non-negative integer within the bounds of the docs array",qce=e=>`Invalid value for key ${e}`,Uce=e=>`Pattern length exceeds max of ${e}.`,Vce=e=>`Missing ${e} property in key`,Kce=e=>`Property 'weight' in key '${e}' must be a positive integer`,Zce="Fuse.match does not support useTokenSearch: token search requires corpus-level statistics (df, fieldCount) that a one-off string comparison does not have. Use new Fuse(...).search(...) instead.",_L=Object.prototype.hasOwnProperty;var Gce=class{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(n=>{const i=hW(n);this._keys.push(i),this._keyMap[i.id]=i,t+=i.weight}),this._keys.forEach(n=>{n.weight/=t})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}};function hW(e){let t=null,n=null,i=null,o=1,s=null;if($r(e)||hh(e))i=e,t=IL(e),n=wk(e);else{if(!_L.call(e,"name"))throw new Error(Vce("name"));const r=e.name;if(i=r,_L.call(e,"weight")&&e.weight!==void 0&&(o=e.weight,o<=0))throw new Error(Kce(wk(r)));t=IL(r),n=wk(r),s=e.getFn??null}return{path:t,id:n,weight:o,src:i,getFn:s}}function IL(e){return hh(e)?e:e.split(".")}function wk(e){return hh(e)?e.join("."):e}function Qce(e,t){const n=[];let i=!1;const o=(s,r,a,l)=>{if(ll(s))if(!r[a])n.push(l!==void 0?{v:s,i:l}:s);else{const u=s[r[a]];if(!ll(u))return;if(a===r.length-1&&($r(u)||bk(u)||jce(u)||typeof u=="bigint"))n.push(l!==void 0?{v:o6(u),i:l}:o6(u));else if(hh(u)){i=!0;for(let c=0,d=u.length;ce.score===t.score?e.idx=9&&e<=13||e===32||e===160}function nde(e=1,t=3){const n=new Map,i=Math.pow(10,t);return{get(o){let s=0,r=!1;for(let l=0;l{this._keysMap[t.id]=n})}create(){if(this.isCreated||!this.docs.length)return;this.isCreated=!0;const e=this.docs.length;this.records=new Array(e);let t=0;if($r(this.docs[0]))for(let n=0;ne&&(this.records[t].i-=1)}removeAll(e){const t=new Set;for(const i of e)Number.isInteger(i)&&i>=0&&t.add(i);if(t.size===0)return;this.records=this.records.filter(i=>!t.has(i.i));const n=Array.from(t).sort((i,o)=>i-o);for(const i of this.records){let o=0,s=n.length;for(;o>>1;n[r]t),records:this.records}}};function pW(e,t,{getFn:n=qn.getFn,fieldNormWeight:i=qn.fieldNormWeight}={}){const o=new xS({getFn:n,fieldNormWeight:i});return o.setKeys(e.map(hW)),o.setSources(t),o.create(),o}function ide(e,{getFn:t=qn.getFn,fieldNormWeight:n=qn.fieldNormWeight}={}){const{keys:i,records:o}=e,s=new xS({getFn:t,fieldNormWeight:n});return s.setKeys(i),s.setIndexRecords(o),s}function ode(e=[],t=qn.minMatchCharLength){const n=[];let i=-1,o=-1,s=0;for(let r=e.length;s=t&&n.push([i,o]),i=-1)}return e[s-1]&&s-i>=t&&n.push([i,s-1]),n}function sde(e,t,n,{location:i=qn.location,distance:o=qn.distance,threshold:s=qn.threshold,findAllMatches:r=qn.findAllMatches,minMatchCharLength:a=qn.minMatchCharLength,includeMatches:l=qn.includeMatches,ignoreLocation:u=qn.ignoreLocation}={}){if(t.length>32)throw new Error(Uce(32));const c=t.length,d=e.length,f=Math.max(0,Math.min(i,d));let h=s,m=f;const g=(x,_)=>{const F=x/c;if(u)return F;const I=Math.abs(f-_);return o?F+I/o:I?1:F},y=a>1||l,b=y?Array(d):[];let v;for(;(v=e.indexOf(t,m))>-1;){const x=g(0,v);if(h=Math.min(x,h),m=v+c,y){let _=0;for(;_=I;$-=1){const T=$-1,R=n[e[T]];if(H[$]=(H[$+1]<<1|1)&R,x&&(H[$]|=(w[$+1]|w[$])<<1|1|w[$+1]),H[$]&E&&(A=g(x,T),A<=h)){if(h=A,m=T,M=x,m<=f)break;I=Math.max(1,2*f-m)}}if(g(x+1,f)>h)break;w=H}if(y&&m>=0){const x=Math.min(d-1,m+c-1+M);for(let _=m;_<=x;_+=1)n[e[_]]&&(b[_]=1)}const C={isMatch:m>=0,score:Math.max(.001,A)};if(y){const x=ode(b,a);x.length?l&&(C.indices=x):C.isMatch=!1}return C}function rde(e){const t={};for(let n=0,i=e.length;nn[0]-i[0]||n[1]-i[1]);const t=[e[0]];for(let n=1,i=e.length;ne.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"").replace(ade,t=>mW[t]):e=>e;var _S=class{constructor(e,{location:t=qn.location,threshold:n=qn.threshold,distance:i=qn.distance,includeMatches:o=qn.includeMatches,findAllMatches:s=qn.findAllMatches,minMatchCharLength:r=qn.minMatchCharLength,isCaseSensitive:a=qn.isCaseSensitive,ignoreDiacritics:l=qn.ignoreDiacritics,ignoreLocation:u=qn.ignoreLocation}={}){if(this.options={location:t,threshold:n,distance:i,includeMatches:o,findAllMatches:s,minMatchCharLength:r,isCaseSensitive:a,ignoreDiacritics:l,ignoreLocation:u},e=a?e:e.toLowerCase(),e=l?u2(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;const c=(f,h)=>{this.chunks.push({pattern:f,alphabet:rde(f),startIndex:h})},d=this.pattern.length;if(d>32){let f=0;const h=d%32,m=d-h;for(;f{const{isMatch:b,score:v,indices:w}=sde(e,m,g,{location:o+y,distance:s,threshold:r,findAllMatches:a,minMatchCharLength:l,includeMatches:i,ignoreLocation:u});b&&(f=!0),d+=v,b&&w&&c.push(...w)});const h={isMatch:f,score:f?d/this.chunks.length:1};return f&&i&&(h.indices=SS(c)),h}};const lde=new Set(["fuzzy","include"]);function ude(e){return e.startsWith("inverse")}const r6=[{type:"exact",multiRegex:/^="(.*)"$/,singleRegex:/^=(.*)$/,create:e=>({type:"exact",search(t){const n=t===e;return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}})},{type:"include",multiRegex:/^'"(.*)"$/,singleRegex:/^'(.*)$/,create:e=>({type:"include",search(t){let n=0,i;const o=[],s=e.length;for(;(i=t.indexOf(e,n))>-1;)n=i+s,o.push([i,n-1]);const r=!!o.length;return{isMatch:r,score:r?0:1,indices:o}}})},{type:"prefix-exact",multiRegex:/^\^"(.*)"$/,singleRegex:/^\^(.*)$/,create:e=>({type:"prefix-exact",search(t){const n=t.startsWith(e);return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}})},{type:"inverse-prefix-exact",multiRegex:/^!\^"(.*)"$/,singleRegex:/^!\^(.*)$/,create:e=>({type:"inverse-prefix-exact",search(t){const n=!t.startsWith(e);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}})},{type:"inverse-suffix-exact",multiRegex:/^!"(.*)"\$$/,singleRegex:/^!(.*)\$$/,create:e=>({type:"inverse-suffix-exact",search(t){const n=!t.endsWith(e);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}})},{type:"suffix-exact",multiRegex:/^"(.*)"\$$/,singleRegex:/^(.*)\$$/,create:e=>({type:"suffix-exact",search(t){const n=t.endsWith(e);return{isMatch:n,score:n?0:1,indices:[t.length-e.length,t.length-1]}}})},{type:"inverse-exact",multiRegex:/^!"(.*)"$/,singleRegex:/^!(.*)$/,create:e=>({type:"inverse-exact",search(t){const n=t.indexOf(e)===-1;return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}})},{type:"fuzzy",multiRegex:/^"(.*)"$/,singleRegex:/^(.*)$/,create:(e,t={})=>{const n=new _S(e,{location:t.location??qn.location,threshold:t.threshold??qn.threshold,distance:t.distance??qn.distance,includeMatches:t.includeMatches??qn.includeMatches,findAllMatches:t.findAllMatches??qn.findAllMatches,minMatchCharLength:t.minMatchCharLength??qn.minMatchCharLength,isCaseSensitive:t.isCaseSensitive??qn.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics??qn.ignoreDiacritics,ignoreLocation:t.ignoreLocation??qn.ignoreLocation});return{type:"fuzzy",search(i){return n.searchIn(i)}}}}],ML=r6.length,cde="\0",dde="|";function fde(e){const t=[],n=e.length;let i=0;for(;i=n)break;let o=i;for(;o=n||e[s]===" "){o++;break}if(e[s]==="$"&&(s+1>=n||e[s+1]===" ")){o+=2;break}}o++}t.push(e.substring(i,o)),i=o}else{for(;o{const i=fde(n.replace(/\u0000/g,"|").trim()).filter(s=>s&&!!s.trim()),o=[];for(let s=0,r=i.length;s!!(e[jb.AND]||e[jb.OR]),mde=e=>!!e[l6.PATH],gde=e=>!hh(e)&&dW(e)&&!u6(e),EL=e=>({[jb.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function gW(e,t,{auto:n=!0}={}){const i=o=>{if($r(o)){const l={keyId:null,pattern:o};return n&&(l.searcher=zb(o,t)),l}const s=Object.keys(o),r=mde(o);if(!r&&s.length>1&&!u6(o))return i(EL(o));if(gde(o)){const l=r?o[l6.PATH]:s[0],u=r?o[l6.PATTERN]:o[l];if(!$r(u))throw new Error(qce(l));const c={keyId:wk(l),pattern:u};return n&&(c.searcher=zb(u,t)),c}const a={children:[],operator:s[0]};return s.forEach(l=>{const u=o[l];hh(u)&&u.forEach(c=>{a.children.push(i(c))})}),a};return u6(e)||(e=EL(e)),i(e)}function c6(e,{ignoreFieldNorm:t=qn.ignoreFieldNorm}){let n=1;return e.forEach(({key:i,norm:o,score:s})=>{const r=i?i.weight:null;n*=Math.pow(s===0&&r?Number.EPSILON:s,(r||1)*(t?1:o))}),n}function vde(e,{ignoreFieldNorm:t=qn.ignoreFieldNorm}){e.forEach(n=>{n.score=c6(n.matches,{ignoreFieldNorm:t})})}var yde=class{constructor(e,t){this.limit=e,this.heap=[],this.comparator=t}get size(){return this.heap.length}insert(e){this.size0;){const n=e-1>>1;if(this.comparator(t[e],t[n])<=0)break;const i=t[e];t[e]=t[n],t[n]=i,e=n}}_sinkDown(e){const t=this.heap,n=t.length;let i=e;do{e=i;const o=2*e+1,s=2*e+2;if(o0&&(i=o),s0&&(i=s),i!==e){const r=t[e];t[e]=t[i],t[i]=r}}while(i!==e)}};function kde(e){const t=[];return e.matches.forEach(n=>{if(!ll(n.indices)||!n.indices.length)return;const i={indices:n.indices,value:n.value};n.key&&(i.key=n.key.id),n.idx>-1&&(i.refIndex=n.idx),t.push(i)}),t}function bde(e,t,{includeMatches:n=qn.includeMatches,includeScore:i=qn.includeScore}={}){return e.map(o=>{const{idx:s}=o,r={item:t[s],refIndex:s};return n&&(r.matches=kde(o)),i&&(r.score=o.score),r})}const wde=/[\p{L}\p{M}\p{N}_]+/gu,LL=new WeakSet;function Ade(e){LL.has(e)||(LL.add(e),console.warn(`[Fuse] tokenize regex ${e} lacks the global flag; only the first match per text will be returned. Add the 'g' flag.`))}function Cde(e){if(typeof e=="function"){let t=!1;return n=>{const i=e(n);if(!t&&(t=!0,!Array.isArray(i)||i.some(o=>typeof o!="string")))throw new Error(`[Fuse] tokenize function must return string[]; received ${Array.isArray(i)?"array containing non-strings":typeof i}.`);return i}}return e instanceof RegExp?(e.global||Ade(e),t=>t.match(e)||[]):t=>t.match(wde)||[]}function d6({isCaseSensitive:e=!1,ignoreDiacritics:t=!1,tokenize:n}={}){const i=Cde(n);return{tokenize(o){return e||(o=o.toLowerCase()),t&&(o=u2(o)),i(o)}}}var xde=class{static condition(e,t){return t.useTokenSearch}constructor(e,t){this.options=t,this.analyzer=d6({isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,tokenize:t.tokenize});const n=this.analyzer.tokenize(e),{df:i,fieldCount:o}=t._invertedIndex;this.termSearchers=[],this.idfWeights=[];for(const s of n){this.termSearchers.push(new _S(s,{location:t.location,threshold:t.threshold,distance:t.distance,includeMatches:t.includeMatches,findAllMatches:t.findAllMatches,minMatchCharLength:t.minMatchCharLength,isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,ignoreLocation:!0}));const r=i.get(s)||0,a=Math.log(1+(o-r+.5)/(r+.5));this.idfWeights.push(a)}this.combineAll=t.tokenMatch==="all",this.numTerms=this.termSearchers.length,this.useMask=this.numTerms<=31}searchIn(e){if(!this.termSearchers.length)return{isMatch:!1,score:1};const t=[];let n=0,i=0,o=0,s=0;const r=this.combineAll&&!this.useMask?new Set:null;for(let u=0;u0?1-n/i:0,l={isMatch:!0,score:Math.max(.001,a)};return this.options.includeMatches&&t.length&&(l.indices=SS(t)),this.combineAll&&(this.useMask?l.matchedMask=s:l.matchedTerms=r,l.termCount=this.numTerms),l}};function U8(e,t,n,i){const o=i.tokenize(t);if(!o.length)return;e.fieldCount++,e.docFieldCount.set(n,(e.docFieldCount.get(n)||0)+1);const s=new Set(o);let r=e.docTermFieldHits.get(n);r||(r=new Map,e.docTermFieldHits.set(n,r));for(const a of s)r.set(a,(r.get(a)||0)+1),e.df.set(a,(e.df.get(a)||0)+1)}function vW(e,t,n,i){const{i:o,v:s,$:r}=t;if(s!==void 0){U8(e,s,o,i);return}if(r)for(let a=0;aa-l);for(const a of n)Ide(e,a);const i=a=>{let l=0,u=n.length;for(;l>>1;n[c]o?i(a):a,l);e.docFieldCount=s;const r=new Map;for(const[a,l]of e.docTermFieldHits)r.set(a>o?i(a):a,l);e.docTermFieldHits=r}var ph=class{constructor(e,t,n){this.options={...qn,...t},this.options.useExtendedSearch,this.options.useTokenSearch,this._keyStore=new Gce(this.options.keys),this._docs=e,this._myIndex=null,this._invertedIndex=null,this.setCollection(e,n),this._lastQuery=null,this._lastSearcher=null}_getSearcher(e){if(this._lastQuery===e)return this._lastSearcher;const t=zb(e,this._invertedIndex?{...this.options,_invertedIndex:this._invertedIndex}:this.options);return this._lastQuery=e,this._lastSearcher=t,t}setCollection(e,t){if(this._docs=e,t&&!(t instanceof xS))throw new Error(Wce);if(this._myIndex=t||pW(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){const n=d6({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});this._invertedIndex=Sde(this._myIndex.records,this._myIndex.keys.length,n)}this._invalidateSearcherCache()}add(e){if(!ll(e))return;this._docs.push(e);const t=this._myIndex.add(e,this._docs.length-1);if(this._invertedIndex&&t){const n=d6({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});_de(this._invertedIndex,t,this._myIndex.keys.length,n)}this._invalidateSearcherCache()}remove(e=()=>!1){const t=[],n=[];for(let i=0,o=this._docs.length;i!i.has(s)),this._myIndex.removeAll(n),this._invalidateSearcherCache()}return t}removeAt(e){if(!Number.isInteger(e)||e<0||e>=this._docs.length)throw new Error(s6);this._invertedIndex&&NL(this._invertedIndex,[e]);const t=this._docs.splice(e,1)[0];return this._myIndex.removeAt(e),this._invalidateSearcherCache(),t}_invalidateSearcherCache(){this._lastQuery=null,this._lastSearcher=null}getIndex(){return this._myIndex}_normalizedKeys(){return this._myIndex.keys.map(e=>this._keyStore.get(e.id)||e)}search(e,t){const{limit:n=-1}=t||{},{includeMatches:i,includeScore:o,shouldSort:s,sortFn:r,ignoreFieldNorm:a}=this.options;if($r(e)&&!e.trim()){let f=this._docs.map((h,m)=>({item:h,refIndex:m}));return bk(n)&&n>-1&&(f=f.slice(0,n)),f}const l=s&&bk(n)&&n>0&&$r(e),u=r,c=(f,h)=>u(f,h)||f.idx-h.idx;let d;if(l){const f=new yde(n,c);$r(this._docs[0])?this._searchStringList(e,{heap:f,ignoreFieldNorm:a}):this._searchObjectList(e,{heap:f,ignoreFieldNorm:a}),d=f.extractSorted()}else d=$r(e)?$r(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e),vde(d,{ignoreFieldNorm:a}),s&&d.sort($r(e)?c:u),bk(n)&&n>-1&&(d=d.slice(0,n));return bde(d,this._docs,{includeMatches:i,includeScore:o})}_searchStringList(e,{heap:t,ignoreFieldNorm:n}={}){const i=this._getSearcher(e),o=this.options.useTokenSearch&&this.options.tokenMatch==="all",{records:s}=this._myIndex,r=t?null:[];return s.forEach(({v:a,i:l,n:u})=>{if(!ll(a))return;const c=i.searchIn(a);if(c.isMatch){const d={score:c.score,value:a,norm:u,indices:c.indices};o&&(d.matchedMask=c.matchedMask,d.matchedTerms=c.matchedTerms,d.termCount=c.termCount);const f=[d];if(!o||this._coversAllTokens(f)){const h={item:a,idx:l,matches:f};t?(h.score=c6(h.matches,{ignoreFieldNorm:n}),t.insert(h)):r.push(h)}}}),r}_searchLogical(e){const t=gW(e,this.options),n=this._normalizedKeys(),i=(a,l,u)=>{if(!("children"in a)){const{keyId:h,searcher:m}=a;let g;return h===null?(g=[],n.forEach((y,b)=>{g.push(...this._findMatches({key:y,value:l[b],searcher:m}))})):g=this._findMatches({key:this._keyStore.get(h),value:this._myIndex.getValueForItemAtKeyId(l,h),searcher:m}),g&&g.length?[{idx:u,item:l,matches:g}]:[]}const{children:c,operator:d}=a,f=[];for(let h=0,m=c.length;h{if(ll(a)){const u=i(t,a,l);u.length&&(s.has(l)||(s.set(l,{idx:l,item:a,matches:[]}),r.push(s.get(l))),u.forEach(({matches:c})=>{s.get(l).matches.push(...c)}))}}),r}_searchObjectList(e,{heap:t,ignoreFieldNorm:n}={}){const i=this._getSearcher(e),o=this.options.useTokenSearch&&this.options.tokenMatch==="all",{records:s}=this._myIndex,r=this._normalizedKeys(),a=t?null:[];return s.forEach(({$:l,i:u})=>{if(!ll(l))return;const c=[];let d=!1,f=!1;if(r.forEach((h,m)=>{const g=this._findMatches({key:h,value:l[m],searcher:i});g.length?(c.push(...g),g[0].hasInverse&&(f=!0)):d=!0}),!(f&&d)&&c.length&&(!o||this._coversAllTokens(c))){const h={idx:u,item:l,matches:c};t?(h.score=c6(h.matches,{ignoreFieldNorm:n}),t.insert(h)):a.push(h)}}),a}_findMatches({key:e,value:t,searcher:n}){if(!ll(t))return[];const i=[];if(hh(t))t.forEach(({v:o,i:s,n:r})=>{if(!ll(o))return;const a=n.searchIn(o);if(a.isMatch){const l={score:a.score,key:e,value:o,idx:s,norm:r,indices:a.indices,hasInverse:a.hasInverse};a.termCount!==void 0&&(l.matchedMask=a.matchedMask,l.matchedTerms=a.matchedTerms,l.termCount=a.termCount),i.push(l)}});else{const{v:o,n:s}=t,r=n.searchIn(o);if(r.isMatch){const a={score:r.score,key:e,value:o,norm:s,indices:r.indices,hasInverse:r.hasInverse};r.termCount!==void 0&&(a.matchedMask=r.matchedMask,a.matchedTerms=r.matchedTerms,a.termCount=r.termCount),i.push(a)}}return i}_coversAllTokens(e){const t=e.length?e[0].termCount:void 0;if(t===void 0)return!0;if(t<=31){let i=0;for(let o=0;oIS(t))};var Mde=ph;const Tde=/^[\uD800-\uDBFF]$/,Ede=/^[\uDC00-\uDFFF]$/,Lde=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;var FL;(function(e){e[e.Unknown=1e-13]="Unknown",e[e.Rule=1e-12]="Rule",e[e.DICT=2e-8]="DICT",e[e.Surname=1]="Surname",e[e.Custom=1]="Custom"})(FL||(FL={}));const Cl={Normal:1,Surname:10,Custom:100};function Mu(e){var t;return e.length-(((t=e.match(Lde))===null||t===void 0?void 0:t.length)||0)}function f6(e){const t=[];let n=0;for(;n1)return this.StringDICT.get(t);{const n=t.charCodeAt(0);return this.NumberDICT[n]}}set(t,n){if(t.length>1)this.StringDICT.set(t,n);else{const i=t.charCodeAt(0);this.NumberDICT[i]=n}}clear(){this.NumberDICT=[],this.StringDICT.clear()}}const Nde=["zh","ch","sh","z","c","s","b","p","m","f","d","t","n","l","g","k","h","j","q","x","r","y","w",""],Fde=["j","q","x"],Rde=["uān","uán","uǎn","uàn","uan","uē","ué","uě","uè","ue","ūn","ún","ǔn","ùn","un","ū","ú","ǔ","ù","u"],Dde={uān:"üān",uán:"üán",uǎn:"üǎn",uàn:"üàn",uan:"üan",uē:"üē",ué:"üé",uě:"üě",uè:"üè",ue:"üe",ūn:"ǖn",ún:"ǘn",ǔn:"ǚn",ùn:"ǜn",un:"ün",ū:"ǖ",ú:"ǘ",ǔ:"ǚ",ù:"ǜ",u:"ü"},Ode=["ia","ian","iang","iao","ie","iu","iong","ua","uai","uan","uang","ue","ui","uo","üan","üe","van","ve"],RL={一:"yì",二:"èr",三:"sān",四:"sì",五:"wǔ",六:"liù",七:"qī",八:"bā",九:"jiǔ",十:"shí",百:"bǎi",千:"qiān",万:"wàn",亿:"yì",单:"dān",两:"liǎng",双:"shuāng",多:"duō",几:"jǐ",十一:"shí yī",零一:"líng yī",第一:"dì yī",一十:"yī shí",一十一:"yī shí yī"},DL={重:"chóng",行:"háng",斗:"dǒu",更:"gēng"};function Pde(){const e={零一:"líng yī","〇一":"líng yī",十一:"shí yī",一十:"yī shí",第一:"dì yī",一十一:"yī shí yī"};for(let t in RL)for(let n in DL){const i=`${t}${n}`,o=`${RL[t]} ${DL[n]}`;e[i]=o}return e}const OL=Pde(),Bde=Object.keys(OL).map(e=>({zh:e,pinyin:OL[e],probability:1e-12,length:Mu(e),priority:Cl.Normal,dict:Symbol("rule")})),kW={不:{bú:[4]},一:{yí:[4],yì:[1,2,3]}},$de={不:["的","而","之","后","也","还","地"],一:["的","而","之","后","也","还","是"]},zde=Object.keys(kW),h6={南宫:"nán gōng",第五:"dì wǔ",万俟:"mò qí",司马:"sī mǎ",上官:"shàng guān",欧阳:"ōu yáng",夏侯:"xià hóu",诸葛:"zhū gě",闻人:"wén rén",东方:"dōng fāng",赫连:"hè lián",皇甫:"huáng fǔ",尉迟:"yù chí",公羊:"gōng yáng",澹台:"tán tái",公冶:"gōng yě",宗政:"zōng zhèng",濮阳:"pú yáng",淳于:"chún yú",太叔:"tài shū",申屠:"shēn tú",公孙:"gōng sūn",仲孙:"zhòng sūn",轩辕:"xuān yuán",令狐:"líng hú",钟离:"zhōng lí",宇文:"yǔ wén",长孙:"zhǎng sūn",慕容:"mù róng",鲜于:"xiān yú",闾丘:"lǘ qiū",司徒:"sī tú",司空:"sī kōng",亓官:"qí guān",司寇:"sī kòu",仉督:"zhǎng dū",子车:"zǐ jū",颛孙:"zhuān sūn",端木:"duān mù",巫马:"wū mǎ",公西:"gōng xī",漆雕:"qī diāo",乐正:"yuè zhèng",壤驷:"rǎng sì",公良:"gōng liáng",拓跋:"tuò bá",夹谷:"jiá gǔ",宰父:"zǎi fǔ",榖梁:"gǔ liáng",段干:"duàn gān",百里:"bǎi lǐ",东郭:"dōng guō",南门:"nán mén",呼延:"hū yán",羊舌:"yáng shé",梁丘:"liáng qiū",左丘:"zuǒ qiū",东门:"dōng mén",西门:"xī mén",句龙:"gōu lóng",毌丘:"guàn qiū",赵:"zhào",钱:"qián",孙:"sūn",李:"lǐ",周:"zhōu",吴:"wú",郑:"zhèng",王:"wáng",冯:"féng",陈:"chén",褚:"chǔ",卫:"wèi",蒋:"jiǎng",沈:"shěn",韩:"hán",杨:"yáng",朱:"zhū",秦:"qín",尤:"yóu",许:"xǔ",何:"hé",吕:"lǚ",施:"shī",张:"zhāng",孔:"kǒng",曹:"cáo",严:"yán",华:"huà",金:"jīn",魏:"wèi",陶:"táo",姜:"jiāng",戚:"qī",谢:"xiè",邹:"zōu",喻:"yù",柏:"bǎi",水:"shuǐ",窦:"dòu",章:"zhāng",云:"yún",苏:"sū",潘:"pān",葛:"gě",奚:"xī",范:"fàn",彭:"péng",郎:"láng",鲁:"lǔ",韦:"wéi",昌:"chāng",马:"mǎ",苗:"miáo",凤:"fèng",花:"huā",方:"fāng",俞:"yú",任:"rén",袁:"yuán",柳:"liǔ",酆:"fēng",鲍:"bào",史:"shǐ",唐:"táng",费:"fèi",廉:"lián",岑:"cén",薛:"xuē",雷:"léi",贺:"hè",倪:"ní",汤:"tāng",滕:"téng",殷:"yīn",罗:"luó",毕:"bì",郝:"hǎo",邬:"wū",安:"ān",常:"cháng",乐:"yuè",于:"yú",时:"shí",傅:"fù",皮:"pí",卞:"biàn",齐:"qí",康:"kāng",伍:"wǔ",余:"yú",元:"yuán",卜:"bǔ",顾:"gù",孟:"mèng",平:"píng",黄:"huáng",和:"hé",穆:"mù",萧:"xiāo",尹:"yǐn",姚:"yáo",邵:"shào",湛:"zhàn",汪:"wāng",祁:"qí",毛:"máo",禹:"yǔ",狄:"dí",米:"mǐ",贝:"bèi",明:"míng",臧:"zāng",计:"jì",伏:"fú",成:"chéng",戴:"dài",谈:"tán",宋:"sòng",茅:"máo",庞:"páng",熊:"xióng",纪:"jǐ",舒:"shū",屈:"qū",项:"xiàng",祝:"zhù",董:"dǒng",梁:"liáng",杜:"dù",阮:"ruǎn",蓝:"lán",闵:"mǐn",席:"xí",季:"jì",麻:"má",强:"qiáng",贾:"jiǎ",路:"lù",娄:"lóu",危:"wēi",江:"jiāng",童:"tóng",颜:"yán",郭:"guō",梅:"méi",盛:"shèng",林:"lín",刁:"diāo",钟:"zhōng",徐:"xú",邱:"qiū",骆:"luò",高:"gāo",夏:"xià",蔡:"cài",田:"tián",樊:"fán",胡:"hú",凌:"líng",霍:"huò",虞:"yú",万:"wàn",支:"zhī",柯:"kē",昝:"zǎn",管:"guǎn",卢:"lú",莫:"mò",经:"jīng",房:"fáng",裘:"qiú",缪:"miào",干:"gān",解:"xiè",应:"yīng",宗:"zōng",丁:"dīng",宣:"xuān",贲:"bēn",邓:"dèng",郁:"yù",单:"shàn",杭:"háng",洪:"hóng",包:"bāo",诸:"zhū",左:"zuǒ",石:"shí",崔:"cuī",吉:"jí",钮:"niǔ",龚:"gōng",程:"chéng",嵇:"jī",邢:"xíng",滑:"huá",裴:"péi",陆:"lù",荣:"róng",翁:"wēng",荀:"xún",羊:"yáng",於:"yū",惠:"huì",甄:"zhēn",曲:"qū",家:"jiā",封:"fēng",芮:"ruì",羿:"yì",储:"chǔ",靳:"jìn",汲:"jí",邴:"bǐng",糜:"mí",松:"sōng",井:"jǐng",段:"duàn",富:"fù",巫:"wū",乌:"wū",焦:"jiāo",巴:"bā",弓:"gōng",牧:"mù",隗:"wěi",山:"shān",谷:"gǔ",车:"chē",侯:"hóu",宓:"mì",蓬:"péng",全:"quán",郗:"xī",班:"bān",仰:"yǎng",秋:"qiū",仲:"zhòng",伊:"yī",宫:"gōng",宁:"nìng",仇:"qiú",栾:"luán",暴:"bào",甘:"gān",钭:"tǒu",厉:"lì",戎:"róng",祖:"zǔ",武:"wǔ",符:"fú",刘:"liú",景:"jǐng",詹:"zhān",束:"shù",龙:"lóng",叶:"yè",幸:"xìng",司:"sī",韶:"sháo",郜:"gào",黎:"lí",蓟:"jì",薄:"bó",印:"yìn",宿:"sù",白:"bái",怀:"huái",蒲:"pú",邰:"tái",从:"cóng",鄂:"è",索:"suǒ",咸:"xián",籍:"jí",赖:"lài",卓:"zhuó",蔺:"lìn",屠:"tú",蒙:"méng",池:"chí",乔:"qiáo",阴:"yīn",鬱:"yù",胥:"xū",能:"nài",苍:"cāng",双:"shuāng",闻:"wén",莘:"shēn",党:"dǎng",翟:"zhái",谭:"tán",贡:"gòng",劳:"láo",逄:"páng",姬:"jī",申:"shēn",扶:"fú",堵:"dǔ",冉:"rǎn",宰:"zǎi",郦:"lì",雍:"yōng",郤:"xì",璩:"qú",桑:"sāng",桂:"guì",濮:"pú",牛:"niú",寿:"shòu",通:"tōng",边:"biān",扈:"hù",燕:"yān",冀:"jì",郏:"jiá",浦:"pǔ",尚:"shàng",农:"nóng",温:"wēn",别:"bié",庄:"zhuāng",晏:"yàn",柴:"chái",瞿:"qú",阎:"yán",充:"chōng",慕:"mù",连:"lián",茹:"rú",习:"xí",宦:"huàn",艾:"ài",鱼:"yú",容:"róng",向:"xiàng",古:"gǔ",易:"yì",慎:"shèn",戈:"gē",廖:"liào",庾:"yǔ",终:"zhōng",暨:"jì",居:"jū",衡:"héng",步:"bù",都:"dū",耿:"gěng",满:"mǎn",弘:"hóng",匡:"kuāng",国:"guó",文:"wén",寇:"kòu",广:"guǎng",禄:"lù",阙:"quē",东:"dōng",欧:"ōu",殳:"shū",沃:"wò",利:"lì",蔚:"wèi",越:"yuè",夔:"kuí",隆:"lóng",师:"shī",巩:"gǒng",厍:"shè",聂:"niè",晁:"cháo",勾:"gōu",敖:"áo",融:"róng",冷:"lěng",訾:"zī",辛:"xīn",阚:"kàn",那:"nā",简:"jiǎn",饶:"ráo",空:"kōng",曾:"zēng",母:"mǔ",沙:"shā",乜:"niè",养:"yǎng",鞠:"jū",须:"xū",丰:"fēng",巢:"cháo",关:"guān",蒯:"kuǎi",相:"xiàng",查:"zhā",后:"hòu",荆:"jīng",红:"hóng",游:"yóu",竺:"zhú",权:"quán",逯:"lù",盖:"gě",益:"yì",桓:"huán",公:"gōng",牟:"móu",哈:"hǎ",言:"yán",福:"fú",肖:"xiāo",区:"ōu",覃:"qín",朴:"piáo",繁:"pó",员:"yùn",句:"gōu",要:"yāo",过:"guō",钻:"zuān",谌:"chén",折:"shé",召:"shào",郄:"qiè",撒:"sǎ",甯:"nìng",六:"lù",啜:"chuài",行:"xíng"},jde=Object.keys(h6).map(e=>({zh:e,pinyin:h6[e],probability:1+Mu(e),length:Mu(e),priority:Cl.Surname,dict:Symbol("surname")})),PL={"bǎng páng pāng":["膀"],líng:["〇","伶","凌","刢","囹","坽","夌","姈","婈","孁","岺","彾","掕","昤","朎","柃","棂","櫺","欞","泠","淩","澪","灵","燯","爧","狑","玲","琌","瓴","皊","砱","祾","秢","竛","笭","紷","綾","绫","羐","羚","翎","聆","舲","苓","菱","蓤","蔆","蕶","蛉","衑","裬","詅","跉","軨","輘","酃","醽","鈴","錂","铃","閝","陵","零","霊","霗","霛","霝","靈","駖","魿","鯪","鲮","鴒","鸰","鹷","麢","齡","齢","龄","龗","㥄"],yī:["一","乊","伊","依","医","吚","咿","噫","壱","壹","夁","嫛","嬄","弌","揖","撎","檹","毉","洢","渏","漪","瑿","畩","祎","禕","稦","繄","蛜","衤","譩","辷","郼","醫","銥","铱","鷖","鹥","黟","黳"],"dīng zhēng":["丁"],"kǎo qiǎo yú":["丂"],qī:["七","倛","僛","凄","嘁","墄","娸","悽","慼","慽","戚","捿","柒","桤","桼","棲","榿","欺","沏","淒","漆","紪","緀","萋","褄","諆","迉","郪","鏚","霋","魌","鶈"],shàng:["丄","尙","尚","恦","緔","绱"],xià:["丅","下","乤","圷","夏","夓","懗","梺","疜","睱","罅","鎼","鏬"],hǎn:["丆","喊","浫","罕","豃","㘎"],"wàn mò":["万"],zhàng:["丈","仗","墇","嶂","帐","帳","幛","扙","杖","涱","痮","瘬","瘴","瞕","粀","胀","脹","賬","账","障"],sān:["三","厁","叁","弎","毵","毶","毿","犙","鬖"],"shàng shǎng shang":["上"],"qí jī":["丌","其","奇"],"bù fǒu":["不"],"yǔ yù yú":["与"],miǎn:["丏","偭","免","冕","勉","勔","喕","娩","愐","汅","沔","湎","睌","緬","缅","腼","葂","靦","鮸","𩾃"],gài:["丐","乢","匃","匄","戤","概","槩","槪","溉","漑","瓂","葢","鈣","钙","𬮿"],chǒu:["丑","丒","侴","吜","杽","瞅","矁","醜","魗"],zhuān:["专","叀","嫥","専","專","瑼","甎","砖","磗","磚","蟤","諯","鄟","顓","颛","鱄","䏝"],"qiě jū":["且"],pī:["丕","伓","伾","噼","坯","岯","憵","批","披","炋","狉","狓","砒","磇","礔","礕","秛","秠","耚","豾","邳","鈚","鉟","銔","錃","錍","霹","駓","髬","魾","𬳵"],shì:["世","丗","亊","事","仕","侍","冟","势","勢","卋","呩","嗜","噬","士","奭","嬕","室","市","式","弑","弒","恀","恃","戺","拭","揓","是","昰","枾","柿","栻","澨","烒","煶","眂","眎","眡","睗","示","礻","筮","簭","舐","舓","襫","視","视","觢","試","誓","諡","謚","试","谥","貰","贳","軾","轼","逝","遾","釈","释","釋","鈰","鉃","鉽","铈","飾","餙","餝","饰","鰘","䏡","𬤊"],qiū:["丘","丠","坵","媝","恘","恷","楸","秋","秌","穐","篍","緧","萩","蘒","蚯","蝵","蟗","蠤","趥","邱","鞦","鞧","鰌","鰍","鳅","鶖","鹙","龝"],bǐng:["丙","屛","怲","抦","昞","昺","柄","棅","炳","禀","秉","稟","苪","蛃","邴","鈵","陃","鞆","餅","餠","饼"],yè:["业","亱","僷","墷","夜","嶪","嶫","抴","捙","擛","擪","擫","晔","曄","曅","曗","曳","曵","枼","枽","業","洂","液","澲","烨","燁","爗","璍","皣","瞱","瞸","礏","腋","葉","謁","谒","邺","鄴","鍱","鐷","靥","靨","頁","页","餣","饁","馌","驜","鵺","鸈"],cóng:["丛","从","叢","婃","孮","従","徔","徖","悰","樷","欉","淙","灇","爜","琮","藂","誴","賨","賩","錝"],dōng:["东","倲","冬","咚","埬","岽","崬","徚","昸","東","氡","氭","涷","笗","苳","菄","蝀","鮗","鯟","鶇","鶫","鸫","鼕","𬟽"],sī:["丝","俬","凘","厮","司","咝","嘶","噝","媤","廝","恖","撕","斯","楒","泀","澌","燍","禗","禠","私","糹","絲","緦","纟","缌","罳","蕬","虒","蛳","蜤","螄","蟖","蟴","鉰","銯","鍶","鐁","锶","颸","飔","騦","鷥","鸶","鼶","㟃"],chéng:["丞","呈","城","埕","堘","塍","塖","宬","峸","惩","懲","成","承","挰","掁","揨","枨","棖","橙","檙","洆","溗","澂","珵","珹","畻","程","窚","筬","絾","脭","荿","誠","诚","郕","酲","鋮","铖","騬","鯎"],diū:["丟","丢","銩","铥"],liǎng:["両","两","兩","唡","啢","掚","緉","脼","蜽","裲","魉","魎","𬜯"],yǒu:["丣","卣","友","梄","湵","牖","禉","羑","聈","苃","莠","蜏","酉","銪","铕","黝"],yán:["严","厳","啱","喦","嚴","塩","壛","壧","妍","姸","娫","娮","岩","嵒","嵓","巌","巖","巗","延","揅","昖","楌","檐","櫩","欕","沿","炎","炏","狿","琂","盐","碞","筵","簷","莚","蔅","虤","蜒","言","訁","訮","詽","讠","郔","閆","閻","闫","阎","顏","顔","颜","鹽","麣","𫄧"],bìng:["並","併","倂","傡","垪","摒","栤","病","窉","竝","誁","靐","鮩"],"sàng sāng":["丧"],gǔn:["丨","惃","滚","滾","磙","緄","绲","蓘","蔉","衮","袞","輥","辊","鮌","鯀","鲧"],jiū:["丩","勼","啾","揪","揫","朻","究","糾","纠","萛","赳","阄","鬏","鬮","鳩","鸠"],"gè gě":["个","個","各"],yā:["丫","圧","孲","庘","押","枒","桠","椏","錏","鐚","鴉","鴨","鵶","鸦","鸭"],pán:["丬","媻","幋","槃","洀","瀊","爿","盘","盤","磐","縏","蒰","蟠","蹒","蹣","鎜","鞶"],"zhōng zhòng":["中"],jǐ:["丮","妀","己","戟","挤","掎","撠","擠","橶","泲","犱","脊","虮","蟣","魢","鱾","麂"],jiè:["丯","介","借","唶","堺","屆","届","岕","庎","徣","戒","楐","犗","玠","琾","界","畍","疥","砎","蚧","蛶","衸","褯","誡","诫","鎅","骱","魪"],fēng:["丰","仹","偑","僼","凨","凬","凮","妦","寷","封","峯","峰","崶","枫","楓","檒","沣","沨","渢","灃","烽","犎","猦","琒","疯","瘋","盽","砜","碸","篈","蘴","蜂","蠭","豐","鄷","酆","鋒","鎽","鏠","锋","霻","靊","飌","麷"],"guàn kuàng":["丱"],chuàn:["串","汌","玔","賗","釧","钏"],chǎn:["丳","产","冁","剷","囅","嵼","旵","浐","滻","灛","產","産","簅","蒇","蕆","諂","譂","讇","谄","鏟","铲","閳","闡","阐","骣","𬊤"],lín:["临","冧","壣","崊","嶙","斴","晽","暽","林","潾","瀶","燐","琳","璘","瞵","碄","磷","粦","粼","繗","翷","臨","轔","辚","遴","邻","鄰","鏻","阾","隣","霖","驎","鱗","鳞","麐","麟","𬴊","𬭸"],zhuó:["丵","劅","卓","啄","圴","妰","娺","撯","擆","擢","斫","斮","斱","斲","斵","晫","椓","浊","浞","濁","灼","烵","琸","硺","禚","窡","籗","籱","罬","茁","蠗","蠿","諁","諑","謶","诼","酌","鐲","镯","鵫","鷟","䓬","𬸦"],zhǔ:["丶","主","劯","嘱","囑","宔","帾","拄","渚","濐","煑","煮","燝","瞩","矚","罜","詝","陼","鸀","麈","𬣞"],bā:["丷","仈","八","叭","哵","夿","岜","巴","捌","朳","玐","疤","笆","粑","羓","芭","蚆","豝","釟"],wán:["丸","刓","完","岏","抏","捖","汍","烷","玩","琓","笂","紈","纨","翫","芄","貦","頑","顽"],dān:["丹","勯","匰","単","妉","媅","殚","殫","甔","眈","砃","箪","簞","耼","耽","聃","聸","褝","襌","躭","郸","鄲","酖","頕"],"wèi wéi":["为"],"jǐng dǎn":["丼"],"lì lí":["丽"],jǔ:["举","弆","挙","擧","椇","榉","榘","櫸","欅","矩","筥","聥","舉","莒","蒟","襷","踽","齟","龃"],piě:["丿","苤","鐅","𬭯"],fú:["乀","伏","俘","凫","刜","匐","咈","哹","垘","孚","岪","巿","帗","幅","幞","弗","彿","怫","扶","柫","栿","桴","氟","泭","浮","涪","澓","炥","玸","甶","畉","癁","祓","福","稪","符","箙","紱","紼","絥","綍","绂","绋","罘","罦","翇","艀","芙","芣","苻","茀","茯","菔","葍","虙","蚨","蜉","蝠","袚","袱","襆","襥","諨","豧","踾","輻","辐","郛","鉘","鉜","韍","韨","颫","髴","鮄","鮲","鳧","鳬","鴔","鵩","黻"],"yí jí":["乁"],yì:["乂","义","亄","亦","亿","伇","伿","佾","俋","億","兿","刈","劓","劮","勚","勩","匇","呓","呭","呹","唈","囈","圛","坄","垼","埸","奕","嫕","嬑","寱","屹","峄","嶧","帟","帠","幆","廙","异","弈","弋","役","忆","怈","怿","悒","意","憶","懌","懿","抑","挹","敡","易","晹","曀","曎","杙","枍","棭","榏","槸","檍","歝","殔","殪","殹","毅","浂","浥","浳","湙","溢","潩","澺","瀷","炈","焲","熠","熤","熼","燚","燡","燱","獈","玴","異","疫","痬","瘗","瘞","瘱","癔","益","瞖","穓","竩","篒","縊","繶","繹","绎","缢","義","羿","翊","翌","翳","翼","耴","肄","肊","膉","臆","艗","艺","芅","苅","萟","蓺","薏","藙","藝","蘙","虉","蜴","螠","衪","袣","裔","裛","褹","襼","訲","訳","詍","詣","誼","譯","議","讛","议","译","诣","谊","豙","豛","豷","貖","贀","跇","轶","逸","邑","鄓","醷","釴","鈠","鎰","鐿","镒","镱","阣","隿","霬","饐","駅","驛","驿","骮","鮨","鶂","鶃","鶍","鷁","鷊","鷧","鷾","鸃","鹝","鹢","黓","齸","𬬩","㑊","𫄷","𬟁"],nǎi:["乃","倷","奶","嬭","廼","氖","疓","艿","迺","釢"],wǔ:["乄","五","仵","伍","侮","倵","儛","午","啎","妩","娬","嫵","庑","廡","忤","怃","憮","摀","武","潕","熓","牾","玝","珷","瑦","甒","碔","舞","躌","迕","逜","陚","鵡","鹉","𣲘"],jiǔ:["久","乆","九","乣","奺","杦","汣","灸","玖","紤","舏","酒","镹","韭","韮"],"tuō zhé":["乇","杔","馲"],"me mó ma yāo":["么"],zhī:["之","倁","卮","巵","搘","支","栀","梔","椥","榰","汁","泜","疷","祗","祬","秓","稙","綕","肢","胑","胝","脂","芝","蘵","蜘","衼","隻","鳷","鴲","鼅","𦭜"],"wū wù":["乌"],zhà:["乍","咤","宱","搾","榨","溠","痄","蚱","詐","诈","醡","霅","䃎"],hū:["乎","乯","匢","匫","呼","唿","嘑","垀","寣","幠","忽","惚","昒","歑","泘","淴","滹","烀","苸","虍","虖","謼","軤","轷","雐"],fá:["乏","伐","傠","坺","垡","墢","姂","栰","浌","瞂","笩","筏","罚","罰","罸","藅","閥","阀"],"lè yuè yào lào":["乐","樂"],yín:["乑","吟","噖","嚚","圁","垠","夤","婬","寅","峾","崟","崯","檭","殥","泿","淫","滛","烎","犾","狺","璌","硍","碒","荶","蔩","訔","訚","訡","誾","鄞","鈝","銀","银","霪","鷣","齦"],pīng:["乒","俜","娉","涄","甹","砯","聠","艵","頩"],pāng:["乓","滂","胮","膖","雱","霶"],qiáo:["乔","侨","僑","嫶","憔","桥","槗","樵","橋","櫵","犞","瞧","硚","礄","荍","荞","蕎","藮","譙","趫","鐈","鞒","鞽","顦"],hǔ:["乕","琥","萀","虎","虝","錿","鯱"],guāi:["乖"],"chéng shèng":["乗","乘","娍"],yǐ:["乙","乛","以","倚","偯","嬟","崺","已","庡","扆","攺","敼","旑","旖","檥","矣","礒","笖","舣","艤","苡","苢","蚁","螘","蟻","裿","踦","輢","轙","逘","酏","釔","鈘","鉯","钇","顗","鳦","齮","𫖮","𬺈"],"háo yǐ":["乚"],"niè miē":["乜"],qǐ:["乞","企","启","唘","啓","啔","啟","婍","屺","杞","棨","玘","盀","綺","绮","芑","諬","起","邔","闙"],yě:["也","冶","嘢","埜","壄","漜","野"],xí:["习","喺","媳","嶍","席","椺","檄","漝","習","蓆","袭","襲","覡","觋","謵","趘","郋","鎴","隰","霫","飁","騱","騽","驨","鰼","鳛","𠅤","𫘬"],xiāng:["乡","厢","廂","忀","楿","欀","湘","瓖","稥","箱","緗","缃","膷","芗","萫","葙","薌","襄","郷","鄉","鄊","鄕","鑲","镶","香","驤","骧","鱜","麘","𬙋"],shū:["书","倏","倐","儵","叔","姝","尗","抒","掓","摅","攄","書","枢","梳","樞","殊","殳","毹","毺","淑","瀭","焂","疎","疏","紓","綀","纾","舒","菽","蔬","踈","軗","輸","输","鄃","陎","鮛","鵨"],dǒu:["乧","抖","枓","蚪","鈄","阧","陡"],shǐ:["乨","使","兘","史","始","宩","屎","榁","矢","笶","豕","鉂","駛","驶"],jī:["乩","僟","击","刉","刏","剞","叽","唧","喞","嗘","嘰","圾","基","墼","姬","屐","嵆","嵇","撃","擊","朞","机","枅","樭","機","毄","激","犄","玑","璣","畸","畿","癪","矶","磯","积","積","笄","筓","箕","簊","緁","羁","羇","羈","耭","肌","芨","虀","覉","覊","譏","譤","讥","賫","賷","赍","跻","踑","躋","躸","銈","錤","鐖","鑇","鑙","隮","雞","鞿","韲","飢","饑","饥","魕","鳮","鶏","鶺","鷄","鸄","鸡","齎","齏","齑","𬯀","𫓯","𫓹","𫌀"],náng:["乪","嚢","欜","蠰","饢"],jiā:["乫","佳","傢","加","嘉","抸","枷","梜","毠","泇","浃","浹","犌","猳","珈","痂","笳","糘","耞","腵","葭","袈","豭","貑","跏","迦","鉫","鎵","镓","鴐","麚","𬂩"],jù:["乬","倨","倶","具","剧","劇","勮","埧","埾","壉","姖","屦","屨","岠","巨","巪","怇","惧","愳","懅","懼","拒","拠","昛","歫","洰","澽","炬","烥","犋","秬","窭","窶","簴","粔","耟","聚","虡","蚷","詎","讵","豦","距","踞","躆","遽","邭","醵","鉅","鐻","钜","颶","飓","駏","鮔"],shí:["乭","十","埘","塒","姼","实","実","寔","實","峕","嵵","时","旹","時","榯","湜","溡","炻","祏","竍","蚀","蝕","辻","遈","鉐","飠","饣","鮖","鰣","鲥","鼫","鼭"],mǎo:["乮","冇","卯","峁","戼","昴","泖","笷","蓩","鉚","铆"],mǎi:["买","嘪","荬","蕒","買","鷶"],luàn:["乱","亂","釠"],rǔ:["乳","擩","汝","肗","辱","鄏"],xué:["乴","学","學","峃","嶨","斈","泶","澩","燢","穴","茓","袕","踅","鷽","鸴"],yǎn:["䶮","乵","俨","偃","儼","兖","兗","厣","厴","噞","孍","嵃","巘","巚","弇","愝","戭","扊","抁","掩","揜","曮","椼","檿","沇","渷","演","琰","甗","眼","罨","萒","蝘","衍","褗","躽","遃","郾","隒","顩","魇","魘","鰋","鶠","黡","黤","黬","黭","黶","鼴","鼹","齴","龑","𬸘","𬙂","𪩘"],fǔ:["乶","俌","俛","俯","府","弣","抚","拊","撫","斧","椨","滏","焤","甫","盙","簠","腐","腑","蜅","輔","辅","郙","釜","釡","阝","頫","鬴","黼","㕮","𫖯"],shā:["乷","唦","杀","桬","殺","毮","猀","痧","砂","硰","紗","繺","纱","蔱","裟","鎩","铩","閷","髿","魦","鯊","鯋","鲨"],nǎ:["乸","雫"],qián:["乹","亁","仱","偂","前","墘","媊","岒","拑","掮","榩","橬","歬","潛","潜","濳","灊","箝","葥","虔","軡","鈐","鉗","銭","錢","鎆","钤","钱","钳","靬","騚","騝","鰬","黔","黚"],suǒ:["乺","唢","嗩","所","暛","溑","溹","琐","琑","瑣","索","褨","鎖","鎻","鏁","锁"],yú:["乻","于","亐","伃","余","堣","堬","妤","娛","娯","娱","嬩","崳","嵎","嵛","愚","扵","揄","旟","楡","楰","榆","欤","歈","歟","歶","渔","渝","湡","漁","澞","牏","狳","玗","玙","瑜","璵","盂","睮","窬","竽","籅","羭","腴","臾","舁","舆","艅","茰","萮","萸","蕍","蘛","虞","虶","蝓","螸","衧","褕","覦","觎","諛","謣","谀","踰","輿","轝","逾","邘","酑","鍝","隅","雓","雩","餘","馀","騟","骬","髃","魚","魣","鮽","鯲","鰅","鱼","鷠","鸆","齵"],zhù:["乼","伫","佇","住","坾","墸","壴","嵀","拀","杼","柱","樦","殶","注","炷","疰","眝","祝","祩","竚","筯","箸","篫","簗","紵","紸","纻","羜","翥","苎","莇","蛀","註","貯","贮","跓","軴","鉒","鋳","鑄","铸","馵","駐","驻"],zhě:["乽","者","褶","襵","赭","踷","鍺","锗"],"qián gān":["乾"],"zhì luàn":["乿"],guī:["亀","圭","妫","媯","嫢","嬀","帰","归","摫","椝","槻","槼","櫷","歸","珪","瑰","璝","瓌","皈","瞡","硅","茥","蘬","規","规","邽","郌","閨","闺","騩","鬶","鬹"],"lǐn lìn":["亃"],jué:["亅","决","刔","劂","匷","厥","噊","孒","孓","崛","崫","嶥","彏","憠","憰","戄","抉","挗","掘","攫","桷","橛","橜","欮","氒","決","灍","焳","熦","爑","爴","爵","獗","玃","玦","玨","珏","瑴","瘚","矍","矡","砄","絕","絶","绝","臄","芵","蕝","蕨","虳","蟨","蟩","觖","觮","觼","訣","譎","诀","谲","貜","赽","趉","蹷","躩","鈌","鐍","鐝","钁","镢","鴂","鴃","鷢","𫘝","㵐","𫔎"],"le liǎo":["了"],"gè mā":["亇"],"yǔ yú":["予","懙"],zhēng:["争","佂","凧","姃","媜","峥","崝","崢","征","徰","炡","烝","爭","狰","猙","癥","眐","睁","睜","筝","箏","篜","聇","脀","蒸","踭","鉦","錚","鏳","鬇"],èr:["二","刵","咡","弍","弐","樲","誀","貮","貳","贰","髶"],chù:["亍","傗","儊","怵","憷","搐","斶","歜","珿","琡","矗","竌","絀","绌","臅","触","觸","豖","鄐","閦","黜"],kuī:["亏","刲","岿","巋","盔","窥","窺","聧","虧","闚","顝"],yún:["云","伝","勻","匀","囩","妘","愪","抣","昀","橒","沄","涢","溳","澐","熉","畇","秐","筼","篔","紜","縜","纭","耘","芸","蒷","蕓","郧","鄖","鋆","雲"],hù:["互","冱","嗀","嚛","婟","嫭","嫮","岵","帍","弖","怙","戶","户","戸","戽","扈","护","昈","槴","沍","沪","滬","熩","瓠","祜","笏","簄","粐","綔","蔰","護","豰","鄠","鍙","頀","鱯","鳠","鳸","鸌","鹱"],qí:["亓","剘","埼","岐","岓","崎","嵜","愭","掑","斉","斊","旂","旗","棊","棋","檱","櫀","歧","淇","濝","猉","玂","琦","琪","璂","畦","疧","碁","碕","祁","祈","祺","禥","竒","簯","簱","籏","粸","綥","綦","肵","脐","臍","艩","芪","萁","萕","蕲","藄","蘄","蚑","蚚","蛴","蜝","蜞","螧","蠐","褀","軝","鄿","釮","錡","锜","陭","頎","颀","騎","騏","騹","骐","骑","鬐","鬿","鯕","鰭","鲯","鳍","鵸","鶀","麒","麡","𨙸","𬨂","䓫"],jǐng:["井","儆","刭","剄","坓","宑","幜","憬","暻","殌","汫","汬","澋","璄","璟","璥","穽","肼","蟼","警","阱","頚","頸"],sì:["亖","佀","価","儩","兕","嗣","四","姒","娰","孠","寺","巳","柶","榹","汜","泗","泤","洍","洠","涘","瀃","牭","祀","禩","竢","笥","耜","肂","肆","蕼","覗","貄","釲","鈶","鈻","飤","飼","饲","駟","騃","驷"],suì:["亗","嬘","岁","嵗","旞","檖","歲","歳","澻","煫","燧","璲","砕","碎","祟","禭","穂","穗","穟","繀","繐","繸","襚","誶","譢","谇","賥","邃","鐆","鐩","隧","韢","𫟦","𬭼"],gèn:["亘","亙","揯","搄","茛"],yà:["亚","亜","俹","冴","劜","圔","圠","埡","娅","婭","揠","氩","氬","犽","砑","稏","聐","襾","覀","訝","讶","迓","齾"],"xiē suò":["些"],"qí zhāi":["亝","齊"],"yā yà":["亞","压","垭","壓","铔"],"jí qì":["亟","焏"],tóu:["亠","投","頭","骰"],"wáng wú":["亡"],"kàng háng gāng":["亢"],dà:["亣","眔"],jiāo:["交","僬","娇","嬌","峧","嶕","嶣","憍","椒","浇","澆","焦","礁","穚","簥","胶","膠","膲","茭","茮","蕉","虠","蛟","蟭","跤","轇","郊","鐎","驕","骄","鮫","鲛","鵁","鷦","鷮","鹪","䴔"],hài:["亥","嗐","害","氦","餀","饚","駭","駴","骇"],"hēng pēng":["亨"],mǔ:["亩","姆","峔","拇","母","牡","牳","畂","畆","畒","畝","畞","畮","砪","胟","踇","鉧","𬭁","𧿹"],ye:["亪"],xiǎng:["享","亯","响","想","晑","蚃","蠁","響","飨","餉","饗","饷","鮝","鯗","鱶","鲞"],jīng:["京","亰","兢","坕","坙","婛","惊","旌","旍","晶","橸","泾","涇","猄","睛","秔","稉","粳","精","経","經","綡","聙","腈","茎","荆","荊","菁","葏","驚","鯨","鲸","鶁","鶄","麖","麠","鼱","䴖"],tíng:["亭","停","婷","嵉","庭","廷","楟","榳","筳","聤","莛","葶","蜓","蝏","諪","邒","霆","鼮","䗴"],liàng:["亮","喨","悢","晾","湸","諒","谅","輌","輛","辆","鍄"],"qīn qìng":["亲","親"],bó:["亳","仢","侼","僰","博","帛","愽","懪","挬","搏","欂","浡","淿","渤","煿","牔","狛","瓝","礴","秡","箔","簙","糪","胉","脖","膊","舶","艊","萡","葧","袯","襏","襮","謈","踣","郣","鈸","鉑","鋍","鎛","鑮","钹","铂","镈","餺","馎","馛","馞","駁","駮","驳","髆","鵓","鹁"],yòu:["亴","佑","佦","侑","又","右","哊","唀","囿","姷","宥","峟","幼","狖","祐","蚴","誘","诱","貁","迶","酭","釉","鼬"],xiè:["亵","伳","偞","偰","僁","卨","卸","噧","塮","夑","媟","屑","屧","廨","徢","懈","暬","械","榍","榭","泻","洩","渫","澥","瀉","瀣","灺","炧","炨","燮","爕","獬","祄","禼","糏","紲","絏","絬","繲","纈","绁","缷","薢","薤","蟹","蠏","褉","褻","謝","谢","躞","邂","靾","韰","齂","齘","齛","齥","𬹼","𤫉"],"dǎn dàn":["亶","馾"],lián:["亷","劆","匲","匳","嗹","噒","奁","奩","嫾","帘","廉","怜","憐","涟","漣","濂","濓","瀮","熑","燫","簾","籢","籨","縺","翴","联","聨","聫","聮","聯","臁","莲","蓮","薕","螊","蠊","裢","褳","覝","謰","蹥","连","連","鎌","鐮","镰","鬑","鰱","鲢"],duǒ:["亸","哚","嚲","埵","崜","朵","朶","綞","缍","趓","躱","躲","軃"],"wěi mén":["亹","斖"],rén:["人","亻","仁","壬","忈","忎","朲","秂","芢","魜","鵀"],jí:["亼","亽","伋","佶","偮","卙","即","卽","及","叝","吉","堲","塉","姞","嫉","岌","嵴","嶯","彶","忣","急","愱","戢","揤","极","棘","楫","極","槉","檝","殛","汲","湒","潗","疾","瘠","皍","笈","箿","籍","級","级","膌","艥","蒺","蕀","蕺","蝍","螏","襋","觙","谻","踖","蹐","躤","輯","轚","辑","郆","銡","鍓","鏶","集","雧","霵","鹡","㴔"],wáng:["亾","仼","兦","莣","蚟"],"shén shí":["什"],lè:["仂","叻","忇","氻","泐","玏","砳","簕","艻","阞","韷","餎","鰳","鱳","鳓"],dīng:["仃","叮","帄","玎","疔","盯","耵","虰","靪"],zè:["仄","崱","庂","捑","昃","昗","汄"],"jǐn jìn":["仅","僅","嫤"],"pú pū":["仆"],"chóu qiú":["仇"],zhǎng:["仉","幥","掌","礃"],jīn:["今","堻","巾","惍","斤","津","珒","琻","璡","砛","筋","荕","衿","襟","觔","金","釒","釿","钅","鹶","黅","𬬱"],bīng:["仌","仒","兵","冫","冰","掤","氷","鋲"],réng:["仍","礽","芿","辸","陾"],fó:["仏","坲","梻"],"jīn sǎn":["仐"],lún:["仑","伦","侖","倫","囵","圇","婨","崘","崙","棆","沦","淪","磮","腀","菕","蜦","踚","輪","轮","錀","陯","鯩","𬬭"],cāng:["仓","仺","倉","凔","嵢","沧","滄","濸","獊","舱","艙","苍","蒼","螥","鸧"],"zǎi zǐ zī":["仔"],tā:["他","塌","它","榙","溻","牠","祂","褟","趿","遢","闧"],fù:["付","偩","傅","冨","副","咐","坿","复","妇","婦","媍","嬔","富","復","椱","祔","禣","竎","緮","縛","缚","腹","萯","蕧","蚹","蛗","蝜","蝮","袝","複","覄","覆","訃","詂","讣","負","賦","賻","负","赋","赙","赴","輹","鍑","鍢","阜","附","馥","駙","驸","鮒","鰒","鲋","鳆","㳇"],xiān:["仙","仚","佡","僊","僲","先","嘕","奾","屳","廯","忺","憸","掀","暹","杴","氙","珗","祆","秈","籼","繊","纎","纖","苮","褼","襳","跹","蹮","躚","酰","鍁","锨","韯","韱","馦","鱻","鶱","𬸣"],"tuō chà duó":["仛"],hóng:["仜","吰","垬","妅","娂","宏","宖","弘","彋","汯","泓","洪","浤","渱","潂","玒","玜","竑","竤","篊","粠","紘","紭","綋","纮","翃","翝","耾","苰","荭","葒","葓","谹","谼","鈜","鉷","鋐","閎","闳","霐","霟","鞃","魟","鴻","鸿","黉","黌","𫟹","𬭎"],tóng:["仝","佟","哃","峂","峝","庝","彤","晍","曈","桐","氃","浵","潼","犝","獞","眮","瞳","砼","秱","童","粡","膧","茼","蚒","詷","赨","酮","鉖","鉵","銅","铜","餇","鮦","鲖","𫍣","𦒍"],rèn:["仞","仭","刃","刄","妊","姙","屻","岃","扨","牣","祍","紉","紝","絍","纫","纴","肕","腍","衽","袵","訒","認","认","讱","軔","轫","鈓","靭","靱","韌","韧","飪","餁","饪"],qiān:["仟","佥","僉","千","圲","奷","孯","岍","悭","愆","慳","扦","拪","搴","撁","攐","攑","攓","杄","櫏","汘","汧","牵","牽","竏","签","簽","籖","籤","粁","芊","茾","蚈","褰","諐","謙","谦","谸","迁","遷","釺","鈆","鉛","鏲","钎","阡","韆","顅","騫","骞","鬜","鬝","鵮","鹐"],"gǎn hàn":["仠"],"yì gē":["仡"],dài:["代","侢","叇","垈","埭","岱","帒","带","帯","帶","廗","怠","戴","曃","柋","殆","瀻","玳","瑇","甙","簤","紿","緿","绐","艜","蝳","袋","襶","貣","贷","蹛","軑","軚","軩","轪","迨","霴","靆","鴏","黛","黱"],"lìng líng lǐng":["令"],chào:["仦","耖","觘"],"cháng zhǎng":["仧","兏","長","长"],sā:["仨"],cháng:["仩","偿","償","嘗","嚐","嫦","尝","常","徜","瑺","瓺","甞","肠","腸","膓","苌","萇","镸","鱨","鲿"],yí:["仪","侇","儀","冝","匜","咦","圯","夷","姨","宐","宜","宧","寲","峓","嶬","嶷","巸","彛","彜","彝","彞","怡","恞","扅","暆","栘","椬","椸","沂","洟","熪","瓵","痍","移","簃","籎","羠","胰","萓","蛦","螔","觺","謻","貽","贻","跠","迻","遺","鏔","頉","頤","頥","顊","颐","饴","鮧","鴺"],mù:["仫","凩","募","墓","幕","幙","慔","慕","暮","暯","木","楘","毣","沐","炑","牧","狇","目","睦","穆","艒","苜","莯","蚞","鉬","钼","雮","霂"],"men mén":["们"],fǎn:["仮","反","橎","返"],"chào miǎo":["仯"],"yǎng áng":["仰"],zhòng:["仲","众","堹","妕","媑","狆","眾","祌","筗","茽","蚛","衆","衶","諥"],"pǐ pí":["仳"],wò:["仴","偓","卧","媉","幄","握","楃","沃","渥","濣","瓁","瞃","硪","肟","腛","臥","齷","龌"],jiàn:["件","俴","健","僭","剑","剣","剱","劍","劎","劒","劔","墹","寋","建","徤","擶","旔","楗","毽","洊","涧","澗","牮","珔","瞷","磵","礀","箭","糋","繝","腱","臶","舰","艦","荐","薦","覸","諓","諫","譛","谏","賎","賤","贱","趝","践","踐","踺","轞","鉴","鍳","鍵","鐱","鑑","鑒","鑬","鑳","键","間","餞","饯","𬣡"],"jià jiè jie":["价"],"yǎo fó":["仸"],"rèn rén":["任"],"fèn bīn":["份"],dī:["仾","低","啲","埞","堤","岻","彽","樀","滴","磾","秪","羝","袛","趆","隄","鞮","䃅"],fǎng:["仿","倣","旊","昉","昘","瓬","眆","紡","纺","舫","訪","访","髣","鶭"],zhōng:["伀","刣","妐","幒","彸","忠","柊","汷","泈","炂","盅","籦","終","终","舯","蔠","蜙","螤","螽","衳","衷","蹱","鈡","鍾","鐘","钟","锺","鴤","鼨"],pèi:["伂","佩","姵","帔","斾","旆","沛","浿","珮","蓜","轡","辔","配","霈","馷"],diào:["伄","吊","弔","掉","瘹","盄","窎","窵","竨","訋","釣","鈟","銱","鋽","鑃","钓","铞","雿","魡"],dùn:["伅","潡","炖","燉","盾","砘","碷","踲","逇","遁","遯","鈍","钝"],wěn:["伆","刎","吻","呅","抆","桽","稳","穏","穩","紊","肳","脗"],xǐn:["伈"],kàng:["伉","匟","囥","抗","炕","鈧","钪"],ài:["伌","僾","塧","壒","嫒","嬡","愛","懓","暧","曖","爱","瑷","璦","皧","瞹","砹","硋","碍","礙","薆","譺","賹","鑀","隘","靉","餲","馤","鱫","鴱"],"jì qí":["伎","薺"],"xiū xǔ":["休"],"jìn yín":["伒"],dǎn:["伔","刐","撢","玬","瓭","紞","胆","膽","衴","賧","赕","黕","𬘘"],fū:["伕","呋","娐","孵","尃","怤","懯","敷","旉","玞","砆","稃","筟","糐","綒","肤","膚","荂","荴","衭","趺","跗","邞","鄜","酜","鈇","麩","麬","麱","麸","𫓧"],tǎng:["伖","傥","儻","埫","戃","曭","爣","矘","躺","鎲","钂","镋"],yōu:["优","優","呦","嚘","峳","幽","忧","悠","憂","攸","櫌","滺","瀀","纋","羪","耰","逌","鄾","麀"],huǒ:["伙","夥","火","煷","邩","鈥","钬"],"huì kuài":["会","會","浍","璯"],yǔ:["伛","俁","俣","偊","傴","匬","噳","圄","圉","宇","寙","屿","嶼","庾","挧","敔","斞","楀","瑀","瘐","祤","禹","穥","窳","羽","與","萭","貐","鄅","頨","麌","齬","龉","㺄"],cuì:["伜","啛","忰","悴","毳","淬","焠","疩","瘁","竁","粋","粹","紣","綷","翆","翠","脃","脆","脺","膬","膵","臎","萃","襊","顇"],sǎn:["伞","傘","糤","繖","饊","馓"],wěi:["伟","伪","偉","偽","僞","儰","娓","寪","屗","崣","嶉","徫","愇","捤","暐","梶","洧","浘","渨","炜","煒","猥","玮","瑋","痿","緯","纬","腲","艉","芛","苇","荱","萎","葦","蒍","蔿","蜼","諉","诿","踓","鍡","韑","韙","韡","韪","頠","颹","骩","骪","骫","鮪","鲔","𫇭","𬀩","𬱟"],"chuán zhuàn":["传","傳"],"chē jū":["伡","俥","车"],"jū chē":["車"],yá:["伢","厑","厓","堐","岈","崕","崖","涯","漄","牙","玡","琊","睚","笌","芽","蚜","衙","齖"],qiàn:["伣","俔","倩","儙","刋","壍","嬱","悓","棈","椠","槧","欠","歉","皘","篏","篟","縴","芡","蒨","蔳","輤","𬘬"],shāng:["伤","傷","商","墒","慯","殇","殤","滳","漡","熵","蔏","螪","觞","觴","謪","鬺"],chāng:["伥","倀","娼","昌","椙","淐","猖","琩","菖","裮","錩","锠","閶","阊","鯧","鲳","鼚"],"chen cāng":["伧"],xùn:["伨","侚","卂","噀","巺","巽","徇","愻","殉","殾","汛","潠","狥","蕈","訊","訓","訙","训","讯","迅","迿","逊","遜","鑂","顨","馴","驯"],xìn:["伩","囟","孞","脪","舋","衅","訫","釁","阠","顖"],chǐ:["伬","侈","卶","叺","呎","垑","恥","歯","耻","肔","胣","蚇","裭","褫","豉","鉹","齒","齿"],"xián xuán":["伭"],"nú nǔ":["伮"],"bó bǎi":["伯"],"gū gù":["估"],nǐ:["伱","你","儞","孴","拟","擬","旎","晲","狔","苨","薿","隬"],"nì ní":["伲"],bàn:["伴","办","半","姅","怑","扮","瓣","秚","絆","绊","辦","鉡","靽"],xù:["伵","侐","勖","勗","卹","叙","垿","壻","婿","序","恤","敍","敘","旭","昫","朂","槒","欰","殈","汿","沀","洫","溆","漵","潊","烅","烼","煦","獝","珬","盢","瞁","稸","絮","続","緒","緖","續","绪","续","聓","聟","蓄","藚","訹","賉","酗","頊","鱮","㳚"],zhòu:["伷","僽","冑","呪","咒","咮","宙","昼","晝","甃","皱","皺","籀","籒","籕","粙","紂","縐","纣","绉","胄","荮","葤","詋","酎","駎","驟","骤","㤘","㑇"],shēn:["伸","侁","兟","呻","堔","妽","娠","屾","峷","扟","敒","曑","柛","氠","深","燊","珅","甡","甧","申","眒","砷","穼","籶","籸","糂","紳","绅","罙","罧","葠","蓡","蔘","薓","裑","訷","詵","诜","身","駪","鯓","鯵","鰺","鲹","鵢","𬳽"],qū:["伹","佉","匤","呿","坥","屈","岖","岴","嶇","憈","抾","敺","浀","煀","祛","筁","粬","胠","蛆","蛐","袪","覻","詘","诎","趍","躯","軀","阹","駆","駈","驅","驱","髷","魼","鰸","鱋","鶌","麯","麴","麹","黢","㭕","𪨰","䓛"],"sì cì":["伺"],bēng:["伻","嘣","奟","崩","嵭","閍"],"sì shì":["似"],"jiā qié gā":["伽"],"yǐ chì":["佁"],"diàn tián":["佃","钿"],"hān gàn":["佄"],mài:["佅","劢","勱","卖","唛","売","脈","衇","賣","迈","邁","霡","霢","麥","麦","鿏"],dàn:["但","僤","啖","啗","啿","噉","嚪","帎","憺","旦","柦","氮","沊","泹","淡","狚","疍","癚","禫","窞","腅","萏","蓞","蛋","蜑","觛","訑","誕","诞","贉","霮","餤","饏","駳","髧","鴠","𫢸"],bù:["佈","勏","吥","咘","埗","埠","布","廍","怖","悑","步","歨","歩","瓿","篰","荹","蔀","踄","部","郶","鈈","钚","餢"],bǐ:["佊","俾","匕","夶","妣","彼","朼","柀","比","毞","沘","疕","秕","笔","筆","粃","聛","舭","貏","鄙"],"zhāo shào":["佋"],cǐ:["佌","此","泚","皉","𫚖"],wèi:["位","卫","味","喂","墛","媦","慰","懀","未","渭","煟","熭","犚","猬","畏","緭","罻","胃","苿","菋","藯","蘶","蝟","螱","衛","衞","褽","謂","讆","讏","谓","躗","躛","軎","轊","鏏","霨","餧","餵","饖","魏","鮇","鳚"],zuǒ:["佐","左","繓"],yǎng:["佒","傟","养","坱","岟","慃","懩","攁","氧","氱","炴","痒","癢","礢","紻","蝆","軮","養","駚"],"tǐ tī":["体","體"],zhàn:["佔","偡","嶘","战","戦","戰","栈","桟","棧","湛","站","綻","绽","菚","蘸","虥","虦","譧","轏","驏"],"hé hē hè":["何"],bì:["佖","咇","哔","嗶","坒","堛","壁","奰","妼","婢","嬖","币","幣","幤","庇","庳","廦","弊","弻","弼","彃","必","怭","愊","愎","敝","斃","梐","毕","毖","毙","湢","滗","滭","潷","煏","熚","狴","獘","獙","珌","璧","畀","畢","疪","痹","痺","皕","睤","碧","筚","箅","箆","篦","篳","粊","綼","縪","繴","罼","腷","苾","荜","萆","萞","蓖","蓽","蔽","薜","蜌","袐","襅","襞","襣","觱","詖","诐","貱","贔","赑","跸","蹕","躃","躄","避","邲","鄨","鄪","鉍","鏎","鐴","铋","閇","閉","閟","闭","陛","韠","飶","饆","馝","駜","驆","髀","魓","鮅","鷝","鷩","鼊"],tuó:["佗","坨","堶","岮","槖","橐","沱","砣","砤","碢","紽","詑","跎","酡","阤","陀","陁","駝","駞","騨","驒","驝","驼","鮀","鴕","鸵","鼉","鼍","鼧","𬶍"],shé:["佘","舌","虵","蛥"],"yì dié":["佚","昳","泆","軼"],"fó fú bì bó":["佛"],"zuò zuō":["作"],gōu:["佝","沟","溝","痀","篝","簼","緱","缑","袧","褠","鈎","鉤","钩","鞲","韝"],nìng:["佞","侫","倿","寕","泞","澝","濘"],qú:["佢","劬","戵","斪","欋","欔","氍","淭","灈","爠","璖","璩","癯","磲","籧","絇","胊","臞","菃","葋","蕖","蘧","蟝","蠷","蠼","衐","衢","躣","軥","鑺","鴝","鸜","鸲","鼩"],"yōng yòng":["佣"],wǎ:["佤","咓","砙","邷"],kǎ:["佧","垰","胩","裃","鉲"],bāo:["佨","勹","包","孢","煲","笣","胞","苞","蕔","裦","褒","襃","闁","齙","龅"],"huái huí":["佪"],"gé hè":["佫"],lǎo:["佬","咾","恅","栳","狫","珯","硓","老","耂","荖","蛯","轑","銠","铑","鮱"],xiáng:["佭","庠","栙","祥","絴","翔","詳","跭"],gé:["佮","匌","呄","嗝","塥","愅","挌","搿","槅","櫊","滆","膈","臵","茖","觡","諽","輵","轕","閣","阁","隔","鞷","韐","韚","騔","骼","鮯"],yáng:["佯","劷","垟","崸","徉","扬","揚","敭","旸","昜","暘","杨","楊","洋","炀","珜","疡","瘍","眻","蛘","諹","輰","鍚","钖","阦","阳","陽","霷","颺","飏","鰑","鴹","鸉"],bǎi:["佰","捭","摆","擺","栢","百","竡","粨","襬"],fǎ:["佱","峜","法","灋","砝","鍅"],mǐng:["佲","凕","姳","慏","酩"],"èr nài":["佴"],hěn:["佷","很","狠","詪","𬣳"],huó:["佸","活"],guǐ:["佹","匦","匭","厬","垝","姽","宄","庋","庪","恑","晷","湀","癸","祪","簋","蛫","蟡","觤","詭","诡","軌","轨","陒","鬼"],quán:["佺","全","啳","埢","姾","峑","巏","拳","搼","权","楾","権","權","泉","洤","湶","牷","犈","瑔","痊","硂","筌","縓","荃","葲","蜷","蠸","觠","詮","诠","跧","踡","輇","辁","醛","銓","铨","闎","顴","颧","駩","騡","鬈","鰁","鳈","齤"],tiāo:["佻","庣","旫","祧","聎"],jiǎo:["佼","儌","孂","挢","搅","撟","撹","攪","敫","敽","敿","晈","暞","曒","灚","燞","狡","璬","皎","皦","絞","纐","绞","腳","臫","蟜","譑","賋","踋","鉸","铰","餃","饺","鱎","龣"],cì:["佽","刾","庛","朿","栨","次","絘","茦","莿","蛓","螆","賜","赐"],xíng:["侀","刑","哘","型","娙","形","洐","硎","蛵","邢","郉","鈃","鉶","銒","钘","铏","陉","陘","餳","𫰛"],tuō:["侂","咃","咜","圫","托","拕","拖","汑","脫","脱","莌","袥","託","讬","飥","饦","魠","鮵"],kǎn:["侃","偘","冚","坎","惂","砍","莰","輡","轗","顑"],zhí:["侄","値","值","埴","執","姪","嬂","戠","执","摭","植","樴","淔","漐","直","禃","絷","縶","聀","职","職","膱","蟙","跖","踯","蹠","躑","軄","釞","馽"],gāi:["侅","垓","姟","峐","晐","畡","祴","荄","該","该","豥","賅","賌","赅","陔"],lái:["來","俫","倈","崃","崍","庲","来","梾","棶","涞","淶","猍","琜","筙","箂","莱","萊","逨","郲","錸","铼","騋","鯠","鶆","麳"],kuǎ:["侉","咵","垮","銙"],gōng:["侊","公","功","匑","匔","塨","宫","宮","工","幊","弓","恭","攻","杛","碽","糼","糿","肱","觥","觵","躬","躳","髸","龔","龚","䢼"],lì:["例","俐","俪","傈","儮","儷","凓","利","力","励","勵","历","厉","厤","厯","厲","叓","吏","呖","唎","唳","嚦","囇","坜","塛","壢","娳","婯","屴","岦","悧","悷","慄","戾","搮","暦","曆","曞","朸","枥","栃","栗","栛","檪","櫔","櫪","欐","歴","歷","沥","沴","涖","溧","濿","瀝","爏","犡","猁","珕","瑮","瓅","瓑","瓥","疬","痢","癧","盭","睙","砅","砺","砾","磿","礪","礫","礰","禲","秝","立","笠","篥","粒","粝","糲","脷","苈","茘","荔","莅","莉","蒚","蒞","藶","蚸","蛎","蛠","蜧","蝷","蠇","蠣","詈","讈","赲","轢","轣","轹","酈","鉝","隶","隷","雳","靂","靋","鬁","鳨","鴗","鷅","麜","𫵷","𬍛"],yīn:["侌","凐","喑","噾","囙","因","垔","堙","姻","婣","愔","慇","栶","氤","洇","溵","濦","瘖","禋","秵","筃","絪","緸","茵","蒑","蔭","裀","諲","銦","铟","闉","阥","阴","陰","陻","隂","霒","霠","鞇","音","韾","駰","骃","齗","𬘡","𬤇","𬮱"],mǐ:["侎","孊","弭","敉","洣","渳","灖","米","粎","羋","脒","芈","葞","蔝","銤"],zhū:["侏","株","槠","橥","櫧","櫫","洙","潴","瀦","猪","珠","硃","秼","絑","茱","蕏","蛛","蝫","蠩","袾","誅","諸","诛","诸","豬","跦","邾","銖","铢","駯","鮢","鯺","鴸","鼄"],ān:["侒","偣","媕","安","峖","庵","桉","氨","盦","盫","腤","菴","萻","葊","蓭","誝","諳","谙","鞌","鞍","韽","馣","鮟","鵪","鶕","鹌","𩽾"],lù:["侓","僇","勎","勠","圥","坴","塶","娽","峍","廘","彔","录","戮","摝","椂","樚","淕","淥","渌","漉","潞","琭","璐","甪","盝","睩","硉","祿","禄","稑","穋","箓","簏","簬","簵","簶","籙","粶","蔍","蕗","虂","螰","賂","赂","趢","路","踛","蹗","輅","轆","辂","辘","逯","醁","錄","録","錴","鏴","陸","騄","騼","鯥","鴼","鵦","鵱","鷺","鹭","鹿","麓","𫘧"],móu:["侔","劺","恈","眸","蛑","謀","谋","踎","鍪","鴾","麰"],ér:["侕","儿","児","兒","峏","栭","洏","粫","而","胹","荋","袻","輀","轜","陑","隭","髵","鮞","鲕","鴯","鸸"],"dòng tǒng tóng":["侗"],chà:["侘","奼","姹","岔","汊","詫","诧"],chì:["侙","傺","勅","勑","叱","啻","彳","恜","慗","憏","懘","抶","敕","斥","杘","湁","灻","炽","烾","熾","痓","痸","瘛","翄","翅","翤","翨","腟","赤","趩","遫","鉓","雴","飭","饬","鶒","鷘"],"gòng gōng":["供","共"],zhōu:["侜","周","喌","州","徟","洲","淍","炿","烐","珘","矪","舟","謅","譸","诌","賙","赒","輈","輖","辀","週","郮","銂","霌","駲","騆","鵃","鸼"],rú:["侞","儒","嚅","如","嬬","孺","帤","曘","桇","渪","濡","筎","茹","蕠","薷","蝡","蠕","袽","襦","邚","醹","銣","铷","顬","颥","鱬","鴑","鴽"],"jiàn cún":["侟"],xiá:["侠","俠","匣","峡","峽","敮","暇","柙","炠","烚","狎","狭","狹","珨","瑕","硖","硤","碬","祫","筪","縖","翈","舝","舺","蕸","赮","轄","辖","遐","鍜","鎋","陜","陿","霞","騢","魻","鶷","黠"],lǚ:["侣","侶","儢","吕","呂","屡","屢","履","挔","捛","旅","梠","焒","祣","稆","穭","絽","縷","缕","膂","膐","褛","褸","郘","鋁","铝"],ta:["侤"],"jiǎo yáo":["侥","僥","徺"],zhēn:["侦","偵","寊","帧","帪","幀","搸","斟","桢","楨","榛","樼","殝","浈","湞","潧","澵","獉","珍","珎","瑧","甄","眞","真","砧","碪","祯","禎","禛","箴","胗","臻","葴","蒖","蓁","薽","貞","贞","轃","遉","酙","針","鉁","錱","鍼","针","鱵"],"cè zè zhāi":["侧","側"],kuài:["侩","儈","凷","哙","噲","圦","块","塊","巜","廥","快","旝","欳","狯","獪","筷","糩","脍","膾","郐","鄶","鱠","鲙"],chái:["侪","儕","喍","柴","犲","祡","豺"],nóng:["侬","儂","农","哝","噥","檂","欁","浓","濃","燶","禯","秾","穠","脓","膿","蕽","襛","譨","農","辳","醲","鬞","𬪩"],jǐn:["侭","儘","卺","厪","巹","槿","漌","瑾","紧","緊","菫","蓳","謹","谨","錦","锦","饉","馑"],"hóu hòu":["侯","矦"],jiǒng:["侰","僒","冏","囧","泂","澃","炯","烱","煚","煛","熲","燛","窘","綗","褧","迥","逈","顈","颎","䌹"],"chěng tǐng":["侱"],"zhèn zhēn":["侲","揕"],zuò:["侳","做","唑","坐","岝","岞","座","祚","糳","胙","葃","葄","蓙","袏","阼"],qīn:["侵","兓","媇","嵚","嶔","欽","衾","誛","钦","顉","駸","骎","鮼"],jú:["侷","啹","婅","局","巈","椈","橘","泦","淗","湨","焗","犑","狊","粷","菊","蘜","趜","跼","蹫","輂","郹","閰","駶","驧","鵙","鵴","鶪","鼰","鼳","䴗"],"shù dōu":["侸"],tǐng:["侹","圢","娗","挺","涏","烶","珽","脡","艇","誔","頲","颋"],shèn:["侺","愼","慎","昚","涁","渗","滲","瘆","瘮","眘","祳","肾","胂","脤","腎","蜃","蜄","鋠"],"tuì tuó":["侻"],nán:["侽","喃","娚","抩","暔","枏","柟","楠","男","畘","莮","萳","遖"],xiāo:["侾","哓","嘵","嚻","囂","婋","宯","宵","庨","彇","揱","枭","枵","梟","櫹","歊","毊","消","潇","瀟","灱","灲","烋","焇","猇","獢","痚","痟","硝","硣","窙","箫","簘","簫","綃","绡","翛","膮","萧","蕭","虈","虓","蟂","蟏","蟰","蠨","踃","逍","銷","销","霄","颵","驍","骁","髇","髐","魈","鴞","鴵","鷍","鸮"],"biàn pián":["便","緶","缏"],tuǐ:["俀","腿","蹆","骽"],xì:["係","匸","卌","呬","墍","屃","屓","屭","忥","怬","恄","椞","潝","潟","澙","熂","犔","磶","禊","細","綌","縘","细","绤","舃","舄","蕮","虩","衋","覤","赩","趇","郤","釳","阋","隙","隟","霼","餼","饩","鬩","黖"],cù:["促","媨","憱","猝","瘄","瘯","簇","縬","脨","蔟","誎","趗","踧","踿","蹙","蹴","蹵","醋","顣","鼀"],é:["俄","囮","娥","峉","峨","峩","涐","珴","皒","睋","磀","莪","訛","誐","譌","讹","迗","鈋","鋨","锇","頟","額","额","魤","鵝","鵞","鹅"],qiú:["俅","叴","唒","囚","崷","巯","巰","扏","梂","殏","毬","求","汓","泅","浗","湭","煪","犰","玌","球","璆","皳","盚","紌","絿","肍","芁","莍","虬","虯","蛷","裘","觓","觩","訄","訅","賕","赇","逎","逑","遒","酋","釚","釻","銶","頄","鮂","鯄","鰽","鼽","𨱇"],xú:["俆","徐","禑"],"guàng kuāng":["俇"],kù:["俈","喾","嚳","库","庫","廤","瘔","絝","绔","袴","裤","褲","酷"],wù:["俉","务","務","勿","卼","坞","塢","奦","婺","寤","屼","岉","嵨","忢","悞","悟","悮","戊","扤","晤","杌","溩","焐","熃","物","痦","矹","窹","粅","蘁","誤","误","鋈","阢","隖","雾","霚","霧","靰","騖","骛","鶩","鹜","鼿","齀"],jùn:["俊","儁","呁","埈","寯","峻","懏","捃","攟","晙","棞","燇","珺","畯","竣","箟","蜠","賐","郡","陖","餕","馂","駿","骏","鵔","鵕","鵘","䐃"],liáng:["俍","墚","梁","椋","樑","粮","粱","糧","良","輬","辌","𫟅"],zǔ:["俎","唨","爼","祖","組","组","詛","诅","鎺","阻","靻"],"qiào xiào":["俏"],yǒng:["俑","勇","勈","咏","埇","塎","嵱","彮","怺","恿","悀","惥","愑","愹","慂","柡","栐","永","泳","湧","甬","蛹","詠","踊","踴","鯒","鲬"],hùn:["俒","倱","圂","尡","慁","掍","溷","焝","睴","觨","諢","诨"],jìng:["俓","傹","境","妌","婙","婧","弪","弳","径","徑","敬","曔","桱","梷","浄","瀞","獍","痉","痙","竞","竟","竫","競","竸","胫","脛","莖","誩","踁","迳","逕","鏡","镜","靖","静","靜","鵛"],sàn:["俕","閐"],pěi:["俖"],sú:["俗"],xī:["俙","僖","兮","凞","卥","厀","吸","唏","唽","嘻","噏","嚱","夕","奚","嬆","嬉","屖","嵠","巇","希","徆","徯","息","悉","悕","惁","惜","昔","晞","晰","晳","曦","析","桸","榽","樨","橀","欷","氥","汐","浠","淅","渓","溪","烯","焁","焈","焟","熄","熈","熙","熹","熺","熻","燨","爔","牺","犀","犠","犧","琋","瘜","皙","睎","瞦","矽","硒","磎","礂","稀","穸","窸","粞","糦","緆","繥","羲","翕","翖","肸","肹","膝","舾","莃","菥","蒠","蜥","螅","蟋","蠵","西","觹","觽","觿","譆","谿","豀","豨","豯","貕","赥","邜","鄎","酅","醯","釸","錫","鏭","鐊","鑴","锡","隵","餏","饎","饻","鯑","鵗","鸂","鼷"],lǐ:["俚","娌","峢","峲","李","欚","浬","澧","理","礼","禮","粴","裏","裡","豊","逦","邐","醴","鋰","锂","鯉","鱧","鱱","鲤","鳢"],bǎo:["保","堢","媬","宝","寚","寳","寶","珤","緥","葆","藵","褓","賲","靌","飹","飽","饱","駂","鳵","鴇","鸨"],"yú shù yù":["俞"],"sì qí":["俟"],"xìn shēn":["信"],xiū:["俢","修","咻","庥","樇","烌","羞","脙","脩","臹","貅","銝","鎀","飍","饈","馐","髤","髹","鮴","鱃","鵂","鸺","䗛"],dì:["俤","偙","僀","埊","墑","墬","娣","帝","怟","旳","梊","焍","玓","甋","眱","睇","碲","祶","禘","第","締","缔","腣","菂","蒂","蔕","蝃","蝭","螮","諦","谛","踶","递","逓","遞","遰","鉪","𤧛","䗖"],chóu:["俦","儔","嬦","惆","愁","懤","栦","燽","畴","疇","皗","稠","筹","籌","絒","綢","绸","菗","詶","讎","讐","踌","躊","酧","酬","醻","雔","雠","雦"],zhì:["俧","偫","儨","制","劕","垁","娡","寘","帙","帜","幟","庢","庤","廌","彘","徏","徝","志","忮","懥","懫","挃","挚","掷","摯","擲","旘","晊","智","栉","桎","梽","櫍","櫛","治","洷","滍","滞","滯","潌","瀄","炙","熫","狾","猘","璏","瓆","痔","痣","礩","祑","秩","秷","稚","稺","穉","窒","紩","緻","置","翐","膣","至","致","芖","蛭","袟","袠","製","覟","觗","觯","觶","誌","豑","豒","貭","質","贄","质","贽","跱","踬","躓","輊","轾","郅","銍","鋕","鑕","铚","锧","陟","隲","雉","駤","騭","騺","驇","骘","鯯","鴙","鷙","鸷","𬃊"],"liǎ liǎng":["俩"],jiǎn:["俭","倹","儉","减","剪","堿","弿","彅","戩","戬","拣","挸","捡","揀","撿","枧","柬","梘","检","検","檢","減","湕","瀽","瑐","睑","瞼","硷","碱","礆","笕","筧","简","簡","絸","繭","翦","茧","藆","蠒","裥","襇","襉","襺","詃","謇","謭","譾","谫","趼","蹇","鐗","鬋","鰎","鹸","鹻","鹼"],huò:["俰","咟","嚯","嚿","奯","彠","惑","或","擭","旤","曤","檴","沎","湱","瀖","獲","癨","眓","矐","祸","禍","穫","窢","耯","臛","艧","获","蒦","藿","蠖","謋","貨","货","鍃","鑊","镬","雘","霍","靃","韄","㸌"],"jù jū":["俱","据","鋸","锯"],xiào:["俲","傚","効","咲","哮","啸","嘋","嘨","嘯","孝","效","斅","斆","歗","涍","熽","笑","詨","誟"],pái:["俳","徘","牌","犤","猅","簰","簲","輫"],biào:["俵","鰾","鳔"],"chù tì":["俶"],fèi:["俷","剕","厞","吠","屝","废","廃","廢","昲","曊","櫠","沸","濷","狒","癈","肺","萉","費","费","鐨","镄","陫","靅","鼣"],fèng:["俸","凤","奉","湗","焨","煈","賵","赗","鳯","鳳","鴌"],ǎn:["俺","唵","埯","揞","罯","銨","铵"],bèi:["俻","倍","偝","偹","備","僃","备","悖","惫","愂","憊","昁","梖","焙","牬","犕","狈","狽","珼","琲","碚","禙","糒","苝","蓓","蛽","褙","貝","贝","軰","輩","辈","邶","郥","鄁","鋇","鐾","钡","鞁","鞴","𬇙"],yù:["俼","儥","喅","喩","喻","域","堉","妪","嫗","寓","峪","嶎","庽","彧","御","愈","慾","戫","昱","棛","棜","棫","櫲","欎","欝","欲","毓","浴","淯","滪","潏","澦","灪","焴","煜","燏","燠","爩","狱","獄","玉","琙","瘉","癒","砡","硢","硲","礇","礖","礜","禦","秗","稢","稶","篽","籞","籲","粖","緎","罭","聿","肀","艈","芋","芌","茟","蒮","蓣","蓹","蕷","蘌","蜟","蜮","袬","裕","誉","諭","譽","谕","豫","軉","輍","逳","遇","遹","郁","醧","鈺","鋊","錥","鐭","钰","閾","阈","雤","霱","預","预","飫","饇","饫","馭","驈","驭","鬰","鬱","鬻","魊","鱊","鳿","鴥","鴧","鴪","鵒","鷸","鸒","鹆","鹬"],xīn:["俽","噺","妡","嬜","廞","心","忄","忻","惞","新","昕","杺","欣","歆","炘","盺","薪","訢","辛","邤","鈊","鋅","鑫","锌","馨","馫","䜣","𫷷"],"hǔ chí":["俿"],jiù:["倃","僦","匓","匛","匶","厩","咎","就","廄","廏","廐","慦","捄","救","旧","柩","柾","桕","欍","殧","疚","臼","舅","舊","鯦","鷲","鹫","麔","齨","㠇"],yáo:["倄","傜","嗂","垚","堯","姚","媱","尧","尭","峣","嶢","嶤","徭","揺","搖","摇","摿","暚","榣","烑","爻","猺","珧","瑤","瑶","磘","窑","窯","窰","肴","蘨","謠","謡","谣","軺","轺","遙","遥","邎","顤","颻","飖","餆","餚","鰩","鱙","鳐"],"cuì zú":["倅"],"liǎng liǎ":["倆"],wǎn:["倇","唍","婉","惋","挽","晚","晥","晩","晼","梚","椀","琬","畹","皖","盌","碗","綩","綰","绾","脘","萖","踠","輓","鋔"],zǒng:["倊","偬","傯","嵸","总","惣","捴","搃","摠","燪","総","緫","縂","總","蓗"],guān:["倌","关","官","棺","瘝","癏","窤","蒄","関","闗","關","鰥","鱞","鳏"],tiǎn:["倎","唺","忝","悿","晪","殄","淟","睓","腆","舔","覥","觍","賟","錪","餂"],mén:["們","扪","捫","璊","菛","虋","鍆","钔","門","閅","门","𫞩"],"dǎo dào":["倒"],"tán tàn":["倓","埮"],"juè jué":["倔"],chuí:["倕","垂","埀","捶","搥","桘","棰","槌","箠","腄","菙","錘","鎚","锤","陲","顀"],xìng:["倖","姓","婞","嬹","幸","性","悻","杏","涬","緈","臖","荇","莕","葕"],péng:["倗","傰","塜","塳","弸","憉","捀","朋","棚","椖","樥","硼","稝","竼","篷","纄","膨","芃","蓬","蘕","蟚","蟛","袶","輣","錋","鑝","韸","韼","騯","髼","鬅","鬔","鵬","鹏"],"tǎng cháng":["倘"],hòu:["候","厚","后","垕","堠","後","洉","茩","豞","逅","郈","鮜","鱟","鲎","鲘"],tì:["倜","剃","嚏","嚔","屉","屜","悌","悐","惕","惖","戻","掦","替","朑","歒","殢","涕","瓋","笹","籊","薙","褅","逖","逷","髰","鬀","鬄"],gàn:["倝","凎","幹","榦","檊","淦","灨","盰","紺","绀","詌","贑","赣","骭","㽏"],"liàng jìng":["倞","靓"],suī:["倠","哸","夊","滖","濉","眭","睢","芕","荽","荾","虽","雖","鞖"],"chàng chāng":["倡"],jié:["倢","偼","傑","刦","刧","刼","劫","劼","卩","卪","婕","媫","孑","岊","崨","嵥","嶻","巀","幯","截","捷","掶","擮","昅","杢","杰","桀","桝","楬","楶","榤","洁","滐","潔","狤","睫","礍","竭","節","羯","莭","蓵","蛣","蜐","蠘","蠞","蠽","衱","袺","訐","詰","誱","讦","踕","迼","鉣","鍻","镼","頡","鮚","鲒","㛃"],"kǒng kōng":["倥"],juàn:["倦","劵","奆","慻","桊","淃","狷","獧","眷","睊","睠","絭","絹","绢","罥","羂","腃","蔨","鄄","餋"],zōng:["倧","堫","宗","嵏","嵕","惾","朡","棕","椶","熧","猣","磫","緃","翪","腙","葼","蝬","豵","踨","踪","蹤","鍐","鑁","騌","騣","骔","鬃","鬉","鬷","鯮","鯼"],ní:["倪","坭","埿","尼","屔","怩","淣","猊","籾","聣","蚭","蜺","觬","貎","跜","輗","郳","鈮","铌","霓","馜","鯢","鲵","麑","齯","𫐐","𫠜"],zhuō:["倬","拙","捉","桌","梲","棁","棳","槕","涿","窧","鐯","䦃"],"wō wēi":["倭"],luǒ:["倮","剆","曪","瘰","癳","臝","蓏","蠃","裸","躶"],sōng:["倯","凇","娀","崧","嵩","庺","憽","松","枀","枩","柗","梥","檧","淞","濍","硹","菘","鬆"],lèng:["倰","堎","愣","睖","踜"],zì:["倳","剚","字","恣","渍","漬","牸","眥","眦","胔","胾","自","茡","荢"],bèn:["倴","坌","捹","撪","渀","笨","逩"],cǎi:["倸","啋","婇","彩","採","棌","毝","睬","綵","跴","踩"],zhài:["债","債","寨","瘵","砦"],yē:["倻","吔","噎","擨","暍","椰","歋","潱","蠮"],shà:["倽","唼","喢","歃","箑","翜","翣","萐","閯","霎"],qīng:["倾","傾","卿","圊","寈","氢","氫","淸","清","蜻","軽","輕","轻","郬","錆","鑋","靑","青","鯖"],yīng:["偀","嘤","噟","嚶","婴","媖","嫈","嬰","孆","孾","愥","撄","攖","朠","桜","樱","櫻","渶","煐","珱","瑛","璎","瓔","甇","甖","碤","礯","緓","纓","绬","缨","罂","罃","罌","膺","英","莺","蘡","蝧","蠳","褮","譻","賏","軈","鑍","锳","霙","韺","鴬","鶑","鶧","鶯","鷪","鷹","鸎","鸚","鹦","鹰","䓨"],"chēng chèn":["偁","爯"],ruǎn:["偄","朊","瑌","瓀","碝","礝","腝","軟","輭","软","阮"],"zhòng tóng":["偅"],chǔn:["偆","惷","睶","萶","蠢","賰"],"jiǎ jià":["假"],"jì jié":["偈"],"bǐng bìng":["偋"],ruò:["偌","叒","嵶","弱","楉","焫","爇","箬","篛","蒻","鄀","鰙","鰯","鶸"],tí:["偍","厗","啼","嗁","崹","漽","瑅","睼","禵","稊","緹","缇","罤","蕛","褆","謕","趧","蹄","蹏","醍","鍗","題","题","騠","鮷","鯷","鳀","鵜","鷤","鹈","𫘨"],wēi:["偎","危","喴","威","媙","嶶","巍","微","愄","揋","揻","椳","楲","溦","烓","煨","燰","癓","縅","葨","葳","薇","蜲","蝛","覣","詴","逶","隇","隈","霺","鰃","鰄","鳂"],piān:["偏","囨","媥","楄","犏","篇","翩","鍂"],yàn:["偐","厌","厭","唁","喭","嚈","嚥","堰","妟","姲","嬊","嬿","宴","彥","彦","敥","晏","暥","曕","曣","滟","灎","灔","灧","灩","焔","焰","焱","熖","燄","牪","猒","砚","硯","艳","艶","艷","覎","觃","觾","諺","讌","讞","谚","谳","豓","豔","贋","贗","赝","軅","酀","酽","醼","釅","雁","餍","饜","騐","験","騴","驗","驠","验","鬳","鳫","鴈","鴳","鷃","鷰","齞"],"tǎng dàng":["偒"],è:["偔","匎","卾","厄","呝","咢","噩","垩","堊","堮","岋","崿","廅","悪","愕","戹","扼","搤","搹","擜","櫮","歞","歺","湂","琧","砈","砐","硆","腭","苊","萼","蕚","蚅","蝁","覨","諤","讍","谔","豟","軛","軶","轭","遌","遏","遻","鄂","鈪","鍔","鑩","锷","阨","阸","頞","顎","颚","餓","餩","饿","鰐","鰪","鱷","鳄","鶚","鹗","齃","齶","𫫇","𥔲"],xié:["偕","勰","协","協","嗋","垥","奊","恊","愶","拹","携","撷","擕","擷","攜","斜","旪","熁","燲","綊","緳","縀","缬","翓","胁","脅","脇","脋","膎","蝢","衺","襭","諧","讗","谐","鞋","鞵","龤","㙦"],chě:["偖","扯","撦"],shěng:["偗","渻","眚"],chā:["偛","嗏","扠","挿","插","揷","疀","臿","艖","銟","鍤","锸","餷"],huáng:["偟","凰","喤","堭","墴","媓","崲","徨","惶","楻","湟","煌","獚","瑝","璜","癀","皇","磺","穔","篁","簧","艎","葟","蝗","蟥","諻","趪","遑","鍠","鐄","锽","隍","韹","餭","騜","鰉","鱑","鳇","鷬","黃","黄","𨱑"],yǎo:["偠","咬","婹","宎","岆","杳","柼","榚","溔","狕","窅","窈","舀","苭","闄","騕","鷕","齩"],"chǒu qiào":["偢"],yóu:["偤","尤","庮","怣","沋","油","浟","游","犹","猶","猷","由","疣","秞","肬","莜","莸","蕕","蚰","蝣","訧","輏","輶","逰","遊","邮","郵","鈾","铀","駀","魷","鮋","鱿","鲉","𬨎"],xū:["偦","墟","媭","嬃","楈","欨","歔","燸","疞","盱","綇","縃","繻","胥","蕦","虗","虚","虛","蝑","裇","訏","許","諝","譃","谞","鑐","需","須","须","顼","驉","鬚","魆","魖","𬣙","𦈡"],zhā:["偧","哳","抯","挓","揸","摣","樝","渣","皶","觰","譇","齄","齇"],cī:["偨","疵","蠀","趀","骴","髊","齹"],bī:["偪","屄","楅","毴","豍","逼","鰏","鲾","鵖"],xún:["偱","噚","寻","尋","峋","巡","廵","循","恂","揗","攳","旬","杊","栒","桪","樳","洵","浔","潯","燅","燖","珣","璕","畃","紃","荀","蟳","詢","询","鄩","鱏","鱘","鲟","𬘓","𬩽","𬍤","𬊈"],"cāi sī":["偲"],duān:["偳","媏","端","褍","鍴"],ǒu:["偶","吘","嘔","耦","腢","蕅","藕","𬉼","𠙶"],tōu:["偷","偸","鍮"],"zán zá zǎ":["偺"],"lǚ lóu":["偻","僂"],fèn:["偾","僨","奋","奮","弅","忿","愤","憤","瀵","瞓","秎","粪","糞","膹","鱝","鲼"],"kuǐ guī":["傀"],sǒu:["傁","叜","叟","嗾","櫢","瞍","薮","藪"],"zhì sī tí":["傂"],sù:["傃","僳","嗉","塐","塑","夙","嫊","愫","憟","榡","樎","樕","殐","泝","涑","溯","溸","潚","潥","玊","珟","璛","簌","粛","粟","素","縤","肃","肅","膆","蔌","藗","觫","訴","謖","诉","谡","趚","蹜","速","遡","遬","鋉","餗","驌","骕","鱐","鷫","鹔","𫗧"],xiā:["傄","煆","瞎","虲","谺","颬","鰕"],"yuàn yuán":["傆","媛"],rǒng:["傇","冗","宂","氄","軵"],nù:["傉","怒"],yùn:["傊","孕","恽","惲","愠","慍","枟","腪","蕴","薀","藴","蘊","褞","貟","运","運","郓","鄆","酝","醖","醞","韗","韞","韵","韻","餫"],"gòu jiǎng":["傋"],mà:["傌","嘜","榪","睰","祃","禡","罵","閁","駡","骂","鬕"],bàng:["傍","塝","棒","玤","稖","艕","蒡","蜯","謗","谤","鎊","镑"],diān:["傎","厧","嵮","巅","巓","巔","掂","攧","敁","槇","滇","癫","癲","蹎","顚","顛","颠","齻"],táng:["傏","唐","啺","坣","堂","塘","搪","棠","榶","溏","漟","煻","瑭","磄","禟","篖","糃","糖","糛","膅","膛","蓎","螗","螳","赯","踼","鄌","醣","鎕","隚","餹","饄","鶶","䣘"],hào:["傐","哠","恏","昊","昦","晧","暠","暤","暭","曍","浩","淏","澔","灏","灝","皓","皜","皞","皡","皥","耗","聕","薃","號","鄗","顥","颢","鰝"],"xī xì":["傒"],shān:["傓","删","刪","剼","圸","山","挻","搧","柵","檆","潸","澘","煽","狦","珊","笘","縿","羴","羶","脠","舢","芟","衫","跚","軕","邖","閊","鯅"],"qiàn jiān":["傔"],"què jué":["傕","埆"],"cāng chen":["傖"],róng:["傛","媶","嫆","嬫","容","峵","嵘","嶸","戎","搈","曧","栄","榕","榮","榵","毧","溶","瀜","烿","熔","狨","瑢","穁","絨","绒","羢","肜","茙","茸","荣","蓉","蝾","融","螎","蠑","褣","鎔","镕","駥"],"tà tàn":["傝"],suō:["傞","唆","嗍","嗦","娑","摍","桫","梭","睃","簑","簔","羧","莏","蓑","趖","鮻"],dǎi:["傣","歹"],zài:["傤","儎","再","在","扗","洅","載","酨"],gǔ:["傦","古","啒","尳","愲","榖","榾","汩","淈","濲","瀔","牯","皷","皼","盬","瞽","穀","罟","羖","股","脵","臌","薣","蛊","蠱","詁","诂","轂","逧","鈷","钴","餶","馉","鼓","鼔","𦙶"],bīn:["傧","宾","彬","斌","椕","滨","濒","濱","濵","瀕","繽","缤","虨","豩","豳","賓","賔","邠","鑌","镔","霦","顮"],chǔ:["储","儲","杵","椘","楚","楮","檚","濋","璴","础","礎","禇","處","齭","齼","𬺓"],nuó:["傩","儺","挪","梛","橠"],"cān càn":["傪"],lěi:["傫","儡","厽","垒","塁","壘","壨","櫐","灅","癗","矋","磊","礨","耒","蕌","蕾","藟","蘽","蠝","誄","讄","诔","鑸","鸓"],cuī:["催","凗","墔","崔","嵟","慛","摧","榱","獕","磪","鏙"],yōng:["傭","嗈","墉","壅","嫞","庸","廱","慵","拥","擁","滽","灉","牅","痈","癕","癰","臃","邕","郺","鄘","鏞","镛","雍","雝","饔","鱅","鳙","鷛"],"zāo cáo":["傮"],sǒng:["傱","嵷","怂","悚","愯","慫","竦","耸","聳","駷","㧐"],ào:["傲","坳","垇","墺","奡","嫯","岙","岰","嶴","懊","擙","澳","鏊","驁","骜"],"qī còu":["傶"],chuǎng:["傸","磢","闖","闯"],shǎ:["傻","儍"],hàn:["傼","垾","悍","憾","扞","捍","撖","撼","旱","晘","暵","汉","涆","漢","瀚","焊","猂","皔","睅","翰","莟","菡","蛿","蜭","螒","譀","輚","釬","銲","鋎","雗","頷","顄","颔","駻","鶾"],zhāng:["傽","嫜","张","張","彰","慞","暲","樟","漳","獐","璋","章","粻","蔁","蟑","遧","鄣","鏱","餦","騿","鱆","麞"],"yān yàn":["傿","墕","嬮"],"piào biāo":["僄","骠"],liàn:["僆","堜","媡","恋","戀","楝","殓","殮","湅","潋","澰","瀲","炼","煉","瑓","練","纞","练","萰","錬","鍊","鏈","链","鰊","𬶠"],màn:["㵘","僈","墁","幔","慢","曼","漫","澷","熳","獌","縵","缦","蔄","蘰","鄤","鏝","镘","𬜬"],"tàn tǎn":["僋"],yíng:["僌","営","塋","嬴","攍","楹","櫿","溁","溋","滢","潆","濙","濚","濴","瀅","瀛","瀠","瀯","灐","灜","熒","營","瑩","盁","盈","禜","籝","籯","縈","茔","荧","莹","萤","营","萦","萾","蓥","藀","蛍","蝇","蝿","螢","蠅","謍","贏","赢","迎","鎣"],dòng:["働","冻","凍","动","動","姛","戙","挏","栋","棟","湩","硐","胨","胴","腖","迵","霘","駧"],zhuàn:["僎","啭","囀","堟","撰","灷","瑑","篆","腞","蒃","襈","譔","饌","馔"],xiàng:["像","勨","向","嚮","姠","嶑","曏","橡","珦","缿","蟓","衖","襐","象","鐌","項","项","鱌"],shàn:["僐","善","墠","墡","嬗","擅","敾","椫","樿","歚","汕","灗","疝","磰","繕","缮","膳","蟮","蟺","訕","謆","譱","讪","贍","赡","赸","鄯","鐥","饍","騸","骟","鱓","鱔","鳝","𫮃"],"tuí tuǐ":["僓"],zǔn:["僔","噂","撙","譐"],pú:["僕","匍","圤","墣","濮","獛","璞","瞨","穙","莆","菐","菩","葡","蒱","蒲","贌","酺","鏷","镤"],láo:["僗","劳","労","勞","哰","崂","嶗","憥","朥","浶","牢","痨","癆","窂","簩","醪","鐒","铹","顟","髝","𫭼"],chǎng:["僘","厰","廠","敞","昶","氅","鋹","𬬮"],guāng:["僙","光","咣","垙","姯","洸","灮","炗","炚","炛","烡","珖","胱","茪","輄","銧","黆","𨐈"],liáo:["僚","嘹","嫽","寥","寮","尞","屪","嵺","嶚","嶛","廫","憀","敹","暸","橑","獠","璙","疗","療","竂","簝","繚","缭","聊","膋","膫","藔","蟟","豂","賿","蹘","辽","遼","飉","髎","鷯","鹩"],dèng:["僜","凳","墱","嶝","櫈","瞪","磴","覴","邓","鄧","隥"],"chán zhàn zhuàn":["僝"],bō:["僠","嶓","拨","撥","播","波","溊","玻","癶","盋","砵","碆","礡","缽","菠","袰","蹳","鉢","钵","餑","饽","驋","鱍","𬭛"],huì:["僡","匯","卉","喙","嘒","嚖","圚","嬒","寭","屶","屷","彗","彙","彚","徻","恚","恵","惠","慧","憓","懳","晦","暳","槥","橞","檅","櫘","汇","泋","滙","潓","烩","燴","獩","璤","瞺","硊","秽","穢","篲","絵","繪","绘","翙","翽","荟","蔧","蕙","薈","薉","蟪","詯","誨","諱","譓","譿","讳","诲","賄","贿","鐬","闠","阓","靧","頮","顪","颒","餯","𬤝","𬭬"],chuǎn:["僢","喘","舛","荈","踳"],"tiě jiàn":["僣"],sēng:["僧","鬙"],xiàn:["僩","僴","哯","垷","塪","姭","娊","宪","岘","峴","憲","撊","晛","橌","橺","涀","瀗","献","獻","现","現","県","睍","粯","糮","絤","綫","線","线","缐","羡","羨","腺","臔","臽","苋","莧","誢","豏","鋧","錎","限","陥","陷","霰","餡","馅","麲","鼸","𬀪","𪾢"],"yù jú":["僪"],"è wū":["僫"],"tóng zhuàng":["僮"],lǐn:["僯","凛","凜","廩","廪","懍","懔","撛","檁","檩","澟","癛","癝"],gù:["僱","凅","固","堌","崓","崮","故","梏","棝","牿","痼","祻","錮","锢","雇","顧","顾","鯝","鲴"],jiāng:["僵","壃","姜","橿","殭","江","畕","疅","礓","繮","缰","翞","茳","葁","薑","螀","螿","豇","韁","鱂","鳉"],mǐn:["僶","冺","刡","勄","悯","惽","愍","慜","憫","抿","敃","敏","敯","泯","潣","皿","笢","笽","簢","蠠","閔","閩","闵","闽","鰵","鳘","黽"],jìn:["僸","凚","噤","嚍","墐","壗","妗","嬧","搢","晉","晋","枃","殣","浕","浸","溍","濅","濜","烬","煡","燼","琎","瑨","璶","盡","祲","縉","缙","荩","藎","覲","觐","賮","贐","赆","近","进","進","靳","齽"],"jià jie":["價"],qiào:["僺","峭","帩","撬","殻","窍","竅","誚","诮","躈","陗","鞩","韒","髚"],pì:["僻","媲","嫓","屁","澼","甓","疈","譬","闢","鷿","鸊","䴙"],sài:["僿","簺","賽","赛"],"chán tǎn shàn":["儃"],"dāng dàng":["儅","当","闣"],xuān:["儇","喧","塇","媗","宣","愃","愋","揎","昍","暄","煊","煖","瑄","睻","矎","禤","箮","翧","翾","萱","萲","蓒","蕿","藼","蘐","蝖","蠉","諠","諼","譞","谖","軒","轩","鍹","駽","鰚","𫓶","𫍽"],"dān dàn":["儋","擔","瘅"],càn:["儏","澯","灿","燦","璨","粲","薒","謲"],"bīn bìn":["儐"],"án àn":["儑"],tái:["儓","坮","嬯","抬","擡","檯","炱","炲","籉","臺","薹","跆","邰","颱","鮐","鲐"],lán:["儖","兰","囒","婪","岚","嵐","幱","拦","攔","斓","斕","栏","欄","欗","澜","瀾","灆","灡","燣","燷","璼","篮","籃","籣","繿","葻","蓝","藍","蘫","蘭","褴","襕","襤","襴","襽","譋","讕","谰","躝","鑭","镧","闌","阑","韊","𬒗"],"nǐ yì ài yí":["儗"],méng:["儚","幪","曚","朦","橗","檬","氋","溕","濛","甍","甿","盟","礞","艨","莔","萌","蕄","虻","蝱","鄳","鄸","霿","靀","顭","饛","鯍","鸏","鹲","𫑡","㠓"],níng:["儜","凝","咛","嚀","嬣","柠","橣","檸","狞","獰","聍","聹","薴","鑏","鬡","鸋"],qióng:["儝","卭","宆","惸","憌","桏","橩","焪","焭","煢","熍","琼","瓊","睘","穷","穹","窮","竆","笻","筇","舼","茕","藑","藭","蛩","蛬","赹","跫","邛","銎","䓖"],liè:["儠","冽","列","劣","劽","埒","埓","姴","峛","巤","挒","捩","栵","洌","浖","烈","烮","煭","犣","猎","猟","獵","聗","脟","茢","蛚","趔","躐","迾","颲","鬛","鬣","鮤","鱲","鴷","䴕","𫚭"],kuǎng:["儣","夼","懭"],bào:["儤","勽","報","忁","报","抱","曓","爆","犦","菢","虣","蚫","豹","鉋","鑤","铇","骲","髱","鮑","鲍"],biāo:["儦","墂","幖","彪","标","標","滮","瀌","熛","爂","猋","瘭","磦","膘","臕","謤","贆","鏢","鑣","镖","镳","颮","颷","飆","飇","飈","飊","飑","飙","飚","驫","骉","髟"],zǎn:["儧","儹","噆","攅","昝","趱","趲"],háo:["儫","嗥","嘷","噑","嚎","壕","椃","毜","毫","濠","獆","獔","竓","籇","蚝","蠔","譹","豪"],qìng:["儬","凊","庆","慶","櫦","濪","碃","磬","罄","靘"],chèn:["儭","嚫","榇","櫬","疢","衬","襯","讖","谶","趁","趂","齓","齔","龀"],téng:["儯","幐","滕","漛","疼","籐","籘","縢","腾","藤","虅","螣","誊","謄","邆","駦","騰","驣","鰧","䲢"],"lǒng lóng lòng":["儱"],"chán chàn":["儳"],"ráng xiāng":["儴","勷"],"huì xié":["儶"],luó:["儸","攞","椤","欏","猡","玀","箩","籮","罗","羅","脶","腡","萝","蘿","螺","覼","逻","邏","鏍","鑼","锣","镙","饠","騾","驘","骡","鸁"],léi:["儽","嫘","檑","欙","瓃","畾","縲","纍","纝","缧","罍","羸","蔂","蘲","虆","轠","鐳","鑘","镭","雷","靁","鱩","鼺"],"nàng nāng":["儾"],"wù wū":["兀"],yǔn:["允","喗","夽","抎","殒","殞","狁","磒","荺","賱","鈗","阭","陨","隕","霣","馻","齫","齳"],zān:["兂","橵","簪","簮","糌","鐕","鐟","鵤"],yuán:["元","円","原","厡","厵","园","圆","圎","園","圓","垣","塬","媴","嫄","援","榞","榬","橼","櫞","沅","湲","源","溒","爰","猨","猿","笎","緣","縁","缘","羱","茒","薗","蝝","蝯","螈","袁","褤","謜","轅","辕","邍","邧","酛","鈨","鎱","騵","魭","鶢","鶰","黿","鼋","𫘪"],xiōng:["兄","兇","凶","匂","匈","哅","忷","恟","汹","洶","胷","胸","芎","訩","詾","讻"],chōng:["充","嘃","忡","憃","憧","摏","沖","浺","珫","罿","翀","舂","艟","茺","衝","蹖","㳘"],zhào:["兆","垗","旐","曌","枛","櫂","照","燳","狣","瞾","笊","罀","罩","羄","肁","肇","肈","詔","诏","赵","趙","鮡","𬶐"],"duì ruì yuè":["兊","兌","兑"],kè:["克","刻","勀","勊","堁","娔","客","恪","愙","氪","溘","碦","緙","缂","艐","衉","課","课","錁","锞","騍","骒"],tù:["兎","兔","堍","迌","鵵"],dǎng:["党","攩","欓","譡","讜","谠","黨","𣗋"],dōu:["兜","兠","唗","橷","篼","蔸"],huǎng:["兤","奛","幌","怳","恍","晄","炾","熀","縨","詤","謊","谎"],rù:["入","嗕","媷","扖","杁","洳","溽","縟","缛","蓐","褥","鳰"],nèi:["內","氝","氞","錗"],"yú shù":["兪"],"liù lù":["六"],han:["兯","爳"],tiān:["兲","天","婖","添","酟","靔","靝","黇"],"xīng xìng":["兴"],diǎn:["典","嚸","奌","婰","敟","椣","点","碘","蒧","蕇","踮","點"],"zī cí":["兹"],jiān:["兼","冿","囏","坚","堅","奸","姦","姧","尖","幵","惤","戋","戔","搛","椾","樫","櫼","歼","殱","殲","湔","瀐","瀸","煎","熞","熸","牋","瑊","睷","礛","礷","笺","箋","緘","縑","缄","缣","肩","艰","艱","菅","菺","葌","蒹","蔪","蕑","蕳","虃","譼","豜","鑯","雃","鞯","韀","韉","餰","馢","鰔","鰜","鰹","鲣","鳒","鵑","鵳","鶼","鹣","麉"],shòu:["兽","受","售","壽","夀","寿","授","狩","獣","獸","痩","瘦","綬","绶","膄"],jì:["兾","冀","剂","剤","劑","勣","坖","垍","塈","妓","季","寂","寄","廭","彑","徛","忌","悸","惎","懻","技","旡","既","旣","暨","暩","曁","梞","檕","檵","洎","漃","漈","瀱","痵","癠","禝","稩","稷","穄","穊","穧","紀","継","績","繋","繼","继","绩","罽","臮","芰","茍","茤","葪","蓟","蔇","薊","蘎","蘮","蘻","裚","襀","覬","觊","計","記","誋","计","记","跡","跽","蹟","迹","际","際","霁","霽","驥","骥","髻","鬾","魝","魥","鯚","鯽","鰶","鰿","鱀","鱭","鲚","鲫","鵋","鷑","齌","𪟝","𬶨","𬶭"],jiōng:["冂","冋","坰","埛","扃","蘏","蘔","駉","駫","𬳶"],mào:["冃","冐","媢","帽","愗","懋","暓","柕","楙","毷","瑁","皃","眊","瞀","耄","茂","萺","蝐","袤","覒","貌","貿","贸","鄚","鄮"],rǎn:["冄","冉","姌","媣","染","珃","苒","蒅","䎃"],"nèi nà":["内"],gāng:["冈","冮","刚","剛","堈","堽","岡","掆","摃","棡","牨","犅","疘","綱","纲","缸","罁","罡","肛","釭","鎠","㭎"],cè:["冊","册","厕","厠","夨","廁","恻","惻","憡","敇","测","測","笧","策","筞","筴","箣","荝","萗","萴","蓛"],guǎ:["冎","剐","剮","叧","寡"],"mào mò":["冒"],gòu:["冓","啂","坸","垢","够","夠","媾","彀","搆","撀","构","構","煹","覯","觏","訽","詬","诟","購","购","遘","雊"],xǔ:["冔","喣","暊","栩","珝","盨","糈","詡","諿","诩","鄦","醑"],mì:["冖","冪","嘧","塓","宻","密","峚","幂","幎","幦","怽","榓","樒","櫁","汨","淧","滵","漞","濗","熐","羃","蔤","蜜","覓","覔","覛","觅","謐","谧","鼏"],"yóu yín":["冘"],xiě:["写","冩","藛"],jūn:["军","君","均","桾","汮","皲","皸","皹","碅","莙","蚐","袀","覠","軍","鈞","銁","銞","鍕","钧","頵","鮶","鲪","麏"],mí:["冞","擟","瀰","爢","猕","獼","祢","禰","縻","蒾","藌","蘪","蘼","袮","詸","謎","迷","醚","醾","醿","釄","镾","鸍","麊","麋","麛"],"guān guàn":["冠","覌","観","觀","观"],měng:["冡","勐","懵","掹","猛","獴","艋","蜢","蠓","錳","锰","鯭","鼆"],zhǒng:["冢","塚","尰","歱","煄","瘇","肿","腫","踵"],zuì:["冣","嶵","晬","最","栬","槜","檇","檌","祽","絊","罪","蕞","辠","酔","酻","醉","錊"],yuān:["冤","剈","囦","嬽","寃","棩","淵","渁","渆","渊","渕","灁","眢","肙","葾","蒬","蜎","蜵","駌","鳶","鴛","鵷","鸢","鸳","鹓","鼘","鼝"],míng:["冥","名","明","暝","朙","榠","洺","溟","猽","眀","眳","瞑","茗","螟","覭","詺","鄍","銘","铭","鳴","鸣"],kòu:["冦","叩","宼","寇","扣","敂","滱","窛","筘","簆","蔲","蔻","釦","鷇"],tài:["冭","太","夳","忲","态","態","汰","汱","泰","溙","肽","舦","酞","鈦","钛"],"féng píng":["冯","馮"],"chōng chòng":["冲"],kuàng:["况","圹","壙","岲","懬","旷","昿","曠","框","況","爌","眖","眶","矿","砿","礦","穬","絋","絖","纊","纩","貺","贶","軦","邝","鄺","鉱","鋛","鑛","黋"],lěng:["冷"],pàn:["冸","判","叛","沜","泮","溿","炍","牉","畔","盼","聁","袢","襻","詊","鋬","鑻","頖","鵥"],fā:["冹","彂","沷","発","發"],xiǎn:["冼","尟","尠","崄","嶮","幰","攇","显","櫶","毨","灦","烍","燹","狝","猃","獫","獮","玁","禒","筅","箲","藓","蘚","蚬","蜆","譣","赻","跣","鍌","险","険","險","韅","顕","顯","㬎"],qià:["冾","圶","帢","恰","殎","洽","硈","胢","髂"],"jìng chēng":["净","凈","淨"],sōu:["凁","嗖","廀","廋","捜","搜","摉","溲","獀","艘","蒐","螋","鄋","醙","鎪","锼","颼","飕","餿","馊","騪"],měi:["凂","媄","媺","嬍","嵄","挴","毎","每","浼","渼","燘","美","躾","鎂","镁","黣"],tú:["凃","図","图","圖","圗","塗","屠","峹","嵞","庩","廜","徒","悇","揬","涂","瘏","筡","腯","荼","蒤","跿","途","酴","鈯","鍎","馟","駼","鵌","鶟","鷋","鷵","𬳿"],zhǔn:["准","凖","埻","準","𬘯"],"liáng liàng":["凉","涼","量"],diāo:["凋","刁","刟","叼","奝","弴","彫","汈","琱","碉","簓","虭","蛁","貂","錭","雕","鮉","鯛","鲷","鵰","鼦"],còu:["凑","湊","腠","輳","辏"],ái:["凒","啀","嘊","捱","溰","癌","皑","皚"],duó:["凙","剫","夺","奪","痥","踱","鈬","鐸","铎"],dú:["凟","匵","嬻","椟","櫝","殰","涜","牍","牘","犊","犢","独","獨","瓄","皾","裻","読","讀","讟","豄","贕","錖","鑟","韇","韣","韥","騳","髑","黩","黷"],"jǐ jī":["几"],fán:["凡","凢","凣","匥","墦","杋","柉","棥","樊","瀿","烦","煩","燔","璠","矾","礬","笲","籵","緐","羳","舤","舧","薠","蘩","蠜","襎","蹯","釩","鐇","鐢","钒","鷭","𫔍","𬸪"],jū:["凥","匊","娵","婮","居","崌","抅","挶","掬","梮","椐","檋","毩","毱","泃","涺","狙","琚","疽","砠","罝","腒","艍","蜛","裾","諊","跔","踘","躹","陱","雎","鞠","鞫","駒","驹","鮈","鴡","鶋","𬶋"],"chù chǔ":["処","处"],zhǐ:["凪","劧","咫","址","坧","帋","恉","扺","指","旨","枳","止","汦","沚","洔","淽","疻","砋","祉","秖","紙","纸","芷","藢","衹","襧","訨","趾","軹","轵","酯","阯","黹"],píng:["凭","凴","呯","坪","塀","岼","帡","帲","幈","平","慿","憑","枰","洴","焩","玶","瓶","甁","竮","箳","簈","缾","荓","萍","蓱","蚲","蛢","評","评","軿","輧","郱","鮃","鲆"],kǎi:["凯","凱","剀","剴","垲","塏","恺","愷","慨","暟","蒈","輆","鍇","鎧","铠","锴","闓","闿","颽"],gān:["凲","坩","尲","尴","尶","尷","柑","泔","漧","玕","甘","疳","矸","竿","筸","粓","肝","苷","迀","酐","魐"],"kǎn qiǎn":["凵"],tū:["凸","堗","嶀","捸","涋","湥","痜","禿","秃","突","葖","鋵","鵚","鼵","㻬"],"āo wā":["凹"],chū:["出","初","岀","摴","榋","樗","貙","齣","䢺","䝙"],dàng:["凼","圵","垱","壋","档","檔","氹","璗","瓽","盪","瞊","砀","碭","礑","簜","荡","菪","蕩","蘯","趤","逿","雼","𬍡"],hán:["函","凾","含","圅","娢","寒","崡","晗","梒","浛","涵","澏","焓","琀","甝","筨","蜬","邗","邯","鋡","韓","韩"],záo:["凿","鑿"],dāo:["刀","刂","忉","氘","舠","螩","釖","魛","鱽"],chuāng:["刅","摐","牎","牕","疮","瘡","窓","窗","窻"],"fēn fèn":["分"],"qiè qiē":["切"],kān:["刊","勘","堪","戡","栞","龕","龛"],cǔn:["刌","忖"],chú:["刍","厨","幮","廚","橱","櫉","櫥","滁","犓","篨","耡","芻","蒢","蒭","蜍","蟵","豠","趎","蹰","躇","躕","鉏","鋤","锄","除","雏","雛","鶵"],"huà huá":["划"],lí:["刕","剓","剺","劙","厘","喱","嚟","囄","嫠","孷","廲","悡","梨","梸","棃","漓","灕","犁","犂","狸","琍","璃","瓈","盠","睝","离","穲","竰","筣","篱","籬","糎","縭","缡","罹","艃","荲","菞","蓠","蔾","藜","蘺","蜊","蟍","蟸","蠫","褵","謧","貍","醨","鋫","錅","鏫","鑗","離","驪","骊","鯏","鯬","鱺","鲡","鵹","鸝","鹂","黎","黧","㰀"],yuè:["刖","嬳","岄","岳","嶽","恱","悅","悦","戉","抈","捳","月","樾","瀹","爚","玥","礿","禴","篗","籆","籥","籰","粤","粵","蘥","蚎","蚏","説","越","跀","跃","躍","軏","鈅","鉞","鑰","钺","閱","閲","阅","鸑","鸙","黦","龠","𫐄","𬸚"],liú:["刘","劉","嚠","媹","嵧","旈","旒","榴","橊","流","浏","瀏","琉","瑠","瑬","璢","畄","留","畱","疁","瘤","癅","硫","蒥","蓅","蟉","裗","鎏","鏐","鐂","镠","飀","飅","飗","駠","駵","騮","驑","骝","鰡","鶹","鹠","麍"],zé:["则","則","啧","嘖","嫧","帻","幘","択","樍","歵","沢","泎","溭","皟","瞔","矠","礋","箦","簀","舴","蔶","蠌","襗","謮","賾","赜","迮","鸅","齚","齰"],"chuàng chuāng":["创","創"],qù:["刞","厺","去","閴","闃","阒","麮","鼁"],"bié biè":["別","别"],"páo bào":["刨"],"chǎn chàn":["刬","剗","幝"],guā:["刮","劀","桰","歄","煱","瓜","胍","踻","颪","颳","騧","鴰","鸹"],gēng:["刯","庚","椩","浭","焿","畊","絚","羮","羹","耕","菮","賡","赓","鶊","鹒"],dào:["到","噵","悼","椡","檤","燾","瓙","盗","盜","稲","稻","纛","翿","艔","菿","衜","衟","軇","道"],chuàng:["刱","剏","剙","怆","愴"],kū:["刳","哭","圐","堀","枯","桍","矻","窟","跍","郀","骷","鮬"],duò:["刴","剁","墯","尮","惰","憜","挅","桗","舵","跥","跺","陊","陏","飿","饳","鵽"],"shuā shuà":["刷"],"quàn xuàn":["券"],"chà shā":["刹","剎"],"cì cī":["刺"],guì:["刽","刿","劊","劌","撌","攰","昋","桂","椢","槶","樻","櫃","猤","禬","筀","蓕","襘","貴","贵","跪","鐀","鑎","鞼","鱖","鱥"],lóu:["剅","娄","婁","廔","楼","樓","溇","漊","熡","耧","耬","艛","蒌","蔞","蝼","螻","謱","軁","遱","鞻","髅","髏","𪣻"],cuò:["剉","剒","厝","夎","挫","措","棤","莝","莡","蓌","逪","銼","錯","锉","错"],"xiāo xuē":["削"],"kēi kè":["剋","尅"],"là lá":["剌"],tī:["剔","梯","踢","銻","锑","鷈","鷉","䏲","䴘"],pōu:["剖"],wān:["剜","塆","壪","帵","弯","彎","湾","潫","灣","睕","蜿","豌"],"bāo bō":["剝","剥"],duō:["剟","咄","哆","嚉","多","夛","掇","毲","畓","裰","㙍"],qíng:["剠","勍","夝","情","擎","晴","暒","棾","樈","檠","氰","甠","硘","葝","黥"],"yǎn shàn":["剡"],"dū zhuó":["剢"],yān:["剦","嫣","崦","嶖","恹","懕","懨","樮","淊","淹","漹","烟","焉","焑","煙","珚","篶","胭","臙","菸","鄢","醃","閹","阉","黫"],huō:["剨","劐","吙","攉","秴","耠","锪","騞","𬴃"],shèng:["剩","剰","勝","圣","墭","嵊","晠","榺","橳","琞","聖","蕂","貹","賸"],"duān zhì":["剬"],wū:["剭","呜","嗚","圬","屋","巫","弙","杇","歍","汙","汚","污","洿","烏","窏","箼","螐","誈","誣","诬","邬","鄔","鎢","钨","鰞","鴮"],gē:["割","哥","圪","彁","戈","戓","戨","歌","滒","犵","肐","袼","謌","鎶","鴚","鴿","鸽"],"dá zhá":["剳"],chuán:["剶","暷","椽","篅","舡","舩","船","輲","遄"],"tuán zhuān":["剸","漙","篿"],"lù jiū":["剹"],pēng:["剻","匉","嘭","怦","恲","抨","梈","烹","砰","軯","駍"],piāo:["剽","勡","慓","旚","犥","翲","螵","飃","飄","飘","魒"],kōu:["剾","彄","抠","摳","眍","瞘","芤","𫸩"],"jiǎo chāo":["剿","劋","勦","摷"],qiāo:["劁","勪","墝","幧","敲","橇","毃","燆","硗","磽","繑","趬","跷","踍","蹺","蹻","郻","鄡","鄥","鍫","鍬","鐰","锹","頝"],"huá huà":["劃"],"zhā zhá":["劄"],"pī pǐ":["劈","悂"],tāng:["劏","嘡","羰","薚","蝪","蹚","鞺","鼞"],chán:["劖","嚵","壥","婵","嬋","巉","廛","棎","毚","湹","潹","潺","澶","瀍","瀺","煘","獑","磛","緾","纏","纒","缠","艬","蝉","蟐","蟬","蟾","誗","讒","谗","躔","鄽","酁","鋋","鑱","镵","饞","馋"],zuān:["劗","躜","躦","鉆","鑚"],mó:["劘","嫫","嬤","嬷","尛","摹","擵","橅","糢","膜","藦","蘑","謨","謩","谟","饃","饝","馍","髍","魔","魹"],zhú:["劚","斸","曯","欘","灟","炢","烛","燭","爥","瘃","竹","笁","笜","舳","茿","蓫","蠋","蠾","躅","逐","逫","钃","鱁"],quàn:["劝","勧","勸","牶","韏"],"jìn jìng":["劤","劲","勁"],kēng:["劥","坑","牼","硁","硜","誙","銵","鍞","鏗","铿","阬"],"xié liè":["劦"],"zhù chú":["助"],nǔ:["努","弩","砮","胬"],shào:["劭","卲","哨","潲","紹","綤","绍","袑","邵"],miǎo:["劰","杪","淼","渺","眇","秒","篎","緲","缈","藐","邈"],kǒu:["劶","口"],wā:["劸","娲","媧","屲","挖","攨","洼","溛","漥","瓾","畖","穵","窊","窪","蛙","韈","鼃"],kuāng:["劻","匡","匩","哐","恇","洭","筐","筺","誆","诓","軭","邼"],hé:["劾","咊","啝","姀","峆","敆","曷","柇","楁","毼","河","涸","渮","澕","熆","皬","盇","盉","盍","盒","禾","篕","籺","粭","翮","菏","萂","覈","訸","詥","郃","釛","鉌","鑉","閡","闔","阂","阖","鞨","頜","餄","饸","魺","鹖","麧","齕","龁","龢","𬌗"],gào:["勂","吿","告","峼","祮","祰","禞","筶","誥","诰","郜","鋯","锆"],"bó bèi":["勃"],láng:["勆","嫏","廊","斏","桹","榔","樃","欴","狼","琅","瑯","硠","稂","艆","蓈","蜋","螂","躴","郒","郞","鋃","鎯","锒"],xūn:["勋","勛","勲","勳","嚑","坃","埙","塤","壎","壦","曛","燻","獯","矄","纁","臐","薫","薰","蘍","醺","𫄸"],"juàn juān":["勌","瓹"],"lè lēi":["勒"],kài:["勓","炌","烗","鎎"],"wěng yǎng":["勜"],qín:["勤","嗪","噙","嶜","庈","懃","懄","捦","擒","斳","檎","澿","珡","琴","琹","瘽","禽","秦","耹","芩","芹","菦","螓","蠄","鈙","鈫","雂","靲","鳹","鵭"],jiàng:["勥","匞","匠","嵹","弜","弶","摾","櫤","洚","滰","犟","糡","糨","絳","绛","謽","酱","醤","醬"],fān:["勫","嬏","帆","幡","忛","憣","旙","旛","繙","翻","藩","轓","颿","飜","鱕"],juān:["勬","姢","娟","捐","涓","蠲","裐","鎸","鐫","镌","鹃"],"tóng dòng":["勭","烔","燑","狪"],lǜ:["勴","垏","嵂","律","慮","氯","滤","濾","爈","箻","綠","繂","膟","葎","虑","鑢"],chè:["勶","坼","彻","徹","掣","撤","澈","烢","爡","瞮","硩","聅","迠","頙","㬚"],sháo:["勺","玿","韶"],"gōu gòu":["勾"],cōng:["匆","囪","囱","忩","怱","悤","暰","樬","漗","瑽","璁","瞛","篵","繱","聡","聦","聪","聰","苁","茐","葱","蓯","蔥","蟌","鍯","鏓","鏦","騘","驄","骢"],"táo yáo":["匋","陶"],páo:["匏","咆","垉","庖","爮","狍","袍","褜","軳","鞄","麅"],dá:["匒","妲","怛","炟","燵","畣","笪","羍","荙","薘","蟽","詚","达","迏","迖","迚","逹","達","鐽","靼","鞑","韃","龖","龘","𫟼"],"huà huā":["化"],"běi bèi":["北"],nǎo:["匘","垴","堖","嫐","恼","悩","惱","瑙","碯","脑","脳","腦"],"chí shi":["匙"],fāng:["匚","堏","方","淓","牥","芳","邡","鈁","錺","钫","鴋"],zā:["匝","咂","帀","沞","臜","臢","迊","鉔","魳"],qiè:["匧","厒","妾","怯","悏","惬","愜","挈","穕","窃","竊","笡","箧","篋","籡","踥","鍥","锲","鯜"],"zāng cáng":["匨"],fěi:["匪","奜","悱","棐","榧","篚","翡","蕜","誹","诽"],"kuì guì":["匮","匱"],suǎn:["匴"],pǐ:["匹","噽","嚭","圮","庀","痞","癖","脴","苉","銢","鴄"],"qū ōu":["区","區"],"kē qià":["匼"],"yǎn yàn":["匽","棪"],biǎn:["匾","惼","揙","碥","稨","窆","藊","褊","貶","贬","鴘"],nì:["匿","堄","嫟","嬺","惄","愵","昵","暱","氼","眤","睨","縌","胒","腻","膩","逆","𨺙"],niàn:["卄","唸","埝","廿","念","惗","艌"],sà:["卅","櫒","脎","萨","蕯","薩","鈒","隡","颯","飒","馺"],zú:["卆","哫","崪","族","箤","足","踤","镞"],shēng:["升","呏","声","斘","昇","曻","枡","殅","泩","湦","焺","牲","珄","生","甥","竔","笙","聲","鉎","鍟","阩","陞","陹","鵿","鼪"],wàn:["卍","卐","忨","杤","瞣","脕","腕","萬","蟃","贎","輐","錽","𬇕"],"huá huà huā":["华","華"],bēi:["卑","悲","揹","杯","桮","盃","碑","藣","鵯","鹎"],"zú cù":["卒"],"dān shàn chán":["单","單"],"nán nā":["南"],"shuài lǜ":["卛"],"bǔ bo pú":["卜"],"kuàng guàn":["卝"],biàn:["卞","变","変","峅","弁","徧","忭","抃","昪","汳","汴","玣","艑","苄","覍","諚","變","辡","辧","辨","辩","辫","辮","辯","遍","釆","𨚕"],bǔ:["卟","哺","捕","补","補","鸔","𬷕"],"zhàn zhān":["占","覱"],"kǎ qiǎ":["卡"],lú:["卢","嚧","垆","壚","庐","廬","曥","枦","栌","櫨","泸","瀘","炉","爐","獹","玈","瓐","盧","矑","籚","纑","罏","胪","臚","舮","舻","艫","芦","蘆","蠦","轤","轳","鈩","鑪","顱","颅","馿","髗","魲","鱸","鲈","鸕","鸬","黸","𬬻"],lǔ:["卤","塷","掳","擄","樐","橹","櫓","氌","滷","澛","瀂","硵","磠","穞","艣","艪","蓾","虏","虜","鏀","鐪","鑥","镥","魯","鲁","鹵"],guà:["卦","啩","挂","掛","罣","褂","詿","诖"],"áng yǎng":["卬"],yìn:["印","垽","堷","廕","慭","憖","憗","懚","洕","湚","猌","癊","胤","茚","酳","鮣","䲟"],què:["却","卻","塙","崅","悫","愨","慤","搉","榷","燩","琷","皵","确","確","礭","闋","阕","鵲","鹊","𬒈"],luǎn:["卵"],"juàn juǎn":["卷","巻"],"chǎng ān hàn":["厂"],"wěi yán":["厃"],tīng:["厅","厛","听","庁","廰","廳","汀","烃","烴","綎","耓","聴","聼","聽","鞓","𬘩"],"zhé zhái":["厇"],"hàn àn":["厈","屽"],yǎ:["厊","唖","庌","痖","瘂","蕥"],shè:["厍","厙","弽","慑","慴","懾","摂","欇","涉","涻","渉","滠","灄","社","舎","蔎","蠂","設","设","赦","騇","麝"],dǐ:["厎","呧","坘","弤","抵","拞","掋","牴","砥","菧","觝","詆","诋","軧","邸","阺","骶","鯳"],"zhǎ zhǎi":["厏"],páng:["厐","嫎","庞","徬","舽","螃","逄","鰟","鳑","龎","龐"],"zhì shī":["厔"],máng:["厖","吂","哤","娏","忙","恾","杗","杧","汒","浝","牻","痝","盲","硭","笀","芒","茫","蘉","邙","釯","鋩","铓","駹"],zuī:["厜","樶","纗","蟕"],"shà xià":["厦","廈"],áo:["厫","嗷","嗸","廒","敖","滶","獒","獓","璈","翱","翶","翺","聱","蔜","螯","謷","謸","遨","鏖","隞","鰲","鳌","鷔","鼇"],"lán qiān":["厱"],"sī mǒu":["厶"],"gōng hóng":["厷"],"lín miǎo":["厸"],"qiú róu":["厹"],dū:["厾","嘟","督","醏"],"xiàn xuán":["县","縣"],"cān shēn cēn sān":["参","參","叄","叅"],"ài yǐ":["叆"],"chā chà chǎ chá":["叉"],shuāng:["双","孀","孇","欆","礵","艭","雙","霜","騻","驦","骦","鷞","鸘","鹴"],shōu:["収","收"],guái:["叏"],bá:["叐","妭","抜","拔","炦","癹","胈","茇","菝","詙","跋","軷","魃","鼥"],"fā fà":["发"],"zhuó yǐ lì jué":["叕"],qǔ:["取","娶","竬","蝺","詓","齲","龋"],"jiǎ xiá":["叚","徦"],"wèi yù":["叞","尉","蔚"],dié:["叠","垤","堞","峌","幉","恎","惵","戜","曡","殜","氎","牃","牒","瓞","畳","疂","疉","疊","碟","絰","绖","耊","耋","胅","艓","苵","蜨","蝶","褋","詄","諜","谍","跮","蹀","迭","镻","鰈","鲽","鴩","𫶇"],ruì:["叡","枘","汭","瑞","睿","芮","蚋","蜹","銳","鋭","锐"],"jù gōu":["句"],lìng:["另","呤","炩","蘦"],"dāo dáo tāo":["叨"],"zhī zhǐ":["只"],jiào:["叫","呌","嘂","嘦","噍","嬓","斍","斠","滘","漖","獥","珓","皭","窖","藠","訆","譥","趭","較","轎","轿","较","酵","醮","釂"],"zhào shào":["召"],"kě kè":["可"],"tái tāi":["台","苔"],pǒ:["叵","尀","笸","箥","鉕","钷","駊"],"yè xié":["叶"],"hào háo":["号"],tàn:["叹","嘆","探","歎","湠","炭","碳","舕"],"hōng hóng":["叿"],miē:["吀","咩","哶","孭"],"xū yū yù":["吁"],chī:["吃","哧","喫","嗤","噄","妛","媸","彨","彲","摛","攡","殦","瓻","痴","癡","眵","瞝","笞","粚","胵","蚩","螭","訵","魑","鴟","鵄","鸱","黐","齝","𫄨"],"xuān sòng":["吅"],yāo:["吆","喓","夭","妖","幺","楆","殀","祅","腰","葽","訞","邀","鴁","鴢","㙘"],zǐ:["吇","姉","姊","子","杍","梓","榟","橴","滓","矷","秭","笫","籽","紫","耔","虸","訿","釨"],"hé gě":["合","鲄"],"cùn dòu":["吋"],"tóng tòng":["同"],"tǔ tù":["吐","唋"],"zhà zhā":["吒","奓"],"xià hè":["吓"],"ā yā":["吖"],"ma má mǎ":["吗"],lìn:["吝","恡","悋","橉","焛","甐","膦","蔺","藺","賃","赁","蹸","躏","躙","躪","轥","閵"],tūn:["吞","暾","朜","焞"],"bǐ pǐ":["吡"],qìn:["吢","吣","唚","抋","揿","搇","撳","沁","瀙","菣","藽"],"jiè gè":["吤"],"fǒu pǐ":["否"],"ba bā":["吧"],dūn:["吨","噸","墩","墪","惇","撉","撴","犜","獤","礅","蜳","蹾","驐"],fēn:["吩","帉","昐","朆","梤","棻","氛","竕","紛","纷","翂","芬","衯","訜","躮","酚","鈖","雰","餴","饙","馚"],"é huā":["吪"],"kēng háng":["吭","妔"],shǔn:["吮"],"zhī zī":["吱"],"yǐn shěn":["吲"],wú:["吳","吴","呉","墲","峿","梧","橆","毋","洖","浯","無","珸","璑","祦","芜","茣","莁","蕪","蜈","蟱","譕","郚","鋙","铻","鯃","鵐","鷡","鹀","鼯"],"chǎo chāo":["吵"],"nà nè":["吶"],"xuè chuò jué":["吷"],chuī:["吹","炊","龡"],"dōu rú":["吺"],hǒu:["吼","犼"],"hōng hǒu ōu":["吽"],"wú yù":["吾"],"ya yā":["呀"],"è e":["呃"],dāi:["呆","懛","獃"],"mèn qǐ":["呇"],hōng:["呍","嚝","揈","灴","烘","焢","硡","薨","訇","谾","軣","輷","轟","轰","鍧"],nà:["呐","捺","笝","納","纳","肭","蒳","衲","豽","貀","軜","郍","鈉","钠","靹","魶"],"tūn tiān":["呑"],"fǔ ḿ":["呒","嘸"],"dāi tǎi":["呔"],"ǒu ōu òu":["呕"],"bài bei":["呗"],"yuán yún yùn":["员","員"],guō:["呙","啯","嘓","埚","堝","墎","崞","彉","彍","懖","猓","瘑","聒","蝈","蟈","郭","鈛","鍋","锅"],"huá qì":["呚"],"qiàng qiāng":["呛","跄"],shī:["呞","失","尸","屍","师","師","施","浉","湤","湿","溮","溼","濕","狮","獅","瑡","絁","葹","蒒","蓍","虱","蝨","褷","襹","詩","诗","邿","釃","鉇","鍦","鯴","鰤","鲺","鳲","鳾","鶳","鸤","䴓","𫚕"],juǎn:["呟","埍","臇","菤","錈","锩"],pěn:["呠","翸"],"wěn mǐn":["呡"],"ne ní":["呢"],"ḿ m̀ móu":["呣"],rán:["呥","嘫","然","燃","繎","肰","蚦","蚺","衻","袇","袡","髥","髯"],"tiè chè":["呫"],"qì zhī":["呮"],"zǐ cī":["呰"],"guā gū guǎ":["呱"],"cī zī":["呲"],"hǒu xǔ gòu":["呴"],"hē ā á ǎ à a":["呵"],náo:["呶","夒","峱","嶩","巎","挠","撓","猱","硇","蛲","蟯","詉","譊","鐃","铙"],"xiā gā":["呷"],pēi:["呸","怌","肧","胚","衃","醅"],"háo xiāo":["呺"],mìng:["命","掵"],"dá dàn":["呾"],"zuǐ jǔ":["咀"],"xián gān":["咁"],pǒu:["咅","哣","犃"],"yǎng yāng":["咉"],"zǎ zé zhā":["咋"],"hé hè huó huò hú":["和"],hāi:["咍"],dā:["咑","哒","噠","墶","搭","撘","耷","褡","鎝","𨱏"],"kǎ kā":["咔"],gū:["咕","唂","唃","姑","嫴","孤","巬","巭","柧","橭","沽","泒","稒","笟","箍","箛","篐","罛","苽","菇","菰","蓇","觚","軱","軲","轱","辜","酤","鈲","鮕","鴣","鸪"],"kā gā":["咖"],zuo:["咗"],lóng:["咙","嚨","嶐","巃","巄","昽","曨","朧","栊","槞","櫳","湰","滝","漋","爖","珑","瓏","癃","眬","矓","砻","礱","礲","窿","竜","聋","聾","胧","茏","蘢","蠪","蠬","襱","豅","鏧","鑨","霳","靇","驡","鸗","龍","龒","龙"],"xiàn xián":["咞"],qì:["咠","唭","噐","器","夡","弃","憇","憩","暣","棄","欫","气","気","氣","汔","汽","泣","湆","湇","炁","甈","盵","矵","碛","碶","磜","磧","罊","芞","葺","藒","蟿","訖","讫","迄","鐑"],"xì dié":["咥"],"liē liě lié lie":["咧"],zī:["咨","嗞","姕","姿","孜","孳","孶","崰","嵫","栥","椔","淄","湽","滋","澬","玆","禌","秶","粢","紎","緇","緕","纃","缁","茊","茲","葘","諮","谘","貲","資","赀","资","赼","趑","趦","輜","輺","辎","鄑","鈭","錙","鍿","鎡","锱","镃","頾","頿","髭","鯔","鰦","鲻","鶅","鼒","齍","齜","龇"],mī:["咪"],"jī xī qià":["咭"],"gē luò kǎ lo":["咯"],"shù xún":["咰"],"zán zá zǎ zan":["咱"],"hāi ké":["咳"],huī:["咴","噅","噕","婎","媈","幑","徽","恢","拻","挥","揮","晖","暉","楎","洃","瀈","灰","灳","烣","睳","禈","翚","翬","蘳","袆","褘","詼","诙","豗","輝","辉","鰴","麾","㧑"],"huài shì":["咶"],táo:["咷","啕","桃","檮","洮","淘","祹","綯","绹","萄","蜪","裪","迯","逃","醄","鋾","鞀","鞉","饀","駣","騊","鼗","𫘦"],xián:["咸","啣","娴","娹","婱","嫌","嫺","嫻","弦","挦","撏","涎","湺","澖","甉","痫","癇","癎","絃","胘","舷","藖","蚿","蛝","衔","衘","誸","諴","賢","贒","贤","輱","醎","銜","鑦","閑","闲","鷳","鷴","鷼","鹇","鹹","麙","𫍯"],"è àn":["咹"],"xuān xuǎn":["咺","烜"],"wāi hé wǒ guǎ guō":["咼"],"yàn yè yān":["咽"],āi:["哀","哎","埃","溾","銰","鎄","锿"],pǐn:["品","榀"],shěn:["哂","婶","嬸","审","宷","審","弞","曋","渖","瀋","瞫","矤","矧","覾","訠","諗","讅","谂","谉","邥","頣","魫"],"hǒng hōng hòng":["哄"],"wā wa":["哇"],"hā hǎ hà":["哈"],zāi:["哉","栽","渽","溨","災","灾","烖","睵","賳"],"dì diè":["哋"],pài:["哌","沠","派","渒","湃","蒎","鎃"],"gén hěn":["哏"],"yǎ yā":["哑","雅"],"yuě huì":["哕","噦"],nián:["哖","年","秊","秥","鮎","鯰","鲇","鲶","鵇","黏"],"huá huā":["哗","嘩"],"jì jiē zhāi":["哜","嚌"],mōu:["哞"],"yō yo":["哟","喲"],lòng:["哢","梇","贚"],"ò ó é":["哦"],"lī lǐ li":["哩"],"nǎ na nǎi né něi":["哪"],hè:["哬","垎","壑","寉","惒","焃","煂","燺","爀","癋","碋","翯","褐","謞","賀","贺","赫","靍","靎","靏","鶴","鸖","鹤"],"bō pò bā":["哱"],zhé:["哲","啠","喆","嚞","埑","悊","摺","晢","晣","歽","矺","砓","磔","籷","粍","虴","蛰","蟄","袩","詟","謫","謺","讁","讋","谪","輒","輙","轍","辄","辙","鮿"],"liàng láng":["哴"],"liè lǜ":["哷"],hān:["哻","憨","蚶","谽","酣","頇","顸","馠","魽","鼾"],"hēng hng":["哼"],gěng:["哽","埂","峺","挭","梗","綆","绠","耿","莄","郠","骾","鯁","鲠","𬒔"],"chuò yuè":["哾"],"gě jiā":["哿"],"bei bài":["唄"],"hán hàn":["唅"],chún:["唇","浱","湻","滣","漘","犉","純","纯","脣","莼","蒓","蓴","醇","醕","錞","陙","鯙","鶉","鹑","𬭚"],"ài āi":["唉"],"jiá qiǎn":["唊"],"yán dàn xián":["唌"],chē:["唓","砗","硨","莗","蛼"],"wú ńg ń":["唔"],zào:["唕","唣","噪","慥","梍","灶","煰","燥","皁","皂","竃","竈","簉","艁","譟","趮","躁","造","𥖨"],dí:["唙","啇","嘀","嚁","嫡","廸","敌","敵","梑","涤","滌","狄","笛","籴","糴","苖","荻","蔋","蔐","藡","覿","觌","豴","迪","靮","頔","馰","髢","鸐","𬱖"],"gòng hǒng gǒng":["唝","嗊"],dóu:["唞"],"lào láo":["唠","嘮","憦"],huàn:["唤","喚","奂","奐","宦","嵈","幻","患","愌","换","換","擐","攌","梙","槵","浣","涣","渙","漶","澣","烉","焕","煥","瑍","痪","瘓","睆","肒","藧","豢","轘","逭","鯇","鯶","鰀","鲩"],léng:["唥","塄","楞","碐","薐"],"wō wěi":["唩"],fěng:["唪","覂","諷","讽"],"yín jìn":["唫"],"hǔ xià":["唬"],wéi:["唯","围","圍","壝","峗","峞","嵬","帏","帷","幃","惟","桅","沩","洈","涠","湋","溈","潍","潙","潿","濰","犩","矀","維","维","蓶","覹","违","違","鄬","醀","鍏","闈","闱","韋","韦","鮠","𣲗","𬶏"],shuā:["唰"],chàng:["唱","怅","悵","暢","焻","畅","畼","誯","韔","鬯"],"ér wā":["唲"],qiàng:["唴","炝","熗","羻"],yō:["唷"],yū:["唹","淤","瘀","盓","箊","紆","纡","込","迂","迃","陓"],lài:["唻","濑","瀨","瀬","癞","癩","睐","睞","籁","籟","藾","賚","賴","赉","赖","頼","顂","鵣"],tuò:["唾","嶞","柝","毤","毻","箨","籜","萚","蘀","跅"],"zhōu zhāo tiào":["啁"],kěn:["啃","垦","墾","恳","懇","肎","肯","肻","豤","錹"],"zhuó zhào":["啅","濯"],"hēng hèng":["啈","悙"],"lín lán":["啉"],"a ā á ǎ à":["啊"],qiāng:["啌","嗴","嶈","戕","摤","斨","枪","槍","溬","牄","猐","獇","羌","羗","腔","蜣","謒","鏘","锖","锵"],"tūn zhūn xiāng duǐ":["啍"],wèn:["問","妏","揾","搵","璺","问","顐"],"cuì qi":["啐"],"dié shà jié tì":["啑"],"yuē wā":["啘"],"zǐ cǐ":["啙"],"bǐ tú":["啚"],"chuò chuài":["啜"],"yǎ yā è":["啞"],fēi:["啡","婓","婔","扉","暃","渄","猆","緋","绯","裶","霏","非","靟","飛","飝","飞","餥","馡","騑","騛","鯡","鲱","𬴂"],pí:["啤","壀","枇","毗","毘","焷","琵","疲","皮","篺","罴","羆","脾","腗","膍","蚍","蚽","蜱","螷","蠯","豼","貔","郫","鈹","阰","陴","隦","魮","鮍","鲏","鵧","鼙"],shá:["啥"],"lā la":["啦"],"yīng qíng":["啨"],pā:["啪","妑","舥","葩","趴"],"zhě shì":["啫"],sè:["啬","嗇","懎","擌","栜","歮","涩","渋","澀","澁","濇","濏","瀒","瑟","璱","瘷","穑","穡","穯","繬","譅","轖","銫","鏼","铯","飋"],niè:["啮","嗫","噛","嚙","囁","囓","圼","孼","孽","嵲","嶭","巕","帇","敜","枿","槷","櫱","涅","湼","痆","篞","籋","糱","糵","聂","聶","臬","臲","蘖","蠥","讘","踂","踗","踙","蹑","躡","錜","鎳","鑈","鑷","钀","镊","镍","闑","陧","隉","顳","颞","齧","𫔶"],"luō luó luo":["啰","囉"],"tān chǎn tuō":["啴"],bo:["啵","蔔"],dìng:["啶","定","椗","矴","碇","碠","磸","聢","腚","萣","蝊","訂","订","錠","锭","顁","飣","饤"],lāng:["啷"],"án ān":["啽"],kā:["喀","擖"],"yóng yú":["喁"],"lā lá lǎ":["喇"],jiē:["喈","喼","嗟","堦","媘","接","掲","擑","湝","煯","疖","痎","癤","皆","秸","稭","脻","蝔","街","謯","阶","階","鞂","鶛"],hóu:["喉","帿","猴","瘊","睺","篌","糇","翭","葔","鄇","鍭","餱","骺","鯸","𬭤"],"dié zhá":["喋"],wāi:["喎","歪","竵"],"nuò rě":["喏"],"xù huò guó":["喐"],zán:["喒"],"wō ō":["喔"],hú:["喖","嘝","囫","壶","壷","壺","媩","弧","搰","斛","楜","槲","湖","瀫","焀","煳","狐","猢","瑚","瓳","箶","絗","縠","胡","葫","蔛","蝴","螜","衚","觳","醐","鍸","頶","餬","鬍","魱","鰗","鵠","鶘","鶦","鹕"],"huàn yuán xuǎn hé":["喛"],xǐ:["喜","囍","壐","屣","徙","憙","枲","橲","歖","漇","玺","璽","矖","禧","縰","葈","葸","蓰","蟢","謑","蹝","躧","鈢","鉨","鉩","鱚","𬭳","𬶮"],"hē hè yè":["喝"],kuì:["喟","嘳","媿","嬇","愦","愧","憒","篑","簣","籄","聩","聭","聵","膭","蕢","謉","餽","饋","馈"],"zhǒng chuáng":["喠"],"wéi wèi":["喡","為","爲"],"duó zhà":["喥"],"sāng sàng":["喪"],"qiáo jiāo":["喬"],"pèn bēn":["喯"],"cān sūn qī":["喰"],"zhā chā":["喳"],miāo:["喵"],"pēn pèn":["喷"],kuí:["喹","夔","奎","巙","戣","揆","晆","暌","楏","楑","櫆","犪","睽","葵","藈","蘷","虁","蝰","躨","逵","鄈","鍨","鍷","頯","馗","騤","骙","魁"],"lou lóu":["喽"],"zào qiāo":["喿"],"hè xiāo xiào hù":["嗃"],"á shà":["嗄"],xiù:["嗅","岫","峀","溴","珛","琇","璓","秀","綉","繍","繡","绣","螑","袖","褎","褏","銹","鏥","鏽","锈","齅"],"qiāng qiàng":["嗆","戗","戧","蹌","蹡"],"ài yì":["嗌","艾"],"má mǎ ma":["嗎"],"kè kē":["嗑"],"dā tà":["嗒","鎉"],sǎng:["嗓","搡","磉","褬","鎟","顙","颡"],chēn:["嗔","抻","琛","瞋","諃","謓","賝","郴","𬘭"],"wā gǔ":["嗗"],"pǎng bēng":["嗙"],"xián qiǎn qiān":["嗛"],lào:["嗠","嫪","橯","涝","澇","耢","耮","躼","軂","酪"],wēng:["嗡","翁","聬","螉","鎓","鶲","鹟","𬭩"],wà:["嗢","腽","膃","袜","襪","韤"],"hēi hāi":["嗨"],hē:["嗬","欱","蠚","訶","诃"],zi:["嗭"],sǎi:["嗮"],"ǹg ńg ňg":["嗯"],gě:["嗰","舸"],ná:["嗱","拏","拿","鎿","镎"],diǎ:["嗲"],"ài ǎi āi":["嗳"],tōng:["嗵","樋","炵","蓪"],"zuī suī":["嗺"],"zhē zhè zhù zhe":["嗻"],mò:["嗼","圽","塻","墨","妺","嫼","寞","帞","昩","末","枺","歿","殁","沫","漠","爅","獏","瘼","皌","眽","眿","瞐","瞙","砞","礳","秣","絈","纆","耱","茉","莈","蓦","蛨","蟔","貃","貊","貘","銆","鏌","镆","陌","靺","驀","魩","默","黙","𬙊"],sòu:["嗽","瘶"],tǎn:["嗿","坦","忐","憳","憻","暺","毯","璮","菼","袒","襢","醓","鉭","钽"],"jiào dǎo":["嘄"],"kǎi gě":["嘅"],"shān càn":["嘇"],cáo:["嘈","嶆","曹","曺","槽","漕","艚","蓸","螬","褿","鏪","𥕢"],piào:["嘌","徱","蔈","驃"],"lóu lou":["嘍"],gǎ:["尕","玍"],"gǔ jiǎ":["嘏"],"jiāo xiāo":["嘐"],"xū shī":["嘘","噓"],pó:["嘙","嚩","婆","櫇","皤","鄱"],"dē dēi":["嘚"],"ma má":["嘛"],"lē lei":["嘞"],"gā gá gǎ":["嘠"],sāi:["嘥","噻","毢","腮","顋","鰓"],"zuō chuài":["嘬"],"cháo zhāo":["嘲","朝","鼂"],zuǐ:["嘴","噿","嶊","璻"],"qiáo qiào":["嘺","翹","谯"],"chù xù shòu":["嘼"],"tān chǎn":["嘽"],"dàn tán":["嘾","弾","彈","惔","澹"],"hēi mò":["嘿"],ě:["噁","砨","頋","騀","鵈"],"fān bo":["噃"],chuáng:["噇","床","牀"],"cù zā hé":["噈"],"tūn kuò":["噋"],"cēng chēng":["噌"],dēng:["噔","嬁","灯","燈","璒","登","竳","簦","艠","豋"],pū:["噗","扑","撲","攴","攵","潽","炇","陠"],juē:["噘","屩","屫","撧"],lū:["噜","嚕","撸","擼","謢"],zhān:["噡","岾","惉","旃","旜","枬","栴","毡","氈","氊","沾","瞻","薝","蛅","詀","詹","譫","谵","趈","邅","閚","霑","飦","饘","驙","魙","鱣","鸇","鹯","𫗴"],ō:["噢"],"zhòu zhuó":["噣"],"jiào qiào chī":["噭"],yuàn:["噮","妴","怨","愿","掾","瑗","禐","苑","衏","裫","褑","院","願"],"ǎi ài āi":["噯"],"yōng yǒng":["噰","澭"],"jué xué":["噱"],"pēn pèn fèn":["噴"],gá:["噶","尜","釓","錷","钆"],"xīn hěn hèn":["噷"],dāng:["噹","澢","珰","璫","筜","簹","艡","蟷","裆","襠"],làn:["嚂","滥","濫","烂","燗","爁","爛","爤","瓓","糷","钄"],tà:["嚃","嚺","崉","挞","搨","撻","榻","橽","毾","涾","澾","濌","禢","粏","誻","譶","蹋","蹹","躂","躢","遝","錔","闒","闥","闼","阘","鞜","鞳"],"huō huò ǒ":["嚄"],hāo:["嚆","茠","蒿","薅"],"hè xià":["嚇"],"xiù pì":["嚊"],"zhōu chóu":["嚋","盩","诪"],mē:["嚒"],"chā cā":["嚓"],"bó pào bào":["嚗"],"me mèi mò":["嚜"],"xié hái":["嚡"],"áo xiāo":["嚣"],mō:["嚤","摸"],pín:["嚬","娦","嫔","嬪","玭","矉","薲","蠙","貧","贫","顰","颦","𬞟"],mè:["嚰","濹"],"rǎng rāng":["嚷"],lá:["嚹","旯"],"jiáo jué jiào":["嚼"],chuò:["嚽","娖","擉","歠","涰","磭","踀","輟","辍","辵","辶","酫","鑡","餟","齪","龊"],"huān huàn":["嚾"],"zá cà":["囃"],chài:["囆","虿","蠆","袃","訍"],"náng nāng":["囊"],"zá zàn cān":["囋"],sū:["囌","櫯","甦","稣","穌","窣","蘇","蘓","酥","鯂"],zèng:["囎","熷","甑","贈","赠","鋥","锃"],"zá niè yàn":["囐"],nāng:["囔"],"luó luō luo":["囖"],"wéi guó":["囗"],huí:["囘","回","囬","廻","廽","恛","洄","痐","茴","蚘","蛔","蛕","蜖","迴","逥","鮰"],nín:["囜","您","脌"],"jiǎn nān":["囝"],nān:["囡"],tuán:["团","団","團","慱","抟","摶","檲","糰","鏄","鷒","鷻"],"tún dùn":["囤","坉"],guó:["囯","囶","囻","国","圀","國","帼","幗","慖","摑","漍","聝","腘","膕","蔮","虢","馘","𬇹"],kùn:["困","涃","睏"],"wéi tōng":["囲"],qūn:["囷","夋","逡"],rì:["囸","日","衵","鈤","馹","驲"],tāi:["囼","孡","胎"],pǔ:["圃","圑","擈","普","暜","樸","檏","氆","浦","溥","烳","諩","譜","谱","蹼","鐠","镨"],"quān juàn juān":["圈","圏"],"chuí chuán":["圌"],tuǎn:["圕","畽","疃"],lüè:["圙","掠","略","畧","稤","鋝","鋢","锊","䂮"],"huán yuán":["圜"],luán:["圝","圞","奱","娈","孌","孪","孿","峦","巒","挛","攣","曫","栾","欒","滦","灤","癴","癵","羉","脔","臠","虊","銮","鑾","鵉","鸞","鸾"],tǔ:["土","圡","釷","钍"],"xū wéi":["圩"],"dì de":["地","嶳"],"qiān sú":["圱"],zhèn:["圳","塦","挋","振","朕","栚","甽","眹","紖","絼","纼","誫","賑","赈","鋴","鎭","鎮","镇","阵","陣","震","鴆","鸩"],"chǎng cháng":["场","場","塲"],"qí yín":["圻"],jiá:["圿","忦","恝","戞","扴","脥","荚","莢","蛱","蛺","裌","跲","郏","郟","鋏","铗","頬","頰","颊","鴶","鵊"],"zhǐ zhì":["坁"],bǎn:["坂","岅","昄","板","版","瓪","粄","舨","蝂","鈑","钣","阪","魬"],qǐn:["坅","寑","寝","寢","昑","梫","笉","螼","赾","鋟","锓"],"méi fén":["坆"],"rǒng kēng":["坈"],"fāng fáng":["坊"],"fèn bèn":["坋"],tān:["坍","怹","摊","擹","攤","滩","灘","瘫","癱","舑","貪","贪"],"huài pēi pī péi":["坏"],"dì làn":["坔"],tán:["坛","墰","墵","壇","壜","婒","憛","昙","曇","榃","檀","潭","燂","痰","磹","罈","罎","藫","談","譚","譠","谈","谭","貚","郯","醰","錟","顃"],bà:["坝","垻","壩","弝","欛","灞","爸","矲","覇","霸","鮁","鲅"],fén:["坟","墳","妢","岎","幩","枌","棼","汾","焚","燌","燓","羒","羵","蒶","蕡","蚠","蚡","豮","豶","轒","鐼","隫","馩","魵","黂","鼖","鼢","𣸣"],zhuì:["坠","墜","惴","甀","畷","礈","綴","縋","缀","缒","腏","膇","諈","贅","赘","醊","錣","鑆"],pō:["坡","岥","泼","溌","潑","釙","鏺","钋","頗","颇","䥽"],"pǎn bàn":["坢"],kūn:["坤","堃","堒","崐","崑","昆","晜","潉","焜","熴","猑","琨","瑻","菎","蜫","裈","裩","褌","醌","錕","锟","騉","髠","髡","髨","鯤","鲲","鵾","鶤","鹍"],diàn:["坫","垫","墊","壂","奠","婝","店","惦","扂","橂","殿","淀","澱","玷","琔","电","癜","簟","蜔","鈿","電","靛","驔"],"mù mǔ":["坶"],"kē kě":["坷","軻"],xuè:["坹","岤","桖","瀥","狘","瞲","謔","谑","趐"],"dǐ chí":["坻","柢"],lā:["垃","柆","菈","邋"],lǒng:["垄","垅","壟","壠","拢","攏","竉","陇","隴","𬕂"],mín:["垊","姄","岷","崏","捪","旻","旼","民","珉","琘","琝","瑉","痻","盿","砇","緍","緡","缗","罠","苠","鈱","錉","鍲","鴖"],"dòng tóng":["垌","峒","洞"],cí:["垐","嬨","慈","柌","濨","珁","瓷","甆","磁","礠","祠","糍","茨","詞","词","辝","辞","辤","辭","雌","飺","餈","鴜","鶿","鷀","鹚"],duī:["垖","堆","塠","痽","磓","鐓","鐜","鴭"],"duò duǒ":["垛"],"duǒ duò":["垜","挆"],chá:["垞","察","嵖","搽","槎","檫","猹","茬","茶","詧","靫","𥻗"],shǎng:["垧","晌","樉","賞","贘","赏","鋿","鏛","鑜"],shǒu:["垨","守","手","扌","艏","首"],da:["垯","繨","跶"],háng:["垳","斻","杭","筕","絎","绗","航","苀","蚢","裄","貥","迒","頏","颃","魧"],"ān ǎn":["垵"],xīng:["垶","惺","星","曐","煋","猩","瑆","皨","篂","腥","興","觪","觲","謃","騂","骍","鮏","鯹"],"yuàn huán":["垸"],bāng:["垹","帮","幇","幚","幫","捠","梆","浜","邦","邫","鞤","𠳐"],"póu fú":["垺"],cén:["埁","岑","涔"],"běng fēng":["埄"],"dì fáng":["埅"],"xiá jiā":["埉"],"mái mán":["埋"],làng:["埌","崀","浪","蒗","閬","㫰"],"shān yán":["埏"],"qín jīn":["埐"],"pǔ bù":["埔"],huā:["埖","婲","椛","硴","糀","花","蒊","蘤","誮","錵"],"suì sù":["埣"],"pí pì":["埤"],"qīng zhēng":["埥","鲭"],"wǎn wān":["埦"],lǔn:["埨","稐","𫭢"],"zhēng chéng":["埩"],kōng:["埪","崆","箜","躻","錓","鵼"],"cǎi cài":["埰","寀","采"],"chù tòu":["埱"],běng:["埲","琫","菶","鞛"],"kǎn xiàn":["埳"],"yì shì":["埶","醳"],péi:["培","毰","裴","裵","賠","赔","錇","锫","阫","陪"],"sào sǎo":["埽"],"jǐn qīn jìn":["堇"],"péng bèng":["堋"],"qiàn zàn jiàn":["堑"],àn:["堓","屵","岸","按","暗","案","胺","荌","豻","貋","錌","闇","隌","黯"],"duò huī":["堕","墮"],huán:["堚","寏","寰","峘","桓","洹","澴","獂","环","環","糫","繯","缳","羦","荁","萈","萑","豲","鍰","鐶","锾","镮","闤","阛","雈","鬟","鹮","𬘫","𤩽"],"bǎo bǔ pù":["堡"],"máo móu wǔ":["堥"],ruán:["堧","壖","撋"],"ài è yè":["堨"],gèng:["堩","暅"],méi:["堳","塺","媒","嵋","徾","攗","枚","栂","梅","楣","楳","槑","湄","湈","煤","猸","玫","珻","瑂","眉","睂","禖","脄","脢","腜","苺","莓","葿","郿","酶","鎇","镅","霉","鶥","鹛","黴"],dǔ:["堵","琽","睹","笃","篤","覩","賭","赌"],féng:["堸","綘","艂","逢"],hèng:["堼"],chūn:["堾","媋","旾","春","暙","杶","椿","槆","橁","櫄","瑃","箺","萅","蝽","輴","鰆","鶞","䲠"],jiǎng:["塂","奖","奨","奬","桨","槳","獎","耩","膙","蒋","蔣","講","讲","顜"],huāng:["塃","巟","慌","肓","荒","衁"],duàn:["塅","断","斷","椴","段","毈","煅","瑖","碫","簖","籪","緞","缎","腶","葮","躖","鍛","锻"],tǎ:["塔","墖","獭","獺","鮙","鰨","鳎"],wěng:["塕","奣","嵡","攚","暡","瞈","蓊"],"sāi sài sè":["塞"],zàng:["塟","弉","臓","臟","葬","蔵","銺"],tián:["塡","屇","恬","沺","湉","璳","甛","甜","田","畋","畑","碵","磌","胋","闐","阗","鴫","鷆","鷏"],zhèng:["塣","幁","政","証","諍","證","证","诤","郑","鄭","靕","鴊"],"tián zhèn":["填"],wēn:["塭","昷","榲","殟","温","溫","瑥","瘟","蕰","豱","輼","轀","辒","鎾","饂","鰛","鰮","鳁"],liù:["塯","廇","磟","翏","雡","霤","餾","鬸","鷚","鹨"],hǎi:["塰","海","烸","酼","醢"],lǎng:["塱","朖","朗","朤","烺","蓢","㮾"],bèng:["塴","揼","泵","甏","綳","蹦","迸","逬","鏰","镚"],chén:["塵","宸","尘","忱","敐","敶","晨","曟","栕","樄","沉","煁","瘎","臣","茞","莀","莐","蔯","薼","螴","訦","諶","軙","辰","迧","鈂","陈","陳","霃","鷐","麎"],"ōu qiū":["塸"],"qiàn jiàn":["塹"],"zhuān tuán":["塼"],shuǎng:["塽","慡","漺","爽","縔","鏯"],shú:["塾","婌","孰","璹","秫","贖","赎"],lǒu:["塿","嵝","嶁","甊","篓","簍"],chí:["墀","弛","持","池","漦","竾","筂","箎","篪","茌","荎","蚳","謘","貾","赿","踟","迟","迡","遅","遟","遲","鍉","馳","驰"],shù:["墅","庶","庻","怷","恕","戍","束","树","樹","沭","漱","潄","濖","竖","竪","絉","腧","荗","蒁","虪","術","裋","豎","述","鉥","錰","鏣","霔","鶐","𬬸"],"dì zhì":["墆","疐"],kàn:["墈","崁","瞰","矙","磡","衎","鬫"],chěn:["墋","夦","硶","碜","磣","贂","趻","踸","鍖"],"zhǐ zhuó":["墌"],qiǎng:["墏","繈","繦","羥","襁"],zēng:["増","增","憎","璔","矰","磳","罾","譄","鄫","鱛","䎖"],qiáng:["墙","墻","嫱","嬙","樯","檣","漒","牆","艢","蔃","蔷","蘠"],"kuài tuí":["墤"],"tuǎn dǒng":["墥"],"qiáo què":["墧"],"zūn dūn":["墫"],"qiāo áo":["墽"],"yì tú":["墿"],"xué bó jué":["壆"],lǎn:["壈","嬾","孄","孏","懒","懶","揽","擥","攬","榄","欖","浨","漤","灠","纜","缆","罱","覧","覽","览","醂","顲"],huài:["壊","壞","蘾"],rǎng:["壌","壤","攘","爙"],"làn xiàn":["壏"],dǎo:["壔","导","導","岛","島","嶋","嶌","嶹","捣","搗","擣","槝","祷","禂","禱","蹈","陦","隝","隯"],ruǐ:["壡","桵","橤","繠","蕊","蕋","蘂","蘃"],san:["壭"],zhuàng:["壮","壯","壵","撞","焋","状","狀"],"ké qiào":["壳","殼"],kǔn:["壸","壼","悃","捆","梱","硱","祵","稇","稛","綑","裍","閫","閸","阃"],mǎng:["壾","漭","茻","莽","莾","蠎"],cún:["壿","存"],"zhǐ zhōng":["夂"],"gǔ yíng":["夃"],"jiàng xiáng":["夅","降"],"páng féng fēng":["夆"],zhāi:["夈","捚","摘","斋","斎","榸","粂","齋"],"xuàn xiòng":["夐"],wài:["外","顡"],"wǎn yuàn wān yuān":["夗"],"mǎo wǎn":["夘"],mèng:["夢","夣","孟","梦","癦","霥"],"dà dài":["大"],"fū fú":["夫","姇","枎","粰"],guài:["夬","怪","恠"],yāng:["央","姎","抰","殃","泱","秧","胦","鉠","鍈","雵","鴦","鸯"],"hāng bèn":["夯"],gǎo:["夰","搞","杲","槀","槁","檺","稁","稾","稿","縞","缟","菒","藁","藳"],"tāo běn":["夲"],"tóu tou":["头"],"yǎn tāo":["夵"],"kuā kuà":["夸","誇"],"jiá jiā gā xiá":["夹"],huà:["夻","婳","嫿","嬅","崋","摦","杹","枠","桦","槬","樺","澅","画","畫","畵","繣","舙","話","諙","譮","话","黊"],"jiā jiá gā xiá":["夾"],ēn:["奀","恩","蒽"],"dī tì":["奃"],"yǎn yān":["奄","渰"],pào:["奅","疱","皰","砲","礟","礮","靤","麭"],nài:["奈","柰","渿","耐","萘","褦","錼","鼐"],"quān juàn":["奍","弮","棬"],zòu:["奏","揍"],"qì qiè xiè":["契"],kāi:["奒","开","揩","鐦","锎","開"],"bēn bèn":["奔","泍"],tào:["套"],"zàng zhuǎng":["奘"],běn:["奙","本","楍","畚","翉","苯"],"xùn zhuì":["奞"],shē:["奢","檨","猞","畭","畲","賒","賖","赊","輋","𪨶"],"hǎ pò tǎi":["奤"],"ào yù":["奥","奧","澚"],yūn:["奫","氲","氳","蒀","蒕","蝹","贇","赟","𫖳"],"duǒ chě":["奲"],"nǚ rǔ":["女"],nú:["奴","孥","笯","駑","驽"],"dīng dǐng tiǎn":["奵"],"tā jiě":["她"],nuán:["奻"],"hǎo hào":["好"],fàn:["奿","嬎","梵","汎","泛","滼","瀪","犯","畈","盕","笵","範","范","訉","販","贩","軬","輽","飯","飰","饭"],shuò:["妁","搠","朔","槊","烁","爍","矟","蒴","鎙","鑠","铄"],"fēi pèi":["妃"],wàng:["妄","忘","旺","望","朢"],zhuāng:["妆","妝","娤","庄","庒","桩","梉","樁","粧","糚","荘","莊","装","裝"],mā:["妈","媽"],"fū yōu":["妋"],"hài jiè":["妎"],dù:["妒","妬","杜","殬","渡","秺","芏","荰","螙","蠧","蠹","鍍","镀","靯","𬭊"],miào:["妙","庙","庿","廟","玅","竗"],"fǒu pēi pī":["妚"],"yuè jué":["妜"],niū:["妞"],"nà nàn":["妠"],tuǒ:["妥","嫷","庹","椭","楕","橢","鬌","鰖","鵎"],"wàn yuán":["妧"],fáng:["妨","房","肪","防","魴","鲂"],nī:["妮"],zhóu:["妯","碡"],zhāo:["妱","巶","招","昭","釗","鉊","鍣","钊","駋","𬬿"],"nǎi nǐ":["妳"],tǒu:["妵","敨","紏","蘣","黈"],"xián xuán xù":["妶"],"zhí yì":["妷","秇"],ē:["妸","妿","婀","屙"],mèi:["妹","媚","寐","抺","旀","昧","沬","煝","痗","眛","睸","祙","篃","蝞","袂","跊","鬽","魅"],"qī qì":["妻"],"xū xǔ":["姁","稰"],"shān shàn":["姍","姗","苫","釤","钐"],mán:["姏","慲","樠","蛮","蠻","謾","饅","馒","鬗","鬘","鰻","鳗"],jiě:["姐","媎","檞","毑","飷"],"wěi wēi":["委"],pīn:["姘","拼","礗","穦","馪","驞"],"huá huó":["姡"],"jiāo xiáo":["姣"],"gòu dù":["姤"],"lǎo mǔ":["姥"],"nián niàn":["姩"],zhěn:["姫","屒","弫","抮","昣","枕","畛","疹","眕","稹","縝","縥","缜","聄","萙","袗","裖","覙","診","诊","軫","轸","辴","駗","鬒"],héng:["姮","恆","恒","烆","珩","胻","蘅","衡","鑅","鴴","鵆","鸻"],"jūn xún":["姰"],"kuā hù":["姱"],"è yà":["姶"],"xiān shēn":["姺"],wá:["娃"],"ráo rǎo":["娆","嬈"],"shào shāo":["娋"],xiē:["娎","揳","楔","歇","蝎","蠍"],"wǔ méi mǔ":["娒"],"chuò lài":["娕"],niáng:["娘","嬢","孃"],"nà nuó":["娜","𦰡"],"pōu bǐ":["娝"],"něi suī":["娞"],tuì:["娧","煺","蛻","蜕","退","駾"],mǎn:["娨","屘","満","满","滿","螨","蟎","襔","鏋"],"wú wù yú":["娪"],"xī āi":["娭"],"zhuì shuì":["娷"],"dōng dòng":["娻"],"ǎi ái è":["娾"],"ē ě":["娿"],mián:["婂","嬵","宀","杣","棉","檰","櫋","眠","矈","矊","矏","綿","緜","绵","芇","蝒"],"pǒu péi bù":["婄"],biǎo:["婊","脿","表","裱","褾","諘","錶"],"fù fàn":["婏"],wǒ:["婐","婑","我"],"ní nǐ":["婗","棿"],"quán juàn":["婘","惓"],hūn:["婚","昏","昬","棔","涽","睧","睯","碈","荤","葷","蔒","轋","閽","阍"],"qiān jǐn":["婜"],"wān wà":["婠"],"lái lài":["婡","徕","徠"],"zhōu chōu":["婤"],"chuò nào":["婥"],"nüè àn":["婩"],"hùn kūn":["婫"],"dàng yáng":["婸"],nàn:["婻"],"ruò chuò":["婼"],jiǎ:["婽","岬","斚","斝","榎","槚","檟","玾","甲","胛","鉀","钾"],"tōu yú":["婾","媮"],"yù yú":["媀"],"wéi wěi":["媁"],"dì tí":["媂","珶","苐"],róu:["媃","揉","柔","渘","煣","瑈","瓇","禸","粈","糅","脜","腬","葇","蝚","蹂","輮","鍒","鞣","騥","鰇","鶔","𫐓"],"ruǎn nèn":["媆"],miáo:["媌","嫹","描","瞄","苗","鶓","鹋"],"yí pèi":["媐"],"mián miǎn":["媔"],"tí shì":["媞","惿"],"duò tuó":["媠","沲"],ǎo:["媪","媼","艹","芺","袄","襖","镺"],"chú zòu":["媰"],yìng:["媵","映","暎","硬","膡","鱦"],"qín shēn":["嫀"],jià:["嫁","幏","架","榢","稼","駕","驾"],sǎo:["嫂"],"zhēn zhěn":["嫃"],"jiē suǒ":["嫅"],"míng mǐng":["嫇"],niǎo:["嫋","嬝","嬲","茑","蔦","袅","裊","褭","鸟"],tāo:["嫍","幍","弢","慆","掏","搯","槄","涛","滔","濤","瑫","絛","縚","縧","绦","詜","謟","轁","鞱","韜","韬","飸","饕"],biáo:["嫑"],"piáo piāo":["嫖","薸"],xuán:["嫙","悬","懸","暶","檈","漩","玄","璇","璿","痃","蜁","𫠊"],"màn mān":["嫚"],kāng:["嫝","嵻","康","慷","槺","漮","砊","穅","糠","躿","鏮","鱇","𡐓","𩾌"],"hān nǎn":["嫨"],nèn:["嫩","嫰"],zhē:["嫬","遮"],"mā má":["嫲"],piè:["嫳"],zhǎn:["嫸","展","搌","斩","斬","琖","盏","盞","輾","醆","颭","飐"],"xiān yǎn jìn":["嬐"],liǎn:["嬚","敛","斂","琏","璉","羷","脸","臉","蔹","蘝","蘞","裣","襝","鄻"],"qióng huán xuān":["嬛"],dǒng:["嬞","懂","箽","董","蕫","諌"],cān:["嬠","湌","爘","飡","餐","驂","骖"],tiǎo:["嬥","宨","晀","朓","窱","脁"],bí:["嬶","荸","鼻"],liǔ:["嬼","柳","栁","桞","桺","橮","熮","珋","綹","绺","罶","羀","鋶","锍"],"qiān xiān":["孅","欦"],"xié huī":["孈"],"huān quán":["孉"],"lí lì":["孋","麗"],"zhú chuò":["孎"],kǒng:["孔","恐"],"mā zī":["孖"],"sūn xùn":["孙","孫"],"bèi bó":["孛","誖"],"yòu niū":["孧"],zhuǎn:["孨","竱","轉"],hái:["孩","骸"],nāo:["孬"],"chán càn":["孱"],bò:["孹","檗","蘗","譒"],nái:["孻","腉"],"níng nìng":["宁","寍","寗","寜","寧","甯"],zhái:["宅"],"tū jiā":["宊"],sòng:["宋","訟","誦","讼","诵","送","鎹","頌","颂","餸"],ròu:["宍","肉","譳"],zhūn:["宒","窀","衠","諄","谆","迍"],"mì fú":["宓"],"dàng tàn":["宕"],"wǎn yuān":["宛"],chǒng:["宠","寵"],qún:["宭","峮","帬","羣","群","裙","裠"],zǎi:["宰","崽"],"bǎo shí":["宲"],"jiā jia jie":["家"],"huāng huǎng":["宺"],kuān:["宽","寛","寬","臗","鑧","髋","髖"],"sù xiǔ xiù":["宿"],"jié zǎn":["寁"],"bìng bǐng":["寎"],"jìn qǐn":["寖"],"lóu jù":["寠"],"xiě xiè":["寫"],"qīn qìn":["寴"],cùn:["寸","籿"],duì:["对","対","對","怼","憝","懟","濧","瀩","碓","祋","綐","薱","譈","譵","轛","队","陮"],"lüè luó":["寽"],"shè yè yì":["射"],"jiāng jiàng qiāng":["将"],"jiāng jiàng":["將","浆","漿","畺"],zūn:["尊","嶟","樽","罇","遵","鐏","鱒","鳟","鶎","鷷","𨱔"],"shù zhù":["尌","澍"],xiǎo:["小","晓","暁","曉","皛","皢","筱","筿","篠","謏","𫍲"],"jié jí":["尐","诘","鞊"],"shǎo shào":["少"],ěr:["尒","尓","尔","栮","毦","洱","爾","珥","耳","薾","衈","趰","迩","邇","鉺","铒","餌","饵","駬"],"wāng yóu":["尢"],wāng:["尣","尩","尪","尫","汪"],liào:["尥","尦","廖","撂","料","炓","窷","鐐","镣","𪤗"],"méng máng lóng páng":["尨"],gà:["尬","魀"],"kuì kuǐ":["尯"],tuí:["尵","弚","穨","蘈","蹪","隤","頹","頺","頽","颓","魋","𬯎"],yǐn:["尹","嶾","引","朄","檃","檼","櫽","淾","濥","瘾","癮","粌","蘟","蚓","螾","讔","赺","趛","輑","鈏","靷"],"chǐ chě":["尺"],kāo:["尻","髛"],"jìn jǐn":["尽"],"wěi yǐ":["尾"],"niào suī":["尿"],céng:["层","層","嶒","驓"],diǎo:["屌"],"píng bǐng bīng":["屏"],lòu:["屚","漏","瘘","瘺","瘻","鏤","镂","陋"],"shǔ zhǔ":["属","屬"],"xiè tì":["屟"],"chè cǎo":["屮"],"tún zhūn":["屯"],"nì jǐ":["屰"],"hóng lóng":["屸"],"qǐ kǎi":["岂","豈"],áng:["岇","昂","昻"],"gǎng gāng":["岗","崗"],kě:["岢","敤","渇","渴","炣"],gǒu:["岣","狗","玽","笱","耇","耈","耉","苟","豿"],tiáo:["岧","岹","樤","祒","笤","芀","萔","蓚","蓨","蜩","迢","鋚","鎥","鞗","髫","鯈","鰷","鲦","齠","龆"],"qū jū":["岨"],lǐng:["岭","嶺","領","领"],pò:["岶","敀","洦","湐","烞","珀","破","砶","粕","蒪","魄"],"bā kè":["峇"],luò:["峈","摞","洛","洜","犖","珞","笿","纙","荦","詻","雒","駱","骆","鵅"],"fù niè":["峊"],ěn:["峎"],"zhì shì":["峙","崻"],qiǎ:["峠","跒","酠","鞐"],"qiáo jiào":["峤","癄"],"xié yé":["峫"],bū:["峬","庯","晡","誧","逋","鈽","錻","钸","餔","鵏"],chóng:["崇","崈","爞","虫","蝩","蟲","褈","隀"],"zú cuì":["崒","椊"],"líng léng":["崚"],"dòng dōng":["崠"],xiáo:["崤","洨","淆","訤","誵"],"pí bǐ":["崥","芘"],"zhǎn chán":["崭","嶃","嶄"],"wǎi wēi":["崴"],"yáng dàng":["崵"],"shì dié":["崼"],yào:["崾","曜","熎","燿","矅","穾","窔","筄","耀","艞","药","葯","薬","藥","袎","覞","詏","讑","靿","鷂","鹞","鼼"],"kān zhàn":["嵁"],"hán dǎng":["嵅"],"qiàn kàn":["嵌"],"wù máo":["嵍"],"kě jié":["嵑","嶱"],"wēi wěi":["嵔"],kē:["嵙","柯","棵","榼","樖","牁","牱","犐","珂","疴","瞌","磕","礚","科","稞","窠","萪","薖","蚵","蝌","趷","轲","醘","鈳","钶","頦","顆","颗","髁"],"dàng táng":["嵣"],"róng yíng":["嵤","爃"],"ái kǎi":["嵦"],"kāo qiāo":["嵪"],cuó:["嵯","嵳","痤","矬","蒫","蔖","虘","鹺","鹾"],"qiǎn qīn":["嵰"],"dì dié":["嵽"],cēn:["嵾"],dǐng:["嵿","艼","薡","鐤","頂","顶","鼎","鼑"],"áo ào":["嶅"],"pǐ pèi":["嶏"],"jiào qiáo":["嶠","潐"],"jué guì":["嶡","鳜"],"zhān shàn":["嶦","鳣"],"xiè jiè":["嶰"],"guī xī juàn":["嶲"],rū:["嶿"],"lì liè":["巁","棙","爄","綟"],"xī guī juàn":["巂"],"yíng hōng":["巆"],yǐng:["巊","廮","影","摬","梬","潁","瘿","癭","矨","穎","郢","鐛","頴","颍","颕","颖"],chǎo:["巐","炒","煼","眧","麨"],cuán:["巑","櫕","欑"],chuān:["巛","川","氚","瑏","穿"],"jīng xíng":["巠"],cháo:["巢","巣","晁","漅","潮","牊","窲","罺","謿","轈","鄛","鼌"],qiǎo:["巧","愀","髜"],gǒng:["巩","廾","拱","拲","栱","汞","珙","輁","鞏"],"chà chā chāi cī":["差"],"xiàng hàng":["巷"],shuài:["帅","帥","蟀"],pà:["帊","帕","怕","袙"],"tǎng nú":["帑"],"mò wà":["帓"],"tiē tiě tiè":["帖"],zhǒu:["帚","晭","疛","睭","箒","肘","菷","鯞"],"juǎn juàn":["帣"],shuì:["帨","涗","涚","睡","稅","税","裞"],"chóu dào":["帱","幬"],"jiǎn jiān sàn":["帴"],"shà qiè":["帹"],"qí jì":["帺","荠"],"shān qiāo shēn":["幓"],"zhuàng chuáng":["幢"],"chān chàn":["幨"],miè:["幭","懱","搣","滅","灭","烕","礣","篾","蔑","薎","蠛","衊","鑖","鱴","鴓"],"gān gàn":["干"],"bìng bīng":["并","幷"],"jī jǐ":["幾"],"guǎng ān":["广"],guǎng:["広","廣","犷","獷"],me:["庅"],"dùn tún":["庉"],"bài tīng":["庍"],"yìng yīng":["应"],"dǐ de":["底"],"dù duó":["度"],"máng méng páng":["庬"],"bìng píng":["庰"],chěng:["庱","悜","睈","逞","騁","骋"],"jī cuò":["庴"],qǐng:["庼","廎","檾","漀","苘","請","謦","请","頃","顷"],"guī wěi huì":["廆"],"jǐn qín":["廑"],kuò:["廓","扩","拡","擴","濶","筈","萿","葀","蛞","闊","阔","霩","鞟","鞹","韕","頢","鬠"],"qiáng sè":["廧","薔"],"yǐn yìn":["廴","隐","隠","隱","飮","飲","饮"],"pò pǎi":["廹","迫"],"nòng lòng":["弄"],"dì tì tuí":["弟"],"jué zhāng":["弡"],"mí mǐ":["弥","彌","靡"],chāo:["弨","怊","抄","欩","訬","超","鈔","钞"],yi:["弬"],shāo:["弰","旓","烧","焼","燒","筲","艄","萷","蕱","輎","髾","鮹"],"xuān yuān":["弲"],"qiáng qiǎng jiàng":["強","强"],"tán dàn":["弹","醈"],biè:["彆"],"qiáng jiàng qiǎng":["彊"],"jì xuě":["彐"],tuàn:["彖","褖"],yuē:["彟","曰","曱","矱"],"shān xiǎn":["彡"],wén:["彣","文","炆","珳","瘒","繧","聞","芠","蚉","蚊","螡","蟁","閺","閿","闅","闦","闻","阌","雯","馼","駇","魰","鳼","鴍","鼤","𫘜"],"péng bāng":["彭"],"piāo piào":["彯"],"zhuó bó":["彴"],"tuǒ yí":["彵"],"páng fǎng":["彷"],wǎng:["彺","往","徃","惘","枉","棢","網","网","罒","罓","罔","罖","菵","蛧","蝄","誷","輞","辋","魍"],cú:["徂","殂"],"dài dāi":["待"],huái:["徊","怀","懐","懷","槐","淮","耲","蘹","褢","褱","踝"],"wā wàng jiā":["徍"],"chěng zhèng":["徎"],"dé děi de":["得"],"cóng zòng":["從"],"shì tǐ":["徥"],"tí chí":["徲","鶗","鶙"],dé:["徳","德","恴","悳","惪","淂","鍀","锝"],"zhǐ zhēng":["徴","徵"],bié:["徶","癿","莂","蛂","襒","蹩"],"chōng zhǒng":["徸"],"jiǎo jiào":["徼","笅","筊"],"lòng lǒng":["徿"],"qú jù":["忂","渠","瞿","螶"],"dìng tìng":["忊"],gǎi:["忋","改"],rěn:["忍","栠","栣","秹","稔","綛","荏","荵","躵"],chàn:["忏","懴","懺","硟","羼","韂","顫"],tè:["忑","慝","特","蟘","鋱","铽"],"tè tēi tuī":["忒"],"gān hàn":["忓","攼"],"yì qì":["忔"],"tài shì":["忕"],"xī liě":["忚"],"yīng yìng":["応","應","譍"],"mǐn wěn mín":["忞","忟"],"sōng zhōng":["忪"],"yù shū":["忬","悆"],"qí shì":["忯","耆"],"tún zhūn dùn":["忳"],"qián qín":["忴","扲"],hún:["忶","浑","渾","餛","馄","魂","鼲"],niǔ:["忸","扭","炄","狃","紐","纽","莥","鈕","钮","靵"],"kuáng wǎng":["忹"],"kāng hàng":["忼"],"kài xì":["忾","愾"],òu:["怄","慪"],"bǎo bào":["怉"],"mín mén":["怋"],"zuò zhà":["怍"],zěn:["怎"],yàng:["怏","恙","样","様","樣","漾","羕","詇"],"kòu jù":["怐"],"náo niú":["怓"],"zhēng zhèng":["怔","掙","钲","铮"],"tiē zhān":["怗"],"hù gù":["怘"],"cū jù zū":["怚"],"sī sāi":["思"],"yóu chóu":["怞"],"tū dié":["怢"],"yōu yào":["怮"],xuàn:["怰","昡","楦","泫","渲","炫","琄","眩","碹","絢","縼","繏","绚","蔙","衒","袨","贙","鉉","鏇","铉","镟","颴"],"xù xuè":["怴"],"bì pī":["怶"],"xī shù":["怸"],"nèn nín":["恁"],"tiāo yáo":["恌"],"xī qī xù":["恓"],"xiào jiǎo":["恔"],"hū kuā":["恗"],nǜ:["恧","朒","衂","衄"],hèn:["恨"],"dòng tōng":["恫"],"quán zhuān":["恮"],"è wù ě wū":["恶","惡"],tòng:["恸","慟","憅","痛","衕"],"yuān juàn":["悁"],"qiāo qiǎo":["悄"],"jiè kè":["悈"],"hào jiào":["悎"],huǐ:["悔","檓","毀","毁","毇","燬","譭"],"mán mèn":["悗","鞔"],"yī yì":["悘","衣"],quān:["悛","箞","鐉","𨟠"],"kuī lǐ":["悝"],"yì niàn":["悥"],"mèn mēn":["悶"],guàn:["悹","悺","惯","慣","掼","摜","樌","欟","泴","涫","潅","灌","爟","瓘","盥","礶","祼","罆","罐","貫","贯","躀","遦","鏆","鑵","鱹","鸛","鹳"],"kōng kǒng":["悾"],"lǔn lùn":["惀"],guǒ:["惈","果","椁","槨","粿","綶","菓","蜾","裹","褁","輠","餜","馃"],"yuān wǎn":["惌","箢"],"lán lín":["惏"],"yù xù":["惐","淢"],"chuò chuì":["惙"],"hūn mèn":["惛"],"chǎng tǎng":["惝"],"suǒ ruǐ":["惢"],cǎn:["惨","慘","憯","黪","黲","䅟"],cán:["惭","慙","慚","残","殘","蚕","蝅","蠶","蠺"],"dàn dá":["惮","憚"],rě:["惹"],"yú tōu":["愉"],"kài qì":["愒"],"dàng táng shāng yáng":["愓"],"chén xìn dān":["愖"],"kè qià":["愘"],nuò:["愞","懦","懧","掿","搦","榒","稬","穤","糑","糥","糯","諾","诺","蹃","逽","鍩","锘"],gǎn:["感","擀","敢","桿","橄","澉","澸","皯","秆","稈","笴","芉","衦","赶","趕","鱤","鳡"],"còng sōng":["愡"],"sāi sī sǐ":["愢"],"gōng gòng hǒng":["愩","慐"],"shuò sù":["愬","洬"],"yáo yào":["愮"],huàng:["愰","曂","榥","滉","皝","皩","鎤","㿠"],zhěng:["愸","抍","拯","整","晸"],cǎo:["愺","艸","草","騲"],"xì xié":["慀"],"cǎo sāo":["慅"],"xù chù":["慉"],"qiè qiàn":["慊"],"cáo cóng":["慒"],"ào áo":["慠"],"lián liǎn":["慩","梿","槤","櫣"],"jìn qín jǐn":["慬"],"dì chì":["慸"],"zhí zhé":["慹"],"lóu lǚ":["慺","鷜"],còng:["憁","謥"],"zhī zhì":["憄","知","織","织"],chēng:["憆","摚","撐","撑","晿","柽","棦","橕","檉","泟","浾","琤","瞠","碀","緽","罉","蛏","蟶","赪","赬","鏿","鐣","阷","靗","頳","饓"],biē:["憋","虌","鱉","鳖","鼈","龞"],"chéng dèng zhèng":["憕"],"xǐ xī":["憘"],"duì dùn tūn":["憞"],"xiāo jiāo":["憢"],"xián xiàn":["憪"],"liáo liǎo":["憭","燎","爎","爒"],shéng:["憴","縄","繉","繩","绳","譝"],"náo nǎo náng":["憹"],"jǐng jìng":["憼"],"jǐ jiǎo":["憿"],"xuān huān":["懁"],"cǎo sāo sào":["懆"],mèn:["懑","懣","暪","焖","燜"],"mèng méng měng":["懜"],"ài yì nǐ":["懝"],"méng měng":["懞","瞢","矒"],"qí jī jì":["懠"],mǒ:["懡"],"lán xiàn":["懢"],"yōu yǒu":["懮"],"liú liǔ":["懰","藰"],ràng:["懹","譲","讓","让"],huān:["懽","欢","歓","歡","獾","讙","貛","酄","驩","鴅","鵍"],nǎn:["戁","揇","湳","煵","腩","蝻","赧"],"mí mó":["戂"],"gàng zhuàng":["戅","戆"],"zhuàng gàng":["戇"],"xū qu":["戌"],"xì hū":["戏","戯","戲"],"jiá gā":["戛"],zéi:["戝","蠈","賊","贼","鰂","鱡","鲗"],děng:["戥","等"],"hū xì":["戱"],chuō:["戳","踔","逴"],"biǎn piān":["扁"],"shǎng jiōng":["扄"],"shàn shān":["扇"],cái:["才","材","纔","裁","財","财"],"zhā zā zhá":["扎"],"lè lì cái":["扐"],"bā pá":["扒"],"dǎ dá":["打"],rēng:["扔"],"fǎn fú":["払"],"diǎo dí yuē lì":["扚"],"káng gāng":["扛"],"yū wū":["扜"],"yū wū kū":["扝"],"tuō chǐ yǐ":["扡"],"gǔ jié xì gē":["扢"],dèn:["扥","扽"],"sǎo sào":["扫","掃"],rǎo:["扰","擾","隢"],"xī chā qì":["扱"],"bān pān":["扳"],"bā ào":["扷"],"xī zhé":["扸"],"zhì sǔn kǎn":["扻"],zhǎo:["找","沼","瑵"],"kuáng wǎng zài":["抂"],"hú gǔ":["抇","鹄","鹘"],"bǎ bà":["把"],"dǎn shěn":["抌"],"nè nì ruì nà":["抐"],zhuā:["抓","檛","簻","膼","髽"],póu:["抔","裒"],"zhé shé zhē":["折"],"póu pōu fū":["抙","捊"],pāo:["抛","拋","脬","萢"],"ǎo ào niù":["抝"],"lūn lún":["抡","掄"],"qiǎng qiāng chēng":["抢"],"zhǐ zhǎi":["抧"],"bù pū":["抪","柨"],"yǎo tāo":["抭"],"hē hè qiā":["抲"],"nǐ ní":["抳"],"pī pēi":["抷"],"mǒ mò mā":["抹"],chōu:["抽","犨","犫","瘳","篘"],"jiā yá":["拁"],"fú bì":["拂","畐","鶝"],zhǎ:["拃","眨","砟","鮺","鲝"],"dān dàn dǎn":["担"],"chāi cā":["拆"],niān:["拈","蔫"],"lā lá lǎ là":["拉"],"bàn pàn":["拌"],pāi:["拍"],līn:["拎"],guǎi:["拐","枴","柺"],"tuò tà zhí":["拓"],"ào ǎo niù":["拗"],"jū gōu":["拘"],"pīn pàn fān":["拚"],"bài bái":["拜"],bài:["拝","敗","稗","粺","薭","贁","败","韛"],qiá:["拤"],"nǐng níng nìng":["拧"],"zé zhái":["择","擇"],hén:["拫","痕","鞎"],"kuò guā":["括"],"jié jiá":["拮"],nǐn:["拰"],shuān:["拴","栓","閂","闩"],"cún zùn":["拵"],"zā zǎn":["拶","桚"],kǎo:["拷","攷","栲","烤","考"],"yí chǐ hài":["拸"],"cè sè chuò":["拺"],"zhuài zhuāi yè":["拽"],"shí shè":["拾"],bāi:["挀","掰"],"kuò guāng":["挄"],nòng:["挊","挵","齈"],"jiào jiāo":["挍","敎","教"],"kuà kū":["挎"],"ná rú":["挐"],"tiāo tiǎo":["挑"],"dié shè":["挕"],liě:["挘","毟"],"yà yǎ":["挜","掗"],"wō zhuā":["挝"],"xié jiā":["挟","挾"],"dǎng dàng":["挡","擋"],"zhèng zhēng":["挣","正","症"],"āi ái":["挨"],"tuō shuì":["挩","捝"],"tǐ tì":["挮"],"suō shā":["挱"],"sā shā suō":["挲"],"kēng qiān":["挳","摼"],"bàng péng":["挷"],"ruó ruá":["挼"],"jiǎo kù":["捁"],"wǔ wú":["捂"],tǒng:["捅","桶","筒","筩","統","綂","统","㛚"],"huò chì":["捇"],"tú shū chá":["捈"],"lǚ luō":["捋"],"shāo shào":["捎","稍"],niē:["捏","揑"],"shù sǒng sōu":["捒"],"yé yú":["捓"],"jué zhuó":["捔"],"bù pú zhì":["捗"],zùn:["捘","銌"],lāo:["捞","撈","粩"],sǔn:["损","損","榫","笋","筍","箰","鎨","隼"],"wàn wǎn wān yù":["捥"],pěng:["捧","淎","皏"],shě:["捨"],"fǔ fù bǔ":["捬"],dáo:["捯"],"luò luǒ wǒ":["捰"],"juǎn quán":["捲"],"chēn tiǎn":["捵"],"niǎn niē":["捻"],"ruó wěi ré":["捼"],zuó:["捽","昨","秨","稓","筰","莋","鈼"],"wò xiá":["捾"],"qìng qiàn":["掅"],"póu pǒu":["掊"],qiā:["掐","葜"],"pái pǎi":["排"],"qiān wàn":["掔"],"yè yē":["掖"],"niè nǐ yì":["掜"],"huò xù":["掝"],"yàn shàn yǎn":["掞"],"zhěng dìng":["掟"],kòng:["控","鞚"],tuī:["推","蓷","藬"],"zōu zhōu chōu":["掫"],tiàn:["掭","舚"],kèn:["掯","裉","褃"],pá:["掱","杷","潖","爬","琶","筢"],"guó guāi":["掴"],"dǎn shàn":["掸","撣"],"chān xiān càn shǎn":["掺"],sāo:["掻","搔","溞","繅","缫","螦","騒","騷","鰠","鱢","鳋"],pèng:["掽","椪","槰","碰","踫"],"zhēng kēng":["揁"],"jiū yóu":["揂"],"jiān jiǎn":["揃","籛"],"pì chè":["揊"],"sāi zǒng cāi":["揌"],"tí dī dǐ":["提"],"zǒng sōng":["揔"],"huáng yóng":["揘"],"zǎn zuàn":["揝"],"xū jū":["揟"],"ké qiā":["揢"],"chuāi chuǎi chuài tuán zhuī":["揣"],"dì tì":["揥"],"lá là":["揦"],là:["揧","楋","溂","瓎","瘌","翋","臘","蝋","蝲","蠟","辢","辣","鑞","镴","鬎","鯻","𬶟"],"jiē qì":["揭"],"chòng dǒng":["揰"],"dié shé yè":["揲"],"jiàn qián jiǎn":["揵"],yé:["揶","爷","爺","瑘","鋣","鎁","铘"],chān:["搀","摻","攙","裧","襜","覘","觇","辿","鋓"],"gē gé":["搁","擱"],"lǒu lōu":["搂","摟"],"chōu zǒu":["搊"],chuāi:["搋"],sūn:["搎","槂","狲","猻","荪","蓀","蕵","薞","飧","飱"],"róng náng nǎng":["搑"],"péng bàng":["搒"],cuō:["搓","瑳","磋","蹉","遳","醝"],"kē è":["搕"],"nù nuò nòu":["搙"],"lā xié xiàn":["搚"],qiǔ:["搝","糗"],"xiǎn xiān":["搟"],"jié zhé":["搩"],"pán bān pó":["搫"],bān:["搬","攽","斑","斒","班","瘢","癍","肦","螁","螌","褩","辬","頒","颁","𨭉"],"zhì nái":["搱"],"wā wǎ wà":["搲"],huá:["搳","撶","滑","猾","蕐","螖","譁","鏵","铧","驊","骅","鷨"],"qiāng qiǎng chēng":["搶"],"tián shēn":["搷"],"ná nuò":["搻"],èn:["摁"],"shè niè":["摄","攝"],bìn:["摈","擯","殡","殯","膑","臏","髌","髕","髩","鬂","鬓","鬢"],"shā sà shǎi":["摋"],"chǎn sùn":["摌"],"jiū liú liáo jiǎo náo":["摎"],"féng pěng":["摓"],shuāi:["摔"],"dì tú zhí":["摕"],"qì jì chá":["摖"],"sōu sǒng":["摗"],"liǎn liàn":["摙"],"gài xì":["摡"],"hù chū":["摢"],tàng:["摥","烫","燙","鐋"],"nái zhì":["摨"],"mó mā":["摩"],"jiāng qiàng":["摪"],"áo qiáo":["摮"],"niè chè":["摰"],"mán màn":["摱"],"chàn cán":["摲"],"sè mí sù":["摵"],"biāo biào":["摽"],"juē jué":["撅"],piē:["撆","暼","氕","瞥"],"piě piē":["撇"],"zǎn zān zēn qián":["撍"],"sā sǎ":["撒"],hòng:["撔","訌","讧","闀","鬨"],"héng guàng":["撗"],niǎn:["撚","撵","攆","涊","焾","碾","簐","蹍","蹨","躎","輦","辇"],"chéng zhěng":["撜"],"huī wéi":["撝"],cāo:["撡","操","糙"],"xiāo sōu":["撨"],"liáo liāo":["撩"],"cuō zuǒ":["撮"],"wěi tuǒ":["撱"],cuān:["撺","攛","汆","蹿","躥","鑹","镩"],"qiào yāo jī":["撽"],"zhuā wō":["撾"],"lèi léi":["擂"],nǎng:["擃","攮","曩","灢"],"qíng jǐng":["擏"],kuǎi:["擓","蒯","㧟"],"pǐ bò":["擗"],"bò bāi":["擘"],"jù jǐ":["據"],mēng:["擝"],"sǒu sòu":["擞"],xǐng:["擤","箵","醒"],cā:["擦"],"níng nǐng nìng":["擰"],"zhì jié":["擳"],"là liè":["擸","爉"],"sòu sǒu":["擻"],"lì luò yuè":["擽"],"tī zhāi zhì":["擿"],pān:["攀","潘","眅","萠"],lèi:["攂","泪","涙","淚","禷","类","纇","蘱","酹","銇","錑","頛","頪","類","颣"],"cā sǎ":["攃"],"jùn pèi":["攈"],"lì luò":["攊","躒"],"là lài":["攋","櫴"],"lú luó":["攎"],"zǎn cuán":["攒"],"xiān jiān":["攕"],"mí mǐ mó":["攠"],"zǎn cuán zàn zuān":["攢"],zuàn:["攥"],"lì shài":["攦"],"lì luǒ":["攭"],"guǐ guì":["攱"],"jī qī yǐ":["攲"],fàng:["放"],"wù móu":["敄"],"chù shōu":["敊"],"gé guó è":["敋"],"duó duì":["敓","敚"],"duō què":["敠","敪"],"sàn sǎn":["散"],"dūn duì":["敦","镦"],"qī yǐ jī":["敧"],"xiào xué":["敩"],"shù shǔ shuò":["数","數"],"ái zhú":["敱","敳"],"xiòng xuàn":["敻"],"zhuó zhú":["斀"],"yì dù":["斁"],"lí tái":["斄"],"fěi fēi":["斐"],"yǔ zhōng":["斔"],"dòu dǒu":["斗"],"wò guǎn":["斡"],"tǒu tiǎo":["斢"],dòu:["斣","梪","浢","痘","窦","竇","脰","荳","豆","逗","郖","酘","閗","闘","餖","饾","鬥","鬦","鬪","鬬","鬭"],"yín zhì":["斦"],"chǎn jiè":["斺"],"wū yū yú":["於"],"yóu liú":["斿"],"páng bàng":["旁"],"máo mào":["旄"],"pī bì":["旇"],"xuán xuàn":["旋"],"wú mó":["无"],zǎo:["早","枣","栆","棗","澡","璪","薻","藻","蚤"],gā:["旮"],"gàn hàn":["旰"],"tái yīng":["旲"],"xū xù":["旴"],"tūn zhùn":["旽"],"wù wǔ":["旿"],"pò pèi":["昢"],zòng:["昮","猔","疭","瘲","粽","糉","糭","縦"],ǎi:["昹","毐","矮","蔼","藹","譪","躷","霭","靄"],"huàng huǎng":["晃"],xuǎn:["晅","癣","癬","选","選"],"xù kuā":["晇"],hǒng:["晎"],shài:["晒","曬"],"yūn yùn":["晕","煴"],"shèng chéng":["晟","椉","盛"],"jǐng yǐng":["景"],shǎn:["晱","熌","睒","覢","閃","闪","陕","陝"],"qǐ dù":["晵"],"ǎn àn yǎn":["晻"],"wǎng wàng":["暀"],zàn:["暂","暫","瓉","瓒","瓚","禶","襸","讃","讚","賛","贊","赞","蹔","鄼","錾","鏨","饡"],"yùn yūn":["暈"],"mín mǐn":["暋"],"dǔ shǔ":["暏"],shǔ:["暑","曙","潻","癙","糬","署","薥","薯","藷","蜀","蠴","襡","襩","鱪","鱰","黍","鼠","鼡"],"jiǎn lán":["暕"],nuǎn:["暖","煗","餪"],"bào pù":["暴"],"xī xǐ":["暿"],"pù bào":["曝","瀑"],"qū qǔ":["紶"],"qǔ qū":["曲"],"gèng gēng":["更"],"hū hù":["曶","雽"],"zēng céng":["曽","橧"],"céng zēng":["曾","竲"],"cǎn qián jiàn":["朁"],"qiè hé":["朅"],"bì pí":["朇","禆","笓","裨"],"yǒu yòu":["有"],"bān fén":["朌","鳻"],"fú fù":["服","洑"],"fěi kū":["朏","胐"],"qú xù chǔn":["朐"],"juān zuī":["朘"],"huāng máng wáng":["朚"],"qī jī":["期"],"tóng chuáng":["朣","橦"],zhá:["札","牐","箚","蚻","譗","鍘","铡","閘","闸"],"zhú shù shú":["朮"],"shù shú zhú":["术"],"zhū shú":["朱"],"pǔ pò pō piáo":["朴"],"dāo tiáo mù":["朷"],"guǐ qiú":["朹"],xiǔ:["朽","滫","潃","糔"],"chéng chēng":["朾"],zá:["杂","沯","砸","襍","雑","雜","雥","韴"],"yú wū":["杅"],"gān gǎn":["杆"],"chā chà":["杈"],"shān shā":["杉"],cūn:["村","皴","竴","膥","踆","邨"],"rèn ér":["杒","梕"],"sháo biāo":["杓"],"dì duò":["杕","枤"],"gū gài":["杚"],"yí zhì lí duò":["杝"],"gàng gāng":["杠"],"tiáo tiāo":["条","條"],"mà mǎ":["杩"],"sì zhǐ xǐ":["杫"],"yuán wán":["杬","蚖"],"bèi fèi":["杮"],"shū duì":["杸"],"niǔ chǒu":["杻"],"wò yuè":["枂","臒"],máo:["枆","毛","氂","渵","牦","矛","罞","茅","茆","蝥","蟊","軞","酕","鉾","錨","锚","髦","鶜"],"pī mì":["枈"],àng:["枊","盎","醠"],"fāng bìng":["枋"],"hù dǐ":["枑"],xín:["枔","襑","鐔","鬵"],"yāo yǎo":["枖"],"ě è":["枙"],"zhī qí":["枝"],"cōng zōng":["枞","樅"],"xiān zhēn":["枮"],"tái sì":["枱"],"gǒu jǔ gōu":["枸"],"bāo fú":["枹"],"yì xiè":["枻","栧"],"tuó duò":["柁","馱","駄","驮"],"yí duò lí":["柂"],"nǐ chì":["柅"],"pán bàn":["柈","跘"],"yǎng yàng yāng yīng":["柍"],"fù fū fǔ":["柎"],"bǎi bó bò":["柏"],mǒu:["某"],"sháo shào":["柖"],zhè:["柘","樜","浙","淛","蔗","蟅","這","鷓","鹧","䗪"],"yòu yóu":["柚","櫾"],"guì jǔ":["柜"],"zhà zuò":["柞"],"dié zhì":["柣","眰"],"zhā zǔ zū":["柤"],"chá zhā":["查","査"],"āo ào":["柪","軪"],"bā fú pèi bó biē":["柭"],"duò zuó wù":["柮"],"bì bié":["柲"],"zhù chù":["柷"],"bēi pēi":["柸"],"shì fèi":["柹"],"shān zhà shi cè":["栅"],"lì yuè":["栎","櫟"],"qì qiè":["栔","砌"],"qī xī":["栖","蹊"],"guā kuò":["栝"],"bīng bēn":["栟"],"xiào jiào":["校"],"jiàn zùn":["栫","袸"],"yǒu yù":["栯"],"hé hú":["核"],gēn:["根","跟"],"zhī yì":["栺"],"gé gē":["格"],"héng háng":["桁"],"guàng guāng":["桄"],"yí tí":["桋","荑"],sāng:["桑","桒","槡"],"jú jié":["桔"],"yú móu":["桙"],"ráo náo":["桡","橈"],"guì huì":["桧","檜"],"chén zhèn":["桭"],"tīng yíng":["桯"],"bó po":["桲"],"bèn fàn":["桳"],"fēng fèng":["桻","葑"],"sù yìn":["梀"],"tǐng tìng":["梃"],"xuān juān xié":["梋"],"tú chá":["梌"],"āo yòu":["梎"],kuǎn:["梡","欵","款","歀"],"shāo sào":["梢"],"qín chén cén":["梣"],"lí sì qǐ":["梩"],"chān yán":["梴"],"bīn bīng":["梹","槟","檳"],"táo chóu dào":["梼"],"cōng sōng":["棇"],"gùn hùn":["棍"],"dé zhé":["棏"],"pái bèi pèi":["棑"],"bàng pǒu bèi bēi":["棓"],"dì dài tì":["棣"],sēn:["森","椮","槮","襂"],"rěn shěn":["棯"],"léng lēng líng":["棱"],"fú sù":["棴"],"zōu sǒu":["棷"],zōu:["棸","箃","緅","諏","诹","邹","郰","鄒","鄹","陬","騶","驺","鯫","鲰","黀","齱","齺"],"zhào zhuō":["棹"],"chēn shēn":["棽"],"jiē qiè":["椄"],"yǐ yī":["椅"],"chóu zhòu diāo":["椆"],"qiāng kōng":["椌"],"zhuī chuí":["椎"],"bēi pí":["椑"],mēn:["椚"],"quān juàn quán":["椦"],"duǒ chuán":["椯"],"wěi huī":["椲"],"jiǎ jiā":["椵"],"hán jiān":["椷"],"shèn zhēn":["椹"],"yàn yà":["椻"],"zhā chá":["楂"],"guō kuǎ":["楇"],"jí zhì":["楖"],"kǔ hù":["楛"],"yóu yǒu":["楢"],"sǒng cōng":["楤"],"yuán xuàn":["楥"],"yǎng yàng yīng":["楧"],pián:["楩","胼","腁","賆","蹁","駢","騈","骈","骿","㛹"],"dié yè":["楪"],"dùn shǔn":["楯"],"còu zòu":["楱"],"dì dǐ shì":["楴"],"kǎi jiē":["楷"],"róu ròu":["楺"],"lè yuè":["楽"],"wēn yùn":["榅","鞰"],lǘ:["榈","櫚","氀","膢","藘","閭","闾","驢","驴"],shén:["榊","神","鉮","鰰","𬬹"],"bī pi":["榌"],"zhǎn niǎn zhèn":["榐"],"fú fù bó":["榑"],"jiàn jìn":["榗"],"bǎng bàng":["榜"],"shā xiè":["榝","樧"],nòu:["槈","耨","鎒","鐞"],"qiǎn lián xiàn":["槏"],gàng:["槓","焵","焹","筻","鿍"],gāo:["槔","槹","橰","櫜","睾","篙","糕","羔","臯","韟","餻","高","髙","鷎","鷱","鼛"],"diān zhěn zhēn":["槙"],"kǎn jiàn":["槛"],"xí dié":["槢"],"jī guī":["槣"],"róng yōng":["槦"],"tuán shuàn quán":["槫"],"qì sè":["槭"],"cuī zhǐ":["槯"],"yǒu chǎo":["槱"],"màn wàn":["槾"],"lí chī":["樆"],"léi lěi":["樏","櫑","礌"],"cháo jiǎo chāo":["樔"],"chēng táng":["樘"],"jiū liáo":["樛"],"mó mú":["模"],"niǎo mù":["樢"],"héng hèng":["横","橫"],xuě:["樰","膤","艝","轌","雪","鱈","鳕"],"fá fèi":["橃"],rùn:["橍","润","潤","膶","閏","閠","闰"],"zhǎn jiǎn":["橏"],shùn:["橓","瞚","瞬","舜","蕣","順","顺","鬊"],"tuí dūn":["橔"],"táng chēng":["橖"],"sù qiū":["橚"],"tán diàn":["橝"],"fén fèn fèi":["橨"],"rǎn yān":["橪"],"cū chu":["橻"],"shū qiāo":["橾"],"píng bò":["檘"],"zhái shì tú":["檡"],"biǎo biāo":["檦"],"qiān lián":["檶"],"nǐ mí":["檷"],"jiàn kǎn":["檻"],"nòu ruǎn rú":["檽"],"jī jì":["櫅","禨"],"huǎng guǒ gǔ":["櫎"],"lǜ chū":["櫖"],"miè mèi":["櫗"],ōu:["櫙","欧","歐","殴","毆","瓯","甌","膒","藲","謳","讴","鏂","鴎","鷗","鸥"],"zhù zhuó":["櫡"],"jué jì":["櫭"],"huái guī":["櫰"],"chán zhàn":["欃"],"wéi zuì":["欈"],cáng:["欌","鑶"],"yù yì":["欥"],"chù qù xì":["欪"],"kài ài":["欬"],"yì yīn":["欭"],"xì kài":["欯"],"shuò sòu":["欶"],"ǎi ēi éi ěi èi ê̄ ế ê̌ ề":["欸"],"qī yī":["欹"],"chuā xū":["欻"],"chǐ chuài":["欼"],"kǎn qiàn":["欿"],"kǎn kè":["歁"],"chuǎn chuán":["歂"],"yīn yān":["歅"],"jìn qūn":["歏"],pēn:["歕"],"xū chuā":["歘"],"xī shè":["歙"],"liǎn hān":["歛"],"zhì chí":["歭"],"sè shà":["歰"],sǐ:["死"],"wěn mò":["歾"],piǎo:["殍","皫","瞟","醥","顠"],"qíng jìng":["殑"],"fǒu bó":["殕"],"zhí shi":["殖"],"yè yān yàn":["殗"],"hūn mèi":["殙"],chòu:["殠","臰","遚"],"kuì huì":["殨","溃","潰"],cuàn:["殩","熶","爨","窜","竄","篡","簒"],"yīn yān yǐn":["殷"],"qìng kēng shēng":["殸"],"yáo xiáo xiào":["殽"],"gū gǔ":["毂","蛄"],"guàn wān":["毌"],"dú dài":["毒"],"xún xùn":["毥"],mú:["毪","氁"],"dòu nuò":["毭"],"sāi suī":["毸"],lu:["氇"],sào:["氉","瘙","矂","髞"],"shì zhī":["氏"],"dī dǐ":["氐"],"máng méng":["氓"],"yáng rì":["氜"],shuǐ:["水","氵","氺","閖"],"zhěng chéng zhèng":["氶"],tǔn:["氽"],"fán fàn":["氾"],"guǐ jiǔ":["氿"],"bīn pà pā":["汃"],"zhuó què":["汋"],"dà tài":["汏"],pìn:["汖","牝","聘"],"hàn hán":["汗","馯"],tu:["汢"],"tāng shāng":["汤","湯"],"zhī jì":["汥"],"gàn hán cén":["汵"],"wèn mén":["汶"],"fāng pāng":["汸"],"hǔ huǎng":["汻"],"niú yóu":["汼"],hàng:["沆"],"shěn chén":["沈"],"dùn zhuàn":["沌"],"nǜ niǔ":["沑"],"méi mò":["沒","没"],"tà dá":["沓"],"mì wù":["沕"],"hóng pāng":["沗"],"shā shà":["沙"],"zhuǐ zǐ":["沝"],"ōu òu":["沤","漚"],"jǔ jù":["沮"],"tuō duó":["沰"],"mǐ lì":["沵"],"yí chí":["沶"],"xiè yì":["泄"],"bó pō":["泊"],"mì bì":["泌","秘"],"chù shè":["泏"],"yōu yòu āo":["泑"],"pēng píng":["泙","硑"],"pào pāo":["泡"],"ní nì":["泥","秜"],"yuè sà":["泧"],"jué xuè":["泬","疦"],"lóng shuāng":["泷","瀧"],"luò pō":["泺","濼"],"zé shì":["泽","澤"],"sǎ xǐ":["洒"],"sè qì zì":["洓"],"xǐ xiǎn":["洗"],"kǎo kào":["洘"],"àn yàn è":["洝"],"lěi lèi":["洡"],"qiè jié":["洯"],"qiǎn jiān":["浅"],"jì jǐ":["济","済","濟","纪"],"hǔ xǔ":["浒","滸"],"jùn xùn":["浚","濬"],"yǐng chéng yíng":["浧"],"liàn lì":["浰"],"féng hóng":["浲","溄"],"jiǒng jiōng":["浻"],"suī něi":["浽"],"yǒng chōng":["涌"],"tūn yūn":["涒"],"wō guō":["涡","渦"],hēng:["涥","脝"],"zhǎng zhàng":["涨","漲"],"shòu tāo":["涭"],shuàn:["涮","腨"],"kōng náng":["涳"],"wò wǎn yuān":["涴"],"tuō tuò":["涶"],wō:["涹","猧","窝","窩","莴","萵","蜗","蝸","踒"],"qiè jí":["淁"],"guǒ guàn":["淉"],"lín lìn":["淋","獜","疄"],"tǎng chǎng":["淌"],"nào chuò zhuō":["淖"],"péng píng":["淜"],féi:["淝","肥","腓","蜰"],"pì pèi":["淠"],"niǎn shěn":["淰"],"biāo hǔ":["淲"],"chún zhūn":["淳"],"hùn hún":["混"],qiǎn:["淺","繾","缱","肷","膁","蜸","譴","谴","遣","鑓"],"wèn mín":["渂"],"rè ruò luò":["渃"],"dú dòu":["渎","瀆","读"],"jiàn jiān":["渐","溅","漸","濺"],"miǎn shéng":["渑","澠"],"nuǎn nuán":["渜"],"qiú wù":["渞"],"tíng tīng":["渟"],"dì tí dī":["渧"],"gǎng jiǎng":["港"],"hōng qìng":["渹"],tuān:["湍","煓"],"huì mǐn xū":["湏"],"xǔ xù":["湑"],pén:["湓","瓫","盆","葐"],"mǐn hūn":["湣"],"tuàn nuǎn":["湪"],"qiū jiǎo":["湫","湬"],"yān yīn":["湮"],"bàn pán":["湴"],"zhuāng hún":["湷"],"yàn guì":["溎"],"lián liǎn nián xián xiàn":["溓"],"dá tǎ":["溚","鿎"],"liū liù":["溜","澑","蹓"],lùn:["溣"],mǎ:["溤","犸","獁","玛","瑪","码","碼","遤","鎷","馬","马","鰢","鷌"],"zhēn qín":["溱"],"nì niào":["溺"],"chù xù":["滀","畜"],"wěng wēng":["滃"],"hào xuè":["滈"],"qì xì xiē":["滊"],"xíng yíng":["滎"],"zé hào":["滜"],"piāo piào piǎo":["漂"],"cóng sǒng":["漎"],"féng péng":["漨"],"luò tà":["漯"],"pēng bēn":["漰"],"chóng shuāng":["漴"],"huǒ kuò huò":["漷"],"liáo liú":["漻"],"cuǐ cuī":["漼"],"cóng zǒng":["潀"],"cóng zōng":["潈"],"pì piē":["潎"],"dàng xiàng":["潒"],"huáng guāng":["潢"],"liáo lào lǎo":["潦"],"cōng zòng":["潨"],"zhí zhì":["潪"],"tān shàn":["潬"],"tú zhā":["潳"],"sàn sǎ":["潵"],hēi:["潶","黑","黒","𬭶"],"chéng dèng":["澄","瀓"],"cūn cún":["澊"],"péng pēng":["澎"],"hòng gǒng":["澒","銾"],"wàn màn":["澫"],"kuài huì":["澮"],"guō wō":["濄"],"pēn fén":["濆"],"jí shà":["濈"],"huì huò":["濊"],"dǐng tìng":["濎"],"mǐ nǐ":["濔"],"bì pì":["濞"],"cuì zuǐ":["濢"],"hù huò":["濩"],"ǎi kài kè":["濭"],"wěi duì":["濻","瀢"],"zàn cuán":["濽","灒"],"yǎng yàng":["瀁"],"wǎng wāng":["瀇"],"mò miè":["瀎","眜"],suǐ:["瀡","膸","髓"],"huái wāi":["瀤"],"zùn jiàn":["瀳"],"yīng yǐng yìng":["瀴"],"ráng ràng":["瀼"],shuàng:["灀"],"zhuó jiào zé":["灂"],sǎ:["灑","訯","靸"],"luán luàn":["灓"],"dǎng tǎng":["灙"],"xún quán quàn":["灥"],"huǒ biāo":["灬"],"zhà yù":["灹"],"fén bèn":["炃"],"jiǒng guì":["炅"],"pàng fēng":["炐"],quē:["炔","缺","缼","蒛"],biān:["炞","煸","甂","砭","笾","箯","籩","編","编","蝙","邉","邊","鍽","鞭","鯾","鯿","鳊"],"zhāo zhào":["炤"],"zhuō chù":["炪"],"pào páo bāo":["炮"],"páo fǒu":["炰"],"shǎn qián shān":["炶"],"zhà zhá":["炸"],"jiǎo yào":["烄"],quǎn:["烇","犬","犭","畎","綣","绻","虇"],"yàng yáng":["烊"],"lào luò":["烙"],"huí huǐ":["烠"],rè:["热","熱"],"fú páo":["烰"],"xiè chè":["烲","焎"],"yàn shān":["烻"],"hūn xūn":["焄"],kào:["焅","犒","銬","铐","靠","鮳","鯌","鲓","㸆"],"juān yè":["焆"],"jùn qū":["焌"],"tāo dào":["焘"],"chǎo jù":["焣"],"wò ài":["焥"],"zǒng cōng":["焧"],"xī yì":["焬"],"xìn xīn":["焮"],"chāo zhuō":["焯"],"xiǒng yīng":["焸","焽"],kuǐ:["煃","跬","蹞","頍","𫠆"],"huī yùn xūn":["煇"],"jiǎo qiāo":["煍"],"qián shǎn shān":["煔"],"xī yí":["煕"],"shà shā":["煞"],"yè zhá":["煠"],"yáng yàng":["煬"],"ēn yūn":["煾"],"yūn yǔn":["熅"],"hè xiāo":["熇"],xióng:["熊","熋","雄"],"xūn xùn":["熏","爋"],gòng:["熕","貢","贡"],liū:["熘"],"cōng zǒng":["熜"],"lù āo":["熝"],"shú shóu":["熟"],"fēng péng":["熢"],"cuǐ suī":["熣"],tēng:["熥","膯","鼟"],"yùn yù":["熨"],"áo āo":["熬"],"hàn rǎn":["熯"],"ōu ǒu":["熰"],"huáng huǎng":["熿"],"chǎn dǎn chàn":["燀"],"jiāo zhuó qiáo jué":["燋"],"yàn yān":["燕"],"tài liè":["燤"],āo:["爊"],"yàn xún":["爓"],"jué jiào":["爝","覐","覚","覺","觉"],"lǎn làn":["爦"],"zhuǎ zhǎo":["爪"],"zhǎo zhuǎ":["爫"],"fù fǔ":["父"],diē:["爹","褺","跌"],zāng:["牂","羘","臧","賍","賘","贓","贜","赃","髒"],"piàn piān":["片"],"biān miàn":["牑"],bǎng:["牓","綁","绑"],"yǒu yōng":["牗"],"chēng chèng":["牚","竀"],niú:["牛","牜"],"jiū lè":["牞"],"mù móu":["牟"],māng:["牤"],"gē qiú":["牫"],"yòu chōu":["牰"],"tè zhí":["犆"],bēn:["犇","錛","锛"],"jiān qián":["犍","玪"],má:["犘","痲","蔴","蟇","麻"],"máo lí":["犛"],"bá quǎn":["犮"],"zhuó bào":["犳"],"àn hān":["犴"],"kàng gǎng":["犺"],"pèi fèi":["犻"],"fān huān":["犿"],kuáng:["狂","狅","誑","诳","軖","軠","鵟","𫛭"],"yí quán chí":["狋"],"xīng shēng":["狌"],"tuó yí":["狏"],kǔ:["狜","苦"],"huán huān":["狟"],"hé mò":["狢"],"tà shì":["狧"],"máng dòu":["狵"],"xī shǐ":["狶"],suān:["狻","痠","酸"],"bài pí":["猈"],"jiān yàn":["猏","豣"],"yī yǐ":["猗"],"yá wèi":["猚"],cāi:["猜"],"māo máo":["猫","貓"],"chuàn chuān":["猭"],"tuān tuàn":["猯","貒"],"yà jiá qiè":["猰"],"hè xiē gé hài":["猲"],"biān piàn":["猵","獱"],"bó pò":["猼"],"háo gāo":["獋"],"fén fèn":["獖"],"yào xiāo":["獟"],"shuò xī":["獡"],"gé liè xiē":["獦"],"nòu rú":["獳"],"náo nǎo yōu":["獶"],ráng:["獽","瓤","禳","穣","穰","蘘","躟","鬤"],"náo yōu":["獿"],"lǜ shuài":["率"],"wáng wàng":["王"],"yáng chàng":["玚"],"mín wén":["玟"],"bīn fēn":["玢"],"mén yǔn":["玧"],"qiāng cāng":["玱","瑲","篬"],"án gān":["玵"],"xuán xián":["玹"],"cī cǐ":["玼","跐"],"yí tāi":["珆"],"zǔ jù":["珇"],fà:["珐","琺","蕟","髪","髮"],"yín kèn":["珢"],"huī hún":["珲"],"xuán qióng":["琁"],"fú fū":["琈"],"bǐng pín":["琕"],"cuì sè":["琗"],"yù wéi":["琟"],"tiǎn tiàn":["琠"],"zhuó zuó":["琢"],"běng pěi":["琣"],guǎn:["琯","璭","痯","筦","管","舘","輨","錧","館","馆","鳤"],"hún huī":["琿"],"xié jiē":["瑎"],"chàng dàng yáng":["瑒"],"tiàn zhèn":["瑱"],"bīn pián":["瑸","璸"],"tú shū":["瑹"],cuǐ:["璀","皠","趡"],"zǎo suǒ":["璅"],"jué qióng":["璚"],"lú fū":["璷"],"jì zī":["璾"],suí:["瓍","綏","绥","遀","随","隨","髄"],"mí xǐ":["瓕"],"qióng wěi wèi":["瓗"],"huán yè yà":["瓛"],"bó páo":["瓟"],"zhí hú":["瓡"],piáo:["瓢","闝"],"wǎ wà":["瓦"],"xiáng hóng":["瓨"],wèng:["瓮","甕","罋","蕹","齆"],"shèn shén":["甚"],ruí:["甤","緌","蕤"],yòng:["用","砽","苚","蒏","醟","㶲"],shuǎi:["甩"],béng:["甭","甮"],"yóu zhá":["甴"],"diàn tián shèng":["甸"],"tǐng dīng":["町","甼"],"zāi zī":["甾"],"bì qí":["畁"],"dá fú":["畗"],"cè jì":["畟"],"zāi zī tián":["畠"],"zhì chóu shì":["畤"],"fān pān":["畨","番"],"shē yú":["畬"],"dāng dàng dǎng":["當"],"jiāng qiáng":["疆"],"pǐ yǎ shū":["疋"],"jié qiè":["疌"],"yí nǐ":["疑"],nè:["疒","眲","訥","讷"],"gē yì":["疙"],"nüè yào":["疟","瘧"],"lì lài":["疠","癘"],"yǎ xiā":["疨"],xuē:["疶","蒆","薛","辥","辪","靴","鞾"],"dǎn da":["疸"],"fá biǎn":["疺"],"fèi féi":["疿","痱"],"shān diàn":["痁"],"téng chóng":["痋"],"tōng tóng":["痌"],"wěi yòu yù":["痏"],"tān shǐ":["痑"],"pū pù":["痡","鋪"],"bēng péng":["痭"],"má lìn":["痳"],"tiǎn diàn":["痶"],"ān yè è":["痷"],"kē ē":["痾"],"zhì chì":["瘈"],"jiǎ xiá xiā":["瘕"],"lěi huì":["瘣"],"chài cuó":["瘥"],"diān chēn":["瘨"],"da dá":["瘩"],"biě biē":["瘪"],qué:["瘸"],"dàn dān":["癉"],"guì wēi":["癐"],"nòng nóng":["癑"],"biē biě":["癟"],"bō bǒ":["癷"],bái:["白"],"jí bī":["皀"],"de dì dí dī":["的"],"pā bà":["皅"],"gāo háo":["皋"],"gāo yáo":["皐"],"lì luò bō":["皪"],"zhā cǔ":["皻"],"zhāo zhǎn dǎn":["皽"],"jiān jiàn":["监","監","鋻","间","鞬"],"gài gě hé":["盖"],"máng wàng":["盳"],yuǎn:["盶","逺","遠"],"tián xián":["盷"],"xiāng xiàng":["相"],dǔn:["盹","趸","躉"],"xì pǎn":["盻"],"shěng xǐng":["省"],"yún hùn":["眃"],"miǎn miàn":["眄"],"kàn kān":["看"],"yìng yāng yǎng":["眏"],"yǎo āo ǎo":["眑"],"jū xū kōu":["眗"],"yí chì":["眙"],"dié tì":["眣"],"bǐng fǎng":["眪"],"pàng pán":["眫"],"mī mí":["眯","瞇"],"xuàn shùn xún":["眴"],tiào:["眺","粜","糶","覜","趒"],"zhe zhuó zháo zhāo":["着"],"qiáo shào xiāo":["睄"],"cuó zhuài":["睉"],gùn:["睔","謴"],"suì zuì":["睟"],"pì bì":["睥","稫","辟"],"yì zé gāo":["睪"],"xǐng xìng":["睲"],"guì wèi kuì":["瞆"],"kòu jì":["瞉"],"qióng huán":["瞏"],"mán mén":["瞒","瞞"],"diāo dōu":["瞗"],"lou lóu lǘ":["瞜"],"shùn rún":["瞤"],"liào liǎo":["瞭","钌"],"jiàn xián":["瞯"],"wǔ mí":["瞴"],"guì kuì":["瞶"],"nǐng chēng":["矃"],"huò yuè":["矆"],"mēng méng":["矇"],"kuàng guō":["矌"],"guàn quán":["矔"],"mǎn mán":["矕"],"jīn guān qín":["矜"],"jīn qín guān":["矝"],"yù xù jué":["矞"],"jiǎo jiáo":["矫","矯"],duǎn:["短"],"shí dàn":["石"],"gāng qiāng kòng":["矼"],"huā xū":["砉"],"pīn bīn fēn":["砏"],"yán yàn":["研","硏"],"luǒ kē":["砢"],"fú fèi":["砩","笰"],"zhǔ zhù":["砫"],"lá lì lā":["砬"],"kuāng guāng":["硄"],"gè luò":["硌"],"shuò shí":["硕","碩"],"wèi wéi ái":["硙"],"què kè kù":["硞"],"mǎng bàng":["硥"],"luò lòng":["硦"],"yǒng tóng":["硧"],nüè:["硸","虐"],"kēng kěng":["硻"],"yān yǎn":["硽"],"zhuì chuí duǒ":["硾"],"kōng kòng":["硿"],"zòng cóng":["碂"],"jiān zhàn":["碊"],"lù liù":["碌","陆"],"què xī":["碏"],"lún lǔn lùn":["碖"],"náo gāng":["碙"],"jié yà":["碣"],"wèi wěi":["碨"],"tí dī":["碮"],"chá chā":["碴"],"qiāo què":["碻"],"sù xiè":["碿"],"liú liù":["磂","遛","鎦","馏"],"sī tí":["磃"],"bàng páng":["磅"],"huá kě gū":["磆"],"wěi kuǐ":["磈"],"xiá qià yà":["磍"],"lián qiān":["磏"],"wèi ái gài":["磑"],"lá lā":["磖"],"áo qiāo":["磝"],"pēng pèng":["磞","閛"],"yīn yǐn":["磤"],"lěi léi":["磥"],"mó mò":["磨"],"qì zhú":["磩"],"láo luò":["磱"],"pán bō":["磻"],"jí shé":["磼"],"hé qiāo qiào":["礉"],"kè huò":["礊"],"què hú":["礐"],"è qì":["礘"],cǎ:["礤","礸"],"xián xín":["礥"],"léi lěi lèi":["礧"],"yán yǎn":["礹"],"qí zhǐ":["祇","蚔"],"bēng fāng":["祊"],"bì mì":["祕"],suàn:["祘","笇","筭","算","蒜"],"piào piāo":["票"],"jì zhài":["祭"],"shuì lèi":["祱"],"jìn jīn":["禁"],"chán shàn":["禅"],"yáng shāng":["禓"],"zhī zhǐ tí":["禔"],"shàn chán":["禪"],"yú yù ǒu":["禺"],"zǐ zì":["秄"],"chá ná":["秅"],"zhǒng zhòng chóng":["种"],"hào mào":["秏"],"kù kū":["秙"],zū:["租","葅"],chèng:["秤","穪"],"huó kuò":["秮","秳"],"chēng chèn chèng":["称","稱"],"shì zhì":["秲","銴"],"fù pū":["秿"],"xùn zè":["稄"],"tú shǔ":["稌"],"zhùn zhǔn":["稕"],"jī qí":["稘","綨","觭"],"léng líng":["稜"],"zuì zú sū":["稡"],"xì qiè":["稧","郄"],"zhǒng zhòng":["種"],"zōng zǒng":["稯"],"xián jiān liàn":["稴"],"zī jiū":["稵"],"jī qǐ":["稽"],ròng:["穃"],"shān cǎn cēn":["穇"],"mén méi":["穈"],"jǐ jì":["穖"],"xiāo rào":["穘"],"zhuō bó":["穛"],"tóng zhǒng zhòng":["穜"],zuō:["穝"],"biāo pāo":["穮","藨"],"zhuō jué":["穱"],"cuán zàn":["穳"],"kōng kòng kǒng":["空"],"yū yǔ":["穻"],zhǎi:["窄","鉙"],báo:["窇","雹"],"kū zhú":["窋"],"jiào liáo liù":["窌"],"wā guī":["窐"],"tiǎo yáo":["窕"],"xūn yìn":["窨"],"yà yē":["窫"],"tián diān yǎn":["窴"],"chāo kē":["窼"],"kuǎn cuàn":["窽","窾"],"chù qì":["竐"],"qǔ kǒu":["竘"],"jìng zhěn":["竧"],"kǎn kàn":["竷"],"zhú dǔ":["竺"],"lè jīn":["竻"],"zhuì ruì":["笍"],"háng hàng":["笐"],"cén jìn hán":["笒"],"dā xiá nà":["笚"],"zé zuó":["笮"],"lóng lǒng":["笼","篭","籠","躘","龓"],"zhù zhú":["筑","築"],"dá dā":["答","荅"],shāi:["筛","篩","簁","籭"],"yún jūn":["筠"],"láng làng":["筤","郎","阆"],"zhì zhǐ":["筫"],o:["筽"],"póu bù fú pú":["箁"],"pái bēi":["箄"],gè:["箇","虼","鉻","铬"],"tái chí":["箈"],"guǎi dài":["箉"],"zhào dào":["箌"],"jīng qìng":["箐"],"lín lǐn":["箖"],"jùn qūn":["箘"],"shī yí":["箷","釶"],"yuē yào chuò":["箹"],"xiāo shuò qiào":["箾"],"gōng gǎn lǒng":["篢"],"páng péng":["篣"],"zhuó huò":["篧"],"jiǎn jiān":["篯"],"dí zhú":["篴"],"zān cēn cǎn":["篸"],"zhuàn suǎn zuàn":["篹"],"piǎo biāo":["篻"],"guó guì":["簂"],"cè jí":["簎"],"mì miè":["簚"],"shāi sī":["簛"],"sǔn zhuàn":["簨"],"gàn gǎn":["簳"],"bò bǒ":["簸"],"bó bù":["簿"],shi:["籂"],"zhēn jiān":["籈"],"zhuàn zuǎn":["籑"],"fān pān biān":["籓"],"sǒu shǔ":["籔"],zuǎn:["籫","繤","纂","纉","纘","缵"],nǚ:["籹","釹","钕"],"shā chǎo":["粆"],"kāng jīng":["粇"],fěn:["粉","黺"],cū:["粗","觕","麁","麄","麤"],"nián zhān":["粘"],"cè sè":["粣"],"zhōu yù":["粥"],"shēn sǎn":["糁"],"biān biǎn":["糄","萹"],miàn:["糆","面","靣","麪","麫","麵","麺"],"hú hū hù":["糊"],"gǔ gòu":["糓"],"mí méi":["糜"],"sǎn shēn":["糝","糣"],zāo:["糟","蹧","遭","醩"],"mì sī":["糸"],"jiū jiǔ":["糺"],"xì jì":["系","繫"],"zhēng zhěng":["糽"],"chà chǎ":["紁","衩"],"yuē yāo":["約","约"],"hóng gōng":["紅","红"],"hé gē":["紇","纥"],"wén wèn":["紋","纹"],fóu:["紑"],"jì jié jiè":["紒"],"pī pí bǐ":["紕","纰"],"jīn jìn":["紟"],"zhā zā":["紥","紮"],hā:["紦"],"fū fù":["紨"],"chōu chóu":["紬"],"lèi léi lěi":["累"],"bō bì":["紴"],"tiǎn zhěn":["紾"],"jiōng jiǒng":["絅"],"jié jiē":["結","结","节"],"guà kuā":["絓"],"bǎi mò":["絔"],"gēng huán":["絙"],"jié xié":["絜"],"quán shuān":["絟"],"gǎi ǎi":["絠"],"luò lào":["絡","络"],"bīng bēng pēng":["絣"],"gěi jǐ":["給","给"],"tóng tōng dòng":["絧"],"tiào diào dào":["絩"],"lěi lèi léi":["絫"],"gāi hài":["絯"],"chī zhǐ":["絺"],"wèn miǎn mán wàn":["絻"],"huán huàn wàn":["綄"],"qīn xiān":["綅"],"tì tí":["綈"],"yán xiàn":["綖"],"zōng zèng zòng":["綜"],"chēn lín":["綝"],"zhǔn zhùn":["綧"],"qiàn qīng zhēng":["綪"],"qìng qǐ":["綮"],"lún guān":["綸","纶"],"chuò chāo":["綽","绰"],"tián tǎn chān":["緂"],"lǜ lù":["緑","绿"],"ruǎn ruàn":["緛"],"jí qī":["緝"],"zhòng chóng":["緟","重"],"miáo máo":["緢"],"xiè yè":["緤"],huǎn:["緩","缓","㬊"],"gēng gèng":["緪","縆"],"tōu xū shū":["緰"],"zōng zòng":["緵","繌"],"yùn gǔn":["緷"],"guā wō":["緺"],"yùn yūn wēn":["緼","縕"],"bāng bàng":["縍"],"gǔ hú":["縎","鶻"],"cī cuò suǒ":["縒"],"cuī shuāi":["縗"],"róng rǒng ròng":["縙"],"zài zēng":["縡"],cài:["縩","菜","蔡"],"féng fèng":["縫"],"suō sù":["縮","缩"],"yǎn yǐn":["縯","酓"],"zòng zǒng":["縱","纵"],"zhuàn juàn":["縳"],"mò mù":["縸","莫"],"piǎo piāo":["縹","缥"],"fán pó":["繁"],"bēng bèng":["繃"],"móu miù miào liǎo":["繆"],"yáo yóu zhòu":["繇"],"zēng zèng":["繒","缯"],"jú jué":["繘"],"chuō chuò":["繛"],"zūn zǔn":["繜"],rào:["繞","绕","遶"],"chǎn chán":["繟"],"huì huí":["繢","缋","藱"],"qiāo sāo zǎo":["繰"],"jiǎo zhuó":["繳","缴"],"dàn tán chán":["繵"],nǒng:["繷"],"pú fú":["纀"],"yào lì":["纅"],"rǎng xiāng":["纕"],"lí sǎ xǐ lǐ":["纚"],"xiān qiàn":["纤"],"jīng jìng":["经"],"tí tì":["绨"],"bēng běng bèng":["绷"],"zōng zèng":["综"],"jī qī":["缉"],"wēn yùn yūn":["缊"],"fèng féng":["缝"],"shuāi cuī suī":["缞"],"miù móu liáo miào mù":["缪"],"qiāo sāo":["缲"],fǒu:["缶","缹","缻","雬","鴀"],"bà ba pí":["罢","罷"],"guà guǎi":["罫"],"yáng xiáng":["羊","羏"],"měi gāo":["羙"],"yì xī":["羛"],"qiǎng qiān":["羟"],"qiāng kòng":["羫"],"qián xián yán":["羬"],nóu:["羺"],"hóng gòng":["羾"],"pī bì pō":["翍"],"qú yù":["翑"],ké:["翗"],"qiào qiáo":["翘"],"zhái dí":["翟"],"dào zhōu":["翢"],"hóu qú":["翵"],shuǎ:["耍"],"ruǎn nuò":["耎"],"ér nài":["耏"],"zhuān duān":["耑"],"pá bà":["耙"],"chí sì":["耛"],"qù chú":["耝"],"lún lǔn":["耣"],"jí jiè":["耤"],"tāng tǎng":["耥"],pǎng:["耪","覫"],"zhá zé":["耫"],"yē yé":["耶"],"yún yíng":["耺"],"wà tuǐ zhuó":["聉"],"ér nǜ":["聏"],"tiē zhé":["聑"],"dǐ zhì":["聜"],qié:["聺"],"nǐ jiàn":["聻"],"lèi lē":["肋"],cào:["肏","襙","鄵","鼜"],"bó dí":["肑"],"xiào xiāo":["肖"],"dù dǔ":["肚"],chāi:["肞","釵","钗"],"hán qín hàn":["肣"],"pàng pán pàn":["肨","胖"],"zhūn chún":["肫"],āng:["肮","骯"],"yù yō":["育"],"pí bǐ bì":["肶"],"fèi bì":["胇"],"bèi bēi":["背"],"fèi zǐ":["胏"],"píng pēng":["胓","苹"],"fū fú zhǒu":["胕"],"shèng shēng":["胜"],kuà:["胯","跨","骻"],"gǎi hǎi":["胲"],"gē gé gā":["胳"],"néng nài":["能"],"guī kuì":["胿"],"mài mò":["脉"],"zāng zàng":["脏"],"jiǎo jué":["脚","角"],cuǒ:["脞"],"de te":["脦"],"zuī juān":["脧"],něi:["脮","腇","餒","馁","鮾","鯘"],"pú fǔ":["脯"],niào:["脲"],shuí:["脽"],guò:["腂","過","鐹"],"là xī":["腊"],"yān ā":["腌"],"gāo gào":["膏"],"lù biāo":["膔"],chuái:["膗"],"zhuān chuán chún zhuǎn":["膞"],chuài:["膪","踹"],"fán pán":["膰"],"wǔ hū":["膴"],"shān dàn":["膻"],tún:["臀","臋","蛌","豘","豚","軘","霕","飩","饨","魨","鲀","黗"],"bì bei":["臂"],"là gé":["臈"],"sào sāo":["臊"],nào:["臑","閙","闹","鬧"],"ní luán":["臡"],"qiān xián":["臤"],"guàng jiǒng":["臦"],"guǎng jiǒng":["臩"],"chòu xiù":["臭"],"mián biān":["臱"],"dié zhí":["臷"],"zhī jìn":["臸"],"shè shě":["舍"],pù:["舖","舗"],"bān bō pán":["般"],kuā:["舿"],"gèn gěn":["艮"],"sè shǎi":["色"],"fú bó":["艴"],"jiāo qiú":["艽"],"chāi chā":["芆"],"sháo què":["芍"],"hù xià":["芐"],"zì zǐ":["芓"],"huì hū":["芔"],"tún chūn":["芚"],"jiè gài":["芥"],"xù zhù":["芧"],"yuán yán":["芫"],"xīn xìn":["芯"],"lún huā":["芲"],"wù hū":["芴"],"gōu gǒu":["芶"],"mào máo":["芼"],"fèi fú":["芾"],"chán yín":["苂"],qiē:["苆"],"sū sù":["苏"],"tiáo sháo":["苕"],"lì jī":["苙"],"kē hē":["苛"],"jù qǔ":["苣"],"ruò rě":["若"],"zhù níng":["苧"],"pā bó":["苩"],xiú:["苬"],"zhǎ zuó":["苲"],"jū chá":["苴"],nié:["苶"],"shēng ruí":["苼"],"qié jiā":["茄"],"zǐ cí":["茈"],"qiàn xī":["茜"],chǎi:["茝"],"fá pèi":["茷"],ráo:["荛","蕘","襓","饒","饶"],"yíng xíng":["荥"],"qián xún":["荨","蕁"],"yìn yīn":["荫"],"hé hè":["荷"],"shā suō":["莎"],"péng fēng":["莑"],"shēn xīn":["莘"],"wǎn guān guǎn":["莞"],"yóu sù":["莤"],"shāo xiāo":["莦","蛸"],"làng liáng":["莨"],"piǎo fú":["莩"],"wèn wǎn miǎn":["莬"],"shì shí":["莳","蒔"],"tù tú":["莵"],"xiān liǎn":["莶","薟"],"wǎn yù":["菀"],"zōu chù":["菆"],"lù lǜ":["菉"],"jūn jùn":["菌"],"niè rěn":["菍"],"zī zì zāi":["菑"],"tú tù":["菟"],"jiē shà":["菨"],"qiáo zhǎo":["菬"],"tái zhī chí":["菭"],"fēi fěi":["菲","蜚"],"qín qīn jīn":["菳"],"zū jù":["菹","蒩"],"lǐn má":["菻"],"tián tiàn":["菾"],tiē:["萜","貼","贴"],"luò là lào luō":["落"],"zhù zhuó zhe":["著"],"shèn rèn":["葚"],"gě gé":["葛"],"jùn suǒ":["葰"],"kuì kuài":["蒉"],"rú ná":["蒘"],"méng mēng měng":["蒙"],"yuán huán":["蒝"],"xú shú":["蒣"],"xí xì":["蒵"],"mì míng":["蓂"],"sōu sǒu":["蓃"],"gài gě hé hài":["蓋"],"yǎo zhuó":["蓔"],"diào tiáo dí":["蓧"],"xū qiū fū":["蓲"],"zí jú":["蓻"],"liǎo lù":["蓼"],xu:["蓿"],"hàn hǎn":["蔊"],"màn wàn mán":["蔓"],"pó bò":["蔢"],"fān fán bō":["蕃"],"hóng hòng":["蕻"],"yù ào":["薁","隩"],"xí xiào":["薂"],"báo bó bò":["薄"],"cí zī":["薋"],"wàn luàn":["薍"],"kǎo hāo":["薧"],"yuǎn wěi":["薳"],"zhòu chóu":["薵"],"wō mái":["薶"],"xiāo hào":["藃"],"yù xù xū":["藇"],"jiè jí":["藉"],"diào zhuó":["藋"],"cáng zàng":["藏"],lǎ:["藞"],"chú zhū":["藸"],"pín píng":["蘋"],"gān hán":["虷"],"hóng jiàng":["虹"],"huī huǐ":["虺"],"xiā há":["虾"],"mǎ mà mā":["蚂"],"fāng bàng":["蚄"],"bàng bèng":["蚌"],"jué quē":["蚗"],"qín qián":["蚙"],"gōng zhōng":["蚣"],"fǔ fù":["蚥"],"dài dé":["蚮"],"gǒu qú xù":["蚼"],"bǒ pí":["蚾"],"shé yí":["蛇"],tiě:["蛈","鉄","銕","鐡","鐵","铁","驖"],"gé luò":["蛒"],"máng bàng":["蛖"],"yì xǔ":["蛡"],"há gé":["蛤"],"qiè ní":["蛪"],"é yǐ":["蛾"],"zhē zhé":["蜇"],"là zhà":["蜡"],suò:["蜶","逤"],"yóu qiú":["蝤"],"xiā hā":["蝦"],"xī qī":["螇"],"bī pí":["螕"],"nài něng":["螚"],"hé xiá":["螛"],"guì huǐ":["螝"],"mǎ mā mà":["螞"],"shì zhē":["螫"],"zhì dié":["螲"],"jiàn chán":["螹"],"ma má mò":["蟆"],"mǎng měng":["蟒"],"biē bié":["蟞"],"bēn fèi":["蟦"],"láo liáo":["蟧"],"yín xún":["蟫"],"lí lǐ":["蠡"],"xuè xiě":["血"],"xíng háng hàng héng":["行"],"shuāi cuī":["衰"],"tuó tuō":["袉"],"lǐng líng":["袊"],"bào páo pào":["袌"],"jù jiē":["袓"],"hè kè":["袔"],"yí yì":["袘","貤"],"nà jué":["袦"],"bèi pī":["被"],"chǐ nuǒ":["袲"],"chǐ qǐ duǒ nuǒ":["袳"],"jiá qiā jié":["袷"],"bó mò":["袹"],"guī guà":["袿"],"liè liě":["裂"],"chéng chěng":["裎"],"jiē gé":["裓"],"dāo chóu":["裯"],"shang cháng":["裳"],"yuān gǔn":["裷"],"yǎn ān":["裺"],"tì xī":["裼"],"fù fú":["褔"],"chǔ zhǔ":["褚"],"tuì tùn":["褪"],lǎi:["襰"],"yào yāo":["要"],"qín tán":["覃"],"jiàn xiàn":["見","见"],piǎn:["覑","諞","谝","貵","𡎚"],"piē miè":["覕"],"yíng yǐng":["覮"],"qù qū":["覰","覷","觑"],"jiàn biǎn":["覵"],"luó luǎn":["覶"],"zī zuǐ":["觜"],"huà xiè":["觟"],"jiě jiè xiè":["解","觧"],"xué hù":["觷"],"lì lù":["觻"],tǎo:["討","讨"],zhùn:["訰"],"zī zǐ":["訾"],"yí dài":["詒","诒"],xiòng:["詗","诇"],"diào tiǎo":["誂"],"yí chǐ chì":["誃"],"lǎng làng":["誏"],"ēi éi ěi èi xī":["誒","诶"],shuà:["誜"],"yǔ yù":["語","语","雨"],"shuō shuì yuè":["說","说"],"shuí shéi":["誰","谁"],"qū juè":["誳"],"chī lài":["誺"],"nì ná":["誽"],"diào tiáo":["調"],"pǐ bēi":["諀"],"jì jī":["諅"],"zé zuò zhǎ cuò":["諎"],"chù jí":["諔"],"háo xià":["諕"],"lùn lún":["論","论"],"shì dì":["諟"],"huà guā":["諣"],"xǐ shāi āi":["諰"],"nán nàn":["諵","難"],miù:["謬","谬"],zèn:["譖","谮"],"shí zhì":["識","识"],"juàn xuān":["讂"],"yí tuī":["讉"],zhán:["讝"],"xǔ hǔ":["许"],"xiáng yáng":["详"],"tiáo diào zhōu":["调"],"chén shèn":["谌"],"mí mèi":["谜"],"màn mán":["谩"],"gǔ yù":["谷"],"huō huò huá":["豁"],"zhì zhài":["豸"],"huān huán":["貆"],"kěn kūn":["貇"],"mò hé":["貈"],"mò hé háo":["貉"],"jù lóu":["貗"],"zé zhài":["責","责"],"dài tè":["貸"],"bì bēn":["賁"],"jiǎ gǔ jià":["賈"],"xiōng mín":["賯"],càng:["賶"],"zhuàn zuàn":["賺","赚"],"wàn zhuàn":["贃"],"gàn gòng zhuàng":["贛"],"yuán yùn":["贠"],"bēn bì":["贲"],"jiǎ gǔ":["贾"],zǒu:["走","赱","鯐"],"dié tú":["趃"],"jū qiè":["趄"],"qū cù":["趋","趨"],"jí jié":["趌"],"guā huó":["趏"],"què qì jí":["趞"],"tàng tāng":["趟"],"chuō zhuó":["趠"],"qù cù":["趣"],"yuè tì":["趯"],"bō bào":["趵"],"kuà wù":["趶"],"guì jué":["趹"],"fāng fàng páng":["趽"],"páo bà":["跁"],"qí qǐ":["跂"],"jiàn chén":["跈"],"pǎo páo":["跑"],"diǎn diē tiē":["跕"],"jū jù qiè":["跙"],bǒ:["跛"],"luò lì":["跞"],"dài duò duō chí":["跢"],zhuǎi:["跩"],"bèng pián":["跰"],"tiào táo":["跳"],"shū chōu":["跾"],"liàng liáng":["踉"],"tà tā":["踏"],chǎ:["蹅","鑔","镲"],"dí zhí":["蹢"],"dēng dèng":["蹬","鐙","镫"],cèng:["蹭"],"dūn cún":["蹲"],"juě jué":["蹶"],liāo:["蹽"],"xiè sǎ":["躠"],tǐ:["躰","軆","骵"],"yà zhá gá":["轧","軋"],"xìn xiàn":["軐"],"fàn guǐ":["軓"],"zhuàn zhuǎn":["転"],"zhóu zhòu":["軸","轴"],bú:["轐","醭","鳪"],"zhuǎn zhuàn zhuǎi":["转"],"zǎi zài":["载"],"niǎn zhǎn":["辗"],"biān bian":["边"],"dào biān":["辺"],"yǐ yí":["迆","迤","迱"],"guò guo guō":["过"],"wàng kuāng":["迋"],"hái huán":["还"],"zhè zhèi":["这"],"yuǎn yuàn":["远"],"zhì lì":["迣"],"zhù wǎng":["迬"],"zhuī duī":["追"],"shì kuò":["适"],tòu:["透"],"tōng tòng":["通"],guàng:["逛"],"dǎi dài":["逮"],"suì suí":["遂"],"tí dì":["遆"],"yí wèi":["遗"],"shì dí zhé":["適"],cà:["遪"],"huán hái":["還"],"lí chí":["邌"],"kàng háng":["邟"],"nà nèi nā":["那"],"xié yá yé yú xú":["邪"],"gāi hái":["郂"],"huán xún":["郇"],"chī xī":["郗"],hǎo:["郝"],"lì zhí":["郦"],"xiáo ǎo":["郩"],"dōu dū":["都"],liǎo:["曢","鄝","镽"],"zàn cuán cuó":["酂","酇"],"dīng dǐng":["酊"],"cù zuò":["酢"],"fā pō":["酦"],"shāi shī":["酾"],niàng:["酿","醸"],"qiú chōu":["醔"],"pō fā":["醗","醱"],"chǎn chěn":["醦"],"yàn liǎn xiān":["醶"],"niàng niáng":["釀"],"lǐ li":["里"],"lí xǐ xī":["釐"],"liǎo liào":["釕"],"dīng dìng":["釘","钉"],"qiǎo jiǎo":["釥"],"yú huá":["釪"],"huá wū":["釫"],"rì rèn jiàn":["釰","釼"],"dì dài":["釱"],"pī zhāo":["釽"],"yá yé":["釾"],"bǎ pá":["鈀","钯"],"tā tuó":["鉈","铊"],běi:["鉳"],"bǐng píng":["鉼"],"hā kē":["鉿","铪"],chòng:["銃","铳"],"xiǎng jiōng":["銄"],"yù sì":["銉"],"xù huì":["銊"],"rén rěn":["銋"],"shàn shuò":["銏"],"chì lì":["銐"],"xiǎn xǐ":["銑","铣"],"hóu xiàng":["銗"],"diào tiáo yáo":["銚"],"xiān kuò tiǎn guā":["銛","銽","铦"],"zhé niè":["銸"],"zhōng yōng":["銿"],"tōu tù dòu":["鋀"],"méi méng":["鋂"],"wàn jiǎn":["鋄","鎫"],"tǐng dìng":["鋌","铤"],"juān jiān cuān":["鋑"],"sī tuó":["鋖"],"juān xuān juàn":["鋗"],"wú huá wū":["鋘"],"zhuó chuò":["鋜"],"xíng xìng jīng":["鋞"],"jū jú":["鋦","锔"],"zuì niè":["鋷"],"yuān yuǎn wǎn wān":["鋺"],"gāng gàng":["鋼","钢"],zhuī:["錐","锥","騅","骓","鵻"],ā:["錒","锕"],"cuō chā":["鎈"],"suǒ sè":["鎍"],"yáo zú":["鎐"],"yè tà gé":["鎑"],"qiāng chēng":["鎗"],"gé lì":["鎘","镉","鬲"],"bī pī bì":["鎞"],"gǎo hào":["鎬"],"zú chuò":["鏃"],"xiū xiù":["鏅"],"shòu sōu":["鏉"],"dí dī":["鏑","镝"],"qiāo sǎn càn":["鏒"],"lù áo":["鏕"],"tāng táng":["鏜"],"jiàn zàn":["鏩"],"huì suì ruì":["鏸"],"qiǎng qiāng":["鏹","镪"],"sǎn xiàn sà":["鏾"],"jiǎn jiàn":["鐧","锏"],"dāng chēng":["鐺","铛"],"zuān zuàn":["鑽"],"sà xì":["钑"],"yào yuè":["钥"],"tǒu dǒu":["钭"],"zuàn zuān":["钻"],"qiān yán":["铅"],"pí pī":["铍"],"yáo diào tiáo":["铫"],"tāng tàng":["铴"],"pù pū":["铺"],"tán xiān":["锬"],"liù liú":["镏"],"hào gǎo":["镐"],"táng tāng":["镗"],"tán chán xín":["镡"],"huò shǎn":["閄"],"hàn bì":["閈","闬"],"kāng kàng":["閌","闶"],"xián jiàn jiān jiǎn":["閒"],"xiā xiǎ":["閕"],"xiǎ kě":["閜"],"biàn guān":["閞"],"hé gé":["閤","颌"],"hòng xiàng":["閧"],"sē xī":["閪"],"tíng tǐng":["閮"],"è yān":["閼","阏"],"hòng juǎn xiàng":["闂"],"bǎn pàn":["闆"],"dū shé":["闍","阇"],"què quē":["闕"],"tāng táng chāng":["闛"],"kàn hǎn":["闞","阚"],"xì sè tà":["闟"],"mēn mèn":["闷"],"quē què":["阙"],"yán diàn":["阽"],"ā ē":["阿"],"bēi pō pí":["陂"],"yàn yǎn":["隁"],"yú yáo shù":["隃"],"lóng lōng":["隆"],"duì zhuì":["隊"],"suí duò":["隋"],"gāi qí ái":["隑"],"huī duò":["隓","隳"],"wěi kuí":["隗"],"lì dài":["隸"],"zhuī cuī wéi":["隹"],"hè hú":["隺","鶮"],"jùn juàn":["隽","雋"],"nán nàn nuó":["难"],"què qiāo qiǎo":["雀"],"guàn huán":["雚"],"guī xī":["雟"],"sè xí":["雭"],án:["雸"],"wù méng":["雺"],tèng:["霯"],"lù lòu":["露"],mái:["霾"],"jìng liàng":["靚"],"gé jí":["革"],bǎ:["靶"],"yāng yàng":["鞅"],"gé tà sǎ":["鞈"],"biān yìng":["鞕"],"qiào shāo":["鞘"],"juān xuān":["鞙"],"shàng zhǎng":["鞝"],"pí bǐng bì bēi":["鞞"],la:["鞡"],"xiè dié":["鞢"],ēng:["鞥"],"móu mù":["鞪"],"bì bǐng":["鞸"],"mèi wà":["韎"],rǒu:["韖"],"shè xiè":["韘"],"yùn wēn":["韫"],"dùn dú":["頓","顿"],duǐ:["頧"],luō:["頱"],"bīn pín":["頻"],yóng:["顒","颙","鰫"],mān:["顢","颟"],"jǐng gěng":["颈"],"jié xié jiá":["颉"],"kē ké":["颏"],"pín bīn":["频"],"chàn zhàn":["颤"],"fēng fěng":["風","风"],"biāo diū":["颩"],"bá fú":["颰"],"sāo sōu":["颾"],"liù liáo":["飂"],"shí sì yì":["食"],"yǎng juàn":["飬"],"zhù tǒu":["飳"],"yí sì":["飴"],"zuò zé zhā":["飵"],tiè:["飻","餮"],"xiǎng náng":["饟"],"táng xíng":["饧"],"gē le":["饹"],"chā zha":["馇"],"náng nǎng":["馕"],"yūn wò":["馧"],"zhī shì":["馶"],"xìn jìn":["馸"],"kuài jué":["駃"],zǎng:["駔","驵"],"tái dài":["駘"],"xún xuān":["駨"],"liáng láng":["駺"],piàn:["騗","騙","骗","魸"],"dài tái":["骀"],"sāo sǎo":["骚"],"gǔ gū":["骨"],"bèi mó":["骳"],"xiāo qiāo":["骹"],"bǎng pǎng":["髈"],"bó jué":["髉"],"bì pǒ":["髲"],"máo méng":["髳"],"kuò yuè":["髺"],"bā bà":["魞","鲃"],"jì cǐ":["鮆"],"bó bà":["鮊"],"zhǎ zhà":["鮓","鲊"],"chóu dài":["鮘"],"luò gé":["鮥"],"guī xié wā kuí":["鮭"],"xiān xiǎn":["鮮","鲜"],"pū bū":["鯆"],"yì sī":["鯣"],"bà bó":["鲌"],"guī xié":["鲑"],"sāi xǐ":["鳃"],"niǎo diǎo":["鳥"],"diāo zhāo":["鳭"],"gān hàn yàn":["鳱"],"fū guī":["鳺"],"jiān qiān zhān":["鳽"],"hé jiè":["鶡"],"piān biǎn":["鶣"],"chuàn zhì":["鶨"],"cāng qiāng":["鶬"],"sǔn xùn":["鶽"],"biāo páo":["麃"],"zhù cū":["麆"],"jūn qún":["麇","麕"],chi:["麶"],"mó me":["麼"],"mó me ma":["麽"],"mí mǒ":["麿"],"dàn shèn":["黮"],"zhěn yān":["黰"],"dǎn zhǎn":["黵"],"miǎn mǐn měng":["黾"],hōu:["齁"],nàng:["齉"],"qí jì zī zhāi":["齐"],"yín kěn yǎn":["龂"],"yín kěn":["龈"],"gōng wò":["龏"],"guī jūn qiū":["龜","龟"],"kuí wā":["䖯"],lōu:["䁖"],"ōu qū":["𫭟"],"lóu lǘ":["𦝼"],"gǎ gā gá":["嘎"],"wā guà":["坬"],"zhǐ dǐ":["茋"],"gǒng hóng":["硔"],"yáo xiào":["滧"]},Kf=new yW;Object.keys(PL).forEach(e=>{const t=PL[e];for(let n of t)Kf.set(n,e)});const BL={这个:"zhè ge",成为:"chéng wéi",认为:"rèn wéi",作为:"zuò wéi",部分:"bù fen",要求:"yāo qiú",应该:"yīng gāi",增长:"zēng zhǎng",提供:"tí gōng",觉得:"jué de",任务:"rèn wu",那个:"nà ge",称为:"chēng wéi",为主:"wéi zhǔ",了解:"liǎo jiě",处理:"chǔ lǐ",皇上:"huáng shang",只要:"zhǐ yào",大量:"dà liàng",力量:"lì liàng",几乎:"jī hū",干部:"gàn bù",目的:"mù dì",行为:"xíng wéi",只见:"zhǐ jiàn",认识:"rèn shi",市长:"shì zhǎng",师父:"shī fu",调查:"diào chá",重新:"chóng xīn",分为:"fēn wéi",知识:"zhī shi",导弹:"dǎo dàn",质量:"zhì liàng",行款:"háng kuǎn",行列:"háng liè",行话:"háng huà",行业:"háng yè",隔行:"gé háng",在行:"zài háng",行家:"háng jia",内行:"nèi háng",外行:"wài háng",同行:"tóng háng",本行:"běn háng",行伍:"háng wǔ",洋行:"yáng háng",银行:"yín háng",商行:"shāng háng",支行:"zhī háng",总行:"zǒng háng",行情:"háng qíng",懂行:"dǒng háng",行规:"háng guī",行当:"háng dang",行货:"háng huò",太行:"tài háng",入行:"rù háng",中行:"zhōng háng",农行:"nóng háng",工行:"gōng háng",建行:"jiàn háng",各行:"gè háng",行号:"háng hào",行高:"háng gāo",行首:"háng shǒu",行尾:"háng wěi",行末:"háng mò",行长:"háng zhǎng",行距:"háng jù",换行:"huàn háng",行会:"háng huì",行辈:"háng bèi",行道:"háng dào",道行:"dào heng",参与:"cān yù",充分:"chōng fèn",尽管:"jǐn guǎn",生长:"shēng zhǎng",数量:"shù liàng",应当:"yīng dāng",院长:"yuàn zhǎng",强调:"qiáng diào",只能:"zhǐ néng",音乐:"yīn yuè",以为:"yǐ wéi",处于:"chǔ yú",部长:"bù zhǎng",蒙古:"měng gǔ",只有:"zhǐ yǒu",适当:"shì dàng",只好:"zhǐ hǎo",成长:"chéng zhǎng",高兴:"gāo xìng",不了:"bù liǎo",产量:"chǎn liàng",胖子:"pàng zi",显得:"xiǎn de",只是:"zhǐ shì",似的:"shì de",率领:"shuài lǐng",改为:"gǎi wéi",不禁:"bù jīn",成分:"chéng fèn",答应:"dā ying",少年:"shào nián",兴趣:"xìng qù",太监:"tài jian",休息:"xiū xi",校长:"xiào zhǎng",更新:"gēng xīn",合同:"hé tong",喝道:"hè dào",重庆:"chóng qìng",重建:"chóng jiàn",使得:"shǐ de",审查:"shěn chá",累计:"lěi jì",给予:"jǐ yǔ",极为:"jí wéi",冠军:"guàn jūn",仿佛:"fǎng fú",头发:"tóu fa",投降:"tóu xiáng",家长:"jiā zhǎng",仔细:"zǐ xì",要是:"yào shi",将领:"jiàng lǐng",含量:"hán liàng",更为:"gèng wéi",积累:"jī lěi",地处:"dì chǔ",县长:"xiàn zhǎng",少女:"shào nǚ",路上:"lù shang",只怕:"zhǐ pà",能量:"néng liàng",储量:"chǔ liàng",供应:"gōng yìng",挑战:"tiǎo zhàn",西藏:"xī zàng",记得:"jì de",总量:"zǒng liàng",当真:"dàng zhēn",将士:"jiàng shì",差别:"chā bié",较为:"jiào wéi",长老:"zhǎng lǎo",大夫:"dài fu",差异:"chā yì",懂得:"dǒng de",尽量:"jǐn liàng",模样:"mú yàng",的确:"dí què",为首:"wéi shǒu",便宜:"pián yi",更名:"gēng míng",石头:"shí tou",州长:"zhōu zhǎng",为止:"wéi zhǐ",漂亮:"piào liang",炮弹:"pào dàn",藏族:"zàng zú",角色:"jué sè",当作:"dàng zuò",尽快:"jǐn kuài",人为:"rén wéi",重复:"chóng fù",胡同:"hú tòng",差距:"chā jù",弟兄:"dì xiong",大将:"dà jiàng",睡觉:"shuì jiào",一觉:"yí jiào",团长:"tuán zhǎng",队长:"duì zhǎng",区长:"qū zhǎng",难得:"nán dé",丫头:"yā tou",会长:"huì zhǎng",弟弟:"dì di",王爷:"wáng ye",重量:"zhòng liàng",誉为:"yù wéi",家伙:"jiā huo",华山:"huà shān",椅子:"yǐ zi",流量:"liú liàng",长大:"zhǎng dà",勉强:"miǎn qiǎng",会计:"kuài jì",过分:"guò fèn",济南:"jǐ nán",调动:"diào dòng",燕京:"yān jīng",少将:"shào jiàng",中毒:"zhòng dú",晓得:"xiǎo de",变更:"biàn gēng",打更:"dǎ gēng",认得:"rèn de",苹果:"píng guǒ",念头:"niàn tou",挣扎:"zhēng zhá",三藏:"sān zàng",剥削:"bō xuē",丞相:"chéng xiàng",少量:"shǎo liàng",寻思:"xún si",夺得:"duó dé",干线:"gàn xiàn",呼吁:"hū yù",处罚:"chǔ fá",长官:"zhǎng guān",柏林:"bó lín",亲戚:"qīn qi",身分:"shēn fèn",胳膊:"gē bo",着手:"zhuó shǒu",炸弹:"zhà dàn",咳嗽:"ké sou",叶子:"yè zi",外长:"wài zhǎng",供给:"gōng jǐ",师长:"shī zhǎng",变量:"biàn liàng",应有:"yīng yǒu",下载:"xià zài",乐器:"yuè qì",间接:"jiàn jiē",底下:"dǐ xià",打扮:"dǎ bàn",子弹:"zǐ dàn",弹药:"dàn yào",热量:"rè liàng",削弱:"xuē ruò",骨干:"gǔ gàn",容量:"róng liàng",模糊:"mó hu",转动:"zhuàn dòng",称呼:"chēng hu",科长:"kē zhǎng",处置:"chǔ zhì",着重:"zhuó zhòng",着急:"zháo jí",强迫:"qiǎng pò",庭长:"tíng zhǎng",首相:"shǒu xiàng",喇嘛:"lǎ ma",镇长:"zhèn zhǎng",只管:"zhǐ guǎn",重重:"chóng chóng",免得:"miǎn de",着实:"zhuó shí",度假:"dù jià",真相:"zhēn xiàng",相貌:"xiàng mào",处分:"chǔ fèn",委屈:"wěi qu",为期:"wéi qī",伯伯:"bó bo",伯子:"bǎi zi",圈子:"quān zi",见识:"jiàn shi",笼罩:"lǒng zhào",与会:"yù huì",都督:"dū du",都市:"dū shì",成都:"chéng dū",首都:"shǒu dū",帝都:"dì dū",王都:"wáng dū",东都:"dōng dū",都护:"dū hù",都城:"dū chéng",建都:"jiàn dū",迁都:"qiān dū",故都:"gù dū",定都:"dìng dū",中都:"zhōng dū",六安:"lù ān",宰相:"zǎi xiàng",较量:"jiào liàng",对称:"duì chèn",总长:"zǒng zhǎng",相公:"xiàng gong",空白:"kòng bái",打量:"dǎ liang",水分:"shuǐ fèn",舌头:"shé tou",没收:"mò shōu",行李:"xíng li",判处:"pàn chǔ",散文:"sǎn wén",处境:"chǔ jìng",孙子:"sūn zi",拳头:"quán tou",打发:"dǎ fā",组长:"zǔ zhǎng",骨头:"gǔ tou",宁可:"nìng kě",更换:"gēng huàn",薄弱:"bó ruò",还原:"huán yuán",重修:"chóng xiū",重来:"chóng lái",只顾:"zhǐ gù",爱好:"ài hào",馒头:"mán tou",军长:"jūn zhǎng",首长:"shǒu zhǎng",厂长:"chǎng zhǎng",司长:"sī zhǎng",长子:"zhǎng zǐ",强劲:"qiáng jìng",恰当:"qià dàng",头儿:"tóu er",站长:"zhàn zhǎng",折腾:"zhē teng",相处:"xiāng chǔ",统率:"tǒng shuài",中将:"zhōng jiàng",命中:"mìng zhòng",名将:"míng jiàng",木头:"mù tou",动弹:"dòng tan",地壳:"dì qiào",干活:"gàn huó",少爷:"shào ye",水量:"shuǐ liàng",补给:"bǔ jǐ",尾巴:"wěi ba",来得:"lái de",好奇:"hào qí",钥匙:"yào shi",当做:"dàng zuò",沉着:"chén zhuó",哑巴:"yǎ ba",车子:"chē zi",上将:"shàng jiàng",恶心:"ě xīn",担子:"dàn zi",应届:"yīng jiè",主角:"zhǔ jué",运转:"yùn zhuǎn",兄长:"xiōng zhǎng",格式:"gé shì",正月:"zhēng yuè",营长:"yíng zhǎng",当成:"dàng chéng",女婿:"nǚ xu",咽喉:"yān hóu",重阳:"chóng yáng",化为:"huà wéi",吐蕃:"tǔ bō",钻进:"zuān jìn",乐队:"yuè duì",亮相:"liàng xiàng",被子:"bèi zi",舍得:"shě de",杉木:"shā mù",击中:"jī zhòng",排长:"pái zhǎng",假期:"jià qī",分量:"fèn liàng",数次:"shù cì",提防:"dī fáng",吆喝:"yāo he",查处:"chá chǔ",量子:"liàng zǐ",里头:"lǐ tou",调研:"diào yán",伺候:"cì hou",重申:"chóng shēn",枕头:"zhěn tou",拚命:"pīn mìng",社长:"shè zhǎng",归还:"guī huán",批量:"pī liàng",畜牧:"xù mù",点着:"diǎn zháo",甚为:"shèn wéi",小将:"xiǎo jiàng",着眼:"zhuó yǎn",处死:"chǔ sǐ",厌恶:"yàn wù",鼓乐:"gǔ yuè",树干:"shù gàn",秘鲁:"bì lǔ",大方:"dà fāng",外头:"wài tou",班长:"bān zhǎng",星宿:"xīng xiù",宁愿:"nìng yuàn",钦差:"qīn chāi",为数:"wéi shù",勾当:"gòu dàng",削减:"xuē jiǎn",间谍:"jiàn dié",埋怨:"mán yuàn",结实:"jiē shi",计量:"jì liáng",淹没:"yān mò",村长:"cūn zhǎng",连长:"lián zhǎng",自给:"zì jǐ",武将:"wǔ jiàng",温差:"wēn chā",直奔:"zhí bèn",供求:"gōng qiú",剂量:"jì liàng",道长:"dào zhǎng",泄露:"xiè lòu",王八:"wáng ba",切割:"qiē gē",间隔:"jiàn gé",一晃:"yì huǎng",长假:"cháng jià",令狐:"líng hú",为害:"wéi hài",句子:"jù zi",偿还:"cháng huán",疙瘩:"gē da",燕山:"yān shān",堵塞:"dǔ sè",夺冠:"duó guàn",扎实:"zhā shi",电荷:"diàn hè",看守:"kān shǒu",复辟:"fù bì",郁闷:"yù mèn",尽早:"jǐn zǎo",切断:"qiē duàn",指头:"zhǐ tou",为生:"wéi shēng",畜生:"chù sheng",切除:"qiē chú",着力:"zhuó lì",着想:"zhuó xiǎng",级差:"jí chā",投奔:"tóu bèn",棍子:"gùn zi",含糊:"hán hu",少妇:"shào fù",兴致:"xìng zhì",纳闷:"nà mèn",干流:"gàn liú",卷起:"juǎn qǐ",扇子:"shàn zi",更改:"gēng gǎi",笼络:"lǒng luò",喇叭:"lǎ ba",载荷:"zài hè",妥当:"tuǒ dàng",为难:"wéi nán",着陆:"zhuó lù",燕子:"yàn zi",干吗:"gàn má",白发:"bái fà",总得:"zǒng děi",夹击:"jiā jī",曝光:"bào guāng",曲调:"qǔ diào",相机:"xiàng jī",叫化:"jiào huà",角逐:"jué zhú",啊哟:"ā yō",载重:"zài zhòng",长辈:"zhǎng bèi",出差:"chū chāi",垛口:"duǒ kǒu",撇开:"piē kāi",厅长:"tīng zhǎng",组分:"zǔ fèn",误差:"wù chā",家当:"jiā dàng",传记:"zhuàn jì",个子:"gè zi",铺设:"pū shè",干事:"gàn shì",杆菌:"gǎn jūn",定量:"dìng liàng",运载:"yùn zài",会儿:"huì er",酋长:"qiú zhǎng",重返:"chóng fǎn",差额:"chā é",露面:"lòu miàn",钻研:"zuān yán",大城:"dài chéng",上当:"shàng dàng",销量:"xiāo liàng",作坊:"zuō fang",照相:"zhào xiàng",哎呀:"āi yā",调集:"diào jí",看中:"kàn zhòng",议长:"yì zhǎng",风筝:"fēng zheng",辟邪:"bì xié",空隙:"kòng xì",更迭:"gēng dié",偏差:"piān chā",声调:"shēng diào",适量:"shì liàng",屯子:"tún zi",无量:"wú liàng",空地:"kòng dì",调度:"diào dù",散射:"sǎn shè",创伤:"chuāng shāng",海参:"hǎi shēn",满载:"mǎn zài",重叠:"chóng dié",落差:"luò chā",单调:"dān diào",老将:"lǎo jiàng",人参:"rén shēn",间断:"jiàn duàn",重现:"chóng xiàn",夹杂:"jiā zá",调用:"diào yòng",萝卜:"luó bo",附着:"fù zhuó",应声:"yìng shēng",主将:"zhǔ jiàng",罪过:"zuì guo",咀嚼:"jǔ jué",为政:"wéi zhèng",过量:"guò liàng",乐曲:"yuè qǔ",负荷:"fù hè",枪弹:"qiāng dàn",悄然:"qiǎo rán",处方:"chǔ fāng",悄声:"qiǎo shēng",曲子:"qǔ zi",情调:"qíng diào",挑衅:"tiǎo xìn",代为:"dài wéi",了结:"liǎo jié",打中:"dǎ zhòng",酒吧:"jiǔ bā",懒得:"lǎn de",增量:"zēng liàng",衣着:"yī zhuó",部将:"bù jiàng",要塞:"yào sài",茶几:"chá jī",杠杆:"gàng gǎn",出没:"chū mò",鲜有:"xiǎn yǒu",间隙:"jiàn xì",重担:"zhòng dàn",重演:"chóng yǎn",重试:"chóng shì",应酬:"yìng chou",只当:"zhǐ dāng",毋宁:"wú nìng",包扎:"bāo zā",前头:"qián tou",卷烟:"juǎn yān",非得:"fēi děi",弹道:"dàn dào",杆子:"gān zi",门将:"mén jiàng",后头:"hòu tou",喝彩:"hè cǎi",暖和:"nuǎn huo",累积:"lěi jī",调遣:"diào qiǎn",倔强:"jué jiàng",宝藏:"bǎo zàng",丧事:"sāng shì",约莫:"yuē mo",纤夫:"qiàn fū",更替:"gēng tì",装载:"zhuāng zài",背包:"bēi bāo",帖子:"tiě zi",松散:"sōng sǎn",呼喝:"hū hè",可恶:"kě wù",自转:"zì zhuàn",供电:"gōng diàn",反省:"fǎn xǐng",坦率:"tǎn shuài",苏打:"sū dá",本分:"běn fèn",落得:"luò de",鄙薄:"bǐ bó",相间:"xiāng jiàn",单薄:"dān bó",混蛋:"hún dàn",贞观:"zhēn guān",附和:"fù hè",能耐:"néng nài",吓唬:"xià hu",未了:"wèi liǎo",引着:"yǐn zháo",抽调:"chōu diào",沙子:"shā zi",席卷:"xí juǎn",标的:"biāo dì",别扭:"biè niu",思量:"sī liang",喝采:"hè cǎi",论语:"lún yǔ",盖子:"gài zi",分外:"fèn wài",弄堂:"lòng táng",乐舞:"yuè wǔ",雨量:"yǔ liàng",毛发:"máo fà",差遣:"chāi qiǎn",背负:"bēi fù",转速:"zhuàn sù",声乐:"shēng yuè",夹攻:"jiā gōng",供水:"gōng shuǐ",主干:"zhǔ gàn",惩处:"chéng chǔ",长相:"zhǎng xiàng",公差:"gōng chāi",榴弹:"liú dàn",省得:"shěng de",条子:"tiáo zi",重围:"chóng wéi",阻塞:"zǔ sè",劲风:"jìng fēng",纠葛:"jiū gé",颠簸:"diān bǒ",点中:"diǎn zhòng",重创:"zhòng chuāng",姥姥:"lǎo lao",迷糊:"mí hu",公家:"gōng jia",几率:"jī lǜ",苦闷:"kǔ mèn",度量:"dù liàng",差错:"chā cuò",暑假:"shǔ jià",参差:"cēn cī",搭载:"dā zài",助长:"zhù zhǎng",相称:"xiāng chèn",红晕:"hóng yùn",舍命:"shě mìng",喜好:"xǐ hào",列传:"liè zhuàn",劲敌:"jìng dí",蛤蟆:"há ma",请假:"qǐng jià",钉子:"dīng zi",沉没:"chén mò",高丽:"gāo lí",休假:"xiū jià",无为:"wú wéi",巴结:"bā jie",了得:"liǎo dé",变相:"biàn xiàng",核弹:"hé dàn",亲家:"qìng jia",承载:"chéng zài",喝问:"hè wèn",还击:"huán jī",交还:"jiāo huán",将令:"jiàng lìng",单于:"chán yú",空缺:"kòng quē",绿林:"lù lín",胆量:"dǎn liàng",执着:"zhí zhuó",低调:"dī diào",闭塞:"bì sè",轻薄:"qīng bó",得当:"dé dàng",占卜:"zhān bǔ",扫帚:"sào zhou",龟兹:"qiū cí",年长:"nián zhǎng",外传:"wài zhuàn",头子:"tóu zi",裁缝:"cái feng",礼乐:"lǐ yuè",血泊:"xuè pō",散乱:"sǎn luàn",动量:"dòng liàng",倒腾:"dǎo teng",取舍:"qǔ shě",咱家:"zán jiā",长发:"cháng fà",爪哇:"zhǎo wā",弹壳:"dàn ké",省悟:"xǐng wù",嚷嚷:"rāng rang",连累:"lián lèi",应得:"yīng dé",族长:"zú zhǎng",柜子:"guì zi",擂鼓:"léi gǔ",眩晕:"xuàn yùn",调配:"tiáo pèi",躯干:"qū gàn",差役:"chāi yì",坎坷:"kǎn kě",少儿:"shào ér",乐团:"yuè tuán",养分:"yǎng fèn",退还:"tuì huán",格调:"gé diào",语调:"yǔ diào",音调:"yīn diào",乐府:"yuè fǔ",古朴:"gǔ pǔ",打点:"dǎ diǎn",差使:"chāi shǐ",匀称:"yún chèn",瘦削:"shòu xuē",膏药:"gāo yao",吞没:"tūn mò",调任:"diào rèn",散居:"sǎn jū",上头:"shàng tóu",风靡:"fēng mǐ",放假:"fàng jià",估量:"gū liang",失当:"shī dàng",中弹:"zhòng dàn",妄为:"wàng wéi",长者:"zhǎng zhě",起哄:"qǐ hòng",末了:"mò liǎo",相声:"xiàng sheng",校正:"jiào zhèng",劝降:"quàn xiáng",矢量:"shǐ liàng",沉闷:"chén mèn",给与:"jǐ yǔ",解法:"jiě fǎ",塞外:"sài wài",将校:"jiàng xiào",嗜好:"shì hào",没落:"mò luò",朴刀:"pō dāo",片子:"piān zi",切削:"qiē xiāo",弹丸:"dàn wán",稀薄:"xī bó",亏得:"kuī dé",间歇:"jiàn xiē",翘首:"qiáo shǒu",色调:"sè diào",处决:"chǔ jué",表率:"biǎo shuài",尺子:"chǐ zi",招降:"zhāo xiáng",称职:"chèn zhí",斗篷:"dǒu peng",铺子:"pù zi",底子:"dǐ zi",负载:"fù zài",干警:"gàn jǐng",倒数:"dào shǔ",将官:"jiàng guān",锄头:"chú tou",归降:"guī xiáng",疟疾:"nüè ji",唠叨:"láo dao",限量:"xiàn liàng",屏息:"bǐng xī",重逢:"chóng féng",器乐:"qì yuè",氢弹:"qīng dàn",脖颈:"bó gěng",妃子:"fēi zi",处事:"chǔ shì",参量:"cān liàng",轻率:"qīng shuài",缥缈:"piāo miǎo",中奖:"zhòng jiǎng",才干:"cái gàn",施舍:"shī shě",卷子:"juàn zi",游说:"yóu shuì",巷子:"xiàng zi",膀胱:"páng guāng",切勿:"qiè wù",看管:"kān guǎn",风头:"fēng tou",精干:"jīng gàn",高差:"gāo chā",恐吓:"kǒng hè",扁担:"biǎn dàn",给养:"jǐ yǎng",格子:"gé zi",供需:"gōng xū",反差:"fǎn chā",飞弹:"fēi dàn",微薄:"wēi bó",发型:"fà xíng",即兴:"jí xìng",攒动:"cuán dòng",间或:"jiàn huò",浅薄:"qiǎn bó",乐章:"yuè zhāng",顺差:"shùn chā",调子:"diào zi",相位:"xiàng wèi",转子:"zhuàn zǐ",劲旅:"jìng lǚ",咔嚓:"kā chā",了事:"liǎo shì",转悠:"zhuàn you",当铺:"dàng pù",爪子:"zhuǎ zi",单子:"dān zi",好战:"hào zhàn",燕麦:"yàn mài",只许:"zhǐ xǔ",干练:"gàn liàn",女将:"nǚ jiàng",酒量:"jiǔ liàng",划船:"huá chuán",伎俩:"jì liǎng",挑拨:"tiǎo bō",少校:"shào xiào",着落:"zhuó luò",憎恶:"zēng wù",刻薄:"kè bó",要挟:"yāo xié",用处:"yòng chu",还手:"huán shǒu",模具:"mú jù",执著:"zhí zhuó",喝令:"hè lìng",保长:"bǎo zhǎng",吸着:"xī zhe",症结:"zhēng jié",公转:"gōng zhuàn",校勘:"jiào kān",重提:"chóng tí",扫兴:"sǎo xìng",铺盖:"pū gài",长史:"zhǎng shǐ",差价:"chā jià",压根:"yà gēn",怔住:"zhèng zhù",应允:"yīng yǔn",切入:"qiē rù",战将:"zhàn jiàng",年少:"nián shào",舍身:"shě shēn",执拗:"zhí niù",处世:"chǔ shì",中风:"zhòng fēng",等量:"děng liàng",放量:"fàng liàng",腔调:"qiāng diào",老少:"lǎo shào",没入:"mò rù",瓜葛:"guā gé",将帅:"jiàng shuài",车载:"chē zài",窝囊:"wō nang",长进:"zhǎng jìn",可汗:"kè hán",并州:"bīng zhōu",供销:"gōng xiāo",切片:"qiē piàn",差事:"chāi shì",知会:"zhī hui",鹰爪:"yīng zhǎo",处女:"chǔ nǚ",切磋:"qiē cuō",日头:"rì tou",押解:"yā jiè",滋长:"zī zhǎng",道观:"dào guàn",脚色:"jué sè",当量:"dāng liàng",婆家:"pó jia",缘分:"yuán fèn",空闲:"kòng xián",好色:"hào sè",怒喝:"nù hè",笼统:"lǒng tǒng",边塞:"biān sài",何曾:"hé céng",重合:"chóng hé",零散:"líng sǎn",轰隆:"hōng lōng",化子:"huà zi",内蒙:"nèi měng",数落:"shǔ luò",逆差:"nì chā",牟利:"móu lì",栅栏:"zhà lan",中标:"zhòng biāo",调档:"diào dàng",佝偻:"gōu lóu",场子:"chǎng zi",甲壳:"jiǎ qiào",重温:"chóng wēn",炮制:"páo zhì",返还:"fǎn huán",自传:"zì zhuàn",高调:"gāo diào",殷红:"yān hóng",固着:"gù zhuó",强求:"qiǎng qiú",本相:"běn xiàng",骄横:"jiāo hèng",草率:"cǎo shuài",气闷:"qì mèn",着色:"zhuó sè",宁肯:"nìng kěn",兴头:"xìng tou",拘泥:"jū nì",夹角:"jiā jiǎo",发髻:"fà jì",猛将:"měng jiàng",约摸:"yuē mo",拖累:"tuō lěi",呢绒:"ní róng",钻探:"zuān tàn",夹层:"jiā céng",落魄:"luò pò",巷道:"hàng dào",运量:"yùn liàng",解闷:"jiě mèn",空儿:"kòng er",估摸:"gū mo",好客:"hào kè",钻孔:"zuān kǒng",糊弄:"hù nòng",荥阳:"xíng yáng",烦闷:"fán mèn",仓卒:"cāng cù",分叉:"fēn chà",厂子:"chǎng zi",小调:"xiǎo diào",少阳:"shào yáng",受降:"shòu xiáng",染坊:"rǎn fáng",胳臂:"gē bei",将门:"jiàng mén",模板:"mú bǎn",配给:"pèi jǐ",为伍:"wéi wǔ",跟头:"gēn tou",划算:"huá suàn",累赘:"léi zhui",哄笑:"hōng xiào",晕眩:"yūn xuàn",干掉:"gàn diào",缝制:"féng zhì",难处:"nán chù",着意:"zhuó yì",蛮横:"mán hèng",奇数:"jī shù",短发:"duǎn fà",生还:"shēng huán",还清:"huán qīng",看护:"kān hù",直率:"zhí shuài",奏乐:"zòu yuè",载客:"zài kè",专横:"zhuān hèng",湮没:"yān mò",空格:"kòng gé",铺垫:"pū diàn",良将:"liáng jiàng",哗啦:"huā lā",散漫:"sǎn màn",脱发:"tuō fà",送还:"sòng huán",埋没:"mái mò",累及:"lěi jí",薄雾:"bó wù",调离:"diào lí",舌苔:"shé tāi",机长:"jī zhǎng",栓塞:"shuān sè",配角:"pèi jué",切口:"qiē kǒu",创口:"chuāng kǒu",哈欠:"hā qian",实弹:"shí dàn",铺平:"pū píng",哈达:"hǎ dá",懒散:"lǎn sǎn",实干:"shí gàn",填空:"tián kòng",刁钻:"diāo zuān",乐师:"yuè shī",量变:"liàng biàn",诱降:"yòu xiáng",搪塞:"táng sè",征调:"zhēng diào",夹道:"jiā dào",干咳:"gān ké",止咳:"zhǐ ké",乐工:"yuè gōng",划过:"huá guò",着火:"zháo huǒ",更正:"gēng zhèng",给付:"jǐ fù",空子:"kòng zi",哪吒:"né zhā",正着:"zhèng zháo",刷子:"shuā zi",丧葬:"sāng zàng",夹带:"jiā dài",安分:"ān fèn",中意:"zhòng yì",长孙:"zhǎng sūn",校订:"jiào dìng",卷曲:"juǎn qū",载运:"zài yùn",投弹:"tóu dàn",柞蚕:"zuò cán",份量:"fèn liàng",调换:"diào huàn",了然:"liǎo rán",咧嘴:"liě zuǐ",典当:"diǎn dàng",寒假:"hán jià",长兄:"zhǎng xiōng",给水:"jǐ shuǐ",须发:"xū fà",枝干:"zhī gàn",属相:"shǔ xiàng",哄抢:"hōng qiǎng",刻划:"kè huà",塞子:"sāi zi",单干:"dān gàn",还乡:"huán xiāng",兆头:"zhào tou",寺观:"sì guàn",督率:"dū shuài",啊哈:"ā ha",割舍:"gē shě",抹布:"mā bù",好恶:"hào wù",下处:"xià chǔ",消长:"xiāo zhǎng",离间:"lí jiàn",准头:"zhǔn tou",校对:"jiào duì",什物:"shí wù",番禺:"pān yú",佛爷:"fó ye",吗啡:"mǎ fēi",盐分:"yán fèn",虎将:"hǔ jiàng",薄荷:"bò he",独处:"dú chǔ",空位:"kòng wèi",铺路:"pū lù",乌拉:"wū lā",调回:"diào huí",来头:"lái tou",闲散:"xián sǎn",胶卷:"jiāo juǎn",冒失:"mào shi",干劲:"gàn jìn",弦乐:"xián yuè",相国:"xiàng guó",丹参:"dān shēn",助兴:"zhù xìng",铺开:"pū kāi",次长:"cì zhǎng",发卡:"fà qiǎ",拮据:"jié jū",刹车:"shā chē",生发:"shēng fà",重播:"chóng bō",缝合:"féng hé",音量:"yīn liàng",少尉:"shào wèi",冲压:"chòng yā",苍劲:"cāng jìng",厚薄:"hòu báo",威吓:"wēi hè",外相:"wài xiàng",呼号:"hū háo",着迷:"zháo mí",挑担:"tiāo dàn",纹路:"wén lù",还俗:"huán sú",强横:"qiáng hèng",着数:"zhāo shù",降顺:"xiáng shùn",挑明:"tiǎo míng",眯缝:"mī feng",分内:"fèn nèi",更衣:"gēng yī",软和:"ruǎn huo",尽兴:"jìn xìng",号子:"hào zi",爪牙:"zhǎo yá",败将:"bài jiàng",猜中:"cāi zhòng",结扎:"jié zā",没空:"méi kòng",夹缝:"jiā fèng",拾掇:"shí duo",掺和:"chān huo",簸箕:"bò ji",电量:"diàn liàng",荷载:"hè zǎi",调式:"diào shì",处身:"chǔ shēn",打手:"dǎ shǒu",弹弓:"dàn gōng",横蛮:"hèng mán",能干:"néng gàn",校点:"jiào diǎn",加载:"jiā zài",干校:"gàn xiào",哄传:"hōng chuán",校注:"jiào zhù",淤塞:"yū sè",马扎:"mǎ zhá",月氏:"yuè zhī",高干:"gāo gàn",经传:"jīng zhuàn",曾孙:"zēng sūn",好斗:"hào dòu",关卡:"guān qiǎ",逃奔:"táo bèn",磨蹭:"mó ceng",牟取:"móu qǔ",颤栗:"zhàn lì",蚂蚱:"mà zha",撮合:"cuō he",趔趄:"liè qie",摔打:"shuāi dǎ",台子:"tái zi",分得:"fēn de",粘着:"nián zhuó",采邑:"cài yì",散装:"sǎn zhuāng",婀娜:"ē nuó",兴味:"xìng wèi",行头:"xíng tou",气量:"qì liàng",调运:"diào yùn",处治:"chǔ zhì",乐音:"yuè yīn",充塞:"chōng sè",恫吓:"dòng hè",论调:"lùn diào",相中:"xiāng zhòng",民乐:"mín yuè",炮仗:"pào zhang",丧服:"sāng fú",骁将:"xiāo jiàng",量刑:"liàng xíng",缝补:"féng bǔ",财会:"cái kuài",大干:"dà gàn",历数:"lì shǔ",校场:"jiào chǎng",塞北:"sài běi",识相:"shí xiàng",辱没:"rǔ mò",鲜亮:"xiān liàng",语塞:"yǔ sè",露脸:"lòu liǎn",凉快:"liáng kuai",腰杆:"yāo gǎn",溜达:"liū da",嘎嘎:"gā gā",公干:"gōng gàn",桔梗:"jié gěng",挑逗:"tiǎo dòu",看门:"kān mén",乐歌:"yuè gē",拓片:"tà piàn",挑动:"tiǎo dòng",准将:"zhǔn jiàng",遒劲:"qiú jìng",磨坊:"mò fáng",逶迤:"wēi yí",搅和:"jiǎo huo",摩挲:"mó suō",作弄:"zuò nòng",苗头:"miáo tou",打颤:"dǎ zhàn",大藏:"dà zàng",畜牲:"chù shēng",勾搭:"gōu da",树荫:"shù yīn",树杈:"shù chà",铁杆:"tiě gǎn",将相:"jiàng xiàng",份子:"fèn zi",视差:"shì chā",绿荫:"lǜ yīn",枪杆:"qiāng gǎn",缝纫:"féng rèn",愁闷:"chóu mèn",点将:"diǎn jiàng",华佗:"huà tuó",劲射:"jìng shè",箱笼:"xiāng lǒng",终了:"zhōng liǎo",鬓发:"bìn fà",结巴:"jiē ba",苦干:"kǔ gàn",看家:"kān jiā",正旦:"zhēng dàn",中肯:"zhòng kěn",厦门:"xià mén",东莞:"dōng guǎn",食量:"shí liàng",宫调:"gōng diào",间作:"jiàn zuò",弹片:"dàn piàn",差池:"chā chí",漂白:"piǎo bái",杠子:"gàng zi",调处:"tiáo chǔ",好动:"hào dòng",转炉:"zhuàn lú",屏气:"bǐng qì",夹板:"jiā bǎn",哀乐:"āi yuè",干道:"gàn dào",苦处:"kǔ chù",劈柴:"pǐ chái",长势:"zhǎng shì",天华:"tiān huá",共处:"gòng chǔ",校验:"jiào yàn",出塞:"chū sài",磨盘:"mò pán",萎靡:"wěi mǐ",奔丧:"bēn sāng",唱和:"chàng hè",大调:"dà diào",非分:"fēi fèn",钻营:"zuān yíng",夹子:"jiā zi",超载:"chāo zài",更始:"gēng shǐ",铃铛:"líng dang",披散:"pī sàn",发还:"fā huán",转轮:"zhuàn lún",横财:"hèng cái",泡桐:"pāo tóng",抛撒:"pāo sǎ",天呀:"tiān yā",糊糊:"hū hu",躯壳:"qū qiào",通量:"tōng liàng",奉还:"fèng huán",午觉:"wǔ jiào",闷棍:"mèn gùn",浪头:"làng tou",砚台:"yàn tái",油坊:"yóu fáng",学长:"xué zhǎng",过载:"guò zài",笔调:"bǐ diào",衣被:"yī bèi",畜产:"xù chǎn",调阅:"diào yuè",蛮干:"mán gàn",曾祖:"zēng zǔ",提干:"tí gàn",变调:"biàn diào",覆没:"fù mò",模子:"mú zi",乐律:"yuè lǜ",称心:"chèn xīn",木杆:"mù gān",重印:"chóng yìn",自省:"zì xǐng",提调:"tí diào",看相:"kàn xiàng",芋头:"yù tou",下切:"xià qiē",塞上:"sài shàng",铺张:"pū zhāng",藤蔓:"téng wàn",薄幸:"bó xìng",解数:"xiè shù",褪去:"tuì qù",霰弹:"xiàn dàn",柚木:"yóu mù",痕量:"hén liàng",雅乐:"yǎ yuè",号哭:"háo kū",诈降:"zhà xiáng",猪圈:"zhū juàn",咋舌:"zé shé",铣床:"xǐ chuáng",防弹:"fáng dàn",健将:"jiàn jiàng",丽水:"lí shuǐ",削发:"xuē fà",空当:"kòng dāng",多相:"duō xiàng",鲜见:"xiǎn jiàn",划桨:"huá jiǎng",载波:"zài bō",跳蚤:"tiào zao",俏皮:"qiào pí",吧嗒:"bā dā",结发:"jié fà",了断:"liǎo duàn",同调:"tóng diào",石磨:"shí mò",时差:"shí chā",鼻塞:"bí sè",挑子:"tiāo zi",推磨:"tuī mò",武侯:"wǔ hóu",抹煞:"mǒ shā",调转:"diào zhuǎn",籍没:"jí mò",还债:"huán zhài",调演:"diào yǎn",分划:"fēn huá",奇偶:"jī ǒu",断喝:"duàn hè",闷雷:"mèn léi",狼藉:"láng jí",饭量:"fàn liàng",还礼:"huán lǐ",转调:"zhuǎn diào",星相:"xīng xiàng",手相:"shǒu xiàng",配乐:"pèi yuè",盖头:"gài tou",连杆:"lián gǎn",簿记:"bù jì",刀把:"dāo bà",量词:"liàng cí",名角:"míng jué",步调:"bù diào",校本:"jiào běn",账簿:"zhàng bù",隽永:"juàn yǒng",稍为:"shāo wéi",易传:"yì zhuàn",乐谱:"yuè pǔ",牵累:"qiān lěi",答理:"dā li",喝斥:"hè chì",吟哦:"yín é",干渠:"gàn qú",海量:"hǎi liàng",精当:"jīng dàng",着床:"zhuó chuáng",月相:"yuè xiàng",庶几:"shù jī",宫观:"gōng guàn",论处:"lùn chǔ",征辟:"zhēng bì",厚朴:"hòu pò",介壳:"jiè qiào",吭哧:"kēng chī",咯血:"kǎ xiě",铺陈:"pū chén",重生:"chóng shēng",乐理:"yuè lǐ",哀号:"āi háo",藏历:"zàng lì",刚劲:"gāng jìng",削平:"xuē píng",浓荫:"nóng yīn",城垛:"chéng duǒ",当差:"dāng chāi",正传:"zhèng zhuàn",并处:"bìng chǔ",创面:"chuāng miàn",旦角:"dàn jué",薄礼:"bó lǐ",晃荡:"huàng dang",臊子:"sào zi",家什:"jiā shí",闷头:"mēn tóu",美发:"měi fà",度数:"dù shu",着凉:"zháo liáng",闯将:"chuǎng jiàng",几案:"jī àn",姘头:"pīn tou",差数:"chā shù",散碎:"sǎn suì",壅塞:"yōng sè",寒颤:"hán zhàn",牵强:"qiān qiǎng",无间:"wú jiàn",轮转:"lún zhuàn",号叫:"háo jiào",铺排:"pū pái",降伏:"xiáng fú",轧钢:"zhá gāng",东阿:"dōng ē",病假:"bìng jià",累加:"lěi jiā",梗塞:"gěng sè",弹夹:"dàn jiā",钻心:"zuān xīn",晃眼:"huǎng yǎn",魔爪:"mó zhǎo",标量:"biāo liàng",憋闷:"biē mèn",猜度:"cāi duó",处士:"chǔ shì",官差:"guān chāi",讨还:"tǎo huán",长门:"cháng mén",馏分:"liú fēn",里弄:"lǐ lòng",色相:"sè xiàng",雅兴:"yǎ xìng",角力:"jué lì",弹坑:"dàn kēng",枝杈:"zhī chà",夹具:"jiā jù",处刑:"chǔ xíng",悍将:"hàn jiàng",好学:"hào xué",好好:"hǎo hǎo",银发:"yín fà",扫把:"sào bǎ",法相:"fǎ xiàng",贵干:"guì gàn",供气:"gōng qì",空余:"kòng yú",捆扎:"kǔn zā",瘠薄:"jí bó",浆糊:"jiàng hu",嘎吱:"gā zhī",调令:"diào lìng",法帖:"fǎ tiè",淋病:"lìn bìng",调派:"diào pài",转盘:"zhuàn pán",供稿:"gōng gǎo",差官:"chāi guān",忧闷:"yōu mèn",教长:"jiào zhǎng",重唱:"chóng chàng",酒兴:"jiǔ xìng",乐坛:"yuè tán",花呢:"huā ní",叱喝:"chì hè",膀臂:"bǎng bì",得空:"dé kòng",转圈:"zhuàn quān",横暴:"hèng bào",哄抬:"hōng tái",引吭:"yǐn háng",载货:"zài huò",中计:"zhòng jì",官长:"guān zhǎng",相面:"xiàng miàn",看头:"kàn tou",盼头:"pàn tou",意兴:"yì xìng",军乐:"jūn yuè",累次:"lěi cì",骨嘟:"gǔ dū",燕赵:"yān zhào",报丧:"bào sāng",弥撒:"mí sa",挨斗:"ái dòu",扁舟:"piān zhōu",丑角:"chǒu jué",吊丧:"diào sāng",强将:"qiáng jiàng",重奏:"chóng zòu",发辫:"fà biàn",着魔:"zháo mó",着法:"zhāo fǎ",盛放:"shèng fàng",填塞:"tián sè",凶横:"xiōng hèng",稽首:"qǐ shǒu",碑帖:"bēi tiè",冲量:"chōng liàng",发菜:"fà cài",假发:"jiǎ fà",翻卷:"fān juǎn",小量:"xiǎo liàng",胶着:"jiāo zhuó",里子:"lǐ zi",调调:"diào diao",散兵:"sǎn bīng",高挑:"gāo tiǎo",播撒:"bō sǎ",夹心:"jiā xīn",扇动:"shān dòng",叨扰:"tāo rǎo",霓裳:"ní cháng",捻子:"niǎn zi",弥缝:"mí féng",撒布:"sǎ bù",场院:"cháng yuàn",省亲:"xǐng qīn",提拉:"tí lā",惯量:"guàn liàng",强逼:"qiáng bī",强征:"qiáng zhēng",晕车:"yùn chē",数道:"shù dào",带累:"dài lèi",拓本:"tà běn",嫌恶:"xián wù",宿将:"sù jiàng",龟裂:"jūn liè",缠夹:"chán jiā",发式:"fà shì",隔扇:"gé shàn",天分:"tiān fèn",癖好:"pǐ hào",四通:"sì tōng",白术:"bái zhú",划伤:"huá shāng",角斗:"jué dòu",听差:"tīng chāi",岁差:"suì chā",丧礼:"sāng lǐ",脉脉:"mò mò",削瘦:"xuē shòu",撒播:"sǎ bō",莎草:"suō cǎo",犍为:"qián wéi",调头:"diào tóu",龙卷:"lóng juǎn",外调:"wài diào",字帖:"zì tiè",卷发:"juǎn fà",揣度:"chuǎi duó",洋相:"yáng xiàng",散光:"sǎn guāng",骨碌:"gū lu",薄命:"bó mìng",笼头:"lóng tóu",咽炎:"yān yán",碌碡:"liù zhou",片儿:"piàn er",纤手:"qiàn shǒu",散体:"sǎn tǐ",内省:"nèi xǐng",强留:"qiáng liú",解送:"jiè sòng",反间:"fǎn jiàn",少壮:"shào zhuàng",留空:"liú kōng",告假:"gào jià",咳血:"ké xuè",薄暮:"bó mù",铺轨:"pū guǐ",磨削:"mó xuē",治丧:"zhì sāng",叉子:"chā zi",哄动:"hōng dòng",蛾子:"é zi",出落:"chū luò",股长:"gǔ zhǎng",贵处:"guì chù",还魂:"huán hún",例假:"lì jià",刹住:"shā zhù",身量:"shēn liàng",同好:"tóng hào",模量:"mó liàng",更生:"gēng shēng",服丧:"fú sāng",率直:"shuài zhí",字模:"zì mú",散架:"sǎn jià",答腔:"dā qiāng",交恶:"jiāo wù",薄情:"bó qíng",眼泡:"yǎn pāo",袅娜:"niǎo nuó",草垛:"cǎo duò",冲劲:"chòng jìn",呢喃:"ní nán",切中:"qiè zhòng",挑灯:"tiǎo dēng",还愿:"huán yuàn",激将:"jī jiàng",更鼓:"gēng gǔ",没药:"mò yào",败兴:"bài xìng",切面:"qiē miàn",散户:"sǎn hù",累进:"lěi jìn",背带:"bēi dài",秤杆:"chèng gǎn",碾坊:"niǎn fáng",簿子:"bù zi",扳手:"bān shǒu",铅山:"yán shān",儒将:"rú jiàng",重光:"chóng guāng",剪发:"jiǎn fà",长上:"zhǎng shàng",小传:"xiǎo zhuàn",压轴:"yā zhòu",弱冠:"ruò guàn",花卷:"huā juǎn",横祸:"hèng huò",夹克:"jiā kè",光晕:"guāng yùn",披靡:"pī mǐ",对调:"duì diào",夹持:"jiā chí",空额:"kòng é",平调:"píng diào",铺床:"pū chuáng",丧钟:"sāng zhōng",作乐:"zuò lè",少府:"shào fǔ",数数:"shuò shuò",奔头:"bèn tou",进给:"jìn jǐ",率性:"shuài xìng",乐子:"lè zi",绑扎:"bǎng zā",挑唆:"tiǎo suō",漂洗:"piǎo xǐ",夹墙:"jiā qiáng",咳喘:"ké chuǎn",乜斜:"miē xie",错处:"cuò chù",闷酒:"mèn jiǔ",时调:"shí diào",重孙:"chóng sūn",经幢:"jīng chuáng",圩场:"xū chǎng",调门:"diào mén",花头:"huā tóu",划拉:"huá la",套色:"tào shǎi",粗率:"cū shuài",相率:"xiāng shuài",款识:"kuǎn zhì",吁请:"yù qǐng",荫蔽:"yīn bì",文蛤:"wén gé",嘀嗒:"dī dā",调取:"diào qǔ",交差:"jiāo chāi",落子:"luò zǐ",相册:"xiàng cè",絮叨:"xù dao",落发:"luò fà",异相:"yì xiàng",浸没:"jìn mò",角抵:"jué dǐ",卸载:"xiè zài",春卷:"chūn juǎn",扎挣:"zhá zheng",畜养:"xù yǎng",吡咯:"bǐ luò",垛子:"duò zi",恶少:"è shào",发际:"fà jì",红苕:"hóng sháo",糨糊:"jiàng hu",哭丧:"kū sāng",稍息:"shào xī",晕船:"yùn chuán",校样:"jiào yàng",外差:"wài chā",脚爪:"jiǎo zhǎo",铺展:"pū zhǎn",芫荽:"yán sui",夹紧:"jiā jǐn",尿泡:"suī pào",丧乱:"sāng luàn",凶相:"xiōng xiàng",华发:"huá fà",打场:"dǎ cháng",云量:"yún liàng",正切:"zhèng qiē",划拳:"huá quán",划艇:"huá tǐng",评传:"píng zhuàn",拉纤:"lā qiàn",句读:"jù dòu",散剂:"sǎn jì",骨殖:"gǔ shi",塞音:"sè yīn",铺叙:"pū xù",阏氏:"yān zhī",冷颤:"lěng zhàn",煞住:"shā zhù",少男:"shào nán",管乐:"guǎn yuè",号啕:"háo táo",纳降:"nà xiáng",拥塞:"yōng sè",万乘:"wàn shèng",杆儿:"gǎn ér",葛藤:"gé téng",簿籍:"bù jí",皮夹:"pí jiā",校准:"jiào zhǔn",允当:"yǔn dàng",器量:"qì liàng",选调:"xuǎn diào",扮相:"bàn xiàng",干才:"gàn cái",基干:"jī gàn",割切:"gē qiē",国乐:"guó yuè",卡壳:"qiǎ ké",辟谷:"bì gǔ",磨房:"mò fáng",咿呀:"yī yā",芥末:"jiè mo",薄技:"bó jì",产假:"chǎn jià",诗兴:"shī xìng",重出:"chóng chū",转椅:"zhuàn yǐ",酌量:"zhuó liang",簿册:"bù cè",藏青:"zàng qīng",的士:"dī shì",调人:"diào rén",解元:"jiè yuán",茎干:"jīng gàn",巨量:"jù liàng",榔头:"láng tou",率真:"shuài zhēn",喷香:"pèn xiāng",锁钥:"suǒ yuè",虾蟆:"há má",相图:"xiàng tú",兴会:"xìng huì",灶头:"zào tóu",重婚:"chóng hūn",钻洞:"zuān dòng",忖度:"cǔn duó",党参:"dǎng shēn",调温:"diào wēn",杆塔:"gān tǎ",葛布:"gé bù",拱券:"gǒng xuàn",夹生:"jiā shēng",露馅:"lòu xiàn",恰切:"qià qiè",散见:"sǎn jiàn",哨卡:"shào qiǎ",烫发:"tàng fà",体量:"tǐ liàng",挺括:"tǐng kuò",系带:"jì dài",相士:"xiàng shì",羊圈:"yáng juàn",转矩:"zhuàn jǔ",吧台:"bā tái",苍术:"cāng zhú",菲薄:"fěi bó",蛤蚧:"gé jiè",蛤蜊:"gé lí",瓜蔓:"guā wàn",怪相:"guài xiàng",临帖:"lín tiè",女红:"nǚ gōng",刨床:"bào chuáng",翘楚:"qiáo chǔ",数九:"shǔ jiǔ",谈兴:"tán xìng",雄劲:"xióng jìng",扎染:"zā rǎn",遮荫:"zhē yīn",周正:"zhōu zhèng",赚头:"zhuàn tou",扒手:"pá shǒu",搀和:"chān huo",诚朴:"chéng pǔ",肚量:"dù liàng",干结:"gān jié",工尺:"gōng chě",家累:"jiā lěi",曲水:"qū shuǐ",沙参:"shā shēn",挑花:"tiǎo huā",阿门:"ā mén",背篓:"bēi lǒu",瘪三:"biē sān",裁处:"cái chǔ",创痛:"chuāng tòng",福相:"fú xiàng",更动:"gēng dòng",豪兴:"háo xìng",还阳:"huán yáng",还嘴:"huán zuǐ",借调:"jiè diào",卷云:"juǎn yún",流弹:"liú dàn",想头:"xiǎng tou",削价:"xuē jià",校阅:"jiào yuè",雅量:"yǎ liàng",别传:"bié zhuàn",薄酒:"bó jiǔ",春假:"chūn jià",发妻:"fà qī",哗哗:"huā huā",宽绰:"kuān chuo",了悟:"liǎo wù",切花:"qiē huā",审度:"shěn duó",应许:"yīng xǔ",转台:"zhuàn tái",仔猪:"zǐ zhū",裁量:"cái liáng",藏戏:"zàng xì",乘兴:"chéng xìng",绸缪:"chóu móu",摧折:"cuī zhé",调经:"tiáo jīng",调职:"diào zhí",缝缀:"féng zhuì",骨朵:"gū duǒ",核儿:"hú er",恒量:"héng liàng",还价:"huán jià",浑朴:"hún pǔ",苦差:"kǔ chāi",面糊:"miàn hù",煞车:"shā chē",省视:"xǐng shì",什锦:"shí jǐn",信差:"xìn chāi",余切:"yú qiē",攒眉:"cuán méi",炸糕:"zhá gāo",钻杆:"zuàn gǎn",扒灰:"pá huī",拌和:"bàn huò",长调:"cháng diào",大溜:"dà liù",抖搂:"dǒu lōu",飞转:"fēi zhuàn",干仗:"gàn zhàng",好胜:"hào shèng",画片:"huà piàn",搅混:"jiǎo hún",螺杆:"luó gǎn",木模:"mù mú",怒号:"nù háo",频数:"pín shù",无宁:"wú níng",遗少:"yí shào",邮差:"yóu chāi",占卦:"zhān guà",占星:"zhān xīng",重审:"chóng shěn",自量:"zì liàng",调防:"diào fáng",发廊:"fà láng",反调:"fǎn diào",缝子:"fèng zi",更夫:"gēng fū",骨子:"gǔ zi",光杆:"guāng gǎn",夹棍:"jiā gùn",居丧:"jū sāng",巨贾:"jù gǔ",看押:"kān yā",空转:"kōng zhuàn",量力:"liàng lì",炮烙:"páo luò",赔还:"péi huán",扑扇:"pū shān",散记:"sǎn jì",散件:"sǎn jiàn",删削:"shān xuē",射干:"shè gàn",条几:"tiáo jī",偷空:"tōu kòng",削壁:"xuē bì",校核:"jiào hé",阴干:"yīn gān",择菜:"zhái cài",重九:"chóng jiǔ",主调:"zhǔ diào",自禁:"zì jīn",吧唧:"bā jī",便溺:"biàn niào",词调:"cí diào",叨咕:"dáo gu",落枕:"lào zhěn",铺砌:"pū qì",刷白:"shuà bái",委靡:"wěi mǐ",系泊:"xì bó",相马:"xiàng mǎ",熨帖:"yù tiē",转筋:"zhuàn jīn",棒喝:"bàng hè",傧相:"bīn xiàng",镐头:"gǎo tóu",间苗:"jiàn miáo",乐池:"yuè chí",卖相:"mài xiàng",屏弃:"bǐng qì",铅弹:"qiān dàn",切变:"qiē biàn",请调:"qǐng diào",群氓:"qún méng",散板:"sǎn bǎn",省察:"xǐng chá",事假:"shì jià",纤绳:"qiàn shéng",重影:"chóng yǐng",耕种:"gēng zhòng",种地:"zhòng dì",种菜:"zhòng cài",栽种:"zāi zhòng",接种:"jiē zhòng",垦种:"kěn zhòng",种殖:"zhòng zhí",种瓜:"zhòng guā",种豆:"zhòng dòu",种树:"zhòng shù",睡着:"shuì zháo",笼子:"lóng zi",重启:"chóng qǐ",重整:"chóng zhěng",重弹:"chóng tán",重足:"chóng zú",重山:"chóng shān",重游:"chóng yóu",重峦:"chóng luán",爷爷:"yé ye",奶奶:"nǎi nai",姥爷:"lǎo ye",爸爸:"bà ba",妈妈:"mā ma",婶婶:"shěn shen",舅舅:"jiù jiu",姑姑:"gū gu",叔叔:"shū shu",姨夫:"yí fu",舅母:"jiù mu",姑父:"gū fu",姐夫:"jiě fu",婆婆:"pó po",公公:"gōng gong",舅子:"jiù zi",姐姐:"jiě jie",哥哥:"gē ge",妹妹:"mèi mei",妹夫:"mèi fu",姨子:"yí zi",宝宝:"bǎo bao",娃娃:"wá wa",孩子:"hái zi",日子:"rì zi",样子:"yàng zi",狮子:"shī zi",身子:"shēn zi",架子:"jià zi",嫂子:"sǎo zi",鼻子:"bí zi",亭子:"tíng zi",折子:"zhé zi",面子:"miàn zi",脖子:"bó zi",辈子:"bèi zi",帽子:"mào zi",拍子:"pāi zi",柱子:"zhù zi",辫子:"biàn zi",鸽子:"gē zi",房子:"fáng zi",丸子:"wán zi",摊子:"tān zi",牌子:"pái zi",胡子:"hú zi",鬼子:"guǐ zi",矮子:"ǎi zi",鸭子:"yā zi",小子:"xiǎo zi",影子:"yǐng zi",屋子:"wū zi",对子:"duì zi",点子:"diǎn zi",本子:"běn zi",种子:"zhǒng zi",儿子:"ér zi",兔子:"tù zi",骗子:"piàn zi",院子:"yuàn zi",猴子:"hóu zi",嗓子:"sǎng zi",侄子:"zhí zi",柿子:"shì zi",钳子:"qián zi",虱子:"shī zi",瓶子:"píng zi",豹子:"bào zi",筷子:"kuài zi",篮子:"lán zi",绳子:"shéng zi",嘴巴:"zuǐ ba",耳朵:"ěr duo",茄子:"qié zi",蚌埠:"bèng bù",崆峒:"kōng tóng",琵琶:"pí pa",蘑菇:"mó gu",葫芦:"hú lu",狐狸:"hú li",桔子:"jú zi",盒子:"hé zi",桌子:"zhuō zi",竹子:"zhú zi",师傅:"shī fu",衣服:"yī fu",袜子:"wà zi",杯子:"bēi zi",刺猬:"cì wei",麦子:"mài zi",队伍:"duì wu",知了:"zhī liǎo",鱼儿:"yú er",馄饨:"hún tun",灯笼:"dēng long",庄稼:"zhuāng jia",聪明:"cōng ming",镜子:"jìng zi",银子:"yín zi",盘子:"pán zi",了却:"liǎo què",力气:"lì qi",席子:"xí zi",林子:"lín zi",朝霞:"zhāo xiá",朝夕:"zhāo xī",朝气:"zhāo qì",翅膀:"chì bǎng",省长:"shěng zhǎng",臧否:"zāng pǐ",否泰:"pǐ tài",变得:"biàn de",丈夫:"zhàng fu",豆腐:"dòu fu",笔杆:"bǐ gǎn",枞阳:"zōng yáng",行人:"xíng rén",打着:"dǎ zhe",第一:"dì yī",万一:"wàn yī",之一:"zhī yī",得之:"dé zhī",统一:"tǒng yī",唯一:"wéi yī",专一:"zhuān yī",单一:"dān yī",如一:"rú yī",其一:"qí yī",合一:"hé yī",逐一:"zhú yī",周一:"zhōu yī",初一:"chū yī",研一:"yán yī",归一:"guī yī",假一:"jiǎ yī",闻一:"wén yī",了了:"liǎo liǎo",公了:"gōng liǎo",私了:"sī liǎo",一月:"yī yuè",一号:"yī hào",一级:"yī jí",一等:"yī děng",一哥:"yī gē",月一:"yuè yī",一一:"yī yī",二一:"èr yī",三一:"sān yī",四一:"sì yī",五一:"wǔ yī",六一:"liù yī",七一:"qī yī",八一:"bā yī",九一:"jiǔ yī","一〇":"yī líng",一零:"yī líng",一二:"yī èr",一三:"yī sān",一四:"yī sì",一五:"yī wǔ",一六:"yī liù",一七:"yī qī",一八:"yī bā",一九:"yī jiǔ",一又:"yī yòu",一饼:"yī bǐng",一楼:"yī lóu",为例:"wéi lì",为准:"wéi zhǔn",沧海:"cāng hǎi",难为:"nán wéi",责难:"zé nàn",患难:"huàn nàn",磨难:"mó nàn",大难:"dà nàn",刁难:"diāo nàn",殉难:"xùn nàn",落难:"luò nàn",罹难:"lí nàn",灾难:"zāi nàn",难民:"nàn mín",苦难:"kǔ nàn",危难:"wēi nàn",发难:"fā nàn",逃难:"táo nàn",避难:"bì nàn",遇难:"yù nàn",阻难:"zǔ nàn",厄难:"è nàn",徇难:"xùn nàn",空难:"kōng nàn",喜欢:"xǐ huan",朝朝:"zhāo zhāo",不行:"bù xíng",轧轧:"yà yà",弯曲:"wān qū",扭曲:"niǔ qū",曲直:"qū zhí",委曲:"wěi qū",酒曲:"jiǔ qū",曲径:"qū jìng",曲解:"qū jiě",歪曲:"wāi qū",曲线:"qū xiàn",曲阜:"qū fù",九曲:"jiǔ qū",曲折:"qū zhé",曲肱:"qū gōng",曲意:"qū yì",仡佬:"gē lǎo"},Hde=Object.keys(BL).map(e=>({zh:e,pinyin:BL[e],probability:2e-8,length:2,priority:Cl.Normal,dict:Symbol("dict2")})),$L={为什么:"wèi shén me",实际上:"shí jì shang",检察长:"jiǎn chá zhǎng",干什么:"gàn shén me",这会儿:"zhè huì er",尽可能:"jǐn kě néng",董事长:"dǒng shì zhǎng",了不起:"liǎo bù qǐ",参谋长:"cān móu zhǎng",朝鲜族:"cháo xiǎn zú",海内外:"hǎi nèi wài",禁不住:"jīn bú zhù",柏拉图:"bó lā tú",不在乎:"bú zài hu",洛杉矶:"luò shān jī",有点儿:"yǒu diǎn er",迫击炮:"pǎi jī pào",不得了:"bù dé liǎo",马尾松:"mǎ wěi sōng",运输量:"yùn shū liàng",发脾气:"fā pí qi",士大夫:"shì dà fū",鸭绿江:"yā lù jiāng",压根儿:"yà gēn er",对得起:"duì de qǐ",那会儿:"nà huì er",自个儿:"zì gě er",物理量:"wù lǐ liàng",怎么着:"zěn me zhāo",明晃晃:"míng huǎng huǎng",节假日:"jié jià rì",心里话:"xīn lǐ huà",发行量:"fā xíng liàng",兴冲冲:"xìng chōng chōng",分子量:"fēn zǐ liàng",国子监:"guó zǐ jiàn",老大难:"lǎo dà nán",党内外:"dǎng nèi wài",这么着:"zhè me zhāo",少奶奶:"shào nǎi nai",暗地里:"àn dì lǐ",更年期:"gēng nián qī",工作量:"gōng zuò liàng",背地里:"bèi dì lǐ",山里红:"shān li hóng",好好儿:"hǎo hāo er",交响乐:"jiāo xiǎng yuè",好意思:"hǎo yì si",吐谷浑:"tǔ yù hún",没意思:"méi yì si",理发师:"lǐ fà shī",塔什干:"tǎ shí gān",充其量:"chōng qí liàng",靠得住:"kào de zhù",车行道:"chē xíng dào",人行道:"rén xíng dào",中郎将:"zhōng láng jiàng",照明弹:"zhào míng dàn",烟幕弹:"yān mù dàn",没奈何:"mò nài hé",乱哄哄:"luàn hōng hōng",惠更斯:"huì gēng sī",载重量:"zài zhòng liàng",瞧得起:"qiáo de qǐ",纪传体:"jì zhuàn tǐ",阿房宫:"ē páng gōng",卷心菜:"juǎn xīn cài",戏班子:"xì bān zi",过得去:"guò de qù",花岗石:"huā gāng shí",外甥女:"wài sheng nǚ",团团转:"tuán tuán zhuàn",大堡礁:"dà bǎo jiāo",燃烧弹:"rán shāo dàn",劳什子:"láo shí zi",摇滚乐:"yáo gǔn yuè",夹竹桃:"jiā zhú táo",闹哄哄:"nào hōng hōng",三连冠:"sān lián guàn",重头戏:"zhòng tóu xì",二人转:"èr rén zhuàn",节骨眼:"jiē gǔ yǎn",知识面:"zhī shi miàn",护士长:"hù shi zhǎng",信号弹:"xìn hào dàn",干电池:"gān diàn chí",枪杆子:"qiāng gǎn zi",哭丧棒:"kū sāng bàng",鼻咽癌:"bí yān ái",瓦岗军:"wǎ gāng jūn",买得起:"mǎi de qǐ",癞蛤蟆:"lài há ma",脊梁骨:"jǐ liang gǔ",子母弹:"zǐ mǔ dàn",开小差:"kāi xiǎo chāi",女强人:"nǚ qiáng rén",英雄传:"yīng xióng zhuàn",爵士乐:"jué shì yuè",说笑话:"shuō xiào hua",碰头会:"pèng tóu huì",玻璃钢:"bō li gāng",曳光弹:"yè guāng dàn",少林拳:"shào lín quán",咏叹调:"yǒng tàn diào",少先队:"shào xiān duì",灵长目:"líng zhǎng mù",对着干:"duì zhe gàn",蒙蒙亮:"méng méng liàng",软骨头:"ruǎn gǔ tou",铺盖卷:"pū gài juǎn",和稀泥:"huò xī ní",背黑锅:"bēi hēi guō",红彤彤:"hóng tōng tōng",武侯祠:"wǔ hóu cí",打哆嗦:"dǎ duō suo",户口簿:"hù kǒu bù",马尾藻:"mǎ wěi zǎo",夜猫子:"yè māo zi",打手势:"dǎ shǒu shì",龙王爷:"lóng wáng yé",气头上:"qì tóu shang",糊涂虫:"hú tu chóng",笔杆子:"bǐ gǎn zi",占便宜:"zhàn pián yi",打主意:"dǎ zhǔ yì",多弹头:"duō dàn tóu",露一手:"lòu yì shǒu",堰塞湖:"yàn sè hú",保得住:"bǎo de zhù",趵突泉:"bào tū quán",奥得河:"ào de hé",司务长:"sī wù zhǎng",禁不起:"jīn bù qǐ",什刹海:"shí chà hǎi",莲花落:"lián huā lào",见世面:"jiàn shì miàn",豁出去:"huō chū qù",电位差:"diàn wèi chā",挨个儿:"āi gè er",那阵儿:"nà zhèn er",肺活量:"fèi huó liàng",大师傅:"dà shī fu",掷弹筒:"zhì dàn tǒng",打呼噜:"dǎ hū lu",广渠门:"ān qú mén",未见得:"wèi jiàn dé",大婶儿:"dà shěn er",谈得来:"tán de lái",脚丫子:"jiǎo yā zi",空包弹:"kōng bāo dàn",窝里斗:"wō li dòu",弹着点:"dàn zhuó diǎn",个头儿:"gè tóu er",看得起:"kàn de qǐ",糊涂账:"hú tu zhàng",大猩猩:"dà xīng xing",禁得起:"jīn de qǐ",法相宗:"fǎ xiàng zōng",可怜相:"kě lián xiàng",吃得下:"chī de xià",汉堡包:"hàn bǎo bāo",闹嚷嚷:"nào rāng rāng",数来宝:"shǔ lái bǎo",合得来:"hé de lái",干性油:"gān xìng yóu",闷葫芦:"mèn hú lu",呱呱叫:"guā guā jiào",西洋参:"xī yáng shēn",林荫道:"lín yīn dào",拉家常:"lā jiā cháng",卷铺盖:"juǎn pū gài",过得硬:"guò de yìng",飞将军:"fēi jiāng jūn",挑大梁:"tiǎo dà liáng",哈巴狗:"hǎ ba gǒu",过家家:"guò jiā jiā",催泪弹:"cuī lèi dàn",雨夹雪:"yǔ jiā xuě",敲竹杠:"qiāo zhú gàng",列车长:"liè chē zhǎng",华达呢:"huá dá ní",犯得着:"fàn de zháo",土疙瘩:"tǔ gē da",煞风景:"shā fēng jǐng",轻量级:"qīng liàng jí",羞答答:"xiū dā dā",石子儿:"shí zǐ er",达姆弹:"dá mǔ dàn",科教片:"kē jiào piān",侃大山:"kǎn dà shān",丁点儿:"dīng diǎn er",吃得消:"chī de xiāo",捋虎须:"luō hǔ xū",高丽参:"gāo lí shēn",众生相:"zhòng shēng xiàng",咽峡炎:"yān xiá yán",禁得住:"jīn de zhù",吃得开:"chī de kāi",柞丝绸:"zuò sī chóu",应声虫:"yìng shēng chóng",数得着:"shǔ de zháo",傻劲儿:"shǎ jìn er",铅玻璃:"qiān bō li",可的松:"kě dì sōng",划得来:"huá de lái",晕乎乎:"yūn hū hū",屎壳郎:"shǐ ke làng",尥蹶子:"liào juě zi",藏红花:"zàng hóng huā",闷罐车:"mèn guàn chē",卡脖子:"qiǎ bó zi",红澄澄:"hóng deng deng",赶得及:"gǎn de jí",当间儿:"dāng jiàn er",露马脚:"lòu mǎ jiǎo",鸡内金:"jī nèi jīn",犯得上:"fàn de shàng",钉齿耙:"dīng chǐ bà",饱和点:"bǎo hé diǎn",龙爪槐:"lóng zhǎo huái",喝倒彩:"hè dào cǎi",定冠词:"dìng guàn cí",担担面:"dàn dan miàn",吃得住:"chī de zhù",爪尖儿:"zhuǎ jiān er",支着儿:"zhī zhāo er",折跟头:"zhē gēn tou",阴着儿:"yīn zhāo er",烟卷儿:"yān juǎn er",宣传弹:"xuān chuán dàn",信皮儿:"xìn pí er",弦切角:"xián qiē jiǎo",缩砂密:"sù shā mì",说得来:"shuō de lái",水漂儿:"shuǐ piāo er",耍笔杆:"shuǎ bǐ gǎn",数得上:"shǔ de shàng",数不着:"shǔ bù zháo",数不清:"shǔ bù qīng",什件儿:"shí jiàn er",生死簿:"shēng sǐ bù",扇风机:"shān fēng jī",撒呓挣:"sā yì zheng",日记簿:"rì jì bù",热得快:"rè de kuài",亲家公:"qìng jia gōng",奇函数:"jī hán shù",拍纸簿:"pāi zhǐ bù",努劲儿:"nǔ jìn er",泥娃娃:"ní wá wa",内切圆:"nèi qiē yuán",哪会儿:"nǎ huì er",闷头儿:"mēn tóu er",没谱儿:"méi pǔ er",铆劲儿:"mǎo jìn er",溜肩膀:"liū jiān bǎng",了望台:"liào wàng tái",老来少:"lǎo lái shào",坤角儿:"kūn jué er",考勤簿:"kǎo qín bù",卷笔刀:"juǎn bǐ dāo",进给量:"jìn jǐ liàng",划不来:"huá bù lái",汗褂儿:"hàn guà er",鼓囊囊:"gǔ nāng nāng",够劲儿:"gòu jìn er",公切线:"gōng qiē xiàn",搁得住:"gé de zhù",赶浪头:"gǎn làng tóu",赶得上:"gǎn de shàng",干酵母:"gān jiào mǔ",嘎渣儿:"gā zhā er",嘎嘣脆:"gā bēng cuì",对得住:"duì de zhù",逗闷子:"dòu mèn zi",顶呱呱:"dǐng guā guā",滴溜儿:"dī liù er",大轴子:"dà zhòu zi",打板子:"dǎ bǎn zi",寸劲儿:"cùn jìn er",醋劲儿:"cù jìn er",揣手儿:"chuāi shǒu er",冲劲儿:"chòng jìn er",吃得来:"chī de lái",不更事:"bù gēng shì",奔头儿:"bèn tou er",百夫长:"bǎi fū zhǎng",娃娃亲:"wá wa qīn",死劲儿:"sǐ jìn er",骨朵儿:"gū duǒ er",功劳簿:"gōng láo bù",都江堰:"dū jiāng yàn",一担水:"yí dàn shuǐ",否极泰:"pǐ jí tài",泰来否:"tài lái pǐ",咳特灵:"ké tè líng",开户行:"kāi hù háng",郦食其:"lì yì jī",花事了:"huā shì liǎo",一更更:"yì gēng gēng",一重山:"yì chóng shān",风一更:"fēng yì gēng",雪一更:"xuě yì gēng",归一码:"guī yì mǎ",星期一:"xīng qī yī",礼拜一:"lǐ bài yī",一季度:"yī jì dù",一月一:"yī yuè yī",一字马:"yī zì mǎ",一是一:"yī shì yī",一次方:"yī cì fāng",一阳指:"yī yáng zhǐ",一字决:"yī zì jué",一年级:"yī nián jí",一不做:"yī bú zuò",屈戌儿:"qū qu ér",难为水:"nán wéi shuǐ",难为情:"nán wéi qíng",行一行:"xíng yì háng",别别的:"biè bié de",干哪行:"gàn nǎ háng",干一行:"gàn yì háng",曲别针:"qū bié zhēn"},Wde=Object.keys($L).map(e=>({zh:e,pinyin:$L[e],probability:2e-8,length:3,priority:Cl.Normal,dict:Symbol("dict3")})),zL={成吉思汗:"chéng jí sī hán",四通八达:"sì tōng bā dá",一模一样:"yì mú yí yàng",青藏高原:"qīng zàng gāo yuán",阿弥陀佛:"ē mí tuó fó",解放思想:"jiè fàng sī xiǎng",所作所为:"suǒ zuò suǒ wéi",迷迷糊糊:"mí mí hu hū",荷枪实弹:"hè qiāng shí dàn",兴高采烈:"xìng gāo cǎi liè",无能为力:"wú néng wéi lì",布鲁塞尔:"bù lǔ sài ěr",为所欲为:"wéi suǒ yù wéi",克什米尔:"kè shí mǐ ěr",没完没了:"méi wán méi liǎo",不为人知:"bù wéi rén zhī",结结巴巴:"jiē jiē bā bā",前仆后继:"qián pū hòu jì",铺天盖地:"pū tiān gài dì",直截了当:"zhí jié liǎo dàng",供不应求:"gōng bú yìng qiú",御史大夫:"yù shǐ dà fū",不为瓦全:"bù wéi wǎ quán",不可收拾:"bù kě shōu shi",胡作非为:"hú zuò fēi wéi",分毫不差:"fēn háo bú chà",模模糊糊:"mó mó hu hū",不足为奇:"bù zú wéi qí",悄无声息:"qiǎo wú shēng xī",了如指掌:"liǎo rú zhǐ zhǎng",深恶痛绝:"shēn wù tòng jué",高高兴兴:"gāo gāo xìng xìng",唉声叹气:"āi shēng tàn qì",汉藏语系:"hàn zàng yǔ xì",处心积虑:"chǔ xīn jī lǜ",泣不成声:"qì bù chéng shēng",半夜三更:"bàn yè sān gēng",失魂落魄:"shī hún luò pò",二十八宿:"èr shí bā xiù",转来转去:"zhuàn lái zhuàn qù",数以万计:"shǔ yǐ wàn jì",相依为命:"xiāng yī wéi mìng",恋恋不舍:"liàn liàn bù shě",屈指可数:"qū zhǐ kě shǔ",神出鬼没:"shén chū guǐ mò",结结实实:"jiē jiē shí shí",有的放矢:"yǒu dì fàng shǐ",叽哩咕噜:"jī lǐ gū lū",调兵遣将:"diào bīng qiǎn jiàng",载歌载舞:"zài gē zài wǔ",转危为安:"zhuǎn wēi wéi ān",踏踏实实:"tā tā shi shí",桑给巴尔:"sāng jǐ bā ěr",装模作样:"zhuāng mú zuò yàng",见义勇为:"jiàn yì yǒng wéi",相差无几:"xiāng chā wú jǐ",叹为观止:"tàn wéi guān zhǐ",闷闷不乐:"mèn mèn bú lè",喜怒哀乐:"xǐ nù āi lè",鲜为人知:"xiǎn wéi rén zhī",张牙舞爪:"zhāng yá wǔ zhǎo",为非作歹:"wéi fēi zuò dǎi",含糊其辞:"hán hú qí cí",疲于奔命:"pí yú bēn mìng",勉为其难:"miǎn wéi qí nán",依依不舍:"yī yī bù shě",顶头上司:"dǐng tóu shàng si",不着边际:"bù zhuó biān jì",大模大样:"dà mú dà yàng",寻欢作乐:"xún huān zuò lè",一走了之:"yì zǒu liǎo zhī",字里行间:"zì lǐ háng jiān",含含糊糊:"hán hán hu hū",恰如其分:"qià rú qí fèn",破涕为笑:"pò tì wéi xiào",深更半夜:"shēn gēng bàn yè",千差万别:"qiān chā wàn bié",数不胜数:"shǔ bú shèng shǔ",据为己有:"jù wéi jǐ yǒu",天旋地转:"tiān xuán dì zhuàn",养尊处优:"yǎng zūn chǔ yōu",玻璃纤维:"bō li xiān wéi",吵吵闹闹:"chāo chao nào nào",晕头转向:"yūn tóu zhuàn xiàng",土生土长:"tǔ shēng tǔ zhǎng",宁死不屈:"nìng sǐ bù qū",不省人事:"bù xǐng rén shì",尽力而为:"jìn lì ér wéi",精明强干:"jīng míng qiáng gàn",唠唠叨叨:"láo lao dāo dāo",叽叽喳喳:"jī ji zhā zhā",功不可没:"gōng bù kě mò",锲而不舍:"qiè ér bù shě",排忧解难:"pái yōu jiě nàn",稀里糊涂:"xī li hú tú",各有所长:"gè yǒu suǒ cháng",的的确确:"dí dí què què",哄堂大笑:"hōng táng dà xiào",听而不闻:"tīng ér bù wén",刀耕火种:"dāo gēng huǒ zhòng",内分泌腺:"nèi fèn mì xiàn",化险为夷:"huà xiǎn wéi yí",百发百中:"bǎi fā bǎi zhòng",重见天日:"chóng jiàn tiān rì",反败为胜:"fǎn bài wéi shèng",一了百了:"yì liǎo bǎi liǎo",大大咧咧:"dà da liē liē",心急火燎:"xīn jí huǒ liǎo",粗心大意:"cū xīn dà yi",鸡皮疙瘩:"jī pí gē da",夷为平地:"yí wéi píng dì",日积月累:"rì jī yuè lěi",设身处地:"shè shēn chǔ dì",投其所好:"tóu qí suǒ hào",间不容发:"jiān bù róng fà",人满为患:"rén mǎn wéi huàn",穷追不舍:"qióng zhuī bù shě",为时已晚:"wéi shí yǐ wǎn",如数家珍:"rú shǔ jiā zhēn",心里有数:"xīn lǐ yǒu shù",以牙还牙:"yǐ yá huán yá",神不守舍:"shén bù shǒu shě",孟什维克:"mèng shí wéi kè",各自为战:"gè zì wéi zhàn",怨声载道:"yuàn shēng zài dào",救苦救难:"jiù kǔ jiù nàn",好好先生:"hǎo hǎo xiān sheng",怪模怪样:"guài mú guài yàng",抛头露面:"pāo tóu lù miàn",游手好闲:"yóu shǒu hào xián",无所不为:"wú suǒ bù wéi",调虎离山:"diào hǔ lí shān",步步为营:"bù bù wéi yíng",好大喜功:"hào dà xǐ gōng",众矢之的:"zhòng shǐ zhī dì",长生不死:"cháng shēng bù sǐ",蔚为壮观:"wèi wéi zhuàng guān",不可胜数:"bù kě shèng shǔ",鬼使神差:"guǐ shǐ shén chāi",洁身自好:"jié shēn zì hào",敢作敢为:"gǎn zuò gǎn wéi",茅塞顿开:"máo sè dùn kāi",走马换将:"zǒu mǎ huàn jiàng",为时过早:"wéi shí guò zǎo",为人师表:"wéi rén shī biǎo",阴差阳错:"yīn chā yáng cuò",油腔滑调:"yóu qiāng huá diào",重蹈覆辙:"chóng dǎo fù zhé",骂骂咧咧:"mà ma liē liē",絮絮叨叨:"xù xù dāo dāo",如履薄冰:"rú lǚ bó bīng",损兵折将:"sǔn bīng zhé jiàng",拐弯抹角:"guǎi wān mò jiǎo",像模像样:"xiàng mú xiàng yàng",供过于求:"gōng guò yú qiú",开花结果:"kāi huā jiē guǒ",仔仔细细:"zǐ zǐ xì xì",川藏公路:"chuān zàng gōng lù",河北梆子:"hé běi bāng zi",长年累月:"cháng nián lěi yuè",正儿八经:"zhèng er bā jīng",不识抬举:"bù shí tái ju",重振旗鼓:"chóng zhèn qí gǔ",气息奄奄:"qì xī yān yān",紧追不舍:"jǐn zhuī bù shě",服服帖帖:"fú fu tiē tiē",强词夺理:"qiǎng cí duó lǐ",噼里啪啦:"pī li pā lā",人才济济:"rén cái jǐ jǐ",发人深省:"fā rén shēn xǐng",不足为凭:"bù zú wéi píng",为富不仁:"wéi fù bù rén",连篇累牍:"lián piān lěi dú",呼天抢地:"hū tiān qiāng dì",落落大方:"luò luò dà fāng",自吹自擂:"zì chuī zì léi",乐善好施:"lè shàn hào shī",以攻为守:"yǐ gōng wéi shǒu",磨磨蹭蹭:"mó mó cèng cèng",削铁如泥:"xuē tiě rú ní",助纣为虐:"zhù zhòu wéi nüè",以退为进:"yǐ tuì wéi jìn",嘁嘁喳喳:"qī qī chā chā",枪林弹雨:"qiāng lín dàn yǔ",令人发指:"lìng rén fà zhǐ",转败为胜:"zhuǎn bài wéi shèng",转弯抹角:"zhuǎn wān mò jiǎo",在劫难逃:"zài jié nán táo",正当防卫:"zhèng dàng fáng wèi",不足为怪:"bù zú wéi guài",难兄难弟:"nàn xiōng nàn dì",咿咿呀呀:"yī yī yā yā",弹尽粮绝:"dàn jìn liáng jué",阿谀奉承:"ē yú fèng chéng",稀里哗啦:"xī li huā lā",返老还童:"fǎn lǎo huán tóng",好高骛远:"hào gāo wù yuǎn",鹿死谁手:"lù sǐ shéi shǒu",差强人意:"chā qiáng rén yì",大吹大擂:"dà chuī dà léi",成家立业:"chéng jiā lì yè",自怨自艾:"zì yuàn zì yì",负债累累:"fù zhài lěi lěi",古为今用:"gǔ wéi jīn yòng",入土为安:"rù tǔ wéi ān",下不为例:"xià bù wéi lì",一哄而上:"yì hōng ér shàng",没头苍蝇:"méi tóu cāng ying",天差地远:"tiān chā dì yuǎn",风卷残云:"fēng juǎn cán yún",多灾多难:"duō zāi duō nàn",乳臭未干:"rǔ xiù wèi gān",行家里手:"háng jiā lǐ shǒu",狼狈为奸:"láng bèi wéi jiān",处变不惊:"chǔ biàn bù jīng",一唱一和:"yí chàng yí hè",一念之差:"yí niàn zhī chā",金蝉脱壳:"jīn chán tuō qiào",滴滴答答:"dī dī dā dā",硕果累累:"shuò guǒ léi léi",好整以暇:"hào zhěng yǐ xiá",红得发紫:"hóng de fā zǐ",传为美谈:"chuán wéi měi tán",富商大贾:"fù shāng dà gǔ",四海为家:"sì hǎi wéi jiā",了若指掌:"liǎo ruò zhǐ zhǎng",大有可为:"dà yǒu kě wéi",出头露面:"chū tóu lù miàn",鼓鼓囊囊:"gǔ gu nāng nāng",窗明几净:"chuāng míng jī jìng",泰然处之:"tài rán chǔ zhī",怒发冲冠:"nù fà chōng guān",有机玻璃:"yǒu jī bō li",骨头架子:"gǔ tou jià zi",义薄云天:"yì bó yún tiān",一丁点儿:"yī dīng diǎn er",时来运转:"shí lái yùn zhuǎn",陈词滥调:"chén cí làn diào",化整为零:"huà zhěng wéi líng",火烧火燎:"huǒ shāo huǒ liǎo",干脆利索:"gàn cuì lì suǒ",吊儿郎当:"diào er láng dāng",广种薄收:"guǎng zhòng bó shōu",种瓜得瓜:"zhòng guā dé guā",种豆得豆:"zhòng dòu dé dòu",难舍难分:"nán shě nán fēn",歃血为盟:"shà xuè wéi méng",奋发有为:"fèn fā yǒu wéi",阴错阳差:"yīn cuò yáng chā",东躲西藏:"dōng duǒ xī cáng",烟熏火燎:"yān xūn huǒ liǎo",钻牛角尖:"zuān niú jiǎo jiān",乔装打扮:"qiáo zhuāng dǎ bàn",改弦更张:"gǎi xián gēng zhāng",河南梆子:"hé nán bāng zi",好吃懒做:"hào chī lǎn zuò",何乐不为:"hé lè bù wéi",大出风头:"dà chū fēng tóu",攻城掠地:"gōng chéng lüè dì",漂漂亮亮:"piào piào liang liang",折衷主义:"zhé zhōng zhǔ yì",大马哈鱼:"dà mǎ hǎ yú",绿树成荫:"lǜ shù chéng yīn",率先垂范:"shuài xiān chuí fàn",家长里短:"jiā cháng lǐ duǎn",宽大为怀:"kuān dà wéi huái",左膀右臂:"zuǒ bǎng yòu bì",一笑了之:"yí xiào liǎo zhī",天下为公:"tiān xià wéi gōng",还我河山:"huán wǒ hé shān",何足为奇:"hé zú wéi qí",好自为之:"hǎo zì wéi zhī",风姿绰约:"fēng zī chuò yuē",大雨滂沱:"dà yǔ pāng tuó",传为佳话:"chuán wéi jiā huà",吃里扒外:"chī lǐ pá wài",重操旧业:"chóng cāo jiù yè",小家子气:"xiǎo jiā zi qì",少不更事:"shào bù gēng shì",难分难舍:"nán fēn nán shě",添砖加瓦:"tiān zhuān jiā wǎ",是非分明:"shì fēi fēn míng",舍我其谁:"shě wǒ qí shuí",偏听偏信:"piān tīng piān xìn",量入为出:"liàng rù wéi chū",降龙伏虎:"xiáng lóng fú hǔ",钢化玻璃:"gāng huà bō li",正中下怀:"zhèng zhòng xià huái",以身许国:"yǐ shēn xǔ guó",一语中的:"yì yǔ zhòng dì",丧魂落魄:"sàng hún luò pò",三座大山:"sān zuò dà shān",济济一堂:"jǐ jǐ yì táng",好事之徒:"hào shì zhī tú",干净利索:"gàn jìng lì suǒ",出将入相:"chū jiàng rù xiàng",袅袅娜娜:"niǎo niǎo nuó nuó",狐狸尾巴:"hú li wěi ba",好逸恶劳:"hào yì wù láo",大而无当:"dà ér wú dàng",打马虎眼:"dǎ mǎ hu yǎn",板上钉钉:"bǎn shàng dìng dīng",吆五喝六:"yāo wǔ hè liù",虾兵蟹将:"xiā bīng xiè jiàng",水调歌头:"shuǐ diào gē tóu",数典忘祖:"shǔ diǎn wàng zǔ",人事不省:"rén shì bù xǐng",曲高和寡:"qǔ gāo hè guǎ",屡教不改:"lǚ jiào bù gǎi",互为因果:"hù wéi yīn guǒ",互为表里:"hù wéi biǎo lǐ",厚此薄彼:"hòu cǐ bó bǐ",过关斩将:"guò guān zhǎn jiàng",疙疙瘩瘩:"gē ge dā dā",大腹便便:"dà fù pián pián",走为上策:"zǒu wéi shàng cè",冤家对头:"yuān jia duì tóu",有隙可乘:"yǒu xì kě chèng",一鳞半爪:"yì lín bàn zhǎo",片言只语:"piàn yán zhǐ yǔ",开花结实:"kāi huā jié shí",经年累月:"jīng nián lěi yuè",含糊其词:"hán hú qí cí",寡廉鲜耻:"guǎ lián xiǎn chǐ",成年累月:"chéng nián lěi yuè",不徇私情:"bú xùn sī qíng",不当人子:"bù dāng rén zǐ",膀大腰圆:"bǎng dà yāo yuán",指腹为婚:"zhǐ fù wéi hūn",这么点儿:"zhè me diǎn er",意兴索然:"yì xīng suǒ rán",绣花枕头:"xiù huā zhěn tou",无的放矢:"wú dì fàng shǐ",望闻问切:"wàng wén wèn qiè",舍己为人:"shě jǐ wèi rén",穷年累月:"qióng nián lěi yuè",排难解纷:"pái nàn jiě fēn",处之泰然:"chǔ zhī tài rán",指鹿为马:"zhǐ lù wéi mǎ",危如累卵:"wēi rú lěi luǎn",天兵天将:"tiān bīng tiān jiàng",舍近求远:"shě jìn qiú yuǎn",南腔北调:"nán qiāng běi diào",苦中作乐:"kǔ zhōng zuò lè",厚积薄发:"hòu jī bó fā",臭味相投:"xiù wèi xiāng tóu",长幼有序:"zhǎng yòu yǒu xù",逼良为娼:"bī liáng wéi chāng",悲悲切切:"bēi bēi qiè qiē",败军之将:"bài jūn zhī jiàng",欺行霸市:"qī háng bà shì",削足适履:"xuē zú shì lǚ",先睹为快:"xiān dǔ wéi kuài",啼饥号寒:"tí jī háo hán",疏不间亲:"shū bú jiàn qīn",神差鬼使:"shén chāi guǐ shǐ",敲敲打打:"qiāo qiāo dǎ dǎ",平铺直叙:"píng pū zhí xù",没头没尾:"méi tóu mò wěi",寥寥可数:"liáo liáo kě shǔ",哼哈二将:"hēng hā èr jiàng",鹤发童颜:"hè fà tóng yán",各奔前程:"gè bèn qián chéng",弹无虚发:"dàn wú xū fā",大人先生:"dà rén xiān sheng",与民更始:"yǔ mín gēng shǐ",树碑立传:"shù bēi lì zhuàn",是非得失:"shì fēi dé shī",实逼处此:"shí bī chǔ cǐ",塞翁失马:"sài wēng shī mǎ",日薄西山:"rì bó xī shān",切身体会:"qiè shēn tǐ huì",片言只字:"piàn yán zhǐ zì",跑马卖解:"pǎo mǎ mài xiè",宁折不弯:"nìng zhé bù wān",零零散散:"líng líng sǎn sǎn",量体裁衣:"liàng tǐ cái yī",连中三元:"lián zhòng sān yuán",礼崩乐坏:"lǐ bēng yuè huài",不为已甚:"bù wéi yǐ shèn",转悲为喜:"zhuǎn bēi wéi xǐ",以眼还眼:"yǐ yǎn huán yǎn",蔚为大观:"wèi wéi dà guān",未为不可:"wèi wéi bù kě",童颜鹤发:"tóng yán hè fà",朋比为奸:"péng bǐ wéi jiān",莫此为甚:"mò cǐ wéi shèn",夹枪带棒:"jiā qiāng dài bàng",富商巨贾:"fù shāng jù jiǎ",淡然处之:"dàn rán chǔ zhī",箪食壶浆:"dān shí hú jiāng",创巨痛深:"chuāng jù tòng shēn",草长莺飞:"cǎo zhǎng yīng fēi",坐视不救:"zuò shī bú jiù",以己度人:"yǐ jǐ duó rén",随行就市:"suí háng jiù shì",文以载道:"wén yǐ zài dào",文不对题:"wén bú duì tí",铁板钉钉:"tiě bǎn dìng dīng",身体发肤:"shēn tǐ fà fū",缺吃少穿:"quē chī shǎo chuān",目无尊长:"mù wú zūn zhǎng",吉人天相:"jí rén tiān xiàng",毁家纾难:"huǐ jiā shū nàn",钢筋铁骨:"gāng jīn tiě gǔ",丢卒保车:"diū zú bǎo jū",丢三落四:"diū sān là sì",闭目塞听:"bì mù sè tīng",削尖脑袋:"xuē jiān nǎo dài",为非作恶:"wéi fēi zuò è",人才难得:"rén cái nán dé",情非得已:"qíng fēi dé yǐ",切中要害:"qiè zhòng yào hài",火急火燎:"huǒ jí huǒ liǎo",画地为牢:"huà dì wéi láo",好酒贪杯:"hào jiǔ tān bēi",长歌当哭:"cháng gē dàng kū",载沉载浮:"zài chén zài fú",遇难呈祥:"yù nàn chéng xiáng",榆木疙瘩:"yú mù gē da",以邻为壑:"yǐ lín wéi hè",洋为中用:"yáng wéi zhōng yòng",言为心声:"yán wéi xīn shēng",言必有中:"yán bì yǒu zhòng",图穷匕见:"tú qióng bǐ xiàn",滂沱大雨:"páng tuó dà yǔ",目不暇给:"mù bù xiá jǐ",量才录用:"liàng cái lù yòng",教学相长:"jiào xué xiāng zhǎng",悔不当初:"huǐ bù dāng chū",呼幺喝六:"hū yāo hè liù",不足为训:"bù zú wéi xùn",不拘形迹:"bù jū xíng jī",傍若无人:"páng ruò wú rén",罪责难逃:"zuì zé nán táo",自我吹嘘:"zì wǒ chuī xū",转祸为福:"zhuǎn huò wéi fú",勇冠三军:"yǒng guàn sān jūn",易地而处:"yì dì ér chǔ",卸磨杀驴:"xiè mò shā lǘ",玩儿不转:"wán ér bú zhuàn",天道好还:"tiān dào hǎo huán",身单力薄:"shēn dān lì bó",撒豆成兵:"sǎ dòu chéng bīng",片纸只字:"piàn zhǐ zhī zì",宁缺毋滥:"nìng quē wú làn",没没无闻:"mò mò wú wén",量力而为:"liàng lì ér wéi",历历可数:"lì lì kě shǔ",口碑载道:"kǒu bēi zài dào",君子好逑:"jūn zǐ hǎo qiú",好为人师:"hào wéi rén shī",豪商巨贾:"háo shāng jù jiǎ",各有所好:"gè yǒu suǒ hào",度德量力:"duó dé liàng lì",指天为誓:"zhǐ tiān wéi shì",逸兴遄飞:"yì xìng chuán fēi",心宽体胖:"xīn kuān tǐ pán",为德不卒:"wéi dé bù zú",天下为家:"tiān xià wéi jiā",视为畏途:"shì wéi wèi tú",三灾八难:"sān zāi bā nàn",沐猴而冠:"mù hóu ér guàn",哩哩啦啦:"lī li lā lā",见缝就钻:"jiàn fèng jiù zuān",夹层玻璃:"jiā céng bō li",急公好义:"jí gōng hào yì",积年累月:"jī nián lěi yuè",划地为牢:"huá dì wéi láo",更名改姓:"gēng míng gǎi xìng",奉为圭臬:"fèng wéi guī niè",多难兴邦:"duō nàn xīng bāng",不破不立:"bú pò bú lì",坐地自划:"zuò dì zì huá",坐不重席:"zuò bù chóng xí",坐不窥堂:"zuò bù kuī táng",作嫁衣裳:"zuò jià yī shang",左枝右梧:"zuǒ zhī yòu wú",左宜右有:"zuǒ yí yòu yǒu",钻头觅缝:"zuān tóu mì fèng",钻天打洞:"zuān tiān dǎ dòng",钻皮出羽:"zuān pí chū yǔ",钻火得冰:"zuān huǒ dé bīng",钻洞觅缝:"zuàn dòng mì féng",钻冰求火:"zuān bīng qiú huǒ",子为父隐:"zǐ wéi fù yǐn",擢发难数:"zhuó fà nán shǔ",着人先鞭:"zhuó rén xiān biān",斫雕为朴:"zhuó diāo wéi pǔ",锥处囊中:"zhuī chǔ náng zhōng",椎心饮泣:"chuí xīn yǐn qì",椎心泣血:"chuí xīn qì xuè",椎牛飨士:"chuí niú xiǎng shì",椎牛歃血:"chuí niú shà xuè",椎牛发冢:"chuí niú fà zhǒng",椎埋屠狗:"chuí mái tú gǒu",椎埋狗窃:"chuí mái gǒu qiè",壮发冲冠:"zhuàng fā chōng guàn",庄严宝相:"zhuāng yán bǎo xiàng",转愁为喜:"zhuǎn chóu wéi xǐ",转嗔为喜:"zhuǎn chēn wéi xǐ",拽巷啰街:"zhuài xiàng luó jiē",拽耙扶犁:"zhuāi pá fú lí",拽布拖麻:"zhuài bù tuō má",箸长碗短:"zhù cháng wǎn duǎn",铸剑为犁:"zhù jiàn wéi lí",杼柚其空:"zhù yòu qí kōng",杼柚空虚:"zhù yòu kōng xū",助天为虐:"zhù tiān wéi nüè",属垣有耳:"zhǔ yuán yǒu ěr",属毛离里:"zhǔ máo lí lǐ",属辞比事:"zhǔ cí bǐ shì",逐物不还:"zhú wù bù huán",铢量寸度:"zhū liáng cùn duó",铢两悉称:"zhū liǎng xī chèn",侏儒观戏:"zhū rú guān xì",朱轓皁盖:"zhū fān zào gài",昼度夜思:"zhòu duó yè sī",诪张为幻:"zhōu zhāng wéi huàn",重明继焰:"chóng míng jì yàn",众啄同音:"zhòng zhuó tóng yīn",众毛攒裘:"zhòng máo cuán qiú",众好众恶:"zhòng hào zhòng wù",擿埴索涂:"zhāi zhí suǒ tú",稚齿婑媠:"zhì chǐ wǒ tuó",至当不易:"zhì dàng bú yì",指皂为白:"zhǐ zào wéi bái",指雁为羹:"zhǐ yàn wéi gēng",指树为姓:"zhǐ shù wéi xìng",指山说磨:"zhǐ shān shuō mò",止戈为武:"zhǐ gē wéi wǔ",枝干相持:"zhī gàn xiāng chí",枝大于本:"zh dà yú běn",支吾其词:"zhī wú qí cí",正身率下:"zhèng shēn shuài xià",正冠李下:"zhèng guàn lǐ xià",整冠纳履:"zhěng guān nà lǚ",整躬率物:"zhěng gōng shuài wù",整顿干坤:"zhěng dùn gàn kūn",针头削铁:"zhēn tóu xuē tiě",贞松劲柏:"zhēn sōng jìng bǎi",赭衣塞路:"zhě yī sè lù",折箭为誓:"shé jiàn wéi shì",折而族之:"zhé ér zú zhī",昭德塞违:"zhāo dé sè wéi",章句小儒:"zhāng jù xiǎo rú",湛恩汪濊:"zhàn ēn wāng huì",占风望气:"zhān fēng wàng qì",斩将搴旗:"zhǎn jiàng qiān qí",曾母投杼:"zēng mǔ tóu zhù",曾参杀人:"zēng shēn shā rén",造谣中伤:"zào yáo zhòng shāng",早占勿药:"zǎo zhān wù yào",凿龟数策:"záo guī shǔ cè",攒三聚五:"cuán sān jù wǔ",攒眉蹙额:"cuán mei cù é",攒零合整:"cuán líng hé zhěng",攒锋聚镝:"cuán fēng jù dí",载笑载言:"zài xiào zài yán",载酒问字:"zài jiǔ wèn zì",殒身不恤:"yǔn shēn bú xù",云舒霞卷:"yún shū xiá juǎn",月中折桂:"yuè zhōng shé guì",月落参横:"yuè luò shēn héng",鬻驽窃价:"yù nú qiè jià",鬻鸡为凤:"yù jī wéi fèng",遇难成祥:"yù nàn chéng xiáng",郁郁累累:"yù yù lěi lěi",玉卮无当:"yù zhī wú dàng",语笑喧阗:"yǔ xiào xuān tián",与世沉浮:"yǔ shì chén fú",与时消息:"yǔ shí xiāo xi",逾墙钻隙:"yú qiáng zuān xì",渔夺侵牟:"yú duó qīn móu",杅穿皮蠹:"yú chuān pí dù",余勇可贾:"yú yǒng kě gǔ",予智予雄:"yú zhì yú xióng",予取予求:"yú qǔ yú qiú",于家为国:"yú jiā wéi guó",有借无还:"yǒu jiè wú huán",有加无已:"yǒu jiā wú yǐ",有国难投:"yǒu guó nán tóu",游必有方:"yóu bì yǒu fāng",油干灯尽:"yóu gàn dēng jìn",尤云殢雨:"yóu yún tì yǔ",庸中皦皦:"yōng zhōng jiǎo jiǎo",郢书燕说:"yǐng shū yān shuō",营蝇斐锦:"yíng yíng fēi jǐn",鹰心雁爪:"yīng xīn yàn zhǎo",莺吟燕儛:"yīng yín yàn wǔ",应天顺时:"yīng tiān shùn shí",印累绶若:"yìn léi shòu ruò",隐占身体:"yǐn zhàn shēn tǐ",饮犊上流:"yìn dú shàng liú",引绳切墨:"yǐn shéng qiē mò",龈齿弹舌:"yín chǐ dàn shé",因缘为市:"yīn yuán wéi shì",因树为屋:"yīn shù wéi wū",溢美溢恶:"yì měi yì wù",抑塞磊落:"yì sè lěi luò",倚闾望切:"yǐ lǘ wàng qiē",以意为之:"yǐ yì wéi zhī",以言为讳:"yǐ yán wéi huì",以疏间亲:"yǐ shū jiàn qīn",以水济水:"yǐ shuǐ jǐ shuǐ",以书为御:"yǐ shū wéi yù",以守为攻:"yǐ shǒu wéi gōng",以升量石:"yǐ shēng liáng dàn",以慎为键:"yǐ shèn wéi jiàn",以筌为鱼:"yǐ quán wéi yú",以利累形:"yǐ lì lěi xíng",以毁为罚:"yǐ huǐ wéi fá",以黑为白:"yǐ hēi wéi bái",以规为瑱:"yǐ guī wéi tiàn",以古为鉴:"yǐ gǔ wéi jiàn",以宫笑角:"yǐ gōng xiào jué",以法为教:"yǐ fǎ wéi jiào",以大恶细:"yǐ dà wù xì",遗世忘累:"yí shì wàng lěi",遗寝载怀:"yí qǐn zài huái",移的就箭:"yí dì jiù jiàn",依头缕当:"yī tóu lǚ dàng",衣租食税:"yì zū shí shuì",衣轻乘肥:"yì qīng chéng féi",衣裳之会:"yī shang zhī huì",衣单食薄:"yī dān shí bó",一还一报:"yì huán yí bào",叶公好龙:"yè gōng hào lóng",野调无腔:"yě diào wú qiāng",瑶池女使:"yáo chí nǚ shǐ",幺麽小丑:"yāo mó xiǎo chǒu",养精畜锐:"yǎng jīng xù ruì",卬首信眉:"áng shǒu shēn méi",洋洋纚纚:"yáng yáng sǎ sǎ",羊羔美酒:"yáng gāo měi jiǔ",扬风扢雅:"yáng fēng jié yǎ",燕昭市骏:"yān zhāo shì jùn",燕昭好马:"yān zhāo hǎo mǎ",燕石妄珍:"yān shí wàng zhēn",燕骏千金:"yān jùn qiān jīn",燕金募秀:"yān jīn mù xiù",燕驾越毂:"yān jià yuè gǔ",燕歌赵舞:"yān gē zhào wǔ",燕岱之石:"yān dài zhī shí",燕处危巢:"yàn chǔ wēi cháo",掞藻飞声:"shàn zǎo fēi shēng",偃革为轩:"yǎn gé wéi xuān",妍蚩好恶:"yán chī hǎo è",压良为贱:"yā liáng wéi jiàn",搀行夺市:"chān háng duó shì",泣数行下:"qì shù háng xià",当行出色:"dāng háng chū sè",秀出班行:"xiù chū bān háng",儿女成行:"ér nǚ chéng háng",大行大市:"dà háng dà shì",寻行数墨:"xún háng shǔ mò",埙篪相和:"xūn chí xiāng hè",血债累累:"xuè zhài lěi lěi",炫玉贾石:"xuàn yù gǔ shí",炫石为玉:"xuàn shí wéi yù",悬石程书:"xuán dàn chéng shū",悬狟素飡:"xuán huán sù cān",悬龟系鱼:"xuán guī xì yú",揎拳捋袖:"xuān quán luō xiù",轩鹤冠猴:"xuān hè guàn hóu",畜妻养子:"xù qī yǎng zǐ",羞人答答:"xiū rén dā dā",修鳞养爪:"xiū lín yǎng zhǎo",熊据虎跱:"xióng jù hǔ zhì",兄死弟及:"xiōng sǐ dì jí",腥闻在上:"xīng wén zài shàng",兴文匽武:"xīng wén yǎn wǔ",兴观群怨:"xìng guān qún yuàn",兴高彩烈:"xìng gāo cǎi liè",心手相应:"xīn shǒu xiāng yìng",心口相应:"xīn kǒu xiāng yīng",挟势弄权:"xié shì nòng quán",胁肩累足:"xié jiān lěi zú",校短量长:"jiào duǎn liáng cháng",小眼薄皮:"xiǎo yǎn bó pí",硝云弹雨:"xiāo yún dàn yǔ",鸮鸣鼠暴:"xiāo míng shǔ bào",削株掘根:"xuē zhū jué gēn",削铁无声:"xuē tiě wú shēng",削职为民:"xuē zhí wéi mín",削木为吏:"xuē mù wéi lì",想望风褱:"xiǎng wàng fēng huái",香培玉琢:"xiang pei yu zhuó",相鼠有皮:"xiàng shǔ yǒu pí",相时而动:"xiàng shí ér dòng",相切相磋:"xiāng qiē xiāng cuō",相女配夫:"xiàng nǚ pèi fū",相门有相:"xiàng mén yǒu xiàng",挦章撦句:"xián zhāng chě jù",先我着鞭:"xiān wǒ zhuó biān",习焉不察:"xí yān bù chá",歙漆阿胶:"shè qī ē jiāo",晰毛辨发:"xī máo biàn fà",悉索薄赋:"xī suǒ bó fù",雾鳞云爪:"wù lín yún zhǎo",物稀为贵:"wù xī wéi guì",碔砆混玉:"wǔ fū hùn yù",武断专横:"wǔ duàn zhuān héng",五石六鹢:"wǔ shí liù yì",五色相宣:"wǔ sè xiāng xuān",五侯七贵:"wǔ hóu qī guì",五侯蜡烛:"wǔ hòu là zhú",五羖大夫:"wǔ gǔ dà fū",吾自有处:"wú zì yǒu chǔ",无下箸处:"wú xià zhù chǔ",无伤无臭:"wú shāng wú xiù",无能为役:"wú néng wéi yì",无寇暴死:"wú kòu bào sǐ",无孔不钻:"wú kǒng bú zuàn",无间可乘:"wú jiān kě chéng",无间冬夏:"wú jiān dōng xià",无恶不为:"wú è bù wéi",无动为大:"wú dòng wéi dà",诬良为盗:"wū liáng wéi dào",握拳透爪:"wò quán tòu zhǎo",文武差事:"wén wǔ chāi shì",委委佗佗:"wēi wēi tuó tuó",惟日为岁:"wéi rì wéi suì",帷薄不修:"wéi bó bù xiū",为善最乐:"wéi shàn zuì lè",为山止篑:"wéi shān zhǐ kuì",为仁不富:"wéi rén bú fù",为裘为箕:"wéi qiú wéi jī",为民父母:"wéi mín fù mǔ",为虺弗摧:"wéi huǐ fú cuī",为好成歉:"wéi hǎo chéng qiàn",为鬼为蜮:"wéi guǐ wéi yù",望风响应:"wàng fēng xiǎng yīng",望尘僄声:"wàng chén piào shēng",往渚还汀:"wǎng zhǔ huán tīng",王贡弹冠:"wáng gòng dàn guàn",亡国大夫:"wáng guó dà fū",万贯家私:"wàn guàn jiā sī",晚食当肉:"wǎn shí dàng ròu",晚节不保:"wǎn jié bù bǎo",玩岁愒时:"wán suì kài shí",蛙蟆胜负:"wā má shèng fù",吞言咽理:"tūn yán yàn lǐ",颓垣断堑:"tuí yuán duàn qiàn",推干就湿:"tuī gàn jiù shī",剸繁决剧:"tuán fán jué jù",团头聚面:"tuán tóu jù miàn",兔丝燕麦:"tù sī yàn mài",兔头麞脑:"tù tóu zhāng nǎo",兔葵燕麦:"tù kuí yàn mài",吐哺握发:"tǔ bǔ wò fà",投传而去:"tóu zhuàn ér qù",头没杯案:"tóu mò bēi àn",头昏脑闷:"tóu hūn nǎo mèn",头会箕敛:"tóu kuài jī liǎn",头出头没:"tóu chū tóu mò",痛自创艾:"tòng zì chuāng yì",同恶相助:"tóng wù xiāng zhù",同恶相恤:"tóng wù xiāng xù",痌瘝在抱:"tōng guān zài bào",通文调武:"tōng wén diào wǔ",停留长智:"tíng liú zhǎng zhì",铁树开华:"tiě shù kāi huā",条贯部分:"tiáo guàn bù fēn",挑牙料唇:"tiǎo yá liào chún",挑么挑六:"tiāo yāo tiāo liù",挑唇料嘴:"tiǎo chún liào zuǐ",恬不为意:"tián bù wéi yì",恬不为怪:"tián bù wéi guài",天下为笼:"tiān xià wéi lóng",天台路迷:"tiān tái lù mí",天年不遂:"tiān nián bú suì",探囊胠箧:"tàn náng qū qiè",谭言微中:"tán yán wēi zhòng",谈言微中:"tán yán wēi zhòng",狧穅及米:"shì kāng jí mǐ",随物应机:"suí wù yīng jī",搜岩采干:"sōu yán cǎi gàn",宋斤鲁削:"sòng jīn lǔ xuē",松筠之节:"sōng yún zhī jié",四亭八当:"sì tíng bā dàng",四马攒蹄:"sì mǎ cuán tí",四不拗六:"sì bú niù liù",思所逐之:"sī suǒ zhú zhī",丝恩发怨:"sī ēn fà yuàn",硕望宿德:"shuò wàng xiǔ dé",铄古切今:"shuò gǔ qiē jīn",顺风而呼:"shùn fēng ér hū",顺风吹火:"shùn fēng chuī huǒ",水中著盐:"shuǐ zhōng zhuó yán",双柑斗酒:"shuāng gān dǒu jiǔ",数米而炊:"shǔ mǐ ér chuī",数米量柴:"shǔ mǐ liáng chái",数理逻辑:"shù lǐ luó ji",数黑论黄:"shǔ hēi lùn huáng",数白论黄:"shǔ bái lùn huáng",束缊还妇:"shù yūn huán fù",束蒲为脯:"shù pú wéi pú",束椽为柱:"shù chuán wéi zhù",书缺有间:"shū quē yǒu jiàn",手足重茧:"shǒu zú chóng jiǎn",手足异处:"shǒu zú yì chǔ",手脚干净:"shǒu jiǎo gàn jìng",手不应心:"shǒu bù yīng xīn",螫手解腕:"shì shǒu jiě wàn",释知遗形:"shì zhī yí xíng",适时应务:"shì shí yīng wù",适情率意:"shì qíng shuài yì",适当其冲:"shì dāng qí chōng",视为知己:"shì wéi zhī jǐ",使羊将狼:"shǐ yáng jiàng láng",食为民天:"shí wéi mín tiān",拾掇无遗:"shí duō wú yí",实与有力:"shí yù yǒu lì",石英玻璃:"shí yīng bō li",石室金匮:"shí shì jīn guì",什袭珍藏:"shí xí zhēn cáng",什伍东西:"shí wǔ dōng xī",什围伍攻:"shí wéi wǔ gōng",十魔九难:"shí mó jiǔ nàn",诗书发冢:"shī shū fà zhǒng",虱处裈中:"shī chǔ kūn zhōng",师直为壮:"shī zhí wéi zhuàng",尸居龙见:"shī jū lóng xiàn",圣经贤传:"shèng jīng xián zhuàn",圣君贤相:"shèng jūn xián xiàng",生拖死拽:"shēng tuō sǐ zhuài",审己度人:"shěn jǐ duó rén",神武挂冠:"shén wǔ guà guàn",神龙失埶:"shén lóng shī shì",深文曲折:"shēn wén qǔ shé",深厉浅揭:"shēn lì qiǎn qì",深谷为陵:"shēn gǔ wéi líng",深恶痛疾:"shēn wù tòng jí",深仇宿怨:"shēn chóu xiǔ yuàn",舍己为公:"shě jǐ wèi gōng",舍短取长:"shě duǎn qǔ cháng",舍策追羊:"shě cè zhuī yáng",蛇蝎为心:"shé xiē wéi xīn",少成若性:"shào chéng ruò xìng",上当学乖:"shàng dàng xué guāi",赏不当功:"shǎng bù dāng gōng",善自为谋:"shàn zì wéi móu",善为说辞:"shàn wéi shuō cí",善善恶恶:"shàn shàn wù è",善财难舍:"shàn cái nán shě",苫眼铺眉:"shān yǎn pū méi",讪牙闲嗑:"shàn yá xián kē",山阴乘兴:"shān yīn chéng xīng",山殽野湋:"shān yáo yě wéi",山溜穿石:"shān liù chuān shí",山节藻棁:"shān jié zǎo zhuō",杀鸡为黍:"shā jī wéi shǔ",色厉胆薄:"sè lì dǎn bó",桑荫未移:"sāng yīn wèi yí",桑荫不徙:"sāng yīn bù xǐ",桑土绸缪:"sāng tǔ chóu miù",桑户棬枢:"sāng hù juàn shū",三战三北:"sān zhàn sān běi",三瓦两舍:"sān wǎ liǎng shě",三人为众:"sān rén wèi zhòng",三差两错:"sān chā liǎng cuò",塞井焚舍:"sāi jǐng fén shě",洒心更始:"sǎ xīn gèng shǐ",洒扫应对:"sǎ sǎo yìng duì",软红香土:"ruǎn hóng xiāng tǔ",入吾彀中:"rù wú gòu zhōng",入铁主簿:"rù tiě zhǔ bù",入理切情:"rù lǐ qiē qíng",汝成人耶:"rǔ chéng rén yé",如水投石:"rú shuǐ tóu shí",如切如磋:"rú qiē rú cuō",如登春台:"rú dēng chūn tái",肉薄骨并:"ròu bó gǔ bìng",柔情绰态:"róu qíng chuò tài",戎马劻勷:"róng mǎ kuāng ráng",日中为市:"rì zhōng wéi shì",日月参辰:"rì yuè shēn chén",日省月修:"rì xǐng yuè xiū",日削月割:"rì xuē yuè gē",日省月试:"rì xǐng yuè shì",任达不拘:"rèn dá bù jū",人言藉藉:"rén yán jí jí",人模狗样:"rén mú gǒu yàng",人莫予毒:"rén mò yú dú",热熬翻饼:"rè áo fān bǐng",圈牢养物:"juàn láo yǎng wù",取予有节:"qǔ yǔ yǒu jié",诎要桡腘:"qū yāo ráo guó",穷形尽相:"qióng xíng jìn xiàng",情凄意切:"qíng qī yì qiè",情见势屈:"qíng xiàn shì qū",情见乎辞:"qíng xiàn hū cí",清都绛阙:"qīng dōu jiàng què",倾肠倒肚:"qīng cháng dào dǔ",青紫被体:"qīng zǐ pī tǐ",青林黑塞:"qīng lín hēi sài",螓首蛾眉:"qín shǒu é méi",琴瑟之好:"qín sè zhī hào",且住为佳:"qiě zhù wéi jiā",切树倒根:"qiē shù dǎo gēn",切理餍心:"qiē lǐ yàn xīn",切近的当:"qiē jìn de dāng",翘足引领:"qiáo zú yǐn lǐng",巧发奇中:"qiǎo fā qí zhòng",强嘴拗舌:"jiàng zuǐ niù shé",强直自遂:"qiáng zhí zì suí",强死强活:"qiǎng sǐ qiǎng huó",强食自爱:"qiǎng shí zì ài",强食靡角:"qiǎng shí mí jiǎo",强弓劲弩:"qiáng gōng jìng nǔ",强聒不舍:"qiǎng guō bù shě",强凫变鹤:"qiáng fú biàn hè",强而后可:"qiǎng ér hòu kě",强得易贫:"qiǎng dé yì pín",遣兴陶情:"qiǎn xìng táo qíng",牵羊担酒:"qiān yáng dān jiǔ",千了百当:"qiān liǎo bǎi dàng",泣下如雨:"qì xià rú yǔ",起偃为竖:"qǐ yǎn wéi shù",岂弟君子:"kǎi tì jūn zǐ",綦溪利跂:"qí xī lì qí",棋输先著:"qí shū xiān zhuó",齐王舍牛:"qí wáng shě niú",欺天诳地:"qī tiān kuáng dì",普天率土:"pǔ tiān shuài tǔ",铺胸纳地:"pū xiōng nà dì",铺锦列绣:"pū jǐn liè xiù",破家为国:"pò jiā wèi guó",破觚为圜:"pò gū wéi yuán",萍飘蓬转:"píng piāo péng zhuàn",帡天极地:"píng tiān jí dì",屏声息气:"bǐng shēng xī qì",凭几据杖:"píng jī jù zhàng",贫嘴薄舌:"pín zuǐ bó shé",片语只辞:"piàn yǔ zhī cí",披发文身:"pī fà wén shēn",烹龙炮凤:"pēng lóng páo fèng",炰鳖脍鲤:"fǒu biē kuài lǐ",庞眉皓发:"páng méi hào fà",攀花折柳:"pān huā zhé liǔ",攀蟾折桂:"pān chán shé guì",女大难留:"nǚ dà nán liú",弄玉吹箫:"nòng yù chuī xiāo",弄管调弦:"nòng guǎn tiáo xián",弄粉调朱:"nòng fěn diào zhū",浓抹淡妆:"nóng mò dàn zhuāng",捻土为香:"niǎn tǔ wéi xiāng",年谊世好:"nián yì shì hǎo",年华垂暮:"nián huá chuí mù",儗不于伦:"nǐ bù yú lún",泥而不滓:"ní ér bù zǐ",能者为师:"néng zhě wéi shī",能不称官:"néng bú chèn guān",挠直为曲:"náo zhí wéi qū",难进易退:"nán jìn yì tuì",难得糊涂:"nán dé hú tú",南蛮鴂舌:"nán mán jué shé",南贩北贾:"nán fàn běi gǔ",牧猪奴戏:"mù zhū nú xì",目眢心忳:"mù yuān xīn tún",目挑心招:"mù tiǎo xīn zhāo",目量意营:"mù liàng yì yíng",木头木脑:"mù tóu mù nǎo",木干鸟栖:"mù gàn niǎo qī",侔色揣称:"móu sè chuǎi chèn",莫予毒也:"mò yú dú yě",抹粉施脂:"mò fěn shī zhī",磨砻镌切:"mó lóng juān qiē",磨棱刓角:"mó léng wán jiǎo",摸门不着:"mō mén bù zháo",摸不着边:"mō bù zhuó biān",命中注定:"mìng zhōng zhù dìng",鸣鹤之应:"míng hè zhī yìng",明效大验:"míng xiào dà yàn",名我固当:"míng wǒ gù dāng",邈处欿视:"miǎo chǔ kǎn shì",黾穴鸲巢:"měng xué qú cháo",绵里薄材:"mián lǐ bó cái",靡有孑遗:"mǐ yǒu jié yí",靡衣偷食:"mǐ yī tōu shí",迷恋骸骨:"mí liàn hái gǔ",扪参历井:"mén shēn lì jǐng",门单户薄:"mén dān hù bó",昧旦晨兴:"mèi dàn chén xīng",冒名接脚:"mào míng jiē jiǎo",毛遂堕井:"máo suí duò jǐng",毛发倒竖:"máo fā dǎo shù",卖文为生:"mài wén wéi shēng",卖李钻核:"mài lǐ zuān hé",买椟还珠:"mǎi dú huán zhū",埋三怨四:"mán sān yuàn sì",马入华山:"mǎ rù huá shān",落魄江湖:"luò pò jiāng hú",落落难合:"luò luò nán hé",落草为寇:"luò cǎo wéi kòu",罗织构陷:"luó zhī gòu xiàn",鸾凤和鸣:"luán fèng hè míng",率由旧章:"shuài yóu jiù zhāng",率土同庆:"shuài tǔ tóng qìng",率兽食人:"shuài shòu shí rén",率土归心:"shuài tǔ guī xīn",率马以骥:"shuài mǎ yǐ jì",率尔成章:"shuài ěr chéng zhāng",鲁斤燕削:"lǔ jīn yàn xuē",漏尽更阑:"lòu jìn gēng lán",笼鸟槛猿:"lóng niǎo jiàn yuán",笼鸟池鱼:"lóng niǎo chí yú",龙游曲沼:"lóng yóu qū zhǎo",龙血玄黄:"lóng xuè xuán huáng",龙雕凤咀:"lóng diāo fèng jǔ",六尺之讬:"liù chǐ zhī tuō",令原之戚:"líng yuán zhī qī",令人捧腹:"lìng rén pěng fù",陵劲淬砺:"líng jìng cuì lì",临敌易将:"lín dí yì jiàng",裂裳衣疮:"liè shang yī chuāng",裂冠毁冕:"liè guàn huǐ miǎn",了无惧色:"liǎo wú jù sè",了身达命:"liǎo shēn dá mìng",了然无闻:"liǎo rán wú wén",了不可见:"liǎo bù kě jiàn",了不长进:"liǎo bù zhǎng jìn",燎发摧枯:"liǎo fà cuī kū",审时度势:"shěn shí duó shì",量小力微:"liàng xiǎo lì wēi",相时度力:"xiāng shí duó lì",量枘制凿:"liàng ruì zhì záo",量如江海:"liàng rú jiāng hǎi",量金买赋:"liàng jīn mǎi fù",量己审分:"liàng jǐ shěn fēn",敛骨吹魂:"liǎn gǔ chuī hún",詈夷为跖:"lì yí wéi zhí",利令志惛:"lì lìng zhì hūn",李广不侯:"lǐ guǎng bú hòu",礼为情貌:"lǐ wéi qíng mào",礼让为国:"lǐ ràng wéi guó",犁生骍角:"lí shēng xīng jiǎo",离本徼末:"lí běn jiǎo mò",楞眉横眼:"léng méi hèng yǎn",擂天倒地:"léi tiān dǎo dì",累足成步:"lěi zú chéng bù",累瓦结绳:"lěi wǎ jié shéng",累土至山:"lěi tǔ zhì shān",累土聚沙:"lěi tǔ jù shā",累卵之危:"lěi luǎn zhī wēi",累累如珠:"lěi lěi rú zhū",累块积苏:"lěi kuài jī sū",乐山乐水:"lè shān lè shuǐ",潦原浸天:"lǎo yuán jìn tiān",老师宿儒:"lǎo shī xiǔ rú",牢什古子:"láo shí gǔ zi",琅嬛福地:"láng huán fú dì",揆情度理:"kuí qíng duó lǐ",旷日累时:"kuàng rì lěi shí",匡救弥缝:"kuāng jiù mí fèng",枯树生华:"kū shù shēng huā",口轻舌薄:"kǒu qīng shé bó",口角生风:"kǒu jiǎo shēng fēng",口角春风:"kǒu jiǎo chūn fēng",口角风情:"kǒu jiǎo fēng qíng",口干舌焦:"kǒu gān shé jiāo",口腹之累:"kǒu fù zhī lěi",空腹便便:"kōng fù pián pián",嗑牙料嘴:"kē yá liào zuǐ",刻木为鹄:"kè mù wéi hú",咳珠唾玉:"ké zhū tuò yù",咳唾成珠:"ké tuò chéng zhū",抗颜为师:"kàng yán wéi shī",开华结果:"kāi huā jié guǒ",峻阪盐车:"jùn bǎn yán chē",嚼铁咀金:"jiáo tiě jǔ jīn",嚼墨喷纸:"jué mò pēn zhǐ",倔头强脑:"juè tóu jiàng nǎo",倔头倔脑:"juè tóu juè nǎo",倦鸟知还:"juàn niǎo zhī huán",卷席而葬:"juǎn xí ér zàng",卷甲倍道:"juǎn jiǎ bèi dào",聚米为山:"jù mǐ wéi shān",举手相庆:"jǔ shǒu xiāng qìng",举世混浊:"jǔ shì hún zhuó",鞠为茂草:"jū wéi mào cǎo",拘神遣将:"jū shén qiǎn jiàng",居下讪上:"jū xià shàn shàng",久要不忘:"jiǔ yāo bú wàng",九转功成:"jiǔ zhuǎn gōng chéng",九蒸三熯:"jiǔ zhēng sān hàn",敬业乐群:"jìng yè lè qún",井底虾蟆:"jǐng dǐ xiā má",旌旗卷舒:"jīng qí juǎn shū",荆棘载途:"jīng jí zài tú",禁舍开塞:"jìn shě kāi sāi",祲威盛容:"jìn wēi shèng róng",进退消长:"jìn tuì xiāo cháng",进退应矩:"jìn tuì yīng jǔ",进退触籓:"jìn tuì chù fān",进退跋疐:"jìn tuì bá zhì",尽多尽少:"jǐn duō jǐn shǎo",锦囊还矢:"jǐn náng huán shǐ",矜己自饰:"jīn jǐ zì shì",矜功负气:"jīn gōng fù qì",津关险塞:"jīn guān xiǎn sài",金吾不禁:"jīn wú bú jìn",金翅擘海:"jīn chì bāi hǎi",解衣衣人:"jiě yī yī rén",解人难得:"jiě rén nán dé",解铃系铃:"jiě líng xì líng",解发佯狂:"jiě fà yáng kuáng",诘屈磝碻:"jié qū áo qiāo",教猱升木:"jiāo náo shēng mù",较瘦量肥:"jiào shòu liàng féi",角立杰出:"jiǎo lì jié chū",焦沙烂石:"jiāo shā làn shí",骄儿騃女:"jiāo ér sì nǚ",浇风薄俗:"jiāo fēng bó sú",降妖捉怪:"xiáng yāo zhuō guài",将取固予:"jiāng qǔ gù yǔ",将门有将:"jiàng mén yǒu jiàng",将夺固与:"jiāng duó gù yǔ",槛花笼鹤:"jiàn huā lóng hè",鉴影度形:"jiàn yǐng duó xíng",渐不可长:"jiàn bù kě zhǎng",见素抱朴:"xiàn sù bào pǔ",见弃于人:"jiàn qì yú rén",简丝数米:"jiǎn sī shǔ mǐ",俭不中礼:"jiǎn bú zhòng lǐ",间见层出:"jiàn xiàn céng chū",尖嘴薄舌:"jiān zuǐ bó shé",甲冠天下:"jiǎ guàn tiān xià",葭莩之亲:"jiā fú zhī qīn",家累千金:"jiā lèi qiān jīn",家给人足:"jiā jǐ rén zú",家道从容:"jiā dào cóng róng",夹袋人物:"jiā dài rén wù",霁风朗月:"jì fēng lǎng yuè",寄兴寓情:"jì xìng yù qíng",计深虑远:"jì shēn lǜ yuǎn",计功量罪:"jì gōng liàng zuì",掎裳连襼:"jǐ shang lián yì",虮虱相吊:"jǐ shī xiāng diào",疾不可为:"jí bù kě wéi",极深研几:"jí shēn yán jī",及宾有鱼:"jí bīn yǒu yú",激薄停浇:"jī bó tíng jiāo",积素累旧:"jī sù lěi jiù",积时累日:"jī shí lěi rì",积露为波:"jī lù wéi bō",积德累功:"jī dé lěi gōng",积谗糜骨:"jī chán méi gǔ",击排冒没:"jī pái mào mò",祸为福先:"huò wéi fú xiān",祸福相依:"huò fú xiāng yī",获隽公车:"huò jùn gōng chē",混应滥应:"hùn yīng làn yīng",毁舟为杕:"huǐ zhōu wéi duò",毁钟为铎:"huǐ zhōng wéi duó",毁冠裂裳:"huǐ guān liè cháng",晦盲否塞:"huì máng pǐ sè",回船转舵:"huí chuán zhuàn duò",潢池盗弄:"huáng chí dào nòng",黄冠草履:"huáng guàn cǎo lǚ",黄发儿齿:"huáng fà ér chǐ",黄发垂髫:"huáng fà chuí tiáo",还珠返璧:"huán zhū fǎn bì",还年驻色:"huán nián zhù sè",还年却老:"huán nián què lǎo",坏裳为裤:"huài shang wéi kù",画荻和丸:"huà dí huò wán",化枭为鸠:"huà xiāo wéi jiū",化腐为奇:"huà fǔ wéi qí",化鸱为凤:"huà chī wéi fèng",花不棱登:"huā bu lēng dēng",户限为穿:"hù xiàn wéi chuān",呼卢喝雉:"hū lú hè zhì",呼来喝去:"hū lái hè qù",呼不给吸:"hū bù jǐ xī",厚味腊毒:"hòu wèi xī dú",厚德载物:"hòu dé zài wù",鸿渐于干:"hóng jiàn yú gàn",洪炉燎发:"hóng lú liáo fà",红绳系足:"hóng shéng jì zú",红不棱登:"hóng bu lēng dēng",横抢硬夺:"hèng qiǎng yìng duó",横恩滥赏:"hèng ēn làn shǎng",恨海难填:"hèn hǎi nán tián",鹤发鸡皮:"hè fà jī pí",涸思干虑:"hé sī gān lǜ",河涸海干:"hé hé hǎi gān",和颜说色:"hé yán yuè sè",合从连衡:"hé zòng lián héng",浩浩汤汤:"hào hào shāng shāng",好勇斗狠:"hào yǒng dòu hěn",好问则裕:"hào wèn zé yù",好为事端:"hào wéi shì duān",好问决疑:"hào wèn jué yí",好生之德:"hào shēng zhī dé",好奇尚异:"hǎo qí shàng yì",好恶不同:"hǎo è bù tóng",好丹非素:"hào dān fēi sù",豪干暴取:"háo gàn bào qǔ",毫发不爽:"háo fà bù shuǎng",寒酸落魄:"hán suān luò pò",含英咀华:"hán yīng jǔ huá",含糊不明:"hán hú bù míng",过为已甚:"guò wéi yǐ shèn",桂折兰摧:"guì shé lán cuī",规旋矩折:"guī xuán jǔ shé",广文先生:"guǎng wén xiān sheng",广陵散绝:"guǎng líng sǎn jué",冠山戴粒:"guàn shān dài lì",冠屦倒施:"guàn jù dǎo shī",挂席为门:"guà xí wéi mén",寡见鲜闻:"guǎ jiàn xiǎn wén",瓜葛相连:"guā gé xiāng lián",鼓吻奋爪:"gǔ wěn fèn zhǎo",古调单弹:"gǔ diào dān tán",古调不弹:"gǔ diào bù tán",姑射神人:"gū yè shén rén",苟合取容:"gǒu hé qǔ róng",狗续侯冠:"gǒu xù hòu guàn",钩爪锯牙:"gōu zhǎo jù yá",共枝别干:"gòng zhī bié gàn",共为唇齿:"gòng wéi chún chǐ",拱手而降:"gǒng shǒu ér xiáng",拱肩缩背:"gǒng jiān suō bèi",功薄蝉翼:"gōng bó chán yì",弓调马服:"gōng diào mǎ fú",更姓改物:"gēng xìng gǎi wù",更仆难数:"gēng pú nán shǔ",更令明号:"gēng lìng míng hào",更待干罢:"gèng dài gàn bà",更唱迭和:"gēng chàng dié hé",更长梦短:"gēng cháng mèng duǎn",各色名样:"gè sè míng yàng",格格不纳:"gé gé bú nà",格格不吐:"gé gé bù tǔ",告朔饩羊:"gù shuò xì yáng",膏车秣马:"gào chē mò mǎ",高义薄云:"gāo yì bó yún",岗头泽底:"gāng tóu zé dǐ",敢为敢做:"gǎn wéi gǎn zuò",甘分随时:"gān fèn suí shí",甘处下流:"gān chǔ xià liú",干啼湿哭:"gàn tí shī kū",干名犯义:"gàn míng fàn yì",干将莫邪:"gān jiāng mò yé",干城之将:"gān chéng zhī jiàng",腹载五车:"fù zài wǔ chē",父债子还:"fù zhài zǐ huán",父为子隐:"fù wéi zǐ yǐn",辅世长民:"fǔ shì zhǎng mín",福为祸始:"fú wéi huò shǐ",符号逻辑:"fú hào luó jí",浮收勒折:"fú shōu lè shé",肤受之愬:"fū shòu zhī sù",否终则泰:"pǐ zhōng zé tài",佛头著粪:"fó tóu zhuó fèn",奉为楷模:"fèng wéi kǎi mó",凤靡鸾吪:"fèng mǐ luán é",封豨修蛇:"fēng xī xiū shé",风影敷衍:"fēng yǐng fū yǎn",丰屋蔀家:"fēng wū bù jiā",粪土不如:"fèn tǔ bù rú",分风劈流:"fēn fēng pǐ liú",沸沸汤汤:"fèi fèi shāng shāng",菲食薄衣:"fěi shí bó yī",飞将数奇:"fēi jiàng shù qí",放辟邪侈:"fàng pì xié chǐ",方领圆冠:"fāng lǐng yuán guàn",犯而不校:"fàn ér bú jiào",返本还源:"fǎn běn huán yuán",反劳为逸:"fǎn láo wéi yì",法轮常转:"fǎ lún cháng zhuàn",罚不当罪:"fá bù dāng zuì",发引千钧:"fà yǐn qiān jūn",发奸擿伏:"fā jiān tī fú",发短心长:"fà duǎn xīn cháng",二竖为虐:"èr shù wéi nüè",儿女心肠:"ér nǚ xīn cháng",儿女亲家:"ér nǚ qìng jiā",遏恶扬善:"è wù yáng shàn",饿殍枕藉:"è piǎo zhěn jí",饿殍载道:"è piǎo zài dào",恶醉强酒:"wù zuì qiǎng jiǔ",恶意中伤:"è yì zhòng shāng",恶湿居下:"wù shī jū xià",恶居下流:"wù jū xià liú",恶不去善:"wù bú qù shàn",扼吭夺食:"è háng duó shí",扼襟控咽:"è jīn kòng yān",峨峨汤汤:"é é shāng shāng",屙金溺银:"ē jīn niào yín",朵颐大嚼:"duǒ yí dà jiáo",夺人所好:"duó rén suǒ hào",多言数穷:"duō yán shuò qióng",多文为富:"duō wén wéi fù",多端寡要:"duō duān guǎ yào",多财善贾:"duō cái shàn gǔ",遁世无闷:"dùn shì wú mèn",遁迹黄冠:"dùn jì huáng guàn",堆案盈几:"duī àn yíng jī",断还归宗:"duàn huán guī zōng",短见薄识:"duǎn jiàn bó shí",蠹居棊处:"dù jū qí chǔ",度己以绳:"duó jǐ yǐ shéng",杜默为诗:"dù mò wéi shī",杜鹃啼血:"dù juān tí xuè",笃近举远:"dǔ jìn jǔ yuǎn",独有千秋:"dú yǒu qiān qiū",读书得间:"dú shū dé jiàn",斗转参横:"dǒu zhuǎn shēn héng",兜肚连肠:"dōu dǔ lián cháng",洞见症结:"dòng jiàn zhèng jié",恫疑虚喝:"dòng yí xū hè",动中窾要:"dòng zhōng kuǎn yào",东鸣西应:"dōng míng xī yīng",东鳞西爪:"dōng lín xī zhǎo",东量西折:"dōng liàng xī shé",东家西舍:"dōng jiā xī shè",东扯西拽:"dōng chě xī zhuāi",鼎铛有耳:"dǐng chēng yǒu ěr",鼎铛玉石:"dǐng chēng yù shí",钉头磷磷:"dīng tóu lín lín",跌宕不羁:"diē dàng bù jī",跌弹斑鸠:"diē dàn bān jiū",雕心雁爪:"diāo xīn yàn zhǎo",颠倒衣裳:"diān dǎo yī cháng",德薄能鲜:"dé bó néng xiǎn",得马折足:"dé mǎ shé zú",蹈其覆辙:"dǎo qí fù zhé",捣虚撇抗:"dǎo xū piē kàng",倒载干戈:"dào zài gān gē",倒裳索领:"dào cháng suǒ lǐng",倒果为因:"dào guǒ wéi yīn",叨在知己:"tāo zài zhī jǐ",叨陪末座:"tāo péi mò zuò",党豺为虐:"dǎng chái wéi nüè",当轴处中:"dāng zhóu chǔ zhōng",当着不着:"dāng zhuó bù zhuó",当务始终:"dāng wù shǐ zhōng",淡汝浓抹:"dàn rǔ nóng mǒ",弹丸脱手:"tán wán tuō shǒu",弹铗无鱼:"dàn jiá wú yú",箪食瓢饮:"dān sì piáo yǐn",大璞不完:"dà pú bù wán",大明法度:"dà míng fǎ dù",大车以载:"dà chē yǐ zài",打闷葫芦:"dǎ mèn hú lu",沓来踵至:"tà lái zhǒng zhì",厝火燎原:"cuò huǒ liǎo yuán",撮科打哄:"cuō kē dǎ hòng",寸积铢累:"cùn jī zhū lěi",啛啛喳喳:"cuì cuì chā chā",摧折豪强:"cuī zhé háo qiáng",摧刚为柔:"cuī gāng wéi róu",从俗就简:"cóng sú jiù jiǎn",此发彼应:"cǐ fā bǐ yīng",此唱彼和:"cǐ chàng bǐ hè",慈悲为本:"cí bēi wéi běn",纯属骗局:"chún shǔ piàn jú",春笋怒发:"chūn sǔn nù fā",垂头搨翼:"chuí tóu tà yì",传为笑谈:"chuán wéi xiào tán",传风扇火:"chuán fēng shān huǒ",穿红着绿:"chuān hóng zhuó lǜ",触处机来:"chù chǔ jī lái",处尊居显:"chǔ zūn jū xiǎn",处堂燕雀:"chǔ táng yàn què",处实效功:"chǔ shí xiào gōng",处高临深:"chǔ gāo lín shēn",出入无间:"chū rù wú jiān",出门应辙:"chū mén yīng zhé",出处语默:"chū chǔ yǔ mò",出处殊途:"chū chǔ shū tú",出处进退:"chū chǔ jìn tuì",愁山闷海:"chóu shān mèn hǎi",冲冠眦裂:"chōng guàn zì liè",齿牙为祸:"chǐ yá wéi huò",尺二冤家:"chǐ èr yuān jia",尺短寸长:"chǐ duǎn cùn cháng",尺寸之功:"chǐ cùn zhī gōng",城北徐公:"chéng běi xú gōng",成败兴废:"chéng bài xīng fèi",趁水和泥:"chèn shuǐ huò ní",称雨道晴:"chēng yǔ dào qíng",称体载衣:"chēng tǐ zài yī",称体裁衣:"chèn tǐ cái yī",称家有无:"chèn jiā yǒu wú",称德度功:"chēng dé duó gōng",沉吟章句:"chén yín zhāng jù",沉吟不决:"chén yín bù jué",沉疴宿疾:"chén kē sù jí",扯纤拉烟:"chě qiàn lā yān",扯顺风旗:"chě shùn fēng qí",车载船装:"chē zǎi chuán zhuāng",朝升暮合:"zhāo shēng mù gě",朝攀暮折:"zhāo pān mù shé",超今冠古:"chāo jīn guàn gǔ",倡而不和:"chàng ér bú hè",畅所欲为:"chàng suǒ yù wéi",苌弘碧血:"cháng hóng bì xiě",长幼尊卑:"zhǎng yòu zūn bēi",长绳系日:"cháng shéng jì rì",长年三老:"zhǎng nián sān lǎo",长春不老:"cháng chūn bù lǎo",长傲饰非:"zhǎng ào shì fēi",昌亭旅食:"chāng tíng lǚ shí",禅絮沾泥:"chán xù zhān ní",差三错四:"chā sān cuò sì",层台累榭:"céng tái lěi xiè",层见迭出:"céng xiàn dié chū",藏踪蹑迹:"cáng zōng niè jì",苍蝇见血:"cāng yíng jiàn xiě",餐松啖柏:"cān sōng dàn bó",骖风驷霞:"cān fēng sì xiá",参伍错综:"cēn wǔ cuò zōng",参辰卯酉:"shēn chén mǎo yǒu",材优干济:"cái yōu gān jǐ",材薄质衰:"cái bó zhì shuāi",才大难用:"cái dà nán yòng",才薄智浅:"cái bó zhì qiǎn",不足为意:"bù zú wéi yì",不足为据:"bù zú wéi jù",不足为法:"bù zú wéi fǎ",不足齿数:"bù zú chǐ shǔ",不着疼热:"bù zhuó téng rè",不知薡蕫:"bù zhī dǐng dǒng",不越雷池:"bú yuè léi chí",不相为谋:"bù xiāng wéi móu",不贪为宝:"bù tān wéi bǎo",不了而了:"bù liǎo ér liǎo",不可揆度:"bù kě kuí duó",不遑启处:"bù huáng qǐ chǔ",不当不正:"bù dāng bú zhèng",不差什么:"bú chà shén me",不差累黍:"bù chā lěi shǔ",擘两分星:"bò liǎng fēn xīng",簸土扬沙:"bǒ tǔ yáng shā",薄物细故:"bó wù xì gù",薄寒中人:"bó hán zhòng rén",博文约礼:"bó wén yuē lǐ",播糠眯目:"bō kāng mí mù",剥皮抽筋:"bō pí chōu jīn",剥肤椎髓:"bō fū chuí suǐ",波属云委:"bō zhǔ yún wěi",波骇云属:"bō hài yún zhǔ",兵微将寡:"bīng wēi jiàng guǎ",兵强将勇:"bīng qiáng jiàng yǒng",兵多将广:"bīng duō jiàng guǎng",兵不由将:"bīng bù yóu jiàng",冰解的破:"bīng jiě dì pò",彬彬济济:"bīn bīn jǐ jǐ",摽梅之年:"biào méi zhī nián",表里为奸:"biǎo lǐ wéi jiān",飙发电举:"biāo fā diàn jǔ",变贪厉薄:"biàn tān lì bó",敝盖不弃:"bì gài bú qì",秕言谬说:"bǐ yán miù shuō",比物属事:"bǐ wù zhǔ shì",被山带河:"pī shān dài hé",被甲枕戈:"pī jiǎ zhěn gē",被甲据鞍:"pī jiǎ jù ān",被褐怀玉:"pī hè huái yù",被发缨冠:"pī fà yīng guàn",背曲腰躬:"bèi qǔ yāo gōng",北窗高卧:"běi chuāng gāo wò",北辰星拱:"běi chén xīng gǒng",北鄙之音:"běi bǐ zhī yīn",卑宫菲食:"bēi gōng fěi shí",暴衣露冠:"pù yī lù guàn",暴腮龙门:"pù sāi lóng mén",暴露文学:"bào lù wén xué",暴虎冯河:"bào hǔ píng hé",抱蔓摘瓜:"bào wàn zhāi guā",抱法处势:"bào fǎ chǔ shì",褒贬与夺:"bāo biǎn yǔ duó",帮闲钻懒:"bāng xián zuān lǎn",拜将封侯:"bài jiàng fēng hóu",百兽率舞:"bǎi shòu shuài wǔ",百孔千创:"bǎi kǒng qiān chuāng",白衣卿相:"bái yī qīng xiàng",白首为郎:"bái shǒu wéi láng",白首相知:"bái shǒu xiāng zhī",把玩无厌:"bǎ wán wú yàn",拔锅卷席:"bá guō juǎn xí",拔本塞源:"bá běn sè yuán",傲不可长:"ào bù kě zhǎng",熬更守夜:"áo gēng shǒu yè",安时处顺:"ān shí chǔ shùn",安身为乐:"ān shēn wéi lè",安老怀少:"ān lǎo huái shào",安步当车:"ān bù dàng chē",爱人好士:"ài rén hào shì",矮人观场:"ǎi rén guān chǎng",捱风缉缝:"ái fēng jī fèng",挨山塞海:"āi shān sè hǎi",阿家阿翁:"ā jiā ā wēng",阿党相为:"ē dǎng xiāng wéi",追亡逐北:"zhuī wáng zhú běi",竹篮打水:"zhú lán dá shuǐ",知疼着热:"zhī téng zháo rè",语不惊人:"yǔ bù jīng rén",于今为烈:"yú jīn wéi liè",一日三省:"yí rì sān xǐng",穴居野处:"xué jū yě chǔ",五脊六兽:"wǔ jǐ liù shòu",无声无臭:"wú shēng wú xiù",谓予不信:"wèi yú bú xìn",舍身为国:"shě shēn wéi guó",杀妻求将:"shā qī qiú jiàng",强作解人:"qiǎng zuò jiě rén",气冲斗牛:"qì chōng dǒu niú",临深履薄:"lín shēn lǚ bó",钧天广乐:"jūn tiān guǎng yuè",艰难竭蹶:"jiān nán jié jué",夹七夹八:"jiā qī jiā bā",混混噩噩:"hún hún è è",厚古薄今:"hòu gǔ bó jīn",鬼怕恶人:"guǐ pà è rén",伽马射线:"gā mǎ shè xiàn",佛头着粪:"fó tóu zhuó fèn",奉为至宝:"fèng wéi zhì bǎo",登坛拜将:"dēng tán bài jiàng",晨昏定省:"chén hūn dìng xǐng",察察为明:"chá chá wéi míng",博闻强识:"bó wén qiáng zhì",避难就易:"bì nán jiù yì",了无生机:"liǎo wú shēng jī",有一说一:"yǒu yī shuō yī",独一无二:"dú yī wú èr",说一不二:"shuō yī bù èr",举一反三:"jǔ yī fǎn sān",数一数二:"shǔ yī shǔ èr",杀一儆百:"shā yī jǐng bǎi",丁一卯二:"dīng yī mǎo èr",丁一确二:"dīng yī què èr",不一而止:"bù yī ér zhǐ",无一幸免:"wú yī xìng miǎn",表里不一:"biǎo lǐ bù yī",良莠不一:"liáng yǒu bù yī",心口不一:"xīn kǒu bù yī",言行不一:"yán xíng bù yī",政令不一:"zhèng lìng bù yī",参差不一:"cēn cī bù yī",纷纷不一:"fēn fēn bù yī",毁誉不一:"huǐ yù bù yī",不一而三:"bù yī ér sān",百不一遇:"bǎi bù yī yù",言行抱一:"yán xíng bào yī",瑜百瑕一:"yú bǎi xiá yī",背城借一:"bèi chéng jiè yī",凭城借一:"píng chéng jiè yī",劝百讽一:"quàn bǎi fěng yī",群居和一:"qún jū hé yī",百不获一:"bǎi bù huò yī",百不失一:"bǎi bù shī yī",百无失一:"bǎi wú shī yī",万不失一:"wàn bù shī yī",万无失一:"wàn wú shī yī",合而为一:"hé ér wéi yī",合两为一:"hé liǎng wéi yī",合二为一:"hé èr wéi yī",天下为一:"tiān xià wéi yī",相与为一:"xiāng yǔ wéi yī",较若画一:"jiào ruò huà yī",较如画一:"jiào rú huà yī",斠若画一:"jiào ruò huà yī",言行若一:"yán xíng ruò yī",始终若一:"shǐ zhōng ruò yī",终始若一:"zhōng shǐ ruò yī",惟精惟一:"wéi jīng wéi yī",众多非一:"zhòng duō fēi yī",不能赞一:"bù néng zàn yī",问一答十:"wèn yī dá shí",一不扭众:"yī bù niǔ zhòng",一以贯之:"yī yǐ guàn zhī",一以当百:"yī yǐ dāng bǎi",百不当一:"bǎi bù dāng yī",十不当一:"shí bù dāng yī",以一警百:"yǐ yī jǐng bǎi",以一奉百:"yǐ yī fèng bǎi",以一持万:"yǐ yī chí wàn",以一知万:"yǐ yī zhī wàn",百里挑一:"bǎi lǐ tiāo yī",整齐划一:"zhěng qí huà yī",一来二去:"yī lái èr qù",一路公交:"yī lù gōng jiāo",一路汽车:"yī lù qì chē",一路巴士:"yī lù bā shì",朝朝朝落:"zhāo cháo zhāo luò",曲意逢迎:"qū yì féng yíng",一行不行:"yì háng bù xíng",行行不行:"háng háng bù xíng"},qde=Object.keys(zL).map(e=>({zh:e,pinyin:zL[e],probability:2e-8,length:4,priority:Cl.Normal,dict:Symbol("dict4")})),jL={巴尔干半岛:"bā ěr gàn bàn dǎo",巴尔喀什湖:"bā ěr kā shí hú",不幸而言中:"bú xìng ér yán zhòng",布尔什维克:"bù ěr shí wéi kè",何乐而不为:"hé lè ér bù wéi",苛政猛于虎:"kē zhèng měng yú hǔ",蒙得维的亚:"méng dé wéi dì yà",民以食为天:"mín yǐ shí wéi tiān",事后诸葛亮:"shì hòu zhū gě liàng",物以稀为贵:"wù yǐ xī wéi guì",先下手为强:"xiān xià shǒu wéi qiáng",行行出状元:"háng háng chū zhuàng yuan",亚得里亚海:"yà dé lǐ yà hǎi",眼不见为净:"yǎn bú jiàn wéi jìng",竹筒倒豆子:"zhú tǒng dào dòu zi"},Ude=Object.keys(jL).map(e=>({zh:e,pinyin:jL[e],probability:2e-8,length:5,priority:Cl.Normal,dict:Symbol("dict5")}));function HL(e,t){return e&&(e.decimalt.probability)?e:t}function WL(e){e.probability<1e-300&&(e.probability*=1e300,e.decimal+=1)}function Vde(e){return e.priority===Cl.Custom?-(e.length*e.length*100):e.priority===Cl.Surname?-(e.length*e.length*10):0}function Kde(e,t){const n=[];let i=e.length-1,o=e[i];for(let s=t-1;s>=0;s--){const r=s+1>=t?{probability:1,decimal:0,patterns:[]}:n[s+1];for(;o&&o.index+o.length-1===s;){const l=o.index,u={probability:o.probability*r.probability,decimal:r.decimal+Vde(o),patterns:r.patterns,concatPattern:o};WL(u),n[l]=HL(n[l],u),o=e[--i]}const a={probability:1e-13*r.probability,decimal:0,patterns:r.patterns};WL(a),n[s]=HL(n[s],a),n[s].concatPattern&&(n[s].patterns=n[s].patterns.concat(n[s].concatPattern),n[s].concatPattern=void 0,delete n[s+1])}return n[0].patterns.reverse()}function qL(e,t){return e&&e.count<=t.count?e:t}function Zde(e){return e.priority===Cl.Custom?-(e.length*e.length*1e5):e.priority===Cl.Surname?-(e.length*e.length*100):1}function Gde(e,t){const n=[];let i=e.length-1,o=e[i];for(let s=t-1;s>=0;s--){const r=s+1>=t?{count:0,patterns:[]}:n[s+1];for(;o&&o.index+o.length-1===s;){const l=o.index,u={count:Zde(o)+r.count,patterns:r.patterns,concatPattern:o};n[l]=qL(n[l],u),o=e[--i]}const a={count:1+r.count,patterns:r.patterns};n[s]=qL(n[s],a),n[s].concatPattern&&(n[s].patterns=n[s].patterns.concat(n[s].concatPattern),n[s].concatPattern=void 0,delete n[s+1])}return n[0].patterns.reverse()}function Qde(e,t){return!(t.index+t.length<=e.index||t.priority>e.priority||t.priority===e.priority&&t.length>e.length)}function Yde(e){const t=[];for(let n=e.length-1;n>=0;){const{index:i}=e[n];let o=n-1;for(;o>=0&&Qde(e[n],e[o]);)o--;(o<0||e[o].index+e[o].length<=i)&&t.push(e[n]),n=o}return t.reverse()}var UL;(function(e){e[e.ReverseMaxMatch=1]="ReverseMaxMatch",e[e.MaxProbability=2]="MaxProbability",e[e.MinTokenization=3]="MinTokenization"})(UL||(UL={}));class VL{constructor(t,n="",i=""){this.children=new Map,this.fail=null,this.patterns=[],this.parent=t,this.prefix=n,this.key=i}}class Jde{constructor(){this.dictMap=new Map,this.queues=[],this.root=new VL(null)}build(t){this.buildTrie(t),this.buildFailPointer()}buildTrie(t){for(let n of t){const i=f6(n.zh);let o=this.root;for(let s=0;s{t=t.concat(i)}),this.queues=[];t.length>n;){let i=t[n++],o=i.parent&&i.parent.fail,s=i.key;for(;o&&!o.children.has(s);)o=o.fail;o?i.fail=o.children.get(s):i.fail=this.root}}addPatternToDictMap(t){this.dictMap.has(t.dict)||this.dictMap.set(t.dict,new Set),this.dictMap.get(t.dict).add(t)}addNodeToQueues(t){this.queues[Mu(t.prefix)]||(this.queues[Mu(t.prefix)]=[]),this.queues[Mu(t.prefix)].push(t)}insertPattern(t,n){for(let i=t.length-1;i>=0;i--){const o=t[i];if(n.priority===o.priority&&n.probability>=o.probability)t[i+1]=o;else if(n.priority>o.priority)t[i+1]=o;else{t[i+1]=n;return}}t[0]=n}removeDict(t){this.dictMap.has(t)&&(this.dictMap.get(t).forEach(i=>{i.node.patterns=i.node.patterns.filter(o=>o!==i)}),this.dictMap.delete(t))}match(t,n){let i=this.root,o=[];const s=f6(t);for(let r=0;rn==="off"?c.priority!==Cl.Surname:n==="head"?c.length-1-r===0:!0);l&&o.push(Object.assign(Object.assign({},l),{index:r-l.length+1}));let u=i.fail;for(;u!==null;){const c=u.patterns.find(d=>n==="off"?d.priority!==Cl.Surname:n==="head"?d.length-1-r===0:!0);c&&o.push(Object.assign(Object.assign({},c),{index:r-c.length+1})),u=u.fail}}}return o}search(t,n,i=2){const o=this.match(t,n);return i===1?Yde(o):i===3?Gde(o,Mu(t)):Kde(o,Mu(t))}}const Xde=[...Ude,...qde,...Wde,...Hde,...Bde,...jde],bW=new Jde;bW.build(Xde);const efe=new yW,tfe=()=>efe,nfe=[];function ife(){return nfe}const $0=e=>{const t=Kf.get(e);return t?t.split(" ")[0]:e},ofe=e=>{const t=[],n=ife();for(let i=0;i{const s=o?ofe(e):e,r=bW.search(s,n,i);let a=0;const l=f6(e);for(let u=0;ue.replace(/(ā|á|ǎ|à)/g,"a").replace(/(ō|ó|ǒ|ò)/g,"o").replace(/(ē|é|ě|è)/g,"e").replace(/(ī|í|ǐ|ì)/g,"i").replace(/(ū|ú|ǔ|ù)/g,"u").replace(/(ǖ|ǘ|ǚ|ǜ)/g,"ü").replace(/(n̄|ń|ň|ǹ)/g,"n").replace(/(m̄|ḿ|m̌|m̀)/g,"m").replace(/(ê̄|ế|ê̌|ề)/g,"ê"),wW=(e,t="off")=>{const n=tfe();let i=Kf.get(e)?Kf.get(e).split(" "):[];if(n.get(e))i=n.get(e).split(" ");else if(t!=="off"){const o=h6[e];o&&(i=[o].concat(i.filter(s=>s!==o)))}return i},rfe=(e,t="off")=>{let n=wW(e,t);return n.length>0?n.map(i=>({origin:e,result:i,isZh:!0,originPinyin:i})):[{origin:e,result:e,isZh:!1,originPinyin:e}]},Hb=(e,t)=>{const n=e.split(" "),i=[],o=[];for(let s of n)for(let r of Nde)if(s.startsWith(r)){let a=s.slice(r.length);Fde.indexOf(r)!==-1&&Rde.indexOf(a)!==-1&&(a=Dde[a]),i.push(r),o.push(a);break}return t==="standard"&&i.forEach((s,r)=>{(s==="y"||s==="w")&&(i[r]="")}),{final:o.join(" "),initial:i.join(" ")}},Ak=e=>{const{final:t}=Hb(e);let n="",i="",o="";return Ode.indexOf(Ow(t))!==-1?(n=t[0],i=t[1],o=t.slice(2)):(i=t[0]||"",o=t.slice(1)||""),{head:n,body:i,tail:o}},Pw=e=>{const t=/(ā|ō|ē|ī|ū|ǖ|n̄|m̄|ê̄)/,n=/(á|ó|é|í|ú|ǘ|ń|ḿ|ế)/,i=/(ǎ|ǒ|ě|ǐ|ǔ|ǚ|ň|m̌|ê̌)/,o=/(à|ò|è|ì|ù|ǜ|ǹ|m̀|ề)/,s=/(a|o|e|i|u|ü|ê)/,r=/(n|m)$/,a=[];return e.split(" ").forEach(u=>{t.test(u)?a.push("1"):n.test(u)?a.push("2"):i.test(u)?a.push("3"):o.test(u)?a.push("4"):s.test(u)||r.test(u)?a.push("0"):a.push("")}),a.join(" ")},afe=(e,t)=>{const n=Ow(e).split(" "),i=Pw(t).split(" "),o=[];return n.forEach((s,r)=>{o.push(`${s}${i[r]}`)}),o.join(" ")},AW=(e,t)=>{const n=[];return e.split(" ").forEach(o=>{n.push(t?o[0]:o)}),n.join(" ")};function lfe(e,t,n){if(zde.indexOf(e)===-1)return $0(e);if(t===n&&t&&$0(t)!==t)return Ow($0(e));if(n&&!$de[e].includes(n)){const i=$0(n);if(i!==n){const o=Pw(i),s=kW[e];for(let r in s)if(s[r].indexOf(Number(o))!==-1)return r}}}function ufe(e,t){if(e==="了"&&(!t||!Kf.get(t)))return"liǎo"}function cfe(e,t){if(e==="々")return!t||!Kf.get(t)?"tóng":Kf.get(t).split(" ")[0]}function KL(e,t,n){return cfe(e,t)||ufe(e,t)||lfe(e,t,n)||$0(e)}const dfe=e=>typeof e!="string"?(console.error("The first param of pinyin is error: "+e+' is not assignable to type "string".'),!1):!0;function V8(e,t){return t instanceof RegExp?t.test(e):!0}const ffe=(e,t)=>{let n=t.nonZh;if(n==="removed")return e.filter(i=>i.isZh||!V8(i.origin,t.nonZhScope));if(n==="consecutive"){for(let i=e.length-2;i>=0;i--){const o=e[i],s=e[i+1];!o.isZh&&!s.isZh&&V8(o.origin,t.nonZhScope)&&V8(s.origin,t.nonZhScope)&&(o.origin+=s.origin,o.result+=s.result,s.delete=!0)}return e.filter(i=>!i.delete)}else return e},ZL=(e,t)=>Mu(e)===1&&t.multiple?rfe(e,t.surname):!1,hfe=(e,t)=>{switch(t.pattern){case"pinyin":break;case"num":e.forEach(n=>{n.result=n.isZh?Pw(n.result):""});break;case"initial":e.forEach(n=>{n.result=n.isZh?Hb(n.result,t.initialPattern).initial:""});break;case"final":e.forEach(n=>{n.result=n.isZh?Hb(n.result,t.initialPattern).final:""});break;case"first":e.forEach(n=>{n.result=AW(n.result,n.isZh)});break;case"finalHead":e.forEach(n=>{n.result=n.isZh?Ak(n.result).head:""});break;case"finalBody":e.forEach(n=>{n.result=n.isZh?Ak(n.result).body:""});break;case"finalTail":e.forEach(n=>{n.result=n.isZh?Ak(n.result).tail:""});break}},pfe=(e,t)=>{switch(t.toneType){case"symbol":break;case"none":e.forEach(n=>{n.isZh&&(n.result=Ow(n.result))});break;case"num":{e.forEach(n=>{n.isZh&&(n.result=afe(n.result,n.originPinyin))});break}}},mfe=(e,t)=>{t.v&&e.forEach(n=>{n.isZh&&(n.result=n.result.replace(/ü/g,typeof t.v=="string"?t.v:"v"))})},gfe=(e,t,n)=>{if(t.multiple&&Mu(n)===1){let i="";e=e.filter(o=>{const s=o.result!==i;return i=o.result,s})}return t.type==="array"?e.map(i=>i.result):t.type==="all"?e.map(i=>{const o=i.isZh?i.result:"",{initial:s,final:r}=Hb(o,t.initialPattern),{head:a,body:l,tail:u}=Ak(o);let c=[];return o!==""&&(c=[o].concat(wW(i.origin,t.surname).filter(d=>d!==o))),{origin:i.origin,pinyin:o,initial:s,final:r,first:AW(i.result,i.isZh),finalHead:a,finalBody:l,finalTail:u,num:Number(Pw(i.originPinyin)),isZh:i.isZh,polyphonic:c,inZhRange:!!Kf.get(i.origin),result:i.result}}):e.map(i=>i.result).join(t.separator)},vfe=(e,t)=>(t===!1&&e.forEach(n=>{n.origin==="一"?n.result=n.originPinyin="yī":n.origin==="不"&&(n.result=n.originPinyin="bù")}),e),yfe={pattern:"pinyin",toneType:"symbol",type:"string",multiple:!1,mode:"normal",removeNonZh:!1,nonZh:"spaced",v:!1,separator:" ",toneSandhi:!0,segmentit:2};function Wb(e,t){if(t=Object.assign(Object.assign({},yfe),t||{}),!dfe(e))return e;if(e==="")return t.type==="array"||t.type==="all"?[]:"";t.surname===void 0&&(t.mode==="surname"?t.surname="all":t.surname="off"),t.type==="all"&&(t.pattern="pinyin"),t.pattern==="num"&&(t.toneType="none"),t.removeNonZh&&(t.nonZh="removed");let i=Array(Mu(e)),{list:o}=sfe(e,i,t.surname,t.segmentit,t.traditional);return o=vfe(o,t.toneSandhi),o=ffe(o,t),ZL(e,t)&&(o=ZL(e,t)),hfe(o,t),pfe(o,t),mfe(o,t),gfe(o,t,e)}var p6;(function(e){e[e.AllSegment=1]="AllSegment",e[e.AllArray=2]="AllArray",e[e.AllString=3]="AllString",e[e.PinyinSegment=4]="PinyinSegment",e[e.PinyinArray=5]="PinyinArray",e[e.PinyinString=6]="PinyinString",e[e.ZhSegment=7]="ZhSegment",e[e.ZhArray=8]="ZhArray",e[e.ZhString=9]="ZhString"})(p6||(p6={}));p6.AllSegment;const m6=[{name:"/new",desc:"commands.new.desc",noArgs:!0},{name:"/clear",desc:"commands.clear.desc",noArgs:!0},{name:"/login",desc:"commands.login.desc",noArgs:!0},{name:"/plan",desc:"commands.plan.desc"},{name:"/swarm",desc:"commands.swarm.desc"},{name:"/tower",desc:"commands.tower.desc"},{name:"/goal",desc:"commands.goal.desc"},{name:"/btw",desc:"commands.btw.desc",acceptsInput:!0},{name:"/compact",desc:"commands.compact.desc",acceptsInput:!0},{name:"/undo",desc:"commands.undo.desc",noArgs:!0},{name:"/fork",desc:"commands.fork.desc",noArgs:!0},{name:"/export",desc:"commands.export.desc",noArgs:!0},{name:"/status",desc:"commands.status.desc",noArgs:!0}];function g6(e){if(!e.startsWith("/"))return null;const t=e.indexOf(" ");return t===-1?{cmd:e,arg:""}:{cmd:e.slice(0,t),arg:e.slice(t+1)}}const Ec="skill:";function kfe(e,t){const n=e.find(r=>r.name===t);if(n!==void 0)return n;const i=`/${Ec}${t.slice(1)}`,o=e.find(r=>r.name===i);if(o!==void 0)return o;if(!t.startsWith(`/${Ec}`))return;const s=t.slice(1+Ec.length);if(!(s.length===0||s.includes(" ")))return e.find(r=>r.isSkill===!0&&Bw(r.name)===s)}function Bw(e){const t=e.startsWith("/")?e.slice(1):e;return t.startsWith(Ec)?t.slice(Ec.length):t}function bfe(e,t,n){for(const i of[`/${Ec}${t}`,`/${t}`]){if(e===i)return;if(e.startsWith(`${i} `))return e.slice(i.length+1).trim()||void 0}return(n??"").trim()||void 0}function CW(e=[],t){const n=t?.towerEnabled===!0?m6:m6.filter(o=>o.name!=="/tower"),i=e.map(o=>({name:o.source==="builtin"?`/${o.name}`:`/${Ec}${o.name}`,desc:o.description,isSkill:!0,acceptsInput:!0}));return[...n,...i]}const GL=new Map;function xW(e){let t=GL.get(e);if(!t){const n=Wb(e,{toneType:"none",type:"array"}),i=Wb(e,{pattern:"first",toneType:"none",type:"array"});t=wfe(e,n,i),GL.set(e,t)}return t}const QL={full:[],first:[],offsets:[],literal:[]};function wfe(e,t,n){if(t.length!==n.length)return QL;const i=[],o=[];let s=0;for(let r=0;r0&&e.slice(s,s+a.length).toLowerCase()===a.toLowerCase()?(o.push(!0),s+=a.length):(o.push(!1),s+=Array.from(e.slice(s))[0]?.length??0)}return i.push(s),s!==e.length?QL:{full:t,first:n,offsets:i,literal:o}}function v6(e,t,n,i){const o=e[t];let s=0,r=-1,a=-1,l=0,u=0;for(let f=0;f=0)return v6(i,"first",o,o+t.length);const s=i.full.join("").indexOf(t);if(!(s<0))return v6(i,"full",s,s+t.length)}function _fe(e,t,n){const i=e.trim().replace(/^\//,"").toLowerCase();if(i==="")return{};const o=xfe(t,i),s=Sfe(n,i);return{name:o?[o]:void 0,desc:s?[s]:void 0}}const Ife={keys:[{name:"name",weight:3},{name:"desc",weight:1},{name:"pinyinFull",weight:1},{name:"pinyinFirst",weight:1}],includeScore:!0,includeMatches:!0,ignoreLocation:!0,threshold:.4};function Mfe(e,t){const n=e.toLowerCase(),i=t.toLowerCase();return n===i?0:n.startsWith(i)?1:2}function JL(e){const t=[...e].sort((i,o)=>i[0]-o[0]),n=[];for(const i of t){const o=n[n.length-1];o&&i[0]<=o[1]?o[1]=Math.max(o[1],i[1]):n.push([...i])}return n}function Tfe(e,t){const n=[],i=[];for(const o of t??[])for(const[s,r]of o.indices)if(o.key==="name")n.push([s+1,r+2]);else if(o.key==="desc")i.push([s,r+1]);else if(o.key==="pinyinFirst"||o.key==="pinyinFull"){const a=v6(xW(e.desc),o.key==="pinyinFirst"?"first":"full",s,r+1);a&&i.push(a)}return{name:n.length>0?JL(n):void 0,desc:i.length>0?JL(i):void 0}}function Efe(e,t=m6,n=i=>i.desc){const i=e.trim().replace(/^\//,"");if(i==="")return t.map(s=>({item:s,ranges:{}}));const o=t.map((s,r)=>{const a=n(s),l=Afe(a);return{index:r,item:s,name:s.name.replace(/^\//,""),desc:a,pinyinFull:l.full,pinyinFirst:l.first}});return new Mde(o,Ife).search(i).map(({item:s,score:r,matches:a})=>({doc:s,score:r??1,rank:Mfe(s.name,i),ranges:Tfe(s,a)})).sort((s,r)=>s.rank!==r.rank?s.rank-r.rank:s.score!==r.score?s.score-r.score:s.doc.index-r.doc.index).map(({doc:s,ranges:r})=>({item:s.item,ranges:r}))}function Lfe(e){const t=e.trim();if(t.length<2)return t;const n=t[0];return(n==='"'||n==="'")&&t[t.length-1]===n?t.slice(1,-1).trim():t}function Nfe(e,t,n,i,o){const s=n-o-(t.right+i),r=t.left-i-o,a=e>s&&r>s,l=Math.min(e,a?r:s);return{left:a?t.left-i-l:t.right+i,maxWidth:l,flipped:a}}let Ffe=0;function XL(e,t){const n=++Ffe;return e.pendingSwarmBySession[t]=n,n}function MS(e,t,n){return n===void 0||e.pendingSwarmBySession[t]!==n?!1:(delete e.pendingSwarmBySession[t],!0)}function y6(e,t,n){e.pendingSwarmBySession[t]===void 0&&(e.swarmModeBySession[t]=n)}function eN(e,t){const n=new Set(e.map(u=>u.id)),i=t.filter(u=>u.kind==="subagent"&&!n.has(u.id));if(i.length===0)return e;const o=new Map(e.map(u=>[u.id,u])),s=new Map(e.filter(u=>u.kind==="subagent"&&u.agentId!==void 0).map(u=>[u.agentId,u])),r=new Set,a=i.map(u=>{const c=u.backgroundTaskId!==void 0?o.get(u.backgroundTaskId):void 0,d=s.get(u.agentId??u.id),f=(d?.status==="running"&&c?.status!=="running"?d:c)??d;if(f===void 0)return u;r.add(f.id);const h=u.status==="running"&&f.status!=="running";return{...u,status:u.status==="running"?f.status:u.status,subagentPhase:h?f.status==="completed"?"completed":"failed":u.subagentPhase,completedAt:f.completedAt??u.completedAt,completedAtEstimated:f.completedAt!==void 0?void 0:u.completedAtEstimated,outputPreview:f.outputPreview??u.outputPreview,outputBytes:f.outputBytes??u.outputBytes,model:u.model??f.model,thinkingEffort:u.thinkingEffort??f.thinkingEffort,backgroundTaskId:f.id}});return[...e.filter(u=>!r.has(u.id)),...a]}const Rfe="Report the current tower status: call TowerStatus and give a compact summary.",Dfe="Tear down the tower: call TowerTeardown and report what it did. It refuses to destroy dirty worktrees unless forced.";let Ofe=0;function k6(e,t){const n=++Ofe;return e.pendingTowerBySession[t]=n,n}function TS(e,t,n){return n===void 0||e.pendingTowerBySession[t]!==n?!1:(delete e.pendingTowerBySession[t],!0)}function b6(e,t,n){e.pendingTowerBySession[t]===void 0&&(e.towerModeBySession[t]=n)}function Pfe(){if(typeof navigator>"u")return!1;if(/Mac|iPod|iPhone|iPad/.test(navigator.platform))return!0;const e=navigator.userAgentData;return e?.platform==="macOS"||e?.platform==="iOS"}function Bfe(e,t=Pfe()){return(t?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey)&&!e.altKey&&!e.shiftKey&&(e.code==="KeyF"||e.key.toLowerCase()==="f")&&!e.defaultPrevented}const $fe=new Map([["ς","σ"],["ß","ss"],["ſ","s"],["ff","ff"],["fi","fi"],["fl","fl"],["ffi","ffi"],["ffl","ffl"],["ſt","st"],["st","st"],["ʼn","ʼn"],["µ","μ"],["K","k"],["Å","å"],["Ω","ω"]]);function zfe(e){return e==="pre"||e==="pre-wrap"||e==="break-spaces"?"preserve":e==="pre-line"?"pre-line":"collapse"}function jfe(e,t){if(t==="preserve")return{text:e,map:Array.from({length:e.length},(r,a)=>a)};const n=t==="collapse"?/[\t\n\f\r ]/:/[\t ]/;let i="";const o=[];let s=!1;for(let r=0;rtN(c.text)),i="\0";let o="";const s=[];for(let c=0;c0&&e[c].gapBefore&&(o+=i),s[c]=o.length,o+=n[c].folded;const r=qfe(tN(t).folded);if(r===null)return;const a=new RegExp(r,"g");function l(c){let d=0,f=s.length-1,h=0;for(;d<=f;){const m=d+f>>1;s[m]<=c?(h=m,d=m+1):f=m-1}return h}let u;for(;;){const c=a.exec(o);if(c===null)return;const d=c.index,f=d+c[0].length-1,h=l(d),m=l(f),g=n[h].map[d-s[h]],y=n[m].map[f-s[m]],b={startSeg:h,startOffset:g.start,endSeg:m,endOffset:y.start+y.length};u!==void 0&&u.startSeg===b.startSeg&&u.startOffset===b.startOffset&&u.endSeg===b.endSeg&&u.endOffset===b.endOffset||(u=b,yield b)}}const Wfe=/[.*+?^${}()|[\]\\]/g;function qfe(e){const t=[];let n=0;for(;n=Gfe)return{ranges:l,truncated:!0};l.push(f)}}return{ranges:l,truncated:!1}}const _W="kimi-transcript-search",w6="kimi-transcript-search-current";function IW(){return globalThis.CSS?.highlights??null}function K8(e,t){const n=IW(),i=globalThis.Highlight;if(!n||!i)return;if(e.length===0){A6();return}const o=new i;for(const r of e)o.add(r);n.set(_W,o);const s=e[t];if(s!==void 0){const r=new i;r.add(s),n.set(w6,r)}else n.delete(w6)}function A6(){const e=IW();e?.delete(_W),e?.delete(w6)}let MW=null;function Yfe(e){e!==null&&(MW=e)}let iN=0,u9=null;async function qb(e){const t=++iN,n=(async()=>{const o=await e();t===iN&&Yfe(o)})(),i=(async()=>{await n,u9!==null&&u9.seq>t&&await u9.promise})();return u9={seq:t,promise:i},i}let TW=null;function Jfe(e){TW=e}const Xfe=5e3;function ehe(e){return Promise.race([e(),new Promise(t=>{setTimeout(()=>t(null),Xfe)})])}function c9(){return`${MW==="global"?"https://www.kimi.ai":"https://www.kimi.com"}/code?from=${s1?"kimi_code_desktop":"kimi_code_web"}`}function J2(){const e=TW;if(e===null){window.open(c9(),"_blank","noopener");return}const t=()=>ehe(e);if(s1){qb(t).then(()=>{window.open(c9(),"_blank","noopener")});return}const n=window.open("","_blank");if(n===null){window.open(c9(),"_blank","noopener");return}try{n.opener=null}catch{}qb(t).then(()=>{try{n.location.href=c9()}catch{}})}function the(e,t,n){if(e.length===0)return null;const i=new Set(e),o=t.filter(r=>i.has(r)),s=e.filter(r=>!t.includes(r));return s.length===0&&o.length===t.length?null:t.length===0&&n!==void 0?s.toSorted((r,a)=>(n.get(a)??Number.NEGATIVE_INFINITY)-(n.get(r)??Number.NEGATIVE_INFINITY)):[...s,...o]}function nhe(e,t){const n=new Map(t.map((i,o)=>[i,o]));return e.toSorted((i,o)=>(n.get(i.id)??-1)-(n.get(o.id)??-1))}function ihe(e,t,n,i="before"){const o=e.indexOf(t),s=e.indexOf(n);if(o===-1||s===-1||o===s)return e;const r=[...e];r.splice(o,1);const a=o(t.get(i.id)??Number.NEGATIVE_INFINITY)-(t.get(n.id)??Number.NEGATIVE_INFINITY))}function she(e,t){let n=!1;const i={...e};for(const[o,s]of t)s>(i[o]??Number.NEGATIVE_INFINITY)&&(i[o]=s,n=!0);return{next:i,changed:n}}function rhe(e,t){const n=new Map;for(const i of e){if(i.parentSessionId||i.archived)continue;const o=new Date(i.updatedAt).getTime();if(Number.isNaN(o))continue;const s=t(i);o>(n.get(s)??Number.NEGATIVE_INFINITY)&&n.set(s,o)}return n}function ahe(e,t){const n=new Map;for(const i of e){const o=t[i.id]??Number.NEGATIVE_INFINITY,s=i.lastOpenedAt?Date.parse(i.lastOpenedAt):Number.NaN,r=Number.isNaN(s)?Number.NEGATIVE_INFINITY:s;n.set(i.id,Math.max(o,r))}return n}function lhe(e,t){const n=Object.keys(e);if(!n.some(o=>!t.has(o)))return{next:e,changed:!1};const i={};for(const o of n)t.has(o)&&(i[o]=e[o]);return{next:i,changed:!0}}const uhe=5;function che(e,t,n,i=uhe){if(e.length<=i)return e;const o=e.slice(0,i);if(t&&!o.some(s=>s.id===t)){const s=e.find(r=>r.id===t);s&&(o[i-1]=s)}return o}const dhe={class:"error-boundary-title"},fhe=ot({__name:"ErrorBoundary",props:{closable:{type:Boolean,default:!1},fullscreen:{type:Boolean,default:!1}},emits:["close"],setup(e,{emit:t}){const n=t,{t:i}=qt(),o=q(!1);Wz(()=>{o.value=!0});function s(){o.value=!1}return(r,a)=>o.value?(k(),N("div",{key:1,class:De(["error-boundary",{fullscreen:e.fullscreen}]),role:"alert"},[e.closable?(k(),fe(p(rn),{key:0,class:"error-boundary-close",size:"sm",label:p(i)("common.close"),tooltip:p(i)("common.close"),onClick:a[0]||(a[0]=l=>n("close"))},{default:de(()=>[G(p(Ie),{name:"close",size:"sm"})]),_:1},8,["label","tooltip"])):ne("",!0),G(p(Ie),{class:"error-boundary-icon",name:"alert-triangle",size:"lg"}),S("p",dhe,z(p(i)("common.errorBoundaryTitle")),1),G(p(nn),{size:"sm",onClick:s},{default:de(()=>[Pe(z(p(i)("common.errorBoundaryRetry")),1)]),_:1})],2)):Kn(r.$slots,"default",{key:0},void 0,!0)}}),EW=xt(fhe,[["__scopeId","data-v-3fe116a9"]]);var hhe=Object.create,ES=Object.defineProperty,phe=Object.getOwnPropertyDescriptor,LW=Object.getOwnPropertyNames,mhe=Object.getPrototypeOf,ghe=Object.prototype.hasOwnProperty,NW=(e,t)=>function(){return t||(0,e[LW(e)[0]])((t={exports:{}}).exports,t),t.exports},vhe=e=>{let t={};for(var n in e)ES(t,n,{get:e[n],enumerable:!0});return t},yhe=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(var o=LW(t),s=0,r=o.length,a;st[l]).bind(null,a),enumerable:!(i=phe(t,a))||i.enumerable});return e},FW=(e,t,n)=>(n=e!=null?hhe(mhe(e)):{},yhe(ES(n,"default",{value:e,enumerable:!0}),e));function khe(e,t,n,i){const o=Number(e[t].meta.id+1).toString();let s="";return typeof i.docId=="string"&&(s=`-${i.docId}-`),s+o}function bhe(e,t){let n=Number(e[t].meta.id+1).toString();return e[t].meta.subId>0&&(n+=`:${e[t].meta.subId}`),`[${n}]`}function whe(e,t,n,i,o){const s=o.rules.footnote_anchor_name(e,t,n,i,o),r=o.rules.footnote_caption(e,t,n,i,o);let a=s;return e[t].meta.subId>0&&(a+=`:${e[t].meta.subId}`),`${r}`}function Ahe(e,t,n){return(n.xhtmlOut?`
+`:`
+`)+`
+
    +`}function Che(){return`
+
+`}function xhe(e,t,n,i,o){let s=o.rules.footnote_anchor_name(e,t,n,i,o);return e[t].meta.subId>0&&(s+=`:${e[t].meta.subId}`),`
  • `}function She(){return`
  • +`}function _he(e,t,n,i,o){let s=o.rules.footnote_anchor_name(e,t,n,i,o);return e[t].meta.subId>0&&(s+=`:${e[t].meta.subId}`),` ↩︎`}function Ihe(e){const t=e.helpers.parseLinkLabel,n=e.utils.isSpace;e.renderer.rules.footnote_ref=whe,e.renderer.rules.footnote_block_open=Ahe,e.renderer.rules.footnote_block_close=Che,e.renderer.rules.footnote_open=xhe,e.renderer.rules.footnote_close=She,e.renderer.rules.footnote_anchor=_he,e.renderer.rules.footnote_caption=bhe,e.renderer.rules.footnote_anchor_name=khe;function i(a,l,u,c){const d=a.bMarks[l]+a.tShift[l],f=a.eMarks[l];if(d+4>f||a.src.charCodeAt(d)!==91||a.src.charCodeAt(d+1)!==94)return!1;let h;for(h=d+2;h=f||a.src.charCodeAt(++h)!==58)return!1;if(c)return!0;h++,a.env.footnotes||(a.env.footnotes={}),a.env.footnotes.refs||(a.env.footnotes.refs={});const m=a.src.slice(d+2,h-2);a.env.footnotes.refs[`:${m}`]=-1;const g=new a.Token("footnote_reference_open","",1);g.meta={label:m},g.level=a.level++,a.tokens.push(g);const y=a.bMarks[l],b=a.tShift[l],v=a.sCount[l],w=a.parentType,A=h,M=a.sCount[l]+h-(a.bMarks[l]+a.tShift[l]);let L=M;for(;h=u||a.src.charCodeAt(c)!==94||a.src.charCodeAt(c+1)!==91)return!1;const d=c+2,f=t(a,c+1);if(f<0)return!1;if(!l){a.env.footnotes||(a.env.footnotes={}),a.env.footnotes.list||(a.env.footnotes.list=[]);const h=a.env.footnotes.list.length,m=[];a.md.inline.parse(a.src.slice(d,f),a.md,a.env,m);const g=a.push("footnote_ref","",0);g.meta={id:h},a.env.footnotes.list[h]={content:a.src.slice(d,f),tokens:m}}return a.pos=f+1,a.posMax=u,!0}function s(a,l){const u=a.posMax,c=a.pos;if(c+3>u||!a.env.footnotes||!a.env.footnotes.refs||a.src.charCodeAt(c)!==91||a.src.charCodeAt(c+1)!==94)return!1;let d;for(d=c+2;d=u)return!1;d++;const f=a.src.slice(c+2,d-1);if(typeof a.env.footnotes.refs[`:${f}`]>"u")return!1;if(!l){a.env.footnotes.list||(a.env.footnotes.list=[]);let h;a.env.footnotes.refs[`:${f}`]<0?(h=a.env.footnotes.list.length,a.env.footnotes.list[h]={label:f,count:0},a.env.footnotes.refs[`:${f}`]=h):h=a.env.footnotes.refs[`:${f}`];const m=a.env.footnotes.list[h].count;a.env.footnotes.list[h].count++;const g=a.push("footnote_ref","",0);g.meta={id:h,subId:m,label:f}}return a.pos=d,a.posMax=u,!0}function r(a){let l,u,c,d=!1;const f={};if(!a.env.footnotes||(a.tokens=a.tokens.filter(function(m){return m.type==="footnote_reference_open"?(d=!0,u=[],c=m.meta.label,!1):m.type==="footnote_reference_close"?(d=!1,f[":"+c]=u,!1):(d&&u.push(m),!d)}),!a.env.footnotes.list))return;const h=a.env.footnotes.list;a.tokens.push(new a.Token("footnote_block_open","",1));for(let m=0,g=h.length;m0?h[m].count:1;for(let w=0;w?@[\]^_`{|}~-])/g;function Lhe(e,t){const n=e.posMax,i=e.pos;if(e.src.charCodeAt(i)!==94||t||i+2>=n)return!1;e.pos=i+1;let o=!1;for(;e.pos{t.exports=function(g,y){y=Object.assign({},{disabled:!0,divWrap:!1,divClass:"checkbox",idPrefix:"cbx_",ulClass:"task-list",liClass:"task-list-item"},y),g.core.ruler.after("inline","github-task-lists",function(b){for(var v=b.tokens,w=0,A=2;A=0;v--)if(g[v].level===b)return v;return-1}function o(g,y){return d(g[y])&&f(g[y-1])&&h(g[y-2])&&m(g[y])}function s(g,y,b,v){var w=b.idPrefix+y;g.children[0].content=g.children[0].content.slice(3),g.children.unshift(a(w,v)),g.children.push(l(v)),g.children.unshift(r(g,w,b,v)),b.divWrap&&(g.children.unshift(u(b,v)),g.children.push(c(v)))}function r(g,y,b,v){var w=new v("checkbox_input","input",0);return w.attrs=[["type","checkbox"],["id",y]],/^\[[xX]\][ \u00A0]/.test(g.content)===!0&&w.attrs.push(["checked","true"]),b.disabled===!0&&w.attrs.push(["disabled","true"]),w}function a(g,y){var b=new y("label_open","label",1);return b.attrs=[["for",g]],b}function l(g){return new g("label_close","label",-1)}function u(g,y){var b=new y("checkbox_open","div",0);return b.attrs=[["class",g.divClass]],b}function c(g){return new g("checkbox_close","div",-1)}function d(g){return g.type==="inline"}function f(g){return g.type==="paragraph_open"}function h(g){return g.type==="list_item_open"}function m(g){return/^\[[xX \u00A0]\][ \u00A0]/.test(g.content)}})});const Rhe=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function Dhe(e){return e>=55296&&e<=57343||e>1114111?65533:Rhe.get(e)??e}function Ohe(e){const t=atob(e),n=t.length&-2,i=new Uint16Array(n/2);for(let o=0,s=0;o=Mo.ZERO&&e<=Mo.NINE}function Bhe(e){return e>=Mo.UPPER_A&&e<=Mo.UPPER_F||e>=Mo.LOWER_A&&e<=Mo.LOWER_F}function $he(e){return e>=Mo.UPPER_A&&e<=Mo.UPPER_Z||e>=Mo.LOWER_A&&e<=Mo.LOWER_Z||C6(e)}function zhe(e){return e===Mo.EQUALS||$he(e)}var Ks;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(Ks||(Ks={}));var bf;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(bf||(bf={}));var jhe=class{decodeTree;emitCodePoint;errors;constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n}state=Ks.EntityStart;consumed=1;result=0;treeIndex=0;excess=1;decodeMode=bf.Strict;runConsumed=0;startEntity(e){this.decodeMode=e,this.state=Ks.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1,this.runConsumed=0}write(e,t){switch(this.state){case Ks.EntityStart:return e.charCodeAt(t)===Mo.NUM?(this.state=Ks.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=Ks.NamedEntity,this.stateNamedEntity(e,t));case Ks.NumericStart:return this.stateNumericStart(e,t);case Ks.NumericDecimal:return this.stateNumericDecimal(e,t);case Ks.NumericHex:return this.stateNumericHex(e,t);case Ks.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|oN)===Mo.LOWER_X?(this.state=Ks.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=Ks.NumericDecimal,this.stateNumericDecimal(e,t))}stateNumericHex(e,t){for(;t>14;for(;t>7;if(this.runConsumed===0){const a=i&na.JUMP_TABLE;if(e.charCodeAt(t)!==a)return this.result===0?0:this.emitNotTerminatedNamedEntity();t++,this.excess++,this.runConsumed++}for(;this.runConsumed=e.length)return-1;const a=this.runConsumed-1,l=n[this.treeIndex+1+(a>>1)],u=a%2===0?l&255:l>>8&255;if(e.charCodeAt(t)!==u)return this.runConsumed=0,this.result===0?0:this.emitNotTerminatedNamedEntity();t++,this.excess++,this.runConsumed++}this.runConsumed=0,this.treeIndex+=1+(r>>1),i=n[this.treeIndex],o=(i&na.VALUE_LENGTH)>>14}if(t>=e.length)break;const s=e.charCodeAt(t);if(s===Mo.SEMI&&o!==0&&(i&na.FLAG13)!==0)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);if(this.treeIndex=Whe(n,i,this.treeIndex+Math.max(1,o),s),this.treeIndex<0)return this.result===0||this.decodeMode===bf.Attribute&&(o===0||zhe(s))?0:this.emitNotTerminatedNamedEntity();if(i=n[this.treeIndex],o=(i&na.VALUE_LENGTH)>>14,o!==0){if(s===Mo.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==bf.Strict&&(i&na.FLAG13)===0&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}t++,this.excess++}return-1}emitNotTerminatedNamedEntity(){const{result:e,decodeTree:t}=this,n=(t[e]&na.VALUE_LENGTH)>>14;return this.emitNamedEntityData(e,n,this.consumed),this.errors?.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){const{decodeTree:i}=this;return this.emitCodePoint(t===1?i[e]&~(na.VALUE_LENGTH|na.FLAG13):i[e+1],n),t===3&&this.emitCodePoint(i[e+2],n),n}end(){switch(this.state){case Ks.NamedEntity:return this.result!==0&&(this.decodeMode!==bf.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Ks.NumericDecimal:return this.emitNumericEntity(0,2);case Ks.NumericHex:return this.emitNumericEntity(0,3);case Ks.NumericStart:return this.errors?.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Ks.EntityStart:return 0}}};function Hhe(e){let t="";const n=new jhe(e,i=>t+=String.fromCodePoint(i));return function(o,s){let r=0,a=0;for(;(a=o.indexOf("&",a))>=0;){t+=o.slice(r,a),n.startEntity(s);const u=n.write(o,a+1);if(u<0){r=a+n.end();break}r=a+u,a=u===0?r+1:r}const l=t+o.slice(r);return t="",l}}function Whe(e,t,n,i){const o=(t&na.BRANCH_LENGTH)>>7,s=t&na.JUMP_TABLE;if(o===0)return s!==0&&i===s?n:-1;if(s){const u=i-s;return u<0||u>=o?-1:e[n+u]-1}const r=o+1>>1;let a=0,l=o-1;for(;a<=l;){const u=a+l>>>1,c=e[n+(u>>1)]>>(u&1)*8&255;if(ci)l=u-1;else return e[n+r+u]}return-1}const qhe=Hhe(Phe);function LS(e,t=bf.Legacy){return qhe(e,t)}var Uhe=FW(Fhe());const sN={};function Vhe(e){let t=sN[e];if(t)return t;t=sN[e]=[];for(let n=0;n<128;n++){const i=String.fromCharCode(n);t.push(i)}for(let n=0;n=55296&&c<=57343?o+="���":o+=String.fromCharCode(c),s+=6;continue}}if((a&248)===240&&s+91114111?o+="����":(d-=65536,o+=String.fromCharCode(55296+(d>>10),56320+(d&1023))),s+=9;continue}}o+="�"}return o})}$w.defaultChars=";/?:@&=+$,#";$w.componentChars="";var x6=$w;const rN={};function Khe(e){let t=rN[e];if(t)return t;t=rN[e]=[];for(let n=0;n<128;n++){const i=String.fromCharCode(n);/^[0-9a-z]$/i.test(i)?t.push(i):t.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n"u"&&(n=!0);const i=Khe(t);let o="";for(let s=0,r=e.length;s=55296&&a<=57343){if(a>=55296&&a<=56319&&s+1=56320&&l<=57343){o+=encodeURIComponent(e[s]+e[s+1]),s++;continue}}o+="%EF%BF%BD";continue}o+=encodeURIComponent(e[s])}return o}zw.defaultChars=";/?:@&=+$,-_.!~*'()#";zw.componentChars="-_.!~*'()";var RW=zw;function NS(e){let t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&e.hostname.indexOf(":")!==-1?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||"",t}function Ub(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const Zhe=/^([a-z0-9.+-]+:)/i,Ghe=/:[0-9]*$/,Qhe=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Yhe=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",` +`," "]),Jhe=["'"].concat(Yhe),aN=["%","/","?",";","#"].concat(Jhe),lN=["/","?","#"],Xhe=255,uN=/^[+a-z0-9A-Z_-]{0,63}$/,epe=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,cN={javascript:!0,"javascript:":!0},dN={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function tpe(e,t){if(e&&e instanceof Ub)return e;const n=new Ub;return n.parse(e,t),n}Ub.prototype.parse=function(e,t){let n,i,o,s=e;if(s=s.trim(),!t&&e.split("#").length===1){const u=Qhe.exec(s);if(u)return this.pathname=u[1],u[2]&&(this.search=u[2]),this}let r=Zhe.exec(s);if(r&&(r=r[0],n=r.toLowerCase(),this.protocol=r,s=s.substr(r.length)),(t||r||s.match(/^\/\/[^@\/]+@[^@\/]+/))&&(o=s.substr(0,2)==="//",o&&!(r&&cN[r])&&(s=s.substr(2),this.slashes=!0)),!cN[r]&&(o||r&&!dN[r])){let u=-1;for(let m=0;m127?v+="x":v+=b[w];if(!v.match(uN)){const w=m.slice(0,g),A=m.slice(g+1),M=b.match(epe);M&&(w.push(M[1]),A.unshift(M[2])),A.length&&(s=A.join(".")+s),this.hostname=w.join(".");break}}}}this.hostname.length>Xhe&&(this.hostname=""),h&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const a=s.indexOf("#");a!==-1&&(this.hash=s.substr(a),s=s.slice(0,a));const l=s.indexOf("?");return l!==-1&&(this.search=s.substr(l),s=s.slice(0,l)),s&&(this.pathname=s),dN[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};Ub.prototype.parseHost=function(e){let t=Ghe.exec(e);t&&(t=t[0],t!==":"&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};var FS=tpe,DW=vhe({decode:()=>x6,encode:()=>RW,format:()=>NS,parse:()=>FS}),npe=Object.defineProperty,OW=e=>{let t={};for(var n in e)npe(t,n,{get:e[n],enumerable:!0});return t},Os=class{type;tag;attrs;map;nesting;level;children;content;markup;info;meta;block;hidden;constructor(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}attrIndex(e){if(!this.attrs)return-1;const t=this.attrs;for(let n=0,i=t.length;n=0&&(n=this.attrs[t][1]),n}attrJoin(e,t){const n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=`${this.attrs[n][1]} ${t}`}},ipe=OW({arrayReplaceAt:()=>cpe,assign:()=>lpe,countLines:()=>$o,escapeHtml:()=>kpe,escapeRE:()=>wpe,fromCodePoint:()=>d2,has:()=>ape,isMdAsciiPunct:()=>Zb,isPunctChar:()=>Kb,isPunctCode:()=>S6,isSpace:()=>upe,isString:()=>spe,isValidEntityCode:()=>Hw,isWhiteSpace:()=>c2,lib:()=>Ape,mdurl:()=>DW,normalizeReference:()=>jw,ucmicro:()=>Vb,unescapeAll:()=>f2,unescapeMd:()=>ppe});const Vb={Any:/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Cc:/[\0-\x1F\x7F-\x9F]/,Cf:/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,P:/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,S:/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,Z:/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/};function ope(e){return Object.prototype.toString.call(e)}function spe(e){return ope(e)==="[object String]"}const rpe=Object.prototype.hasOwnProperty;function ape(e,t){return rpe.call(e,t)}function lpe(e,...t){return t.forEach(n=>{if(n){if(typeof n!="object")throw new TypeError(`${String(n)}must be object`);Object.keys(n).forEach(i=>{e[i]=n[i]})}}),e}function upe(e){return e===9||e===32}function c2(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function Kb(e){return Vb.P.test(e)||Vb.S.test(e)}const fN=new Map;function S6(e){if(Zb(e))return!0;if(e>=0&&e<128)return!1;const t=fN.get(e);if(t!==void 0)return t;const n=Kb(String.fromCharCode(e));return fN.set(e,n),n}function Zb(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function jw(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}function cpe(e,t,n){return[...e.slice(0,t),...n,...e.slice(t+1)]}function Hw(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function d2(e){if(e>65535){e-=65536;const t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}const PW=/\\([!"#$%&'()*+,\-\./:;<=>?@[\\\]^_`{|}~])/g,dpe=new RegExp(`${PW.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),fpe=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function hpe(e,t){if(t.charCodeAt(0)===35&&fpe.test(t)){const i=t[1].toLowerCase()==="x"?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return Hw(i)?d2(i):e}const n=LS(e);return n!==e?n:e}function ppe(e){return e.includes("\\")?e.replace(PW,"$1"):e}function f2(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(dpe,(t,n,i)=>n||hpe(t,i))}const mpe=/[&<>"]/,gpe=/[&<>"]/g,vpe={"&":"&","<":"<",">":">",'"':"""};function ype(e){return vpe[e]}function kpe(e){return mpe.test(e)?e.replace(gpe,ype):e}const bpe=/[.?*+^$[\]\\(){}|-]/g;function wpe(e){return e.replace(bpe,"\\$&")}const Ape={mdurl:DW,ucmicro:Vb};function $o(e){if(e.length===0)return 0;let t=0,n=-1;for(;(n=e.indexOf(` +`,n+1))!==-1;)t++;return t}const Cpe=/(?:^|\n)[ \t]{0,3}\[\^[^\]\n]+\]:/m,xpe=/(?:^|\n)[ \t]{0,3}\*\[[^\]\n]+\]:/m,Spe=/(?:^|\n)[ \t]{0,3}\[(?!\^)(?:\\[\s\S]|[^\]\\[])+\][ \t]*:/m,RS=["references","footnotes","abbreviations","abbr","abbrs"],DS=Symbol.for("markdown-it-ts.global-state"),OS=Object.prototype.hasOwnProperty;function hN(e){return e==="reference-definition"||e==="footnote-definition"||e==="abbreviation-definition"}function Lu(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Ff(e){if(Array.isArray(e))return e.map(t=>Ff(t));if(Lu(e)){const t={};for(const n of Object.keys(e))t[n]=Ff(e[n]);return t}return e}function Gb(e){return Array.isArray(e)?e.map((t,n)=>String(n)):Lu(e)?Object.keys(e):[]}function _6(e,t){if(Array.isArray(e)||Array.isArray(t)){if(!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;ns.has(r)?!_6(o[r],BW(i.value,r)):!0)}}function Td(e){const t=PS(e);if(t){for(const n of RS){const i=t.snapshot[n];if(!i){delete e[n];continue}if(i.ownedKeys){Ipe(e,n,i);continue}i.existed?e[n]=_pe(e[n],i.value):delete e[n]}delete e[DS]}}function Z8(e){return{area:e,attempted:!0,matched:!1,attemptMs:0,blocks:0,headings:0,paragraphs:0,lists:0,fences:0,paragraphCacheHits:0,paragraphCacheMisses:0,paragraphCacheBypasses:0,listCacheHits:0,listCacheMisses:0,fenceCacheHits:0,fenceCacheMisses:0}}const I6=Symbol.for("markdown-it-ts.diagnostics");function ey(e,t){if(e)try{const n=e[I6];if(n&&typeof n=="object")return n;if(!t)return;const i={};return e[I6]=i,i}catch{return}}function od(e){return ey(e,!1)}function Tpe(e){if(e)try{const t=e[I6];t&&typeof t=="object"&&(delete t.strategy,delete t.chunk,delete t.unbounded,delete t.editable,delete t.stockFast)}catch{}}function ia(e){Tpe(e)}function p0(e,t){const n=ey(e,!0);n&&(n.stockFast=t)}function ms(e,t){const n=ey(e,!0);n&&(n.strategy=t)}function G8(e,t){const n=ey(e,!0);n&&(n.chunk=t)}function $W(e,t){const n=ey(e,!0);n&&(n.unbounded=t)}const Epe=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Lpe=/[\0-\x1F\x7F-\x9F]/,Npe=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B4E\u1B4F\u1B5A-\u1B60\u1B7D-\u1B7F\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDD6E\uDEAD\uDED0\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9\uDFD4\uDFD5\uDFD7\uDFD8]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09\uDFE1]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDD6D-\uDD6F\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD839\uDDFF|\uD83A[\uDD5E\uDD5F]/,Fpe=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/;var Rpe=class{src_Any=Epe.source;src_Cc=Lpe.source;src_Z=Fpe.source;src_P=Npe.source;src_ZPCc=[this.src_Z,this.src_P,this.src_Cc].join("|");src_ZCc=[this.src_Z,this.src_Cc].join("|");cache={};opts={maxLength:1e4,urlAuth:!1,schema_names:[]};constructor(e={}){this.opts={...this.opts,...e}}set(e={}){return this.opts={...this.opts,...e},this.cache={},this}escapeRE(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}nestedPairRE(e,t,n=4){const i=this.escapeRE(e),o=this.escapeRE(t),s=`(?:(?!${this.src_ZCc}|${i}|${o}).)`;let r=`${i}${s}{0,1000}${o}`;for(let a=2;a<=n;a++)r=`${i}(?:${s}|${r}){0,1000}${o}`;return r}get_text_separators(){return this.cache.text_separators??=/[><\uff5c]/}get_pseudo_letter(){return this.cache.src_pseudo_letter??=new RegExp(`(?:(?!${this.get_text_separators().source}|${this.src_ZPCc})${this.src_Any})`)}get_ipv4_addr(){return this.cache.src_ip4??=new RegExp("(?:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])[.]){3}(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])")}get_ipv6_addr(){const e="[0-9A-Fa-f]{1,4}",t=`(?:(?:${e}:${e})|${this.get_ipv4_addr().source})`;return this.cache.src_ip6_addr??=new RegExp(`(?:(?:${e}:){6}${t}|::(?:${e}:){5}${t}|(?:${e})?::(?:${e}:){4}${t}|(?:(?:${e}:){0,1}${e})?::(?:${e}:){3}${t}|(?:(?:${e}:){0,2}${e})?::(?:${e}:){2}${t}|(?:(?:${e}:){0,3}${e})?::${e}:${t}|(?:(?:${e}:){0,4}${e})?::${t}|(?:(?:${e}:){0,5}${e})?::${e}|(?:(?:${e}:){0,6}${e})?::)`)}get_ipv6_url_host(){return this.cache.src_ip6_host??=new RegExp(`\\[${this.get_ipv6_addr().source}\\]`)}get_ipv6_mail_host(){return this.cache.src_ipv6_mail_host??=new RegExp(`\\[IPv6:${this.get_ipv6_addr().source}\\]`)}get_auth(){return this.cache.src_auth??=new RegExp(`(?:(?:(?!${this.src_ZCc}|[@/\\[\\]()]).){1,50}@)?`)}get_port(){return this.cache.src_port??=new RegExp("(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?")}get_host_terminator(){return this.cache.src_host_terminator??=new RegExp(`(?=$|${this.get_text_separators().source}|${this.src_ZPCc})(?!${this.opts["---"]?"-(?!--)|":"-|"}_|:\\d|\\.-|\\.(?!$|${this.src_ZPCc}))`)}get_path_terminator(){return this.cache.src_path_terminator??=new RegExp(`${this.src_ZPCc}|${this.get_text_separators().source}`)}get_path(){return this.cache.src_path??=new RegExp(`(?:[/?#](?:${this.nestedPairRE("[","]")}|${this.nestedPairRE("(",")")}|${this.nestedPairRE("{","}")}|\\"(?:(?!${this.src_ZCc}|["]).){1,100}\\"|\\'(?:(?!${this.src_ZCc}|[']).){1,100}\\'|\\'(?=${this.get_pseudo_letter().source}|[-])|\\.{2,20}[:]?[a-zA-Z0-9%/&]|\\.(?!${this.src_ZCc}|[.]|$)|`+(this.opts["---"]?"\\-(?!--(?:[^-]|$))(?:-{0,19})|":"\\-{1,20}|")+`,(?!${this.src_ZCc}|$)|;(?!${this.src_ZCc}|$)|\\!{1,20}(?!${this.src_ZCc}|[!]|$)|\\?(?!${this.src_ZCc}|[?]|$)|`+this.get_path_extra().source+`[\\\\/:%@#&=_~*]|(?!${this.get_path_terminator().source}).){1,${this.opts.maxLength}}|\\/)?`)}get_mail_name(){return this.cache.src_mail_name??=new RegExp("[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9](?:[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9]|[.](?=[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9])){0,63}")}get_xn(){return this.cache.src_xn??=new RegExp("xn--[a-z0-9\\-]{1,59}")}get_tld(){if(this.cache.tld)return this.cache.tld;const e=[...new Set(this.opts.tlds||[])].sort().reverse().join("|");return this.cache.tld=new RegExp(`${e||"$#none#$"}|${this.get_xn().source}`),this.cache.tld}get_domain_root(){return this.cache.src_domain_root??=new RegExp("(?:"+this.get_xn().source+`|${this.get_pseudo_letter().source}{1,63})`)}get_domain(){return this.cache.src_domain??=new RegExp("(?:"+this.get_xn().source+`|(?:${this.get_pseudo_letter().source})|(?:${this.get_pseudo_letter().source}(?:-|${this.get_pseudo_letter().source}){0,61}${this.get_pseudo_letter().source}))`)}get_url_host_port(){return this.cache.url_host_port??=new RegExp("(?:"+this.get_ipv6_url_host().source+`|(?:(?:(?:${this.get_domain().source})\\.){0,10}${this.get_domain().source}))`+this.get_port().source+this.get_host_terminator().source)}get_fuzzy_url_host_port(){return this.cache.fuzzy_url_host_port??=new RegExp("(?:"+(this.opts.fuzzyIP?this.get_ipv4_addr().source+"|":"")+`(?:(?:(?:${this.get_domain().source})\\.){1,10}(?:${this.get_tld().source})))`+this.get_host_terminator().source)}get_mail_host(){return this.cache.src_mail_host??=new RegExp("(?:"+this.get_ipv6_mail_host().source+`|(?:(?:(?:${this.get_domain().source})\\.){0,4}${this.get_domain().source}))`+this.get_host_terminator().source)}get_fuzzy_mail_host(){return this.cache.src_fuzzy_mail_host??=new RegExp("(?:"+this.get_ipv6_mail_host().source+`|(?:(?:(?:${this.get_domain().source})[.]){1,4}${this.get_domain_root().source}))`+this.get_host_terminator().source)}get_path_extra(){return this.cache.src_path_extra??=new RegExp("")}get_fuzzy_mail_host_search(){return this.cache.mail_fuzzy_host_search??=new RegExp(`@${this.get_fuzzy_mail_host().source}`,"ig")}get_fuzzy_link_search(){return this.cache.link_fuzzy_search??=new RegExp(`(^|(?![.:/\\-_@])(?:[$+<=>^\`||]|${this.src_ZPCc}))(?:(?![$+<=>^\`||])${this.get_fuzzy_url_host_port().source}${this.get_path().source})`,"ig")}get_http_validator(){return this.cache.http_validator??=new RegExp("\\/\\/"+(this.opts.urlAuth?this.get_auth().source:"")+this.get_url_host_port().source+this.get_path().source,"iy")}get_relative_proto_validator(){return this.cache.relative_proto_validator??=new RegExp((this.opts.urlAuth?this.get_auth().source:"")+`(?:localhost|${this.get_ipv6_url_host().source}|(?:(?:${this.get_domain().source})[.]){1,10}${this.get_domain_root().source})`+this.get_port().source+this.get_host_terminator().source+this.get_path().source,"iy")}get_mail_name_validator(){return this.cache.mail_name_validator??=new RegExp(`(?:^|${this.get_text_separators().source}|"|\\(|${this.src_ZCc})(${this.get_mail_name().source})$`)}get_mailto_validator(){return this.cache.mailto_validator??=new RegExp(`${this.get_mail_name().source}@${this.get_mail_host().source}`,"iy")}get_schema_names(){return this.cache.schema_names??=new RegExp((this.opts.schema_names||[]).map(e=>this.escapeRE(e)).join("|"))}get_schema_search(){return this.cache.schema_search??=new RegExp(`(^|(?!_)(?:[><|]|${this.src_ZPCc}))(${this.get_schema_names().source})`,"ig")}get_schema_at_start(){return this.cache.schema_at_start??=new RegExp(`^${this.get_schema_search().source}`,"i")}},Q8={validate:(e,t,n)=>{const i=n.re.get_http_validator();i.lastIndex=t;const o=i.exec(e);return o?o[0].length:0},normalize:(e,t)=>t.normalize(e)},Dpe={"http:":Q8,"https:":Q8,"ftp:":Q8,"//":{validate:function(e,t,n){const i=n.re.get_relative_proto_validator();i.lastIndex=t;const o=i.exec(e);return o?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:o[0].length:0},normalize:(e,t)=>t.normalize(e)},"mailto:":{validate:function(e,t,n){const i=n.re.get_mailto_validator();i.lastIndex=t;const o=i.exec(e);return o?o[0].length:0},normalize:(e,t)=>t.normalize(e)}},Ope="a:cdefgilmnoqrstuwxz|b:abdefghijmnorstvwyz|c:acdfghiklmnoruvwxyz|d:ejkmoz|e:cegrstu|f:ijkmor|g:abdefghilmnpqrstuwy|h:kmnrtu|i:delmnoqrst|j:emop|k:eghimnprwyz|l:abcikrstuvy|m:acdeghklmnopqrstuvwxyz|n:acefgilopruz|o:m|p:aefghklmnrstwy|q:a|r:eosuw|s:abcdeghijklmnortuvxyz|t:cdfghjklmnortvwz|u:agksyz|v:aceginu|w:fs|y:et|z:amw",Ppe="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф";function Bpe(){const e=Ppe.split("|");return Ope.split("|").forEach(t=>{const n=t.indexOf(":"),i=t.slice(0,n);for(const o of t.slice(n+1))e.push(i+o)}),e}var $pe={fuzzyLink:!1,fuzzyEmail:!0,fuzzyIP:!1,"---":!1,tlds:Bpe(),urlAuth:!1,maxLength:1e4},pN=class{schema;index;lastIndex;raw;text;url;constructor(e,t,n,i){const o=e.slice(n,i);this.schema=t.toLowerCase(),this.index=n,this.lastIndex=i,this.raw=o,this.text=o,this.url=o}},zW=class{__opts__;__schemas__;re;constructor(e={}){const{rebuilder:t,...n}=e;this.__opts__={...$pe,...n},this.__schemas__={...Dpe},this.re=t||new Rpe,this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)})}add(e,t=null){if(!t)delete this.__schemas__[e];else{const n={normalize:(i,o)=>o.normalize(i),...t};this.__schemas__[e]=n}return this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}set(e={}){return this.__opts__={...this.__opts__,...e},this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}test(e){if(!e.length)return!1;let t,n;for(n=this.re.get_schema_search(),n.lastIndex=0;(t=n.exec(e))!==null;)if(this.testSchemaAt(e,t[2],n.lastIndex))return!0;if(this.__opts__.fuzzyLink&&this.__schemas__["http:"]&&(n=this.re.get_fuzzy_link_search(),n.lastIndex=0,n.exec(e)!==null))return!0;if(this.__opts__.fuzzyEmail&&this.__schemas__["mailto:"]&&e.indexOf("@")>=0){const i=this.re.get_fuzzy_mail_host_search(),o=this.re.get_mail_name_validator();for(i.lastIndex=0;(t=i.exec(e))!==null;){const s=e.slice(Math.max(0,t.index-65),t.index);if(o.test(s))return!0}}return!1}testSchemaAt(e,t,n){return this.__schemas__[t.toLowerCase()]?this.__schemas__[t.toLowerCase()].validate(e.slice(0,n+this.__opts__.maxLength),n,this):0}match(e){const t=[],n=this.re.get_schema_search();let i,o,s,r,a,l,u=!1,c=!1,d=!1,f=0;if(!e.length)return null;for(n.lastIndex=0,this.__opts__.fuzzyLink&&this.__schemas__["http:"]&&(i=this.re.get_fuzzy_link_search(),i.lastIndex=0),this.__opts__.fuzzyEmail&&this.__schemas__["mailto:"]&&(o=this.re.get_fuzzy_mail_host_search(),o.lastIndex=0,s=this.re.get_mail_name_validator());;){const h=Math.max(f-1,0);if(o&&s&&!d&&(!a||a.index=f)break;o.lastIndex=f)break;i.lastIndexm.lastIndex))&&(m=r);let g;if(!u)for(;;){if(!l){n.lastIndexm.index)break;const v=l;l=void 0;const w=this.testSchemaAt(e,v.schema,v.lastIndex);if(w){g={schema:v.schema,index:v.index,lastIndex:v.lastIndex+w};break}}let y=g;if((!y||a&&(a.indexy.lastIndex))&&(y=a),(!y||r&&(r.indexy.lastIndex))&&(y=r),!y)break;y===a?a=void 0:y===r&&(r=void 0);const b=new pN(e,y.schema,y.index,y.lastIndex);b.schema?this.__schemas__[b.schema].normalize(b,this):this.normalize(b),t.push(b),f=y.lastIndex}return t.length?t:null}matchAtStart(e){if(!e.length)return null;const t=this.re.get_schema_at_start().exec(e);if(!t)return null;const n=this.testSchemaAt(e,t[2],t[0].length);if(!n)return null;const i=new pN(e,t[2],t.index+t[1].length,t.index+t[0].length+n);return this.__schemas__[i.schema].normalize(i,this),i}tlds(e,t=!1){return e=Array.isArray(e)?e:[e],t?this.__opts__.tlds=this.__opts__.tlds.concat(e):this.__opts__.tlds=e,this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}normalize(e){e.schema||(e.url=`http://${e.url}`),e.schema==="mailto:"&&!/^mailto:/i.test(e.url)&&(e.url=`mailto:${e.url}`)}},zpe=NW({"../../node_modules/.pnpm/punycode.js@2.3.1/node_modules/punycode.js/punycode.js":((e,t)=>{const d=/^xn--/,f=/[^\0-\x7F]/,h=/[\x2E\u3002\uFF0E\uFF61]/g,m={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},g=35,y=Math.floor,b=String.fromCharCode;function v($){throw new RangeError(m[$])}function w($,T){const R=[];let P=$.length;for(;P--;)R[P]=T($[P]);return R}function A($,T){const R=$.split("@");let P="";R.length>1&&(P=R[0]+"@",$=R[1]),$=$.replace(h,".");const j=w($.split("."),T).join(".");return P+j}function M($){const T=[];let R=0;const P=$.length;for(;R=55296&&j<=56319&&RString.fromCodePoint(...$),E=function($){return $>=48&&$<58?26+($-48):$>=65&&$<91?$-65:$>=97&&$<123?$-97:36},C=function($,T){return $+22+75*($<26)-((T!=0)<<5)},x=function($,T,R){let P=0;for($=R?y($/700):$>>1,$+=y($/T);$>g*26>>1;P+=36)$=y($/g);return y(P+(g+1)*$/($+38))},_=function($){const T=[],R=$.length;let P=0,j=128,B=72,K=$.lastIndexOf("-");K<0&&(K=0);for(let X=0;X=128&&v("not-basic"),T.push($.charCodeAt(X));for(let X=K>0?K+1:0;X=R&&v("invalid-input");const Ce=E($.charCodeAt(X++));Ce>=36&&v("invalid-input"),Ce>y((2147483647-P)/ie)&&v("overflow"),P+=Ce*ie;const Z=ee<=B?1:ee>=B+26?26:ee-B;if(Cey(2147483647/ae)&&v("overflow"),ie*=ae}const Q=T.length+1;B=x(P-V,Q,V==0),y(P/Q)>2147483647-j&&v("overflow"),j+=y(P/Q),P%=Q,T.splice(P++,0,j)}return String.fromCodePoint(...T)},F=function($){const T=[];$=M($);const R=$.length;let P=128,j=0,B=72;for(const V of $)V<128&&T.push(b(V));const K=T.length;let X=K;for(K&&T.push("-");X=P&&iey((2147483647-j)/Q)&&v("overflow"),j+=(V-P)*Q,P=V;for(const ie of $)if(ie2147483647&&v("overflow"),ie===P){let ee=j;for(let Ce=36;;Ce+=36){const Z=Ce<=B?1:Ce>=B+26?26:Ce-B;if(ee32))return s;if(i===41){if(r===0)break;r--}o++}return t===o||r!==0||(s.str=f2(e.slice(t,o)),s.pos=o,s.ok=!0),s}var HW=zS;const Ck=-2;function jpe(e,t,n,i){let o=1,s=t+1;for(;s=0&&t+1>=c)return-1;const d=a.indexOf("]",t+1);if(d<0||d>=l)return e.linkLabelNoCloseFrom=t+1,-1;const f=jpe(a,t,l,n);if(f!==Ck)return f;for(e.pos=t+1;e.pos=n)return r;let a=e.charCodeAt(s);if(a!==34&&a!==39&&a!==40)return r;t++,s++,a===40&&(a=41),r.marker=a}for(;s=0?e.attrs[n][1]:null}function qpe(e,t,n){const i=Ww(e,t);i<0?WS(e,[t,n]):e.attrs[i][1]=`${e.attrs[i][1]} ${n}`}var Upe=OW({attrGet:()=>Wpe,attrIndex:()=>Ww,attrJoin:()=>qpe,attrPush:()=>WS,attrSet:()=>Hpe,parseLinkDestination:()=>zS,parseLinkLabel:()=>jS,parseLinkTitle:()=>HS});function Vpe(e){return e.includes("\r")||e.includes("\0")}function qW(e){return typeof e=="string"?e:e.toString()}function Kpe(e){if(e.inlineMode){const t=new Os("inline","",0);t.content=qW(e.src),t.map=[0,1],t.children=[],t.level=0,e.tokens.push(t)}else e.md&&e.md.block&&e.md.block.parse(e.src,e.md,e.env,e.tokens)}const Zpe=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,Gpe=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function Qpe(e,t){let n=e.pos;const i=e.src;if(i.charCodeAt(n)!==60)return!1;const o=n,s=e.posMax;for(;;){if(++n>=s)return!1;const a=i.charCodeAt(n);if(a===60)return!1;if(a===62)break}const r=i.slice(o+1,n);if(Gpe.test(r)){const a=e.md.normalizeLink(r);if(!e.md.validateLink(a))return!1;if(!t){const l=e.push("link_open","a",1);l.attrs=[["href",a]],l.markup="autolink",l.info="auto";const u=e.push("text","",0);u.content=e.md.normalizeLinkText(r);const c=e.push("link_close","a",-1);c.markup="autolink",c.info="auto"}return e.pos+=r.length+2,!0}if(Zpe.test(r)){const a=e.md.normalizeLink(`mailto:${r}`);if(!e.md.validateLink(a))return!1;if(!t){const l=e.push("link_open","a",1);l.attrs=[["href",a]],l.markup="autolink",l.info="auto";const u=e.push("text","",0);u.content=e.md.normalizeLinkText(r);const c=e.push("link_close","a",-1);c.markup="autolink",c.info="auto"}return e.pos+=r.length+2,!0}return!1}var UW=Qpe;function Ype(e,t){const n=e.src;let i=e.pos;if(n.charCodeAt(i)!==96)return!1;const o=i;i++;const s=e.posMax;for(;i2&&f.charCodeAt(0)===32&&f.charCodeAt(f.length-1)===32&&(f=f.slice(1,-1)),d.content=f}return e.pos=l,!0}e.backticks[c]=u}return e.backticksScanned=!0,t||(e.pending+=r),e.pos+=a,!0}var VW=Ype;function mN(e){const t={},n=e.length;if(!n)return;let i=0,o=-2;const s=[];for(let r=0;rl;u-=s[u]+1){const d=e[u];if(d.marker===a.marker&&d.open&&d.end<0){let f=!1;if((d.close||a.open)&&(d.length+a.length)%3===0&&(d.length%3!==0||a.length%3!==0)&&(f=!0),!f){const h=u>0&&!e[u-1].open?s[u-1]+1:0;s[r]=r-u+h,s[u]=h,a.open=!1,d.end=r,d.close=!1,c=-1,o=-2;break}}}c!==-1&&(t[a.marker][(a.open?3:0)+(a.length||0)%3]=c)}}function Jpe(e){const t=e.tokens_meta,n=e.tokens_meta.length;mN(e.delimiters);for(let i=0;i=0;o--){const s=t[o],r=s.marker;if(r!==95&&r!==42||s.end===-1)continue;const a=t[s.end],l=s.token,u=a.token,c=o>0&&t[o-1].end===s.end+1&&t[o-1].marker===r&&t[o-1].token===l-1&&t[s.end+1].token===u+1,d=r===42?KW:ZW,f=i[l];c?(f.type="strong_open",f.tag="strong",f.nesting=1,f.markup=d+d,f.content=""):(f.type="em_open",f.tag="em",f.nesting=1,f.markup=d,f.content="");const h=i[u];c?(h.type="strong_close",h.tag="strong",h.nesting=-1,h.markup=d+d,h.content=""):(h.type="em_close",h.tag="em",h.nesting=-1,h.markup=d,h.content=""),c&&(i[t[o-1].token].content="",i[t[s.end+1].token].content="",o--)}}function t1e(e){const t=e.tokens_meta,n=e.tokens_meta.length;gN(e,e.delimiters);for(let i=0;i=48&&e<=57}function n1e(e){const t=e|32;return qS(e)||t>=97&&t<=102}function QW(e){const t=e|32;return t>=97&&t<=122}function i1e(e){return QW(e)||qS(e)}function o1e(e,t,n){let i=t+2;if(i>=n)return null;let o=!1,s=7,r=i;for((e.charCodeAt(i)|32)===120&&(o=!0,s=6,i++,r=i);i=n||e.charCodeAt(i)!==59?null:e.slice(t,i+1)}function s1e(e,t,n){let i=t+1;if(i>=n||!QW(e.charCodeAt(i)))return null;for(i++;i=n||e.charCodeAt(i)!==59)return null;const o=e.slice(t,i+1);return GW(o)!==o?o:null}function r1e(e,t){const n=e.pos,i=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=i)return!1;if(e.src.charCodeAt(n+1)===35){const o=o1e(e.src,n,i);if(o){if(!t){const s=(o.charCodeAt(2)|32)===120?Number.parseInt(o.slice(3,-1),16):Number.parseInt(o.slice(2,-1),10),r=e.push("text_special","",0);r.content=Hw(s)?d2(s):d2(65533),r.markup=o,r.info="entity"}return e.pos+=o.length,!0}}else{const o=s1e(e.src,n,i);if(o){const s=GW(o);if(!t){const r=e.push("text_special","",0);r.content=s,r.markup=o,r.info="entity"}return e.pos+=o.length,!0}}return!1}var YW=r1e;const JW=(()=>{const e=new Array(256).fill(0),t="\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-";for(let n=0;n<32;n++)e[t.charCodeAt(n)]=1;return e})(),T6=new Array(128),XW=new Array(128);for(let e=0;e<128;e++){const t=String.fromCharCode(e);T6[e]=`\\${t}`,XW[e]=JW[e]?t:T6[e]}function vN(e,t,n){e.pending&&e.pushPending();const i=new Os("text_special","",0);i.level=e.level,i.content=t,i.markup=n,i.info="escape",e.pendingLevel=e.level,e.tokens.push(i),e.tokens_meta.push(null)}function a1e(e,t){let n=e.pos;const i=e.posMax,o=e.src;if(o.charCodeAt(n)!==92||(n++,n>=i))return!1;let s=o.charCodeAt(n);if(s===10){for(t||e.push("hardbreak","br",0),n++;n=55296&&s<=56319&&n+1=56320&&l<=57343&&n++}return e.pos=n+1,!0}let r=o.charAt(n);if(s>=55296&&s<=56319&&n+1=56320&&l<=57343&&(r+=o.charAt(n+1),n++)}const a=`\\${r}`;return vN(e,s<256&&JW[s]?r:a,a),e.pos=n+1,!0}var eq=a1e;function l1e(e){let t,n,i=0;const o=e.tokens,s=e.tokens.length;for(t=n=0;t0&&i++,r.type==="text"&&t+1\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,nq="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",c1e=new RegExp(`^(?:${tq}|${nq}||<\\?[\\s\\S]*?\\?>|]*>|)`),d1e=new RegExp(`^(?:${tq}|${nq})`);function iq(e){return e===32||e===9||e===10||e===12||e===13}function f1e(e){if(e.length<3||e.charCodeAt(0)!==60||(e.charCodeAt(1)|32)!==97)return!1;const t=e.charCodeAt(2);return t===62||iq(t)}function h1e(e){if(e.length<4||e.charCodeAt(0)!==60||e.charCodeAt(1)!==47||(e.charCodeAt(2)|32)!==97)return!1;for(let t=3;t=97&&t<=122}function m1e(e,t){if(!e.md.options.html)return!1;const n=e.posMax,i=e.pos,o=e.src;if(o.charCodeAt(i)!==60||i+2>=n)return!1;const s=o.charCodeAt(i+1);if(s!==33&&s!==63&&s!==47&&!p1e(s))return!1;const r=o.slice(i).match(c1e);if(!r)return!1;const a=r[0];if(!t){const l=e.pushSimple("html_inline","");l.content=a,f1e(a)&&e.linkLevel++,h1e(a)&&e.linkLevel--}return e.pos+=a.length,!0}var oq=m1e;function g1e(e,t){let n,i,o,s,r,a,l,u,c="";const d=e.pos,f=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const h=e.pos+2,m=Qb(e,e.pos+1,!1);if(m<0)return!1;if(s=m+1,s=f)return!1;if(a=HW(e.src,s,e.posMax),a.ok){for(c=e.md.normalizeLink(a.str),e.md.validateLink(c)?s=a.pos:c="",u=s;s=f||e.src.charCodeAt(s)!==41)return e.pos=d,!1;s++}else{if(typeof e.env.references>"u")return!1;if(s=0?o=e.src.slice(u,s++):s=m+1):s=m+1,o||(o=e.src.slice(h,m)),r=e.env.references[jw(o)],!r)return e.pos=d,!1;c=r.href,l=r.title}if(!t){i=e.src.slice(h,m);const g=[];e.md.inline.parse(i,e.md,e.env,g);const y=e.push("image","img",0);y.attrs=[["src",c],["alt",""]],y.children=g,y.content=i,l&&y.attrs.push(["title",l])}return e.pos=s,e.posMax=f,!0}var sq=g1e;function Y8(e,t,n){for(;t"u")return!1;let d;if(a=r+1,a=0?(d=n.slice(h,m),d||(d=n.slice(s,r)),a=m+1):d=n.slice(s,r)}else d=n.slice(s,r);const f=e.env.references[jw(d)];if(!f)return e.pos=i,!1;l=f.href,u=f.title}if(!t){e.pos=s,e.posMax=r;const d=e.push("link_open","a",1);d.attrs=u?[["href",l],["title",u]]:[["href",l]],e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=a,e.posMax=o,!0}var rq=v1e;function aq(e){const t=e|32;return t>=97&&t<=122}function y1e(e){return e>=48&&e<=57}function k1e(e){return aq(e)||y1e(e)||e===43||e===45||e===46}function b1e(e){if(e.length===0)return null;let t=e.length-1;for(;t>=0&&k1e(e.charCodeAt(t));)t--;return t++,t>=e.length||!aq(e.charCodeAt(t))?null:e.slice(t)}function w1e(e,t,n){let i=t;for(;i0)return!1;const n=e.pos,i=e.posMax;if(n+3>i||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;const o=b1e(e.pending);if(!o)return!1;const s=w1e(e.src,n-o.length,i),r=e.md.linkify.matchAtStart(s);if(!r)return!1;let a=r.url;if(a.length<=o.length)return!1;let l=a.length;for(;l>0&&a.charCodeAt(l-1)===42;)l--;l!==a.length&&(a=a.slice(0,l));const u=e.md.normalizeLink(a);if(!e.md.validateLink(u))return!1;if(!t){e.pending=e.pending.slice(0,-o.length);const c=e.push("link_open","a",1);c.attrs=[["href",u]],c.markup="linkify",c.info="auto";const d=e.push("text","",0);d.content=e.md.normalizeLinkText(a);const f=e.push("link_close","a",-1);f.markup="linkify",f.info="auto"}return e.pos+=a.length-o.length,!0}function A1e(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const i=e.pending.length-1,o=e.posMax;if(!t)if(i>=0&&e.pending.charCodeAt(i)===32)if(i>=1&&e.pending.charCodeAt(i-1)===32){let s=i-1;for(;s>=1&&e.pending.charCodeAt(s-1)===32;)s--;e.pending=e.pending.slice(0,s),e.pushSimple("hardbreak","br")}else e.pending=e.pending.slice(0,-1),e.pushSimple("softbreak","br");else e.pushSimple("softbreak","br");for(n++;n=o||kN(n.charCodeAt(i)))return!1;let s=i+1;for(;si-o),n=Math.floor(t.length/2);return t.length%2===0?(t[n-1]+t[n])/2:t[n]}function I1e(e,t){return{chain:e,name:t,calls:0,hits:0,inclusiveMs:0,medianMs:0,maxMs:0,normalCalls:0,normalHits:0,silentCalls:0,silentHits:0,samples:[]}}function dq(e){const t=e;if(!t)return null;if(t.__mdtsRuleProfile)return t.__mdtsRuleProfile;if(!t.__mdtsProfileRules)return null;const n=t.__mdtsProfileRules===!0?{}:t.__mdtsProfileRules,i={enabled:!0,fixture:n.fixture,mode:n.mode,startedAt:US(),records:Object.create(null)};return t.__mdtsRuleProfile=i,i}function Lm(e,t,n,i,o,s){const r=dq(e);if(!r)return;const a=`${t}:${n}`,l=r.records[a]??(r.records[a]=I1e(t,n));l.calls++,l.inclusiveMs+=i,i>l.maxMs&&(l.maxMs=i),l.samples.push(i),s?(l.silentCalls++,o&&l.silentHits++):(l.normalCalls++,o&&l.normalHits++),o&&l.hits++,r.completedAt=US()}function M1e(e){const t=dq(e);if(!t)return null;const n=Object.keys(t.records);for(let i=0;io.name===e);i>=0&&this.rules.splice(i,1),this.rules.push({name:e,fn:t,alt:n?.alt||[],enabled:!0}),this.invalidateCache()}at(e,t,n){const i=this.rules.findIndex(o=>o.name===e);if(t===void 0){if(i<0)return;const o=this.rules[i];return Object.freeze({name:o.name,fn:o.fn,alt:o.alt?Object.freeze(o.alt.slice()):void 0,enabled:o.enabled})}if(i<0)throw new Error(`Parser rule not found: ${e}`);this.rules[i].fn=t,n?.alt!==void 0&&(this.rules[i].alt=n.alt),this.invalidateCache()}before(e,t,n,i){const o=this.rules.findIndex(r=>r.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this.rules.findIndex(r=>r.name===t);s>=0&&this.rules.splice(s,1),this.rules.splice(o,0,{name:t,fn:n,alt:i?.alt||[],enabled:!0}),this.invalidateCache()}after(e,t,n,i){const o=this.rules.findIndex(r=>r.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this.rules.findIndex(r=>r.name===t);s>=0&&this.rules.splice(s,1),this.rules.splice(o+1,0,{name:t,fn:n,alt:i?.alt||[],enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;for(const s of n){const r=this.rules.findIndex(a=>a.name===s);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${s}`);continue}i.push(s),this.rules[r].enabled||(this.rules[r].enabled=!0,o=!0)}return o&&this.invalidateCache(),i}disable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;for(const s of n){const r=this.rules.findIndex(a=>a.name===s);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${s}`);continue}i.push(s),this.rules[r].enabled&&(this.rules[r].enabled=!1,o=!0)}return o&&this.invalidateCache(),i}enableOnly(e){const t=new Set(e);let n=!1;for(const i of this.rules){const o=t.has(i.name);i.enabled!==o&&(i.enabled=o,n=!0)}n&&this.invalidateCache()}getRules(e){const t=e||"";return this.cache||this.compileCache(),this.cache.get(t)??[]}getNamedRules(e){const t=e||"";return this.namedCache||this.compileCache(),this.namedCache.get(t)??[]}compileCache(){const e=new Set([""]);for(const i of this.rules)if(i.enabled&&i.alt)for(const o of i.alt)e.add(o);const t=new Map,n=new Map;for(const i of e){const o=[],s=[];for(const r of this.rules)r.enabled&&(i!==""&&!r.alt?.includes(i)||(o.push(r.fn),s.push({name:r.name,fn:r.fn})));t.set(i,o),n.set(i,s)}this.cache=t,this.namedCache=n}},fq=class{src;md;env;tokens;tokens_meta;pos;posMax;level;pending;pendingLevel;cache;delimiters;_prev_delimiters;backticks;backticksScanned;linkLevel;linkLabelNoCloseFrom;maxNesting;constructor(e,t,n,i){this.src=e,this.md=t,this.env=n,this.tokens=i,this.tokens_meta=new Array(i.length),this.pos=0,this.posMax=e.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache=[],this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0,this.linkLabelNoCloseFrom=-1,this.maxNesting=t.options.maxNesting}pushPending(){const e=new Os("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e}pushSimple(e,t){this.pending&&this.pushPending();const n=new Os(e,t,0);return n.level=this.level,this.pendingLevel=this.level,this.tokens.push(n),this.tokens_meta.push(null),n}push(e,t,n){if(this.pending&&this.pushPending(),n===0)return this.pushSimple(e,t);const i=new Os(e,t,n);let o=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),i.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],o={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(i),this.tokens_meta.push(o),i}scanDelims(e,t){const{src:n,posMax:i}=this,o=n.charCodeAt(e);let s=e;for(;s0?n.charCodeAt(e-1):32,l=s@[\]\\^_`{}~]/;function wN(e,t){switch(e.src.charCodeAt(e.pos)){case 10:return uq(e,t);case 33:return sq(e,t);case 38:return YW(e,t);case 42:case 95:return M6.tokenize(e,t);case 58:return e.md.options.linkify&&lq(e,t);case 60:return UW(e,t)||oq(e,t);case 91:return rq(e,t);case 92:return eq(e,t);case 96:return VW(e,t);case 126:return E6.tokenize(e,t);default:return cq(e,t)}}function hq(e){return!T1e.test(e)}var E1e=class{ruler;ruler2;cachedRulesVersion=-1;cachedRules=[];cachedRules2Version=-1;cachedRules2=[];defaultRulerVersion;defaultRuler2Version;constructor(){this.ruler=new bN,this.ruler2=new bN,this.ruler.push("text",cq),this.ruler.push("linkify",lq),this.ruler.push("newline",uq),this.ruler.push("escape",eq),this.ruler.push("backticks",VW),this.ruler.push("strikethrough",E6.tokenize),this.ruler.push("emphasis",M6.tokenize),this.ruler.push("link",rq),this.ruler.push("image",sq),this.ruler.push("autolink",UW),this.ruler.push("html_inline",oq),this.ruler.push("entity",YW),this.ruler2.push("balance_pairs",Xpe),this.ruler2.push("strikethrough",E6.postProcess),this.ruler2.push("emphasis",M6.postProcess),this.ruler2.push("fragments_join",u1e),this.defaultRulerVersion=this.ruler.version,this.defaultRuler2Version=this.ruler2.version}skipToken(e){const t=e.pos,n=this.getRules(),i=n.length,o=e.cache,s=o[t],r=!!e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules"));if(s!==void 0){e.pos=s;return}let a=!1;if(e.level=e.pos)throw new Error("inline rule didn't increment state.pos");break}}}else if(this.isDefaultRuleset()){if(e.level++,a=wN(e,!0),e.level--,a&&t>=e.pos)throw new Error("inline rule didn't increment state.pos")}else for(let l=0;l=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;a||e.pos++,o[t]=e.pos}tokenize(e){const t=this.getRules(),n=t.length,i=e.posMax;if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules")))){const s=this.isDefaultRuleset();for(;e.pos=e.pos)throw new Error("inline rule didn't increment state.pos")}if(a){if(e.pos>=i)break;continue}e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending();return}const o=this.ruler.getNamedRules("");for(;e.pos=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(r){if(e.pos>=i)break;continue}e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending()}isDefaultRuleset(){return this.ruler.version===this.defaultRulerVersion&&this.ruler2.version===this.defaultRuler2Version}parseSource(e,t,n,i){if(typeof e=="string"&&e.length>0&&this.isDefaultRuleset()&&hq(e)){const l=new Os("text","",0);l.content=e,i.push(l);return}const o=new fq(e,t,n,i);this.tokenize(o);const s=this.getRules2(),r=s.length;if(!(o.env&&(Object.prototype.hasOwnProperty.call(o.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(o.env,"__mdtsProfileRules")))){for(let l=0;l0&&hq(s.content)){const r=new Os("text","",0);r.content=s.content,s.children.push(r);continue}e.md.inline.parse(s.content,e.md,e.env,s.children)}}}const N1e=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u,F1e=/[0-9a-z]/i;function R1e(e){return/^\s]/i.test(e)}function D1e(e){return/^<\/a\s*>/i.test(e)}function O1e(e,t){if(t.schema||t.index!==0||!t.raw)return t;for(let n=1;n=0;r--){const a=o[r];if(a.type==="link_close"){for(r--;r>=0&&o[r].level!==a.level&&o[r].type!=="link_open";)r--;continue}if(a.type==="html_inline"&&(R1e(a.content)&&s>0&&s--,D1e(a.content)&&s++),s>0||a.type!=="text"||!e.md.linkify.test(a.content))continue;const l=a.content;let u=(e.md.linkify.match(l)||[]).map(h=>O1e(e.md.linkify,h));if(u.length===0)continue;const c=[];let d=a.level,f=0;u.length>0&&u[0].index===0&&r>0&&o[r-1].type==="text_special"&&(u=u.slice(1));for(let h=0;hf){const M=new Os("text","",0);M.content=l.slice(f,b),M.level=d,c.push(M)}const v=new Os("link_open","a",1);v.attrs=[["href",g]],v.level=d++,v.markup="linkify",v.info="auto",c.push(v);const w=new Os("text","",0);w.content=y,w.level=d,c.push(w);const A=new Os("link_close","a",-1);A.level=--d,A.markup="linkify",A.info="auto",c.push(A),f=m.lastIndex}if(f!==0){if(f=0;n--){const i=e[n];i.type==="text"&&!t&&(i.content=i.content.replace(H1e,q1e)),i.type==="link_open"&&i.info==="auto"&&t--,i.type==="link_close"&&i.info==="auto"&&t++}}function V1e(e){let t=0;for(let n=e.length-1;n>=0;n--){const i=e[n];i.type==="text"&&!t&&pq.test(i.content)&&(i.content=i.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/gm,"$1—").replace(/(^|\s)--(?=\s|$)/gm,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,"$1–")),i.type==="link_open"&&i.info==="auto"&&t--,i.type==="link_close"&&i.info==="auto"&&t++}}function K1e(e){if(e.md?.options?.typographer)for(let t=e.tokens.length-1;t>=0;t--){const n=e.tokens[t];if(n.type!=="inline")continue;const i=n.content||(Array.isArray(n.children)?n.children.map(o=>o.type==="text"?o.content:"").join(""):"");j1e.test(i)&&U1e(n.children||[]),pq.test(i)&&V1e(n.children||[])}}var Z1e=class{rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t){const n=this.rules.findIndex(i=>i.name===e);n>=0&&this.rules.splice(n,1),this.rules.push({name:e,fn:t,enabled:!0}),this.invalidateCache()}at(e,t){const n=this.rules.findIndex(i=>i.name===e);if(n<0)throw new Error(`Parser rule not found: ${e}`);this.rules[n].fn=t,this.invalidateCache()}before(e,t,n){const i=this.rules.findIndex(s=>s.name===e);if(i<0)throw new Error(`Parser rule not found: ${e}`);const o=this.rules.findIndex(s=>s.name===t);o>=0&&this.rules.splice(o,1),this.rules.splice(i,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}after(e,t,n){const i=this.rules.findIndex(s=>s.name===e);if(i<0)throw new Error(`Parser rule not found: ${e}`);const o=this.rules.findIndex(s=>s.name===t);o>=0&&this.rules.splice(o,1),this.rules.splice(i+1,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;for(const s of n){const r=this.rules.findIndex(a=>a.name===s);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${s}`);continue}i.push(s),this.rules[r].enabled||(this.rules[r].enabled=!0,o=!0)}return o&&this.invalidateCache(),i}disable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;for(const s of n){const r=this.rules.findIndex(a=>a.name===s);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${s}`);continue}i.push(s),this.rules[r].enabled&&(this.rules[r].enabled=!1,o=!0)}return o&&this.invalidateCache(),i}enableOnly(e){const t=new Set(e);let n=!1;for(const i of this.rules){const o=t.has(i.name);i.enabled!==o&&(i.enabled=o,n=!0)}n&&this.invalidateCache()}compileCache(){this.cache=this.rules.filter(e=>e.enabled).map(e=>e.fn),this.namedCache=this.rules.filter(e=>e.enabled).map(e=>({name:e.name,fn:e.fn}))}getRules(e=""){return this.cache||this.compileCache(),this.cache}getNamedRules(e=""){return this.namedCache||this.compileCache(),this.namedCache}};const G1e=/['"]/,AN=/['"]/g,CN="’";function d9(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function Q1e(e,t){let n;const i=[],o=t.md&&t.md.options&&t.md.options.quotes||"“”‘’";for(let s=0;s=0&&!(i[n].level<=a);n--);if(i.length=n+1,r.type!=="text")continue;let l=r.content,u=0,c=l.length;e:for(;u=0)g=l.charCodeAt(d.index-1);else for(n=s-1;n>=0&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n--)if(e[n].content){g=e[n].content.charCodeAt(e[n].content.length-1);break}let y=32;if(u=48&&g<=57&&(h=f=!1),f&&h&&(f=b,h=v),!f&&!h){m&&(r.content=d9(r.content,d.index,CN));continue}if(h)for(n=i.length-1;n>=0;n--){let M=i[n];if(i[n].level=0;t--){const n=e.tokens[t];if(n.type!=="inline")continue;const i=typeof n.content=="string"?n.content:(n.children||[]).map(o=>o.content||"").join("");!G1e.test(i)||!n.children||Q1e(n.children,e)}}function J1e(e){const t=e.tokens||[],n=t.length;for(let i=0;i=4||o.charCodeAt(c)!==62)return!1;if(i)return!0;const h=[],m=[],g=[],y=[],b=e.md.block.ruler.getRulesForState(e,"blockquote"),v=e.parentType;e.parentType="blockquote";let w=!1,A;for(A=t;A=d)break;if(o.charCodeAt(c++)===62&&!x){let F=l[A]+1,I,D;o.charCodeAt(c)===32?(c++,F++,D=!1,I=!0):o.charCodeAt(c)===9?(I=!0,(u[A]+F)%4===3?(c++,F++,D=!1):D=!0):I=!1;let H=F;for(h.push(s[A]),s[A]=c;c=d,m.push(u[A]),u[A]=l[A]+1+(I?1:0),g.push(l[A]),l[A]=H-F,y.push(a[A]),a[A]=c-s[A];continue}if(w)break;let _=!1;for(let F=0,I=b.length;F";const E=[t,0];L.map=E,e.md.block.tokenize(e,t,A);const C=e.push("blockquote_close","blockquote",-1);C.markup=">",e.lineMax=f,e.parentType=v,E[1]=e.line;for(let x=0;x=4){i++,o=i;continue}break}e.line=o;const s=e.push("code_block","code",0);return s.content=`${e.getLines(t,o,4+e.blkIndent,!1)} +`,s.map=[t,e.line],!0}function ome(e,t,n,i){let o=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||o+3>s)return!1;const r=e.src.charCodeAt(o);if(r!==126&&r!==96)return!1;let a=o;o=e.skipChars(o,r);let l=o-a;if(l<3)return!1;const u=e.src.slice(a,o),c=e.src.slice(o,s);if(r===96&&c.includes(String.fromCharCode(r)))return!1;if(i)return!0;let d=t,f=!1;for(;d++,!(d>=n||(o=a=e.bMarks[d]+e.tShift[d],s=e.eMarks[d],o=4)&&(o=e.skipChars(o,r),!(o-a=4)return!1;let c=o.charCodeAt(l);if(c!==35||l>=u)return!1;let d=1;for(c=o.charCodeAt(++l);c===35&&l6||ll&&_N(o.charCodeAt(f-1))&&(u=f),e.line=t+1;const h=e.push("heading_open",xN[d],1);h.markup=SN[d],h.map=[t,e.line];const m=e.push("inline","",0);m.content=o.slice(l,u).trim(),m.map=[t,e.line],m.children=[];const g=e.push("heading_close",xN[d],-1);return g.markup=SN[d],!0}function rme(e){switch(e){case 9:case 32:return!0}return!1}function ame(e,t,n,i){const o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let s=e.bMarks[t]+e.tShift[t];const r=e.src.charCodeAt(s++);if(r!==42&&r!==45&&r!==95)return!1;let a=1;for(;s|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp(`^|$))`,"i"),/^$/,!0],[new RegExp(`${d1e.source}\\s*$`),/^$/,!1]];function lme(e,t,n,i){let o=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(o)!==60)return!1;let r=e.src.slice(o,s),a=0;for(;a=48&&e<=57}var kq=class{src;md;env;tokens;bMarks=[];eMarks=[];tShift=[];sCount=[];bsCount=[];lineFlags=[];blkIndent=0;line=0;lineMax=0;tight=!1;ddIndent=-1;listIndent=-1;parentType="root";level=0;constructor(e,t,n,i){this.src=e,this.md=t,this.env=n,this.tokens=i;const o=this.src;let s=0,r=0,a=0,l=!1,u=0;for(let c=0,d=o.length;c0&&this.level++,this.tokens.push(i),i}isEmpty(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]}skipEmptyLines(e){const t=this.bMarks,n=this.tShift,i=this.eMarks;for(let o=this.lineMax;et;){const i=n.charCodeAt(--e);if(i!==9&&i!==32)return e+1}return e}skipChars(e,t){const n=this.src;for(let i=n.length;en;)if(t!==i.charCodeAt(--e))return e+1;return e}getLines(e,t,n,i){if(e>=t)return"";if(e+1===t){const c=e,d=this.bMarks[c];let f=d;const h=i?this.eMarks[c]+1:this.eMarks[c];let m=0;const g=this.src,y=this.bsCount,b=this.tShift;for(;fn?new Array(m-n+1).join(" ")+g.slice(f,h):g.slice(f,h)}const o=new Array(t-e),s=this.src,r=this.bMarks,a=this.eMarks,l=this.bsCount,u=this.tShift;for(let c=0,d=e;dn?o[c]=new Array(f-n+1).join(" ")+s.slice(m,g):o[c]=s.slice(m,g)}return o.join("")}};kq.prototype.Token=Os;function cme(e,t,n){for(let i=t;i=o)return!1;const s=n.charCodeAt(i);switch(s){case 35:case 42:case 43:case 45:case 60:case 62:case 95:case 96:case 126:return!0}return s>=48&&s<=57?!0:cme(n,i,o)}const MN=["","h1","h2"];function dme(e,t,n){const i=e.md.block.ruler.getRulesForState(e,"paragraph"),o=e.src,s=e.bMarks,r=e.tShift,a=e.eMarks,l=e.sCount,u=e.blkIndent,c=bq(e);if(l[t]-u>=4)return!1;const d=e.parentType;e.parentType="paragraph";let f=0,h,m=t+1;for(;m=M)break;if(l[m]-u>3)continue;if(l[m]>=u&&(h=o.charCodeAt(A),h===45||h===61)){let E=A+1,C=E;for(;E=M){f=h===61?1:2;break}if(C-A>1)continue}if(l[m]<0||c&&!wq(e,m,o,A,M))continue;let L=!1;for(let E=0,C=i.length;EA;){const L=o.charCodeAt(M-1);if(L!==9&&L!==32)break;M--}g=o.slice(A,M)}else g=e.getLines(t,m,u,!1).trim();e.line=m+1;const y=h===61?"=":"-",b=e.push("heading_open",MN[f],1);b.markup=y,b.map=[t,e.line];const v=e.push("inline","",0);v.content=g,v.map=[t,e.line-1],v.children=[];const w=e.push("heading_close",MN[f],-1);return w.markup=y,e.parentType=d,!0}function Aq(e){switch(e){case 9:case 32:return!0}return!1}function TN(e,t){const n=e.eMarks,i=e.bMarks,o=e.tShift,s=e.src,r=n[t];let a=i[t]+o[t];const l=s.charCodeAt(a++);return l!==42&&l!==45&&l!==43||a=a)return-1;let u=s.charCodeAt(l++);if(u<48||u>57)return-1;for(;;){if(l>=a)return-1;if(u=s.charCodeAt(l++),u>=48&&u<=57){if(l-r>=10)return-1;continue}if(u===41||u===46)break;return-1}return l0&&++o=4||e.listIndent>=0&&e.sCount[a]-e.listIndent>=4&&e.sCount[a]=e.blkIndent&&(u=!0);let c,d,f;const h=e.src,m=e.bMarks,g=e.tShift,y=e.eMarks,b=e.sCount,v=e.bsCount,w=m[a]+g[a];if(w>=y[a])return!1;const A=h.charCodeAt(w);if(A>=48&&A<=57){if(f=EN(e,a),f<0||(c=!0,r=w,d=fme(e,a,f),u&&d!==1))return!1}else if(A===42||A===45||A===43){if(f=TN(e,a),f<0)return!1;c=!1}else return!1;if(u&&e.skipSpaces(f)>=y[a])return!1;if(i)return!0;const M=h.charCodeAt(f-1),L=String.fromCharCode(M);if(c){const I=e.push("ordered_list_open","ol",1);d!==void 0&&d!==1&&(I.attrs=[["start",String(d)]])}else e.push("bullet_list_open","ul",1);const E=[a,0];e.tokens[e.tokens.length-1].map=E,e.tokens[e.tokens.length-1].markup=L;let C=!1;const x=e.tokens.length-1,_=e.md.block.ruler.getRulesForState(e,"list"),F=e.parentType;for(e.parentType="list";a=o?$=1:$=D-I,$>4&&($=1);const T=I+$,R=e.push("list_item_open","li",1);R.markup=L;const P=[a,0];R.map=P,c&&(R.info=f-r-1===1?hme[h.charCodeAt(r)-48]:h.slice(r,f-1));const j=e.tight,B=e.tShift[a],K=e.sCount[a],X=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=T,e.tight=!0,e.tShift[a]=H-m[a],e.sCount[a]=D,H>=o&&e.isEmpty(a+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,a,n,!0),(!e.tight||C)&&(l=!1),C=e.line-a>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=X,e.tShift[a]=B,e.sCount[a]=K,e.tight=j,e.push("list_item_close","li",-1).markup=L,a=e.line,P[1]=a,a>=n||e.sCount[a]=4)break;let V=!1;for(let Q=0,ie=_.length;Q3||u[f]<0)continue;if(o==="list"&&u[f]>=c){const w=r[f]+a[f],A=l[f];if(w=A||LN(s.charCodeAt(w+1)))break}else if(M>=48&&M<=57&&w+1=A){L=-1;break}const E=s.charCodeAt(L++);if(E>=48&&E<=57){if(L-w>=10){L=-1;break}continue}if((E===41||E===46)&&(L>=A||LN(s.charCodeAt(L))))break;L=-1;break}if(L>=0)break}}}const y=r[f]+a[f],b=l[f];if(d&&!wq(e,f,s,y,b))continue;let v=!1;for(let w=0,A=i.length;w=4||e.src.charCodeAt(o)!==91)return!1;function l(w){const A=e.lineMax;if(w>=A||e.isEmpty(w))return null;let M=!1;if(e.sCount[w]-e.blkIndent>3&&(M=!0),e.sCount[w]<0&&(M=!0),!M){const C=e.parentType;e.parentType="reference";let x=!1;for(let _=0,F=a.length;_"u"&&(e.env.references={}),typeof e.env.references[v]>"u"&&(e.env.references[v]={title:b,href:f}),e.line=r),!0):!1}function J8(e){switch(e){case 9:case 32:return!0}return!1}const yme=65536;function X8(e,t){const n=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];return e.src.slice(n,i)}function kme(e,t){if(e.lineFlags)return(e.lineFlags[t]&pv.Pipe)!==0;for(let n=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];nn)return!1;let o=t+1;if(e.sCount[o]=4)return!1;let s=e.bMarks[o]+e.tShift[o];if(s>=e.eMarks[o])return!1;const r=e.src.charCodeAt(s++);if(r!==124&&r!==45&&r!==58||s>=e.eMarks[o])return!1;const a=e.src.charCodeAt(s++);if(a!==124&&a!==45&&a!==58&&!J8(a)||r===45&&J8(a)||!kme(e,t))return!1;for(;s=4)return!1;u=NN(l),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop();const d=u.length;if(d===0||d!==c.length)return!1;if(i)return!0;const f=e.parentType;e.parentType="table";const h=e.md.block.ruler.getRulesForState(e,"blockquote"),m=e.push("table_open","table",1),g=[t,0];m.map=g;const y=e.push("thead_open","thead",1);y.map=[t,t+1];const b=e.push("tr_open","tr",1);b.map=[t,t+1];for(let A=0;A=4||(u=NN(l),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop(),w+=d-u.length,w>yme))break;if(o===t+2){const L=e.push("tbody_open","tbody",1);L.map=v=[t+2,0]}const M=e.push("tr_open","tr",1);M.map=[o,o+1];for(let L=0;Lr.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this._rules.findIndex(r=>r.name===t);s>=0&&this._rules.splice(s,1),this._rules.splice(o,0,{name:t,enabled:!0,fn:n,alt:i?.alt||[]}),this.invalidateCache()}after(e,t,n,i){const o=this._rules.findIndex(r=>r.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this._rules.findIndex(r=>r.name===t);s>=0&&this._rules.splice(s,1),this._rules.splice(o+1,0,{name:t,enabled:!0,fn:n,alt:i?.alt||[]}),this.invalidateCache()}getRules(e){const t=e||"";return this.cache||this.compileCache(),this.cache[t]??[]}getNamedRules(e){const t=e||"";return this.namedCache||this.compileCache(),this.namedCache[t]??[]}getRulesForState(e,t){const n=e?.env;return n&&(Object.prototype.hasOwnProperty.call(n,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(n,"__mdtsProfileRules"))?this.getNamedRules(t).map(({name:i,fn:o})=>(s,r,a,l)=>{const u=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now(),c=o(s,r,a,l),d=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();return Lm(s?.env,"block",i,d-u,c,!!l),c}):this.getRules(t)}at(e,t,n){const i=this._rules.findIndex(o=>o.name===e);if(i===-1)throw new Error(`Parser rule not found: ${e}`);this._rules[i].fn=t,n?.alt&&(this._rules[i].alt=n.alt),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;return n.forEach(s=>{const r=this._rules.findIndex(a=>a.name===s);if(r===-1){if(t)return;throw new Error(`Rules manager: invalid rule name ${s}`)}i.push(s),this._rules[r].enabled||(this._rules[r].enabled=!0,o=!0)}),o&&this.invalidateCache(),i}disable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;return n.forEach(s=>{const r=this._rules.findIndex(a=>a.name===s);if(r===-1){if(t)return;throw new Error(`Rules manager: invalid rule name ${s}`)}i.push(s),this._rules[r].enabled&&(this._rules[r].enabled=!1,o=!0)}),o&&this.invalidateCache(),i}enableOnly(e){const t=new Set(e);let n=!1;for(const i of this._rules){const o=t.has(i.name);i.enabled!==o&&(i.enabled=o,n=!0)}n&&this.invalidateCache()}compileCache(){const e=new Set([""]);for(const i of this._rules)if(i.enabled)for(const o of i.alt)e.add(o);const t=Object.create(null),n=Object.create(null);for(const i of e){const o=[],s=[];for(const r of this._rules)r.enabled&&(i!==""&&!r.alt.includes(i)||(o.push(r.fn),s.push({name:r.name,fn:r.fn})));t[i]=o,n[i]=s}this.cache=t,this.namedCache=n}};const h9=[["table",bme,["paragraph","reference"]],["code",ime],["fence",ome,["paragraph","reference","blockquote","list"]],["blockquote",nme,["paragraph","reference","blockquote","list"]],["hr",ame,["paragraph","reference","blockquote","list"]],["list",mme,["paragraph","reference","blockquote"]],["reference",vme],["html_block",lme,["paragraph","reference","blockquote"]],["heading",sme,["paragraph","reference","blockquote"]],["lheading",dme],["paragraph",gme]];var Ame=class{ruler;cachedRulesVersion=-1;cachedRules=[];constructor(){this.ruler=new wme;for(let e=0;e=l[c];)c++;if(e.line=c,c>=n||u[c]=s){e.line=n;break}const h=e.line;let m=!1;for(let g=0;g=e.line)throw new Error("block rule didn't increment state.line");break}if(!m)throw new Error("none of the block rules matched");e.tight=!d,r[e.line-1]+a[e.line-1]>=l[e.line-1]&&(d=!0),c=e.line,c=l[c]&&(d=!0,c++,e.line=c)}return}const f=this.ruler.getNamedRules("");for(;c=l[c];)c++;if(e.line=c,c>=n||u[c]=s){e.line=n;break}const h=e.line;let m=!1;for(let g=0;g=e.line)throw new Error("block rule didn't increment state.line");break}}if(!m)throw new Error("none of the block rules matched");e.tight=!d,r[e.line-1]+a[e.line-1]>=l[e.line-1]&&(d=!0),c=e.line,c=l[c]&&(d=!0,c++,e.line=c)}}parse(e,t,n,i){if(!e||e.length===0)return;const o=new kq(e,t,n,i);this.tokenize(o,o.line,o.lineMax)}getRules(){return this.cachedRulesVersion!==this.ruler.version&&(this.cachedRules=this.ruler.getRules(""),this.cachedRulesVersion=this.ruler.version),this.cachedRules}},Cq=class{src;env;tokens;inlineMode;md;constructor(e,t,n={}){this.src=typeof e=="string"?e||"":e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}};Cq.prototype.Token=Os;const FN=[["normalize",z1e],["block",Kpe],["inline",L1e],["linkify",P1e],["replacements",K1e],["smartquotes",Y1e],["text_join",J1e]],Cme={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:100},xme={parseLinkLabel:jS,parseLinkDestination:zS,parseLinkTitle:HS};function Sme(){return{...Cme}}function _me(){return{...xme}}var Ime=class{fallbackParser;lastState=null;block;inline;ruler;linkifyInstance=null;cachedCoreRulesVersion=-1;cachedCoreRules=[];cachedCoreNamedRulesVersion=-1;cachedCoreNamedRules=[];constructor(){this.block=new Ame,this.inline=new E1e,this.ruler=new Z1e;for(let e=0;e@[\]\\^_`{}~]/;function Yb(e){return!Mme.test(e)}function z0(e,t){const n=e.indexOf(` +`,t);return n===-1?e.length:n}function xk(e,t,n){for(let i=t;i3)return Yb(e);for(let t=0;t=i||t.charCodeAt(r)!==32)return!1;let a=r+1;for(;aa&&t.charCodeAt(l-1)===32;)l--;let u=l;for(;u>a&&t.charCodeAt(u-1)===35;)u--;if(u>a&&t.charCodeAt(u-1)===32)for(l=u-1;l>a&&t.charCodeAt(l-1)===32;)l--;const c=t.slice(a,l);if(!Yb(c))return!1;const d=Eme[s],f=Lme[s],h=Ql("heading_open",d,1,0);h.map=[o,o+1],h.markup=f,e.push(h),e.push(VS(c,o,1));const m=Ql("heading_close",d,-1,0);return m.markup=f,e.push(m),!0}function Fme(e,t,n){const i=Ql("paragraph_open","p",1,0);i.map=[n,n+1],e.push(i),e.push(VS(t,n,1)),e.push(Ql("paragraph_close","p",-1,0))}function Rme(e,t,n){const i=e.charCodeAt(n-1);return i===32||i===9?e.slice(t,n).trim():e.slice(t,n)}function i5(e,t){for(;t=1e5?DN:n5,o="",s=!1,r=!1,a=0,l=0;for(;a"]/,ON=/[&<>"]/g,jme=/&/g,Hme=/[<>"]/g,Wme={"&":"&","<":"<",">":">",'"':"""};function o5(e){return Wme[e]||e}function Vi(e){if(e.length===0)return"";if(e.length<32)return zme.test(e)?e.replace(ON,o5):e;const t=e.includes("&"),n=e.includes("<"),i=e.includes(">"),o=e.includes('"');return!t&&!n&&!i&&!o?e:t&&!n&&!i&&!o?e.replace(jme,"&"):t?e.replace(ON,o5):e.replace(Hme,o5)}const qme=new RegExp(`${/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),Ume=/^#(?:x[a-f0-9]{1,8}|\d{1,8})$/i;function xq(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(qme,(t,n,i)=>{if(n)return n;if(Ume.test(i)){const s=i[1].toLowerCase()==="x"?Number.parseInt(i.slice(2),16):Number.parseInt(i.slice(1),10);return Hw(s)?d2(s):"�"}const o=LS(t);return o!==t?o:t})}const Vme=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/,Kme=/[\n!"#$%&*+\-:<=>@[\]\\^_`{}~]/,Zme=/"/g;function am(e,t){const n=e.indexOf(` +`,t);return n===-1?e.length:n}function Jb(e,t,n){for(let i=t;i=e.length||e.charCodeAt(t)===10?!1:!Jb(e,t,am(e,t))}function PN(e,t,n){return t+2=n||e.charCodeAt(o)!==32)return null;let s=o+1;for(;ss&&e.charCodeAt(r-1)===32;)r--;let a=r;for(;a>s&&e.charCodeAt(a-1)===35;)a--;if(a>s&&e.charCodeAt(a-1)===32)for(r=a-1;r>s&&e.charCodeAt(r-1)===32;)r--;const l=KS(e.slice(s,r));return l===null?null:`${l} +`}function BN(e,t,n){return t+1" +`;case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return null}return`
  • ${e[t]}
  • +`}function Xme(e,t,n){const i=t+2;if(n===i+1)return Jme(e,i);const o=KS(e.slice(t+2,n));return o===null?null:`
  • ${o}
  • +`}function ege(e,t,n){for(;tt;){const o=e.charCodeAt(n-1);if(o!==32&&o!==9)break;n--}let i=n;for(let o=t;o`:"
    ",i.lang=s,i.open=d),{html:`${d}${Vi(c)}
    +`,nextPos:u=25e4,s=[],r={lang:null,open:""};let a="",l="",u="",c="";for(;n +`;A +`,a=b,l=v}let w=p9(e,y);for(;w${y}

    +`,u=h,c=m}const g=de.core.parse(t,n,e).tokens);let r=Sk(t,o);if(o.maxChunks&&r.length>o.maxChunks&&(r=rge(r,o.maxChunks)),_k(t,r))return G8(n,{count:1,fallback:!0,fallbackReason:"unsafe-chunk-boundary",maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines}),Em(n,s,()=>e.core.parse(t,n,e).tokens);let a=0;const l=[];return G8(n,{count:r.length,maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines,globalStateDetected:s||void 0,globalStateFallbackDisabled:o.fallbackOnGlobalState===!1&&!!s}),Em(n,s,()=>{for(let u=0;u=3&&(c?c.marker===w&&M>=c.length&&(c=null):c={marker:w,length:M})}}const y=m-f;o+=y,s+=1,a+=1,g?(l=0,u=0):(l+=1,u+=y);const b=g;if((o>=t.maxChunkChars||s>=t.maxChunkLines)&&!c)if(b)d(m);else{const v=Math.max(10,Math.floor(t.maxChunkLines*.5)),w=Math.max(t.maxChunkChars,8e3);(l>=v||u>=w)&&d(m)}f=m}return n&&d(e.length),i}function _k(e,t,n={rangesCoverWholeSource:!0}){const i=n.rangesCoverWholeSource?t.length-1:t.length;for(let o=0;oe.length||e.charCodeAt(t-1)!==10)return!1;let n=t-2;for(;n>=0&&e.charCodeAt(n)!==10;)n--;for(let i=n+1;i=0;i--)n.push(e[i]);for(;n.length;){const i=n.pop();if(i.map&&(i.map[0]+=t,i.map[1]+=t),i.children)for(let o=i.children.length-1;o>=0;o--)n.push(i.children[o])}}function sge(e,t){for(let n=0;n=0;i--)n.push(e[i]);for(;n.length;){const i=n.pop();if(i.map&&(i.map[0]+=t,i.map[1]+=t),i.children)for(let o=i.children.length-1;o>=0;o--)n.push(i.children[o])}}function ef(e){return e.length===0?0:$o(e)+(e.charCodeAt(e.length-1)===10?0:1)}function hge(e,t,n){for(let i=t;i=3&&(n?n.marker===r&&l>=n.length&&(n=null):n={marker:r,length:l})}i=o===e.length?e.length:o+1}return n!==null}function mge(e,t){if(e.length===0||e.charCodeAt(e.length-1)!==10)return!1;let n=e.length-2;for(;n>=0&&e.charCodeAt(n)!==10;)n--;return hge(e,n+1,e.length-1)?!pge(e,t):!1}function gge(e,t,n,i={}){const o=i.mode??"full",s=i.fenceAware??(o==="stream"?e.options.streamChunkFenceAware??!0:e.options.fullChunkFenceAware??!0);if(i.maxChunkChars!==void 0||i.maxChunkLines!==void 0||i.autoTune===!1){const r=i.maxChunkChars??(o==="stream"?e.options.streamChunkSizeChars??cge:e.options.fullChunkSizeChars??lge),a=i.maxChunkLines??(o==="stream"?e.options.streamChunkSizeLines??dge:e.options.fullChunkSizeLines??uge);return{maxChunkChars:r,maxChunkLines:a,holdBelowChars:r,holdBelowLines:a,fenceAware:s}}return o==="stream"?t<=5e3?{maxChunkChars:16e3,maxChunkLines:250,holdBelowChars:16e3,holdBelowLines:250,fenceAware:s}:t<=2e4?{maxChunkChars:16e3,maxChunkLines:200,holdBelowChars:16e3,holdBelowLines:200,fenceAware:s}:t<=5e4?{maxChunkChars:16e3,maxChunkLines:250,holdBelowChars:16e3,holdBelowLines:250,fenceAware:s}:t<=5e5?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:32e3,holdBelowLines:350,fenceAware:s}:{maxChunkChars:64e3,maxChunkLines:700,holdBelowChars:64e3,holdBelowLines:700,fenceAware:s}:t<=1e5&&n<=2500?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:1e5,holdBelowLines:2500,fenceAware:s}:t<=2e5?{maxChunkChars:2e4,maxChunkLines:150,holdBelowChars:2e4,holdBelowLines:150,fenceAware:s}:t<=5e5?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:32e3,holdBelowLines:350,fenceAware:s}:{maxChunkChars:64e3,maxChunkLines:700,holdBelowChars:64e3,holdBelowLines:700,fenceAware:s}}var ty=class{md;options;pending="";tokens=[];committedChars=0;committedLines=0;fedChunks=0;parsedChunks=0;globalStateEnv=null;markedGlobalStateReason=null;constructor(e,t={}){if(this.md=e,this.options={mode:"full",autoTune:!0,retainTokens:!0,...t},this.options.retainTokens===!1&&!this.options.onChunkTokens)throw new Error("UnboundedBuffer with retainTokens=false requires onChunkTokens")}feed(e){e&&(this.pending+=e,this.fedChunks+=1)}flushAvailable(e={}){if(!this.pending)return null;const t=this.resolveWindow(),n=ef(this.pending);if(this.pending.length=i||n>=o}function Eq(e,t,n){if(e.options.autoUnbounded===!1)return"no";if(t>=(e.options.autoUnboundedThresholdChars??_q))return"yes";const i=e.options.autoUnboundedThresholdLines??Iq;return n!==void 0?n>=i?"yes":"no":t+1e.core.parse(t,n,e).tokens);const s=[],r=new ty(e,{mode:"full",...i,retainTokens:!1,onChunkTokens(a){Mq(s,a)}});if(o&&BS(n,o),r.feed(t),r.flushForce(n),o&&($S(n),i.fallbackOnGlobalState===!1)){const a=od(n)?.unbounded;a&&(a.globalStateDetected=o,a.globalStateFallbackDisabled=!0)}return s}const Nm=(e,t,n)=>en?n:e;function Lq(e){return e.experimental?{...e,...e.experimental}:e}const jN=[{max:5e3,strategy:"discrete",maxChunkChars:32e3,maxChunkLines:150,maxChunks:8,notes:"<=5k"},{max:2e4,strategy:"discrete",maxChunkChars:24e3,maxChunkLines:200,maxChunks:12,notes:"<=20k"},{max:1e5,strategy:"plain",notes:"<=100k plain"},{max:2e5,strategy:"discrete",maxChunkChars:2e4,maxChunkLines:150,maxChunks:12,notes:"<=200k"},{max:5e5,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:16,notes:"<=500k"},{max:5e6,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:16,notes:"<=5M"}],HN=[{max:5e3,strategy:"discrete",maxChunkChars:16e3,maxChunkLines:250,maxChunks:8,notes:"<=5k"},{max:2e4,strategy:"discrete",maxChunkChars:2e4,maxChunkLines:200,maxChunks:24,notes:"<=20k"},{max:1e5,strategy:"discrete",maxChunkChars:2e4,maxChunkLines:200,maxChunks:24,notes:"<=100k"},{max:5e5,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:32,notes:"<=500k"},{max:5e6,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:32,notes:"<=5M"}];function Nq(e,t){return{strategy:t.strategy,maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,maxChunks:t.maxChunks,fenceAware:e,notes:t.notes}}function wge(e,t=Math.max(0,e/40|0),n={}){const i=Lq(n),o=i.fullChunkFenceAware??!0,s=i.fullChunkTargetChunks??8,r=i.fullChunkAdaptive!==!1;for(let a=0;a5e6?{strategy:"plain",fenceAware:o,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:Nm(Math.ceil(e/s),8e3,64e3),maxChunkLines:Nm(Math.ceil(t/s),150,700),maxChunks:Nm(Math.ceil(e/64e3),s,16),fenceAware:o,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:i.fullChunkSizeChars??1e4,maxChunkLines:i.fullChunkSizeLines??200,fenceAware:o,maxChunks:i.fullChunkMaxChunks}}function WN(e,t=Math.max(0,e/40|0),n={}){const i=Lq(n),o=i.streamChunkFenceAware??!0,s=i.streamChunkTargetChunks??8,r=i.streamChunkAdaptive!==!1;for(let a=0;a5e6?{strategy:"plain",fenceAware:o,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:Nm(Math.ceil(e/s),8e3,64e3),maxChunkLines:Nm(Math.ceil(t/s),150,700),maxChunks:Nm(Math.ceil(e/64e3),s,32),fenceAware:o,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:i.streamChunkSizeChars??1e4,maxChunkLines:i.streamChunkSizeLines??200,maxChunks:i.streamChunkMaxChunks,fenceAware:o}}var Age={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"]},inline2:{rules:["balance_pairs","emphasis","fragments_join"]}}},Cge={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},xge={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"]},inline2:{rules:["balance_pairs","fragments_join"]}}};function qw(e){return!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function Ik(e,t){if(qw(e))throw new TypeError(`Renderer rule "${t}" returned a Promise. Use renderAsync() instead.`);return e}const qN=e=>qw(e)?e:Promise.resolve(e);function gv(e){switch(e){case"alt":case"class":case"href":case"id":case"lang":case"rel":case"src":case"start":case"style":case"target":case"title":return e;default:return Vi(e)}}function Zf(e){if(!e||e.length===0)return"";const t=e[0];let n=` ${gv(t[0])}="${Vi(t[1])}"`;for(let i=1;i=e.length)return{langName:e,langAttrs:""};let n=t;for(;n${t} +`;const s=e.attrIndex("class"),r=e.attrs?e.attrs.slice():[],a=`${o.langPrefix??"language-"}${i}`;return s<0?r.push(["class",a]):(r[s]=r[s].slice(),r[s][1]+=` ${a}`),`
    ${t}
    +`}return`
    ${t}
    +`}function h2(e){return!e.attrs||e.attrs.length===0?`${Vi(e.content)}`:`${Vi(e.content)}`}function L6(e){const t=Vi(e.content);return e.attrs?`${t} +`:`
    ${t}
    +`}function Sge(e,t){const n=e.attrs;if(!n||n.length===0)switch(e.type){case"paragraph_open":return`${t}

    `;case"heading_open":return`<${e.tag}>`;case"td_open":return`${t}`;case"th_open":return`${t}`;default:return null}if(n.length===1&&n[0][0]==="style"){if(e.type==="td_open")return`${t}`;if(e.type==="th_open")return`${t}`}return null}function UN(e){const t=e.attrs;return!t||t.length===0?"":t.length===1?``:t.length===2?``:``}function _ge(e){switch(e.type){case"text":case"text_special":case"softbreak":case"hardbreak":case"html_inline":case"code_inline":case"image":return!0;default:return!1}}function VN(e){switch(e.type){case"text":case"text_special":case"softbreak":case"hardbreak":case"html_inline":case"code_inline":return!0;default:return!1}}function e4(e,t){if(e.hidden)return"";const n=e.attrs,i=e.nesting,o=e.tag;if(!n||n.length===0)return i===0?t?`<${o} />`:`<${o}>`:i===-1?``:`<${o}>`;let s=(i===-1?"`}const Ige={langPrefix:"language-",xhtmlOut:!1,breaks:!1},m9=Object.prototype.hasOwnProperty,Ci={code_inline(e,t){return h2(e[t])},code_block(e,t){return L6(e[t])},fence(e,t,n,i,o){const s=e[t],r=s.info?xq(s.info).trim():"",{langName:a,langAttrs:l}=Fq(r),u=n.highlight,c=Vi(s.content);if(!u)return vv(s,c,r,a,n);const d=u(s.content,a,l);return qw(d)?d.then(f=>vv(s,f||c,r,a,n)):vv(s,d||c,r,a,n)},image(e,t,n,i,o){const s=e[t],r=o.renderInlineAsText(s.children||[],n,i),a=s.attrIndex("alt");return a>=0&&s.attrs?s.attrs[a][1]=r:s.attrs?s.attrs.push(["alt",r]):s.attrs=[["alt",r]],e4(s,n.xhtmlOut===!0)},hardbreak(e,t,n){return n.xhtmlOut?`
    +`:`
    +`},softbreak(e,t,n){return n.breaks?n.xhtmlOut?`
    +`:`
    +`:` +`},text(e,t){return Vi(e[t].content)},text_special(e,t){return Vi(e[t].content)},html_block(e,t){return e[t].content},html_inline(e,t){return e[t].content}};function KN(e,t,n){const i=e.info?xq(e.info).trim():"",{langName:o,langAttrs:s}=Fq(i),r=t.highlight,a=Vi(e.content);if(!r)return vv(e,a,i,o,t);const l=r(e.content,o,s);if(qw(l))throw new TypeError('Renderer rule "fence" returned a Promise. Use renderAsync() instead.');return vv(e,l||a,i,o,t)}function s5(e,t,n,i){switch(e.type){case"text":return t.text===Ci.text?e.content.length===0?"":Vi(e.content):null;case"text_special":return t.text_special===Ci.text_special?e.content.length===0?"":Vi(e.content):null;case"softbreak":return t.softbreak===Ci.softbreak?i:null;case"hardbreak":return t.hardbreak===Ci.hardbreak?n:null;case"html_inline":return t.html_inline===Ci.html_inline?e.content:null;case"code_inline":return t.code_inline===Ci.code_inline?h2(e):null;default:return null}}function Mge(e,t,n,i,o){const s=e[0];switch(s.type){case"text":if(o.text===Ci.text)return s.content.length===0?"":Vi(s.content);break;case"text_special":if(o.text_special===Ci.text_special)return s.content.length===0?"":Vi(s.content);break;case"softbreak":if(o.softbreak===Ci.softbreak)return t.breaks?t.xhtmlOut?`
    +`:`
    +`:` +`;break;case"hardbreak":if(o.hardbreak===Ci.hardbreak)return t.xhtmlOut?`
    +`:`
    +`;break;case"html_inline":if(o.html_inline===Ci.html_inline)return s.content;break;case"code_inline":if(o.code_inline===Ci.code_inline)return h2(s);break}const r=o[s.type];if(!r)return e4(s,t.xhtmlOut===!0);const a=r(e,0,t,n,i);return typeof a=="string"?a:Ik(a,s.type)}var Tge=class{rules;baseOptions;normalizedBase;constructor(e={}){this.baseOptions={...e},this.normalizedBase=this.buildNormalizedBase(),this.rules={...Ci}}set(e){return this.baseOptions={...this.baseOptions,...e},this.normalizedBase=this.buildNormalizedBase(),this}render(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");if(e.length===1)return this.renderSingleToken(e,e[0],t,n);const i=this.mergeOptions(t),o=n??{},s=this.rules,r=i.xhtmlOut===!0;let a,l,u,c,d,f,h="",m="",g=!1,y="";for(let b=0;b0&&e[b-1].hidden?` +`:"";if(w==="list_item_open"&&(!v.attrs||v.attrs.length===0)&&b+3${this.renderInlineTokens(C.children||[],i,o)}`,b+=3;continue}}if(b+2 +`,b+=2;continue}}}if(w==="inline"){const E=v.children||[];if(E.length===1){g||(a=s.text,l=s.text_special,u=s.softbreak,c=s.hardbreak,d=s.html_inline,f=s.code_inline,h=i.xhtmlOut?`
    +`:`
    +`,m=i.breaks?h:` +`,g=!0);const C=E[0];switch(C.type){case"text":if(a===Ci.text){y+=Vi(C.content);continue}break;case"text_special":if(l===Ci.text_special){y+=Vi(C.content);continue}break;case"softbreak":if(u===Ci.softbreak){y+=m;continue}break;case"hardbreak":if(c===Ci.hardbreak){y+=h;continue}break;case"html_inline":if(d===Ci.html_inline){y+=C.content;continue}break;case"code_inline":if(f===Ci.code_inline){y+=h2(C);continue}break}}y+=this.renderInlineTokens(E,i,o);continue}const M=s[w];if(!M){const E=v.attrs;if(!v.hidden){if(!E||E.length===0)switch(w){case"hr":y+=r?`


    +`:`
    +`;continue;case"heading_open":y+=`<${v.tag}>`;continue;case"heading_close":y+=` +`;continue;case"paragraph_open":y+=`${A}

    `;continue;case"paragraph_close":y+=`

    +`;continue;case"list_item_open":{const C=e[b+1];y+=A+(C&&(C.type==="inline"||C.hidden||C.nesting===-1&&C.tag==="li")?"
  • ":`
  • +`);continue}case"list_item_close":y+=`
  • +`;continue;case"bullet_list_open":y+=`${A}
      +`;continue;case"bullet_list_close":y+=`
    +`;continue;case"blockquote_open":y+=A+(e[b+1]&&e[b+1].nesting===-1&&e[b+1].tag==="blockquote"?"
    ":`
    +`);continue;case"blockquote_close":y+=`
    +`;continue;case"ordered_list_open":y+=`${A}
      +`;continue;case"ordered_list_close":y+=`
    +`;continue;case"table_open":y+=`${A} +`;continue;case"table_close":y+=`
    +`;continue;case"thead_open":y+=`${A} +`;continue;case"thead_close":y+=` +`;continue;case"tbody_open":y+=`${A} +`;continue;case"tbody_close":y+=` +`;continue;case"tr_open":y+=`${A} +`;continue;case"tr_close":y+=` +`;continue;case"td_open":y+=`${A}`;continue;case"td_close":y+=` +`;continue;case"th_open":y+=`${A}`;continue;case"th_close":y+=` +`;continue}else if(E.length===1){const C=E[0];if(w==="ordered_list_open"&&C[0]==="start"){y+=`${A}
      +`;continue}if(w==="td_open"&&C[0]==="style"){y+=`${A}`;continue}if(w==="th_open"&&C[0]==="style"){y+=`${A}`;continue}}}y+=this.renderToken(e,b,i);continue}if(w==="code_block"&&M===Ci.code_block){y+=L6(v);continue}if(w==="fence"&&M===Ci.fence){y+=KN(v,i);continue}if(w==="html_block"&&M===Ci.html_block){y+=v.content;continue}const L=M(e,b,i,o,this);typeof L=="string"?y+=L:y+=Ik(L,v.type)}return y}async renderAsync(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");const i=this.mergeOptions(t),o=n??{},s=this.rules;let r="";for(let a=0;a0&&e[t-1].hidden?` +`:"",c=l?`> +`:">";if(!a||a.length===0)return s===0?n.xhtmlOut?`${u}<${r} /${c}`:`${u}<${r}${c}`:s===-1?`${u}(n||(n={...t}),n);if(m9.call(e,"highlight")&&e.highlight!==t.highlight&&(i().highlight=e.highlight),m9.call(e,"langPrefix")){const o=e.langPrefix;o!==t.langPrefix&&(i().langPrefix=o)}if(m9.call(e,"xhtmlOut")){const o=e.xhtmlOut;o!==t.xhtmlOut&&(i().xhtmlOut=o)}if(m9.call(e,"breaks")){const o=e.breaks;o!==t.breaks&&(i().breaks=o)}return n||t}buildNormalizedBase(){return Object.freeze({...Ige,...this.baseOptions})}renderSingleToken(e,t,n,i){const o=this.rules,s=t.type;if(s==="code_block"&&o.code_block===Ci.code_block)return L6(t);if(s==="html_block"&&o.html_block===Ci.html_block)return t.content;const r=this.mergeOptions(n),a=i??{};if(s==="inline")return this.renderInlineTokens(t.children||[],r,a);const l=o[s];if(!l)return t.block?this.renderToken(e,0,r):e4(t,r.xhtmlOut===!0);if(s==="fence"&&l===Ci.fence)return KN(t,r);const u=l(e,0,r,a,this);return typeof u=="string"?u:Ik(u,s)}renderInlineTokens(e,t,n){if(!e||e.length===0)return"";const i=this.rules;if(e.length===1)return Mge(e,t,n,this,i);const o=t.xhtmlOut===!0,s=o?`
      +`:`
      +`,r=t.breaks?s:` +`,a=i.text,l=i.text_special,u=i.softbreak,c=i.hardbreak,d=i.html_inline,f=i.code_inline,h=i.link_open,m=i.link_close,g=i.em_open,y=i.em_close,b=i.strong_open,v=i.strong_close;let w="";for(let A=0;A`;if(u===Ci.softbreak&&A+3`,A+=1;continue}if(M.type==="em_open"&&!g&&!y&&A+2${x}`,A+=2;continue}}}if(M.type==="strong_open"&&!b&&!v&&A+2${x}`,A+=2;continue}}}switch(M.type){case"text":if(a===Ci.text){const C=M.content.length===0?"":Vi(M.content);if(d===Ci.html_inline&&A+1=4)return!0;continue}if(a===9){if(r+=4-r%4,s++,r>=4)return!0;continue}break}if(s0&&u<=6){if(l=3)return!0;break}default:if(a>=48&&a<=57){let l=s+1;for(;l57)break;l++}if(l=Z,!J&&ae!==void 0&&(he=$o(e),J=he>=ae)),J){const U=this.parseFullDocument(e,D,n,he,!1);return this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",ms(D,{area:"stream",path:"stream-full",reason:"skip-cache-large-one-shot",unbounded:!!od(D)?.unbounded}),U.tokens}else if(P){const U=(ve,le,xe)=>vexe?xe:ve;he===void 0&&(he=$o(e));const Y=ie&&!Q?WN(e.length,he,n.options):null,ce=Y?.maxChunkChars??(j?U(Math.ceil(e.length/B),8e3,64e3):K??1e4),me=Y?.maxChunkLines??(j?U(Math.ceil(he/B),150,700):X??200),ge=Y?.maxChunks??(j?U(Math.ceil(e.length/64e3),B,32):V),oe=e.length>0&&e.charCodeAt(e.length-1)===10,re=R&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&Y?.strategy!=="plain";if((T||re)&&(e.length>=ce*2||he>=me*2)&&oe){const ve=Xb(n,e,D,{maxChunkChars:ce,maxChunkLines:me,fenceAware:Y?.fenceAware??ee,maxChunks:ge});return this.cache={src:e,tokens:ve,env:D,lineCount:he,lastSegment:void 0,globalStateReason:La(e)},this.updateCacheLineCount(this.cache,he),this.recordChunkedParseResult(D,T?"explicit-initial-large-doc":"default-initial-large-doc"),ve}}const te=this.parseFullDocument(e,D,n,he);return he=te.lineCount,this.cache={src:e,tokens:te.tokens,env:D,lineCount:he,lastSegment:void 0,globalStateReason:La(e)},this.updateCacheLineCount(this.cache,he),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",ms(D,{area:"stream",path:"stream-full",reason:"initial-parse",unbounded:!!od(D)?.unbounded}),te.tokens}if(e===o.src)return this.stats.total+=1,this.stats.cacheHits+=1,this.stats.lastMode="cache",ms(o.env,{area:"stream",path:"stream-cache",reason:"same-source"}),o.tokens;const s=e.startsWith(o.src)?e.slice(o.src.length):null;let r=o.globalStateReason;r===void 0&&(r=La(o.src),o.globalStateReason=r);const a=r?null:s!==null?this.detectGlobalStateForAppend(o,s):La(e),l=r||a;if(l){const D=i??o.env;Td(D);const H=La(e),$=this.parseFullDocument(e,D,n),T=$.tokens,R=$.lineCount;return this.cache={src:e,tokens:T,env:D,lineCount:R,lastSegment:void 0,globalStateReason:H},this.updateCacheLineCount(this.cache,R),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",ms(D,{area:"stream",path:"stream-full",reason:`global-state:${l}`,unbounded:!!od(D)?.unbounded}),T}const u=n.options?.streamOptimizationMinSize??this.MIN_SIZE_FOR_OPTIMIZATION;if(o.src.length5e3?H=8:c.length>1e3?H=6:c.length>200&&(H=4),H=Math.min(H,D);let $=null;const T=n.options?.streamContextParseStrategy??"chars",R=n.options?.streamContextParseMinChars??200,P=n.options?.streamContextParseMinLines??2;let j;const B=()=>(j===void 0&&(j=$o(c)),j),K=this.canDirectlyParseAppend(o),X=K&&this.shouldUseUnboundedAppend(e,o,c);let V=!1;if(!K)switch(T){case"lines":V=B()>=P;break;case"constructs":if(c.length>=R){V=!0;break}if(Nge(c)){V=!0;break}V=B()>=P;break;case"chars":default:V=c.length>=R}if(H>0&&V){const ee=this.getTailLines(o.src,H)+c;try{const Ce=this.core.parse(ee,o.env,n).tokens,Z=Ce.findIndex(ae=>ae.map&&typeof ae.map[1]=="number"&&ae.map[1]>H);if(Z!==-1){const ae=Ce.slice(Z),he=D-H;he!==0&&this.shiftTokenLines(ae,he),$={tokens:ae}}}catch{$=null}}else $=null;if(!$){const ee=D;if(X)$={tokens:mv(n,c,o.env,{mode:"stream"})},ee>0&&this.shiftTokenLines($.tokens,ee);else{const Ce=this.core.parse(c,o.env,n);ee>0&&this.shiftTokenLines(Ce.tokens,ee),$=Ce}}let Q=0;if(o.tokens.length>0&&$.tokens.length>0){const ee=o.tokens[o.tokens.length-1],Ce=$.tokens[0];try{ee.type==="inline"&&Ce.type==="inline"&&(Ce.children&&Ce.children.length>0&&(ee.children||(ee.children=[]),this.appendTokens(ee.children,Ce.children)),ee.content=(ee.content||"")+(Ce.content||""),Q=1)}catch{Q=0}}const ie=o.tokens.length;if($.tokens.length>Q){const ee=o.tokens,Ce=$.tokens,Z=Math.min(ee.length,Ce.length-Q);let ae=0;for(let he=Z;he>0;he--){let J=!0;for(let te=0;te0&&(Q+=ae),Ce.length>Q&&this.appendTokens(o.tokens,Ce,Q)}if(o.src=e,o.globalStateReason=null,o.lineCount=D+(j??B()),o.tokens.length>ie){const ee=this.getLastSegment(o.tokens,e,ie,o.tokens.length,e.length-c.length,D);ee?o.lastSegment=ee:o.lastSegment=void 0}else o.lastSegment=void 0;return this.stats.total+=1,this.stats.appendHits+=1,X&&(this.stats.unboundedAppendHits=(this.stats.unboundedAppendHits||0)+1),this.stats.lastMode="append",ms(o.env,{area:"stream",path:X?"stream-unbounded-append":"stream-append",reason:X?"large-delta":"safe-append",unbounded:X}),o.tokens}const d=i??o.env,f=this.tryTailSegmentReparse(e,o,d,n);if(f)return this.stats.total+=1,this.stats.tailHits+=1,this.stats.lastMode="tail",ms(d,{area:"stream",path:"stream-tail",reason:"tail-reparse"}),f;const h=!!n.__explicitStreamChunkFallbackSetting,m=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,g=!!n.options?.streamChunkedFallback,y=!h&&!c&&m,b=g||y,v=n.options?.streamChunkAdaptive!==!1,w=n.options?.streamChunkTargetChunks??8,A=n.options?.streamChunkSizeChars,M=n.options?.streamChunkSizeLines,L=n.options?.streamChunkMaxChunks,E=!!n.__explicitStreamChunkConfig,C=n.options?.autoTuneChunks!==!1,x=n.options?.streamChunkFenceAware??!0;let _=c&&o.lineCount!==void 0?o.lineCount+$o(c):void 0;if(b){_===void 0&&(_=$o(e));const D=(B,K,X)=>BX?X:B,H=C&&!E?WN(e.length,_,n.options):null,$=H?.maxChunkChars??(v?D(Math.ceil(e.length/w),8e3,64e3):A??1e4),T=H?.maxChunkLines??(v?D(Math.ceil(_/w),150,700):M??200),R=H?.maxChunks??(v?D(Math.ceil(e.length/64e3),w,32):L),P=e.length>0&&e.charCodeAt(e.length-1)===10,j=y&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&H?.strategy!=="plain";if((g||j)&&(e.length>=$*2||_>=T*2)&&P){const B=Xb(n,e,d,{maxChunkChars:$,maxChunkLines:T,fenceAware:H?.fenceAware??x,maxChunks:R});return this.cache={src:e,tokens:B,env:d,lineCount:_,lastSegment:void 0,globalStateReason:La(e)},this.updateCacheLineCount(this.cache,_),this.recordChunkedParseResult(d,g?"explicit-fallback-large-doc":"default-fallback-large-doc"),B}}const F=this.parseFullDocument(e,d,n,_),I=F.tokens;return _=F.lineCount,this.cache={src:e,tokens:I,env:d,lineCount:_,lastSegment:void 0,globalStateReason:La(e)},this.updateCacheLineCount(this.cache,_),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",ms(d,{area:"stream",path:"stream-full",reason:"fallback-full",unbounded:!!od(d)?.unbounded}),I}recordChunkedParseResult(e,t){const n=od(e)?.chunk,i=n?.fallback?String(n.fallbackReason||"global-state"):null;if(this.stats.total+=1,i){this.stats.fullParses+=1,this.stats.lastMode="full",ms(e,{area:"stream",path:"stream-full",reason:`global-state:${i}`,unbounded:!!od(e)?.unbounded});return}this.stats.chunkedParses=(this.stats.chunkedParses||0)+1,this.stats.lastMode="chunked",ms(e,{area:"stream",path:"stream-chunked",chunked:!0,reason:t})}parseFullDocument(e,t,n,i,o=!0){const s=La(e);X2(t)&&Td(t);const r=typeof n.__canUseImplicitLargeInputStrategy!="function"||n.__canUseImplicitLargeInputStrategy()?Eq(n,e.length,i):"no";if(r==="yes"){const l=mv(n,e,t);return ms(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-char-threshold",unbounded:!0}),{tokens:l,lineCount:i??(o?$o(e):0)}}let a=i;if(r==="need-lines"&&(a=$o(e),Tq(n,e.length,a))){const l=mv(n,e,t);return ms(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-line-threshold",unbounded:!0}),{tokens:l,lineCount:a}}return a===void 0&&(a=o?$o(e):0),{tokens:Em(t,s,()=>this.core.parse(e,t,n).tokens),lineCount:a}}shouldUseUnboundedAppend(e,t,n){return!n||e.length=this.MIN_UNBOUNDED_APPEND_CHARS?!0:$o(n)>=this.MIN_UNBOUNDED_APPEND_LINES}getAppendedSegment(e,t,n){if(n===null||n===void 0&&!t.startsWith(e)||!e.endsWith(` +`))return null;const i=n??t.slice(e.length);if(!i)return null;const o=i.length;if(i.charCodeAt(o-1)!==10)return null;let s=0,r=-1;for(let l=0;l=2));l++);if(s<2)return null;const a=(r===-1?i:i.slice(0,r)).trim();if(a.length===0)return null;if(/^[-=]+$/.test(a)){const l=e.slice(0,-1),u=l.lastIndexOf(` +`);if(l.slice(u+1).trim().length>0)return null}return this.endsInsideOpenFence(e)||this.mayContainReferenceDefinition(i)?null:i}tryTailSegmentReparse(e,t,n,i){const o=this.ensureLastSegment(t);if(!o||o.srcOffset<=0&&o.tokenStart<=0)return null;const s=t.src.slice(0,o.srcOffset);if(!e.startsWith(s))return null;const r=t.src.slice(o.srcOffset),a=e.slice(o.srcOffset);if(a===r)return null;const l=e.startsWith(t.src)?e.slice(t.src.length):null;if(l){const u=this.tryContainerTailAppendMerge(e,t,n,i,o,l);if(u)return u}if(this.mayContainReferenceDefinition(r)||this.mayContainReferenceDefinition(a))return null;try{const u=this.core.parse(a,n,i),c=this.getLastSegment(u.tokens,a);return o.lineStart>0&&this.shiftTokenLines(u.tokens,o.lineStart),t.src=e,t.env=n,t.globalStateReason=null,t.globalStateCarry=void 0,t.tokens.length=o.tokenStart,this.appendTokens(t.tokens,u.tokens),t.lineCount=o.lineStart+$o(a),c?t.lastSegment={tokenStart:o.tokenStart+c.tokenStart,tokenEnd:o.tokenStart+c.tokenEnd,lineStart:o.lineStart+c.lineStart,lineEnd:o.lineStart+c.lineEnd,srcOffset:o.srcOffset+c.srcOffset}:t.lastSegment=null,t.tokens}catch{return null}}getTailLines(e,t){if(t<=0)return"";let n=t;for(let i=e.length-1;i>=0;i--)if(e.charCodeAt(i)===10&&(n--,n===0))return e.slice(i+1);return e}endsInsideOpenFence(e){const n=e.length>4e3?e.length-4e3:0,i=e.slice(n),o=i.length;let s=null,r=0;for(;r<=o;){let a=i.indexOf(` +`,r);a===-1&&(a=o);let l=r;for(;l=3&&(s?s.marker===u&&d>=s.length&&(s=null):s={marker:u,length:d})}}if(a===o)break;r=a+1}return s!==null}peek(){return this.cache?.tokens??Lge}getStats(){return{...this.stats}}appendTokens(e,t,n=0,i=t.length){for(let o=n;or5?n.slice(n.length-r5):n,i&&(e.globalStateReason=i),i}ensureLastSegment(e){return e.lastSegment!==void 0||(e.lastSegment=this.getLastSegment(e.tokens,e.src)),e.lastSegment}getLastSegment(e,t,n=0,i=e.length,o,s){if(i<=n)return null;let r=Number.POSITIVE_INFINITY,a=-1,l=0;for(let u=i-1;u>=n;u--){const c=e[u];if(c.map&&(c.map[0]a&&(a=c.map[1])),c.nesting<0){l+=-c.nesting;continue}if(c.nesting>0){if(l-=c.nesting,c.level===0&&l<=0){const d=Number.isFinite(r)?r:c.map?.[0]??0,f=a>=d?a:c.map?.[1]??d;return{tokenStart:u,tokenEnd:i,lineStart:d,lineEnd:f,srcOffset:this.getLineStartOffset(t,d,o,s)}}continue}if(c.level===0&&l===0){const d=Number.isFinite(r)?r:c.map?.[0]??0,f=a>=d?a:c.map?.[1]??d;return{tokenStart:u,tokenEnd:i,lineStart:d,lineEnd:f,srcOffset:this.getLineStartOffset(t,d,o,s)}}}return null}getLineStartOffset(e,t,n,i){if(n!==void 0&&i!==void 0&&t>=i)return this.getLineStartOffsetFrom(e,n,t-i);if(t<=0)return 0;let o=t,s=-1;for(;o>0;){if(s=e.indexOf(` +`,s+1),s===-1)return e.length;o--}return s+1}getLineStartOffsetFrom(e,t,n){if(n<=0)return t;let i=n,o=t-1;for(;i>0;){if(o=e.indexOf(` +`,o+1),o===-1)return e.length;i--}return o+1}mayContainReferenceDefinition(e){return e.includes("]:")?/(?:^|\n)[ \t]{0,3}\[[^\]\n]+\]:/.test(e):!1}canDirectlyParseAppend(e){if(!this.endsWithBlankLine(e.src))return!1;const t=this.ensureLastSegment(e);if(!t)return!1;switch(e.tokens[t.tokenStart]?.type){case"paragraph_open":case"heading_open":case"fence":case"code_block":case"html_block":case"hr":case"table_open":return!0;default:return!1}}tryContainerTailAppendMerge(e,t,n,i,o,s){if(!s||this.mayContainReferenceDefinition(s))return null;const r=t.tokens[o.tokenStart];switch(r?.type){case"bullet_list_open":case"ordered_list_open":return this.tryListTailAppendMerge(e,t,n,i,o,s,r);case"table_open":return this.tryTableTailAppendMerge(e,t,n,i,o,s,r);default:return null}}tryListTailAppendMerge(e,t,n,i,o,s,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10)return null;const a=o.lineEnd-o.lineStart,l=t.src.length-o.srcOffset;if(a0&&this.shiftTokenLines(d,f);const h=this.getListParagraphMode(t.tokens,o.tokenStart,t.tokens.length,r.level),m=this.getListParagraphMode(c,0,c.length,0);(h==="loose"||m==="loose"||this.endsWithBlankLine(t.src)||(c[0]?.map?.[0]??0)>0)&&(this.setListParagraphVisibility(t.tokens,o.tokenStart,t.tokens.length,r.level,!1),this.setListParagraphVisibility(d,0,d.length,r.level,!1)),t.tokens.splice(t.tokens.length-1,0,...d),t.src=e,t.env=n,t.globalStateReason=null;const g=f+$o(s);t.lineCount=g;const y=this.getDocLineCount(e,g);return r.map&&(r.map[1]=y),t.lastSegment={tokenStart:o.tokenStart,tokenEnd:t.tokens.length,lineStart:o.lineStart,lineEnd:y,srcOffset:o.srcOffset},t.tokens}tryTableTailAppendMerge(e,t,n,i,o,s,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10||/(?:^|\n)[ \t]*\n/.test(s))return null;const a=o.lineEnd-o.lineStart,l=t.src.length-o.srcOffset;if(a=0?d.slice(f.tbodyOpenIndex+1,f.tbodyCloseIndex):d.slice(f.tbodyOpenIndex,f.tbodyCloseIndex+1);if(m.length===0)return null;const g=o.lineEnd-2;g!==0&&this.shiftTokenLines(m,g);const y=h.tbodyCloseIndex>=0?h.tbodyCloseIndex:h.tableCloseIndex,b=t.lineCount??$o(t.src);t.tokens.splice(y,0,...m),t.src=e,t.env=n,t.globalStateReason=null;const v=b+$o(s);t.lineCount=v;const w=this.getDocLineCount(e,v);if(r.map&&(r.map[1]=w),h.tbodyOpenIndex>=0){const A=t.tokens[h.tbodyOpenIndex];A?.map&&(A.map[1]=w)}return t.lastSegment={tokenStart:o.tokenStart,tokenEnd:t.tokens.length,lineStart:o.lineStart,lineEnd:w,srcOffset:o.srcOffset},t.tokens}getTableHeaderContext(e){const t=e.indexOf(` +`);if(t<0)return null;const n=e.indexOf(` +`,t+1);return n<0?null:e.slice(0,n+1)}getTableBodySection(e,t,n,i){if(t<0||t>=n||e[t]?.type!=="table_open")return null;let o=-1;for(let a=n-1;a>t;a--){const l=e[a];if(l.type==="table_close"&&l.level===i){o=a;break}}if(o<0)return null;let s=-1,r=-1;for(let a=t+1;a=0){for(let a=o-1;a>s;a--){const l=e[a];if(l.type==="tbody_close"&&l.level===i+1){r=a;break}}if(r<0)return null}return{tableCloseIndex:o,tbodyOpenIndex:s,tbodyCloseIndex:r}}isSingleTopLevelContainer(e,t,n,i){if(e.length<2)return!1;const o=e[0],s=e[e.length-1];if(o.type!==t||s.type!==n||o.level!==0||s.level!==0||i!==void 0&&o.markup!==i)return!1;let r=0;for(let a=0;a0&&a0||l.nesting<0)&&(r+=l.nesting)}return r===0}getListParagraphMode(e,t,n,i){let o=!1,s=!1;const r=i+2;for(let a=t;a=0;){const i=e.charCodeAt(n);if(i===32||i===9){n--;continue}return i===10}return!0}getDocLineCount(e,t=$o(e)){return e.length===0?0:e.charCodeAt(e.length-1)===10?t:t+1}shiftTokenLines(e,t){if(t===0)return;let n=null;for(let i=0;i=0;s--)n.push(o.children[s]);for(;n.length>0;){const s=n.pop();if(s.map&&(s.map[0]+=t,s.map[1]+=t),s.children)for(let r=s.children.length-1;r>=0;r--)n.push(s.children[r])}}}}};const GN={default:Cge,zero:xge,commonmark:Age};function Oge(e){return{core:e.core.ruler.version,block:e.block.ruler.version,inline:e.inline.ruler.version,inline2:e.inline.ruler2.version}}function Pge(e,t){return e.core.ruler.version!==t.core||e.block.ruler.version!==t.block||e.inline.ruler.version!==t.inline||e.inline.ruler2.version!==t.inline2}function QN(e){return e.experimental?{...e,...e.experimental}:e}function jl(e,t){if(!e)return!1;if(Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==void 0)return!0;const n=e.experimental;return!!n&&Object.prototype.hasOwnProperty.call(n,t)&&n[t]!==void 0}function YN(e,t,n){for(let i=0;i=4?n.quotes=[C[0],C[1],C[2],C[3]]:n.quotes=["“","”","‘","’"]}let r=YN(s?.options,o,["fullChunkSizeChars","fullChunkSizeLines","fullChunkMaxChunks"]),a=YN(s?.options,o,["streamChunkSizeChars","streamChunkSizeLines","streamChunkMaxChunks"]),l=JN(s?.options,o,"fullChunkedFallback"),u=JN(s?.options,o,"streamChunkedFallback"),c=!1,d=null,f=null;const h=new Ime;let m=null;const g=()=>(m||(m=new Ege(n)),m);let y=null;const b=()=>(y||(y=new Dge(h)),y);let v=null;const w=()=>(v||(v=new zW({fuzzyLink:!0})),v),A=C=>!c&&!!d&&!Pge(C,d),M=(C,x)=>i==="default"&&!c&&m===null&&f!==null&&C.parse===f&&A(C)&&!C.stream.enabled&&x<(C.options.autoUnboundedThresholdChars??4e6)&&C.options.html===!1&&C.options.xhtmlOut===!1&&C.options.breaks===!1&&C.options.langPrefix==="language-"&&C.options.linkify===!1&&C.options.typographer===!1&&C.options.highlight===null,L=(C,x)=>i==="default"&&!c&&A(C)&&!C.stream.enabled&&!C.options.fullChunkedFallback&&x<(C.options.autoUnboundedThresholdChars??4e6)&&C.options.html===!1&&C.options.linkify===!1&&C.options.typographer===!1,E={core:h,block:h.block,inline:h.inline,get linkify(){const C=w();return Object.defineProperty(this,"linkify",{value:C,writable:!0,configurable:!0}),C},get renderer(){const C=g();return Object.defineProperty(this,"renderer",{value:C,writable:!0,configurable:!0}),C},options:n,__explicitFullChunkConfig:r,__explicitStreamChunkConfig:a,__explicitFullChunkFallbackSetting:l,__explicitStreamChunkFallbackSetting:u,__canUseImplicitLargeInputStrategy(){return A(this)},set(C){const x=QN(C);return this.options={...this.options,...x},(jl(C,"fullChunkSizeChars")||jl(C,"fullChunkSizeLines")||jl(C,"fullChunkMaxChunks"))&&(r=!0,this.__explicitFullChunkConfig=!0),(jl(C,"streamChunkSizeChars")||jl(C,"streamChunkSizeLines")||jl(C,"streamChunkMaxChunks"))&&(a=!0,this.__explicitStreamChunkConfig=!0),jl(C,"fullChunkedFallback")&&(l=!0,this.__explicitFullChunkFallbackSetting=!0),jl(C,"streamChunkedFallback")&&(u=!0,this.__explicitStreamChunkFallbackSetting=!0),m&&m.set(x),typeof x.stream=="boolean"&&(this.stream.enabled=x.stream,y&&(y.reset(),y.resetStats())),this},configure(C){const x=typeof C=="string"?GN[C]:C;if(!x)throw new Error("Wrong `markdown-it` preset, can't be empty");if(x.options&&this.set(x.options),x.components){const _=x.components;_.core?.rules&&this.core.ruler.enableOnly(_.core.rules),_.block?.rules&&this.block.ruler.enableOnly(_.block.rules),_.inline?.rules&&this.inline.ruler.enableOnly(_.inline.rules),_.inline2?.rules&&this.inline.ruler2.enableOnly(_.inline2.rules)}return this},enable(C,x){const _=Array.isArray(C)?C:[C],F=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],I=new Set;for(const D of F){if(!D)continue;const H=D.enable(_,!0);for(let $=0;$!I.has(H));if(D.length)throw new Error(`Rules manager: invalid rule name ${D.join(", ")}`)}return this},disable(C,x){const _=Array.isArray(C)?C:[C],F=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],I=new Set;for(const D of F){if(!D)continue;const H=D.disable(_,!0);for(let $=0;$!I.has(H));if(D.length)throw new Error(`Rules manager: invalid rule name ${D.join(", ")}`)}return this},use(C,...x){const _=typeof C=="function"?C:C&&typeof C.default=="function"?C.default:void 0;if(!_)throw new TypeError("MarkdownIt.use: plugin must be a function");const F=[this,...x],I=C;return c=!0,_.apply(I,F),this},render(C,x){let _;if(M(this,C.length)){x!==void 0&&(ia(x),_=Z8("render"));const D=_?F1():0,H=_?zN(C,_):$N(C);if(_&&(_.attemptMs=F1()-D,H===null&&(_.fallbackReason="unsupported-stock-subset"),p0(x,_)),H!==null)return x!==void 0&&ms(x,{area:"render",path:"stock-fast",reason:"stock-subset"}),H}const F=x??{},I=this.parse(C,F);return _&&p0(F,_),g().render(I,this.options,F)},async renderAsync(C,x){let _;if(M(this,C.length)){x!==void 0&&(ia(x),_=Z8("render"));const D=_?F1():0,H=_?zN(C,_):$N(C);if(_&&(_.attemptMs=F1()-D,H===null&&(_.fallbackReason="unsupported-stock-subset"),p0(x,_)),H!==null)return x!==void 0&&ms(x,{area:"render",path:"stock-fast",reason:"stock-subset"}),H}const F=x??{},I=this.parse(C,F);return _&&p0(F,_),g().renderAsync(I,this.options,F)},renderIterable(C,x={}){const _=this.parseIterable(C,x);return g().render(_,this.options,x)},async renderAsyncIterable(C,x={}){const _=await this.parseAsyncIterable(C,x);return g().renderAsync(_,this.options,x)},renderInline(C,x={}){const _=this.parseInline(C,x);return g().render(_,this.options,x)},validateLink:gq,normalizeLink:vq,normalizeLinkText:yq,utils:ipe,helpers:{...Upe},parse(C,x){if(typeof C!="string")throw new TypeError("Input data should be a String");if(x!==void 0&&ia(x),L(this,C.length)){const D=x===void 0?void 0:Z8("parse"),H=D?F1():0,$=$me(C,D);if(D&&(D.attemptMs=F1()-H,$===null&&(D.fallbackReason="unsupported-stock-subset"),p0(x,D)),$!==null)return x!==void 0&&ms(x,{area:"parse",path:"stock-fast",reason:"stock-subset"}),$}const _=x??{};let F;if(!this.stream.enabled&&!this.options.fullChunkedFallback&&A(this)){const D=Eq(this,C.length);if(D==="yes"){const H=mv(this,C,_);return ms(x,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"char-threshold"}),H}D==="need-lines"&&(F=$o(C))}if(!this.stream.enabled){const D=C.length,H=this.options.autoTuneChunks!==!1,$=r,T=!l&&A(this),R=!!this.options.fullChunkedFallback,P=T&&D>=2e5;let j;(R||P||F!==void 0)&&(j=F??$o(C));const B=(R||P)&&H&&!$?wge(D,j,this.options):null;if(R||P){const K=j??0;if(R?D>=(this.options.fullChunkThresholdChars??2e4)||K>=(this.options.fullChunkThresholdLines??400):P){if(B&&B.strategy!=="plain"){const X=Xb(this,C,_,{maxChunkChars:B.maxChunkChars,maxChunkLines:B.maxChunkLines,fenceAware:B.fenceAware,maxChunks:B.maxChunks});return x&&XN(x,R?"explicit-full-chunk":"default-large-string"),X}if(R){const X=(J,te,U)=>JU?U:J,V=this.options.fullChunkAdaptive!==!1,Q=this.options.fullChunkTargetChunks??8,ie=X(Math.ceil(D/Q),8e3,64e3),ee=X(Math.ceil(K/Q),150,700),Ce=V?ie:this.options.fullChunkSizeChars??1e4,Z=V?ee:this.options.fullChunkSizeLines??200,ae=V?X(Math.ceil(D/64e3),Q,32):this.options.fullChunkMaxChunks,he=Xb(this,C,_,{maxChunkChars:Ce,maxChunkLines:Z,fenceAware:this.options.fullChunkFenceAware??!0,maxChunks:ae});return x&&XN(x,"explicit-full-chunk"),he}}}if(F!==void 0&&A(this)&&Tq(this,D,j??F)){const K=mv(this,C,_);return ms(x,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"line-threshold"}),K}}const I=La(C);return ms(x,{area:"parse",path:"plain",reason:"default-plain"}),Em(_,I,()=>h.parse(C,_,this).tokens)},parseIterable(C,x={}){return ia(x),vge(this,C,x)},parseAsyncIterable(C,x={}){return ia(x),yge(this,C,x)},parseIterableToSink(C,x,_={}){return ia(_),kge(this,C,x,_)},parseAsyncIterableToSink(C,x,_={}){return ia(_),bge(this,C,x,_)},parseInline(C,x={}){if(typeof C!="string")throw new TypeError("Input data should be a String");ia(x),X2(x)&&Td(x);const _=h.createState(C,x,this);return _.inlineMode=!0,h.process(_),_.tokens}};if(E.stream={enabled:!!n.stream,parse(C,x){return E.stream.enabled?b().parse(C,x,E):E.parse(C,x??{})},reset(){b().reset()},peek(){return y?y.peek():[]},stats(){return y?y.getStats():{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}},resetStats(){y&&y.resetStats()}},s?.components){const C=s.components;C.core?.rules&&E.core.ruler.enableOnly(C.core.rules),C.block?.rules&&E.block.ruler.enableOnly(C.block.rules),C.inline?.rules&&E.inline.ruler.enableOnly(C.inline.rules),C.inline2?.rules&&E.inline.ruler2.enableOnly(C.inline2.rules)}return d=Oge(E),f=E.parse,E}var $ge=Bge;const Dq=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],zge=["a","abbr","b","bdi","bdo","button","cite","code","data","del","dfn","em","font","i","ins","kbd","label","mark","q","s","samp","small","span","strong","sub","sup","time","u","var"],Oq=["article","aside","blockquote","details","div","figcaption","figure","footer","header","h1","h2","h3","h4","h5","h6","li","main","nav","ol","p","pre","section","summary","table","tbody","td","th","thead","tr","ul"],jge=["svg","g","path"],Hge=["address","audio","body","canvas","caption","colgroup","datalist","dd","dialog","dl","dt","fieldset","form","head","hgroup","html","iframe","legend","map","menu","meter","noscript","object","optgroup","option","output","picture","progress","rp","rt","ruby","script","select","style","template","textarea","tfoot","title","video"],Wge=["onclick","onerror","onload","onmouseover","onmouseout","onmousedown","onmouseup","onkeydown","onkeyup","onfocus","onblur","onsubmit","onreset","onchange","onselect","ondblclick","ontouchstart","ontouchend","ontouchmove","ontouchcancel","onwheel","onscroll","oncopy","oncut","onpaste","oninput","oninvalid","onsearch","innerhtml","outerhtml","textcontent","innertext","srcdoc","ping"],qge=["action","data","href","src","srcset","poster","xlink:href","formaction"],Uge=["script"],Vge=["pre","iframe","picture","script","style","table","tbody","td","tfoot","th","thead","textarea","tr","title","video"],Gf=new Set(Dq),Pq=new Set(Oq),p2=new Set([...Dq,...zge,...Oq,...jge]),Bq=new Set([...p2,...Hge]),Kge=new Set(Wge),Zge=new Set(qge),ny=new Set(Uge),$q=new Set(Vge);function zq(e){let t="";for(const n of e){const i=n.charCodeAt(0);i<=31||i>=127&&i<=159||/\s/u.test(n)||(t+=n)}return t}const Gge={amp:"&",bsol:"\\",colon:":",newline:` +`,sol:"/",tab:" "};function jq(e){return e.replace(/&(?:#(\d+)|#x([0-9a-f]+)|([a-z][a-z0-9]+));?/gi,(t,n,i,o)=>{const s=n??i;if(s){const r=Number.parseInt(s,n?10:16);try{return Number.isFinite(r)?String.fromCodePoint(r):""}catch{return""}}return Gge[String(o??"").toLowerCase()]??t})}const g9=new Set(["http","https","mailto","tel"]),Qge=new Set(["javascript","vbscript","data","file","ftp","blob","filesystem","intent","chrome","chrome-extension","moz-extension","ms-browser-extension","view-source"]),Bh=new Set(["http","https"]);function Hq(e){return e.match(/^([a-z][a-z0-9+.-]*):/i)?.[1]?.toLowerCase()??""}const Yge=/^https?:\/\//i;function Jge(e){if(!Yge.test(e))return!1;for(const t of e){const n=t.charCodeAt(0);if(t==="&"||n<=32||n>=127&&n<=159||n>127&&/\s/u.test(t))return!1}return!0}function Xge(e,t,n){if(!yv(t,n)||!e.startsWith("file:///"))return!1;const i=e.charAt(8);return i!=="/"&&i!=="\\"}function yv(e,t){return e?(e==="a"||e==="area")&&(!t||t==="href"||t==="xlink:href"):!t||t==="href"}function e0e(e,t){return t==="href"||t==="xlink:href"?yv(e,t)?g9:Bh:t==="src"||t==="srcset"||t==="poster"||t==="action"||t==="formaction"||t==="data"?Bh:(yv(e,t),g9)}function Tp(e,t={}){if(Jge(e))return!1;const n=zq(jq(e)).toLowerCase(),i=String(t.tagName??"").toLowerCase(),o=String(t.attrName??"").toLowerCase();if(!n)return!1;if(n.startsWith("data:")){const r=/^data:image\/(?:png|gif|jpe?g|webp|avif|bmp);/i.test(n);return i==="img"&&o==="src"?!r:!0}if(/^[\\/]{2}/.test(n))return!0;if(n.startsWith("/")||n.startsWith("./")||n.startsWith("../")||n.startsWith("#")||n.startsWith("?"))return!1;const s=Hq(n);return s?s==="file"?!Xge(n,i,o):yv(i,o)?Qge.has(s):!e0e(i,o).has(s):!1}function t0e(e){const t=jq(String(e??"")).trim();if(!t||t.startsWith("#")||t.startsWith("/")||t.startsWith("./")||t.startsWith("../")||t.startsWith("?"))return!1;const n=Hq(zq(t).toLowerCase());return n==="http"||n==="https"}function n0e(e,t={}){const n=String(e??"").trim();return n?Tp(n,t)?"":n:""}function eF(e){return n0e(e,{tagName:"img",attrName:"src"})}function i0e(e,t,n){function i(f){return f.trim().split(" ",2)[0]===t}function o(f,h,m,g,y){return f[h].nesting===1&&f[h].attrJoin("class",t),y.renderToken(f,h,m,g,y)}n=n||{};const s=3,r=n.marker||":",a=r.charCodeAt(0),l=r.length,u=n.validate||i,c=n.render||o;function d(f,h,m,g){let y,b=!1,v=f.bMarks[h]+f.tShift[h],w=f.eMarks[h];if(a!==f.src.charCodeAt(v))return!1;for(y=v+1;y<=w&&r[(y-v)%l]===f.src[y];y++);const A=Math.floor((y-v)/l);if(A=m||(v=f.bMarks[E]+f.tShift[E],w=f.eMarks[E],v=4)){for(y=v+1;y<=w&&r[(y-v)%l]===f.src[y];y++);if(!(Math.floor((y-v)/l)=2){const r=Number(s[0]),a=Number(s[1]);Number.isFinite(r)&&Number.isFinite(a)&&(o.map=[r+t,Math.min(a+t,n)])}Array.isArray(o.children)&&Wq(o.children,t,n)}}function s0e(e){["admonition","info","warning","error","tip","danger","note","caution"].forEach(t=>{e.use(i0e,t,{render(n,i){return n[i].nesting===1?`
      `:`
      +`}})}),e.block.ruler.before("fence","vmr_container_fallback",(t,n,i,o)=>{const s=t,r=s.bMarks[n]+s.tShift[n],a=s.eMarks[n],l=s.src.slice(r,a),u=l.match(/^:::\s*([^\s{]+)/);if(!u)return!1;const c=u[1];if(!c.trim())return!1;const d=l.slice(u[0].length).trim();let f,h;const m=d.indexOf("{"),g=m>=0?d.slice(m).trimStart():void 0;if(m===-1)f=d||void 0;else{if(f=d.slice(0,m).trim()||void 0,g?.startsWith("{")){let L=0,E=-1;for(let C=0;C0&&(h=g.slice(0,E))}h||(f=d||void 0)}if(o)return!0;const y=!!s.env.__markstreamFinal;let b=n+1,v=!1;for(;b<=i;){const L=s.bMarks[b]+s.tShift[b],E=s.eMarks[b];if(s.src.slice(L,E).trim()===":::"){v=!0;break}b++}v||(b=i);const w=s.push("vmr_container_open","div",1);if(w.attrSet("class",`vmr-container vmr-container-${c}`),w.map=[n,v?b:i],w.meta={...w.meta??{},unclosed:!v&&!y},f&&w.attrSet("data-args",f),h)try{const L=JSON.parse(h);for(const[E,C]of Object.entries(L)){const x=C!=null&&typeof C=="object";w.attrSet(`data-${E}`,x?JSON.stringify(C):String(C))}}catch{const L=o0e(h);if(L)for(const[E,C]of Object.entries(L)){const x=C!=null&&typeof C=="object";w.attrSet(`data-${E}`,x?JSON.stringify(C):String(C))}else w.attrSet("data-attrs",h)}const A=[];for(let L=n+1;LL.trim().length>0)){let L=A.join(` +`);L.endsWith(` +`)||(L+=` +`),L.endsWith(` + +`)||(L+=` +`);const E=s.tokens[s.tokens.length-1];E&&(E.raw=L);const C=[];s.md.block.parse(L,s.md,s.env,C),Wq(C,n+1,n+1+A.length),s.tokens.push(...C)}const M=s.push("vmr_container_close","div",-1);return v||(M.hidden=!0,M.map=[i,i]),s.line=v?b+1:b,!0},{alt:["paragraph","reference","blockquote","list"]})}function zu(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Wo(e){let t=!1,n=!1;for(let i=0;i")return i}return-1}function Uw(e){const t=[],n=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let i;for(;(i=n.exec(e))!==null;){const o=i[1];if(!o)continue;const s=i[2]||i[3]||i[4]||"";t.push([o,s])}return t}const r0e=/^[a-z][a-z0-9_-]*$/;function tF(e){return r0e.test(String(e??"").trim().toLowerCase())}function su(e){const t=String(e??"").trim();if(!t)return"";if(!t.startsWith("<"))return tF(t)?t.toLowerCase():"";let n=1;for(;n]/.test(s)?"":tF(o)?o:""}function r1(e){if(!e||e.length===0)return[];const t=new Set,n=[];for(const i of e){const o=su(i);!o||t.has(o)||(t.add(o),n.push(o))}return n}function a0e(...e){const t=new Set,n=[];for(const i of e)for(const o of r1(i))t.has(o)||(t.add(o),n.push(o));return n}function l0e(e){const t=r1(e);return{key:t.join(","),tags:t}}function qq(e){return su(e)}function u0e(e,t){const n=String(e??""),i=su(t);if(!i)return!1;const o=zu(i),s=n.match(new RegExp(String.raw`^\s*<\s*${o}(?:\s[^>]*)?(\s*\/)?>`,"i"));return s?s[1]?!0:new RegExp(String.raw`<\s*\/\s*${o}\s*>`,"i").test(n):!1}function Uq(e,t){const n=su(t);return!!n&&!p2.has(n)&&!u0e(e,n)}function c0e(e,t){const n=String(e??""),i=su(t);if(!i)return n;const o=zu(i),s=new RegExp(String.raw`^\s*<\s*${o}(?:\s[^>]*)?>\s*`,"i"),r=new RegExp(String.raw`\s*<\s*\/\s*${o}\s*>\s*$`,"i");return n.replace(s,"").replace(r,"")}const Vq=Gf,d0e=p2,Kq=new Set(Pq);Kq.delete("details");const f0e=/<([A-Z][\w-]*)(?=[\s/>]|$)/gi,h0e=/<\/\s*([A-Z][\w-]*)(?=[\s/>]|$)/gi,N6=/^<\s*(?:\/\s*)?([A-Z][\w-]*)/i,p0e=/^<\s*([A-Z][\w:-]*)(?=[\s/>]|$)/i;function t4(e){return(e.match(N6)?.[1]??"").toLowerCase()}function ZS(e){return/^\s*<\s*\//.test(e)}function GS(e,t){return Vq.has(t)||/\/\s*>\s*$/.test(e)}function m0e(e,t){let n=0;for(let i=0;i0&&n--;continue}GS(o,s)||n++}}return n}function nF(e,t,n=0){const i=new RegExp(String.raw`<\s*(\/?)\s*${zu(t)}(?=[\s>/])[^>]*>`,"gi");i.lastIndex=Math.max(0,n);let o=0,s;for(;(s=i.exec(e))!==null;){const r=s[0]??"",a=!!s[1],l=!a&&/\/\s*>$/.test(r);if(a){if(o===0)return{start:s.index,end:s.index+r.length};o--;continue}l||o++}return null}function v0e(e,t){const n=new RegExp(String.raw`<\s*(\/?)\s*${zu(t)}(?=[\s>/])[^>]*>`,"gi");let i=0,o;for(;(o=n.exec(e))!==null;){const s=o[0]??"",r=!!o[1],a=!r&&/\/\s*>$/.test(s);if(r){i>0&&i--;continue}a||i++}return i}function n4(e){const t=e;return String(t.raw??t.content??t.markup??"")}function y0e(e){const t=e;return t.meta||(t.meta={}),t.meta}function a5(e,t,n){const i=y0e(e);i.markstreamCustomHtmlRaw=t,i.markstreamCustomHtmlInner=n}function k0e(e,t){if(!t.size)return;const n=Array.from(t,h=>new RegExp(String.raw`<\s*${zu(h)}(?=[\s>/])`,"i")),i=[];let o=!1;const s=h=>h?n.some(m=>m.test(h)):!1,r=h=>{if(!(!h||!i.length))for(const m of i)m.raw+=h,m.inner+=h},a=()=>{!i.length||!o||(r(` +`),o=!1)},l=h=>{r(h)},u=h=>{for(let g=0;g{const m=i[i.length-1]?.tag;if(!m)return null;const g=new RegExp(String.raw`^\s*<\s*\/\s*${zu(m)}\s*>`,"i");return h.match(g)?.[0]??null},d=h=>!!c(h),f=(h,m,g)=>{const y=g??(h.type==="html_inline"?t4(m):"");if(!(y&&t.has(y))){r(m);return}const b=ZS(m),v=!b&&GS(m,y);if(b){if(!i.length||i[i.length-1].tag!==y){r(m);return}u(m);return}if(r(m),v){a5(h,m,"");return}i.push({tag:y,token:h,raw:m,inner:""})};for(const h of e){if(h.type==="inline"&&Array.isArray(h.children)){const m=String(h.content??"");if(d(m)?o=!1:a(),!i.length&&!s(m)){o=!1;continue}let g=0,y=!0;for(const b of h.children){const v=n4(b),w=b.type==="html_inline"?t4(v):"",A=w&&t.has(w);let M=v;if(y&&m&&v&&(i.length||A)){const L=m.indexOf(v,g);if(L!==-1)l(m.slice(g,L)),M=m.slice(L,L+v.length),g=L+v.length;else{if(i.length&&!A)continue;y=!1}}f(b,M,w)}y&&m&&g0;continue}if(i.length&&typeof h.content=="string"){const m=n4(h),g=h.type==="html_block"?c(m):null;if(g){u(`${o?` +`:""}${g}`),o=i.length>0;continue}if(!h.content)continue;a(),r(h.content),o=!0}}for(const h of i)a5(h.token,h.raw,h.inner)}function b0e(e){return/^\s*<\s*[!?]/.test(e)}function w0e(e){const t=new Set(d0e);if(e&&Array.isArray(e))for(const n of e){const i=String(n??"").trim();if(!i)continue;const o=i.match(/^[<\s/]*([A-Z][\w-]*)/i);o&&t.add(o[1].toLowerCase())}return t}function iF(e,t){if(t.has(e))return!0;for(const n of t)if(n.startsWith(e))return!0;return!1}function A0e(e,t){let n=null;for(const s of e.matchAll(f0e)){const r=s.index??-1;if(r<0)continue;const a=(s[1]??"").toLowerCase();iF(a,t)&&Wo(e.slice(r))===-1&&(!n||r")&&(!n||s")&&(!n||s{const h=f,m=new Set(n),g=Array.isArray(h.env?.__markstreamCustomHtmlTags)?h.env.__markstreamCustomHtmlTags:[];for(const w of g){const A=su(String(w??""));A&&m.add(A)}const y=w0e(Array.from(m)),b=new Set(S0e);for(const w of m)b.add(w);return{autoCloseInlineTagSet:b,commonHtmlTags:y,customTagSet:m,shouldMergeHtmlBlockTag:w=>m.has(w)||!y.has(w)||Kq.has(w)}},o=f=>{if(f.type==="html_block")return String(f.content??"");if(f.type!=="inline"||!Array.isArray(f.children)||f.children.length!==1)return"";const h=f.children[0];return h?.type!=="html_block"?"":String(f.content??h.content??"")},s=(f,h)=>{f.type="html_block",f.content=h,f.raw=h,f.children=[]},r=f=>f.replace(/^(?:\r?\n)+/,""),a=f=>/^(?: {4}|\t)/.test(f),l=f=>f.replace(/^(?: {4}|\t)/gm,""),u=(f,h)=>{const m=r(f);if(!/\S/.test(m))return[];if(a(m))return[{type:"code_block",content:l(m),raw:m}];const g=m.replace(/^[\t ]+/,"");if(!g)return[];if(g.startsWith("<"))return[{type:"html_block",content:g}];const y={type:"inline",tag:"",nesting:0,content:g,children:[{type:"text",content:g,raw:g}]};return h==="paragraph"?[{type:"paragraph_open",tag:"p",nesting:1},y,{type:"paragraph_close",tag:"p",nesting:-1}]:h==="text"?[{type:"text",content:g,raw:g}]:[y]},c=(f,h,m)=>f[h-1]?.type==="paragraph_open"&&f[h+1]?.type==="paragraph_close"?"inline":m,d=(f,h)=>{const m=r(h);return!/\S/.test(m)||f.type!=="inline"||!Array.isArray(f.children)?!1:(f.content=`${String(f.content??"")}${m}`,f.children.push({type:"text",content:m,raw:m}),!0)};e.core.ruler.after("inline","fix_html_inline_streaming",f=>{const h=f.tokens??[],{commonHtmlTags:m,customTagSet:g}=i(f);for(const y of h){const b=y;if(b.type!=="inline"||!Array.isArray(b.children))continue;const v=String(b.content??""),w=b.children.length?b.children:v.includes("<")?[{type:"text",content:v,raw:v}]:null;if(w)try{const A=x0e(w,m);if(b.children=A.children,A.pendingBuffer){const M=v.lastIndexOf(A.pendingBuffer);if(M!==-1){const L=v.slice(0,M);b.content=L,typeof b.raw=="string"&&(b.raw=L)}}}catch(A){console.error("[applyFixHtmlInlineTokens] failed to fix streaming html inline",A)}}k0e(h,g)}),e.core.ruler.push("fix_html_inline_tokens",f=>{const h=f.tokens??[],{autoCloseInlineTagSet:m,customTagSet:g,shouldMergeHtmlBlockTag:y}=i(f),b=[];for(let v=0;v0){const[M,L]=b[b.length-1];if(v!==L){if(w.type==="paragraph_open"||w.type==="paragraph_close"){h.splice(v,1),v--;continue}const E=String(w.content??w.raw??"");if(E){const C=h[L],x=`${String(C.content||"")} +${E}`,_=Wo(x),F=_===-1?null:nF(x,M,_+1);if(F){const I=x.slice(0,F.end),D=x.slice(F.end);C.content=I,C.loading=!1,h.splice(v,1),b.pop();const H=d(C,D)?[]:u(D,c(h,v,"paragraph"));H.length&&h.splice(v,0,...H),v--;continue}C.content=x,C.loading!==!1&&(C.loading=!0)}h.splice(v,1),v--;continue}}const A=o(w);if(A){if(b0e(A))continue;const M=(A.match(/<\s*(?:\/\s*)?([^\s>/]+)/)?.[1]??"").toLowerCase(),L=/^\s*<\s*\//.test(A);if(!M||!y(M))continue;if(s(w,A),!L)M&&!new RegExp(`^\\s*<\\s*${M}\\b[^>]*\\/\\s*>`,"i").test(A)&&v0e(A,M)>0&&b.push([M,v]);else if(b.length>0&&M&&b[b.length-1][0]===M){const[,E]=b[b.length-1],C=h[E];C.content=`${String(C.content||"")} +${A}`,C.loading=!1,b.pop(),h.splice(v,1),v--}continue}else if(b.length>0){if(w.type==="paragraph_open"||w.type==="paragraph_close"){h.splice(v,1),v--;continue}const M=w.content||"",L=new RegExp(`<\\s*\\/\\s*${b[b.length-1][0]}\\s*>`,"i").test(M);if(M){const[,E]=b[b.length-1],C=h[E];C.content=`${C.content||""} +${M}`,C.loading!==!1&&(C.loading=!L)}L&&b.pop(),h.splice(v,1),v--}else continue}if(g.size>0){const v=new Map,w=new Map,A=E=>{let C=v.get(E);return C||(C=new RegExp(`<\\s*${E}\\b`,"i"),v.set(E,C)),C},M=E=>{let C=w.get(E);return C||(C=new RegExp(`<\\s*\\/\\s*${E}\\s*>`,"i"),w.set(E,C)),C},L=[];for(let E=0;E0){const F=L[L.length-1],I=h[F.index],D=C.type==="html_block"?M(F.tag).exec(x):null;if(D){const T=D.index+D[0].length,R=x.slice(0,T),P=x.slice(T);I.content=`${String(I.content??"")} +${R}`,Array.isArray(I.children)&&I.children.push({type:"html_inline",content:``,raw:``}),L.pop();const j=d(I,P)?[]:u(P,c(h,E,"paragraph"));j.length?h.splice(E,1,...j):(h.splice(E,1),E--);continue}if(C.type!=="inline")continue;const H=Array.isArray(C.children)?C.children:[],$=m0e(H,F.tag);if($!==-1){const T=H.slice(0,$+1),R=H.slice($+1),P=T.map(j=>String(j?.content??j?.raw??"")).join("");if(I.content=`${String(I.content??"")} +${P}`,Array.isArray(I.children)&&I.children.push(...T),R.length){const j=R.map(B=>String(B.content??B.raw??"")).join("");if(j.trim()){const B=j.replace(/^\s+/,"");if(d(I,j))h.splice(E,1),E--;else if(B.startsWith("<"))h.splice(E,1,{type:"html_block",content:B});else{const K=u(j,c(h,E,"paragraph"));h.splice(E,1,...K)}}else h.splice(E,1),E--}else h.splice(E,1),E--;L.pop();continue}I.content=`${String(I.content??"")} +${x}`,Array.isArray(I.children)&&I.children.push(...H),h.splice(E,1),E--;continue}if(C.type!=="inline")continue;const _=Array.isArray(C.children)?C.children:[];for(const F of g)if((_.length?g0e(_,F):A(F).test(x)&&!M(F).test(x)?1:0)>0){L.push({tag:F,index:E});break}}}{let v=0;for(let w=0;w0?v--:(h.splice(w,1),w--))}}for(let v=0;v/]+)/)?.[1]??"").toLowerCase();if(C.startsWith("!")||C.startsWith("?")){w.loading=!1;continue}if(g.has(C)){const $=String(w.content??""),T=Wo($),R=T===-1?null:nF($,C,T+1);w.loading=R?!1:w.loading!==void 0?w.loading:!0;const P=R?.start??-1,j=R?R.end-R.start:0;if(P!==-1){const B=$.slice(0,P+j);let K="";T!==-1&&T]+)))?/g;let _;for(;(_=x.exec(w.content||""))!==null;)_[1],_[2]||_[3]||_[4];const F=String(w.content??""),I=new RegExp(`<\\/\\s*${C}\\s*>`,"i").exec(F),D=I?I.index:-1,H=I?I[0].length:0;if(D!==-1){const $=F.slice(0,D+H),T=(F.slice(D+H)||"").replace(/^\s+/,"");w.children=[{type:"html_block",content:$,tag:C,loading:!1}],w.content=$,w.raw=$,T&&h.splice(v+1,0,T.startsWith("<")?{type:"html_block",content:T}:{type:"text",content:T,raw:T})}else w.children=[{type:"html_block",content:w.content,tag:C,loading:!0}];continue}if(!w||w.type!=="inline")continue;if(w.children.length===2&&w.children[0].type==="html_inline"){const C=(w.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase(),x=w.children[1],_=String(x?.content??"").match(/^<\s*\/\s*([^\s>]+)/)?.[1]?.toLowerCase()??"";if(x?.type==="html_inline"&&_===C)continue;m.has(C)?(w.children[0].loading=!0,w.children[0].tag=C,w.children.push({type:"html_inline",tag:C,loading:!0,content:``})):w.children=[{type:"html_block",loading:!0,tag:C,content:String(w.children[0]?.content??"")+String(w.children[1]?.content??"")}];continue}else if(w.children.length===3&&w.children[0].type==="html_inline"&&w.children[2].type==="html_inline"){const C=(w.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(m.has(C))continue;w.children=[{type:"html_block",loading:!1,tag:C,content:w.children.map(x=>x.content).join("")}];continue}if(!w.content?.startsWith("<")||w.children?.length!==1)continue;const A=String(w.content),M=w,L=M.children[0];if(L?.type!=="html_inline"){/^<\s*(?:\/\s*)?[A-Z][\w:-]*\s*$/i.test(A)&&(M.children.length=0);continue}const E=String(L.content??A).match(p0e)?.[1]?.toLowerCase()??"";if(E){if(/\/\s*>\s*$/.test(A)||Vq.has(E)){M.children=[{type:"html_inline",content:A}];continue}M.children.length=0}}})}function I0e(e){const t=e.trim();return!t||/^&[a-z0-9#]+;/i.test(t)?!1:!!(/^(?:const|let|var|function|class|import|export|if|for|while|return|await|async|yield|try|catch|throw|new|typeof|instanceof|switch|case|break|continue|def|ruby|perl|print|echo|true|false|null|undefined|NaN|Infinity|this)\b/.test(t)||/[a-z_$][\w$]*(?:\.[a-z_$][\w$]*|\['[^']*'\]|\["[^"]*"\]|\[\d+\])*\s*\(/i.test(t)||/[a-z_$][\w$]*(?:\.[a-z_$][\w$]*|\['[^']*'\]|\["[^"]*"\]|\[[\d+\]])+/i.test(t)||/\w+\s*(?:===?|!==?|<=?|>=?|\+\+|--|&&|\|\||\?\.)/.test(t)||/^(?:!!|\+\+|--)\s*\w/.test(t)||/[\w$]+\s*(?:\+=|-=|\*=|\/=|%=|\*\*=|=)/.test(t)||/^(?:https?:\/\/|ftp:\/\/|file:\/\/|\/\/|www\.)/i.test(t)||/`[^`]*\$\{[^}]*\}[^`]*`/.test(t)||/<\/?[A-Z][a-zA-Z0-9]*/.test(t)||/<[a-z][a-z0-9]*\s[^>]+>/.test(t)||/^(["'`]).*\1\s*[;,]?$/.test(t)||/^\[[\s\S]*\]$/.test(t)||/^\{[\s\S]*\}$/.test(t)||/^\(\s*\)$/.test(t)||/[\w$]+(?:\s*[+\-*/%<>=!&|^~:]+\s*[\w$]+|\s*\.\s*[\w$]+)/.test(t)||/=>|->|::/.test(t)||/^@[\w.$]+$/.test(t)||/^(?:0x[0-9a-fA-F]+|0b[01]+|0o[0-7]+|\d+(?:\.\d*)?(?:px|em|rem|%|vh|vw|deg|s|ms)?)$/.test(t)||/^\$[\w$]+\s*[=:]/.test(t)||/\|\s*\w+|\w+\s*\|/.test(t)||/^(?:git|npm|yarn|pnpm|bun|pip|cargo|go|rust|python|node|java|mvn|gradle|docker|kubectl)\s+/.test(t)||/(?:console|window|document|Math|JSON|Date|Array|Object|String|Number|Boolean)\.[a-zA-Z]/.test(t)||/^(?:\/\/|#|\/\*|\*\/|)/.test(t)||/^(?:<<<|<<\s*['"]?\w+['"]?)/.test(t))}function M0e(e,t={}){t.enabled!==!1&&e.core.ruler.after("inline","fix_indented_code_block",n=>{const i=n.tokens??[];for(let o=0;ol.trim().length>0);if(a.length===1&&!I0e(a[0]??"")){const l=a[0]??"",u=s.level??0;i.splice(o,1,{type:"paragraph_open",tag:"p",nesting:1,level:u},{type:"inline",tag:"",nesting:0,level:u,content:l,children:[{type:"text",content:l,level:u+1,raw:l}],block:!0},{type:"paragraph_close",tag:"p",nesting:-1,level:u}),o+=2}}})}const Zq=/\.([a-z0-9]{1,15})$/i,T0e=/[_()[\]{}<>]/u,E0e=/^(?:https?:\/\/|ftp:\/\/|mailto:|www\.)/i,L0e=/[?#@]/u,N0e=/[\\/]/u,F0e=/^[\p{L}\p{N}./\\-]+$/u,R0e=/^[A-Za-z0-9-]{1,63}$/u,D0e=/^xn--[a-z0-9-]{2,59}$/i,O0e=/^(?:[A-Z]{1,6}|\d{1,8})$/u,P0e=/^(?=.{1,12}$)[A-Z0-9]+(?:[-.][A-Z0-9]+)*$/iu,B0e=/文件名\s*[::]?|附件\s*[::]?|路径\s*[::]?|路徑\s*[::]?|文件列表\s*[::]?|文档列表\s*[::]?|文檔列表\s*[::]?|\bfile\s*names?\b\s*[::]?|\battachments?\b\s*[::]?|\bpaths?\b\s*[::]?|\bfile\s+lists?\b\s*[::]?|\bdocument\s+lists?\b\s*[::]?/iu,$0e=/文件名\s*[::]?|文件\s*[::]?|附件\s*[::]?|档案\s*[::]?|檔案\s*[::]?|文档\s*[::]?|文檔\s*[::]?|资料\s*[::]?|資料\s*[::]?|路径\s*[::]?|路徑\s*[::]?|\bfile\s*name\b\s*[::]?|\battachments?\b\s*[::]?|\bfiles?\b\s*[::]?|\bdocuments?\b\s*[::]?|\bdocs?\b\s*[::]?|\bpaths?\b\s*[::]?/iu,z0e=/股票代码|股票代碼|证券代码|證券代碼|(?:代码|代碼|交易所|后缀|後綴|市场|市場)(?=$|[\s::/|,,、()()])|\btickers?\b|\bsymbols?\b|\bexchanges?\b/iu,j0e=2e3,H0e=512,W0e={},q0e=new Set(["ai","md","py","rs","sh","zip"]),Gq=new Set(["as","bj","de","hk","l","ln","ny","pa","sh","ss","sz","t","us"]),U0e=new Set([...Gq,"at","ax","cn","co","it","jp","ks","mc","mx","nz","pl","sa","si","to","tw"]),V0e=new Set(["com","dev","io","page","site"]),K0e=new Set(["app","apk","dmg","exe","ipa","lock","log","markdown","webmanifest"]),Z0e=new Set(["7z","ai","astro","avi","bash","bz2","c","cjs","cpp","cs","csv","doc","docx","fish","flac","gif","go","gz","h","hpp","html","java","jpeg","jpg","js","json","jsx","kt","md","mdx","mjs","mov","mp3","mp4","pdf","php","png","ppt","pptx","ps1","py","rar","rb","rs","sh","sql","svg","swift","svelte","tar","tgz","toml","ts","tsx","txt","vue","wav","webp","xls","xlsx","xml","yaml","yml","zip","zsh"]),hp=new Map;function oF(e,t){if(!e||e.length>H0e)return t;for(hp.set(e,t);hp.size>j0e;){const n=hp.keys().next().value;if(!n)break;hp.delete(n)}return t}function m2(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function l5(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return m2(n)?n:void 0}function sF(e,t){if(!m2(t))return e;const n=e?.__linkifyDemotionContext;return{...e,__linkifyDemotionContext:{filename:n?.filename||t?.filename,explicitFilename:n?.explicitFilename||t?.explicitFilename,marketTicker:n?.marketTicker||t?.marketTicker}}}function rF(e){const t=iy(e);return m2(t)?t:void 0}function G0e(e){return e.replace(/^[\s>*_`[\]((【《"'“‘]+/u,"").replace(/[\s<*_`\]))】》"'.。;;,,、::!?!?]+$/u,"")}function aF(e,t){if(!m2(t))return;const n=String(e??"").trim().split(/\s+/u).map(G0e).filter(Boolean);if(n.length===0)return;const i={};return t?.filename&&n.every(o=>i4(o,{filename:!0,explicitFilename:t.explicitFilename}))&&(i.filename=!0),t?.explicitFilename&&i.filename&&(i.explicitFilename=!0),t?.marketTicker&&n.every(o=>i4(o,{marketTicker:!0}))&&(i.marketTicker=!0),m2(i)?i:void 0}function mh(e,t=!1){let n;return{options(i){return t||i==null?sF(e,n):sF(e,l5(rF(i),aF(i,n)))},remember(i){const o=rF(i);n=t?l5(n,o):l5(o,aF(i,n))},reset(){n=void 0}}}function lF(e){return R0e.test(e)&&!e.startsWith("-")&&!e.endsWith("-")}function Q0e(e){const t=e.split(".");if(t.length<2)return!1;const n=t[t.length-1]?.toLowerCase()??"";return lF(n)||D0e.test(n)?t.every(lF):!1}function Qq(e){return Array.from(e).some(t=>t.charCodeAt(0)>127)}function Y0e(e){return e.replace(/^[a-z][a-z0-9+.-]*:\/\//i,"").split(/[/?#]/,1)[0]??""}function J0e(e){return e.split(".").some(t=>t.toLowerCase().startsWith("xn--"))}function Yq(e,t,n){const i=Y0e(t);return Qq(e)&&J0e(i)&&String(n??"").toLowerCase().includes(i.toLowerCase())}function X0e(e){if(!e)return!1;if(e.includes("文件")||e.includes("附件")||e.includes("路径")||e.includes("路徑")||e.includes("文档")||e.includes("文檔")||e.includes("档案")||e.includes("檔案")||e.includes("资料")||e.includes("資料")||e.includes("股票")||e.includes("证券")||e.includes("證券")||e.includes("代码")||e.includes("代碼")||e.includes("交易所")||e.includes("后缀")||e.includes("後綴")||e.includes("市场")||e.includes("市場"))return!0;const t=e.toLowerCase();return t.includes("file")||t.includes("attachment")||t.includes("document")||t.includes("doc")||t.includes("path")||t.includes("ticker")||t.includes("symbol")||t.includes("exchange")}function iy(e){const t=String(e??""),n=hp.get(t);return n?(hp.delete(t),hp.set(t,n),n):X0e(t)?oF(t,{explicitFilename:B0e.test(t),filename:$0e.test(t),marketTicker:z0e.test(t)}):oF(t,W0e)}function eve(e){return Q0e(e.split(/[\\/]/)[0]??"")}function tve(e){const t=e.replace(/[^a-z]/gi,"");return t.length>=2&&t===t.toUpperCase()}function nve(e){if(T0e.test(e)||!F0e.test(e))return!0;if(N0e.test(e))return!eve(e);const t=e.replace(Zq,"");return Qq(t)?!0:t.split(".").filter(Boolean).some(tve)}function ive(e,t,n){if(!(n?U0e:Gq).has(t))return!1;const i=e.slice(0,-(t.length+1));return i===""?e.startsWith("."):(n?P0e:O0e).test(i)}function i4(e,t={}){if(!e||E0e.test(e)||L0e.test(e))return!1;const n=e.match(Zq);if(!n)return!1;const i=String(n[1]??"").toLowerCase();return ive(e,i,t.marketTicker===!0)?!0:Z0e.has(i)?!q0e.has(i)||t.filename?!0:nve(e):!!(t.explicitFilename&&V0e.has(i)||t.filename&&K0e.has(i))}const Jq=new WeakMap,Xq=new WeakSet;function F6(e,t){return Jq.set(e,t),e}function ove(e){return Jq.get(e)}function sve(e){Xq.add(e)}function rve(e){return e===void 0||Xq.has(e)}const uF=["!"];function cF(e){return e==="linkify"||e==="autolink"?e:"recovery"}function Ma(e){return{type:"text",content:e,raw:e}}function $h(e,t){t===1?e.push({type:"em_open",tag:"em",nesting:1}):t===2?e.push({type:"strong_open",tag:"strong",nesting:1}):t===3&&(e.push({type:"strong_open",tag:"strong",nesting:1}),e.push({type:"em_open",tag:"em",nesting:1}))}function zh(e,t){t===1?e.push({type:"em_close",tag:"em",nesting:-1}):t===2?e.push({type:"strong_close",tag:"strong",nesting:-1}):t===3&&(e.push({type:"em_close",tag:"em",nesting:-1}),e.push({type:"strong_close",tag:"strong",nesting:-1}))}function tf(e,t,n,i="recovery"){let o="";if(t.includes('"')){const s=t.split('"');t=s[0].trim(),o=s[1].trim()}return F6({type:"link",loading:n,href:t,title:o,text:e,children:[{type:"text",content:e,raw:e}],raw:`[${e}](${t})`},i)}function ave(e,t){if(!(!e||!t)&&(e.href=String(e.href??"")+t,e.text=String(e.text??"")+t,e.raw=`[${e.text}](${e.href})`,Array.isArray(e.children)&&e.children.length)){const n=e.children[e.children.length-1];n?.type==="text"?(n.content=String(n.content??"")+t,n.raw=String(n.raw??"")+t):e.children.push(Ma(t))}}function dF(e,t){let n=-1;for(const i of t){const o=e.indexOf(i);o!==-1&&(n===-1||on?.[0]==="href")?.[1];return typeof t=="string"?t:""}function uve(e,t){if(!e)return;e.attrs=Array.isArray(e.attrs)?e.attrs:[];const n=e.attrs.findIndex(i=>i?.[0]==="href");n>=0?e.attrs[n][1]=t:e.attrs.push(["href",t])}function fF(e,t,n){let i="";for(let o=t+1;o{const n=t.tokens??[];for(let i=0;ir.type==="code_inline"),i=new Map;let o=0;for(let r=0;r0&&u?hF(u):-1;if(c!==-1&&u)for(const d of u.slice(c))d==="("?o++:d===")"&&o>0&&o--}l!==-1&&(r=l);continue}if(!(a.type!=="text"||typeof a.content!="string"))for(const l of a.content)l==="("?o++:l===")"&&o>0&&o--}const s=iy(t);for(let r=0;r<=e.length-1;r++){r<0&&(r=0);const a=e[r];if(!a)break;if(a.type==="link_open"&&(a.markup==="linkify"||a.markup==="autolink")){let l=-1;for(let u=r+1;u0){const m=hF(u);m!==-1&&(d===-1||m=g.content.length){h-=g.content.length;continue}if(h<0)break;const y=g.content[h],b=g.content.slice(0,h);let v=g.content.slice(h);for(let M=m+1;M0&&(e.splice(m+1,w),l=m+1);let A=c;if(y==="!"&&f!==-1)A=c.slice(0,f);else if(v){const M=encodeURI(v);if(M&&c.endsWith(M))A=c.slice(0,c.length-M.length);else{const L=y?encodeURI(y):"",E=L?c.indexOf(L):-1;E!==-1&&(A=c.slice(0,E))}}A!==c&&uve(a,A),v&&e.splice(l+1,0,Ma(v));break}}}if(!n){if(a?.type==="em_open"&&e[r-1]?.type==="text"&&e[r-1].content?.endsWith("*")){const l=e[r-1].content?.replace(/(\*+)$/,"")||"";e[r-1].content=l,a.type="strong_open",a.tag="strong",a.markup="**";for(let u=r+1;ud[0]==="href")?.[1]||"";if(e[r+3]?.type==="text"){const d=(e[r+3]?.content??"").indexOf(")"),f=d===-1;d===-1&&(c+=e[r+3]?.content?.slice(0,d)||"",e[r+3].content=""),l.push(tf(u,c,f,"linkify"));const h=e[r+3].content?.replace(/^\)\**/,"");h&&l.push(Ma(h)),e.splice(r-4,8,...l)}else l.push(F6({type:"link",loading:!0,href:c,title:"",text:u,children:[{type:"text",content:c,raw:c}],raw:`[${u}](${c})`},"linkify")),e.splice(r-4,7,...l);continue}else if(e[r-1].content==="]("&&e[r-3]?.type==="text"&&e[r-3].content?.endsWith(")"))if(e[r-2]?.type==="strong_open"){const[l,u]=e[r-3].content?.split("[**")||[];e[r+1].content=u||"",e[r-3].content=l||"",e[r-1].content=""}else if(e[r-2]?.type==="em_open"){const[l,u]=e[r-3].content?.split("[*")||[];e[r+1].content=u||"",e[r-3].content=l||"",e[r-1].content=""}else{const[l,u]=e[r-3].content?.split("[")||[];e[r+1].content=u||"",e[r-3].content=l||"",e[r-1].content=""}}if(a.type==="link_close"&&a.nesting===-1&&e[r-2]?.type==="link_open"&&e[r+1]?.type==="text"&&e[r-1]?.type==="text"){const l=e[r-1].content||"",u=e[r-2].attrs||[],c=u.find(b=>b[0]==="href")?.[1]||"",d=u.find(b=>b[0]==="title")?.[1]||"";let f=3,h=2;const m=(e[r-3]?.content||"").match(/^(\*+)$/),g=[];if(m){h+=1;const b=m[1].length;$h(g,b)}if(a.markup!=="linkify"&&e[r+1].type==="text"&&e[r+1]?.content?.startsWith("](")){f+=1;for(let b=r+1;by[0]==="href")?.[1];e[r+5]?.type==="text"&&e[r+5].content==="."?(f=(g||f)+e[r+5].content,e[r+5].content=""):f=g||f,h+=3}let m=!0;if(a.nesting===-1&&(d=d.replace(/\*+$/,"")),e[r+2]?.type==="text"){const g=(e[r+2]?.content??"").indexOf(")");m=g===-1,g===-1&&(f+=e[r+2]?.content?.slice(0,g)||"",e[r+2].content="")}l.push(tf(d,f,m)),zh(l,2),e.splice(r-2,h,...l)}if(a.type==="text"&&/\*+\[[^\]]*$/.test(a.content||"")&&e[r+1]?.type==="strong_open"&&e[r+2]?.type==="text"&&e[r+2].content==="]("&&e[r+3]?.type==="link_open"&&e[r+5]?.type==="link_close"&&e[r+6]?.type==="text"&&e[r+6].content===")"&&e[r+7]?.type==="strong_close"){const l=(a.content||"").match(/^(\*+)\[(.*)$/);if(l){const u=(l[2]||"")+l[1];let c=e[r+3]?.attrs?.find(f=>f[0]==="href")?.[1]||"";!c&&e[r+4]?.type==="text"&&(c=e[r+4].content||"");const d=[];$h(d,2),d.push(tf(u,c,!1)),zh(d,2),e.splice(r,9,...d),r-=d.length-1;continue}}}}if(n)return e;for(let r=0;r{const n=t.tokens??[];for(let i=0;i{const n=t.tokens??[];for(let i=0;i=0&&e[m].type==="text"&&e[m].content==="";)m--;const g=e[m];let y=c+1;for(;y=0&&e[m].type==="text"&&e[m].content==="";)m--;const g=e[m];let y=c+1;for(;y{const n=t;try{const i=xve(n.tokens??[],!!n.env?.__markstreamFinal,n.src??"");Array.isArray(i)&&(n.tokens=i)}catch(i){console.error("[applyFixTableTokens] failed to fix table tokens",i)}})}function pF(){return[{type:"table_open",tag:"table",attrs:null,map:null,children:null,content:"",markup:"",info:"",level:0,loading:!0,meta:null},{type:"thead_open",tag:"thead",attrs:null,block:!0,level:1,children:null},{type:"tr_open",tag:"tr",attrs:null,block:!0,level:2,children:null}]}function mF(){return[{type:"tr_close",tag:"tr",attrs:null,block:!0,level:2,children:null},{type:"thead_close",tag:"thead",attrs:null,block:!0,level:1,children:null},{type:"table_close",tag:"table",attrs:null,map:null,children:null,content:"",markup:"",info:"",level:0,meta:null}]}function gF(e){return[{type:"th_open",tag:"th",attrs:null,block:!0,level:3,children:null},{type:"inline",tag:"",children:null,content:e,level:4,attrs:null,block:!0},{type:"th_close",tag:"th",attrs:null,block:!0,level:3,children:null}]}function eU(e,t){if(!e.startsWith("|")||e.includes(` +`)||!e.endsWith("|"))return null;const n=e.slice(1).split("|");return n.at(-1)===""&&n.pop(),n.length>0&&n.every(i=>i.trim().length>0)?n:null}function u5(e){return eU(e)!==null}function tU(e){return/^:?-+:?$/.test(e.trim())}function kve(e){if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|");return t.at(-1)===""&&t.pop(),t.length>0&&t.every(tU)}function bve(e){return/^(?:[::]-*|:?-+:?)?$/.test(e.trim())}function wve(e){if(e==="")return!0;if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|"),n=t.at(-1)??"";return t.slice(0,-1).every(tU)&&bve(n)}function Ave(e){return e==="|"||e==="|:"}function Cve(e){const t=eU(e);return t!==null&&t.every(n=>!n.includes(":"))}function xve(e,t=!1,n=""){const i=[...e];if(e.length<3)return i;const o=e.length-2,s=e[o];if(s.type==="inline"){const r=String(s.content??""),a=r.split(` +`)[0]??"",[l="",u="",...c]=r.split(` +`),d=!t&&!r.includes(` +`)&&/\r?\n$/.test(n)&&u5(r);if(!t&&(r.includes(` +`)&&c.length===0&&u5(l)&&wve(u)||d)){const f=a.slice(1,-1).split("|").map(m=>m.trim()).flatMap(m=>gF(m)),h=[...pF(),...f,...mF()];i.splice(o-1,3,...h)}else if(r.includes(` +`)&&c.length===0&&u5(l)&&kve(u)){const f=a.slice(1,-1).split("|").map(m=>m.trim()).flatMap(m=>gF(m)),h=[...pF(),...f,...mF()];i.splice(o-1,3,...h)}else r.includes(` +`)&&c.length===0&&Cve(l)&&Ave(u)&&(s.content=r.slice(0,-2),s.children.splice(2,1))}return i}function Sve(e,t,n,i){const o=e.length;if(n==="$$"&&i==="$$"){let u=t;for(;u=0&&e[c]==="\\";)d++,c--;if(d%2===0)return u}u++}return-1}const s=n[n.length-1],r=i;let a=0,l=t;for(;l=0&&e[c]==="\\";)d++,c--;if(d%2===0){if(a===0)return l;a--,l+=r.length;continue}}const u=e[l];if(u==="\\"){l+=2;continue}u===s?a++:u===r[r.length-1]&&a>0&&a--,l++}return-1}var _ve=Sve;const Ive=["boldsymbol","mathbb","mathcal","mathfrak","mathrm","mathit","mathsf","vec","hat","bar","tilde","overline","underline","mathscr","mathnormal","operatorname","mathbf*"],o4=Ive.map(e=>e.replace(/[.*+?^${}()|[\\]"\]/g,"\\$&")).join("|"),Mve=/\\[a-z]+/i,nU="(?:\\\\|\\u0008)",Tve=new RegExp(String.raw`${nU}(?:${o4})\s*\{[^}]+\}`,"i"),Eve=new RegExp(String.raw`(?:${nU})?(?:${o4})\s*\{`,"i"),Lve=/\\(?:text|frac|left|right|times)/,Nve=/(?:^|[^+])\+(?!\+)|[=\-*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/,Fve=/\b[A-Z]{2,}-[A-Z]{2,}\b/i,Rve=/[A-Z]+\s*\([^)]+\)/i,Dve=/^\(\s*[a-z](?:\s*,\s*[a-z])+\s*\)$/i,Ove=/\b(?:sin|cos|tan|log|ln|exp|sqrt|frac|sum|lim|int|prod)\b/,Pve=/\b\d{4}\/\d{1,2}\/\d{1,2}(?:[ T]\d{1,2}:\d{2}(?::\d{2})?)?\b/,Bve={"\b":"\\b","\v":"\\v","\f":"\\f"};function $ve(e){let t="";for(const n of e)t+=Bve[n]??n;return t}function wf(e){if(!e)return!1;const t=$ve(e),n=t.trim();if(Pve.test(n)||n.includes("**"))return!1;if(n.length>2e3)return!0;const i=Mve.test(t),o=Tve.test(t),s=Eve.test(t),r=Lve.test(t),a=/(?:^|[^\w\\])(?:[A-Z]|\\[A-Z]+)_(?:\{[^}]+\}|[A-Z0-9\\])/i.test(t)||/(?:^|[^\w\\])(?:[A-Z]|\\[A-Z]+)\^(?:\{[^}]+\}|[A-Z0-9\\])/i.test(t),l=Nve.test(t)&&!Fve.test(t),u=Rve.test(t),c=Dve.test(n),d=Ove.test(t),f=/^\([a-z]\)$/i.test(n)||/^(?:[a-z]|pi)$/i.test(n),h=/^(?:[A-Z][a-z]?(?:_\{?\d+\}?|\^\{?\d+\}?)?)+$/.test(n);return i||o||s||r||a||l||u||c||d||f||h}const iU="__markstreamMathPluginApplied",R6=80,oU=2e4,vF=oU+4096;function QS(e){return!!e[iU]}function zve(e){e[iU]=!0}const sU=["ldots","cdots","quad","in","displaystyle","int_","lim","lim_","ce","pu","end","infty","perp","mid","operatorname","to","rightarrow","leftarrow","math","mathrm","mathit","mathbb","mathcal","mathfrak","implies","alpha","beta","gamma","delta","epsilon","lambda","sum","sum_","prod","sqrt","fbox","boxed","color","rule","edef","fcolorbox","hline","hdashline","cdot","times","pm","le","ge","neq","sin","cos","tan","log","ln","exp","frac","text","left","right"],jve=["cdot","mathbf{","partial","mu_{"],rU=sU.slice().sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),aU="[ \r\b\f\v]",Hve=new RegExp(`([^\\\\])(${jve.map(e=>e).join("|")})+`,"g"),Wve=/span\{([^}]+)\}/,qve=/\\operatorname\{span\}\{((?:[^{}]|\{[^}]*\})+)\}/,Uve=/(^|[^\\])\\\r?\n/g,Vve=/(^|[^\\])\\$/g,Kve=/[\p{L}\p{M}\p{N}\p{Pe}\p{Pf}'′″‴|‖]/u,Zve=new RegExp(`(${aU})|(${rU})\\b`,"g"),yF=new Map,kF=new Map;function Gve(e){if(!e)return Zve;const t=[...e];t.sort((r,a)=>a.length-r.length);const n=t.join(""),i=yF.get(n);if(i)return i;const o=`(?:${t.map(r=>r.replace(/[.*+?^${}()|[\\]\\"\]/g,"\\$&")).join("|")})`,s=new RegExp(`(${aU})|(${o})\\b`,"g");return yF.set(n,s),s}function Qve(e,t){const n=e?[]:[...t??[]];e||n.sort((a,l)=>l.length-a.length);const i=e?"__default__":n.join(""),o=kF.get(i);if(o)return o;const s=e?[o4,rU].filter(Boolean).join("|"):[n.map(a=>a.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),o4].filter(Boolean).join("|"),r=new RegExp(`(^|[^\\\\\\w])(${s})\\s*\\{`,"g");return kF.set(i,r),r}const bF={" ":"t","\r":"r","\b":"b","\f":"f","\v":"v"};function wF(e){const t=/(^|[^\\])(__|\*\*)/g;let n=0;for(;t.exec(e)!==null;)n++;return n}function Yve(e){return e.replace(/(^|[^\\])!+/gu,(t,n)=>{if(n&&Kve.test(n))return t;const i=n?t.slice(n.length):t;return`${n}${"\\!".repeat(i.length)}`})}function AF(e){const t=/(^|[^\\])(__|\*\*)/g;let n,i=null;for(;(n=t.exec(e))!==null;)i={marker:n[2],index:n.index+(n[1]?.length??0)};return i}function nf(e,t){const n=t?.commands??sU,i=t?.escapeExclamation??!0,o=t?.commands==null,s=Gve(o?void 0:n);let r=e.replace(s,(u,c,d,f,h)=>{if(c!==void 0&&bF[c]!==void 0)return`\\${bF[c]}`;if(d&&n.includes(d)){const m=h&&typeof f=="number"?h[f-1]:void 0;return m==="\\"||m&&/\w/.test(m)?u:`\\${d}`}return u});i&&(r=Yve(r));let a=r;const l=Qve(o,o?void 0:n);return a=a.replace(l,(u,c,d)=>`${c}\\${d}{`),a=a.replace(Wve,"span\\{$1\\}").replace(qve,"\\operatorname{span}\\{$1\\}"),a=a.replace(Uve,`$1\\\\ +`),a=a.replace(Vve,"$1\\\\"),a=a.replace(Hve,"$1\\$2"),a}function CF(e){const t=e.trim();return!(!wf(t)||/"[^"\n]{1,80}"\s*:\s*/.test(t)||!(/\\[a-z]+/i.test(t)||/[=+*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/.test(t)||/[_^]/.test(t))&&/\s-\s/.test(t))}function lU(e){const t=[];let n=0;for(;n=n[0]&&t0;){if(e[s]==="\\"&&s+10;){if(e[a]==="\\"&&a+1=0&&e[n]==="\\";)i++,n--;return i%2===1}function D6(e,t){let n=t;for(;n0&&e[i-1]==="$"||i+1=a)break;const u=s4(o,l);if(u){r=Math.max(l+Math.max(1,t.length),u[1]);continue}oy(e,l)||s++,r=l+Math.max(1,t.length)}return s}function YS(e,t,n){const i=v2(String(e??""));if(!i.endsWith(t))return-1;const o=i.length-t.length;if(o<=0||!v2(i.slice(0,o)).trim()||oy(i,o))return-1;const s=lU(i);if(s4(s,o))return-1;const r=xF(i,t,0,o,s);if(t==="$$"){if(r%2===1)return-1}else if(r>xF(i,n,0,o,s))return-1;return o}function g2(e){return e===" "||e===" "}function v2(e){let t=e.length;for(;t>0&&g2(e[t-1]);)t--;return e.slice(0,t)}function SF(e){let t=0;for(let n=0;n=48&&t<=57}function Xve(e){if(e.length<3)return!1;const t=e[0];if(t!=="-"&&t!=="*"&&t!=="_"&&t!=="=")return!1;let n=0;for(let i=0;i=3}function e2e(e){const t=e.trim();if(!t)return!1;let n=0;t[n]===":"&&n++;let i=0;for(;t[n]==="-";)i++,n++;return i<3?!1:(t[n]===":"&&n++,n===t.length)}function t2e(e){if(!e.includes("|"))return!1;const t=e[0]==="|"?e.slice(1):e;return(t.endsWith("|")?t.slice(0,-1):t).split("|").every(e2e)}function n2e(e){let t=0;if(!_F(e[t]))return!1;for(;_F(e[t]);)t++;return e[t]!=="."&&e[t]!==")"?!1:g2(e[t+1])}function uU(e){const t=e.trimStart();if(!t||t.startsWith("```")||t.startsWith("~~~")||t.startsWith(":::")||t[0]===">"||t[0]==="<")return!0;if(t[0]==="#"){let n=0;for(;t[n]==="#";)n++;if(n>=1&&n<=6&&g2(t[n]))return!0}return!!((t[0]==="-"||t[0]==="+"||t[0]==="*")&&g2(t[1])||n2e(t)||Xve(t)||t2e(t))}function IF(e,t){return e?t?`${e} +${t}`:e:t}function O6(e){const t=String(e??"").trim();return t?wf(t):!1}function MF(e){let t=0;for(let n=0;nR6){h=!0;break}const g=o[m],y=Q1(g,c);if(y!==-1){const b=IF(f,g.slice(0,y));if(!O6(b)){h=!0;break}const v=g.slice(y+c.length),w=v.trim()?`suffix:${MF(v)}`:"nosuffix";return["closed",u,i+a,d,i+m,y,MF(b),w].join(":")}if(uU(g)){h=!0;break}if(f=IF(f,g),f.length>oU){h=!0;break}}if(!h&&O6(f))return["pending",u,i+a,d].join(":")}}return null}function d5(e,t){const n=String(e??"").trim();return!n||!/^\d[\d,.]*\s*[~~-]\s*$/.test(n)?!1:/\d/.test(String(t??""))}function o2e(e){const t=String(e??"").trimStart(),n=t.match(/^\d+(?:,\d{3})*(?:\.\d+)?/);if(!n)return!1;const i=t.slice(n[0].length);return/^\s*(?:[+\-*/^_=<>]|\\[a-z]+)/i.test(i)?!1:i===""||/^[)\s,.!?;:]/.test(i)}function f5(e){const t=String(e??"").trim();return t?/^(?:\.{3,}|…+)$/.test(t):!1}function s2e(e,t){zve(e);const n=(r,a,l)=>{const u=String(a??"").replace(/^[\t ]+/,"").replace(/[\t ]+$/,"");if(!u)return;const c=r.push("paragraph_open","p",1);c.map=[l,l+1];const d=r.push("inline","",0);d.content=u,d.map=[l,l+1],d.children=[],r.push("paragraph_close","p",-1)},i=(r,a)=>{const l=r,u=!!t?.strictDelimiters,c=!l?.env?.__markstreamFinal,d=(v,w)=>{let A=w;for(;A=3&&(!A||/\s/.test(A))){const M=l.push("text","",0);return M.content=l.src.slice(l.pos,v),l.pos=v,!0}}const f=[["$$","$$"],["$","$"],["\\(","\\)"]],h=String(l.pending??""),m=Math.max(0,l.pos-h.length);let g=m,y=m;const b=m;for(const[v,w]of f){const A=l.src,M=lU(A),L=Jve(A,c);let E=!1;v==="$$"&&g!==b&&(g=b);let C=-1,x=-1,_=0;const F=I=>{if((I==="undefined"||I==null)&&(I=""),I==="\\"){l.pos=l.pos+I.length,g=l.pos;return}if(I==="\\)"||I==="\\("){const $=l.push("text_special","",0);$.content=I==="\\)"?")":"(",$.markup=I,l.pos=l.pos+I.length,g=l.pos;return}if(!I)return;if(v==="$$"&&I.includes("$")){let $=0;for(;$0&&I[T-1]==="$"||T+10){const R=I.slice(0,D),P=l.push("text","",0);P.content=R,l.pos=l.pos+R.length,g=l.pos}const $=I.slice(D).match(/^!\[([^\]]*)\]\(([^)]+)\)/);if($){const[,R,P]=$,j=P.match(/^(\S+)(?:\s+"([^"]+)")?\s*$/),B=j?j[1]:P,K=j&&j[2]?j[2]:null,X=l.push("image","img",0);X.attrs=[["src",B],["alt",R]],K&&X.attrs.push(["title",K]),X.content=R,X.children=[{type:"text",content:R,tag:""}],l.pos=l.pos+$[0].length,g=l.pos;const V=I.slice(D+$[0].length);V&&F(V);return}const T=l.push("text","",0);T.content=I,l.pos=l.pos+I.length,g=l.pos;return}const H=l.push("text","",0);H.content=I,l.pos=l.pos+I.length,g=l.pos};for(;!(g>=A.length);){const I=A.indexOf(v,g);if(I===-1)break;if(oy(A,I)){g=I+Math.max(1,v.length);continue}const D=s4(M,I);if(D){g=D[1];continue}const H=s4(L,I);if(H){g=H[1];continue}if(I===C&&g===x){if(_++,_>2){g=I+Math.max(1,v.length);continue}}else _=0,C=I,x=g;if(v==="("&&I>0){let V=I-1;for(;V>=0&&A[V]===" ";)V--;if(V>=0&&A[V]==="]"){g=I+v.length;continue}}if(v==="$"&&I>0&&A[I-1]==="$"){g=I+1;continue}if(v==="$"&&I=A.length);){const D=D6(A,I);if(D===-1)break;if(D+10&&A[D-1]==="$"){I=D+1;continue}const H=c5(A,D+1);if(H===-1)break;const $=A.slice(D+1,H),T=$.includes("`"),R=!$||!$.trim(),P=A[H+1],j=d5($,P),B=f5($);if(!T&&!R&&!j&&!B){const K=A.slice(g,D);K&&F(K);const X=l.push("math_inline","math",0);X.content=nf($,t),X.markup="$",X.raw=`$${$}$`,X.loading=!1,g=H+1,I=H+1}else F("$"),I=D+1}I{const c=r,d=!c?.env?.__markstreamFinal,f=t?.strictDelimiters,h=f?[["\\[","\\]"],["$$","$$"]]:[["\\[","\\]"],["[","]"],["$$","$$"]],m=c.bMarks[a]+c.tShift[a];let g=c.src.slice(m,c.eMarks[a]).trim(),y=!1,b="",v="",w=!1,A="",M=!1;for(const[K,X]of h)if(g.startsWith(K))if(K.includes("[")){const V=K==="\\["?g.slice(K.length):"";if(K==="\\["&&Q1(V,X)===-1&&!/^\s*!\[/.test(V)&&!V.includes("`")&&wf(V)){y=!0,b=K,v=X;break}if(t?.strictDelimiters){if(g.replace("\\","")==="["){if(a+1=0?"\\]":v,_=C>=0?C:Q1(g,v,E);if(!w&&_>b.length){const K=g.slice(L+b.length,_),X=c.push("math_block","math",0);X.content=nf(K),X.markup=b==="$$"?"$$":b==="["?"[]":"\\[\\]",X.map=[a,a+1],X.raw=`${b}${K}${x}`,X.block=!0,X.loading=!1,c.line=a+1;const V=g.slice(_+x.length);return V.trim()&&n(c,V,a),!0}let F=a,I="",D=!1,H="",$=a;const T=w?g:g===b?"":g.slice(b.length),R=!f&&b==="\\["?"]":"",P=Q1(T,v);if(P!==-1){const K=P;I=T.slice(0,K),H=T.slice(K+v.length),$=w?a+1:a,D=!0,F=$}else for(T&&!w&&(I=T),F=a+1;F{const c=r,d=c.bMarks[a]+c.tShift[a],f=c.src.slice(d,c.eMarks[a]).trim();return!f.startsWith("$$")&&!f.startsWith("\\[")?!1:o(r,a,l,u)};e.inline.ruler.before("escape","math",i),e.block.ruler.before("lheading","explicit_math_block",s,{alt:["paragraph","reference","blockquote","list"]}),e.block.ruler.before("paragraph","math_block",o,{alt:["paragraph","reference","blockquote","list"]})}function r2e(e){const t=e.renderer.rules.image||function(n,i,o,s,r){const a=n,l=r;return l.renderToken?l.renderToken(a,i,o):""};e.renderer.rules.image=(n,i,o,s,r)=>{const a=n;return a[i].attrSet?.("loading","lazy"),t(a,i,o,s,r)},e.renderer.rules.fence=e.renderer.rules.fence||((n,i)=>{const o=n[i],s=String(o.info??"").trim();return`
      ${e.utils.escapeHtml(String(o.content??""))}
      `})}const a2e=/^\s]/i,l2e=/^<\/a\s*>/i;function u2e(e,t){if(e?.type!=="inline")return!1;const n=e.children;if(!Array.isArray(n)||n.length===0)return t.test(String(e.content??""));let i=0;for(let o=n.length-1;o>=0;o--){const s=n[o];if(s?.type==="link_close"){for(o--;o>=0&&n[o]?.level!==s.level&&n[o]?.type!=="link_open";)o--;continue}if(s?.type==="html_inline"){const r=String(s.content??"");a2e.test(r)&&i>0&&i--,l2e.test(r)&&i++}if(!(i>0)&&s?.type==="text"&&t.test(String(s.content??"")))return!0}return!1}function c2e(e){const t=e.core?.ruler,n=t.getNamedRules?.().find(i=>i.name==="linkify")?.fn;typeof n=="function"&&t.at("linkify",i=>{if(!i.md?.options?.linkify)return;const o=Array.isArray(i.tokens)?i.tokens:[],s=i.md.linkify;if(!s)return;const r=o.filter(a=>u2e(a,s));if(r.length)return n(Object.assign(Object.create(Object.getPrototypeOf(i)),i,{tokens:r}))})}function d2e(e){const t=e.inline.ruler,n=t.getNamedRules?.(),i=n?.find(a=>a.name==="link")?.fn,o=n?.find(a=>a.name==="image")?.fn;if(typeof i!="function"||typeof o!="function")return;const s=e.validateLink,r=e;r.__markstreamOriginalValidateLink=s,t.at("link",(...a)=>{const l=a[0].md,u=l?.validateLink===s?l.options?.validateLink:l?.validateLink;if(!l||typeof u!="function")return i(...a);const c=l.validateLink;l.validateLink=u;try{return i(...a)}finally{l.validateLink=c}}),t.at("image",(...a)=>{const l=a[0].md;if(!l)return o(...a);const u=l.validateLink;l.validateLink=s;try{return o(...a)}finally{l.validateLink=u}})}function f2e(e={}){const t=e.markdownItOptions??{},n=typeof t.experimental=="object"&&t.experimental!==null?t.experimental:{},i=Object.prototype.hasOwnProperty.call(t,"stream")?!!t.stream:!0,o=Object.prototype.hasOwnProperty.call(t,"validateLink"),s=new $ge({html:!0,linkify:!0,typographer:!0,...t,experimental:{stream:i,...n}});if(!o){const r=a=>!Tp(a,{tagName:"a",attrName:"href"});sve(r),s.set({validateLink:r})}return d2e(s),c2e(s),(e.enableMath??!0)&&s2e(s,{...e.mathOptions??{}}),(e.enableContainers??!0)&&s0e(s),e.enableFixIndentedCodeBlock!==!1&&M0e(s),cve(s),pve(s),fve(s),yve(s),r2e(s),_0e(s,{customHtmlTags:e.customHtmlTags}),s}function Ep(e){const t=Object.assign(Object.create(Object.getPrototypeOf(e)),e);return Array.isArray(e.attrs)&&(t.attrs=e.attrs.map(n=>[...n])),Array.isArray(e.map)&&(t.map=[...e.map]),Array.isArray(e.children)&&(t.children=e.children.map(n=>Ep(n))),t}function h2e(e){const t=e.meta??{};return{type:"checkbox",checked:t.checked===!0,raw:t.checked?"[x]":"[ ]"}}function p2e(e){const t=e,n=t.attrGet?t.attrGet("checked"):void 0,i=n===""||n==="true";return{type:"checkbox_input",checked:i,raw:i?"[x]":"[ ]"}}function m2e(e){const t=String(e.content??"");return{type:"emoji",name:t,markup:String(e.markup??""),raw:`:${t}:`}}function v9(e,t,n){const i=[];let o="",s=t+1;const r=[];for(;sn.startsWith(t)||t.startsWith(n)):!1}function TF(e,t,n,i){n.length>0&&e.push(...n),i.length>0&&t.push(...i),n.length=0,i.length=0}function EF(e,t){return!t&&e.startsWith(" ")&&!e.startsWith(" ")?` ${e}`:e}function k2e(e,t){const n=[],i=[],o=[],s=[],r=e.split(v2e),a=/\r?\n$/.test(e),l=r.some(h=>h.startsWith("diff ")||h.startsWith("--- ")||h.startsWith("+++ ")||h.startsWith("@@ ")),u=h=>{const m=h;if(!fU.some(g=>m.startsWith(g)))if(m.startsWith("-")){const g=m.slice(1);o.push(EF(g,l))}else if(m.startsWith("+")){const g=m.slice(1);s.push(EF(g,l))}else{TF(n,i,o,s);const g=l&&m.startsWith(" ")?m.slice(1):m;n.push(g),i.push(g)}},c=a?Math.max(0,r.length-1):r.length;for(let h=0;h0||s.length>0)&&TF(n,i,o,s);const d=n.join(` +`),f=i.join(` +`);return{original:t&&a&&d?`${d} +`:d,updated:t&&a&&f?`${f} +`:f}}function JS(e){const t=Array.isArray(e.map)&&e.map.length===2,n=e.meta??{},i=typeof n.closed=="boolean"?n.closed:void 0,o=i===!0||i!==!1&&t,s=String(e.info??""),r=s.startsWith("diff"),a=r?(()=>{const u=s,c=u.indexOf(" ");return c===-1?"":String(u.slice(c+1)??"")})():s;let l=String(e.content??"");if(!o&&e.markup){const u=e.markup[0],c=g2e(u);c.test(l)&&(l=l.replace(c,""))}if(r){const{original:u,updated:c}=k2e(l,o===!0);return{type:"code_block",language:a,code:String(c??""),raw:String(l??""),diff:r,loading:i===!0?!1:i===!1?!0:!t,originalCode:u,updatedCode:c}}return{type:"code_block",language:a,code:String(l??""),raw:String(l??""),diff:r,loading:i===!0?!1:i===!1?!0:!t}}function b2e(e){const t=e.meta??{};return{type:"footnote_reference",id:String(t.label??""),raw:`[^${String(t.label??"")}]`}}function w2e(){return{type:"hardbreak",raw:`\\ +`}}function A2e(e,t,n){const i=[];let o="",s=t+1;const r=[];for(;s\s*$/.test(t)||Gf.has(e)}function C2e(e){if(!e||e.length===0)return LF();const t=p5.get(e);if(t)return t;const n=e.map(su).filter(Boolean);if(!n.length){const o=LF();return p5.set(e,o),o}const i={customTagSet:new Set(n),allowedTagSet:Gw({customHtmlTags:e})};return p5.set(e,i),i}function gU(e){const t=e,n=t.raw??t.content??t.markup??"";return String(n??"")}function x2e(e){const t=e.meta,n=t?.markstreamCustomHtmlRaw,i=t?.markstreamCustomHtmlInner;return typeof n=="string"&&typeof i=="string"?{raw:n,inner:i}:null}function r4(e,t){const n=t.toLowerCase();for(let i=e.length-1;i>=0;i--){const[o,s]=e[i];if(String(o).toLowerCase()===n)return s}}function S2e(e,t,n){const i=e.slice();return r4(i,"href")||i.push(["href",t]),n!=null&&!r4(i,"title")&&i.push(["title",n]),i}function P6(e){return e.map(gU).join("")}function Mk(e){const t=[],n=i=>{const o=String(i??"");if(!o)return;const s=t[t.length-1];if(s?.type==="text"){s.content=`${s.content}${o}`,s.raw=`${s.raw}${o}`;return}t.push({type:"text",content:o,raw:o})};for(const i of e)if(i){if(i.type==="reference"||i.type==="footnote_reference"){n(String(i.raw??""));continue}if("children"in i&&Array.isArray(i.children)){t.push({...i,children:Mk(i.children)});continue}t.push(i)}return t}function _2e(e,t,n){let i=0;for(let o=t;o`;g.toLowerCase().includes(M.toLowerCase())||(g+=M),b=!0,y=!0}const v=[],w=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let A;for(;(A=w.exec(a))!==null;){const M=A[1],L=A[2]||A[3]||A[4]||"";v.push([M,L])}if(u?.has(l)){const M=x2e(e);return[{type:l,tag:l,attrs:v,content:M?M.inner:h.innerTokens.length?P6(h.innerTokens):"",children:h.innerTokens.length?i(h.innerTokens,o,s,r):[],raw:M?.raw??g,loading:e.loading||y,autoClosed:b},h.nextIndex]}return[{type:"html_inline",tag:l,attrs:v,content:g,children:m,raw:g,loading:y,autoClosed:b},h.nextIndex]}function vU(e){if(e.type==="math_inline"){if(e.raw)return String(e.raw);const t=e.markup==="$$"?"$$":"$";return`${t}${String(e.content??"")}${t}`}return Array.isArray(e.children)&&e.children.length>0?e.children.map(t=>vU(t)).join(""):String(e.content??"")}function M2e(e){return!e||!Array.isArray(e.children)||e.children.length===0?"":e.children.map(t=>vU(t)).join("")}function NF(e,t=!1){let n=e.attrs??[],i=null;if((!n||n.length===0)&&Array.isArray(e.children))for(const d of e.children){const f=d.attrs;if(Array.isArray(f)&&f.length>0){n=f,i=d;break}}const o=String(n.find(d=>d[0]==="src")?.[1]??""),s=n.find(d=>d[0]==="alt")?.[1],r=M2e(i??e);let a="";r?a=r:s!=null&&String(s).length>0?a=String(s):i?.content!=null&&String(i.content).length>0?a=String(i.content):Array.isArray(i?.children)&&i.children[0]?.content?a=String(i.children[0].content):Array.isArray(e.children)&&e.children[0]?.content?a=String(e.children[0].content):e.content!=null&&String(e.content).length>0&&(a=String(e.content));const l=n.find(d=>d[0]==="title")?.[1]??null,u=l===null?null:String(l),c=String(e.content??"");return{type:"image",src:o,alt:a,title:u,raw:c,loading:t}}function T2e(e){const t=String(e.content??"");return{type:"inline_code",code:t,raw:t}}function E2e(e,t,n){const i=[];let o="",s=t+1;const r=[];for(;s=0;i--){const[o,s]=e[i];if(String(o).toLowerCase()===n)return s}}function N2e(e,t,n){const i=e.slice();return a4(i,"href")||i.push(["href",t]),n!=null&&!a4(i,"title")&&i.push(["title",n]),i}function y9(e,t,n){const i=e[t],o=L2e(i.attrs),s=String(a4(o,"href")??""),r=a4(o,"title"),a=r==null?null:String(r),l=N2e(o,s,a);let u=t+1;const c=[];let d=!0;for(;uy.type==="strong_open")){const y=String(h.content??""),b=String(h.raw??y),v=Ep(h);v.content=y.slice(0,-2),v.raw=b.replace(/\*\*$/,""),f=c.slice(),f[f.length-1]=v}const m=To(f,void 0,void 0,n),g=m.map(y=>{const b=y;return"content"in y?String(b.content??""):String(b.raw??"")}).join("");return{node:{type:"link",href:s,title:a,text:g,children:m,raw:`[${g}](${s}${a?` "${a}"`:""})`,loading:d,attrs:l},nextIndex:u0?i:[{type:"text",content:l,raw:l}],raw:`~${l}~`},nextIndex:s0?i:[{type:"text",content:o||String(e[t].content??""),raw:o||String(e[t].content??"")}],raw:`^${o||String(e[t].content??"")}^`},nextIndex:s?@[\\\]^_`{|}~]/,U2e=/\p{P}/u,V2e=/^[\x22\x27《「『【〔〖〘〚〈([{“‘﹁﹃﹙﹛﹝]$/u,K2e=/^[\x22\x27》」』】〕〗〙〛〉)]}”’﹂﹄﹚﹜﹞]$/u,Z2e=/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,G2e=/:\/\//,B6=1,yU=2,Q2e=4,Y2e=8,kU=16,cf=32,Tk=64,j0=128,bU=256,J2e=512,H0=1024,X2e=1982;function k9(e){let t=0;for(let n=0;n=t){n++,i++;continue}n++,i++;continue}if(o==="*"&&n>=t)return n;n++}return-1}function Qf(e){return!!e&&W2e.test(e)}function Yf(e){return!!e&&(q2e.test(e)||U2e.test(e))}function AU(e,t){return!!e&&!!t&&/^\p{Script=Han}$/u.test(t)&&V2e.test(e)}function CU(e,t){return!!e&&!!t&&/^[\p{L}\p{N}]$/u.test(t)&&K2e.test(e)}function tye(e,t){const n=t>0?e[t-1]:void 0,i=e[t+1];return!i||Qf(i)?!1:!(Yf(i)&&!AU(i,n)&&n&&!Qf(n)&&!Yf(n))}function nye(e,t){const n=t>0?e[t-1]:void 0,i=e[t+1];return!n||Qf(n)?!1:!(Yf(n)&&!CU(n,i)&&i&&!Qf(i)&&!Yf(i))}function iye(e,t,n=0){let i=n,o=!1;for(;i0?e[t-1]:void 0,i=e[t+2];return!i||Qf(i)?!1:!(Yf(i)&&!AU(i,n)&&n&&!Qf(n)&&!Yf(n))}function sye(e,t){const n=t>0?e[t-1]:void 0,i=e[t+2];return!n||Qf(n)?!1:!(Yf(n)&&!CU(n,i)&&i&&!Qf(i)&&!Yf(i))}function rye(e,t=0){let n=t,i=!1;for(;n=0&&e[s]==="\\";s--)o++;return o%2===1}const cye=/[\p{L}\p{N}]/u,dye=/^[\p{L}\p{N}]+$/u;function $6(e){return e?cye.test(e):!1}function xU(e){return e?dye.test(e):!1}function kv(e,t){let n=t;for(;n0?e[t-1]:void 0,o=n=2&&i.intraword&&t.push({start:n,end:o}),n=o}for(let n=0;n=3)return i;n=i+o.len}return-1}function mye(e){return e?Z2e.test(e)||G2e.test(e):!1}function gye(e,t){if(!e||!t)return null;const n=e.match(/\[([^\]\n]+)\]\(([^)]*)$/);return n&&n[2]===t?n[1]:null}function To(e,t,n,i){if(!e||e.length===0)return[];const o=i?.__linkifyDemotionContext,s=iy(t),r={filename:o?.filename||s.filename,explicitFilename:o?.explicitFilename||s.explicitFilename,marketTicker:o?.marketTicker||s.marketTicker};(r.filename||r.explicitFilename||r.marketTicker)&&(i={...i,__linkifyDemotionContext:r});const a=i,l=[];let u=null,c=0;const d=i?.requireClosingStrong,f=e;function h(){return e===f&&(e=e.slice()),e}function m(){u=null}function g(J,te){const U=e.length===1?t:String(te.content??""),Y=[],ce=fye(J);if(ce!==-1){M(J.slice(0,ce),J.slice(0,ce));const ge=J.slice(ce);return ge&&(F({type:"text",content:ge,raw:ge}),c--),c++,!0}if($2e.test(J)){const ge=J.indexOf("~~");ge!==-1&&Y.push({type:"strikethrough",index:ge})}if(z2e.test(J)){const ge=J.indexOf("**");ge!==-1&&Y.push({type:"strong",index:ge})}if(/[^*]*\*[^*]+/.test(J)){const ge=U?wU(U,0):J.indexOf("*");if(U&&ge===-1)return!1;ge!==-1&&Y.push({type:"emphasis",index:ge})}Y.sort((ge,oe)=>ge.index!==oe.index?ge.index-oe.index:ge.type===oe.type?0:ge.type==="strong"?-1:oe.type==="strong"?1:0);const me=Y[0];if(!me)return!1;if(me.type==="strikethrough"){const ge=me.index,oe=ge>-1?J.slice(0,ge):"";if(oe&&M(oe,oe),ge===-1)return c++,!0;const re=J.indexOf("~~",ge+2),ve=re===-1?J.slice(ge+2):J.slice(ge+2,re),le=re===-1?"":J.slice(re+2),{node:xe}=RF([{type:"s_open",tag:"s",content:"",markup:"~~",info:"",meta:null},{type:"text",tag:"",content:ve,markup:"",info:"",meta:null},{type:"s_close",tag:"s",content:"",markup:"~~",info:"",meta:null}],0,i);return m(),A(xe),le&&(F({type:"text",content:le,raw:le}),c--),c++,!0}if(me.type==="strong"){const ge=me.index,oe=ge>-1?J.slice(0,ge):"";if(oe&&M(oe,oe),ge===-1)return c++,!0;if(t&&ge===0){let pe=!1,Te=0;for(;Te=2)return M(J,J),c++,!0}}if(t&&(J.match(/\*/g)||[]).length>eye(t))return M(J.slice(oe.length),J.slice(oe.length)),c++,!0;const re=kv(J,ge);if(re.len>=3){const pe=pye(J,ge+re.len);if(pe!==-1){const Te=J.slice(ge+re.len,pe);if(hye(Te)){const{node:Ae}=m0([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:Te,markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,i);m(),A(Ae);const _e=J.slice(pe+3);return _e&&(F({type:"text",content:_e,raw:_e}),c--),c++,!0}}}if(!oye(J,ge)){const pe=J.slice(ge,ge+re.len);M(pe,pe);const Te=J.slice(ge+re.len);return Te&&(F({type:"text",content:Te,raw:Te}),c--),c++,!0}const ve=rye(J,ge+2);let le="",xe="";if(ve.index!==-1){le=J.slice(ge+2,ve.index),xe=J.slice(ve.index+2);const pe=ve.index,Te=kv(J,pe);if(re.intraword&&Te.intraword&&!xU(le)||!le&&re.len>=4&&re.intraword)return M(J.slice(oe.length),J.slice(oe.length)),c++,!0}else{if(d||ve.sawInvalidClose||re.intraword)return M(J.slice(oe.length),J.slice(oe.length)),c++,!0;le=J.slice(ge+2),xe=""}if(!le&&/^\*+$/.test(xe))return M(J,J),c++,!0;const{node:be}=m0([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"text",tag:"",content:le,markup:"",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,i);return m(),A(be),xe&&(F({type:"text",content:xe,raw:xe}),c--),c++,!0}if(me.type==="emphasis"){let ge=me.index;ge===-1&&(ge=0);const oe=J.slice(0,ge);if(oe&&M(oe,oe),!tye(J,ge)){M(J[ge],J[ge]);const pe=J.slice(ge+1);return pe&&(F({type:"text",content:pe,raw:pe}),c--),c++,!0}const re=kv(J,ge),ve=iye(U,J,ge+1),le=ve.index,xe=e[c+1];if(i?.final&&xe?.type==="em_open"&&le!==-1&&J.slice(ge+1,le).trim()!==J.slice(ge+1,le)||le===-1&&(ve.sawInvalidClose||i?.final||re.intraword||!$6(J[ge+1])))return M(J.slice(ge),J.slice(ge)),c++,!0;const{node:be}=v9([{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:le>-1?J.slice(ge+1,le):J.slice(ge+1),markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null}],0,i);if(m(),A(be),le!==-1&&le{for(let be=0;be=0&&xe[Te]==="\\";Te--)pe++;if(pe%2===0)return be}return-1})(J);if(Y===-1)return!1;let ce=1;for(let xe=Y+1;xeme?.type==="math_inline")||!j2e.test(J))return null;const U=te.parseInline(J,{__markstreamFinal:!!i?.final});if(!Array.isArray(U)||U.length===0)return null;const Y=(U.find(me=>me?.type==="inline")?.children??[]).filter(me=>!(me?.type==="text"&&String(me.content??"")===""));if(!Y.length||!Y.some(me=>me?.type!=="text")||Y.length===1&&Y[0]?.type==="text"&&String(Y[0].content??"")===J)return null;const ce=To(Y,J,n,i);return ce.length?ce:null}function v(J){m(),l.push(J)}function w(J){m();const te=Ep(J);l.push(te)}function A(J){v(J)}function M(J,te){u?(u.content+=J,u.raw+=te??J):(u={type:"text",content:String(J??""),raw:String(te??J??"")},l.push(u))}function L(J,te){if(!J)return;const U=To([{...te,type:"text",content:J,raw:J}],J,n,i);if(U.length===1&&U[0]?.type==="text"){const Y=U[0];M(String(Y.content??""),String(Y.raw??Y.content??""));return}for(const Y of U)A(Y)}function E(J,te){return String(J.markup??"").startsWith(te)}function C(J){if(!u||J.loading!==!0||J.markup!=="\\(\\)")return;const te=e[c-1];!te||te.type!=="text"||!E(te,"\\(")||u.content.endsWith("(")&&(u.content=u.content.slice(0,-1),u.raw.endsWith("(")&&(u.raw=u.raw.slice(0,-1)),!u.content&&l[l.length-1]===u&&(l.pop(),u=null))}function x(J){return J.endsWith("](")?e[c+1]?.type==="link_open"&&e[c+1]?.markup==="linkify"&&e[c+2]?.type==="text"&&e[c+3]?.type==="link_close"&&e[c+4]?.type==="text"&&String(e[c+4]?.content??"").startsWith(")"):!1}function _(J,te,U=k9(J)){let Y=J;const ce=String(te.content??"");return(U&B6)!==0&&Y.endsWith("\\")&&!E(te,"\\\\")&&!ce.endsWith("\\\\")&&(Y=Y.slice(0,-1)),(U&H0)!==0&&Y.endsWith("(")&&!E(te,"\\(")&&!ce.endsWith("\\(")&&(Y=Y.slice(0,-1)),(U&yU)!==0&&/\*+$/.test(Y)&&!E(te,"\\*")&&!ce.endsWith("\\*")&&(Y=Y.replace(/\*+$/,"")),Y}for(;c=0;pe--){const Te=l[pe];if(Te.type!=="text")break;re=pe,ve=String(Te.content??"")+ve}rere==="href")?.[1],oe=String(ge??"");if(t&&oe){const re=t.indexOf("](");if(re!==-1){const ve=t.indexOf(")",re+2);ve===-1?U.loading=!0:U.loading&&t.slice(re+2,ve).includes(oe)&&(U.loading=!1)}}/^file:\/\/\/[a-z]:\//i.test(U.href)&&B(U,te-1)||R(U)||v(U)}function $(J){if(J.markup!=="linkify")return!1;const{node:te,nextIndex:U}=y9(e,c,i);return j(te,U)?(c=U,!0):!1}function T(J){m(),A(F2e(J)),c++}function R(J){if(J.type!=="link")return!1;const te=l[l.length-1];if(!te||te.type!=="text")return!1;const U=String(te.content??"").match(/^([^[]*)\[([^\]\n]+)\]\($/);if(!U)return!1;const Y=J,ce=String(Y.href??""),me=String(Y.text??""),ge=String(U[2]??""),oe=ce.replace(/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,"");if(!ce||!(me===ce||me===oe||mye(me)))return!1;const re=String(U[1]??"");return re?(te.content=re,te.raw=re):l.pop(),v({...J,text:ge,children:[{type:"text",content:ge,raw:ge}],raw:`[${ge}](${ce}${Y.title?` "${Y.title}"`:""})`}),!0}function P(J){if(J.type!=="link")return!1;const te=J,U=String(te.href??"");return U?j({href:U,title:te.title==null||te.title===""?null:String(te.title),loading:!!te.loading},c+1):!1}function j(J,te){const U=l[l.length-1];if(U?.type!=="image"||U.src||!U.loading||!String(U.raw??"").endsWith("]("))return!1;const Y=e[te],ce=String(Y?.content??"");if(Y?.type!=="text"||!ce.startsWith(")"))return!1;l.pop(),u=null;const me=String(U.alt??"");v({type:"image",src:J.href,alt:me,title:J.title,raw:`![${me}](${J.href}${J.title?` "${J.title}"`:""})`,loading:!!J.loading});const ge=ce.slice(1),oe=Ep(Y);return oe.content=ge,oe.raw=ge,h()[te]=oe,!0}function B(J,te=c-1){if(J.type!=="link")return!1;const U=l[l.length-1],Y=e[te];if(!U||U.type!=="text"||Y?.type!=="text")return!1;const ce=String(U.content??""),me=String(Y.content??"");if(!ce.endsWith("!")||!me.endsWith("!")||E(Y,"\\!"))return!1;const ge=ce.slice(0,-1);ge?(U.content=ge,U.raw=ge,u=U):(l.pop(),u=null);const oe=J,re=String(oe.text??oe.children?.map(xe=>String(xe?.content??xe?.raw??"")).join("")??""),ve=String(oe.href??""),le=oe.title==null||oe.title===""?null:String(oe.title);return v({type:"image",src:ve,alt:re,title:le,raw:`![${re}](${ve}${le?` "${le}"`:""})`,loading:!!oe.loading}),!0}function K(J,te="",U=null){const Y=String(J.alt??J.raw??"");return{type:"link",href:te,title:U,text:Y,children:[J],raw:`[${Y}](${te}${U?` "${U}"`:""})`,loading:!0}}function X(J){const te=J.startsWith("![")?J:`![${J}`,U=te.slice(2),Y=U.indexOf("](");return{type:"image",src:"",alt:Y===-1?U.replace(/\]$/,""):U.slice(0,Y),title:null,raw:te,loading:!0}}function V(J){const te=J.indexOf("[![");if(te===-1||typeof t=="string"&&e.length===1&&uye(t,te,"["))return!1;const U=J.slice(0,te);return U&&M(U,U),v(K(X(J.slice(te+1)))),c++,!0}function Q(J){if(i?.final)return!1;const te=e[c-1];if(te?.type!=="text"||!String(te.content??"").endsWith("[")||E(te,"\\["))return!1;const U=l[l.length-1];if(U?.type==="text"&&U.content.endsWith("[")){const Y=U.content.slice(0,-1);Y?(U.content=Y,U.raw=Y,u=U):(l.pop(),u=null)}return v(K(NF(J))),c++,!0}function ie(J){if(J.type!=="link")return!1;const te=J,U=String(te.raw??""),Y=String(te.text??"");if(!U.startsWith("[![")&&!Y.startsWith("!["))return!1;const ce=te.title==null||te.title===""?null:String(te.title);return v(K({type:"image",src:String(te.href??""),alt:Y.replace(/^!\[/,"").replace(/\]$/,""),title:ce,raw:U.startsWith("[![")?U.slice(1):U,loading:!0})),!0}function ee(J){if(!J.startsWith("]("))return!1;const te=e[c-2];if(te?.type==="text"&&String(te.content??"").endsWith("[")&&E(te,"\\["))return!1;const U=l[l.length-1];if(U?.type!=="image"&&U?.type!=="link")return!1;const Y=U,ce=U?.type==="link"&&Array.isArray(Y.children)&&Y.children.length===1&&Y.children[0]?.type==="image"?l.pop():null,me=ce?ce.children[0]:l.pop();if(!me||me.type!=="image")return!1;const ge=e[c+1];let oe=String(ce?.href??""),re=ce?.title==null?null:String(ce.title),ve=!0;if(ge?.type==="link_open"){const{node:xe,nextIndex:be}=y9(e,c+1,i);oe=xe.href,re=xe.title,ve=!0,c=be}else{if(oe=J.slice(2),oe.includes('"')){const xe=oe.split('"');oe=String(xe[0]??"").trim(),re=xe[1]==null?null:String(xe[1]).trim()}c++}const le=K(me,oe,re);return le.loading=ve,v(le),!0}function Ce(){const J=e[c-3];return e[c-2]?.type==="image"&&e[c-1]?.type==="text"&&String(e[c-1].content??"")==="]("&&J?.type==="text"&&String(J.content??"").endsWith("[")&&E(J,"\\[")}function Z(J,te){const U=J.indexOf("[");if(U===-1)return!1;let Y=J.slice(0,U);const ce=J.indexOf("](",U);if(ce!==-1){const me=e[c+2];let ge=J.slice(U+1,ce);if(ge.includes("[")){const pe=ge.indexOf("[");Y+=J.slice(0,U+pe+1);const Te=U+pe+1;ge=J.slice(Te+1,ce)}const oe=e[c+1];if(J.endsWith("](")&&oe?.type==="link_open"&&me){const pe=e[c+4];let Te=4,Ae=!0;if(pe?.type==="text"){const Fe=String(pe.content??"");if(Fe.startsWith(")")){Ae=!1;const $e=Fe.slice(1);if($e){const Je=Ep(pe);Je.content=$e,Je.raw=$e,h()[c+4]=Je}else Te++}else Fe==="."&&Te++}L(Y,te);const _e=String(me.content??"");return i?.validateLink&&!i.validateLink(_e)?M(ge,ge):v({type:"link",href:_e,title:null,text:ge,children:[{type:"text",content:ge,raw:ge}],loading:Ae}),c+=Te,!0}const re=J.indexOf(")",ce),ve=re!==-1?J.slice(ce+2,re):"",le=re===-1;let xe=Y.match(/\*+$/);if(xe&&(Y=Y.replace(/\*+$/,"")),L(Y,te),xe||(xe=ge.match(/^\*+/)),!d&&xe){const pe=xe[0].length;ge=ge.replace(/^\*+/,"").replace(/\*+$/,"");const Te=[];if(pe===1?Te.push({type:"em_open",tag:"em",nesting:1}):pe===2?Te.push({type:"strong_open",tag:"strong",nesting:1}):pe===3&&(Te.push({type:"strong_open",tag:"strong",nesting:1}),Te.push({type:"em_open",tag:"em",nesting:1})),Te.push({type:"link",href:ve,title:null,text:ge,children:[{type:"text",content:ge,raw:ge}],loading:le}),pe===1){Te.push({type:"em_close",tag:"em",nesting:-1});const{node:Ae}=v9(Te,0,i);A(Ae)}else if(pe===2){Te.push({type:"strong_close",tag:"strong",nesting:-1});const{node:Ae}=m0(Te,0,void 0,i);A(Ae)}else if(pe===3){Te.push({type:"em_close",tag:"em",nesting:-1}),Te.push({type:"strong_close",tag:"strong",nesting:-1});const{node:Ae}=m0(Te,0,void 0,i);A(Ae)}else{const{node:Ae}=v9(Te,0,i);A(Ae)}}else i?.validateLink&&!i.validateLink(ve)?M(ge,ge):v({type:"link",href:ve,title:null,text:ge,children:[{type:"text",content:ge,raw:ge}],loading:le});const be=re!==-1?J.slice(re+1):"";return be&&(F({type:"text",content:be,raw:be}),c--),c++,!0}return!1}function ae(J){const te=J.indexOf("![");if(te===-1)return!1;const U=J.slice(0,te);return U&&!u?u={type:"text",content:U,raw:U}:U&&u&&(u.content+=U),u&&(l.push(u),u=null),v(X(J.slice(te))),c++,!0}function he(J){if(!(J?.startsWith("[")&&n?.type==="list_item_open"))return!1;const te=J.slice(1).match(/[^\s\]]/);if(te===null)return c++,!0;if(te&&/x/i.test(te[0])){const U=te[0]==="x"||te[0]==="X";return v({type:"checkbox_input",checked:U,raw:U?"[x]":"[ ]"}),c++,!0}return!1}return l}function e_(e,t,n){const i=n?.__sourceLineMapper;if(!i)return{startLine:e,endLine:t};const o=i(e),s=t>e?i(t-1).endLine:i(t).startLine;return{startLine:o.startLine,endLine:Math.max(o.startLine,s)}}function DF(e,t){const n=Math.max(0,Math.min(e.length,Math.trunc(t)));let i=0;for(let o=0;oi&&e[o-1]!==` +`&&r++,{startLine:s,endLine:r}}function y2(e,t,n,i){const o=vye(e,t,n);return e_(o.startLine,o.endLine,i)}function yye(e,t){const n=e?.map;if(!Array.isArray(n)||n.length<2)return null;const i=Number(n[0]),o=Number(n[1]);return!Number.isFinite(i)||!Number.isFinite(o)?null:e_(i,o,t)}function Si(e,t,n){if(!n?.includeSourceMap)return e;const i=yye(t,n);if(!i)return e;if(e.sourceMap=i,e.type==="code_block"){const o=e;o.startLine=i.startLine,o.endLine=i.endLine}return e}function kye(e,t,n,i){if(!i?.includeSourceMap)return e;const o=t?.map;if(!Array.isArray(o)||o.length<2)return e;const s=Number(o[0]),r=Number(o[1]),a=Number(n);return!Number.isFinite(s)||!Number.isFinite(r)||!Number.isFinite(a)||(e.sourceMap=e_(s,Math.max(r,a),i)),e}function bye(e){const t=String(e.content??""),n=t.replace(/[ \t\r\n]+$/g,"");if(n===t)return;e.content=n;const i=e.children;if(!(!Array.isArray(i)||i.length===0))for(;i.length;){const o=i[i.length-1];if(!o){i.pop();continue}if(o.type==="softbreak"||o.type==="hardbreak"){i.pop();continue}if(o.type==="text"){const s=String(o.content??""),r=s.replace(/[ \t\r\n]+$/g,"");if(r===s)break;if(r){o.content=r;break}i.pop();continue}break}}function wye(e){const t=String(e.content??""),n=t.match(/\r?\n\s*\d+[.)]?\s*$/);if(!n||typeof n.index!="number")return;e.content=t.slice(0,n.index);const i=e.children;if(!(!Array.isArray(i)||i.length===0))for(;i.length;){const o=i[i.length-1];if(!o){i.pop();continue}if(o.type==="softbreak"||o.type==="hardbreak"){i.pop();continue}if(o.type==="text"){const s=String(o.content??"");if(/^[ \t\r\n\d.)]*$/.test(s)){i.pop();continue}const r=s.replace(/[ \t\r\n\d.)]+$/g,"");r!==s&&(r?o.content=r:i.pop())}break}}function Aye(e){const t=String(e.content??"");return/[ \t\r\n]+$/.test(t)||/\r?\n\s*\d+[.)]?\s*$/.test(t)}function Cg(e,t,n){const i=e[t],o=[],s=mh(n,!0);let r=t+1;for(;rd.raw).join("")};n?.includeSourceMap&&Si(c,e[r],n),o.push(c),r=u+1}else r+=1;const a={type:"list",ordered:i.type==="ordered_list_open",start:(()=>{if(i.attrs&&i.attrs.length){const l=i.attrs.find(u=>u[0]==="start");if(l){const u=Number(l[1]);return Number.isFinite(u)&&u!==0?u:1}}})(),items:o,raw:o.map(l=>l.raw).join(` +`)};return n?.includeSourceMap&&Si(a,i,n),[a,r+1]}function Cye(e,t,n,i){const o=String(n[1]??"note"),s=String(n[2]??o.charAt(0).toUpperCase()+o.slice(1)),r=[],a=mh(i,!0);let l=t+1;for(;lu.raw).join(` +`)} +:::`},l+1]}const xye=new Set(["warning","info","note","tip","danger","caution"]);function Sye(e){let t=0;for(;t=0;g--){const y=f[g];if(y.type==="text"&&/:+/.test(y.content)){h=g;break}}const m={type:"paragraph",children:To((h!==-1?f.slice(0,h):f)||[],void 0,void 0,l.options()),raw:String(d.content??"").replace(/\n:+$/,"").replace(/\n\s*:::\s*$/,"")};n?.includeSourceMap&&Si(m,e[u],n),a.push(m),l.remember(m.raw)}u+=3}else if(e[u].type==="bullet_list_open"||e[u].type==="ordered_list_open"){const[d,f]=Cg(e,u,l.options());n?.includeSourceMap&&Si(d,e[u],n),a.push(d),l.remember(d.raw),u=f}else if(e[u].type==="blockquote_open"){const[d,f]=xg(e,u,l.options());n?.includeSourceMap&&Si(d,e[u],n),a.push(d),l.remember(d.raw),u=f}else{const d=Vw(e,u,l.options());d?(a.push(d[0]),l.remember(d[0].raw),u=d[1]):u++}return[{type:"admonition",kind:o,title:s,children:a,raw:`:::${o} ${s} +${a.map(d=>d.raw).join(` +`)} +:::`},u+1]}const Iye=/^::: ?(warning|info|note|tip|danger|caution|error) ?(.*)$/;function Mye(e,t,n){const i=e[t];if(i.type!=="container_open")return null;const o=Iye.exec(String(i.info??""));return o?Cye(e,t,o,n):null}const t_={parseContainer:(e,t,n)=>_ye(e,t,n),matchAdmonition:Mye};function xg(e,t,n){const i=[],o=mh(n,!0);let s=t+1;for(;sa.raw).join(` +`)};return n?.includeSourceMap&&Si(r,e[t],n),[r,s+1]}function Tye(e){if(e.info?.startsWith("diff"))return JS(e);const t=String(e.content??""),n=t.match(/ type="application\/vnd\.ant\.([^"]+)"/);let i=t;n?.[1]&&(i=t.replace(/]*>/g,"").replace(/<\/antArtifact>/g,""));const o=Array.isArray(e.map)&&e.map.length===2;return{type:"code_block",language:n?n[1]:String(e.info??""),code:i,raw:i,loading:!o}}function Eye(e,t,n){const i=[];let o=t+1,s=[],r=[];const a=mh(n,!0);for(;ou.raw).join("")),o+=3}else if(e[o].type==="dd_open"){let l=o+1;for(r=[];l0&&(i.push({type:"definition_item",term:s,definition:r,raw:`${s.map(u=>u.raw).join("")}: ${r.map(u=>u.raw).join(` +`)}`}),s=[]),o=l+1}else o++;return[{type:"definition_list",items:i,raw:i.map(l=>l.raw).join(` +`)},o+1]}function Lye(e,t,n){const i=e[t].meta??{},o=String(i?.label??"0"),s=[],r=mh(n,!0);let a=t+1;for(;al.raw).join(` +`)}`},a+1]}function Nye(e,t,n){const i=e[t],o=i.attrs,s=Array.isArray(o)&&o.length?Object.fromEntries(o.filter(c=>Array.isArray(c)&&c.length>=1&&c[0]).map(([c,d])=>[String(c),d==null||d===""?!0:String(d)])):void 0,r=String(i.tag?.substring(1)??"1"),a=Number.parseInt(r,10),l=e[t+1],u=String(l.content??"");return{type:"heading",level:a,text:u,...s?{attrs:s}:{},children:To(l.children||[],u,void 0,n),raw:u}}function Fye(e,t,n){const i=t.toLowerCase(),o=new RegExp(String.raw`^<\s*${i}(?=\s|>|/)`,"i"),s=new RegExp(String.raw`^<\s*\/\s*${i}(?=\s|>)`,"i");let r=0,a=Math.max(0,n);for(;a$/.test(d)||r++,a=l+c+1;continue}a=l+1}return-1}function SU(e){const t=String(e.content??"");if(/^\s*");else if(l)l=!y.includes(">");else if(u)u=!y.includes("?>");else if(y.startsWith("");else if(y.startsWith("");else if(y.startsWith("");else{const b=o(y);if(b)if(b.closing){for(let v=r.length-1;v>=0;v--)if(r[v]===b.tag){r.length=v;break}}else b.selfClosing||s(b.after,b.tag)||r.push(b.tag)}}if(d===-1||d>=t)break;c=d+1}return a||l||u||r.length>0}function v9e(e,t,n){if(!n?.length)return!1;const i=new Set(r1(n));if(!i.size)return!1;const o=c=>{const d=c.charCodeAt(0);return d>=65&&d<=90||d>=97&&d<=122||d>=48&&d<=57||c==="_"||c==="-"||c===":"},s=c=>c===" "||c===" ",r=c=>{if(c[0]!=="<")return null;let d=1;for(;d"&&g!=="/")return null;const y=c.indexOf(">",d);if(y===-1)return null;let b=y-1;for(;b>=0&&s(c[b]);)b--;return{closing:f,tag:m,selfClosing:!f&&c[b]==="/",after:c.slice(y+1)}},a=(c,d)=>{const f=c.toLowerCase();let h=0;for(;h")return!0}}return!1},l=[];let u=0;for(;u=t?t:c,f=e.slice(u,d),h=f.endsWith("\r")?f.slice(0,-1):f,m=Sg(h);if(m){const g=r(h.slice(m.index));if(g)if(g.closing){for(let y=l.length-1;y>=0;y--)if(l[y]===g.tag){l.length=y;break}}else g.selfClosing||a(g.after,g.tag)||l.push(g.tag)}if(c===-1||c>=t)break;u=c+1}return l.length>0}function y9e(e,t){const n=Gye.exec(e);if(!n)return null;const i=n[1]??"",o=n.index+i.length,s=e.indexOf(` +`,o),r=e.slice(o,s===-1?e.length:s);return!Sg(r.endsWith("\r")?r.slice(0,-1):r)||DU(e,o)||g9e(e,o)||v9e(e,o,t)?null:`${e.slice(0,n.index)}${i}`}function l_(e,t,n){let i=t;for(;ii&&(r=!0),t.inMath=!1,t.mathOpenOffset=null,s+=2;continue}s++;continue}if(t.inDollarMath){if(e.startsWith("$$",s)&&!yc(e,a)){i!=null&&o&&n+s+2>i&&(r=!0),t.inDollarMath=!1,t.dollarMathOpenOffset=null,s+=2;continue}s++;continue}if(e[s]==="`"&&!yc(e,a)){const l=l_(e,s,"`"),u=OU(e,s+l,l);if(u===-1)break;s=u+l;continue}if(e.startsWith("\\[",s)&&!yc(e,a)){t.inMath=!0,t.mathOpenOffset=n+s,s+=2;continue}if(e.startsWith("$$",s)&&!yc(e,a)){t.inDollarMath=!0,t.dollarMathOpenOffset=n+s,s+=2;continue}s++}return r}function k9e(e,t){if(!QS(t))return e;const n=t,i=zF.get(n),o=i?.source===e?i.state:i&&e.startsWith(i.source)?PU(i.state,e.slice(i.source.length),i.source.length-i.state.lineBuffer.length).state:Zw(e).state;zF.set(n,{source:e,state:o});const{context:s}=o,r=s.inMath?s.mathOpenOffset:s.inDollarMath?s.dollarMathOpenOffset:null;if(r==null)return e;const a=e.slice(r+2),l=e.lastIndexOf(` +`,r-1)+1;if(e.slice(l,r).trim()!==""&&!/^\r?\n/.test(a)||/^\s*!\[/.test(a))return e;const u=a.trim(),c=/^(?:[a-z]|pi)$/i.test(u);return wf(a)&&!c?e:e.slice(0,r)}function b9e(e,t,n,i,o){const s=o_(e),r=s_(e);if(t.inFence&&t.fenceInBlockquote&&e.trim()&&r_(e)==null&&w5(t),t.inFence&&t.fenceInList&&e.trim()&&s.column=t.fenceLen&&/^\s*$/.test(a.rest)&&w5(t):(t.inFence=!0,t.fenceChar=a.markerChar,t.fenceLen=a.markerLen,t.fenceInBlockquote=a.inBlockquote,t.fenceInList=a.inList||t.listContentIndent!=null&&!a.inBlockquote&&s.column>=t.listContentIndent,t.fenceListIndent=a.listIndent||t.listContentIndent||0);else if(!t.inFence)return qF(e,t,n,i,o)}else return qF(e,t,n,i,o);return!1}function Zw(e,t=d9e(),n=null,i=!1,o=0){const s=wv(t);let r=wv(t),a="",l=!1,u=0;for(;uu&&e[c-1]==="\r"?c-1:d?c:e.length,h=e.slice(u,f);b9e(h,s,o+u,n,i)&&(l=!0),d?(r=wv(s),a=""):a=h,u=d?c+1:e.length}return{closedOpenMath:l,state:{committedContext:r,context:s,lineBuffer:a}}}function PU(e,t,n=0){return t&&!e.context.inMath&&!e.context.inDollarMath&&!e.context.inFence&&!e.committedContext.inFence&&!/[\\$`~\r\n]/.test(t)&&!(e.lineBuffer.endsWith("\\")&&(t[0]==="["||t[0]==="]"))?{closedOpenMath:!1,state:{committedContext:wv(e.committedContext),context:wv(e.context),lineBuffer:e.lineBuffer+t}}:Zw(e.lineBuffer+t,e.committedContext,n+e.lineBuffer.length,e.context.inMath||e.context.inDollarMath,n)}function w9e(e,t){if(!QS(e))return;const n=e.stream;if(typeof n?.reset!="function")return;const i=e,o=Kw.get(i);if(o?.source===t)return;const s=o?t.startsWith(o.source):!1,r=s&&o?t.slice(o.source.length):"",a=s&&o?PU(o.explicitBracketMath,r,o.source.length-o.explicitBracketMath.lineBuffer.length):Zw(t),l=a.state,u=s&&o?a.closedOpenMath:!1;if(o&&s&&o.key===null&&o.pendingCandidate===!1&&!u&&!m9e(o.source,r)&&!h9e(t)){o.source=t,o.explicitBracketMath=l;return}const c=i2e(t);(o&&(o&&!s||o.key!==c||u)||!o&&c)&&n.reset(),f9e(e,t,c,l)}function A9e(e){return typeof e.preTransformTokens=="function"||typeof e.postTransformTokens=="function"}function BU(e,t){const n=e?.map,i=t?.map;return n===i?!0:!Array.isArray(n)||!Array.isArray(i)?!1:n.length===i.length&&n.every((o,s)=>o===i[s])}function C9e(e,t){const n=e?.attrs,i=t?.attrs;if(n===i)return!0;if(!Array.isArray(n)||!Array.isArray(i)||n.length!==i.length)return!1;for(let o=0;o":""}function ZF(e){return{type:"paragraph",children:e,raw:e.map(I9e).join("")}}function GF(e,t){if(t.sourceMap)for(const n of e)n.sourceMap||(n.sourceMap=t.sourceMap)}function QF(e,t){if(e.type!=="paragraph")return null;const n=e.children,i=Array.isArray(n)?n:[];if(i.length===0)return null;const o=r9e(t);if(!o?.size)return null;let s=-1;for(let c=0;ch?.type==="hardbreak")){s=c;break}}if(s===-1)return null;const r=i.slice(0,s),a=i[s];if(!a)return null;const l=[];r.length&&l.push(ZF(r)),l.push(a);const u=i.slice(s+1);return u.length&&l.push(ZF(u)),l}function M9e(e){const t=e.trim();if(!t)return null;const n=/^(?:]*>\s*)?]*)?>/i.test(t),i=/<\/html>\s*$/i.test(t);return!n||!i?null:[{type:"html_block",tag:"html",raw:e,content:e,loading:!1}]}function Av(e){const t=e.raw;if(typeof t=="string")return t;const n=e.content;return typeof n=="string"?n:""}function T9e(e,t){if(e.type!=="html_block"||!t)return!1;const n=String(e.raw??e.content??"");return new RegExp(String.raw`^\s*<\s*\/\s*${zu(t)}\s*>\s*$`,"i").test(n)}const C5=new Set(["iframe","script","style","textarea","title"]);function Qm(e,t,n){if(!e||!t)return null;const i=t.toLowerCase(),o=f=>{if(e.startsWith("",f+4);return{closing:!1,end:w===-1?e.length:w+3,selfClosing:!1,tag:""}}if(e.startsWith("",f+9);return{closing:!1,end:w===-1?e.length:w+3,selfClosing:!1,tag:""}}const h=Wo(e.slice(f));if(h===-1)return null;const m=f+h+1,g=e.slice(f,m);if(/^<\s*[!?]/.test(g))return{closing:!1,end:m,selfClosing:!1,tag:""};let y=g.slice(1).trimStart();const b=y.startsWith("/");b&&(y=y.slice(1).trimStart());const v=y.match(/^([A-Z][\w:-]*)/i);return v?.[1]?{closing:b,end:m,selfClosing:/\/\s*>$/.test(g),tag:v[1].toLowerCase()}:{closing:!1,end:f+1,selfClosing:!1,tag:""}},s=(f,h)=>{const m=new RegExp(String.raw`<\s*\/\s*${zu(f)}(?=\s|>)`,"gi");m.lastIndex=h;const g=m.exec(e);if(!g||g.index==null)return null;const y=o(g.index);return y?{start:g.index,end:y.end}:null};let r=-1,a=-1,l=Math.max(0,n);for(;l$/.test(u))return{raw:u,start:r,end:a+1,closed:!0};if(C5.has(i)){const f=s(i,a+1);return f?{raw:e.slice(r,f.end),start:r,end:f.end,closeStart:f.start,closed:!0}:{raw:e.slice(r),start:r,end:e.length,closed:!1}}let c=1,d=a+1;for(;d]*$/,"")} +`}function YF(e){return e.replace(/\r\n/g,` +`).replace(/(^|\n)[ \t]{1,4}/g,"$1")}function N9e(e,t,n){return n?e.includes(n,t)?!0:YF(e.slice(Math.max(0,t))).includes(YF(n)):!1}function F9e(e,t){let n=Math.max(0,t);for(;n)`,"gi");let i=-1,o;for(;(o=n.exec(e))!==null;)i=o.index;return i}function Ek(e,t){return{final:t,__disableStreamParse:!0,requireClosingStrong:e.requireClosingStrong,customHtmlTags:e.customHtmlTags,validateLink:e.validateLink}}const D9e=new Set(["admonition","blockquote","code_block","definition_list","footnote","heading","list","math_block","table","thematic_break"]),O9e=/(?:^|\n)\s{0,3}(?:#{1,6}\s+\S|[-+*]\s+\S|\d+[.)]\s+\S|>\s*\S|`{3,}|~{3,}|(?:\*{3,}|-{3,}|_{3,})(?:\s|$)|\|.*\|)/m;function P9e(e){return/\n\s*\n/.test(e)||O9e.test(e)}function B9e(e,t){if(!e.trim()||t.length===0)return!1;if(t.some(i=>D9e.has(String(i?.type??"").toLowerCase()))||t.some(i=>{if(i?.type!=="html_block")return!1;const o=i;return Array.isArray(o.children)&&o.children.length>0}))return!0;if(!P9e(e))return!1;if(t.length>1)return!0;const[n]=t;return!!(n&&n.type==="paragraph")}function $9e(e){const t=[];let n=0;for(;n=e.length)break;const i=e.slice(n).match(/^<([A-Z][\w:-]*)/i);if(!i?.[1])return null;const o=Qm(e,i[1],n);if(!o||o.start!==n)return null;t.push(o.raw),n=o.end}return t.length>1?t:null}function z9e(e,t,n,i){const o=n.customHtmlTags?.join("\0")??"",s=t,r=$F.get(s),a=r&&r.final===i&&r.customHtmlTags===o&&r.requireClosingStrong===n.requireClosingStrong&&r.validateLink===n.validateLink,l=e.map((u,c)=>a&&r.blocks[c]===u?r.children[c]:Fm(u,t,n));return $F.set(s,{blocks:e,children:l,customHtmlTags:o,final:i,requireClosingStrong:n.requireClosingStrong,validateLink:n.validateLink}),l.flat()}function j9e(e,t,n,i){return e.map(o=>{if(o?.type!=="html_block")return o;const s=o,r=String(s.tag??"").toLowerCase();if(!r||r==="details"||$q.has(r)||Array.isArray(s.children))return o;const a=String(o.raw??s.content??"");if(!a)return o;const l=Wo(a);if(l===-1)return o;const u=Qm(a,r,0),c=u?.closeStart??-1,d=u?.closed===!0&&c>=l+1,f=d?a.slice(l+1,c):a.slice(l+1);if(!f.trim())return o;const h=Ek(n,i),m=d?null:$9e(f),g=m?z9e(m,t,h,i):Fm(f,t,h);return B9e(f,g)?{...o,children:g}:o})}function H9e(e){for(const t of e)if(t?.type==="html_block")return!0;return!1}function Fm(e,t,n){return e.trim()?jU(e,t,{...n,__disableStreamParse:!0,__disableStructuredReuse:!0}):[]}function W9e(e,t,n){const i=Fm(e,t,n),o=i[0];return i.length===1&&o?.type==="paragraph"&&Array.isArray(o.children)?o.children:i}function q6(e,t,n){const i=SU({content:e}),o=Wo(e),s=$U(e,"summary");if(o!==-1&&s!==-1&&s>=o+1){const r=W9e(e.slice(o+1,s),t,n);r.length>0&&(i.children=r)}return i.raw=e,i}function q9e(e,t,n){const i=Wo(e);if(i===-1)return[];const o=e.slice(i+1);if(!o.trim())return[];const s=Qm(o,"summary",0);if(!s)return Fm(o,t,n);const r=o.slice(0,s.start),a=o.slice(s.end);return[...Fm(r,t,n),q6(s.raw,t,n),...Fm(a,t,n)]}function zU(e,t,n,i,o,s=0){const r=[];let a=s;for(let l=0;l{const Q=$U(f,"details");return Q!==-1?f.slice(0,Q):f})():f,w=g===-1?"":String(e[g].raw??Av(e[g])??""),A=b||g!==-1&&y?.closed===!0,M=w.replace(/[\t\r\n ]+$/,""),L=A?(()=>{const Q=(y?.raw??"").lastIndexOf(M);return Q===-1?t.length:h+Q})():t.length,E=Wo(f),C=E!==-1?h+E+1:h+f.length,x=t.slice(C,L===-1?t.length:L),_=L+M.length,F=A?Math.max(L+w.length,F9e(t,_)):t.length,I=A?t.slice(L,F):w,D=A?t.slice(h,F):t.slice(h),H=i.__structuredReuseTailStart!==void 0&&i.__structuredReuseTailStart>0?H6.get(n)??(()=>{const Q=new WeakMap;return H6.set(n,Q),Q})():void 0,$=H?.get(u);if($&&$.openRaw===f&&$.explicitClose===A&&$.closeSliceEnd===F&&$.middleSource===x){if(r.push($.node),a=A?F:t.length,g===-1&&!b)break;g!==-1&&(l=g);continue}const[T]=zU(b?[]:g===-1?e.slice(l+1):e.slice(l+1,g),t,n,i,o,h+f.length);let R=q9e(v,n,Ek(i,o)),P=T;const j=T[0];if(!R.some(Q=>{const ie=Q;return ie?.type==="html_block"&&String(ie.tag??"").toLowerCase()==="summary"})){if(j?.type==="html_block"&&String(j.tag??"").toLowerCase()==="summary"&&!Array.isArray(j.children))P=[q6(String(j.raw??j.content??""),n,Ek(i,o)),...T.slice(1)];else if(E!==-1){const Q=Qm(t,"summary",h+E+1);if(Q&&Q.closed){const ie=t.slice(h+E+1,Q.start);/^[\t \r\n]*$/.test(ie)&&(R=[q6(Q.raw,n,Ek(i,o)),...R])}}}const B=n.parse(x,{__markstreamFinal:o}),K=n.renderer.render(B,n.options,{__markstreamFinal:o}),X=E!==-1?t.slice(h,h+E+1):f,V={...u,tag:"details",attrs:Uw(f.slice(0,E+1)),raw:D,content:`${X}${K}${I}`,children:[...R,...P],loading:!o&&!A};if(i.includeSourceMap&&(V.sourceMap=y2(t,h,A?F:t.length,i)),H&&A&&H.set(u,{openRaw:f,explicitClose:A,closeSliceEnd:F,middleSource:x,node:V}),r.push(V),a=A?F:t.length,g===-1&&!b)break;g!==-1&&(l=g)}return[r,a]}function U9e(e,t,n,i){if(!n)return e;const o=e.slice();let s=0;for(let r=0;r=d.start&&x.end<=d.end){o.splice(L,1);continue}break}M=C+E.length,o.splice(L,1)}}return o}function V9e(e){const t=a=>a===" "||a===" "||a===` +`||a==="\r",n=a=>{if(!a||a[0]!=="<"||a.includes(">"))return!1;let l=1;if(l{const y=g.charCodeAt(0);return y>=65&&y<=90||y>=97&&y<=122},c=g=>{const y=g.charCodeAt(0);return y>=48&&y<=57},d=g=>g==="!"||u(g),f=g=>u(g)||c(g)||g===":"||g==="-",h=g=>u(g)||c(g)||g==="_"||g==="."||g===":"||g==="-",m=h;if(l>=a.length||!d(a[l]))return!1;for(l++;l=a.length)return!0;if(a[l]==="/"){for(l++;l=a.length}if(!h(a[l]))return!1;for(l++;l=a.length)return!0;const g=a[l];if(g==='"'||g==="'"){for(l++;l=a.length)return!0;l++}else{for(;l"||y==='"'||y==="'"||y==="`")break;l++}if(l>=a.length)return!0}}}return!0},i=(a,l)=>DU(a,l),o=String(e??""),s=o.lastIndexOf("<");if(s===-1||i(o,s))return o;if(s>0){const a=o[s-1],l=a===" "||a===" "||a===` +`||a==="\r",u=o[s-2];if(!l&&!((a==="n"||a==="r")&&u==="\\"))return o}const r=o.slice(s);return r.includes(">")||r.length>1&&(r[1]===" "||r[1]===" "||r[1]===` +`||r[1]==="\r")||!n(r)?o:o.slice(0,s)}function XF(e,t){if(e===t)return;const n=e.split(/\r?\n/),i=t.split(/\r?\n/),o=[];let s=0;for(let r=0;r{const a=Number.isFinite(r)?Math.max(0,Math.trunc(r)):0;if(aString(m??"").toLowerCase()).filter(Boolean));if(!n.size)return e;const i=m=>m===" "||m===" ",o=m=>{const g=m.charCodeAt(0);return g>=65&&g<=90||g>=97&&g<=122||g>=48&&g<=57||m==="_"||m==="-"||m===":"},s=m=>{if(!m)return!1;if(m[0]===" ")return!0;let g=0;for(let y=0;y=4)return!0;continue}if(b===" ")return!0;break}return!1},r=m=>{let g=!1,y=!1;for(let b=0;b")return b}return-1},a=m=>{let g=0;for(;g{if(s(m))return-1;const y=m.replace(/^[ \t]+/,"");if(!y||y.startsWith(">")||y.startsWith("|")||/^(?:[*+-]|\d+[.)])[\t ]+/.test(y))return-1;let b=!1,v=0;for(;v=M.length){b=!0,v++;continue}const E=M[L];if(E==="!"||E==="?"){b=!0,v+=A+1;continue}if(E==="/"){b=!0,v+=A+1;continue}const C=L;for(;L"&&_!=="/"){b=!0,v++;continue}const F=new RegExp(String.raw`<\s*\/\s*${x}\s*>`,"i"),I=/\/\s*>$/.test(M),D=F.test(m.slice(v+A+1)),H=F.test(e.slice(g+v+A+1)),$=/[\r\n]/.test(e.slice(g+v+A+1));if(b&&n.has(x)&&!I&&!D&&(H||$))return v;b=!0,v+=A+1}return-1};let u=!1,c="",d=0,f="",h=0;for(;hh&&e[m-1]==="\r",b=g?y?m-1:m:e.length,v=e.slice(h,b),w=g?y?`\r +`:` +`:"",A=a(v);let M=v;if(!u&&!A){const L=l(v,h);if(L!==-1){const E=w||` +`;M=`${v.slice(0,L).replace(/[ \t]+$/,"")}${E}${E}${v.slice(L).replace(/^[ \t]+/,"")}`}}f+=M,f+=w,A&&(u?A.markerChar===c&&A.markerLen>=d&&/^\s*$/.test(A.rest)&&(u=!1,c="",d=0):(u=!0,c=A.markerChar,d=A.markerLen)),h=g?m+1:e.length}return f}function Z9e(e,t){if(!e||!t.length)return e;const n=new Set(t.map(d=>String(d??"").toLowerCase()));if(!n.size)return e;const i=d=>d===" "||d===" ",o=d=>{const f=d.charCodeAt(0);return f>=65&&f<=90||f>=97&&f<=122||f>=48&&f<=57||d==="_"||d==="-"},s=d=>{let f=0;for(;f{let f=!1,h=!1;for(let m=0;m")return m}return-1},a=(d,f,h)=>{const m=h.toLowerCase();let g=d.indexOf("<",f);for(;g!==-1;){let y=g+1;for(;y=d.length||d[y]!=="/"){g=d.indexOf("<",g+1);continue}for(y++;yd.length){g=d.indexOf("<",g+1);continue}let b=!0;for(let w=0;w="A"&&A<="Z"?String.fromCharCode(A.charCodeAt(0)+32):A)!==m[w]){b=!1;break}}if(!b){g=d.indexOf("<",g+1);continue}let v=y+m.length;if(v")return!0;g=d.indexOf("<",g+1)}return!1},l=d=>{let f=0;for(;f=d.length||d[f]!=="<")return d;for(f++;f=d.length||d[f]==="/")return d;const h=f;for(;fc&&e[d-1]==="\r",h=f?d-1:d,m=e.slice(c,h);u+=l(m),u+=f?`\r +`:` +`,c=d+1}return u}function G9e(e,t){if(!e||!t.length)return e;const n=new Set(t.map(f=>String(f??"").toLowerCase()));if(!n.size)return e;const i=f=>f===" "||f===" ",o=f=>{let h=0,m=!1,g=0;for(;h=f.length||f[h]!==">")break;for(m=!0,h++;h{let h=0;for(;hnew RegExp(String.raw`(<\s*\/\s*${f}\s*>)${"(?=[\\t ]*(?:#{1,6}[\\t ]+|>|(?:[*+-]|\\d+[.)])[\\t ]+|(?:`{3,}|~{3,})|\\||\\$\\$|:{3,}|\\[\\^[^\\]]+\\]:|(?:-{3,}|\\*{3,}|_{3,})))"}`,"gi"));let a=!1,l="",u=0,c="",d=0;for(;dd&&e[f-1]==="\r",g=h?m?f-1:f:e.length,y=e.slice(d,g),b=h?m?`\r +`:` +`:"",v=o(y),w=v?.prefix??"",A=v?.content??y,M=s(A);M&&(a?M.markerChar===l&&M.markerLen>=u&&/^\s*$/.test(M.rest)&&(a=!1,l="",u=0):(a=!0,l=M.markerChar,u=M.markerLen));let L=A;if(!a&&L.includes("{if(F.replace(/^[\t ]+/,"").startsWith("|"))return C;const I=F.slice(0,_).replace(/^[\t ]+/,"");if(I.length>0){const D=x.match(/^<\s*\/\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"",H=I.match(/^<\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"";if(!D||!H||D!==H)return C}return`${x} + +`});if(w){const E=w+L.split(` +`).join(` +${w}`);c+=E}else c+=L;c+=b,d=h?f+1:e.length}return c}function Q9e(e,t){if(!e||!t.length)return e;const n=new Set(t.map(I=>String(I??"").toLowerCase()));if(!n.size)return e;const i=I=>I===" "||I===" ",o=I=>{if(!I)return!1;if(I[0]===" ")return!0;let D=0;for(let H=0;H=4)return!0;continue}if($===" ")return!0;break}return!1},s=I=>{const D=I.charCodeAt(0);return D>=65&&D<=90||D>=97&&D<=122||D>=48&&D<=57||I==="_"||I==="-"||I===":"},r=I=>{let D=0;for(;D{let D=0,H=!1,$=0;for(;D=I.length||I[D]!==">")break;for(H=!0,D++;Dr(I).startsWith("<"),u=I=>{for(let D=0;D{if(o(I))return"";const D=r(I);if(!D.startsWith("<"))return"";let H=1;for(;H=D.length||D[H]==="/"||D[H]==="!"||D[H]==="?")return"";const $=H;for(;H"&&R!=="/"?"":T},d=I=>{if(o(I))return null;const D=r(I);if(!D.startsWith("<"))return null;let H=1;for(;H=D.length)return null;const $=D[H]==="/";if($)for(H++;H"&&j!=="/")return null;if($)return{type:"close",name:P};if(/\/\s*>\s*$/.test(D))return{type:"open",name:P,complete:!0};const B=D.indexOf(">",H);if(B!==-1){const K=D.slice(B+1);if(new RegExp(`<\\s*\\/\\s*${P}\\s*>`,"i").test(K))return{type:"open",name:P,complete:!0}}return{type:"open",name:P,complete:!1}},f=I=>{if(o(I))return null;const D=r(I).replace(/[ \t]+$/,"");if(!D.startsWith("<")||/^<\s*(?:!--|!doctype\b|\?)/i.test(D))return null;const H=D.match(/^<\s*([A-Z][\w:-]*)\b[^>]*\/\s*>\s*$/i);if(H?.[1])return H[1].toLowerCase();const $=D.match(/^<\s*([A-Z][\w:-]*)\b[^>]*>[\s\S]*<\s*\/\s*([A-Z][\w:-]*)\s*>\s*$/i);if(!$?.[1]||!$[2])return null;const T=$[1].toLowerCase();return T===$[2].toLowerCase()?T:null};let h=!1,m="",g=0;const y=I=>{let D=0;for(;Dy(I),v=I=>{const D=r(I);return D?o(I)?!0:/^(?:#{1,6}[ \t]+|>|[*+-][ \t]+|\d+[.)][ \t]+|`{3,}|~{3,}|\||\$\$|:{3,}|\[\^[^\]]+\]:|-{3,}|\*{3,}|_{3,})/.test(D):!1},w=(I,D,H)=>{let $=I,T=0;for(;$$&&e[R-1]==="\r",B=P?j?R-1:R:e.length,K=e.slice($,B),X=a(K),V=X?.key??"";if(T>0&&D&&V!==D)break;const Q=X?.content??K,ie=d(Q);if(ie?.name===H){if(ie.type==="open")ie.complete||T++;else if(T>0&&(T--,T===0))return!1}else if(T>0&&(u(Q)||v(Q)))return!0;if(P)$=R+1;else break}return!1};let A="",M=0,L=!0,E=!1,C=!1,x=` +`;const _=[];let F="";for(;MM&&e[I-1]==="\r",$=D?H?I-1:I:e.length,T=e.slice(M,$),R=D?H?`\r +`:` +`:"",P=a(T),j=P?.key??"",B=P?.content??T,K=b(B);K&&(h?K.markerChar===m&&K.markerLen>=g&&/^\s*$/.test(K.rest)&&(h=!1,m="",g=0):(h=!0,m=K.markerChar,g=K.markerLen));const X=_.length>0;if(!h&&!X){const Q=c(B),ie=!!Q&&!L&&E&&C&&w(M,j,Q);Q&&!L&&(!E||ie)&&(j&&F&&j===F?A+=`${j}${x}`:j||(A+=x))}if(A+=T,A+=R,R&&(x=R),!h){const Q=d(B);if(Q){if(Q.type==="open")Q.complete||_.push(Q.name);else for(let ie=_.length-1;ie>=0;ie--)if(_[ie]===Q.name){_.length=ie;break}}}const V=u(B);L=V,E=!V&&l(B),C=!V&&!!f(B),F=j,M=D?I+1:e.length}return A}function Y9e(e){let t=!1,n="",i=0,o=!1,s=!1,r=!1,a=0;const l=(c,d)=>{const f=a_(c);if(f){t?f.markerChar===n&&f.markerLen>=i&&/^\s*$/.test(f.rest)&&(t=!1,n="",i=0):(t=!0,n=f.markerChar,i=f.markerLen);return}if(t)return;let h=0;for(;h{for(;a=c?c:d,h=f>a&&e[f-1]==="\r"?f-1:f;if(l(e.slice(a,h)),d===-1||d>=c){a=c;break}r=!1,a=d+1}},inMath:()=>o||s||r}}function x5(e,t,n,i){let o=e.replace(/([^\\])\r(ight|ho)/g,"$1\\r$2");const s=Y9e(o);if(o=o.replace(/([^\\])\r?\n(abla|eq|ot|exists)/g,(r,a,l,u)=>{s.scanTo(u+1);const c=s.inMath();return s.scanTo(u+r.length),c?`${a}\\n${l}`:r}),t||(o.endsWith("- *")&&(o=o.replace(/- \*$/,"- \\*")),/(?:^|\n)\s*-\s*$/.test(o)?o=o.replace(/(?:^|\n)\s*-\s*$/,r=>r.startsWith(` +`)?` +`:""):/(?:^|\n)\s*--\s*$/.test(o)?o=o.replace(/(?:^|\n)\s*--\s*$/,r=>r.startsWith(` +`)?` +`:""):/(?:^|\n)\s*>\s*$/.test(o)?o=o.replace(/(?:^|\n)\s*>\s*$/,r=>r.startsWith(` +`)?` +`:""):/\n\s*[*+]\s*$/.test(o)?o=o.replace(/\n\s*[*+]\s*$/,` +`):/(?:^|\n)\s*\d+\s*$/.test(o)?/^\d+$/.test(o.trim())||(o=o.replace(/(?:^|\n)\s*\d+\s*$/,r=>r.startsWith(` +`)?` +`:"")):/(?:^|\n)\s*\d+[.)]\s+\*{1,3}\s*$/.test(o)?o=o.replace(/((?:^|\n)\s*\d+[.)]\s+)(\*{1,3})\s*$/,(r,a,l)=>`${a}${l.split("").map(()=>"\\*").join("")}`):/(?:^|\n)\s*\d+[.)]\s*$/.test(o)?o=o.replace(/(?:^|\n)\s*\d+[.)]\s*$/,r=>r.startsWith(` +`)?` +`:""):/\n[[(]\n*$/.test(o)&&(o=o.replace(/(\n\[|\n\()+\n*$/g,` +`)),o=y9e(o,i.customHtmlTags)??o),i.customHtmlTags?.length&&o.includes("<")){const r=r1(i.customHtmlTags);if(r.length&&(o=K9e(o,r),o=Z9e(o,r),o=Q9e(o,r),o=G9e(o,r),o.includes("[\t ]*)(\r?\n)(?![\t ]*\r?\n|$)`,"gim");o=o.replace(l,"$1$2$2")}}return t||(o=V9e(o)),o}function J9e(e,t,n,i){const o=e,s=`${n?"final":"stream"}:${(i.customHtmlTags??[]).join(",")}`,r=j6.get(o);let a;if(!n&&!i.customHtmlTags?.length&&r&&r.mode===s&&t.length>=r.source.length&&t.startsWith(r.source)){const l=Math.max(0,r.source.length-Qye-Yye),u=x5(t.slice(l),n,e,i),c=r.source.length-l;a=u.length>=c&&u.slice(0,c)===r.safeMarkdown.slice(-c)?r.safeMarkdown.slice(0,r.safeMarkdown.length-c)+u:x5(t,n,e,i)}else a=x5(t,n,e,i);return n||(a=k9e(a,e)),j6.set(o,{source:t,safeMarkdown:a,mode:s}),a}function jU(e,t,n={}){const i=TU(n),o=i?Su():0,s=!!n.final,r=(e??"").toString();u9e(t,n)&&(t.stream.reset(),c9e(t),j6.delete(t),H6.delete(t));const a=J9e(t,r,s,n);i&&Rf(i,"safeMarkdownMs",Su()-o);const l=M9e(a);if(l){if(n.includeSourceMap){const M={...n,__sourceLineMapper:XF(r,a)};l[0].sourceMap=y2(a,0,a.length,M)}const w=n.preTransformTokens,A=n.postTransformTokens;if(i_(t,n)||typeof w=="function"||typeof A=="function"){const M=KF(t,a,{__markstreamFinal:s},n),L=typeof w=="function"&&w(M)||M;typeof A=="function"&&A(L)}return jF(l,n,i,o)}const u=i?Su():0,c=KF(t,a,{__markstreamFinal:s},n);if(i&&Rf(i,"tokenizeMs",Su()-u),!c||!Array.isArray(c))return jF([],n,i,o);const d=n.preTransformTokens,f=n.postTransformTokens;let h=c;d&&typeof d=="function"&&(h=d(h)||h);const m=t,g=typeof m.validateLink=="function"&&m.__markstreamOriginalValidateLink&&m.validateLink!==m.__markstreamOriginalValidateLink?m.validateLink:void 0,y=n.validateLink??g??m.options?.validateLink??(typeof m.validateLink=="function"?m.validateLink:void 0),b={...n,validateLink:y,__markdownIt:t,__sourceLineMapper:n.includeSourceMap===!0?XF(r,a):void 0,__sourceMarkdown:a,__customHtmlBlockCursor:0};let v=s9e(t,a,h,b,i);if(f&&typeof f=="function"){const w=f(h);if(Array.isArray(w)){const A=w[0],M=A?.type;A&&typeof M=="string"?v=Y1(w,{...b,__customHtmlBlockCursor:0},i):v=w}}if(H9e(v)){const w=i?Su():0;v=U9e(v,s,a,b),v=zU(v,a,t,b,s)[0],v=j9e(v,t,b,s),i&&Rf(i,"htmlBlockPassesMs",Su()-w)}if(s){const w=new WeakSet,A=M=>{if(!M||typeof M!="object"||w.has(M))return;if(w.add(M),Array.isArray(M)){for(const E of M)A(E);return}const L=M;L.type==="html_block"&&L.loading===!0&&(L.loading=!1);for(const E of Object.values(L))A(E)};A(v)}return v=LU(v,n),n.debug&&console.log("Parsed Markdown Tree Structure:",v),EU(v,i,o)}function eR(e,t){if(!e||!Array.isArray(e))return[];const n=[],i=mh(t),o=t?.__linkifyDemotionSeed;if(Array.isArray(o)&&o.length)for(const a of o)i.remember(String(a??""));const s=t?.includeSourceMap===!0;let r=0;for(;rd.type==="html_block")){if(s)for(const d of c)Si(d,l,t);for(const d of c)ic(d,l,t);n.push(...c)}else{const d={type:"paragraph",raw:u,children:c};s&&Si(d,l,t);const f=QF(d,t);if(f){s&&GF(f,d);for(const h of f)ic(h,l,t);n.push(...f)}else ic(d,l,t),n.push(d)}i.remember(u)}r+=1;break;default:r+=1;break}}return n}const X9e=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g,Cv=/\d/u,eke=/[,.!?;:,。;、!?:]/u,tke=/\d\p{Script=Han}{1,3}$/u;function nke(e){return e.pos>0&&e.pos+1{const u=a,c=u.posMax,d=u.pos;if(u.src.charCodeAt(d)!==r||l||s.refuseDigitRange&&nke(u))return!1;u.pos=d+1;let f=!1;for(;u.pos]|$)/i,rke=new Set([...ny,"base","button","datalist","dialog","embed","fieldset","form","iframe","input","legend","link","meta","object","optgroup","option","output","param","select","style","template","textarea","title"]),ake=new Set(["a","abbr","b","blockquote","br","caption","code","col","colgroup","dd","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","ins","kbd","li","mark","ol","p","picture","pre","s","small","source","span","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","ul"]);function tR(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function lke(e){return typeof e=="string"?e:e==null?"":String(e)}function HU(e){return/^[^\s"'<>`=]+$/.test(e)&&!/^on/i.test(e)}function Af(e){return lke(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function WU(e){return Af(e).replace(/`/g,"`")}function Qw(e){return String(e??"").trim().toLowerCase()}function u_(e,t="safe"){const n=Qw(e);return n?t==="escape"?!0:t==="trusted"?ny.has(n):!ake.has(n):!1}function qU(e,t="safe"){const n=Qw(e);return n?t==="escape"?!0:t==="trusted"?ny.has(n):rke.has(n):!1}function nR(e){const t=Object.entries(e);return t.length===0?"":t.map(([n,i])=>i===""?` ${n}`:` ${n}="${WU(i)}"`).join("")}function UU(e){const t=e.startsWith("/"),n=t?e.slice(1):e,i=n.match(ske);return i?{attrsStr:t?"":n.slice(i[0].length).trimStart(),isClosing:t,isSelfClosing:!t&&e.trimEnd().endsWith("/"),tagName:i[1]}:null}function uke(e,t){const n=e.split(",").map(i=>i.trim()).filter(Boolean);return n.length===0?!1:n.some(i=>{const o=i.split(/\s+/,1)[0]??"";return!o||Tp(o,{tagName:t,attrName:"srcset"})})}function VU(e,t,n,i){return Kge.has(e)||n==="safe"&&e==="style"?!0:e==="srcset"?uke(t,i):!!(Zge.has(e)&&t&&Tp(t,{tagName:i,attrName:e}))}function sp(e,t){const n=t.toLowerCase();return Object.keys(e).find(i=>i.toLowerCase()===n)}function KU(e,t,n,i=!1){if(t!=="safe"||Qw(n)!=="a")return e;const o=sp(e,"href");if(i&&(!o||!e[o])){const l=sp(e,"target"),u=sp(e,"rel");return l&&delete e[l],u&&delete e[u],e}const s=sp(e,"target");if((s?String(e[s]).trim():"").toLowerCase()!=="_blank")return e;const r=sp(e,"rel"),a=new Set(String(r?e[r]:"").split(/\s+/).map(l=>l.trim()).filter(Boolean).filter(l=>l.toLowerCase()!=="opener"));return a.add("noopener"),a.add("noreferrer"),r&&r!=="rel"&&delete e[r],e.rel=Array.from(a).join(" "),e}function iR(e,t="safe",n){const i={};for(const[o,s]of Object.entries(e)){const r=o.trim(),a=r.toLowerCase();!r||!HU(r)||VU(a,s,t,n)||(i[r]=s)}return KU(i,t,n,!!sp(e,"href"))}function ZU(e,t){const n=e.toLowerCase();return Bq.has(n)?!1:tR(t,n)||tR(t,e)}function c_(e,t="safe",n){const i={};for(const[o,s]of Object.entries(e)){const r=o.trim(),a=r.toLowerCase();!r||!HU(r)||VU(a,s,t,n)||(i[r]=s)}return KU(i,t,n,!!sp(e,"href"))}function xv(e){const t={};if(!Array.isArray(e)||e.length===0)return t;for(const[n,i]of e)n&&(t[String(n)]=i==null?"":String(i));return t}function Lk(e,t="safe",n){const i=c_(xv(e),t,n),o=Object.entries(i).map(([s,r])=>[s,r]);return o.length>0?o:void 0}function cke(e,t){const n=t.toLowerCase();if(["checked","disabled","readonly","required","autofocus","multiple","hidden"].includes(n))return e==="true"||e===""||e===t;if(["value","min","max","step","width","height","size","maxlength"].includes(n)){const i=Number(e);if(e!==""&&!Number.isNaN(i))return i}return e}function dke(e){const t={};for(const[n,i]of Object.entries(e))t[n]=cke(i,n);return t}function S5(e){return e.trim().length>0}function GU(e){const t=[];let n=0;for(;n",n);if(r!==-1){n=r+3;continue}break}const i=e.indexOf("<",n);if(i===-1){if(nn){const r=e.slice(n,i);S5(r)&&t.push({type:"text",content:r})}if(e.startsWith("![CDATA[",i+1)){const r=e.indexOf("]]>",i);if(r!==-1){t.push({type:"text",content:e.slice(i,r+3)}),n=r+3;continue}break}if(e.startsWith("!",i+1)){const r=e.indexOf(">",i);if(r!==-1){n=r+1;continue}break}const o=e.indexOf(">",i);if(o===-1)break;const s=UU(e.slice(i+1,o));if(!s){const r=e.slice(i,o+1);S5(r)&&t.push({type:"text",content:r}),n=o+1;continue}if(s.isClosing)t.push({type:"tag_close",tagName:s.tagName});else{const r={};if(s.attrsStr){const a=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let l;for(;(l=a.exec(s.attrsStr))!==null;){const u=l[1],c=l[2]??l[3]??l[4]??"";u&&!u.endsWith("/")&&(r[u]=c)}}t.push({type:s.isSelfClosing||Gf.has(s.tagName.toLowerCase())?"self_closing":"tag_open",tagName:s.tagName,attrs:r})}n=o+1}return t}function fke(e){const t=[];let n=0;for(;n",n);if(a!==-1){n=a+3;continue}break}const i=e.indexOf("<",n);if(i===-1){nn&&t.push({type:"text",content:e.slice(n,i)}),e.startsWith("![CDATA[",i+1)){const a=e.indexOf("]]>",i);if(a!==-1){t.push({type:"text",content:e.slice(i,a+3)}),n=a+3;continue}break}if(e.startsWith("!",i+1)){const a=e.indexOf(">",i);if(a!==-1){n=a+1;continue}break}const o=e.indexOf(">",i);if(o===-1)break;const s=UU(e.slice(i+1,o));if(!s){t.push({type:"text",content:e.slice(i,o+1)}),n=o+1;continue}if(s.isClosing){t.push({type:"tag_close",tagName:s.tagName}),n=o+1;continue}const r={};if(s.attrsStr){const a=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let l;for(;(l=a.exec(s.attrsStr))!==null;){const u=l[1],c=l[2]??l[3]??l[4]??"";u&&!u.endsWith("/")&&(r[u]=c)}}t.push({type:s.isSelfClosing||Gf.has(s.tagName.toLowerCase())?"self_closing":"tag_open",tagName:s.tagName,attrs:r}),n=o+1}return t}function hke(e){const t=String(e.tagName??"").trim();if(!t)return"";if(e.type==="tag_close")return`</${Af(t)}>`;const n=Object.entries(e.attrs??{}).map(([i,o])=>o===""?` ${Af(i)}`:` ${Af(i)}="${WU(o)}"`).join("");return e.type==="self_closing"?`<${Af(t)}${n} />`:`<${Af(t)}${n}>`}function pke(e,t){if(!e||!e.includes("<")||!t||Object.keys(t).length===0)return!1;for(const n of GU(e))if((n.type==="tag_open"||n.type==="self_closing")&&ZU(n.tagName??"",t))return!0;return!1}function Rm(e,t="safe"){if(!e)return"";if(t==="escape")return Af(e);const n=fke(e),i=[],o=[],s=[];for(const r of n){if(r.type==="text"){s.length===0&&o.push(Af(r.content??""));continue}const a=Qw(r.tagName);if(!a)continue;if(qU(a,t)){r.type==="tag_open"?s.push(a):r.type==="tag_close"&&s[s.length-1]===a&&s.pop();continue}if(s.length>0)continue;if(t==="safe"&&u_(a,t)){o.push(hke(r));continue}if(r.type==="self_closing"){o.push(`<${a}${nR(iR(r.attrs??{},t,a))}>`);continue}if(r.type==="tag_open"){o.push(`<${a}${nR(iR(r.attrs??{},t,a))}>`),Gf.has(a)||i.push(a);continue}const l=i.lastIndexOf(a);if(l===-1)continue;for(;i.length>l+1;){const c=i.pop();c&&o.push(``)}const u=i.pop();u&&o.push(``)}for(;i.length>0;){const r=i.pop();r&&o.push(``)}return o.join("")}const mke=[/javascript:/i,/vbscript:/i,/data:text\/html/i,/expression\s*\(/i,/@import/i],oR="http://www.w3.org/2000/svg",gke=new Set(["script","style","iframe","object","embed","link","meta"]),vke=new Set(["svg","style","g","a","defs","marker","path","rect","circle","ellipse","line","polyline","polygon","text","tspan","title","desc","use","image","lineargradient","radialgradient","stop","clippath","mask","pattern"]),yke=new Set(["href","xlink:href","src","srcdoc","action","data","formaction","poster"]),kke=new Set(["clip-path","fill","filter","marker-end","marker-mid","marker-start","mask","stroke"]),bke=new Set(["circle","ellipse","image","line","path","polygon","polyline","rect","text","tspan","use"]);function wke(e){return(e.getAttribute("href")||e.getAttribute("xlink:href"))?.startsWith("#")===!0}function Ake(e){return!!(e.getAttribute("href")||e.getAttribute("xlink:href")||e.getAttribute("src"))}function Cke(e){const t=e.nodeName.toLowerCase();return t==="use"?wke(e):t==="image"?Ake(e):t==="text"||t==="tspan"?!!e.textContent?.trim():bke.has(t)}function xke(e){return e.replace(/(["'])\s*javascript:/gi,"$1#").replace(/\bjavascript:/gi,"#").replace(/(["'])\s*vbscript:/gi,"$1#").replace(/\bvbscript:/gi,"#").replace(/\bdata:text\/html/gi,"#")}function Ske(e,t,n){const i=e.toLowerCase(),o=t.toLowerCase(),s=String(n??"").trim();return s?(i==="use"||i==="marker"||i==="clippath"||i==="mask")&&(o==="href"||o==="xlink:href")?s.startsWith("#")?s:"":i==="a"&&(o==="href"||o==="xlink:href")?Tp(s,{tagName:"a",attrName:"href"})?"":s:i==="image"&&(o==="href"||o==="xlink:href"||o==="src")?Tp(s,{tagName:"img",attrName:"src"})?"":s:o==="href"||o==="xlink:href"?s.startsWith("#")?s:"":Tp(s,{tagName:i,attrName:o})?"":s:""}function _ke(e,t){let n=t+4;for(;n{const i=n.trim();if(/^[0-9a-f]+$/i.test(i)){const o=Number.parseInt(i,16);try{return Number.isFinite(o)?String.fromCodePoint(o):""}catch{return""}}return String(n).trim()})}function YU(e){const t=QU(e),n=t.toLowerCase();let i=0;for(;in.test(t))||YU(t)}function Ike(e){if(e.tagName.toLowerCase()!=="a"||e.getAttribute("target")?.trim().toLowerCase()!=="_blank")return;const t=new Set(String(e.getAttribute("rel")??"").split(/\s+/).map(n=>n.trim()).filter(Boolean).filter(n=>n.toLowerCase()!=="opener"));t.add("noopener"),t.add("noreferrer"),e.setAttribute("rel",Array.from(t).join(" "))}function w9(e){const t=Number.parseFloat(String(e??""));return Number.isFinite(t)?t:0}function JU(e,t){if(e.nodeType===Node.TEXT_NODE){const o=e.textContent??"";o&&t.push(o);return}if(e.nodeType!==Node.ELEMENT_NODE)return;const n=e,i=n.tagName.toLowerCase();if(!gke.has(i)){if(i==="br"){t.push(` +`);return}for(const o of Array.from(n.childNodes))JU(o,t)}}function Mke(e){for(const t of Array.from(e.querySelectorAll("foreignObject"))){const n=[];JU(t,n);const i=n.join("").split(/\r?\n/).map(c=>c.trim()).filter(Boolean);if(!i.length){t.remove();continue}const o=w9(t.getAttribute("width")),s=w9(t.getAttribute("height")),r=w9(t.getAttribute("x")),a=w9(t.getAttribute("y")),l=e.ownerDocument.createElementNS(oR,"text");l.setAttribute("x",String(r+o/2)),l.setAttribute("y",String(a+s/2)),l.setAttribute("text-anchor","middle"),l.setAttribute("dominant-baseline","central");const u=t.querySelector(".nodeLabel");if(u?.getAttribute("class")&&l.setAttribute("class",u.getAttribute("class")),i.length===1)l.textContent=i[0];else{const c=-.6*(i.length-1);for(const[d,f]of i.entries()){const h=e.ownerDocument.createElementNS(oR,"tspan");h.setAttribute("x",String(r+o/2)),h.setAttribute("dy",d===0?`${c}em`:"1.2em"),h.textContent=f,l.appendChild(h)}}t.parentNode?.replaceChild(l,t)}}function Tke(e){Mke(e);const t=[e,...Array.from(e.querySelectorAll("*"))];for(const n of t){const i=n.tagName.toLowerCase();if(!vke.has(i)){n.remove();continue}if(i==="style"&&sR(n.textContent??"")){n.remove();continue}const o=Array.from(n.attributes);for(const s of o){const r=s.name.toLowerCase();if(/^on/i.test(r)){n.removeAttribute(s.name);continue}if(r==="style"&&s.value&&sR(s.value)){n.removeAttribute(s.name);continue}if(r==="srcdoc"){n.removeAttribute(s.name);continue}if(yke.has(r)&&s.value){const a=Ske(i,r,s.value);if(!a){n.removeAttribute(s.name);continue}a!==s.value&&n.setAttribute(s.name,a);continue}if(kke.has(r)&&s.value&&YU(s.value)){n.removeAttribute(s.name);continue}if(s.value){const a=xke(s.value);a!==s.value&&n.setAttribute(s.name,a)}}Ike(n)}}function QCt(e){if(typeof DOMParser>"u"||!e)return null;try{const t=new DOMParser().parseFromString(e,"image/svg+xml").documentElement;if(!t||t.nodeName.toLowerCase()!=="svg")return null;const n=t;return Tke(n),Eke(n)?null:n}catch{return null}}function Eke(e){const t=e.getAttribute("viewBox");if(t){const o=t.trim().split(/[\s,]+/);if(o.length===4){const s=Number.parseFloat(o[2]||""),r=Number.parseFloat(o[3]||"");if(!Number.isFinite(s)||!Number.isFinite(r)||s<=0||r<=0)return!0}}const n=[e,...Array.from(e.querySelectorAll("*"))];let i=!1;for(const o of n){Cke(o)&&(i=!0);for(const s of Array.from(o.attributes))if(/\bNaN\b/i.test(s.value)||s.name==="style"&&/max-width:\s*0(?:px)?/i.test(s.value))return!0}return!i}const A9=[];function _5(e){return String(e??"").replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function Lke(e){return(String(e||"text").trim().split(/\s+/)[0]||"text").replace(/[^\w+.#:-]/g,"-").replace(/-+/g,"-")||"text"}function Nke(e){return e.replace(/[^\w:.+-]/g,"-").replace(/-+/g,"-")}function rR(e=`editor-${Date.now()}`,t={}){const n=f2e(t),i=n;i.__markstreamRegisteredPluginCount=A9.length,i.__markstreamHasCustomParserExtensions=!!(t.plugin?.length||t.apply?.length||A9.length);const o={"common.copy":"Copy"};let s;if(typeof t.i18n=="function")s=t.i18n;else if(t.i18n&&typeof t.i18n=="object"){const h=t.i18n;s=m=>h[m]??o[m]??m}else s=h=>o[h]??h;if(Array.isArray(t.plugin))for(const h of t.plugin){const m=h;if(Array.isArray(m)){const[g,...y]=m;typeof g=="function"&&n.use(g,...y)}else typeof m=="function"&&n.use(m)}if(Array.isArray(t.apply))for(const h of t.apply)try{h(n)}catch(m){console.error("[getMarkdown] apply function threw an error",m)}if(A9.length)for(const h of A9)if(Array.isArray(h)){const[m,...g]=h;typeof m=="function"&&n.use(m,...g)}else typeof h=="function"&&n.use(h);n.use(oke),n.use(Nhe),n.use(The);const r=Uhe,a=r.default??r;n.use(a),n.use(Mhe),n.use(Ihe),n.core.ruler.after("block","mark_fence_closed",h=>{const m=h,g=m.src,y=!!m.env?.__markstreamFinal,b=g.split(/\r?\n/);for(const v of m.tokens){if(v.type!=="fence"||!v.map||!v.markup)continue;const w=v.map[0],A=v.map[1],M=v.markup,L=M[0],E=M.length,C=b[Math.max(0,A-1)]??"";let x=0;for(;xw+1&&_>=E&&F===C.length,D=v;D.meta=D.meta??{},D.meta.unclosed=!I,D.meta.closed=!!I}}),n.renderer.rules.fence=(h,m)=>{const g=h[m],y=String(g.info??"").trim(),b=String(g.content??""),v=btoa(unescape(encodeURIComponent(b))),w=Lke(y),A=_5(w),M=Nke(`editor-${e}-${m}-${w}`),L=_5(s("common.copy"));return`
      +
      + ${_5(w.toUpperCase())} + +
      +
      +
      `};const l=/^\[(\d+)\]/,u=/^\[([^\]\n]+)\]/,c=h=>{if(!h.startsWith("["))return!1;const m=u.exec(h);if(!m)return h!=="["&&!/^\[\d+$/.test(h);const g=String(m[1]??"");return h.slice(m[0].length).startsWith("(")?!1:!/^\d+$/.test(g)},d=(h,m)=>{const g=h;if(g.src[g.pos]!=="[")return!1;const y=l.exec(g.src.slice(g.pos));if(!y)return!1;const b=g.src.slice(Math.max(0,g.pos-120),g.pos);if(/"[^"\n]{1,80}"\s*:\s*$/.test(b))return!1;const v=g.src.slice(g.pos+y[0].length);if(v.startsWith("](")||v.startsWith("(")||c(v))return!1;if(!m){const w=y[1],A=g.push("reference","span",0);A.content=w,A.markup=y[0],A.raw=y[0]}return g.pos+=y[0].length,!0};n.inline.ruler.before("escape","reference",d),n.renderer.rules.reference=(h,m)=>{const y=String(h[m].content??"");return`${y}`};const f=n.use.bind(n);return n.use=((...h)=>(i.__markstreamHasCustomParserExtensions=!0,f(...h))),n}const Fke="modulepreload",Rke=function(e){return"/"+e},aR={},ts=function(t,n,i){let o=Promise.resolve();if(n&&n.length>0){let r=function(u){return Promise.all(u.map(c=>Promise.resolve(c).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),l=a?.nonce||a?.getAttribute("nonce");o=r(n.map(u=>{if(u=Rke(u),u in aR)return;aR[u]=!0;const c=u.endsWith(".css"),d=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${d}`))return;const f=document.createElement("link");if(f.rel=c?"stylesheet":Fke,c||(f.as="script"),f.crossOrigin="",f.href=u,l&&f.setAttribute("nonce",l),document.head.appendChild(f),c)return new Promise((h,m)=>{f.addEventListener("load",h),f.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${u}`)))})}))}function s(r){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=r,window.dispatchEvent(a),!a.defaultPrevented)throw r}return o.then(r=>{for(const a of r||[])a.status==="rejected"&&s(a.reason);return t().catch(s)})};function Dke({nextContent:e,previousContent:t,typewriterEnabled:n}){return n?e===t?{settledContent:e,streamedDelta:"",appended:!1}:t&&e.startsWith(t)&&e.length>t.length?{settledContent:t,streamedDelta:e.slice(t.length),appended:!0}:{settledContent:e,streamedDelta:"",appended:!1}:{settledContent:e,streamedDelta:"",appended:!1}}function XU({nextContent:e,persistedContent:t,currentState:n,typewriterEnabled:i,streamRenderVersionChanged:o=!1}){const s=`${n.settledContent}${n.streamedDelta}`;return i?n.streamedDelta&&s===e?o?{settledContent:s,streamedDelta:"",appended:!1}:{settledContent:n.settledContent,streamedDelta:n.streamedDelta,appended:!1}:Dke({nextContent:e,previousContent:t??s,typewriterEnabled:i}):{settledContent:e,streamedDelta:"",appended:!1}}const Oke={plain:"plaintext",text:"plaintext",txt:"plaintext",js:"javascript",mjs:"javascript",cjs:"javascript",ts:"typescript",mts:"typescript",cts:"typescript",golang:"go",py:"python",rb:"ruby",rs:"rust",kt:"kotlin",kts:"kotlin",md:"markdown",yml:"yaml",sh:"shellscript",bash:"shellscript",zsh:"shellscript",shell:"shellscript",shellscript:"shellscript",ps:"powershell",ps1:"powershell",pwsh:"powershell","c++":"cpp","c#":"csharp",cs:"csharp",objc:"objective-c",objectivec:"objective-c","objective-c":"objective-c",objectivecpp:"objective-cpp","objective-c++":"objective-cpp","objective-cpp":"objective-cpp"};function Pke(e){var t,n;const i=String(e??"").trim();if(!i)return"";const[o=""]=i.split(/\s+/);return(t=(n=o.split(":")[0])===null||n===void 0?void 0:n.trim().toLowerCase())!==null&&t!==void 0?t:""}function eV(e){var t;const n=Pke(e);return(t=Oke[n])!==null&&t!==void 0?t:n}function Bke(e){if(!Array.isArray(e))return;const t=e.filter(i=>typeof i=="string").map(i=>eV(i)).filter(Boolean),n=Array.from(new Set(t)).sort();return n.length>0?n:void 0}function $ke(e){if(!Array.isArray(e))return;const t=[],n=new Set;for(const i of e){if(typeof i!="string")continue;const o=i.trim();!o||n.has(o)||(n.add(o),t.push(o))}return t.length>0?t:void 0}function zke(e){var t,n;return(t=(n=$ke(e))===null||n===void 0?void 0:n.join("\0"))!==null&&t!==void 0?t:""}function jke(e,t){var n,i;return`${zke(e)}\0\0${(n=(i=Bke(t))===null||i===void 0?void 0:i.join("\0"))!==null&&n!==void 0?n:""}`}function R1(e,t,n=1){const i=Number(e);return Number.isFinite(i)?Math.max(n,i):t}function lR(e,t){const n=Number(e);return Number.isFinite(n)?Math.max(0,n):t}var Hke=class{constructor(e={},t){this.source="",this.visible="",this.done=!1,this.paused=!1,this.listeners=new Set,this.rafId=0,this.startedAt=0,this.lastTick=0,this.charBudget=0,this.hasStarted=!1,this.destroyed=!1,this.fenceScanOffset=0,this.fenceLineStart=0,this.fenceLineState="candidate",this.fenceIndent=0,this.fenceMarker="",this.fenceMarkerLength=0,this.activeFenceMarker="",this.activeFenceLength=0,this.blockedRevealEnd=0,this.atomicRevealRanges=[],this.atomicRevealRangeIndex=0,this.getSnapshot=()=>({source:this.source,visible:this.visible,done:this.done,paused:this.paused,pendingChars:this.pendingChars,caughtUp:this.caughtUp,final:this.final}),this.subscribe=d=>this.destroyed?()=>{}:(this.listeners.add(d),()=>{this.listeners.delete(d)}),this.enqueue=d=>{if(this.destroyed||!d)return;this.done&&(this.done=!1);const f=this.source.length>0,h=this.pendingChars<=0,m=this.isRevealBlocked();if(this.source+=d,this.scanAppendedSource(),h||m&&!this.isRevealBlocked()){const g=cR();this.startedAt=f&&this.hasStarted?g-this.normalizedStartDelayMs:g,this.lastTick=g,this.charBudget=0}this.hasStarted=!0,this.emit(),this.ensureLoop()},this.finish=(d={})=>{var f;if(!this.destroyed){if(this.done=!0,this.releaseTrailingFenceCandidate(),(f=d.flush)!==null&&f!==void 0?f:this.flushOnFinish){this.visible=this.source,this.discardConsumedAtomicRanges(),this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.cancelLoop(),this.emit();return}this.emit(),this.ensureLoop()}},this.flush=()=>{this.destroyed||(this.releaseTrailingFenceCandidate(),this.visible=this.source,this.discardConsumedAtomicRanges(),this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.cancelLoop(),this.emit())},this.reset=(d="")=>{this.destroyed||(this.cancelLoop(),d.startsWith(this.source)?(this.source=d,this.scanAppendedSource()):(this.resetFenceScanner(),this.source=d,this.scanAppendedSource()),this.visible=this.source.slice(0,this.getRevealableEnd()),this.discardConsumedAtomicRanges(),this.done=!1,this.paused=!1,this.hasStarted=!1,this.startedAt=0,this.lastTick=0,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.emit())},this.pause=()=>{this.destroyed||this.paused||(this.paused=!0,this.cancelLoop(),this.emit())},this.resume=()=>{if(this.destroyed||!this.paused)return;this.paused=!1;const d=cR();this.lastTick=d,this.startedAt||(this.startedAt=d),this.emit(),this.ensureLoop()},this.destroy=()=>{this.destroyed||(this.destroyed=!0,this.cancelLoop(),this.listeners.clear())},this.dispose=()=>{this.destroy()},this.tick=d=>{if(this.rafId=0,this.destroyed||this.paused)return;if(!this.hasRevealableChars()){this.startedAt=0,this.lastTick=0,this.charBudget=0,this.currentCps=this.minCharsPerSecond;return}if(d-this.startedAtthis.normalizedCatchUpThreshold?this.normalizedCatchUpLatencyMs:this.normalizedTargetLatencyMs,y=Uke(m/Math.max(.001,g/1e3),this.minCharsPerSecond,this.maxCharsPerSecond);if(this.currentCps+=(y-this.currentCps)*.2,this.charBudget+=this.currentCps*(h/1e3),this.charBudget<1){this.ensureLoop();return}const b=Math.min(Math.floor(this.charBudget),this.maxCharsPerCommit),v=this.takeNextRevealSlice(b);v.text&&(this.visible+=v.text,this.charBudget=Math.max(0,this.charBudget-v.graphemeCount),this.emit()),this.ensureLoop()};const{minCharsPerSecond:n=40,maxCharsPerSecond:i=1e3,targetLatencyMs:o=900,catchUpLatencyMs:s=350,catchUpThreshold:r=600,maxCommitFps:a=30,startDelayMs:l=80,maxCharsPerCommit:u=80,flushOnFinish:c=!1}=e;this.minCharsPerSecond=R1(n,40,1),this.maxCharsPerSecond=Math.max(this.minCharsPerSecond,R1(i,1e3,1)),this.normalizedTargetLatencyMs=R1(o,900,1),this.normalizedCatchUpLatencyMs=R1(s,350,1),this.normalizedCatchUpThreshold=lR(r,600),this.normalizedStartDelayMs=lR(l,80),this.maxCommitFps=Math.trunc(R1(a,30,1)),this.maxCharsPerCommit=Math.trunc(R1(u,80,1)),this.flushOnFinish=c,this.segmenter=qke(),t&&this.listeners.add(t),this.currentCps=this.minCharsPerSecond}get pendingChars(){return Math.max(0,this.source.length-this.visible.length)}get caughtUp(){return this.pendingChars===0}get final(){return this.done&&this.caughtUp}resetFenceScanner(){this.fenceScanOffset=0,this.fenceLineStart=0,this.fenceLineState="candidate",this.fenceIndent=0,this.fenceMarker="",this.fenceMarkerLength=0,this.activeFenceMarker="",this.activeFenceLength=0,this.blockedRevealEnd=0,this.atomicRevealRanges.length=0,this.atomicRevealRangeIndex=0}scanAppendedSource(e=!1){for(;this.fenceScanOffset=this.source.length&&!e)break;if(this.source[this.fenceScanOffset+1]===` +`){const n=this.fenceScanOffset+2;this.completeFenceLine(n),this.fenceScanOffset=n;continue}}if(t===` +`){const n=this.fenceScanOffset+1;this.completeFenceLine(n),this.fenceScanOffset=n;continue}this.consumeFenceCharacter(t),this.fenceScanOffset++}this.updateFenceRevealBlock()}consumeFenceCharacter(e){if(this.fenceLineState!=="normal"){if(this.fenceLineState==="opening"){this.fenceMarker==="`"&&e==="`"&&(this.fenceLineState="normal");return}if(this.fenceLineState==="closing"){e!==" "&&e!==" "&&(this.fenceLineState="normal");return}if(!this.fenceMarker){if(e===" "&&this.fenceIndent<3){this.fenceIndent++;return}if(e==="`"||e==="~"){this.fenceMarker=e,this.fenceMarkerLength=1;return}this.fenceLineState="normal";return}if(e===this.fenceMarker){this.fenceMarkerLength++;return}if(this.activeFenceMarker){this.fenceLineState=this.fenceMarker===this.activeFenceMarker&&this.fenceMarkerLength>=this.activeFenceLength&&(e===" "||e===" ")?"closing":"normal";return}this.fenceLineState=this.fenceMarkerLength>=3?"opening":"normal"}}completeFenceLine(e){const t=this.fenceLineState==="candidate"&&this.fenceMarkerLength>=3;!this.activeFenceMarker&&(this.fenceLineState==="opening"||t)?(this.atomicRevealRanges.push({start:this.fenceLineStart,end:e}),this.activeFenceMarker=this.fenceMarker,this.activeFenceLength=this.fenceMarkerLength):this.activeFenceMarker&&this.fenceMarker===this.activeFenceMarker&&this.fenceMarkerLength>=this.activeFenceLength&&(this.fenceLineState==="closing"||t)&&(this.activeFenceMarker="",this.activeFenceLength=0),this.fenceLineStart=e,this.fenceLineState="candidate",this.fenceIndent=0,this.fenceMarker="",this.fenceMarkerLength=0,this.blockedRevealEnd=0}updateFenceRevealBlock(){this.blockedRevealEnd=!this.activeFenceMarker&&(this.fenceLineState==="opening"||this.fenceLineState==="candidate"&&(this.fenceIndent>0||this.fenceMarkerLength>0))?this.fenceLineStart+1:0}releaseTrailingFenceCandidate(){this.scanAppendedSource(!0),this.blockedRevealEnd&&((this.fenceLineState==="opening"||this.fenceLineState==="candidate"&&this.fenceMarkerLength>=3)&&this.source.length>this.fenceLineStart&&this.atomicRevealRanges.push({start:this.fenceLineStart,end:this.source.length}),this.fenceLineState="normal",this.blockedRevealEnd=0)}isRevealBlocked(){return this.blockedRevealEnd!==0}getRevealableEnd(){return this.blockedRevealEnd?Math.min(this.source.length,this.blockedRevealEnd-1):this.source.length}hasRevealableChars(){return this.visible.length=t)return{text:"",graphemeCount:0};const n=this.atomicRevealRanges[this.atomicRevealRangeIndex];if(n&&this.visible.length>=n.start&&this.visible.lengththis.visible.length?Math.min(n.start,t):t;return uR(this.source,this.visible.length,e,this.segmenter,i)}discardConsumedAtomicRanges(){for(;this.atomicRevealRangeIndex=64&&this.atomicRevealRangeIndex*2>=this.atomicRevealRanges.length&&(this.atomicRevealRanges.splice(0,this.atomicRevealRangeIndex),this.atomicRevealRangeIndex=0)}ensureLoop(){if(!(this.destroyed||this.rafId||this.paused||!this.hasRevealableChars())){if(typeof requestAnimationFrame!="function"){this.flush();return}this.rafId=requestAnimationFrame(this.tick)}}cancelLoop(){this.rafId&&(typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(this.rafId),this.rafId=0)}emit(){if(!this.destroyed)for(const e of this.listeners)e()}};function Wke(e={},t){const n=new Hke(e,t);return{getSnapshot:n.getSnapshot,subscribe:n.subscribe,enqueue:n.enqueue,finish:n.finish,flush:n.flush,reset:n.reset,pause:n.pause,resume:n.resume,destroy:n.destroy,dispose:n.dispose}}function qke(){if(typeof Intl>"u")return null;const e=Intl.Segmenter;return e?new e(void 0,{granularity:"grapheme"}):null}function uR(e,t,n,i,o=e.length){const s=Math.min(e.length,Math.max(t,o));if(t>=s||n<=0)return{text:"",graphemeCount:0};if(!i){let l=t,u=0;for(;l=55296&&c<=56319&&d>=56320&&d<=57343?2:1;l=Math.min(s,l+f),u++}return{text:e.slice(t,l),graphemeCount:u}}const r=s-t;let a=Math.min(r,Math.max(64,n*2));for(;;){const l=a>=r,u=e.slice(t,t+a);let c=0,d=0;for(const f of i.segment(u)){if(d>=n)return{text:e.slice(t,t+c),graphemeCount:d};c+=f.segment.length,d++}if(l)return{text:e.slice(t,t+c),graphemeCount:d};a=Math.min(r,a*2)}}function cR(){return typeof performance<"u"?performance.now():Date.now()}function Uke(e,t,n){return Math.min(n,Math.max(t,e))}var Vke=(e,t,n)=>new Promise((i,o)=>{var s=l=>{try{a(n.next(l))}catch(u){o(u)}},r=l=>{try{a(n.throw(l))}catch(u){o(u)}},a=l=>l.done?i(l.value):Promise.resolve(l.value).then(s,r);a((n=n.apply(e,t)).next())});const U6=Symbol.for("markstream-vue:node-lifecycle");function YCt(){}const d_=new Map;let tV="material";const lm=new Map,dR=new Map;let V6=null;function Kke(e){d_.set(e.id,e)}function Zke(e){const t=d_.get(tV);if(!t)return;const n=t.core[e];if(n)return n;const i=lm.get(t.id);if(i){const o=i[e];if(o)return o}t.loadExtended&&!lm.has(t.id)&&Qke(t)}function Gke(){var e,t;return(t=(e=d_.get(tV))==null?void 0:e.fallback)!=null?t:""}function Qke(e){return Vke(this,null,function*(){var t,n,i;if(lm.has(e.id))return(t=lm.get(e.id))!=null?t:null;let o=dR.get(e.id);return o||(o=((i=(n=e.loadExtended)==null?void 0:n.call(e))!=null?i:Promise.resolve(null)).then(s=>(lm.set(e.id,s),V6?.(),s)).catch(()=>(lm.set(e.id,null),null)),dR.set(e.id,o)),o})}const fR='',hR='',Yke={id:"material",core:{"":hR,plain:'',text:hR,javascript:'',typescript:'',jsx:'',tsx:'',html:'',css:'',scss:'',json:'',python:'',ruby:'',go:'',java:'',kotlin:'',c:'',cpp:'',cs:fR,csharp:fR,php:'',shell:'',powershell:'',sql:'',yaml:'',markdown:'',xml:'',rust:'',vue:'',mermaid:''},fallback:'',loadExtended:()=>ts(()=>import("./extended-p72mFE2C.js"),[]).then(e=>e.materialExtendedMap)},Jke=au(0);V6=()=>{Jke.value++},Kke(Yke);const Xke={"":"",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"};function Yw(e){var t;const n=(function(i){if(!i)return"";const o=i.trim();if(!o)return"";const[s]=o.split(/\s+/),[r]=s.split(":");return r.toLowerCase()})(e);return(t=Xke[n])!=null?t:n}function JCt(e){const t=Yw(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";case"objectivec":return"objective-c";case"objectivecpp":return"objective-cpp";default:return t}}function XCt(e){return Zke(Yw(e))||Gke()}const pR={js:"JavaScript",javascript:"JavaScript",ts:"TypeScript",jsx:"JSX",tsx:"TSX",html:"HTML",css:"CSS",scss:"SCSS",json:"JSON",py:"Python",python:"Python",rb:"Ruby",go:"Go",java:"Java",c:"C",cpp:"C++",cs:"C#",csharp:"C#",php:"PHP",sh:"Shell",bash:"Bash",sql:"SQL",yaml:"YAML",md:"Markdown",d2:"D2",d2lang:"D2","":"Plain Text",plain:"Plain Text"};var Jw=(e,t,n)=>new Promise((i,o)=>{var s=l=>{try{a(n.next(l))}catch(u){o(u)}},r=l=>{try{a(n.throw(l))}catch(u){o(u)}},a=l=>l.done?i(l.value):Promise.resolve(l.value).then(s,r);a((n=n.apply(e,t)).next())});let ra=null,pp=!1,mp=null,Xw=h_;function sy(e){var t;const n=(t=e?.default)!=null?t:e;return n&&typeof n.renderToString=="function"?n:null}function f_(){try{const e=globalThis;return sy(e?.katex)}catch{return null}}function h_(){return Jw(null,null,function*(){const e=f_();if(e)return e;const t=yield ts(()=>import("./katex-DnlPpQZa.js"),[]);try{yield ts(()=>import("./mhchem-DtR62fUK.js"),__vite__mapDeps([0,1]))}catch{}return sy(t)})}function nV(e){const t=Promise.resolve(e).then(n=>{var i;return mp===t&&n?(ra=(i=sy(n))!=null?i:n,ra):null}).catch(()=>null).finally(()=>{mp===t&&(mp=null)});return mp=t,pp=!0,t}function ebe(e){Xw=e,ra=null,pp=!1,mp=null}function tbe(e){ebe(h_)}function iV(){return typeof Xw=="function"}function e6t(){var e;const t=Xw;if(!t||t===h_)return null;if(ra)return ra;const n=f_();if(n)return ra=n,ra;if(pp)return null;try{const i=t();return i?typeof i?.then=="function"?(nV(i),null):(ra=(e=sy(i))!=null?e:i,ra):null}catch{return null}}function oV(){return Jw(this,null,function*(){var e;const t=f_();if(t)return ra=t,ra;if(ra)return ra;if(mp)return mp;if(pp)return null;const n=Xw;if(!n)return pp=!0,null;try{const i=n();if(typeof i?.then=="function")return nV(i);if(i)return ra=(e=sy(i))!=null?e:i,pp=!0,ra}catch{}return pp=!0,null})}function sV(e){return e?e.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}let Nk=null,Zh=null;const oa=new Map,md=new Map;let k2=5;const Lp=new Set;function Sv(){if(oa.size{const{id:n,html:i,error:o}=t.data,s=oa.get(n);if(s)if(oa.delete(n),clearTimeout(s.timeoutId),s.cleanup(),Sv(),o)s.aborted||s.reject(new Error(o));else{const{content:r,displayMode:a}=t.data;if(r){const l=`${a?"d":"i"}:${r}`;if(md.set(l,i),md.size>200){const u=md.keys().next().value;md.delete(u)}}s.aborted||s.resolve(i)}},Nk.onerror=t=>{console.error("[katexWorkerClient] Worker error:",t);for(const[n,i]of oa.entries())clearTimeout(i.timeoutId),i.cleanup(),i.aborted||i.reject(new Error(`Worker error: ${t.message}`));oa.clear(),nbe()}}function obe(e,t=!0,n=2e3,i){return Jw(this,null,function*(){performance.now();const o=sV(e);if(!iV()){const l=new Error("KaTeX rendering disabled");return l.name="KaTeXDisabled",l.code="KATEX_DISABLED",Promise.reject(l)}if(Zh)return Promise.reject(Zh);const s=`${t?"d":"i"}:${o}`,r=md.get(s);if(r)return Sv(),Promise.resolve(r);const a=Nk||(Zh=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),Zh.name="WorkerInitError",Zh.code="WORKER_INIT_ERROR",null);if(!a)return Promise.reject(Zh);if(oa.size>=k2){const l=new Error("Worker busy");return l.name="WorkerBusy",l.code="WORKER_BUSY",l.busy=!0,l.inFlight=oa.size,l.max=k2,Promise.reject(l)}return new Promise((l,u)=>{if(i?.aborted){const g=new Error("Aborted");return g.name="AbortError",void u(g)}const c=Math.random().toString(36).slice(2);let d=null;const f=globalThis.setTimeout(()=>{const g=oa.get(c);if(!g)return;oa.delete(c),g.cleanup();const y=new Error("Worker render timed out");y.name="WorkerTimeout",y.code="WORKER_TIMEOUT",g.aborted||g.reject(y),Sv()},n);d=()=>{const g=oa.get(c);if(!g||g.aborted)return;g.aborted=!0,g.cleanup();const y=new Error("Aborted");y.name="AbortError",u(y)},i&&i.addEventListener("abort",d,{once:!0});const h=l,m=u;oa.set(c,{resolve:g=>{h(g)},reject:g=>{m(g)},timeoutId:f,aborted:!1,cleanup:()=>{i&&d&&i.removeEventListener("abort",d),d=null}});try{a.postMessage({id:c,content:o,displayMode:t})}catch(g){const y=oa.get(c);oa.delete(c),clearTimeout(f),y?.cleanup(),y?.reject(g),Sv()}})})}function t6t(e,t=!0,n){const i=`${t?"d":"i"}:${sV(e)}`;if(md.set(i,n),md.size>200){const o=md.keys().next().value;md.delete(o)}}const sbe="WORKER_BUSY";function rbe(e=2e3,t){return oa.size{let o,s=!1,r=null,a=()=>{};const l=()=>{o&&globalThis.clearTimeout(o),Lp.delete(a),t&&r&&t.removeEventListener("abort",r),r=null};a=()=>{s||(s=!0,l(),n())},Lp.add(a),o=globalThis.setTimeout(()=>{if(s)return;s=!0,l();const u=new Error("Wait for worker slot timed out");u.name="WorkerBusyTimeout",u.code="WORKER_BUSY_TIMEOUT",i(u)},e),queueMicrotask(()=>Sv()),t&&(r=()=>{if(s)return;s=!0,l();const u=new Error("Aborted");u.name="AbortError",i(u)},t.aborted?r():t.addEventListener("abort",r,{once:!0}))})}const g0={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function n6t(e){return Jw(this,arguments,function*(t,n=!0,i={}){var o,s,r,a;if(!iV()){const g=new Error("KaTeX rendering disabled");throw g.name="KaTeXDisabled",g.code="KATEX_DISABLED",g}const l=(o=i.timeout)!=null?o:g0.timeout,u=(s=i.waitTimeout)!=null?s:g0.waitTimeout,c=(r=i.backoffMs)!=null?r:g0.backoffMs,d=(a=i.maxRetries)!=null?a:g0.maxRetries,f=Number.isFinite(d)?Math.max(0,Math.min(Math.floor(d),8)):g0.maxRetries,h=i.signal;let m=0;for(;;){if(h?.aborted){const g=new Error("Aborted");throw g.name="AbortError",g}try{return yield obe(t,n,l,h)}catch(g){if(g?.code!==sbe||m>=f)throw g;if(m++,yield rbe(u,h).catch(()=>{}),h?.aborted){const y=new Error("Aborted");throw y.name="AbortError",y}c>0&&(yield new Promise(y=>globalThis.setTimeout(y,c*m)))}}})}function um(e){const t=typeof e=="number"?e:Number.parseFloat(String(e??""));return Number.isFinite(t)&&t>0?t:null}function abe(e){var t;for(const n of e.split(/\r?\n/)){const i=n.trim();if(!i||i.startsWith("%%"))continue;const o=i.match(/^([A-Z][\w-]*)\b/i);return((t=o?.[1])==null?void 0:t.toLowerCase())||""}return""}function l4(e){const t=e.split(/\r?\n/).map(o=>o.trim()).filter(o=>o&&!o.startsWith("%%")),n=Math.max(1,t.length),i=abe(e);return i==="gantt"?220+28*n:i==="sequencediagram"?180+26*n:i==="classdiagram"||i==="statediagram"||i==="erdiagram"?180+24*n:i==="flowchart"||i==="graph"?170+28*n:200+22*n}function u4(e){const t=e.split(/\r?\n/).filter(n=>/^\s*-\s+/.test(n)).length;return t>=3?500:t>0?280+60*t:360}function rV(e,t=360,n=500){return n==null?Math.max(t,e):Math.min(Math.max(t,e),n)}function c4(e,t=360,n=500){return rV(e,t,n)}function d4(e,t=360,n=500){return rV(e,t,n)}var lbe=Object.defineProperty,ube=Object.defineProperties,cbe=Object.getOwnPropertyDescriptors,mR=Object.getOwnPropertySymbols,dbe=Object.prototype.hasOwnProperty,fbe=Object.prototype.propertyIsEnumerable,gR=(e,t,n)=>t in e?lbe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,aV=(e,t)=>{for(var n in t||(t={}))dbe.call(t,n)&&gR(e,n,t[n]);if(mR)for(var n of mR(t))fbe.call(t,n)&&gR(e,n,t[n]);return e},vR=(e,t,n)=>new Promise((i,o)=>{var s=l=>{try{a(n.next(l))}catch(u){o(u)}},r=l=>{try{a(n.throw(l))}catch(u){o(u)}},a=l=>l.done?i(l.value):Promise.resolve(l.value).then(s,r);a((n=n.apply(e,t)).next())});const f4=()=>ts(()=>import("./mermaid.core-mH2pk-lc.js").then(e=>e.bp),__vite__mapDeps([2,3]));let ed=null,cm=f4,q0=null,K6=!1,Z6=!1,U0=0;function hbe(e){cm=e,U0++,ed=null,q0=null,K6=!1,Z6=!1}function pbe(e){hbe(f4)}function yR(){return typeof cm=="function"}function kR(e){if(!e)return e;const t=e&&e.default?e.default:e;if(t&&(typeof t.render=="function"||typeof t.parse=="function"||typeof t.initialize=="function"))return t;if(t&&t.mermaidAPI&&(typeof t.mermaidAPI.render=="function"||typeof t.mermaidAPI.parse=="function")){const o=t.mermaidAPI;return n=aV({},t),i={render:o.render.bind(o),parse:o.parse?o.parse.bind(o):void 0,initialize:s=>typeof t.initialize=="function"?t.initialize(s):o.initialize?o.initialize(s):void 0},ube(n,cbe(i))}var n,i;return e.mermaid&&typeof e.mermaid.render=="function"?e.mermaid:t}function bR(e){if(e)try{const t=e?.initialize;e.initialize=n=>{const i=aV({suppressErrorRendering:!0},n||{});return typeof t=="function"?t.call(e,i):e?.mermaidAPI&&typeof e.mermaidAPI.initialize=="function"?e.mermaidAPI.initialize(i):void 0}}catch{}}function i6t(){return vR(this,null,function*(){if(ed)return ed;const e=(function(){try{const i=globalThis;return kR(i?.mermaid)}catch{return null}})();if(e)return ed=e,bR(ed),ed;const t=cm,n=U0;return t?t===f4&&K6?null:q0||(q0=vR(null,null,function*(){let i;try{i=yield t()}catch(o){if(t===f4)return n===U0&&t===cm&&(K6=!0,(function(s){Z6||(Z6=!0,console.warn('[markstream-vue] Optional dependency "mermaid" is not installed. Mermaid blocks will render as source.',s))})(o)),null;throw o}finally{n===U0&&t===cm&&(q0=null)}return n!==U0||t!==cm?null:i?(ed=kR(i),bR(ed),ed):null}),q0):null})}let rc=null,Gh=null;const _u=new Map,Qh=new Map;function I5(e){for(const t of _u.values())t.reject(e);_u.clear(),Qh.clear()}let wR=5,AR=!1;const mbe="WORKER_BUSY",CR="MERMAID_DISABLED";function gbe(e){if(rc&&rc!==e){const n=new Error("Worker replaced");n.code="WORKER_REPLACED",I5(n)}rc=e,Gh=null;const t=e;rc.onmessage=n=>{if(rc!==t)return;const{id:i,ok:o,result:s,error:r}=n.data,a=_u.get(i);a&&(o===!1||r?a.reject(new Error(r||"Unknown error")):a.resolve(s))},rc.onerror=n=>{var i,o;if(rc===t)if(_u.size!==0){try{AR?console.error("[mermaidWorkerClient] Worker error:",n?.message||n):(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker error:",n?.message||n)}catch{}I5(new Error(`Worker error: ${n.message}`))}else(i=console.debug)==null||i.call(console,"[mermaidWorkerClient] Worker error (no pending):",n?.message||n)},rc.onmessageerror=n=>{var i,o;if(rc===t)if(_u.size!==0){try{AR?console.error("[mermaidWorkerClient] Worker messageerror:",n):(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker messageerror:",n)}catch{}I5(new Error("Worker messageerror"))}else(i=console.debug)==null||i.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",n)}}function lV(e,t,n,i){if(!yR()){const r=new Error("Mermaid rendering disabled");return r.name="MermaidDisabled",r.code=CR,Promise.reject(r)}const o=`${e}\0${t.theme}\0${n}\0${t.code}`;let s=Qh.get(o);return s||(s=(function(r,a,l=1400){if(!yR()){const c=new Error("Mermaid rendering disabled");return c.name="MermaidDisabled",c.code=CR,Promise.reject(c)}if(Gh)return Promise.reject(Gh);const u=rc||(Gh=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),Gh.name="WorkerInitError",Gh.code="WORKER_INIT_ERROR",null);if(!u)return Promise.reject(Gh);if(_u.size>=wR){const c=new Error("Worker busy");return c.name="WorkerBusy",c.code=mbe,c.inFlight=_u.size,c.max=wR,Promise.reject(c)}return new Promise((c,d)=>{const f=Math.random().toString(36).slice(2);let h,m=!1;const g=()=>{m||(m=!0,h!=null&&globalThis.clearTimeout(h),_u.delete(f))},y={resolve:b=>{g(),c(b)},reject:b=>{g(),d(b)}};_u.set(f,y);try{u.postMessage({id:f,action:r,payload:a})}catch(b){return _u.delete(f),void d(b)}h=globalThis.setTimeout(()=>{const b=new Error("Worker call timed out");b.name="WorkerTimeout",b.code="WORKER_TIMEOUT";const v=_u.get(f);v&&v.reject(b)},l)})})(e,t,n),Qh.set(o,s),s.then(()=>{Qh.get(o)===s&&Qh.delete(o)},()=>{Qh.get(o)===s&&Qh.delete(o)})),(function(r,a){if(!a)return r;if(a.aborted){const l=new Error("Aborted");return l.name="AbortError",Promise.reject(l)}return new Promise((l,u)=>{let c=()=>{};const d=()=>a.removeEventListener("abort",c);c=()=>{d();const f=new Error("Aborted");f.name="AbortError",u(f)},a.addEventListener("abort",c,{once:!0}),r.then(f=>{d(),l(f)},f=>{d(),u(f)})})})(s,i)}function o6t(e,t,n=1400,i){return lV("canParse",{code:e,theme:t},n,i)}function s6t(e,t,n=1400,i){return lV("findPrefix",{code:e,theme:t},n,i)}var vbe=Object.defineProperty,ybe=Object.defineProperties,kbe=Object.getOwnPropertyDescriptors,xR=Object.getOwnPropertySymbols,bbe=Object.prototype.hasOwnProperty,wbe=Object.prototype.propertyIsEnumerable,SR=(e,t,n)=>t in e?vbe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Dt=(e,t)=>{for(var n in t||(t={}))bbe.call(t,n)&&SR(e,n,t[n]);if(xR)for(var n of xR(t))wbe.call(t,n)&&SR(e,n,t[n]);return e},Pn=(e,t)=>ybe(e,kbe(t)),ao=(e,t,n)=>new Promise((i,o)=>{var s=l=>{try{a(n.next(l))}catch(u){o(u)}},r=l=>{try{a(n.throw(l))}catch(u){o(u)}},a=l=>l.done?i(l.value):Promise.resolve(l.value).then(s,r);a((n=n.apply(e,t)).next())});const Abe="__global__",M5="__MARKSTREAM_VUE_CUSTOM_COMPONENTS_STORE__",G6=(()=>{const e=globalThis;if(e[M5])return e[M5];const t={scopedCustomComponents:{},revision:au(0)};return e[M5]=t,t})(),_R=G6.revision,Cbe=Symbol("markstreamCustomComponents"),xbe=new Set(["text","paragraph","heading","code_block","list","list_item","blockquote","table","table_row","table_cell","definition_list","definition_item","footnote","footnote_reference","footnote_anchor","admonition","hardbreak","link","image","thematic_break","math_inline","math_block","strong","emphasis","strikethrough","highlight","insert","subscript","superscript","emoji","checkbox","checkbox_input","inline_code","html_inline","html_block","reference","mermaid","infographic","d2","vmr_container"]);function ry(e){return xbe.has(String(e).trim().toLowerCase())}function Sbe(e){return e.trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase()}function T5(e={}){const t={};for(const[n,i]of Object.entries(e))if(i!=null){t[n]=i;for(const o of new Set([su(n),su(Sbe(n))]))!o||ry(o)||Object.prototype.hasOwnProperty.call(t,o)||(t[o]=i)}return t}function Ms(e){const t=en(Cbe,null);return O(()=>{var n;return _R.value,(function(i,o={}){return _R.value,Dt(Dt(Dt({},T5(G6.scopedCustomComponents[Abe]||{})),T5(o)),T5((function(s){return s&&G6.scopedCustomComponents[s]||{}})(i)))})(e?.(),(n=t?.value)!=null?n:{})})}const _be=["aria-label"],Ibe={key:0,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",class:"checkbox-icon checkbox-unchecked"},Mbe={key:1,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",class:"checkbox-icon checkbox-checked"},Ri=(e,t)=>{const n=e.__vccOpts||e;for(const[i,o]of t)n[i]=o;return n},pl=Ri(ot({__name:"CheckboxNode",props:{node:{}},setup:e=>(t,n)=>(k(),N("span",{class:"checkbox-node",role:"img","aria-label":e.node.checked?"checked":"unchecked"},[e.node.checked?(k(),N("svg",Mbe,[...n[1]||(n[1]=[S("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",fill:"currentColor"},null,-1),S("path",{d:"M9 12l2 2 4-4",stroke:"hsl(var(--ms-background))","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):(k(),N("svg",Ibe,[...n[0]||(n[0]=[S("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",stroke:"currentColor","stroke-width":"2"},null,-1)])]))],8,_be))}),[["__scopeId","data-v-be21ab83"]]);pl.install=e=>{e.component(pl.__name,pl)};const Tbe={class:"emoji-node"},Ba=Ri(ot({__name:"EmojiNode",props:{node:{}},setup:e=>(t,n)=>(k(),N("span",Tbe,z(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);Ba.install=e=>{e.component(Ba.__name,Ba)};const Ebe=["id"],Lbe=["title"],ml=Ri(ot({__name:"FootnoteReferenceNode",props:{node:{}},setup(e){const t=`#fnref--${e.node.id}`;function n(){if(typeof document>"u")return;const i=document.querySelector(t);i?i.scrollIntoView({behavior:"smooth"}):console.warn(`Element with href: ${t} not found`)}return(i,o)=>(k(),N("sup",{id:`fnref-${e.node.id}`,class:"footnote-reference",onClick:n},[S("span",{href:t,title:`查看脚注 ${e.node.id}`,class:"footnote-link cursor-pointer"},"["+z(e.node.id)+"]",9,Lbe)],8,Ebe))}}),[["__scopeId","data-v-c1463a29"]]);ml.install=e=>{e.component(ml.__name,ml)};const uV=(()=>{try{return!1}catch{}return!1})();function E5(e){uV&&console.warn(e)}function IR(e,t="safe",n){return c_(e,t,n)}function cV(e){return dke(e)}function L5(e){return e===!0?"":e===!1?"false":e==null?null:String(e)}function p_(e,t="safe"){const n=String(e.tag||e.type||"").trim(),i=Lk((o=e.attrs)?Array.isArray(o)?o.every(Array.isArray)?o.map(([r,a])=>[String(r),L5(a)]):o.filter(r=>r&&typeof r=="object"&&!Array.isArray(r)&&"name"in r).map(r=>[String(r.name),L5(r.value)]):Object.entries(o).map(([r,a])=>[r,L5(a)]):null,t,n);var o;if(!i)return;const s=cV(xv(i));return Object.keys(s).length>0?s:void 0}function MR(e,t,n=!1){const i=Object.entries(t??{}),o=i.length>0?i.map(([s,r])=>r===""?` ${s}`:` ${s}="${r}"`).join(""):"";return n?`<${e}${o} />`:`<${e}${o}>`}function v0(e,t){Array.isArray(t)?e.push(...t):t!=null&&e.push(t)}function N5(e,t,n,i,o,s,r=!1){const a=(function(d,f){return ZU(d,f)})(e,i);if(ny.has(e.toLowerCase())||!a&&qU(e,s))return null;if(!a&&u_(e,s))return r?[MR(e,t,!0)]:[MR(e,t),...n,``];const l=c_(t,s,e),u=l.key,c=u!=null&&u!==""?u:o;if(a){const d=i[e]||i[e.toLowerCase()],f=cV(l);return On(d,Pn(Dt({},f),{key:c}),n.length>0?n:void 0)}return On(e,Pn(Dt({},l),{innerHTML:void 0,key:c}),n.length>0?n:void 0)}function dV(e,t){return pke(e,t)}function h4(e,t,n="safe"){if(!e)return[];try{return(function(s,r,a="safe"){let l=0;const u=[],c=[];for(const d of s)if(d.type==="text")(u.length>0?u[u.length-1].children:c).push(d.content);else if(d.type==="self_closing"){const f=N5(d.tagName,d.attrs||{},[],r,"ms-html-"+l++,a,!0);v0(u.length>0?u[u.length-1].children:c,f)}else if(d.type==="tag_open")u.push({tagName:d.tagName,children:[],attrs:d.attrs,autoKey:"ms-html-"+l++});else if(d.type==="tag_close"){const f=d.tagName.toLowerCase();let h=-1;for(let m=u.length-1;m>=0;m--)if(u[m].tagName.toLowerCase()===f){h=m;break}if(h!==-1)for(;u.length>h;){const m=u.pop(),g=N5(m.tagName,m.attrs||{},m.children,r,m.autoKey,a);u.length>0?v0(u[u.length-1].children,g):v0(c,g),m.tagName.toLowerCase()!==f&&u.length>h&&E5(`Auto-closing unclosed tag: <${m.tagName}>`)}else E5(`Ignoring closing tag with no matching opening tag: `)}for(;u.length>0;){const d=u.pop(),f=N5(d.tagName,d.attrs||{},d.children,r,d.autoKey,a);u.length>0?v0(u[u.length-1].children,f):v0(c,f),E5(`Auto-closing unclosed tag: <${d.tagName}>`)}return c})(GU(e),t,n)}catch(o){return i=o,uV&&console.error("Failed to parse HTML to VNodes:",i),null}var i}const Nbe=["innerHTML"],gl=Ri(ot({__name:"HtmlInlineNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=en("markstreamHtmlPolicy",void 0),i=O(()=>{var a,l;return(l=(a=t.htmlPolicy)!=null?a:n?.value)!=null?l:"safe"}),o=Ms(()=>t.customId),s=ot({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),r=O(()=>{const a=t.node.content;if(!a)return{mode:"html",content:""};if(i.value==="escape")return{mode:"html",content:Rm(a,i.value)};if(t.node.loading&&!t.node.autoClosed)return{mode:"text",content:a};if(t.node.loading&&t.node.autoClosed){const u=h4(a,o.value,i.value);if(u!==null)return{mode:"dynamic",nodes:u}}if(!dV(a,o.value))return{mode:"html",content:Rm(a,i.value)};const l=h4(a,o.value,i.value);return l===null?{mode:"html",content:Rm(a,i.value)}:{mode:"dynamic",nodes:l}});return(a,l)=>r.value.mode==="dynamic"?(k(),N("span",{key:0,class:De(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},[G(p(s),{nodes:r.value.nodes},null,8,["nodes"])],2)):r.value.mode==="text"?(k(),N("span",{key:1,class:De(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},z(r.value.content),3)):(k(),N("span",{key:2,class:De(["html-inline-node",{"html-inline-node--loading":t.node.loading}]),innerHTML:r.value.content},null,10,Nbe))}}),[["__scopeId","data-v-d17f12b0"]]);gl.install=e=>{e.component(gl.__name,gl)};const Fbe={class:"inline-code"},Rbe={key:0},Hr=Ri(ot({__name:"InlineCodeNode",props:{node:{}},setup(e){const t=e,n=yg(),i=en("markstreamFade",void 0),o=en("markstreamTextStreamState",void 0),s=en("markstreamStreamVersion",void 0),r=O(()=>{const v=n.fade;return v===""||v===!0||v==="true"||v!==!1&&v!=="false"&&void 0}),a=O(()=>typeof r.value=="boolean"?r.value:typeof i?.value!="boolean"||i.value),l=O(()=>{var v;return String((v=t.node.code)!=null?v:"")}),u=O(()=>!a.value),c=O(()=>{var v;const w=(v=n["index-key"])!=null?v:n.indexKey;return w==null||w===""?"":String(w)}),d=q(t.node.code),f=q(""),h=q(0);let m;function g(){m?.(),m=void 0}function y(){g(),f.value&&(d.value=d.value+f.value,f.value="")}Be([()=>t.node.code,c,a],([v])=>{const w=String(v??""),A=c.value,M=XU({nextContent:w,persistedContent:A?o?.get(A):void 0,currentState:{settledContent:d.value,streamedDelta:f.value},typewriterEnabled:a.value});d.value=M.settledContent,f.value=M.streamedDelta,M.appended?(h.value+=1,(function(){if(!f.value||m||!s)return;const L=s.value;m=Be(()=>s.value,E=>{E!==L&&y()},{flush:"sync"})})()):f.value||g(),A&&o?.set(A,w)},{immediate:!0}),Fd(g);const b=O(()=>h.value%2==0?"inline-code-stream-delta--a":"inline-code-stream-delta--b");return(v,w)=>(k(),N("code",Fbe,[u.value?(k(),N(Ne,{key:0},[Pe(z(l.value),1)],64)):(k(),N(Ne,{key:1},[d.value?(k(),N("span",Rbe,z(d.value),1)):ne("",!0),f.value?(k(),N("span",{key:1,class:De(["inline-code-stream-delta",[b.value]]),onAnimationend:y},z(f.value),35)):ne("",!0)],64))]))}}),[["__scopeId","data-v-4e331c97"]]);Hr.install=e=>{e.component(Hr.__name,Hr)};const Q6=q(!1),TR=q(""),ER=q("top"),_v=q(null),Iv=q(null),Y6=q(null),J6=q(null),LR=q(null);let Fk=null,Rk=null,X6=0;function fV(){Fk&&(clearTimeout(Fk),Fk=null),Rk&&(clearTimeout(Rk),Rk=null)}let C9=!1,x9=null,NR=!1;function Dbe(e,t,n="top",i=!1,o,s){if(!e)return;const r=++X6;fV();const a=()=>ao(null,null,function*(){var l,u;if(yield(function(){return ao(this,null,function*(){if(!C9&&!NR&&typeof document<"u"){x9!=null||(x9=ao(null,null,function*(){const[{createApp:c,h:d},{default:f}]=yield Promise.all([ts(()=>import("./vue.runtime.esm-bundler-D_EBaNOx.js"),[]),ts(()=>import("./Tooltip-M0G64eNn.js"),[])]),h=document.createElement("div");h.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(h),c({setup:()=>()=>{var m;return d(f,{visible:Q6.value,"anchor-el":_v.value,content:TR.value,placement:ER.value,id:Iv.value,originX:Y6.value,originY:J6.value,isDark:(m=LR.value)!=null?m:void 0})}}).mount(h),C9=!0}));try{yield x9}catch(c){C9=!1,x9=null,NR=!0,console.warn("[markstream-vue] Failed to mount Tooltip component. Tooltips will be disabled.",c)}}})})(),C9&&r===X6){Iv.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,_v.value=e,TR.value=t,ER.value=n,Y6.value=(l=o?.x)!=null?l:null,J6.value=(u=o?.y)!=null?u:null,LR.value=typeof s=="boolean"?s:null,Q6.value=!0;try{e.setAttribute("aria-describedby",Iv.value)}catch{}}});i?a():Fk=setTimeout(a,80)}function Obe(e=!1){X6+=1,fV();const t=()=>{if(_v.value&&Iv.value)try{_v.value.removeAttribute("aria-describedby")}catch{}Q6.value=!1,_v.value=null,Iv.value=null,Y6.value=null,J6.value=null};e?t():Rk=setTimeout(t,120)}const Pbe={"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..."},Bbe=Symbol("markstreamI18nFallback");function hV(e,t){var n;return(n=t?.[e])!=null?n:Pbe[e]}const e7=(e,t)=>{var n;return(n=hV(e,t))!=null?n:(function(i){return(i.split(".").pop()||i).replace(/[_-]/g," ").replace(/([A-Z])/g," $1").replace(/\s+/g," ").replace(/\b\w/g,o=>o.toUpperCase()).trim()})(e)};function FR(e,t){return{t(n){const i=hV(n,t);if(e.te&&i!=null&&!e.te(n))return e7(n,t);const o=e.t(n);return o===n&&i!=null?e7(n,t):o}}}function $be(){const e=(function(){var n,i,o;try{const s=Is(),r=Bbe,a=s?.provides,l=(n=s?.appContext)==null?void 0:n.provides;return(o=(i=a?.[r])!=null?i:l?.[r])!=null?o:null}catch{}return null})(),t=(function(){var n,i;try{const o=Is(),s=o?.proxy,r=s?.$t;if(typeof r=="function"){const u=s?.$te;return{t:r.bind(s),te:typeof u=="function"?u.bind(s):void 0}}const a=(i=(n=o?.appContext)==null?void 0:n.config)==null?void 0:i.globalProperties,l=a?.$t;if(typeof l=="function"){const u=a?.$te;return{t:l.bind(a),te:typeof u=="function"?u.bind(a):void 0}}}catch{}return null})();if(t)return FR(t,e);try{const n=globalThis.$vueI18nUse||null;if(n&&typeof n=="function")try{const i=n();if(i&&typeof i.t=="function")return FR({t:i.t.bind(i),te:typeof i.te=="function"?i.te.bind(i):void 0},e)}catch{}}catch{}return{t:n=>e7(n,e)}}const pV=Symbol("ViewportPriority"),mV=Symbol("ViewportPriorityOptions"),gV=Symbol("OffscreenHeavyNodeDeferral"),zbe=O(()=>!1),Wp="400px";function m_(){return en(mV,void 0)}function g_(){return en(gV,zbe)}function jbe(e,t){var n,i;const o=typeof window<"u"&&typeof document<"u",s=typeof t=="boolean"?q(t):t,r=o?(n=window.requestIdleCallback)!=null?n:E=>window.setTimeout(()=>E({didTimeout:!0,timeRemaining:()=>0}),16):null,a=o?(i=window.cancelIdleCallback)!=null?i:E=>window.clearTimeout(E):null,l=new WeakMap;let u=1;const c=new Map,d=new Map,f=new Set;let h=null,m=null;function g(E){if(!E)return"viewport";let C=l.get(E);return C||(C=u++,l.set(E,C)),String(C)}function y(){if(h!=null){try{a?.(h)}catch{}h=null}}function b(E){if(E){const C=c.get(E);if(C&&!C.targets.size){try{C.io.disconnect()}catch{}c.delete(E)}}d.size||f.size||y()}function v(E){const C=d.get(E);if(!C)return;const x=c.get(C.bucketKey);if(!C.visible.value){C.visible.value=!0;try{C.resolve()}catch{}}try{x?.io.unobserve(E)}catch{}x?.targets.delete(E),d.delete(E),f.delete(E),b(C.bucketKey)}function w(){window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&r&&h==null&&f.size&&(h=r(()=>{h=null;const E=f.values().next().value;E&&(f.delete(E),v(E),f.size&&w())},{timeout:1200}))}function A(E,C){if(!o||typeof IntersectionObserver>"u")return null;const x=(function($,T){var R,P,j;return{root:(R=e?.($??null))!=null?R:null,rootMargin:(P=T?.rootMargin)!=null?P:Wp,threshold:(j=T?.threshold)!=null?j:0}})(E,C),_=[g((F=x).root),F.rootMargin,F.threshold].join("\0");var F;const I=c.get(_);if(I)return{key:_,bucket:I};let D;try{D=new IntersectionObserver($=>{for(const T of $)(T.isIntersecting||T.intersectionRatio>0)&&v(T.target)},{root:x.root,rootMargin:x.rootMargin,threshold:x.threshold})}catch{return null}const H={io:D,targets:new Map};return c.set(_,H),{key:_,bucket:H}}function M(){if(o&&s.value)for(const[E,C]of Array.from(d.entries())){const x=A(E,C.opts);if(!x){v(E);continue}if(x.key===C.bucketKey)continue;const _=C.bucketKey,F=c.get(_);try{F?.io.unobserve(E)}catch{}F?.targets.delete(E),C.bucketKey=x.key,x.bucket.targets.set(E,C),x.bucket.io.observe(E),b(_)}}Be(s,E=>{if(!E){for(const C of Array.from(d.keys()))v(C);y()}},{flush:"sync"});const L=(E,C)=>{const x=q(!1);let _,F=!1;const I=new Promise(T=>{_=()=>{F||(F=!0,T())}}),D=()=>{const T=d.get(E);if(!T)return f.delete(E),void b();const R=c.get(T.bucketKey);try{R?.io.unobserve(E)}catch{}R?.targets.delete(E),d.delete(E),f.delete(E),b(T.bucketKey)};if(!o||!s.value)return x.value=!0,_(),{isVisible:x,whenVisible:I,destroy:D};const H=A(E,C);if(!H)return x.value=!0,_(),{isVisible:x,whenVisible:I,destroy:D};const $={resolve:_,visible:x,bucketKey:H.key,opts:C};return d.set(E,$),H.bucket.targets.set(E,$),H.bucket.io.observe(E),o&&m==null&&(m=window.requestAnimationFrame(()=>{m=null,M()})),C?.allowIdle!==!1&&(f.add(E),w()),{isVisible:x,whenVisible:I,destroy:D}};return L.refresh=M,Qn(pV,L),L}function v_(){var e,t;const n=en(pV,void 0);if(n)return n;const i=new WeakMap,o=new Map,s=new Set;let r=null;const a=typeof window<"u"?(e=window.requestIdleCallback)!=null?e:h=>window.setTimeout(()=>h({didTimeout:!0,timeRemaining:()=>0}),16):null,l=typeof window<"u"?(t=window.cancelIdleCallback)!=null?t:h=>window.clearTimeout(h):null,u=()=>{if(r!=null){try{l?.(r)}catch{}r=null}},c=h=>{if(!h)return;const m=o.get(h);if(m&&!m.targets.size){try{m.io.disconnect()}catch{}o.delete(h)}},d=h=>{const m=i.get(h);if(!m)return;const g=o.get(m.bucketKey);if(!m.visible.value){m.visible.value=!0;try{m.resolve()}catch{}}try{g?.io.unobserve(h)}catch{}i.delete(h),g?.targets.delete(h),s.delete(h),c(m.bucketKey),s.size||u()},f=()=>{window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&a&&r==null&&s.size&&(r=a(()=>{r=null;const h=s.values().next().value;h&&(s.delete(h),d(h),s.size&&f())},{timeout:1200}))};return(h,m)=>{const g=q(!1);let y,b=!1;const v=new Promise(M=>{y=()=>{b||(b=!0,M())}}),w=()=>{const M=i.get(h);if(!M)return s.delete(h),void(s.size||u());const L=o.get(M.bucketKey);try{L?.io.unobserve(h)}catch{}i.delete(h),L?.targets.delete(h),s.delete(h),c(M.bucketKey),s.size||u()},A=(M=>{var L,E;if(typeof window>"u"||typeof IntersectionObserver>"u")return null;const C=(D=>{var H,$;return[(H=D?.rootMargin)!=null?H:Wp,($=D?.threshold)!=null?$:0].join("\0")})(M),x=o.get(C);if(x)return{key:C,bucket:x};const _=(L=M?.rootMargin)!=null?L:Wp;let F;try{F=new IntersectionObserver(D=>{for(const H of D)(H.isIntersecting||H.intersectionRatio>0)&&d(H.target)},{root:null,rootMargin:_,threshold:(E=M?.threshold)!=null?E:0})}catch{return null}const I={io:F,targets:new Set};return o.set(C,I),{key:C,bucket:I}})(m);return A?(i.set(h,{resolve:y,visible:g,bucketKey:A.key}),A.bucket.targets.add(h),A.bucket.io.observe(h),m?.allowIdle!==!1&&(s.add(h),f()),{isVisible:g,whenVisible:v,destroy:w}):(g.value=!0,y(),{isVisible:g,whenVisible:v,destroy:w})}}function Hbe(e,t){var n,i;const o=(i=(n=e.indexKey)!=null?n:t["index-key"])!=null?i:t.indexKey;return o==null||o===""?"":String(o)}const Wbe=["data-markstream-viewport-pending"],qbe=["src","alt","title","loading","fetchpriority","decoding","tabindex","aria-label"],Ube={key:1,class:"image-placeholder"},Vbe={key:1,class:"image-node__raw-text"},Kbe={key:2,class:"image-shimmer-overlay"},Zbe={key:1,class:"image-node__raw-text"},Gbe={key:3,class:"image-error"},Df=Ri(ot({__name:"ImageNode",props:{node:{},fallbackSrc:{default:""},lazy:{type:Boolean,default:!1},usePlaceholder:{type:Boolean,default:!0}},emits:["load","error","click"],setup(e,{emit:t}){var n,i,o;const s=e,r=t,a=q(!1),l=q(!1),u=q(""),c=q("primary"),d=q(null),f=yg(),h=en(U6,null),m=v_(),g=m_(),y=g_(),b=O(()=>eF(s.node.src)),v=O(()=>eF(s.fallbackSrc)),w=(o=(i=(n=Is())==null?void 0:n.vnode.el)==null?void 0:i.querySelector)==null?void 0:o.call(i,"img"),A=typeof window<"u"&&w?.getAttribute("src")===(b.value||v.value),M=q(typeof window>"u"||A||!y.value),L=au(null);let E="",C=null;const x=O(()=>u.value),_=O(()=>!s.lazy),F=O(()=>typeof window<"u"&&y.value&&!A),I=O(()=>!F.value||M.value),D=O(()=>I.value?x.value:""),H=O(()=>{var Z,ae;return(ae=(Z=g?.value.heavyBlockMargin)!=null?Z:g?.value.rootMargin)!=null?ae:Wp}),$=O(()=>!s.node.loading&&c.value!=="failed"&&u.value.length>0),T=O(()=>c.value==="failed"),R=O(()=>(!_.value||F.value&&!M.value)&&!a.value&&!l.value&&c.value!=="failed"&&u.value.length>0),P=O(()=>Hbe(s,f));function j(Z=P.value){Z&&d.value&&h?.reportHeight(Z,d.value.offsetHeight)}function B(Z=P.value){Z&&pt(()=>{j(Z)})}function K(){C&&(clearTimeout(C),C=null)}function X(){const Z=P.value;Z&&E!==Z&&(E&&h?.markSettled(E),K(),E=Z,h?.markPending(Z),typeof window<"u"&&(C=window.setTimeout(()=>{E===Z&&(B(Z),V())},8e3)))}function V(){return ao(this,null,function*(){const Z=E;Z&&(K(),E="",yield pt(),j(Z),h?.markSettled(Z))})}function Q(){if(c.value==="primary"&&v.value&&v.value!==u.value)return c.value="fallback",u.value=v.value,a.value=!1,l.value=!1,void B();c.value="failed",l.value=!0,r("error",u.value),B()}function ie(){a.value=!0,l.value=!1,r("load",x.value),B()}function ee(Z){Z.preventDefault(),a.value&&!l.value&&r("click",[Z,x.value])}const{t:Ce}=$be();return Be([b,v,()=>s.node.loading],()=>(a.value=!1,l.value=!1,s.node.loading||b.value?(u.value=b.value,void(c.value="primary")):v.value?(u.value=v.value,void(c.value="fallback")):(u.value="",c.value="failed",void(l.value=!0))),{immediate:!0}),typeof window<"u"&&Be([d,F],([Z,ae],he,J)=>{var te;if((te=L.value)==null||te.destroy(),L.value=null,!ae||M.value)return void(M.value=!0);if(!Z)return void(M.value=!1);let U=!0;const Y=m(Z,{rootMargin:H.value,allowIdle:!1});L.value=Y,M.value=Y.isVisible.value,Y.whenVisible.then(()=>{U&&L.value===Y&&(M.value=!0)}),J(()=>{U=!1,Y.destroy(),L.value===Y&&(L.value=null)})},{immediate:!0}),Be([$,a,l,x,()=>s.lazy,I],([Z,ae,he,J,te,U])=>Z&&J&&!he&&U?ae?(V(),void B()):te?(X(),void B()):void(ae||he||X()):(V(),void B()),{flush:"post",immediate:!0}),ii(()=>{var Z;(Z=L.value)==null||Z.destroy(),L.value=null,(function(){const ae=E;ae&&(K(),E="",h?.markSettled(ae))})()}),(Z,ae)=>{var he,J,te,U,Y;return k(),N("span",{ref_key:"rootRef",ref:d,class:"image-node-container","data-markstream-viewport-pending":F.value&&!M.value?"true":void 0},[$.value?(k(),N("img",{key:0,src:D.value||void 0,alt:String((J=(he=s.node.alt)!=null?he:s.node.title)!=null?J:""),title:String((U=(te=s.node.title)!=null?te:s.node.alt)!=null?U:""),class:De(["image-node__img",{"is-loading":!_.value&&!a.value,"is-loaded":_.value||a.value,"has-natural-size":a.value,"cursor-pointer":a.value}]),loading:s.lazy?"lazy":void 0,fetchpriority:_.value?"high":void 0,decoding:_.value?"sync":"async",tabindex:a.value?0:-1,"aria-label":(Y=s.node.alt)!=null?Y:p(Ce)("image.preview"),onError:Q,onLoad:ie,onClick:ee},null,42,qbe)):ne("",!0),e.node.loading&&!l.value?(k(),N("span",Ube,[s.usePlaceholder?Kn(Z.$slots,"placeholder",{key:0,node:s.node,displaySrc:x.value,imageLoaded:a.value,hasError:l.value,fallbackSrc:s.fallbackSrc,lazy:s.lazy},()=>[ae[0]||(ae[0]=S("span",{class:"image-shimmer"},null,-1))],!0):(k(),N("span",Vbe,z(e.node.raw),1))])):ne("",!0),R.value&&!e.node.loading?(k(),N("span",Kbe,[s.usePlaceholder?Kn(Z.$slots,"placeholder",{key:0,node:s.node,displaySrc:x.value,imageLoaded:a.value,hasError:l.value,fallbackSrc:s.fallbackSrc,lazy:s.lazy},()=>[ae[1]||(ae[1]=S("span",{class:"image-shimmer"},null,-1))],!0):(k(),N("span",Zbe,z(e.node.raw),1))])):ne("",!0),T.value?(k(),N("span",Gbe,[Kn(Z.$slots,"error",{node:s.node,displaySrc:x.value,imageLoaded:a.value,hasError:l.value,fallbackSrc:s.fallbackSrc,lazy:s.lazy},()=>[ae[2]||(ae[2]=S("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[S("path",{fill:"currentColor",d:"M2 2h20v10h-2V4H4v9.586l5-5L14.414 14L13 15.414l-4-4l-5 5V20h8v2H2zm13.547 5a1 1 0 1 0 0 2a1 1 0 0 0 0-2m-3 1a3 3 0 1 1 6 0a3 3 0 0 1-6 0m3.625 6.757L19 17.586l2.828-2.829l1.415 1.415L20.414 19l2.829 2.828l-1.415 1.415L19 20.414l-2.828 2.829l-1.415-1.415L17.586 19l-2.829-2.828z"})],-1)),S("span",null,z(p(Ce)("image.loadError")),1)],!0)])):ne("",!0)],8,Wbe)}}}),[["__scopeId","data-v-046e82ac"]]);Df.install=e=>{e.component(Df.__name,Df)};const Qbe={key:2},zc=ot({__name:"NodeChildRenderer",props:{node:{},components:{},customId:{},indexKey:{},fallbackToText:{type:Boolean,default:!1}},setup(e){const t=e,n=Ms(()=>t.customId),i=en("markstreamHtmlPolicy",void 0),o=en("markstreamNestedRendererProps",void 0),s=O(()=>{var m;return(m=i?.value)!=null?m:"safe"}),r=O(()=>{var m,g;const y=(m=o?.value)!=null?m:{};return Pn(Dt({},y),{customId:(g=t.customId)!=null?g:y.customId,htmlPolicy:s.value})}),a=Ac({loader:()=>Promise.resolve().then(()=>M_),suspensible:!1}),l=O(()=>t.components[String(t.node.type)]),u=O(()=>!!(l.value&&n.value[t.node.type]&&!ry(String(t.node.type)))),c=O(()=>u.value?p_(t.node,s.value):void 0),d=O(()=>Array.isArray(t.node.children)&&t.node.children.length>0),f=O(()=>{var m;return String((m=t.node.content)!=null?m:"")}),h=O(()=>{var m,g;return String((g=(m=t.node.content)!=null?m:t.node.raw)!=null?g:"")});return(m,g)=>l.value&&u.value?(k(),fe(zo(l.value),ci({key:0},c.value,{node:e.node,loading:e.node.loading,"index-key":e.indexKey,"custom-id":e.customId,"is-dark":r.value.isDark}),{default:de(()=>[d.value?(k(),fe(p(a),ci({key:0},r.value,{nodes:e.node.children,"index-key":e.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):f.value?(k(),fe(p(a),ci({key:1},r.value,{content:f.value,final:!e.node.loading,"index-key":`${e.indexKey||"child"}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ne("",!0)]),_:1},16,["node","loading","index-key","custom-id","is-dark"])):l.value?(k(),fe(zo(l.value),{key:1,node:e.node,"custom-id":e.customId,"index-key":e.indexKey},null,8,["node","custom-id","index-key"])):e.fallbackToText?(k(),N("span",Qbe,z(h.value),1)):ne("",!0)}}),RR=Object.freeze({enabled:!0,contextLineCount:2,minimumLineCount:4,revealLineCount:5});function Ybe(e){var t;if(typeof e=="boolean")return e;if(e&&typeof e=="object"){const n=e;return Pn(Dt(Dt({},RR),n),{enabled:(t=n.enabled)==null||t})}return Dt({},RR)}function y_(e,t){if(e.renderSideBySide===!1)return!0;if(e.useInlineViewWhenSpaceIsLimited!==!0)return!1;const n=e.renderSideBySideInlineBreakpoint,i=typeof n=="number"&&Number.isFinite(n)?n:900;return t>0&&t<=i}function vV(e){var t,n;const i=(n=(t=String(e??"").split(/\r?\n/,1)[0])==null?void 0:t.trim())!=null?n:"";if(i.length<3)return"";const o=i[0];if(o!=="`"&&o!=="~"||i[1]!==o||i[2]!==o)return"";let s=3;for(;i[s]===o;)s+=1;return i.slice(s).trim()}function DR(e){var t;return((t=String(e??"").trim().split(/\s+/,1)[0])!=null?t:"")==="diff"}function Jbe(e){var t;return e.diff===!0||DR(e.language)||DR(vV(String((t=e.raw)!=null?t:"")))}function Xbe(e,t,n){const i=(function(o){const s=vV(o);if(!s)return"";const r=s.split(/\s+/).filter(Boolean);if(!r.length)return"";const a=r[0]==="diff"?r.slice(1):r;for(const l of a){const u=l.includes(":")?l.slice(l.indexOf(":")+1):l;if(u&&/[./\\-]/.test(u))return u}return""})(e);return{title:i||t,caption:i?n?`Diff / ${t}`:t:""}}const e4e=["aria-busy","aria-label","data-language","data-markstream-line-numbers"],t4e={key:0,translate:"no",class:"markstream-pre__diff-code"},n4e={class:"markstream-pre__diff-pane-content"},i4e={class:"markstream-pre__diff-number","aria-hidden":"true"},o4e={class:"markstream-pre__diff-content"},s4e={class:"markstream-pre__diff-content-inner"},r4e={key:0,class:"markstream-pre__line-numbers","aria-hidden":"true"},a4e=["textContent"],l4e=["textContent"],Na=ot({__name:"PreCodeNode",props:{node:{},loading:{type:Boolean},showLineNumbers:{type:Boolean},diffInline:{type:Boolean},diffHideUnchangedRegions:{type:[Boolean,Object]},reservedHeightPx:{}},setup(e){const t=e;function n(ee,Ce){const Z=String(ee??"");return Ce?Z:Z.replace(/\r\n$|\n$|\r$/,"")}const i=O(()=>{var ee,Ce,Z;const ae=String((Ce=(ee=t.node)==null?void 0:ee.language)!=null?Ce:"");return String((Z=String(ae).split(/\s+/g)[0])!=null?Z:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),o=O(()=>`language-${i.value}`),s=O(()=>{var ee;return t.loading===!0||((ee=t.node)==null?void 0:ee.loading)===!0}),r=O(()=>{var ee;return n((ee=t.node)==null?void 0:ee.code,s.value)});let a="",l=1;const u=O(()=>(function(ee){let Ce=0,Z=1;ee.startsWith(a)&&(Ce=a.length,Z=l,Ce>0&&ee[Ce-1]==="\r"&&ee[Ce]===` +`&&Ce++);for(let ae=Ce;aer.value.split(/\r\n|\n|\r/));let d=0,f="";const h=O(()=>{const ee=u.value;ee{var ee;return t.showLineNumbers===!0&&((ee=t.node)==null?void 0:ee.diff)===!0}),g=O(()=>m.value&&t.diffInline===!0),y=O(()=>{const ee=Number(t.reservedHeightPx);if(!Number.isFinite(ee)||ee<=0)return;const Ce=`${Math.ceil(ee)}px`;return s.value?{maxHeight:Ce,overflow:"auto"}:{height:Ce,minHeight:Ce,maxHeight:Ce,overflow:"auto"}}),b=["diff ","index ","--- ","+++ ","@@ "];function v(ee){return String(ee??"").trim().length===0}function w(ee,Ce="context",Z={}){const ae=v(ee);return{code:ee,kind:ae&&Ce!=="hunk"&&Ce!=="spacer"&&!Z.preserveBlankKind?"context":Ce,empty:ae}}function A(ee){const Ce=n(ee,s.value);return Ce?Ce.split(/\r\n|\n|\r/):[]}function M(ee,Ce){return!v(ee[Ce])||Ceb.some(Z=>Ce.startsWith(Z)))}function x(ee,Ce){return Ce||!ee.startsWith(" ")||ee.startsWith(" ")?ee:` ${ee}`}function _(ee,Ce){const Z=ee.length,ae=Ce.length,he=[];let J=0;for(;J=J&&Y>=J&&ee[U]===Ce[Y];)te.unshift({originalIndex:U,modifiedIndex:Y}),U--,Y--;const ce=U-J+1,me=Y-J+1;if(ce<=0||me<=0||s.value||(ce+1)*(me+1)>15e5)return he.concat(te);const ge=me+1,oe=new Uint32Array((ce+1)*(me+1));for(let xe=ce-1;xe>=0;xe--)for(let be=me-1;be>=0;be--){const pe=xe*ge+be;if(ee[J+xe]===Ce[J+be])oe[pe]=oe[(xe+1)*ge+be+1]+1;else{const Te=oe[(xe+1)*ge+be],Ae=oe[xe*ge+be+1];oe[pe]=Te>=Ae?Te:Ae}}const re=[];let ve=0,le=0;for(;ve=oe[ve*ge+le+1]?ve++:le++;return he.concat(re,te)}function F(ee){var Ce;const Z=(function(){var Y,ce;const me=t.diffHideUnchangedRegions;if(me==null||me===!1)return null;const ge=me===!0?{}:me;return ge.enabled===!1?null:{contextLineCount:Math.max(0,Math.floor((Y=ge.contextLineCount)!=null?Y:2)),minimumLineCount:Math.max(1,Math.floor((ce=ge.minimumLineCount)!=null?ce:4))}})();if(!Z||ee.length<1||ee.length>2||ee.length===2&&ee[0].lines.length!==ee[1].lines.length)return ee;const ae=ee[0].lines,he=(Ce=ee[1])==null?void 0:Ce.lines,J=Y=>ae[Y].kind==="context"&&(he===void 0||he[Y].kind==="context"&&ae[Y].code===he[Y].code),te=[];let U=0;for(;U=Z.minimumLineCount){const me=Y+(Y===0?0:Z.contextLineCount),ge=ce-(ce===ae.length?0:Z.contextLineCount);ge-me>=Z.minimumLineCount&&te.push({start:me,end:ge})}U===Y&&U++}return te.length?ee.map((Y,ce)=>{const me=[];let ge=0;for(const oe of te)me.push(...Y.lines.slice(ge,oe.start)),me.push({code:ce===0?"Unmodified lines":"",kind:"collapsed",empty:!1,key:`${Y.key}-collapsed-${oe.start}-${oe.end}`,number:""}),ge=oe.end;return me.push(...Y.lines.slice(ge)),Pn(Dt({},Y),{lines:me})}):ee}const I=O(()=>{var ee,Ce,Z,ae;if(!m.value)return[];const he=(function(ce){const me=ce.some(oe=>L(oe)),ge=ce.some(oe=>E(oe));return me&&ge||(function(){var oe,re,ve,le;if(i.value==="diff")return!0;const xe=(le=(ve=String((re=(oe=t.node)==null?void 0:oe.raw)!=null?re:"").split(/\r?\n/,1)[0])==null?void 0:ve.trim())!=null?le:"";return/^`{3,}\s*diff(?:\s|$)|^~{3,}\s*diff(?:\s|$)/.test(xe)})()&&(me||ge)})(c.value),J=(function(){var ce,me;return((ce=t.node)==null?void 0:ce.originalCode)!=null||((me=t.node)==null?void 0:me.updatedCode)!=null})();if(g.value){const ce=J?(function(me,ge){const oe=A(me),re=A(ge),ve=_(oe,re);if(ve.length>0){const Ae=[];let _e=0,Fe=0;for(const $e of ve){for(;_e<$e.originalIndex;)Ae.push(Pn(Dt({},w(oe[_e],"removed",{preserveBlankKind:M(oe,_e)})),{key:`inline-removed-source-${_e}`,number:_e+1})),_e++;for(;Fe<$e.modifiedIndex;)Ae.push(Pn(Dt({},w(re[Fe],"added",{preserveBlankKind:M(re,Fe)})),{key:`inline-added-source-${Fe}`,number:Fe+1})),Fe++;Ae.push(Pn(Dt({},w(re[$e.modifiedIndex])),{key:`inline-context-source-${$e.originalIndex}-${$e.modifiedIndex}`,number:$e.modifiedIndex+1})),_e=$e.originalIndex+1,Fe=$e.modifiedIndex+1}for(;_e=xe&&pe>=xe&&oe[be]===re[pe];)Te.unshift(Pn(Dt({},w(re[pe])),{key:`inline-suffix-${pe}`,number:pe+1})),be--,pe--;for(let Ae=xe;Ae<=be;Ae++)le.push(Pn(Dt({},w(oe[Ae],"removed",{preserveBlankKind:M(oe,Ae)})),{key:`inline-removed-source-${Ae}`,number:Ae+1}));for(let Ae=xe;Ae<=pe;Ae++)le.push(Pn(Dt({},w(re[Ae],"added",{preserveBlankKind:M(re,Ae)})),{key:`inline-added-source-${Ae}`,number:Ae+1}));return le.concat(Te)})((ee=t.node)==null?void 0:ee.originalCode,(Ce=t.node)==null?void 0:Ce.updatedCode):(function(me){const ge=[];let oe=1,re=1;const ve=C(me);for(const[le,xe]of me.entries())if(xe.startsWith("@@")){const be=xe.match(/^@@\s+-(\d+)(?:,\d+)?\s+\+(\d+)(?:,\d+)?\s+@@/);be&&(oe=Number(be[1]),re=Number(be[2])),ge.push(Pn(Dt({},w(xe,"hunk")),{key:`inline-hunk-${le}`,number:""}))}else if(L(xe))ge.push(Pn(Dt({},w(x(xe.slice(1),ve),"removed",{preserveBlankKind:!0})),{key:`inline-removed-${le}`,number:oe++}));else if(E(xe))ge.push(Pn(Dt({},w(x(xe.slice(1),ve),"added",{preserveBlankKind:!0})),{key:`inline-added-${le}`,number:re++}));else{const be=ve&&xe.startsWith(" ")?xe.slice(1):xe;ge.push(Pn(Dt({},w(be)),{key:`inline-context-${le}`,number:re})),oe++,re++}return ge})(c.value);return F([{key:"inline",className:"markstream-pre__diff-pane--inline",lines:ce}])}if(!he&&J)return(function(ce,me){const ge=A(ce),oe=A(me),re=_(ge,oe),ve=[],le=[];let xe=0,be=0,pe=0;const Te=(Ae,_e)=>{const Fe=Math.max(Ae-xe,_e-be);for(let $e=0;$ePn(Dt({},ce),{key:`original-${me}`,number:me+1}))},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:U.map((ce,me)=>Pn(Dt({},ce),{key:`modified-${me}`,number:me+1}))}])}),D=O(()=>{var ee,Ce;if(t.showLineNumbers!==!0)return;let Z=m.value?1:u.value;if(m.value){Z=Math.max(Z,A((ee=t.node)==null?void 0:ee.originalCode).length,A((Ce=t.node)==null?void 0:Ce.updatedCode).length);for(const he of I.value)for(const J of he.lines)typeof J.number=="number"&&(Z=Math.max(Z,J.number))}const ae=`${Math.max(2,String(Z).length)}ch`;return{"--markstream-pre-line-number-width":ae,"--markstream-pre-diff-line-number-width":ae,"--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=O(()=>I.value.some(ee=>ee.lines.some(Ce=>Ce.kind==="collapsed"))),$=O(()=>{const ee=i.value;return ee?`Code block: ${ee}`:"Code block"}),T=q(null),R=q([]);let P=null,j=!1,B=null;function K(ee){const Ce=Number.parseFloat(String(ee??""));return Number.isFinite(Ce)&&Ce>0?Ce:0}function X(ee,Ce){var Z;if(!ee)return Ce;if(ee.classList.contains("markstream-pre__diff-line--collapsed"))return 32;const ae=ee.querySelector(".markstream-pre__diff-content"),he=ae?.getBoundingClientRect(),J=(Z=he?.height)!=null?Z:0;return Math.max(Ce,Math.ceil(J))}function V(){j||typeof window>"u"||(P!=null&&window.cancelAnimationFrame(P),P=window.requestAnimationFrame(()=>{P=null,j||(function(){var ee,Ce;P=null;const Z=T.value;if(!Z||!m.value||g.value||!Z.classList.contains("is-wrap"))return void(R.value.length&&(R.value=[]));const ae=(function(me){const ge=window.getComputedStyle(me),oe=K(ge.getPropertyValue("--markstream-pre-diff-line-height"));if(oe>0)return oe;const re=K(ge.lineHeight);return re>0?re:18})(Z),he=Array.from(Z.querySelectorAll(".markstream-pre__diff-pane--original .markstream-pre__diff-line")),J=Array.from(Z.querySelectorAll(".markstream-pre__diff-pane--modified .markstream-pre__diff-line")),te=Math.max(he.length,J.length),U=[];for(let me=0;me{const oe=ce[ge];return oe&&Math.abs(me.rowHeight-oe.rowHeight)<=.5&&Math.abs(me.originalHeight-oe.originalHeight)<=.5&&Math.abs(me.modifiedHeight-oe.modifiedHeight)<=.5})||(R.value=U)})()}))}function Q(ee){B?.disconnect(),B=null,ee&&m.value&&!g.value&&typeof ResizeObserver<"u"&&(B=new ResizeObserver(()=>{V()}),B.observe(ee))}function ie(ee,Ce){const Z=R.value[ee];if(!Z)return;const ae=Ce==="original"?Z.originalHeight:Z.modifiedHeight;return{"--markstream-pre-diff-synced-row-height":`${Math.ceil(Z.rowHeight)}px`,"--markstream-pre-diff-content-height":`${Math.ceil(ae)}px`}}return Be(T,ee=>{Q(ee),pt(()=>V())},{flush:"post"}),Be([m,g,I],()=>{Q(T.value),pt(()=>V())},{flush:"post",immediate:!0}),ii(()=>{j=!0,P!=null&&(window.cancelAnimationFrame(P),P=null),B?.disconnect(),B=null}),(ee,Ce)=>(k(),N("pre",{ref_key:"preRef",ref:T,style:an([y.value,D.value]),class:De([o.value,{"markstream-pre--line-numbers":t.showLineNumbers,"markstream-pre--diff-preview":m.value,"markstream-pre--diff-inline":g.value,"markstream-pre--diff-collapsed":H.value}]),"aria-busy":s.value,"aria-label":$.value,"data-language":i.value,"data-markstream-line-numbers":t.showLineNumbers?"1":void 0,"data-markstream-pre":"1",tabindex:"0"},[m.value?(k(),N("code",t4e,[(k(!0),N(Ne,null,wt(I.value,Z=>(k(),N("span",{key:Z.key,class:De(["markstream-pre__diff-pane",Z.className])},[S("span",n4e,[(k(!0),N(Ne,null,wt(Z.lines,(ae,he)=>(k(),N("span",{key:ae.key,class:De(["markstream-pre__diff-line",[`markstream-pre__diff-line--${ae.kind}`,{"markstream-pre__diff-line--empty":ae.empty}]]),style:an(ie(he,Z.key))},[Ce[0]||(Ce[0]=S("span",{class:"markstream-pre__diff-rail","aria-hidden":"true"},null,-1)),S("span",i4e,z(ae.number),1),S("span",o4e,[S("span",s4e,z(ae.code),1)])],6))),128))])],2))),128))])):(k(),N(Ne,{key:1},[t.showLineNumbers?(k(),N("span",r4e,[S("span",{class:"markstream-pre__line-numbers-text",textContent:z(h.value)},null,8,a4e)])):ne("",!0),S("code",{translate:"no",class:"markstream-pre__code",textContent:z(r.value)},null,8,l4e)],64))],14,e4e))}});Na.install=e=>{e.component(Na.__name,Na)};const qo=Ri(ot({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const t=e,n=yg(),i=en("markstreamFade",void 0),o=en("markstreamTextStreamState",void 0),s=en("markstreamStreamVersion",void 0),r=O(()=>{const M=n.fade;return M===""||M===!0||M==="true"||M!==!1&&M!=="false"&&void 0}),a=O(()=>typeof r.value=="boolean"?r.value:typeof i?.value!="boolean"||i.value),l=O(()=>{var M;const L=(M=n["index-key"])!=null?M:n.indexKey;return L==null||L===""?"":String(L)}),u=q(t.node.content),c=q(""),d=q(0),f=q(t.node.content);let h;const m=q(null),g=q(null);let y="",b=null;function v(){h?.(),h=void 0}function w(){v(),c.value&&(u.value=u.value+c.value,c.value="")}Be([u,m,g],function(){var M,L;const E=m.value;if(!E)return;const C=String((M=u.value)!=null?M:""),x=g.value;return b||(b=E.firstChild,y=(L=b?.data)!=null?L:""),C.startsWith(y)?!b&&C?(E.textContent=C,b=E.firstChild,void(y=C)):void(C.length>y.length&&x&&(x.appendChild(document.createTextNode(C.slice(y.length))),y=C)):(E.textContent=C,b=E.firstChild,x&&(x.textContent=""),void(y=C))},{immediate:!0}),Be([()=>t.node.content,l,a],([M])=>{const L=String(M??""),E=l.value,C=XU({nextContent:L,persistedContent:E?o?.get(E):void 0,currentState:{settledContent:u.value,streamedDelta:c.value},typewriterEnabled:a.value});u.value=C.settledContent,c.value=C.streamedDelta,C.appended?(d.value+=1,(function(){if(!c.value||h||!s)return;const x=s.value;h=Be(()=>s.value,_=>{_!==x&&w()},{flush:"sync"})})()):c.value||v(),E&&o?.set(E,L)},{immediate:!0}),Fd(v);const A=O(()=>d.value%2==0?"text-node-stream-delta--a":"text-node-stream-delta--b");return(M,L)=>(k(),N("span",{class:De([[e.node.center?"text-node-center":""],"text-node"])},[ri(S("span",{ref_key:"settledTextEl",ref:m},z(f.value),513),[[jo,u.value!==""]]),ri(S("span",{ref_key:"settledAppendsEl",ref:g},null,512),[[jo,u.value!==""]]),c.value?(k(),N("span",{key:0,class:De(["text-node-stream-delta",[A.value]]),onAnimationend:w},z(c.value),35)):ne("",!0)],2))}}),[["__scopeId","data-v-fd79037c"]]);function V0(e,t,n){return ot({name:e,inheritAttrs:!1,setup(i,{attrs:o,slots:s}){var r,a;const l=v_(),u=m_(),c=g_(),d=typeof window<"u"&&((a=(r=Is())==null?void 0:r.vnode.el)==null?void 0:a.nodeType)===1,f=q(typeof window>"u"||d||!c.value),h=au(null);let m=null;function g(y){const b=y&&"$el"in y?y.$el:y;h.value=b instanceof HTMLElement?b:null}return typeof window<"u"&&Be([h,c],([y,b],v,w)=>{if(m?.destroy(),m=null,!b||f.value)return void(f.value=!0);if(!y)return;let A=!0;const M=l(y,{rootMargin:u?.value.heavyBlockMargin,allowIdle:!1});m=M,f.value=M.isVisible.value,M.whenVisible.then(()=>{A&&m===M&&(f.value=!0)}),w(()=>{A=!1,M.destroy(),m===M&&(m=null)})},{immediate:!0}),ii(()=>{m?.destroy(),m=null}),()=>On(f.value?t:n,Pn(Dt({},o),{ref:g}),s)}})}qo.install=e=>{e.component(qo.__name,qo)};const p4=ot({name:"CodeBlockNodeLoading",inheritAttrs:!1,props:["node","isDark","loading","stream","theme","darkTheme","lightTheme","isShowPreview","monacoOptions","enableFontSizeControl","minWidth","maxWidth","themes","showHeader","showCopyButton","showExpandButton","showPreviewButton","showCollapseButton","showFontSizeButtons","showTooltips","htmlPreviewAllowScripts","htmlPreviewSandbox","customId","estimatedHeightPx","estimatedContentHeightPx","estimatedDiffInline"],emits:["previewCode","copy"],setup(e,{attrs:t}){const n=e;return()=>{var i,o,s,r,a,l,u;const c=Yw(String((o=(i=n.node)==null?void 0:i.language)!=null?o:"")),d=pR[c]||(c?c.charAt(0).toUpperCase()+c.slice(1):pR[""]),f=Jbe(n.node),h=Xbe(String((r=(s=n.node)==null?void 0:s.raw)!=null?r:""),d,f),m=n.monacoOptions,g=f&&((a=n.estimatedDiffInline)!=null?a:y_(m??{},typeof window>"u"?0:window.innerWidth)),y=m?.diffAppearance,b=y==="dark"||y!=="light"&&n.isDark===!0,v=typeof m?.fontSize=="number"&&Number.isFinite(m.fontSize)&&m.fontSize>0?m.fontSize:12,w=typeof m?.lineHeight=="number"&&Number.isFinite(m.lineHeight)&&m.lineHeight>0?m.lineHeight:v===12?18:Math.max(12,Math.round(1.5*v)),A=typeof m?.tabSize=="number"&&Number.isFinite(m.tabSize)&&m.tabSize>0?m.tabSize:4,M=f?0:8,L=typeof((l=m?.padding)==null?void 0:l.top)=="number"&&Number.isFinite(m.padding.top)&&m.padding.top>=0?m.padding.top:M,E=typeof((u=m?.padding)==null?void 0:u.bottom)=="number"&&Number.isFinite(m.padding.bottom)&&m.padding.bottom>=0?m.padding.bottom:M,C=typeof m?.fontFamily=="string"?m.fontFamily.trim():"",x=Dt(Dt({fontSize:`${v}px`,lineHeight:`${w}px`,tabSize:A,paddingTop:`${L}px`,paddingBottom:`${E}px`,"--markstream-pre-line-number-top":`${L}px`},f?{"--markstream-pre-diff-line-height":`${w}px`}:{}),C?{"--markstream-code-font-family":C}:{}),_=()=>On("button",{class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0","aria-hidden":"true",disabled:!0,tabindex:-1,type:"button"},[On("svg",{class:"action-icon",width:"14",height:"14"})]),F=n.isShowPreview!==!1&&(c==="html"||c==="svg"),I=n.showFontSizeButtons!==!1&&n.enableFontSizeControl!==!1||n.showExpandButton!==!1||F&&n.showPreviewButton!==!1,D=$=>{if($!=null)return typeof $=="number"?`${$}px`:String($)},H=Dt(Dt(Dt({"--markstream-code-layout-character-width":"1ch"},D(n.minWidth)?{minWidth:D(n.minWidth)}:{}),D(n.maxWidth)?{maxWidth:D(n.maxWidth)}:{}),f?{}:{color:"var(--vscode-editor-foreground, var(--markstream-code-fallback-fg, var(--code-fg)))",backgroundColor:"var(--markstream-code-fallback-bg, var(--code-bg, #fff))",borderColor:"var(--markstream-code-border-color, var(--code-border))"});return On("div",Pn(Dt({},t),{class:["code-block-container","rounded-lg","border",{dark:n.isDark===!0,"is-rendering":n.loading!==!1,"is-dark":b,"is-diff":f,"is-plain-text":c===""||c==="plaintext"||c==="text"},t.class],style:[H,t.style],"data-markstream-code-block":"1","data-markstream-enhanced":"false","data-markstream-code-block-state":n.loading?"streaming":"settled","data-markstream-code-loading":"1"}),[n.showHeader===!1?null:On("div",{class:"code-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)] border-[var(--code-border)] bg-[var(--code-header-bg)] text-[var(--code-fg)]"},[On("div",{class:"code-header-main",style:{minWidth:0,flex:"1 1 auto",display:"flex",alignItems:"center",gap:"var(--ms-gap-header-main, 0.625rem)",overflow:"hidden"}},[On("span",{class:"icon-slot h-4 w-4 flex-shrink-0","aria-hidden":"true",style:{display:"inline-flex",width:"1rem",height:"1rem",flex:"0 0 auto"}}),On("div",{class:"code-header-copy",style:{minWidth:0,display:"grid",gap:"2px"}},[On("div",{class:"code-header-title",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"var(--ms-text-label, 0.75rem)",fontWeight:"500",color:"var(--code-action-fg)"}},h.title),h.caption?On("div",{class:"code-header-caption",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"0.75rem",color:"var(--code-line-number)"}},h.caption):null])]),On("div",{class:"flex items-center gap-0.5",style:{visibility:"hidden"}},[f?On("div",{class:"code-diff-stats","aria-hidden":"true"},[On("span",{class:"code-diff-stat removed"},"-0"),On("span",{class:"code-diff-stat added"},"+0")]):null,n.showCopyButton===!1?null:_(),n.showCollapseButton===!1?null:_(),I?On("div",{class:"relative"},[_()]):null])]),On("div",{class:"code-block-shell-content",style:n.stream!==!1||n.loading===!1?void 0:{display:"none"}},[On(Na,{node:n.node,loading:n.loading,showLineNumbers:!0,reservedHeightPx:f?void 0:n.estimatedContentHeightPx,diffInline:g,diffHideUnchangedRegions:f?Ybe(m?.diffHideUnchangedRegions):void 0,class:"code-pre-fallback",style:x,"data-markstream-code-loading":"1"})]),On("div",{class:"code-loading-placeholder",style:n.stream===!1&&n.loading!==!1?void 0:{display:"none"}},[On("div",{class:"loading-skeleton"},[On("div",{class:"skeleton-line"}),On("div",{class:"skeleton-line"}),On("div",{class:"skeleton-line short"})])]),On("span",{class:"sr-only","aria-live":"polite",role:"status"})])}}}),F5=V0("ViewportDeferredCodeBlockNode",Ac({loader:()=>ao(null,null,function*(){try{return(yield ts(()=>import("./CodeBlockNode-nOFvAmOq.js"),__vite__mapDeps([4,5]))).default}catch(e){return console.warn('[markstream-vue] Failed to load the enhanced CodeBlockNode chunk; falling back to preformatted code rendering. Enhanced code blocks require the optional "stream-diffs" peer (or "stream-monaco" as a fallback).',e),Na}}),loadingComponent:p4,delay:0,suspensible:!1}),p4),Wu=Ac(()=>ao(null,null,function*(){var e;if(((e=(function(){const t=Reflect.get(globalThis,"process");return t?.env})())==null?void 0:e.NODE_ENV)==="test"&&typeof window<"u")return t=>{var n,i,o,s;return On(qo,Pn(Dt({},t),{node:{type:"text",content:(i=t.node.raw)!=null?i:`$${(n=t.node.content)!=null?n:""}$`,raw:(s=t.node.raw)!=null?s:`$${(o=t.node.content)!=null?o:""}$`}}))};try{return yield oV(),(yield ts(()=>import("./index7-bsFOqYUV.js"),[])).default}catch(t){console.warn('[markstream-vue] Optional peer dependencies for MathInlineNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',t)}return t=>{var n,i,o,s;return On(qo,Pn(Dt({},t),{node:{type:"text",content:(i=t.node.raw)!=null?i:`$${(n=t.node.content)!=null?n:""}$`,raw:(s=t.node.raw)!=null?s:`$${(o=t.node.content)!=null?o:""}$`}}))}})),yV=Ac(()=>ao(null,null,function*(){try{return yield oV(),(yield ts(()=>import("./index6-B68sKyzS.js"),[])).default}catch(e){console.warn('[markstream-vue] Optional peer dependencies for MathBlockNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',e)}return e=>{var t,n,i,o;return On(qo,Pn(Dt({},e),{node:{type:"text",content:(n=e.node.raw)!=null?n:`$$${(t=e.node.content)!=null?t:""}$$`,raw:(o=e.node.raw)!=null?o:`$$${(i=e.node.content)!=null?i:""}$$`}}))}})),la=Ri(ot({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup:e=>(t,n)=>(k(),N("span",{class:"reference-node cursor-pointer text-xs rounded-md px-1.5 mx-0.5",role:"button",tabindex:"0",onClick:n[0]||(n[0]=i=>t.$emit("click",i,e.node.id,e.messageId,e.threadId)),onMouseenter:n[1]||(n[1]=i=>t.$emit("mouseEnter",i,e.node.id,e.messageId,e.threadId)),onMouseleave:n[2]||(n[2]=i=>t.$emit("mouseLeave",i,e.node.id,e.messageId,e.threadId))},z(e.node.id),33))}),[["__scopeId","data-v-775c65e4"]]);la.install=e=>{e.component(la.__name,la)};const u4e={class:"superscript-node"},$a=Ri(ot({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Ms(()=>t.customId),i=O(()=>Dt({text:qo,inline_code:Hr,link:da,html_inline:gl,strong:ua,emphasis:fa,footnote_reference:ml,strikethrough:ca,highlight:vl,insert:ja,subscript:za,emoji:Ba,math_inline:Wu,reference:la},n.value));return(o,s)=>(k(),N("sup",u4e,[(k(!0),N(Ne,null,wt(e.node.children,(r,a)=>(k(),fe(p(zc),{key:`${e.indexKey||"superscript"}-${a}`,components:i.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"superscript"}-${a}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-24160b22"]]);$a.install=e=>{e.component($a.__name,$a)};const c4e={class:"subscript-node"},za=Ri(ot({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Ms(()=>t.customId),i=O(()=>Dt({text:qo,inline_code:Hr,link:da,html_inline:gl,strong:ua,emphasis:fa,footnote_reference:ml,strikethrough:ca,highlight:vl,insert:ja,superscript:$a,emoji:Ba,math_inline:Wu,reference:la},n.value));return(o,s)=>(k(),N("sub",c4e,[(k(!0),N(Ne,null,wt(e.node.children,(r,a)=>(k(),fe(p(zc),{key:`${e.indexKey||"subscript"}-${a}`,components:i.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"subscript"}-${a}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-197fa13b"]]);za.install=e=>{e.component(za.__name,za)};const d4e={class:"strong-node"},ua=Ri(ot({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Ms(()=>t.customId),i=O(()=>Dt({text:qo,inline_code:Hr,link:da,html_inline:gl,emphasis:fa,strikethrough:ca,highlight:vl,insert:ja,subscript:za,superscript:$a,emoji:Ba,footnote_reference:ml,math_inline:Wu,reference:la},n.value));return(o,s)=>(k(),N("strong",d4e,[(k(!0),N(Ne,null,wt(e.node.children,(r,a)=>(k(),fe(p(zc),{key:`${e.indexKey||"strong"}-${a}`,components:i.value,node:r,"index-key":`${e.indexKey||"strong"}-${a}`,"custom-id":t.customId},null,8,["components","node","index-key","custom-id"]))),128))]))}}),[["__scopeId","data-v-a8647104"]]);ua.install=e=>{e.component(ua.__name,ua)};const f4e={class:"strikethrough-node"},ca=Ri(ot({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Ms(()=>t.customId),i=O(()=>Dt({text:qo,inline_code:Hr,link:da,html_inline:gl,strong:ua,emphasis:fa,highlight:vl,insert:ja,subscript:za,superscript:$a,emoji:Ba,footnote_reference:ml,math_inline:Wu,reference:la},n.value));return(o,s)=>(k(),N("del",f4e,[(k(!0),N(Ne,null,wt(e.node.children,(r,a)=>(k(),fe(p(zc),{key:`${e.indexKey||"strikethrough"}-${a}`,components:i.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"strikethrough"}-${a}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-b7a531fa"]]);ca.install=e=>{e.component(ca.__name,ca)};const h4e=["href","title","aria-label","aria-hidden","target","rel"],p4e=["aria-hidden"],m4e={class:"link-text-wrapper relative inline-flex"},g4e={class:"leading-[normal] link-text"},da=Ri(ot({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){const t=e,n=en("markstreamShowTooltips",void 0),i=O(()=>{const b=n?.value;return typeof b=="boolean"?b:t.showTooltip}),o=O(()=>{var b,v,w,A,M;const L=t.underlineBottom!==void 0?typeof t.underlineBottom=="number"?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px",E=(b=t.animationOpacity)!=null?b:.35,C=Math.max(.12,Math.min(.5*E,E)),x={"--underline-height":`${(v=t.underlineHeight)!=null?v:2}px`,"--underline-bottom":L,"--underline-opacity":String(E),"--underline-rest-opacity":String(C),"--underline-duration":`${(w=t.animationDuration)!=null?w:1.6}s`,"--underline-timing":(A=t.animationTiming)!=null?A:"ease-in-out","--underline-iteration":typeof t.animationIteration=="number"?String(t.animationIteration):(M=t.animationIteration)!=null?M:"infinite"};return t.color&&(x["--link-color"]=t.color),x}),s=Ms(()=>t.customId),r=O(()=>Dt({text:qo,strong:ua,strikethrough:ca,emphasis:fa,image:Df,html_inline:gl,inline_code:Hr},s.value)),a=yg(),l=O(()=>{var b,v;const w=(b=t.node)==null?void 0:b.attrs;if(!w||typeof w!="object")return{};const A={};if(Array.isArray(w))for(const M of w)Array.isArray(M)&&M[0]&&(A[String(M[0])]=String((v=M[1])!=null?v:""));else for(const[M,L]of Object.entries(w))M&&L!=null&&L!==!1&&(A[M]=L===!0?"":String(L));return IR(A,"safe","a")}),u=O(()=>Dt(Dt({},a),l.value)),c=O(()=>{var b,v;return IR({href:String((v=(b=t.node)==null?void 0:b.href)!=null?v:"")},"safe","a").href}),d=O(()=>{if(!c.value)return;const b=u.value.target;return(typeof b=="string"?b.trim():String(b??"").trim())||(t0e(c.value)?"_blank":void 0)}),f=O(()=>{var b;return String((b=d.value)!=null?b:"").trim().toLowerCase()==="_blank"}),h=O(()=>{if(!c.value)return;const b=u.value.rel,v=new Set((typeof b=="string"?b:String(b??"")).split(/\s+/).filter(Boolean)),w=new Set(Array.from(v).filter(A=>A.toLowerCase()!=="opener"));return f.value&&(w.add("noopener"),w.add("noreferrer")),w.size>0?Array.from(w).join(" "):void 0}),m=O(()=>{const b=Dt({},u.value);return delete b.title,delete b.href,delete b.target,delete b.rel,b});function g(){i.value&&Obe()}const y=O(()=>{var b,v;const w=(b=t.node)==null?void 0:b.title;return typeof w=="string"&&w.trim().length>0?w:String((v=c.value)!=null?v:"")});return(b,v)=>{var w,A;return e.node.loading?(k(),N("span",ci({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},p(a),{style:o.value}),[S("span",m4e,[S("span",g4e,[G(p(qo),{class:"leading-[normal] link-text",node:{type:"text",content:String((w=e.node.text)!=null?w:""),raw:String((A=e.node.text)!=null?A:"")},"index-key":`${e.indexKey||"link-text"}-loading`},null,8,["node","index-key"])]),v[1]||(v[1]=S("span",{class:"link-loading-indicator","aria-hidden":"true"},null,-1))])],16,p4e)):(k(),N("a",ci({key:0,class:"link-node",href:c.value,title:i.value?"":y.value,"aria-label":`Link: ${y.value}`,"aria-hidden":e.node.loading?"true":"false",target:d.value,rel:h.value},m.value,{style:o.value,onMouseenter:v[0]||(v[0]=M=>(function(L){var E,C,x,_;if(!i.value)return;const F=L,I=F?.clientX!=null&&F?.clientY!=null?{x:F.clientX,y:F.clientY}:void 0,D=((E=t.node)==null?void 0:E.title)||((C=c.value)!=null&&C.includes("xn--")&&((_=(x=t.node)==null?void 0:x.text)!=null&&_.includes("://"))?t.node.text:c.value)||"";Dbe(L.currentTarget,D,"top",!1,I)})(M)),onMouseleave:g}),[(k(!0),N(Ne,null,wt(e.node.children,(M,L)=>(k(),fe(p(zc),{key:`${e.indexKey||"emphasis"}-${L}`,components:r.value,node:M,"custom-id":t.customId,"index-key":`${e.indexKey||"link-text"}-${L}`},null,8,["components","node","custom-id","index-key"]))),128))],16,h4e))}}}),[["__scopeId","data-v-367e6ca4"]]);da.install=e=>{e.component(da.__name,da)};const v4e={class:"insert-node"},ja=Ri(ot({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Ms(()=>t.customId),i=O(()=>Dt({text:qo,inline_code:Hr,link:da,html_inline:gl,strong:ua,emphasis:fa,strikethrough:ca,highlight:vl,subscript:za,superscript:$a,emoji:Ba,footnote_reference:ml,math_inline:Wu,reference:la},n.value));return(o,s)=>(k(),N("ins",v4e,[(k(!0),N(Ne,null,wt(e.node.children,(r,a)=>(k(),fe(p(zc),{key:`${e.indexKey||"insert"}-${a}`,components:i.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"insert"}-${a}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-1e2c29d4"]]);ja.install=e=>{e.component(ja.__name,ja)};const y4e={class:"highlight-node"},vl=Ri(ot({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Ms(()=>t.customId),i=O(()=>Dt({text:qo,inline_code:Hr,link:da,html_inline:gl,strong:ua,emphasis:fa,strikethrough:ca,insert:ja,subscript:za,superscript:$a,emoji:Ba,footnote_reference:ml,math_inline:Wu,reference:la},n.value));return(o,s)=>(k(),N("mark",y4e,[(k(!0),N(Ne,null,wt(e.node.children,(r,a)=>(k(),fe(p(zc),{key:`${e.indexKey||"highlight"}-${a}`,components:i.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"highlight"}-${a}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-7a62982a"]]);vl.install=e=>{e.component(vl.__name,vl)};const k4e={class:"emphasis-node"},fa=Ri(ot({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Ms(()=>t.customId),i=O(()=>Dt({text:qo,inline_code:Hr,link:da,html_inline:gl,strong:ua,strikethrough:ca,highlight:vl,insert:ja,subscript:za,superscript:$a,emoji:Ba,footnote_reference:ml,math_inline:Wu,reference:la},n.value));return(o,s)=>(k(),N("em",k4e,[(k(!0),N(Ne,null,wt(e.node.children,(r,a)=>(k(),fe(p(zc),{key:`${e.indexKey||"emphasis"}-${a}`,components:i.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"emphasis"}-${a}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-2a5aafbf"]]);fa.install=e=>{e.component(fa.__name,fa)};const b4e={class:"hard-break"},Of=Ri(ot({__name:"HardBreakNode",props:{node:{}},setup:e=>(t,n)=>(k(),N("br",b4e))}),[["__scopeId","data-v-50c58f70"]]);Of.install=e=>{e.component(Of.__name,Of)};const b2=ot({__name:"SimpleInlineRenderer",props:{nodes:{},customId:{},indexKey:{}},setup(e){const t=e,n=Tt({checkbox:pl,checkbox_input:pl,emoji:Ba,emphasis:fa,hardbreak:Of,highlight:vl,inline_code:Hr,insert:ja,link:da,reference:la,strikethrough:ca,strong:ua,subscript:za,superscript:$a,text:qo}),i=Ms(()=>t.customId),o=O(()=>{const s=i.value;return Object.keys(s).length>0?Dt(Dt({},n),s):n});return(s,r)=>(k(!0),N(Ne,null,wt(e.nodes,(a,l)=>(k(),fe(p(zc),{key:l,components:o.value,node:a,"custom-id":t.customId,"index-key":`${e.indexKey||"inline"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))}});function t7(e){if(!e||typeof e!="object")return!1;const t=`|${e.type}|`;if(!"|checkbox|checkbox_input|emoji|emphasis|hardbreak|highlight|inline_code|insert|link|reference|strikethrough|strong|subscript|superscript|text|".includes(t))return!1;if(!"|emphasis|highlight|insert|link|strikethrough|strong|subscript|superscript|".includes(t))return!0;const n=e.children;return Array.isArray(n)&&n.every(t7)}function m4(e,t=!0,n=!1){if(!e||!n&&e.length===0)return null;if(e.every(t7))return e;if(!t||e.length!==1)return null;const i=e[0];if(i?.type!=="paragraph"||!Array.isArray(i.children))return null;const o=i.children;return(n||o.length>0)&&o.every(t7)?o:null}function qp(e){var t,n;if(!e?.length)return null;let i="";for(const o of e){if(o?.type!=="text"||o.center===!0)return null;i+=String((n=(t=o.content)!=null?t:o.raw)!=null?n:"")}return i}const w4e=["cite"],A4e={key:0,dir:"auto",class:"paragraph-node"},C4e=["custom-id"],Dk=Ri(ot({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=Ms(()=>t.customId),i=O(()=>!!n.value.paragraph),o=O(()=>!!n.value.text),s=O(()=>m4(t.node.children,!i.value)),r=O(()=>t.fade!==!1||o.value?null:qp(s.value));return Qn("markstreamShowTooltips",O(()=>t.showTooltips)),Qn("markstreamFade",O(()=>t.fade)),(a,l)=>(k(),N("blockquote",{class:"blockquote blockquote-node",dir:"auto",cite:e.node.cite},[s.value?(k(),N("p",A4e,[r.value!==null?(k(),N("span",{key:0,class:"text-node","custom-id":t.customId},z(r.value),9,C4e)):(k(),fe(p(b2),{key:1,nodes:s.value,"custom-id":t.customId,"index-key":`blockquote-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):(k(),fe(p(Ha),{key:1,"show-tooltips":t.showTooltips,"index-key":`blockquote-${t.indexKey}`,nodes:t.node.children||[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:l[0]||(l[0]=u=>a.$emit("copy",u))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade"]))],8,w4e))}}),[["__scopeId","data-v-abfecebc"]]);Dk.install=e=>{e.component(Dk.__name,Dk)};const x4e={class:"definition-list"},S4e={class:"definition-term"},_4e={class:"definition-desc"},Ok=Ri(ot({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,i)=>(k(),N("dl",x4e,[(k(!0),N(Ne,null,wt(t.node.items,(o,s)=>(k(),N(Ne,{key:s},[S("dt",S4e,[G(p(Ha),{"index-key":`definition-term-${t.indexKey}-${s}`,nodes:o.term,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:i[0]||(i[0]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])]),S("dd",_4e,[G(p(Ha),{"index-key":`definition-desc-${t.indexKey}-${s}`,nodes:o.definition,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:i[1]||(i[1]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],64))),128))]))}}),[["__scopeId","data-v-4e103b30"]]);Ok.install=e=>{e.component(Ok.__name,Ok)};const I4e=["href","title"],Mv=Ri(ot({__name:"FootnoteAnchorNode",props:{node:{}},setup(e){const t=e;function n(i){var o;if(i.preventDefault(),typeof document>"u")return;const s=`fnref-${String((o=t.node.id)!=null?o:"")}`,r=document.getElementById(s);r&&r.scrollIntoView({behavior:"smooth",block:"center"})}return(i,o)=>(k(),N("a",{class:"footnote-anchor text-sm hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:n}," ↩︎ ",8,I4e))}}),[["__scopeId","data-v-e1eb37b6"]]);Mv.install=e=>{e.component(Mv.__name,Mv)};const M4e=["id"],T4e={class:"flex-1"},Pk=ot({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,i)=>(k(),N("div",{id:`fnref--${e.node.id}`,class:"footnote-node flex text-sm leading-relaxed border-t border-[var(--footnote-border)] pt-2"},[S("div",T4e,[G(p(Ha),{"index-key":`footnote-${t.indexKey}`,nodes:t.node.children,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:i[0]||(i[0]=o=>n.$emit("copy",o))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],8,M4e))}});Pk.install=e=>{e.component(Pk.__name,Pk)};const E4e=["custom-id"],n7=Ri(ot({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=Ms(()=>t.customId),i=en("markstreamFade",void 0),o=O(()=>i?.value!==!1||n.value.text?null:qp(t.node.children)),s=O(()=>Dt({text:qo,inline_code:Hr,link:da,image:Df,strong:ua,emphasis:fa,strikethrough:ca,highlight:vl,insert:ja,subscript:za,superscript:$a,emoji:Ba,checkbox:pl,checkbox_input:pl,footnote_reference:ml,hardbreak:Of,math_inline:Wu,reference:la},n.value));return(r,a)=>(k(),fe(zo(`h${e.node.level}`),ci({class:["heading-node",[`heading-${e.node.level}`]],dir:"auto"},e.node.attrs),{default:de(()=>[o.value!==null?(k(),N("span",{key:0,class:"text-node","custom-id":t.customId},z(o.value),9,E4e)):(k(!0),N(Ne,{key:1},wt(e.node.children,(l,u)=>(k(),fe(p(zc),{key:u,components:s.value,"custom-id":t.customId,node:l,"index-key":`${e.indexKey||"heading"}-${u}`},null,8,["components","custom-id","node","index-key"]))),128))]),_:1},16,["class"]))}}),[["__scopeId","data-v-7122dbe1"]]),e3=n7;e3.install=e=>{e.component(n7.__name,n7)};const L4e={key:0,dir:"auto",class:"paragraph-node"},N4e=["custom-id"],F4e={dir:"auto",class:"paragraph-node"},R4e=["custom-id"],Dm=Ri(ot({__name:"ListItemNode",props:{node:{},item:{},indexKey:{},customId:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},value:{},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=O(()=>{var h;return(h=t.node)!=null?h:t.item}),i=Ms(()=>t.customId),o=O(()=>!!i.value.paragraph),s=O(()=>!!i.value.text),r=O(()=>{var h;return m4((h=n.value)==null?void 0:h.children,!o.value)}),a=O(()=>{var h;if(o.value)return null;const m=(h=n.value)==null?void 0:h.children;if(!Array.isArray(m)||m.length<2)return null;const g=m[0];if(g?.type!=="paragraph"||!Array.isArray(g.children))return null;const y=m.slice(1);if(!y.every(v=>v?.type==="list"))return null;const b=m4([g]);return b?{paragraphChildren:b,nestedLists:y}:null});function l(){return t.fade===!1&&!s.value}const u=O(()=>l()?qp(r.value):null),c=O(()=>{var h;return l()?qp((h=a.value)==null?void 0:h.paragraphChildren):null}),d=Object.freeze({}),f=O(()=>{const{value:h}=t;return typeof h=="number"&&Number.isFinite(h)?{value:h}:d});return Qn("markstreamShowTooltips",O(()=>t.showTooltips)),Qn("markstreamFade",O(()=>t.fade)),(h,m)=>{var g,y;return k(),N("li",ci({class:"list-item",dir:"auto"},f.value),[r.value?(k(),N("p",L4e,[u.value!==null?(k(),N("span",{key:0,class:"text-node","custom-id":t.customId},z(u.value),9,N4e)):(k(),fe(p(b2),{key:1,nodes:r.value,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):a.value?(k(),N(Ne,{key:1},[S("p",F4e,[c.value!==null?(k(),N("span",{key:0,class:"text-node","custom-id":t.customId},z(c.value),9,R4e)):(k(),fe(p(b2),{key:1,nodes:a.value.paragraphChildren,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))]),(k(!0),N(Ne,null,wt(a.value.nestedLists,(b,v)=>(k(),fe(p(Ha),{key:v,nodes:[b],"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-nested-${v}`,"show-tooltips":t.showTooltips,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0,onCopy:m[0]||(m[0]=w=>h.$emit("copy",w))},null,8,["nodes","custom-id","index-key","show-tooltips","typewriter","fade","is-dark"]))),128))],64)):(k(),fe(p(Ha),{key:2,"show-tooltips":t.showTooltips,"index-key":`list-item-${t.indexKey}`,nodes:(y=(g=n.value)==null?void 0:g.children)!=null?y:[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,onCopy:m[1]||(m[1]=b=>h.$emit("copy",b))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade","is-dark"]))],16)}}}),[["__scopeId","data-v-617214f9"]]);Dm.install=e=>{e.component(Dm.__name,Dm)};const Om=Ri(ot({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=Ms(()=>e.customId),n=O(()=>t.value.list_item||Dm);return(i,o)=>(k(),fe(zo(e.node.ordered?"ol":"ul"),{class:De(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:de(()=>[(k(!0),N(Ne,null,wt(e.node.items,(s,r)=>{var a;return k(),fe(zo(n.value),ci({key:`${e.indexKey||"list"}-${r}`},{ref_for:!0},{showTooltips:e.showTooltips},{node:s,"custom-id":e.customId,"index-key":`${e.indexKey||"list"}-${r}`,typewriter:e.typewriter,fade:e.fade,"is-dark":e.isDark,value:e.node.ordered?((a=e.node.start)!=null?a:1)+r:void 0,onCopy:o[0]||(o[0]=l=>i.$emit("copy",l))}),null,16,["node","custom-id","index-key","typewriter","fade","is-dark","value"])}),128))]),_:1},8,["class"]))}}),[["__scopeId","data-v-99cb95e0"]]);Om.install=e=>{e.component(Om.__name,Om)};const D4e={key:2,class:"html-block-node__raw"},O4e=["innerHTML"],P4e={key:1,class:"html-block-node__placeholder"},Tv=Ri(ot({__name:"HtmlBlockNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=en("markstreamHtmlPolicy",void 0),i=en("markstreamNestedRendererProps",void 0),o=O(()=>{var I,D;return(D=(I=t.htmlPolicy)!=null?I:n?.value)!=null?D:"safe"}),s=O(()=>{var I,D;const H=(I=i?.value)!=null?I:{};return Pn(Dt({},H),{customId:(D=t.customId)!=null?D:H.customId,htmlPolicy:o.value})}),r=Ac({loader:()=>Promise.resolve().then(()=>M_),suspensible:!1}),a=O(()=>{const I=Lk(t.node.attrs,o.value);if(!I)return;const D=xv(I);return Object.keys(D).length>0?D:void 0}),l=O(()=>{const I=String(t.node.tag||"").trim(),D=Lk(t.node.attrs,o.value,I);if(!D)return;const H=xv(D);return Object.keys(H).length>0?H:void 0}),u=Ms(()=>t.customId),c=ot({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),d=q(null),f=q(typeof window>"u"),h=q(t.node.content),m=O(()=>Array.isArray(t.node.children)?t.node.children:[]),g=O(()=>String(t.node.tag||"div")),y=O(()=>{var I;if(g.value.trim().toLowerCase()!=="details"||(I=t.node.attrs)!=null&&I.some(([H])=>String(H).toLowerCase()==="open"))return null;const D=m.value[0];return D?.type==="html_block"&&String(D.tag||"").toLowerCase()==="summary"?D:null}),b=O(()=>{var I;return qp((I=y.value)==null?void 0:I.children)}),v=O(()=>{const I=y.value;if(!I)return;const D=Lk(I.attrs,o.value,"summary");if(!D)return;const H=xv(D);return Object.keys(H).length>0?H:void 0}),w=O(()=>b.value==null?m.value:m.value.slice(1)),A=O(()=>{const I=g.value.trim().toLowerCase();return $q.has(I)||u_(I,o.value)}),M=O(()=>m.value.length>0&&!!t.node.tag&&!A.value),L=O(()=>{var I,D,H;if(M.value)return{mode:"structured"};if(!f.value)return{mode:"html",content:(I=h.value)!=null?I:""};const $=(D=h.value)!=null?D:t.node.content;if(!$)return{mode:"html",content:""};if(o.value==="escape")return{mode:"html",content:Rm($,o.value)};if(t.node.loading){const R=h4($,u.value,o.value);return R===null?{mode:"text",content:(H=t.node.raw)!=null?H:$}:{mode:"dynamic",nodes:R}}if(!dV($,u.value))return{mode:"html",content:Rm($,o.value)};const T=h4($,u.value,o.value);return T===null?{mode:"html",content:Rm($,o.value)}:{mode:"dynamic",nodes:T}}),E=v_(),C=m_(),x=g_(),_=au(null),F=!!t.node.loading;return typeof window<"u"?(Be([()=>d.value,()=>C?.value.heavyBlockMargin,()=>C?.value.rootMargin],([I],D,H)=>{var $,T,R,P;if((T=($=_.value)==null?void 0:$.destroy)==null||T.call($),_.value=null,!F)return f.value=!0,void(h.value=t.node.content);if(!I)return void(f.value=!1);let j=!0;const B=(P=(R=C?.value.heavyBlockMargin)!=null?R:C?.value.rootMargin)!=null?P:Wp,K=E(I,{rootMargin:B,allowIdle:!x.value});_.value=K,f.value=f.value||K.isVisible.value,K.whenVisible.then(()=>{j&&_.value===K&&(f.value=!0)}),H(()=>{j=!1,K.destroy(),_.value===K&&(_.value=null)})},{immediate:!0}),Be(()=>t.node.content,I=>{F&&!f.value||(h.value=I)})):f.value=!0,ii(()=>{var I,D;(D=(I=_.value)==null?void 0:I.destroy)==null||D.call(I),_.value=null}),(I,D)=>(k(),fe(zo(M.value?g.value:"div"),ci({ref_key:"htmlRef",ref:d,class:"html-block-node","data-markstream-viewport-pending":p(x)&&!f.value?"true":void 0},M.value?l.value:void 0),{default:de(()=>[f.value?(k(),N(Ne,{key:0},[L.value.mode==="structured"?(k(),N(Ne,{key:0},[b.value!==null?(k(),N(Ne,{key:0},[S("summary",QX(gj(v.value)),z(b.value),17),w.value.length?(k(),fe(p(r),ci({key:0},s.value,{nodes:w.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"])):ne("",!0)],64)):(k(),fe(p(r),ci({key:1},s.value,{nodes:m.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"]))],64)):L.value.mode==="dynamic"?(k(),fe(p(c),{key:1,nodes:L.value.nodes},null,8,["nodes"])):L.value.mode==="text"?(k(),N("pre",D4e,z(L.value.content),1)):(k(),N("div",ci({key:3},a.value,{innerHTML:L.value.content}),null,16,O4e))],64)):(k(),N("div",P4e,[Kn(I.$slots,"placeholder",{node:e.node},()=>[D[0]||(D[0]=S("span",{class:"html-block-node__placeholder-bar"},null,-1)),D[1]||(D[1]=S("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),D[2]||(D[2]=S("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))]),_:3},16,["data-markstream-viewport-pending"]))}}),[["__scopeId","data-v-e140a874"]]);Tv.install=e=>{e.component(Tv.__name,Tv)};const B4e={dir:"auto",class:"paragraph-node"},$4e=["custom-id"],Np=Ri(ot({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{},customHtmlTags:{},parseOptions:{},customMarkdownIt:{type:Function}},setup(e){const t=e,n=Ms(()=>t.customId),i=en("markstreamHtmlPolicy",void 0),o=en("markstreamFade",void 0),s=en("markstreamParseOptions",void 0),r=en("markstreamCustomMarkdownIt",void 0),a=en("markstreamNestedRendererProps",void 0),l=O(()=>{var C;return(C=i?.value)!=null?C:"safe"}),u=O(()=>{var C;return(C=t.parseOptions)!=null?C:s?.value}),c=O(()=>{var C;return(C=t.customMarkdownIt)!=null?C:r?.value}),d=O(()=>{var C,x;return(x=t.customHtmlTags)!=null?x:(C=a?.value)==null?void 0:C.customHtmlTags}),f=O(()=>{var C,x;const _=(C=a?.value)!=null?C:{};return Pn(Dt({},_),{customId:(x=t.customId)!=null?x:_.customId,customHtmlTags:d.value,parseOptions:u.value,customMarkdownIt:c.value,htmlPolicy:l.value})}),h=Ac({loader:()=>Promise.resolve().then(()=>M_),suspensible:!1});function m(C){var x;return C.type==="text"&&String((x=C.content)!=null?x:"").trim()===""}const g=O(()=>t.node.children.filter(C=>!m(C))),y=O(()=>g.value.length>0&&g.value.every(C=>C.type==="image"||(function(x){var _;const F=(function(I){return I.type==="link"&&Array.isArray(I.children)?I.children.filter(D=>!m(D)):[]})(x);return F.length===1&&((_=F[0])==null?void 0:_.type)==="image"})(C))),b=O(()=>new Set(r1(d.value))),v=O(()=>{if(!y.value||g.value.length<=1)return t.node.children;const C=[];for(let x=0;x0,I=t.node.children.slice(x+1).some(D=>!m(D));F&&I&&C.push(Pn(Dt({},_),{content:" ",raw:" "}))}return C}),w=O(()=>o?.value===!1&&!n.value.text),A=O(()=>w.value?qp(v.value):null);function M(C,x){return{node:C,"index-key":`${t.indexKey}-${x}`,"custom-id":t.customId,"custom-html-tags":d.value}}const L=O(()=>Dt({inline_code:Hr,image:Df,link:da,hardbreak:Of,emphasis:fa,strong:ua,strikethrough:ca,highlight:vl,insert:ja,subscript:za,superscript:$a,html_inline:gl,html_block:Tv,emoji:Ba,checkbox:pl,math_inline:Wu,checkbox_input:pl,reference:la,footnote_anchor:Mv,footnote_reference:ml,text:qo},n.value)),E=O(()=>v.value.map((C,x)=>{var _;const F=(function(I){var D,H,$,T;if(I.type==="html_block"||I.type==="html_inline"){const R=String((D=I.tag)!=null?D:"").trim().toLowerCase()||qq(I.content);if(R&&!b.value.has(R)&&Uq((H=I.content)!=null?H:I.raw,R)){const P=String((T=($=I.content)!=null?$:I.raw)!=null?T:"");return{child:{type:"text",content:P,raw:P},component:qo,isCustomComponent:!1}}}return{child:I,component:L.value[I.type],isCustomComponent:!!(n.value[I.type]&&!ry(String(I.type)))}})(C);return Pn(Dt({},F),{index:x,key:`${t.indexKey||"paragraph"}-${x}`,customAttrs:F.isCustomComponent?p_(F.child,l.value):void 0,hasSlotChildren:Array.isArray(F.child.children)&&F.child.children.length>0,slotContent:String((_=F.child.content)!=null?_:""),originalChild:C})}));return(C,x)=>(k(),N("p",B4e,[A.value!==null?(k(),N("span",{key:0,class:"text-node","custom-id":t.customId},z(A.value),9,$4e)):(k(!0),N(Ne,{key:1},wt(E.value,_=>{return k(),N(Ne,{key:_.key},[y.value&&m(_.originalChild)?(k(),N(Ne,{key:0},[Pe(z((F=_.originalChild,String((I=F.content)!=null?I:""))),1)],64)):_.isCustomComponent?(k(),fe(zo(_.component),ci({key:1,ref_for:!0},_.customAttrs,{node:_.child,loading:_.child.loading,"index-key":_.key,"custom-id":t.customId,"custom-html-tags":d.value,"is-dark":f.value.isDark}),{default:de(()=>[_.hasSlotChildren?(k(),fe(p(h),ci({key:0,ref_for:!0},f.value,{nodes:_.child.children,"index-key":_.key,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):_.slotContent?(k(),fe(p(h),ci({key:1,ref_for:!0},f.value,{content:_.slotContent,final:!_.child.loading,"index-key":`${_.key}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ne("",!0)]),_:2},1040,["node","loading","index-key","custom-id","custom-html-tags","is-dark"])):(k(),fe(zo(_.component),ci({key:2,ref_for:!0},M(_.child,_.index)),null,16))],64);var F,I}),128))]))}}),[["__scopeId","data-v-c59ff506"]]);Np.install=e=>{e.component(Np.__name,Np)};const z4e={class:"table-node-wrapper"},j4e=["aria-busy"],H4e={key:0},W4e=["custom-id"],q4e=["aria-label","onPointerdown"],U4e=["custom-id"],V4e={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},Ev=Ri(ot({__name:"TableNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=O(()=>{var b;return(b=t.node.loading)!=null&&b}),i=O(()=>{var b;return(b=t.node.rows)!=null?b:[]}),o=q(null),s=q([]);let r=null;const a=O(()=>t.node.header.cells.length),l=O(()=>s.value.some(b=>Number.isFinite(b)&&b>0)),u=O(()=>l.value?s.value.map(b=>b>0?{width:`${b}px`}:void 0):[]);Qn("markstreamShowTooltips",O(()=>t.showTooltips)),Qn("markstreamFade",O(()=>t.fade));const c=Ms(()=>t.customId),d=O(()=>!!c.value.text),f=O(()=>!!c.value.paragraph),h=new WeakMap;function m(b){const v=t.fade===!1&&!d.value,w=!f.value,A=h.get(b);if(A?.children===b.children&&A.textFastPath===v&&A.paragraphFastPath===w)return A.info;const M=m4(b.children,w,!0),L={simpleChildren:M,plainText:M&&v?qp(M):null};return h.set(b,{children:b.children,textFastPath:v,paragraphFastPath:w,info:L}),L}function g(b){if(!r)return;b.preventDefault();const v=r.startWidth+r.nextStartWidth,w=Math.min(48,Math.floor(v/2)),A=Math.max(w,Math.min(v-w,Math.round(r.startWidth+b.clientX-r.startX))),M=[...r.widths];M[r.index]=A,M[r.index+1]=v-A,s.value=M}function y(){r&&(window.removeEventListener("pointermove",g),window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",y),r=null)}return Be(a,()=>{y(),s.value=[]}),ii(y),(b,v)=>(k(),N("div",z4e,[S("table",{ref_key:"tableRef",ref:o,class:De(["table-node",{"table-node--loading":n.value}]),"aria-busy":n.value},[l.value?(k(),N("colgroup",H4e,[(k(!0),N(Ne,null,wt(e.node.header.cells,(w,A)=>(k(),N("col",{key:A,style:an(u.value[A])},null,4))),128))])):ne("",!0),S("thead",null,[S("tr",null,[(k(!0),N(Ne,null,wt(e.node.header.cells,(w,A)=>(k(),N("th",{key:A,dir:"auto",class:De([w.align==="right"?"text-right":w.align==="center"?"text-center":"text-left"])},[m(w).plainText!==null?(k(),N("span",{key:0,class:"text-node","custom-id":t.customId},z(m(w).plainText),9,W4e)):m(w).simpleChildren?(k(),fe(p(b2),{key:1,nodes:m(w).simpleChildren,"custom-id":t.customId,"index-key":`table-th-${t.indexKey}-${A}`},null,8,["nodes","custom-id","index-key"])):(k(),fe(p(Ha),{key:2,nodes:w.children,"index-key":`table-th-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:v[0]||(v[0]=M=>b.$emit("copy",M))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"])),A(function(L,E){if(E.button!==0)return;const C=(function(){var F;const I=(F=o.value)==null?void 0:F.querySelectorAll("thead th");return Array.from(I??[],D=>Math.round(D.getBoundingClientRect().width))})(),x=C[L],_=C[L+1];x&&_&&(E.preventDefault(),r={index:L,startX:E.clientX,startWidth:x,nextStartWidth:_,widths:C},s.value=C,window.addEventListener("pointermove",g),window.addEventListener("pointerup",y),window.addEventListener("pointercancel",y))})(A,M)},null,40,q4e)):ne("",!0)],2))),128))])]),S("tbody",null,[(k(!0),N(Ne,null,wt(i.value,(w,A)=>(k(),N("tr",{key:A},[(k(!0),N(Ne,null,wt(w.cells,(M,L)=>(k(),N("td",{key:L,class:De([M.align==="right"?"text-right":M.align==="center"?"text-center":"text-left"]),dir:"auto"},[m(M).plainText!==null?(k(),N("span",{key:0,class:"text-node","custom-id":t.customId},z(m(M).plainText),9,U4e)):m(M).simpleChildren?(k(),fe(p(b2),{key:1,nodes:m(M).simpleChildren,"custom-id":t.customId,"index-key":`table-td-${t.indexKey}-${A}-${L}`},null,8,["nodes","custom-id","index-key"])):(k(),fe(p(Ha),{key:2,nodes:M.children,"index-key":`table-td-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:v[1]||(v[1]=E=>b.$emit("copy",E))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"]))],2))),128))]))),128))])],10,j4e),G(wo,{name:"table-node-fade"},{default:de(()=>[n.value?(k(),N("div",V4e,[Kn(b.$slots,"loading",{isLoading:n.value},()=>[v[2]||(v[2]=S("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),v[3]||(v[3]=S("span",{class:"sr-only"},"Loading",-1))],!0)])):ne("",!0)]),_:3})]))}}),[["__scopeId","data-v-39f87b5d"]]);Ev.install=e=>{e.component(Ev.__name,Ev)};const K4e={class:"hr-node"},Bk=Ri({},[["render",function(e,t){return k(),N("hr",K4e)}],["__scopeId","data-v-39b2349c"]]);Bk.install=e=>{e.component(Bk.__name,Bk)};const Z4e={class:"unknown-node"},i7=ot({__name:"FallbackComponent",props:{node:{}},setup:e=>(t,n)=>(k(),N("div",Z4e,z(e.node.raw),1))}),$k=Ri(ot({__name:"VmrContainerNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},setup(e){const t=e,n=O(()=>`vmr-container vmr-container-${t.node.name}`),i=Ms(()=>t.customId),o=O(()=>Dt({text:qo,paragraph:Np,heading:e3,inline_code:Hr,link:da,image:Df,strong:ua,emphasis:fa,strikethrough:ca,insert:ja,subscript:za,superscript:$a,checkbox:pl,checkbox_input:pl,hardbreak:Of,math_inline:Wu,reference:la,list:Om,math_block:yV,table:Ev},i.value));return(s,r)=>(k(),N("div",ci({class:n.value},e.node.attrs),[(k(!0),N(Ne,null,wt(e.node.children,(a,l)=>{return k(),fe(zo((u=a.type,o.value[u]||i7)),{key:`${e.indexKey||"vmr-container"}-${l}`,"custom-id":t.customId,node:a,"index-key":`${e.indexKey||"vmr-container"}-${l}`,typewriter:t.typewriter,fade:t.fade},null,8,["custom-id","node","index-key","typewriter","fade"]);var u}),128))],16))}}),[["__scopeId","data-v-911e41c4"]]);$k.install=e=>{e.component($k.__name,$k)};const G4e=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","ON","ON","ET","ET","ET","ON","ON","ON","ON","ON","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","ON","ET","ET","ET","ET","ON","ON","ON","ON","L","ON","ON","BN","ON","ON","ET","ET","EN","EN","ON","L","ON","ON","ON","EN","L","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L"],OR=[[697,698,"ON"],[706,719,"ON"],[722,735,"ON"],[741,749,"ON"],[751,767,"ON"],[768,879,"NSM"],[884,885,"ON"],[894,894,"ON"],[900,901,"ON"],[903,903,"ON"],[1014,1014,"ON"],[1155,1161,"NSM"],[1418,1418,"ON"],[1421,1422,"ON"],[1423,1423,"ET"],[1424,1424,"R"],[1425,1469,"NSM"],[1470,1470,"R"],[1471,1471,"NSM"],[1472,1472,"R"],[1473,1474,"NSM"],[1475,1475,"R"],[1476,1477,"NSM"],[1478,1478,"R"],[1479,1479,"NSM"],[1480,1535,"R"],[1536,1541,"AN"],[1542,1543,"ON"],[1544,1544,"AL"],[1545,1546,"ET"],[1547,1547,"AL"],[1548,1548,"CS"],[1549,1549,"AL"],[1550,1551,"ON"],[1552,1562,"NSM"],[1563,1610,"AL"],[1611,1631,"NSM"],[1632,1641,"AN"],[1642,1642,"ET"],[1643,1644,"AN"],[1645,1647,"AL"],[1648,1648,"NSM"],[1649,1749,"AL"],[1750,1756,"NSM"],[1757,1757,"AN"],[1758,1758,"ON"],[1759,1764,"NSM"],[1765,1766,"AL"],[1767,1768,"NSM"],[1769,1769,"ON"],[1770,1773,"NSM"],[1774,1775,"AL"],[1776,1785,"EN"],[1786,1808,"AL"],[1809,1809,"NSM"],[1810,1839,"AL"],[1840,1866,"NSM"],[1867,1957,"AL"],[1958,1968,"NSM"],[1969,1983,"AL"],[1984,2026,"R"],[2027,2035,"NSM"],[2036,2037,"R"],[2038,2041,"ON"],[2042,2044,"R"],[2045,2045,"NSM"],[2046,2069,"R"],[2070,2073,"NSM"],[2074,2074,"R"],[2075,2083,"NSM"],[2084,2084,"R"],[2085,2087,"NSM"],[2088,2088,"R"],[2089,2093,"NSM"],[2094,2136,"R"],[2137,2139,"NSM"],[2140,2143,"R"],[2144,2191,"AL"],[2192,2193,"AN"],[2194,2198,"AL"],[2199,2207,"NSM"],[2208,2249,"AL"],[2250,2273,"NSM"],[2274,2274,"AN"],[2275,2306,"NSM"],[2362,2362,"NSM"],[2364,2364,"NSM"],[2369,2376,"NSM"],[2381,2381,"NSM"],[2385,2391,"NSM"],[2402,2403,"NSM"],[2433,2433,"NSM"],[2492,2492,"NSM"],[2497,2500,"NSM"],[2509,2509,"NSM"],[2530,2531,"NSM"],[2546,2547,"ET"],[2555,2555,"ET"],[2558,2558,"NSM"],[2561,2562,"NSM"],[2620,2620,"NSM"],[2625,2626,"NSM"],[2631,2632,"NSM"],[2635,2637,"NSM"],[2641,2641,"NSM"],[2672,2673,"NSM"],[2677,2677,"NSM"],[2689,2690,"NSM"],[2748,2748,"NSM"],[2753,2757,"NSM"],[2759,2760,"NSM"],[2765,2765,"NSM"],[2786,2787,"NSM"],[2801,2801,"ET"],[2810,2815,"NSM"],[2817,2817,"NSM"],[2876,2876,"NSM"],[2879,2879,"NSM"],[2881,2884,"NSM"],[2893,2893,"NSM"],[2901,2902,"NSM"],[2914,2915,"NSM"],[2946,2946,"NSM"],[3008,3008,"NSM"],[3021,3021,"NSM"],[3059,3064,"ON"],[3065,3065,"ET"],[3066,3066,"ON"],[3072,3072,"NSM"],[3076,3076,"NSM"],[3132,3132,"NSM"],[3134,3136,"NSM"],[3142,3144,"NSM"],[3146,3149,"NSM"],[3157,3158,"NSM"],[3170,3171,"NSM"],[3192,3198,"ON"],[3201,3201,"NSM"],[3260,3260,"NSM"],[3276,3277,"NSM"],[3298,3299,"NSM"],[3328,3329,"NSM"],[3387,3388,"NSM"],[3393,3396,"NSM"],[3405,3405,"NSM"],[3426,3427,"NSM"],[3457,3457,"NSM"],[3530,3530,"NSM"],[3538,3540,"NSM"],[3542,3542,"NSM"],[3633,3633,"NSM"],[3636,3642,"NSM"],[3647,3647,"ET"],[3655,3662,"NSM"],[3761,3761,"NSM"],[3764,3772,"NSM"],[3784,3790,"NSM"],[3864,3865,"NSM"],[3893,3893,"NSM"],[3895,3895,"NSM"],[3897,3897,"NSM"],[3898,3901,"ON"],[3953,3966,"NSM"],[3968,3972,"NSM"],[3974,3975,"NSM"],[3981,3991,"NSM"],[3993,4028,"NSM"],[4038,4038,"NSM"],[4141,4144,"NSM"],[4146,4151,"NSM"],[4153,4154,"NSM"],[4157,4158,"NSM"],[4184,4185,"NSM"],[4190,4192,"NSM"],[4209,4212,"NSM"],[4226,4226,"NSM"],[4229,4230,"NSM"],[4237,4237,"NSM"],[4253,4253,"NSM"],[4957,4959,"NSM"],[5008,5017,"ON"],[5120,5120,"ON"],[5760,5760,"WS"],[5787,5788,"ON"],[5906,5908,"NSM"],[5938,5939,"NSM"],[5970,5971,"NSM"],[6002,6003,"NSM"],[6068,6069,"NSM"],[6071,6077,"NSM"],[6086,6086,"NSM"],[6089,6099,"NSM"],[6107,6107,"ET"],[6109,6109,"NSM"],[6128,6137,"ON"],[6144,6154,"ON"],[6155,6157,"NSM"],[6158,6158,"BN"],[6159,6159,"NSM"],[6277,6278,"NSM"],[6313,6313,"NSM"],[6432,6434,"NSM"],[6439,6440,"NSM"],[6450,6450,"NSM"],[6457,6459,"NSM"],[6464,6464,"ON"],[6468,6469,"ON"],[6622,6655,"ON"],[6679,6680,"NSM"],[6683,6683,"NSM"],[6742,6742,"NSM"],[6744,6750,"NSM"],[6752,6752,"NSM"],[6754,6754,"NSM"],[6757,6764,"NSM"],[6771,6780,"NSM"],[6783,6783,"NSM"],[6832,6877,"NSM"],[6880,6891,"NSM"],[6912,6915,"NSM"],[6964,6964,"NSM"],[6966,6970,"NSM"],[6972,6972,"NSM"],[6978,6978,"NSM"],[7019,7027,"NSM"],[7040,7041,"NSM"],[7074,7077,"NSM"],[7080,7081,"NSM"],[7083,7085,"NSM"],[7142,7142,"NSM"],[7144,7145,"NSM"],[7149,7149,"NSM"],[7151,7153,"NSM"],[7212,7219,"NSM"],[7222,7223,"NSM"],[7376,7378,"NSM"],[7380,7392,"NSM"],[7394,7400,"NSM"],[7405,7405,"NSM"],[7412,7412,"NSM"],[7416,7417,"NSM"],[7616,7679,"NSM"],[8125,8125,"ON"],[8127,8129,"ON"],[8141,8143,"ON"],[8157,8159,"ON"],[8173,8175,"ON"],[8189,8190,"ON"],[8192,8202,"WS"],[8203,8205,"BN"],[8207,8207,"R"],[8208,8231,"ON"],[8232,8232,"WS"],[8233,8233,"B"],[8234,8238,"BN"],[8239,8239,"CS"],[8240,8244,"ET"],[8245,8259,"ON"],[8260,8260,"CS"],[8261,8286,"ON"],[8287,8287,"WS"],[8288,8303,"BN"],[8304,8304,"EN"],[8308,8313,"EN"],[8314,8315,"ES"],[8316,8318,"ON"],[8320,8329,"EN"],[8330,8331,"ES"],[8332,8334,"ON"],[8352,8399,"ET"],[8400,8432,"NSM"],[8448,8449,"ON"],[8451,8454,"ON"],[8456,8457,"ON"],[8468,8468,"ON"],[8470,8472,"ON"],[8478,8483,"ON"],[8485,8485,"ON"],[8487,8487,"ON"],[8489,8489,"ON"],[8494,8494,"ET"],[8506,8507,"ON"],[8512,8516,"ON"],[8522,8525,"ON"],[8528,8543,"ON"],[8585,8587,"ON"],[8592,8721,"ON"],[8722,8722,"ES"],[8723,8723,"ET"],[8724,9013,"ON"],[9083,9108,"ON"],[9110,9257,"ON"],[9280,9290,"ON"],[9312,9351,"ON"],[9352,9371,"EN"],[9450,9899,"ON"],[9901,10239,"ON"],[10496,11123,"ON"],[11126,11263,"ON"],[11493,11498,"ON"],[11503,11505,"NSM"],[11513,11519,"ON"],[11647,11647,"NSM"],[11744,11775,"NSM"],[11776,11869,"ON"],[11904,11929,"ON"],[11931,12019,"ON"],[12032,12245,"ON"],[12272,12287,"ON"],[12288,12288,"WS"],[12289,12292,"ON"],[12296,12320,"ON"],[12330,12333,"NSM"],[12336,12336,"ON"],[12342,12343,"ON"],[12349,12351,"ON"],[12441,12442,"NSM"],[12443,12444,"ON"],[12448,12448,"ON"],[12539,12539,"ON"],[12736,12773,"ON"],[12783,12783,"ON"],[12829,12830,"ON"],[12880,12895,"ON"],[12924,12926,"ON"],[12977,12991,"ON"],[13004,13007,"ON"],[13175,13178,"ON"],[13278,13279,"ON"],[13311,13311,"ON"],[19904,19967,"ON"],[42128,42182,"ON"],[42509,42511,"ON"],[42607,42610,"NSM"],[42611,42611,"ON"],[42612,42621,"NSM"],[42622,42623,"ON"],[42654,42655,"NSM"],[42736,42737,"NSM"],[42752,42785,"ON"],[42888,42888,"ON"],[43010,43010,"NSM"],[43014,43014,"NSM"],[43019,43019,"NSM"],[43045,43046,"NSM"],[43048,43051,"ON"],[43052,43052,"NSM"],[43064,43065,"ET"],[43124,43127,"ON"],[43204,43205,"NSM"],[43232,43249,"NSM"],[43263,43263,"NSM"],[43302,43309,"NSM"],[43335,43345,"NSM"],[43392,43394,"NSM"],[43443,43443,"NSM"],[43446,43449,"NSM"],[43452,43453,"NSM"],[43493,43493,"NSM"],[43561,43566,"NSM"],[43569,43570,"NSM"],[43573,43574,"NSM"],[43587,43587,"NSM"],[43596,43596,"NSM"],[43644,43644,"NSM"],[43696,43696,"NSM"],[43698,43700,"NSM"],[43703,43704,"NSM"],[43710,43711,"NSM"],[43713,43713,"NSM"],[43756,43757,"NSM"],[43766,43766,"NSM"],[43882,43883,"ON"],[44005,44005,"NSM"],[44008,44008,"NSM"],[44013,44013,"NSM"],[64285,64285,"R"],[64286,64286,"NSM"],[64287,64296,"R"],[64297,64297,"ES"],[64298,64335,"R"],[64336,64450,"AL"],[64451,64466,"ON"],[64467,64829,"AL"],[64830,64847,"ON"],[64848,64911,"AL"],[64912,64913,"ON"],[64914,64967,"AL"],[64968,64975,"ON"],[64976,65007,"BN"],[65008,65020,"AL"],[65021,65023,"ON"],[65024,65039,"NSM"],[65040,65049,"ON"],[65056,65071,"NSM"],[65072,65103,"ON"],[65104,65104,"CS"],[65105,65105,"ON"],[65106,65106,"CS"],[65108,65108,"ON"],[65109,65109,"CS"],[65110,65118,"ON"],[65119,65119,"ET"],[65120,65121,"ON"],[65122,65123,"ES"],[65124,65126,"ON"],[65128,65128,"ON"],[65129,65130,"ET"],[65131,65131,"ON"],[65136,65278,"AL"],[65279,65279,"BN"],[65281,65282,"ON"],[65283,65285,"ET"],[65286,65290,"ON"],[65291,65291,"ES"],[65292,65292,"CS"],[65293,65293,"ES"],[65294,65295,"CS"],[65296,65305,"EN"],[65306,65306,"CS"],[65307,65312,"ON"],[65339,65344,"ON"],[65371,65381,"ON"],[65504,65505,"ET"],[65506,65508,"ON"],[65509,65510,"ET"],[65512,65518,"ON"],[65520,65528,"BN"],[65529,65533,"ON"],[65534,65535,"BN"],[65793,65793,"ON"],[65856,65932,"ON"],[65936,65948,"ON"],[65952,65952,"ON"],[66045,66045,"NSM"],[66272,66272,"NSM"],[66273,66299,"EN"],[66422,66426,"NSM"],[67584,67870,"R"],[67871,67871,"ON"],[67872,68096,"R"],[68097,68099,"NSM"],[68100,68100,"R"],[68101,68102,"NSM"],[68103,68107,"R"],[68108,68111,"NSM"],[68112,68151,"R"],[68152,68154,"NSM"],[68155,68158,"R"],[68159,68159,"NSM"],[68160,68324,"R"],[68325,68326,"NSM"],[68327,68408,"R"],[68409,68415,"ON"],[68416,68863,"R"],[68864,68899,"AL"],[68900,68903,"NSM"],[68904,68911,"AL"],[68912,68921,"AN"],[68922,68927,"AL"],[68928,68937,"AN"],[68938,68968,"R"],[68969,68973,"NSM"],[68974,68974,"ON"],[68975,69215,"R"],[69216,69246,"AN"],[69247,69290,"R"],[69291,69292,"NSM"],[69293,69311,"R"],[69312,69327,"AL"],[69328,69336,"ON"],[69337,69369,"AL"],[69370,69375,"NSM"],[69376,69423,"R"],[69424,69445,"AL"],[69446,69456,"NSM"],[69457,69487,"AL"],[69488,69505,"R"],[69506,69509,"NSM"],[69510,69631,"R"],[69633,69633,"NSM"],[69688,69702,"NSM"],[69714,69733,"ON"],[69744,69744,"NSM"],[69747,69748,"NSM"],[69759,69761,"NSM"],[69811,69814,"NSM"],[69817,69818,"NSM"],[69826,69826,"NSM"],[69888,69890,"NSM"],[69927,69931,"NSM"],[69933,69940,"NSM"],[70003,70003,"NSM"],[70016,70017,"NSM"],[70070,70078,"NSM"],[70089,70092,"NSM"],[70095,70095,"NSM"],[70191,70193,"NSM"],[70196,70196,"NSM"],[70198,70199,"NSM"],[70206,70206,"NSM"],[70209,70209,"NSM"],[70367,70367,"NSM"],[70371,70378,"NSM"],[70400,70401,"NSM"],[70459,70460,"NSM"],[70464,70464,"NSM"],[70502,70508,"NSM"],[70512,70516,"NSM"],[70587,70592,"NSM"],[70606,70606,"NSM"],[70608,70608,"NSM"],[70610,70610,"NSM"],[70625,70626,"NSM"],[70712,70719,"NSM"],[70722,70724,"NSM"],[70726,70726,"NSM"],[70750,70750,"NSM"],[70835,70840,"NSM"],[70842,70842,"NSM"],[70847,70848,"NSM"],[70850,70851,"NSM"],[71090,71093,"NSM"],[71100,71101,"NSM"],[71103,71104,"NSM"],[71132,71133,"NSM"],[71219,71226,"NSM"],[71229,71229,"NSM"],[71231,71232,"NSM"],[71264,71276,"ON"],[71339,71339,"NSM"],[71341,71341,"NSM"],[71344,71349,"NSM"],[71351,71351,"NSM"],[71453,71453,"NSM"],[71455,71455,"NSM"],[71458,71461,"NSM"],[71463,71467,"NSM"],[71727,71735,"NSM"],[71737,71738,"NSM"],[71995,71996,"NSM"],[71998,71998,"NSM"],[72003,72003,"NSM"],[72148,72151,"NSM"],[72154,72155,"NSM"],[72160,72160,"NSM"],[72193,72198,"NSM"],[72201,72202,"NSM"],[72243,72248,"NSM"],[72251,72254,"NSM"],[72263,72263,"NSM"],[72273,72278,"NSM"],[72281,72283,"NSM"],[72330,72342,"NSM"],[72344,72345,"NSM"],[72544,72544,"NSM"],[72546,72548,"NSM"],[72550,72550,"NSM"],[72752,72758,"NSM"],[72760,72765,"NSM"],[72850,72871,"NSM"],[72874,72880,"NSM"],[72882,72883,"NSM"],[72885,72886,"NSM"],[73009,73014,"NSM"],[73018,73018,"NSM"],[73020,73021,"NSM"],[73023,73029,"NSM"],[73031,73031,"NSM"],[73104,73105,"NSM"],[73109,73109,"NSM"],[73111,73111,"NSM"],[73459,73460,"NSM"],[73472,73473,"NSM"],[73526,73530,"NSM"],[73536,73536,"NSM"],[73538,73538,"NSM"],[73562,73562,"NSM"],[73685,73692,"ON"],[73693,73696,"ET"],[73697,73713,"ON"],[78912,78912,"NSM"],[78919,78933,"NSM"],[90398,90409,"NSM"],[90413,90415,"NSM"],[92912,92916,"NSM"],[92976,92982,"NSM"],[94031,94031,"NSM"],[94095,94098,"NSM"],[94178,94178,"ON"],[94180,94180,"NSM"],[113821,113822,"NSM"],[113824,113827,"BN"],[117760,117973,"ON"],[118e3,118009,"EN"],[118010,118012,"ON"],[118016,118451,"ON"],[118458,118480,"ON"],[118496,118512,"ON"],[118528,118573,"NSM"],[118576,118598,"NSM"],[119143,119145,"NSM"],[119155,119162,"BN"],[119163,119170,"NSM"],[119173,119179,"NSM"],[119210,119213,"NSM"],[119273,119274,"ON"],[119296,119361,"ON"],[119362,119364,"NSM"],[119365,119365,"ON"],[119552,119638,"ON"],[120513,120513,"ON"],[120539,120539,"ON"],[120571,120571,"ON"],[120597,120597,"ON"],[120629,120629,"ON"],[120655,120655,"ON"],[120687,120687,"ON"],[120713,120713,"ON"],[120745,120745,"ON"],[120771,120771,"ON"],[120782,120831,"EN"],[121344,121398,"NSM"],[121403,121452,"NSM"],[121461,121461,"NSM"],[121476,121476,"NSM"],[121499,121503,"NSM"],[121505,121519,"NSM"],[122880,122886,"NSM"],[122888,122904,"NSM"],[122907,122913,"NSM"],[122915,122916,"NSM"],[122918,122922,"NSM"],[123023,123023,"NSM"],[123184,123190,"NSM"],[123566,123566,"NSM"],[123628,123631,"NSM"],[123647,123647,"ET"],[124140,124143,"NSM"],[124398,124399,"NSM"],[124643,124643,"NSM"],[124646,124646,"NSM"],[124654,124655,"NSM"],[124661,124661,"NSM"],[124928,125135,"R"],[125136,125142,"NSM"],[125143,125251,"R"],[125252,125258,"NSM"],[125259,126063,"R"],[126064,126143,"AL"],[126144,126207,"R"],[126208,126287,"AL"],[126288,126463,"R"],[126464,126703,"AL"],[126704,126705,"ON"],[126706,126719,"AL"],[126720,126975,"R"],[126976,127019,"ON"],[127024,127123,"ON"],[127136,127150,"ON"],[127153,127167,"ON"],[127169,127183,"ON"],[127185,127221,"ON"],[127232,127242,"EN"],[127243,127247,"ON"],[127279,127279,"ON"],[127338,127343,"ON"],[127405,127405,"ON"],[127584,127589,"ON"],[127744,128728,"ON"],[128732,128748,"ON"],[128752,128764,"ON"],[128768,128985,"ON"],[128992,129003,"ON"],[129008,129008,"ON"],[129024,129035,"ON"],[129040,129095,"ON"],[129104,129113,"ON"],[129120,129159,"ON"],[129168,129197,"ON"],[129200,129211,"ON"],[129216,129217,"ON"],[129232,129240,"ON"],[129280,129623,"ON"],[129632,129645,"ON"],[129648,129660,"ON"],[129664,129674,"ON"],[129678,129734,"ON"],[129736,129736,"ON"],[129741,129756,"ON"],[129759,129770,"ON"],[129775,129784,"ON"],[129792,129938,"ON"],[129940,130031,"ON"],[130032,130041,"EN"],[130042,130042,"ON"],[131070,131071,"BN"],[196606,196607,"BN"],[262142,262143,"BN"],[327678,327679,"BN"],[393214,393215,"BN"],[458750,458751,"BN"],[524286,524287,"BN"],[589822,589823,"BN"],[655358,655359,"BN"],[720894,720895,"BN"],[786430,786431,"BN"],[851966,851967,"BN"],[917502,917759,"BN"],[917760,917999,"NSM"],[918e3,921599,"BN"],[983038,983039,"BN"],[1048574,1048575,"BN"],[1114110,1114111,"BN"]];function Q4e(e){if(e<=255)return G4e[e];let t=0,n=OR.length-1;for(;t<=n;){const i=t+n>>1,o=OR[i];if(eo[1]))return o[2];t=i+1}}return"L"}const Y4e=/[ \t\n\r\f]+/g,J4e=/[\t\n\r\f]| {2,}|^ | $/;let R5=null;const X4e=new RegExp("\\p{Script=Arabic}","u"),Jf=new RegExp("\\p{M}","u"),k_=new RegExp("\\p{Nd}","u");function PR(e){return X4e.test(e)}function BR(e){return e>=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=183984&&e<=191471||e>=191472&&e<=192093||e>=194560&&e<=195103||e>=196608&&e<=201551||e>=201552&&e<=205743||e>=205744&&e<=210041||e>=63744&&e<=64255||e>=12288&&e<=12351||e>=12352&&e<=12447||e>=12448&&e<=12543||e>=12592&&e<=12687||e>=44032&&e<=55215||e>=65280&&e<=65519}function xc(e){for(let t=0;t=55296&&n<=56319&&t+1=56320&&i<=57343){if(BR(i-56320+(n-55296<<10)+65536))return!0;t++;continue}}if(BR(n))return!0}}return!1}const ewe=new Set([" "," ","⁠","\uFEFF"]),twe=new Set(["-","‐","–","—"]);function kV(e,t){return!((function(n){const i=Lv(n);return i!==null&&ewe.has(i)})(e)||t&&((function(n){const i=Lv(n);return i!==null&&(b_.has(i)||Up.has(i))})(e)||(function(n){const i=Lv(n);return i!==null&&twe.has(i)})(e)))}const b_=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),t3=new Set(['"',"(","[","{","¡","¿","“","‘","‚","„","«","‹","⸘","(","〔","〈","《","「","『","【","〖","〘","〚"]),w_=new Set(["'","’"]),Up=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),nwe=new Set([":",".","،","؛"]),iwe=new Set(["၏"]),owe=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function swe(e){if(A_(e))return!0;let t=!1;for(const n of e)if(Up.has(n)||v4(n))t=!0;else if(!t||!Jf.test(n))return!1;return t}function rwe(e){for(const t of e)if(!b_.has(t)&&!Up.has(t))return!1;return e.length>0}function awe(e){if(A_(e))return!0;for(const t of e)if(!(t3.has(t)||w_.has(t)||Jf.test(t)||v4(t)))return!1;return e.length>0}function A_(e){let t=!1;for(const n of e)if(n!=="\\"&&!Jf.test(n)){if(!(t3.has(n)||Up.has(n)||w_.has(n)))return!1;t=!0}return t}function g4(e,t){const n=t-1;if(n<=0)return Math.max(n,0);const i=e.charCodeAt(n);if(i<56320||i>57343)return n;const o=n-1;if(o<0)return n;const s=e.charCodeAt(o);return s>=55296&&s<=56319?o:n}function Lv(e){if(e.length===0)return null;const t=g4(e,e.length);return e.slice(t)}const lwe=[36,37,43,43,92,92,162,165,176,177,1423,1423,1545,1547,1642,1642,2046,2047,2546,2547,2553,2555,2801,2801,3065,3065,3449,3449,3647,3647,6107,6107,8240,8247,8279,8279,8352,8399,8451,8451,8457,8457,8470,8470,8722,8723,43064,43064,65020,65020,65129,65130,65284,65285,65504,65505,65509,65510,73693,73696,123647,123647,126124,126124,126128,126128];function v4(e){const t=e.codePointAt(0);return t!==void 0&&(function(n,i){for(let o=0;o=i[o]&&n<=i[o+1])return!0;return!1})(t,lwe)}function uwe(e){const t=(function(n){for(const i of n)if(!Jf.test(i))return i;return null})(e);return t!==null&&k_.test(t)}function cwe(e){const t=Array.from(e);let n=t.length;for(;n>0;){const i=t[n-1];if(Jf.test(i))n--;else{if(!t3.has(i)&&!w_.has(i))break;n--}}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function dwe(e,t,n){return n!=="text"||t||e.length!==1||e==="-"||e==="—"?null:e}function $R(e,t,n,i){const o=t[i],s=e[i];if(o==null)return s;const r=n[i];if(s.length===r)return s;const a=o.repeat(r);return e[i]=a,a}function zR(e,t){return e&&t!==null&&nwe.has(t)}function fwe(e){const t=Lv(e);return t!==null&&iwe.has(t)}function hwe(e){if(e.length<2||e[0]!==" ")return null;const t=e.slice(1);return new RegExp("^\\p{M}+$","u").test(t)?{space:" ",marks:t}:null}function o7(e){let t=e.length;for(;t>0;){const n=g4(e,t),i=e.slice(n,t);if(owe.has(i))return!0;if(!Up.has(i))return!1;t=n}return!1}function pwe(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===` +`)return"hard-break"}return e===" "?"space":e===" "||e===" "||e==="⁠"||e==="\uFEFF"?"glue":e==="​"?"zero-width-break":e==="­"?"soft-hyphen":"text"}const mwe=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function Cu(e){return e.length===1?e[0]:e.join("")}function gwe(e,t){const n=[];for(let i=e.length-1;i>=0;i--)n.push(e[i]);return n.push(t),Cu(n)}function vwe(e,t,n,i){if(!mwe.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];const o=[];let s=null,r=[],a=n,l=!1,u=0;for(const c of e){const d=pwe(c,i),f=d==="text"&&t;s===null||d!==s||f!==l?(s!==null&&o.push({text:Cu(r),isWordLike:l,kind:s,start:a}),s=d,r=[c],a=n+u,l=f,u+=c.length):(r.push(c),u+=c.length)}return s!==null&&o.push({text:Cu(r),isWordLike:l,kind:s,start:a}),o}function D5(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const ywe=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function kwe(e,t){const n=e.texts[t];return!!n.startsWith("www.")||ywe.test(n)&&t+1=33&&n<=47&&n!==45||n>=58&&n<=64&&n!==63||n>=91&&n<=96||n>=123&&n<=126})(t):!xwe.has(e)&&!Cwe.test(e)&&Awe.test(e)}function jR(e){let t=!1;for(const n of e)if(!Jf.test(n)){if(!bV(n))return!1;t=!0}return t}function Swe(e,t,n,i){const o=!t&&jR(e),s=!i&&jR(n),r=(function(l){const u=(function(c){for(let d=c.length;d>0;){const f=g4(c,d),h=c.slice(f,d);if(!Jf.test(h))return h;d=f}return null})(l);return u!==null&&v4(u)})(e),a=(t||r)&&(function(l){for(let u=l.length;u>0;){const c=g4(l,u),d=l.slice(c,u);if(!Jf.test(d))return bV(d)||v4(d);u=c}return!1})(e);return!!(o||s||a)&&!xc(e)&&!xc(n)&&(t||o||r)&&(i||s)}function HR(e){for(const t of e)if(k_.test(t))return!0;return!1}function zk(e){if(e.length===0)return!1;for(const t of e)if(!k_.test(t)&&!wwe.has(t))return!1;return!0}function _we(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];const n=[];let i=0;for(let o=0;o0&&u.charCodeAt(u.length-1)===32&&(u=u.slice(0,-1)),u})(e);if(s.length===0)return{normalized:s,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const r=(function(l,u,c){var d,f,h;const m=(R5===null&&(R5=new Intl.Segmenter(void 0,{granularity:"word"})),R5);let g=0;const y=[],b=[],v=[],w=[],A=[],M=[],L=[],E=[],C=[],x=[],_=[],F=[];for(const T of m.segment(l))for(const R of vwe(T.segment,(d=T.isWordLike)!=null&&d,T.index,c)){let P=function(){M[ee]!==null&&(b[ee]=[$R(y,M,L,ee)],M[ee]=null),b[ee].push(R.text),v[ee]=v[ee]||R.isWordLike,E[ee]=E[ee]||K,C[ee]=C[ee]||X,x[ee]=Q,_[ee]=ie,F[ee]=zR(C[ee],V)};const j=R.kind==="text",B=dwe(R.text,R.isWordLike,R.kind),K=xc(R.text),X=PR(R.text),V=Lv(R.text),Q=o7(R.text),ie=fwe(R.text),ee=g-1;u.carryCJKAfterClosingQuote&&j&&g>0&&w[ee]==="text"&&K&&E[ee]&&x[ee]||j&&g>0&&w[ee]==="text"&&rwe(R.text)&&E[ee]||j&&g>0&&w[ee]==="text"&&_[ee]?P():j&&g>0&&w[ee]==="text"&&R.isWordLike&&X&&F[ee]?(P(),v[ee]=!0):B!==null&&g>0&&w[ee]==="text"&&M[ee]===B?L[ee]=((f=L[ee])!=null?f:1)+1:j&&!R.isWordLike&&g>0&&w[ee]==="text"&&!E[ee]&&(swe(R.text)||R.text==="-"&&v[ee])?P():(y[g]=R.text,b[g]=[R.text],v[g]=R.isWordLike,w[g]=R.kind,A[g]=R.start,M[g]=B,L[g]=B===null?0:1,E[g]=K,C[g]=X,x[g]=Q,_[g]=ie,F[g]=zR(X,V),g++)}for(let T=0;Tnull);let D=-1;for(let T=g-1;T>=0;T--){const R=y[T];if(R.length!==0){if(w[T]==="text"&&!v[T]&&D>=0&&w[D]==="text"&&(awe(R)||R==="-"&&uwe(y[D]))){const P=(h=I[D])!=null?h:[];P.push(R),I[D]=P,A[D]=A[T],y[T]="";continue}D=T}}for(let T=0;TK+1){R.push(Cu(ie)),P.push(Ce),j.push("text"),B.push(T.starts[K]),K=ee;continue}}R.push(X),P.push(Q),j.push(V),B.push(T.starts[K]),K++}return{len:R.length,texts:R,isWordLike:P,kinds:j,starts:B}})((function(T){const R=[],P=[],j=[],B=[];for(let K=0;K1;for(let ie=0;ie=T.len||D5(T.kinds[V]))continue;const Q=[],ie=T.starts[V];let ee=V;for(;ee0&&(R.push(Cu(Q)),P.push(!0),j.push("text"),B.push(ie),K=ee-1)}return{len:R.length,texts:R,isWordLike:P,kinds:j,starts:B}})((function(T){const R=T.texts.slice(),P=T.isWordLike.slice(),j=T.kinds.slice(),B=T.starts.slice();for(let X=0;X=0&&!kV(u.texts[w-1],c)&&v(w),g<0&&(g=w),y=y||xc(A))}return v(u.len),{len:d.length,texts:d,isWordLike:f,kinds:h,starts:m}})(s,r,t.breakKeepAllAfterPunctuation):r;return Dt({normalized:s,chunks:_we(a,o)},a)}let D1=null;const WR=new Map;let O1=null;const Mwe=new RegExp("\\p{Emoji_Presentation}","u"),Twe=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let O5=null;const qR=new Map;function s7(){if(D1!==null)return D1;if(typeof OffscreenCanvas<"u")return D1=new OffscreenCanvas(1,1).getContext("2d"),D1;if(typeof document<"u")return D1=document.createElement("canvas").getContext("2d"),D1;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function of(e,t){let n=t.get(e);return n===void 0&&(n={width:s7().measureText(e).width,containsCJK:xc(e)},t.set(e,n)),n}function y4(){if(O1!==null)return O1;if(typeof navigator>"u")return O1={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,breakKeepAllAfterPunctuation:!0,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},O1;const e=navigator.userAgent,t=navigator.vendor==="Apple Computer, Inc."&&e.includes("Safari/")&&!e.includes("Chrome/")&&!e.includes("Chromium/")&&!e.includes("CriOS/")&&!e.includes("FxiOS/")&&!e.includes("EdgiOS/"),n=e.includes("Chrome/")||e.includes("Chromium/")||e.includes("CriOS/")||e.includes("Edg/");return O1={lineFitEpsilon:t?1/64:.005,carryCJKAfterClosingQuote:n,breakKeepAllAfterPunctuation:!t,preferPrefixWidthsForBreakableRuns:t,preferEarlySoftHyphenBreak:t},O1}function wV(){return O5===null&&(O5=new Intl.Segmenter(void 0,{granularity:"grapheme"})),O5}function Ewe(e){return Mwe.test(e)||e.includes("️")}function jh(e,t,n){return n===0?t.width:t.width-(function(i,o){return o.emojiCount===void 0&&(o.emojiCount=(function(s){let r=0;const a=wV();for(const l of a.segment(s))Ewe(l.segment)&&r++;return r})(i)),o.emojiCount})(e,t)*n}function Lwe(e){return e==="space"||e==="zero-width-break"||e==="soft-hyphen"}function UR(e){return e==="space"||e==="preserved-space"||e==="tab"||e==="zero-width-break"||e==="soft-hyphen"}function VR(e,t,n=e.widths.length){for(;t0?e.letterSpacing:0}function C_(e,t){return t===0?0:e+t}function Rwe(e,t,n,i,o){return C_(i,t==="tab"?o+(function(s,r){return s.letterSpacing!==0&&s.spacingGraphemeCounts[r]>0?s.letterSpacing:0})(e,n):e.lineEndFitAdvances[n])}function KR(e,t,n,i){return C_(i,t==="tab"?0:e.lineEndFitAdvances[n])}function ZR(e,t,n,i,o){return C_(i,t==="tab"?o:e.lineEndPaintAdvances[n])}function Dwe(e,t,n){return e.letterSpacing!==0&&t?n+e.letterSpacing:n}function Owe(e,t){return e.letterSpacing===0?t:t+e.letterSpacing}function S9(e,t,n){let i=t;for(;iP){if(me!==null&&oe>U){ee(te,oe,re),ve=oe,ge=S9(me,ge,ve+1),oe=-1,re=0;continue}ee(),Z(te,ve,le)}else B+=le,X=te,V=ve+1;else Z(te,ve,le);const xe=ve+1;me!==null&&me[ge]===xe&&(oe=xe,re=B,ge++),ve++}K&&X===te&&V===ce.length&&(X=te+1,V=0)}let J=0;for(;J=H.length)));){const te=H[J],U=UR($[J]);if(K)if(B+te>P){if(U){ae(J,te),ee(J+1,0,B-te),J++;continue}if(Q>=0){if(X>Q||X===Q&&V>0){ee();continue}ee(Q,0,ie);continue}if(te>P&&T[J]!==null){ee(),he(J,0),J++;continue}ee()}else ae(J,te),U&&(Q=J+1,ie=B-te),J++;else te>P&&T[J]!==null?he(J,0):Ce(J,te),U&&(Q=J+1,ie=B-te),J++}return K&&ee(),j})(n,i);const{widths:o,kinds:s,breakableFitAdvances:r,breakablePreferredBreaks:a,discretionaryHyphenWidth:l,chunks:u}=n;if(o.length===0||u.length===0)return 0;const c=y4(),d=i+c.lineFitEpsilon;let f=0,h=0,m=!1,g=0,y=0,b=-1,v=0,w=null;function A(){b=-1,v=0,w=null}function M(I=g,D=y,H){f++,h=0,m=!1,A()}function L(I,D){m=!0,g=I+1,y=0,h=D}function E(I,D,H){m=!0,g=I,y=D+1,h=H}function C(I,D){m?(h+=D,g=I+1,y=0):L(I,D)}function x(I,D,H,$,T,R){if(!D)return;const P=KR(n,I,H,T);ZR(n,I,H,T,$),b=H+1,v=h-R+P,w=I}function _(I,D){var H;const $=r[I],T=(H=a[I])!=null?H:null;let R=T===null?-1:S9(T,0,D+1),P=-1,j=D;for(;j<$.length;){const B=$[j];if(m){const X=Dwe(n,!0,B),V=h+X;if(Owe(n,V)>d){if(T!==null&&P>D){M(I,P),j=P,R=S9(T,R,j+1),P=-1;continue}M(),E(I,j,B)}else h=V,g=I,y=j+1}else E(I,j,B);const K=j+1;T!==null&&T[R]===K&&(P=K,R++),j++}m&&g===I&&y===$.length&&(g=I+1,y=0)}function F(I){f++,A()}for(let I=0;I=D.endSegmentIndex)));){const $=s[H],T=UR($),R=Fwe(n,m,H),P=$==="tab"?Nwe(h+R,n.tabStopAdvance):o[H],j=R+P,B=Rwe(n,$,H,R,P);if($!=="soft-hyphen")if(m){if(h+B>d){const K=h+KR(n,$,H,R);if(ZR(n,$,H,R,P),w==="soft-hyphen"&&c.preferEarlySoftHyphenBreak&&v<=d){M(b,0);continue}if(T&&K<=d){C(H,j),M(H+1,0),H++;continue}if(b>=0&&v<=d){if(g>b||g===b&&y>0){M();continue}const X=b;M(X,0),H=X;continue}if(B>d&&r[H]!==null){M(),_(H,0),H++;continue}M();continue}C(H,j),x($,T,H,P,R,j),H++}else B>d&&r[H]!==null?_(H,0):L(H,P),x($,T,H,P,R,j),H++;else m&&(g=H+1,y=0,b=H+1,v=h+l,w=$),H++}m&&(D.consumedEndSegmentIndex,M(D.consumedEndSegmentIndex,0))}return f})(e,t)}let P5=null;function x_(){return P5===null&&(P5=new Intl.Segmenter(void 0,{granularity:"grapheme"})),P5}function Bwe(e,t){const n=[];let i=[],o=0,s=!1,r=!1,a=!1;function l(){i.length!==0&&(n.push({text:i.length===1?i[0]:i.join(""),start:o}),i=[],s=!1,r=!1,a=!1)}function u(d,f,h){i=[d],o=f,s=h,r=o7(d),a=t3.has(d)}function c(d,f){i.push(d),s=s||f;const h=o7(d);r=d.length===1&&Up.has(d)&&r||h,a=!1}for(const d of x_().segment(e)){const f=d.segment,h=xc(f);i.length!==0?a||b_.has(f)||Up.has(f)||t.carryCJKAfterClosingQuote&&h&&r?c(f,h):s||h?(l(),u(f,d.index,h)):c(f,h):u(f,d.index,h)}return l(),n}function $we(e,t,n){if(t.length<=1)return t;const i=[];let o=-1,s=!1;function r(a){if(!(o<0)){if(s)o+1===a?i.push(t[o]):(function(l,u){const c=t[l].start,d=u=0&&!kV(t[a-1].text,n)&&r(a),o<0&&(o=a),s=s||xc(l.text)}return r(t.length),i}function GR(e,t){if(t==="zero-width-break"||t==="soft-hyphen"||t==="hard-break")return 0;if(t==="tab")return 1;let n=0;const i=x_();for(const o of i.segment(e))n++;return n}function zwe(e){return e==="-"||e==="֊"||e==="‐"||e==="‒"||e==="–"||e==="—"}function jwe(e,t,n,i,o){const s=y4(),{cache:r,emojiCorrection:a}=(function(F,I){s7().font=F;const D=(function(T){let R=WR.get(T);return R||(R=new Map,WR.set(T,R)),R})(F),H=(function(T){const R=T.match(/(\d+(?:\.\d+)?)\s*px/);return R?parseFloat(R[1]):16})(F),$=I?(function(T,R){let P=qR.get(T);if(P!==void 0)return P;const j=s7();j.font=T;const B=j.measureText("😀").width;if(P=0,B>R+.5&&typeof document<"u"&&document.body!==null){const K=document.createElement("span");K.style.font=T,K.style.display="inline-block",K.style.visibility="hidden",K.style.position="absolute",K.textContent="😀",document.body.appendChild(K);const X=K.getBoundingClientRect().width;document.body.removeChild(K),B-X>.5&&(P=B-X)}return qR.set(T,P),P})(F,H):0;return{cache:D,fontSize:H,emojiCorrection:$}})(t,(l=e.normalized,Twe.test(l)));var l;const u=jh("-",of("-",r),a)+(o===0?0:2*o),c=8*jh(" ",of(" ",r),a),d=o!==0;if(e.len===0)return{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],breakablePreferredBreaks:[],letterSpacing:0,spacingGraphemeCounts:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[]};const f=[],h=[],m=[],g=[];let y=e.chunks.length<=1&&!d;const b=null,v=[],w=[],A=[],M=null,L=Array.from({length:e.len});function E(F,I,D,H,$,T,R,P,j){$!=="text"&&$!=="space"&&$!=="zero-width-break"&&(y=!1),f.push(I),h.push(D),m.push(H),g.push($),v.push(R),w.push(P),d&&A.push(j)}function C(F,I,D,H,$){const T=of(F,r),R=d?GR(F,I):0,P=(function(X,V,Q){return V>1?X+(V-1)*Q:X})(jh(F,T,a),R,o),j=I==="space"||I==="preserved-space"||I==="zero-width-break"?0:P,B=j===0?0:j+(R>0?o:0),K=I==="space"||I==="zero-width-break"?0:P;if($&&H&&F.length>1){let X="sum-graphemes";o!==0?X="segment-prefixes":zk(F)?X="pair-context":s.preferPrefixWidthsForBreakableRuns&&(X="segment-prefixes");const V=(function(ie,ee,Ce,Z,ae){if(ee.breakableFitAdvances!==void 0&&ee.breakableFitMode===ae)return ee.breakableFitAdvances;ee.breakableFitMode=ae;const he=wV(),J=[];for(const ce of he.segment(ie))J.push(ce.segment);if(J.length<=1)return ee.breakableFitAdvances=null,ee.breakableFitAdvances;if(ae==="sum-graphemes"){const ce=[];for(const me of J){const ge=of(me,Ce);ce.push(jh(me,ge,Z))}return ee.breakableFitAdvances=ce,ee.breakableFitAdvances}if(ae==="pair-context"||J.length>96){const ce=[];let me=null,ge=0;for(const oe of J){const re=jh(oe,of(oe,Ce),Z);if(me===null)ce.push(re);else{const ve=me+oe,le=of(ve,Ce);ce.push(jh(ve,le,Z)-ge)}me=oe,ge=re}return ee.breakableFitAdvances=ce,ee.breakableFitAdvances}const te=[];let U="",Y=0;for(const ce of J){U+=ce;const me=jh(U,of(U,Ce),Z);te.push(me-Y),Y=me}return ee.breakableFitAdvances=te,ee.breakableFitAdvances})(F,T,r,a,X),Q=V===null||i==="keep-all"?null:(function(ie){if(!/[-\u058A\u2010\u2012\u2013\u2014]/u.test(ie))return null;const ee=[];let Ce=0;for(const Z of x_().segment(ie))Ce++,zwe(Z.segment)&&ee.push(Ce);return ee.length===0?null:ee})(F);return void E(F,P,B,K,I,D,V,Q,R)}E(F,P,B,K,I,D,null,null,R)}for(let F=0;F=55296&&ie<=56319&&Q+1=56320&&ae<=57343&&(ee=ae-56320+(ie-55296<<10)+65536,Ce=2)}const Z=Q4e(ee);Z!=="R"&&Z!=="AL"&&Z!=="AN"||(P=!0);for(let ae=0;ae=0&&R[ie]==="ET";ie--)R[ie]="EN";for(ie=Q+1;ie0?R[Q-1]:X)!=="L"?"R":"L";if(ee===((ie{const e=globalThis;if(e[B5])return e[B5];const t={configs:{},controllers:{},revision:au(0),preparedCache:new Map,blockEstimateCache:new Map};return e[B5]=t,t})();let y0=null;const $5=Ls.revision;function QR(e){var t;return e&&(t=Ls.configs[e])!=null?t:null}function YR(e,t){const n=Number.parseFloat(String(e??""));return Number.isFinite(n)&&n>0?n:t}function Wwe(e){return e?.type==="text"||e?.type==="emoji"||e?.type==="hardbreak"}function z5(e){var t,n,i;if(!Array.isArray(e)||e.length===0)return null;let o="";for(const s of e){if(!Wwe(s))return null;s.type==="text"?o+=String((t=s.content)!=null?t:""):s.type==="emoji"?o+=String((i=(n=s.name)!=null?n:s.raw)!=null?i:""):s.type==="hardbreak"&&(o+=` +`)}return o.length>0?o:null}function j5(e,t,n){var i,o;if(!e||!Number.isFinite(t)||t<=0||!(function(){var s;if(y0!=null)return y0;if(typeof document>"u")return!1;try{const r=document.createElement("canvas");return y0=!!((s=r.getContext)!=null&&s.call(r,"2d")),y0}catch{return y0=!1,!1}})())return null;try{const s=Math.round(100*t)/100,r=[(i=n.whiteSpace)!=null?i:"pre-wrap",n.font,n.lineHeight,n.wrapperOverhead,n.widthAdjustment,s,e].join("\0"),a=Ls.blockEstimateCache.get(r);if(a)return Ls.blockEstimateCache.delete(r),Ls.blockEstimateCache.set(r,a),{kind:"simple-text",height:a.height,contentHeight:a.contentHeight};const l=(o=n.whiteSpace)!=null?o:"pre-wrap",u=(function(h,m,g){const y=`${g}\0${m}\0${h}`,b=Ls.preparedCache.get(y);if(b)return Ls.preparedCache.delete(y),Ls.preparedCache.set(y,b),b.prepared;const v=(function(w,A,M){return(function(L,E,C,x){var _,F;const I=(_=x?.wordBreak)!=null?_:"normal",D=(F=x?.letterSpacing)!=null?F:0;return jwe(Iwe(L,y4(),x?.whiteSpace,I),E,!1,I,D)})(w,A,0,M)})(h,m,{whiteSpace:g});for(Ls.preparedCache.set(y,{prepared:v});Ls.preparedCache.size>240;){const w=Ls.preparedCache.keys().next().value;if(!w)break;Ls.preparedCache.delete(w)}return v})(e,n.font,l),c=(function(h,m,g){const y=Pwe(h,m);return{lineCount:y,height:y*g}})(u,Math.max(24,s-n.widthAdjustment),n.lineHeight),d=Math.max(n.lineHeight,c.height),f=Math.max(n.lineHeight,Math.round(d+n.wrapperOverhead));for(Ls.blockEstimateCache.set(r,{height:f,contentHeight:Math.round(d)});Ls.blockEstimateCache.size>4e3;){const h=Ls.blockEstimateCache.keys().next().value;if(!h)break;Ls.blockEstimateCache.delete(h)}return{kind:"simple-text",height:f,contentHeight:Math.round(d)}}catch{return null}}function AV(e,t,n){var i,o;if(!n||!e||!Number.isFinite(t)||t<=0)return null;if(e.type==="paragraph"){const s=z5(e.children);return s&&n.paragraph?j5(s,t,n.paragraph):null}if(e.type==="heading"){const s=Number(e.level||0),r=z5(e.children),a=n.headings[s];return r&&a?j5(r,t,a):null}if(e.type==="list_item"){const s=Array.isArray(e.children)?e.children:[];if(s.length!==1||((i=s[0])==null?void 0:i.type)!=="paragraph"||!n.listItem)return null;const r=z5((o=s[0])==null?void 0:o.children);return r?j5(r,t,n.listItem):null}if(e.type==="list"){const s=Array.isArray(e.items)?e.items:[];if(!s.length)return null;let r=Math.max(0,n.listWrapperOverhead);for(const a of s){const l=AV(a,t,n);if(!l)return null;r+=l.height}return{kind:"simple-text",height:Math.max(1,Math.round(r)),contentHeight:Math.max(1,Math.round(r))}}return null}function k0(e){if(!e)return 1;const t=String(e).split(/\r?\n/);return Math.max(1,t.length)}function Hh(e,t){const n=String(e??"");return t?n:n.replace(/\r\n$|\n$|\r$/,"")}function H5(e,t,n=0){return e.diff?y_(t??{},n)?(function(i){const o=Hh(i.raw);if(o){const s=o.split(/\r?\n/);return i.originalCode!=null||i.updatedCode!=null?Math.max(1,s.filter(r=>!Hwe.some(a=>r.startsWith(a))).length):Math.max(1,s.length)}return k0(Hh(i.originalCode))+k0(Hh(i.updatedCode))})(e):(function(i){const o=i.originalCode,s=i.updatedCode;if(o!=null||s!=null)return Math.max(k0(Hh(o)),k0(Hh(s)));const r=Hh(i.code).split(/\r?\n/);let a=0,l=0;for(const u of r)u.startsWith("+")&&!u.startsWith("+++")?l++:u.startsWith("-")&&!u.startsWith("---")?a++:(a++,l++);return Math.max(1,a,l)})(e):k0(Hh(e.code,e.loading===!0))}function qwe(e){return e?`${e.fontStyle||"normal"} ${e.fontWeight||"400"} ${e.fontSize||"16px"} ${e.fontFamily||"sans-serif"}`:""}function W5(e,t,n="pre-wrap"){if(!e||!t||typeof window>"u")return null;const i=window.getComputedStyle(t),o=e.offsetHeight,s=YR(i.lineHeight,1.5*YR(i.fontSize,16)),r=e.getBoundingClientRect().width,a=t.getBoundingClientRect().width;return{font:qwe(i),lineHeight:s,wrapperOverhead:Math.max(0,o-s),widthAdjustment:Math.max(0,r-a),whiteSpace:n}}const Uwe=new Set(["node","key","ref","ctx","renderNode","indexKey","__proto__","prototype","constructor"]);function JR(e,t={}){var n;const i={},o=new Set((n=t.omit)!=null?n:[]);if(!e||typeof e!="object")return i;const s=Object.getOwnPropertyDescriptors(e);for(const[r,a]of Object.entries(s))Uwe.has(r)||o.has(r)||a.enumerable&&"value"in a&&(i[r]=a.value);return i}function XR(e,t,n,i){var o;const s=(function(f){return Math.max(0,Math.ceil(f.scrollHeight||0)-Math.ceil(f.clientHeight||0))})(e),r=(function(f,h){return Number.isFinite(f)?Math.min(Math.max(0,f),h):0})(n,s);if(!i.isReverseFlexScrollRoot(e))return void(e.scrollTop=r);const a=Math.max(0,s-r),l=[-a,a];let u=l[0],c=Number.POSITIVE_INFINITY;for(const f of l){e.scrollTop=f;const h=i.getNormalizedScrollTop(e,t,!1),m=Math.abs(h-r);md&&(e.scrollTop=u)}function eD(e,t){let n=0,i=null,o=null;const s=()=>{const r=o;o=null,i=null,r&&(n=Date.now(),e(...r))};return function(...r){const a=Date.now(),l=t-(a-n);o=r,l<=0?(i&&(clearTimeout(i),i=null),n=a,o=null,e(...r)):i||(i=setTimeout(s,l))}}function tD(e){return e==="simple"?"simple":e===!0||e==="true"||e==="precise"?"precise":"off"}const CV=Symbol("MarkstreamMathBlockMinHeightCache");function r6t(){return en(CV,null)}const Vwe=new Set(["text","inline_code","emoji","footnote_reference"]),Kwe=new Set(["strong","emphasis","strikethrough","highlight","insert","subscript","superscript","link"]);function b0(e){const t=Number(e);return!Number.isFinite(t)||t<=0?-1:Math.round(t/32)}function Wh(e,t,n,i=22){const o=String(e??"");if(!o)return n;const s=Math.max(18,Math.floor(Math.max(320,t)/8)),r=o.split(/\r?\n/).length,a=Math.ceil(o.length/s),l=Math.max(1,r,a);return Math.max(n,Math.ceil(l*i+12))}function xV(e){var t;if(!e||typeof e!="object")return!1;const n=e,i=String((t=n.type)!=null?t:"");if(Vwe.has(i))return!0;if(!Kwe.has(i))return!1;const o=n.children;return!Array.isArray(o)||!o.length||o.every(xV)}function r7(e){var t,n,i,o,s,r,a,l;if(!e||typeof e!="object")return"";const u=e,c=String((t=u.type)!=null?t:"");if(c==="text")return String((i=(n=u.content)!=null?n:u.raw)!=null?i:"");if(c==="inline_code")return String((r=(s=(o=u.code)!=null?o:u.content)!=null?s:u.raw)!=null?r:"");if(c==="emoji")return String((l=(a=u.name)!=null?a:u.raw)!=null?l:"");if(typeof u.text=="string")return u.text;const d=[];for(const f of["children","items","cells","rows"]){const h=u[f];if(Array.isArray(h)){const m=h.map(r7).filter(Boolean).join(" ");m&&d.push(m)}}return d.join(" ").replace(/\s+/g," ").trim()}function SV(e){if(!e||typeof e!="object")return!1;const t=e;return t.type==="inline_code"||["children","items","cells","rows"].some(n=>{const i=t[n];return Array.isArray(i)&&i.some(SV)})}function Zwe(e,t){if(!e)return 30;const n=Math.max(18,Math.floor(Math.max(320,t)/8)),i=e.split(/\r?\n/).length,o=Math.ceil(e.length/n),s=Math.max(1,i,o);return 30+26*Math.max(0,s-1)}function Gwe(e,t){var n,i,o,s,r,a,l,u,c,d,f,h,m,g;if(!e||typeof e!="object")return 32;const y=e,b=String((n=y.type)!=null?n:""),v=Number.isFinite(t)&&t>0?t:640;switch(b){case"heading":return(function(w){var A;const M=Number((A=w.level)!=null?A:w.depth);return M>=4?20:M===3?30:M===2?32:44})(y);case"paragraph":return(function(w,A){const M=String(w??"");if(!M)return 28;const L=Math.max(18,Math.floor(Math.max(320,A)/8)),E=M.split(/\r?\n/).length,C=Math.ceil(M.length/L);return Math.max(1,E,C)<=1?28:Wh(M,A,34)})(String((o=(i=y.raw)!=null?i:y.content)!=null?o:""),v);case"list":return(function(w,A){var M;const L=Array.isArray(w.items)?w.items:[];if(!L.length)return 48;const E=Math.max(48,30*L.length+12);let C=12;for(const F of L)C+=Zwe(r7(F)||String((M=F.raw)!=null?M:""),A);const x=Math.max(0,C-E);if(L.length>20){const F=Math.round(2.4*L.length);return Math.round(E+Math.max(F,Math.min(x,3*L.length)))}if(x<=0)return E;const _=L.length>8?8*L.length:x;return Math.round(E+Math.min(x,_))})(y,v);case"list_item":return Wh(String((r=(s=y.raw)!=null?s:y.content)!=null?r:""),v,34);case"blockquote":return Wh(String((l=(a=y.raw)!=null?a:y.content)!=null?l:""),v,56);case"table":return(function(w,A){const M=[...w.header?[w.header]:[],...Array.isArray(w.rows)?w.rows:[]];if(!M.length){const L=Array.isArray(w.children)?w.children.length:3;return Math.max(120,38*L+48)}return Math.max(120,Math.round(4+M.reduce((L,E)=>L+(function(C,x){const _=Math.max(1,C.length),F=Math.max(80,(x-32)/_),I=Math.max(10,Math.floor(F/8)),D=Math.max(1,...C.map(H=>{var $;const T=r7(H)||String(($=H?.raw)!=null?$:"");return Math.ceil(T.length/I)||1}));return 54+34*Math.max(0,D-1)+(_<=3&&C.some(SV)?14:0)})((function(C){var x;return Array.isArray(C?.cells)&&(x=C.cells)!=null?x:[]})(E),A),0)))})(y,v);case"code_block":{const w=String((u=y.language)!=null?u:"").trim().toLowerCase(),A=String((d=(c=y.code)!=null?c:y.raw)!=null?d:"");return w==="mermaid"?c4(l4(A)):w==="infographic"?d4(u4(A)):Wh(A,v,96,20)}case"math_block":return 72;case"image":return 220;case"admonition":case"vmr_container":case"html_block":return(function(w,A){var M,L,E;const C=w.match(/^\s*]*)>/i);return C&&!/(?:^|\s)open(?:\s|=|$)/i.test((M=C[1])!=null?M:"")?Wh(((E=(L=w.match(/]*>([\s\S]*?)<\/summary>/i))==null?void 0:L[1])==null?void 0:E.replace(/<[^>]*>/g,"").trim())||"Details",A,28,28):Wh(w,A,96)})(String((h=(f=y.raw)!=null?f:y.content)!=null?h:""),v);case"thematic_break":return 24;default:return Wh(String((g=(m=y.raw)!=null?m:y.content)!=null?g:""),v,40)}}function nD(e,t,n){return Math.min(Math.max(e,t),n)}const Qwe=["total","cacheHits","appendHits","tailHits","fullParses","chunkedParses"],Ywe=["tokenCloneMs","processTokensInputTokens","processTokensReusedTopLevelNodes","processTokensMs","safeMarkdownMs","tokenizeMs","htmlBlockPassesMs","parseMarkdownToStructureTotalMs"],Jwe=new Set(["attrs","data","items","header","payload","props","rows","cells","term","definition","sourceMap"]),_V=["raw","content","code","originalCode","updatedCode"],iD=new WeakMap,oD=new WeakMap;let Xwe=1;function wu(){return typeof performance<"u"?performance.now():Date.now()}function sD(e){const t=e.stream;return t&&typeof t.stats=="function"?t.stats():null}function ul(e){if(typeof e!="object"&&typeof e!="function"||e===null)return"";const t=e;let n=iD.get(t);return n||(n=Xwe++,iD.set(t,n)),String(n)}function rD(e,t,n,i={}){var o,s;const r=i.includeFinal!==!1,a={md:ul(t),customMarkdownIt:ul(n),requireClosingStrong:e.requireClosingStrong===!0,customHtmlTags:(o=e.customHtmlTags)!=null?o:[],includeSourceMap:e.includeSourceMap===!0,streamParse:(s=e.streamParse)!=null?s:"auto",validateLink:ul(e.validateLink),preTransformTokens:ul(e.preTransformTokens),postTransformTokens:ul(e.postTransformTokens),postTransformNodes:ul(e.postTransformNodes)};return r&&(a.final=e.final===!0),JSON.stringify(a)}function aD(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===10;)t-=1;const n=e.lastIndexOf(` +`,t-1)+1;return e.slice(n,t).trim()}function lD(e){const t=IV(e);return t.length>=2&&t.every(n=>{const i=n.trim();return i.length>=1&&i.replace(/^:/,"").replace(/:$/,"").split("").every(o=>o==="-")})}function IV(e){return e.includes("|")?e.replace(/^\|/,"").replace(/\|$/,"").split("|"):[]}function MV(e){let t=2166136261;for(let n=0;n>>0).toString(36)}function S_(e){const t=String(e??"");return`${t.length}:${MV(t)}`}function a7(e,t=new WeakMap,n=0){if(e==null||typeof e=="number"||typeof e=="boolean")return String(e);if(typeof e=="string")return`s:${(function(r){return r.length<=8192?S_(r):`${r.length}:${MV(r.slice(0,8192))}:truncated`})(e)}`;if(typeof e=="function")return`fn:${ul(e)}`;if(typeof e!="object")return typeof e;const i=e,o=t.get(i);if(o)return`cycle:${o}`;if(n>=6)return`object:${ul(i)}`;const s=ul(i);if(t.set(i,s),Array.isArray(e)){const r=e.slice(0,200);return`a:${e.length}:${r.map(a=>a7(a,t,n+1)).join(",")}`}if(typeof e=="object"){const r=e,a=Object.keys(r).sort(),l=a.slice(0,80);return`o:${a.length}:${l.sort().map(u=>`${u}:${a7(r[u],t,n+1)}`).join(";")}`}return typeof e}function k4(e){return typeof e=="object"&&e!==null&&typeof e.type=="string"&&typeof e.raw=="string"}function TV(e,t=new WeakMap,n=0){return Array.isArray(e)?`a:${e.length}:${e.slice(0,200).map(i=>k4(i)?Xf(i,t,n+1):TV(i,t,n+1)).join(",")}`:k4(e)?Xf(e,t,n):a7(e,t,n)}function e3e(e,t,n){return Object.keys(e).sort().filter(i=>i!=="children"&&!_V.includes(i)).map(i=>{const o=e[i];return typeof o=="string"?`${i}=s:${S_(o)}`:typeof o=="number"||typeof o=="boolean"||o==null?`${i}=${String(o)}`:typeof o=="function"?`${i}=fn:${ul(o)}`:Jwe.has(i)&&(Array.isArray(o)||typeof o=="object")?`${i}=${TV(o,t,n+1)}`:o&&typeof o=="object"?`${i}=object:${ul(o)}`:""}).filter(Boolean).join(";")}function t3e(e){return _V.map(t=>{const n=e[t];return typeof n=="string"?`${t}=s:${S_(n)}`:""}).filter(Boolean).join(";")}function Xf(e,t=new WeakMap,n=0){const i=oD.get(e);if(i)return i;const o=e,s=t.get(o);if(s)return`node-cycle:${s}`;if(n>=6)return`node:${e.type}:${ul(o)}`;const r=ul(o);t.set(o,r);const a=(function(l,u,c){const d=l,f=Array.isArray(d.children)?d.children:[],h=f.length?f.slice(0,200).map(m=>Xf(m,u,c+1)).join("|"):"";return[l.type,t3e(d),e3e(d,u,c),f.length,h].join(":")})(e,t,n);return oD.set(o,a),a}function EV(e,t){return Xf(e)===Xf(t)}function __(e,t,n){const i=wu(),o=t==="stabilizeSignatureMs"?"stabilizeSignatureCallCount":"primeSignatureCallCount";try{return n()}finally{e[t]+=wu()-i,e[o]+=1,e.signatureMs=e.stabilizeSignatureMs+e.primeSignatureMs,e.signatureCallCount=e.stabilizeSignatureCallCount+e.primeSignatureCallCount}}function uD(e,t,n){return __(t,n,()=>Xf(e))}function LV(e,t,n){return uD(e,n,"stabilizeSignatureMs")===uD(t,n,"stabilizeSignatureMs")}function _9(e){return{reusedNodeCount:0,dirtyStartIndex:e>0?0:-1,stablePrefixNodeCount:0,dirtyTailNodeCount:e}}function cD(e,t,n){return e<0?0:Math.max(t.length,n.length)-e}function dD(e){return e.__markstreamHasCustomParserExtensions===!0||(function(t){var n;return Number((n=t.__markstreamRegisteredPluginCount)!=null?n:0)>0})(e)}function n3e(e,t){return e.length===t.length&&e===t}function I_(e,t,n=0){if(n>=4)return null;if(e.type!==t.type)return!1;const i=e,o=t,s=Object.keys(i).filter(c=>c!=="type"&&c!=="children").sort(),r=Object.keys(o).filter(c=>c!=="type"&&c!=="children").sort();if(s.length!==r.length)return!1;for(let c=0;c{i=I_(e,t)}),i??LV(e,t,n)}function s3e(e,t){const n={};for(const i of Qwe){const o=e[i],s=t?.[i];typeof o=="number"&&(n[i]=o-(typeof s=="number"?s:0))}return n}function r3e(e,t){var n;const i=rR(t.instanceMsgId),o=new Map,s=(n=t.smoothStreamingEnabled)!=null?n:O(()=>!1),r=q(t.renderContent.value);let a=[],l="",u="",c="",d=!1;const f=(function(){let H="",$=0,T=!1,R=!1,P=!1,j=!1;function B(){H="",$=0,T=!1,R=!1,P=!1,j=!1}function K(X){let V=!1;for(let Q=0;Q{if(!X||!V.startsWith(X)||V.length<=X.length)return B(),[!0,0];let Q=0;H!==X&&(B(),K(X),Q=X.length);const ie=V.slice(X.length),ee=K(ie);return H=V,[ee,Q+ie.length]}})();let h,m=0,g=0,y=wu(),b=-1,v=0;function w(H){b=Number.isInteger(H)?H:0,v+=1}function A(){h&&(clearTimeout(h),h=void 0)}function M(){A();const H=t.renderContent.value;r.value!==H&&(r.value=H),y=wu()}Be([t.renderContent,t.effectiveFinal,s],([H,$,T])=>{r.value!==H&&(!T||$||(function(R,P){if(!R&&P||P.length<=80||P.length\s*|`{3,}|~{3,})/.test(j))||j.endsWith(` +`)&&!(function(B){const K=aD(B);if(lD(K))return!1;const X=IV(K);return X.length>=2&&X.some(V=>V.trim())})(P))})(r.value,H)?M():(function(){if(g+=1,h)return;const R=Math.max(0,(function(P){const j=P.parseCoalesceMs;return typeof j=="number"&&Number.isFinite(j)&&j>=0?j:80})(e)-(wu()-y));R<=0?M():h=setTimeout(M,R)})())},{flush:"sync",immediate:!0}),Fd(A);const L=O(()=>{var H,$,T,R;return a0e(e.customHtmlTags,(H=e.parseOptions)==null?void 0:H.customHtmlTags,(R=(T=($=t.customComponentsMap)==null?void 0:$.value)!=null?T:{},Object.entries(R).map(([P,j])=>{const B=su(P);return j==null||!B||ry(B)||Bq.has(B)||ny.has(B)?"":B}).filter(Boolean)))}),E=O(()=>{const{key:H,tags:$}=l0e(L.value);if(!H)return i;const T=o.get(H);if(T)return T;const R=rR(t.instanceMsgId,{customHtmlTags:$});return o.set(H,R),R}),C=O(()=>{const H=E.value;if(!e.customMarkdownIt)return H;const $=e.customMarkdownIt(H);return H.__markstreamHasCustomParserExtensions=!0,$.__markstreamHasCustomParserExtensions=!0,$}),x=O(()=>{var H,$;const T=(H=e.parseOptions)!=null?H:{},R=t.effectiveFinal.value,P=L.value,j=R!=null,B=P.length>0;return j||B||T.streamParse==null?Dt(Dt(Pn(Dt({},T),{streamParse:($=T.streamParse)==null||$}),j?{final:R}:{}),B?{customHtmlTags:P}:{}):T}),_=O(()=>{var H;return new Set(((H=x.value.customHtmlTags)!=null?H:[]).map($=>String($).trim().toLowerCase()).filter(Boolean))}),F=O(()=>rD(x.value,C.value,e.customMarkdownIt,{includeFinal:!0})),I=O(()=>rD(x.value,C.value,e.customMarkdownIt,{includeFinal:!1}));Be([F,I],([H,$],[T,R])=>{T&&(H===T&&$===R||(M(),$!==R&&(a=[],c="")))},{flush:"sync"});const D=O(()=>{var H,$,T,R,P,j,B,K,X,V,Q;if((H=e.nodes)!=null&&H.length)return a=[],c="",w(0),Tt(e.nodes.slice());const ie=r.value;if(!ie)return a=[],c="",w(-1),[];const ee=t.debugPerformanceEnabled.value,Ce=ee?wu():0,Z=C.value,ae=F.value,he=I.value;l&&ae!==l&&(function(_e){var Fe,$e;($e=(Fe=_e.stream)==null?void 0:Fe.reset)==null||$e.call(Fe)})(Z),u&&he!==u&&(a=[],c="");const J=Object.keys((T=($=t.customComponentsMap)==null?void 0:$.value)!=null?T:{}).length>0||typeof x.value.postTransformNodes=="function";J!==d&&(a=[],c="");const te=!J&&a.length>0&&ie.startsWith(c)&&he===u,U=ee?sD(Z):null,Y=ee?{}:void 0,ce=dD(Z),me=!ce&&!J,ge=Dt(Dt(Pn(Dt({},x.value),{__reuseStableTopLevelNodes:me}),ce?{__disableStreamParse:!0}:{}),Y?{__timing:Y}:{}),oe=jU(ie,Z,ge),re=ee?wu():0,ve=ee?{signatureMs:0,stabilizeSignatureMs:0,primeSignatureMs:0,signatureCallCount:0,stabilizeSignatureCallCount:0,primeSignatureCallCount:0}:void 0;let le,xe=ee?_9(oe.length):void 0,be=0,pe=0,Te=0;if(te){const _e=ee?wu():0,[Fe,$e]=(function(ht){var Nt,Ot;const[_t,dt]=ht.scanGlobalReferenceAppend(ht.previousContent,ht.content),ue=ht.parseOptions;return[ht.previousDirtyStartIndex>0&&ue.final!==!0&&!ht.customMarkdownIt&&!dD(ht.md)&&!_t&&typeof ue.preTransformTokens!="function"&&typeof ue.postTransformTokens!="function"&&typeof ue.postTransformNodes!="function"&&((Ot=(Nt=ue.customHtmlTags)==null?void 0:Nt.length)!=null?Ot:0)===0?ht.previousDirtyStartIndex:0,dt]})({content:ie,previousContent:c,previousDirtyStartIndex:b,parseOptions:x.value,customMarkdownIt:e.customMarkdownIt,md:Z,scanGlobalReferenceAppend:f});Te=$e;const Je=Fe<=0;if(ve){const ht=(function(Nt,Ot,_t,dt={}){var ue;if(!Ot.length)return{nodes:Nt,metrics:_9(Nt.length)};const Le=(ue=dt.scanStartIndex)!=null?ue:0,Oe=dt.reuseDirtyTail!==!1,Ge=(function(Se,Ve,rt,He=0){const Xe=Math.min(Se.length,Ve.length);for(let Ye=Math.min(Xe,Math.max(0,He));YeXf(_e[Je]))})(le,ve,pe):(function(_e,Fe=0){for(let $e=Math.max(0,Fe);$e<_e.length;$e++)Xf(_e[$e])})(le,pe));const Ae=ee?wu()-re:0;if(m+=1,c=ie,l=ae,u=he,d=J,a=le,w((R=xe?.dirtyStartIndex)!=null?R:0),ee){const _e=sD(Z),Fe=typeof _e?.total=="number"&&_e.total>((P=U?.total)!=null?P:0);t.logPerf(Fe?"parse(stream)":"parse(sync)",Dt(Dt(Dt({rendererId:t.instanceMsgId,ms:Math.round(wu()-Ce),nodes:le.length,contentLength:ie.length,parseCommitCount:m,parseCoalescedCount:g,nodeReuseMs:Ae,referenceDefinitionScanChars:Te,signatureMs:(j=ve?.signatureMs)!=null?j:0,stabilizeSignatureMs:(B=ve?.stabilizeSignatureMs)!=null?B:0,primeSignatureMs:(K=ve?.primeSignatureMs)!=null?K:0,signatureCallCount:(X=ve?.signatureCallCount)!=null?X:0,stabilizeSignatureCallCount:(V=ve?.stabilizeSignatureCallCount)!=null?V:0,primeSignatureCallCount:(Q=ve?.primeSignatureCallCount)!=null?Q:0,stabilizeMs:be},xe??{}),Y?Object.fromEntries(Ywe.map($e=>{var Je;return[$e,(Je=Y[$e])!=null?Je:0]})):{}),_e?{streamMode:_e.lastMode,streamDelta:s3e(_e,U),streamStats:_e}:{}))}return Tt(le)});return{effectiveCustomHtmlTags:L,effectiveCustomHtmlTagsSet:_,mdBase:E,mdInstance:C,mergedParseOptions:x,getParsedNodesDirtyStartIndex:()=>b,getParsedNodesRevision:()=>v,parsedNodes:D}}function a3e(e){const{isClient:t}=e,n=q(new Set),i=new Map,o=new Map,s=new Map;function r(u){if(!t)return;const c=s.get(u);c!=null&&(window.clearTimeout(c),s.delete(u))}function a(){if(t)for(const u of s.values())window.clearTimeout(u);s.clear()}function l(){n.value=new Set}return{visibleNodeIndices:n,nodeVisibilityHandles:i,nodeVisibilityWatchStops:o,nodeVisibilityFallbackTimers:s,clearVisibilityFallback:r,clearAllVisibilityFallbacks:a,markNodeVisible:function(u,c=!0){var d;c&&r(u),(function(f,h){if((g=(m=e.shouldTrackVisibleNodeIndices)==null?void 0:m.call(e))!=null&&!g)return;var m,g;const y=n.value,b=y.has(f);if(h){if(b)return;const w=new Set(y);return w.add(f),void(n.value=w)}if(!b)return;const v=new Set(y);v.delete(f),n.value=v})(u,c),c&&((d=e.onNodeMarkedVisible)==null||d.call(e,u))},resetNodeVisibleState:l,cleanupNodeVisibility:function(u){var c;if(e.shouldCleanupNodeVisibility&&!e.shouldCleanupNodeVisibility())return;for(const[f,h]of o.entries())f{const c=o.getSnapshot();t.value=c.source,n.value=c.visible,i.value=c.done},r=o.subscribe(s);s();const a=O(()=>Math.max(0,t.value.length-n.value.length)),l=O(()=>a.value===0),u=O(()=>i.value&&l.value);return mg()&&Fd(()=>{r(),o.destroy()}),{source:t,visible:n,done:i,final:u,caughtUp:l,pendingChars:a,enqueue:c=>o.enqueue(c),finish:c=>o.finish(c),flush:()=>o.flush(),reset:c=>o.reset(c),pause:()=>o.pause(),resume:()=>o.resume()}}const u3e={maxCharsPerSecond:3e3,maxCommitFps:20,maxCharsPerCommit:160,catchUpLatencyMs:220,catchUpThreshold:400},fD=/auto|scroll|overlay/i;function c3e(e){if(!e)return!1;const t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();return fD.test(t)||fD.test(n)}function d3e(e){const t=Math.ceil(e.scrollHeight)>Math.ceil(e.clientHeight)+1,n=Math.ceil(e.scrollWidth)>Math.ceil(e.clientWidth)+1;return t||n}const f3e={class:"m-0 p-0"},h3e=["data-probe"],p3e=Ri(ot(Pn(Dt({},{name:"HeightEstimationProbes"}),{__name:"HeightEstimationProbes",props:{width:{},flowRoot:{type:Boolean},paragraphNode:{},listItemNode:{},listNode:{},headingNodes:{},setParagraphWrapper:{type:Function},setListItemWrapper:{type:Function},setListWrapper:{type:Function},setHeadingWrapper:{type:Function}},setup(e){const t=e;function n(i){var o,s;return(s=(o=t.headingNodes)==null?void 0:o[i])!=null?s:null}return(i,o)=>(k(),N("div",{class:"height-estimation-probes",style:an({width:`${e.width}px`}),"aria-hidden":"true"},[S("div",{ref:s=>e.setParagraphWrapper(s),class:De(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"paragraph"},[G(p(Np),{node:e.paragraphNode,"index-key":"probe-paragraph"},null,8,["node"])],2),S("div",{ref:s=>e.setListItemWrapper(s),class:De(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"list-item"},[S("ul",f3e,[G(p(Dm),{node:e.listItemNode,"index-key":"probe-list-item"},null,8,["node"])])],2),S("div",{ref:s=>e.setListWrapper(s),class:De(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"list"},[G(p(Om),{node:e.listNode,"index-key":"probe-list"},null,8,["node"])],2),(k(),N(Ne,null,wt(6,s=>S("div",{key:`probe-heading-${s}`,ref_for:!0,ref:r=>e.setHeadingWrapper(s,r),class:De(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":`heading-${s}`},[G(p(e3),{node:n(s),"index-key":`probe-heading-${s}`},null,8,["node","index-key"])],10,h3e)),64))],4))}})),[["__scopeId","data-v-3e0766e2"]]),hD=ot({name:"InfographicBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=O(()=>{var n,i;return d4((i=um(e.estimatedPreviewHeightPx))!=null?i:u4(String((n=e.node.code)!=null?n:"")))});return()=>{var n;return On("div",{class:"infographic-block-container rounded-lg border overflow-hidden",style:{margin:"var(--ms-flow-diagram-y) 0",background:"var(--diagram-bg)",borderColor:"var(--diagram-border)",color:"hsl(var(--ms-foreground))"},"data-markstream-infographic":"1","data-markstream-mode":"pending"},[e.showHeader?On("div",{class:"infographic-block-header flex justify-between items-center border-b",style:{padding:"var(--ms-inset-panel-y) var(--ms-inset-panel-x)",background:"var(--diagram-header-bg)",borderColor:"var(--diagram-border)",minHeight:"calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding) + var(--ms-inset-panel-y) + var(--ms-inset-panel-y) + 1px)"}},[On("div",{class:"flex items-center gap-x-2 overflow-hidden"},[On("span",{class:"icon-slot action-icon shrink-0",style:{display:"inline-flex",width:"var(--ms-action-btn-icon)",height:"var(--ms-action-btn-icon)"}}),On("span",{class:"infographic-label font-medium font-mono truncate",style:{fontSize:"var(--ms-text-label)",color:"hsl(var(--ms-muted-foreground))"}},"Infographic")]),On("div",{class:"infographic-header-actions flex items-center opacity-0 pointer-events-none",style:{gap:"var(--ms-gap-header-actions)"},"aria-hidden":"true"},Array.from({length:4},()=>On("span",{class:"infographic-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded",style:{width:"calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding))",height:"calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding))"}})))]):null,On("div",{class:"infographic-preview relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[On("pre",{class:"infographic-pending-source text-sm font-mono whitespace-pre-wrap",style:{position:"absolute",inset:"0",zIndex:"1",margin:"0",padding:"var(--ms-inset-panel-body)",overflow:"auto",textAlign:"left"}},String((n=e.node.code)!=null?n:"")),On("div",{class:"absolute inset-0"},[On("div",{class:"w-full text-center flex items-center justify-center min-h-full"})])])])}}}),pD=ot({name:"MermaidBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=O(()=>{var n,i;return c4((i=um(e.estimatedPreviewHeightPx))!=null?i:l4(String((n=e.node.code)!=null?n:"")))});return()=>{var n;return On("div",{class:"mermaid-block-container rounded-lg border overflow-hidden",style:{margin:"var(--ms-flow-diagram-y) 0",borderColor:"var(--diagram-border)"},"data-markstream-mermaid":"1","data-markstream-mode":"pending"},[e.showHeader?On("div",{class:"mermaid-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)]",style:{background:"var(--diagram-header-bg)",borderColor:"var(--diagram-border)"}},[On("div",{class:"flex items-center gap-x-2 overflow-hidden"},[On("span",{class:"mermaid-label-text text-[length:var(--ms-text-label)] font-medium font-mono truncate",style:{color:"var(--code-action-fg)"}},"Mermaid")]),On("div",{class:"mermaid-header-actions flex items-center gap-[var(--ms-gap-header-actions)] opacity-0 pointer-events-none","aria-hidden":"true"},Array.from({length:4},()=>On("span",{class:"mermaid-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded"},[On("span",{class:"action-icon block"})])))]):null,On("div",{class:"mermaid-preview-area relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[On("pre",{class:"mermaid-source-code text-sm font-mono whitespace-pre-wrap",style:{position:"absolute",inset:"0",margin:"0",padding:"var(--ms-inset-panel-body)",overflow:"auto",textAlign:"left"}},String((n=e.node.code)!=null?n:"")),On("div",{class:"_mermaid w-full text-center flex items-center justify-center min-h-full",style:{fontFamily:"inherit",contentVisibility:"auto",contain:"content",containIntrinsicSize:"var(--ms-size-diagram-min-height) 240px"}})])])}}}),m3e={docs:{showTooltips:!0,fade:!0,batchRendering:!0,initialRenderBatchSize:40,renderBatchSize:80,renderBatchDelay:16,renderBatchBudgetMs:6,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:220,liveNodeBuffer:60,nodeVirtual:"auto"},chat:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:32,renderBatchSize:48,renderBatchDelay:6,renderBatchBudgetMs:8,renderBatchIdleTimeoutMs:60,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"},minimal:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:32,renderBatchSize:48,renderBatchDelay:6,renderBatchBudgetMs:8,renderBatchIdleTimeoutMs:60,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"}};function Vs(e){if(e==null)return"";if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return String(e);try{return JSON.stringify(e)}catch{return String(e)}}const g3e=["data-custom-id"],v3e=["data-node-index","data-node-type"],mD="typewriter-simple-cursor-target",NV=Ri(ot(Pn(Dt({},{name:"NodeRenderer"}),{__name:"NodeRenderer",props:{content:{},nodes:{},final:{type:Boolean},parseOptions:{},customMarkdownIt:{},debugPerformance:{type:Boolean,default:!1},customHtmlTags:{},mode:{},domMode:{},htmlPolicy:{},viewportPriority:{type:Boolean,default:void 0},viewportPriorityOptions:{},codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:{},codeBlockLightTheme:{},codeBlockMonacoOptions:{},codeRenderer:{},renderCodeBlocksAsPre:{type:Boolean,default:void 0},codeBlockMinWidth:{},codeBlockMaxWidth:{},codeBlockProps:{},mermaidProps:{},d2Props:{},infographicProps:{},showTooltips:{type:Boolean,default:void 0},themes:{},langs:{},isDark:{type:Boolean},customId:{},indexKey:{},typewriter:{type:[Boolean,String],default:!1},smoothStreaming:{type:[Boolean,String],default:"auto"},smoothStreamingOptions:{},parseCoalesceMs:{},fade:{type:Boolean,default:void 0},batchRendering:{type:Boolean,default:void 0},initialRenderBatchSize:{},renderBatchSize:{},renderBatchDelay:{},renderBatchBudgetMs:{},renderBatchIdleTimeoutMs:{},deferNodesUntilVisible:{type:Boolean,default:void 0},maxLiveNodes:{},liveNodeBuffer:{},nodeVirtual:{type:[Boolean,String],default:void 0},virtualScroll:{},renderAsFragment:{type:Boolean}},emits:["copy","copy-code","handleArtifactClick","click","mouseover","mouseout","virtual-state-change","height-change","render-settled","render-final","anchor-change"],setup(e,{expose:t,emit:n}){const i=e,o=n;function s(W){if(!(typeof Event<"u"&&W instanceof Event))return typeof W=="string"&&o("copy-code",W),void o("copy",W)}const r=Is(),a=en("markstreamNestedRendererProps",void 0);function l(W){const se=r?.vnode.props;return!!se&&(Object.prototype.hasOwnProperty.call(se,W)||Object.prototype.hasOwnProperty.call(se,String(W).replace(/[A-Z]/g,ye=>`-${ye.toLowerCase()}`)))}function u(W){var se,ye;const we=i[W];return l(W)?we:(ye=(se=a?.value)==null?void 0:se[W])!=null?ye:we}const c=O(()=>{return(W=u("mode"))==="chat"||W==="minimal"||W==="docs"?W:"docs";var W}),d=O(()=>tD(u("typewriter"))),f=O(()=>d.value!=="off"),h=O(()=>u("domMode")==="minimal"?"minimal":"full"),m=O(()=>{return(W={mode:c.value,codeRenderer:u("codeRenderer"),renderCodeBlocksAsPre:u("renderCodeBlocksAsPre")}).renderCodeBlocksAsPre===!0?"pre":W.codeRenderer==="pre"||W.codeRenderer==="shiki"||W.codeRenderer==="monaco"?W.codeRenderer:W.renderCodeBlocksAsPre===!1||W.mode==="docs"?"monaco":"pre";var W}),g=O(()=>m3e[c.value]),y=O(()=>{var W;return(W=u("showTooltips"))!=null?W:g.value.showTooltips}),b=O(()=>{var W;return(W=u("fade"))!=null?W:g.value.fade}),v=O(()=>{var W;return(W=u("batchRendering"))!=null?W:g.value.batchRendering}),w=O(()=>{var W;return(W=u("initialRenderBatchSize"))!=null?W:g.value.initialRenderBatchSize}),A=O(()=>{var W;return(W=u("renderBatchSize"))!=null?W:g.value.renderBatchSize}),M=O(()=>{var W;return(W=u("renderBatchDelay"))!=null?W:g.value.renderBatchDelay}),L=O(()=>{var W;return(W=u("renderBatchBudgetMs"))!=null?W:g.value.renderBatchBudgetMs}),E=O(()=>{var W;return(W=u("renderBatchIdleTimeoutMs"))!=null?W:g.value.renderBatchIdleTimeoutMs}),C=O(()=>{var W;return(W=u("deferNodesUntilVisible"))!=null?W:g.value.deferNodesUntilVisible}),x=O(()=>{var W;return(W=u("maxLiveNodes"))!=null?W:g.value.maxLiveNodes}),_=O(()=>{var W;return(W=u("liveNodeBuffer"))!=null?W:g.value.liveNodeBuffer}),F=O(()=>{var W;return(W=u("nodeVirtual"))!=null?W:g.value.nodeVirtual}),I={get content(){return i.content},get nodes(){return i.nodes},get final(){return i.final},get parseOptions(){return u("parseOptions")},get customMarkdownIt(){return u("customMarkdownIt")},get debugPerformance(){return i.debugPerformance},get customHtmlTags(){return u("customHtmlTags")},get mode(){return u("mode")},get domMode(){return h.value},get htmlPolicy(){return u("htmlPolicy")},get viewportPriority(){return u("viewportPriority")},get viewportPriorityOptions(){return u("viewportPriorityOptions")},get codeBlockStream(){return u("codeBlockStream")},get codeBlockDarkTheme(){return u("codeBlockDarkTheme")},get codeBlockLightTheme(){return u("codeBlockLightTheme")},get codeBlockMonacoOptions(){return u("codeBlockMonacoOptions")},get codeRenderer(){return u("codeRenderer")},get renderCodeBlocksAsPre(){return u("renderCodeBlocksAsPre")},get codeBlockMinWidth(){return u("codeBlockMinWidth")},get codeBlockMaxWidth(){return u("codeBlockMaxWidth")},get codeBlockProps(){return u("codeBlockProps")},get mermaidProps(){return u("mermaidProps")},get d2Props(){return u("d2Props")},get infographicProps(){return u("infographicProps")},get showTooltips(){return y.value},get themes(){return u("themes")},get langs(){return u("langs")},get isDark(){return u("isDark")},get customId(){return u("customId")},get indexKey(){return i.indexKey},get typewriter(){return u("typewriter")},get smoothStreaming(){return i.smoothStreaming},get smoothStreamingOptions(){return u("smoothStreamingOptions")},get parseCoalesceMs(){return u("parseCoalesceMs")},get fade(){return b.value},get batchRendering(){return v.value},get initialRenderBatchSize(){return w.value},get renderBatchSize(){return A.value},get renderBatchDelay(){return M.value},get renderBatchBudgetMs(){return L.value},get renderBatchIdleTimeoutMs(){return E.value},get deferNodesUntilVisible(){return C.value},get maxLiveNodes(){return x.value},get liveNodeBuffer(){return _.value},get nodeVirtual(){return F.value},get virtualScroll(){return i.virtualScroll},get renderAsFragment(){return i.renderAsFragment}};function D(W){o("height-change",W)}function H(W){o("virtual-state-change",W)}function $(W){o("anchor-change",W)}const T=q(),R=q(null),P=q(null),j=q(null),B=bo({1:null,2:null,3:null,4:null,5:null,6:null}),K=q(!1),X=new Map,V=q(0),Q=q(0),ie=q({paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}});function ee(W,se){return typeof W!="string"?se:W.trim()||se}function Ce(W){const se=Number(W);return Number.isFinite(se)&&se>0?Math.max(1,Math.trunc(se)):640}const Z=O(()=>{var W;const se=(W=I.viewportPriorityOptions)!=null?W:{},ye=ee(se.rootMargin,Wp);return{rootMargin:ye,heavyBlockMargin:ee(se.heavyBlockMargin,ye),maxTargets:Ce(se.maxTargets)}}),ae=O(()=>{var W;return(W=Z.value.rootMargin)!=null?W:Wp}),he=O(()=>{var W;return(W=Z.value.maxTargets)!=null?W:640});function J(){var W,se;if(((W=i.virtualScroll)==null?void 0:W.enabled)!==!0)return null;const ye=(se=i.virtualScroll)==null?void 0:se.scrollRoot;return te(typeof ye=="function"?ye():ye)}function te(W){return W?typeof HTMLElement<"u"&&W instanceof HTMLElement?W:typeof W=="object"&&"value"in W?te(W.value):typeof W=="object"&&"$el"in W?te(W.$el):null:null}Qn(mV,Z);const{isClient:U,renderAsFragment:Y,debugPerformanceEnabled:ce,resolvedShowTooltips:me,resolvedHtmlPolicy:ge,inheritedSmoothStreaming:oe,ownsTypewriterCursor:re}=(function(W){const se=typeof window<"u",ye=yg(),we=en("markstreamHtmlPolicy",void 0),Ee=en("markstreamTypewriterCursor",void 0),ze=en("markstreamSmoothStreaming",void 0),nt=O(()=>W.renderAsFragment===!0),it=O(()=>!!(W.debugPerformance&&se&&typeof console<"u")),yt=O(()=>{var kt;if(typeof W.showTooltips=="boolean")return W.showTooltips;const Qe=(kt=ye.showTooltips)!=null?kt:ye["show-tooltips"];return Qe===""||Qe===!0||Qe==="true"||Qe!==!1&&Qe!=="false"&&void 0}),ut=O(()=>{var kt,Qe;return(Qe=(kt=W.htmlPolicy)!=null?kt:we?.value)!=null?Qe:"safe"}),st=O(()=>Ee?.value!==!0);return{isClient:se,renderAsFragment:nt,debugPerformanceEnabled:it,resolvedShowTooltips:yt,resolvedHtmlPolicy:ut,inheritedSmoothStreaming:ze,inheritedTypewriterCursor:Ee,ownsTypewriterCursor:st}})(I),{resolveViewportRoot:ve,resolveScrollContainer:le,isReverseFlexScrollRoot:xe,getNormalizedScrollTop:be,getOffsetTopWithinRoot:pe}=(function(W,se){function ye(){var it,yt;return(yt=(it=se.scrollRoot)==null?void 0:it.call(se))!=null?yt:null}function we(it){if(typeof window>"u")return null;const yt=ye();if(yt)return yt;const ut=it??W.value;if(!ut)return null;const st=ut.ownerDocument||document,kt=st.scrollingElement||st.documentElement;let Qe=ut;for(;Qe&&Qe!==st.body&&Qe!==kt;){if(c3e(window.getComputedStyle(Qe))&&d3e(Qe))return Qe;Qe=Qe.parentElement}return null}function Ee(it){if(!se.isClient)return!1;try{const yt=window.getComputedStyle(it);return!!(yt.display||"").toLowerCase().includes("flex")&&(yt.flexDirection||"").toLowerCase().endsWith("reverse")}catch{return!1}}function ze(it,yt,ut){var st,kt;if(ut)return nt(yt);const Qe=it.scrollTop;if(!Ee(it))return Qe;const ft=Qe<0?-Qe:Qe;return Math.max(0,((st=it.scrollHeight)!=null?st:0)-((kt=it.clientHeight)!=null?kt:0))-ft}function nt(it){var yt,ut,st,kt,Qe;const ft=Number((yt=it.scrollingElement)==null?void 0:yt.scrollTop),St=Number((st=(ut=it.documentElement)==null?void 0:ut.scrollTop)!=null?st:0),bt=Number((Qe=(kt=it.body)==null?void 0:kt.scrollTop)!=null?Qe:0);return Math.max(0,Number.isFinite(ft)?ft:0,Number.isFinite(St)?St:0,Number.isFinite(bt)?bt:0)}return{resolveViewportRoot:we,resolveScrollContainer:function(it){var yt,ut,st,kt;const Qe=ye();if(Qe)return Qe;const ft=we((yt=it??W.value)!=null?yt:null);if(ft)return ft;const St=(kt=(st=it?.ownerDocument)!=null?st:(ut=W.value)==null?void 0:ut.ownerDocument)!=null?kt:typeof document<"u"?document:null;return St?.scrollingElement||St?.documentElement||null},isReverseFlexScrollRoot:Ee,getNormalizedScrollTop:ze,getOffsetTopWithinRoot:function(it,yt){const ut=yt.ownerDocument||it.ownerDocument||document;if((function(ft,St){return ft===St.documentElement||ft===St.body||ft===St.scrollingElement})(yt,ut))return it.getBoundingClientRect().top+nt(ut);const st=yt.getBoundingClientRect(),kt=it.getBoundingClientRect(),Qe=ze(yt,ut,!1);return kt.top-st.top+Qe}}})(T,{isClient:U,scrollRoot:J});Qn("markstreamShowTooltips",me),Qn("markstreamHtmlPolicy",ge),Qn("markstreamTypewriter",f),Qn("markstreamFade",O(()=>I.fade!==!1)),Qn("markstreamTypewriterCursor",O(()=>!0)),Qn("markstreamTextStreamState",X),Qn("markstreamStreamVersion",V),Qn("markstreamParseOptions",O(()=>I.parseOptions)),Qn("markstreamCustomMarkdownIt",O(()=>I.customMarkdownIt));const{smoothStreamingEnabled:Te,renderContent:Ae,requestedFinal:_e,effectiveFinal:Fe}=(function(W,se){const ye=l3e(Dt(Dt({},u3e),W.smoothStreamingOptions)),we=O(()=>{var Qe,ft,St;return W.smoothStreaming!==!1&&!((Qe=W.nodes)!=null&&Qe.length)&&(W.smoothStreaming===!0||!((ft=se.inheritedSmoothStreaming)!=null&&ft.value))&&(W.smoothStreaming===!0||tD(W.typewriter)!=="off"||((St=W.maxLiveNodes)!=null?St:0)<=0)}),Ee=q(!se.isClient||W.smoothStreaming===!0);wn(()=>{Ee.value=!0});const ze=O(()=>Ee.value&&we.value),nt=O(()=>{var Qe;return ze.value?ye.visible.value:(Qe=W.content)!=null?Qe:""}),it=O(()=>{var Qe,ft;const St=(Qe=W.parseOptions)!=null?Qe:{};return(ft=W.final)!=null?ft:St.final}),yt=O(()=>{const Qe=it.value;return ze.value&&Qe!=null?!!Qe&&ye.caughtUp.value:Qe});let ut=0,st=!1;function kt(){ut=0,st=!1}return Be([()=>W.content,()=>W.nodes,ze,it],([Qe,ft,St,bt])=>{if(ft?.length)return kt(),void ye.reset("");const Vt=Qe??"";if(!St)return kt(),ye.reset(Vt),void(bt&&ye.finish({flush:!0}));const Ht=ye.source.value;if(Vt){if(Vt!==Ht)if(Vt.startsWith(Ht)){const An=Vt.slice(Ht.length),Qt=ye.pendingChars.value;An.length<=8?(ut++,st||ut>=2&&Qt<=8?(st=!0,ye.reset(Vt)):ye.enqueue(An)):(kt(),ye.enqueue(An))}else kt(),ye.reset(Vt)}else kt(),ye.reset("");bt&&ye.finish()},{immediate:!0}),{smoothStream:ye,smoothStreamingEligible:we,smoothStreamingEnabled:ze,renderContent:nt,requestedFinal:it,effectiveFinal:yt}})(I,{isClient:U,inheritedSmoothStreaming:oe}),$e=_e.value===!0;Qn("markstreamSmoothStreaming",Te);const Je=q(!1),ht=q(!1),Nt=q(!1);let Ot="",_t=!1,dt=null;function ue(){U&&dt!=null&&(window.clearTimeout(dt),dt=null)}function Le(){Je.value=!1,ue()}function Oe(W,se){if(!ce.value)return;const ye=(function(){if(!ce.value)return null;const we=Ve(Ge),Ee=Ve(at),ze=Math.max(Se,Ee);if(we<=0&&ze<=0)return null;const nt={total:we,maxPerFrame:ze,byLabel:(it=Ge,Object.fromEntries(Array.from(it.entries()).sort((yt,ut)=>ut[1]-yt[1]||yt[0].localeCompare(ut[0]))))};var it;return Ge.clear(),at.clear(),Se=0,nt})();console.info(`[markstream-vue][perf] ${W}`,ye?Pn(Dt({},se),{layoutReads:ye}):se)}Be([()=>I.indexKey,()=>I.customId],()=>{var W,se;Le(),ht.value=!1,Nt.value=!((W=i.nodes)!=null&&W.length)&&_e.value!==!0&&!!i.content,Ot=(se=Ae.value)!=null?se:"",_t=Ot.length>0},{flush:"sync"}),Be([()=>i.content,()=>i.nodes,_e],([W,se,ye])=>{!se?.length&&ye!==!0&&W&&(Nt.value=!0)},{flush:"sync",immediate:!0}),Be([Ae,()=>i.nodes,_e],([W,se,ye])=>{const we=W??"";return se?.length||ye===!0?(Le(),ht.value=!1,Ot=we,void(_t=!0)):(we.length>0&&(Nt.value=!0),_t?(Ot&&we.length>Ot.length&&we.startsWith(Ot)?(Je.value=!0,ht.value=!0,U&&(ue(),dt=window.setTimeout(()=>{var Ee;dt=null,Fe.value===!0||(Ee=i.nodes)!=null&&Ee.length||(w1(),Je.value=!1,Vd())},1200))):(we.length"u")return null;const ze=window;if(ze.__markstreamLayoutReadPerformance)return ze.__markstreamLayoutReadPerformance;const nt={total:0,maxPerFrame:0,byLabel:{}};return ze.__markstreamLayoutReadPerformance=nt,nt})();Ee&&(Ee.total=Number(Ee.total||0)+1,Ee.byLabel[we]=Number(Ee.byLabel[we]||0)+1,Ee.currentFrameTotal=Number(Ee.currentFrameTotal||0)+1,Ee.frameScheduled||(Ee.frameScheduled=!0,typeof window.requestAnimationFrame!="function"?typeof queueMicrotask!="function"?setTimeout(()=>He(Ee),0):queueMicrotask(()=>He(Ee)):window.requestAnimationFrame(()=>He(Ee))))})(W),et||(et=!0,U&&typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(rt):typeof queueMicrotask!="function"?setTimeout(rt,0):queueMicrotask(rt)))}function Ye(W,se){return Xe(W),se()}const Ut=I.customId?`renderer-${I.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,gn=(function(W){const se=new Map;return{scope:W,cache:se,clear:()=>se.clear()}})(Ut),$n=Ut;Qn(CV,gn);const sn=Ms(()=>I.customId),{effectiveCustomHtmlTagsSet:li,mergedParseOptions:Ro,parsedNodes:Gt,getParsedNodesDirtyStartIndex:io,getParsedNodesRevision:Co}=r3e(I,{instanceMsgId:Ut,renderContent:Ae,effectiveFinal:Fe,smoothStreamingEnabled:Te,debugPerformanceEnabled:ce,customComponentsMap:sn,logPerf:Oe});Be(Gt,()=>{Je.value||gn.clear(),V.value+=1},{immediate:!0});const fo=O(()=>({customId:I.customId,customHtmlTags:Ro.value.customHtmlTags,parseOptions:I.parseOptions,customMarkdownIt:I.customMarkdownIt,htmlPolicy:ge.value,viewportPriority:I.viewportPriority,viewportPriorityOptions:Z.value,mode:c.value,domMode:I.domMode,codeRenderer:m.value,codeBlockStream:I.codeBlockStream,codeBlockDarkTheme:I.codeBlockDarkTheme,codeBlockLightTheme:I.codeBlockLightTheme,codeBlockMonacoOptions:I.codeBlockMonacoOptions,renderCodeBlocksAsPre:I.renderCodeBlocksAsPre,codeBlockMinWidth:I.codeBlockMinWidth,codeBlockMaxWidth:I.codeBlockMaxWidth,codeBlockProps:I.codeBlockProps,mermaidProps:I.mermaidProps,d2Props:I.d2Props,infographicProps:I.infographicProps,showTooltips:me.value,themes:I.themes,langs:I.langs,isDark:I.isDark,typewriter:f.value,smoothStreamingOptions:I.smoothStreamingOptions,parseCoalesceMs:I.parseCoalesceMs,fade:I.fade}));Qn("markstreamNestedRendererProps",fo);const ga=O(()=>Gt.value),xo=O(()=>Gt.value.length),Xs=q(null),er=q(null),mo=q(null),Vo=q(null),tr=i.indexKey!=null&&String(i.indexKey).startsWith("list-item-"),Qa=!tr&&I.customId?QR(I.customId):null,nr=O(()=>Qa?($5.value,QR(I.customId)):null),hn=O(()=>{var W;return!!(!Y.value&&I.customId&&!tr&&((W=nr.value)!=null&&W.enabled))}),Ti=O(()=>!!(U&&hn.value)),Ke=O(()=>{var W;return!!(!Y.value&&((W=i.virtualScroll)!=null&&W.enabled))}),lt=O(()=>Ke.value),tt=q(!1);wn(()=>{tt.value=!0});const jt=O(()=>!!(U&&Ke.value));Qn("markstreamHostScrollManaged",jt);const Rt=O(()=>!!(tt.value&&jt.value)),In=O(()=>Ti.value||jt.value),Es=O(()=>Ti.value||Rt.value),It=O(()=>{var W;return In.value&&((W=nr.value)==null?void 0:W.textEstimation)!==!1});function mt(){const W=Q.value||Ye("getMeasuredContainerWidth.clientWidth",()=>{var se;return((se=T.value)==null?void 0:se.clientWidth)||0});return Number.isFinite(W)&&W>0?W:0}const Pt=O(()=>{const W=mt();return W>0?Math.max(1,Math.round(W)):640}),Kt=O(()=>{var W,se;return!(Fe.value!==!0||Ke.value||c.value!=="chat"&&c.value!=="minimal"||l("maxLiveNodes")||l("liveNodeBuffer")||(W=i.nodes)!=null&&W.length||Nt.value||!(((se=I.maxLiveNodes)!=null?se:0)<=0))}),zn=O(()=>{var W;return Kt.value?50:Math.max(1,(W=I.maxLiveNodes)!=null?W:320)}),Di=O(()=>{var W;return Kt.value?16:Math.max(0,(W=I.liveNodeBuffer)!=null?W:60)}),Mn=O(()=>{var W;return!Y.value&&I.nodeVirtual!==!1&&!(((W=I.maxLiveNodes)!=null?W:0)<=0&&!Kt.value)&&(I.nodeVirtual===!0?Gt.value.length>0:Gt.value.length>zn.value)}),Hc=O(()=>Mn.value||Ti.value||jt.value),as=O(()=>I.viewportPriority!==!1),qr=O(()=>!!as.value&&!K.value);var _r;_r=O(()=>as.value),Qn(gV,_r);const Bd=O(()=>{var W;return!(Y.value||I.deferNodesUntilVisible===!1||((W=I.maxLiveNodes)!=null?W:0)<=0||Mn.value||Gt.value.length>900||I.viewportPriority===!1)}),Ya=jbe(W=>{var se;return ve((se=W??T.value)!=null?se:null)},as),{requestFrame:Oi,cancelFrame:ls,hasIdleCallback:ir,isTestEnv:Ur}=(function(W){const se=W.isClient&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):null,ye=W.isClient&&typeof window.cancelAnimationFrame=="function"?window.cancelAnimationFrame.bind(window):null,we=W.isClient&&typeof window.requestIdleCallback=="function",Ee=(function(){var ze;if(typeof globalThis>"u"||!("process"in globalThis))return;const nt=(ze=Object.getOwnPropertyDescriptor(globalThis,"process"))==null?void 0:ze.value;return nt?.env})();return{requestFrame:se,cancelFrame:ye,hasIdleCallback:we,isTestEnv:Ee?.NODE_ENV==="test"}})({isClient:U}),Vu=O(()=>Fe.value===!0&&!Ke.value),{resolvedBatchSize:Sl,resolvedInitialBatch:_l,batchingEnabled:$d,incrementalRenderingActive:cu,renderedCount:Ko,previousRenderContext:js,adaptiveBatchSize:Zo,previousBatchConfig:Vr}=(function(W,se){var ye;const we=O(()=>{var kt;const Qe=Math.trunc((kt=W.renderBatchSize)!=null?kt:80);return Number.isFinite(Qe)?Math.max(0,Qe):0}),Ee=O(()=>{var kt;const Qe=Math.trunc((kt=W.initialRenderBatchSize)!=null?kt:we.value);return Number.isFinite(Qe)?Math.max(0,Qe):we.value}),ze=O(()=>!se.renderAsFragment.value&&W.batchRendering!==!1&&we.value>0&&se.isClient&&!se.isTestEnv),nt=q(0),it=q({key:W.indexKey,total:0}),yt=q(Math.max(1,we.value||1)),ut=O(()=>{var kt,Qe,ft;return ze.value&&!((kt=se.continuousStreaming)!=null&&kt.value)&&!((Qe=se.forceFullRenderFinalContent)!=null&&Qe.value)&&((ft=W.maxLiveNodes)!=null?ft:0)<=0}),st=q({batchSize:we.value,initial:Ee.value,delay:(ye=W.renderBatchDelay)!=null?ye:16,enabled:ut.value});return{resolvedBatchSize:we,resolvedInitialBatch:Ee,batchingEnabled:ze,incrementalRenderingActive:ut,renderedCount:nt,previousRenderContext:it,adaptiveBatchSize:yt,previousBatchConfig:st}})(I,{isClient:U,isTestEnv:Ur,renderAsFragment:Y,forceFullRenderFinalContent:Vu,continuousStreaming:O(()=>ht.value&&Fe.value!==!0)}),Do=O(()=>{var W;return!Y.value&&I.batchRendering!==!1&&Sl.value>0&&!Ur&&((W=I.maxLiveNodes)!=null?W:0)<=0&&!Vu.value}),va=O(()=>Do.value),du=O(()=>In.value||va.value),Ja=O(()=>{var W;return du.value&&((W=nr.value)==null?void 0:W.codeBlockEstimation)!==!1}),Oo=new Map,Xa=new Map,Wc=new WeakMap;let go=null;const Ku=new WeakMap,vo=new Map,Il=[];let Hs=[],hi=[],So=-1;const us=au(Il),Ir=new Set,ya=q(0);let Ml=0;const Tl=q(0),qc=O(()=>(Tl.value,Array.from(Oo.entries()).sort((W,se)=>W[0]-se[0]))),el=q(null),Go=q(null);let Wi,yo=null,qi=0,pi=null;function eo(){Wi.markFallbackHeightPrefixDirty()}function Mr(W){return Wi.getFallbackNodeHeight(W)}function or(W,se){return Wi.estimateHeightRange(W,se)}function cs(W){return Wi.estimateIndexForOffset(W)}const{activeRestoreAnchor:Qo,getRelativeScrollTopWithinContainer:El,setRelativeScrollTopWithinContainer:sr,resolveAnchorOffset:ka,clearRestoreReconcile:ba,scheduleRestoreReconcile:Tr,captureRestoreAnchor:rr,restoreAnchor:Er,getAnchorDrift:fu}=(function(W){const{isClient:se,containerRef:ye,parsedNodeCount:we,requestFrame:Ee,cancelFrame:ze,resolveScrollContainer:nt,getNormalizedScrollTop:it,getOffsetTopWithinRoot:yt,isReverseFlexScrollRoot:ut,estimateIndexForOffset:st,estimateHeightRange:kt,getFallbackNodeHeight:Qe,clamp:ft}=W,St=q(null);let bt=null,Vt=[];function Ht(){const un=nt(),jn=ye.value;if(!un||!jn)return null;const ti=un.ownerDocument||jn.ownerDocument||document;if(un===ti.documentElement||un===ti.body||un===ti.scrollingElement){const Yo=jn.getBoundingClientRect();return Math.max(0,-Yo.top)}return Math.max(0,it(un,ti,!1)-yt(jn,un))}function An(un){var jn;const ti=nt(),Yo=ye.value;if(!ti||!Yo)return;const fr=Math.max(0,un),ho=ti.ownerDocument||Yo.ownerDocument||document,ku=ho.defaultView||(typeof window<"u"?window:null);if(ti===ho.documentElement||ti===ho.body||ti===ho.scrollingElement){const Ia=it(ti,ho,!0)+Yo.getBoundingClientRect().top;return void((jn=ku?.scrollTo)==null||jn.call(ku,0,Math.max(0,Ia+fr)))}XR(ti,ho,yt(Yo,ti)+fr,{isReverseFlexScrollRoot:Ia=>{var Zd;return(Zd=ut?.(Ia))!=null&&Zd},getNormalizedScrollTop:it})}function Qt(un){const jn=we.value,ti=ft(un.nodeIndex,0,Math.max(0,jn-1));return kt(0,ti)+Math.max(0,un.offsetWithinNodePx)}function xn(){if(bt!=null&&(ze?.(bt),bt=null),se)for(const un of Vt)window.clearTimeout(un);Vt=[]}function Zt(un){const jn=Qt(un),ti=Ht();ti!=null&&Math.abs(ti-jn)<=.5||An(jn)}return{activeRestoreAnchor:St,getRelativeScrollTopWithinContainer:Ht,setRelativeScrollTopWithinContainer:An,resolveAnchorOffset:Qt,clearRestoreReconcile:xn,applyRestoreAnchor:Zt,scheduleRestoreReconcile:function(){St.value&&se&&bt==null&&(bt=Ee?Ee(()=>{bt=null,St.value&&Zt(St.value)}):null,bt==null&&St.value&&Zt(St.value))},captureRestoreAnchor:function(){const un=Ht(),jn=we.value;if(un==null||jn<=0)return null;const ti=ft(st(un+1),0,jn-1),Yo=kt(0,ti),fr=Qe(ti);return{nodeIndex:ti,offsetWithinNodePx:ft(un-Yo,0,Math.max(0,fr-1))}},restoreAnchor:function(un){const jn=we.value;if(St.value={nodeIndex:ft(un.nodeIndex,0,Math.max(0,jn-1)),offsetWithinNodePx:Math.max(0,un.offsetWithinNodePx)},xn(),Zt(St.value),se)for(const ti of[0,120,280,480])Vt.push(window.setTimeout(()=>{St.value&&Zt(St.value)},ti))},getAnchorDrift:function(un){const jn=Ht();return jn==null?null:jn-Qt(un)}}})({isClient:U,containerRef:T,parsedNodeCount:xo,requestFrame:Oi,cancelFrame:ls,resolveScrollContainer:()=>el.value||le(),getNormalizedScrollTop:be,getOffsetTopWithinRoot:pe,isReverseFlexScrollRoot:xe,estimateIndexForOffset:cs,estimateHeightRange:or,getFallbackNodeHeight:Mr,clamp:fs}),{nodeHeights:Ws,heightStats:Pi,heightTreeSize:hu,heightSumTree:zd,heightKnownTree:pu,averageNodeHeight:mu,resetHeightMeasurements:Lr,pruneHeightMeasurements:Ll,rebuildHeightTrees:ds,syncHeightTreeSize:Uc,recordNodeHeight:Zu,removeNodeHeights:wa,exportHeightCache:gu,importHeightCache:Aa,fenwickRangeSum:Ca}=(function(W={}){const se=bo({}),ye=bo({total:0,count:0}),we=q(0),Ee=q([]),ze=q([]);function nt(){for(const Qe of Object.keys(se))delete se[Number(Qe)];ye.total=0,ye.count=0,we.value=0,Ee.value=[],ze.value=[]}function it(Qe,ft,St){for(let bt=ft+1;bt0;bt-=bt&-bt)St+=Qe[bt];return St}function ut(Qe){we.value=Qe;const ft=new Array(Qe+1).fill(0),St=new Array(Qe+1).fill(0);for(const[bt,Vt]of Object.entries(se)){const Ht=Number(bt),An=Number(Vt);!Number.isFinite(Ht)||Ht<0||Ht>=Qe||!Number.isFinite(An)||An<=0||(it(ft,Ht,An),it(St,Ht,1))}Ee.value=ft,ze.value=St}function st(Qe){if(!Number.isInteger(Qe)||Qe<0)return!1;const ft=se[Qe];if(!Number.isFinite(ft)||ft<=0)return!1;if(delete se[Qe],ye.total=Math.max(0,ye.total-ft),ye.count=Math.max(0,ye.count-1),we.value>Qe){const St=Ee.value,bt=ze.value;St.length&&bt.length&&(it(St,Qe,-ft),it(bt,Qe,-1))}return!0}const kt=O(()=>ye.count>0?Math.max(12,ye.total/ye.count):32);return{nodeHeights:se,heightStats:ye,heightTreeSize:we,heightSumTree:Ee,heightKnownTree:ze,averageNodeHeight:kt,resetHeightMeasurements:nt,pruneHeightMeasurements:function(Qe){if(Qe<=0)return void nt();let ft=0,St=0;for(const[bt,Vt]of Object.entries(se)){const Ht=Number(bt),An=Number(Vt);!Number.isFinite(Ht)||Ht<0||Ht>=Qe||!Number.isFinite(An)||An<=0?delete se[Ht]:(ft+=An,St++)}ye.total=ft,ye.count=St},rebuildHeightTrees:ut,syncHeightTreeSize:function(Qe){const ft=we.value;if(Qe===ft)return;if(Qe=Qe||!Number.isFinite(xn)||xn<=0)continue;let Zt=Qt+1;for(;Ztbt){const xn=Ee.value,Zt=ze.value;if(xn.length&&Zt.length)if(Qt){const un=Vt-Qt;un!==0&&it(xn,bt,un)}else it(xn,bt,Vt),it(Zt,bt,1)}Ht.notify!==!1&&((An=W.onHeightRecorded)==null||An.call(W))})(Qe,ft,Pn(Dt({},St),{notify:!0}))},removeNodeHeight:function(Qe,ft={}){var St;const bt=st(Qe);return bt&&ft.notify!==!1&&((St=W.onHeightRecorded)==null||St.call(W)),bt},removeNodeHeights:function(Qe,ft={}){var St;let bt=0;for(const Vt of Qe)st(Number(Vt))&&bt++;return bt>0&&ft.notify!==!1&&((St=W.onHeightRecorded)==null||St.call(W)),bt},exportHeightCache:function(){return Object.entries(se).map(([Qe,ft])=>({index:Number(Qe),height:Number(ft)})).filter(Qe=>Number.isFinite(Qe.index)&&Qe.index>=0&&Number.isFinite(Qe.height)&&Qe.height>0).sort((Qe,ft)=>Qe.index-ft.index)},importHeightCache:function(Qe,ft={}){var St;if(!Array.isArray(Qe))return;const bt=we.value;let Vt=!1;if(ft.mode!=="merge"){const Ht=Object.keys(se);if(Ht.length>0){for(const An of Ht)delete se[Number(An)];Vt=!0}}for(const Ht of Qe){const An=Number(Ht.index),Qt=Number(Ht.height);if(!Number.isInteger(An)||An<0||bt>0&&An>=bt||!Number.isFinite(Qt)||Qt<=0)continue;const xn=se[An];xn&&Math.abs(xn-Qt)<=1||(se[An]=Qt,Vt=!0)}Vt&&((function(){let Ht=0,An=0;const Qt=we.value;for(const[xn,Zt]of Object.entries(se)){const un=Number(xn),jn=Number(Zt);!Number.isFinite(un)||un<0||Qt>0&&un>=Qt||!Number.isFinite(jn)||jn<=0?delete se[un]:(Ht+=jn,An++)}ye.total=Ht,ye.count=An})(),bt>0&&ut(bt),(St=W.onHeightRecorded)==null||St.call(W))},fenwickRangeSum:function(Qe,ft,St){if(St<=ft)return 0;const bt=yt(Qe,St-1);return ft<=0?bt:bt-yt(Qe,ft-1)}}})({onHeightRecorded:()=>{eo(),jt.value&&n0(),Qo.value&&Tr(),Go.value&&v1(),so("node-resize")}});function Kr(W){Number.isInteger(W)&&W>=0&&Ir.add(W)}function qe(W){for(const se of W)Kr(Number(se))}function Re(W){Ml++;let se=!0;try{const ye=W();return se=ye!==!1,ye}finally{Ml--,Ml===0&&se&&ya.value++}}function ct(){Hs=[],hi=[],So=-1,Ir.clear(),us.value=Il}function vn(){ct(),Re(()=>Lr()),vo.clear()}function Tn(W){!Number.isInteger(W)||W<0||W>=Gt.value.length||vo.set(W,Ug(W))}function Rn(W,se,ye={}){const we=Ws[W];Kr(W),Zu(W,se,ye);const Ee=Ws[W];return Object.is(we,Ee)?(Ir.delete(W),!1):(Ee&&Ee>0?Tn(W):we&&vo.delete(W),!0)}function Zi(W,se){const ye=Ye("getNodeLayoutHeight.slot.offsetHeight",()=>{var we,Ee;return(Ee=(we=Oo.get(W))==null?void 0:we.offsetHeight)!=null?Ee:0});return ye>0?ye:Ye("getNodeLayoutHeight.content.offsetHeight",()=>se.offsetHeight)}function mi(W,se={}){se.mode!=="merge"?ct():qe(W.map(ye=>ye.index)),Re(()=>Aa(W,se)),J3()}const yi=O(()=>Bd.value&&qr.value),Zr=O(()=>{var W;return!Y.value&&I.batchRendering!==!1&&Sl.value>0&&((W=I.maxLiveNodes)!=null?W:0)<=0}),ar=O(()=>!Y.value&&$e&&Fe.value===!0&&!Mn.value&&!Ke.value&&!hn.value&&!yi.value&&!Zr.value),Nl=O(()=>!!Ya&&yi.value),d1=O(()=>Mn.value||jt.value),{focusIndex:Gr,liveRange:_o,updateLiveRange:tl}=(function(W,se){const{parsedNodeCount:ye,virtualizationEnabled:we,maxLiveNodesResolved:Ee,liveNodeBufferResolved:ze,clamp:nt}=se,it=ze??O(()=>{var st;return Math.max(0,(st=W.liveNodeBuffer)!=null?st:60)}),yt=q(0),ut=bo({start:0,end:0});return{liveNodeBufferResolved:it,focusIndex:yt,liveRange:ut,updateLiveRange:function(){const st=ye.value;if(!we.value||st===0)return ut.start=0,void(ut.end=st);const kt=Math.min(Ee.value,st),Qe=it.value,ft=nt(yt.value-Qe,0,Math.max(0,st-kt));ut.start=ft,ut.end=Math.min(st,ft+kt)}}})(I,{parsedNodeCount:xo,virtualizationEnabled:Mn,maxLiveNodesResolved:zn,liveNodeBufferResolved:Di,clamp:fs}),Nr=new Map,Fl=new Map,xa=new Map,nl=[],lr=new Map;let jd=-1/0;const il=new Set,ol=q(0);let Hd=!1;const Wd=O(()=>(ol.value,il.size)),qs=new Map,ur=new Map,Vc=q(0),xh=O(()=>{Vc.value;let W=0;for(const se of qs.values())W+=Math.max(0,se);return W});let cr=null;const Me=O(()=>{if(!Mn.value)return Gt.value.length;const W=Di.value,se=Math.max(_o.end+W,_l.value),ye=Math.min(Gt.value.length,se);return Math.max(Ko.value,ye)});function je(){Hd||(Hd=!0,queueMicrotask(()=>{Hd=!1,ol.value+=1}))}function gt(W,se,ye="node-resize"){if(!U||typeof window>"u")return null;const we=window.setTimeout(()=>{il.delete(we)&&je();try{se()}finally{so(ye)}},Math.max(0,W));return il.add(we),je(),we}function zt(W){U&&W!=null&&(il.delete(W)&&je(),window.clearTimeout(W))}function Cn(){if(U&&typeof window<"u")for(const W of il)window.clearTimeout(W);il.size&&(il.clear(),je()),nl.length=0,xa.clear()}function Hn(W){R.value=W}function Ai(W){P.value=W}function to(W){j.value=W}const{cancelScheduledFocusSync:Po,scheduleFocusSync:Us}=(function(W){const{isClient:se,containerRef:ye,virtualizationEnabled:we,requestFrame:Ee,cancelFrame:ze,syncFocusToScroll:nt}=W;let it=null;function yt(){var st,kt,Qe;return(Qe=(kt=(st=ye.value)==null?void 0:st.ownerDocument)==null?void 0:kt.defaultView)!=null?Qe:typeof window<"u"?window:null}function ut(){if(!it)return;const st=yt();it.viaTimeout?st?st.clearTimeout(it.id):clearTimeout(it.id):ze?.(it.id),it=null}return{cancelScheduledFocusSync:ut,scheduleFocusSync:function(st={}){if(!we.value)return;if(!se)return void nt(!0);if(st.immediate)return ut(),void nt(!0);if(it)return;const kt=()=>{it=null,nt()};if(Ee)return void(it={id:Ee(kt),viaTimeout:!1});const Qe=yt();it={id:Qe?Qe.setTimeout(kt,16):setTimeout(kt,16),viaTimeout:!0}}}})({isClient:U,containerRef:T,virtualizationEnabled:Mn,requestFrame:Oi,cancelFrame:ls,syncFocusToScroll:function(W=!1){var se;if(!Mn.value)return;const ye=el.value||le();if(!ye)return;const we=ye.ownerDocument||((se=T.value)==null?void 0:se.ownerDocument)||document,Ee=we?.defaultView||(typeof window<"u"?window:null),ze=ye===we?.documentElement||ye===we?.body,nt=Gt.value.length;if(nt<=0)return;if(!ze&&nt>0&&xe(ye)){const bt=Ye("syncFocusToScroll.clientHeight",()=>ye.clientHeight||0),Vt=Ye("syncFocusToScroll.scrollTop",()=>ye.scrollTop),Ht=Vt<0?-Vt:Vt;return void Sh(fs((it=Math.max(0,Ht)+.5*Math.max(0,bt),Wi.estimateIndexForOffsetFromEnd(it)),0,Math.max(0,nt-1)),W)}var it;const yt=(function(bt,Vt,Ht,An){const Qt=T.value;if(!Qt)return null;const xn=An?0:Ye("syncFocusToScroll.model.root.getBoundingClientRect",()=>bt.getBoundingClientRect().top),Zt=Ye("syncFocusToScroll.model.container.getBoundingClientRect",()=>Qt.getBoundingClientRect().top),un=Math.max(0,xn-Zt),jn=An?Ye("syncFocusToScroll.model.viewport.clientHeight",()=>{var ti,Yo,fr,ho;return(ho=(fr=(Yo=Ht?.innerHeight)!=null?Yo:(ti=Vt.documentElement)==null?void 0:ti.clientHeight)!=null?fr:bt.clientHeight)!=null?ho:0}):Ye("syncFocusToScroll.model.root.clientHeight",()=>bt.clientHeight);return fs(cs(un+.5*Math.max(0,jn)),0,Math.max(0,Gt.value.length-1))})(ye,we,Ee,ze);if(yt!=null)return void Sh(yt,W);const ut=ze?null:Ye("syncFocusToScroll.root.getBoundingClientRect",()=>ye.getBoundingClientRect()),st=ze?0:ut.top,kt=ze?Ye("syncFocusToScroll.viewport.clientHeight",()=>{var bt,Vt;return(Vt=(bt=Ee?.innerHeight)!=null?bt:ye.clientHeight)!=null?Vt:0}):ut.bottom,Qe=qc.value;let ft=null,St=null;for(const[bt,Vt]of Qe){if(!Vt)continue;const Ht=Ye("syncFocusToScroll.slot.getBoundingClientRect",()=>Vt.getBoundingClientRect());Ht.bottom<=st||Ht.top>=kt||(ft==null&&(ft=bt),St=bt)}if(ft==null||St==null){const bt=T.value;if(!bt)return;const Vt=ze?{top:0}:Ye("syncFocusToScroll.fallback.root.getBoundingClientRect",()=>ye.getBoundingClientRect()),Ht=Ye("syncFocusToScroll.fallback.scrollTop",()=>be(ye,we,ze)),An=ze?(()=>{const xn=Ye("syncFocusToScroll.fallback.container.getBoundingClientRect",()=>bt.getBoundingClientRect()),Zt=(ze?0:Vt.top)-xn.top;return Math.max(0,Zt)})():(()=>{const xn=pe(bt,ye);return Math.max(0,Ht-xn)})(),Qt=ze?Ye("syncFocusToScroll.fallback.viewport.clientHeight",()=>{var xn,Zt,un,jn;return(jn=(un=(Zt=Ee?.innerHeight)!=null?Zt:(xn=we?.documentElement)==null?void 0:xn.clientHeight)!=null?un:ye.clientHeight)!=null?jn:0}):Ye("syncFocusToScroll.fallback.root.clientHeight",()=>ye.clientHeight);return void Sh(fs(cs(An+.5*Math.max(0,Qt)),0,Math.max(0,Gt.value.length-1)),!0)}Sh(Math.round((ft+St)/2),W)}}),{visibleNodeIndices:Gu,nodeVisibilityHandles:vu,nodeVisibilityWatchStops:f1,nodeVisibilityFallbackTimers:yu,clearVisibilityFallback:Bi,markNodeVisible:Qr,cleanupNodeVisibility:sl,destroyNodeVisibilityState:Qu}=a3e({isClient:U,shouldTrackVisibleNodeIndices:()=>yi.value,shouldCleanupNodeVisibility:()=>Mn.value,onNodeMarkedVisible:W=>{Mn.value?Us():Gr.value=fs(W,0,Math.max(0,Gt.value.length-1))},onNodeVisibilityCleaned:W=>{Oo.delete(W)&&HM()}}),{cleanupScrollListener:Dg,setupScrollListener:xy}=(function(W){const{isClient:se,virtualizationEnabled:ye,listenerEnabled:we,scrollRootElement:Ee,resolveScrollContainer:ze,scheduleFocusSync:nt,onScroll:it}=W;let yt=null,ut=null;function st(){yt&&(yt(),yt=null),ut=null,Ee.value=null}function kt(Qe){const ft=W.getScrollTop?W.getScrollTop(Qe):Qe.scrollTop;return Math.max(0,Number.isFinite(ft)?Math.abs(ft):0)}return{cleanupScrollListener:st,setupScrollListener:function(){if(!se)return;if(!((Qe=we?.value)!=null?Qe:ye.value))return void st();var Qe;const ft=ze();if(!ft)return void st();if(Ee.value===ft&&yt)return;st(),ut=kt(ft);const St=()=>{if(it?.(),ye.value){const bt=(function(Vt){const Ht=kt(Vt),An=ut;ut=Ht;const Qt=Math.max(480,.75*(Vt.clientHeight||0));return An==null?Ht>Qt?{immediate:!0}:void 0:Math.abs(Ht-An)>Qt?{immediate:!0}:void 0})(ft);bt?nt(bt):nt()}};ft.addEventListener("scroll",St,{passive:!0}),Ee.value=ft,yt=()=>{ft.removeEventListener("scroll",St)}}}})({isClient:U,virtualizationEnabled:Mn,listenerEnabled:d1,scrollRootElement:el,resolveScrollContainer:le,scheduleFocusSync:Us,onScroll:function(){const W=Go.value;if(!W)return;const se=Ih();if(!se||(function(we){if(k1()>=qi)return pi=null,!1;const Ee=pi;if(Ee==null)return!0;const ze=Math.abs(we.scrollTop-Ee)<=2;return ze||(pi=null),ze})(se))return;const ye=TM(se);ye!=null?(ye<-32||Math.abs(Math.max(0,ye)-Math.max(0,W.distanceFromBottomPx))>32)&&g1("restore"):g1("restore")},getScrollTop:W=>{var se;const ye=W.ownerDocument||((se=T.value)==null?void 0:se.ownerDocument)||document,we=W===ye.documentElement||W===ye.body||W===ye.scrollingElement;return Ye("scrollListener.getScrollTop",()=>be(W,ye,we))}});function Sh(W,se=!1){const ye=fs(W,0,Math.max(0,Gt.value.length-1));!se&&Math.abs(ye-Gr.value)<=1||(Gr.value=ye,tl())}function fs(W,se,ye){return Math.min(Math.max(W,se),ye)}function _h(W=Gt.value.length){const se=io();return!Number.isInteger(se)||se<0?W:fs(se,0,W)}function Og(W){return W?.firstElementChild}function Pg(W,se){var ye;return W?(ye=W.matches)!=null&&ye.call(W,se)?W:W.querySelector(se):null}function Sy(W,se){W<1||W>6||(B[W]=se)}function _y(){if(!In.value)return void(Q.value=0);const W=Ye("updateExperimentContainerWidth.clientWidth",()=>{var se,ye;return(ye=(se=T.value)==null?void 0:se.clientWidth)!=null?ye:0});Q.value=W>0?W:0}let Fr=null;function qd(){Fr?.disconnect(),Fr=null}const Iy=V0("ViewportDeferredMarkdownCodeBlockNode",Ac({loader:()=>ao(null,null,function*(){return(yield ts(()=>import("./index5-BWZLeih7.js"),__vite__mapDeps([6,4,5]))).default}),loadingComponent:p4,delay:0,suspensible:!1}),p4);function Bg(W){return W===Iy}const Kc=O(()=>m.value==="pre"?Na:m.value==="shiki"?Iy:F5);function h1(){var W;return((W=I.codeBlockProps)==null?void 0:W.showHeader)!==!1}function My(W,se,ye){const we=Ws[se],Ee=typeof we=="number"&&we>0;if(It.value&&!Ee&&!(function(ze){return!!sn.value.paragraph&&(ze.type==="paragraph"||ze.type==="list_item"||ze.type==="list")})(W)){const ze=AV(W,ye,ie.value);if(ze)return ze}if(Ja.value&&W.type==="code_block"){const ze=(function(nt){if(nt.type!=="code_block")return null;const it=aT(nt,Oy(nt));return Bg(it)?"markdown":it===Na?"pre":it===Kc.value||it===F5?"monaco":null})(W);if(ze==="monaco"||ze==="markdown"||ze==="pre")return(function(nt,it){var yt,ut,st;if(!nt||nt.type!=="code_block")return null;const kt=it.rendererKind,Qe=kt!=="pre"&&it.showHeader!==!1,ft=!!nt.diff;let St=0,bt=500;if(kt==="monaco"){const Ht=(yt=it.monacoOptions)!=null?yt:{},An=H5(nt,Ht,it.width),Qt=(function(Zt){const un=typeof Zt?.fontSize=="number"&&Zt.fontSize>0?Zt.fontSize:12;return typeof Zt?.lineHeight=="number"&&Zt.lineHeight>0?Zt.lineHeight:Math.round(1.5*un)})(Ht),xn=(function(Zt,un){var jn,ti;const Yo=typeof((jn=Zt?.padding)==null?void 0:jn.top)=="number"?Zt.padding.top:un?0:8,fr=typeof((ti=Zt?.padding)==null?void 0:ti.bottom)=="number"?Zt.padding.bottom:un?0:8;return Math.max(0,Yo)+Math.max(0,fr)})(Ht,ft);bt=typeof Ht.MAX_HEIGHT=="number"&&Ht.MAX_HEIGHT>0?Ht.MAX_HEIGHT:500,St=Math.round(An*Qt+xn)}else if(kt==="markdown"){const Ht=H5(nt);St=Math.round(21*Ht+32)}else{const Ht=H5(nt);St=Math.round(28*Ht),bt=Number.POSITIVE_INFINITY}const Vt=Math.max(1,Math.min(St,bt));return Dt({kind:"code-block",height:Math.round(Vt+(Qe?40:0)),contentHeight:Vt,rendererKind:kt},ft&&kt==="monaco"?{diffInline:y_((ut=it.monacoOptions)!=null?ut:{},(st=it.width)!=null?st:0)}:{})})(W,{rendererKind:ze,monacoOptions:I.codeBlockMonacoOptions,showHeader:h1(),width:ye})}return null}xm(()=>{if(ya.value,Ml>0)return;const W=Gt.value,se=Co();if(!W.length||!du.value)return Hs=[],hi=[],So=-1,Ir.clear(),void(us.value=Il);const ye=Q.value||Ye("estimatedNodeHeights.clientWidth",()=>{var ut;return((ut=T.value)==null?void 0:ut.clientWidth)||0});if(!Number.isFinite(ye)||ye<=0)return Hs=[],hi=[],So=-1,Ir.clear(),void(us.value=Il);const we=(function(ut){return[Math.round(ut),It.value,Ja.value,ie.value,I.codeBlockMonacoOptions,h1(),m.value,sn.value,$5.value]})(ye),Ee=Hs.length<=W.length&&(nt=we,(ze=hi).length===nt.length&&ze.every((ut,st)=>Object.is(ut,nt[st])));var ze,nt;const it=Ee&&So===se?W.length:Ee?_h(W.length):0,yt=Ee?Array.from(Ir):[];Hs.length=W.length;for(let ut=it;ut=0&&utus.value);Wi=(function(W){let se=!0,ye=[0],we="";function Ee(st){var kt;const Qe=W.nodeHeights[st];if(Number.isFinite(Qe)&&Qe>0)return Qe;const ft=W.parsedNodes.value[st],St=ft?.type,bt=!!((kt=W.hasCustomParagraphComponent)!=null&&kt.call(W)),Vt=W.estimatedNodeHeights.value[st],Ht=Vt?.height;if(!(function(Qt,xn,Zt){return!!(Zt&&xn?.kind==="simple-text"&&(Qt==="paragraph"||Qt==="list_item"||Qt==="list"))})(St,Vt,bt)&&Number.isFinite(Ht)&&Ht>0)return Ht;const An=Gwe(ft,W.getContainerWidth()||640);return St==="heading"||St==="paragraph"&&An<=28&&(function(Qt,xn){if(xn)return!1;const Zt=Qt.children;return!Array.isArray(Zt)||!Zt.length||Zt.every(xV)})(ft,bt)?An:Math.max(W.averageNodeHeight.value,An)}function ze(){var st;const kt=W.parsedNodes.value.length,Qe=W.getPrefixCacheKeyParts().join(":");if(!se&&we===Qe)return ye;const ft=new Array(kt+1);ft[0]=0;for(let St=0;St=((kt=St[ft])!=null?kt:0))return ft-1;let bt=0,Vt=ft-1,Ht=ft-1;for(;bt<=Vt;){const An=bt+Vt>>1;((Qe=St[An+1])!=null?Qe:0)>=st?(Ht=An,Vt=An-1):bt=An+1}return Ht}function it(st,kt){var Qe,ft;if(st>=kt)return 0;if(W.heightEstimationActive.value)return(function(Vt,Ht){var An,Qt;const xn=W.parsedNodes.value.length,Zt=nD(Math.trunc(Vt),0,xn),un=nD(Math.trunc(Ht),Zt,xn);if(Zt>=un)return 0;const jn=ze();return((An=jn[un])!=null?An:0)-((Qt=jn[Zt])!=null?Qt:0)})(st,kt);if(W.heightTreeSize.value!==W.parsedNodes.value.length){let Vt=0;for(let Ht=st;HtZt<=0?0:W.fenwickRangeSum(bt,0,Zt)+(Zt-W.fenwickRangeSum(Vt,0,Zt))*St;let An=0,Qt=Qe.length-1,xn=Qe.length-1;for(;An<=Qt;){const Zt=An+Qt>>1;Ht(Zt+1)>=st?(xn=Zt,Qt=Zt-1):An=Zt+1}return xn}let ft=st;for(let St=0;St0||st++}return st}return{markFallbackHeightPrefixDirty:function(){se=!0},getFallbackNodeHeight:Ee,estimateHeightRange:it,estimateIndexForOffset:yt,estimateIndexForOffsetFromEnd:function(st){var kt,Qe;const ft=W.parsedNodes.value;if(!ft.length)return 0;if(st<=0)return Math.max(0,ft.length-1);if(W.heightEstimationActive.value){const bt=(kt=ze()[ft.length])!=null?kt:0;return nt(Math.max(0,bt-st))}if(W.heightTreeSize.value===ft.length){const bt=it(0,ft.length);return yt(Math.max(0,bt-st))}let St=st;for(let bt=ft.length-1;bt>=0;bt--){const Vt=(Qe=W.nodeHeights[bt])!=null?Qe:W.averageNodeHeight.value;if(St<=Vt)return bt;St-=Vt}return 0},getEstimatedNodeHeightCount:ut,buildVirtualHeightSummary:function(st){var kt;const Qe=W.parsedNodes.value.length;return{totalNodes:Qe,measuredCount:W.heightStats.count,estimatedCount:ut(),averageNodeHeight:W.averageNodeHeight.value,topSpacerHeight:st.topSpacerHeight,bottomSpacerHeight:st.bottomSpacerHeight,estimatedTotalHeight:it(0,Qe),width:(kt=st.width)!=null?kt:W.getContainerWidth()}}}})({parsedNodes:Gt,nodeHeights:Ws,heightStats:Pi,heightTreeSize:hu,heightSumTree:zd,heightKnownTree:pu,averageNodeHeight:mu,heightEstimationActive:In,estimatedNodeHeights:Zc,getContainerWidth:mt,hasCustomParagraphComponent:()=>!!sn.value.paragraph,getPrefixCacheKeyParts:()=>{var W;const se=b0(Q.value||Ye("getFallbackHeightPrefix.clientWidth",()=>{var we;return((we=T.value)==null?void 0:we.clientWidth)||0})),ye=((W=i.virtualScroll)==null?void 0:W.measurementKey)==null?"":String(i.virtualScroll.measurementKey);return[Gt.value.length,Pi.count,Math.round(Pi.total),Math.round(100*mu.value),ye,se,In.value?1:0,$5.value,V.value,sn.value.paragraph?1:0]},fenwickRangeSum:Ca}),Be(()=>Gt.value.length,W=>{var se;eo(),W<=0?vn():(WLl(se))),Uc(W))},{immediate:!0});const Ty=O(()=>{if(!Mn.value)return Gt.value.map((we,Ee)=>({node:we,index:Ee}));const W=Gt.value.length,se=fs(_o.start,0,W),ye=fs(_o.end,se,W);return Gt.value.slice(se,ye).map((we,Ee)=>({node:we,index:se+Ee}))}),$g=O(()=>Mn.value?or(0,Math.min(_o.start,Gt.value.length)):0),zg=O(()=>{if(!Mn.value)return 0;const W=Gt.value.length;return or(Math.min(_o.end,W),W)});function jg(){return Wi.buildVirtualHeightSummary({topSpacerHeight:$g.value,bottomSpacerHeight:zg.value,width:Qc()})}function Hg(){const W=Gt.value,se=jg();return Pn(Dt({},se),{probe:{paragraphReady:!!ie.value.paragraph,listItemReady:!!ie.value.listItem,listWrapperOverhead:ie.value.listWrapperOverhead,headingReadyLevels:Object.entries(ie.value.headings).filter(([,ye])=>!!ye).map(([ye])=>Number(ye))},nodes:W.map((ye,we)=>{var Ee,ze,nt,it,yt,ut,st,kt,Qe;return{index:we,type:ye.type,estimateKind:(ze=(Ee=Zc.value[we])==null?void 0:Ee.kind)!=null?ze:null,rendererKind:(it=(nt=Zc.value[we])==null?void 0:nt.rendererKind)!=null?it:null,estimatedHeight:(ut=(yt=Zc.value[we])==null?void 0:yt.height)!=null?ut:null,estimatedContentHeight:(kt=(st=Zc.value[we])==null?void 0:st.contentHeight)!=null?kt:null,measuredHeight:(Qe=Ws[we])!=null?Qe:null}})})}function p1(){return i.indexKey!=null?String(i.indexKey):Ke.value?`virtual-${Ui()}`:"markdown-renderer"}function Wg(W){const se=String(W),ye=`${p1()}-`;if(!se.startsWith(ye))return null;const we=se.slice(ye.length).match(/^(\d+)(?:$|-)/);if(!we)return null;const Ee=Number(we[1]);return!Number.isInteger(Ee)||Ee<0||Ee>=Gt.value.length?null:Ee}function Ui(){var W,se,ye;const we=(W=i.virtualScroll)==null?void 0:W.sessionKey;return String(we!=null&&we!==""?we:(ye=(se=i.indexKey)!=null?se:I.customId)!=null?ye:Ut)}function Bo(){var W;const se=(W=i.virtualScroll)==null?void 0:W.threadKey;return se==null||se===""?void 0:String(se)}const Gc=O(()=>{var W,se,ye;return(ye=Bo())!=null?ye:String((se=(W=i.indexKey)!=null?W:I.customId)!=null?se:Ut)});function qg(W){var se;return(W??"")===((se=Bo())!=null?se:"")}function Rl(){var W,se,ye;return se=(W=i.virtualScroll)==null?void 0:W.measurementKey,ye=(function(){const we=m.value;return(function(Ee){var ze,nt;const it=Ee.renderer,yt=it==="monaco"?Ee.codeBlockMonacoOptions:void 0,ut=Ee.codeBlockProps,st=it==="shiki";return[Ee.isDark?"dark":"light",it==="monaco"?"code-rich":it==="pre"?"code-pre":"code-shiki",Ee.codeBlockStream===!1?"code-static":"code-stream",Vs(Ee.codeBlockMinWidth),Vs(Ee.codeBlockMaxWidth),...st?[jke((ze=ut?.themes)!=null?ze:Ee.themes,(nt=ut?.langs)!=null?nt:Ee.langs)]:[],Vs(yt?.fontSize),Vs(yt?.lineHeight),Vs(yt?.fontFamily),Vs(yt?.tabSize),Vs(yt?.MAX_HEIGHT),Vs(yt?.wordWrap),Vs(yt?.wrappingIndent),Vs(yt?.padding),Vs(ut?.showHeader),Vs(ut?.showCopyButton),Vs(ut?.showExpandButton),Vs(ut?.showPreviewButton),Vs(ut?.showCollapseButton),Vs(ut?.showFontSizeButtons)].join("\0")})({renderer:we,isDark:I.isDark,codeBlockStream:I.codeBlockStream,codeBlockMinWidth:I.codeBlockMinWidth,codeBlockMaxWidth:I.codeBlockMaxWidth,codeBlockMonacoOptions:we==="monaco"?I.codeBlockMonacoOptions:void 0,codeBlockProps:I.codeBlockProps,themes:we==="shiki"?I.themes:void 0,langs:we==="shiki"?I.langs:void 0})})(),[se==null?"":String(se),ye].join("\0")}function Qc(){return mt()}const Ud=O(()=>b0(Qc())),ke=O(()=>[Rl(),Ud.value].join("\0")),Ue=O(()=>{var W;return Ke.value?["virtual",(W=Bo())!=null?W:"",Ui(),ke.value].join("\0"):i.indexKey});function Ze(){Vc.value+=1}function vt(W){return!(!W||!Number.isInteger(W.index)||W.index<0||W.index>=Gt.value.length||W.sessionKey!==Ui()||W.threadKey!==Bo()||W.layoutEpochKey!==ke.value)}function Bt(W){const se=String(W),ye=ur.get(se);return ye?vt(ye)?ye.index:null:Wg(se)}function ln(W="async-node"){(qs.size||ur.size)&&(qs.clear(),ur.clear(),Ze(),so(W))}const dn=en(U6,null),En={reportHeight(W,se){if(!jt.value)return;const ye=Bt(W);if(ye==null)return;const we=Nr.get(ye);if(!we)return;const Ee=Number(se),ze=Zi(ye,we);(function(nt,it,yt={}){Re(()=>Rn(nt,it,yt))})(ye,Number.isFinite(Ee)&&Ee>0?Math.max(Ee,ze||0):ze)},markPending(W){if(!jt.value)return;const se=Wg(W);se!=null&&(function(ye,we){var Ee;const ze=ur.get(ye);if(ze&&vt(ze))return qs.set(ye,Math.max(0,(Ee=qs.get(ye))!=null?Ee:0)+1),Ze(),void so("async-node");qs.set(ye,1),ur.set(ye,(function(nt){return{index:nt,sessionKey:Ui(),threadKey:Bo(),layoutEpochKey:ke.value}})(we)),Ze(),so("async-node")})(String(W),se)},markSettled(W){if(!jt.value)return;const se=String(W),ye=Bt(W);if((ye!=null||(function(we){return qs.has(String(we))})(se))&&(function(we){var Ee;const ze=(Ee=qs.get(we))!=null?Ee:0;return!(ze<=0||(ze<=1?(qs.delete(we),ur.delete(we)):qs.set(we,ze-1),Ze(),ze===1&&so("async-node"),0))})(se)&&ye!=null){const we=Nr.get(ye);we&&Xg(ye,we)}}};function pn(){let W=0;for(const se of Nr.values())W+=Ye("getVisibleDomHeight.offsetHeight",()=>{var ye;return(ye=se?.offsetHeight)!=null?ye:0});return Math.ceil(Math.max(0,W))}Qn(U6,{reportHeight(W,se){En.reportHeight(W,se),dn?.reportHeight(W,se)},markPending(W){En.markPending(W),dn?.markPending(W)},markSettled(W){En.markSettled(W),dn?.markSettled(W)}});let Wn,Gn=null,ui=null;function si(W){return W!==!1&&W!=null&&W!==""}function oo(){return Mn.value?(function(){if(!Mn.value)return!0;const W=Gt.value.length,se=fs(_o.start,0,W),ye=fs(_o.end,se,W);if(se>=ye)return!0;for(let we=se;we=Me.value}function dr(){return Fe.value===!0&&!Je.value&&xh.value===0&&il.size===0&&lr.size===0&&cr==null&&oo()}function Yr(){var W,se;if(((W=i.virtualScroll)==null?void 0:W.settleMode)!=="manual"||Gn===Ui()&&Wn===Bo())return!0;const ye=(se=i.virtualScroll)==null?void 0:se.settledToken;return!!si(ye)&&ui===i0(ye)}function hs(){return dr()&&Yr()}function Sa(W,se){return se.totalNodes<=0?W==="final"?"final":"estimate":se.measuredCount>=se.totalNodes?W==="final"?"final":"measured":se.measuredCount>0||se.estimatedCount>0?"mixed":"estimate"}function Yu(W="manual",se){const ye=jg(),we=(function(Ee){return Ee||(Fe.value!==!0?Gt.value.length>0?"streaming":"estimating":!oo()||lr.size>0||cr!=null?"measuring":hs()?"settled":"settling")})(se);return{sessionKey:Ui(),threadKey:Bo(),phase:we,nodeCount:ye.totalNodes,liveRange:{start:_o.start,end:_o.end},renderedCount:Ko.value,measuredCount:ye.measuredCount,estimatedCount:ye.estimatedCount,averageNodeHeight:ye.averageNodeHeight,topSpacerHeight:ye.topSpacerHeight,bottomSpacerHeight:ye.bottomSpacerHeight,visibleDomHeight:pn(),totalHeight:MM(),width:ye.width,final:Fe.value===!0,stable:hs(),confidence:Sa(we,ye),reason:W}}function Ih(){const W=el.value||le(),se=T.value;if(!W||!se)return null;const ye=W.ownerDocument||se.ownerDocument||document,we=W===ye.documentElement||W===ye.body||W===ye.scrollingElement,Ee=Ye("getScrollBox.scrollTop",()=>be(W,ye,we)),ze=Ye("getScrollBox.scrollHeight",()=>{var it,yt,ut,st,kt;return we?Math.max((yt=(it=ye.documentElement)==null?void 0:it.scrollHeight)!=null?yt:0,(st=(ut=ye.body)==null?void 0:ut.scrollHeight)!=null?st:0,(kt=W.scrollHeight)!=null?kt:0):W.scrollHeight}),nt=Ye("getScrollBox.clientHeight",()=>{var it;return we?((it=ye.documentElement)==null?void 0:it.clientHeight)||W.clientHeight||0:W.clientHeight});return{root:W,doc:ye,isViewportRoot:we,scrollTop:Ee,scrollHeight:ze,clientHeight:nt}}function MM(){const W=Gt.value.length,se=Math.max(0,or(0,W)),ye=Ye("getRendererLogicalHeight.offsetHeight",()=>{var Ee,ze;return(ze=(Ee=T.value)==null?void 0:Ee.offsetHeight)!=null?ze:0}),we=Math.max(0,ye>0?ye:Ye("getRendererLogicalHeight.scrollHeight",()=>{var Ee,ze;return(ze=(Ee=T.value)==null?void 0:Ee.scrollHeight)!=null?ze:0}));return W<=0?Math.ceil(ye):Mn.value?se>0?Math.max(1,Math.ceil(se),(function(){let Ee=$g.value+zg.value;for(const ze of Oo.values())ze&&(Ee+=Math.max(0,Ye("getVirtualizedDomLogicalHeight.offsetHeight",()=>ze.offsetHeight||0)));return Math.ceil(Math.max(0,Ee))})(),(function(Ee,ze){return Ee<=0||ze<=0?0:ze<=Ee+Math.max(512,.05*Ee)?Math.ceil(ze):0})(se,we)):Math.max(1,Math.ceil(we)):jt.value?se>0||Pi.count>0||Wi.getEstimatedNodeHeightCount()>0?(cu.value&&Ko.value,Math.max(1,Math.ceil(we),Math.ceil(se))):Math.ceil(we):Math.max(1,Math.ceil(we),Math.ceil(se))}function TM(W){const se=T.value;if(!se)return null;const ye=Ye("getRendererBottomDistanceFromViewport.getBoundingClientRect",()=>se.getBoundingClientRect());return(function(Ee){return Ee.isViewportRoot?Ee.clientHeight:Ye("getViewportBottomInRoot.getBoundingClientRect",()=>Ee.root.getBoundingClientRect().bottom)})(W)-ye.bottom}function gX(W={}){const se=W.requireViewport!==!1,ye=(function(ze=64){const nt=Ih(),it=T.value;if(!nt||!it)return!1;const yt=(function(st){if(st.isViewportRoot)return{top:0,bottom:st.clientHeight};const kt=Ye("getVirtualViewportRect.getBoundingClientRect",()=>st.root.getBoundingClientRect());return{top:kt.top,bottom:kt.bottom}})(nt),ut=Ye("isRendererNearVirtualViewport.getBoundingClientRect",()=>it.getBoundingClientRect());return ut.bottom>=yt.top-ze&&ut.top<=yt.bottom+ze})();if(se&&!ye)return null;const we=(function(){const ze=Ih(),nt=T.value;if(!ze||!nt||Math.max(0,ze.scrollHeight-ze.scrollTop-ze.clientHeight)>64)return null;const it=TM(ze);return it==null?null:it>=-8&&it<=160?{type:"bottom",distanceFromBottomPx:Math.max(0,it)}:null})();if(we)return{anchor:we,captured:!0};const Ee=rr();if(Ee)return{anchor:{type:"node",nodeIndex:Ee.nodeIndex,offsetWithinNodePx:Ee.offsetWithinNodePx},captured:ye};if(W.allowFallback===!0){const ze=(function(){const nt=Gt.value.length;return nt<=0?null:{type:"node",nodeIndex:fs(Gr.value,0,Math.max(0,nt-1)),offsetWithinNodePx:0}})();return ze?{anchor:ze,captured:!1}:null}return null}function W3(W){let se=2166136261;for(let ye=0;ye>>0).toString(36)}function vX(W,se){let ye=W;for(let we=0;we8192?`${we.slice(0,8192)}...${we.length}`:we;return`${we.length}:${W3(Ee)}`})(W)}`;if(typeof W=="function")return"fn";if(typeof W!="object")return typeof W;if(se.has(W))return"cycle";if(ye>=6)return"max-depth";se.add(W);try{if(Array.isArray(W)){if(W.length<=160){const ut=[];for(let st=0;st=it&&nt.push(st)}return[`a:${W.length}`,`h=${ze.join(",")}`,`t=${nt.join(",")}`,`all=${(yt>>>0).toString(36)}`].join(":")}const we=W,Ee=Object.keys(we).filter(ze=>{const nt=we[ze];return ze!=="parent"&&ze!=="el"&&ze!=="component"&&(nt==null||typeof nt=="string"||typeof nt=="number"||typeof nt=="boolean"||yX.has(ze))}).sort();return`o:${Ee.length}:${Ee.map(ze=>`${ze}=${Ey(we[ze],se,ye+1)}`).join(";")}`}finally{se.delete(W)}}let q3=-1,U3="",Mh=[2166136261];function Ug(W){const se=Gt.value[W];return se?W3(Ey(se)):""}function kX(W,se){let ye=W;for(let we=0;we>>0}function V3(){var W,se;const ye=V.value;if(q3===ye)return U3;const we=Gt.value.length;let Ee=_h(we);(q3!==ye-1||Ee>we||Mh.length>>0).toString(36),q3=ye,U3}function m1(W,se={}){var ye;const we=se.includeHeightCache===!0,Ee=(ye=se.includeContentHash)!=null?ye:we,ze=we?(function(it){const yt=(function(){var bt,Vt;const Ht=Number((Vt=(bt=i.virtualScroll)==null?void 0:bt.heightCacheLimit)!=null?Vt:5e3);return!Number.isFinite(Ht)||Ht<=0?Number.POSITIVE_INFINITY:Math.max(1,Math.trunc(Ht))})();if(!Number.isFinite(yt)||it.length<=yt)return it;const ut=new Map,st=bt=>{!bt||ut.size>=yt||ut.set(bt.index,bt)},kt=Gt.value.length,Qe=fs(_o.start-2*Di.value,0,kt),ft=fs(_o.end+2*Di.value,Qe,kt);for(const bt of it)bt.index>=Qe&&bt.index=0&&ut.sizebt.index-Vt.index).slice(0,yt)})(gu().map(it=>{var yt;const ut=Gt.value[it.index];return ut?Pn(Dt({},it),{nodeType:String((yt=ut.type)!=null?yt:""),signature:Ug(it.index)}):null}).filter(it=>!!it)):[],nt=gX({allowFallback:se.allowAnchorFallback===!0,requireViewport:se.requireViewport});return nt||ze.length||se.includeEmptyState===!0?Pn(Dt({sessionKey:W.sessionKey,threadKey:W.threadKey},nt?{anchor:nt.anchor,anchorCaptured:nt.captured}:{anchorCaptured:!1}),{metrics:W,width:W.width,contentHash:Ee?V3():void 0,measurementKey:Rl()||void 0,heightCache:ze.length?ze:void 0}):null}function K3(W){var se,ye;const we=Ih();if(!we)return;const Ee=(function(it){const yt=T.value;if(!yt)return null;const ut=pe(yt,it.root),st=Gt.value.length,kt=Ye("getRendererBottomOffsetWithinRoot.offsetHeight",()=>yt.offsetHeight||0),Qe=Math.max(0,kt>0?kt:st>0?Ye("getRendererBottomOffsetWithinRoot.scrollHeight",()=>yt.scrollHeight||0):0),ft=MM();return ut+Math.max(Qe,ft)})(we);if(Ee==null)return;const ze=Math.max(0,W.distanceFromBottomPx),nt=Math.max(0,Ee-we.clientHeight-ze);(function(it){qi=k1()+120,pi=it})(nt),we.isViewportRoot?(ye=(se=we.doc.defaultView)==null?void 0:se.scrollTo)==null||ye.call(se,0,nt):XR(we.root,we.doc,nt,{isReverseFlexScrollRoot:xe,getNormalizedScrollTop:be})}const Z3=[];function EM(){if(U)for(yo!=null&&(ls?.(yo),yo=null);Z3.length;){const W=Z3.pop();W!=null&&window.clearTimeout(W)}}function g1(W){const se=!!Go.value;Go.value=null,qi=0,pi=null,EM(),se&&W&&so(W)}function v1(){if(!Go.value||!U||yo!=null)return;const W=()=>{yo=null;const se=Go.value;se&&K3(se)};yo=Oi?Oi(W):null,yo==null&&W()}function LM(W,se={}){const ye=Gt.value.length;return ye<=0?[]:W.filter(we=>!(!Number.isInteger(we.index)||we.index<0||we.index>=ye)&&!(!Number.isFinite(we.height)||we.height<=0)&&!(se.requireSignature&&!we.signature)&&!(se.requireCompatibilityMetadata&&!we.nodeType&&!we.signature)&&(function(Ee){var ze;const nt=Gt.value[Ee.index];return!(!nt||Ee.nodeType&&Ee.nodeType!==String((ze=nt.type)!=null?ze:"")||Ee.signature&&Ee.signature!==Ug(Ee.index))})(we))}function NM(W){const se=b0(Qc()),ye=b0(W);return se!==-1&&ye!==-1&&se===ye}function G3(W){var se;const ye=Number(W?.width);if(Number.isFinite(ye)&&ye>0)return ye;const we=Number((se=W?.metrics)==null?void 0:se.width);return Number.isFinite(we)&&we>0?we:null}function FM(W){var se;return W.sessionKey===Ui()&&!!qg(W.threadKey)&&((se=W.measurementKey)!=null?se:"")===Rl()&&!!NM(G3(W))&&!!(function(ye){const we=ye.heightCache;return!!we?.length&&(RM(ye)?we.some(Ee=>!!(Ee.nodeType||Ee.signature)):we.some(Ee=>!!Ee.signature))})(W)}function RM(W){return!!(W.contentHash&&W.contentHash===V3())}function bX(W){return!RM(W)}let Th=null,Eh=null,Ly=null,Vg=null,Kg=null;function Q3(W){var se;const ye=W.map(Ee=>{var ze,nt;return[Ee.index,Math.round(10*Ee.height),(ze=Ee.nodeType)!=null?ze:"",(nt=Ee.signature)!=null?nt:""].join("")}).join(""),we=b0(Qc());return[(se=Bo())!=null?se:"",Ui(),Rl(),Gt.value.length,we,W.length,W3(ye)].join(":")}function DM(W=(se=>(se=i.virtualScroll)==null?void 0:se.heightCache)()){if(!jt.value||!W?.length||Gt.value.length<=0||!NM((se=i.virtualScroll)==null?void 0:se.heightCacheWidth))return!1;var se;const ye=LM(W,{requireSignature:!0});if(!ye.length)return!1;const we=Q3(ye);return we===Th?(Eh="standalone",!0):(mi(ye,{mode:"merge"}),eo(),Th=we,Eh="standalone",Yg(),so("restore"),!0)}function Y3(W,se={}){var ye,we,Ee;if(!jt.value||!W||W.sessionKey!==Ui()||!qg(W.threadKey)||Gt.value.length<=0)return!1;const ze=!!((ye=W.heightCache)!=null&&ye.length)&&!Ny(),nt=!W.anchor||W.anchorCaptured===!1&&se.allowUncapturedAnchor!==!0?null:W.anchor,it=se.restoreAnchor===!0&&!!nt&&!Ny()&&Number(G3(W))>0;let yt=!1;if((we=W.heightCache)!=null&&we.length&&FM(W)){const st=LM(W.heightCache,{requireCompatibilityMetadata:!W.contentHash,requireSignature:bX(W)});st.length&&(mi(st,{mode:"merge"}),eo(),Th=Q3(st),Eh="restore",Yg(),yt=!0)}if(ze||it)return!1;if(!se.restoreAnchor||!nt)return yt&&so("restore"),!0;const ut=(function(st,kt){var Qe;const ft=st.anchor,St=ft?ft.type==="bottom"?`bottom:${Math.round(ft.distanceFromBottomPx)}`:`node:${ft.nodeIndex}:${Math.round(ft.offsetWithinNodePx)}`:"none";return[(Qe=Bo())!=null?Qe:"",Ui(),Rl(),Ud.value,kt,St].join(":")})(W,(Ee=se.restoreToken)!=null?Ee:"imperative");return Ly===ut?(yt&&so("restore"),!0):(Ly=ut,(function(st){const kt=()=>{if(st.type==="node")return g1(),void Er({nodeIndex:st.nodeIndex,offsetWithinNodePx:st.offsetWithinNodePx});if(ba(),Qo.value=null,Go.value=st,EM(),K3(st),U)for(const Qe of[0,120,280,480])Z3.push(window.setTimeout(()=>{const ft=Go.value;ft&&K3(ft)},Qe))};(function(Qe){if(!Mn.value)return!1;const ft=Gt.value.length;return!(ft<=0||(Gr.value=Qe.type==="node"?fs(Qe.nodeIndex,0,ft-1):ft-1,tl(),0))})(st)?pt(kt):kt()})(nt),so("restore"),!0)}function Ny(){const W=Qc();return Number.isFinite(W)&&W>0}function OM(W){var se;return W.sessionKey===Ui()&&!!qg(W.threadKey)&&(Gt.value.length<=0||!(!((se=W.heightCache)!=null&&se.length)||Ny())||!(!(W.anchor&&Number(G3(W))>0)||Ny()))}function J3(){vo.clear();for(const W of Object.keys(Ws)){const se=Number(W);Number.isInteger(se)&&se>=0&&se{let se=!1,ye=null;const we=()=>{se||(se=!0,ye!=null&&window.clearTimeout(ye),W())};if(Oi)return Oi(we),void(ye=window.setTimeout(we,50));ye=window.setTimeout(we,0)})}function X3(W,se=Bo(),ye=ke.value){return Ui()===W&&Bo()===se&&ke.value===ye}function e8(){return ao(this,arguments,function*(W={}){var se,ye,we,Ee,ze;const nt=Ui(),it=Bo(),yt=ke.value,ut=(se=W.frames)!=null?se:2,st=(ye=W.timeoutMs)!=null?ye:120,kt=(we=W.reason)!=null?we:"manual",Qe=W.expectedSettledTokenKey,ft=W.flushPendingTimers===!0,St=Yu(kt),bt=()=>Pn(Dt({},St),{phase:St.final?"settling":St.phase,stable:!1,confidence:St.confidence==="final"?"mixed":St.confidence,reason:kt}),Vt=()=>X3(nt,it,yt)&&(Qe==null||Qg()===Qe);for(let xn=0;xnwindow.setTimeout(Zt,xn))})(st),!Vt()||(ft&&Cn(),Vd(),Zg(),!Vt()))return bt();const Ht=dr();Ht&&(Gn=nt,Wn=it,((Ee=i.virtualScroll)==null?void 0:Ee.settleMode)==="manual"&&Qe!=null&&si((ze=i.virtualScroll)==null?void 0:ze.settledToken)&&Qg()===Qe&&(ui=i0(i.virtualScroll.settledToken)));const An=Vt()&&Ht&&Yr(),Qt=Yu(kt,An?"final":void 0);return o8(Qt,!0),Qt})}let BM="content",Lh=null,Nh=null,t8=0,Gg=null,y1=null,n8=null,i8=null;function k1(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function $M(W){var se,ye;const we=Gg;if(!we)return!0;const Ee=(ye=(se=i.virtualScroll)==null?void 0:se.heightDiffThresholdPx)!=null?ye:1;return Math.abs(W.totalHeight-we.totalHeight)>Ee||W.sessionKey!==we.sessionKey||W.phase!==we.phase||W.stable!==we.stable||W.final!==we.final||W.threadKey!==we.threadKey||W.nodeCount!==we.nodeCount||W.measuredCount!==we.measuredCount||W.width!==we.width}function Qg(W=(se=>(se=i.virtualScroll)==null?void 0:se.settledToken)()){return Vs(W)}function zM(W,se){var ye,we;return[W,se.sessionKey,(ye=se.threadKey)!=null?ye:"",Rl(),V3(),Vs((we=i.virtualScroll)==null?void 0:we.settledToken),Math.round(se.totalHeight),Math.round(se.width)].join("\0")}function Yg(){n8=null,i8=null,y1=null}function wX(W){const se=W.heightCache;return se?.length?Q3(se):""}function Jg(W){var se,ye,we;const Ee=W.metrics,ze=W.anchor?(nt=W.anchor).type==="bottom"?`bottom:${Math.round(nt.distanceFromBottomPx)}`:`node:${nt.nodeIndex}:${Math.round(nt.offsetWithinNodePx)}`:"none";var nt;return[W.sessionKey,(se=W.threadKey)!=null?se:"",(ye=W.measurementKey)!=null?ye:Rl(),(we=W.contentHash)!=null?we:"",wX(W),ze,W.anchorCaptured?1:0,Ee.liveRange.start,Ee.liveRange.end,Ee.renderedCount,Ee.nodeCount,Math.round(Ee.totalHeight),Math.round(Ee.width),Ee.phase,Ee.stable?1:0].join("\0")}function o8(W,se=!1){if(!jt.value||(function(nt=!1){return!nt&&Ke.value&&!Rt.value})(se))return;const ye=se||$M(W),we=(function(nt,it=!1){return it||nt.stable||nt.phase==="final"?{state:m1(nt,{includeHeightCache:!0})}:{state:m1(nt)}})(W,se),Ee=we.state,ze=!!(Ee&&(ye||(function(nt,it=!1){return!!it||Jg(nt)!==y1})(Ee,se)));if(ye&&(D(W),Gg=W,t8=k1()),Ee&&ze&&(H(Ee),Ee.anchor&&$(Ee.anchor),y1=Jg(Ee)),W.stable){const nt=zM("settled",W);if(nt!==n8){n8=nt;const it=m1(W,{includeHeightCache:!0});it&&(H(it),y1=Jg(it)),(function(yt){o("render-settled",yt)})(W)}}if(W.phase==="final"){const nt=zM("final",W);if(nt!==i8){i8=nt;const it=m1(W,{includeHeightCache:!0});it&&(H(it),y1=Jg(it)),(function(yt){o("render-final",yt)})(W)}}}function s8(){Lh!=null&&(ls?.(Lh),Lh=null),Nh!=null&&U&&(window.clearTimeout(Nh),Nh=null)}function jM(){Lh=null,Nh=null;const W=k1();W-jd>=120&&(jd=W,Vd()),(lr.size>0||cr!=null)&&Zg(),o8(Yu(BM))}function so(W){var se,ye;if(!jt.value||(BM=W,Lh!=null||Nh!=null))return;const we=Math.max(0,(ye=(se=i.virtualScroll)==null?void 0:se.emitIntervalMs)!=null?ye:32),Ee=Math.max(0,we-(k1()-t8)),ze=()=>{Nh=null,Lh=Oi?Oi(jM):null,Lh==null&&jM()};U&&Ee>0?Nh=window.setTimeout(ze,Ee):ze()}function HM(){Tl.value+=1}function Fy(W){if(cu.value&&W>=Ko.value){const se=Gt.value[W],ye=_e.value===!0&&Fe.value!==!0&&W>=Gt.value.length-2,we=se?.type==="code_block"||se?.type==="image"||se?.type==="mermaid"||se?.type==="infographic";if(!ye||we)return!1}return!yi.value||W<_l.value||Gu.value.has(W)}function b1(W){const se=f1.get(W);se&&(se(),f1.delete(W));const ye=vu.get(W);ye&&(ye.destroy(),vu.delete(W)),Bi(W)}function Ry(W,se){let ye=!1;if(se){const ze=Oo.get(W);Oo.set(W,se),ze!==se&&(ye=!0)}else Oo.delete(W)&&(ye=!0);if(ye&&HM(),se||Bi(W),!Nl.value||!Ya)return b1(W),void(se&&yi.value&&Qr(W,!0));if(!Mn.value&&yi.value&&!K.value&&vu.size>=he.value&&(K.value||(K.value=!0,Qu()),!Nl.value||!Ya))return b1(W),void(se&&Qr(W,!0));if(W<_l.value&&!Mn.value||Gu.value.has(W))return b1(W),void Qr(W,!0);if(!se)return void b1(W);b1(W);const we=Ya(se,{rootMargin:ae.value});if(!we)return;vu.set(W,we),Qr(W,we.isVisible.value),yi.value&&(function(ze){if(!U||!yi.value)return;Bi(ze);const nt=ze%17*23,it=window.setTimeout(()=>{if(yu.delete(ze),!yi.value||Gu.value.has(ze))return;const yt=Oo.get(ze);if(!yt)return;const ut=le(yt),st=yt.ownerDocument||document,kt=st.defaultView||window,Qe=!ut||ut===st.documentElement||ut===st.body,ft=!Qe&&ut?Ye("nodeVisibilityFallback.root.getBoundingClientRect",()=>ut.getBoundingClientRect()):null,St=Qe?0:ft.top,bt=Qe?Ye("nodeVisibilityFallback.clientHeight",()=>{var Ht,An;return(An=(Ht=kt.innerHeight)!=null?Ht:ut?.clientHeight)!=null?An:0}):ft.bottom,Vt=Ye("nodeVisibilityFallback.node.getBoundingClientRect",()=>yt.getBoundingClientRect());Vt.bottom>=St-500&&Vt.top<=bt+500&&Qr(ze,!0)},1800+nt);yu.set(ze,it)})(W);let Ee=null;Ee=Be(()=>we.isVisible.value,ze=>{if(ze){Bi(W),Qr(W,!0),Ee?.(),f1.delete(W),vu.get(W)===we&&vu.delete(W);try{we.destroy()}catch{}}},{immediate:!0}),f1.set(W,Ee),Mn.value&&Us()}function r8(){cr=null,Re(()=>{let W=!1;for(const[se,ye]of lr)lr.delete(se),Nr.get(se)===ye.el&&Fl.get(se)===ye.version&&(W=Rn(se,ye.height,{allowShrink:ye.allowShrink})||W);return W})}function w1(){cr!=null&&(ls?.(cr),cr=null),lr.clear()}function Xg(W,se){(function(ye,we,Ee){var ze;if(!Number.isFinite(Ee)||Ee<=0||Nr.get(ye)!==we)return;const nt=Fl.get(ye);if(nt==null)return;const it=Gt.value[ye],yt=Je.value&&Fe.value!==!0&&!((ze=i.nodes)!=null&&ze.length)&&ye>=Gt.value.length-2,ut=!(it?.loading===!0||yt),st=lr.get(ye),kt=st?st.allowShrink&&ut:ut,Qe=st&&!kt?Math.max(st.height,Ee):Ee;lr.set(ye,{height:Qe,allowShrink:kt,version:nt,el:we}),cr==null&&(cr=Oi?Oi(r8):null,cr==null&&r8())})(W,se,Zi(W,se))}function Vd(){for(const[W,se]of Nr)se&&Xg(W,se)}function WM(){go?.disconnect(),go=null,Xa.clear()}function a8(){for(;nl.length;)zt(nl.pop())}Be(Rt,W=>{W&&so("content")},{flush:"post"}),t({getVirtualMetrics:Yu,captureVirtualState:function(W={}){var se;return m1(Yu("manual"),{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:W.allowFallbackAnchor===!0,requireViewport:W.requireViewport===!0,includeEmptyState:(se=W.includeEmptyState)==null||se})},restoreVirtualState:function(W,se={}){const ye=se.restoreAnchor===!0,we=se.restoreToken==null?"imperative":String(se.restoreToken);Vg=W,Kg={restoreAnchor:ye,restoreToken:we,allowUncapturedAnchor:se.allowUncapturedAnchor===!0},!Y3(W,{restoreAnchor:ye,restoreToken:we,allowUncapturedAnchor:se.allowUncapturedAnchor===!0})&&OM(W)||(Vg=null,Kg=null)},forceMeasure:function(W="manual"){return ao(this,null,function*(){yield pt(),yield PM(),Vd(),Zg(),yield pt();const se=Yu(W);return o8(se,!0),se})},settle:e8,scrollToNode:function(W,se="start"){g1(),ba();const ye=Gt.value.length;if(ye<=0)return;const we=fs(W,0,ye-1),Ee=()=>{var ze;const nt=ka({nodeIndex:we,offsetWithinNodePx:0}),it=Mr(we),yt=Ih(),ut=(ze=yt?.clientHeight)!=null?ze:0,st=El();let kt=nt;if(se==="center")kt=nt-ut/2+it/2;else if(se==="end")kt=nt-ut+it;else if(se==="nearest"&&st!=null){if(nt>=st&&nt+it<=st+ut)return;kt=ntHc.value,W=>{if(!W){WM();for(const se of xa.values())for(const ye of se)zt(ye);xa.clear(),Fl.clear(),a8(),w1()}},{immediate:!0}),Be(Fe,W=>{W&&(function(){if(U&&Fe.value&&Nr.size){a8();for(const se of[80,240,640]){const ye=gt(se,()=>{for(const[we,Ee]of Nr)Ee&&Xg(we,Ee)},"final");ye!=null&&nl.push(ye)}}})(),so(W?"final":"content")});const AX=eD(()=>so("content"),16),CX=eD(()=>so("batch"),16);Be([()=>Gt.value.length,()=>Ko.value],()=>{Go.value&&v1(),AX()},{flush:"post",immediate:!0}),Be([()=>_o.start,()=>_o.end],()=>{CX()},{flush:"post"});const{cleanupBatchScheduler:xX}=(function(W){const{props:se,isClient:ye,isTestEnv:we,parsedNodesIdentity:Ee,parsedNodeCount:ze,desiredRenderedCount:nt,datasetKey:it,batchingEnabled:yt,incrementalRenderingActive:ut,resolvedBatchSize:st,resolvedInitialBatch:kt,renderedCount:Qe,adaptiveBatchSize:ft,previousRenderContext:St,previousBatchConfig:bt,requestFrame:Vt,cancelFrame:Ht,hasIdleCallback:An,cleanupNodeVisibility:Qt,onDatasetKeyChanged:xn,onDatasetChanged:Zt}=W;let un=null,jn="raf",ti=null,Yo=0,fr=!1,ho=!1;const ku=new Set,Ia=new Set;function Zd(){if(ye){un!=null&&(jn==="raf"&&Ht?Ht(un):jn==="idle"&&typeof window.cancelIdleCallback=="function"?window.cancelIdleCallback(un):jn==="timeout"&&window.clearTimeout(un),un=null),Yo+=1;for(const Rr of ku)Ht&&Ht(Rr);for(const Rr of Ia)window.clearTimeout(Rr);ku.clear(),Ia.clear(),ti=null,fr=!1,ho=!1}}function Wy(){return typeof performance<"u"?performance.now():Date.now()}function pT(Rr){(function(bu){var Gd;if(!ut.value)return;const Ju=Math.max(2,(Gd=se.renderBatchBudgetMs)!=null?Gd:6),Xu=Math.max(1,st.value||1),ec=Math.max(1,Math.floor(Xu/4));bu>1.5*Ju?ft.value=Math.max(ec,Math.floor(.8*ft.value)):bu<.6*Ju&&ft.value=Ju)return;const Xu=Math.max(1,Rr),ec=()=>{const Qd=Wy();un=null;const qy=ti??Xu;ti=null;const a0=Wy();Qe.value=Math.min(Ju,Qe.value+qy),Qt(Qe.value),(function(S1,Uy){if(!ye)return void pT(Uy);fr=!0;const Vy=++Yo;pt().then(()=>{var yT;if(Vy!==Yo)return;const PX=Wy(),BX=Math.max(Uy,PX-S1),kT=()=>{Vy===Yo&&pT(BX)};if(Vt){let Dh=null,_1=null,wT=!1;const AT=()=>{wT||(wT=!0,Dh!==null&&(ku.delete(Dh),Dh=null),_1!==null&&(Ia.delete(_1),window.clearTimeout(_1),_1=null),kT())};return Dh=Vt(()=>{AT()}),ku.add(Dh),_1=window.setTimeout(()=>{Dh!==null&&Ht&&Ht(Dh),AT()},Math.max(32,(yT=se.renderBatchIdleTimeoutMs)!=null?yT:120)),void Ia.add(_1)}const bT=window.setTimeout(()=>{Ia.delete(bT),kT()},0);Ia.add(bT)})})(Qd,Wy()-a0)};if(!ye||Jr.immediate)return void ec();const Rh=Math.max(0,(bu=se.renderBatchDelay)!=null?bu:16);if(ti=ti!=null?Math.max(ti,Xu):Xu,un==null){if(!we&&An&&window.requestIdleCallback){const Qd=Math.max(0,(Gd=se.renderBatchIdleTimeoutMs)!=null?Gd:120);return jn="idle",void(un=window.requestIdleCallback(()=>ec(),{timeout:Qd}))}if(Vt&&!we)return jn="raf",void(un=Vt(()=>{Rh===0?ec():(jn="timeout",un=window.setTimeout(()=>ec(),Rh))}));jn="timeout",un=window.setTimeout(()=>ec(),Rh)}}function gT(Rr,Jr={}){fr?ho=!0:Rr==null?vT():mT(Rr,Jr)}function vT(){ut.value&&mT(yt.value?Math.max(1,Math.round(ft.value)):Math.max(1,st.value))}return Be([Ee,ze,it,ut,st,kt,()=>se.renderBatchDelay],()=>{var Rr;const Jr=ze.value,bu=St.value,Gd=it.value,Ju=!Object.is(Gd,bu.key),Xu=Jr!==bu.total,ec=Xu&&Jr>bu.total&&bu.total>0&&!Ju,Rh=Ju||Xu;St.value={key:Gd,total:Jr};const Qd=bt.value,qy=(Rr=se.renderBatchDelay)!=null?Rr:16,a0=Qd.batchSize!==st.value||Qd.initial!==kt.value||Qd.delay!==qy||Qd.enabled!==ut.value;bt.value={batchSize:st.value,initial:kt.value,delay:qy,enabled:ut.value},Ju&&xn(Jr),(Rh||a0||!ut.value)&&Zd(),(Rh&&!ec||a0)&&(ft.value=Math.max(1,st.value||1)),Rh&&!ec&&Zt();const S1=nt.value;if(!Jr)return Qe.value=0,void Qt(0);if(!ut.value)return Qe.value=S1,void Qt(Qe.value);const Uy=Ju||bu.total===0;Qe.value=Uy||a0?Math.min(S1,kt.value):Math.min(Qe.value,S1);const Vy=Math.max(1,kt.value||st.value||Jr);Qe.value{ut.value&&(typeof Jr=="number"&&Rr<=Jr||Rr>Qe.value&&gT())}),{cleanupBatchScheduler:Zd}})({props:I,isClient:U,isTestEnv:Ur,parsedNodesIdentity:ga,parsedNodeCount:xo,desiredRenderedCount:Me,datasetKey:Ue,batchingEnabled:$d,incrementalRenderingActive:cu,resolvedBatchSize:Sl,resolvedInitialBatch:_l,renderedCount:Ko,adaptiveBatchSize:Zo,previousRenderContext:js,previousBatchConfig:Vr,requestFrame:Oi,cancelFrame:ls,hasIdleCallback:ir,cleanupNodeVisibility:sl,onDatasetKeyChanged:W=>{w1(),vn(),eo(),Yg(),W>0&&ds(W)},onDatasetChanged:()=>{Mn.value&&Us({immediate:!0})}});Be([d1,Mn,()=>T.value,()=>J()],([W,se])=>{if(!W)return Dg(),void Po();xy(),se?Us({immediate:!0}):Po()},{flush:"post",immediate:!0}),Be([()=>Gt.value.length,()=>Mn.value],W=>ao(null,[W],function*([se,ye]){ye&&se&&U&&(yield pt(),Us({immediate:!0}))}),{flush:"post"}),Be(In,W=>{W&&(function(){var se;if(Xs.value&&er.value&&mo.value&&((se=Vo.value)!=null&&se[1]))return;const ye=Tt({type:"paragraph",children:[{type:"text",content:"Probe paragraph text",raw:"Probe paragraph text"}],raw:"Probe paragraph text"}),we=Tt({type:"list_item",children:[ye],raw:"- Probe paragraph text"}),Ee=Tt({type:"list",ordered:!1,items:[we],raw:"- Probe paragraph text"});Xs.value=ye,er.value=we,mo.value=Ee;const ze={1:null,2:null,3:null,4:null,5:null,6:null};for(let nt=1;nt<=6;nt++)ze[nt]=Tt({type:"heading",level:nt,text:"Probe heading",children:[{type:"text",content:"Probe heading",raw:"Probe heading"}],raw:`${"#".repeat(nt)} Probe heading`});Vo.value=ze})()},{immediate:!0}),Be([()=>T.value,In],()=>{if(!In.value)return qd(),void(Q.value=0);_y(),qd(),In.value&&T.value&&typeof ResizeObserver<"u"&&(Fr=new ResizeObserver(()=>{_y(),Qo.value&&Tr(),Go.value&&v1(),so("resize")}),Fr.observe(T.value))},{immediate:!0}),Be([In,Pt,ke],()=>ao(null,null,function*(){if(!In.value)return ie.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void eo();yield pt(),(function(){if(!In.value||typeof window>"u")return ie.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void eo();const W={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},se=Pg(Og(R.value),".paragraph-node");W.paragraph=W5(R.value,se,"pre-wrap");const ye=Og(P.value),we=ye?.querySelector(".paragraph-node");W.listItem=W5(P.value,we,"pre-wrap");const Ee=Ye("readSimpleTextProbeProfile.list.offsetHeight",()=>{var nt,it;return(it=(nt=j.value)==null?void 0:nt.offsetHeight)!=null?it:0}),ze=Ye("readSimpleTextProbeProfile.listItem.offsetHeight",()=>{var nt,it;return(it=(nt=P.value)==null?void 0:nt.offsetHeight)!=null?it:0});W.listWrapperOverhead=Math.max(0,Ee-ze);for(let nt=1;nt<=6;nt++){const it=Pg(Og(B[nt]),`h${nt}`);W.headings[nt]=W5(B[nt],it,"pre-wrap")}ie.value=W,eo()})()}),{flush:"post",immediate:!0}),Be(()=>Gt.value.length,()=>{Mn.value&&Us({immediate:!0})}),Be([In,Q],()=>{eo(),Mn.value&&Us({immediate:!0}),Qo.value&&Tr(),Go.value&&v1(),so("resize")},{immediate:!1}),Be(()=>yi.value,W=>{if(W)for(const[se,ye]of Oo)Ry(se,ye);else if(Qu(),Mn.value)Us({immediate:!0});else for(const[se,ye]of Oo)ye&&Qr(se,!0)},{immediate:!1}),Be([ae,he,()=>J()],()=>{var W;(W=Ya.refresh)==null||W.call(Ya);for(const[se,ye]of Oo)Ry(se,ye)},{immediate:!1}),Be([()=>I.viewportPriority,()=>Gt.value.length,he],([W,se,ye])=>{if(W!==!1){if(K.value&&(se<=200||se<=ye)){K.value=!1;for(const[we,Ee]of Oo)Ry(we,Ee)}}else K.value=!1}),Be(()=>Ko.value,()=>{Mn.value&&Us({immediate:!0})}),Be([Gr,zn,Di,()=>Gt.value.length,Mn],()=>{tl()},{immediate:!0});let e0=null,t0=!1,A1=null;function n0(){e0=null,Gn=null,Wn=void 0,ui=null,Yg()}function l8(){w1(),vn(),eo(),vo.clear();const W=Gt.value.length;W>0&&ds(W),J3()}function u8(){s8(),Cn(),Gg=null,Th=null,Eh=null,Ly=null,Vg=null,Kg=null,t0=!1,n0(),ln("restore"),ba(),g1()}function i0(W){var se;return[(se=Bo())!=null?se:"",Ui(),Rl(),Ud.value,Qg(W),Gt.value.length,Math.round(or(0,Gt.value.length)),Math.round(Qc()),Pi.count,Math.round(Pi.total)].join(":")}function qM(){return ao(this,null,function*(){var W,se,ye,we;const Ee=(W=i.virtualScroll)==null?void 0:W.settledToken,ze=Qg(Ee),nt=Ui(),it=Bo(),yt=ke.value;if(jt.value&&((se=i.virtualScroll)==null?void 0:se.settleMode)==="manual"&&si(Ee))if(dr()){if(i0(Ee)!==ui&&!t0){t0=!0;try{const ut=yield e8({reason:"manual",expectedSettledTokenKey:ze}),st=Qg()===ze;X3(nt,it,yt)&&ut.sessionKey===nt&&ut.threadKey===it&&st&&ut.stable&&ut.phase==="final"&&(ui=i0((ye=i.virtualScroll)==null?void 0:ye.settledToken))}finally{t0=!1,yield pt();const ut=(we=i.virtualScroll)==null?void 0:we.settledToken,st=si(ut)?i0(ut):"";X3(nt,it,yt)&&st&&ui!==st&&qM()}}}else so("manual")})}Be(jt,(W,se)=>{if(W!==se){if(!W)return u8(),void s8();u8(),l8(),A1=ke.value,so("content")}},{flush:"post"}),Be([jt,ke],([W,se])=>{W?A1!=null?A1!==se&&(A1=se,(function(ye="resize"){w1(),vn(),eo(),vo.clear();const we=Gt.value.length;we>0&&ds(we),J3(),Th=null,Eh=null,Ly=null,Gg=null,t0=!1,n0(),DM(),pt(()=>{Vd(),Qo.value&&Tr(),Go.value&&v1(),so(ye)})})("resize")):A1=se:A1=null},{flush:"post",immediate:!0}),Be([jt,()=>Ui(),()=>Bo()],([W])=>{W&&(u8(),l8(),ln("content"),so("content"))}),Be([jt,()=>Ui(),()=>Bo(),ke,()=>Gt.value.length],([W])=>{W&&(function(se="async-node"){let ye=!1;for(const[we,Ee]of Array.from(ur.entries()))vt(Ee)||(ur.delete(we),qs.delete(we),ye=!0);ye&&(Ze(),so(se))})("async-node")},{flush:"post"}),Be([jt,()=>{var W;return(W=i.virtualScroll)==null?void 0:W.sessionKey},()=>{var W;return(W=i.virtualScroll)==null?void 0:W.measurementKey},()=>i.indexKey,()=>V.value],([W])=>{W&&(Yg(),(function(se="content"){if(!jt.value)return;const ye=[],we=Gt.value.length,Ee=_h(we);for(const ze of Array.from(vo.keys())){if(ze>=we){ye.push(ze);continue}if(ze=we&&vo.delete(ze);ye.length&&((function(ze,nt={}){const it=Array.from(ze,Number);qe(it);let yt=0;if(Re(()=>(yt=wa(it,nt),yt>0)),yt>0)(function(ut){for(const st of ut)vo.delete(st)})(it);else for(const ut of it)Ir.delete(ut)})(ye,{notify:!1}),eo(),n0(),Qo.value&&Tr(),Go.value&&v1(),so(se))})("content"))},{flush:"post",immediate:!0}),Be([jt,()=>Gt.value.length,()=>Ui(),()=>Bo()],([W,se,ye,we],[Ee,ze,nt,it])=>{W&&Ee&&ye===nt&&we===it&&se!==ze&&n0()},{flush:"post"}),Be([jt,()=>{var W;return(W=i.virtualScroll)==null?void 0:W.heightCache},()=>{var W;return(W=i.virtualScroll)==null?void 0:W.heightCacheWidth},()=>{var W;return(W=i.virtualScroll)==null?void 0:W.restoreState},()=>{var W;return(W=i.virtualScroll)==null?void 0:W.measurementKey},()=>Gt.value.length,()=>Ui(),Q],()=>{DM()},{flush:"post",immediate:!0}),Be([jt,()=>{var W;return(W=i.virtualScroll)==null?void 0:W.restoreState},()=>{var W;return(W=i.virtualScroll)==null?void 0:W.restoreAnchor},()=>{var W;return(W=i.virtualScroll)==null?void 0:W.measurementKey},()=>Gt.value.length,()=>Ui(),Q],W=>ao(null,[W],function*([se,ye]){if(!se||!ye)return;yield pt();const we=(function(){var Ee;const ze=(Ee=i.virtualScroll)==null?void 0:Ee.restoreAnchor;return ze==null||ze===!1?null:ze===!0?"true":String(ze)})();Y3(ye,{restoreAnchor:we!=null,restoreToken:we??void 0})}),{flush:"post",immediate:!0}),Be([jt,Q,()=>{var W;return(W=i.virtualScroll)==null?void 0:W.restoreState},()=>{var W;return(W=i.virtualScroll)==null?void 0:W.measurementKey}],([W])=>{var se;if(!W)return;const ye=(se=i.virtualScroll)==null?void 0:se.restoreState;ye&&Th&&Eh==="restore"&&(FM(ye)||(l8(),Th=null,Eh=null,so("resize")))},{flush:"post"}),Be([jt,()=>Gt.value.length,()=>Ui(),Q],W=>ao(null,[W],function*([se]){var ye;const we=Vg,Ee=Kg;se&&we&&(yield pt(),!Y3(we,{restoreAnchor:Ee?.restoreAnchor===!0,restoreToken:(ye=Ee?.restoreToken)!=null?ye:"imperative",allowUncapturedAnchor:Ee?.allowUncapturedAnchor===!0})&&OM(we)||(Vg=null,Kg=null))}),{flush:"post",immediate:!0}),Be([jt,Fe,()=>{var W;return(W=i.virtualScroll)==null?void 0:W.settleMode},()=>Ui(),()=>Bo(),ke,xh,Wd,()=>Ko.value,Me,()=>Pi.count,()=>Pi.total],([W,se,ye])=>{if(!W||se!==!0||ye==="manual"||!hs())return;const we=(function(){var Ee;const ze=Gt.value.length;return[(Ee=Bo())!=null?Ee:"",Ui(),Rl(),Ud.value,ze,Math.round(or(0,ze)),Math.round(Qc()),Pi.count,Math.round(Pi.total)].join(":")})();e0!==we&&(e0=we,e8({reason:"final"}).then(Ee=>{Ee.stable||e0!==we||(e0=null)}))},{flush:"post",immediate:!0}),Be([jt,Fe,()=>{var W;return(W=i.virtualScroll)==null?void 0:W.settleMode},()=>{var W;return(W=i.virtualScroll)==null?void 0:W.settledToken},()=>Ui(),()=>Bo(),ke,xh,Wd,()=>Ko.value,Me,()=>Gt.value.length,()=>Pi.count,()=>Pi.total],()=>{qM()},{flush:"post",immediate:!0}),Be([()=>Gt.value.length,Mn,zn,Di,()=>_o.start,()=>_o.end],([W,se,ye,we,Ee,ze])=>{ce.value&&Oe("virtualization",{nodes:W,virtualization:se,maxLiveNodes:ye,buffer:we,focusIndex:Gr.value,scroll:se?(()=>{const nt=el.value||le();return nt?{reverse:xe(nt),scrollTop:Math.round(nt.scrollTop),scrollTopAbs:Math.round(Math.abs(nt.scrollTop)),scrollHeight:Math.round(nt.scrollHeight),clientHeight:Math.round(nt.clientHeight)}:null})():null,liveRange:{start:Ee,end:ze},rendered:Ko.value})}),Be([()=>I.customId],([W],se,ye)=>{if(!W||tr)return;const we=(function(Ee,ze){return Ee?(Ls.controllers[Ee]=ze,()=>{Ls.controllers[Ee]===ze&&delete Ls.controllers[Ee]}):()=>{}})(W,{captureRestoreAnchor:rr,restoreAnchor:Er,getAnchorDrift:fu,getReport:Hg});ye(()=>{we()})},{immediate:!0}),ii(()=>{(function(){if(jt.value)try{Vd(),Zg();const W=Yu("manual");$M(W)&&(D(W),Gg=W,t8=k1());const se=m1(W,{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:!1,requireViewport:!0,includeEmptyState:!0});se&&(H(se),se.anchor&&$(se.anchor),y1=Jg(se))}catch{}})(),xX(),Qu(),ue(),WM();for(const W of xa.values())for(const se of W)zt(se);xa.clear(),Fl.clear(),vo.clear(),a8(),w1(),qd(),ba(),g1(),s8(),Dg(),Po()});const SX=V0("ViewportDeferredMermaidBlockNode",Ac({loader:()=>ao(null,null,function*(){try{return(yield ts(()=>import("./index11-DknOc_PX.js"),__vite__mapDeps([7,5]))).default}catch(W){return console.warn('[markstream-vue] Optional peer dependencies for MermaidBlockNode are missing. Falling back to preformatted code rendering. To enable Mermaid rendering, please install "mermaid".',W),Na}}),loadingComponent:pD,delay:0}),pD),_X=V0("ViewportDeferredInfographicBlockNode",Ac({loader:()=>ao(null,null,function*(){try{return(yield ts(()=>import("./index10-CS88G5vz.js"),[])).default}catch(W){return console.warn('[markstream-vue] Failed to load InfographicBlockNode. Falling back to preformatted code rendering. To enable Infographic rendering, install "@antv/infographic" and configure setInfographicLoader with a dynamic loader.',W),Na}}),loadingComponent:hD,delay:0}),hD),IX=V0("ViewportDeferredD2BlockNode",Ac(()=>ao(null,null,function*(){try{return(yield ts(()=>import("./index8-DgkTsrAC.js"),[])).default}catch(W){return console.warn('[markstream-vue] Optional peer dependencies for D2BlockNode are missing. Falling back to preformatted code rendering. To enable D2 rendering, please install "@terrastruct/d2".',W),Na}})),Na),UM={text:qo,paragraph:Np,heading:e3,code_block:F5,list:Om,list_item:Dm,blockquote:Dk,table:Ev,definition_list:Ok,footnote:Pk,footnote_reference:ml,footnote_anchor:Mv,admonition:jk,vmr_container:$k,hardbreak:Of,link:da,image:Df,thematic_break:Bk,math_inline:Wu,math_block:yV,strong:ua,emphasis:fa,strikethrough:ca,highlight:vl,insert:ja,subscript:za,superscript:$a,emoji:Ba,checkbox:pl,checkbox_input:pl,inline_code:Hr,html_inline:gl,reference:la,html_block:Tv},VM=O(()=>p1()),KM=O(()=>JR(I.codeBlockProps)),MX=O(()=>JR(I.codeBlockProps,{omit:["langs"]})),c8=O(()=>Dt(Dt({stream:I.codeBlockStream,darkTheme:I.codeBlockDarkTheme,lightTheme:I.codeBlockLightTheme,monacoOptions:I.codeBlockMonacoOptions,themes:I.themes,langs:m.value==="shiki"?I.langs:void 0,minWidth:I.codeBlockMinWidth,maxWidth:I.codeBlockMaxWidth},typeof me.value=="boolean"?{showTooltips:me.value}:{}),MX.value)),d8=O(()=>Dt(Pn(Dt({},c8.value),{langs:I.langs}),KM.value));function ZM(W){return typeof W=="boolean"?W:void 0}const GM=O(()=>{const W=I.codeBlockProps||{},se={},ye=ZM(W.showLineNumbers);ye!==void 0&&(se.showLineNumbers=ye);const we=ZM(W.diffInline);we!==void 0&&(se.diffInline=we);const Ee=(function(ze){const nt=Number(ze);return Number.isFinite(nt)&&nt>0?nt:void 0})(W.reservedHeightPx);return Ee!==void 0&&(se.reservedHeightPx=Ee),se}),TX=O(()=>Dt(Dt({stream:I.codeBlockStream,darkTheme:I.codeBlockDarkTheme,lightTheme:I.codeBlockLightTheme,themes:I.themes,langs:I.langs,minWidth:I.codeBlockMinWidth,maxWidth:I.codeBlockMaxWidth},typeof me.value=="boolean"?{showTooltips:me.value}:{}),KM.value)),QM=O(()=>Dt({},I.mermaidProps||{})),f8=O(()=>Dt({},I.d2Props||{})),YM=O(()=>Dt({},I.infographicProps||{})),C1=O(()=>({typewriter:f.value,fade:I.fade,customHtmlTags:Ro.value.customHtmlTags})),JM=O(()=>Dt(Dt({},C1.value),typeof me.value=="boolean"?{showTooltip:me.value}:{})),XM=O(()=>Dt(Dt({},C1.value),typeof me.value=="boolean"?{showTooltips:me.value}:{})),eT=O(()=>Dt(Dt({},C1.value),typeof me.value=="boolean"?{showTooltips:me.value}:{})),tT=O(()=>Dt(Dt({},C1.value),typeof me.value=="boolean"?{showTooltips:me.value}:{}));function EX(W){return Array.isArray(W.children)&&W.children.length>0}const nT=new WeakMap,iT=new WeakMap;function h8(W,se){var ye;const we=String((ye=W?.code)!=null?ye:""),Ee=iT.get(W);if(Ee&&Ee.code===we)return Ee.height;const ze=se(we);return iT.set(W,{code:we,height:ze}),ze}const Dy=O(()=>Ty.value.map(W=>{var se,ye,we,Ee,ze,nt;const it=[yt=W.index,In.value?Zc.value[yt]:null,m.value==="pre",sn.value,li.value,ge.value,Gc.value,VM.value,$n,Kc.value,GM.value,c8.value,d8.value,QM.value,YM.value,f8.value,C1.value,JM.value,XM.value,eT.value,tT.value];var yt;const ut=nT.get(W.node);if(ut&&(function(Qt,xn){if(Qt.length!==xn.length)return!1;for(let Zt=0;Zt!(I.domMode!=="minimal"||Y.value||I.fade!==!1||f.value||_a.value||Do.value||Mn.value||lt.value||hn.value||Bd.value||Object.keys(sn.value).length!==0));let s0,x1=null,g8=0,Py=0,By=0;const cT=["code_block","admonition","table","math_block","html_block","image","thematic_break"],RX=new Set(cT),dT=[".typewriter-cursor",".height-estimation-probes",...cT.map(W=>`[data-node-type="${W}"]`),"script","style"].join(",");function fT(W){if(!W||typeof W!="object")return!1;const se=W.type;return typeof se=="string"&&RX.has(se)}function $y(W){var se,ye;if(!W||typeof W!="object")return 0;const we=W,Ee=(ye=(se=we.raw)!=null?se:we.content)!=null?ye:we.code;if(typeof Ee=="string")return Ee.length;const ze=we.children;if(Array.isArray(ze))return ze.reduce((it,yt)=>it+$y(yt),0);const nt=we.items;return Array.isArray(nt)?nt.reduce((it,yt)=>it+$y(yt),0):0}function zy(){s0&&(clearTimeout(s0),s0=void 0)}function v8(){g8+=1,x1!=null&&(ls?.(x1),x1=null)}function r0(){v8(),Kd(),Fh.value&&(Fh.value.style.visibility="hidden")}function DX(W){var se;if(W.nodeType!==Node.TEXT_NODE||!((se=W.textContent)!=null?se:"").trim())return!1;const ye=W.parentElement;return!!ye&&!ye.closest(dT)}function OX(W){let se=W.lastChild;for(;se;){if(DX(se))return se;if(se.nodeType===Node.ELEMENT_NODE){const ye=se;if(!ye.matches(dT)&&ye.lastChild){se=ye.lastChild;continue}}for(;se&&se!==W&&!se.previousSibling;)se=se.parentNode;if(!se||se===W)break;se=se.previousSibling}return null}function hT(){const W=Dy.value;for(let se=W.length-1;se>=0;se--){const ye=W[se];if(!ye||fT(ye.node)||!Fy(ye.index))continue;const we=Oo.get(ye.index);if(!we)continue;const Ee=OX(we);if(Ee)return Ee}return null}function Kd(){o0.value&&(o0.value.classList.remove(mD),o0.value=null)}function jy(){if(d.value!=="simple"||!U||!_a.value||!T.value)return void Kd();const W=hT(),se=W?(function(ye){var we;const Ee=(we=ye.parentElement)==null?void 0:we.closest(".text-node");return Ee instanceof HTMLElement?Ee:ye.parentElement})(W):null;se!==o0.value&&(Kd(),se&&(se.classList.add(mD),o0.value=se))}function Hy(){if(d.value!=="precise"||!U||!_a.value||x1!=null)return;const W=g8,se=()=>{x1=null,W===g8&&(function(){var ye,we;if(d.value!=="precise"||!(U&&_a.value&&T.value&&Fh.value))return;const Ee=T.value,ze=Fh.value;ze.style.visibility="hidden";const nt=hT();if(!nt)return;let it=0,yt=0,ut=20,st=!1;if(nt?.textContent){const kt=nt.textContent.length,Qe=document.createRange();Qe.setStart(nt,Math.max(0,kt-1)),Qe.setEnd(nt,kt);const ft=typeof Qe.getClientRects=="function"?Qe.getClientRects():void 0,St=(we=ft?.[ft.length-1])!=null?we:(ye=nt.parentElement)==null?void 0:ye.getBoundingClientRect();if(St){const bt=Ye("typewriterCursor.root.getBoundingClientRect",()=>Ee.getBoundingClientRect());it=St.right-bt.left+Ee.scrollLeft,yt=St.top-bt.top+Ee.scrollTop,ut=St.height||ut,st=!0}Qe.detach()}st&&(ze.style.transform=`translate(${Math.max(0,it)}px, ${Math.max(0,yt)}px)`,ze.style.height=`${ut}px`,ze.style.visibility="visible")})()};Oi?x1=Oi(se):se()}return Be([Ae,()=>i.content,()=>i.nodes,()=>I.typewriter,Fe],()=>ao(null,null,function*(){var W,se;if(!U||Y.value||!re.value)return;if(Fe.value)return _a.value=!1,zy(),void r0();if((W=i.nodes)!=null&&W.length)return _a.value=!1,zy(),r0(),Py=((se=i.content)!=null?se:"").length,void(By=Ae.value.length);const ye=(function(){var it,yt;return(it=i.nodes)!=null&&it.length?i.nodes.reduce((ut,st)=>ut+$y(st),0):((yt=i.content)!=null?yt:"").length})(),we=(function(){var it;return(it=i.nodes)!=null&&it.length?i.nodes.reduce((yt,ut)=>yt+$y(ut),0):Ae.value.length})(),Ee=!fT(Gt.value[Gt.value.length-1]),ze=ye>Py,nt=we>By;if(!f.value||!Ee||!ze&&!nt)return f.value&&Ee||(_a.value=!1,r0()),Py=ye,void(By=we);Py=ye,By=we,_a.value=!0,d.value==="precise"&&Fh.value&&(Fh.value.style.visibility="hidden"),zy(),yield pt(),d.value==="simple"?jy():(Kd(),Hy()),s0=setTimeout(()=>{s0=void 0,_a.value=!1},3e3)}),{flush:"post",immediate:!0}),Be(_a,W=>ao(null,null,function*(){W?(yield pt(),d.value!=="simple"?(Kd(),d.value==="precise"&&Hy()):jy()):r0()}),{flush:"post"}),Be(d,()=>ao(null,null,function*(){if(U&&!Y.value&&re.value&&_a.value){if(yield pt(),d.value==="simple")return v8(),void jy();Kd(),d.value!=="precise"?r0():Hy()}}),{flush:"post"}),Be([()=>Ko.value,()=>_o.start,()=>_o.end],()=>ao(null,null,function*(){U&&!Y.value&&re.value&&_a.value&&(yield pt(),d.value!=="simple"?(Kd(),d.value==="precise"&&Hy()):jy())}),{flush:"post"}),ii(()=>{zy(),v8(),Kd(),gn.clear()}),(W,se)=>{const ye=qz("NodeRenderer",!0);return p(Y)?(k(!0),N(Ne,{key:0},wt(Dy.value,we=>(k(),N(Ne,{key:we.vnodeKey},[we.rendersCustomNode?(k(),fe(zo(we.component),ci({key:0,ref_for:!0},we.customBindings,{node:we.node,loading:we.node.loading,"index-key":we.indexKey,"custom-id":I.customId,"is-dark":I.isDark,onClick:m8,onMouseover:lT,onMouseout:uT,onCopy:se[0]||(se[0]=Ee=>s(Ee)),onHandleArtifactClick:se[1]||(se[1]=Ee=>o("handleArtifactClick",Ee))}),{default:de(()=>[we.hasSlotChildren?(k(),fe(ye,ci({key:0,ref_for:!0},fo.value,{nodes:we.node.children,"index-key":we.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):we.slotContent?(k(),fe(ye,ci({key:1,ref_for:!0},fo.value,{content:we.slotContent,final:!we.node.loading,"index-key":`${we.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ne("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(k(),fe(zo(we.component),ci({key:1,node:we.node,loading:we.node.loading,"index-key":we.indexKey},{ref_for:!0},we.bindings,{"custom-id":I.customId,"is-dark":I.isDark,onClick:m8,onMouseover:lT,onMouseout:uT,onCopy:se[2]||(se[2]=Ee=>s(Ee)),onHandleArtifactClick:se[3]||(se[3]=Ee=>o("handleArtifactClick",Ee))}),null,16,["node","loading","index-key","custom-id","is-dark"]))],64))),128)):(k(),N("div",{key:1,ref_key:"containerRef",ref:T,class:De(["markstream-vue markdown-renderer",[{dark:I.isDark},{virtualized:Mn.value},{"virtual-scroll-coordinated":Rt.value},{"stable-layout":ar.value},{"typewriter-simple-cursor":_a.value&&d.value==="simple"}]]),"data-custom-id":I.customId,onClick:m8,onMouseover:LX,onMouseout:NX},[Es.value||Mn.value?(k(),N(Ne,{key:0},[Es.value?(k(),fe(p3e,{key:0,width:Pt.value,"flow-root":Mn.value||Rt.value,"paragraph-node":Xs.value,"list-item-node":er.value,"list-node":mo.value,"heading-nodes":Vo.value,"set-paragraph-wrapper":Hn,"set-list-item-wrapper":Ai,"set-list-wrapper":to,"set-heading-wrapper":Sy},null,8,["width","flow-root","paragraph-node","list-item-node","list-node","heading-nodes"])):ne("",!0),Mn.value?(k(),N("div",{key:1,class:"node-spacer",style:an({height:`${$g.value}px`}),"aria-hidden":"true"},null,4)):ne("",!0)],64)):ne("",!0),FX.value?(k(!0),N(Ne,{key:1},wt(Dy.value,we=>(k(),N(Ne,{key:we.vnodeKey},[Fy(we.index)?(k(),fe(zo(we.component),ci({key:0,node:we.node,loading:we.node.loading,"index-key":we.indexKey},{ref_for:!0},we.bindings,{"custom-id":I.customId,"is-dark":I.isDark,onMouseover:se[4]||(se[4]=Ee=>o("mouseover",Ee)),onMouseout:se[5]||(se[5]=Ee=>o("mouseout",Ee)),onCopy:se[6]||(se[6]=Ee=>s(Ee)),onHandleArtifactClick:se[7]||(se[7]=Ee=>o("handleArtifactClick",Ee))}),null,16,["node","loading","index-key","custom-id","is-dark"])):ne("",!0)],64))),128)):(k(!0),N(Ne,{key:2},wt(Dy.value,we=>(k(),N("div",{key:we.vnodeKey,ref_for:!0,ref:Ee=>Ry(we.index,Ee),class:"node-slot","data-node-index":we.index,"data-node-type":we.node.type},[Fy(we.index)?(k(),N("div",{key:0,ref_for:!0,ref:Ee=>(function(ze,nt){var it;nt||(function(kt){const Qe=`${p1()}-${kt}`;let ft=!1;for(const St of Array.from(qs.keys())){const bt=ur.get(St);(bt?.index===kt||St===Qe||St.startsWith(`${Qe}-`))&&(qs.delete(St),ur.delete(St),ft=!0)}ft&&(Ze(),so("async-node"))})(ze),lr.delete(ze),(function(kt){var Qe;const ft=((Qe=Fl.get(kt))!=null?Qe:0)+1;Fl.set(kt,ft)})(ze);const yt=xa.get(ze);if(yt){for(const kt of yt)zt(kt);xa.delete(ze)}if((function(kt){const Qe=Xa.get(kt);Qe&&(go?.unobserve(Qe),Wc.delete(Qe),Xa.delete(kt))})(ze),!nt||!Hc.value)return Nr.delete(ze),void Fl.delete(ze);Nr.set(ze,nt);const ut=()=>{Xg(ze,nt)};queueMicrotask(ut);const st=(go||typeof ResizeObserver>"u"||(go=new ResizeObserver(kt=>{if(kt.length)for(const Qe of kt){const ft=Wc.get(Qe.target),St=Xa.get(ft??-1);ft!=null&&St&&Xg(ft,St)}else Vd()})),go);if(st&&(Xa.set(ze,nt),Wc.set(nt,ze),st.observe(nt)),typeof window<"u"){const kt=((it=Gt.value[ze])==null?void 0:it.type)==="code_block"?[16,80,240,800]:Fe.value?[80]:[];if(kt.length){const Qe=kt.map(ft=>gt(ft,ut,"node-resize")).filter(ft=>ft!=null);Qe.length&&xa.set(ze,Qe)}}})(we.index,Ee),class:"node-content"},[we.isCodeBlock?we.rendersCustomNode?(k(),fe(zo(we.component),ci({key:1,ref_for:!0},we.customBindings,{node:we.node,loading:we.node.loading,"index-key":we.indexKey,"custom-id":I.customId,"is-dark":I.isDark,onCopy:se[12]||(se[12]=Ee=>s(Ee)),onHandleArtifactClick:se[13]||(se[13]=Ee=>o("handleArtifactClick",Ee))}),{default:de(()=>[we.hasSlotChildren?(k(),fe(ye,ci({key:0,ref_for:!0},fo.value,{nodes:we.node.children,"index-key":we.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):we.slotContent?(k(),fe(ye,ci({key:1,ref_for:!0},fo.value,{content:we.slotContent,final:!we.node.loading,"index-key":`${we.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ne("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(k(),fe(zo(we.component),ci({key:2,node:we.node,loading:we.node.loading,"index-key":we.indexKey},{ref_for:!0},we.bindings,{"custom-id":I.customId,"is-dark":I.isDark,onCopy:se[14]||(se[14]=Ee=>s(Ee)),onHandleArtifactClick:se[15]||(se[15]=Ee=>o("handleArtifactClick",Ee))}),null,16,["node","loading","index-key","custom-id","is-dark"])):(k(),fe(wo,{key:0,name:"fade",css:I.fade!==!1,appear:I.fade!==!1},{default:de(()=>[we.rendersCustomNode?(k(),fe(zo(we.component),ci({key:0,ref_for:!0},we.customBindings,{node:we.node,loading:we.node.loading,"index-key":we.indexKey,"custom-id":I.customId,"is-dark":I.isDark,onCopy:se[8]||(se[8]=Ee=>s(Ee)),onHandleArtifactClick:se[9]||(se[9]=Ee=>o("handleArtifactClick",Ee))}),{default:de(()=>[we.hasSlotChildren?(k(),fe(ye,ci({key:0,ref_for:!0},fo.value,{nodes:we.node.children,"index-key":we.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):we.slotContent?(k(),fe(ye,ci({key:1,ref_for:!0},fo.value,{content:we.slotContent,final:!we.node.loading,"index-key":`${we.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):ne("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(k(),fe(zo(we.component),ci({key:1,node:we.node,loading:we.node.loading,"index-key":we.indexKey},{ref_for:!0},we.bindings,{"custom-id":I.customId,"is-dark":I.isDark,onCopy:se[10]||(se[10]=Ee=>s(Ee)),onHandleArtifactClick:se[11]||(se[11]=Ee=>o("handleArtifactClick",Ee))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1032,["css","appear"]))],512)):(k(),N("div",{key:1,class:"node-placeholder",style:an({height:`${Mr(we.index)}px`})},null,4))],8,v3e))),128)),_a.value&&d.value==="precise"?(k(),N("span",{key:3,ref_key:"typewriterCursorRef",ref:Fh,class:"typewriter-cursor","aria-hidden":"true"},null,512)):ne("",!0),Mn.value?(k(),N("div",{key:4,class:"node-spacer",style:an({height:`${zg.value}px`}),"aria-hidden":"true"},null,4)):ne("",!0)],42,g3e))}}})),[["__scopeId","data-v-9d192751"]]),Ha=NV;Ha.install=e=>{const t=new Set(["MarkdownRender","NodeRenderer",Ha.__name,Ha.name].filter(n=>!!n));for(const n of t)e.component(n,NV)};const M_=Object.freeze(Object.defineProperty({__proto__:null,default:Ha},Symbol.toStringTag,{value:"Module"})),y3e={key:0,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},k3e={key:1,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},b3e={key:2,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},w3e={key:3,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},A3e={class:"admonition-title"},C3e=["aria-expanded","aria-controls"],x3e=["id"],jk=Ri(ot({__name:"AdmonitionNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e,{emit:t}){var n;const i=e,o=t,s=O(()=>{if(i.node.title&&i.node.title.trim().length)return i.node.title;const u=i.node.kind||"note";return u.charAt(0).toUpperCase()+u.slice(1)}),r=q(!!i.node.collapsible&&!((n=i.node.open)==null||n));function a(){i.node.collapsible&&(r.value=!r.value)}const l=`admonition-${Math.random().toString(36).slice(2,9)}`;return(u,c)=>(k(),N("div",{class:De(["admonition",[`admonition-${i.node.kind}`]])},[S("div",{id:l,class:"admonition-legend"},[i.node.kind==="note"||i.node.kind==="info"?(k(),N("svg",y3e,[...c[1]||(c[1]=[S("circle",{cx:"12",cy:"12",r:"10"},null,-1),S("path",{d:"M12 16v-4"},null,-1),S("path",{d:"M12 8h.01"},null,-1)])])):i.node.kind==="tip"?(k(),N("svg",k3e,[...c[2]||(c[2]=[S("path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5"},null,-1),S("path",{d:"M9 18h6"},null,-1),S("path",{d:"M10 22h4"},null,-1)])])):i.node.kind==="warning"||i.node.kind==="caution"?(k(),N("svg",b3e,[...c[3]||(c[3]=[S("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"},null,-1),S("path",{d:"M12 9v4"},null,-1),S("path",{d:"M12 17h.01"},null,-1)])])):i.node.kind==="danger"||i.node.kind==="error"?(k(),N("svg",w3e,[...c[4]||(c[4]=[S("polygon",{points:"7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2"},null,-1),S("path",{d:"M12 8v4"},null,-1),S("path",{d:"M12 16h.01"},null,-1)])])):ne("",!0),S("span",A3e,z(s.value),1),i.node.collapsible?(k(),N("button",{key:4,class:"admonition-toggle","aria-expanded":!r.value,"aria-controls":`${l}-content`,onClick:a},[(k(),N("svg",{style:an({rotate:r.value?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[...c[5]||(c[5]=[S("path",{d:"m9 18 6-6-6-6"},null,-1)])],4))],8,C3e)):ne("",!0)]),ri(S("div",{id:`${l}-content`,class:"admonition-content","aria-labelledby":l},[G(p(Ha),{"index-key":`admonition-${e.indexKey}`,nodes:i.node.children,"custom-id":i.customId,typewriter:i.typewriter,fade:i.fade,onCopy:c[0]||(c[0]=d=>o("copy",d))},null,8,["index-key","nodes","custom-id","typewriter","fade"])],8,x3e),[[jo,!r.value]])],2))}}),[["__scopeId","data-v-a83480e1"]]);jk.install=e=>{e.component(jk.__name,jk)};const l7=()=>ts(()=>import("./d2_markstream-vue-yoD6TSFD.js"),[]);let I9=null,M9=l7,T9=null,gD=!1,vD=!1;function a6t(){return ao(this,null,function*(){if(I9)return I9;const e=M9;return e?e===l7&&gD?null:T9||(T9=ao(null,null,function*(){let t;try{t=yield e()}catch(n){if(e===l7)return e===M9&&(gD=!0,(function(i){vD||(vD=!0,console.warn('[markstream-vue] Optional dependency "@terrastruct/d2" is not installed. D2 blocks will render as source.',i))})(n)),null;throw n}finally{e===M9&&(T9=null)}return e!==M9?null:t?(I9=(function(n){var i;if(!n)return n;if(n.D2&&typeof n.D2=="function")return n.D2;if(n.default&&n.default.D2&&typeof n.default.D2=="function")return n.default.D2;const o=(i=n.default)!=null?i:n;return typeof o=="function"?o:o?.D2&&typeof o.D2=="function"?o.D2:o})(t),I9):null}),T9):null})}let E9=null,FV=null,L9=null;function l6t(){return typeof FV=="function"}function u6t(){return ao(this,null,function*(){if(E9)return E9;const e=FV;return e?L9||(L9=ao(null,null,function*(){const t=yield e(),n=(function(i){var o,s,r;if(!i)return null;const a=(o=i.default)!=null?o:i,l=typeof a=="function"&&typeof((s=a.prototype)==null?void 0:s.render)=="function"?a:(r=i.Infographic)!=null?r:a?.Infographic;return typeof l=="function"?l:null})(t);return n?(E9=n,E9):null}).finally(()=>{L9=null}),L9):null})}const c6t=Symbol("markstreamLanguageIconResolver");function S3e(e){return new Worker("/assets/katexRenderer.worker-CO_gEm4q.js",{type:"module",name:e?.name})}function _3e(e){return new Worker("/assets/mermaidParser.worker-BFSlSHEW.js",{type:"module",name:e?.name})}let yD=!1;function RV(){yD||typeof Worker>"u"||(yD=!0,ibe(new S3e),gbe(new _3e))}RV();function Cf(e,t,n="/api/v1"){return`${e}${n}${t.startsWith("/")?t:`/${t}`}`}function kD(e,t){const n=new URL(`${e}/api/v1/ws`);return n.protocol=n.protocol==="https:"?"wss:":"ws:",n.searchParams.set("client_id",t),n.toString()}const T_={},b4=Symbol("resolveImage"),ac=3e4,N9=5*6e4,bD=5*6e4,DV="0123456789ABCDEFGHJKMNPQRSTVWXYZ",u7=500,OV=40101;function wD(e,t){for(const[n,i]of Object.entries(t))if(i!==void 0)if(Array.isArray(i))for(const o of i)o!==void 0&&e.append(n,String(o));else e.set(n,String(i))}function K0(e=ac){try{return AbortSignal.timeout(e)}catch{return}}function AD(e,t){const n=K0(e);if(n===void 0)return t;try{return AbortSignal.any([n,t])}catch{return t}}function I3e(e,t){let n="",i=e;for(let o=0;oDV[n%32]).join("")}function w0(){return`${I3e(Date.now(),10)}${M3e(16)}`}function CD(e){try{const t=[];return e.forEach((n,i)=>{typeof n=="string"?t.push({field:i,value:n}):t.push({field:i,file:n.name,size:n.size,type:n.type})}),{formData:t}}catch{return"[FormData]"}}async function q5(e){try{const t=await e.text();return t?t.length>u7?`${t.slice(0,u7)}...`:t:void 0}catch{return}}class xD{constructor(t){this.opts=t,this.tracer=t.tracer??T_}tracer;async get(t,n){return this.request("GET",t,void 0,n)}async getBlob(t,n,i){let o=Cf(this.opts.origin,t,this.opts.restBasePath);if(n){const c=new URLSearchParams;wD(c,n);const d=c.toString();d&&(o=`${o}?${d}`)}const s=w0(),r={"X-Request-Id":s};if(this.addClientHeaders(r),i?.prefixBytes!==void 0){if(!Number.isSafeInteger(i.prefixBytes)||i.prefixBytes<1)throw new RangeError("Media prefix size must be a positive integer");r.Range=`bytes=0-${i.prefixBytes-1}`}const a=Date.now();this.tracer.restRequest?.({method:"GET",path:t,url:o,requestId:s});let l;try{l=await fetch(o,{method:"GET",headers:r,signal:i?.signal?AD(ac,i.signal):K0()})}catch(c){throw this.tracer.restFailure?.({method:"GET",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-a,error:c}),new rl({message:`Network error calling GET ${t}`,cause:c,method:"GET",path:t,url:o,requestId:s,phase:"fetch",timeoutMs:ac,timestamp:Date.now(),durationMs:Date.now()-a})}if(l.ok){this.tracer.restResponse?.({method:"GET",path:t,requestId:s,status:l.status,durationMs:Date.now()-a,code:0,msg:""});const c=Number(l.headers.get("content-length")??0),d=i?.prefixBytes??i?.maxBytes;if(d!==void 0&&c>d)throw l.body?.cancel(),new Db({size:c,limit:d});if(i?.prefixBytes!==void 0&&l.body!==null){const f=l.body.getReader(),h=[];let m=0;try{for(;;){const{done:g,value:y}=await f.read();if(g)break;if(m+=y.byteLength,m>i.prefixBytes)throw new Db({size:m,limit:i.prefixBytes});h.push(new Uint8Array(y))}return new Blob(h,{type:l.headers.get("content-type")??""})}finally{await f.cancel(),f.releaseLock()}}return l.blob()}let u;try{u=await l.clone().json()}catch{}throw this.checkAuthRequired(l,u?.code??0),this.tracer.restResponse?.({method:"GET",path:t,requestId:s,status:l.status,durationMs:Date.now()-a,code:u?.code??l.status,msg:u?.msg??l.statusText,envelopeRequestId:u?.request_id}),new mc({code:u?.code??l.status,msg:u?.msg??l.statusText,requestId:u?.request_id??s,details:u?.details,timestamp:Date.now(),durationMs:Date.now()-a})}async post(t,n,i){return this.request("POST",t,n,void 0,i)}async postZip(t,n,i){const o="POST",s=Cf(this.opts.origin,t,this.opts.restBasePath),r=w0(),a={"X-Request-Id":r,"Content-Type":"application/json; charset=utf-8"};this.addClientHeaders(a);const l=Date.now();this.tracer.restRequest?.({method:o,path:t,url:s,requestId:r,body:i});let u;try{u=await fetch(s,{method:o,headers:a,body:JSON.stringify(n),signal:K0(N9)})}catch(h){throw this.tracer.restFailure?.({method:o,path:t,requestId:r,phase:"fetch",durationMs:Date.now()-l,error:h}),new rl({message:`Network error calling ${o} ${t}`,cause:h,method:o,path:t,url:s,requestId:r,phase:"fetch",timeoutMs:N9,timestamp:Date.now(),durationMs:Date.now()-l})}const c=u.headers.get("content-type")??void 0,d=c?.split(";",1)[0]?.trim().toLowerCase();if(!u.ok||d!=="application/zip"){let h;try{h=await u.clone().json()}catch{}if(this.checkAuthRequired(u,h?.code??0),!u.ok||h!==void 0&&h.code!==0){const y=h?.code??u.status,b=h?.msg??u.statusText;throw this.tracer.restResponse?.({method:o,path:t,requestId:r,status:u.status,durationMs:Date.now()-l,code:y,msg:b,envelopeRequestId:h?.request_id}),new mc({code:y,msg:b,requestId:h?.request_id??r,details:h?.details,timestamp:Date.now(),durationMs:Date.now()-l})}const m=u.clone(),g=new TypeError(`Expected application/zip, received ${c??"no content type"}`);throw this.tracer.restFailure?.({method:o,path:t,requestId:r,phase:"parse",durationMs:Date.now()-l,status:u.status,error:g}),new rl({message:`Invalid ZIP response from ${o} ${t}`,cause:g,method:o,path:t,url:s,requestId:r,phase:"parse",timeoutMs:N9,status:u.status,statusText:u.statusText,contentType:c,bodyPreview:await q5(m),timestamp:Date.now(),durationMs:Date.now()-l})}let f;try{f=await u.blob()}catch(h){throw this.tracer.restFailure?.({method:o,path:t,requestId:r,phase:"parse",durationMs:Date.now()-l,status:u.status,error:h}),new rl({message:`Failed to read ZIP response from ${o} ${t}`,cause:h,method:o,path:t,url:s,requestId:r,phase:"parse",timeoutMs:N9,status:u.status,statusText:u.statusText,contentType:c,timestamp:Date.now(),durationMs:Date.now()-l})}return this.tracer.restResponse?.({method:o,path:t,requestId:r,status:u.status,durationMs:Date.now()-l,code:0,msg:""}),{blob:f,contentDisposition:u.headers.get("content-disposition")??void 0}}async postForm(t,n,i){if(i?.onUploadProgress!==void 0)return this.postFormXhr(t,n,i.onUploadProgress,i.signal);const o=Cf(this.opts.origin,t,this.opts.restBasePath),s=w0(),r={"X-Request-Id":s};this.addClientHeaders(r);const a=Date.now();this.tracer.restRequest?.({method:"POST",path:t,url:o,requestId:s,body:CD(n)});const l=i?.signal,u=K0(),c=l===void 0?u:u===void 0?l:AbortSignal.any([u,l]);let d;try{d=await fetch(o,{method:"POST",headers:r,body:n,signal:c})}catch(m){throw this.tracer.restFailure?.({method:"POST",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-a,error:m}),new rl({message:`Network error calling POST ${t}`,cause:m,method:"POST",path:t,url:o,requestId:s,phase:"fetch",timeoutMs:ac,timestamp:Date.now(),durationMs:Date.now()-a})}let f;const h=d.clone();try{f=await d.json()}catch(m){throw this.tracer.restFailure?.({method:"POST",path:t,requestId:s,phase:"parse",durationMs:Date.now()-a,status:d.status,error:m}),new rl({message:`Failed to parse JSON response from POST ${t}`,cause:m,method:"POST",path:t,url:o,requestId:s,phase:"parse",timeoutMs:ac,status:d.status,statusText:d.statusText,contentType:d.headers.get("content-type")??void 0,bodyPreview:await q5(h),timestamp:Date.now(),durationMs:Date.now()-a})}if(this.tracer.restResponse?.({method:"POST",path:t,requestId:s,status:d.status,durationMs:Date.now()-a,code:f.code,msg:f.msg,envelopeRequestId:f.request_id,data:f.data}),this.checkAuthRequired(d,f.code),f.code!==0){const m=f.code??d.status;throw new mc({code:m,msg:f.msg??d.statusText,requestId:f.request_id??s,details:f.details,timestamp:Date.now(),durationMs:Date.now()-a})}return f.data}postFormXhr(t,n,i,o){const s=Cf(this.opts.origin,t,this.opts.restBasePath),r=w0(),a={"X-Request-Id":r};this.addClientHeaders(a);const l=Date.now();return this.tracer.restRequest?.({method:"POST",path:t,url:s,requestId:r,body:CD(n)}),new Promise((u,c)=>{const d=new XMLHttpRequest,f=()=>d.abort(),h=()=>o?.removeEventListener("abort",f);d.open("POST",s),d.timeout=ac;for(const[m,g]of Object.entries(a))d.setRequestHeader(m,g);if(d.upload.onprogress=m=>{m.lengthComputable&&i(m.loaded,m.total)},d.onerror=()=>{h(),this.tracer.restFailure?.({method:"POST",path:t,requestId:r,phase:"fetch",durationMs:Date.now()-l,error:d.statusText||"network error"}),c(new rl({message:`Network error calling POST ${t}`,cause:null,method:"POST",path:t,url:s,requestId:r,phase:"fetch",timeoutMs:ac,timestamp:Date.now(),durationMs:Date.now()-l}))},d.ontimeout=()=>{h(),this.tracer.restFailure?.({method:"POST",path:t,requestId:r,phase:"fetch",durationMs:Date.now()-l,error:"timeout"}),c(new rl({message:`Timeout calling POST ${t}`,cause:null,method:"POST",path:t,url:s,requestId:r,phase:"fetch",timeoutMs:ac,timestamp:Date.now(),durationMs:Date.now()-l}))},d.onload=()=>{h();let m;try{m=JSON.parse(d.responseText)}catch(g){this.tracer.restFailure?.({method:"POST",path:t,requestId:r,phase:"parse",durationMs:Date.now()-l,status:d.status,error:g}),c(new rl({message:`Failed to parse JSON response from POST ${t}`,cause:g,method:"POST",path:t,url:s,requestId:r,phase:"parse",timeoutMs:ac,status:d.status,statusText:d.statusText,bodyPreview:d.responseText.slice(0,u7),timestamp:Date.now(),durationMs:Date.now()-l}));return}if(this.tracer.restResponse?.({method:"POST",path:t,requestId:r,status:d.status,durationMs:Date.now()-l,code:m.code,msg:m.msg,envelopeRequestId:m.request_id,data:m.data}),this.checkAuthStatus(d.status,m.code),m.code!==0){const g=m.code??d.status;c(new mc({code:g,msg:m.msg??d.statusText,requestId:m.request_id??r,details:m.details,timestamp:Date.now(),durationMs:Date.now()-l}));return}u(m.data)},d.onabort=()=>{h(),c(new DOMException("Upload aborted","AbortError"))},o?.addEventListener("abort",f,{once:!0}),o?.aborted===!0){h(),c(new DOMException("Upload aborted","AbortError"));return}d.send(n)})}async patch(t,n){return this.request("PATCH",t,n)}async put(t,n){return this.request("PUT",t,n)}async delete(t){return this.request("DELETE",t)}async request(t,n,i,o,s={}){const r=s.allowCodes??[],a=s.timeoutMs??ac,l=s.signal;let u=Cf(this.opts.origin,n,this.opts.restBasePath);if(o){const y=new URLSearchParams;wD(y,o);const b=y.toString();b&&(u=`${u}?${b}`)}const c=w0(),d={"X-Request-Id":c};this.addClientHeaders(d),i!==void 0&&(d["Content-Type"]="application/json; charset=utf-8");const f=Date.now();this.tracer.restRequest?.({method:t,path:n,url:u,requestId:c,body:i});let h;try{h=await fetch(u,{method:t,headers:d,body:i!==void 0?JSON.stringify(i):void 0,signal:l!==void 0?AD(a,l):K0(a)})}catch(y){throw l?.aborted&&y instanceof Error&&y.name==="AbortError"?y:(this.tracer.restFailure?.({method:t,path:n,requestId:c,phase:"fetch",durationMs:Date.now()-f,error:y}),new rl({message:`Network error calling ${t} ${n}`,cause:y,method:t,path:n,url:u,requestId:c,phase:"fetch",timeoutMs:a,timestamp:Date.now(),durationMs:Date.now()-f}))}let m;const g=h.clone();try{const y=await h.text();m=h.status===204&&y===""?{code:0,msg:"",data:null,request_id:c}:JSON.parse(y)}catch(y){throw l?.aborted&&y instanceof Error&&y.name==="AbortError"?y:(this.tracer.restFailure?.({method:t,path:n,requestId:c,phase:"parse",durationMs:Date.now()-f,status:h.status,error:y}),new rl({message:`Failed to parse JSON response from ${t} ${n}`,cause:y,method:t,path:n,url:u,requestId:c,phase:"parse",timeoutMs:a,status:h.status,statusText:h.statusText,contentType:h.headers.get("content-type")??void 0,bodyPreview:await q5(g),timestamp:Date.now(),durationMs:Date.now()-f}))}if(this.tracer.restResponse?.({method:t,path:n,requestId:c,status:h.status,durationMs:Date.now()-f,code:m.code,msg:m.msg,envelopeRequestId:m.request_id,data:m.data}),this.checkAuthRequired(h,m.code),m.code!==0&&!r.includes(m.code))throw new mc({code:typeof m.code=="number"?m.code:h.status,msg:typeof m.msg=="string"&&m.msg.length>0?m.msg:`HTTP ${h.status}${h.statusText?` ${h.statusText}`:""}`,requestId:m.request_id??c,details:m.details,timestamp:Date.now(),durationMs:Date.now()-f});return m.data}addClientHeaders(t){const n=this.opts.credentialStore?.getToken();n!==void 0&&(t.Authorization=`Bearer ${n}`);const i=this.opts.identity;i!==void 0&&(t["X-Kimi-Client-Id"]=i.clientId,t["X-Kimi-Client-Name"]=i.clientName,t["X-Kimi-Client-Version"]=i.clientVersion,t["X-Kimi-Client-Ui-Mode"]=i.clientUiMode)}checkAuthRequired(t,n){this.checkAuthStatus(t.status,n)}checkAuthStatus(t,n){(t===401||n===OV)&&this.opts.credentialStore?.markAuthRequired?.()}}function PV(e){return{inputTokens:e.input_tokens,outputTokens:e.output_tokens,cacheReadTokens:e.cache_read_tokens,cacheCreationTokens:e.cache_creation_tokens,totalCostUsd:e.total_cost_usd,contextTokens:e.context_tokens,contextLimit:e.context_limit,turnCount:e.turn_count}}function SD(e){return e.contextTokens===0&&e.contextLimit===0&&e.inputTokens===0&&e.outputTokens===0&&e.turnCount===0}function uc(e){return{id:e.id,title:e.title,createdAt:e.created_at,updatedAt:e.updated_at,busy:e.busy,mainTurnActive:e.main_turn_active,pendingInteraction:e.pending_interaction,lastTurnReason:e.last_turn_reason,archived:e.archived??!1,archivedAt:e.archived_at,currentPromptId:e.current_prompt_id,lastPrompt:e.last_prompt,cwd:e.metadata.cwd,model:e.agent_config.model,usage:PV(e.usage),messageCount:e.message_count,lastSeq:e.last_seq,workspaceId:e.workspace_id,parentSessionId:typeof e.metadata.parent_session_id=="string"?e.metadata.parent_session_id:void 0}}function F9(e){const t=e.activity.status;return{id:e.id,title:e.meta.title??e.meta.last_prompt??e.id.slice(0,12),createdAt:new Date(e.meta.created_at).toISOString(),updatedAt:new Date(e.meta.updated_at).toISOString(),busy:t==="running",pendingInteraction:t==="approval"?"approval":t==="question"?"question":void 0,lastTurnReason:t==="failed"?"failed":void 0,archived:e.meta.archived,archivedAt:e.meta.archived_at==null?void 0:new Date(e.meta.archived_at).toISOString(),lastPrompt:e.meta.last_prompt??void 0,cwd:e.workspace.cwd??"",model:e.activity.model??"",pullRequest:e.git===void 0?void 0:e.git.pull_request,usage:{inputTokens:0,outputTokens:0,cacheReadTokens:0,cacheCreationTokens:0,totalCostUsd:0,contextTokens:0,contextLimit:0,turnCount:0},messageCount:0,lastSeq:0,workspaceId:e.workspace.id.length>0?e.workspace.id:void 0}}function Nv(e){return{id:e.id,root:e.root,name:e.name,lastOpenedAt:e.last_opened_at,sessionCount:e.session_count}}function _D(e){return e.kind==="base64"?{kind:"base64",mediaType:e.media_type,data:e.data}:e.kind==="file"?{kind:"file",fileId:e.file_id}:e.kind==="session_media"?{kind:"sessionMedia",fileId:e.file_id}:{kind:"url",url:e.url}}function n3(e){switch(e.type){case"text":return{type:"text",text:e.text};case"tool_use":return{type:"toolUse",toolCallId:e.tool_call_id,toolName:e.tool_name,input:e.input};case"tool_result":return{type:"toolResult",toolCallId:e.tool_call_id,output:e.output,isError:e.is_error};case"image":return{type:"image",source:_D(e.source),...e.name===void 0?{}:{name:e.name}};case"video":return{type:"video",source:_D(e.source),...e.name===void 0?{}:{name:e.name}};case"file":return{type:"file",fileId:e.file_id,name:e.name,mediaType:e.media_type,size:e.size};case"thinking":return{type:"thinking",thinking:e.thinking,signature:e.signature};default:return{type:"unknown",raw:e}}}function BV(e){return{id:e.id,sessionId:e.session_id,role:e.role,content:e.content.map(n3),createdAt:e.created_at,promptId:e.prompt_id,parentMessageId:e.parent_message_id,metadata:e.metadata}}function $V(e){switch(e.type){case"text":return{type:"text",text:e.text};case"toolUse":return{type:"tool_use",tool_call_id:e.toolCallId,tool_name:e.toolName,input:e.input};case"toolResult":return{type:"tool_result",tool_call_id:e.toolCallId,output:e.output,is_error:e.isError};case"image":case"video":{const t=e.source;let n;return t.kind==="base64"?n={kind:"base64",media_type:t.mediaType,data:t.data}:t.kind==="file"?n={kind:"file",file_id:t.fileId}:t.kind==="sessionMedia"?n={kind:"session_media",file_id:t.fileId}:n={kind:"url",url:t.url},{type:e.type,source:n,...e.name===void 0?{}:{name:e.name}}}case"file":return{type:"file",file_id:e.fileId,name:e.name,media_type:e.mediaType,size:e.size};case"thinking":return{type:"thinking",thinking:e.thinking,signature:e.signature};case"unknown":return e.raw}}function T3e(e){return{content:e.content.map($V),metadata:e.metadata,agent_id:e.agentId,model:e.model,thinking:e.thinking,permission_mode:e.permissionMode,plan_mode:e.planMode,swarm_mode:e.swarmMode,goal_objective:e.goalObjective,goal_control:e.goalControl,skills:e.skills}}function E3e(e){return{decision:e.decision,scope:e.scope,feedback:e.feedback,selected_label:e.selectedLabel}}function L3e(e){return{approvalId:e.approval_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,toolName:e.tool_name,action:e.action,display:e.tool_input_display??e.display,expiresAt:e.expires_at,createdAt:e.created_at}}function N3e(e){return{id:e.id,label:e.label,description:e.description,recommended:e.recommended===!0||e.is_recommended===!0}}function F3e(e){return{id:e.id,question:e.question,header:e.header,body:e.body,options:e.options.map(N3e),multiSelect:e.multi_select,allowOther:e.allow_other,otherLabel:e.other_label,otherDescription:e.other_description}}function R3e(e){return{questionId:e.question_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,questions:e.questions.map(F3e),createdAt:e.created_at}}function D3e(e){switch(e.kind){case"single":return{kind:"single",option_id:e.optionId};case"multi":return{kind:"multi",option_ids:e.optionIds};case"other":return{kind:"other",text:e.text};case"multiWithOther":return{kind:"multi_with_other",option_ids:e.optionIds,other_text:e.otherText};case"skipped":return{kind:"skipped"}}}function O3e(e){const t={};for(const[n,i]of Object.entries(e.answers))t[n]=D3e(i);return{answers:t,method:e.method,note:e.note}}function c7(e,t){if(typeof e.run_in_background!="boolean")throw new Error(`task wire missing required run_in_background (id ${e.id})`);return{id:e.id,agentId:e.agent_id??t,sessionId:e.session_id,kind:e.kind,description:e.description,status:e.status,command:e.command,createdAt:e.created_at,startedAt:e.started_at,completedAt:e.completed_at,outputPreview:e.output_preview,outputBytes:e.output_bytes,subagentPhase:e.subagent_phase,subagentType:e.subagent_type,model:e.model,thinkingEffort:e.thinking_effort,parentToolCallId:e.parent_tool_call_id,suspendedReason:e.suspended_reason,swarmIndex:e.swarm_index,runInBackground:e.run_in_background}}function ID(e){return{path:e.path,name:e.name,kind:e.kind,size:e.size,modifiedAt:e.modified_at,etag:e.etag,mime:e.mime,languageId:e.language_id,isBinary:e.is_binary,isSymlinkTo:e.is_symlink_to,gitStatus:e.git_status,childCount:e.child_count}}function sf(e,t){const n=e[t];return typeof n=="string"?n:void 0}function P1(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function Ol(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function zV(e){if(!e||typeof e!="object")return null;const t=e,n=sf(t,"status");if(n!=="active"&&n!=="paused"&&n!=="blocked"&&n!=="complete")return null;const i=t.budget,o=i&&typeof i=="object"?i:{};return{goalId:sf(t,"goalId")??sf(t,"goal_id")??"goal",objective:sf(t,"objective")??"",completionCriterion:sf(t,"completionCriterion")??sf(t,"completion_criterion"),status:n,turnsUsed:P1(t,"turnsUsed")??P1(t,"turns_used")??0,tokensUsed:P1(t,"tokensUsed")??P1(t,"tokens_used")??0,wallClockMs:P1(t,"wallClockMs")??P1(t,"wall_clock_ms")??0,terminalReason:sf(t,"terminalReason")??sf(t,"terminal_reason"),budget:{tokenBudget:Ol(o,"tokenBudget")??Ol(o,"token_budget"),remainingTokens:Ol(o,"remainingTokens")??Ol(o,"remaining_tokens"),turnBudget:Ol(o,"turnBudget")??Ol(o,"turn_budget"),remainingTurns:Ol(o,"remainingTurns")??Ol(o,"remaining_turns"),wallClockBudgetMs:Ol(o,"wallClockBudgetMs")??Ol(o,"wall_clock_budget_ms"),remainingWallClockMs:Ol(o,"remainingWallClockMs")??Ol(o,"remaining_wall_clock_ms"),overBudget:o.overBudget===!0||o.over_budget===!0}}}function P3e(e){const t=e;switch(e.type){case"event.session.created":return{type:"sessionCreated",session:uc(t.payload.session)};case"event.session.updated":return{type:"sessionUpdated",session:uc(t.payload.session),changedFields:t.payload.changed_fields};case"event.session.deleted":return{type:"sessionDeleted",sessionId:t.session_id};case"event.session.archived":{const n=t.payload?.sessionId??t.payload?.session_id;if(typeof n!="string"||n.length===0)return{type:"unknown",raw:{_noop:!0,_wireType:t.type}};const i=t.payload?.workspace_id;return{type:"sessionArchived",sessionId:n,workspaceId:typeof i=="string"&&i.length>0?i:void 0}}case"event.workspace.created":return{type:"workspaceCreated",workspace:Nv(t.payload.workspace)};case"event.workspace.updated":return{type:"workspaceUpdated",workspace:Nv(t.payload.workspace)};case"event.workspace.deleted":return{type:"workspaceDeleted",workspaceId:t.payload.workspace_id,root:t.payload.root};case"event.session.work_changed":return{type:"sessionWorkChanged",sessionId:t.session_id,busy:t.payload.busy,mainTurnActive:t.payload.main_turn_active,pendingInteraction:t.payload.pending_interaction,lastTurnReason:t.payload.last_turn_reason};case"event.session.status_changed":return{type:"sessionWorkChanged",sessionId:t.session_id,busy:t.payload.status!=="idle"&&t.payload.status!=="aborted",mainTurnActive:t.payload.status!=="idle"&&t.payload.status!=="aborted",pendingInteraction:t.payload.status==="awaiting_approval"?"approval":t.payload.status==="awaiting_question"?"question":"none",lastTurnReason:t.payload.status==="aborted"?"cancelled":void 0};case"event.session.usage_updated":return{type:"sessionUsageUpdated",sessionId:t.session_id,usage:PV(t.payload.usage)};case"event.session.history_compacted":return{type:"historyCompacted",sessionId:t.session_id,beforeSeq:t.payload.before_seq,reason:t.payload.reason,summaryMessageId:t.payload.summary_message_id};case"event.goal.updated":{const n=zV(t.payload.snapshot??null);return{type:"goalUpdated",sessionId:t.session_id,goal:n?.status==="complete"?null:n}}case"event.message.created":return{type:"messageCreated",message:BV(t.payload.message)};case"event.message.updated":return{type:"messageUpdated",sessionId:t.session_id,messageId:t.payload.message_id,content:t.payload.content.map(n3),status:t.payload.status};case"event.assistant.delta":return{type:"assistantDelta",sessionId:t.session_id,messageId:t.payload.message_id,contentIndex:t.payload.content_index,delta:t.payload.delta};case"event.assistant.tool_use_started":case"event.assistant.tool_use_delta":case"event.assistant.tool_use_completed":case"event.assistant.completed":case"event.tool.started":return{type:"unknown",raw:{_noop:!0,_wireType:t.type}};case"event.tool.output":return{type:"toolOutput",sessionId:t.session_id,toolCallId:t.payload.tool_call_id,outputChunk:t.payload.chunk,stream:t.payload.stream};case"event.tool.progress":return typeof t.payload.message=="string"&&t.payload.message.length>0?{type:"toolOutput",sessionId:t.session_id,toolCallId:t.payload.tool_call_id,outputChunk:t.payload.message,stream:"stdout"}:{type:"unknown",raw:{_noop:!0,_wireType:t.type}};case"event.tool.completed":return{type:"unknown",raw:{_noop:!0,_wireType:t.type}};case"event.approval.requested":return{type:"approvalRequested",sessionId:t.session_id,approval:L3e(t.payload)};case"event.approval.resolved":return{type:"approvalResolved",sessionId:t.session_id,approvalId:t.payload.approval_id,decision:t.payload.decision,resolvedAt:t.payload.resolved_at,feedback:t.payload.feedback,selectedLabel:t.payload.selected_label};case"event.approval.expired":return{type:"approvalExpired",sessionId:t.session_id,approvalId:t.payload.approval_id};case"event.question.requested":return{type:"questionRequested",sessionId:t.session_id,question:R3e(t.payload)};case"event.question.answered":return{type:"questionAnswered",sessionId:t.session_id,questionId:t.payload.question_id,resolvedAt:t.payload.resolved_at};case"event.question.dismissed":return{type:"questionDismissed",sessionId:t.session_id,questionId:t.payload.question_id,dismissedAt:t.payload.dismissed_at};case"event.task.created":return{type:"taskCreated",sessionId:t.session_id,task:c7(t.payload.task)};case"event.task.progress":return{type:"taskProgress",sessionId:t.session_id,taskId:t.payload.task_id,outputChunk:t.payload.output_chunk,stream:t.payload.stream};case"event.task.completed":return{type:"taskCompleted",sessionId:t.session_id,taskId:t.payload.task_id,status:t.payload.status,outputPreview:t.payload.output_preview,outputBytes:t.payload.output_bytes};case"event.plugin.changed":return{type:"pluginsChanged"};case"event.capability.changed":return{type:"capabilityChanged",capabilityId:t.payload.capability_id,install:t.payload.install};case"event.config.changed":return{type:"configChanged",changedFields:t.payload.changed_fields,config:d7(t.payload.config)};case"event.model_catalog.changed":return{type:"modelCatalogChanged",changed:t.payload.changed.map(n=>({providerId:n.provider_id,providerName:n.provider_name,added:n.added,removed:n.removed})),unchanged:t.payload.unchanged,failed:t.payload.failed};default:return{type:"unknown",raw:e}}}function B3e(e){return{id:e.model,provider:e.provider,model:e.model,displayName:e.display_name,maxContextSize:e.max_context_size,capabilities:e.capabilities,supportEfforts:e.support_efforts,defaultEffort:e.default_effort}}function B1(e){return{id:e.id,type:e.type,baseUrl:e.base_url,defaultModel:e.default_model,hasApiKey:e.has_api_key,status:e.status,models:e.models}}function MD(e){return{id:e.id,name:e.name,wireType:e.wire_type,guessed:e.guessed,needsBaseUrl:e.needs_base_url,rejected:e.rejected,rejectReason:e.reject_reason,envKey:e.env_key,models:e.models.map(t=>({id:t.id,name:t.name,maxContextSize:t.max_context_size,capabilities:t.capabilities,reasoning:t.reasoning}))}}function d7(e){const t={};for(const[n,i]of Object.entries(e.providers))t[n]={type:i.type,baseUrl:i.base_url,defaultModel:i.default_model,hasApiKey:i.has_api_key};return{providers:t,defaultProvider:e.default_provider,defaultModel:e.default_model,secondaryModel:e.secondary_model,models:e.models,thinking:e.thinking,planMode:e.plan_mode,yolo:e.yolo,defaultPermissionMode:e.default_permission_mode,defaultPlanMode:e.default_plan_mode,permission:e.permission,hooks:e.hooks,services:e.services,mergeAllAvailableSkills:e.merge_all_available_skills,extraSkillDirs:e.extra_skill_dirs,loopControl:e.loop_control,background:e.background,experimental:e.experimental,telemetry:e.telemetry,raw:e.raw}}function $3e(e){return e.session_id}function z3e(e){return e.seq}function j3e(e){const t=Number(e.slice(1));return Number.isFinite(t)?t:0}function TD(e){switch(e.kind){case"turn":return e.turnId;case"marker":return e.markerId;case"taskref":return e.refId}}const H3e={items:[],tasks:new Map,interactions:new Map,attachments:new Map,todos:new Map,prompts:new Map,meta:{},pendingInteractions:new Set,hasMoreOlder:!1};function W3e(e,t){switch(t.op){case"reset":return q3e(e,t);case"turn.upsert":return V3e(e,t.turn);case"step.upsert":return Z3e(e,t.turnId,t.step);case"frame.upsert":return Q3e(e,t);case"append":return J3e(e,t);case"marker.upsert":return LD(e,t.item,t.item.markerId,t.beforeTurn);case"taskref.upsert":return LD(e,t.item,t.item.refId,t.beforeTurn);case"task.upsert":return t8e(e,t.task);case"interaction.upsert":return n8e(e,t.interaction);case"attachment.upsert":return o8e(e,t.attachment);case"todo.upsert":return r8e(e,t.todo);case"prompt.upsert":return l8e(e,t.prompt);case"meta.merge":return d8e(e,t.meta);case"items.remove":return e8e(e,t.ids)}}function q3e(e,t){const n=new Set;for(const i of t.snapshot.interactions)i.state==="pending"&&n.add(i.interactionId);return{state:{items:t.snapshot.items,tasks:new Map(t.snapshot.tasks.map(i=>[i.taskId,i])),interactions:new Map(t.snapshot.interactions.map(i=>[i.interactionId,i])),attachments:new Map(t.snapshot.attachments.map(i=>[i.attachmentId,i])),todos:new Map(t.snapshot.todos.map(i=>[i.todoId,i])),prompts:new Map(t.snapshot.prompts.map(i=>[i.promptId,i])),meta:t.snapshot.meta,pendingInteractions:n,hasMoreOlder:t.snapshot.hasMoreOlder??!1},changed:!0}}function ED(e,t){return{...e,kind:"turn",steps:[...t]}}function jV(e){return{kind:"turn",turnId:e,ordinal:j3e(e),state:"running",origin:{kind:"other"},steps:[]}}function U3e(e,t){const n=Number(e.slice(t.length+1))||0;return{kind:"step",stepId:e,turnId:t,ordinal:n,state:"running",frames:[]}}function Ym(e,t){const n=e.items.find(i=>i.kind==="turn"&&i.turnId===t);return n?.kind==="turn"?n:void 0}function E_(e,t){const n=[...e];let i=n.length;for(let o=0;ot.ordinal){i=o;break}}return n.splice(i,0,t),n}function i3(e,t,n){return e.map(i=>i.kind==="turn"&&i.turnId===t?n(i):i)}function V3e(e,t){const n=Ym(e,t.turnId);return n?K3e(n,t)?{state:e,changed:!1}:{state:{...e,items:i3(e.items,t.turnId,i=>ED(t,i.steps))},changed:!0}:{state:{...e,items:E_(e.items,ED(t,[]))},changed:!0}}function K3e(e,t){return e.ordinal===t.ordinal&&e.triggerPromptId===t.triggerPromptId&&e.state===t.state&&e.prompt===t.prompt&&e.attachmentIds===t.attachmentIds&&e.startedAt===t.startedAt&&e.endedAt===t.endedAt&&e.origin.kind===t.origin.kind&&e.origin.payload===t.origin.payload&&e.usage===t.usage&&e.durationMs===t.durationMs&&e.error===t.error}function Z3e(e,t,n){const i=Ym(e,t)??jV(t),o=i.steps.findIndex(u=>u.stepId===n.stepId);let s,r=!0;if(o>=0){const u=i.steps[o];u&&G3e(u,n)?(r=!1,s=i.steps):s=i.steps.map(c=>c.stepId===n.stepId?{...n,kind:"step",frames:c.frames}:c)}else s=[...i.steps,{...n,kind:"step",frames:[]}].toSorted((u,c)=>u.ordinal-c.ordinal);if(!r)return{state:e,changed:!1};const a={...i,steps:[...s]},l=Ym(e,t)?i3(e.items,t,()=>a):E_(e.items,a);return{state:{...e,items:l},changed:!0}}function G3e(e,t){return e.ordinal===t.ordinal&&e.state===t.state&&e.startedAt===t.startedAt&&e.endedAt===t.endedAt&&e.usage===t.usage&&e.finishReason===t.finishReason&&e.timing===t.timing&&e.retry===t.retry&&e.endReason===t.endReason&&e.endMessage===t.endMessage}function Q3e(e,t){const n=Ym(e,t.turnId)??jV(t.turnId),i=n.steps.find(c=>c.stepId===t.stepId)??U3e(t.stepId,t.turnId),o=i.frames.findIndex(c=>c.frameId===t.frame.frameId);let s;if(o>=0){const c=i.frames[o];if(c!==void 0&&Y3e(c,t.frame))return{state:e,changed:!1};s=i.frames.map(d=>d.frameId===t.frame.frameId?t.frame:d)}else s=[...i.frames,t.frame];const r={...i,frames:[...s]},a=n.steps.some(c=>c.stepId===t.stepId)?n.steps.map(c=>c.stepId===t.stepId?r:c):[...n.steps,r].toSorted((c,d)=>c.ordinal-d.ordinal),l={...n,steps:a},u=Ym(e,t.turnId)?i3(e.items,t.turnId,()=>l):E_(e.items,l);return{state:{...e,items:u},changed:!0}}function Y3e(e,t){return e.kind!==t.kind?!1:e.kind==="text"&&t.kind==="text"?e.text===t.text&&e.role===t.role&&e.attachmentIds===t.attachmentIds&&e.taskId===t.taskId:e.kind==="thinking"&&t.kind==="thinking"?e.text===t.text:e.kind==="tool"&&t.kind==="tool"?e.state===t.state&&e.toolCallId===t.toolCallId&&e.name===t.name&&e.view===t.view&&e.input===t.input&&e.output===t.output&&e.display===t.display&&e.error===t.error&&e.inputText===t.inputText&&e.progress===t.progress&&e.taskId===t.taskId&&e.approvalId===t.approvalId&&e.todoId===t.todoId&&e.agentRefs===t.agentRefs:e.kind==="notice"&&t.kind==="notice"?e.message===t.message&&e.level===t.level&&e.detail===t.detail:!1}function J3e(e,t){if(t.target.type==="task")return X3e(e,t);const{turnId:n,stepId:i,frameId:o}=t.target,s=Ym(e,n),r=s?.steps.find(f=>f.stepId===i),a=r?.frames.find(f=>f.frameId===o);if(!s||!r||!a||a.kind!=="text"&&a.kind!=="thinking")return{state:e,changed:!1,gap:{expected:0,got:t.offset}};const l=HV(a.text,t.offset,t.text);if(l.gap)return{state:e,changed:!1,gap:l.gap};if(!l.changed)return{state:e,changed:!1};const u={...a,text:l.text},c={...r,frames:r.frames.map(f=>f.frameId===o?u:f)},d={...s,steps:s.steps.map(f=>f.stepId===i?c:f)};return{state:{...e,items:i3(e.items,n,()=>d)},changed:!0}}function X3e(e,t){if(t.target.type!=="task")throw new Error("unreachable");const n=t.target.taskId,i=e.tasks.get(n),o=i?.outputTail??"",s=HV(o,t.offset,t.text);if(s.gap)return{state:e,changed:!1,gap:s.gap};if(!s.changed)return{state:e,changed:!1};const r=i?{...i,outputTail:s.text}:{taskId:n,kind:"other",state:"running",detached:!1,outputTail:s.text},a=new Map(e.tasks);return a.set(n,r),{state:{...e,tasks:a},changed:!0}}function HV(e,t,n){if(t>e.length)return{text:e,changed:!1,gap:{expected:e.length,got:t}};if(e.slice(t,t+n.length)===n)return{text:e,changed:!1};const i=e.length-t;return e.slice(t)!==n.slice(0,i)?{text:e,changed:!1,gap:{expected:e.length,got:t}}:(i>0?n.slice(i):n).length===0?{text:e,changed:!1}:{text:e.slice(0,t)+n,changed:!0}}function LD(e,t,n,i){if(e.items.some(s=>f7(s)===n)){let s=!1;const r=e.items.map(a=>f7(a)!==n||a===t?a:(s=!0,t));return s?{state:{...e,items:r},changed:!0}:{state:e,changed:!1}}if(i!==void 0){const s=[...e.items];let r=s.length;for(let a=0;a=i){r=a;break}}return s.splice(r,0,t),{state:{...e,items:s},changed:!0}}return{state:{...e,items:[...e.items,t]},changed:!0}}function f7(e){switch(e.kind){case"turn":return e.turnId;case"marker":return e.markerId;case"taskref":return e.refId}}function e8e(e,t){const n=new Set(t),i=e.items.filter(a=>a.kind==="turn"&&n.has(a.turnId)),o=e.items.filter(a=>!n.has(f7(a)));if(o.length===e.items.length)return{state:e,changed:!1};let s=e.pendingInteractions,r=e.interactions;if(i.length>0){const a=new Set,l=new Set(s),u=new Set;for(const c of i)for(const d of c.steps)for(const f of d.frames)f.kind==="tool"&&a.add(f.toolCallId);for(const c of r.values())c.toolCallId!==void 0&&a.has(c.toolCallId)&&(u.add(c.interactionId),l.delete(c.interactionId));if(u.size>0){const c=new Map(r);for(const d of u)c.delete(d);r=c}s=l}return{state:{...e,items:o,interactions:r,pendingInteractions:s},changed:!0}}function t8e(e,t){const n=e.tasks.get(t.taskId);if(n&&c8e(n,t))return{state:e,changed:!1};const i=new Map(e.tasks);return i.set(t.taskId,t),{state:{...e,tasks:i},changed:!0}}function n8e(e,t){const n=e.interactions.get(t.interactionId);if(n&&i8e(n,t))return{state:e,changed:!1};const i=new Map(e.interactions);i.set(t.interactionId,t);let o=e.pendingInteractions;if(t.state==="pending"){if(!o.has(t.interactionId)){const s=new Set(o);s.add(t.interactionId),o=s}}else if(o.has(t.interactionId)){const s=new Set(o);s.delete(t.interactionId),o=s}return{state:{...e,interactions:i,pendingInteractions:o},changed:!0}}function i8e(e,t){return e.interactionKind===t.interactionKind&&e.toolCallId===t.toolCallId&&e.state===t.state&&e.request===t.request&&e.response===t.response}function o8e(e,t){const n=e.attachments.get(t.attachmentId);if(n&&s8e(n,t))return{state:e,changed:!1};const i=new Map(e.attachments);return i.set(t.attachmentId,t),{state:{...e,attachments:i},changed:!0}}function s8e(e,t){return e.mediaType===t.mediaType&&e.name===t.name&&e.size===t.size&&e.source===t.source&&e.placeholder===t.placeholder}function r8e(e,t){const n=e.todos.get(t.todoId);if(n&&a8e(n,t))return{state:e,changed:!1};const i=new Map(e.todos);return i.set(t.todoId,t),{state:{...e,todos:i},changed:!0}}function a8e(e,t){return e.items===t.items&&e.updatedAt===t.updatedAt}function l8e(e,t){const n=e.prompts.get(t.promptId);if(n&&u8e(n,t))return{state:e,changed:!1};const i=new Map(e.prompts);return i.set(t.promptId,t),{state:{...e,prompts:i},changed:!0}}function u8e(e,t){return e.status===t.status&&e.userMessageId===t.userMessageId&&e.content===t.content&&e.createdAt===t.createdAt&&e.finishedAt===t.finishedAt&&e.steeredAt===t.steeredAt}function c8e(e,t){return e.kind===t.kind&&e.state===t.state&&e.detached===t.detached&&e.description===t.description&&e.agentId===t.agentId&&e.outputTail===t.outputTail&&e.startedAt===t.startedAt&&e.endedAt===t.endedAt&&e.resultSummary===t.resultSummary&&e.error===t.error&&e.stateReason===t.stateReason&&e.usage===t.usage}function d8e(e,t){const n=t.modes!==void 0?{plan:t.modes.plan===null?void 0:t.modes.plan??e.meta.modes?.plan,swarm:t.modes.swarm===null?void 0:t.modes.swarm??e.meta.modes?.swarm,tower:t.modes.tower===null?void 0:t.modes.tower??e.meta.modes?.tower}:e.meta.modes,i=t.agent!==void 0?{...e.meta.agent,...t.agent}:e.meta.agent,o={goal:t.goal===null?void 0:t.goal??e.meta.goal,activity:t.activity??e.meta.activity,modes:n!==void 0&&n.plan===void 0&&n.swarm===void 0&&n.tower===void 0?void 0:n,agent:i};return o.goal===e.meta.goal&&o.activity===e.meta.activity&&o.modes===e.meta.modes&&o.agent===e.meta.agent?{state:e,changed:!1}:{state:{...e,meta:o},changed:!0}}class f8e{constructor(t){this.agentId=t}#e=H3e;#t=new Set;receive(t){return this.apply(t)}apply(t){const n=[];let i,o=this.#e;for(const s of t){const r=W3e(o,s);if(r.gap){i={target:s.target,...r.gap};continue}r.changed&&(o=r.state,n.push(s))}if(this.#e=o,n.length>0){const s={agentId:this.agentId,ops:n};for(const r of this.#t)r(s)}return{accepted:n,gap:i}}onChange(t){return this.#t.add(t),{dispose:()=>void this.#t.delete(t)}}getItems(){return this.#e.items}getTurn(t){const n=this.#e.items.find(i=>i.kind==="turn"&&i.turnId===t);return n?.kind==="turn"?n:void 0}getTasks(){return this.#e.tasks}getTask(t){return this.#e.tasks.get(t)}getInteractions(){return this.#e.interactions}getInteraction(t){return this.#e.interactions.get(t)}getAttachments(){return this.#e.attachments}getAttachment(t){return this.#e.attachments.get(t)}getTodos(){return this.#e.todos}getTodo(t){return this.#e.todos.get(t)}getPrompts(){return this.#e.prompts}getPrompt(t){return this.#e.prompts.get(t)}getMeta(){return this.#e.meta}listPendingInteractions(){return[...this.#e.pendingInteractions]}get hasMoreOlder(){return this.#e.hasMoreOlder}snapshot(t){let n=this.#e.items,i=this.#e.hasMoreOlder;if(t!==void 0){const o=n.reduce((s,r)=>r.kind==="turn"?s+1:s,0);if(o>t.tailTurns){const s=o-t.tailTurns,r=[];let a=0;for(const l of n)if(l.kind==="turn"){if(a+=1,a<=s)continue;r.push(l)}else a>s&&r.push(l);n=r,i=!0}}return{items:n,tasks:[...this.#e.tasks.values()],interactions:[...this.#e.interactions.values()],attachments:[...this.#e.attachments.values()],todos:[...this.#e.todos.values()],prompts:[...this.#e.prompts.values()],meta:this.#e.meta,hasMoreOlder:i}}}function Lt(e,t,n){function i(a,l){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:l,constr:r,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,l);const u=r.prototype,c=Object.keys(u);for(let d=0;dn?.Parent&&a instanceof n.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(r,"name",{value:e}),r}class Pm extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class WV extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const qV={};function eh(e){return qV}function UV(e){const t=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,o])=>t.indexOf(+i)===-1).map(([i,o])=>o)}function h7(e,t){return typeof t=="bigint"?t.toString():t}function o3(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function L_(e){return e==null}function N_(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function h8e(e,t){const n=(e.toString().split(".")[1]||"").length,i=t.toString();let o=(i.split(".")[1]||"").length;if(o===0&&/\d?e-\d?/.test(i)){const l=i.match(/\d?e-(\d?)/);l?.[1]&&(o=Number.parseInt(l[1]))}const s=n>o?n:o,r=Number.parseInt(e.toFixed(s).replace(".","")),a=Number.parseInt(t.toFixed(s).replace(".",""));return r%a/10**s}const ND=Symbol("evaluating");function Hi(e,t,n){let i;Object.defineProperty(e,t,{get(){if(i!==ND)return i===void 0&&(i=ND,i=n()),i},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function a1(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function gh(...e){const t={};for(const n of e){const i=Object.getOwnPropertyDescriptors(n);Object.assign(t,i)}return Object.defineProperties({},t)}function FD(e){return JSON.stringify(e)}function p8e(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const VV="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function w2(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const m8e=o3(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Jm(e){if(w2(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(w2(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function KV(e){return Jm(e)?{...e}:Array.isArray(e)?[...e]:e}const g8e=new Set(["string","number","symbol"]);function Xm(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function vh(e,t,n){const i=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(i._zod.parent=e),i}function Fn(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function v8e(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const y8e={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function k8e(e,t){const n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const s=gh(e._zod.def,{get shape(){const r={};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(r[a]=n.shape[a])}return a1(this,"shape",r),r},checks:[]});return vh(e,s)}function b8e(e,t){const n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=gh(e._zod.def,{get shape(){const r={...e._zod.def.shape};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete r[a]}return a1(this,"shape",r),r},checks:[]});return vh(e,s)}function w8e(e,t){if(!Jm(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const s=e._zod.def.shape;for(const r in t)if(Object.getOwnPropertyDescriptor(s,r)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=gh(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return a1(this,"shape",s),s}});return vh(e,o)}function A8e(e,t){if(!Jm(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=gh(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t};return a1(this,"shape",i),i}});return vh(e,n)}function C8e(e,t){const n=gh(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t._zod.def.shape};return a1(this,"shape",i),i},get catchall(){return t._zod.def.catchall},checks:[]});return vh(e,n)}function x8e(e,t,n){const o=t._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const r=gh(t._zod.def,{get shape(){const a=t._zod.def.shape,l={...a};if(n)for(const u in n){if(!(u in a))throw new Error(`Unrecognized key: "${u}"`);n[u]&&(l[u]=e?new e({type:"optional",innerType:a[u]}):a[u])}else for(const u in a)l[u]=e?new e({type:"optional",innerType:a[u]}):a[u];return a1(this,"shape",l),l},checks:[]});return vh(t,r)}function S8e(e,t,n){const i=gh(t._zod.def,{get shape(){const o=t._zod.def.shape,s={...o};if(n)for(const r in n){if(!(r in s))throw new Error(`Unrecognized key: "${r}"`);n[r]&&(s[r]=new e({type:"nonoptional",innerType:o[r]}))}else for(const r in o)s[r]=new e({type:"nonoptional",innerType:o[r]});return a1(this,"shape",s),s}});return vh(t,i)}function dm(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n{var i;return(i=n).path??(i.path=[]),n.path.unshift(e),n})}function R9(e){return typeof e=="string"?e:e?.message}function th(e,t,n){const i={...e,path:e.path??[]};if(!e.message){const o=R9(e.inst?._zod.def?.error?.(e))??R9(t?.error?.(e))??R9(n.customError?.(e))??R9(n.localeError?.(e))??"Invalid input";i.message=o}return delete i.inst,delete i.continue,t?.reportInput||delete i.input,i}function F_(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function A2(...e){const[t,n,i]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:i}:{...t}}const ZV=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,h7,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},GV=Lt("$ZodError",ZV),QV=Lt("$ZodError",ZV,{Parent:Error});function _8e(e,t=n=>n.message){const n={},i=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):i.push(t(o));return{formErrors:i,fieldErrors:n}}function I8e(e,t=n=>n.message){const n={_errors:[]},i=o=>{for(const s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(r=>i({issues:r}));else if(s.code==="invalid_key")i({issues:s.issues});else if(s.code==="invalid_element")i({issues:s.issues});else if(s.path.length===0)n._errors.push(t(s));else{let r=n,a=0;for(;a(t,n,i,o)=>{const s=i?Object.assign(i,{async:!1}):{async:!1},r=t._zod.run({value:n,issues:[]},s);if(r instanceof Promise)throw new Pm;if(r.issues.length){const a=new(o?.Err??e)(r.issues.map(l=>th(l,s,eh())));throw VV(a,o?.callee),a}return r.value},D_=e=>async(t,n,i,o)=>{const s=i?Object.assign(i,{async:!0}):{async:!0};let r=t._zod.run({value:n,issues:[]},s);if(r instanceof Promise&&(r=await r),r.issues.length){const a=new(o?.Err??e)(r.issues.map(l=>th(l,s,eh())));throw VV(a,o?.callee),a}return r.value},s3=e=>(t,n,i)=>{const o=i?{...i,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise)throw new Pm;return s.issues.length?{success:!1,error:new(e??GV)(s.issues.map(r=>th(r,o,eh())))}:{success:!0,data:s.value}},M8e=s3(QV),r3=e=>async(t,n,i)=>{const o=i?Object.assign(i,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(r=>th(r,o,eh())))}:{success:!0,data:s.value}},T8e=r3(QV),E8e=e=>(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return R_(e)(t,n,o)},L8e=e=>(t,n,i)=>R_(e)(t,n,i),N8e=e=>async(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return D_(e)(t,n,o)},F8e=e=>async(t,n,i)=>D_(e)(t,n,i),R8e=e=>(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return s3(e)(t,n,o)},D8e=e=>(t,n,i)=>s3(e)(t,n,i),O8e=e=>async(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return r3(e)(t,n,o)},P8e=e=>async(t,n,i)=>r3(e)(t,n,i),B8e=/^[cC][^\s-]{8,}$/,$8e=/^[0-9a-z]+$/,z8e=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,j8e=/^[0-9a-vA-V]{20}$/,H8e=/^[A-Za-z0-9]{27}$/,W8e=/^[a-zA-Z0-9_-]{21}$/,q8e=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,U8e=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,RD=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,V8e=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,K8e="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Z8e(){return new RegExp(K8e,"u")}const G8e=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Q8e=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Y8e=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,J8e=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,X8e=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,YV=/^[A-Za-z0-9_-]*$/,e5e=/^\+[1-9]\d{6,14}$/,JV="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",t5e=new RegExp(`^${JV}$`);function XV(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function n5e(e){return new RegExp(`^${XV(e)}$`)}function i5e(e){const t=XV({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const i=`${t}(?:${n.join("|")})`;return new RegExp(`^${JV}T(?:${i})$`)}const o5e=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},s5e=/^-?\d+$/,eK=/^-?\d+(?:\.\d+)?$/,r5e=/^(?:true|false)$/i,a5e=/^[^A-Z]*$/,l5e=/^[^a-z]*$/,Za=Lt("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),tK={number:"number",bigint:"bigint",object:"date"},nK=Lt("$ZodCheckLessThan",(e,t)=>{Za.init(e,t);const n=tK[typeof t.value];e._zod.onattach.push(i=>{const o=i._zod.bag,s=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value{(t.inclusive?i.value<=t.value:i.value{Za.init(e,t);const n=tK[typeof t.value];e._zod.onattach.push(i=>{const o=i._zod.bag,s=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),u5e=Lt("$ZodCheckMultipleOf",(e,t)=>{Za.init(e,t),e._zod.onattach.push(n=>{var i;(i=n._zod.bag).multipleOf??(i.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):h8e(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),c5e=Lt("$ZodCheckNumberFormat",(e,t)=>{Za.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),i=n?"int":"number",[o,s]=y8e[t.format];e._zod.onattach.push(r=>{const a=r._zod.bag;a.format=t.format,a.minimum=o,a.maximum=s,n&&(a.pattern=s5e)}),e._zod.check=r=>{const a=r.value;if(n){if(!Number.isInteger(a)){r.issues.push({expected:i,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?r.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort}):r.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort});return}}as&&r.issues.push({origin:"number",input:a,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),d5e=Lt("$ZodCheckMaxLength",(e,t)=>{var n;Za.init(e,t),(n=e._zod.def).when??(n.when=i=>{const o=i.value;return!L_(o)&&o.length!==void 0}),e._zod.onattach.push(i=>{const o=i._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum{const o=i.value;if(o.length<=t.maximum)return;const r=F_(o);i.issues.push({origin:r,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),f5e=Lt("$ZodCheckMinLength",(e,t)=>{var n;Za.init(e,t),(n=e._zod.def).when??(n.when=i=>{const o=i.value;return!L_(o)&&o.length!==void 0}),e._zod.onattach.push(i=>{const o=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(i._zod.bag.minimum=t.minimum)}),e._zod.check=i=>{const o=i.value;if(o.length>=t.minimum)return;const r=F_(o);i.issues.push({origin:r,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),h5e=Lt("$ZodCheckLengthEquals",(e,t)=>{var n;Za.init(e,t),(n=e._zod.def).when??(n.when=i=>{const o=i.value;return!L_(o)&&o.length!==void 0}),e._zod.onattach.push(i=>{const o=i._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=i=>{const o=i.value,s=o.length;if(s===t.length)return;const r=F_(o),a=s>t.length;i.issues.push({origin:r,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),a3=Lt("$ZodCheckStringFormat",(e,t)=>{var n,i;Za.init(e,t),e._zod.onattach.push(o=>{const s=o._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(i=e._zod).check??(i.check=()=>{})}),p5e=Lt("$ZodCheckRegex",(e,t)=>{a3.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),m5e=Lt("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=a5e),a3.init(e,t)}),g5e=Lt("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=l5e),a3.init(e,t)}),v5e=Lt("$ZodCheckIncludes",(e,t)=>{Za.init(e,t);const n=Xm(t.includes),i=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=i,e._zod.onattach.push(o=>{const s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(i)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),y5e=Lt("$ZodCheckStartsWith",(e,t)=>{Za.init(e,t);const n=new RegExp(`^${Xm(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(i=>{const o=i._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=i=>{i.value.startsWith(t.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:i.value,inst:e,continue:!t.abort})}}),k5e=Lt("$ZodCheckEndsWith",(e,t)=>{Za.init(e,t);const n=new RegExp(`.*${Xm(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(i=>{const o=i._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=i=>{i.value.endsWith(t.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:i.value,inst:e,continue:!t.abort})}}),b5e=Lt("$ZodCheckOverwrite",(e,t)=>{Za.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class w5e{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const i=t.split(` +`).filter(r=>r),o=Math.min(...i.map(r=>r.length-r.trimStart().length)),s=i.map(r=>r.slice(o)).map(r=>" ".repeat(this.indent*2)+r);for(const r of s)this.content.push(r)}compile(){const t=Function,n=this?.args,o=[...(this?.content??[""]).map(s=>` ${s}`)];return new t(...n,o.join(` +`))}}const A5e={major:4,minor:3,patch:6},Lo=Lt("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=A5e;const i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(const o of i)for(const s of o._zod.onattach)s(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const o=(r,a,l)=>{let u=dm(r),c;for(const d of a){if(d._zod.def.when){if(!d._zod.def.when(r))continue}else if(u)continue;const f=r.issues.length,h=d._zod.check(r);if(h instanceof Promise&&l?.async===!1)throw new Pm;if(c||h instanceof Promise)c=(c??Promise.resolve()).then(async()=>{await h,r.issues.length!==f&&(u||(u=dm(r,f)))});else{if(r.issues.length===f)continue;u||(u=dm(r,f))}}return c?c.then(()=>r):r},s=(r,a,l)=>{if(dm(r))return r.aborted=!0,r;const u=o(a,i,l);if(u instanceof Promise){if(l.async===!1)throw new Pm;return u.then(c=>e._zod.parse(c,l))}return e._zod.parse(u,l)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction==="backward"){const u=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return u instanceof Promise?u.then(c=>s(c,r,a)):s(u,r,a)}const l=e._zod.parse(r,a);if(l instanceof Promise){if(a.async===!1)throw new Pm;return l.then(u=>o(u,i,a))}return o(l,i,a)}}Hi(e,"~standard",()=>({validate:o=>{try{const s=M8e(e,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return T8e(e,o).then(r=>r.success?{value:r.data}:{issues:r.error?.issues})}},vendor:"zod",version:1}))}),O_=Lt("$ZodString",(e,t)=>{Lo.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??o5e(e._zod.bag),e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),Ao=Lt("$ZodStringFormat",(e,t)=>{a3.init(e,t),O_.init(e,t)}),C5e=Lt("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=U8e),Ao.init(e,t)}),x5e=Lt("$ZodUUID",(e,t)=>{if(t.version){const i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(i===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=RD(i))}else t.pattern??(t.pattern=RD());Ao.init(e,t)}),S5e=Lt("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=V8e),Ao.init(e,t)}),_5e=Lt("$ZodURL",(e,t)=>{Ao.init(e,t),e._zod.check=n=>{try{const i=n.value.trim(),o=new URL(i);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=o.href:n.value=i;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),I5e=Lt("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Z8e()),Ao.init(e,t)}),M5e=Lt("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=W8e),Ao.init(e,t)}),T5e=Lt("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=B8e),Ao.init(e,t)}),E5e=Lt("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=$8e),Ao.init(e,t)}),L5e=Lt("$ZodULID",(e,t)=>{t.pattern??(t.pattern=z8e),Ao.init(e,t)}),N5e=Lt("$ZodXID",(e,t)=>{t.pattern??(t.pattern=j8e),Ao.init(e,t)}),F5e=Lt("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=H8e),Ao.init(e,t)}),R5e=Lt("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=i5e(t)),Ao.init(e,t)}),D5e=Lt("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=t5e),Ao.init(e,t)}),O5e=Lt("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=n5e(t)),Ao.init(e,t)}),P5e=Lt("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=q8e),Ao.init(e,t)}),B5e=Lt("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=G8e),Ao.init(e,t),e._zod.bag.format="ipv4"}),$5e=Lt("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Q8e),Ao.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),z5e=Lt("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Y8e),Ao.init(e,t)}),j5e=Lt("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=J8e),Ao.init(e,t),e._zod.check=n=>{const i=n.value.split("/");try{if(i.length!==2)throw new Error;const[o,s]=i;if(!s)throw new Error;const r=Number(s);if(`${r}`!==s)throw new Error;if(r<0||r>128)throw new Error;new URL(`http://[${o}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function oK(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const H5e=Lt("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=X8e),Ao.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{oK(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function W5e(e){if(!YV.test(e))return!1;const t=e.replace(/[-_]/g,i=>i==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return oK(n)}const q5e=Lt("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=YV),Ao.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{W5e(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),U5e=Lt("$ZodE164",(e,t)=>{t.pattern??(t.pattern=e5e),Ao.init(e,t)});function V5e(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[i]=n;if(!i)return!1;const o=JSON.parse(atob(i));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}const K5e=Lt("$ZodJWT",(e,t)=>{Ao.init(e,t),e._zod.check=n=>{V5e(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),sK=Lt("$ZodNumber",(e,t)=>{Lo.init(e,t),e._zod.pattern=e._zod.bag.pattern??eK,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const o=n.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return n;const s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...s?{received:s}:{}}),n}}),Z5e=Lt("$ZodNumberFormat",(e,t)=>{c5e.init(e,t),sK.init(e,t)}),G5e=Lt("$ZodBoolean",(e,t)=>{Lo.init(e,t),e._zod.pattern=r5e,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=!!n.value}catch{}const o=n.value;return typeof o=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}}),Q5e=Lt("$ZodUnknown",(e,t)=>{Lo.init(e,t),e._zod.parse=n=>n}),Y5e=Lt("$ZodNever",(e,t)=>{Lo.init(e,t),e._zod.parse=(n,i)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function DD(e,t,n){e.issues.length&&t.issues.push(...fm(n,e.issues)),t.value[n]=e.value}const J5e=Lt("$ZodArray",(e,t)=>{Lo.init(e,t),e._zod.parse=(n,i)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const s=[];for(let r=0;rDD(u,n,r))):DD(l,n,r)}return s.length?Promise.all(s).then(()=>n):n}});function w4(e,t,n,i,o){if(e.issues.length){if(o&&!(n in i))return;t.issues.push(...fm(n,e.issues))}e.value===void 0?n in i&&(t.value[n]=void 0):t.value[n]=e.value}function rK(e){const t=Object.keys(e.shape);for(const i of t)if(!e.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);const n=v8e(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function aK(e,t,n,i,o,s){const r=[],a=o.keySet,l=o.catchall._zod,u=l.def.type,c=l.optout==="optional";for(const d in t){if(a.has(d))continue;if(u==="never"){r.push(d);continue}const f=l.run({value:t[d],issues:[]},i);f instanceof Promise?e.push(f.then(h=>w4(h,n,d,t,c))):w4(f,n,d,t,c)}return r.length&&n.issues.push({code:"unrecognized_keys",keys:r,input:t,inst:s}),e.length?Promise.all(e).then(()=>n):n}const X5e=Lt("$ZodObject",(e,t)=>{if(Lo.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const a=t.shape;Object.defineProperty(t,"shape",{get:()=>{const l={...a};return Object.defineProperty(t,"shape",{value:l}),l}})}const i=o3(()=>rK(t));Hi(e._zod,"propValues",()=>{const a=t.shape,l={};for(const u in a){const c=a[u]._zod;if(c.values){l[u]??(l[u]=new Set);for(const d of c.values)l[u].add(d)}}return l});const o=w2,s=t.catchall;let r;e._zod.parse=(a,l)=>{r??(r=i.value);const u=a.value;if(!o(u))return a.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),a;a.value={};const c=[],d=r.shape;for(const f of r.keys){const h=d[f],m=h._zod.optout==="optional",g=h._zod.run({value:u[f],issues:[]},l);g instanceof Promise?c.push(g.then(y=>w4(y,a,f,u,m))):w4(g,a,f,u,m)}return s?aK(c,u,a,l,i.value,e):c.length?Promise.all(c).then(()=>a):a}}),eAe=Lt("$ZodObjectJIT",(e,t)=>{X5e.init(e,t);const n=e._zod.parse,i=o3(()=>rK(t)),o=f=>{const h=new w5e(["shape","payload","ctx"]),m=i.value,g=w=>{const A=FD(w);return`shape[${A}]._zod.run({ value: input[${A}], issues: [] }, ctx)`};h.write("const input = payload.value;");const y=Object.create(null);let b=0;for(const w of m.keys)y[w]=`key_${b++}`;h.write("const newResult = {};");for(const w of m.keys){const A=y[w],M=FD(w),E=f[w]?._zod?.optout==="optional";h.write(`const ${A} = ${g(w)};`),E?h.write(` + if (${A}.issues.length) { + if (${M} in input) { + payload.issues = payload.issues.concat(${A}.issues.map(iss => ({ + ...iss, + path: iss.path ? [${M}, ...iss.path] : [${M}] + }))); + } + } + + if (${A}.value === undefined) { + if (${M} in input) { + newResult[${M}] = undefined; + } + } else { + newResult[${M}] = ${A}.value; + } + + `):h.write(` + if (${A}.issues.length) { + payload.issues = payload.issues.concat(${A}.issues.map(iss => ({ + ...iss, + path: iss.path ? [${M}, ...iss.path] : [${M}] + }))); + } + + if (${A}.value === undefined) { + if (${M} in input) { + newResult[${M}] = undefined; + } + } else { + newResult[${M}] = ${A}.value; + } + + `)}h.write("payload.value = newResult;"),h.write("return payload;");const v=h.compile();return(w,A)=>v(f,w,A)};let s;const r=w2,a=!qV.jitless,u=a&&m8e.value,c=t.catchall;let d;e._zod.parse=(f,h)=>{d??(d=i.value);const m=f.value;return r(m)?a&&u&&h?.async===!1&&h.jitless!==!0?(s||(s=o(t.shape)),f=s(f,h),c?aK([],m,f,h,d,e):f):n(f,h):(f.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),f)}});function OD(e,t,n,i){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const o=e.filter(s=>!dm(s));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(s=>s.issues.map(r=>th(r,i,eh())))}),t)}const lK=Lt("$ZodUnion",(e,t)=>{Lo.init(e,t),Hi(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),Hi(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),Hi(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),Hi(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>N_(s.source)).join("|")})$`)}});const n=t.options.length===1,i=t.options[0]._zod.run;e._zod.parse=(o,s)=>{if(n)return i(o,s);let r=!1;const a=[];for(const l of t.options){const u=l._zod.run({value:o.value,issues:[]},s);if(u instanceof Promise)a.push(u),r=!0;else{if(u.issues.length===0)return u;a.push(u)}}return r?Promise.all(a).then(l=>OD(l,o,e,s)):OD(a,o,e,s)}}),tAe=Lt("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,lK.init(e,t);const n=e._zod.parse;Hi(e._zod,"propValues",()=>{const o={};for(const s of t.options){const r=s._zod.propValues;if(!r||Object.keys(r).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(const[a,l]of Object.entries(r)){o[a]||(o[a]=new Set);for(const u of l)o[a].add(u)}}return o});const i=o3(()=>{const o=t.options,s=new Map;for(const r of o){const a=r._zod.propValues?.[t.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(const l of a){if(s.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);s.set(l,r)}}return s});e._zod.parse=(o,s)=>{const r=o.value;if(!w2(r))return o.issues.push({code:"invalid_type",expected:"object",input:r,inst:e}),o;const a=i.value.get(r?.[t.discriminator]);return a?a._zod.run(o,s):t.unionFallback?n(o,s):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:r,path:[t.discriminator],inst:e}),o)}}),nAe=Lt("$ZodIntersection",(e,t)=>{Lo.init(e,t),e._zod.parse=(n,i)=>{const o=n.value,s=t.left._zod.run({value:o,issues:[]},i),r=t.right._zod.run({value:o,issues:[]},i);return s instanceof Promise||r instanceof Promise?Promise.all([s,r]).then(([l,u])=>PD(n,l,u)):PD(n,s,r)}});function p7(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Jm(e)&&Jm(t)){const n=Object.keys(t),i=Object.keys(e).filter(s=>n.indexOf(s)!==-1),o={...e,...t};for(const s of i){const r=p7(e[s],t[s]);if(!r.valid)return{valid:!1,mergeErrorPath:[s,...r.mergeErrorPath]};o[s]=r.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let i=0;ia.l&&a.r).map(([a])=>a);if(s.length&&o&&e.issues.push({...o,keys:s}),dm(e))return e;const r=p7(t.value,n.value);if(!r.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}const iAe=Lt("$ZodRecord",(e,t)=>{Lo.init(e,t),e._zod.parse=(n,i)=>{const o=n.value;if(!Jm(o))return n.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),n;const s=[],r=t.keyType._zod.values;if(r){n.value={};const a=new Set;for(const u of r)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){a.add(typeof u=="number"?u.toString():u);const c=t.valueType._zod.run({value:o[u],issues:[]},i);c instanceof Promise?s.push(c.then(d=>{d.issues.length&&n.issues.push(...fm(u,d.issues)),n.value[u]=d.value})):(c.issues.length&&n.issues.push(...fm(u,c.issues)),n.value[u]=c.value)}let l;for(const u in o)a.has(u)||(l=l??[],l.push(u));l&&l.length>0&&n.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:l})}else{n.value={};for(const a of Reflect.ownKeys(o)){if(a==="__proto__")continue;let l=t.keyType._zod.run({value:a,issues:[]},i);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&eK.test(a)&&l.issues.length){const d=t.keyType._zod.run({value:Number(a),issues:[]},i);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");d.issues.length===0&&(l=d)}if(l.issues.length){t.mode==="loose"?n.value[a]=o[a]:n.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(d=>th(d,i,eh())),input:a,path:[a],inst:e});continue}const c=t.valueType._zod.run({value:o[a],issues:[]},i);c instanceof Promise?s.push(c.then(d=>{d.issues.length&&n.issues.push(...fm(a,d.issues)),n.value[l.value]=d.value})):(c.issues.length&&n.issues.push(...fm(a,c.issues)),n.value[l.value]=c.value)}}return s.length?Promise.all(s).then(()=>n):n}}),oAe=Lt("$ZodEnum",(e,t)=>{Lo.init(e,t);const n=UV(t.entries),i=new Set(n);e._zod.values=i,e._zod.pattern=new RegExp(`^(${n.filter(o=>g8e.has(typeof o)).map(o=>typeof o=="string"?Xm(o):o.toString()).join("|")})$`),e._zod.parse=(o,s)=>{const r=o.value;return i.has(r)||o.issues.push({code:"invalid_value",values:n,input:r,inst:e}),o}}),sAe=Lt("$ZodLiteral",(e,t)=>{if(Lo.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(i=>typeof i=="string"?Xm(i):i?Xm(i.toString()):String(i)).join("|")})$`),e._zod.parse=(i,o)=>{const s=i.value;return n.has(s)||i.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),i}}),rAe=Lt("$ZodTransform",(e,t)=>{Lo.init(e,t),e._zod.parse=(n,i)=>{if(i.direction==="backward")throw new WV(e.constructor.name);const o=t.transform(n.value,n);if(i.async)return(o instanceof Promise?o:Promise.resolve(o)).then(r=>(n.value=r,n));if(o instanceof Promise)throw new Pm;return n.value=o,n}});function BD(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const uK=Lt("$ZodOptional",(e,t)=>{Lo.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Hi(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Hi(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${N_(n.source)})?$`):void 0}),e._zod.parse=(n,i)=>{if(t.innerType._zod.optin==="optional"){const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then(s=>BD(s,n.value)):BD(o,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,i)}}),aAe=Lt("$ZodExactOptional",(e,t)=>{uK.init(e,t),Hi(e._zod,"values",()=>t.innerType._zod.values),Hi(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,i)=>t.innerType._zod.run(n,i)}),lAe=Lt("$ZodNullable",(e,t)=>{Lo.init(e,t),Hi(e._zod,"optin",()=>t.innerType._zod.optin),Hi(e._zod,"optout",()=>t.innerType._zod.optout),Hi(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${N_(n.source)}|null)$`):void 0}),Hi(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,i)=>n.value===null?n:t.innerType._zod.run(n,i)}),uAe=Lt("$ZodDefault",(e,t)=>{Lo.init(e,t),e._zod.optin="optional",Hi(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);if(n.value===void 0)return n.value=t.defaultValue,n;const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then(s=>$D(s,t)):$D(o,t)}});function $D(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const cAe=Lt("$ZodPrefault",(e,t)=>{Lo.init(e,t),e._zod.optin="optional",Hi(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,i)=>(i.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,i))}),dAe=Lt("$ZodNonOptional",(e,t)=>{Lo.init(e,t),Hi(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(i=>i!==void 0)):void 0}),e._zod.parse=(n,i)=>{const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then(s=>zD(s,e)):zD(o,e)}});function zD(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const fAe=Lt("$ZodCatch",(e,t)=>{Lo.init(e,t),Hi(e._zod,"optin",()=>t.innerType._zod.optin),Hi(e._zod,"optout",()=>t.innerType._zod.optout),Hi(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then(s=>(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(r=>th(r,i,eh()))},input:n.value}),n.issues=[]),n)):(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(s=>th(s,i,eh()))},input:n.value}),n.issues=[]),n)}}),hAe=Lt("$ZodPipe",(e,t)=>{Lo.init(e,t),Hi(e._zod,"values",()=>t.in._zod.values),Hi(e._zod,"optin",()=>t.in._zod.optin),Hi(e._zod,"optout",()=>t.out._zod.optout),Hi(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,i)=>{if(i.direction==="backward"){const s=t.out._zod.run(n,i);return s instanceof Promise?s.then(r=>D9(r,t.in,i)):D9(s,t.in,i)}const o=t.in._zod.run(n,i);return o instanceof Promise?o.then(s=>D9(s,t.out,i)):D9(o,t.out,i)}});function D9(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const pAe=Lt("$ZodReadonly",(e,t)=>{Lo.init(e,t),Hi(e._zod,"propValues",()=>t.innerType._zod.propValues),Hi(e._zod,"values",()=>t.innerType._zod.values),Hi(e._zod,"optin",()=>t.innerType?._zod?.optin),Hi(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then(jD):jD(o)}});function jD(e){return e.value=Object.freeze(e.value),e}const mAe=Lt("$ZodCustom",(e,t)=>{Za.init(e,t),Lo.init(e,t),e._zod.parse=(n,i)=>n,e._zod.check=n=>{const i=n.value,o=t.fn(i);if(o instanceof Promise)return o.then(s=>HD(s,n,i,e));HD(o,n,i,e)}});function HD(e,t,n,i){if(!e){const o={code:"custom",input:n,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(o.params=i._zod.def.params),t.issues.push(A2(o))}}var WD;class gAe{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const i=n[0];return this._map.set(t,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const i={...this.get(n)??{}};delete i.id;const o={...i,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function vAe(){return new gAe}(WD=globalThis).__zod_globalRegistry??(WD.__zod_globalRegistry=vAe());const Z0=globalThis.__zod_globalRegistry;function yAe(e,t){return new e({type:"string",...Fn(t)})}function kAe(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Fn(t)})}function qD(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Fn(t)})}function bAe(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Fn(t)})}function wAe(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Fn(t)})}function AAe(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Fn(t)})}function CAe(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Fn(t)})}function xAe(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Fn(t)})}function SAe(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Fn(t)})}function _Ae(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Fn(t)})}function IAe(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Fn(t)})}function MAe(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Fn(t)})}function TAe(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Fn(t)})}function EAe(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Fn(t)})}function LAe(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Fn(t)})}function NAe(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Fn(t)})}function FAe(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Fn(t)})}function RAe(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Fn(t)})}function DAe(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Fn(t)})}function OAe(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Fn(t)})}function PAe(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Fn(t)})}function BAe(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Fn(t)})}function $Ae(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Fn(t)})}function zAe(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Fn(t)})}function jAe(e,t){return new e({type:"string",format:"date",check:"string_format",...Fn(t)})}function HAe(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Fn(t)})}function WAe(e,t){return new e({type:"string",format:"duration",check:"string_format",...Fn(t)})}function qAe(e,t){return new e({type:"number",checks:[],...Fn(t)})}function UAe(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Fn(t)})}function VAe(e,t){return new e({type:"boolean",...Fn(t)})}function KAe(e){return new e({type:"unknown"})}function ZAe(e,t){return new e({type:"never",...Fn(t)})}function UD(e,t){return new nK({check:"less_than",...Fn(t),value:e,inclusive:!1})}function U5(e,t){return new nK({check:"less_than",...Fn(t),value:e,inclusive:!0})}function VD(e,t){return new iK({check:"greater_than",...Fn(t),value:e,inclusive:!1})}function V5(e,t){return new iK({check:"greater_than",...Fn(t),value:e,inclusive:!0})}function KD(e,t){return new u5e({check:"multiple_of",...Fn(t),value:e})}function cK(e,t){return new d5e({check:"max_length",...Fn(t),maximum:e})}function A4(e,t){return new f5e({check:"min_length",...Fn(t),minimum:e})}function dK(e,t){return new h5e({check:"length_equals",...Fn(t),length:e})}function GAe(e,t){return new p5e({check:"string_format",format:"regex",...Fn(t),pattern:e})}function QAe(e){return new m5e({check:"string_format",format:"lowercase",...Fn(e)})}function YAe(e){return new g5e({check:"string_format",format:"uppercase",...Fn(e)})}function JAe(e,t){return new v5e({check:"string_format",format:"includes",...Fn(t),includes:e})}function XAe(e,t){return new y5e({check:"string_format",format:"starts_with",...Fn(t),prefix:e})}function eCe(e,t){return new k5e({check:"string_format",format:"ends_with",...Fn(t),suffix:e})}function _g(e){return new b5e({check:"overwrite",tx:e})}function tCe(e){return _g(t=>t.normalize(e))}function nCe(){return _g(e=>e.trim())}function iCe(){return _g(e=>e.toLowerCase())}function oCe(){return _g(e=>e.toUpperCase())}function sCe(){return _g(e=>p8e(e))}function rCe(e,t,n){return new e({type:"array",element:t,...Fn(n)})}function aCe(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Fn(n)})}function lCe(e){const t=uCe(n=>(n.addIssue=i=>{if(typeof i=="string")n.issues.push(A2(i,n.value,t._zod.def));else{const o=i;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),n.issues.push(A2(o))}},e(n.value,n)));return t}function uCe(e,t){const n=new Za({check:"custom",...Fn(t)});return n._zod.check=e,n}function fK(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Z0,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Ss(e,t,n={path:[],schemaPath:[]}){var i;const o=e._zod.def,s=t.seen.get(e);if(s)return s.count++,n.schemaPath.includes(e)&&(s.cycle=n.path),s.schema;const r={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,r);const a=e._zod.toJSONSchema?.();if(a)r.schema=a;else{const c={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,r.schema,c);else{const f=r.schema,h=t.processors[o.type];if(!h)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);h(e,t,f,c)}const d=e._zod.parent;d&&(r.ref||(r.ref=d),Ss(d,t,c),t.seen.get(d).isParent=!0)}const l=t.metadataRegistry.get(e);return l&&Object.assign(r.schema,l),t.io==="input"&&ea(e)&&(delete r.schema.examples,delete r.schema.default),t.io==="input"&&r.schema._prefault&&((i=r.schema).default??(i.default=r.schema._prefault)),delete r.schema._prefault,t.seen.get(e).schema}function hK(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const i=new Map;for(const r of e.seen.entries()){const a=e.metadataRegistry.get(r[0])?.id;if(a){const l=i.get(a);if(l&&l!==r[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(a,r[0])}}const o=r=>{const a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const d=e.external.registry.get(r[0])?.id,f=e.external.uri??(m=>m);if(d)return{ref:f(d)};const h=r[1].defId??r[1].schema.id??`schema${e.counter++}`;return r[1].defId=h,{defId:h,ref:`${f("__shared")}#/${a}/${h}`}}if(r[1]===n)return{ref:"#"};const u=`#/${a}/`,c=r[1].schema.id??`__schema${e.counter++}`;return{defId:c,ref:u+c}},s=r=>{if(r[1].schema.$ref)return;const a=r[1],{ref:l,defId:u}=o(r);a.def={...a.schema},u&&(a.defId=u);const c=a.schema;for(const d in c)delete c[d];c.$ref=l};if(e.cycles==="throw")for(const r of e.seen.entries()){const a=r[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/ + +Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const r of e.seen.entries()){const a=r[1];if(t===r[0]){s(r);continue}if(e.external){const u=e.external.registry.get(r[0])?.id;if(t!==r[0]&&u){s(r);continue}}if(e.metadataRegistry.get(r[0])?.id){s(r);continue}if(a.cycle){s(r);continue}if(a.count>1&&e.reused==="ref"){s(r);continue}}}function pK(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const i=r=>{const a=e.seen.get(r);if(a.ref===null)return;const l=a.def??a.schema,u={...l},c=a.ref;if(a.ref=null,c){i(c);const f=e.seen.get(c),h=f.schema;if(h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(h)):Object.assign(l,h),Object.assign(l,u),r._zod.parent===c)for(const g in l)g==="$ref"||g==="allOf"||g in u||delete l[g];if(h.$ref&&f.def)for(const g in l)g==="$ref"||g==="allOf"||g in f.def&&JSON.stringify(l[g])===JSON.stringify(f.def[g])&&delete l[g]}const d=r._zod.parent;if(d&&d!==c){i(d);const f=e.seen.get(d);if(f?.schema.$ref&&(l.$ref=f.schema.$ref,f.def))for(const h in l)h==="$ref"||h==="allOf"||h in f.def&&JSON.stringify(l[h])===JSON.stringify(f.def[h])&&delete l[h]}e.override({zodSchema:r,jsonSchema:l,path:a.path??[]})};for(const r of[...e.seen.entries()].reverse())i(r[0]);const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const r=e.external.registry.get(t)?.id;if(!r)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(r)}Object.assign(o,n.def??n.schema);const s=e.external?.defs??{};for(const r of e.seen.entries()){const a=r[1];a.def&&a.defId&&(s[a.defId]=a.def)}e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?o.$defs=s:o.definitions=s);try{const r=JSON.parse(JSON.stringify(o));return Object.defineProperty(r,"~standard",{value:{...t["~standard"],jsonSchema:{input:C4(t,"input",e.processors),output:C4(t,"output",e.processors)}},enumerable:!1,writable:!1}),r}catch{throw new Error("Error converting schema to JSON.")}}function ea(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const i=e._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return ea(i.element,n);if(i.type==="set")return ea(i.valueType,n);if(i.type==="lazy")return ea(i.getter(),n);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault")return ea(i.innerType,n);if(i.type==="intersection")return ea(i.left,n)||ea(i.right,n);if(i.type==="record"||i.type==="map")return ea(i.keyType,n)||ea(i.valueType,n);if(i.type==="pipe")return ea(i.in,n)||ea(i.out,n);if(i.type==="object"){for(const o in i.shape)if(ea(i.shape[o],n))return!0;return!1}if(i.type==="union"){for(const o of i.options)if(ea(o,n))return!0;return!1}if(i.type==="tuple"){for(const o of i.items)if(ea(o,n))return!0;return!!(i.rest&&ea(i.rest,n))}return!1}const cCe=(e,t={})=>n=>{const i=fK({...n,processors:t});return Ss(e,i),hK(i,e),pK(i,e)},C4=(e,t,n={})=>i=>{const{libraryOptions:o,target:s}=i??{},r=fK({...o??{},target:s,io:t,processors:n});return Ss(e,r),hK(r,e),pK(r,e)},dCe={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},fCe=(e,t,n,i)=>{const o=n;o.type="string";const{minimum:s,maximum:r,format:a,patterns:l,contentEncoding:u}=e._zod.bag;if(typeof s=="number"&&(o.minLength=s),typeof r=="number"&&(o.maxLength=r),a&&(o.format=dCe[a]??a,o.format===""&&delete o.format,a==="time"&&delete o.format),u&&(o.contentEncoding=u),l&&l.size>0){const c=[...l];c.length===1?o.pattern=c[0].source:c.length>1&&(o.allOf=[...c.map(d=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},hCe=(e,t,n,i)=>{const o=n,{minimum:s,maximum:r,format:a,multipleOf:l,exclusiveMaximum:u,exclusiveMinimum:c}=e._zod.bag;typeof a=="string"&&a.includes("int")?o.type="integer":o.type="number",typeof c=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.minimum=c,o.exclusiveMinimum=!0):o.exclusiveMinimum=c),typeof s=="number"&&(o.minimum=s,typeof c=="number"&&t.target!=="draft-04"&&(c>=s?delete o.minimum:delete o.exclusiveMinimum)),typeof u=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.maximum=u,o.exclusiveMaximum=!0):o.exclusiveMaximum=u),typeof r=="number"&&(o.maximum=r,typeof u=="number"&&t.target!=="draft-04"&&(u<=r?delete o.maximum:delete o.exclusiveMaximum)),typeof l=="number"&&(o.multipleOf=l)},pCe=(e,t,n,i)=>{n.type="boolean"},mCe=(e,t,n,i)=>{n.not={}},gCe=(e,t,n,i)=>{},vCe=(e,t,n,i)=>{const o=e._zod.def,s=UV(o.entries);s.every(r=>typeof r=="number")&&(n.type="number"),s.every(r=>typeof r=="string")&&(n.type="string"),n.enum=s},yCe=(e,t,n,i)=>{const o=e._zod.def,s=[];for(const r of o.values)if(r===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof r=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(r))}else s.push(r);if(s.length!==0)if(s.length===1){const r=s[0];n.type=r===null?"null":typeof r,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[r]:n.const=r}else s.every(r=>typeof r=="number")&&(n.type="number"),s.every(r=>typeof r=="string")&&(n.type="string"),s.every(r=>typeof r=="boolean")&&(n.type="boolean"),s.every(r=>r===null)&&(n.type="null"),n.enum=s},kCe=(e,t,n,i)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},bCe=(e,t,n,i)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},wCe=(e,t,n,i)=>{const o=n,s=e._zod.def,{minimum:r,maximum:a}=e._zod.bag;typeof r=="number"&&(o.minItems=r),typeof a=="number"&&(o.maxItems=a),o.type="array",o.items=Ss(s.element,t,{...i,path:[...i.path,"items"]})},ACe=(e,t,n,i)=>{const o=n,s=e._zod.def;o.type="object",o.properties={};const r=s.shape;for(const u in r)o.properties[u]=Ss(r[u],t,{...i,path:[...i.path,"properties",u]});const a=new Set(Object.keys(r)),l=new Set([...a].filter(u=>{const c=s.shape[u]._zod;return t.io==="input"?c.optin===void 0:c.optout===void 0}));l.size>0&&(o.required=Array.from(l)),s.catchall?._zod.def.type==="never"?o.additionalProperties=!1:s.catchall?s.catchall&&(o.additionalProperties=Ss(s.catchall,t,{...i,path:[...i.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},CCe=(e,t,n,i)=>{const o=e._zod.def,s=o.inclusive===!1,r=o.options.map((a,l)=>Ss(a,t,{...i,path:[...i.path,s?"oneOf":"anyOf",l]}));s?n.oneOf=r:n.anyOf=r},xCe=(e,t,n,i)=>{const o=e._zod.def,s=Ss(o.left,t,{...i,path:[...i.path,"allOf",0]}),r=Ss(o.right,t,{...i,path:[...i.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1,l=[...a(s)?s.allOf:[s],...a(r)?r.allOf:[r]];n.allOf=l},SCe=(e,t,n,i)=>{const o=n,s=e._zod.def;o.type="object";const r=s.keyType,l=r._zod.bag?.patterns;if(s.mode==="loose"&&l&&l.size>0){const c=Ss(s.valueType,t,{...i,path:[...i.path,"patternProperties","*"]});o.patternProperties={};for(const d of l)o.patternProperties[d.source]=c}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(o.propertyNames=Ss(s.keyType,t,{...i,path:[...i.path,"propertyNames"]})),o.additionalProperties=Ss(s.valueType,t,{...i,path:[...i.path,"additionalProperties"]});const u=r._zod.values;if(u){const c=[...u].filter(d=>typeof d=="string"||typeof d=="number");c.length>0&&(o.required=c)}},_Ce=(e,t,n,i)=>{const o=e._zod.def,s=Ss(o.innerType,t,i),r=t.seen.get(e);t.target==="openapi-3.0"?(r.ref=o.innerType,n.nullable=!0):n.anyOf=[s,{type:"null"}]},ICe=(e,t,n,i)=>{const o=e._zod.def;Ss(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType},MCe=(e,t,n,i)=>{const o=e._zod.def;Ss(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))},TCe=(e,t,n,i)=>{const o=e._zod.def;Ss(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},ECe=(e,t,n,i)=>{const o=e._zod.def;Ss(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType;let r;try{r=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=r},LCe=(e,t,n,i)=>{const o=e._zod.def,s=t.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;Ss(s,t,i);const r=t.seen.get(e);r.ref=s},NCe=(e,t,n,i)=>{const o=e._zod.def;Ss(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType,n.readOnly=!0},mK=(e,t,n,i)=>{const o=e._zod.def;Ss(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType},FCe=Lt("ZodISODateTime",(e,t)=>{R5e.init(e,t),Fo.init(e,t)});function RCe(e){return zAe(FCe,e)}const DCe=Lt("ZodISODate",(e,t)=>{D5e.init(e,t),Fo.init(e,t)});function OCe(e){return jAe(DCe,e)}const PCe=Lt("ZodISOTime",(e,t)=>{O5e.init(e,t),Fo.init(e,t)});function BCe(e){return HAe(PCe,e)}const $Ce=Lt("ZodISODuration",(e,t)=>{P5e.init(e,t),Fo.init(e,t)});function zCe(e){return WAe($Ce,e)}const jCe=(e,t)=>{GV.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>I8e(e,n)},flatten:{value:n=>_8e(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,h7,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,h7,2)}},isEmpty:{get(){return e.issues.length===0}}})},lu=Lt("ZodError",jCe,{Parent:Error}),HCe=R_(lu),WCe=D_(lu),qCe=s3(lu),UCe=r3(lu),VCe=E8e(lu),KCe=L8e(lu),ZCe=N8e(lu),GCe=F8e(lu),QCe=R8e(lu),YCe=D8e(lu),JCe=O8e(lu),XCe=P8e(lu),No=Lt("ZodType",(e,t)=>(Lo.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:C4(e,"input"),output:C4(e,"output")}}),e.toJSONSchema=cCe(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(gh(t,{checks:[...t.checks??[],...n.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0}),e.with=e.check,e.clone=(n,i)=>vh(e,n,i),e.brand=()=>e,e.register=((n,i)=>(n.add(e,i),e)),e.parse=(n,i)=>HCe(e,n,i,{callee:e.parse}),e.safeParse=(n,i)=>qCe(e,n,i),e.parseAsync=async(n,i)=>WCe(e,n,i,{callee:e.parseAsync}),e.safeParseAsync=async(n,i)=>UCe(e,n,i),e.spa=e.safeParseAsync,e.encode=(n,i)=>VCe(e,n,i),e.decode=(n,i)=>KCe(e,n,i),e.encodeAsync=async(n,i)=>ZCe(e,n,i),e.decodeAsync=async(n,i)=>GCe(e,n,i),e.safeEncode=(n,i)=>QCe(e,n,i),e.safeDecode=(n,i)=>YCe(e,n,i),e.safeEncodeAsync=async(n,i)=>JCe(e,n,i),e.safeDecodeAsync=async(n,i)=>XCe(e,n,i),e.refine=(n,i)=>e.check(V6e(n,i)),e.superRefine=n=>e.check(K6e(n)),e.overwrite=n=>e.check(_g(n)),e.optional=()=>QD(e),e.exactOptional=()=>F6e(e),e.nullable=()=>YD(e),e.nullish=()=>QD(YD(e)),e.nonoptional=n=>$6e(e,n),e.array=()=>ki(e),e.or=n=>x6e([e,n]),e.and=n=>I6e(e,n),e.transform=n=>JD(e,L6e(n)),e.default=n=>O6e(e,n),e.prefault=n=>B6e(e,n),e.catch=n=>j6e(e,n),e.pipe=n=>JD(e,n),e.readonly=()=>q6e(e),e.describe=n=>{const i=e.clone();return Z0.add(i,{description:n}),i},Object.defineProperty(e,"description",{get(){return Z0.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return Z0.get(e);const i=e.clone();return Z0.add(i,n[0]),i},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),gK=Lt("_ZodString",(e,t)=>{O_.init(e,t),No.init(e,t),e._zod.processJSONSchema=(i,o,s)=>fCe(e,i,o);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...i)=>e.check(GAe(...i)),e.includes=(...i)=>e.check(JAe(...i)),e.startsWith=(...i)=>e.check(XAe(...i)),e.endsWith=(...i)=>e.check(eCe(...i)),e.min=(...i)=>e.check(A4(...i)),e.max=(...i)=>e.check(cK(...i)),e.length=(...i)=>e.check(dK(...i)),e.nonempty=(...i)=>e.check(A4(1,...i)),e.lowercase=i=>e.check(QAe(i)),e.uppercase=i=>e.check(YAe(i)),e.trim=()=>e.check(nCe()),e.normalize=(...i)=>e.check(tCe(...i)),e.toLowerCase=()=>e.check(iCe()),e.toUpperCase=()=>e.check(oCe()),e.slugify=()=>e.check(sCe())}),e6e=Lt("ZodString",(e,t)=>{O_.init(e,t),gK.init(e,t),e.email=n=>e.check(kAe(t6e,n)),e.url=n=>e.check(xAe(n6e,n)),e.jwt=n=>e.check($Ae(v6e,n)),e.emoji=n=>e.check(SAe(i6e,n)),e.guid=n=>e.check(qD(ZD,n)),e.uuid=n=>e.check(bAe(O9,n)),e.uuidv4=n=>e.check(wAe(O9,n)),e.uuidv6=n=>e.check(AAe(O9,n)),e.uuidv7=n=>e.check(CAe(O9,n)),e.nanoid=n=>e.check(_Ae(o6e,n)),e.guid=n=>e.check(qD(ZD,n)),e.cuid=n=>e.check(IAe(s6e,n)),e.cuid2=n=>e.check(MAe(r6e,n)),e.ulid=n=>e.check(TAe(a6e,n)),e.base64=n=>e.check(OAe(p6e,n)),e.base64url=n=>e.check(PAe(m6e,n)),e.xid=n=>e.check(EAe(l6e,n)),e.ksuid=n=>e.check(LAe(u6e,n)),e.ipv4=n=>e.check(NAe(c6e,n)),e.ipv6=n=>e.check(FAe(d6e,n)),e.cidrv4=n=>e.check(RAe(f6e,n)),e.cidrv6=n=>e.check(DAe(h6e,n)),e.e164=n=>e.check(BAe(g6e,n)),e.datetime=n=>e.check(RCe(n)),e.date=n=>e.check(OCe(n)),e.time=n=>e.check(BCe(n)),e.duration=n=>e.check(zCe(n))});function $t(e){return yAe(e6e,e)}const Fo=Lt("ZodStringFormat",(e,t)=>{Ao.init(e,t),gK.init(e,t)}),t6e=Lt("ZodEmail",(e,t)=>{S5e.init(e,t),Fo.init(e,t)}),ZD=Lt("ZodGUID",(e,t)=>{C5e.init(e,t),Fo.init(e,t)}),O9=Lt("ZodUUID",(e,t)=>{x5e.init(e,t),Fo.init(e,t)}),n6e=Lt("ZodURL",(e,t)=>{_5e.init(e,t),Fo.init(e,t)}),i6e=Lt("ZodEmoji",(e,t)=>{I5e.init(e,t),Fo.init(e,t)}),o6e=Lt("ZodNanoID",(e,t)=>{M5e.init(e,t),Fo.init(e,t)}),s6e=Lt("ZodCUID",(e,t)=>{T5e.init(e,t),Fo.init(e,t)}),r6e=Lt("ZodCUID2",(e,t)=>{E5e.init(e,t),Fo.init(e,t)}),a6e=Lt("ZodULID",(e,t)=>{L5e.init(e,t),Fo.init(e,t)}),l6e=Lt("ZodXID",(e,t)=>{N5e.init(e,t),Fo.init(e,t)}),u6e=Lt("ZodKSUID",(e,t)=>{F5e.init(e,t),Fo.init(e,t)}),c6e=Lt("ZodIPv4",(e,t)=>{B5e.init(e,t),Fo.init(e,t)}),d6e=Lt("ZodIPv6",(e,t)=>{$5e.init(e,t),Fo.init(e,t)}),f6e=Lt("ZodCIDRv4",(e,t)=>{z5e.init(e,t),Fo.init(e,t)}),h6e=Lt("ZodCIDRv6",(e,t)=>{j5e.init(e,t),Fo.init(e,t)}),p6e=Lt("ZodBase64",(e,t)=>{H5e.init(e,t),Fo.init(e,t)}),m6e=Lt("ZodBase64URL",(e,t)=>{q5e.init(e,t),Fo.init(e,t)}),g6e=Lt("ZodE164",(e,t)=>{U5e.init(e,t),Fo.init(e,t)}),v6e=Lt("ZodJWT",(e,t)=>{K5e.init(e,t),Fo.init(e,t)}),vK=Lt("ZodNumber",(e,t)=>{sK.init(e,t),No.init(e,t),e._zod.processJSONSchema=(i,o,s)=>hCe(e,i,o),e.gt=(i,o)=>e.check(VD(i,o)),e.gte=(i,o)=>e.check(V5(i,o)),e.min=(i,o)=>e.check(V5(i,o)),e.lt=(i,o)=>e.check(UD(i,o)),e.lte=(i,o)=>e.check(U5(i,o)),e.max=(i,o)=>e.check(U5(i,o)),e.int=i=>e.check(GD(i)),e.safe=i=>e.check(GD(i)),e.positive=i=>e.check(VD(0,i)),e.nonnegative=i=>e.check(V5(0,i)),e.negative=i=>e.check(UD(0,i)),e.nonpositive=i=>e.check(U5(0,i)),e.multipleOf=(i,o)=>e.check(KD(i,o)),e.step=(i,o)=>e.check(KD(i,o)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function Sn(e){return qAe(vK,e)}const y6e=Lt("ZodNumberFormat",(e,t)=>{Z5e.init(e,t),vK.init(e,t)});function GD(e){return UAe(y6e,e)}const k6e=Lt("ZodBoolean",(e,t)=>{G5e.init(e,t),No.init(e,t),e._zod.processJSONSchema=(n,i,o)=>pCe(e,n,i)});function ay(e){return VAe(k6e,e)}const b6e=Lt("ZodUnknown",(e,t)=>{Q5e.init(e,t),No.init(e,t),e._zod.processJSONSchema=(n,i,o)=>gCe()});function Fs(){return KAe(b6e)}const w6e=Lt("ZodNever",(e,t)=>{Y5e.init(e,t),No.init(e,t),e._zod.processJSONSchema=(n,i,o)=>mCe(e,n,i)});function yK(e){return ZAe(w6e,e)}const A6e=Lt("ZodArray",(e,t)=>{J5e.init(e,t),No.init(e,t),e._zod.processJSONSchema=(n,i,o)=>wCe(e,n,i,o),e.element=t.element,e.min=(n,i)=>e.check(A4(n,i)),e.nonempty=n=>e.check(A4(1,n)),e.max=(n,i)=>e.check(cK(n,i)),e.length=(n,i)=>e.check(dK(n,i)),e.unwrap=()=>e.element});function ki(e,t){return rCe(A6e,e,t)}const C6e=Lt("ZodObject",(e,t)=>{eAe.init(e,t),No.init(e,t),e._zod.processJSONSchema=(n,i,o)=>ACe(e,n,i,o),Hi(e,"shape",()=>t.shape),e.keyof=()=>Eo(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Fs()}),e.loose=()=>e.clone({...e._zod.def,catchall:Fs()}),e.strict=()=>e.clone({...e._zod.def,catchall:yK()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>w8e(e,n),e.safeExtend=n=>A8e(e,n),e.merge=n=>C8e(e,n),e.pick=n=>k8e(e,n),e.omit=n=>b8e(e,n),e.partial=(...n)=>x8e(bK,e,n[0]),e.required=(...n)=>S8e(wK,e,n[0])});function Jt(e,t){const n={type:"object",shape:e??{},...Fn(t)};return new C6e(n)}const kK=Lt("ZodUnion",(e,t)=>{lK.init(e,t),No.init(e,t),e._zod.processJSONSchema=(n,i,o)=>CCe(e,n,i,o),e.options=t.options});function x6e(e,t){return new kK({type:"union",options:e,...Fn(t)})}const S6e=Lt("ZodDiscriminatedUnion",(e,t)=>{kK.init(e,t),tAe.init(e,t)});function Dd(e,t,n){return new S6e({type:"union",options:t,discriminator:e,...Fn(n)})}const _6e=Lt("ZodIntersection",(e,t)=>{nAe.init(e,t),No.init(e,t),e._zod.processJSONSchema=(n,i,o)=>xCe(e,n,i,o)});function I6e(e,t){return new _6e({type:"intersection",left:e,right:t})}const M6e=Lt("ZodRecord",(e,t)=>{iAe.init(e,t),No.init(e,t),e._zod.processJSONSchema=(n,i,o)=>SCe(e,n,i,o),e.keyType=t.keyType,e.valueType=t.valueType});function P_(e,t,n){return new M6e({type:"record",keyType:e,valueType:t,...Fn(n)})}const m7=Lt("ZodEnum",(e,t)=>{oAe.init(e,t),No.init(e,t),e._zod.processJSONSchema=(i,o,s)=>vCe(e,i,o),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(i,o)=>{const s={};for(const r of i)if(n.has(r))s[r]=t.entries[r];else throw new Error(`Key ${r} not found in enum`);return new m7({...t,checks:[],...Fn(o),entries:s})},e.exclude=(i,o)=>{const s={...t.entries};for(const r of i)if(n.has(r))delete s[r];else throw new Error(`Key ${r} not found in enum`);return new m7({...t,checks:[],...Fn(o),entries:s})}});function Eo(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new m7({type:"enum",entries:n,...Fn(t)})}const T6e=Lt("ZodLiteral",(e,t)=>{sAe.init(e,t),No.init(e,t),e._zod.processJSONSchema=(n,i,o)=>yCe(e,n,i),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Un(e,t){return new T6e({type:"literal",values:Array.isArray(e)?e:[e],...Fn(t)})}const E6e=Lt("ZodTransform",(e,t)=>{rAe.init(e,t),No.init(e,t),e._zod.processJSONSchema=(n,i,o)=>bCe(e,n),e._zod.parse=(n,i)=>{if(i.direction==="backward")throw new WV(e.constructor.name);n.addIssue=s=>{if(typeof s=="string")n.issues.push(A2(s,n.value,t));else{const r=s;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=n.value),r.inst??(r.inst=e),n.issues.push(A2(r))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(s=>(n.value=s,n)):(n.value=o,n)}});function L6e(e){return new E6e({type:"transform",transform:e})}const bK=Lt("ZodOptional",(e,t)=>{uK.init(e,t),No.init(e,t),e._zod.processJSONSchema=(n,i,o)=>mK(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function QD(e){return new bK({type:"optional",innerType:e})}const N6e=Lt("ZodExactOptional",(e,t)=>{aAe.init(e,t),No.init(e,t),e._zod.processJSONSchema=(n,i,o)=>mK(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function F6e(e){return new N6e({type:"optional",innerType:e})}const R6e=Lt("ZodNullable",(e,t)=>{lAe.init(e,t),No.init(e,t),e._zod.processJSONSchema=(n,i,o)=>_Ce(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function YD(e){return new R6e({type:"nullable",innerType:e})}const D6e=Lt("ZodDefault",(e,t)=>{uAe.init(e,t),No.init(e,t),e._zod.processJSONSchema=(n,i,o)=>MCe(e,n,i,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function O6e(e,t){return new D6e({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():KV(t)}})}const P6e=Lt("ZodPrefault",(e,t)=>{cAe.init(e,t),No.init(e,t),e._zod.processJSONSchema=(n,i,o)=>TCe(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function B6e(e,t){return new P6e({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():KV(t)}})}const wK=Lt("ZodNonOptional",(e,t)=>{dAe.init(e,t),No.init(e,t),e._zod.processJSONSchema=(n,i,o)=>ICe(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function $6e(e,t){return new wK({type:"nonoptional",innerType:e,...Fn(t)})}const z6e=Lt("ZodCatch",(e,t)=>{fAe.init(e,t),No.init(e,t),e._zod.processJSONSchema=(n,i,o)=>ECe(e,n,i,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function j6e(e,t){return new z6e({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const H6e=Lt("ZodPipe",(e,t)=>{hAe.init(e,t),No.init(e,t),e._zod.processJSONSchema=(n,i,o)=>LCe(e,n,i,o),e.in=t.in,e.out=t.out});function JD(e,t){return new H6e({type:"pipe",in:e,out:t})}const W6e=Lt("ZodReadonly",(e,t)=>{pAe.init(e,t),No.init(e,t),e._zod.processJSONSchema=(n,i,o)=>NCe(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function q6e(e){return new W6e({type:"readonly",innerType:e})}const U6e=Lt("ZodCustom",(e,t)=>{mAe.init(e,t),No.init(e,t),e._zod.processJSONSchema=(n,i,o)=>kCe(e,n)});function V6e(e,t={}){return aCe(U6e,e,t)}function K6e(e){return lCe(e)}const Vp=$t().min(1),B_=$t().min(1),ly=$t().min(1),Kp=$t().min(1),xl=$t().min(1),Z6e=/^[A-Za-z0-9._-]{1,128}$/;function G6e(e){return Z6e.test(e)&&e!=="."&&e!==".."}const AK=Dd("kind",[Jt({kind:Un("user"),payload:Fs().optional()}),Jt({kind:Un("cron"),taskId:Kp.optional(),payload:Fs().optional()}),Jt({kind:Un("task"),taskId:Kp,payload:Fs().optional()}),Jt({kind:Un("hook"),payload:Fs().optional()}),Jt({kind:Un("compaction"),payload:Fs().optional()}),Jt({kind:Un("side"),payload:Fs().optional()}),Jt({kind:Un("other"),payload:Fs().optional()})]),Q6e=Jt({inputTokens:Sn().optional(),outputTokens:Sn().optional(),cachedTokens:Sn().optional(),cost:Sn().optional()}),Fv=Jt({inputOther:Sn(),output:Sn(),inputCacheRead:Sn(),inputCacheCreation:Sn()}),Y6e=Jt({llmFirstTokenLatencyMs:Sn().optional(),llmStreamDurationMs:Sn().optional(),llmRequestBuildMs:Sn().optional(),llmServerFirstTokenMs:Sn().optional(),llmServerDecodeMs:Sn().optional(),llmClientConsumeMs:Sn().optional()}),J6e=Jt({failedAttempt:Sn(),nextAttempt:Sn(),maxAttempts:Sn(),delayMs:Sn(),errorName:$t(),errorMessage:$t(),statusCode:Sn().optional()}),CK=Eo(["queued","running","completed","failed","cancelled"]),X6e=Eo(["running","completed","interrupted","failed"]),e7e=Jt({skillName:$t(),skillArgs:$t().optional()}),t7e=Jt({kind:Un("user"),skillActivations:ki(e7e).optional()}),XD={kind:Un("text"),frameId:ly,text:$t(),attachmentIds:ki($t()).optional(),taskId:Kp.optional(),promptIds:ki($t()).optional()},n7e=Dd("role",[Jt({...XD,role:Un("assistant"),origin:yK().optional()}),Jt({...XD,role:Un("user"),origin:t7e.optional()})]),i7e=Jt({kind:Un("thinking"),frameId:ly,text:$t()}),o7e=Jt({agentId:xl,role:Eo(["child","member"]).optional()}),s7e=Jt({kind:Eo(["stdout","stderr","progress","status","custom"]),text:$t().optional(),percent:Sn().optional(),customKind:$t().optional(),customData:Fs().optional()}),r7e=Jt({kind:Un("tool"),frameId:ly,toolCallId:$t(),name:$t(),view:$t().optional(),state:Eo(["running","done","error"]),input:Fs().optional(),output:Fs().optional(),display:Fs().optional(),error:$t().optional(),inputText:$t().optional(),progress:s7e.optional(),taskId:Kp.optional(),approvalId:$t().optional(),todoId:$t().optional(),agentRefs:ki(o7e).optional()}),$_=Jt({interactionId:$t(),interactionKind:Eo(["approval","question"]),toolCallId:$t().optional(),state:Eo(["pending","approved","rejected","cancelled","answered","dismissed"]),request:Fs().optional(),response:Fs().optional()}),a7e=Jt({kind:Un("notice"),frameId:ly,level:Eo(["error","warning","info"]),source:$t().optional(),message:$t(),detail:Fs().optional()}),xK=Dd("kind",[n7e,i7e,r7e,a7e]),SK=Jt({kind:Un("step"),stepId:B_,turnId:Vp,ordinal:Sn().int(),state:X6e,frames:ki(xK),startedAt:$t().optional(),endedAt:$t().optional(),usage:Fv.optional(),finishReason:$t().optional(),timing:Y6e.optional(),retry:J6e.optional(),endReason:$t().optional(),endMessage:$t().optional()}),_K=Jt({kind:Un("turn"),turnId:Vp,triggerPromptId:$t().min(1).optional(),ordinal:Sn().int(),state:CK,origin:AK,prompt:$t().optional(),attachmentIds:ki($t()).optional(),steps:ki(SK),startedAt:$t().optional(),endedAt:$t().optional(),usage:Q6e.optional(),durationMs:Sn().optional(),error:$t().optional()}),IK=Jt({kind:Un("marker"),markerId:$t(),marker:$t(),payload:Fs().optional(),at:$t().optional()}),MK=Jt({kind:Un("taskref"),refId:$t(),taskId:Kp,at:$t().optional()}),TK=Dd("kind",[_K,IK,MK]),z_=Jt({taskId:Kp,kind:Eo(["shell","subagent","tool","other"]),state:Eo(["running","completed","failed","timed_out","killed","lost"]),detached:ay(),description:$t().optional(),agentId:xl.optional(),outputTail:$t(),startedAt:$t().optional(),endedAt:$t().optional(),resultSummary:$t().optional(),error:$t().optional(),stateReason:$t().optional(),usage:Fv.optional(),model:$t().optional(),thinkingEffort:$t().optional()}),EK=Jt({objective:$t(),status:Eo(["active","paused","blocked","complete"]),completionCriterion:$t().optional(),budgetUsed:Sn().optional(),budgetLimit:Sn().optional()}),l7e=Jt({plan:Jt({reviewPath:$t().optional(),version:Sn().optional()}).optional(),swarm:Jt({trigger:$t().optional()}).optional(),tower:Jt({}).optional()}),u7e=Jt({plan:Jt({reviewPath:$t().optional(),version:Sn().optional()}).nullable().optional(),swarm:Jt({trigger:$t().optional()}).nullable().optional(),tower:Jt({}).nullable().optional()}),c7e=Dd("kind",[Jt({kind:Un("idle")}),Jt({kind:Un("running"),turnId:Sn(),step:Sn(),stepId:$t(),since:Sn()}),Jt({kind:Un("streaming"),turnId:Sn(),step:Sn(),stepId:$t(),stream:Eo(["assistant","thinking","tool_call"]),toolCallId:$t().optional(),toolName:$t().optional(),since:Sn()}),Jt({kind:Un("tool_call"),turnId:Sn(),step:Sn(),toolCallId:$t(),name:$t(),since:Sn()}),Jt({kind:Un("retrying"),turnId:Sn(),step:Sn(),stepId:$t(),failedAttempt:Sn(),nextAttempt:Sn(),maxAttempts:Sn(),delayMs:Sn(),errorName:$t().optional(),statusCode:Sn().optional(),since:Sn()}),Jt({kind:Un("awaiting_approval"),turnId:Sn(),step:Sn().optional(),approval:Fs().optional(),since:Sn()}),Jt({kind:Un("interrupted"),turnId:Sn(),step:Sn().optional(),reason:Eo(["aborted","max_steps","error"]),message:$t().optional(),at:Sn()}),Jt({kind:Un("ended"),turnId:Sn(),reason:Eo(["completed","cancelled","failed","blocked"]),durationMs:Sn().optional(),at:Sn()})]),d7e=Jt({byModel:P_($t(),Fv).optional(),currentTurn:Fv.optional(),total:Fv.optional()}),f7e=Jt({model:$t().optional(),thinkingEffort:$t().optional(),usage:d7e.optional(),contextTokens:Sn().optional(),maxContextTokens:Sn().optional(),contextUsage:Sn().optional(),permission:Eo(["manual","yolo","auto"]).optional(),phase:c7e.optional()}),j_=Jt({goal:EK.optional(),modes:l7e.optional(),activity:Eo(["idle","turn","disposing","unknown"]).optional(),agent:f7e.optional()}),h7e=j_.extend({goal:EK.nullable().optional(),modes:u7e.optional()}),l3=Jt({attachmentId:$t(),mediaType:$t(),name:$t().optional(),size:Sn().optional(),source:Dd("kind",[Jt({kind:Un("url"),url:$t()}),Jt({kind:Un("file"),fileId:$t()}),Jt({kind:Un("session_media"),fileId:$t()})]).optional(),placeholder:$t().optional()}),p7e=Jt({title:$t(),status:Eo(["pending","in_progress","done"])}),H_=Jt({todoId:$t(),items:ki(p7e),updatedAt:$t().optional()}),W_=Jt({promptId:$t(),status:Eo(["running","queued","blocked","completed","failed","aborted"]),userMessageId:$t().optional(),content:Fs().optional(),createdAt:$t(),finishedAt:$t().optional(),steeredAt:$t().optional()}),LK=Jt({items:ki(TK),tasks:ki(z_),interactions:ki($_).default([]),attachments:ki(l3).default([]),todos:ki(H_).default([]),prompts:ki(W_).default([]),meta:j_,hasMoreOlder:ay().optional()}),m7e=_K.omit({steps:!0}),g7e=SK.omit({frames:!0}),v7e=Dd("type",[Jt({type:Un("frame"),turnId:Vp,stepId:B_,frameId:ly}),Jt({type:Un("task"),taskId:Kp})]),q_=Dd("op",[Jt({op:Un("reset"),agentId:xl,snapshot:LK}),Jt({op:Un("turn.upsert"),turn:m7e}),Jt({op:Un("step.upsert"),turnId:Vp,step:g7e}),Jt({op:Un("frame.upsert"),turnId:Vp,stepId:B_,frame:xK}),Jt({op:Un("append"),target:v7e,offset:Sn().int().nonnegative(),text:$t()}),Jt({op:Un("marker.upsert"),item:IK,beforeTurn:Sn().int().optional()}),Jt({op:Un("taskref.upsert"),item:MK,beforeTurn:Sn().int().optional()}),Jt({op:Un("task.upsert"),task:z_}),Jt({op:Un("interaction.upsert"),interaction:$_}),Jt({op:Un("attachment.upsert"),attachment:l3}),Jt({op:Un("todo.upsert"),todo:H_}),Jt({op:Un("prompt.upsert"),prompt:W_}),Jt({op:Un("meta.merge"),meta:h7e}),Jt({op:Un("items.remove"),ids:ki($t())})]);Jt({agentId:xl,ops:ki(q_)});const y7e=Eo(["off","turn","block","delta"]),eg=Sn().int().nonnegative(),k7e=P_($t(),y7e);Jt({session_id:$t().min(1),transcript:k7e,transcript_since:P_($t(),eg).optional()});Jt({agent_id:xl,before_turn:$t().min(1).optional(),after_turn:$t().min(1).optional(),page_size:Sn().int().min(1).max(100).optional()}).superRefine((e,t)=>{e.before_turn!==void 0&&e.after_turn!==void 0&&t.addIssue({code:"custom",message:"before_turn and after_turn are mutually exclusive",path:["before_turn"]}),G6e(e.agent_id)||t.addIssue({code:"custom",message:"agent_id must be a plain agent id (no path separators)",path:["agent_id"]})});const b7e=Jt({agentId:xl,type:Eo(["main","sub","independent"]).optional(),parentAgentId:xl.optional(),label:$t().optional(),createdAt:$t().optional(),disposedAt:$t().optional()}),w7e=Jt({agent_id:xl,items:ki(TK),has_more:ay(),tasks:ki(z_),interactions:ki($_).default([]),attachments:ki(l3).default([]),todos:ki(H_).default([]),prompts:ki(W_).default([]),meta:j_,agents:ki(b7e),pending_interactions:ki($t()),seq:eg.optional()});Jt({agent_id:xl,batches:ki(Jt({seq:eg,ops:ki(q_)})),latest_seq:eg,complete:ay()});const A7e=Jt({turn_id:Vp,ordinal:Sn().int(),state:CK,origin:AK,prompt:$t(),attachment_ids:ki($t()).optional(),started_at:$t().optional()});Jt({agents:ki(Jt({agent_id:xl,messages:ki(A7e),attachments:ki(l3).default([])}))});const C7e=Jt({state:Eo(["pending","approved","rejected","cancelled"]),selected_option:$t().optional(),feedback:$t().optional()}),x7e=Jt({tool_call_id:$t(),turn_id:Vp,source:Eo(["interaction","display","output"]),plan:$t(),path:$t().optional(),options:ki(Jt({label:$t(),description:$t().optional()})).optional(),review:C7e.optional()});Jt({agent_id:xl,plans:ki(x7e)});const S7e=Jt({agent_id:xl,snapshot:LK,has_more_older:ay(),seq:eg.optional()}),_7e=Jt({agent_id:xl,ops:ki(q_),seq:eg.optional()}),NK=S7e.extend({type:Un("transcript.reset")}),FK=_7e.extend({type:Un("transcript.ops")});Dd("type",[NK,FK]);const eO=new Set(["turn.started","turn.step.started","turn.step.completed","turn.step.retrying","turn.step.interrupted","turn.ended","thinking.delta","assistant.delta","tool.call.started","tool.use","tool.call.delta","tool.progress","tool.result","agent.status.updated","prompt.submitted","prompt.completed","prompt.aborted","session.meta.updated","compaction.started","compaction.completed","compaction.cancelled","goal.updated","error","warning","subagent.spawned","subagent.started","subagent.suspended","subagent.completed","subagent.failed","task.started","task.terminated","background.task.started","background.task.terminated","cron.fired"]),I7e=new Set(["session.created","session.updated","session.deleted","session.status_changed","session.usage_updated","session.history_compacted","message.created","message.updated","approval.requested","approval.resolved","approval.expired","question.requested","question.answered","question.dismissed","task.created","task.progress","task.completed","assistant.tool_use_started","assistant.tool_use_delta","assistant.tool_use_completed","assistant.completed","tool.started","tool.output","tool.completed"]),M7e=new Set(["server_hello","ack","ping","resync_required","error","pong"]),T7e=new Set(["assistant.delta","thinking.delta"]);function E7e(e,t){if(M7e.has(e))return{route:"ignore"};const n=e.startsWith("event."),i=n?e.slice(6):e;return T7e.has(i)?L7e(t)?{route:"agent",agentType:i}:{route:"protocol"}:n?I7e.has(i)?{route:"protocol"}:eO.has(i)?{route:"agent",agentType:i}:{route:"protocol"}:eO.has(i)?{route:"agent",agentType:i}:{route:"agent",agentType:i}}function L7e(e){if(!e||typeof e!="object")return!1;const t=e;return"message_id"in t||"content_index"in t?!1:typeof t.delta=="string"}const N7e="kimi-code.bearer.",F7e=3e4;class tO{constructor(t){this.opts=t,this.tracer=t.tracer??T_}ws=null;connected=!1;closed=!1;subscriptions=new Map;transcriptSubscriptions=new Map;sideChannelAgents=new Map;pendingSubscriptions=[];terminalAttachments=new Map;msgSeq=0;clientHelloId=null;reconnectAttempts=0;reconnectTimer=null;heartbeatMs=3e4;lastActivityAt=0;tracer;connect(){if(this.ws!==null||this.closed)return;this.lastActivityAt=Date.now(),this.tracer.wsEvent?.({kind:"lifecycle",event:"connect",detail:{url:this.opts.wsUrl,attempt:this.reconnectAttempts}});const t=this.opts.credentialStore?.getToken(),n=t!==void 0?[`${N7e}${t}`]:void 0,i=new WebSocket(this.opts.wsUrl,n);this.ws=i,i.onopen=()=>{this.tracer.wsEvent?.({kind:"lifecycle",event:"open"})},i.onmessage=o=>{this.lastActivityAt=Date.now();try{const s=JSON.parse(String(o.data));this.tracer.wsEvent?.({kind:"in",frame:s}),this.handleFrame(s)}catch(s){this.tracer.wsEvent?.({kind:"lifecycle",event:"parse-error",detail:{error:String(s)}}),this.opts.handlers.onError(0,`Failed to parse WS frame: ${String(s)}`,!1)}},i.onerror=()=>{this.tracer.wsEvent?.({kind:"lifecycle",event:"error"}),this.opts.handlers.onError(0,"WebSocket error",!1)},i.onclose=o=>{this.tracer.wsEvent?.({kind:"lifecycle",event:"close",detail:o?{code:o.code,reason:o.reason,wasClean:o.wasClean}:void 0}),this.connected=!1,this.ws=null,this.opts.handlers.onConnectionState(!1),this.scheduleReconnect()}}scheduleReconnect(){if(this.closed||this.reconnectTimer!==null)return;const n=Math.min(3e4,1e3*2**this.reconnectAttempts)+Math.floor(Math.random()*250);this.reconnectAttempts+=1,this.tracer.wsEvent?.({kind:"lifecycle",event:"reconnect-scheduled",detail:{delayMs:n,attempt:this.reconnectAttempts}}),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},n)}subscribe(t,n={seq:0}){if(this.subscriptions.set(t,{...n}),this.connected)this.sendSubscribe([t],{[t]:n});else{const i=this.pendingSubscriptions.findIndex(o=>o.sessionId===t);i!==-1&&this.pendingSubscriptions.splice(i,1),this.pendingSubscriptions.push({sessionId:t,cursor:{...n}})}}unsubscribe(t){this.subscriptions.delete(t);const n=this.pendingSubscriptions.findIndex(i=>i.sessionId===t);n!==-1&&this.pendingSubscriptions.splice(n,1),this.connected&&this.ws&&this.send({type:"unsubscribe",id:this.nextId(),payload:{session_ids:[t]}})}subscribeTranscript(t,n,i){let o=this.transcriptSubscriptions.get(t);o===void 0&&(o=new Map,this.transcriptSubscriptions.set(t,o)),o.set(n,i!==void 0?{sinceSeq:i}:{}),this.connected&&this.sendTranscriptSubscribe(t,n)}unsubscribeTranscript(t,n){const i=this.transcriptSubscriptions.get(t);if(i!==void 0)if(n===void 0)this.transcriptSubscriptions.delete(t);else{for(const o of n)i.delete(o);i.size===0&&this.transcriptSubscriptions.delete(t)}!this.connected||!this.ws||this.send({type:"unsubscribe_v2",id:this.nextId(),payload:{session_id:t,...n!==void 0?{agent_ids:n}:{}}})}markSideChannelAgent(t,n){if(!this.opts.mainAgentOnly)return;let i=this.sideChannelAgents.get(t);if(i===void 0&&(i=new Set,this.sideChannelAgents.set(t,i)),i.has(n))return;i.add(n);const o=this.subscriptions.get(t);this.connected&&o!==void 0&&this.sendSubscribe([t],{[t]:o})}abort(t,n){!this.connected||!this.ws||this.send({type:"abort",id:this.nextId(),payload:{session_id:t,prompt_id:n}})}terminalAttach(t,n,i){const o=P9(t,n),s=this.terminalAttachments.get(o),r=i??s?.lastSeq??0;this.terminalAttachments.set(o,{sessionId:t,terminalId:n,lastSeq:r}),!(!this.connected||!this.ws)&&this.sendTerminalAttach(t,n,r)}terminalInput(t,n,i){!this.connected||!this.ws||this.send({type:"terminal_input",id:this.nextId(),payload:{session_id:t,terminal_id:n,data:i}})}terminalResize(t,n,i,o){!this.connected||!this.ws||this.send({type:"terminal_resize",id:this.nextId(),payload:{session_id:t,terminal_id:n,cols:i,rows:o}})}terminalDetach(t,n){this.terminalAttachments.delete(P9(t,n)),!(!this.connected||!this.ws)&&this.send({type:"terminal_detach",id:this.nextId(),payload:{session_id:t,terminal_id:n}})}terminalClose(t,n){this.terminalAttachments.delete(P9(t,n)),!(!this.connected||!this.ws)&&this.send({type:"terminal_close",id:this.nextId(),payload:{session_id:t,terminal_id:n}})}close(){this.closed=!0,this.connected=!1,this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.ws&&(this.ws.close(1e3),this.ws=null)}health(){const t=this.ws!==null&&this.ws.readyState===WebSocket.OPEN,n=Math.max(this.heartbeatMs*2,F7e),i=this.lastActivityAt>0&&Date.now()-this.lastActivityAt>n;return{connected:this.connected,open:t,stale:i}}reconnect(){if(this.closed)return;this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null);const t=this.ws;if(t!==null){t.onopen=null,t.onmessage=null,t.onerror=null,t.onclose=null;try{t.close(1e3,"reconnect")}catch{}}const n=this.connected;this.ws=null,this.connected=!1,n&&this.opts.handlers.onConnectionState(!1),this.connect()}handleFrame(t){const n=t,i=t.type;if(i==="transcript.reset"){const o=NK.safeParse({type:i,...n.payload}),s=n.session_id;if(!o.success||typeof s!="string"){this.opts.handlers.onError(0,"Invalid transcript.reset frame",!1);return}const r=o.data;this.opts.handlers.onTranscriptReset?.(s,r.agent_id,{...r.snapshot,hasMoreOlder:r.has_more_older},r.seq);const a=this.transcriptSubscriptions.get(s)?.get(r.agent_id);a!==void 0&&r.seq!==void 0&&(a.sinceSeq=r.seq);return}if(i==="transcript.ops"){const o=FK.safeParse({type:i,...n.payload}),s=n.session_id;if(!o.success||typeof s!="string"){this.opts.handlers.onError(0,"Invalid transcript.ops frame",!1);return}const r=o.data,a=this.opts.handlers.onTranscriptOps?.(s,r.agent_id,r.ops,r.seq),l=this.transcriptSubscriptions.get(s)?.get(r.agent_id);a!==!1&&l!==void 0&&r.seq!==void 0&&(l.sinceSeq=r.seq);return}switch(i){case"server_hello":{const o=n.payload?.heartbeat_ms;typeof o=="number"&&o>0&&(this.heartbeatMs=o),this.onServerHello();break}case"ping":this.send({type:"pong",payload:{nonce:n.payload.nonce}});break;case"resync_required":{const o=n.payload.session_id,s=n.payload.epoch;this.subscriptions.set(o,{seq:n.payload.current_seq,epoch:s}),this.opts.handlers.onResync(o,n.payload.current_seq,s);break}case"error":{const o=n.session_id;typeof o=="string"&&this.opts.handlers.onRawAgentEvent?this.opts.handlers.onRawAgentEvent({type:"error",seq:n.seq,session_id:o,timestamp:n.timestamp,payload:n.payload}):this.opts.handlers.onError(n.payload.code,n.payload.msg,n.payload.fatal);break}case"ack":n.id===this.clientHelloId&&(this.clientHelloId=null,n.code===0&&this.opts.handlers.onReplayComplete?.());break;case"terminal_output":{const o=n.session_id,s=n.terminal_id,r=n.seq,a=P9(o,s),l=this.terminalAttachments.get(a);l&&this.terminalAttachments.set(a,{...l,lastSeq:Math.max(l.lastSeq,r)});const u=typeof n.payload?.data=="string"?n.payload.data:"";this.opts.handlers.onTerminalOutput?.(o,s,u,r);break}case"terminal_exit":{const o=n.session_id,s=n.terminal_id,r=n.payload?.exit_code,a=typeof r=="number"?r:null;this.opts.handlers.onTerminalExit?.(o,s,a);break}default:{this.trackCursor(n);const o=n.type,s=E7e(o,n.payload);if(s.route==="protocol"){this.opts.handlers.onWireEvent(n);break}if(s.route==="agent"){if(this.opts.handlers.onRawAgentEvent&&typeof n.session_id=="string"){const r=n,a=n;this.opts.handlers.onRawAgentEvent({type:s.agentType,seq:r.seq,session_id:r.session_id,timestamp:r.timestamp,payload:r.payload,...a.volatile!==void 0?{volatile:a.volatile}:{},...a.offset!==void 0?{offset:a.offset}:{}})}break}break}}}onServerHello(){this.connected=!0,this.reconnectAttempts=0,this.opts.handlers.onConnectionState(!0);const t=Array.from(this.subscriptions.keys());for(const o of this.pendingSubscriptions)this.subscriptions.set(o.sessionId,o.cursor),t.includes(o.sessionId)||t.push(o.sessionId);this.pendingSubscriptions.length=0;const n={};for(const[o,s]of this.subscriptions.entries())n[o]=s;const i=this.nextId();this.clientHelloId=i,this.send({type:"client_hello",id:i,payload:{client_id:this.opts.clientId,subscriptions:t,cursors:n,...this.opts.mainAgentOnly?{agent_filter:this.rawAgentFilter(t)}:{}}});for(const o of this.transcriptSubscriptions.keys())this.sendTranscriptSubscribe(o);for(const o of this.terminalAttachments.values())this.sendTerminalAttach(o.sessionId,o.terminalId,o.lastSeq)}sendSubscribe(t,n){this.send({type:"subscribe",id:this.nextId(),payload:{session_ids:t,cursors:n,...this.opts.mainAgentOnly?{agent_filter:this.rawAgentFilter(t)}:{}}})}rawAgentFilter(t){return Object.fromEntries(t.map(n=>[n,["main",...this.sideChannelAgents.get(n)??[]]]))}sendTranscriptSubscribe(t,n){const i=this.transcriptSubscriptions.get(t);if(i===void 0||i.size===0)return;const o={},s={};for(const[r,a]of i)o[r]="delta",a.sinceSeq!==void 0&&(n===void 0||n===r)&&(s[r]=a.sinceSeq);this.send({type:"subscribe_v2",id:this.nextId(),payload:{session_id:t,transcript:o,...Object.keys(s).length>0?{transcript_since:s}:{}}})}sendTerminalAttach(t,n,i){this.send({type:"terminal_attach",id:this.nextId(),payload:{session_id:t,terminal_id:n,since_seq:i>0?i:void 0}})}trackCursor(t){if(t.volatile===!0)return;const n=t.session_id,i=t.seq;if(typeof n!="string"||typeof i!="number")return;const o=this.subscriptions.get(n);if(!o||i<=o.seq&&o.epoch!==void 0)return;const s=typeof t.epoch=="string"?t.epoch:o.epoch;this.subscriptions.set(n,{seq:Math.max(i,o.seq),epoch:s})}send(t){if(!(!this.ws||this.ws.readyState!==WebSocket.OPEN))try{this.ws.send(JSON.stringify(t)),this.tracer.wsEvent?.({kind:"out",frame:t})}catch{}}nextId(){return`c_${++this.msgSeq}`}}function P9(e,t){return`${e}\0${t}`}async function R7e(e,t,n){const i=await e.get(`/sessions/${encodeURIComponent(t)}/transcript`,{agent_id:n.agentId,before_turn:n.beforeTurn,after_turn:n.afterTurn,page_size:n.pageSize}),o=w7e.parse(i),s={items:o.items,tasks:o.tasks,interactions:o.interactions,attachments:o.attachments,todos:o.todos,prompts:o.prompts,meta:o.meta,hasMoreOlder:o.has_more};return{agentId:o.agent_id,...s,agents:o.agents,pendingInteractions:o.pending_interactions,...o.seq!==void 0?{seq:o.seq}:{}}}const K5=10485760,D7e=5e3,nO=40001;function O7e(e,t){if(e===void 0)return t;let n;const i=/filename\*\s*=\s*UTF-8''([^;]+)/i.exec(e)?.[1]?.trim();if(i!==void 0)try{n=decodeURIComponent(i.replaceAll(/^"|"$/g,""))}catch{return t}else n=/filename\s*=\s*"([^"]*)"/i.exec(e)?.[1]??/filename\s*=\s*([^;]+)/i.exec(e)?.[1]?.trim();return n===void 0||n.length===0||n.length>200||n==="."||n===".."||/[\u0000-\u001F\u007F/\\]/.test(n)||!n.toLowerCase().endsWith(".zip")?t:n}function P7e(e){if(typeof e!="object"||e===null)return{errorName:typeof e};const t=e;return{errorName:typeof t.name=="string"?t.name:"Error",errorCode:typeof t.code=="number"?t.code:void 0,requestId:typeof t.requestId=="string"?t.requestId:void 0,phase:typeof t.phase=="string"?t.phase:void 0,httpStatus:typeof t.status=="number"?t.status:void 0}}function Z5(e){return{id:e.id,sessionId:e.session_id,cwd:e.cwd,shell:e.shell,cols:e.cols,rows:e.rows,status:e.status,createdAt:e.created_at,exitedAt:e.exited_at,exitCode:e.exit_code}}function iO(e){return e==="auto_compact"||e==="manual_compact"}class B7e{constructor(t){this.opts=t,this.tracer=t.tracer??T_,this.http=new xD({origin:t.origin,identity:t.identity,tracer:this.tracer,credentialStore:t.credentialStore}),this.httpV2=new xD({origin:t.origin,identity:t.identity,tracer:this.tracer,credentialStore:t.credentialStore,restBasePath:"/api/v2"})}http;httpV2;tracer;async getHealth(){return{status:"ok",uptimeSec:(await this.http.get("/healthz")).uptime_sec??0}}async getMeta(){const t=await this.http.get("/meta");return{serverVersion:t.server_version,serverId:t.server_id,startedAt:t.started_at,capabilities:t.capabilities,openInApps:Array.isArray(t.open_in_apps)?t.open_in_apps:[],dangerousBypassAuth:t.dangerous_bypass_auth===!0,experimentalFlags:t.experimental_flags??{},backend:t.backend==="v2"?"v2":"v1",webTitle:t.web_title??""}}async listSessions(t){const n={before_id:t?.beforeId,after_id:t?.afterId,page_size:t?.pageSize,busy:t?.busy,include_archive:t?.includeArchive,archived_only:t?.archivedOnly,exclude_empty:t?.excludeEmpty,workspace_id:t?.workspaceId},i=await this.http.get("/sessions",n);return{items:i.items.map(uc),hasMore:i.has_more}}async listSessionsV2(t){const n={sort:t?.sort,page_size:t?.pageSize,page_token:t?.pageToken,page:t?.page,"meta.updated_after":t?.updatedAfter,"meta.updated_before":t?.updatedBefore,"meta.archived":t?.archived===void 0?void 0:String(t.archived),include:t?.include,"workspace.id":t?.workspaceIds,"activity.status":t?.statuses},i=await this.httpV2.get("/sessions",n);return{items:i.items,hasMore:i.has_more,nextPageToken:i.next_page_token,total:i.total}}async listSessionIdsV2(t){const n={sort:t?.sort,page_size:t?.pageSize,page_token:t?.pageToken,page:t?.page,"meta.updated_after":t?.updatedAfter,"meta.updated_before":t?.updatedBefore,"meta.archived":t?.archived===void 0?void 0:String(t.archived),fields:"id,archived","workspace.id":t?.workspaceIds,"activity.status":t?.statuses},i=await this.httpV2.get("/sessions",n);return{items:i.items,hasMore:i.has_more,nextPageToken:i.next_page_token,total:i.total}}async listSessionGroupsV2(t){const n={view:"by_workspace","group.page_size":t?.groupPageSize,"meta.has_prompt":t?.hasPrompt===void 0?void 0:String(t.hasPrompt),sort:t?.sort,page_size:t?.pageSize,page_token:t?.pageToken,"meta.archived":t?.archived===void 0?void 0:String(t.archived),"workspace.id":t?.workspaceIds,"activity.status":t?.statuses},i=await this.httpV2.get("/sessions",n);return{groups:i.groups,hasMore:i.has_more,nextPageToken:i.next_page_token,total:i.total}}async createSession(t){const n={metadata:t.cwd!==void 0?{cwd:t.cwd}:{}};t.workspaceId!==void 0&&(n.workspace_id=t.workspaceId),t.title!==void 0&&(n.title=t.title),t.model!==void 0&&(n.agent_config={model:t.model});const i=await this.http.post("/sessions",n);return uc(i)}async getSession(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}`);return uc(n)}async updateSession(t,n){const i={};n.title!==void 0&&(i.title=n.title),n.cwd!==void 0&&(i.metadata={cwd:n.cwd});const o={};n.model!==void 0&&(o.model=n.model),n.permissionMode!==void 0&&(o.permission_mode=n.permissionMode),n.planMode!==void 0&&(o.plan_mode=n.planMode),n.swarmMode!==void 0&&(o.swarm_mode=n.swarmMode),n.towerMode!==void 0&&(o.tower_mode=n.towerMode),n.towerBase!==void 0&&(o.tower_base=n.towerBase),n.goalObjective!==void 0&&(o.goal_objective=n.goalObjective),n.goalControl!==void 0&&(o.goal_control=n.goalControl),n.thinking!==void 0&&(o.thinking=n.thinking),Object.keys(o).length>0&&(i.agent_config=o);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/profile`,i);return uc(s)}async getSessionStatus(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/status`);return{model:n.model&&n.model.length>0?n.model:null,thinkingEffort:n.thinking_level,permission:n.permission,planMode:n.plan_mode===!0,swarmMode:n.swarm_mode===!0,towerMode:n.tower_mode===!0,contextTokens:n.context_tokens??0,maxContextTokens:n.max_context_tokens??0,contextUsage:n.context_usage??0}}async getSessionGoal(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/goal`);return zV(n)}async getSessionPlans(t,n){const i=await this.http.get(`/sessions/${encodeURIComponent(t)}/transcript/plan`,{agent_id:n.agentId,tool_call_id:n.toolCallId});return i.plans.map(o=>({agentId:i.agent_id,toolCallId:o.tool_call_id,turnId:o.turn_id,source:o.source,plan:o.plan,...o.path!==void 0?{path:o.path}:{},...o.options!==void 0?{options:o.options.map(s=>({label:s.label,...s.description!==void 0?{description:s.description}:{}}))}:{},...o.review!==void 0?{review:{state:o.review.state,...o.review.selected_option!==void 0?{selectedOption:o.review.selected_option}:{},...o.review.feedback!==void 0?{feedback:o.review.feedback}:{}}}:{}}))}async getTurnFileChanges(t,n){const i=await this.http.get(`/sessions/${encodeURIComponent(t)}/file-history/changes`,{turn_id:n});return i.recorded===!1?"unrecorded":i.changes??[]}async getTurnFileContent(t,n,i,o){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/file-history/content`,{turn_id:n,path:i,phase:o})).content??null}async getSessionWarnings(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/warnings`)).warnings??[]}async archiveSession(t){return await this.http.post(`/sessions/${encodeURIComponent(t)}:archive`,{})}async restoreSession(t){const n=await this.http.post(`/sessions/${encodeURIComponent(t)}:restore`,{});return uc(n)}async archiveSessions(t){return this.httpV2.post("/sessions:archive",{ids:t})}async restoreSessions(t){return this.httpV2.post("/sessions:restore",{ids:t})}async listMessages(t,n){const i={before_id:n?.beforeId,after_id:n?.afterId,page_size:n?.pageSize,role:n?.role},o=await this.http.get(`/sessions/${encodeURIComponent(t)}/messages`,i);return{items:o.items.map(BV),hasMore:o.has_more}}async getSessionTranscript(t,n){return R7e(this.http,t,n)}async exportSession(t,n,i){const o=n===void 0?0:new TextEncoder().encode(n).byteLength,s=n===void 0||n.length===0?0:n.split(` +`).length,r=`/sessions/${encodeURIComponent(t)}/export`,a={web_log_bytes:o,web_log_entries:s},l=i?.desktop===!0;let u;try{u=await this.http.postZip(r,{web_log:n,...l?{desktop:!0}:{}},a)}catch(d){if(l&&ai(d)&&d.code===nO)u=await this.http.postZip(r,{web_log:n},a);else throw d}const c=`${t}.zip`;return{blob:u.blob,fileName:O7e(u.contentDisposition,c)}}async submitPrompt(t,n){const i=Date.now();this.tracer.traceKeyEvent?.("prompt:start",{sessionId:t,contentCount:n.content.length,mediaCount:n.content.filter(o=>o.type==="image"||o.type==="video"||o.type==="file").length});try{const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts`,T3e(n));return this.tracer.traceKeyEvent?.("prompt:accepted",{sessionId:t,promptId:o.prompt_id,status:o.status,durationMs:Date.now()-i}),{promptId:o.prompt_id,userMessageId:o.user_message_id,origin:o.origin,status:o.status}}catch(o){throw this.tracer.traceKeyEvent?.("prompt:failed",{sessionId:t,status:"failed",durationMs:Date.now()-i,...P7e(o)}),o}}async steerPrompts(t,n){const i=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts:steer`,{prompt_ids:n});return{steered:i.steered,promptIds:i.prompt_ids}}async abortPrompt(t,n){const i=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts/${encodeURIComponent(n)}:abort`,void 0,{allowCodes:[40903]});return{aborted:i.aborted,atSeq:i.at_seq}}async abortSession(t){return{aborted:(await this.http.post(`/sessions/${encodeURIComponent(t)}:abort`,{})).aborted}}async compactSession(t,n){await this.http.post(`/sessions/${encodeURIComponent(t)}:compact`,n?{instruction:n}:{})}async undoSession(t,n=1){await this.http.post(`/sessions/${encodeURIComponent(t)}:undo`,{count:n})}async generateSessionTitle(t,n){try{const i={};n?.force===!0&&(i.force=!0),n?.source!==void 0&&(i.source=n.source);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/title/generate`,i);return typeof o?.title=="string"&&o.title.length>0?o.title:null}catch{return null}}async forkSession(t,n){const i={};n?.title!==void 0&&(i.title=n.title);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}:fork`,i,{timeoutMs:bD});return uc(o)}async createChildSession(t,n){const i={};n?.title!==void 0&&(i.title=n.title);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/children`,i,{timeoutMs:bD});return uc(o)}async listChildSessions(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/children`)).items.map(uc)}async startBtw(t){return{agentId:(await this.http.post(`/sessions/${encodeURIComponent(t)}:btw`,{})).agent_id}}async respondApproval(t,n,i){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/approvals/${encodeURIComponent(n)}`,E3e(i));return{resolved:o.resolved,resolvedAt:o.resolved_at}}async respondQuestion(t,n,i){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}`,O3e(i));return{resolved:o.resolved,resolvedAt:o.resolved_at}}async dismissQuestion(t,n){return{dismissed:!0,dismissedAt:(await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}:dismiss`,void 0,{allowCodes:[40909]})).dismissed_at}}async listTasks(t,n){const i={status:n};return(await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks`,i)).items.map(s=>c7(s))}async getTask(t,n,i){const o={with_output:i?.withOutput,output_bytes:i?.outputBytes},s=await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}`,o);return c7(s)}async cancelTask(t,n){return await this.http.post(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}:cancel`)}async detachTask(t,n){return await this.http.post(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}:detach`)}async listTerminals(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals`)).items.map(Z5)}async createTerminal(t,n={}){const i={cwd:n.cwd,shell:n.shell,cols:n.cols,rows:n.rows},o=await this.http.post(`/sessions/${encodeURIComponent(t)}/terminals`,i);return Z5(o)}async getTerminal(t,n){const i=await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}`);return Z5(i)}async closeTerminal(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}:close`)}async listSkills(t){return((await this.http.get(`/sessions/${encodeURIComponent(t)}/skills`)).skills??[]).map(i=>({name:i.name,description:i.description,path:i.path,source:i.source}))}async listSkillsForWorkspace(t){return((await this.http.get(`/workspaces/${encodeURIComponent(t)}/skills`)).skills??[]).map(i=>({name:i.name,description:i.description,path:i.path,source:i.source}))}async activateSkill(t,n,i,o){const s={};i!==void 0&&i.length>0&&(s.args=i),o!==void 0&&o.length>0&&(s.attachments=o.map($V));const r=await this.http.post(`/sessions/${encodeURIComponent(t)}/skills/${encodeURIComponent(n)}:activate`,s);return{activated:r.activated,skillName:r.skill_name}}async listCapabilities(){return(await this.http.get("/capabilities")).capabilities??[]}async getCapability(t){return this.http.get(`/capabilities/${encodeURIComponent(t)}`)}async installCapability(t){return this.http.post(`/capabilities/${encodeURIComponent(t)}:install`,{})}async listPlugins(){return(await this.http.get("/plugins")).plugins??[]}async listPluginMarketplace(){return(await this.http.get("/plugins/marketplace")).entries??[]}async installPlugin(t){return this.http.post("/plugins",{source:t})}async setPluginEnabled(t,n){return this.http.post(`/plugins/${encodeURIComponent(t)}:${n?"enable":"disable"}`,{})}async removePlugin(t){return this.http.post(`/plugins/${encodeURIComponent(t)}:remove`,{})}async listDirectory(t,n){const i={};n.path!==void 0&&(i.path=n.path),n.depth!==void 0&&(i.depth=n.depth),n.includeGitStatus!==void 0&&(i.include_git_status=n.includeGitStatus);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:list`,i),s=o.children_by_path?Object.fromEntries(Object.entries(o.children_by_path).map(([r,a])=>[r,a.map(ID)])):void 0;return{items:o.items.map(ID),childrenByPath:s,truncated:o.truncated}}async readFile(t,n){const i={path:n.path};n.offset!==void 0&&(i.offset=n.offset),n.length!==void 0&&(i.length=n.length);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:read`,i);return{path:o.path,content:o.content,encoding:o.encoding,size:o.size,truncated:o.truncated,etag:o.etag,mime:o.mime,languageId:o.language_id,lineCount:o.line_count,isBinary:o.is_binary}}async searchFiles(t,n,i){const o={workspace:t,query:n.query};n.limit!==void 0&&(o.limit=n.limit);const s=await this.http.post("/workspace/fs:search",o,{signal:i?.signal});return{items:s.items.map(r=>({path:r.path,name:r.name,kind:r.kind,score:r.score,matchPositions:r.match_positions})),truncated:s.truncated}}async suggestFiles(t,n,i){const o={workspace:t,query:n.query};n.limit!==void 0&&(o.limit=n.limit);const s=await this.http.post("/workspace/fs:suggest",o,{signal:i?.signal});return{items:s.items.map(r=>({path:r.path,name:r.name,kind:r.kind,score:r.score,matchPositions:r.match_positions})),truncated:s.truncated}}async grepFiles(t,n){const i={pattern:n.pattern};n.regex!==void 0&&(i.regex=n.regex),n.caseSensitive!==void 0&&(i.case_sensitive=n.caseSensitive);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:grep`,i);return{files:o.files,filesScanned:o.files_scanned,truncated:o.truncated,elapsedMs:o.elapsed_ms}}async getGitStatus(t,n){const i={};n!==void 0&&(i.paths=n);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:git_status`,i);return{branch:o.branch,ahead:o.ahead,behind:o.behind,entries:o.entries,additions:o.additions,deletions:o.deletions,pullRequest:o.pullRequest??null}}async getFileDiff(t,n){const i=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:diff`,{path:n});return{path:i.path,diff:i.diff,truncated:i.truncated??!1}}getFileDownloadUrl(t,n){const i=n.split("/").map(o=>encodeURIComponent(o)).join("/");return Cf(this.opts.origin,`/sessions/${encodeURIComponent(t)}/fs/${i}:download`)}async openFile(t,n){const i={path:n.path};return n.line!==void 0&&(i.line=n.line),this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open`,i)}async revealFile(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/fs:reveal`,{path:n.path})}async openInApp(t,n,i,o){const s={app_id:n,path:i};o!==void 0&&(s.line=o),await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open-in`,s)}async listWorkspaces(){try{return((await this.http.get("/workspaces")).items??[]).map(Nv)}catch{return[]}}async addWorkspace(t){const n={root:t.root};t.name!==void 0&&(n.name=t.name);const i=await this.http.post("/workspaces",n);return Nv(i)}async deleteWorkspace(t){await this.http.delete(`/workspaces/${encodeURIComponent(t)}`)}async updateWorkspace(t,n){const i=await this.http.patch(`/workspaces/${encodeURIComponent(t)}`,{name:n.name});return Nv(i)}async browseFs(t){try{const n=await this.http.get("/fs:browse",{path:t});return{path:n.path,parent:n.parent,entries:(n.entries??[]).map(i=>({name:i.name,path:i.path,isDir:i.is_dir}))}}catch{return{path:"",parent:null,entries:[]}}}async getFsHome(){try{const t=await this.http.get("/fs:home");return{home:t.home,recentRoots:t.recent_roots??[]}}catch{return{home:"",recentRoots:[]}}}async listModels(){return(await this.http.get("/models")).items.map(B3e)}async listProviders(){return(await this.http.get("/providers")).items.map(B1)}async getProvider(t){const n=await this.http.get(`/providers/${encodeURIComponent(t)}`),i=B1(n);return n.api_key!==void 0?{...i,apiKey:n.api_key}:i}async addProvider(t){const n={id:t.id??"",type:t.type,models:(t.models??[]).map(o=>{const s={model:o.model,max_context_size:o.maxContextSize};return o.displayName!==void 0&&(s.display_name=o.displayName),o.capabilities!==void 0&&(s.capabilities=o.capabilities),o.maxOutputSize!==void 0&&(s.max_output_size=o.maxOutputSize),o.supportEfforts!==void 0&&(s.support_efforts=o.supportEfforts),o.adaptiveThinking!==void 0&&(s.adaptive_thinking=o.adaptiveThinking),s})};t.apiKey!==void 0&&(n.api_key=t.apiKey),t.baseUrl!==void 0&&(n.base_url=t.baseUrl),t.defaultModel!==void 0&&(n.default_model=t.defaultModel);const i=await this.http.post("/providers",n);return B1(i)}async updateProvider(t,n){const i={type:n.type,models:(n.models??[]).map(s=>{const r={model:s.model,max_context_size:s.maxContextSize};return s.displayName!==void 0&&(r.display_name=s.displayName),s.capabilities!==void 0&&(r.capabilities=s.capabilities),s.maxOutputSize!==void 0&&(r.max_output_size=s.maxOutputSize),s.supportEfforts!==void 0&&(r.support_efforts=s.supportEfforts),s.adaptiveThinking!==void 0&&(r.adaptive_thinking=s.adaptiveThinking),r})};n.newId!==void 0&&(i.new_id=n.newId),n.apiKey!==void 0&&(i.api_key=n.apiKey),n.baseUrl!==void 0&&(i.base_url=n.baseUrl),n.defaultModel!==void 0&&(i.default_model=n.defaultModel);const o=await this.http.put(`/providers/${encodeURIComponent(t)}`,i);return{provider:B1(o.provider)}}async deleteProvider(t){return await this.http.delete(`/providers/${encodeURIComponent(t)}`),{deleted:t}}async listCatalogProviders(){return(await this.http.get("/catalog/providers")).items.map(MD)}async getCatalogProvider(t){const n=await this.http.get(`/catalog/providers/${encodeURIComponent(t)}`);return MD(n)}async importCatalogProvider(t){const n={catalog_id:t.catalogId};t.apiKey!==void 0&&(n.api_key=t.apiKey),t.baseUrl!==void 0&&(n.base_url=t.baseUrl),t.id!==void 0&&(n.id=t.id);const i=await this.http.post("/providers:import_catalog",n);return{provider:B1(i.provider),modelsImported:i.models_imported}}async importCustomRegistry(t){const n={url:t.url};t.apiKey!==void 0&&(n.api_key=t.apiKey);const i=await this.http.post("/providers:import_registry",n);return{providers:i.providers.map(B1),modelsImported:i.models_imported}}async refreshProvider(t){const n=await this.http.post(`/providers/${encodeURIComponent(t)}:refresh`);return G5(n)}async refreshAllProviders(){const t=await this.http.post("/providers:refresh");return G5(t)}async refreshOAuthProviderModels(){const t=await this.http.post("/providers:refresh_oauth");return G5(t)}async getConfig(){const t=await this.http.get("/config");return d7(t)}async setConfig(t){const n={},i={providers:"providers",defaultProvider:"default_provider",defaultModel:"default_model",secondaryModel:"secondary_model",models:"models",thinking:"thinking",planMode:"plan_mode",yolo:"yolo",defaultPermissionMode:"default_permission_mode",defaultPlanMode:"default_plan_mode",permission:"permission",hooks:"hooks",services:"services",mergeAllAvailableSkills:"merge_all_available_skills",extraSkillDirs:"extra_skill_dirs",loopControl:"loop_control",background:"background",experimental:"experimental",telemetry:"telemetry",raw:"raw"};for(const[s,r]of Object.entries(t)){const a=i[s];a!==void 0&&(n[a]=r)}const o=await this.http.post("/config",n);return d7(o)}async getAuth(){const t=await this.http.get("/auth");return{modelsReady:t.models_ready,providersCount:t.providers_count,managedProvider:t.managed_provider?{status:t.managed_provider.status}:null}}async startOAuthLogin(t){let n;try{n=await this.http.post("/oauth/login",t===void 0?{}:{region:t})}catch(i){if(t!==void 0&&ai(i)&&i.code===nO)n=await this.http.post("/oauth/login",{});else throw i}return n.status==="authenticated"?{flowId:n.flow_id,provider:n.provider,status:"authenticated"}:{flowId:n.flow_id,provider:n.provider,status:"pending",verificationUri:n.verification_uri,verificationUriComplete:n.verification_uri_complete,userCode:n.user_code,expiresIn:n.expires_in,interval:n.interval,expiresAt:n.expires_at}}async pollOAuthLogin(){const t=await this.http.get("/oauth/login");return t?{flowId:t.flow_id,status:t.status,resolvedAt:t.resolved_at,errorMessage:t.error_message}:null}async cancelOAuthLogin(){const t=await this.http.delete("/oauth/login");return{cancelled:t.cancelled,status:t.status}}async logout(){return{loggedOut:(await this.http.post("/oauth/logout",{})).logged_out}}async getUsage(){const t=await this.http.get("/oauth/usage");if(t.kind==="error")return{kind:"error",message:t.message,status:t.status};const n=i=>({name:i.name,window:i.window,used:i.used,limit:i.limit,resetAt:i.reset_at});return{kind:"ok",summary:t.summary===null?null:n(t.summary),limits:t.limits.map(n),extraUsage:t.extra_usage===null?null:{balanceCents:t.extra_usage.balance_cents,totalCents:t.extra_usage.total_cents,monthlyChargeLimitEnabled:t.extra_usage.monthly_charge_limit_enabled,monthlyChargeLimitCents:t.extra_usage.monthly_charge_limit_cents,monthlyUsedCents:t.extra_usage.monthly_used_cents,currency:t.extra_usage.currency}}}async getUserInfo(){return this.http.get("/oauth/userinfo")}async getOAuthRegion(){try{const t=await Promise.race([this.http.get("/oauth/region"),new Promise((n,i)=>{setTimeout(()=>i(new Error("oauth region probe timed out")),D7e)})]);return t.region==="mainland-cn"||t.region==="global"?t.region:null}catch{return null}}async uploadFile(t){const n=new FormData;n.append("file",t.file,t.name??(t.file instanceof File?t.file.name:"upload")),t.name!==void 0&&n.append("name",t.name);const i=await this.http.postForm("/files",n,{onUploadProgress:t.onProgress,signal:t.signal});return{id:i.id,name:i.name,mediaType:i.media_type,size:i.size}}getFileUrl(t){return Cf(this.opts.origin,`/files/${encodeURIComponent(t)}`)}async getFileBlob(t,n){return this.http.getBlob(`/files/${encodeURIComponent(t)}`,void 0,n)}getSessionMediaUrl(t,n){return Cf(this.opts.origin,`/sessions/${encodeURIComponent(t)}/media/${encodeURIComponent(n)}`)}async getSessionMediaBlob(t,n,i){return this.http.getBlob(`/sessions/${encodeURIComponent(t)}/media/${encodeURIComponent(n)}`,void 0,i)}async readHostFileContent(t){const n=await this.http.getBlob("/fs:content",{path:t},{maxBytes:K5});if(n.size>K5)throw new Db({size:n.size,limit:K5});const i=n.type,o=!$7e(i),s=i||(o?"application/octet-stream":"text/plain");if(o){const a=await z7e(n);return{path:t,content:a,encoding:"base64",mime:s,isBinary:!0,size:n.size}}const r=await n.text();return{path:t,content:r,encoding:"utf-8",mime:s,isBinary:!1,size:n.size}}connectEvents(t){const n=kD(this.opts.origin,this.opts.identity.clientId),i=this.opts.projectorFactory(),o=new tO({wsUrl:n,clientId:this.opts.identity.clientId,tracer:this.tracer,credentialStore:this.opts.credentialStore,mainAgentOnly:this.opts.mainAgentOnly,handlers:{onWireEvent:s=>{const r=$3e(s),a=z3e(s),l=P3e(s);l.type==="historyCompacted"&&!iO(l.reason)&&t.onResync(l.sessionId,l.beforeSeq),t.onEvent(l,{sessionId:r,seq:a})},onRawAgentEvent:s=>{const{type:r,seq:a,session_id:l,payload:u,offset:c}=s,d=i.project(r,u,l,{offset:c});for(const f of d){const h=u?.turnId,m=f.type==="assistantDelta"&&typeof h=="number"&&typeof c=="number"&&(r==="assistant.delta"||r==="thinking.delta")?{turnId:h,offset:c,kind:r==="assistant.delta"?"text":"thinking"}:void 0;f.type==="historyCompacted"&&!iO(f.reason)&&t.onResync(l,a),t.onEvent(f,{sessionId:l,seq:a,stream:m})}},onResync:(s,r,a)=>{i.reset(s),t.onResync(s,r,a)},onConnectionState:s=>{t.onConnectionChange(s)},onReplayComplete:()=>{t.onReplayComplete?.()},onError:(s,r,a)=>{t.onError(s,r,a)},onTerminalOutput:(s,r,a,l)=>{t.onTerminalOutput?.(s,r,a,l)},onTerminalExit:(s,r,a)=>{t.onTerminalExit?.(s,r,a)},onTranscriptReset:(s,r,a,l)=>{t.onTranscriptReset?.(s,r,a,l)},onTranscriptOps:(s,r,a,l)=>t.onTranscriptOps?.(s,r,a,l)??!0}});return o.connect(),{subscribe(s,r){o.subscribe(s,r??{seq:0})},unsubscribe(s){o.unsubscribe(s),i.forgetSession(s)},subscribeTranscript(s,r,a){o.subscribeTranscript(s,r,a)},unsubscribeTranscript(s,r){o.unsubscribeTranscript(s,r)},bindNextPromptId(s,r){i.bindNextPromptId(s,r)},abort(s,r){o.abort(s,r)},terminalAttach(s,r,a){o.terminalAttach(s,r,a)},terminalInput(s,r,a){o.terminalInput(s,r,a)},terminalResize(s,r,a,l){o.terminalResize(s,r,a,l)},terminalDetach(s,r){o.terminalDetach(s,r)},terminalClose(s,r){o.terminalClose(s,r)},markSideChannelAgent(s,r){o.markSideChannelAgent(s,r),i.markSideChannelAgent(r)},health(){return o.health()},reconnect(){o.reconnect()},close(){o.close()}}}connectTranscriptChannel(t){const n=`${this.opts.identity.clientId}-transcript`,i=new tO({wsUrl:kD(this.opts.origin,n),clientId:n,tracer:this.tracer,credentialStore:this.opts.credentialStore,handlers:{onWireEvent:()=>{},onResync:()=>{},onConnectionState:o=>t.onConnectionState?.(o),onError:(o,s,r)=>t.onError?.(o,s,r),onTranscriptReset:t.onTranscriptReset,onTranscriptOps:t.onTranscriptOps}});return i.connect(),{subscribe:()=>{},unsubscribe:()=>{},subscribeTranscript:(o,s,r)=>i.subscribeTranscript(o,s,r),unsubscribeTranscript:(o,s)=>i.unsubscribeTranscript(o,s),bindNextPromptId:()=>{},abort:()=>{},terminalAttach:()=>{},terminalInput:()=>{},terminalResize:()=>{},terminalDetach:()=>{},terminalClose:()=>{},markSideChannelAgent:()=>{},health:()=>i.health(),reconnect:()=>i.reconnect(),close:()=>i.close()}}}function G5(e){return{changed:e.changed.map(t=>({providerId:t.provider_id,providerName:t.provider_name,added:t.added,removed:t.removed})),unchanged:e.unchanged,failed:e.failed}}function $7e(e){const t=e.toLowerCase().split(";")[0].trim();return t===""||t==="text/plain"||t.startsWith("text/")?!0:/(json|xml|javascript|typescript|x-yaml|yaml|svg|x-sh|x-python|markdown|csv|html|css)$/.test(t)}function z7e(e){return new Promise((t,n)=>{const i=new FileReader;i.onload=()=>{const o=typeof i.result=="string"?i.result:"";t(o.slice(o.indexOf(",")+1))},i.onerror=()=>n(i.error),i.readAsDataURL(e)})}const j7e="main",H7e=new Set(["turn.started","turn.step.started","turn.step.completed","turn.step.retrying","turn.step.interrupted","turn.ended","thinking.delta","assistant.delta","tool.use","tool.call.started","tool.call.delta","tool.progress","tool.result","agent.status.updated","prompt.completed","prompt.aborted","error"]);function Q5(e="msg_"){const t=Date.now().toString(36).padStart(10,"0"),n=Math.random().toString(36).slice(2,12).padEnd(10,"0");return`${e}${t}${n}`}function W7e(e){if(!e||typeof e!="object")return{input:0,output:0,cacheRead:0,cacheCreate:0};const t=e;return{input:t.inputOther??t.input_tokens??0,output:t.output??t.output_tokens??0,cacheRead:t.inputCacheRead??t.cache_read_input_tokens??0,cacheCreate:t.inputCacheCreation??t.cache_creation_input_tokens??0}}function oO(){return{turnPromptId:new Map,currentPromptId:void 0,totalInput:0,totalOutput:0,totalCacheRead:0,totalCacheCreate:0,contextTokens:0,contextLimit:0,turnCount:0,model:"",subagentMeta:new Map,restartedThisRun:new Set,settledByKernel:new Set,retiredBindings:new Set,registrationSeq:0,registrationOrderByKey:new Map,retryActive:!1}}function Pr(e,t){const n=e[t];return typeof n=="string"?n:void 0}function pr(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function Pl(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function q7e(e){if(!e||typeof e!="object")return null;const t=e,n=t.budget,i=n&&typeof n=="object"?n:{},o=Pr(t,"status");if(o!=="active"&&o!=="paused"&&o!=="blocked"&&o!=="complete")return null;const s=Pr(t,"goalId")??Pr(t,"goal_id")??"goal",r=Pr(t,"objective")??"";return{goalId:s,objective:r,completionCriterion:Pr(t,"completionCriterion")??Pr(t,"completion_criterion"),status:o,turnsUsed:pr(t,"turnsUsed")??pr(t,"turns_used")??0,tokensUsed:pr(t,"tokensUsed")??pr(t,"tokens_used")??0,wallClockMs:pr(t,"wallClockMs")??pr(t,"wall_clock_ms")??0,terminalReason:Pr(t,"terminalReason")??Pr(t,"terminal_reason"),budget:{tokenBudget:Pl(i,"tokenBudget")??Pl(i,"token_budget"),remainingTokens:Pl(i,"remainingTokens")??Pl(i,"remaining_tokens"),turnBudget:Pl(i,"turnBudget")??Pl(i,"turn_budget"),remainingTurns:Pl(i,"remainingTurns")??Pl(i,"remaining_turns"),wallClockBudgetMs:Pl(i,"wallClockBudgetMs")??Pl(i,"wall_clock_budget_ms"),remainingWallClockMs:Pl(i,"remainingWallClockMs")??Pl(i,"remaining_wall_clock_ms"),overBudget:i.overBudget===!0||i.over_budget===!0}}}function mf(e,t,n,i,o){if(typeof i!="string"||i.length===0)return null;const r={...t.subagentMeta.get(i)??{id:i,agentId:i,sessionId:n,kind:"subagent",description:e("tasks.dockSubagent"),status:"running",createdAt:new Date().toISOString(),subagentPhase:"queued"},...o,id:i,sessionId:n,kind:"subagent"};return t.subagentMeta.set(i,r),r}function U7e(e,t,n){if(t==="turn.step.started")return null;if(t==="tool.use"||t==="tool.call.started"){const i=Pr(n,"name")??Pr(n,"toolName")??"tool",o=CH(e,V7e(i)),s=K7e(e,i,n.args??n.input);return s?`Calling ${o}: ${s}`:`Calling ${o}`}if(t==="tool.progress"){const i=n.update;if(i&&typeof i=="object"){const s=Pr(i,"text");if(s)return Y5(s);const r=Pr(i,"message");if(r)return Y5(r)}const o=Pr(n,"message");if(o)return Y5(o)}return null}function V7e(e){return e.replace(/_\d+$/,"")}const sO=2e3;function Y5(e){return e.length>sO?`${e.slice(0,sO)}…`:e}function K7e(e,t,n){if(n==null)return"";const i=typeof n=="string"?n:JSON.stringify(n);return pS(e,t,i)}function Z7e(e,t,n,i,o,s,r){if(r.has(i)&&o==="turn.step.started")return[];if(o==="assistant.delta"){const h=Pr(s,"delta");if(!h)return[];const m=t.subagentMeta.get(i),g=mf(e,t,n,i,{status:"running",subagentPhase:"working",startedAt:m?.startedAt??new Date().toISOString()}),y=[];return g&&y.push({type:"taskCreated",sessionId:n,task:g}),y.push({type:"taskProgress",sessionId:n,taskId:i,outputChunk:h,stream:"stdout",kind:"text"}),y}const a=U7e(e,o,s);if(a===null||a.length===0)return[];const l=o==="tool.progress"?s.update:void 0,u=l!=null&&typeof l=="object"?l.replace===!0:!1,c=t.subagentMeta.get(i),d=mf(e,t,n,i,{status:"running",subagentPhase:"working",startedAt:c?.startedAt??new Date().toISOString()}),f=[];return d&&f.push({type:"taskCreated",sessionId:n,task:d}),f.push({type:"taskProgress",sessionId:n,taskId:i,outputChunk:a,stream:"stdout",replace:u}),f}function G7e(e){return Array.isArray(e)?e.map(t=>n3(t)):[]}function Q7e(e){return{inputTokens:e.totalInput,outputTokens:e.totalOutput,cacheReadTokens:e.totalCacheRead,cacheCreationTokens:e.totalCacheCreate,totalCostUsd:0,contextTokens:e.contextTokens,contextLimit:e.contextLimit,turnCount:e.turnCount}}const Y7e=new Set(["session.meta.updated","goal.updated","compaction.completed","compaction.started","compaction.cancelled","compaction.blocked","hook.result","mcp.server.status","skill.activated","tool.list.updated"]);function J7e(e,t,n){switch(e){case"session.meta.updated":{const i=t?.patch?.title??t?.title,o=t?.patch?.lastPrompt,s={};return typeof i=="string"&&i.length>0&&(s.title=i),typeof o=="string"&&(s.lastPrompt=o),s.title!==void 0||s.lastPrompt!==void 0?[{type:"sessionMetaUpdated",sessionId:n,...s}]:[]}case"goal.updated":{const i=q7e(t?.snapshot??null);return[{type:"goalUpdated",sessionId:n,goal:i?.status==="complete"?null:i}]}case"compaction.completed":{const i=t?.result??{};return[{type:"compactionCompleted",sessionId:n,tokensBefore:typeof i.tokensBefore=="number"?i.tokensBefore:void 0,tokensAfter:typeof i.tokensAfter=="number"?i.tokensAfter:void 0,summary:typeof i.summary=="string"?i.summary:void 0},{type:"historyCompacted",sessionId:n,beforeSeq:0,reason:"auto_compact"}]}case"compaction.started":return[{type:"compactionStarted",sessionId:n,trigger:t?.trigger==="manual"?"manual":"auto",instruction:typeof t?.instruction=="string"?t.instruction:void 0}];case"compaction.cancelled":return[{type:"compactionCancelled",sessionId:n}];default:return[]}}function X7e(e){const{t}=e,n=new Map,i=new Set;function o(f){let h=n.get(f);return h||(h=oO(),n.set(f,h)),h}function s(f){n.set(f,oO())}function r(f){n.delete(f)}function a(f){return n.has(f)}function l(f){i.add(f)}function u(f,h){const m=o(f);m.currentPromptId=h}function c(f,h,m,g){try{return d(f,h,m,g)}catch(y){return gc("[agentProjector] Error projecting event:",f,y instanceof Error?y.message:y),[]}}function d(f,h,m,g){if(Y7e.has(f))return J7e(f,h,m);const y=o(m),b=h,v=[],w=b?.agentId;if(typeof w=="string"&&w!==j7e){const A=i.has(w);if(f==="prompt.submitted"){if(!A)return[];const M=b?.promptId,L=b?.userMessageId;if(!M||!L)return[];const E=G7e(b?.content);return E.length===0?[]:[{type:"messageCreated",agentId:w,message:{id:L,sessionId:m,role:"user",content:E,createdAt:typeof b?.createdAt=="string"?b.createdAt:new Date().toISOString(),promptId:M}}]}if(A&&(f==="thinking.delta"||f==="assistant.delta")){const M=b?.delta??"";return M?[{type:"agentDelta",sessionId:m,agentId:w,delta:{[f==="thinking.delta"?"thinking":"text"]:M}}]:[]}if(A&&f==="turn.ended")return[{type:"agentTurnEnded",sessionId:m,agentId:w,reason:b?.reason}];if(H7e.has(f))return Z7e(t,y,m,w,f,b??{},i)}switch(f){case"turn.started":{const A=b?.turnId,M=y.currentPromptId??Q5("pr_");y.currentPromptId=M,A!==void 0&&y.turnPromptId.set(A,M),v.push({type:"turnActiveChanged",sessionId:m,active:!0});break}case"turn.step.started":case"thinking.delta":case"assistant.delta":case"tool.use":case"tool.call.started":case"tool.call.delta":case"tool.progress":case"tool.result":break;case"turn.step.completed":{const A=W7e(b?.usage);y.totalInput+=A.input,y.totalOutput+=A.output,y.totalCacheRead+=A.cacheRead,y.totalCacheCreate+=A.cacheCreate;break}case"agent.status.updated":{b?.model&&(y.model=b.model),b?.contextTokens!==void 0&&(y.contextTokens=b.contextTokens),b?.maxContextTokens!==void 0&&(y.contextLimit=b.maxContextTokens);const A=b?.phase;A!=null&&A.kind==="retrying"?(y.retryActive=!0,v.push({type:"turnRetry",sessionId:m,retry:{failedAttempt:pr(A,"failedAttempt")??0,nextAttempt:pr(A,"nextAttempt")??0,maxAttempts:pr(A,"maxAttempts")??0,delayMs:pr(A,"delayMs")??0,errorName:Pr(A,"errorName"),statusCode:pr(A,"statusCode"),turnId:pr(A,"turnId")}})):y.retryActive&&A!==void 0&&A!==null&&typeof A.kind=="string"&&(y.retryActive=!1,v.push({type:"turnRetry",sessionId:m,retry:void 0})),v.push({type:"sessionUsageUpdated",sessionId:m,usage:Q7e(y),model:y.model||void 0,swarmMode:b?.swarmMode===!0?!0:b?.swarmMode===!1?!1:void 0,towerMode:b?.towerMode===!0?!0:b?.towerMode===!1?!1:void 0,planMode:b?.planMode===!0?!0:b?.planMode===!1?!1:void 0,thinking:typeof b?.thinkingEffort=="string"&&b.thinkingEffort.length>0?b.thinkingEffort:void 0});break}case"turn.ended":{const A=b?.turnId,M=(A!==void 0?y.turnPromptId.get(A):void 0)??y.currentPromptId;v.push({type:"turnActiveChanged",sessionId:m,active:!1,reason:b?.reason,promptId:M}),y.turnCount++,y.currentPromptId=void 0;break}case"prompt.completed":{const A=b?.promptId;typeof A=="string"&&A.length>0&&v.push({type:"promptCompleted",sessionId:m,promptId:A,reason:b?.reason??"completed"});break}case"prompt.aborted":{const A=b?.promptId;typeof A=="string"&&A.length>0&&v.push({type:"promptAborted",sessionId:m,promptId:A});break}case"turn.step.retrying":{y.retryActive=!0,v.push({type:"turnRetry",sessionId:m,retry:{failedAttempt:pr(b??{},"failedAttempt")??0,nextAttempt:pr(b??{},"nextAttempt")??0,maxAttempts:pr(b??{},"maxAttempts")??0,delayMs:pr(b??{},"delayMs")??0,errorName:Pr(b??{},"errorName"),statusCode:pr(b??{},"statusCode"),turnId:typeof b?.turnId=="number"?b.turnId:void 0}});break}case"turn.step.interrupted":break;case"subagent.spawned":{const A=typeof b?.subagentId=="string"&&b.subagentId.length>0?b.subagentId:Q5("task_"),M=typeof b?.taskId=="string"&&b.taskId.length>0?b.taskId:void 0,L=M!==void 0&&M!==A?y.subagentMeta.get(M):void 0,E=y.subagentMeta.get(A);L!==void 0&&y.subagentMeta.delete(M),M!==void 0&&!y.registrationOrderByKey.has(M)&&y.registrationOrderByKey.set(M,++y.registrationSeq);const C=E===void 0||L===void 0?E??L:{...E,createdAt:L.createdAt,startedAt:L.startedAt??E.startedAt,runInBackground:!0,backgroundTaskId:E.backgroundTaskId??M},x=C?.backgroundTaskId??(C!==void 0&&M!==void 0&&C.id===M?M:void 0),_=M!==void 0?y.registrationOrderByKey.get(M):void 0,F=x!==void 0?y.registrationOrderByKey.get(x):void 0,I=y.retiredBindings.has(M??"")||_!==void 0&&F!==void 0&&_0?b.model:C?.model,thinkingEffort:typeof b?.thinkingEffort=="string"&&b.thinkingEffort.length>0?b.thinkingEffort:C?.thinkingEffort,parentToolCallId:typeof b?.parentToolCallId=="string"?b.parentToolCallId:C?.parentToolCallId,swarmIndex:typeof b?.swarmIndex=="number"?b.swarmIndex:C?.swarmIndex,runInBackground:D?b?.runInBackground===!0||b?.runInBackground===void 0&&C?.runInBackground===!0:b?.runInBackground===!0||C?.runInBackground===!0,outputPreview:D?void 0:C?.outputPreview,outputBytes:D?void 0:C?.outputBytes,outputLines:D?void 0:C?.outputLines,suspendedReason:D?void 0:C?.suspendedReason,text:D?void 0:C?.text,backgroundTaskId:I?C?.backgroundTaskId:D?M:M??C?.backgroundTaskId};y.subagentMeta.set($.id,$),v.push({type:"taskCreated",sessionId:m,task:$});break}case"subagent.started":{const A=typeof b?.subagentId=="string"?b.subagentId:void 0,M=A!==void 0&&(y.subagentMeta.get(A)?.status!==void 0&&y.subagentMeta.get(A).status!=="running"||y.settledByKernel.has(A));M&&y.settledByKernel.delete(A);const L=mf(t,y,m,b?.subagentId,{subagentPhase:"working",status:"running",startedAt:new Date().toISOString(),suspendedReason:void 0,...M?{createdAt:new Date().toISOString(),completedAt:void 0,completedAtEstimated:void 0,outputPreview:void 0,outputBytes:void 0,outputLines:void 0,text:void 0}:{}});M&&A!==void 0&&y.restartedThisRun.add(A),L&&v.push({type:"taskCreated",sessionId:m,task:L});break}case"subagent.suspended":{const A=mf(t,y,m,b?.subagentId,{subagentPhase:"suspended",status:"running",suspendedReason:typeof b?.reason=="string"?b.reason:void 0});A&&v.push({type:"taskCreated",sessionId:m,task:A});break}case"subagent.completed":{const A=typeof b?.resultSummary=="string"?b.resultSummary:void 0,M=mf(t,y,m,b?.subagentId,{subagentPhase:"completed",status:"completed",completedAt:new Date().toISOString(),completedAtEstimated:!0,outputPreview:A});M&&v.push({type:"taskCreated",sessionId:m,task:M}),M!==null&&y.restartedThisRun.delete(M.id),v.push({type:"taskCompleted",sessionId:m,taskId:b?.subagentId??"",status:"completed",outputPreview:A});break}case"subagent.failed":{const A=typeof b?.error=="string"?b.error:void 0,M=mf(t,y,m,b?.subagentId,{subagentPhase:"failed",status:"failed",completedAt:new Date().toISOString(),completedAtEstimated:!0,outputPreview:A});M&&v.push({type:"taskCreated",sessionId:m,task:M}),M!==null&&y.restartedThisRun.delete(M.id),v.push({type:"taskCompleted",sessionId:m,taskId:b?.subagentId??"",status:"failed",outputPreview:A});break}case"error":{v.push({type:"unknown",raw:{_agentError:!0,code:b?.code,message:b?.message,name:b?.name,details:b?.details,retryable:b?.retryable}});break}case"warning":{v.push({type:"unknown",raw:{_agentWarning:!0,message:b?.message}});break}case"task.started":case"background.task.started":{const A=b?.info??{},M=typeof A.startedAt=="number"?new Date(A.startedAt).toISOString():void 0,L=typeof A.taskId=="string"?A.taskId:typeof A.taskId=="number"?String(A.taskId):Q5("task_"),E=typeof A.description=="string"?A.description:typeof A.command=="string"?A.command:t("tasks.defaultDescription");if(A.kind==="agent"){const x=typeof A.agentId=="string"&&A.agentId.length>0?A.agentId:void 0;if(x!==void 0){const _=y.subagentMeta.get(x),F=y.registrationOrderByKey.get(L),I=_?.backgroundTaskId!==void 0?y.registrationOrderByKey.get(_.backgroundTaskId):void 0;if(y.retiredBindings.has(L)||F!==void 0&&I!==void 0&&FI.backgroundTaskId===L);if(_===void 0&&(y.retiredBindings.has(L)||y.registrationOrderByKey.has(L)&&y.registrationOrderByKey.get(L)0&&y.settledByKernel.add(A.agentId),v.push({type:"taskCompleted",sessionId:m,taskId:typeof A.taskId=="string"?A.taskId:typeof A.taskId=="number"?String(A.taskId):"",status:A.status==="killed"?"cancelled":M?"failed":"completed"});break}}return v}return{project:c,bindNextPromptId:u,reset:s,forgetSession:r,markSideChannelAgent:l,hasSessionState:a}}function exe(e){return new B7e({origin:e.origin,identity:e.identity,tracer:e.tracer,credentialStore:e.credentialStore,projectorFactory:()=>X7e({t:e.t}),mainAgentOnly:e.mainAgentOnly})}const txe={t:e=>e},rO="Sub Agent";function nxe(){return{sessions:[],activeSessionId:void 0,approvalsBySession:{},planReviewByToolCallId:{},questionsBySession:{},tasksBySession:{},goalBySession:{},goalVersionBySession:{},lastSeqBySession:{},turnActiveBySession:{},turnErrorBySession:{},turnRetryBySession:{},compactionBySession:{},warnings:[]}}function ixe(e){return{...e,sessions:e.sessions,approvalsBySession:{...e.approvalsBySession},planReviewByToolCallId:{...e.planReviewByToolCallId},questionsBySession:{...e.questionsBySession},tasksBySession:{...e.tasksBySession},goalBySession:{...e.goalBySession},goalVersionBySession:{...e.goalVersionBySession},lastSeqBySession:{...e.lastSeqBySession},turnActiveBySession:{...e.turnActiveBySession},turnErrorBySession:{...e.turnErrorBySession},turnRetryBySession:{...e.turnRetryBySession},compactionBySession:{...e.compactionBySession},warnings:[...e.warnings]}}function oxe(e,t,n){if(t!==void 0&&n!==void 0&&n>0){const i=e.lastSeqBySession[t]??0;n>i&&(e.lastSeqBySession[t]=n)}}function B9(e,t){const n=e.sessions.find(i=>i.id===t.sessionId)?.lastSeq??0;return t.seq>Math.max(e.lastSeqBySession[t.sessionId]??0,n)}const sxe={"provider.connection_error":"connection","provider.auth_error":"auth","provider.rate_limit":"rateLimit","provider.overloaded":"overloaded","provider.filtered":"filtered","provider.api_error":"api","context.overflow":"contextOverflow"};function g7(e,t){const n=[],i=(r,a)=>{typeof a=="number"||typeof a=="boolean"?n.push({label:r,value:String(a)}):typeof a=="string"&&a.length>0&&n.push({label:r,value:a})};i(t("warnings.details.code"),e.code);const o=e.details??{};i(t("warnings.details.status"),o.statusCode),i(t("warnings.details.requestId"),o.requestId),i(t("warnings.details.errorName"),e.name);for(const[r,a]of Object.entries(o))r==="statusCode"||r==="requestId"||i(r,a);const s=(e.code!==void 0?sxe[e.code]:void 0)??"title";return{severity:"error",title:t(`warnings.agentError.${s}`),message:e.message,details:n.length>0?n:void 0}}function rxe(e,t,n,i=txe){const o=ixe(e);switch(oxe(o,n.sessionId,n.seq),t.type){case"sessionCreated":{o.sessions.some(r=>r.id===t.session.id)||(o.sessions=[t.session,...o.sessions]);break}case"sessionUpdated":{o.sessions=o.sessions.map(s=>s.id===t.session.id?{...t.session,pullRequest:s.pullRequest}:s);break}case"sessionDeleted":{const s=t.sessionId;o.sessions=o.sessions.filter(r=>r.id!==s),delete o.tasksBySession[s],delete o.goalBySession[s],delete o.goalVersionBySession[s],delete o.approvalsBySession[s],delete o.questionsBySession[s],delete o.lastSeqBySession[s],delete o.turnActiveBySession[s],delete o.turnErrorBySession[s],delete o.turnRetryBySession[s],o.activeSessionId===s&&(o.activeSessionId=void 0);break}case"sessionWorkChanged":{if(!B9(e,n))break;let s;o.sessions=o.sessions.map(r=>r.id!==t.sessionId?r:(s=t.pendingInteraction??(t.busy?r.pendingInteraction:"none"),{...r,busy:t.busy,mainTurnActive:t.mainTurnActive??(t.busy?r.mainTurnActive:!1),pendingInteraction:s,lastTurnReason:t.lastTurnReason})),s==="none"?(delete o.approvalsBySession[t.sessionId],delete o.questionsBySession[t.sessionId]):s==="question"&&delete o.approvalsBySession[t.sessionId],t.mainTurnActive===!0?o.turnActiveBySession[t.sessionId]=!0:(t.mainTurnActive===!1||!t.busy)&&(delete o.turnActiveBySession[t.sessionId],delete o.turnRetryBySession[t.sessionId]);break}case"sessionMetaUpdated":{o.sessions=o.sessions.map(s=>s.id===t.sessionId?{...s,title:t.title??s.title,lastPrompt:t.lastPrompt??s.lastPrompt}:s);break}case"sessionUsageUpdated":{o.sessions=o.sessions.map(s=>{if(s.id!==t.sessionId)return s;const r=t.model&&t.model.length>0?t.model:s.model;return{...s,usage:t.usage,model:r}});break}case"historyCompacted":break;case"compactionStarted":{o.compactionBySession={...o.compactionBySession,[t.sessionId]:{status:"running",trigger:t.trigger}};break}case"compactionCompleted":{const s=t.sessionId,{[s]:r,...a}=o.compactionBySession;o.compactionBySession=a;break}case"compactionCancelled":{const{[t.sessionId]:s,...r}=o.compactionBySession;o.compactionBySession=r;break}case"messageCreated":case"messageUpdated":case"assistantDelta":case"toolOutput":break;case"approvalRequested":{const s=t.sessionId,r=o.approvalsBySession[s]??[];r.some(u=>u.approvalId===t.approval.approvalId)||(o.approvalsBySession[s]=[...r,t.approval]);const l=t.approval.display;l?.kind==="plan_review"&&typeof l.plan=="string"&&l.plan.length>0&&(o.planReviewByToolCallId={...o.planReviewByToolCallId,[t.approval.toolCallId]:{plan:l.plan,path:typeof l.path=="string"?l.path:void 0}});break}case"approvalResolved":case"approvalExpired":{const s=t.sessionId,r=t.approvalId,a=o.approvalsBySession[s]??[];o.approvalsBySession[s]=a.filter(l=>l.approvalId!==r);break}case"questionRequested":{const s=t.sessionId,r=o.questionsBySession[s]??[];r.some(l=>l.questionId===t.question.questionId)||(o.questionsBySession[s]=[...r,t.question]);break}case"questionAnswered":case"questionDismissed":{const s=t.sessionId,r=t.questionId,a=o.questionsBySession[s]??[];o.questionsBySession[s]=a.filter(l=>l.questionId!==r);break}case"taskCreated":{const s=t.sessionId,r=o.tasksBySession[s]??[],a=r.findIndex(f=>f.id===t.task.id),l=t.task.backgroundTaskId===void 0?-1:r.findIndex(f=>f.id===t.task.backgroundTaskId),u=l!==-1&&a!==-1&&l!==a?r[l]:void 0,c=u!==void 0?r.filter((f,h)=>h!==l):r,d=c.findIndex(f=>f.id===t.task.id||t.task.backgroundTaskId!==void 0&&f.id===t.task.backgroundTaskId);if(d===-1)o.tasksBySession[s]=[...c,t.task];else{const f=[...c],h=c[d],m=t.task.backgroundTaskId!==void 0&&(t.task.backgroundTaskId===h.backgroundTaskId||h.id===t.task.backgroundTaskId)||h.id===t.task.id&&(h.kind!=="subagent"||h.agentId===void 0),g=(m&&h.status!=="running"?h:void 0)??(u!==void 0&&u.status!=="running"?u:void 0),y=g!==void 0&&(t.task.status==="running"||t.task.status!==g.status),b=!m&&h.status!=="running"||t.task.backgroundTaskId!==void 0&&h.backgroundTaskId!==void 0&&t.task.backgroundTaskId!==h.backgroundTaskId,v=m&&h.completedAt!==void 0&&h.completedAtEstimated!==!0;f[d]={...t.task,status:y?g.status:t.task.status,subagentPhase:y?g.subagentPhase:t.task.subagentPhase,completedAt:y?g.completedAt:v?h.completedAt:t.task.completedAt,completedAtEstimated:y?g.completedAtEstimated:v?h.completedAtEstimated:t.task.completedAtEstimated,outputLines:y?g.outputLines:b?u?.outputLines??t.task.outputLines:h.outputLines??u?.outputLines??t.task.outputLines,text:y?g.text:b?u?.text??t.task.text:h.text??u?.text??t.task.text,outputPreview:y?g.outputPreview:t.task.outputPreview??(b?u?.outputPreview:h.outputPreview??u?.outputPreview),outputBytes:y?g.outputBytes:t.task.outputBytes??(b?u?.outputBytes:h.outputBytes??u?.outputBytes),description:t.task.description===rO&&h.description!==rO?h.description:t.task.description,swarmIndex:t.task.swarmIndex??h.swarmIndex,parentToolCallId:t.task.parentToolCallId??h.parentToolCallId,subagentType:t.task.subagentType??h.subagentType,model:t.task.model??h.model,thinkingEffort:t.task.thinkingEffort??h.thinkingEffort,runInBackground:b?t.task.runInBackground:t.task.runInBackground??h.runInBackground,backgroundTaskId:b?t.task.backgroundTaskId:t.task.backgroundTaskId??h.backgroundTaskId,agentId:t.task.agentId??h.agentId},o.tasksBySession[s]=f}break}case"taskProgress":{const s=t.sessionId,r=o.tasksBySession[s]??[];o.tasksBySession[s]=r.map(a=>{if(a.id!==t.taskId||a.status==="completed"||a.status==="failed"||a.status==="cancelled")return a;if(a.kind==="subagent"&&t.kind==="text")return{...a,text:(a.text??"")+t.outputChunk};const l=a.outputLines??[];if(t.replace===!0){const c=l.length>0?[...l.slice(0,-1),t.outputChunk]:[t.outputChunk];return{...a,outputLines:c}}if(l.at(-1)===t.outputChunk)return a;const u=[...l,t.outputChunk];return{...a,outputLines:a.kind==="subagent"?u:u.slice(-40)}});break}case"taskCompleted":{const s=t.sessionId,r=o.tasksBySession[s]??[];o.tasksBySession[s]=r.map(a=>a.id!==t.taskId&&a.backgroundTaskId!==t.taskId||t.status==="completed"&&(a.status==="cancelled"||a.status==="failed")||t.status==="failed"&&a.status==="cancelled"?a:{...a,status:t.status,completedAt:a.completedAt??new Date().toISOString(),completedAtEstimated:a.completedAt===void 0?!0:a.completedAtEstimated,outputPreview:t.outputPreview??a.outputPreview,outputBytes:t.outputBytes??a.outputBytes});break}case"goalUpdated":{const s=t.sessionId;o.goalVersionBySession[s]=(o.goalVersionBySession[s]??0)+1,t.goal===null||t.goal.status==="complete"?delete o.goalBySession[s]:o.goalBySession[s]=t.goal;break}case"configChanged":{o.config=t.config;break}case"modelCatalogChanged":break;case"agentDelta":case"agentTurnEnded":break;case"promptCompleted":case"promptAborted":break;case"turnActiveChanged":{if(!B9(e,n))break;if(o.sessions=o.sessions.map(s=>s.id===t.sessionId?{...s,mainTurnActive:t.active}:s),t.active)o.turnActiveBySession[t.sessionId]=!0,delete o.turnErrorBySession[t.sessionId],delete o.turnRetryBySession[t.sessionId];else{delete o.turnActiveBySession[t.sessionId],delete o.turnRetryBySession[t.sessionId];const s=t.reason===void 0||t.reason==="completed"?"completed":"failed",r=o.tasksBySession[t.sessionId];r!==void 0&&(o.tasksBySession[t.sessionId]=r.map(a=>a.kind!=="subagent"||a.status!=="running"||a.runInBackground===!0?a:{...a,status:s,subagentPhase:s,completedAt:a.completedAt??new Date().toISOString(),completedAtEstimated:a.completedAt===void 0?!0:a.completedAtEstimated,suspendedReason:void 0}))}break}case"turnRetry":{if(!B9(e,n))break;t.retry===void 0?delete o.turnRetryBySession[t.sessionId]:o.turnRetryBySession[t.sessionId]=t.retry;break}case"unknown":{const s=t.raw;if(!(s&&s._noop===!0))if(s&&s._agentError){if(B9(e,n)){if(n.sessionId!==void 0){const r=s.details??{};o.turnErrorBySession[n.sessionId]={code:s.code,message:s.message,name:s.name,retryable:s.retryable,statusCode:typeof r.statusCode=="number"?r.statusCode:void 0,requestId:typeof r.requestId=="string"?r.requestId:void 0}}(n.sessionId===void 0||n.sessionId!==e.activeSessionId)&&(o.warnings=[...o.warnings,g7(s,i.t)])}}else if(s&&s._agentWarning){const r=s.message??s.code??i.t("warnings.agentWarningFallback");o.warnings=[...o.warnings,`${i.t("warnings.noteLabel")}: ${r}`]}else{const r=s?.type??"(unknown)";o.warnings=[...o.warnings,i.t("warnings.unhandledEvent",{type:r})]}break}}return o}function axe(e,t){if(e===t)return!0;const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(const o of n)if(e[o]!==t[o])return!1;return!0}function lxe(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n]*)>([\s\S]*?)<\/notification>/g,cxe=/([\w-]+)="([^"]*)"/g,dxe=/]*)>[\s\S]*?<\/output-file>/,fxe=/]*)>([\s\S]*?)<\/output-preview>/,hxe=/^Title: (.*)$/m,pxe=/^Severity: (.*)$/m;function Hk(e){return e.replaceAll(""",'"').replaceAll("<","<").replaceAll(">",">").replaceAll("&","&")}function J5(e){const t={};for(const n of e.matchAll(cxe))n[1]!==void 0&&n[2]!==void 0&&(t[n[1]]=Hk(n[2]));return t}function mxe(e,t,n){const i=J5(e),o=hxe.exec(t)?.[1]?.trim()??"",s=pxe.exec(t)?.[1]?.trim()??"";let r=t.split(` +`).filter(f=>!f.startsWith("Title: ")&&!f.startsWith("Severity: ")).join(` +`);const a=r.search(/^<\w/m);a!==-1&&(r=r.slice(0,a)),r=r.trim();const l=dxe.exec(t),u=l?(()=>{const f=J5(l[1]??""),h=Number(f.bytes);return f.path!==void 0&&f.path!==""?{path:f.path,bytes:Number.isFinite(h)?h:void 0}:void 0})():void 0,c=fxe.exec(t),d=c?(()=>{const f=J5(c[1]??""),h=(c[2]??"").replace(/^\n/,""),m=h.indexOf(` +`),g=Hk(m===-1?"":h.slice(m+1)).replace(/\n$/,""),y=Number(f.bytes),b=Number(f.total_bytes);return{text:g,bytes:Number.isFinite(y)?y:void 0,totalBytes:Number.isFinite(b)?b:void 0,truncated:f.truncated==="true"?!0:f.truncated==="false"?!1:void 0}})():void 0;return{id:i.id??"",category:i.category??"",type:i.type??"",sourceKind:i.source_kind??"",sourceId:i.source_id??"",agentId:i.agent_id,title:Hk(o),severity:s,body:Hk(r),outputFile:u,outputPreview:d,raw:n}}function gxe(e){if(!e.includes("(/^Background (process|agent)$/.test(u.description)&&(u={...u,description:""}),u),r=bxe.exec(n);if(r?.[1]!==void 0&&r[2]!==void 0)return s({status:r[2]==="timed out"?"timed_out":r[2],description:r[1],reason:r[3],rest:o});const a=wxe.exec(n);if(a?.[1]!==void 0)return s({status:"killed",description:a[1],userStopped:a[2]!==void 0,reason:a[3],rest:o});const l=Axe.exec(n);if(l?.[1]!==void 0&&l[2]!==void 0)return s({status:l[2]==="was killed"?"killed":l[2]==="timed out"?"timed_out":l[2],description:l[1],reason:l[3],rest:o})}function xxe(e){if(!DK(e.title))return;const t=Cxe(e.body);if(!(t===void 0||t.status!==x4(e)))return t}const Sxe=1e6,aO=5e3;function Dc(e){return e===""?[]:e.endsWith(` +`)?e.slice(0,-1).split(` +`):e.split(` +`)}const OK="\0";function lO(e){return e===""||e.endsWith(` +`)?e:`${e}${OK}`}function PK(e,t){const n=S4(lO(e),lO(t));return n===null?null:n.map(i=>i.text.endsWith(OK)?{...i,text:i.text.slice(0,-1)}:i)}function S4(e,t){const n=Dc(e),i=Dc(t),o=n.length,s=i.length;if(o===0&&s===0)return[];if(o>aO||s>aO||(o+1)*(s+1)>Sxe)return null;const r=Array.from({length:o+1},()=>Array.from({length:s+1},()=>0));for(let h=1;h<=o;h++)for(let m=1;m<=s;m++)r[h][m]=n[h-1]===i[m-1]?r[h-1][m-1]+1:Math.max(r[h-1][m],r[h][m-1]);const a=[];let l=o,u=s;for(;l>0||u>0;)l>0&&u>0&&n[l-1]===i[u-1]?(a.push({type:"context",text:n[l-1]}),l--,u--):u>0&&(l===0||r[l][u-1]>=r[l-1][u])?(a.push({type:"add",text:i[u-1]}),u--):(a.push({type:"del",text:n[l-1]}),l--);a.reverse();const c=[];let d=1,f=1;for(const h of a)h.type==="context"?(c.push({type:"context",text:h.text,oldNo:d,newNo:f}),d++,f++):h.type==="add"?(c.push({type:"add",text:h.text,newNo:f}),f++):(c.push({type:"del",text:h.text,oldNo:d}),d++);return c}const uO=500;function cO(e,t){const n=[],i=Dc(e),o=Dc(t),s=Math.min(i.length,uO),r=Math.min(o.length,uO);for(let a=1;a<=s;a++)n.push({type:"del",text:i[a-1],oldNo:a});i.length>s&&n.push({type:"context",text:`… ${i.length-s} more lines …`});for(let a=1;a<=r;a++)n.push({type:"add",text:o[a-1],newNo:a});return o.length>r&&n.push({type:"context",text:`… ${o.length-r} more lines …`}),n}function _xe(e){let t=0,n=0;for(const i of e)i.type==="add"?t++:i.type==="del"&&n++;return{added:t,removed:n}}function Ad(e){const t=e;return t?.kind!=="user"||!Array.isArray(t.skillActivations)?[]:t.skillActivations.flatMap(n=>{if(typeof n!="object"||n===null)return[];const i=n;return typeof i.skillName!="string"?[]:[{name:i.skillName,...typeof i.skillArgs=="string"?{args:i.skillArgs}:{}}]})}function Ixe(e){return{content:e.content,skillActivations:Ad(e.metadata?.origin)}}function Rv(e,t){return e.length===t.length&&e.every((n,i)=>{const o=t[i];return o!==void 0&&n.name===o.name&&n.args===o.args})}const Mxe=/^read[_-]?media(?:file)?$/i,Txe=/^data:([^;]+);base64,(.*)$/s,Exe=/^<(image|video|audio)\s+path="([^"]+)">$/,Lxe=/^<(image|video|audio)\s+path="([^"]+)">(?:<\/\1>)?$/,Nxe=/Mime type:\s*([^.\s]+)/i,Fxe=/Size:\s*(\d+)\s*bytes/i,Rxe=/Original dimensions:\s*(\d+)x(\d+)\s*pixels/i,Dxe="Image compressed to fit model limits:",Oxe=/Image compressed to fit model limits:[\s\S]*?<\/system>/g;function dO(e){return e.includes(Dxe)?e.replace(Oxe,""):e}function Pxe(e){return e.replaceAll(""",'"').replaceAll("<","<").replaceAll(">",">").replaceAll("&","&")}function fO(e){const t=Lxe.exec(e.trim());return t?{kind:t[1],path:Pxe(t[2])}:null}const BK=/^f_(?:[0-9A-Za-z]{26}|[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12})$/,Bxe=/f_(?:[0-9A-Za-z]{26}|[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12})$/;function v7(e){const t=e.split(/[\\/]/).at(-1)??"",n=t.lastIndexOf("."),i=n>0?t.slice(0,n):t;return BK.test(i)?i:void 0}const gd='Attached file "',$K=" — open it with the Read tool";function $xe(e,t,n,i){const o=`-${e}`,s=i.endsWith(o)?i.slice(0,-o.length):i,r=Bxe.exec(s)?.[0];return{name:e,mediaType:t,size:Number(n),fileId:r!==void 0&&BK.test(r)?r:void 0}}const zK="attachmentRecords",zxe=65536;function jxe(e,t,n){const i=t+gd.length,o=e.slice(i,n),s=o.indexOf('" (');if(s<=0)return!1;const r=o.indexOf(", ",s+3);if(r<=s+3)return!1;let a=i+r+2;if(a>=n||e.charCodeAt(a)<48||e.charCodeAt(a)>57)return!1;for(;a=48&&e.charCodeAt(a)<=57;)a++;return e.startsWith(" bytes): ",a)}function Hxe(e,t,n){let i=e.indexOf(gd,t);for(;i>=0&&i=n?n:s;if(jxe(e,i,r))return i;if(s<0||s>=n)return-1;i=s}return-1}function Wxe(e,t){const n=t+gd.length,i=Math.min(e.length,n+zxe),o=e.slice(n,i),s=o.indexOf('" (');if(s<=0)return null;const r=n+s,a=o.indexOf(", ",s+3);if(a<=s+3)return null;const l=n+a+2;let u=l;for(;u=48&&e.charCodeAt(u)<=57;)u++;if(u===l||!e.startsWith(" bytes): ",u))return null;const c=e.slice(l,u),d=u+9,f=Hxe(e,r,i),h=f>=0?Math.min(f,i):i,m=e.slice(d,h),g=o.slice(0,s),y=`-${g}${$K}`;let b=m.lastIndexOf(y);for(;b>=0;){const w=m.slice(0,b),A=Math.max(w.lastIndexOf("/"),w.lastIndexOf("\\"));if(!/\s/.test(w.slice(A+1)))break;b=m.lastIndexOf(y,b-1)}if(b<0)return null;const v=m.slice(0,b+1+g.length);return{start:t,end:d+b+y.length,info:$xe(g,o.slice(s+3,a),c,v)}}function U_(e){if(!e.includes($K))return[];const t=[];let n=e.indexOf(gd);for(;n>=0;){const i=Wxe(e,n);n=i?e.indexOf(gd,i.end):e.indexOf(gd,n+gd.length),i&&t.push(i)}return t}function hO(e){const t=U_(e);if(t.length===0)return e;let n="",i=0;for(const o of t)n+=e.slice(i,o.start),i=o.end;return n+e.slice(i)}function qxe(e){const t=[];for(const o of e.content)o.type==="file"&&t.push({fileId:o.fileId,name:o.name});const n=[...t],i=e.metadata?.[zK];if(Array.isArray(i))for(const o of i){if(typeof o!="object"||o===null)continue;const s=o.fileId,r=o.name,a={fileId:typeof s=="string"&&s.length>0?s:void 0,name:typeof r=="string"&&r.length>0?r:void 0},l=n.findIndex(u=>a.fileId!==void 0?u.fileId===a.fileId:u.fileId===void 0&&u.name===a.name);l>=0?n.splice(l,1):t.push(a)}return t.length>0?t:null}function Uxe(e){const t=qxe(e);if(t)return{kind:"paired",records:t};let n=0;for(const s of e.content)if(s.type==="text")for(const r of y7(s.text))n=Math.max(n,r);const i=e.metadata?.origin;for(const s of[i?.skillArgs,i?.commandArgs])if(typeof s=="string")for(const r of y7(s))n=Math.max(n,r);if(n===0)return{kind:"legacy"};let o=0;for(const s of e.content)s.type==="text"&&(o+=U_(s.text).length);return{kind:"pill",keepLast:n,total:o}}function Vxe(e){let t=0;const n=e.kind==="pill"?Math.max(0,e.total-e.keepLast):0;return i=>{const o=U_(i);if(o.length===0)return{notices:[],text:i};const s=[];for(const l of o){const u=t++;if(e.kind==="legacy")s.push(l);else if(e.kind==="pill")u>=n&&s.push(l);else{const c=l.info.fileId,d=e.records.findIndex(f=>c!==void 0?f.fileId===c:f.fileId===void 0&&f.name===l.info.name);d>=0&&(e.records.splice(d,1),s.push(l))}}if(s.length===0)return{notices:[],text:i};let r="",a=0;for(const l of s)r+=i.slice(a,l.start),a=l.end;return{notices:s.map(l=>l.info),text:r+i.slice(a)}}}const Kxe=/(?=0&&e[i]==="\\";)n+=1,i-=1;return n%2===1}function jK(e){let t="",n=0,i=0;for(;i0?t:void 0}return[JSON.stringify(e)]}}function tSe(e,t){if(Sr(e)==="task")for(const n of t??[]){const i=/^agent_id:\s*(\S+)\s*$/.exec(n);if(i?.[1])return i[1]}}function nSe(e,t){return{id:e.agentId??e.id,toolCallId:e.parentToolCallId,name:e.description,kind:e.kind,subagentType:e.subagentType,prompt:e.command??t,model:e.model,thinkingEffort:e.thinkingEffort,phase:e.status==="completed"?"completed":e.status==="failed"?"failed":e.status==="cancelled"?"cancelled":e.subagentPhase??"working",status:e.status,summary:e.outputPreview,outputLines:e.outputLines,text:e.text,suspendedReason:e.suspendedReason,swarmIndex:e.swarmIndex}}function HK(e){const t=e.display??{},n=typeof t.kind=="string"?t.kind:"";if(n==="diff"){const i=typeof t.path=="string"?t.path:"";if(Array.isArray(t.diff))return{kind:"diff",path:i,diff:t.diff};const o=typeof t.old_text=="string"?t.old_text:typeof t.before=="string"?t.before:void 0,s=typeof t.new_text=="string"?t.new_text:typeof t.after=="string"?t.after:void 0;if(o!==void 0&&s!==void 0){const r=PK(o,s)??cO(o,s);return{kind:"diff",path:i,diff:r}}return{kind:"diff",path:i,diff:[]}}if(n==="file_io"){const i=typeof t.path=="string"?t.path:"",o=typeof t.operation=="string"?t.operation:"";if(o==="write"&&typeof t.content=="string")return{kind:"file",path:i,content:t.content};if(o==="edit"&&typeof t.before=="string"&&typeof t.after=="string"){const r=S4(t.before,t.after)??cO(t.before,t.after);return{kind:"diff",path:i,diff:r}}const s=typeof t.detail=="string"?t.detail:void 0;return{kind:"fileop",op:o||n,path:i,detail:s}}if(n==="shell"||n==="command"){const i=typeof t.command=="string"?t.command:e.action;return{kind:"shell",command:i,cwd:typeof t.cwd=="string"?t.cwd:void 0,danger:typeof t.danger=="string"?t.danger:$ce(i)}}if(n==="file_content"||n==="file")return{kind:"file",path:typeof t.path=="string"?t.path:"",content:typeof t.content=="string"?t.content:"",language:typeof t.language=="string"?t.language:void 0};if(n==="file_op"||n==="fileop")return{kind:"fileop",op:typeof t.operation=="string"?t.operation:typeof t.op=="string"?t.op:n,path:typeof t.path=="string"?t.path:"",detail:typeof t.detail=="string"?t.detail:void 0};if(n==="url_fetch"||n==="url")return{kind:"url",method:typeof t.method=="string"?t.method:void 0,url:typeof t.url=="string"?t.url:e.action};if(n==="search")return{kind:"search",query:typeof t.query=="string"?t.query:e.action,scope:typeof t.scope=="string"?t.scope:void 0};if(n==="invocation"||n==="agent_call"||n==="skill_call")return{kind:"invocation",kind2:typeof t.kind=="string"?t.kind:n,name:typeof t.name=="string"?t.name:e.toolName,description:typeof t.description=="string"?t.description:void 0};if(n==="todo"||n==="todo_list")return{kind:"todo",items:(Array.isArray(t.items)?t.items:[]).map(s=>{const r=s??{};return{title:typeof r.title=="string"?r.title:"",status:typeof r.status=="string"?r.status:"pending"}})};if(n==="plan_review"){const i=typeof t.plan=="string"?t.plan:"",o=typeof t.path=="string"?t.path:void 0,r=(Array.isArray(t.options)?t.options:[]).map(a=>{const l=a??{},u=typeof l.label=="string"?l.label:"";if(!u)return null;const c=typeof l.description=="string"?l.description:void 0;return{label:u,description:c}}).filter(a=>a!==null);return{kind:"plan_review",plan:i,path:o,options:r.length>0?r:void 0}}return{kind:"generic",summary:e.action}}function WK(e){const t=` +`,n=` +`,i=e.indexOf(t),o=e.lastIndexOf(n);return i>=0&&o>=i+t.length?e.slice(i+t.length,o):iSe(e)}function iSe(e){const t=e.split(` +`);return t.length>=2&&t[0]?.startsWith(""?t.slice(1,-1).join(` +`):e}function oSe(e){const t=e.metadata?.origin;if(t?.kind==="cron_job"||t?.kind==="cron_missed")return t.kind}function sSe(e){const t=e.content.filter(n=>n.type==="text").map(n=>n.text).join(` +`);return WK(t)}function rSe(e,t){const n=e.metadata?.origin??{},i=sSe(e);return t==="cron_missed"?{text:i,cron:{missedCount:typeof n.count=="number"?n.count:void 0}}:{text:i,cron:{jobId:typeof n.jobId=="string"?n.jobId:void 0,cron:typeof n.cron=="string"?n.cron:void 0,recurring:typeof n.recurring=="boolean"?n.recurring:void 0,coalescedCount:typeof n.coalescedCount=="number"?n.coalescedCount:void 0,stale:typeof n.stale=="boolean"?n.stale:void 0}}}function aSe(e,t,n){const{text:i,cron:o}=rSe(e,n);return{id:e.id,role:"cron",no:t,text:i,createdAt:e.createdAt,cron:o}}function lSe(e){const t=e.metadata?.origin,n=t?.kind;return n===void 0||n==="user"?!0:n==="skill_activation"||n==="plugin_command"?t?.trigger==="user-slash":!1}function uSe(e){const t=e.metadata?.["kimiWeb.steeredPromptIds"];if(Array.isArray(t)){const i=t.filter(o=>typeof o=="string"&&o.length>0);if(i.length>0)return i}if(e.promptId!==void 0&&e.promptId.length>0)return[e.promptId];const n=e.metadata?.["kimiWeb.promptId"];if(typeof n=="string"&&n.length>0)return[n]}function cSe(e){return e.metadata?.origin?.kind==="compaction_summary"}function dSe(e,t){return e===null?!1:e.promptId===void 0||t===void 0||e.promptId===t}function fSe(e){if(!e||e.length===0)return;const t="Plan saved to: ";for(const n of e)if(n.startsWith(t))return n.slice(t.length).trim()}function hSe(e){const t=[];for(const n of e){const i=t.at(-1);n.type==="text"&&i?.type==="text"?i.text+=n.text:n.type==="thinking"&&i?.type==="thinking"?i.thinking+=n.thinking:n.type==="thinking"?t.push({type:"thinking",thinking:n.thinking}):t.push({...n})}return JSON.stringify(t)}function u3(e,t,n,i=!0,o={},s={},r){const a=[];let l=r?.startNo??1;const u=r?.collect,c=new Map;for(const g of t)c.set(g.toolCallId,g);let d=null;function f(g=!1){if(!d)return;const y=d;if(d=null,!g&&y.blocks.length===0&&y.textParts.length===0&&y.thinkingParts.length===0&&y.tools.length===0)return;if(!g||!i)for(let w=0;wE.kind==="tool"&&E.tool.id===M.id);L&&L.kind==="tool"&&(L.tool=M)}const b=y.sources.find(w=>w.daemonTurnId!==void 0),v={id:y.id,sessionId:y.sources.find(w=>w.sessionId)?.sessionId||void 0,role:"assistant",no:l++,text:y.textParts.join(` +`),thinking:y.thinkingParts.length>0?y.thinkingParts.join(` +`):void 0,tools:y.tools.length>0?y.tools:void 0,blocks:y.blocks.length>0?y.blocks:void 0,approval:y.approval,approvalId:y.approvalId,durationMs:y.durationMs,createdAt:y.createdAt,endedAt:y.endedAt,goalContinuation:y.goalContinuation,daemonTurnId:b?.daemonTurnId,daemonTurnState:b?.daemonTurnState};a.push(v),u?.(v,y.sources)}function h(g,y){let b=null;for(const v of y)if(v.type==="text"){if(v.text){b==="text"?g.textParts[g.textParts.length-1]+=v.text:g.textParts.push(v.text);const w=g.blocks.at(-1);w&&w.kind==="text"?w.text+=(b==="text"?"":` +`)+v.text:g.blocks.push({kind:"text",text:v.text}),b="text"}}else if(v.type==="thinking"){if(v.thinking){b==="thinking"?g.thinkingParts[g.thinkingParts.length-1]+=v.thinking:g.thinkingParts.push(v.thinking);const w=g.blocks.at(-1);if(w&&w.kind==="thinking"){w.thinking+=(b==="thinking"?"":` +`)+v.thinking;const A=[w.startedAt,v.startedAt].filter(E=>E!==void 0).sort()[0],M=w.startedAt!==void 0&&w.durationMs===void 0||v.startedAt!==void 0&&v.durationMs===void 0,L=[w,v].flatMap(E=>E.startedAt!==void 0&&E.durationMs!==void 0?[Date.parse(E.startedAt)+E.durationMs]:[]);w.startedAt=A,w.durationMs=!M&&A!==void 0&&L.length>0?Math.max(...L)-Date.parse(A):void 0}else g.blocks.push({kind:"thinking",thinking:v.thinking,startedAt:v.startedAt,durationMs:v.durationMs});b="thinking"}}else if(v.type==="toolUse"){b=null;const w=c.get(v.toolCallId),A=v.toolName==="ExitPlanMode"?s[v.toolCallId]:void 0,M={id:v.toolCallId,name:v.toolName,arg:typeof v.input=="string"?v.input:JSON.stringify(v.input),agentId:Sr(v.toolName)==="task"?v.agentRefs?.find(L=>L.role!=="member")?.agentId??v.agentRefs?.[0]?.agentId:void 0,status:"running",output:v.outputLines,plan:A,planPath:v.toolName==="ExitPlanMode"?A?.path??o[v.toolCallId]?.path:void 0};g.tools.push(M),g.blocks.push({kind:"tool",tool:M}),w&&(g.approval=HK(w),g.approvalId=w.approvalId)}else if(v.type==="toolResult"){b=null;const w=g.tools.findIndex(A=>A.id===v.toolCallId);if(w!==-1){const A=g.tools[w],M=V_(v.output),L={...A,status:v.isError?"error":"ok",output:M,media:v.isError?void 0:eSe(A.name,v.output),agentId:A.agentId??tSe(A.name,M)};L.name==="ExitPlanMode"&&!L.planPath&&(L.planPath=fSe(L.output)),g.tools[w]=L;const E=g.blocks.find(C=>C.kind==="tool"&&C.tool.id===v.toolCallId);E&&E.kind==="tool"&&(E.tool=L)}}else b=null}function m(g,y){if(g.type==="image"||g.type==="video"){const b=g.type,v=g.source;if(v.kind==="url")return{url:v.url,kind:b,name:g.name};if(v.kind==="base64")return{url:`data:${v.mediaType};base64,${v.data}`,kind:b,name:g.name};if(v.kind==="file"&&n)return{url:n(v.fileId),kind:b,name:g.name,fileId:v.fileId};if(v.kind==="sessionMedia")return{url:r?.getSessionMediaUrl?.(y,v.fileId)??"",kind:b,name:g.name,fileId:v.fileId,sessionId:y}}if(g.type==="file"&&n){if(mS(g.mediaType))return{url:n(g.fileId),kind:"image",name:g.name,fileId:g.fileId};if(g.mediaType.startsWith("video/"))return{url:n(g.fileId),kind:"video",name:g.name,fileId:g.fileId}}}for(const g of e){if(g.role==="system")continue;if(cSe(g)){f();const A=g.metadata?.[ZH],M={id:g.id,role:"compaction",no:l,text:g.content.filter(L=>L.type==="text").map(L=>L.text).join(` +`),compaction:{trigger:A?.trigger,tokensBefore:A?.tokensBefore,tokensAfter:A?.tokensAfter}};a.push(M),u?.(M,[g]);continue}if(g.role==="user"){const A=oSe(g),M=g.metadata?.origin?.kind,L=M==="skill_activation"&&g.metadata?.origin?.trigger!=="user-slash";if(A===void 0&&(M==="injection"||L))continue;if(A===void 0&&(M==="task"||M==="background_task"||M==="task_notification")){const te=g.content.filter(ce=>ce.type==="text").map(ce=>ce.text).join(` +`),U=vxe(g.metadata),Y=U!==void 0?[U]:gxe(te);if(Y.length>0){d??={id:g.id,promptId:void 0,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,seenSigs:new Set,sources:[g],createdAt:g.createdAt};for(const ce of Y)d.blocks.push({kind:"notification",notification:{...ce,createdAt:g.createdAt}})}continue}if(f(),A!==void 0){const te=aSe(g,l++,A);a.push(te),u?.(te,[g]);continue}if(M==="system_trigger"&&g.metadata?.origin?.name==="goal_continuation"){d={id:g.id,promptId:void 0,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,seenSigs:new Set,sources:[g],createdAt:g.createdAt,goalContinuation:!0};continue}if(!lSe(g))continue;const E=g.metadata?.origin,C=E?.kind==="skill_activation"&&E?.trigger==="user-slash",x=E?.kind==="plugin_command"&&E?.trigger==="user-slash",_=Ixe(g),F=_.skillActivations,I=_.content,D=[];let H=[];const $=Vxe(Uxe(g)),T=new Set,R=te=>{const U={kind:"file",url:te.fileId&&n?n(te.fileId):"",fileId:te.fileId,name:te.name,mediaType:te.mediaType,size:te.size};H.push(U),T.add(U)};for(const te of I){if(te.type==="text")if(C){const Y=fO(te.text);if(Y&&(Y.kind==="video"||Y.kind==="image")&&n){const ce=v7(Y.path);if(ce){H.push({url:n(ce),kind:Y.kind,fileId:ce});continue}}for(const ce of $(te.text).notices)R(ce)}else if(x)D.push(E.commandArgs??"");else{const Y=fO(te.text);if(Y&&(Y.kind==="video"||Y.kind==="image")&&n){const ge=v7(Y.path);if(ge){H.push({url:n(ge),kind:Y.kind,fileId:ge});continue}}const ce=$(te.text);if(ce.notices.length>0){for(const oe of ce.notices)R(oe);if(ce.text.trim().length===0)continue;const ge=dO(ce.text);if(ge!==ce.text&&ge.trim().length===0)continue;D.push(ge);continue}const me=dO(te.text);if(me!==te.text&&me.trim().length===0)continue;D.push(me)}const U=m(te,g.sessionId);if(U){H.push({url:U.url,kind:U.kind,name:U.name,fileId:U.fileId,sessionId:U.sessionId});continue}te.type==="file"&&n&&H.push({kind:"file",url:n(te.fileId),fileId:te.fileId,name:te.name,mediaType:te.mediaType||void 0,size:te.size})}const P=new Map;for(const te of T){if(te.fileId===void 0)continue;const U=`${te.kind}|${te.fileId}`;P.set(U,(P.get(U)??0)+1)}H=H.filter(te=>{if(T.has(te)||te.fileId===void 0)return!0;const U=`${te.kind}|${te.fileId}`,Y=P.get(U)??0;return Y>0?(P.set(U,Y-1),!1):!0});const j=C?E?.skillArgs??"":D.join(` +`),B=y7(j),K=Qxe(j);let X=0;H=H.map(te=>te.kind!=="image"&&te.kind!=="video"?te:{kind:te.kind,url:te.url,mediaOrdinal:++X,...te.fileId===void 0?{}:{fileId:te.fileId},...te.sessionId===void 0?{}:{sessionId:te.sessionId},...te.name===void 0?{}:{name:te.name},...te.mediaType===void 0?{}:{mediaType:te.mediaType},...te.size===void 0?{}:{size:te.size}});const V=H.filter(te=>te.kind==="file"),Q=H.filter(te=>te.kind==="image"||te.kind==="video"),ie=[...B].some(te=>te<=V.length),ee=[...K].some(te=>te<=Q.length),Ce=ie||ee?H:[];let Z=0;const ae=H.filter(te=>te.kind==="file"?(Z+=1,!(ie&&B.has(Z))):(te.kind==="image"||te.kind==="video",!0)),he=g.metadata?.["kimiWeb.steeredPromptIds"],J={id:g.id,role:"user",no:l++,text:j,hasUndoAnchor:g.metadata?.["kimiWeb.settledWithoutEcho"]===!0||g.metadata?.["kimiWeb.steered"]===!0?!1:void 0,steered:g.metadata?.["kimiWeb.steered"]===!0||Array.isArray(he)&&he.length>0?!0:void 0,promptIds:uSe(g),attachments:ae.length>0?ae:void 0,inlineAttachments:Ce.length>0?Ce:void 0,skillActivation:C?{name:E.skillName,args:E.skillArgs}:void 0,skillActivations:F.length>0?F.map(te=>({name:te.name,args:te.args})):void 0,pluginCommand:x?{pluginId:E.pluginId,commandName:E.commandName,args:E.commandArgs}:void 0,createdAt:g.createdAt};a.push(J),u?.(J,[g]);continue}if(g.role==="tool"){d&&(d.sources.push(g),h(d,g.content),d.endedAt=g.createdAt);continue}const y=g.promptId;dSe(d,y)?d!==null&&d.promptId===void 0&&y!==void 0&&(d.promptId=y):(f(),d={id:g.id,promptId:y,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,seenSigs:new Set,sources:[],durationMs:g.durationMs,createdAt:g.createdAt});const v=d;if(v===null)continue;const w=hSe(g.content);v.promptId!==void 0&&v.seenSigs.has(w)||(v.seenSigs.add(w),v.sources.push(g),g.durationMs!==void 0&&(v.durationMs=g.durationMs),h(v,g.content),g.endedAt!==void 0?v.endedAt=g.endedAt:g.id!==v.id&&(v.endedAt=g.createdAt))}return f(!0),a}function qK(e,t,n){return e.state==="running"&&e.frames.at(-1)===t&&!n}function pSe(e,t){if(t.size===0)return;let n=!1;for(const a of t.values())if(a.settledAt===void 0){n=!0;break}if(!n)return;const i=new Date().toISOString(),o=e.items.findLast(a=>a.kind==="turn"&&a.state==="running"),s=o?.kind==="turn"?o.steps.findLast(a=>a.state==="running"):void 0,r=e.interactions.some(a=>a.state==="pending");for(const a of e.items)if(a.kind==="turn")for(const l of a.steps){const u=r&&l===s;for(const c of l.frames){if(c.kind!=="thinking")continue;const d=t.get(c.frameId);d===void 0||d.settledAt!==void 0||qK(l,c,u)||(d.settledAt=i)}}}function mSe(e,t){if(t.size===0)return;const n=new Set;for(const i of e.items)if(i.kind==="turn")for(const o of i.steps)for(const s of o.frames)s.kind==="thinking"&&n.add(s.frameId);for(const i of[...t.keys()])n.has(i)||t.delete(i)}function gSe(e,t,n,i){const o=e.items.filter(f=>f.kind==="turn"),s=o[0]?.turnId,r=o.length===1?s:void 0,a=new Map(e.tasks.map(f=>[f.taskId,f])),l=new Map(e.prompts.map(f=>[f.promptId,f])),u=VK(e.prompts,UK(e.items)),c=e.items.flatMap(f=>f.kind==="turn"?K_(f,e.attachments,a,f.turnId===s?n?.createdAt:void 0,f.turnId===r?n?.disposedAt:void 0,i?.sessionId,{promptById:l,promptForTurn:u}):[]),d=e.meta.activity==="turn";return u3(c,[],t,d,{},{},{getSessionMediaUrl:i?.getSessionMediaUrl}).map(wSe)}function pO(e){if(!Array.isArray(e))return[];const t=[];for(const n of e){if(typeof n!="object"||n===null)continue;const i=n;if(i.type!=="file")continue;const o=typeof i.fileId=="string"?i.fileId:i.file_id;t.push({fileId:typeof o=="string"?o:void 0,name:typeof i.name=="string"?i.name:void 0})}return t}function mO(e,t){return t.length===0?e:{...e,[zK]:t}}const vSe=new Set(["user","skill_activation","plugin_command"]);function ySe(e){return(e.origin.payload??e.origin)?.kind}function kSe(e){const t=e.content;if(!Array.isArray(t))return;const n=[];for(const i of t)if(typeof i=="object"&&i!==null&&i.type==="text"){const o=i.text;typeof o=="string"&&n.push(o)}return n.join("")}function UK(e){const t=new Set;for(const n of e)if(n.kind==="turn"){for(const i of n.steps)for(const o of i.frames)if(o.kind==="text")for(const s of o.promptIds??[])t.add(s)}return t}function VK(e,t){const n=new Set(t??[]);return i=>{const o=ySe(i);if(o!==void 0&&!vSe.has(o)||i.prompt===void 0&&(i.attachmentIds??[]).length===0)return;const s=hO(i.prompt??"");for(const r of e){if(n.has(r.promptId))continue;const a=kSe(r);if(a!==void 0&&hO(a)===s)return n.add(r.promptId),r}}}function K_(e,t,n,i,o,s="",r){const a=[],l=new Map(t.map(b=>[b.attachmentId,b])),u=k7([e.startedAt,...e.steps.map(b=>b.startedAt),i])??"",c=gO(e.endedAt)??gO(o),d=e.triggerPromptId??e.turnId,f=e.origin.payload??e.origin,h=(e.attachmentIds??[]).length>0,m=r?.includeOrigin===!0&&Ad(f).length>0;if(e.prompt!==void 0&&e.prompt.length>0||h||m){const b=e.prompt!==void 0&&e.prompt.length>0?[{type:"text",text:e.prompt}]:[];for(const v of e.attachmentIds??[]){const w=vO(l.get(v));w!==void 0&&b.push(w)}a.push({id:`${e.turnId}:input`,sessionId:s,role:"user",content:b,createdAt:u,promptId:d,metadata:mO(r?.includeOrigin===!0||e.origin.kind==="task"&&(e.prompt??"").includes("0;if(v.role==="user"){if(v.taskId!==void 0){if(v.text.length===0&&!w)continue;const _=bSe(v.taskId,v.text,n.get(v.taskId));a.push({id:v.frameId,sessionId:s,role:"user",content:[{type:"text",text:v.text}],createdAt:b.startedAt??u,promptId:d,metadata:{origin:{kind:"task",taskId:v.taskId},[RK]:_}});continue}const A=v.text.length>0?[{type:"text",text:v.text}]:[];for(const _ of v.attachmentIds??[]){const F=vO(l.get(_));F!==void 0&&A.push(F)}const M=v.promptIds?.map(_=>r?.promptById?.get(_)).find(_=>_!==void 0),L=[];for(const _ of v.promptIds??[])L.push(...pO(r?.promptById?.get(_)?.content));const E=v.origin,C=Ad(E);if(v.text.length===0&&!w&&C.length===0)continue;const x={...C.length>0?{origin:E}:{},...(v.promptIds?.length??0)>0?{"kimiWeb.steeredPromptIds":v.promptIds}:{}};a.push({id:v.frameId,sessionId:s,role:"user",content:A,createdAt:M?.createdAt??b.startedAt??u,promptId:d,metadata:mO(Object.keys(x).length>0?x:void 0,L)});continue}if(v.text.length===0&&!w)continue;a.push({id:v.frameId,sessionId:s,role:"assistant",content:[{type:"text",text:v.text}],createdAt:b.startedAt??u,promptId:d})}else if(v.kind==="thinking"){if(v.text.length===0)continue;const w=r?.pendingInteractionAtByStepId?.get(b.stepId),A=qK(b,v,w!==void 0),M=r?.thinkingTiming,L=M?.get(v.frameId);let E,C;if(L!==void 0)L.settledAt===void 0&&!A&&(L.settledAt=new Date().toISOString()),E=L.startedAt,C=X5(L.startedAt,L.settledAt);else if(M!==void 0&&A){const x=new Date().toISOString();M.set(v.frameId,{startedAt:x}),E=x}else E=b.startedAt,C=X5(b.startedAt,k7([b.endedAt,w]));a.push({id:v.frameId,sessionId:s,role:"assistant",content:[{type:"thinking",thinking:v.text,startedAt:E,durationMs:C}],createdAt:b.startedAt??u,promptId:d})}else v.kind==="tool"&&(a.push({id:`${v.frameId}:call`,sessionId:s,role:"assistant",content:[{type:"toolUse",toolCallId:v.toolCallId,toolName:v.name,input:v.input??v.display??{},outputLines:v.state==="running"?V_(v.output):void 0,agentRefs:v.agentRefs}],createdAt:b.startedAt??u,promptId:d}),v.state!=="running"&&a.push({id:`${v.frameId}:result`,sessionId:s,role:"tool",content:[{type:"toolResult",toolCallId:v.toolCallId,output:v.output??v.error??"",isError:v.state==="error"}],createdAt:b.endedAt??b.startedAt??u,promptId:d}));const g=e.durationMs??X5(u||void 0,c),y=a.findLastIndex(b=>b.role==="assistant");y>=0&&(g!==void 0||c!==void 0)&&(a[y]={...a[y],durationMs:g,endedAt:c??a[y].endedAt});for(const b of a)b.daemonTurnId=e.ordinal,b.daemonTurnState=e.state;return a}function bSe(e,t,n){const[i="",...o]=t.split(` +`),s=n?.state??"info";return{id:`task:${e}:${s}`,category:"task",type:`task.${s}`,sourceKind:n?.kind==="subagent"?"subagent":"background_task",sourceId:e,agentId:n?.agentId,title:i.trim(),severity:s==="completed"?"info":"warning",body:o.join(` +`).trim(),raw:t}}function wSe(e){if(e.createdAt!==""&&e.endedAt!=="")return e;const t={...e};return t.createdAt===""&&delete t.createdAt,t.endedAt===""&&delete t.endedAt,t}function k7(e){let t;for(const n of e){if(n===void 0)continue;const i=Date.parse(n);Number.isFinite(i)&&(t===void 0||i=0?n:void 0}const yO=6e3,tg=256*1024,ASe=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/;function kO(e,t){return t===0?e:e-1}function CSe(e,t){const n=Dc(t),i=[];let o=0;for(const s of e){if(s.type==="hunk"){const r=ASe.exec(s.text);if(!r)return null;const a=kO(Number(r[1]),r[2]===void 0?1:Number(r[2])),l=kO(Number(r[3]),r[4]===void 0?1:Number(r[4]));if(ln.length)return null;for(;o=n.length||n[o]!==s.text)return null;o++,s.type==="context"&&i.push(s.text)}for(;otg||Dc(n).length>yO)return null;const i=CSe(e,n);return i===null||i.length>tg||Dc(i).length>yO?null:{before:i,after:n}}const SSe=new Set(["assistantDelta","agentDelta","toolOutput","taskProgress"]);function _Se(e){return SSe.has(e.type)}const ISe=50,MSe=100,b7=32*1024,TSe={requestFrame(e){return typeof requestAnimationFrame=="function"?requestAnimationFrame(e):null},cancelFrame(e){typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(e)},requestTask(e){return setTimeout(e,ISe)},cancelTask(e){clearTimeout(e)}};function ESe(e,t,n={}){const i=n.scheduler??TSe,o=Math.max(1,Math.floor(n.maxItemsPerSlice??MSe)),s=[];let r=0,a=null,l=null,u=0,c=!1;const d=()=>s.length-r,f=()=>{u+=1,a!==null&&(i.cancelFrame(a),a=null),l!==null&&(i.cancelTask(l),l=null)},h=()=>{r===s.length?(s.length=0,r=0):r>=1024&&(s.splice(0,r),r=0)};let m;const g=()=>{if(c||a!==null||l!==null||d()===0)return;const b=++u,v=()=>{b===u&&m()};a=i.requestFrame(v),l=i.requestTask(v)};m=()=>{f();let b=0;for(;!c&&b{if(!c){if(t(b)){const v=s.length>r?s.at(-1):void 0,w=v===void 0?void 0:n.coalesce?.(v,b);w===void 0?s.push(b):s[s.length-1]=w,g();return}if(d()===0){e(b);return}s.push(b),m()}});return y.flush=()=>{if(!c){for(f();!c&&r{if(c||d()===0)return;let v=r;for(let w=r;w{c||(c=!0,f(),s.length=0,r=0)},y}function w7(e){if(e.type==="assistantDelta"){if(e.delta.text!==void 0&&e.delta.thinking===void 0)return{kind:"text",value:e.delta.text};if(e.delta.thinking!==void 0&&e.delta.text===void 0)return{kind:"thinking",value:e.delta.thinking}}}function LSe(e){if(e.appEvent.type!=="assistantDelta")return[e];const t=e.appEvent,n=e.meta.stream,i=w7(t);if(n===void 0||i===void 0||n.kind!==i.kind||i.value.length<=b7)return[e];const o=[];let s=0;for(;ss&&/[\uD800-\uDBFF]/u.test(i.value[r-1])&&/[\uDC00-\uDFFF]/u.test(i.value[r])&&(r-=1);const a=i.value.slice(s,r);o.push({appEvent:{...t,delta:i.kind==="text"?{text:a}:{thinking:a}},meta:{...e.meta,stream:{...n,offset:n.offset+s}}}),s=r}return o}function NSe(e,t){if(e.appEvent.type!=="assistantDelta"||t.appEvent.type!=="assistantDelta")return;const n=e.meta.stream,i=t.meta.stream,o=w7(e.appEvent),s=w7(t.appEvent);if(n===void 0||i===void 0||o===void 0||s===void 0||e.meta.sessionId!==t.meta.sessionId||e.appEvent.sessionId!==t.appEvent.sessionId||e.appEvent.messageId!==t.appEvent.messageId||e.appEvent.contentIndex!==t.appEvent.contentIndex||n.turnId!==i.turnId||n.kind!==i.kind||o.kind!==s.kind||n.kind!==o.kind||i.kind!==s.kind||i.offset!==n.offset+o.value.length||o.value.length+s.value.length>b7)return;const r=o.value+s.value;return{appEvent:{...e.appEvent,delta:o.kind==="text"?{text:r}:{thinking:r}},meta:{...t.meta,stream:{...n}}}}function KK(e){return Array.isArray(e)?e.filter(t=>typeof t=="object"&&t!==null&&t.type==="text").map(t=>t.text).join(""):""}function FSe(e){for(let t=e.items.length-1;t>=0;t--){const n=e.items[t];if(n.kind==="marker"){const i=n.at;if(typeof i=="string")return i;continue}if(n.kind==="turn"){let i;const o=s=>{typeof s=="string"&&(i===void 0||s>i)&&(i=s)};o(n.endedAt),o(n.startedAt);for(const s of n.steps)o(s.endedAt),o(s.startedAt);if(i!==void 0)return i}}}function RSe(e,t){if(t===void 0)return;const n=e.find(i=>i.kind==="turn"&&i.turnId===t);return n?.kind==="turn"?n.startedAt:void 0}function Zp(e,t){const n=RSe(e,t?.["kimiWeb.anchorTurnId"]),i=t?.["kimiWeb.anchorPromptCreatedAt"];return typeof i=="string"&&(n===void 0||i>=n)?{at:i,exclusive:!0}:n!==void 0?{at:n,exclusive:!1}:void 0}function Z_(e,t,n){const i=new Map,o=new Set(n??[]);for(const s of e){if(s.skills.length>0)continue;const r=t.find(a=>!o.has(a.promptId)&&a.status!=="queued"&&(s.floor===void 0||(s.floor.exclusive?a.createdAt>s.floor.at:a.createdAt>=s.floor.at))&&KK(a.content)===s.text);r!==void 0&&(o.add(r.promptId),i.set(s.id,r.promptId))}return i}function G_(e,t,n){const i=[];for(const r of t.items){if(r.kind!=="turn")continue;const a=Ad(r.origin.payload);a.length>0&&i.push({id:`turn:${r.turnId}`,text:r.prompt??"",attachmentCount:r.attachmentIds?.length??0,at:r.startedAt,skills:a})}const o=new Map,s=new Set(n??[]);for(const r of e){const a=i.find(l=>s.has(l.id)||r.floor!==void 0&&(l.at===void 0||(r.floor.exclusive?l.at<=r.floor.at:l.atr.kind==="turn"&&r.turnId===t);return t!==void 0&&s===-1?!1:e.slice(s+1).some(r=>{if(r.kind!=="marker"||r.marker!=="skill")return!1;if(o!==void 0){const l=r.at;if(typeof l!="string"||l<=o)return!1}const a=r.payload?.origin;return a?.kind==="skill_activation"&&a.skillName===n&&a.skillArgs===i})}function ZK(e,t,n,i,o){const s=t===void 0?-1:e.findIndex(r=>r.kind==="turn"&&r.turnId===t);return t!==void 0&&s===-1?!1:e.slice(s+1).some(r=>{if(r.kind!=="turn"||o?.terminalOnly===!0&&r.state==="running")return!1;const a=r.origin.payload??r.origin;return a.kind==="skill_activation"&&a.skillName===n&&a.skillArgs===i})}function Q_(e,t,n){const i=new Map,o=new Set(n??[]);for(const s of e){const r=s.anchorTurnId===void 0?-1:t.findIndex(l=>l.kind==="turn"&&l.turnId===s.anchorTurnId);if(s.anchorTurnId!==void 0&&r===-1)continue;const a=t.slice(r+1).find(l=>{if(l.kind==="turn"){if(o.has(l.turnId))return!1;const u=l.origin.payload??l.origin;return u.kind==="skill_activation"&&u.skillName===s.skillName&&u.skillArgs===s.skillArgs}if(l.kind==="marker"&&l.marker==="skill"){if(o.has(l.markerId))return!1;if(s.promptFloor!==void 0){const c=l.at;if(typeof c!="string"||c<=s.promptFloor)return!1}const u=l.payload?.origin;return u?.kind==="skill_activation"&&u.skillName===s.skillName&&u.skillArgs===s.skillArgs}return!1});if(a!==void 0){const l=a.kind==="turn"?a.turnId:a.markerId;o.add(l),i.set(s.id,l)}}return i}function Qs(e){return Ad(e?.origin)}function A7(e,t){const n=Qs(e.metadata);if(n.length===0)return!1;const i=e.content.filter(u=>u.type==="text").map(u=>"text"in u?u.text:"").join(""),o=e.content.filter(u=>u.type!=="text").length,s=e.metadata?.["kimiWeb.promptId"];if(s!==void 0)return t.items.some(c=>c.kind==="turn"&&c.steps.some(d=>d.frames.some(f=>f.kind==="text"&&f.role==="user"&&(f.promptIds?.includes(s)??!1)&&Rv(Ad(f.origin),n))))?!0:t.items.some(c=>c.kind==="turn"&&c.triggerPromptId===s&&(c.prompt??"")===i&&(c.attachmentIds?.length??0)===o&&Rv(Ad(c.origin.payload),n));const r=e.metadata?.["kimiWeb.anchorTurnId"],a=r===void 0?-1:t.items.findIndex(u=>u.kind==="turn"&&u.turnId===r);return r!==void 0&&a===-1?!1:(a===-1?t.items:t.items.slice(a+1)).some(u=>u.kind==="turn"&&(u.prompt??"")===i&&(u.attachmentIds?.length??0)===o&&Rv(Ad(u.origin.payload),n))}function OSe(e,t){const i=e.items.filter(h=>h.kind==="turn")[0]?.turnId,o=new Map(e.tasks.map(h=>[h.taskId,h])),s=new Map(e.prompts.map(h=>[h.promptId,h])),r=VK(e.prompts,UK(e.items)),a=h=>h.kind==="turn"?h.origin.payload??h.origin:void 0,l=new Set,u=PSe(e.items),c=e.items.flatMap((h,m)=>{if(h.kind==="turn"){const g=u.turnPart.get(m)??h,y=g.startedAt!==void 0||g.steps.some(b=>b.startedAt!==void 0);return bO(g,e.attachments,o,h.turnId===i&&!y&&e.hasMoreOlder!==!0?t.agentCreatedAt:void 0,void 0,t.sessionId,t.pendingInteractionAtByStepId,t.thinkingTiming,s,r)}if(h.kind==="marker"&&h.marker==="compaction"){const g=BSe(h.payload,h.at,t.sessionId,h.markerId,zSe(e.items,m));if(g===void 0)return[];const y=u.continuation.get(h.markerId);return y===void 0?[g]:[g,...bO(y,e.attachments,o,void 0,void 0,t.sessionId,t.pendingInteractionAtByStepId,t.thinkingTiming,s,r,!0,`:${h.markerId}`)]}if(h.kind==="marker"&&h.marker==="cron.fired"){const g=h.payload,y=g?.origin?.jobId,b=typeof g?.prompt=="string"?g.prompt:void 0,v=e.items.slice(m+1).find(A=>{if(A.kind!=="turn"||l.has(A.turnId))return!1;const M=a(A);return M?.kind==="cron_job"&&(y===void 0||M.jobId===y)&&(b===void 0||A.kind==="turn"&&WK(A.prompt??"")===b)});if(v!==void 0&&v.kind==="turn")return l.add(v.turnId),[];const w=$Se(h.payload,h.at,t.sessionId,h.markerId);return w===void 0?[]:[w]}return[]}),d=e.interactions.map(h=>J1(h,t.sessionId)).filter(h=>h!==void 0),f=e.meta.activity==="turn";return u3(c,d,t.getFileUrl,f,t.planReviewByToolCallId??{},t.plansByToolCallId??{},{getSessionMediaUrl:t.getSessionMediaUrl}).map(WSe)}function PSe(e){const t=new Map,n=new Map;for(let i=0;i[]);let l=-1;for(const u of o.steps){for(;l+1=s[l+1].at;)l+=1;l<0?r.push(u):a[l].push(u)}if(r.length!==o.steps.length){t.set(i,{...o,steps:r,endedAt:r.at(-1)?.endedAt,durationMs:void 0});for(let u=0;ug.startedAt),i])??"",promptId:e.turnId,daemonTurnId:e.ordinal,daemonTurnState:e.state,metadata:{origin:f}}]:[],...K_(e,t,n,i,o,s,{includeOrigin:c!==!0,pendingInteractionAtByStepId:r,thinkingTiming:a,promptById:l,promptForTurn:u})]}function BSe(e,t,n,i,o){const s=e;if(s?.phase!=="completed")return;const r=s.result??{},a={trigger:o,tokensBefore:typeof r.tokensBefore=="number"?r.tokensBefore:void 0,tokensAfter:typeof r.tokensAfter=="number"?r.tokensAfter:void 0};return{id:i,sessionId:n,role:"assistant",content:typeof r.summary=="string"?[{type:"text",text:r.summary}]:[],createdAt:t??"",metadata:{origin:{kind:"compaction_summary"},[ZH]:a}}}function $Se(e,t,n,i){const o=e,s=o?.origin;if(!(s?.kind!=="cron_job"||typeof o?.prompt!="string"))return{id:i,sessionId:n,role:"user",content:[{type:"text",text:o.prompt}],createdAt:t??"",metadata:{origin:s}}}function zSe(e,t){for(let n=t-1;n>=0;n--){const i=e[n];if(i?.kind!=="marker"||i.marker!=="compaction")continue;const o=i.payload;if(o?.phase==="started")return o.trigger==="manual"?"manual":"auto"}return"auto"}function J1(e,t){if(e.interactionKind!=="approval"||e.state!=="pending")return;const n=e.request??{};if(typeof n.toolName!="string"||typeof n.action!="string")return;const i=typeof e.toolCallId=="string"?e.toolCallId:typeof n.toolCallId=="string"?n.toolCallId:void 0;if(i!==void 0)return{approvalId:e.interactionId,sessionId:t,turnId:typeof n.turnId=="number"?n.turnId:void 0,toolCallId:i,toolName:n.toolName,action:n.action,display:n.display,expiresAt:"",createdAt:""}}function A0(e,t){if(e.interactionKind!=="question"||e.state!=="pending")return;const n=e.request??{};if(!Array.isArray(n.questions))return;const i=typeof e.toolCallId=="string"?e.toolCallId:typeof n.toolCallId=="string"?n.toolCallId:typeof n.tool_call_id=="string"?n.tool_call_id:void 0;return{questionId:e.interactionId,sessionId:t,turnId:typeof n.turnId=="number"?n.turnId:typeof n.turn_id=="number"?n.turn_id:void 0,toolCallId:i,questions:n.questions.map(jSe),createdAt:""}}function jSe(e){const t=Array.isArray(e.options)?e.options:[];return{id:typeof e.id=="string"?e.id:"",question:typeof e.question=="string"?e.question:"",header:typeof e.header=="string"?e.header:void 0,body:typeof e.body=="string"?e.body:void 0,options:t.map(HSe),multiSelect:e.multi_select===!0,allowOther:e.allow_other===!0,otherLabel:typeof e.other_label=="string"?e.other_label:void 0,otherDescription:typeof e.other_description=="string"?e.other_description:void 0}}function HSe(e){const t=e??{};return{id:typeof t.id=="string"?t.id:"",label:typeof t.label=="string"?t.label:"",description:typeof t.description=="string"?t.description:void 0,recommended:t.recommended===!0||t.is_recommended===!0}}function WSe(e){if(e.createdAt!==""&&e.endedAt!=="")return e;const t={...e};return t.createdAt===""&&delete t.createdAt,t.endedAt===""&&delete t.endedAt,t}function qSe(){let e=[];const t=(n,i)=>{const s=OSe(n,i).map((r,a)=>{const l=JSON.stringify(r),u=e[a],c=u!==void 0&&u.fingerprint===l?u.turn:r;return e[a]={turn:c,fingerprint:l},c});return e.length=s.length,s};return t.reset=()=>{e=[]},t}function GK(e){if(e instanceof Error)return typeof e.stack=="string"&&e.stack?e.stack:e.message?`${e.name}: ${e.message}`:e.name;if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean"||typeof e=="bigint")return String(e);try{return JSON.stringify(e)}catch{return String(e)}}function USe(e){if(e instanceof Error)return{name:e.name,message:e.message};const t=e;return{name:typeof t?.name=="string"?t.name:void 0,message:typeof t?.message=="string"?t.message:void 0}}function VSe(e){return e instanceof Error&&typeof e.stack=="string"&&e.stack?e.stack:void 0}function KSe(e){if(!(typeof e!="number"||!Number.isFinite(e)))return new Date(e).toISOString()}function wO(e){if(!(typeof e!="number"||!Number.isFinite(e)))return`${Math.round(e)}ms`}function ZSe(e,t,n){const i=YSe(e),o=QSe(e),s=new Map(e.prompts.map(d=>[d.promptId,d])),r=n.filter(d=>{const f=d.metadata?.["kimiWeb.promptId"];if(f===void 0||o===void 0)return!0;const h=s.get(f)?.steeredAt;return h===void 0||h>=o}),a=e.prompts.filter(GSe).filter(d=>!i.has(d.promptId)).filter(d=>o===void 0||d.steeredAt>=o);if(a.length===0)return[...r];a.sort((d,f)=>d.steeredAtt)&&(t=n.startedAt);return t}function YSe(e){const t=new Set;for(const n of e.items)if(n.kind==="turn"){for(const i of n.steps)for(const o of i.frames)if(!(o.kind!=="text"||o.role!=="user"))for(const s of o.promptIds??[])t.add(s)}return t}function JSe(e){return Array.isArray(e)?e.map(t=>n3(t)).filter(t=>t.type!=="text"||t.text.length>0):[]}function XSe(e){return e.startsWith("diff --git")||e.startsWith("index ")||e.startsWith("--- ")||e.startsWith("+++ ")||e.startsWith("new file mode")||e.startsWith("deleted file mode")||e.startsWith("old mode")||e.startsWith("new mode")||e.startsWith("similarity index")||e.startsWith("dissimilarity index")||e.startsWith("rename from")||e.startsWith("rename to")||e.startsWith("copy from")||e.startsWith("copy to")||e.startsWith("Binary files")}function e_e(e){const t=[];if(!e)return t;let n=0,i=0,o=!1;for(const s of e.split(` +`)){if(s.startsWith("diff --git")){o=!1;continue}if(!o&&XSe(s))continue;if(s.startsWith("@@")){const l=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(s);l&&(n=Number.parseInt(l[1],10),i=Number.parseInt(l[2],10)),o=!0,t.push({type:"hunk",text:s});continue}if(!o||s.startsWith("\\"))continue;const r=s.charAt(0),a=s.slice(1);r==="+"?(t.push({type:"add",text:a,newNo:i}),i+=1):r==="-"?(t.push({type:"del",text:a,oldNo:n}),n+=1):r===" "&&(t.push({type:"context",text:a,oldNo:n,newNo:i}),n+=1,i+=1)}return t}function AO(e){return e?e.split(` +`).map(t=>t.trimEnd()).filter(Boolean).at(-1)??"":""}function t_e(e){return e.suspendedReason||AO(e.text)||AO(e.outputLines?.join(` +`))||e.summary||""}function n_e(e){return e.suspendedReason?e.suspendedReason:e.text?e.text:e.outputLines&&e.outputLines.length>0?e.outputLines.join(` +`):e.summary??""}function i_e(e){return e==="completed"?"completed":e==="failed"?"failed":e==="aborted"?"cancelled":"working"}function CO(e,t){return{id:e.agentId??e.item??`result-${t}`,agentId:e.agentId,name:e.item??`subagent ${t+1}`,activity:e.body.split(` +`)[0]??"",phase:i_e(e.outcome),body:e.body}}function o_e(e,t){return!!(t.agentId&&e.agentId===t.agentId||t.item&&e.name.includes(t.item))}function s_e(e,t){const n=e.map(o=>({id:o.id,agentId:o.agentId,name:o.name,activity:t_e(o),phase:o.phase,body:n_e(o)}));if(!t)return n;const i=t.subagents.filter(o=>(o.outcome==="aborted"||o.state==="not_started")&&!e.some(s=>o_e(s,o))).map((o,s)=>CO(o,s));return n.length>0?[...n,...i]:t.subagents.map((o,s)=>CO(o,s))}const r_e=["queued","working","suspended","completed","failed","cancelled"];function QK(e){return e.status==="completed"?"completed":e.status==="failed"?"failed":e.status==="cancelled"?"cancelled":e.subagentPhase?e.subagentPhase:"working"}function a_e(){return{queued:0,working:0,suspended:0,completed:0,failed:0,cancelled:0}}function l_e(e){const t=new Map;for(const n of e){if(n.kind!=="subagent"||n.swarmIndex===void 0)continue;const i=n.parentToolCallId??"swarm",o=t.get(i)??[];o.push({id:n.id,agentId:n.agentId,name:n.description,subagentType:n.subagentType,model:n.model,thinkingEffort:n.thinkingEffort,phase:QK(n),summary:n.outputPreview,outputLines:n.outputLines,text:n.text,suspendedReason:n.suspendedReason,swarmIndex:n.swarmIndex}),t.set(i,o)}return[...t.entries()].map(([n,i])=>{const o=i.toSorted((r,a)=>r.swarmIndex-a.swarmIndex||r.id.localeCompare(a.id)),s=a_e();for(const r of o)s[r.phase]++;return{id:n,members:o,counts:s}}).filter(n=>n.members.length>1).toSorted((n,i)=>{const o=n.members.at(0)?.swarmIndex??0,s=i.members.at(0)?.swarmIndex??0;return o!==s?o-s:n.id.localeCompare(i.id)})}function u_e(e){let t=0,n=0;for(const i of e){n+=i.members.length;for(const o of r_e)(o==="completed"||o==="failed"||o==="cancelled")&&(t+=i.counts[o])}return{done:t,total:n}}function c_e(e){const t=new Map;for(const n of e){if(n.kind!=="subagent"||!n.parentToolCallId)continue;const i=t.get(n.parentToolCallId)??[];i.push({id:n.id,agentId:n.agentId,name:n.description,subagentType:n.subagentType,model:n.model,thinkingEffort:n.thinkingEffort,phase:QK(n),summary:n.outputPreview,outputLines:n.outputLines,text:n.text,suspendedReason:n.suspendedReason,swarmIndex:n.swarmIndex??Number.MAX_SAFE_INTEGER}),t.set(n.parentToolCallId,i)}for(const[n,i]of t)t.set(n,i.toSorted((o,s)=>o.swarmIndex-s.swarmIndex||o.id.localeCompare(s.id)));return t}function Y_(e){const t=e.trim();if(!t.startsWith("{"))return null;try{const n=JSON.parse(t);return n&&typeof n=="object"&&!Array.isArray(n)?n:null}catch{return null}}function YK(e){for(const t of["path","file_path","filePath","filename"]){const n=e[t];if(typeof n=="string"&&n.length>0)return n}}const G0=100*1024;function d_e(e){const t=Sr(e.name);if(t!=="edit"&&t!=="multi_edit")return null;const n=Y_(e.arg);if(!n)return null;if(t==="edit"){if(n.replace_all===!0)return null;const a=typeof n.old_string=="string"?n.old_string:void 0,l=typeof n.new_string=="string"?n.new_string:void 0;return a===void 0||l===void 0||a.length>G0||l.length>G0?null:S4(a,l)}const i=Array.isArray(n.edits)?n.edits:void 0;if(!i||i.length===0)return null;const o=[];let s=0,r=0;for(const a of i){if(!a||typeof a!="object")return null;const l=a;if(l.replace_all===!0)return null;const u=typeof l.old_string=="string"?l.old_string:void 0,c=typeof l.new_string=="string"?l.new_string:void 0;if(u===void 0||c===void 0||u.length>G0||c.length>G0)return null;const d=S4(u,c);if(d===null)return null;o.length>0&&o.push({type:"hunk",text:"···"});for(const f of d)o.push({...f,oldNo:f.oldNo!==void 0?f.oldNo+s:void 0,newNo:f.newNo!==void 0?f.newNo+r:void 0});s+=Dc(u).length,r+=Dc(c).length}return o}const f_e=5e3;function h_e(e){if(Sr(e.name)!=="write")return null;const t=Y_(e.arg);return!t||typeof t.content!="string"||t.content.length>G0||t.content.split(` +`).length>f_e?null:{content:t.content,path:YK(t)}}function p_e(e){const t=Y_(e.arg);return t?YK(t):void 0}function m_e(e){switch(e){case"running":return"running";case"completed":return"completed";case"killed":return"cancelled";default:return"failed"}}function g_e(e,t){return t==="running"?e.stateReason!==void 0?"suspended":"working":t}function v_e(e){return e==="subagent"?"subagent":e==="shell"?"bash":"tool"}function y_e(e){return JK(e).parents}function JK(e){const t=new Map,n=new Map;for(const i of e.items)if(i.kind==="turn")for(const o of i.steps)for(const s of o.frames)s.kind!=="tool"||s.agentRefs===void 0||s.agentRefs.forEach((r,a)=>{t.set(r.agentId,s.toolCallId),n.set(r.agentId,a)});return{parents:t,swarmIndexes:n}}function k_e(e,t,n){const i=JK(e);let o=i.parents,s=i.swarmIndexes;if(n!==void 0){for(const[u,c]of i.parents)n.parents.set(u,c);for(const[u,c]of i.swarmIndexes)n.swarmIndexes.set(u,c);o=n.parents,s=n.swarmIndexes}const r=e.tasks.map(u=>{const c=m_e(u.state);return{id:u.taskId,agentId:u.agentId,sessionId:t,kind:v_e(u.kind),description:u.description??"",status:c,createdAt:u.startedAt??"",startedAt:u.startedAt,completedAt:u.endedAt,outputPreview:u.outputTail.length>0?u.outputTail:void 0,text:u.resultSummary,subagentPhase:u.kind==="subagent"?g_e(u,c):void 0,suspendedReason:c==="running"?u.stateReason:void 0,model:u.model,thinkingEffort:u.thinkingEffort,runInBackground:u.detached,parentToolCallId:u.agentId!==void 0?o.get(u.agentId):void 0,swarmIndex:u.agentId!==void 0?s.get(u.agentId):void 0}}),a=new Map;r.forEach((u,c)=>{u.agentId!==void 0&&u.id===u.agentId&&a.set(u.agentId,c)});const l=new Set;return r.forEach((u,c)=>{if(u.agentId===void 0||u.id===u.agentId)return;const d=a.get(u.agentId);if(d===void 0)return;const f=r[d],h=u.completedAt!==void 0&&f.startedAt!==void 0&&u.completedAt>=f.startedAt,m=f.status==="running"&&u.status!=="running"&&h;r[d]={...f,backgroundTaskId:u.status==="running"||h?u.id:void 0,status:m?u.status:f.status,subagentPhase:m?u.status==="completed"?"completed":u.status==="cancelled"?"cancelled":"failed":f.subagentPhase,description:f.description.length>0?f.description:u.description,model:f.model??u.model,thinkingEffort:f.thinkingEffort??u.thinkingEffort,completedAt:h?u.completedAt??f.completedAt:f.completedAt,outputPreview:h?f.outputPreview??u.outputPreview:f.outputPreview,text:h?f.text??u.text:f.text},l.add(c)}),r.filter((u,c)=>!l.has(c))}function b_e(){let e=[],t=null,n=null,i=null,o,s,r=!0;const a=new WeakMap,l=u=>{const{messages:c,approvals:d}=u,f=u.sessionActive??!0,h=u.planReviewByToolCallId??{},m=u.plansByToolCallId??{},g=(C,x)=>a.set(C,x);let y=n!==null;if(y){const C=n,x=Object.keys(h);y=x.length===Object.keys(C).length&&x.every(_=>h[_]===C[_])}let b=i!==null;if(b){const C=i,x=Object.keys(m);b=x.length===Object.keys(C).length&&x.every(_=>m[_]===C[_])}const v=e.length>0&&d===t&&y&&b&&u.getFileUrl===o&&u.getSessionMediaUrl===s;let w=0,A=0,M=1;if(v){let C=-1;for(let x=e.length-1;x>=0;x--)if(e[x].role==="assistant"){C=x;break}for(let x=0;x0?[...e.slice(0,w),...L]:L;return e=E,t=d,n={...h},i={...m},o=u.getFileUrl,s=u.getSessionMediaUrl,r=f,E};return l.reset=()=>{e=[],t=null,n=null,i=null,o=void 0,r=!0},l}function w_e(e){const t=new Map;let n=0;for(let i=e.length-1;i>=0;i--){const o=e[i];if(o.role==="compaction"||o.goalContinuation===!0)break;o.role==="user"&&o.hasUndoAnchor!==!1&&(n++,t.set(o.id,n))}return t}const XK=["light","dark","system"],A_e=["small","medium","large","xlarge"],eA="medium",eZ="kimi-web.color-scheme",C7="kimi-web.font-scale",xO="kimi-web.ui-font-size";function x7(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function J_(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function C_e(e){try{globalThis.localStorage.removeItem(e)}catch{}}function x_e(){const e=x7(eZ);return e&&XK.includes(e)?e:"system"}const $9={light:"#ffffff",dark:"#121212"};function S_e(e){if(typeof document>"u"||!document.documentElement)return;document.documentElement.dataset.colorScheme=e;const t=document.querySelectorAll('meta[name="theme-color"]');if(t.length===0)return;const n=e==="dark"?$9.dark:e==="light"?$9.light:null;t.forEach(i=>{const s=(i.getAttribute("media")??"").includes("dark")?$9.dark:$9.light;i.setAttribute("content",n??s)})}function tZ(e){return A_e.includes(e)}function __e(e){return e<=13?"small":e<=15?"medium":e<=17?"large":"xlarge"}function I_e(){const e=x7(C7);if(e==="xxlarge")return"xlarge";if(e!==null)return tZ(e)?e:eA;const t=x7(xO);if(t===null)return eA;const n=Number(t),i=Number.isFinite(n)?__e(n):eA;return J_(C7,i),C_e(xO),i}function M_e(e){typeof document>"u"||!document.documentElement||(document.documentElement.dataset.fontScale=e)}const X_=q(x_e()),eI=q(I_e());let SO=!1;function T_e(){SO||(SO=!0,Be(X_,S_e,{immediate:!0}),Be(eI,M_e,{immediate:!0}))}function E_e(e){XK.includes(e)&&(X_.value=e,J_(eZ,e))}function L_e(e){tZ(e)&&(eI.value=e,J_(C7,e))}function Ig(){return T_e(),{colorScheme:X_,fontScale:eI,setColorScheme:E_e,setFontScale:L_e}}const z9=q(!1);let _O=!1;function tA(){const e=document.documentElement.dataset.colorScheme;return e==="dark"?!0:e==="light"?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function c3(){return!_O&&typeof window<"u"&&typeof document<"u"&&(_O=!0,z9.value=tA(),new MutationObserver(()=>{z9.value=tA()}).observe(document.documentElement,{attributes:!0,attributeFilter:["data-color-scheme"]}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{z9.value=tA()})),z9}const nZ="kimi-web.sidebar-multi-tab";function N_e(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function F_e(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function R_e(){return N_e(nZ)==="1"}const iZ=q(R_e());function D_e(e){iZ.value=e,F_e(nZ,e?"1":"0")}function l1(){return{sidebarTabs:iZ,setSidebarTabs:D_e}}function Dv(e){let t="";for(const n of e)n.codePointAt(0)>127||/[A-Za-z0-9\-._~]/.test(n)?t+=n:t+=`%${n.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0")}`;return t}function O_e(e){const t=e.split("/").map(Dv).join("/");return t.startsWith("//")?`/%2F${t.slice(2)}`:t}function tI(e){return e.replace(/%/g,"%25").replace(/&/g,"%26").replace(//g,"%3E").replace(/([\\[\]])/g,"\\$1").replace(/\n/g,"%0A").replace(/\r/g,"%0D")}function IO(e){return e.replace(/\\([\\[\]])/g,"$1").replace(/%0A/g,` +`).replace(/%0D/g,"\r").replace(/%26/g,"&").replace(/%3C/g,"<").replace(/%3E/g,">").replace(/%25/g,"%")}function P_e(e){return e.replace(/%0A/g,` +`).replace(/%0D/g,"\r").replace(/%26/g,"&").replace(/%3C/g,"<").replace(/%3E/g,">").replace(/%25/g,"%")}function B_e(e,t){const n=t?e.replace(/\\([\\<>])/g,"$1"):e.replace(/\\([\\()])/g,"$1");return Ov(n)}function Ov(e){try{return decodeURIComponent(e)}catch{return e}}let MO;function S7(e){return MO??=new Intl.Segmenter("und",{granularity:"grapheme"}),[...MO.segment(e)].map(t=>t.segment)}function oZ(e,t){const n=S7(e);return n.length<=t?e:`${n.slice(0,t-1).join("")}…`}const _4="kimi-code://skill/";function nI(e){return e?e.startsWith(_4)&&e.length>_4.length?"skill":e.startsWith("#")||e.startsWith("?")||e.startsWith("//")||/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(e)&&!/^[a-zA-Z]:(?:[\\/]|%5c)/i.test(e)?null:e.endsWith("/")||e.endsWith("\\")||/%5c$/i.test(e)?"folder":"file":null}function hm(e){const t=e.search(/[#?]/);return t>0?e.slice(0,t):e}function sZ(e){const t=e.slice(_4.length);return Ov(t)}function u1(e){const t=tI(e.name);if(e.kind==="skill")return`[${t}](${_4}${Dv(e.name)})`;const n=e.kind==="folder"&&!e.path.endsWith("/")&&!e.path.endsWith("\\")?`${e.path}/`:e.path;return`[${t}](${O_e(n)})`}const Wk="kimi-code-composer://attachments/";function nh(e){return`[${tI(e.name)}](${Wk}${e.attId})`}const gp="kimi-code-composer://quote/",$_e=12;function ng(e){const t=e.split(` +`).map(i=>i.trim()).find(i=>i.length>0)??"",n=oZ(t,$_e);return n.length>0?n:"…"}function d3(e){const t=e.source!==void 0&&e.source.length>0?`?source=${Dv(e.source)}`:"",n=e.comment!==void 0&&e.comment.length>0?`?comment=${Dv(e.comment)}`:"";return`[${tI(ng(e.text))}](${gp}${Dv(e.text)}${t}${n})`}function rZ(e){const t=e.indexOf("?source="),n=e.indexOf("?comment="),i=[t,n].filter(s=>s>=0).sort((s,r)=>s-r)[0]??-1,o={text:Ov(i===-1?e:e.slice(0,i))};if(t>=0){const s=n>t?n:e.length;o.source=Ov(e.slice(t+8,s))}if(n>=0){const s=t>n?t:e.length;o.comment=Ov(e.slice(n+9,s))}return o}const TO=document.createElement("i");function z_e(e){const t="&"+e+";";TO.innerHTML=t;const n=TO.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Oc(e,t,n,i){const o=e.length;let s=0,r;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,n=n>0?n:0,i.length<1e4)r=Array.from(i),r.unshift(t,n),e.splice(...r);else for(n&&e.splice(t,n);s0?(Oc(e,e.length,0,t),e):t}const EO={}.hasOwnProperty;function j_e(e){const t={};let n=-1;for(;++n-1&&e.test(String.fromCharCode(n))}}function lo(e,t,n,i){const o=i?i-1:Number.POSITIVE_INFINITY;let s=0;return r;function r(l){return Li(l)?(e.enter(n),a(l)):t(l)}function a(l){return Li(l)&&s++r))return;const E=t.events.length;let C=E,x,_;for(;C--;)if(t.events[C][0]==="exit"&&t.events[C][1].type==="chunkFlow"){if(x){_=t.events[C][1].end;break}x=!0}for(b(i),L=E;Lw;){const M=n[A];t.containerState=M[1],M[0].exit.call(t,e)}n.length=w}function v(){o.write([null]),s=void 0,o=void 0,t.containerState._closeFlow=void 0}}function X_e(e,t,n){return lo(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function NO(e){if(e===null||Wa(e)||Z_e(e))return 1;if(K_e(e))return 2}function oI(e,t,n){const i=[];let o=-1;for(;++o1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[i][1].end},f={...e[n][1].start};FO(d,-l),FO(f,l),r={type:l>1?"strongSequence":"emphasisSequence",start:d,end:{...e[i][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:f},s={type:l>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[n][1].start}},o={type:l>1?"strong":"emphasis",start:{...r.start},end:{...a.end}},e[i][1].end={...r.start},e[n][1].start={...a.end},u=[],e[i][1].end.offset-e[i][1].start.offset&&(u=Ul(u,[["enter",e[i][1],t],["exit",e[i][1],t]])),u=Ul(u,[["enter",o,t],["enter",r,t],["exit",r,t],["enter",s,t]]),u=Ul(u,oI(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),u=Ul(u,[["exit",s,t],["enter",a,t],["exit",a,t],["exit",o,t]]),e[n][1].end.offset-e[n][1].start.offset?(c=2,u=Ul(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):c=0,Oc(e,i-1,n-i+3,u),n=i+u.length-c-2;break}}for(n=-1;++n0&&Li(L)?lo(e,v,"linePrefix",s+1)(L):v(L)}function v(L){return L===null||Vn(L)?e.check(RO,g,A)(L):(e.enter("codeFlowValue"),w(L))}function w(L){return L===null||Vn(L)?(e.exit("codeFlowValue"),v(L)):(e.consume(L),w)}function A(L){return e.exit("codeFenced"),t(L)}function M(L,E,C){let x=0;return _;function _($){return L.enter("lineEnding"),L.consume($),L.exit("lineEnding"),F}function F($){return L.enter("codeFencedFence"),Li($)?lo(L,I,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)($):I($)}function I($){return $===a?(L.enter("codeFencedFenceSequence"),D($)):C($)}function D($){return $===a?(x++,L.consume($),D):x>=r?(L.exit("codeFencedFenceSequence"),Li($)?lo(L,H,"whitespace")($):H($)):C($)}function H($){return $===null||Vn($)?(L.exit("codeFencedFence"),E($)):C($)}}}function dIe(e,t,n){const i=this;return o;function o(r){return r===null?n(r):(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),s)}function s(r){return i.parser.lazy[i.now().line]?n(r):t(r)}}const nA={name:"codeIndented",tokenize:hIe},fIe={partial:!0,tokenize:pIe};function hIe(e,t,n){const i=this;return o;function o(u){return e.enter("codeIndented"),lo(e,s,"linePrefix",5)(u)}function s(u){const c=i.events[i.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?r(u):n(u)}function r(u){return u===null?l(u):Vn(u)?e.attempt(fIe,r,l)(u):(e.enter("codeFlowValue"),a(u))}function a(u){return u===null||Vn(u)?(e.exit("codeFlowValue"),r(u)):(e.consume(u),a)}function l(u){return e.exit("codeIndented"),t(u)}}function pIe(e,t,n){const i=this;return o;function o(r){return i.parser.lazy[i.now().line]?n(r):Vn(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),o):lo(e,s,"linePrefix",5)(r)}function s(r){const a=i.events[i.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(r):Vn(r)?o(r):n(r)}}const mIe={name:"codeText",previous:vIe,resolve:gIe,tokenize:yIe};function gIe(e){let t=e.length-4,n=3,i,o;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(i=n;++i=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(t,n,i){const o=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return i&&C0(this.left,i),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),C0(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),C0(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(r):e.interrupt(i.parser.constructs.flow,n,t)(r)}}function dZ(e,t,n,i,o,s,r,a,l){const u=l||Number.POSITIVE_INFINITY;let c=0;return d;function d(b){return b===60?(e.enter(i),e.enter(o),e.enter(s),e.consume(b),e.exit(s),f):b===null||b===32||b===41||_7(b)?n(b):(e.enter(i),e.enter(r),e.enter(a),e.enter("chunkString",{contentType:"string"}),g(b))}function f(b){return b===62?(e.enter(s),e.consume(b),e.exit(s),e.exit(o),e.exit(i),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),h(b))}function h(b){return b===62?(e.exit("chunkString"),e.exit(a),f(b)):b===null||b===60||Vn(b)?n(b):(e.consume(b),b===92?m:h)}function m(b){return b===60||b===62||b===92?(e.consume(b),h):h(b)}function g(b){return!c&&(b===null||b===41||Wa(b))?(e.exit("chunkString"),e.exit(a),e.exit(r),e.exit(i),t(b)):c999||h===null||h===91||h===93&&!l||h===94&&!a&&"_hiddenFootnoteSupport"in r.parser.constructs?n(h):h===93?(e.exit(s),e.enter(o),e.consume(h),e.exit(o),e.exit(i),t):Vn(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===null||h===91||h===93||Vn(h)||a++>999?(e.exit("chunkString"),c(h)):(e.consume(h),l||(l=!Li(h)),h===92?f:d)}function f(h){return h===91||h===92||h===93?(e.consume(h),a++,d):d(h)}}function hZ(e,t,n,i,o,s){let r;return a;function a(f){return f===34||f===39||f===40?(e.enter(i),e.enter(o),e.consume(f),e.exit(o),r=f===40?41:f,l):n(f)}function l(f){return f===r?(e.enter(o),e.consume(f),e.exit(o),e.exit(i),t):(e.enter(s),u(f))}function u(f){return f===r?(e.exit(s),l(r)):f===null?n(f):Vn(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),lo(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(f))}function c(f){return f===r||f===null||Vn(f)?(e.exit("chunkString"),u(f)):(e.consume(f),f===92?d:c)}function d(f){return f===r||f===92?(e.consume(f),c):c(f)}}function Pv(e,t){let n;return i;function i(o){return Vn(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,i):Li(o)?lo(e,i,n?"linePrefix":"lineSuffix")(o):t(o)}}const _Ie={name:"definition",tokenize:MIe},IIe={partial:!0,tokenize:TIe};function MIe(e,t,n){const i=this;let o;return s;function s(h){return e.enter("definition"),r(h)}function r(h){return fZ.call(i,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function a(h){return o=iI(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),l):n(h)}function l(h){return Wa(h)?Pv(e,u)(h):u(h)}function u(h){return dZ(e,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function c(h){return e.attempt(IIe,d,d)(h)}function d(h){return Li(h)?lo(e,f,"whitespace")(h):f(h)}function f(h){return h===null||Vn(h)?(e.exit("definition"),i.parser.defined.push(o),t(h)):n(h)}}function TIe(e,t,n){return i;function i(a){return Wa(a)?Pv(e,o)(a):n(a)}function o(a){return hZ(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function s(a){return Li(a)?lo(e,r,"whitespace")(a):r(a)}function r(a){return a===null||Vn(a)?t(a):n(a)}}const EIe={name:"hardBreakEscape",tokenize:LIe};function LIe(e,t,n){return i;function i(s){return e.enter("hardBreakEscape"),e.consume(s),o}function o(s){return Vn(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const NIe={name:"headingAtx",resolve:FIe,tokenize:RIe};function FIe(e,t){let n=e.length-2,i=3,o,s;return e[i][1].type==="whitespace"&&(i+=2),n-2>i&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(i===n-1||n-4>i&&e[n-2][1].type==="whitespace")&&(n-=i+1===n?2:4),n>i&&(o={type:"atxHeadingText",start:e[i][1].start,end:e[n][1].end},s={type:"chunkText",start:e[i][1].start,end:e[n][1].end,contentType:"text"},Oc(e,i,n-i+1,[["enter",o,t],["enter",s,t],["exit",s,t],["exit",o,t]])),e}function RIe(e,t,n){let i=0;return o;function o(c){return e.enter("atxHeading"),s(c)}function s(c){return e.enter("atxHeadingSequence"),r(c)}function r(c){return c===35&&i++<6?(e.consume(c),r):c===null||Wa(c)?(e.exit("atxHeadingSequence"),a(c)):n(c)}function a(c){return c===35?(e.enter("atxHeadingSequence"),l(c)):c===null||Vn(c)?(e.exit("atxHeading"),t(c)):Li(c)?lo(e,a,"whitespace")(c):(e.enter("atxHeadingText"),u(c))}function l(c){return c===35?(e.consume(c),l):(e.exit("atxHeadingSequence"),a(c))}function u(c){return c===null||c===35||Wa(c)?(e.exit("atxHeadingText"),a(c)):(e.consume(c),u)}}const DIe=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],OO=["pre","script","style","textarea"],OIe={concrete:!0,name:"htmlFlow",resolveTo:$Ie,tokenize:zIe},PIe={partial:!0,tokenize:HIe},BIe={partial:!0,tokenize:jIe};function $Ie(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function zIe(e,t,n){const i=this;let o,s,r,a,l;return u;function u(V){return c(V)}function c(V){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(V),d}function d(V){return V===33?(e.consume(V),f):V===47?(e.consume(V),s=!0,g):V===63?(e.consume(V),o=3,i.interrupt?t:B):kc(V)?(e.consume(V),r=String.fromCharCode(V),y):n(V)}function f(V){return V===45?(e.consume(V),o=2,h):V===91?(e.consume(V),o=5,a=0,m):kc(V)?(e.consume(V),o=4,i.interrupt?t:B):n(V)}function h(V){return V===45?(e.consume(V),i.interrupt?t:B):n(V)}function m(V){const Q="CDATA[";return V===Q.charCodeAt(a++)?(e.consume(V),a===Q.length?i.interrupt?t:I:m):n(V)}function g(V){return kc(V)?(e.consume(V),r=String.fromCharCode(V),y):n(V)}function y(V){if(V===null||V===47||V===62||Wa(V)){const Q=V===47,ie=r.toLowerCase();return!Q&&!s&&OO.includes(ie)?(o=1,i.interrupt?t(V):I(V)):DIe.includes(r.toLowerCase())?(o=6,Q?(e.consume(V),b):i.interrupt?t(V):I(V)):(o=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(V):s?v(V):w(V))}return V===45||Nu(V)?(e.consume(V),r+=String.fromCharCode(V),y):n(V)}function b(V){return V===62?(e.consume(V),i.interrupt?t:I):n(V)}function v(V){return Li(V)?(e.consume(V),v):_(V)}function w(V){return V===47?(e.consume(V),_):V===58||V===95||kc(V)?(e.consume(V),A):Li(V)?(e.consume(V),w):_(V)}function A(V){return V===45||V===46||V===58||V===95||Nu(V)?(e.consume(V),A):M(V)}function M(V){return V===61?(e.consume(V),L):Li(V)?(e.consume(V),M):w(V)}function L(V){return V===null||V===60||V===61||V===62||V===96?n(V):V===34||V===39?(e.consume(V),l=V,E):Li(V)?(e.consume(V),L):C(V)}function E(V){return V===l?(e.consume(V),l=null,x):V===null||Vn(V)?n(V):(e.consume(V),E)}function C(V){return V===null||V===34||V===39||V===47||V===60||V===61||V===62||V===96||Wa(V)?M(V):(e.consume(V),C)}function x(V){return V===47||V===62||Li(V)?w(V):n(V)}function _(V){return V===62?(e.consume(V),F):n(V)}function F(V){return V===null||Vn(V)?I(V):Li(V)?(e.consume(V),F):n(V)}function I(V){return V===45&&o===2?(e.consume(V),T):V===60&&o===1?(e.consume(V),R):V===62&&o===4?(e.consume(V),K):V===63&&o===3?(e.consume(V),B):V===93&&o===5?(e.consume(V),j):Vn(V)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(PIe,X,D)(V)):V===null||Vn(V)?(e.exit("htmlFlowData"),D(V)):(e.consume(V),I)}function D(V){return e.check(BIe,H,X)(V)}function H(V){return e.enter("lineEnding"),e.consume(V),e.exit("lineEnding"),$}function $(V){return V===null||Vn(V)?D(V):(e.enter("htmlFlowData"),I(V))}function T(V){return V===45?(e.consume(V),B):I(V)}function R(V){return V===47?(e.consume(V),r="",P):I(V)}function P(V){if(V===62){const Q=r.toLowerCase();return OO.includes(Q)?(e.consume(V),K):I(V)}return kc(V)&&r.length<8?(e.consume(V),r+=String.fromCharCode(V),P):I(V)}function j(V){return V===93?(e.consume(V),B):I(V)}function B(V){return V===62?(e.consume(V),K):V===45&&o===2?(e.consume(V),B):I(V)}function K(V){return V===null||Vn(V)?(e.exit("htmlFlowData"),X(V)):(e.consume(V),K)}function X(V){return e.exit("htmlFlow"),t(V)}}function jIe(e,t,n){const i=this;return o;function o(r){return Vn(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),s):n(r)}function s(r){return i.parser.lazy[i.now().line]?n(r):t(r)}}function HIe(e,t,n){return i;function i(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(f3,t,n)}}const WIe={name:"htmlText",tokenize:qIe};function qIe(e,t,n){const i=this;let o,s,r;return a;function a(B){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(B),l}function l(B){return B===33?(e.consume(B),u):B===47?(e.consume(B),M):B===63?(e.consume(B),w):kc(B)?(e.consume(B),C):n(B)}function u(B){return B===45?(e.consume(B),c):B===91?(e.consume(B),s=0,m):kc(B)?(e.consume(B),v):n(B)}function c(B){return B===45?(e.consume(B),h):n(B)}function d(B){return B===null?n(B):B===45?(e.consume(B),f):Vn(B)?(r=d,R(B)):(e.consume(B),d)}function f(B){return B===45?(e.consume(B),h):d(B)}function h(B){return B===62?T(B):B===45?f(B):d(B)}function m(B){const K="CDATA[";return B===K.charCodeAt(s++)?(e.consume(B),s===K.length?g:m):n(B)}function g(B){return B===null?n(B):B===93?(e.consume(B),y):Vn(B)?(r=g,R(B)):(e.consume(B),g)}function y(B){return B===93?(e.consume(B),b):g(B)}function b(B){return B===62?T(B):B===93?(e.consume(B),b):g(B)}function v(B){return B===null||B===62?T(B):Vn(B)?(r=v,R(B)):(e.consume(B),v)}function w(B){return B===null?n(B):B===63?(e.consume(B),A):Vn(B)?(r=w,R(B)):(e.consume(B),w)}function A(B){return B===62?T(B):w(B)}function M(B){return kc(B)?(e.consume(B),L):n(B)}function L(B){return B===45||Nu(B)?(e.consume(B),L):E(B)}function E(B){return Vn(B)?(r=E,R(B)):Li(B)?(e.consume(B),E):T(B)}function C(B){return B===45||Nu(B)?(e.consume(B),C):B===47||B===62||Wa(B)?x(B):n(B)}function x(B){return B===47?(e.consume(B),T):B===58||B===95||kc(B)?(e.consume(B),_):Vn(B)?(r=x,R(B)):Li(B)?(e.consume(B),x):T(B)}function _(B){return B===45||B===46||B===58||B===95||Nu(B)?(e.consume(B),_):F(B)}function F(B){return B===61?(e.consume(B),I):Vn(B)?(r=F,R(B)):Li(B)?(e.consume(B),F):x(B)}function I(B){return B===null||B===60||B===61||B===62||B===96?n(B):B===34||B===39?(e.consume(B),o=B,D):Vn(B)?(r=I,R(B)):Li(B)?(e.consume(B),I):(e.consume(B),H)}function D(B){return B===o?(e.consume(B),o=void 0,$):B===null?n(B):Vn(B)?(r=D,R(B)):(e.consume(B),D)}function H(B){return B===null||B===34||B===39||B===60||B===61||B===96?n(B):B===47||B===62||Wa(B)?x(B):(e.consume(B),H)}function $(B){return B===47||B===62||Wa(B)?x(B):n(B)}function T(B){return B===62?(e.consume(B),e.exit("htmlTextData"),e.exit("htmlText"),t):n(B)}function R(B){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(B),e.exit("lineEnding"),P}function P(B){return Li(B)?lo(e,j,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):j(B)}function j(B){return e.enter("htmlTextData"),r(B)}}const sI={name:"labelEnd",resolveAll:ZIe,resolveTo:GIe,tokenize:QIe},UIe={tokenize:YIe},VIe={tokenize:JIe},KIe={tokenize:XIe};function ZIe(e){let t=-1;const n=[];for(;++t=3&&(u===null||Vn(u))?(e.exit("thematicBreak"),t(u)):n(u)}function l(u){return u===o?(e.consume(u),i++,l):(e.exit("thematicBreakSequence"),Li(u)?lo(e,a,"whitespace")(u):a(u))}}const Ta={continuation:{tokenize:uMe},exit:dMe,name:"list",tokenize:lMe},rMe={partial:!0,tokenize:fMe},aMe={partial:!0,tokenize:cMe};function lMe(e,t,n){const i=this,o=i.events[i.events.length-1];let s=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,r=0;return a;function a(h){const m=i.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!i.containerState.marker||h===i.containerState.marker:I7(h)){if(i.containerState.type||(i.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(qk,n,u)(h):u(h);if(!i.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(h)}return n(h)}function l(h){return I7(h)&&++r<10?(e.consume(h),l):(!i.interrupt||r<2)&&(i.containerState.marker?h===i.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),u(h)):n(h)}function u(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||h,e.check(f3,i.interrupt?n:c,e.attempt(rMe,f,d))}function c(h){return i.containerState.initialBlankLine=!0,s++,f(h)}function d(h){return Li(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),f):n(h)}function f(h){return i.containerState.size=s+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function uMe(e,t,n){const i=this;return i.containerState._closeFlow=void 0,e.check(f3,o,s);function o(a){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,lo(e,t,"listItemIndent",i.containerState.size+1)(a)}function s(a){return i.containerState.furtherBlankLines||!Li(a)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,r(a)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(aMe,t,r)(a))}function r(a){return i.containerState._closeFlow=!0,i.interrupt=void 0,lo(e,e.attempt(Ta,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function cMe(e,t,n){const i=this;return lo(e,o,"listItemIndent",i.containerState.size+1);function o(s){const r=i.events[i.events.length-1];return r&&r[1].type==="listItemIndent"&&r[2].sliceSerialize(r[1],!0).length===i.containerState.size?t(s):n(s)}}function dMe(e){e.exit(this.containerState.type)}function fMe(e,t,n){const i=this;return lo(e,o,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(s){const r=i.events[i.events.length-1];return!Li(s)&&r&&r[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const PO={name:"setextUnderline",resolveTo:hMe,tokenize:pMe};function hMe(e,t){let n=e.length,i,o,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){i=n;break}e[n][1].type==="paragraph"&&(o=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const r={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",s?(e.splice(o,0,["enter",r,t]),e.splice(s+1,0,["exit",e[i][1],t]),e[i][1].end={...e[s][1].end}):e[i][1]=r,e.push(["exit",r,t]),e}function pMe(e,t,n){const i=this;let o;return s;function s(u){let c=i.events.length,d;for(;c--;)if(i.events[c][1].type!=="lineEnding"&&i.events[c][1].type!=="linePrefix"&&i.events[c][1].type!=="content"){d=i.events[c][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||d)?(e.enter("setextHeadingLine"),o=u,r(u)):n(u)}function r(u){return e.enter("setextHeadingLineSequence"),a(u)}function a(u){return u===o?(e.consume(u),a):(e.exit("setextHeadingLineSequence"),Li(u)?lo(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||Vn(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const mMe={tokenize:gMe};function gMe(e){const t=this,n=e.attempt(f3,i,e.attempt(this.parser.constructs.flowInitial,o,lo(e,e.attempt(this.parser.constructs.flow,o,e.attempt(wIe,o)),"linePrefix")));return n;function i(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function o(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const vMe={resolveAll:mZ()},yMe=pZ("string"),kMe=pZ("text");function pZ(e){return{resolveAll:mZ(e==="text"?bMe:void 0),tokenize:t};function t(n){const i=this,o=this.parser.constructs[e],s=n.attempt(o,r,a);return r;function r(c){return u(c)?s(c):a(c)}function a(c){if(c===null){n.consume(c);return}return n.enter("data"),n.consume(c),l}function l(c){return u(c)?(n.exit("data"),s(c)):(n.consume(c),l)}function u(c){if(c===null)return!0;const d=o[c];let f=-1;if(d)for(;++f-1){const a=r[0];typeof a=="string"?r[0]=a.slice(i):r.shift()}s>0&&r.push(e[o].slice(0,s))}return r}function FMe(e,t){let n=-1;const i=[];let o;for(;++n0;if(s||e[c]!==(h?"!":"[")||r===null)continue;const m=e.slice(c+(h?2:1),d-1);let g=e.slice(r.start,r.end),y=!1;g.startsWith("<")&&(y=!0,g=g.slice(1,-1)),!(!m||!g)&&n.push({start:c,end:f,rawText:m,rawDest:g,angle:y,image:h})}return n}function BMe(e,t){const{start:n,end:i,rawText:o,rawDest:s,angle:r,image:a}=e;if(a&&!s.startsWith(gp))return null;if(s.startsWith(Wk)&&s.length>Wk.length){const u=IO(o),c=s.slice(Wk.length);return{type:"attachment",start:n,end:i,attrs:{attId:c,name:u,kind:t?.(c)??(u.endsWith("/")?"folder":"file")},rawDest:s}}if(s.startsWith(gp)&&s.length>gp.length)return{type:"quote",start:n,end:i,attrs:rZ(s.slice(gp.length)),rawDest:s};const l=nI(s);return l===null?null:l==="skill"?{type:"mention",start:n,end:i,attrs:{kind:l,name:sZ(s),path:""},rawDest:s}:{type:"mention",start:n,end:i,attrs:{kind:l,name:IO(o),path:B_e(s,r)},rawDest:s}}const $O=/\[(?:\\.|[^\\[\]\n])*\]\((kimi-code-composer:\/\/quote\/[^\s)]+)\)/g;function $Me(e){const t=[];$O.lastIndex=0;let n;for(;(n=$O.exec(e))!==null;){let i=0;for(let s=n.index-1;s>=0&&e[s]==="\\";s-=1)i+=1;if(i%2===0)continue;const o=n[1];o===void 0||o.length<=gp.length||t.push({type:"quote",start:n.index-1,end:n.index+n[0].length,attrs:rZ(o.slice(gp.length)),rawDest:o})}return t}function h3(e,t){const n=[];for(const i of gZ(e)){const o=BMe(i,t);o&&n.push(o)}return n.push(...$Me(e)),n.sort((i,o)=>i.start-o.start),n}function ih(e){return h3(e).filter(t=>t.type==="mention").map(({start:t,end:n,attrs:i,rawDest:o})=>({start:t,end:n,attrs:i,rawDest:o}))}function cl(e){return h3(e).filter(t=>t.type==="attachment").map(({start:t,end:n,attrs:i,rawDest:o})=>({start:t,end:n,attrs:i,rawDest:o}))}function vZ(e){return h3(e).filter(t=>t.type==="quote").map(({start:t,end:n,attrs:i,rawDest:o})=>({start:t,end:n,attrs:i,rawDest:o}))}function yZ(e,t){const n=h3(e,t);if(n.length===0)return[{type:"text",value:e}];const i=[];let o=0;for(const s of n)s.start>o&&i.push({type:"text",value:e.slice(o,s.start)}),s.type==="mention"?i.push({type:"mention",attrs:s.attrs,rawDest:s.rawDest}):s.type==="attachment"?i.push({type:"attachment",attrs:s.attrs,rawDest:s.rawDest}):i.push({type:"quote",attrs:s.attrs,rawDest:s.rawDest}),o=s.end;return o[l,u+1])),s=new Map(t.mediaAttIds.map((l,u)=>[l,u+1]));let r="",a=0;for(const l of i){r+=e.slice(a,l.start),a=l.end;const{attId:u,name:c,kind:d}=l.attrs,f=d==="folder"?n?.resolveFolder?.(u):void 0;if(f!==void 0){const y=f==="/"||/^[a-zA-Z]:\/$/.test(f)?f.slice(0,-1)||"/":c.endsWith("/")?c.slice(0,-1):c;r+=u1({kind:"folder",name:y,path:f});continue}const h=o.get(u);if(h!==void 0){r+=nh({attId:String(h),name:c});continue}const m=s.get(u);if(m!==void 0){const g=n?.resolveMediaName?.(u,m)??c;r+=nh({attId:`m${m}`,name:g});continue}r+=c}return r+=e.slice(a),r}function zO(e,t,n=0){if(t<=0&&n<=0)return e;const i=cl(e);if(i.length===0)return e;let o="",s=0;for(const r of i){const{attId:a,name:l,kind:u}=r.attrs;let c,d=l;if(t>0&&/^[1-9]\d*$/.test(a))c=String(Number(a)+t);else if(n>0&&/^m[1-9]\d*$/.test(a)){const f=Number(a.slice(1)),h=f+n;c=`m${h}`;const m=` ${f}`;l.endsWith(m)&&(d=`${l.slice(0,-m.length)} ${h}`)}c!==void 0&&(o+=e.slice(s,r.start),s=r.end,o+=nh({attId:c,name:d}))}return o+=e.slice(s),o}function _f(e,t){const n=cl(e);if(n.length===0)return e;let i="",o=0;for(const s of n)i+=e.slice(o,s.start)+(t?.(s.attrs.name)??s.attrs.name),o=s.end;return i+=e.slice(o),i}function jO(e,t){const n=cl(e);if(n.length===0)return e;let i="",o=0;for(const s of n)t.has(s.attrs.attId)||(i+=e.slice(o,s.start)+s.attrs.name,o=s.end);return i+=e.slice(o),i}function T7(e){const t=cl(e);if(t.length===0)return e;let n="",i=0;for(const o of t)n+=e.slice(i,o.start),i=o.end;return n+=e.slice(i),n}let jMe=!0;const HMe=/^> (.*)$/,WMe=/^>$/;function rI(e){return e.replaceAll("%","%25").replaceAll(` +`,"%0A").replaceAll("\r","%0D")}function qMe(e){return e.replaceAll("%0A",` +`).replaceAll("%0D","\r").replaceAll("%25","%")}const UMe=/^from: (.+)$/;function kZ(e){let t=e,n;const i=e.indexOf(` +`),o=UMe.exec(i===-1?e:e.slice(0,i));o!==null&&(n=qMe(o[1]),t=i===-1?"":e.slice(i+1));const s=[];for(const r of t.split(` +`)){const a=HMe.exec(r);if(a!==null){s.push(a[1]??"");continue}if(WMe.test(r)){s.push("");continue}return null}return{text:s.join(` +`),...n!==void 0?{source:n}:{}}}function aI(e){const t=[];for(const i of e.split(/(\n{2,})/)){if(i==="")continue;if(/^\n{2,}$/.test(i)){t.push({type:"sep",text:i});continue}const o=kZ(i);t.push(o===null?{type:"inline",text:i}:{type:"quote",text:o.text,...o.source!==void 0?{source:o.source}:{}})}const n=[];for(let i=0;i`> ${t}`).join(` +`)}function KMe(e){const t=e.split(/(\n{2,})/),n=new Array(t.length).fill(!1);let i=!1;for(let s=t.length-1;s>=0;s-=1){n[s]=i;const r=t[s];r!==""&&!/^\n{2,}$/.test(r)&&(i=!0)}let o="";for(let s=0;s{i.type==="sep"&&i.text===` + +`&&t[o-1]?.type==="quote"&&t[o+1]?.type==="quote"&&n.add(o)}),t.map((i,o)=>{if(n.has(o))return" ";if(i.type!=="quote")return i.text;const s={text:i.text};return i.source!==void 0&&(s.source=i.source),i.comment!==void 0&&(s.comment=i.comment),d3(s)}).join("")}function hr(e){this.content=e}hr.prototype={constructor:hr,find:function(e){for(var t=0;t>1}};hr.from=function(e){if(e instanceof hr)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new hr(t)};function AZ(e,t,n){for(let i=0;;i++){if(i==e.childCount||i==t.childCount)return e.childCount==t.childCount?null:n;let o=e.child(i),s=t.child(i);if(o==s){n+=o.nodeSize;continue}if(!o.sameMarkup(s))return n;if(o.isText&&o.text!=s.text){let r=o.text,a=s.text,l=0;for(;r[l]==a[l];l++)n++;return l&&l0&&f>0&&u[d-1]==c[f-1];)d--,f--,n--,i--;return d&&f&&d=56320&&e<57344}function SZ(e){return e>=55296&&e<56320}class fn{constructor(t,n){if(this.content=t,this.size=n||0,n==null)for(let i=0;it&&i(l,o+a,s||null,r)!==!1&&l.content.size){let c=a+1;l.nodesBetween(Math.max(0,t-c),Math.min(l.content.size,n-c),i,o+c)}a=u}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,i,o){let s="",r=!0;return this.nodesBetween(t,n,(a,l)=>{let u=a.isText?a.text.slice(Math.max(t,l)-l,n-l):a.isLeaf?o?typeof o=="function"?o(a):o:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&u||a.isTextblock)&&i&&(r?r=!1:s+=i),s+=u},0),s}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,i=t.firstChild,o=this.content.slice(),s=0;for(n.isText&&n.sameMarkup(i)&&(o[o.length-1]=n.withText(n.text+i.text),s=1);st)for(let s=0,r=0;rt&&((rn)&&(a.isText?a=a.cut(Math.max(0,t-r),Math.min(a.text.length,n-r)):a=a.cut(Math.max(0,t-r-1),Math.min(a.content.size,n-r-1))),i.push(a),o+=a.nodeSize),r=l}return new fn(i,o)}cutByIndex(t,n){return t==n?fn.empty:t==0&&n==this.content.length?this:new fn(this.content.slice(t,n))}replaceChild(t,n){let i=this.content[t];if(i==n)return this;let o=this.content.slice(),s=this.size+n.nodeSize-i.nodeSize;return o[t]=n,new fn(o,s)}addToStart(t){return new fn([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new fn(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let n=0;nthis.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,i=0;;n++){let o=this.child(n),s=i+o.nodeSize;if(s>=t)return s==t?j9(n+1,s):j9(n,i);i=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,n){if(!n)return fn.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return fn.fromArray(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return fn.empty;let n,i=0;for(let o=0;othis.type.rank&&(n||(n=t.slice(0,o)),n.push(this),i=!0),n&&n.push(s)}}return n||(n=t.slice()),i||n.push(this),n}removeFromSet(t){for(let n=0;ni.type.rank-o.type.rank),n}}ji.none=[];class C2 extends Error{}class bn{constructor(t,n,i){this.content=t,this.openStart=n,this.openEnd=i}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let i=IZ(this.content,t+this.openStart,n,this.openStart+1,this.openEnd+1);return i&&new bn(i,this.openStart,this.openEnd)}removeBetween(t,n){return new bn(_Z(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,n){if(!n)return bn.empty;let i=n.openStart||0,o=n.openEnd||0;if(typeof i!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new bn(fn.fromJSON(t,n.content),i,o)}static maxOpen(t,n=!0){let i=0,o=0;for(let s=t.firstChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.firstChild)i++;for(let s=t.lastChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.lastChild)o++;return new bn(t,i,o)}}bn.empty=new bn(fn.empty,0,0);function _Z(e,t,n){let{index:i,offset:o}=e.findIndex(t),s=e.maybeChild(i),{index:r,offset:a}=e.findIndex(n);if(o==t||s.isText){if(a!=n&&!e.child(r).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(i!=r)throw new RangeError("Removing non-flat range");return e.replaceChild(i,s.copy(_Z(s.content,t-o-1,n-o-1)))}function IZ(e,t,n,i,o,s){let{index:r,offset:a}=e.findIndex(t),l=e.maybeChild(r);if(a==t||l.isText)return s&&i<=0&&o<=0&&!s.canReplace(r,r,n)?null:e.cut(0,t).append(n).append(e.cut(t));let u=IZ(l.content,t-a-1,n,r==0?i-1:0,r==e.childCount-1?o-1:0,l);return u&&e.replaceChild(r,l.copy(u))}function ZMe(e,t,n){if(n.openStart>e.depth)throw new C2("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new C2("Inconsistent open depths");return MZ(e,t,n,0)}function MZ(e,t,n,i){let o=e.index(i),s=e.node(i);if(o==t.index(i)&&i=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function Bv(e,t,n,i){let o=(t||e).node(n),s=0,r=t?t.index(n):o.childCount;e&&(s=e.index(n),e.depth>n?s++:e.textOffset&&(Fp(e.nodeAfter,i),s++));for(let a=s;ao&&E7(e,t,o+1),r=i.depth>o&&E7(n,i,o+1),a=[];return Bv(null,e,o,a),s&&r&&t.index(o)==n.index(o)?(TZ(s,r),Fp(Rp(s,EZ(e,t,n,i,o+1)),a)):(s&&Fp(Rp(s,M4(e,t,o+1)),a),Bv(t,n,o,a),r&&Fp(Rp(r,M4(n,i,o+1)),a)),Bv(i,null,o,a),new fn(a)}function M4(e,t,n){let i=[];if(Bv(null,e,n,i),e.depth>n){let o=E7(e,t,n+1);Fp(Rp(o,M4(e,t,n+1)),i)}return Bv(t,null,n,i),new fn(i)}function GMe(e,t){let n=t.depth-e.openStart,o=t.node(n).copy(e.content);for(let s=n-1;s>=0;s--)o=t.node(s).copy(fn.from(o));return{start:o.resolveNoCache(e.openStart+n),end:o.resolveNoCache(o.content.size-e.openEnd-n)}}class x2{constructor(t,n,i){this.pos=t,this.path=n,this.parentOffset=i,this.depth=n.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,n=this.index(this.depth);if(n==t.childCount)return null;let i=this.pos-this.path[this.path.length-1],o=t.child(n);return i?t.child(n).cut(i):o}get nodeBefore(){let t=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(t).cut(0,n):t==0?null:this.parent.child(t-1)}posAtIndex(t,n){n=this.resolveDepth(n);let i=this.path[n*3],o=n==0?0:this.path[n*3-1]+1;for(let s=0;s0;n--)if(this.start(n)<=t&&this.end(n)>=t)return n;return 0}blockRange(t=this,n){if(t.pos=0;i--)if(t.pos<=this.end(i)&&(!n||n(this.node(i))))return new JMe(this,t,i);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");let i=[],o=0,s=n;for(let r=t;;){let{index:a,offset:l}=r.content.findIndex(s),u=s-l;if(i.push(r,a,o+l),!u||(r=r.child(a),r.isText))break;s=u-1,o+=l+1}return new x2(n,i,s)}static resolveCached(t,n){let i=HO.get(t);if(i)for(let s=0;st&&this.nodesBetween(t,n,s=>(i.isInSet(s.marks)&&(o=!0),!o)),o}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),LZ(this.marks,t)}contentMatchAt(t){let n=this.type.contentMatch.matchFragment(this.content,0,t);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(t,n,i=fn.empty,o=0,s=i.childCount){let r=this.contentMatchAt(t).matchFragment(i,o,s),a=r&&r.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=o;ln.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(n=>n.toJSON())),t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let i;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");i=n.marks.map(t.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(n.text,i)}let o=fn.fromJSON(t,n.content),s=t.nodeType(n.type).create(n.attrs,o,i);return s.type.checkAttrs(s.attrs),s}};Dp.prototype.text=void 0;class T4 extends Dp{constructor(t,n,i,o){if(super(t,n,null,o),!i)throw new RangeError("Empty text nodes are not allowed");this.text=i}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):LZ(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,n){return this.text.slice(t,n)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new T4(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new T4(this.type,this.attrs,t,this.marks)}cut(t=0,n=this.text.length){return t==0&&n==this.text.length?this:this.withText(this.text.slice(t,n))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function LZ(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class Gp{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let i=new eTe(t,n);if(i.next==null)return Gp.empty;let o=NZ(i);i.next&&i.err("Unexpected trailing text");let s=aTe(rTe(o));return lTe(s,i),s}matchType(t){for(let n=0;nu.createAndFill()));for(let u=0;u=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function n(i){t.push(i);for(let o=0;o{let s=o+(i.validEnd?"*":" ")+" ";for(let r=0;r"+t.indexOf(i.next[r].next);return s}).join(` +`)}}Gp.empty=new Gp(!0);class eTe{constructor(t,n){this.string=t,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function NZ(e){let t=[];do t.push(tTe(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function tTe(e){let t=[];do t.push(nTe(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function nTe(e){let t=sTe(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else if(e.eat("{"))t=iTe(e,t);else break;return t}function WO(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function iTe(e,t){let n=WO(e),i=n;return e.eat(",")&&(e.next!="}"?i=WO(e):i=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:i,expr:t}}function oTe(e,t){let n=e.nodeTypes,i=n[t];if(i)return[i];let o=[];for(let s in n){let r=n[s];r.isInGroup(t)&&o.push(r)}return o.length==0&&e.err("No node type or group '"+t+"' found"),o}function sTe(e){if(e.eat("(")){let t=NZ(e);return e.eat(")")||e.err("Missing closing paren"),t}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=oTe(e,e.next).map(n=>(e.inline==null?e.inline=n.isInline:e.inline!=n.isInline&&e.err("Mixing inline and block content"),{type:"name",value:n}));return e.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function rTe(e){let t=[[]];return o(s(e,0),n()),t;function n(){return t.push([])-1}function i(r,a,l){let u={term:l,to:a};return t[r].push(u),u}function o(r,a){r.forEach(l=>l.to=a)}function s(r,a){if(r.type=="choice")return r.exprs.reduce((l,u)=>l.concat(s(u,a)),[]);if(r.type=="seq")for(let l=0;;l++){let u=s(r.exprs[l],a);if(l==r.exprs.length-1)return u;o(u,a=n())}else if(r.type=="star"){let l=n();return i(a,l),o(s(r.expr,l),l),[i(l)]}else if(r.type=="plus"){let l=n();return o(s(r.expr,a),l),o(s(r.expr,l),l),[i(l)]}else{if(r.type=="opt")return[i(a)].concat(s(r.expr,a));if(r.type=="range"){let l=a;for(let u=0;u{e[r].forEach(({term:a,to:l})=>{if(!a)return;let u;for(let c=0;c{u||o.push([a,u=[]]),u.indexOf(c)==-1&&u.push(c)})})});let s=t[i.join(",")]=new Gp(i.indexOf(e.length-1)>-1);for(let r=0;r-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:DZ(this.attrs,t)}create(t=null,n,i){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Dp(this,this.computeAttrs(t),fn.from(n),ji.setFrom(i))}createChecked(t=null,n,i){return n=fn.from(n),this.checkContent(n),new Dp(this,this.computeAttrs(t),n,ji.setFrom(i))}createAndFill(t=null,n,i){if(t=this.computeAttrs(t),n=fn.from(n),n.size){let r=this.contentMatch.fillBefore(n);if(!r)return null;n=r.append(n)}let o=this.contentMatch.matchFragment(n),s=o&&o.fillBefore(fn.empty,!0);return s?new Dp(this,t,n.append(s),ji.setFrom(i)):null}validContent(t){let n=this.contentMatch.matchFragment(t);if(!n||!n.validEnd)return!1;for(let i=0;i-1}allowsMarks(t){if(this.markSet==null)return!0;for(let n=0;ni[s]=new BZ(s,n,r));let o=n.spec.topNode||"doc";if(!i[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!i.text)throw new RangeError("Every schema needs a 'text' type");for(let s in i.text.attrs)throw new RangeError("The text node type should not have attributes");return i}};function uTe(e,t,n){let i=n.split("|");return o=>{let s=o===null?"null":typeof o;if(i.indexOf(s)<0)throw new RangeError(`Expected value of type ${i} for attribute ${t} on type ${e}, got ${s}`)}}class cTe{constructor(t,n,i){this.hasDefault=Object.prototype.hasOwnProperty.call(i,"default"),this.default=i.default,this.validate=typeof i.validate=="string"?uTe(t,n,i.validate):i.validate}get isRequired(){return!this.hasDefault}}class p3{constructor(t,n,i,o){this.name=t,this.rank=n,this.schema=i,this.spec=o,this.attrs=PZ(t,o.attrs),this.excluded=null;let s=RZ(this.attrs);this.instance=s?new ji(this,s):null}create(t=null){return!t&&this.instance?this.instance:new ji(this,DZ(this.attrs,t))}static compile(t,n){let i=Object.create(null),o=0;return t.forEach((s,r)=>i[s]=new p3(s,o++,n,r)),i}removeFromSet(t){for(var n=0;n-1}}class dTe{constructor(t){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let o in t)n[o]=t[o];n.nodes=hr.from(t.nodes),n.marks=hr.from(t.marks||{}),this.nodes=UO.compile(this.spec.nodes,this),this.marks=p3.compile(this.spec.marks,this);let i=Object.create(null);for(let o in this.nodes){if(o in this.marks)throw new RangeError(o+" can not be both a node and a mark");let s=this.nodes[o],r=s.spec.content||"",a=s.spec.marks;if(s.contentMatch=i[r]||(i[r]=Gp.parse(r,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=a=="_"?null:a?VO(this,a.split(" ")):a==""||!s.inlineContent?[]:null}for(let o in this.marks){let s=this.marks[o],r=s.spec.excludes;s.excluded=r==null?[s]:r==""?[]:VO(this,r.split(" "))}this.nodeFromJSON=o=>Dp.fromJSON(this,o),this.markFromJSON=o=>ji.fromJSON(this,o),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,n=null,i,o){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof UO){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(n,i,o)}text(t,n){let i=this.nodes.text;return new T4(i,i.defaultAttrs,t,ji.setFrom(n))}mark(t,n){return typeof t=="string"&&(t=this.marks[t]),t.create(n)}nodeType(t){let n=this.nodes[t];if(!n)throw new RangeError("Unknown node type: "+t);return n}}function VO(e,t){let n=[];for(let i=0;i-1)&&n.push(r=l)}if(!r)throw new SyntaxError("Unknown mark type: '"+t[i]+"'")}return n}function fTe(e){return e.tag!=null}function hTe(e){return e.style!=null}let $Z=class N7{constructor(t,n){this.schema=t,this.rules=n,this.tags=[],this.styles=[];let i=this.matchedStyles=[];n.forEach(o=>{if(fTe(o))this.tags.push(o);else if(hTe(o)){let s=/[^=]*/.exec(o.style)[0];i.indexOf(s)<0&&i.push(s),this.styles.push(o)}}),this.normalizeLists=!this.tags.some(o=>{if(!/^(ul|ol)\b/.test(o.tag)||!o.node)return!1;let s=t.nodes[o.node];return s.contentMatch.matchType(s)})}parse(t,n={}){let i=new ZO(this,n,!1);return i.addAll(t,ji.none,n.from,n.to),i.finish()}parseSlice(t,n={}){let i=new ZO(this,n,!0);return i.addAll(t,ji.none,n.from,n.to),bn.maxOpen(i.finish())}matchTag(t,n,i){for(let o=i?this.tags.indexOf(i)+1:0;ot.length&&(a.charCodeAt(t.length)!=61||a.slice(t.length+1)!=n))){if(r.getAttrs){let l=r.getAttrs(n);if(l===!1)continue;r.attrs=l||void 0}return r}}}static schemaRules(t){let n=[];function i(o){let s=o.priority==null?50:o.priority,r=0;for(;r{i(r=GO(r)),r.mark||r.ignore||r.clearMark||(r.mark=o)})}for(let o in t.nodes){let s=t.nodes[o].spec.parseDOM;s&&s.forEach(r=>{i(r=GO(r)),r.node||r.ignore||r.mark||(r.node=o)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new N7(t,N7.schemaRules(t)))}};const zZ={address:!0,article:!0,aside:!0,blockquote:!0,body:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},pTe={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},jZ={ol:!0,ul:!0},S2=1,F7=2,$v=4;function KO(e,t,n){return t!=null?(t?S2:0)|(t==="full"?F7:0):e&&e.whitespace=="pre"?S2|F7:n&~$v}class H9{constructor(t,n,i,o,s,r){this.type=t,this.attrs=n,this.marks=i,this.solid=o,this.options=r,this.content=[],this.activeMarks=ji.none,this.match=s||(r&$v?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(fn.from(t));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let i=this.type.contentMatch,o;return(o=i.findWrapping(t.type))?(this.match=i,o):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&S2)){let i=this.content[this.content.length-1],o;if(i&&i.isText&&(o=/[ \t\r\n\u000c]+$/.exec(i.text))){let s=i;i.text.length==o[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-o[0].length))}}let n=fn.from(this.content);return!t&&this.match&&(n=n.append(this.match.fillBefore(fn.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!zZ.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class ZO{constructor(t,n,i){this.parser=t,this.options=n,this.isOpen=i,this.open=0,this.localPreserveWS=!1;let o=n.topNode,s,r=KO(null,n.preserveWhitespace,0)|(i?$v:0);o?s=new H9(o.type,o.attrs,ji.none,!0,n.topMatch||o.type.contentMatch,r):i?s=new H9(null,null,ji.none,!0,null,r):s=new H9(t.schema.topNodeType,null,ji.none,!0,null,r),this.nodes=[s],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t,n){t.nodeType==3?this.addTextNode(t,n):t.nodeType==1&&this.addElement(t,n)}addTextNode(t,n){let i=t.nodeValue,o=this.top,s=o.options&F7?"full":this.localPreserveWS||(o.options&S2)>0,{schema:r}=this.parser;if(s==="full"||o.inlineContext(t)||/[^ \t\r\n\u000c]/.test(i)){if(s)if(s==="full")i=i.replace(/\r\n?/g,` +`);else if(r.linebreakReplacement&&/[\r\n]/.test(i)&&this.top.findWrapping(r.linebreakReplacement.create())){let a=i.split(/\r?\n|\r/);for(let l=0;l!l.clearMark(u)):n=n.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)a=l;else break}}return n}addElementByRule(t,n,i,o){let s,r;if(n.node)if(r=this.parser.schema.nodes[n.node],r.isLeaf)this.insertNode(r.create(n.attrs),i,t.nodeName=="BR")||this.leafFallback(t,i);else{let l=this.enter(r,n.attrs||null,i,n.preserveWhitespace);l&&(s=!0,i=l)}else{let l=this.parser.schema.marks[n.mark];i=i.concat(l.create(n.attrs))}let a=this.top;if(r&&r.isLeaf)this.findInside(t);else if(o)this.addElement(t,i,o);else if(n.getContent)this.findInside(t),n.getContent(t,this.parser.schema).forEach(l=>this.insertNode(l,i,!1));else{let l=t;typeof n.contentElement=="string"?l=t.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(t):n.contentElement&&(l=n.contentElement),this.findAround(t,l,!0),this.addAll(l,i),this.findAround(t,l,!1)}s&&this.sync(a)&&this.open--}addAll(t,n,i,o){let s=i||0;for(let r=i?t.childNodes[i]:t.firstChild,a=o==null?null:t.childNodes[o];r!=a;r=r.nextSibling,++s)this.findAtPoint(t,s),this.addDOM(r,n);this.findAtPoint(t,s)}findPlace(t,n,i){let o,s;for(let r=this.open,a=0;r>=0;r--){let l=this.nodes[r],u=l.findWrapping(t);if(u&&(!o||o.length>u.length+a)&&(o=u,s=l,!u.length))break;if(l.solid){if(i)break;a+=2}}if(!o)return null;this.sync(s);for(let r=0;r(r.type?r.type.allowsMarkType(u.type):QO(u.type,t))?(l=u.addToSet(l),!1):!0),this.nodes.push(new H9(t,n,l,o,null,a)),this.open++,i}closeExtra(t=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(t){for(let n=this.open;n>=0;n--){if(this.nodes[n]==t)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=S2)}return!1}get currentPos(){this.closeExtra();let t=0;for(let n=this.open;n>=0;n--){let i=this.nodes[n].content;for(let o=i.length-1;o>=0;o--)t+=i[o].nodeSize;n&&t++}return t}findAtPoint(t,n){if(this.find)for(let i=0;i-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let n=t.split("/"),i=this.options.context,o=!this.isOpen&&(!i||i.parent.type==this.nodes[0].type),s=-(i?i.depth+1:0)+(o?0:1),r=(a,l)=>{for(;a>=0;a--){let u=n[a];if(u==""){if(a==n.length-1||a==0)continue;for(;l>=s;l--)if(r(a-1,l))return!0;return!1}else{let c=l>0||l==0&&o?this.nodes[l].type:i&&l>=s?i.node(l-s).type:null;if(!c||c.name!=u&&!c.isInGroup(u))return!1;l--}}return!0};return r(n.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let n=t.depth;n>=0;n--){let i=t.node(n).contentMatchAt(t.indexAfter(n)).defaultType;if(i&&i.isTextblock&&i.defaultAttrs)return i}for(let n in this.parser.schema.nodes){let i=this.parser.schema.nodes[n];if(i.isTextblock&&i.defaultAttrs)return i}}}function mTe(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let i=t.nodeType==1?t.nodeName.toLowerCase():null;i&&jZ.hasOwnProperty(i)&&n?(n.appendChild(t),t=n):i=="li"?n=t:i&&(n=null)}}function gTe(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function GO(e){let t={};for(let n in e)t[n]=e[n];return t}function QO(e,t){let n=t.schema.nodes;for(let i in n){let o=n[i];if(!o.allowsMarkType(e))continue;let s=[],r=a=>{s.push(a);for(let l=0;l{if(s.length||r.marks.length){let a=0,l=0;for(;a=0;o--){let s=this.serializeMark(t.marks[o],t.isInline,n);s&&((s.contentDOM||s.dom).appendChild(i),i=s.dom)}return i}serializeMark(t,n,i={}){let o=this.marks[t.type.name];return o&&Uk(W9(i),o(t,n),null,t.attrs)}static renderSpec(t,n,i=null,o){return typeof n=="string"?{dom:t.createTextNode(n)}:Uk(t,n,i,o)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new Lc(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=YO(t.nodes);return n.text||(n.text=i=>i.text),n}static marksFromSchema(t){return YO(t.marks)}}function YO(e){let t={};for(let n in e){let i=e[n].spec.toDOM;i&&(t[n]=i)}return t}function W9(e){return e.document||window.document}const JO=new WeakMap;function vTe(e){let t=JO.get(e);return t===void 0&&JO.set(e,t=yTe(e)),t}function yTe(e){let t=null;function n(i){if(i&&typeof i=="object")if(Array.isArray(i))if(typeof i[0]=="string")t||(t=[]),t.push(i);else for(let o=0;o-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let r=o.indexOf(" ");r>0&&(n=o.slice(0,r),o=o.slice(r+1));let a,l=n?e.createElementNS(n,o):e.createElement(o),u=t[1],c=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){c=2;for(let d in u)if(u[d]!=null){let f=d.indexOf(" ");f>0?l.setAttributeNS(d.slice(0,f),d.slice(f+1),u[d]):d=="style"&&l.style?l.style.cssText=u[d]:l.setAttribute(d,u[d])}}for(let d=c;dc)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else if(typeof f=="string")l.appendChild(e.createTextNode(f));else{let{dom:h,contentDOM:m}=Uk(e,f,n,i);if(l.appendChild(h),m){if(a)throw new RangeError("Multiple content holes");a=m}}}return{dom:l,contentDOM:a}}const ei=new dTe({nodes:{doc:{content:"block+"},paragraph:{group:"block",content:"inline*",toDOM:()=>["p",0],parseDOM:[{tag:"p"}]},text:{group:"inline"},mention:{group:"inline",inline:!0,atom:!0,selectable:!0,attrs:{kind:{},name:{},path:{default:""}},leafText:e=>u1(e.attrs),toDOM:e=>{const t=e.attrs;return["span",{class:`mention-pill mention-${t.kind}`,"data-mention-path":t.path},t.name]}},attachment:{group:"inline",inline:!0,atom:!0,selectable:!0,attrs:{attId:{},name:{},kind:{}},leafText:e=>nh(e.attrs),toDOM:e=>{const t=e.attrs;return["span",{class:`attachment-pill attachment-${t.kind}`,"data-attachment-id":t.attId,"data-attachment-kind":t.kind,"data-attachment-name":t.name},t.name]}},quote:{group:"inline",inline:!0,atom:!0,selectable:!0,attrs:{text:{},comment:{default:""},source:{default:""}},leafText:e=>d3(e.attrs),toDOM:e=>{const t=e.attrs,n={class:"quote-pill","data-quote-text":t.text};return typeof t.comment=="string"&&t.comment.length>0&&(n["data-quote-comment"]=t.comment),typeof t.source=="string"&&t.source.length>0&&(n["data-quote-source"]=t.source),["span",n,ng(t.text)]}}}});function HZ(e){return ei.nodes.mention.create(e)}function WZ(e){return ei.nodes.attachment.create(e)}function qZ(e){return ei.nodes.quote.create(e)}function kTe(e,t){return e?yZ(e,t).map(n=>n.type==="mention"?HZ(n.attrs):n.type==="attachment"?WZ(n.attrs):n.type==="quote"?qZ(n.attrs):ei.text(n.value)):[]}function _2(e,t){const n=e.split(` +`);return ei.node("doc",null,n.map(i=>i?ei.node("paragraph",null,t?.reviveMentions?kTe(i,t?.attachmentKindFor):ei.text(i)):ei.node("paragraph")))}function I2(e){return e.textBetween(0,e.content.size,` +`)}const UZ=65535,VZ=Math.pow(2,16);function bTe(e,t){return e+t*VZ}function XO(e){return e&UZ}function wTe(e){return(e-(e&UZ))/VZ}const KZ=1,ZZ=2,Vk=4,GZ=8;class R7{constructor(t,n,i){this.pos=t,this.delInfo=n,this.recover=i}get deleted(){return(this.delInfo&GZ)>0}get deletedBefore(){return(this.delInfo&(KZ|Vk))>0}get deletedAfter(){return(this.delInfo&(ZZ|Vk))>0}get deletedAcross(){return(this.delInfo&Vk)>0}}class Da{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&Da.empty)return Da.empty}recover(t){let n=0,i=XO(t);if(!this.inverted)for(let o=0;ot)break;let u=this.ranges[a+s],c=this.ranges[a+r],d=l+u;if(t<=d){let f=u?t==l?-1:t==d?1:n:n,h=l+o+(f<0?0:c);if(i)return h;let m=t==(n<0?l:d)?null:bTe(a/3,t-l),g=t==l?ZZ:t==d?KZ:Vk;return(n<0?t!=l:t!=d)&&(g|=GZ),new R7(h,g,m)}o+=c-u}return i?t+o:new R7(t+o,0,null)}touches(t,n){let i=0,o=XO(n),s=this.inverted?2:1,r=this.inverted?1:2;for(let a=0;at)break;let u=this.ranges[a+s],c=l+u;if(t<=c&&a==o*3)return!0;i+=this.ranges[a+r]-u}return!1}forEach(t){let n=this.inverted?2:1,i=this.inverted?1:2;for(let o=0,s=0;o=0;n--){let o=t.getMirror(n);this.appendMap(t._maps[n].invert(),o!=null&&o>n?i-o-1:void 0)}}invert(){let t=new M2;return t.appendMappingInverted(this),t}map(t,n=1){if(this.mirror)return this._map(t,n,!0);for(let i=this.from;is&&l!r.isAtom||!a.type.allowsMarkType(this.mark.type)?r:r.mark(this.mark.addToSet(r.marks)),o),n.openStart,n.openEnd);return ns.fromReplace(t,this.from,this.to,s)}invert(){return new Sc(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),i=t.mapResult(this.to,-1);return n.deleted&&i.deleted||n.pos>=i.pos?null:new If(n.pos,i.pos,this.mark)}merge(t){return t instanceof If&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new If(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new If(n.from,n.to,t.markFromJSON(n.mark))}}Js.jsonID("addMark",If);class Sc extends Js{constructor(t,n,i){super(),this.from=t,this.to=n,this.mark=i}apply(t){let n=t.slice(this.from,this.to),i=new bn(lI(n.content,o=>o.mark(this.mark.removeFromSet(o.marks)),t),n.openStart,n.openEnd);return ns.fromReplace(t,this.from,this.to,i)}invert(){return new If(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),i=t.mapResult(this.to,-1);return n.deleted&&i.deleted||n.pos>=i.pos?null:new Sc(n.pos,i.pos,this.mark)}merge(t){return t instanceof Sc&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Sc(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Sc(n.from,n.to,t.markFromJSON(n.mark))}}Js.jsonID("removeMark",Sc);class Mf extends Js{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return ns.fail("No node at mark step's position");let i=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return ns.fromReplace(t,this.pos,this.pos+1,new bn(fn.from(i),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let i=this.mark.addToSet(n.marks);if(i.length==n.marks.length){for(let o=0;oi.pos?null:new yl(n.pos,i.pos,o,s,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new yl(n.from,n.to,n.gapFrom,n.gapTo,bn.fromJSON(t,n.slice),n.insert,!!n.structure)}}Js.jsonID("replaceAround",yl);function D7(e,t,n){let i=e.resolve(t),o=n-t,s=i.depth;for(;o>0&&s>0&&i.indexAfter(s)==i.node(s).childCount;)s--,o--;if(o>0){let r=i.node(s).maybeChild(i.indexAfter(s));for(;o>0;){if(!r||r.isLeaf)return!0;r=r.firstChild,o--}}return!1}function ATe(e,t,n,i){let o=[],s=[],r,a;e.doc.nodesBetween(t,n,(l,u,c)=>{if(!l.isInline)return;let d=l.marks;if(!i.isInSet(d)&&c.type.allowsMarkType(i.type)){let f=Math.max(u,t),h=Math.min(u+l.nodeSize,n),m=i.addToSet(d);for(let g=0;ge.step(l)),s.forEach(l=>e.step(l))}function CTe(e,t,n,i){let o=[],s=0;e.doc.nodesBetween(t,n,(r,a)=>{if(!r.isInline)return;s++;let l=null;if(i instanceof p3){let u=r.marks,c;for(;c=i.isInSet(u);)(l||(l=[])).push(c),u=c.removeFromSet(u)}else i?i.isInSet(r.marks)&&(l=[i]):l=r.marks;if(l&&l.length){let u=Math.min(a+r.nodeSize,n);for(let c=0;ce.step(new Sc(r.from,r.to,r.style)))}function uI(e,t,n,i=n.contentMatch,o=!0){let s=e.doc.nodeAt(t),r=[],a=t+1;for(let l=0;l=0;l--)e.step(r[l])}function xTe(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function cI(e){let n=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let i=e.depth,o=0,s=0;;--i){let r=e.$from.node(i),a=e.$from.index(i)+o,l=e.$to.indexAfter(i)-s;if(in;m--)g||i.index(m)>0?(g=!0,c=fn.from(i.node(m).copy(c)),d++):l--;let f=fn.empty,h=0;for(let m=s,g=!1;m>n;m--)g||o.after(m+1)=0;r--){if(i.size){let a=n[r].type.contentMatch.matchFragment(i);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}i=fn.from(n[r].type.create(n[r].attrs,i))}let o=t.start,s=t.end;e.step(new yl(o,s,o,s,new bn(i,0,0),n.length,!0))}function ITe(e,t,n,i,o){if(!i.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=e.steps.length;e.doc.nodesBetween(t,n,(r,a)=>{let l=typeof o=="function"?o(r):o;if(r.isTextblock&&!r.hasMarkup(i,l)&&MTe(e.doc,e.mapping.slice(s).map(a),i)){let u=null;if(i.schema.linebreakReplacement){let h=i.whitespace=="pre",m=!!i.contentMatch.matchType(i.schema.linebreakReplacement);h&&!m?u=!1:!h&&m&&(u=!0)}u===!1&&YZ(e,r,a,s),uI(e,e.mapping.slice(s).map(a,1),i,void 0,u===null);let c=e.mapping.slice(s),d=c.map(a,1),f=c.map(a+r.nodeSize,1);return e.step(new yl(d,f,d+1,f-1,new bn(fn.from(i.create(l,null,r.marks)),0,0),1,!0)),u===!0&&QZ(e,r,a,s),!1}})}function QZ(e,t,n,i){t.forEach((o,s)=>{if(o.isText){let r,a=/\r?\n|\r/g;for(;r=a.exec(o.text);){let l=e.mapping.slice(i).map(n+1+s+r.index);e.replaceWith(l,l+1,t.type.schema.linebreakReplacement.create())}}})}function YZ(e,t,n,i){t.forEach((o,s)=>{if(o.type==o.type.schema.linebreakReplacement){let r=e.mapping.slice(i).map(n+1+s);e.replaceWith(r,r+1,t.type.schema.text(` +`))}})}function MTe(e,t,n){let i=e.resolve(t),o=i.index();return i.parent.canReplaceWith(o,o+1,n)}function TTe(e,t,n,i,o){let s=e.doc.nodeAt(t);if(!s)throw new RangeError("No node at given position");n||(n=s.type);let r=n.create(i,null,o||s.marks);if(s.isLeaf)return e.replaceWith(t,t+s.nodeSize,r);if(!n.validContent(s.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new yl(t,t+s.nodeSize,t+1,t+s.nodeSize-1,new bn(fn.from(r),0,0),1,!0))}function Kk(e,t,n=1,i){let o=e.resolve(t),s=o.depth-n,r=i&&i[i.length-1]||o.parent;if(s<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!r.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let u=o.depth-1,c=n-2;u>s;u--,c--){let d=o.node(u),f=o.index(u);if(d.type.spec.isolating)return!1;let h=d.content.cutByIndex(f,d.childCount),m=i&&i[c+1];m&&(h=h.replaceChild(0,m.type.create(m.attrs)));let g=i&&i[c]||d;if(!d.canReplace(f+1,d.childCount)||!g.type.validContent(h))return!1}let a=o.indexAfter(s),l=i&&i[0];return o.node(s).canReplaceWith(a,a,l?l.type:o.node(s+1).type)}function ETe(e,t,n=1,i){let o=e.doc.resolve(t),s=fn.empty,r=fn.empty;for(let a=o.depth,l=o.depth-n,u=n-1;a>l;a--,u--){s=fn.from(o.node(a).copy(s));let c=i&&i[u];r=fn.from(c?c.type.create(c.attrs,r):o.node(a).copy(r))}e.step(new Gs(t,t,new bn(s.append(r),n,n),!0))}function JZ(e,t){let n=e.resolve(t),i=n.index();return NTe(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(i,i+1)}function LTe(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:i}=e.type.schema;for(let o=0;o=0;o--){let s=i.index(o);if(i.node(o).canReplaceWith(s,s,n))return i.before(o+1);if(s>0)return null}if(i.parentOffset==i.parent.content.size)for(let o=i.depth-1;o>=0;o--){let s=i.indexAfter(o);if(i.node(o).canReplaceWith(s,s,n))return i.after(o+1);if(s=0;r--){let a=r==i.depth?0:i.pos<=(i.start(r+1)+i.end(r+1))/2?-1:1,l=i.index(r)+(a>0?1:0),u=i.node(r),c=!1;if(s==1)c=u.canReplace(l,l,o);else{let d=u.contentMatchAt(l).findWrapping(o.firstChild.type);c=d&&u.canReplaceWith(l,l,d[0])}if(c)return a==0?i.pos:a<0?i.before(r+1):i.after(r+1)}return null}function dI(e,t,n=t,i=bn.empty){if(t==n&&!i.size)return null;let o=e.resolve(t),s=e.resolve(n);return XZ(o,s,i)?new Gs(t,n,i):new OTe(o,s,i).fit()}function XZ(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}class OTe{constructor(t,n,i){this.$from=t,this.$to=n,this.unplaced=i,this.frontier=[],this.placed=fn.empty;for(let o=0;o<=t.depth;o++){let s=t.node(o);this.frontier.push({type:s.type,match:s.contentMatchAt(t.indexAfter(o))})}for(let o=t.depth;o>0;o--)this.placed=fn.from(t.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,i=this.$from,o=this.close(t<0?this.$to:i.doc.resolve(t));if(!o)return null;let s=this.placed,r=i.depth,a=o.depth;for(;r&&a&&s.childCount==1;)s=s.firstChild.content,r--,a--;let l=new bn(s,r,a);return t>-1?new yl(i.pos,t,this.$to.pos,this.$to.end(),l,n):l.size||i.pos!=this.$to.pos?new Gs(i.pos,o.pos,l):null}findFittable(){let t=this.unplaced.openStart;for(let n=this.unplaced.content,i=0,o=this.unplaced.openEnd;i1&&(o=0),s.type.spec.isolating&&o<=i){t=i;break}n=s.content}for(let n=1;n<=2;n++)for(let i=n==1?t:this.unplaced.openStart;i>=0;i--){let o,s=null;i?(s=rA(this.unplaced.content,i-1).firstChild,o=s.content):o=this.unplaced.content;let r=o.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:u}=this.frontier[a],c,d=null;if(n==1&&(r?u.matchType(r.type)||(d=u.fillBefore(fn.from(r),!1)):s&&l.compatibleContent(s.type)))return{sliceDepth:i,frontierDepth:a,parent:s,inject:d};if(n==2&&r&&(c=u.findWrapping(r.type)))return{sliceDepth:i,frontierDepth:a,parent:s,wrap:c};if(s&&u.matchType(s.type))break}}}openMore(){let{content:t,openStart:n,openEnd:i}=this.unplaced,o=rA(t,n);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new bn(t,n+1,Math.max(i,o.size+n>=t.size-i?n+1:0)),!0)}dropNode(){let{content:t,openStart:n,openEnd:i}=this.unplaced,o=rA(t,n);if(o.childCount<=1&&n>0){let s=t.size-n<=n+o.size;this.unplaced=new bn(Q0(t,n-1,1),n-1,s?n-1:i)}else this.unplaced=new bn(Q0(t,n,1),n,i)}placeNodes({sliceDepth:t,frontierDepth:n,parent:i,inject:o,wrap:s}){for(;this.depth>n;)this.closeFrontierNode();if(s)for(let g=0;g1||l==0||g.content.size)&&(d=y,c.push(eG(g.mark(f.allowedMarks(g.marks)),u==1?l:0,u==a.childCount?h:-1)))}let m=u==a.childCount;m||(h=-1),this.placed=Y0(this.placed,n,fn.from(c)),this.frontier[n].match=d,m&&h<0&&i&&i.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,y=a;g1&&o==this.$to.end(--i);)++o;return o}findCloseLevel(t){e:for(let n=Math.min(this.depth,t.depth);n>=0;n--){let{match:i,type:o}=this.frontier[n],s=n=0;a--){let{match:l,type:u}=this.frontier[a],c=aA(t,a,u,l,!0);if(!c||c.childCount)continue e}return{depth:n,fit:r,move:s?t.doc.resolve(t.after(n+1)):t}}}}close(t){let n=this.findCloseLevel(t);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Y0(this.placed,n.depth,n.fit)),t=n.move;for(let i=n.depth+1;i<=t.depth;i++){let o=t.node(i),s=o.type.contentMatch.fillBefore(o.content,!0,t.index(i));this.openFrontierNode(o.type,o.attrs,s)}return t}openFrontierNode(t,n=null,i){let o=this.frontier[this.depth];o.match=o.match.matchType(t),this.placed=Y0(this.placed,this.depth,fn.from(t.create(n,i))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(fn.empty,!0);n.childCount&&(this.placed=Y0(this.placed,this.frontier.length,n))}}function Q0(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(Q0(e.firstChild.content,t-1,n)))}function Y0(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(Y0(e.lastChild.content,t-1,n)))}function rA(e,t){for(let n=0;n1&&(i=i.replaceChild(0,eG(i.firstChild,t-1,i.childCount==1?n-1:0))),t>0&&(i=e.type.contentMatch.fillBefore(i).append(i),n<=0&&(i=i.append(e.type.contentMatch.matchFragment(i).fillBefore(fn.empty,!0)))),e.copy(i)}function aA(e,t,n,i,o){let s=e.node(t),r=o?e.indexAfter(t):e.index(t);if(r==s.childCount&&!n.compatibleContent(s.type))return null;let a=i.fillBefore(s.content,!0,r);return a&&!PTe(n,s.content,r)?a:null}function PTe(e,t,n){for(let i=n;i0;f--,h--){let m=o.node(f).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;r.indexOf(f)>-1?a=f:o.before(f)==h&&r.splice(1,0,-f)}let l=r.indexOf(a),u=[],c=i.openStart;for(let f=i.content,h=0;;h++){let m=f.firstChild;if(u.push(m),h==i.openStart)break;f=m.content}for(let f=c-1;f>=0;f--){let h=u[f],m=BTe(h.type);if(m&&!h.sameMarkup(o.node(Math.abs(a)-1)))c=f;else if(m||!h.type.isTextblock)break}for(let f=i.openStart;f>=0;f--){let h=(f+c+1)%(i.openStart+1),m=u[h];if(m)for(let g=0;g=0&&(e.replace(t,n,i),!(e.steps.length>d));f--){let h=r[f];h<0||(t=o.before(h),n=s.after(h))}}function tG(e,t,n,i,o){if(ti){let s=o.contentMatchAt(0),r=s.fillBefore(e).append(e);e=r.append(s.matchFragment(r).fillBefore(fn.empty,!0))}return e}function zTe(e,t,n,i){if(!i.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let o=RTe(e.doc,t,i.type);o!=null&&(t=n=o)}e.replaceRange(t,n,new bn(fn.from(i),0,0))}function jTe(e,t,n){let i=e.doc.resolve(t),o=e.doc.resolve(n);if(i.parent.isTextblock&&o.parent.isTextblock&&i.start()!=o.start()&&i.parentOffset==0&&o.parentOffset==0){let r=i.sharedDepth(n),a=!1;for(let l=i.depth;l>r;l--)i.node(l).type.spec.isolating&&(a=!0);for(let l=o.depth;l>r;l--)o.node(l).type.spec.isolating&&(a=!0);if(!a){for(let l=i.depth;l>0&&t==i.start(l);l--)t=i.before(l);for(let l=o.depth;l>0&&n==o.start(l);l--)n=o.before(l);i=e.doc.resolve(t),o=e.doc.resolve(n)}}let s=nG(i,o);for(let r=0;r0&&(l||i.node(a-1).canReplace(i.index(a-1),o.indexAfter(a-1))))return e.delete(i.before(a),o.after(a))}for(let r=1;r<=i.depth&&r<=o.depth;r++)if(t-i.start(r)==i.depth-r&&n>i.end(r)&&o.end(r)-n!=o.depth-r&&i.start(r-1)==o.start(r-1)&&i.node(r-1).canReplace(i.index(r-1),o.index(r-1)))return e.delete(i.before(r),n);e.delete(t,n)}function nG(e,t){let n=[],i=Math.min(e.depth,t.depth);for(let o=i;o>=0;o--){let s=e.start(o);if(st.pos+(t.depth-o)||e.node(o).type.spec.isolating||t.node(o).type.spec.isolating)break;(s==t.start(o)||o==e.depth&&o==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&o&&t.start(o-1)==s-1)&&n.push(o)}return n}class Bm extends Js{constructor(t,n,i){super(),this.pos=t,this.attr=n,this.value=i}apply(t){let n=t.nodeAt(this.pos);if(!n)return ns.fail("No node at attribute step's position");let i=Object.create(null);for(let s in n.attrs)i[s]=n.attrs[s];i[this.attr]=this.value;let o=n.type.create(i,null,n.marks);return ns.fromReplace(t,this.pos,this.pos+1,new bn(fn.from(o),0,n.isLeaf?0:1))}getMap(){return Da.empty}invert(t){return new Bm(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Bm(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Bm(n.pos,n.attr,n.value)}}Js.jsonID("attr",Bm);class T2 extends Js{constructor(t,n){super(),this.attr=t,this.value=n}apply(t){let n=Object.create(null);for(let o in t.attrs)n[o]=t.attrs[o];n[this.attr]=this.value;let i=t.type.create(n,t.content,t.marks);return ns.ok(i)}getMap(){return Da.empty}invert(t){return new T2(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new T2(n.attr,n.value)}}Js.jsonID("docAttr",T2);let ig=class extends Error{};ig=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n};ig.prototype=Object.create(Error.prototype);ig.prototype.constructor=ig;ig.prototype.name="TransformError";class HTe{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new M2}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let n=this.maybeStep(t);if(n.failed)throw new ig(n.failed);return this}maybeStep(t){let n=t.apply(this.doc);return n.failed||this.addStep(t,n.doc),n}get docChanged(){return this.steps.length>0}changedRange(){let t=1e9,n=-1e9;for(let i=0;i{t=Math.min(t,a),n=Math.max(n,l)})}return t==1e9?null:{from:t,to:n}}addStep(t,n){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=n}replace(t,n=t,i=bn.empty){let o=dI(this.doc,t,n,i);return o&&this.step(o),this}replaceWith(t,n,i){return this.replace(t,n,new bn(fn.from(i),0,0))}delete(t,n){return this.replace(t,n,bn.empty)}insert(t,n){return this.replaceWith(t,t,n)}replaceRange(t,n,i){return $Te(this,t,n,i),this}replaceRangeWith(t,n,i){return zTe(this,t,n,i),this}deleteRange(t,n){return jTe(this,t,n),this}lift(t,n){return STe(this,t,n),this}join(t,n=1){return FTe(this,t,n),this}wrap(t,n){return _Te(this,t,n),this}setBlockType(t,n=t,i,o=null){return ITe(this,t,n,i,o),this}setNodeMarkup(t,n,i=null,o){return TTe(this,t,n,i,o),this}setNodeAttribute(t,n,i){return this.step(new Bm(t,n,i)),this}setDocAttribute(t,n){return this.step(new T2(t,n)),this}addNodeMark(t,n){return this.step(new Mf(t,n)),this}removeNodeMark(t,n){let i=this.doc.nodeAt(t);if(!i)throw new RangeError("No node at position "+t);if(n instanceof ji)n.isInSet(i.marks)&&this.step(new Qp(t,n));else{let o=i.marks,s,r=[];for(;s=n.isInSet(o);)r.push(new Qp(t,s)),o=s.removeFromSet(o);for(let a=r.length-1;a>=0;a--)this.step(r[a])}return this}split(t,n=1,i){return ETe(this,t,n,i),this}addMark(t,n,i){return ATe(this,t,n,i),this}removeMark(t,n,i){return CTe(this,t,n,i),this}clearIncompatible(t,n,i){return uI(this,t,n,i),this}}const lA=Object.create(null);class zi{constructor(t,n,i){this.$anchor=t,this.$head=n,this.ranges=i||[new WTe(t.min(n),t.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let n=0;n=0;s--){let r=n<0?X1(t.node(0),t.node(s),t.before(s+1),t.index(s),n,i):X1(t.node(0),t.node(s),t.after(s+1),t.index(s)+1,n,i);if(r)return r}return null}static near(t,n=1){return this.findFrom(t,n)||this.findFrom(t,-n)||new kl(t.node(0))}static atStart(t){return X1(t,t,0,0,1)||new kl(t)}static atEnd(t){return X1(t,t,t.content.size,t.childCount,-1)||new kl(t)}static fromJSON(t,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let i=lA[n.type];if(!i)throw new RangeError(`No selection type ${n.type} defined`);return i.fromJSON(t,n)}static jsonID(t,n){if(t in lA)throw new RangeError("Duplicate use of selection JSON ID "+t);return lA[t]=n,n.prototype.jsonID=t,n}getBookmark(){return ni.between(this.$anchor,this.$head).getBookmark()}}zi.prototype.visible=!0;class WTe{constructor(t,n){this.$from=t,this.$to=n}}let eP=!1;function tP(e){!eP&&!e.parent.inlineContent&&(eP=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class ni extends zi{constructor(t,n=t){tP(t),tP(n),super(t,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let i=t.resolve(n.map(this.head));if(!i.parent.inlineContent)return zi.near(i);let o=t.resolve(n.map(this.anchor));return new ni(o.parent.inlineContent?o:i,i)}replace(t,n=bn.empty){if(super.replace(t,n),n==bn.empty){let i=this.$from.marksAcross(this.$to);i&&t.ensureMarks(i)}}eq(t){return t instanceof ni&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new m3(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new ni(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,i=n){let o=t.resolve(n);return new this(o,i==n?o:t.resolve(i))}static between(t,n,i){let o=t.pos-n.pos;if((!i||o)&&(i=o>=0?1:-1),!n.parent.inlineContent){let s=zi.findFrom(n,i,!0)||zi.findFrom(n,-i,!0);if(s)n=s.$head;else return zi.near(n,i)}return t.parent.inlineContent||(o==0?t=n:(t=(zi.findFrom(t,-i,!0)||zi.findFrom(t,i,!0)).$anchor,t.pos0?0:1);o>0?r=0;r+=o){let a=t.child(r);if(a.isAtom){if(!s&&Yn.isSelectable(a))return Yn.create(e,n-(o<0?a.nodeSize:0))}else{let l=X1(e,a,n+o,o<0?a.childCount:0,o,s);if(l)return l}n+=a.nodeSize*o}return null}function nP(e,t,n){let i=e.steps.length-1;if(i{r==null&&(r=c)}),e.setSelection(zi.near(e.doc.resolve(r),n))}const iP=1,q9=2,oP=4;class UTe extends HTe{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(t){return this.storedMarks=t,this.updated|=q9,this}ensureMarks(t){return ji.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&q9)>0}addStep(t,n){super.addStep(t,n),this.updated=this.updated&~q9,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,n=!0){let i=this.selection;return n&&(t=t.mark(this.storedMarks||(i.empty?i.$from.marks():i.$from.marksAcross(i.$to)||ji.none))),i.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,n,i){let o=this.doc.type.schema;if(n==null)return t?this.replaceSelectionWith(o.text(t),!0):this.deleteSelection();{if(i==null&&(i=n),!t)return this.deleteRange(n,i);let s=this.storedMarks;if(!s){let r=this.doc.resolve(n);s=i==n?r.marks():r.marksAcross(this.doc.resolve(i))}return this.replaceRangeWith(n,i,o.text(t,s)),!this.selection.empty&&this.selection.to==n+t.length&&this.setSelection(zi.near(this.selection.$to)),this}}setMeta(t,n){return this.meta[typeof t=="string"?t:t.key]=n,this}getMeta(t){return this.meta[typeof t=="string"?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=oP,this}get scrolledIntoView(){return(this.updated&oP)>0}}function sP(e,t){return!t||!e?e:e.bind(t)}class J0{constructor(t,n,i){this.name=t,this.init=sP(n.init,i),this.apply=sP(n.apply,i)}}const VTe=[new J0("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new J0("selection",{init(e,t){return e.selection||zi.atStart(t.doc)},apply(e){return e.selection}}),new J0("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,n,i){return i.selection.$cursor?e.storedMarks:null}}),new J0("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})];class uA{constructor(t,n){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=VTe.slice(),n&&n.forEach(i=>{if(this.pluginsByKey[i.key])throw new RangeError("Adding different instances of a keyed plugin ("+i.key+")");this.plugins.push(i),this.pluginsByKey[i.key]=i,i.spec.state&&this.fields.push(new J0(i.key,i.spec.state,i))})}}class vp{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,n=-1){for(let i=0;ii.toJSON())),t&&typeof t=="object")for(let i in t){if(i=="doc"||i=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let o=t[i],s=o.spec.state;s&&s.toJSON&&(n[i]=s.toJSON.call(o,this[o.key]))}return n}static fromJSON(t,n,i){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let o=new uA(t.schema,t.plugins),s=new vp(o);return o.fields.forEach(r=>{if(r.name=="doc")s.doc=Dp.fromJSON(t.schema,n.doc);else if(r.name=="selection")s.selection=zi.fromJSON(s.doc,n.selection);else if(r.name=="storedMarks")n.storedMarks&&(s.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(i)for(let a in i){let l=i[a],u=l.spec.state;if(l.key==r.name&&u&&u.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){s[r.name]=u.fromJSON.call(l,t,n[a],s);return}}s[r.name]=r.init(t,s)}}),s}}function iG(e,t,n){for(let i in e){let o=e[i];o instanceof Function?o=o.bind(t):i=="handleDOMEvents"&&(o=iG(o,t,{})),n[i]=o}return n}class Mg{constructor(t){this.spec=t,this.props={},t.props&&iG(t.props,this,this.props),this.key=t.key?t.key.key:oG("plugin")}getState(t){return t[this.key]}}const cA=Object.create(null);function oG(e){return e in cA?e+"$"+ ++cA[e]:(cA[e]=0,e+"$")}class g3{constructor(t="key"){this.key=oG(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}function zv(e){return e.isText?e.text.length:e.type===ei.nodes.attachment?nh(e.attrs).length:e.type===ei.nodes.quote?d3(e.attrs).length:u1(e.attrs).length}function KTe(e,t){if(!t.parent.isTextblock)return _c(e,t.pos);if(t.textOffset>0)return _c(e,t.pos-t.textOffset);const n=t.nodeBefore;return n&&n.isText?_c(e,t.pos-n.nodeSize):_c(e,t.pos)}function Cd(e,t){let n=Math.max(0,t),i=-1;return e.forEach((o,s)=>{if(i!==-1)return;let r=0;if(o.forEach(a=>{r+=zv(a)}),n>r){n-=r+1;return}o.forEach((a,l)=>{if(i!==-1)return;const u=s+1+l,c=zv(a);if(n<=c){a.isText?i=u+n:i=n===0?u:u+1;return}n-=c}),i===-1&&(i=s+1+o.content.size)}),i===-1?e.content.size-1:i}function _c(e,t){let n=0,i=-1;return e.forEach((o,s)=>{if(i!==-1)return;const r=s+o.nodeSize;if(t>r){o.forEach(l=>{n+=zv(l)}),n+=1;return}let a=0;o.forEach((l,u)=>{if(i!==-1)return;const c=s+1+u;if(l.isText){const d=c+l.nodeSize;if(t<=d){i=n+a+Math.max(0,t-c);return}a+=l.text.length}else{const d=c+1;if(t<=d){i=n+a+(t<=c?0:zv(l));return}a+=zv(l)}}),i===-1&&(i=n+a)}),i===-1?n:i}function ZTe(e){const t=[];return e.forEach(n=>{n.forEach(i=>{!i.isText&&i.type===ei.nodes.mention&&i.attrs.kind==="skill"&&t.push({name:i.attrs.name})})}),t}function rP(e){return(t,n)=>{const i=t.selection.$head,o=e?i.start():i.end();return n&&n(t.tr.setSelection(ni.create(t.doc,t.selection.$anchor.pos,o)).scrollIntoView()),!0}}var E4=200,Ys=function(){};Ys.prototype.append=function(t){return t.length?(t=Ys.from(t),!this.length&&t||t.length=n?Ys.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,n))};Ys.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)};Ys.prototype.forEach=function(t,n,i){n===void 0&&(n=0),i===void 0&&(i=this.length),n<=i?this.forEachInner(t,n,i,0):this.forEachInvertedInner(t,n,i,0)};Ys.prototype.map=function(t,n,i){n===void 0&&(n=0),i===void 0&&(i=this.length);var o=[];return this.forEach(function(s,r){return o.push(t(s,r))},n,i),o};Ys.from=function(t){return t instanceof Ys?t:t&&t.length?new sG(t):Ys.empty};var sG=(function(e){function t(i){e.call(this),this.values=i}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(o,s){return o==0&&s==this.length?this:new t(this.values.slice(o,s))},t.prototype.getInner=function(o){return this.values[o]},t.prototype.forEachInner=function(o,s,r,a){for(var l=s;l=r;l--)if(o(this.values[l],a+l)===!1)return!1},t.prototype.leafAppend=function(o){if(this.length+o.length<=E4)return new t(this.values.concat(o.flatten()))},t.prototype.leafPrepend=function(o){if(this.length+o.length<=E4)return new t(o.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t})(Ys);Ys.empty=new sG([]);var GTe=(function(e){function t(n,i){e.call(this),this.left=n,this.right=i,this.length=n.length+i.length,this.depth=Math.max(n.depth,i.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(i){return ia&&this.right.forEachInner(i,Math.max(o-a,0),Math.min(this.length,s)-a,r+a)===!1)return!1},t.prototype.forEachInvertedInner=function(i,o,s,r){var a=this.left.length;if(o>a&&this.right.forEachInvertedInner(i,o-a,Math.max(s,a)-a,r+a)===!1||s=s?this.right.slice(i-s,o-s):this.left.slice(i,s).append(this.right.slice(0,o-s))},t.prototype.leafAppend=function(i){var o=this.right.leafAppend(i);if(o)return new t(this.left,o)},t.prototype.leafPrepend=function(i){var o=this.left.leafPrepend(i);if(o)return new t(o,this.right)},t.prototype.appendInner=function(i){return this.left.depth>=Math.max(this.right.depth,i.depth)+1?new t(this.left,new t(this.right,i)):new t(this,i)},t})(Ys);const QTe=500;class Tu{constructor(t,n){this.items=t,this.eventCount=n}popEvent(t,n){if(this.eventCount==0)return null;let i=this.items.length;for(;;i--)if(this.items.get(i-1).selection){--i;break}let o,s;n&&(o=this.remapping(i,this.items.length),s=o.maps.length);let r=t.tr,a,l,u=[],c=[];return this.items.forEach((d,f)=>{if(!d.step){o||(o=this.remapping(i,f+1),s=o.maps.length),s--,c.push(d);return}if(o){c.push(new cc(d.map));let h=d.step.map(o.slice(s)),m;h&&r.maybeStep(h).doc&&(m=r.mapping.maps[r.mapping.maps.length-1],u.push(new cc(m,void 0,void 0,u.length+c.length))),s--,m&&o.appendMap(m,s)}else r.maybeStep(d.step);if(d.selection)return a=o?d.selection.map(o.slice(s)):d.selection,l=new Tu(this.items.slice(0,i).append(c.reverse().concat(u)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:r,selection:a}}addTransform(t,n,i,o){let s=[],r=this.eventCount,a=this.items,l=!o&&a.length?a.get(a.length-1):null;for(let c=0;cJTe&&(a=YTe(a,u),r-=u),new Tu(a.append(s),r)}remapping(t,n){let i=new M2;return this.items.forEach((o,s)=>{let r=o.mirrorOffset!=null&&s-o.mirrorOffset>=t?i.maps.length-o.mirrorOffset:void 0;i.appendMap(o.map,r)},t,n),i}addMaps(t){return this.eventCount==0?this:new Tu(this.items.append(t.map(n=>new cc(n))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let i=[],o=Math.max(0,this.items.length-n),s=t.mapping,r=t.steps.length,a=this.eventCount;this.items.forEach(f=>{f.selection&&a--},o);let l=n;this.items.forEach(f=>{let h=s.getMirror(--l);if(h==null)return;r=Math.min(r,h);let m=s.maps[h];if(f.step){let g=t.steps[h].invert(t.docs[h]),y=f.selection&&f.selection.map(s.slice(l+1,h));y&&a++,i.push(new cc(m,g,y))}else i.push(new cc(m))},o);let u=[];for(let f=n;fQTe&&(d=d.compress(this.items.length-i.length)),d}emptyItemCount(){let t=0;return this.items.forEach(n=>{n.step||t++}),t}compress(t=this.items.length){let n=this.remapping(0,t),i=n.maps.length,o=[],s=0;return this.items.forEach((r,a)=>{if(a>=t)o.push(r),r.selection&&s++;else if(r.step){let l=r.step.map(n.slice(i)),u=l&&l.getMap();if(i--,u&&n.appendMap(u,i),l){let c=r.selection&&r.selection.map(n.slice(i));c&&s++;let d=new cc(u.invert(),l,c),f,h=o.length-1;(f=o.length&&o[h].merge(d))?o[h]=f:o.push(d)}}else r.map&&i--},this.items.length,0),new Tu(Ys.from(o.reverse()),s)}}Tu.empty=new Tu(Ys.empty,0);function YTe(e,t){let n;return e.forEach((i,o)=>{if(i.selection&&t--==0)return n=o,!1}),e.slice(n)}class cc{constructor(t,n,i,o){this.map=t,this.step=n,this.selection=i,this.mirrorOffset=o}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new cc(n.getMap().invert(),n,this.selection)}}}class gf{constructor(t,n,i,o,s){this.done=t,this.undone=n,this.prevRanges=i,this.prevTime=o,this.prevComposition=s}}const JTe=20;function XTe(e,t,n,i){let o=n.getMeta(Op),s;if(o)return o.historyState;n.getMeta(aG)&&(e=new gf(e.done,e.undone,null,0,-1));let r=n.getMeta("appendedTransaction");if(n.steps.length==0)return e;if(r&&r.getMeta(Op))return r.getMeta(Op).redo?new gf(e.done.addTransform(n,void 0,i,Zk(t)),e.undone,aP(n.mapping.maps),e.prevTime,e.prevComposition):new gf(e.done,e.undone.addTransform(n,void 0,i,Zk(t)),null,e.prevTime,e.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(r&&r.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),l=e.prevTime==0||!r&&e.prevComposition!=a&&(e.prevTime<(n.time||0)-i.newGroupDelay||!eEe(n,e.prevRanges)),u=r?dA(e.prevRanges,n.mapping):aP(n.mapping.maps);return new gf(e.done.addTransform(n,l?t.selection.getBookmark():void 0,i,Zk(t)),Tu.empty,u,n.time,a??e.prevComposition)}else return(s=n.getMeta("rebased"))?new gf(e.done.rebased(n,s),e.undone.rebased(n,s),dA(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new gf(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),dA(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function eEe(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((i,o)=>{for(let s=0;s=t[s]&&(n=!0)}),n}function aP(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((i,o,s,r)=>t.push(s,r));return t}function dA(e,t){if(!e)return null;let n=[];for(let i=0;i{let o=Op.getState(n);if(!o||(e?o.undone:o.done).eventCount==0)return!1;if(i){let s=tEe(o,n,e);s&&i(t?s.scrollIntoView():s)}return!0}}const uG=lG(!1,!0),O7=lG(!0,!0);function iEe(e,t,n){const i=Cd(e.doc,n.start),o=Cd(e.doc,n.end),s=I2(e.doc),r=n.start>0?s.charAt(n.start-1):"",a=s.charAt(n.end),l=[];(r==="!"||r==="\\")&&l.push(ei.text(" ")),l.push(HZ(t)),(a===""||!/\s/.test(a))&&l.push(ei.text(" "));const u=e.tr.replaceWith(i,o,l);return u.setSelection(ni.create(u.doc,i+l.reduce((c,d)=>c+d.nodeSize,0))),u.scrollIntoView()}function oEe(e,t,n){const i=Cd(e.doc,n.start),o=Cd(e.doc,n.end),s=e.tr.insertText(t,i,o);return s.setSelection(ni.create(s.doc,i+t.length)),rG(s.scrollIntoView())}function sEe(e,t,n){const i=n?n.start:_c(e.doc,e.selection.from),o=n?n.end:_c(e.doc,e.selection.to),s=Cd(e.doc,i),r=Cd(e.doc,o),a=I2(e.doc),l=i>0?a.charAt(i-1):"",u=a.charAt(o),c=[];(l==="!"||l==="\\")&&c.push(ei.text(" ")),c.push(WZ(t)),(u===""||!/\s/.test(u))&&c.push(ei.text(" "));const d=e.tr.replaceWith(s,r,c);return d.setSelection(ni.create(d.doc,s+c.reduce((f,h)=>f+h.nodeSize,0))),d.scrollIntoView()}function rEe(e,t,n){const i=e.selection.to,o=I2(e.doc),s=_c(e.doc,i),r=s>0?o.charAt(s-1):"",a=o.charAt(s),l=[];r!==""&&!/\s/.test(r)&&l.push(ei.text(" ")),l.push(qZ(n!==void 0&&n.length>0?{...t,comment:n}:t)),(a===""||!/\s/.test(a))&&l.push(ei.text(" "));const u=e.tr.replaceWith(i,i,l);return u.setSelection(ni.create(u.doc,i+l.reduce((c,d)=>c+d.nodeSize,0))),u.scrollIntoView()}function U9(e,t){return bn.maxOpen(_2(e.replace(/\r\n?/g,` +`),t).content)}function uP(e){const t=typeof e.source=="string"&&e.source.length>0?`from: ${rI(e.source)} +`:"",n=typeof e.comment=="string"&&e.comment.length>0?` + +${e.comment}`:"";return`${t}${bZ(e.text)}${n}`}function cG(e){const t=i=>i.isText?i.text??"":i.type===ei.nodes.mention?u1(i.attrs):i.type===ei.nodes.attachment?i.attrs.name:i.type===ei.nodes.quote?uP(i.attrs):i.textBetween(0,i.content.size,""),n=[];return e.content.forEach(i=>{if(i.type===ei.nodes.mention||i.type===ei.nodes.attachment||i.type===ei.nodes.quote)n.push(t(i));else{let o="",s=!1;i.forEach(r=>{if(r.type===ei.nodes.quote){const l=uP(r.attrs);o=o.length>0?`${o.replace(/ +$/,"")} + +${l}`:l,s=!0;return}let a=t(r);s&&(a=a.replace(/^ /,""),o+=` + +`,s=!1),o+=a}),n.push(o)}}),n.join(` +`)}const P7=` + + + + +`,dG=` + + + + +`,fG='',hG=` + + + +`,pG=` + + +`,mG='',gG=` + + +`,vG=` + + +`,yG=` + + +`,aEe='',lEe='',uEe='',cEe='',dEe='',fEe={sm:14,md:16,lg:20},hEe={file:P7,folder:dG,skill:fG,copy:hG,check:pG,"external-link":mG,target:gG,"file-edit":vG,close:yG,attachment:aEe,image:lEe,video:uEe,fullscreen:cEe,quote:dEe};function ha(e,t="md"){const n=fEe[t];return hEe[e].replace(/]*>/,i=>i.replace(/\s(?:width|height)="[^"]*"/g,"")).replace(/^
      ↩︎`}function Fde(e){const t=e.helpers.parseLinkLabel,n=e.utils.isSpace;e.renderer.rules.footnote_ref=Ide,e.renderer.rules.footnote_block_open=Mde,e.renderer.rules.footnote_block_close=Tde,e.renderer.rules.footnote_open=Ede,e.renderer.rules.footnote_close=Lde,e.renderer.rules.footnote_anchor=Nde,e.renderer.rules.footnote_caption=_de,e.renderer.rules.footnote_anchor_name=Sde;function i(l,a,u,c){const d=l.bMarks[a]+l.tShift[a],f=l.eMarks[a];if(d+4>f||l.src.charCodeAt(d)!==91||l.src.charCodeAt(d+1)!==94)return!1;let h;for(h=d+2;h=f||l.src.charCodeAt(++h)!==58)return!1;if(c)return!0;h++,l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.refs||(l.env.footnotes.refs={});const m=l.src.slice(d+2,h-2);l.env.footnotes.refs[`:${m}`]=-1;const g=new l.Token("footnote_reference_open","",1);g.meta={label:m},g.level=l.level++,l.tokens.push(g);const y=l.bMarks[a],k=l.tShift[a],v=l.sCount[a],C=l.parentType,w=h,M=l.sCount[a]+h-(l.bMarks[a]+l.tShift[a]);let L=M;for(;h=u||l.src.charCodeAt(c)!==94||l.src.charCodeAt(c+1)!==91)return!1;const d=c+2,f=t(l,c+1);if(f<0)return!1;if(!a){l.env.footnotes||(l.env.footnotes={}),l.env.footnotes.list||(l.env.footnotes.list=[]);const h=l.env.footnotes.list.length,m=[];l.md.inline.parse(l.src.slice(d,f),l.md,l.env,m);const g=l.push("footnote_ref","",0);g.meta={id:h},l.env.footnotes.list[h]={content:l.src.slice(d,f),tokens:m}}return l.pos=f+1,l.posMax=u,!0}function s(l,a){const u=l.posMax,c=l.pos;if(c+3>u||!l.env.footnotes||!l.env.footnotes.refs||l.src.charCodeAt(c)!==91||l.src.charCodeAt(c+1)!==94)return!1;let d;for(d=c+2;d=u)return!1;d++;const f=l.src.slice(c+2,d-1);if(typeof l.env.footnotes.refs[`:${f}`]>"u")return!1;if(!a){l.env.footnotes.list||(l.env.footnotes.list=[]);let h;l.env.footnotes.refs[`:${f}`]<0?(h=l.env.footnotes.list.length,l.env.footnotes.list[h]={label:f,count:0},l.env.footnotes.refs[`:${f}`]=h):h=l.env.footnotes.refs[`:${f}`];const m=l.env.footnotes.list[h].count;l.env.footnotes.list[h].count++;const g=l.push("footnote_ref","",0);g.meta={id:h,subId:m,label:f}}return l.pos=d,l.posMax=u,!0}function r(l){let a,u,c,d=!1;const f={};if(!l.env.footnotes||(l.tokens=l.tokens.filter(function(m){return m.type==="footnote_reference_open"?(d=!0,u=[],c=m.meta.label,!1):m.type==="footnote_reference_close"?(d=!1,f[":"+c]=u,!1):(d&&u.push(m),!d)}),!l.env.footnotes.list))return;const h=l.env.footnotes.list;l.tokens.push(new l.Token("footnote_block_open","",1));for(let m=0,g=h.length;m0?h[m].count:1;for(let C=0;C?@[\]^_`{|}~-])/g;function Pde(e,t){const n=e.posMax,i=e.pos;if(e.src.charCodeAt(i)!==94||t||i+2>=n)return!1;e.pos=i+1;let o=!1;for(;e.pos{t.exports=function(g,y){y=Object.assign({},{disabled:!0,divWrap:!1,divClass:"checkbox",idPrefix:"cbx_",ulClass:"task-list",liClass:"task-list-item"},y),g.core.ruler.after("inline","github-task-lists",function(k){for(var v=k.tokens,C=0,w=2;w=0;v--)if(g[v].level===k)return v;return-1}function o(g,y){return d(g[y])&&f(g[y-1])&&h(g[y-2])&&m(g[y])}function s(g,y,k,v){var C=k.idPrefix+y;g.children[0].content=g.children[0].content.slice(3),g.children.unshift(l(C,v)),g.children.push(a(v)),g.children.unshift(r(g,C,k,v)),k.divWrap&&(g.children.unshift(u(k,v)),g.children.push(c(v)))}function r(g,y,k,v){var C=new v("checkbox_input","input",0);return C.attrs=[["type","checkbox"],["id",y]],/^\[[xX]\][ \u00A0]/.test(g.content)===!0&&C.attrs.push(["checked","true"]),k.disabled===!0&&C.attrs.push(["disabled","true"]),C}function l(g,y){var k=new y("label_open","label",1);return k.attrs=[["for",g]],k}function a(g){return new g("label_close","label",-1)}function u(g,y){var k=new y("checkbox_open","div",0);return k.attrs=[["class",g.divClass]],k}function c(g){return new g("checkbox_close","div",-1)}function d(g){return g.type==="inline"}function f(g){return g.type==="paragraph_open"}function h(g){return g.type==="list_item_open"}function m(g){return/^\[[xX \u00A0]\][ \u00A0]/.test(g.content)}})});const zde=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function jde(e){return e>=55296&&e<=57343||e>1114111?65533:zde.get(e)??e}function Hde(e){const t=atob(e),n=t.length&-2,i=new Uint16Array(n/2);for(let o=0,s=0;o=ko.ZERO&&e<=ko.NINE}function qde(e){return e>=ko.UPPER_A&&e<=ko.UPPER_F||e>=ko.LOWER_A&&e<=ko.LOWER_F}function Ude(e){return e>=ko.UPPER_A&&e<=ko.UPPER_Z||e>=ko.LOWER_A&&e<=ko.LOWER_Z||aA(e)}function Vde(e){return e===ko.EQUALS||Ude(e)}var Ks;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(Ks||(Ks={}));var Gd;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(Gd||(Gd={}));var Kde=class{decodeTree;emitCodePoint;errors;constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n}state=Ks.EntityStart;consumed=1;result=0;treeIndex=0;excess=1;decodeMode=Gd.Strict;runConsumed=0;startEntity(e){this.decodeMode=e,this.state=Ks.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1,this.runConsumed=0}write(e,t){switch(this.state){case Ks.EntityStart:return e.charCodeAt(t)===ko.NUM?(this.state=Ks.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=Ks.NamedEntity,this.stateNamedEntity(e,t));case Ks.NumericStart:return this.stateNumericStart(e,t);case Ks.NumericDecimal:return this.stateNumericDecimal(e,t);case Ks.NumericHex:return this.stateNumericHex(e,t);case Ks.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|IE)===ko.LOWER_X?(this.state=Ks.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=Ks.NumericDecimal,this.stateNumericDecimal(e,t))}stateNumericHex(e,t){for(;t>14;for(;t>7;if(this.runConsumed===0){const l=i&qr.JUMP_TABLE;if(e.charCodeAt(t)!==l)return this.result===0?0:this.emitNotTerminatedNamedEntity();t++,this.excess++,this.runConsumed++}for(;this.runConsumed=e.length)return-1;const l=this.runConsumed-1,a=n[this.treeIndex+1+(l>>1)],u=l%2===0?a&255:a>>8&255;if(e.charCodeAt(t)!==u)return this.runConsumed=0,this.result===0?0:this.emitNotTerminatedNamedEntity();t++,this.excess++,this.runConsumed++}this.runConsumed=0,this.treeIndex+=1+(r>>1),i=n[this.treeIndex],o=(i&qr.VALUE_LENGTH)>>14}if(t>=e.length)break;const s=e.charCodeAt(t);if(s===ko.SEMI&&o!==0&&(i&qr.FLAG13)!==0)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);if(this.treeIndex=Gde(n,i,this.treeIndex+Math.max(1,o),s),this.treeIndex<0)return this.result===0||this.decodeMode===Gd.Attribute&&(o===0||Vde(s))?0:this.emitNotTerminatedNamedEntity();if(i=n[this.treeIndex],o=(i&qr.VALUE_LENGTH)>>14,o!==0){if(s===ko.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==Gd.Strict&&(i&qr.FLAG13)===0&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}t++,this.excess++}return-1}emitNotTerminatedNamedEntity(){const{result:e,decodeTree:t}=this,n=(t[e]&qr.VALUE_LENGTH)>>14;return this.emitNamedEntityData(e,n,this.consumed),this.errors?.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){const{decodeTree:i}=this;return this.emitCodePoint(t===1?i[e]&~(qr.VALUE_LENGTH|qr.FLAG13):i[e+1],n),t===3&&this.emitCodePoint(i[e+2],n),n}end(){switch(this.state){case Ks.NamedEntity:return this.result!==0&&(this.decodeMode!==Gd.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Ks.NumericDecimal:return this.emitNumericEntity(0,2);case Ks.NumericHex:return this.emitNumericEntity(0,3);case Ks.NumericStart:return this.errors?.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Ks.EntityStart:return 0}}};function Zde(e){let t="";const n=new Kde(e,i=>t+=String.fromCodePoint(i));return function(o,s){let r=0,l=0;for(;(l=o.indexOf("&",l))>=0;){t+=o.slice(r,l),n.startEntity(s);const u=n.write(o,l+1);if(u<0){r=l+n.end();break}r=l+u,l=u===0?r+1:r}const a=t+o.slice(r);return t="",a}}function Gde(e,t,n,i){const o=(t&qr.BRANCH_LENGTH)>>7,s=t&qr.JUMP_TABLE;if(o===0)return s!==0&&i===s?n:-1;if(s){const u=i-s;return u<0||u>=o?-1:e[n+u]-1}const r=o+1>>1;let l=0,a=o-1;for(;l<=a;){const u=l+a>>>1,c=e[n+(u>>1)]>>(u&1)*8&255;if(ci)a=u-1;else return e[n+r+u]}return-1}const Qde=Zde(Wde);function nx(e,t=Gd.Legacy){return Qde(e,t)}var Yde=zj($de());const ME={};function Jde(e){let t=ME[e];if(t)return t;t=ME[e]=[];for(let n=0;n<128;n++){const i=String.fromCharCode(n);t.push(i)}for(let n=0;n=55296&&c<=57343?o+="���":o+=String.fromCharCode(c),s+=6;continue}}if((l&248)===240&&s+91114111?o+="����":(d-=65536,o+=String.fromCharCode(55296+(d>>10),56320+(d&1023))),s+=9;continue}}o+="�"}return o})}F4.defaultChars=";/?:@&=+$,#";F4.componentChars="";var uA=F4;const TE={};function Xde(e){let t=TE[e];if(t)return t;t=TE[e]=[];for(let n=0;n<128;n++){const i=String.fromCharCode(n);/^[0-9a-z]$/i.test(i)?t.push(i):t.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n"u"&&(n=!0);const i=Xde(t);let o="";for(let s=0,r=e.length;s=55296&&l<=57343){if(l>=55296&&l<=56319&&s+1=56320&&a<=57343){o+=encodeURIComponent(e[s]+e[s+1]),s++;continue}}o+="%EF%BF%BD";continue}o+=encodeURIComponent(e[s])}return o}D4.defaultChars=";/?:@&=+$,-_.!~*'()#";D4.componentChars="-_.!~*'()";var jj=D4;function ix(e){let t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&e.hostname.indexOf(":")!==-1?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||"",t}function Kk(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const efe=/^([a-z0-9.+-]+:)/i,tfe=/:[0-9]*$/,nfe=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,ife=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",` -`," "]),ofe=["'"].concat(ife),EE=["%","/","?",";","#"].concat(ofe),LE=["/","?","#"],sfe=255,NE=/^[+a-z0-9A-Z_-]{0,63}$/,rfe=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,FE={javascript:!0,"javascript:":!0},DE={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function lfe(e,t){if(e&&e instanceof Kk)return e;const n=new Kk;return n.parse(e,t),n}Kk.prototype.parse=function(e,t){let n,i,o,s=e;if(s=s.trim(),!t&&e.split("#").length===1){const u=nfe.exec(s);if(u)return this.pathname=u[1],u[2]&&(this.search=u[2]),this}let r=efe.exec(s);if(r&&(r=r[0],n=r.toLowerCase(),this.protocol=r,s=s.substr(r.length)),(t||r||s.match(/^\/\/[^@\/]+@[^@\/]+/))&&(o=s.substr(0,2)==="//",o&&!(r&&FE[r])&&(s=s.substr(2),this.slashes=!0)),!FE[r]&&(o||r&&!DE[r])){let u=-1;for(let m=0;m127?v+="x":v+=k[C];if(!v.match(NE)){const C=m.slice(0,g),w=m.slice(g+1),M=k.match(rfe);M&&(C.push(M[1]),w.unshift(M[2])),w.length&&(s=w.join(".")+s),this.hostname=C.join(".");break}}}}this.hostname.length>sfe&&(this.hostname=""),h&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const l=s.indexOf("#");l!==-1&&(this.hash=s.substr(l),s=s.slice(0,l));const a=s.indexOf("?");return a!==-1&&(this.search=s.substr(a),s=s.slice(0,a)),s&&(this.pathname=s),DE[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};Kk.prototype.parseHost=function(e){let t=tfe.exec(e);t&&(t=t[0],t!==":"&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};var ox=lfe,Hj=Ade({decode:()=>uA,encode:()=>jj,format:()=>ix,parse:()=>ox}),afe=Object.defineProperty,Wj=e=>{let t={};for(var n in e)afe(t,n,{get:e[n],enumerable:!0});return t},Ns=class{type;tag;attrs;map;nesting;level;children;content;markup;info;meta;block;hidden;constructor(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}attrIndex(e){if(!this.attrs)return-1;const t=this.attrs;for(let n=0,i=t.length;n=0&&(n=this.attrs[t][1]),n}attrJoin(e,t){const n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=`${this.attrs[n][1]} ${t}`}},ufe=Wj({arrayReplaceAt:()=>gfe,assign:()=>pfe,countLines:()=>Mo,escapeHtml:()=>Sfe,escapeRE:()=>Ife,fromCodePoint:()=>Mv,has:()=>hfe,isMdAsciiPunct:()=>Qk,isPunctChar:()=>Gk,isPunctCode:()=>cA,isSpace:()=>mfe,isString:()=>dfe,isValidEntityCode:()=>O4,isWhiteSpace:()=>Iv,lib:()=>Mfe,mdurl:()=>Hj,normalizeReference:()=>R4,ucmicro:()=>Zk,unescapeAll:()=>Tv,unescapeMd:()=>bfe});const Zk={Any:/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Cc:/[\0-\x1F\x7F-\x9F]/,Cf:/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,P:/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,S:/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,Z:/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/};function cfe(e){return Object.prototype.toString.call(e)}function dfe(e){return cfe(e)==="[object String]"}const ffe=Object.prototype.hasOwnProperty;function hfe(e,t){return ffe.call(e,t)}function pfe(e,...t){return t.forEach(n=>{if(n){if(typeof n!="object")throw new TypeError(`${String(n)}must be object`);Object.keys(n).forEach(i=>{e[i]=n[i]})}}),e}function mfe(e){return e===9||e===32}function Iv(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function Gk(e){return Zk.P.test(e)||Zk.S.test(e)}const RE=new Map;function cA(e){if(Qk(e))return!0;if(e>=0&&e<128)return!1;const t=RE.get(e);if(t!==void 0)return t;const n=Gk(String.fromCharCode(e));return RE.set(e,n),n}function Qk(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function R4(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}function gfe(e,t,n){return[...e.slice(0,t),...n,...e.slice(t+1)]}function O4(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function Mv(e){if(e>65535){e-=65536;const t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}const qj=/\\([!"#$%&'()*+,\-\./:;<=>?@[\\\]^_`{|}~])/g,vfe=new RegExp(`${qj.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),yfe=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function kfe(e,t){if(t.charCodeAt(0)===35&&yfe.test(t)){const i=t[1].toLowerCase()==="x"?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return O4(i)?Mv(i):e}const n=nx(e);return n!==e?n:e}function bfe(e){return e.includes("\\")?e.replace(qj,"$1"):e}function Tv(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(vfe,(t,n,i)=>n||kfe(t,i))}const wfe=/[&<>"]/,Cfe=/[&<>"]/g,Afe={"&":"&","<":"<",">":">",'"':"""};function xfe(e){return Afe[e]}function Sfe(e){return wfe.test(e)?e.replace(Cfe,xfe):e}const _fe=/[.?*+^$[\]\\(){}|-]/g;function Ife(e){return e.replace(_fe,"\\$&")}const Mfe={mdurl:Hj,ucmicro:Zk};function Mo(e){if(e.length===0)return 0;let t=0,n=-1;for(;(n=e.indexOf(` -`,n+1))!==-1;)t++;return t}const Tfe=/(?:^|\n)[ \t]{0,3}\[\^[^\]\n]+\]:/m,Efe=/(?:^|\n)[ \t]{0,3}\*\[[^\]\n]+\]:/m,Lfe=/(?:^|\n)[ \t]{0,3}\[(?!\^)(?:\\[\s\S]|[^\]\\[])+\][ \t]*:/m,sx=["references","footnotes","abbreviations","abbr","abbrs"],rx=Symbol.for("markdown-it-ts.global-state"),lx=Object.prototype.hasOwnProperty;function OE(e){return e==="reference-definition"||e==="footnote-definition"||e==="abbreviation-definition"}function pu(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function uf(e){if(Array.isArray(e))return e.map(t=>uf(t));if(pu(e)){const t={};for(const n of Object.keys(e))t[n]=uf(e[n]);return t}return e}function Yk(e){return Array.isArray(e)?e.map((t,n)=>String(n)):pu(e)?Object.keys(e):[]}function dA(e,t){if(Array.isArray(e)||Array.isArray(t)){if(!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;ns.has(r)?!dA(o[r],Uj(i.value,r)):!0)}}function ad(e){const t=ax(e);if(t){for(const n of sx){const i=t.snapshot[n];if(!i){delete e[n];continue}if(i.ownedKeys){Ffe(e,n,i);continue}i.existed?e[n]=Nfe(e[n],i.value):delete e[n]}delete e[rx]}}function R3(e){return{area:e,attempted:!0,matched:!1,attemptMs:0,blocks:0,headings:0,paragraphs:0,lists:0,fences:0,paragraphCacheHits:0,paragraphCacheMisses:0,paragraphCacheBypasses:0,listCacheHits:0,listCacheMisses:0,fenceCacheHits:0,fenceCacheMisses:0}}const fA=Symbol.for("markdown-it-ts.diagnostics");function c2(e,t){if(e)try{const n=e[fA];if(n&&typeof n=="object")return n;if(!t)return;const i={};return e[fA]=i,i}catch{return}}function Bc(e){return c2(e,!1)}function Rfe(e){if(e)try{const t=e[fA];t&&typeof t=="object"&&(delete t.strategy,delete t.chunk,delete t.unbounded,delete t.editable,delete t.stockFast)}catch{}}function Ur(e){Rfe(e)}function Dg(e,t){const n=c2(e,!0);n&&(n.stockFast=t)}function ts(e,t){const n=c2(e,!0);n&&(n.strategy=t)}function O3(e,t){const n=c2(e,!0);n&&(n.chunk=t)}function Vj(e,t){const n=c2(e,!0);n&&(n.unbounded=t)}const Ofe=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Pfe=/[\0-\x1F\x7F-\x9F]/,Bfe=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B4E\u1B4F\u1B5A-\u1B60\u1B7D-\u1B7F\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDD6E\uDEAD\uDED0\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9\uDFD4\uDFD5\uDFD7\uDFD8]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09\uDFE1]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDD6D-\uDD6F\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD839\uDDFF|\uD83A[\uDD5E\uDD5F]/,$fe=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/;var zfe=class{src_Any=Ofe.source;src_Cc=Pfe.source;src_Z=$fe.source;src_P=Bfe.source;src_ZPCc=[this.src_Z,this.src_P,this.src_Cc].join("|");src_ZCc=[this.src_Z,this.src_Cc].join("|");cache={};opts={maxLength:1e4,urlAuth:!1,schema_names:[]};constructor(e={}){this.opts={...this.opts,...e}}set(e={}){return this.opts={...this.opts,...e},this.cache={},this}escapeRE(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}nestedPairRE(e,t,n=4){const i=this.escapeRE(e),o=this.escapeRE(t),s=`(?:(?!${this.src_ZCc}|${i}|${o}).)`;let r=`${i}${s}{0,1000}${o}`;for(let l=2;l<=n;l++)r=`${i}(?:${s}|${r}){0,1000}${o}`;return r}get_text_separators(){return this.cache.text_separators??=/[><\uff5c]/}get_pseudo_letter(){return this.cache.src_pseudo_letter??=new RegExp(`(?:(?!${this.get_text_separators().source}|${this.src_ZPCc})${this.src_Any})`)}get_ipv4_addr(){return this.cache.src_ip4??=new RegExp("(?:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])[.]){3}(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])")}get_ipv6_addr(){const e="[0-9A-Fa-f]{1,4}",t=`(?:(?:${e}:${e})|${this.get_ipv4_addr().source})`;return this.cache.src_ip6_addr??=new RegExp(`(?:(?:${e}:){6}${t}|::(?:${e}:){5}${t}|(?:${e})?::(?:${e}:){4}${t}|(?:(?:${e}:){0,1}${e})?::(?:${e}:){3}${t}|(?:(?:${e}:){0,2}${e})?::(?:${e}:){2}${t}|(?:(?:${e}:){0,3}${e})?::${e}:${t}|(?:(?:${e}:){0,4}${e})?::${t}|(?:(?:${e}:){0,5}${e})?::${e}|(?:(?:${e}:){0,6}${e})?::)`)}get_ipv6_url_host(){return this.cache.src_ip6_host??=new RegExp(`\\[${this.get_ipv6_addr().source}\\]`)}get_ipv6_mail_host(){return this.cache.src_ipv6_mail_host??=new RegExp(`\\[IPv6:${this.get_ipv6_addr().source}\\]`)}get_auth(){return this.cache.src_auth??=new RegExp(`(?:(?:(?!${this.src_ZCc}|[@/\\[\\]()]).){1,50}@)?`)}get_port(){return this.cache.src_port??=new RegExp("(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?")}get_host_terminator(){return this.cache.src_host_terminator??=new RegExp(`(?=$|${this.get_text_separators().source}|${this.src_ZPCc})(?!${this.opts["---"]?"-(?!--)|":"-|"}_|:\\d|\\.-|\\.(?!$|${this.src_ZPCc}))`)}get_path_terminator(){return this.cache.src_path_terminator??=new RegExp(`${this.src_ZPCc}|${this.get_text_separators().source}`)}get_path(){return this.cache.src_path??=new RegExp(`(?:[/?#](?:${this.nestedPairRE("[","]")}|${this.nestedPairRE("(",")")}|${this.nestedPairRE("{","}")}|\\"(?:(?!${this.src_ZCc}|["]).){1,100}\\"|\\'(?:(?!${this.src_ZCc}|[']).){1,100}\\'|\\'(?=${this.get_pseudo_letter().source}|[-])|\\.{2,20}[:]?[a-zA-Z0-9%/&]|\\.(?!${this.src_ZCc}|[.]|$)|`+(this.opts["---"]?"\\-(?!--(?:[^-]|$))(?:-{0,19})|":"\\-{1,20}|")+`,(?!${this.src_ZCc}|$)|;(?!${this.src_ZCc}|$)|\\!{1,20}(?!${this.src_ZCc}|[!]|$)|\\?(?!${this.src_ZCc}|[?]|$)|`+this.get_path_extra().source+`[\\\\/:%@#&=_~*]|(?!${this.get_path_terminator().source}).){1,${this.opts.maxLength}}|\\/)?`)}get_mail_name(){return this.cache.src_mail_name??=new RegExp("[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9](?:[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9]|[.](?=[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9])){0,63}")}get_xn(){return this.cache.src_xn??=new RegExp("xn--[a-z0-9\\-]{1,59}")}get_tld(){if(this.cache.tld)return this.cache.tld;const e=[...new Set(this.opts.tlds||[])].sort().reverse().join("|");return this.cache.tld=new RegExp(`${e||"$#none#$"}|${this.get_xn().source}`),this.cache.tld}get_domain_root(){return this.cache.src_domain_root??=new RegExp("(?:"+this.get_xn().source+`|${this.get_pseudo_letter().source}{1,63})`)}get_domain(){return this.cache.src_domain??=new RegExp("(?:"+this.get_xn().source+`|(?:${this.get_pseudo_letter().source})|(?:${this.get_pseudo_letter().source}(?:-|${this.get_pseudo_letter().source}){0,61}${this.get_pseudo_letter().source}))`)}get_url_host_port(){return this.cache.url_host_port??=new RegExp("(?:"+this.get_ipv6_url_host().source+`|(?:(?:(?:${this.get_domain().source})\\.){0,10}${this.get_domain().source}))`+this.get_port().source+this.get_host_terminator().source)}get_fuzzy_url_host_port(){return this.cache.fuzzy_url_host_port??=new RegExp("(?:"+(this.opts.fuzzyIP?this.get_ipv4_addr().source+"|":"")+`(?:(?:(?:${this.get_domain().source})\\.){1,10}(?:${this.get_tld().source})))`+this.get_host_terminator().source)}get_mail_host(){return this.cache.src_mail_host??=new RegExp("(?:"+this.get_ipv6_mail_host().source+`|(?:(?:(?:${this.get_domain().source})\\.){0,4}${this.get_domain().source}))`+this.get_host_terminator().source)}get_fuzzy_mail_host(){return this.cache.src_fuzzy_mail_host??=new RegExp("(?:"+this.get_ipv6_mail_host().source+`|(?:(?:(?:${this.get_domain().source})[.]){1,4}${this.get_domain_root().source}))`+this.get_host_terminator().source)}get_path_extra(){return this.cache.src_path_extra??=new RegExp("")}get_fuzzy_mail_host_search(){return this.cache.mail_fuzzy_host_search??=new RegExp(`@${this.get_fuzzy_mail_host().source}`,"ig")}get_fuzzy_link_search(){return this.cache.link_fuzzy_search??=new RegExp(`(^|(?![.:/\\-_@])(?:[$+<=>^\`||]|${this.src_ZPCc}))(?:(?![$+<=>^\`||])${this.get_fuzzy_url_host_port().source}${this.get_path().source})`,"ig")}get_http_validator(){return this.cache.http_validator??=new RegExp("\\/\\/"+(this.opts.urlAuth?this.get_auth().source:"")+this.get_url_host_port().source+this.get_path().source,"iy")}get_relative_proto_validator(){return this.cache.relative_proto_validator??=new RegExp((this.opts.urlAuth?this.get_auth().source:"")+`(?:localhost|${this.get_ipv6_url_host().source}|(?:(?:${this.get_domain().source})[.]){1,10}${this.get_domain_root().source})`+this.get_port().source+this.get_host_terminator().source+this.get_path().source,"iy")}get_mail_name_validator(){return this.cache.mail_name_validator??=new RegExp(`(?:^|${this.get_text_separators().source}|"|\\(|${this.src_ZCc})(${this.get_mail_name().source})$`)}get_mailto_validator(){return this.cache.mailto_validator??=new RegExp(`${this.get_mail_name().source}@${this.get_mail_host().source}`,"iy")}get_schema_names(){return this.cache.schema_names??=new RegExp((this.opts.schema_names||[]).map(e=>this.escapeRE(e)).join("|"))}get_schema_search(){return this.cache.schema_search??=new RegExp(`(^|(?!_)(?:[><|]|${this.src_ZPCc}))(${this.get_schema_names().source})`,"ig")}get_schema_at_start(){return this.cache.schema_at_start??=new RegExp(`^${this.get_schema_search().source}`,"i")}},P3={validate:(e,t,n)=>{const i=n.re.get_http_validator();i.lastIndex=t;const o=i.exec(e);return o?o[0].length:0},normalize:(e,t)=>t.normalize(e)},jfe={"http:":P3,"https:":P3,"ftp:":P3,"//":{validate:function(e,t,n){const i=n.re.get_relative_proto_validator();i.lastIndex=t;const o=i.exec(e);return o?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:o[0].length:0},normalize:(e,t)=>t.normalize(e)},"mailto:":{validate:function(e,t,n){const i=n.re.get_mailto_validator();i.lastIndex=t;const o=i.exec(e);return o?o[0].length:0},normalize:(e,t)=>t.normalize(e)}},Hfe="a:cdefgilmnoqrstuwxz|b:abdefghijmnorstvwyz|c:acdfghiklmnoruvwxyz|d:ejkmoz|e:cegrstu|f:ijkmor|g:abdefghilmnpqrstuwy|h:kmnrtu|i:delmnoqrst|j:emop|k:eghimnprwyz|l:abcikrstuvy|m:acdeghklmnopqrstuvwxyz|n:acefgilopruz|o:m|p:aefghklmnrstwy|q:a|r:eosuw|s:abcdeghijklmnortuvxyz|t:cdfghjklmnortvwz|u:agksyz|v:aceginu|w:fs|y:et|z:amw",Wfe="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф";function qfe(){const e=Wfe.split("|");return Hfe.split("|").forEach(t=>{const n=t.indexOf(":"),i=t.slice(0,n);for(const o of t.slice(n+1))e.push(i+o)}),e}var Ufe={fuzzyLink:!1,fuzzyEmail:!0,fuzzyIP:!1,"---":!1,tlds:qfe(),urlAuth:!1,maxLength:1e4},PE=class{schema;index;lastIndex;raw;text;url;constructor(e,t,n,i){const o=e.slice(n,i);this.schema=t.toLowerCase(),this.index=n,this.lastIndex=i,this.raw=o,this.text=o,this.url=o}},Kj=class{__opts__;__schemas__;re;constructor(e={}){const{rebuilder:t,...n}=e;this.__opts__={...Ufe,...n},this.__schemas__={...jfe},this.re=t||new zfe,this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)})}add(e,t=null){if(!t)delete this.__schemas__[e];else{const n={normalize:(i,o)=>o.normalize(i),...t};this.__schemas__[e]=n}return this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}set(e={}){return this.__opts__={...this.__opts__,...e},this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}test(e){if(!e.length)return!1;let t,n;for(n=this.re.get_schema_search(),n.lastIndex=0;(t=n.exec(e))!==null;)if(this.testSchemaAt(e,t[2],n.lastIndex))return!0;if(this.__opts__.fuzzyLink&&this.__schemas__["http:"]&&(n=this.re.get_fuzzy_link_search(),n.lastIndex=0,n.exec(e)!==null))return!0;if(this.__opts__.fuzzyEmail&&this.__schemas__["mailto:"]&&e.indexOf("@")>=0){const i=this.re.get_fuzzy_mail_host_search(),o=this.re.get_mail_name_validator();for(i.lastIndex=0;(t=i.exec(e))!==null;){const s=e.slice(Math.max(0,t.index-65),t.index);if(o.test(s))return!0}}return!1}testSchemaAt(e,t,n){return this.__schemas__[t.toLowerCase()]?this.__schemas__[t.toLowerCase()].validate(e.slice(0,n+this.__opts__.maxLength),n,this):0}match(e){const t=[],n=this.re.get_schema_search();let i,o,s,r,l,a,u=!1,c=!1,d=!1,f=0;if(!e.length)return null;for(n.lastIndex=0,this.__opts__.fuzzyLink&&this.__schemas__["http:"]&&(i=this.re.get_fuzzy_link_search(),i.lastIndex=0),this.__opts__.fuzzyEmail&&this.__schemas__["mailto:"]&&(o=this.re.get_fuzzy_mail_host_search(),o.lastIndex=0,s=this.re.get_mail_name_validator());;){const h=Math.max(f-1,0);if(o&&s&&!d&&(!l||l.index=f)break;o.lastIndex=f)break;i.lastIndexm.lastIndex))&&(m=r);let g;if(!u)for(;;){if(!a){n.lastIndexm.index)break;const v=a;a=void 0;const C=this.testSchemaAt(e,v.schema,v.lastIndex);if(C){g={schema:v.schema,index:v.index,lastIndex:v.lastIndex+C};break}}let y=g;if((!y||l&&(l.indexy.lastIndex))&&(y=l),(!y||r&&(r.indexy.lastIndex))&&(y=r),!y)break;y===l?l=void 0:y===r&&(r=void 0);const k=new PE(e,y.schema,y.index,y.lastIndex);k.schema?this.__schemas__[k.schema].normalize(k,this):this.normalize(k),t.push(k),f=y.lastIndex}return t.length?t:null}matchAtStart(e){if(!e.length)return null;const t=this.re.get_schema_at_start().exec(e);if(!t)return null;const n=this.testSchemaAt(e,t[2],t[0].length);if(!n)return null;const i=new PE(e,t[2],t.index+t[1].length,t.index+t[0].length+n);return this.__schemas__[i.schema].normalize(i,this),i}tlds(e,t=!1){return e=Array.isArray(e)?e:[e],t?this.__opts__.tlds=this.__opts__.tlds.concat(e):this.__opts__.tlds=e,this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}normalize(e){e.schema||(e.url=`http://${e.url}`),e.schema==="mailto:"&&!/^mailto:/i.test(e.url)&&(e.url=`mailto:${e.url}`)}},Vfe=$j({"../../node_modules/.pnpm/punycode.js@2.3.1/node_modules/punycode.js/punycode.js":((e,t)=>{const d=/^xn--/,f=/[^\0-\x7F]/,h=/[\x2E\u3002\uFF0E\uFF61]/g,m={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},g=35,y=Math.floor,k=String.fromCharCode;function v(R){throw new RangeError(m[R])}function C(R,F){const P=[];let z=R.length;for(;z--;)P[z]=F(R[z]);return P}function w(R,F){const P=R.split("@");let z="";P.length>1&&(z=P[0]+"@",R=P[1]),R=R.replace(h,".");const W=C(R.split("."),F).join(".");return z+W}function M(R){const F=[];let P=0;const z=R.length;for(;P=55296&&W<=56319&&PString.fromCodePoint(...R),E=function(R){return R>=48&&R<58?26+(R-48):R>=65&&R<91?R-65:R>=97&&R<123?R-97:36},S=function(R,F){return R+22+75*(R<26)-((F!=0)<<5)},x=function(R,F,P){let z=0;for(R=P?y(R/700):R>>1,R+=y(R/F);R>g*26>>1;z+=36)R=y(R/g);return y(z+(g+1)*R/(R+38))},A=function(R){const F=[],P=R.length;let z=0,W=128,$=72,K=R.lastIndexOf("-");K<0&&(K=0);for(let ne=0;ne=128&&v("not-basic"),F.push(R.charCodeAt(ne));for(let ne=K>0?K+1:0;ne=P&&v("invalid-input");const _e=E(R.charCodeAt(ne++));_e>=36&&v("invalid-input"),_e>y((2147483647-z)/le)&&v("overflow"),z+=_e*le;const Z=ie<=$?1:ie>=$+26?26:ie-$;if(_ey(2147483647/se)&&v("overflow"),le*=se}const te=F.length+1;$=x(z-G,te,G==0),y(z/te)>2147483647-W&&v("overflow"),W+=y(z/te),z%=te,F.splice(z++,0,W)}return String.fromCodePoint(...F)},T=function(R){const F=[];R=M(R);const P=R.length;let z=128,W=0,$=72;for(const G of R)G<128&&F.push(k(G));const K=F.length;let ne=K;for(K&&F.push("-");ne=z&&ley((2147483647-W)/te)&&v("overflow"),W+=(G-z)*te,z=G;for(const le of R)if(le2147483647&&v("overflow"),le===z){let ie=W;for(let _e=36;;_e+=36){const Z=_e<=$?1:_e>=$+26?26:_e-$;if(ie32))return s;if(i===41){if(r===0)break;r--}o++}return t===o||r!==0||(s.str=Tv(e.slice(t,o)),s.pos=o,s.ok=!0),s}var Gj=dx;const E9=-2;function Kfe(e,t,n,i){let o=1,s=t+1;for(;s=0&&t+1>=c)return-1;const d=l.indexOf("]",t+1);if(d<0||d>=a)return e.linkLabelNoCloseFrom=t+1,-1;const f=Kfe(l,t,a,n);if(f!==E9)return f;for(e.pos=t+1;e.pos=n)return r;let l=e.charCodeAt(s);if(l!==34&&l!==39&&l!==40)return r;t++,s++,l===40&&(l=41),r.marker=l}for(;s=0?e.attrs[n][1]:null}function Qfe(e,t,n){const i=P4(e,t);i<0?px(e,[t,n]):e.attrs[i][1]=`${e.attrs[i][1]} ${n}`}var Yfe=Wj({attrGet:()=>Gfe,attrIndex:()=>P4,attrJoin:()=>Qfe,attrPush:()=>px,attrSet:()=>Zfe,parseLinkDestination:()=>dx,parseLinkLabel:()=>fx,parseLinkTitle:()=>hx});function Jfe(e){return e.includes("\r")||e.includes("\0")}function Yj(e){return typeof e=="string"?e:e.toString()}function Xfe(e){if(e.inlineMode){const t=new Ns("inline","",0);t.content=Yj(e.src),t.map=[0,1],t.children=[],t.level=0,e.tokens.push(t)}else e.md&&e.md.block&&e.md.block.parse(e.src,e.md,e.env,e.tokens)}const ehe=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,the=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function nhe(e,t){let n=e.pos;const i=e.src;if(i.charCodeAt(n)!==60)return!1;const o=n,s=e.posMax;for(;;){if(++n>=s)return!1;const l=i.charCodeAt(n);if(l===60)return!1;if(l===62)break}const r=i.slice(o+1,n);if(the.test(r)){const l=e.md.normalizeLink(r);if(!e.md.validateLink(l))return!1;if(!t){const a=e.push("link_open","a",1);a.attrs=[["href",l]],a.markup="autolink",a.info="auto";const u=e.push("text","",0);u.content=e.md.normalizeLinkText(r);const c=e.push("link_close","a",-1);c.markup="autolink",c.info="auto"}return e.pos+=r.length+2,!0}if(ehe.test(r)){const l=e.md.normalizeLink(`mailto:${r}`);if(!e.md.validateLink(l))return!1;if(!t){const a=e.push("link_open","a",1);a.attrs=[["href",l]],a.markup="autolink",a.info="auto";const u=e.push("text","",0);u.content=e.md.normalizeLinkText(r);const c=e.push("link_close","a",-1);c.markup="autolink",c.info="auto"}return e.pos+=r.length+2,!0}return!1}var Jj=nhe;function ihe(e,t){const n=e.src;let i=e.pos;if(n.charCodeAt(i)!==96)return!1;const o=i;i++;const s=e.posMax;for(;i2&&f.charCodeAt(0)===32&&f.charCodeAt(f.length-1)===32&&(f=f.slice(1,-1)),d.content=f}return e.pos=a,!0}e.backticks[c]=u}return e.backticksScanned=!0,t||(e.pending+=r),e.pos+=l,!0}var Xj=ihe;function BE(e){const t={},n=e.length;if(!n)return;let i=0,o=-2;const s=[];for(let r=0;ra;u-=s[u]+1){const d=e[u];if(d.marker===l.marker&&d.open&&d.end<0){let f=!1;if((d.close||l.open)&&(d.length+l.length)%3===0&&(d.length%3!==0||l.length%3!==0)&&(f=!0),!f){const h=u>0&&!e[u-1].open?s[u-1]+1:0;s[r]=r-u+h,s[u]=h,l.open=!1,d.end=r,d.close=!1,c=-1,o=-2;break}}}c!==-1&&(t[l.marker][(l.open?3:0)+(l.length||0)%3]=c)}}function ohe(e){const t=e.tokens_meta,n=e.tokens_meta.length;BE(e.delimiters);for(let i=0;i=0;o--){const s=t[o],r=s.marker;if(r!==95&&r!==42||s.end===-1)continue;const l=t[s.end],a=s.token,u=l.token,c=o>0&&t[o-1].end===s.end+1&&t[o-1].marker===r&&t[o-1].token===a-1&&t[s.end+1].token===u+1,d=r===42?eH:tH,f=i[a];c?(f.type="strong_open",f.tag="strong",f.nesting=1,f.markup=d+d,f.content=""):(f.type="em_open",f.tag="em",f.nesting=1,f.markup=d,f.content="");const h=i[u];c?(h.type="strong_close",h.tag="strong",h.nesting=-1,h.markup=d+d,h.content=""):(h.type="em_close",h.tag="em",h.nesting=-1,h.markup=d,h.content=""),c&&(i[t[o-1].token].content="",i[t[s.end+1].token].content="",o--)}}function lhe(e){const t=e.tokens_meta,n=e.tokens_meta.length;$E(e,e.delimiters);for(let i=0;i=48&&e<=57}function ahe(e){const t=e|32;return mx(e)||t>=97&&t<=102}function iH(e){const t=e|32;return t>=97&&t<=122}function uhe(e){return iH(e)||mx(e)}function che(e,t,n){let i=t+2;if(i>=n)return null;let o=!1,s=7,r=i;for((e.charCodeAt(i)|32)===120&&(o=!0,s=6,i++,r=i);i=n||e.charCodeAt(i)!==59?null:e.slice(t,i+1)}function dhe(e,t,n){let i=t+1;if(i>=n||!iH(e.charCodeAt(i)))return null;for(i++;i=n||e.charCodeAt(i)!==59)return null;const o=e.slice(t,i+1);return nH(o)!==o?o:null}function fhe(e,t){const n=e.pos,i=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=i)return!1;if(e.src.charCodeAt(n+1)===35){const o=che(e.src,n,i);if(o){if(!t){const s=(o.charCodeAt(2)|32)===120?Number.parseInt(o.slice(3,-1),16):Number.parseInt(o.slice(2,-1),10),r=e.push("text_special","",0);r.content=O4(s)?Mv(s):Mv(65533),r.markup=o,r.info="entity"}return e.pos+=o.length,!0}}else{const o=dhe(e.src,n,i);if(o){const s=nH(o);if(!t){const r=e.push("text_special","",0);r.content=s,r.markup=o,r.info="entity"}return e.pos+=o.length,!0}}return!1}var oH=fhe;const sH=(()=>{const e=new Array(256).fill(0),t="\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-";for(let n=0;n<32;n++)e[t.charCodeAt(n)]=1;return e})(),pA=new Array(128),rH=new Array(128);for(let e=0;e<128;e++){const t=String.fromCharCode(e);pA[e]=`\\${t}`,rH[e]=sH[e]?t:pA[e]}function zE(e,t,n){e.pending&&e.pushPending();const i=new Ns("text_special","",0);i.level=e.level,i.content=t,i.markup=n,i.info="escape",e.pendingLevel=e.level,e.tokens.push(i),e.tokens_meta.push(null)}function hhe(e,t){let n=e.pos;const i=e.posMax,o=e.src;if(o.charCodeAt(n)!==92||(n++,n>=i))return!1;let s=o.charCodeAt(n);if(s===10){for(t||e.push("hardbreak","br",0),n++;n=55296&&s<=56319&&n+1=56320&&a<=57343&&n++}return e.pos=n+1,!0}let r=o.charAt(n);if(s>=55296&&s<=56319&&n+1=56320&&a<=57343&&(r+=o.charAt(n+1),n++)}const l=`\\${r}`;return zE(e,s<256&&sH[s]?r:l,l),e.pos=n+1,!0}var lH=hhe;function phe(e){let t,n,i=0;const o=e.tokens,s=e.tokens.length;for(t=n=0;t0&&i++,r.type==="text"&&t+1\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,uH="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",ghe=new RegExp(`^(?:${aH}|${uH}||<\\?[\\s\\S]*?\\?>|]*>|)`),vhe=new RegExp(`^(?:${aH}|${uH})`);function cH(e){return e===32||e===9||e===10||e===12||e===13}function yhe(e){if(e.length<3||e.charCodeAt(0)!==60||(e.charCodeAt(1)|32)!==97)return!1;const t=e.charCodeAt(2);return t===62||cH(t)}function khe(e){if(e.length<4||e.charCodeAt(0)!==60||e.charCodeAt(1)!==47||(e.charCodeAt(2)|32)!==97)return!1;for(let t=3;t=97&&t<=122}function whe(e,t){if(!e.md.options.html)return!1;const n=e.posMax,i=e.pos,o=e.src;if(o.charCodeAt(i)!==60||i+2>=n)return!1;const s=o.charCodeAt(i+1);if(s!==33&&s!==63&&s!==47&&!bhe(s))return!1;const r=o.slice(i).match(ghe);if(!r)return!1;const l=r[0];if(!t){const a=e.pushSimple("html_inline","");a.content=l,yhe(l)&&e.linkLevel++,khe(l)&&e.linkLevel--}return e.pos+=l.length,!0}var dH=whe;function Che(e,t){let n,i,o,s,r,l,a,u,c="";const d=e.pos,f=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const h=e.pos+2,m=Jk(e,e.pos+1,!1);if(m<0)return!1;if(s=m+1,s=f)return!1;if(l=Gj(e.src,s,e.posMax),l.ok){for(c=e.md.normalizeLink(l.str),e.md.validateLink(c)?s=l.pos:c="",u=s;s=f||e.src.charCodeAt(s)!==41)return e.pos=d,!1;s++}else{if(typeof e.env.references>"u")return!1;if(s=0?o=e.src.slice(u,s++):s=m+1):s=m+1,o||(o=e.src.slice(h,m)),r=e.env.references[R4(o)],!r)return e.pos=d,!1;c=r.href,a=r.title}if(!t){i=e.src.slice(h,m);const g=[];e.md.inline.parse(i,e.md,e.env,g);const y=e.push("image","img",0);y.attrs=[["src",c],["alt",""]],y.children=g,y.content=i,a&&y.attrs.push(["title",a])}return e.pos=s,e.posMax=f,!0}var fH=Che;function B3(e,t,n){for(;t"u")return!1;let d;if(l=r+1,l=0?(d=n.slice(h,m),d||(d=n.slice(s,r)),l=m+1):d=n.slice(s,r)}else d=n.slice(s,r);const f=e.env.references[R4(d)];if(!f)return e.pos=i,!1;a=f.href,u=f.title}if(!t){e.pos=s,e.posMax=r;const d=e.push("link_open","a",1);d.attrs=u?[["href",a],["title",u]]:[["href",a]],e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=l,e.posMax=o,!0}var hH=Ahe;function pH(e){const t=e|32;return t>=97&&t<=122}function xhe(e){return e>=48&&e<=57}function She(e){return pH(e)||xhe(e)||e===43||e===45||e===46}function _he(e){if(e.length===0)return null;let t=e.length-1;for(;t>=0&&She(e.charCodeAt(t));)t--;return t++,t>=e.length||!pH(e.charCodeAt(t))?null:e.slice(t)}function Ihe(e,t,n){let i=t;for(;i0)return!1;const n=e.pos,i=e.posMax;if(n+3>i||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;const o=_he(e.pending);if(!o)return!1;const s=Ihe(e.src,n-o.length,i),r=e.md.linkify.matchAtStart(s);if(!r)return!1;let l=r.url;if(l.length<=o.length)return!1;let a=l.length;for(;a>0&&l.charCodeAt(a-1)===42;)a--;a!==l.length&&(l=l.slice(0,a));const u=e.md.normalizeLink(l);if(!e.md.validateLink(u))return!1;if(!t){e.pending=e.pending.slice(0,-o.length);const c=e.push("link_open","a",1);c.attrs=[["href",u]],c.markup="linkify",c.info="auto";const d=e.push("text","",0);d.content=e.md.normalizeLinkText(l);const f=e.push("link_close","a",-1);f.markup="linkify",f.info="auto"}return e.pos+=l.length-o.length,!0}function Mhe(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const i=e.pending.length-1,o=e.posMax;if(!t)if(i>=0&&e.pending.charCodeAt(i)===32)if(i>=1&&e.pending.charCodeAt(i-1)===32){let s=i-1;for(;s>=1&&e.pending.charCodeAt(s-1)===32;)s--;e.pending=e.pending.slice(0,s),e.pushSimple("hardbreak","br")}else e.pending=e.pending.slice(0,-1),e.pushSimple("softbreak","br");else e.pushSimple("softbreak","br");for(n++;n=o||HE(n.charCodeAt(i)))return!1;let s=i+1;for(;si-o),n=Math.floor(t.length/2);return t.length%2===0?(t[n-1]+t[n])/2:t[n]}function Fhe(e,t){return{chain:e,name:t,calls:0,hits:0,inclusiveMs:0,medianMs:0,maxMs:0,normalCalls:0,normalHits:0,silentCalls:0,silentHits:0,samples:[]}}function yH(e){const t=e;if(!t)return null;if(t.__mdtsRuleProfile)return t.__mdtsRuleProfile;if(!t.__mdtsProfileRules)return null;const n=t.__mdtsProfileRules===!0?{}:t.__mdtsProfileRules,i={enabled:!0,fixture:n.fixture,mode:n.mode,startedAt:gx(),records:Object.create(null)};return t.__mdtsRuleProfile=i,i}function om(e,t,n,i,o,s){const r=yH(e);if(!r)return;const l=`${t}:${n}`,a=r.records[l]??(r.records[l]=Fhe(t,n));a.calls++,a.inclusiveMs+=i,i>a.maxMs&&(a.maxMs=i),a.samples.push(i),s?(a.silentCalls++,o&&a.silentHits++):(a.normalCalls++,o&&a.normalHits++),o&&a.hits++,r.completedAt=gx()}function Dhe(e){const t=yH(e);if(!t)return null;const n=Object.keys(t.records);for(let i=0;io.name===e);i>=0&&this.rules.splice(i,1),this.rules.push({name:e,fn:t,alt:n?.alt||[],enabled:!0}),this.invalidateCache()}at(e,t,n){const i=this.rules.findIndex(o=>o.name===e);if(t===void 0){if(i<0)return;const o=this.rules[i];return Object.freeze({name:o.name,fn:o.fn,alt:o.alt?Object.freeze(o.alt.slice()):void 0,enabled:o.enabled})}if(i<0)throw new Error(`Parser rule not found: ${e}`);this.rules[i].fn=t,n?.alt!==void 0&&(this.rules[i].alt=n.alt),this.invalidateCache()}before(e,t,n,i){const o=this.rules.findIndex(r=>r.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this.rules.findIndex(r=>r.name===t);s>=0&&this.rules.splice(s,1),this.rules.splice(o,0,{name:t,fn:n,alt:i?.alt||[],enabled:!0}),this.invalidateCache()}after(e,t,n,i){const o=this.rules.findIndex(r=>r.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this.rules.findIndex(r=>r.name===t);s>=0&&this.rules.splice(s,1),this.rules.splice(o+1,0,{name:t,fn:n,alt:i?.alt||[],enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;for(const s of n){const r=this.rules.findIndex(l=>l.name===s);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${s}`);continue}i.push(s),this.rules[r].enabled||(this.rules[r].enabled=!0,o=!0)}return o&&this.invalidateCache(),i}disable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;for(const s of n){const r=this.rules.findIndex(l=>l.name===s);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${s}`);continue}i.push(s),this.rules[r].enabled&&(this.rules[r].enabled=!1,o=!0)}return o&&this.invalidateCache(),i}enableOnly(e){const t=new Set(e);let n=!1;for(const i of this.rules){const o=t.has(i.name);i.enabled!==o&&(i.enabled=o,n=!0)}n&&this.invalidateCache()}getRules(e){const t=e||"";return this.cache||this.compileCache(),this.cache.get(t)??[]}getNamedRules(e){const t=e||"";return this.namedCache||this.compileCache(),this.namedCache.get(t)??[]}compileCache(){const e=new Set([""]);for(const i of this.rules)if(i.enabled&&i.alt)for(const o of i.alt)e.add(o);const t=new Map,n=new Map;for(const i of e){const o=[],s=[];for(const r of this.rules)r.enabled&&(i!==""&&!r.alt?.includes(i)||(o.push(r.fn),s.push({name:r.name,fn:r.fn})));t.set(i,o),n.set(i,s)}this.cache=t,this.namedCache=n}},kH=class{src;md;env;tokens;tokens_meta;pos;posMax;level;pending;pendingLevel;cache;delimiters;_prev_delimiters;backticks;backticksScanned;linkLevel;linkLabelNoCloseFrom;maxNesting;constructor(e,t,n,i){this.src=e,this.md=t,this.env=n,this.tokens=i,this.tokens_meta=new Array(i.length),this.pos=0,this.posMax=e.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache=[],this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0,this.linkLabelNoCloseFrom=-1,this.maxNesting=t.options.maxNesting}pushPending(){const e=new Ns("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e}pushSimple(e,t){this.pending&&this.pushPending();const n=new Ns(e,t,0);return n.level=this.level,this.pendingLevel=this.level,this.tokens.push(n),this.tokens_meta.push(null),n}push(e,t,n){if(this.pending&&this.pushPending(),n===0)return this.pushSimple(e,t);const i=new Ns(e,t,n);let o=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),i.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],o={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(i),this.tokens_meta.push(o),i}scanDelims(e,t){const{src:n,posMax:i}=this,o=n.charCodeAt(e);let s=e;for(;s0?n.charCodeAt(e-1):32,a=s@[\]\\^_`{}~]/;function qE(e,t){switch(e.src.charCodeAt(e.pos)){case 10:return gH(e,t);case 33:return fH(e,t);case 38:return oH(e,t);case 42:case 95:return hA.tokenize(e,t);case 58:return e.md.options.linkify&&mH(e,t);case 60:return Jj(e,t)||dH(e,t);case 91:return hH(e,t);case 92:return lH(e,t);case 96:return Xj(e,t);case 126:return mA.tokenize(e,t);default:return vH(e,t)}}function bH(e){return!Rhe.test(e)}var Ohe=class{ruler;ruler2;cachedRulesVersion=-1;cachedRules=[];cachedRules2Version=-1;cachedRules2=[];defaultRulerVersion;defaultRuler2Version;constructor(){this.ruler=new WE,this.ruler2=new WE,this.ruler.push("text",vH),this.ruler.push("linkify",mH),this.ruler.push("newline",gH),this.ruler.push("escape",lH),this.ruler.push("backticks",Xj),this.ruler.push("strikethrough",mA.tokenize),this.ruler.push("emphasis",hA.tokenize),this.ruler.push("link",hH),this.ruler.push("image",fH),this.ruler.push("autolink",Jj),this.ruler.push("html_inline",dH),this.ruler.push("entity",oH),this.ruler2.push("balance_pairs",she),this.ruler2.push("strikethrough",mA.postProcess),this.ruler2.push("emphasis",hA.postProcess),this.ruler2.push("fragments_join",mhe),this.defaultRulerVersion=this.ruler.version,this.defaultRuler2Version=this.ruler2.version}skipToken(e){const t=e.pos,n=this.getRules(),i=n.length,o=e.cache,s=o[t],r=!!e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules"));if(s!==void 0){e.pos=s;return}let l=!1;if(e.level=e.pos)throw new Error("inline rule didn't increment state.pos");break}}}else if(this.isDefaultRuleset()){if(e.level++,l=qE(e,!0),e.level--,l&&t>=e.pos)throw new Error("inline rule didn't increment state.pos")}else for(let a=0;a=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;l||e.pos++,o[t]=e.pos}tokenize(e){const t=this.getRules(),n=t.length,i=e.posMax;if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(e.env,"__mdtsProfileRules")))){const s=this.isDefaultRuleset();for(;e.pos=e.pos)throw new Error("inline rule didn't increment state.pos")}if(l){if(e.pos>=i)break;continue}e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending();return}const o=this.ruler.getNamedRules("");for(;e.pos=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(r){if(e.pos>=i)break;continue}e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending()}isDefaultRuleset(){return this.ruler.version===this.defaultRulerVersion&&this.ruler2.version===this.defaultRuler2Version}parseSource(e,t,n,i){if(typeof e=="string"&&e.length>0&&this.isDefaultRuleset()&&bH(e)){const a=new Ns("text","",0);a.content=e,i.push(a);return}const o=new kH(e,t,n,i);this.tokenize(o);const s=this.getRules2(),r=s.length;if(!(o.env&&(Object.prototype.hasOwnProperty.call(o.env,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(o.env,"__mdtsProfileRules")))){for(let a=0;a0&&bH(s.content)){const r=new Ns("text","",0);r.content=s.content,s.children.push(r);continue}e.md.inline.parse(s.content,e.md,e.env,s.children)}}}const Bhe=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u,$he=/[0-9a-z]/i;function zhe(e){return/^\s]/i.test(e)}function jhe(e){return/^<\/a\s*>/i.test(e)}function Hhe(e,t){if(t.schema||t.index!==0||!t.raw)return t;for(let n=1;n=0;r--){const l=o[r];if(l.type==="link_close"){for(r--;r>=0&&o[r].level!==l.level&&o[r].type!=="link_open";)r--;continue}if(l.type==="html_inline"&&(zhe(l.content)&&s>0&&s--,jhe(l.content)&&s++),s>0||l.type!=="text"||!e.md.linkify.test(l.content))continue;const a=l.content;let u=(e.md.linkify.match(a)||[]).map(h=>Hhe(e.md.linkify,h));if(u.length===0)continue;const c=[];let d=l.level,f=0;u.length>0&&u[0].index===0&&r>0&&o[r-1].type==="text_special"&&(u=u.slice(1));for(let h=0;hf){const M=new Ns("text","",0);M.content=a.slice(f,k),M.level=d,c.push(M)}const v=new Ns("link_open","a",1);v.attrs=[["href",g]],v.level=d++,v.markup="linkify",v.info="auto",c.push(v);const C=new Ns("text","",0);C.content=y,C.level=d,c.push(C);const w=new Ns("link_close","a",-1);w.level=--d,w.markup="linkify",w.info="auto",c.push(w),f=m.lastIndex}if(f!==0){if(f=0;n--){const i=e[n];i.type==="text"&&!t&&(i.content=i.content.replace(Zhe,Qhe)),i.type==="link_open"&&i.info==="auto"&&t--,i.type==="link_close"&&i.info==="auto"&&t++}}function Jhe(e){let t=0;for(let n=e.length-1;n>=0;n--){const i=e[n];i.type==="text"&&!t&&wH.test(i.content)&&(i.content=i.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/gm,"$1—").replace(/(^|\s)--(?=\s|$)/gm,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,"$1–")),i.type==="link_open"&&i.info==="auto"&&t--,i.type==="link_close"&&i.info==="auto"&&t++}}function Xhe(e){if(e.md?.options?.typographer)for(let t=e.tokens.length-1;t>=0;t--){const n=e.tokens[t];if(n.type!=="inline")continue;const i=n.content||(Array.isArray(n.children)?n.children.map(o=>o.type==="text"?o.content:"").join(""):"");Khe.test(i)&&Yhe(n.children||[]),wH.test(i)&&Jhe(n.children||[])}}var epe=class{rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t){const n=this.rules.findIndex(i=>i.name===e);n>=0&&this.rules.splice(n,1),this.rules.push({name:e,fn:t,enabled:!0}),this.invalidateCache()}at(e,t){const n=this.rules.findIndex(i=>i.name===e);if(n<0)throw new Error(`Parser rule not found: ${e}`);this.rules[n].fn=t,this.invalidateCache()}before(e,t,n){const i=this.rules.findIndex(s=>s.name===e);if(i<0)throw new Error(`Parser rule not found: ${e}`);const o=this.rules.findIndex(s=>s.name===t);o>=0&&this.rules.splice(o,1),this.rules.splice(i,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}after(e,t,n){const i=this.rules.findIndex(s=>s.name===e);if(i<0)throw new Error(`Parser rule not found: ${e}`);const o=this.rules.findIndex(s=>s.name===t);o>=0&&this.rules.splice(o,1),this.rules.splice(i+1,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;for(const s of n){const r=this.rules.findIndex(l=>l.name===s);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${s}`);continue}i.push(s),this.rules[r].enabled||(this.rules[r].enabled=!0,o=!0)}return o&&this.invalidateCache(),i}disable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;for(const s of n){const r=this.rules.findIndex(l=>l.name===s);if(r<0){if(!t)throw new Error(`Rules manager: invalid rule name ${s}`);continue}i.push(s),this.rules[r].enabled&&(this.rules[r].enabled=!1,o=!0)}return o&&this.invalidateCache(),i}enableOnly(e){const t=new Set(e);let n=!1;for(const i of this.rules){const o=t.has(i.name);i.enabled!==o&&(i.enabled=o,n=!0)}n&&this.invalidateCache()}compileCache(){this.cache=this.rules.filter(e=>e.enabled).map(e=>e.fn),this.namedCache=this.rules.filter(e=>e.enabled).map(e=>({name:e.name,fn:e.fn}))}getRules(e=""){return this.cache||this.compileCache(),this.cache}getNamedRules(e=""){return this.namedCache||this.compileCache(),this.namedCache}};const tpe=/['"]/,UE=/['"]/g,VE="’";function wy(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function npe(e,t){let n;const i=[],o=t.md&&t.md.options&&t.md.options.quotes||"“”‘’";for(let s=0;s=0&&!(i[n].level<=l);n--);if(i.length=n+1,r.type!=="text")continue;let a=r.content,u=0,c=a.length;e:for(;u=0)g=a.charCodeAt(d.index-1);else for(n=s-1;n>=0&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n--)if(e[n].content){g=e[n].content.charCodeAt(e[n].content.length-1);break}let y=32;if(u=48&&g<=57&&(h=f=!1),f&&h&&(f=k,h=v),!f&&!h){m&&(r.content=wy(r.content,d.index,VE));continue}if(h)for(n=i.length-1;n>=0;n--){let M=i[n];if(i[n].level=0;t--){const n=e.tokens[t];if(n.type!=="inline")continue;const i=typeof n.content=="string"?n.content:(n.children||[]).map(o=>o.content||"").join("");!tpe.test(i)||!n.children||npe(n.children,e)}}function ope(e){const t=e.tokens||[],n=t.length;for(let i=0;i=4||o.charCodeAt(c)!==62)return!1;if(i)return!0;const h=[],m=[],g=[],y=[],k=e.md.block.ruler.getRulesForState(e,"blockquote"),v=e.parentType;e.parentType="blockquote";let C=!1,w;for(w=t;w=d)break;if(o.charCodeAt(c++)===62&&!x){let T=a[w]+1,I,O;o.charCodeAt(c)===32?(c++,T++,O=!1,I=!0):o.charCodeAt(c)===9?(I=!0,(u[w]+T)%4===3?(c++,T++,O=!1):O=!0):I=!1;let H=T;for(h.push(s[w]),s[w]=c;c=d,m.push(u[w]),u[w]=a[w]+1+(I?1:0),g.push(a[w]),a[w]=H-T,y.push(l[w]),l[w]=c-s[w];continue}if(C)break;let A=!1;for(let T=0,I=k.length;T";const E=[t,0];L.map=E,e.md.block.tokenize(e,t,w);const S=e.push("blockquote_close","blockquote",-1);S.markup=">",e.lineMax=f,e.parentType=v,E[1]=e.line;for(let x=0;x=4){i++,o=i;continue}break}e.line=o;const s=e.push("code_block","code",0);return s.content=`${e.getLines(t,o,4+e.blkIndent,!1)} -`,s.map=[t,e.line],!0}function cpe(e,t,n,i){let o=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||o+3>s)return!1;const r=e.src.charCodeAt(o);if(r!==126&&r!==96)return!1;let l=o;o=e.skipChars(o,r);let a=o-l;if(a<3)return!1;const u=e.src.slice(l,o),c=e.src.slice(o,s);if(r===96&&c.includes(String.fromCharCode(r)))return!1;if(i)return!0;let d=t,f=!1;for(;d++,!(d>=n||(o=l=e.bMarks[d]+e.tShift[d],s=e.eMarks[d],o=4)&&(o=e.skipChars(o,r),!(o-l=4)return!1;let c=o.charCodeAt(a);if(c!==35||a>=u)return!1;let d=1;for(c=o.charCodeAt(++a);c===35&&a6||aa&&GE(o.charCodeAt(f-1))&&(u=f),e.line=t+1;const h=e.push("heading_open",KE[d],1);h.markup=ZE[d],h.map=[t,e.line];const m=e.push("inline","",0);m.content=o.slice(a,u).trim(),m.map=[t,e.line],m.children=[];const g=e.push("heading_close",KE[d],-1);return g.markup=ZE[d],!0}function fpe(e){switch(e){case 9:case 32:return!0}return!1}function hpe(e,t,n,i){const o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let s=e.bMarks[t]+e.tShift[t];const r=e.src.charCodeAt(s++);if(r!==42&&r!==45&&r!==95)return!1;let l=1;for(;s|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp(`^|$))`,"i"),/^$/,!0],[new RegExp(`${vhe.source}\\s*$`),/^$/,!1]];function ppe(e,t,n,i){let o=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(o)!==60)return!1;let r=e.src.slice(o,s),l=0;for(;l=48&&e<=57}var _H=class{src;md;env;tokens;bMarks=[];eMarks=[];tShift=[];sCount=[];bsCount=[];lineFlags=[];blkIndent=0;line=0;lineMax=0;tight=!1;ddIndent=-1;listIndent=-1;parentType="root";level=0;constructor(e,t,n,i){this.src=e,this.md=t,this.env=n,this.tokens=i;const o=this.src;let s=0,r=0,l=0,a=!1,u=0;for(let c=0,d=o.length;c0&&this.level++,this.tokens.push(i),i}isEmpty(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]}skipEmptyLines(e){const t=this.bMarks,n=this.tShift,i=this.eMarks;for(let o=this.lineMax;et;){const i=n.charCodeAt(--e);if(i!==9&&i!==32)return e+1}return e}skipChars(e,t){const n=this.src;for(let i=n.length;en;)if(t!==i.charCodeAt(--e))return e+1;return e}getLines(e,t,n,i){if(e>=t)return"";if(e+1===t){const c=e,d=this.bMarks[c];let f=d;const h=i?this.eMarks[c]+1:this.eMarks[c];let m=0;const g=this.src,y=this.bsCount,k=this.tShift;for(;fn?new Array(m-n+1).join(" ")+g.slice(f,h):g.slice(f,h)}const o=new Array(t-e),s=this.src,r=this.bMarks,l=this.eMarks,a=this.bsCount,u=this.tShift;for(let c=0,d=e;dn?o[c]=new Array(f-n+1).join(" ")+s.slice(m,g):o[c]=s.slice(m,g)}return o.join("")}};_H.prototype.Token=Ns;function gpe(e,t,n){for(let i=t;i=o)return!1;const s=n.charCodeAt(i);switch(s){case 35:case 42:case 43:case 45:case 60:case 62:case 95:case 96:case 126:return!0}return s>=48&&s<=57?!0:gpe(n,i,o)}const YE=["","h1","h2"];function vpe(e,t,n){const i=e.md.block.ruler.getRulesForState(e,"paragraph"),o=e.src,s=e.bMarks,r=e.tShift,l=e.eMarks,a=e.sCount,u=e.blkIndent,c=IH(e);if(a[t]-u>=4)return!1;const d=e.parentType;e.parentType="paragraph";let f=0,h,m=t+1;for(;m=M)break;if(a[m]-u>3)continue;if(a[m]>=u&&(h=o.charCodeAt(w),h===45||h===61)){let E=w+1,S=E;for(;E=M){f=h===61?1:2;break}if(S-w>1)continue}if(a[m]<0||c&&!MH(e,m,o,w,M))continue;let L=!1;for(let E=0,S=i.length;Ew;){const L=o.charCodeAt(M-1);if(L!==9&&L!==32)break;M--}g=o.slice(w,M)}else g=e.getLines(t,m,u,!1).trim();e.line=m+1;const y=h===61?"=":"-",k=e.push("heading_open",YE[f],1);k.markup=y,k.map=[t,e.line];const v=e.push("inline","",0);v.content=g,v.map=[t,e.line-1],v.children=[];const C=e.push("heading_close",YE[f],-1);return C.markup=y,e.parentType=d,!0}function TH(e){switch(e){case 9:case 32:return!0}return!1}function JE(e,t){const n=e.eMarks,i=e.bMarks,o=e.tShift,s=e.src,r=n[t];let l=i[t]+o[t];const a=s.charCodeAt(l++);return a!==42&&a!==45&&a!==43||l=l)return-1;let u=s.charCodeAt(a++);if(u<48||u>57)return-1;for(;;){if(a>=l)return-1;if(u=s.charCodeAt(a++),u>=48&&u<=57){if(a-r>=10)return-1;continue}if(u===41||u===46)break;return-1}return a0&&++o=4||e.listIndent>=0&&e.sCount[l]-e.listIndent>=4&&e.sCount[l]=e.blkIndent&&(u=!0);let c,d,f;const h=e.src,m=e.bMarks,g=e.tShift,y=e.eMarks,k=e.sCount,v=e.bsCount,C=m[l]+g[l];if(C>=y[l])return!1;const w=h.charCodeAt(C);if(w>=48&&w<=57){if(f=XE(e,l),f<0||(c=!0,r=C,d=ype(e,l,f),u&&d!==1))return!1}else if(w===42||w===45||w===43){if(f=JE(e,l),f<0)return!1;c=!1}else return!1;if(u&&e.skipSpaces(f)>=y[l])return!1;if(i)return!0;const M=h.charCodeAt(f-1),L=String.fromCharCode(M);if(c){const I=e.push("ordered_list_open","ol",1);d!==void 0&&d!==1&&(I.attrs=[["start",String(d)]])}else e.push("bullet_list_open","ul",1);const E=[l,0];e.tokens[e.tokens.length-1].map=E,e.tokens[e.tokens.length-1].markup=L;let S=!1;const x=e.tokens.length-1,A=e.md.block.ruler.getRulesForState(e,"list"),T=e.parentType;for(e.parentType="list";l=o?R=1:R=O-I,R>4&&(R=1);const F=I+R,P=e.push("list_item_open","li",1);P.markup=L;const z=[l,0];P.map=z,c&&(P.info=f-r-1===1?kpe[h.charCodeAt(r)-48]:h.slice(r,f-1));const W=e.tight,$=e.tShift[l],K=e.sCount[l],ne=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=F,e.tight=!0,e.tShift[l]=H-m[l],e.sCount[l]=O,H>=o&&e.isEmpty(l+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,l,n,!0),(!e.tight||S)&&(a=!1),S=e.line-l>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=ne,e.tShift[l]=$,e.sCount[l]=K,e.tight=W,e.push("list_item_close","li",-1).markup=L,l=e.line,z[1]=l,l>=n||e.sCount[l]=4)break;let G=!1;for(let te=0,le=A.length;te3||u[f]<0)continue;if(o==="list"&&u[f]>=c){const C=r[f]+l[f],w=a[f];if(C=w||eL(s.charCodeAt(C+1)))break}else if(M>=48&&M<=57&&C+1=w){L=-1;break}const E=s.charCodeAt(L++);if(E>=48&&E<=57){if(L-C>=10){L=-1;break}continue}if((E===41||E===46)&&(L>=w||eL(s.charCodeAt(L))))break;L=-1;break}if(L>=0)break}}}const y=r[f]+l[f],k=a[f];if(d&&!MH(e,f,s,y,k))continue;let v=!1;for(let C=0,w=i.length;C=4||e.src.charCodeAt(o)!==91)return!1;function a(C){const w=e.lineMax;if(C>=w||e.isEmpty(C))return null;let M=!1;if(e.sCount[C]-e.blkIndent>3&&(M=!0),e.sCount[C]<0&&(M=!0),!M){const S=e.parentType;e.parentType="reference";let x=!1;for(let A=0,T=l.length;A"u"&&(e.env.references={}),typeof e.env.references[v]>"u"&&(e.env.references[v]={title:k,href:f}),e.line=r),!0):!1}function $3(e){switch(e){case 9:case 32:return!0}return!1}const xpe=65536;function z3(e,t){const n=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];return e.src.slice(n,i)}function Spe(e,t){if(e.lineFlags)return(e.lineFlags[t]&F0.Pipe)!==0;for(let n=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];nn)return!1;let o=t+1;if(e.sCount[o]=4)return!1;let s=e.bMarks[o]+e.tShift[o];if(s>=e.eMarks[o])return!1;const r=e.src.charCodeAt(s++);if(r!==124&&r!==45&&r!==58||s>=e.eMarks[o])return!1;const l=e.src.charCodeAt(s++);if(l!==124&&l!==45&&l!==58&&!$3(l)||r===45&&$3(l)||!Spe(e,t))return!1;for(;s=4)return!1;u=tL(a),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop();const d=u.length;if(d===0||d!==c.length)return!1;if(i)return!0;const f=e.parentType;e.parentType="table";const h=e.md.block.ruler.getRulesForState(e,"blockquote"),m=e.push("table_open","table",1),g=[t,0];m.map=g;const y=e.push("thead_open","thead",1);y.map=[t,t+1];const k=e.push("tr_open","tr",1);k.map=[t,t+1];for(let w=0;w=4||(u=tL(a),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop(),C+=d-u.length,C>xpe))break;if(o===t+2){const L=e.push("tbody_open","tbody",1);L.map=v=[t+2,0]}const M=e.push("tr_open","tr",1);M.map=[o,o+1];for(let L=0;Lr.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this._rules.findIndex(r=>r.name===t);s>=0&&this._rules.splice(s,1),this._rules.splice(o,0,{name:t,enabled:!0,fn:n,alt:i?.alt||[]}),this.invalidateCache()}after(e,t,n,i){const o=this._rules.findIndex(r=>r.name===e);if(o<0)throw new Error(`Parser rule not found: ${e}`);const s=this._rules.findIndex(r=>r.name===t);s>=0&&this._rules.splice(s,1),this._rules.splice(o+1,0,{name:t,enabled:!0,fn:n,alt:i?.alt||[]}),this.invalidateCache()}getRules(e){const t=e||"";return this.cache||this.compileCache(),this.cache[t]??[]}getNamedRules(e){const t=e||"";return this.namedCache||this.compileCache(),this.namedCache[t]??[]}getRulesForState(e,t){const n=e?.env;return n&&(Object.prototype.hasOwnProperty.call(n,"__mdtsRuleProfile")||Object.prototype.hasOwnProperty.call(n,"__mdtsProfileRules"))?this.getNamedRules(t).map(({name:i,fn:o})=>(s,r,l,a)=>{const u=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now(),c=o(s,r,l,a),d=typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now();return om(s?.env,"block",i,d-u,c,!!a),c}):this.getRules(t)}at(e,t,n){const i=this._rules.findIndex(o=>o.name===e);if(i===-1)throw new Error(`Parser rule not found: ${e}`);this._rules[i].fn=t,n?.alt&&(this._rules[i].alt=n.alt),this.invalidateCache()}enable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;return n.forEach(s=>{const r=this._rules.findIndex(l=>l.name===s);if(r===-1){if(t)return;throw new Error(`Rules manager: invalid rule name ${s}`)}i.push(s),this._rules[r].enabled||(this._rules[r].enabled=!0,o=!0)}),o&&this.invalidateCache(),i}disable(e,t){const n=Array.isArray(e)?e:[e],i=[];let o=!1;return n.forEach(s=>{const r=this._rules.findIndex(l=>l.name===s);if(r===-1){if(t)return;throw new Error(`Rules manager: invalid rule name ${s}`)}i.push(s),this._rules[r].enabled&&(this._rules[r].enabled=!1,o=!0)}),o&&this.invalidateCache(),i}enableOnly(e){const t=new Set(e);let n=!1;for(const i of this._rules){const o=t.has(i.name);i.enabled!==o&&(i.enabled=o,n=!0)}n&&this.invalidateCache()}compileCache(){const e=new Set([""]);for(const i of this._rules)if(i.enabled)for(const o of i.alt)e.add(o);const t=Object.create(null),n=Object.create(null);for(const i of e){const o=[],s=[];for(const r of this._rules)r.enabled&&(i!==""&&!r.alt.includes(i)||(o.push(r.fn),s.push({name:r.name,fn:r.fn})));t[i]=o,n[i]=s}this.cache=t,this.namedCache=n}};const Ay=[["table",_pe,["paragraph","reference"]],["code",upe],["fence",cpe,["paragraph","reference","blockquote","list"]],["blockquote",ape,["paragraph","reference","blockquote","list"]],["hr",hpe,["paragraph","reference","blockquote","list"]],["list",wpe,["paragraph","reference","blockquote"]],["reference",Ape],["html_block",ppe,["paragraph","reference","blockquote"]],["heading",dpe,["paragraph","reference","blockquote"]],["lheading",vpe],["paragraph",Cpe]];var Mpe=class{ruler;cachedRulesVersion=-1;cachedRules=[];constructor(){this.ruler=new Ipe;for(let e=0;e=a[c];)c++;if(e.line=c,c>=n||u[c]=s){e.line=n;break}const h=e.line;let m=!1;for(let g=0;g=e.line)throw new Error("block rule didn't increment state.line");break}if(!m)throw new Error("none of the block rules matched");e.tight=!d,r[e.line-1]+l[e.line-1]>=a[e.line-1]&&(d=!0),c=e.line,c=a[c]&&(d=!0,c++,e.line=c)}return}const f=this.ruler.getNamedRules("");for(;c=a[c];)c++;if(e.line=c,c>=n||u[c]=s){e.line=n;break}const h=e.line;let m=!1;for(let g=0;g=e.line)throw new Error("block rule didn't increment state.line");break}}if(!m)throw new Error("none of the block rules matched");e.tight=!d,r[e.line-1]+l[e.line-1]>=a[e.line-1]&&(d=!0),c=e.line,c=a[c]&&(d=!0,c++,e.line=c)}}parse(e,t,n,i){if(!e||e.length===0)return;const o=new _H(e,t,n,i);this.tokenize(o,o.line,o.lineMax)}getRules(){return this.cachedRulesVersion!==this.ruler.version&&(this.cachedRules=this.ruler.getRules(""),this.cachedRulesVersion=this.ruler.version),this.cachedRules}},EH=class{src;env;tokens;inlineMode;md;constructor(e,t,n={}){this.src=typeof e=="string"?e||"":e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}};EH.prototype.Token=Ns;const nL=[["normalize",Vhe],["block",Xfe],["inline",Phe],["linkify",Whe],["replacements",Xhe],["smartquotes",ipe],["text_join",ope]],Tpe={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:100},Epe={parseLinkLabel:fx,parseLinkDestination:dx,parseLinkTitle:hx};function Lpe(){return{...Tpe}}function Npe(){return{...Epe}}var Fpe=class{fallbackParser;lastState=null;block;inline;ruler;linkifyInstance=null;cachedCoreRulesVersion=-1;cachedCoreRules=[];cachedCoreNamedRulesVersion=-1;cachedCoreNamedRules=[];constructor(){this.block=new Mpe,this.inline=new Ohe,this.ruler=new epe;for(let e=0;e@[\]\\^_`{}~]/;function Xk(e){return!Dpe.test(e)}function s0(e,t){const n=e.indexOf(` -`,t);return n===-1?e.length:n}function L9(e,t,n){for(let i=t;i3)return Xk(e);for(let t=0;t=i||t.charCodeAt(r)!==32)return!1;let l=r+1;for(;ll&&t.charCodeAt(a-1)===32;)a--;let u=a;for(;u>l&&t.charCodeAt(u-1)===35;)u--;if(u>l&&t.charCodeAt(u-1)===32)for(a=u-1;a>l&&t.charCodeAt(a-1)===32;)a--;const c=t.slice(l,a);if(!Xk(c))return!1;const d=Ope[s],f=Ppe[s],h=Ba("heading_open",d,1,0);h.map=[o,o+1],h.markup=f,e.push(h),e.push(vx(c,o,1));const m=Ba("heading_close",d,-1,0);return m.markup=f,e.push(m),!0}function $pe(e,t,n){const i=Ba("paragraph_open","p",1,0);i.map=[n,n+1],e.push(i),e.push(vx(t,n,1)),e.push(Ba("paragraph_close","p",-1,0))}function zpe(e,t,n){const i=e.charCodeAt(n-1);return i===32||i===9?e.slice(t,n).trim():e.slice(t,n)}function q3(e,t){for(;t=1e5?oL:W3,o="",s=!1,r=!1,l=0,a=0;for(;l"]/,sL=/[&<>"]/g,Kpe=/&/g,Zpe=/[<>"]/g,Gpe={"&":"&","<":"<",">":">",'"':"""};function U3(e){return Gpe[e]||e}function Pi(e){if(e.length===0)return"";if(e.length<32)return Vpe.test(e)?e.replace(sL,U3):e;const t=e.includes("&"),n=e.includes("<"),i=e.includes(">"),o=e.includes('"');return!t&&!n&&!i&&!o?e:t&&!n&&!i&&!o?e.replace(Kpe,"&"):t?e.replace(sL,U3):e.replace(Zpe,U3)}const Qpe=new RegExp(`${/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),Ype=/^#(?:x[a-f0-9]{1,8}|\d{1,8})$/i;function LH(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(Qpe,(t,n,i)=>{if(n)return n;if(Ype.test(i)){const s=i[1].toLowerCase()==="x"?Number.parseInt(i.slice(2),16):Number.parseInt(i.slice(1),10);return O4(s)?Mv(s):"�"}const o=nx(t);return o!==t?o:t})}const Jpe=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/,Xpe=/[\n!"#$%&*+\-:<=>@[\]\\^_`{}~]/,e1e=/"/g;function D1(e,t){const n=e.indexOf(` -`,t);return n===-1?e.length:n}function eb(e,t,n){for(let i=t;i=e.length||e.charCodeAt(t)===10?!1:!eb(e,t,D1(e,t))}function rL(e,t,n){return t+2=n||e.charCodeAt(o)!==32)return null;let s=o+1;for(;ss&&e.charCodeAt(r-1)===32;)r--;let l=r;for(;l>s&&e.charCodeAt(l-1)===35;)l--;if(l>s&&e.charCodeAt(l-1)===32)for(r=l-1;r>s&&e.charCodeAt(r-1)===32;)r--;const a=yx(e.slice(s,r));return a===null?null:`${a} -`}function lL(e,t,n){return t+1" -`;case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return null}return`
    1. ${e[t]}
    2. -`}function s1e(e,t,n){const i=t+2;if(n===i+1)return o1e(e,i);const o=yx(e.slice(t+2,n));return o===null?null:`
    3. ${o}
    4. -`}function r1e(e,t,n){for(;tt;){const o=e.charCodeAt(n-1);if(o!==32&&o!==9)break;n--}let i=n;for(let o=t;o`:"
      ",i.lang=s,i.open=d),{html:`${d}${Pi(c)}
      -`,nextPos:u=25e4,s=[],r={lang:null,open:""};let l="",a="",u="",c="";for(;n -`;w -`,l=k,a=v}let C=xy(e,y);for(;C${y}

      -`,u=h,c=m}const g=de.core.parse(t,n,e).tokens);let r=N9(t,o);if(o.maxChunks&&r.length>o.maxChunks&&(r=f1e(r,o.maxChunks)),F9(t,r))return O3(n,{count:1,fallback:!0,fallbackReason:"unsafe-chunk-boundary",maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines}),im(n,s,()=>e.core.parse(t,n,e).tokens);let l=0;const a=[];return O3(n,{count:r.length,maxChunkChars:o.maxChunkChars,maxChunkLines:o.maxChunkLines,globalStateDetected:s||void 0,globalStateFallbackDisabled:o.fallbackOnGlobalState===!1&&!!s}),im(n,s,()=>{for(let u=0;u=3&&(c?c.marker===C&&M>=c.length&&(c=null):c={marker:C,length:M})}}const y=m-f;o+=y,s+=1,l+=1,g?(a=0,u=0):(a+=1,u+=y);const k=g;if((o>=t.maxChunkChars||s>=t.maxChunkLines)&&!c)if(k)d(m);else{const v=Math.max(10,Math.floor(t.maxChunkLines*.5)),C=Math.max(t.maxChunkChars,8e3);(a>=v||u>=C)&&d(m)}f=m}return n&&d(e.length),i}function F9(e,t,n={rangesCoverWholeSource:!0}){const i=n.rangesCoverWholeSource?t.length-1:t.length;for(let o=0;oe.length||e.charCodeAt(t-1)!==10)return!1;let n=t-2;for(;n>=0&&e.charCodeAt(n)!==10;)n--;for(let i=n+1;i=0;i--)n.push(e[i]);for(;n.length;){const i=n.pop();if(i.map&&(i.map[0]+=t,i.map[1]+=t),i.children)for(let o=i.children.length-1;o>=0;o--)n.push(i.children[o])}}function d1e(e,t){for(let n=0;n=0;i--)n.push(e[i]);for(;n.length;){const i=n.pop();if(i.map&&(i.map[0]+=t,i.map[1]+=t),i.children)for(let o=i.children.length-1;o>=0;o--)n.push(i.children[o])}}function Td(e){return e.length===0?0:Mo(e)+(e.charCodeAt(e.length-1)===10?0:1)}function k1e(e,t,n){for(let i=t;i=3&&(n?n.marker===r&&a>=n.length&&(n=null):n={marker:r,length:a})}i=o===e.length?e.length:o+1}return n!==null}function w1e(e,t){if(e.length===0||e.charCodeAt(e.length-1)!==10)return!1;let n=e.length-2;for(;n>=0&&e.charCodeAt(n)!==10;)n--;return k1e(e,n+1,e.length-1)?!b1e(e,t):!1}function C1e(e,t,n,i={}){const o=i.mode??"full",s=i.fenceAware??(o==="stream"?e.options.streamChunkFenceAware??!0:e.options.fullChunkFenceAware??!0);if(i.maxChunkChars!==void 0||i.maxChunkLines!==void 0||i.autoTune===!1){const r=i.maxChunkChars??(o==="stream"?e.options.streamChunkSizeChars??g1e:e.options.fullChunkSizeChars??p1e),l=i.maxChunkLines??(o==="stream"?e.options.streamChunkSizeLines??v1e:e.options.fullChunkSizeLines??m1e);return{maxChunkChars:r,maxChunkLines:l,holdBelowChars:r,holdBelowLines:l,fenceAware:s}}return o==="stream"?t<=5e3?{maxChunkChars:16e3,maxChunkLines:250,holdBelowChars:16e3,holdBelowLines:250,fenceAware:s}:t<=2e4?{maxChunkChars:16e3,maxChunkLines:200,holdBelowChars:16e3,holdBelowLines:200,fenceAware:s}:t<=5e4?{maxChunkChars:16e3,maxChunkLines:250,holdBelowChars:16e3,holdBelowLines:250,fenceAware:s}:t<=5e5?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:32e3,holdBelowLines:350,fenceAware:s}:{maxChunkChars:64e3,maxChunkLines:700,holdBelowChars:64e3,holdBelowLines:700,fenceAware:s}:t<=1e5&&n<=2500?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:1e5,holdBelowLines:2500,fenceAware:s}:t<=2e5?{maxChunkChars:2e4,maxChunkLines:150,holdBelowChars:2e4,holdBelowLines:150,fenceAware:s}:t<=5e5?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:32e3,holdBelowLines:350,fenceAware:s}:{maxChunkChars:64e3,maxChunkLines:700,holdBelowChars:64e3,holdBelowLines:700,fenceAware:s}}var d2=class{md;options;pending="";tokens=[];committedChars=0;committedLines=0;fedChunks=0;parsedChunks=0;globalStateEnv=null;markedGlobalStateReason=null;constructor(e,t={}){if(this.md=e,this.options={mode:"full",autoTune:!0,retainTokens:!0,...t},this.options.retainTokens===!1&&!this.options.onChunkTokens)throw new Error("UnboundedBuffer with retainTokens=false requires onChunkTokens")}feed(e){e&&(this.pending+=e,this.fedChunks+=1)}flushAvailable(e={}){if(!this.pending)return null;const t=this.resolveWindow(),n=Td(this.pending);if(this.pending.length=i||n>=o}function PH(e,t,n){if(e.options.autoUnbounded===!1)return"no";if(t>=(e.options.autoUnboundedThresholdChars??FH))return"yes";const i=e.options.autoUnboundedThresholdLines??DH;return n!==void 0?n>=i?"yes":"no":t+1e.core.parse(t,n,e).tokens);const s=[],r=new d2(e,{mode:"full",...i,retainTokens:!1,onChunkTokens(l){RH(s,l)}});if(o&&ux(n,o),r.feed(t),r.flushForce(n),o&&(cx(n),i.fallbackOnGlobalState===!1)){const l=Bc(n)?.unbounded;l&&(l.globalStateDetected=o,l.globalStateFallbackDisabled=!0)}return s}const sm=(e,t,n)=>en?n:e;function BH(e){return e.experimental?{...e,...e.experimental}:e}const cL=[{max:5e3,strategy:"discrete",maxChunkChars:32e3,maxChunkLines:150,maxChunks:8,notes:"<=5k"},{max:2e4,strategy:"discrete",maxChunkChars:24e3,maxChunkLines:200,maxChunks:12,notes:"<=20k"},{max:1e5,strategy:"plain",notes:"<=100k plain"},{max:2e5,strategy:"discrete",maxChunkChars:2e4,maxChunkLines:150,maxChunks:12,notes:"<=200k"},{max:5e5,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:16,notes:"<=500k"},{max:5e6,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:16,notes:"<=5M"}],dL=[{max:5e3,strategy:"discrete",maxChunkChars:16e3,maxChunkLines:250,maxChunks:8,notes:"<=5k"},{max:2e4,strategy:"discrete",maxChunkChars:2e4,maxChunkLines:200,maxChunks:24,notes:"<=20k"},{max:1e5,strategy:"discrete",maxChunkChars:2e4,maxChunkLines:200,maxChunks:24,notes:"<=100k"},{max:5e5,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:32,notes:"<=500k"},{max:5e6,strategy:"discrete",maxChunkChars:64e3,maxChunkLines:700,maxChunks:32,notes:"<=5M"}];function $H(e,t){return{strategy:t.strategy,maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,maxChunks:t.maxChunks,fenceAware:e,notes:t.notes}}function I1e(e,t=Math.max(0,e/40|0),n={}){const i=BH(n),o=i.fullChunkFenceAware??!0,s=i.fullChunkTargetChunks??8,r=i.fullChunkAdaptive!==!1;for(let l=0;l5e6?{strategy:"plain",fenceAware:o,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:sm(Math.ceil(e/s),8e3,64e3),maxChunkLines:sm(Math.ceil(t/s),150,700),maxChunks:sm(Math.ceil(e/64e3),s,16),fenceAware:o,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:i.fullChunkSizeChars??1e4,maxChunkLines:i.fullChunkSizeLines??200,fenceAware:o,maxChunks:i.fullChunkMaxChunks}}function fL(e,t=Math.max(0,e/40|0),n={}){const i=BH(n),o=i.streamChunkFenceAware??!0,s=i.streamChunkTargetChunks??8,r=i.streamChunkAdaptive!==!1;for(let l=0;l5e6?{strategy:"plain",fenceAware:o,notes:">5M plain"}:r?{strategy:"adaptive",maxChunkChars:sm(Math.ceil(e/s),8e3,64e3),maxChunkLines:sm(Math.ceil(t/s),150,700),maxChunks:sm(Math.ceil(e/64e3),s,32),fenceAware:o,notes:"adaptive fallback"}:{strategy:"discrete",maxChunkChars:i.streamChunkSizeChars??1e4,maxChunkLines:i.streamChunkSizeLines??200,maxChunks:i.streamChunkMaxChunks,fenceAware:o}}var M1e={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"]},inline2:{rules:["balance_pairs","emphasis","fragments_join"]}}},T1e={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},E1e={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"]},inline2:{rules:["balance_pairs","fragments_join"]}}};function B4(e){return!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function D9(e,t){if(B4(e))throw new TypeError(`Renderer rule "${t}" returned a Promise. Use renderAsync() instead.`);return e}const hL=e=>B4(e)?e:Promise.resolve(e);function R0(e){switch(e){case"alt":case"class":case"href":case"id":case"lang":case"rel":case"src":case"start":case"style":case"target":case"title":return e;default:return Pi(e)}}function xf(e){if(!e||e.length===0)return"";const t=e[0];let n=` ${R0(t[0])}="${Pi(t[1])}"`;for(let i=1;i=e.length)return{langName:e,langAttrs:""};let n=t;for(;n${t} -`;const s=e.attrIndex("class"),r=e.attrs?e.attrs.slice():[],l=`${o.langPrefix??"language-"}${i}`;return s<0?r.push(["class",l]):(r[s]=r[s].slice(),r[s][1]+=` ${l}`),`
      ${t}
      -`}return`
      ${t}
      -`}function Ev(e){return!e.attrs||e.attrs.length===0?`${Pi(e.content)}`:`${Pi(e.content)}`}function gA(e){const t=Pi(e.content);return e.attrs?`${t} -`:`
      ${t}
      -`}function L1e(e,t){const n=e.attrs;if(!n||n.length===0)switch(e.type){case"paragraph_open":return`${t}

      `;case"heading_open":return`<${e.tag}>`;case"td_open":return`${t}`;case"th_open":return`${t}`;default:return null}if(n.length===1&&n[0][0]==="style"){if(e.type==="td_open")return`${t}`;if(e.type==="th_open")return`${t}`}return null}function pL(e){const t=e.attrs;return!t||t.length===0?"":t.length===1?``:t.length===2?``:``}function N1e(e){switch(e.type){case"text":case"text_special":case"softbreak":case"hardbreak":case"html_inline":case"code_inline":case"image":return!0;default:return!1}}function mL(e){switch(e.type){case"text":case"text_special":case"softbreak":case"hardbreak":case"html_inline":case"code_inline":return!0;default:return!1}}function nb(e,t){if(e.hidden)return"";const n=e.attrs,i=e.nesting,o=e.tag;if(!n||n.length===0)return i===0?t?`<${o} />`:`<${o}>`:i===-1?``:`<${o}>`;let s=(i===-1?"`}const F1e={langPrefix:"language-",xhtmlOut:!1,breaks:!1},Sy=Object.prototype.hasOwnProperty,yi={code_inline(e,t){return Ev(e[t])},code_block(e,t){return gA(e[t])},fence(e,t,n,i,o){const s=e[t],r=s.info?LH(s.info).trim():"",{langName:l,langAttrs:a}=zH(r),u=n.highlight,c=Pi(s.content);if(!u)return O0(s,c,r,l,n);const d=u(s.content,l,a);return B4(d)?d.then(f=>O0(s,f||c,r,l,n)):O0(s,d||c,r,l,n)},image(e,t,n,i,o){const s=e[t],r=o.renderInlineAsText(s.children||[],n,i),l=s.attrIndex("alt");return l>=0&&s.attrs?s.attrs[l][1]=r:s.attrs?s.attrs.push(["alt",r]):s.attrs=[["alt",r]],nb(s,n.xhtmlOut===!0)},hardbreak(e,t,n){return n.xhtmlOut?`
      -`:`
      -`},softbreak(e,t,n){return n.breaks?n.xhtmlOut?`
      -`:`
      -`:` -`},text(e,t){return Pi(e[t].content)},text_special(e,t){return Pi(e[t].content)},html_block(e,t){return e[t].content},html_inline(e,t){return e[t].content}};function gL(e,t,n){const i=e.info?LH(e.info).trim():"",{langName:o,langAttrs:s}=zH(i),r=t.highlight,l=Pi(e.content);if(!r)return O0(e,l,i,o,t);const a=r(e.content,o,s);if(B4(a))throw new TypeError('Renderer rule "fence" returned a Promise. Use renderAsync() instead.');return O0(e,a||l,i,o,t)}function V3(e,t,n,i){switch(e.type){case"text":return t.text===yi.text?e.content.length===0?"":Pi(e.content):null;case"text_special":return t.text_special===yi.text_special?e.content.length===0?"":Pi(e.content):null;case"softbreak":return t.softbreak===yi.softbreak?i:null;case"hardbreak":return t.hardbreak===yi.hardbreak?n:null;case"html_inline":return t.html_inline===yi.html_inline?e.content:null;case"code_inline":return t.code_inline===yi.code_inline?Ev(e):null;default:return null}}function D1e(e,t,n,i,o){const s=e[0];switch(s.type){case"text":if(o.text===yi.text)return s.content.length===0?"":Pi(s.content);break;case"text_special":if(o.text_special===yi.text_special)return s.content.length===0?"":Pi(s.content);break;case"softbreak":if(o.softbreak===yi.softbreak)return t.breaks?t.xhtmlOut?`
      -`:`
      -`:` -`;break;case"hardbreak":if(o.hardbreak===yi.hardbreak)return t.xhtmlOut?`
      -`:`
      -`;break;case"html_inline":if(o.html_inline===yi.html_inline)return s.content;break;case"code_inline":if(o.code_inline===yi.code_inline)return Ev(s);break}const r=o[s.type];if(!r)return nb(s,t.xhtmlOut===!0);const l=r(e,0,t,n,i);return typeof l=="string"?l:D9(l,s.type)}var R1e=class{rules;baseOptions;normalizedBase;constructor(e={}){this.baseOptions={...e},this.normalizedBase=this.buildNormalizedBase(),this.rules={...yi}}set(e){return this.baseOptions={...this.baseOptions,...e},this.normalizedBase=this.buildNormalizedBase(),this}render(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");if(e.length===1)return this.renderSingleToken(e,e[0],t,n);const i=this.mergeOptions(t),o=n??{},s=this.rules,r=i.xhtmlOut===!0;let l,a,u,c,d,f,h="",m="",g=!1,y="";for(let k=0;k0&&e[k-1].hidden?` -`:"";if(C==="list_item_open"&&(!v.attrs||v.attrs.length===0)&&k+3${this.renderInlineTokens(S.children||[],i,o)}`,k+=3;continue}}if(k+2 -`,k+=2;continue}}}if(C==="inline"){const E=v.children||[];if(E.length===1){g||(l=s.text,a=s.text_special,u=s.softbreak,c=s.hardbreak,d=s.html_inline,f=s.code_inline,h=i.xhtmlOut?`
      -`:`
      -`,m=i.breaks?h:` -`,g=!0);const S=E[0];switch(S.type){case"text":if(l===yi.text){y+=Pi(S.content);continue}break;case"text_special":if(a===yi.text_special){y+=Pi(S.content);continue}break;case"softbreak":if(u===yi.softbreak){y+=m;continue}break;case"hardbreak":if(c===yi.hardbreak){y+=h;continue}break;case"html_inline":if(d===yi.html_inline){y+=S.content;continue}break;case"code_inline":if(f===yi.code_inline){y+=Ev(S);continue}break}}y+=this.renderInlineTokens(E,i,o);continue}const M=s[C];if(!M){const E=v.attrs;if(!v.hidden){if(!E||E.length===0)switch(C){case"hr":y+=r?`


      -`:`
      -`;continue;case"heading_open":y+=`<${v.tag}>`;continue;case"heading_close":y+=` -`;continue;case"paragraph_open":y+=`${w}

      `;continue;case"paragraph_close":y+=`

      -`;continue;case"list_item_open":{const S=e[k+1];y+=w+(S&&(S.type==="inline"||S.hidden||S.nesting===-1&&S.tag==="li")?"
    5. ":`
    6. -`);continue}case"list_item_close":y+=`
    7. -`;continue;case"bullet_list_open":y+=`${w}
        -`;continue;case"bullet_list_close":y+=`
      -`;continue;case"blockquote_open":y+=w+(e[k+1]&&e[k+1].nesting===-1&&e[k+1].tag==="blockquote"?"
      ":`
      -`);continue;case"blockquote_close":y+=`
      -`;continue;case"ordered_list_open":y+=`${w}
        -`;continue;case"ordered_list_close":y+=`
      -`;continue;case"table_open":y+=`${w} -`;continue;case"table_close":y+=`
      -`;continue;case"thead_open":y+=`${w} -`;continue;case"thead_close":y+=` -`;continue;case"tbody_open":y+=`${w} -`;continue;case"tbody_close":y+=` -`;continue;case"tr_open":y+=`${w} -`;continue;case"tr_close":y+=` -`;continue;case"td_open":y+=`${w}`;continue;case"td_close":y+=` -`;continue;case"th_open":y+=`${w}`;continue;case"th_close":y+=` -`;continue}else if(E.length===1){const S=E[0];if(C==="ordered_list_open"&&S[0]==="start"){y+=`${w}
        -`;continue}if(C==="td_open"&&S[0]==="style"){y+=`${w}`;continue}if(C==="th_open"&&S[0]==="style"){y+=`${w}`;continue}}}y+=this.renderToken(e,k,i);continue}if(C==="code_block"&&M===yi.code_block){y+=gA(v);continue}if(C==="fence"&&M===yi.fence){y+=gL(v,i);continue}if(C==="html_block"&&M===yi.html_block){y+=v.content;continue}const L=M(e,k,i,o,this);typeof L=="string"?y+=L:y+=D9(L,v.type)}return y}async renderAsync(e,t,n){if(!Array.isArray(e))throw new TypeError("render expects token array as first argument");const i=this.mergeOptions(t),o=n??{},s=this.rules;let r="";for(let l=0;l0&&e[t-1].hidden?` -`:"",c=a?`> -`:">";if(!l||l.length===0)return s===0?n.xhtmlOut?`${u}<${r} /${c}`:`${u}<${r}${c}`:s===-1?`${u}(n||(n={...t}),n);if(Sy.call(e,"highlight")&&e.highlight!==t.highlight&&(i().highlight=e.highlight),Sy.call(e,"langPrefix")){const o=e.langPrefix;o!==t.langPrefix&&(i().langPrefix=o)}if(Sy.call(e,"xhtmlOut")){const o=e.xhtmlOut;o!==t.xhtmlOut&&(i().xhtmlOut=o)}if(Sy.call(e,"breaks")){const o=e.breaks;o!==t.breaks&&(i().breaks=o)}return n||t}buildNormalizedBase(){return Object.freeze({...F1e,...this.baseOptions})}renderSingleToken(e,t,n,i){const o=this.rules,s=t.type;if(s==="code_block"&&o.code_block===yi.code_block)return gA(t);if(s==="html_block"&&o.html_block===yi.html_block)return t.content;const r=this.mergeOptions(n),l=i??{};if(s==="inline")return this.renderInlineTokens(t.children||[],r,l);const a=o[s];if(!a)return t.block?this.renderToken(e,0,r):nb(t,r.xhtmlOut===!0);if(s==="fence"&&a===yi.fence)return gL(t,r);const u=a(e,0,r,l,this);return typeof u=="string"?u:D9(u,s)}renderInlineTokens(e,t,n){if(!e||e.length===0)return"";const i=this.rules;if(e.length===1)return D1e(e,t,n,this,i);const o=t.xhtmlOut===!0,s=o?`
        -`:`
        -`,r=t.breaks?s:` -`,l=i.text,a=i.text_special,u=i.softbreak,c=i.hardbreak,d=i.html_inline,f=i.code_inline,h=i.link_open,m=i.link_close,g=i.em_open,y=i.em_close,k=i.strong_open,v=i.strong_close;let C="";for(let w=0;w`;if(u===yi.softbreak&&w+3`,w+=1;continue}if(M.type==="em_open"&&!g&&!y&&w+2${x}`,w+=2;continue}}}if(M.type==="strong_open"&&!k&&!v&&w+2${x}`,w+=2;continue}}}switch(M.type){case"text":if(l===yi.text){const S=M.content.length===0?"":Pi(M.content);if(d===yi.html_inline&&w+1=4)return!0;continue}if(l===9){if(r+=4-r%4,s++,r>=4)return!0;continue}break}if(s0&&u<=6){if(a=3)return!0;break}default:if(l>=48&&l<=57){let a=s+1;for(;a57)break;a++}if(a=Z,!Y&&se!==void 0&&(he=Mo(e),Y=he>=se)),Y){const U=this.parseFullDocument(e,O,n,he,!1);return this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",ts(O,{area:"stream",path:"stream-full",reason:"skip-cache-large-one-shot",unbounded:!!Bc(O)?.unbounded}),U.tokens}else if(z){const U=(ge,ae,Ce)=>geCe?Ce:ge;he===void 0&&(he=Mo(e));const Q=le&&!te?fL(e.length,he,n.options):null,ue=Q?.maxChunkChars??(W?U(Math.ceil(e.length/$),8e3,64e3):K??1e4),me=Q?.maxChunkLines??(W?U(Math.ceil(he/$),150,700):ne??200),pe=Q?.maxChunks??(W?U(Math.ceil(e.length/64e3),$,32):G),ee=e.length>0&&e.charCodeAt(e.length-1)===10,re=P&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&Q?.strategy!=="plain";if((F||re)&&(e.length>=ue*2||he>=me*2)&&ee){const ge=tb(n,e,O,{maxChunkChars:ue,maxChunkLines:me,fenceAware:Q?.fenceAware??ie,maxChunks:pe});return this.cache={src:e,tokens:ge,env:O,lineCount:he,lastSegment:void 0,globalStateReason:kl(e)},this.updateCacheLineCount(this.cache,he),this.recordChunkedParseResult(O,F?"explicit-initial-large-doc":"default-initial-large-doc"),ge}}const J=this.parseFullDocument(e,O,n,he);return he=J.lineCount,this.cache={src:e,tokens:J.tokens,env:O,lineCount:he,lastSegment:void 0,globalStateReason:kl(e)},this.updateCacheLineCount(this.cache,he),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",ts(O,{area:"stream",path:"stream-full",reason:"initial-parse",unbounded:!!Bc(O)?.unbounded}),J.tokens}if(e===o.src)return this.stats.total+=1,this.stats.cacheHits+=1,this.stats.lastMode="cache",ts(o.env,{area:"stream",path:"stream-cache",reason:"same-source"}),o.tokens;const s=e.startsWith(o.src)?e.slice(o.src.length):null;let r=o.globalStateReason;r===void 0&&(r=kl(o.src),o.globalStateReason=r);const l=r?null:s!==null?this.detectGlobalStateForAppend(o,s):kl(e),a=r||l;if(a){const O=i??o.env;ad(O);const H=kl(e),R=this.parseFullDocument(e,O,n),F=R.tokens,P=R.lineCount;return this.cache={src:e,tokens:F,env:O,lineCount:P,lastSegment:void 0,globalStateReason:H},this.updateCacheLineCount(this.cache,P),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",ts(O,{area:"stream",path:"stream-full",reason:`global-state:${a}`,unbounded:!!Bc(O)?.unbounded}),F}const u=n.options?.streamOptimizationMinSize??this.MIN_SIZE_FOR_OPTIMIZATION;if(o.src.length5e3?H=8:c.length>1e3?H=6:c.length>200&&(H=4),H=Math.min(H,O);let R=null;const F=n.options?.streamContextParseStrategy??"chars",P=n.options?.streamContextParseMinChars??200,z=n.options?.streamContextParseMinLines??2;let W;const $=()=>(W===void 0&&(W=Mo(c)),W),K=this.canDirectlyParseAppend(o),ne=K&&this.shouldUseUnboundedAppend(e,o,c);let G=!1;if(!K)switch(F){case"lines":G=$()>=z;break;case"constructs":if(c.length>=P){G=!0;break}if(B1e(c)){G=!0;break}G=$()>=z;break;case"chars":default:G=c.length>=P}if(H>0&&G){const ie=this.getTailLines(o.src,H)+c;try{const _e=this.core.parse(ie,o.env,n).tokens,Z=_e.findIndex(se=>se.map&&typeof se.map[1]=="number"&&se.map[1]>H);if(Z!==-1){const se=_e.slice(Z),he=O-H;he!==0&&this.shiftTokenLines(se,he),R={tokens:se}}}catch{R=null}}else R=null;if(!R){const ie=O;if(ne)R={tokens:D0(n,c,o.env,{mode:"stream"})},ie>0&&this.shiftTokenLines(R.tokens,ie);else{const _e=this.core.parse(c,o.env,n);ie>0&&this.shiftTokenLines(_e.tokens,ie),R=_e}}let te=0;if(o.tokens.length>0&&R.tokens.length>0){const ie=o.tokens[o.tokens.length-1],_e=R.tokens[0];try{ie.type==="inline"&&_e.type==="inline"&&(_e.children&&_e.children.length>0&&(ie.children||(ie.children=[]),this.appendTokens(ie.children,_e.children)),ie.content=(ie.content||"")+(_e.content||""),te=1)}catch{te=0}}const le=o.tokens.length;if(R.tokens.length>te){const ie=o.tokens,_e=R.tokens,Z=Math.min(ie.length,_e.length-te);let se=0;for(let he=Z;he>0;he--){let Y=!0;for(let J=0;J0&&(te+=se),_e.length>te&&this.appendTokens(o.tokens,_e,te)}if(o.src=e,o.globalStateReason=null,o.lineCount=O+(W??$()),o.tokens.length>le){const ie=this.getLastSegment(o.tokens,e,le,o.tokens.length,e.length-c.length,O);ie?o.lastSegment=ie:o.lastSegment=void 0}else o.lastSegment=void 0;return this.stats.total+=1,this.stats.appendHits+=1,ne&&(this.stats.unboundedAppendHits=(this.stats.unboundedAppendHits||0)+1),this.stats.lastMode="append",ts(o.env,{area:"stream",path:ne?"stream-unbounded-append":"stream-append",reason:ne?"large-delta":"safe-append",unbounded:ne}),o.tokens}const d=i??o.env,f=this.tryTailSegmentReparse(e,o,d,n);if(f)return this.stats.total+=1,this.stats.tailHits+=1,this.stats.lastMode="tail",ts(d,{area:"stream",path:"stream-tail",reason:"tail-reparse"}),f;const h=!!n.__explicitStreamChunkFallbackSetting,m=typeof n.__canUseImplicitLargeInputStrategy=="function"?n.__canUseImplicitLargeInputStrategy():!0,g=!!n.options?.streamChunkedFallback,y=!h&&!c&&m,k=g||y,v=n.options?.streamChunkAdaptive!==!1,C=n.options?.streamChunkTargetChunks??8,w=n.options?.streamChunkSizeChars,M=n.options?.streamChunkSizeLines,L=n.options?.streamChunkMaxChunks,E=!!n.__explicitStreamChunkConfig,S=n.options?.autoTuneChunks!==!1,x=n.options?.streamChunkFenceAware??!0;let A=c&&o.lineCount!==void 0?o.lineCount+Mo(c):void 0;if(k){A===void 0&&(A=Mo(e));const O=($,K,ne)=>$ne?ne:$,H=S&&!E?fL(e.length,A,n.options):null,R=H?.maxChunkChars??(v?O(Math.ceil(e.length/C),8e3,64e3):w??1e4),F=H?.maxChunkLines??(v?O(Math.ceil(A/C),150,700):M??200),P=H?.maxChunks??(v?O(Math.ceil(e.length/64e3),C,32):L),z=e.length>0&&e.charCodeAt(e.length-1)===10,W=y&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&H?.strategy!=="plain";if((g||W)&&(e.length>=R*2||A>=F*2)&&z){const $=tb(n,e,d,{maxChunkChars:R,maxChunkLines:F,fenceAware:H?.fenceAware??x,maxChunks:P});return this.cache={src:e,tokens:$,env:d,lineCount:A,lastSegment:void 0,globalStateReason:kl(e)},this.updateCacheLineCount(this.cache,A),this.recordChunkedParseResult(d,g?"explicit-fallback-large-doc":"default-fallback-large-doc"),$}}const T=this.parseFullDocument(e,d,n,A),I=T.tokens;return A=T.lineCount,this.cache={src:e,tokens:I,env:d,lineCount:A,lastSegment:void 0,globalStateReason:kl(e)},this.updateCacheLineCount(this.cache,A),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode="full",ts(d,{area:"stream",path:"stream-full",reason:"fallback-full",unbounded:!!Bc(d)?.unbounded}),I}recordChunkedParseResult(e,t){const n=Bc(e)?.chunk,i=n?.fallback?String(n.fallbackReason||"global-state"):null;if(this.stats.total+=1,i){this.stats.fullParses+=1,this.stats.lastMode="full",ts(e,{area:"stream",path:"stream-full",reason:`global-state:${i}`,unbounded:!!Bc(e)?.unbounded});return}this.stats.chunkedParses=(this.stats.chunkedParses||0)+1,this.stats.lastMode="chunked",ts(e,{area:"stream",path:"stream-chunked",chunked:!0,reason:t})}parseFullDocument(e,t,n,i,o=!0){const s=kl(e);u2(t)&&ad(t);const r=typeof n.__canUseImplicitLargeInputStrategy!="function"||n.__canUseImplicitLargeInputStrategy()?PH(n,e.length,i):"no";if(r==="yes"){const a=D0(n,e,t);return ts(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-char-threshold",unbounded:!0}),{tokens:a,lineCount:i??(o?Mo(e):0)}}let l=i;if(r==="need-lines"&&(l=Mo(e),OH(n,e.length,l))){const a=D0(n,e,t);return ts(t,{area:"stream",path:"stream-full",reason:"auto-unbounded-line-threshold",unbounded:!0}),{tokens:a,lineCount:l}}return l===void 0&&(l=o?Mo(e):0),{tokens:im(t,s,()=>this.core.parse(e,t,n).tokens),lineCount:l}}shouldUseUnboundedAppend(e,t,n){return!n||e.length=this.MIN_UNBOUNDED_APPEND_CHARS?!0:Mo(n)>=this.MIN_UNBOUNDED_APPEND_LINES}getAppendedSegment(e,t,n){if(n===null||n===void 0&&!t.startsWith(e)||!e.endsWith(` -`))return null;const i=n??t.slice(e.length);if(!i)return null;const o=i.length;if(i.charCodeAt(o-1)!==10)return null;let s=0,r=-1;for(let a=0;a=2));a++);if(s<2)return null;const l=(r===-1?i:i.slice(0,r)).trim();if(l.length===0)return null;if(/^[-=]+$/.test(l)){const a=e.slice(0,-1),u=a.lastIndexOf(` -`);if(a.slice(u+1).trim().length>0)return null}return this.endsInsideOpenFence(e)||this.mayContainReferenceDefinition(i)?null:i}tryTailSegmentReparse(e,t,n,i){const o=this.ensureLastSegment(t);if(!o||o.srcOffset<=0&&o.tokenStart<=0)return null;const s=t.src.slice(0,o.srcOffset);if(!e.startsWith(s))return null;const r=t.src.slice(o.srcOffset),l=e.slice(o.srcOffset);if(l===r)return null;const a=e.startsWith(t.src)?e.slice(t.src.length):null;if(a){const u=this.tryContainerTailAppendMerge(e,t,n,i,o,a);if(u)return u}if(this.mayContainReferenceDefinition(r)||this.mayContainReferenceDefinition(l))return null;try{const u=this.core.parse(l,n,i),c=this.getLastSegment(u.tokens,l);return o.lineStart>0&&this.shiftTokenLines(u.tokens,o.lineStart),t.src=e,t.env=n,t.globalStateReason=null,t.globalStateCarry=void 0,t.tokens.length=o.tokenStart,this.appendTokens(t.tokens,u.tokens),t.lineCount=o.lineStart+Mo(l),c?t.lastSegment={tokenStart:o.tokenStart+c.tokenStart,tokenEnd:o.tokenStart+c.tokenEnd,lineStart:o.lineStart+c.lineStart,lineEnd:o.lineStart+c.lineEnd,srcOffset:o.srcOffset+c.srcOffset}:t.lastSegment=null,t.tokens}catch{return null}}getTailLines(e,t){if(t<=0)return"";let n=t;for(let i=e.length-1;i>=0;i--)if(e.charCodeAt(i)===10&&(n--,n===0))return e.slice(i+1);return e}endsInsideOpenFence(e){const n=e.length>4e3?e.length-4e3:0,i=e.slice(n),o=i.length;let s=null,r=0;for(;r<=o;){let l=i.indexOf(` -`,r);l===-1&&(l=o);let a=r;for(;a=3&&(s?s.marker===u&&d>=s.length&&(s=null):s={marker:u,length:d})}}if(l===o)break;r=l+1}return s!==null}peek(){return this.cache?.tokens??P1e}getStats(){return{...this.stats}}appendTokens(e,t,n=0,i=t.length){for(let o=n;oK3?n.slice(n.length-K3):n,i&&(e.globalStateReason=i),i}ensureLastSegment(e){return e.lastSegment!==void 0||(e.lastSegment=this.getLastSegment(e.tokens,e.src)),e.lastSegment}getLastSegment(e,t,n=0,i=e.length,o,s){if(i<=n)return null;let r=Number.POSITIVE_INFINITY,l=-1,a=0;for(let u=i-1;u>=n;u--){const c=e[u];if(c.map&&(c.map[0]l&&(l=c.map[1])),c.nesting<0){a+=-c.nesting;continue}if(c.nesting>0){if(a-=c.nesting,c.level===0&&a<=0){const d=Number.isFinite(r)?r:c.map?.[0]??0,f=l>=d?l:c.map?.[1]??d;return{tokenStart:u,tokenEnd:i,lineStart:d,lineEnd:f,srcOffset:this.getLineStartOffset(t,d,o,s)}}continue}if(c.level===0&&a===0){const d=Number.isFinite(r)?r:c.map?.[0]??0,f=l>=d?l:c.map?.[1]??d;return{tokenStart:u,tokenEnd:i,lineStart:d,lineEnd:f,srcOffset:this.getLineStartOffset(t,d,o,s)}}}return null}getLineStartOffset(e,t,n,i){if(n!==void 0&&i!==void 0&&t>=i)return this.getLineStartOffsetFrom(e,n,t-i);if(t<=0)return 0;let o=t,s=-1;for(;o>0;){if(s=e.indexOf(` -`,s+1),s===-1)return e.length;o--}return s+1}getLineStartOffsetFrom(e,t,n){if(n<=0)return t;let i=n,o=t-1;for(;i>0;){if(o=e.indexOf(` -`,o+1),o===-1)return e.length;i--}return o+1}mayContainReferenceDefinition(e){return e.includes("]:")?/(?:^|\n)[ \t]{0,3}\[[^\]\n]+\]:/.test(e):!1}canDirectlyParseAppend(e){if(!this.endsWithBlankLine(e.src))return!1;const t=this.ensureLastSegment(e);if(!t)return!1;switch(e.tokens[t.tokenStart]?.type){case"paragraph_open":case"heading_open":case"fence":case"code_block":case"html_block":case"hr":case"table_open":return!0;default:return!1}}tryContainerTailAppendMerge(e,t,n,i,o,s){if(!s||this.mayContainReferenceDefinition(s))return null;const r=t.tokens[o.tokenStart];switch(r?.type){case"bullet_list_open":case"ordered_list_open":return this.tryListTailAppendMerge(e,t,n,i,o,s,r);case"table_open":return this.tryTableTailAppendMerge(e,t,n,i,o,s,r);default:return null}}tryListTailAppendMerge(e,t,n,i,o,s,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10)return null;const l=o.lineEnd-o.lineStart,a=t.src.length-o.srcOffset;if(l0&&this.shiftTokenLines(d,f);const h=this.getListParagraphMode(t.tokens,o.tokenStart,t.tokens.length,r.level),m=this.getListParagraphMode(c,0,c.length,0);(h==="loose"||m==="loose"||this.endsWithBlankLine(t.src)||(c[0]?.map?.[0]??0)>0)&&(this.setListParagraphVisibility(t.tokens,o.tokenStart,t.tokens.length,r.level,!1),this.setListParagraphVisibility(d,0,d.length,r.level,!1)),t.tokens.splice(t.tokens.length-1,0,...d),t.src=e,t.env=n,t.globalStateReason=null;const g=f+Mo(s);t.lineCount=g;const y=this.getDocLineCount(e,g);return r.map&&(r.map[1]=y),t.lastSegment={tokenStart:o.tokenStart,tokenEnd:t.tokens.length,lineStart:o.lineStart,lineEnd:y,srcOffset:o.srcOffset},t.tokens}tryTableTailAppendMerge(e,t,n,i,o,s,r){if(t.src.length===0||t.src.charCodeAt(t.src.length-1)!==10||/(?:^|\n)[ \t]*\n/.test(s))return null;const l=o.lineEnd-o.lineStart,a=t.src.length-o.srcOffset;if(l=0?d.slice(f.tbodyOpenIndex+1,f.tbodyCloseIndex):d.slice(f.tbodyOpenIndex,f.tbodyCloseIndex+1);if(m.length===0)return null;const g=o.lineEnd-2;g!==0&&this.shiftTokenLines(m,g);const y=h.tbodyCloseIndex>=0?h.tbodyCloseIndex:h.tableCloseIndex,k=t.lineCount??Mo(t.src);t.tokens.splice(y,0,...m),t.src=e,t.env=n,t.globalStateReason=null;const v=k+Mo(s);t.lineCount=v;const C=this.getDocLineCount(e,v);if(r.map&&(r.map[1]=C),h.tbodyOpenIndex>=0){const w=t.tokens[h.tbodyOpenIndex];w?.map&&(w.map[1]=C)}return t.lastSegment={tokenStart:o.tokenStart,tokenEnd:t.tokens.length,lineStart:o.lineStart,lineEnd:C,srcOffset:o.srcOffset},t.tokens}getTableHeaderContext(e){const t=e.indexOf(` -`);if(t<0)return null;const n=e.indexOf(` -`,t+1);return n<0?null:e.slice(0,n+1)}getTableBodySection(e,t,n,i){if(t<0||t>=n||e[t]?.type!=="table_open")return null;let o=-1;for(let l=n-1;l>t;l--){const a=e[l];if(a.type==="table_close"&&a.level===i){o=l;break}}if(o<0)return null;let s=-1,r=-1;for(let l=t+1;l=0){for(let l=o-1;l>s;l--){const a=e[l];if(a.type==="tbody_close"&&a.level===i+1){r=l;break}}if(r<0)return null}return{tableCloseIndex:o,tbodyOpenIndex:s,tbodyCloseIndex:r}}isSingleTopLevelContainer(e,t,n,i){if(e.length<2)return!1;const o=e[0],s=e[e.length-1];if(o.type!==t||s.type!==n||o.level!==0||s.level!==0||i!==void 0&&o.markup!==i)return!1;let r=0;for(let l=0;l0&&l0||a.nesting<0)&&(r+=a.nesting)}return r===0}getListParagraphMode(e,t,n,i){let o=!1,s=!1;const r=i+2;for(let l=t;l=0;){const i=e.charCodeAt(n);if(i===32||i===9){n--;continue}return i===10}return!0}getDocLineCount(e,t=Mo(e)){return e.length===0?0:e.charCodeAt(e.length-1)===10?t:t+1}shiftTokenLines(e,t){if(t===0)return;let n=null;for(let i=0;i=0;s--)n.push(o.children[s]);for(;n.length>0;){const s=n.pop();if(s.map&&(s.map[0]+=t,s.map[1]+=t),s.children)for(let r=s.children.length-1;r>=0;r--)n.push(s.children[r])}}}}};const yL={default:T1e,zero:E1e,commonmark:M1e};function H1e(e){return{core:e.core.ruler.version,block:e.block.ruler.version,inline:e.inline.ruler.version,inline2:e.inline.ruler2.version}}function W1e(e,t){return e.core.ruler.version!==t.core||e.block.ruler.version!==t.block||e.inline.ruler.version!==t.inline||e.inline.ruler2.version!==t.inline2}function kL(e){return e.experimental?{...e,...e.experimental}:e}function Ea(e,t){if(!e)return!1;if(Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==void 0)return!0;const n=e.experimental;return!!n&&Object.prototype.hasOwnProperty.call(n,t)&&n[t]!==void 0}function bL(e,t,n){for(let i=0;i=4?n.quotes=[S[0],S[1],S[2],S[3]]:n.quotes=["“","”","‘","’"]}let r=bL(s?.options,o,["fullChunkSizeChars","fullChunkSizeLines","fullChunkMaxChunks"]),l=bL(s?.options,o,["streamChunkSizeChars","streamChunkSizeLines","streamChunkMaxChunks"]),a=wL(s?.options,o,"fullChunkedFallback"),u=wL(s?.options,o,"streamChunkedFallback"),c=!1,d=null,f=null;const h=new Fpe;let m=null;const g=()=>(m||(m=new O1e(n)),m);let y=null;const k=()=>(y||(y=new j1e(h)),y);let v=null;const C=()=>(v||(v=new Kj({fuzzyLink:!0})),v),w=S=>!c&&!!d&&!W1e(S,d),M=(S,x)=>i==="default"&&!c&&m===null&&f!==null&&S.parse===f&&w(S)&&!S.stream.enabled&&x<(S.options.autoUnboundedThresholdChars??4e6)&&S.options.html===!1&&S.options.xhtmlOut===!1&&S.options.breaks===!1&&S.options.langPrefix==="language-"&&S.options.linkify===!1&&S.options.typographer===!1&&S.options.highlight===null,L=(S,x)=>i==="default"&&!c&&w(S)&&!S.stream.enabled&&!S.options.fullChunkedFallback&&x<(S.options.autoUnboundedThresholdChars??4e6)&&S.options.html===!1&&S.options.linkify===!1&&S.options.typographer===!1,E={core:h,block:h.block,inline:h.inline,get linkify(){const S=C();return Object.defineProperty(this,"linkify",{value:S,writable:!0,configurable:!0}),S},get renderer(){const S=g();return Object.defineProperty(this,"renderer",{value:S,writable:!0,configurable:!0}),S},options:n,__explicitFullChunkConfig:r,__explicitStreamChunkConfig:l,__explicitFullChunkFallbackSetting:a,__explicitStreamChunkFallbackSetting:u,__canUseImplicitLargeInputStrategy(){return w(this)},set(S){const x=kL(S);return this.options={...this.options,...x},(Ea(S,"fullChunkSizeChars")||Ea(S,"fullChunkSizeLines")||Ea(S,"fullChunkMaxChunks"))&&(r=!0,this.__explicitFullChunkConfig=!0),(Ea(S,"streamChunkSizeChars")||Ea(S,"streamChunkSizeLines")||Ea(S,"streamChunkMaxChunks"))&&(l=!0,this.__explicitStreamChunkConfig=!0),Ea(S,"fullChunkedFallback")&&(a=!0,this.__explicitFullChunkFallbackSetting=!0),Ea(S,"streamChunkedFallback")&&(u=!0,this.__explicitStreamChunkFallbackSetting=!0),m&&m.set(x),typeof x.stream=="boolean"&&(this.stream.enabled=x.stream,y&&(y.reset(),y.resetStats())),this},configure(S){const x=typeof S=="string"?yL[S]:S;if(!x)throw new Error("Wrong `markdown-it` preset, can't be empty");if(x.options&&this.set(x.options),x.components){const A=x.components;A.core?.rules&&this.core.ruler.enableOnly(A.core.rules),A.block?.rules&&this.block.ruler.enableOnly(A.block.rules),A.inline?.rules&&this.inline.ruler.enableOnly(A.inline.rules),A.inline2?.rules&&this.inline.ruler2.enableOnly(A.inline2.rules)}return this},enable(S,x){const A=Array.isArray(S)?S:[S],T=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],I=new Set;for(const O of T){if(!O)continue;const H=O.enable(A,!0);for(let R=0;R!I.has(H));if(O.length)throw new Error(`Rules manager: invalid rule name ${O.join(", ")}`)}return this},disable(S,x){const A=Array.isArray(S)?S:[S],T=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],I=new Set;for(const O of T){if(!O)continue;const H=O.disable(A,!0);for(let R=0;R!I.has(H));if(O.length)throw new Error(`Rules manager: invalid rule name ${O.join(", ")}`)}return this},use(S,...x){const A=typeof S=="function"?S:S&&typeof S.default=="function"?S.default:void 0;if(!A)throw new TypeError("MarkdownIt.use: plugin must be a function");const T=[this,...x],I=S;return c=!0,A.apply(I,T),this},render(S,x){let A;if(M(this,S.length)){x!==void 0&&(Ur(x),A=R3("render"));const O=A?l1():0,H=A?uL(S,A):aL(S);if(A&&(A.attemptMs=l1()-O,H===null&&(A.fallbackReason="unsupported-stock-subset"),Dg(x,A)),H!==null)return x!==void 0&&ts(x,{area:"render",path:"stock-fast",reason:"stock-subset"}),H}const T=x??{},I=this.parse(S,T);return A&&Dg(T,A),g().render(I,this.options,T)},async renderAsync(S,x){let A;if(M(this,S.length)){x!==void 0&&(Ur(x),A=R3("render"));const O=A?l1():0,H=A?uL(S,A):aL(S);if(A&&(A.attemptMs=l1()-O,H===null&&(A.fallbackReason="unsupported-stock-subset"),Dg(x,A)),H!==null)return x!==void 0&&ts(x,{area:"render",path:"stock-fast",reason:"stock-subset"}),H}const T=x??{},I=this.parse(S,T);return A&&Dg(T,A),g().renderAsync(I,this.options,T)},renderIterable(S,x={}){const A=this.parseIterable(S,x);return g().render(A,this.options,x)},async renderAsyncIterable(S,x={}){const A=await this.parseAsyncIterable(S,x);return g().renderAsync(A,this.options,x)},renderInline(S,x={}){const A=this.parseInline(S,x);return g().render(A,this.options,x)},validateLink:AH,normalizeLink:xH,normalizeLinkText:SH,utils:ufe,helpers:{...Yfe},parse(S,x){if(typeof S!="string")throw new TypeError("Input data should be a String");if(x!==void 0&&Ur(x),L(this,S.length)){const O=x===void 0?void 0:R3("parse"),H=O?l1():0,R=Upe(S,O);if(O&&(O.attemptMs=l1()-H,R===null&&(O.fallbackReason="unsupported-stock-subset"),Dg(x,O)),R!==null)return x!==void 0&&ts(x,{area:"parse",path:"stock-fast",reason:"stock-subset"}),R}const A=x??{};let T;if(!this.stream.enabled&&!this.options.fullChunkedFallback&&w(this)){const O=PH(this,S.length);if(O==="yes"){const H=D0(this,S,A);return ts(x,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"char-threshold"}),H}O==="need-lines"&&(T=Mo(S))}if(!this.stream.enabled){const O=S.length,H=this.options.autoTuneChunks!==!1,R=r,F=!a&&w(this),P=!!this.options.fullChunkedFallback,z=F&&O>=2e5;let W;(P||z||T!==void 0)&&(W=T??Mo(S));const $=(P||z)&&H&&!R?I1e(O,W,this.options):null;if(P||z){const K=W??0;if(P?O>=(this.options.fullChunkThresholdChars??2e4)||K>=(this.options.fullChunkThresholdLines??400):z){if($&&$.strategy!=="plain"){const ne=tb(this,S,A,{maxChunkChars:$.maxChunkChars,maxChunkLines:$.maxChunkLines,fenceAware:$.fenceAware,maxChunks:$.maxChunks});return x&&CL(x,P?"explicit-full-chunk":"default-large-string"),ne}if(P){const ne=(Y,J,U)=>YU?U:Y,G=this.options.fullChunkAdaptive!==!1,te=this.options.fullChunkTargetChunks??8,le=ne(Math.ceil(O/te),8e3,64e3),ie=ne(Math.ceil(K/te),150,700),_e=G?le:this.options.fullChunkSizeChars??1e4,Z=G?ie:this.options.fullChunkSizeLines??200,se=G?ne(Math.ceil(O/64e3),te,32):this.options.fullChunkMaxChunks,he=tb(this,S,A,{maxChunkChars:_e,maxChunkLines:Z,fenceAware:this.options.fullChunkFenceAware??!0,maxChunks:se});return x&&CL(x,"explicit-full-chunk"),he}}}if(T!==void 0&&w(this)&&OH(this,O,W??T)){const K=D0(this,S,A);return ts(x,{area:"parse",path:"auto-unbounded",unbounded:!0,reason:"line-threshold"}),K}}const I=kl(S);return ts(x,{area:"parse",path:"plain",reason:"default-plain"}),im(A,I,()=>h.parse(S,A,this).tokens)},parseIterable(S,x={}){return Ur(x),A1e(this,S,x)},parseAsyncIterable(S,x={}){return Ur(x),x1e(this,S,x)},parseIterableToSink(S,x,A={}){return Ur(A),S1e(this,S,x,A)},parseAsyncIterableToSink(S,x,A={}){return Ur(A),_1e(this,S,x,A)},parseInline(S,x={}){if(typeof S!="string")throw new TypeError("Input data should be a String");Ur(x),u2(x)&&ad(x);const A=h.createState(S,x,this);return A.inlineMode=!0,h.process(A),A.tokens}};if(E.stream={enabled:!!n.stream,parse(S,x){return E.stream.enabled?k().parse(S,x,E):E.parse(S,x??{})},reset(){k().reset()},peek(){return y?y.peek():[]},stats(){return y?y.getStats():{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:"idle"}},resetStats(){y&&y.resetStats()}},s?.components){const S=s.components;S.core?.rules&&E.core.ruler.enableOnly(S.core.rules),S.block?.rules&&E.block.ruler.enableOnly(S.block.rules),S.inline?.rules&&E.inline.ruler.enableOnly(S.inline.rules),S.inline2?.rules&&E.inline.ruler2.enableOnly(S.inline2.rules)}return d=H1e(E),f=E.parse,E}var U1e=q1e;const HH=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],V1e=["a","abbr","b","bdi","bdo","button","cite","code","data","del","dfn","em","font","i","ins","kbd","label","mark","q","s","samp","small","span","strong","sub","sup","time","u","var"],WH=["article","aside","blockquote","details","div","figcaption","figure","footer","header","h1","h2","h3","h4","h5","h6","li","main","nav","ol","p","pre","section","summary","table","tbody","td","th","thead","tr","ul"],K1e=["svg","g","path"],Z1e=["address","audio","body","canvas","caption","colgroup","datalist","dd","dialog","dl","dt","fieldset","form","head","hgroup","html","iframe","legend","map","menu","meter","noscript","object","optgroup","option","output","picture","progress","rp","rt","ruby","script","select","style","template","textarea","tfoot","title","video"],G1e=["onclick","onerror","onload","onmouseover","onmouseout","onmousedown","onmouseup","onkeydown","onkeyup","onfocus","onblur","onsubmit","onreset","onchange","onselect","ondblclick","ontouchstart","ontouchend","ontouchmove","ontouchcancel","onwheel","onscroll","oncopy","oncut","onpaste","oninput","oninvalid","onsearch","innerhtml","outerhtml","textcontent","innertext","srcdoc","ping"],Q1e=["action","data","href","src","srcset","poster","xlink:href","formaction"],Y1e=["script"],J1e=["pre","iframe","picture","script","style","table","tbody","td","tfoot","th","thead","textarea","tr","title","video"],Sf=new Set(HH),qH=new Set(WH),Lv=new Set([...HH,...V1e,...WH,...K1e]),UH=new Set([...Lv,...Z1e]),X1e=new Set(G1e),eme=new Set(Q1e),f2=new Set(Y1e),VH=new Set(J1e);function KH(e){let t="";for(const n of e){const i=n.charCodeAt(0);i<=31||i>=127&&i<=159||/\s/u.test(n)||(t+=n)}return t}const tme={amp:"&",bsol:"\\",colon:":",newline:` -`,sol:"/",tab:" "};function ZH(e){return e.replace(/&(?:#(\d+)|#x([0-9a-f]+)|([a-z][a-z0-9]+));?/gi,(t,n,i,o)=>{const s=n??i;if(s){const r=Number.parseInt(s,n?10:16);try{return Number.isFinite(r)?String.fromCodePoint(r):""}catch{return""}}return tme[String(o??"").toLowerCase()]??t})}const _y=new Set(["http","https","mailto","tel"]),nme=new Set(["javascript","vbscript","data","file","ftp","blob","filesystem","intent","chrome","chrome-extension","moz-extension","ms-browser-extension","view-source"]),fh=new Set(["http","https"]);function GH(e){return e.match(/^([a-z][a-z0-9+.-]*):/i)?.[1]?.toLowerCase()??""}const ime=/^https?:\/\//i;function ome(e){if(!ime.test(e))return!1;for(const t of e){const n=t.charCodeAt(0);if(t==="&"||n<=32||n>=127&&n<=159||n>127&&/\s/u.test(t))return!1}return!0}function sme(e,t,n){if(!P0(t,n)||!e.startsWith("file:///"))return!1;const i=e.charAt(8);return i!=="/"&&i!=="\\"}function P0(e,t){return e?(e==="a"||e==="area")&&(!t||t==="href"||t==="xlink:href"):!t||t==="href"}function rme(e,t){return t==="href"||t==="xlink:href"?P0(e,t)?_y:fh:t==="src"||t==="srcset"||t==="poster"||t==="action"||t==="formaction"||t==="data"?fh:(P0(e,t),_y)}function ip(e,t={}){if(ome(e))return!1;const n=KH(ZH(e)).toLowerCase(),i=String(t.tagName??"").toLowerCase(),o=String(t.attrName??"").toLowerCase();if(!n)return!1;if(n.startsWith("data:")){const r=/^data:image\/(?:png|gif|jpe?g|webp|avif|bmp);/i.test(n);return i==="img"&&o==="src"?!r:!0}if(/^[\\/]{2}/.test(n))return!0;if(n.startsWith("/")||n.startsWith("./")||n.startsWith("../")||n.startsWith("#")||n.startsWith("?"))return!1;const s=GH(n);return s?s==="file"?!sme(n,i,o):P0(i,o)?nme.has(s):!rme(i,o).has(s):!1}function lme(e){const t=ZH(String(e??"")).trim();if(!t||t.startsWith("#")||t.startsWith("/")||t.startsWith("./")||t.startsWith("../")||t.startsWith("?"))return!1;const n=GH(KH(t).toLowerCase());return n==="http"||n==="https"}function ame(e,t={}){const n=String(e??"").trim();return n?ip(n,t)?"":n:""}function AL(e){return ame(e,{tagName:"img",attrName:"src"})}function ume(e,t,n){function i(f){return f.trim().split(" ",2)[0]===t}function o(f,h,m,g,y){return f[h].nesting===1&&f[h].attrJoin("class",t),y.renderToken(f,h,m,g,y)}n=n||{};const s=3,r=n.marker||":",l=r.charCodeAt(0),a=r.length,u=n.validate||i,c=n.render||o;function d(f,h,m,g){let y,k=!1,v=f.bMarks[h]+f.tShift[h],C=f.eMarks[h];if(l!==f.src.charCodeAt(v))return!1;for(y=v+1;y<=C&&r[(y-v)%a]===f.src[y];y++);const w=Math.floor((y-v)/a);if(w=m||(v=f.bMarks[E]+f.tShift[E],C=f.eMarks[E],v=4)){for(y=v+1;y<=C&&r[(y-v)%a]===f.src[y];y++);if(!(Math.floor((y-v)/a)=2){const r=Number(s[0]),l=Number(s[1]);Number.isFinite(r)&&Number.isFinite(l)&&(o.map=[r+t,Math.min(l+t,n)])}Array.isArray(o.children)&&QH(o.children,t,n)}}function dme(e){["admonition","info","warning","error","tip","danger","note","caution"].forEach(t=>{e.use(ume,t,{render(n,i){return n[i].nesting===1?`
        `:`
        -`}})}),e.block.ruler.before("fence","vmr_container_fallback",(t,n,i,o)=>{const s=t,r=s.bMarks[n]+s.tShift[n],l=s.eMarks[n],a=s.src.slice(r,l),u=a.match(/^:::\s*([^\s{]+)/);if(!u)return!1;const c=u[1];if(!c.trim())return!1;const d=a.slice(u[0].length).trim();let f,h;const m=d.indexOf("{"),g=m>=0?d.slice(m).trimStart():void 0;if(m===-1)f=d||void 0;else{if(f=d.slice(0,m).trim()||void 0,g?.startsWith("{")){let L=0,E=-1;for(let S=0;S0&&(h=g.slice(0,E))}h||(f=d||void 0)}if(o)return!0;const y=!!s.env.__markstreamFinal;let k=n+1,v=!1;for(;k<=i;){const L=s.bMarks[k]+s.tShift[k],E=s.eMarks[k];if(s.src.slice(L,E).trim()===":::"){v=!0;break}k++}v||(k=i);const C=s.push("vmr_container_open","div",1);if(C.attrSet("class",`vmr-container vmr-container-${c}`),C.map=[n,v?k:i],C.meta={...C.meta??{},unclosed:!v&&!y},f&&C.attrSet("data-args",f),h)try{const L=JSON.parse(h);for(const[E,S]of Object.entries(L)){const x=S!=null&&typeof S=="object";C.attrSet(`data-${E}`,x?JSON.stringify(S):String(S))}}catch{const L=cme(h);if(L)for(const[E,S]of Object.entries(L)){const x=S!=null&&typeof S=="object";C.attrSet(`data-${E}`,x?JSON.stringify(S):String(S))}else C.attrSet("data-attrs",h)}const w=[];for(let L=n+1;LL.trim().length>0)){let L=w.join(` -`);L.endsWith(` -`)||(L+=` -`),L.endsWith(` - -`)||(L+=` -`);const E=s.tokens[s.tokens.length-1];E&&(E.raw=L);const S=[];s.md.block.parse(L,s.md,s.env,S),QH(S,n+1,n+1+w.length),s.tokens.push(...S)}const M=s.push("vmr_container_close","div",-1);return v||(M.hidden=!0,M.map=[i,i]),s.line=v?k+1:k,!0},{alt:["paragraph","reference","blockquote","list"]})}function Au(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function No(e){let t=!1,n=!1;for(let i=0;i")return i}return-1}function $4(e){const t=[],n=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let i;for(;(i=n.exec(e))!==null;){const o=i[1];if(!o)continue;const s=i[2]||i[3]||i[4]||"";t.push([o,s])}return t}const fme=/^[a-z][a-z0-9_-]*$/;function xL(e){return fme.test(String(e??"").trim().toLowerCase())}function Va(e){const t=String(e??"").trim();if(!t)return"";if(!t.startsWith("<"))return xL(t)?t.toLowerCase():"";let n=1;for(;n]/.test(s)?"":xL(o)?o:""}function Np(e){if(!e||e.length===0)return[];const t=new Set,n=[];for(const i of e){const o=Va(i);!o||t.has(o)||(t.add(o),n.push(o))}return n}function hme(...e){const t=new Set,n=[];for(const i of e)for(const o of Np(i))t.has(o)||(t.add(o),n.push(o));return n}function pme(e){const t=Np(e);return{key:t.join(","),tags:t}}function YH(e){return Va(e)}function mme(e,t){const n=String(e??""),i=Va(t);if(!i)return!1;const o=Au(i),s=n.match(new RegExp(String.raw`^\s*<\s*${o}(?:\s[^>]*)?(\s*\/)?>`,"i"));return s?s[1]?!0:new RegExp(String.raw`<\s*\/\s*${o}\s*>`,"i").test(n):!1}function JH(e,t){const n=Va(t);return!!n&&!Lv.has(n)&&!mme(e,n)}function gme(e,t){const n=String(e??""),i=Va(t);if(!i)return n;const o=Au(i),s=new RegExp(String.raw`^\s*<\s*${o}(?:\s[^>]*)?>\s*`,"i"),r=new RegExp(String.raw`\s*<\s*\/\s*${o}\s*>\s*$`,"i");return n.replace(s,"").replace(r,"")}const XH=Sf,vme=Lv,eW=new Set(qH);eW.delete("details");const yme=/<([A-Z][\w-]*)(?=[\s/>]|$)/gi,kme=/<\/\s*([A-Z][\w-]*)(?=[\s/>]|$)/gi,vA=/^<\s*(?:\/\s*)?([A-Z][\w-]*)/i,bme=/^<\s*([A-Z][\w:-]*)(?=[\s/>]|$)/i;function ib(e){return(e.match(vA)?.[1]??"").toLowerCase()}function kx(e){return/^\s*<\s*\//.test(e)}function bx(e,t){return XH.has(t)||/\/\s*>\s*$/.test(e)}function wme(e,t){let n=0;for(let i=0;i0&&n--;continue}bx(o,s)||n++}}return n}function SL(e,t,n=0){const i=new RegExp(String.raw`<\s*(\/?)\s*${Au(t)}(?=[\s>/])[^>]*>`,"gi");i.lastIndex=Math.max(0,n);let o=0,s;for(;(s=i.exec(e))!==null;){const r=s[0]??"",l=!!s[1],a=!l&&/\/\s*>$/.test(r);if(l){if(o===0)return{start:s.index,end:s.index+r.length};o--;continue}a||o++}return null}function Ame(e,t){const n=new RegExp(String.raw`<\s*(\/?)\s*${Au(t)}(?=[\s>/])[^>]*>`,"gi");let i=0,o;for(;(o=n.exec(e))!==null;){const s=o[0]??"",r=!!o[1],l=!r&&/\/\s*>$/.test(s);if(r){i>0&&i--;continue}l||i++}return i}function ob(e){const t=e;return String(t.raw??t.content??t.markup??"")}function xme(e){const t=e;return t.meta||(t.meta={}),t.meta}function Z3(e,t,n){const i=xme(e);i.markstreamCustomHtmlRaw=t,i.markstreamCustomHtmlInner=n}function Sme(e,t){if(!t.size)return;const n=Array.from(t,h=>new RegExp(String.raw`<\s*${Au(h)}(?=[\s>/])`,"i")),i=[];let o=!1;const s=h=>h?n.some(m=>m.test(h)):!1,r=h=>{if(!(!h||!i.length))for(const m of i)m.raw+=h,m.inner+=h},l=()=>{!i.length||!o||(r(` -`),o=!1)},a=h=>{r(h)},u=h=>{for(let g=0;g{const m=i[i.length-1]?.tag;if(!m)return null;const g=new RegExp(String.raw`^\s*<\s*\/\s*${Au(m)}\s*>`,"i");return h.match(g)?.[0]??null},d=h=>!!c(h),f=(h,m,g)=>{const y=g??(h.type==="html_inline"?ib(m):"");if(!(y&&t.has(y))){r(m);return}const k=kx(m),v=!k&&bx(m,y);if(k){if(!i.length||i[i.length-1].tag!==y){r(m);return}u(m);return}if(r(m),v){Z3(h,m,"");return}i.push({tag:y,token:h,raw:m,inner:""})};for(const h of e){if(h.type==="inline"&&Array.isArray(h.children)){const m=String(h.content??"");if(d(m)?o=!1:l(),!i.length&&!s(m)){o=!1;continue}let g=0,y=!0;for(const k of h.children){const v=ob(k),C=k.type==="html_inline"?ib(v):"",w=C&&t.has(C);let M=v;if(y&&m&&v&&(i.length||w)){const L=m.indexOf(v,g);if(L!==-1)a(m.slice(g,L)),M=m.slice(L,L+v.length),g=L+v.length;else{if(i.length&&!w)continue;y=!1}}f(k,M,C)}y&&m&&g0;continue}if(i.length&&typeof h.content=="string"){const m=ob(h),g=h.type==="html_block"?c(m):null;if(g){u(`${o?` -`:""}${g}`),o=i.length>0;continue}if(!h.content)continue;l(),r(h.content),o=!0}}for(const h of i)Z3(h.token,h.raw,h.inner)}function _me(e){return/^\s*<\s*[!?]/.test(e)}function Ime(e){const t=new Set(vme);if(e&&Array.isArray(e))for(const n of e){const i=String(n??"").trim();if(!i)continue;const o=i.match(/^[<\s/]*([A-Z][\w-]*)/i);o&&t.add(o[1].toLowerCase())}return t}function _L(e,t){if(t.has(e))return!0;for(const n of t)if(n.startsWith(e))return!0;return!1}function Mme(e,t){let n=null;for(const s of e.matchAll(yme)){const r=s.index??-1;if(r<0)continue;const l=(s[1]??"").toLowerCase();_L(l,t)&&No(e.slice(r))===-1&&(!n||r")&&(!n||s")&&(!n||s{const h=f,m=new Set(n),g=Array.isArray(h.env?.__markstreamCustomHtmlTags)?h.env.__markstreamCustomHtmlTags:[];for(const C of g){const w=Va(String(C??""));w&&m.add(w)}const y=Ime(Array.from(m)),k=new Set(Lme);for(const C of m)k.add(C);return{autoCloseInlineTagSet:k,commonHtmlTags:y,customTagSet:m,shouldMergeHtmlBlockTag:C=>m.has(C)||!y.has(C)||eW.has(C)}},o=f=>{if(f.type==="html_block")return String(f.content??"");if(f.type!=="inline"||!Array.isArray(f.children)||f.children.length!==1)return"";const h=f.children[0];return h?.type!=="html_block"?"":String(f.content??h.content??"")},s=(f,h)=>{f.type="html_block",f.content=h,f.raw=h,f.children=[]},r=f=>f.replace(/^(?:\r?\n)+/,""),l=f=>/^(?: {4}|\t)/.test(f),a=f=>f.replace(/^(?: {4}|\t)/gm,""),u=(f,h)=>{const m=r(f);if(!/\S/.test(m))return[];if(l(m))return[{type:"code_block",content:a(m),raw:m}];const g=m.replace(/^[\t ]+/,"");if(!g)return[];if(g.startsWith("<"))return[{type:"html_block",content:g}];const y={type:"inline",tag:"",nesting:0,content:g,children:[{type:"text",content:g,raw:g}]};return h==="paragraph"?[{type:"paragraph_open",tag:"p",nesting:1},y,{type:"paragraph_close",tag:"p",nesting:-1}]:h==="text"?[{type:"text",content:g,raw:g}]:[y]},c=(f,h,m)=>f[h-1]?.type==="paragraph_open"&&f[h+1]?.type==="paragraph_close"?"inline":m,d=(f,h)=>{const m=r(h);return!/\S/.test(m)||f.type!=="inline"||!Array.isArray(f.children)?!1:(f.content=`${String(f.content??"")}${m}`,f.children.push({type:"text",content:m,raw:m}),!0)};e.core.ruler.after("inline","fix_html_inline_streaming",f=>{const h=f.tokens??[],{commonHtmlTags:m,customTagSet:g}=i(f);for(const y of h){const k=y;if(k.type!=="inline"||!Array.isArray(k.children))continue;const v=String(k.content??""),C=k.children.length?k.children:v.includes("<")?[{type:"text",content:v,raw:v}]:null;if(C)try{const w=Eme(C,m);if(k.children=w.children,w.pendingBuffer){const M=v.lastIndexOf(w.pendingBuffer);if(M!==-1){const L=v.slice(0,M);k.content=L,typeof k.raw=="string"&&(k.raw=L)}}}catch(w){console.error("[applyFixHtmlInlineTokens] failed to fix streaming html inline",w)}}Sme(h,g)}),e.core.ruler.push("fix_html_inline_tokens",f=>{const h=f.tokens??[],{autoCloseInlineTagSet:m,customTagSet:g,shouldMergeHtmlBlockTag:y}=i(f),k=[];for(let v=0;v0){const[M,L]=k[k.length-1];if(v!==L){if(C.type==="paragraph_open"||C.type==="paragraph_close"){h.splice(v,1),v--;continue}const E=String(C.content??C.raw??"");if(E){const S=h[L],x=`${String(S.content||"")} -${E}`,A=No(x),T=A===-1?null:SL(x,M,A+1);if(T){const I=x.slice(0,T.end),O=x.slice(T.end);S.content=I,S.loading=!1,h.splice(v,1),k.pop();const H=d(S,O)?[]:u(O,c(h,v,"paragraph"));H.length&&h.splice(v,0,...H),v--;continue}S.content=x,S.loading!==!1&&(S.loading=!0)}h.splice(v,1),v--;continue}}const w=o(C);if(w){if(_me(w))continue;const M=(w.match(/<\s*(?:\/\s*)?([^\s>/]+)/)?.[1]??"").toLowerCase(),L=/^\s*<\s*\//.test(w);if(!M||!y(M))continue;if(s(C,w),!L)M&&!new RegExp(`^\\s*<\\s*${M}\\b[^>]*\\/\\s*>`,"i").test(w)&&Ame(w,M)>0&&k.push([M,v]);else if(k.length>0&&M&&k[k.length-1][0]===M){const[,E]=k[k.length-1],S=h[E];S.content=`${String(S.content||"")} -${w}`,S.loading=!1,k.pop(),h.splice(v,1),v--}continue}else if(k.length>0){if(C.type==="paragraph_open"||C.type==="paragraph_close"){h.splice(v,1),v--;continue}const M=C.content||"",L=new RegExp(`<\\s*\\/\\s*${k[k.length-1][0]}\\s*>`,"i").test(M);if(M){const[,E]=k[k.length-1],S=h[E];S.content=`${S.content||""} -${M}`,S.loading!==!1&&(S.loading=!L)}L&&k.pop(),h.splice(v,1),v--}else continue}if(g.size>0){const v=new Map,C=new Map,w=E=>{let S=v.get(E);return S||(S=new RegExp(`<\\s*${E}\\b`,"i"),v.set(E,S)),S},M=E=>{let S=C.get(E);return S||(S=new RegExp(`<\\s*\\/\\s*${E}\\s*>`,"i"),C.set(E,S)),S},L=[];for(let E=0;E0){const T=L[L.length-1],I=h[T.index],O=S.type==="html_block"?M(T.tag).exec(x):null;if(O){const F=O.index+O[0].length,P=x.slice(0,F),z=x.slice(F);I.content=`${String(I.content??"")} -${P}`,Array.isArray(I.children)&&I.children.push({type:"html_inline",content:``,raw:``}),L.pop();const W=d(I,z)?[]:u(z,c(h,E,"paragraph"));W.length?h.splice(E,1,...W):(h.splice(E,1),E--);continue}if(S.type!=="inline")continue;const H=Array.isArray(S.children)?S.children:[],R=wme(H,T.tag);if(R!==-1){const F=H.slice(0,R+1),P=H.slice(R+1),z=F.map(W=>String(W?.content??W?.raw??"")).join("");if(I.content=`${String(I.content??"")} -${z}`,Array.isArray(I.children)&&I.children.push(...F),P.length){const W=P.map($=>String($.content??$.raw??"")).join("");if(W.trim()){const $=W.replace(/^\s+/,"");if(d(I,W))h.splice(E,1),E--;else if($.startsWith("<"))h.splice(E,1,{type:"html_block",content:$});else{const K=u(W,c(h,E,"paragraph"));h.splice(E,1,...K)}}else h.splice(E,1),E--}else h.splice(E,1),E--;L.pop();continue}I.content=`${String(I.content??"")} -${x}`,Array.isArray(I.children)&&I.children.push(...H),h.splice(E,1),E--;continue}if(S.type!=="inline")continue;const A=Array.isArray(S.children)?S.children:[];for(const T of g)if((A.length?Cme(A,T):w(T).test(x)&&!M(T).test(x)?1:0)>0){L.push({tag:T,index:E});break}}}{let v=0;for(let C=0;C0?v--:(h.splice(C,1),C--))}}for(let v=0;v/]+)/)?.[1]??"").toLowerCase();if(S.startsWith("!")||S.startsWith("?")){C.loading=!1;continue}if(g.has(S)){const R=String(C.content??""),F=No(R),P=F===-1?null:SL(R,S,F+1);C.loading=P?!1:C.loading!==void 0?C.loading:!0;const z=P?.start??-1,W=P?P.end-P.start:0;if(z!==-1){const $=R.slice(0,z+W);let K="";F!==-1&&F]+)))?/g;let A;for(;(A=x.exec(C.content||""))!==null;)A[1],A[2]||A[3]||A[4];const T=String(C.content??""),I=new RegExp(`<\\/\\s*${S}\\s*>`,"i").exec(T),O=I?I.index:-1,H=I?I[0].length:0;if(O!==-1){const R=T.slice(0,O+H),F=(T.slice(O+H)||"").replace(/^\s+/,"");C.children=[{type:"html_block",content:R,tag:S,loading:!1}],C.content=R,C.raw=R,F&&h.splice(v+1,0,F.startsWith("<")?{type:"html_block",content:F}:{type:"text",content:F,raw:F})}else C.children=[{type:"html_block",content:C.content,tag:S,loading:!0}];continue}if(!C||C.type!=="inline")continue;if(C.children.length===2&&C.children[0].type==="html_inline"){const S=(C.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase(),x=C.children[1],A=String(x?.content??"").match(/^<\s*\/\s*([^\s>]+)/)?.[1]?.toLowerCase()??"";if(x?.type==="html_inline"&&A===S)continue;m.has(S)?(C.children[0].loading=!0,C.children[0].tag=S,C.children.push({type:"html_inline",tag:S,loading:!0,content:``})):C.children=[{type:"html_block",loading:!0,tag:S,content:String(C.children[0]?.content??"")+String(C.children[1]?.content??"")}];continue}else if(C.children.length===3&&C.children[0].type==="html_inline"&&C.children[2].type==="html_inline"){const S=(C.children[0].content?.match(/<([^\s>/]+)/)?.[1]??"").toLowerCase();if(m.has(S))continue;C.children=[{type:"html_block",loading:!1,tag:S,content:C.children.map(x=>x.content).join("")}];continue}if(!C.content?.startsWith("<")||C.children?.length!==1)continue;const w=String(C.content),M=C,L=M.children[0];if(L?.type!=="html_inline"){/^<\s*(?:\/\s*)?[A-Z][\w:-]*\s*$/i.test(w)&&(M.children.length=0);continue}const E=String(L.content??w).match(bme)?.[1]?.toLowerCase()??"";if(E){if(/\/\s*>\s*$/.test(w)||XH.has(E)){M.children=[{type:"html_inline",content:w}];continue}M.children.length=0}}})}function Fme(e){const t=e.trim();return!t||/^&[a-z0-9#]+;/i.test(t)?!1:!!(/^(?:const|let|var|function|class|import|export|if|for|while|return|await|async|yield|try|catch|throw|new|typeof|instanceof|switch|case|break|continue|def|ruby|perl|print|echo|true|false|null|undefined|NaN|Infinity|this)\b/.test(t)||/[a-z_$][\w$]*(?:\.[a-z_$][\w$]*|\['[^']*'\]|\["[^"]*"\]|\[\d+\])*\s*\(/i.test(t)||/[a-z_$][\w$]*(?:\.[a-z_$][\w$]*|\['[^']*'\]|\["[^"]*"\]|\[[\d+\]])+/i.test(t)||/\w+\s*(?:===?|!==?|<=?|>=?|\+\+|--|&&|\|\||\?\.)/.test(t)||/^(?:!!|\+\+|--)\s*\w/.test(t)||/[\w$]+\s*(?:\+=|-=|\*=|\/=|%=|\*\*=|=)/.test(t)||/^(?:https?:\/\/|ftp:\/\/|file:\/\/|\/\/|www\.)/i.test(t)||/`[^`]*\$\{[^}]*\}[^`]*`/.test(t)||/<\/?[A-Z][a-zA-Z0-9]*/.test(t)||/<[a-z][a-z0-9]*\s[^>]+>/.test(t)||/^(["'`]).*\1\s*[;,]?$/.test(t)||/^\[[\s\S]*\]$/.test(t)||/^\{[\s\S]*\}$/.test(t)||/^\(\s*\)$/.test(t)||/[\w$]+(?:\s*[+\-*/%<>=!&|^~:]+\s*[\w$]+|\s*\.\s*[\w$]+)/.test(t)||/=>|->|::/.test(t)||/^@[\w.$]+$/.test(t)||/^(?:0x[0-9a-fA-F]+|0b[01]+|0o[0-7]+|\d+(?:\.\d*)?(?:px|em|rem|%|vh|vw|deg|s|ms)?)$/.test(t)||/^\$[\w$]+\s*[=:]/.test(t)||/\|\s*\w+|\w+\s*\|/.test(t)||/^(?:git|npm|yarn|pnpm|bun|pip|cargo|go|rust|python|node|java|mvn|gradle|docker|kubectl)\s+/.test(t)||/(?:console|window|document|Math|JSON|Date|Array|Object|String|Number|Boolean)\.[a-zA-Z]/.test(t)||/^(?:\/\/|#|\/\*|\*\/|)/.test(t)||/^(?:<<<|<<\s*['"]?\w+['"]?)/.test(t))}function Dme(e,t={}){t.enabled!==!1&&e.core.ruler.after("inline","fix_indented_code_block",n=>{const i=n.tokens??[];for(let o=0;oa.trim().length>0);if(l.length===1&&!Fme(l[0]??"")){const a=l[0]??"",u=s.level??0;i.splice(o,1,{type:"paragraph_open",tag:"p",nesting:1,level:u},{type:"inline",tag:"",nesting:0,level:u,content:a,children:[{type:"text",content:a,level:u+1,raw:a}],block:!0},{type:"paragraph_close",tag:"p",nesting:-1,level:u}),o+=2}}})}const tW=/\.([a-z0-9]{1,15})$/i,Rme=/[_()[\]{}<>]/u,Ome=/^(?:https?:\/\/|ftp:\/\/|mailto:|www\.)/i,Pme=/[?#@]/u,Bme=/[\\/]/u,$me=/^[\p{L}\p{N}./\\-]+$/u,zme=/^[A-Za-z0-9-]{1,63}$/u,jme=/^xn--[a-z0-9-]{2,59}$/i,Hme=/^(?:[A-Z]{1,6}|\d{1,8})$/u,Wme=/^(?=.{1,12}$)[A-Z0-9]+(?:[-.][A-Z0-9]+)*$/iu,qme=/文件名\s*[::]?|附件\s*[::]?|路径\s*[::]?|路徑\s*[::]?|文件列表\s*[::]?|文档列表\s*[::]?|文檔列表\s*[::]?|\bfile\s*names?\b\s*[::]?|\battachments?\b\s*[::]?|\bpaths?\b\s*[::]?|\bfile\s+lists?\b\s*[::]?|\bdocument\s+lists?\b\s*[::]?/iu,Ume=/文件名\s*[::]?|文件\s*[::]?|附件\s*[::]?|档案\s*[::]?|檔案\s*[::]?|文档\s*[::]?|文檔\s*[::]?|资料\s*[::]?|資料\s*[::]?|路径\s*[::]?|路徑\s*[::]?|\bfile\s*name\b\s*[::]?|\battachments?\b\s*[::]?|\bfiles?\b\s*[::]?|\bdocuments?\b\s*[::]?|\bdocs?\b\s*[::]?|\bpaths?\b\s*[::]?/iu,Vme=/股票代码|股票代碼|证券代码|證券代碼|(?:代码|代碼|交易所|后缀|後綴|市场|市場)(?=$|[\s::/|,,、()()])|\btickers?\b|\bsymbols?\b|\bexchanges?\b/iu,Kme=2e3,Zme=512,Gme={},Qme=new Set(["ai","md","py","rs","sh","zip"]),nW=new Set(["as","bj","de","hk","l","ln","ny","pa","sh","ss","sz","t","us"]),Yme=new Set([...nW,"at","ax","cn","co","it","jp","ks","mc","mx","nz","pl","sa","si","to","tw"]),Jme=new Set(["com","dev","io","page","site"]),Xme=new Set(["app","apk","dmg","exe","ipa","lock","log","markdown","webmanifest"]),ege=new Set(["7z","ai","astro","avi","bash","bz2","c","cjs","cpp","cs","csv","doc","docx","fish","flac","gif","go","gz","h","hpp","html","java","jpeg","jpg","js","json","jsx","kt","md","mdx","mjs","mov","mp3","mp4","pdf","php","png","ppt","pptx","ps1","py","rar","rb","rs","sh","sql","svg","swift","svelte","tar","tgz","toml","ts","tsx","txt","vue","wav","webp","xls","xlsx","xml","yaml","yml","zip","zsh"]),jh=new Map;function IL(e,t){if(!e||e.length>Zme)return t;for(jh.set(e,t);jh.size>Kme;){const n=jh.keys().next().value;if(!n)break;jh.delete(n)}return t}function Nv(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function G3(e,t){const n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return Nv(n)?n:void 0}function ML(e,t){if(!Nv(t))return e;const n=e?.__linkifyDemotionContext;return{...e,__linkifyDemotionContext:{filename:n?.filename||t?.filename,explicitFilename:n?.explicitFilename||t?.explicitFilename,marketTicker:n?.marketTicker||t?.marketTicker}}}function TL(e){const t=h2(e);return Nv(t)?t:void 0}function tge(e){return e.replace(/^[\s>*_`[\]((【《"'“‘]+/u,"").replace(/[\s<*_`\]))】》"'.。;;,,、::!?!?]+$/u,"")}function EL(e,t){if(!Nv(t))return;const n=String(e??"").trim().split(/\s+/u).map(tge).filter(Boolean);if(n.length===0)return;const i={};return t?.filename&&n.every(o=>sb(o,{filename:!0,explicitFilename:t.explicitFilename}))&&(i.filename=!0),t?.explicitFilename&&i.filename&&(i.explicitFilename=!0),t?.marketTicker&&n.every(o=>sb(o,{marketTicker:!0}))&&(i.marketTicker=!0),Nv(i)?i:void 0}function qf(e,t=!1){let n;return{options(i){return t||i==null?ML(e,n):ML(e,G3(TL(i),EL(i,n)))},remember(i){const o=TL(i);n=t?G3(n,o):G3(o,EL(i,n))},reset(){n=void 0}}}function LL(e){return zme.test(e)&&!e.startsWith("-")&&!e.endsWith("-")}function nge(e){const t=e.split(".");if(t.length<2)return!1;const n=t[t.length-1]?.toLowerCase()??"";return LL(n)||jme.test(n)?t.every(LL):!1}function iW(e){return Array.from(e).some(t=>t.charCodeAt(0)>127)}function ige(e){return e.replace(/^[a-z][a-z0-9+.-]*:\/\//i,"").split(/[/?#]/,1)[0]??""}function oge(e){return e.split(".").some(t=>t.toLowerCase().startsWith("xn--"))}function oW(e,t,n){const i=ige(t);return iW(e)&&oge(i)&&String(n??"").toLowerCase().includes(i.toLowerCase())}function sge(e){if(!e)return!1;if(e.includes("文件")||e.includes("附件")||e.includes("路径")||e.includes("路徑")||e.includes("文档")||e.includes("文檔")||e.includes("档案")||e.includes("檔案")||e.includes("资料")||e.includes("資料")||e.includes("股票")||e.includes("证券")||e.includes("證券")||e.includes("代码")||e.includes("代碼")||e.includes("交易所")||e.includes("后缀")||e.includes("後綴")||e.includes("市场")||e.includes("市場"))return!0;const t=e.toLowerCase();return t.includes("file")||t.includes("attachment")||t.includes("document")||t.includes("doc")||t.includes("path")||t.includes("ticker")||t.includes("symbol")||t.includes("exchange")}function h2(e){const t=String(e??""),n=jh.get(t);return n?(jh.delete(t),jh.set(t,n),n):sge(t)?IL(t,{explicitFilename:qme.test(t),filename:Ume.test(t),marketTicker:Vme.test(t)}):IL(t,Gme)}function rge(e){return nge(e.split(/[\\/]/)[0]??"")}function lge(e){const t=e.replace(/[^a-z]/gi,"");return t.length>=2&&t===t.toUpperCase()}function age(e){if(Rme.test(e)||!$me.test(e))return!0;if(Bme.test(e))return!rge(e);const t=e.replace(tW,"");return iW(t)?!0:t.split(".").filter(Boolean).some(lge)}function uge(e,t,n){if(!(n?Yme:nW).has(t))return!1;const i=e.slice(0,-(t.length+1));return i===""?e.startsWith("."):(n?Wme:Hme).test(i)}function sb(e,t={}){if(!e||Ome.test(e)||Pme.test(e))return!1;const n=e.match(tW);if(!n)return!1;const i=String(n[1]??"").toLowerCase();return uge(e,i,t.marketTicker===!0)?!0:ege.has(i)?!Qme.has(i)||t.filename?!0:age(e):!!(t.explicitFilename&&Jme.has(i)||t.filename&&Xme.has(i))}const sW=new WeakMap,rW=new WeakSet;function yA(e,t){return sW.set(e,t),e}function cge(e){return sW.get(e)}function dge(e){rW.add(e)}function fge(e){return e===void 0||rW.has(e)}const NL=["!"];function FL(e){return e==="linkify"||e==="autolink"?e:"recovery"}function gl(e){return{type:"text",content:e,raw:e}}function hh(e,t){t===1?e.push({type:"em_open",tag:"em",nesting:1}):t===2?e.push({type:"strong_open",tag:"strong",nesting:1}):t===3&&(e.push({type:"strong_open",tag:"strong",nesting:1}),e.push({type:"em_open",tag:"em",nesting:1}))}function ph(e,t){t===1?e.push({type:"em_close",tag:"em",nesting:-1}):t===2?e.push({type:"strong_close",tag:"strong",nesting:-1}):t===3&&(e.push({type:"em_close",tag:"em",nesting:-1}),e.push({type:"strong_close",tag:"strong",nesting:-1}))}function Ed(e,t,n,i="recovery"){let o="";if(t.includes('"')){const s=t.split('"');t=s[0].trim(),o=s[1].trim()}return yA({type:"link",loading:n,href:t,title:o,text:e,children:[{type:"text",content:e,raw:e}],raw:`[${e}](${t})`},i)}function hge(e,t){if(!(!e||!t)&&(e.href=String(e.href??"")+t,e.text=String(e.text??"")+t,e.raw=`[${e.text}](${e.href})`,Array.isArray(e.children)&&e.children.length)){const n=e.children[e.children.length-1];n?.type==="text"?(n.content=String(n.content??"")+t,n.raw=String(n.raw??"")+t):e.children.push(gl(t))}}function DL(e,t){let n=-1;for(const i of t){const o=e.indexOf(i);o!==-1&&(n===-1||on?.[0]==="href")?.[1];return typeof t=="string"?t:""}function mge(e,t){if(!e)return;e.attrs=Array.isArray(e.attrs)?e.attrs:[];const n=e.attrs.findIndex(i=>i?.[0]==="href");n>=0?e.attrs[n][1]=t:e.attrs.push(["href",t])}function RL(e,t,n){let i="";for(let o=t+1;o{const n=t.tokens??[];for(let i=0;ir.type==="code_inline"),i=new Map;let o=0;for(let r=0;r0&&u?OL(u):-1;if(c!==-1&&u)for(const d of u.slice(c))d==="("?o++:d===")"&&o>0&&o--}a!==-1&&(r=a);continue}if(!(l.type!=="text"||typeof l.content!="string"))for(const a of l.content)a==="("?o++:a===")"&&o>0&&o--}const s=h2(t);for(let r=0;r<=e.length-1;r++){r<0&&(r=0);const l=e[r];if(!l)break;if(l.type==="link_open"&&(l.markup==="linkify"||l.markup==="autolink")){let a=-1;for(let u=r+1;u0){const m=OL(u);m!==-1&&(d===-1||m=g.content.length){h-=g.content.length;continue}if(h<0)break;const y=g.content[h],k=g.content.slice(0,h);let v=g.content.slice(h);for(let M=m+1;M0&&(e.splice(m+1,C),a=m+1);let w=c;if(y==="!"&&f!==-1)w=c.slice(0,f);else if(v){const M=encodeURI(v);if(M&&c.endsWith(M))w=c.slice(0,c.length-M.length);else{const L=y?encodeURI(y):"",E=L?c.indexOf(L):-1;E!==-1&&(w=c.slice(0,E))}}w!==c&&mge(l,w),v&&e.splice(a+1,0,gl(v));break}}}if(!n){if(l?.type==="em_open"&&e[r-1]?.type==="text"&&e[r-1].content?.endsWith("*")){const a=e[r-1].content?.replace(/(\*+)$/,"")||"";e[r-1].content=a,l.type="strong_open",l.tag="strong",l.markup="**";for(let u=r+1;ud[0]==="href")?.[1]||"";if(e[r+3]?.type==="text"){const d=(e[r+3]?.content??"").indexOf(")"),f=d===-1;d===-1&&(c+=e[r+3]?.content?.slice(0,d)||"",e[r+3].content=""),a.push(Ed(u,c,f,"linkify"));const h=e[r+3].content?.replace(/^\)\**/,"");h&&a.push(gl(h)),e.splice(r-4,8,...a)}else a.push(yA({type:"link",loading:!0,href:c,title:"",text:u,children:[{type:"text",content:c,raw:c}],raw:`[${u}](${c})`},"linkify")),e.splice(r-4,7,...a);continue}else if(e[r-1].content==="]("&&e[r-3]?.type==="text"&&e[r-3].content?.endsWith(")"))if(e[r-2]?.type==="strong_open"){const[a,u]=e[r-3].content?.split("[**")||[];e[r+1].content=u||"",e[r-3].content=a||"",e[r-1].content=""}else if(e[r-2]?.type==="em_open"){const[a,u]=e[r-3].content?.split("[*")||[];e[r+1].content=u||"",e[r-3].content=a||"",e[r-1].content=""}else{const[a,u]=e[r-3].content?.split("[")||[];e[r+1].content=u||"",e[r-3].content=a||"",e[r-1].content=""}}if(l.type==="link_close"&&l.nesting===-1&&e[r-2]?.type==="link_open"&&e[r+1]?.type==="text"&&e[r-1]?.type==="text"){const a=e[r-1].content||"",u=e[r-2].attrs||[],c=u.find(k=>k[0]==="href")?.[1]||"",d=u.find(k=>k[0]==="title")?.[1]||"";let f=3,h=2;const m=(e[r-3]?.content||"").match(/^(\*+)$/),g=[];if(m){h+=1;const k=m[1].length;hh(g,k)}if(l.markup!=="linkify"&&e[r+1].type==="text"&&e[r+1]?.content?.startsWith("](")){f+=1;for(let k=r+1;ky[0]==="href")?.[1];e[r+5]?.type==="text"&&e[r+5].content==="."?(f=(g||f)+e[r+5].content,e[r+5].content=""):f=g||f,h+=3}let m=!0;if(l.nesting===-1&&(d=d.replace(/\*+$/,"")),e[r+2]?.type==="text"){const g=(e[r+2]?.content??"").indexOf(")");m=g===-1,g===-1&&(f+=e[r+2]?.content?.slice(0,g)||"",e[r+2].content="")}a.push(Ed(d,f,m)),ph(a,2),e.splice(r-2,h,...a)}if(l.type==="text"&&/\*+\[[^\]]*$/.test(l.content||"")&&e[r+1]?.type==="strong_open"&&e[r+2]?.type==="text"&&e[r+2].content==="]("&&e[r+3]?.type==="link_open"&&e[r+5]?.type==="link_close"&&e[r+6]?.type==="text"&&e[r+6].content===")"&&e[r+7]?.type==="strong_close"){const a=(l.content||"").match(/^(\*+)\[(.*)$/);if(a){const u=(a[2]||"")+a[1];let c=e[r+3]?.attrs?.find(f=>f[0]==="href")?.[1]||"";!c&&e[r+4]?.type==="text"&&(c=e[r+4].content||"");const d=[];hh(d,2),d.push(Ed(u,c,!1)),ph(d,2),e.splice(r,9,...d),r-=d.length-1;continue}}}}if(n)return e;for(let r=0;r{const n=t.tokens??[];for(let i=0;i{const n=t.tokens??[];for(let i=0;i=0&&e[m].type==="text"&&e[m].content==="";)m--;const g=e[m];let y=c+1;for(;y=0&&e[m].type==="text"&&e[m].content==="";)m--;const g=e[m];let y=c+1;for(;y{const n=t;try{const i=Ege(n.tokens??[],!!n.env?.__markstreamFinal,n.src??"");Array.isArray(i)&&(n.tokens=i)}catch(i){console.error("[applyFixTableTokens] failed to fix table tokens",i)}})}function PL(){return[{type:"table_open",tag:"table",attrs:null,map:null,children:null,content:"",markup:"",info:"",level:0,loading:!0,meta:null},{type:"thead_open",tag:"thead",attrs:null,block:!0,level:1,children:null},{type:"tr_open",tag:"tr",attrs:null,block:!0,level:2,children:null}]}function BL(){return[{type:"tr_close",tag:"tr",attrs:null,block:!0,level:2,children:null},{type:"thead_close",tag:"thead",attrs:null,block:!0,level:1,children:null},{type:"table_close",tag:"table",attrs:null,map:null,children:null,content:"",markup:"",info:"",level:0,meta:null}]}function $L(e){return[{type:"th_open",tag:"th",attrs:null,block:!0,level:3,children:null},{type:"inline",tag:"",children:null,content:e,level:4,attrs:null,block:!0},{type:"th_close",tag:"th",attrs:null,block:!0,level:3,children:null}]}function lW(e,t){if(!e.startsWith("|")||e.includes(` -`)||!e.endsWith("|"))return null;const n=e.slice(1).split("|");return n.at(-1)===""&&n.pop(),n.length>0&&n.every(i=>i.trim().length>0)?n:null}function Q3(e){return lW(e)!==null}function aW(e){return/^:?-+:?$/.test(e.trim())}function Sge(e){if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|");return t.at(-1)===""&&t.pop(),t.length>0&&t.every(aW)}function _ge(e){return/^(?:[::]-*|:?-+:?)?$/.test(e.trim())}function Ige(e){if(e==="")return!0;if(!e.startsWith("|"))return!1;const t=e.slice(1).split("|"),n=t.at(-1)??"";return t.slice(0,-1).every(aW)&&_ge(n)}function Mge(e){return e==="|"||e==="|:"}function Tge(e){const t=lW(e);return t!==null&&t.every(n=>!n.includes(":"))}function Ege(e,t=!1,n=""){const i=[...e];if(e.length<3)return i;const o=e.length-2,s=e[o];if(s.type==="inline"){const r=String(s.content??""),l=r.split(` -`)[0]??"",[a="",u="",...c]=r.split(` -`),d=!t&&!r.includes(` -`)&&/\r?\n$/.test(n)&&Q3(r);if(!t&&(r.includes(` -`)&&c.length===0&&Q3(a)&&Ige(u)||d)){const f=l.slice(1,-1).split("|").map(m=>m.trim()).flatMap(m=>$L(m)),h=[...PL(),...f,...BL()];i.splice(o-1,3,...h)}else if(r.includes(` -`)&&c.length===0&&Q3(a)&&Sge(u)){const f=l.slice(1,-1).split("|").map(m=>m.trim()).flatMap(m=>$L(m)),h=[...PL(),...f,...BL()];i.splice(o-1,3,...h)}else r.includes(` -`)&&c.length===0&&Tge(a)&&Mge(u)&&(s.content=r.slice(0,-2),s.children.splice(2,1))}return i}function Lge(e,t,n,i){const o=e.length;if(n==="$$"&&i==="$$"){let u=t;for(;u=0&&e[c]==="\\";)d++,c--;if(d%2===0)return u}u++}return-1}const s=n[n.length-1],r=i;let l=0,a=t;for(;a=0&&e[c]==="\\";)d++,c--;if(d%2===0){if(l===0)return a;l--,a+=r.length;continue}}const u=e[a];if(u==="\\"){a+=2;continue}u===s?l++:u===r[r.length-1]&&l>0&&l--,a++}return-1}var Nge=Lge;const Fge=["boldsymbol","mathbb","mathcal","mathfrak","mathrm","mathit","mathsf","vec","hat","bar","tilde","overline","underline","mathscr","mathnormal","operatorname","mathbf*"],rb=Fge.map(e=>e.replace(/[.*+?^${}()|[\\]"\]/g,"\\$&")).join("|"),Dge=/\\[a-z]+/i,uW="(?:\\\\|\\u0008)",Rge=new RegExp(String.raw`${uW}(?:${rb})\s*\{[^}]+\}`,"i"),Oge=new RegExp(String.raw`(?:${uW})?(?:${rb})\s*\{`,"i"),Pge=/\\(?:text|frac|left|right|times)/,Bge=/(?:^|[^+])\+(?!\+)|[=\-*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/,$ge=/\b[A-Z]{2,}-[A-Z]{2,}\b/i,zge=/[A-Z]+\s*\([^)]+\)/i,jge=/^\(\s*[a-z](?:\s*,\s*[a-z])+\s*\)$/i,Hge=/\b(?:sin|cos|tan|log|ln|exp|sqrt|frac|sum|lim|int|prod)\b/,Wge=/\b\d{4}\/\d{1,2}\/\d{1,2}(?:[ T]\d{1,2}:\d{2}(?::\d{2})?)?\b/,qge={"\b":"\\b","\v":"\\v","\f":"\\f"};function Uge(e){let t="";for(const n of e)t+=qge[n]??n;return t}function Qd(e){if(!e)return!1;const t=Uge(e),n=t.trim();if(Wge.test(n)||n.includes("**"))return!1;if(n.length>2e3)return!0;const i=Dge.test(t),o=Rge.test(t),s=Oge.test(t),r=Pge.test(t),l=/(?:^|[^\w\\])(?:[A-Z]|\\[A-Z]+)_(?:\{[^}]+\}|[A-Z0-9\\])/i.test(t)||/(?:^|[^\w\\])(?:[A-Z]|\\[A-Z]+)\^(?:\{[^}]+\}|[A-Z0-9\\])/i.test(t),a=Bge.test(t)&&!$ge.test(t),u=zge.test(t),c=jge.test(n),d=Hge.test(t),f=/^\([a-z]\)$/i.test(n)||/^(?:[a-z]|pi)$/i.test(n),h=/^(?:[A-Z][a-z]?(?:_\{?\d+\}?|\^\{?\d+\}?)?)+$/.test(n);return i||o||s||r||l||a||u||c||d||f||h}const cW="__markstreamMathPluginApplied",kA=80,dW=2e4,zL=dW+4096;function wx(e){return!!e[cW]}function Vge(e){e[cW]=!0}const fW=["ldots","cdots","quad","in","displaystyle","int_","lim","lim_","ce","pu","end","infty","perp","mid","operatorname","to","rightarrow","leftarrow","math","mathrm","mathit","mathbb","mathcal","mathfrak","implies","alpha","beta","gamma","delta","epsilon","lambda","sum","sum_","prod","sqrt","fbox","boxed","color","rule","edef","fcolorbox","hline","hdashline","cdot","times","pm","le","ge","neq","sin","cos","tan","log","ln","exp","frac","text","left","right"],Kge=["cdot","mathbf{","partial","mu_{"],hW=fW.slice().sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),pW="[ \r\b\f\v]",Zge=new RegExp(`([^\\\\])(${Kge.map(e=>e).join("|")})+`,"g"),Gge=/span\{([^}]+)\}/,Qge=/\\operatorname\{span\}\{((?:[^{}]|\{[^}]*\})+)\}/,Yge=/(^|[^\\])\\\r?\n/g,Jge=/(^|[^\\])\\$/g,Xge=/[\p{L}\p{M}\p{N}\p{Pe}\p{Pf}'′″‴|‖]/u,e0e=new RegExp(`(${pW})|(${hW})\\b`,"g"),jL=new Map,HL=new Map;function t0e(e){if(!e)return e0e;const t=[...e];t.sort((r,l)=>l.length-r.length);const n=t.join(""),i=jL.get(n);if(i)return i;const o=`(?:${t.map(r=>r.replace(/[.*+?^${}()|[\\]\\"\]/g,"\\$&")).join("|")})`,s=new RegExp(`(${pW})|(${o})\\b`,"g");return jL.set(n,s),s}function n0e(e,t){const n=e?[]:[...t??[]];e||n.sort((l,a)=>a.length-l.length);const i=e?"__default__":n.join(""),o=HL.get(i);if(o)return o;const s=e?[rb,hW].filter(Boolean).join("|"):[n.map(l=>l.replace(/[.*+?^${}()|[\\]\\\]/g,"\\$&")).join("|"),rb].filter(Boolean).join("|"),r=new RegExp(`(^|[^\\\\\\w])(${s})\\s*\\{`,"g");return HL.set(i,r),r}const WL={" ":"t","\r":"r","\b":"b","\f":"f","\v":"v"};function qL(e){const t=/(^|[^\\])(__|\*\*)/g;let n=0;for(;t.exec(e)!==null;)n++;return n}function i0e(e){return e.replace(/(^|[^\\])!+/gu,(t,n)=>{if(n&&Xge.test(n))return t;const i=n?t.slice(n.length):t;return`${n}${"\\!".repeat(i.length)}`})}function UL(e){const t=/(^|[^\\])(__|\*\*)/g;let n,i=null;for(;(n=t.exec(e))!==null;)i={marker:n[2],index:n.index+(n[1]?.length??0)};return i}function Ld(e,t){const n=t?.commands??fW,i=t?.escapeExclamation??!0,o=t?.commands==null,s=t0e(o?void 0:n);let r=e.replace(s,(u,c,d,f,h)=>{if(c!==void 0&&WL[c]!==void 0)return`\\${WL[c]}`;if(d&&n.includes(d)){const m=h&&typeof f=="number"?h[f-1]:void 0;return m==="\\"||m&&/\w/.test(m)?u:`\\${d}`}return u});i&&(r=i0e(r));let l=r;const a=n0e(o,o?void 0:n);return l=l.replace(a,(u,c,d)=>`${c}\\${d}{`),l=l.replace(Gge,"span\\{$1\\}").replace(Qge,"\\operatorname{span}\\{$1\\}"),l=l.replace(Yge,`$1\\\\ -`),l=l.replace(Jge,"$1\\\\"),l=l.replace(Zge,"$1\\$2"),l}function VL(e){const t=e.trim();return!(!Qd(t)||/"[^"\n]{1,80}"\s*:\s*/.test(t)||!(/\\[a-z]+/i.test(t)||/[=+*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/.test(t)||/[_^]/.test(t))&&/\s-\s/.test(t))}function mW(e){const t=[];let n=0;for(;n=n[0]&&t0;){if(e[s]==="\\"&&s+10;){if(e[l]==="\\"&&l+1=0&&e[n]==="\\";)i++,n--;return i%2===1}function bA(e,t){let n=t;for(;n0&&e[i-1]==="$"||i+1=l)break;const u=lb(o,a);if(u){r=Math.max(a+Math.max(1,t.length),u[1]);continue}p2(e,a)||s++,r=a+Math.max(1,t.length)}return s}function Cx(e,t,n){const i=Dv(String(e??""));if(!i.endsWith(t))return-1;const o=i.length-t.length;if(o<=0||!Dv(i.slice(0,o)).trim()||p2(i,o))return-1;const s=mW(i);if(lb(s,o))return-1;const r=KL(i,t,0,o,s);if(t==="$$"){if(r%2===1)return-1}else if(r>KL(i,n,0,o,s))return-1;return o}function Fv(e){return e===" "||e===" "}function Dv(e){let t=e.length;for(;t>0&&Fv(e[t-1]);)t--;return e.slice(0,t)}function ZL(e){let t=0;for(let n=0;n=48&&t<=57}function s0e(e){if(e.length<3)return!1;const t=e[0];if(t!=="-"&&t!=="*"&&t!=="_"&&t!=="=")return!1;let n=0;for(let i=0;i=3}function r0e(e){const t=e.trim();if(!t)return!1;let n=0;t[n]===":"&&n++;let i=0;for(;t[n]==="-";)i++,n++;return i<3?!1:(t[n]===":"&&n++,n===t.length)}function l0e(e){if(!e.includes("|"))return!1;const t=e[0]==="|"?e.slice(1):e;return(t.endsWith("|")?t.slice(0,-1):t).split("|").every(r0e)}function a0e(e){let t=0;if(!GL(e[t]))return!1;for(;GL(e[t]);)t++;return e[t]!=="."&&e[t]!==")"?!1:Fv(e[t+1])}function gW(e){const t=e.trimStart();if(!t||t.startsWith("```")||t.startsWith("~~~")||t.startsWith(":::")||t[0]===">"||t[0]==="<")return!0;if(t[0]==="#"){let n=0;for(;t[n]==="#";)n++;if(n>=1&&n<=6&&Fv(t[n]))return!0}return!!((t[0]==="-"||t[0]==="+"||t[0]==="*")&&Fv(t[1])||a0e(t)||s0e(t)||l0e(t))}function QL(e,t){return e?t?`${e} -${t}`:e:t}function wA(e){const t=String(e??"").trim();return t?Qd(t):!1}function YL(e){let t=0;for(let n=0;nkA){h=!0;break}const g=o[m],y=x1(g,c);if(y!==-1){const k=QL(f,g.slice(0,y));if(!wA(k)){h=!0;break}const v=g.slice(y+c.length),C=v.trim()?`suffix:${YL(v)}`:"nosuffix";return["closed",u,i+l,d,i+m,y,YL(k),C].join(":")}if(gW(g)){h=!0;break}if(f=QL(f,g),f.length>dW){h=!0;break}}if(!h&&wA(f))return["pending",u,i+l,d].join(":")}}return null}function J3(e,t){const n=String(e??"").trim();return!n||!/^\d[\d,.]*\s*[~~-]\s*$/.test(n)?!1:/\d/.test(String(t??""))}function c0e(e){const t=String(e??"").trimStart(),n=t.match(/^\d+(?:,\d{3})*(?:\.\d+)?/);if(!n)return!1;const i=t.slice(n[0].length);return/^\s*(?:[+\-*/^_=<>]|\\[a-z]+)/i.test(i)?!1:i===""||/^[)\s,.!?;:]/.test(i)}function X3(e){const t=String(e??"").trim();return t?/^(?:\.{3,}|…+)$/.test(t):!1}function d0e(e,t){Vge(e);const n=(r,l,a)=>{const u=String(l??"").replace(/^[\t ]+/,"").replace(/[\t ]+$/,"");if(!u)return;const c=r.push("paragraph_open","p",1);c.map=[a,a+1];const d=r.push("inline","",0);d.content=u,d.map=[a,a+1],d.children=[],r.push("paragraph_close","p",-1)},i=(r,l)=>{const a=r,u=!!t?.strictDelimiters,c=!a?.env?.__markstreamFinal,d=(v,C)=>{let w=C;for(;w=3&&(!w||/\s/.test(w))){const M=a.push("text","",0);return M.content=a.src.slice(a.pos,v),a.pos=v,!0}}const f=[["$$","$$"],["$","$"],["\\(","\\)"]],h=String(a.pending??""),m=Math.max(0,a.pos-h.length);let g=m,y=m;const k=m;for(const[v,C]of f){const w=a.src,M=mW(w),L=o0e(w,c);let E=!1;v==="$$"&&g!==k&&(g=k);let S=-1,x=-1,A=0;const T=I=>{if((I==="undefined"||I==null)&&(I=""),I==="\\"){a.pos=a.pos+I.length,g=a.pos;return}if(I==="\\)"||I==="\\("){const R=a.push("text_special","",0);R.content=I==="\\)"?")":"(",R.markup=I,a.pos=a.pos+I.length,g=a.pos;return}if(!I)return;if(v==="$$"&&I.includes("$")){let R=0;for(;R0&&I[F-1]==="$"||F+10){const P=I.slice(0,O),z=a.push("text","",0);z.content=P,a.pos=a.pos+P.length,g=a.pos}const R=I.slice(O).match(/^!\[([^\]]*)\]\(([^)]+)\)/);if(R){const[,P,z]=R,W=z.match(/^(\S+)(?:\s+"([^"]+)")?\s*$/),$=W?W[1]:z,K=W&&W[2]?W[2]:null,ne=a.push("image","img",0);ne.attrs=[["src",$],["alt",P]],K&&ne.attrs.push(["title",K]),ne.content=P,ne.children=[{type:"text",content:P,tag:""}],a.pos=a.pos+R[0].length,g=a.pos;const G=I.slice(O+R[0].length);G&&T(G);return}const F=a.push("text","",0);F.content=I,a.pos=a.pos+I.length,g=a.pos;return}const H=a.push("text","",0);H.content=I,a.pos=a.pos+I.length,g=a.pos};for(;!(g>=w.length);){const I=w.indexOf(v,g);if(I===-1)break;if(p2(w,I)){g=I+Math.max(1,v.length);continue}const O=lb(M,I);if(O){g=O[1];continue}const H=lb(L,I);if(H){g=H[1];continue}if(I===S&&g===x){if(A++,A>2){g=I+Math.max(1,v.length);continue}}else A=0,S=I,x=g;if(v==="("&&I>0){let G=I-1;for(;G>=0&&w[G]===" ";)G--;if(G>=0&&w[G]==="]"){g=I+v.length;continue}}if(v==="$"&&I>0&&w[I-1]==="$"){g=I+1;continue}if(v==="$"&&I=w.length);){const O=bA(w,I);if(O===-1)break;if(O+10&&w[O-1]==="$"){I=O+1;continue}const H=Y3(w,O+1);if(H===-1)break;const R=w.slice(O+1,H),F=R.includes("`"),P=!R||!R.trim(),z=w[H+1],W=J3(R,z),$=X3(R);if(!F&&!P&&!W&&!$){const K=w.slice(g,O);K&&T(K);const ne=a.push("math_inline","math",0);ne.content=Ld(R,t),ne.markup="$",ne.raw=`$${R}$`,ne.loading=!1,g=H+1,I=H+1}else T("$"),I=O+1}I{const c=r,d=!c?.env?.__markstreamFinal,f=t?.strictDelimiters,h=f?[["\\[","\\]"],["$$","$$"]]:[["\\[","\\]"],["[","]"],["$$","$$"]],m=c.bMarks[l]+c.tShift[l];let g=c.src.slice(m,c.eMarks[l]).trim(),y=!1,k="",v="",C=!1,w="",M=!1;for(const[K,ne]of h)if(g.startsWith(K))if(K.includes("[")){const G=K==="\\["?g.slice(K.length):"";if(K==="\\["&&x1(G,ne)===-1&&!/^\s*!\[/.test(G)&&!G.includes("`")&&Qd(G)){y=!0,k=K,v=ne;break}if(t?.strictDelimiters){if(g.replace("\\","")==="["){if(l+1=0?"\\]":v,A=S>=0?S:x1(g,v,E);if(!C&&A>k.length){const K=g.slice(L+k.length,A),ne=c.push("math_block","math",0);ne.content=Ld(K),ne.markup=k==="$$"?"$$":k==="["?"[]":"\\[\\]",ne.map=[l,l+1],ne.raw=`${k}${K}${x}`,ne.block=!0,ne.loading=!1,c.line=l+1;const G=g.slice(A+x.length);return G.trim()&&n(c,G,l),!0}let T=l,I="",O=!1,H="",R=l;const F=C?g:g===k?"":g.slice(k.length),P=!f&&k==="\\["?"]":"",z=x1(F,v);if(z!==-1){const K=z;I=F.slice(0,K),H=F.slice(K+v.length),R=C?l+1:l,O=!0,T=R}else for(F&&!C&&(I=F),T=l+1;T{const c=r,d=c.bMarks[l]+c.tShift[l],f=c.src.slice(d,c.eMarks[l]).trim();return!f.startsWith("$$")&&!f.startsWith("\\[")?!1:o(r,l,a,u)};e.inline.ruler.before("escape","math",i),e.block.ruler.before("lheading","explicit_math_block",s,{alt:["paragraph","reference","blockquote","list"]}),e.block.ruler.before("paragraph","math_block",o,{alt:["paragraph","reference","blockquote","list"]})}function f0e(e){const t=e.renderer.rules.image||function(n,i,o,s,r){const l=n,a=r;return a.renderToken?a.renderToken(l,i,o):""};e.renderer.rules.image=(n,i,o,s,r)=>{const l=n;return l[i].attrSet?.("loading","lazy"),t(l,i,o,s,r)},e.renderer.rules.fence=e.renderer.rules.fence||((n,i)=>{const o=n[i],s=String(o.info??"").trim();return`
        ${e.utils.escapeHtml(String(o.content??""))}
        `})}const h0e=/^\s]/i,p0e=/^<\/a\s*>/i;function m0e(e,t){if(e?.type!=="inline")return!1;const n=e.children;if(!Array.isArray(n)||n.length===0)return t.test(String(e.content??""));let i=0;for(let o=n.length-1;o>=0;o--){const s=n[o];if(s?.type==="link_close"){for(o--;o>=0&&n[o]?.level!==s.level&&n[o]?.type!=="link_open";)o--;continue}if(s?.type==="html_inline"){const r=String(s.content??"");h0e.test(r)&&i>0&&i--,p0e.test(r)&&i++}if(!(i>0)&&s?.type==="text"&&t.test(String(s.content??"")))return!0}return!1}function g0e(e){const t=e.core?.ruler,n=t.getNamedRules?.().find(i=>i.name==="linkify")?.fn;typeof n=="function"&&t.at("linkify",i=>{if(!i.md?.options?.linkify)return;const o=Array.isArray(i.tokens)?i.tokens:[],s=i.md.linkify;if(!s)return;const r=o.filter(l=>m0e(l,s));if(r.length)return n(Object.assign(Object.create(Object.getPrototypeOf(i)),i,{tokens:r}))})}function v0e(e){const t=e.inline.ruler,n=t.getNamedRules?.(),i=n?.find(l=>l.name==="link")?.fn,o=n?.find(l=>l.name==="image")?.fn;if(typeof i!="function"||typeof o!="function")return;const s=e.validateLink,r=e;r.__markstreamOriginalValidateLink=s,t.at("link",(...l)=>{const a=l[0].md,u=a?.validateLink===s?a.options?.validateLink:a?.validateLink;if(!a||typeof u!="function")return i(...l);const c=a.validateLink;a.validateLink=u;try{return i(...l)}finally{a.validateLink=c}}),t.at("image",(...l)=>{const a=l[0].md;if(!a)return o(...l);const u=a.validateLink;a.validateLink=s;try{return o(...l)}finally{a.validateLink=u}})}function y0e(e={}){const t=e.markdownItOptions??{},n=typeof t.experimental=="object"&&t.experimental!==null?t.experimental:{},i=Object.prototype.hasOwnProperty.call(t,"stream")?!!t.stream:!0,o=Object.prototype.hasOwnProperty.call(t,"validateLink"),s=new U1e({html:!0,linkify:!0,typographer:!0,...t,experimental:{stream:i,...n}});if(!o){const r=l=>!ip(l,{tagName:"a",attrName:"href"});dge(r),s.set({validateLink:r})}return v0e(s),g0e(s),(e.enableMath??!0)&&d0e(s,{...e.mathOptions??{}}),(e.enableContainers??!0)&&dme(s),e.enableFixIndentedCodeBlock!==!1&&Dme(s),gge(s),bge(s),yge(s),xge(s),f0e(s),Nme(s,{customHtmlTags:e.customHtmlTags}),s}function op(e){const t=Object.assign(Object.create(Object.getPrototypeOf(e)),e);return Array.isArray(e.attrs)&&(t.attrs=e.attrs.map(n=>[...n])),Array.isArray(e.map)&&(t.map=[...e.map]),Array.isArray(e.children)&&(t.children=e.children.map(n=>op(n))),t}function k0e(e){const t=e.meta??{};return{type:"checkbox",checked:t.checked===!0,raw:t.checked?"[x]":"[ ]"}}function b0e(e){const t=e,n=t.attrGet?t.attrGet("checked"):void 0,i=n===""||n==="true";return{type:"checkbox_input",checked:i,raw:i?"[x]":"[ ]"}}function w0e(e){const t=String(e.content??"");return{type:"emoji",name:t,markup:String(e.markup??""),raw:`:${t}:`}}function Iy(e,t,n){const i=[];let o="",s=t+1;const r=[];for(;sn.startsWith(t)||t.startsWith(n)):!1}function JL(e,t,n,i){n.length>0&&e.push(...n),i.length>0&&t.push(...i),n.length=0,i.length=0}function XL(e,t){return!t&&e.startsWith(" ")&&!e.startsWith(" ")?` ${e}`:e}function S0e(e,t){const n=[],i=[],o=[],s=[],r=e.split(A0e),l=/\r?\n$/.test(e),a=r.some(h=>h.startsWith("diff ")||h.startsWith("--- ")||h.startsWith("+++ ")||h.startsWith("@@ ")),u=h=>{const m=h;if(!kW.some(g=>m.startsWith(g)))if(m.startsWith("-")){const g=m.slice(1);o.push(XL(g,a))}else if(m.startsWith("+")){const g=m.slice(1);s.push(XL(g,a))}else{JL(n,i,o,s);const g=a&&m.startsWith(" ")?m.slice(1):m;n.push(g),i.push(g)}},c=l?Math.max(0,r.length-1):r.length;for(let h=0;h0||s.length>0)&&JL(n,i,o,s);const d=n.join(` -`),f=i.join(` -`);return{original:t&&l&&d?`${d} -`:d,updated:t&&l&&f?`${f} -`:f}}function Ax(e){const t=Array.isArray(e.map)&&e.map.length===2,n=e.meta??{},i=typeof n.closed=="boolean"?n.closed:void 0,o=i===!0||i!==!1&&t,s=String(e.info??""),r=s.startsWith("diff"),l=r?(()=>{const u=s,c=u.indexOf(" ");return c===-1?"":String(u.slice(c+1)??"")})():s;let a=String(e.content??"");if(!o&&e.markup){const u=e.markup[0],c=e.markup.length,d=C0e(u,c);d.test(a)&&(a=a.replace(d,""))}if(r){const{original:u,updated:c}=S0e(a,o===!0);return{type:"code_block",language:l,code:String(c??""),raw:String(a??""),diff:r,loading:i===!0?!1:i===!1?!0:!t,originalCode:u,updatedCode:c}}return{type:"code_block",language:l,code:String(a??""),raw:String(a??""),diff:r,loading:i===!0?!1:i===!1?!0:!t}}function _0e(e){const t=e.meta??{};return{type:"footnote_reference",id:String(t.label??""),raw:`[^${String(t.label??"")}]`}}function I0e(){return{type:"hardbreak",raw:`\\ -`}}function M0e(e,t,n){const i=[];let o="",s=t+1;const r=[];for(;s\s*$/.test(t)||Sf.has(e)}function T0e(e){if(!e||e.length===0)return eN();const t=t8.get(e);if(t)return t;const n=e.map(Va).filter(Boolean);if(!n.length){const o=eN();return t8.set(e,o),o}const i={customTagSet:new Set(n),allowedTagSet:W4({customHtmlTags:e})};return t8.set(e,i),i}function AW(e){const t=e,n=t.raw??t.content??t.markup??"";return String(n??"")}function E0e(e){const t=e.meta,n=t?.markstreamCustomHtmlRaw,i=t?.markstreamCustomHtmlInner;return typeof n=="string"&&typeof i=="string"?{raw:n,inner:i}:null}function ab(e,t){const n=t.toLowerCase();for(let i=e.length-1;i>=0;i--){const[o,s]=e[i];if(String(o).toLowerCase()===n)return s}}function L0e(e,t,n){const i=e.slice();return ab(i,"href")||i.push(["href",t]),n!=null&&!ab(i,"title")&&i.push(["title",n]),i}function CA(e){return e.map(AW).join("")}function R9(e){const t=[],n=i=>{const o=String(i??"");if(!o)return;const s=t[t.length-1];if(s?.type==="text"){s.content=`${s.content}${o}`,s.raw=`${s.raw}${o}`;return}t.push({type:"text",content:o,raw:o})};for(const i of e)if(i){if(i.type==="reference"||i.type==="footnote_reference"){n(String(i.raw??""));continue}if("children"in i&&Array.isArray(i.children)){t.push({...i,children:R9(i.children)});continue}t.push(i)}return t}function N0e(e,t,n){let i=0;for(let o=t;o`;g.toLowerCase().includes(M.toLowerCase())||(g+=M),k=!0,y=!0}const v=[],C=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;let w;for(;(w=C.exec(l))!==null;){const M=w[1],L=w[2]||w[3]||w[4]||"";v.push([M,L])}if(u?.has(a)){const M=E0e(e);return[{type:a,tag:a,attrs:v,content:M?M.inner:h.innerTokens.length?CA(h.innerTokens):"",children:h.innerTokens.length?i(h.innerTokens,o,s,r):[],raw:M?.raw??g,loading:e.loading||y,autoClosed:k},h.nextIndex]}return[{type:"html_inline",tag:a,attrs:v,content:g,children:m,raw:g,loading:y,autoClosed:k},h.nextIndex]}function xW(e){if(e.type==="math_inline"){if(e.raw)return String(e.raw);const t=e.markup==="$$"?"$$":"$";return`${t}${String(e.content??"")}${t}`}return Array.isArray(e.children)&&e.children.length>0?e.children.map(t=>xW(t)).join(""):String(e.content??"")}function D0e(e){return!e||!Array.isArray(e.children)||e.children.length===0?"":e.children.map(t=>xW(t)).join("")}function tN(e,t=!1){let n=e.attrs??[],i=null;if((!n||n.length===0)&&Array.isArray(e.children))for(const d of e.children){const f=d.attrs;if(Array.isArray(f)&&f.length>0){n=f,i=d;break}}const o=String(n.find(d=>d[0]==="src")?.[1]??""),s=n.find(d=>d[0]==="alt")?.[1],r=D0e(i??e);let l="";r?l=r:s!=null&&String(s).length>0?l=String(s):i?.content!=null&&String(i.content).length>0?l=String(i.content):Array.isArray(i?.children)&&i.children[0]?.content?l=String(i.children[0].content):Array.isArray(e.children)&&e.children[0]?.content?l=String(e.children[0].content):e.content!=null&&String(e.content).length>0&&(l=String(e.content));const a=n.find(d=>d[0]==="title")?.[1]??null,u=a===null?null:String(a),c=String(e.content??"");return{type:"image",src:o,alt:l,title:u,raw:c,loading:t}}function R0e(e){const t=String(e.content??"");return{type:"inline_code",code:t,raw:t}}function O0e(e,t,n){const i=[];let o="",s=t+1;const r=[];for(;s=0;i--){const[o,s]=e[i];if(String(o).toLowerCase()===n)return s}}function B0e(e,t,n){const i=e.slice();return ub(i,"href")||i.push(["href",t]),n!=null&&!ub(i,"title")&&i.push(["title",n]),i}function My(e,t,n){const i=e[t],o=P0e(i.attrs),s=String(ub(o,"href")??""),r=ub(o,"title"),l=r==null?null:String(r),a=B0e(o,s,l);let u=t+1;const c=[];let d=!0;for(;uy.type==="strong_open")){const y=String(h.content??""),k=String(h.raw??y),v=op(h);v.content=y.slice(0,-2),v.raw=k.replace(/\*\*$/,""),f=c.slice(),f[f.length-1]=v}const m=bo(f,void 0,void 0,n),g=m.map(y=>{const k=y;return"content"in y?String(k.content??""):String(k.raw??"")}).join("");return{node:{type:"link",href:s,title:l,text:g,children:m,raw:`[${g}](${s}${l?` "${l}"`:""})`,loading:d,attrs:a},nextIndex:u0?i:[{type:"text",content:a,raw:a}],raw:`~${a}~`},nextIndex:s0?i:[{type:"text",content:o||String(e[t].content??""),raw:o||String(e[t].content??"")}],raw:`^${o||String(e[t].content??"")}^`},nextIndex:s?@[\\\]^_`{|}~]/,Y0e=/\p{P}/u,J0e=/^[\x22\x27《「『【〔〖〘〚〈([{“‘﹁﹃﹙﹛﹝]$/u,X0e=/^[\x22\x27》」』】〕〗〙〛〉)]}”’﹂﹄﹚﹜﹞]$/u,eve=/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,tve=/:\/\//,AA=1,SW=2,nve=4,ive=8,_W=16,Bd=32,O9=64,r0=128,IW=256,ove=512,l0=1024,sve=1982;function Ty(e){let t=0;for(let n=0;n=t){n++,i++;continue}n++,i++;continue}if(o==="*"&&n>=t)return n;n++}return-1}function _f(e){return!!e&&G0e.test(e)}function If(e){return!!e&&(Q0e.test(e)||Y0e.test(e))}function TW(e,t){return!!e&&!!t&&/^\p{Script=Han}$/u.test(t)&&J0e.test(e)}function EW(e,t){return!!e&&!!t&&/^[\p{L}\p{N}]$/u.test(t)&&X0e.test(e)}function lve(e,t){const n=t>0?e[t-1]:void 0,i=e[t+1];return!i||_f(i)?!1:!(If(i)&&!TW(i,n)&&n&&!_f(n)&&!If(n))}function ave(e,t){const n=t>0?e[t-1]:void 0,i=e[t+1];return!n||_f(n)?!1:!(If(n)&&!EW(n,i)&&i&&!_f(i)&&!If(i))}function uve(e,t,n=0){let i=n,o=!1;for(;i0?e[t-1]:void 0,i=e[t+2];return!i||_f(i)?!1:!(If(i)&&!TW(i,n)&&n&&!_f(n)&&!If(n))}function dve(e,t){const n=t>0?e[t-1]:void 0,i=e[t+2];return!n||_f(n)?!1:!(If(n)&&!EW(n,i)&&i&&!_f(i)&&!If(i))}function fve(e,t=0){let n=t,i=!1;for(;n=0&&e[s]==="\\";s--)o++;return o%2===1}const gve=/[\p{L}\p{N}]/u,vve=/^[\p{L}\p{N}]+$/u;function xA(e){return e?gve.test(e):!1}function LW(e){return e?vve.test(e):!1}function B0(e,t){let n=t;for(;n0?e[t-1]:void 0,o=n=2&&i.intraword&&t.push({start:n,end:o}),n=o}for(let n=0;n=3)return i;n=i+o.len}return-1}function wve(e){return e?eve.test(e)||tve.test(e):!1}function Cve(e,t){if(!e||!t)return null;const n=e.match(/\[([^\]\n]+)\]\(([^)]*)$/);return n&&n[2]===t?n[1]:null}function bo(e,t,n,i){if(!e||e.length===0)return[];const o=i?.__linkifyDemotionContext,s=h2(t),r={filename:o?.filename||s.filename,explicitFilename:o?.explicitFilename||s.explicitFilename,marketTicker:o?.marketTicker||s.marketTicker};(r.filename||r.explicitFilename||r.marketTicker)&&(i={...i,__linkifyDemotionContext:r});const l=i,a=[];let u=null,c=0;const d=i?.requireClosingStrong,f=e;function h(){return e===f&&(e=e.slice()),e}function m(){u=null}function g(Y,J){const U=e.length===1?t:String(J.content??""),Q=[],ue=yve(Y);if(ue!==-1){M(Y.slice(0,ue),Y.slice(0,ue));const pe=Y.slice(ue);return pe&&(T({type:"text",content:pe,raw:pe}),c--),c++,!0}if(U0e.test(Y)){const pe=Y.indexOf("~~");pe!==-1&&Q.push({type:"strikethrough",index:pe})}if(V0e.test(Y)){const pe=Y.indexOf("**");pe!==-1&&Q.push({type:"strong",index:pe})}if(/[^*]*\*[^*]+/.test(Y)){const pe=U?MW(U,0):Y.indexOf("*");if(U&&pe===-1)return!1;pe!==-1&&Q.push({type:"emphasis",index:pe})}Q.sort((pe,ee)=>pe.index!==ee.index?pe.index-ee.index:pe.type===ee.type?0:pe.type==="strong"?-1:ee.type==="strong"?1:0);const me=Q[0];if(!me)return!1;if(me.type==="strikethrough"){const pe=me.index,ee=pe>-1?Y.slice(0,pe):"";if(ee&&M(ee,ee),pe===-1)return c++,!0;const re=Y.indexOf("~~",pe+2),ge=re===-1?Y.slice(pe+2):Y.slice(pe+2,re),ae=re===-1?"":Y.slice(re+2),{node:Ce}=iN([{type:"s_open",tag:"s",content:"",markup:"~~",info:"",meta:null},{type:"text",tag:"",content:ge,markup:"",info:"",meta:null},{type:"s_close",tag:"s",content:"",markup:"~~",info:"",meta:null}],0,i);return m(),w(Ce),ae&&(T({type:"text",content:ae,raw:ae}),c--),c++,!0}if(me.type==="strong"){const pe=me.index,ee=pe>-1?Y.slice(0,pe):"";if(ee&&M(ee,ee),pe===-1)return c++,!0;if(t&&pe===0){let ce=!1,Te=0;for(;Te=2)return M(Y,Y),c++,!0}}if(t&&(Y.match(/\*/g)||[]).length>rve(t))return M(Y.slice(ee.length),Y.slice(ee.length)),c++,!0;const re=B0(Y,pe);if(re.len>=3){const ce=bve(Y,pe+re.len);if(ce!==-1){const Te=Y.slice(pe+re.len,ce);if(kve(Te)){const{node:ke}=Rg([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:Te,markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,i);m(),w(ke);const Ae=Y.slice(ce+3);return Ae&&(T({type:"text",content:Ae,raw:Ae}),c--),c++,!0}}}if(!cve(Y,pe)){const ce=Y.slice(pe,pe+re.len);M(ce,ce);const Te=Y.slice(pe+re.len);return Te&&(T({type:"text",content:Te,raw:Te}),c--),c++,!0}const ge=fve(Y,pe+2);let ae="",Ce="";if(ge.index!==-1){ae=Y.slice(pe+2,ge.index),Ce=Y.slice(ge.index+2);const ce=ge.index,Te=B0(Y,ce);if(re.intraword&&Te.intraword&&!LW(ae)||!ae&&re.len>=4&&re.intraword)return M(Y.slice(ee.length),Y.slice(ee.length)),c++,!0}else{if(d||ge.sawInvalidClose||re.intraword)return M(Y.slice(ee.length),Y.slice(ee.length)),c++,!0;ae=Y.slice(pe+2),Ce=""}if(!ae&&/^\*+$/.test(Ce))return M(Y,Y),c++,!0;const{node:ve}=Rg([{type:"strong_open",tag:"strong",content:"",markup:"**",info:"",meta:null},{type:"text",tag:"",content:ae,markup:"",info:"",meta:null},{type:"strong_close",tag:"strong",content:"",markup:"**",info:"",meta:null}],0,t,i);return m(),w(ve),Ce&&(T({type:"text",content:Ce,raw:Ce}),c--),c++,!0}if(me.type==="emphasis"){let pe=me.index;pe===-1&&(pe=0);const ee=Y.slice(0,pe);if(ee&&M(ee,ee),!lve(Y,pe)){M(Y[pe],Y[pe]);const ce=Y.slice(pe+1);return ce&&(T({type:"text",content:ce,raw:ce}),c--),c++,!0}const re=B0(Y,pe),ge=uve(U,Y,pe+1),ae=ge.index,Ce=e[c+1];if(i?.final&&Ce?.type==="em_open"&&ae!==-1&&Y.slice(pe+1,ae).trim()!==Y.slice(pe+1,ae)||ae===-1&&(ge.sawInvalidClose||i?.final||re.intraword||!xA(Y[pe+1])))return M(Y.slice(pe),Y.slice(pe)),c++,!0;const{node:ve}=Iy([{type:"em_open",tag:"em",content:"",markup:"*",info:"",meta:null},{type:"text",tag:"",content:ae>-1?Y.slice(pe+1,ae):Y.slice(pe+1),markup:"",info:"",meta:null},{type:"em_close",tag:"em",content:"",markup:"*",info:"",meta:null}],0,i);if(m(),w(ve),ae!==-1&&ae{for(let ve=0;ve=0&&Ce[Te]==="\\";Te--)ce++;if(ce%2===0)return ve}return-1})(Y);if(Q===-1)return!1;let ue=1;for(let Ce=Q+1;Ceme?.type==="math_inline")||!K0e.test(Y))return null;const U=J.parseInline(Y,{__markstreamFinal:!!i?.final});if(!Array.isArray(U)||U.length===0)return null;const Q=(U.find(me=>me?.type==="inline")?.children??[]).filter(me=>!(me?.type==="text"&&String(me.content??"")===""));if(!Q.length||!Q.some(me=>me?.type!=="text")||Q.length===1&&Q[0]?.type==="text"&&String(Q[0].content??"")===Y)return null;const ue=bo(Q,Y,n,i);return ue.length?ue:null}function v(Y){m(),a.push(Y)}function C(Y){m();const J=op(Y);a.push(J)}function w(Y){v(Y)}function M(Y,J){u?(u.content+=Y,u.raw+=J??Y):(u={type:"text",content:String(Y??""),raw:String(J??Y??"")},a.push(u))}function L(Y,J){if(!Y)return;const U=bo([{...J,type:"text",content:Y,raw:Y}],Y,n,i);if(U.length===1&&U[0]?.type==="text"){const Q=U[0];M(String(Q.content??""),String(Q.raw??Q.content??""));return}for(const Q of U)w(Q)}function E(Y,J){return String(Y.markup??"").startsWith(J)}function S(Y){if(!u||Y.loading!==!0||Y.markup!=="\\(\\)")return;const J=e[c-1];!J||J.type!=="text"||!E(J,"\\(")||u.content.endsWith("(")&&(u.content=u.content.slice(0,-1),u.raw.endsWith("(")&&(u.raw=u.raw.slice(0,-1)),!u.content&&a[a.length-1]===u&&(a.pop(),u=null))}function x(Y){return Y.endsWith("](")?e[c+1]?.type==="link_open"&&e[c+1]?.markup==="linkify"&&e[c+2]?.type==="text"&&e[c+3]?.type==="link_close"&&e[c+4]?.type==="text"&&String(e[c+4]?.content??"").startsWith(")"):!1}function A(Y,J,U=Ty(Y)){let Q=Y;const ue=String(J.content??"");return(U&AA)!==0&&Q.endsWith("\\")&&!E(J,"\\\\")&&!ue.endsWith("\\\\")&&(Q=Q.slice(0,-1)),(U&l0)!==0&&Q.endsWith("(")&&!E(J,"\\(")&&!ue.endsWith("\\(")&&(Q=Q.slice(0,-1)),(U&SW)!==0&&/\*+$/.test(Q)&&!E(J,"\\*")&&!ue.endsWith("\\*")&&(Q=Q.replace(/\*+$/,"")),Q}for(;c=0;ce--){const Te=a[ce];if(Te.type!=="text")break;re=ce,ge=String(Te.content??"")+ge}rere==="href")?.[1],ee=String(pe??"");if(t&&ee){const re=t.indexOf("](");if(re!==-1){const ge=t.indexOf(")",re+2);ge===-1?U.loading=!0:U.loading&&t.slice(re+2,ge).includes(ee)&&(U.loading=!1)}}/^file:\/\/\/[a-z]:\//i.test(U.href)&&$(U,J-1)||P(U)||v(U)}function R(Y){if(Y.markup!=="linkify")return!1;const{node:J,nextIndex:U}=My(e,c,i);return W(J,U)?(c=U,!0):!1}function F(Y){m(),w($0e(Y)),c++}function P(Y){if(Y.type!=="link")return!1;const J=a[a.length-1];if(!J||J.type!=="text")return!1;const U=String(J.content??"").match(/^([^[]*)\[([^\]\n]+)\]\($/);if(!U)return!1;const Q=Y,ue=String(Q.href??""),me=String(Q.text??""),pe=String(U[2]??""),ee=ue.replace(/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,"");if(!ue||!(me===ue||me===ee||wve(me)))return!1;const re=String(U[1]??"");return re?(J.content=re,J.raw=re):a.pop(),v({...Y,text:pe,children:[{type:"text",content:pe,raw:pe}],raw:`[${pe}](${ue}${Q.title?` "${Q.title}"`:""})`}),!0}function z(Y){if(Y.type!=="link")return!1;const J=Y,U=String(J.href??"");return U?W({href:U,title:J.title==null||J.title===""?null:String(J.title),loading:!!J.loading},c+1):!1}function W(Y,J){const U=a[a.length-1];if(U?.type!=="image"||U.src||!U.loading||!String(U.raw??"").endsWith("]("))return!1;const Q=e[J],ue=String(Q?.content??"");if(Q?.type!=="text"||!ue.startsWith(")"))return!1;a.pop(),u=null;const me=String(U.alt??"");v({type:"image",src:Y.href,alt:me,title:Y.title,raw:`![${me}](${Y.href}${Y.title?` "${Y.title}"`:""})`,loading:!!Y.loading});const pe=ue.slice(1),ee=op(Q);return ee.content=pe,ee.raw=pe,h()[J]=ee,!0}function $(Y,J=c-1){if(Y.type!=="link")return!1;const U=a[a.length-1],Q=e[J];if(!U||U.type!=="text"||Q?.type!=="text")return!1;const ue=String(U.content??""),me=String(Q.content??"");if(!ue.endsWith("!")||!me.endsWith("!")||E(Q,"\\!"))return!1;const pe=ue.slice(0,-1);pe?(U.content=pe,U.raw=pe,u=U):(a.pop(),u=null);const ee=Y,re=String(ee.text??ee.children?.map(Ce=>String(Ce?.content??Ce?.raw??"")).join("")??""),ge=String(ee.href??""),ae=ee.title==null||ee.title===""?null:String(ee.title);return v({type:"image",src:ge,alt:re,title:ae,raw:`![${re}](${ge}${ae?` "${ae}"`:""})`,loading:!!ee.loading}),!0}function K(Y,J="",U=null){const Q=String(Y.alt??Y.raw??"");return{type:"link",href:J,title:U,text:Q,children:[Y],raw:`[${Q}](${J}${U?` "${U}"`:""})`,loading:!0}}function ne(Y){const J=Y.startsWith("![")?Y:`![${Y}`,U=J.slice(2),Q=U.indexOf("](");return{type:"image",src:"",alt:Q===-1?U.replace(/\]$/,""):U.slice(0,Q),title:null,raw:J,loading:!0}}function G(Y){const J=Y.indexOf("[![");if(J===-1||typeof t=="string"&&e.length===1&&mve(t,J,"["))return!1;const U=Y.slice(0,J);return U&&M(U,U),v(K(ne(Y.slice(J+1)))),c++,!0}function te(Y){if(i?.final)return!1;const J=e[c-1];if(J?.type!=="text"||!String(J.content??"").endsWith("[")||E(J,"\\["))return!1;const U=a[a.length-1];if(U?.type==="text"&&U.content.endsWith("[")){const Q=U.content.slice(0,-1);Q?(U.content=Q,U.raw=Q,u=U):(a.pop(),u=null)}return v(K(tN(Y))),c++,!0}function le(Y){if(Y.type!=="link")return!1;const J=Y,U=String(J.raw??""),Q=String(J.text??"");if(!U.startsWith("[![")&&!Q.startsWith("!["))return!1;const ue=J.title==null||J.title===""?null:String(J.title);return v(K({type:"image",src:String(J.href??""),alt:Q.replace(/^!\[/,"").replace(/\]$/,""),title:ue,raw:U.startsWith("[![")?U.slice(1):U,loading:!0})),!0}function ie(Y){if(!Y.startsWith("]("))return!1;const J=e[c-2];if(J?.type==="text"&&String(J.content??"").endsWith("[")&&E(J,"\\["))return!1;const U=a[a.length-1];if(U?.type!=="image"&&U?.type!=="link")return!1;const Q=U,ue=U?.type==="link"&&Array.isArray(Q.children)&&Q.children.length===1&&Q.children[0]?.type==="image"?a.pop():null,me=ue?ue.children[0]:a.pop();if(!me||me.type!=="image")return!1;const pe=e[c+1];let ee=String(ue?.href??""),re=ue?.title==null?null:String(ue.title),ge=!0;if(pe?.type==="link_open"){const{node:Ce,nextIndex:ve}=My(e,c+1,i);ee=Ce.href,re=Ce.title,ge=!0,c=ve}else{if(ee=Y.slice(2),ee.includes('"')){const Ce=ee.split('"');ee=String(Ce[0]??"").trim(),re=Ce[1]==null?null:String(Ce[1]).trim()}c++}const ae=K(me,ee,re);return ae.loading=ge,v(ae),!0}function _e(){const Y=e[c-3];return e[c-2]?.type==="image"&&e[c-1]?.type==="text"&&String(e[c-1].content??"")==="]("&&Y?.type==="text"&&String(Y.content??"").endsWith("[")&&E(Y,"\\[")}function Z(Y,J){const U=Y.indexOf("[");if(U===-1)return!1;let Q=Y.slice(0,U);const ue=Y.indexOf("](",U);if(ue!==-1){const me=e[c+2];let pe=Y.slice(U+1,ue);if(pe.includes("[")){const ce=pe.indexOf("[");Q+=Y.slice(0,U+ce+1);const Te=U+ce+1;pe=Y.slice(Te+1,ue)}const ee=e[c+1];if(Y.endsWith("](")&&ee?.type==="link_open"&&me){const ce=e[c+4];let Te=4,ke=!0;if(ce?.type==="text"){const Ne=String(ce.content??"");if(Ne.startsWith(")")){ke=!1;const Ze=Ne.slice(1);if(Ze){const rt=op(ce);rt.content=Ze,rt.raw=Ze,h()[c+4]=rt}else Te++}else Ne==="."&&Te++}L(Q,J);const Ae=String(me.content??"");return i?.validateLink&&!i.validateLink(Ae)?M(pe,pe):v({type:"link",href:Ae,title:null,text:pe,children:[{type:"text",content:pe,raw:pe}],loading:ke}),c+=Te,!0}const re=Y.indexOf(")",ue),ge=re!==-1?Y.slice(ue+2,re):"",ae=re===-1;let Ce=Q.match(/\*+$/);if(Ce&&(Q=Q.replace(/\*+$/,"")),L(Q,J),Ce||(Ce=pe.match(/^\*+/)),!d&&Ce){const ce=Ce[0].length;pe=pe.replace(/^\*+/,"").replace(/\*+$/,"");const Te=[];if(ce===1?Te.push({type:"em_open",tag:"em",nesting:1}):ce===2?Te.push({type:"strong_open",tag:"strong",nesting:1}):ce===3&&(Te.push({type:"strong_open",tag:"strong",nesting:1}),Te.push({type:"em_open",tag:"em",nesting:1})),Te.push({type:"link",href:ge,title:null,text:pe,children:[{type:"text",content:pe,raw:pe}],loading:ae}),ce===1){Te.push({type:"em_close",tag:"em",nesting:-1});const{node:ke}=Iy(Te,0,i);w(ke)}else if(ce===2){Te.push({type:"strong_close",tag:"strong",nesting:-1});const{node:ke}=Rg(Te,0,void 0,i);w(ke)}else if(ce===3){Te.push({type:"em_close",tag:"em",nesting:-1}),Te.push({type:"strong_close",tag:"strong",nesting:-1});const{node:ke}=Rg(Te,0,void 0,i);w(ke)}else{const{node:ke}=Iy(Te,0,i);w(ke)}}else i?.validateLink&&!i.validateLink(ge)?M(pe,pe):v({type:"link",href:ge,title:null,text:pe,children:[{type:"text",content:pe,raw:pe}],loading:ae});const ve=re!==-1?Y.slice(re+1):"";return ve&&(T({type:"text",content:ve,raw:ve}),c--),c++,!0}return!1}function se(Y){const J=Y.indexOf("![");if(J===-1)return!1;const U=Y.slice(0,J);return U&&!u?u={type:"text",content:U,raw:U}:U&&u&&(u.content+=U),u&&(a.push(u),u=null),v(ne(Y.slice(J))),c++,!0}function he(Y){if(!(Y?.startsWith("[")&&n?.type==="list_item_open"))return!1;const J=Y.slice(1).match(/[^\s\]]/);if(J===null)return c++,!0;if(J&&/x/i.test(J[0])){const U=J[0]==="x"||J[0]==="X";return v({type:"checkbox_input",checked:U,raw:U?"[x]":"[ ]"}),c++,!0}return!1}return a}function Sx(e,t,n){const i=n?.__sourceLineMapper;if(!i)return{startLine:e,endLine:t};const o=i(e),s=t>e?i(t-1).endLine:i(t).startLine;return{startLine:o.startLine,endLine:Math.max(o.startLine,s)}}function oN(e,t){const n=Math.max(0,Math.min(e.length,Math.trunc(t)));let i=0;for(let o=0;oi&&e[o-1]!==` -`&&r++,{startLine:s,endLine:r}}function Rv(e,t,n,i){const o=Ave(e,t,n);return Sx(o.startLine,o.endLine,i)}function xve(e,t){const n=e?.map;if(!Array.isArray(n)||n.length<2)return null;const i=Number(n[0]),o=Number(n[1]);return!Number.isFinite(i)||!Number.isFinite(o)?null:Sx(i,o,t)}function bi(e,t,n){if(!n?.includeSourceMap)return e;const i=xve(t,n);if(!i)return e;if(e.sourceMap=i,e.type==="code_block"){const o=e;o.startLine=i.startLine,o.endLine=i.endLine}return e}function Sve(e,t,n,i){if(!i?.includeSourceMap)return e;const o=t?.map;if(!Array.isArray(o)||o.length<2)return e;const s=Number(o[0]),r=Number(o[1]),l=Number(n);return!Number.isFinite(s)||!Number.isFinite(r)||!Number.isFinite(l)||(e.sourceMap=Sx(s,Math.max(r,l),i)),e}function _ve(e){const t=String(e.content??""),n=t.replace(/[ \t\r\n]+$/g,"");if(n===t)return;e.content=n;const i=e.children;if(!(!Array.isArray(i)||i.length===0))for(;i.length;){const o=i[i.length-1];if(!o){i.pop();continue}if(o.type==="softbreak"||o.type==="hardbreak"){i.pop();continue}if(o.type==="text"){const s=String(o.content??""),r=s.replace(/[ \t\r\n]+$/g,"");if(r===s)break;if(r){o.content=r;break}i.pop();continue}break}}function Ive(e){const t=String(e.content??""),n=t.match(/\r?\n\s*\d+[.)]?\s*$/);if(!n||typeof n.index!="number")return;e.content=t.slice(0,n.index);const i=e.children;if(!(!Array.isArray(i)||i.length===0))for(;i.length;){const o=i[i.length-1];if(!o){i.pop();continue}if(o.type==="softbreak"||o.type==="hardbreak"){i.pop();continue}if(o.type==="text"){const s=String(o.content??"");if(/^[ \t\r\n\d.)]*$/.test(s)){i.pop();continue}const r=s.replace(/[ \t\r\n\d.)]+$/g,"");r!==s&&(r?o.content=r:i.pop())}break}}function Mve(e){const t=String(e.content??"");return/[ \t\r\n]+$/.test(t)||/\r?\n\s*\d+[.)]?\s*$/.test(t)}function Gm(e,t,n){const i=e[t],o=[],s=qf(n,!0);let r=t+1;for(;rd.raw).join("")};n?.includeSourceMap&&bi(c,e[r],n),o.push(c),r=u+1}else r+=1;const l={type:"list",ordered:i.type==="ordered_list_open",start:(()=>{if(i.attrs&&i.attrs.length){const a=i.attrs.find(u=>u[0]==="start");if(a){const u=Number(a[1]);return Number.isFinite(u)&&u!==0?u:1}}})(),items:o,raw:o.map(a=>a.raw).join(` -`)};return n?.includeSourceMap&&bi(l,i,n),[l,r+1]}function Tve(e,t,n,i){const o=String(n[1]??"note"),s=String(n[2]??o.charAt(0).toUpperCase()+o.slice(1)),r=[],l=qf(i,!0);let a=t+1;for(;au.raw).join(` -`)} -:::`},a+1]}const Eve=new Set(["warning","info","note","tip","danger","caution"]);function Lve(e){let t=0;for(;t=0;g--){const y=f[g];if(y.type==="text"&&/:+/.test(y.content)){h=g;break}}const m={type:"paragraph",children:bo((h!==-1?f.slice(0,h):f)||[],void 0,void 0,a.options()),raw:String(d.content??"").replace(/\n:+$/,"").replace(/\n\s*:::\s*$/,"")};n?.includeSourceMap&&bi(m,e[u],n),l.push(m),a.remember(m.raw)}u+=3}else if(e[u].type==="bullet_list_open"||e[u].type==="ordered_list_open"){const[d,f]=Gm(e,u,a.options());n?.includeSourceMap&&bi(d,e[u],n),l.push(d),a.remember(d.raw),u=f}else if(e[u].type==="blockquote_open"){const[d,f]=Qm(e,u,a.options());n?.includeSourceMap&&bi(d,e[u],n),l.push(d),a.remember(d.raw),u=f}else{const d=z4(e,u,a.options());d?(l.push(d[0]),a.remember(d[0].raw),u=d[1]):u++}return[{type:"admonition",kind:o,title:s,children:l,raw:`:::${o} ${s} -${l.map(d=>d.raw).join(` -`)} -:::`},u+1]}const Fve=/^::: ?(warning|info|note|tip|danger|caution|error) ?(.*)$/;function Dve(e,t,n){const i=e[t];if(i.type!=="container_open")return null;const o=Fve.exec(String(i.info??""));return o?Tve(e,t,o,n):null}const _x={parseContainer:(e,t,n)=>Nve(e,t,n),matchAdmonition:Dve};function Qm(e,t,n){const i=[],o=qf(n,!0);let s=t+1;for(;sl.raw).join(` -`)};return n?.includeSourceMap&&bi(r,e[t],n),[r,s+1]}function Rve(e){if(e.info?.startsWith("diff"))return Ax(e);const t=String(e.content??""),n=t.match(/ type="application\/vnd\.ant\.([^"]+)"/);let i=t;n?.[1]&&(i=t.replace(/]*>/g,"").replace(/<\/antArtifact>/g,""));const o=Array.isArray(e.map)&&e.map.length===2;return{type:"code_block",language:n?n[1]:String(e.info??""),code:i,raw:i,loading:!o}}function Ove(e,t,n){const i=[];let o=t+1,s=[],r=[];const l=qf(n,!0);for(;ou.raw).join("")),o+=3}else if(e[o].type==="dd_open"){let a=o+1;for(r=[];a0&&(i.push({type:"definition_item",term:s,definition:r,raw:`${s.map(u=>u.raw).join("")}: ${r.map(u=>u.raw).join(` -`)}`}),s=[]),o=a+1}else o++;return[{type:"definition_list",items:i,raw:i.map(a=>a.raw).join(` -`)},o+1]}function Pve(e,t,n){const i=e[t].meta??{},o=String(i?.label??"0"),s=[],r=qf(n,!0);let l=t+1;for(;la.raw).join(` -`)}`},l+1]}function Bve(e,t,n){const i=e[t],o=i.attrs,s=Array.isArray(o)&&o.length?Object.fromEntries(o.filter(c=>Array.isArray(c)&&c.length>=1&&c[0]).map(([c,d])=>[String(c),d==null||d===""?!0:String(d)])):void 0,r=String(i.tag?.substring(1)??"1"),l=Number.parseInt(r,10),a=e[t+1],u=String(a.content??"");return{type:"heading",level:l,text:u,...s?{attrs:s}:{},children:bo(a.children||[],u,void 0,n),raw:u}}function $ve(e,t,n){const i=t.toLowerCase(),o=new RegExp(String.raw`^<\s*${i}(?=\s|>|/)`,"i"),s=new RegExp(String.raw`^<\s*\/\s*${i}(?=\s|>)`,"i");let r=0,l=Math.max(0,n);for(;l$/.test(d)||r++,l=a+c+1;continue}l=a+1}return-1}function NW(e){const t=String(e.content??"");if(/^\s*");else if(a)a=!y.includes(">");else if(u)u=!y.includes("?>");else if(y.startsWith("");else if(y.startsWith("");else if(y.startsWith("");else{const k=o(y);if(k)if(k.closing){for(let v=r.length-1;v>=0;v--)if(r[v]===k.tag){r.length=v;break}}else k.selfClosing||s(k.after,k.tag)||r.push(k.tag)}}if(d===-1||d>=t)break;c=d+1}return l||a||u||r.length>0}function x2e(e,t,n){if(!n?.length)return!1;const i=new Set(Np(n));if(!i.size)return!1;const o=c=>{const d=c.charCodeAt(0);return d>=65&&d<=90||d>=97&&d<=122||d>=48&&d<=57||c==="_"||c==="-"||c===":"},s=c=>c===" "||c===" ",r=c=>{if(c[0]!=="<")return null;let d=1;for(;d"&&g!=="/")return null;const y=c.indexOf(">",d);if(y===-1)return null;let k=y-1;for(;k>=0&&s(c[k]);)k--;return{closing:f,tag:m,selfClosing:!f&&c[k]==="/",after:c.slice(y+1)}},l=(c,d)=>{const f=c.toLowerCase();let h=0;for(;h")return!0}}return!1},a=[];let u=0;for(;u=t?t:c,f=e.slice(u,d),h=f.endsWith("\r")?f.slice(0,-1):f,m=Ym(h);if(m){const g=r(h.slice(m.index));if(g)if(g.closing){for(let y=a.length-1;y>=0;y--)if(a[y]===g.tag){a.length=y;break}}else g.selfClosing||l(g.after,g.tag)||a.push(g.tag)}if(c===-1||c>=t)break;u=c+1}return a.length>0}function S2e(e,t){const n=t2e.exec(e);if(!n)return null;const i=n[1]??"",o=n.index+i.length,s=e.indexOf(` -`,o),r=e.slice(o,s===-1?e.length:s);return!Ym(r.endsWith("\r")?r.slice(0,-1):r)||HW(e,o)||A2e(e,o)||x2e(e,o,t)?null:`${e.slice(0,n.index)}${i}`}function Fx(e,t,n){let i=t;for(;ii&&(r=!0),t.inMath=!1,t.mathOpenOffset=null,s+=2;continue}s++;continue}if(t.inDollarMath){if(e.startsWith("$$",s)&&!Qu(e,l)){i!=null&&o&&n+s+2>i&&(r=!0),t.inDollarMath=!1,t.dollarMathOpenOffset=null,s+=2;continue}s++;continue}if(e[s]==="`"&&!Qu(e,l)){const a=Fx(e,s,"`"),u=WW(e,s+a,a);if(u===-1)break;s=u+a;continue}if(e.startsWith("\\[",s)&&!Qu(e,l)){t.inMath=!0,t.mathOpenOffset=n+s,s+=2;continue}if(e.startsWith("$$",s)&&!Qu(e,l)){t.inDollarMath=!0,t.dollarMathOpenOffset=n+s,s+=2;continue}s++}return r}function _2e(e,t){if(!wx(t))return e;const n=t,i=uN.get(n),o=i?.source===e?i.state:i&&e.startsWith(i.source)?qW(i.state,e.slice(i.source.length),i.source.length-i.state.lineBuffer.length).state:H4(e).state;uN.set(n,{source:e,state:o});const{context:s}=o,r=s.inMath?s.mathOpenOffset:s.inDollarMath?s.dollarMathOpenOffset:null;if(r==null)return e;const l=e.slice(r+2),a=e.lastIndexOf(` -`,r-1)+1;if(e.slice(a,r).trim()!==""&&!/^\r?\n/.test(l)||/^\s*!\[/.test(l))return e;const u=l.trim(),c=/^(?:[a-z]|pi)$/i.test(u);return Qd(l)&&!c?e:e.slice(0,r)}function I2e(e,t,n,i,o){const s=Tx(e),r=Ex(e);if(t.inFence&&t.fenceInBlockquote&&e.trim()&&Lx(e)==null&&l8(t),t.inFence&&t.fenceInList&&e.trim()&&s.column=t.fenceLen&&/^\s*$/.test(l.rest)&&l8(t):(t.inFence=!0,t.fenceChar=l.markerChar,t.fenceLen=l.markerLen,t.fenceInBlockquote=l.inBlockquote,t.fenceInList=l.inList||t.listContentIndent!=null&&!l.inBlockquote&&s.column>=t.listContentIndent,t.fenceListIndent=l.listIndent||t.listContentIndent||0);else if(!t.inFence)return hN(e,t,n,i,o)}else return hN(e,t,n,i,o);return!1}function H4(e,t=y2e(),n=null,i=!1,o=0){const s=z0(t);let r=z0(t),l="",a=!1,u=0;for(;uu&&e[c-1]==="\r"?c-1:d?c:e.length,h=e.slice(u,f);I2e(h,s,o+u,n,i)&&(a=!0),d?(r=z0(s),l=""):l=h,u=d?c+1:e.length}return{closedOpenMath:a,state:{committedContext:r,context:s,lineBuffer:l}}}function qW(e,t,n=0){return t&&!e.context.inMath&&!e.context.inDollarMath&&!e.context.inFence&&!e.committedContext.inFence&&!/[\\$`~\r\n]/.test(t)&&!(e.lineBuffer.endsWith("\\")&&(t[0]==="["||t[0]==="]"))?{closedOpenMath:!1,state:{committedContext:z0(e.committedContext),context:z0(e.context),lineBuffer:e.lineBuffer+t}}:H4(e.lineBuffer+t,e.committedContext,n+e.lineBuffer.length,e.context.inMath||e.context.inDollarMath,n)}function M2e(e,t){if(!wx(e))return;const n=e.stream;if(typeof n?.reset!="function")return;const i=e,o=j4.get(i);if(o?.source===t)return;const s=o?t.startsWith(o.source):!1,r=s&&o?t.slice(o.source.length):"",l=s&&o?qW(o.explicitBracketMath,r,o.source.length-o.explicitBracketMath.lineBuffer.length):H4(t),a=l.state,u=s&&o?l.closedOpenMath:!1;if(o&&s&&o.key===null&&o.pendingCandidate===!1&&!u&&!C2e(o.source,r)&&!b2e(t)){o.source=t,o.explicitBracketMath=a;return}const c=u0e(t);(o&&(o&&!s||o.key!==c||u)||!o&&c)&&n.reset(),k2e(e,t,c,a)}function T2e(e){return typeof e.preTransformTokens=="function"||typeof e.postTransformTokens=="function"}function UW(e,t){const n=e?.map,i=t?.map;return n===i?!0:!Array.isArray(n)||!Array.isArray(i)?!1:n.length===i.length&&n.every((o,s)=>o===i[s])}function E2e(e,t){const n=e?.attrs,i=t?.attrs;if(n===i)return!0;if(!Array.isArray(n)||!Array.isArray(i)||n.length!==i.length)return!1;for(let o=0;o":""}function vN(e){return{type:"paragraph",children:e,raw:e.map(D2e).join("")}}function yN(e,t){if(t.sourceMap)for(const n of e)n.sourceMap||(n.sourceMap=t.sourceMap)}function kN(e,t){if(e.type!=="paragraph")return null;const n=e.children,i=Array.isArray(n)?n:[];if(i.length===0)return null;const o=h2e(t);if(!o?.size)return null;let s=-1;for(let c=0;ch?.type==="hardbreak")){s=c;break}}if(s===-1)return null;const r=i.slice(0,s),l=i[s];if(!l)return null;const a=[];r.length&&a.push(vN(r)),a.push(l);const u=i.slice(s+1);return u.length&&a.push(vN(u)),a}function R2e(e){const t=e.trim();if(!t)return null;const n=/^(?:]*>\s*)?]*)?>/i.test(t),i=/<\/html>\s*$/i.test(t);return!n||!i?null:[{type:"html_block",tag:"html",raw:e,content:e,loading:!1}]}function j0(e){const t=e.raw;if(typeof t=="string")return t;const n=e.content;return typeof n=="string"?n:""}function O2e(e,t){if(e.type!=="html_block"||!t)return!1;const n=String(e.raw??e.content??"");return new RegExp(String.raw`^\s*<\s*\/\s*${Au(t)}\s*>\s*$`,"i").test(n)}const u8=new Set(["iframe","script","style","textarea","title"]);function m2(e,t,n){if(!e||!t)return null;const i=t.toLowerCase(),o=f=>{if(e.startsWith("",f+4);return{closing:!1,end:C===-1?e.length:C+3,selfClosing:!1,tag:""}}if(e.startsWith("",f+9);return{closing:!1,end:C===-1?e.length:C+3,selfClosing:!1,tag:""}}const h=No(e.slice(f));if(h===-1)return null;const m=f+h+1,g=e.slice(f,m);if(/^<\s*[!?]/.test(g))return{closing:!1,end:m,selfClosing:!1,tag:""};let y=g.slice(1).trimStart();const k=y.startsWith("/");k&&(y=y.slice(1).trimStart());const v=y.match(/^([A-Z][\w:-]*)/i);return v?.[1]?{closing:k,end:m,selfClosing:/\/\s*>$/.test(g),tag:v[1].toLowerCase()}:{closing:!1,end:f+1,selfClosing:!1,tag:""}},s=(f,h)=>{const m=new RegExp(String.raw`<\s*\/\s*${Au(f)}(?=\s|>)`,"gi");m.lastIndex=h;const g=m.exec(e);if(!g||g.index==null)return null;const y=o(g.index);return y?{start:g.index,end:y.end}:null};let r=-1,l=-1,a=Math.max(0,n);for(;a$/.test(u))return{raw:u,start:r,end:l+1,closed:!0};if(u8.has(i)){const f=s(i,l+1);return f?{raw:e.slice(r,f.end),start:r,end:f.end,closeStart:f.start,closed:!0}:{raw:e.slice(r),start:r,end:e.length,closed:!1}}let c=1,d=l+1;for(;d]*$/,"")} -`}function bN(e){return e.replace(/\r\n/g,` -`).replace(/(^|\n)[ \t]{1,4}/g,"$1")}function $2e(e,t,n){return n?e.includes(n,t)?!0:bN(e.slice(Math.max(0,t))).includes(bN(n)):!1}function z2e(e,t){let n=Math.max(0,t);for(;n)`,"gi");let i=-1,o;for(;(o=n.exec(e))!==null;)i=o.index;return i}function KW(e,t){return{final:t,__disableStreamParse:!0,requireClosingStrong:e.requireClosingStrong,customHtmlTags:e.customHtmlTags,validateLink:e.validateLink}}const H2e=new Set(["admonition","blockquote","code_block","definition_list","footnote","heading","list","math_block","table","thematic_break"]),W2e=/(?:^|\n)\s{0,3}(?:#{1,6}\s+\S|[-+*]\s+\S|\d+[.)]\s+\S|>\s*\S|`{3,}|~{3,}|(?:\*{3,}|-{3,}|_{3,})(?:\s|$)|\|.*\|)/m;function q2e(e){return/\n\s*\n/.test(e)||W2e.test(e)}function U2e(e,t){if(!e.trim()||t.length===0)return!1;if(t.some(i=>H2e.has(String(i?.type??"").toLowerCase()))||t.some(i=>{if(i?.type!=="html_block")return!1;const o=i;return Array.isArray(o.children)&&o.children.length>0}))return!0;if(!q2e(e))return!1;if(t.length>1)return!0;const[n]=t;return!!(n&&n.type==="paragraph")}function V2e(e){const t=[];let n=0;for(;n=e.length)break;const i=e.slice(n).match(/^<([A-Z][\w:-]*)/i);if(!i?.[1])return null;const o=m2(e,i[1],n);if(!o||o.start!==n)return null;t.push(o.raw),n=o.end}return t.length>1?t:null}function K2e(e,t,n,i){const o=n.customHtmlTags?.join("\0")??"",s=t,r=aN.get(s),l=r&&r.final===i&&r.customHtmlTags===o&&r.requireClosingStrong===n.requireClosingStrong&&r.validateLink===n.validateLink,a=e.map((u,c)=>l&&r.blocks[c]===u?r.children[c]:rm(u,t,n));return aN.set(s,{blocks:e,children:a,customHtmlTags:o,final:i,requireClosingStrong:n.requireClosingStrong,validateLink:n.validateLink}),a.flat()}function Z2e(e,t,n,i){return e.map(o=>{if(o?.type!=="html_block")return o;const s=o,r=String(s.tag??"").toLowerCase();if(!r||r==="details"||VH.has(r)||Array.isArray(s.children))return o;const l=String(o.raw??s.content??"");if(!l)return o;const a=No(l);if(a===-1)return o;const u=m2(l,r,0),c=u?.closeStart??-1,d=u?.closed===!0&&c>=a+1,f=d?l.slice(a+1,c):l.slice(a+1);if(!f.trim())return o;const h=KW(n,i),m=d?null:V2e(f),g=m?K2e(m,t,h,i):rm(f,t,h);return U2e(f,g)?{...o,children:g}:o})}function G2e(e){for(const t of e)if(t?.type==="html_block")return!0;return!1}function rm(e,t,n){return e.trim()?GW(e,t,{...n,__disableStreamParse:!0,__disableStructuredReuse:!0}):[]}function Q2e(e,t,n){const i=rm(e,t,n),o=i[0];return i.length===1&&o?.type==="paragraph"&&Array.isArray(o.children)?o.children:i}function Y2e(e,t,n){const i=NW({content:e}),o=No(e),s=VW(e,"summary");if(o!==-1&&s!==-1&&s>=o+1){const r=Q2e(e.slice(o+1,s),t,n);r.length>0&&(i.children=r)}return i.raw=e,i}function J2e(e,t,n){const i=No(e);if(i===-1)return[];const o=e.slice(i+1);if(!o.trim())return[];const s=m2(o,"summary",0);if(!s)return rm(o,t,n);const r=o.slice(0,s.start),l=o.slice(s.end);return[...rm(r,t,n),Y2e(s.raw,t,n),...rm(l,t,n)]}function ZW(e,t,n,i,o,s=0){const r=[];let l=s;for(let a=0;a{const $=VW(f,"details");return $!==-1?f.slice(0,$):f})():f,[C]=ZW(k?[]:g===-1?e.slice(a+1):e.slice(a+1,g),t,n,i,o,h+f.length),w=J2e(v,n,KW(i,o)),M=g===-1?"":String(e[g].raw??j0(e[g])??""),L=k||g!==-1&&y?.closed===!0,E=M.replace(/[\t\r\n ]+$/,""),S=L?(()=>{const $=(y?.raw??"").lastIndexOf(E);return $===-1?t.length:h+$})():t.length,x=No(f),A=k&&x!==-1?h+x+1:h+f.length,T=t.slice(A,S===-1?t.length:S),I=n.parse(T,{__markstreamFinal:o}),O=n.renderer.render(I,n.options,{__markstreamFinal:o}),H=S+E.length,R=L?Math.max(S+M.length,z2e(t,H)):t.length,F=L?t.slice(S,R):M,P=L?t.slice(h,R):t.slice(h),z=k&&x!==-1?f.slice(0,x+1):f,W={...u,tag:"details",attrs:$4(f.slice(0,x+1)),raw:P,content:`${z}${O}${F}`,children:[...w,...C],loading:!o&&!L};if(i.includeSourceMap&&(W.sourceMap=Rv(t,h,L?R:t.length,i)),r.push(W),l=L?R:t.length,g===-1&&!k)break;g!==-1&&(a=g)}return[r,l]}function X2e(e,t,n,i){if(!n)return e;const o=e.slice();let s=0;for(let r=0;r=d.start&&x.end<=d.end){o.splice(L,1);continue}break}M=S+E.length,o.splice(L,1)}}return o}function eye(e){const t=l=>l===" "||l===" "||l===` -`||l==="\r",n=l=>{if(!l||l[0]!=="<"||l.includes(">"))return!1;let a=1;if(a{const y=g.charCodeAt(0);return y>=65&&y<=90||y>=97&&y<=122},c=g=>{const y=g.charCodeAt(0);return y>=48&&y<=57},d=g=>g==="!"||u(g),f=g=>u(g)||c(g)||g===":"||g==="-",h=g=>u(g)||c(g)||g==="_"||g==="."||g===":"||g==="-",m=h;if(a>=l.length||!d(l[a]))return!1;for(a++;a=l.length)return!0;if(l[a]==="/"){for(a++;a=l.length}if(!h(l[a]))return!1;for(a++;a=l.length)return!0;const g=l[a];if(g==='"'||g==="'"){for(a++;a=l.length)return!0;a++}else{for(;a"||y==='"'||y==="'"||y==="`")break;a++}if(a>=l.length)return!0}}}return!0},i=(l,a)=>HW(l,a),o=String(e??""),s=o.lastIndexOf("<");if(s===-1||i(o,s))return o;if(s>0){const l=o[s-1],a=l===" "||l===" "||l===` -`||l==="\r",u=o[s-2];if(!a&&!((l==="n"||l==="r")&&u==="\\"))return o}const r=o.slice(s);return r.includes(">")||r.length>1&&(r[1]===" "||r[1]===" "||r[1]===` -`||r[1]==="\r")||!n(r)?o:o.slice(0,s)}function CN(e,t){if(e===t)return;const n=e.split(/\r?\n/),i=t.split(/\r?\n/),o=[];let s=0;for(let r=0;r{const l=Number.isFinite(r)?Math.max(0,Math.trunc(r)):0;if(lString(m??"").toLowerCase()).filter(Boolean));if(!n.size)return e;const i=m=>m===" "||m===" ",o=m=>{const g=m.charCodeAt(0);return g>=65&&g<=90||g>=97&&g<=122||g>=48&&g<=57||m==="_"||m==="-"||m===":"},s=m=>{if(!m)return!1;if(m[0]===" ")return!0;let g=0;for(let y=0;y=4)return!0;continue}if(k===" ")return!0;break}return!1},r=m=>{let g=!1,y=!1;for(let k=0;k")return k}return-1},l=m=>{let g=0;for(;g{if(s(m))return-1;const y=m.replace(/^[ \t]+/,"");if(!y||y.startsWith(">")||y.startsWith("|")||/^(?:[*+-]|\d+[.)])[\t ]+/.test(y))return-1;let k=!1,v=0;for(;v=M.length){k=!0,v++;continue}const E=M[L];if(E==="!"||E==="?"){k=!0,v+=w+1;continue}if(E==="/"){k=!0,v+=w+1;continue}const S=L;for(;L"&&A!=="/"){k=!0,v++;continue}const T=new RegExp(String.raw`<\s*\/\s*${x}\s*>`,"i"),I=/\/\s*>$/.test(M),O=T.test(m.slice(v+w+1)),H=T.test(e.slice(g+v+w+1)),R=/[\r\n]/.test(e.slice(g+v+w+1));if(k&&n.has(x)&&!I&&!O&&(H||R))return v;k=!0,v+=w+1}return-1};let u=!1,c="",d=0,f="",h=0;for(;hh&&e[m-1]==="\r",k=g?y?m-1:m:e.length,v=e.slice(h,k),C=g?y?`\r -`:` -`:"",w=l(v);let M=v;if(!u&&!w){const L=a(v,h);if(L!==-1){const E=C||` -`;M=`${v.slice(0,L).replace(/[ \t]+$/,"")}${E}${E}${v.slice(L).replace(/^[ \t]+/,"")}`}}f+=M,f+=C,w&&(u?w.markerChar===c&&w.markerLen>=d&&/^\s*$/.test(w.rest)&&(u=!1,c="",d=0):(u=!0,c=w.markerChar,d=w.markerLen)),h=g?m+1:e.length}return f}function nye(e,t){if(!e||!t.length)return e;const n=new Set(t.map(d=>String(d??"").toLowerCase()));if(!n.size)return e;const i=d=>d===" "||d===" ",o=d=>{const f=d.charCodeAt(0);return f>=65&&f<=90||f>=97&&f<=122||f>=48&&f<=57||d==="_"||d==="-"},s=d=>{let f=0;for(;f{let f=!1,h=!1;for(let m=0;m")return m}return-1},l=(d,f,h)=>{const m=h.toLowerCase();let g=d.indexOf("<",f);for(;g!==-1;){let y=g+1;for(;y=d.length||d[y]!=="/"){g=d.indexOf("<",g+1);continue}for(y++;yd.length){g=d.indexOf("<",g+1);continue}let k=!0;for(let C=0;C="A"&&w<="Z"?String.fromCharCode(w.charCodeAt(0)+32):w)!==m[C]){k=!1;break}}if(!k){g=d.indexOf("<",g+1);continue}let v=y+m.length;if(v")return!0;g=d.indexOf("<",g+1)}return!1},a=d=>{let f=0;for(;f=d.length||d[f]!=="<")return d;for(f++;f=d.length||d[f]==="/")return d;const h=f;for(;fc&&e[d-1]==="\r",h=f?d-1:d,m=e.slice(c,h);u+=a(m),u+=f?`\r -`:` -`,c=d+1}return u}function iye(e,t){if(!e||!t.length)return e;const n=new Set(t.map(f=>String(f??"").toLowerCase()));if(!n.size)return e;const i=f=>f===" "||f===" ",o=f=>{let h=0,m=!1,g=0;for(;h=f.length||f[h]!==">")break;for(m=!0,h++;h{let h=0;for(;hnew RegExp(String.raw`(<\s*\/\s*${f}\s*>)${"(?=[\\t ]*(?:#{1,6}[\\t ]+|>|(?:[*+-]|\\d+[.)])[\\t ]+|(?:`{3,}|~{3,})|\\||\\$\\$|:{3,}|\\[\\^[^\\]]+\\]:|(?:-{3,}|\\*{3,}|_{3,})))"}`,"gi"));let l=!1,a="",u=0,c="",d=0;for(;dd&&e[f-1]==="\r",g=h?m?f-1:f:e.length,y=e.slice(d,g),k=h?m?`\r -`:` -`:"",v=o(y),C=v?.prefix??"",w=v?.content??y,M=s(w);M&&(l?M.markerChar===a&&M.markerLen>=u&&/^\s*$/.test(M.rest)&&(l=!1,a="",u=0):(l=!0,a=M.markerChar,u=M.markerLen));let L=w;if(!l&&L.includes("{if(T.replace(/^[\t ]+/,"").startsWith("|"))return S;const I=T.slice(0,A).replace(/^[\t ]+/,"");if(I.length>0){const O=x.match(/^<\s*\/\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"",H=I.match(/^<\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??"";if(!O||!H||O!==H)return S}return`${x} - -`});if(C){const E=C+L.split(` -`).join(` -${C}`);c+=E}else c+=L;c+=k,d=h?f+1:e.length}return c}function oye(e,t){if(!e||!t.length)return e;const n=new Set(t.map(I=>String(I??"").toLowerCase()));if(!n.size)return e;const i=I=>I===" "||I===" ",o=I=>{if(!I)return!1;if(I[0]===" ")return!0;let O=0;for(let H=0;H=4)return!0;continue}if(R===" ")return!0;break}return!1},s=I=>{const O=I.charCodeAt(0);return O>=65&&O<=90||O>=97&&O<=122||O>=48&&O<=57||I==="_"||I==="-"||I===":"},r=I=>{let O=0;for(;O{let O=0,H=!1,R=0;for(;O=I.length||I[O]!==">")break;for(H=!0,O++;Or(I).startsWith("<"),u=I=>{for(let O=0;O{if(o(I))return"";const O=r(I);if(!O.startsWith("<"))return"";let H=1;for(;H=O.length||O[H]==="/"||O[H]==="!"||O[H]==="?")return"";const R=H;for(;H"&&P!=="/"?"":F},d=I=>{if(o(I))return null;const O=r(I);if(!O.startsWith("<"))return null;let H=1;for(;H=O.length)return null;const R=O[H]==="/";if(R)for(H++;H"&&W!=="/")return null;if(R)return{type:"close",name:z};if(/\/\s*>\s*$/.test(O))return{type:"open",name:z,complete:!0};const $=O.indexOf(">",H);if($!==-1){const K=O.slice($+1);if(new RegExp(`<\\s*\\/\\s*${z}\\s*>`,"i").test(K))return{type:"open",name:z,complete:!0}}return{type:"open",name:z,complete:!1}},f=I=>{if(o(I))return null;const O=r(I).replace(/[ \t]+$/,"");if(!O.startsWith("<")||/^<\s*(?:!--|!doctype\b|\?)/i.test(O))return null;const H=O.match(/^<\s*([A-Z][\w:-]*)\b[^>]*\/\s*>\s*$/i);if(H?.[1])return H[1].toLowerCase();const R=O.match(/^<\s*([A-Z][\w:-]*)\b[^>]*>[\s\S]*<\s*\/\s*([A-Z][\w:-]*)\s*>\s*$/i);if(!R?.[1]||!R[2])return null;const F=R[1].toLowerCase();return F===R[2].toLowerCase()?F:null};let h=!1,m="",g=0;const y=I=>{let O=0;for(;Oy(I),v=I=>{const O=r(I);return O?o(I)?!0:/^(?:#{1,6}[ \t]+|>|[*+-][ \t]+|\d+[.)][ \t]+|`{3,}|~{3,}|\||\$\$|:{3,}|\[\^[^\]]+\]:|-{3,}|\*{3,}|_{3,})/.test(O):!1},C=(I,O,H)=>{let R=I,F=0;for(;RR&&e[P-1]==="\r",$=z?W?P-1:P:e.length,K=e.slice(R,$),ne=l(K),G=ne?.key??"";if(F>0&&O&&G!==O)break;const te=ne?.content??K,le=d(te);if(le?.name===H){if(le.type==="open")le.complete||F++;else if(F>0&&(F--,F===0))return!1}else if(F>0&&(u(te)||v(te)))return!0;if(z)R=P+1;else break}return!1};let w="",M=0,L=!0,E=!1,S=!1,x=` -`;const A=[];let T="";for(;MM&&e[I-1]==="\r",R=O?H?I-1:I:e.length,F=e.slice(M,R),P=O?H?`\r -`:` -`:"",z=l(F),W=z?.key??"",$=z?.content??F,K=k($);K&&(h?K.markerChar===m&&K.markerLen>=g&&/^\s*$/.test(K.rest)&&(h=!1,m="",g=0):(h=!0,m=K.markerChar,g=K.markerLen));const ne=A.length>0;if(!h&&!ne){const te=c($),le=!!te&&!L&&E&&S&&C(M,W,te);te&&!L&&(!E||le)&&(W&&T&&W===T?w+=`${W}${x}`:W||(w+=x))}if(w+=F,w+=P,P&&(x=P),!h){const te=d($);if(te){if(te.type==="open")te.complete||A.push(te.name);else for(let le=A.length-1;le>=0;le--)if(A[le]===te.name){A.length=le;break}}}const G=u($);L=G,E=!G&&a($),S=!G&&!!f($),T=W,M=O?I+1:e.length}return w}function sye(e){let t=!1,n="",i=0,o=!1,s=!1,r=!1,l=0;const a=(c,d)=>{const f=Nx(c);if(f){t?f.markerChar===n&&f.markerLen>=i&&/^\s*$/.test(f.rest)&&(t=!1,n="",i=0):(t=!0,n=f.markerChar,i=f.markerLen);return}if(t)return;let h=0;for(;h{for(;l=c?c:d,h=f>l&&e[f-1]==="\r"?f-1:f;if(a(e.slice(l,h)),d===-1||d>=c){l=c;break}r=!1,l=d+1}},inMath:()=>o||s||r}}function c8(e,t,n,i){let o=e.replace(/([^\\])\r(ight|ho)/g,"$1\\r$2");const s=sye(o);if(o=o.replace(/([^\\])\r?\n(abla|eq|ot|exists)/g,(r,l,a,u)=>{s.scanTo(u+1);const c=s.inMath();return s.scanTo(u+r.length),c?`${l}\\n${a}`:r}),t||(o.endsWith("- *")&&(o=o.replace(/- \*$/,"- \\*")),/(?:^|\n)\s*-\s*$/.test(o)?o=o.replace(/(?:^|\n)\s*-\s*$/,r=>r.startsWith(` -`)?` -`:""):/(?:^|\n)\s*--\s*$/.test(o)?o=o.replace(/(?:^|\n)\s*--\s*$/,r=>r.startsWith(` -`)?` -`:""):/(?:^|\n)\s*>\s*$/.test(o)?o=o.replace(/(?:^|\n)\s*>\s*$/,r=>r.startsWith(` -`)?` -`:""):/\n\s*[*+]\s*$/.test(o)?o=o.replace(/\n\s*[*+]\s*$/,` -`):/(?:^|\n)\s*\d+\s*$/.test(o)?/^\d+$/.test(o.trim())||(o=o.replace(/(?:^|\n)\s*\d+\s*$/,r=>r.startsWith(` -`)?` -`:"")):/(?:^|\n)\s*\d+[.)]\s+\*{1,3}\s*$/.test(o)?o=o.replace(/((?:^|\n)\s*\d+[.)]\s+)(\*{1,3})\s*$/,(r,l,a)=>`${l}${a.split("").map(()=>"\\*").join("")}`):/(?:^|\n)\s*\d+[.)]\s*$/.test(o)?o=o.replace(/(?:^|\n)\s*\d+[.)]\s*$/,r=>r.startsWith(` -`)?` -`:""):/\n[[(]\n*$/.test(o)&&(o=o.replace(/(\n\[|\n\()+\n*$/g,` -`)),o=S2e(o,i.customHtmlTags)??o),i.customHtmlTags?.length&&o.includes("<")){const r=Np(i.customHtmlTags);if(r.length&&(o=tye(o,r),o=nye(o,r),o=oye(o,r),o=iye(o,r),o.includes("[\t ]*)(\r?\n)(?![\t ]*\r?\n|$)`,"gim");o=o.replace(a,"$1$2$2")}}return t||(o=eye(o)),o}function rye(e,t,n,i){const o=e,s=`${n?"final":"stream"}:${(i.customHtmlTags??[]).join(",")}`,r=_A.get(o);let l;if(!n&&!i.customHtmlTags?.length&&r&&r.mode===s&&t.length>=r.source.length&&t.startsWith(r.source)){const a=Math.max(0,r.source.length-n2e-i2e),u=c8(t.slice(a),n,e,i),c=r.source.length-a;l=u.length>=c&&u.slice(0,c)===r.safeMarkdown.slice(-c)?r.safeMarkdown.slice(0,r.safeMarkdown.length-c)+u:c8(t,n,e,i)}else l=c8(t,n,e,i);return n||(l=_2e(l,e)),_A.set(o,{source:t,safeMarkdown:l,mode:s}),l}function GW(e,t,n={}){const i=OW(n),o=i?au():0,s=!!n.final,r=(e??"").toString();g2e(t,n)&&(t.stream.reset(),v2e(t),_A.delete(t));const l=rye(t,r,s,n);i&&cf(i,"safeMarkdownMs",au()-o);const a=R2e(l);if(a){if(n.includeSourceMap){const M={...n,__sourceLineMapper:CN(r,l)};a[0].sourceMap=Rv(l,0,l.length,M)}const C=n.preTransformTokens,w=n.postTransformTokens;if(Mx(t,n)||typeof C=="function"||typeof w=="function"){const M=gN(t,l,{__markstreamFinal:s},n),L=typeof C=="function"&&C(M)||M;typeof w=="function"&&w(L)}return cN(a,n,i,o)}const u=i?au():0,c=gN(t,l,{__markstreamFinal:s},n);if(i&&cf(i,"tokenizeMs",au()-u),!c||!Array.isArray(c))return cN([],n,i,o);const d=n.preTransformTokens,f=n.postTransformTokens;let h=c;d&&typeof d=="function"&&(h=d(h)||h);const m=t,g=typeof m.validateLink=="function"&&m.__markstreamOriginalValidateLink&&m.validateLink!==m.__markstreamOriginalValidateLink?m.validateLink:void 0,y=n.validateLink??g??m.options?.validateLink??(typeof m.validateLink=="function"?m.validateLink:void 0),k={...n,validateLink:y,__markdownIt:t,__sourceLineMapper:n.includeSourceMap===!0?CN(r,l):void 0,__sourceMarkdown:l,__customHtmlBlockCursor:0};let v=f2e(t,l,h,k,i);if(f&&typeof f=="function"){const C=f(h);if(Array.isArray(C)){const w=C[0],M=w?.type;w&&typeof M=="string"?v=S1(C,{...k,__customHtmlBlockCursor:0},i):v=C}}if(G2e(v)){const C=i?au():0;v=X2e(v,s,l,k),v=ZW(v,l,t,k,s)[0],v=Z2e(v,t,k,s),i&&cf(i,"htmlBlockPassesMs",au()-C)}if(s){const C=new WeakSet,w=M=>{if(!M||typeof M!="object"||C.has(M))return;if(C.add(M),Array.isArray(M)){for(const E of M)w(E);return}const L=M;L.type==="html_block"&&L.loading===!0&&(L.loading=!1);for(const E of Object.values(L))w(E)};w(v)}return v=BW(v,n),n.debug&&console.log("Parsed Markdown Tree Structure:",v),PW(v,i,o)}function AN(e,t){if(!e||!Array.isArray(e))return[];const n=[],i=qf(t),o=t?.__linkifyDemotionSeed;if(Array.isArray(o)&&o.length)for(const l of o)i.remember(String(l??""));const s=t?.includeSourceMap===!0;let r=0;for(;rd.type==="html_block")){if(s)for(const d of c)bi(d,a,t);for(const d of c)Bu(d,a,t);n.push(...c)}else{const d={type:"paragraph",raw:u,children:c};s&&bi(d,a,t);const f=kN(d,t);if(f){s&&yN(f,d);for(const h of f)Bu(h,a,t);n.push(...f)}else Bu(d,a,t),n.push(d)}i.remember(u)}r+=1;break;default:r+=1;break}}return n}const lye=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g,H0=/\d/u,aye=/[,.!?;:,。;、!?:]/u,uye=/\d\p{Script=Han}{1,3}$/u;function cye(e){return e.pos>0&&e.pos+1{const u=l,c=u.posMax,d=u.pos;if(u.src.charCodeAt(d)!==r||a||s.refuseDigitRange&&cye(u))return!1;u.pos=d+1;let f=!1;for(;u.pos]|$)/i,pye=new Set([...f2,"base","button","datalist","dialog","embed","fieldset","form","iframe","input","legend","link","meta","object","optgroup","option","output","param","select","style","template","textarea","title"]),mye=new Set(["a","abbr","b","blockquote","br","caption","code","col","colgroup","dd","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","ins","kbd","li","mark","ol","p","picture","pre","s","small","source","span","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","ul"]);function xN(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function gye(e){return typeof e=="string"?e:e==null?"":String(e)}function QW(e){return/^[^\s"'<>`=]+$/.test(e)&&!/^on/i.test(e)}function Yd(e){return gye(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function YW(e){return Yd(e).replace(/`/g,"`")}function q4(e){return String(e??"").trim().toLowerCase()}function Dx(e,t="safe"){const n=q4(e);return n?t==="escape"?!0:t==="trusted"?f2.has(n):!mye.has(n):!1}function JW(e,t="safe"){const n=q4(e);return n?t==="escape"?!0:t==="trusted"?f2.has(n):pye.has(n):!1}function SN(e){const t=Object.entries(e);return t.length===0?"":t.map(([n,i])=>i===""?` ${n}`:` ${n}="${YW(i)}"`).join("")}function XW(e){const t=e.startsWith("/"),n=t?e.slice(1):e,i=n.match(hye);return i?{attrsStr:t?"":n.slice(i[0].length).trimStart(),isClosing:t,isSelfClosing:!t&&e.trimEnd().endsWith("/"),tagName:i[1]}:null}function vye(e,t){const n=e.split(",").map(i=>i.trim()).filter(Boolean);return n.length===0?!1:n.some(i=>{const o=i.split(/\s+/,1)[0]??"";return!o||ip(o,{tagName:t,attrName:"srcset"})})}function eq(e,t,n,i){return X1e.has(e)||n==="safe"&&e==="style"?!0:e==="srcset"?vye(t,i):!!(eme.has(e)&&t&&ip(t,{tagName:i,attrName:e}))}function Fh(e,t){const n=t.toLowerCase();return Object.keys(e).find(i=>i.toLowerCase()===n)}function tq(e,t,n,i=!1){if(t!=="safe"||q4(n)!=="a")return e;const o=Fh(e,"href");if(i&&(!o||!e[o])){const a=Fh(e,"target"),u=Fh(e,"rel");return a&&delete e[a],u&&delete e[u],e}const s=Fh(e,"target");if((s?String(e[s]).trim():"").toLowerCase()!=="_blank")return e;const r=Fh(e,"rel"),l=new Set(String(r?e[r]:"").split(/\s+/).map(a=>a.trim()).filter(Boolean).filter(a=>a.toLowerCase()!=="opener"));return l.add("noopener"),l.add("noreferrer"),r&&r!=="rel"&&delete e[r],e.rel=Array.from(l).join(" "),e}function _N(e,t="safe",n){const i={};for(const[o,s]of Object.entries(e)){const r=o.trim(),l=r.toLowerCase();!r||!QW(r)||eq(l,s,t,n)||(i[r]=s)}return tq(i,t,n,!!Fh(e,"href"))}function nq(e,t){const n=e.toLowerCase();return UH.has(n)?!1:xN(t,n)||xN(t,e)}function Rx(e,t="safe",n){const i={};for(const[o,s]of Object.entries(e)){const r=o.trim(),l=r.toLowerCase();!r||!QW(r)||eq(l,s,t,n)||(i[r]=s)}return tq(i,t,n,!!Fh(e,"href"))}function W0(e){const t={};if(!Array.isArray(e)||e.length===0)return t;for(const[n,i]of e)n&&(t[String(n)]=i==null?"":String(i));return t}function P9(e,t="safe",n){const i=Rx(W0(e),t,n),o=Object.entries(i).map(([s,r])=>[s,r]);return o.length>0?o:void 0}function yye(e,t){const n=t.toLowerCase();if(["checked","disabled","readonly","required","autofocus","multiple","hidden"].includes(n))return e==="true"||e===""||e===t;if(["value","min","max","step","width","height","size","maxlength"].includes(n)){const i=Number(e);if(e!==""&&!Number.isNaN(i))return i}return e}function kye(e){const t={};for(const[n,i]of Object.entries(e))t[n]=yye(i,n);return t}function d8(e){return e.trim().length>0}function iq(e){const t=[];let n=0;for(;n",n);if(r!==-1){n=r+3;continue}break}const i=e.indexOf("<",n);if(i===-1){if(nn){const r=e.slice(n,i);d8(r)&&t.push({type:"text",content:r})}if(e.startsWith("![CDATA[",i+1)){const r=e.indexOf("]]>",i);if(r!==-1){t.push({type:"text",content:e.slice(i,r+3)}),n=r+3;continue}break}if(e.startsWith("!",i+1)){const r=e.indexOf(">",i);if(r!==-1){n=r+1;continue}break}const o=e.indexOf(">",i);if(o===-1)break;const s=XW(e.slice(i+1,o));if(!s){const r=e.slice(i,o+1);d8(r)&&t.push({type:"text",content:r}),n=o+1;continue}if(s.isClosing)t.push({type:"tag_close",tagName:s.tagName});else{const r={};if(s.attrsStr){const l=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let a;for(;(a=l.exec(s.attrsStr))!==null;){const u=a[1],c=a[2]??a[3]??a[4]??"";u&&!u.endsWith("/")&&(r[u]=c)}}t.push({type:s.isSelfClosing||Sf.has(s.tagName.toLowerCase())?"self_closing":"tag_open",tagName:s.tagName,attrs:r})}n=o+1}return t}function bye(e){const t=[];let n=0;for(;n",n);if(l!==-1){n=l+3;continue}break}const i=e.indexOf("<",n);if(i===-1){nn&&t.push({type:"text",content:e.slice(n,i)}),e.startsWith("![CDATA[",i+1)){const l=e.indexOf("]]>",i);if(l!==-1){t.push({type:"text",content:e.slice(i,l+3)}),n=l+3;continue}break}if(e.startsWith("!",i+1)){const l=e.indexOf(">",i);if(l!==-1){n=l+1;continue}break}const o=e.indexOf(">",i);if(o===-1)break;const s=XW(e.slice(i+1,o));if(!s){t.push({type:"text",content:e.slice(i,o+1)}),n=o+1;continue}if(s.isClosing){t.push({type:"tag_close",tagName:s.tagName}),n=o+1;continue}const r={};if(s.attrsStr){const l=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g;let a;for(;(a=l.exec(s.attrsStr))!==null;){const u=a[1],c=a[2]??a[3]??a[4]??"";u&&!u.endsWith("/")&&(r[u]=c)}}t.push({type:s.isSelfClosing||Sf.has(s.tagName.toLowerCase())?"self_closing":"tag_open",tagName:s.tagName,attrs:r}),n=o+1}return t}function wye(e){const t=String(e.tagName??"").trim();if(!t)return"";if(e.type==="tag_close")return`</${Yd(t)}>`;const n=Object.entries(e.attrs??{}).map(([i,o])=>o===""?` ${Yd(i)}`:` ${Yd(i)}="${YW(o)}"`).join("");return e.type==="self_closing"?`<${Yd(t)}${n} />`:`<${Yd(t)}${n}>`}function Cye(e,t){if(!e||!e.includes("<")||!t||Object.keys(t).length===0)return!1;for(const n of iq(e))if((n.type==="tag_open"||n.type==="self_closing")&&nq(n.tagName??"",t))return!0;return!1}function lm(e,t="safe"){if(!e)return"";if(t==="escape")return Yd(e);const n=bye(e),i=[],o=[],s=[];for(const r of n){if(r.type==="text"){s.length===0&&o.push(Yd(r.content??""));continue}const l=q4(r.tagName);if(!l)continue;if(JW(l,t)){r.type==="tag_open"?s.push(l):r.type==="tag_close"&&s[s.length-1]===l&&s.pop();continue}if(s.length>0)continue;if(t==="safe"&&Dx(l,t)){o.push(wye(r));continue}if(r.type==="self_closing"){o.push(`<${l}${SN(_N(r.attrs??{},t,l))}>`);continue}if(r.type==="tag_open"){o.push(`<${l}${SN(_N(r.attrs??{},t,l))}>`),Sf.has(l)||i.push(l);continue}const a=i.lastIndexOf(l);if(a===-1)continue;for(;i.length>a+1;){const c=i.pop();c&&o.push(``)}const u=i.pop();u&&o.push(``)}for(;i.length>0;){const r=i.pop();r&&o.push(``)}return o.join("")}const Aye=[/javascript:/i,/vbscript:/i,/data:text\/html/i,/expression\s*\(/i,/@import/i],IN="http://www.w3.org/2000/svg",xye=new Set(["script","style","iframe","object","embed","link","meta"]),Sye=new Set(["svg","style","g","a","defs","marker","path","rect","circle","ellipse","line","polyline","polygon","text","tspan","title","desc","use","image","lineargradient","radialgradient","stop","clippath","mask","pattern"]),_ye=new Set(["href","xlink:href","src","srcdoc","action","data","formaction","poster"]),Iye=new Set(["clip-path","fill","filter","marker-end","marker-mid","marker-start","mask","stroke"]),Mye=new Set(["circle","ellipse","image","line","path","polygon","polyline","rect","text","tspan","use"]);function Tye(e){return(e.getAttribute("href")||e.getAttribute("xlink:href"))?.startsWith("#")===!0}function Eye(e){return!!(e.getAttribute("href")||e.getAttribute("xlink:href")||e.getAttribute("src"))}function Lye(e){const t=e.nodeName.toLowerCase();return t==="use"?Tye(e):t==="image"?Eye(e):t==="text"||t==="tspan"?!!e.textContent?.trim():Mye.has(t)}function Nye(e){return e.replace(/(["'])\s*javascript:/gi,"$1#").replace(/\bjavascript:/gi,"#").replace(/(["'])\s*vbscript:/gi,"$1#").replace(/\bvbscript:/gi,"#").replace(/\bdata:text\/html/gi,"#")}function Fye(e,t,n){const i=e.toLowerCase(),o=t.toLowerCase(),s=String(n??"").trim();return s?(i==="use"||i==="marker"||i==="clippath"||i==="mask")&&(o==="href"||o==="xlink:href")?s.startsWith("#")?s:"":i==="a"&&(o==="href"||o==="xlink:href")?ip(s,{tagName:"a",attrName:"href"})?"":s:i==="image"&&(o==="href"||o==="xlink:href"||o==="src")?ip(s,{tagName:"img",attrName:"src"})?"":s:o==="href"||o==="xlink:href"?s.startsWith("#")?s:"":ip(s,{tagName:i,attrName:o})?"":s:""}function Dye(e,t){let n=t+4;for(;n{const i=n.trim();if(/^[0-9a-f]+$/i.test(i)){const o=Number.parseInt(i,16);try{return Number.isFinite(o)?String.fromCodePoint(o):""}catch{return""}}return String(n).trim()})}function sq(e){const t=oq(e),n=t.toLowerCase();let i=0;for(;in.test(t))||sq(t)}function Rye(e){if(e.tagName.toLowerCase()!=="a"||e.getAttribute("target")?.trim().toLowerCase()!=="_blank")return;const t=new Set(String(e.getAttribute("rel")??"").split(/\s+/).map(n=>n.trim()).filter(Boolean).filter(n=>n.toLowerCase()!=="opener"));t.add("noopener"),t.add("noreferrer"),e.setAttribute("rel",Array.from(t).join(" "))}function Ly(e){const t=Number.parseFloat(String(e??""));return Number.isFinite(t)?t:0}function rq(e,t){if(e.nodeType===Node.TEXT_NODE){const o=e.textContent??"";o&&t.push(o);return}if(e.nodeType!==Node.ELEMENT_NODE)return;const n=e,i=n.tagName.toLowerCase();if(!xye.has(i)){if(i==="br"){t.push(` -`);return}for(const o of Array.from(n.childNodes))rq(o,t)}}function Oye(e){for(const t of Array.from(e.querySelectorAll("foreignObject"))){const n=[];rq(t,n);const i=n.join("").split(/\r?\n/).map(c=>c.trim()).filter(Boolean);if(!i.length){t.remove();continue}const o=Ly(t.getAttribute("width")),s=Ly(t.getAttribute("height")),r=Ly(t.getAttribute("x")),l=Ly(t.getAttribute("y")),a=e.ownerDocument.createElementNS(IN,"text");a.setAttribute("x",String(r+o/2)),a.setAttribute("y",String(l+s/2)),a.setAttribute("text-anchor","middle"),a.setAttribute("dominant-baseline","central");const u=t.querySelector(".nodeLabel");if(u?.getAttribute("class")&&a.setAttribute("class",u.getAttribute("class")),i.length===1)a.textContent=i[0];else{const c=-.6*(i.length-1);for(const[d,f]of i.entries()){const h=e.ownerDocument.createElementNS(IN,"tspan");h.setAttribute("x",String(r+o/2)),h.setAttribute("dy",d===0?`${c}em`:"1.2em"),h.textContent=f,a.appendChild(h)}}t.parentNode?.replaceChild(a,t)}}function Pye(e){Oye(e);const t=[e,...Array.from(e.querySelectorAll("*"))];for(const n of t){const i=n.tagName.toLowerCase();if(!Sye.has(i)){n.remove();continue}if(i==="style"&&MN(n.textContent??"")){n.remove();continue}const o=Array.from(n.attributes);for(const s of o){const r=s.name.toLowerCase();if(/^on/i.test(r)){n.removeAttribute(s.name);continue}if(r==="style"&&s.value&&MN(s.value)){n.removeAttribute(s.name);continue}if(r==="srcdoc"){n.removeAttribute(s.name);continue}if(_ye.has(r)&&s.value){const l=Fye(i,r,s.value);if(!l){n.removeAttribute(s.name);continue}l!==s.value&&n.setAttribute(s.name,l);continue}if(Iye.has(r)&&s.value&&sq(s.value)){n.removeAttribute(s.name);continue}if(s.value){const l=Nye(s.value);l!==s.value&&n.setAttribute(s.name,l)}}Rye(n)}}function R8t(e){if(typeof DOMParser>"u"||!e)return null;try{const t=new DOMParser().parseFromString(e,"image/svg+xml").documentElement;if(!t||t.nodeName.toLowerCase()!=="svg")return null;const n=t;return Pye(n),Bye(n)?null:n}catch{return null}}function Bye(e){const t=e.getAttribute("viewBox");if(t){const o=t.trim().split(/[\s,]+/);if(o.length===4){const s=Number.parseFloat(o[2]||""),r=Number.parseFloat(o[3]||"");if(!Number.isFinite(s)||!Number.isFinite(r)||s<=0||r<=0)return!0}}const n=[e,...Array.from(e.querySelectorAll("*"))];let i=!1;for(const o of n){Lye(o)&&(i=!0);for(const s of Array.from(o.attributes))if(/\bNaN\b/i.test(s.value)||s.name==="style"&&/max-width:\s*0(?:px)?/i.test(s.value))return!0}return!i}const Ny=[];function f8(e){return String(e??"").replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function $ye(e){return(String(e||"text").trim().split(/\s+/)[0]||"text").replace(/[^\w+.#:-]/g,"-").replace(/-+/g,"-")||"text"}function zye(e){return e.replace(/[^\w:.+-]/g,"-").replace(/-+/g,"-")}function TN(e=`editor-${Date.now()}`,t={}){const n=y0e(t),i=n;i.__markstreamRegisteredPluginCount=Ny.length,i.__markstreamHasCustomParserExtensions=!!(t.plugin?.length||t.apply?.length||Ny.length);const o={"common.copy":"Copy"};let s;if(typeof t.i18n=="function")s=t.i18n;else if(t.i18n&&typeof t.i18n=="object"){const h=t.i18n;s=m=>h[m]??o[m]??m}else s=h=>o[h]??h;if(Array.isArray(t.plugin))for(const h of t.plugin){const m=h;if(Array.isArray(m)){const[g,...y]=m;typeof g=="function"&&n.use(g,...y)}else typeof m=="function"&&n.use(m)}if(Array.isArray(t.apply))for(const h of t.apply)try{h(n)}catch(m){console.error("[getMarkdown] apply function threw an error",m)}if(Ny.length)for(const h of Ny)if(Array.isArray(h)){const[m,...g]=h;typeof m=="function"&&n.use(m,...g)}else typeof h=="function"&&n.use(h);n.use(fye),n.use(Bde),n.use(Rde);const r=Yde,l=r.default??r;n.use(l),n.use(Dde),n.use(Fde),n.core.ruler.after("block","mark_fence_closed",h=>{const m=h,g=m.src,y=!!m.env?.__markstreamFinal,k=g.split(/\r?\n/);for(const v of m.tokens){if(v.type!=="fence"||!v.map||!v.markup)continue;const C=v.map[0],w=v.map[1],M=v.markup,L=M[0],E=M.length,S=k[Math.max(0,w-1)]??"";let x=0;for(;xC+1&&A>=E&&T===S.length,O=v;O.meta=O.meta??{},O.meta.unclosed=!I,O.meta.closed=!!I}}),n.renderer.rules.fence=(h,m)=>{const g=h[m],y=String(g.info??"").trim(),k=String(g.content??""),v=btoa(unescape(encodeURIComponent(k))),C=$ye(y),w=f8(C),M=zye(`editor-${e}-${m}-${C}`),L=f8(s("common.copy"));return`
        -
        - ${f8(C.toUpperCase())} - -
        -
        -
        `};const a=/^\[(\d+)\]/,u=/^\[([^\]\n]+)\]/,c=h=>{if(!h.startsWith("["))return!1;const m=u.exec(h);if(!m)return h!=="["&&!/^\[\d+$/.test(h);const g=String(m[1]??"");return h.slice(m[0].length).startsWith("(")?!1:!/^\d+$/.test(g)},d=(h,m)=>{const g=h;if(g.src[g.pos]!=="[")return!1;const y=a.exec(g.src.slice(g.pos));if(!y)return!1;const k=g.src.slice(Math.max(0,g.pos-120),g.pos);if(/"[^"\n]{1,80}"\s*:\s*$/.test(k))return!1;const v=g.src.slice(g.pos+y[0].length);if(v.startsWith("](")||v.startsWith("(")||c(v))return!1;if(!m){const C=y[1],w=g.push("reference","span",0);w.content=C,w.markup=y[0],w.raw=y[0]}return g.pos+=y[0].length,!0};n.inline.ruler.before("escape","reference",d),n.renderer.rules.reference=(h,m)=>{const y=String(h[m].content??"");return`${y}`};const f=n.use.bind(n);return n.use=((...h)=>(i.__markstreamHasCustomParserExtensions=!0,f(...h))),n}const jye="modulepreload",Hye=function(e){return"/"+e},EN={},qo=function(t,n,i){let o=Promise.resolve();if(n&&n.length>0){let r=function(u){return Promise.all(u.map(c=>Promise.resolve(c).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),a=l?.nonce||l?.getAttribute("nonce");o=r(n.map(u=>{if(u=Hye(u),u in EN)return;EN[u]=!0;const c=u.endsWith(".css"),d=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${d}`))return;const f=document.createElement("link");if(f.rel=c?"stylesheet":jye,c||(f.as="script"),f.crossOrigin="",f.href=u,a&&f.setAttribute("nonce",a),document.head.appendChild(f),c)return new Promise((h,m)=>{f.addEventListener("load",h),f.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${u}`)))})}))}function s(r){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=r,window.dispatchEvent(l),!l.defaultPrevented)throw r}return o.then(r=>{for(const l of r||[])l.status==="rejected"&&s(l.reason);return t().catch(s)})};function Wye({nextContent:e,previousContent:t,typewriterEnabled:n}){return n?e===t?{settledContent:e,streamedDelta:"",appended:!1}:t&&e.startsWith(t)&&e.length>t.length?{settledContent:t,streamedDelta:e.slice(t.length),appended:!0}:{settledContent:e,streamedDelta:"",appended:!1}:{settledContent:e,streamedDelta:"",appended:!1}}function lq({nextContent:e,persistedContent:t,currentState:n,typewriterEnabled:i,streamRenderVersionChanged:o=!1}){const s=`${n.settledContent}${n.streamedDelta}`;return i?n.streamedDelta&&s===e?o?{settledContent:s,streamedDelta:"",appended:!1}:{settledContent:n.settledContent,streamedDelta:n.streamedDelta,appended:!1}:Wye({nextContent:e,previousContent:t??s,typewriterEnabled:i}):{settledContent:e,streamedDelta:"",appended:!1}}const qye={plain:"plaintext",text:"plaintext",txt:"plaintext",js:"javascript",mjs:"javascript",cjs:"javascript",ts:"typescript",mts:"typescript",cts:"typescript",golang:"go",py:"python",rb:"ruby",rs:"rust",kt:"kotlin",kts:"kotlin",md:"markdown",yml:"yaml",sh:"shellscript",bash:"shellscript",zsh:"shellscript",shell:"shellscript",shellscript:"shellscript",ps:"powershell",ps1:"powershell",pwsh:"powershell","c++":"cpp","c#":"csharp",cs:"csharp",objc:"objective-c",objectivec:"objective-c","objective-c":"objective-c",objectivecpp:"objective-cpp","objective-c++":"objective-cpp","objective-cpp":"objective-cpp"};function Uye(e){const t=String(e??"").trim();if(!t)return"";const[n=""]=t.split(/\s+/);return n.split(":")[0]?.trim().toLowerCase()??""}function aq(e){const t=Uye(e);return qye[t]??t}function Vye(e){if(!Array.isArray(e))return;const t=e.filter(i=>typeof i=="string").map(i=>aq(i)).filter(Boolean),n=Array.from(new Set(t)).sort();return n.length>0?n:void 0}function Kye(e){if(!Array.isArray(e))return;const t=[],n=new Set;for(const i of e){if(typeof i!="string")continue;const o=i.trim();!o||n.has(o)||(n.add(o),t.push(o))}return t.length>0?t:void 0}function Zye(e){return Kye(e)?.join("\0")??""}function Gye(e,t){return`${Zye(e)}\0\0${Vye(t)?.join("\0")??""}`}function a1(e,t,n=1){const i=Number(e);return Number.isFinite(i)?Math.max(n,i):t}function LN(e,t){const n=Number(e);return Number.isFinite(n)?Math.max(0,n):t}var Qye=class{constructor(e={},t){this.source="",this.visible="",this.done=!1,this.paused=!1,this.listeners=new Set,this.rafId=0,this.startedAt=0,this.lastTick=0,this.charBudget=0,this.hasStarted=!1,this.destroyed=!1,this.getSnapshot=()=>({source:this.source,visible:this.visible,done:this.done,paused:this.paused,pendingChars:this.pendingChars,caughtUp:this.caughtUp,final:this.final}),this.subscribe=d=>this.destroyed?()=>{}:(this.listeners.add(d),()=>{this.listeners.delete(d)}),this.enqueue=d=>{if(this.destroyed||!d)return;this.done&&(this.done=!1);const f=this.source.length>0,h=this.pendingChars<=0;if(this.source+=d,h){const m=NN();this.startedAt=f&&this.hasStarted?m-this.normalizedStartDelayMs:m,this.lastTick=m,this.charBudget=0}this.hasStarted=!0,this.emit(),this.ensureLoop()},this.finish=(d={})=>{if(!this.destroyed){if(this.done=!0,d.flush??this.flushOnFinish){this.visible=this.source,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.cancelLoop(),this.emit();return}this.emit(),this.ensureLoop()}},this.flush=()=>{this.destroyed||(this.visible=this.source,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.cancelLoop(),this.emit())},this.reset=(d="")=>{this.destroyed||(this.cancelLoop(),this.source=d,this.visible=d,this.done=!1,this.paused=!1,this.hasStarted=!1,this.startedAt=0,this.lastTick=0,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.emit())},this.pause=()=>{this.destroyed||this.paused||(this.paused=!0,this.cancelLoop(),this.emit())},this.resume=()=>{if(this.destroyed||!this.paused)return;this.paused=!1;const d=NN();this.lastTick=d,this.startedAt||=d,this.emit(),this.ensureLoop()},this.destroy=()=>{this.destroyed||(this.destroyed=!0,this.cancelLoop(),this.listeners.clear())},this.dispose=()=>{this.destroy()},this.tick=d=>{if(this.rafId=0,this.destroyed||this.paused)return;if(this.pendingChars<=0){this.startedAt=0,this.lastTick=0,this.charBudget=0,this.currentCps=this.minCharsPerSecond;return}if(d-this.startedAtthis.normalizedCatchUpThreshold?this.normalizedCatchUpLatencyMs:this.normalizedTargetLatencyMs,y=e9e(m/Math.max(.001,g/1e3),this.minCharsPerSecond,this.maxCharsPerSecond);if(this.currentCps+=(y-this.currentCps)*.2,this.charBudget+=this.currentCps*(h/1e3),this.charBudget<1){this.ensureLoop();return}const k=Math.min(Math.floor(this.charBudget),this.maxCharsPerCommit),v=Xye(this.source.slice(this.visible.length),k,this.segmenter);v.text&&(this.visible+=v.text,this.charBudget=Math.max(0,this.charBudget-v.graphemeCount),this.emit()),this.ensureLoop()};const{minCharsPerSecond:n=40,maxCharsPerSecond:i=1e3,targetLatencyMs:o=900,catchUpLatencyMs:s=350,catchUpThreshold:r=600,maxCommitFps:l=30,startDelayMs:a=80,maxCharsPerCommit:u=80,flushOnFinish:c=!1}=e;this.minCharsPerSecond=a1(n,40,1),this.maxCharsPerSecond=Math.max(this.minCharsPerSecond,a1(i,1e3,1)),this.normalizedTargetLatencyMs=a1(o,900,1),this.normalizedCatchUpLatencyMs=a1(s,350,1),this.normalizedCatchUpThreshold=LN(r,600),this.normalizedStartDelayMs=LN(a,80),this.maxCommitFps=Math.trunc(a1(l,30,1)),this.maxCharsPerCommit=Math.trunc(a1(u,80,1)),this.flushOnFinish=c,this.segmenter=Jye(),t&&this.listeners.add(t),this.currentCps=this.minCharsPerSecond}get pendingChars(){return Math.max(0,this.source.length-this.visible.length)}get caughtUp(){return this.pendingChars===0}get final(){return this.done&&this.caughtUp}ensureLoop(){if(!(this.destroyed||this.rafId||this.paused||this.pendingChars<=0)){if(typeof requestAnimationFrame!="function"){this.flush();return}this.rafId=requestAnimationFrame(this.tick)}}cancelLoop(){this.rafId&&(typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(this.rafId),this.rafId=0)}emit(){if(!this.destroyed)for(const e of this.listeners)e()}};function Yye(e={},t){const n=new Qye(e,t);return{getSnapshot:n.getSnapshot,subscribe:n.subscribe,enqueue:n.enqueue,finish:n.finish,flush:n.flush,reset:n.reset,pause:n.pause,resume:n.resume,destroy:n.destroy,dispose:n.dispose}}function Jye(){if(typeof Intl>"u")return null;const e=Intl.Segmenter;return e?new e(void 0,{granularity:"grapheme"}):null}function Xye(e,t,n){if(!e||t<=0)return{text:"",graphemeCount:0};if(!n){const s=Array.from(e).slice(0,t);return{text:s.join(""),graphemeCount:s.length}}let i="",o=0;for(const s of n.segment(e)){if(o>=t)break;i+=s.segment,o++}return{text:i,graphemeCount:o}}function NN(){return typeof performance<"u"?performance.now():Date.now()}function e9e(e,t,n){return Math.min(n,Math.max(t,e))}var t9e=(e,t,n)=>new Promise((i,o)=>{var s=a=>{try{l(n.next(a))}catch(u){o(u)}},r=a=>{try{l(n.throw(a))}catch(u){o(u)}},l=a=>a.done?i(a.value):Promise.resolve(a.value).then(s,r);l((n=n.apply(e,t)).next())});const MA=Symbol.for("markstream-vue:node-lifecycle");function O8t(){}const Ox=new Map;let uq="material";const R1=new Map,FN=new Map;let TA=null;function n9e(e){Ox.set(e.id,e)}function i9e(e){const t=Ox.get(uq);if(!t)return;const n=t.core[e];if(n)return n;const i=R1.get(t.id);if(i){const o=i[e];if(o)return o}t.loadExtended&&!R1.has(t.id)&&s9e(t)}function o9e(){var e,t;return(t=(e=Ox.get(uq))==null?void 0:e.fallback)!=null?t:""}function s9e(e){return t9e(this,null,function*(){var t,n,i;if(R1.has(e.id))return(t=R1.get(e.id))!=null?t:null;let o=FN.get(e.id);return o||(o=((i=(n=e.loadExtended)==null?void 0:n.call(e))!=null?i:Promise.resolve(null)).then(s=>(R1.set(e.id,s),TA?.(),s)).catch(()=>(R1.set(e.id,null),null)),FN.set(e.id,o)),o})}const DN='',RN='',r9e={id:"material",core:{"":RN,plain:'',text:RN,javascript:'',typescript:'',jsx:'',tsx:'',html:'',css:'',scss:'',json:'',python:'',ruby:'',go:'',java:'',kotlin:'',c:'',cpp:'',cs:DN,csharp:DN,php:'',shell:'',powershell:'',sql:'',yaml:'',markdown:'',xml:'',rust:'',vue:'',mermaid:''},fallback:'',loadExtended:()=>qo(()=>import("./extended-p72mFE2C.js"),[]).then(e=>e.materialExtendedMap)},l9e=_u(0);TA=()=>{l9e.value++},n9e(r9e);const a9e={"":"",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"};function U4(e){var t;const n=(function(i){if(!i)return"";const o=i.trim();if(!o)return"";const[s]=o.split(/\s+/),[r]=s.split(":");return r.toLowerCase()})(e);return(t=a9e[n])!=null?t:n}function P8t(e){const t=U4(e);if(!t)return"plaintext";switch(t){case"plain":return"plaintext";case"jsx":return"javascript";case"tsx":return"typescript";case"objectivec":return"objective-c";case"objectivecpp":return"objective-cpp";default:return t}}function B8t(e){return i9e(U4(e))||o9e()}const ON={js:"JavaScript",javascript:"JavaScript",ts:"TypeScript",jsx:"JSX",tsx:"TSX",html:"HTML",css:"CSS",scss:"SCSS",json:"JSON",py:"Python",python:"Python",rb:"Ruby",go:"Go",java:"Java",c:"C",cpp:"C++",cs:"C#",csharp:"C#",php:"PHP",sh:"Shell",bash:"Bash",sql:"SQL",yaml:"YAML",md:"Markdown",d2:"D2",d2lang:"D2","":"Plain Text",plain:"Plain Text"};var V4=(e,t,n)=>new Promise((i,o)=>{var s=a=>{try{l(n.next(a))}catch(u){o(u)}},r=a=>{try{l(n.throw(a))}catch(u){o(u)}},l=a=>a.done?i(a.value):Promise.resolve(a.value).then(s,r);l((n=n.apply(e,t)).next())});let Zr=null,Hh=!1,Wh=null,K4=Bx;function g2(e){var t;const n=(t=e?.default)!=null?t:e;return n&&typeof n.renderToString=="function"?n:null}function Px(){try{const e=globalThis;return g2(e?.katex)}catch{return null}}function Bx(){return V4(null,null,function*(){const e=Px();if(e)return e;const t=yield qo(()=>import("./katex-DnlPpQZa.js"),[]);try{yield qo(()=>import("./mhchem-DtR62fUK.js"),__vite__mapDeps([0,1]))}catch{}return g2(t)})}function cq(e){const t=Promise.resolve(e).then(n=>{var i;return Wh===t&&n?(Zr=(i=g2(n))!=null?i:n,Zr):null}).catch(()=>null).finally(()=>{Wh===t&&(Wh=null)});return Wh=t,Hh=!0,t}function u9e(e){K4=e,Zr=null,Hh=!1,Wh=null}function c9e(e){u9e(Bx)}function dq(){return typeof K4=="function"}function $8t(){var e;const t=K4;if(!t||t===Bx)return null;if(Zr)return Zr;const n=Px();if(n)return Zr=n,Zr;if(Hh)return null;try{const i=t();return i?typeof i?.then=="function"?(cq(i),null):(Zr=(e=g2(i))!=null?e:i,Zr):null}catch{return null}}function fq(){return V4(this,null,function*(){var e;const t=Px();if(t)return Zr=t,Zr;if(Zr)return Zr;if(Wh)return Wh;if(Hh)return null;const n=K4;if(!n)return Hh=!0,null;try{const i=n();if(typeof i?.then=="function")return cq(i);if(i)return Zr=(e=g2(i))!=null?e:i,Hh=!0,Zr}catch{}return Hh=!0,null})}function hq(e){return e?e.replace(/·/g,"⋅").replace(/℃/g,"°C"):""}let B9=null,Ch=null;const Vr=new Map,Zc=new Map;let Ov=5;const sp=new Set;function q0(){if(Vr.size{const{id:n,html:i,error:o}=t.data,s=Vr.get(n);if(s)if(Vr.delete(n),clearTimeout(s.timeoutId),s.cleanup(),q0(),o)s.aborted||s.reject(new Error(o));else{const{content:r,displayMode:l}=t.data;if(r){const a=`${l?"d":"i"}:${r}`;if(Zc.set(a,i),Zc.size>200){const u=Zc.keys().next().value;Zc.delete(u)}}s.aborted||s.resolve(i)}},B9.onerror=t=>{console.error("[katexWorkerClient] Worker error:",t);for(const[n,i]of Vr.entries())clearTimeout(i.timeoutId),i.cleanup(),i.aborted||i.reject(new Error(`Worker error: ${t.message}`));Vr.clear(),d9e()}}function h9e(e,t=!0,n=2e3,i){return V4(this,null,function*(){performance.now();const o=hq(e);if(!dq()){const a=new Error("KaTeX rendering disabled");return a.name="KaTeXDisabled",a.code="KATEX_DISABLED",Promise.reject(a)}if(Ch)return Promise.reject(Ch);const s=`${t?"d":"i"}:${o}`,r=Zc.get(s);if(r)return q0(),Promise.resolve(r);const l=B9||(Ch=new Error("[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker()."),Ch.name="WorkerInitError",Ch.code="WORKER_INIT_ERROR",null);if(!l)return Promise.reject(Ch);if(Vr.size>=Ov){const a=new Error("Worker busy");return a.name="WorkerBusy",a.code="WORKER_BUSY",a.busy=!0,a.inFlight=Vr.size,a.max=Ov,Promise.reject(a)}return new Promise((a,u)=>{if(i?.aborted){const g=new Error("Aborted");return g.name="AbortError",void u(g)}const c=Math.random().toString(36).slice(2);let d=null;const f=globalThis.setTimeout(()=>{const g=Vr.get(c);if(!g)return;Vr.delete(c),g.cleanup();const y=new Error("Worker render timed out");y.name="WorkerTimeout",y.code="WORKER_TIMEOUT",g.aborted||g.reject(y),q0()},n);d=()=>{const g=Vr.get(c);if(!g||g.aborted)return;g.aborted=!0,g.cleanup();const y=new Error("Aborted");y.name="AbortError",u(y)},i&&i.addEventListener("abort",d,{once:!0});const h=a,m=u;Vr.set(c,{resolve:g=>{h(g)},reject:g=>{m(g)},timeoutId:f,aborted:!1,cleanup:()=>{i&&d&&i.removeEventListener("abort",d),d=null}});try{l.postMessage({id:c,content:o,displayMode:t})}catch(g){const y=Vr.get(c);Vr.delete(c),clearTimeout(f),y?.cleanup(),y?.reject(g),q0()}})})}function z8t(e,t=!0,n){const i=`${t?"d":"i"}:${hq(e)}`;if(Zc.set(i,n),Zc.size>200){const o=Zc.keys().next().value;Zc.delete(o)}}const p9e="WORKER_BUSY";function m9e(e=2e3,t){return Vr.size{let o,s=!1,r=null,l=()=>{};const a=()=>{o&&globalThis.clearTimeout(o),sp.delete(l),t&&r&&t.removeEventListener("abort",r),r=null};l=()=>{s||(s=!0,a(),n())},sp.add(l),o=globalThis.setTimeout(()=>{if(s)return;s=!0,a();const u=new Error("Wait for worker slot timed out");u.name="WorkerBusyTimeout",u.code="WORKER_BUSY_TIMEOUT",i(u)},e),queueMicrotask(()=>q0()),t&&(r=()=>{if(s)return;s=!0,a();const u=new Error("Aborted");u.name="AbortError",i(u)},t.aborted?r():t.addEventListener("abort",r,{once:!0}))})}const Og={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function j8t(e){return V4(this,arguments,function*(t,n=!0,i={}){var o,s,r,l;if(!dq()){const g=new Error("KaTeX rendering disabled");throw g.name="KaTeXDisabled",g.code="KATEX_DISABLED",g}const a=(o=i.timeout)!=null?o:Og.timeout,u=(s=i.waitTimeout)!=null?s:Og.waitTimeout,c=(r=i.backoffMs)!=null?r:Og.backoffMs,d=(l=i.maxRetries)!=null?l:Og.maxRetries,f=Number.isFinite(d)?Math.max(0,Math.min(Math.floor(d),8)):Og.maxRetries,h=i.signal;let m=0;for(;;){if(h?.aborted){const g=new Error("Aborted");throw g.name="AbortError",g}try{return yield h9e(t,n,a,h)}catch(g){if(g?.code!==p9e||m>=f)throw g;if(m++,yield m9e(u,h).catch(()=>{}),h?.aborted){const y=new Error("Aborted");throw y.name="AbortError",y}c>0&&(yield new Promise(y=>globalThis.setTimeout(y,c*m)))}}})}function O1(e){const t=typeof e=="number"?e:Number.parseFloat(String(e??""));return Number.isFinite(t)&&t>0?t:null}function g9e(e){var t;for(const n of e.split(/\r?\n/)){const i=n.trim();if(!i||i.startsWith("%%"))continue;const o=i.match(/^([A-Z][\w-]*)\b/i);return((t=o?.[1])==null?void 0:t.toLowerCase())||""}return""}function cb(e){const t=e.split(/\r?\n/).map(o=>o.trim()).filter(o=>o&&!o.startsWith("%%")),n=Math.max(1,t.length),i=g9e(e);return i==="gantt"?220+28*n:i==="sequencediagram"?180+26*n:i==="classdiagram"||i==="statediagram"||i==="erdiagram"?180+24*n:i==="flowchart"||i==="graph"?170+28*n:200+22*n}function db(e){const t=e.split(/\r?\n/).filter(n=>/^\s*-\s+/.test(n)).length;return t>=3?500:t>0?280+60*t:360}function pq(e,t=360,n=500){return n==null?Math.max(t,e):Math.min(Math.max(t,e),n)}function fb(e,t=360,n=500){return pq(e,t,n)}function hb(e,t=360,n=500){return pq(e,t,n)}var v9e=Object.defineProperty,y9e=Object.defineProperties,k9e=Object.getOwnPropertyDescriptors,PN=Object.getOwnPropertySymbols,b9e=Object.prototype.hasOwnProperty,w9e=Object.prototype.propertyIsEnumerable,BN=(e,t,n)=>t in e?v9e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,mq=(e,t)=>{for(var n in t||(t={}))b9e.call(t,n)&&BN(e,n,t[n]);if(PN)for(var n of PN(t))w9e.call(t,n)&&BN(e,n,t[n]);return e},$N=(e,t,n)=>new Promise((i,o)=>{var s=a=>{try{l(n.next(a))}catch(u){o(u)}},r=a=>{try{l(n.throw(a))}catch(u){o(u)}},l=a=>a.done?i(a.value):Promise.resolve(a.value).then(s,r);l((n=n.apply(e,t)).next())});const pb=()=>qo(()=>import("./mermaid.core-WW7RuneT.js").then(e=>e.bp),__vite__mapDeps([2,3]));let Fc=null,P1=pb,u0=null,EA=!1,LA=!1,c0=0;function C9e(e){P1=e,c0++,Fc=null,u0=null,EA=!1,LA=!1}function A9e(e){C9e(pb)}function zN(){return typeof P1=="function"}function jN(e){if(!e)return e;const t=e&&e.default?e.default:e;if(t&&(typeof t.render=="function"||typeof t.parse=="function"||typeof t.initialize=="function"))return t;if(t&&t.mermaidAPI&&(typeof t.mermaidAPI.render=="function"||typeof t.mermaidAPI.parse=="function")){const o=t.mermaidAPI;return n=mq({},t),i={render:o.render.bind(o),parse:o.parse?o.parse.bind(o):void 0,initialize:s=>typeof t.initialize=="function"?t.initialize(s):o.initialize?o.initialize(s):void 0},y9e(n,k9e(i))}var n,i;return e.mermaid&&typeof e.mermaid.render=="function"?e.mermaid:t}function HN(e){if(e)try{const t=e?.initialize;e.initialize=n=>{const i=mq({suppressErrorRendering:!0},n||{});return typeof t=="function"?t.call(e,i):e?.mermaidAPI&&typeof e.mermaidAPI.initialize=="function"?e.mermaidAPI.initialize(i):void 0}}catch{}}function H8t(){return $N(this,null,function*(){if(Fc)return Fc;const e=(function(){try{const i=globalThis;return jN(i?.mermaid)}catch{return null}})();if(e)return Fc=e,HN(Fc),Fc;const t=P1,n=c0;return t?t===pb&&EA?null:u0||(u0=$N(null,null,function*(){let i;try{i=yield t()}catch(o){if(t===pb)return n===c0&&t===P1&&(EA=!0,(function(s){LA||(LA=!0,console.warn('[markstream-vue] Optional dependency "mermaid" is not installed. Mermaid blocks will render as source.',s))})(o)),null;throw o}finally{n===c0&&t===P1&&(u0=null)}return n!==c0||t!==P1?null:i?(Fc=jN(i),HN(Fc),Fc):null}),u0):null})}let ju=null,Ah=null;const uu=new Map,xh=new Map;function h8(e){for(const t of uu.values())t.reject(e);uu.clear(),xh.clear()}let WN=5,qN=!1;const x9e="WORKER_BUSY",UN="MERMAID_DISABLED";function S9e(e){if(ju&&ju!==e){const n=new Error("Worker replaced");n.code="WORKER_REPLACED",h8(n)}ju=e,Ah=null;const t=e;ju.onmessage=n=>{if(ju!==t)return;const{id:i,ok:o,result:s,error:r}=n.data,l=uu.get(i);l&&(o===!1||r?l.reject(new Error(r||"Unknown error")):l.resolve(s))},ju.onerror=n=>{var i,o;if(ju===t)if(uu.size!==0){try{qN?console.error("[mermaidWorkerClient] Worker error:",n?.message||n):(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker error:",n?.message||n)}catch{}h8(new Error(`Worker error: ${n.message}`))}else(i=console.debug)==null||i.call(console,"[mermaidWorkerClient] Worker error (no pending):",n?.message||n)},ju.onmessageerror=n=>{var i,o;if(ju===t)if(uu.size!==0){try{qN?console.error("[mermaidWorkerClient] Worker messageerror:",n):(o=console.debug)==null||o.call(console,"[mermaidWorkerClient] Worker messageerror:",n)}catch{}h8(new Error("Worker messageerror"))}else(i=console.debug)==null||i.call(console,"[mermaidWorkerClient] Worker messageerror (no pending):",n)}}function gq(e,t,n,i){if(!zN()){const r=new Error("Mermaid rendering disabled");return r.name="MermaidDisabled",r.code=UN,Promise.reject(r)}const o=`${e}\0${t.theme}\0${n}\0${t.code}`;let s=xh.get(o);return s||(s=(function(r,l,a=1400){if(!zN()){const c=new Error("Mermaid rendering disabled");return c.name="MermaidDisabled",c.code=UN,Promise.reject(c)}if(Ah)return Promise.reject(Ah);const u=ju||(Ah=new Error("[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker()."),Ah.name="WorkerInitError",Ah.code="WORKER_INIT_ERROR",null);if(!u)return Promise.reject(Ah);if(uu.size>=WN){const c=new Error("Worker busy");return c.name="WorkerBusy",c.code=x9e,c.inFlight=uu.size,c.max=WN,Promise.reject(c)}return new Promise((c,d)=>{const f=Math.random().toString(36).slice(2);let h,m=!1;const g=()=>{m||(m=!0,h!=null&&globalThis.clearTimeout(h),uu.delete(f))},y={resolve:k=>{g(),c(k)},reject:k=>{g(),d(k)}};uu.set(f,y);try{u.postMessage({id:f,action:r,payload:l})}catch(k){return uu.delete(f),void d(k)}h=globalThis.setTimeout(()=>{const k=new Error("Worker call timed out");k.name="WorkerTimeout",k.code="WORKER_TIMEOUT";const v=uu.get(f);v&&v.reject(k)},a)})})(e,t,n),xh.set(o,s),s.then(()=>{xh.get(o)===s&&xh.delete(o)},()=>{xh.get(o)===s&&xh.delete(o)})),(function(r,l){if(!l)return r;if(l.aborted){const a=new Error("Aborted");return a.name="AbortError",Promise.reject(a)}return new Promise((a,u)=>{let c=()=>{};const d=()=>l.removeEventListener("abort",c);c=()=>{d();const f=new Error("Aborted");f.name="AbortError",u(f)},l.addEventListener("abort",c,{once:!0}),r.then(f=>{d(),a(f)},f=>{d(),u(f)})})})(s,i)}function W8t(e,t,n=1400,i){return gq("canParse",{code:e,theme:t},n,i)}function q8t(e,t,n=1400,i){return gq("findPrefix",{code:e,theme:t},n,i)}var _9e=Object.defineProperty,I9e=Object.defineProperties,M9e=Object.getOwnPropertyDescriptors,VN=Object.getOwnPropertySymbols,T9e=Object.prototype.hasOwnProperty,E9e=Object.prototype.propertyIsEnumerable,KN=(e,t,n)=>t in e?_9e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Bt=(e,t)=>{for(var n in t||(t={}))T9e.call(t,n)&&KN(e,n,t[n]);if(VN)for(var n of VN(t))E9e.call(t,n)&&KN(e,n,t[n]);return e},Dn=(e,t)=>I9e(e,M9e(t)),io=(e,t,n)=>new Promise((i,o)=>{var s=a=>{try{l(n.next(a))}catch(u){o(u)}},r=a=>{try{l(n.throw(a))}catch(u){o(u)}},l=a=>a.done?i(a.value):Promise.resolve(a.value).then(s,r);l((n=n.apply(e,t)).next())});const L9e="__global__",p8="__MARKSTREAM_VUE_CUSTOM_COMPONENTS_STORE__",NA=(()=>{const e=globalThis;if(e[p8])return e[p8];const t={scopedCustomComponents:{},revision:_u(0)};return e[p8]=t,t})(),ZN=NA.revision,N9e=Symbol("markstreamCustomComponents"),F9e=new Set(["text","paragraph","heading","code_block","list","list_item","blockquote","table","table_row","table_cell","definition_list","definition_item","footnote","footnote_reference","footnote_anchor","admonition","hardbreak","link","image","thematic_break","math_inline","math_block","strong","emphasis","strikethrough","highlight","insert","subscript","superscript","emoji","checkbox","checkbox_input","inline_code","html_inline","html_block","reference","mermaid","infographic","d2","vmr_container"]);function v2(e){return F9e.has(String(e).trim().toLowerCase())}function D9e(e){return e.trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase()}function m8(e={}){const t={};for(const[n,i]of Object.entries(e))if(i!=null){t[n]=i;for(const o of new Set([Va(n),Va(D9e(n))]))!o||v2(o)||Object.prototype.hasOwnProperty.call(t,o)||(t[o]=i)}return t}function vs(e){const t=en(N9e,null);return D(()=>{var n;return ZN.value,(function(i,o={}){return ZN.value,Bt(Bt(Bt({},m8(NA.scopedCustomComponents[L9e]||{})),m8(o)),m8((function(s){return s&&NA.scopedCustomComponents[s]||{}})(i)))})(e?.(),(n=t?.value)!=null?n:{})})}const R9e=["aria-label"],O9e={key:0,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",class:"checkbox-icon checkbox-unchecked"},P9e={key:1,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",class:"checkbox-icon checkbox-checked"},Ei=(e,t)=>{const n=e.__vccOpts||e;for(const[i,o]of t)n[i]=o;return n},ra=Ei(ot({__name:"CheckboxNode",props:{node:{}},setup:e=>(t,n)=>(b(),N("span",{class:"checkbox-node",role:"img","aria-label":e.node.checked?"checked":"unchecked"},[e.node.checked?(b(),N("svg",P9e,[...n[1]||(n[1]=[_("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",fill:"currentColor"},null,-1),_("path",{d:"M9 12l2 2 4-4",stroke:"hsl(var(--ms-background))","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):(b(),N("svg",O9e,[...n[0]||(n[0]=[_("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4",stroke:"currentColor","stroke-width":"2"},null,-1)])]))],8,R9e))}),[["__scopeId","data-v-be21ab83"]]);ra.install=e=>{e.component(ra.__name,ra)};const B9e={class:"emoji-node"},Il=Ei(ot({__name:"EmojiNode",props:{node:{}},setup:e=>(t,n)=>(b(),N("span",B9e,B(e.node.name),1))}),[["__scopeId","data-v-de55dc97"]]);Il.install=e=>{e.component(Il.__name,Il)};const $9e=["id"],z9e=["title"],la=Ei(ot({__name:"FootnoteReferenceNode",props:{node:{}},setup(e){const t=`#fnref--${e.node.id}`;function n(){if(typeof document>"u")return;const i=document.querySelector(t);i?i.scrollIntoView({behavior:"smooth"}):console.warn(`Element with href: ${t} not found`)}return(i,o)=>(b(),N("sup",{id:`fnref-${e.node.id}`,class:"footnote-reference",onClick:n},[_("span",{href:t,title:`查看脚注 ${e.node.id}`,class:"footnote-link cursor-pointer"},"["+B(e.node.id)+"]",9,z9e)],8,$9e))}}),[["__scopeId","data-v-c1463a29"]]);la.install=e=>{e.component(la.__name,la)};const vq=(()=>{try{return!1}catch{}return!1})();function g8(e){vq&&console.warn(e)}function GN(e,t="safe",n){return Rx(e,t,n)}function yq(e){return kye(e)}function v8(e){return e===!0?"":e===!1?"false":e==null?null:String(e)}function $x(e,t="safe"){const n=String(e.tag||e.type||"").trim(),i=P9((o=e.attrs)?Array.isArray(o)?o.every(Array.isArray)?o.map(([r,l])=>[String(r),v8(l)]):o.filter(r=>r&&typeof r=="object"&&!Array.isArray(r)&&"name"in r).map(r=>[String(r.name),v8(r.value)]):Object.entries(o).map(([r,l])=>[r,v8(l)]):null,t,n);var o;if(!i)return;const s=yq(W0(i));return Object.keys(s).length>0?s:void 0}function QN(e,t,n=!1){const i=Object.entries(t??{}),o=i.length>0?i.map(([s,r])=>r===""?` ${s}`:` ${s}="${r}"`).join(""):"";return n?`<${e}${o} />`:`<${e}${o}>`}function Pg(e,t){Array.isArray(t)?e.push(...t):t!=null&&e.push(t)}function y8(e,t,n,i,o,s,r=!1){const l=(function(d,f){return nq(d,f)})(e,i);if(f2.has(e.toLowerCase())||!l&&JW(e,s))return null;if(!l&&Dx(e,s))return r?[QN(e,t,!0)]:[QN(e,t),...n,``];const a=Rx(t,s,e),u=a.key,c=u!=null&&u!==""?u:o;if(l){const d=i[e]||i[e.toLowerCase()],f=yq(a);return Fn(d,Dn(Bt({},f),{key:c}),n.length>0?n:void 0)}return Fn(e,Dn(Bt({},a),{innerHTML:void 0,key:c}),n.length>0?n:void 0)}function kq(e,t){return Cye(e,t)}function mb(e,t,n="safe"){if(!e)return[];try{return(function(s,r,l="safe"){let a=0;const u=[],c=[];for(const d of s)if(d.type==="text")(u.length>0?u[u.length-1].children:c).push(d.content);else if(d.type==="self_closing"){const f=y8(d.tagName,d.attrs||{},[],r,"ms-html-"+a++,l,!0);Pg(u.length>0?u[u.length-1].children:c,f)}else if(d.type==="tag_open")u.push({tagName:d.tagName,children:[],attrs:d.attrs,autoKey:"ms-html-"+a++});else if(d.type==="tag_close"){const f=d.tagName.toLowerCase();let h=-1;for(let m=u.length-1;m>=0;m--)if(u[m].tagName.toLowerCase()===f){h=m;break}if(h!==-1)for(;u.length>h;){const m=u.pop(),g=y8(m.tagName,m.attrs||{},m.children,r,m.autoKey,l);u.length>0?Pg(u[u.length-1].children,g):Pg(c,g),m.tagName.toLowerCase()!==f&&u.length>h&&g8(`Auto-closing unclosed tag: <${m.tagName}>`)}else g8(`Ignoring closing tag with no matching opening tag: `)}for(;u.length>0;){const d=u.pop(),f=y8(d.tagName,d.attrs||{},d.children,r,d.autoKey,l);u.length>0?Pg(u[u.length-1].children,f):Pg(c,f),g8(`Auto-closing unclosed tag: <${d.tagName}>`)}return c})(iq(e),t,n)}catch(o){return i=o,vq&&console.error("Failed to parse HTML to VNodes:",i),null}var i}const j9e=["innerHTML"],aa=Ei(ot({__name:"HtmlInlineNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=en("markstreamHtmlPolicy",void 0),i=D(()=>{var l,a;return(a=(l=t.htmlPolicy)!=null?l:n?.value)!=null?a:"safe"}),o=vs(()=>t.customId),s=ot({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),r=D(()=>{const l=t.node.content;if(!l)return{mode:"html",content:""};if(i.value==="escape")return{mode:"html",content:lm(l,i.value)};if(t.node.loading&&!t.node.autoClosed)return{mode:"text",content:l};if(t.node.loading&&t.node.autoClosed){const u=mb(l,o.value,i.value);if(u!==null)return{mode:"dynamic",nodes:u}}if(!kq(l,o.value))return{mode:"html",content:lm(l,i.value)};const a=mb(l,o.value,i.value);return a===null?{mode:"html",content:lm(l,i.value)}:{mode:"dynamic",nodes:a}});return(l,a)=>r.value.mode==="dynamic"?(b(),N("span",{key:0,class:De(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},[V(p(s),{nodes:r.value.nodes},null,8,["nodes"])],2)):r.value.mode==="text"?(b(),N("span",{key:1,class:De(["html-inline-node",{"html-inline-node--loading":t.node.loading}])},B(r.value.content),3)):(b(),N("span",{key:2,class:De(["html-inline-node",{"html-inline-node--loading":t.node.loading}]),innerHTML:r.value.content},null,10,j9e))}}),[["__scopeId","data-v-d17f12b0"]]);aa.install=e=>{e.component(aa.__name,aa)};const H9e={class:"inline-code"},W9e={key:0},Er=Ei(ot({__name:"InlineCodeNode",props:{node:{}},setup(e){const t=e,n=qm(),i=en("markstreamFade",void 0),o=en("markstreamTextStreamState",void 0),s=en("markstreamStreamVersion",void 0),r=D(()=>{const v=n.fade;return v===""||v===!0||v==="true"||v!==!1&&v!=="false"&&void 0}),l=D(()=>typeof r.value=="boolean"?r.value:typeof i?.value!="boolean"||i.value),a=D(()=>{var v;return String((v=t.node.code)!=null?v:"")}),u=D(()=>!l.value),c=D(()=>{var v;const C=(v=n["index-key"])!=null?v:n.indexKey;return C==null||C===""?"":String(C)}),d=q(t.node.code),f=q(""),h=q(0);let m;function g(){m?.(),m=void 0}function y(){g(),f.value&&(d.value=d.value+f.value,f.value="")}ze([()=>t.node.code,c,l],([v])=>{const C=String(v??""),w=c.value,M=lq({nextContent:C,persistedContent:w?o?.get(w):void 0,currentState:{settledContent:d.value,streamedDelta:f.value},typewriterEnabled:l.value});d.value=M.settledContent,f.value=M.streamedDelta,M.appended?(h.value+=1,(function(){if(!f.value||m||!s)return;const L=s.value;m=ze(()=>s.value,E=>{E!==L&&y()},{flush:"sync"})})()):f.value||g(),w&&o?.set(w,C)},{immediate:!0}),cd(g);const k=D(()=>h.value%2==0?"inline-code-stream-delta--a":"inline-code-stream-delta--b");return(v,C)=>(b(),N("code",H9e,[u.value?(b(),N(Le,{key:0},[Be(B(a.value),1)],64)):(b(),N(Le,{key:1},[d.value?(b(),N("span",W9e,B(d.value),1)):X("",!0),f.value?(b(),N("span",{key:1,class:De(["inline-code-stream-delta",[k.value]]),onAnimationend:y},B(f.value),35)):X("",!0)],64))]))}}),[["__scopeId","data-v-4e331c97"]]);Er.install=e=>{e.component(Er.__name,Er)};const FA=q(!1),YN=q(""),JN=q("top"),U0=q(null),V0=q(null),DA=q(null),RA=q(null),XN=q(null);let $9=null,z9=null,OA=0;function bq(){$9&&(clearTimeout($9),$9=null),z9&&(clearTimeout(z9),z9=null)}let Fy=!1,Dy=null,eF=!1;function q9e(e,t,n="top",i=!1,o,s){if(!e)return;const r=++OA;bq();const l=()=>io(null,null,function*(){var a,u;if(yield(function(){return io(this,null,function*(){if(!Fy&&!eF&&typeof document<"u"){Dy!=null||(Dy=io(null,null,function*(){const[{createApp:c,h:d},{default:f}]=yield Promise.all([qo(()=>import("./vue.runtime.esm-bundler-Dz1HMlA6.js"),[]),qo(()=>import("./Tooltip-Da35cfam.js"),[])]),h=document.createElement("div");h.setAttribute("data-singleton-tooltip","1"),document.body.appendChild(h),c({setup:()=>()=>{var m;return d(f,{visible:FA.value,"anchor-el":U0.value,content:YN.value,placement:JN.value,id:V0.value,originX:DA.value,originY:RA.value,isDark:(m=XN.value)!=null?m:void 0})}}).mount(h),Fy=!0}));try{yield Dy}catch(c){Fy=!1,Dy=null,eF=!0,console.warn("[markstream-vue] Failed to mount Tooltip component. Tooltips will be disabled.",c)}}})})(),Fy&&r===OA){V0.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,U0.value=e,YN.value=t,JN.value=n,DA.value=(a=o?.x)!=null?a:null,RA.value=(u=o?.y)!=null?u:null,XN.value=typeof s=="boolean"?s:null,FA.value=!0;try{e.setAttribute("aria-describedby",V0.value)}catch{}}});i?l():$9=setTimeout(l,80)}function U9e(e=!1){OA+=1,bq();const t=()=>{if(U0.value&&V0.value)try{U0.value.removeAttribute("aria-describedby")}catch{}FA.value=!1,U0.value=null,V0.value=null,DA.value=null,RA.value=null};e?t():z9=setTimeout(t,120)}const V9e={"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..."},K9e=Symbol("markstreamI18nFallback");function wq(e,t){var n;return(n=t?.[e])!=null?n:V9e[e]}const PA=(e,t)=>{var n;return(n=wq(e,t))!=null?n:(function(i){return(i.split(".").pop()||i).replace(/[_-]/g," ").replace(/([A-Z])/g," $1").replace(/\s+/g," ").replace(/\b\w/g,o=>o.toUpperCase()).trim()})(e)};function tF(e,t){return{t(n){const i=wq(n,t);if(e.te&&i!=null&&!e.te(n))return PA(n,t);const o=e.t(n);return o===n&&i!=null?PA(n,t):o}}}function Z9e(){const e=(function(){var n,i,o;try{const s=gs(),r=K9e,l=s?.provides,a=(n=s?.appContext)==null?void 0:n.provides;return(o=(i=l?.[r])!=null?i:a?.[r])!=null?o:null}catch{}return null})(),t=(function(){var n,i;try{const o=gs(),s=o?.proxy,r=s?.$t;if(typeof r=="function"){const u=s?.$te;return{t:r.bind(s),te:typeof u=="function"?u.bind(s):void 0}}const l=(i=(n=o?.appContext)==null?void 0:n.config)==null?void 0:i.globalProperties,a=l?.$t;if(typeof a=="function"){const u=l?.$te;return{t:a.bind(l),te:typeof u=="function"?u.bind(l):void 0}}}catch{}return null})();if(t)return tF(t,e);try{const n=globalThis.$vueI18nUse||null;if(n&&typeof n=="function")try{const i=n();if(i&&typeof i.t=="function")return tF({t:i.t.bind(i),te:typeof i.te=="function"?i.te.bind(i):void 0},e)}catch{}}catch{}return{t:n=>PA(n,e)}}const Cq=Symbol("ViewportPriority"),Aq=Symbol("ViewportPriorityOptions"),xq=Symbol("OffscreenHeavyNodeDeferral"),G9e=D(()=>!1),gp="400px";function zx(){return en(Aq,void 0)}function jx(){return en(xq,G9e)}function Q9e(e,t){var n,i;const o=typeof window<"u"&&typeof document<"u",s=typeof t=="boolean"?q(t):t,r=o?(n=window.requestIdleCallback)!=null?n:E=>window.setTimeout(()=>E({didTimeout:!0,timeRemaining:()=>0}),16):null,l=o?(i=window.cancelIdleCallback)!=null?i:E=>window.clearTimeout(E):null,a=new WeakMap;let u=1;const c=new Map,d=new Map,f=new Set;let h=null,m=null;function g(E){if(!E)return"viewport";let S=a.get(E);return S||(S=u++,a.set(E,S)),String(S)}function y(){if(h!=null){try{l?.(h)}catch{}h=null}}function k(E){if(E){const S=c.get(E);if(S&&!S.targets.size){try{S.io.disconnect()}catch{}c.delete(E)}}d.size||f.size||y()}function v(E){const S=d.get(E);if(!S)return;const x=c.get(S.bucketKey);if(!S.visible.value){S.visible.value=!0;try{S.resolve()}catch{}}try{x?.io.unobserve(E)}catch{}x?.targets.delete(E),d.delete(E),f.delete(E),k(S.bucketKey)}function C(){window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&r&&h==null&&f.size&&(h=r(()=>{h=null;const E=f.values().next().value;E&&(f.delete(E),v(E),f.size&&C())},{timeout:1200}))}function w(E,S){if(!o||typeof IntersectionObserver>"u")return null;const x=(function(R,F){var P,z,W;return{root:(P=e?.(R??null))!=null?P:null,rootMargin:(z=F?.rootMargin)!=null?z:gp,threshold:(W=F?.threshold)!=null?W:0}})(E,S),A=[g((T=x).root),T.rootMargin,T.threshold].join("\0");var T;const I=c.get(A);if(I)return{key:A,bucket:I};let O;try{O=new IntersectionObserver(R=>{for(const F of R)(F.isIntersecting||F.intersectionRatio>0)&&v(F.target)},{root:x.root,rootMargin:x.rootMargin,threshold:x.threshold})}catch{return null}const H={io:O,targets:new Map};return c.set(A,H),{key:A,bucket:H}}function M(){if(o&&s.value)for(const[E,S]of Array.from(d.entries())){const x=w(E,S.opts);if(!x){v(E);continue}if(x.key===S.bucketKey)continue;const A=S.bucketKey,T=c.get(A);try{T?.io.unobserve(E)}catch{}T?.targets.delete(E),S.bucketKey=x.key,x.bucket.targets.set(E,S),x.bucket.io.observe(E),k(A)}}ze(s,E=>{if(!E){for(const S of Array.from(d.keys()))v(S);y()}},{flush:"sync"});const L=(E,S)=>{const x=q(!1);let A,T=!1;const I=new Promise(F=>{A=()=>{T||(T=!0,F())}}),O=()=>{const F=d.get(E);if(!F)return f.delete(E),void k();const P=c.get(F.bucketKey);try{P?.io.unobserve(E)}catch{}P?.targets.delete(E),d.delete(E),f.delete(E),k(F.bucketKey)};if(!o||!s.value)return x.value=!0,A(),{isVisible:x,whenVisible:I,destroy:O};const H=w(E,S);if(!H)return x.value=!0,A(),{isVisible:x,whenVisible:I,destroy:O};const R={resolve:A,visible:x,bucketKey:H.key,opts:S};return d.set(E,R),H.bucket.targets.set(E,R),H.bucket.io.observe(E),o&&m==null&&(m=window.requestAnimationFrame(()=>{m=null,M()})),S?.allowIdle!==!1&&(f.add(E),C()),{isVisible:x,whenVisible:I,destroy:O}};return L.refresh=M,Gn(Cq,L),L}function Hx(){var e,t;const n=en(Cq,void 0);if(n)return n;const i=new WeakMap,o=new Map,s=new Set;let r=null;const l=typeof window<"u"?(e=window.requestIdleCallback)!=null?e:h=>window.setTimeout(()=>h({didTimeout:!0,timeRemaining:()=>0}),16):null,a=typeof window<"u"?(t=window.cancelIdleCallback)!=null?t:h=>window.clearTimeout(h):null,u=()=>{if(r!=null){try{a?.(r)}catch{}r=null}},c=h=>{if(!h)return;const m=o.get(h);if(m&&!m.targets.size){try{m.io.disconnect()}catch{}o.delete(h)}},d=h=>{const m=i.get(h);if(!m)return;const g=o.get(m.bucketKey);if(!m.visible.value){m.visible.value=!0;try{m.resolve()}catch{}}try{g?.io.unobserve(h)}catch{}i.delete(h),g?.targets.delete(h),s.delete(h),c(m.bucketKey),s.size||u()},f=()=>{window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__!==!0&&l&&r==null&&s.size&&(r=l(()=>{r=null;const h=s.values().next().value;h&&(s.delete(h),d(h),s.size&&f())},{timeout:1200}))};return(h,m)=>{const g=q(!1);let y,k=!1;const v=new Promise(M=>{y=()=>{k||(k=!0,M())}}),C=()=>{const M=i.get(h);if(!M)return s.delete(h),void(s.size||u());const L=o.get(M.bucketKey);try{L?.io.unobserve(h)}catch{}i.delete(h),L?.targets.delete(h),s.delete(h),c(M.bucketKey),s.size||u()},w=(M=>{var L,E;if(typeof window>"u"||typeof IntersectionObserver>"u")return null;const S=(O=>{var H,R;return[(H=O?.rootMargin)!=null?H:gp,(R=O?.threshold)!=null?R:0].join("\0")})(M),x=o.get(S);if(x)return{key:S,bucket:x};const A=(L=M?.rootMargin)!=null?L:gp;let T;try{T=new IntersectionObserver(O=>{for(const H of O)(H.isIntersecting||H.intersectionRatio>0)&&d(H.target)},{root:null,rootMargin:A,threshold:(E=M?.threshold)!=null?E:0})}catch{return null}const I={io:T,targets:new Set};return o.set(S,I),{key:S,bucket:I}})(m);return w?(i.set(h,{resolve:y,visible:g,bucketKey:w.key}),w.bucket.targets.add(h),w.bucket.io.observe(h),m?.allowIdle!==!1&&(s.add(h),f()),{isVisible:g,whenVisible:v,destroy:C}):(g.value=!0,y(),{isVisible:g,whenVisible:v,destroy:C})}}function Y9e(e,t){var n,i;const o=(i=(n=e.indexKey)!=null?n:t["index-key"])!=null?i:t.indexKey;return o==null||o===""?"":String(o)}const J9e=["data-markstream-viewport-pending"],X9e=["src","alt","title","loading","fetchpriority","decoding","tabindex","aria-label"],eke={key:1,class:"image-placeholder"},tke={key:1,class:"image-node__raw-text"},nke={key:2,class:"image-shimmer-overlay"},ike={key:1,class:"image-node__raw-text"},oke={key:3,class:"image-error"},df=Ei(ot({__name:"ImageNode",props:{node:{},fallbackSrc:{default:""},lazy:{type:Boolean,default:!1},usePlaceholder:{type:Boolean,default:!0}},emits:["load","error","click"],setup(e,{emit:t}){var n,i,o;const s=e,r=t,l=q(!1),a=q(!1),u=q(""),c=q("primary"),d=q(null),f=qm(),h=en(MA,null),m=Hx(),g=zx(),y=jx(),k=D(()=>AL(s.node.src)),v=D(()=>AL(s.fallbackSrc)),C=(o=(i=(n=gs())==null?void 0:n.vnode.el)==null?void 0:i.querySelector)==null?void 0:o.call(i,"img"),w=typeof window<"u"&&C?.getAttribute("src")===(k.value||v.value),M=q(typeof window>"u"||w||!y.value),L=_u(null);let E="",S=null;const x=D(()=>u.value),A=D(()=>!s.lazy),T=D(()=>typeof window<"u"&&y.value&&!w),I=D(()=>!T.value||M.value),O=D(()=>I.value?x.value:""),H=D(()=>{var Z,se;return(se=(Z=g?.value.heavyBlockMargin)!=null?Z:g?.value.rootMargin)!=null?se:gp}),R=D(()=>!s.node.loading&&c.value!=="failed"&&u.value.length>0),F=D(()=>c.value==="failed"),P=D(()=>(!A.value||T.value&&!M.value)&&!l.value&&!a.value&&c.value!=="failed"&&u.value.length>0),z=D(()=>Y9e(s,f));function W(Z=z.value){Z&&d.value&&h?.reportHeight(Z,d.value.offsetHeight)}function $(Z=z.value){Z&&ft(()=>{W(Z)})}function K(){S&&(clearTimeout(S),S=null)}function ne(){const Z=z.value;Z&&E!==Z&&(E&&h?.markSettled(E),K(),E=Z,h?.markPending(Z),typeof window<"u"&&(S=window.setTimeout(()=>{E===Z&&($(Z),G())},8e3)))}function G(){return io(this,null,function*(){const Z=E;Z&&(K(),E="",yield ft(),W(Z),h?.markSettled(Z))})}function te(){if(c.value==="primary"&&v.value&&v.value!==u.value)return c.value="fallback",u.value=v.value,l.value=!1,a.value=!1,void $();c.value="failed",a.value=!0,r("error",u.value),$()}function le(){l.value=!0,a.value=!1,r("load",x.value),$()}function ie(Z){Z.preventDefault(),l.value&&!a.value&&r("click",[Z,x.value])}const{t:_e}=Z9e();return ze([k,v,()=>s.node.loading],()=>(l.value=!1,a.value=!1,s.node.loading||k.value?(u.value=k.value,void(c.value="primary")):v.value?(u.value=v.value,void(c.value="fallback")):(u.value="",c.value="failed",void(a.value=!0))),{immediate:!0}),typeof window<"u"&&ze([d,T],([Z,se],he,Y)=>{var J;if((J=L.value)==null||J.destroy(),L.value=null,!se||M.value)return void(M.value=!0);if(!Z)return void(M.value=!1);let U=!0;const Q=m(Z,{rootMargin:H.value,allowIdle:!1});L.value=Q,M.value=Q.isVisible.value,Q.whenVisible.then(()=>{U&&L.value===Q&&(M.value=!0)}),Y(()=>{U=!1,Q.destroy(),L.value===Q&&(L.value=null)})},{immediate:!0}),ze([R,l,a,x,()=>s.lazy,I],([Z,se,he,Y,J,U])=>Z&&Y&&!he&&U?se?(G(),void $()):J?(ne(),void $()):void(se||he||ne()):(G(),void $()),{flush:"post",immediate:!0}),ii(()=>{var Z;(Z=L.value)==null||Z.destroy(),L.value=null,(function(){const se=E;se&&(K(),E="",h?.markSettled(se))})()}),(Z,se)=>{var he,Y,J,U,Q;return b(),N("span",{ref_key:"rootRef",ref:d,class:"image-node-container","data-markstream-viewport-pending":T.value&&!M.value?"true":void 0},[R.value?(b(),N("img",{key:0,src:O.value||void 0,alt:String((Y=(he=s.node.alt)!=null?he:s.node.title)!=null?Y:""),title:String((U=(J=s.node.title)!=null?J:s.node.alt)!=null?U:""),class:De(["image-node__img",{"is-loading":!A.value&&!l.value,"is-loaded":A.value||l.value,"has-natural-size":l.value,"cursor-pointer":l.value}]),loading:s.lazy?"lazy":void 0,fetchpriority:A.value?"high":void 0,decoding:A.value?"sync":"async",tabindex:l.value?0:-1,"aria-label":(Q=s.node.alt)!=null?Q:p(_e)("image.preview"),onError:te,onLoad:le,onClick:ie},null,42,X9e)):X("",!0),e.node.loading&&!a.value?(b(),N("span",eke,[s.usePlaceholder?Hn(Z.$slots,"placeholder",{key:0,node:s.node,displaySrc:x.value,imageLoaded:l.value,hasError:a.value,fallbackSrc:s.fallbackSrc,lazy:s.lazy},()=>[se[0]||(se[0]=_("span",{class:"image-shimmer"},null,-1))],!0):(b(),N("span",tke,B(e.node.raw),1))])):X("",!0),P.value&&!e.node.loading?(b(),N("span",nke,[s.usePlaceholder?Hn(Z.$slots,"placeholder",{key:0,node:s.node,displaySrc:x.value,imageLoaded:l.value,hasError:a.value,fallbackSrc:s.fallbackSrc,lazy:s.lazy},()=>[se[1]||(se[1]=_("span",{class:"image-shimmer"},null,-1))],!0):(b(),N("span",ike,B(e.node.raw),1))])):X("",!0),F.value?(b(),N("span",oke,[Hn(Z.$slots,"error",{node:s.node,displaySrc:x.value,imageLoaded:l.value,hasError:a.value,fallbackSrc:s.fallbackSrc,lazy:s.lazy},()=>[se[2]||(se[2]=_("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24"},[_("path",{fill:"currentColor",d:"M2 2h20v10h-2V4H4v9.586l5-5L14.414 14L13 15.414l-4-4l-5 5V20h8v2H2zm13.547 5a1 1 0 1 0 0 2a1 1 0 0 0 0-2m-3 1a3 3 0 1 1 6 0a3 3 0 0 1-6 0m3.625 6.757L19 17.586l2.828-2.829l1.415 1.415L20.414 19l2.829 2.828l-1.415 1.415L19 20.414l-2.828 2.829l-1.415-1.415L17.586 19l-2.829-2.828z"})],-1)),_("span",null,B(p(_e)("image.loadError")),1)],!0)])):X("",!0)],8,J9e)}}}),[["__scopeId","data-v-046e82ac"]]);df.install=e=>{e.component(df.__name,df)};const ske={key:2},yc=ot({__name:"NodeChildRenderer",props:{node:{},components:{},customId:{},indexKey:{},fallbackToText:{type:Boolean,default:!1}},setup(e){const t=e,n=vs(()=>t.customId),i=en("markstreamHtmlPolicy",void 0),o=en("markstreamNestedRendererProps",void 0),s=D(()=>{var m;return(m=i?.value)!=null?m:"safe"}),r=D(()=>{var m,g;const y=(m=o?.value)!=null?m:{};return Dn(Bt({},y),{customId:(g=t.customId)!=null?g:y.customId,htmlPolicy:s.value})}),l=Xu({loader:()=>Promise.resolve().then(()=>Xx),suspensible:!1}),a=D(()=>t.components[String(t.node.type)]),u=D(()=>!!(a.value&&n.value[t.node.type]&&!v2(String(t.node.type)))),c=D(()=>u.value?$x(t.node,s.value):void 0),d=D(()=>Array.isArray(t.node.children)&&t.node.children.length>0),f=D(()=>{var m;return String((m=t.node.content)!=null?m:"")}),h=D(()=>{var m,g;return String((g=(m=t.node.content)!=null?m:t.node.raw)!=null?g:"")});return(m,g)=>a.value&&u.value?(b(),fe(To(a.value),ci({key:0},c.value,{node:e.node,loading:e.node.loading,"index-key":e.indexKey,"custom-id":e.customId,"is-dark":r.value.isDark}),{default:de(()=>[d.value?(b(),fe(p(l),ci({key:0},r.value,{nodes:e.node.children,"index-key":e.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):f.value?(b(),fe(p(l),ci({key:1},r.value,{content:f.value,final:!e.node.loading,"index-key":`${e.indexKey||"child"}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):X("",!0)]),_:1},16,["node","loading","index-key","custom-id","is-dark"])):a.value?(b(),fe(To(a.value),{key:1,node:e.node,"custom-id":e.customId,"index-key":e.indexKey},null,8,["node","custom-id","index-key"])):e.fallbackToText?(b(),N("span",ske,B(h.value),1)):X("",!0)}}),nF=Object.freeze({enabled:!0,contextLineCount:2,minimumLineCount:4,revealLineCount:5});function rke(e){var t;if(typeof e=="boolean")return e;if(e&&typeof e=="object"){const n=e;return Dn(Bt(Bt({},nF),n),{enabled:(t=n.enabled)==null||t})}return Bt({},nF)}function Wx(e,t){if(e.renderSideBySide===!1)return!0;if(e.useInlineViewWhenSpaceIsLimited!==!0)return!1;const n=e.renderSideBySideInlineBreakpoint,i=typeof n=="number"&&Number.isFinite(n)?n:900;return t>0&&t<=i}function Sq(e){var t,n;const i=(n=(t=String(e??"").split(/\r?\n/,1)[0])==null?void 0:t.trim())!=null?n:"";if(i.length<3)return"";const o=i[0];if(o!=="`"&&o!=="~"||i[1]!==o||i[2]!==o)return"";let s=3;for(;i[s]===o;)s+=1;return i.slice(s).trim()}function iF(e){var t;return((t=String(e??"").trim().split(/\s+/,1)[0])!=null?t:"")==="diff"}function lke(e){var t;return e.diff===!0||iF(e.language)||iF(Sq(String((t=e.raw)!=null?t:"")))}function ake(e,t,n){const i=(function(o){const s=Sq(o);if(!s)return"";const r=s.split(/\s+/).filter(Boolean);if(!r.length)return"";const l=r[0]==="diff"?r.slice(1):r;for(const a of l){const u=a.includes(":")?a.slice(a.indexOf(":")+1):a;if(u&&/[./\\-]/.test(u))return u}return""})(e);return{title:i||t,caption:i?n?`Diff / ${t}`:t:""}}const uke=["aria-busy","aria-label","data-language","data-markstream-line-numbers"],cke={key:0,translate:"no",class:"markstream-pre__diff-code"},dke={class:"markstream-pre__diff-pane-content"},fke={class:"markstream-pre__diff-number","aria-hidden":"true"},hke={class:"markstream-pre__diff-content"},pke={class:"markstream-pre__diff-content-inner"},mke={key:0,class:"markstream-pre__line-numbers","aria-hidden":"true"},gke=["textContent"],vke=["textContent"],bl=ot({__name:"PreCodeNode",props:{node:{},loading:{type:Boolean},showLineNumbers:{type:Boolean},diffInline:{type:Boolean},diffHideUnchangedRegions:{type:[Boolean,Object]},reservedHeightPx:{}},setup(e){const t=e;function n(ie,_e){const Z=String(ie??"");return _e?Z:Z.replace(/\r\n$|\n$|\r$/,"")}const i=D(()=>{var ie,_e,Z;const se=String((_e=(ie=t.node)==null?void 0:ie.language)!=null?_e:"");return String((Z=String(se).split(/\s+/g)[0])!=null?Z:"").toLowerCase().replace(/[^\w-]/g,"")||"plaintext"}),o=D(()=>`language-${i.value}`),s=D(()=>{var ie;return t.loading===!0||((ie=t.node)==null?void 0:ie.loading)===!0}),r=D(()=>{var ie;return n((ie=t.node)==null?void 0:ie.code,s.value)});let l="",a=1;const u=D(()=>(function(ie){let _e=0,Z=1;ie.startsWith(l)&&(_e=l.length,Z=a,_e>0&&ie[_e-1]==="\r"&&ie[_e]===` -`&&_e++);for(let se=_e;ser.value.split(/\r\n|\n|\r/));let d=0,f="";const h=D(()=>{const ie=u.value;ie{var ie;return t.showLineNumbers===!0&&((ie=t.node)==null?void 0:ie.diff)===!0}),g=D(()=>m.value&&t.diffInline===!0),y=D(()=>{const ie=Number(t.reservedHeightPx);if(!Number.isFinite(ie)||ie<=0)return;const _e=`${Math.ceil(ie)}px`;return s.value?{maxHeight:_e,overflow:"auto"}:{height:_e,minHeight:_e,maxHeight:_e,overflow:"auto"}}),k=["diff ","index ","--- ","+++ ","@@ "];function v(ie){return String(ie??"").trim().length===0}function C(ie,_e="context",Z={}){const se=v(ie);return{code:ie,kind:se&&_e!=="hunk"&&_e!=="spacer"&&!Z.preserveBlankKind?"context":_e,empty:se}}function w(ie){const _e=n(ie,s.value);return _e?_e.split(/\r\n|\n|\r/):[]}function M(ie,_e){return!v(ie[_e])||_ek.some(Z=>_e.startsWith(Z)))}function x(ie,_e){return _e||!ie.startsWith(" ")||ie.startsWith(" ")?ie:` ${ie}`}function A(ie,_e){const Z=ie.length,se=_e.length,he=[];let Y=0;for(;Y=Y&&Q>=Y&&ie[U]===_e[Q];)J.unshift({originalIndex:U,modifiedIndex:Q}),U--,Q--;const ue=U-Y+1,me=Q-Y+1;if(ue<=0||me<=0||s.value||(ue+1)*(me+1)>15e5)return he.concat(J);const pe=me+1,ee=new Uint32Array((ue+1)*(me+1));for(let Ce=ue-1;Ce>=0;Ce--)for(let ve=me-1;ve>=0;ve--){const ce=Ce*pe+ve;if(ie[Y+Ce]===_e[Y+ve])ee[ce]=ee[(Ce+1)*pe+ve+1]+1;else{const Te=ee[(Ce+1)*pe+ve],ke=ee[Ce*pe+ve+1];ee[ce]=Te>=ke?Te:ke}}const re=[];let ge=0,ae=0;for(;ge=ee[ge*pe+ae+1]?ge++:ae++;return he.concat(re,J)}function T(ie){var _e;const Z=(function(){var Q,ue;const me=t.diffHideUnchangedRegions;if(me==null||me===!1)return null;const pe=me===!0?{}:me;return pe.enabled===!1?null:{contextLineCount:Math.max(0,Math.floor((Q=pe.contextLineCount)!=null?Q:2)),minimumLineCount:Math.max(1,Math.floor((ue=pe.minimumLineCount)!=null?ue:4))}})();if(!Z||ie.length<1||ie.length>2||ie.length===2&&ie[0].lines.length!==ie[1].lines.length)return ie;const se=ie[0].lines,he=(_e=ie[1])==null?void 0:_e.lines,Y=Q=>se[Q].kind==="context"&&(he===void 0||he[Q].kind==="context"&&se[Q].code===he[Q].code),J=[];let U=0;for(;U=Z.minimumLineCount){const me=Q+(Q===0?0:Z.contextLineCount),pe=ue-(ue===se.length?0:Z.contextLineCount);pe-me>=Z.minimumLineCount&&J.push({start:me,end:pe})}U===Q&&U++}return J.length?ie.map((Q,ue)=>{const me=[];let pe=0;for(const ee of J)me.push(...Q.lines.slice(pe,ee.start)),me.push({code:ue===0?"Unmodified lines":"",kind:"collapsed",empty:!1,key:`${Q.key}-collapsed-${ee.start}-${ee.end}`,number:""}),pe=ee.end;return me.push(...Q.lines.slice(pe)),Dn(Bt({},Q),{lines:me})}):ie}const I=D(()=>{var ie,_e,Z,se;if(!m.value)return[];const he=(function(ue){const me=ue.some(ee=>L(ee)),pe=ue.some(ee=>E(ee));return me&&pe||(function(){var ee,re,ge,ae;if(i.value==="diff")return!0;const Ce=(ae=(ge=String((re=(ee=t.node)==null?void 0:ee.raw)!=null?re:"").split(/\r?\n/,1)[0])==null?void 0:ge.trim())!=null?ae:"";return/^`{3,}\s*diff(?:\s|$)|^~{3,}\s*diff(?:\s|$)/.test(Ce)})()&&(me||pe)})(c.value),Y=(function(){var ue,me;return((ue=t.node)==null?void 0:ue.originalCode)!=null||((me=t.node)==null?void 0:me.updatedCode)!=null})();if(g.value){const ue=Y?(function(me,pe){const ee=w(me),re=w(pe),ge=A(ee,re);if(ge.length>0){const ke=[];let Ae=0,Ne=0;for(const Ze of ge){for(;Ae=Ce&&ce>=Ce&&ee[ve]===re[ce];)Te.unshift(Dn(Bt({},C(re[ce])),{key:`inline-suffix-${ce}`,number:ce+1})),ve--,ce--;for(let ke=Ce;ke<=ve;ke++)ae.push(Dn(Bt({},C(ee[ke],"removed",{preserveBlankKind:M(ee,ke)})),{key:`inline-removed-source-${ke}`,number:ke+1}));for(let ke=Ce;ke<=ce;ke++)ae.push(Dn(Bt({},C(re[ke],"added",{preserveBlankKind:M(re,ke)})),{key:`inline-added-source-${ke}`,number:ke+1}));return ae.concat(Te)})((ie=t.node)==null?void 0:ie.originalCode,(_e=t.node)==null?void 0:_e.updatedCode):(function(me){const pe=[];let ee=1,re=1;const ge=S(me);for(const[ae,Ce]of me.entries())if(Ce.startsWith("@@")){const ve=Ce.match(/^@@\s+-(\d+)(?:,\d+)?\s+\+(\d+)(?:,\d+)?\s+@@/);ve&&(ee=Number(ve[1]),re=Number(ve[2])),pe.push(Dn(Bt({},C(Ce,"hunk")),{key:`inline-hunk-${ae}`,number:""}))}else if(L(Ce))pe.push(Dn(Bt({},C(x(Ce.slice(1),ge),"removed",{preserveBlankKind:!0})),{key:`inline-removed-${ae}`,number:ee++}));else if(E(Ce))pe.push(Dn(Bt({},C(x(Ce.slice(1),ge),"added",{preserveBlankKind:!0})),{key:`inline-added-${ae}`,number:re++}));else{const ve=ge&&Ce.startsWith(" ")?Ce.slice(1):Ce;pe.push(Dn(Bt({},C(ve)),{key:`inline-context-${ae}`,number:re})),ee++,re++}return pe})(c.value);return T([{key:"inline",className:"markstream-pre__diff-pane--inline",lines:ue}])}if(!he&&Y)return(function(ue,me){const pe=w(ue),ee=w(me),re=A(pe,ee),ge=[],ae=[];let Ce=0,ve=0,ce=0;const Te=(ke,Ae)=>{const Ne=Math.max(ke-Ce,Ae-ve);for(let Ze=0;ZeDn(Bt({},ue),{key:`original-${me}`,number:me+1}))},{key:"modified",className:"markstream-pre__diff-pane--modified",lines:U.map((ue,me)=>Dn(Bt({},ue),{key:`modified-${me}`,number:me+1}))}])}),O=D(()=>{var ie,_e;if(t.showLineNumbers!==!0)return;let Z=m.value?1:u.value;if(m.value){Z=Math.max(Z,w((ie=t.node)==null?void 0:ie.originalCode).length,w((_e=t.node)==null?void 0:_e.updatedCode).length);for(const he of I.value)for(const Y of he.lines)typeof Y.number=="number"&&(Z=Math.max(Z,Y.number))}const se=`${Math.max(2,String(Z).length)}ch`;return{"--markstream-pre-line-number-width":se,"--markstream-pre-diff-line-number-width":se,"--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=D(()=>I.value.some(ie=>ie.lines.some(_e=>_e.kind==="collapsed"))),R=D(()=>{const ie=i.value;return ie?`Code block: ${ie}`:"Code block"}),F=q(null),P=q([]);let z=null,W=!1,$=null;function K(ie){const _e=Number.parseFloat(String(ie??""));return Number.isFinite(_e)&&_e>0?_e:0}function ne(ie,_e){var Z;if(!ie)return _e;if(ie.classList.contains("markstream-pre__diff-line--collapsed"))return 32;const se=ie.querySelector(".markstream-pre__diff-content"),he=se?.getBoundingClientRect(),Y=(Z=he?.height)!=null?Z:0;return Math.max(_e,Math.ceil(Y))}function G(){W||typeof window>"u"||(z!=null&&window.cancelAnimationFrame(z),z=window.requestAnimationFrame(()=>{z=null,W||(function(){var ie,_e;z=null;const Z=F.value;if(!Z||!m.value||g.value||!Z.classList.contains("is-wrap"))return void(P.value.length&&(P.value=[]));const se=(function(me){const pe=window.getComputedStyle(me),ee=K(pe.getPropertyValue("--markstream-pre-diff-line-height"));if(ee>0)return ee;const re=K(pe.lineHeight);return re>0?re:18})(Z),he=Array.from(Z.querySelectorAll(".markstream-pre__diff-pane--original .markstream-pre__diff-line")),Y=Array.from(Z.querySelectorAll(".markstream-pre__diff-pane--modified .markstream-pre__diff-line")),J=Math.max(he.length,Y.length),U=[];for(let me=0;me{const ee=ue[pe];return ee&&Math.abs(me.rowHeight-ee.rowHeight)<=.5&&Math.abs(me.originalHeight-ee.originalHeight)<=.5&&Math.abs(me.modifiedHeight-ee.modifiedHeight)<=.5})||(P.value=U)})()}))}function te(ie){$?.disconnect(),$=null,ie&&m.value&&!g.value&&typeof ResizeObserver<"u"&&($=new ResizeObserver(()=>{G()}),$.observe(ie))}function le(ie,_e){const Z=P.value[ie];if(!Z)return;const se=_e==="original"?Z.originalHeight:Z.modifiedHeight;return{"--markstream-pre-diff-synced-row-height":`${Math.ceil(Z.rowHeight)}px`,"--markstream-pre-diff-content-height":`${Math.ceil(se)}px`}}return ze(F,ie=>{te(ie),ft(()=>G())},{flush:"post"}),ze([m,g,I],()=>{te(F.value),ft(()=>G())},{flush:"post",immediate:!0}),ii(()=>{W=!0,z!=null&&(window.cancelAnimationFrame(z),z=null),$?.disconnect(),$=null}),(ie,_e)=>(b(),N("pre",{ref_key:"preRef",ref:F,style:on([y.value,O.value]),class:De([o.value,{"markstream-pre--line-numbers":t.showLineNumbers,"markstream-pre--diff-preview":m.value,"markstream-pre--diff-inline":g.value,"markstream-pre--diff-collapsed":H.value}]),"aria-busy":s.value,"aria-label":R.value,"data-language":i.value,"data-markstream-line-numbers":t.showLineNumbers?"1":void 0,"data-markstream-pre":"1",tabindex:"0"},[m.value?(b(),N("code",cke,[(b(!0),N(Le,null,Ct(I.value,Z=>(b(),N("span",{key:Z.key,class:De(["markstream-pre__diff-pane",Z.className])},[_("span",dke,[(b(!0),N(Le,null,Ct(Z.lines,(se,he)=>(b(),N("span",{key:se.key,class:De(["markstream-pre__diff-line",[`markstream-pre__diff-line--${se.kind}`,{"markstream-pre__diff-line--empty":se.empty}]]),style:on(le(he,Z.key))},[_e[0]||(_e[0]=_("span",{class:"markstream-pre__diff-rail","aria-hidden":"true"},null,-1)),_("span",fke,B(se.number),1),_("span",hke,[_("span",pke,B(se.code),1)])],6))),128))])],2))),128))])):(b(),N(Le,{key:1},[t.showLineNumbers?(b(),N("span",mke,[_("span",{class:"markstream-pre__line-numbers-text",textContent:B(h.value)},null,8,gke)])):X("",!0),_("code",{translate:"no",class:"markstream-pre__code",textContent:B(r.value)},null,8,vke)],64))],14,uke))}});bl.install=e=>{e.component(bl.__name,bl)};const Fo=Ei(ot({__name:"TextNode",props:{node:{}},emits:["copy"],setup(e){const t=e,n=qm(),i=en("markstreamFade",void 0),o=en("markstreamTextStreamState",void 0),s=en("markstreamStreamVersion",void 0),r=D(()=>{const M=n.fade;return M===""||M===!0||M==="true"||M!==!1&&M!=="false"&&void 0}),l=D(()=>typeof r.value=="boolean"?r.value:typeof i?.value!="boolean"||i.value),a=D(()=>{var M;const L=(M=n["index-key"])!=null?M:n.indexKey;return L==null||L===""?"":String(L)}),u=q(t.node.content),c=q(""),d=q(0),f=q(t.node.content);let h;const m=q(null),g=q(null);let y="",k=null;function v(){h?.(),h=void 0}function C(){v(),c.value&&(u.value=u.value+c.value,c.value="")}ze([u,m,g],function(){var M,L;const E=m.value;if(!E)return;const S=String((M=u.value)!=null?M:""),x=g.value;return k||(k=E.firstChild,y=(L=k?.data)!=null?L:""),S.startsWith(y)?!k&&S?(E.textContent=S,k=E.firstChild,void(y=S)):void(S.length>y.length&&x&&(x.appendChild(document.createTextNode(S.slice(y.length))),y=S)):(E.textContent=S,k=E.firstChild,x&&(x.textContent=""),void(y=S))},{immediate:!0}),ze([()=>t.node.content,a,l],([M])=>{const L=String(M??""),E=a.value,S=lq({nextContent:L,persistedContent:E?o?.get(E):void 0,currentState:{settledContent:u.value,streamedDelta:c.value},typewriterEnabled:l.value});u.value=S.settledContent,c.value=S.streamedDelta,S.appended?(d.value+=1,(function(){if(!c.value||h||!s)return;const x=s.value;h=ze(()=>s.value,A=>{A!==x&&C()},{flush:"sync"})})()):c.value||v(),E&&o?.set(E,L)},{immediate:!0}),cd(v);const w=D(()=>d.value%2==0?"text-node-stream-delta--a":"text-node-stream-delta--b");return(M,L)=>(b(),N("span",{class:De([[e.node.center?"text-node-center":""],"text-node"])},[si(_("span",{ref_key:"settledTextEl",ref:m},B(f.value),513),[[Eo,u.value!==""]]),si(_("span",{ref_key:"settledAppendsEl",ref:g},null,512),[[Eo,u.value!==""]]),c.value?(b(),N("span",{key:0,class:De(["text-node-stream-delta",[w.value]]),onAnimationend:C},B(c.value),35)):X("",!0)],2))}}),[["__scopeId","data-v-fd79037c"]]);function d0(e,t,n){return ot({name:e,inheritAttrs:!1,setup(i,{attrs:o,slots:s}){var r,l;const a=Hx(),u=zx(),c=jx(),d=typeof window<"u"&&((l=(r=gs())==null?void 0:r.vnode.el)==null?void 0:l.nodeType)===1,f=q(typeof window>"u"||d||!c.value),h=_u(null);let m=null;function g(y){const k=y&&"$el"in y?y.$el:y;h.value=k instanceof HTMLElement?k:null}return typeof window<"u"&&ze([h,c],([y,k],v,C)=>{if(m?.destroy(),m=null,!k||f.value)return void(f.value=!0);if(!y)return;let w=!0;const M=a(y,{rootMargin:u?.value.heavyBlockMargin,allowIdle:!1});m=M,f.value=M.isVisible.value,M.whenVisible.then(()=>{w&&m===M&&(f.value=!0)}),C(()=>{w=!1,M.destroy(),m===M&&(m=null)})},{immediate:!0}),ii(()=>{m?.destroy(),m=null}),()=>Fn(f.value?t:n,Dn(Bt({},o),{ref:g}),s)}})}Fo.install=e=>{e.component(Fo.__name,Fo)};const gb=ot({name:"CodeBlockNodeLoading",inheritAttrs:!1,props:["node","isDark","loading","stream","theme","darkTheme","lightTheme","isShowPreview","monacoOptions","enableFontSizeControl","minWidth","maxWidth","themes","showHeader","showCopyButton","showExpandButton","showPreviewButton","showCollapseButton","showFontSizeButtons","showTooltips","htmlPreviewAllowScripts","htmlPreviewSandbox","customId","estimatedHeightPx","estimatedContentHeightPx","estimatedDiffInline"],emits:["previewCode","copy"],setup(e,{attrs:t}){const n=e;return()=>{var i,o,s,r,l,a,u;const c=U4(String((o=(i=n.node)==null?void 0:i.language)!=null?o:"")),d=ON[c]||(c?c.charAt(0).toUpperCase()+c.slice(1):ON[""]),f=lke(n.node),h=ake(String((r=(s=n.node)==null?void 0:s.raw)!=null?r:""),d,f),m=n.monacoOptions,g=f&&((l=n.estimatedDiffInline)!=null?l:Wx(m??{},typeof window>"u"?0:window.innerWidth)),y=m?.diffAppearance,k=y==="dark"||y!=="light"&&n.isDark===!0,v=typeof m?.fontSize=="number"&&Number.isFinite(m.fontSize)&&m.fontSize>0?m.fontSize:12,C=typeof m?.lineHeight=="number"&&Number.isFinite(m.lineHeight)&&m.lineHeight>0?m.lineHeight:v===12?18:Math.max(12,Math.round(1.5*v)),w=typeof m?.tabSize=="number"&&Number.isFinite(m.tabSize)&&m.tabSize>0?m.tabSize:4,M=f?0:8,L=typeof((a=m?.padding)==null?void 0:a.top)=="number"&&Number.isFinite(m.padding.top)&&m.padding.top>=0?m.padding.top:M,E=typeof((u=m?.padding)==null?void 0:u.bottom)=="number"&&Number.isFinite(m.padding.bottom)&&m.padding.bottom>=0?m.padding.bottom:M,S=typeof m?.fontFamily=="string"?m.fontFamily.trim():"",x=Bt(Bt({fontSize:`${v}px`,lineHeight:`${C}px`,tabSize:w,paddingTop:`${L}px`,paddingBottom:`${E}px`,"--markstream-pre-line-number-top":`${L}px`},f?{"--markstream-pre-diff-line-height":`${C}px`}:{}),S?{"--markstream-code-font-family":S}:{}),A=()=>Fn("button",{class:"code-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0","aria-hidden":"true",disabled:!0,tabindex:-1,type:"button"},[Fn("svg",{class:"action-icon",width:"14",height:"14"})]),T=n.isShowPreview!==!1&&(c==="html"||c==="svg"),I=n.showFontSizeButtons!==!1&&n.enableFontSizeControl!==!1||n.showExpandButton!==!1||T&&n.showPreviewButton!==!1,O=R=>{if(R!=null)return typeof R=="number"?`${R}px`:String(R)},H=Bt(Bt(Bt({"--markstream-code-layout-character-width":"1ch"},O(n.minWidth)?{minWidth:O(n.minWidth)}:{}),O(n.maxWidth)?{maxWidth:O(n.maxWidth)}:{}),f?{}:{color:"var(--vscode-editor-foreground, var(--markstream-code-fallback-fg, var(--code-fg)))",backgroundColor:"var(--markstream-code-fallback-bg, var(--code-bg, #fff))",borderColor:"var(--markstream-code-border-color, var(--code-border))"});return Fn("div",Dn(Bt({},t),{class:["code-block-container","rounded-lg","border",{dark:n.isDark===!0,"is-rendering":n.loading!==!1,"is-dark":k,"is-diff":f,"is-plain-text":c===""||c==="plaintext"||c==="text"},t.class],style:[H,t.style],"data-markstream-code-block":"1","data-markstream-enhanced":"false","data-markstream-code-block-state":n.loading?"streaming":"settled","data-markstream-code-loading":"1"}),[n.showHeader===!1?null:Fn("div",{class:"code-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)] border-[var(--code-border)] bg-[var(--code-header-bg)] text-[var(--code-fg)]"},[Fn("div",{class:"code-header-main",style:{minWidth:0,flex:"1 1 auto",display:"flex",alignItems:"center",gap:"var(--ms-gap-header-main, 0.625rem)",overflow:"hidden"}},[Fn("span",{class:"icon-slot h-4 w-4 flex-shrink-0","aria-hidden":"true",style:{display:"inline-flex",width:"1rem",height:"1rem",flex:"0 0 auto"}}),Fn("div",{class:"code-header-copy",style:{minWidth:0,display:"grid",gap:"2px"}},[Fn("div",{class:"code-header-title",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"var(--ms-text-label, 0.75rem)",fontWeight:"500",color:"var(--code-action-fg)"}},h.title),h.caption?Fn("div",{class:"code-header-caption",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"0.75rem",color:"var(--code-line-number)"}},h.caption):null])]),Fn("div",{class:"flex items-center gap-0.5",style:{visibility:"hidden"}},[f?Fn("div",{class:"code-diff-stats","aria-hidden":"true"},[Fn("span",{class:"code-diff-stat removed"},"-0"),Fn("span",{class:"code-diff-stat added"},"+0")]):null,n.showCopyButton===!1?null:A(),n.showCollapseButton===!1?null:A(),I?Fn("div",{class:"relative"},[A()]):null])]),Fn("div",{class:"code-block-shell-content",style:n.stream!==!1||n.loading===!1?void 0:{display:"none"}},[Fn(bl,{node:n.node,loading:n.loading,showLineNumbers:!0,reservedHeightPx:f?void 0:n.estimatedContentHeightPx,diffInline:g,diffHideUnchangedRegions:f?rke(m?.diffHideUnchangedRegions):void 0,class:"code-pre-fallback",style:x,"data-markstream-code-loading":"1"})]),Fn("div",{class:"code-loading-placeholder",style:n.stream===!1&&n.loading!==!1?void 0:{display:"none"}},[Fn("div",{class:"loading-skeleton"},[Fn("div",{class:"skeleton-line"}),Fn("div",{class:"skeleton-line"}),Fn("div",{class:"skeleton-line short"})])]),Fn("span",{class:"sr-only","aria-live":"polite",role:"status"})])}}}),k8=d0("ViewportDeferredCodeBlockNode",Xu({loader:()=>io(null,null,function*(){try{return(yield qo(()=>import("./CodeBlockNode-Dh6YGbd1.js"),__vite__mapDeps([4,5]))).default}catch(e){return console.warn('[markstream-vue] Failed to load the enhanced CodeBlockNode chunk; falling back to preformatted code rendering. Enhanced code blocks require the optional "stream-diffs" peer (or "stream-monaco" as a fallback).',e),bl}}),loadingComponent:gb,delay:0,suspensible:!1}),gb),Iu=Xu(()=>io(null,null,function*(){var e;if(((e=(function(){const t=Reflect.get(globalThis,"process");return t?.env})())==null?void 0:e.NODE_ENV)==="test"&&typeof window<"u")return t=>{var n,i,o,s;return Fn(Fo,Dn(Bt({},t),{node:{type:"text",content:(i=t.node.raw)!=null?i:`$${(n=t.node.content)!=null?n:""}$`,raw:(s=t.node.raw)!=null?s:`$${(o=t.node.content)!=null?o:""}$`}}))};try{return yield fq(),(yield qo(()=>import("./index7-CreDRl0J.js"),[])).default}catch(t){console.warn('[markstream-vue] Optional peer dependencies for MathInlineNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',t)}return t=>{var n,i,o,s;return Fn(Fo,Dn(Bt({},t),{node:{type:"text",content:(i=t.node.raw)!=null?i:`$${(n=t.node.content)!=null?n:""}$`,raw:(s=t.node.raw)!=null?s:`$${(o=t.node.content)!=null?o:""}$`}}))}})),_q=Xu(()=>io(null,null,function*(){try{return yield fq(),(yield qo(()=>import("./index6-BTRYPHWD.js"),[])).default}catch(e){console.warn('[markstream-vue] Optional peer dependencies for MathBlockNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".',e)}return e=>{var t,n,i,o;return Fn(Fo,Dn(Bt({},e),{node:{type:"text",content:(n=e.node.raw)!=null?n:`$$${(t=e.node.content)!=null?t:""}$$`,raw:(o=e.node.raw)!=null?o:`$$${(i=e.node.content)!=null?i:""}$$`}}))}})),Qr=Ei(ot({__name:"ReferenceNode",props:{node:{},messageId:{},threadId:{}},emits:["click","mouseEnter","mouseLeave"],setup:e=>(t,n)=>(b(),N("span",{class:"reference-node cursor-pointer text-xs rounded-md px-1.5 mx-0.5",role:"button",tabindex:"0",onClick:n[0]||(n[0]=i=>t.$emit("click",i,e.node.id,e.messageId,e.threadId)),onMouseenter:n[1]||(n[1]=i=>t.$emit("mouseEnter",i,e.node.id,e.messageId,e.threadId)),onMouseleave:n[2]||(n[2]=i=>t.$emit("mouseLeave",i,e.node.id,e.messageId,e.threadId))},B(e.node.id),33))}),[["__scopeId","data-v-775c65e4"]]);Qr.install=e=>{e.component(Qr.__name,Qr)};const yke={class:"superscript-node"},Ml=Ei(ot({__name:"SuperscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=vs(()=>t.customId),i=D(()=>Bt({text:Fo,inline_code:Er,link:Xr,html_inline:aa,strong:Yr,emphasis:el,footnote_reference:la,strikethrough:Jr,highlight:ua,insert:El,subscript:Tl,emoji:Il,math_inline:Iu,reference:Qr},n.value));return(o,s)=>(b(),N("sup",yke,[(b(!0),N(Le,null,Ct(e.node.children,(r,l)=>(b(),fe(p(yc),{key:`${e.indexKey||"superscript"}-${l}`,components:i.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"superscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-24160b22"]]);Ml.install=e=>{e.component(Ml.__name,Ml)};const kke={class:"subscript-node"},Tl=Ei(ot({__name:"SubscriptNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=vs(()=>t.customId),i=D(()=>Bt({text:Fo,inline_code:Er,link:Xr,html_inline:aa,strong:Yr,emphasis:el,footnote_reference:la,strikethrough:Jr,highlight:ua,insert:El,superscript:Ml,emoji:Il,math_inline:Iu,reference:Qr},n.value));return(o,s)=>(b(),N("sub",kke,[(b(!0),N(Le,null,Ct(e.node.children,(r,l)=>(b(),fe(p(yc),{key:`${e.indexKey||"subscript"}-${l}`,components:i.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"subscript"}-${l}`,"fallback-to-text":""},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-197fa13b"]]);Tl.install=e=>{e.component(Tl.__name,Tl)};const bke={class:"strong-node"},Yr=Ei(ot({__name:"StrongNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=vs(()=>t.customId),i=D(()=>Bt({text:Fo,inline_code:Er,link:Xr,html_inline:aa,emphasis:el,strikethrough:Jr,highlight:ua,insert:El,subscript:Tl,superscript:Ml,emoji:Il,footnote_reference:la,math_inline:Iu,reference:Qr},n.value));return(o,s)=>(b(),N("strong",bke,[(b(!0),N(Le,null,Ct(e.node.children,(r,l)=>(b(),fe(p(yc),{key:`${e.indexKey||"strong"}-${l}`,components:i.value,node:r,"index-key":`${e.indexKey||"strong"}-${l}`,"custom-id":t.customId},null,8,["components","node","index-key","custom-id"]))),128))]))}}),[["__scopeId","data-v-a8647104"]]);Yr.install=e=>{e.component(Yr.__name,Yr)};const wke={class:"strikethrough-node"},Jr=Ei(ot({__name:"StrikethroughNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=vs(()=>t.customId),i=D(()=>Bt({text:Fo,inline_code:Er,link:Xr,html_inline:aa,strong:Yr,emphasis:el,highlight:ua,insert:El,subscript:Tl,superscript:Ml,emoji:Il,footnote_reference:la,math_inline:Iu,reference:Qr},n.value));return(o,s)=>(b(),N("del",wke,[(b(!0),N(Le,null,Ct(e.node.children,(r,l)=>(b(),fe(p(yc),{key:`${e.indexKey||"strikethrough"}-${l}`,components:i.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"strikethrough"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-b7a531fa"]]);Jr.install=e=>{e.component(Jr.__name,Jr)};const Cke=["href","title","aria-label","aria-hidden","target","rel"],Ake=["aria-hidden"],xke={class:"link-text-wrapper relative inline-flex"},Ske={class:"leading-[normal] link-text"},Xr=Ei(ot({__name:"LinkNode",props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){const t=e,n=en("markstreamShowTooltips",void 0),i=D(()=>{const k=n?.value;return typeof k=="boolean"?k:t.showTooltip}),o=D(()=>{var k,v,C,w,M;const L=t.underlineBottom!==void 0?typeof t.underlineBottom=="number"?`${t.underlineBottom}px`:String(t.underlineBottom):"-3px",E=(k=t.animationOpacity)!=null?k:.35,S=Math.max(.12,Math.min(.5*E,E)),x={"--underline-height":`${(v=t.underlineHeight)!=null?v:2}px`,"--underline-bottom":L,"--underline-opacity":String(E),"--underline-rest-opacity":String(S),"--underline-duration":`${(C=t.animationDuration)!=null?C:1.6}s`,"--underline-timing":(w=t.animationTiming)!=null?w:"ease-in-out","--underline-iteration":typeof t.animationIteration=="number"?String(t.animationIteration):(M=t.animationIteration)!=null?M:"infinite"};return t.color&&(x["--link-color"]=t.color),x}),s=vs(()=>t.customId),r=D(()=>Bt({text:Fo,strong:Yr,strikethrough:Jr,emphasis:el,image:df,html_inline:aa,inline_code:Er},s.value)),l=qm(),a=D(()=>{var k,v;const C=(k=t.node)==null?void 0:k.attrs;if(!C||typeof C!="object")return{};const w={};if(Array.isArray(C))for(const M of C)Array.isArray(M)&&M[0]&&(w[String(M[0])]=String((v=M[1])!=null?v:""));else for(const[M,L]of Object.entries(C))M&&L!=null&&L!==!1&&(w[M]=L===!0?"":String(L));return GN(w,"safe","a")}),u=D(()=>Bt(Bt({},l),a.value)),c=D(()=>{var k,v;return GN({href:String((v=(k=t.node)==null?void 0:k.href)!=null?v:"")},"safe","a").href}),d=D(()=>{if(!c.value)return;const k=u.value.target;return(typeof k=="string"?k.trim():String(k??"").trim())||(lme(c.value)?"_blank":void 0)}),f=D(()=>{var k;return String((k=d.value)!=null?k:"").trim().toLowerCase()==="_blank"}),h=D(()=>{if(!c.value)return;const k=u.value.rel,v=new Set((typeof k=="string"?k:String(k??"")).split(/\s+/).filter(Boolean)),C=new Set(Array.from(v).filter(w=>w.toLowerCase()!=="opener"));return f.value&&(C.add("noopener"),C.add("noreferrer")),C.size>0?Array.from(C).join(" "):void 0}),m=D(()=>{const k=Bt({},u.value);return delete k.title,delete k.href,delete k.target,delete k.rel,k});function g(){i.value&&U9e()}const y=D(()=>{var k,v;const C=(k=t.node)==null?void 0:k.title;return typeof C=="string"&&C.trim().length>0?C:String((v=c.value)!=null?v:"")});return(k,v)=>{var C,w;return e.node.loading?(b(),N("span",ci({key:1,class:"link-loading inline-flex items-baseline gap-1.5","aria-hidden":e.node.loading?"false":"true"},p(l),{style:o.value}),[_("span",xke,[_("span",Ske,[V(p(Fo),{class:"leading-[normal] link-text",node:{type:"text",content:String((C=e.node.text)!=null?C:""),raw:String((w=e.node.text)!=null?w:"")},"index-key":`${e.indexKey||"link-text"}-loading`},null,8,["node","index-key"])]),v[1]||(v[1]=_("span",{class:"link-loading-indicator","aria-hidden":"true"},null,-1))])],16,Ake)):(b(),N("a",ci({key:0,class:"link-node",href:c.value,title:i.value?"":y.value,"aria-label":`Link: ${y.value}`,"aria-hidden":e.node.loading?"true":"false",target:d.value,rel:h.value},m.value,{style:o.value,onMouseenter:v[0]||(v[0]=M=>(function(L){var E,S,x,A;if(!i.value)return;const T=L,I=T?.clientX!=null&&T?.clientY!=null?{x:T.clientX,y:T.clientY}:void 0,O=((E=t.node)==null?void 0:E.title)||((S=c.value)!=null&&S.includes("xn--")&&((A=(x=t.node)==null?void 0:x.text)!=null&&A.includes("://"))?t.node.text:c.value)||"";q9e(L.currentTarget,O,"top",!1,I)})(M)),onMouseleave:g}),[(b(!0),N(Le,null,Ct(e.node.children,(M,L)=>(b(),fe(p(yc),{key:`${e.indexKey||"emphasis"}-${L}`,components:r.value,node:M,"custom-id":t.customId,"index-key":`${e.indexKey||"link-text"}-${L}`},null,8,["components","node","custom-id","index-key"]))),128))],16,Cke))}}}),[["__scopeId","data-v-367e6ca4"]]);Xr.install=e=>{e.component(Xr.__name,Xr)};const _ke={class:"insert-node"},El=Ei(ot({__name:"InsertNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=vs(()=>t.customId),i=D(()=>Bt({text:Fo,inline_code:Er,link:Xr,html_inline:aa,strong:Yr,emphasis:el,strikethrough:Jr,highlight:ua,subscript:Tl,superscript:Ml,emoji:Il,footnote_reference:la,math_inline:Iu,reference:Qr},n.value));return(o,s)=>(b(),N("ins",_ke,[(b(!0),N(Le,null,Ct(e.node.children,(r,l)=>(b(),fe(p(yc),{key:`${e.indexKey||"insert"}-${l}`,components:i.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"insert"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-1e2c29d4"]]);El.install=e=>{e.component(El.__name,El)};const Ike={class:"highlight-node"},ua=Ei(ot({__name:"HighlightNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=vs(()=>t.customId),i=D(()=>Bt({text:Fo,inline_code:Er,link:Xr,html_inline:aa,strong:Yr,emphasis:el,strikethrough:Jr,insert:El,subscript:Tl,superscript:Ml,emoji:Il,footnote_reference:la,math_inline:Iu,reference:Qr},n.value));return(o,s)=>(b(),N("mark",Ike,[(b(!0),N(Le,null,Ct(e.node.children,(r,l)=>(b(),fe(p(yc),{key:`${e.indexKey||"highlight"}-${l}`,components:i.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"highlight"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-7a62982a"]]);ua.install=e=>{e.component(ua.__name,ua)};const Mke={class:"emphasis-node"},el=Ei(ot({__name:"EmphasisNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=vs(()=>t.customId),i=D(()=>Bt({text:Fo,inline_code:Er,link:Xr,html_inline:aa,strong:Yr,strikethrough:Jr,highlight:ua,insert:El,subscript:Tl,superscript:Ml,emoji:Il,footnote_reference:la,math_inline:Iu,reference:Qr},n.value));return(o,s)=>(b(),N("em",Mke,[(b(!0),N(Le,null,Ct(e.node.children,(r,l)=>(b(),fe(p(yc),{key:`${e.indexKey||"emphasis"}-${l}`,components:i.value,node:r,"custom-id":t.customId,"index-key":`${e.indexKey||"emphasis"}-${l}`},null,8,["components","node","custom-id","index-key"]))),128))]))}}),[["__scopeId","data-v-2a5aafbf"]]);el.install=e=>{e.component(el.__name,el)};const Tke={class:"hard-break"},ff=Ei(ot({__name:"HardBreakNode",props:{node:{}},setup:e=>(t,n)=>(b(),N("br",Tke))}),[["__scopeId","data-v-50c58f70"]]);ff.install=e=>{e.component(ff.__name,ff)};const Pv=ot({__name:"SimpleInlineRenderer",props:{nodes:{},customId:{},indexKey:{}},setup(e){const t=e,n=Lt({checkbox:ra,checkbox_input:ra,emoji:Il,emphasis:el,hardbreak:ff,highlight:ua,inline_code:Er,insert:El,link:Xr,reference:Qr,strikethrough:Jr,strong:Yr,subscript:Tl,superscript:Ml,text:Fo}),i=vs(()=>t.customId),o=D(()=>{const s=i.value;return Object.keys(s).length>0?Bt(Bt({},n),s):n});return(s,r)=>(b(!0),N(Le,null,Ct(e.nodes,(l,a)=>(b(),fe(p(yc),{key:a,components:o.value,node:l,"custom-id":t.customId,"index-key":`${e.indexKey||"inline"}-${a}`},null,8,["components","node","custom-id","index-key"]))),128))}});function BA(e){if(!e||typeof e!="object")return!1;const t=`|${e.type}|`;if(!"|checkbox|checkbox_input|emoji|emphasis|hardbreak|highlight|inline_code|insert|link|reference|strikethrough|strong|subscript|superscript|text|".includes(t))return!1;if(!"|emphasis|highlight|insert|link|strikethrough|strong|subscript|superscript|".includes(t))return!0;const n=e.children;return Array.isArray(n)&&n.every(BA)}function vb(e,t=!0,n=!1){if(!e||!n&&e.length===0)return null;if(e.every(BA))return e;if(!t||e.length!==1)return null;const i=e[0];if(i?.type!=="paragraph"||!Array.isArray(i.children))return null;const o=i.children;return(n||o.length>0)&&o.every(BA)?o:null}function vp(e){var t,n;if(!e?.length)return null;let i="";for(const o of e){if(o?.type!=="text"||o.center===!0)return null;i+=String((n=(t=o.content)!=null?t:o.raw)!=null?n:"")}return i}const Eke=["cite"],Lke={key:0,dir:"auto",class:"paragraph-node"},Nke=["custom-id"],j9=Ei(ot({__name:"BlockquoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=vs(()=>t.customId),i=D(()=>!!n.value.paragraph),o=D(()=>!!n.value.text),s=D(()=>vb(t.node.children,!i.value)),r=D(()=>t.fade!==!1||o.value?null:vp(s.value));return Gn("markstreamShowTooltips",D(()=>t.showTooltips)),Gn("markstreamFade",D(()=>t.fade)),(l,a)=>(b(),N("blockquote",{class:"blockquote blockquote-node",dir:"auto",cite:e.node.cite},[s.value?(b(),N("p",Lke,[r.value!==null?(b(),N("span",{key:0,class:"text-node","custom-id":t.customId},B(r.value),9,Nke)):(b(),fe(p(Pv),{key:1,nodes:s.value,"custom-id":t.customId,"index-key":`blockquote-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):(b(),fe(p(Ll),{key:1,"show-tooltips":t.showTooltips,"index-key":`blockquote-${t.indexKey}`,nodes:t.node.children||[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:a[0]||(a[0]=u=>l.$emit("copy",u))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade"]))],8,Eke))}}),[["__scopeId","data-v-abfecebc"]]);j9.install=e=>{e.component(j9.__name,j9)};const Fke={class:"definition-list"},Dke={class:"definition-term"},Rke={class:"definition-desc"},H9=Ei(ot({__name:"DefinitionListNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,i)=>(b(),N("dl",Fke,[(b(!0),N(Le,null,Ct(t.node.items,(o,s)=>(b(),N(Le,{key:s},[_("dt",Dke,[V(p(Ll),{"index-key":`definition-term-${t.indexKey}-${s}`,nodes:o.term,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:i[0]||(i[0]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])]),_("dd",Rke,[V(p(Ll),{"index-key":`definition-desc-${t.indexKey}-${s}`,nodes:o.definition,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:i[1]||(i[1]=r=>n.$emit("copy",r))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],64))),128))]))}}),[["__scopeId","data-v-4e103b30"]]);H9.install=e=>{e.component(H9.__name,H9)};const Oke=["href","title"],K0=Ei(ot({__name:"FootnoteAnchorNode",props:{node:{}},setup(e){const t=e;function n(i){var o;if(i.preventDefault(),typeof document>"u")return;const s=`fnref-${String((o=t.node.id)!=null?o:"")}`,r=document.getElementById(s);r&&r.scrollIntoView({behavior:"smooth",block:"center"})}return(i,o)=>(b(),N("a",{class:"footnote-anchor text-sm hover:underline cursor-pointer",href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:n}," ↩︎ ",8,Oke))}}),[["__scopeId","data-v-e1eb37b6"]]);K0.install=e=>{e.component(K0.__name,K0)};const Pke=["id"],Bke={class:"flex-1"},W9=ot({__name:"FootnoteNode",props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e){const t=e;return(n,i)=>(b(),N("div",{id:`fnref--${e.node.id}`,class:"footnote-node flex text-sm leading-relaxed border-t border-[var(--footnote-border)] pt-2"},[_("div",Bke,[V(p(Ll),{"index-key":`footnote-${t.indexKey}`,nodes:t.node.children,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:i[0]||(i[0]=o=>n.$emit("copy",o))},null,8,["index-key","nodes","custom-id","typewriter","fade"])])],8,Pke))}});W9.install=e=>{e.component(W9.__name,W9)};const $ke=["custom-id"],$A=Ei(ot({__name:"HeadingNode",props:{node:{},customId:{},indexKey:{}},setup(e){const t=e,n=vs(()=>t.customId),i=en("markstreamFade",void 0),o=D(()=>i?.value!==!1||n.value.text?null:vp(t.node.children)),s=D(()=>Bt({text:Fo,inline_code:Er,link:Xr,image:df,strong:Yr,emphasis:el,strikethrough:Jr,highlight:ua,insert:El,subscript:Tl,superscript:Ml,emoji:Il,checkbox:ra,checkbox_input:ra,footnote_reference:la,hardbreak:ff,math_inline:Iu,reference:Qr},n.value));return(r,l)=>(b(),fe(To(`h${e.node.level}`),ci({class:["heading-node",[`heading-${e.node.level}`]],dir:"auto"},e.node.attrs),{default:de(()=>[o.value!==null?(b(),N("span",{key:0,class:"text-node","custom-id":t.customId},B(o.value),9,$ke)):(b(!0),N(Le,{key:1},Ct(e.node.children,(a,u)=>(b(),fe(p(yc),{key:u,components:s.value,"custom-id":t.customId,node:a,"index-key":`${e.indexKey||"heading"}-${u}`},null,8,["components","custom-id","node","index-key"]))),128))]),_:1},16,["class"]))}}),[["__scopeId","data-v-7122dbe1"]]),Z4=$A;Z4.install=e=>{e.component($A.__name,$A)};const zke={key:0,dir:"auto",class:"paragraph-node"},jke=["custom-id"],Hke={dir:"auto",class:"paragraph-node"},Wke=["custom-id"],am=Ei(ot({__name:"ListItemNode",props:{node:{},item:{},indexKey:{},customId:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},value:{},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=D(()=>{var h;return(h=t.node)!=null?h:t.item}),i=vs(()=>t.customId),o=D(()=>!!i.value.paragraph),s=D(()=>!!i.value.text),r=D(()=>{var h;return vb((h=n.value)==null?void 0:h.children,!o.value)}),l=D(()=>{var h;if(o.value)return null;const m=(h=n.value)==null?void 0:h.children;if(!Array.isArray(m)||m.length<2)return null;const g=m[0];if(g?.type!=="paragraph"||!Array.isArray(g.children))return null;const y=m.slice(1);if(!y.every(v=>v?.type==="list"))return null;const k=vb([g]);return k?{paragraphChildren:k,nestedLists:y}:null});function a(){return t.fade===!1&&!s.value}const u=D(()=>a()?vp(r.value):null),c=D(()=>{var h;return a()?vp((h=l.value)==null?void 0:h.paragraphChildren):null}),d=Object.freeze({}),f=D(()=>{const{value:h}=t;return typeof h=="number"&&Number.isFinite(h)?{value:h}:d});return Gn("markstreamShowTooltips",D(()=>t.showTooltips)),Gn("markstreamFade",D(()=>t.fade)),(h,m)=>{var g,y;return b(),N("li",ci({class:"list-item",dir:"auto"},f.value),[r.value?(b(),N("p",zke,[u.value!==null?(b(),N("span",{key:0,class:"text-node","custom-id":t.customId},B(u.value),9,jke)):(b(),fe(p(Pv),{key:1,nodes:r.value,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))])):l.value?(b(),N(Le,{key:1},[_("p",Hke,[c.value!==null?(b(),N("span",{key:0,class:"text-node","custom-id":t.customId},B(c.value),9,Wke)):(b(),fe(p(Pv),{key:1,nodes:l.value.paragraphChildren,"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-paragraph`},null,8,["nodes","custom-id","index-key"]))]),(b(!0),N(Le,null,Ct(l.value.nestedLists,(k,v)=>(b(),fe(p(Ll),{key:v,nodes:[k],"custom-id":t.customId,"index-key":`list-item-${t.indexKey}-nested-${v}`,"show-tooltips":t.showTooltips,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0,onCopy:m[0]||(m[0]=C=>h.$emit("copy",C))},null,8,["nodes","custom-id","index-key","show-tooltips","typewriter","fade","is-dark"]))),128))],64)):(b(),fe(p(Ll),{key:2,"show-tooltips":t.showTooltips,"index-key":`list-item-${t.indexKey}`,nodes:(y=(g=n.value)==null?void 0:g.children)!=null?y:[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"is-dark":t.isDark,"batch-rendering":!1,onCopy:m[1]||(m[1]=k=>h.$emit("copy",k))},null,8,["show-tooltips","index-key","nodes","custom-id","typewriter","fade","is-dark"]))],16)}}}),[["__scopeId","data-v-617214f9"]]);am.install=e=>{e.component(am.__name,am)};const um=Ei(ot({__name:"ListNode",props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},isDark:{type:Boolean}},emits:["copy"],setup(e){const t=vs(()=>e.customId),n=D(()=>t.value.list_item||am);return(i,o)=>(b(),fe(To(e.node.ordered?"ol":"ul"),{class:De(["list-node",{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:de(()=>[(b(!0),N(Le,null,Ct(e.node.items,(s,r)=>{var l;return b(),fe(To(n.value),ci({key:`${e.indexKey||"list"}-${r}`},{ref_for:!0},{showTooltips:e.showTooltips},{node:s,"custom-id":e.customId,"index-key":`${e.indexKey||"list"}-${r}`,typewriter:e.typewriter,fade:e.fade,"is-dark":e.isDark,value:e.node.ordered?((l=e.node.start)!=null?l:1)+r:void 0,onCopy:o[0]||(o[0]=a=>i.$emit("copy",a))}),null,16,["node","custom-id","index-key","typewriter","fade","is-dark","value"])}),128))]),_:1},8,["class"]))}}),[["__scopeId","data-v-99cb95e0"]]);um.install=e=>{e.component(um.__name,um)};const qke={key:2,class:"html-block-node__raw"},Uke=["innerHTML"],Vke={key:1,class:"html-block-node__placeholder"},Z0=Ei(ot({__name:"HtmlBlockNode",props:{node:{},customId:{},htmlPolicy:{}},setup(e){const t=e,n=en("markstreamHtmlPolicy",void 0),i=en("markstreamNestedRendererProps",void 0),o=D(()=>{var I,O;return(O=(I=t.htmlPolicy)!=null?I:n?.value)!=null?O:"safe"}),s=D(()=>{var I,O;const H=(I=i?.value)!=null?I:{};return Dn(Bt({},H),{customId:(O=t.customId)!=null?O:H.customId,htmlPolicy:o.value})}),r=Xu({loader:()=>Promise.resolve().then(()=>Xx),suspensible:!1}),l=D(()=>{const I=P9(t.node.attrs,o.value);if(!I)return;const O=W0(I);return Object.keys(O).length>0?O:void 0}),a=D(()=>{const I=String(t.node.tag||"").trim(),O=P9(t.node.attrs,o.value,I);if(!O)return;const H=W0(O);return Object.keys(H).length>0?H:void 0}),u=vs(()=>t.customId),c=ot({name:"DynamicRenderer",props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),d=q(null),f=q(typeof window>"u"),h=q(t.node.content),m=D(()=>Array.isArray(t.node.children)?t.node.children:[]),g=D(()=>String(t.node.tag||"div")),y=D(()=>{var I;if(g.value.trim().toLowerCase()!=="details"||(I=t.node.attrs)!=null&&I.some(([H])=>String(H).toLowerCase()==="open"))return null;const O=m.value[0];return O?.type==="html_block"&&String(O.tag||"").toLowerCase()==="summary"?O:null}),k=D(()=>{var I;return vp((I=y.value)==null?void 0:I.children)}),v=D(()=>{const I=y.value;if(!I)return;const O=P9(I.attrs,o.value,"summary");if(!O)return;const H=W0(O);return Object.keys(H).length>0?H:void 0}),C=D(()=>k.value==null?m.value:m.value.slice(1)),w=D(()=>{const I=g.value.trim().toLowerCase();return VH.has(I)||Dx(I,o.value)}),M=D(()=>m.value.length>0&&!!t.node.tag&&!w.value),L=D(()=>{var I,O,H;if(M.value)return{mode:"structured"};if(!f.value)return{mode:"html",content:(I=h.value)!=null?I:""};const R=(O=h.value)!=null?O:t.node.content;if(!R)return{mode:"html",content:""};if(o.value==="escape")return{mode:"html",content:lm(R,o.value)};if(t.node.loading){const P=mb(R,u.value,o.value);return P===null?{mode:"text",content:(H=t.node.raw)!=null?H:R}:{mode:"dynamic",nodes:P}}if(!kq(R,u.value))return{mode:"html",content:lm(R,o.value)};const F=mb(R,u.value,o.value);return F===null?{mode:"html",content:lm(R,o.value)}:{mode:"dynamic",nodes:F}}),E=Hx(),S=zx(),x=jx(),A=_u(null),T=!!t.node.loading;return typeof window<"u"?(ze([()=>d.value,()=>S?.value.heavyBlockMargin,()=>S?.value.rootMargin],([I],O,H)=>{var R,F,P,z;if((F=(R=A.value)==null?void 0:R.destroy)==null||F.call(R),A.value=null,!T)return f.value=!0,void(h.value=t.node.content);if(!I)return void(f.value=!1);let W=!0;const $=(z=(P=S?.value.heavyBlockMargin)!=null?P:S?.value.rootMargin)!=null?z:gp,K=E(I,{rootMargin:$,allowIdle:!x.value});A.value=K,f.value=f.value||K.isVisible.value,K.whenVisible.then(()=>{W&&A.value===K&&(f.value=!0)}),H(()=>{W=!1,K.destroy(),A.value===K&&(A.value=null)})},{immediate:!0}),ze(()=>t.node.content,I=>{T&&!f.value||(h.value=I)})):f.value=!0,ii(()=>{var I,O;(O=(I=A.value)==null?void 0:I.destroy)==null||O.call(I),A.value=null}),(I,O)=>(b(),fe(To(M.value?g.value:"div"),ci({ref_key:"htmlRef",ref:d,class:"html-block-node","data-markstream-viewport-pending":p(x)&&!f.value?"true":void 0},M.value?a.value:void 0),{default:de(()=>[f.value?(b(),N(Le,{key:0},[L.value.mode==="structured"?(b(),N(Le,{key:0},[k.value!==null?(b(),N(Le,{key:0},[_("summary",iJ(C$(v.value)),B(k.value),17),C.value.length?(b(),fe(p(r),ci({key:0},s.value,{nodes:C.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"])):X("",!0)],64)):(b(),fe(p(r),ci({key:1},s.value,{nodes:m.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes"]))],64)):L.value.mode==="dynamic"?(b(),fe(p(c),{key:1,nodes:L.value.nodes},null,8,["nodes"])):L.value.mode==="text"?(b(),N("pre",qke,B(L.value.content),1)):(b(),N("div",ci({key:3},l.value,{innerHTML:L.value.content}),null,16,Uke))],64)):(b(),N("div",Vke,[Hn(I.$slots,"placeholder",{node:e.node},()=>[O[0]||(O[0]=_("span",{class:"html-block-node__placeholder-bar"},null,-1)),O[1]||(O[1]=_("span",{class:"html-block-node__placeholder-bar w-4/5"},null,-1)),O[2]||(O[2]=_("span",{class:"html-block-node__placeholder-bar w-2/3"},null,-1))],!0)]))]),_:3},16,["data-markstream-viewport-pending"]))}}),[["__scopeId","data-v-e140a874"]]);Z0.install=e=>{e.component(Z0.__name,Z0)};const Kke={dir:"auto",class:"paragraph-node"},Zke=["custom-id"],rp=Ei(ot({__name:"ParagraphNode",props:{node:{},customId:{},indexKey:{},customHtmlTags:{},parseOptions:{},customMarkdownIt:{type:Function}},setup(e){const t=e,n=vs(()=>t.customId),i=en("markstreamHtmlPolicy",void 0),o=en("markstreamFade",void 0),s=en("markstreamParseOptions",void 0),r=en("markstreamCustomMarkdownIt",void 0),l=en("markstreamNestedRendererProps",void 0),a=D(()=>{var S;return(S=i?.value)!=null?S:"safe"}),u=D(()=>{var S;return(S=t.parseOptions)!=null?S:s?.value}),c=D(()=>{var S;return(S=t.customMarkdownIt)!=null?S:r?.value}),d=D(()=>{var S,x;return(x=t.customHtmlTags)!=null?x:(S=l?.value)==null?void 0:S.customHtmlTags}),f=D(()=>{var S,x;const A=(S=l?.value)!=null?S:{};return Dn(Bt({},A),{customId:(x=t.customId)!=null?x:A.customId,customHtmlTags:d.value,parseOptions:u.value,customMarkdownIt:c.value,htmlPolicy:a.value})}),h=Xu({loader:()=>Promise.resolve().then(()=>Xx),suspensible:!1});function m(S){var x;return S.type==="text"&&String((x=S.content)!=null?x:"").trim()===""}const g=D(()=>t.node.children.filter(S=>!m(S))),y=D(()=>g.value.length>0&&g.value.every(S=>S.type==="image"||(function(x){var A;const T=(function(I){return I.type==="link"&&Array.isArray(I.children)?I.children.filter(O=>!m(O)):[]})(x);return T.length===1&&((A=T[0])==null?void 0:A.type)==="image"})(S))),k=D(()=>new Set(Np(d.value))),v=D(()=>{if(!y.value||g.value.length<=1)return t.node.children;const S=[];for(let x=0;x0,I=t.node.children.slice(x+1).some(O=>!m(O));T&&I&&S.push(Dn(Bt({},A),{content:" ",raw:" "}))}return S}),C=D(()=>o?.value===!1&&!n.value.text),w=D(()=>C.value?vp(v.value):null);function M(S,x){return{node:S,"index-key":`${t.indexKey}-${x}`,"custom-id":t.customId,"custom-html-tags":d.value}}const L=D(()=>Bt({inline_code:Er,image:df,link:Xr,hardbreak:ff,emphasis:el,strong:Yr,strikethrough:Jr,highlight:ua,insert:El,subscript:Tl,superscript:Ml,html_inline:aa,html_block:Z0,emoji:Il,checkbox:ra,math_inline:Iu,checkbox_input:ra,reference:Qr,footnote_anchor:K0,footnote_reference:la,text:Fo},n.value)),E=D(()=>v.value.map((S,x)=>{var A;const T=(function(I){var O,H,R,F;if(I.type==="html_block"||I.type==="html_inline"){const P=String((O=I.tag)!=null?O:"").trim().toLowerCase()||YH(I.content);if(P&&!k.value.has(P)&&JH((H=I.content)!=null?H:I.raw,P)){const z=String((F=(R=I.content)!=null?R:I.raw)!=null?F:"");return{child:{type:"text",content:z,raw:z},component:Fo,isCustomComponent:!1}}}return{child:I,component:L.value[I.type],isCustomComponent:!!(n.value[I.type]&&!v2(String(I.type)))}})(S);return Dn(Bt({},T),{index:x,key:`${t.indexKey||"paragraph"}-${x}`,customAttrs:T.isCustomComponent?$x(T.child,a.value):void 0,hasSlotChildren:Array.isArray(T.child.children)&&T.child.children.length>0,slotContent:String((A=T.child.content)!=null?A:""),originalChild:S})}));return(S,x)=>(b(),N("p",Kke,[w.value!==null?(b(),N("span",{key:0,class:"text-node","custom-id":t.customId},B(w.value),9,Zke)):(b(!0),N(Le,{key:1},Ct(E.value,A=>{return b(),N(Le,{key:A.key},[y.value&&m(A.originalChild)?(b(),N(Le,{key:0},[Be(B((T=A.originalChild,String((I=T.content)!=null?I:""))),1)],64)):A.isCustomComponent?(b(),fe(To(A.component),ci({key:1,ref_for:!0},A.customAttrs,{node:A.child,loading:A.child.loading,"index-key":A.key,"custom-id":t.customId,"custom-html-tags":d.value,"is-dark":f.value.isDark}),{default:de(()=>[A.hasSlotChildren?(b(),fe(p(h),ci({key:0,ref_for:!0},f.value,{nodes:A.child.children,"index-key":A.key,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):A.slotContent?(b(),fe(p(h),ci({key:1,ref_for:!0},f.value,{content:A.slotContent,final:!A.child.loading,"index-key":`${A.key}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):X("",!0)]),_:2},1040,["node","loading","index-key","custom-id","custom-html-tags","is-dark"])):(b(),fe(To(A.component),ci({key:2,ref_for:!0},M(A.child,A.index)),null,16))],64);var T,I}),128))]))}}),[["__scopeId","data-v-c59ff506"]]);rp.install=e=>{e.component(rp.__name,rp)};const Gke={class:"table-node-wrapper"},Qke=["aria-busy"],Yke={key:0},Jke=["custom-id"],Xke=["aria-label","onPointerdown"],ebe=["custom-id"],tbe={key:0,class:"table-node__loading",role:"status","aria-live":"polite"},G0=Ei(ot({__name:"TableNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:["copy"],setup(e){const t=e,n=D(()=>{var k;return(k=t.node.loading)!=null&&k}),i=D(()=>{var k;return(k=t.node.rows)!=null?k:[]}),o=q(null),s=q([]);let r=null;const l=D(()=>t.node.header.cells.length),a=D(()=>s.value.some(k=>Number.isFinite(k)&&k>0)),u=D(()=>a.value?s.value.map(k=>k>0?{width:`${k}px`}:void 0):[]);Gn("markstreamShowTooltips",D(()=>t.showTooltips)),Gn("markstreamFade",D(()=>t.fade));const c=vs(()=>t.customId),d=D(()=>!!c.value.text),f=D(()=>!!c.value.paragraph),h=new WeakMap;function m(k){const v=t.fade===!1&&!d.value,C=!f.value,w=h.get(k);if(w?.children===k.children&&w.textFastPath===v&&w.paragraphFastPath===C)return w.info;const M=vb(k.children,C,!0),L={simpleChildren:M,plainText:M&&v?vp(M):null};return h.set(k,{children:k.children,textFastPath:v,paragraphFastPath:C,info:L}),L}function g(k){if(!r)return;k.preventDefault();const v=r.startWidth+r.nextStartWidth,C=Math.min(48,Math.floor(v/2)),w=Math.max(C,Math.min(v-C,Math.round(r.startWidth+k.clientX-r.startX))),M=[...r.widths];M[r.index]=w,M[r.index+1]=v-w,s.value=M}function y(){r&&(window.removeEventListener("pointermove",g),window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",y),r=null)}return ze(l,()=>{y(),s.value=[]}),ii(y),(k,v)=>(b(),N("div",Gke,[_("table",{ref_key:"tableRef",ref:o,class:De(["table-node",{"table-node--loading":n.value}]),"aria-busy":n.value},[a.value?(b(),N("colgroup",Yke,[(b(!0),N(Le,null,Ct(e.node.header.cells,(C,w)=>(b(),N("col",{key:w,style:on(u.value[w])},null,4))),128))])):X("",!0),_("thead",null,[_("tr",null,[(b(!0),N(Le,null,Ct(e.node.header.cells,(C,w)=>(b(),N("th",{key:w,dir:"auto",class:De([C.align==="right"?"text-right":C.align==="center"?"text-center":"text-left"])},[m(C).plainText!==null?(b(),N("span",{key:0,class:"text-node","custom-id":t.customId},B(m(C).plainText),9,Jke)):m(C).simpleChildren?(b(),fe(p(Pv),{key:1,nodes:m(C).simpleChildren,"custom-id":t.customId,"index-key":`table-th-${t.indexKey}-${w}`},null,8,["nodes","custom-id","index-key"])):(b(),fe(p(Ll),{key:2,nodes:C.children,"index-key":`table-th-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:v[0]||(v[0]=M=>k.$emit("copy",M))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"])),w(function(L,E){if(E.button!==0)return;const S=(function(){var T;const I=(T=o.value)==null?void 0:T.querySelectorAll("thead th");return Array.from(I??[],O=>Math.round(O.getBoundingClientRect().width))})(),x=S[L],A=S[L+1];x&&A&&(E.preventDefault(),r={index:L,startX:E.clientX,startWidth:x,nextStartWidth:A,widths:S},s.value=S,window.addEventListener("pointermove",g),window.addEventListener("pointerup",y),window.addEventListener("pointercancel",y))})(w,M)},null,40,Xke)):X("",!0)],2))),128))])]),_("tbody",null,[(b(!0),N(Le,null,Ct(i.value,(C,w)=>(b(),N("tr",{key:w},[(b(!0),N(Le,null,Ct(C.cells,(M,L)=>(b(),N("td",{key:L,class:De([M.align==="right"?"text-right":M.align==="center"?"text-center":"text-left"]),dir:"auto"},[m(M).plainText!==null?(b(),N("span",{key:0,class:"text-node","custom-id":t.customId},B(m(M).plainText),9,ebe)):m(M).simpleChildren?(b(),fe(p(Pv),{key:1,nodes:m(M).simpleChildren,"custom-id":t.customId,"index-key":`table-td-${t.indexKey}-${w}-${L}`},null,8,["nodes","custom-id","index-key"])):(b(),fe(p(Ll),{key:2,nodes:M.children,"index-key":`table-td-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:v[1]||(v[1]=E=>k.$emit("copy",E))},null,8,["nodes","index-key","custom-id","typewriter","fade","show-tooltips"]))],2))),128))]))),128))])],10,Qke),V(mo,{name:"table-node-fade"},{default:de(()=>[n.value?(b(),N("div",tbe,[Hn(k.$slots,"loading",{isLoading:n.value},()=>[v[2]||(v[2]=_("span",{class:"table-node__spinner animate-spin","aria-hidden":"true"},null,-1)),v[3]||(v[3]=_("span",{class:"sr-only"},"Loading",-1))],!0)])):X("",!0)]),_:3})]))}}),[["__scopeId","data-v-39f87b5d"]]);G0.install=e=>{e.component(G0.__name,G0)};const nbe={class:"hr-node"},q9=Ei({},[["render",function(e,t){return b(),N("hr",nbe)}],["__scopeId","data-v-39b2349c"]]);q9.install=e=>{e.component(q9.__name,q9)};const ibe={class:"unknown-node"},zA=ot({__name:"FallbackComponent",props:{node:{}},setup:e=>(t,n)=>(b(),N("div",ibe,B(e.node.raw),1))}),U9=Ei(ot({__name:"VmrContainerNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},setup(e){const t=e,n=D(()=>`vmr-container vmr-container-${t.node.name}`),i=vs(()=>t.customId),o=D(()=>Bt({text:Fo,paragraph:rp,heading:Z4,inline_code:Er,link:Xr,image:df,strong:Yr,emphasis:el,strikethrough:Jr,insert:El,subscript:Tl,superscript:Ml,checkbox:ra,checkbox_input:ra,hardbreak:ff,math_inline:Iu,reference:Qr,list:um,math_block:_q,table:G0},i.value));return(s,r)=>(b(),N("div",ci({class:n.value},e.node.attrs),[(b(!0),N(Le,null,Ct(e.node.children,(l,a)=>{return b(),fe(To((u=l.type,o.value[u]||zA)),{key:`${e.indexKey||"vmr-container"}-${a}`,"custom-id":t.customId,node:l,"index-key":`${e.indexKey||"vmr-container"}-${a}`,typewriter:t.typewriter,fade:t.fade},null,8,["custom-id","node","index-key","typewriter","fade"]);var u}),128))],16))}}),[["__scopeId","data-v-911e41c4"]]);U9.install=e=>{e.component(U9.__name,U9)};const obe=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","ON","ON","ET","ET","ET","ON","ON","ON","ON","ON","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","ON","ET","ET","ET","ET","ON","ON","ON","ON","L","ON","ON","BN","ON","ON","ET","ET","EN","EN","ON","L","ON","ON","ON","EN","L","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L"],oF=[[697,698,"ON"],[706,719,"ON"],[722,735,"ON"],[741,749,"ON"],[751,767,"ON"],[768,879,"NSM"],[884,885,"ON"],[894,894,"ON"],[900,901,"ON"],[903,903,"ON"],[1014,1014,"ON"],[1155,1161,"NSM"],[1418,1418,"ON"],[1421,1422,"ON"],[1423,1423,"ET"],[1424,1424,"R"],[1425,1469,"NSM"],[1470,1470,"R"],[1471,1471,"NSM"],[1472,1472,"R"],[1473,1474,"NSM"],[1475,1475,"R"],[1476,1477,"NSM"],[1478,1478,"R"],[1479,1479,"NSM"],[1480,1535,"R"],[1536,1541,"AN"],[1542,1543,"ON"],[1544,1544,"AL"],[1545,1546,"ET"],[1547,1547,"AL"],[1548,1548,"CS"],[1549,1549,"AL"],[1550,1551,"ON"],[1552,1562,"NSM"],[1563,1610,"AL"],[1611,1631,"NSM"],[1632,1641,"AN"],[1642,1642,"ET"],[1643,1644,"AN"],[1645,1647,"AL"],[1648,1648,"NSM"],[1649,1749,"AL"],[1750,1756,"NSM"],[1757,1757,"AN"],[1758,1758,"ON"],[1759,1764,"NSM"],[1765,1766,"AL"],[1767,1768,"NSM"],[1769,1769,"ON"],[1770,1773,"NSM"],[1774,1775,"AL"],[1776,1785,"EN"],[1786,1808,"AL"],[1809,1809,"NSM"],[1810,1839,"AL"],[1840,1866,"NSM"],[1867,1957,"AL"],[1958,1968,"NSM"],[1969,1983,"AL"],[1984,2026,"R"],[2027,2035,"NSM"],[2036,2037,"R"],[2038,2041,"ON"],[2042,2044,"R"],[2045,2045,"NSM"],[2046,2069,"R"],[2070,2073,"NSM"],[2074,2074,"R"],[2075,2083,"NSM"],[2084,2084,"R"],[2085,2087,"NSM"],[2088,2088,"R"],[2089,2093,"NSM"],[2094,2136,"R"],[2137,2139,"NSM"],[2140,2143,"R"],[2144,2191,"AL"],[2192,2193,"AN"],[2194,2198,"AL"],[2199,2207,"NSM"],[2208,2249,"AL"],[2250,2273,"NSM"],[2274,2274,"AN"],[2275,2306,"NSM"],[2362,2362,"NSM"],[2364,2364,"NSM"],[2369,2376,"NSM"],[2381,2381,"NSM"],[2385,2391,"NSM"],[2402,2403,"NSM"],[2433,2433,"NSM"],[2492,2492,"NSM"],[2497,2500,"NSM"],[2509,2509,"NSM"],[2530,2531,"NSM"],[2546,2547,"ET"],[2555,2555,"ET"],[2558,2558,"NSM"],[2561,2562,"NSM"],[2620,2620,"NSM"],[2625,2626,"NSM"],[2631,2632,"NSM"],[2635,2637,"NSM"],[2641,2641,"NSM"],[2672,2673,"NSM"],[2677,2677,"NSM"],[2689,2690,"NSM"],[2748,2748,"NSM"],[2753,2757,"NSM"],[2759,2760,"NSM"],[2765,2765,"NSM"],[2786,2787,"NSM"],[2801,2801,"ET"],[2810,2815,"NSM"],[2817,2817,"NSM"],[2876,2876,"NSM"],[2879,2879,"NSM"],[2881,2884,"NSM"],[2893,2893,"NSM"],[2901,2902,"NSM"],[2914,2915,"NSM"],[2946,2946,"NSM"],[3008,3008,"NSM"],[3021,3021,"NSM"],[3059,3064,"ON"],[3065,3065,"ET"],[3066,3066,"ON"],[3072,3072,"NSM"],[3076,3076,"NSM"],[3132,3132,"NSM"],[3134,3136,"NSM"],[3142,3144,"NSM"],[3146,3149,"NSM"],[3157,3158,"NSM"],[3170,3171,"NSM"],[3192,3198,"ON"],[3201,3201,"NSM"],[3260,3260,"NSM"],[3276,3277,"NSM"],[3298,3299,"NSM"],[3328,3329,"NSM"],[3387,3388,"NSM"],[3393,3396,"NSM"],[3405,3405,"NSM"],[3426,3427,"NSM"],[3457,3457,"NSM"],[3530,3530,"NSM"],[3538,3540,"NSM"],[3542,3542,"NSM"],[3633,3633,"NSM"],[3636,3642,"NSM"],[3647,3647,"ET"],[3655,3662,"NSM"],[3761,3761,"NSM"],[3764,3772,"NSM"],[3784,3790,"NSM"],[3864,3865,"NSM"],[3893,3893,"NSM"],[3895,3895,"NSM"],[3897,3897,"NSM"],[3898,3901,"ON"],[3953,3966,"NSM"],[3968,3972,"NSM"],[3974,3975,"NSM"],[3981,3991,"NSM"],[3993,4028,"NSM"],[4038,4038,"NSM"],[4141,4144,"NSM"],[4146,4151,"NSM"],[4153,4154,"NSM"],[4157,4158,"NSM"],[4184,4185,"NSM"],[4190,4192,"NSM"],[4209,4212,"NSM"],[4226,4226,"NSM"],[4229,4230,"NSM"],[4237,4237,"NSM"],[4253,4253,"NSM"],[4957,4959,"NSM"],[5008,5017,"ON"],[5120,5120,"ON"],[5760,5760,"WS"],[5787,5788,"ON"],[5906,5908,"NSM"],[5938,5939,"NSM"],[5970,5971,"NSM"],[6002,6003,"NSM"],[6068,6069,"NSM"],[6071,6077,"NSM"],[6086,6086,"NSM"],[6089,6099,"NSM"],[6107,6107,"ET"],[6109,6109,"NSM"],[6128,6137,"ON"],[6144,6154,"ON"],[6155,6157,"NSM"],[6158,6158,"BN"],[6159,6159,"NSM"],[6277,6278,"NSM"],[6313,6313,"NSM"],[6432,6434,"NSM"],[6439,6440,"NSM"],[6450,6450,"NSM"],[6457,6459,"NSM"],[6464,6464,"ON"],[6468,6469,"ON"],[6622,6655,"ON"],[6679,6680,"NSM"],[6683,6683,"NSM"],[6742,6742,"NSM"],[6744,6750,"NSM"],[6752,6752,"NSM"],[6754,6754,"NSM"],[6757,6764,"NSM"],[6771,6780,"NSM"],[6783,6783,"NSM"],[6832,6877,"NSM"],[6880,6891,"NSM"],[6912,6915,"NSM"],[6964,6964,"NSM"],[6966,6970,"NSM"],[6972,6972,"NSM"],[6978,6978,"NSM"],[7019,7027,"NSM"],[7040,7041,"NSM"],[7074,7077,"NSM"],[7080,7081,"NSM"],[7083,7085,"NSM"],[7142,7142,"NSM"],[7144,7145,"NSM"],[7149,7149,"NSM"],[7151,7153,"NSM"],[7212,7219,"NSM"],[7222,7223,"NSM"],[7376,7378,"NSM"],[7380,7392,"NSM"],[7394,7400,"NSM"],[7405,7405,"NSM"],[7412,7412,"NSM"],[7416,7417,"NSM"],[7616,7679,"NSM"],[8125,8125,"ON"],[8127,8129,"ON"],[8141,8143,"ON"],[8157,8159,"ON"],[8173,8175,"ON"],[8189,8190,"ON"],[8192,8202,"WS"],[8203,8205,"BN"],[8207,8207,"R"],[8208,8231,"ON"],[8232,8232,"WS"],[8233,8233,"B"],[8234,8238,"BN"],[8239,8239,"CS"],[8240,8244,"ET"],[8245,8259,"ON"],[8260,8260,"CS"],[8261,8286,"ON"],[8287,8287,"WS"],[8288,8303,"BN"],[8304,8304,"EN"],[8308,8313,"EN"],[8314,8315,"ES"],[8316,8318,"ON"],[8320,8329,"EN"],[8330,8331,"ES"],[8332,8334,"ON"],[8352,8399,"ET"],[8400,8432,"NSM"],[8448,8449,"ON"],[8451,8454,"ON"],[8456,8457,"ON"],[8468,8468,"ON"],[8470,8472,"ON"],[8478,8483,"ON"],[8485,8485,"ON"],[8487,8487,"ON"],[8489,8489,"ON"],[8494,8494,"ET"],[8506,8507,"ON"],[8512,8516,"ON"],[8522,8525,"ON"],[8528,8543,"ON"],[8585,8587,"ON"],[8592,8721,"ON"],[8722,8722,"ES"],[8723,8723,"ET"],[8724,9013,"ON"],[9083,9108,"ON"],[9110,9257,"ON"],[9280,9290,"ON"],[9312,9351,"ON"],[9352,9371,"EN"],[9450,9899,"ON"],[9901,10239,"ON"],[10496,11123,"ON"],[11126,11263,"ON"],[11493,11498,"ON"],[11503,11505,"NSM"],[11513,11519,"ON"],[11647,11647,"NSM"],[11744,11775,"NSM"],[11776,11869,"ON"],[11904,11929,"ON"],[11931,12019,"ON"],[12032,12245,"ON"],[12272,12287,"ON"],[12288,12288,"WS"],[12289,12292,"ON"],[12296,12320,"ON"],[12330,12333,"NSM"],[12336,12336,"ON"],[12342,12343,"ON"],[12349,12351,"ON"],[12441,12442,"NSM"],[12443,12444,"ON"],[12448,12448,"ON"],[12539,12539,"ON"],[12736,12773,"ON"],[12783,12783,"ON"],[12829,12830,"ON"],[12880,12895,"ON"],[12924,12926,"ON"],[12977,12991,"ON"],[13004,13007,"ON"],[13175,13178,"ON"],[13278,13279,"ON"],[13311,13311,"ON"],[19904,19967,"ON"],[42128,42182,"ON"],[42509,42511,"ON"],[42607,42610,"NSM"],[42611,42611,"ON"],[42612,42621,"NSM"],[42622,42623,"ON"],[42654,42655,"NSM"],[42736,42737,"NSM"],[42752,42785,"ON"],[42888,42888,"ON"],[43010,43010,"NSM"],[43014,43014,"NSM"],[43019,43019,"NSM"],[43045,43046,"NSM"],[43048,43051,"ON"],[43052,43052,"NSM"],[43064,43065,"ET"],[43124,43127,"ON"],[43204,43205,"NSM"],[43232,43249,"NSM"],[43263,43263,"NSM"],[43302,43309,"NSM"],[43335,43345,"NSM"],[43392,43394,"NSM"],[43443,43443,"NSM"],[43446,43449,"NSM"],[43452,43453,"NSM"],[43493,43493,"NSM"],[43561,43566,"NSM"],[43569,43570,"NSM"],[43573,43574,"NSM"],[43587,43587,"NSM"],[43596,43596,"NSM"],[43644,43644,"NSM"],[43696,43696,"NSM"],[43698,43700,"NSM"],[43703,43704,"NSM"],[43710,43711,"NSM"],[43713,43713,"NSM"],[43756,43757,"NSM"],[43766,43766,"NSM"],[43882,43883,"ON"],[44005,44005,"NSM"],[44008,44008,"NSM"],[44013,44013,"NSM"],[64285,64285,"R"],[64286,64286,"NSM"],[64287,64296,"R"],[64297,64297,"ES"],[64298,64335,"R"],[64336,64450,"AL"],[64451,64466,"ON"],[64467,64829,"AL"],[64830,64847,"ON"],[64848,64911,"AL"],[64912,64913,"ON"],[64914,64967,"AL"],[64968,64975,"ON"],[64976,65007,"BN"],[65008,65020,"AL"],[65021,65023,"ON"],[65024,65039,"NSM"],[65040,65049,"ON"],[65056,65071,"NSM"],[65072,65103,"ON"],[65104,65104,"CS"],[65105,65105,"ON"],[65106,65106,"CS"],[65108,65108,"ON"],[65109,65109,"CS"],[65110,65118,"ON"],[65119,65119,"ET"],[65120,65121,"ON"],[65122,65123,"ES"],[65124,65126,"ON"],[65128,65128,"ON"],[65129,65130,"ET"],[65131,65131,"ON"],[65136,65278,"AL"],[65279,65279,"BN"],[65281,65282,"ON"],[65283,65285,"ET"],[65286,65290,"ON"],[65291,65291,"ES"],[65292,65292,"CS"],[65293,65293,"ES"],[65294,65295,"CS"],[65296,65305,"EN"],[65306,65306,"CS"],[65307,65312,"ON"],[65339,65344,"ON"],[65371,65381,"ON"],[65504,65505,"ET"],[65506,65508,"ON"],[65509,65510,"ET"],[65512,65518,"ON"],[65520,65528,"BN"],[65529,65533,"ON"],[65534,65535,"BN"],[65793,65793,"ON"],[65856,65932,"ON"],[65936,65948,"ON"],[65952,65952,"ON"],[66045,66045,"NSM"],[66272,66272,"NSM"],[66273,66299,"EN"],[66422,66426,"NSM"],[67584,67870,"R"],[67871,67871,"ON"],[67872,68096,"R"],[68097,68099,"NSM"],[68100,68100,"R"],[68101,68102,"NSM"],[68103,68107,"R"],[68108,68111,"NSM"],[68112,68151,"R"],[68152,68154,"NSM"],[68155,68158,"R"],[68159,68159,"NSM"],[68160,68324,"R"],[68325,68326,"NSM"],[68327,68408,"R"],[68409,68415,"ON"],[68416,68863,"R"],[68864,68899,"AL"],[68900,68903,"NSM"],[68904,68911,"AL"],[68912,68921,"AN"],[68922,68927,"AL"],[68928,68937,"AN"],[68938,68968,"R"],[68969,68973,"NSM"],[68974,68974,"ON"],[68975,69215,"R"],[69216,69246,"AN"],[69247,69290,"R"],[69291,69292,"NSM"],[69293,69311,"R"],[69312,69327,"AL"],[69328,69336,"ON"],[69337,69369,"AL"],[69370,69375,"NSM"],[69376,69423,"R"],[69424,69445,"AL"],[69446,69456,"NSM"],[69457,69487,"AL"],[69488,69505,"R"],[69506,69509,"NSM"],[69510,69631,"R"],[69633,69633,"NSM"],[69688,69702,"NSM"],[69714,69733,"ON"],[69744,69744,"NSM"],[69747,69748,"NSM"],[69759,69761,"NSM"],[69811,69814,"NSM"],[69817,69818,"NSM"],[69826,69826,"NSM"],[69888,69890,"NSM"],[69927,69931,"NSM"],[69933,69940,"NSM"],[70003,70003,"NSM"],[70016,70017,"NSM"],[70070,70078,"NSM"],[70089,70092,"NSM"],[70095,70095,"NSM"],[70191,70193,"NSM"],[70196,70196,"NSM"],[70198,70199,"NSM"],[70206,70206,"NSM"],[70209,70209,"NSM"],[70367,70367,"NSM"],[70371,70378,"NSM"],[70400,70401,"NSM"],[70459,70460,"NSM"],[70464,70464,"NSM"],[70502,70508,"NSM"],[70512,70516,"NSM"],[70587,70592,"NSM"],[70606,70606,"NSM"],[70608,70608,"NSM"],[70610,70610,"NSM"],[70625,70626,"NSM"],[70712,70719,"NSM"],[70722,70724,"NSM"],[70726,70726,"NSM"],[70750,70750,"NSM"],[70835,70840,"NSM"],[70842,70842,"NSM"],[70847,70848,"NSM"],[70850,70851,"NSM"],[71090,71093,"NSM"],[71100,71101,"NSM"],[71103,71104,"NSM"],[71132,71133,"NSM"],[71219,71226,"NSM"],[71229,71229,"NSM"],[71231,71232,"NSM"],[71264,71276,"ON"],[71339,71339,"NSM"],[71341,71341,"NSM"],[71344,71349,"NSM"],[71351,71351,"NSM"],[71453,71453,"NSM"],[71455,71455,"NSM"],[71458,71461,"NSM"],[71463,71467,"NSM"],[71727,71735,"NSM"],[71737,71738,"NSM"],[71995,71996,"NSM"],[71998,71998,"NSM"],[72003,72003,"NSM"],[72148,72151,"NSM"],[72154,72155,"NSM"],[72160,72160,"NSM"],[72193,72198,"NSM"],[72201,72202,"NSM"],[72243,72248,"NSM"],[72251,72254,"NSM"],[72263,72263,"NSM"],[72273,72278,"NSM"],[72281,72283,"NSM"],[72330,72342,"NSM"],[72344,72345,"NSM"],[72544,72544,"NSM"],[72546,72548,"NSM"],[72550,72550,"NSM"],[72752,72758,"NSM"],[72760,72765,"NSM"],[72850,72871,"NSM"],[72874,72880,"NSM"],[72882,72883,"NSM"],[72885,72886,"NSM"],[73009,73014,"NSM"],[73018,73018,"NSM"],[73020,73021,"NSM"],[73023,73029,"NSM"],[73031,73031,"NSM"],[73104,73105,"NSM"],[73109,73109,"NSM"],[73111,73111,"NSM"],[73459,73460,"NSM"],[73472,73473,"NSM"],[73526,73530,"NSM"],[73536,73536,"NSM"],[73538,73538,"NSM"],[73562,73562,"NSM"],[73685,73692,"ON"],[73693,73696,"ET"],[73697,73713,"ON"],[78912,78912,"NSM"],[78919,78933,"NSM"],[90398,90409,"NSM"],[90413,90415,"NSM"],[92912,92916,"NSM"],[92976,92982,"NSM"],[94031,94031,"NSM"],[94095,94098,"NSM"],[94178,94178,"ON"],[94180,94180,"NSM"],[113821,113822,"NSM"],[113824,113827,"BN"],[117760,117973,"ON"],[118e3,118009,"EN"],[118010,118012,"ON"],[118016,118451,"ON"],[118458,118480,"ON"],[118496,118512,"ON"],[118528,118573,"NSM"],[118576,118598,"NSM"],[119143,119145,"NSM"],[119155,119162,"BN"],[119163,119170,"NSM"],[119173,119179,"NSM"],[119210,119213,"NSM"],[119273,119274,"ON"],[119296,119361,"ON"],[119362,119364,"NSM"],[119365,119365,"ON"],[119552,119638,"ON"],[120513,120513,"ON"],[120539,120539,"ON"],[120571,120571,"ON"],[120597,120597,"ON"],[120629,120629,"ON"],[120655,120655,"ON"],[120687,120687,"ON"],[120713,120713,"ON"],[120745,120745,"ON"],[120771,120771,"ON"],[120782,120831,"EN"],[121344,121398,"NSM"],[121403,121452,"NSM"],[121461,121461,"NSM"],[121476,121476,"NSM"],[121499,121503,"NSM"],[121505,121519,"NSM"],[122880,122886,"NSM"],[122888,122904,"NSM"],[122907,122913,"NSM"],[122915,122916,"NSM"],[122918,122922,"NSM"],[123023,123023,"NSM"],[123184,123190,"NSM"],[123566,123566,"NSM"],[123628,123631,"NSM"],[123647,123647,"ET"],[124140,124143,"NSM"],[124398,124399,"NSM"],[124643,124643,"NSM"],[124646,124646,"NSM"],[124654,124655,"NSM"],[124661,124661,"NSM"],[124928,125135,"R"],[125136,125142,"NSM"],[125143,125251,"R"],[125252,125258,"NSM"],[125259,126063,"R"],[126064,126143,"AL"],[126144,126207,"R"],[126208,126287,"AL"],[126288,126463,"R"],[126464,126703,"AL"],[126704,126705,"ON"],[126706,126719,"AL"],[126720,126975,"R"],[126976,127019,"ON"],[127024,127123,"ON"],[127136,127150,"ON"],[127153,127167,"ON"],[127169,127183,"ON"],[127185,127221,"ON"],[127232,127242,"EN"],[127243,127247,"ON"],[127279,127279,"ON"],[127338,127343,"ON"],[127405,127405,"ON"],[127584,127589,"ON"],[127744,128728,"ON"],[128732,128748,"ON"],[128752,128764,"ON"],[128768,128985,"ON"],[128992,129003,"ON"],[129008,129008,"ON"],[129024,129035,"ON"],[129040,129095,"ON"],[129104,129113,"ON"],[129120,129159,"ON"],[129168,129197,"ON"],[129200,129211,"ON"],[129216,129217,"ON"],[129232,129240,"ON"],[129280,129623,"ON"],[129632,129645,"ON"],[129648,129660,"ON"],[129664,129674,"ON"],[129678,129734,"ON"],[129736,129736,"ON"],[129741,129756,"ON"],[129759,129770,"ON"],[129775,129784,"ON"],[129792,129938,"ON"],[129940,130031,"ON"],[130032,130041,"EN"],[130042,130042,"ON"],[131070,131071,"BN"],[196606,196607,"BN"],[262142,262143,"BN"],[327678,327679,"BN"],[393214,393215,"BN"],[458750,458751,"BN"],[524286,524287,"BN"],[589822,589823,"BN"],[655358,655359,"BN"],[720894,720895,"BN"],[786430,786431,"BN"],[851966,851967,"BN"],[917502,917759,"BN"],[917760,917999,"NSM"],[918e3,921599,"BN"],[983038,983039,"BN"],[1048574,1048575,"BN"],[1114110,1114111,"BN"]];function sbe(e){if(e<=255)return obe[e];let t=0,n=oF.length-1;for(;t<=n;){const i=t+n>>1,o=oF[i];if(eo[1]))return o[2];t=i+1}}return"L"}const rbe=/[ \t\n\r\f]+/g,lbe=/[\t\n\r\f]| {2,}|^ | $/;let b8=null;const abe=new RegExp("\\p{Script=Arabic}","u"),Mf=new RegExp("\\p{M}","u"),qx=new RegExp("\\p{Nd}","u");function sF(e){return abe.test(e)}function rF(e){return e>=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=183984&&e<=191471||e>=191472&&e<=192093||e>=194560&&e<=195103||e>=196608&&e<=201551||e>=201552&&e<=205743||e>=205744&&e<=210041||e>=63744&&e<=64255||e>=12288&&e<=12351||e>=12352&&e<=12447||e>=12448&&e<=12543||e>=12592&&e<=12687||e>=44032&&e<=55215||e>=65280&&e<=65519}function tc(e){for(let t=0;t=55296&&n<=56319&&t+1=56320&&i<=57343){if(rF(i-56320+(n-55296<<10)+65536))return!0;t++;continue}}if(rF(n))return!0}}return!1}const ube=new Set([" "," ","⁠","\uFEFF"]),cbe=new Set(["-","‐","–","—"]);function Iq(e,t){return!((function(n){const i=Q0(n);return i!==null&&ube.has(i)})(e)||t&&((function(n){const i=Q0(n);return i!==null&&(Ux.has(i)||yp.has(i))})(e)||(function(n){const i=Q0(n);return i!==null&&cbe.has(i)})(e)))}const Ux=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),G4=new Set(['"',"(","[","{","¡","¿","“","‘","‚","„","«","‹","⸘","(","〔","〈","《","「","『","【","〖","〘","〚"]),Vx=new Set(["'","’"]),yp=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","»","›","…"]),dbe=new Set([":",".","،","؛"]),fbe=new Set(["၏"]),hbe=new Set(["”","’","»","›","」","』","】","》","〉","〕",")"]);function pbe(e){if(Kx(e))return!0;let t=!1;for(const n of e)if(yp.has(n)||kb(n))t=!0;else if(!t||!Mf.test(n))return!1;return t}function mbe(e){for(const t of e)if(!Ux.has(t)&&!yp.has(t))return!1;return e.length>0}function gbe(e){if(Kx(e))return!0;for(const t of e)if(!(G4.has(t)||Vx.has(t)||Mf.test(t)||kb(t)))return!1;return e.length>0}function Kx(e){let t=!1;for(const n of e)if(n!=="\\"&&!Mf.test(n)){if(!(G4.has(n)||yp.has(n)||Vx.has(n)))return!1;t=!0}return t}function yb(e,t){const n=t-1;if(n<=0)return Math.max(n,0);const i=e.charCodeAt(n);if(i<56320||i>57343)return n;const o=n-1;if(o<0)return n;const s=e.charCodeAt(o);return s>=55296&&s<=56319?o:n}function Q0(e){if(e.length===0)return null;const t=yb(e,e.length);return e.slice(t)}const vbe=[36,37,43,43,92,92,162,165,176,177,1423,1423,1545,1547,1642,1642,2046,2047,2546,2547,2553,2555,2801,2801,3065,3065,3449,3449,3647,3647,6107,6107,8240,8247,8279,8279,8352,8399,8451,8451,8457,8457,8470,8470,8722,8723,43064,43064,65020,65020,65129,65130,65284,65285,65504,65505,65509,65510,73693,73696,123647,123647,126124,126124,126128,126128];function kb(e){const t=e.codePointAt(0);return t!==void 0&&(function(n,i){for(let o=0;o=i[o]&&n<=i[o+1])return!0;return!1})(t,vbe)}function ybe(e){const t=(function(n){for(const i of n)if(!Mf.test(i))return i;return null})(e);return t!==null&&qx.test(t)}function kbe(e){const t=Array.from(e);let n=t.length;for(;n>0;){const i=t[n-1];if(Mf.test(i))n--;else{if(!G4.has(i)&&!Vx.has(i))break;n--}}return n<=0||n===t.length?null:{head:t.slice(0,n).join(""),tail:t.slice(n).join("")}}function bbe(e,t,n){return n!=="text"||t||e.length!==1||e==="-"||e==="—"?null:e}function lF(e,t,n,i){const o=t[i],s=e[i];if(o==null)return s;const r=n[i];if(s.length===r)return s;const l=o.repeat(r);return e[i]=l,l}function aF(e,t){return e&&t!==null&&dbe.has(t)}function wbe(e){const t=Q0(e);return t!==null&&fbe.has(t)}function Cbe(e){if(e.length<2||e[0]!==" ")return null;const t=e.slice(1);return new RegExp("^\\p{M}+$","u").test(t)?{space:" ",marks:t}:null}function jA(e){let t=e.length;for(;t>0;){const n=yb(e,t),i=e.slice(n,t);if(hbe.has(i))return!0;if(!yp.has(i))return!1;t=n}return!1}function Abe(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(e===" ")return"preserved-space";if(e===" ")return"tab";if(t.preserveHardBreaks&&e===` -`)return"hard-break"}return e===" "?"space":e===" "||e===" "||e==="⁠"||e==="\uFEFF"?"glue":e==="​"?"zero-width-break":e==="­"?"soft-hyphen":"text"}const xbe=/[\x20\t\n\xA0\xAD\u200B\u202F\u2060\uFEFF]/;function ru(e){return e.length===1?e[0]:e.join("")}function Sbe(e,t){const n=[];for(let i=e.length-1;i>=0;i--)n.push(e[i]);return n.push(t),ru(n)}function _be(e,t,n,i){if(!xbe.test(e))return[{text:e,isWordLike:t,kind:"text",start:n}];const o=[];let s=null,r=[],l=n,a=!1,u=0;for(const c of e){const d=Abe(c,i),f=d==="text"&&t;s===null||d!==s||f!==a?(s!==null&&o.push({text:ru(r),isWordLike:a,kind:s,start:l}),s=d,r=[c],l=n+u,a=f,u+=c.length):(r.push(c),u+=c.length)}return s!==null&&o.push({text:ru(r),isWordLike:a,kind:s,start:l}),o}function w8(e){return e==="space"||e==="preserved-space"||e==="zero-width-break"||e==="hard-break"}const Ibe=/^[A-Za-z][A-Za-z0-9+.-]*:$/;function Mbe(e,t){const n=e.texts[t];return!!n.startsWith("www.")||Ibe.test(n)&&t+1=33&&n<=47&&n!==45||n>=58&&n<=64&&n!==63||n>=91&&n<=96||n>=123&&n<=126})(t):!Fbe.has(e)&&!Nbe.test(e)&&Lbe.test(e)}function uF(e){let t=!1;for(const n of e)if(!Mf.test(n)){if(!Mq(n))return!1;t=!0}return t}function Dbe(e,t,n,i){const o=!t&&uF(e),s=!i&&uF(n),r=(function(a){const u=(function(c){for(let d=c.length;d>0;){const f=yb(c,d),h=c.slice(f,d);if(!Mf.test(h))return h;d=f}return null})(a);return u!==null&&kb(u)})(e),l=(t||r)&&(function(a){for(let u=a.length;u>0;){const c=yb(a,u),d=a.slice(c,u);if(!Mf.test(d))return Mq(d)||kb(d);u=c}return!1})(e);return!!(o||s||l)&&!tc(e)&&!tc(n)&&(t||o||r)&&(i||s)}function cF(e){for(const t of e)if(qx.test(t))return!0;return!1}function V9(e){if(e.length===0)return!1;for(const t of e)if(!qx.test(t)&&!Ebe.has(t))return!1;return!0}function Rbe(e,t){if(e.len===0)return[];if(!t.preserveHardBreaks)return[{startSegmentIndex:0,endSegmentIndex:e.len,consumedEndSegmentIndex:e.len}];const n=[];let i=0;for(let o=0;o0&&u.charCodeAt(u.length-1)===32&&(u=u.slice(0,-1)),u})(e);if(s.length===0)return{normalized:s,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};const r=(function(a,u,c){var d,f,h;const m=(b8===null&&(b8=new Intl.Segmenter(void 0,{granularity:"word"})),b8);let g=0;const y=[],k=[],v=[],C=[],w=[],M=[],L=[],E=[],S=[],x=[],A=[],T=[];for(const F of m.segment(a))for(const P of _be(F.segment,(d=F.isWordLike)!=null&&d,F.index,c)){let z=function(){M[ie]!==null&&(k[ie]=[lF(y,M,L,ie)],M[ie]=null),k[ie].push(P.text),v[ie]=v[ie]||P.isWordLike,E[ie]=E[ie]||K,S[ie]=S[ie]||ne,x[ie]=te,A[ie]=le,T[ie]=aF(S[ie],G)};const W=P.kind==="text",$=bbe(P.text,P.isWordLike,P.kind),K=tc(P.text),ne=sF(P.text),G=Q0(P.text),te=jA(P.text),le=wbe(P.text),ie=g-1;u.carryCJKAfterClosingQuote&&W&&g>0&&C[ie]==="text"&&K&&E[ie]&&x[ie]||W&&g>0&&C[ie]==="text"&&mbe(P.text)&&E[ie]||W&&g>0&&C[ie]==="text"&&A[ie]?z():W&&g>0&&C[ie]==="text"&&P.isWordLike&&ne&&T[ie]?(z(),v[ie]=!0):$!==null&&g>0&&C[ie]==="text"&&M[ie]===$?L[ie]=((f=L[ie])!=null?f:1)+1:W&&!P.isWordLike&&g>0&&C[ie]==="text"&&!E[ie]&&(pbe(P.text)||P.text==="-"&&v[ie])?z():(y[g]=P.text,k[g]=[P.text],v[g]=P.isWordLike,C[g]=P.kind,w[g]=P.start,M[g]=$,L[g]=$===null?0:1,E[g]=K,S[g]=ne,x[g]=te,A[g]=le,T[g]=aF(ne,G),g++)}for(let F=0;Fnull);let O=-1;for(let F=g-1;F>=0;F--){const P=y[F];if(P.length!==0){if(C[F]==="text"&&!v[F]&&O>=0&&C[O]==="text"&&(gbe(P)||P==="-"&&ybe(y[O]))){const z=(h=I[O])!=null?h:[];z.push(P),I[O]=z,w[O]=w[F],y[F]="";continue}O=F}}for(let F=0;FK+1){P.push(ru(le)),z.push(_e),W.push("text"),$.push(F.starts[K]),K=ie;continue}}P.push(ne),z.push(te),W.push(G),$.push(F.starts[K]),K++}return{len:P.length,texts:P,isWordLike:z,kinds:W,starts:$}})((function(F){const P=[],z=[],W=[],$=[];for(let K=0;K1;for(let le=0;le=F.len||w8(F.kinds[G]))continue;const te=[],le=F.starts[G];let ie=G;for(;ie0&&(P.push(ru(te)),z.push(!0),W.push("text"),$.push(le),K=ie-1)}return{len:P.length,texts:P,isWordLike:z,kinds:W,starts:$}})((function(F){const P=F.texts.slice(),z=F.isWordLike.slice(),W=F.kinds.slice(),$=F.starts.slice();for(let ne=0;ne=0&&!Iq(u.texts[C-1],c)&&v(C),g<0&&(g=C),y=y||tc(w))}return v(u.len),{len:d.length,texts:d,isWordLike:f,kinds:h,starts:m}})(s,r,t.breakKeepAllAfterPunctuation):r;return Bt({normalized:s,chunks:Rbe(l,o)},l)}let u1=null;const dF=new Map;let c1=null;const Pbe=new RegExp("\\p{Emoji_Presentation}","u"),Bbe=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Regional_Indicator}\uFE0F\u20E3]/u;let C8=null;const fF=new Map;function HA(){if(u1!==null)return u1;if(typeof OffscreenCanvas<"u")return u1=new OffscreenCanvas(1,1).getContext("2d"),u1;if(typeof document<"u")return u1=document.createElement("canvas").getContext("2d"),u1;throw new Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function Nd(e,t){let n=t.get(e);return n===void 0&&(n={width:HA().measureText(e).width,containsCJK:tc(e)},t.set(e,n)),n}function bb(){if(c1!==null)return c1;if(typeof navigator>"u")return c1={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,breakKeepAllAfterPunctuation:!0,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1},c1;const e=navigator.userAgent,t=navigator.vendor==="Apple Computer, Inc."&&e.includes("Safari/")&&!e.includes("Chrome/")&&!e.includes("Chromium/")&&!e.includes("CriOS/")&&!e.includes("FxiOS/")&&!e.includes("EdgiOS/"),n=e.includes("Chrome/")||e.includes("Chromium/")||e.includes("CriOS/")||e.includes("Edg/");return c1={lineFitEpsilon:t?1/64:.005,carryCJKAfterClosingQuote:n,breakKeepAllAfterPunctuation:!t,preferPrefixWidthsForBreakableRuns:t,preferEarlySoftHyphenBreak:t},c1}function Tq(){return C8===null&&(C8=new Intl.Segmenter(void 0,{granularity:"grapheme"})),C8}function $be(e){return Pbe.test(e)||e.includes("️")}function mh(e,t,n){return n===0?t.width:t.width-(function(i,o){return o.emojiCount===void 0&&(o.emojiCount=(function(s){let r=0;const l=Tq();for(const a of l.segment(s))$be(a.segment)&&r++;return r})(i)),o.emojiCount})(e,t)*n}function zbe(e){return e==="space"||e==="zero-width-break"||e==="soft-hyphen"}function hF(e){return e==="space"||e==="preserved-space"||e==="tab"||e==="zero-width-break"||e==="soft-hyphen"}function pF(e,t,n=e.widths.length){for(;t0?e.letterSpacing:0}function Zx(e,t){return t===0?0:e+t}function Wbe(e,t,n,i,o){return Zx(i,t==="tab"?o+(function(s,r){return s.letterSpacing!==0&&s.spacingGraphemeCounts[r]>0?s.letterSpacing:0})(e,n):e.lineEndFitAdvances[n])}function mF(e,t,n,i){return Zx(i,t==="tab"?0:e.lineEndFitAdvances[n])}function gF(e,t,n,i,o){return Zx(i,t==="tab"?o:e.lineEndPaintAdvances[n])}function qbe(e,t,n){return e.letterSpacing!==0&&t?n+e.letterSpacing:n}function Ube(e,t){return e.letterSpacing===0?t:t+e.letterSpacing}function Ry(e,t,n){let i=t;for(;iz){if(me!==null&&ee>U){ie(J,ee,re),ge=ee,pe=Ry(me,pe,ge+1),ee=-1,re=0;continue}ie(),Z(J,ge,ae)}else $+=ae,ne=J,G=ge+1;else Z(J,ge,ae);const Ce=ge+1;me!==null&&me[pe]===Ce&&(ee=Ce,re=$,pe++),ge++}K&&ne===J&&G===ue.length&&(ne=J+1,G=0)}let Y=0;for(;Y=H.length)));){const J=H[Y],U=hF(R[Y]);if(K)if($+J>z){if(U){se(Y,J),ie(Y+1,0,$-J),Y++;continue}if(te>=0){if(ne>te||ne===te&&G>0){ie();continue}ie(te,0,le);continue}if(J>z&&F[Y]!==null){ie(),he(Y,0),Y++;continue}ie()}else se(Y,J),U&&(te=Y+1,le=$-J),Y++;else J>z&&F[Y]!==null?he(Y,0):_e(Y,J),U&&(te=Y+1,le=$-J),Y++}return K&&ie(),W})(n,i);const{widths:o,kinds:s,breakableFitAdvances:r,breakablePreferredBreaks:l,discretionaryHyphenWidth:a,chunks:u}=n;if(o.length===0||u.length===0)return 0;const c=bb(),d=i+c.lineFitEpsilon;let f=0,h=0,m=!1,g=0,y=0,k=-1,v=0,C=null;function w(){k=-1,v=0,C=null}function M(I=g,O=y,H){f++,h=0,m=!1,w()}function L(I,O){m=!0,g=I+1,y=0,h=O}function E(I,O,H){m=!0,g=I,y=O+1,h=H}function S(I,O){m?(h+=O,g=I+1,y=0):L(I,O)}function x(I,O,H,R,F,P){if(!O)return;const z=mF(n,I,H,F);gF(n,I,H,F,R),k=H+1,v=h-P+z,C=I}function A(I,O){var H;const R=r[I],F=(H=l[I])!=null?H:null;let P=F===null?-1:Ry(F,0,O+1),z=-1,W=O;for(;Wd){if(F!==null&&z>O){M(I,z),W=z,P=Ry(F,P,W+1),z=-1;continue}M(),E(I,W,$)}else h=G,g=I,y=W+1}else E(I,W,$);const K=W+1;F!==null&&F[P]===K&&(z=K,P++),W++}m&&g===I&&y===R.length&&(g=I+1,y=0)}function T(I){f++,w()}for(let I=0;I=O.endSegmentIndex)));){const R=s[H],F=hF(R),P=Hbe(n,m,H),z=R==="tab"?jbe(h+P,n.tabStopAdvance):o[H],W=P+z,$=Wbe(n,R,H,P,z);if(R!=="soft-hyphen")if(m){if(h+$>d){const K=h+mF(n,R,H,P);if(gF(n,R,H,P,z),C==="soft-hyphen"&&c.preferEarlySoftHyphenBreak&&v<=d){M(k,0);continue}if(F&&K<=d){S(H,W),M(H+1,0),H++;continue}if(k>=0&&v<=d){if(g>k||g===k&&y>0){M();continue}const ne=k;M(ne,0),H=ne;continue}if($>d&&r[H]!==null){M(),A(H,0),H++;continue}M();continue}S(H,W),x(R,F,H,z,P,W),H++}else $>d&&r[H]!==null?A(H,0):L(H,z),x(R,F,H,z,P,W),H++;else m&&(g=H+1,y=0,k=H+1,v=h+a,C=R),H++}m&&(O.consumedEndSegmentIndex,M(O.consumedEndSegmentIndex,0))}return f})(e,t)}let A8=null;function Gx(){return A8===null&&(A8=new Intl.Segmenter(void 0,{granularity:"grapheme"})),A8}function Kbe(e,t){const n=[];let i=[],o=0,s=!1,r=!1,l=!1;function a(){i.length!==0&&(n.push({text:i.length===1?i[0]:i.join(""),start:o}),i=[],s=!1,r=!1,l=!1)}function u(d,f,h){i=[d],o=f,s=h,r=jA(d),l=G4.has(d)}function c(d,f){i.push(d),s=s||f;const h=jA(d);r=d.length===1&&yp.has(d)&&r||h,l=!1}for(const d of Gx().segment(e)){const f=d.segment,h=tc(f);i.length!==0?l||Ux.has(f)||yp.has(f)||t.carryCJKAfterClosingQuote&&h&&r?c(f,h):s||h?(a(),u(f,d.index,h)):c(f,h):u(f,d.index,h)}return a(),n}function Zbe(e,t,n){if(t.length<=1)return t;const i=[];let o=-1,s=!1;function r(l){if(!(o<0)){if(s)o+1===l?i.push(t[o]):(function(a,u){const c=t[a].start,d=u=0&&!Iq(t[l-1].text,n)&&r(l),o<0&&(o=l),s=s||tc(a.text)}return r(t.length),i}function vF(e,t){if(t==="zero-width-break"||t==="soft-hyphen"||t==="hard-break")return 0;if(t==="tab")return 1;let n=0;const i=Gx();for(const o of i.segment(e))n++;return n}function Gbe(e){return e==="-"||e==="֊"||e==="‐"||e==="‒"||e==="–"||e==="—"}function Qbe(e,t,n,i,o){const s=bb(),{cache:r,emojiCorrection:l}=(function(T,I){HA().font=T;const O=(function(F){let P=dF.get(F);return P||(P=new Map,dF.set(F,P)),P})(T),H=(function(F){const P=F.match(/(\d+(?:\.\d+)?)\s*px/);return P?parseFloat(P[1]):16})(T),R=I?(function(F,P){let z=fF.get(F);if(z!==void 0)return z;const W=HA();W.font=F;const $=W.measureText("😀").width;if(z=0,$>P+.5&&typeof document<"u"&&document.body!==null){const K=document.createElement("span");K.style.font=F,K.style.display="inline-block",K.style.visibility="hidden",K.style.position="absolute",K.textContent="😀",document.body.appendChild(K);const ne=K.getBoundingClientRect().width;document.body.removeChild(K),$-ne>.5&&(z=$-ne)}return fF.set(F,z),z})(T,H):0;return{cache:O,fontSize:H,emojiCorrection:R}})(t,(a=e.normalized,Bbe.test(a)));var a;const u=mh("-",Nd("-",r),l)+(o===0?0:2*o),c=8*mh(" ",Nd(" ",r),l),d=o!==0;if(e.len===0)return{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableFitAdvances:[],breakablePreferredBreaks:[],letterSpacing:0,spacingGraphemeCounts:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[]};const f=[],h=[],m=[],g=[];let y=e.chunks.length<=1&&!d;const k=null,v=[],C=[],w=[],M=null,L=Array.from({length:e.len});function E(T,I,O,H,R,F,P,z,W){R!=="text"&&R!=="space"&&R!=="zero-width-break"&&(y=!1),f.push(I),h.push(O),m.push(H),g.push(R),v.push(P),C.push(z),d&&w.push(W)}function S(T,I,O,H,R){const F=Nd(T,r),P=d?vF(T,I):0,z=(function(ne,G,te){return G>1?ne+(G-1)*te:ne})(mh(T,F,l),P,o),W=I==="space"||I==="preserved-space"||I==="zero-width-break"?0:z,$=W===0?0:W+(P>0?o:0),K=I==="space"||I==="zero-width-break"?0:z;if(R&&H&&T.length>1){let ne="sum-graphemes";o!==0?ne="segment-prefixes":V9(T)?ne="pair-context":s.preferPrefixWidthsForBreakableRuns&&(ne="segment-prefixes");const G=(function(le,ie,_e,Z,se){if(ie.breakableFitAdvances!==void 0&&ie.breakableFitMode===se)return ie.breakableFitAdvances;ie.breakableFitMode=se;const he=Tq(),Y=[];for(const ue of he.segment(le))Y.push(ue.segment);if(Y.length<=1)return ie.breakableFitAdvances=null,ie.breakableFitAdvances;if(se==="sum-graphemes"){const ue=[];for(const me of Y){const pe=Nd(me,_e);ue.push(mh(me,pe,Z))}return ie.breakableFitAdvances=ue,ie.breakableFitAdvances}if(se==="pair-context"||Y.length>96){const ue=[];let me=null,pe=0;for(const ee of Y){const re=mh(ee,Nd(ee,_e),Z);if(me===null)ue.push(re);else{const ge=me+ee,ae=Nd(ge,_e);ue.push(mh(ge,ae,Z)-pe)}me=ee,pe=re}return ie.breakableFitAdvances=ue,ie.breakableFitAdvances}const J=[];let U="",Q=0;for(const ue of Y){U+=ue;const me=mh(U,Nd(U,_e),Z);J.push(me-Q),Q=me}return ie.breakableFitAdvances=J,ie.breakableFitAdvances})(T,F,r,l,ne),te=G===null||i==="keep-all"?null:(function(le){if(!/[-\u058A\u2010\u2012\u2013\u2014]/u.test(le))return null;const ie=[];let _e=0;for(const Z of Gx().segment(le))_e++,Gbe(Z.segment)&&ie.push(_e);return ie.length===0?null:ie})(T);return void E(T,z,$,K,I,O,G,te,P)}E(T,z,$,K,I,O,null,null,P)}for(let T=0;T=55296&&le<=56319&&te+1=56320&&se<=57343&&(ie=se-56320+(le-55296<<10)+65536,_e=2)}const Z=sbe(ie);Z!=="R"&&Z!=="AL"&&Z!=="AN"||(z=!0);for(let se=0;se<_e;se++)P[te+se]=Z;te+=_e}if(!z)return null;let W=0;for(let te=0;te=0&&P[le]==="ET";le--)P[le]="EN";for(le=te+1;le0?P[te-1]:ne)!=="L"?"R":"L";if(ie===((le{const e=globalThis;if(e[x8])return e[x8];const t={configs:{},controllers:{},revision:_u(0),preparedCache:new Map,blockEstimateCache:new Map};return e[x8]=t,t})();let Bg=null;const S8=_s.revision;function yF(e){var t;return e&&(t=_s.configs[e])!=null?t:null}function kF(e,t){const n=Number.parseFloat(String(e??""));return Number.isFinite(n)&&n>0?n:t}function Jbe(e){return e?.type==="text"||e?.type==="emoji"||e?.type==="hardbreak"}function _8(e){var t,n,i;if(!Array.isArray(e)||e.length===0)return null;let o="";for(const s of e){if(!Jbe(s))return null;s.type==="text"?o+=String((t=s.content)!=null?t:""):s.type==="emoji"?o+=String((i=(n=s.name)!=null?n:s.raw)!=null?i:""):s.type==="hardbreak"&&(o+=` -`)}return o.length>0?o:null}function I8(e,t,n){var i,o;if(!e||!Number.isFinite(t)||t<=0||!(function(){var s;if(Bg!=null)return Bg;if(typeof document>"u")return!1;try{const r=document.createElement("canvas");return Bg=!!((s=r.getContext)!=null&&s.call(r,"2d")),Bg}catch{return Bg=!1,!1}})())return null;try{const s=Math.round(100*t)/100,r=[(i=n.whiteSpace)!=null?i:"pre-wrap",n.font,n.lineHeight,n.wrapperOverhead,n.widthAdjustment,s,e].join("\0"),l=_s.blockEstimateCache.get(r);if(l)return _s.blockEstimateCache.delete(r),_s.blockEstimateCache.set(r,l),{kind:"simple-text",height:l.height,contentHeight:l.contentHeight};const a=(o=n.whiteSpace)!=null?o:"pre-wrap",u=(function(h,m,g){const y=`${g}\0${m}\0${h}`,k=_s.preparedCache.get(y);if(k)return _s.preparedCache.delete(y),_s.preparedCache.set(y,k),k.prepared;const v=(function(C,w,M){return(function(L,E,S,x){var A,T;const I=(A=x?.wordBreak)!=null?A:"normal",O=(T=x?.letterSpacing)!=null?T:0;return Qbe(Obe(L,bb(),x?.whiteSpace,I),E,!1,I,O)})(C,w,0,M)})(h,m,{whiteSpace:g});for(_s.preparedCache.set(y,{prepared:v});_s.preparedCache.size>240;){const C=_s.preparedCache.keys().next().value;if(!C)break;_s.preparedCache.delete(C)}return v})(e,n.font,a),c=(function(h,m,g){const y=Vbe(h,m);return{lineCount:y,height:y*g}})(u,Math.max(24,s-n.widthAdjustment),n.lineHeight),d=Math.max(n.lineHeight,c.height),f=Math.max(n.lineHeight,Math.round(d+n.wrapperOverhead));for(_s.blockEstimateCache.set(r,{height:f,contentHeight:Math.round(d)});_s.blockEstimateCache.size>4e3;){const h=_s.blockEstimateCache.keys().next().value;if(!h)break;_s.blockEstimateCache.delete(h)}return{kind:"simple-text",height:f,contentHeight:Math.round(d)}}catch{return null}}function Eq(e,t,n){var i,o;if(!n||!e||!Number.isFinite(t)||t<=0)return null;if(e.type==="paragraph"){const s=_8(e.children);return s&&n.paragraph?I8(s,t,n.paragraph):null}if(e.type==="heading"){const s=Number(e.level||0),r=_8(e.children),l=n.headings[s];return r&&l?I8(r,t,l):null}if(e.type==="list_item"){const s=Array.isArray(e.children)?e.children:[];if(s.length!==1||((i=s[0])==null?void 0:i.type)!=="paragraph"||!n.listItem)return null;const r=_8((o=s[0])==null?void 0:o.children);return r?I8(r,t,n.listItem):null}if(e.type==="list"){const s=Array.isArray(e.items)?e.items:[];if(!s.length)return null;let r=Math.max(0,n.listWrapperOverhead);for(const l of s){const a=Eq(l,t,n);if(!a)return null;r+=a.height}return{kind:"simple-text",height:Math.max(1,Math.round(r)),contentHeight:Math.max(1,Math.round(r))}}return null}function $g(e){if(!e)return 1;const t=String(e).split(/\r?\n/);return Math.max(1,t.length)}function gh(e,t){const n=String(e??"");return t?n:n.replace(/\r\n$|\n$|\r$/,"")}function M8(e,t,n=0){return e.diff?Wx(t??{},n)?(function(i){const o=gh(i.raw);if(o){const s=o.split(/\r?\n/);return i.originalCode!=null||i.updatedCode!=null?Math.max(1,s.filter(r=>!Ybe.some(l=>r.startsWith(l))).length):Math.max(1,s.length)}return $g(gh(i.originalCode))+$g(gh(i.updatedCode))})(e):(function(i){const o=i.originalCode,s=i.updatedCode;if(o!=null||s!=null)return Math.max($g(gh(o)),$g(gh(s)));const r=gh(i.code).split(/\r?\n/);let l=0,a=0;for(const u of r)u.startsWith("+")&&!u.startsWith("+++")?a++:u.startsWith("-")&&!u.startsWith("---")?l++:(l++,a++);return Math.max(1,l,a)})(e):$g(gh(e.code,e.loading===!0))}function Xbe(e){return e?`${e.fontStyle||"normal"} ${e.fontWeight||"400"} ${e.fontSize||"16px"} ${e.fontFamily||"sans-serif"}`:""}function T8(e,t,n="pre-wrap"){if(!e||!t||typeof window>"u")return null;const i=window.getComputedStyle(t),o=e.offsetHeight,s=kF(i.lineHeight,1.5*kF(i.fontSize,16)),r=e.getBoundingClientRect().width,l=t.getBoundingClientRect().width;return{font:Xbe(i),lineHeight:s,wrapperOverhead:Math.max(0,o-s),widthAdjustment:Math.max(0,r-l),whiteSpace:n}}const e4e=new Set(["node","key","ref","ctx","renderNode","indexKey","__proto__","prototype","constructor"]);function bF(e,t={}){var n;const i={},o=new Set((n=t.omit)!=null?n:[]);if(!e||typeof e!="object")return i;const s=Object.getOwnPropertyDescriptors(e);for(const[r,l]of Object.entries(s))e4e.has(r)||o.has(r)||l.enumerable&&"value"in l&&(i[r]=l.value);return i}function wF(e,t,n,i){var o;const s=(function(f){return Math.max(0,Math.ceil(f.scrollHeight||0)-Math.ceil(f.clientHeight||0))})(e),r=(function(f,h){return Number.isFinite(f)?Math.min(Math.max(0,f),h):0})(n,s);if(!i.isReverseFlexScrollRoot(e))return void(e.scrollTop=r);const l=Math.max(0,s-r),a=[-l,l];let u=a[0],c=Number.POSITIVE_INFINITY;for(const f of a){e.scrollTop=f;const h=i.getNormalizedScrollTop(e,t,!1),m=Math.abs(h-r);md&&(e.scrollTop=u)}function CF(e,t){let n=0,i=null,o=null;const s=()=>{const r=o;o=null,i=null,r&&(n=Date.now(),e(...r))};return function(...r){const l=Date.now(),a=t-(l-n);o=r,a<=0?(i&&(clearTimeout(i),i=null),n=l,o=null,e(...r)):i||(i=setTimeout(s,a))}}function AF(e){return e==="simple"?"simple":e===!0||e==="true"||e==="precise"?"precise":"off"}const Lq=Symbol("MarkstreamMathBlockMinHeightCache");function U8t(){return en(Lq,null)}const t4e=new Set(["text","inline_code","emoji","footnote_reference"]),n4e=new Set(["strong","emphasis","strikethrough","highlight","insert","subscript","superscript","link"]);function zg(e){const t=Number(e);return!Number.isFinite(t)||t<=0?-1:Math.round(t/32)}function vh(e,t,n,i=22){const o=String(e??"");if(!o)return n;const s=Math.max(18,Math.floor(Math.max(320,t)/8)),r=o.split(/\r?\n/).length,l=Math.ceil(o.length/s),a=Math.max(1,r,l);return Math.max(n,Math.ceil(a*i+12))}function Nq(e){var t;if(!e||typeof e!="object")return!1;const n=e,i=String((t=n.type)!=null?t:"");if(t4e.has(i))return!0;if(!n4e.has(i))return!1;const o=n.children;return!Array.isArray(o)||!o.length||o.every(Nq)}function WA(e){var t,n,i,o,s,r,l,a;if(!e||typeof e!="object")return"";const u=e,c=String((t=u.type)!=null?t:"");if(c==="text")return String((i=(n=u.content)!=null?n:u.raw)!=null?i:"");if(c==="inline_code")return String((r=(s=(o=u.code)!=null?o:u.content)!=null?s:u.raw)!=null?r:"");if(c==="emoji")return String((a=(l=u.name)!=null?l:u.raw)!=null?a:"");if(typeof u.text=="string")return u.text;const d=[];for(const f of["children","items","cells","rows"]){const h=u[f];if(Array.isArray(h)){const m=h.map(WA).filter(Boolean).join(" ");m&&d.push(m)}}return d.join(" ").replace(/\s+/g," ").trim()}function Fq(e){if(!e||typeof e!="object")return!1;const t=e;return t.type==="inline_code"||["children","items","cells","rows"].some(n=>{const i=t[n];return Array.isArray(i)&&i.some(Fq)})}function i4e(e,t){if(!e)return 30;const n=Math.max(18,Math.floor(Math.max(320,t)/8)),i=e.split(/\r?\n/).length,o=Math.ceil(e.length/n),s=Math.max(1,i,o);return 30+26*Math.max(0,s-1)}function o4e(e,t){var n,i,o,s,r,l,a,u,c,d,f,h,m,g;if(!e||typeof e!="object")return 32;const y=e,k=String((n=y.type)!=null?n:""),v=Number.isFinite(t)&&t>0?t:640;switch(k){case"heading":return(function(C){var w;const M=Number((w=C.level)!=null?w:C.depth);return M>=4?20:M===3?30:M===2?32:44})(y);case"paragraph":return(function(C,w){const M=String(C??"");if(!M)return 28;const L=Math.max(18,Math.floor(Math.max(320,w)/8)),E=M.split(/\r?\n/).length,S=Math.ceil(M.length/L);return Math.max(1,E,S)<=1?28:vh(M,w,34)})(String((o=(i=y.raw)!=null?i:y.content)!=null?o:""),v);case"list":return(function(C,w){var M;const L=Array.isArray(C.items)?C.items:[];if(!L.length)return 48;const E=Math.max(48,30*L.length+12);let S=12;for(const T of L)S+=i4e(WA(T)||String((M=T.raw)!=null?M:""),w);const x=Math.max(0,S-E);if(L.length>20){const T=Math.round(2.4*L.length);return Math.round(E+Math.max(T,Math.min(x,3*L.length)))}if(x<=0)return E;const A=L.length>8?8*L.length:x;return Math.round(E+Math.min(x,A))})(y,v);case"list_item":return vh(String((r=(s=y.raw)!=null?s:y.content)!=null?r:""),v,34);case"blockquote":return vh(String((a=(l=y.raw)!=null?l:y.content)!=null?a:""),v,56);case"table":return(function(C,w){const M=[...C.header?[C.header]:[],...Array.isArray(C.rows)?C.rows:[]];if(!M.length){const L=Array.isArray(C.children)?C.children.length:3;return Math.max(120,38*L+48)}return Math.max(120,Math.round(4+M.reduce((L,E)=>L+(function(S,x){const A=Math.max(1,S.length),T=Math.max(80,(x-32)/A),I=Math.max(10,Math.floor(T/8)),O=Math.max(1,...S.map(H=>{var R;const F=WA(H)||String((R=H?.raw)!=null?R:"");return Math.ceil(F.length/I)||1}));return 54+34*Math.max(0,O-1)+(A<=3&&S.some(Fq)?14:0)})((function(S){var x;return Array.isArray(S?.cells)&&(x=S.cells)!=null?x:[]})(E),w),0)))})(y,v);case"code_block":{const C=String((u=y.language)!=null?u:"").trim().toLowerCase(),w=String((d=(c=y.code)!=null?c:y.raw)!=null?d:"");return C==="mermaid"?fb(cb(w)):C==="infographic"?hb(db(w)):vh(w,v,96,20)}case"math_block":return 72;case"image":return 220;case"admonition":case"vmr_container":case"html_block":return(function(C,w){var M,L,E;const S=C.match(/^\s*]*)>/i);return S&&!/(?:^|\s)open(?:\s|=|$)/i.test((M=S[1])!=null?M:"")?vh(((E=(L=C.match(/]*>([\s\S]*?)<\/summary>/i))==null?void 0:L[1])==null?void 0:E.replace(/<[^>]*>/g,"").trim())||"Details",w,28,28):vh(C,w,96)})(String((h=(f=y.raw)!=null?f:y.content)!=null?h:""),v);case"thematic_break":return 24;default:return vh(String((g=(m=y.raw)!=null?m:y.content)!=null?g:""),v,40)}}function xF(e,t,n){return Math.min(Math.max(e,t),n)}const s4e=["total","cacheHits","appendHits","tailHits","fullParses","chunkedParses"],r4e=["tokenCloneMs","processTokensInputTokens","processTokensReusedTopLevelNodes","processTokensMs","safeMarkdownMs","tokenizeMs","htmlBlockPassesMs","parseMarkdownToStructureTotalMs"],l4e=new Set(["attrs","data","items","header","payload","props","rows","cells","term","definition","sourceMap"]),Dq=["raw","content","code","originalCode","updatedCode"],SF=new WeakMap,_F=new WeakMap;let a4e=1;function ou(){return typeof performance<"u"?performance.now():Date.now()}function IF(e){const t=e.stream;return t&&typeof t.stats=="function"?t.stats():null}function na(e){if(typeof e!="object"&&typeof e!="function"||e===null)return"";const t=e;let n=SF.get(t);return n||(n=a4e++,SF.set(t,n)),String(n)}function MF(e,t,n,i={}){var o,s;const r=i.includeFinal!==!1,l={md:na(t),customMarkdownIt:na(n),requireClosingStrong:e.requireClosingStrong===!0,customHtmlTags:(o=e.customHtmlTags)!=null?o:[],includeSourceMap:e.includeSourceMap===!0,streamParse:(s=e.streamParse)!=null?s:"auto",validateLink:na(e.validateLink),preTransformTokens:na(e.preTransformTokens),postTransformTokens:na(e.postTransformTokens),postTransformNodes:na(e.postTransformNodes)};return r&&(l.final=e.final===!0),JSON.stringify(l)}function TF(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===10;)t-=1;const n=e.lastIndexOf(` -`,t-1)+1;return e.slice(n,t).trim()}function EF(e){const t=Rq(e);return t.length>=2&&t.every(n=>{const i=n.trim();return i.length>=1&&i.replace(/^:/,"").replace(/:$/,"").split("").every(o=>o==="-")})}function Rq(e){return e.includes("|")?e.replace(/^\|/,"").replace(/\|$/,"").split("|"):[]}function Oq(e){let t=2166136261;for(let n=0;n>>0).toString(36)}function Qx(e){const t=String(e??"");return`${t.length}:${Oq(t)}`}function qA(e,t=new WeakMap,n=0){if(e==null||typeof e=="number"||typeof e=="boolean")return String(e);if(typeof e=="string")return`s:${(function(r){return r.length<=8192?Qx(r):`${r.length}:${Oq(r.slice(0,8192))}:truncated`})(e)}`;if(typeof e=="function")return`fn:${na(e)}`;if(typeof e!="object")return typeof e;const i=e,o=t.get(i);if(o)return`cycle:${o}`;if(n>=6)return`object:${na(i)}`;const s=na(i);if(t.set(i,s),Array.isArray(e)){const r=e.slice(0,200);return`a:${e.length}:${r.map(l=>qA(l,t,n+1)).join(",")}`}if(typeof e=="object"){const r=e,l=Object.keys(r).sort(),a=l.slice(0,80);return`o:${l.length}:${a.sort().map(u=>`${u}:${qA(r[u],t,n+1)}`).join(";")}`}return typeof e}function wb(e){return typeof e=="object"&&e!==null&&typeof e.type=="string"&&typeof e.raw=="string"}function Pq(e,t=new WeakMap,n=0){return Array.isArray(e)?`a:${e.length}:${e.slice(0,200).map(i=>wb(i)?Tf(i,t,n+1):Pq(i,t,n+1)).join(",")}`:wb(e)?Tf(e,t,n):qA(e,t,n)}function u4e(e,t,n){return Object.keys(e).sort().filter(i=>i!=="children"&&!Dq.includes(i)).map(i=>{const o=e[i];return typeof o=="string"?`${i}=s:${Qx(o)}`:typeof o=="number"||typeof o=="boolean"||o==null?`${i}=${String(o)}`:typeof o=="function"?`${i}=fn:${na(o)}`:l4e.has(i)&&(Array.isArray(o)||typeof o=="object")?`${i}=${Pq(o,t,n+1)}`:o&&typeof o=="object"?`${i}=object:${na(o)}`:""}).filter(Boolean).join(";")}function c4e(e){return Dq.map(t=>{const n=e[t];return typeof n=="string"?`${t}=s:${Qx(n)}`:""}).filter(Boolean).join(";")}function Tf(e,t=new WeakMap,n=0){const i=_F.get(e);if(i)return i;const o=e,s=t.get(o);if(s)return`node-cycle:${s}`;if(n>=6)return`node:${e.type}:${na(o)}`;const r=na(o);t.set(o,r);const l=(function(a,u,c){const d=a,f=Array.isArray(d.children)?d.children:[],h=f.length?f.slice(0,200).map(m=>Tf(m,u,c+1)).join("|"):"";return[a.type,c4e(d),u4e(d,u,c),f.length,h].join(":")})(e,t,n);return _F.set(o,l),l}function Bq(e,t){return Tf(e)===Tf(t)}function Yx(e,t,n){const i=ou(),o=t==="stabilizeSignatureMs"?"stabilizeSignatureCallCount":"primeSignatureCallCount";try{return n()}finally{e[t]+=ou()-i,e[o]+=1,e.signatureMs=e.stabilizeSignatureMs+e.primeSignatureMs,e.signatureCallCount=e.stabilizeSignatureCallCount+e.primeSignatureCallCount}}function LF(e,t,n){return Yx(t,n,()=>Tf(e))}function $q(e,t,n){return LF(e,n,"stabilizeSignatureMs")===LF(t,n,"stabilizeSignatureMs")}function Oy(e){return{reusedNodeCount:0,dirtyStartIndex:e>0?0:-1,stablePrefixNodeCount:0,dirtyTailNodeCount:e}}function NF(e,t,n){return e<0?0:Math.max(t.length,n.length)-e}function FF(e){return e.__markstreamHasCustomParserExtensions===!0||(function(t){var n;return Number((n=t.__markstreamRegisteredPluginCount)!=null?n:0)>0})(e)}function d4e(e,t){return e.length===t.length&&e===t}function Jx(e,t,n=0){if(n>=4)return null;if(e.type!==t.type)return!1;const i=e,o=t,s=Object.keys(i).filter(c=>c!=="type"&&c!=="children").sort(),r=Object.keys(o).filter(c=>c!=="type"&&c!=="children").sort();if(s.length!==r.length)return!1;for(let c=0;c{i=Jx(e,t)}),i??$q(e,t,n)}function p4e(e,t){const n={};for(const i of s4e){const o=e[i],s=t?.[i];typeof o=="number"&&(n[i]=o-(typeof s=="number"?s:0))}return n}function m4e(e,t){var n;const i=TN(t.instanceMsgId),o=new Map,s=(n=t.smoothStreamingEnabled)!=null?n:D(()=>!1),r=q(t.renderContent.value);let l=[],a="",u="",c="",d=!1;const f=(function(){let H="",R=0,F=!1,P=!1,z=!1,W=!1;function $(){H="",R=0,F=!1,P=!1,z=!1,W=!1}function K(ne){let G=!1;for(let te=0;te{if(!ne||!G.startsWith(ne)||G.length<=ne.length)return $(),[!0,0];let te=0;H!==ne&&($(),K(ne),te=ne.length);const le=G.slice(ne.length),ie=K(le);return H=G,[ie,te+le.length]}})();let h,m=0,g=0,y=ou(),k=-1,v=0;function C(H){k=Number.isInteger(H)?H:0,v+=1}function w(){h&&(clearTimeout(h),h=void 0)}function M(){w();const H=t.renderContent.value;r.value!==H&&(r.value=H),y=ou()}ze([t.renderContent,t.effectiveFinal,s],([H,R,F])=>{r.value!==H&&(!F||R||(function(P,z){if(!P&&z||z.length<=80||z.length\s*|`{3,}|~{3,})/.test(W))||W.endsWith(` -`)&&!(function($){const K=TF($);if(EF(K))return!1;const ne=Rq(K);return ne.length>=2&&ne.some(G=>G.trim())})(z))})(r.value,H)?M():(function(){if(g+=1,h)return;const P=Math.max(0,(function(z){const W=z.parseCoalesceMs;return typeof W=="number"&&Number.isFinite(W)&&W>=0?W:80})(e)-(ou()-y));P<=0?M():h=setTimeout(M,P)})())},{flush:"sync",immediate:!0}),cd(w);const L=D(()=>{var H,R,F,P;return hme(e.customHtmlTags,(H=e.parseOptions)==null?void 0:H.customHtmlTags,(P=(F=(R=t.customComponentsMap)==null?void 0:R.value)!=null?F:{},Object.entries(P).map(([z,W])=>{const $=Va(z);return W==null||!$||v2($)||UH.has($)||f2.has($)?"":$}).filter(Boolean)))}),E=D(()=>{const{key:H,tags:R}=pme(L.value);if(!H)return i;const F=o.get(H);if(F)return F;const P=TN(t.instanceMsgId,{customHtmlTags:R});return o.set(H,P),P}),S=D(()=>{const H=E.value;if(!e.customMarkdownIt)return H;const R=e.customMarkdownIt(H);return H.__markstreamHasCustomParserExtensions=!0,R.__markstreamHasCustomParserExtensions=!0,R}),x=D(()=>{var H,R;const F=(H=e.parseOptions)!=null?H:{},P=t.effectiveFinal.value,z=L.value,W=P!=null,$=z.length>0;return W||$||F.streamParse==null?Bt(Bt(Dn(Bt({},F),{streamParse:(R=F.streamParse)==null||R}),W?{final:P}:{}),$?{customHtmlTags:z}:{}):F}),A=D(()=>{var H;return new Set(((H=x.value.customHtmlTags)!=null?H:[]).map(R=>String(R).trim().toLowerCase()).filter(Boolean))}),T=D(()=>MF(x.value,S.value,e.customMarkdownIt,{includeFinal:!0})),I=D(()=>MF(x.value,S.value,e.customMarkdownIt,{includeFinal:!1}));ze([T,I],([H,R],[F,P])=>{F&&(H===F&&R===P||(M(),R!==P&&(l=[],c="")))},{flush:"sync"});const O=D(()=>{var H,R,F,P,z,W,$,K,ne,G,te;if((H=e.nodes)!=null&&H.length)return l=[],c="",C(0),Lt(e.nodes.slice());const le=r.value;if(!le)return l=[],c="",C(-1),[];const ie=t.debugPerformanceEnabled.value,_e=ie?ou():0,Z=S.value,se=T.value,he=I.value;a&&se!==a&&(function(Ae){var Ne,Ze;(Ze=(Ne=Ae.stream)==null?void 0:Ne.reset)==null||Ze.call(Ne)})(Z),u&&he!==u&&(l=[],c="");const Y=Object.keys((F=(R=t.customComponentsMap)==null?void 0:R.value)!=null?F:{}).length>0||typeof x.value.postTransformNodes=="function";Y!==d&&(l=[],c="");const J=!Y&&l.length>0&&le.startsWith(c)&&he===u,U=ie?IF(Z):null,Q=ie?{}:void 0,ue=FF(Z),me=!ue&&!Y,pe=Bt(Bt(Dn(Bt({},x.value),{__reuseStableTopLevelNodes:me}),ue?{__disableStreamParse:!0}:{}),Q?{__timing:Q}:{}),ee=GW(le,Z,pe),re=ie?ou():0,ge=ie?{signatureMs:0,stabilizeSignatureMs:0,primeSignatureMs:0,signatureCallCount:0,stabilizeSignatureCallCount:0,primeSignatureCallCount:0}:void 0;let ae,Ce=ie?Oy(ee.length):void 0,ve=0,ce=0,Te=0;if(J){const Ae=ie?ou():0,[Ne,Ze]=(function(pt){var Rt,Ot;const[Fe,Pe]=pt.scanGlobalReferenceAppend(pt.previousContent,pt.content),be=pt.parseOptions;return[pt.previousDirtyStartIndex>0&&be.final!==!0&&!pt.customMarkdownIt&&!FF(pt.md)&&!Fe&&typeof be.preTransformTokens!="function"&&typeof be.postTransformTokens!="function"&&typeof be.postTransformNodes!="function"&&((Ot=(Rt=be.customHtmlTags)==null?void 0:Rt.length)!=null?Ot:0)===0?pt.previousDirtyStartIndex:0,Pe]})({content:le,previousContent:c,previousDirtyStartIndex:k,parseOptions:x.value,customMarkdownIt:e.customMarkdownIt,md:Z,scanGlobalReferenceAppend:f});Te=Ze;const rt=Ne<=0;if(ge){const pt=(function(Rt,Ot,Fe,Pe={}){var be;if(!Ot.length)return{nodes:Rt,metrics:Oy(Rt.length)};const Oe=(be=Pe.scanStartIndex)!=null?be:0,Ke=Pe.reuseDirtyTail!==!1,Qe=(function(Se,We,ut,Tt=0){const tt=Math.min(Se.length,We.length);for(let Ve=Math.min(tt,Math.max(0,Tt));VeTf(Ae[rt]))})(ae,ge,ce):(function(Ae,Ne=0){for(let Ze=Math.max(0,Ne);Ze((z=U?.total)!=null?z:0);t.logPerf(Ne?"parse(stream)":"parse(sync)",Bt(Bt(Bt({rendererId:t.instanceMsgId,ms:Math.round(ou()-_e),nodes:ae.length,contentLength:le.length,parseCommitCount:m,parseCoalescedCount:g,nodeReuseMs:ke,referenceDefinitionScanChars:Te,signatureMs:(W=ge?.signatureMs)!=null?W:0,stabilizeSignatureMs:($=ge?.stabilizeSignatureMs)!=null?$:0,primeSignatureMs:(K=ge?.primeSignatureMs)!=null?K:0,signatureCallCount:(ne=ge?.signatureCallCount)!=null?ne:0,stabilizeSignatureCallCount:(G=ge?.stabilizeSignatureCallCount)!=null?G:0,primeSignatureCallCount:(te=ge?.primeSignatureCallCount)!=null?te:0,stabilizeMs:ve},Ce??{}),Q?Object.fromEntries(r4e.map(Ze=>{var rt;return[Ze,(rt=Q[Ze])!=null?rt:0]})):{}),Ae?{streamMode:Ae.lastMode,streamDelta:p4e(Ae,U),streamStats:Ae}:{}))}return Lt(ae)});return{effectiveCustomHtmlTags:L,effectiveCustomHtmlTagsSet:A,mdBase:E,mdInstance:S,mergedParseOptions:x,getParsedNodesDirtyStartIndex:()=>k,getParsedNodesRevision:()=>v,parsedNodes:O}}function g4e(e){const{isClient:t}=e,n=q(new Set),i=new Map,o=new Map,s=new Map;function r(u){if(!t)return;const c=s.get(u);c!=null&&(window.clearTimeout(c),s.delete(u))}function l(){if(t)for(const u of s.values())window.clearTimeout(u);s.clear()}function a(){n.value=new Set}return{visibleNodeIndices:n,nodeVisibilityHandles:i,nodeVisibilityWatchStops:o,nodeVisibilityFallbackTimers:s,clearVisibilityFallback:r,clearAllVisibilityFallbacks:l,markNodeVisible:function(u,c=!0){var d;c&&r(u),(function(f,h){if((g=(m=e.shouldTrackVisibleNodeIndices)==null?void 0:m.call(e))!=null&&!g)return;var m,g;const y=n.value,k=y.has(f);if(h){if(k)return;const C=new Set(y);return C.add(f),void(n.value=C)}if(!k)return;const v=new Set(y);v.delete(f),n.value=v})(u,c),c&&((d=e.onNodeMarkedVisible)==null||d.call(e,u))},resetNodeVisibleState:a,cleanupNodeVisibility:function(u){var c;if(e.shouldCleanupNodeVisibility&&!e.shouldCleanupNodeVisibility())return;for(const[f,h]of o.entries())f{const c=o.getSnapshot();t.value=c.source,n.value=c.visible,i.value=c.done},r=o.subscribe(s);s();const l=D(()=>Math.max(0,t.value.length-n.value.length)),a=D(()=>l.value===0),u=D(()=>i.value&&a.value);return jm()&&cd(()=>{r(),o.destroy()}),{source:t,visible:n,done:i,final:u,caughtUp:a,pendingChars:l,enqueue:c=>o.enqueue(c),finish:c=>o.finish(c),flush:()=>o.flush(),reset:c=>o.reset(c),pause:()=>o.pause(),resume:()=>o.resume()}}const y4e={maxCharsPerSecond:3e3,maxCommitFps:20,maxCharsPerCommit:160,catchUpLatencyMs:220,catchUpThreshold:400},DF=/auto|scroll|overlay/i;function k4e(e){if(!e)return!1;const t=(e.overflowY||"").toLowerCase(),n=(e.overflow||"").toLowerCase();return DF.test(t)||DF.test(n)}function b4e(e){const t=Math.ceil(e.scrollHeight)>Math.ceil(e.clientHeight)+1,n=Math.ceil(e.scrollWidth)>Math.ceil(e.clientWidth)+1;return t||n}const w4e={class:"m-0 p-0"},C4e=["data-probe"],A4e=Ei(ot(Dn(Bt({},{name:"HeightEstimationProbes"}),{__name:"HeightEstimationProbes",props:{width:{},flowRoot:{type:Boolean},paragraphNode:{},listItemNode:{},listNode:{},headingNodes:{},setParagraphWrapper:{type:Function},setListItemWrapper:{type:Function},setListWrapper:{type:Function},setHeadingWrapper:{type:Function}},setup(e){const t=e;function n(i){var o,s;return(s=(o=t.headingNodes)==null?void 0:o[i])!=null?s:null}return(i,o)=>(b(),N("div",{class:"height-estimation-probes",style:on({width:`${e.width}px`}),"aria-hidden":"true"},[_("div",{ref:s=>e.setParagraphWrapper(s),class:De(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"paragraph"},[V(p(rp),{node:e.paragraphNode,"index-key":"probe-paragraph"},null,8,["node"])],2),_("div",{ref:s=>e.setListItemWrapper(s),class:De(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"list-item"},[_("ul",w4e,[V(p(am),{node:e.listItemNode,"index-key":"probe-list-item"},null,8,["node"])])],2),_("div",{ref:s=>e.setListWrapper(s),class:De(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":"list"},[V(p(um),{node:e.listNode,"index-key":"probe-list"},null,8,["node"])],2),(b(),N(Le,null,Ct(6,s=>_("div",{key:`probe-heading-${s}`,ref_for:!0,ref:r=>e.setHeadingWrapper(s,r),class:De(["node-content",{"node-content-flow-root":e.flowRoot}]),"data-probe":`heading-${s}`},[V(p(Z4),{node:n(s),"index-key":`probe-heading-${s}`},null,8,["node","index-key"])],10,C4e)),64))],4))}})),[["__scopeId","data-v-3e0766e2"]]),RF=ot({name:"InfographicBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=D(()=>{var n,i;return hb((i=O1(e.estimatedPreviewHeightPx))!=null?i:db(String((n=e.node.code)!=null?n:"")))});return()=>{var n;return Fn("div",{class:"infographic-block-container rounded-lg border overflow-hidden",style:{margin:"var(--ms-flow-diagram-y) 0",background:"var(--diagram-bg)",borderColor:"var(--diagram-border)",color:"hsl(var(--ms-foreground))"},"data-markstream-infographic":"1","data-markstream-mode":"pending"},[e.showHeader?Fn("div",{class:"infographic-block-header flex justify-between items-center border-b",style:{padding:"var(--ms-inset-panel-y) var(--ms-inset-panel-x)",background:"var(--diagram-header-bg)",borderColor:"var(--diagram-border)",minHeight:"calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding) + var(--ms-inset-panel-y) + var(--ms-inset-panel-y) + 1px)"}},[Fn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[Fn("span",{class:"icon-slot action-icon shrink-0",style:{display:"inline-flex",width:"var(--ms-action-btn-icon)",height:"var(--ms-action-btn-icon)"}}),Fn("span",{class:"infographic-label font-medium font-mono truncate",style:{fontSize:"var(--ms-text-label)",color:"hsl(var(--ms-muted-foreground))"}},"Infographic")]),Fn("div",{class:"infographic-header-actions flex items-center opacity-0 pointer-events-none",style:{gap:"var(--ms-gap-header-actions)"},"aria-hidden":"true"},Array.from({length:4},()=>Fn("span",{class:"infographic-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded",style:{width:"calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding))",height:"calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding))"}})))]):null,Fn("div",{class:"infographic-preview relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[Fn("pre",{class:"infographic-pending-source text-sm font-mono whitespace-pre-wrap",style:{position:"absolute",inset:"0",zIndex:"1",margin:"0",padding:"var(--ms-inset-panel-body)",overflow:"auto",textAlign:"left"}},String((n=e.node.code)!=null?n:"")),Fn("div",{class:"absolute inset-0"},[Fn("div",{class:"w-full text-center flex items-center justify-center min-h-full"})])])])}}}),OF=ot({name:"MermaidBlockNodeLoading",props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){const t=D(()=>{var n,i;return fb((i=O1(e.estimatedPreviewHeightPx))!=null?i:cb(String((n=e.node.code)!=null?n:"")))});return()=>{var n;return Fn("div",{class:"mermaid-block-container rounded-lg border overflow-hidden",style:{margin:"var(--ms-flow-diagram-y) 0",borderColor:"var(--diagram-border)"},"data-markstream-mermaid":"1","data-markstream-mode":"pending"},[e.showHeader?Fn("div",{class:"mermaid-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)]",style:{background:"var(--diagram-header-bg)",borderColor:"var(--diagram-border)"}},[Fn("div",{class:"flex items-center gap-x-2 overflow-hidden"},[Fn("span",{class:"mermaid-label-text text-[length:var(--ms-text-label)] font-medium font-mono truncate",style:{color:"var(--code-action-fg)"}},"Mermaid")]),Fn("div",{class:"mermaid-header-actions flex items-center gap-[var(--ms-gap-header-actions)] opacity-0 pointer-events-none","aria-hidden":"true"},Array.from({length:4},()=>Fn("span",{class:"mermaid-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded"},[Fn("span",{class:"action-icon block"})])))]):null,Fn("div",{class:"mermaid-preview-area relative overflow-hidden block",style:{height:`${t.value}px`,minHeight:"var(--ms-size-diagram-min-height)",background:"var(--diagram-bg)"}},[Fn("pre",{class:"mermaid-source-code text-sm font-mono whitespace-pre-wrap",style:{position:"absolute",inset:"0",margin:"0",padding:"var(--ms-inset-panel-body)",overflow:"auto",textAlign:"left"}},String((n=e.node.code)!=null?n:"")),Fn("div",{class:"_mermaid w-full text-center flex items-center justify-center min-h-full",style:{fontFamily:"inherit",contentVisibility:"auto",contain:"content",containIntrinsicSize:"var(--ms-size-diagram-min-height) 240px"}})])])}}}),x4e={docs:{showTooltips:!0,fade:!0,batchRendering:!0,initialRenderBatchSize:40,renderBatchSize:80,renderBatchDelay:16,renderBatchBudgetMs:6,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:220,liveNodeBuffer:60,nodeVirtual:"auto"},chat:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:32,renderBatchSize:48,renderBatchDelay:6,renderBatchBudgetMs:8,renderBatchIdleTimeoutMs:60,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"},minimal:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:32,renderBatchSize:48,renderBatchDelay:6,renderBatchBudgetMs:8,renderBatchIdleTimeoutMs:60,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:"auto"}};function Vs(e){if(e==null)return"";if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return String(e);try{return JSON.stringify(e)}catch{return String(e)}}const S4e=["data-custom-id"],_4e=["data-node-index","data-node-type"],PF="typewriter-simple-cursor-target",zq=Ei(ot(Dn(Bt({},{name:"NodeRenderer"}),{__name:"NodeRenderer",props:{content:{},nodes:{},final:{type:Boolean},parseOptions:{},customMarkdownIt:{},debugPerformance:{type:Boolean,default:!1},customHtmlTags:{},mode:{},domMode:{},htmlPolicy:{},viewportPriority:{type:Boolean,default:void 0},viewportPriorityOptions:{},codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:{},codeBlockLightTheme:{},codeBlockMonacoOptions:{},codeRenderer:{},renderCodeBlocksAsPre:{type:Boolean,default:void 0},codeBlockMinWidth:{},codeBlockMaxWidth:{},codeBlockProps:{},mermaidProps:{},d2Props:{},infographicProps:{},showTooltips:{type:Boolean,default:void 0},themes:{},langs:{},isDark:{type:Boolean},customId:{},indexKey:{},typewriter:{type:[Boolean,String],default:!1},smoothStreaming:{type:[Boolean,String],default:"auto"},smoothStreamingOptions:{},parseCoalesceMs:{},fade:{type:Boolean,default:void 0},batchRendering:{type:Boolean,default:void 0},initialRenderBatchSize:{},renderBatchSize:{},renderBatchDelay:{},renderBatchBudgetMs:{},renderBatchIdleTimeoutMs:{},deferNodesUntilVisible:{type:Boolean,default:void 0},maxLiveNodes:{},liveNodeBuffer:{},nodeVirtual:{type:[Boolean,String],default:void 0},virtualScroll:{},renderAsFragment:{type:Boolean}},emits:["copy","copy-code","handleArtifactClick","click","mouseover","mouseout","virtual-state-change","height-change","render-settled","render-final","anchor-change"],setup(e,{expose:t,emit:n}){const i=e,o=n;function s(j){if(!(typeof Event<"u"&&j instanceof Event))return typeof j=="string"&&o("copy-code",j),void o("copy",j)}const r=gs(),l=en("markstreamNestedRendererProps",void 0);function a(j){const oe=r?.vnode.props;return!!oe&&(Object.prototype.hasOwnProperty.call(oe,j)||Object.prototype.hasOwnProperty.call(oe,String(j).replace(/[A-Z]/g,ye=>`-${ye.toLowerCase()}`)))}function u(j){var oe,ye;const we=i[j];return a(j)?we:(ye=(oe=l?.value)==null?void 0:oe[j])!=null?ye:we}const c=D(()=>{return(j=u("mode"))==="chat"||j==="minimal"||j==="docs"?j:"docs";var j}),d=D(()=>AF(u("typewriter"))),f=D(()=>d.value!=="off"),h=D(()=>u("domMode")==="minimal"?"minimal":"full"),m=D(()=>{return(j={mode:c.value,codeRenderer:u("codeRenderer"),renderCodeBlocksAsPre:u("renderCodeBlocksAsPre")}).renderCodeBlocksAsPre===!0?"pre":j.codeRenderer==="pre"||j.codeRenderer==="shiki"||j.codeRenderer==="monaco"?j.codeRenderer:j.renderCodeBlocksAsPre===!1||j.mode==="docs"?"monaco":"pre";var j}),g=D(()=>x4e[c.value]),y=D(()=>{var j;return(j=u("showTooltips"))!=null?j:g.value.showTooltips}),k=D(()=>{var j;return(j=u("fade"))!=null?j:g.value.fade}),v=D(()=>{var j;return(j=u("batchRendering"))!=null?j:g.value.batchRendering}),C=D(()=>{var j;return(j=u("initialRenderBatchSize"))!=null?j:g.value.initialRenderBatchSize}),w=D(()=>{var j;return(j=u("renderBatchSize"))!=null?j:g.value.renderBatchSize}),M=D(()=>{var j;return(j=u("renderBatchDelay"))!=null?j:g.value.renderBatchDelay}),L=D(()=>{var j;return(j=u("renderBatchBudgetMs"))!=null?j:g.value.renderBatchBudgetMs}),E=D(()=>{var j;return(j=u("renderBatchIdleTimeoutMs"))!=null?j:g.value.renderBatchIdleTimeoutMs}),S=D(()=>{var j;return(j=u("deferNodesUntilVisible"))!=null?j:g.value.deferNodesUntilVisible}),x=D(()=>{var j;return(j=u("maxLiveNodes"))!=null?j:g.value.maxLiveNodes}),A=D(()=>{var j;return(j=u("liveNodeBuffer"))!=null?j:g.value.liveNodeBuffer}),T=D(()=>{var j;return(j=u("nodeVirtual"))!=null?j:g.value.nodeVirtual}),I={get content(){return i.content},get nodes(){return i.nodes},get final(){return i.final},get parseOptions(){return u("parseOptions")},get customMarkdownIt(){return u("customMarkdownIt")},get debugPerformance(){return i.debugPerformance},get customHtmlTags(){return u("customHtmlTags")},get mode(){return u("mode")},get domMode(){return h.value},get htmlPolicy(){return u("htmlPolicy")},get viewportPriority(){return u("viewportPriority")},get viewportPriorityOptions(){return u("viewportPriorityOptions")},get codeBlockStream(){return u("codeBlockStream")},get codeBlockDarkTheme(){return u("codeBlockDarkTheme")},get codeBlockLightTheme(){return u("codeBlockLightTheme")},get codeBlockMonacoOptions(){return u("codeBlockMonacoOptions")},get codeRenderer(){return u("codeRenderer")},get renderCodeBlocksAsPre(){return u("renderCodeBlocksAsPre")},get codeBlockMinWidth(){return u("codeBlockMinWidth")},get codeBlockMaxWidth(){return u("codeBlockMaxWidth")},get codeBlockProps(){return u("codeBlockProps")},get mermaidProps(){return u("mermaidProps")},get d2Props(){return u("d2Props")},get infographicProps(){return u("infographicProps")},get showTooltips(){return y.value},get themes(){return u("themes")},get langs(){return u("langs")},get isDark(){return u("isDark")},get customId(){return u("customId")},get indexKey(){return i.indexKey},get typewriter(){return u("typewriter")},get smoothStreaming(){return i.smoothStreaming},get smoothStreamingOptions(){return u("smoothStreamingOptions")},get parseCoalesceMs(){return u("parseCoalesceMs")},get fade(){return k.value},get batchRendering(){return v.value},get initialRenderBatchSize(){return C.value},get renderBatchSize(){return w.value},get renderBatchDelay(){return M.value},get renderBatchBudgetMs(){return L.value},get renderBatchIdleTimeoutMs(){return E.value},get deferNodesUntilVisible(){return S.value},get maxLiveNodes(){return x.value},get liveNodeBuffer(){return A.value},get nodeVirtual(){return T.value},get virtualScroll(){return i.virtualScroll},get renderAsFragment(){return i.renderAsFragment}};function O(j){o("height-change",j)}function H(j){o("virtual-state-change",j)}function R(j){o("anchor-change",j)}const F=q(),P=q(null),z=q(null),W=q(null),$=po({1:null,2:null,3:null,4:null,5:null,6:null}),K=q(!1),ne=new Map,G=q(0),te=q(0),le=q({paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}});function ie(j,oe){return typeof j!="string"?oe:j.trim()||oe}function _e(j){const oe=Number(j);return Number.isFinite(oe)&&oe>0?Math.max(1,Math.trunc(oe)):640}const Z=D(()=>{var j;const oe=(j=I.viewportPriorityOptions)!=null?j:{},ye=ie(oe.rootMargin,gp);return{rootMargin:ye,heavyBlockMargin:ie(oe.heavyBlockMargin,ye),maxTargets:_e(oe.maxTargets)}}),se=D(()=>{var j;return(j=Z.value.rootMargin)!=null?j:gp}),he=D(()=>{var j;return(j=Z.value.maxTargets)!=null?j:640});function Y(){var j,oe;if(((j=i.virtualScroll)==null?void 0:j.enabled)!==!0)return null;const ye=(oe=i.virtualScroll)==null?void 0:oe.scrollRoot;return J(typeof ye=="function"?ye():ye)}function J(j){return j?typeof HTMLElement<"u"&&j instanceof HTMLElement?j:typeof j=="object"&&"value"in j?J(j.value):typeof j=="object"&&"$el"in j?J(j.$el):null:null}Gn(Aq,Z);const{isClient:U,renderAsFragment:Q,debugPerformanceEnabled:ue,resolvedShowTooltips:me,resolvedHtmlPolicy:pe,inheritedSmoothStreaming:ee,ownsTypewriterCursor:re}=(function(j){const oe=typeof window<"u",ye=qm(),we=en("markstreamHtmlPolicy",void 0),Ee=en("markstreamTypewriterCursor",void 0),He=en("markstreamSmoothStreaming",void 0),Je=D(()=>j.renderAsFragment===!0),nt=D(()=>!!(j.debugPerformance&&oe&&typeof console<"u")),vt=D(()=>{var gt;if(typeof j.showTooltips=="boolean")return j.showTooltips;const Xe=(gt=ye.showTooltips)!=null?gt:ye["show-tooltips"];return Xe===""||Xe===!0||Xe==="true"||Xe!==!1&&Xe!=="false"&&void 0}),it=D(()=>{var gt,Xe;return(Xe=(gt=j.htmlPolicy)!=null?gt:we?.value)!=null?Xe:"safe"}),lt=D(()=>Ee?.value!==!0);return{isClient:oe,renderAsFragment:Je,debugPerformanceEnabled:nt,resolvedShowTooltips:vt,resolvedHtmlPolicy:it,inheritedSmoothStreaming:He,inheritedTypewriterCursor:Ee,ownsTypewriterCursor:lt}})(I),{resolveViewportRoot:ge,resolveScrollContainer:ae,isReverseFlexScrollRoot:Ce,getNormalizedScrollTop:ve,getOffsetTopWithinRoot:ce}=(function(j,oe){function ye(){var nt,vt;return(vt=(nt=oe.scrollRoot)==null?void 0:nt.call(oe))!=null?vt:null}function we(nt){if(typeof window>"u")return null;const vt=ye();if(vt)return vt;const it=nt??j.value;if(!it)return null;const lt=it.ownerDocument||document,gt=lt.scrollingElement||lt.documentElement;let Xe=it;for(;Xe&&Xe!==lt.body&&Xe!==gt;){if(k4e(window.getComputedStyle(Xe))&&b4e(Xe))return Xe;Xe=Xe.parentElement}return null}function Ee(nt){if(!oe.isClient)return!1;try{const vt=window.getComputedStyle(nt);return!!(vt.display||"").toLowerCase().includes("flex")&&(vt.flexDirection||"").toLowerCase().endsWith("reverse")}catch{return!1}}function He(nt,vt,it){var lt,gt;if(it)return Je(vt);const Xe=nt.scrollTop;if(!Ee(nt))return Xe;const at=Xe<0?-Xe:Xe;return Math.max(0,((lt=nt.scrollHeight)!=null?lt:0)-((gt=nt.clientHeight)!=null?gt:0))-at}function Je(nt){var vt,it,lt,gt,Xe;const at=Number((vt=nt.scrollingElement)==null?void 0:vt.scrollTop),It=Number((lt=(it=nt.documentElement)==null?void 0:it.scrollTop)!=null?lt:0),At=Number((Xe=(gt=nt.body)==null?void 0:gt.scrollTop)!=null?Xe:0);return Math.max(0,Number.isFinite(at)?at:0,Number.isFinite(It)?It:0,Number.isFinite(At)?At:0)}return{resolveViewportRoot:we,resolveScrollContainer:function(nt){var vt,it,lt,gt;const Xe=ye();if(Xe)return Xe;const at=we((vt=nt??j.value)!=null?vt:null);if(at)return at;const It=(gt=(lt=nt?.ownerDocument)!=null?lt:(it=j.value)==null?void 0:it.ownerDocument)!=null?gt:typeof document<"u"?document:null;return It?.scrollingElement||It?.documentElement||null},isReverseFlexScrollRoot:Ee,getNormalizedScrollTop:He,getOffsetTopWithinRoot:function(nt,vt){const it=vt.ownerDocument||nt.ownerDocument||document;if((function(at,It){return at===It.documentElement||at===It.body||at===It.scrollingElement})(vt,it))return nt.getBoundingClientRect().top+Je(it);const lt=vt.getBoundingClientRect(),gt=nt.getBoundingClientRect(),Xe=He(vt,it,!1);return gt.top-lt.top+Xe}}})(F,{isClient:U,scrollRoot:Y});Gn("markstreamShowTooltips",me),Gn("markstreamHtmlPolicy",pe),Gn("markstreamTypewriter",f),Gn("markstreamFade",D(()=>I.fade!==!1)),Gn("markstreamTypewriterCursor",D(()=>!0)),Gn("markstreamTextStreamState",ne),Gn("markstreamStreamVersion",G),Gn("markstreamParseOptions",D(()=>I.parseOptions)),Gn("markstreamCustomMarkdownIt",D(()=>I.customMarkdownIt));const{smoothStreamingEnabled:Te,renderContent:ke,requestedFinal:Ae,effectiveFinal:Ne}=(function(j,oe){const ye=v4e(Bt(Bt({},y4e),j.smoothStreamingOptions)),we=D(()=>{var Xe,at,It;return j.smoothStreaming!==!1&&!((Xe=j.nodes)!=null&&Xe.length)&&(j.smoothStreaming===!0||!((at=oe.inheritedSmoothStreaming)!=null&&at.value))&&(j.smoothStreaming===!0||AF(j.typewriter)!=="off"||((It=j.maxLiveNodes)!=null?It:0)<=0)}),Ee=q(!oe.isClient||j.smoothStreaming===!0);gn(()=>{Ee.value=!0});const He=D(()=>Ee.value&&we.value),Je=D(()=>{var Xe;return He.value?ye.visible.value:(Xe=j.content)!=null?Xe:""}),nt=D(()=>{var Xe,at;const It=(Xe=j.parseOptions)!=null?Xe:{};return(at=j.final)!=null?at:It.final}),vt=D(()=>{const Xe=nt.value;return He.value&&Xe!=null?!!Xe&&ye.caughtUp.value:Xe});let it=0,lt=!1;function gt(){it=0,lt=!1}return ze([()=>j.content,()=>j.nodes,He,nt],([Xe,at,It,At])=>{if(at?.length)return gt(),void ye.reset("");const Ut=Xe??"";if(!It)return gt(),ye.reset(Ut),void(At&&ye.finish({flush:!0}));const Dt=ye.source.value;if(Ut){if(Ut!==Dt)if(Ut.startsWith(Dt)){const rn=Ut.slice(Dt.length),cn=ye.pendingChars.value;rn.length<=8?(it++,lt||it>=2&&cn<=8?(lt=!0,ye.reset(Ut)):ye.enqueue(rn)):(gt(),ye.enqueue(rn))}else gt(),ye.reset(Ut)}else gt(),ye.reset("");At&&ye.finish()},{immediate:!0}),{smoothStream:ye,smoothStreamingEligible:we,smoothStreamingEnabled:He,renderContent:Je,requestedFinal:nt,effectiveFinal:vt}})(I,{isClient:U,inheritedSmoothStreaming:ee}),Ze=Ae.value===!0;Gn("markstreamSmoothStreaming",Te);const rt=q(!1),pt=q(!1),Rt=q(!1);let Ot="",Fe=!1,Pe=null;function be(){U&&Pe!=null&&(window.clearTimeout(Pe),Pe=null)}function Oe(){rt.value=!1,be()}function Ke(j,oe){if(!ue.value)return;const ye=(function(){if(!ue.value)return null;const we=We(Qe),Ee=We(mt),He=Math.max(Se,Ee);if(we<=0&&He<=0)return null;const Je={total:we,maxPerFrame:He,byLabel:(nt=Qe,Object.fromEntries(Array.from(nt.entries()).sort((vt,it)=>it[1]-vt[1]||vt[0].localeCompare(it[0]))))};var nt;return Qe.clear(),mt.clear(),Se=0,Je})();console.info(`[markstream-vue][perf] ${j}`,ye?Dn(Bt({},oe),{layoutReads:ye}):oe)}ze([()=>I.indexKey,()=>I.customId],()=>{var j,oe;Oe(),pt.value=!1,Rt.value=!((j=i.nodes)!=null&&j.length)&&Ae.value!==!0&&!!i.content,Ot=(oe=ke.value)!=null?oe:"",Fe=Ot.length>0},{flush:"sync"}),ze([()=>i.content,()=>i.nodes,Ae],([j,oe,ye])=>{!oe?.length&&ye!==!0&&j&&(Rt.value=!0)},{flush:"sync",immediate:!0}),ze([ke,()=>i.nodes,Ae],([j,oe,ye])=>{const we=j??"";return oe?.length||ye===!0?(Oe(),pt.value=!1,Ot=we,void(Fe=!0)):(we.length>0&&(Rt.value=!0),Fe?(Ot&&we.length>Ot.length&&we.startsWith(Ot)?(rt.value=!0,pt.value=!0,U&&(be(),Pe=window.setTimeout(()=>{var Ee;Pe=null,Ne.value===!0||(Ee=i.nodes)!=null&&Ee.length||(Gp(),rt.value=!1,_c())},1200))):(we.length"u")return null;const He=window;if(He.__markstreamLayoutReadPerformance)return He.__markstreamLayoutReadPerformance;const Je={total:0,maxPerFrame:0,byLabel:{}};return He.__markstreamLayoutReadPerformance=Je,Je})();Ee&&(Ee.total=Number(Ee.total||0)+1,Ee.byLabel[we]=Number(Ee.byLabel[we]||0)+1,Ee.currentFrameTotal=Number(Ee.currentFrameTotal||0)+1,Ee.frameScheduled||(Ee.frameScheduled=!0,typeof window.requestAnimationFrame!="function"?typeof queueMicrotask!="function"?setTimeout(()=>Tt(Ee),0):queueMicrotask(()=>Tt(Ee)):window.requestAnimationFrame(()=>Tt(Ee))))})(j),dt||(dt=!0,U&&typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(ut):typeof queueMicrotask!="function"?setTimeout(ut,0):queueMicrotask(ut)))}function Ve(j,oe){return tt(j),oe()}const kt=I.customId?`renderer-${I.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,Wt=(function(j){const oe=new Map;return{scope:j,cache:oe,clear:()=>oe.clear()}})(kt),Nn=kt;Gn(Lq,Wt);const Sn=vs(()=>I.customId),{effectiveCustomHtmlTagsSet:Yi,mergedParseOptions:Ji,parsedNodes:Zt,getParsedNodesDirtyStartIndex:Ro,getParsedNodesRevision:Js}=m4e(I,{instanceMsgId:kt,renderContent:ke,effectiveFinal:Ne,smoothStreamingEnabled:Te,debugPerformanceEnabled:ue,customComponentsMap:Sn,logPerf:Ke});ze(Zt,()=>{rt.value||Wt.clear(),G.value+=1},{immediate:!0});const ji=D(()=>({customId:I.customId,customHtmlTags:Ji.value.customHtmlTags,parseOptions:I.parseOptions,customMarkdownIt:I.customMarkdownIt,htmlPolicy:pe.value,viewportPriority:I.viewportPriority,viewportPriorityOptions:Z.value,mode:c.value,domMode:I.domMode,codeRenderer:m.value,codeBlockStream:I.codeBlockStream,codeBlockDarkTheme:I.codeBlockDarkTheme,codeBlockLightTheme:I.codeBlockLightTheme,codeBlockMonacoOptions:I.codeBlockMonacoOptions,renderCodeBlocksAsPre:I.renderCodeBlocksAsPre,codeBlockMinWidth:I.codeBlockMinWidth,codeBlockMaxWidth:I.codeBlockMaxWidth,codeBlockProps:I.codeBlockProps,mermaidProps:I.mermaidProps,d2Props:I.d2Props,infographicProps:I.infographicProps,showTooltips:me.value,themes:I.themes,langs:I.langs,isDark:I.isDark,typewriter:f.value,smoothStreamingOptions:I.smoothStreamingOptions,parseCoalesceMs:I.parseCoalesceMs,fade:I.fade}));Gn("markstreamNestedRendererProps",ji);const Fr=D(()=>Zt.value),Oo=D(()=>Zt.value.length),pr=q(null),Zo=q(null),Po=q(null),fo=q(null),Ps=i.indexKey!=null&&String(i.indexKey).startsWith("list-item-"),$l=!Ps&&I.customId?yF(I.customId):null,mr=D(()=>$l?(S8.value,yF(I.customId)):null),Ue=D(()=>{var j;return!!(!Q.value&&I.customId&&!Ps&&((j=mr.value)!=null&&j.enabled))}),Ge=D(()=>!!(U&&Ue.value)),Ye=D(()=>{var j;return!!(!Q.value&&((j=i.virtualScroll)!=null&&j.enabled))}),fn=D(()=>Ye.value),xt=q(!1);gn(()=>{xt.value=!0});const hn=D(()=>!!(U&&Ye.value));Gn("markstreamHostScrollManaged",hn);const So=D(()=>!!(xt.value&&hn.value)),ei=D(()=>Ge.value||hn.value),Li=D(()=>Ge.value||So.value),Mt=D(()=>{var j;return ei.value&&((j=mr.value)==null?void 0:j.textEstimation)!==!1});function ht(){const j=te.value||Ve("getMeasuredContainerWidth.clientWidth",()=>{var oe;return((oe=F.value)==null?void 0:oe.clientWidth)||0});return Number.isFinite(j)&&j>0?j:0}const $t=D(()=>{const j=ht();return j>0?Math.max(1,Math.round(j)):640}),Vt=D(()=>{var j,oe;return!(Ne.value!==!0||Ye.value||c.value!=="chat"&&c.value!=="minimal"||a("maxLiveNodes")||a("liveNodeBuffer")||(j=i.nodes)!=null&&j.length||Rt.value||!(((oe=I.maxLiveNodes)!=null?oe:0)<=0))}),Un=D(()=>{var j;return Vt.value?50:Math.max(1,(j=I.maxLiveNodes)!=null?j:320)}),Ri=D(()=>{var j;return Vt.value?16:Math.max(0,(j=I.liveNodeBuffer)!=null?j:60)}),An=D(()=>{var j;return!Q.value&&I.nodeVirtual!==!1&&!(((j=I.maxLiveNodes)!=null?j:0)<=0&&!Vt.value)&&(I.nodeVirtual===!0?Zt.value.length>0:Zt.value.length>Un.value)}),Ga=D(()=>An.value||Ge.value||hn.value),va=D(()=>I.viewportPriority!==!1),Xf=D(()=>!!va.value&&!K.value);var Dr;Dr=D(()=>va.value),Gn(xq,Dr);const zl=D(()=>{var j;return!(Q.value||I.deferNodesUntilVisible===!1||((j=I.maxLiveNodes)!=null?j:0)<=0||An.value||Zt.value.length>900||I.viewportPriority===!1)}),gr=Q9e(j=>{var oe;return ge((oe=j??F.value)!=null?oe:null)},va),{requestFrame:Go,cancelFrame:Xi,hasIdleCallback:vr,isTestEnv:yr}=(function(j){const oe=j.isClient&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):null,ye=j.isClient&&typeof window.cancelAnimationFrame=="function"?window.cancelAnimationFrame.bind(window):null,we=j.isClient&&typeof window.requestIdleCallback=="function",Ee=(function(){var He;if(typeof globalThis>"u"||!("process"in globalThis))return;const Je=(He=Object.getOwnPropertyDescriptor(globalThis,"process"))==null?void 0:He.value;return Je?.env})();return{requestFrame:oe,cancelFrame:ye,hasIdleCallback:we,isTestEnv:Ee?.NODE_ENV==="test"}})({isClient:U}),Qa=D(()=>Ne.value===!0&&!Ye.value),{resolvedBatchSize:jl,resolvedInitialBatch:ol,batchingEnabled:Eu,incrementalRenderingActive:ya,renderedCount:Bs,previousRenderContext:Bo,adaptiveBatchSize:ks,previousBatchConfig:Hl}=(function(j,oe){var ye;const we=D(()=>{var gt;const Xe=Math.trunc((gt=j.renderBatchSize)!=null?gt:80);return Number.isFinite(Xe)?Math.max(0,Xe):0}),Ee=D(()=>{var gt;const Xe=Math.trunc((gt=j.initialRenderBatchSize)!=null?gt:we.value);return Number.isFinite(Xe)?Math.max(0,Xe):we.value}),He=D(()=>!oe.renderAsFragment.value&&j.batchRendering!==!1&&we.value>0&&oe.isClient&&!oe.isTestEnv),Je=q(0),nt=q({key:j.indexKey,total:0}),vt=q(Math.max(1,we.value||1)),it=D(()=>{var gt,Xe,at;return He.value&&!((gt=oe.continuousStreaming)!=null&>.value)&&!((Xe=oe.forceFullRenderFinalContent)!=null&&Xe.value)&&((at=j.maxLiveNodes)!=null?at:0)<=0}),lt=q({batchSize:we.value,initial:Ee.value,delay:(ye=j.renderBatchDelay)!=null?ye:16,enabled:it.value});return{resolvedBatchSize:we,resolvedInitialBatch:Ee,batchingEnabled:He,incrementalRenderingActive:it,renderedCount:Je,previousRenderContext:nt,adaptiveBatchSize:vt,previousBatchConfig:lt}})(I,{isClient:U,isTestEnv:yr,renderAsFragment:Q,forceFullRenderFinalContent:Qa,continuousStreaming:D(()=>pt.value&&Ne.value!==!0)}),bs=D(()=>{var j;return!Q.value&&I.batchRendering!==!1&&jl.value>0&&!yr&&((j=I.maxLiveNodes)!=null?j:0)<=0&&!Qa.value}),Ai=D(()=>bs.value),$o=D(()=>ei.value||Ai.value),Hi=D(()=>{var j;return $o.value&&((j=mr.value)==null?void 0:j.codeBlockEstimation)!==!1}),xi=new Map,Rr=new Map,Ya=new WeakMap;let zo=null;const Ja=new WeakMap,_o=new Map,sl=[];let Qo=[],vo=[],ai=-1;const ws=_u(sl),Xs=new Set,Or=q(0);let kr=0;const bc=q(0),wc=D(()=>(bc.value,Array.from(xi.entries()).sort((j,oe)=>j[0]-oe[0]))),Xa=q(null),jo=q(null);let Cs,Pr=null,br=0,Io=null;function ui(){Cs.markFallbackHeightPrefixDirty()}function Br(j){return Cs.getFallbackNodeHeight(j)}function $s(j,oe){return Cs.estimateHeightRange(j,oe)}function Wl(j){return Cs.estimateIndexForOffset(j)}const{activeRestoreAnchor:lo,getRelativeScrollTopWithinContainer:Lu,setRelativeScrollTopWithinContainer:ka,resolveAnchorOffset:md,clearRestoreReconcile:ql,scheduleRestoreReconcile:ba,captureRestoreAnchor:wr,restoreAnchor:wa,getAnchorDrift:As}=(function(j){const{isClient:oe,containerRef:ye,parsedNodeCount:we,requestFrame:Ee,cancelFrame:He,resolveScrollContainer:Je,getNormalizedScrollTop:nt,getOffsetTopWithinRoot:vt,isReverseFlexScrollRoot:it,estimateIndexForOffset:lt,estimateHeightRange:gt,getFallbackNodeHeight:Xe,clamp:at}=j,It=q(null);let At=null,Ut=[];function Dt(){const Cn=Je(),Wn=ye.value;if(!Cn||!Wn)return null;const Jn=Cn.ownerDocument||Wn.ownerDocument||document;if(Cn===Jn.documentElement||Cn===Jn.body||Cn===Jn.scrollingElement){const Oi=Wn.getBoundingClientRect();return Math.max(0,-Oi.top)}return Math.max(0,nt(Cn,Jn,!1)-vt(Wn,Cn))}function rn(Cn){var Wn;const Jn=Je(),Oi=ye.value;if(!Jn||!Oi)return;const er=Math.max(0,Cn),Us=Jn.ownerDocument||Oi.ownerDocument||document,nu=Us.defaultView||(typeof window<"u"?window:null);if(Jn===Us.documentElement||Jn===Us.body||Jn===Us.scrollingElement){const Ru=nt(Jn,Us,!0)+Oi.getBoundingClientRect().top;return void((Wn=nu?.scrollTo)==null||Wn.call(nu,0,Math.max(0,Ru+er)))}wF(Jn,Us,vt(Oi,Jn)+er,{isReverseFlexScrollRoot:Ru=>{var _g;return(_g=it?.(Ru))!=null&&_g},getNormalizedScrollTop:nt})}function cn(Cn){const Wn=we.value,Jn=at(Cn.nodeIndex,0,Math.max(0,Wn-1));return gt(0,Jn)+Math.max(0,Cn.offsetWithinNodePx)}function wn(){if(At!=null&&(He?.(At),At=null),oe)for(const Cn of Ut)window.clearTimeout(Cn);Ut=[]}function yn(Cn){const Wn=cn(Cn),Jn=Dt();Jn!=null&&Math.abs(Jn-Wn)<=.5||rn(Wn)}return{activeRestoreAnchor:It,getRelativeScrollTopWithinContainer:Dt,setRelativeScrollTopWithinContainer:rn,resolveAnchorOffset:cn,clearRestoreReconcile:wn,applyRestoreAnchor:yn,scheduleRestoreReconcile:function(){It.value&&oe&&At==null&&(At=Ee?Ee(()=>{At=null,It.value&&yn(It.value)}):null,At==null&&It.value&&yn(It.value))},captureRestoreAnchor:function(){const Cn=Dt(),Wn=we.value;if(Cn==null||Wn<=0)return null;const Jn=at(lt(Cn+1),0,Wn-1),Oi=gt(0,Jn),er=Xe(Jn);return{nodeIndex:Jn,offsetWithinNodePx:at(Cn-Oi,0,Math.max(0,er-1))}},restoreAnchor:function(Cn){const Wn=we.value;if(It.value={nodeIndex:at(Cn.nodeIndex,0,Math.max(0,Wn-1)),offsetWithinNodePx:Math.max(0,Cn.offsetWithinNodePx)},wn(),yn(It.value),oe)for(const Jn of[0,120,280,480])Ut.push(window.setTimeout(()=>{It.value&&yn(It.value)},Jn))},getAnchorDrift:function(Cn){const Wn=Dt();return Wn==null?null:Wn-cn(Cn)}}})({isClient:U,containerRef:F,parsedNodeCount:Oo,requestFrame:Go,cancelFrame:Xi,resolveScrollContainer:()=>Xa.value||ae(),getNormalizedScrollTop:ve,getOffsetTopWithinRoot:ce,isReverseFlexScrollRoot:Ce,estimateIndexForOffset:Wl,estimateHeightRange:$s,getFallbackNodeHeight:Br,clamp:Xo}),{nodeHeights:rl,heightStats:ao,heightTreeSize:eo,heightSumTree:Ul,heightKnownTree:gd,averageNodeHeight:Vl,resetHeightMeasurements:Kl,pruneHeightMeasurements:Zl,rebuildHeightTrees:ll,recordNodeHeight:vd,removeNodeHeights:Ca,exportHeightCache:eu,importHeightCache:Cc,fenwickRangeSum:zs}=(function(j={}){const oe=po({}),ye=po({total:0,count:0}),we=q(0),Ee=q([]),He=q([]);function Je(){for(const Xe of Object.keys(oe))delete oe[Number(Xe)];ye.total=0,ye.count=0,we.value=0,Ee.value=[],He.value=[]}function nt(Xe,at,It){for(let At=at+1;At0;At-=At&-At)It+=Xe[At];return It}function it(Xe){we.value=Xe;const at=new Array(Xe+1).fill(0),It=new Array(Xe+1).fill(0);for(const[At,Ut]of Object.entries(oe)){const Dt=Number(At),rn=Number(Ut);!Number.isFinite(Dt)||Dt<0||Dt>=Xe||!Number.isFinite(rn)||rn<=0||(nt(at,Dt,rn),nt(It,Dt,1))}Ee.value=at,He.value=It}function lt(Xe){if(!Number.isInteger(Xe)||Xe<0)return!1;const at=oe[Xe];if(!Number.isFinite(at)||at<=0)return!1;if(delete oe[Xe],ye.total=Math.max(0,ye.total-at),ye.count=Math.max(0,ye.count-1),we.value>Xe){const It=Ee.value,At=He.value;It.length&&At.length&&(nt(It,Xe,-at),nt(At,Xe,-1))}return!0}const gt=D(()=>ye.count>0?Math.max(12,ye.total/ye.count):32);return{nodeHeights:oe,heightStats:ye,heightTreeSize:we,heightSumTree:Ee,heightKnownTree:He,averageNodeHeight:gt,resetHeightMeasurements:Je,pruneHeightMeasurements:function(Xe){if(Xe<=0)return void Je();let at=0,It=0;for(const[At,Ut]of Object.entries(oe)){const Dt=Number(At),rn=Number(Ut);!Number.isFinite(Dt)||Dt<0||Dt>=Xe||!Number.isFinite(rn)||rn<=0?delete oe[Dt]:(at+=rn,It++)}ye.total=at,ye.count=It},rebuildHeightTrees:it,recordNodeHeight:function(Xe,at,It={}){(function(At,Ut,Dt={}){var rn;if(!Number.isFinite(Ut)||Ut<=0)return!1;const cn=oe[At];if(cn&&(Dt.allowShrink===!1&&UtAt){const wn=Ee.value,yn=He.value;if(wn.length&&yn.length)if(cn){const Cn=Ut-cn;Cn!==0&&nt(wn,At,Cn)}else nt(wn,At,Ut),nt(yn,At,1)}Dt.notify!==!1&&((rn=j.onHeightRecorded)==null||rn.call(j))})(Xe,at,Dn(Bt({},It),{notify:!0}))},removeNodeHeight:function(Xe,at={}){var It;const At=lt(Xe);return At&&at.notify!==!1&&((It=j.onHeightRecorded)==null||It.call(j)),At},removeNodeHeights:function(Xe,at={}){var It;let At=0;for(const Ut of Xe)lt(Number(Ut))&&At++;return At>0&&at.notify!==!1&&((It=j.onHeightRecorded)==null||It.call(j)),At},exportHeightCache:function(){return Object.entries(oe).map(([Xe,at])=>({index:Number(Xe),height:Number(at)})).filter(Xe=>Number.isFinite(Xe.index)&&Xe.index>=0&&Number.isFinite(Xe.height)&&Xe.height>0).sort((Xe,at)=>Xe.index-at.index)},importHeightCache:function(Xe,at={}){var It;if(!Array.isArray(Xe))return;const At=we.value;let Ut=!1;if(at.mode!=="merge"){const Dt=Object.keys(oe);if(Dt.length>0){for(const rn of Dt)delete oe[Number(rn)];Ut=!0}}for(const Dt of Xe){const rn=Number(Dt.index),cn=Number(Dt.height);if(!Number.isInteger(rn)||rn<0||At>0&&rn>=At||!Number.isFinite(cn)||cn<=0)continue;const wn=oe[rn];wn&&Math.abs(wn-cn)<=1||(oe[rn]=cn,Ut=!0)}Ut&&((function(){let Dt=0,rn=0;const cn=we.value;for(const[wn,yn]of Object.entries(oe)){const Cn=Number(wn),Wn=Number(yn);!Number.isFinite(Cn)||Cn<0||cn>0&&Cn>=cn||!Number.isFinite(Wn)||Wn<=0?delete oe[Cn]:(Dt+=Wn,rn++)}ye.total=Dt,ye.count=rn})(),At>0&&it(At),(It=j.onHeightRecorded)==null||It.call(j))},fenwickRangeSum:function(Xe,at,It){if(It<=at)return 0;const At=vt(Xe,It-1);return at<=0?At:At-vt(Xe,at-1)}}})({onHeightRecorded:()=>{ui(),hn.value&&bg(),lo.value&&ba(),jo.value&&Vp(),to("node-resize")}});function Yo(j){Number.isInteger(j)&&j>=0&&Xs.add(j)}function js(j){for(const oe of j)Yo(Number(oe))}function Hs(j){kr++;let oe=!0;try{const ye=j();return oe=ye!==!1,ye}finally{kr--,kr===0&&oe&&Or.value++}}function qe(){Qo=[],vo=[],ai=-1,Xs.clear(),ws.value=sl}function Re(){qe(),Hs(()=>Kl()),_o.clear()}function ct(j){!Number.isInteger(j)||j<0||j>=Zt.value.length||_o.set(j,ug(j))}function un(j,oe,ye={}){const we=rl[j];Yo(j),vd(j,oe,ye);const Ee=rl[j];return Object.is(we,Ee)?(Xs.delete(j),!1):(Ee&&Ee>0?ct(j):we&&_o.delete(j),!0)}function Rn(j,oe){const ye=Ve("getNodeLayoutHeight.slot.offsetHeight",()=>{var we,Ee;return(Ee=(we=xi.get(j))==null?void 0:we.offsetHeight)!=null?Ee:0});return ye>0?ye:Ve("getNodeLayoutHeight.content.offsetHeight",()=>oe.offsetHeight)}function In(j,oe={}){oe.mode!=="merge"?qe():js(j.map(ye=>ye.index)),Hs(()=>Cc(j,oe)),Hw()}const oi=D(()=>zl.value&&Xf.value),Si=D(()=>{var j;return!Q.value&&I.batchRendering!==!1&&jl.value>0&&((j=I.maxLiveNodes)!=null?j:0)<=0}),xs=D(()=>!Q.value&&Ze&&Ne.value===!0&&!An.value&&!Ye.value&&!Ue.value&&!oi.value&&!Si.value),al=D(()=>!!gr&&oi.value),ul=D(()=>An.value||hn.value),{focusIndex:Ho,liveRange:uo,updateLiveRange:tu}=(function(j,oe){const{parsedNodeCount:ye,virtualizationEnabled:we,maxLiveNodesResolved:Ee,liveNodeBufferResolved:He,clamp:Je}=oe,nt=He??D(()=>{var lt;return Math.max(0,(lt=j.liveNodeBuffer)!=null?lt:60)}),vt=q(0),it=po({start:0,end:0});return{liveNodeBufferResolved:nt,focusIndex:vt,liveRange:it,updateLiveRange:function(){const lt=ye.value;if(!we.value||lt===0)return it.start=0,void(it.end=lt);const gt=Math.min(Ee.value,lt),Xe=nt.value,at=Je(vt.value-Xe,0,Math.max(0,lt-gt));it.start=at,it.end=Math.min(lt,at+gt)}}})(I,{parsedNodeCount:Oo,virtualizationEnabled:An,maxLiveNodesResolved:Un,liveNodeBufferResolved:Ri,clamp:Xo}),$r=new Map,Aa=new Map,Gl=new Map,Nu=[],cl=new Map,zr=new Set,Fu=q(0);let yd=!1;const dl=D(()=>(Fu.value,zr.size)),Yn=new Map,Ss=new Map,Cr=q(0),fl=D(()=>{Cr.value;let j=0;for(const oe of Yn.values())j+=Math.max(0,oe);return j});let Ws=null;const Ac=D(()=>{if(!An.value)return Zt.value.length;const j=Ri.value,oe=Math.max(uo.end+j,ol.value),ye=Math.min(Zt.value.length,oe);return Math.max(Bs.value,ye)});function xc(){yd||(yd=!0,queueMicrotask(()=>{yd=!1,Fu.value+=1}))}function Ie(j,oe,ye="node-resize"){if(!U||typeof window>"u")return null;const we=window.setTimeout(()=>{zr.delete(we)&&xc();try{oe()}finally{to(ye)}},Math.max(0,j));return zr.add(we),xc(),we}function $e(j){U&&j!=null&&(zr.delete(j)&&xc(),window.clearTimeout(j))}function yt(){if(U&&typeof window<"u")for(const j of zr)window.clearTimeout(j);zr.size&&(zr.clear(),xc()),Nu.length=0,Gl.clear()}function Ht(j){P.value=j}function vn(j){z.value=j}function Bn(j){W.value=j}const{cancelScheduledFocusSync:Vn,scheduleFocusSync:ti}=(function(j){const{isClient:oe,containerRef:ye,virtualizationEnabled:we,requestFrame:Ee,cancelFrame:He,syncFocusToScroll:Je}=j;let nt=null;function vt(){var lt,gt,Xe;return(Xe=(gt=(lt=ye.value)==null?void 0:lt.ownerDocument)==null?void 0:gt.defaultView)!=null?Xe:typeof window<"u"?window:null}function it(){if(!nt)return;const lt=vt();nt.viaTimeout?lt?lt.clearTimeout(nt.id):clearTimeout(nt.id):He?.(nt.id),nt=null}return{cancelScheduledFocusSync:it,scheduleFocusSync:function(lt={}){if(!we.value)return;if(!oe)return void Je(!0);if(lt.immediate)return it(),void Je(!0);if(nt)return;const gt=()=>{nt=null,Je()};if(Ee)return void(nt={id:Ee(gt),viaTimeout:!1});const Xe=vt();nt={id:Xe?Xe.setTimeout(gt,16):setTimeout(gt,16),viaTimeout:!0}}}})({isClient:U,containerRef:F,virtualizationEnabled:An,requestFrame:Go,cancelFrame:Xi,syncFocusToScroll:function(j=!1){var oe;if(!An.value)return;const ye=Xa.value||ae();if(!ye)return;const we=ye.ownerDocument||((oe=F.value)==null?void 0:oe.ownerDocument)||document,Ee=we?.defaultView||(typeof window<"u"?window:null),He=ye===we?.documentElement||ye===we?.body,Je=Zt.value.length;if(Je<=0)return;if(!He&&Je>0&&Ce(ye)){const At=Ve("syncFocusToScroll.clientHeight",()=>ye.clientHeight||0),Ut=Ve("syncFocusToScroll.scrollTop",()=>ye.scrollTop),Dt=Ut<0?-Ut:Ut;return void kd(Xo((nt=Math.max(0,Dt)+.5*Math.max(0,At),Cs.estimateIndexForOffsetFromEnd(nt)),0,Math.max(0,Je-1)),j)}var nt;const vt=(function(At,Ut,Dt,rn){const cn=F.value;if(!cn)return null;const wn=rn?0:Ve("syncFocusToScroll.model.root.getBoundingClientRect",()=>At.getBoundingClientRect().top),yn=Ve("syncFocusToScroll.model.container.getBoundingClientRect",()=>cn.getBoundingClientRect().top),Cn=Math.max(0,wn-yn),Wn=rn?Ve("syncFocusToScroll.model.viewport.clientHeight",()=>{var Jn,Oi,er,Us;return(Us=(er=(Oi=Dt?.innerHeight)!=null?Oi:(Jn=Ut.documentElement)==null?void 0:Jn.clientHeight)!=null?er:At.clientHeight)!=null?Us:0}):Ve("syncFocusToScroll.model.root.clientHeight",()=>At.clientHeight);return Xo(Wl(Cn+.5*Math.max(0,Wn)),0,Math.max(0,Zt.value.length-1))})(ye,we,Ee,He);if(vt!=null)return void kd(vt,j);const it=He?null:Ve("syncFocusToScroll.root.getBoundingClientRect",()=>ye.getBoundingClientRect()),lt=He?0:it.top,gt=He?Ve("syncFocusToScroll.viewport.clientHeight",()=>{var At,Ut;return(Ut=(At=Ee?.innerHeight)!=null?At:ye.clientHeight)!=null?Ut:0}):it.bottom,Xe=wc.value;let at=null,It=null;for(const[At,Ut]of Xe){if(!Ut)continue;const Dt=Ve("syncFocusToScroll.slot.getBoundingClientRect",()=>Ut.getBoundingClientRect());Dt.bottom<=lt||Dt.top>=gt||(at==null&&(at=At),It=At)}if(at==null||It==null){const At=F.value;if(!At)return;const Ut=He?{top:0}:Ve("syncFocusToScroll.fallback.root.getBoundingClientRect",()=>ye.getBoundingClientRect()),Dt=Ve("syncFocusToScroll.fallback.scrollTop",()=>ve(ye,we,He)),rn=He?(()=>{const wn=Ve("syncFocusToScroll.fallback.container.getBoundingClientRect",()=>At.getBoundingClientRect()),yn=(He?0:Ut.top)-wn.top;return Math.max(0,yn)})():(()=>{const wn=ce(At,ye);return Math.max(0,Dt-wn)})(),cn=He?Ve("syncFocusToScroll.fallback.viewport.clientHeight",()=>{var wn,yn,Cn,Wn;return(Wn=(Cn=(yn=Ee?.innerHeight)!=null?yn:(wn=we?.documentElement)==null?void 0:wn.clientHeight)!=null?Cn:ye.clientHeight)!=null?Wn:0}):Ve("syncFocusToScroll.fallback.root.clientHeight",()=>ye.clientHeight);return void kd(Xo(Wl(rn+.5*Math.max(0,cn)),0,Math.max(0,Zt.value.length-1)),!0)}kd(Math.round((at+It)/2),j)}}),{visibleNodeIndices:Jo,nodeVisibilityHandles:hl,nodeVisibilityWatchStops:Ql,nodeVisibilityFallbackTimers:Pp,clearVisibilityFallback:Bp,markNodeVisible:Du,cleanupNodeVisibility:D2,destroyNodeVisibilityState:rg}=g4e({isClient:U,shouldTrackVisibleNodeIndices:()=>oi.value,shouldCleanupNodeVisibility:()=>An.value,onNodeMarkedVisible:j=>{An.value?ti():Ho.value=Xo(j,0,Math.max(0,Zt.value.length-1))},onNodeVisibilityCleaned:j=>{xi.delete(j)&&gI()}}),{cleanupScrollListener:R2,setupScrollListener:O2}=(function(j){const{isClient:oe,virtualizationEnabled:ye,listenerEnabled:we,scrollRootElement:Ee,resolveScrollContainer:He,scheduleFocusSync:Je,onScroll:nt}=j;let vt=null,it=null;function lt(){vt&&(vt(),vt=null),it=null,Ee.value=null}function gt(Xe){const at=j.getScrollTop?j.getScrollTop(Xe):Xe.scrollTop;return Math.max(0,Number.isFinite(at)?Math.abs(at):0)}return{cleanupScrollListener:lt,setupScrollListener:function(){if(!oe)return;if(!((Xe=we?.value)!=null?Xe:ye.value))return void lt();var Xe;const at=He();if(!at)return void lt();if(Ee.value===at&&vt)return;lt(),it=gt(at);const It=()=>{if(nt?.(),ye.value){const At=(function(Ut){const Dt=gt(Ut),rn=it;it=Dt;const cn=Math.max(480,.75*(Ut.clientHeight||0));return rn==null?Dt>cn?{immediate:!0}:void 0:Math.abs(Dt-rn)>cn?{immediate:!0}:void 0})(at);At?Je(At):Je()}};at.addEventListener("scroll",It,{passive:!0}),Ee.value=at,vt=()=>{at.removeEventListener("scroll",It)}}}})({isClient:U,virtualizationEnabled:An,listenerEnabled:ul,scrollRootElement:Xa,resolveScrollContainer:ae,scheduleFocusSync:ti,onScroll:function(){const j=jo.value;if(!j)return;const oe=ag();if(!oe||(function(we){if(pg()>=br)return Io=null,!1;const Ee=Io;if(Ee==null)return!0;const He=Math.abs(we.scrollTop-Ee)<=2;return He||(Io=null),He})(oe))return;const ye=oI(oe);ye!=null?(ye<-32||Math.abs(Math.max(0,ye)-Math.max(0,j.distanceFromBottomPx))>32)&&Up("restore"):Up("restore")},getScrollTop:j=>{var oe;const ye=j.ownerDocument||((oe=F.value)==null?void 0:oe.ownerDocument)||document,we=j===ye.documentElement||j===ye.body||j===ye.scrollingElement;return Ve("scrollListener.getScrollTop",()=>ve(j,ye,we))}});function kd(j,oe=!1){const ye=Xo(j,0,Math.max(0,Zt.value.length-1));!oe&&Math.abs(ye-Ho.value)<=1||(Ho.value=ye,tu())}function Xo(j,oe,ye){return Math.min(Math.max(j,oe),ye)}function $p(j=Zt.value.length){const oe=Ro();return!Number.isInteger(oe)||oe<0?j:Xo(oe,0,j)}function bd(j){return j?.firstElementChild}function P2(j,oe){var ye;return j?(ye=j.matches)!=null&&ye.call(j,oe)?j:j.querySelector(oe):null}function wd(j,oe){j<1||j>6||($[j]=oe)}function B2(){if(!ei.value)return void(te.value=0);const j=Ve("updateExperimentContainerWidth.clientWidth",()=>{var oe,ye;return(ye=(oe=F.value)==null?void 0:oe.clientWidth)!=null?ye:0});te.value=j>0?j:0}let Cd=null;function lg(){Cd?.disconnect(),Cd=null}const zp=d0("ViewportDeferredMarkdownCodeBlockNode",Xu({loader:()=>io(null,null,function*(){return(yield qo(()=>import("./index5-CI5HVqyi.js"),__vite__mapDeps([6,4,5]))).default}),loadingComponent:gb,delay:0,suspensible:!1}),gb);function Me(j){return j===zp}const st=D(()=>m.value==="pre"?bl:m.value==="shiki"?zp:k8);function et(){var j;return((j=I.codeBlockProps)==null?void 0:j.showHeader)!==!1}function _t(j,oe,ye){const we=rl[oe],Ee=typeof we=="number"&&we>0;if(Mt.value&&!Ee&&!(function(He){return!!Sn.value.paragraph&&(He.type==="paragraph"||He.type==="list_item"||He.type==="list")})(j)){const He=Eq(j,ye,le.value);if(He)return He}if(Hi.value&&j.type==="code_block"){const He=(function(Je){if(Je.type!=="code_block")return null;const nt=MI(Je,Z2(Je));return Me(nt)?"markdown":nt===bl?"pre":nt===st.value||nt===k8?"monaco":null})(j);if(He==="monaco"||He==="markdown"||He==="pre")return(function(Je,nt){var vt,it,lt;if(!Je||Je.type!=="code_block")return null;const gt=nt.rendererKind,Xe=gt!=="pre"&&nt.showHeader!==!1,at=!!Je.diff;let It=0,At=500;if(gt==="monaco"){const Dt=(vt=nt.monacoOptions)!=null?vt:{},rn=M8(Je,Dt,nt.width),cn=(function(yn){const Cn=typeof yn?.fontSize=="number"&&yn.fontSize>0?yn.fontSize:12;return typeof yn?.lineHeight=="number"&&yn.lineHeight>0?yn.lineHeight:Math.round(1.5*Cn)})(Dt),wn=(function(yn,Cn){var Wn,Jn;const Oi=typeof((Wn=yn?.padding)==null?void 0:Wn.top)=="number"?yn.padding.top:Cn?0:8,er=typeof((Jn=yn?.padding)==null?void 0:Jn.bottom)=="number"?yn.padding.bottom:Cn?0:8;return Math.max(0,Oi)+Math.max(0,er)})(Dt,at);At=typeof Dt.MAX_HEIGHT=="number"&&Dt.MAX_HEIGHT>0?Dt.MAX_HEIGHT:500,It=Math.round(rn*cn+wn)}else if(gt==="markdown"){const Dt=M8(Je);It=Math.round(21*Dt+32)}else{const Dt=M8(Je);It=Math.round(28*Dt),At=Number.POSITIVE_INFINITY}const Ut=Math.max(1,Math.min(It,At));return Bt({kind:"code-block",height:Math.round(Ut+(Xe?40:0)),contentHeight:Ut,rendererKind:gt},at&>==="monaco"?{diffInline:Wx((it=nt.monacoOptions)!=null?it:{},(lt=nt.width)!=null?lt:0)}:{})})(j,{rendererKind:He,monacoOptions:I.codeBlockMonacoOptions,showHeader:et(),width:ye})}return null}Y1(()=>{if(Or.value,kr>0)return;const j=Zt.value,oe=Js();if(!j.length||!$o.value)return Qo=[],vo=[],ai=-1,Xs.clear(),void(ws.value=sl);const ye=te.value||Ve("estimatedNodeHeights.clientWidth",()=>{var it;return((it=F.value)==null?void 0:it.clientWidth)||0});if(!Number.isFinite(ye)||ye<=0)return Qo=[],vo=[],ai=-1,Xs.clear(),void(ws.value=sl);const we=(function(it){return[Math.round(it),Mt.value,Hi.value,le.value,I.codeBlockMonacoOptions,et(),m.value,Sn.value,S8.value]})(ye),Ee=Qo.length<=j.length&&(Je=we,(He=vo).length===Je.length&&He.every((it,lt)=>Object.is(it,Je[lt])));var He,Je;const nt=Ee&&ai===oe?j.length:Ee?$p(j.length):0,vt=Ee?Array.from(Xs):[];Qo.length=j.length;for(let it=nt;it=0&&itws.value);Cs=(function(j){let oe=!0,ye=[0],we="";function Ee(lt){var gt;const Xe=j.nodeHeights[lt];if(Number.isFinite(Xe)&&Xe>0)return Xe;const at=j.parsedNodes.value[lt],It=at?.type,At=!!((gt=j.hasCustomParagraphComponent)!=null&>.call(j)),Ut=j.estimatedNodeHeights.value[lt],Dt=Ut?.height;if(!(function(cn,wn,yn){return!!(yn&&wn?.kind==="simple-text"&&(cn==="paragraph"||cn==="list_item"||cn==="list"))})(It,Ut,At)&&Number.isFinite(Dt)&&Dt>0)return Dt;const rn=o4e(at,j.getContainerWidth()||640);return It==="heading"||It==="paragraph"&&rn<=28&&(function(cn,wn){if(wn)return!1;const yn=cn.children;return!Array.isArray(yn)||!yn.length||yn.every(Nq)})(at,At)?rn:Math.max(j.averageNodeHeight.value,rn)}function He(){var lt;const gt=j.parsedNodes.value.length,Xe=j.getPrefixCacheKeyParts().join(":");if(!oe&&we===Xe)return ye;const at=new Array(gt+1);at[0]=0;for(let It=0;It=((gt=It[at])!=null?gt:0))return at-1;let At=0,Ut=at-1,Dt=at-1;for(;At<=Ut;){const rn=At+Ut>>1;((Xe=It[rn+1])!=null?Xe:0)>=lt?(Dt=rn,Ut=rn-1):At=rn+1}return Dt}function nt(lt,gt){var Xe,at;if(lt>=gt)return 0;if(j.heightEstimationActive.value)return(function(Ut,Dt){var rn,cn;const wn=j.parsedNodes.value.length,yn=xF(Math.trunc(Ut),0,wn),Cn=xF(Math.trunc(Dt),yn,wn);if(yn>=Cn)return 0;const Wn=He();return((rn=Wn[Cn])!=null?rn:0)-((cn=Wn[yn])!=null?cn:0)})(lt,gt);if(j.heightTreeSize.value!==j.parsedNodes.value.length){let Ut=0;for(let Dt=lt;Dtyn<=0?0:j.fenwickRangeSum(At,0,yn)+(yn-j.fenwickRangeSum(Ut,0,yn))*It;let rn=0,cn=Xe.length-1,wn=Xe.length-1;for(;rn<=cn;){const yn=rn+cn>>1;Dt(yn+1)>=lt?(wn=yn,cn=yn-1):rn=yn+1}return wn}let at=lt;for(let It=0;It0||lt++}return lt}return{markFallbackHeightPrefixDirty:function(){oe=!0},getFallbackNodeHeight:Ee,estimateHeightRange:nt,estimateIndexForOffset:vt,estimateIndexForOffsetFromEnd:function(lt){var gt,Xe;const at=j.parsedNodes.value;if(!at.length)return 0;if(lt<=0)return Math.max(0,at.length-1);if(j.heightEstimationActive.value){const At=(gt=He()[at.length])!=null?gt:0;return Je(Math.max(0,At-lt))}if(j.heightTreeSize.value===at.length){const At=nt(0,at.length);return vt(Math.max(0,At-lt))}let It=lt;for(let At=at.length-1;At>=0;At--){const Ut=(Xe=j.nodeHeights[At])!=null?Xe:j.averageNodeHeight.value;if(It<=Ut)return At;It-=Ut}return 0},getEstimatedNodeHeightCount:it,buildVirtualHeightSummary:function(lt){var gt;const Xe=j.parsedNodes.value.length;return{totalNodes:Xe,measuredCount:j.heightStats.count,estimatedCount:it(),averageNodeHeight:j.averageNodeHeight.value,topSpacerHeight:lt.topSpacerHeight,bottomSpacerHeight:lt.bottomSpacerHeight,estimatedTotalHeight:nt(0,Xe),width:(gt=lt.width)!=null?gt:j.getContainerWidth()}}}})({parsedNodes:Zt,nodeHeights:rl,heightStats:ao,heightTreeSize:eo,heightSumTree:Ul,heightKnownTree:gd,averageNodeHeight:Vl,heightEstimationActive:ei,estimatedNodeHeights:an,getContainerWidth:ht,hasCustomParagraphComponent:()=>!!Sn.value.paragraph,getPrefixCacheKeyParts:()=>{var j;const oe=zg(te.value||Ve("getFallbackHeightPrefix.clientWidth",()=>{var we;return((we=F.value)==null?void 0:we.clientWidth)||0})),ye=((j=i.virtualScroll)==null?void 0:j.measurementKey)==null?"":String(i.virtualScroll.measurementKey);return[Zt.value.length,ao.count,Math.round(ao.total),Math.round(100*Vl.value),ye,oe,ei.value?1:0,S8.value,G.value,Sn.value.paragraph?1:0]},fenwickRangeSum:zs}),ze(()=>Zt.value.length,j=>{var oe;ui(),j<=0?Re():(jZl(oe))),j!==eo.value&&ll(j))},{immediate:!0});const On=D(()=>{if(!An.value)return Zt.value.map((we,Ee)=>({node:we,index:Ee}));const j=Zt.value.length,oe=Xo(uo.start,0,j),ye=Xo(uo.end,oe,j);return Zt.value.slice(oe,ye).map((we,Ee)=>({node:we,index:oe+Ee}))}),xn=D(()=>An.value?$s(0,Math.min(uo.start,Zt.value.length)):0),En=D(()=>{if(!An.value)return 0;const j=Zt.value.length;return $s(Math.min(uo.end,j),j)});function Mn(){return Cs.buildVirtualHeightSummary({topSpacerHeight:xn.value,bottomSpacerHeight:En.value,width:th()})}function Wi(){const j=Zt.value,oe=Mn();return Dn(Bt({},oe),{probe:{paragraphReady:!!le.value.paragraph,listItemReady:!!le.value.listItem,listWrapperOverhead:le.value.listWrapperOverhead,headingReadyLevels:Object.entries(le.value.headings).filter(([,ye])=>!!ye).map(([ye])=>Number(ye))},nodes:j.map((ye,we)=>{var Ee,He,Je,nt,vt,it,lt,gt,Xe;return{index:we,type:ye.type,estimateKind:(He=(Ee=an.value[we])==null?void 0:Ee.kind)!=null?He:null,rendererKind:(nt=(Je=an.value[we])==null?void 0:Je.rendererKind)!=null?nt:null,estimatedHeight:(it=(vt=an.value[we])==null?void 0:vt.height)!=null?it:null,estimatedContentHeight:(gt=(lt=an.value[we])==null?void 0:lt.contentHeight)!=null?gt:null,measuredHeight:(Xe=rl[we])!=null?Xe:null}})})}function qs(){return i.indexKey!=null?String(i.indexKey):Ye.value?`virtual-${vi()}`:"markdown-renderer"}function Yl(j){const oe=String(j),ye=`${qs()}-`;if(!oe.startsWith(ye))return null;const we=oe.slice(ye.length).match(/^(\d+)(?:$|-)/);if(!we)return null;const Ee=Number(we[1]);return!Number.isInteger(Ee)||Ee<0||Ee>=Zt.value.length?null:Ee}function vi(){var j,oe,ye;const we=(j=i.virtualScroll)==null?void 0:j.sessionKey;return String(we!=null&&we!==""?we:(ye=(oe=i.indexKey)!=null?oe:I.customId)!=null?ye:kt)}function qi(){var j;const oe=(j=i.virtualScroll)==null?void 0:j.threadKey;return oe==null||oe===""?void 0:String(oe)}const eh=D(()=>{var j,oe,ye;return(ye=qi())!=null?ye:String((oe=(j=i.indexKey)!=null?j:I.customId)!=null?oe:kt)});function _w(j){var oe;return(j??"")===((oe=qi())!=null?oe:"")}function Sc(){var j,oe,ye;return oe=(j=i.virtualScroll)==null?void 0:j.measurementKey,ye=(function(){const we=m.value;return(function(Ee){var He,Je;const nt=Ee.renderer,vt=nt==="monaco"?Ee.codeBlockMonacoOptions:void 0,it=Ee.codeBlockProps,lt=nt==="shiki";return[Ee.isDark?"dark":"light",nt==="monaco"?"code-rich":nt==="pre"?"code-pre":"code-shiki",Ee.codeBlockStream===!1?"code-static":"code-stream",Vs(Ee.codeBlockMinWidth),Vs(Ee.codeBlockMaxWidth),...lt?[Gye((He=it?.themes)!=null?He:Ee.themes,(Je=it?.langs)!=null?Je:Ee.langs)]:[],Vs(vt?.fontSize),Vs(vt?.lineHeight),Vs(vt?.fontFamily),Vs(vt?.tabSize),Vs(vt?.MAX_HEIGHT),Vs(vt?.wordWrap),Vs(vt?.wrappingIndent),Vs(vt?.padding),Vs(it?.showHeader),Vs(it?.showCopyButton),Vs(it?.showExpandButton),Vs(it?.showPreviewButton),Vs(it?.showCollapseButton),Vs(it?.showFontSizeButtons)].join("\0")})({renderer:we,isDark:I.isDark,codeBlockStream:I.codeBlockStream,codeBlockMinWidth:I.codeBlockMinWidth,codeBlockMaxWidth:I.codeBlockMaxWidth,codeBlockMonacoOptions:we==="monaco"?I.codeBlockMonacoOptions:void 0,codeBlockProps:I.codeBlockProps,themes:we==="shiki"?I.themes:void 0,langs:we==="shiki"?I.langs:void 0})})(),[oe==null?"":String(oe),ye].join("\0")}function th(){return ht()}const $2=D(()=>zg(th())),Jl=D(()=>[Sc(),$2.value].join("\0")),fY=D(()=>{var j;return Ye.value?["virtual",(j=qi())!=null?j:"",vi(),Jl.value].join("\0"):i.indexKey});function jp(){Cr.value+=1}function Iw(j){return!(!j||!Number.isInteger(j.index)||j.index<0||j.index>=Zt.value.length||j.sessionKey!==vi()||j.threadKey!==qi()||j.layoutEpochKey!==Jl.value)}function X_(j){const oe=String(j),ye=Ss.get(oe);return ye?Iw(ye)?ye.index:null:Yl(oe)}function eI(j="async-node"){(Yn.size||Ss.size)&&(Yn.clear(),Ss.clear(),jp(),to(j))}const Hp=en(MA,null),Mw={reportHeight(j,oe){if(!hn.value)return;const ye=X_(j);if(ye==null)return;const we=$r.get(ye);if(!we)return;const Ee=Number(oe),He=Rn(ye,we);(function(Je,nt,vt={}){Hs(()=>un(Je,nt,vt))})(ye,Number.isFinite(Ee)&&Ee>0?Math.max(Ee,He||0):He)},markPending(j){if(!hn.value)return;const oe=Yl(j);oe!=null&&(function(ye,we){var Ee;const He=Ss.get(ye);if(He&&Iw(He))return Yn.set(ye,Math.max(0,(Ee=Yn.get(ye))!=null?Ee:0)+1),jp(),void to("async-node");Yn.set(ye,1),Ss.set(ye,(function(Je){return{index:Je,sessionKey:vi(),threadKey:qi(),layoutEpochKey:Jl.value}})(we)),jp(),to("async-node")})(String(j),oe)},markSettled(j){if(!hn.value)return;const oe=String(j),ye=X_(j);(ye!=null||(function(we){return Yn.has(String(we))})(oe))&&(function(we){var Ee;const He=(Ee=Yn.get(we))!=null?Ee:0;return!(He<=0||(He<=1?(Yn.delete(we),Ss.delete(we)):Yn.set(we,He-1),jp(),He===1&&to("async-node"),0))})(oe)&&ye!=null&&_c()}};function hY(){let j=0;for(const oe of $r.values())j+=Ve("getVisibleDomHeight.offsetHeight",()=>{var ye;return(ye=oe?.offsetHeight)!=null?ye:0});return Math.ceil(Math.max(0,j))}Gn(MA,{reportHeight(j,oe){Mw.reportHeight(j,oe),Hp?.reportHeight(j,oe)},markPending(j){Mw.markPending(j),Hp?.markPending(j)},markSettled(j){Mw.markSettled(j),Hp?.markSettled(j)}});let Tw,Ew=null,Wp=null;function z2(j){return j!==!1&&j!=null&&j!==""}function tI(){return An.value?(function(){if(!An.value)return!0;const j=Zt.value.length,oe=Xo(uo.start,0,j),ye=Xo(uo.end,oe,j);if(oe>=ye)return!0;for(let we=oe;we=Ac.value}function Lw(){return Ne.value===!0&&!rt.value&&fl.value===0&&zr.size===0&&cl.size===0&&Ws==null&&tI()}function nI(){var j,oe;if(((j=i.virtualScroll)==null?void 0:j.settleMode)!=="manual"||Ew===vi()&&Tw===qi())return!0;const ye=(oe=i.virtualScroll)==null?void 0:oe.settledToken;return!!z2(ye)&&Wp===wg(ye)}function Nw(){return Lw()&&nI()}function pY(j,oe){return oe.totalNodes<=0?j==="final"?"final":"estimate":oe.measuredCount>=oe.totalNodes?j==="final"?"final":"measured":oe.measuredCount>0||oe.estimatedCount>0?"mixed":"estimate"}function nh(j="manual",oe){const ye=Mn(),we=(function(Ee){return Ee||(Ne.value!==!0?Zt.value.length>0?"streaming":"estimating":!tI()||cl.size>0||Ws!=null?"measuring":Nw()?"settled":"settling")})(oe);return{sessionKey:vi(),threadKey:qi(),phase:we,nodeCount:ye.totalNodes,liveRange:{start:uo.start,end:uo.end},renderedCount:Bs.value,measuredCount:ye.measuredCount,estimatedCount:ye.estimatedCount,averageNodeHeight:ye.averageNodeHeight,topSpacerHeight:ye.topSpacerHeight,bottomSpacerHeight:ye.bottomSpacerHeight,visibleDomHeight:hY(),totalHeight:iI(),width:ye.width,final:Ne.value===!0,stable:Nw(),confidence:pY(we,ye),reason:j}}function ag(){const j=Xa.value||ae(),oe=F.value;if(!j||!oe)return null;const ye=j.ownerDocument||oe.ownerDocument||document,we=j===ye.documentElement||j===ye.body||j===ye.scrollingElement,Ee=Ve("getScrollBox.scrollTop",()=>ve(j,ye,we)),He=Ve("getScrollBox.scrollHeight",()=>{var nt,vt,it,lt,gt;return we?Math.max((vt=(nt=ye.documentElement)==null?void 0:nt.scrollHeight)!=null?vt:0,(lt=(it=ye.body)==null?void 0:it.scrollHeight)!=null?lt:0,(gt=j.scrollHeight)!=null?gt:0):j.scrollHeight}),Je=Ve("getScrollBox.clientHeight",()=>{var nt;return we?((nt=ye.documentElement)==null?void 0:nt.clientHeight)||j.clientHeight||0:j.clientHeight});return{root:j,doc:ye,isViewportRoot:we,scrollTop:Ee,scrollHeight:He,clientHeight:Je}}function iI(){const j=Zt.value.length,oe=Math.max(0,$s(0,j)),ye=Ve("getRendererLogicalHeight.offsetHeight",()=>{var Ee,He;return(He=(Ee=F.value)==null?void 0:Ee.offsetHeight)!=null?He:0}),we=Math.max(0,ye>0?ye:Ve("getRendererLogicalHeight.scrollHeight",()=>{var Ee,He;return(He=(Ee=F.value)==null?void 0:Ee.scrollHeight)!=null?He:0}));return j<=0?Math.ceil(ye):An.value?oe>0?Math.max(1,Math.ceil(oe),(function(){let Ee=xn.value+En.value;for(const He of xi.values())He&&(Ee+=Math.max(0,Ve("getVirtualizedDomLogicalHeight.offsetHeight",()=>He.offsetHeight||0)));return Math.ceil(Math.max(0,Ee))})(),(function(Ee,He){return Ee<=0||He<=0?0:He<=Ee+Math.max(512,.05*Ee)?Math.ceil(He):0})(oe,we)):Math.max(1,Math.ceil(we)):hn.value?oe>0||ao.count>0||Cs.getEstimatedNodeHeightCount()>0?(ya.value&&Bs.value,Math.max(1,Math.ceil(we),Math.ceil(oe))):Math.ceil(we):Math.max(1,Math.ceil(we),Math.ceil(oe))}function oI(j){const oe=F.value;if(!oe)return null;const ye=Ve("getRendererBottomDistanceFromViewport.getBoundingClientRect",()=>oe.getBoundingClientRect());return(function(Ee){return Ee.isViewportRoot?Ee.clientHeight:Ve("getViewportBottomInRoot.getBoundingClientRect",()=>Ee.root.getBoundingClientRect().bottom)})(j)-ye.bottom}function mY(j={}){const oe=j.requireViewport!==!1,ye=(function(He=64){const Je=ag(),nt=F.value;if(!Je||!nt)return!1;const vt=(function(lt){if(lt.isViewportRoot)return{top:0,bottom:lt.clientHeight};const gt=Ve("getVirtualViewportRect.getBoundingClientRect",()=>lt.root.getBoundingClientRect());return{top:gt.top,bottom:gt.bottom}})(Je),it=Ve("isRendererNearVirtualViewport.getBoundingClientRect",()=>nt.getBoundingClientRect());return it.bottom>=vt.top-He&&it.top<=vt.bottom+He})();if(oe&&!ye)return null;const we=(function(){const He=ag(),Je=F.value;if(!He||!Je||Math.max(0,He.scrollHeight-He.scrollTop-He.clientHeight)>64)return null;const nt=oI(He);return nt==null?null:nt>=-8&&nt<=160?{type:"bottom",distanceFromBottomPx:Math.max(0,nt)}:null})();if(we)return{anchor:we,captured:!0};const Ee=wr();if(Ee)return{anchor:{type:"node",nodeIndex:Ee.nodeIndex,offsetWithinNodePx:Ee.offsetWithinNodePx},captured:ye};if(j.allowFallback===!0){const He=(function(){const Je=Zt.value.length;return Je<=0?null:{type:"node",nodeIndex:Xo(Ho.value,0,Math.max(0,Je-1)),offsetWithinNodePx:0}})();return He?{anchor:He,captured:!1}:null}return null}function Fw(j){let oe=2166136261;for(let ye=0;ye>>0).toString(36)}function gY(j,oe){let ye=j;for(let we=0;we8192?`${we.slice(0,8192)}...${we.length}`:we;return`${we.length}:${Fw(Ee)}`})(j)}`;if(typeof j=="function")return"fn";if(typeof j!="object")return typeof j;if(oe.has(j))return"cycle";if(ye>=6)return"max-depth";oe.add(j);try{if(Array.isArray(j)){if(j.length<=160){const it=[];for(let lt=0;lt=nt&&Je.push(lt)}return[`a:${j.length}`,`h=${He.join(",")}`,`t=${Je.join(",")}`,`all=${(vt>>>0).toString(36)}`].join(":")}const we=j,Ee=Object.keys(we).filter(He=>{const Je=we[He];return He!=="parent"&&He!=="el"&&He!=="component"&&(Je==null||typeof Je=="string"||typeof Je=="number"||typeof Je=="boolean"||vY.has(He))}).sort();return`o:${Ee.length}:${Ee.map(He=>`${He}=${j2(we[He],oe,ye+1)}`).join(";")}`}finally{oe.delete(j)}}let Dw=-1,Rw="",ih=[2166136261];function ug(j){const oe=Zt.value[j];return oe?Fw(j2(oe)):""}function yY(j,oe){let ye=j;for(let we=0;we>>0}function Ow(){var j,oe;const ye=G.value;if(Dw===ye)return Rw;const we=Zt.value.length;let Ee=$p(we);(Dw!==ye-1||Ee>we||ih.length>>0).toString(36),Dw=ye,Rw}function qp(j,oe={}){var ye;const we=oe.includeHeightCache===!0,Ee=(ye=oe.includeContentHash)!=null?ye:we,He=we?(function(nt){const vt=(function(){var At,Ut;const Dt=Number((Ut=(At=i.virtualScroll)==null?void 0:At.heightCacheLimit)!=null?Ut:5e3);return!Number.isFinite(Dt)||Dt<=0?Number.POSITIVE_INFINITY:Math.max(1,Math.trunc(Dt))})();if(!Number.isFinite(vt)||nt.length<=vt)return nt;const it=new Map,lt=At=>{!At||it.size>=vt||it.set(At.index,At)},gt=Zt.value.length,Xe=Xo(uo.start-2*Ri.value,0,gt),at=Xo(uo.end+2*Ri.value,Xe,gt);for(const At of nt)At.index>=Xe&&At.index=0&&it.sizeAt.index-Ut.index).slice(0,vt)})(eu().map(nt=>{var vt;const it=Zt.value[nt.index];return it?Dn(Bt({},nt),{nodeType:String((vt=it.type)!=null?vt:""),signature:ug(nt.index)}):null}).filter(nt=>!!nt)):[],Je=mY({allowFallback:oe.allowAnchorFallback===!0,requireViewport:oe.requireViewport});return Je||He.length||oe.includeEmptyState===!0?Dn(Bt({sessionKey:j.sessionKey,threadKey:j.threadKey},Je?{anchor:Je.anchor,anchorCaptured:Je.captured}:{anchorCaptured:!1}),{metrics:j,width:j.width,contentHash:Ee?Ow():void 0,measurementKey:Sc()||void 0,heightCache:He.length?He:void 0}):null}function Pw(j){var oe,ye;const we=ag();if(!we)return;const Ee=(function(nt){const vt=F.value;if(!vt)return null;const it=ce(vt,nt.root),lt=Zt.value.length,gt=Ve("getRendererBottomOffsetWithinRoot.offsetHeight",()=>vt.offsetHeight||0),Xe=Math.max(0,gt>0?gt:lt>0?Ve("getRendererBottomOffsetWithinRoot.scrollHeight",()=>vt.scrollHeight||0):0),at=iI();return it+Math.max(Xe,at)})(we);if(Ee==null)return;const He=Math.max(0,j.distanceFromBottomPx),Je=Math.max(0,Ee-we.clientHeight-He);(function(nt){br=pg()+120,Io=nt})(Je),we.isViewportRoot?(ye=(oe=we.doc.defaultView)==null?void 0:oe.scrollTo)==null||ye.call(oe,0,Je):wF(we.root,we.doc,Je,{isReverseFlexScrollRoot:Ce,getNormalizedScrollTop:ve})}const Bw=[];function sI(){if(U)for(Pr!=null&&(Xi?.(Pr),Pr=null);Bw.length;){const j=Bw.pop();j!=null&&window.clearTimeout(j)}}function Up(j){const oe=!!jo.value;jo.value=null,br=0,Io=null,sI(),oe&&j&&to(j)}function Vp(){if(!jo.value||!U||Pr!=null)return;const j=()=>{Pr=null;const oe=jo.value;oe&&Pw(oe)};Pr=Go?Go(j):null,Pr==null&&j()}function rI(j,oe={}){const ye=Zt.value.length;return ye<=0?[]:j.filter(we=>!(!Number.isInteger(we.index)||we.index<0||we.index>=ye)&&!(!Number.isFinite(we.height)||we.height<=0)&&!(oe.requireSignature&&!we.signature)&&!(oe.requireCompatibilityMetadata&&!we.nodeType&&!we.signature)&&(function(Ee){var He;const Je=Zt.value[Ee.index];return!(!Je||Ee.nodeType&&Ee.nodeType!==String((He=Je.type)!=null?He:"")||Ee.signature&&Ee.signature!==ug(Ee.index))})(we))}function lI(j){const oe=zg(th()),ye=zg(j);return oe!==-1&&ye!==-1&&oe===ye}function $w(j){var oe;const ye=Number(j?.width);if(Number.isFinite(ye)&&ye>0)return ye;const we=Number((oe=j?.metrics)==null?void 0:oe.width);return Number.isFinite(we)&&we>0?we:null}function aI(j){var oe;return j.sessionKey===vi()&&!!_w(j.threadKey)&&((oe=j.measurementKey)!=null?oe:"")===Sc()&&!!lI($w(j))&&!!(function(ye){const we=ye.heightCache;return!!we?.length&&(uI(ye)?we.some(Ee=>!!(Ee.nodeType||Ee.signature)):we.some(Ee=>!!Ee.signature))})(j)}function uI(j){return!!(j.contentHash&&j.contentHash===Ow())}function kY(j){return!uI(j)}let oh=null,sh=null,H2=null,cg=null,dg=null;function zw(j){var oe;const ye=j.map(Ee=>{var He,Je;return[Ee.index,Math.round(10*Ee.height),(He=Ee.nodeType)!=null?He:"",(Je=Ee.signature)!=null?Je:""].join("")}).join(""),we=zg(th());return[(oe=qi())!=null?oe:"",vi(),Sc(),Zt.value.length,we,j.length,Fw(ye)].join(":")}function cI(j=(oe=>(oe=i.virtualScroll)==null?void 0:oe.heightCache)()){if(!hn.value||!j?.length||Zt.value.length<=0||!lI((oe=i.virtualScroll)==null?void 0:oe.heightCacheWidth))return!1;var oe;const ye=rI(j,{requireSignature:!0});if(!ye.length)return!1;const we=zw(ye);return we===oh?(sh="standalone",!0):(In(ye,{mode:"merge"}),ui(),oh=we,sh="standalone",gg(),to("restore"),!0)}function jw(j,oe={}){var ye,we,Ee;if(!hn.value||!j||j.sessionKey!==vi()||!_w(j.threadKey)||Zt.value.length<=0)return!1;const He=!!((ye=j.heightCache)!=null&&ye.length)&&!W2(),Je=!j.anchor||j.anchorCaptured===!1&&oe.allowUncapturedAnchor!==!0?null:j.anchor,nt=oe.restoreAnchor===!0&&!!Je&&!W2()&&Number($w(j))>0;let vt=!1;if((we=j.heightCache)!=null&&we.length&&aI(j)){const lt=rI(j.heightCache,{requireCompatibilityMetadata:!j.contentHash,requireSignature:kY(j)});lt.length&&(In(lt,{mode:"merge"}),ui(),oh=zw(lt),sh="restore",gg(),vt=!0)}if(He||nt)return!1;if(!oe.restoreAnchor||!Je)return vt&&to("restore"),!0;const it=(function(lt,gt){var Xe;const at=lt.anchor,It=at?at.type==="bottom"?`bottom:${Math.round(at.distanceFromBottomPx)}`:`node:${at.nodeIndex}:${Math.round(at.offsetWithinNodePx)}`:"none";return[(Xe=qi())!=null?Xe:"",vi(),Sc(),$2.value,gt,It].join(":")})(j,(Ee=oe.restoreToken)!=null?Ee:"imperative");return H2===it?(vt&&to("restore"),!0):(H2=it,(function(lt){const gt=()=>{if(lt.type==="node")return Up(),void wa({nodeIndex:lt.nodeIndex,offsetWithinNodePx:lt.offsetWithinNodePx});if(ql(),lo.value=null,jo.value=lt,sI(),Pw(lt),U)for(const Xe of[0,120,280,480])Bw.push(window.setTimeout(()=>{const at=jo.value;at&&Pw(at)},Xe))};(function(Xe){if(!An.value)return!1;const at=Zt.value.length;return!(at<=0||(Ho.value=Xe.type==="node"?Xo(Xe.nodeIndex,0,at-1):at-1,tu(),0))})(lt)?ft(gt):gt()})(Je),to("restore"),!0)}function W2(){const j=th();return Number.isFinite(j)&&j>0}function dI(j){var oe;return j.sessionKey===vi()&&!!_w(j.threadKey)&&(Zt.value.length<=0||!(!((oe=j.heightCache)!=null&&oe.length)||W2())||!(!(j.anchor&&Number($w(j))>0)||W2()))}function Hw(){_o.clear();for(const j of Object.keys(rl)){const oe=Number(j);Number.isInteger(oe)&&oe>=0&&oe{let oe=!1,ye=null;const we=()=>{oe||(oe=!0,ye!=null&&window.clearTimeout(ye),j())};if(Go)return Go(we),void(ye=window.setTimeout(we,50));ye=window.setTimeout(we,0)})}function Ww(j,oe=qi(),ye=Jl.value){return vi()===j&&qi()===oe&&Jl.value===ye}function qw(){return io(this,arguments,function*(j={}){var oe,ye,we,Ee,He;const Je=vi(),nt=qi(),vt=Jl.value,it=(oe=j.frames)!=null?oe:2,lt=(ye=j.timeoutMs)!=null?ye:120,gt=(we=j.reason)!=null?we:"manual",Xe=j.expectedSettledTokenKey,at=j.flushPendingTimers===!0,It=nh(gt),At=()=>Dn(Bt({},It),{phase:It.final?"settling":It.phase,stable:!1,confidence:It.confidence==="final"?"mixed":It.confidence,reason:gt}),Ut=()=>Ww(Je,nt,vt)&&(Xe==null||mg()===Xe);for(let wn=0;wnwindow.setTimeout(yn,wn))})(lt),!Ut()||(at&&yt(),_c(),fg(),!Ut()))return At();const Dt=Lw();Dt&&(Ew=Je,Tw=nt,((Ee=i.virtualScroll)==null?void 0:Ee.settleMode)==="manual"&&Xe!=null&&z2((He=i.virtualScroll)==null?void 0:He.settledToken)&&mg()===Xe&&(Wp=wg(i.virtualScroll.settledToken)));const rn=Ut()&&Dt&&nI(),cn=nh(gt,rn?"final":void 0);return Gw(cn,!0),cn})}let Uw="content",rh=null,lh=null,Vw=0,hg=null,Kp=null,Kw=null,Zw=null;function pg(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}function hI(j){var oe,ye;const we=hg;if(!we)return!0;const Ee=(ye=(oe=i.virtualScroll)==null?void 0:oe.heightDiffThresholdPx)!=null?ye:1;return Math.abs(j.totalHeight-we.totalHeight)>Ee||j.sessionKey!==we.sessionKey||j.phase!==we.phase||j.stable!==we.stable||j.final!==we.final||j.threadKey!==we.threadKey||j.nodeCount!==we.nodeCount||j.measuredCount!==we.measuredCount||j.width!==we.width}function mg(j=(oe=>(oe=i.virtualScroll)==null?void 0:oe.settledToken)()){return Vs(j)}function pI(j,oe){var ye,we;return[j,oe.sessionKey,(ye=oe.threadKey)!=null?ye:"",Sc(),Ow(),Vs((we=i.virtualScroll)==null?void 0:we.settledToken),Math.round(oe.totalHeight),Math.round(oe.width)].join("\0")}function gg(){Kw=null,Zw=null,Kp=null}function bY(j){const oe=j.heightCache;return oe?.length?zw(oe):""}function vg(j){var oe,ye,we;const Ee=j.metrics,He=j.anchor?(Je=j.anchor).type==="bottom"?`bottom:${Math.round(Je.distanceFromBottomPx)}`:`node:${Je.nodeIndex}:${Math.round(Je.offsetWithinNodePx)}`:"none";var Je;return[j.sessionKey,(oe=j.threadKey)!=null?oe:"",(ye=j.measurementKey)!=null?ye:Sc(),(we=j.contentHash)!=null?we:"",bY(j),He,j.anchorCaptured?1:0,Ee.liveRange.start,Ee.liveRange.end,Ee.renderedCount,Ee.nodeCount,Math.round(Ee.totalHeight),Math.round(Ee.width),Ee.phase,Ee.stable?1:0].join("\0")}function Gw(j,oe=!1){if(!hn.value||(function(Je=!1){return!Je&&Ye.value&&!So.value})(oe))return;const ye=oe||hI(j),we=(function(Je,nt=!1){return nt||Je.stable||Je.phase==="final"?{state:qp(Je,{includeHeightCache:!0})}:{state:qp(Je)}})(j,oe),Ee=we.state,He=!!(Ee&&(ye||(function(Je,nt=!1){return!!nt||vg(Je)!==Kp})(Ee,oe)));if(ye&&(O(j),hg=j,Vw=pg()),Ee&&He&&(H(Ee),Ee.anchor&&R(Ee.anchor),Kp=vg(Ee)),j.stable){const Je=pI("settled",j);if(Je!==Kw){Kw=Je;const nt=qp(j,{includeHeightCache:!0});nt&&(H(nt),Kp=vg(nt)),(function(vt){o("render-settled",vt)})(j)}}if(j.phase==="final"){const Je=pI("final",j);if(Je!==Zw){Zw=Je;const nt=qp(j,{includeHeightCache:!0});nt&&(H(nt),Kp=vg(nt)),(function(vt){o("render-final",vt)})(j)}}}function Qw(){rh!=null&&(Xi?.(rh),rh=null),lh!=null&&U&&(window.clearTimeout(lh),lh=null)}function mI(){rh=null,lh=null,(function(j){if(cl.size>0||Ws!=null)return!0;switch(j){case"node-resize":case"async-node":case"resize":case"restore":case"final":case"manual":return!0;default:return!1}})(Uw)&&(_c(),fg()),Gw(nh(Uw))}function to(j){var oe,ye;if(!hn.value||(Uw=j,rh!=null||lh!=null))return;const we=Math.max(0,(ye=(oe=i.virtualScroll)==null?void 0:oe.emitIntervalMs)!=null?ye:32),Ee=Math.max(0,we-(pg()-Vw)),He=()=>{lh=null,rh=Go?Go(mI):null,rh==null&&mI()};U&&Ee>0?lh=window.setTimeout(He,Ee):He()}function gI(){bc.value+=1}function q2(j){if(ya.value&&j>=Bs.value){const oe=Zt.value[j],ye=Ae.value===!0&&Ne.value!==!0&&j>=Zt.value.length-2,we=oe?.type==="code_block"||oe?.type==="image"||oe?.type==="mermaid"||oe?.type==="infographic";if(!ye||we)return!1}return!oi.value||j=he.value&&(K.value||(K.value=!0,rg()),!al.value||!gr))return Zp(j),void(oe&&Du(j,!0));if(j{if(Pp.delete(He),!oi.value||Jo.value.has(He))return;const vt=xi.get(He);if(!vt)return;const it=ae(vt),lt=vt.ownerDocument||document,gt=lt.defaultView||window,Xe=!it||it===lt.documentElement||it===lt.body,at=!Xe&&it?Ve("nodeVisibilityFallback.root.getBoundingClientRect",()=>it.getBoundingClientRect()):null,It=Xe?0:at.top,At=Xe?Ve("nodeVisibilityFallback.clientHeight",()=>{var Dt,rn;return(rn=(Dt=gt.innerHeight)!=null?Dt:it?.clientHeight)!=null?rn:0}):at.bottom,Ut=Ve("nodeVisibilityFallback.node.getBoundingClientRect",()=>vt.getBoundingClientRect());Ut.bottom>=It-500&&Ut.top<=At+500&&Du(He,!0)},1800+Je);Pp.set(He,nt)})(j);let Ee=null;Ee=ze(()=>we.isVisible.value,He=>{if(He){Bp(j),Du(j,!0),Ee?.(),Ql.delete(j),hl.get(j)===we&&hl.delete(j);try{we.destroy()}catch{}}},{immediate:!0}),Ql.set(j,Ee),An.value&&ti()}function Yw(){Ws=null,Hs(()=>{let j=!1;for(const[oe,ye]of cl)cl.delete(oe),$r.get(oe)===ye.el&&Aa.get(oe)===ye.version&&(j=un(oe,ye.height,{allowShrink:ye.allowShrink})||j);return j})}function Gp(){Ws!=null&&(Xi?.(Ws),Ws=null),cl.clear()}function V2(j,oe){(function(ye,we,Ee){var He;if(!Number.isFinite(Ee)||Ee<=0||$r.get(ye)!==we)return;const Je=Aa.get(ye);if(Je==null)return;const nt=Zt.value[ye],vt=rt.value&&Ne.value!==!0&&!((He=i.nodes)!=null&&He.length)&&ye>=Zt.value.length-2,it=!(nt?.loading===!0||vt),lt=cl.get(ye),gt=lt?lt.allowShrink&&it:it,Xe=lt&&!gt?Math.max(lt.height,Ee):Ee;cl.set(ye,{height:Xe,allowShrink:gt,version:Je,el:we}),Ws==null&&(Ws=Go?Go(Yw):null,Ws==null&&Yw())})(j,oe,Rn(j,oe))}function _c(){for(const[j,oe]of $r)oe&&V2(j,oe)}function vI(){zo?.disconnect(),zo=null,Rr.clear()}function Jw(){for(;Nu.length;)$e(Nu.pop())}ze(So,j=>{j&&to("content")},{flush:"post"}),t({getVirtualMetrics:nh,captureVirtualState:function(j={}){var oe;return qp(nh("manual"),{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:j.allowFallbackAnchor===!0,requireViewport:j.requireViewport===!0,includeEmptyState:(oe=j.includeEmptyState)==null||oe})},restoreVirtualState:function(j,oe={}){const ye=oe.restoreAnchor===!0,we=oe.restoreToken==null?"imperative":String(oe.restoreToken);cg=j,dg={restoreAnchor:ye,restoreToken:we,allowUncapturedAnchor:oe.allowUncapturedAnchor===!0},!jw(j,{restoreAnchor:ye,restoreToken:we,allowUncapturedAnchor:oe.allowUncapturedAnchor===!0})&&dI(j)||(cg=null,dg=null)},forceMeasure:function(j="manual"){return io(this,null,function*(){yield ft(),yield fI(),_c(),fg(),yield ft();const oe=nh(j);return Gw(oe,!0),oe})},settle:qw,scrollToNode:function(j,oe="start"){Up(),ql();const ye=Zt.value.length;if(ye<=0)return;const we=Xo(j,0,ye-1),Ee=()=>{var He;const Je=md({nodeIndex:we,offsetWithinNodePx:0}),nt=Br(we),vt=ag(),it=(He=vt?.clientHeight)!=null?He:0,lt=Lu();let gt=Je;if(oe==="center")gt=Je-it/2+nt/2;else if(oe==="end")gt=Je-it+nt;else if(oe==="nearest"&<!=null){if(Je>=lt&&Je+nt<=lt+it)return;gt=JeGa.value,j=>{if(!j){vI();for(const oe of Gl.values())for(const ye of oe)$e(ye);Gl.clear(),Aa.clear(),Jw(),Gp()}},{immediate:!0}),ze(Ne,j=>{j&&(function(){if(U&&Ne.value&&$r.size){Jw();for(const oe of[80,240,640]){const ye=Ie(oe,()=>{for(const[we,Ee]of $r)Ee&&V2(we,Ee)},"final");ye!=null&&Nu.push(ye)}}})(),to(j?"final":"content")});const wY=CF(()=>to("content"),16),CY=CF(()=>to("batch"),16);ze([()=>Zt.value.length,()=>Bs.value],()=>{jo.value&&Vp(),wY()},{flush:"post",immediate:!0}),ze([()=>uo.start,()=>uo.end],()=>{CY()},{flush:"post"});const{cleanupBatchScheduler:AY}=(function(j){const{props:oe,isClient:ye,isTestEnv:we,parsedNodesIdentity:Ee,parsedNodeCount:He,desiredRenderedCount:Je,datasetKey:nt,batchingEnabled:vt,incrementalRenderingActive:it,resolvedBatchSize:lt,resolvedInitialBatch:gt,renderedCount:Xe,adaptiveBatchSize:at,previousRenderContext:It,previousBatchConfig:At,requestFrame:Ut,cancelFrame:Dt,hasIdleCallback:rn,cleanupNodeVisibility:cn,onDatasetKeyChanged:wn,onDatasetChanged:yn}=j;let Cn=null,Wn="raf",Jn=null,Oi=0,er=!1,Us=!1;const nu=new Set,Ru=new Set;function _g(){if(ye){Cn!=null&&(Wn==="raf"&&Dt?Dt(Cn):Wn==="idle"&&typeof window.cancelIdleCallback=="function"?window.cancelIdleCallback(Cn):Wn==="timeout"&&window.clearTimeout(Cn),Cn=null),Oi+=1;for(const Ar of nu)Dt&&Dt(Ar);for(const Ar of Ru)window.clearTimeout(Ar);nu.clear(),Ru.clear(),Jn=null,er=!1,Us=!1}}function ty(){return typeof performance<"u"?performance.now():Date.now()}function RI(Ar){(function(Ic){var xd;if(!it.value)return;const Mc=Math.max(2,(xd=oe.renderBatchBudgetMs)!=null?xd:6),Tc=Math.max(1,lt.value||1),iu=Math.max(1,Math.floor(Tc/4));Ic>1.5*Mc?at.value=Math.max(iu,Math.floor(.8*at.value)):Ic<.6*Mc&&at.value=Mc)return;const Tc=Math.max(1,Ar),iu=()=>{const Jp=ty();Cn=null;const Ig=Jn??Tc;Jn=null;const Xp=ty();Xe.value=Math.min(Mc,Xe.value+Ig),cn(Xe.value),(function(s3,ny){if(!ye)return void RI(ny);er=!0;const $I=++Oi;ft().then(()=>{var zI;if($I!==Oi)return;const qY=ty(),UY=Math.max(ny,qY-s3),jI=()=>{$I===Oi&&RI(UY)};if(Ut){let uh=null,e1=null,WI=!1;const qI=()=>{WI||(WI=!0,uh!==null&&(nu.delete(uh),uh=null),e1!==null&&(Ru.delete(e1),window.clearTimeout(e1),e1=null),jI())};return uh=Ut(()=>{qI()}),nu.add(uh),e1=window.setTimeout(()=>{uh!==null&&Dt&&Dt(uh),qI()},Math.max(32,(zI=oe.renderBatchIdleTimeoutMs)!=null?zI:120)),void Ru.add(e1)}const HI=window.setTimeout(()=>{Ru.delete(HI),jI()},0);Ru.add(HI)})})(Jp,ty()-Xp)};if(!ye||ml.immediate)return void iu();const Sd=Math.max(0,(Ic=oe.renderBatchDelay)!=null?Ic:16);if(Jn=Jn!=null?Math.max(Jn,Tc):Tc,Cn==null){if(!we&&rn&&window.requestIdleCallback){const Jp=Math.max(0,(xd=oe.renderBatchIdleTimeoutMs)!=null?xd:120);return Wn="idle",void(Cn=window.requestIdleCallback(()=>iu(),{timeout:Jp}))}if(Ut&&!we)return Wn="raf",void(Cn=Ut(()=>{Sd===0?iu():(Wn="timeout",Cn=window.setTimeout(()=>iu(),Sd))}));Wn="timeout",Cn=window.setTimeout(()=>iu(),Sd)}}function PI(Ar,ml={}){er?Us=!0:Ar==null?BI():OI(Ar,ml)}function BI(){it.value&&OI(vt.value?Math.max(1,Math.round(at.value)):Math.max(1,lt.value))}return ze([Ee,He,nt,it,lt,gt,()=>oe.renderBatchDelay],()=>{var Ar;const ml=He.value,Ic=It.value,xd=nt.value,Mc=!Object.is(xd,Ic.key),Tc=ml!==Ic.total,iu=Mc||Tc;It.value={key:xd,total:ml};const Sd=At.value,Jp=(Ar=oe.renderBatchDelay)!=null?Ar:16,Ig=Sd.batchSize!==lt.value||Sd.initial!==gt.value||Sd.delay!==Jp||Sd.enabled!==it.value;At.value={batchSize:lt.value,initial:gt.value,delay:Jp,enabled:it.value},Mc&&wn(ml),(iu||Ig||!it.value)&&_g(),(iu||Ig)&&(at.value=Math.max(1,lt.value||1)),iu&&yn();const Xp=Je.value;if(!ml)return Xe.value=0,void cn(0);if(!it.value)return Xe.value=Xp,void cn(Xe.value);const s3=Mc||Ic.total===0;Xe.value=s3||Ig?Math.min(Xp,gt.value):Math.min(Xe.value,Xp);const ny=Math.max(1,gt.value||lt.value||ml);Xe.value{it.value&&(typeof ml=="number"&&Ar<=ml||Ar>Xe.value&&PI())}),{cleanupBatchScheduler:_g}})({props:I,isClient:U,isTestEnv:yr,parsedNodesIdentity:Fr,parsedNodeCount:Oo,desiredRenderedCount:Ac,datasetKey:fY,batchingEnabled:Eu,incrementalRenderingActive:ya,resolvedBatchSize:jl,resolvedInitialBatch:ol,renderedCount:Bs,adaptiveBatchSize:ks,previousRenderContext:Bo,previousBatchConfig:Hl,requestFrame:Go,cancelFrame:Xi,hasIdleCallback:vr,cleanupNodeVisibility:D2,onDatasetKeyChanged:j=>{Gp(),Re(),ui(),gg(),j>0&&ll(j)},onDatasetChanged:()=>{An.value&&ti({immediate:!0})}});ze([ul,An,()=>F.value,()=>Y()],([j,oe])=>{if(!j)return R2(),void Vn();O2(),oe?ti({immediate:!0}):Vn()},{flush:"post",immediate:!0}),ze([()=>Zt.value.length,()=>An.value],j=>io(null,[j],function*([oe,ye]){ye&&oe&&U&&(yield ft(),ti({immediate:!0}))}),{flush:"post"}),ze(ei,j=>{j&&(function(){var oe;if(pr.value&&Zo.value&&Po.value&&((oe=fo.value)!=null&&oe[1]))return;const ye=Lt({type:"paragraph",children:[{type:"text",content:"Probe paragraph text",raw:"Probe paragraph text"}],raw:"Probe paragraph text"}),we=Lt({type:"list_item",children:[ye],raw:"- Probe paragraph text"}),Ee=Lt({type:"list",ordered:!1,items:[we],raw:"- Probe paragraph text"});pr.value=ye,Zo.value=we,Po.value=Ee;const He={1:null,2:null,3:null,4:null,5:null,6:null};for(let Je=1;Je<=6;Je++)He[Je]=Lt({type:"heading",level:Je,text:"Probe heading",children:[{type:"text",content:"Probe heading",raw:"Probe heading"}],raw:`${"#".repeat(Je)} Probe heading`});fo.value=He})()},{immediate:!0}),ze([()=>F.value,ei],()=>{if(!ei.value)return lg(),void(te.value=0);B2(),lg(),ei.value&&F.value&&typeof ResizeObserver<"u"&&(Cd=new ResizeObserver(()=>{B2(),lo.value&&ba(),jo.value&&Vp(),to("resize")}),Cd.observe(F.value))},{immediate:!0}),ze([ei,$t,Jl],()=>io(null,null,function*(){if(!ei.value)return le.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void ui();yield ft(),(function(){if(!ei.value||typeof window>"u")return le.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void ui();const j={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},oe=P2(bd(P.value),".paragraph-node");j.paragraph=T8(P.value,oe,"pre-wrap");const ye=bd(z.value),we=ye?.querySelector(".paragraph-node");j.listItem=T8(z.value,we,"pre-wrap");const Ee=Ve("readSimpleTextProbeProfile.list.offsetHeight",()=>{var Je,nt;return(nt=(Je=W.value)==null?void 0:Je.offsetHeight)!=null?nt:0}),He=Ve("readSimpleTextProbeProfile.listItem.offsetHeight",()=>{var Je,nt;return(nt=(Je=z.value)==null?void 0:Je.offsetHeight)!=null?nt:0});j.listWrapperOverhead=Math.max(0,Ee-He);for(let Je=1;Je<=6;Je++){const nt=P2(bd($[Je]),`h${Je}`);j.headings[Je]=T8($[Je],nt,"pre-wrap")}le.value=j,ui()})()}),{flush:"post",immediate:!0}),ze(()=>Zt.value.length,()=>{An.value&&ti({immediate:!0})}),ze([ei,te],()=>{ui(),An.value&&ti({immediate:!0}),lo.value&&ba(),jo.value&&Vp(),to("resize")},{immediate:!1}),ze(()=>oi.value,j=>{if(j)for(const[oe,ye]of xi)U2(oe,ye);else if(rg(),An.value)ti({immediate:!0});else for(const[oe,ye]of xi)ye&&Du(oe,!0)},{immediate:!1}),ze([se,he,()=>Y()],()=>{var j;(j=gr.refresh)==null||j.call(gr);for(const[oe,ye]of xi)U2(oe,ye)},{immediate:!1}),ze([()=>I.viewportPriority,()=>Zt.value.length,he],([j,oe,ye])=>{if(j!==!1){if(K.value&&(oe<=200||oe<=ye)){K.value=!1;for(const[we,Ee]of xi)U2(we,Ee)}}else K.value=!1}),ze(()=>Bs.value,()=>{An.value&&ti({immediate:!0})}),ze([Ho,Un,Ri,()=>Zt.value.length,An],()=>{tu()},{immediate:!0});let yg=null,kg=!1,Qp=null;function bg(){yg=null,Ew=null,Tw=void 0,Wp=null,gg()}function Xw(){Gp(),Re(),ui(),_o.clear();const j=Zt.value.length;j>0&&ll(j),Hw()}function e3(){Qw(),yt(),hg=null,oh=null,sh=null,H2=null,cg=null,dg=null,kg=!1,bg(),eI("restore"),ql(),Up()}function wg(j){var oe;return[(oe=qi())!=null?oe:"",vi(),Sc(),$2.value,mg(j),Zt.value.length,Math.round($s(0,Zt.value.length)),Math.round(th()),ao.count,Math.round(ao.total)].join(":")}function yI(){return io(this,null,function*(){var j,oe,ye,we;const Ee=(j=i.virtualScroll)==null?void 0:j.settledToken,He=mg(Ee),Je=vi(),nt=qi(),vt=Jl.value;if(hn.value&&((oe=i.virtualScroll)==null?void 0:oe.settleMode)==="manual"&&z2(Ee))if(Lw()){if(wg(Ee)!==Wp&&!kg){kg=!0;try{const it=yield qw({reason:"manual",expectedSettledTokenKey:He}),lt=mg()===He;Ww(Je,nt,vt)&&it.sessionKey===Je&&it.threadKey===nt&<&&it.stable&&it.phase==="final"&&(Wp=wg((ye=i.virtualScroll)==null?void 0:ye.settledToken))}finally{kg=!1,yield ft();const it=(we=i.virtualScroll)==null?void 0:we.settledToken,lt=z2(it)?wg(it):"";Ww(Je,nt,vt)&<&&Wp!==lt&&yI()}}}else to("manual")})}ze(hn,(j,oe)=>{if(j!==oe){if(!j)return e3(),void Qw();e3(),Xw(),Qp=Jl.value,to("content")}},{flush:"post"}),ze([hn,Jl],([j,oe])=>{j?Qp!=null?Qp!==oe&&(Qp=oe,(function(ye="resize"){Gp(),Re(),ui(),_o.clear();const we=Zt.value.length;we>0&&ll(we),Hw(),oh=null,sh=null,H2=null,hg=null,kg=!1,bg(),cI(),ft(()=>{_c(),lo.value&&ba(),jo.value&&Vp(),to(ye)})})("resize")):Qp=oe:Qp=null},{flush:"post",immediate:!0}),ze([hn,()=>vi(),()=>qi()],([j])=>{j&&(e3(),Xw(),eI("content"),to("content"))}),ze([hn,()=>vi(),()=>qi(),Jl,()=>Zt.value.length],([j])=>{j&&(function(oe="async-node"){let ye=!1;for(const[we,Ee]of Array.from(Ss.entries()))Iw(Ee)||(Ss.delete(we),Yn.delete(we),ye=!0);ye&&(jp(),to(oe))})("async-node")},{flush:"post"}),ze([hn,()=>{var j;return(j=i.virtualScroll)==null?void 0:j.sessionKey},()=>{var j;return(j=i.virtualScroll)==null?void 0:j.measurementKey},()=>i.indexKey,()=>G.value],([j])=>{j&&(gg(),(function(oe="content"){if(!hn.value)return;const ye=[],we=Zt.value.length,Ee=$p(we);for(const He of Array.from(_o.keys())){if(He>=we){ye.push(He);continue}if(He=we&&_o.delete(He);ye.length&&((function(He,Je={}){const nt=Array.from(He,Number);js(nt);let vt=0;if(Hs(()=>(vt=Ca(nt,Je),vt>0)),vt>0)(function(it){for(const lt of it)_o.delete(lt)})(nt);else for(const it of nt)Xs.delete(it)})(ye,{notify:!1}),ui(),bg(),lo.value&&ba(),jo.value&&Vp(),to(oe))})("content"))},{flush:"post",immediate:!0}),ze([hn,()=>Zt.value.length,()=>vi(),()=>qi()],([j,oe,ye,we],[Ee,He,Je,nt])=>{j&&Ee&&ye===Je&&we===nt&&oe!==He&&bg()},{flush:"post"}),ze([hn,()=>{var j;return(j=i.virtualScroll)==null?void 0:j.heightCache},()=>{var j;return(j=i.virtualScroll)==null?void 0:j.heightCacheWidth},()=>{var j;return(j=i.virtualScroll)==null?void 0:j.restoreState},()=>{var j;return(j=i.virtualScroll)==null?void 0:j.measurementKey},()=>Zt.value.length,()=>vi(),te],()=>{cI()},{flush:"post",immediate:!0}),ze([hn,()=>{var j;return(j=i.virtualScroll)==null?void 0:j.restoreState},()=>{var j;return(j=i.virtualScroll)==null?void 0:j.restoreAnchor},()=>{var j;return(j=i.virtualScroll)==null?void 0:j.measurementKey},()=>Zt.value.length,()=>vi(),te],j=>io(null,[j],function*([oe,ye]){if(!oe||!ye)return;yield ft();const we=(function(){var Ee;const He=(Ee=i.virtualScroll)==null?void 0:Ee.restoreAnchor;return He==null||He===!1?null:He===!0?"true":String(He)})();jw(ye,{restoreAnchor:we!=null,restoreToken:we??void 0})}),{flush:"post",immediate:!0}),ze([hn,te,()=>{var j;return(j=i.virtualScroll)==null?void 0:j.restoreState},()=>{var j;return(j=i.virtualScroll)==null?void 0:j.measurementKey}],([j])=>{var oe;if(!j)return;const ye=(oe=i.virtualScroll)==null?void 0:oe.restoreState;ye&&oh&&sh==="restore"&&(aI(ye)||(Xw(),oh=null,sh=null,to("resize")))},{flush:"post"}),ze([hn,()=>Zt.value.length,()=>vi(),te],j=>io(null,[j],function*([oe]){var ye;const we=cg,Ee=dg;oe&&we&&(yield ft(),!jw(we,{restoreAnchor:Ee?.restoreAnchor===!0,restoreToken:(ye=Ee?.restoreToken)!=null?ye:"imperative",allowUncapturedAnchor:Ee?.allowUncapturedAnchor===!0})&&dI(we)||(cg=null,dg=null))}),{flush:"post",immediate:!0}),ze([hn,Ne,()=>{var j;return(j=i.virtualScroll)==null?void 0:j.settleMode},()=>vi(),()=>qi(),Jl,fl,dl,()=>Bs.value,Ac,()=>ao.count,()=>ao.total],([j,oe,ye])=>{if(!j||oe!==!0||ye==="manual"||!Nw())return;const we=(function(){var Ee;const He=Zt.value.length;return[(Ee=qi())!=null?Ee:"",vi(),Sc(),$2.value,He,Math.round($s(0,He)),Math.round(th()),ao.count,Math.round(ao.total)].join(":")})();yg!==we&&(yg=we,qw({reason:"final"}).then(Ee=>{Ee.stable||yg!==we||(yg=null)}))},{flush:"post",immediate:!0}),ze([hn,Ne,()=>{var j;return(j=i.virtualScroll)==null?void 0:j.settleMode},()=>{var j;return(j=i.virtualScroll)==null?void 0:j.settledToken},()=>vi(),()=>qi(),Jl,fl,dl,()=>Bs.value,Ac,()=>Zt.value.length,()=>ao.count,()=>ao.total],()=>{yI()},{flush:"post",immediate:!0}),ze([()=>Zt.value.length,An,Un,Ri,()=>uo.start,()=>uo.end],([j,oe,ye,we,Ee,He])=>{ue.value&&Ke("virtualization",{nodes:j,virtualization:oe,maxLiveNodes:ye,buffer:we,focusIndex:Ho.value,scroll:oe?(()=>{const Je=Xa.value||ae();return Je?{reverse:Ce(Je),scrollTop:Math.round(Je.scrollTop),scrollTopAbs:Math.round(Math.abs(Je.scrollTop)),scrollHeight:Math.round(Je.scrollHeight),clientHeight:Math.round(Je.clientHeight)}:null})():null,liveRange:{start:Ee,end:He},rendered:Bs.value})}),ze([()=>I.customId],([j],oe,ye)=>{if(!j||Ps)return;const we=(function(Ee,He){return Ee?(_s.controllers[Ee]=He,()=>{_s.controllers[Ee]===He&&delete _s.controllers[Ee]}):()=>{}})(j,{captureRestoreAnchor:wr,restoreAnchor:wa,getAnchorDrift:As,getReport:Wi});ye(()=>{we()})},{immediate:!0}),ii(()=>{(function(){if(hn.value)try{_c(),fg();const j=nh("manual");hI(j)&&(O(j),hg=j,Vw=pg());const oe=qp(j,{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:!1,requireViewport:!0,includeEmptyState:!0});oe&&(H(oe),oe.anchor&&R(oe.anchor),Kp=vg(oe))}catch{}})(),AY(),rg(),be(),vI();for(const j of Gl.values())for(const oe of j)$e(oe);Gl.clear(),Aa.clear(),_o.clear(),Jw(),Gp(),lg(),ql(),Up(),Qw(),R2(),Vn()});const xY=d0("ViewportDeferredMermaidBlockNode",Xu({loader:()=>io(null,null,function*(){try{return(yield qo(()=>import("./index11-oTpPg1Iy.js"),__vite__mapDeps([7,5]))).default}catch(j){return console.warn('[markstream-vue] Optional peer dependencies for MermaidBlockNode are missing. Falling back to preformatted code rendering. To enable Mermaid rendering, please install "mermaid".',j),bl}}),loadingComponent:OF,delay:0}),OF),SY=d0("ViewportDeferredInfographicBlockNode",Xu({loader:()=>io(null,null,function*(){try{return(yield qo(()=>import("./index10-DPt9V4bc.js"),[])).default}catch(j){return console.warn('[markstream-vue] Failed to load InfographicBlockNode. Falling back to preformatted code rendering. To enable Infographic rendering, install "@antv/infographic" and configure setInfographicLoader with a dynamic loader.',j),bl}}),loadingComponent:RF,delay:0}),RF),_Y=d0("ViewportDeferredD2BlockNode",Xu(()=>io(null,null,function*(){try{return(yield qo(()=>import("./index8-MiLy1Wbt.js"),[])).default}catch(j){return console.warn('[markstream-vue] Optional peer dependencies for D2BlockNode are missing. Falling back to preformatted code rendering. To enable D2 rendering, please install "@terrastruct/d2".',j),bl}})),bl),kI={text:Fo,paragraph:rp,heading:Z4,code_block:k8,list:um,list_item:am,blockquote:j9,table:G0,definition_list:H9,footnote:W9,footnote_reference:la,footnote_anchor:K0,admonition:K9,vmr_container:U9,hardbreak:ff,link:Xr,image:df,thematic_break:q9,math_inline:Iu,math_block:_q,strong:Yr,emphasis:el,strikethrough:Jr,highlight:ua,insert:El,subscript:Tl,superscript:Ml,emoji:Il,checkbox:ra,checkbox_input:ra,inline_code:Er,html_inline:aa,reference:Qr,html_block:Z0},IY=D(()=>qs()),bI=D(()=>bF(I.codeBlockProps)),MY=D(()=>bF(I.codeBlockProps,{omit:["langs"]})),wI=D(()=>Bt(Bt({stream:I.codeBlockStream,darkTheme:I.codeBlockDarkTheme,lightTheme:I.codeBlockLightTheme,monacoOptions:I.codeBlockMonacoOptions,themes:I.themes,langs:m.value==="shiki"?I.langs:void 0,minWidth:I.codeBlockMinWidth,maxWidth:I.codeBlockMaxWidth},typeof me.value=="boolean"?{showTooltips:me.value}:{}),MY.value)),CI=D(()=>Bt(Dn(Bt({},wI.value),{langs:I.langs}),bI.value));function AI(j){return typeof j=="boolean"?j:void 0}const TY=D(()=>{const j=I.codeBlockProps||{},oe={},ye=AI(j.showLineNumbers);ye!==void 0&&(oe.showLineNumbers=ye);const we=AI(j.diffInline);we!==void 0&&(oe.diffInline=we);const Ee=(function(He){const Je=Number(He);return Number.isFinite(Je)&&Je>0?Je:void 0})(j.reservedHeightPx);return Ee!==void 0&&(oe.reservedHeightPx=Ee),oe}),EY=D(()=>Bt(Bt({stream:I.codeBlockStream,darkTheme:I.codeBlockDarkTheme,lightTheme:I.codeBlockLightTheme,themes:I.themes,langs:I.langs,minWidth:I.codeBlockMinWidth,maxWidth:I.codeBlockMaxWidth},typeof me.value=="boolean"?{showTooltips:me.value}:{}),bI.value)),LY=D(()=>Bt({},I.mermaidProps||{})),xI=D(()=>Bt({},I.d2Props||{})),NY=D(()=>Bt({},I.infographicProps||{})),Cg=D(()=>({typewriter:f.value,fade:I.fade,customHtmlTags:Ji.value.customHtmlTags})),FY=D(()=>Bt(Bt({},Cg.value),typeof me.value=="boolean"?{showTooltip:me.value}:{})),DY=D(()=>Bt(Bt({},Cg.value),typeof me.value=="boolean"?{showTooltips:me.value}:{})),RY=D(()=>Bt(Bt({},Cg.value),typeof me.value=="boolean"?{showTooltips:me.value}:{})),OY=D(()=>Bt(Bt({},Cg.value),typeof me.value=="boolean"?{showTooltips:me.value}:{}));function PY(j){return Array.isArray(j.children)&&j.children.length>0}const K2=D(()=>On.value.map(j=>{var oe,ye,we,Ee,He,Je,nt,vt;let it=(function(Dt){var rn,cn,wn,yn,Cn,Wn,Jn;if(Dt.type!=="code_block")return Dt;const Oi=Dt,er=[String((rn=Oi.language)!=null?rn:""),String((cn=Oi.loading)!=null?cn:""),String((wn=Oi.diff)!=null?wn:""),String((yn=Oi.code)!=null?yn:""),String((Cn=Oi.originalCode)!=null?Cn:""),String((Wn=Oi.updatedCode)!=null?Wn:""),String((Jn=Oi.raw)!=null?Jn:"")].join("\0"),Us=Ja.get(Oi);if(Us&&Us.signature===er)return Us.node;const nu=Bt({},Oi);return Ja.set(Oi,{signature:er,node:nu}),nu})(j.node);const lt=Z2(it);let gt=MI(it,lt);if((it.type==="html_block"||it.type==="html_inline")&>===kI[it.type]){const Dt=it,rn=String((oe=Dt.tag)!=null?oe:"").trim().toLowerCase()||YH(Dt.content);if(rn){const cn=Sn.value[rn];if(Yi.value.has(rn)&&cn)gt=cn,it=Dn(Bt({},Dt),{type:rn,tag:rn,content:gme(Dt.content,rn)});else if(JH((ye=Dt.content)!=null?ye:Dt.raw,rn)){const wn=String((Ee=(we=Dt.content)!=null?we:Dt.raw)!=null?Ee:"");it.type==="html_inline"?(gt=Fo,it={type:"text",content:wn,raw:wn}):(gt=rp,it={type:"paragraph",children:[{type:"text",content:wn,raw:wn}],raw:wn})}}}const Xe=it.type==="code_block"&&m.value==="pre"&>===bl&&!t3(Sn.value,lt);let at=Bt({},(function(Dt,rn,cn){const wn=rn??Z2(Dt);if(Dt.type==="code_block"){const yn=wn?t3(Sn.value,wn):void 0;if(cn&&m.value==="pre"&&!yn&&cn===bl)return TY.value;if(cn&&wn&&cn===yn)return wn==="mermaid"?_I(Dt):wn==="infographic"?II(Dt):wn==="d2"||wn==="d2lang"?xI.value:CI.value;if(cn&&cn===Sn.value.code_block)return CI.value;if(Me(cn))return EY.value}return wn==="mermaid"?_I(Dt):wn==="infographic"?II(Dt):wn==="d2"||wn==="d2lang"?xI.value:Dt.type==="link"?FY.value:Dt.type==="list"?DY.value:Dt.type==="blockquote"?RY.value:Dt.type==="table"?OY.value:Dt.type==="code_block"?wI.value:Cg.value})(it,lt,gt));const It=ei.value?an.value[j.index]:null;it.type==="code_block"&&It?.kind==="code-block"&&(at=Dn(Bt({},at),Xe?{reservedHeightPx:(He=It.height)!=null?He:It.contentHeight}:{estimatedHeightPx:It.height,estimatedContentHeightPx:It.contentHeight,estimatedDiffInline:It.diffInline})),Xe||it.type!=="code_block"||lt!=="mermaid"||O1(at.estimatedPreviewHeightPx)!=null||(at=Dn(Bt({},at),{estimatedPreviewHeightPx:fb(cb(String((Je=it.code)!=null?Je:"")))})),Xe||it.type!=="code_block"||lt!=="infographic"||O1(at.estimatedPreviewHeightPx)!=null||(at=Dn(Bt({},at),{estimatedPreviewHeightPx:hb(db(String((nt=it.code)!=null?nt:"")))})),it.type==="math_block"&&(at=Dn(Bt({},at),{cacheScope:Nn}));const At=(function(Dt,rn){const cn=String(Dt.type);return!v2(cn)&&Sn.value[cn]===rn})(it,gt),Ut=At?$x(it,pe.value):void 0;return Dn(Bt({},j),{node:it,component:gt,bindings:at,customBindings:Bt(Bt({},Ut??{}),at),rendersCustomNode:At,hasSlotChildren:PY(it),slotContent:String((vt=it.content)!=null?vt:""),isCodeBlock:it.type==="code_block",indexKey:`${IY.value}-${j.index}`,vnodeKey:`${eh.value}\0${j.index}\0${it.type}`})}));function Z2(j){var oe;return j?.type==="code_block"?String((oe=j.language)!=null?oe:"").trim().toLowerCase():""}function t3(j,oe){const ye=oe.trim().toLowerCase();if(ye)for(const we of[ye,U4(ye),aq(ye)]){const Ee=we&&j[we];if(Ee)return Ee}}function SI(j,oe,ye,we){var Ee,He;const Je=Bt({},j.value);return O1(Je.estimatedPreviewHeightPx)==null&&(Je.estimatedPreviewHeightPx=we(ye(String((Ee=oe?.code)!=null?Ee:"")),void 0,Je.maxHeight==="none"?null:(He=O1(Je.maxHeight))!=null?He:void 0)),Je}function _I(j){return SI(LY,j,cb,fb)}function II(j){return SI(NY,j,db,hb)}function MI(j,oe){if(!j)return zA;const ye=Sn.value,we=ye[String(j.type)];if(j.type==="code_block"){const Ee=oe??Z2(j),He=Ee?t3(ye,Ee):void 0;return He||(m.value==="pre"?ye.code_block||bl:Ee==="mermaid"?ye.mermaid||xY:Ee==="infographic"?ye.infographic||SY:Ee==="d2"||Ee==="d2lang"?ye.d2||_Y:we||ye.code_block||st.value)}return we||kI[String(j.type)]||zA}function n3(j){o("click",j)}function BY(j){var oe;(oe=j.target)!=null&&oe.closest("[data-node-index]")&&o("mouseover",j)}function $Y(j){var oe;(oe=j.target)!=null&&oe.closest("[data-node-index]")&&o("mouseout",j)}function TI(j){o("mouseover",j)}function EI(j){o("mouseout",j)}const ah=q(null),pl=q(!1),Ag=q(null),zY=D(()=>!(I.domMode!=="minimal"||Q.value||I.fade!==!1||f.value||pl.value||bs.value||An.value||fn.value||Ue.value||zl.value||Object.keys(Sn.value).length!==0));let xg,Yp=null,i3=0,G2=0,Q2=0;const LI=["code_block","admonition","table","math_block","html_block","image","thematic_break"],jY=new Set(LI),NI=[".typewriter-cursor",".height-estimation-probes",...LI.map(j=>`[data-node-type="${j}"]`),"script","style"].join(",");function FI(j){if(!j||typeof j!="object")return!1;const oe=j.type;return typeof oe=="string"&&jY.has(oe)}function Y2(j){var oe,ye;if(!j||typeof j!="object")return 0;const we=j,Ee=(ye=(oe=we.raw)!=null?oe:we.content)!=null?ye:we.code;if(typeof Ee=="string")return Ee.length;const He=we.children;if(Array.isArray(He))return He.reduce((nt,vt)=>nt+Y2(vt),0);const Je=we.items;return Array.isArray(Je)?Je.reduce((nt,vt)=>nt+Y2(vt),0):0}function J2(){xg&&(clearTimeout(xg),xg=void 0)}function o3(){i3+=1,Yp!=null&&(Xi?.(Yp),Yp=null)}function Sg(){o3(),Ad(),ah.value&&(ah.value.style.visibility="hidden")}function HY(j){var oe;if(j.nodeType!==Node.TEXT_NODE||!((oe=j.textContent)!=null?oe:"").trim())return!1;const ye=j.parentElement;return!!ye&&!ye.closest(NI)}function WY(j){let oe=j.lastChild;for(;oe;){if(HY(oe))return oe;if(oe.nodeType===Node.ELEMENT_NODE){const ye=oe;if(!ye.matches(NI)&&ye.lastChild){oe=ye.lastChild;continue}}for(;oe&&oe!==j&&!oe.previousSibling;)oe=oe.parentNode;if(!oe||oe===j)break;oe=oe.previousSibling}return null}function DI(){const j=K2.value;for(let oe=j.length-1;oe>=0;oe--){const ye=j[oe];if(!ye||FI(ye.node)||!q2(ye.index))continue;const we=xi.get(ye.index);if(!we)continue;const Ee=WY(we);if(Ee)return Ee}return null}function Ad(){Ag.value&&(Ag.value.classList.remove(PF),Ag.value=null)}function X2(){if(d.value!=="simple"||!U||!pl.value||!F.value)return void Ad();const j=DI(),oe=j?(function(ye){var we;const Ee=(we=ye.parentElement)==null?void 0:we.closest(".text-node");return Ee instanceof HTMLElement?Ee:ye.parentElement})(j):null;oe!==Ag.value&&(Ad(),oe&&(oe.classList.add(PF),Ag.value=oe))}function ey(){if(d.value!=="precise"||!U||!pl.value||Yp!=null)return;const j=i3,oe=()=>{Yp=null,j===i3&&(function(){var ye,we;if(d.value!=="precise"||!(U&&pl.value&&F.value&&ah.value))return;const Ee=F.value,He=ah.value;He.style.visibility="hidden";const Je=DI();if(!Je)return;let nt=0,vt=0,it=20,lt=!1;if(Je?.textContent){const gt=Je.textContent.length,Xe=document.createRange();Xe.setStart(Je,Math.max(0,gt-1)),Xe.setEnd(Je,gt);const at=typeof Xe.getClientRects=="function"?Xe.getClientRects():void 0,It=(we=at?.[at.length-1])!=null?we:(ye=Je.parentElement)==null?void 0:ye.getBoundingClientRect();if(It){const At=Ve("typewriterCursor.root.getBoundingClientRect",()=>Ee.getBoundingClientRect());nt=It.right-At.left+Ee.scrollLeft,vt=It.top-At.top+Ee.scrollTop,it=It.height||it,lt=!0}Xe.detach()}lt&&(He.style.transform=`translate(${Math.max(0,nt)}px, ${Math.max(0,vt)}px)`,He.style.height=`${it}px`,He.style.visibility="visible")})()};Go?Yp=Go(oe):oe()}return ze([ke,()=>i.content,()=>i.nodes,()=>I.typewriter,Ne],()=>io(null,null,function*(){var j,oe;if(!U||Q.value||!re.value)return;if(Ne.value)return pl.value=!1,J2(),void Sg();if((j=i.nodes)!=null&&j.length)return pl.value=!1,J2(),Sg(),G2=((oe=i.content)!=null?oe:"").length,void(Q2=ke.value.length);const ye=(function(){var nt,vt;return(nt=i.nodes)!=null&&nt.length?i.nodes.reduce((it,lt)=>it+Y2(lt),0):((vt=i.content)!=null?vt:"").length})(),we=(function(){var nt;return(nt=i.nodes)!=null&&nt.length?i.nodes.reduce((vt,it)=>vt+Y2(it),0):ke.value.length})(),Ee=!FI(Zt.value[Zt.value.length-1]),He=ye>G2,Je=we>Q2;if(!f.value||!Ee||!He&&!Je)return f.value&&Ee||(pl.value=!1,Sg()),G2=ye,void(Q2=we);G2=ye,Q2=we,pl.value=!0,d.value==="precise"&&ah.value&&(ah.value.style.visibility="hidden"),J2(),yield ft(),d.value==="simple"?X2():(Ad(),ey()),xg=setTimeout(()=>{xg=void 0,pl.value=!1},3e3)}),{flush:"post",immediate:!0}),ze(pl,j=>io(null,null,function*(){j?(yield ft(),d.value!=="simple"?(Ad(),d.value==="precise"&&ey()):X2()):Sg()}),{flush:"post"}),ze(d,()=>io(null,null,function*(){if(U&&!Q.value&&re.value&&pl.value){if(yield ft(),d.value==="simple")return o3(),void X2();Ad(),d.value!=="precise"?Sg():ey()}}),{flush:"post"}),ze([()=>Bs.value,()=>uo.start,()=>uo.end],()=>io(null,null,function*(){U&&!Q.value&&re.value&&pl.value&&(yield ft(),d.value!=="simple"?(Ad(),d.value==="precise"&&ey()):X2())}),{flush:"post"}),ii(()=>{J2(),o3(),Ad(),Wt.clear()}),(j,oe)=>{const ye=QB("NodeRenderer",!0);return p(Q)?(b(!0),N(Le,{key:0},Ct(K2.value,we=>(b(),N(Le,{key:we.vnodeKey},[we.rendersCustomNode?(b(),fe(To(we.component),ci({key:0,ref_for:!0},we.customBindings,{node:we.node,loading:we.node.loading,"index-key":we.indexKey,"custom-id":I.customId,"is-dark":I.isDark,onClick:n3,onMouseover:TI,onMouseout:EI,onCopy:oe[0]||(oe[0]=Ee=>s(Ee)),onHandleArtifactClick:oe[1]||(oe[1]=Ee=>o("handleArtifactClick",Ee))}),{default:de(()=>[we.hasSlotChildren?(b(),fe(ye,ci({key:0,ref_for:!0},ji.value,{nodes:we.node.children,"index-key":we.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):we.slotContent?(b(),fe(ye,ci({key:1,ref_for:!0},ji.value,{content:we.slotContent,final:!we.node.loading,"index-key":`${we.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):X("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(b(),fe(To(we.component),ci({key:1,node:we.node,loading:we.node.loading,"index-key":we.indexKey},{ref_for:!0},we.bindings,{"custom-id":I.customId,"is-dark":I.isDark,onClick:n3,onMouseover:TI,onMouseout:EI,onCopy:oe[2]||(oe[2]=Ee=>s(Ee)),onHandleArtifactClick:oe[3]||(oe[3]=Ee=>o("handleArtifactClick",Ee))}),null,16,["node","loading","index-key","custom-id","is-dark"]))],64))),128)):(b(),N("div",{key:1,ref_key:"containerRef",ref:F,class:De(["markstream-vue markdown-renderer",[{dark:I.isDark},{virtualized:An.value},{"virtual-scroll-coordinated":So.value},{"stable-layout":xs.value},{"typewriter-simple-cursor":pl.value&&d.value==="simple"}]]),"data-custom-id":I.customId,onClick:n3,onMouseover:BY,onMouseout:$Y},[Li.value||An.value?(b(),N(Le,{key:0},[Li.value?(b(),fe(A4e,{key:0,width:$t.value,"flow-root":An.value||So.value,"paragraph-node":pr.value,"list-item-node":Zo.value,"list-node":Po.value,"heading-nodes":fo.value,"set-paragraph-wrapper":Ht,"set-list-item-wrapper":vn,"set-list-wrapper":Bn,"set-heading-wrapper":wd},null,8,["width","flow-root","paragraph-node","list-item-node","list-node","heading-nodes"])):X("",!0),An.value?(b(),N("div",{key:1,class:"node-spacer",style:on({height:`${xn.value}px`}),"aria-hidden":"true"},null,4)):X("",!0)],64)):X("",!0),zY.value?(b(!0),N(Le,{key:1},Ct(K2.value,we=>(b(),N(Le,{key:we.vnodeKey},[q2(we.index)?(b(),fe(To(we.component),ci({key:0,node:we.node,loading:we.node.loading,"index-key":we.indexKey},{ref_for:!0},we.bindings,{"custom-id":I.customId,"is-dark":I.isDark,onMouseover:oe[4]||(oe[4]=Ee=>o("mouseover",Ee)),onMouseout:oe[5]||(oe[5]=Ee=>o("mouseout",Ee)),onCopy:oe[6]||(oe[6]=Ee=>s(Ee)),onHandleArtifactClick:oe[7]||(oe[7]=Ee=>o("handleArtifactClick",Ee))}),null,16,["node","loading","index-key","custom-id","is-dark"])):X("",!0)],64))),128)):(b(!0),N(Le,{key:2},Ct(K2.value,we=>(b(),N("div",{key:we.vnodeKey,ref_for:!0,ref:Ee=>U2(we.index,Ee),class:"node-slot","data-node-index":we.index,"data-node-type":we.node.type},[q2(we.index)?(b(),N("div",{key:0,ref_for:!0,ref:Ee=>(function(He,Je){var nt;Je||(function(gt){const Xe=`${qs()}-${gt}`;let at=!1;for(const It of Array.from(Yn.keys())){const At=Ss.get(It);(At?.index===gt||It===Xe||It.startsWith(`${Xe}-`))&&(Yn.delete(It),Ss.delete(It),at=!0)}at&&(jp(),to("async-node"))})(He),cl.delete(He),(function(gt){var Xe;const at=((Xe=Aa.get(gt))!=null?Xe:0)+1;Aa.set(gt,at)})(He);const vt=Gl.get(He);if(vt){for(const gt of vt)$e(gt);Gl.delete(He)}if((function(gt){const Xe=Rr.get(gt);Xe&&(zo?.unobserve(Xe),Ya.delete(Xe),Rr.delete(gt))})(He),!Je||!Ga.value)return $r.delete(He),void Aa.delete(He);$r.set(He,Je);const it=()=>{V2(He,Je)};queueMicrotask(it);const lt=(zo||typeof ResizeObserver>"u"||(zo=new ResizeObserver(gt=>{if(gt.length)for(const Xe of gt){const at=Ya.get(Xe.target),It=Rr.get(at??-1);at!=null&&It&&V2(at,It)}else _c()})),zo);if(lt&&(Rr.set(He,Je),Ya.set(Je,He),lt.observe(Je)),typeof window<"u"){const gt=((nt=Zt.value[He])==null?void 0:nt.type)==="code_block"?[16,80,240,800]:Ne.value?[80]:[];if(gt.length){const Xe=gt.map(at=>Ie(at,it,"node-resize")).filter(at=>at!=null);Xe.length&&Gl.set(He,Xe)}}})(we.index,Ee),class:"node-content"},[we.isCodeBlock?we.rendersCustomNode?(b(),fe(To(we.component),ci({key:1,ref_for:!0},we.customBindings,{node:we.node,loading:we.node.loading,"index-key":we.indexKey,"custom-id":I.customId,"is-dark":I.isDark,onCopy:oe[12]||(oe[12]=Ee=>s(Ee)),onHandleArtifactClick:oe[13]||(oe[13]=Ee=>o("handleArtifactClick",Ee))}),{default:de(()=>[we.hasSlotChildren?(b(),fe(ye,ci({key:0,ref_for:!0},ji.value,{nodes:we.node.children,"index-key":we.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):we.slotContent?(b(),fe(ye,ci({key:1,ref_for:!0},ji.value,{content:we.slotContent,final:!we.node.loading,"index-key":`${we.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):X("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(b(),fe(To(we.component),ci({key:2,node:we.node,loading:we.node.loading,"index-key":we.indexKey},{ref_for:!0},we.bindings,{"custom-id":I.customId,"is-dark":I.isDark,onCopy:oe[14]||(oe[14]=Ee=>s(Ee)),onHandleArtifactClick:oe[15]||(oe[15]=Ee=>o("handleArtifactClick",Ee))}),null,16,["node","loading","index-key","custom-id","is-dark"])):(b(),fe(mo,{key:0,name:"fade",css:I.fade!==!1,appear:I.fade!==!1},{default:de(()=>[we.rendersCustomNode?(b(),fe(To(we.component),ci({key:0,ref_for:!0},we.customBindings,{node:we.node,loading:we.node.loading,"index-key":we.indexKey,"custom-id":I.customId,"is-dark":I.isDark,onCopy:oe[8]||(oe[8]=Ee=>s(Ee)),onHandleArtifactClick:oe[9]||(oe[9]=Ee=>o("handleArtifactClick",Ee))}),{default:de(()=>[we.hasSlotChildren?(b(),fe(ye,ci({key:0,ref_for:!0},ji.value,{nodes:we.node.children,"index-key":we.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["nodes","index-key"])):we.slotContent?(b(),fe(ye,ci({key:1,ref_for:!0},ji.value,{content:we.slotContent,final:!we.node.loading,"index-key":`${we.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,["content","final","index-key"])):X("",!0)]),_:2},1040,["node","loading","index-key","custom-id","is-dark"])):(b(),fe(To(we.component),ci({key:1,node:we.node,loading:we.node.loading,"index-key":we.indexKey},{ref_for:!0},we.bindings,{"custom-id":I.customId,"is-dark":I.isDark,onCopy:oe[10]||(oe[10]=Ee=>s(Ee)),onHandleArtifactClick:oe[11]||(oe[11]=Ee=>o("handleArtifactClick",Ee))}),null,16,["node","loading","index-key","custom-id","is-dark"]))]),_:2},1032,["css","appear"]))],512)):(b(),N("div",{key:1,class:"node-placeholder",style:on({height:`${Br(we.index)}px`})},null,4))],8,_4e))),128)),pl.value&&d.value==="precise"?(b(),N("span",{key:3,ref_key:"typewriterCursorRef",ref:ah,class:"typewriter-cursor","aria-hidden":"true"},null,512)):X("",!0),An.value?(b(),N("div",{key:4,class:"node-spacer",style:on({height:`${En.value}px`}),"aria-hidden":"true"},null,4)):X("",!0)],42,S4e))}}})),[["__scopeId","data-v-a9489508"]]),Ll=zq;Ll.install=e=>{const t=new Set(["MarkdownRender","NodeRenderer",Ll.__name,Ll.name].filter(n=>!!n));for(const n of t)e.component(n,zq)};const Xx=Object.freeze(Object.defineProperty({__proto__:null,default:Ll},Symbol.toStringTag,{value:"Module"})),I4e={key:0,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},M4e={key:1,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},T4e={key:2,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},E4e={key:3,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"admonition-icon"},L4e={class:"admonition-title"},N4e=["aria-expanded","aria-controls"],F4e=["id"],K9=Ei(ot({__name:"AdmonitionNode",props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:["copy"],setup(e,{emit:t}){var n;const i=e,o=t,s=D(()=>{if(i.node.title&&i.node.title.trim().length)return i.node.title;const u=i.node.kind||"note";return u.charAt(0).toUpperCase()+u.slice(1)}),r=q(!!i.node.collapsible&&!((n=i.node.open)==null||n));function l(){i.node.collapsible&&(r.value=!r.value)}const a=`admonition-${Math.random().toString(36).slice(2,9)}`;return(u,c)=>(b(),N("div",{class:De(["admonition",[`admonition-${i.node.kind}`]])},[_("div",{id:a,class:"admonition-legend"},[i.node.kind==="note"||i.node.kind==="info"?(b(),N("svg",I4e,[...c[1]||(c[1]=[_("circle",{cx:"12",cy:"12",r:"10"},null,-1),_("path",{d:"M12 16v-4"},null,-1),_("path",{d:"M12 8h.01"},null,-1)])])):i.node.kind==="tip"?(b(),N("svg",M4e,[...c[2]||(c[2]=[_("path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5"},null,-1),_("path",{d:"M9 18h6"},null,-1),_("path",{d:"M10 22h4"},null,-1)])])):i.node.kind==="warning"||i.node.kind==="caution"?(b(),N("svg",T4e,[...c[3]||(c[3]=[_("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"},null,-1),_("path",{d:"M12 9v4"},null,-1),_("path",{d:"M12 17h.01"},null,-1)])])):i.node.kind==="danger"||i.node.kind==="error"?(b(),N("svg",E4e,[...c[4]||(c[4]=[_("polygon",{points:"7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2"},null,-1),_("path",{d:"M12 8v4"},null,-1),_("path",{d:"M12 16h.01"},null,-1)])])):X("",!0),_("span",L4e,B(s.value),1),i.node.collapsible?(b(),N("button",{key:4,class:"admonition-toggle","aria-expanded":!r.value,"aria-controls":`${a}-content`,onClick:l},[(b(),N("svg",{style:on({rotate:r.value?"0deg":"90deg"}),xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[...c[5]||(c[5]=[_("path",{d:"m9 18 6-6-6-6"},null,-1)])],4))],8,N4e)):X("",!0)]),si(_("div",{id:`${a}-content`,class:"admonition-content","aria-labelledby":a},[V(p(Ll),{"index-key":`admonition-${e.indexKey}`,nodes:i.node.children,"custom-id":i.customId,typewriter:i.typewriter,fade:i.fade,onCopy:c[0]||(c[0]=d=>o("copy",d))},null,8,["index-key","nodes","custom-id","typewriter","fade"])],8,F4e),[[Eo,!r.value]])],2))}}),[["__scopeId","data-v-a83480e1"]]);K9.install=e=>{e.component(K9.__name,K9)};const UA=()=>qo(()=>import("./d2_markstream-vue-yoD6TSFD.js"),[]);let Py=null,By=UA,$y=null,BF=!1,$F=!1;function V8t(){return io(this,null,function*(){if(Py)return Py;const e=By;return e?e===UA&&BF?null:$y||($y=io(null,null,function*(){let t;try{t=yield e()}catch(n){if(e===UA)return e===By&&(BF=!0,(function(i){$F||($F=!0,console.warn('[markstream-vue] Optional dependency "@terrastruct/d2" is not installed. D2 blocks will render as source.',i))})(n)),null;throw n}finally{e===By&&($y=null)}return e!==By?null:t?(Py=(function(n){var i;if(!n)return n;if(n.D2&&typeof n.D2=="function")return n.D2;if(n.default&&n.default.D2&&typeof n.default.D2=="function")return n.default.D2;const o=(i=n.default)!=null?i:n;return typeof o=="function"?o:o?.D2&&typeof o.D2=="function"?o.D2:o})(t),Py):null}),$y):null})}let zy=null,jq=null,jy=null;function K8t(){return typeof jq=="function"}function Z8t(){return io(this,null,function*(){if(zy)return zy;const e=jq;return e?jy||(jy=io(null,null,function*(){const t=yield e(),n=(function(i){var o,s,r;if(!i)return null;const l=(o=i.default)!=null?o:i,a=typeof l=="function"&&typeof((s=l.prototype)==null?void 0:s.render)=="function"?l:(r=i.Infographic)!=null?r:l?.Infographic;return typeof a=="function"?a:null})(t);return n?(zy=n,zy):null}).finally(()=>{jy=null}),jy):null})}const G8t=Symbol("markstreamLanguageIconResolver");function D4e(e){return new Worker("/assets/katexRenderer.worker-CO_gEm4q.js",{type:"module",name:e?.name})}function R4e(e){return new Worker("/assets/mermaidParser.worker-BFSlSHEW.js",{type:"module",name:e?.name})}let zF=!1;function Hq(){zF||typeof Worker>"u"||(zF=!0,f9e(new D4e),S9e(new R4e))}Hq();function Jd(e,t,n="/api/v1"){return`${e}${n}${t.startsWith("/")?t:`/${t}`}`}function jF(e,t){const n=new URL(`${e}/api/v1/ws`);return n.protocol=n.protocol==="https:"?"wss:":"ws:",n.searchParams.set("client_id",t),n.toString()}const eS={},Cb=Symbol("resolveImage"),Dc=3e4,Hy=5*6e4,HF=5*6e4,Wq="0123456789ABCDEFGHJKMNPQRSTVWXYZ",VA=500,qq=40101;function WF(e,t){for(const[n,i]of Object.entries(t))if(i!==void 0)if(Array.isArray(i))for(const o of i)o!==void 0&&e.append(n,String(o));else e.set(n,String(i))}function f0(e=Dc){try{return AbortSignal.timeout(e)}catch{return}}function O4e(e,t){const n=f0(e);if(n===void 0)return t;try{return AbortSignal.any([n,t])}catch{return t}}function P4e(e,t){let n="",i=e;for(let o=0;oWq[n%32]).join("")}function jg(){return`${P4e(Date.now(),10)}${B4e(16)}`}function qF(e){try{const t=[];return e.forEach((n,i)=>{typeof n=="string"?t.push({field:i,value:n}):t.push({field:i,file:n.name,size:n.size,type:n.type})}),{formData:t}}catch{return"[FormData]"}}async function E8(e){try{const t=await e.text();return t?t.length>VA?`${t.slice(0,VA)}...`:t:void 0}catch{return}}class UF{constructor(t){this.opts=t,this.tracer=t.tracer??eS}tracer;async get(t,n){return this.request("GET",t,void 0,n)}async getBlob(t,n,i){let o=Jd(this.opts.origin,t,this.opts.restBasePath);if(n){const c=new URLSearchParams;WF(c,n);const d=c.toString();d&&(o=`${o}?${d}`)}const s=jg(),r={"X-Request-Id":s};this.addClientHeaders(r);const l=Date.now();this.tracer.restRequest?.({method:"GET",path:t,url:o,requestId:s});let a;try{a=await fetch(o,{method:"GET",headers:r,signal:f0()})}catch(c){throw this.tracer.restFailure?.({method:"GET",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-l,error:c}),new Xl({message:`Network error calling GET ${t}`,cause:c,method:"GET",path:t,url:o,requestId:s,phase:"fetch",timeoutMs:Dc,timestamp:Date.now(),durationMs:Date.now()-l})}if(a.ok){this.tracer.restResponse?.({method:"GET",path:t,requestId:s,status:a.status,durationMs:Date.now()-l,code:0,msg:""});const c=Number(a.headers.get("content-length")??0);if(i?.maxBytes!==void 0&&c>i.maxBytes)throw a.body?.cancel(),new z7({size:c,limit:i.maxBytes});return a.blob()}let u;try{u=await a.clone().json()}catch{}throw this.checkAuthRequired(a,u?.code??0),this.tracer.restResponse?.({method:"GET",path:t,requestId:s,status:a.status,durationMs:Date.now()-l,code:u?.code??a.status,msg:u?.msg??a.statusText,envelopeRequestId:u?.request_id}),new Zu({code:u?.code??a.status,msg:u?.msg??a.statusText,requestId:u?.request_id??s,details:u?.details,timestamp:Date.now(),durationMs:Date.now()-l})}async post(t,n,i){return this.request("POST",t,n,void 0,i)}async postZip(t,n,i){const o="POST",s=Jd(this.opts.origin,t,this.opts.restBasePath),r=jg(),l={"X-Request-Id":r,"Content-Type":"application/json; charset=utf-8"};this.addClientHeaders(l);const a=Date.now();this.tracer.restRequest?.({method:o,path:t,url:s,requestId:r,body:i});let u;try{u=await fetch(s,{method:o,headers:l,body:JSON.stringify(n),signal:f0(Hy)})}catch(h){throw this.tracer.restFailure?.({method:o,path:t,requestId:r,phase:"fetch",durationMs:Date.now()-a,error:h}),new Xl({message:`Network error calling ${o} ${t}`,cause:h,method:o,path:t,url:s,requestId:r,phase:"fetch",timeoutMs:Hy,timestamp:Date.now(),durationMs:Date.now()-a})}const c=u.headers.get("content-type")??void 0,d=c?.split(";",1)[0]?.trim().toLowerCase();if(!u.ok||d!=="application/zip"){let h;try{h=await u.clone().json()}catch{}if(this.checkAuthRequired(u,h?.code??0),!u.ok||h!==void 0&&h.code!==0){const y=h?.code??u.status,k=h?.msg??u.statusText;throw this.tracer.restResponse?.({method:o,path:t,requestId:r,status:u.status,durationMs:Date.now()-a,code:y,msg:k,envelopeRequestId:h?.request_id}),new Zu({code:y,msg:k,requestId:h?.request_id??r,details:h?.details,timestamp:Date.now(),durationMs:Date.now()-a})}const m=u.clone(),g=new TypeError(`Expected application/zip, received ${c??"no content type"}`);throw this.tracer.restFailure?.({method:o,path:t,requestId:r,phase:"parse",durationMs:Date.now()-a,status:u.status,error:g}),new Xl({message:`Invalid ZIP response from ${o} ${t}`,cause:g,method:o,path:t,url:s,requestId:r,phase:"parse",timeoutMs:Hy,status:u.status,statusText:u.statusText,contentType:c,bodyPreview:await E8(m),timestamp:Date.now(),durationMs:Date.now()-a})}let f;try{f=await u.blob()}catch(h){throw this.tracer.restFailure?.({method:o,path:t,requestId:r,phase:"parse",durationMs:Date.now()-a,status:u.status,error:h}),new Xl({message:`Failed to read ZIP response from ${o} ${t}`,cause:h,method:o,path:t,url:s,requestId:r,phase:"parse",timeoutMs:Hy,status:u.status,statusText:u.statusText,contentType:c,timestamp:Date.now(),durationMs:Date.now()-a})}return this.tracer.restResponse?.({method:o,path:t,requestId:r,status:u.status,durationMs:Date.now()-a,code:0,msg:""}),{blob:f,contentDisposition:u.headers.get("content-disposition")??void 0}}async postForm(t,n,i){if(i?.onUploadProgress!==void 0)return this.postFormXhr(t,n,i.onUploadProgress);const o=Jd(this.opts.origin,t,this.opts.restBasePath),s=jg(),r={"X-Request-Id":s};this.addClientHeaders(r);const l=Date.now();this.tracer.restRequest?.({method:"POST",path:t,url:o,requestId:s,body:qF(n)});let a;try{a=await fetch(o,{method:"POST",headers:r,body:n,signal:f0()})}catch(d){throw this.tracer.restFailure?.({method:"POST",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-l,error:d}),new Xl({message:`Network error calling POST ${t}`,cause:d,method:"POST",path:t,url:o,requestId:s,phase:"fetch",timeoutMs:Dc,timestamp:Date.now(),durationMs:Date.now()-l})}let u;const c=a.clone();try{u=await a.json()}catch(d){throw this.tracer.restFailure?.({method:"POST",path:t,requestId:s,phase:"parse",durationMs:Date.now()-l,status:a.status,error:d}),new Xl({message:`Failed to parse JSON response from POST ${t}`,cause:d,method:"POST",path:t,url:o,requestId:s,phase:"parse",timeoutMs:Dc,status:a.status,statusText:a.statusText,contentType:a.headers.get("content-type")??void 0,bodyPreview:await E8(c),timestamp:Date.now(),durationMs:Date.now()-l})}if(this.tracer.restResponse?.({method:"POST",path:t,requestId:s,status:a.status,durationMs:Date.now()-l,code:u.code,msg:u.msg,envelopeRequestId:u.request_id,data:u.data}),this.checkAuthRequired(a,u.code),u.code!==0){const d=u.code??a.status;throw new Zu({code:d,msg:u.msg??a.statusText,requestId:u.request_id??s,details:u.details,timestamp:Date.now(),durationMs:Date.now()-l})}return u.data}postFormXhr(t,n,i){const o=Jd(this.opts.origin,t,this.opts.restBasePath),s=jg(),r={"X-Request-Id":s};this.addClientHeaders(r);const l=Date.now();return this.tracer.restRequest?.({method:"POST",path:t,url:o,requestId:s,body:qF(n)}),new Promise((a,u)=>{const c=new XMLHttpRequest;c.open("POST",o),c.timeout=Dc;for(const[d,f]of Object.entries(r))c.setRequestHeader(d,f);c.upload.onprogress=d=>{d.lengthComputable&&i(d.loaded,d.total)},c.onerror=()=>{this.tracer.restFailure?.({method:"POST",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-l,error:c.statusText||"network error"}),u(new Xl({message:`Network error calling POST ${t}`,cause:null,method:"POST",path:t,url:o,requestId:s,phase:"fetch",timeoutMs:Dc,timestamp:Date.now(),durationMs:Date.now()-l}))},c.ontimeout=()=>{this.tracer.restFailure?.({method:"POST",path:t,requestId:s,phase:"fetch",durationMs:Date.now()-l,error:"timeout"}),u(new Xl({message:`Timeout calling POST ${t}`,cause:null,method:"POST",path:t,url:o,requestId:s,phase:"fetch",timeoutMs:Dc,timestamp:Date.now(),durationMs:Date.now()-l}))},c.onload=()=>{let d;try{d=JSON.parse(c.responseText)}catch(f){this.tracer.restFailure?.({method:"POST",path:t,requestId:s,phase:"parse",durationMs:Date.now()-l,status:c.status,error:f}),u(new Xl({message:`Failed to parse JSON response from POST ${t}`,cause:f,method:"POST",path:t,url:o,requestId:s,phase:"parse",timeoutMs:Dc,status:c.status,statusText:c.statusText,bodyPreview:c.responseText.slice(0,VA),timestamp:Date.now(),durationMs:Date.now()-l}));return}if(this.tracer.restResponse?.({method:"POST",path:t,requestId:s,status:c.status,durationMs:Date.now()-l,code:d.code,msg:d.msg,envelopeRequestId:d.request_id,data:d.data}),this.checkAuthStatus(c.status,d.code),d.code!==0){const f=d.code??c.status;u(new Zu({code:f,msg:d.msg??c.statusText,requestId:d.request_id??s,details:d.details,timestamp:Date.now(),durationMs:Date.now()-l}));return}a(d.data)},c.send(n)})}async patch(t,n){return this.request("PATCH",t,n)}async put(t,n){return this.request("PUT",t,n)}async delete(t){return this.request("DELETE",t)}async request(t,n,i,o,s={}){const r=s.allowCodes??[],l=s.timeoutMs??Dc,a=s.signal;let u=Jd(this.opts.origin,n,this.opts.restBasePath);if(o){const y=new URLSearchParams;WF(y,o);const k=y.toString();k&&(u=`${u}?${k}`)}const c=jg(),d={"X-Request-Id":c};this.addClientHeaders(d),i!==void 0&&(d["Content-Type"]="application/json; charset=utf-8");const f=Date.now();this.tracer.restRequest?.({method:t,path:n,url:u,requestId:c,body:i});let h;try{h=await fetch(u,{method:t,headers:d,body:i!==void 0?JSON.stringify(i):void 0,signal:a!==void 0?O4e(l,a):f0(l)})}catch(y){throw a?.aborted&&y instanceof Error&&y.name==="AbortError"?y:(this.tracer.restFailure?.({method:t,path:n,requestId:c,phase:"fetch",durationMs:Date.now()-f,error:y}),new Xl({message:`Network error calling ${t} ${n}`,cause:y,method:t,path:n,url:u,requestId:c,phase:"fetch",timeoutMs:l,timestamp:Date.now(),durationMs:Date.now()-f}))}let m;const g=h.clone();try{const y=await h.text();m=h.status===204&&y===""?{code:0,msg:"",data:null,request_id:c}:JSON.parse(y)}catch(y){throw a?.aborted&&y instanceof Error&&y.name==="AbortError"?y:(this.tracer.restFailure?.({method:t,path:n,requestId:c,phase:"parse",durationMs:Date.now()-f,status:h.status,error:y}),new Xl({message:`Failed to parse JSON response from ${t} ${n}`,cause:y,method:t,path:n,url:u,requestId:c,phase:"parse",timeoutMs:l,status:h.status,statusText:h.statusText,contentType:h.headers.get("content-type")??void 0,bodyPreview:await E8(g),timestamp:Date.now(),durationMs:Date.now()-f}))}if(this.tracer.restResponse?.({method:t,path:n,requestId:c,status:h.status,durationMs:Date.now()-f,code:m.code,msg:m.msg,envelopeRequestId:m.request_id,data:m.data}),this.checkAuthRequired(h,m.code),m.code!==0&&!r.includes(m.code))throw new Zu({code:typeof m.code=="number"?m.code:h.status,msg:typeof m.msg=="string"&&m.msg.length>0?m.msg:`HTTP ${h.status}${h.statusText?` ${h.statusText}`:""}`,requestId:m.request_id??c,details:m.details,timestamp:Date.now(),durationMs:Date.now()-f});return m.data}addClientHeaders(t){const n=this.opts.credentialStore?.getToken();n!==void 0&&(t.Authorization=`Bearer ${n}`);const i=this.opts.identity;i!==void 0&&(t["X-Kimi-Client-Id"]=i.clientId,t["X-Kimi-Client-Name"]=i.clientName,t["X-Kimi-Client-Version"]=i.clientVersion,t["X-Kimi-Client-Ui-Mode"]=i.clientUiMode)}checkAuthRequired(t,n){this.checkAuthStatus(t.status,n)}checkAuthStatus(t,n){(t===401||n===qq)&&this.opts.credentialStore?.markAuthRequired?.()}}function Uq(e){return{inputTokens:e.input_tokens,outputTokens:e.output_tokens,cacheReadTokens:e.cache_read_tokens,cacheCreationTokens:e.cache_creation_tokens,totalCostUsd:e.total_cost_usd,contextTokens:e.context_tokens,contextLimit:e.context_limit,turnCount:e.turn_count}}function VF(e){return e.contextTokens===0&&e.contextLimit===0&&e.inputTokens===0&&e.outputTokens===0&&e.turnCount===0}function Wu(e){return{id:e.id,title:e.title,createdAt:e.created_at,updatedAt:e.updated_at,busy:e.busy,mainTurnActive:e.main_turn_active,pendingInteraction:e.pending_interaction,lastTurnReason:e.last_turn_reason,archived:e.archived??!1,archivedAt:e.archived_at,currentPromptId:e.current_prompt_id,lastPrompt:e.last_prompt,cwd:e.metadata.cwd,model:e.agent_config.model,usage:Uq(e.usage),messageCount:e.message_count,lastSeq:e.last_seq,workspaceId:e.workspace_id,parentSessionId:typeof e.metadata.parent_session_id=="string"?e.metadata.parent_session_id:void 0}}function Wy(e){const t=e.activity.status;return{id:e.id,title:e.meta.title??e.meta.last_prompt??e.id.slice(0,12),createdAt:new Date(e.meta.created_at).toISOString(),updatedAt:new Date(e.meta.updated_at).toISOString(),busy:t==="running",pendingInteraction:t==="approval"?"approval":t==="question"?"question":void 0,lastTurnReason:t==="failed"?"failed":void 0,archived:e.meta.archived,archivedAt:e.meta.archived_at==null?void 0:new Date(e.meta.archived_at).toISOString(),lastPrompt:e.meta.last_prompt??void 0,cwd:e.workspace.cwd??"",model:e.activity.model??"",pullRequest:e.git===void 0?void 0:e.git.pull_request,usage:{inputTokens:0,outputTokens:0,cacheReadTokens:0,cacheCreationTokens:0,totalCostUsd:0,contextTokens:0,contextLimit:0,turnCount:0},messageCount:0,lastSeq:0,workspaceId:e.workspace.id.length>0?e.workspace.id:void 0}}function Y0(e){return{id:e.id,root:e.root,name:e.name,lastOpenedAt:e.last_opened_at,sessionCount:e.session_count}}function KF(e){return e.kind==="base64"?{kind:"base64",mediaType:e.media_type,data:e.data}:e.kind==="file"?{kind:"file",fileId:e.file_id}:e.kind==="session_media"?{kind:"sessionMedia",fileId:e.file_id}:{kind:"url",url:e.url}}function Q4(e){switch(e.type){case"text":return{type:"text",text:e.text};case"tool_use":return{type:"toolUse",toolCallId:e.tool_call_id,toolName:e.tool_name,input:e.input};case"tool_result":return{type:"toolResult",toolCallId:e.tool_call_id,output:e.output,isError:e.is_error};case"image":return{type:"image",source:KF(e.source)};case"video":return{type:"video",source:KF(e.source)};case"file":return{type:"file",fileId:e.file_id,name:e.name,mediaType:e.media_type,size:e.size};case"thinking":return{type:"thinking",thinking:e.thinking,signature:e.signature};default:return{type:"unknown",raw:e}}}function Vq(e){return{id:e.id,sessionId:e.session_id,role:e.role,content:e.content.map(Q4),createdAt:e.created_at,promptId:e.prompt_id,parentMessageId:e.parent_message_id,metadata:e.metadata}}function Kq(e){switch(e.type){case"text":return{type:"text",text:e.text};case"toolUse":return{type:"tool_use",tool_call_id:e.toolCallId,tool_name:e.toolName,input:e.input};case"toolResult":return{type:"tool_result",tool_call_id:e.toolCallId,output:e.output,is_error:e.isError};case"image":case"video":{const t=e.source;let n;return t.kind==="base64"?n={kind:"base64",media_type:t.mediaType,data:t.data}:t.kind==="file"?n={kind:"file",file_id:t.fileId}:t.kind==="sessionMedia"?n={kind:"session_media",file_id:t.fileId}:n={kind:"url",url:t.url},{type:e.type,source:n}}case"file":return{type:"file",file_id:e.fileId,name:e.name,media_type:e.mediaType,size:e.size};case"thinking":return{type:"thinking",thinking:e.thinking,signature:e.signature};case"unknown":return e.raw}}function $4e(e){return{content:e.content.map(Kq),metadata:e.metadata,agent_id:e.agentId,model:e.model,thinking:e.thinking,permission_mode:e.permissionMode,plan_mode:e.planMode,swarm_mode:e.swarmMode,goal_objective:e.goalObjective,goal_control:e.goalControl,skills:e.skills}}function z4e(e){return{decision:e.decision,scope:e.scope,feedback:e.feedback,selected_label:e.selectedLabel}}function j4e(e){return{approvalId:e.approval_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,toolName:e.tool_name,action:e.action,display:e.tool_input_display??e.display,expiresAt:e.expires_at,createdAt:e.created_at}}function H4e(e){return{id:e.id,label:e.label,description:e.description,recommended:e.recommended===!0||e.is_recommended===!0}}function W4e(e){return{id:e.id,question:e.question,header:e.header,body:e.body,options:e.options.map(H4e),multiSelect:e.multi_select,allowOther:e.allow_other,otherLabel:e.other_label,otherDescription:e.other_description}}function q4e(e){return{questionId:e.question_id,sessionId:e.session_id,turnId:e.turn_id,toolCallId:e.tool_call_id,questions:e.questions.map(W4e),createdAt:e.created_at}}function U4e(e){switch(e.kind){case"single":return{kind:"single",option_id:e.optionId};case"multi":return{kind:"multi",option_ids:e.optionIds};case"other":return{kind:"other",text:e.text};case"multiWithOther":return{kind:"multi_with_other",option_ids:e.optionIds,other_text:e.otherText};case"skipped":return{kind:"skipped"}}}function V4e(e){const t={};for(const[n,i]of Object.entries(e.answers))t[n]=U4e(i);return{answers:t,method:e.method,note:e.note}}function KA(e,t){if(typeof e.run_in_background!="boolean")throw new Error(`task wire missing required run_in_background (id ${e.id})`);return{id:e.id,agentId:e.agent_id??t,sessionId:e.session_id,kind:e.kind,description:e.description,status:e.status,command:e.command,createdAt:e.created_at,startedAt:e.started_at,completedAt:e.completed_at,outputPreview:e.output_preview,outputBytes:e.output_bytes,subagentPhase:e.subagent_phase,subagentType:e.subagent_type,model:e.model,thinkingEffort:e.thinking_effort,parentToolCallId:e.parent_tool_call_id,suspendedReason:e.suspended_reason,swarmIndex:e.swarm_index,runInBackground:e.run_in_background}}function ZF(e){return{path:e.path,name:e.name,kind:e.kind,size:e.size,modifiedAt:e.modified_at,etag:e.etag,mime:e.mime,languageId:e.language_id,isBinary:e.is_binary,isSymlinkTo:e.is_symlink_to,gitStatus:e.git_status,childCount:e.child_count}}function Fd(e,t){const n=e[t];return typeof n=="string"?n:void 0}function d1(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function Sa(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function Zq(e){if(!e||typeof e!="object")return null;const t=e,n=Fd(t,"status");if(n!=="active"&&n!=="paused"&&n!=="blocked"&&n!=="complete")return null;const i=t.budget,o=i&&typeof i=="object"?i:{};return{goalId:Fd(t,"goalId")??Fd(t,"goal_id")??"goal",objective:Fd(t,"objective")??"",completionCriterion:Fd(t,"completionCriterion")??Fd(t,"completion_criterion"),status:n,turnsUsed:d1(t,"turnsUsed")??d1(t,"turns_used")??0,tokensUsed:d1(t,"tokensUsed")??d1(t,"tokens_used")??0,wallClockMs:d1(t,"wallClockMs")??d1(t,"wall_clock_ms")??0,terminalReason:Fd(t,"terminalReason")??Fd(t,"terminal_reason"),budget:{tokenBudget:Sa(o,"tokenBudget")??Sa(o,"token_budget"),remainingTokens:Sa(o,"remainingTokens")??Sa(o,"remaining_tokens"),turnBudget:Sa(o,"turnBudget")??Sa(o,"turn_budget"),remainingTurns:Sa(o,"remainingTurns")??Sa(o,"remaining_turns"),wallClockBudgetMs:Sa(o,"wallClockBudgetMs")??Sa(o,"wall_clock_budget_ms"),remainingWallClockMs:Sa(o,"remainingWallClockMs")??Sa(o,"remaining_wall_clock_ms"),overBudget:o.overBudget===!0||o.over_budget===!0}}}function K4e(e){const t=e;switch(e.type){case"event.session.created":return{type:"sessionCreated",session:Wu(t.payload.session)};case"event.session.updated":return{type:"sessionUpdated",session:Wu(t.payload.session),changedFields:t.payload.changed_fields};case"event.session.deleted":return{type:"sessionDeleted",sessionId:t.session_id};case"event.session.archived":{const n=t.payload?.sessionId??t.payload?.session_id;if(typeof n!="string"||n.length===0)return{type:"unknown",raw:{_noop:!0,_wireType:t.type}};const i=t.payload?.workspace_id;return{type:"sessionArchived",sessionId:n,workspaceId:typeof i=="string"&&i.length>0?i:void 0}}case"event.workspace.created":return{type:"workspaceCreated",workspace:Y0(t.payload.workspace)};case"event.workspace.updated":return{type:"workspaceUpdated",workspace:Y0(t.payload.workspace)};case"event.workspace.deleted":return{type:"workspaceDeleted",workspaceId:t.payload.workspace_id,root:t.payload.root};case"event.session.work_changed":return{type:"sessionWorkChanged",sessionId:t.session_id,busy:t.payload.busy,mainTurnActive:t.payload.main_turn_active,pendingInteraction:t.payload.pending_interaction,lastTurnReason:t.payload.last_turn_reason};case"event.session.status_changed":return{type:"sessionWorkChanged",sessionId:t.session_id,busy:t.payload.status!=="idle"&&t.payload.status!=="aborted",mainTurnActive:t.payload.status!=="idle"&&t.payload.status!=="aborted",pendingInteraction:t.payload.status==="awaiting_approval"?"approval":t.payload.status==="awaiting_question"?"question":"none",lastTurnReason:t.payload.status==="aborted"?"cancelled":void 0};case"event.session.usage_updated":return{type:"sessionUsageUpdated",sessionId:t.session_id,usage:Uq(t.payload.usage)};case"event.session.history_compacted":return{type:"historyCompacted",sessionId:t.session_id,beforeSeq:t.payload.before_seq,reason:t.payload.reason,summaryMessageId:t.payload.summary_message_id};case"event.goal.updated":{const n=Zq(t.payload.snapshot??null);return{type:"goalUpdated",sessionId:t.session_id,goal:n?.status==="complete"?null:n}}case"event.message.created":return{type:"messageCreated",message:Vq(t.payload.message)};case"event.message.updated":return{type:"messageUpdated",sessionId:t.session_id,messageId:t.payload.message_id,content:t.payload.content.map(Q4),status:t.payload.status};case"event.assistant.delta":return{type:"assistantDelta",sessionId:t.session_id,messageId:t.payload.message_id,contentIndex:t.payload.content_index,delta:t.payload.delta};case"event.assistant.tool_use_started":case"event.assistant.tool_use_delta":case"event.assistant.tool_use_completed":case"event.assistant.completed":case"event.tool.started":return{type:"unknown",raw:{_noop:!0,_wireType:t.type}};case"event.tool.output":return{type:"toolOutput",sessionId:t.session_id,toolCallId:t.payload.tool_call_id,outputChunk:t.payload.chunk,stream:t.payload.stream};case"event.tool.progress":return typeof t.payload.message=="string"&&t.payload.message.length>0?{type:"toolOutput",sessionId:t.session_id,toolCallId:t.payload.tool_call_id,outputChunk:t.payload.message,stream:"stdout"}:{type:"unknown",raw:{_noop:!0,_wireType:t.type}};case"event.tool.completed":return{type:"unknown",raw:{_noop:!0,_wireType:t.type}};case"event.approval.requested":return{type:"approvalRequested",sessionId:t.session_id,approval:j4e(t.payload)};case"event.approval.resolved":return{type:"approvalResolved",sessionId:t.session_id,approvalId:t.payload.approval_id,decision:t.payload.decision,resolvedAt:t.payload.resolved_at,feedback:t.payload.feedback,selectedLabel:t.payload.selected_label};case"event.approval.expired":return{type:"approvalExpired",sessionId:t.session_id,approvalId:t.payload.approval_id};case"event.question.requested":return{type:"questionRequested",sessionId:t.session_id,question:q4e(t.payload)};case"event.question.answered":return{type:"questionAnswered",sessionId:t.session_id,questionId:t.payload.question_id,resolvedAt:t.payload.resolved_at};case"event.question.dismissed":return{type:"questionDismissed",sessionId:t.session_id,questionId:t.payload.question_id,dismissedAt:t.payload.dismissed_at};case"event.task.created":return{type:"taskCreated",sessionId:t.session_id,task:KA(t.payload.task)};case"event.task.progress":return{type:"taskProgress",sessionId:t.session_id,taskId:t.payload.task_id,outputChunk:t.payload.output_chunk,stream:t.payload.stream};case"event.task.completed":return{type:"taskCompleted",sessionId:t.session_id,taskId:t.payload.task_id,status:t.payload.status,outputPreview:t.payload.output_preview,outputBytes:t.payload.output_bytes};case"event.plugin.changed":return{type:"pluginsChanged"};case"event.capability.changed":return{type:"capabilityChanged",capabilityId:t.payload.capability_id,install:t.payload.install};case"event.config.changed":return{type:"configChanged",changedFields:t.payload.changed_fields,config:ZA(t.payload.config)};case"event.model_catalog.changed":return{type:"modelCatalogChanged",changed:t.payload.changed.map(n=>({providerId:n.provider_id,providerName:n.provider_name,added:n.added,removed:n.removed})),unchanged:t.payload.unchanged,failed:t.payload.failed};default:return{type:"unknown",raw:e}}}function Z4e(e){return{id:e.model,provider:e.provider,model:e.model,displayName:e.display_name,maxContextSize:e.max_context_size,capabilities:e.capabilities,supportEfforts:e.support_efforts,defaultEffort:e.default_effort}}function f1(e){return{id:e.id,type:e.type,baseUrl:e.base_url,defaultModel:e.default_model,hasApiKey:e.has_api_key,status:e.status,models:e.models}}function GF(e){return{id:e.id,name:e.name,wireType:e.wire_type,guessed:e.guessed,needsBaseUrl:e.needs_base_url,rejected:e.rejected,rejectReason:e.reject_reason,envKey:e.env_key,models:e.models.map(t=>({id:t.id,name:t.name,maxContextSize:t.max_context_size,capabilities:t.capabilities,reasoning:t.reasoning}))}}function ZA(e){const t={};for(const[n,i]of Object.entries(e.providers))t[n]={type:i.type,baseUrl:i.base_url,defaultModel:i.default_model,hasApiKey:i.has_api_key};return{providers:t,defaultProvider:e.default_provider,defaultModel:e.default_model,secondaryModel:e.secondary_model,models:e.models,thinking:e.thinking,planMode:e.plan_mode,yolo:e.yolo,defaultPermissionMode:e.default_permission_mode,defaultPlanMode:e.default_plan_mode,permission:e.permission,hooks:e.hooks,services:e.services,mergeAllAvailableSkills:e.merge_all_available_skills,extraSkillDirs:e.extra_skill_dirs,loopControl:e.loop_control,background:e.background,experimental:e.experimental,telemetry:e.telemetry,raw:e.raw}}function G4e(e){return e.session_id}function Q4e(e){return e.seq}function Y4e(e){const t=Number(e.slice(1));return Number.isFinite(t)?t:0}function QF(e){switch(e.kind){case"turn":return e.turnId;case"marker":return e.markerId;case"taskref":return e.refId}}const J4e={items:[],tasks:new Map,interactions:new Map,attachments:new Map,todos:new Map,prompts:new Map,meta:{},pendingInteractions:new Set,hasMoreOlder:!1};function X4e(e,t){switch(t.op){case"reset":return ewe(e,t);case"turn.upsert":return nwe(e,t.turn);case"step.upsert":return owe(e,t.turnId,t.step);case"frame.upsert":return rwe(e,t);case"append":return awe(e,t);case"marker.upsert":return JF(e,t.item,t.item.markerId,t.beforeTurn);case"taskref.upsert":return JF(e,t.item,t.item.refId,t.beforeTurn);case"task.upsert":return dwe(e,t.task);case"interaction.upsert":return fwe(e,t.interaction);case"attachment.upsert":return pwe(e,t.attachment);case"todo.upsert":return gwe(e,t.todo);case"prompt.upsert":return ywe(e,t.prompt);case"meta.merge":return wwe(e,t.meta);case"items.remove":return cwe(e,t.ids)}}function ewe(e,t){const n=new Set;for(const i of t.snapshot.interactions)i.state==="pending"&&n.add(i.interactionId);return{state:{items:t.snapshot.items,tasks:new Map(t.snapshot.tasks.map(i=>[i.taskId,i])),interactions:new Map(t.snapshot.interactions.map(i=>[i.interactionId,i])),attachments:new Map(t.snapshot.attachments.map(i=>[i.attachmentId,i])),todos:new Map(t.snapshot.todos.map(i=>[i.todoId,i])),prompts:new Map(t.snapshot.prompts.map(i=>[i.promptId,i])),meta:t.snapshot.meta,pendingInteractions:n,hasMoreOlder:t.snapshot.hasMoreOlder??!1},changed:!0}}function YF(e,t){return{...e,kind:"turn",steps:[...t]}}function Gq(e){return{kind:"turn",turnId:e,ordinal:Y4e(e),state:"running",origin:{kind:"other"},steps:[]}}function twe(e,t){const n=Number(e.slice(t.length+1))||0;return{kind:"step",stepId:e,turnId:t,ordinal:n,state:"running",frames:[]}}function Am(e,t){const n=e.items.find(i=>i.kind==="turn"&&i.turnId===t);return n?.kind==="turn"?n:void 0}function tS(e,t){const n=[...e];let i=n.length;for(let o=0;ot.ordinal){i=o;break}}return n.splice(i,0,t),n}function Y4(e,t,n){return e.map(i=>i.kind==="turn"&&i.turnId===t?n(i):i)}function nwe(e,t){const n=Am(e,t.turnId);return n?iwe(n,t)?{state:e,changed:!1}:{state:{...e,items:Y4(e.items,t.turnId,i=>YF(t,i.steps))},changed:!0}:{state:{...e,items:tS(e.items,YF(t,[]))},changed:!0}}function iwe(e,t){return e.ordinal===t.ordinal&&e.triggerPromptId===t.triggerPromptId&&e.state===t.state&&e.prompt===t.prompt&&e.attachmentIds===t.attachmentIds&&e.startedAt===t.startedAt&&e.endedAt===t.endedAt&&e.origin.kind===t.origin.kind&&e.origin.payload===t.origin.payload&&e.usage===t.usage&&e.durationMs===t.durationMs&&e.error===t.error}function owe(e,t,n){const i=Am(e,t)??Gq(t),o=i.steps.findIndex(u=>u.stepId===n.stepId);let s,r=!0;if(o>=0){const u=i.steps[o];u&&swe(u,n)?(r=!1,s=i.steps):s=i.steps.map(c=>c.stepId===n.stepId?{...n,kind:"step",frames:c.frames}:c)}else s=[...i.steps,{...n,kind:"step",frames:[]}].toSorted((u,c)=>u.ordinal-c.ordinal);if(!r)return{state:e,changed:!1};const l={...i,steps:[...s]},a=Am(e,t)?Y4(e.items,t,()=>l):tS(e.items,l);return{state:{...e,items:a},changed:!0}}function swe(e,t){return e.ordinal===t.ordinal&&e.state===t.state&&e.startedAt===t.startedAt&&e.endedAt===t.endedAt&&e.usage===t.usage&&e.finishReason===t.finishReason&&e.timing===t.timing&&e.retry===t.retry&&e.endReason===t.endReason&&e.endMessage===t.endMessage}function rwe(e,t){const n=Am(e,t.turnId)??Gq(t.turnId),i=n.steps.find(c=>c.stepId===t.stepId)??twe(t.stepId,t.turnId),o=i.frames.findIndex(c=>c.frameId===t.frame.frameId);let s;if(o>=0){const c=i.frames[o];if(c!==void 0&&lwe(c,t.frame))return{state:e,changed:!1};s=i.frames.map(d=>d.frameId===t.frame.frameId?t.frame:d)}else s=[...i.frames,t.frame];const r={...i,frames:[...s]},l=n.steps.some(c=>c.stepId===t.stepId)?n.steps.map(c=>c.stepId===t.stepId?r:c):[...n.steps,r].toSorted((c,d)=>c.ordinal-d.ordinal),a={...n,steps:l},u=Am(e,t.turnId)?Y4(e.items,t.turnId,()=>a):tS(e.items,a);return{state:{...e,items:u},changed:!0}}function lwe(e,t){return e.kind!==t.kind?!1:e.kind==="text"&&t.kind==="text"?e.text===t.text&&e.role===t.role&&e.attachmentIds===t.attachmentIds&&e.taskId===t.taskId:e.kind==="thinking"&&t.kind==="thinking"?e.text===t.text:e.kind==="tool"&&t.kind==="tool"?e.state===t.state&&e.toolCallId===t.toolCallId&&e.name===t.name&&e.view===t.view&&e.input===t.input&&e.output===t.output&&e.display===t.display&&e.error===t.error&&e.inputText===t.inputText&&e.progress===t.progress&&e.taskId===t.taskId&&e.approvalId===t.approvalId&&e.todoId===t.todoId&&e.agentRefs===t.agentRefs:e.kind==="notice"&&t.kind==="notice"?e.message===t.message&&e.level===t.level&&e.detail===t.detail:!1}function awe(e,t){if(t.target.type==="task")return uwe(e,t);const{turnId:n,stepId:i,frameId:o}=t.target,s=Am(e,n),r=s?.steps.find(f=>f.stepId===i),l=r?.frames.find(f=>f.frameId===o);if(!s||!r||!l||l.kind!=="text"&&l.kind!=="thinking")return{state:e,changed:!1,gap:{expected:0,got:t.offset}};const a=Qq(l.text,t.offset,t.text);if(a.gap)return{state:e,changed:!1,gap:a.gap};if(!a.changed)return{state:e,changed:!1};const u={...l,text:a.text},c={...r,frames:r.frames.map(f=>f.frameId===o?u:f)},d={...s,steps:s.steps.map(f=>f.stepId===i?c:f)};return{state:{...e,items:Y4(e.items,n,()=>d)},changed:!0}}function uwe(e,t){if(t.target.type!=="task")throw new Error("unreachable");const n=t.target.taskId,i=e.tasks.get(n),o=i?.outputTail??"",s=Qq(o,t.offset,t.text);if(s.gap)return{state:e,changed:!1,gap:s.gap};if(!s.changed)return{state:e,changed:!1};const r=i?{...i,outputTail:s.text}:{taskId:n,kind:"other",state:"running",detached:!1,outputTail:s.text},l=new Map(e.tasks);return l.set(n,r),{state:{...e,tasks:l},changed:!0}}function Qq(e,t,n){if(t>e.length)return{text:e,changed:!1,gap:{expected:e.length,got:t}};if(e.slice(t,t+n.length)===n)return{text:e,changed:!1};const i=e.length-t;return e.slice(t)!==n.slice(0,i)?{text:e,changed:!1,gap:{expected:e.length,got:t}}:(i>0?n.slice(i):n).length===0?{text:e,changed:!1}:{text:e.slice(0,t)+n,changed:!0}}function JF(e,t,n,i){if(e.items.some(s=>GA(s)===n)){let s=!1;const r=e.items.map(l=>GA(l)!==n||l===t?l:(s=!0,t));return s?{state:{...e,items:r},changed:!0}:{state:e,changed:!1}}if(i!==void 0){const s=[...e.items];let r=s.length;for(let l=0;l=i){r=l;break}}return s.splice(r,0,t),{state:{...e,items:s},changed:!0}}return{state:{...e,items:[...e.items,t]},changed:!0}}function GA(e){switch(e.kind){case"turn":return e.turnId;case"marker":return e.markerId;case"taskref":return e.refId}}function cwe(e,t){const n=new Set(t),i=e.items.filter(l=>l.kind==="turn"&&n.has(l.turnId)),o=e.items.filter(l=>!n.has(GA(l)));if(o.length===e.items.length)return{state:e,changed:!1};let s=e.pendingInteractions,r=e.interactions;if(i.length>0){const l=new Set,a=new Set(s),u=new Set;for(const c of i)for(const d of c.steps)for(const f of d.frames)f.kind==="tool"&&l.add(f.toolCallId);for(const c of r.values())c.toolCallId!==void 0&&l.has(c.toolCallId)&&(u.add(c.interactionId),a.delete(c.interactionId));if(u.size>0){const c=new Map(r);for(const d of u)c.delete(d);r=c}s=a}return{state:{...e,items:o,interactions:r,pendingInteractions:s},changed:!0}}function dwe(e,t){const n=e.tasks.get(t.taskId);if(n&&bwe(n,t))return{state:e,changed:!1};const i=new Map(e.tasks);return i.set(t.taskId,t),{state:{...e,tasks:i},changed:!0}}function fwe(e,t){const n=e.interactions.get(t.interactionId);if(n&&hwe(n,t))return{state:e,changed:!1};const i=new Map(e.interactions);i.set(t.interactionId,t);let o=e.pendingInteractions;if(t.state==="pending"){if(!o.has(t.interactionId)){const s=new Set(o);s.add(t.interactionId),o=s}}else if(o.has(t.interactionId)){const s=new Set(o);s.delete(t.interactionId),o=s}return{state:{...e,interactions:i,pendingInteractions:o},changed:!0}}function hwe(e,t){return e.interactionKind===t.interactionKind&&e.toolCallId===t.toolCallId&&e.state===t.state&&e.request===t.request&&e.response===t.response}function pwe(e,t){const n=e.attachments.get(t.attachmentId);if(n&&mwe(n,t))return{state:e,changed:!1};const i=new Map(e.attachments);return i.set(t.attachmentId,t),{state:{...e,attachments:i},changed:!0}}function mwe(e,t){return e.mediaType===t.mediaType&&e.name===t.name&&e.size===t.size&&e.source===t.source&&e.placeholder===t.placeholder}function gwe(e,t){const n=e.todos.get(t.todoId);if(n&&vwe(n,t))return{state:e,changed:!1};const i=new Map(e.todos);return i.set(t.todoId,t),{state:{...e,todos:i},changed:!0}}function vwe(e,t){return e.items===t.items&&e.updatedAt===t.updatedAt}function ywe(e,t){const n=e.prompts.get(t.promptId);if(n&&kwe(n,t))return{state:e,changed:!1};const i=new Map(e.prompts);return i.set(t.promptId,t),{state:{...e,prompts:i},changed:!0}}function kwe(e,t){return e.status===t.status&&e.userMessageId===t.userMessageId&&e.content===t.content&&e.createdAt===t.createdAt&&e.finishedAt===t.finishedAt&&e.steeredAt===t.steeredAt}function bwe(e,t){return e.kind===t.kind&&e.state===t.state&&e.detached===t.detached&&e.description===t.description&&e.agentId===t.agentId&&e.outputTail===t.outputTail&&e.startedAt===t.startedAt&&e.endedAt===t.endedAt&&e.resultSummary===t.resultSummary&&e.error===t.error&&e.stateReason===t.stateReason&&e.usage===t.usage}function wwe(e,t){const n=t.modes!==void 0?{plan:t.modes.plan===null?void 0:t.modes.plan??e.meta.modes?.plan,swarm:t.modes.swarm===null?void 0:t.modes.swarm??e.meta.modes?.swarm,tower:t.modes.tower===null?void 0:t.modes.tower??e.meta.modes?.tower}:e.meta.modes,i=t.agent!==void 0?{...e.meta.agent,...t.agent}:e.meta.agent,o={goal:t.goal===null?void 0:t.goal??e.meta.goal,activity:t.activity??e.meta.activity,modes:n!==void 0&&n.plan===void 0&&n.swarm===void 0&&n.tower===void 0?void 0:n,agent:i};return o.goal===e.meta.goal&&o.activity===e.meta.activity&&o.modes===e.meta.modes&&o.agent===e.meta.agent?{state:e,changed:!1}:{state:{...e,meta:o},changed:!0}}class Cwe{constructor(t){this.agentId=t}#e=J4e;#t=new Set;receive(t){return this.apply(t)}apply(t){const n=[];let i,o=this.#e;for(const s of t){const r=X4e(o,s);if(r.gap){i={target:s.target,...r.gap};continue}r.changed&&(o=r.state,n.push(s))}if(this.#e=o,n.length>0){const s={agentId:this.agentId,ops:n};for(const r of this.#t)r(s)}return{accepted:n,gap:i}}onChange(t){return this.#t.add(t),{dispose:()=>void this.#t.delete(t)}}getItems(){return this.#e.items}getTurn(t){const n=this.#e.items.find(i=>i.kind==="turn"&&i.turnId===t);return n?.kind==="turn"?n:void 0}getTasks(){return this.#e.tasks}getTask(t){return this.#e.tasks.get(t)}getInteractions(){return this.#e.interactions}getInteraction(t){return this.#e.interactions.get(t)}getAttachments(){return this.#e.attachments}getAttachment(t){return this.#e.attachments.get(t)}getTodos(){return this.#e.todos}getTodo(t){return this.#e.todos.get(t)}getPrompts(){return this.#e.prompts}getPrompt(t){return this.#e.prompts.get(t)}getMeta(){return this.#e.meta}listPendingInteractions(){return[...this.#e.pendingInteractions]}get hasMoreOlder(){return this.#e.hasMoreOlder}snapshot(t){let n=this.#e.items,i=this.#e.hasMoreOlder;if(t!==void 0){const o=n.reduce((s,r)=>r.kind==="turn"?s+1:s,0);if(o>t.tailTurns){const s=o-t.tailTurns,r=[];let l=0;for(const a of n)if(a.kind==="turn"){if(l+=1,l<=s)continue;r.push(a)}else l>s&&r.push(a);n=r,i=!0}}return{items:n,tasks:[...this.#e.tasks.values()],interactions:[...this.#e.interactions.values()],attachments:[...this.#e.attachments.values()],todos:[...this.#e.todos.values()],prompts:[...this.#e.prompts.values()],meta:this.#e.meta,hasMoreOlder:i}}}function Ft(e,t,n){function i(l,a){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:a,constr:r,traits:new Set},enumerable:!1}),l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,a);const u=r.prototype,c=Object.keys(u);for(let d=0;dn?.Parent&&l instanceof n.Parent?!0:l?._zod?.traits?.has(e)}),Object.defineProperty(r,"name",{value:e}),r}class cm extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Yq extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Jq={};function Ef(e){return Jq}function Xq(e){const t=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,o])=>t.indexOf(+i)===-1).map(([i,o])=>o)}function QA(e,t){return typeof t=="bigint"?t.toString():t}function J4(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function nS(e){return e==null}function iS(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function Awe(e,t){const n=(e.toString().split(".")[1]||"").length,i=t.toString();let o=(i.split(".")[1]||"").length;if(o===0&&/\d?e-\d?/.test(i)){const a=i.match(/\d?e-(\d?)/);a?.[1]&&(o=Number.parseInt(a[1]))}const s=n>o?n:o,r=Number.parseInt(e.toFixed(s).replace(".","")),l=Number.parseInt(t.toFixed(s).replace(".",""));return r%l/10**s}const XF=Symbol("evaluating");function Di(e,t,n){let i;Object.defineProperty(e,t,{get(){if(i!==XF)return i===void 0&&(i=XF,i=n()),i},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function Fp(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Uf(...e){const t={};for(const n of e){const i=Object.getOwnPropertyDescriptors(n);Object.assign(t,i)}return Object.defineProperties({},t)}function eD(e){return JSON.stringify(e)}function xwe(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const eU="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Bv(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Swe=J4(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function xm(e){if(Bv(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Bv(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function tU(e){return xm(e)?{...e}:Array.isArray(e)?[...e]:e}const _we=new Set(["string","number","symbol"]);function Sm(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Vf(e,t,n){const i=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(i._zod.parent=e),i}function _n(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Iwe(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const Mwe={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Twe(e,t){const n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const s=Uf(e._zod.def,{get shape(){const r={};for(const l in t){if(!(l in n.shape))throw new Error(`Unrecognized key: "${l}"`);t[l]&&(r[l]=n.shape[l])}return Fp(this,"shape",r),r},checks:[]});return Vf(e,s)}function Ewe(e,t){const n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=Uf(e._zod.def,{get shape(){const r={...e._zod.def.shape};for(const l in t){if(!(l in n.shape))throw new Error(`Unrecognized key: "${l}"`);t[l]&&delete r[l]}return Fp(this,"shape",r),r},checks:[]});return Vf(e,s)}function Lwe(e,t){if(!xm(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const s=e._zod.def.shape;for(const r in t)if(Object.getOwnPropertyDescriptor(s,r)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=Uf(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return Fp(this,"shape",s),s}});return Vf(e,o)}function Nwe(e,t){if(!xm(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Uf(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t};return Fp(this,"shape",i),i}});return Vf(e,n)}function Fwe(e,t){const n=Uf(e._zod.def,{get shape(){const i={...e._zod.def.shape,...t._zod.def.shape};return Fp(this,"shape",i),i},get catchall(){return t._zod.def.catchall},checks:[]});return Vf(e,n)}function Dwe(e,t,n){const o=t._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const r=Uf(t._zod.def,{get shape(){const l=t._zod.def.shape,a={...l};if(n)for(const u in n){if(!(u in l))throw new Error(`Unrecognized key: "${u}"`);n[u]&&(a[u]=e?new e({type:"optional",innerType:l[u]}):l[u])}else for(const u in l)a[u]=e?new e({type:"optional",innerType:l[u]}):l[u];return Fp(this,"shape",a),a},checks:[]});return Vf(t,r)}function Rwe(e,t,n){const i=Uf(t._zod.def,{get shape(){const o=t._zod.def.shape,s={...o};if(n)for(const r in n){if(!(r in s))throw new Error(`Unrecognized key: "${r}"`);n[r]&&(s[r]=new e({type:"nonoptional",innerType:o[r]}))}else for(const r in o)s[r]=new e({type:"nonoptional",innerType:o[r]});return Fp(this,"shape",s),s}});return Vf(t,i)}function B1(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n{var i;return(i=n).path??(i.path=[]),n.path.unshift(e),n})}function qy(e){return typeof e=="string"?e:e?.message}function Lf(e,t,n){const i={...e,path:e.path??[]};if(!e.message){const o=qy(e.inst?._zod.def?.error?.(e))??qy(t?.error?.(e))??qy(n.customError?.(e))??qy(n.localeError?.(e))??"Invalid input";i.message=o}return delete i.inst,delete i.continue,t?.reportInput||delete i.input,i}function oS(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function $v(...e){const[t,n,i]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:i}:{...t}}const nU=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,QA,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},iU=Ft("$ZodError",nU),oU=Ft("$ZodError",nU,{Parent:Error});function Owe(e,t=n=>n.message){const n={},i=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):i.push(t(o));return{formErrors:i,fieldErrors:n}}function Pwe(e,t=n=>n.message){const n={_errors:[]},i=o=>{for(const s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(r=>i({issues:r}));else if(s.code==="invalid_key")i({issues:s.issues});else if(s.code==="invalid_element")i({issues:s.issues});else if(s.path.length===0)n._errors.push(t(s));else{let r=n,l=0;for(;l(t,n,i,o)=>{const s=i?Object.assign(i,{async:!1}):{async:!1},r=t._zod.run({value:n,issues:[]},s);if(r instanceof Promise)throw new cm;if(r.issues.length){const l=new(o?.Err??e)(r.issues.map(a=>Lf(a,s,Ef())));throw eU(l,o?.callee),l}return r.value},rS=e=>async(t,n,i,o)=>{const s=i?Object.assign(i,{async:!0}):{async:!0};let r=t._zod.run({value:n,issues:[]},s);if(r instanceof Promise&&(r=await r),r.issues.length){const l=new(o?.Err??e)(r.issues.map(a=>Lf(a,s,Ef())));throw eU(l,o?.callee),l}return r.value},X4=e=>(t,n,i)=>{const o=i?{...i,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise)throw new cm;return s.issues.length?{success:!1,error:new(e??iU)(s.issues.map(r=>Lf(r,o,Ef())))}:{success:!0,data:s.value}},Bwe=X4(oU),ew=e=>async(t,n,i)=>{const o=i?Object.assign(i,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(r=>Lf(r,o,Ef())))}:{success:!0,data:s.value}},$we=ew(oU),zwe=e=>(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return sS(e)(t,n,o)},jwe=e=>(t,n,i)=>sS(e)(t,n,i),Hwe=e=>async(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return rS(e)(t,n,o)},Wwe=e=>async(t,n,i)=>rS(e)(t,n,i),qwe=e=>(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return X4(e)(t,n,o)},Uwe=e=>(t,n,i)=>X4(e)(t,n,i),Vwe=e=>async(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return ew(e)(t,n,o)},Kwe=e=>async(t,n,i)=>ew(e)(t,n,i),Zwe=/^[cC][^\s-]{8,}$/,Gwe=/^[0-9a-z]+$/,Qwe=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Ywe=/^[0-9a-vA-V]{20}$/,Jwe=/^[A-Za-z0-9]{27}$/,Xwe=/^[a-zA-Z0-9_-]{21}$/,e3e=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,t3e=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,tD=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,n3e=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,i3e="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function o3e(){return new RegExp(i3e,"u")}const s3e=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,r3e=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,l3e=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,a3e=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,u3e=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,sU=/^[A-Za-z0-9_-]*$/,c3e=/^\+[1-9]\d{6,14}$/,rU="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",d3e=new RegExp(`^${rU}$`);function lU(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function f3e(e){return new RegExp(`^${lU(e)}$`)}function h3e(e){const t=lU({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const i=`${t}(?:${n.join("|")})`;return new RegExp(`^${rU}T(?:${i})$`)}const p3e=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},m3e=/^-?\d+$/,aU=/^-?\d+(?:\.\d+)?$/,g3e=/^(?:true|false)$/i,v3e=/^[^A-Z]*$/,y3e=/^[^a-z]*$/,Pl=Ft("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),uU={number:"number",bigint:"bigint",object:"date"},cU=Ft("$ZodCheckLessThan",(e,t)=>{Pl.init(e,t);const n=uU[typeof t.value];e._zod.onattach.push(i=>{const o=i._zod.bag,s=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value{(t.inclusive?i.value<=t.value:i.value{Pl.init(e,t);const n=uU[typeof t.value];e._zod.onattach.push(i=>{const o=i._zod.bag,s=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),k3e=Ft("$ZodCheckMultipleOf",(e,t)=>{Pl.init(e,t),e._zod.onattach.push(n=>{var i;(i=n._zod.bag).multipleOf??(i.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):Awe(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),b3e=Ft("$ZodCheckNumberFormat",(e,t)=>{Pl.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),i=n?"int":"number",[o,s]=Mwe[t.format];e._zod.onattach.push(r=>{const l=r._zod.bag;l.format=t.format,l.minimum=o,l.maximum=s,n&&(l.pattern=m3e)}),e._zod.check=r=>{const l=r.value;if(n){if(!Number.isInteger(l)){r.issues.push({expected:i,format:t.format,code:"invalid_type",continue:!1,input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?r.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort}):r.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort});return}}ls&&r.issues.push({origin:"number",input:l,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),w3e=Ft("$ZodCheckMaxLength",(e,t)=>{var n;Pl.init(e,t),(n=e._zod.def).when??(n.when=i=>{const o=i.value;return!nS(o)&&o.length!==void 0}),e._zod.onattach.push(i=>{const o=i._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum{const o=i.value;if(o.length<=t.maximum)return;const r=oS(o);i.issues.push({origin:r,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),C3e=Ft("$ZodCheckMinLength",(e,t)=>{var n;Pl.init(e,t),(n=e._zod.def).when??(n.when=i=>{const o=i.value;return!nS(o)&&o.length!==void 0}),e._zod.onattach.push(i=>{const o=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(i._zod.bag.minimum=t.minimum)}),e._zod.check=i=>{const o=i.value;if(o.length>=t.minimum)return;const r=oS(o);i.issues.push({origin:r,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),A3e=Ft("$ZodCheckLengthEquals",(e,t)=>{var n;Pl.init(e,t),(n=e._zod.def).when??(n.when=i=>{const o=i.value;return!nS(o)&&o.length!==void 0}),e._zod.onattach.push(i=>{const o=i._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=i=>{const o=i.value,s=o.length;if(s===t.length)return;const r=oS(o),l=s>t.length;i.issues.push({origin:r,...l?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),tw=Ft("$ZodCheckStringFormat",(e,t)=>{var n,i;Pl.init(e,t),e._zod.onattach.push(o=>{const s=o._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(i=e._zod).check??(i.check=()=>{})}),x3e=Ft("$ZodCheckRegex",(e,t)=>{tw.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),S3e=Ft("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=v3e),tw.init(e,t)}),_3e=Ft("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=y3e),tw.init(e,t)}),I3e=Ft("$ZodCheckIncludes",(e,t)=>{Pl.init(e,t);const n=Sm(t.includes),i=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=i,e._zod.onattach.push(o=>{const s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(i)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),M3e=Ft("$ZodCheckStartsWith",(e,t)=>{Pl.init(e,t);const n=new RegExp(`^${Sm(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(i=>{const o=i._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=i=>{i.value.startsWith(t.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:i.value,inst:e,continue:!t.abort})}}),T3e=Ft("$ZodCheckEndsWith",(e,t)=>{Pl.init(e,t);const n=new RegExp(`.*${Sm(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(i=>{const o=i._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=i=>{i.value.endsWith(t.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:i.value,inst:e,continue:!t.abort})}}),E3e=Ft("$ZodCheckOverwrite",(e,t)=>{Pl.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class L3e{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const i=t.split(` -`).filter(r=>r),o=Math.min(...i.map(r=>r.length-r.trimStart().length)),s=i.map(r=>r.slice(o)).map(r=>" ".repeat(this.indent*2)+r);for(const r of s)this.content.push(r)}compile(){const t=Function,n=this?.args,o=[...(this?.content??[""]).map(s=>` ${s}`)];return new t(...n,o.join(` -`))}}const N3e={major:4,minor:3,patch:6},Co=Ft("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=N3e;const i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(const o of i)for(const s of o._zod.onattach)s(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const o=(r,l,a)=>{let u=B1(r),c;for(const d of l){if(d._zod.def.when){if(!d._zod.def.when(r))continue}else if(u)continue;const f=r.issues.length,h=d._zod.check(r);if(h instanceof Promise&&a?.async===!1)throw new cm;if(c||h instanceof Promise)c=(c??Promise.resolve()).then(async()=>{await h,r.issues.length!==f&&(u||(u=B1(r,f)))});else{if(r.issues.length===f)continue;u||(u=B1(r,f))}}return c?c.then(()=>r):r},s=(r,l,a)=>{if(B1(r))return r.aborted=!0,r;const u=o(l,i,a);if(u instanceof Promise){if(a.async===!1)throw new cm;return u.then(c=>e._zod.parse(c,a))}return e._zod.parse(u,a)};e._zod.run=(r,l)=>{if(l.skipChecks)return e._zod.parse(r,l);if(l.direction==="backward"){const u=e._zod.parse({value:r.value,issues:[]},{...l,skipChecks:!0});return u instanceof Promise?u.then(c=>s(c,r,l)):s(u,r,l)}const a=e._zod.parse(r,l);if(a instanceof Promise){if(l.async===!1)throw new cm;return a.then(u=>o(u,i,l))}return o(a,i,l)}}Di(e,"~standard",()=>({validate:o=>{try{const s=Bwe(e,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return $we(e,o).then(r=>r.success?{value:r.data}:{issues:r.error?.issues})}},vendor:"zod",version:1}))}),lS=Ft("$ZodString",(e,t)=>{Co.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??p3e(e._zod.bag),e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),go=Ft("$ZodStringFormat",(e,t)=>{tw.init(e,t),lS.init(e,t)}),F3e=Ft("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=t3e),go.init(e,t)}),D3e=Ft("$ZodUUID",(e,t)=>{if(t.version){const i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(i===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=tD(i))}else t.pattern??(t.pattern=tD());go.init(e,t)}),R3e=Ft("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=n3e),go.init(e,t)}),O3e=Ft("$ZodURL",(e,t)=>{go.init(e,t),e._zod.check=n=>{try{const i=n.value.trim(),o=new URL(i);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=o.href:n.value=i;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),P3e=Ft("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=o3e()),go.init(e,t)}),B3e=Ft("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Xwe),go.init(e,t)}),$3e=Ft("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Zwe),go.init(e,t)}),z3e=Ft("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Gwe),go.init(e,t)}),j3e=Ft("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Qwe),go.init(e,t)}),H3e=Ft("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Ywe),go.init(e,t)}),W3e=Ft("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Jwe),go.init(e,t)}),q3e=Ft("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=h3e(t)),go.init(e,t)}),U3e=Ft("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=d3e),go.init(e,t)}),V3e=Ft("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=f3e(t)),go.init(e,t)}),K3e=Ft("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=e3e),go.init(e,t)}),Z3e=Ft("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=s3e),go.init(e,t),e._zod.bag.format="ipv4"}),G3e=Ft("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=r3e),go.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),Q3e=Ft("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=l3e),go.init(e,t)}),Y3e=Ft("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=a3e),go.init(e,t),e._zod.check=n=>{const i=n.value.split("/");try{if(i.length!==2)throw new Error;const[o,s]=i;if(!s)throw new Error;const r=Number(s);if(`${r}`!==s)throw new Error;if(r<0||r>128)throw new Error;new URL(`http://[${o}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function fU(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const J3e=Ft("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=u3e),go.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{fU(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function X3e(e){if(!sU.test(e))return!1;const t=e.replace(/[-_]/g,i=>i==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return fU(n)}const e8e=Ft("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=sU),go.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{X3e(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),t8e=Ft("$ZodE164",(e,t)=>{t.pattern??(t.pattern=c3e),go.init(e,t)});function n8e(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[i]=n;if(!i)return!1;const o=JSON.parse(atob(i));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}const i8e=Ft("$ZodJWT",(e,t)=>{go.init(e,t),e._zod.check=n=>{n8e(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),hU=Ft("$ZodNumber",(e,t)=>{Co.init(e,t),e._zod.pattern=e._zod.bag.pattern??aU,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const o=n.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return n;const s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...s?{received:s}:{}}),n}}),o8e=Ft("$ZodNumberFormat",(e,t)=>{b3e.init(e,t),hU.init(e,t)}),s8e=Ft("$ZodBoolean",(e,t)=>{Co.init(e,t),e._zod.pattern=g3e,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=!!n.value}catch{}const o=n.value;return typeof o=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}}),r8e=Ft("$ZodUnknown",(e,t)=>{Co.init(e,t),e._zod.parse=n=>n}),l8e=Ft("$ZodNever",(e,t)=>{Co.init(e,t),e._zod.parse=(n,i)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function nD(e,t,n){e.issues.length&&t.issues.push(...$1(n,e.issues)),t.value[n]=e.value}const a8e=Ft("$ZodArray",(e,t)=>{Co.init(e,t),e._zod.parse=(n,i)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const s=[];for(let r=0;rnD(u,n,r))):nD(a,n,r)}return s.length?Promise.all(s).then(()=>n):n}});function Ab(e,t,n,i,o){if(e.issues.length){if(o&&!(n in i))return;t.issues.push(...$1(n,e.issues))}e.value===void 0?n in i&&(t.value[n]=void 0):t.value[n]=e.value}function pU(e){const t=Object.keys(e.shape);for(const i of t)if(!e.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);const n=Iwe(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function mU(e,t,n,i,o,s){const r=[],l=o.keySet,a=o.catchall._zod,u=a.def.type,c=a.optout==="optional";for(const d in t){if(l.has(d))continue;if(u==="never"){r.push(d);continue}const f=a.run({value:t[d],issues:[]},i);f instanceof Promise?e.push(f.then(h=>Ab(h,n,d,t,c))):Ab(f,n,d,t,c)}return r.length&&n.issues.push({code:"unrecognized_keys",keys:r,input:t,inst:s}),e.length?Promise.all(e).then(()=>n):n}const u8e=Ft("$ZodObject",(e,t)=>{if(Co.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const l=t.shape;Object.defineProperty(t,"shape",{get:()=>{const a={...l};return Object.defineProperty(t,"shape",{value:a}),a}})}const i=J4(()=>pU(t));Di(e._zod,"propValues",()=>{const l=t.shape,a={};for(const u in l){const c=l[u]._zod;if(c.values){a[u]??(a[u]=new Set);for(const d of c.values)a[u].add(d)}}return a});const o=Bv,s=t.catchall;let r;e._zod.parse=(l,a)=>{r??(r=i.value);const u=l.value;if(!o(u))return l.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),l;l.value={};const c=[],d=r.shape;for(const f of r.keys){const h=d[f],m=h._zod.optout==="optional",g=h._zod.run({value:u[f],issues:[]},a);g instanceof Promise?c.push(g.then(y=>Ab(y,l,f,u,m))):Ab(g,l,f,u,m)}return s?mU(c,u,l,a,i.value,e):c.length?Promise.all(c).then(()=>l):l}}),c8e=Ft("$ZodObjectJIT",(e,t)=>{u8e.init(e,t);const n=e._zod.parse,i=J4(()=>pU(t)),o=f=>{const h=new L3e(["shape","payload","ctx"]),m=i.value,g=C=>{const w=eD(C);return`shape[${w}]._zod.run({ value: input[${w}], issues: [] }, ctx)`};h.write("const input = payload.value;");const y=Object.create(null);let k=0;for(const C of m.keys)y[C]=`key_${k++}`;h.write("const newResult = {};");for(const C of m.keys){const w=y[C],M=eD(C),E=f[C]?._zod?.optout==="optional";h.write(`const ${w} = ${g(C)};`),E?h.write(` - if (${w}.issues.length) { - if (${M} in input) { - payload.issues = payload.issues.concat(${w}.issues.map(iss => ({ - ...iss, - path: iss.path ? [${M}, ...iss.path] : [${M}] - }))); - } - } - - if (${w}.value === undefined) { - if (${M} in input) { - newResult[${M}] = undefined; - } - } else { - newResult[${M}] = ${w}.value; - } - - `):h.write(` - if (${w}.issues.length) { - payload.issues = payload.issues.concat(${w}.issues.map(iss => ({ - ...iss, - path: iss.path ? [${M}, ...iss.path] : [${M}] - }))); - } - - if (${w}.value === undefined) { - if (${M} in input) { - newResult[${M}] = undefined; - } - } else { - newResult[${M}] = ${w}.value; - } - - `)}h.write("payload.value = newResult;"),h.write("return payload;");const v=h.compile();return(C,w)=>v(f,C,w)};let s;const r=Bv,l=!Jq.jitless,u=l&&Swe.value,c=t.catchall;let d;e._zod.parse=(f,h)=>{d??(d=i.value);const m=f.value;return r(m)?l&&u&&h?.async===!1&&h.jitless!==!0?(s||(s=o(t.shape)),f=s(f,h),c?mU([],m,f,h,d,e):f):n(f,h):(f.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),f)}});function iD(e,t,n,i){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const o=e.filter(s=>!B1(s));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(s=>s.issues.map(r=>Lf(r,i,Ef())))}),t)}const gU=Ft("$ZodUnion",(e,t)=>{Co.init(e,t),Di(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),Di(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),Di(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),Di(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>iS(s.source)).join("|")})$`)}});const n=t.options.length===1,i=t.options[0]._zod.run;e._zod.parse=(o,s)=>{if(n)return i(o,s);let r=!1;const l=[];for(const a of t.options){const u=a._zod.run({value:o.value,issues:[]},s);if(u instanceof Promise)l.push(u),r=!0;else{if(u.issues.length===0)return u;l.push(u)}}return r?Promise.all(l).then(a=>iD(a,o,e,s)):iD(l,o,e,s)}}),d8e=Ft("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,gU.init(e,t);const n=e._zod.parse;Di(e._zod,"propValues",()=>{const o={};for(const s of t.options){const r=s._zod.propValues;if(!r||Object.keys(r).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(const[l,a]of Object.entries(r)){o[l]||(o[l]=new Set);for(const u of a)o[l].add(u)}}return o});const i=J4(()=>{const o=t.options,s=new Map;for(const r of o){const l=r._zod.propValues?.[t.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(const a of l){if(s.has(a))throw new Error(`Duplicate discriminator value "${String(a)}"`);s.set(a,r)}}return s});e._zod.parse=(o,s)=>{const r=o.value;if(!Bv(r))return o.issues.push({code:"invalid_type",expected:"object",input:r,inst:e}),o;const l=i.value.get(r?.[t.discriminator]);return l?l._zod.run(o,s):t.unionFallback?n(o,s):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:r,path:[t.discriminator],inst:e}),o)}}),f8e=Ft("$ZodIntersection",(e,t)=>{Co.init(e,t),e._zod.parse=(n,i)=>{const o=n.value,s=t.left._zod.run({value:o,issues:[]},i),r=t.right._zod.run({value:o,issues:[]},i);return s instanceof Promise||r instanceof Promise?Promise.all([s,r]).then(([a,u])=>oD(n,a,u)):oD(n,s,r)}});function YA(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(xm(e)&&xm(t)){const n=Object.keys(t),i=Object.keys(e).filter(s=>n.indexOf(s)!==-1),o={...e,...t};for(const s of i){const r=YA(e[s],t[s]);if(!r.valid)return{valid:!1,mergeErrorPath:[s,...r.mergeErrorPath]};o[s]=r.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let i=0;il.l&&l.r).map(([l])=>l);if(s.length&&o&&e.issues.push({...o,keys:s}),B1(e))return e;const r=YA(t.value,n.value);if(!r.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}const h8e=Ft("$ZodRecord",(e,t)=>{Co.init(e,t),e._zod.parse=(n,i)=>{const o=n.value;if(!xm(o))return n.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),n;const s=[],r=t.keyType._zod.values;if(r){n.value={};const l=new Set;for(const u of r)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){l.add(typeof u=="number"?u.toString():u);const c=t.valueType._zod.run({value:o[u],issues:[]},i);c instanceof Promise?s.push(c.then(d=>{d.issues.length&&n.issues.push(...$1(u,d.issues)),n.value[u]=d.value})):(c.issues.length&&n.issues.push(...$1(u,c.issues)),n.value[u]=c.value)}let a;for(const u in o)l.has(u)||(a=a??[],a.push(u));a&&a.length>0&&n.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:a})}else{n.value={};for(const l of Reflect.ownKeys(o)){if(l==="__proto__")continue;let a=t.keyType._zod.run({value:l,issues:[]},i);if(a instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&aU.test(l)&&a.issues.length){const d=t.keyType._zod.run({value:Number(l),issues:[]},i);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");d.issues.length===0&&(a=d)}if(a.issues.length){t.mode==="loose"?n.value[l]=o[l]:n.issues.push({code:"invalid_key",origin:"record",issues:a.issues.map(d=>Lf(d,i,Ef())),input:l,path:[l],inst:e});continue}const c=t.valueType._zod.run({value:o[l],issues:[]},i);c instanceof Promise?s.push(c.then(d=>{d.issues.length&&n.issues.push(...$1(l,d.issues)),n.value[a.value]=d.value})):(c.issues.length&&n.issues.push(...$1(l,c.issues)),n.value[a.value]=c.value)}}return s.length?Promise.all(s).then(()=>n):n}}),p8e=Ft("$ZodEnum",(e,t)=>{Co.init(e,t);const n=Xq(t.entries),i=new Set(n);e._zod.values=i,e._zod.pattern=new RegExp(`^(${n.filter(o=>_we.has(typeof o)).map(o=>typeof o=="string"?Sm(o):o.toString()).join("|")})$`),e._zod.parse=(o,s)=>{const r=o.value;return i.has(r)||o.issues.push({code:"invalid_value",values:n,input:r,inst:e}),o}}),m8e=Ft("$ZodLiteral",(e,t)=>{if(Co.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(i=>typeof i=="string"?Sm(i):i?Sm(i.toString()):String(i)).join("|")})$`),e._zod.parse=(i,o)=>{const s=i.value;return n.has(s)||i.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),i}}),g8e=Ft("$ZodTransform",(e,t)=>{Co.init(e,t),e._zod.parse=(n,i)=>{if(i.direction==="backward")throw new Yq(e.constructor.name);const o=t.transform(n.value,n);if(i.async)return(o instanceof Promise?o:Promise.resolve(o)).then(r=>(n.value=r,n));if(o instanceof Promise)throw new cm;return n.value=o,n}});function sD(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const vU=Ft("$ZodOptional",(e,t)=>{Co.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Di(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Di(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${iS(n.source)})?$`):void 0}),e._zod.parse=(n,i)=>{if(t.innerType._zod.optin==="optional"){const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then(s=>sD(s,n.value)):sD(o,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,i)}}),v8e=Ft("$ZodExactOptional",(e,t)=>{vU.init(e,t),Di(e._zod,"values",()=>t.innerType._zod.values),Di(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,i)=>t.innerType._zod.run(n,i)}),y8e=Ft("$ZodNullable",(e,t)=>{Co.init(e,t),Di(e._zod,"optin",()=>t.innerType._zod.optin),Di(e._zod,"optout",()=>t.innerType._zod.optout),Di(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${iS(n.source)}|null)$`):void 0}),Di(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,i)=>n.value===null?n:t.innerType._zod.run(n,i)}),k8e=Ft("$ZodDefault",(e,t)=>{Co.init(e,t),e._zod.optin="optional",Di(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);if(n.value===void 0)return n.value=t.defaultValue,n;const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then(s=>rD(s,t)):rD(o,t)}});function rD(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const b8e=Ft("$ZodPrefault",(e,t)=>{Co.init(e,t),e._zod.optin="optional",Di(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,i)=>(i.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,i))}),w8e=Ft("$ZodNonOptional",(e,t)=>{Co.init(e,t),Di(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(i=>i!==void 0)):void 0}),e._zod.parse=(n,i)=>{const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then(s=>lD(s,e)):lD(o,e)}});function lD(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const C8e=Ft("$ZodCatch",(e,t)=>{Co.init(e,t),Di(e._zod,"optin",()=>t.innerType._zod.optin),Di(e._zod,"optout",()=>t.innerType._zod.optout),Di(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then(s=>(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(r=>Lf(r,i,Ef()))},input:n.value}),n.issues=[]),n)):(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(s=>Lf(s,i,Ef()))},input:n.value}),n.issues=[]),n)}}),A8e=Ft("$ZodPipe",(e,t)=>{Co.init(e,t),Di(e._zod,"values",()=>t.in._zod.values),Di(e._zod,"optin",()=>t.in._zod.optin),Di(e._zod,"optout",()=>t.out._zod.optout),Di(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,i)=>{if(i.direction==="backward"){const s=t.out._zod.run(n,i);return s instanceof Promise?s.then(r=>Uy(r,t.in,i)):Uy(s,t.in,i)}const o=t.in._zod.run(n,i);return o instanceof Promise?o.then(s=>Uy(s,t.out,i)):Uy(o,t.out,i)}});function Uy(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const x8e=Ft("$ZodReadonly",(e,t)=>{Co.init(e,t),Di(e._zod,"propValues",()=>t.innerType._zod.propValues),Di(e._zod,"values",()=>t.innerType._zod.values),Di(e._zod,"optin",()=>t.innerType?._zod?.optin),Di(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,i)=>{if(i.direction==="backward")return t.innerType._zod.run(n,i);const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then(aD):aD(o)}});function aD(e){return e.value=Object.freeze(e.value),e}const S8e=Ft("$ZodCustom",(e,t)=>{Pl.init(e,t),Co.init(e,t),e._zod.parse=(n,i)=>n,e._zod.check=n=>{const i=n.value,o=t.fn(i);if(o instanceof Promise)return o.then(s=>uD(s,n,i,e));uD(o,n,i,e)}});function uD(e,t,n,i){if(!e){const o={code:"custom",input:n,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(o.params=i._zod.def.params),t.issues.push($v(o))}}var cD;class _8e{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const i=n[0];return this._map.set(t,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const i={...this.get(n)??{}};delete i.id;const o={...i,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function I8e(){return new _8e}(cD=globalThis).__zod_globalRegistry??(cD.__zod_globalRegistry=I8e());const h0=globalThis.__zod_globalRegistry;function M8e(e,t){return new e({type:"string",..._n(t)})}function T8e(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,..._n(t)})}function dD(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,..._n(t)})}function E8e(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,..._n(t)})}function L8e(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",..._n(t)})}function N8e(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",..._n(t)})}function F8e(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",..._n(t)})}function D8e(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,..._n(t)})}function R8e(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,..._n(t)})}function O8e(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,..._n(t)})}function P8e(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,..._n(t)})}function B8e(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,..._n(t)})}function $8e(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,..._n(t)})}function z8e(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,..._n(t)})}function j8e(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,..._n(t)})}function H8e(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,..._n(t)})}function W8e(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,..._n(t)})}function q8e(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,..._n(t)})}function U8e(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,..._n(t)})}function V8e(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,..._n(t)})}function K8e(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,..._n(t)})}function Z8e(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,..._n(t)})}function G8e(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,..._n(t)})}function Q8e(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,..._n(t)})}function Y8e(e,t){return new e({type:"string",format:"date",check:"string_format",..._n(t)})}function J8e(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,..._n(t)})}function X8e(e,t){return new e({type:"string",format:"duration",check:"string_format",..._n(t)})}function e5e(e,t){return new e({type:"number",checks:[],..._n(t)})}function t5e(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",..._n(t)})}function n5e(e,t){return new e({type:"boolean",..._n(t)})}function i5e(e){return new e({type:"unknown"})}function o5e(e,t){return new e({type:"never",..._n(t)})}function fD(e,t){return new cU({check:"less_than",..._n(t),value:e,inclusive:!1})}function L8(e,t){return new cU({check:"less_than",..._n(t),value:e,inclusive:!0})}function hD(e,t){return new dU({check:"greater_than",..._n(t),value:e,inclusive:!1})}function N8(e,t){return new dU({check:"greater_than",..._n(t),value:e,inclusive:!0})}function pD(e,t){return new k3e({check:"multiple_of",..._n(t),value:e})}function yU(e,t){return new w3e({check:"max_length",..._n(t),maximum:e})}function xb(e,t){return new C3e({check:"min_length",..._n(t),minimum:e})}function kU(e,t){return new A3e({check:"length_equals",..._n(t),length:e})}function s5e(e,t){return new x3e({check:"string_format",format:"regex",..._n(t),pattern:e})}function r5e(e){return new S3e({check:"string_format",format:"lowercase",..._n(e)})}function l5e(e){return new _3e({check:"string_format",format:"uppercase",..._n(e)})}function a5e(e,t){return new I3e({check:"string_format",format:"includes",..._n(t),includes:e})}function u5e(e,t){return new M3e({check:"string_format",format:"starts_with",..._n(t),prefix:e})}function c5e(e,t){return new T3e({check:"string_format",format:"ends_with",..._n(t),suffix:e})}function Jm(e){return new E3e({check:"overwrite",tx:e})}function d5e(e){return Jm(t=>t.normalize(e))}function f5e(){return Jm(e=>e.trim())}function h5e(){return Jm(e=>e.toLowerCase())}function p5e(){return Jm(e=>e.toUpperCase())}function m5e(){return Jm(e=>xwe(e))}function g5e(e,t,n){return new e({type:"array",element:t,..._n(n)})}function v5e(e,t,n){return new e({type:"custom",check:"custom",fn:t,..._n(n)})}function y5e(e){const t=k5e(n=>(n.addIssue=i=>{if(typeof i=="string")n.issues.push($v(i,n.value,t._zod.def));else{const o=i;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),n.issues.push($v(o))}},e(n.value,n)));return t}function k5e(e,t){const n=new Pl({check:"custom",..._n(t)});return n._zod.check=e,n}function bU(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??h0,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function ps(e,t,n={path:[],schemaPath:[]}){var i;const o=e._zod.def,s=t.seen.get(e);if(s)return s.count++,n.schemaPath.includes(e)&&(s.cycle=n.path),s.schema;const r={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,r);const l=e._zod.toJSONSchema?.();if(l)r.schema=l;else{const c={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,r.schema,c);else{const f=r.schema,h=t.processors[o.type];if(!h)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);h(e,t,f,c)}const d=e._zod.parent;d&&(r.ref||(r.ref=d),ps(d,t,c),t.seen.get(d).isParent=!0)}const a=t.metadataRegistry.get(e);return a&&Object.assign(r.schema,a),t.io==="input"&&Hr(e)&&(delete r.schema.examples,delete r.schema.default),t.io==="input"&&r.schema._prefault&&((i=r.schema).default??(i.default=r.schema._prefault)),delete r.schema._prefault,t.seen.get(e).schema}function wU(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const i=new Map;for(const r of e.seen.entries()){const l=e.metadataRegistry.get(r[0])?.id;if(l){const a=i.get(l);if(a&&a!==r[0])throw new Error(`Duplicate schema id "${l}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(l,r[0])}}const o=r=>{const l=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const d=e.external.registry.get(r[0])?.id,f=e.external.uri??(m=>m);if(d)return{ref:f(d)};const h=r[1].defId??r[1].schema.id??`schema${e.counter++}`;return r[1].defId=h,{defId:h,ref:`${f("__shared")}#/${l}/${h}`}}if(r[1]===n)return{ref:"#"};const u=`#/${l}/`,c=r[1].schema.id??`__schema${e.counter++}`;return{defId:c,ref:u+c}},s=r=>{if(r[1].schema.$ref)return;const l=r[1],{ref:a,defId:u}=o(r);l.def={...l.schema},u&&(l.defId=u);const c=l.schema;for(const d in c)delete c[d];c.$ref=a};if(e.cycles==="throw")for(const r of e.seen.entries()){const l=r[1];if(l.cycle)throw new Error(`Cycle detected: #/${l.cycle?.join("/")}/ - -Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const r of e.seen.entries()){const l=r[1];if(t===r[0]){s(r);continue}if(e.external){const u=e.external.registry.get(r[0])?.id;if(t!==r[0]&&u){s(r);continue}}if(e.metadataRegistry.get(r[0])?.id){s(r);continue}if(l.cycle){s(r);continue}if(l.count>1&&e.reused==="ref"){s(r);continue}}}function CU(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const i=r=>{const l=e.seen.get(r);if(l.ref===null)return;const a=l.def??l.schema,u={...a},c=l.ref;if(l.ref=null,c){i(c);const f=e.seen.get(c),h=f.schema;if(h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(a.allOf=a.allOf??[],a.allOf.push(h)):Object.assign(a,h),Object.assign(a,u),r._zod.parent===c)for(const g in a)g==="$ref"||g==="allOf"||g in u||delete a[g];if(h.$ref&&f.def)for(const g in a)g==="$ref"||g==="allOf"||g in f.def&&JSON.stringify(a[g])===JSON.stringify(f.def[g])&&delete a[g]}const d=r._zod.parent;if(d&&d!==c){i(d);const f=e.seen.get(d);if(f?.schema.$ref&&(a.$ref=f.schema.$ref,f.def))for(const h in a)h==="$ref"||h==="allOf"||h in f.def&&JSON.stringify(a[h])===JSON.stringify(f.def[h])&&delete a[h]}e.override({zodSchema:r,jsonSchema:a,path:l.path??[]})};for(const r of[...e.seen.entries()].reverse())i(r[0]);const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const r=e.external.registry.get(t)?.id;if(!r)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(r)}Object.assign(o,n.def??n.schema);const s=e.external?.defs??{};for(const r of e.seen.entries()){const l=r[1];l.def&&l.defId&&(s[l.defId]=l.def)}e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?o.$defs=s:o.definitions=s);try{const r=JSON.parse(JSON.stringify(o));return Object.defineProperty(r,"~standard",{value:{...t["~standard"],jsonSchema:{input:Sb(t,"input",e.processors),output:Sb(t,"output",e.processors)}},enumerable:!1,writable:!1}),r}catch{throw new Error("Error converting schema to JSON.")}}function Hr(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const i=e._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return Hr(i.element,n);if(i.type==="set")return Hr(i.valueType,n);if(i.type==="lazy")return Hr(i.getter(),n);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault")return Hr(i.innerType,n);if(i.type==="intersection")return Hr(i.left,n)||Hr(i.right,n);if(i.type==="record"||i.type==="map")return Hr(i.keyType,n)||Hr(i.valueType,n);if(i.type==="pipe")return Hr(i.in,n)||Hr(i.out,n);if(i.type==="object"){for(const o in i.shape)if(Hr(i.shape[o],n))return!0;return!1}if(i.type==="union"){for(const o of i.options)if(Hr(o,n))return!0;return!1}if(i.type==="tuple"){for(const o of i.items)if(Hr(o,n))return!0;return!!(i.rest&&Hr(i.rest,n))}return!1}const b5e=(e,t={})=>n=>{const i=bU({...n,processors:t});return ps(e,i),wU(i,e),CU(i,e)},Sb=(e,t,n={})=>i=>{const{libraryOptions:o,target:s}=i??{},r=bU({...o??{},target:s,io:t,processors:n});return ps(e,r),wU(r,e),CU(r,e)},w5e={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},C5e=(e,t,n,i)=>{const o=n;o.type="string";const{minimum:s,maximum:r,format:l,patterns:a,contentEncoding:u}=e._zod.bag;if(typeof s=="number"&&(o.minLength=s),typeof r=="number"&&(o.maxLength=r),l&&(o.format=w5e[l]??l,o.format===""&&delete o.format,l==="time"&&delete o.format),u&&(o.contentEncoding=u),a&&a.size>0){const c=[...a];c.length===1?o.pattern=c[0].source:c.length>1&&(o.allOf=[...c.map(d=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},A5e=(e,t,n,i)=>{const o=n,{minimum:s,maximum:r,format:l,multipleOf:a,exclusiveMaximum:u,exclusiveMinimum:c}=e._zod.bag;typeof l=="string"&&l.includes("int")?o.type="integer":o.type="number",typeof c=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.minimum=c,o.exclusiveMinimum=!0):o.exclusiveMinimum=c),typeof s=="number"&&(o.minimum=s,typeof c=="number"&&t.target!=="draft-04"&&(c>=s?delete o.minimum:delete o.exclusiveMinimum)),typeof u=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.maximum=u,o.exclusiveMaximum=!0):o.exclusiveMaximum=u),typeof r=="number"&&(o.maximum=r,typeof u=="number"&&t.target!=="draft-04"&&(u<=r?delete o.maximum:delete o.exclusiveMaximum)),typeof a=="number"&&(o.multipleOf=a)},x5e=(e,t,n,i)=>{n.type="boolean"},S5e=(e,t,n,i)=>{n.not={}},_5e=(e,t,n,i)=>{},I5e=(e,t,n,i)=>{const o=e._zod.def,s=Xq(o.entries);s.every(r=>typeof r=="number")&&(n.type="number"),s.every(r=>typeof r=="string")&&(n.type="string"),n.enum=s},M5e=(e,t,n,i)=>{const o=e._zod.def,s=[];for(const r of o.values)if(r===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof r=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(r))}else s.push(r);if(s.length!==0)if(s.length===1){const r=s[0];n.type=r===null?"null":typeof r,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[r]:n.const=r}else s.every(r=>typeof r=="number")&&(n.type="number"),s.every(r=>typeof r=="string")&&(n.type="string"),s.every(r=>typeof r=="boolean")&&(n.type="boolean"),s.every(r=>r===null)&&(n.type="null"),n.enum=s},T5e=(e,t,n,i)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},E5e=(e,t,n,i)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},L5e=(e,t,n,i)=>{const o=n,s=e._zod.def,{minimum:r,maximum:l}=e._zod.bag;typeof r=="number"&&(o.minItems=r),typeof l=="number"&&(o.maxItems=l),o.type="array",o.items=ps(s.element,t,{...i,path:[...i.path,"items"]})},N5e=(e,t,n,i)=>{const o=n,s=e._zod.def;o.type="object",o.properties={};const r=s.shape;for(const u in r)o.properties[u]=ps(r[u],t,{...i,path:[...i.path,"properties",u]});const l=new Set(Object.keys(r)),a=new Set([...l].filter(u=>{const c=s.shape[u]._zod;return t.io==="input"?c.optin===void 0:c.optout===void 0}));a.size>0&&(o.required=Array.from(a)),s.catchall?._zod.def.type==="never"?o.additionalProperties=!1:s.catchall?s.catchall&&(o.additionalProperties=ps(s.catchall,t,{...i,path:[...i.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},F5e=(e,t,n,i)=>{const o=e._zod.def,s=o.inclusive===!1,r=o.options.map((l,a)=>ps(l,t,{...i,path:[...i.path,s?"oneOf":"anyOf",a]}));s?n.oneOf=r:n.anyOf=r},D5e=(e,t,n,i)=>{const o=e._zod.def,s=ps(o.left,t,{...i,path:[...i.path,"allOf",0]}),r=ps(o.right,t,{...i,path:[...i.path,"allOf",1]}),l=u=>"allOf"in u&&Object.keys(u).length===1,a=[...l(s)?s.allOf:[s],...l(r)?r.allOf:[r]];n.allOf=a},R5e=(e,t,n,i)=>{const o=n,s=e._zod.def;o.type="object";const r=s.keyType,a=r._zod.bag?.patterns;if(s.mode==="loose"&&a&&a.size>0){const c=ps(s.valueType,t,{...i,path:[...i.path,"patternProperties","*"]});o.patternProperties={};for(const d of a)o.patternProperties[d.source]=c}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(o.propertyNames=ps(s.keyType,t,{...i,path:[...i.path,"propertyNames"]})),o.additionalProperties=ps(s.valueType,t,{...i,path:[...i.path,"additionalProperties"]});const u=r._zod.values;if(u){const c=[...u].filter(d=>typeof d=="string"||typeof d=="number");c.length>0&&(o.required=c)}},O5e=(e,t,n,i)=>{const o=e._zod.def,s=ps(o.innerType,t,i),r=t.seen.get(e);t.target==="openapi-3.0"?(r.ref=o.innerType,n.nullable=!0):n.anyOf=[s,{type:"null"}]},P5e=(e,t,n,i)=>{const o=e._zod.def;ps(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType},B5e=(e,t,n,i)=>{const o=e._zod.def;ps(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))},$5e=(e,t,n,i)=>{const o=e._zod.def;ps(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},z5e=(e,t,n,i)=>{const o=e._zod.def;ps(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType;let r;try{r=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=r},j5e=(e,t,n,i)=>{const o=e._zod.def,s=t.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;ps(s,t,i);const r=t.seen.get(e);r.ref=s},H5e=(e,t,n,i)=>{const o=e._zod.def;ps(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType,n.readOnly=!0},AU=(e,t,n,i)=>{const o=e._zod.def;ps(o.innerType,t,i);const s=t.seen.get(e);s.ref=o.innerType},W5e=Ft("ZodISODateTime",(e,t)=>{q3e.init(e,t),xo.init(e,t)});function q5e(e){return Q8e(W5e,e)}const U5e=Ft("ZodISODate",(e,t)=>{U3e.init(e,t),xo.init(e,t)});function V5e(e){return Y8e(U5e,e)}const K5e=Ft("ZodISOTime",(e,t)=>{V3e.init(e,t),xo.init(e,t)});function Z5e(e){return J8e(K5e,e)}const G5e=Ft("ZodISODuration",(e,t)=>{K3e.init(e,t),xo.init(e,t)});function Q5e(e){return X8e(G5e,e)}const Y5e=(e,t)=>{iU.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>Pwe(e,n)},flatten:{value:n=>Owe(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,QA,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,QA,2)}},isEmpty:{get(){return e.issues.length===0}}})},Ka=Ft("ZodError",Y5e,{Parent:Error}),J5e=sS(Ka),X5e=rS(Ka),eCe=X4(Ka),tCe=ew(Ka),nCe=zwe(Ka),iCe=jwe(Ka),oCe=Hwe(Ka),sCe=Wwe(Ka),rCe=qwe(Ka),lCe=Uwe(Ka),aCe=Vwe(Ka),uCe=Kwe(Ka),Ao=Ft("ZodType",(e,t)=>(Co.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Sb(e,"input"),output:Sb(e,"output")}}),e.toJSONSchema=b5e(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Uf(t,{checks:[...t.checks??[],...n.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0}),e.with=e.check,e.clone=(n,i)=>Vf(e,n,i),e.brand=()=>e,e.register=((n,i)=>(n.add(e,i),e)),e.parse=(n,i)=>J5e(e,n,i,{callee:e.parse}),e.safeParse=(n,i)=>eCe(e,n,i),e.parseAsync=async(n,i)=>X5e(e,n,i,{callee:e.parseAsync}),e.safeParseAsync=async(n,i)=>tCe(e,n,i),e.spa=e.safeParseAsync,e.encode=(n,i)=>nCe(e,n,i),e.decode=(n,i)=>iCe(e,n,i),e.encodeAsync=async(n,i)=>oCe(e,n,i),e.decodeAsync=async(n,i)=>sCe(e,n,i),e.safeEncode=(n,i)=>rCe(e,n,i),e.safeDecode=(n,i)=>lCe(e,n,i),e.safeEncodeAsync=async(n,i)=>aCe(e,n,i),e.safeDecodeAsync=async(n,i)=>uCe(e,n,i),e.refine=(n,i)=>e.check(nAe(n,i)),e.superRefine=n=>e.check(iAe(n)),e.overwrite=n=>e.check(Jm(n)),e.optional=()=>vD(e),e.exactOptional=()=>WCe(e),e.nullable=()=>yD(e),e.nullish=()=>vD(yD(e)),e.nonoptional=n=>GCe(e,n),e.array=()=>pi(e),e.or=n=>DCe([e,n]),e.and=n=>PCe(e,n),e.transform=n=>kD(e,jCe(n)),e.default=n=>VCe(e,n),e.prefault=n=>ZCe(e,n),e.catch=n=>YCe(e,n),e.pipe=n=>kD(e,n),e.readonly=()=>eAe(e),e.describe=n=>{const i=e.clone();return h0.add(i,{description:n}),i},Object.defineProperty(e,"description",{get(){return h0.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return h0.get(e);const i=e.clone();return h0.add(i,n[0]),i},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),xU=Ft("_ZodString",(e,t)=>{lS.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(i,o,s)=>C5e(e,i,o);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...i)=>e.check(s5e(...i)),e.includes=(...i)=>e.check(a5e(...i)),e.startsWith=(...i)=>e.check(u5e(...i)),e.endsWith=(...i)=>e.check(c5e(...i)),e.min=(...i)=>e.check(xb(...i)),e.max=(...i)=>e.check(yU(...i)),e.length=(...i)=>e.check(kU(...i)),e.nonempty=(...i)=>e.check(xb(1,...i)),e.lowercase=i=>e.check(r5e(i)),e.uppercase=i=>e.check(l5e(i)),e.trim=()=>e.check(f5e()),e.normalize=(...i)=>e.check(d5e(...i)),e.toLowerCase=()=>e.check(h5e()),e.toUpperCase=()=>e.check(p5e()),e.slugify=()=>e.check(m5e())}),cCe=Ft("ZodString",(e,t)=>{lS.init(e,t),xU.init(e,t),e.email=n=>e.check(T8e(dCe,n)),e.url=n=>e.check(D8e(fCe,n)),e.jwt=n=>e.check(G8e(ICe,n)),e.emoji=n=>e.check(R8e(hCe,n)),e.guid=n=>e.check(dD(mD,n)),e.uuid=n=>e.check(E8e(Vy,n)),e.uuidv4=n=>e.check(L8e(Vy,n)),e.uuidv6=n=>e.check(N8e(Vy,n)),e.uuidv7=n=>e.check(F8e(Vy,n)),e.nanoid=n=>e.check(O8e(pCe,n)),e.guid=n=>e.check(dD(mD,n)),e.cuid=n=>e.check(P8e(mCe,n)),e.cuid2=n=>e.check(B8e(gCe,n)),e.ulid=n=>e.check($8e(vCe,n)),e.base64=n=>e.check(V8e(xCe,n)),e.base64url=n=>e.check(K8e(SCe,n)),e.xid=n=>e.check(z8e(yCe,n)),e.ksuid=n=>e.check(j8e(kCe,n)),e.ipv4=n=>e.check(H8e(bCe,n)),e.ipv6=n=>e.check(W8e(wCe,n)),e.cidrv4=n=>e.check(q8e(CCe,n)),e.cidrv6=n=>e.check(U8e(ACe,n)),e.e164=n=>e.check(Z8e(_Ce,n)),e.datetime=n=>e.check(q5e(n)),e.date=n=>e.check(V5e(n)),e.time=n=>e.check(Z5e(n)),e.duration=n=>e.check(Q5e(n))});function zt(e){return M8e(cCe,e)}const xo=Ft("ZodStringFormat",(e,t)=>{go.init(e,t),xU.init(e,t)}),dCe=Ft("ZodEmail",(e,t)=>{R3e.init(e,t),xo.init(e,t)}),mD=Ft("ZodGUID",(e,t)=>{F3e.init(e,t),xo.init(e,t)}),Vy=Ft("ZodUUID",(e,t)=>{D3e.init(e,t),xo.init(e,t)}),fCe=Ft("ZodURL",(e,t)=>{O3e.init(e,t),xo.init(e,t)}),hCe=Ft("ZodEmoji",(e,t)=>{P3e.init(e,t),xo.init(e,t)}),pCe=Ft("ZodNanoID",(e,t)=>{B3e.init(e,t),xo.init(e,t)}),mCe=Ft("ZodCUID",(e,t)=>{$3e.init(e,t),xo.init(e,t)}),gCe=Ft("ZodCUID2",(e,t)=>{z3e.init(e,t),xo.init(e,t)}),vCe=Ft("ZodULID",(e,t)=>{j3e.init(e,t),xo.init(e,t)}),yCe=Ft("ZodXID",(e,t)=>{H3e.init(e,t),xo.init(e,t)}),kCe=Ft("ZodKSUID",(e,t)=>{W3e.init(e,t),xo.init(e,t)}),bCe=Ft("ZodIPv4",(e,t)=>{Z3e.init(e,t),xo.init(e,t)}),wCe=Ft("ZodIPv6",(e,t)=>{G3e.init(e,t),xo.init(e,t)}),CCe=Ft("ZodCIDRv4",(e,t)=>{Q3e.init(e,t),xo.init(e,t)}),ACe=Ft("ZodCIDRv6",(e,t)=>{Y3e.init(e,t),xo.init(e,t)}),xCe=Ft("ZodBase64",(e,t)=>{J3e.init(e,t),xo.init(e,t)}),SCe=Ft("ZodBase64URL",(e,t)=>{e8e.init(e,t),xo.init(e,t)}),_Ce=Ft("ZodE164",(e,t)=>{t8e.init(e,t),xo.init(e,t)}),ICe=Ft("ZodJWT",(e,t)=>{i8e.init(e,t),xo.init(e,t)}),SU=Ft("ZodNumber",(e,t)=>{hU.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(i,o,s)=>A5e(e,i,o),e.gt=(i,o)=>e.check(hD(i,o)),e.gte=(i,o)=>e.check(N8(i,o)),e.min=(i,o)=>e.check(N8(i,o)),e.lt=(i,o)=>e.check(fD(i,o)),e.lte=(i,o)=>e.check(L8(i,o)),e.max=(i,o)=>e.check(L8(i,o)),e.int=i=>e.check(gD(i)),e.safe=i=>e.check(gD(i)),e.positive=i=>e.check(hD(0,i)),e.nonnegative=i=>e.check(N8(0,i)),e.negative=i=>e.check(fD(0,i)),e.nonpositive=i=>e.check(L8(0,i)),e.multipleOf=(i,o)=>e.check(pD(i,o)),e.step=(i,o)=>e.check(pD(i,o)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function kn(e){return e5e(SU,e)}const MCe=Ft("ZodNumberFormat",(e,t)=>{o8e.init(e,t),SU.init(e,t)});function gD(e){return t5e(MCe,e)}const TCe=Ft("ZodBoolean",(e,t)=>{s8e.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(n,i,o)=>x5e(e,n,i)});function y2(e){return n5e(TCe,e)}const ECe=Ft("ZodUnknown",(e,t)=>{r8e.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(n,i,o)=>_5e()});function Ts(){return i5e(ECe)}const LCe=Ft("ZodNever",(e,t)=>{l8e.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(n,i,o)=>S5e(e,n,i)});function _U(e){return o5e(LCe,e)}const NCe=Ft("ZodArray",(e,t)=>{a8e.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(n,i,o)=>L5e(e,n,i,o),e.element=t.element,e.min=(n,i)=>e.check(xb(n,i)),e.nonempty=n=>e.check(xb(1,n)),e.max=(n,i)=>e.check(yU(n,i)),e.length=(n,i)=>e.check(kU(n,i)),e.unwrap=()=>e.element});function pi(e,t){return g5e(NCe,e,t)}const FCe=Ft("ZodObject",(e,t)=>{c8e.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(n,i,o)=>N5e(e,n,i,o),Di(e,"shape",()=>t.shape),e.keyof=()=>wo(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Ts()}),e.loose=()=>e.clone({...e._zod.def,catchall:Ts()}),e.strict=()=>e.clone({...e._zod.def,catchall:_U()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>Lwe(e,n),e.safeExtend=n=>Nwe(e,n),e.merge=n=>Fwe(e,n),e.pick=n=>Twe(e,n),e.omit=n=>Ewe(e,n),e.partial=(...n)=>Dwe(MU,e,n[0]),e.required=(...n)=>Rwe(TU,e,n[0])});function Gt(e,t){const n={type:"object",shape:e??{},..._n(t)};return new FCe(n)}const IU=Ft("ZodUnion",(e,t)=>{gU.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(n,i,o)=>F5e(e,n,i,o),e.options=t.options});function DCe(e,t){return new IU({type:"union",options:e,..._n(t)})}const RCe=Ft("ZodDiscriminatedUnion",(e,t)=>{IU.init(e,t),d8e.init(e,t)});function fd(e,t,n){return new RCe({type:"union",options:t,discriminator:e,..._n(n)})}const OCe=Ft("ZodIntersection",(e,t)=>{f8e.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(n,i,o)=>D5e(e,n,i,o)});function PCe(e,t){return new OCe({type:"intersection",left:e,right:t})}const BCe=Ft("ZodRecord",(e,t)=>{h8e.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(n,i,o)=>R5e(e,n,i,o),e.keyType=t.keyType,e.valueType=t.valueType});function aS(e,t,n){return new BCe({type:"record",keyType:e,valueType:t,..._n(n)})}const JA=Ft("ZodEnum",(e,t)=>{p8e.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(i,o,s)=>I5e(e,i,o),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(i,o)=>{const s={};for(const r of i)if(n.has(r))s[r]=t.entries[r];else throw new Error(`Key ${r} not found in enum`);return new JA({...t,checks:[],..._n(o),entries:s})},e.exclude=(i,o)=>{const s={...t.entries};for(const r of i)if(n.has(r))delete s[r];else throw new Error(`Key ${r} not found in enum`);return new JA({...t,checks:[],..._n(o),entries:s})}});function wo(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new JA({type:"enum",entries:n,..._n(t)})}const $Ce=Ft("ZodLiteral",(e,t)=>{m8e.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(n,i,o)=>M5e(e,n,i),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function zn(e,t){return new $Ce({type:"literal",values:Array.isArray(e)?e:[e],..._n(t)})}const zCe=Ft("ZodTransform",(e,t)=>{g8e.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(n,i,o)=>E5e(e,n),e._zod.parse=(n,i)=>{if(i.direction==="backward")throw new Yq(e.constructor.name);n.addIssue=s=>{if(typeof s=="string")n.issues.push($v(s,n.value,t));else{const r=s;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=n.value),r.inst??(r.inst=e),n.issues.push($v(r))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(s=>(n.value=s,n)):(n.value=o,n)}});function jCe(e){return new zCe({type:"transform",transform:e})}const MU=Ft("ZodOptional",(e,t)=>{vU.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(n,i,o)=>AU(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function vD(e){return new MU({type:"optional",innerType:e})}const HCe=Ft("ZodExactOptional",(e,t)=>{v8e.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(n,i,o)=>AU(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function WCe(e){return new HCe({type:"optional",innerType:e})}const qCe=Ft("ZodNullable",(e,t)=>{y8e.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(n,i,o)=>O5e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function yD(e){return new qCe({type:"nullable",innerType:e})}const UCe=Ft("ZodDefault",(e,t)=>{k8e.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(n,i,o)=>B5e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function VCe(e,t){return new UCe({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():tU(t)}})}const KCe=Ft("ZodPrefault",(e,t)=>{b8e.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(n,i,o)=>$5e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function ZCe(e,t){return new KCe({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():tU(t)}})}const TU=Ft("ZodNonOptional",(e,t)=>{w8e.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(n,i,o)=>P5e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function GCe(e,t){return new TU({type:"nonoptional",innerType:e,..._n(t)})}const QCe=Ft("ZodCatch",(e,t)=>{C8e.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(n,i,o)=>z5e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function YCe(e,t){return new QCe({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const JCe=Ft("ZodPipe",(e,t)=>{A8e.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(n,i,o)=>j5e(e,n,i,o),e.in=t.in,e.out=t.out});function kD(e,t){return new JCe({type:"pipe",in:e,out:t})}const XCe=Ft("ZodReadonly",(e,t)=>{x8e.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(n,i,o)=>H5e(e,n,i,o),e.unwrap=()=>e._zod.def.innerType});function eAe(e){return new XCe({type:"readonly",innerType:e})}const tAe=Ft("ZodCustom",(e,t)=>{S8e.init(e,t),Ao.init(e,t),e._zod.processJSONSchema=(n,i,o)=>T5e(e,n)});function nAe(e,t={}){return v5e(tAe,e,t)}function iAe(e){return y5e(e)}const kp=zt().min(1),uS=zt().min(1),k2=zt().min(1),bp=zt().min(1),ga=zt().min(1),oAe=/^[A-Za-z0-9._-]{1,128}$/;function sAe(e){return oAe.test(e)&&e!=="."&&e!==".."}const EU=fd("kind",[Gt({kind:zn("user"),payload:Ts().optional()}),Gt({kind:zn("cron"),taskId:bp.optional(),payload:Ts().optional()}),Gt({kind:zn("task"),taskId:bp,payload:Ts().optional()}),Gt({kind:zn("hook"),payload:Ts().optional()}),Gt({kind:zn("compaction"),payload:Ts().optional()}),Gt({kind:zn("side"),payload:Ts().optional()}),Gt({kind:zn("other"),payload:Ts().optional()})]),rAe=Gt({inputTokens:kn().optional(),outputTokens:kn().optional(),cachedTokens:kn().optional(),cost:kn().optional()}),J0=Gt({inputOther:kn(),output:kn(),inputCacheRead:kn(),inputCacheCreation:kn()}),lAe=Gt({llmFirstTokenLatencyMs:kn().optional(),llmStreamDurationMs:kn().optional(),llmRequestBuildMs:kn().optional(),llmServerFirstTokenMs:kn().optional(),llmServerDecodeMs:kn().optional(),llmClientConsumeMs:kn().optional()}),aAe=Gt({failedAttempt:kn(),nextAttempt:kn(),maxAttempts:kn(),delayMs:kn(),errorName:zt(),errorMessage:zt(),statusCode:kn().optional()}),LU=wo(["queued","running","completed","failed","cancelled"]),uAe=wo(["running","completed","interrupted","failed"]),cAe=Gt({skillName:zt(),skillArgs:zt().optional()}),dAe=Gt({kind:zn("user"),skillActivations:pi(cAe).optional()}),bD={kind:zn("text"),frameId:k2,text:zt(),attachmentIds:pi(zt()).optional(),taskId:bp.optional(),promptIds:pi(zt()).optional()},fAe=fd("role",[Gt({...bD,role:zn("assistant"),origin:_U().optional()}),Gt({...bD,role:zn("user"),origin:dAe.optional()})]),hAe=Gt({kind:zn("thinking"),frameId:k2,text:zt()}),pAe=Gt({agentId:ga,role:wo(["child","member"]).optional()}),mAe=Gt({kind:wo(["stdout","stderr","progress","status","custom"]),text:zt().optional(),percent:kn().optional(),customKind:zt().optional(),customData:Ts().optional()}),gAe=Gt({kind:zn("tool"),frameId:k2,toolCallId:zt(),name:zt(),view:zt().optional(),state:wo(["running","done","error"]),input:Ts().optional(),output:Ts().optional(),display:Ts().optional(),error:zt().optional(),inputText:zt().optional(),progress:mAe.optional(),taskId:bp.optional(),approvalId:zt().optional(),todoId:zt().optional(),agentRefs:pi(pAe).optional()}),cS=Gt({interactionId:zt(),interactionKind:wo(["approval","question"]),toolCallId:zt().optional(),state:wo(["pending","approved","rejected","cancelled","answered","dismissed"]),request:Ts().optional(),response:Ts().optional()}),vAe=Gt({kind:zn("notice"),frameId:k2,level:wo(["error","warning","info"]),source:zt().optional(),message:zt(),detail:Ts().optional()}),NU=fd("kind",[fAe,hAe,gAe,vAe]),FU=Gt({kind:zn("step"),stepId:uS,turnId:kp,ordinal:kn().int(),state:uAe,frames:pi(NU),startedAt:zt().optional(),endedAt:zt().optional(),usage:J0.optional(),finishReason:zt().optional(),timing:lAe.optional(),retry:aAe.optional(),endReason:zt().optional(),endMessage:zt().optional()}),DU=Gt({kind:zn("turn"),turnId:kp,triggerPromptId:zt().min(1).optional(),ordinal:kn().int(),state:LU,origin:EU,prompt:zt().optional(),attachmentIds:pi(zt()).optional(),steps:pi(FU),startedAt:zt().optional(),endedAt:zt().optional(),usage:rAe.optional(),durationMs:kn().optional(),error:zt().optional()}),RU=Gt({kind:zn("marker"),markerId:zt(),marker:zt(),payload:Ts().optional(),at:zt().optional()}),OU=Gt({kind:zn("taskref"),refId:zt(),taskId:bp,at:zt().optional()}),PU=fd("kind",[DU,RU,OU]),dS=Gt({taskId:bp,kind:wo(["shell","subagent","tool","other"]),state:wo(["running","completed","failed","timed_out","killed","lost"]),detached:y2(),description:zt().optional(),agentId:ga.optional(),outputTail:zt(),startedAt:zt().optional(),endedAt:zt().optional(),resultSummary:zt().optional(),error:zt().optional(),stateReason:zt().optional(),usage:J0.optional(),model:zt().optional(),thinkingEffort:zt().optional()}),BU=Gt({objective:zt(),status:wo(["active","paused","blocked","complete"]),completionCriterion:zt().optional(),budgetUsed:kn().optional(),budgetLimit:kn().optional()}),yAe=Gt({plan:Gt({reviewPath:zt().optional(),version:kn().optional()}).optional(),swarm:Gt({trigger:zt().optional()}).optional(),tower:Gt({}).optional()}),kAe=Gt({plan:Gt({reviewPath:zt().optional(),version:kn().optional()}).nullable().optional(),swarm:Gt({trigger:zt().optional()}).nullable().optional(),tower:Gt({}).nullable().optional()}),bAe=fd("kind",[Gt({kind:zn("idle")}),Gt({kind:zn("running"),turnId:kn(),step:kn(),stepId:zt(),since:kn()}),Gt({kind:zn("streaming"),turnId:kn(),step:kn(),stepId:zt(),stream:wo(["assistant","thinking","tool_call"]),toolCallId:zt().optional(),toolName:zt().optional(),since:kn()}),Gt({kind:zn("tool_call"),turnId:kn(),step:kn(),toolCallId:zt(),name:zt(),since:kn()}),Gt({kind:zn("retrying"),turnId:kn(),step:kn(),stepId:zt(),failedAttempt:kn(),nextAttempt:kn(),maxAttempts:kn(),delayMs:kn(),errorName:zt().optional(),statusCode:kn().optional(),since:kn()}),Gt({kind:zn("awaiting_approval"),turnId:kn(),step:kn().optional(),approval:Ts().optional(),since:kn()}),Gt({kind:zn("interrupted"),turnId:kn(),step:kn().optional(),reason:wo(["aborted","max_steps","error"]),message:zt().optional(),at:kn()}),Gt({kind:zn("ended"),turnId:kn(),reason:wo(["completed","cancelled","failed","blocked"]),durationMs:kn().optional(),at:kn()})]),wAe=Gt({byModel:aS(zt(),J0).optional(),currentTurn:J0.optional(),total:J0.optional()}),CAe=Gt({model:zt().optional(),thinkingEffort:zt().optional(),usage:wAe.optional(),contextTokens:kn().optional(),maxContextTokens:kn().optional(),contextUsage:kn().optional(),permission:wo(["manual","yolo","auto"]).optional(),phase:bAe.optional()}),fS=Gt({goal:BU.optional(),modes:yAe.optional(),activity:wo(["idle","turn","disposing","unknown"]).optional(),agent:CAe.optional()}),AAe=fS.extend({goal:BU.nullable().optional(),modes:kAe.optional()}),nw=Gt({attachmentId:zt(),mediaType:zt(),name:zt().optional(),size:kn().optional(),source:fd("kind",[Gt({kind:zn("url"),url:zt()}),Gt({kind:zn("file"),fileId:zt()}),Gt({kind:zn("session_media"),fileId:zt()})]).optional(),placeholder:zt().optional()}),xAe=Gt({title:zt(),status:wo(["pending","in_progress","done"])}),hS=Gt({todoId:zt(),items:pi(xAe),updatedAt:zt().optional()}),pS=Gt({promptId:zt(),status:wo(["running","queued","blocked","completed","failed","aborted"]),userMessageId:zt().optional(),content:Ts().optional(),createdAt:zt(),finishedAt:zt().optional(),steeredAt:zt().optional()}),$U=Gt({items:pi(PU),tasks:pi(dS),interactions:pi(cS).default([]),attachments:pi(nw).default([]),todos:pi(hS).default([]),prompts:pi(pS).default([]),meta:fS,hasMoreOlder:y2().optional()}),SAe=DU.omit({steps:!0}),_Ae=FU.omit({frames:!0}),IAe=fd("type",[Gt({type:zn("frame"),turnId:kp,stepId:uS,frameId:k2}),Gt({type:zn("task"),taskId:bp})]),mS=fd("op",[Gt({op:zn("reset"),agentId:ga,snapshot:$U}),Gt({op:zn("turn.upsert"),turn:SAe}),Gt({op:zn("step.upsert"),turnId:kp,step:_Ae}),Gt({op:zn("frame.upsert"),turnId:kp,stepId:uS,frame:NU}),Gt({op:zn("append"),target:IAe,offset:kn().int().nonnegative(),text:zt()}),Gt({op:zn("marker.upsert"),item:RU,beforeTurn:kn().int().optional()}),Gt({op:zn("taskref.upsert"),item:OU,beforeTurn:kn().int().optional()}),Gt({op:zn("task.upsert"),task:dS}),Gt({op:zn("interaction.upsert"),interaction:cS}),Gt({op:zn("attachment.upsert"),attachment:nw}),Gt({op:zn("todo.upsert"),todo:hS}),Gt({op:zn("prompt.upsert"),prompt:pS}),Gt({op:zn("meta.merge"),meta:AAe}),Gt({op:zn("items.remove"),ids:pi(zt())})]);Gt({agentId:ga,ops:pi(mS)});const MAe=wo(["off","turn","block","delta"]),_m=kn().int().nonnegative(),TAe=aS(zt(),MAe);Gt({session_id:zt().min(1),transcript:TAe,transcript_since:aS(zt(),_m).optional()});Gt({agent_id:ga,before_turn:zt().min(1).optional(),after_turn:zt().min(1).optional(),page_size:kn().int().min(1).max(100).optional()}).superRefine((e,t)=>{e.before_turn!==void 0&&e.after_turn!==void 0&&t.addIssue({code:"custom",message:"before_turn and after_turn are mutually exclusive",path:["before_turn"]}),sAe(e.agent_id)||t.addIssue({code:"custom",message:"agent_id must be a plain agent id (no path separators)",path:["agent_id"]})});const EAe=Gt({agentId:ga,type:wo(["main","sub","independent"]).optional(),parentAgentId:ga.optional(),label:zt().optional(),createdAt:zt().optional(),disposedAt:zt().optional()}),LAe=Gt({agent_id:ga,items:pi(PU),has_more:y2(),tasks:pi(dS),interactions:pi(cS).default([]),attachments:pi(nw).default([]),todos:pi(hS).default([]),prompts:pi(pS).default([]),meta:fS,agents:pi(EAe),pending_interactions:pi(zt()),seq:_m.optional()});Gt({agent_id:ga,batches:pi(Gt({seq:_m,ops:pi(mS)})),latest_seq:_m,complete:y2()});const NAe=Gt({turn_id:kp,ordinal:kn().int(),state:LU,origin:EU,prompt:zt(),attachment_ids:pi(zt()).optional(),started_at:zt().optional()});Gt({agents:pi(Gt({agent_id:ga,messages:pi(NAe),attachments:pi(nw).default([])}))});const FAe=Gt({state:wo(["pending","approved","rejected","cancelled"]),selected_option:zt().optional(),feedback:zt().optional()}),DAe=Gt({tool_call_id:zt(),turn_id:kp,source:wo(["interaction","display","output"]),plan:zt(),path:zt().optional(),options:pi(Gt({label:zt(),description:zt().optional()})).optional(),review:FAe.optional()});Gt({agent_id:ga,plans:pi(DAe)});const RAe=Gt({agent_id:ga,snapshot:$U,has_more_older:y2(),seq:_m.optional()}),OAe=Gt({agent_id:ga,ops:pi(mS),seq:_m.optional()}),zU=RAe.extend({type:zn("transcript.reset")}),jU=OAe.extend({type:zn("transcript.ops")});fd("type",[zU,jU]);const wD=new Set(["turn.started","turn.step.started","turn.step.completed","turn.step.retrying","turn.step.interrupted","turn.ended","thinking.delta","assistant.delta","tool.call.started","tool.use","tool.call.delta","tool.progress","tool.result","agent.status.updated","prompt.submitted","prompt.completed","prompt.aborted","session.meta.updated","compaction.started","compaction.completed","compaction.cancelled","goal.updated","error","warning","subagent.spawned","subagent.started","subagent.suspended","subagent.completed","subagent.failed","task.started","task.terminated","background.task.started","background.task.terminated","cron.fired"]),PAe=new Set(["session.created","session.updated","session.deleted","session.status_changed","session.usage_updated","session.history_compacted","message.created","message.updated","approval.requested","approval.resolved","approval.expired","question.requested","question.answered","question.dismissed","task.created","task.progress","task.completed","assistant.tool_use_started","assistant.tool_use_delta","assistant.tool_use_completed","assistant.completed","tool.started","tool.output","tool.completed"]),BAe=new Set(["server_hello","ack","ping","resync_required","error","pong"]),$Ae=new Set(["assistant.delta","thinking.delta"]);function zAe(e,t){if(BAe.has(e))return{route:"ignore"};const n=e.startsWith("event."),i=n?e.slice(6):e;return $Ae.has(i)?jAe(t)?{route:"agent",agentType:i}:{route:"protocol"}:n?PAe.has(i)?{route:"protocol"}:wD.has(i)?{route:"agent",agentType:i}:{route:"protocol"}:wD.has(i)?{route:"agent",agentType:i}:{route:"agent",agentType:i}}function jAe(e){if(!e||typeof e!="object")return!1;const t=e;return"message_id"in t||"content_index"in t?!1:typeof t.delta=="string"}const HAe="kimi-code.bearer.",WAe=3e4;class CD{constructor(t){this.opts=t,this.tracer=t.tracer??eS}ws=null;connected=!1;closed=!1;subscriptions=new Map;transcriptSubscriptions=new Map;sideChannelAgents=new Map;pendingSubscriptions=[];terminalAttachments=new Map;msgSeq=0;clientHelloId=null;reconnectAttempts=0;reconnectTimer=null;heartbeatMs=3e4;lastActivityAt=0;tracer;connect(){if(this.ws!==null||this.closed)return;this.lastActivityAt=Date.now(),this.tracer.wsEvent?.({kind:"lifecycle",event:"connect",detail:{url:this.opts.wsUrl,attempt:this.reconnectAttempts}});const t=this.opts.credentialStore?.getToken(),n=t!==void 0?[`${HAe}${t}`]:void 0,i=new WebSocket(this.opts.wsUrl,n);this.ws=i,i.onopen=()=>{this.tracer.wsEvent?.({kind:"lifecycle",event:"open"})},i.onmessage=o=>{this.lastActivityAt=Date.now();try{const s=JSON.parse(String(o.data));this.tracer.wsEvent?.({kind:"in",frame:s}),this.handleFrame(s)}catch(s){this.tracer.wsEvent?.({kind:"lifecycle",event:"parse-error",detail:{error:String(s)}}),this.opts.handlers.onError(0,`Failed to parse WS frame: ${String(s)}`,!1)}},i.onerror=()=>{this.tracer.wsEvent?.({kind:"lifecycle",event:"error"}),this.opts.handlers.onError(0,"WebSocket error",!1)},i.onclose=o=>{this.tracer.wsEvent?.({kind:"lifecycle",event:"close",detail:o?{code:o.code,reason:o.reason,wasClean:o.wasClean}:void 0}),this.connected=!1,this.ws=null,this.opts.handlers.onConnectionState(!1),this.scheduleReconnect()}}scheduleReconnect(){if(this.closed||this.reconnectTimer!==null)return;const n=Math.min(3e4,1e3*2**this.reconnectAttempts)+Math.floor(Math.random()*250);this.reconnectAttempts+=1,this.tracer.wsEvent?.({kind:"lifecycle",event:"reconnect-scheduled",detail:{delayMs:n,attempt:this.reconnectAttempts}}),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},n)}subscribe(t,n={seq:0}){if(this.subscriptions.set(t,{...n}),this.connected)this.sendSubscribe([t],{[t]:n});else{const i=this.pendingSubscriptions.findIndex(o=>o.sessionId===t);i!==-1&&this.pendingSubscriptions.splice(i,1),this.pendingSubscriptions.push({sessionId:t,cursor:{...n}})}}unsubscribe(t){this.subscriptions.delete(t);const n=this.pendingSubscriptions.findIndex(i=>i.sessionId===t);n!==-1&&this.pendingSubscriptions.splice(n,1),this.connected&&this.ws&&this.send({type:"unsubscribe",id:this.nextId(),payload:{session_ids:[t]}})}subscribeTranscript(t,n,i){let o=this.transcriptSubscriptions.get(t);o===void 0&&(o=new Map,this.transcriptSubscriptions.set(t,o)),o.set(n,i!==void 0?{sinceSeq:i}:{}),this.connected&&this.sendTranscriptSubscribe(t,n)}unsubscribeTranscript(t,n){const i=this.transcriptSubscriptions.get(t);if(i!==void 0)if(n===void 0)this.transcriptSubscriptions.delete(t);else{for(const o of n)i.delete(o);i.size===0&&this.transcriptSubscriptions.delete(t)}!this.connected||!this.ws||this.send({type:"unsubscribe_v2",id:this.nextId(),payload:{session_id:t,...n!==void 0?{agent_ids:n}:{}}})}markSideChannelAgent(t,n){if(!this.opts.mainAgentOnly)return;let i=this.sideChannelAgents.get(t);if(i===void 0&&(i=new Set,this.sideChannelAgents.set(t,i)),i.has(n))return;i.add(n);const o=this.subscriptions.get(t);this.connected&&o!==void 0&&this.sendSubscribe([t],{[t]:o})}abort(t,n){!this.connected||!this.ws||this.send({type:"abort",id:this.nextId(),payload:{session_id:t,prompt_id:n}})}terminalAttach(t,n,i){const o=Ky(t,n),s=this.terminalAttachments.get(o),r=i??s?.lastSeq??0;this.terminalAttachments.set(o,{sessionId:t,terminalId:n,lastSeq:r}),!(!this.connected||!this.ws)&&this.sendTerminalAttach(t,n,r)}terminalInput(t,n,i){!this.connected||!this.ws||this.send({type:"terminal_input",id:this.nextId(),payload:{session_id:t,terminal_id:n,data:i}})}terminalResize(t,n,i,o){!this.connected||!this.ws||this.send({type:"terminal_resize",id:this.nextId(),payload:{session_id:t,terminal_id:n,cols:i,rows:o}})}terminalDetach(t,n){this.terminalAttachments.delete(Ky(t,n)),!(!this.connected||!this.ws)&&this.send({type:"terminal_detach",id:this.nextId(),payload:{session_id:t,terminal_id:n}})}terminalClose(t,n){this.terminalAttachments.delete(Ky(t,n)),!(!this.connected||!this.ws)&&this.send({type:"terminal_close",id:this.nextId(),payload:{session_id:t,terminal_id:n}})}close(){this.closed=!0,this.connected=!1,this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.ws&&(this.ws.close(1e3),this.ws=null)}health(){const t=this.ws!==null&&this.ws.readyState===WebSocket.OPEN,n=Math.max(this.heartbeatMs*2,WAe),i=this.lastActivityAt>0&&Date.now()-this.lastActivityAt>n;return{connected:this.connected,open:t,stale:i}}reconnect(){if(this.closed)return;this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null);const t=this.ws;if(t!==null){t.onopen=null,t.onmessage=null,t.onerror=null,t.onclose=null;try{t.close(1e3,"reconnect")}catch{}}const n=this.connected;this.ws=null,this.connected=!1,n&&this.opts.handlers.onConnectionState(!1),this.connect()}handleFrame(t){const n=t,i=t.type;if(i==="transcript.reset"){const o=zU.safeParse({type:i,...n.payload}),s=n.session_id;if(!o.success||typeof s!="string"){this.opts.handlers.onError(0,"Invalid transcript.reset frame",!1);return}const r=o.data;this.opts.handlers.onTranscriptReset?.(s,r.agent_id,{...r.snapshot,hasMoreOlder:r.has_more_older},r.seq);const l=this.transcriptSubscriptions.get(s)?.get(r.agent_id);l!==void 0&&r.seq!==void 0&&(l.sinceSeq=r.seq);return}if(i==="transcript.ops"){const o=jU.safeParse({type:i,...n.payload}),s=n.session_id;if(!o.success||typeof s!="string"){this.opts.handlers.onError(0,"Invalid transcript.ops frame",!1);return}const r=o.data,l=this.opts.handlers.onTranscriptOps?.(s,r.agent_id,r.ops,r.seq),a=this.transcriptSubscriptions.get(s)?.get(r.agent_id);l!==!1&&a!==void 0&&r.seq!==void 0&&(a.sinceSeq=r.seq);return}switch(i){case"server_hello":{const o=n.payload?.heartbeat_ms;typeof o=="number"&&o>0&&(this.heartbeatMs=o),this.onServerHello();break}case"ping":this.send({type:"pong",payload:{nonce:n.payload.nonce}});break;case"resync_required":{const o=n.payload.session_id,s=n.payload.epoch;this.subscriptions.set(o,{seq:n.payload.current_seq,epoch:s}),this.opts.handlers.onResync(o,n.payload.current_seq,s);break}case"error":{const o=n.session_id;typeof o=="string"&&this.opts.handlers.onRawAgentEvent?this.opts.handlers.onRawAgentEvent({type:"error",seq:n.seq,session_id:o,timestamp:n.timestamp,payload:n.payload}):this.opts.handlers.onError(n.payload.code,n.payload.msg,n.payload.fatal);break}case"ack":n.id===this.clientHelloId&&(this.clientHelloId=null,n.code===0&&this.opts.handlers.onReplayComplete?.());break;case"terminal_output":{const o=n.session_id,s=n.terminal_id,r=n.seq,l=Ky(o,s),a=this.terminalAttachments.get(l);a&&this.terminalAttachments.set(l,{...a,lastSeq:Math.max(a.lastSeq,r)});const u=typeof n.payload?.data=="string"?n.payload.data:"";this.opts.handlers.onTerminalOutput?.(o,s,u,r);break}case"terminal_exit":{const o=n.session_id,s=n.terminal_id,r=n.payload?.exit_code,l=typeof r=="number"?r:null;this.opts.handlers.onTerminalExit?.(o,s,l);break}default:{this.trackCursor(n);const o=n.type,s=zAe(o,n.payload);if(s.route==="protocol"){this.opts.handlers.onWireEvent(n);break}if(s.route==="agent"){if(this.opts.handlers.onRawAgentEvent&&typeof n.session_id=="string"){const r=n,l=n;this.opts.handlers.onRawAgentEvent({type:s.agentType,seq:r.seq,session_id:r.session_id,timestamp:r.timestamp,payload:r.payload,...l.volatile!==void 0?{volatile:l.volatile}:{},...l.offset!==void 0?{offset:l.offset}:{}})}break}break}}}onServerHello(){this.connected=!0,this.reconnectAttempts=0,this.opts.handlers.onConnectionState(!0);const t=Array.from(this.subscriptions.keys());for(const o of this.pendingSubscriptions)this.subscriptions.set(o.sessionId,o.cursor),t.includes(o.sessionId)||t.push(o.sessionId);this.pendingSubscriptions.length=0;const n={};for(const[o,s]of this.subscriptions.entries())n[o]=s;const i=this.nextId();this.clientHelloId=i,this.send({type:"client_hello",id:i,payload:{client_id:this.opts.clientId,subscriptions:t,cursors:n,...this.opts.mainAgentOnly?{agent_filter:this.rawAgentFilter(t)}:{}}});for(const o of this.transcriptSubscriptions.keys())this.sendTranscriptSubscribe(o);for(const o of this.terminalAttachments.values())this.sendTerminalAttach(o.sessionId,o.terminalId,o.lastSeq)}sendSubscribe(t,n){this.send({type:"subscribe",id:this.nextId(),payload:{session_ids:t,cursors:n,...this.opts.mainAgentOnly?{agent_filter:this.rawAgentFilter(t)}:{}}})}rawAgentFilter(t){return Object.fromEntries(t.map(n=>[n,["main",...this.sideChannelAgents.get(n)??[]]]))}sendTranscriptSubscribe(t,n){const i=this.transcriptSubscriptions.get(t);if(i===void 0||i.size===0)return;const o={},s={};for(const[r,l]of i)o[r]="delta",l.sinceSeq!==void 0&&(n===void 0||n===r)&&(s[r]=l.sinceSeq);this.send({type:"subscribe_v2",id:this.nextId(),payload:{session_id:t,transcript:o,...Object.keys(s).length>0?{transcript_since:s}:{}}})}sendTerminalAttach(t,n,i){this.send({type:"terminal_attach",id:this.nextId(),payload:{session_id:t,terminal_id:n,since_seq:i>0?i:void 0}})}trackCursor(t){if(t.volatile===!0)return;const n=t.session_id,i=t.seq;if(typeof n!="string"||typeof i!="number")return;const o=this.subscriptions.get(n);if(!o||i<=o.seq&&o.epoch!==void 0)return;const s=typeof t.epoch=="string"?t.epoch:o.epoch;this.subscriptions.set(n,{seq:Math.max(i,o.seq),epoch:s})}send(t){if(!(!this.ws||this.ws.readyState!==WebSocket.OPEN))try{this.ws.send(JSON.stringify(t)),this.tracer.wsEvent?.({kind:"out",frame:t})}catch{}}nextId(){return`c_${++this.msgSeq}`}}function Ky(e,t){return`${e}\0${t}`}async function qAe(e,t,n){const i=await e.get(`/sessions/${encodeURIComponent(t)}/transcript`,{agent_id:n.agentId,before_turn:n.beforeTurn,after_turn:n.afterTurn,page_size:n.pageSize}),o=LAe.parse(i),s={items:o.items,tasks:o.tasks,interactions:o.interactions,attachments:o.attachments,todos:o.todos,prompts:o.prompts,meta:o.meta,hasMoreOlder:o.has_more};return{agentId:o.agent_id,...s,agents:o.agents,pendingInteractions:o.pending_interactions,...o.seq!==void 0?{seq:o.seq}:{}}}const F8=10485760,UAe=5e3,AD=40001;function VAe(e,t){if(e===void 0)return t;let n;const i=/filename\*\s*=\s*UTF-8''([^;]+)/i.exec(e)?.[1]?.trim();if(i!==void 0)try{n=decodeURIComponent(i.replaceAll(/^"|"$/g,""))}catch{return t}else n=/filename\s*=\s*"([^"]*)"/i.exec(e)?.[1]??/filename\s*=\s*([^;]+)/i.exec(e)?.[1]?.trim();return n===void 0||n.length===0||n.length>200||n==="."||n===".."||/[\u0000-\u001F\u007F/\\]/.test(n)||!n.toLowerCase().endsWith(".zip")?t:n}function KAe(e){if(typeof e!="object"||e===null)return{errorName:typeof e};const t=e;return{errorName:typeof t.name=="string"?t.name:"Error",errorCode:typeof t.code=="number"?t.code:void 0,requestId:typeof t.requestId=="string"?t.requestId:void 0,phase:typeof t.phase=="string"?t.phase:void 0,httpStatus:typeof t.status=="number"?t.status:void 0}}function D8(e){return{id:e.id,sessionId:e.session_id,cwd:e.cwd,shell:e.shell,cols:e.cols,rows:e.rows,status:e.status,createdAt:e.created_at,exitedAt:e.exited_at,exitCode:e.exit_code}}function xD(e){return e==="auto_compact"||e==="manual_compact"}class ZAe{constructor(t){this.opts=t,this.tracer=t.tracer??eS,this.http=new UF({origin:t.origin,identity:t.identity,tracer:this.tracer,credentialStore:t.credentialStore}),this.httpV2=new UF({origin:t.origin,identity:t.identity,tracer:this.tracer,credentialStore:t.credentialStore,restBasePath:"/api/v2"})}http;httpV2;tracer;async getHealth(){return{status:"ok",uptimeSec:(await this.http.get("/healthz")).uptime_sec??0}}async getMeta(){const t=await this.http.get("/meta");return{serverVersion:t.server_version,serverId:t.server_id,startedAt:t.started_at,capabilities:t.capabilities,openInApps:Array.isArray(t.open_in_apps)?t.open_in_apps:[],dangerousBypassAuth:t.dangerous_bypass_auth===!0,experimentalFlags:t.experimental_flags??{},backend:t.backend==="v2"?"v2":"v1",webTitle:t.web_title??""}}async listSessions(t){const n={before_id:t?.beforeId,after_id:t?.afterId,page_size:t?.pageSize,busy:t?.busy,include_archive:t?.includeArchive,archived_only:t?.archivedOnly,exclude_empty:t?.excludeEmpty,workspace_id:t?.workspaceId},i=await this.http.get("/sessions",n);return{items:i.items.map(Wu),hasMore:i.has_more}}async listSessionsV2(t){const n={sort:t?.sort,page_size:t?.pageSize,page_token:t?.pageToken,page:t?.page,"meta.updated_after":t?.updatedAfter,"meta.updated_before":t?.updatedBefore,"meta.archived":t?.archived===void 0?void 0:String(t.archived),include:t?.include,"workspace.id":t?.workspaceIds,"activity.status":t?.statuses},i=await this.httpV2.get("/sessions",n);return{items:i.items,hasMore:i.has_more,nextPageToken:i.next_page_token,total:i.total}}async listSessionIdsV2(t){const n={sort:t?.sort,page_size:t?.pageSize,page_token:t?.pageToken,page:t?.page,"meta.updated_after":t?.updatedAfter,"meta.updated_before":t?.updatedBefore,"meta.archived":t?.archived===void 0?void 0:String(t.archived),fields:"id,archived","workspace.id":t?.workspaceIds,"activity.status":t?.statuses},i=await this.httpV2.get("/sessions",n);return{items:i.items,hasMore:i.has_more,nextPageToken:i.next_page_token,total:i.total}}async listSessionGroupsV2(t){const n={view:"by_workspace","group.page_size":t?.groupPageSize,"meta.has_prompt":t?.hasPrompt===void 0?void 0:String(t.hasPrompt),sort:t?.sort,page_size:t?.pageSize,page_token:t?.pageToken,"meta.archived":t?.archived===void 0?void 0:String(t.archived),"workspace.id":t?.workspaceIds,"activity.status":t?.statuses},i=await this.httpV2.get("/sessions",n);return{groups:i.groups,hasMore:i.has_more,nextPageToken:i.next_page_token,total:i.total}}async createSession(t){const n={metadata:t.cwd!==void 0?{cwd:t.cwd}:{}};t.workspaceId!==void 0&&(n.workspace_id=t.workspaceId),t.title!==void 0&&(n.title=t.title),t.model!==void 0&&(n.agent_config={model:t.model});const i=await this.http.post("/sessions",n);return Wu(i)}async getSession(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}`);return Wu(n)}async updateSession(t,n){const i={};n.title!==void 0&&(i.title=n.title),n.cwd!==void 0&&(i.metadata={cwd:n.cwd});const o={};n.model!==void 0&&(o.model=n.model),n.permissionMode!==void 0&&(o.permission_mode=n.permissionMode),n.planMode!==void 0&&(o.plan_mode=n.planMode),n.swarmMode!==void 0&&(o.swarm_mode=n.swarmMode),n.towerMode!==void 0&&(o.tower_mode=n.towerMode),n.towerBase!==void 0&&(o.tower_base=n.towerBase),n.goalObjective!==void 0&&(o.goal_objective=n.goalObjective),n.goalControl!==void 0&&(o.goal_control=n.goalControl),n.thinking!==void 0&&(o.thinking=n.thinking),Object.keys(o).length>0&&(i.agent_config=o);const s=await this.http.post(`/sessions/${encodeURIComponent(t)}/profile`,i);return Wu(s)}async getSessionStatus(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/status`);return{model:n.model&&n.model.length>0?n.model:null,thinkingEffort:n.thinking_level,permission:n.permission,planMode:n.plan_mode===!0,swarmMode:n.swarm_mode===!0,towerMode:n.tower_mode===!0,contextTokens:n.context_tokens??0,maxContextTokens:n.max_context_tokens??0,contextUsage:n.context_usage??0}}async getSessionGoal(t){const n=await this.http.get(`/sessions/${encodeURIComponent(t)}/goal`);return Zq(n)}async getSessionPlans(t,n){const i=await this.http.get(`/sessions/${encodeURIComponent(t)}/transcript/plan`,{agent_id:n.agentId,tool_call_id:n.toolCallId});return i.plans.map(o=>({agentId:i.agent_id,toolCallId:o.tool_call_id,turnId:o.turn_id,source:o.source,plan:o.plan,...o.path!==void 0?{path:o.path}:{},...o.options!==void 0?{options:o.options.map(s=>({label:s.label,...s.description!==void 0?{description:s.description}:{}}))}:{},...o.review!==void 0?{review:{state:o.review.state,...o.review.selected_option!==void 0?{selectedOption:o.review.selected_option}:{},...o.review.feedback!==void 0?{feedback:o.review.feedback}:{}}}:{}}))}async getTurnFileChanges(t,n){const i=await this.http.get(`/sessions/${encodeURIComponent(t)}/file-history/changes`,{turn_id:n});return i.recorded===!1?"unrecorded":i.changes??[]}async getTurnFileContent(t,n,i,o){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/file-history/content`,{turn_id:n,path:i,phase:o})).content??null}async getSessionWarnings(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/warnings`)).warnings??[]}async archiveSession(t){return await this.http.post(`/sessions/${encodeURIComponent(t)}:archive`,{})}async restoreSession(t){const n=await this.http.post(`/sessions/${encodeURIComponent(t)}:restore`,{});return Wu(n)}async archiveSessions(t){return this.httpV2.post("/sessions:archive",{ids:t})}async restoreSessions(t){return this.httpV2.post("/sessions:restore",{ids:t})}async listMessages(t,n){const i={before_id:n?.beforeId,after_id:n?.afterId,page_size:n?.pageSize,role:n?.role},o=await this.http.get(`/sessions/${encodeURIComponent(t)}/messages`,i);return{items:o.items.map(Vq),hasMore:o.has_more}}async getSessionTranscript(t,n){return qAe(this.http,t,n)}async exportSession(t,n,i){const o=n===void 0?0:new TextEncoder().encode(n).byteLength,s=n===void 0||n.length===0?0:n.split(` -`).length,r=`/sessions/${encodeURIComponent(t)}/export`,l={web_log_bytes:o,web_log_entries:s},a=i?.desktop===!0;let u;try{u=await this.http.postZip(r,{web_log:n,...a?{desktop:!0}:{}},l)}catch(d){if(a&&li(d)&&d.code===AD)u=await this.http.postZip(r,{web_log:n},l);else throw d}const c=`${t}.zip`;return{blob:u.blob,fileName:VAe(u.contentDisposition,c)}}async submitPrompt(t,n){const i=Date.now();this.tracer.traceKeyEvent?.("prompt:start",{sessionId:t,contentCount:n.content.length,mediaCount:n.content.filter(o=>o.type==="image"||o.type==="video"||o.type==="file").length});try{const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts`,$4e(n));return this.tracer.traceKeyEvent?.("prompt:accepted",{sessionId:t,promptId:o.prompt_id,status:o.status,durationMs:Date.now()-i}),{promptId:o.prompt_id,userMessageId:o.user_message_id,origin:o.origin,status:o.status}}catch(o){throw this.tracer.traceKeyEvent?.("prompt:failed",{sessionId:t,status:"failed",durationMs:Date.now()-i,...KAe(o)}),o}}async steerPrompts(t,n){const i=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts:steer`,{prompt_ids:n});return{steered:i.steered,promptIds:i.prompt_ids}}async abortPrompt(t,n){const i=await this.http.post(`/sessions/${encodeURIComponent(t)}/prompts/${encodeURIComponent(n)}:abort`,void 0,{allowCodes:[40903]});return{aborted:i.aborted,atSeq:i.at_seq}}async abortSession(t){return{aborted:(await this.http.post(`/sessions/${encodeURIComponent(t)}:abort`,{})).aborted}}async compactSession(t,n){await this.http.post(`/sessions/${encodeURIComponent(t)}:compact`,n?{instruction:n}:{})}async undoSession(t,n=1){await this.http.post(`/sessions/${encodeURIComponent(t)}:undo`,{count:n})}async generateSessionTitle(t,n){try{const i={};n?.force===!0&&(i.force=!0),n?.source!==void 0&&(i.source=n.source);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/title/generate`,i);return typeof o?.title=="string"&&o.title.length>0?o.title:null}catch{return null}}async forkSession(t,n){const i={};n?.title!==void 0&&(i.title=n.title);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}:fork`,i,{timeoutMs:HF});return Wu(o)}async createChildSession(t,n){const i={};n?.title!==void 0&&(i.title=n.title);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/children`,i,{timeoutMs:HF});return Wu(o)}async listChildSessions(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/children`)).items.map(Wu)}async startBtw(t){return{agentId:(await this.http.post(`/sessions/${encodeURIComponent(t)}:btw`,{})).agent_id}}async respondApproval(t,n,i){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/approvals/${encodeURIComponent(n)}`,z4e(i));return{resolved:o.resolved,resolvedAt:o.resolved_at}}async respondQuestion(t,n,i){const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}`,V4e(i));return{resolved:o.resolved,resolvedAt:o.resolved_at}}async dismissQuestion(t,n){return{dismissed:!0,dismissedAt:(await this.http.post(`/sessions/${encodeURIComponent(t)}/questions/${encodeURIComponent(n)}:dismiss`,void 0,{allowCodes:[40909]})).dismissed_at}}async listTasks(t,n){const i={status:n};return(await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks`,i)).items.map(s=>KA(s))}async getTask(t,n,i){const o={with_output:i?.withOutput,output_bytes:i?.outputBytes},s=await this.http.get(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}`,o);return KA(s)}async cancelTask(t,n){return await this.http.post(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}:cancel`)}async detachTask(t,n){return await this.http.post(`/sessions/${encodeURIComponent(t)}/tasks/${encodeURIComponent(n)}:detach`)}async listTerminals(t){return(await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals`)).items.map(D8)}async createTerminal(t,n={}){const i={cwd:n.cwd,shell:n.shell,cols:n.cols,rows:n.rows},o=await this.http.post(`/sessions/${encodeURIComponent(t)}/terminals`,i);return D8(o)}async getTerminal(t,n){const i=await this.http.get(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}`);return D8(i)}async closeTerminal(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/terminals/${encodeURIComponent(n)}:close`)}async listSkills(t){return((await this.http.get(`/sessions/${encodeURIComponent(t)}/skills`)).skills??[]).map(i=>({name:i.name,description:i.description,path:i.path,source:i.source}))}async listSkillsForWorkspace(t){return((await this.http.get(`/workspaces/${encodeURIComponent(t)}/skills`)).skills??[]).map(i=>({name:i.name,description:i.description,path:i.path,source:i.source}))}async activateSkill(t,n,i,o){const s={};i!==void 0&&i.length>0&&(s.args=i),o!==void 0&&o.length>0&&(s.attachments=o.map(Kq));const r=await this.http.post(`/sessions/${encodeURIComponent(t)}/skills/${encodeURIComponent(n)}:activate`,s);return{activated:r.activated,skillName:r.skill_name}}async listCapabilities(){return(await this.http.get("/capabilities")).capabilities??[]}async getCapability(t){return this.http.get(`/capabilities/${encodeURIComponent(t)}`)}async installCapability(t){return this.http.post(`/capabilities/${encodeURIComponent(t)}:install`,{})}async listPlugins(){return(await this.http.get("/plugins")).plugins??[]}async listPluginMarketplace(){return(await this.http.get("/plugins/marketplace")).entries??[]}async installPlugin(t){return this.http.post("/plugins",{source:t})}async setPluginEnabled(t,n){return this.http.post(`/plugins/${encodeURIComponent(t)}:${n?"enable":"disable"}`,{})}async removePlugin(t){return this.http.post(`/plugins/${encodeURIComponent(t)}:remove`,{})}async listDirectory(t,n){const i={};n.path!==void 0&&(i.path=n.path),n.depth!==void 0&&(i.depth=n.depth),n.includeGitStatus!==void 0&&(i.include_git_status=n.includeGitStatus);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:list`,i),s=o.children_by_path?Object.fromEntries(Object.entries(o.children_by_path).map(([r,l])=>[r,l.map(ZF)])):void 0;return{items:o.items.map(ZF),childrenByPath:s,truncated:o.truncated}}async readFile(t,n){const i={path:n.path};n.offset!==void 0&&(i.offset=n.offset),n.length!==void 0&&(i.length=n.length);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:read`,i);return{path:o.path,content:o.content,encoding:o.encoding,size:o.size,truncated:o.truncated,etag:o.etag,mime:o.mime,languageId:o.language_id,lineCount:o.line_count,isBinary:o.is_binary}}async searchFiles(t,n,i){const o={workspace:t,query:n.query};n.limit!==void 0&&(o.limit=n.limit);const s=await this.http.post("/workspace/fs:search",o,{signal:i?.signal});return{items:s.items.map(r=>({path:r.path,name:r.name,kind:r.kind,score:r.score,matchPositions:r.match_positions})),truncated:s.truncated}}async suggestFiles(t,n,i){const o={workspace:t,query:n.query};n.limit!==void 0&&(o.limit=n.limit);const s=await this.http.post("/workspace/fs:suggest",o,{signal:i?.signal});return{items:s.items.map(r=>({path:r.path,name:r.name,kind:r.kind,score:r.score,matchPositions:r.match_positions})),truncated:s.truncated}}async grepFiles(t,n){const i={pattern:n.pattern};n.regex!==void 0&&(i.regex=n.regex),n.caseSensitive!==void 0&&(i.case_sensitive=n.caseSensitive);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:grep`,i);return{files:o.files,filesScanned:o.files_scanned,truncated:o.truncated,elapsedMs:o.elapsed_ms}}async getGitStatus(t,n){const i={};n!==void 0&&(i.paths=n);const o=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:git_status`,i);return{branch:o.branch,ahead:o.ahead,behind:o.behind,entries:o.entries,additions:o.additions,deletions:o.deletions,pullRequest:o.pullRequest??null}}async getFileDiff(t,n){const i=await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:diff`,{path:n});return{path:i.path,diff:i.diff,truncated:i.truncated??!1}}getFileDownloadUrl(t,n){const i=n.split("/").map(o=>encodeURIComponent(o)).join("/");return Jd(this.opts.origin,`/sessions/${encodeURIComponent(t)}/fs/${i}:download`)}async openFile(t,n){const i={path:n.path};return n.line!==void 0&&(i.line=n.line),this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open`,i)}async revealFile(t,n){return this.http.post(`/sessions/${encodeURIComponent(t)}/fs:reveal`,{path:n.path})}async openInApp(t,n,i,o){const s={app_id:n,path:i};o!==void 0&&(s.line=o),await this.http.post(`/sessions/${encodeURIComponent(t)}/fs:open-in`,s)}async listWorkspaces(){try{return((await this.http.get("/workspaces")).items??[]).map(Y0)}catch{return[]}}async addWorkspace(t){const n={root:t.root};t.name!==void 0&&(n.name=t.name);const i=await this.http.post("/workspaces",n);return Y0(i)}async deleteWorkspace(t){await this.http.delete(`/workspaces/${encodeURIComponent(t)}`)}async updateWorkspace(t,n){const i=await this.http.patch(`/workspaces/${encodeURIComponent(t)}`,{name:n.name});return Y0(i)}async browseFs(t){try{const n=await this.http.get("/fs:browse",{path:t});return{path:n.path,parent:n.parent,entries:(n.entries??[]).map(i=>({name:i.name,path:i.path,isDir:i.is_dir}))}}catch{return{path:"",parent:null,entries:[]}}}async getFsHome(){try{const t=await this.http.get("/fs:home");return{home:t.home,recentRoots:t.recent_roots??[]}}catch{return{home:"",recentRoots:[]}}}async listModels(){return(await this.http.get("/models")).items.map(Z4e)}async listProviders(){return(await this.http.get("/providers")).items.map(f1)}async getProvider(t){const n=await this.http.get(`/providers/${encodeURIComponent(t)}`),i=f1(n);return n.api_key!==void 0?{...i,apiKey:n.api_key}:i}async addProvider(t){const n={id:t.id??"",type:t.type,models:(t.models??[]).map(o=>{const s={model:o.model,max_context_size:o.maxContextSize};return o.displayName!==void 0&&(s.display_name=o.displayName),o.capabilities!==void 0&&(s.capabilities=o.capabilities),o.maxOutputSize!==void 0&&(s.max_output_size=o.maxOutputSize),o.supportEfforts!==void 0&&(s.support_efforts=o.supportEfforts),o.adaptiveThinking!==void 0&&(s.adaptive_thinking=o.adaptiveThinking),s})};t.apiKey!==void 0&&(n.api_key=t.apiKey),t.baseUrl!==void 0&&(n.base_url=t.baseUrl),t.defaultModel!==void 0&&(n.default_model=t.defaultModel);const i=await this.http.post("/providers",n);return f1(i)}async updateProvider(t,n){const i={type:n.type,models:(n.models??[]).map(s=>{const r={model:s.model,max_context_size:s.maxContextSize};return s.displayName!==void 0&&(r.display_name=s.displayName),s.capabilities!==void 0&&(r.capabilities=s.capabilities),s.maxOutputSize!==void 0&&(r.max_output_size=s.maxOutputSize),s.supportEfforts!==void 0&&(r.support_efforts=s.supportEfforts),s.adaptiveThinking!==void 0&&(r.adaptive_thinking=s.adaptiveThinking),r})};n.newId!==void 0&&(i.new_id=n.newId),n.apiKey!==void 0&&(i.api_key=n.apiKey),n.baseUrl!==void 0&&(i.base_url=n.baseUrl),n.defaultModel!==void 0&&(i.default_model=n.defaultModel);const o=await this.http.put(`/providers/${encodeURIComponent(t)}`,i);return{provider:f1(o.provider)}}async deleteProvider(t){return await this.http.delete(`/providers/${encodeURIComponent(t)}`),{deleted:t}}async listCatalogProviders(){return(await this.http.get("/catalog/providers")).items.map(GF)}async getCatalogProvider(t){const n=await this.http.get(`/catalog/providers/${encodeURIComponent(t)}`);return GF(n)}async importCatalogProvider(t){const n={catalog_id:t.catalogId};t.apiKey!==void 0&&(n.api_key=t.apiKey),t.baseUrl!==void 0&&(n.base_url=t.baseUrl),t.id!==void 0&&(n.id=t.id);const i=await this.http.post("/providers:import_catalog",n);return{provider:f1(i.provider),modelsImported:i.models_imported}}async importCustomRegistry(t){const n={url:t.url};t.apiKey!==void 0&&(n.api_key=t.apiKey);const i=await this.http.post("/providers:import_registry",n);return{providers:i.providers.map(f1),modelsImported:i.models_imported}}async refreshProvider(t){const n=await this.http.post(`/providers/${encodeURIComponent(t)}:refresh`);return R8(n)}async refreshAllProviders(){const t=await this.http.post("/providers:refresh");return R8(t)}async refreshOAuthProviderModels(){const t=await this.http.post("/providers:refresh_oauth");return R8(t)}async getConfig(){const t=await this.http.get("/config");return ZA(t)}async setConfig(t){const n={},i={providers:"providers",defaultProvider:"default_provider",defaultModel:"default_model",secondaryModel:"secondary_model",models:"models",thinking:"thinking",planMode:"plan_mode",yolo:"yolo",defaultPermissionMode:"default_permission_mode",defaultPlanMode:"default_plan_mode",permission:"permission",hooks:"hooks",services:"services",mergeAllAvailableSkills:"merge_all_available_skills",extraSkillDirs:"extra_skill_dirs",loopControl:"loop_control",background:"background",experimental:"experimental",telemetry:"telemetry",raw:"raw"};for(const[s,r]of Object.entries(t)){const l=i[s];l!==void 0&&(n[l]=r)}const o=await this.http.post("/config",n);return ZA(o)}async getAuth(){const t=await this.http.get("/auth");return{modelsReady:t.models_ready,providersCount:t.providers_count,managedProvider:t.managed_provider?{status:t.managed_provider.status}:null}}async startOAuthLogin(t){let n;try{n=await this.http.post("/oauth/login",t===void 0?{}:{region:t})}catch(i){if(t!==void 0&&li(i)&&i.code===AD)n=await this.http.post("/oauth/login",{});else throw i}return n.status==="authenticated"?{flowId:n.flow_id,provider:n.provider,status:"authenticated"}:{flowId:n.flow_id,provider:n.provider,status:"pending",verificationUri:n.verification_uri,verificationUriComplete:n.verification_uri_complete,userCode:n.user_code,expiresIn:n.expires_in,interval:n.interval,expiresAt:n.expires_at}}async pollOAuthLogin(){const t=await this.http.get("/oauth/login");return t?{flowId:t.flow_id,status:t.status,resolvedAt:t.resolved_at,errorMessage:t.error_message}:null}async cancelOAuthLogin(){const t=await this.http.delete("/oauth/login");return{cancelled:t.cancelled,status:t.status}}async logout(){return{loggedOut:(await this.http.post("/oauth/logout",{})).logged_out}}async getUsage(){const t=await this.http.get("/oauth/usage");if(t.kind==="error")return{kind:"error",message:t.message,status:t.status};const n=i=>({name:i.name,window:i.window,used:i.used,limit:i.limit,resetAt:i.reset_at});return{kind:"ok",summary:t.summary===null?null:n(t.summary),limits:t.limits.map(n),extraUsage:t.extra_usage===null?null:{balanceCents:t.extra_usage.balance_cents,totalCents:t.extra_usage.total_cents,monthlyChargeLimitEnabled:t.extra_usage.monthly_charge_limit_enabled,monthlyChargeLimitCents:t.extra_usage.monthly_charge_limit_cents,monthlyUsedCents:t.extra_usage.monthly_used_cents,currency:t.extra_usage.currency}}}async getUserInfo(){return this.http.get("/oauth/userinfo")}async getOAuthRegion(){try{const t=await Promise.race([this.http.get("/oauth/region"),new Promise((n,i)=>{setTimeout(()=>i(new Error("oauth region probe timed out")),UAe)})]);return t.region==="mainland-cn"||t.region==="global"?t.region:null}catch{return null}}async uploadFile(t){const n=new FormData;n.append("file",t.file,t.name??(t.file instanceof File?t.file.name:"upload")),t.name!==void 0&&n.append("name",t.name);const i=await this.http.postForm("/files",n,t.onProgress===void 0?void 0:{onUploadProgress:t.onProgress});return{id:i.id,name:i.name,mediaType:i.media_type,size:i.size}}getFileUrl(t){return Jd(this.opts.origin,`/files/${encodeURIComponent(t)}`)}async getFileBlob(t){return this.http.getBlob(`/files/${encodeURIComponent(t)}`)}getSessionMediaUrl(t,n){return Jd(this.opts.origin,`/sessions/${encodeURIComponent(t)}/media/${encodeURIComponent(n)}`)}async getSessionMediaBlob(t,n){return this.http.getBlob(`/sessions/${encodeURIComponent(t)}/media/${encodeURIComponent(n)}`)}async readHostFileContent(t){const n=await this.http.getBlob("/fs:content",{path:t},{maxBytes:F8});if(n.size>F8)throw new z7({size:n.size,limit:F8});const i=n.type,o=!GAe(i),s=i||(o?"application/octet-stream":"text/plain");if(o){const l=await QAe(n);return{path:t,content:l,encoding:"base64",mime:s,isBinary:!0,size:n.size}}const r=await n.text();return{path:t,content:r,encoding:"utf-8",mime:s,isBinary:!1,size:n.size}}connectEvents(t){const n=jF(this.opts.origin,this.opts.identity.clientId),i=this.opts.projectorFactory(),o=new CD({wsUrl:n,clientId:this.opts.identity.clientId,tracer:this.tracer,credentialStore:this.opts.credentialStore,mainAgentOnly:this.opts.mainAgentOnly,handlers:{onWireEvent:s=>{const r=G4e(s),l=Q4e(s),a=K4e(s);a.type==="historyCompacted"&&!xD(a.reason)&&t.onResync(a.sessionId,a.beforeSeq),t.onEvent(a,{sessionId:r,seq:l})},onRawAgentEvent:s=>{const{type:r,seq:l,session_id:a,payload:u,offset:c}=s,d=i.project(r,u,a,{offset:c});for(const f of d){const h=u?.turnId,m=f.type==="assistantDelta"&&typeof h=="number"&&typeof c=="number"&&(r==="assistant.delta"||r==="thinking.delta")?{turnId:h,offset:c,kind:r==="assistant.delta"?"text":"thinking"}:void 0;f.type==="historyCompacted"&&!xD(f.reason)&&t.onResync(a,l),t.onEvent(f,{sessionId:a,seq:l,stream:m})}},onResync:(s,r,l)=>{i.reset(s),t.onResync(s,r,l)},onConnectionState:s=>{t.onConnectionChange(s)},onReplayComplete:()=>{t.onReplayComplete?.()},onError:(s,r,l)=>{t.onError(s,r,l)},onTerminalOutput:(s,r,l,a)=>{t.onTerminalOutput?.(s,r,l,a)},onTerminalExit:(s,r,l)=>{t.onTerminalExit?.(s,r,l)},onTranscriptReset:(s,r,l,a)=>{t.onTranscriptReset?.(s,r,l,a)},onTranscriptOps:(s,r,l,a)=>t.onTranscriptOps?.(s,r,l,a)??!0}});return o.connect(),{subscribe(s,r){o.subscribe(s,r??{seq:0})},unsubscribe(s){o.unsubscribe(s),i.forgetSession(s)},subscribeTranscript(s,r,l){o.subscribeTranscript(s,r,l)},unsubscribeTranscript(s,r){o.unsubscribeTranscript(s,r)},bindNextPromptId(s,r){i.bindNextPromptId(s,r)},abort(s,r){o.abort(s,r)},terminalAttach(s,r,l){o.terminalAttach(s,r,l)},terminalInput(s,r,l){o.terminalInput(s,r,l)},terminalResize(s,r,l,a){o.terminalResize(s,r,l,a)},terminalDetach(s,r){o.terminalDetach(s,r)},terminalClose(s,r){o.terminalClose(s,r)},markSideChannelAgent(s,r){o.markSideChannelAgent(s,r),i.markSideChannelAgent(r)},health(){return o.health()},reconnect(){o.reconnect()},close(){o.close()}}}connectTranscriptChannel(t){const n=`${this.opts.identity.clientId}-transcript`,i=new CD({wsUrl:jF(this.opts.origin,n),clientId:n,tracer:this.tracer,credentialStore:this.opts.credentialStore,handlers:{onWireEvent:()=>{},onResync:()=>{},onConnectionState:o=>t.onConnectionState?.(o),onError:(o,s,r)=>t.onError?.(o,s,r),onTranscriptReset:t.onTranscriptReset,onTranscriptOps:t.onTranscriptOps}});return i.connect(),{subscribe:()=>{},unsubscribe:()=>{},subscribeTranscript:(o,s,r)=>i.subscribeTranscript(o,s,r),unsubscribeTranscript:(o,s)=>i.unsubscribeTranscript(o,s),bindNextPromptId:()=>{},abort:()=>{},terminalAttach:()=>{},terminalInput:()=>{},terminalResize:()=>{},terminalDetach:()=>{},terminalClose:()=>{},markSideChannelAgent:()=>{},health:()=>i.health(),reconnect:()=>i.reconnect(),close:()=>i.close()}}}function R8(e){return{changed:e.changed.map(t=>({providerId:t.provider_id,providerName:t.provider_name,added:t.added,removed:t.removed})),unchanged:e.unchanged,failed:e.failed}}function GAe(e){const t=e.toLowerCase().split(";")[0].trim();return t===""||t==="text/plain"||t.startsWith("text/")?!0:/(json|xml|javascript|typescript|x-yaml|yaml|svg|x-sh|x-python|markdown|csv|html|css)$/.test(t)}function QAe(e){return new Promise((t,n)=>{const i=new FileReader;i.onload=()=>{const o=typeof i.result=="string"?i.result:"";t(o.slice(o.indexOf(",")+1))},i.onerror=()=>n(i.error),i.readAsDataURL(e)})}const YAe="main",JAe=new Set(["turn.started","turn.step.started","turn.step.completed","turn.step.retrying","turn.step.interrupted","turn.ended","thinking.delta","assistant.delta","tool.use","tool.call.started","tool.call.delta","tool.progress","tool.result","agent.status.updated","prompt.completed","prompt.aborted","error"]);function O8(e="msg_"){const t=Date.now().toString(36).padStart(10,"0"),n=Math.random().toString(36).slice(2,12).padEnd(10,"0");return`${e}${t}${n}`}function XAe(e){if(!e||typeof e!="object")return{input:0,output:0,cacheRead:0,cacheCreate:0};const t=e;return{input:t.inputOther??t.input_tokens??0,output:t.output??t.output_tokens??0,cacheRead:t.inputCacheRead??t.cache_read_input_tokens??0,cacheCreate:t.inputCacheCreation??t.cache_creation_input_tokens??0}}function SD(){return{turnPromptId:new Map,currentPromptId:void 0,totalInput:0,totalOutput:0,totalCacheRead:0,totalCacheCreate:0,contextTokens:0,contextLimit:0,turnCount:0,model:"",subagentMeta:new Map,restartedThisRun:new Set,settledByKernel:new Set,retiredBindings:new Set,registrationSeq:0,registrationOrderByKey:new Map,retryActive:!1}}function _r(e,t){const n=e[t];return typeof n=="string"?n:void 0}function nr(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:void 0}function _a(e,t){const n=e[t];return typeof n=="number"&&Number.isFinite(n)?n:null}function e6e(e){if(!e||typeof e!="object")return null;const t=e,n=t.budget,i=n&&typeof n=="object"?n:{},o=_r(t,"status");if(o!=="active"&&o!=="paused"&&o!=="blocked"&&o!=="complete")return null;const s=_r(t,"goalId")??_r(t,"goal_id")??"goal",r=_r(t,"objective")??"";return{goalId:s,objective:r,completionCriterion:_r(t,"completionCriterion")??_r(t,"completion_criterion"),status:o,turnsUsed:nr(t,"turnsUsed")??nr(t,"turns_used")??0,tokensUsed:nr(t,"tokensUsed")??nr(t,"tokens_used")??0,wallClockMs:nr(t,"wallClockMs")??nr(t,"wall_clock_ms")??0,terminalReason:_r(t,"terminalReason")??_r(t,"terminal_reason"),budget:{tokenBudget:_a(i,"tokenBudget")??_a(i,"token_budget"),remainingTokens:_a(i,"remainingTokens")??_a(i,"remaining_tokens"),turnBudget:_a(i,"turnBudget")??_a(i,"turn_budget"),remainingTurns:_a(i,"remainingTurns")??_a(i,"remaining_turns"),wallClockBudgetMs:_a(i,"wallClockBudgetMs")??_a(i,"wall_clock_budget_ms"),remainingWallClockMs:_a(i,"remainingWallClockMs")??_a(i,"remaining_wall_clock_ms"),overBudget:i.overBudget===!0||i.over_budget===!0}}}function Wd(e,t,n,i,o){if(typeof i!="string"||i.length===0)return null;const r={...t.subagentMeta.get(i)??{id:i,agentId:i,sessionId:n,kind:"subagent",description:e("tasks.dockSubagent"),status:"running",createdAt:new Date().toISOString(),subagentPhase:"queued"},...o,id:i,sessionId:n,kind:"subagent"};return t.subagentMeta.set(i,r),r}function t6e(e,t,n){if(t==="turn.step.started")return null;if(t==="tool.use"||t==="tool.call.started"){const i=_r(n,"name")??_r(n,"toolName")??"tool",o=Ez(e,n6e(i)),s=i6e(e,i,n.args??n.input);return s?`Calling ${o}: ${s}`:`Calling ${o}`}if(t==="tool.progress"){const i=n.update;if(i&&typeof i=="object"){const s=_r(i,"text");if(s)return P8(s);const r=_r(i,"message");if(r)return P8(r)}const o=_r(n,"message");if(o)return P8(o)}return null}function n6e(e){return e.replace(/_\d+$/,"")}const _D=2e3;function P8(e){return e.length>_D?`${e.slice(0,_D)}…`:e}function i6e(e,t,n){if(n==null)return"";const i=typeof n=="string"?n:JSON.stringify(n);return $7(e,t,i)}function o6e(e,t,n,i,o,s,r){if(r.has(i)&&o==="turn.step.started")return[];if(o==="assistant.delta"){const h=_r(s,"delta");if(!h)return[];const m=t.subagentMeta.get(i),g=Wd(e,t,n,i,{status:"running",subagentPhase:"working",startedAt:m?.startedAt??new Date().toISOString()}),y=[];return g&&y.push({type:"taskCreated",sessionId:n,task:g}),y.push({type:"taskProgress",sessionId:n,taskId:i,outputChunk:h,stream:"stdout",kind:"text"}),y}const l=t6e(e,o,s);if(l===null||l.length===0)return[];const a=o==="tool.progress"?s.update:void 0,u=a!=null&&typeof a=="object"?a.replace===!0:!1,c=t.subagentMeta.get(i),d=Wd(e,t,n,i,{status:"running",subagentPhase:"working",startedAt:c?.startedAt??new Date().toISOString()}),f=[];return d&&f.push({type:"taskCreated",sessionId:n,task:d}),f.push({type:"taskProgress",sessionId:n,taskId:i,outputChunk:l,stream:"stdout",replace:u}),f}function s6e(e){return Array.isArray(e)?e.map(t=>Q4(t)):[]}function r6e(e){return{inputTokens:e.totalInput,outputTokens:e.totalOutput,cacheReadTokens:e.totalCacheRead,cacheCreationTokens:e.totalCacheCreate,totalCostUsd:0,contextTokens:e.contextTokens,contextLimit:e.contextLimit,turnCount:e.turnCount}}const l6e=new Set(["session.meta.updated","goal.updated","compaction.completed","compaction.started","compaction.cancelled","compaction.blocked","hook.result","mcp.server.status","skill.activated","tool.list.updated"]);function a6e(e,t,n){switch(e){case"session.meta.updated":{const i=t?.patch?.title??t?.title,o=t?.patch?.lastPrompt,s={};return typeof i=="string"&&i.length>0&&(s.title=i),typeof o=="string"&&(s.lastPrompt=o),s.title!==void 0||s.lastPrompt!==void 0?[{type:"sessionMetaUpdated",sessionId:n,...s}]:[]}case"goal.updated":{const i=e6e(t?.snapshot??null);return[{type:"goalUpdated",sessionId:n,goal:i?.status==="complete"?null:i}]}case"compaction.completed":{const i=t?.result??{};return[{type:"compactionCompleted",sessionId:n,tokensBefore:typeof i.tokensBefore=="number"?i.tokensBefore:void 0,tokensAfter:typeof i.tokensAfter=="number"?i.tokensAfter:void 0,summary:typeof i.summary=="string"?i.summary:void 0},{type:"historyCompacted",sessionId:n,beforeSeq:0,reason:"auto_compact"}]}case"compaction.started":return[{type:"compactionStarted",sessionId:n,trigger:t?.trigger==="manual"?"manual":"auto",instruction:typeof t?.instruction=="string"?t.instruction:void 0}];case"compaction.cancelled":return[{type:"compactionCancelled",sessionId:n}];default:return[]}}function u6e(e){const{t}=e,n=new Map,i=new Set;function o(f){let h=n.get(f);return h||(h=SD(),n.set(f,h)),h}function s(f){n.set(f,SD())}function r(f){n.delete(f)}function l(f){return n.has(f)}function a(f){i.add(f)}function u(f,h){const m=o(f);m.currentPromptId=h}function c(f,h,m,g){try{return d(f,h,m,g)}catch(y){return Gu("[agentProjector] Error projecting event:",f,y instanceof Error?y.message:y),[]}}function d(f,h,m,g){if(l6e.has(f))return a6e(f,h,m);const y=o(m),k=h,v=[],C=k?.agentId;if(typeof C=="string"&&C!==YAe){const w=i.has(C);if(f==="prompt.submitted"){if(!w)return[];const M=k?.promptId,L=k?.userMessageId;if(!M||!L)return[];const E=s6e(k?.content);return E.length===0?[]:[{type:"messageCreated",agentId:C,message:{id:L,sessionId:m,role:"user",content:E,createdAt:typeof k?.createdAt=="string"?k.createdAt:new Date().toISOString(),promptId:M}}]}if(w&&(f==="thinking.delta"||f==="assistant.delta")){const M=k?.delta??"";return M?[{type:"agentDelta",sessionId:m,agentId:C,delta:{[f==="thinking.delta"?"thinking":"text"]:M}}]:[]}if(w&&f==="turn.ended")return[{type:"agentTurnEnded",sessionId:m,agentId:C,reason:k?.reason}];if(JAe.has(f))return o6e(t,y,m,C,f,k??{},i)}switch(f){case"turn.started":{const w=k?.turnId,M=y.currentPromptId??O8("pr_");y.currentPromptId=M,w!==void 0&&y.turnPromptId.set(w,M),v.push({type:"turnActiveChanged",sessionId:m,active:!0});break}case"turn.step.started":case"thinking.delta":case"assistant.delta":case"tool.use":case"tool.call.started":case"tool.call.delta":case"tool.progress":case"tool.result":break;case"turn.step.completed":{const w=XAe(k?.usage);y.totalInput+=w.input,y.totalOutput+=w.output,y.totalCacheRead+=w.cacheRead,y.totalCacheCreate+=w.cacheCreate;break}case"agent.status.updated":{k?.model&&(y.model=k.model),k?.contextTokens!==void 0&&(y.contextTokens=k.contextTokens),k?.maxContextTokens!==void 0&&(y.contextLimit=k.maxContextTokens);const w=k?.phase;w!=null&&w.kind==="retrying"?(y.retryActive=!0,v.push({type:"turnRetry",sessionId:m,retry:{failedAttempt:nr(w,"failedAttempt")??0,nextAttempt:nr(w,"nextAttempt")??0,maxAttempts:nr(w,"maxAttempts")??0,delayMs:nr(w,"delayMs")??0,errorName:_r(w,"errorName"),statusCode:nr(w,"statusCode"),turnId:nr(w,"turnId")}})):y.retryActive&&w!==void 0&&w!==null&&typeof w.kind=="string"&&(y.retryActive=!1,v.push({type:"turnRetry",sessionId:m,retry:void 0})),v.push({type:"sessionUsageUpdated",sessionId:m,usage:r6e(y),model:y.model||void 0,swarmMode:k?.swarmMode===!0?!0:k?.swarmMode===!1?!1:void 0,towerMode:k?.towerMode===!0?!0:k?.towerMode===!1?!1:void 0,planMode:k?.planMode===!0?!0:k?.planMode===!1?!1:void 0,thinking:typeof k?.thinkingEffort=="string"&&k.thinkingEffort.length>0?k.thinkingEffort:void 0});break}case"turn.ended":{const w=k?.turnId,M=(w!==void 0?y.turnPromptId.get(w):void 0)??y.currentPromptId;v.push({type:"turnActiveChanged",sessionId:m,active:!1,reason:k?.reason,promptId:M}),y.turnCount++,y.currentPromptId=void 0;break}case"prompt.completed":{const w=k?.promptId;typeof w=="string"&&w.length>0&&v.push({type:"promptCompleted",sessionId:m,promptId:w,reason:k?.reason??"completed"});break}case"prompt.aborted":{const w=k?.promptId;typeof w=="string"&&w.length>0&&v.push({type:"promptAborted",sessionId:m,promptId:w});break}case"turn.step.retrying":{y.retryActive=!0,v.push({type:"turnRetry",sessionId:m,retry:{failedAttempt:nr(k??{},"failedAttempt")??0,nextAttempt:nr(k??{},"nextAttempt")??0,maxAttempts:nr(k??{},"maxAttempts")??0,delayMs:nr(k??{},"delayMs")??0,errorName:_r(k??{},"errorName"),statusCode:nr(k??{},"statusCode"),turnId:typeof k?.turnId=="number"?k.turnId:void 0}});break}case"turn.step.interrupted":break;case"subagent.spawned":{const w=typeof k?.subagentId=="string"&&k.subagentId.length>0?k.subagentId:O8("task_"),M=typeof k?.taskId=="string"&&k.taskId.length>0?k.taskId:void 0,L=M!==void 0&&M!==w?y.subagentMeta.get(M):void 0,E=y.subagentMeta.get(w);L!==void 0&&y.subagentMeta.delete(M),M!==void 0&&!y.registrationOrderByKey.has(M)&&y.registrationOrderByKey.set(M,++y.registrationSeq);const S=E===void 0||L===void 0?E??L:{...E,createdAt:L.createdAt,startedAt:L.startedAt??E.startedAt,runInBackground:!0,backgroundTaskId:E.backgroundTaskId??M},x=S?.backgroundTaskId??(S!==void 0&&M!==void 0&&S.id===M?M:void 0),A=M!==void 0?y.registrationOrderByKey.get(M):void 0,T=x!==void 0?y.registrationOrderByKey.get(x):void 0,I=y.retiredBindings.has(M??"")||A!==void 0&&T!==void 0&&A0?k.model:S?.model,thinkingEffort:typeof k?.thinkingEffort=="string"&&k.thinkingEffort.length>0?k.thinkingEffort:S?.thinkingEffort,parentToolCallId:typeof k?.parentToolCallId=="string"?k.parentToolCallId:S?.parentToolCallId,swarmIndex:typeof k?.swarmIndex=="number"?k.swarmIndex:S?.swarmIndex,runInBackground:O?k?.runInBackground===!0||k?.runInBackground===void 0&&S?.runInBackground===!0:k?.runInBackground===!0||S?.runInBackground===!0,outputPreview:O?void 0:S?.outputPreview,outputBytes:O?void 0:S?.outputBytes,outputLines:O?void 0:S?.outputLines,suspendedReason:O?void 0:S?.suspendedReason,text:O?void 0:S?.text,backgroundTaskId:I?S?.backgroundTaskId:O?M:M??S?.backgroundTaskId};y.subagentMeta.set(R.id,R),v.push({type:"taskCreated",sessionId:m,task:R});break}case"subagent.started":{const w=typeof k?.subagentId=="string"?k.subagentId:void 0,M=w!==void 0&&(y.subagentMeta.get(w)?.status!==void 0&&y.subagentMeta.get(w).status!=="running"||y.settledByKernel.has(w));M&&y.settledByKernel.delete(w);const L=Wd(t,y,m,k?.subagentId,{subagentPhase:"working",status:"running",startedAt:new Date().toISOString(),suspendedReason:void 0,...M?{createdAt:new Date().toISOString(),completedAt:void 0,completedAtEstimated:void 0,outputPreview:void 0,outputBytes:void 0,outputLines:void 0,text:void 0}:{}});M&&w!==void 0&&y.restartedThisRun.add(w),L&&v.push({type:"taskCreated",sessionId:m,task:L});break}case"subagent.suspended":{const w=Wd(t,y,m,k?.subagentId,{subagentPhase:"suspended",status:"running",suspendedReason:typeof k?.reason=="string"?k.reason:void 0});w&&v.push({type:"taskCreated",sessionId:m,task:w});break}case"subagent.completed":{const w=typeof k?.resultSummary=="string"?k.resultSummary:void 0,M=Wd(t,y,m,k?.subagentId,{subagentPhase:"completed",status:"completed",completedAt:new Date().toISOString(),completedAtEstimated:!0,outputPreview:w});M&&v.push({type:"taskCreated",sessionId:m,task:M}),M!==null&&y.restartedThisRun.delete(M.id),v.push({type:"taskCompleted",sessionId:m,taskId:k?.subagentId??"",status:"completed",outputPreview:w});break}case"subagent.failed":{const w=typeof k?.error=="string"?k.error:void 0,M=Wd(t,y,m,k?.subagentId,{subagentPhase:"failed",status:"failed",completedAt:new Date().toISOString(),completedAtEstimated:!0,outputPreview:w});M&&v.push({type:"taskCreated",sessionId:m,task:M}),M!==null&&y.restartedThisRun.delete(M.id),v.push({type:"taskCompleted",sessionId:m,taskId:k?.subagentId??"",status:"failed",outputPreview:w});break}case"error":{v.push({type:"unknown",raw:{_agentError:!0,code:k?.code,message:k?.message,name:k?.name,details:k?.details,retryable:k?.retryable}});break}case"warning":{v.push({type:"unknown",raw:{_agentWarning:!0,message:k?.message}});break}case"task.started":case"background.task.started":{const w=k?.info??{},M=typeof w.startedAt=="number"?new Date(w.startedAt).toISOString():void 0,L=typeof w.taskId=="string"?w.taskId:typeof w.taskId=="number"?String(w.taskId):O8("task_"),E=typeof w.description=="string"?w.description:typeof w.command=="string"?w.command:t("tasks.defaultDescription");if(w.kind==="agent"){const x=typeof w.agentId=="string"&&w.agentId.length>0?w.agentId:void 0;if(x!==void 0){const A=y.subagentMeta.get(x),T=y.registrationOrderByKey.get(L),I=A?.backgroundTaskId!==void 0?y.registrationOrderByKey.get(A.backgroundTaskId):void 0;if(y.retiredBindings.has(L)||T!==void 0&&I!==void 0&&TI.backgroundTaskId===L);if(A===void 0&&(y.retiredBindings.has(L)||y.registrationOrderByKey.has(L)&&y.registrationOrderByKey.get(L)0&&y.settledByKernel.add(w.agentId),v.push({type:"taskCompleted",sessionId:m,taskId:typeof w.taskId=="string"?w.taskId:typeof w.taskId=="number"?String(w.taskId):"",status:w.status==="killed"?"cancelled":M?"failed":"completed"});break}}return v}return{project:c,bindNextPromptId:u,reset:s,forgetSession:r,markSideChannelAgent:a,hasSessionState:l}}function c6e(e){return new ZAe({origin:e.origin,identity:e.identity,tracer:e.tracer,credentialStore:e.credentialStore,projectorFactory:()=>u6e({t:e.t}),mainAgentOnly:e.mainAgentOnly})}const d6e={t:e=>e},ID="Sub Agent";function f6e(){return{sessions:[],activeSessionId:void 0,approvalsBySession:{},planReviewByToolCallId:{},questionsBySession:{},tasksBySession:{},goalBySession:{},goalVersionBySession:{},lastSeqBySession:{},turnActiveBySession:{},turnErrorBySession:{},turnRetryBySession:{},compactionBySession:{},warnings:[]}}function h6e(e){return{...e,sessions:e.sessions,approvalsBySession:{...e.approvalsBySession},planReviewByToolCallId:{...e.planReviewByToolCallId},questionsBySession:{...e.questionsBySession},tasksBySession:{...e.tasksBySession},goalBySession:{...e.goalBySession},goalVersionBySession:{...e.goalVersionBySession},lastSeqBySession:{...e.lastSeqBySession},turnActiveBySession:{...e.turnActiveBySession},turnErrorBySession:{...e.turnErrorBySession},turnRetryBySession:{...e.turnRetryBySession},compactionBySession:{...e.compactionBySession},warnings:[...e.warnings]}}function p6e(e,t,n){if(t!==void 0&&n!==void 0&&n>0){const i=e.lastSeqBySession[t]??0;n>i&&(e.lastSeqBySession[t]=n)}}function Zy(e,t){const n=e.sessions.find(i=>i.id===t.sessionId)?.lastSeq??0;return t.seq>Math.max(e.lastSeqBySession[t.sessionId]??0,n)}const m6e={"provider.connection_error":"connection","provider.auth_error":"auth","provider.rate_limit":"rateLimit","provider.overloaded":"overloaded","provider.filtered":"filtered","provider.api_error":"api","context.overflow":"contextOverflow"};function XA(e,t){const n=[],i=(r,l)=>{typeof l=="number"||typeof l=="boolean"?n.push({label:r,value:String(l)}):typeof l=="string"&&l.length>0&&n.push({label:r,value:l})};i(t("warnings.details.code"),e.code);const o=e.details??{};i(t("warnings.details.status"),o.statusCode),i(t("warnings.details.requestId"),o.requestId),i(t("warnings.details.errorName"),e.name);for(const[r,l]of Object.entries(o))r==="statusCode"||r==="requestId"||i(r,l);const s=(e.code!==void 0?m6e[e.code]:void 0)??"title";return{severity:"error",title:t(`warnings.agentError.${s}`),message:e.message,details:n.length>0?n:void 0}}function g6e(e,t,n,i=d6e){const o=h6e(e);switch(p6e(o,n.sessionId,n.seq),t.type){case"sessionCreated":{o.sessions.some(r=>r.id===t.session.id)||(o.sessions=[t.session,...o.sessions]);break}case"sessionUpdated":{o.sessions=o.sessions.map(s=>s.id===t.session.id?{...t.session,pullRequest:s.pullRequest}:s);break}case"sessionDeleted":{const s=t.sessionId;o.sessions=o.sessions.filter(r=>r.id!==s),delete o.tasksBySession[s],delete o.goalBySession[s],delete o.goalVersionBySession[s],delete o.approvalsBySession[s],delete o.questionsBySession[s],delete o.lastSeqBySession[s],delete o.turnActiveBySession[s],delete o.turnErrorBySession[s],delete o.turnRetryBySession[s],o.activeSessionId===s&&(o.activeSessionId=void 0);break}case"sessionWorkChanged":{if(!Zy(e,n))break;let s;o.sessions=o.sessions.map(r=>r.id!==t.sessionId?r:(s=t.pendingInteraction??(t.busy?r.pendingInteraction:"none"),{...r,busy:t.busy,mainTurnActive:t.mainTurnActive??(t.busy?r.mainTurnActive:!1),pendingInteraction:s,lastTurnReason:t.lastTurnReason})),s==="none"?(delete o.approvalsBySession[t.sessionId],delete o.questionsBySession[t.sessionId]):s==="question"&&delete o.approvalsBySession[t.sessionId],t.mainTurnActive===!0?o.turnActiveBySession[t.sessionId]=!0:(t.mainTurnActive===!1||!t.busy)&&(delete o.turnActiveBySession[t.sessionId],delete o.turnRetryBySession[t.sessionId]);break}case"sessionMetaUpdated":{o.sessions=o.sessions.map(s=>s.id===t.sessionId?{...s,title:t.title??s.title,lastPrompt:t.lastPrompt??s.lastPrompt}:s);break}case"sessionUsageUpdated":{o.sessions=o.sessions.map(s=>{if(s.id!==t.sessionId)return s;const r=t.model&&t.model.length>0?t.model:s.model;return{...s,usage:t.usage,model:r}});break}case"historyCompacted":break;case"compactionStarted":{o.compactionBySession={...o.compactionBySession,[t.sessionId]:{status:"running",trigger:t.trigger}};break}case"compactionCompleted":{const s=t.sessionId,{[s]:r,...l}=o.compactionBySession;o.compactionBySession=l;break}case"compactionCancelled":{const{[t.sessionId]:s,...r}=o.compactionBySession;o.compactionBySession=r;break}case"messageCreated":case"messageUpdated":case"assistantDelta":case"toolOutput":break;case"approvalRequested":{const s=t.sessionId,r=o.approvalsBySession[s]??[];r.some(u=>u.approvalId===t.approval.approvalId)||(o.approvalsBySession[s]=[...r,t.approval]);const a=t.approval.display;a?.kind==="plan_review"&&typeof a.plan=="string"&&a.plan.length>0&&(o.planReviewByToolCallId={...o.planReviewByToolCallId,[t.approval.toolCallId]:{plan:a.plan,path:typeof a.path=="string"?a.path:void 0}});break}case"approvalResolved":case"approvalExpired":{const s=t.sessionId,r=t.approvalId,l=o.approvalsBySession[s]??[];o.approvalsBySession[s]=l.filter(a=>a.approvalId!==r);break}case"questionRequested":{const s=t.sessionId,r=o.questionsBySession[s]??[];r.some(a=>a.questionId===t.question.questionId)||(o.questionsBySession[s]=[...r,t.question]);break}case"questionAnswered":case"questionDismissed":{const s=t.sessionId,r=t.questionId,l=o.questionsBySession[s]??[];o.questionsBySession[s]=l.filter(a=>a.questionId!==r);break}case"taskCreated":{const s=t.sessionId,r=o.tasksBySession[s]??[],l=r.findIndex(f=>f.id===t.task.id),a=t.task.backgroundTaskId===void 0?-1:r.findIndex(f=>f.id===t.task.backgroundTaskId),u=a!==-1&&l!==-1&&a!==l?r[a]:void 0,c=u!==void 0?r.filter((f,h)=>h!==a):r,d=c.findIndex(f=>f.id===t.task.id||t.task.backgroundTaskId!==void 0&&f.id===t.task.backgroundTaskId);if(d===-1)o.tasksBySession[s]=[...c,t.task];else{const f=[...c],h=c[d],m=t.task.backgroundTaskId!==void 0&&(t.task.backgroundTaskId===h.backgroundTaskId||h.id===t.task.backgroundTaskId)||h.id===t.task.id&&(h.kind!=="subagent"||h.agentId===void 0),g=(m&&h.status!=="running"?h:void 0)??(u!==void 0&&u.status!=="running"?u:void 0),y=g!==void 0&&(t.task.status==="running"||t.task.status!==g.status),k=!m&&h.status!=="running"||t.task.backgroundTaskId!==void 0&&h.backgroundTaskId!==void 0&&t.task.backgroundTaskId!==h.backgroundTaskId,v=m&&h.completedAt!==void 0&&h.completedAtEstimated!==!0;f[d]={...t.task,status:y?g.status:t.task.status,subagentPhase:y?g.subagentPhase:t.task.subagentPhase,completedAt:y?g.completedAt:v?h.completedAt:t.task.completedAt,completedAtEstimated:y?g.completedAtEstimated:v?h.completedAtEstimated:t.task.completedAtEstimated,outputLines:y?g.outputLines:k?u?.outputLines??t.task.outputLines:h.outputLines??u?.outputLines??t.task.outputLines,text:y?g.text:k?u?.text??t.task.text:h.text??u?.text??t.task.text,outputPreview:y?g.outputPreview:t.task.outputPreview??(k?u?.outputPreview:h.outputPreview??u?.outputPreview),outputBytes:y?g.outputBytes:t.task.outputBytes??(k?u?.outputBytes:h.outputBytes??u?.outputBytes),description:t.task.description===ID&&h.description!==ID?h.description:t.task.description,swarmIndex:t.task.swarmIndex??h.swarmIndex,parentToolCallId:t.task.parentToolCallId??h.parentToolCallId,subagentType:t.task.subagentType??h.subagentType,model:t.task.model??h.model,thinkingEffort:t.task.thinkingEffort??h.thinkingEffort,runInBackground:k?t.task.runInBackground:t.task.runInBackground??h.runInBackground,backgroundTaskId:k?t.task.backgroundTaskId:t.task.backgroundTaskId??h.backgroundTaskId,agentId:t.task.agentId??h.agentId},o.tasksBySession[s]=f}break}case"taskProgress":{const s=t.sessionId,r=o.tasksBySession[s]??[];o.tasksBySession[s]=r.map(l=>{if(l.id!==t.taskId)return l;if(l.kind==="subagent"&&t.kind==="text")return{...l,text:(l.text??"")+t.outputChunk};const a=l.outputLines??[];if(t.replace===!0){const c=a.length>0?[...a.slice(0,-1),t.outputChunk]:[t.outputChunk];return{...l,outputLines:c}}if(a.at(-1)===t.outputChunk)return l;const u=[...a,t.outputChunk];return{...l,outputLines:l.kind==="subagent"?u:u.slice(-40)}});break}case"taskCompleted":{const s=t.sessionId,r=o.tasksBySession[s]??[];o.tasksBySession[s]=r.map(l=>l.id!==t.taskId&&l.backgroundTaskId!==t.taskId||t.status==="completed"&&(l.status==="cancelled"||l.status==="failed")||t.status==="failed"&&l.status==="cancelled"?l:{...l,status:t.status,completedAt:l.completedAt??new Date().toISOString(),completedAtEstimated:l.completedAt===void 0?!0:l.completedAtEstimated,outputPreview:t.outputPreview??l.outputPreview,outputBytes:t.outputBytes??l.outputBytes});break}case"goalUpdated":{const s=t.sessionId;o.goalVersionBySession[s]=(o.goalVersionBySession[s]??0)+1,t.goal===null||t.goal.status==="complete"?delete o.goalBySession[s]:o.goalBySession[s]=t.goal;break}case"configChanged":{o.config=t.config;break}case"modelCatalogChanged":break;case"agentDelta":case"agentTurnEnded":break;case"promptCompleted":case"promptAborted":break;case"turnActiveChanged":{if(!Zy(e,n))break;if(o.sessions=o.sessions.map(s=>s.id===t.sessionId?{...s,mainTurnActive:t.active}:s),t.active)o.turnActiveBySession[t.sessionId]=!0,delete o.turnErrorBySession[t.sessionId],delete o.turnRetryBySession[t.sessionId];else{delete o.turnActiveBySession[t.sessionId],delete o.turnRetryBySession[t.sessionId];const s=t.reason===void 0||t.reason==="completed"?"completed":"failed",r=o.tasksBySession[t.sessionId];r!==void 0&&(o.tasksBySession[t.sessionId]=r.map(l=>l.kind!=="subagent"||l.status!=="running"||l.runInBackground===!0?l:{...l,status:s,subagentPhase:s,completedAt:l.completedAt??new Date().toISOString(),completedAtEstimated:l.completedAt===void 0?!0:l.completedAtEstimated,suspendedReason:void 0}))}break}case"turnRetry":{if(!Zy(e,n))break;t.retry===void 0?delete o.turnRetryBySession[t.sessionId]:o.turnRetryBySession[t.sessionId]=t.retry;break}case"unknown":{const s=t.raw;if(!(s&&s._noop===!0))if(s&&s._agentError){if(Zy(e,n)){if(n.sessionId!==void 0){const r=s.details??{};o.turnErrorBySession[n.sessionId]={code:s.code,message:s.message,name:s.name,retryable:s.retryable,statusCode:typeof r.statusCode=="number"?r.statusCode:void 0,requestId:typeof r.requestId=="string"?r.requestId:void 0}}(n.sessionId===void 0||n.sessionId!==e.activeSessionId)&&(o.warnings=[...o.warnings,XA(s,i.t)])}}else if(s&&s._agentWarning){const r=s.message??s.code??i.t("warnings.agentWarningFallback");o.warnings=[...o.warnings,`${i.t("warnings.noteLabel")}: ${r}`]}else{const r=s?.type??"(unknown)";o.warnings=[...o.warnings,i.t("warnings.unhandledEvent",{type:r})]}break}}return o}function v6e(e,t){if(e===t)return!0;const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(const o of n)if(e[o]!==t[o])return!1;return!0}function y6e(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n]*)>([\s\S]*?)<\/notification>/g,b6e=/([\w-]+)="([^"]*)"/g,w6e=/]*)>[\s\S]*?<\/output-file>/,C6e=/]*)>([\s\S]*?)<\/output-preview>/,A6e=/^Title: (.*)$/m,x6e=/^Severity: (.*)$/m;function Z9(e){return e.replaceAll(""",'"').replaceAll("<","<").replaceAll(">",">").replaceAll("&","&")}function B8(e){const t={};for(const n of e.matchAll(b6e))n[1]!==void 0&&n[2]!==void 0&&(t[n[1]]=Z9(n[2]));return t}function S6e(e,t,n){const i=B8(e),o=A6e.exec(t)?.[1]?.trim()??"",s=x6e.exec(t)?.[1]?.trim()??"";let r=t.split(` -`).filter(f=>!f.startsWith("Title: ")&&!f.startsWith("Severity: ")).join(` -`);const l=r.search(/^<\w/m);l!==-1&&(r=r.slice(0,l)),r=r.trim();const a=w6e.exec(t),u=a?(()=>{const f=B8(a[1]??""),h=Number(f.bytes);return f.path!==void 0&&f.path!==""?{path:f.path,bytes:Number.isFinite(h)?h:void 0}:void 0})():void 0,c=C6e.exec(t),d=c?(()=>{const f=B8(c[1]??""),h=(c[2]??"").replace(/^\n/,""),m=h.indexOf(` -`),g=Z9(m===-1?"":h.slice(m+1)).replace(/\n$/,""),y=Number(f.bytes),k=Number(f.total_bytes);return{text:g,bytes:Number.isFinite(y)?y:void 0,totalBytes:Number.isFinite(k)?k:void 0,truncated:f.truncated==="true"?!0:f.truncated==="false"?!1:void 0}})():void 0;return{id:i.id??"",category:i.category??"",type:i.type??"",sourceKind:i.source_kind??"",sourceId:i.source_id??"",agentId:i.agent_id,title:Z9(o),severity:s,body:Z9(r),outputFile:u,outputPreview:d,raw:n}}function _6e(e){if(!e.includes("(/^Background (process|agent)$/.test(u.description)&&(u={...u,description:""}),u),r=E6e.exec(n);if(r?.[1]!==void 0&&r[2]!==void 0)return s({status:r[2]==="timed out"?"timed_out":r[2],description:r[1],reason:r[3],rest:o});const l=L6e.exec(n);if(l?.[1]!==void 0)return s({status:"killed",description:l[1],userStopped:l[2]!==void 0,reason:l[3],rest:o});const a=N6e.exec(n);if(a?.[1]!==void 0&&a[2]!==void 0)return s({status:a[2]==="was killed"?"killed":a[2]==="timed out"?"timed_out":a[2],description:a[1],reason:a[3],rest:o})}function D6e(e){if(!WU(e.title))return;const t=F6e(e.body);if(!(t===void 0||t.status!==_b(e)))return t}const R6e=1e6,MD=5e3;function hc(e){return e===""?[]:e.endsWith(` -`)?e.slice(0,-1).split(` -`):e.split(` -`)}const qU="\0";function TD(e){return e===""||e.endsWith(` -`)?e:`${e}${qU}`}function UU(e,t){const n=Ib(TD(e),TD(t));return n===null?null:n.map(i=>i.text.endsWith(qU)?{...i,text:i.text.slice(0,-1)}:i)}function Ib(e,t){const n=hc(e),i=hc(t),o=n.length,s=i.length;if(o===0&&s===0)return[];if(o>MD||s>MD||(o+1)*(s+1)>R6e)return null;const r=Array.from({length:o+1},()=>Array.from({length:s+1},()=>0));for(let h=1;h<=o;h++)for(let m=1;m<=s;m++)r[h][m]=n[h-1]===i[m-1]?r[h-1][m-1]+1:Math.max(r[h-1][m],r[h][m-1]);const l=[];let a=o,u=s;for(;a>0||u>0;)a>0&&u>0&&n[a-1]===i[u-1]?(l.push({type:"context",text:n[a-1]}),a--,u--):u>0&&(a===0||r[a][u-1]>=r[a-1][u])?(l.push({type:"add",text:i[u-1]}),u--):(l.push({type:"del",text:n[a-1]}),a--);l.reverse();const c=[];let d=1,f=1;for(const h of l)h.type==="context"?(c.push({type:"context",text:h.text,oldNo:d,newNo:f}),d++,f++):h.type==="add"?(c.push({type:"add",text:h.text,newNo:f}),f++):(c.push({type:"del",text:h.text,oldNo:d}),d++);return c}const ED=500;function LD(e,t){const n=[],i=hc(e),o=hc(t),s=Math.min(i.length,ED),r=Math.min(o.length,ED);for(let l=1;l<=s;l++)n.push({type:"del",text:i[l-1],oldNo:l});i.length>s&&n.push({type:"context",text:`… ${i.length-s} more lines …`});for(let l=1;l<=r;l++)n.push({type:"add",text:o[l-1],newNo:l});return o.length>r&&n.push({type:"context",text:`… ${o.length-r} more lines …`}),n}function O6e(e){let t=0,n=0;for(const i of e)i.type==="add"?t++:i.type==="del"&&n++;return{added:t,removed:n}}function td(e){const t=e;return t?.kind!=="user"||!Array.isArray(t.skillActivations)?[]:t.skillActivations.flatMap(n=>{if(typeof n!="object"||n===null)return[];const i=n;return typeof i.skillName!="string"?[]:[{name:i.skillName,...typeof i.skillArgs=="string"?{args:i.skillArgs}:{}}]})}function P6e(e){return{content:e.content,skillActivations:td(e.metadata?.origin)}}function X0(e,t){return e.length===t.length&&e.every((n,i)=>{const o=t[i];return o!==void 0&&n.name===o.name&&n.args===o.args})}const B6e=/^read[_-]?media(?:file)?$/i,$6e=/^data:([^;]+);base64,(.*)$/s,z6e=/^<(image|video|audio)\s+path="([^"]+)">$/,j6e=/^<(image|video|audio)\s+path="([^"]+)">(?:<\/\1>)?$/,H6e=/Mime type:\s*([^.\s]+)/i,W6e=/Size:\s*(\d+)\s*bytes/i,q6e=/Original dimensions:\s*(\d+)x(\d+)\s*pixels/i,U6e="Image compressed to fit model limits:",V6e=/Image compressed to fit model limits:[\s\S]*?<\/system>/g;function ND(e){return e.includes(U6e)?e.replace(V6e,""):e}function K6e(e){return e.replaceAll(""",'"').replaceAll("<","<").replaceAll(">",">").replaceAll("&","&")}function FD(e){const t=j6e.exec(e.trim());return t?{kind:t[1],path:K6e(t[2])}:null}const VU=/^f_(?:[0-9A-Za-z]{26}|[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12})$/,Z6e=/f_(?:[0-9A-Za-z]{26}|[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12})$/;function e6(e){const t=e.split(/[\\/]/).at(-1)??"",n=t.lastIndexOf("."),i=n>0?t.slice(0,n):t;return VU.test(i)?i:void 0}const Gc='Attached file "',KU=" — open it with the Read tool";function G6e(e,t,n,i){const o=`-${e}`,s=i.endsWith(o)?i.slice(0,-o.length):i,r=Z6e.exec(s)?.[0];return{name:e,mediaType:t,size:Number(n),fileId:r!==void 0&&VU.test(r)?r:void 0}}const ZU="attachmentRecords",Q6e=65536;function Y6e(e,t,n){const i=t+Gc.length,o=e.slice(i,n),s=o.indexOf('" (');if(s<=0)return!1;const r=o.indexOf(", ",s+3);if(r<=s+3)return!1;let l=i+r+2;if(l>=n||e.charCodeAt(l)<48||e.charCodeAt(l)>57)return!1;for(;l=48&&e.charCodeAt(l)<=57;)l++;return e.startsWith(" bytes): ",l)}function J6e(e,t,n){let i=e.indexOf(Gc,t);for(;i>=0&&i=n?n:s;if(Y6e(e,i,r))return i;if(s<0||s>=n)return-1;i=s}return-1}function X6e(e,t){const n=t+Gc.length,i=Math.min(e.length,n+Q6e),o=e.slice(n,i),s=o.indexOf('" (');if(s<=0)return null;const r=n+s,l=o.indexOf(", ",s+3);if(l<=s+3)return null;const a=n+l+2;let u=a;for(;u=48&&e.charCodeAt(u)<=57;)u++;if(u===a||!e.startsWith(" bytes): ",u))return null;const c=e.slice(a,u),d=u+9,f=J6e(e,r,i),h=f>=0?Math.min(f,i):i,m=e.slice(d,h),g=o.slice(0,s),y=`-${g}${KU}`;let k=m.lastIndexOf(y);for(;k>=0;){const C=m.slice(0,k),w=Math.max(C.lastIndexOf("/"),C.lastIndexOf("\\"));if(!/\s/.test(C.slice(w+1)))break;k=m.lastIndexOf(y,k-1)}if(k<0)return null;const v=m.slice(0,k+1+g.length);return{start:t,end:d+k+y.length,info:G6e(g,o.slice(s+3,l),c,v)}}function gS(e){if(!e.includes(KU))return[];const t=[];let n=e.indexOf(Gc);for(;n>=0;){const i=X6e(e,n);n=i?e.indexOf(Gc,i.end):e.indexOf(Gc,n+Gc.length),i&&t.push(i)}return t}function DD(e){const t=gS(e);if(t.length===0)return e;let n="",i=0;for(const o of t)n+=e.slice(i,o.start),i=o.end;return n+e.slice(i)}function e7e(e){const t=[];for(const o of e.content)o.type==="file"&&t.push({fileId:o.fileId,name:o.name});const n=[...t],i=e.metadata?.[ZU];if(Array.isArray(i))for(const o of i){if(typeof o!="object"||o===null)continue;const s=o.fileId,r=o.name,l={fileId:typeof s=="string"&&s.length>0?s:void 0,name:typeof r=="string"&&r.length>0?r:void 0},a=n.findIndex(u=>l.fileId!==void 0?u.fileId===l.fileId:u.fileId===void 0&&u.name===l.name);a>=0?n.splice(a,1):t.push(l)}return t.length>0?t:null}function t7e(e){const t=e7e(e);if(t)return{kind:"paired",records:t};let n=0;for(const s of e.content)if(s.type==="text")for(const r of t6(s.text))n=Math.max(n,r);const i=e.metadata?.origin;for(const s of[i?.skillArgs,i?.commandArgs])if(typeof s=="string")for(const r of t6(s))n=Math.max(n,r);if(n===0)return{kind:"legacy"};let o=0;for(const s of e.content)s.type==="text"&&(o+=gS(s.text).length);return{kind:"pill",keepLast:n,total:o}}function n7e(e){let t=0;const n=e.kind==="pill"?Math.max(0,e.total-e.keepLast):0;return i=>{const o=gS(i);if(o.length===0)return{notices:[],text:i};const s=[];for(const a of o){const u=t++;if(e.kind==="legacy")s.push(a);else if(e.kind==="pill")u>=n&&s.push(a);else{const c=a.info.fileId,d=e.records.findIndex(f=>c!==void 0?f.fileId===c:f.fileId===void 0&&f.name===a.info.name);d>=0&&(e.records.splice(d,1),s.push(a))}}if(s.length===0)return{notices:[],text:i};let r="",l=0;for(const a of s)r+=i.slice(l,a.start),l=a.end;return{notices:s.map(a=>a.info),text:r+i.slice(l)}}}const i7e=/(?=0&&e[i]==="\\";)n+=1,i-=1;return n%2===1}function GU(e){let t="",n=0,i=0;for(;i0?t:void 0}return[JSON.stringify(e)]}}function d7e(e,t){if(hr(e)==="task")for(const n of t??[]){const i=/^agent_id:\s*(\S+)\s*$/.exec(n);if(i?.[1])return i[1]}}function f7e(e,t){return{id:e.agentId??e.id,toolCallId:e.parentToolCallId,name:e.description,kind:e.kind,subagentType:e.subagentType,prompt:e.command??t,model:e.model,thinkingEffort:e.thinkingEffort,phase:e.status==="completed"?"completed":e.status==="failed"?"failed":e.status==="cancelled"?"cancelled":e.subagentPhase??"working",status:e.status,summary:e.outputPreview,outputLines:e.outputLines,text:e.text,suspendedReason:e.suspendedReason,swarmIndex:e.swarmIndex}}function QU(e){const t=e.display??{},n=typeof t.kind=="string"?t.kind:"";if(n==="diff"){const i=typeof t.path=="string"?t.path:"";if(Array.isArray(t.diff))return{kind:"diff",path:i,diff:t.diff};const o=typeof t.old_text=="string"?t.old_text:typeof t.before=="string"?t.before:void 0,s=typeof t.new_text=="string"?t.new_text:typeof t.after=="string"?t.after:void 0;if(o!==void 0&&s!==void 0){const r=UU(o,s)??LD(o,s);return{kind:"diff",path:i,diff:r}}return{kind:"diff",path:i,diff:[]}}if(n==="file_io"){const i=typeof t.path=="string"?t.path:"",o=typeof t.operation=="string"?t.operation:"";if(o==="write"&&typeof t.content=="string")return{kind:"file",path:i,content:t.content};if(o==="edit"&&typeof t.before=="string"&&typeof t.after=="string"){const r=Ib(t.before,t.after)??LD(t.before,t.after);return{kind:"diff",path:i,diff:r}}const s=typeof t.detail=="string"?t.detail:void 0;return{kind:"fileop",op:o||n,path:i,detail:s}}if(n==="shell"||n==="command"){const i=typeof t.command=="string"?t.command:e.action;return{kind:"shell",command:i,cwd:typeof t.cwd=="string"?t.cwd:void 0,danger:typeof t.danger=="string"?t.danger:Uae(i)}}if(n==="file_content"||n==="file")return{kind:"file",path:typeof t.path=="string"?t.path:"",content:typeof t.content=="string"?t.content:"",language:typeof t.language=="string"?t.language:void 0};if(n==="file_op"||n==="fileop")return{kind:"fileop",op:typeof t.operation=="string"?t.operation:typeof t.op=="string"?t.op:n,path:typeof t.path=="string"?t.path:"",detail:typeof t.detail=="string"?t.detail:void 0};if(n==="url_fetch"||n==="url")return{kind:"url",method:typeof t.method=="string"?t.method:void 0,url:typeof t.url=="string"?t.url:e.action};if(n==="search")return{kind:"search",query:typeof t.query=="string"?t.query:e.action,scope:typeof t.scope=="string"?t.scope:void 0};if(n==="invocation"||n==="agent_call"||n==="skill_call")return{kind:"invocation",kind2:typeof t.kind=="string"?t.kind:n,name:typeof t.name=="string"?t.name:e.toolName,description:typeof t.description=="string"?t.description:void 0};if(n==="todo"||n==="todo_list")return{kind:"todo",items:(Array.isArray(t.items)?t.items:[]).map(s=>{const r=s??{};return{title:typeof r.title=="string"?r.title:"",status:typeof r.status=="string"?r.status:"pending"}})};if(n==="plan_review"){const i=typeof t.plan=="string"?t.plan:"",o=typeof t.path=="string"?t.path:void 0,r=(Array.isArray(t.options)?t.options:[]).map(l=>{const a=l??{},u=typeof a.label=="string"?a.label:"";if(!u)return null;const c=typeof a.description=="string"?a.description:void 0;return{label:u,description:c}}).filter(l=>l!==null);return{kind:"plan_review",plan:i,path:o,options:r.length>0?r:void 0}}return{kind:"generic",summary:e.action}}function YU(e){const t=` -`,n=` -`,i=e.indexOf(t),o=e.lastIndexOf(n);return i>=0&&o>=i+t.length?e.slice(i+t.length,o):h7e(e)}function h7e(e){const t=e.split(` -`);return t.length>=2&&t[0]?.startsWith(""?t.slice(1,-1).join(` -`):e}function p7e(e){const t=e.metadata?.origin;if(t?.kind==="cron_job"||t?.kind==="cron_missed")return t.kind}function m7e(e){const t=e.content.filter(n=>n.type==="text").map(n=>n.text).join(` -`);return YU(t)}function g7e(e,t){const n=e.metadata?.origin??{},i=m7e(e);return t==="cron_missed"?{text:i,cron:{missedCount:typeof n.count=="number"?n.count:void 0}}:{text:i,cron:{jobId:typeof n.jobId=="string"?n.jobId:void 0,cron:typeof n.cron=="string"?n.cron:void 0,recurring:typeof n.recurring=="boolean"?n.recurring:void 0,coalescedCount:typeof n.coalescedCount=="number"?n.coalescedCount:void 0,stale:typeof n.stale=="boolean"?n.stale:void 0}}}function v7e(e,t,n){const{text:i,cron:o}=g7e(e,n);return{id:e.id,role:"cron",no:t,text:i,createdAt:e.createdAt,cron:o}}function y7e(e){const t=e.metadata?.origin,n=t?.kind;return n===void 0||n==="user"?!0:n==="skill_activation"||n==="plugin_command"?t?.trigger==="user-slash":!1}function k7e(e){const t=e.metadata?.["kimiWeb.steeredPromptIds"];if(Array.isArray(t)){const i=t.filter(o=>typeof o=="string"&&o.length>0);if(i.length>0)return i}if(e.promptId!==void 0&&e.promptId.length>0)return[e.promptId];const n=e.metadata?.["kimiWeb.promptId"];if(typeof n=="string"&&n.length>0)return[n]}function b7e(e){return e.metadata?.origin?.kind==="compaction_summary"}function w7e(e,t){return e===null?!1:e.promptId===void 0||t===void 0||e.promptId===t}function C7e(e){if(!e||e.length===0)return;const t="Plan saved to: ";for(const n of e)if(n.startsWith(t))return n.slice(t.length).trim()}function A7e(e){const t=[];for(const n of e){const i=t.at(-1);n.type==="text"&&i?.type==="text"?i.text+=n.text:n.type==="thinking"&&i?.type==="thinking"?i.thinking+=n.thinking:n.type==="thinking"?t.push({type:"thinking",thinking:n.thinking}):t.push({...n})}return JSON.stringify(t)}function iw(e,t,n,i=!0,o={},s={},r){const l=[];let a=r?.startNo??1;const u=r?.collect,c=new Map;for(const g of t)c.set(g.toolCallId,g);let d=null;function f(g=!1){if(!d)return;const y=d;if(d=null,!g&&y.blocks.length===0&&y.textParts.length===0&&y.thinkingParts.length===0&&y.tools.length===0)return;if(!g||!i)for(let C=0;CE.kind==="tool"&&E.tool.id===M.id);L&&L.kind==="tool"&&(L.tool=M)}const k=y.sources.find(C=>C.daemonTurnId!==void 0),v={id:y.id,sessionId:y.sources.find(C=>C.sessionId)?.sessionId||void 0,role:"assistant",no:a++,text:y.textParts.join(` -`),thinking:y.thinkingParts.length>0?y.thinkingParts.join(` -`):void 0,tools:y.tools.length>0?y.tools:void 0,blocks:y.blocks.length>0?y.blocks:void 0,approval:y.approval,approvalId:y.approvalId,durationMs:y.durationMs,createdAt:y.createdAt,endedAt:y.endedAt,goalContinuation:y.goalContinuation,daemonTurnId:k?.daemonTurnId,daemonTurnState:k?.daemonTurnState};l.push(v),u?.(v,y.sources)}function h(g,y){let k=null;for(const v of y)if(v.type==="text"){if(v.text){k==="text"?g.textParts[g.textParts.length-1]+=v.text:g.textParts.push(v.text);const C=g.blocks.at(-1);C&&C.kind==="text"?C.text+=(k==="text"?"":` -`)+v.text:g.blocks.push({kind:"text",text:v.text}),k="text"}}else if(v.type==="thinking"){if(v.thinking){k==="thinking"?g.thinkingParts[g.thinkingParts.length-1]+=v.thinking:g.thinkingParts.push(v.thinking);const C=g.blocks.at(-1);if(C&&C.kind==="thinking"){C.thinking+=(k==="thinking"?"":` -`)+v.thinking;const w=[C.startedAt,v.startedAt].filter(E=>E!==void 0).sort()[0],M=C.startedAt!==void 0&&C.durationMs===void 0||v.startedAt!==void 0&&v.durationMs===void 0,L=[C,v].flatMap(E=>E.startedAt!==void 0&&E.durationMs!==void 0?[Date.parse(E.startedAt)+E.durationMs]:[]);C.startedAt=w,C.durationMs=!M&&w!==void 0&&L.length>0?Math.max(...L)-Date.parse(w):void 0}else g.blocks.push({kind:"thinking",thinking:v.thinking,startedAt:v.startedAt,durationMs:v.durationMs});k="thinking"}}else if(v.type==="toolUse"){k=null;const C=c.get(v.toolCallId),w=v.toolName==="ExitPlanMode"?s[v.toolCallId]:void 0,M={id:v.toolCallId,name:v.toolName,arg:typeof v.input=="string"?v.input:JSON.stringify(v.input),agentId:hr(v.toolName)==="task"?v.agentRefs?.find(L=>L.role!=="member")?.agentId??v.agentRefs?.[0]?.agentId:void 0,status:"running",output:v.outputLines,plan:w,planPath:v.toolName==="ExitPlanMode"?w?.path??o[v.toolCallId]?.path:void 0};g.tools.push(M),g.blocks.push({kind:"tool",tool:M}),C&&(g.approval=QU(C),g.approvalId=C.approvalId)}else if(v.type==="toolResult"){k=null;const C=g.tools.findIndex(w=>w.id===v.toolCallId);if(C!==-1){const w=g.tools[C],M=vS(v.output),L={...w,status:v.isError?"error":"ok",output:M,media:v.isError?void 0:c7e(w.name,v.output),agentId:w.agentId??d7e(w.name,M)};L.name==="ExitPlanMode"&&!L.planPath&&(L.planPath=C7e(L.output)),g.tools[C]=L;const E=g.blocks.find(S=>S.kind==="tool"&&S.tool.id===v.toolCallId);E&&E.kind==="tool"&&(E.tool=L)}}else k=null}function m(g,y){if(g.type==="image"||g.type==="video"){const k=g.type,v=g.source;if(v.kind==="url")return{url:v.url,kind:k};if(v.kind==="base64")return{url:`data:${v.mediaType};base64,${v.data}`,kind:k};if(v.kind==="file"&&n)return{url:n(v.fileId),kind:k,fileId:v.fileId};if(v.kind==="sessionMedia")return{url:r?.getSessionMediaUrl?.(y,v.fileId)??"",kind:k,fileId:v.fileId,sessionId:y}}if(g.type==="file"&&n){if(g.mediaType.startsWith("image/"))return{url:n(g.fileId),kind:"image",fileId:g.fileId};if(g.mediaType.startsWith("video/"))return{url:n(g.fileId),kind:"video",fileId:g.fileId}}}for(const g of e){if(g.role==="system")continue;if(b7e(g)){f();const w=g.metadata?.[tj],M={id:g.id,role:"compaction",no:a,text:g.content.filter(L=>L.type==="text").map(L=>L.text).join(` -`),compaction:{trigger:w?.trigger,tokensBefore:w?.tokensBefore,tokensAfter:w?.tokensAfter}};l.push(M),u?.(M,[g]);continue}if(g.role==="user"){const w=p7e(g),M=g.metadata?.origin?.kind,L=M==="skill_activation"&&g.metadata?.origin?.trigger!=="user-slash";if(w===void 0&&(M==="injection"||L))continue;if(w===void 0&&(M==="task"||M==="background_task"||M==="task_notification")){const J=g.content.filter(ue=>ue.type==="text").map(ue=>ue.text).join(` -`),U=I6e(g.metadata),Q=U!==void 0?[U]:_6e(J);if(Q.length>0){d??={id:g.id,promptId:void 0,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,seenSigs:new Set,sources:[g],createdAt:g.createdAt};for(const ue of Q)d.blocks.push({kind:"notification",notification:{...ue,createdAt:g.createdAt}})}continue}if(f(),w!==void 0){const J=v7e(g,a++,w);l.push(J),u?.(J,[g]);continue}if(M==="system_trigger"&&g.metadata?.origin?.name==="goal_continuation"){d={id:g.id,promptId:void 0,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,seenSigs:new Set,sources:[g],createdAt:g.createdAt,goalContinuation:!0};continue}if(!y7e(g))continue;const E=g.metadata?.origin,S=E?.kind==="skill_activation"&&E?.trigger==="user-slash",x=E?.kind==="plugin_command"&&E?.trigger==="user-slash",A=P6e(g),T=A.skillActivations,I=A.content,O=[];let H=[];const R=n7e(t7e(g)),F=new Set,P=J=>{const U={kind:"file",url:J.fileId&&n?n(J.fileId):"",fileId:J.fileId,name:J.name,mediaType:J.mediaType,size:J.size};H.push(U),F.add(U)};for(const J of I){if(J.type==="text")if(S){const Q=FD(J.text);if(Q&&(Q.kind==="video"||Q.kind==="image")&&n){const ue=e6(Q.path);if(ue){H.push({url:n(ue),kind:Q.kind,fileId:ue});continue}}for(const ue of R(J.text).notices)P(ue)}else if(x)O.push(E.commandArgs??"");else{const Q=FD(J.text);if(Q&&(Q.kind==="video"||Q.kind==="image")&&n){const pe=e6(Q.path);if(pe){H.push({url:n(pe),kind:Q.kind,fileId:pe});continue}}const ue=R(J.text);if(ue.notices.length>0){for(const ee of ue.notices)P(ee);if(ue.text.trim().length===0)continue;const pe=ND(ue.text);if(pe!==ue.text&&pe.trim().length===0)continue;O.push(pe);continue}const me=ND(J.text);if(me!==J.text&&me.trim().length===0)continue;O.push(me)}const U=m(J,g.sessionId);if(U){H.push({url:U.url,kind:U.kind,name:J.type==="file"?J.name:void 0,fileId:U.fileId,sessionId:U.sessionId});continue}J.type==="file"&&n&&H.push({kind:"file",url:n(J.fileId),fileId:J.fileId,name:J.name,mediaType:J.mediaType||void 0,size:J.size})}const z=new Map;for(const J of F){if(J.fileId===void 0)continue;const U=`${J.kind}|${J.fileId}`;z.set(U,(z.get(U)??0)+1)}H=H.filter(J=>{if(F.has(J)||J.fileId===void 0)return!0;const U=`${J.kind}|${J.fileId}`,Q=z.get(U)??0;return Q>0?(z.set(U,Q-1),!1):!0});const W=S?E?.skillArgs??"":O.join(` -`),$=t6(W),K=r7e(W),ne=H.filter(J=>J.kind==="file"),G=H.filter(J=>J.kind==="image"||J.kind==="video"),te=[...$].some(J=>J<=ne.length),le=[...K].some(J=>J<=G.length),ie=te||le?H:[];let _e=0,Z=0;const se=H.filter(J=>J.kind==="file"?(_e+=1,!(te&&$.has(_e))):J.kind==="image"||J.kind==="video"?(Z+=1,!(le&&K.has(Z))):!0),he=g.metadata?.["kimiWeb.steeredPromptIds"],Y={id:g.id,role:"user",no:a++,text:W,hasUndoAnchor:g.metadata?.["kimiWeb.settledWithoutEcho"]===!0||g.metadata?.["kimiWeb.steered"]===!0?!1:void 0,steered:g.metadata?.["kimiWeb.steered"]===!0||Array.isArray(he)&&he.length>0?!0:void 0,promptIds:k7e(g),attachments:se.length>0?se:void 0,inlineAttachments:ie.length>0?ie:void 0,skillActivation:S?{name:E.skillName,args:E.skillArgs}:void 0,skillActivations:T.length>0?T.map(J=>({name:J.name,args:J.args})):void 0,pluginCommand:x?{pluginId:E.pluginId,commandName:E.commandName,args:E.commandArgs}:void 0,createdAt:g.createdAt};l.push(Y),u?.(Y,[g]);continue}if(g.role==="tool"){d&&(d.sources.push(g),h(d,g.content),d.endedAt=g.createdAt);continue}const y=g.promptId;w7e(d,y)?d!==null&&d.promptId===void 0&&y!==void 0&&(d.promptId=y):(f(),d={id:g.id,promptId:y,textParts:[],thinkingParts:[],tools:[],blocks:[],approval:void 0,approvalId:void 0,seenSigs:new Set,sources:[],durationMs:g.durationMs,createdAt:g.createdAt});const v=d;if(v===null)continue;const C=A7e(g.content);v.promptId!==void 0&&v.seenSigs.has(C)||(v.seenSigs.add(C),v.sources.push(g),g.durationMs!==void 0&&(v.durationMs=g.durationMs),h(v,g.content),g.endedAt!==void 0?v.endedAt=g.endedAt:g.id!==v.id&&(v.endedAt=g.createdAt))}return f(!0),l}function JU(e,t,n){return e.state==="running"&&e.frames.at(-1)===t&&!n}function x7e(e,t){if(t.size===0)return;let n=!1;for(const l of t.values())if(l.settledAt===void 0){n=!0;break}if(!n)return;const i=new Date().toISOString(),o=e.items.findLast(l=>l.kind==="turn"&&l.state==="running"),s=o?.kind==="turn"?o.steps.findLast(l=>l.state==="running"):void 0,r=e.interactions.some(l=>l.state==="pending");for(const l of e.items)if(l.kind==="turn")for(const a of l.steps){const u=r&&a===s;for(const c of a.frames){if(c.kind!=="thinking")continue;const d=t.get(c.frameId);d===void 0||d.settledAt!==void 0||JU(a,c,u)||(d.settledAt=i)}}}function S7e(e,t){if(t.size===0)return;const n=new Set;for(const i of e.items)if(i.kind==="turn")for(const o of i.steps)for(const s of o.frames)s.kind==="thinking"&&n.add(s.frameId);for(const i of[...t.keys()])n.has(i)||t.delete(i)}function _7e(e,t,n,i){const o=e.items.filter(f=>f.kind==="turn"),s=o[0]?.turnId,r=o.length===1?s:void 0,l=new Map(e.tasks.map(f=>[f.taskId,f])),a=new Map(e.prompts.map(f=>[f.promptId,f])),u=eV(e.prompts,XU(e.items)),c=e.items.flatMap(f=>f.kind==="turn"?yS(f,e.attachments,l,f.turnId===s?n?.createdAt:void 0,f.turnId===r?n?.disposedAt:void 0,i?.sessionId,{promptById:a,promptForTurn:u}):[]),d=e.meta.activity==="turn";return iw(c,[],t,d,{},{},{getSessionMediaUrl:i?.getSessionMediaUrl}).map(L7e)}function RD(e){if(!Array.isArray(e))return[];const t=[];for(const n of e){if(typeof n!="object"||n===null)continue;const i=n;if(i.type!=="file")continue;const o=typeof i.fileId=="string"?i.fileId:i.file_id;t.push({fileId:typeof o=="string"?o:void 0,name:typeof i.name=="string"?i.name:void 0})}return t}function OD(e,t){return t.length===0?e:{...e,[ZU]:t}}const I7e=new Set(["user","skill_activation","plugin_command"]);function M7e(e){return(e.origin.payload??e.origin)?.kind}function T7e(e){const t=e.content;if(!Array.isArray(t))return;const n=[];for(const i of t)if(typeof i=="object"&&i!==null&&i.type==="text"){const o=i.text;typeof o=="string"&&n.push(o)}return n.join("")}function XU(e){const t=new Set;for(const n of e)if(n.kind==="turn"){for(const i of n.steps)for(const o of i.frames)if(o.kind==="text")for(const s of o.promptIds??[])t.add(s)}return t}function eV(e,t){const n=new Set(t??[]);return i=>{const o=M7e(i);if(o!==void 0&&!I7e.has(o)||i.prompt===void 0&&(i.attachmentIds??[]).length===0)return;const s=DD(i.prompt??"");for(const r of e){if(n.has(r.promptId))continue;const l=T7e(r);if(l!==void 0&&DD(l)===s)return n.add(r.promptId),r}}}function yS(e,t,n,i,o,s="",r){const l=[],a=new Map(t.map(k=>[k.attachmentId,k])),u=n6([e.startedAt,...e.steps.map(k=>k.startedAt),i])??"",c=PD(e.endedAt)??PD(o),d=e.triggerPromptId??e.turnId,f=e.origin.payload??e.origin,h=(e.attachmentIds??[]).length>0,m=r?.includeOrigin===!0&&td(f).length>0;if(e.prompt!==void 0&&e.prompt.length>0||h||m){const k=e.prompt!==void 0&&e.prompt.length>0?[{type:"text",text:e.prompt}]:[];for(const v of e.attachmentIds??[]){const C=BD(a.get(v));C!==void 0&&k.push(C)}l.push({id:`${e.turnId}:input`,sessionId:s,role:"user",content:k,createdAt:u,promptId:d,metadata:OD(r?.includeOrigin===!0||e.origin.kind==="task"&&(e.prompt??"").includes("0;if(v.role==="user"){if(v.taskId!==void 0){if(v.text.length===0&&!C)continue;const A=E7e(v.taskId,v.text,n.get(v.taskId));l.push({id:v.frameId,sessionId:s,role:"user",content:[{type:"text",text:v.text}],createdAt:k.startedAt??u,promptId:d,metadata:{origin:{kind:"task",taskId:v.taskId},[HU]:A}});continue}const w=v.text.length>0?[{type:"text",text:v.text}]:[];for(const A of v.attachmentIds??[]){const T=BD(a.get(A));T!==void 0&&w.push(T)}const M=v.promptIds?.map(A=>r?.promptById?.get(A)).find(A=>A!==void 0),L=[];for(const A of v.promptIds??[])L.push(...RD(r?.promptById?.get(A)?.content));const E=v.origin,S=td(E);if(v.text.length===0&&!C&&S.length===0)continue;const x={...S.length>0?{origin:E}:{},...(v.promptIds?.length??0)>0?{"kimiWeb.steeredPromptIds":v.promptIds}:{}};l.push({id:v.frameId,sessionId:s,role:"user",content:w,createdAt:M?.createdAt??k.startedAt??u,promptId:d,metadata:OD(Object.keys(x).length>0?x:void 0,L)});continue}if(v.text.length===0&&!C)continue;l.push({id:v.frameId,sessionId:s,role:"assistant",content:[{type:"text",text:v.text}],createdAt:k.startedAt??u,promptId:d})}else if(v.kind==="thinking"){if(v.text.length===0)continue;const C=r?.pendingInteractionAtByStepId?.get(k.stepId),w=JU(k,v,C!==void 0),M=r?.thinkingTiming,L=M?.get(v.frameId);let E,S;if(L!==void 0)L.settledAt===void 0&&!w&&(L.settledAt=new Date().toISOString()),E=L.startedAt,S=$8(L.startedAt,L.settledAt);else if(M!==void 0&&w){const x=new Date().toISOString();M.set(v.frameId,{startedAt:x}),E=x}else E=k.startedAt,S=$8(k.startedAt,n6([k.endedAt,C]));l.push({id:v.frameId,sessionId:s,role:"assistant",content:[{type:"thinking",thinking:v.text,startedAt:E,durationMs:S}],createdAt:k.startedAt??u,promptId:d})}else v.kind==="tool"&&(l.push({id:`${v.frameId}:call`,sessionId:s,role:"assistant",content:[{type:"toolUse",toolCallId:v.toolCallId,toolName:v.name,input:v.input??v.display??{},outputLines:v.state==="running"?vS(v.output):void 0,agentRefs:v.agentRefs}],createdAt:k.startedAt??u,promptId:d}),v.state!=="running"&&l.push({id:`${v.frameId}:result`,sessionId:s,role:"tool",content:[{type:"toolResult",toolCallId:v.toolCallId,output:v.output??v.error??"",isError:v.state==="error"}],createdAt:k.endedAt??k.startedAt??u,promptId:d}));const g=e.durationMs??$8(u||void 0,c),y=l.findLastIndex(k=>k.role==="assistant");y>=0&&(g!==void 0||c!==void 0)&&(l[y]={...l[y],durationMs:g,endedAt:c??l[y].endedAt});for(const k of l)k.daemonTurnId=e.ordinal,k.daemonTurnState=e.state;return l}function E7e(e,t,n){const[i="",...o]=t.split(` -`),s=n?.state??"info";return{id:`task:${e}:${s}`,category:"task",type:`task.${s}`,sourceKind:n?.kind==="subagent"?"subagent":"background_task",sourceId:e,agentId:n?.agentId,title:i.trim(),severity:s==="completed"?"info":"warning",body:o.join(` -`).trim(),raw:t}}function L7e(e){if(e.createdAt!==""&&e.endedAt!=="")return e;const t={...e};return t.createdAt===""&&delete t.createdAt,t.endedAt===""&&delete t.endedAt,t}function n6(e){let t;for(const n of e){if(n===void 0)continue;const i=Date.parse(n);Number.isFinite(i)&&(t===void 0||i=0?n:void 0}const $D=6e3,Im=256*1024,N7e=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/;function zD(e,t){return t===0?e:e-1}function F7e(e,t){const n=hc(t),i=[];let o=0;for(const s of e){if(s.type==="hunk"){const r=N7e.exec(s.text);if(!r)return null;const l=zD(Number(r[1]),r[2]===void 0?1:Number(r[2])),a=zD(Number(r[3]),r[4]===void 0?1:Number(r[4]));if(an.length)return null;for(;o=n.length||n[o]!==s.text)return null;o++,s.type==="context"&&i.push(s.text)}for(;oIm||hc(n).length>$D)return null;const i=F7e(e,n);return i===null||i.length>Im||hc(i).length>$D?null:{before:i,after:n}}const R7e=new Set(["assistantDelta","agentDelta","toolOutput","taskProgress"]);function O7e(e){return R7e.has(e.type)}const P7e=50,B7e=100,i6=32*1024,$7e={requestFrame(e){return typeof requestAnimationFrame=="function"?requestAnimationFrame(e):null},cancelFrame(e){typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(e)},requestTask(e){return setTimeout(e,P7e)},cancelTask(e){clearTimeout(e)}};function z7e(e,t,n={}){const i=n.scheduler??$7e,o=Math.max(1,Math.floor(n.maxItemsPerSlice??B7e)),s=[];let r=0,l=null,a=null,u=0,c=!1;const d=()=>s.length-r,f=()=>{u+=1,l!==null&&(i.cancelFrame(l),l=null),a!==null&&(i.cancelTask(a),a=null)},h=()=>{r===s.length?(s.length=0,r=0):r>=1024&&(s.splice(0,r),r=0)};let m;const g=()=>{if(c||l!==null||a!==null||d()===0)return;const k=++u,v=()=>{k===u&&m()};l=i.requestFrame(v),a=i.requestTask(v)};m=()=>{f();let k=0;for(;!c&&k{if(!c){if(t(k)){const v=s.length>r?s.at(-1):void 0,C=v===void 0?void 0:n.coalesce?.(v,k);C===void 0?s.push(k):s[s.length-1]=C,g();return}if(d()===0){e(k);return}s.push(k),m()}});return y.flush=()=>{if(!c){for(f();!c&&r{if(c||d()===0)return;let v=r;for(let C=r;C{c||(c=!0,f(),s.length=0,r=0)},y}function o6(e){if(e.type==="assistantDelta"){if(e.delta.text!==void 0&&e.delta.thinking===void 0)return{kind:"text",value:e.delta.text};if(e.delta.thinking!==void 0&&e.delta.text===void 0)return{kind:"thinking",value:e.delta.thinking}}}function j7e(e){if(e.appEvent.type!=="assistantDelta")return[e];const t=e.appEvent,n=e.meta.stream,i=o6(t);if(n===void 0||i===void 0||n.kind!==i.kind||i.value.length<=i6)return[e];const o=[];let s=0;for(;ss&&/[\uD800-\uDBFF]/u.test(i.value[r-1])&&/[\uDC00-\uDFFF]/u.test(i.value[r])&&(r-=1);const l=i.value.slice(s,r);o.push({appEvent:{...t,delta:i.kind==="text"?{text:l}:{thinking:l}},meta:{...e.meta,stream:{...n,offset:n.offset+s}}}),s=r}return o}function H7e(e,t){if(e.appEvent.type!=="assistantDelta"||t.appEvent.type!=="assistantDelta")return;const n=e.meta.stream,i=t.meta.stream,o=o6(e.appEvent),s=o6(t.appEvent);if(n===void 0||i===void 0||o===void 0||s===void 0||e.meta.sessionId!==t.meta.sessionId||e.appEvent.sessionId!==t.appEvent.sessionId||e.appEvent.messageId!==t.appEvent.messageId||e.appEvent.contentIndex!==t.appEvent.contentIndex||n.turnId!==i.turnId||n.kind!==i.kind||o.kind!==s.kind||n.kind!==o.kind||i.kind!==s.kind||i.offset!==n.offset+o.value.length||o.value.length+s.value.length>i6)return;const r=o.value+s.value;return{appEvent:{...e.appEvent,delta:o.kind==="text"?{text:r}:{thinking:r}},meta:{...t.meta,stream:{...n}}}}function tV(e){return Array.isArray(e)?e.filter(t=>typeof t=="object"&&t!==null&&t.type==="text").map(t=>t.text).join(""):""}function W7e(e){for(let t=e.items.length-1;t>=0;t--){const n=e.items[t];if(n.kind==="marker"){const i=n.at;if(typeof i=="string")return i;continue}if(n.kind==="turn"){let i;const o=s=>{typeof s=="string"&&(i===void 0||s>i)&&(i=s)};o(n.endedAt),o(n.startedAt);for(const s of n.steps)o(s.endedAt),o(s.startedAt);if(i!==void 0)return i}}}function q7e(e,t){if(t===void 0)return;const n=e.find(i=>i.kind==="turn"&&i.turnId===t);return n?.kind==="turn"?n.startedAt:void 0}function wp(e,t){const n=q7e(e,t?.["kimiWeb.anchorTurnId"]),i=t?.["kimiWeb.anchorPromptCreatedAt"];return typeof i=="string"&&(n===void 0||i>=n)?{at:i,exclusive:!0}:n!==void 0?{at:n,exclusive:!1}:void 0}function kS(e,t,n){const i=new Map,o=new Set(n??[]);for(const s of e){if(s.skills.length>0)continue;const r=t.find(l=>!o.has(l.promptId)&&l.status!=="queued"&&(s.floor===void 0||(s.floor.exclusive?l.createdAt>s.floor.at:l.createdAt>=s.floor.at))&&tV(l.content)===s.text);r!==void 0&&(o.add(r.promptId),i.set(s.id,r.promptId))}return i}function bS(e,t,n){const i=[];for(const r of t.items){if(r.kind!=="turn")continue;const l=td(r.origin.payload);l.length>0&&i.push({id:`turn:${r.turnId}`,text:r.prompt??"",attachmentCount:r.attachmentIds?.length??0,at:r.startedAt,skills:l})}const o=new Map,s=new Set(n??[]);for(const r of e){const l=i.find(a=>s.has(a.id)||r.floor!==void 0&&(a.at===void 0||(r.floor.exclusive?a.at<=r.floor.at:a.atr.kind==="turn"&&r.turnId===t);return t!==void 0&&s===-1?!1:e.slice(s+1).some(r=>{if(r.kind!=="marker"||r.marker!=="skill")return!1;if(o!==void 0){const a=r.at;if(typeof a!="string"||a<=o)return!1}const l=r.payload?.origin;return l?.kind==="skill_activation"&&l.skillName===n&&l.skillArgs===i})}function nV(e,t,n,i,o){const s=t===void 0?-1:e.findIndex(r=>r.kind==="turn"&&r.turnId===t);return t!==void 0&&s===-1?!1:e.slice(s+1).some(r=>{if(r.kind!=="turn"||o?.terminalOnly===!0&&r.state==="running")return!1;const l=r.origin.payload??r.origin;return l.kind==="skill_activation"&&l.skillName===n&&l.skillArgs===i})}function wS(e,t,n){const i=new Map,o=new Set(n??[]);for(const s of e){const r=s.anchorTurnId===void 0?-1:t.findIndex(a=>a.kind==="turn"&&a.turnId===s.anchorTurnId);if(s.anchorTurnId!==void 0&&r===-1)continue;const l=t.slice(r+1).find(a=>{if(a.kind==="turn"){if(o.has(a.turnId))return!1;const u=a.origin.payload??a.origin;return u.kind==="skill_activation"&&u.skillName===s.skillName&&u.skillArgs===s.skillArgs}if(a.kind==="marker"&&a.marker==="skill"){if(o.has(a.markerId))return!1;if(s.promptFloor!==void 0){const c=a.at;if(typeof c!="string"||c<=s.promptFloor)return!1}const u=a.payload?.origin;return u?.kind==="skill_activation"&&u.skillName===s.skillName&&u.skillArgs===s.skillArgs}return!1});if(l!==void 0){const a=l.kind==="turn"?l.turnId:l.markerId;o.add(a),i.set(s.id,a)}}return i}function Qs(e){return td(e?.origin)}function s6(e,t){const n=Qs(e.metadata);if(n.length===0)return!1;const i=e.content.filter(u=>u.type==="text").map(u=>"text"in u?u.text:"").join(""),o=e.content.filter(u=>u.type!=="text").length,s=e.metadata?.["kimiWeb.promptId"];if(s!==void 0)return t.items.some(c=>c.kind==="turn"&&c.steps.some(d=>d.frames.some(f=>f.kind==="text"&&f.role==="user"&&(f.promptIds?.includes(s)??!1)&&X0(td(f.origin),n))))?!0:t.items.some(c=>c.kind==="turn"&&c.triggerPromptId===s&&(c.prompt??"")===i&&(c.attachmentIds?.length??0)===o&&X0(td(c.origin.payload),n));const r=e.metadata?.["kimiWeb.anchorTurnId"],l=r===void 0?-1:t.items.findIndex(u=>u.kind==="turn"&&u.turnId===r);return r!==void 0&&l===-1?!1:(l===-1?t.items:t.items.slice(l+1)).some(u=>u.kind==="turn"&&(u.prompt??"")===i&&(u.attachmentIds?.length??0)===o&&X0(td(u.origin.payload),n))}function V7e(e,t){const i=e.items.filter(h=>h.kind==="turn")[0]?.turnId,o=new Map(e.tasks.map(h=>[h.taskId,h])),s=new Map(e.prompts.map(h=>[h.promptId,h])),r=eV(e.prompts,XU(e.items)),l=h=>h.kind==="turn"?h.origin.payload??h.origin:void 0,a=new Set,u=K7e(e.items),c=e.items.flatMap((h,m)=>{if(h.kind==="turn"){const g=u.turnPart.get(m)??h,y=g.startedAt!==void 0||g.steps.some(k=>k.startedAt!==void 0);return jD(g,e.attachments,o,h.turnId===i&&!y&&e.hasMoreOlder!==!0?t.agentCreatedAt:void 0,void 0,t.sessionId,t.pendingInteractionAtByStepId,t.thinkingTiming,s,r)}if(h.kind==="marker"&&h.marker==="compaction"){const g=Z7e(h.payload,h.at,t.sessionId,h.markerId,Q7e(e.items,m));if(g===void 0)return[];const y=u.continuation.get(h.markerId);return y===void 0?[g]:[g,...jD(y,e.attachments,o,void 0,void 0,t.sessionId,t.pendingInteractionAtByStepId,t.thinkingTiming,s,r,!0,`:${h.markerId}`)]}if(h.kind==="marker"&&h.marker==="cron.fired"){const g=h.payload,y=g?.origin?.jobId,k=typeof g?.prompt=="string"?g.prompt:void 0,v=e.items.slice(m+1).find(w=>{if(w.kind!=="turn"||a.has(w.turnId))return!1;const M=l(w);return M?.kind==="cron_job"&&(y===void 0||M.jobId===y)&&(k===void 0||w.kind==="turn"&&YU(w.prompt??"")===k)});if(v!==void 0&&v.kind==="turn")return a.add(v.turnId),[];const C=G7e(h.payload,h.at,t.sessionId,h.markerId);return C===void 0?[]:[C]}return[]}),d=e.interactions.map(h=>_1(h,t.sessionId)).filter(h=>h!==void 0),f=e.meta.activity==="turn";return iw(c,d,t.getFileUrl,f,t.planReviewByToolCallId??{},t.plansByToolCallId??{},{getSessionMediaUrl:t.getSessionMediaUrl}).map(X7e)}function K7e(e){const t=new Map,n=new Map;for(let i=0;i[]);let a=-1;for(const u of o.steps){for(;a+1=s[a+1].at;)a+=1;a<0?r.push(u):l[a].push(u)}if(r.length!==o.steps.length){t.set(i,{...o,steps:r,endedAt:r.at(-1)?.endedAt,durationMs:void 0});for(let u=0;ug.startedAt),i])??"",promptId:e.turnId,daemonTurnId:e.ordinal,daemonTurnState:e.state,metadata:{origin:f}}]:[],...yS(e,t,n,i,o,s,{includeOrigin:c!==!0,pendingInteractionAtByStepId:r,thinkingTiming:l,promptById:a,promptForTurn:u})]}function Z7e(e,t,n,i,o){const s=e;if(s?.phase!=="completed")return;const r=s.result??{},l={trigger:o,tokensBefore:typeof r.tokensBefore=="number"?r.tokensBefore:void 0,tokensAfter:typeof r.tokensAfter=="number"?r.tokensAfter:void 0};return{id:i,sessionId:n,role:"assistant",content:typeof r.summary=="string"?[{type:"text",text:r.summary}]:[],createdAt:t??"",metadata:{origin:{kind:"compaction_summary"},[tj]:l}}}function G7e(e,t,n,i){const o=e,s=o?.origin;if(!(s?.kind!=="cron_job"||typeof o?.prompt!="string"))return{id:i,sessionId:n,role:"user",content:[{type:"text",text:o.prompt}],createdAt:t??"",metadata:{origin:s}}}function Q7e(e,t){for(let n=t-1;n>=0;n--){const i=e[n];if(i?.kind!=="marker"||i.marker!=="compaction")continue;const o=i.payload;if(o?.phase==="started")return o.trigger==="manual"?"manual":"auto"}return"auto"}function _1(e,t){if(e.interactionKind!=="approval"||e.state!=="pending")return;const n=e.request??{};if(typeof n.toolName!="string"||typeof n.action!="string")return;const i=typeof e.toolCallId=="string"?e.toolCallId:typeof n.toolCallId=="string"?n.toolCallId:void 0;if(i!==void 0)return{approvalId:e.interactionId,sessionId:t,turnId:typeof n.turnId=="number"?n.turnId:void 0,toolCallId:i,toolName:n.toolName,action:n.action,display:n.display,expiresAt:"",createdAt:""}}function Hg(e,t){if(e.interactionKind!=="question"||e.state!=="pending")return;const n=e.request??{};if(!Array.isArray(n.questions))return;const i=typeof e.toolCallId=="string"?e.toolCallId:typeof n.toolCallId=="string"?n.toolCallId:typeof n.tool_call_id=="string"?n.tool_call_id:void 0;return{questionId:e.interactionId,sessionId:t,turnId:typeof n.turnId=="number"?n.turnId:typeof n.turn_id=="number"?n.turn_id:void 0,toolCallId:i,questions:n.questions.map(Y7e),createdAt:""}}function Y7e(e){const t=Array.isArray(e.options)?e.options:[];return{id:typeof e.id=="string"?e.id:"",question:typeof e.question=="string"?e.question:"",header:typeof e.header=="string"?e.header:void 0,body:typeof e.body=="string"?e.body:void 0,options:t.map(J7e),multiSelect:e.multi_select===!0,allowOther:e.allow_other===!0,otherLabel:typeof e.other_label=="string"?e.other_label:void 0,otherDescription:typeof e.other_description=="string"?e.other_description:void 0}}function J7e(e){const t=e??{};return{id:typeof t.id=="string"?t.id:"",label:typeof t.label=="string"?t.label:"",description:typeof t.description=="string"?t.description:void 0,recommended:t.recommended===!0||t.is_recommended===!0}}function X7e(e){if(e.createdAt!==""&&e.endedAt!=="")return e;const t={...e};return t.createdAt===""&&delete t.createdAt,t.endedAt===""&&delete t.endedAt,t}function exe(){let e=[];const t=(n,i)=>{const s=V7e(n,i).map((r,l)=>{const a=JSON.stringify(r),u=e[l],c=u!==void 0&&u.fingerprint===a?u.turn:r;return e[l]={turn:c,fingerprint:a},c});return e.length=s.length,s};return t.reset=()=>{e=[]},t}function iV(e){if(e instanceof Error)return typeof e.stack=="string"&&e.stack?e.stack:e.message?`${e.name}: ${e.message}`:e.name;if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean"||typeof e=="bigint")return String(e);try{return JSON.stringify(e)}catch{return String(e)}}function txe(e){if(e instanceof Error)return{name:e.name,message:e.message};const t=e;return{name:typeof t?.name=="string"?t.name:void 0,message:typeof t?.message=="string"?t.message:void 0}}function nxe(e){return e instanceof Error&&typeof e.stack=="string"&&e.stack?e.stack:void 0}function ixe(e){if(!(typeof e!="number"||!Number.isFinite(e)))return new Date(e).toISOString()}function HD(e){if(!(typeof e!="number"||!Number.isFinite(e)))return`${Math.round(e)}ms`}function oxe(e,t,n){const i=lxe(e),o=rxe(e),s=new Map(e.prompts.map(d=>[d.promptId,d])),r=n.filter(d=>{const f=d.metadata?.["kimiWeb.promptId"];if(f===void 0||o===void 0)return!0;const h=s.get(f)?.steeredAt;return h===void 0||h>=o}),l=e.prompts.filter(sxe).filter(d=>!i.has(d.promptId)).filter(d=>o===void 0||d.steeredAt>=o);if(l.length===0)return[...r];l.sort((d,f)=>d.steeredAtt)&&(t=n.startedAt);return t}function lxe(e){const t=new Set;for(const n of e.items)if(n.kind==="turn"){for(const i of n.steps)for(const o of i.frames)if(!(o.kind!=="text"||o.role!=="user"))for(const s of o.promptIds??[])t.add(s)}return t}function axe(e){return Array.isArray(e)?e.map(t=>Q4(t)).filter(t=>t.type!=="text"||t.text.length>0):[]}function uxe(e){return e.startsWith("diff --git")||e.startsWith("index ")||e.startsWith("--- ")||e.startsWith("+++ ")||e.startsWith("new file mode")||e.startsWith("deleted file mode")||e.startsWith("old mode")||e.startsWith("new mode")||e.startsWith("similarity index")||e.startsWith("dissimilarity index")||e.startsWith("rename from")||e.startsWith("rename to")||e.startsWith("copy from")||e.startsWith("copy to")||e.startsWith("Binary files")}function cxe(e){const t=[];if(!e)return t;let n=0,i=0,o=!1;for(const s of e.split(` -`)){if(s.startsWith("diff --git")){o=!1;continue}if(!o&&uxe(s))continue;if(s.startsWith("@@")){const a=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(s);a&&(n=Number.parseInt(a[1],10),i=Number.parseInt(a[2],10)),o=!0,t.push({type:"hunk",text:s});continue}if(!o||s.startsWith("\\"))continue;const r=s.charAt(0),l=s.slice(1);r==="+"?(t.push({type:"add",text:l,newNo:i}),i+=1):r==="-"?(t.push({type:"del",text:l,oldNo:n}),n+=1):r===" "&&(t.push({type:"context",text:l,oldNo:n,newNo:i}),n+=1,i+=1)}return t}function WD(e){return e?e.split(` -`).map(t=>t.trimEnd()).filter(Boolean).at(-1)??"":""}function dxe(e){return e.suspendedReason||WD(e.text)||WD(e.outputLines?.join(` -`))||e.summary||""}function fxe(e){return e.suspendedReason?e.suspendedReason:e.text?e.text:e.outputLines&&e.outputLines.length>0?e.outputLines.join(` -`):e.summary??""}function hxe(e){return e==="completed"?"completed":e==="failed"?"failed":e==="aborted"?"cancelled":"working"}function qD(e,t){return{id:e.agentId??e.item??`result-${t}`,agentId:e.agentId,name:e.item??`subagent ${t+1}`,activity:e.body.split(` -`)[0]??"",phase:hxe(e.outcome),body:e.body}}function pxe(e,t){return!!(t.agentId&&e.agentId===t.agentId||t.item&&e.name.includes(t.item))}function mxe(e,t){const n=e.map(o=>({id:o.id,agentId:o.agentId,name:o.name,activity:dxe(o),phase:o.phase,body:fxe(o)}));if(!t)return n;const i=t.subagents.filter(o=>(o.outcome==="aborted"||o.state==="not_started")&&!e.some(s=>pxe(s,o))).map((o,s)=>qD(o,s));return n.length>0?[...n,...i]:t.subagents.map((o,s)=>qD(o,s))}const gxe=["queued","working","suspended","completed","failed","cancelled"];function oV(e){return e.status==="completed"?"completed":e.status==="failed"?"failed":e.status==="cancelled"?"cancelled":e.subagentPhase?e.subagentPhase:"working"}function vxe(){return{queued:0,working:0,suspended:0,completed:0,failed:0,cancelled:0}}function yxe(e){const t=new Map;for(const n of e){if(n.kind!=="subagent"||n.swarmIndex===void 0)continue;const i=n.parentToolCallId??"swarm",o=t.get(i)??[];o.push({id:n.id,agentId:n.agentId,name:n.description,subagentType:n.subagentType,model:n.model,thinkingEffort:n.thinkingEffort,phase:oV(n),summary:n.outputPreview,outputLines:n.outputLines,text:n.text,suspendedReason:n.suspendedReason,swarmIndex:n.swarmIndex}),t.set(i,o)}return[...t.entries()].map(([n,i])=>{const o=i.toSorted((r,l)=>r.swarmIndex-l.swarmIndex||r.id.localeCompare(l.id)),s=vxe();for(const r of o)s[r.phase]++;return{id:n,members:o,counts:s}}).filter(n=>n.members.length>1).toSorted((n,i)=>{const o=n.members.at(0)?.swarmIndex??0,s=i.members.at(0)?.swarmIndex??0;return o!==s?o-s:n.id.localeCompare(i.id)})}function kxe(e){let t=0,n=0;for(const i of e){n+=i.members.length;for(const o of gxe)(o==="completed"||o==="failed"||o==="cancelled")&&(t+=i.counts[o])}return{done:t,total:n}}function bxe(e){const t=new Map;for(const n of e){if(n.kind!=="subagent"||!n.parentToolCallId)continue;const i=t.get(n.parentToolCallId)??[];i.push({id:n.id,agentId:n.agentId,name:n.description,subagentType:n.subagentType,model:n.model,thinkingEffort:n.thinkingEffort,phase:oV(n),summary:n.outputPreview,outputLines:n.outputLines,text:n.text,suspendedReason:n.suspendedReason,swarmIndex:n.swarmIndex??Number.MAX_SAFE_INTEGER}),t.set(n.parentToolCallId,i)}for(const[n,i]of t)t.set(n,i.toSorted((o,s)=>o.swarmIndex-s.swarmIndex||o.id.localeCompare(s.id)));return t}function CS(e){const t=e.trim();if(!t.startsWith("{"))return null;try{const n=JSON.parse(t);return n&&typeof n=="object"&&!Array.isArray(n)?n:null}catch{return null}}function sV(e){for(const t of["path","file_path","filePath","filename"]){const n=e[t];if(typeof n=="string"&&n.length>0)return n}}const p0=100*1024;function wxe(e){const t=hr(e.name);if(t!=="edit"&&t!=="multi_edit")return null;const n=CS(e.arg);if(!n)return null;if(t==="edit"){if(n.replace_all===!0)return null;const l=typeof n.old_string=="string"?n.old_string:void 0,a=typeof n.new_string=="string"?n.new_string:void 0;return l===void 0||a===void 0||l.length>p0||a.length>p0?null:Ib(l,a)}const i=Array.isArray(n.edits)?n.edits:void 0;if(!i||i.length===0)return null;const o=[];let s=0,r=0;for(const l of i){if(!l||typeof l!="object")return null;const a=l;if(a.replace_all===!0)return null;const u=typeof a.old_string=="string"?a.old_string:void 0,c=typeof a.new_string=="string"?a.new_string:void 0;if(u===void 0||c===void 0||u.length>p0||c.length>p0)return null;const d=Ib(u,c);if(d===null)return null;o.length>0&&o.push({type:"hunk",text:"···"});for(const f of d)o.push({...f,oldNo:f.oldNo!==void 0?f.oldNo+s:void 0,newNo:f.newNo!==void 0?f.newNo+r:void 0});s+=hc(u).length,r+=hc(c).length}return o}const Cxe=5e3;function Axe(e){if(hr(e.name)!=="write")return null;const t=CS(e.arg);return!t||typeof t.content!="string"||t.content.length>p0||t.content.split(` -`).length>Cxe?null:{content:t.content,path:sV(t)}}function xxe(e){const t=CS(e.arg);return t?sV(t):void 0}function Sxe(e){switch(e){case"running":return"running";case"completed":return"completed";case"killed":return"cancelled";default:return"failed"}}function _xe(e,t){return t==="running"?e.stateReason!==void 0?"suspended":"working":t}function Ixe(e){return e==="subagent"?"subagent":e==="shell"?"bash":"tool"}function Mxe(e){return rV(e).parents}function rV(e){const t=new Map,n=new Map;for(const i of e.items)if(i.kind==="turn")for(const o of i.steps)for(const s of o.frames)s.kind!=="tool"||s.agentRefs===void 0||s.agentRefs.forEach((r,l)=>{t.set(r.agentId,s.toolCallId),n.set(r.agentId,l)});return{parents:t,swarmIndexes:n}}function Txe(e,t,n){const i=rV(e);let o=i.parents,s=i.swarmIndexes;if(n!==void 0){for(const[u,c]of i.parents)n.parents.set(u,c);for(const[u,c]of i.swarmIndexes)n.swarmIndexes.set(u,c);o=n.parents,s=n.swarmIndexes}const r=e.tasks.map(u=>{const c=Sxe(u.state);return{id:u.taskId,agentId:u.agentId,sessionId:t,kind:Ixe(u.kind),description:u.description??"",status:c,createdAt:u.startedAt??"",startedAt:u.startedAt,completedAt:u.endedAt,outputPreview:u.outputTail.length>0?u.outputTail:void 0,text:u.resultSummary,subagentPhase:u.kind==="subagent"?_xe(u,c):void 0,suspendedReason:c==="running"?u.stateReason:void 0,model:u.model,thinkingEffort:u.thinkingEffort,runInBackground:u.detached,parentToolCallId:u.agentId!==void 0?o.get(u.agentId):void 0,swarmIndex:u.agentId!==void 0?s.get(u.agentId):void 0}}),l=new Map;r.forEach((u,c)=>{u.agentId!==void 0&&u.id===u.agentId&&l.set(u.agentId,c)});const a=new Set;return r.forEach((u,c)=>{if(u.agentId===void 0||u.id===u.agentId)return;const d=l.get(u.agentId);if(d===void 0)return;const f=r[d],h=u.completedAt!==void 0&&f.startedAt!==void 0&&u.completedAt>=f.startedAt,m=f.status==="running"&&u.status!=="running"&&h;r[d]={...f,backgroundTaskId:u.status==="running"||h?u.id:void 0,status:m?u.status:f.status,subagentPhase:m?u.status==="completed"?"completed":u.status==="cancelled"?"cancelled":"failed":f.subagentPhase,description:f.description.length>0?f.description:u.description,model:f.model??u.model,thinkingEffort:f.thinkingEffort??u.thinkingEffort,completedAt:h?u.completedAt??f.completedAt:f.completedAt,outputPreview:h?f.outputPreview??u.outputPreview:f.outputPreview,text:h?f.text??u.text:f.text},a.add(c)}),r.filter((u,c)=>!a.has(c))}function Exe(){let e=[],t=null,n=null,i=null,o,s,r=!0;const l=new WeakMap,a=u=>{const{messages:c,approvals:d}=u,f=u.sessionActive??!0,h=u.planReviewByToolCallId??{},m=u.plansByToolCallId??{},g=(S,x)=>l.set(S,x);let y=n!==null;if(y){const S=n,x=Object.keys(h);y=x.length===Object.keys(S).length&&x.every(A=>h[A]===S[A])}let k=i!==null;if(k){const S=i,x=Object.keys(m);k=x.length===Object.keys(S).length&&x.every(A=>m[A]===S[A])}const v=e.length>0&&d===t&&y&&k&&u.getFileUrl===o&&u.getSessionMediaUrl===s;let C=0,w=0,M=1;if(v){let S=-1;for(let x=e.length-1;x>=0;x--)if(e[x].role==="assistant"){S=x;break}for(let x=0;x0?[...e.slice(0,C),...L]:L;return e=E,t=d,n={...h},i={...m},o=u.getFileUrl,s=u.getSessionMediaUrl,r=f,E};return a.reset=()=>{e=[],t=null,n=null,i=null,o=void 0,r=!0},a}function Lxe(e){const t=new Map;let n=0;for(let i=e.length-1;i>=0;i--){const o=e[i];if(o.role==="compaction"||o.goalContinuation===!0)break;o.role==="user"&&o.hasUndoAnchor!==!1&&(n++,t.set(o.id,n))}return t}const lV=["light","dark","system"],Nxe=["small","medium","large","xlarge"],z8="medium",aV="kimi-web.color-scheme",r6="kimi-web.font-scale",UD="kimi-web.ui-font-size";function l6(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function AS(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function Fxe(e){try{globalThis.localStorage.removeItem(e)}catch{}}function Dxe(){const e=l6(aV);return e&&lV.includes(e)?e:"system"}const Gy={light:"#ffffff",dark:"#121212"};function Rxe(e){if(typeof document>"u"||!document.documentElement)return;document.documentElement.dataset.colorScheme=e;const t=document.querySelectorAll('meta[name="theme-color"]');if(t.length===0)return;const n=e==="dark"?Gy.dark:e==="light"?Gy.light:null;t.forEach(i=>{const s=(i.getAttribute("media")??"").includes("dark")?Gy.dark:Gy.light;i.setAttribute("content",n??s)})}function uV(e){return Nxe.includes(e)}function Oxe(e){return e<=13?"small":e<=15?"medium":e<=17?"large":"xlarge"}function Pxe(){const e=l6(r6);if(e==="xxlarge")return"xlarge";if(e!==null)return uV(e)?e:z8;const t=l6(UD);if(t===null)return z8;const n=Number(t),i=Number.isFinite(n)?Oxe(n):z8;return AS(r6,i),Fxe(UD),i}function Bxe(e){typeof document>"u"||!document.documentElement||(document.documentElement.dataset.fontScale=e)}const xS=q(Dxe()),SS=q(Pxe());let VD=!1;function $xe(){VD||(VD=!0,ze(xS,Rxe,{immediate:!0}),ze(SS,Bxe,{immediate:!0}))}function zxe(e){lV.includes(e)&&(xS.value=e,AS(aV,e))}function jxe(e){uV(e)&&(SS.value=e,AS(r6,e))}function Xm(){return $xe(),{colorScheme:xS,fontScale:SS,setColorScheme:zxe,setFontScale:jxe}}const Qy=q(!1);let KD=!1;function j8(){const e=document.documentElement.dataset.colorScheme;return e==="dark"?!0:e==="light"?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function ow(){return!KD&&typeof window<"u"&&typeof document<"u"&&(KD=!0,Qy.value=j8(),new MutationObserver(()=>{Qy.value=j8()}).observe(document.documentElement,{attributes:!0,attributeFilter:["data-color-scheme"]}),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{Qy.value=j8()})),Qy}const cV="kimi-web.sidebar-multi-tab";function Hxe(e){try{return globalThis.localStorage.getItem(e)}catch{return null}}function Wxe(e,t){try{globalThis.localStorage.setItem(e,t)}catch{}}function qxe(){return Hxe(cV)==="1"}const dV=q(qxe());function Uxe(e){dV.value=e,Wxe(cV,e?"1":"0")}function Dp(){return{sidebarTabs:dV,setSidebarTabs:Uxe}}function ev(e){let t="";for(const n of e)n.codePointAt(0)>127||/[A-Za-z0-9\-._~]/.test(n)?t+=n:t+=`%${n.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0")}`;return t}function Vxe(e){const t=e.split("/").map(ev).join("/");return t.startsWith("//")?`/%2F${t.slice(2)}`:t}function _S(e){return e.replace(/%/g,"%25").replace(/&/g,"%26").replace(//g,"%3E").replace(/([\\[\]])/g,"\\$1").replace(/\n/g,"%0A").replace(/\r/g,"%0D")}function ZD(e){return e.replace(/\\([\\[\]])/g,"$1").replace(/%0A/g,` -`).replace(/%0D/g,"\r").replace(/%26/g,"&").replace(/%3C/g,"<").replace(/%3E/g,">").replace(/%25/g,"%")}function Kxe(e){return e.replace(/%0A/g,` -`).replace(/%0D/g,"\r").replace(/%26/g,"&").replace(/%3C/g,"<").replace(/%3E/g,">").replace(/%25/g,"%")}function Zxe(e,t){const n=t?e.replace(/\\([\\<>])/g,"$1"):e.replace(/\\([\\()])/g,"$1");return tv(n)}function tv(e){try{return decodeURIComponent(e)}catch{return e}}let GD;function a6(e){return GD??=new Intl.Segmenter("und",{granularity:"grapheme"}),[...GD.segment(e)].map(t=>t.segment)}function fV(e,t){const n=a6(e);return n.length<=t?e:`${n.slice(0,t-1).join("")}…`}const Mb="kimi-code://skill/";function IS(e){return e?e.startsWith(Mb)&&e.length>Mb.length?"skill":e.startsWith("#")||e.startsWith("?")||e.startsWith("//")||/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(e)&&!/^[a-zA-Z]:(?:[\\/]|%5c)/i.test(e)?null:e.endsWith("/")||e.endsWith("\\")||/%5c$/i.test(e)?"folder":"file":null}function z1(e){const t=e.search(/[#?]/);return t>0?e.slice(0,t):e}function hV(e){const t=e.slice(Mb.length);return tv(t)}function Rp(e){const t=_S(e.name);if(e.kind==="skill")return`[${t}](${Mb}${ev(e.name)})`;const n=e.kind==="folder"&&!e.path.endsWith("/")&&!e.path.endsWith("\\")?`${e.path}/`:e.path;return`[${t}](${Vxe(n)})`}const G9="kimi-code-composer://attachments/";function Nf(e){return`[${_S(e.name)}](${G9}${e.attId})`}const qh="kimi-code-composer://quote/",Gxe=12;function Mm(e){const t=e.split(` -`).map(i=>i.trim()).find(i=>i.length>0)??"",n=fV(t,Gxe);return n.length>0?n:"…"}function sw(e){const t=e.source!==void 0&&e.source.length>0?`?source=${ev(e.source)}`:"",n=e.comment!==void 0&&e.comment.length>0?`?comment=${ev(e.comment)}`:"";return`[${_S(Mm(e.text))}](${qh}${ev(e.text)}${t}${n})`}function pV(e){const t=e.indexOf("?source="),n=e.indexOf("?comment="),i=[t,n].filter(s=>s>=0).sort((s,r)=>s-r)[0]??-1,o={text:tv(i===-1?e:e.slice(0,i))};if(t>=0){const s=n>t?n:e.length;o.source=tv(e.slice(t+8,s))}if(n>=0){const s=t>n?t:e.length;o.comment=tv(e.slice(n+9,s))}return o}const QD=document.createElement("i");function Qxe(e){const t="&"+e+";";QD.innerHTML=t;const n=QD.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function pc(e,t,n,i){const o=e.length;let s=0,r;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,n=n>0?n:0,i.length<1e4)r=Array.from(i),r.unshift(t,n),e.splice(...r);else for(n&&e.splice(t,n);s0?(pc(e,e.length,0,t),e):t}const YD={}.hasOwnProperty;function Yxe(e){const t={};let n=-1;for(;++n-1&&e.test(String.fromCharCode(n))}}function oo(e,t,n,i){const o=i?i-1:Number.POSITIVE_INFINITY;let s=0;return r;function r(a){return Ii(a)?(e.enter(n),l(a)):t(a)}function l(a){return Ii(a)&&s++r))return;const E=t.events.length;let S=E,x,A;for(;S--;)if(t.events[S][0]==="exit"&&t.events[S][1].type==="chunkFlow"){if(x){A=t.events[S][1].end;break}x=!0}for(k(i),L=E;LC;){const M=n[w];t.containerState=M[1],M[0].exit.call(t,e)}n.length=C}function v(){o.write([null]),s=void 0,o=void 0,t.containerState._closeFlow=void 0}}function uSe(e,t,n){return oo(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function XD(e){if(e===null||Nl(e)||oSe(e))return 1;if(iSe(e))return 2}function TS(e,t,n){const i=[];let o=-1;for(;++o1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[i][1].end},f={...e[n][1].start};eR(d,-a),eR(f,a),r={type:a>1?"strongSequence":"emphasisSequence",start:d,end:{...e[i][1].end}},l={type:a>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:f},s={type:a>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[n][1].start}},o={type:a>1?"strong":"emphasis",start:{...r.start},end:{...l.end}},e[i][1].end={...r.start},e[n][1].start={...l.end},u=[],e[i][1].end.offset-e[i][1].start.offset&&(u=Da(u,[["enter",e[i][1],t],["exit",e[i][1],t]])),u=Da(u,[["enter",o,t],["enter",r,t],["exit",r,t],["enter",s,t]]),u=Da(u,TS(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),u=Da(u,[["exit",s,t],["enter",l,t],["exit",l,t],["exit",o,t]]),e[n][1].end.offset-e[n][1].start.offset?(c=2,u=Da(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):c=0,pc(e,i-1,n-i+3,u),n=i+u.length-c-2;break}}for(n=-1;++n0&&Ii(L)?oo(e,v,"linePrefix",s+1)(L):v(L)}function v(L){return L===null||jn(L)?e.check(tR,g,w)(L):(e.enter("codeFlowValue"),C(L))}function C(L){return L===null||jn(L)?(e.exit("codeFlowValue"),v(L)):(e.consume(L),C)}function w(L){return e.exit("codeFenced"),t(L)}function M(L,E,S){let x=0;return A;function A(R){return L.enter("lineEnding"),L.consume(R),L.exit("lineEnding"),T}function T(R){return L.enter("codeFencedFence"),Ii(R)?oo(L,I,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):I(R)}function I(R){return R===l?(L.enter("codeFencedFenceSequence"),O(R)):S(R)}function O(R){return R===l?(x++,L.consume(R),O):x>=r?(L.exit("codeFencedFenceSequence"),Ii(R)?oo(L,H,"whitespace")(R):H(R)):S(R)}function H(R){return R===null||jn(R)?(L.exit("codeFencedFence"),E(R)):S(R)}}}function wSe(e,t,n){const i=this;return o;function o(r){return r===null?n(r):(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),s)}function s(r){return i.parser.lazy[i.now().line]?n(r):t(r)}}const H8={name:"codeIndented",tokenize:ASe},CSe={partial:!0,tokenize:xSe};function ASe(e,t,n){const i=this;return o;function o(u){return e.enter("codeIndented"),oo(e,s,"linePrefix",5)(u)}function s(u){const c=i.events[i.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?r(u):n(u)}function r(u){return u===null?a(u):jn(u)?e.attempt(CSe,r,a)(u):(e.enter("codeFlowValue"),l(u))}function l(u){return u===null||jn(u)?(e.exit("codeFlowValue"),r(u)):(e.consume(u),l)}function a(u){return e.exit("codeIndented"),t(u)}}function xSe(e,t,n){const i=this;return o;function o(r){return i.parser.lazy[i.now().line]?n(r):jn(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),o):oo(e,s,"linePrefix",5)(r)}function s(r){const l=i.events[i.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(r):jn(r)?o(r):n(r)}}const SSe={name:"codeText",previous:ISe,resolve:_Se,tokenize:MSe};function _Se(e){let t=e.length-4,n=3,i,o;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(i=n;++i=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(t,n,i){const o=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return i&&Wg(this.left,i),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Wg(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Wg(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(r):e.interrupt(i.parser.constructs.flow,n,t)(r)}}function kV(e,t,n,i,o,s,r,l,a){const u=a||Number.POSITIVE_INFINITY;let c=0;return d;function d(k){return k===60?(e.enter(i),e.enter(o),e.enter(s),e.consume(k),e.exit(s),f):k===null||k===32||k===41||u6(k)?n(k):(e.enter(i),e.enter(r),e.enter(l),e.enter("chunkString",{contentType:"string"}),g(k))}function f(k){return k===62?(e.enter(s),e.consume(k),e.exit(s),e.exit(o),e.exit(i),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),h(k))}function h(k){return k===62?(e.exit("chunkString"),e.exit(l),f(k)):k===null||k===60||jn(k)?n(k):(e.consume(k),k===92?m:h)}function m(k){return k===60||k===62||k===92?(e.consume(k),h):h(k)}function g(k){return!c&&(k===null||k===41||Nl(k))?(e.exit("chunkString"),e.exit(l),e.exit(r),e.exit(i),t(k)):c999||h===null||h===91||h===93&&!a||h===94&&!l&&"_hiddenFootnoteSupport"in r.parser.constructs?n(h):h===93?(e.exit(s),e.enter(o),e.consume(h),e.exit(o),e.exit(i),t):jn(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===null||h===91||h===93||jn(h)||l++>999?(e.exit("chunkString"),c(h)):(e.consume(h),a||(a=!Ii(h)),h===92?f:d)}function f(h){return h===91||h===92||h===93?(e.consume(h),l++,d):d(h)}}function wV(e,t,n,i,o,s){let r;return l;function l(f){return f===34||f===39||f===40?(e.enter(i),e.enter(o),e.consume(f),e.exit(o),r=f===40?41:f,a):n(f)}function a(f){return f===r?(e.enter(o),e.consume(f),e.exit(o),e.exit(i),t):(e.enter(s),u(f))}function u(f){return f===r?(e.exit(s),a(r)):f===null?n(f):jn(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),oo(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(f))}function c(f){return f===r||f===null||jn(f)?(e.exit("chunkString"),u(f)):(e.consume(f),f===92?d:c)}function d(f){return f===r||f===92?(e.consume(f),c):c(f)}}function nv(e,t){let n;return i;function i(o){return jn(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,i):Ii(o)?oo(e,i,n?"linePrefix":"lineSuffix")(o):t(o)}}const OSe={name:"definition",tokenize:BSe},PSe={partial:!0,tokenize:$Se};function BSe(e,t,n){const i=this;let o;return s;function s(h){return e.enter("definition"),r(h)}function r(h){return bV.call(i,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function l(h){return o=MS(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),a):n(h)}function a(h){return Nl(h)?nv(e,u)(h):u(h)}function u(h){return kV(e,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function c(h){return e.attempt(PSe,d,d)(h)}function d(h){return Ii(h)?oo(e,f,"whitespace")(h):f(h)}function f(h){return h===null||jn(h)?(e.exit("definition"),i.parser.defined.push(o),t(h)):n(h)}}function $Se(e,t,n){return i;function i(l){return Nl(l)?nv(e,o)(l):n(l)}function o(l){return wV(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function s(l){return Ii(l)?oo(e,r,"whitespace")(l):r(l)}function r(l){return l===null||jn(l)?t(l):n(l)}}const zSe={name:"hardBreakEscape",tokenize:jSe};function jSe(e,t,n){return i;function i(s){return e.enter("hardBreakEscape"),e.consume(s),o}function o(s){return jn(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const HSe={name:"headingAtx",resolve:WSe,tokenize:qSe};function WSe(e,t){let n=e.length-2,i=3,o,s;return e[i][1].type==="whitespace"&&(i+=2),n-2>i&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(i===n-1||n-4>i&&e[n-2][1].type==="whitespace")&&(n-=i+1===n?2:4),n>i&&(o={type:"atxHeadingText",start:e[i][1].start,end:e[n][1].end},s={type:"chunkText",start:e[i][1].start,end:e[n][1].end,contentType:"text"},pc(e,i,n-i+1,[["enter",o,t],["enter",s,t],["exit",s,t],["exit",o,t]])),e}function qSe(e,t,n){let i=0;return o;function o(c){return e.enter("atxHeading"),s(c)}function s(c){return e.enter("atxHeadingSequence"),r(c)}function r(c){return c===35&&i++<6?(e.consume(c),r):c===null||Nl(c)?(e.exit("atxHeadingSequence"),l(c)):n(c)}function l(c){return c===35?(e.enter("atxHeadingSequence"),a(c)):c===null||jn(c)?(e.exit("atxHeading"),t(c)):Ii(c)?oo(e,l,"whitespace")(c):(e.enter("atxHeadingText"),u(c))}function a(c){return c===35?(e.consume(c),a):(e.exit("atxHeadingSequence"),l(c))}function u(c){return c===null||c===35||Nl(c)?(e.exit("atxHeadingText"),l(c)):(e.consume(c),u)}}const USe=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],iR=["pre","script","style","textarea"],VSe={concrete:!0,name:"htmlFlow",resolveTo:GSe,tokenize:QSe},KSe={partial:!0,tokenize:JSe},ZSe={partial:!0,tokenize:YSe};function GSe(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function QSe(e,t,n){const i=this;let o,s,r,l,a;return u;function u(G){return c(G)}function c(G){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(G),d}function d(G){return G===33?(e.consume(G),f):G===47?(e.consume(G),s=!0,g):G===63?(e.consume(G),o=3,i.interrupt?t:$):Yu(G)?(e.consume(G),r=String.fromCharCode(G),y):n(G)}function f(G){return G===45?(e.consume(G),o=2,h):G===91?(e.consume(G),o=5,l=0,m):Yu(G)?(e.consume(G),o=4,i.interrupt?t:$):n(G)}function h(G){return G===45?(e.consume(G),i.interrupt?t:$):n(G)}function m(G){const te="CDATA[";return G===te.charCodeAt(l++)?(e.consume(G),l===te.length?i.interrupt?t:I:m):n(G)}function g(G){return Yu(G)?(e.consume(G),r=String.fromCharCode(G),y):n(G)}function y(G){if(G===null||G===47||G===62||Nl(G)){const te=G===47,le=r.toLowerCase();return!te&&!s&&iR.includes(le)?(o=1,i.interrupt?t(G):I(G)):USe.includes(r.toLowerCase())?(o=6,te?(e.consume(G),k):i.interrupt?t(G):I(G)):(o=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(G):s?v(G):C(G))}return G===45||mu(G)?(e.consume(G),r+=String.fromCharCode(G),y):n(G)}function k(G){return G===62?(e.consume(G),i.interrupt?t:I):n(G)}function v(G){return Ii(G)?(e.consume(G),v):A(G)}function C(G){return G===47?(e.consume(G),A):G===58||G===95||Yu(G)?(e.consume(G),w):Ii(G)?(e.consume(G),C):A(G)}function w(G){return G===45||G===46||G===58||G===95||mu(G)?(e.consume(G),w):M(G)}function M(G){return G===61?(e.consume(G),L):Ii(G)?(e.consume(G),M):C(G)}function L(G){return G===null||G===60||G===61||G===62||G===96?n(G):G===34||G===39?(e.consume(G),a=G,E):Ii(G)?(e.consume(G),L):S(G)}function E(G){return G===a?(e.consume(G),a=null,x):G===null||jn(G)?n(G):(e.consume(G),E)}function S(G){return G===null||G===34||G===39||G===47||G===60||G===61||G===62||G===96||Nl(G)?M(G):(e.consume(G),S)}function x(G){return G===47||G===62||Ii(G)?C(G):n(G)}function A(G){return G===62?(e.consume(G),T):n(G)}function T(G){return G===null||jn(G)?I(G):Ii(G)?(e.consume(G),T):n(G)}function I(G){return G===45&&o===2?(e.consume(G),F):G===60&&o===1?(e.consume(G),P):G===62&&o===4?(e.consume(G),K):G===63&&o===3?(e.consume(G),$):G===93&&o===5?(e.consume(G),W):jn(G)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(KSe,ne,O)(G)):G===null||jn(G)?(e.exit("htmlFlowData"),O(G)):(e.consume(G),I)}function O(G){return e.check(ZSe,H,ne)(G)}function H(G){return e.enter("lineEnding"),e.consume(G),e.exit("lineEnding"),R}function R(G){return G===null||jn(G)?O(G):(e.enter("htmlFlowData"),I(G))}function F(G){return G===45?(e.consume(G),$):I(G)}function P(G){return G===47?(e.consume(G),r="",z):I(G)}function z(G){if(G===62){const te=r.toLowerCase();return iR.includes(te)?(e.consume(G),K):I(G)}return Yu(G)&&r.length<8?(e.consume(G),r+=String.fromCharCode(G),z):I(G)}function W(G){return G===93?(e.consume(G),$):I(G)}function $(G){return G===62?(e.consume(G),K):G===45&&o===2?(e.consume(G),$):I(G)}function K(G){return G===null||jn(G)?(e.exit("htmlFlowData"),ne(G)):(e.consume(G),K)}function ne(G){return e.exit("htmlFlow"),t(G)}}function YSe(e,t,n){const i=this;return o;function o(r){return jn(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),s):n(r)}function s(r){return i.parser.lazy[i.now().line]?n(r):t(r)}}function JSe(e,t,n){return i;function i(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(rw,t,n)}}const XSe={name:"htmlText",tokenize:e_e};function e_e(e,t,n){const i=this;let o,s,r;return l;function l($){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume($),a}function a($){return $===33?(e.consume($),u):$===47?(e.consume($),M):$===63?(e.consume($),C):Yu($)?(e.consume($),S):n($)}function u($){return $===45?(e.consume($),c):$===91?(e.consume($),s=0,m):Yu($)?(e.consume($),v):n($)}function c($){return $===45?(e.consume($),h):n($)}function d($){return $===null?n($):$===45?(e.consume($),f):jn($)?(r=d,P($)):(e.consume($),d)}function f($){return $===45?(e.consume($),h):d($)}function h($){return $===62?F($):$===45?f($):d($)}function m($){const K="CDATA[";return $===K.charCodeAt(s++)?(e.consume($),s===K.length?g:m):n($)}function g($){return $===null?n($):$===93?(e.consume($),y):jn($)?(r=g,P($)):(e.consume($),g)}function y($){return $===93?(e.consume($),k):g($)}function k($){return $===62?F($):$===93?(e.consume($),k):g($)}function v($){return $===null||$===62?F($):jn($)?(r=v,P($)):(e.consume($),v)}function C($){return $===null?n($):$===63?(e.consume($),w):jn($)?(r=C,P($)):(e.consume($),C)}function w($){return $===62?F($):C($)}function M($){return Yu($)?(e.consume($),L):n($)}function L($){return $===45||mu($)?(e.consume($),L):E($)}function E($){return jn($)?(r=E,P($)):Ii($)?(e.consume($),E):F($)}function S($){return $===45||mu($)?(e.consume($),S):$===47||$===62||Nl($)?x($):n($)}function x($){return $===47?(e.consume($),F):$===58||$===95||Yu($)?(e.consume($),A):jn($)?(r=x,P($)):Ii($)?(e.consume($),x):F($)}function A($){return $===45||$===46||$===58||$===95||mu($)?(e.consume($),A):T($)}function T($){return $===61?(e.consume($),I):jn($)?(r=T,P($)):Ii($)?(e.consume($),T):x($)}function I($){return $===null||$===60||$===61||$===62||$===96?n($):$===34||$===39?(e.consume($),o=$,O):jn($)?(r=I,P($)):Ii($)?(e.consume($),I):(e.consume($),H)}function O($){return $===o?(e.consume($),o=void 0,R):$===null?n($):jn($)?(r=O,P($)):(e.consume($),O)}function H($){return $===null||$===34||$===39||$===60||$===61||$===96?n($):$===47||$===62||Nl($)?x($):(e.consume($),H)}function R($){return $===47||$===62||Nl($)?x($):n($)}function F($){return $===62?(e.consume($),e.exit("htmlTextData"),e.exit("htmlText"),t):n($)}function P($){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume($),e.exit("lineEnding"),z}function z($){return Ii($)?oo(e,W,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)($):W($)}function W($){return e.enter("htmlTextData"),r($)}}const ES={name:"labelEnd",resolveAll:o_e,resolveTo:s_e,tokenize:r_e},t_e={tokenize:l_e},n_e={tokenize:a_e},i_e={tokenize:u_e};function o_e(e){let t=-1;const n=[];for(;++t=3&&(u===null||jn(u))?(e.exit("thematicBreak"),t(u)):n(u)}function a(u){return u===o?(e.consume(u),i++,a):(e.exit("thematicBreakSequence"),Ii(u)?oo(e,l,"whitespace")(u):l(u))}}const vl={continuation:{tokenize:k_e},exit:w_e,name:"list",tokenize:y_e},g_e={partial:!0,tokenize:C_e},v_e={partial:!0,tokenize:b_e};function y_e(e,t,n){const i=this,o=i.events[i.events.length-1];let s=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,r=0;return l;function l(h){const m=i.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!i.containerState.marker||h===i.containerState.marker:c6(h)){if(i.containerState.type||(i.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(Q9,n,u)(h):u(h);if(!i.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),a(h)}return n(h)}function a(h){return c6(h)&&++r<10?(e.consume(h),a):(!i.interrupt||r<2)&&(i.containerState.marker?h===i.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),u(h)):n(h)}function u(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||h,e.check(rw,i.interrupt?n:c,e.attempt(g_e,f,d))}function c(h){return i.containerState.initialBlankLine=!0,s++,f(h)}function d(h){return Ii(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),f):n(h)}function f(h){return i.containerState.size=s+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function k_e(e,t,n){const i=this;return i.containerState._closeFlow=void 0,e.check(rw,o,s);function o(l){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,oo(e,t,"listItemIndent",i.containerState.size+1)(l)}function s(l){return i.containerState.furtherBlankLines||!Ii(l)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,r(l)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(v_e,t,r)(l))}function r(l){return i.containerState._closeFlow=!0,i.interrupt=void 0,oo(e,e.attempt(vl,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function b_e(e,t,n){const i=this;return oo(e,o,"listItemIndent",i.containerState.size+1);function o(s){const r=i.events[i.events.length-1];return r&&r[1].type==="listItemIndent"&&r[2].sliceSerialize(r[1],!0).length===i.containerState.size?t(s):n(s)}}function w_e(e){e.exit(this.containerState.type)}function C_e(e,t,n){const i=this;return oo(e,o,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(s){const r=i.events[i.events.length-1];return!Ii(s)&&r&&r[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const oR={name:"setextUnderline",resolveTo:A_e,tokenize:x_e};function A_e(e,t){let n=e.length,i,o,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){i=n;break}e[n][1].type==="paragraph"&&(o=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const r={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",s?(e.splice(o,0,["enter",r,t]),e.splice(s+1,0,["exit",e[i][1],t]),e[i][1].end={...e[s][1].end}):e[i][1]=r,e.push(["exit",r,t]),e}function x_e(e,t,n){const i=this;let o;return s;function s(u){let c=i.events.length,d;for(;c--;)if(i.events[c][1].type!=="lineEnding"&&i.events[c][1].type!=="linePrefix"&&i.events[c][1].type!=="content"){d=i.events[c][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||d)?(e.enter("setextHeadingLine"),o=u,r(u)):n(u)}function r(u){return e.enter("setextHeadingLineSequence"),l(u)}function l(u){return u===o?(e.consume(u),l):(e.exit("setextHeadingLineSequence"),Ii(u)?oo(e,a,"lineSuffix")(u):a(u))}function a(u){return u===null||jn(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const S_e={tokenize:__e};function __e(e){const t=this,n=e.attempt(rw,i,e.attempt(this.parser.constructs.flowInitial,o,oo(e,e.attempt(this.parser.constructs.flow,o,e.attempt(LSe,o)),"linePrefix")));return n;function i(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function o(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const I_e={resolveAll:AV()},M_e=CV("string"),T_e=CV("text");function CV(e){return{resolveAll:AV(e==="text"?E_e:void 0),tokenize:t};function t(n){const i=this,o=this.parser.constructs[e],s=n.attempt(o,r,l);return r;function r(c){return u(c)?s(c):l(c)}function l(c){if(c===null){n.consume(c);return}return n.enter("data"),n.consume(c),a}function a(c){return u(c)?(n.exit("data"),s(c)):(n.consume(c),a)}function u(c){if(c===null)return!0;const d=o[c];let f=-1;if(d)for(;++f-1){const l=r[0];typeof l=="string"?r[0]=l.slice(i):r.shift()}s>0&&r.push(e[o].slice(0,s))}return r}function W_e(e,t){let n=-1;const i=[];let o;for(;++n0;if(s||e[c]!==(h?"!":"[")||r===null)continue;const m=e.slice(c+(h?2:1),d-1);let g=e.slice(r.start,r.end),y=!1;g.startsWith("<")&&(y=!0,g=g.slice(1,-1)),!(!m||!g)&&n.push({start:c,end:f,rawText:m,rawDest:g,angle:y,image:h})}return n}function Z_e(e,t){const{start:n,end:i,rawText:o,rawDest:s,angle:r,image:l}=e;if(l&&!s.startsWith(qh))return null;if(s.startsWith(G9)&&s.length>G9.length){const u=ZD(o),c=s.slice(G9.length);return{type:"attachment",start:n,end:i,attrs:{attId:c,name:u,kind:t?.(c)??(u.endsWith("/")?"folder":"file")},rawDest:s}}if(s.startsWith(qh)&&s.length>qh.length)return{type:"quote",start:n,end:i,attrs:pV(s.slice(qh.length)),rawDest:s};const a=IS(s);return a===null?null:a==="skill"?{type:"mention",start:n,end:i,attrs:{kind:a,name:hV(s),path:""},rawDest:s}:{type:"mention",start:n,end:i,attrs:{kind:a,name:ZD(o),path:Zxe(s,r)},rawDest:s}}const rR=/\[(?:\\.|[^\\[\]\n])*\]\((kimi-code-composer:\/\/quote\/[^\s)]+)\)/g;function G_e(e){const t=[];rR.lastIndex=0;let n;for(;(n=rR.exec(e))!==null;){let i=0;for(let s=n.index-1;s>=0&&e[s]==="\\";s-=1)i+=1;if(i%2===0)continue;const o=n[1];o===void 0||o.length<=qh.length||t.push({type:"quote",start:n.index-1,end:n.index+n[0].length,attrs:pV(o.slice(qh.length)),rawDest:o})}return t}function lw(e,t){const n=[];for(const i of xV(e)){const o=Z_e(i,t);o&&n.push(o)}return n.push(...G_e(e)),n.sort((i,o)=>i.start-o.start),n}function Ff(e){return lw(e).filter(t=>t.type==="mention").map(({start:t,end:n,attrs:i,rawDest:o})=>({start:t,end:n,attrs:i,rawDest:o}))}function Al(e){return lw(e).filter(t=>t.type==="attachment").map(({start:t,end:n,attrs:i,rawDest:o})=>({start:t,end:n,attrs:i,rawDest:o}))}function SV(e){return lw(e).filter(t=>t.type==="quote").map(({start:t,end:n,attrs:i,rawDest:o})=>({start:t,end:n,attrs:i,rawDest:o}))}function _V(e,t){const n=lw(e,t);if(n.length===0)return[{type:"text",value:e}];const i=[];let o=0;for(const s of n)s.start>o&&i.push({type:"text",value:e.slice(o,s.start)}),s.type==="mention"?i.push({type:"mention",attrs:s.attrs,rawDest:s.rawDest}):s.type==="attachment"?i.push({type:"attachment",attrs:s.attrs,rawDest:s.rawDest}):i.push({type:"quote",attrs:s.attrs,rawDest:s.rawDest}),o=s.end;return o[a,u+1])),s=new Map(t.mediaAttIds.map((a,u)=>[a,u+1]));let r="",l=0;for(const a of i){r+=e.slice(l,a.start),l=a.end;const{attId:u,name:c,kind:d}=a.attrs,f=d==="folder"?n?.resolveFolder?.(u):void 0;if(f!==void 0){const y=f==="/"||/^[a-zA-Z]:\/$/.test(f)?f.slice(0,-1)||"/":c.endsWith("/")?c.slice(0,-1):c;r+=Rp({kind:"folder",name:y,path:f});continue}const h=o.get(u);if(h!==void 0){r+=Nf({attId:String(h),name:c});continue}const m=s.get(u);if(m!==void 0){r+=Nf({attId:`m${m}`,name:c});continue}r+=c}return r+=e.slice(l),r}function lR(e,t,n=0){if(t<=0&&n<=0)return e;const i=Al(e);if(i.length===0)return e;let o="",s=0;for(const r of i){const{attId:l,name:a,kind:u}=r.attrs;let c;t>0&&/^[1-9]\d*$/.test(l)?c=String(Number(l)+t):n>0&&/^m[1-9]\d*$/.test(l)&&(c=`m${Number(l.slice(1))+n}`),c!==void 0&&(o+=e.slice(s,r.start),s=r.end,o+=Nf({attId:c,name:a}))}return o+=e.slice(s),o}function tf(e,t){const n=Al(e);if(n.length===0)return e;let i="",o=0;for(const s of n)i+=e.slice(o,s.start)+(t?.(s.attrs.name)??s.attrs.name),o=s.end;return i+=e.slice(o),i}function aR(e,t){const n=Al(e);if(n.length===0)return e;let i="",o=0;for(const s of n)t.has(s.attrs.attId)||(i+=e.slice(o,s.start)+s.attrs.name,o=s.end);return i+=e.slice(o),i}function f6(e){const t=Al(e);if(t.length===0)return e;let n="",i=0;for(const o of t)n+=e.slice(i,o.start),i=o.end;return n+=e.slice(i),n}let Y_e=!0;const J_e=/^> (.*)$/,X_e=/^>$/;function LS(e){return e.replaceAll("%","%25").replaceAll(` -`,"%0A").replaceAll("\r","%0D")}function eIe(e){return e.replaceAll("%0A",` -`).replaceAll("%0D","\r").replaceAll("%25","%")}const tIe=/^from: (.+)$/;function IV(e){let t=e,n;const i=e.indexOf(` -`),o=tIe.exec(i===-1?e:e.slice(0,i));o!==null&&(n=eIe(o[1]),t=i===-1?"":e.slice(i+1));const s=[];for(const r of t.split(` -`)){const l=J_e.exec(r);if(l!==null){s.push(l[1]??"");continue}if(X_e.test(r)){s.push("");continue}return null}return{text:s.join(` -`),...n!==void 0?{source:n}:{}}}function NS(e){const t=[];for(const i of e.split(/(\n{2,})/)){if(i==="")continue;if(/^\n{2,}$/.test(i)){t.push({type:"sep",text:i});continue}const o=IV(i);t.push(o===null?{type:"inline",text:i}:{type:"quote",text:o.text,...o.source!==void 0?{source:o.source}:{}})}const n=[];for(let i=0;i`> ${t}`).join(` -`)}function iIe(e){const t=e.split(/(\n{2,})/),n=new Array(t.length).fill(!1);let i=!1;for(let s=t.length-1;s>=0;s-=1){n[s]=i;const r=t[s];r!==""&&!/^\n{2,}$/.test(r)&&(i=!0)}let o="";for(let s=0;s{i.type==="sep"&&i.text===` - -`&&t[o-1]?.type==="quote"&&t[o+1]?.type==="quote"&&n.add(o)}),t.map((i,o)=>{if(n.has(o))return" ";if(i.type!=="quote")return i.text;const s={text:i.text};return i.source!==void 0&&(s.source=i.source),i.comment!==void 0&&(s.comment=i.comment),sw(s)}).join("")}function tr(e){this.content=e}tr.prototype={constructor:tr,find:function(e){for(var t=0;t>1}};tr.from=function(e){if(e instanceof tr)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new tr(t)};function EV(e,t,n){for(let i=0;;i++){if(i==e.childCount||i==t.childCount)return e.childCount==t.childCount?null:n;let o=e.child(i),s=t.child(i);if(o==s){n+=o.nodeSize;continue}if(!o.sameMarkup(s))return n;if(o.isText&&o.text!=s.text){let r=o.text,l=s.text,a=0;for(;r[a]==l[a];a++)n++;return a&&a0&&f>0&&u[d-1]==c[f-1];)d--,f--,n--,i--;return d&&f&&d=56320&&e<57344}function FV(e){return e>=55296&&e<56320}class sn{constructor(t,n){if(this.content=t,this.size=n||0,n==null)for(let i=0;it&&i(a,o+l,s||null,r)!==!1&&a.content.size){let c=l+1;a.nodesBetween(Math.max(0,t-c),Math.min(a.content.size,n-c),i,o+c)}l=u}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,i,o){let s="",r=!0;return this.nodesBetween(t,n,(l,a)=>{let u=l.isText?l.text.slice(Math.max(t,a)-a,n-a):l.isLeaf?o?typeof o=="function"?o(l):o:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&u||l.isTextblock)&&i&&(r?r=!1:s+=i),s+=u},0),s}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,i=t.firstChild,o=this.content.slice(),s=0;for(n.isText&&n.sameMarkup(i)&&(o[o.length-1]=n.withText(n.text+i.text),s=1);st)for(let s=0,r=0;rt&&((rn)&&(l.isText?l=l.cut(Math.max(0,t-r),Math.min(l.text.length,n-r)):l=l.cut(Math.max(0,t-r-1),Math.min(l.content.size,n-r-1))),i.push(l),o+=l.nodeSize),r=a}return new sn(i,o)}cutByIndex(t,n){return t==n?sn.empty:t==0&&n==this.content.length?this:new sn(this.content.slice(t,n))}replaceChild(t,n){let i=this.content[t];if(i==n)return this;let o=this.content.slice(),s=this.size+n.nodeSize-i.nodeSize;return o[t]=n,new sn(o,s)}addToStart(t){return new sn([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new sn(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let n=0;nthis.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,i=0;;n++){let o=this.child(n),s=i+o.nodeSize;if(s>=t)return s==t?Yy(n+1,s):Yy(n,i);i=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,n){if(!n)return sn.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return sn.fromArray(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return sn.empty;let n,i=0;for(let o=0;othis.type.rank&&(n||(n=t.slice(0,o)),n.push(this),i=!0),n&&n.push(s)}}return n||(n=t.slice()),i||n.push(this),n}removeFromSet(t){for(let n=0;ni.type.rank-o.type.rank),n}}Fi.none=[];class zv extends Error{}class mn{constructor(t,n,i){this.content=t,this.openStart=n,this.openEnd=i}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let i=RV(this.content,t+this.openStart,n,this.openStart+1,this.openEnd+1);return i&&new mn(i,this.openStart,this.openEnd)}removeBetween(t,n){return new mn(DV(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,n){if(!n)return mn.empty;let i=n.openStart||0,o=n.openEnd||0;if(typeof i!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new mn(sn.fromJSON(t,n.content),i,o)}static maxOpen(t,n=!0){let i=0,o=0;for(let s=t.firstChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.firstChild)i++;for(let s=t.lastChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.lastChild)o++;return new mn(t,i,o)}}mn.empty=new mn(sn.empty,0,0);function DV(e,t,n){let{index:i,offset:o}=e.findIndex(t),s=e.maybeChild(i),{index:r,offset:l}=e.findIndex(n);if(o==t||s.isText){if(l!=n&&!e.child(r).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(i!=r)throw new RangeError("Removing non-flat range");return e.replaceChild(i,s.copy(DV(s.content,t-o-1,n-o-1)))}function RV(e,t,n,i,o,s){let{index:r,offset:l}=e.findIndex(t),a=e.maybeChild(r);if(l==t||a.isText)return s&&i<=0&&o<=0&&!s.canReplace(r,r,n)?null:e.cut(0,t).append(n).append(e.cut(t));let u=RV(a.content,t-l-1,n,r==0?i-1:0,r==e.childCount-1?o-1:0,a);return u&&e.replaceChild(r,a.copy(u))}function oIe(e,t,n){if(n.openStart>e.depth)throw new zv("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new zv("Inconsistent open depths");return OV(e,t,n,0)}function OV(e,t,n,i){let o=e.index(i),s=e.node(i);if(o==t.index(i)&&i=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function iv(e,t,n,i){let o=(t||e).node(n),s=0,r=t?t.index(n):o.childCount;e&&(s=e.index(n),e.depth>n?s++:e.textOffset&&(lp(e.nodeAfter,i),s++));for(let l=s;lo&&h6(e,t,o+1),r=i.depth>o&&h6(n,i,o+1),l=[];return iv(null,e,o,l),s&&r&&t.index(o)==n.index(o)?(PV(s,r),lp(ap(s,BV(e,t,n,i,o+1)),l)):(s&&lp(ap(s,Eb(e,t,o+1)),l),iv(t,n,o,l),r&&lp(ap(r,Eb(n,i,o+1)),l)),iv(i,null,o,l),new sn(l)}function Eb(e,t,n){let i=[];if(iv(null,e,n,i),e.depth>n){let o=h6(e,t,n+1);lp(ap(o,Eb(e,t,n+1)),i)}return iv(t,null,n,i),new sn(i)}function sIe(e,t){let n=t.depth-e.openStart,o=t.node(n).copy(e.content);for(let s=n-1;s>=0;s--)o=t.node(s).copy(sn.from(o));return{start:o.resolveNoCache(e.openStart+n),end:o.resolveNoCache(o.content.size-e.openEnd-n)}}class jv{constructor(t,n,i){this.pos=t,this.path=n,this.parentOffset=i,this.depth=n.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,n=this.index(this.depth);if(n==t.childCount)return null;let i=this.pos-this.path[this.path.length-1],o=t.child(n);return i?t.child(n).cut(i):o}get nodeBefore(){let t=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(t).cut(0,n):t==0?null:this.parent.child(t-1)}posAtIndex(t,n){n=this.resolveDepth(n);let i=this.path[n*3],o=n==0?0:this.path[n*3-1]+1;for(let s=0;s0;n--)if(this.start(n)<=t&&this.end(n)>=t)return n;return 0}blockRange(t=this,n){if(t.pos=0;i--)if(t.pos<=this.end(i)&&(!n||n(this.node(i))))return new aIe(this,t,i);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");let i=[],o=0,s=n;for(let r=t;;){let{index:l,offset:a}=r.content.findIndex(s),u=s-a;if(i.push(r,l,o+a),!u||(r=r.child(l),r.isText))break;s=u-1,o+=a+1}return new jv(n,i,s)}static resolveCached(t,n){let i=uR.get(t);if(i)for(let s=0;st&&this.nodesBetween(t,n,s=>(i.isInSet(s.marks)&&(o=!0),!o)),o}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),$V(this.marks,t)}contentMatchAt(t){let n=this.type.contentMatch.matchFragment(this.content,0,t);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(t,n,i=sn.empty,o=0,s=i.childCount){let r=this.contentMatchAt(t).matchFragment(i,o,s),l=r&&r.matchFragment(this.content,n);if(!l||!l.validEnd)return!1;for(let a=o;an.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(n=>n.toJSON())),t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let i;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");i=n.marks.map(t.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(n.text,i)}let o=sn.fromJSON(t,n.content),s=t.nodeType(n.type).create(n.attrs,o,i);return s.type.checkAttrs(s.attrs),s}};up.prototype.text=void 0;class Lb extends up{constructor(t,n,i,o){if(super(t,n,null,o),!i)throw new RangeError("Empty text nodes are not allowed");this.text=i}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):$V(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,n){return this.text.slice(t,n)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new Lb(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new Lb(this.type,this.attrs,t,this.marks)}cut(t=0,n=this.text.length){return t==0&&n==this.text.length?this:this.withText(this.text.slice(t,n))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function $V(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class Cp{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let i=new cIe(t,n);if(i.next==null)return Cp.empty;let o=zV(i);i.next&&i.err("Unexpected trailing text");let s=vIe(gIe(o));return yIe(s,i),s}matchType(t){for(let n=0;nu.createAndFill()));for(let u=0;u=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function n(i){t.push(i);for(let o=0;o{let s=o+(i.validEnd?"*":" ")+" ";for(let r=0;r"+t.indexOf(i.next[r].next);return s}).join(` -`)}}Cp.empty=new Cp(!0);class cIe{constructor(t,n){this.string=t,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function zV(e){let t=[];do t.push(dIe(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function dIe(e){let t=[];do t.push(fIe(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function fIe(e){let t=mIe(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else if(e.eat("{"))t=hIe(e,t);else break;return t}function cR(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function hIe(e,t){let n=cR(e),i=n;return e.eat(",")&&(e.next!="}"?i=cR(e):i=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:i,expr:t}}function pIe(e,t){let n=e.nodeTypes,i=n[t];if(i)return[i];let o=[];for(let s in n){let r=n[s];r.isInGroup(t)&&o.push(r)}return o.length==0&&e.err("No node type or group '"+t+"' found"),o}function mIe(e){if(e.eat("(")){let t=zV(e);return e.eat(")")||e.err("Missing closing paren"),t}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=pIe(e,e.next).map(n=>(e.inline==null?e.inline=n.isInline:e.inline!=n.isInline&&e.err("Mixing inline and block content"),{type:"name",value:n}));return e.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function gIe(e){let t=[[]];return o(s(e,0),n()),t;function n(){return t.push([])-1}function i(r,l,a){let u={term:a,to:l};return t[r].push(u),u}function o(r,l){r.forEach(a=>a.to=l)}function s(r,l){if(r.type=="choice")return r.exprs.reduce((a,u)=>a.concat(s(u,l)),[]);if(r.type=="seq")for(let a=0;;a++){let u=s(r.exprs[a],l);if(a==r.exprs.length-1)return u;o(u,l=n())}else if(r.type=="star"){let a=n();return i(l,a),o(s(r.expr,a),a),[i(a)]}else if(r.type=="plus"){let a=n();return o(s(r.expr,l),a),o(s(r.expr,a),a),[i(a)]}else{if(r.type=="opt")return[i(l)].concat(s(r.expr,l));if(r.type=="range"){let a=l;for(let u=0;u{e[r].forEach(({term:l,to:a})=>{if(!l)return;let u;for(let c=0;c{u||o.push([l,u=[]]),u.indexOf(c)==-1&&u.push(c)})})});let s=t[i.join(",")]=new Cp(i.indexOf(e.length-1)>-1);for(let r=0;r-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:WV(this.attrs,t)}create(t=null,n,i){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new up(this,this.computeAttrs(t),sn.from(n),Fi.setFrom(i))}createChecked(t=null,n,i){return n=sn.from(n),this.checkContent(n),new up(this,this.computeAttrs(t),n,Fi.setFrom(i))}createAndFill(t=null,n,i){if(t=this.computeAttrs(t),n=sn.from(n),n.size){let r=this.contentMatch.fillBefore(n);if(!r)return null;n=r.append(n)}let o=this.contentMatch.matchFragment(n),s=o&&o.fillBefore(sn.empty,!0);return s?new up(this,t,n.append(s),Fi.setFrom(i)):null}validContent(t){let n=this.contentMatch.matchFragment(t);if(!n||!n.validEnd)return!1;for(let i=0;i-1}allowsMarks(t){if(this.markSet==null)return!0;for(let n=0;ni[s]=new VV(s,n,r));let o=n.spec.topNode||"doc";if(!i[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!i.text)throw new RangeError("Every schema needs a 'text' type");for(let s in i.text.attrs)throw new RangeError("The text node type should not have attributes");return i}};function kIe(e,t,n){let i=n.split("|");return o=>{let s=o===null?"null":typeof o;if(i.indexOf(s)<0)throw new RangeError(`Expected value of type ${i} for attribute ${t} on type ${e}, got ${s}`)}}class bIe{constructor(t,n,i){this.hasDefault=Object.prototype.hasOwnProperty.call(i,"default"),this.default=i.default,this.validate=typeof i.validate=="string"?kIe(t,n,i.validate):i.validate}get isRequired(){return!this.hasDefault}}class aw{constructor(t,n,i,o){this.name=t,this.rank=n,this.schema=i,this.spec=o,this.attrs=UV(t,o.attrs),this.excluded=null;let s=HV(this.attrs);this.instance=s?new Fi(this,s):null}create(t=null){return!t&&this.instance?this.instance:new Fi(this,WV(this.attrs,t))}static compile(t,n){let i=Object.create(null),o=0;return t.forEach((s,r)=>i[s]=new aw(s,o++,n,r)),i}removeFromSet(t){for(var n=0;n-1}}class wIe{constructor(t){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let o in t)n[o]=t[o];n.nodes=tr.from(t.nodes),n.marks=tr.from(t.marks||{}),this.nodes=fR.compile(this.spec.nodes,this),this.marks=aw.compile(this.spec.marks,this);let i=Object.create(null);for(let o in this.nodes){if(o in this.marks)throw new RangeError(o+" can not be both a node and a mark");let s=this.nodes[o],r=s.spec.content||"",l=s.spec.marks;if(s.contentMatch=i[r]||(i[r]=Cp.parse(r,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=l=="_"?null:l?hR(this,l.split(" ")):l==""||!s.inlineContent?[]:null}for(let o in this.marks){let s=this.marks[o],r=s.spec.excludes;s.excluded=r==null?[s]:r==""?[]:hR(this,r.split(" "))}this.nodeFromJSON=o=>up.fromJSON(this,o),this.markFromJSON=o=>Fi.fromJSON(this,o),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,n=null,i,o){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof fR){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(n,i,o)}text(t,n){let i=this.nodes.text;return new Lb(i,i.defaultAttrs,t,Fi.setFrom(n))}mark(t,n){return typeof t=="string"&&(t=this.marks[t]),t.create(n)}nodeType(t){let n=this.nodes[t];if(!n)throw new RangeError("Unknown node type: "+t);return n}}function hR(e,t){let n=[];for(let i=0;i-1)&&n.push(r=a)}if(!r)throw new SyntaxError("Unknown mark type: '"+t[i]+"'")}return n}function CIe(e){return e.tag!=null}function AIe(e){return e.style!=null}let KV=class m6{constructor(t,n){this.schema=t,this.rules=n,this.tags=[],this.styles=[];let i=this.matchedStyles=[];n.forEach(o=>{if(CIe(o))this.tags.push(o);else if(AIe(o)){let s=/[^=]*/.exec(o.style)[0];i.indexOf(s)<0&&i.push(s),this.styles.push(o)}}),this.normalizeLists=!this.tags.some(o=>{if(!/^(ul|ol)\b/.test(o.tag)||!o.node)return!1;let s=t.nodes[o.node];return s.contentMatch.matchType(s)})}parse(t,n={}){let i=new mR(this,n,!1);return i.addAll(t,Fi.none,n.from,n.to),i.finish()}parseSlice(t,n={}){let i=new mR(this,n,!0);return i.addAll(t,Fi.none,n.from,n.to),mn.maxOpen(i.finish())}matchTag(t,n,i){for(let o=i?this.tags.indexOf(i)+1:0;ot.length&&(l.charCodeAt(t.length)!=61||l.slice(t.length+1)!=n))){if(r.getAttrs){let a=r.getAttrs(n);if(a===!1)continue;r.attrs=a||void 0}return r}}}static schemaRules(t){let n=[];function i(o){let s=o.priority==null?50:o.priority,r=0;for(;r{i(r=gR(r)),r.mark||r.ignore||r.clearMark||(r.mark=o)})}for(let o in t.nodes){let s=t.nodes[o].spec.parseDOM;s&&s.forEach(r=>{i(r=gR(r)),r.node||r.ignore||r.mark||(r.node=o)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new m6(t,m6.schemaRules(t)))}};const ZV={address:!0,article:!0,aside:!0,blockquote:!0,body:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},xIe={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},GV={ol:!0,ul:!0},Hv=1,g6=2,ov=4;function pR(e,t,n){return t!=null?(t?Hv:0)|(t==="full"?g6:0):e&&e.whitespace=="pre"?Hv|g6:n&~ov}class Jy{constructor(t,n,i,o,s,r){this.type=t,this.attrs=n,this.marks=i,this.solid=o,this.options=r,this.content=[],this.activeMarks=Fi.none,this.match=s||(r&ov?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(sn.from(t));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let i=this.type.contentMatch,o;return(o=i.findWrapping(t.type))?(this.match=i,o):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&Hv)){let i=this.content[this.content.length-1],o;if(i&&i.isText&&(o=/[ \t\r\n\u000c]+$/.exec(i.text))){let s=i;i.text.length==o[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-o[0].length))}}let n=sn.from(this.content);return!t&&this.match&&(n=n.append(this.match.fillBefore(sn.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!ZV.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class mR{constructor(t,n,i){this.parser=t,this.options=n,this.isOpen=i,this.open=0,this.localPreserveWS=!1;let o=n.topNode,s,r=pR(null,n.preserveWhitespace,0)|(i?ov:0);o?s=new Jy(o.type,o.attrs,Fi.none,!0,n.topMatch||o.type.contentMatch,r):i?s=new Jy(null,null,Fi.none,!0,null,r):s=new Jy(t.schema.topNodeType,null,Fi.none,!0,null,r),this.nodes=[s],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t,n){t.nodeType==3?this.addTextNode(t,n):t.nodeType==1&&this.addElement(t,n)}addTextNode(t,n){let i=t.nodeValue,o=this.top,s=o.options&g6?"full":this.localPreserveWS||(o.options&Hv)>0,{schema:r}=this.parser;if(s==="full"||o.inlineContext(t)||/[^ \t\r\n\u000c]/.test(i)){if(s)if(s==="full")i=i.replace(/\r\n?/g,` -`);else if(r.linebreakReplacement&&/[\r\n]/.test(i)&&this.top.findWrapping(r.linebreakReplacement.create())){let l=i.split(/\r?\n|\r/);for(let a=0;a!a.clearMark(u)):n=n.concat(this.parser.schema.marks[a.mark].create(a.attrs)),a.consuming===!1)l=a;else break}}return n}addElementByRule(t,n,i,o){let s,r;if(n.node)if(r=this.parser.schema.nodes[n.node],r.isLeaf)this.insertNode(r.create(n.attrs),i,t.nodeName=="BR")||this.leafFallback(t,i);else{let a=this.enter(r,n.attrs||null,i,n.preserveWhitespace);a&&(s=!0,i=a)}else{let a=this.parser.schema.marks[n.mark];i=i.concat(a.create(n.attrs))}let l=this.top;if(r&&r.isLeaf)this.findInside(t);else if(o)this.addElement(t,i,o);else if(n.getContent)this.findInside(t),n.getContent(t,this.parser.schema).forEach(a=>this.insertNode(a,i,!1));else{let a=t;typeof n.contentElement=="string"?a=t.querySelector(n.contentElement):typeof n.contentElement=="function"?a=n.contentElement(t):n.contentElement&&(a=n.contentElement),this.findAround(t,a,!0),this.addAll(a,i),this.findAround(t,a,!1)}s&&this.sync(l)&&this.open--}addAll(t,n,i,o){let s=i||0;for(let r=i?t.childNodes[i]:t.firstChild,l=o==null?null:t.childNodes[o];r!=l;r=r.nextSibling,++s)this.findAtPoint(t,s),this.addDOM(r,n);this.findAtPoint(t,s)}findPlace(t,n,i){let o,s;for(let r=this.open,l=0;r>=0;r--){let a=this.nodes[r],u=a.findWrapping(t);if(u&&(!o||o.length>u.length+l)&&(o=u,s=a,!u.length))break;if(a.solid){if(i)break;l+=2}}if(!o)return null;this.sync(s);for(let r=0;r(r.type?r.type.allowsMarkType(u.type):vR(u.type,t))?(a=u.addToSet(a),!1):!0),this.nodes.push(new Jy(t,n,a,o,null,l)),this.open++,i}closeExtra(t=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(t){for(let n=this.open;n>=0;n--){if(this.nodes[n]==t)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=Hv)}return!1}get currentPos(){this.closeExtra();let t=0;for(let n=this.open;n>=0;n--){let i=this.nodes[n].content;for(let o=i.length-1;o>=0;o--)t+=i[o].nodeSize;n&&t++}return t}findAtPoint(t,n){if(this.find)for(let i=0;i-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let n=t.split("/"),i=this.options.context,o=!this.isOpen&&(!i||i.parent.type==this.nodes[0].type),s=-(i?i.depth+1:0)+(o?0:1),r=(l,a)=>{for(;l>=0;l--){let u=n[l];if(u==""){if(l==n.length-1||l==0)continue;for(;a>=s;a--)if(r(l-1,a))return!0;return!1}else{let c=a>0||a==0&&o?this.nodes[a].type:i&&a>=s?i.node(a-s).type:null;if(!c||c.name!=u&&!c.isInGroup(u))return!1;a--}}return!0};return r(n.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let n=t.depth;n>=0;n--){let i=t.node(n).contentMatchAt(t.indexAfter(n)).defaultType;if(i&&i.isTextblock&&i.defaultAttrs)return i}for(let n in this.parser.schema.nodes){let i=this.parser.schema.nodes[n];if(i.isTextblock&&i.defaultAttrs)return i}}}function SIe(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let i=t.nodeType==1?t.nodeName.toLowerCase():null;i&&GV.hasOwnProperty(i)&&n?(n.appendChild(t),t=n):i=="li"?n=t:i&&(n=null)}}function _Ie(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function gR(e){let t={};for(let n in e)t[n]=e[n];return t}function vR(e,t){let n=t.schema.nodes;for(let i in n){let o=n[i];if(!o.allowsMarkType(e))continue;let s=[],r=l=>{s.push(l);for(let a=0;a{if(s.length||r.marks.length){let l=0,a=0;for(;l=0;o--){let s=this.serializeMark(t.marks[o],t.isInline,n);s&&((s.contentDOM||s.dom).appendChild(i),i=s.dom)}return i}serializeMark(t,n,i={}){let o=this.marks[t.type.name];return o&&Y9(Xy(i),o(t,n),null,t.attrs)}static renderSpec(t,n,i=null,o){return typeof n=="string"?{dom:t.createTextNode(n)}:Y9(t,n,i,o)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new uc(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=yR(t.nodes);return n.text||(n.text=i=>i.text),n}static marksFromSchema(t){return yR(t.marks)}}function yR(e){let t={};for(let n in e){let i=e[n].spec.toDOM;i&&(t[n]=i)}return t}function Xy(e){return e.document||window.document}const kR=new WeakMap;function IIe(e){let t=kR.get(e);return t===void 0&&kR.set(e,t=MIe(e)),t}function MIe(e){let t=null;function n(i){if(i&&typeof i=="object")if(Array.isArray(i))if(typeof i[0]=="string")t||(t=[]),t.push(i);else for(let o=0;o-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let r=o.indexOf(" ");r>0&&(n=o.slice(0,r),o=o.slice(r+1));let l,a=n?e.createElementNS(n,o):e.createElement(o),u=t[1],c=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){c=2;for(let d in u)if(u[d]!=null){let f=d.indexOf(" ");f>0?a.setAttributeNS(d.slice(0,f),d.slice(f+1),u[d]):d=="style"&&a.style?a.style.cssText=u[d]:a.setAttribute(d,u[d])}}for(let d=c;dc)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else if(typeof f=="string")a.appendChild(e.createTextNode(f));else{let{dom:h,contentDOM:m}=Y9(e,f,n,i);if(a.appendChild(h),m){if(l)throw new RangeError("Multiple content holes");l=m}}}return{dom:a,contentDOM:l}}const ri=new wIe({nodes:{doc:{content:"block+"},paragraph:{group:"block",content:"inline*",toDOM:()=>["p",0],parseDOM:[{tag:"p"}]},text:{group:"inline"},mention:{group:"inline",inline:!0,atom:!0,selectable:!0,attrs:{kind:{},name:{},path:{default:""}},leafText:e=>Rp(e.attrs),toDOM:e=>{const t=e.attrs;return["span",{class:`mention-pill mention-${t.kind}`,"data-mention-path":t.path},t.name]}},attachment:{group:"inline",inline:!0,atom:!0,selectable:!0,attrs:{attId:{},name:{},kind:{}},leafText:e=>Nf(e.attrs),toDOM:e=>{const t=e.attrs;return["span",{class:`attachment-pill attachment-${t.kind}`,"data-attachment-id":t.attId,"data-attachment-kind":t.kind,"data-attachment-name":t.name},t.name]}},quote:{group:"inline",inline:!0,atom:!0,selectable:!0,attrs:{text:{},comment:{default:""},source:{default:""}},leafText:e=>sw(e.attrs),toDOM:e=>{const t=e.attrs,n={class:"quote-pill","data-quote-text":t.text};return typeof t.comment=="string"&&t.comment.length>0&&(n["data-quote-comment"]=t.comment),typeof t.source=="string"&&t.source.length>0&&(n["data-quote-source"]=t.source),["span",n,Mm(t.text)]}}}});function QV(e){return ri.nodes.mention.create(e)}function YV(e){return ri.nodes.attachment.create(e)}function JV(e){return ri.nodes.quote.create(e)}function TIe(e,t){return e?_V(e,t).map(n=>n.type==="mention"?QV(n.attrs):n.type==="attachment"?YV(n.attrs):n.type==="quote"?JV(n.attrs):ri.text(n.value)):[]}function Wv(e,t){const n=e.split(` -`);return ri.node("doc",null,n.map(i=>i?ri.node("paragraph",null,t?.reviveMentions?TIe(i,t?.attachmentKindFor):ri.text(i)):ri.node("paragraph")))}function qv(e){return e.textBetween(0,e.content.size,` -`)}const XV=65535,eK=Math.pow(2,16);function EIe(e,t){return e+t*eK}function bR(e){return e&XV}function LIe(e){return(e-(e&XV))/eK}const tK=1,nK=2,J9=4,iK=8;class v6{constructor(t,n,i){this.pos=t,this.delInfo=n,this.recover=i}get deleted(){return(this.delInfo&iK)>0}get deletedBefore(){return(this.delInfo&(tK|J9))>0}get deletedAfter(){return(this.delInfo&(nK|J9))>0}get deletedAcross(){return(this.delInfo&J9)>0}}class ia{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&ia.empty)return ia.empty}recover(t){let n=0,i=bR(t);if(!this.inverted)for(let o=0;ot)break;let u=this.ranges[l+s],c=this.ranges[l+r],d=a+u;if(t<=d){let f=u?t==a?-1:t==d?1:n:n,h=a+o+(f<0?0:c);if(i)return h;let m=t==(n<0?a:d)?null:EIe(l/3,t-a),g=t==a?nK:t==d?tK:J9;return(n<0?t!=a:t!=d)&&(g|=iK),new v6(h,g,m)}o+=c-u}return i?t+o:new v6(t+o,0,null)}touches(t,n){let i=0,o=bR(n),s=this.inverted?2:1,r=this.inverted?1:2;for(let l=0;lt)break;let u=this.ranges[l+s],c=a+u;if(t<=c&&l==o*3)return!0;i+=this.ranges[l+r]-u}return!1}forEach(t){let n=this.inverted?2:1,i=this.inverted?1:2;for(let o=0,s=0;o=0;n--){let o=t.getMirror(n);this.appendMap(t._maps[n].invert(),o!=null&&o>n?i-o-1:void 0)}}invert(){let t=new Uv;return t.appendMappingInverted(this),t}map(t,n=1){if(this.mirror)return this._map(t,n,!0);for(let i=this.from;is&&a!r.isAtom||!l.type.allowsMarkType(this.mark.type)?r:r.mark(this.mark.addToSet(r.marks)),o),n.openStart,n.openEnd);return fs.fromReplace(t,this.from,this.to,s)}invert(){return new nc(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),i=t.mapResult(this.to,-1);return n.deleted&&i.deleted||n.pos>=i.pos?null:new nf(n.pos,i.pos,this.mark)}merge(t){return t instanceof nf&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new nf(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new nf(n.from,n.to,t.markFromJSON(n.mark))}}Nr.jsonID("addMark",nf);class nc extends Nr{constructor(t,n,i){super(),this.from=t,this.to=n,this.mark=i}apply(t){let n=t.slice(this.from,this.to),i=new mn(FS(n.content,o=>o.mark(this.mark.removeFromSet(o.marks)),t),n.openStart,n.openEnd);return fs.fromReplace(t,this.from,this.to,i)}invert(){return new nf(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),i=t.mapResult(this.to,-1);return n.deleted&&i.deleted||n.pos>=i.pos?null:new nc(n.pos,i.pos,this.mark)}merge(t){return t instanceof nc&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new nc(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new nc(n.from,n.to,t.markFromJSON(n.mark))}}Nr.jsonID("removeMark",nc);class of extends Nr{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return fs.fail("No node at mark step's position");let i=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return fs.fromReplace(t,this.pos,this.pos+1,new mn(sn.from(i),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let i=this.mark.addToSet(n.marks);if(i.length==n.marks.length){for(let o=0;oi.pos?null:new ca(n.pos,i.pos,o,s,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new ca(n.from,n.to,n.gapFrom,n.gapTo,mn.fromJSON(t,n.slice),n.insert,!!n.structure)}}Nr.jsonID("replaceAround",ca);function y6(e,t,n){let i=e.resolve(t),o=n-t,s=i.depth;for(;o>0&&s>0&&i.indexAfter(s)==i.node(s).childCount;)s--,o--;if(o>0){let r=i.node(s).maybeChild(i.indexAfter(s));for(;o>0;){if(!r||r.isLeaf)return!0;r=r.firstChild,o--}}return!1}function NIe(e,t,n,i){let o=[],s=[],r,l;e.doc.nodesBetween(t,n,(a,u,c)=>{if(!a.isInline)return;let d=a.marks;if(!i.isInSet(d)&&c.type.allowsMarkType(i.type)){let f=Math.max(u,t),h=Math.min(u+a.nodeSize,n),m=i.addToSet(d);for(let g=0;ge.step(a)),s.forEach(a=>e.step(a))}function FIe(e,t,n,i){let o=[],s=0;e.doc.nodesBetween(t,n,(r,l)=>{if(!r.isInline)return;s++;let a=null;if(i instanceof aw){let u=r.marks,c;for(;c=i.isInSet(u);)(a||(a=[])).push(c),u=c.removeFromSet(u)}else i?i.isInSet(r.marks)&&(a=[i]):a=r.marks;if(a&&a.length){let u=Math.min(l+r.nodeSize,n);for(let c=0;ce.step(new nc(r.from,r.to,r.style)))}function DS(e,t,n,i=n.contentMatch,o=!0){let s=e.doc.nodeAt(t),r=[],l=t+1;for(let a=0;a=0;a--)e.step(r[a])}function DIe(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function RS(e){let n=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let i=e.depth,o=0,s=0;;--i){let r=e.$from.node(i),l=e.$from.index(i)+o,a=e.$to.indexAfter(i)-s;if(in;m--)g||i.index(m)>0?(g=!0,c=sn.from(i.node(m).copy(c)),d++):a--;let f=sn.empty,h=0;for(let m=s,g=!1;m>n;m--)g||o.after(m+1)=0;r--){if(i.size){let l=n[r].type.contentMatch.matchFragment(i);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}i=sn.from(n[r].type.create(n[r].attrs,i))}let o=t.start,s=t.end;e.step(new ca(o,s,o,s,new mn(i,0,0),n.length,!0))}function PIe(e,t,n,i,o){if(!i.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=e.steps.length;e.doc.nodesBetween(t,n,(r,l)=>{let a=typeof o=="function"?o(r):o;if(r.isTextblock&&!r.hasMarkup(i,a)&&BIe(e.doc,e.mapping.slice(s).map(l),i)){let u=null;if(i.schema.linebreakReplacement){let h=i.whitespace=="pre",m=!!i.contentMatch.matchType(i.schema.linebreakReplacement);h&&!m?u=!1:!h&&m&&(u=!0)}u===!1&&sK(e,r,l,s),DS(e,e.mapping.slice(s).map(l,1),i,void 0,u===null);let c=e.mapping.slice(s),d=c.map(l,1),f=c.map(l+r.nodeSize,1);return e.step(new ca(d,f,d+1,f-1,new mn(sn.from(i.create(a,null,r.marks)),0,0),1,!0)),u===!0&&oK(e,r,l,s),!1}})}function oK(e,t,n,i){t.forEach((o,s)=>{if(o.isText){let r,l=/\r?\n|\r/g;for(;r=l.exec(o.text);){let a=e.mapping.slice(i).map(n+1+s+r.index);e.replaceWith(a,a+1,t.type.schema.linebreakReplacement.create())}}})}function sK(e,t,n,i){t.forEach((o,s)=>{if(o.type==o.type.schema.linebreakReplacement){let r=e.mapping.slice(i).map(n+1+s);e.replaceWith(r,r+1,t.type.schema.text(` -`))}})}function BIe(e,t,n){let i=e.resolve(t),o=i.index();return i.parent.canReplaceWith(o,o+1,n)}function $Ie(e,t,n,i,o){let s=e.doc.nodeAt(t);if(!s)throw new RangeError("No node at given position");n||(n=s.type);let r=n.create(i,null,o||s.marks);if(s.isLeaf)return e.replaceWith(t,t+s.nodeSize,r);if(!n.validContent(s.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new ca(t,t+s.nodeSize,t+1,t+s.nodeSize-1,new mn(sn.from(r),0,0),1,!0))}function X9(e,t,n=1,i){let o=e.resolve(t),s=o.depth-n,r=i&&i[i.length-1]||o.parent;if(s<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!r.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let u=o.depth-1,c=n-2;u>s;u--,c--){let d=o.node(u),f=o.index(u);if(d.type.spec.isolating)return!1;let h=d.content.cutByIndex(f,d.childCount),m=i&&i[c+1];m&&(h=h.replaceChild(0,m.type.create(m.attrs)));let g=i&&i[c]||d;if(!d.canReplace(f+1,d.childCount)||!g.type.validContent(h))return!1}let l=o.indexAfter(s),a=i&&i[0];return o.node(s).canReplaceWith(l,l,a?a.type:o.node(s+1).type)}function zIe(e,t,n=1,i){let o=e.doc.resolve(t),s=sn.empty,r=sn.empty;for(let l=o.depth,a=o.depth-n,u=n-1;l>a;l--,u--){s=sn.from(o.node(l).copy(s));let c=i&&i[u];r=sn.from(c?c.type.create(c.attrs,r):o.node(l).copy(r))}e.step(new Gs(t,t,new mn(s.append(r),n,n),!0))}function rK(e,t){let n=e.resolve(t),i=n.index();return HIe(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(i,i+1)}function jIe(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:i}=e.type.schema;for(let o=0;o=0;o--){let s=i.index(o);if(i.node(o).canReplaceWith(s,s,n))return i.before(o+1);if(s>0)return null}if(i.parentOffset==i.parent.content.size)for(let o=i.depth-1;o>=0;o--){let s=i.indexAfter(o);if(i.node(o).canReplaceWith(s,s,n))return i.after(o+1);if(s=0;r--){let l=r==i.depth?0:i.pos<=(i.start(r+1)+i.end(r+1))/2?-1:1,a=i.index(r)+(l>0?1:0),u=i.node(r),c=!1;if(s==1)c=u.canReplace(a,a,o);else{let d=u.contentMatchAt(a).findWrapping(o.firstChild.type);c=d&&u.canReplaceWith(a,a,d[0])}if(c)return l==0?i.pos:l<0?i.before(r+1):i.after(r+1)}return null}function OS(e,t,n=t,i=mn.empty){if(t==n&&!i.size)return null;let o=e.resolve(t),s=e.resolve(n);return lK(o,s,i)?new Gs(t,n,i):new VIe(o,s,i).fit()}function lK(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}class VIe{constructor(t,n,i){this.$from=t,this.$to=n,this.unplaced=i,this.frontier=[],this.placed=sn.empty;for(let o=0;o<=t.depth;o++){let s=t.node(o);this.frontier.push({type:s.type,match:s.contentMatchAt(t.indexAfter(o))})}for(let o=t.depth;o>0;o--)this.placed=sn.from(t.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,i=this.$from,o=this.close(t<0?this.$to:i.doc.resolve(t));if(!o)return null;let s=this.placed,r=i.depth,l=o.depth;for(;r&&l&&s.childCount==1;)s=s.firstChild.content,r--,l--;let a=new mn(s,r,l);return t>-1?new ca(i.pos,t,this.$to.pos,this.$to.end(),a,n):a.size||i.pos!=this.$to.pos?new Gs(i.pos,o.pos,a):null}findFittable(){let t=this.unplaced.openStart;for(let n=this.unplaced.content,i=0,o=this.unplaced.openEnd;i1&&(o=0),s.type.spec.isolating&&o<=i){t=i;break}n=s.content}for(let n=1;n<=2;n++)for(let i=n==1?t:this.unplaced.openStart;i>=0;i--){let o,s=null;i?(s=V8(this.unplaced.content,i-1).firstChild,o=s.content):o=this.unplaced.content;let r=o.firstChild;for(let l=this.depth;l>=0;l--){let{type:a,match:u}=this.frontier[l],c,d=null;if(n==1&&(r?u.matchType(r.type)||(d=u.fillBefore(sn.from(r),!1)):s&&a.compatibleContent(s.type)))return{sliceDepth:i,frontierDepth:l,parent:s,inject:d};if(n==2&&r&&(c=u.findWrapping(r.type)))return{sliceDepth:i,frontierDepth:l,parent:s,wrap:c};if(s&&u.matchType(s.type))break}}}openMore(){let{content:t,openStart:n,openEnd:i}=this.unplaced,o=V8(t,n);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new mn(t,n+1,Math.max(i,o.size+n>=t.size-i?n+1:0)),!0)}dropNode(){let{content:t,openStart:n,openEnd:i}=this.unplaced,o=V8(t,n);if(o.childCount<=1&&n>0){let s=t.size-n<=n+o.size;this.unplaced=new mn(m0(t,n-1,1),n-1,s?n-1:i)}else this.unplaced=new mn(m0(t,n,1),n,i)}placeNodes({sliceDepth:t,frontierDepth:n,parent:i,inject:o,wrap:s}){for(;this.depth>n;)this.closeFrontierNode();if(s)for(let g=0;g1||a==0||g.content.size)&&(d=y,c.push(aK(g.mark(f.allowedMarks(g.marks)),u==1?a:0,u==l.childCount?h:-1)))}let m=u==l.childCount;m||(h=-1),this.placed=g0(this.placed,n,sn.from(c)),this.frontier[n].match=d,m&&h<0&&i&&i.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,y=l;g1&&o==this.$to.end(--i);)++o;return o}findCloseLevel(t){e:for(let n=Math.min(this.depth,t.depth);n>=0;n--){let{match:i,type:o}=this.frontier[n],s=n=0;l--){let{match:a,type:u}=this.frontier[l],c=K8(t,l,u,a,!0);if(!c||c.childCount)continue e}return{depth:n,fit:r,move:s?t.doc.resolve(t.after(n+1)):t}}}}close(t){let n=this.findCloseLevel(t);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=g0(this.placed,n.depth,n.fit)),t=n.move;for(let i=n.depth+1;i<=t.depth;i++){let o=t.node(i),s=o.type.contentMatch.fillBefore(o.content,!0,t.index(i));this.openFrontierNode(o.type,o.attrs,s)}return t}openFrontierNode(t,n=null,i){let o=this.frontier[this.depth];o.match=o.match.matchType(t),this.placed=g0(this.placed,this.depth,sn.from(t.create(n,i))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(sn.empty,!0);n.childCount&&(this.placed=g0(this.placed,this.frontier.length,n))}}function m0(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(m0(e.firstChild.content,t-1,n)))}function g0(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(g0(e.lastChild.content,t-1,n)))}function V8(e,t){for(let n=0;n1&&(i=i.replaceChild(0,aK(i.firstChild,t-1,i.childCount==1?n-1:0))),t>0&&(i=e.type.contentMatch.fillBefore(i).append(i),n<=0&&(i=i.append(e.type.contentMatch.matchFragment(i).fillBefore(sn.empty,!0)))),e.copy(i)}function K8(e,t,n,i,o){let s=e.node(t),r=o?e.indexAfter(t):e.index(t);if(r==s.childCount&&!n.compatibleContent(s.type))return null;let l=i.fillBefore(s.content,!0,r);return l&&!KIe(n,s.content,r)?l:null}function KIe(e,t,n){for(let i=n;i0;f--,h--){let m=o.node(f).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;r.indexOf(f)>-1?l=f:o.before(f)==h&&r.splice(1,0,-f)}let a=r.indexOf(l),u=[],c=i.openStart;for(let f=i.content,h=0;;h++){let m=f.firstChild;if(u.push(m),h==i.openStart)break;f=m.content}for(let f=c-1;f>=0;f--){let h=u[f],m=ZIe(h.type);if(m&&!h.sameMarkup(o.node(Math.abs(l)-1)))c=f;else if(m||!h.type.isTextblock)break}for(let f=i.openStart;f>=0;f--){let h=(f+c+1)%(i.openStart+1),m=u[h];if(m)for(let g=0;g=0&&(e.replace(t,n,i),!(e.steps.length>d));f--){let h=r[f];h<0||(t=o.before(h),n=s.after(h))}}function uK(e,t,n,i,o){if(ti){let s=o.contentMatchAt(0),r=s.fillBefore(e).append(e);e=r.append(s.matchFragment(r).fillBefore(sn.empty,!0))}return e}function QIe(e,t,n,i){if(!i.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let o=qIe(e.doc,t,i.type);o!=null&&(t=n=o)}e.replaceRange(t,n,new mn(sn.from(i),0,0))}function YIe(e,t,n){let i=e.doc.resolve(t),o=e.doc.resolve(n);if(i.parent.isTextblock&&o.parent.isTextblock&&i.start()!=o.start()&&i.parentOffset==0&&o.parentOffset==0){let r=i.sharedDepth(n),l=!1;for(let a=i.depth;a>r;a--)i.node(a).type.spec.isolating&&(l=!0);for(let a=o.depth;a>r;a--)o.node(a).type.spec.isolating&&(l=!0);if(!l){for(let a=i.depth;a>0&&t==i.start(a);a--)t=i.before(a);for(let a=o.depth;a>0&&n==o.start(a);a--)n=o.before(a);i=e.doc.resolve(t),o=e.doc.resolve(n)}}let s=cK(i,o);for(let r=0;r0&&(a||i.node(l-1).canReplace(i.index(l-1),o.indexAfter(l-1))))return e.delete(i.before(l),o.after(l))}for(let r=1;r<=i.depth&&r<=o.depth;r++)if(t-i.start(r)==i.depth-r&&n>i.end(r)&&o.end(r)-n!=o.depth-r&&i.start(r-1)==o.start(r-1)&&i.node(r-1).canReplace(i.index(r-1),o.index(r-1)))return e.delete(i.before(r),n);e.delete(t,n)}function cK(e,t){let n=[],i=Math.min(e.depth,t.depth);for(let o=i;o>=0;o--){let s=e.start(o);if(st.pos+(t.depth-o)||e.node(o).type.spec.isolating||t.node(o).type.spec.isolating)break;(s==t.start(o)||o==e.depth&&o==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&o&&t.start(o-1)==s-1)&&n.push(o)}return n}class dm extends Nr{constructor(t,n,i){super(),this.pos=t,this.attr=n,this.value=i}apply(t){let n=t.nodeAt(this.pos);if(!n)return fs.fail("No node at attribute step's position");let i=Object.create(null);for(let s in n.attrs)i[s]=n.attrs[s];i[this.attr]=this.value;let o=n.type.create(i,null,n.marks);return fs.fromReplace(t,this.pos,this.pos+1,new mn(sn.from(o),0,n.isLeaf?0:1))}getMap(){return ia.empty}invert(t){return new dm(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new dm(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new dm(n.pos,n.attr,n.value)}}Nr.jsonID("attr",dm);class Vv extends Nr{constructor(t,n){super(),this.attr=t,this.value=n}apply(t){let n=Object.create(null);for(let o in t.attrs)n[o]=t.attrs[o];n[this.attr]=this.value;let i=t.type.create(n,t.content,t.marks);return fs.ok(i)}getMap(){return ia.empty}invert(t){return new Vv(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Vv(n.attr,n.value)}}Nr.jsonID("docAttr",Vv);let Tm=class extends Error{};Tm=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n};Tm.prototype=Object.create(Error.prototype);Tm.prototype.constructor=Tm;Tm.prototype.name="TransformError";class JIe{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new Uv}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let n=this.maybeStep(t);if(n.failed)throw new Tm(n.failed);return this}maybeStep(t){let n=t.apply(this.doc);return n.failed||this.addStep(t,n.doc),n}get docChanged(){return this.steps.length>0}changedRange(){let t=1e9,n=-1e9;for(let i=0;i{t=Math.min(t,l),n=Math.max(n,a)})}return t==1e9?null:{from:t,to:n}}addStep(t,n){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=n}replace(t,n=t,i=mn.empty){let o=OS(this.doc,t,n,i);return o&&this.step(o),this}replaceWith(t,n,i){return this.replace(t,n,new mn(sn.from(i),0,0))}delete(t,n){return this.replace(t,n,mn.empty)}insert(t,n){return this.replaceWith(t,t,n)}replaceRange(t,n,i){return GIe(this,t,n,i),this}replaceRangeWith(t,n,i){return QIe(this,t,n,i),this}deleteRange(t,n){return YIe(this,t,n),this}lift(t,n){return RIe(this,t,n),this}join(t,n=1){return WIe(this,t,n),this}wrap(t,n){return OIe(this,t,n),this}setBlockType(t,n=t,i,o=null){return PIe(this,t,n,i,o),this}setNodeMarkup(t,n,i=null,o){return $Ie(this,t,n,i,o),this}setNodeAttribute(t,n,i){return this.step(new dm(t,n,i)),this}setDocAttribute(t,n){return this.step(new Vv(t,n)),this}addNodeMark(t,n){return this.step(new of(t,n)),this}removeNodeMark(t,n){let i=this.doc.nodeAt(t);if(!i)throw new RangeError("No node at position "+t);if(n instanceof Fi)n.isInSet(i.marks)&&this.step(new Ap(t,n));else{let o=i.marks,s,r=[];for(;s=n.isInSet(o);)r.push(new Ap(t,s)),o=s.removeFromSet(o);for(let l=r.length-1;l>=0;l--)this.step(r[l])}return this}split(t,n=1,i){return zIe(this,t,n,i),this}addMark(t,n,i){return NIe(this,t,n,i),this}removeMark(t,n,i){return FIe(this,t,n,i),this}clearIncompatible(t,n,i){return DS(this,t,n,i),this}}const Z8=Object.create(null);class Bi{constructor(t,n,i){this.$anchor=t,this.$head=n,this.ranges=i||[new XIe(t.min(n),t.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let n=0;n=0;s--){let r=n<0?I1(t.node(0),t.node(s),t.before(s+1),t.index(s),n,i):I1(t.node(0),t.node(s),t.after(s+1),t.index(s)+1,n,i);if(r)return r}return null}static near(t,n=1){return this.findFrom(t,n)||this.findFrom(t,-n)||new da(t.node(0))}static atStart(t){return I1(t,t,0,0,1)||new da(t)}static atEnd(t){return I1(t,t,t.content.size,t.childCount,-1)||new da(t)}static fromJSON(t,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let i=Z8[n.type];if(!i)throw new RangeError(`No selection type ${n.type} defined`);return i.fromJSON(t,n)}static jsonID(t,n){if(t in Z8)throw new RangeError("Duplicate use of selection JSON ID "+t);return Z8[t]=n,n.prototype.jsonID=t,n}getBookmark(){return Xn.between(this.$anchor,this.$head).getBookmark()}}Bi.prototype.visible=!0;class XIe{constructor(t,n){this.$from=t,this.$to=n}}let wR=!1;function CR(e){!wR&&!e.parent.inlineContent&&(wR=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class Xn extends Bi{constructor(t,n=t){CR(t),CR(n),super(t,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let i=t.resolve(n.map(this.head));if(!i.parent.inlineContent)return Bi.near(i);let o=t.resolve(n.map(this.anchor));return new Xn(o.parent.inlineContent?o:i,i)}replace(t,n=mn.empty){if(super.replace(t,n),n==mn.empty){let i=this.$from.marksAcross(this.$to);i&&t.ensureMarks(i)}}eq(t){return t instanceof Xn&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new uw(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Xn(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,i=n){let o=t.resolve(n);return new this(o,i==n?o:t.resolve(i))}static between(t,n,i){let o=t.pos-n.pos;if((!i||o)&&(i=o>=0?1:-1),!n.parent.inlineContent){let s=Bi.findFrom(n,i,!0)||Bi.findFrom(n,-i,!0);if(s)n=s.$head;else return Bi.near(n,i)}return t.parent.inlineContent||(o==0?t=n:(t=(Bi.findFrom(t,-i,!0)||Bi.findFrom(t,i,!0)).$anchor,t.pos0?0:1);o>0?r=0;r+=o){let l=t.child(r);if(l.isAtom){if(!s&&Kn.isSelectable(l))return Kn.create(e,n-(o<0?l.nodeSize:0))}else{let a=I1(e,l,n+o,o<0?l.childCount:0,o,s);if(a)return a}n+=l.nodeSize*o}return null}function AR(e,t,n){let i=e.steps.length-1;if(i{r==null&&(r=c)}),e.setSelection(Bi.near(e.doc.resolve(r),n))}const xR=1,e9=2,SR=4;class tMe extends JIe{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(t){return this.storedMarks=t,this.updated|=e9,this}ensureMarks(t){return Fi.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&e9)>0}addStep(t,n){super.addStep(t,n),this.updated=this.updated&~e9,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,n=!0){let i=this.selection;return n&&(t=t.mark(this.storedMarks||(i.empty?i.$from.marks():i.$from.marksAcross(i.$to)||Fi.none))),i.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,n,i){let o=this.doc.type.schema;if(n==null)return t?this.replaceSelectionWith(o.text(t),!0):this.deleteSelection();{if(i==null&&(i=n),!t)return this.deleteRange(n,i);let s=this.storedMarks;if(!s){let r=this.doc.resolve(n);s=i==n?r.marks():r.marksAcross(this.doc.resolve(i))}return this.replaceRangeWith(n,i,o.text(t,s)),!this.selection.empty&&this.selection.to==n+t.length&&this.setSelection(Bi.near(this.selection.$to)),this}}setMeta(t,n){return this.meta[typeof t=="string"?t:t.key]=n,this}getMeta(t){return this.meta[typeof t=="string"?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=SR,this}get scrolledIntoView(){return(this.updated&SR)>0}}function _R(e,t){return!t||!e?e:e.bind(t)}class v0{constructor(t,n,i){this.name=t,this.init=_R(n.init,i),this.apply=_R(n.apply,i)}}const nMe=[new v0("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new v0("selection",{init(e,t){return e.selection||Bi.atStart(t.doc)},apply(e){return e.selection}}),new v0("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,n,i){return i.selection.$cursor?e.storedMarks:null}}),new v0("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})];class G8{constructor(t,n){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=nMe.slice(),n&&n.forEach(i=>{if(this.pluginsByKey[i.key])throw new RangeError("Adding different instances of a keyed plugin ("+i.key+")");this.plugins.push(i),this.pluginsByKey[i.key]=i,i.spec.state&&this.fields.push(new v0(i.key,i.spec.state,i))})}}class Uh{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,n=-1){for(let i=0;ii.toJSON())),t&&typeof t=="object")for(let i in t){if(i=="doc"||i=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let o=t[i],s=o.spec.state;s&&s.toJSON&&(n[i]=s.toJSON.call(o,this[o.key]))}return n}static fromJSON(t,n,i){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let o=new G8(t.schema,t.plugins),s=new Uh(o);return o.fields.forEach(r=>{if(r.name=="doc")s.doc=up.fromJSON(t.schema,n.doc);else if(r.name=="selection")s.selection=Bi.fromJSON(s.doc,n.selection);else if(r.name=="storedMarks")n.storedMarks&&(s.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(i)for(let l in i){let a=i[l],u=a.spec.state;if(a.key==r.name&&u&&u.fromJSON&&Object.prototype.hasOwnProperty.call(n,l)){s[r.name]=u.fromJSON.call(a,t,n[l],s);return}}s[r.name]=r.init(t,s)}}),s}}function dK(e,t,n){for(let i in e){let o=e[i];o instanceof Function?o=o.bind(t):i=="handleDOMEvents"&&(o=dK(o,t,{})),n[i]=o}return n}class b2{constructor(t){this.spec=t,this.props={},t.props&&dK(t.props,this,this.props),this.key=t.key?t.key.key:fK("plugin")}getState(t){return t[this.key]}}const Q8=Object.create(null);function fK(e){return e in Q8?e+"$"+ ++Q8[e]:(Q8[e]=0,e+"$")}class BS{constructor(t="key"){this.key=fK(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}function sv(e){return e.isText?e.text.length:e.type===ri.nodes.attachment?Nf(e.attrs).length:e.type===ri.nodes.quote?sw(e.attrs).length:Rp(e.attrs).length}function iMe(e,t){if(!t.parent.isTextblock)return ic(e,t.pos);if(t.textOffset>0)return ic(e,t.pos-t.textOffset);const n=t.nodeBefore;return n&&n.isText?ic(e,t.pos-n.nodeSize):ic(e,t.pos)}function nd(e,t){let n=Math.max(0,t),i=-1;return e.forEach((o,s)=>{if(i!==-1)return;let r=0;if(o.forEach(l=>{r+=sv(l)}),n>r){n-=r+1;return}o.forEach((l,a)=>{if(i!==-1)return;const u=s+1+a,c=sv(l);if(n<=c){l.isText?i=u+n:i=n===0?u:u+1;return}n-=c}),i===-1&&(i=s+1+o.content.size)}),i===-1?e.content.size-1:i}function ic(e,t){let n=0,i=-1;return e.forEach((o,s)=>{if(i!==-1)return;const r=s+o.nodeSize;if(t>r){o.forEach(a=>{n+=sv(a)}),n+=1;return}let l=0;o.forEach((a,u)=>{if(i!==-1)return;const c=s+1+u;if(a.isText){const d=c+a.nodeSize;if(t<=d){i=n+l+Math.max(0,t-c);return}l+=a.text.length}else{const d=c+1;if(t<=d){i=n+l+(t<=c?0:sv(a));return}l+=sv(a)}}),i===-1&&(i=n+l)}),i===-1?n:i}function oMe(e){const t=[];return e.forEach(n=>{n.forEach(i=>{!i.isText&&i.type===ri.nodes.mention&&i.attrs.kind==="skill"&&t.push({name:i.attrs.name})})}),t}function IR(e){return(t,n)=>{const i=t.selection.$head,o=e?i.start():i.end();return n&&n(t.tr.setSelection(Xn.create(t.doc,t.selection.$anchor.pos,o)).scrollIntoView()),!0}}var Nb=200,Ys=function(){};Ys.prototype.append=function(t){return t.length?(t=Ys.from(t),!this.length&&t||t.length=n?Ys.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,n))};Ys.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)};Ys.prototype.forEach=function(t,n,i){n===void 0&&(n=0),i===void 0&&(i=this.length),n<=i?this.forEachInner(t,n,i,0):this.forEachInvertedInner(t,n,i,0)};Ys.prototype.map=function(t,n,i){n===void 0&&(n=0),i===void 0&&(i=this.length);var o=[];return this.forEach(function(s,r){return o.push(t(s,r))},n,i),o};Ys.from=function(t){return t instanceof Ys?t:t&&t.length?new hK(t):Ys.empty};var hK=(function(e){function t(i){e.call(this),this.values=i}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(o,s){return o==0&&s==this.length?this:new t(this.values.slice(o,s))},t.prototype.getInner=function(o){return this.values[o]},t.prototype.forEachInner=function(o,s,r,l){for(var a=s;a=r;a--)if(o(this.values[a],l+a)===!1)return!1},t.prototype.leafAppend=function(o){if(this.length+o.length<=Nb)return new t(this.values.concat(o.flatten()))},t.prototype.leafPrepend=function(o){if(this.length+o.length<=Nb)return new t(o.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t})(Ys);Ys.empty=new hK([]);var sMe=(function(e){function t(n,i){e.call(this),this.left=n,this.right=i,this.length=n.length+i.length,this.depth=Math.max(n.depth,i.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(i){return il&&this.right.forEachInner(i,Math.max(o-l,0),Math.min(this.length,s)-l,r+l)===!1)return!1},t.prototype.forEachInvertedInner=function(i,o,s,r){var l=this.left.length;if(o>l&&this.right.forEachInvertedInner(i,o-l,Math.max(s,l)-l,r+l)===!1||s=s?this.right.slice(i-s,o-s):this.left.slice(i,s).append(this.right.slice(0,o-s))},t.prototype.leafAppend=function(i){var o=this.right.leafAppend(i);if(o)return new t(this.left,o)},t.prototype.leafPrepend=function(i){var o=this.left.leafPrepend(i);if(o)return new t(o,this.right)},t.prototype.appendInner=function(i){return this.left.depth>=Math.max(this.right.depth,i.depth)+1?new t(this.left,new t(this.right,i)):new t(this,i)},t})(Ys);const rMe=500;class fu{constructor(t,n){this.items=t,this.eventCount=n}popEvent(t,n){if(this.eventCount==0)return null;let i=this.items.length;for(;;i--)if(this.items.get(i-1).selection){--i;break}let o,s;n&&(o=this.remapping(i,this.items.length),s=o.maps.length);let r=t.tr,l,a,u=[],c=[];return this.items.forEach((d,f)=>{if(!d.step){o||(o=this.remapping(i,f+1),s=o.maps.length),s--,c.push(d);return}if(o){c.push(new qu(d.map));let h=d.step.map(o.slice(s)),m;h&&r.maybeStep(h).doc&&(m=r.mapping.maps[r.mapping.maps.length-1],u.push(new qu(m,void 0,void 0,u.length+c.length))),s--,m&&o.appendMap(m,s)}else r.maybeStep(d.step);if(d.selection)return l=o?d.selection.map(o.slice(s)):d.selection,a=new fu(this.items.slice(0,i).append(c.reverse().concat(u)),this.eventCount-1),!1},this.items.length,0),{remaining:a,transform:r,selection:l}}addTransform(t,n,i,o){let s=[],r=this.eventCount,l=this.items,a=!o&&l.length?l.get(l.length-1):null;for(let c=0;caMe&&(l=lMe(l,u),r-=u),new fu(l.append(s),r)}remapping(t,n){let i=new Uv;return this.items.forEach((o,s)=>{let r=o.mirrorOffset!=null&&s-o.mirrorOffset>=t?i.maps.length-o.mirrorOffset:void 0;i.appendMap(o.map,r)},t,n),i}addMaps(t){return this.eventCount==0?this:new fu(this.items.append(t.map(n=>new qu(n))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let i=[],o=Math.max(0,this.items.length-n),s=t.mapping,r=t.steps.length,l=this.eventCount;this.items.forEach(f=>{f.selection&&l--},o);let a=n;this.items.forEach(f=>{let h=s.getMirror(--a);if(h==null)return;r=Math.min(r,h);let m=s.maps[h];if(f.step){let g=t.steps[h].invert(t.docs[h]),y=f.selection&&f.selection.map(s.slice(a+1,h));y&&l++,i.push(new qu(m,g,y))}else i.push(new qu(m))},o);let u=[];for(let f=n;frMe&&(d=d.compress(this.items.length-i.length)),d}emptyItemCount(){let t=0;return this.items.forEach(n=>{n.step||t++}),t}compress(t=this.items.length){let n=this.remapping(0,t),i=n.maps.length,o=[],s=0;return this.items.forEach((r,l)=>{if(l>=t)o.push(r),r.selection&&s++;else if(r.step){let a=r.step.map(n.slice(i)),u=a&&a.getMap();if(i--,u&&n.appendMap(u,i),a){let c=r.selection&&r.selection.map(n.slice(i));c&&s++;let d=new qu(u.invert(),a,c),f,h=o.length-1;(f=o.length&&o[h].merge(d))?o[h]=f:o.push(d)}}else r.map&&i--},this.items.length,0),new fu(Ys.from(o.reverse()),s)}}fu.empty=new fu(Ys.empty,0);function lMe(e,t){let n;return e.forEach((i,o)=>{if(i.selection&&t--==0)return n=o,!1}),e.slice(n)}class qu{constructor(t,n,i,o){this.map=t,this.step=n,this.selection=i,this.mirrorOffset=o}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new qu(n.getMap().invert(),n,this.selection)}}}class qd{constructor(t,n,i,o,s){this.done=t,this.undone=n,this.prevRanges=i,this.prevTime=o,this.prevComposition=s}}const aMe=20;function uMe(e,t,n,i){let o=n.getMeta(cp),s;if(o)return o.historyState;n.getMeta(mK)&&(e=new qd(e.done,e.undone,null,0,-1));let r=n.getMeta("appendedTransaction");if(n.steps.length==0)return e;if(r&&r.getMeta(cp))return r.getMeta(cp).redo?new qd(e.done.addTransform(n,void 0,i,ek(t)),e.undone,MR(n.mapping.maps),e.prevTime,e.prevComposition):new qd(e.done,e.undone.addTransform(n,void 0,i,ek(t)),null,e.prevTime,e.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(r&&r.getMeta("addToHistory")===!1)){let l=n.getMeta("composition"),a=e.prevTime==0||!r&&e.prevComposition!=l&&(e.prevTime<(n.time||0)-i.newGroupDelay||!cMe(n,e.prevRanges)),u=r?Y8(e.prevRanges,n.mapping):MR(n.mapping.maps);return new qd(e.done.addTransform(n,a?t.selection.getBookmark():void 0,i,ek(t)),fu.empty,u,n.time,l??e.prevComposition)}else return(s=n.getMeta("rebased"))?new qd(e.done.rebased(n,s),e.undone.rebased(n,s),Y8(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new qd(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),Y8(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function cMe(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((i,o)=>{for(let s=0;s=t[s]&&(n=!0)}),n}function MR(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((i,o,s,r)=>t.push(s,r));return t}function Y8(e,t){if(!e)return null;let n=[];for(let i=0;i{let o=cp.getState(n);if(!o||(e?o.undone:o.done).eventCount==0)return!1;if(i){let s=dMe(o,n,e);s&&i(t?s.scrollIntoView():s)}return!0}}const vK=gK(!1,!0),k6=gK(!0,!0);function hMe(e,t,n){const i=nd(e.doc,n.start),o=nd(e.doc,n.end),s=qv(e.doc),r=n.start>0?s.charAt(n.start-1):"",l=s.charAt(n.end),a=[];(r==="!"||r==="\\")&&a.push(ri.text(" ")),a.push(QV(t)),(l===""||!/\s/.test(l))&&a.push(ri.text(" "));const u=e.tr.replaceWith(i,o,a);return u.setSelection(Xn.create(u.doc,i+a.reduce((c,d)=>c+d.nodeSize,0))),u.scrollIntoView()}function pMe(e,t,n){const i=nd(e.doc,n.start),o=nd(e.doc,n.end),s=e.tr.insertText(t,i,o);return s.setSelection(Xn.create(s.doc,i+t.length)),pK(s.scrollIntoView())}function mMe(e,t,n){const i=n?n.start:ic(e.doc,e.selection.from),o=n?n.end:ic(e.doc,e.selection.to),s=nd(e.doc,i),r=nd(e.doc,o),l=qv(e.doc),a=i>0?l.charAt(i-1):"",u=l.charAt(o),c=[];(a==="!"||a==="\\")&&c.push(ri.text(" ")),c.push(YV(t)),(u===""||!/\s/.test(u))&&c.push(ri.text(" "));const d=e.tr.replaceWith(s,r,c);return d.setSelection(Xn.create(d.doc,s+c.reduce((f,h)=>f+h.nodeSize,0))),d.scrollIntoView()}function gMe(e,t,n){const i=e.selection.to,o=qv(e.doc),s=ic(e.doc,i),r=s>0?o.charAt(s-1):"",l=o.charAt(s),a=[];r!==""&&!/\s/.test(r)&&a.push(ri.text(" ")),a.push(JV(n!==void 0&&n.length>0?{...t,comment:n}:t)),(l===""||!/\s/.test(l))&&a.push(ri.text(" "));const u=e.tr.replaceWith(i,i,a);return u.setSelection(Xn.create(u.doc,i+a.reduce((c,d)=>c+d.nodeSize,0))),u.scrollIntoView()}function t9(e,t){return mn.maxOpen(Wv(e.replace(/\r\n?/g,` -`),t).content)}function ER(e){const t=typeof e.source=="string"&&e.source.length>0?`from: ${LS(e.source)} -`:"",n=typeof e.comment=="string"&&e.comment.length>0?` - -${e.comment}`:"";return`${t}${MV(e.text)}${n}`}function yK(e){const t=i=>i.isText?i.text??"":i.type===ri.nodes.mention?Rp(i.attrs):i.type===ri.nodes.attachment?i.attrs.name:i.type===ri.nodes.quote?ER(i.attrs):i.textBetween(0,i.content.size,""),n=[];return e.content.forEach(i=>{if(i.type===ri.nodes.mention||i.type===ri.nodes.attachment||i.type===ri.nodes.quote)n.push(t(i));else{let o="",s=!1;i.forEach(r=>{if(r.type===ri.nodes.quote){const a=ER(r.attrs);o=o.length>0?`${o.replace(/ +$/,"")} - -${a}`:a,s=!0;return}let l=t(r);s&&(l=l.replace(/^ /,""),o+=` - -`,s=!1),o+=l}),n.push(o)}}),n.join(` -`)}const b6=` - - - - -`,kK=` - - - - -`,bK='',wK=` - - - -`,CK=` - - -`,AK='',xK=` - - -`,SK=` - - -`,_K=` - - -`,vMe='',yMe='',kMe='',bMe='',wMe='',CMe={sm:14,md:16,lg:20},AMe={file:b6,folder:kK,skill:bK,copy:wK,check:CK,"external-link":AK,target:xK,"file-edit":SK,close:_K,attachment:vMe,image:yMe,video:kMe,fullscreen:bMe,quote:wMe};function tl(e,t="md"){const n=CMe[t];return AMe[e].replace(/]*>/,i=>i.replace(/\s(?:width|height)="[^"]*"/g,"")).replace(/^