flow-mindmap 0.3.2 → 0.3.3
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
|
-
`);_&&(
|
|
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:
|
|
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 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"},te=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==="data"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:14},[i[24]||(i[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)),i[25]||(i[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)),i[26]||(i[26]=t.createElementVNode("line",{x1:"10.5",y1:"12",x2:"13.5",y2:"12"},null,-1))],64)):e.name==="logo"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:15},[i[27]||(i[27]=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:16},[i[28]||(i[28]=t.createElementVNode("path",{d:"M12 4 V15"},null,-1)),i[29]||(i[29]=t.createElementVNode("polyline",{points:"7 10 12 15 17 10"},null,-1)),i[30]||(i[30]=t.createElementVNode("path",{d:"M4 19 H20"},null,-1))],64)):e.name==="export"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:17},[i[31]||(i[31]=t.createElementVNode("path",{d:"M12 15 V4"},null,-1)),i[32]||(i[32]=t.createElementVNode("polyline",{points:"7 9 12 4 17 9"},null,-1)),i[33]||(i[33]=t.createElementVNode("path",{d:"M4 19 H20"},null,-1))],64)):e.name==="balance"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:18},[i[34]||(i[34]=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:19},[i[35]||(i[35]=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:20},[i[36]||(i[36]=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:21},[i[37]||(i[37]=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:22},[i[38]||(i[38]=t.createElementVNode("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"},null,-1)),i[39]||(i[39]=t.createElementVNode("circle",{cx:"9",cy:"11",r:"1.6"},null,-1)),i[40]||(i[40]=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:23},[i[41]||(i[41]=t.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"},null,-1)),i[42]||(i[42]=t.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"},null,-1))],64)):e.name==="link"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:24},[i[43]||(i[43]=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[44]||(i[44]=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:25},[i[45]||(i[45]=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[46]||(i[46]=t.createElementVNode("line",{x1:"8",y1:"10",x2:"16",y2:"10"},null,-1)),i[47]||(i[47]=t.createElementVNode("line",{x1:"8",y1:"13",x2:"16",y2:"13"},null,-1)),i[48]||(i[48]=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(vt(e,a)*Mi[at(e)])}function at(e){return Math.min(vi,Math.max(0,e))}function vt(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,Ee=24;let Ct=null;function Ai(){if(Ct)return Ct;const e=typeof document<"u"?document.createElement("canvas").getContext("2d"):null;return e?(Ct=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=vt(a,i),c=Math.min(Ri(e.text||"",s,Ni[f]),Di),d=Ci(a,i),g=Math.ceil(c+d*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 y=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,y),j=Math.ceil(b+F+_);return{w:I,h:j}}const O=zi(e.image.width,Oi,Ii),$=Math.max(m,y,Math.ceil(O+d*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 Ui(f),Vi(f,i,r),f.x=0,f.y=0,Hi(f,r)}function Vi(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 d=1,g=Math.abs(r[0]._subtreeH-(c-r[0]._subtreeH)),h=0;for(let b=0;b<r.length-1;b++){h+=r[b]._subtreeH;const k=Math.abs(h-(c-h));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 h of c.children)s(h,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};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,h,b)=>g+h._subtreeH+(b>0?Ve: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+i+g.width/2),g.y=d+c*g._subtreeH/2),g._dir=a,d+=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 d=$i(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:vt(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:i};if(e.collapsed)return g;const h=e.children.length,b=Math.ceil(h/2);return g.children=e.children.map((k,y)=>{const m=a===0?y<b?1:-1:r;return en(k,a+1,g,m,l,f,s,c)}),g}function Ui(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(),h=g.width/2,b=g.height/2;g.x-h<r&&(r=g.x-h),g.x+h>l&&(l=g.x+h),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+Ee*2,height:s-f+Ee*2,vbX:r-Ee,vbY:f-Ee,vbW:l-r+Ee*2,vbH:s-f+Ee*2};const c=Ee-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+Ee*2,height:s+Ee,vbX:r-Ee,vbY:0,vbW:l-r+Ee*2,vbH:s+Ee}}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 Fi(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 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 Ne(e,a,i=null){if(e.id===a)return i;for(const r of e.children){const l=Ne(r,a,e);if(l!==null)return l}return null}function Tt(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(Tt(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(!Ne(e,a)||a===i||H(H(e,a),i))return!1;const l=Ne(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=Ne(e,i);if(!c)return l.children.splice(f,0,s),!1;let d=c.children.findIndex(g=>g.id===i);return d<0?(l.children.splice(f,0,s),!1):(r==="after"&&(d+=1),c.children.splice(d,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:Se(),text:i??tn(r),children:[]};return r.children.push(l),l}function on(e,a,i){const r=Ne(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:i??tn(r),children:[]};return r.children.splice(l+1,0,f),f}function Ki(e,a,i){const r=Ne(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:i,children:[]};return r.children.splice(l,0,f),f}function Yi(e,a){const i=Ne(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=Te(l);return rn(f),i.children.splice(r+1,0,f),f}function rn(e){e.id=Se();for(const a of e.children)rn(a)}const ct="新节点";function At(e,a="导入的导图"){const i=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*$/,h=/^(`{3,}|~{3,})\s*(\S+)?\s*$/;let b=!1,k=[],y=null;function m(_){k.push(_)}function L(){if(y&&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
|
+
`);_&&(y.note={text:_})}b=!1,k=[]}for(const _ of i){if(b){const I=_.match(h);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:""}),y=s[s.length-1];continue}const O=_.match(h);if(O&&O[2]==="note"){b=!0,k=[];continue}const $=_.match(d);if($&&y){const I=$[2],j=160,ee=120;y.image={src:I,naturalW:j,naturalH:ee,width:j,height:ee};continue}const D=_.match(g);if(D&&y){y.link={url:D[2]},y.text=D[1];continue}if(_.trim().length>0&&y){const I=_.trim();y.body=y.body?y.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:Se(),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
4
|
`;e.link&&(i+=`[${e.text||"link"}](${e.link.url})
|
|
5
5
|
`),e.image&&(i+=`
|
|
6
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,
|
|
7
|
+
`);for(const r of e.children)i+=dt(r,a+1);return i}function Zi(e){var g,h;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+(.*)$/,d=/^(\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
8
|
`).trim();i.push({kind:"code",text:((g=I.split(`
|
|
9
9
|
`)[0])==null?void 0:g.slice(0,80))||"(空代码块)",raw:D.join(`
|
|
10
|
-
`),lang:$});continue}const
|
|
11
|
-
`)}),r=$;continue}}const m=b.match(c),L=b.match(
|
|
12
|
-
`)}),r=_}return i}function Xi(e,a="导入的导图"){const i=Zi(e||""),r={id:
|
|
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,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}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`),
|
|
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(`
|
|
10
|
+
`),lang:$});continue}const y=b.match(l);if(y){i.push({kind:"heading",level:y[1].length,text:y[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:((h=O[0].replace(/^\s*\|/,"").replace(/\|\s*$/,"").split("|")[0])==null?void 0:h.trim())||"表格",raw:O.join(`
|
|
11
|
+
`)}),r=$;continue}}const m=b.match(c),L=b.match(d);if(m||L){let O=r;for(;O<a.length;){const $=a[O].match(c),D=a[O].match(d);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)||d.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:Se(),text:a,children:[]},l=[r],f=[0];let s=!1;function c(d){if(d.kind==="heading"){const h=d.level;for(;l.length>1&&f[f.length-1]>=h;)l.pop(),f.pop();if(!s&&h===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(h);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 i)c(d);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),d=t.reactive({x:0,y:0,ox:0,oy:0}),g=t.ref(!1),h=t.reactive({x:0,y:0}),b=t.reactive({x:0,y:0,width:0,height:0}),k=t.ref(0);let y=null;function m(W){y=W}function L(W){W.preventDefault();const J=e.getContainer();if(!J)return;const ae=-W.deltaY*.001,ue=Math.min(i,Math.max(a,l.value*(1+ae))),oe=J.getBoundingClientRect(),fe=W.clientX-oe.left,x=W.clientY-oe.top,v=(fe-f.value)/l.value,M=(x-s.value)/l.value;l.value=ue,f.value=fe-v*ue,s.value=x-M*ue}function K(){l.value=Math.min(i,l.value*r)}function _(){l.value=Math.max(a,l.value/r)}function F(W){var ae;W.target.closest(".zm-node, .zm-toolbar, button, input, textarea")||(c.value=!0,d.x=W.clientX,d.y=W.clientY,d.ox=f.value,d.oy=s.value,window.addEventListener("mousemove",O),window.addEventListener("mouseup",$),(ae=W.preventDefault)==null||ae.call(W))}function O(W){c.value&&(f.value=d.ox+(W.clientX-d.x),s.value=d.oy+(W.clientY-d.y))}function $(){c.value=!1,window.removeEventListener("mousemove",O),window.removeEventListener("mouseup",$)}function D(W,J){g.value=!0,h.x=W,h.y=J,b.x=W,b.y=J,b.width=0,b.height=0,k.value++,window.addEventListener("mousemove",ee),window.addEventListener("mouseup",j)}function I(W,J){if(!g.value)return;const ae=Math.min(h.x,W),ue=Math.min(h.y,J),oe=Math.max(h.x,W),fe=Math.max(h.y,J);b.x=ae,b.y=ue,b.width=oe-ae,b.height=fe-ue,k.value++}function j(){g.value=!1,window.removeEventListener("mousemove",ee),window.removeEventListener("mouseup",j),y&&y()}function ee(W){if(!g.value)return;const J=e.getContainer();if(!J)return;const ae=J.getBoundingClientRect(),ue=(W.clientX-ae.left-f.value)/l.value,oe=(W.clientY-ae.top-s.value)/l.value;I(ue,oe)}function le(W,J,ae,ue=60){const oe=e.getContainer();if(!oe)return;const fe=oe.getBoundingClientRect(),x=(fe.width-ue*2)/W,v=(fe.height-ue*2)/J,M=Math.min(1,Math.max(.3,Math.min(x,v)));l.value=M,f.value=fe.width/2,s.value=fe.height/2-ae*M}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:le}}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 h=JSON.stringify(g);for(i<a.value.length-1&&(a.value=a.value.slice(0,i+1)),a.value.push(h),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 d(){a.value=[],i=-1}return{canUndo:r,canRedo:l,record:f,undo:s,redo:c,reset:d}}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,y=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)),y+_>m.bottom&&(y=Math.max(m.top+4,i.y-_-2)),k<m.left+2&&(k=m.left+2),y<m.top+2&&(y=m.top+2)}return{left:k,top:y}}),f=t.computed(()=>i.hasImage),s=t.computed(()=>i.hasLink),c=t.computed(()=>i.hasNote);function d(k){const y=k.target;y&&y.closest(".zm-node-menu")||r("close")}function g(k){k.key==="Escape"&&r("close")}function h(){r("close")}window.addEventListener("mousedown",d,!0),window.addEventListener("keydown",g,!0),window.addEventListener("wheel",h,!0),window.addEventListener("scroll",h,!0),t.onBeforeUnmount(()=>{window.removeEventListener("mousedown",d,!0),window.removeEventListener("keydown",g,!0),window.removeEventListener("wheel",h,!0),window.removeEventListener("scroll",h,!0)});function b(k){k(),r("close")}return(k,y)=>(t.openBlock(),t.createElementBlock("div",{class:"zm-node-menu",style:t.normalizeStyle({left:l.value.left+"px",top:l.value.top+"px"}),onContextmenu:y[10]||(y[10]=t.withModifiers(()=>{},["prevent"]))},[t.createElementVNode("button",{class:"zm-node-menu-item",onClick:y[0]||(y[0]=t.withModifiers(m=>b(()=>r("pickImage")),["stop"]))},[t.createVNode(te,{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:y[1]||(y[1]=t.withModifiers(m=>b(()=>r("removeImage")),["stop"]))},[t.createVNode(te,{name:"x",size:13}),y[11]||(y[11]=t.createElementVNode("span",null,"移除图片",-1))])):t.createCommentVNode("",!0),t.createElementVNode("button",{class:"zm-node-menu-item",onClick:y[2]||(y[2]=t.withModifiers(m=>b(()=>r("setLink")),["stop"]))},[t.createVNode(te,{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:y[3]||(y[3]=t.withModifiers(m=>b(()=>r("removeLink")),["stop"]))},[t.createVNode(te,{name:"x",size:13}),y[12]||(y[12]=t.createElementVNode("span",null,"移除链接",-1))])):t.createCommentVNode("",!0),t.createElementVNode("button",{class:"zm-node-menu-item",onClick:y[4]||(y[4]=t.withModifiers(m=>b(()=>r("addCode")),["stop"]))},[y[13]||(y[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:y[5]||(y[5]=t.withModifiers(m=>b(()=>r("removeCode")),["stop"]))},[t.createVNode(te,{name:"x",size:13}),y[14]||(y[14]=t.createElementVNode("span",null,"移除代码块",-1))])):t.createCommentVNode("",!0),t.createElementVNode("button",{class:"zm-node-menu-item",onClick:y[6]||(y[6]=t.withModifiers(m=>b(()=>r("addTable")),["stop"]))},[y[15]||(y[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:y[7]||(y[7]=t.withModifiers(m=>b(()=>r("removeTable")),["stop"]))},[t.createVNode(te,{name:"x",size:13}),y[16]||(y[16]=t.createElementVNode("span",null,"移除表格",-1))])):t.createCommentVNode("",!0),t.createElementVNode("button",{class:"zm-node-menu-item",onClick:y[8]||(y[8]=t.withModifiers(m=>b(()=>r("editNote")),["stop"]))},[t.createVNode(te,{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:y[9]||(y[9]=t.withModifiers(m=>b(()=>r("removeNote")),["stop"]))},[t.createVNode(te,{name:"x",size:13}),y[17]||(y[17]=t.createElementVNode("span",null,"移除笔记",-1))])):t.createCommentVNode("",!0)],36))}}),no=t.defineComponent({__name:"CanvasContextMenu",props:{x:{},y:{},container:{}},emits:["openSettings","openData","close"],setup(e,{emit:a}){const i=e,r=a,l=t.computed(()=>{let g=i.x+2,h=i.y+2;if(i.container){const b=i.container.getBoundingClientRect(),k=184,y=4+2*28;g+k>b.right&&(g=Math.max(b.left+4,i.x-k-2)),h+y>b.bottom&&(h=Math.max(b.top+4,i.y-y-2)),g<b.left+2&&(g=b.left+2),h<b.top+2&&(h=b.top+2)}return{left:g,top:h}});function f(g){const h=g.target;h&&h.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 d(g){g(),r("close")}return(g,h)=>(t.openBlock(),t.createElementBlock("div",{class:"zm-canvas-menu",style:t.normalizeStyle({left:l.value.left+"px",top:l.value.top+"px"}),onContextmenu:h[2]||(h[2]=t.withModifiers(()=>{},["prevent"]))},[t.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:h[0]||(h[0]=t.withModifiers(b=>d(()=>r("openData")),["stop"]))},[t.createVNode(te,{name:"data",size:13}),h[3]||(h[3]=t.createElementVNode("span",null,"查看数据",-1))]),h[5]||(h[5]=t.createTextVNode(" `n ",-1)),t.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:h[1]||(h[1]=t.withModifiers(b=>d(()=>r("openSettings")),["stop"]))},[t.createVNode(te,{name:"settings",size:13}),h[4]||(h[4]=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,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Oe(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 Rt{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=>{Rt._collapse(i)}))}}class lo extends Rt{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 je(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=>je(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 Ot(...e){return"("+(uo(e).capture?"":"?:")+e.map(r=>je(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 It(e,{joinWith:a}){let i=0;return e.map(r=>{i+=1;const l=i;let f=je(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*",Bt="[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.*/)),Oe({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=Oe({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=Ot("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:Bt,relevance:0},To={begin:"\\.\\s*"+Bt,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:Bt,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=Ot(...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 d=c.split("|");r[d[0]]=[f,Po(d[0],d[1])]})}}function Po(e,a){return a?Number(a):Vo(e)?0:1}function Vo(e){return zo.includes(e.toLowerCase())}const En={},Le=e=>{console.error(e)},xn=(e,...a)=>{console.log(`WARN: ${e}`,...a)},Ue=(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 Uo(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=It(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=It(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}),Uo(e),Ho(e)}function Go(e){function a(s,c){return new RegExp(je(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,d){d.position=this.position++,this.matchIndexes[this.matchAt]=d,this.regexes.push([d,c]),this.matchAt+=gn(c)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const c=this.regexes.map(d=>d[1]);this.matcherRe=a(It(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),h=this.matchIndexes[g];return d.splice(0,g),Object.assign(d,h)}}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 i;return this.rules.slice(c).forEach(([g,h])=>d.addRule(g,h)),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 h=this.getMatcher(0);h.lastIndex=this.lastIndex+1,g=h.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;[Ro,Bo,Wo,Do].forEach(h=>h(s,c)),e.compilerExtensions.forEach(h=>h(s,c)),s.__beforeBegin=null,[Oo,Io,Lo].forEach(h=>h(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)),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(h){return Ko(h==="self"?s:h)})),s.contains.forEach(function(h){f(h,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=Oe(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 Oe(e,{variants:null},a)})),e.cachedVariants?e.cachedVariants:wn(e)?Oe(e,{starts:e.starts?Oe(e.starts):null}):Object.isFrozen(e)?Oe(e):e}var Yo="11.11.1";class Zo extends Error{constructor(a,i){super(a),this.name="HTMLInjectionError",this.html=i}}const Lt=cn,Nn=Oe,_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 d(x){return c.noHighlightRe.test(x)}function g(x){let v=x.className+" ";v+=x.parentNode?x.parentNode.className:"";const M=c.languageDetectRe.exec(v);if(M){const C=ee(M[1]);return C||(xn(f.replace("{}",M[1])),xn("Falling back to no-highlight mode for this block.",x)),C?M[1]:"no-highlight"}return v.split(/\s+/).find(C=>d(C)||ee(C))}function h(x,v,M){let C="",U="";typeof v=="object"?(C=x,M=v.ignoreIllegals,U=v.language):(Ue("10.7.0","highlight(lang, code, ...args) has been deprecated."),Ue("10.7.0",`Please use highlight(code, options) instead.
|
|
14
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),U=x,C=v),M===void 0&&(M=!0);const ne={code:C,language:U};oe("before:highlight",ne);const ge=ne.result?ne.result:b(ne.language,ne.code,M);return ge.code=ne.code,oe("after:highlight",ge),ge}function b(x,v,M,C){const U=Object.create(null);function ne(S,A){return S.keywords[A]}function ge(){if(!B.keywords){ie.addText(Q);return}let S=0;B.keywordPatternRe.lastIndex=0;let A=B.keywordPatternRe.exec(Q),P="";for(;A;){P+=Q.substring(S,A.index);const Y=be.case_insensitive?A[0].toLowerCase():A[0],se=ne(B,Y);if(se){const[me,ce]=se;if(ie.addText(P),P="",U[Y]=(U[Y]||0)+1,U[Y]<=Xo&&(Ke+=ce),me.startsWith("_"))P+=A[0];else{const X=be.classNameAliases[me]||me;ke(A[0],X)}}else P+=A[0];S=B.keywordPatternRe.lastIndex,A=B.keywordPatternRe.exec(Q)}P+=Q.substring(S),ie.addText(P)}function xe(){if(Q==="")return;let S=null;if(typeof B.subLanguage=="string"){if(!a[B.subLanguage]){ie.addText(Q);return}S=b(B.subLanguage,Q,!0,Qe[B.subLanguage]),Qe[B.subLanguage]=S._top}else S=y(Q,B.subLanguage.length?B.subLanguage:null);B.relevance>0&&(Ke+=S.relevance),ie.__addSublanguage(S._emitter,S.language)}function pe(){B.subLanguage!=null?xe():ge(),Q=""}function ke(S,A){S!==""&&(ie.startScope(A),ie.addText(S),ie.endScope())}function bt(S,A){let P=1;const Y=A.length-1;for(;P<=Y;){if(!S._emit[P]){P++;continue}const se=be.classNameAliases[S[P]]||S[P],me=A[P];se?ke(me,se):(Q=me,ge(),Q=""),P++}}function yt(S,A){return S.scope&&typeof S.scope=="string"&&ie.openNode(be.classNameAliases[S.scope]||S.scope),S.beginScope&&(S.beginScope._wrap?(ke(Q,be.classNameAliases[S.beginScope._wrap]||S.beginScope._wrap),Q=""):S.beginScope._multi&&(bt(S.beginScope,A),Q="")),B=Object.create(S,{parent:{value:B}}),B}function Et(S,A,P){let Y=fo(S.endRe,P);if(Y){if(S["on:end"]){const se=new sn(S);S["on:end"](A,se),se.isMatchIgnored&&(Y=!1)}if(Y){for(;S.endsParent&&S.parent;)S=S.parent;return S}}if(S.endsWithParent)return Et(S.parent,A,P)}function Pt(S){return B.matcher.regexIndex===0?(Q+=S[0],1):($e=!0,0)}function Vt(S){const A=S[0],P=S.rule,Y=new sn(P),se=[P.__beforeBegin,P["on:begin"]];for(const me of se)if(me&&(me(S,Y),Y.isMatchIgnored))return Pt(A);return P.skip?Q+=A:(P.excludeBegin&&(Q+=A),pe(),!P.returnBegin&&!P.excludeBegin&&(Q=A)),yt(P,S),P.returnBegin?0:A.length}function Ut(S){const A=S[0],P=v.substring(S.index),Y=Et(B,S,P);if(!Y)return _n;const se=B;B.endScope&&B.endScope._wrap?(pe(),ke(A,B.endScope._wrap)):B.endScope&&B.endScope._multi?(pe(),bt(B.endScope,S)):se.skip?Q+=A:(se.returnEnd||se.excludeEnd||(Q+=A),pe(),se.excludeEnd&&(Q=A));do B.scope&&ie.closeNode(),!B.skip&&!B.subLanguage&&(Ke+=B.relevance),B=B.parent;while(B!==Y.parent);return Y.starts&&yt(Y.starts,S),se.returnEnd?0:A.length}function Ht(){const S=[];for(let A=B;A!==be;A=A.parent)A.scope&&S.unshift(A.scope);S.forEach(A=>ie.openNode(A))}let ze={};function xt(S,A){const P=A&&A[0];if(Q+=S,P==null)return pe(),0;if(ze.type==="begin"&&A.type==="end"&&ze.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=ze.rule,Y}return 1}if(ze=A,A.type==="begin")return Vt(A);if(A.type==="illegal"&&!M){const Y=new Error('Illegal lexeme "'+P+'" for mode "'+(B.scope||"<unnamed>")+'"');throw Y.mode=B,Y}else if(A.type==="end"){const Y=Ut(A);if(Y!==_n)return Y}if(A.type==="illegal"&&P==="")return Q+=`
|
|
15
|
+
`,1;if(Ye>1e5&&Ye>A.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Q+=P,P.length}const be=ee(x);if(!be)throw Le(f.replace("{}",x)),new Error('Unknown language: "'+x+'"');const Ft=Go(be);let Ge="",B=C||Ft;const Qe={},ie=new c.__emitter(c);Ht();let Q="",Ke=0,Me=0,Ye=0,$e=!1;try{if(be.__emitTokens)be.__emitTokens(v,ie);else{for(B.matcher.considerAll();;){Ye++,$e?$e=!1:B.matcher.considerAll(),B.matcher.lastIndex=Me;const S=B.matcher.exec(v);if(!S)break;const A=v.substring(Me,S.index),P=xt(A,S);Me=S.index+P}xt(v.substring(Me))}return ie.finalize(),Ge=ie.toHTML(),{language:x,value:Ge,relevance:Ke,illegal:!1,_emitter:ie,_top:B}}catch(S){if(S.message&&S.message.includes("Illegal"))return{language:x,value:Lt(v),illegal:!0,relevance:0,_illegalBy:{message:S.message,index:Me,context:v.slice(Me-100,Me+100),mode:S.mode,resultSoFar:Ge},_emitter:ie};if(l)return{language:x,value:Lt(v),illegal:!1,relevance:0,errorRaised:S,_emitter:ie,_top:B};throw S}}function k(x){const v={value:Lt(x),illegal:!1,relevance:0,_top:s,_emitter:new c.__emitter(c)};return v._emitter.addText(x),v}function y(x,v){v=v||c.languages||Object.keys(a);const M=k(x),C=v.filter(ee).filter(W).map(pe=>b(pe,x,!1));C.unshift(M);const U=C.sort((pe,ke)=>{if(pe.relevance!==ke.relevance)return ke.relevance-pe.relevance;if(pe.language&&ke.language){if(ee(pe.language).supersetOf===ke.language)return 1;if(ee(ke.language).supersetOf===pe.language)return-1}return 0}),[ne,ge]=U,xe=ne;return xe.secondBest=ge,xe}function m(x,v,M){const C=v&&i[v]||M;x.classList.add("hljs"),x.classList.add(`language-${C}`)}function L(x){let v=null;const M=g(x);if(d(M))return;if(oe("before:highlightElement",{el:x,language:M}),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,U=M?h(C,{language:M,ignoreIllegals:!0}):y(C);x.innerHTML=U.value,x.dataset.highlighted="yes",m(x,M,U.language),x.result={language:U.language,re:U.relevance,relevance:U.relevance},U.secondBest&&(x.secondBest={language:U.secondBest.language,relevance:U.secondBest.relevance}),oe("after:highlightElement",{el:x,result:U,text:C})}function K(x){c=Nn(c,x)}const _=()=>{$(),Ue("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function F(){$(),Ue("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 M=null;try{M=v(e)}catch(C){if(Le("Language definition for '{}' could not be registered.".replace("{}",x)),l)Le(C);else throw C;M=s}M.name||(M.name=x),a[x]=M,M.rawDefinition=v.bind(null,e),M.aliases&&le(M.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 ee(x){return x=(x||"").toLowerCase(),a[x]||a[i[x]]}function le(x,{languageName:v}){typeof x=="string"&&(x=[x]),x.forEach(M=>{i[M.toLowerCase()]=v})}function W(x){const v=ee(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 ae(x){J(x),r.push(x)}function ue(x){const v=r.indexOf(x);v!==-1&&r.splice(v,1)}function oe(x,v){const M=x;r.forEach(function(C){C[M]&&C[M](v)})}function fe(x){return Ue("10.7.0","highlightBlock will be removed entirely in v12.0"),Ue("10.7.0","Please use highlightElement now."),L(x)}Object.assign(e,{highlight:h,highlightAuto:y,highlightAll:$,highlightElement:L,highlightBlock:fe,configure:K,initHighlighting:_,initHighlightingOnLoad:F,registerLanguage:D,unregisterLanguage:I,listLanguages:j,getLanguage:ee,registerAliases:le,autoDetection:W,inherit:Nn,addPlugin:ae,removePlugin:ue}),e.debugMode=function(){l=!1},e.safeMode=function(){l=!0},e.versionString=Yo,e.regex={concat:Be,lookahead:fn,either:Ot,optional:co,anyNumberOfTimes:so};for(const x in ft)typeof ft[x]=="object"&&ln(ft[x]);return Object.assign(e,ft),e},He=Sn({});He.newInstance=()=>Sn({});var qo=He;He.HighlightJS=He,He.default=He;const Dt=io(qo);function zt(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 d={match:/\\"/},g={className:"string",begin:/'/,end:/'/},h={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"],y=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:[y,e.SHEBANG(),m,b,f,s,_,c,d,g,h,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 Fe="[0-9](_*[0-9])*",mt=`\\.(${Fe})`,pt="[0-9a-fA-F](_*[0-9a-fA-F])*",vn={className:"number",variants:[{begin:`(\\b(${Fe})((${mt})|\\.)?|(${mt}))[eE][+-]?(${Fe})[fFdD]?\\b`},{begin:`\\b(${Fe})((${mt})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${mt})[fFdD]?\\b`},{begin:`\\b(${Fe})[fFdD]\\b`},{begin:`\\b0[xX]((${pt})\\.?|(${pt})?\\.(${pt}))[pP][+-]?(${Fe})[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),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:"@"+i,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},h={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+/,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:[h,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 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=(M,{after:C})=>{const U="</"+M[0].slice(1);return M.input.indexOf(U,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:(M,C)=>{const U=M[0].length+M.index,ne=M.input[U];if(ne==="<"||ne===","){C.ignoreMatch();return}ne===">"&&(i(M,{after:U})||C.ignoreMatch());let ge;const xe=M.input.substring(U);if(ge=xe.match(/^\s*=/)){C.ignoreMatch();return}if((ge=xe.match(/^\s+extends\s+/))&&ge.index===0){C.ignoreMatch();return}}},c={$pattern:Tn,keyword:lr,literal:sr,built_in:dr,"variable.language":cr},d="[0-9](_?[0-9])*",g=`\\.(${d})`,h="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",b={className:"number",variants:[{begin:`(\\b(${h})((${g})|\\.)?|(${g}))[eE][+-]?(${d})\\b`},{begin:`\\b(${h})\\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:[]},y={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,y,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"}}]},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:{_:[...An,...Rn]}},le={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 ae(M){return a.concat("(?!",M.join("|"),")")}const ue={match:a.concat(/\b/,ae([...On,"super","import"].map(M=>`${M}\\s*\\(`)),r,a.lookahead(/\s*\(/)),className:"title.function",relevance:0},oe={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:ee},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),le,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,y,m,L,K,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: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},oe,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[I]},ue,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+.-]*/,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}/}]},h={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},b=e.inherit(g,{contains:[]}),k=e.inherit(h,{contains:[]});g.contains.push(k),h.contains.push(b);let y=[i,d];return[g,h,b,k].forEach(_=>{_.contains=_.contains.concat(y)}),y=y.concat(g,h),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:y},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:y}]}]},i,f,g,h,{className:"quote",begin:"^>\\s+",contains:y,end:"$"},l,r,d,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"]},d={className:"meta",begin:/^(>>>|\.\.\.) /},g={className:"subst",begin:/\{/,end:/\}/,keywords:c,illegal:/#/},h={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,h,g]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,d,h,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,h,g]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,h,g]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},k="[0-9](_?[0-9])*",y=`(\\b(${k}))?\\.(${k})|\\b(${k})\\.`,m=`\\b|${r.join("|")}`,L={className:"number",relevance:0,variants:[{begin:`(\\b(${k})|(${y}))[eE][+-]?(${k})[jJ]?(?=${m})`},{begin:`(${y})[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",d,L,b,e.HASH_COMMENT_MODE]}]};return g.contains=[b,L,d],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:c,illegal:/(<\/|\?)|=>/,contains:[d,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"],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!"],h=["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:h,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:h}},{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"],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"],h=["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"],y=h,m=[...g,...d].filter(D=>!h.includes(D)),L={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},K={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},_={match:a.concat(/\b/,a.either(...y),/\s*\(/),relevance:0,keywords:{built_in:y}};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 ee=j;return I=I||[],D.map(le=>le.match(/\|\d+$/)||I.includes(le)?le:ee(le)?`${le}|0`:le)}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"],Vn=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Un=["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(Un,Pn,Vn);function gr(e){const a=e.regex,i=(M,{after:C})=>{const U="</"+M[0].slice(1);return M.input.indexOf(U,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:(M,C)=>{const U=M[0].length+M.index,ne=M.input[U];if(ne==="<"||ne===","){C.ignoreMatch();return}ne===">"&&(i(M,{after:U})||C.ignoreMatch());let ge;const xe=M.input.substring(U);if(ge=xe.match(/^\s*=/)){C.ignoreMatch();return}if((ge=xe.match(/^\s+extends\s+/))&&ge.index===0){C.ignoreMatch();return}}},c={$pattern:ht,keyword:zn,literal:$n,built_in:Fn,"variable.language":Hn},d="[0-9](_?[0-9])*",g=`\\.(${d})`,h="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",b={className:"number",variants:[{begin:`(\\b(${h})((${g})|\\.)?|(${g}))[eE][+-]?(${d})\\b`},{begin:`\\b(${h})\\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:[]},y={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,y,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"}}]},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:{_:[...Pn,...Vn]}},le={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 ae(M){return a.concat("(?!",M.join("|"),")")}const ue={match:a.concat(/\b/,ae([...Un,"super","import"].map(M=>`${M}\\s*\\(`)),r,a.lookahead(/\s*\(/)),className:"title.function",relevance:0},oe={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:ee},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),le,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,y,m,L,K,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: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},oe,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[I]},ue,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['"]/},d=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],g={$pattern:ht,keyword:zn.concat(d),literal:$n,built_in:Fn.concat(l),"variable.language":Hn},h={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(h);const k=i.contains.find(L=>L.scope==="attr"),y=Object.assign({},k,{match:a.concat(r,a.lookahead(/\s*\?:/))});i.exports.PARAMS_CONTAINS.push([i.exports.CLASS_REFERENCE,k,y]),i.contains=i.contains.concat([h,f,s,y]),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"}),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(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"},y={end:",",endsWithParent:!0,excludeEnd:!0,keywords:a,relevance:0},m={begin:/\{/,end:/\}/,contains:[y],illegal:"\\n",relevance:0},L={begin:"\\[",end:"\\]",contains:[y],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),y.contains=_,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:K}}const $t={bash:zt,sh:zt,shell:zt,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($t))Dt.registerLanguage(e,a);function Yn(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
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
|
|
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,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}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,
|
|
20
|
-
`:"```\n",T=window.prompt("输入代码块内容(用 ```lang 包裹;留空取消)",
|
|
18
|
+
`)[0]??""),i=((a==null?void 0:a[2])??"").toLowerCase();return i&&$t[i]?i:""}function mr(e,a){const i=a&&$t[a]?a:"";try{return i?Dt.highlight(e,{language:i,ignoreIllegals:!0}).value:Dt.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,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}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,d=l.slice().sort((g,h)=>{const b=g[a]??"",k=h[a]??"";return s?(Number(b)-Number(k))*c:b.localeCompare(k,"zh-Hans-CN",{numeric:!0})*c});return[r,...d]}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"],Vr=["src"],De=24,We=400,Ie=160,Xn=t.defineComponent({__name:"MindMap",props:{data:{},theme:{},previewMode:{type:Boolean,default:!1},markdown:{},lineColors:{}},emits:["change","select","edit-note","markdownChange","canvas-settings","canvas-data"],setup(e,{expose:a,emit:i}){const r=e,l=i,f=t.ref(null),s=t.ref(null),c=t.ref(""),d=t.ref(null),g=t.ref(new Set),h=t.ref(!1),b=t.ref(null),k=t.ref(""),y=t.ref(new Map),m=t.ref(Te(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=At(n||"");F=!0,m.value=Te(o),d.value=null,g.value=new Set,X(),t.nextTick(()=>{F=!1,Ae()})}),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 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?D.delete(n):D.set(n,u),$.value=new Map(D)}function j(n){return D.get(n)??{}}function ee(n,o){const u=H(m.value,n);u&&(u.image={src:o.src,naturalW:o.naturalW,naturalH:o.naturalH,width:J(o.width,De,We),height:J(o.height,De,We)},ce(),X(),l("change",m.value))}function le(n){const o=H(m.value,n);!o||!o.image||(delete o.image,ce(),X(),l("change",m.value))}function W(n,o){const u=o.trim();if(!H(m.value,n))return;if(!u){le(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||Ie,De,We),q=Math.round(z/T);N.image={src:u,naturalW:E.naturalWidth||z,naturalH:E.naturalHeight||q,width:z,height:q},ce(),X(),l("change",m.value)},E.onerror=()=>{},E.src=u}function J(n,o,u){return Math.min(u,Math.max(o,n))}function ae(n,o){const u=new FileReader;u.onload=()=>{if(typeof u.result!="string")return;const w=u.result,E=new window.Image;E.onload=()=>{const N=E.naturalWidth||Ie,T=E.naturalHeight||Ie,z=J(N,De,Ie),q=J(Math.round(T*z/N),De,We);o({src:w,naturalW:N,naturalH:T,width:z,height:q})},E.onerror=()=>{o({src:w,naturalW:Ie,naturalH:Ie,width:Ie,height:Ie})},E.src=w},u.readAsDataURL(n)}function ue(n){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&&(ae(u,E=>ee(n,E)),document.body.removeChild(o))},document.body.appendChild(o),o.click()}function oe(n,o){const u=o.trim(),w=H(m.value,n);w&&(u?w.link={url:u}:delete w.link,ce(),X(),l("change",m.value))}function fe(n){oe(n,"")}function x(n,o){const u=H(m.value,n);u&&(o?u.note={text:o}:delete u.note,ce(),X(),l("change",m.value))}function v(n){x(n,"")}function M(n,o){const u=H(m.value,n);u&&(o?u.richContent=o:delete u.richContent,ce(),X(),l("change",m.value))}const C=t.ref(null),U=t.ref(null);function ne(n,o){r.previewMode||(n.preventDefault(),n.stopPropagation(),d.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 xe(n){r.previewMode||(n.preventDefault(),C.value=null,U.value={x:n.clientX,y:n.clientY})}function pe(){U.value=null}function ke(){U.value=null,l("canvas-settings")}function bt(){U.value=null,l("canvas-data")}function yt(){var o;const n=(o=C.value)==null?void 0:o.nodeId;n&&ue(n)}function Et(){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)??"",u=window.prompt("输入链接 URL(留空取消)",o);u!==null&&oe(n,u)}function Pt(){var o;const n=(o=C.value)==null?void 0:o.nodeId;n&&fe(n)}function Vt(){var o;const n=(o=C.value)==null?void 0:o.nodeId;n&&Ge(n)}function Ut(){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&&le(n)}function ze(){var G,we;const n=(G=C.value)==null?void 0:G.nodeId;if(!n)return;const o=(we=H(m.value,n))==null?void 0:we.richContent,u=(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 包裹;留空取消)",u?E+u+(u.endsWith("```")?"":"\n```"):E+"// 你的代码"+"\n```");if(T===null)return;const z=T.trim();if(!z){M(n,null);return}const q=/^```([^\s`]*)/.exec(z),p=q?q[1]:void 0;M(n,{kind:"code",raw:z,lang:p})}function xt(){var o;const n=(o=C.value)==null?void 0:o.nodeId;n&&M(n,null)}function be(){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,u=(o==null?void 0:o.kind)==="table"?o.raw:"",E=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(E===null)return;const N=E.trim();if(!N){M(n,null);return}M(n,{kind:"table",raw:N})}function Ft(){var o;const n=(o=C.value)==null?void 0:o.nodeId;n&&M(n,null)}function Ge(n){r.previewMode||l("edit-note",n)}function B(n,o=60){const u=n.replace(/\s+/g," ").trim();return u.length<=o?u||"点击编辑笔记":u.slice(0,o)+"…"}function Qe(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 u=d.value;if(!u)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,u);if(q!=null&&q.image&&!window.confirm("该节点已有图片,要用剪贴板里的图片替换吗?"))return;ae(z,p=>ee(u,p));return}}}t.onMounted(()=>{window.addEventListener("paste",Qe),X()}),t.onBeforeUnmount(()=>{window.removeEventListener("paste",Qe)});const ie=t.ref(null),Q=t.computed(()=>{var n;return((n=ie.value)==null?void 0:n.nodeId)??null});function Ke(n,o){if(!o.image)return;n.preventDefault(),n.stopPropagation();const u=o.image.naturalW||o.image.width,w=o.image.naturalH||o.image.height,E=w>0?w/u:1;ie.value={nodeId:o.id,startX:n.clientX,startY:n.clientY,startW:o.image.width,startH:o.image.height,naturalW:u,naturalH:w,ratio:E,pendingW:o.image.width,pendingH:o.image.height},window.addEventListener("mousemove",Me),window.addEventListener("mouseup",Ye)}function Me(n){var q,p;const o=ie.value;if(!o)return;const u=V.scale.value||1,w=n.clientX-o.startX,E=J(o.startW+w/u,De,We),N=J(E*o.ratio,De,We);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 Ye(){const n=ie.value;if(window.removeEventListener("mousemove",Me),window.removeEventListener("mouseup",Ye),ie.value=null,!n)return;const o=H(m.value,n.nodeId);!o||!o.image||(ee(n.nodeId,{src:o.image.src,naturalW:o.image.naturalW,naturalH:o.image.naturalH,width:n.pendingW,height:n.pendingH}),d.value=n.nodeId,l("select",o),S=!0)}const $e=t.ref(null);let S=!1;function A(n){$e.value=n}function P(n){$e.value===n&&($e.value=null)}const Y=t.ref(0),se=t.ref(!1),me=eo(100);function ce(){me.record({data:m.value})}function X(){g.value=new Set(g.value),Y.value++,t.nextTick().then(()=>t.nextTick()).then(()=>Hr()).then(()=>{Y.value++})}function Hr(){const n=document.querySelectorAll(".zm-rich"),o={},u={};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,u[N]=p,L.value[N],K.value[N]}),L.value=o,K.value=u}const _e=t.computed(()=>{var n,o,u,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:((u=r.theme)==null?void 0:u.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?Fr(n):Jn(n)}function jn(n){return R.taperedEdge?R.lineWidthEnd:Jn(n)}function Fr(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 Wr(n,o,u,w){const E=1-n,N=E*E*E*o.x+3*E*E*n*u.x1+3*E*n*n*u.x2+n*n*n*w.x,T=E*E*E*o.y+3*E*E*n*u.y1+3*E*n*n*u.y2+n*n*n*w.y;return{x:N,y:T}}function Gr(n,o,u,w,E=32,N="curve",T="right"){if(N==="curve"){let Ce;if(T==="right"||T==="left"){const re=Math.abs(o.x-n.x)*.45,Re=T==="right"?1:-1;Ce={x1:n.x+Re*re,y1:n.y,x2:o.x-Re*re,y2:o.y}}else{const re=Math.abs(o.y-n.y)*.45;Ce={x1:n.x,y1:n.y+re,x2:o.x,y2:o.y-re}}const pi=Z=>{const re=1-Z,Re=-3*re*re*n.x+3*(re*re-2*re*Z)*Ce.x1+3*(2*re*Z-Z*Z)*Ce.x2+3*Z*Z*o.x,Xe=-3*re*re*n.y+3*(re*re-2*re*Z)*Ce.y1+3*(2*re*Z-Z*Z)*Ce.y2+3*Z*Z*o.y;return{dx:Re,dy:Xe}},rt=[],Xt=[];for(let Z=0;Z<=E;Z++){const re=Z/E,Re=Z===0?n:Z===E?o:Wr(re,n,Ce,o),Xe=pi(re);let St=Math.hypot(Xe.dx,Xe.dy);St<1e-6&&(St=1);const hi=-Xe.dy/St,bi=Xe.dx/St,Mt=(u+(w-u)*re)/2;rt.push({x:Re.x+hi*Mt,y:Re.y+bi*Mt}),Xt.push({x:Re.x-hi*Mt,y:Re.y-bi*Mt})}let _t=`M ${rt[0].x.toFixed(2)} ${rt[0].y.toFixed(2)}`;for(let Z=1;Z<=E;Z++)_t+=` L ${rt[Z].x.toFixed(2)} ${rt[Z].y.toFixed(2)}`;for(let Z=E;Z>=0;Z--)_t+=` L ${Xt[Z].x.toFixed(2)} ${Xt[Z].y.toFixed(2)}`;return _t+=" Z",_t}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,we=z/p,ve=u/2,he=w/2,tt={x:n.x+G*ve,y:n.y+we*ve},nt={x:n.x-G*ve,y:n.y-we*ve},it={x:o.x-G*he,y:o.y-we*he},ot={x:o.x+G*he,y:o.y+we*he};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 kt=t.computed(()=>ye.value.root.children),Kr=qe[0].colors,Qn=t.computed(()=>Fi(R.branchPaletteId,R.customPalettes)),Pe=t.computed(()=>{const n=new Map;if(!R.rainbowBranch)return n;const o=r.lineColors,u=o&&o.length>0?o:Qn.value.colors.length>0?Qn.value.colors:Kr;for(let E=0;E<kt.value.length;E++){const N=kt.value[E];n.set(N.id,u[E%u.length])}const w=(E,N)=>{n.set(E.id,N);for(const T of E.children)w(T,N)};for(let E=0;E<kt.value.length;E++){const N=kt.value[E];w(N,u[E%u.length])}return n});function Yr(n,o){return R.rainbowBranch?Pe.value.get(o.id)??_e.value.lineColor:_e.value.lineColor}function Zr(n){const o=j(n.id);if(o.bg)return o.bg;if(n.isRoot)return _e.value.rootBg;if(R.rainbowBranch){const u=Pe.value.get(n.id);if(u)return Jr(u,.18)}return _e.value.branchBg}function Xr(n){const o=j(n.id);if(o.textColor)return o.textColor;if(n.isRoot)return _e.value.rootText;if(R.rainbowBranch){const u=Pe.value.get(n.id);if(u)return ei(u,.55)}return _e.value.branchText}function qr(n){const o=j(n.id);if(o.borderColor)return o.borderColor;if(n.isRoot)return _e.value.rootBg;if(R.rainbowBranch){const u=Pe.value.get(n.id);if(u)return ei(u,.3)}return _e.value.lineColor}function jr(n){return j(n.id).fontWeight??(n.isRoot?600:400)}function Jr(n,o){const u=n.replace("#",""),w=u.length===6?u:u.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 u=n.replace("#",""),w=u.length===6?u:u.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 V=ji({getContainer:()=>f.value});V.setOnMarqueeEnd(ba),Qi({isEditing:()=>s.value!==null,isReadonly:()=>r.previewMode,getSelectedId:()=>d.value,getRootId:()=>m.value.id,defaultTargetId:()=>m.value.id,onAddChild:Ze,onAddSibling:Nt,onAddSiblingBefore:oi,onRemove:ai,onStartEdit:et,onClearSelection:()=>{d.value=null,l("select",null)},onDuplicate:ri,onUndo:Gt,onRedo:Kt,onNavigate:ca,onSelectRoot:()=>{d.value=m.value.id;const n=H(m.value,m.value.id);n&&l("select",n)}});const ye=t.computed(()=>{const n=Te(m.value);return ni(n),Pi(n,{mode:R.layoutMode,baseFontSize:_e.value.fontSize,richHeights:L.value,richWidths:K.value})}),ti=t.ref([]),Wt=t.computed(()=>(Y.value,ti.value));t.watch(ye,n=>{const o=[],u=w=>{o.push(w);for(const E of w.children)u(E)};u(n.root),ti.value=o},{immediate:!0});const Qr=t.computed(()=>{const n=[];for(const o of Wt.value)for(const u of o.children)n.push({from:o,to:u,key:`${o.id}->${u.id}`});return n}),ea=t.computed(()=>`${ye.value.vbX} ${ye.value.vbY} ${ye.value.vbW} ${ye.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 u=document.querySelector(".zm-input");u==null||u.focus(),u==null||u.select()}))}function wt(n={}){if(!s.value)return;const o=H(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,n.addChild?t.nextTick(()=>Ze(u)):n.addSibling==="after"?t.nextTick(()=>Nt(u)):n.addSibling==="before"&&t.nextTick(()=>oi(u))}function ta(){s.value=null}function na(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 u=document.querySelector(".zm-node .zm-rich textarea");u==null||u.focus()}))}function ii(){if(!b.value)return;const n=b.value,o=H(m.value,n),u=k.value;if(o&&o.richContent&&o.richContent.raw!==u)if(o.richContent.kind==="code"){const w=Zn(u)||void 0;M(n,{kind:"code",raw:u,lang:w})}else M(n,{kind:"table",raw:u});b.value=null}function ia(){b.value=null}function oa(n){n.key==="Escape"?(n.preventDefault(),ia()):n.key==="Enter"&&(n.ctrlKey||n.metaKey)&&(n.preventDefault(),ii())}function ra(n,o){const u=y.value.get(n);!u||u.col!==o?y.value.set(n,{col:o,dir:"asc"}):u.dir==="asc"?y.value.set(n,{col:o,dir:"desc"}):y.value.delete(n)}function aa(n,o){const u=y.value.get(n);return!u||o.length<=1?o:br(o,u.col,u.dir)}function la(n,o){const u=y.value.get(n);return!u||u.col!==o?"↕":u.dir==="asc"?"▲":"▼"}function sa(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 Ze(n){const o=nn(m.value,n,ct);o&&(ce(),X(),l("change",m.value),t.nextTick(()=>et(o.id)))}function Nt(n){if(n===m.value.id){Ze(n);return}const o=on(m.value,n,ct);o&&(ce(),X(),l("change",m.value),t.nextTick(()=>et(o.id)))}function oi(n){if(n===m.value.id){Ze(n);return}const o=Ki(m.value,n,ct);o&&(ce(),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&&(ce(),d.value=o.id,l("change",m.value),X())}function Gt(){const n=me.undo();n&&(m.value=n.data,d.value=null,l("select",null),X(),l("change",m.value))}function Kt(){const n=me.redo();n&&(m.value=n.data,d.value=null,l("select",null),X(),l("change",m.value))}function ca(n,o){const u=d.value??m.value.id,w=H(m.value,u);if(!w)return;let E=null;if(o===1){const N=Ne(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=Ne(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=Ne(m.value,w.id);N&&(E=N.id)}else n===-1&&w.children.length>0&&(E=w.children[0].id);if(E){d.value=E;const N=H(m.value,E);N&&l("select",N)}}function ai(n){n!==m.value.id&&Tt(m.value,n)&&(ce(),d.value===n&&(d.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:u,depth:w}=o.pop();n(u,w);for(let E=u.children.length-1;E>=0;E--)o.push({n:u.children[E],depth:w+1})}}function da(){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,u)=>{u>n&&o.children.length>0&&g.value.add(o.id)}),X()}function ua(){g.value=new Set,X()}function fa(n,o){Wi(m.value,n,o)&&(ce(),X(),l("change",m.value))}function ga(n,o,u){return Gi(m.value,n,o,u)?(ce(),X(),l("change",m.value),!0):!1}function ma(n,o){n.stopPropagation(),d.value=o.id;const u=H(m.value,o.id);l("select",u)}function pa(n){const o=n.target;if(!o||o.closest(".zm-node, .zm-toolbar, button, input, textarea"))return;if(n.button===2){V.startPan(n);return}if(n.button!==0)return;const u=f.value.getBoundingClientRect(),w=(n.clientX-u.left-V.offsetX.value)/V.scale.value,E=(n.clientY-u.top-V.offsetY.value)/V.scale.value;V.startMarquee(w,E)}function ha(n){if(S){S=!1;return}const o=n.target;if(!o||o.closest(".zm-node"))return;const u=V.marquee;u.width>=4||u.height>=4||d.value!==null&&(d.value=null,l("select",null))}function ba(){const n=V.marquee;if(n.width<4&&n.height<4)return;const o=n.x,u=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,we=T.y-q,ve=T.y+q;p<=w&&G>=o&&we<=E&&ve>=u&&N.push(T.id)}if(N.length>0){d.value=N[0];const T=H(m.value,N[0]);T&&l("select",T)}}function di(n){return g.value.has(n)}function ya(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,u,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:u!==void 0?N=u:N=n.side;const T=o==="in"?n._richInsetX??0:0;return{x:n.x+N*(n.width/2-T),y:n.y}}function Ae(){const n=ye.value;V.resetView(n.width,n.height,n.root.y)}function Ea(){se.value=!0,ce(),X(),t.nextTick(()=>Ae())}function Zt(n){R.layoutMode!==n&&(R.layoutMode=n,X(),t.nextTick(()=>Ae()))}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:(me.reset(),m.value=Te(o),d.value=null,g.value=new Set,X(),t.nextTick(()=>Ae()),l("change",m.value),!0)}catch{return!1}}function xa(){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 u=new FileReader;u.onload=()=>{typeof u.result=="string"&&(mi(u.result)||alert("导入失败:JSON 格式无效"))},u.readAsText(o)},n.click()}function ka(){const n=new Blob([gi()],{type:"application/json"}),o=URL.createObjectURL(n),u=document.createElement("a");u.href=o,u.download=`${m.value.text||"mindmap"}.json`,u.click(),URL.revokeObjectURL(o)}return a({addChild:n=>Ze(n),addSibling:n=>Nt(n),removeNode:n=>ai(n),duplicateNode:n=>ri(n),setNodeText:(n,o)=>fa(n,o),moveNode:(n,o,u)=>ga(n,o,u),lineWidthForDepth:qn,endWidthForDepth:jn,getData:()=>m.value,setData:n=>{me.reset(),m.value=Te(n),d.value=null,g.value=new Set,X(),ce(),t.nextTick(()=>Ae())},resetView:()=>Ae(),exportData:gi,importData:mi,getMarkdown:()=>dt(m.value),setMarkdown:(n,o=!0)=>{const u=At(n||"");o&&(_.value=!0),F=!o,me.reset(),m.value=Te(u),d.value=null,g.value=new Set,X(),ce(),t.nextTick(()=>{F=!1,Ae()}),l("change",m.value)},setBalanced:n=>{se.value=n},isBalanced:()=>se.value,balance:()=>Ea(),applyNodeStyle:(n,o)=>I(n,o),getNodeStyle:n=>j(n),applyNodeImage:(n,o)=>ee(n,o),applyNodeImageByUrl:(n,o)=>W(n,o),removeNodeImage:n=>le(n),applyNodeLink:(n,o)=>oe(n,o),removeNodeLink:n=>fe(n),applyNodeNote:(n,o)=>x(n,o),removeNodeNote:n=>v(n),applyNodeRichContent:(n,o)=>M(n,o),undo:()=>Gt(),redo:()=>Kt(),canUndo:()=>me.canUndo(),canRedo:()=>me.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;[...qe,...R.customPalettes].find(u=>u.id===n)&&(R.branchPaletteId=n)},getBranchPalette:()=>R.branchPaletteId,getBranchPalettes:()=>[...qe,...R.customPalettes]}),t.watch(()=>r.data,n=>{m.value=Te(n),X()},{deep:!1}),t.onMounted(()=>{ce(),t.nextTick(()=>Ae())}),(n,o)=>{var u,w,E,N,T,z,q;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:pa,onContextmenu:xe,onWheel:o[25]||(o[25]=(...p)=>t.unref(V).onWheel&&t.unref(V).onWheel(...p)),onMouseenter:o[26]||(o[26]=p=>h.value=!0),onMouseleave:o[27]||(o[27]=p=>h.value=!1),onClick:ha},[t.createElementVNode("div",{class:"zm-svg-layer",style:t.normalizeStyle({left:ye.value.vbX*t.unref(V).scale.value+t.unref(V).offsetX.value+"px",top:ye.value.vbY*t.unref(V).scale.value+t.unref(V).offsetY.value+"px",width:ye.value.vbW*t.unref(V).scale.value+"px",height:ye.value.vbH*t.unref(V).scale.value+"px"})},[(t.openBlock(),t.createElementBlock("svg",{class:"zm-svg",viewBox:ea.value,preserveAspectRatio:"xMinYMin meet",width:ye.value.vbW*t.unref(V).scale.value,height:ye.value.vbH*t.unref(V).scale.value},[t.createElementVNode("g",Er,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Qr.value,p=>(t.openBlock(),t.createElementBlock("path",{key:p.key,d:Gr(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:Yr(p.from,p.to),stroke:"none"},null,8,xr))),128))])],8,yr))],4),t.unref(V).isMarquee.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:"zm-marquee",style:t.normalizeStyle({left:t.unref(V).marquee.x*t.unref(V).scale.value+t.unref(V).offsetX.value+"px",top:t.unref(V).marquee.y*t.unref(V).scale.value+t.unref(V).offsetY.value+"px",width:t.unref(V).marquee.width*t.unref(V).scale.value+"px",height:t.unref(V).marquee.height*t.unref(V).scale.value+"px"})},null,4)):t.createCommentVNode("",!0),t.createElementVNode("div",{class:"zm-world",style:t.normalizeStyle({transform:`translate(${t.unref(V).offsetX.value}px, ${t.unref(V).offsetY.value}px) scale(${t.unref(V).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":d.value===p.id,"is-editing":s.value===p.id,"has-image":!!p.image,"is-resizing":Q.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:Zr(p),color:Xr(p),borderColor:qr(p),fontWeight:jr(p),transform:"translate(-50%, -50%)"}),onClick:G=>ma(G,p),onDblclick:G=>{G.stopPropagation(),e.previewMode||et(p.id)},onContextmenu:G=>ne(G,p),onMouseenter:G=>A(p.id),onMouseleave:G=>P(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=>na(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:oa},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(aa(p.id,t.unref(pr)(p.richContent.raw)),(G,we)=>(t.openBlock(),t.createElementBlock("tr",{key:we},[we===0?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:0},t.renderList(G,(ve,he)=>{var tt,nt,it,ot,Ce;return t.openBlock(),t.createElementBlock("th",{key:`h${he}`,class:t.normalizeClass(["zm-rich-table-sort",{"is-sorted":((tt=y.value.get(p.id))==null?void 0:tt.col)===he,"is-asc":((nt=y.value.get(p.id))==null?void 0:nt.col)===he&&((it=y.value.get(p.id))==null?void 0:it.dir)==="asc","is-desc":((ot=y.value.get(p.id))==null?void 0:ot.col)===he&&((Ce=y.value.get(p.id))==null?void 0:Ce.dir)==="desc"}]),onClick:t.withModifiers(pi=>ra(p.id,he),["stop"])},[t.createElementVNode("span",null,t.toDisplayString(ve),1),t.createElementVNode("span",Cr,t.toDisplayString(la(p.id,he)),1)],10,vr)}),128)):(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:1},t.renderList(G,(ve,he)=>(t.openBlock(),t.createElementBlock("td",{key:`c${he}`},t.toDisplayString(ve),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(te,{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:B(p.note.text),onClick:t.withModifiers(G=>Ge(p.id),["stop"]),onMousedown:o[5]||(o[5]=t.withModifiers(()=>{},["stop"]))},[t.createVNode(te,{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=>wt()),onKeydown:[o[8]||(o[8]=t.withKeys(t.withModifiers(G=>wt({addSibling:"after"}),["exact"]),["enter"])),o[9]||(o[9]=t.withKeys(t.withModifiers(G=>wt({addSibling:"before"}),["shift","prevent","exact"]),["enter"])),o[10]||(o[10]=t.withKeys(t.withModifiers(G=>wt({addChild:!0}),["prevent"]),["tab"])),t.withKeys(ta,["esc"]),sa],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:Pe.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),ya(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:Pe.value.get(p.id)??"#64748b",borderColor:Pe.value.get(p.id)??"#64748b"}),title:"折叠",onMousedown:o[14]||(o[14]=t.withModifiers(()=>{},["stop"])),onClick:t.withModifiers(G=>li(p.id),["stop"])},[t.createVNode(te,{name:"minus",size:10,stroke:2.4})],46,Lr)):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(G=>Ke(G,p),["stop"])},null,40,Dr)):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(G=>le(p.id),["stop"])},[t.createVNode(te,{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":!!((u=t.unref(H)(m.value,C.value.nodeId))!=null&&u.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:yt,onRemoveImage:Ht,onSetLink:Et,onRemoveLink:Pt,onEditNote:Vt,onRemoveNote:Ut,onAddCode:ze,onEditCode:ze,onRemoveCode:xt,onAddTable:be,onEditTable:be,onRemoveTable:Ft,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(no,{key:2,x:U.value.x,y:U.value.y,container:f.value,onOpenData:bt,onOpenSettings:ke,onClose:pe},null,8,["x","y","container"])):t.createCommentVNode("",!0),t.createElementVNode("div",{class:t.normalizeClass(["zm-toolbar",{"is-preview-only":r.previewMode,"is-hovered":h.value}])},[t.createElementVNode("span",$r,t.toDisplayString(Math.round(t.unref(V).scale.value*100))+"%",1),t.createElementVNode("button",{class:"zm-tb-btn",title:"放大",onClick:o[16]||(o[16]=(...p)=>t.unref(V).zoomIn&&t.unref(V).zoomIn(...p))},[t.createVNode(te,{name:"zoom-in"})]),t.createElementVNode("button",{class:"zm-tb-btn",title:"缩小",onClick:o[17]||(o[17]=(...p)=>t.unref(V).zoomOut&&t.unref(V).zoomOut(...p))},[t.createVNode(te,{name:"zoom-out"})]),t.createElementVNode("button",{class:"zm-tb-btn",title:"重置视图",onClick:Ae},[t.createVNode(te,{name:"reset"})]),o[31]||(o[31]=t.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),t.createElementVNode("button",{class:"zm-tb-btn",title:"全部收起",onClick:da},[t.createVNode(te,{name:"collapse-all"})]),t.createElementVNode("button",{class:"zm-tb-btn",title:"展开一级",onClick:o[18]||(o[18]=p=>ci(1))},[t.createVNode(te,{name:"expand-level-1"})]),t.createElementVNode("button",{class:"zm-tb-btn",title:"展开二级",onClick:o[19]||(o[19]=p=>ci(2))},[t.createVNode(te,{name:"expand-level-2"})]),t.createElementVNode("button",{class:"zm-tb-btn",title:"全部展开",onClick:ua},[t.createVNode(te,{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:ka},[t.createVNode(te,{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,Pr)]),t.createElementVNode("button",{class:"zm-tb-btn",title:"添加同级 (Enter)",onClick:o[21]||(o[21]=p=>d.value&&Nt(d.value))},[t.createElementVNode("img",{src:t.unref(ki),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,Vr)]),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(te,{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(te,{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(te,{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:xa},[t.createVNode(te,{name:"import"})])],64))],2)],544)],4)}}}),Ur={install(e){e.component("FlowMindMap",Xn)}};de.MindMap=Xn,de.addChild=nn,de.addSibling=on,de.clone=Te,de.default=Ur,de.findNode=H,de.findParent=Ne,de.markdownToMindMap=At,de.markdownToRichMindMap=Xi,de.mindMapToMarkdown=dt,de.removeNode=Tt,de.richBlockToMarkdown=qi,de.uid=Se,Object.defineProperties(de,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|