flow-mindmap 0.3.2 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,22 +1,22 @@
1
- (function(ce,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(ce=typeof globalThis<"u"?globalThis:ce||self,t(ce.FlowMind={},ce.Vue))})(this,function(ce,t){"use strict";const yi=["width","height","stroke-width"],Ei={key:4,points:"6 9 12 15 18 9"},xi={key:5,points:"9 6 15 12 9 18"},ne=t.defineComponent({__name:"Icon",props:{name:{},size:{},stroke:{}},setup(e){return(a,i)=>(t.openBlock(),t.createElementBlock("svg",{width:e.size??16,height:e.size??16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":e.stroke??1.8,"stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[e.name==="add"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[i[0]||(i[0]=t.createElementVNode("circle",{cx:"12",cy:"12",r:"9"},null,-1)),i[1]||(i[1]=t.createElementVNode("line",{x1:"12",y1:"8",x2:"12",y2:"16"},null,-1)),i[2]||(i[2]=t.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1))],64)):e.name==="minus"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[i[3]||(i[3]=t.createElementVNode("circle",{cx:"12",cy:"12",r:"9"},null,-1)),i[4]||(i[4]=t.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1))],64)):e.name==="delete"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:2},[i[5]||(i[5]=t.createStaticVNode('<polyline points="4 7 20 7"></polyline><path d="M9 7 V5 a1 1 0 0 1 1 -1 h4 a1 1 0 0 1 1 1 V7"></path><path d="M6 7 l1 12 a1 1 0 0 0 1 1 h8 a1 1 0 0 0 1 -1 l1 -12"></path><line x1="10" y1="11" x2="10" y2="18"></line><line x1="14" y1="11" x2="14" y2="18"></line>',5))],64)):e.name==="edit"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:3},[i[6]||(i[6]=t.createElementVNode("path",{d:"M4 20 l4 -1 11 -11 -3 -3 -11 11 z"},null,-1)),i[7]||(i[7]=t.createElementVNode("line",{x1:"14",y1:"6",x2:"18",y2:"10"},null,-1))],64)):e.name==="collapse"?(t.openBlock(),t.createElementBlock("polyline",Ei)):e.name==="expand"?(t.openBlock(),t.createElementBlock("polyline",xi)):e.name==="collapse-all"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:6},[i[8]||(i[8]=t.createStaticVNode('<line x1="4" y1="4" x2="10" y2="10"></line><polyline points="6 10 10 10 10 6"></polyline><line x1="20" y1="4" x2="14" y2="10"></line><polyline points="14 6 14 10 18 10"></polyline><line x1="20" y1="20" x2="14" y2="14"></line><polyline points="14 18 14 14 18 14"></polyline><line x1="4" y1="20" x2="10" y2="14"></line><polyline points="6 14 10 14 10 18"></polyline>',8))],64)):e.name==="expand-all"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:7},[i[9]||(i[9]=t.createStaticVNode('<line x1="10" y1="10" x2="4" y2="4"></line><polyline points="4 6 4 4 6 4"></polyline><line x1="14" y1="10" x2="20" y2="4"></line><polyline points="20 6 20 4 18 4"></polyline><line x1="14" y1="14" x2="20" y2="20"></line><polyline points="20 18 20 20 18 20"></polyline><line x1="10" y1="14" x2="4" y2="20"></line><polyline points="4 18 4 20 6 20"></polyline>',8))],64)):e.name==="expand-level-1"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:8},[i[10]||(i[10]=t.createStaticVNode('<circle cx="12" cy="5" r="1.8" fill="currentColor" stroke="none"></circle><line x1="12" y1="7" x2="12" y2="11"></line><line x1="12" y1="11" x2="5" y2="17"></line><line x1="12" y1="11" x2="12" y2="17"></line><line x1="12" y1="11" x2="19" y2="17"></line><circle cx="5" cy="19" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="12" cy="19" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="19" cy="19" r="1.8" fill="currentColor" stroke="none"></circle>',8))],64)):e.name==="expand-level-2"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:9},[i[11]||(i[11]=t.createStaticVNode('<circle cx="12" cy="3" r="1.4" fill="currentColor" stroke="none"></circle><line x1="12" y1="4.5" x2="12" y2="7"></line><line x1="12" y1="7" x2="5" y2="11"></line><line x1="12" y1="7" x2="12" y2="11"></line><line x1="12" y1="7" x2="19" y2="11"></line><line x1="5" y1="11" x2="3" y2="16"></line><line x1="5" y1="11" x2="7" y2="16"></line><line x1="12" y1="11" x2="10" y2="16"></line><line x1="12" y1="11" x2="14" y2="16"></line><line x1="19" y1="11" x2="17" y2="16"></line><line x1="19" y1="11" x2="21" y2="16"></line><circle cx="5" cy="11" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="12" cy="11" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="19" cy="11" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="3" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="7" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="10" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="14" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="17" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="21" cy="18" r="1.4" fill="currentColor" stroke="none"></circle>',20))],64)):e.name==="zoom-in"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:10},[i[12]||(i[12]=t.createElementVNode("circle",{cx:"11",cy:"11",r:"7"},null,-1)),i[13]||(i[13]=t.createElementVNode("line",{x1:"11",y1:"8",x2:"11",y2:"14"},null,-1)),i[14]||(i[14]=t.createElementVNode("line",{x1:"8",y1:"11",x2:"14",y2:"11"},null,-1)),i[15]||(i[15]=t.createElementVNode("line",{x1:"16",y1:"16",x2:"21",y2:"21"},null,-1))],64)):e.name==="zoom-out"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:11},[i[16]||(i[16]=t.createElementVNode("circle",{cx:"11",cy:"11",r:"7"},null,-1)),i[17]||(i[17]=t.createElementVNode("line",{x1:"8",y1:"11",x2:"14",y2:"11"},null,-1)),i[18]||(i[18]=t.createElementVNode("line",{x1:"16",y1:"16",x2:"21",y2:"21"},null,-1))],64)):e.name==="reset"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:12},[i[19]||(i[19]=t.createElementVNode("polyline",{points:"4 9 4 4 9 4"},null,-1)),i[20]||(i[20]=t.createElementVNode("polyline",{points:"15 4 20 4 20 9"},null,-1)),i[21]||(i[21]=t.createElementVNode("polyline",{points:"20 15 20 20 15 20"},null,-1)),i[22]||(i[22]=t.createElementVNode("polyline",{points:"9 20 4 20 4 15"},null,-1))],64)):e.name==="settings"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:13},[i[23]||(i[23]=t.createStaticVNode('<circle cx="12" cy="12" r="3"></circle><line x1="12" y1="2.5" x2="12" y2="4.5"></line><line x1="12" y1="19.5" x2="12" y2="21.5"></line><line x1="2.5" y1="12" x2="4.5" y2="12"></line><line x1="19.5" y1="12" x2="21.5" y2="12"></line><line x1="5.6" y1="5.6" x2="7" y2="7"></line><line x1="17" y1="17" x2="18.4" y2="18.4"></line><line x1="5.6" y1="18.4" x2="7" y2="17"></line><line x1="17" y1="7" x2="18.4" y2="5.6"></line>',9))],64)):e.name==="logo"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:14},[i[24]||(i[24]=t.createStaticVNode('<circle cx="12" cy="12" r="2.2"></circle><circle cx="4" cy="5" r="1.6"></circle><circle cx="20" cy="5" r="1.6"></circle><circle cx="4" cy="19" r="1.6"></circle><circle cx="20" cy="19" r="1.6"></circle><line x1="10.5" y1="10.8" x2="5.2" y2="6.4"></line><line x1="13.5" y1="10.8" x2="18.8" y2="6.4"></line><line x1="10.5" y1="13.2" x2="5.2" y2="17.6"></line><line x1="13.5" y1="13.2" x2="18.8" y2="17.6"></line>',9))],64)):e.name==="import"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:15},[i[25]||(i[25]=t.createElementVNode("path",{d:"M12 4 V15"},null,-1)),i[26]||(i[26]=t.createElementVNode("polyline",{points:"7 10 12 15 17 10"},null,-1)),i[27]||(i[27]=t.createElementVNode("path",{d:"M4 19 H20"},null,-1))],64)):e.name==="export"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:16},[i[28]||(i[28]=t.createElementVNode("path",{d:"M12 15 V4"},null,-1)),i[29]||(i[29]=t.createElementVNode("polyline",{points:"7 9 12 4 17 9"},null,-1)),i[30]||(i[30]=t.createElementVNode("path",{d:"M4 19 H20"},null,-1))],64)):e.name==="balance"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:17},[i[31]||(i[31]=t.createStaticVNode('<line x1="3" y1="6" x2="21" y2="6"></line><line x1="3" y1="12" x2="21" y2="12"></line><line x1="3" y1="18" x2="21" y2="18"></line><polyline points="9 4 5 6 9 8"></polyline><polyline points="15 4 19 6 15 8"></polyline><polyline points="9 10 5 12 9 14"></polyline><polyline points="15 10 19 12 15 14"></polyline><polyline points="9 16 5 18 9 20"></polyline><polyline points="15 16 19 18 15 20"></polyline>',9))],64)):e.name==="mindmap"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:18},[i[32]||(i[32]=t.createStaticVNode('<circle cx="12" cy="12" r="2.4" fill="currentColor" stroke="none"></circle><line x1="13.4" y1="10.6" x2="18.5" y2="5.5"></line><line x1="13.4" y1="13.4" x2="18.5" y2="18.5"></line><line x1="10.6" y1="10.6" x2="5.5" y2="5.5"></line><line x1="10.6" y1="13.4" x2="5.5" y2="18.5"></line><circle cx="19.5" cy="4.5" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="19.5" cy="19.5" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="4.5" cy="4.5" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="4.5" cy="19.5" r="1.8" fill="currentColor" stroke="none"></circle>',9))],64)):e.name==="tree"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:19},[i[33]||(i[33]=t.createStaticVNode('<circle cx="5" cy="12" r="2" fill="currentColor" stroke="none"></circle><circle cx="19" cy="5" r="2" fill="currentColor" stroke="none"></circle><circle cx="19" cy="12" r="2" fill="currentColor" stroke="none"></circle><circle cx="19" cy="19" r="2" fill="currentColor" stroke="none"></circle><line x1="7" y1="12" x2="12" y2="12"></line><line x1="12" y1="12" x2="12" y2="5"></line><line x1="12" y1="12" x2="12" y2="19"></line><line x1="12" y1="5" x2="17" y2="5"></line><line x1="12" y1="19" x2="17" y2="19"></line>',9))],64)):e.name==="org"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:20},[i[34]||(i[34]=t.createStaticVNode('<circle cx="12" cy="5" r="2" fill="currentColor" stroke="none"></circle><circle cx="6" cy="19" r="2" fill="currentColor" stroke="none"></circle><circle cx="12" cy="19" r="2" fill="currentColor" stroke="none"></circle><circle cx="18" cy="19" r="2" fill="currentColor" stroke="none"></circle><line x1="12" y1="7" x2="12" y2="13"></line><line x1="6" y1="13" x2="18" y2="13"></line><line x1="6" y1="13" x2="6" y2="17"></line><line x1="12" y1="13" x2="12" y2="17"></line><line x1="18" y1="13" x2="18" y2="17"></line>',9))],64)):e.name==="image"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:21},[i[35]||(i[35]=t.createElementVNode("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"},null,-1)),i[36]||(i[36]=t.createElementVNode("circle",{cx:"9",cy:"11",r:"1.6"},null,-1)),i[37]||(i[37]=t.createElementVNode("polyline",{points:"3 17 9 12 13 15 16 13 21 17"},null,-1))],64)):e.name==="x"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:22},[i[38]||(i[38]=t.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"},null,-1)),i[39]||(i[39]=t.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"},null,-1))],64)):e.name==="link"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:23},[i[40]||(i[40]=t.createElementVNode("path",{d:"M10 13 a4 4 0 0 0 5.66 0 l3 -3 a4 4 0 1 0 -5.66 -5.66 l-1 1"},null,-1)),i[41]||(i[41]=t.createElementVNode("path",{d:"M14 11 a4 4 0 0 0 -5.66 0 l-3 3 a4 4 0 1 0 5.66 5.66 l1 -1"},null,-1))],64)):e.name==="note"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:24},[i[42]||(i[42]=t.createElementVNode("path",{d:"M6 4 h9 l3 3 v13 a1 1 0 0 1 -1 1 h-11 a1 1 0 0 1 -1 -1 v-15 a1 1 0 0 1 1 -1 z"},null,-1)),i[43]||(i[43]=t.createElementVNode("line",{x1:"8",y1:"10",x2:"16",y2:"10"},null,-1)),i[44]||(i[44]=t.createElementVNode("line",{x1:"8",y1:"13",x2:"16",y2:"13"},null,-1)),i[45]||(i[45]=t.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):t.createCommentVNode("",!0)],8,yi))}}),ki="data:image/svg+xml,%3csvg%20t='1780822312364'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='7459'%20width='200'%20height='200'%3e%3cpath%20d='M329.16%20292.571h658.286V512H329.16zM329.16%200h658.286v219.429H329.16z'%20fill='%239AA1A2'%20p-id='7460'%3e%3c/path%3e%3cpath%20d='M44.927%20146.286a46.519%2046.519%200%200%201%2038.107-73.143h319.269v73.143H109.73V791.99l-48.713%205.705-24.43-651.41h8.339z'%20fill='%239AA1A2'%20p-id='7461'%3e%3c/path%3e%3cpath%20d='M363.83%20877.714H179.51c-78.775%200-142.921-66.12-142.921-147.31V112.787c0-21.943%2017.188-39.643%2038.473-39.643%2021.211%200%2033.5%2017.774%2033.5%2039.643v617.619c0%2037.522%2028.013%2076.58%2064.438%2076.58h190.903c21.211%200%2038.766%2013.97%2038.766%2035.84%200%2021.943-17.555%2034.89-38.766%2034.89z'%20fill='%239AA1A2'%20p-id='7462'%3e%3c/path%3e%3cpath%20d='M432.95%20438.857H179.51c-78.775%200-81.043-18.578-81.043-62.903l10.094-90.624c0%2020.48%2013.458%2080.677%2049.884%2080.677h210.139c21.211%200%20120.613%204.023%20120.613%2016.018%200%2011.922-35.036%2056.832-56.32%2056.832zM640.017%20749.714V640a54.857%2054.857%200%200%201%20109.714%200v109.714h109.715a54.857%2054.857%200%200%201%200%20109.715H749.73v109.714a54.857%2054.857%200%200%201-109.714%200V859.429H530.303a54.857%2054.857%200%200%201%200-109.715h109.714z'%20fill='%239AA1A2'%20p-id='7463'%3e%3c/path%3e%3c/svg%3e",wi="data:image/svg+xml,%3csvg%20t='1780822464335'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='8457'%20width='200'%20height='200'%3e%3cpath%20d='M512%20804.571h512V1024H512V804.571zM0%200h658.286v219.429H0V0z'%20fill='%239AA1A2'%20p-id='8458'%3e%3c/path%3e%3cpath%20d='M619.813%20950.857h-184.32c-78.775%200-142.922-66.121-142.922-147.31V185.93c0-21.943%2017.189-39.643%2038.474-39.643%2021.211%200%2033.353%2017.773%2033.353%2039.643v617.618c0%2037.523%2034.743%2073.728%2071.095%2073.728h184.32c21.211%200%2038.473%2012.069%2038.473%2033.939%200%2021.943-17.189%2039.643-38.473%2039.643z'%20fill='%239AA1A2'%20p-id='8459'%3e%3c/path%3e%3cpath%20d='M676.571%20457.143V347.429a54.857%2054.857%200%200%201%20109.715%200v109.714H896a54.857%2054.857%200%200%201%200%20109.714H786.286v109.714a54.857%2054.857%200%200%201-109.715%200V566.857H566.857a54.857%2054.857%200%200%201%200-109.714h109.714z'%20fill='%239AA1A2'%20p-id='8460'%3e%3c/path%3e%3c/svg%3e",qt=[18,15,13,12],Ni=[700,600,500,400],_i=[52,40,32,28],Si=[120,80,60,44],Mi=[.8,.8,.8,.8],vi=qt.length-1;function Ci(e,a){return Math.round(Ct(e,a)*Mi[at(e)])}function at(e){return Math.min(vi,Math.max(0,e))}function Ct(e,a=14){return Math.round(qt[at(e)]*a/14*10)/10}function Ti(e,a=14){return Math.round(_i[at(e)]*a/14)}const lt=60,Ve=14,be=24;let Tt=null;function Ai(){if(Tt)return Tt;const e=typeof document<"u"?document.createElement("canvas").getContext("2d"):null;return e?(Tt=e,e):{font:"",measureText:()=>({width:0})}}const jt=new Map;function Ri(e,a,i){const r=`${i}|${a}|${e}`,l=jt.get(r);if(l!==void 0)return l;const f=Ai();f.font=`${i} ${a}px "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif`;const s=f.measureText(e).width;return jt.set(r,s),s}const Oi=24,Ii=400,Bi=8,Jt=16,Li=4,Di=200;function zi(e,a,i){return Math.min(i,Math.max(a,e))}function $i(e,a,i,r,l){const f=at(a),s=Ct(a,i),c=Math.min(Ri(e.text||"",s,Ni[f]),Di),u=Ci(a,i),g=Math.ceil(c+u*2),b=!!(e.richContent&&(e.richContent.kind==="code"||e.richContent.kind==="table"))?Math.ceil(s*1.2)+6:Ti(a,i);let k=0;if(e.link&&(k+=Jt),e.note&&(k+=Jt),k>0){const I=(e.link?1:0)+(e.note?1:0);k+=Li*I}const h=g+k,m=(()=>{const I=Math.round(Si[f]*i/14);if(e.richContent&&(e.richContent.kind==="code"||e.richContent.kind==="table")){const j=l==null?void 0:l[e.id];return Math.max(I,j??240)}return I})(),L=!!(e.richContent&&(e.richContent.kind==="code"||e.richContent.kind==="table")),K=r==null?void 0:r[e.id],_=L?Math.max(24,K??Math.max(70,Math.ceil(s*5))):0,F=_>0?10:0;if(!e.image){const I=Math.max(m,h),j=Math.ceil(b+F+_);return{w:I,h:j}}const O=zi(e.image.width,Oi,Ii),$=Math.max(m,h,Math.ceil(O+u*2)),D=Math.ceil(e.image.height+Bi+b+F+_);return{w:$,h:D}}function Pi(e,a={}){const i=a.mode??"mindmap",r=a.preservePositions===!0,l=a.baseFontSize??14,f=en(e,0,null,1,"right",l,a.richHeights,a.richWidths);return Vi(f),Ui(f,i,r),f.x=0,f.y=0,Hi(f,r)}function Ui(e,a,i=!1){if(a==="mindmap"){const r=e.children;if(r.length!==0)if(r.length===1)r[0]._dir="right",r[0].side=1,r[0]._dirRight=1;else{const c=r.reduce((b,k)=>b+k._subtreeH,0);let u=1,g=Math.abs(r[0]._subtreeH-(c-r[0]._subtreeH)),y=0;for(let b=0;b<r.length-1;b++){y+=r[b]._subtreeH;const k=Math.abs(y-(c-y));k<g&&(g=k,u=b+1)}for(let b=0;b<u;b++)r[b]._dir="right",r[b].side=1,r[b]._dirRight=1;for(let b=u;b<r.length;b++)r[b]._dir="left",r[b].side=-1,r[b]._dirRight=-1}const l=e.children.filter(c=>c.side===1),f=e.children.filter(c=>c.side===-1),s=(c,u)=>{const g=u==="right"?1:-1;c._dir=u,c.side=g,c._dirRight=g;for(const y of c.children)s(y,u)};for(const c of l)s(c,"right");for(const c of f)s(c,"left");if(l.length>0){const c={...e,children:l};st(c,"right",lt,!0,i)}if(f.length>0){const c={...e,children:f};st(c,"left",lt,!0,i)}}else if(a==="tree"){const r=l=>{l.side=1,l._dir="right";for(const f of l.children)r(f)};for(const l of e.children)l._dir="right";st(e,"right",lt,!0,i),r(e)}else{for(const r of e.children)r._dir="down";Qt(e,lt,i)}}function st(e,a,i,r,l=!1){if(e.children.length===0)return;const f=e.children.reduce((g,y,b)=>g+y._subtreeH+(b>0?Ve:0),0),s=a==="right"?1:-1,c=r?s:1;let u=e.y-c*f/2;e.children.forEach(g=>{l||(g.x=e.x+s*(e.width/2+i+g.width/2),g.y=u+c*g._subtreeH/2),g._dir=a,u+=c*(g._subtreeH+Ve),st(g,a,i,!1,l)})}function Qt(e,a,i=!1){if(e.children.length===0)return;const r=e.children.reduce((f,s,c)=>f+s._subtreeW+(c>0?Ve*2:0),0);let l=e.x-r/2;e.children.forEach(f=>{i||(f.x=l+f._subtreeW/2,f.y=e.y+e.height/2+a+f.height/2),f._dir="down",l+=f._subtreeW+Ve*2,Qt(f,a,i)})}function en(e,a,i,r,l,f,s,c){const u=$i(e,a,f,s,c),g={id:e.id,text:e.text,depth:a,x:e._x??0,y:e._y??0,width:u.w,height:u.h,fontSize:Ct(a,f),isRoot:a===0,collapsed:e.collapsed,side:r,_dir:l,_dirRight:r,_subtreeH:u.h,_subtreeW:u.w,image:e.image?{...e.image}:void 0,link:e.link?{url:e.link.url}:void 0,note:e.note?{text:e.note.text}:void 0,richContent:e.richContent?{kind:e.richContent.kind,raw:e.richContent.raw,lang:e.richContent.lang}:void 0,children:[],parent:i};if(e.collapsed)return g;const y=e.children.length,b=Math.ceil(y/2);return g.children=e.children.map((k,h)=>{const m=a===0?h<b?1:-1:r;return en(k,a+1,g,m,l,f,s,c)}),g}function Vi(e){const a=[e];for(let i=0;i<a.length;i++){const r=a[i];for(const l of r.children)a.push(l)}for(let i=a.length-1;i>=0;i--){const r=a[i];if(r.collapsed||r.children.length===0){r._subtreeH=r.height,r._subtreeW=r.width;continue}let l=0,f=0;for(const s of r.children)l+=s._subtreeH,f+=s._subtreeW;r.children.length>1&&(l+=Ve*(r.children.length-1),f+=Ve*2*(r.children.length-1)),r._subtreeH=Math.max(r.height,l),r._subtreeW=Math.max(r.width,f)}}function Hi(e,a=!1){const i=[e];let r=1/0,l=-1/0,f=1/0,s=-1/0;for(;i.length;){const g=i.pop(),y=g.width/2,b=g.height/2;g.x-y<r&&(r=g.x-y),g.x+y>l&&(l=g.x+y),g.y-b<f&&(f=g.y-b),g.y+b>s&&(s=g.y+b),i.push(...g.children)}if(a)return{root:e,width:l-r+be*2,height:s-f+be*2,vbX:r-be,vbY:f-be,vbW:l-r+be*2,vbH:s-f+be*2};const c=be-f,u=[e];for(;u.length;){const g=u.pop();g.y+=c,u.push(...g.children)}return f+=c,s+=c,{root:e,width:l-r+be*2,height:s+be,vbX:r-be,vbY:0,vbW:l-r+be*2,vbH:s+be}}const Xe=[{id:"default",name:"默认",colors:["#f87171","#fb923c","#fbbf24","#a3e635","#34d399","#22d3ee","#818cf8","#c084fc"]},{id:"classic",name:"经典",colors:["#ef4444","#f59e0b","#10b981","#3b82f6","#6366f1","#8b5cf6","#ec4899","#14b8a6"]},{id:"vivid",name:"活力",colors:["#dc2626","#ea580c","#ca8a04","#16a34a","#0891b2","#2563eb","#7c3aed","#db2777"]},{id:"dev",name:"代码",colors:["#f472b6","#a78bfa","#60a5fa","#38bdf8","#22d3ee","#34d399","#facc15","#fb923c"]},{id:"mint",name:"薄荷",colors:["#5eead4","#67e8f9","#93c5fd","#c4b5fd","#fbcfe8","#fde68a","#a7f3d0","#bae6fd"]}];function Fi(e,a=[]){return[...Xe,...a].find(r=>r.id===e)??Xe[0]}function _e(){return"n_"+Math.random().toString(36).slice(2,10)+Date.now().toString(36).slice(-4)}function Ce(e){return JSON.parse(JSON.stringify(e))}function H(e,a){if(e.id===a)return e;for(const i of e.children){const r=H(i,a);if(r)return r}return null}function we(e,a,i=null){if(e.id===a)return i;for(const r of e.children){const l=we(r,a,e);if(l!==null)return l}return null}function At(e,a){const i=e.children.findIndex(r=>r.id===a);if(i>=0)return e.children.splice(i,1),!0;for(const r of e.children)if(At(r,a))return!0;return!1}function Wi(e,a,i){const r=H(e,a);return!r||r.text===i?!1:(r.text=i,!0)}function Gi(e,a,i,r){if(!we(e,a)||a===i||H(H(e,a),i))return!1;const l=we(e,a),f=l.children.findIndex(g=>g.id===a);if(f<0)return!1;const[s]=l.children.splice(f,1);if(r==="child"){const g=H(e,i);return g?(g.children.push(s),!0):(l.children.splice(f,0,s),!1)}const c=we(e,i);if(!c)return l.children.splice(f,0,s),!1;let u=c.children.findIndex(g=>g.id===i);return u<0?(l.children.splice(f,0,s),!1):(r==="after"&&(u+=1),c.children.splice(u,0,s),!0)}function tn(e){const a=/^新节点(?:\s+(\d+))?$/;let i=0,r=!1;for(const l of e.children){const f=l.text.match(a);if(f)if(f[1]){const s=parseInt(f[1],10);s>i&&(i=s)}else r=!0}return i===0&&!r?ct:i>0?`新节点 ${i+1}`:"新节点 2"}function nn(e,a,i){const r=H(e,a);if(!r)return null;const l={id:_e(),text:i??tn(r),children:[]};return r.children.push(l),l}function on(e,a,i){const r=we(e,a);if(!r)return null;const l=r.children.findIndex(s=>s.id===a);if(l<0)return null;const f={id:_e(),text:i??tn(r),children:[]};return r.children.splice(l+1,0,f),f}function Ki(e,a,i){const r=we(e,a);if(!r)return null;const l=r.children.findIndex(s=>s.id===a);if(l<0)return null;const f={id:_e(),text:i,children:[]};return r.children.splice(l,0,f),f}function Yi(e,a){const i=we(e,a);if(!i)return null;const r=i.children.findIndex(s=>s.id===a);if(r<0)return null;const l=i.children[r],f=Ce(l);return rn(f),i.children.splice(r+1,0,f),f}function rn(e){e.id=_e();for(const a of e.children)rn(a)}const ct="新节点";function Rt(e,a="导入的导图"){const i=e.split(/\r?\n/),r={id:_e(),text:a,children:[]},l=[r],f=[-1/0],s=[],c=/^(#{1,6})\s+(.+?)\s*#*\s*$/,u=/^!\[([^\]]*)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,g=/^\[([^\]]+)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,y=/^(`{3,}|~{3,})\s*(\S+)?\s*$/;let b=!1,k=[],h=null;function m(_){k.push(_)}function L(){if(h&&k.length>0){for(;k.length>0&&k[0].trim()==="";)k.shift();for(;k.length>0&&k[k.length-1].trim()==="";)k.pop();const _=k.join(`
2
- `);_&&(h.note={text:_})}b=!1,k=[]}for(const _ of i){if(b){const I=_.match(y);if(I&&I[1][0]==="`"){L();continue}m(_);continue}const F=_.match(c);if(F){const I=F[1].length,j=F[2].trim();s.push({level:I,text:j,body:""}),h=s[s.length-1];continue}const O=_.match(y);if(O&&O[2]==="note"){b=!0,k=[];continue}const $=_.match(u);if($&&h){const I=$[2],j=160,te=120;h.image={src:I,naturalW:j,naturalH:te,width:j,height:te};continue}const D=_.match(g);if(D&&h){h.link={url:D[2]},h.text=D[1];continue}if(_.trim().length>0&&h){const I=_.trim();h.body=h.body?h.body+`
3
- `+I:I}}b&&L();function K(_){for(;l.length>1;){const D=l.length-1,I=f[D];if(I!==void 0&&I<_.level)break;l.pop(),f.pop()}const F=l[l.length-1],O=_.text,$={id:_e(),text:O,children:[]};_.image&&($.image={..._.image}),_.link&&($.link={url:_.link.url}),_.note&&($.note={text:_.note.text}),_.body&&($.note={text:_.body}),F.children.push($),l.push($),f.push(_.level)}for(const _ of s)K(_);if(s.length>0&&s[0].level===1){const _=r.children[0];_&&(r.text=_.text,r.id=_.id,_.image&&(r.image={..._.image}),_.link&&(r.link={url:_.link.url}),_.note&&(r.note={text:_.note.text}),r.children=_.children)}return r}function dt(e,a=1){let i="#".repeat(a)+" "+(e.text||"")+`
4
- `;e.link&&(i+=`[${e.text||"link"}](${e.link.url})
5
- `),e.image&&(i+=`![image](${e.image.src})
6
- `),e.note&&(i+="```note\n"+e.note.text+"\n```\n"),e.richContent&&(i+=e.richContent.raw+`
7
- `);for(const r of e.children)i+=dt(r,a+1);return i}function Zi(e){var g,y;const a=e.split(/\r?\n/),i=[];let r=0;const l=/^(#{1,6})\s+(.+?)\s*#*\s*$/,f=/^(`{3,}|~{3,})\s*(\S+)?\s*$/,s=/^\s*\|?\s*(:?-+:?\s*\|\s*)+(:?-+:?)(\s*\|)?\s*$/,c=/^(\s*)[-*+]\s+(.*)$/,u=/^(\s*)\d+\.\s+(.*)$/;for(;r<a.length;){const b=a[r],k=b.match(f);if(k){const O=k[1][0],$=k[2]||"",D=[b];for(r++;r<a.length;){const j=a[r].match(f);if(j&&j[1][0]===O){D.push(a[r]),r++;break}D.push(a[r]),r++}const I=D.slice(1,-1).join(`
8
- `).trim();i.push({kind:"code",text:((g=I.split(`
9
- `)[0])==null?void 0:g.slice(0,80))||"(空代码块)",raw:D.join(`
10
- `),lang:$});continue}const h=b.match(l);if(h){i.push({kind:"heading",level:h[1].length,text:h[2].trim(),raw:b}),r++;continue}if(/^\s*\|/.test(b)){const O=[];let $=r,D=!1;for(;$<a.length&&/^\s*\|/.test(a[$]);)O.push(a[$]),s.test(a[$])&&(D=!0),$++;if(D&&O.length>=2){i.push({kind:"table",text:((y=O[0].replace(/^\s*\|/,"").replace(/\|\s*$/,"").split("|")[0])==null?void 0:y.trim())||"表格",raw:O.join(`
11
- `)}),r=$;continue}}const m=b.match(c),L=b.match(u);if(m||L){let O=r;for(;O<a.length;){const $=a[O].match(c),D=a[O].match(u);if(!($||D))break;const I=a[O].replace(/^\s*[-*+]\s+/,"").replace(/^\s*\d+\.\s+/,"").trim();I.length>0&&i.push({kind:"list",text:I.slice(0,80)||"(列表项)",raw:a[O]}),O++}r=O;continue}if(b.trim()===""){r++;continue}const K=[b];let _=r+1;for(;_<a.length;){const O=a[_];if(O.trim()===""||l.test(O)||f.test(O)||c.test(O)||u.test(O)||/^\s*\|/.test(O))break;K.push(O),_++}const F=K.join(" ").trim();i.push({kind:"paragraph",text:F.slice(0,80)||"(空段落)",raw:K.join(`
12
- `)}),r=_}return i}function Xi(e,a="导入的导图"){const i=Zi(e||""),r={id:_e(),text:a,children:[]},l=[r],f=[0];let s=!1;function c(u){if(u.kind==="heading"){const y=u.level;for(;l.length>1&&f[f.length-1]>=y;)l.pop(),f.pop();if(!s&&y===1){s=!0,r.text=u.text,f[0]=1;return}const b={id:_e(),text:u.text,children:[]};l[l.length-1].children.push(b),l.push(b),f.push(y);return}const g={id:_e(),text:u.text,children:[],richContent:{kind:u.kind,raw:u.raw,lang:u.lang}};l[l.length-1].children.push(g)}for(const u of i)c(u);return r}function qi(e){return e.richContent?e.richContent.raw+`
13
- `:""}function ji(e){const a=e.minScale??.2,i=e.maxScale??1/0,r=e.step??1.2,l=t.ref(1),f=t.ref(0),s=t.ref(0),c=t.ref(!1),u=t.reactive({x:0,y:0,ox:0,oy:0}),g=t.ref(!1),y=t.reactive({x:0,y:0}),b=t.reactive({x:0,y:0,width:0,height:0}),k=t.ref(0);let h=null;function m(W){h=W}function L(W){W.preventDefault();const J=e.getContainer();if(!J)return;const le=-W.deltaY*.001,de=Math.min(i,Math.max(a,l.value*(1+le))),re=J.getBoundingClientRect(),fe=W.clientX-re.left,x=W.clientY-re.top,v=(fe-f.value)/l.value,S=(x-s.value)/l.value;l.value=de,f.value=fe-v*de,s.value=x-S*de}function K(){l.value=Math.min(i,l.value*r)}function _(){l.value=Math.max(a,l.value/r)}function F(W){var le;W.target.closest(".zm-node, .zm-toolbar, button, input, textarea")||(c.value=!0,u.x=W.clientX,u.y=W.clientY,u.ox=f.value,u.oy=s.value,window.addEventListener("mousemove",O),window.addEventListener("mouseup",$),(le=W.preventDefault)==null||le.call(W))}function O(W){c.value&&(f.value=u.ox+(W.clientX-u.x),s.value=u.oy+(W.clientY-u.y))}function $(){c.value=!1,window.removeEventListener("mousemove",O),window.removeEventListener("mouseup",$)}function D(W,J){g.value=!0,y.x=W,y.y=J,b.x=W,b.y=J,b.width=0,b.height=0,k.value++,window.addEventListener("mousemove",te),window.addEventListener("mouseup",j)}function I(W,J){if(!g.value)return;const le=Math.min(y.x,W),de=Math.min(y.y,J),re=Math.max(y.x,W),fe=Math.max(y.y,J);b.x=le,b.y=de,b.width=re-le,b.height=fe-de,k.value++}function j(){g.value=!1,window.removeEventListener("mousemove",te),window.removeEventListener("mouseup",j),h&&h()}function te(W){if(!g.value)return;const J=e.getContainer();if(!J)return;const le=J.getBoundingClientRect(),de=(W.clientX-le.left-f.value)/l.value,re=(W.clientY-le.top-s.value)/l.value;I(de,re)}function se(W,J,le,de=60){const re=e.getContainer();if(!re)return;const fe=re.getBoundingClientRect(),x=(fe.width-de*2)/W,v=(fe.height-de*2)/J,S=Math.min(1,Math.max(.3,Math.min(x,v)));l.value=S,f.value=fe.width/2,s.value=fe.height/2-le*S}return{scale:l,offsetX:f,offsetY:s,isPanning:c,onWheel:L,zoomIn:K,zoomOut:_,startPan:F,startMarquee:D,updateMarquee:I,isMarquee:g,marquee:b,marqueeVersion:k,setOnMarqueeEnd:m,resetView:se}}const Ji=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform);function an(e){return Ji?e.metaKey:e.ctrlKey}function Qi(e){function a(){const r=e.getSelectedId();return r||(e.defaultTargetId?e.defaultTargetId():e.getRootId())}function i(r){const l=r.target;if(l&&(l.tagName==="INPUT"||l.tagName==="TEXTAREA"||l.isContentEditable)||e.isReadonly()||e.isEditing())return;const f=e.getSelectedId(),s=a();if(s){if(an(r)&&!r.shiftKey){if(r.key==="d"||r.key==="D"){f&&f!==e.getRootId()&&(r.preventDefault(),e.onDuplicate(f));return}if(r.key==="z"||r.key==="Z"){r.preventDefault(),e.onUndo();return}if(r.key==="y"||r.key==="Y"){r.preventDefault(),e.onRedo();return}if(r.key==="Home"){r.preventDefault(),e.onSelectRoot();return}}if(an(r)&&r.shiftKey&&(r.key==="Z"||r.key==="z")){r.preventDefault(),e.onRedo();return}r.key==="Tab"?(r.preventDefault(),e.onAddChild(s)):r.key==="Enter"?(r.preventDefault(),r.shiftKey?f&&f!==e.getRootId()&&e.onAddSiblingBefore(f):e.onAddSibling(s)):(r.key==="Delete"||r.key==="Backspace")&&f&&f!==e.getRootId()?(r.preventDefault(),e.onRemove(f)):r.key==="F2"&&f?(r.preventDefault(),e.onStartEdit(f)):r.key==="Escape"?(r.preventDefault(),e.onClearSelection()):r.key==="ArrowDown"?(r.preventDefault(),e.onNavigate(0,1)):r.key==="ArrowUp"?(r.preventDefault(),e.onNavigate(0,-1)):r.key==="ArrowRight"?(r.preventDefault(),e.onNavigate(1,0)):r.key==="ArrowLeft"&&(r.preventDefault(),e.onNavigate(-1,0))}}t.onMounted(()=>{window.addEventListener("keydown",i)}),t.onBeforeUnmount(()=>{window.removeEventListener("keydown",i)})}function eo(e=100){const a=t.ref([]);let i=-1;function r(){return i>0}function l(){return i<a.value.length-1}function f(g){const y=JSON.stringify(g);for(i<a.value.length-1&&(a.value=a.value.slice(0,i+1)),a.value.push(y),i=a.value.length-1;a.value.length>e;)a.value.shift(),i--}function s(){return r()?(i--,JSON.parse(a.value[i])):null}function c(){return l()?(i++,JSON.parse(a.value[i])):null}function u(){a.value=[],i=-1}return{canUndo:r,canRedo:l,record:f,undo:s,redo:c,reset:u}}const to=t.defineComponent({__name:"NodeContextMenu",props:{x:{},y:{},container:{},hasImage:{type:Boolean,default:!1},hasLink:{type:Boolean,default:!1},hasNote:{type:Boolean,default:!1},hasCode:{type:Boolean,default:!1},hasTable:{type:Boolean,default:!1}},emits:["pickImage","setLink","removeLink","editNote","removeNote","removeImage","addCode","editCode","removeCode","addTable","editTable","removeTable","close"],setup(e,{emit:a}){const i=e,r=a,l=t.computed(()=>{let k=i.x+2,h=i.y+2;if(i.container){const m=i.container.getBoundingClientRect(),L=180,_=4+(3+(i.hasImage?1:0)+(i.hasLink?1:0)+(i.hasNote?1:0)+1+(i.hasCode?1:0)+1+(i.hasTable?1:0))*28;k+L>m.right&&(k=Math.max(m.left+4,i.x-L-2)),h+_>m.bottom&&(h=Math.max(m.top+4,i.y-_-2)),k<m.left+2&&(k=m.left+2),h<m.top+2&&(h=m.top+2)}return{left:k,top:h}}),f=t.computed(()=>i.hasImage),s=t.computed(()=>i.hasLink),c=t.computed(()=>i.hasNote);function u(k){const h=k.target;h&&h.closest(".zm-node-menu")||r("close")}function g(k){k.key==="Escape"&&r("close")}function y(){r("close")}window.addEventListener("mousedown",u,!0),window.addEventListener("keydown",g,!0),window.addEventListener("wheel",y,!0),window.addEventListener("scroll",y,!0),t.onBeforeUnmount(()=>{window.removeEventListener("mousedown",u,!0),window.removeEventListener("keydown",g,!0),window.removeEventListener("wheel",y,!0),window.removeEventListener("scroll",y,!0)});function b(k){k(),r("close")}return(k,h)=>(t.openBlock(),t.createElementBlock("div",{class:"zm-node-menu",style:t.normalizeStyle({left:l.value.left+"px",top:l.value.top+"px"}),onContextmenu:h[10]||(h[10]=t.withModifiers(()=>{},["prevent"]))},[t.createElementVNode("button",{class:"zm-node-menu-item",onClick:h[0]||(h[0]=t.withModifiers(m=>b(()=>r("pickImage")),["stop"]))},[t.createVNode(ne,{name:"image",size:13}),t.createElementVNode("span",null,t.toDisplayString(f.value?"替换图片":"添加图片"),1)]),f.value?(t.openBlock(),t.createElementBlock("button",{key:0,class:"zm-node-menu-item",onClick:h[1]||(h[1]=t.withModifiers(m=>b(()=>r("removeImage")),["stop"]))},[t.createVNode(ne,{name:"x",size:13}),h[11]||(h[11]=t.createElementVNode("span",null,"移除图片",-1))])):t.createCommentVNode("",!0),t.createElementVNode("button",{class:"zm-node-menu-item",onClick:h[2]||(h[2]=t.withModifiers(m=>b(()=>r("setLink")),["stop"]))},[t.createVNode(ne,{name:"link",size:13}),t.createElementVNode("span",null,t.toDisplayString(s.value?"编辑链接":"添加链接"),1)]),s.value?(t.openBlock(),t.createElementBlock("button",{key:1,class:"zm-node-menu-item",onClick:h[3]||(h[3]=t.withModifiers(m=>b(()=>r("removeLink")),["stop"]))},[t.createVNode(ne,{name:"x",size:13}),h[12]||(h[12]=t.createElementVNode("span",null,"移除链接",-1))])):t.createCommentVNode("",!0),t.createElementVNode("button",{class:"zm-node-menu-item",onClick:h[4]||(h[4]=t.withModifiers(m=>b(()=>r("addCode")),["stop"]))},[h[13]||(h[13]=t.createElementVNode("span",{class:"zm-node-menu-icon zm-node-menu-icon-code","aria-hidden":"true"},"{ }",-1)),t.createElementVNode("span",null,t.toDisplayString(e.hasCode?"编辑代码块":"添加代码块"),1)]),e.hasCode?(t.openBlock(),t.createElementBlock("button",{key:2,class:"zm-node-menu-item",onClick:h[5]||(h[5]=t.withModifiers(m=>b(()=>r("removeCode")),["stop"]))},[t.createVNode(ne,{name:"x",size:13}),h[14]||(h[14]=t.createElementVNode("span",null,"移除代码块",-1))])):t.createCommentVNode("",!0),t.createElementVNode("button",{class:"zm-node-menu-item",onClick:h[6]||(h[6]=t.withModifiers(m=>b(()=>r("addTable")),["stop"]))},[h[15]||(h[15]=t.createElementVNode("span",{class:"zm-node-menu-icon zm-node-menu-icon-table","aria-hidden":"true"},"▦",-1)),t.createElementVNode("span",null,t.toDisplayString(e.hasTable?"编辑表格":"添加表格"),1)]),e.hasTable?(t.openBlock(),t.createElementBlock("button",{key:3,class:"zm-node-menu-item",onClick:h[7]||(h[7]=t.withModifiers(m=>b(()=>r("removeTable")),["stop"]))},[t.createVNode(ne,{name:"x",size:13}),h[16]||(h[16]=t.createElementVNode("span",null,"移除表格",-1))])):t.createCommentVNode("",!0),t.createElementVNode("button",{class:"zm-node-menu-item",onClick:h[8]||(h[8]=t.withModifiers(m=>b(()=>r("editNote")),["stop"]))},[t.createVNode(ne,{name:"note",size:13}),t.createElementVNode("span",null,t.toDisplayString(c.value?"编辑笔记":"添加笔记"),1)]),c.value?(t.openBlock(),t.createElementBlock("button",{key:4,class:"zm-node-menu-item",onClick:h[9]||(h[9]=t.withModifiers(m=>b(()=>r("removeNote")),["stop"]))},[t.createVNode(ne,{name:"x",size:13}),h[17]||(h[17]=t.createElementVNode("span",null,"移除笔记",-1))])):t.createCommentVNode("",!0)],36))}}),no=t.defineComponent({__name:"CanvasContextMenu",props:{x:{},y:{},container:{}},emits:["openSettings","close"],setup(e,{emit:a}){const i=e,r=a,l=t.computed(()=>{let g=i.x+2,y=i.y+2;if(i.container){const b=i.container.getBoundingClientRect(),k=168,h=4+1*28;g+k>b.right&&(g=Math.max(b.left+4,i.x-k-2)),y+h>b.bottom&&(y=Math.max(b.top+4,i.y-h-2)),g<b.left+2&&(g=b.left+2),y<b.top+2&&(y=b.top+2)}return{left:g,top:y}});function f(g){const y=g.target;y&&y.closest(".zm-canvas-menu")||r("close")}function s(g){g.key==="Escape"&&r("close")}function c(){r("close")}window.addEventListener("mousedown",f,!0),window.addEventListener("keydown",s,!0),window.addEventListener("wheel",c,!0),window.addEventListener("scroll",c,!0),t.onBeforeUnmount(()=>{window.removeEventListener("mousedown",f,!0),window.removeEventListener("keydown",s,!0),window.removeEventListener("wheel",c,!0),window.removeEventListener("scroll",c,!0)});function u(g){g(),r("close")}return(g,y)=>(t.openBlock(),t.createElementBlock("div",{class:"zm-canvas-menu",style:t.normalizeStyle({left:l.value.left+"px",top:l.value.top+"px"}),onContextmenu:y[1]||(y[1]=t.withModifiers(()=>{},["prevent"]))},[t.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:y[0]||(y[0]=t.withModifiers(b=>u(()=>r("openSettings")),["stop"]))},[t.createVNode(ne,{name:"settings",size:13}),y[2]||(y[2]=t.createElementVNode("span",null,"设置",-1))])],36))}});function io(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ln(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(a=>{const i=e[a],r=typeof i;(r==="object"||r==="function")&&!Object.isFrozen(i)&&ln(i)}),e}class sn{constructor(a){a.data===void 0&&(a.data={}),this.data=a.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function cn(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function Re(e,...a){const i=Object.create(null);for(const r in e)i[r]=e[r];return a.forEach(function(r){for(const l in r)i[l]=r[l]}),i}const oo="</span>",dn=e=>!!e.scope,ro=(e,{prefix:a})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){const i=e.split(".");return[`${a}${i.shift()}`,...i.map((r,l)=>`${r}${"_".repeat(l+1)}`)].join(" ")}return`${a}${e}`};class ao{constructor(a,i){this.buffer="",this.classPrefix=i.classPrefix,a.walk(this)}addText(a){this.buffer+=cn(a)}openNode(a){if(!dn(a))return;const i=ro(a.scope,{prefix:this.classPrefix});this.span(i)}closeNode(a){dn(a)&&(this.buffer+=oo)}value(){return this.buffer}span(a){this.buffer+=`<span class="${a}">`}}const un=(e={})=>{const a={children:[]};return Object.assign(a,e),a};class Ot{constructor(){this.rootNode=un(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(a){this.top.children.push(a)}openNode(a){const i=un({scope:a});this.add(i),this.stack.push(i)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(a){return this.constructor._walk(a,this.rootNode)}static _walk(a,i){return typeof i=="string"?a.addText(i):i.children&&(a.openNode(i),i.children.forEach(r=>this._walk(a,r)),a.closeNode(i)),a}static _collapse(a){typeof a!="string"&&a.children&&(a.children.every(i=>typeof i=="string")?a.children=[a.children.join("")]:a.children.forEach(i=>{Ot._collapse(i)}))}}class lo extends Ot{constructor(a){super(),this.options=a}addText(a){a!==""&&this.add(a)}startScope(a){this.openNode(a)}endScope(){this.closeNode()}__addSublanguage(a,i){const r=a.root;i&&(r.scope=`language:${i}`),this.add(r)}toHTML(){return new ao(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function qe(e){return e?typeof e=="string"?e:e.source:null}function fn(e){return Be("(?=",e,")")}function so(e){return Be("(?:",e,")*")}function co(e){return Be("(?:",e,")?")}function Be(...e){return e.map(i=>qe(i)).join("")}function uo(e){const a=e[e.length-1];return typeof a=="object"&&a.constructor===Object?(e.splice(e.length-1,1),a):{}}function It(...e){return"("+(uo(e).capture?"":"?:")+e.map(r=>qe(r)).join("|")+")"}function gn(e){return new RegExp(e.toString()+"|").exec("").length-1}function fo(e,a){const i=e&&e.exec(a);return i&&i.index===0}const go=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Bt(e,{joinWith:a}){let i=0;return e.map(r=>{i+=1;const l=i;let f=qe(r),s="";for(;f.length>0;){const c=go.exec(f);if(!c){s+=f;break}s+=f.substring(0,c.index),f=f.substring(c.index+c[0].length),c[0][0]==="\\"&&c[1]?s+="\\"+String(Number(c[1])+l):(s+=c[0],c[0]==="("&&i++)}return s}).map(r=>`(${r})`).join(a)}const mo=/\b\B/,mn="[a-zA-Z]\\w*",Lt="[a-zA-Z_]\\w*",pn="\\b\\d+(\\.\\d+)?",hn="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",bn="\\b(0b[01]+)",po="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",ho=(e={})=>{const a=/^#![ ]*\//;return e.binary&&(e.begin=Be(a,/.*\b/,e.binary,/\b.*/)),Re({scope:"meta",begin:a,end:/$/,relevance:0,"on:begin":(i,r)=>{i.index!==0&&r.ignoreMatch()}},e)},je={begin:"\\\\[\\s\\S]",relevance:0},bo={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[je]},yo={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[je]},Eo={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},ut=function(e,a,i={}){const r=Re({scope:"comment",begin:e,end:a,contains:[]},i);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const l=It("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:Be(/[ ]+/,"(",l,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},xo=ut("//","$"),ko=ut("/\\*","\\*/"),wo=ut("#","$"),No={scope:"number",begin:pn,relevance:0},_o={scope:"number",begin:hn,relevance:0},So={scope:"number",begin:bn,relevance:0},Mo={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[je,{begin:/\[/,end:/\]/,relevance:0,contains:[je]}]},vo={scope:"title",begin:mn,relevance:0},Co={scope:"title",begin:Lt,relevance:0},To={begin:"\\.\\s*"+Lt,relevance:0};var ft=Object.freeze({__proto__:null,APOS_STRING_MODE:bo,BACKSLASH_ESCAPE:je,BINARY_NUMBER_MODE:So,BINARY_NUMBER_RE:bn,COMMENT:ut,C_BLOCK_COMMENT_MODE:ko,C_LINE_COMMENT_MODE:xo,C_NUMBER_MODE:_o,C_NUMBER_RE:hn,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(a,i)=>{i.data._beginMatch=a[1]},"on:end":(a,i)=>{i.data._beginMatch!==a[1]&&i.ignoreMatch()}})},HASH_COMMENT_MODE:wo,IDENT_RE:mn,MATCH_NOTHING_RE:mo,METHOD_GUARD:To,NUMBER_MODE:No,NUMBER_RE:pn,PHRASAL_WORDS_MODE:Eo,QUOTE_STRING_MODE:yo,REGEXP_MODE:Mo,RE_STARTERS_RE:po,SHEBANG:ho,TITLE_MODE:vo,UNDERSCORE_IDENT_RE:Lt,UNDERSCORE_TITLE_MODE:Co});function Ao(e,a){e.input[e.index-1]==="."&&a.ignoreMatch()}function Ro(e,a){e.className!==void 0&&(e.scope=e.className,delete e.className)}function Oo(e,a){a&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=Ao,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function Io(e,a){Array.isArray(e.illegal)&&(e.illegal=It(...e.illegal))}function Bo(e,a){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function Lo(e,a){e.relevance===void 0&&(e.relevance=1)}const Do=(e,a)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const i=Object.assign({},e);Object.keys(e).forEach(r=>{delete e[r]}),e.keywords=i.keywords,e.begin=Be(i.beforeMatch,fn(i.begin)),e.starts={relevance:0,contains:[Object.assign(i,{endsParent:!0})]},e.relevance=0,delete i.beforeMatch},zo=["of","and","for","in","not","or","if","then","parent","list","value"],$o="keyword";function yn(e,a,i=$o){const r=Object.create(null);return typeof e=="string"?l(i,e.split(" ")):Array.isArray(e)?l(i,e):Object.keys(e).forEach(function(f){Object.assign(r,yn(e[f],a,f))}),r;function l(f,s){a&&(s=s.map(c=>c.toLowerCase())),s.forEach(function(c){const u=c.split("|");r[u[0]]=[f,Po(u[0],u[1])]})}}function Po(e,a){return a?Number(a):Uo(e)?0:1}function Uo(e){return zo.includes(e.toLowerCase())}const En={},Le=e=>{console.error(e)},xn=(e,...a)=>{console.log(`WARN: ${e}`,...a)},He=(e,a)=>{En[`${e}/${a}`]||(console.log(`Deprecated as of ${e}. ${a}`),En[`${e}/${a}`]=!0)},gt=new Error;function kn(e,a,{key:i}){let r=0;const l=e[i],f={},s={};for(let c=1;c<=a.length;c++)s[c+r]=l[c],f[c+r]=!0,r+=gn(a[c-1]);e[i]=s,e[i]._emit=f,e[i]._multi=!0}function Vo(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw Le("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),gt;if(typeof e.beginScope!="object"||e.beginScope===null)throw Le("beginScope must be object"),gt;kn(e,e.begin,{key:"beginScope"}),e.begin=Bt(e.begin,{joinWith:""})}}function Ho(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw Le("skip, excludeEnd, returnEnd not compatible with endScope: {}"),gt;if(typeof e.endScope!="object"||e.endScope===null)throw Le("endScope must be object"),gt;kn(e,e.end,{key:"endScope"}),e.end=Bt(e.end,{joinWith:""})}}function Fo(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function Wo(e){Fo(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),Vo(e),Ho(e)}function Go(e){function a(s,c){return new RegExp(qe(s),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(c?"g":""))}class i{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(c,u){u.position=this.position++,this.matchIndexes[this.matchAt]=u,this.regexes.push([u,c]),this.matchAt+=gn(c)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const c=this.regexes.map(u=>u[1]);this.matcherRe=a(Bt(c,{joinWith:"|"}),!0),this.lastIndex=0}exec(c){this.matcherRe.lastIndex=this.lastIndex;const u=this.matcherRe.exec(c);if(!u)return null;const g=u.findIndex((b,k)=>k>0&&b!==void 0),y=this.matchIndexes[g];return u.splice(0,g),Object.assign(u,y)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(c){if(this.multiRegexes[c])return this.multiRegexes[c];const u=new i;return this.rules.slice(c).forEach(([g,y])=>u.addRule(g,y)),u.compile(),this.multiRegexes[c]=u,u}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(c,u){this.rules.push([c,u]),u.type==="begin"&&this.count++}exec(c){const u=this.getMatcher(this.regexIndex);u.lastIndex=this.lastIndex;let g=u.exec(c);if(this.resumingScanAtSamePosition()&&!(g&&g.index===this.lastIndex)){const y=this.getMatcher(0);y.lastIndex=this.lastIndex+1,g=y.exec(c)}return g&&(this.regexIndex+=g.position+1,this.regexIndex===this.count&&this.considerAll()),g}}function l(s){const c=new r;return s.contains.forEach(u=>c.addRule(u.begin,{rule:u,type:"begin"})),s.terminatorEnd&&c.addRule(s.terminatorEnd,{type:"end"}),s.illegal&&c.addRule(s.illegal,{type:"illegal"}),c}function f(s,c){const u=s;if(s.isCompiled)return u;[Ro,Bo,Wo,Do].forEach(y=>y(s,c)),e.compilerExtensions.forEach(y=>y(s,c)),s.__beforeBegin=null,[Oo,Io,Lo].forEach(y=>y(s,c)),s.isCompiled=!0;let g=null;return typeof s.keywords=="object"&&s.keywords.$pattern&&(s.keywords=Object.assign({},s.keywords),g=s.keywords.$pattern,delete s.keywords.$pattern),g=g||/\w+/,s.keywords&&(s.keywords=yn(s.keywords,e.case_insensitive)),u.keywordPatternRe=a(g,!0),c&&(s.begin||(s.begin=/\B|\b/),u.beginRe=a(u.begin),!s.end&&!s.endsWithParent&&(s.end=/\B|\b/),s.end&&(u.endRe=a(u.end)),u.terminatorEnd=qe(u.end)||"",s.endsWithParent&&c.terminatorEnd&&(u.terminatorEnd+=(s.end?"|":"")+c.terminatorEnd)),s.illegal&&(u.illegalRe=a(s.illegal)),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map(function(y){return Ko(y==="self"?s:y)})),s.contains.forEach(function(y){f(y,u)}),s.starts&&f(s.starts,c),u.matcher=l(u),u}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=Re(e.classNameAliases||{}),f(e)}function wn(e){return e?e.endsWithParent||wn(e.starts):!1}function Ko(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(a){return Re(e,{variants:null},a)})),e.cachedVariants?e.cachedVariants:wn(e)?Re(e,{starts:e.starts?Re(e.starts):null}):Object.isFrozen(e)?Re(e):e}var Yo="11.11.1";class Zo extends Error{constructor(a,i){super(a),this.name="HTMLInjectionError",this.html=i}}const Dt=cn,Nn=Re,_n=Symbol("nomatch"),Xo=7,Sn=function(e){const a=Object.create(null),i=Object.create(null),r=[];let l=!0;const f="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]};let c={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:lo};function u(x){return c.noHighlightRe.test(x)}function g(x){let v=x.className+" ";v+=x.parentNode?x.parentNode.className:"";const S=c.languageDetectRe.exec(v);if(S){const C=te(S[1]);return C||(xn(f.replace("{}",S[1])),xn("Falling back to no-highlight mode for this block.",x)),C?S[1]:"no-highlight"}return v.split(/\s+/).find(C=>u(C)||te(C))}function y(x,v,S){let C="",V="";typeof v=="object"?(C=x,S=v.ignoreIllegals,V=v.language):(He("10.7.0","highlight(lang, code, ...args) has been deprecated."),He("10.7.0",`Please use highlight(code, options) instead.
14
- https://github.com/highlightjs/highlight.js/issues/2277`),V=x,C=v),S===void 0&&(S=!0);const oe={code:C,language:V};re("before:highlight",oe);const ge=oe.result?oe.result:b(oe.language,oe.code,S);return ge.code=oe.code,re("after:highlight",ge),ge}function b(x,v,S,C){const V=Object.create(null);function oe(M,A){return M.keywords[A]}function ge(){if(!B.keywords){ue.addText(Q);return}let M=0;B.keywordPatternRe.lastIndex=0;let A=B.keywordPatternRe.exec(Q),P="";for(;A;){P+=Q.substring(M,A.index);const Y=xe.case_insensitive?A[0].toLowerCase():A[0],ie=oe(B,Y);if(ie){const[ee,X]=ie;if(ue.addText(P),P="",V[Y]=(V[Y]||0)+1,V[Y]<=Xo&&(ze+=X),ee.startsWith("_"))P+=A[0];else{const Ft=xe.classNameAliases[ee]||ee;Ee(A[0],Ft)}}else P+=A[0];M=B.keywordPatternRe.lastIndex,A=B.keywordPatternRe.exec(Q)}P+=Q.substring(M),ue.addText(P)}function ye(){if(Q==="")return;let M=null;if(typeof B.subLanguage=="string"){if(!a[B.subLanguage]){ue.addText(Q);return}M=b(B.subLanguage,Q,!0,Ie[B.subLanguage]),Ie[B.subLanguage]=M._top}else M=h(Q,B.subLanguage.length?B.subLanguage:null);B.relevance>0&&(ze+=M.relevance),ue.__addSublanguage(M._emitter,M.language)}function me(){B.subLanguage!=null?ye():ge(),Q=""}function Ee(M,A){M!==""&&(ue.startScope(A),ue.addText(M),ue.endScope())}function bt(M,A){let P=1;const Y=A.length-1;for(;P<=Y;){if(!M._emit[P]){P++;continue}const ie=xe.classNameAliases[M[P]]||M[P],ee=A[P];ie?Ee(ee,ie):(Q=ee,ge(),Q=""),P++}}function yt(M,A){return M.scope&&typeof M.scope=="string"&&ue.openNode(xe.classNameAliases[M.scope]||M.scope),M.beginScope&&(M.beginScope._wrap?(Ee(Q,xe.classNameAliases[M.beginScope._wrap]||M.beginScope._wrap),Q=""):M.beginScope._multi&&(bt(M.beginScope,A),Q="")),B=Object.create(M,{parent:{value:B}}),B}function Et(M,A,P){let Y=fo(M.endRe,P);if(Y){if(M["on:end"]){const ie=new sn(M);M["on:end"](A,ie),ie.isMatchIgnored&&(Y=!1)}if(Y){for(;M.endsParent&&M.parent;)M=M.parent;return M}}if(M.endsWithParent)return Et(M.parent,A,P)}function Ut(M){return B.matcher.regexIndex===0?(Q+=M[0],1):(Pe=!0,0)}function Vt(M){const A=M[0],P=M.rule,Y=new sn(P),ie=[P.__beforeBegin,P["on:begin"]];for(const ee of ie)if(ee&&(ee(M,Y),Y.isMatchIgnored))return Ut(A);return P.skip?Q+=A:(P.excludeBegin&&(Q+=A),me(),!P.returnBegin&&!P.excludeBegin&&(Q=A)),yt(P,M),P.returnBegin?0:A.length}function Ht(M){const A=M[0],P=v.substring(M.index),Y=Et(B,M,P);if(!Y)return _n;const ie=B;B.endScope&&B.endScope._wrap?(me(),Ee(A,B.endScope._wrap)):B.endScope&&B.endScope._multi?(me(),bt(B.endScope,M)):ie.skip?Q+=A:(ie.returnEnd||ie.excludeEnd||(Q+=A),me(),ie.excludeEnd&&(Q=A));do B.scope&&ue.closeNode(),!B.skip&&!B.subLanguage&&(ze+=B.relevance),B=B.parent;while(B!==Y.parent);return Y.starts&&yt(Y.starts,M),ie.returnEnd?0:A.length}function xt(){const M=[];for(let A=B;A!==xe;A=A.parent)A.scope&&M.unshift(A.scope);M.forEach(A=>ue.openNode(A))}let Ke={};function Je(M,A){const P=A&&A[0];if(Q+=M,P==null)return me(),0;if(Ke.type==="begin"&&A.type==="end"&&Ke.index===A.index&&P===""){if(Q+=v.slice(A.index,A.index+1),!l){const Y=new Error(`0 width match regex (${x})`);throw Y.languageName=x,Y.badRule=Ke.rule,Y}return 1}if(Ke=A,A.type==="begin")return Vt(A);if(A.type==="illegal"&&!S){const Y=new Error('Illegal lexeme "'+P+'" for mode "'+(B.scope||"<unnamed>")+'"');throw Y.mode=B,Y}else if(A.type==="end"){const Y=Ht(A);if(Y!==_n)return Y}if(A.type==="illegal"&&P==="")return Q+=`
15
- `,1;if($e>1e5&&$e>A.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Q+=P,P.length}const xe=te(x);if(!xe)throw Le(f.replace("{}",x)),new Error('Unknown language: "'+x+'"');const kt=Go(xe);let Qe="",B=C||kt;const Ie={},ue=new c.__emitter(c);xt();let Q="",ze=0,Se=0,$e=0,Pe=!1;try{if(xe.__emitTokens)xe.__emitTokens(v,ue);else{for(B.matcher.considerAll();;){$e++,Pe?Pe=!1:B.matcher.considerAll(),B.matcher.lastIndex=Se;const M=B.matcher.exec(v);if(!M)break;const A=v.substring(Se,M.index),P=Je(A,M);Se=M.index+P}Je(v.substring(Se))}return ue.finalize(),Qe=ue.toHTML(),{language:x,value:Qe,relevance:ze,illegal:!1,_emitter:ue,_top:B}}catch(M){if(M.message&&M.message.includes("Illegal"))return{language:x,value:Dt(v),illegal:!0,relevance:0,_illegalBy:{message:M.message,index:Se,context:v.slice(Se-100,Se+100),mode:M.mode,resultSoFar:Qe},_emitter:ue};if(l)return{language:x,value:Dt(v),illegal:!1,relevance:0,errorRaised:M,_emitter:ue,_top:B};throw M}}function k(x){const v={value:Dt(x),illegal:!1,relevance:0,_top:s,_emitter:new c.__emitter(c)};return v._emitter.addText(x),v}function h(x,v){v=v||c.languages||Object.keys(a);const S=k(x),C=v.filter(te).filter(W).map(me=>b(me,x,!1));C.unshift(S);const V=C.sort((me,Ee)=>{if(me.relevance!==Ee.relevance)return Ee.relevance-me.relevance;if(me.language&&Ee.language){if(te(me.language).supersetOf===Ee.language)return 1;if(te(Ee.language).supersetOf===me.language)return-1}return 0}),[oe,ge]=V,ye=oe;return ye.secondBest=ge,ye}function m(x,v,S){const C=v&&i[v]||S;x.classList.add("hljs"),x.classList.add(`language-${C}`)}function L(x){let v=null;const S=g(x);if(u(S))return;if(re("before:highlightElement",{el:x,language:S}),x.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",x);return}if(x.children.length>0&&(c.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(x)),c.throwUnescapedHTML))throw new Zo("One of your code blocks includes unescaped HTML.",x.innerHTML);v=x;const C=v.textContent,V=S?y(C,{language:S,ignoreIllegals:!0}):h(C);x.innerHTML=V.value,x.dataset.highlighted="yes",m(x,S,V.language),x.result={language:V.language,re:V.relevance,relevance:V.relevance},V.secondBest&&(x.secondBest={language:V.secondBest.language,relevance:V.secondBest.relevance}),re("after:highlightElement",{el:x,result:V,text:C})}function K(x){c=Nn(c,x)}const _=()=>{$(),He("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function F(){$(),He("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let O=!1;function $(){function x(){$()}if(document.readyState==="loading"){O||window.addEventListener("DOMContentLoaded",x,!1),O=!0;return}document.querySelectorAll(c.cssSelector).forEach(L)}function D(x,v){let S=null;try{S=v(e)}catch(C){if(Le("Language definition for '{}' could not be registered.".replace("{}",x)),l)Le(C);else throw C;S=s}S.name||(S.name=x),a[x]=S,S.rawDefinition=v.bind(null,e),S.aliases&&se(S.aliases,{languageName:x})}function I(x){delete a[x];for(const v of Object.keys(i))i[v]===x&&delete i[v]}function j(){return Object.keys(a)}function te(x){return x=(x||"").toLowerCase(),a[x]||a[i[x]]}function se(x,{languageName:v}){typeof x=="string"&&(x=[x]),x.forEach(S=>{i[S.toLowerCase()]=v})}function W(x){const v=te(x);return v&&!v.disableAutodetect}function J(x){x["before:highlightBlock"]&&!x["before:highlightElement"]&&(x["before:highlightElement"]=v=>{x["before:highlightBlock"](Object.assign({block:v.el},v))}),x["after:highlightBlock"]&&!x["after:highlightElement"]&&(x["after:highlightElement"]=v=>{x["after:highlightBlock"](Object.assign({block:v.el},v))})}function le(x){J(x),r.push(x)}function de(x){const v=r.indexOf(x);v!==-1&&r.splice(v,1)}function re(x,v){const S=x;r.forEach(function(C){C[S]&&C[S](v)})}function fe(x){return He("10.7.0","highlightBlock will be removed entirely in v12.0"),He("10.7.0","Please use highlightElement now."),L(x)}Object.assign(e,{highlight:y,highlightAuto:h,highlightAll:$,highlightElement:L,highlightBlock:fe,configure:K,initHighlighting:_,initHighlightingOnLoad:F,registerLanguage:D,unregisterLanguage:I,listLanguages:j,getLanguage:te,registerAliases:se,autoDetection:W,inherit:Nn,addPlugin:le,removePlugin:de}),e.debugMode=function(){l=!1},e.safeMode=function(){l=!0},e.versionString=Yo,e.regex={concat:Be,lookahead:fn,either:It,optional:co,anyNumberOfTimes:so};for(const x in ft)typeof ft[x]=="object"&&ln(ft[x]);return Object.assign(e,ft),e},Fe=Sn({});Fe.newInstance=()=>Sn({});var qo=Fe;Fe.HighlightJS=Fe,Fe.default=Fe;const zt=io(qo);function $t(e){const a=e.regex,i={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[i]}]};Object.assign(i,{className:"variable",variants:[{begin:a.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const l={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},f=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),s={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},c={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,i,l]};l.contains.push(c);const u={match:/\\"/},g={className:"string",begin:/'/,end:/'/},y={match:/\\'/},b={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,i]},k=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],h=e.SHEBANG({binary:`(${k.join("|")})`,relevance:10}),m={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},L=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],K=["true","false"],_={match:/(\/[a-z._-]+)+/},F=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],O=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],$=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],D=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:L,literal:K,built_in:[...F,...O,"set","shopt",...$,...D]},contains:[h,e.SHEBANG(),m,b,f,s,_,c,u,g,y,i]}}const jo=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),Jo=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],Qo=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],er=[...Jo,...Qo],tr=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),nr=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),ir=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),or=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function rr(e){const a=e.regex,i=jo(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},l="and or not only",f=/@-?\w[\w]*(-\w+)*/,s="[a-zA-Z-][a-zA-Z0-9_-]*",c=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[i.BLOCK_COMMENT,r,i.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+s,relevance:0},i.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+nr.join("|")+")"},{begin:":(:)?("+ir.join("|")+")"}]},i.CSS_VARIABLE,{className:"attribute",begin:"\\b("+or.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[i.BLOCK_COMMENT,i.HEXCOLOR,i.IMPORTANT,i.CSS_NUMBER_MODE,...c,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...c,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},i.FUNCTION_DISPATCH]},{begin:a.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:f},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:l,attribute:tr.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...c,i.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+er.join("|")+")\\b"}]}}function Mn(e){const f={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:f,illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"string",variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[e.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:f,illegal:/["']/}]}]}}var We="[0-9](_*[0-9])*",mt=`\\.(${We})`,pt="[0-9a-fA-F](_*[0-9a-fA-F])*",vn={className:"number",variants:[{begin:`(\\b(${We})((${mt})|\\.)?|(${mt}))[eE][+-]?(${We})[fFdD]?\\b`},{begin:`\\b(${We})((${mt})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${mt})[fFdD]?\\b`},{begin:`\\b(${We})[fFdD]\\b`},{begin:`\\b0[xX]((${pt})\\.?|(${pt})?\\.(${pt}))[pP][+-]?(${We})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${pt})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Cn(e,a,i){return i===-1?"":e.replace(a,r=>Cn(e,a,i-1))}function ar(e){const a=e.regex,i="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=i+Cn("(?:<"+i+"~~~(?:\\s*,\\s*"+i+"~~~)*>)?",/~~~/g,2),u={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},g={className:"meta",begin:"@"+i,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},y={className:"params",begin:/\(/,end:/\)/,keywords:u,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:u,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,i],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[a.concat(/(?!else)/,i),/\s+/,i,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,i],className:{1:"keyword",3:"title.class"},contains:[y,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:u,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:u,relevance:0,contains:[g,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,vn,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},vn,g]}}const Tn="[A-Za-z$_][0-9A-Za-z$_]*",lr=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],sr=["true","false","null","undefined","NaN","Infinity"],An=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Rn=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],On=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],cr=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],dr=[].concat(On,An,Rn);function In(e){const a=e.regex,i=(S,{after:C})=>{const V="</"+S[0].slice(1);return S.input.indexOf(V,C)!==-1},r=Tn,l={begin:"<>",end:"</>"},f=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(S,C)=>{const V=S[0].length+S.index,oe=S.input[V];if(oe==="<"||oe===","){C.ignoreMatch();return}oe===">"&&(i(S,{after:V})||C.ignoreMatch());let ge;const ye=S.input.substring(V);if(ge=ye.match(/^\s*=/)){C.ignoreMatch();return}if((ge=ye.match(/^\s+extends\s+/))&&ge.index===0){C.ignoreMatch();return}}},c={$pattern:Tn,keyword:lr,literal:sr,built_in:dr,"variable.language":cr},u="[0-9](_?[0-9])*",g=`\\.(${u})`,y="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",b={className:"number",variants:[{begin:`(\\b(${y})((${g})|\\.)?|(${g}))[eE][+-]?(${u})\\b`},{begin:`\\b(${y})\\b((${g})\\b|\\.)?|(${g})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},k={className:"subst",begin:"\\$\\{",end:"\\}",keywords:c,contains:[]},h={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,k],subLanguage:"xml"}},m={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,k],subLanguage:"css"}},L={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,k],subLanguage:"graphql"}},K={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,k]},F={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},O=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,m,L,K,{match:/\$\d+/},b];k.contains=O.concat({begin:/\{/,end:/\}/,keywords:c,contains:["self"].concat(O)});const $=[].concat(F,k.contains),D=$.concat([{begin:/(\s*)\(/,end:/\)/,keywords:c,contains:["self"].concat($)}]),I={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:D},j={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,a.concat(r,"(",a.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},te={relevance:0,match:a.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...An,...Rn]}},se={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},W={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[I],illegal:/%/},J={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function le(S){return a.concat("(?!",S.join("|"),")")}const de={match:a.concat(/\b/,le([...On,"super","import"].map(S=>`${S}\\s*\\(`)),r,a.lookahead(/\s*\(/)),className:"title.function",relevance:0},re={begin:a.concat(/\./,a.lookahead(a.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},fe={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},I]},x="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",v={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,a.lookahead(x)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[I]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:c,exports:{PARAMS_CONTAINS:D,CLASS_REFERENCE:te},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),se,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,m,L,K,F,{match:/\$\d+/},b,te,{scope:"attr",match:r+a.lookahead(":"),relevance:0},v,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[F,e.REGEXP_MODE,{className:"function",begin:x,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:D}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:l.begin,end:l.end},{match:f},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},W,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[I,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},re,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[I]},de,J,j,fe,{match:/\$[(.]/}]}}function ur(e){const a={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},i={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],l={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[a,i,e.QUOTE_STRING_MODE,l,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function Bn(e){const a=e.regex,i={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},l={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},f={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},s={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},c=/[A-Za-z][A-Za-z0-9+.-]*/,u={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:a.concat(/\[.+?\]\(/,c,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},g={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},y={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},b=e.inherit(g,{contains:[]}),k=e.inherit(y,{contains:[]});g.contains.push(k),y.contains.push(b);let h=[i,u];return[g,y,b,k].forEach(_=>{_.contains=_.contains.concat(h)}),h=h.concat(g,y),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:h},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:h}]}]},i,f,g,y,{className:"quote",begin:"^>\\s+",contains:h,end:"$"},l,r,u,s,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function Ln(e){const a=e.regex,i=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],c={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},u={className:"meta",begin:/^(>>>|\.\.\.) /},g={className:"subst",begin:/\{/,end:/\}/,keywords:c,illegal:/#/},y={begin:/\{\{/,relevance:0},b={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,u,y,g]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,u,y,g]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,y,g]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,y,g]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},k="[0-9](_?[0-9])*",h=`(\\b(${k}))?\\.(${k})|\\b(${k})\\.`,m=`\\b|${r.join("|")}`,L={className:"number",relevance:0,variants:[{begin:`(\\b(${k})|(${h}))[eE][+-]?(${k})[jJ]?(?=${m})`},{begin:`(${h})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${m})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${m})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${m})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${m})`},{begin:`\\b(${k})[jJ](?=${m})`}]},K={className:"comment",begin:a.lookahead(/# type:/),end:/$/,keywords:c,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},_={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:["self",u,L,b,e.HASH_COMMENT_MODE]}]};return g.contains=[b,L,u],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:c,illegal:/(<\/|\?)|=>/,contains:[u,L,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},b,K,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,i],scope:{1:"keyword",3:"title.function"},contains:[_]},{variants:[{match:[/\bclass/,/\s+/,i,/\s*/,/\(\s*/,i,/\s*\)/]},{match:[/\bclass/,/\s+/,i]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[L,_,b]}]}}function Dn(e){const a=e.regex,i=/(r#)?/,r=a.concat(i,e.UNDERSCORE_IDENT_RE),l=a.concat(i,e.IDENT_RE),f={className:"title.function.invoke",relevance:0,begin:a.concat(/\b/,/(?!let|for|while|if|else|match\b)/,l,a.lookahead(/\s*\(/))},s="([ui](8|16|32|64|128|size)|f(32|64))?",c=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],u=["true","false","Some","None","Ok","Err"],g=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],y=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:y,keyword:c,literal:u,built_in:g},illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{contains:["self"]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+s},{begin:"\\b0o([0-7_]+)"+s},{begin:"\\b0x([A-Fa-f0-9_]+)"+s},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+s}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,r,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:g,type:y}},{className:"punctuation",begin:"->"},f]}}function fr(e){const a=e.regex,i=e.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},l={begin:/"/,end:/"/,contains:[{match:/""/}]},f=["true","false","unknown"],s=["double precision","large object","with timezone","without timezone"],c=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],u=["add","asc","collation","desc","final","first","last","view"],g=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],y=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],b=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],k=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],h=y,m=[...g,...u].filter(D=>!y.includes(D)),L={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},K={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},_={match:a.concat(/\b/,a.either(...h),/\s*\(/),relevance:0,keywords:{built_in:h}};function F(D){return a.concat(/\b/,a.either(...D.map(I=>I.replace(/\s+/,"\\s+"))),/\b/)}const O={scope:"keyword",match:F(k),relevance:0};function $(D,{exceptions:I,when:j}={}){const te=j;return I=I||[],D.map(se=>se.match(/\|\d+$/)||I.includes(se)?se:te(se)?`${se}|0`:se)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:$(m,{when:D=>D.length<3}),literal:f,type:c,built_in:b},contains:[{scope:"type",match:F(s)},O,_,L,r,l,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,i,K]}}const ht="[A-Za-z$_][0-9A-Za-z$_]*",zn=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],$n=["true","false","null","undefined","NaN","Infinity"],Pn=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Un=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Vn=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Hn=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Fn=[].concat(Vn,Pn,Un);function gr(e){const a=e.regex,i=(S,{after:C})=>{const V="</"+S[0].slice(1);return S.input.indexOf(V,C)!==-1},r=ht,l={begin:"<>",end:"</>"},f=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(S,C)=>{const V=S[0].length+S.index,oe=S.input[V];if(oe==="<"||oe===","){C.ignoreMatch();return}oe===">"&&(i(S,{after:V})||C.ignoreMatch());let ge;const ye=S.input.substring(V);if(ge=ye.match(/^\s*=/)){C.ignoreMatch();return}if((ge=ye.match(/^\s+extends\s+/))&&ge.index===0){C.ignoreMatch();return}}},c={$pattern:ht,keyword:zn,literal:$n,built_in:Fn,"variable.language":Hn},u="[0-9](_?[0-9])*",g=`\\.(${u})`,y="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",b={className:"number",variants:[{begin:`(\\b(${y})((${g})|\\.)?|(${g}))[eE][+-]?(${u})\\b`},{begin:`\\b(${y})\\b((${g})\\b|\\.)?|(${g})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},k={className:"subst",begin:"\\$\\{",end:"\\}",keywords:c,contains:[]},h={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,k],subLanguage:"xml"}},m={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,k],subLanguage:"css"}},L={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,k],subLanguage:"graphql"}},K={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,k]},F={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},O=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,m,L,K,{match:/\$\d+/},b];k.contains=O.concat({begin:/\{/,end:/\}/,keywords:c,contains:["self"].concat(O)});const $=[].concat(F,k.contains),D=$.concat([{begin:/(\s*)\(/,end:/\)/,keywords:c,contains:["self"].concat($)}]),I={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:D},j={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,a.concat(r,"(",a.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},te={relevance:0,match:a.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Pn,...Un]}},se={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},W={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[I],illegal:/%/},J={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function le(S){return a.concat("(?!",S.join("|"),")")}const de={match:a.concat(/\b/,le([...Vn,"super","import"].map(S=>`${S}\\s*\\(`)),r,a.lookahead(/\s*\(/)),className:"title.function",relevance:0},re={begin:a.concat(/\./,a.lookahead(a.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},fe={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},I]},x="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",v={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,a.lookahead(x)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[I]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:c,exports:{PARAMS_CONTAINS:D,CLASS_REFERENCE:te},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),se,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,m,L,K,F,{match:/\$\d+/},b,te,{scope:"attr",match:r+a.lookahead(":"),relevance:0},v,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[F,e.REGEXP_MODE,{className:"function",begin:x,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:D}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:l.begin,end:l.end},{match:f},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},W,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[I,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},re,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[I]},de,J,j,fe,{match:/\$[(.]/}]}}function Wn(e){const a=e.regex,i=gr(e),r=ht,l=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],f={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},s={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:l},contains:[i.exports.CLASS_REFERENCE]},c={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},u=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],g={$pattern:ht,keyword:zn.concat(u),literal:$n,built_in:Fn.concat(l),"variable.language":Hn},y={className:"meta",begin:"@"+r},b=(L,K,_)=>{const F=L.contains.findIndex(O=>O.label===K);if(F===-1)throw new Error("can not find mode to replace");L.contains.splice(F,1,_)};Object.assign(i.keywords,g),i.exports.PARAMS_CONTAINS.push(y);const k=i.contains.find(L=>L.scope==="attr"),h=Object.assign({},k,{match:a.concat(r,a.lookahead(/\s*\?:/))});i.exports.PARAMS_CONTAINS.push([i.exports.CLASS_REFERENCE,k,h]),i.contains=i.contains.concat([y,f,s,h]),b(i,"shebang",e.SHEBANG()),b(i,"use_strict",c);const m=i.contains.find(L=>L.label==="func.def");return m.relevance=0,Object.assign(i,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),i}function Gn(e){const a=e.regex,i=a.concat(/[\p{L}_]/u,a.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,l={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},f={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},s=e.inherit(f,{begin:/\(/,end:/\)/}),c=e.inherit(e.APOS_STRING_MODE,{className:"string"}),u=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),g={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[l]},{begin:/'/,end:/'/,contains:[l]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[f,u,c,s,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[f,s,u,c]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},l,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[u]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[g],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[g],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:a.concat(/</,a.lookahead(a.concat(i,a.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:i,relevance:0,starts:g}]},{className:"tag",begin:a.concat(/<\//,a.lookahead(a.concat(i,/>/))),contains:[{className:"name",begin:i,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function Kn(e){const a="true false yes no null",i="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},l={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},f={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},s={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,l]},c=e.inherit(s,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),k={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},h={end:",",endsWithParent:!0,excludeEnd:!0,keywords:a,relevance:0},m={begin:/\{/,end:/\}/,contains:[h],illegal:"\\n",relevance:0},L={begin:"\\[",end:"\\]",contains:[h],illegal:"\\n",relevance:0},K=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+i},{className:"type",begin:"!<"+i+">"},{className:"type",begin:"!"+i},{className:"type",begin:"!!"+i},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:a,keywords:{literal:a}},k,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},m,L,f,s],_=[...K];return _.pop(),_.push(c),h.contains=_,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:K}}const Pt={bash:$t,sh:$t,shell:$t,css:rr,go:Mn,golang:Mn,java:ar,javascript:In,js:In,json:ur,markdown:Bn,md:Bn,python:Ln,py:Ln,rust:Dn,rs:Dn,sql:fr,typescript:Wn,ts:Wn,xml:Gn,html:Gn,yaml:Kn,yml:Kn};for(const[e,a]of Object.entries(Pt))zt.registerLanguage(e,a);function Yn(e){const a=e.split(`
1
+ (function(de,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(de=typeof globalThis<"u"?globalThis:de||self,t(de.FlowMind={},de.Vue))})(this,function(de,t){"use strict";const Ei=["width","height","stroke-width"],xi={key:4,points:"6 9 12 15 18 9"},ki={key:5,points:"9 6 15 12 9 18"},q=t.defineComponent({__name:"Icon",props:{name:{},size:{},stroke:{}},setup(e){return(a,n)=>(t.openBlock(),t.createElementBlock("svg",{width:e.size??16,height:e.size??16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":e.stroke??1.8,"stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[e.name==="add"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[n[0]||(n[0]=t.createElementVNode("circle",{cx:"12",cy:"12",r:"9"},null,-1)),n[1]||(n[1]=t.createElementVNode("line",{x1:"12",y1:"8",x2:"12",y2:"16"},null,-1)),n[2]||(n[2]=t.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1))],64)):e.name==="minus"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[n[3]||(n[3]=t.createElementVNode("circle",{cx:"12",cy:"12",r:"9"},null,-1)),n[4]||(n[4]=t.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1))],64)):e.name==="delete"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:2},[n[5]||(n[5]=t.createStaticVNode('<polyline points="4 7 20 7"></polyline><path d="M9 7 V5 a1 1 0 0 1 1 -1 h4 a1 1 0 0 1 1 1 V7"></path><path d="M6 7 l1 12 a1 1 0 0 0 1 1 h8 a1 1 0 0 0 1 -1 l1 -12"></path><line x1="10" y1="11" x2="10" y2="18"></line><line x1="14" y1="11" x2="14" y2="18"></line>',5))],64)):e.name==="edit"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:3},[n[6]||(n[6]=t.createElementVNode("path",{d:"M4 20 l4 -1 11 -11 -3 -3 -11 11 z"},null,-1)),n[7]||(n[7]=t.createElementVNode("line",{x1:"14",y1:"6",x2:"18",y2:"10"},null,-1))],64)):e.name==="collapse"?(t.openBlock(),t.createElementBlock("polyline",xi)):e.name==="expand"?(t.openBlock(),t.createElementBlock("polyline",ki)):e.name==="collapse-all"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:6},[n[8]||(n[8]=t.createStaticVNode('<line x1="4" y1="4" x2="10" y2="10"></line><polyline points="6 10 10 10 10 6"></polyline><line x1="20" y1="4" x2="14" y2="10"></line><polyline points="14 6 14 10 18 10"></polyline><line x1="20" y1="20" x2="14" y2="14"></line><polyline points="14 18 14 14 18 14"></polyline><line x1="4" y1="20" x2="10" y2="14"></line><polyline points="6 14 10 14 10 18"></polyline>',8))],64)):e.name==="expand-all"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:7},[n[9]||(n[9]=t.createStaticVNode('<line x1="10" y1="10" x2="4" y2="4"></line><polyline points="4 6 4 4 6 4"></polyline><line x1="14" y1="10" x2="20" y2="4"></line><polyline points="20 6 20 4 18 4"></polyline><line x1="14" y1="14" x2="20" y2="20"></line><polyline points="20 18 20 20 18 20"></polyline><line x1="10" y1="14" x2="4" y2="20"></line><polyline points="4 18 4 20 6 20"></polyline>',8))],64)):e.name==="expand-level-1"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:8},[n[10]||(n[10]=t.createStaticVNode('<circle cx="12" cy="5" r="1.8" fill="currentColor" stroke="none"></circle><line x1="12" y1="7" x2="12" y2="11"></line><line x1="12" y1="11" x2="5" y2="17"></line><line x1="12" y1="11" x2="12" y2="17"></line><line x1="12" y1="11" x2="19" y2="17"></line><circle cx="5" cy="19" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="12" cy="19" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="19" cy="19" r="1.8" fill="currentColor" stroke="none"></circle>',8))],64)):e.name==="expand-level-2"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:9},[n[11]||(n[11]=t.createStaticVNode('<circle cx="12" cy="3" r="1.4" fill="currentColor" stroke="none"></circle><line x1="12" y1="4.5" x2="12" y2="7"></line><line x1="12" y1="7" x2="5" y2="11"></line><line x1="12" y1="7" x2="12" y2="11"></line><line x1="12" y1="7" x2="19" y2="11"></line><line x1="5" y1="11" x2="3" y2="16"></line><line x1="5" y1="11" x2="7" y2="16"></line><line x1="12" y1="11" x2="10" y2="16"></line><line x1="12" y1="11" x2="14" y2="16"></line><line x1="19" y1="11" x2="17" y2="16"></line><line x1="19" y1="11" x2="21" y2="16"></line><circle cx="5" cy="11" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="12" cy="11" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="19" cy="11" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="3" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="7" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="10" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="14" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="17" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="21" cy="18" r="1.4" fill="currentColor" stroke="none"></circle>',20))],64)):e.name==="zoom-in"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:10},[n[12]||(n[12]=t.createElementVNode("circle",{cx:"11",cy:"11",r:"7"},null,-1)),n[13]||(n[13]=t.createElementVNode("line",{x1:"11",y1:"8",x2:"11",y2:"14"},null,-1)),n[14]||(n[14]=t.createElementVNode("line",{x1:"8",y1:"11",x2:"14",y2:"11"},null,-1)),n[15]||(n[15]=t.createElementVNode("line",{x1:"16",y1:"16",x2:"21",y2:"21"},null,-1))],64)):e.name==="zoom-out"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:11},[n[16]||(n[16]=t.createElementVNode("circle",{cx:"11",cy:"11",r:"7"},null,-1)),n[17]||(n[17]=t.createElementVNode("line",{x1:"8",y1:"11",x2:"14",y2:"11"},null,-1)),n[18]||(n[18]=t.createElementVNode("line",{x1:"16",y1:"16",x2:"21",y2:"21"},null,-1))],64)):e.name==="reset"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:12},[n[19]||(n[19]=t.createElementVNode("polyline",{points:"4 9 4 4 9 4"},null,-1)),n[20]||(n[20]=t.createElementVNode("polyline",{points:"15 4 20 4 20 9"},null,-1)),n[21]||(n[21]=t.createElementVNode("polyline",{points:"20 15 20 20 15 20"},null,-1)),n[22]||(n[22]=t.createElementVNode("polyline",{points:"9 20 4 20 4 15"},null,-1))],64)):e.name==="settings"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:13},[n[23]||(n[23]=t.createStaticVNode('<circle cx="12" cy="12" r="3"></circle><line x1="12" y1="2.5" x2="12" y2="4.5"></line><line x1="12" y1="19.5" x2="12" y2="21.5"></line><line x1="2.5" y1="12" x2="4.5" y2="12"></line><line x1="19.5" y1="12" x2="21.5" y2="12"></line><line x1="5.6" y1="5.6" x2="7" y2="7"></line><line x1="17" y1="17" x2="18.4" y2="18.4"></line><line x1="5.6" y1="18.4" x2="7" y2="17"></line><line x1="17" y1="7" x2="18.4" y2="5.6"></line>',9))],64)):e.name==="data"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:14},[n[24]||(n[24]=t.createElementVNode("path",{d:"M9 5 C7 5 7 7 7 9 C7 11 7 12 5 12 C7 12 7 13 7 15 C7 17 7 19 9 19"},null,-1)),n[25]||(n[25]=t.createElementVNode("path",{d:"M15 5 C17 5 17 7 17 9 C17 11 17 12 19 12 C17 12 17 13 17 15 C17 17 17 19 15 19"},null,-1)),n[26]||(n[26]=t.createElementVNode("line",{x1:"10.5",y1:"12",x2:"13.5",y2:"12"},null,-1))],64)):e.name==="settings"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:15},[n[27]||(n[27]=t.createStaticVNode('<circle cx="12" cy="12" r="3"></circle><line x1="12" y1="2.5" x2="12" y2="4.5"></line><line x1="12" y1="19.5" x2="12" y2="21.5"></line><line x1="2.5" y1="12" x2="4.5" y2="12"></line><line x1="19.5" y1="12" x2="21.5" y2="12"></line><line x1="5.6" y1="5.6" x2="7" y2="7"></line><line x1="17" y1="17" x2="18.4" y2="18.4"></line><line x1="5.6" y1="18.4" x2="7" y2="17"></line><line x1="17" y1="7" x2="18.4" y2="5.6"></line>',9))],64)):e.name==="data"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:16},[n[28]||(n[28]=t.createElementVNode("path",{d:"M9 5 C7 5 7 7 7 9 C7 11 7 12 5 12 C7 12 7 13 7 15 C7 17 7 19 9 19"},null,-1)),n[29]||(n[29]=t.createElementVNode("path",{d:"M15 5 C17 5 17 7 17 9 C17 11 17 12 19 12 C17 12 17 13 17 15 C17 17 17 19 15 19"},null,-1)),n[30]||(n[30]=t.createElementVNode("line",{x1:"10.5",y1:"12",x2:"13.5",y2:"12"},null,-1))],64)):e.name==="markdown"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:17},[n[31]||(n[31]=t.createElementVNode("path",{d:"M3 17 V7 L7 13 L11 7 V17"},null,-1)),n[32]||(n[32]=t.createElementVNode("path",{d:"M14 7 V17"},null,-1)),n[33]||(n[33]=t.createElementVNode("path",{d:"M14 7 L18 12 L22 7"},null,-1)),n[34]||(n[34]=t.createElementVNode("line",{x1:"14",y1:"17",x2:"22",y2:"17"},null,-1))],64)):e.name==="txt"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:18},[n[35]||(n[35]=t.createElementVNode("rect",{x:"5",y:"3",width:"14",height:"18",rx:"1.5"},null,-1)),n[36]||(n[36]=t.createElementVNode("line",{x1:"8",y1:"8",x2:"16",y2:"8"},null,-1)),n[37]||(n[37]=t.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1)),n[38]||(n[38]=t.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):e.name==="logo"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:19},[n[39]||(n[39]=t.createStaticVNode('<circle cx="12" cy="12" r="2.2"></circle><circle cx="4" cy="5" r="1.6"></circle><circle cx="20" cy="5" r="1.6"></circle><circle cx="4" cy="19" r="1.6"></circle><circle cx="20" cy="19" r="1.6"></circle><line x1="10.5" y1="10.8" x2="5.2" y2="6.4"></line><line x1="13.5" y1="10.8" x2="18.8" y2="6.4"></line><line x1="10.5" y1="13.2" x2="5.2" y2="17.6"></line><line x1="13.5" y1="13.2" x2="18.8" y2="17.6"></line>',9))],64)):e.name==="import"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:20},[n[40]||(n[40]=t.createElementVNode("path",{d:"M12 4 V15"},null,-1)),n[41]||(n[41]=t.createElementVNode("polyline",{points:"7 10 12 15 17 10"},null,-1)),n[42]||(n[42]=t.createElementVNode("path",{d:"M4 19 H20"},null,-1))],64)):e.name==="export"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:21},[n[43]||(n[43]=t.createElementVNode("path",{d:"M12 15 V4"},null,-1)),n[44]||(n[44]=t.createElementVNode("polyline",{points:"7 9 12 4 17 9"},null,-1)),n[45]||(n[45]=t.createElementVNode("path",{d:"M4 19 H20"},null,-1))],64)):e.name==="balance"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:22},[n[46]||(n[46]=t.createStaticVNode('<line x1="3" y1="6" x2="21" y2="6"></line><line x1="3" y1="12" x2="21" y2="12"></line><line x1="3" y1="18" x2="21" y2="18"></line><polyline points="9 4 5 6 9 8"></polyline><polyline points="15 4 19 6 15 8"></polyline><polyline points="9 10 5 12 9 14"></polyline><polyline points="15 10 19 12 15 14"></polyline><polyline points="9 16 5 18 9 20"></polyline><polyline points="15 16 19 18 15 20"></polyline>',9))],64)):e.name==="mindmap"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:23},[n[47]||(n[47]=t.createStaticVNode('<circle cx="12" cy="12" r="2.4" fill="currentColor" stroke="none"></circle><line x1="13.4" y1="10.6" x2="18.5" y2="5.5"></line><line x1="13.4" y1="13.4" x2="18.5" y2="18.5"></line><line x1="10.6" y1="10.6" x2="5.5" y2="5.5"></line><line x1="10.6" y1="13.4" x2="5.5" y2="18.5"></line><circle cx="19.5" cy="4.5" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="19.5" cy="19.5" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="4.5" cy="4.5" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="4.5" cy="19.5" r="1.8" fill="currentColor" stroke="none"></circle>',9))],64)):e.name==="tree"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:24},[n[48]||(n[48]=t.createStaticVNode('<circle cx="5" cy="12" r="2" fill="currentColor" stroke="none"></circle><circle cx="19" cy="5" r="2" fill="currentColor" stroke="none"></circle><circle cx="19" cy="12" r="2" fill="currentColor" stroke="none"></circle><circle cx="19" cy="19" r="2" fill="currentColor" stroke="none"></circle><line x1="7" y1="12" x2="12" y2="12"></line><line x1="12" y1="12" x2="12" y2="5"></line><line x1="12" y1="12" x2="12" y2="19"></line><line x1="12" y1="5" x2="17" y2="5"></line><line x1="12" y1="19" x2="17" y2="19"></line>',9))],64)):e.name==="org"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:25},[n[49]||(n[49]=t.createStaticVNode('<circle cx="12" cy="5" r="2" fill="currentColor" stroke="none"></circle><circle cx="6" cy="19" r="2" fill="currentColor" stroke="none"></circle><circle cx="12" cy="19" r="2" fill="currentColor" stroke="none"></circle><circle cx="18" cy="19" r="2" fill="currentColor" stroke="none"></circle><line x1="12" y1="7" x2="12" y2="13"></line><line x1="6" y1="13" x2="18" y2="13"></line><line x1="6" y1="13" x2="6" y2="17"></line><line x1="12" y1="13" x2="12" y2="17"></line><line x1="18" y1="13" x2="18" y2="17"></line>',9))],64)):e.name==="image"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:26},[n[50]||(n[50]=t.createElementVNode("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"},null,-1)),n[51]||(n[51]=t.createElementVNode("circle",{cx:"9",cy:"11",r:"1.6"},null,-1)),n[52]||(n[52]=t.createElementVNode("polyline",{points:"3 17 9 12 13 15 16 13 21 17"},null,-1))],64)):e.name==="x"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:27},[n[53]||(n[53]=t.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"},null,-1)),n[54]||(n[54]=t.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"},null,-1))],64)):e.name==="link"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:28},[n[55]||(n[55]=t.createElementVNode("path",{d:"M10 13 a4 4 0 0 0 5.66 0 l3 -3 a4 4 0 1 0 -5.66 -5.66 l-1 1"},null,-1)),n[56]||(n[56]=t.createElementVNode("path",{d:"M14 11 a4 4 0 0 0 -5.66 0 l-3 3 a4 4 0 1 0 5.66 5.66 l1 -1"},null,-1))],64)):e.name==="note"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:29},[n[57]||(n[57]=t.createElementVNode("path",{d:"M6 4 h9 l3 3 v13 a1 1 0 0 1 -1 1 h-11 a1 1 0 0 1 -1 -1 v-15 a1 1 0 0 1 1 -1 z"},null,-1)),n[58]||(n[58]=t.createElementVNode("line",{x1:"8",y1:"10",x2:"16",y2:"10"},null,-1)),n[59]||(n[59]=t.createElementVNode("line",{x1:"8",y1:"13",x2:"16",y2:"13"},null,-1)),n[60]||(n[60]=t.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):t.createCommentVNode("",!0)],8,Ei))}}),Ni="data:image/svg+xml,%3csvg%20t='1780822312364'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='7459'%20width='200'%20height='200'%3e%3cpath%20d='M329.16%20292.571h658.286V512H329.16zM329.16%200h658.286v219.429H329.16z'%20fill='%239AA1A2'%20p-id='7460'%3e%3c/path%3e%3cpath%20d='M44.927%20146.286a46.519%2046.519%200%200%201%2038.107-73.143h319.269v73.143H109.73V791.99l-48.713%205.705-24.43-651.41h8.339z'%20fill='%239AA1A2'%20p-id='7461'%3e%3c/path%3e%3cpath%20d='M363.83%20877.714H179.51c-78.775%200-142.921-66.12-142.921-147.31V112.787c0-21.943%2017.188-39.643%2038.473-39.643%2021.211%200%2033.5%2017.774%2033.5%2039.643v617.619c0%2037.522%2028.013%2076.58%2064.438%2076.58h190.903c21.211%200%2038.766%2013.97%2038.766%2035.84%200%2021.943-17.555%2034.89-38.766%2034.89z'%20fill='%239AA1A2'%20p-id='7462'%3e%3c/path%3e%3cpath%20d='M432.95%20438.857H179.51c-78.775%200-81.043-18.578-81.043-62.903l10.094-90.624c0%2020.48%2013.458%2080.677%2049.884%2080.677h210.139c21.211%200%20120.613%204.023%20120.613%2016.018%200%2011.922-35.036%2056.832-56.32%2056.832zM640.017%20749.714V640a54.857%2054.857%200%200%201%20109.714%200v109.714h109.715a54.857%2054.857%200%200%201%200%20109.715H749.73v109.714a54.857%2054.857%200%200%201-109.714%200V859.429H530.303a54.857%2054.857%200%200%201%200-109.715h109.714z'%20fill='%239AA1A2'%20p-id='7463'%3e%3c/path%3e%3c/svg%3e",wi="data:image/svg+xml,%3csvg%20t='1780822464335'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='8457'%20width='200'%20height='200'%3e%3cpath%20d='M512%20804.571h512V1024H512V804.571zM0%200h658.286v219.429H0V0z'%20fill='%239AA1A2'%20p-id='8458'%3e%3c/path%3e%3cpath%20d='M619.813%20950.857h-184.32c-78.775%200-142.922-66.121-142.922-147.31V185.93c0-21.943%2017.189-39.643%2038.474-39.643%2021.211%200%2033.353%2017.773%2033.353%2039.643v617.618c0%2037.523%2034.743%2073.728%2071.095%2073.728h184.32c21.211%200%2038.473%2012.069%2038.473%2033.939%200%2021.943-17.189%2039.643-38.473%2039.643z'%20fill='%239AA1A2'%20p-id='8459'%3e%3c/path%3e%3cpath%20d='M676.571%20457.143V347.429a54.857%2054.857%200%200%201%20109.715%200v109.714H896a54.857%2054.857%200%200%201%200%20109.714H786.286v109.714a54.857%2054.857%200%200%201-109.715%200V566.857H566.857a54.857%2054.857%200%200%201%200-109.714h109.714z'%20fill='%239AA1A2'%20p-id='8460'%3e%3c/path%3e%3c/svg%3e",jt=[18,15,13,12],_i=[700,600,500,400],Si=[52,40,32,28],Mi=[120,80,60,44],Ci=[.8,.8,.8,.8],vi=jt.length-1;function Ti(e,a){return Math.round(Tt(e,a)*Ci[lt(e)])}function lt(e){return Math.min(vi,Math.max(0,e))}function Tt(e,a=14){return Math.round(jt[lt(e)]*a/14*10)/10}function Ai(e,a=14){return Math.round(Si[lt(e)]*a/14)}const st=60,Pe=14,ye=24;let At=null;function Ri(){if(At)return At;const e=typeof document<"u"?document.createElement("canvas").getContext("2d"):null;return e?(At=e,e):{font:"",measureText:()=>({width:0})}}const Jt=new Map;function Oi(e,a,n){const r=`${n}|${a}|${e}`,l=Jt.get(r);if(l!==void 0)return l;const f=Ri();f.font=`${n} ${a}px "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif`;const s=f.measureText(e).width;return Jt.set(r,s),s}const Ii=24,Bi=400,Li=8,Qt=16,Di=4,zi=200;function $i(e,a,n){return Math.min(n,Math.max(a,e))}function Pi(e,a,n,r,l){const f=lt(a),s=Tt(a,n),c=Math.min(Oi(e.text||"",s,_i[f]),zi),d=Ti(a,n),g=Math.ceil(c+d*2),b=!!(e.richContent&&(e.richContent.kind==="code"||e.richContent.kind==="table"))?Math.ceil(s*1.2)+6:Ai(a,n);let k=0;if(e.link&&(k+=Qt),e.note&&(k+=Qt),k>0){const L=(e.link?1:0)+(e.note?1:0);k+=Di*L}const h=g+k,m=(()=>{const L=Math.round(Mi[f]*n/14);if(e.richContent&&(e.richContent.kind==="code"||e.richContent.kind==="table")){const J=l==null?void 0:l[e.id];return Math.max(L,J??240)}return L})(),O=!!(e.richContent&&(e.richContent.kind==="code"||e.richContent.kind==="table")),C=r==null?void 0:r[e.id],N=O?Math.max(24,C??Math.max(70,Math.ceil(s*5))):0,F=N>0?10:0;if(!e.image){const L=Math.max(m,h),J=Math.ceil(b+F+N);return{w:L,h:J}}const I=$i(e.image.width,Ii,Bi),P=Math.max(m,h,Math.ceil(I+d*2)),z=Math.ceil(e.image.height+Li+b+F+N);return{w:P,h:z}}function Vi(e,a={}){const n=a.mode??"mindmap",r=a.preservePositions===!0,l=a.baseFontSize??14,f=tn(e,0,null,1,"right",l,a.richHeights,a.richWidths);return Hi(f),Ui(f,n,r),f.x=0,f.y=0,Fi(f,r)}function Ui(e,a,n=!1){if(a==="mindmap"){const r=e.children;if(r.length!==0)if(r.length===1)r[0]._dir="right",r[0].side=1,r[0]._dirRight=1;else{const c=r.reduce((b,k)=>b+k._subtreeH,0);let d=1,g=Math.abs(r[0]._subtreeH-(c-r[0]._subtreeH)),x=0;for(let b=0;b<r.length-1;b++){x+=r[b]._subtreeH;const k=Math.abs(x-(c-x));k<g&&(g=k,d=b+1)}for(let b=0;b<d;b++)r[b]._dir="right",r[b].side=1,r[b]._dirRight=1;for(let b=d;b<r.length;b++)r[b]._dir="left",r[b].side=-1,r[b]._dirRight=-1}const l=e.children.filter(c=>c.side===1),f=e.children.filter(c=>c.side===-1),s=(c,d)=>{const g=d==="right"?1:-1;c._dir=d,c.side=g,c._dirRight=g;for(const x of c.children)s(x,d)};for(const c of l)s(c,"right");for(const c of f)s(c,"left");if(l.length>0){const c={...e,children:l};ct(c,"right",st,!0,n)}if(f.length>0){const c={...e,children:f};ct(c,"left",st,!0,n)}}else if(a==="tree"){const r=l=>{l.side=1,l._dir="right";for(const f of l.children)r(f)};for(const l of e.children)l._dir="right";ct(e,"right",st,!0,n),r(e)}else{for(const r of e.children)r._dir="down";en(e,st,n)}}function ct(e,a,n,r,l=!1){if(e.children.length===0)return;const f=e.children.reduce((g,x,b)=>g+x._subtreeH+(b>0?Pe:0),0),s=a==="right"?1:-1,c=r?s:1;let d=e.y-c*f/2;e.children.forEach(g=>{l||(g.x=e.x+s*(e.width/2+n+g.width/2),g.y=d+c*g._subtreeH/2),g._dir=a,d+=c*(g._subtreeH+Pe),ct(g,a,n,!1,l)})}function en(e,a,n=!1){if(e.children.length===0)return;const r=e.children.reduce((f,s,c)=>f+s._subtreeW+(c>0?Pe*2:0),0);let l=e.x-r/2;e.children.forEach(f=>{n||(f.x=l+f._subtreeW/2,f.y=e.y+e.height/2+a+f.height/2),f._dir="down",l+=f._subtreeW+Pe*2,en(f,a,n)})}function tn(e,a,n,r,l,f,s,c){const d=Pi(e,a,f,s,c),g={id:e.id,text:e.text,depth:a,x:e._x??0,y:e._y??0,width:d.w,height:d.h,fontSize:Tt(a,f),isRoot:a===0,collapsed:e.collapsed,side:r,_dir:l,_dirRight:r,_subtreeH:d.h,_subtreeW:d.w,image:e.image?{...e.image}:void 0,link:e.link?{url:e.link.url}:void 0,note:e.note?{text:e.note.text}:void 0,richContent:e.richContent?{kind:e.richContent.kind,raw:e.richContent.raw,lang:e.richContent.lang}:void 0,children:[],parent:n};if(e.collapsed)return g;const x=e.children.length,b=Math.ceil(x/2);return g.children=e.children.map((k,h)=>{const m=a===0?h<b?1:-1:r;return tn(k,a+1,g,m,l,f,s,c)}),g}function Hi(e){const a=[e];for(let n=0;n<a.length;n++){const r=a[n];for(const l of r.children)a.push(l)}for(let n=a.length-1;n>=0;n--){const r=a[n];if(r.collapsed||r.children.length===0){r._subtreeH=r.height,r._subtreeW=r.width;continue}let l=0,f=0;for(const s of r.children)l+=s._subtreeH,f+=s._subtreeW;r.children.length>1&&(l+=Pe*(r.children.length-1),f+=Pe*2*(r.children.length-1)),r._subtreeH=Math.max(r.height,l),r._subtreeW=Math.max(r.width,f)}}function Fi(e,a=!1){const n=[e];let r=1/0,l=-1/0,f=1/0,s=-1/0;for(;n.length;){const g=n.pop(),x=g.width/2,b=g.height/2;g.x-x<r&&(r=g.x-x),g.x+x>l&&(l=g.x+x),g.y-b<f&&(f=g.y-b),g.y+b>s&&(s=g.y+b),n.push(...g.children)}if(a)return{root:e,width:l-r+ye*2,height:s-f+ye*2,vbX:r-ye,vbY:f-ye,vbW:l-r+ye*2,vbH:s-f+ye*2};const c=ye-f,d=[e];for(;d.length;){const g=d.pop();g.y+=c,d.push(...g.children)}return f+=c,s+=c,{root:e,width:l-r+ye*2,height:s+ye,vbX:r-ye,vbY:0,vbW:l-r+ye*2,vbH:s+ye}}const qe=[{id:"default",name:"默认",colors:["#f87171","#fb923c","#fbbf24","#a3e635","#34d399","#22d3ee","#818cf8","#c084fc"]},{id:"classic",name:"经典",colors:["#ef4444","#f59e0b","#10b981","#3b82f6","#6366f1","#8b5cf6","#ec4899","#14b8a6"]},{id:"vivid",name:"活力",colors:["#dc2626","#ea580c","#ca8a04","#16a34a","#0891b2","#2563eb","#7c3aed","#db2777"]},{id:"dev",name:"代码",colors:["#f472b6","#a78bfa","#60a5fa","#38bdf8","#22d3ee","#34d399","#facc15","#fb923c"]},{id:"mint",name:"薄荷",colors:["#5eead4","#67e8f9","#93c5fd","#c4b5fd","#fbcfe8","#fde68a","#a7f3d0","#bae6fd"]}];function Wi(e,a=[]){return[...qe,...a].find(r=>r.id===e)??qe[0]}function Se(){return"n_"+Math.random().toString(36).slice(2,10)+Date.now().toString(36).slice(-4)}function Te(e){return JSON.parse(JSON.stringify(e))}function W(e,a){if(e.id===a)return e;for(const n of e.children){const r=W(n,a);if(r)return r}return null}function we(e,a,n=null){if(e.id===a)return n;for(const r of e.children){const l=we(r,a,e);if(l!==null)return l}return null}function Rt(e,a){const n=e.children.findIndex(r=>r.id===a);if(n>=0)return e.children.splice(n,1),!0;for(const r of e.children)if(Rt(r,a))return!0;return!1}function Gi(e,a,n){const r=W(e,a);return!r||r.text===n?!1:(r.text=n,!0)}function Ki(e,a,n,r){if(!we(e,a)||a===n||W(W(e,a),n))return!1;const l=we(e,a),f=l.children.findIndex(g=>g.id===a);if(f<0)return!1;const[s]=l.children.splice(f,1);if(r==="child"){const g=W(e,n);return g?(g.children.push(s),!0):(l.children.splice(f,0,s),!1)}const c=we(e,n);if(!c)return l.children.splice(f,0,s),!1;let d=c.children.findIndex(g=>g.id===n);return d<0?(l.children.splice(f,0,s),!1):(r==="after"&&(d+=1),c.children.splice(d,0,s),!0)}function nn(e){const a=/^新节点(?:\s+(\d+))?$/;let n=0,r=!1;for(const l of e.children){const f=l.text.match(a);if(f)if(f[1]){const s=parseInt(f[1],10);s>n&&(n=s)}else r=!0}return n===0&&!r?dt:n>0?`新节点 ${n+1}`:"新节点 2"}function on(e,a,n){const r=W(e,a);if(!r)return null;const l={id:Se(),text:n??nn(r),children:[]};return r.children.push(l),l}function rn(e,a,n){const r=we(e,a);if(!r)return null;const l=r.children.findIndex(s=>s.id===a);if(l<0)return null;const f={id:Se(),text:n??nn(r),children:[]};return r.children.splice(l+1,0,f),f}function Yi(e,a,n){const r=we(e,a);if(!r)return null;const l=r.children.findIndex(s=>s.id===a);if(l<0)return null;const f={id:Se(),text:n,children:[]};return r.children.splice(l,0,f),f}function Zi(e,a){const n=we(e,a);if(!n)return null;const r=n.children.findIndex(s=>s.id===a);if(r<0)return null;const l=n.children[r],f=Te(l);return an(f),n.children.splice(r+1,0,f),f}function an(e){e.id=Se();for(const a of e.children)an(a)}const dt="新节点";function Ot(e,a="导入的导图"){const n=e.split(/\r?\n/),r={id:Se(),text:a,children:[]},l=[r],f=[-1/0],s=[],c=/^(#{1,6})\s+(.+?)\s*#*\s*$/,d=/^!\[([^\]]*)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,g=/^\[([^\]]+)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,x=/^(`{3,}|~{3,})\s*(\S+)?\s*$/;let b=!1,k=[],h=null;function m(N){k.push(N)}function O(){if(h&&k.length>0){for(;k.length>0&&k[0].trim()==="";)k.shift();for(;k.length>0&&k[k.length-1].trim()==="";)k.pop();const N=k.join(`
2
+ `);N&&(h.note={text:N})}b=!1,k=[]}for(const N of n){if(b){const L=N.match(x);if(L&&L[1][0]==="`"){O();continue}m(N);continue}const F=N.match(c);if(F){const L=F[1].length,J=F[2].trim();s.push({level:L,text:J,body:""}),h=s[s.length-1];continue}const I=N.match(x);if(I&&I[2]==="note"){b=!0,k=[];continue}const P=N.match(d);if(P&&h){const L=P[2],J=160,ee=120;h.image={src:L,naturalW:J,naturalH:ee,width:J,height:ee};continue}const z=N.match(g);if(z&&h){h.link={url:z[2]},h.text=z[1];continue}if(N.trim().length>0&&h){const L=N.trim();h.body=h.body?h.body+`
3
+ `+L:L}}b&&O();function C(N){for(;l.length>1;){const z=l.length-1,L=f[z];if(L!==void 0&&L<N.level)break;l.pop(),f.pop()}const F=l[l.length-1],I=N.text,P={id:Se(),text:I,children:[]};N.image&&(P.image={...N.image}),N.link&&(P.link={url:N.link.url}),N.note&&(P.note={text:N.note.text}),N.body&&(P.note={text:N.body}),F.children.push(P),l.push(P),f.push(N.level)}for(const N of s)C(N);if(s.length>0&&s[0].level===1){const N=r.children[0];N&&(r.text=N.text,r.id=N.id,N.image&&(r.image={...N.image}),N.link&&(r.link={url:N.link.url}),N.note&&(r.note={text:N.note.text}),r.children=N.children)}return r}function ut(e,a=1){let n="#".repeat(a)+" "+(e.text||"")+`
4
+ `;e.link&&(n+=`[${e.text||"link"}](${e.link.url})
5
+ `),e.image&&(n+=`![image](${e.image.src})
6
+ `),e.note&&(n+="```note\n"+e.note.text+"\n```\n"),e.richContent&&(n+=e.richContent.raw+`
7
+ `);for(const r of e.children)n+=ut(r,a+1);return n}function Xi(e){var g,x;const a=e.split(/\r?\n/),n=[];let r=0;const l=/^(#{1,6})\s+(.+?)\s*#*\s*$/,f=/^(`{3,}|~{3,})\s*(\S+)?\s*$/,s=/^\s*\|?\s*(:?-+:?\s*\|\s*)+(:?-+:?)(\s*\|)?\s*$/,c=/^(\s*)[-*+]\s+(.*)$/,d=/^(\s*)\d+\.\s+(.*)$/;for(;r<a.length;){const b=a[r],k=b.match(f);if(k){const I=k[1][0],P=k[2]||"",z=[b];for(r++;r<a.length;){const J=a[r].match(f);if(J&&J[1][0]===I){z.push(a[r]),r++;break}z.push(a[r]),r++}const L=z.slice(1,-1).join(`
8
+ `).trim();n.push({kind:"code",text:((g=L.split(`
9
+ `)[0])==null?void 0:g.slice(0,80))||"(空代码块)",raw:z.join(`
10
+ `),lang:P});continue}const h=b.match(l);if(h){n.push({kind:"heading",level:h[1].length,text:h[2].trim(),raw:b}),r++;continue}if(/^\s*\|/.test(b)){const I=[];let P=r,z=!1;for(;P<a.length&&/^\s*\|/.test(a[P]);)I.push(a[P]),s.test(a[P])&&(z=!0),P++;if(z&&I.length>=2){n.push({kind:"table",text:((x=I[0].replace(/^\s*\|/,"").replace(/\|\s*$/,"").split("|")[0])==null?void 0:x.trim())||"表格",raw:I.join(`
11
+ `)}),r=P;continue}}const m=b.match(c),O=b.match(d);if(m||O){let I=r;for(;I<a.length;){const P=a[I].match(c),z=a[I].match(d);if(!(P||z))break;const L=a[I].replace(/^\s*[-*+]\s+/,"").replace(/^\s*\d+\.\s+/,"").trim();L.length>0&&n.push({kind:"list",text:L.slice(0,80)||"(列表项)",raw:a[I]}),I++}r=I;continue}if(b.trim()===""){r++;continue}const C=[b];let N=r+1;for(;N<a.length;){const I=a[N];if(I.trim()===""||l.test(I)||f.test(I)||c.test(I)||d.test(I)||/^\s*\|/.test(I))break;C.push(I),N++}const F=C.join(" ").trim();n.push({kind:"paragraph",text:F.slice(0,80)||"(空段落)",raw:C.join(`
12
+ `)}),r=N}return n}function qi(e,a="导入的导图"){const n=Xi(e||""),r={id:Se(),text:a,children:[]},l=[r],f=[0];let s=!1;function c(d){if(d.kind==="heading"){const x=d.level;for(;l.length>1&&f[f.length-1]>=x;)l.pop(),f.pop();if(!s&&x===1){s=!0,r.text=d.text,f[0]=1;return}const b={id:Se(),text:d.text,children:[]};l[l.length-1].children.push(b),l.push(b),f.push(x);return}const g={id:Se(),text:d.text,children:[],richContent:{kind:d.kind,raw:d.raw,lang:d.lang}};l[l.length-1].children.push(g)}for(const d of n)c(d);return r}function ji(e){return e.richContent?e.richContent.raw+`
13
+ `:""}function Ji(e){const a=e.minScale??.2,n=e.maxScale??1/0,r=e.step??1.2,l=t.ref(1),f=t.ref(0),s=t.ref(0),c=t.ref(!1),d=t.reactive({x:0,y:0,ox:0,oy:0}),g=t.ref(!1),x=t.reactive({x:0,y:0}),b=t.reactive({x:0,y:0,width:0,height:0}),k=t.ref(0);let h=null;function m(G){h=G}function O(G){G.preventDefault();const Q=e.getContainer();if(!Q)return;const re=-G.deltaY*.001,ue=Math.min(n,Math.max(a,l.value*(1+re))),ie=Q.getBoundingClientRect(),fe=G.clientX-ie.left,E=G.clientY-ie.top,v=(fe-f.value)/l.value,M=(E-s.value)/l.value;l.value=ue,f.value=fe-v*ue,s.value=E-M*ue}function C(){l.value=Math.min(n,l.value*r)}function N(){l.value=Math.max(a,l.value/r)}function F(G){var re;G.target.closest(".zm-node, .zm-toolbar, button, input, textarea")||(c.value=!0,d.x=G.clientX,d.y=G.clientY,d.ox=f.value,d.oy=s.value,window.addEventListener("mousemove",I),window.addEventListener("mouseup",P),(re=G.preventDefault)==null||re.call(G))}function I(G){c.value&&(f.value=d.ox+(G.clientX-d.x),s.value=d.oy+(G.clientY-d.y))}function P(){c.value=!1,window.removeEventListener("mousemove",I),window.removeEventListener("mouseup",P)}function z(G,Q){g.value=!0,x.x=G,x.y=Q,b.x=G,b.y=Q,b.width=0,b.height=0,k.value++,window.addEventListener("mousemove",ee),window.addEventListener("mouseup",J)}function L(G,Q){if(!g.value)return;const re=Math.min(x.x,G),ue=Math.min(x.y,Q),ie=Math.max(x.x,G),fe=Math.max(x.y,Q);b.x=re,b.y=ue,b.width=ie-re,b.height=fe-ue,k.value++}function J(){g.value=!1,window.removeEventListener("mousemove",ee),window.removeEventListener("mouseup",J),h&&h()}function ee(G){if(!g.value)return;const Q=e.getContainer();if(!Q)return;const re=Q.getBoundingClientRect(),ue=(G.clientX-re.left-f.value)/l.value,ie=(G.clientY-re.top-s.value)/l.value;L(ue,ie)}function ae(G,Q,re,ue=60){const ie=e.getContainer();if(!ie)return;const fe=ie.getBoundingClientRect(),E=(fe.width-ue*2)/G,v=(fe.height-ue*2)/Q,M=Math.min(1,Math.max(.3,Math.min(E,v)));l.value=M,f.value=fe.width/2,s.value=fe.height/2-re*M}return{scale:l,offsetX:f,offsetY:s,isPanning:c,onWheel:O,zoomIn:C,zoomOut:N,startPan:F,startMarquee:z,updateMarquee:L,isMarquee:g,marquee:b,marqueeVersion:k,setOnMarqueeEnd:m,resetView:ae}}const Qi=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform);function ln(e){return Qi?e.metaKey:e.ctrlKey}function eo(e){function a(){const r=e.getSelectedId();return r||(e.defaultTargetId?e.defaultTargetId():e.getRootId())}function n(r){const l=r.target;if(l&&(l.tagName==="INPUT"||l.tagName==="TEXTAREA"||l.isContentEditable)||e.isReadonly()||e.isEditing())return;const f=e.getSelectedId(),s=a();if(s){if(ln(r)&&!r.shiftKey){if(r.key==="d"||r.key==="D"){f&&f!==e.getRootId()&&(r.preventDefault(),e.onDuplicate(f));return}if(r.key==="z"||r.key==="Z"){r.preventDefault(),e.onUndo();return}if(r.key==="y"||r.key==="Y"){r.preventDefault(),e.onRedo();return}if(r.key==="Home"){r.preventDefault(),e.onSelectRoot();return}}if(ln(r)&&r.shiftKey&&(r.key==="Z"||r.key==="z")){r.preventDefault(),e.onRedo();return}r.key==="Tab"?(r.preventDefault(),e.onAddChild(s)):r.key==="Enter"?(r.preventDefault(),r.shiftKey?f&&f!==e.getRootId()&&e.onAddSiblingBefore(f):e.onAddSibling(s)):(r.key==="Delete"||r.key==="Backspace")&&f&&f!==e.getRootId()?(r.preventDefault(),e.onRemove(f)):r.key==="F2"&&f?(r.preventDefault(),e.onStartEdit(f)):r.key==="Escape"?(r.preventDefault(),e.onClearSelection()):r.key==="ArrowDown"?(r.preventDefault(),e.onNavigate(0,1)):r.key==="ArrowUp"?(r.preventDefault(),e.onNavigate(0,-1)):r.key==="ArrowRight"?(r.preventDefault(),e.onNavigate(1,0)):r.key==="ArrowLeft"&&(r.preventDefault(),e.onNavigate(-1,0))}}t.onMounted(()=>{window.addEventListener("keydown",n)}),t.onBeforeUnmount(()=>{window.removeEventListener("keydown",n)})}function to(e=100){const a=t.ref([]);let n=-1;function r(){return n>0}function l(){return n<a.value.length-1}function f(g){const x=JSON.stringify(g);for(n<a.value.length-1&&(a.value=a.value.slice(0,n+1)),a.value.push(x),n=a.value.length-1;a.value.length>e;)a.value.shift(),n--}function s(){return r()?(n--,JSON.parse(a.value[n])):null}function c(){return l()?(n++,JSON.parse(a.value[n])):null}function d(){a.value=[],n=-1}return{canUndo:r,canRedo:l,record:f,undo:s,redo:c,reset:d}}const no=t.defineComponent({__name:"NodeContextMenu",props:{x:{},y:{},container:{},hasImage:{type:Boolean,default:!1},hasLink:{type:Boolean,default:!1},hasNote:{type:Boolean,default:!1},hasCode:{type:Boolean,default:!1},hasTable:{type:Boolean,default:!1}},emits:["pickImage","setLink","removeLink","editNote","removeNote","removeImage","addCode","editCode","removeCode","addTable","editTable","removeTable","close"],setup(e,{emit:a}){const n=e,r=a,l=t.computed(()=>{let k=n.x+2,h=n.y+2;if(n.container){const m=n.container.getBoundingClientRect(),O=180,N=4+(3+(n.hasImage?1:0)+(n.hasLink?1:0)+(n.hasNote?1:0)+1+(n.hasCode?1:0)+1+(n.hasTable?1:0))*28;k+O>m.right&&(k=Math.max(m.left+4,n.x-O-2)),h+N>m.bottom&&(h=Math.max(m.top+4,n.y-N-2)),k<m.left+2&&(k=m.left+2),h<m.top+2&&(h=m.top+2)}return{left:k,top:h}}),f=t.computed(()=>n.hasImage),s=t.computed(()=>n.hasLink),c=t.computed(()=>n.hasNote);function d(k){const h=k.target;h&&h.closest(".zm-node-menu")||r("close")}function g(k){k.key==="Escape"&&r("close")}function x(){r("close")}window.addEventListener("mousedown",d,!0),window.addEventListener("keydown",g,!0),window.addEventListener("wheel",x,!0),window.addEventListener("scroll",x,!0),t.onBeforeUnmount(()=>{window.removeEventListener("mousedown",d,!0),window.removeEventListener("keydown",g,!0),window.removeEventListener("wheel",x,!0),window.removeEventListener("scroll",x,!0)});function b(k){k(),r("close")}return(k,h)=>(t.openBlock(),t.createElementBlock("div",{class:"zm-node-menu",style:t.normalizeStyle({left:l.value.left+"px",top:l.value.top+"px"}),onContextmenu:h[10]||(h[10]=t.withModifiers(()=>{},["prevent"]))},[t.createElementVNode("button",{class:"zm-node-menu-item",onClick:h[0]||(h[0]=t.withModifiers(m=>b(()=>r("pickImage")),["stop"]))},[t.createVNode(q,{name:"image",size:13}),t.createElementVNode("span",null,t.toDisplayString(f.value?"替换图片":"添加图片"),1)]),f.value?(t.openBlock(),t.createElementBlock("button",{key:0,class:"zm-node-menu-item",onClick:h[1]||(h[1]=t.withModifiers(m=>b(()=>r("removeImage")),["stop"]))},[t.createVNode(q,{name:"x",size:13}),h[11]||(h[11]=t.createElementVNode("span",null,"移除图片",-1))])):t.createCommentVNode("",!0),t.createElementVNode("button",{class:"zm-node-menu-item",onClick:h[2]||(h[2]=t.withModifiers(m=>b(()=>r("setLink")),["stop"]))},[t.createVNode(q,{name:"link",size:13}),t.createElementVNode("span",null,t.toDisplayString(s.value?"编辑链接":"添加链接"),1)]),s.value?(t.openBlock(),t.createElementBlock("button",{key:1,class:"zm-node-menu-item",onClick:h[3]||(h[3]=t.withModifiers(m=>b(()=>r("removeLink")),["stop"]))},[t.createVNode(q,{name:"x",size:13}),h[12]||(h[12]=t.createElementVNode("span",null,"移除链接",-1))])):t.createCommentVNode("",!0),t.createElementVNode("button",{class:"zm-node-menu-item",onClick:h[4]||(h[4]=t.withModifiers(m=>b(()=>r("addCode")),["stop"]))},[h[13]||(h[13]=t.createElementVNode("span",{class:"zm-node-menu-icon zm-node-menu-icon-code","aria-hidden":"true"},"{ }",-1)),t.createElementVNode("span",null,t.toDisplayString(e.hasCode?"编辑代码块":"添加代码块"),1)]),e.hasCode?(t.openBlock(),t.createElementBlock("button",{key:2,class:"zm-node-menu-item",onClick:h[5]||(h[5]=t.withModifiers(m=>b(()=>r("removeCode")),["stop"]))},[t.createVNode(q,{name:"x",size:13}),h[14]||(h[14]=t.createElementVNode("span",null,"移除代码块",-1))])):t.createCommentVNode("",!0),t.createElementVNode("button",{class:"zm-node-menu-item",onClick:h[6]||(h[6]=t.withModifiers(m=>b(()=>r("addTable")),["stop"]))},[h[15]||(h[15]=t.createElementVNode("span",{class:"zm-node-menu-icon zm-node-menu-icon-table","aria-hidden":"true"},"▦",-1)),t.createElementVNode("span",null,t.toDisplayString(e.hasTable?"编辑表格":"添加表格"),1)]),e.hasTable?(t.openBlock(),t.createElementBlock("button",{key:3,class:"zm-node-menu-item",onClick:h[7]||(h[7]=t.withModifiers(m=>b(()=>r("removeTable")),["stop"]))},[t.createVNode(q,{name:"x",size:13}),h[16]||(h[16]=t.createElementVNode("span",null,"移除表格",-1))])):t.createCommentVNode("",!0),t.createElementVNode("button",{class:"zm-node-menu-item",onClick:h[8]||(h[8]=t.withModifiers(m=>b(()=>r("editNote")),["stop"]))},[t.createVNode(q,{name:"note",size:13}),t.createElementVNode("span",null,t.toDisplayString(c.value?"编辑笔记":"添加笔记"),1)]),c.value?(t.openBlock(),t.createElementBlock("button",{key:4,class:"zm-node-menu-item",onClick:h[9]||(h[9]=t.withModifiers(m=>b(()=>r("removeNote")),["stop"]))},[t.createVNode(q,{name:"x",size:13}),h[17]||(h[17]=t.createElementVNode("span",null,"移除笔记",-1))])):t.createCommentVNode("",!0)],36))}}),io=t.defineComponent({__name:"CanvasContextMenu",props:{x:{},y:{},container:{}},emits:["openSettings","openData","openImport","close"],setup(e,{emit:a}){const n=e,r=a,l=t.computed(()=>{let O=n.x+2,C=n.y+2;if(n.container){const N=n.container.getBoundingClientRect(),F=184,I=4+3*28;O+F>N.right&&(O=Math.max(N.left+4,n.x-F-2)),C+I>N.bottom&&(C=Math.max(N.top+4,n.y-I-2)),O<N.left+2&&(O=N.left+2),C<N.top+2&&(C=N.top+2)}return{left:O,top:C}}),f=t.ref(!1);let s=null,c=null;function d(){c&&(clearTimeout(c),c=null),s=setTimeout(()=>{f.value=!0},60)}function g(){s&&(clearTimeout(s),s=null),c=setTimeout(()=>{f.value=!1},120)}t.onBeforeUnmount(()=>{s&&clearTimeout(s),c&&clearTimeout(c)});const x=t.computed(()=>({left:l.value.left+184+4+"px",top:l.value.top+32+"px"}));function b(O){const C=O.target;C&&C.closest(".zm-canvas-menu")||r("close")}function k(O){O.key==="Escape"&&r("close")}function h(){r("close")}window.addEventListener("mousedown",b,!0),window.addEventListener("keydown",k,!0),window.addEventListener("wheel",h,!0),window.addEventListener("scroll",h,!0),t.onBeforeUnmount(()=>{window.removeEventListener("mousedown",b,!0),window.removeEventListener("keydown",k,!0),window.removeEventListener("wheel",h,!0),window.removeEventListener("scroll",h,!0)});function m(O){O(),r("close")}return(O,C)=>(t.openBlock(),t.createElementBlock("div",{class:"zm-canvas-menu",style:t.normalizeStyle({left:l.value.left+"px",top:l.value.top+"px"}),onContextmenu:C[5]||(C[5]=t.withModifiers(()=>{},["prevent"]))},[t.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:C[0]||(C[0]=t.withModifiers(N=>m(()=>r("openData")),["stop"]))},[t.createVNode(q,{name:"data",size:13}),C[6]||(C[6]=t.createElementVNode("span",null,"查看数据",-1))]),t.createElementVNode("div",{class:t.normalizeClass(["zm-canvas-menu-item zm-canvas-menu-item-has-submenu",{"is-open":f.value}]),onMouseenter:d,onMouseleave:g},[t.createVNode(q,{name:"import",size:13}),C[10]||(C[10]=t.createElementVNode("span",null,"导入",-1)),C[11]||(C[11]=t.createElementVNode("span",{class:"zm-canvas-menu-caret","aria-hidden":"true"},"›",-1)),f.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:"zm-canvas-submenu",style:t.normalizeStyle(x.value),onMouseenter:d,onMouseleave:g},[t.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:C[1]||(C[1]=t.withModifiers(N=>m(()=>r("openImport","markdown")),["stop"]))},[t.createVNode(q,{name:"markdown",size:13}),C[7]||(C[7]=t.createElementVNode("span",null,"Markdown 导入",-1))]),t.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:C[2]||(C[2]=t.withModifiers(N=>m(()=>r("openImport","json")),["stop"]))},[t.createVNode(q,{name:"data",size:13}),C[8]||(C[8]=t.createElementVNode("span",null,"JSON 文件导入",-1))]),t.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:C[3]||(C[3]=t.withModifiers(N=>m(()=>r("openImport","txt")),["stop"]))},[t.createVNode(q,{name:"note",size:13}),C[9]||(C[9]=t.createElementVNode("span",null,"TXT 文件导入",-1))])],36)):t.createCommentVNode("",!0)],34),t.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:C[4]||(C[4]=t.withModifiers(N=>m(()=>r("openSettings")),["stop"]))},[t.createVNode(q,{name:"settings",size:13}),C[12]||(C[12]=t.createElementVNode("span",null,"设置",-1))])],36))}});function oo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function sn(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(a=>{const n=e[a],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&sn(n)}),e}class cn{constructor(a){a.data===void 0&&(a.data={}),this.data=a.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function dn(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function Ie(e,...a){const n=Object.create(null);for(const r in e)n[r]=e[r];return a.forEach(function(r){for(const l in r)n[l]=r[l]}),n}const ro="</span>",un=e=>!!e.scope,ao=(e,{prefix:a})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){const n=e.split(".");return[`${a}${n.shift()}`,...n.map((r,l)=>`${r}${"_".repeat(l+1)}`)].join(" ")}return`${a}${e}`};class lo{constructor(a,n){this.buffer="",this.classPrefix=n.classPrefix,a.walk(this)}addText(a){this.buffer+=dn(a)}openNode(a){if(!un(a))return;const n=ao(a.scope,{prefix:this.classPrefix});this.span(n)}closeNode(a){un(a)&&(this.buffer+=ro)}value(){return this.buffer}span(a){this.buffer+=`<span class="${a}">`}}const fn=(e={})=>{const a={children:[]};return Object.assign(a,e),a};class It{constructor(){this.rootNode=fn(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(a){this.top.children.push(a)}openNode(a){const n=fn({scope:a});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(a){return this.constructor._walk(a,this.rootNode)}static _walk(a,n){return typeof n=="string"?a.addText(n):n.children&&(a.openNode(n),n.children.forEach(r=>this._walk(a,r)),a.closeNode(n)),a}static _collapse(a){typeof a!="string"&&a.children&&(a.children.every(n=>typeof n=="string")?a.children=[a.children.join("")]:a.children.forEach(n=>{It._collapse(n)}))}}class so extends It{constructor(a){super(),this.options=a}addText(a){a!==""&&this.add(a)}startScope(a){this.openNode(a)}endScope(){this.closeNode()}__addSublanguage(a,n){const r=a.root;n&&(r.scope=`language:${n}`),this.add(r)}toHTML(){return new lo(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function je(e){return e?typeof e=="string"?e:e.source:null}function gn(e){return Le("(?=",e,")")}function co(e){return Le("(?:",e,")*")}function uo(e){return Le("(?:",e,")?")}function Le(...e){return e.map(n=>je(n)).join("")}function fo(e){const a=e[e.length-1];return typeof a=="object"&&a.constructor===Object?(e.splice(e.length-1,1),a):{}}function Bt(...e){return"("+(fo(e).capture?"":"?:")+e.map(r=>je(r)).join("|")+")"}function mn(e){return new RegExp(e.toString()+"|").exec("").length-1}function go(e,a){const n=e&&e.exec(a);return n&&n.index===0}const mo=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Lt(e,{joinWith:a}){let n=0;return e.map(r=>{n+=1;const l=n;let f=je(r),s="";for(;f.length>0;){const c=mo.exec(f);if(!c){s+=f;break}s+=f.substring(0,c.index),f=f.substring(c.index+c[0].length),c[0][0]==="\\"&&c[1]?s+="\\"+String(Number(c[1])+l):(s+=c[0],c[0]==="("&&n++)}return s}).map(r=>`(${r})`).join(a)}const po=/\b\B/,pn="[a-zA-Z]\\w*",Dt="[a-zA-Z_]\\w*",hn="\\b\\d+(\\.\\d+)?",bn="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",yn="\\b(0b[01]+)",ho="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",bo=(e={})=>{const a=/^#![ ]*\//;return e.binary&&(e.begin=Le(a,/.*\b/,e.binary,/\b.*/)),Ie({scope:"meta",begin:a,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},e)},Je={begin:"\\\\[\\s\\S]",relevance:0},yo={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Je]},Eo={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Je]},xo={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},ft=function(e,a,n={}){const r=Ie({scope:"comment",begin:e,end:a,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const l=Bt("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:Le(/[ ]+/,"(",l,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},ko=ft("//","$"),No=ft("/\\*","\\*/"),wo=ft("#","$"),_o={scope:"number",begin:hn,relevance:0},So={scope:"number",begin:bn,relevance:0},Mo={scope:"number",begin:yn,relevance:0},Co={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Je,{begin:/\[/,end:/\]/,relevance:0,contains:[Je]}]},vo={scope:"title",begin:pn,relevance:0},To={scope:"title",begin:Dt,relevance:0},Ao={begin:"\\.\\s*"+Dt,relevance:0};var gt=Object.freeze({__proto__:null,APOS_STRING_MODE:yo,BACKSLASH_ESCAPE:Je,BINARY_NUMBER_MODE:Mo,BINARY_NUMBER_RE:yn,COMMENT:ft,C_BLOCK_COMMENT_MODE:No,C_LINE_COMMENT_MODE:ko,C_NUMBER_MODE:So,C_NUMBER_RE:bn,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(a,n)=>{n.data._beginMatch=a[1]},"on:end":(a,n)=>{n.data._beginMatch!==a[1]&&n.ignoreMatch()}})},HASH_COMMENT_MODE:wo,IDENT_RE:pn,MATCH_NOTHING_RE:po,METHOD_GUARD:Ao,NUMBER_MODE:_o,NUMBER_RE:hn,PHRASAL_WORDS_MODE:xo,QUOTE_STRING_MODE:Eo,REGEXP_MODE:Co,RE_STARTERS_RE:ho,SHEBANG:bo,TITLE_MODE:vo,UNDERSCORE_IDENT_RE:Dt,UNDERSCORE_TITLE_MODE:To});function Ro(e,a){e.input[e.index-1]==="."&&a.ignoreMatch()}function Oo(e,a){e.className!==void 0&&(e.scope=e.className,delete e.className)}function Io(e,a){a&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=Ro,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function Bo(e,a){Array.isArray(e.illegal)&&(e.illegal=Bt(...e.illegal))}function Lo(e,a){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function Do(e,a){e.relevance===void 0&&(e.relevance=1)}const zo=(e,a)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},e);Object.keys(e).forEach(r=>{delete e[r]}),e.keywords=n.keywords,e.begin=Le(n.beforeMatch,gn(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},$o=["of","and","for","in","not","or","if","then","parent","list","value"],Po="keyword";function En(e,a,n=Po){const r=Object.create(null);return typeof e=="string"?l(n,e.split(" ")):Array.isArray(e)?l(n,e):Object.keys(e).forEach(function(f){Object.assign(r,En(e[f],a,f))}),r;function l(f,s){a&&(s=s.map(c=>c.toLowerCase())),s.forEach(function(c){const d=c.split("|");r[d[0]]=[f,Vo(d[0],d[1])]})}}function Vo(e,a){return a?Number(a):Uo(e)?0:1}function Uo(e){return $o.includes(e.toLowerCase())}const xn={},De=e=>{console.error(e)},kn=(e,...a)=>{console.log(`WARN: ${e}`,...a)},Ve=(e,a)=>{xn[`${e}/${a}`]||(console.log(`Deprecated as of ${e}. ${a}`),xn[`${e}/${a}`]=!0)},mt=new Error;function Nn(e,a,{key:n}){let r=0;const l=e[n],f={},s={};for(let c=1;c<=a.length;c++)s[c+r]=l[c],f[c+r]=!0,r+=mn(a[c-1]);e[n]=s,e[n]._emit=f,e[n]._multi=!0}function Ho(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw De("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),mt;if(typeof e.beginScope!="object"||e.beginScope===null)throw De("beginScope must be object"),mt;Nn(e,e.begin,{key:"beginScope"}),e.begin=Lt(e.begin,{joinWith:""})}}function Fo(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw De("skip, excludeEnd, returnEnd not compatible with endScope: {}"),mt;if(typeof e.endScope!="object"||e.endScope===null)throw De("endScope must be object"),mt;Nn(e,e.end,{key:"endScope"}),e.end=Lt(e.end,{joinWith:""})}}function Wo(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function Go(e){Wo(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),Ho(e),Fo(e)}function Ko(e){function a(s,c){return new RegExp(je(s),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(c?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(c,d){d.position=this.position++,this.matchIndexes[this.matchAt]=d,this.regexes.push([d,c]),this.matchAt+=mn(c)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const c=this.regexes.map(d=>d[1]);this.matcherRe=a(Lt(c,{joinWith:"|"}),!0),this.lastIndex=0}exec(c){this.matcherRe.lastIndex=this.lastIndex;const d=this.matcherRe.exec(c);if(!d)return null;const g=d.findIndex((b,k)=>k>0&&b!==void 0),x=this.matchIndexes[g];return d.splice(0,g),Object.assign(d,x)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(c){if(this.multiRegexes[c])return this.multiRegexes[c];const d=new n;return this.rules.slice(c).forEach(([g,x])=>d.addRule(g,x)),d.compile(),this.multiRegexes[c]=d,d}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(c,d){this.rules.push([c,d]),d.type==="begin"&&this.count++}exec(c){const d=this.getMatcher(this.regexIndex);d.lastIndex=this.lastIndex;let g=d.exec(c);if(this.resumingScanAtSamePosition()&&!(g&&g.index===this.lastIndex)){const x=this.getMatcher(0);x.lastIndex=this.lastIndex+1,g=x.exec(c)}return g&&(this.regexIndex+=g.position+1,this.regexIndex===this.count&&this.considerAll()),g}}function l(s){const c=new r;return s.contains.forEach(d=>c.addRule(d.begin,{rule:d,type:"begin"})),s.terminatorEnd&&c.addRule(s.terminatorEnd,{type:"end"}),s.illegal&&c.addRule(s.illegal,{type:"illegal"}),c}function f(s,c){const d=s;if(s.isCompiled)return d;[Oo,Lo,Go,zo].forEach(x=>x(s,c)),e.compilerExtensions.forEach(x=>x(s,c)),s.__beforeBegin=null,[Io,Bo,Do].forEach(x=>x(s,c)),s.isCompiled=!0;let g=null;return typeof s.keywords=="object"&&s.keywords.$pattern&&(s.keywords=Object.assign({},s.keywords),g=s.keywords.$pattern,delete s.keywords.$pattern),g=g||/\w+/,s.keywords&&(s.keywords=En(s.keywords,e.case_insensitive)),d.keywordPatternRe=a(g,!0),c&&(s.begin||(s.begin=/\B|\b/),d.beginRe=a(d.begin),!s.end&&!s.endsWithParent&&(s.end=/\B|\b/),s.end&&(d.endRe=a(d.end)),d.terminatorEnd=je(d.end)||"",s.endsWithParent&&c.terminatorEnd&&(d.terminatorEnd+=(s.end?"|":"")+c.terminatorEnd)),s.illegal&&(d.illegalRe=a(s.illegal)),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map(function(x){return Yo(x==="self"?s:x)})),s.contains.forEach(function(x){f(x,d)}),s.starts&&f(s.starts,c),d.matcher=l(d),d}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=Ie(e.classNameAliases||{}),f(e)}function wn(e){return e?e.endsWithParent||wn(e.starts):!1}function Yo(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(a){return Ie(e,{variants:null},a)})),e.cachedVariants?e.cachedVariants:wn(e)?Ie(e,{starts:e.starts?Ie(e.starts):null}):Object.isFrozen(e)?Ie(e):e}var Zo="11.11.1";class Xo extends Error{constructor(a,n){super(a),this.name="HTMLInjectionError",this.html=n}}const zt=dn,_n=Ie,Sn=Symbol("nomatch"),qo=7,Mn=function(e){const a=Object.create(null),n=Object.create(null),r=[];let l=!0;const f="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]};let c={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:so};function d(E){return c.noHighlightRe.test(E)}function g(E){let v=E.className+" ";v+=E.parentNode?E.parentNode.className:"";const M=c.languageDetectRe.exec(v);if(M){const T=ee(M[1]);return T||(kn(f.replace("{}",M[1])),kn("Falling back to no-highlight mode for this block.",E)),T?M[1]:"no-highlight"}return v.split(/\s+/).find(T=>d(T)||ee(T))}function x(E,v,M){let T="",U="";typeof v=="object"?(T=E,M=v.ignoreIllegals,U=v.language):(Ve("10.7.0","highlight(lang, code, ...args) has been deprecated."),Ve("10.7.0",`Please use highlight(code, options) instead.
14
+ https://github.com/highlightjs/highlight.js/issues/2277`),U=E,T=v),M===void 0&&(M=!0);const ne={code:T,language:U};ie("before:highlight",ne);const ge=ne.result?ne.result:b(ne.language,ne.code,M);return ge.code=ne.code,ie("after:highlight",ge),ge}function b(E,v,M,T){const U=Object.create(null);function ne(S,R){return S.keywords[R]}function ge(){if(!D.keywords){le.addText(Y);return}let S=0;D.keywordPatternRe.lastIndex=0;let R=D.keywordPatternRe.exec(Y),V="";for(;R;){V+=Y.substring(S,R.index);const Z=ke.case_insensitive?R[0].toLowerCase():R[0],se=ne(D,Z);if(se){const[he,Me]=se;if(le.addText(V),V="",U[Z]=(U[Z]||0)+1,U[Z]<=qo&&(Ge+=Me),he.startsWith("_"))V+=R[0];else{const ce=ke.classNameAliases[he]||he;xe(R[0],ce)}}else V+=R[0];S=D.keywordPatternRe.lastIndex,R=D.keywordPatternRe.exec(Y)}V+=Y.substring(S),le.addText(V)}function Ee(){if(Y==="")return;let S=null;if(typeof D.subLanguage=="string"){if(!a[D.subLanguage]){le.addText(Y);return}S=b(D.subLanguage,Y,!0,Nt[D.subLanguage]),Nt[D.subLanguage]=S._top}else S=h(Y,D.subLanguage.length?D.subLanguage:null);D.relevance>0&&(Ge+=S.relevance),le.__addSublanguage(S._emitter,S.language)}function me(){D.subLanguage!=null?Ee():ge(),Y=""}function xe(S,R){S!==""&&(le.startScope(R),le.addText(S),le.endScope())}function yt(S,R){let V=1;const Z=R.length-1;for(;V<=Z;){if(!S._emit[V]){V++;continue}const se=ke.classNameAliases[S[V]]||S[V],he=R[V];se?xe(he,se):(Y=he,ge(),Y=""),V++}}function Et(S,R){return S.scope&&typeof S.scope=="string"&&le.openNode(ke.classNameAliases[S.scope]||S.scope),S.beginScope&&(S.beginScope._wrap?(xe(Y,ke.classNameAliases[S.beginScope._wrap]||S.beginScope._wrap),Y=""):S.beginScope._multi&&(yt(S.beginScope,R),Y="")),D=Object.create(S,{parent:{value:D}}),D}function xt(S,R,V){let Z=go(S.endRe,V);if(Z){if(S["on:end"]){const se=new cn(S);S["on:end"](R,se),se.isMatchIgnored&&(Z=!1)}if(Z){for(;S.endsParent&&S.parent;)S=S.parent;return S}}if(S.endsWithParent)return xt(S.parent,R,V)}function Ut(S){return D.matcher.regexIndex===0?(Y+=S[0],1):(Ye=!0,0)}function Ht(S){const R=S[0],V=S.rule,Z=new cn(V),se=[V.__beforeBegin,V["on:begin"]];for(const he of se)if(he&&(he(S,Z),Z.isMatchIgnored))return Ut(R);return V.skip?Y+=R:(V.excludeBegin&&(Y+=R),me(),!V.returnBegin&&!V.excludeBegin&&(Y=R)),Et(V,S),V.returnBegin?0:R.length}function Ft(S){const R=S[0],V=v.substring(S.index),Z=xt(D,S,V);if(!Z)return Sn;const se=D;D.endScope&&D.endScope._wrap?(me(),xe(R,D.endScope._wrap)):D.endScope&&D.endScope._multi?(me(),yt(D.endScope,S)):se.skip?Y+=R:(se.returnEnd||se.excludeEnd||(Y+=R),me(),se.excludeEnd&&(Y=R));do D.scope&&le.closeNode(),!D.skip&&!D.subLanguage&&(Ge+=D.relevance),D=D.parent;while(D!==Z.parent);return Z.starts&&Et(Z.starts,S),se.returnEnd?0:R.length}function Wt(){const S=[];for(let R=D;R!==ke;R=R.parent)R.scope&&S.unshift(R.scope);S.forEach(R=>le.openNode(R))}let We={};function Qe(S,R){const V=R&&R[0];if(Y+=S,V==null)return me(),0;if(We.type==="begin"&&R.type==="end"&&We.index===R.index&&V===""){if(Y+=v.slice(R.index,R.index+1),!l){const Z=new Error(`0 width match regex (${E})`);throw Z.languageName=E,Z.badRule=We.rule,Z}return 1}if(We=R,R.type==="begin")return Ht(R);if(R.type==="illegal"&&!M){const Z=new Error('Illegal lexeme "'+V+'" for mode "'+(D.scope||"<unnamed>")+'"');throw Z.mode=D,Z}else if(R.type==="end"){const Z=Ft(R);if(Z!==Sn)return Z}if(R.type==="illegal"&&V==="")return Y+=`
15
+ `,1;if(Ke>1e5&&Ke>R.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Y+=V,V.length}const ke=ee(E);if(!ke)throw De(f.replace("{}",E)),new Error('Unknown language: "'+E+'"');const kt=Ko(ke);let et="",D=T||kt;const Nt={},le=new c.__emitter(c);Wt();let Y="",Ge=0,Ae=0,Ke=0,Ye=!1;try{if(ke.__emitTokens)ke.__emitTokens(v,le);else{for(D.matcher.considerAll();;){Ke++,Ye?Ye=!1:D.matcher.considerAll(),D.matcher.lastIndex=Ae;const S=D.matcher.exec(v);if(!S)break;const R=v.substring(Ae,S.index),V=Qe(R,S);Ae=S.index+V}Qe(v.substring(Ae))}return le.finalize(),et=le.toHTML(),{language:E,value:et,relevance:Ge,illegal:!1,_emitter:le,_top:D}}catch(S){if(S.message&&S.message.includes("Illegal"))return{language:E,value:zt(v),illegal:!0,relevance:0,_illegalBy:{message:S.message,index:Ae,context:v.slice(Ae-100,Ae+100),mode:S.mode,resultSoFar:et},_emitter:le};if(l)return{language:E,value:zt(v),illegal:!1,relevance:0,errorRaised:S,_emitter:le,_top:D};throw S}}function k(E){const v={value:zt(E),illegal:!1,relevance:0,_top:s,_emitter:new c.__emitter(c)};return v._emitter.addText(E),v}function h(E,v){v=v||c.languages||Object.keys(a);const M=k(E),T=v.filter(ee).filter(G).map(me=>b(me,E,!1));T.unshift(M);const U=T.sort((me,xe)=>{if(me.relevance!==xe.relevance)return xe.relevance-me.relevance;if(me.language&&xe.language){if(ee(me.language).supersetOf===xe.language)return 1;if(ee(xe.language).supersetOf===me.language)return-1}return 0}),[ne,ge]=U,Ee=ne;return Ee.secondBest=ge,Ee}function m(E,v,M){const T=v&&n[v]||M;E.classList.add("hljs"),E.classList.add(`language-${T}`)}function O(E){let v=null;const M=g(E);if(d(M))return;if(ie("before:highlightElement",{el:E,language:M}),E.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",E);return}if(E.children.length>0&&(c.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(E)),c.throwUnescapedHTML))throw new Xo("One of your code blocks includes unescaped HTML.",E.innerHTML);v=E;const T=v.textContent,U=M?x(T,{language:M,ignoreIllegals:!0}):h(T);E.innerHTML=U.value,E.dataset.highlighted="yes",m(E,M,U.language),E.result={language:U.language,re:U.relevance,relevance:U.relevance},U.secondBest&&(E.secondBest={language:U.secondBest.language,relevance:U.secondBest.relevance}),ie("after:highlightElement",{el:E,result:U,text:T})}function C(E){c=_n(c,E)}const N=()=>{P(),Ve("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function F(){P(),Ve("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let I=!1;function P(){function E(){P()}if(document.readyState==="loading"){I||window.addEventListener("DOMContentLoaded",E,!1),I=!0;return}document.querySelectorAll(c.cssSelector).forEach(O)}function z(E,v){let M=null;try{M=v(e)}catch(T){if(De("Language definition for '{}' could not be registered.".replace("{}",E)),l)De(T);else throw T;M=s}M.name||(M.name=E),a[E]=M,M.rawDefinition=v.bind(null,e),M.aliases&&ae(M.aliases,{languageName:E})}function L(E){delete a[E];for(const v of Object.keys(n))n[v]===E&&delete n[v]}function J(){return Object.keys(a)}function ee(E){return E=(E||"").toLowerCase(),a[E]||a[n[E]]}function ae(E,{languageName:v}){typeof E=="string"&&(E=[E]),E.forEach(M=>{n[M.toLowerCase()]=v})}function G(E){const v=ee(E);return v&&!v.disableAutodetect}function Q(E){E["before:highlightBlock"]&&!E["before:highlightElement"]&&(E["before:highlightElement"]=v=>{E["before:highlightBlock"](Object.assign({block:v.el},v))}),E["after:highlightBlock"]&&!E["after:highlightElement"]&&(E["after:highlightElement"]=v=>{E["after:highlightBlock"](Object.assign({block:v.el},v))})}function re(E){Q(E),r.push(E)}function ue(E){const v=r.indexOf(E);v!==-1&&r.splice(v,1)}function ie(E,v){const M=E;r.forEach(function(T){T[M]&&T[M](v)})}function fe(E){return Ve("10.7.0","highlightBlock will be removed entirely in v12.0"),Ve("10.7.0","Please use highlightElement now."),O(E)}Object.assign(e,{highlight:x,highlightAuto:h,highlightAll:P,highlightElement:O,highlightBlock:fe,configure:C,initHighlighting:N,initHighlightingOnLoad:F,registerLanguage:z,unregisterLanguage:L,listLanguages:J,getLanguage:ee,registerAliases:ae,autoDetection:G,inherit:_n,addPlugin:re,removePlugin:ue}),e.debugMode=function(){l=!1},e.safeMode=function(){l=!0},e.versionString=Zo,e.regex={concat:Le,lookahead:gn,either:Bt,optional:uo,anyNumberOfTimes:co};for(const E in gt)typeof gt[E]=="object"&&sn(gt[E]);return Object.assign(e,gt),e},Ue=Mn({});Ue.newInstance=()=>Mn({});var jo=Ue;Ue.HighlightJS=Ue,Ue.default=Ue;const $t=oo(jo);function Pt(e){const a=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:a.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const l={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},f=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),s={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},c={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,l]};l.contains.push(c);const d={match:/\\"/},g={className:"string",begin:/'/,end:/'/},x={match:/\\'/},b={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},k=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],h=e.SHEBANG({binary:`(${k.join("|")})`,relevance:10}),m={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},O=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],C=["true","false"],N={match:/(\/[a-z._-]+)+/},F=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],I=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],P=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],z=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:O,literal:C,built_in:[...F,...I,"set","shopt",...P,...z]},contains:[h,e.SHEBANG(),m,b,f,s,N,c,d,g,x,n]}}const Jo=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),Qo=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],er=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],tr=[...Qo,...er],nr=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),ir=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),or=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),rr=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function ar(e){const a=e.regex,n=Jo(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},l="and or not only",f=/@-?\w[\w]*(-\w+)*/,s="[a-zA-Z-][a-zA-Z0-9_-]*",c=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+s,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+ir.join("|")+")"},{begin:":(:)?("+or.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+rr.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...c,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...c,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:a.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:f},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:l,attribute:nr.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...c,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+tr.join("|")+")\\b"}]}}function Cn(e){const f={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:f,illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"string",variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[e.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:f,illegal:/["']/}]}]}}var He="[0-9](_*[0-9])*",pt=`\\.(${He})`,ht="[0-9a-fA-F](_*[0-9a-fA-F])*",vn={className:"number",variants:[{begin:`(\\b(${He})((${pt})|\\.)?|(${pt}))[eE][+-]?(${He})[fFdD]?\\b`},{begin:`\\b(${He})((${pt})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${pt})[fFdD]?\\b`},{begin:`\\b(${He})[fFdD]\\b`},{begin:`\\b0[xX]((${ht})\\.?|(${ht})?\\.(${ht}))[pP][+-]?(${He})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${ht})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Tn(e,a,n){return n===-1?"":e.replace(a,r=>Tn(e,a,n-1))}function lr(e){const a=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=n+Tn("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),d={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},g={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},x={className:"params",begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:d,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[a.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[x,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:d,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[g,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,vn,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},vn,g]}}const An="[A-Za-z$_][0-9A-Za-z$_]*",sr=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],cr=["true","false","null","undefined","NaN","Infinity"],Rn=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],On=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],In=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],dr=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],ur=[].concat(In,Rn,On);function Bn(e){const a=e.regex,n=(M,{after:T})=>{const U="</"+M[0].slice(1);return M.input.indexOf(U,T)!==-1},r=An,l={begin:"<>",end:"</>"},f=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(M,T)=>{const U=M[0].length+M.index,ne=M.input[U];if(ne==="<"||ne===","){T.ignoreMatch();return}ne===">"&&(n(M,{after:U})||T.ignoreMatch());let ge;const Ee=M.input.substring(U);if(ge=Ee.match(/^\s*=/)){T.ignoreMatch();return}if((ge=Ee.match(/^\s+extends\s+/))&&ge.index===0){T.ignoreMatch();return}}},c={$pattern:An,keyword:sr,literal:cr,built_in:ur,"variable.language":dr},d="[0-9](_?[0-9])*",g=`\\.(${d})`,x="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",b={className:"number",variants:[{begin:`(\\b(${x})((${g})|\\.)?|(${g}))[eE][+-]?(${d})\\b`},{begin:`\\b(${x})\\b((${g})\\b|\\.)?|(${g})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},k={className:"subst",begin:"\\$\\{",end:"\\}",keywords:c,contains:[]},h={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,k],subLanguage:"xml"}},m={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,k],subLanguage:"css"}},O={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,k],subLanguage:"graphql"}},C={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,k]},F={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},I=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,m,O,C,{match:/\$\d+/},b];k.contains=I.concat({begin:/\{/,end:/\}/,keywords:c,contains:["self"].concat(I)});const P=[].concat(F,k.contains),z=P.concat([{begin:/(\s*)\(/,end:/\)/,keywords:c,contains:["self"].concat(P)}]),L={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:z},J={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,a.concat(r,"(",a.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},ee={relevance:0,match:a.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Rn,...On]}},ae={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},G={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[L],illegal:/%/},Q={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function re(M){return a.concat("(?!",M.join("|"),")")}const ue={match:a.concat(/\b/,re([...In,"super","import"].map(M=>`${M}\\s*\\(`)),r,a.lookahead(/\s*\(/)),className:"title.function",relevance:0},ie={begin:a.concat(/\./,a.lookahead(a.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},fe={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},L]},E="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",v={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,a.lookahead(E)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[L]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:c,exports:{PARAMS_CONTAINS:z,CLASS_REFERENCE:ee},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),ae,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,m,O,C,F,{match:/\$\d+/},b,ee,{scope:"attr",match:r+a.lookahead(":"),relevance:0},v,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[F,e.REGEXP_MODE,{className:"function",begin:E,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:z}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:l.begin,end:l.end},{match:f},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},G,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[L,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},ie,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[L]},ue,Q,J,fe,{match:/\$[(.]/}]}}function fr(e){const a={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],l={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[a,n,e.QUOTE_STRING_MODE,l,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function Ln(e){const a=e.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},l={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},f={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},s={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},c=/[A-Za-z][A-Za-z0-9+.-]*/,d={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:a.concat(/\[.+?\]\(/,c,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},g={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},x={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},b=e.inherit(g,{contains:[]}),k=e.inherit(x,{contains:[]});g.contains.push(k),x.contains.push(b);let h=[n,d];return[g,x,b,k].forEach(N=>{N.contains=N.contains.concat(h)}),h=h.concat(g,x),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:h},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:h}]}]},n,f,g,x,{className:"quote",begin:"^>\\s+",contains:h,end:"$"},l,r,d,s,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function Dn(e){const a=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],c={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},d={className:"meta",begin:/^(>>>|\.\.\.) /},g={className:"subst",begin:/\{/,end:/\}/,keywords:c,illegal:/#/},x={begin:/\{\{/,relevance:0},b={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,d],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,d],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,d,x,g]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,d,x,g]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,x,g]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,x,g]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},k="[0-9](_?[0-9])*",h=`(\\b(${k}))?\\.(${k})|\\b(${k})\\.`,m=`\\b|${r.join("|")}`,O={className:"number",relevance:0,variants:[{begin:`(\\b(${k})|(${h}))[eE][+-]?(${k})[jJ]?(?=${m})`},{begin:`(${h})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${m})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${m})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${m})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${m})`},{begin:`\\b(${k})[jJ](?=${m})`}]},C={className:"comment",begin:a.lookahead(/# type:/),end:/$/,keywords:c,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},N={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:["self",d,O,b,e.HASH_COMMENT_MODE]}]};return g.contains=[b,O,d],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:c,illegal:/(<\/|\?)|=>/,contains:[d,O,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},b,C,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[N]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[O,N,b]}]}}function zn(e){const a=e.regex,n=/(r#)?/,r=a.concat(n,e.UNDERSCORE_IDENT_RE),l=a.concat(n,e.IDENT_RE),f={className:"title.function.invoke",relevance:0,begin:a.concat(/\b/,/(?!let|for|while|if|else|match\b)/,l,a.lookahead(/\s*\(/))},s="([ui](8|16|32|64|128|size)|f(32|64))?",c=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],d=["true","false","Some","None","Ok","Err"],g=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],x=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:x,keyword:c,literal:d,built_in:g},illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{contains:["self"]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+s},{begin:"\\b0o([0-7_]+)"+s},{begin:"\\b0x([A-Fa-f0-9_]+)"+s},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+s}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,r,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:g,type:x}},{className:"punctuation",begin:"->"},f]}}function gr(e){const a=e.regex,n=e.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},l={begin:/"/,end:/"/,contains:[{match:/""/}]},f=["true","false","unknown"],s=["double precision","large object","with timezone","without timezone"],c=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],d=["add","asc","collation","desc","final","first","last","view"],g=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],x=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],b=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],k=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],h=x,m=[...g,...d].filter(z=>!x.includes(z)),O={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},C={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},N={match:a.concat(/\b/,a.either(...h),/\s*\(/),relevance:0,keywords:{built_in:h}};function F(z){return a.concat(/\b/,a.either(...z.map(L=>L.replace(/\s+/,"\\s+"))),/\b/)}const I={scope:"keyword",match:F(k),relevance:0};function P(z,{exceptions:L,when:J}={}){const ee=J;return L=L||[],z.map(ae=>ae.match(/\|\d+$/)||L.includes(ae)?ae:ee(ae)?`${ae}|0`:ae)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:P(m,{when:z=>z.length<3}),literal:f,type:c,built_in:b},contains:[{scope:"type",match:F(s)},I,N,O,r,l,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,C]}}const bt="[A-Za-z$_][0-9A-Za-z$_]*",$n=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],Pn=["true","false","null","undefined","NaN","Infinity"],Vn=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Un=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Hn=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Fn=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Wn=[].concat(Hn,Vn,Un);function mr(e){const a=e.regex,n=(M,{after:T})=>{const U="</"+M[0].slice(1);return M.input.indexOf(U,T)!==-1},r=bt,l={begin:"<>",end:"</>"},f=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(M,T)=>{const U=M[0].length+M.index,ne=M.input[U];if(ne==="<"||ne===","){T.ignoreMatch();return}ne===">"&&(n(M,{after:U})||T.ignoreMatch());let ge;const Ee=M.input.substring(U);if(ge=Ee.match(/^\s*=/)){T.ignoreMatch();return}if((ge=Ee.match(/^\s+extends\s+/))&&ge.index===0){T.ignoreMatch();return}}},c={$pattern:bt,keyword:$n,literal:Pn,built_in:Wn,"variable.language":Fn},d="[0-9](_?[0-9])*",g=`\\.(${d})`,x="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",b={className:"number",variants:[{begin:`(\\b(${x})((${g})|\\.)?|(${g}))[eE][+-]?(${d})\\b`},{begin:`\\b(${x})\\b((${g})\\b|\\.)?|(${g})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},k={className:"subst",begin:"\\$\\{",end:"\\}",keywords:c,contains:[]},h={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,k],subLanguage:"xml"}},m={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,k],subLanguage:"css"}},O={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,k],subLanguage:"graphql"}},C={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,k]},F={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},I=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,m,O,C,{match:/\$\d+/},b];k.contains=I.concat({begin:/\{/,end:/\}/,keywords:c,contains:["self"].concat(I)});const P=[].concat(F,k.contains),z=P.concat([{begin:/(\s*)\(/,end:/\)/,keywords:c,contains:["self"].concat(P)}]),L={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:z},J={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,a.concat(r,"(",a.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},ee={relevance:0,match:a.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Vn,...Un]}},ae={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},G={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[L],illegal:/%/},Q={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function re(M){return a.concat("(?!",M.join("|"),")")}const ue={match:a.concat(/\b/,re([...Hn,"super","import"].map(M=>`${M}\\s*\\(`)),r,a.lookahead(/\s*\(/)),className:"title.function",relevance:0},ie={begin:a.concat(/\./,a.lookahead(a.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},fe={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},L]},E="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",v={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,a.lookahead(E)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[L]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:c,exports:{PARAMS_CONTAINS:z,CLASS_REFERENCE:ee},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),ae,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,m,O,C,F,{match:/\$\d+/},b,ee,{scope:"attr",match:r+a.lookahead(":"),relevance:0},v,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[F,e.REGEXP_MODE,{className:"function",begin:E,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:z}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:l.begin,end:l.end},{match:f},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},G,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[L,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},ie,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[L]},ue,Q,J,fe,{match:/\$[(.]/}]}}function Gn(e){const a=e.regex,n=mr(e),r=bt,l=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],f={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},s={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:l},contains:[n.exports.CLASS_REFERENCE]},c={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},d=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],g={$pattern:bt,keyword:$n.concat(d),literal:Pn,built_in:Wn.concat(l),"variable.language":Fn},x={className:"meta",begin:"@"+r},b=(O,C,N)=>{const F=O.contains.findIndex(I=>I.label===C);if(F===-1)throw new Error("can not find mode to replace");O.contains.splice(F,1,N)};Object.assign(n.keywords,g),n.exports.PARAMS_CONTAINS.push(x);const k=n.contains.find(O=>O.scope==="attr"),h=Object.assign({},k,{match:a.concat(r,a.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,k,h]),n.contains=n.contains.concat([x,f,s,h]),b(n,"shebang",e.SHEBANG()),b(n,"use_strict",c);const m=n.contains.find(O=>O.label==="func.def");return m.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function Kn(e){const a=e.regex,n=a.concat(/[\p{L}_]/u,a.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,l={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},f={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},s=e.inherit(f,{begin:/\(/,end:/\)/}),c=e.inherit(e.APOS_STRING_MODE,{className:"string"}),d=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),g={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[l]},{begin:/'/,end:/'/,contains:[l]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[f,d,c,s,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[f,s,d,c]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},l,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[d]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[g],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[g],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:a.concat(/</,a.lookahead(a.concat(n,a.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:g}]},{className:"tag",begin:a.concat(/<\//,a.lookahead(a.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function Yn(e){const a="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},l={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},f={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},s={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,l]},c=e.inherit(s,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),k={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},h={end:",",endsWithParent:!0,excludeEnd:!0,keywords:a,relevance:0},m={begin:/\{/,end:/\}/,contains:[h],illegal:"\\n",relevance:0},O={begin:"\\[",end:"\\]",contains:[h],illegal:"\\n",relevance:0},C=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:a,keywords:{literal:a}},k,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},m,O,f,s],N=[...C];return N.pop(),N.push(c),h.contains=N,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:C}}const Vt={bash:Pt,sh:Pt,shell:Pt,css:ar,go:Cn,golang:Cn,java:lr,javascript:Bn,js:Bn,json:fr,markdown:Ln,md:Ln,python:Dn,py:Dn,rust:zn,rs:zn,sql:gr,typescript:Gn,ts:Gn,xml:Kn,html:Kn,yaml:Yn,yml:Yn};for(const[e,a]of Object.entries(Vt))$t.registerLanguage(e,a);function Zn(e){const a=e.split(`
16
16
  `);return/^(`{3,}|~{3,})/.test(a[0]??"")&&a.shift(),/^(`{3,}|~{3,})\s*$/.test(a[a.length-1]??"")&&a.pop(),a.join(`
17
- `).replace(/\n+$/,"")}function Zn(e){const a=/^(`{3,}|~{3,})([^\s`~]*)/.exec(e.split(`
18
- `)[0]??""),i=((a==null?void 0:a[2])??"").toLowerCase();return i&&Pt[i]?i:""}function mr(e,a){const i=a&&Pt[a]?a:"";try{return i?zt.highlight(e,{language:i,ignoreIllegals:!0}).value:zt.highlightAuto(e).value}catch{return hr(e)}}function pr(e){return e.split(`
19
- `).filter(a=>a.trim().length>0).filter(a=>!/^\s*\|?\s*(:?-+:?\s*\|\s*)+(:?-+:?)(\s*\|)?\s*$/.test(a)).map(a=>a.replace(/^\s*\|/,"").replace(/\|\s*$/,"").split("|").map(i=>i.trim()))}function hr(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function br(e,a,i){if(e.length<=1)return e.slice();const[r,...l]=e,f=l.map(g=>g[a]??""),s=f.length>0&&f.every(g=>g.trim()!==""&&!Number.isNaN(Number(g))),c=i==="asc"?1:-1,u=l.slice().sort((g,y)=>{const b=g[a]??"",k=y[a]??"";return s?(Number(b)-Number(k))*c:b.localeCompare(k,"zh-Hans-CN",{numeric:!0})*c});return[r,...u]}const yr=["viewBox","width","height"],Er={class:"zm-edges"},xr=["d","fill"],kr=["data-node-id","onClick","onDblclick","onContextmenu","onMouseenter","onMouseleave"],wr=["src","width","height","alt"],Nr=["onDblclick"],_r={key:0,class:"zm-rich-code"},Sr=["innerHTML"],Mr={key:1,class:"zm-rich-table"},vr=["onClick"],Cr={class:"zm-rich-sort-mark","aria-hidden":"true"},Tr={key:2,class:"zm-text"},Ar={class:"zm-text-label"},Rr=["href","title"],Or=["title","onClick"],Ir=["title"],Br=["title","onClick"],Lr=["onClick"],Dr=["onMousedown"],zr=["onClick"],$r={class:"zm-tb-tip zm-tb-zoom"},Pr=["src"],Ur=["src"],De=24,Ge=400,Oe=160,Xn=t.defineComponent({__name:"MindMap",props:{data:{},theme:{},previewMode:{type:Boolean,default:!1},markdown:{},lineColors:{}},emits:["change","select","edit-note","markdownChange","canvas-settings"],setup(e,{expose:a,emit:i}){const r=e,l=i,f=t.ref(null),s=t.ref(null),c=t.ref(""),u=t.ref(null),g=t.ref(new Set),y=t.ref(!1),b=t.ref(null),k=t.ref(""),h=t.ref(new Map),m=t.ref(Ce(r.data)),L=t.ref({}),K=t.ref({}),_=t.ref(r.markdown!==void 0);let F=!1;t.watch(()=>r.markdown,n=>{if(n===void 0){_.value=!1;return}_.value=!0;const o=Rt(n||"");F=!0,m.value=Ce(o),u.value=null,g.value=new Set,X(),t.nextTick(()=>{F=!1,Te()})}),t.watch(m,()=>{_.value&&!F&&l("markdownChange",dt(m.value))},{deep:!0});const O=t.computed(()=>R.showOrderBadge===!0),$=t.ref(new Map),D=$.value;function I(n,o){const d={};o.bg&&(d.bg=o.bg),o.textColor&&(d.textColor=o.textColor),o.borderColor&&(d.borderColor=o.borderColor),o.fontWeight&&(d.fontWeight=o.fontWeight),Object.keys(d).length===0?D.delete(n):D.set(n,d),$.value=new Map(D)}function j(n){return D.get(n)??{}}function te(n,o){const d=H(m.value,n);d&&(d.image={src:o.src,naturalW:o.naturalW,naturalH:o.naturalH,width:J(o.width,De,Ge),height:J(o.height,De,Ge)},ee(),X(),l("change",m.value))}function se(n){const o=H(m.value,n);!o||!o.image||(delete o.image,ee(),X(),l("change",m.value))}function W(n,o){const d=o.trim();if(!H(m.value,n))return;if(!d){se(n);return}const E=new Image;E.onload=()=>{const N=H(m.value,n);if(!N)return;const T=E.naturalWidth&&E.naturalHeight?E.naturalWidth/E.naturalHeight:1,z=J(E.naturalWidth||Oe,De,Ge),q=Math.round(z/T);N.image={src:d,naturalW:E.naturalWidth||z,naturalH:E.naturalHeight||q,width:z,height:q},ee(),X(),l("change",m.value)},E.onerror=()=>{},E.src=d}function J(n,o,d){return Math.min(d,Math.max(o,n))}function le(n,o){const d=new FileReader;d.onload=()=>{if(typeof d.result!="string")return;const w=d.result,E=new window.Image;E.onload=()=>{const N=E.naturalWidth||Oe,T=E.naturalHeight||Oe,z=J(N,De,Oe),q=J(Math.round(T*z/N),De,Ge);o({src:w,naturalW:N,naturalH:T,width:z,height:q})},E.onerror=()=>{o({src:w,naturalW:Oe,naturalH:Oe,width:Oe,height:Oe})},E.src=w},d.readAsDataURL(n)}function de(n){const o=document.createElement("input");o.type="file",o.accept="image/*",o.style.display="none",o.onchange=()=>{var w;const d=(w=o.files)==null?void 0:w[0];d&&(le(d,E=>te(n,E)),document.body.removeChild(o))},document.body.appendChild(o),o.click()}function re(n,o){const d=o.trim(),w=H(m.value,n);w&&(d?w.link={url:d}:delete w.link,ee(),X(),l("change",m.value))}function fe(n){re(n,"")}function x(n,o){const d=H(m.value,n);d&&(o?d.note={text:o}:delete d.note,ee(),X(),l("change",m.value))}function v(n){x(n,"")}function S(n,o){const d=H(m.value,n);d&&(o?d.richContent=o:delete d.richContent,ee(),X(),l("change",m.value))}const C=t.ref(null),V=t.ref(null);function oe(n,o){r.previewMode||(n.preventDefault(),n.stopPropagation(),u.value=o.id,l("select",H(m.value,o.id)),C.value={nodeId:o.id,x:n.clientX,y:n.clientY})}function ge(){C.value=null}function ye(n){r.previewMode||(n.preventDefault(),C.value=null,V.value={x:n.clientX,y:n.clientY})}function me(){V.value=null}function Ee(){V.value=null,l("canvas-settings")}function bt(){var o;const n=(o=C.value)==null?void 0:o.nodeId;n&&de(n)}function yt(){var w,E,N;const n=(w=C.value)==null?void 0:w.nodeId;if(!n)return;const o=((N=(E=H(m.value,n))==null?void 0:E.link)==null?void 0:N.url)??"",d=window.prompt("输入链接 URL(留空取消)",o);d!==null&&re(n,d)}function Et(){var o;const n=(o=C.value)==null?void 0:o.nodeId;n&&fe(n)}function Ut(){var o;const n=(o=C.value)==null?void 0:o.nodeId;n&&kt(n)}function Vt(){var o;const n=(o=C.value)==null?void 0:o.nodeId;n&&v(n)}function Ht(){var o;const n=(o=C.value)==null?void 0:o.nodeId;n&&se(n)}function xt(){var G,ke;const n=(G=C.value)==null?void 0:G.nodeId;if(!n)return;const o=(ke=H(m.value,n))==null?void 0:ke.richContent,d=(o==null?void 0:o.kind)==="code"?Yn(o.raw):"",w=(o==null?void 0:o.kind)==="code"&&o.lang||"",E=w?"```"+w+`
20
- `:"```\n",T=window.prompt("输入代码块内容(用 ```lang 包裹;留空取消)",d?E+d+(d.endsWith("```")?"":"\n```"):E+"// 你的代码"+"\n```");if(T===null)return;const z=T.trim();if(!z){S(n,null);return}const q=/^```([^\s`]*)/.exec(z),p=q?q[1]:void 0;S(n,{kind:"code",raw:z,lang:p})}function Ke(){var o;const n=(o=C.value)==null?void 0:o.nodeId;n&&S(n,null)}function Je(){var T,z;const n=(T=C.value)==null?void 0:T.nodeId;if(!n)return;const o=(z=H(m.value,n))==null?void 0:z.richContent,d=(o==null?void 0:o.kind)==="table"?o.raw:"",E=window.prompt("输入 markdown 表格(每行以 | 分隔;留空取消)",d||`| 列1 | 列2 | 列3 |
17
+ `).replace(/\n+$/,"")}function Xn(e){const a=/^(`{3,}|~{3,})([^\s`~]*)/.exec(e.split(`
18
+ `)[0]??""),n=((a==null?void 0:a[2])??"").toLowerCase();return n&&Vt[n]?n:""}function pr(e,a){const n=a&&Vt[a]?a:"";try{return n?$t.highlight(e,{language:n,ignoreIllegals:!0}).value:$t.highlightAuto(e).value}catch{return br(e)}}function hr(e){return e.split(`
19
+ `).filter(a=>a.trim().length>0).filter(a=>!/^\s*\|?\s*(:?-+:?\s*\|\s*)+(:?-+:?)(\s*\|)?\s*$/.test(a)).map(a=>a.replace(/^\s*\|/,"").replace(/\|\s*$/,"").split("|").map(n=>n.trim()))}function br(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function yr(e,a,n){if(e.length<=1)return e.slice();const[r,...l]=e,f=l.map(g=>g[a]??""),s=f.length>0&&f.every(g=>g.trim()!==""&&!Number.isNaN(Number(g))),c=n==="asc"?1:-1,d=l.slice().sort((g,x)=>{const b=g[a]??"",k=x[a]??"";return s?(Number(b)-Number(k))*c:b.localeCompare(k,"zh-Hans-CN",{numeric:!0})*c});return[r,...d]}const Er=["viewBox","width","height"],xr={class:"zm-edges"},kr=["d","fill"],Nr=["data-node-id","onClick","onDblclick","onContextmenu","onMouseenter","onMouseleave"],wr=["src","width","height","alt"],_r=["onDblclick"],Sr={key:0,class:"zm-rich-code"},Mr=["innerHTML"],Cr={key:1,class:"zm-rich-table"},vr=["onClick"],Tr={class:"zm-rich-sort-mark","aria-hidden":"true"},Ar={key:2,class:"zm-text"},Rr={class:"zm-text-label"},Or=["href","title"],Ir=["title","onClick"],Br=["title"],Lr=["title","onClick"],Dr=["onClick"],zr=["onMousedown"],$r=["onClick"],Pr={class:"zm-tb-tip zm-tb-zoom"},Vr=["src"],Ur=["src"],ze=24,Fe=400,Be=160,qn=t.defineComponent({__name:"MindMap",props:{data:{},theme:{},previewMode:{type:Boolean,default:!1},markdown:{},lineColors:{}},emits:["change","select","edit-note","markdownChange","canvas-settings","canvas-data","canvas-import"],setup(e,{expose:a,emit:n}){const r=e,l=n,f=t.ref(null),s=t.ref(null),c=t.ref(""),d=t.ref(null),g=t.ref(new Set),x=t.ref(!1),b=t.ref(null),k=t.ref(""),h=t.ref(new Map),m=t.ref(Te(r.data)),O=t.ref({}),C=t.ref({}),N=t.ref(r.markdown!==void 0);let F=!1;t.watch(()=>r.markdown,i=>{if(i===void 0){N.value=!1;return}N.value=!0;const o=Ot(i||"");F=!0,m.value=Te(o),d.value=null,g.value=new Set,te(),t.nextTick(()=>{F=!1,Re()})}),t.watch(m,()=>{N.value&&!F&&l("markdownChange",ut(m.value))},{deep:!0});const I=t.computed(()=>B.showOrderBadge===!0),P=t.ref(new Map),z=P.value;function L(i,o){const u={};o.bg&&(u.bg=o.bg),o.textColor&&(u.textColor=o.textColor),o.borderColor&&(u.borderColor=o.borderColor),o.fontWeight&&(u.fontWeight=o.fontWeight),Object.keys(u).length===0?z.delete(i):z.set(i,u),P.value=new Map(z)}function J(i){return z.get(i)??{}}function ee(i,o){const u=W(m.value,i);u&&(u.image={src:o.src,naturalW:o.naturalW,naturalH:o.naturalH,width:Q(o.width,ze,Fe),height:Q(o.height,ze,Fe)},ce(),te(),l("change",m.value))}function ae(i){const o=W(m.value,i);!o||!o.image||(delete o.image,ce(),te(),l("change",m.value))}function G(i,o){const u=o.trim();if(!W(m.value,i))return;if(!u){ae(i);return}const y=new Image;y.onload=()=>{const _=W(m.value,i);if(!_)return;const A=y.naturalWidth&&y.naturalHeight?y.naturalWidth/y.naturalHeight:1,$=Q(y.naturalWidth||Be,ze,Fe),j=Math.round($/A);_.image={src:u,naturalW:y.naturalWidth||$,naturalH:y.naturalHeight||j,width:$,height:j},ce(),te(),l("change",m.value)},y.onerror=()=>{},y.src=u}function Q(i,o,u){return Math.min(u,Math.max(o,i))}function re(i,o){const u=new FileReader;u.onload=()=>{if(typeof u.result!="string")return;const w=u.result,y=new window.Image;y.onload=()=>{const _=y.naturalWidth||Be,A=y.naturalHeight||Be,$=Q(_,ze,Be),j=Q(Math.round(A*$/_),ze,Fe);o({src:w,naturalW:_,naturalH:A,width:$,height:j})},y.onerror=()=>{o({src:w,naturalW:Be,naturalH:Be,width:Be,height:Be})},y.src=w},u.readAsDataURL(i)}function ue(i){const o=document.createElement("input");o.type="file",o.accept="image/*",o.style.display="none",o.onchange=()=>{var w;const u=(w=o.files)==null?void 0:w[0];u&&(re(u,y=>ee(i,y)),document.body.removeChild(o))},document.body.appendChild(o),o.click()}function ie(i,o){const u=o.trim(),w=W(m.value,i);w&&(u?w.link={url:u}:delete w.link,ce(),te(),l("change",m.value))}function fe(i){ie(i,"")}function E(i,o){const u=W(m.value,i);u&&(o?u.note={text:o}:delete u.note,ce(),te(),l("change",m.value))}function v(i){E(i,"")}function M(i,o){const u=W(m.value,i);u&&(o?u.richContent=o:delete u.richContent,ce(),te(),l("change",m.value))}const T=t.ref(null),U=t.ref(null);function ne(i,o){r.previewMode||(i.preventDefault(),i.stopPropagation(),d.value=o.id,l("select",W(m.value,o.id)),T.value={nodeId:o.id,x:i.clientX,y:i.clientY})}function ge(){T.value=null}function Ee(i){r.previewMode||(i.preventDefault(),T.value=null,U.value={x:i.clientX,y:i.clientY})}function me(){U.value=null}function xe(){U.value=null,l("canvas-settings")}function yt(){U.value=null,l("canvas-data")}function Et(i){U.value=null,l("canvas-import",i)}function xt(){var o;const i=(o=T.value)==null?void 0:o.nodeId;i&&ue(i)}function Ut(){var w,y,_;const i=(w=T.value)==null?void 0:w.nodeId;if(!i)return;const o=((_=(y=W(m.value,i))==null?void 0:y.link)==null?void 0:_.url)??"",u=window.prompt("输入链接 URL(留空取消)",o);u!==null&&ie(i,u)}function Ht(){var o;const i=(o=T.value)==null?void 0:o.nodeId;i&&fe(i)}function Ft(){var o;const i=(o=T.value)==null?void 0:o.nodeId;i&&D(i)}function Wt(){var o;const i=(o=T.value)==null?void 0:o.nodeId;i&&v(i)}function We(){var o;const i=(o=T.value)==null?void 0:o.nodeId;i&&ae(i)}function Qe(){var K,Ne;const i=(K=T.value)==null?void 0:K.nodeId;if(!i)return;const o=(Ne=W(m.value,i))==null?void 0:Ne.richContent,u=(o==null?void 0:o.kind)==="code"?Zn(o.raw):"",w=(o==null?void 0:o.kind)==="code"&&o.lang||"",y=w?"```"+w+`
20
+ `:"```\n",A=window.prompt("输入代码块内容(用 ```lang 包裹;留空取消)",u?y+u+(u.endsWith("```")?"":"\n```"):y+"// 你的代码"+"\n```");if(A===null)return;const $=A.trim();if(!$){M(i,null);return}const j=/^```([^\s`]*)/.exec($),p=j?j[1]:void 0;M(i,{kind:"code",raw:$,lang:p})}function ke(){var o;const i=(o=T.value)==null?void 0:o.nodeId;i&&M(i,null)}function kt(){var A,$;const i=(A=T.value)==null?void 0:A.nodeId;if(!i)return;const o=($=W(m.value,i))==null?void 0:$.richContent,u=(o==null?void 0:o.kind)==="table"?o.raw:"",y=window.prompt("输入 markdown 表格(每行以 | 分隔;留空取消)",u||`| 列1 | 列2 | 列3 |
21
21
  | --- | --- | --- |
22
- | a | b | c |`);if(E===null)return;const N=E.trim();if(!N){S(n,null);return}S(n,{kind:"table",raw:N})}function xe(){var o;const n=(o=C.value)==null?void 0:o.nodeId;n&&S(n,null)}function kt(n){r.previewMode||l("edit-note",n)}function Qe(n,o=60){const d=n.replace(/\s+/g," ").trim();return d.length<=o?d||"点击编辑笔记":d.slice(0,o)+"…"}function B(n){var E;if(r.previewMode||s.value)return;const o=n.target;if(o&&(o.tagName==="INPUT"||o.tagName==="TEXTAREA"||o.isContentEditable))return;const d=u.value;if(!d)return;const w=(E=n.clipboardData)==null?void 0:E.items;if(w)for(let N=0;N<w.length;N++){const T=w[N];if(T.kind==="file"&&T.type.startsWith("image/")){const z=T.getAsFile();if(!z)continue;n.preventDefault();const q=H(m.value,d);if(q!=null&&q.image&&!window.confirm("该节点已有图片,要用剪贴板里的图片替换吗?"))return;le(z,p=>te(d,p));return}}}t.onMounted(()=>{window.addEventListener("paste",B),X()}),t.onBeforeUnmount(()=>{window.removeEventListener("paste",B)});const Ie=t.ref(null),ue=t.computed(()=>{var n;return((n=Ie.value)==null?void 0:n.nodeId)??null});function Q(n,o){if(!o.image)return;n.preventDefault(),n.stopPropagation();const d=o.image.naturalW||o.image.width,w=o.image.naturalH||o.image.height,E=w>0?w/d:1;Ie.value={nodeId:o.id,startX:n.clientX,startY:n.clientY,startW:o.image.width,startH:o.image.height,naturalW:d,naturalH:w,ratio:E,pendingW:o.image.width,pendingH:o.image.height},window.addEventListener("mousemove",ze),window.addEventListener("mouseup",Se)}function ze(n){var q,p;const o=Ie.value;if(!o)return;const d=U.scale.value||1,w=n.clientX-o.startX,E=J(o.startW+w/d,De,Ge),N=J(E*o.ratio,De,Ge);o.pendingW=E,o.pendingH=N;const T=(q=f.value)==null?void 0:q.querySelector(`[data-node-id="${o.nodeId}"] .zm-node-img`);T&&(T.style.width=`${E}px`,T.style.height=`${N}px`);const z=(p=f.value)==null?void 0:p.querySelector(`[data-node-id="${o.nodeId}"]`);z&&(z.style.minWidth=`${Math.max(80,Math.ceil(E+28))}px`,z.style.height=`${Math.ceil(N+8+30)}px`)}function Se(){const n=Ie.value;if(window.removeEventListener("mousemove",ze),window.removeEventListener("mouseup",Se),Ie.value=null,!n)return;const o=H(m.value,n.nodeId);!o||!o.image||(te(n.nodeId,{src:o.image.src,naturalW:o.image.naturalW,naturalH:o.image.naturalH,width:n.pendingW,height:n.pendingH}),u.value=n.nodeId,l("select",o),Pe=!0)}const $e=t.ref(null);let Pe=!1;function M(n){$e.value=n}function A(n){$e.value===n&&($e.value=null)}const P=t.ref(0),Y=t.ref(!1),ie=eo(100);function ee(){ie.record({data:m.value})}function X(){g.value=new Set(g.value),P.value++,t.nextTick().then(()=>t.nextTick()).then(()=>Ft()).then(()=>{P.value++})}function Ft(){const n=document.querySelectorAll(".zm-rich"),o={},d={};n.forEach(w=>{let E=w,N=null;for(;E&&!N;)N=E.getAttribute("data-node-id"),E=E.parentElement;if(!N)return;const T=w.offsetHeight,z=w.scrollWidth,q=Math.round(T*2)/2,p=Math.round(z*2)/2;o[N]=q,d[N]=p,L.value[N],K.value[N]}),L.value=o,K.value=d}const Ne=t.computed(()=>{var n,o,d,w,E,N,T,z,q,p;return{rootBg:((n=r.theme)==null?void 0:n.rootBg)??"#1f2937",rootText:((o=r.theme)==null?void 0:o.rootText)??"#ffffff",branchBg:((d=r.theme)==null?void 0:d.branchBg)??"#ffffff",branchText:((w=r.theme)==null?void 0:w.branchText)??"#1f2937",lineColor:((E=r.theme)==null?void 0:E.lineColor)??"#94a3b8",bgColor:((N=r.theme)==null?void 0:N.bgColor)??"#f8fafc",fontSize:((T=r.theme)==null?void 0:T.fontSize)??14,lineWidthStart:((z=r.theme)==null?void 0:z.lineWidthStart)??2.2,lineWidthEnd:((q=r.theme)==null?void 0:q.lineWidthEnd)??.8,rainbowBranch:((p=r.theme)==null?void 0:p.rainbowBranch)??!1}}),R=t.reactive({autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:3.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"curve",layoutMode:"mindmap",taperedEdge:!0,showOrderBadge:!1});function qn(n){return R.taperedEdge?Hr(n):Jn(n)}function jn(n){return R.taperedEdge?R.lineWidthEnd:Jn(n)}function Hr(n){return n<=0?R.lineWidthStart:n===1?Math.max(1.5,R.lineWidthStart*.67):n===2?Math.max(.8,R.lineWidthStart*.42):R.lineWidthEnd}function Jn(n){if(n<=0)return R.lineWidthStart;if(n>=3)return R.lineWidthEnd;const o=n/3;return R.lineWidthStart+(R.lineWidthEnd-R.lineWidthStart)*o}function Fr(n,o,d,w){const E=1-n,N=E*E*E*o.x+3*E*E*n*d.x1+3*E*n*n*d.x2+n*n*n*w.x,T=E*E*E*o.y+3*E*E*n*d.y1+3*E*n*n*d.y2+n*n*n*w.y;return{x:N,y:T}}function Wr(n,o,d,w,E=32,N="curve",T="right"){if(N==="curve"){let ve;if(T==="right"||T==="left"){const ae=Math.abs(o.x-n.x)*.45,Ae=T==="right"?1:-1;ve={x1:n.x+Ae*ae,y1:n.y,x2:o.x-Ae*ae,y2:o.y}}else{const ae=Math.abs(o.y-n.y)*.45;ve={x1:n.x,y1:n.y+ae,x2:o.x,y2:o.y-ae}}const pi=Z=>{const ae=1-Z,Ae=-3*ae*ae*n.x+3*(ae*ae-2*ae*Z)*ve.x1+3*(2*ae*Z-Z*Z)*ve.x2+3*Z*Z*o.x,Ze=-3*ae*ae*n.y+3*(ae*ae-2*ae*Z)*ve.y1+3*(2*ae*Z-Z*Z)*ve.y2+3*Z*Z*o.y;return{dx:Ae,dy:Ze}},rt=[],Xt=[];for(let Z=0;Z<=E;Z++){const ae=Z/E,Ae=Z===0?n:Z===E?o:Fr(ae,n,ve,o),Ze=pi(ae);let Mt=Math.hypot(Ze.dx,Ze.dy);Mt<1e-6&&(Mt=1);const hi=-Ze.dy/Mt,bi=Ze.dx/Mt,vt=(d+(w-d)*ae)/2;rt.push({x:Ae.x+hi*vt,y:Ae.y+bi*vt}),Xt.push({x:Ae.x-hi*vt,y:Ae.y-bi*vt})}let St=`M ${rt[0].x.toFixed(2)} ${rt[0].y.toFixed(2)}`;for(let Z=1;Z<=E;Z++)St+=` L ${rt[Z].x.toFixed(2)} ${rt[Z].y.toFixed(2)}`;for(let Z=E;Z>=0;Z--)St+=` L ${Xt[Z].x.toFixed(2)} ${Xt[Z].y.toFixed(2)}`;return St+=" Z",St}const z=o.x-n.x,q=o.y-n.y;let p=Math.hypot(z,q);p<1e-6&&(p=1);const G=-q/p,ke=z/p,Me=d/2,pe=w/2,tt={x:n.x+G*Me,y:n.y+ke*Me},nt={x:n.x-G*Me,y:n.y-ke*Me},it={x:o.x-G*pe,y:o.y-ke*pe},ot={x:o.x+G*pe,y:o.y+ke*pe};return`M ${tt.x.toFixed(2)} ${tt.y.toFixed(2)} L ${ot.x.toFixed(2)} ${ot.y.toFixed(2)} L ${it.x.toFixed(2)} ${it.y.toFixed(2)} L ${nt.x.toFixed(2)} ${nt.y.toFixed(2)} Z`}const wt=t.computed(()=>he.value.root.children),Gr=Xe[0].colors,Qn=t.computed(()=>Fi(R.branchPaletteId,R.customPalettes)),Ue=t.computed(()=>{const n=new Map;if(!R.rainbowBranch)return n;const o=r.lineColors,d=o&&o.length>0?o:Qn.value.colors.length>0?Qn.value.colors:Gr;for(let E=0;E<wt.value.length;E++){const N=wt.value[E];n.set(N.id,d[E%d.length])}const w=(E,N)=>{n.set(E.id,N);for(const T of E.children)w(T,N)};for(let E=0;E<wt.value.length;E++){const N=wt.value[E];w(N,d[E%d.length])}return n});function Kr(n,o){return R.rainbowBranch?Ue.value.get(o.id)??Ne.value.lineColor:Ne.value.lineColor}function Yr(n){const o=j(n.id);if(o.bg)return o.bg;if(n.isRoot)return Ne.value.rootBg;if(R.rainbowBranch){const d=Ue.value.get(n.id);if(d)return jr(d,.18)}return Ne.value.branchBg}function Zr(n){const o=j(n.id);if(o.textColor)return o.textColor;if(n.isRoot)return Ne.value.rootText;if(R.rainbowBranch){const d=Ue.value.get(n.id);if(d)return ei(d,.55)}return Ne.value.branchText}function Xr(n){const o=j(n.id);if(o.borderColor)return o.borderColor;if(n.isRoot)return Ne.value.rootBg;if(R.rainbowBranch){const d=Ue.value.get(n.id);if(d)return ei(d,.3)}return Ne.value.lineColor}function qr(n){return j(n.id).fontWeight??(n.isRoot?600:400)}function jr(n,o){const d=n.replace("#",""),w=d.length===6?d:d.split("").map(z=>z+z).join(""),E=parseInt(w.slice(0,2),16),N=parseInt(w.slice(2,4),16),T=parseInt(w.slice(4,6),16);return`rgba(${E}, ${N}, ${T}, ${o})`}function ei(n,o){const d=n.replace("#",""),w=d.length===6?d:d.split("").map(z=>z+z).join(""),E=Math.round(parseInt(w.slice(0,2),16)*(1-o)),N=Math.round(parseInt(w.slice(2,4),16)*(1-o)),T=Math.round(parseInt(w.slice(4,6),16)*(1-o));return`rgb(${E}, ${N}, ${T})`}const U=ji({getContainer:()=>f.value});U.setOnMarqueeEnd(ha),Qi({isEditing:()=>s.value!==null,isReadonly:()=>r.previewMode,getSelectedId:()=>u.value,getRootId:()=>m.value.id,defaultTargetId:()=>m.value.id,onAddChild:Ye,onAddSibling:_t,onAddSiblingBefore:oi,onRemove:ai,onStartEdit:et,onClearSelection:()=>{u.value=null,l("select",null)},onDuplicate:ri,onUndo:Gt,onRedo:Kt,onNavigate:sa,onSelectRoot:()=>{u.value=m.value.id;const n=H(m.value,m.value.id);n&&l("select",n)}});const he=t.computed(()=>{const n=Ce(m.value);return ni(n),Pi(n,{mode:R.layoutMode,baseFontSize:Ne.value.fontSize,richHeights:L.value,richWidths:K.value})}),ti=t.ref([]),Wt=t.computed(()=>(P.value,ti.value));t.watch(he,n=>{const o=[],d=w=>{o.push(w);for(const E of w.children)d(E)};d(n.root),ti.value=o},{immediate:!0});const Jr=t.computed(()=>{const n=[];for(const o of Wt.value)for(const d of o.children)n.push({from:o,to:d,key:`${o.id}->${d.id}`});return n}),Qr=t.computed(()=>`${he.value.vbX} ${he.value.vbY} ${he.value.vbW} ${he.value.vbH}`);function ni(n){if(g.value.has(n.id)){n.children=[],n.collapsed=!0;return}n.collapsed=!1;for(const o of n.children)ni(o)}function et(n){const o=H(m.value,n);o&&(s.value=n,c.value=o.text,t.nextTick(()=>{const d=document.querySelector(".zm-input");d==null||d.focus(),d==null||d.select()}))}function Nt(n={}){if(!s.value)return;const o=H(m.value,s.value);o&&o.text!==(c.value.trim()||" ")&&(o.text=c.value.trim()||" ",ee(),l("change",m.value));const d=s.value;s.value=null,n.addChild?t.nextTick(()=>Ye(d)):n.addSibling==="after"?t.nextTick(()=>_t(d)):n.addSibling==="before"&&t.nextTick(()=>oi(d))}function ea(){s.value=null}function ta(n){if(r.previewMode)return;const o=H(m.value,n);o!=null&&o.richContent&&(b.value=n,k.value=o.richContent.raw,t.nextTick(()=>{const d=document.querySelector(".zm-node .zm-rich textarea");d==null||d.focus()}))}function ii(){if(!b.value)return;const n=b.value,o=H(m.value,n),d=k.value;if(o&&o.richContent&&o.richContent.raw!==d)if(o.richContent.kind==="code"){const w=Zn(d)||void 0;S(n,{kind:"code",raw:d,lang:w})}else S(n,{kind:"table",raw:d});b.value=null}function na(){b.value=null}function ia(n){n.key==="Escape"?(n.preventDefault(),na()):n.key==="Enter"&&(n.ctrlKey||n.metaKey)&&(n.preventDefault(),ii())}function oa(n,o){const d=h.value.get(n);!d||d.col!==o?h.value.set(n,{col:o,dir:"asc"}):d.dir==="asc"?h.value.set(n,{col:o,dir:"desc"}):h.value.delete(n)}function ra(n,o){const d=h.value.get(n);return!d||o.length<=1?o:br(o,d.col,d.dir)}function aa(n,o){const d=h.value.get(n);return!d||d.col!==o?"↕":d.dir==="asc"?"▲":"▼"}function la(n){const o=n.metaKey||n.ctrlKey;o&&(n.key==="z"||n.key==="Z")&&!n.shiftKey?(n.preventDefault(),Gt()):(o&&n.shiftKey&&(n.key==="z"||n.key==="Z")||o&&(n.key==="y"||n.key==="Y")&&!n.shiftKey)&&(n.preventDefault(),Kt())}function Ye(n){const o=nn(m.value,n,ct);o&&(ee(),X(),l("change",m.value),t.nextTick(()=>et(o.id)))}function _t(n){if(n===m.value.id){Ye(n);return}const o=on(m.value,n,ct);o&&(ee(),X(),l("change",m.value),t.nextTick(()=>et(o.id)))}function oi(n){if(n===m.value.id){Ye(n);return}const o=Ki(m.value,n,ct);o&&(ee(),X(),l("change",m.value),t.nextTick(()=>et(o.id)))}function ri(n){if(n===m.value.id)return;const o=Yi(m.value,n);o&&(ee(),u.value=o.id,l("change",m.value),X())}function Gt(){const n=ie.undo();n&&(m.value=n.data,u.value=null,l("select",null),X(),l("change",m.value))}function Kt(){const n=ie.redo();n&&(m.value=n.data,u.value=null,l("select",null),X(),l("change",m.value))}function sa(n,o){const d=u.value??m.value.id,w=H(m.value,d);if(!w)return;let E=null;if(o===1){const N=we(m.value,w.id);if(N){const T=N.children.findIndex(z=>z.id===w.id);T>=0&&T<N.children.length-1&&(E=N.children[T+1].id)}}else if(o===-1){const N=we(m.value,w.id);if(N){const T=N.children.findIndex(z=>z.id===w.id);T>0&&(E=N.children[T-1].id)}}else if(n===1){const N=we(m.value,w.id);N&&(E=N.id)}else n===-1&&w.children.length>0&&(E=w.children[0].id);if(E){u.value=E;const N=H(m.value,E);N&&l("select",N)}}function ai(n){n!==m.value.id&&At(m.value,n)&&(ee(),u.value===n&&(u.value=null),X(),l("change",m.value))}function li(n){g.value.has(n)?g.value.delete(n):g.value.add(n),X()}function si(n){const o=[{n:m.value,depth:1}];for(;o.length;){const{n:d,depth:w}=o.pop();n(d,w);for(let E=d.children.length-1;E>=0;E--)o.push({n:d.children[E],depth:w+1})}}function ca(){g.value=new Set,si(n=>{n.children.length>0&&g.value.add(n.id)}),X()}function ci(n){g.value=new Set,si((o,d)=>{d>n&&o.children.length>0&&g.value.add(o.id)}),X()}function da(){g.value=new Set,X()}function ua(n,o){Wi(m.value,n,o)&&(ee(),X(),l("change",m.value))}function fa(n,o,d){return Gi(m.value,n,o,d)?(ee(),X(),l("change",m.value),!0):!1}function ga(n,o){n.stopPropagation(),u.value=o.id;const d=H(m.value,o.id);l("select",d)}function ma(n){const o=n.target;if(!o||o.closest(".zm-node, .zm-toolbar, button, input, textarea"))return;if(n.button===2){U.startPan(n);return}if(n.button!==0)return;const d=f.value.getBoundingClientRect(),w=(n.clientX-d.left-U.offsetX.value)/U.scale.value,E=(n.clientY-d.top-U.offsetY.value)/U.scale.value;U.startMarquee(w,E)}function pa(n){if(Pe){Pe=!1;return}const o=n.target;if(!o||o.closest(".zm-node"))return;const d=U.marquee;d.width>=4||d.height>=4||u.value!==null&&(u.value=null,l("select",null))}function ha(){const n=U.marquee;if(n.width<4&&n.height<4)return;const o=n.x,d=n.y,w=n.x+n.width,E=n.y+n.height,N=[];for(const T of Wt.value){const z=T.width/2,q=T.height/2,p=T.x-z,G=T.x+z,ke=T.y-q,Me=T.y+q;p<=w&&G>=o&&ke<=E&&Me>=d&&N.push(T.id)}if(N.length>0){u.value=N[0];const T=H(m.value,N[0]);T&&l("select",T)}}function di(n){return g.value.has(n)}function ba(n){const o=H(m.value,n.id);return!!o&&o.children.length>0}function Yt(n){const o=H(m.value,n);return o?o.children.length:0}function ui(n){if(!H(m.value,n))return 0;const w=[m.value];for(;w.length;){const E=w.pop(),N=E.children.findIndex(T=>T.id===n);if(N>=0)return N;for(const T of E.children)w.push(T)}return 0}function fi(n,o,d,w){if(((w==null?void 0:w._dir)??n._dir)==="down")return o==="out"?{x:n.x,y:n.y+n.height/2}:{x:n.x,y:n.y-n.height/2};let N;o==="in"?N=-n.side:d!==void 0?N=d:N=n.side;const T=o==="in"?n._richInsetX??0:0;return{x:n.x+N*(n.width/2-T),y:n.y}}function Te(){const n=he.value;U.resetView(n.width,n.height,n.root.y)}function ya(){Y.value=!0,ee(),X(),t.nextTick(()=>Te())}function Zt(n){R.layoutMode!==n&&(R.layoutMode=n,X(),t.nextTick(()=>Te()))}function gi(){return JSON.stringify(m.value,null,2)}function mi(n){try{const o=JSON.parse(n);return!o.id||!Array.isArray(o.children)?!1:(ie.reset(),m.value=Ce(o),u.value=null,g.value=new Set,X(),t.nextTick(()=>Te()),l("change",m.value),!0)}catch{return!1}}function Ea(){const n=document.createElement("input");n.type="file",n.accept="application/json",n.onchange=()=>{var w;const o=(w=n.files)==null?void 0:w[0];if(!o)return;const d=new FileReader;d.onload=()=>{typeof d.result=="string"&&(mi(d.result)||alert("导入失败:JSON 格式无效"))},d.readAsText(o)},n.click()}function xa(){const n=new Blob([gi()],{type:"application/json"}),o=URL.createObjectURL(n),d=document.createElement("a");d.href=o,d.download=`${m.value.text||"mindmap"}.json`,d.click(),URL.revokeObjectURL(o)}return a({addChild:n=>Ye(n),addSibling:n=>_t(n),removeNode:n=>ai(n),duplicateNode:n=>ri(n),setNodeText:(n,o)=>ua(n,o),moveNode:(n,o,d)=>fa(n,o,d),lineWidthForDepth:qn,endWidthForDepth:jn,getData:()=>m.value,setData:n=>{ie.reset(),m.value=Ce(n),u.value=null,g.value=new Set,X(),ee(),t.nextTick(()=>Te())},resetView:()=>Te(),exportData:gi,importData:mi,getMarkdown:()=>dt(m.value),setMarkdown:(n,o=!0)=>{const d=Rt(n||"");o&&(_.value=!0),F=!o,ie.reset(),m.value=Ce(d),u.value=null,g.value=new Set,X(),ee(),t.nextTick(()=>{F=!1,Te()}),l("change",m.value)},setBalanced:n=>{Y.value=n},isBalanced:()=>Y.value,balance:()=>ya(),applyNodeStyle:(n,o)=>I(n,o),getNodeStyle:n=>j(n),applyNodeImage:(n,o)=>te(n,o),applyNodeImageByUrl:(n,o)=>W(n,o),removeNodeImage:n=>se(n),applyNodeLink:(n,o)=>re(n,o),removeNodeLink:n=>fe(n),applyNodeNote:(n,o)=>x(n,o),removeNodeNote:n=>v(n),applyNodeRichContent:(n,o)=>S(n,o),undo:()=>Gt(),redo:()=>Kt(),canUndo:()=>ie.canUndo(),canRedo:()=>ie.canRedo(),applySettings:n=>{n.autoBalanceOnChange!==void 0&&(R.autoBalanceOnChange=n.autoBalanceOnChange),n.lineWidthStart!==void 0&&(R.lineWidthStart=Math.max(.5,Math.min(20,n.lineWidthStart))),n.lineWidthEnd!==void 0&&(R.lineWidthEnd=Math.max(.3,Math.min(10,n.lineWidthEnd))),n.rainbowBranch!==void 0&&(R.rainbowBranch=n.rainbowBranch),n.branchPaletteId!==void 0&&(R.branchPaletteId=n.branchPaletteId),n.customPalettes!==void 0&&(R.customPalettes=n.customPalettes),n.lineStyle!==void 0&&(R.lineStyle=n.lineStyle),n.taperedEdge!==void 0&&(R.taperedEdge=n.taperedEdge),n.showOrderBadge!==void 0&&(R.showOrderBadge=n.showOrderBadge)},getSettings:()=>({autoBalanceOnChange:R.autoBalanceOnChange,lineWidthStart:R.lineWidthStart,lineWidthEnd:R.lineWidthEnd,rainbowBranch:R.rainbowBranch,branchPaletteId:R.branchPaletteId,customPalettes:R.customPalettes,lineStyle:R.lineStyle,layoutMode:R.layoutMode,taperedEdge:R.taperedEdge,showOrderBadge:R.showOrderBadge}),setBranchPalette:n=>{if(!n)return;[...Xe,...R.customPalettes].find(d=>d.id===n)&&(R.branchPaletteId=n)},getBranchPalette:()=>R.branchPaletteId,getBranchPalettes:()=>[...Xe,...R.customPalettes]}),t.watch(()=>r.data,n=>{m.value=Ce(n),X()},{deep:!1}),t.onMounted(()=>{ee(),t.nextTick(()=>Te())}),(n,o)=>{var d,w,E,N,T,z,q;return t.openBlock(),t.createElementBlock("div",{class:"zm-mindmap",style:t.normalizeStyle({background:Ne.value.bgColor,fontSize:Ne.value.fontSize+"px"})},[t.createElementVNode("div",{ref_key:"wrapperRef",ref:f,class:"zm-canvas",onMousedown:ma,onContextmenu:ye,onWheel:o[25]||(o[25]=(...p)=>t.unref(U).onWheel&&t.unref(U).onWheel(...p)),onMouseenter:o[26]||(o[26]=p=>y.value=!0),onMouseleave:o[27]||(o[27]=p=>y.value=!1),onClick:pa},[t.createElementVNode("div",{class:"zm-svg-layer",style:t.normalizeStyle({left:he.value.vbX*t.unref(U).scale.value+t.unref(U).offsetX.value+"px",top:he.value.vbY*t.unref(U).scale.value+t.unref(U).offsetY.value+"px",width:he.value.vbW*t.unref(U).scale.value+"px",height:he.value.vbH*t.unref(U).scale.value+"px"})},[(t.openBlock(),t.createElementBlock("svg",{class:"zm-svg",viewBox:Qr.value,preserveAspectRatio:"xMinYMin meet",width:he.value.vbW*t.unref(U).scale.value,height:he.value.vbH*t.unref(U).scale.value},[t.createElementVNode("g",Er,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Jr.value,p=>(t.openBlock(),t.createElementBlock("path",{key:p.key,d:Wr(fi(p.from,"out",p.to.side,p.to),fi(p.to,"in"),qn(p.from.depth),jn(p.to.depth),32,R.lineStyle,p.to._dir),fill:Kr(p.from,p.to),stroke:"none"},null,8,xr))),128))])],8,yr))],4),t.unref(U).isMarquee.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:"zm-marquee",style:t.normalizeStyle({left:t.unref(U).marquee.x*t.unref(U).scale.value+t.unref(U).offsetX.value+"px",top:t.unref(U).marquee.y*t.unref(U).scale.value+t.unref(U).offsetY.value+"px",width:t.unref(U).marquee.width*t.unref(U).scale.value+"px",height:t.unref(U).marquee.height*t.unref(U).scale.value+"px"})},null,4)):t.createCommentVNode("",!0),t.createElementVNode("div",{class:"zm-world",style:t.normalizeStyle({transform:`translate(${t.unref(U).offsetX.value}px, ${t.unref(U).offsetY.value}px) scale(${t.unref(U).scale.value})`})},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Wt.value,p=>(t.openBlock(),t.createElementBlock("div",{key:p.id,class:t.normalizeClass(["zm-node",{"is-root":p.isRoot,"is-selected":u.value===p.id,"is-editing":s.value===p.id,"has-image":!!p.image,"is-resizing":ue.value===p.id}]),"data-node-id":p.id,style:t.normalizeStyle({left:p.x+"px",top:p.y+"px",width:p.width+"px",minWidth:p.width+"px",height:p.height+"px",fontSize:p.fontSize+"px",background:Yr(p),color:Zr(p),borderColor:Xr(p),fontWeight:qr(p),transform:"translate(-50%, -50%)"}),onClick:G=>ga(G,p),onDblclick:G=>{G.stopPropagation(),e.previewMode||et(p.id)},onContextmenu:G=>oe(G,p),onMouseenter:G=>M(p.id),onMouseleave:G=>A(p.id)},[p.image?(t.openBlock(),t.createElementBlock("img",{key:0,class:"zm-node-img",src:p.image.src,width:p.image.width,height:p.image.height,alt:p.text,draggable:"false"},null,8,wr)):t.createCommentVNode("",!0),p.richContent&&(p.richContent.kind==="code"||p.richContent.kind==="table")&&s.value!==p.id?(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass(["zm-rich zm-rich-above",{"zm-rich-no-overflow":p.richContent.kind==="table"||p.richContent.kind==="code"}]),onClick:o[1]||(o[1]=t.withModifiers(()=>{},["stop"])),onDblclick:t.withModifiers(G=>ta(p.id),["stop"]),onMousedown:o[2]||(o[2]=t.withModifiers(()=>{},["stop"]))},[b.value===p.id?t.withDirectives((t.openBlock(),t.createElementBlock("textarea",{key:0,"onUpdate:modelValue":o[0]||(o[0]=G=>k.value=G),class:"zm-rich-edit",spellcheck:"false",onBlur:ii,onKeydown:ia},null,544)),[[t.vModelText,k.value]]):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[p.richContent.kind==="code"?(t.openBlock(),t.createElementBlock("pre",_r,[t.createElementVNode("code",{innerHTML:t.unref(mr)(t.unref(Yn)(p.richContent.raw),t.unref(Zn)(p.richContent.raw))},null,8,Sr)])):p.richContent.kind==="table"?(t.openBlock(),t.createElementBlock("table",Mr,[t.createElementVNode("tbody",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(ra(p.id,t.unref(pr)(p.richContent.raw)),(G,ke)=>(t.openBlock(),t.createElementBlock("tr",{key:ke},[ke===0?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:0},t.renderList(G,(Me,pe)=>{var tt,nt,it,ot,ve;return t.openBlock(),t.createElementBlock("th",{key:`h${pe}`,class:t.normalizeClass(["zm-rich-table-sort",{"is-sorted":((tt=h.value.get(p.id))==null?void 0:tt.col)===pe,"is-asc":((nt=h.value.get(p.id))==null?void 0:nt.col)===pe&&((it=h.value.get(p.id))==null?void 0:it.dir)==="asc","is-desc":((ot=h.value.get(p.id))==null?void 0:ot.col)===pe&&((ve=h.value.get(p.id))==null?void 0:ve.dir)==="desc"}]),onClick:t.withModifiers(pi=>oa(p.id,pe),["stop"])},[t.createElementVNode("span",null,t.toDisplayString(Me),1),t.createElementVNode("span",Cr,t.toDisplayString(aa(p.id,pe)),1)],10,vr)}),128)):(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:1},t.renderList(G,(Me,pe)=>(t.openBlock(),t.createElementBlock("td",{key:`c${pe}`},t.toDisplayString(Me),1))),128))]))),128))])])):t.createCommentVNode("",!0)],64))],42,Nr)):t.createCommentVNode("",!0),s.value!==p.id?(t.openBlock(),t.createElementBlock("span",Tr,[t.createElementVNode("span",Ar,t.toDisplayString(p.text),1),p.link&&!s.value?(t.openBlock(),t.createElementBlock("a",{key:0,class:"zm-node-link",href:p.link.url,target:"_blank",rel:"noopener noreferrer",title:`打开链接:${p.link.url}`,onClick:o[3]||(o[3]=t.withModifiers(()=>{},["stop"])),onMousedown:o[4]||(o[4]=t.withModifiers(()=>{},["stop"]))},[t.createVNode(ne,{name:"link",size:11,stroke:2})],40,Rr)):t.createCommentVNode("",!0),p.note&&!s.value?(t.openBlock(),t.createElementBlock("button",{key:1,class:"zm-node-note-btn",type:"button",title:Qe(p.note.text),onClick:t.withModifiers(G=>kt(p.id),["stop"]),onMousedown:o[5]||(o[5]=t.withModifiers(()=>{},["stop"]))},[t.createVNode(ne,{name:"note",size:11,stroke:2})],40,Or)):t.createCommentVNode("",!0)])):t.withDirectives((t.openBlock(),t.createElementBlock("input",{key:3,class:"zm-input","onUpdate:modelValue":o[6]||(o[6]=G=>c.value=G),autofocus:"",onBlur:o[7]||(o[7]=G=>Nt()),onKeydown:[o[8]||(o[8]=t.withKeys(t.withModifiers(G=>Nt({addSibling:"after"}),["exact"]),["enter"])),o[9]||(o[9]=t.withKeys(t.withModifiers(G=>Nt({addSibling:"before"}),["shift","prevent","exact"]),["enter"])),o[10]||(o[10]=t.withKeys(t.withModifiers(G=>Nt({addChild:!0}),["prevent"]),["tab"])),t.withKeys(ea,["esc"]),la],onMousedown:o[11]||(o[11]=t.withModifiers(()=>{},["stop"])),onClick:o[12]||(o[12]=t.withModifiers(()=>{},["stop"]))},null,544)),[[t.vModelText,c.value]]),O.value?(t.openBlock(),t.createElementBlock("span",{key:4,class:"zm-order-badge",title:`数据顺序:第 ${ui(p.id)+1} 个`},t.toDisplayString(ui(p.id)+1),9,Ir)):t.createCommentVNode("",!0),di(p.id)&&Yt(p.id)>0?(t.openBlock(),t.createElementBlock("span",{key:5,class:t.normalizeClass(["zm-collapse-badge",{"is-on-left":p.side===-1}]),style:t.normalizeStyle({background:Ue.value.get(p.id)??"#64748b"}),title:`展开 ${Yt(p.id)} 个子节点`,onMousedown:o[13]||(o[13]=t.withModifiers(()=>{},["stop"])),onClick:t.withModifiers(G=>li(p.id),["stop"])},t.toDisplayString(Yt(p.id)),47,Br)):t.createCommentVNode("",!0),ba(p)&&!di(p.id)?(t.openBlock(),t.createElementBlock("button",{key:6,class:t.normalizeClass(["zm-btn zm-collapse",{"is-on-left":p.side===-1}]),style:t.normalizeStyle({color:Ue.value.get(p.id)??"#64748b",borderColor:Ue.value.get(p.id)??"#64748b"}),title:"折叠",onMousedown:o[14]||(o[14]=t.withModifiers(()=>{},["stop"])),onClick:t.withModifiers(G=>li(p.id),["stop"])},[t.createVNode(ne,{name:"minus",size:10,stroke:2.4})],46,Lr)):t.createCommentVNode("",!0),p.image&&u.value===p.id&&s.value!==p.id?(t.openBlock(),t.createElementBlock("span",{key:7,class:"zm-img-resize-handle",title:"拖动调整图片大小",onMousedown:t.withModifiers(G=>Q(G,p),["stop"])},null,40,Dr)):t.createCommentVNode("",!0),p.image&&u.value===p.id&&s.value!==p.id?(t.openBlock(),t.createElementBlock("button",{key:8,class:"zm-img-remove-btn",title:"移除图片",onMousedown:o[15]||(o[15]=t.withModifiers(()=>{},["stop"])),onClick:t.withModifiers(G=>se(p.id),["stop"])},[t.createVNode(ne,{name:"x",size:9,stroke:2.2})],40,zr)):t.createCommentVNode("",!0)],46,kr))),128))],4),C.value?(t.openBlock(),t.createBlock(to,{key:1,x:C.value.x,y:C.value.y,container:f.value,"has-image":!!((d=t.unref(H)(m.value,C.value.nodeId))!=null&&d.image),"has-link":!!((w=t.unref(H)(m.value,C.value.nodeId))!=null&&w.link),"has-note":!!((E=t.unref(H)(m.value,C.value.nodeId))!=null&&E.note),"has-code":((T=(N=t.unref(H)(m.value,C.value.nodeId))==null?void 0:N.richContent)==null?void 0:T.kind)==="code","has-table":((q=(z=t.unref(H)(m.value,C.value.nodeId))==null?void 0:z.richContent)==null?void 0:q.kind)==="table",onPickImage:bt,onRemoveImage:Ht,onSetLink:yt,onRemoveLink:Et,onEditNote:Ut,onRemoveNote:Vt,onAddCode:xt,onEditCode:xt,onRemoveCode:Ke,onAddTable:Je,onEditTable:Je,onRemoveTable:xe,onClose:ge},null,8,["x","y","container","has-image","has-link","has-note","has-code","has-table"])):t.createCommentVNode("",!0),V.value?(t.openBlock(),t.createBlock(no,{key:2,x:V.value.x,y:V.value.y,container:f.value,onOpenSettings:Ee,onClose:me},null,8,["x","y","container"])):t.createCommentVNode("",!0),t.createElementVNode("div",{class:t.normalizeClass(["zm-toolbar",{"is-preview-only":r.previewMode,"is-hovered":y.value}])},[t.createElementVNode("span",$r,t.toDisplayString(Math.round(t.unref(U).scale.value*100))+"%",1),t.createElementVNode("button",{class:"zm-tb-btn",title:"放大",onClick:o[16]||(o[16]=(...p)=>t.unref(U).zoomIn&&t.unref(U).zoomIn(...p))},[t.createVNode(ne,{name:"zoom-in"})]),t.createElementVNode("button",{class:"zm-tb-btn",title:"缩小",onClick:o[17]||(o[17]=(...p)=>t.unref(U).zoomOut&&t.unref(U).zoomOut(...p))},[t.createVNode(ne,{name:"zoom-out"})]),t.createElementVNode("button",{class:"zm-tb-btn",title:"重置视图",onClick:Te},[t.createVNode(ne,{name:"reset"})]),o[31]||(o[31]=t.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),t.createElementVNode("button",{class:"zm-tb-btn",title:"全部收起",onClick:ca},[t.createVNode(ne,{name:"collapse-all"})]),t.createElementVNode("button",{class:"zm-tb-btn",title:"展开一级",onClick:o[18]||(o[18]=p=>ci(1))},[t.createVNode(ne,{name:"expand-level-1"})]),t.createElementVNode("button",{class:"zm-tb-btn",title:"展开二级",onClick:o[19]||(o[19]=p=>ci(2))},[t.createVNode(ne,{name:"expand-level-2"})]),t.createElementVNode("button",{class:"zm-tb-btn",title:"全部展开",onClick:da},[t.createVNode(ne,{name:"expand-all"})]),o[32]||(o[32]=t.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),t.createElementVNode("button",{class:"zm-tb-btn",title:"导出 JSON",onClick:xa},[t.createVNode(ne,{name:"export"})]),r.previewMode?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[o[28]||(o[28]=t.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),t.createElementVNode("button",{class:"zm-tb-btn",title:"添加子节点 (Tab)",onClick:o[20]||(o[20]=p=>u.value&&Ye(u.value))},[t.createElementVNode("img",{src:t.unref(wi),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,Pr)]),t.createElementVNode("button",{class:"zm-tb-btn",title:"添加同级 (Enter)",onClick:o[21]||(o[21]=p=>u.value&&_t(u.value))},[t.createElementVNode("img",{src:t.unref(ki),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,Ur)]),o[29]||(o[29]=t.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),t.createElementVNode("button",{class:t.normalizeClass(["zm-tb-btn",{active:R.layoutMode==="mindmap"}]),title:"思维导图布局 (中心辐射)",onClick:o[22]||(o[22]=p=>Zt("mindmap"))},[t.createVNode(ne,{name:"mindmap"})],2),t.createElementVNode("button",{class:t.normalizeClass(["zm-tb-btn",{active:R.layoutMode==="tree"}]),title:"树形布局 (向右展开)",onClick:o[23]||(o[23]=p=>Zt("tree"))},[t.createVNode(ne,{name:"tree"})],2),t.createElementVNode("button",{class:t.normalizeClass(["zm-tb-btn",{active:R.layoutMode==="org"}]),title:"组织结构布局 (向下展开)",onClick:o[24]||(o[24]=p=>Zt("org"))},[t.createVNode(ne,{name:"org"})],2),o[30]||(o[30]=t.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),t.createElementVNode("button",{class:"zm-tb-btn",title:"导入 JSON",onClick:Ea},[t.createVNode(ne,{name:"import"})])],64))],2)],544)],4)}}}),Vr={install(e){e.component("FlowMindMap",Xn)}};ce.MindMap=Xn,ce.addChild=nn,ce.addSibling=on,ce.clone=Ce,ce.default=Vr,ce.findNode=H,ce.findParent=we,ce.markdownToMindMap=Rt,ce.markdownToRichMindMap=Xi,ce.mindMapToMarkdown=dt,ce.removeNode=At,ce.richBlockToMarkdown=qi,ce.uid=_e,Object.defineProperties(ce,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
22
+ | a | b | c |`);if(y===null)return;const _=y.trim();if(!_){M(i,null);return}M(i,{kind:"table",raw:_})}function et(){var o;const i=(o=T.value)==null?void 0:o.nodeId;i&&M(i,null)}function D(i){r.previewMode||l("edit-note",i)}function Nt(i,o=60){const u=i.replace(/\s+/g," ").trim();return u.length<=o?u||"点击编辑笔记":u.slice(0,o)+"…"}function le(i){var y;if(r.previewMode||s.value)return;const o=i.target;if(o&&(o.tagName==="INPUT"||o.tagName==="TEXTAREA"||o.isContentEditable))return;const u=d.value;if(!u)return;const w=(y=i.clipboardData)==null?void 0:y.items;if(w)for(let _=0;_<w.length;_++){const A=w[_];if(A.kind==="file"&&A.type.startsWith("image/")){const $=A.getAsFile();if(!$)continue;i.preventDefault();const j=W(m.value,u);if(j!=null&&j.image&&!window.confirm("该节点已有图片,要用剪贴板里的图片替换吗?"))return;re($,p=>ee(u,p));return}}}t.onMounted(()=>{window.addEventListener("paste",le),te()}),t.onBeforeUnmount(()=>{window.removeEventListener("paste",le)});const Y=t.ref(null),Ge=t.computed(()=>{var i;return((i=Y.value)==null?void 0:i.nodeId)??null});function Ae(i,o){if(!o.image)return;i.preventDefault(),i.stopPropagation();const u=o.image.naturalW||o.image.width,w=o.image.naturalH||o.image.height,y=w>0?w/u:1;Y.value={nodeId:o.id,startX:i.clientX,startY:i.clientY,startW:o.image.width,startH:o.image.height,naturalW:u,naturalH:w,ratio:y,pendingW:o.image.width,pendingH:o.image.height},window.addEventListener("mousemove",Ke),window.addEventListener("mouseup",Ye)}function Ke(i){var j,p;const o=Y.value;if(!o)return;const u=H.scale.value||1,w=i.clientX-o.startX,y=Q(o.startW+w/u,ze,Fe),_=Q(y*o.ratio,ze,Fe);o.pendingW=y,o.pendingH=_;const A=(j=f.value)==null?void 0:j.querySelector(`[data-node-id="${o.nodeId}"] .zm-node-img`);A&&(A.style.width=`${y}px`,A.style.height=`${_}px`);const $=(p=f.value)==null?void 0:p.querySelector(`[data-node-id="${o.nodeId}"]`);$&&($.style.minWidth=`${Math.max(80,Math.ceil(y+28))}px`,$.style.height=`${Math.ceil(_+8+30)}px`)}function Ye(){const i=Y.value;if(window.removeEventListener("mousemove",Ke),window.removeEventListener("mouseup",Ye),Y.value=null,!i)return;const o=W(m.value,i.nodeId);!o||!o.image||(ee(i.nodeId,{src:o.image.src,naturalW:o.image.naturalW,naturalH:o.image.naturalH,width:i.pendingW,height:i.pendingH}),d.value=i.nodeId,l("select",o),R=!0)}const S=t.ref(null);let R=!1;function V(i){S.value=i}function Z(i){S.value===i&&(S.value=null)}const se=t.ref(0),he=t.ref(!1),Me=to(100);function ce(){Me.record({data:m.value})}function te(){g.value=new Set(g.value),se.value++,t.nextTick().then(()=>t.nextTick()).then(()=>Fr()).then(()=>{se.value++})}function Fr(){const i=document.querySelectorAll(".zm-rich"),o={},u={};i.forEach(w=>{let y=w,_=null;for(;y&&!_;)_=y.getAttribute("data-node-id"),y=y.parentElement;if(!_)return;const A=w.offsetHeight,$=w.scrollWidth,j=Math.round(A*2)/2,p=Math.round($*2)/2;o[_]=j,u[_]=p,O.value[_],C.value[_]}),O.value=o,C.value=u}const _e=t.computed(()=>{var i,o,u,w,y,_,A,$,j,p;return{rootBg:((i=r.theme)==null?void 0:i.rootBg)??"#1f2937",rootText:((o=r.theme)==null?void 0:o.rootText)??"#ffffff",branchBg:((u=r.theme)==null?void 0:u.branchBg)??"#ffffff",branchText:((w=r.theme)==null?void 0:w.branchText)??"#1f2937",lineColor:((y=r.theme)==null?void 0:y.lineColor)??"#94a3b8",bgColor:((_=r.theme)==null?void 0:_.bgColor)??"#f8fafc",fontSize:((A=r.theme)==null?void 0:A.fontSize)??14,lineWidthStart:(($=r.theme)==null?void 0:$.lineWidthStart)??2.2,lineWidthEnd:((j=r.theme)==null?void 0:j.lineWidthEnd)??.8,rainbowBranch:((p=r.theme)==null?void 0:p.rainbowBranch)??!1}}),B=t.reactive({autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:3.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"curve",layoutMode:"mindmap",taperedEdge:!0,showOrderBadge:!1});function jn(i){return B.taperedEdge?Wr(i):Qn(i)}function Jn(i){return B.taperedEdge?B.lineWidthEnd:Qn(i)}function Wr(i){return i<=0?B.lineWidthStart:i===1?Math.max(1.5,B.lineWidthStart*.67):i===2?Math.max(.8,B.lineWidthStart*.42):B.lineWidthEnd}function Qn(i){if(i<=0)return B.lineWidthStart;if(i>=3)return B.lineWidthEnd;const o=i/3;return B.lineWidthStart+(B.lineWidthEnd-B.lineWidthStart)*o}function Gr(i,o,u,w){const y=1-i,_=y*y*y*o.x+3*y*y*i*u.x1+3*y*i*i*u.x2+i*i*i*w.x,A=y*y*y*o.y+3*y*y*i*u.y1+3*y*i*i*u.y2+i*i*i*w.y;return{x:_,y:A}}function Kr(i,o,u,w,y=32,_="curve",A="right"){if(_==="curve"){let ve;if(A==="right"||A==="left"){const oe=Math.abs(o.x-i.x)*.45,Oe=A==="right"?1:-1;ve={x1:i.x+Oe*oe,y1:i.y,x2:o.x-Oe*oe,y2:o.y}}else{const oe=Math.abs(o.y-i.y)*.45;ve={x1:i.x,y1:i.y+oe,x2:o.x,y2:o.y-oe}}const hi=X=>{const oe=1-X,Oe=-3*oe*oe*i.x+3*(oe*oe-2*oe*X)*ve.x1+3*(2*oe*X-X*X)*ve.x2+3*X*X*o.x,Xe=-3*oe*oe*i.y+3*(oe*oe-2*oe*X)*ve.y1+3*(2*oe*X-X*X)*ve.y2+3*X*X*o.y;return{dx:Oe,dy:Xe}},at=[],qt=[];for(let X=0;X<=y;X++){const oe=X/y,Oe=X===0?i:X===y?o:Gr(oe,i,ve,o),Xe=hi(oe);let Ct=Math.hypot(Xe.dx,Xe.dy);Ct<1e-6&&(Ct=1);const bi=-Xe.dy/Ct,yi=Xe.dx/Ct,vt=(u+(w-u)*oe)/2;at.push({x:Oe.x+bi*vt,y:Oe.y+yi*vt}),qt.push({x:Oe.x-bi*vt,y:Oe.y-yi*vt})}let Mt=`M ${at[0].x.toFixed(2)} ${at[0].y.toFixed(2)}`;for(let X=1;X<=y;X++)Mt+=` L ${at[X].x.toFixed(2)} ${at[X].y.toFixed(2)}`;for(let X=y;X>=0;X--)Mt+=` L ${qt[X].x.toFixed(2)} ${qt[X].y.toFixed(2)}`;return Mt+=" Z",Mt}const $=o.x-i.x,j=o.y-i.y;let p=Math.hypot($,j);p<1e-6&&(p=1);const K=-j/p,Ne=$/p,Ce=u/2,pe=w/2,nt={x:i.x+K*Ce,y:i.y+Ne*Ce},it={x:i.x-K*Ce,y:i.y-Ne*Ce},ot={x:o.x-K*pe,y:o.y-Ne*pe},rt={x:o.x+K*pe,y:o.y+Ne*pe};return`M ${nt.x.toFixed(2)} ${nt.y.toFixed(2)} L ${rt.x.toFixed(2)} ${rt.y.toFixed(2)} L ${ot.x.toFixed(2)} ${ot.y.toFixed(2)} L ${it.x.toFixed(2)} ${it.y.toFixed(2)} Z`}const wt=t.computed(()=>be.value.root.children),Yr=qe[0].colors,ei=t.computed(()=>Wi(B.branchPaletteId,B.customPalettes)),$e=t.computed(()=>{const i=new Map;if(!B.rainbowBranch)return i;const o=r.lineColors,u=o&&o.length>0?o:ei.value.colors.length>0?ei.value.colors:Yr;for(let y=0;y<wt.value.length;y++){const _=wt.value[y];i.set(_.id,u[y%u.length])}const w=(y,_)=>{i.set(y.id,_);for(const A of y.children)w(A,_)};for(let y=0;y<wt.value.length;y++){const _=wt.value[y];w(_,u[y%u.length])}return i});function Zr(i,o){return B.rainbowBranch?$e.value.get(o.id)??_e.value.lineColor:_e.value.lineColor}function Xr(i){const o=J(i.id);if(o.bg)return o.bg;if(i.isRoot)return _e.value.rootBg;if(B.rainbowBranch){const u=$e.value.get(i.id);if(u)return Qr(u,.18)}return _e.value.branchBg}function qr(i){const o=J(i.id);if(o.textColor)return o.textColor;if(i.isRoot)return _e.value.rootText;if(B.rainbowBranch){const u=$e.value.get(i.id);if(u)return ti(u,.55)}return _e.value.branchText}function jr(i){const o=J(i.id);if(o.borderColor)return o.borderColor;if(i.isRoot)return _e.value.rootBg;if(B.rainbowBranch){const u=$e.value.get(i.id);if(u)return ti(u,.3)}return _e.value.lineColor}function Jr(i){return J(i.id).fontWeight??(i.isRoot?600:400)}function Qr(i,o){const u=i.replace("#",""),w=u.length===6?u:u.split("").map($=>$+$).join(""),y=parseInt(w.slice(0,2),16),_=parseInt(w.slice(2,4),16),A=parseInt(w.slice(4,6),16);return`rgba(${y}, ${_}, ${A}, ${o})`}function ti(i,o){const u=i.replace("#",""),w=u.length===6?u:u.split("").map($=>$+$).join(""),y=Math.round(parseInt(w.slice(0,2),16)*(1-o)),_=Math.round(parseInt(w.slice(2,4),16)*(1-o)),A=Math.round(parseInt(w.slice(4,6),16)*(1-o));return`rgb(${y}, ${_}, ${A})`}const H=Ji({getContainer:()=>f.value});H.setOnMarqueeEnd(ya),eo({isEditing:()=>s.value!==null,isReadonly:()=>r.previewMode,getSelectedId:()=>d.value,getRootId:()=>m.value.id,defaultTargetId:()=>m.value.id,onAddChild:Ze,onAddSibling:St,onAddSiblingBefore:ri,onRemove:li,onStartEdit:tt,onClearSelection:()=>{d.value=null,l("select",null)},onDuplicate:ai,onUndo:Kt,onRedo:Yt,onNavigate:da,onSelectRoot:()=>{d.value=m.value.id;const i=W(m.value,m.value.id);i&&l("select",i)}});const be=t.computed(()=>{const i=Te(m.value);return ii(i),Vi(i,{mode:B.layoutMode,baseFontSize:_e.value.fontSize,richHeights:O.value,richWidths:C.value})}),ni=t.ref([]),Gt=t.computed(()=>(se.value,ni.value));t.watch(be,i=>{const o=[],u=w=>{o.push(w);for(const y of w.children)u(y)};u(i.root),ni.value=o},{immediate:!0});const ea=t.computed(()=>{const i=[];for(const o of Gt.value)for(const u of o.children)i.push({from:o,to:u,key:`${o.id}->${u.id}`});return i}),ta=t.computed(()=>`${be.value.vbX} ${be.value.vbY} ${be.value.vbW} ${be.value.vbH}`);function ii(i){if(g.value.has(i.id)){i.children=[],i.collapsed=!0;return}i.collapsed=!1;for(const o of i.children)ii(o)}function tt(i){const o=W(m.value,i);o&&(s.value=i,c.value=o.text,t.nextTick(()=>{const u=document.querySelector(".zm-input");u==null||u.focus(),u==null||u.select()}))}function _t(i={}){if(!s.value)return;const o=W(m.value,s.value);o&&o.text!==(c.value.trim()||" ")&&(o.text=c.value.trim()||" ",ce(),l("change",m.value));const u=s.value;s.value=null,i.addChild?t.nextTick(()=>Ze(u)):i.addSibling==="after"?t.nextTick(()=>St(u)):i.addSibling==="before"&&t.nextTick(()=>ri(u))}function na(){s.value=null}function ia(i){if(r.previewMode)return;const o=W(m.value,i);o!=null&&o.richContent&&(b.value=i,k.value=o.richContent.raw,t.nextTick(()=>{const u=document.querySelector(".zm-node .zm-rich textarea");u==null||u.focus()}))}function oi(){if(!b.value)return;const i=b.value,o=W(m.value,i),u=k.value;if(o&&o.richContent&&o.richContent.raw!==u)if(o.richContent.kind==="code"){const w=Xn(u)||void 0;M(i,{kind:"code",raw:u,lang:w})}else M(i,{kind:"table",raw:u});b.value=null}function oa(){b.value=null}function ra(i){i.key==="Escape"?(i.preventDefault(),oa()):i.key==="Enter"&&(i.ctrlKey||i.metaKey)&&(i.preventDefault(),oi())}function aa(i,o){const u=h.value.get(i);!u||u.col!==o?h.value.set(i,{col:o,dir:"asc"}):u.dir==="asc"?h.value.set(i,{col:o,dir:"desc"}):h.value.delete(i)}function la(i,o){const u=h.value.get(i);return!u||o.length<=1?o:yr(o,u.col,u.dir)}function sa(i,o){const u=h.value.get(i);return!u||u.col!==o?"↕":u.dir==="asc"?"▲":"▼"}function ca(i){const o=i.metaKey||i.ctrlKey;o&&(i.key==="z"||i.key==="Z")&&!i.shiftKey?(i.preventDefault(),Kt()):(o&&i.shiftKey&&(i.key==="z"||i.key==="Z")||o&&(i.key==="y"||i.key==="Y")&&!i.shiftKey)&&(i.preventDefault(),Yt())}function Ze(i){const o=on(m.value,i,dt);o&&(ce(),te(),l("change",m.value),t.nextTick(()=>tt(o.id)))}function St(i){if(i===m.value.id){Ze(i);return}const o=rn(m.value,i,dt);o&&(ce(),te(),l("change",m.value),t.nextTick(()=>tt(o.id)))}function ri(i){if(i===m.value.id){Ze(i);return}const o=Yi(m.value,i,dt);o&&(ce(),te(),l("change",m.value),t.nextTick(()=>tt(o.id)))}function ai(i){if(i===m.value.id)return;const o=Zi(m.value,i);o&&(ce(),d.value=o.id,l("change",m.value),te())}function Kt(){const i=Me.undo();i&&(m.value=i.data,d.value=null,l("select",null),te(),l("change",m.value))}function Yt(){const i=Me.redo();i&&(m.value=i.data,d.value=null,l("select",null),te(),l("change",m.value))}function da(i,o){const u=d.value??m.value.id,w=W(m.value,u);if(!w)return;let y=null;if(o===1){const _=we(m.value,w.id);if(_){const A=_.children.findIndex($=>$.id===w.id);A>=0&&A<_.children.length-1&&(y=_.children[A+1].id)}}else if(o===-1){const _=we(m.value,w.id);if(_){const A=_.children.findIndex($=>$.id===w.id);A>0&&(y=_.children[A-1].id)}}else if(i===1){const _=we(m.value,w.id);_&&(y=_.id)}else i===-1&&w.children.length>0&&(y=w.children[0].id);if(y){d.value=y;const _=W(m.value,y);_&&l("select",_)}}function li(i){i!==m.value.id&&Rt(m.value,i)&&(ce(),d.value===i&&(d.value=null),te(),l("change",m.value))}function si(i){g.value.has(i)?g.value.delete(i):g.value.add(i),te()}function ci(i){const o=[{n:m.value,depth:1}];for(;o.length;){const{n:u,depth:w}=o.pop();i(u,w);for(let y=u.children.length-1;y>=0;y--)o.push({n:u.children[y],depth:w+1})}}function ua(){g.value=new Set,ci(i=>{i.children.length>0&&g.value.add(i.id)}),te()}function di(i){g.value=new Set,ci((o,u)=>{u>i&&o.children.length>0&&g.value.add(o.id)}),te()}function fa(){g.value=new Set,te()}function ga(i,o){Gi(m.value,i,o)&&(ce(),te(),l("change",m.value))}function ma(i,o,u){return Ki(m.value,i,o,u)?(ce(),te(),l("change",m.value),!0):!1}function pa(i,o){i.stopPropagation(),d.value=o.id;const u=W(m.value,o.id);l("select",u)}function ha(i){const o=i.target;if(!o||o.closest(".zm-node, .zm-toolbar, button, input, textarea"))return;if(i.button===2){H.startPan(i);return}if(i.button!==0)return;const u=f.value.getBoundingClientRect(),w=(i.clientX-u.left-H.offsetX.value)/H.scale.value,y=(i.clientY-u.top-H.offsetY.value)/H.scale.value;H.startMarquee(w,y)}function ba(i){if(R){R=!1;return}const o=i.target;if(!o||o.closest(".zm-node"))return;const u=H.marquee;u.width>=4||u.height>=4||d.value!==null&&(d.value=null,l("select",null))}function ya(){const i=H.marquee;if(i.width<4&&i.height<4)return;const o=i.x,u=i.y,w=i.x+i.width,y=i.y+i.height,_=[];for(const A of Gt.value){const $=A.width/2,j=A.height/2,p=A.x-$,K=A.x+$,Ne=A.y-j,Ce=A.y+j;p<=w&&K>=o&&Ne<=y&&Ce>=u&&_.push(A.id)}if(_.length>0){d.value=_[0];const A=W(m.value,_[0]);A&&l("select",A)}}function ui(i){return g.value.has(i)}function Ea(i){const o=W(m.value,i.id);return!!o&&o.children.length>0}function Zt(i){const o=W(m.value,i);return o?o.children.length:0}function fi(i){if(!W(m.value,i))return 0;const w=[m.value];for(;w.length;){const y=w.pop(),_=y.children.findIndex(A=>A.id===i);if(_>=0)return _;for(const A of y.children)w.push(A)}return 0}function gi(i,o,u,w){if(((w==null?void 0:w._dir)??i._dir)==="down")return o==="out"?{x:i.x,y:i.y+i.height/2}:{x:i.x,y:i.y-i.height/2};let _;o==="in"?_=-i.side:u!==void 0?_=u:_=i.side;const A=o==="in"?i._richInsetX??0:0;return{x:i.x+_*(i.width/2-A),y:i.y}}function Re(){const i=be.value;H.resetView(i.width,i.height,i.root.y)}function xa(){he.value=!0,ce(),te(),t.nextTick(()=>Re())}function Xt(i){B.layoutMode!==i&&(B.layoutMode=i,te(),t.nextTick(()=>Re()))}function mi(){return JSON.stringify(m.value,null,2)}function pi(i){try{const o=JSON.parse(i);return!o.id||!Array.isArray(o.children)?!1:(Me.reset(),m.value=Te(o),d.value=null,g.value=new Set,te(),t.nextTick(()=>Re()),l("change",m.value),!0)}catch{return!1}}function ka(){const i=document.createElement("input");i.type="file",i.accept="application/json",i.onchange=()=>{var w;const o=(w=i.files)==null?void 0:w[0];if(!o)return;const u=new FileReader;u.onload=()=>{typeof u.result=="string"&&(pi(u.result)||alert("导入失败:JSON 格式无效"))},u.readAsText(o)},i.click()}function Na(){const i=new Blob([mi()],{type:"application/json"}),o=URL.createObjectURL(i),u=document.createElement("a");u.href=o,u.download=`${m.value.text||"mindmap"}.json`,u.click(),URL.revokeObjectURL(o)}return a({addChild:i=>Ze(i),addSibling:i=>St(i),removeNode:i=>li(i),duplicateNode:i=>ai(i),setNodeText:(i,o)=>ga(i,o),moveNode:(i,o,u)=>ma(i,o,u),lineWidthForDepth:jn,endWidthForDepth:Jn,getData:()=>m.value,setData:i=>{Me.reset(),m.value=Te(i),d.value=null,g.value=new Set,te(),ce(),t.nextTick(()=>Re())},resetView:()=>Re(),exportData:mi,importData:pi,getMarkdown:()=>ut(m.value),setMarkdown:(i,o=!0)=>{const u=Ot(i||"");o&&(N.value=!0),F=!o,Me.reset(),m.value=Te(u),d.value=null,g.value=new Set,te(),ce(),t.nextTick(()=>{F=!1,Re()}),l("change",m.value)},setBalanced:i=>{he.value=i},isBalanced:()=>he.value,balance:()=>xa(),applyNodeStyle:(i,o)=>L(i,o),getNodeStyle:i=>J(i),applyNodeImage:(i,o)=>ee(i,o),applyNodeImageByUrl:(i,o)=>G(i,o),removeNodeImage:i=>ae(i),applyNodeLink:(i,o)=>ie(i,o),removeNodeLink:i=>fe(i),applyNodeNote:(i,o)=>E(i,o),removeNodeNote:i=>v(i),applyNodeRichContent:(i,o)=>M(i,o),undo:()=>Kt(),redo:()=>Yt(),canUndo:()=>Me.canUndo(),canRedo:()=>Me.canRedo(),applySettings:i=>{i.autoBalanceOnChange!==void 0&&(B.autoBalanceOnChange=i.autoBalanceOnChange),i.lineWidthStart!==void 0&&(B.lineWidthStart=Math.max(.5,Math.min(20,i.lineWidthStart))),i.lineWidthEnd!==void 0&&(B.lineWidthEnd=Math.max(.3,Math.min(10,i.lineWidthEnd))),i.rainbowBranch!==void 0&&(B.rainbowBranch=i.rainbowBranch),i.branchPaletteId!==void 0&&(B.branchPaletteId=i.branchPaletteId),i.customPalettes!==void 0&&(B.customPalettes=i.customPalettes),i.lineStyle!==void 0&&(B.lineStyle=i.lineStyle),i.taperedEdge!==void 0&&(B.taperedEdge=i.taperedEdge),i.showOrderBadge!==void 0&&(B.showOrderBadge=i.showOrderBadge)},getSettings:()=>({autoBalanceOnChange:B.autoBalanceOnChange,lineWidthStart:B.lineWidthStart,lineWidthEnd:B.lineWidthEnd,rainbowBranch:B.rainbowBranch,branchPaletteId:B.branchPaletteId,customPalettes:B.customPalettes,lineStyle:B.lineStyle,layoutMode:B.layoutMode,taperedEdge:B.taperedEdge,showOrderBadge:B.showOrderBadge}),setBranchPalette:i=>{if(!i)return;[...qe,...B.customPalettes].find(u=>u.id===i)&&(B.branchPaletteId=i)},getBranchPalette:()=>B.branchPaletteId,getBranchPalettes:()=>[...qe,...B.customPalettes]}),t.watch(()=>r.data,i=>{m.value=Te(i),te()},{deep:!1}),t.onMounted(()=>{ce(),t.nextTick(()=>Re())}),(i,o)=>{var u,w,y,_,A,$,j;return t.openBlock(),t.createElementBlock("div",{class:"zm-mindmap",style:t.normalizeStyle({background:_e.value.bgColor,fontSize:_e.value.fontSize+"px"})},[t.createElementVNode("div",{ref_key:"wrapperRef",ref:f,class:"zm-canvas",onMousedown:ha,onContextmenu:Ee,onWheel:o[25]||(o[25]=(...p)=>t.unref(H).onWheel&&t.unref(H).onWheel(...p)),onMouseenter:o[26]||(o[26]=p=>x.value=!0),onMouseleave:o[27]||(o[27]=p=>x.value=!1),onClick:ba},[t.createElementVNode("div",{class:"zm-svg-layer",style:t.normalizeStyle({left:be.value.vbX*t.unref(H).scale.value+t.unref(H).offsetX.value+"px",top:be.value.vbY*t.unref(H).scale.value+t.unref(H).offsetY.value+"px",width:be.value.vbW*t.unref(H).scale.value+"px",height:be.value.vbH*t.unref(H).scale.value+"px"})},[(t.openBlock(),t.createElementBlock("svg",{class:"zm-svg",viewBox:ta.value,preserveAspectRatio:"xMinYMin meet",width:be.value.vbW*t.unref(H).scale.value,height:be.value.vbH*t.unref(H).scale.value},[t.createElementVNode("g",xr,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(ea.value,p=>(t.openBlock(),t.createElementBlock("path",{key:p.key,d:Kr(gi(p.from,"out",p.to.side,p.to),gi(p.to,"in"),jn(p.from.depth),Jn(p.to.depth),32,B.lineStyle,p.to._dir),fill:Zr(p.from,p.to),stroke:"none"},null,8,kr))),128))])],8,Er))],4),t.unref(H).isMarquee.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:"zm-marquee",style:t.normalizeStyle({left:t.unref(H).marquee.x*t.unref(H).scale.value+t.unref(H).offsetX.value+"px",top:t.unref(H).marquee.y*t.unref(H).scale.value+t.unref(H).offsetY.value+"px",width:t.unref(H).marquee.width*t.unref(H).scale.value+"px",height:t.unref(H).marquee.height*t.unref(H).scale.value+"px"})},null,4)):t.createCommentVNode("",!0),t.createElementVNode("div",{class:"zm-world",style:t.normalizeStyle({transform:`translate(${t.unref(H).offsetX.value}px, ${t.unref(H).offsetY.value}px) scale(${t.unref(H).scale.value})`})},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Gt.value,p=>(t.openBlock(),t.createElementBlock("div",{key:p.id,class:t.normalizeClass(["zm-node",{"is-root":p.isRoot,"is-selected":d.value===p.id,"is-editing":s.value===p.id,"has-image":!!p.image,"is-resizing":Ge.value===p.id}]),"data-node-id":p.id,style:t.normalizeStyle({left:p.x+"px",top:p.y+"px",width:p.width+"px",minWidth:p.width+"px",height:p.height+"px",fontSize:p.fontSize+"px",background:Xr(p),color:qr(p),borderColor:jr(p),fontWeight:Jr(p),transform:"translate(-50%, -50%)"}),onClick:K=>pa(K,p),onDblclick:K=>{K.stopPropagation(),e.previewMode||tt(p.id)},onContextmenu:K=>ne(K,p),onMouseenter:K=>V(p.id),onMouseleave:K=>Z(p.id)},[p.image?(t.openBlock(),t.createElementBlock("img",{key:0,class:"zm-node-img",src:p.image.src,width:p.image.width,height:p.image.height,alt:p.text,draggable:"false"},null,8,wr)):t.createCommentVNode("",!0),p.richContent&&(p.richContent.kind==="code"||p.richContent.kind==="table")&&s.value!==p.id?(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass(["zm-rich zm-rich-above",{"zm-rich-no-overflow":p.richContent.kind==="table"||p.richContent.kind==="code"}]),onClick:o[1]||(o[1]=t.withModifiers(()=>{},["stop"])),onDblclick:t.withModifiers(K=>ia(p.id),["stop"]),onMousedown:o[2]||(o[2]=t.withModifiers(()=>{},["stop"]))},[b.value===p.id?t.withDirectives((t.openBlock(),t.createElementBlock("textarea",{key:0,"onUpdate:modelValue":o[0]||(o[0]=K=>k.value=K),class:"zm-rich-edit",spellcheck:"false",onBlur:oi,onKeydown:ra},null,544)),[[t.vModelText,k.value]]):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[p.richContent.kind==="code"?(t.openBlock(),t.createElementBlock("pre",Sr,[t.createElementVNode("code",{innerHTML:t.unref(pr)(t.unref(Zn)(p.richContent.raw),t.unref(Xn)(p.richContent.raw))},null,8,Mr)])):p.richContent.kind==="table"?(t.openBlock(),t.createElementBlock("table",Cr,[t.createElementVNode("tbody",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(la(p.id,t.unref(hr)(p.richContent.raw)),(K,Ne)=>(t.openBlock(),t.createElementBlock("tr",{key:Ne},[Ne===0?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:0},t.renderList(K,(Ce,pe)=>{var nt,it,ot,rt,ve;return t.openBlock(),t.createElementBlock("th",{key:`h${pe}`,class:t.normalizeClass(["zm-rich-table-sort",{"is-sorted":((nt=h.value.get(p.id))==null?void 0:nt.col)===pe,"is-asc":((it=h.value.get(p.id))==null?void 0:it.col)===pe&&((ot=h.value.get(p.id))==null?void 0:ot.dir)==="asc","is-desc":((rt=h.value.get(p.id))==null?void 0:rt.col)===pe&&((ve=h.value.get(p.id))==null?void 0:ve.dir)==="desc"}]),onClick:t.withModifiers(hi=>aa(p.id,pe),["stop"])},[t.createElementVNode("span",null,t.toDisplayString(Ce),1),t.createElementVNode("span",Tr,t.toDisplayString(sa(p.id,pe)),1)],10,vr)}),128)):(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:1},t.renderList(K,(Ce,pe)=>(t.openBlock(),t.createElementBlock("td",{key:`c${pe}`},t.toDisplayString(Ce),1))),128))]))),128))])])):t.createCommentVNode("",!0)],64))],42,_r)):t.createCommentVNode("",!0),s.value!==p.id?(t.openBlock(),t.createElementBlock("span",Ar,[t.createElementVNode("span",Rr,t.toDisplayString(p.text),1),p.link&&!s.value?(t.openBlock(),t.createElementBlock("a",{key:0,class:"zm-node-link",href:p.link.url,target:"_blank",rel:"noopener noreferrer",title:`打开链接:${p.link.url}`,onClick:o[3]||(o[3]=t.withModifiers(()=>{},["stop"])),onMousedown:o[4]||(o[4]=t.withModifiers(()=>{},["stop"]))},[t.createVNode(q,{name:"link",size:11,stroke:2})],40,Or)):t.createCommentVNode("",!0),p.note&&!s.value?(t.openBlock(),t.createElementBlock("button",{key:1,class:"zm-node-note-btn",type:"button",title:Nt(p.note.text),onClick:t.withModifiers(K=>D(p.id),["stop"]),onMousedown:o[5]||(o[5]=t.withModifiers(()=>{},["stop"]))},[t.createVNode(q,{name:"note",size:11,stroke:2})],40,Ir)):t.createCommentVNode("",!0)])):t.withDirectives((t.openBlock(),t.createElementBlock("input",{key:3,class:"zm-input","onUpdate:modelValue":o[6]||(o[6]=K=>c.value=K),autofocus:"",onBlur:o[7]||(o[7]=K=>_t()),onKeydown:[o[8]||(o[8]=t.withKeys(t.withModifiers(K=>_t({addSibling:"after"}),["exact"]),["enter"])),o[9]||(o[9]=t.withKeys(t.withModifiers(K=>_t({addSibling:"before"}),["shift","prevent","exact"]),["enter"])),o[10]||(o[10]=t.withKeys(t.withModifiers(K=>_t({addChild:!0}),["prevent"]),["tab"])),t.withKeys(na,["esc"]),ca],onMousedown:o[11]||(o[11]=t.withModifiers(()=>{},["stop"])),onClick:o[12]||(o[12]=t.withModifiers(()=>{},["stop"]))},null,544)),[[t.vModelText,c.value]]),I.value?(t.openBlock(),t.createElementBlock("span",{key:4,class:"zm-order-badge",title:`数据顺序:第 ${fi(p.id)+1} 个`},t.toDisplayString(fi(p.id)+1),9,Br)):t.createCommentVNode("",!0),ui(p.id)&&Zt(p.id)>0?(t.openBlock(),t.createElementBlock("span",{key:5,class:t.normalizeClass(["zm-collapse-badge",{"is-on-left":p.side===-1}]),style:t.normalizeStyle({background:$e.value.get(p.id)??"#64748b"}),title:`展开 ${Zt(p.id)} 个子节点`,onMousedown:o[13]||(o[13]=t.withModifiers(()=>{},["stop"])),onClick:t.withModifiers(K=>si(p.id),["stop"])},t.toDisplayString(Zt(p.id)),47,Lr)):t.createCommentVNode("",!0),Ea(p)&&!ui(p.id)?(t.openBlock(),t.createElementBlock("button",{key:6,class:t.normalizeClass(["zm-btn zm-collapse",{"is-on-left":p.side===-1}]),style:t.normalizeStyle({color:$e.value.get(p.id)??"#64748b",borderColor:$e.value.get(p.id)??"#64748b"}),title:"折叠",onMousedown:o[14]||(o[14]=t.withModifiers(()=>{},["stop"])),onClick:t.withModifiers(K=>si(p.id),["stop"])},[t.createVNode(q,{name:"minus",size:10,stroke:2.4})],46,Dr)):t.createCommentVNode("",!0),p.image&&d.value===p.id&&s.value!==p.id?(t.openBlock(),t.createElementBlock("span",{key:7,class:"zm-img-resize-handle",title:"拖动调整图片大小",onMousedown:t.withModifiers(K=>Ae(K,p),["stop"])},null,40,zr)):t.createCommentVNode("",!0),p.image&&d.value===p.id&&s.value!==p.id?(t.openBlock(),t.createElementBlock("button",{key:8,class:"zm-img-remove-btn",title:"移除图片",onMousedown:o[15]||(o[15]=t.withModifiers(()=>{},["stop"])),onClick:t.withModifiers(K=>ae(p.id),["stop"])},[t.createVNode(q,{name:"x",size:9,stroke:2.2})],40,$r)):t.createCommentVNode("",!0)],46,Nr))),128))],4),T.value?(t.openBlock(),t.createBlock(no,{key:1,x:T.value.x,y:T.value.y,container:f.value,"has-image":!!((u=t.unref(W)(m.value,T.value.nodeId))!=null&&u.image),"has-link":!!((w=t.unref(W)(m.value,T.value.nodeId))!=null&&w.link),"has-note":!!((y=t.unref(W)(m.value,T.value.nodeId))!=null&&y.note),"has-code":((A=(_=t.unref(W)(m.value,T.value.nodeId))==null?void 0:_.richContent)==null?void 0:A.kind)==="code","has-table":((j=($=t.unref(W)(m.value,T.value.nodeId))==null?void 0:$.richContent)==null?void 0:j.kind)==="table",onPickImage:xt,onRemoveImage:We,onSetLink:Ut,onRemoveLink:Ht,onEditNote:Ft,onRemoveNote:Wt,onAddCode:Qe,onEditCode:Qe,onRemoveCode:ke,onAddTable:kt,onEditTable:kt,onRemoveTable:et,onClose:ge},null,8,["x","y","container","has-image","has-link","has-note","has-code","has-table"])):t.createCommentVNode("",!0),U.value?(t.openBlock(),t.createBlock(io,{key:2,x:U.value.x,y:U.value.y,container:f.value,onOpenData:yt,onOpenImport:Et,onOpenSettings:xe,onClose:me},null,8,["x","y","container"])):t.createCommentVNode("",!0),t.createElementVNode("div",{class:t.normalizeClass(["zm-toolbar",{"is-preview-only":r.previewMode,"is-hovered":x.value}])},[t.createElementVNode("span",Pr,t.toDisplayString(Math.round(t.unref(H).scale.value*100))+"%",1),t.createElementVNode("button",{class:"zm-tb-btn",title:"放大",onClick:o[16]||(o[16]=(...p)=>t.unref(H).zoomIn&&t.unref(H).zoomIn(...p))},[t.createVNode(q,{name:"zoom-in"})]),t.createElementVNode("button",{class:"zm-tb-btn",title:"缩小",onClick:o[17]||(o[17]=(...p)=>t.unref(H).zoomOut&&t.unref(H).zoomOut(...p))},[t.createVNode(q,{name:"zoom-out"})]),t.createElementVNode("button",{class:"zm-tb-btn",title:"重置视图",onClick:Re},[t.createVNode(q,{name:"reset"})]),o[31]||(o[31]=t.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),t.createElementVNode("button",{class:"zm-tb-btn",title:"全部收起",onClick:ua},[t.createVNode(q,{name:"collapse-all"})]),t.createElementVNode("button",{class:"zm-tb-btn",title:"展开一级",onClick:o[18]||(o[18]=p=>di(1))},[t.createVNode(q,{name:"expand-level-1"})]),t.createElementVNode("button",{class:"zm-tb-btn",title:"展开二级",onClick:o[19]||(o[19]=p=>di(2))},[t.createVNode(q,{name:"expand-level-2"})]),t.createElementVNode("button",{class:"zm-tb-btn",title:"全部展开",onClick:fa},[t.createVNode(q,{name:"expand-all"})]),o[32]||(o[32]=t.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),t.createElementVNode("button",{class:"zm-tb-btn",title:"导出 JSON",onClick:Na},[t.createVNode(q,{name:"export"})]),r.previewMode?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[o[28]||(o[28]=t.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),t.createElementVNode("button",{class:"zm-tb-btn",title:"添加子节点 (Tab)",onClick:o[20]||(o[20]=p=>d.value&&Ze(d.value))},[t.createElementVNode("img",{src:t.unref(wi),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,Vr)]),t.createElementVNode("button",{class:"zm-tb-btn",title:"添加同级 (Enter)",onClick:o[21]||(o[21]=p=>d.value&&St(d.value))},[t.createElementVNode("img",{src:t.unref(Ni),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,Ur)]),o[29]||(o[29]=t.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),t.createElementVNode("button",{class:t.normalizeClass(["zm-tb-btn",{active:B.layoutMode==="mindmap"}]),title:"思维导图布局 (中心辐射)",onClick:o[22]||(o[22]=p=>Xt("mindmap"))},[t.createVNode(q,{name:"mindmap"})],2),t.createElementVNode("button",{class:t.normalizeClass(["zm-tb-btn",{active:B.layoutMode==="tree"}]),title:"树形布局 (向右展开)",onClick:o[23]||(o[23]=p=>Xt("tree"))},[t.createVNode(q,{name:"tree"})],2),t.createElementVNode("button",{class:t.normalizeClass(["zm-tb-btn",{active:B.layoutMode==="org"}]),title:"组织结构布局 (向下展开)",onClick:o[24]||(o[24]=p=>Xt("org"))},[t.createVNode(q,{name:"org"})],2),o[30]||(o[30]=t.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),t.createElementVNode("button",{class:"zm-tb-btn",title:"导入 JSON",onClick:ka},[t.createVNode(q,{name:"import"})])],64))],2)],544)],4)}}}),Hr={install(e){e.component("FlowMindMap",qn)}};de.MindMap=qn,de.addChild=on,de.addSibling=rn,de.clone=Te,de.default=Hr,de.findNode=W,de.findParent=we,de.markdownToMindMap=Ot,de.markdownToRichMindMap=qi,de.mindMapToMarkdown=ut,de.removeNode=Rt,de.richBlockToMarkdown=ji,de.uid=Se,Object.defineProperties(de,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});