flow-mindmap 0.5.0 → 0.5.1

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,29 +1,17 @@
1
- (function(be,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(be=typeof globalThis<"u"?globalThis:be||self,e(be.FlowMind={},be.Vue))})(this,function(be,e){"use strict";var Fp=Object.defineProperty;var Up=(be,e,Ln)=>e in be?Fp(be,e,{enumerable:!0,configurable:!0,writable:!0,value:Ln}):be[e]=Ln;var Re=(be,e,Ln)=>Up(be,typeof e!="symbol"?e+"":e,Ln);var Yo;const Ln=["width","height","stroke-width"],Jl={key:4,points:"6 9 12 15 18 9"},Ql={key:5,points:"9 6 15 12 9 18"},ke=e.defineComponent({__name:"Icon",props:{name:{},size:{},stroke:{}},setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("svg",{width:t.size??16,height:t.size??16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":t.stroke??1.8,"stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[t.name==="add"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[n[0]||(n[0]=e.createElementVNode("circle",{cx:"12",cy:"12",r:"9"},null,-1)),n[1]||(n[1]=e.createElementVNode("line",{x1:"12",y1:"8",x2:"12",y2:"16"},null,-1)),n[2]||(n[2]=e.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1))],64)):t.name==="minus"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[n[3]||(n[3]=e.createElementVNode("circle",{cx:"12",cy:"12",r:"9"},null,-1)),n[4]||(n[4]=e.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1))],64)):t.name==="delete"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[n[5]||(n[5]=e.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)):t.name==="edit"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[n[6]||(n[6]=e.createElementVNode("path",{d:"M4 20 l4 -1 11 -11 -3 -3 -11 11 z"},null,-1)),n[7]||(n[7]=e.createElementVNode("line",{x1:"14",y1:"6",x2:"18",y2:"10"},null,-1))],64)):t.name==="collapse"?(e.openBlock(),e.createElementBlock("polyline",Jl)):t.name==="expand"?(e.openBlock(),e.createElementBlock("polyline",Ql)):t.name==="collapse-all"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:6},[n[8]||(n[8]=e.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)):t.name==="expand-all"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:7},[n[9]||(n[9]=e.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)):t.name==="expand-level-1"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:8},[n[10]||(n[10]=e.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)):t.name==="expand-level-2"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:9},[n[11]||(n[11]=e.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)):t.name==="zoom-in"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:10},[n[12]||(n[12]=e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"},null,-1)),n[13]||(n[13]=e.createElementVNode("line",{x1:"11",y1:"8",x2:"11",y2:"14"},null,-1)),n[14]||(n[14]=e.createElementVNode("line",{x1:"8",y1:"11",x2:"14",y2:"11"},null,-1)),n[15]||(n[15]=e.createElementVNode("line",{x1:"16",y1:"16",x2:"21",y2:"21"},null,-1))],64)):t.name==="zoom-out"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:11},[n[16]||(n[16]=e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"},null,-1)),n[17]||(n[17]=e.createElementVNode("line",{x1:"8",y1:"11",x2:"14",y2:"11"},null,-1)),n[18]||(n[18]=e.createElementVNode("line",{x1:"16",y1:"16",x2:"21",y2:"21"},null,-1))],64)):t.name==="reset"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:12},[n[19]||(n[19]=e.createElementVNode("polyline",{points:"4 9 4 4 9 4"},null,-1)),n[20]||(n[20]=e.createElementVNode("polyline",{points:"15 4 20 4 20 9"},null,-1)),n[21]||(n[21]=e.createElementVNode("polyline",{points:"20 15 20 20 15 20"},null,-1)),n[22]||(n[22]=e.createElementVNode("polyline",{points:"9 20 4 20 4 15"},null,-1))],64)):t.name==="database"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:13},[n[23]||(n[23]=e.createElementVNode("ellipse",{cx:"12",cy:"6",rx:"7",ry:"2.5"},null,-1)),n[24]||(n[24]=e.createElementVNode("path",{d:"M5 6 V18 C5 19.4 8 20.5 12 20.5 C16 20.5 19 19.4 19 18 V6"},null,-1)),n[25]||(n[25]=e.createElementVNode("path",{d:"M5 12 C5 13.4 8 14.5 12 14.5 C16 14.5 19 13.4 19 12"},null,-1))],64)):t.name==="settings"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:14},[n[26]||(n[26]=e.createElementVNode("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"},null,-1)),n[27]||(n[27]=e.createElementVNode("circle",{cx:"12",cy:"12",r:"3"},null,-1))],64)):t.name==="markdown"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:15},[n[28]||(n[28]=e.createElementVNode("rect",{x:"2",y:"5",width:"20",height:"14",rx:"2"},null,-1)),n[29]||(n[29]=e.createElementVNode("path",{d:"M6 15 V9 L9 12 L12 9 V15"},null,-1)),n[30]||(n[30]=e.createElementVNode("path",{d:"M15 15 V9 L18 12 V9 M15 12 L18 15"},null,-1))],64)):t.name==="txt"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:16},[n[31]||(n[31]=e.createElementVNode("rect",{x:"5",y:"3",width:"14",height:"18",rx:"1.5"},null,-1)),n[32]||(n[32]=e.createElementVNode("line",{x1:"8",y1:"8",x2:"16",y2:"8"},null,-1)),n[33]||(n[33]=e.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1)),n[34]||(n[34]=e.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):t.name==="eye"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:17},[n[35]||(n[35]=e.createElementVNode("path",{d:"M2 12 C4 6 8 3 12 3 C16 3 20 6 22 12 C20 18 16 21 12 21 C8 21 4 18 2 12 Z"},null,-1)),n[36]||(n[36]=e.createElementVNode("circle",{cx:"12",cy:"12",r:"3.2"},null,-1))],64)):t.name==="eye-off"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:18},[n[37]||(n[37]=e.createElementVNode("path",{d:"M3 3 L21 21"},null,-1)),n[38]||(n[38]=e.createElementVNode("path",{d:"M10.5 6.2 C11 6.1 11.5 6 12 6 C16 6 19.5 8.5 21 12 C20.4 13.2 19.6 14.3 18.7 15.2"},null,-1)),n[39]||(n[39]=e.createElementVNode("path",{d:"M6.6 6.6 C4 8.2 2.7 10.2 2 12 C3 14.5 5.2 16.8 8 18.3 C9.2 19 10.6 19.4 12 19.4 C13.5 19.4 14.9 19 16.2 18.3"},null,-1)),n[40]||(n[40]=e.createElementVNode("path",{d:"M9.5 9.5 C9.1 10.2 9 11.1 9 12 C9 13.7 9.8 15.2 11 16.1"},null,-1))],64)):t.name==="outline"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:19},[n[41]||(n[41]=e.createElementVNode("rect",{x:"4",y:"3",width:"16",height:"18",rx:"2"},null,-1)),n[42]||(n[42]=e.createElementVNode("line",{x1:"8",y1:"8",x2:"16",y2:"8"},null,-1)),n[43]||(n[43]=e.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1)),n[44]||(n[44]=e.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):t.name==="logo"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:20},[n[45]||(n[45]=e.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)):t.name==="import"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:21},[n[46]||(n[46]=e.createElementVNode("path",{d:"M12 4 V15"},null,-1)),n[47]||(n[47]=e.createElementVNode("polyline",{points:"7 10 12 15 17 10"},null,-1)),n[48]||(n[48]=e.createElementVNode("path",{d:"M4 19 H20"},null,-1))],64)):t.name==="export"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:22},[n[49]||(n[49]=e.createElementVNode("path",{d:"M12 15 V4"},null,-1)),n[50]||(n[50]=e.createElementVNode("polyline",{points:"7 9 12 4 17 9"},null,-1)),n[51]||(n[51]=e.createElementVNode("path",{d:"M4 19 H20"},null,-1))],64)):t.name==="balance"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:23},[n[52]||(n[52]=e.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)):t.name==="mindmap"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:24},[n[53]||(n[53]=e.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)):t.name==="tree"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:25},[n[54]||(n[54]=e.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)):t.name==="org"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:26},[n[55]||(n[55]=e.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)):t.name==="image"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:27},[n[56]||(n[56]=e.createElementVNode("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"},null,-1)),n[57]||(n[57]=e.createElementVNode("circle",{cx:"9",cy:"11",r:"1.6"},null,-1)),n[58]||(n[58]=e.createElementVNode("polyline",{points:"3 17 9 12 13 15 16 13 21 17"},null,-1))],64)):t.name==="x"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:28},[n[59]||(n[59]=e.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"},null,-1)),n[60]||(n[60]=e.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"},null,-1))],64)):t.name==="link"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:29},[n[61]||(n[61]=e.createElementVNode("path",{d:"M10 13 a4 4 0 0 0 5.66 0 l3 -3 a4 4 0 1 0 -5.66 -5.66 l-1 1"},null,-1)),n[62]||(n[62]=e.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)):t.name==="note"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:30},[n[63]||(n[63]=e.createElementVNode("path",{d:"M6 4 h9 l3 3 v13 a1 1 0 0 1 -1 1 h-11 a1 1 0 0 1 -1 -1 v-15 a1 1 0 0 1 1 -1 z"},null,-1)),n[64]||(n[64]=e.createElementVNode("line",{x1:"8",y1:"10",x2:"16",y2:"10"},null,-1)),n[65]||(n[65]=e.createElementVNode("line",{x1:"8",y1:"13",x2:"16",y2:"13"},null,-1)),n[66]||(n[66]=e.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):t.name==="search"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:31},[n[67]||(n[67]=e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"},null,-1)),n[68]||(n[68]=e.createElementVNode("line",{x1:"16",y1:"16",x2:"21",y2:"21"},null,-1))],64)):t.name==="json"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:32},[n[69]||(n[69]=e.createElementVNode("path",{d:"M8 4 C6 4 6 6 6 7 C6 8 5 8 5 9 C5 10 6 10 6 11 C6 12 6 14 8 14"},null,-1)),n[70]||(n[70]=e.createElementVNode("path",{d:"M16 4 C18 4 18 6 18 7 C18 8 19 8 19 9 C19 10 18 10 18 11 C18 12 18 14 16 14"},null,-1))],64)):t.name==="svg-export"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:33},[n[71]||(n[71]=e.createElementVNode("path",{d:"M6 3 h8 l4 4 v14 a1 1 0 0 1 -1 1 h-11 a1 1 0 0 1 -1 -1 v-15 a1 1 0 0 1 1 -1 z"},null,-1)),n[72]||(n[72]=e.createElementVNode("polyline",{points:"14 3 14 7 18 7"},null,-1)),n[73]||(n[73]=e.createElementVNode("polyline",{points:"8 14 6 16 8 18"},null,-1)),n[74]||(n[74]=e.createElementVNode("polyline",{points:"14 14 16 16 14 18"},null,-1))],64)):e.createCommentVNode("",!0)],8,Ln))}}),qr="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",Xr="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",Zr=[18,15,13,12],ea=[700,600,500,400],ta=[52,40,32,28],na=[120,80,60,44],oa=[.8,.8,.8,.8],ra=Zr.length-1;function ia(t,o){return Math.round(or(t,o)*oa[Co(t)])}function Co(t){return Math.min(ra,Math.max(0,t))}function or(t,o=14){return Math.round(Zr[Co(t)]*o/14*10)/10}function la(t,o=14){return Math.round(ta[Co(t)]*o/14)}const Ao=60,Dn=14,Tt=24;let rr=null;function aa(){if(rr)return rr;const t=typeof document<"u"?document.createElement("canvas").getContext("2d"):null;return t?(rr=t,t):{font:"",measureText:()=>({width:0})}}const Jr=new Map;function sa(t,o,n){const r=`${n}|${o}|${t}`,i=Jr.get(r);if(i!==void 0)return i;const s=aa();s.font=`${n} ${o}px "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif`;const c=s.measureText(t).width;return Jr.set(r,c),c}const ca=24,da=400,ua=8,Qr=16,ei=4,fa=200;function ma(t,o,n){return Math.min(n,Math.max(o,t))}function pa(t,o,n,r,i){const s=Co(o),c=or(o,n),u=Math.min(sa(t.text||"",c,ea[s]),fa),d=ia(o,n),g=Math.ceil(u+d*2),w=!!(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table"))?Math.ceil(c*1.2)+6:la(o,n);let N=0;if(t.link&&(N+=Qr),t.note&&(N+=Qr),N>0){const Y=(t.link?1:0)+(t.note?1:0);N+=ei*Y}const V=14,_=2;let $=0;t.markers&&t.markers.length>0&&($=t.markers.length*V+(t.markers.length-1)*_+ei);const B=18,T=4,E=t.tags&&t.tags.length>0?B:0,k=g+N+$,m=(()=>{const Y=Math.round(na[s]*n/14);if(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table")){const ee=i==null?void 0:i[t.id];return Math.max(Y,ee??240)}return Y})(),v=!!(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table")),x=r==null?void 0:r[t.id],j=v?Math.max(24,x??Math.max(70,Math.ceil(c*5))):0,K=j>0?10:0;if(!t.image){const Y=Math.max(m,k),ee=Math.ceil(w+K+j+(E>0?T+E:0));return{w:Y,h:ee}}const ne=ma(t.image.width,ca,da),ce=Math.max(m,k,Math.ceil(ne+d*2)),re=Math.ceil(t.image.height+ua+w+K+j+(E>0?T+E:0));return{w:ce,h:re}}function ga(t,o={}){const n=o.mode??"mindmap",r=o.preservePositions===!0,i=o.baseFontSize??14,s=ni(t,0,null,1,"right",i,o.richHeights,o.richWidths);return ba(s),ha(s,n,r),s.x=0,s.y=0,ka(s,r)}function ha(t,o,n=!1){if(o==="mindmap"){const r=t.children;if(r.length!==0)if(r.length===1)r[0]._dir="right",r[0].side=1,r[0]._dirRight=1;else{const u=r.reduce((w,N)=>w+N._subtreeH,0);let d=1,g=Math.abs(r[0]._subtreeH-(u-r[0]._subtreeH)),b=0;for(let w=0;w<r.length-1;w++){b+=r[w]._subtreeH;const N=Math.abs(b-(u-b));N<g&&(g=N,d=w+1)}for(let w=0;w<d;w++)r[w]._dir="right",r[w].side=1,r[w]._dirRight=1;for(let w=d;w<r.length;w++)r[w]._dir="left",r[w].side=-1,r[w]._dirRight=-1}const i=t.children.filter(u=>u.side===1),s=t.children.filter(u=>u.side===-1),c=(u,d)=>{const g=d==="right"?1:-1;u._dir=d,u.side=g,u._dirRight=g;for(const b of u.children)c(b,d)};for(const u of i)c(u,"right");for(const u of s)c(u,"left");if(i.length>0){const u={...t,children:i};_o(u,"right",Ao,!0,n)}if(s.length>0){const u={...t,children:s};_o(u,"left",Ao,!0,n)}}else if(o==="tree"){const r=i=>{i.side=1,i._dir="right";for(const s of i.children)r(s)};for(const i of t.children)i._dir="right";_o(t,"right",Ao,!0,n),r(t)}else{for(const r of t.children)r._dir="down";ti(t,Ao,n)}}function _o(t,o,n,r,i=!1){if(t.children.length===0)return;const s=t.children.reduce((g,b,w)=>g+b._subtreeH+(w>0?Dn:0),0),c=o==="right"?1:-1,u=r?c:1;let d=t.y-u*s/2;t.children.forEach(g=>{i||(g.x=t.x+c*(t.width/2+n+g.width/2),g.y=d+u*g._subtreeH/2),g._dir=o,d+=u*(g._subtreeH+Dn),_o(g,o,n,!1,i)})}function ti(t,o,n=!1){if(t.children.length===0)return;const r=t.children.reduce((s,c,u)=>s+c._subtreeW+(u>0?Dn*2:0),0);let i=t.x-r/2;t.children.forEach(s=>{n||(s.x=i+s._subtreeW/2,s.y=t.y+t.height/2+o+s.height/2),s._dir="down",i+=s._subtreeW+Dn*2,ti(s,o,n)})}function ni(t,o,n,r,i,s,c,u){const d=pa(t,o,s,c,u),g={id:t.id,text:t.text,depth:o,x:t._x??0,y:t._y??0,width:d.w,height:d.h,fontSize:or(o,s),isRoot:o===0,collapsed:t.collapsed,side:r,_dir:i,_dirRight:r,_subtreeH:d.h,_subtreeW:d.w,image:t.image?{...t.image}:void 0,link:t.link?{url:t.link.url}:void 0,note:t.note?{text:t.note.text}:void 0,richContent:t.richContent?{kind:t.richContent.kind,raw:t.richContent.raw,lang:t.richContent.lang}:void 0,markers:t.markers?[...t.markers]:void 0,tags:t.tags?[...t.tags]:void 0,children:[],parent:n};if(t.collapsed)return g;const b=t.children.length,w=Math.ceil(b/2);return g.children=t.children.map((N,V)=>{const _=o===0?V<w?1:-1:r;return ni(N,o+1,g,_,i,s,c,u)}),g}function ba(t){const o=[t];for(let n=0;n<o.length;n++){const r=o[n];for(const i of r.children)o.push(i)}for(let n=o.length-1;n>=0;n--){const r=o[n];if(r.collapsed||r.children.length===0){r._subtreeH=r.height,r._subtreeW=r.width;continue}let i=0,s=0;for(const c of r.children)i+=c._subtreeH,s+=c._subtreeW;r.children.length>1&&(i+=Dn*(r.children.length-1),s+=Dn*2*(r.children.length-1)),r._subtreeH=Math.max(r.height,i),r._subtreeW=Math.max(r.width,s)}}function ka(t,o=!1){const n=[t];let r=1/0,i=-1/0,s=1/0,c=-1/0;for(;n.length;){const g=n.pop(),b=g.width/2,w=g.height/2;g.x-b<r&&(r=g.x-b),g.x+b>i&&(i=g.x+b),g.y-w<s&&(s=g.y-w),g.y+w>c&&(c=g.y+w),n.push(...g.children)}if(o)return{root:t,width:i-r+Tt*2,height:c-s+Tt*2,vbX:r-Tt,vbY:s-Tt,vbW:i-r+Tt*2,vbH:c-s+Tt*2};const u=Tt-s,d=[t];for(;d.length;){const g=d.pop();g.y+=u,d.push(...g.children)}return s+=u,c+=u,{root:t,width:i-r+Tt*2,height:c+Tt,vbX:r-Tt,vbY:0,vbW:i-r+Tt*2,vbH:c+Tt}}const Jt=[{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 ya(t,o=[]){return[...Jt,...o].find(r=>r.id===t)??Jt[0]}function Ea(t,o=8){const n=[],r=new Set,i=/#[0-9a-fA-F]{3,8}\b|rgba?\([^)]+\)|[A-Za-z][A-Za-z0-9_-]{2,30}/g;let s;for(;(s=i.exec(t))!==null;){const c=s[0];let u=null;if(c.startsWith("#")?u=xa(c):c.startsWith("rgb")?u=wa(c):u=Na[c.toLowerCase()]??null,!u)continue;const d=u.toLowerCase();if(!r.has(d)&&(r.add(d),n.push(d),n.length>=o))break}return n}function xa(t){const o=t.startsWith("#")?t.slice(1):t;if(!/^[0-9a-fA-F]+$/.test(o))return null;let n;if(o.length===3)n=o.split("").map(r=>r+r).join("");else if(o.length===4)n=o.slice(0,3).split("").map(r=>r+r).join("");else if(o.length===6)n=o;else if(o.length===8)n=o.slice(0,6);else return null;return"#"+n.toLowerCase()}function wa(t){const o=t.match(/^rgba?\(\s*([^)]+?)\s*\)$/i);if(!o)return null;const n=o[1].split(/\s*,\s*/);if(n.length<3)return null;const r=[];for(let i=0;i<3;i++){const s=n[i];if(s.endsWith("%")){const c=parseFloat(s);if(!isFinite(c))return null;r.push(Math.round(c/100*255))}else{const c=parseInt(s,10);if(!isFinite(c)||c<0||c>255)return null;r.push(c)}}return"#"+r.map(i=>i.toString(16).padStart(2,"0")).join("").toLowerCase()}const Na={black:"#000000",white:"#ffffff",red:"#ff0000",green:"#008000",blue:"#0000ff",yellow:"#ffff00",cyan:"#00ffff",magenta:"#ff00ff",gray:"#808080",grey:"#808080",silver:"#c0c0c0",maroon:"#800000",olive:"#808000",lime:"#00ff00",aqua:"#00ffff",teal:"#008080",navy:"#000080",fuchsia:"#ff00ff",purple:"#800080",orange:"#ffa500",pink:"#ffc0cb",brown:"#a52a2a",gold:"#ffd700",coral:"#ff7f50",tomato:"#ff6347",salmon:"#fa8072",khaki:"#f0e68c",violet:"#ee82ee",indigo:"#4b0082",turquoise:"#40e0d0",chocolate:"#d2691e",crimson:"#dc143c",darkred:"#8b0000",darkblue:"#00008b",darkgreen:"#006400",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightblue:"#add8e6",lightgreen:"#90ee90",lightyellow:"#ffffe0",lightpink:"#ffb6c1",skyblue:"#87ceeb",forestgreen:"#228b22",royalblue:"#4169e1",steelblue:"#4682b4",hotpink:"#ff69b4",deeppink:"#ff1493",orangered:"#ff4500",goldenrod:"#daa520",mediumpurple:"#9370db"};function Ft(){return"n_"+Math.random().toString(36).slice(2,10)+Date.now().toString(36).slice(-4)}function Ct(t){return JSON.parse(JSON.stringify(t))}function le(t,o){if(t.id===o)return t;for(const n of t.children){const r=le(n,o);if(r)return r}return null}function Bt(t,o,n=null){if(t.id===o)return n;for(const r of t.children){const i=Bt(r,o,t);if(i!==null)return i}return null}function Mo(t,o){const n=t.children.findIndex(r=>r.id===o);if(n>=0)return t.children.splice(n,1),!0;for(const r of t.children)if(Mo(r,o))return!0;return!1}function Sa(t,o,n){const r=le(t,o);return!r||r.text===n?!1:(r.text=n,!0)}function Ta(t,o,n,r){if(!Bt(t,o)||o===n||le(le(t,o),n))return!1;const i=Bt(t,o),s=i.children.findIndex(g=>g.id===o);if(s<0)return!1;const[c]=i.children.splice(s,1);if(r==="child"){const g=le(t,n);return g?(g.children.push(c),!0):(i.children.splice(s,0,c),!1)}const u=Bt(t,n);if(!u)return i.children.splice(s,0,c),!1;let d=u.children.findIndex(g=>g.id===n);return d<0?(i.children.splice(s,0,c),!1):(r==="after"&&(d+=1),u.children.splice(d,0,c),!0)}function oi(t){const o=/^新节点(?:\s+(\d+))?$/;let n=0,r=!1;for(const i of t.children){const s=i.text.match(o);if(s)if(s[1]){const c=parseInt(s[1],10);c>n&&(n=c)}else r=!0}return n===0&&!r?vo:n>0?`新节点 ${n+1}`:"新节点 2"}function ri(t,o,n){const r=le(t,o);if(!r)return null;const i={id:Ft(),text:n??oi(r),children:[]};return r.children.push(i),i}function ii(t,o,n){const r=Bt(t,o);if(!r)return null;const i=r.children.findIndex(c=>c.id===o);if(i<0)return null;const s={id:Ft(),text:n??oi(r),children:[]};return r.children.splice(i+1,0,s),s}function Ca(t,o,n){const r=Bt(t,o);if(!r)return null;const i=r.children.findIndex(c=>c.id===o);if(i<0)return null;const s={id:Ft(),text:n,children:[]};return r.children.splice(i,0,s),s}function Aa(t,o){const n=Bt(t,o);if(!n)return null;const r=n.children.findIndex(c=>c.id===o);if(r<0)return null;const i=n.children[r],s=Ct(i);return Ro(s),n.children.splice(r+1,0,s),s}function Ro(t){t.id=Ft();for(const o of t.children)Ro(o)}function li(t,o){const n=le(t,o);if(!n||n.id===t.id)return null;const r=Ct(n);return Ro(r),r}const vo="新节点";function Vn(t,o="导入的导图"){const n=t.split(/\r?\n/),r={id:Ft(),text:o,children:[]},i=[r],s=[-1/0],c=[],u=/^(#{1,6})\s+(.+?)\s*#*\s*$/,d=/^!\[([^\]]*)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,g=/^\[([^\]]+)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,b=/^(`{3,}|~{3,})\s*(\S+)?\s*$/;let w=!1,N=[],V=null;function _(T){N.push(T)}function $(){if(V&&N.length>0){for(;N.length>0&&N[0].trim()==="";)N.shift();for(;N.length>0&&N[N.length-1].trim()==="";)N.pop();const T=N.join(`
2
- `);T&&(V.note={text:T})}w=!1,N=[]}for(const T of n){if(w){const x=T.match(b);if(x&&x[1][0]==="`"){$();continue}_(T);continue}const E=T.match(u);if(E){const x=E[1].length,j=E[2].trim();c.push({level:x,text:j,body:""}),V=c[c.length-1];continue}const k=T.match(b);if(k&&k[2]==="note"){w=!0,N=[];continue}const m=T.match(d);if(m&&V){const x=m[2],j=160,K=120;V.image={src:x,naturalW:j,naturalH:K,width:j,height:K};continue}const v=T.match(g);if(v&&V){V.link={url:v[2]},V.text=v[1];continue}if(T.trim().length>0&&V){const x=T.trim();V.body=V.body?V.body+`
3
- `+x:x}}w&&$();function B(T){for(;i.length>1;){const v=i.length-1,x=s[v];if(x!==void 0&&x<T.level)break;i.pop(),s.pop()}const E=i[i.length-1],k=T.text,m={id:Ft(),text:k,children:[]};T.image&&(m.image={...T.image}),T.link&&(m.link={url:T.link.url}),T.note&&(m.note={text:T.note.text}),T.body&&(m.note={text:T.body}),E.children.push(m),i.push(m),s.push(T.level)}for(const T of c)B(T);if(c.length>0&&c[0].level===1){const T=r.children[0];T&&(r.text=T.text,r.id=T.id,T.image&&(r.image={...T.image}),T.link&&(r.link={url:T.link.url}),T.note&&(r.note={text:T.note.text}),r.children=T.children)}return r}function $n(t,o=1){let n="#".repeat(o)+" "+(t.text||"")+`
1
+ (function(he,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(he=typeof globalThis<"u"?globalThis:he||self,e(he.FlowMind={},he.Vue))})(this,function(he,e){"use strict";var gg=Object.defineProperty;var hg=(he,e,Bn)=>e in he?gg(he,e,{enumerable:!0,configurable:!0,writable:!0,value:Bn}):he[e]=Bn;var ve=(he,e,Bn)=>hg(he,typeof e!="symbol"?e+"":e,Bn);var Qo;const Bn=["width","height","stroke-width"],ha={key:4,points:"6 9 12 15 18 9"},ba={key:5,points:"9 6 15 12 9 18"},be=e.defineComponent({__name:"Icon",props:{name:{},size:{},stroke:{}},setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("svg",{width:t.size??16,height:t.size??16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":t.stroke??1.8,"stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[t.name==="add"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[n[0]||(n[0]=e.createElementVNode("circle",{cx:"12",cy:"12",r:"9"},null,-1)),n[1]||(n[1]=e.createElementVNode("line",{x1:"12",y1:"8",x2:"12",y2:"16"},null,-1)),n[2]||(n[2]=e.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1))],64)):t.name==="minus"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[n[3]||(n[3]=e.createElementVNode("circle",{cx:"12",cy:"12",r:"9"},null,-1)),n[4]||(n[4]=e.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1))],64)):t.name==="delete"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[n[5]||(n[5]=e.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)):t.name==="edit"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[n[6]||(n[6]=e.createElementVNode("path",{d:"M4 20 l4 -1 11 -11 -3 -3 -11 11 z"},null,-1)),n[7]||(n[7]=e.createElementVNode("line",{x1:"14",y1:"6",x2:"18",y2:"10"},null,-1))],64)):t.name==="collapse"?(e.openBlock(),e.createElementBlock("polyline",ha)):t.name==="expand"?(e.openBlock(),e.createElementBlock("polyline",ba)):t.name==="collapse-all"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:6},[n[8]||(n[8]=e.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)):t.name==="expand-all"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:7},[n[9]||(n[9]=e.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)):t.name==="expand-level-1"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:8},[n[10]||(n[10]=e.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)):t.name==="expand-level-2"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:9},[n[11]||(n[11]=e.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)):t.name==="zoom-in"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:10},[n[12]||(n[12]=e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"},null,-1)),n[13]||(n[13]=e.createElementVNode("line",{x1:"11",y1:"8",x2:"11",y2:"14"},null,-1)),n[14]||(n[14]=e.createElementVNode("line",{x1:"8",y1:"11",x2:"14",y2:"11"},null,-1)),n[15]||(n[15]=e.createElementVNode("line",{x1:"16",y1:"16",x2:"21",y2:"21"},null,-1))],64)):t.name==="zoom-out"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:11},[n[16]||(n[16]=e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"},null,-1)),n[17]||(n[17]=e.createElementVNode("line",{x1:"8",y1:"11",x2:"14",y2:"11"},null,-1)),n[18]||(n[18]=e.createElementVNode("line",{x1:"16",y1:"16",x2:"21",y2:"21"},null,-1))],64)):t.name==="reset"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:12},[n[19]||(n[19]=e.createElementVNode("polyline",{points:"4 9 4 4 9 4"},null,-1)),n[20]||(n[20]=e.createElementVNode("polyline",{points:"15 4 20 4 20 9"},null,-1)),n[21]||(n[21]=e.createElementVNode("polyline",{points:"20 15 20 20 15 20"},null,-1)),n[22]||(n[22]=e.createElementVNode("polyline",{points:"9 20 4 20 4 15"},null,-1))],64)):t.name==="database"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:13},[n[23]||(n[23]=e.createElementVNode("ellipse",{cx:"12",cy:"6",rx:"7",ry:"2.5"},null,-1)),n[24]||(n[24]=e.createElementVNode("path",{d:"M5 6 V18 C5 19.4 8 20.5 12 20.5 C16 20.5 19 19.4 19 18 V6"},null,-1)),n[25]||(n[25]=e.createElementVNode("path",{d:"M5 12 C5 13.4 8 14.5 12 14.5 C16 14.5 19 13.4 19 12"},null,-1))],64)):t.name==="settings"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:14},[n[26]||(n[26]=e.createElementVNode("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"},null,-1)),n[27]||(n[27]=e.createElementVNode("circle",{cx:"12",cy:"12",r:"3"},null,-1))],64)):t.name==="markdown"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:15},[n[28]||(n[28]=e.createElementVNode("rect",{x:"2",y:"5",width:"20",height:"14",rx:"2"},null,-1)),n[29]||(n[29]=e.createElementVNode("path",{d:"M6 15 V9 L9 12 L12 9 V15"},null,-1)),n[30]||(n[30]=e.createElementVNode("path",{d:"M15 15 V9 L18 12 V9 M15 12 L18 15"},null,-1))],64)):t.name==="txt"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:16},[n[31]||(n[31]=e.createElementVNode("rect",{x:"5",y:"3",width:"14",height:"18",rx:"1.5"},null,-1)),n[32]||(n[32]=e.createElementVNode("line",{x1:"8",y1:"8",x2:"16",y2:"8"},null,-1)),n[33]||(n[33]=e.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1)),n[34]||(n[34]=e.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):t.name==="eye"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:17},[n[35]||(n[35]=e.createElementVNode("path",{d:"M2 12 C4 6 8 3 12 3 C16 3 20 6 22 12 C20 18 16 21 12 21 C8 21 4 18 2 12 Z"},null,-1)),n[36]||(n[36]=e.createElementVNode("circle",{cx:"12",cy:"12",r:"3.2"},null,-1))],64)):t.name==="eye-off"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:18},[n[37]||(n[37]=e.createElementVNode("path",{d:"M3 3 L21 21"},null,-1)),n[38]||(n[38]=e.createElementVNode("path",{d:"M10.5 6.2 C11 6.1 11.5 6 12 6 C16 6 19.5 8.5 21 12 C20.4 13.2 19.6 14.3 18.7 15.2"},null,-1)),n[39]||(n[39]=e.createElementVNode("path",{d:"M6.6 6.6 C4 8.2 2.7 10.2 2 12 C3 14.5 5.2 16.8 8 18.3 C9.2 19 10.6 19.4 12 19.4 C13.5 19.4 14.9 19 16.2 18.3"},null,-1)),n[40]||(n[40]=e.createElementVNode("path",{d:"M9.5 9.5 C9.1 10.2 9 11.1 9 12 C9 13.7 9.8 15.2 11 16.1"},null,-1))],64)):t.name==="outline"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:19},[n[41]||(n[41]=e.createElementVNode("rect",{x:"4",y:"3",width:"16",height:"18",rx:"2"},null,-1)),n[42]||(n[42]=e.createElementVNode("line",{x1:"8",y1:"8",x2:"16",y2:"8"},null,-1)),n[43]||(n[43]=e.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1)),n[44]||(n[44]=e.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):t.name==="logo"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:20},[n[45]||(n[45]=e.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)):t.name==="import"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:21},[n[46]||(n[46]=e.createElementVNode("path",{d:"M12 4 V15"},null,-1)),n[47]||(n[47]=e.createElementVNode("polyline",{points:"7 10 12 15 17 10"},null,-1)),n[48]||(n[48]=e.createElementVNode("path",{d:"M4 19 H20"},null,-1))],64)):t.name==="export"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:22},[n[49]||(n[49]=e.createElementVNode("path",{d:"M12 15 V4"},null,-1)),n[50]||(n[50]=e.createElementVNode("polyline",{points:"7 9 12 4 17 9"},null,-1)),n[51]||(n[51]=e.createElementVNode("path",{d:"M4 19 H20"},null,-1))],64)):t.name==="balance"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:23},[n[52]||(n[52]=e.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)):t.name==="mindmap"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:24},[n[53]||(n[53]=e.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)):t.name==="tree"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:25},[n[54]||(n[54]=e.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)):t.name==="org"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:26},[n[55]||(n[55]=e.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)):t.name==="image"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:27},[n[56]||(n[56]=e.createElementVNode("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"},null,-1)),n[57]||(n[57]=e.createElementVNode("circle",{cx:"9",cy:"11",r:"1.6"},null,-1)),n[58]||(n[58]=e.createElementVNode("polyline",{points:"3 17 9 12 13 15 16 13 21 17"},null,-1))],64)):t.name==="x"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:28},[n[59]||(n[59]=e.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"},null,-1)),n[60]||(n[60]=e.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"},null,-1))],64)):t.name==="link"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:29},[n[61]||(n[61]=e.createElementVNode("path",{d:"M10 13 a4 4 0 0 0 5.66 0 l3 -3 a4 4 0 1 0 -5.66 -5.66 l-1 1"},null,-1)),n[62]||(n[62]=e.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)):t.name==="note"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:30},[n[63]||(n[63]=e.createElementVNode("path",{d:"M6 4 h9 l3 3 v13 a1 1 0 0 1 -1 1 h-11 a1 1 0 0 1 -1 -1 v-15 a1 1 0 0 1 1 -1 z"},null,-1)),n[64]||(n[64]=e.createElementVNode("line",{x1:"8",y1:"10",x2:"16",y2:"10"},null,-1)),n[65]||(n[65]=e.createElementVNode("line",{x1:"8",y1:"13",x2:"16",y2:"13"},null,-1)),n[66]||(n[66]=e.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):t.name==="search"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:31},[n[67]||(n[67]=e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"},null,-1)),n[68]||(n[68]=e.createElementVNode("line",{x1:"16",y1:"16",x2:"21",y2:"21"},null,-1))],64)):t.name==="json"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:32},[n[69]||(n[69]=e.createElementVNode("path",{d:"M8 4 C6 4 6 6 6 7 C6 8 5 8 5 9 C5 10 6 10 6 11 C6 12 6 14 8 14"},null,-1)),n[70]||(n[70]=e.createElementVNode("path",{d:"M16 4 C18 4 18 6 18 7 C18 8 19 8 19 9 C19 10 18 10 18 11 C18 12 18 14 16 14"},null,-1))],64)):t.name==="svg-export"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:33},[n[71]||(n[71]=e.createElementVNode("path",{d:"M6 3 h8 l4 4 v14 a1 1 0 0 1 -1 1 h-11 a1 1 0 0 1 -1 -1 v-15 a1 1 0 0 1 1 -1 z"},null,-1)),n[72]||(n[72]=e.createElementVNode("polyline",{points:"14 3 14 7 18 7"},null,-1)),n[73]||(n[73]=e.createElementVNode("polyline",{points:"8 14 6 16 8 18"},null,-1)),n[74]||(n[74]=e.createElementVNode("polyline",{points:"14 14 16 16 14 18"},null,-1))],64)):e.createCommentVNode("",!0)],8,Bn))}}),ri="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",ii="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",li=[22,15,13,12],ka=[700,600,500,400],ya=[52,40,32,28],Ea=[120,80,60,44],xa=[.8,.8,.8,.8],wa=li.length-1;function Na(t,o){return Math.round(fr(t,o)*xa[Co(t)])}function Co(t){return Math.min(wa,Math.max(0,t))}function fr(t,o=14){return Math.round(li[Co(t)]*o/14*10)/10}function Sa(t,o=14){return Math.round(ya[Co(t)]*o/14)}const Ao=60,In=14,At=24;let mr=null;function Ta(){if(mr)return mr;const t=typeof document<"u"?document.createElement("canvas").getContext("2d"):null;return t?(mr=t,t):{font:"",measureText:()=>({width:0})}}const ai=new Map;function Ca(t,o,n){const r=`${n}|${o}|${t}`,l=ai.get(r);if(l!==void 0)return l;const s=Ta();s.font=`${n} ${o}px "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif`;const c=s.measureText(t).width;return ai.set(r,c),c}const Aa=24,_a=400,Ma=8,si=16,ci=4,va=200;function Ra(t,o,n){return Math.min(n,Math.max(o,t))}function Ba(t,o,n,r,l){const s=Co(o),c=fr(o,n),u=Math.min(Ca(t.text||"",c,ka[s]),va),d=Na(o,n),g=Math.ceil(u+d*2),w=!!(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table"))?Math.ceil(c*1.2)+6:Sa(o,n);let N=0;if(t.link&&(N+=si),t.note&&(N+=si),N>0){const q=(t.link?1:0)+(t.note?1:0);N+=ci*q}const $=14,M=2;let P=0;t.markers&&t.markers.length>0&&(P=t.markers.length*$+(t.markers.length-1)*M+ci);const I=18,C=4,E=t.tags&&t.tags.length>0?I:0,k=g+N+P,m=(()=>{const q=Math.round(Ea[s]*n/14);if(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table")){const Q=l==null?void 0:l[t.id];return Math.max(q,Q??240)}return q})(),B=!!(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table")),x=r==null?void 0:r[t.id],K=B?Math.max(24,x??Math.max(70,Math.ceil(c*5))):0,Y=K>0?10:0;if(!t.image){const q=Math.max(m,k),Q=Math.ceil(w+Y+K+(E>0?C+E:0));return{w:q,h:Q}}const ee=Ra(t.image.width,Aa,_a),ae=Math.max(m,k,Math.ceil(ee+d*2)),re=Math.ceil(t.image.height+Ma+w+Y+K+(E>0?C+E:0));return{w:ae,h:re}}function Ia(t,o={}){const n=o.mode??"mindmap",r=o.preservePositions===!0,l=o.baseFontSize??14,s=ui(t,0,null,1,"right",l,o.richHeights,o.richWidths);return Oa(s),za(s,n,r),s.x=0,s.y=0,La(s,r)}function za(t,o,n=!1){if(o==="mindmap"){const r=t.children;if(r.length!==0)if(r.length===1)r[0]._dir="right",r[0].side=1,r[0]._dirRight=1;else{const u=r.reduce((w,N)=>w+N._subtreeH,0);let d=1,g=Math.abs(r[0]._subtreeH-(u-r[0]._subtreeH)),b=0;for(let w=0;w<r.length-1;w++){b+=r[w]._subtreeH;const N=Math.abs(b-(u-b));N<g&&(g=N,d=w+1)}for(let w=0;w<d;w++)r[w]._dir="right",r[w].side=1,r[w]._dirRight=1;for(let w=d;w<r.length;w++)r[w]._dir="left",r[w].side=-1,r[w]._dirRight=-1}const l=t.children.filter(u=>u.side===1),s=t.children.filter(u=>u.side===-1),c=(u,d)=>{const g=d==="right"?1:-1;u._dir=d,u.side=g,u._dirRight=g;for(const b of u.children)c(b,d)};for(const u of l)c(u,"right");for(const u of s)c(u,"left");if(l.length>0){const u={...t,children:l};_o(u,"right",Ao,!0,n)}if(s.length>0){const u={...t,children:s};_o(u,"left",Ao,!0,n)}}else if(o==="tree"){const r=l=>{l.side=1,l._dir="right";for(const s of l.children)r(s)};for(const l of t.children)l._dir="right";_o(t,"right",Ao,!0,n),r(t)}else{for(const r of t.children)r._dir="down";di(t,Ao,n)}}function _o(t,o,n,r,l=!1){if(t.children.length===0)return;const s=t.children.reduce((g,b,w)=>g+b._subtreeH+(w>0?In:0),0),c=o==="right"?1:-1,u=r?c:1;let d=t.y-u*s/2;t.children.forEach(g=>{l||(g.x=t.x+c*(t.width/2+n+g.width/2),g.y=d+u*g._subtreeH/2),g._dir=o,d+=u*(g._subtreeH+In),_o(g,o,n,!1,l)})}function di(t,o,n=!1){if(t.children.length===0)return;const r=t.children.reduce((s,c,u)=>s+c._subtreeW+(u>0?In*2:0),0);let l=t.x-r/2;t.children.forEach(s=>{n||(s.x=l+s._subtreeW/2,s.y=t.y+t.height/2+o+s.height/2),s._dir="down",l+=s._subtreeW+In*2,di(s,o,n)})}function ui(t,o,n,r,l,s,c,u){const d=Ba(t,o,s,c,u),g={id:t.id,text:t.text,depth:o,x:t._x??0,y:t._y??0,width:d.w,height:d.h,fontSize:fr(o,s),isRoot:o===0,collapsed:t.collapsed,side:r,_dir:l,_dirRight:r,_subtreeH:d.h,_subtreeW:d.w,image:t.image?{...t.image}:void 0,link:t.link?{url:t.link.url}:void 0,note:t.note?{text:t.note.text}:void 0,richContent:t.richContent?{kind:t.richContent.kind,raw:t.richContent.raw,lang:t.richContent.lang}:void 0,markers:t.markers?[...t.markers]:void 0,tags:t.tags?[...t.tags]:void 0,children:[],parent:n};if(t.collapsed)return g;const b=t.children.length,w=Math.ceil(b/2);return g.children=t.children.map((N,$)=>{const M=o===0?$<w?1:-1:r;return ui(N,o+1,g,M,l,s,c,u)}),g}function Oa(t){const o=[t];for(let n=0;n<o.length;n++){const r=o[n];for(const l of r.children)o.push(l)}for(let n=o.length-1;n>=0;n--){const r=o[n];if(r.collapsed||r.children.length===0){r._subtreeH=r.height,r._subtreeW=r.width;continue}let l=0,s=0;for(const c of r.children)l+=c._subtreeH,s+=c._subtreeW;r.children.length>1&&(l+=In*(r.children.length-1),s+=In*2*(r.children.length-1)),r._subtreeH=Math.max(r.height,l),r._subtreeW=Math.max(r.width,s)}}function La(t,o=!1){const n=[t];let r=1/0,l=-1/0,s=1/0,c=-1/0;for(;n.length;){const g=n.pop(),b=g.width/2,w=g.height/2;g.x-b<r&&(r=g.x-b),g.x+b>l&&(l=g.x+b),g.y-w<s&&(s=g.y-w),g.y+w>c&&(c=g.y+w),n.push(...g.children)}if(o)return{root:t,width:l-r+At*2,height:c-s+At*2,vbX:r-At,vbY:s-At,vbW:l-r+At*2,vbH:c-s+At*2};const u=At-s,d=[t];for(;d.length;){const g=d.pop();g.y+=u,d.push(...g.children)}return s+=u,c+=u,{root:t,width:l-r+At*2,height:c+At,vbX:r-At,vbY:0,vbW:l-r+At*2,vbH:c+At}}const en=[{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 Da(t,o=[]){return[...en,...o].find(r=>r.id===t)??en[0]}function Va(t,o=8){const n=[],r=new Set,l=/#[0-9a-fA-F]{3,8}\b|rgba?\([^)]+\)|[A-Za-z][A-Za-z0-9_-]{2,30}/g;let s;for(;(s=l.exec(t))!==null;){const c=s[0];let u=null;if(c.startsWith("#")?u=$a(c):c.startsWith("rgb")?u=Pa(c):u=Ua[c.toLowerCase()]??null,!u)continue;const d=u.toLowerCase();if(!r.has(d)&&(r.add(d),n.push(d),n.length>=o))break}return n}function $a(t){const o=t.startsWith("#")?t.slice(1):t;if(!/^[0-9a-fA-F]+$/.test(o))return null;let n;if(o.length===3)n=o.split("").map(r=>r+r).join("");else if(o.length===4)n=o.slice(0,3).split("").map(r=>r+r).join("");else if(o.length===6)n=o;else if(o.length===8)n=o.slice(0,6);else return null;return"#"+n.toLowerCase()}function Pa(t){const o=t.match(/^rgba?\(\s*([^)]+?)\s*\)$/i);if(!o)return null;const n=o[1].split(/\s*,\s*/);if(n.length<3)return null;const r=[];for(let l=0;l<3;l++){const s=n[l];if(s.endsWith("%")){const c=parseFloat(s);if(!isFinite(c))return null;r.push(Math.round(c/100*255))}else{const c=parseInt(s,10);if(!isFinite(c)||c<0||c>255)return null;r.push(c)}}return"#"+r.map(l=>l.toString(16).padStart(2,"0")).join("").toLowerCase()}const Ua={black:"#000000",white:"#ffffff",red:"#ff0000",green:"#008000",blue:"#0000ff",yellow:"#ffff00",cyan:"#00ffff",magenta:"#ff00ff",gray:"#808080",grey:"#808080",silver:"#c0c0c0",maroon:"#800000",olive:"#808000",lime:"#00ff00",aqua:"#00ffff",teal:"#008080",navy:"#000080",fuchsia:"#ff00ff",purple:"#800080",orange:"#ffa500",pink:"#ffc0cb",brown:"#a52a2a",gold:"#ffd700",coral:"#ff7f50",tomato:"#ff6347",salmon:"#fa8072",khaki:"#f0e68c",violet:"#ee82ee",indigo:"#4b0082",turquoise:"#40e0d0",chocolate:"#d2691e",crimson:"#dc143c",darkred:"#8b0000",darkblue:"#00008b",darkgreen:"#006400",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightblue:"#add8e6",lightgreen:"#90ee90",lightyellow:"#ffffe0",lightpink:"#ffb6c1",skyblue:"#87ceeb",forestgreen:"#228b22",royalblue:"#4169e1",steelblue:"#4682b4",hotpink:"#ff69b4",deeppink:"#ff1493",orangered:"#ff4500",goldenrod:"#daa520",mediumpurple:"#9370db"};function Gt(){return"n_"+Math.random().toString(36).slice(2,10)+Date.now().toString(36).slice(-4)}function _t(t){return JSON.parse(JSON.stringify(t))}function oe(t,o){if(t.id===o)return t;for(const n of t.children){const r=oe(n,o);if(r)return r}return null}function Lt(t,o,n=null){if(t.id===o)return n;for(const r of t.children){const l=Lt(r,o,t);if(l!==null)return l}return null}function Mo(t,o){const n=t.children.findIndex(r=>r.id===o);if(n>=0)return t.children.splice(n,1),!0;for(const r of t.children)if(Mo(r,o))return!0;return!1}function Fa(t,o,n){const r=oe(t,o);return!r||r.text===n?!1:(r.text=n,!0)}function Ha(t,o,n,r){if(!Lt(t,o)||o===n||oe(oe(t,o),n))return!1;const l=Lt(t,o),s=l.children.findIndex(g=>g.id===o);if(s<0)return!1;const[c]=l.children.splice(s,1);if(r==="child"){const g=oe(t,n);return g?(g.children.push(c),!0):(l.children.splice(s,0,c),!1)}const u=Lt(t,n);if(!u)return l.children.splice(s,0,c),!1;let d=u.children.findIndex(g=>g.id===n);return d<0?(l.children.splice(s,0,c),!1):(r==="after"&&(d+=1),u.children.splice(d,0,c),!0)}function fi(t){const o=/^新节点(?:\s+(\d+))?$/;let n=0,r=!1;for(const l of t.children){const s=l.text.match(o);if(s)if(s[1]){const c=parseInt(s[1],10);c>n&&(n=c)}else r=!0}return n===0&&!r?Ro:n>0?`新节点 ${n+1}`:"新节点 2"}function mi(t,o,n){const r=oe(t,o);if(!r)return null;const l={id:Gt(),text:n??fi(r),children:[]};return r.children.push(l),l}function pi(t,o,n){const r=Lt(t,o);if(!r)return null;const l=r.children.findIndex(c=>c.id===o);if(l<0)return null;const s={id:Gt(),text:n??fi(r),children:[]};return r.children.splice(l+1,0,s),s}function Wa(t,o,n){const r=Lt(t,o);if(!r)return null;const l=r.children.findIndex(c=>c.id===o);if(l<0)return null;const s={id:Gt(),text:n,children:[]};return r.children.splice(l,0,s),s}function Ga(t,o){const n=Lt(t,o);if(!n)return null;const r=n.children.findIndex(c=>c.id===o);if(r<0)return null;const l=n.children[r],s=_t(l);return vo(s),n.children.splice(r+1,0,s),s}function vo(t){t.id=Gt();for(const o of t.children)vo(o)}function gi(t,o){const n=oe(t,o);if(!n||n.id===t.id)return null;const r=_t(n);return vo(r),r}const Ro="新节点";function zn(t,o="导入的导图"){const n=t.split(/\r?\n/),r={id:Gt(),text:o,children:[]},l=[r],s=[-1/0],c=[],u=/^(#{1,6})\s+(.+?)\s*#*\s*$/,d=/^!\[([^\]]*)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,g=/^\[([^\]]+)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,b=/^(`{3,}|~{3,})\s*(\S+)?\s*$/;let w=!1,N=[],$=null;function M(C){N.push(C)}function P(){if($&&N.length>0){for(;N.length>0&&N[0].trim()==="";)N.shift();for(;N.length>0&&N[N.length-1].trim()==="";)N.pop();const C=N.join(`
2
+ `);C&&($.note={text:C})}w=!1,N=[]}for(const C of n){if(w){const x=C.match(b);if(x&&x[1][0]==="`"){P();continue}M(C);continue}const E=C.match(u);if(E){const x=E[1].length,K=E[2].trim();c.push({level:x,text:K,body:""}),$=c[c.length-1];continue}const k=C.match(b);if(k&&k[2]==="note"){w=!0,N=[];continue}const m=C.match(d);if(m&&$){const x=m[2],K=160,Y=120;$.image={src:x,naturalW:K,naturalH:Y,width:K,height:Y};continue}const B=C.match(g);if(B&&$){$.link={url:B[2]},$.text=B[1];continue}if(C.trim().length>0&&$){const x=C.trim();$.body=$.body?$.body+`
3
+ `+x:x}}w&&P();function I(C){for(;l.length>1;){const B=l.length-1,x=s[B];if(x!==void 0&&x<C.level)break;l.pop(),s.pop()}const E=l[l.length-1],k=C.text,m={id:Gt(),text:k,children:[]};C.image&&(m.image={...C.image}),C.link&&(m.link={url:C.link.url}),C.note&&(m.note={text:C.note.text}),C.body&&(m.note={text:C.body}),E.children.push(m),l.push(m),s.push(C.level)}for(const C of c)I(C);if(c.length>0&&c[0].level===1){const C=r.children[0];C&&(r.text=C.text,r.id=C.id,C.image&&(r.image={...C.image}),C.link&&(r.link={url:C.link.url}),C.note&&(r.note={text:C.note.text}),r.children=C.children)}return r}function On(t,o=1){let n="#".repeat(o)+" "+(t.text||"")+`
4
4
  `;t.link&&(n+=`[${t.text||"link"}](${t.link.url})
5
5
  `),t.image&&(n+=`![image](${t.image.src})
6
6
  `),t.note&&(n+="```note\n"+t.note.text+"\n```\n"),t.richContent&&(n+=t.richContent.raw+`
7
- `);for(const r of t.children)n+=$n(r,o+1);return n}function _a(t){var g,b;const o=t.split(/\r?\n/),n=[];let r=0;const i=/^(#{1,6})\s+(.+?)\s*#*\s*$/,s=/^(`{3,}|~{3,})\s*(\S+)?\s*$/,c=/^\s*\|?\s*(:?-+:?\s*\|\s*)+(:?-+:?)(\s*\|)?\s*$/,u=/^(\s*)[-*+]\s+(.*)$/,d=/^(\s*)\d+\.\s+(.*)$/;for(;r<o.length;){const w=o[r],N=w.match(s);if(N){const k=N[1][0],m=N[2]||"",v=[w];for(r++;r<o.length;){const j=o[r].match(s);if(j&&j[1][0]===k){v.push(o[r]),r++;break}v.push(o[r]),r++}const x=v.slice(1,-1).join(`
7
+ `);for(const r of t.children)n+=On(r,o+1);return n}function ja(t){var g,b;const o=t.split(/\r?\n/),n=[];let r=0;const l=/^(#{1,6})\s+(.+?)\s*#*\s*$/,s=/^(`{3,}|~{3,})\s*(\S+)?\s*$/,c=/^\s*\|?\s*(:?-+:?\s*\|\s*)+(:?-+:?)(\s*\|)?\s*$/,u=/^(\s*)[-*+]\s+(.*)$/,d=/^(\s*)\d+\.\s+(.*)$/;for(;r<o.length;){const w=o[r],N=w.match(s);if(N){const k=N[1][0],m=N[2]||"",B=[w];for(r++;r<o.length;){const K=o[r].match(s);if(K&&K[1][0]===k){B.push(o[r]),r++;break}B.push(o[r]),r++}const x=B.slice(1,-1).join(`
8
8
  `).trim();n.push({kind:"code",text:((g=x.split(`
9
- `)[0])==null?void 0:g.slice(0,80))||"(空代码块)",raw:v.join(`
10
- `),lang:m});continue}const V=w.match(i);if(V){n.push({kind:"heading",level:V[1].length,text:V[2].trim(),raw:w}),r++;continue}if(/^\s*\|/.test(w)){const k=[];let m=r,v=!1;for(;m<o.length&&/^\s*\|/.test(o[m]);)k.push(o[m]),c.test(o[m])&&(v=!0),m++;if(v&&k.length>=2){n.push({kind:"table",text:((b=k[0].replace(/^\s*\|/,"").replace(/\|\s*$/,"").split("|")[0])==null?void 0:b.trim())||"表格",raw:k.join(`
11
- `)}),r=m;continue}}const _=w.match(u),$=w.match(d);if(_||$){let k=r;for(;k<o.length;){const m=o[k].match(u),v=o[k].match(d);if(!(m||v))break;const x=o[k].replace(/^\s*[-*+]\s+/,"").replace(/^\s*\d+\.\s+/,"").trim();x.length>0&&n.push({kind:"list",text:x.slice(0,80)||"(列表项)",raw:o[k]}),k++}r=k;continue}if(w.trim()===""){r++;continue}const B=[w];let T=r+1;for(;T<o.length;){const k=o[T];if(k.trim()===""||i.test(k)||s.test(k)||u.test(k)||d.test(k)||/^\s*\|/.test(k))break;B.push(k),T++}const E=B.join(" ").trim();n.push({kind:"paragraph",text:E.slice(0,80)||"(空段落)",raw:B.join(`
12
- `)}),r=T}return n}function Ma(t,o="导入的导图"){const n=_a(t||""),r={id:Ft(),text:o,children:[]},i=[r],s=[0];let c=!1;function u(d){if(d.kind==="heading"){const b=d.level;for(;i.length>1&&s[s.length-1]>=b;)i.pop(),s.pop();if(!c&&b===1){c=!0,r.text=d.text,s[0]=1;return}const w={id:Ft(),text:d.text,children:[]};i[i.length-1].children.push(w),i.push(w),s.push(b);return}const g={id:Ft(),text:d.text,children:[],richContent:{kind:d.kind,raw:d.raw,lang:d.lang}};i[i.length-1].children.push(g)}for(const d of n)u(d);return r}function Ra(t){return t.richContent?t.richContent.raw+`
13
- `:""}function va(t){const o=t.minScale??.2,n=t.maxScale??1/0,r=t.step??1.2,i=e.ref(1),s=e.ref(0),c=e.ref(0),u=e.ref(!1),d=e.ref(!1),g=e.reactive({x:0,y:0,ox:0,oy:0}),b=e.ref(!1),w=e.reactive({x:0,y:0}),N=e.reactive({x:0,y:0,width:0,height:0}),V=e.ref(0);let _=null;function $(Y){_=Y}function B(Y){Y.preventDefault();const ee=t.getContainer();if(!ee)return;const ie=-Y.deltaY*.001,z=Math.min(n,Math.max(o,i.value*(1+ie))),C=ee.getBoundingClientRect(),F=Y.clientX-C.left,P=Y.clientY-C.top,W=(F-s.value)/i.value,ae=(P-c.value)/i.value;i.value=z,s.value=F-W*z,c.value=P-ae*z}function T(){i.value=Math.min(n,i.value*r)}function E(){i.value=Math.max(o,i.value/r)}function k(Y){var ie;Y.target.closest(".zm-node, .zm-toolbar, button, input, textarea")||(u.value=!0,d.value=!1,g.x=Y.clientX,g.y=Y.clientY,g.ox=s.value,g.oy=c.value,window.addEventListener("mousemove",m),window.addEventListener("mouseup",v),(ie=Y.preventDefault)==null||ie.call(Y))}function m(Y){if(!u.value)return;const ee=Y.clientX-g.x,ie=Y.clientY-g.y;(Math.abs(ee)>3||Math.abs(ie)>3)&&(d.value=!0),s.value=g.ox+ee,c.value=g.oy+ie}function v(){u.value=!1,window.removeEventListener("mousemove",m),window.removeEventListener("mouseup",v)}function x(Y,ee,ie){b.value=!0,w.x=Y,w.y=ee,N.x=Y,N.y=ee,N.width=0,N.height=0,N.shiftKey=!!(ie!=null&&ie.shift),V.value++,window.addEventListener("mousemove",ne),window.addEventListener("mouseup",K)}function j(Y,ee){if(!b.value)return;const ie=Math.min(w.x,Y),z=Math.min(w.y,ee),C=Math.max(w.x,Y),F=Math.max(w.y,ee);N.x=ie,N.y=z,N.width=C-ie,N.height=F-z,V.value++}function K(){b.value=!1,window.removeEventListener("mousemove",ne),window.removeEventListener("mouseup",K),_&&_()}function ne(Y){if(!b.value)return;const ee=t.getContainer();if(!ee)return;const ie=ee.getBoundingClientRect(),z=(Y.clientX-ie.left-s.value)/i.value,C=(Y.clientY-ie.top-c.value)/i.value;j(z,C)}function ce(Y,ee,ie,z=60){const C=t.getContainer();if(!C)return;const F=C.getBoundingClientRect(),P=(F.width-z*2)/Y,W=(F.height-z*2)/ee,ae=Math.min(1,Math.max(.3,Math.min(P,W)));i.value=ae,s.value=F.width/2,c.value=F.height/2-ie*ae}function re(Y,ee,ie,z,C=80){const F=t.getContainer();if(!F)return;const P=F.getBoundingClientRect();let W=i.value;(ie*W<40||z*W<40)&&(W=Math.min(n,Math.max(1,60/Math.min(ie,z)))),i.value=W,s.value=P.width/2-Y*W,c.value=P.height/2-ee*W}return{scale:i,offsetX:s,offsetY:c,isPanning:u,panMoved:d,onWheel:B,zoomIn:T,zoomOut:E,startPan:k,startMarquee:x,updateMarquee:j,isMarquee:b,marquee:N,marqueeVersion:V,setOnMarqueeEnd:$,resetView:ce,centerOn:re}}const Ba=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform);function ai(t){return Ba?t.metaKey:t.ctrlKey}function za(t){function o(){const r=t.getSelectedId();if(r)return r;if(t.defaultTargetId)return t.defaultTargetId();const i=t.getSelectedIds();return i.length>0?i[0]:null}function n(r){var u,d,g;const i=r.target;if(i&&(i.tagName==="INPUT"||i.tagName==="TEXTAREA"||i.isContentEditable)||t.isReadonly()||t.isEditing())return;const s=t.getSelectedId(),c=o();if(c){if(ai(r)&&!r.shiftKey){if(r.key==="d"||r.key==="D"){const b=(u=t.defaultTargetId)==null?void 0:u.call(t);s&&s!==b&&(r.preventDefault(),t.onDuplicate(s));return}if(r.key==="c"||r.key==="C"){const b=t.getSelectedIds();b.length>0&&(r.preventDefault(),t.onCopy(b));return}if(r.key==="x"||r.key==="X"){const b=t.getSelectedIds();b.length>0&&(r.preventDefault(),t.onCut(b));return}if(r.key==="v"||r.key==="V"){if(!t.hasClipboard())return;r.preventDefault();const b=t.getSelectedIds();t.onPaste(b.length>0?b[0]:null);return}if(r.key==="z"||r.key==="Z"){r.preventDefault(),t.onUndo();return}if(r.key==="y"||r.key==="Y"){r.preventDefault(),t.onRedo();return}if(r.key==="Home"){r.preventDefault(),t.onSelectRoot();return}}if(ai(r)&&r.shiftKey&&(r.key==="Z"||r.key==="z")){r.preventDefault(),t.onRedo();return}if(r.key==="Tab")r.preventDefault(),t.onAddChild(c);else if(r.key==="Enter")if(r.preventDefault(),r.shiftKey){const b=(d=t.defaultTargetId)==null?void 0:d.call(t);s&&s!==b&&t.onAddSiblingBefore(s)}else t.onAddSibling(c);else(r.key==="Delete"||r.key==="Backspace")&&s&&s!==((g=t.defaultTargetId)==null?void 0:g.call(t))?(r.preventDefault(),t.onRemove(s)):r.key==="F2"&&s?(r.preventDefault(),t.onStartEdit(s)):r.key==="Escape"?(r.preventDefault(),t.onClearSelection()):r.key==="ArrowDown"?(r.preventDefault(),t.onNavigate(0,1)):r.key==="ArrowUp"?(r.preventDefault(),t.onNavigate(0,-1)):r.key==="ArrowRight"?(r.preventDefault(),t.onNavigate(1,0)):r.key==="ArrowLeft"&&(r.preventDefault(),t.onNavigate(-1,0))}}e.onMounted(()=>{window.addEventListener("keydown",n)}),e.onBeforeUnmount(()=>{window.removeEventListener("keydown",n)})}function Ia(t=100){const o=e.ref([]);let n=-1;function r(){return n>0}function i(){return n<o.value.length-1}function s(g){const b=JSON.stringify(g);for(n<o.value.length-1&&(o.value=o.value.slice(0,n+1)),o.value.push(b),n=o.value.length-1;o.value.length>t;)o.value.shift(),n--}function c(){return r()?(n--,JSON.parse(o.value[n])):null}function u(){return i()?(n++,JSON.parse(o.value[n])):null}function d(){o.value=[],n=-1}return{canUndo:r,canRedo:i,record:s,undo:c,redo:u,reset:d}}const Oa={1:"#ef4444",2:"#f97316",3:"#f59e0b",4:"#eab308",5:"#84cc16",6:"#22c55e",7:"#14b8a6",8:"#3b82f6",9:"#6366f1"},La={label:"优先级",markers:Array.from({length:9},(t,o)=>{const n=o+1,r=Oa[n];return{id:`priority-${n}`,label:`优先级 ${n}`,svg:`<circle cx="12" cy="12" r="10" fill="${r}"/><text x="12" y="16" text-anchor="middle" font-size="12" font-weight="700" fill="#fff" font-family="sans-serif">${n}</text>`}})};function Da(t){if(t===0)return'<circle cx="12" cy="12" r="10" fill="none" stroke="#94a3b8" stroke-width="2"/>';if(t===100)return'<circle cx="12" cy="12" r="10" fill="#22c55e"/>';const o=t/100*2*Math.PI,n=12+10*Math.sin(o),r=12-10*Math.cos(o);return`<circle cx="12" cy="12" r="10" fill="none" stroke="#e2e8f0" stroke-width="2"/><path d="M 12 12 L 12 2 A 10 10 0 ${t>50?1:0} 1 ${n.toFixed(2)} ${r.toFixed(2)} Z" fill="#3b82f6"/><circle cx="12" cy="12" r="10" fill="none" stroke="#cbd5e1" stroke-width="1"/>`}const Va={label:"进度",markers:[0,25,50,75,100].map(t=>({id:`progress-${t}`,label:`进度 ${t}%`,svg:Da(t)}))},$a={label:"旗帜",markers:[{id:"flag-red",label:"红旗",color:"#ef4444"},{id:"flag-orange",label:"橙旗",color:"#f97316"},{id:"flag-yellow",label:"黄旗",color:"#eab308"},{id:"flag-green",label:"绿旗",color:"#22c55e"},{id:"flag-blue",label:"蓝旗",color:"#3b82f6"},{id:"flag-gray",label:"灰旗",color:"#94a3b8"}].map(t=>({id:t.id,label:t.label,svg:`<path d="M6 3 V21" stroke="#475569" stroke-width="2" stroke-linecap="round"/><path d="M6 4 H18 L15 7 L18 10 H6 Z" fill="${t.color}" stroke="${t.color}" stroke-width="1" stroke-linejoin="round"/>`}))},ir=[La,Va,$a,{label:"星标",markers:[{id:"star",label:"星标",svg:'<path d="M12 2 L14.5 8.5 L21 9 L16 13.5 L17.5 20 L12 16.5 L6.5 20 L8 13.5 L3 9 L9.5 8.5 Z" fill="#f59e0b" stroke="#f59e0b" stroke-width="1" stroke-linejoin="round"/>'},{id:"star-half",label:"半星",svg:'<path d="M12 2 L14.5 8.5 L21 9 L16 13.5 L17.5 20 L12 16.5 L6.5 20 L8 13.5 L3 9 L9.5 8.5 Z" fill="#e2e8f0" stroke="#f59e0b" stroke-width="1.5" stroke-linejoin="round"/><path d="M12 2 L12 16.5 L6.5 20 L8 13.5 L3 9 L9.5 8.5 Z" fill="#f59e0b" stroke="none"/>'}]},{label:"其他",markers:[{id:"smile",label:"微笑",svg:'<circle cx="12" cy="12" r="10" fill="#fef3c7" stroke="#f59e0b" stroke-width="1.5"/><circle cx="9" cy="10" r="1.2" fill="#92400e"/><circle cx="15" cy="10" r="1.2" fill="#92400e"/><path d="M8 14 Q12 17 16 14" stroke="#92400e" stroke-width="1.5" fill="none" stroke-linecap="round"/>'},{id:"people",label:"人员",svg:'<circle cx="9" cy="8" r="2.5" fill="#3b82f6"/><circle cx="16" cy="8" r="2.5" fill="#3b82f6"/><path d="M4 19 C4 15 6 13 9 13 C12 13 14 15 14 19" fill="#3b82f6"/><path d="M14 19 C14 15.5 15.5 13.5 17.5 13.5 C19.5 13.5 21 15.5 21 19" fill="#3b82f6"/>'},{id:"arrow-up",label:"上箭头",svg:'<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M12 17 V7 M8 11 L12 7 L16 11" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>'},{id:"arrow-down",label:"下箭头",svg:'<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M12 7 V17 M8 13 L12 17 L16 13" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>'},{id:"arrow-right",label:"右箭头",svg:'<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M7 12 H17 M13 8 L17 12 L13 16" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>'},{id:"arrow-left",label:"左箭头",svg:'<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M17 12 H7 M11 8 L7 12 L11 16" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>'}]}],Bo={};for(const t of ir)for(const o of t.markers)Bo[o.id]=o;function Pa(t){return Bo[t]}function zo(t){var o;return((o=Bo[t])==null?void 0:o.svg)??""}function si(t){var o;return((o=Bo[t])==null?void 0:o.label)??t}function lr(t){let o=0;for(let r=0;r<t.length;r++)o=(o<<5)-o+t.charCodeAt(r),o|=0;const n=Math.abs(o)%360;return{background:`hsl(${n}, 85%, 92%)`,borderColor:`hsl(${n}, 60%, 70%)`,color:`hsl(${n}, 55%, 30%)`}}const Fa={key:5,class:"zm-marker-picker"},Ua={class:"zm-marker-group-label"},Ha={class:"zm-marker-grid"},Wa=["title","onClick","innerHTML"],Ga=e.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},nodeMarkers:{default:()=>[]},nodeTags:{default:()=>[]}},emits:["pickImage","setLink","removeLink","editNote","removeNote","removeImage","addCode","editCode","removeCode","addTable","editTable","removeTable","toggleMarker","clearMarkers","addTag","removeTags","close"],setup(t,{emit:o}){const n=t,r=o,i=e.computed(()=>{let E=n.x+2,k=n.y+2;if(n.container){const m=n.container.getBoundingClientRect(),v=180,j=4+(3+(n.hasImage?1:0)+(n.hasLink?1:0)+(n.hasNote?1:0)+1+(n.hasCode?1:0)+1+(n.hasTable?1:0))*28;E+v>m.right&&(E=Math.max(m.left+4,n.x-v-2)),k+j>m.bottom&&(k=Math.max(m.top+4,n.y-j-2)),E<m.left+2&&(E=m.left+2),k<m.top+2&&(k=m.top+2)}return{left:E,top:k}}),s=e.computed(()=>n.hasImage),c=e.computed(()=>n.hasLink),u=e.computed(()=>n.hasNote),d=e.computed(()=>n.nodeMarkers.length>0),g=e.computed(()=>n.nodeTags.length>0),b=e.ref(!1);function w(){b.value=!b.value}function N(E){return n.nodeMarkers.includes(E)}function V(E){r("toggleMarker",E)}function _(E){const k=E.target;k&&k.closest(".zm-node-menu")||r("close")}function $(E){E.key==="Escape"&&r("close")}function B(){r("close")}window.addEventListener("mousedown",_,!0),window.addEventListener("keydown",$,!0),window.addEventListener("wheel",B,!0),window.addEventListener("scroll",B,!0),e.onBeforeUnmount(()=>{window.removeEventListener("mousedown",_,!0),window.removeEventListener("keydown",$,!0),window.removeEventListener("wheel",B,!0),window.removeEventListener("scroll",B,!0)});function T(E){E(),r("close")}return(E,k)=>(e.openBlock(),e.createElementBlock("div",{class:"zm-node-menu",style:e.normalizeStyle({left:i.value.left+"px",top:i.value.top+"px"}),onContextmenu:k[13]||(k[13]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[0]||(k[0]=e.withModifiers(m=>T(()=>r("pickImage")),["stop"]))},[e.createVNode(ke,{name:"image",size:13}),e.createElementVNode("span",null,e.toDisplayString(s.value?"替换图片":"添加图片"),1)]),s.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-node-menu-item",onClick:k[1]||(k[1]=e.withModifiers(m=>T(()=>r("removeImage")),["stop"]))},[e.createVNode(ke,{name:"x",size:13}),k[14]||(k[14]=e.createElementVNode("span",null,"移除图片",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[2]||(k[2]=e.withModifiers(m=>T(()=>r("setLink")),["stop"]))},[e.createVNode(ke,{name:"link",size:13}),e.createElementVNode("span",null,e.toDisplayString(c.value?"编辑链接":"添加链接"),1)]),c.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-node-menu-item",onClick:k[3]||(k[3]=e.withModifiers(m=>T(()=>r("removeLink")),["stop"]))},[e.createVNode(ke,{name:"x",size:13}),k[15]||(k[15]=e.createElementVNode("span",null,"移除链接",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[4]||(k[4]=e.withModifiers(m=>T(()=>r("addCode")),["stop"]))},[k[16]||(k[16]=e.createElementVNode("span",{class:"zm-node-menu-icon zm-node-menu-icon-code","aria-hidden":"true"},"{ }",-1)),e.createElementVNode("span",null,e.toDisplayString(t.hasCode?"编辑代码块":"添加代码块"),1)]),t.hasCode?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-node-menu-item",onClick:k[5]||(k[5]=e.withModifiers(m=>T(()=>r("removeCode")),["stop"]))},[e.createVNode(ke,{name:"x",size:13}),k[17]||(k[17]=e.createElementVNode("span",null,"移除代码块",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[6]||(k[6]=e.withModifiers(m=>T(()=>r("addTable")),["stop"]))},[k[18]||(k[18]=e.createElementVNode("span",{class:"zm-node-menu-icon zm-node-menu-icon-table","aria-hidden":"true"},"▦",-1)),e.createElementVNode("span",null,e.toDisplayString(t.hasTable?"编辑表格":"添加表格"),1)]),t.hasTable?(e.openBlock(),e.createElementBlock("button",{key:3,class:"zm-node-menu-item",onClick:k[7]||(k[7]=e.withModifiers(m=>T(()=>r("removeTable")),["stop"]))},[e.createVNode(ke,{name:"x",size:13}),k[19]||(k[19]=e.createElementVNode("span",null,"移除表格",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[8]||(k[8]=e.withModifiers(m=>T(()=>r("editNote")),["stop"]))},[e.createVNode(ke,{name:"note",size:13}),e.createElementVNode("span",null,e.toDisplayString(u.value?"编辑笔记":"添加笔记"),1)]),u.value?(e.openBlock(),e.createElementBlock("button",{key:4,class:"zm-node-menu-item",onClick:k[9]||(k[9]=e.withModifiers(m=>T(()=>r("removeNote")),["stop"]))},[e.createVNode(ke,{name:"x",size:13}),k[20]||(k[20]=e.createElementVNode("span",null,"移除笔记",-1))])):e.createCommentVNode("",!0),k[25]||(k[25]=e.createElementVNode("div",{class:"zm-node-menu-divider"},null,-1)),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:e.withModifiers(w,["stop"])},[k[21]||(k[21]=e.createElementVNode("span",{class:"zm-node-menu-icon","aria-hidden":"true"},"⚑",-1)),k[22]||(k[22]=e.createElementVNode("span",null,"标记图标",-1)),e.createElementVNode("span",{class:e.normalizeClass(["zm-node-menu-arrow",{"is-open":b.value}])},"›",2)]),b.value?(e.openBlock(),e.createElementBlock("div",Fa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(ir),m=>(e.openBlock(),e.createElementBlock("div",{key:m.label,class:"zm-marker-group"},[e.createElementVNode("div",Ua,e.toDisplayString(m.label),1),e.createElementVNode("div",Ha,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.markers,v=>(e.openBlock(),e.createElementBlock("button",{key:v.id,class:e.normalizeClass(["zm-marker-cell",{"is-active":N(v.id)}]),title:v.label,onClick:e.withModifiers(x=>V(v.id),["stop"]),innerHTML:'<svg viewBox="0 0 24 24" width="20" height="20">'+e.unref(zo)(v.id)+"</svg>"},null,10,Wa))),128))])]))),128)),d.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-marker-clear",onClick:k[10]||(k[10]=e.withModifiers(m=>r("clearMarkers"),["stop"]))}," 清除所有标记 ")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[11]||(k[11]=e.withModifiers(m=>T(()=>r("addTag")),["stop"]))},[k[23]||(k[23]=e.createElementVNode("span",{class:"zm-node-menu-icon","aria-hidden":"true"},"#",-1)),e.createElementVNode("span",null,e.toDisplayString(g.value?"编辑标签":"添加标签"),1)]),g.value?(e.openBlock(),e.createElementBlock("button",{key:6,class:"zm-node-menu-item",onClick:k[12]||(k[12]=e.withModifiers(m=>T(()=>r("removeTags")),["stop"]))},[e.createVNode(ke,{name:"x",size:13}),k[24]||(k[24]=e.createElementVNode("span",null,"移除标签",-1))])):e.createCommentVNode("",!0)],36))}}),ja=e.defineComponent({__name:"CanvasContextMenu",props:{x:{},y:{},container:{}},emits:["openSettings","openData","openImport","exportPng","exportSvg","close"],setup(t,{emit:o}){const n=t,r=o,i=e.computed(()=>{let T=n.x+2,E=n.y+2;if(n.container){const k=n.container.getBoundingClientRect(),m=160,v=4+4*28+5;T+m>k.right&&(T=Math.max(k.left+4,n.x-m-2)),E+v>k.bottom&&(E=Math.max(k.top+4,n.y-v-2)),T<k.left+2&&(T=k.left+2),E<k.top+2&&(E=k.top+2)}return{left:T,top:E}}),s=e.ref(null),c=e.ref(null),u=e.ref(null),d=e.computed(()=>{const T=s.value==="import"?c.value:s.value==="export"?u.value:null;if(!T)return{left:"-9999px",top:"-9999px",display:"none"};const E=T.getBoundingClientRect(),k=window.innerWidth,m=window.innerHeight,v=176,x=4+3*28;let j=E.right;j+v>k-4&&(j=Math.max(4,E.left-v));let K=E.top-4;return K+x>m-4&&(K=Math.max(4,m-x-4)),{left:j+"px",top:K+"px",display:"block"}});let g=null,b=null;function w(T){b&&(clearTimeout(b),b=null),g=setTimeout(()=>{s.value=T},60)}function N(){g&&(clearTimeout(g),g=null),b=setTimeout(()=>{s.value=null},120)}e.onBeforeUnmount(()=>{g&&clearTimeout(g),b&&clearTimeout(b)});function V(T){const E=T.target;E&&E.closest(".zm-canvas-menu")||r("close")}function _(T){T.key==="Escape"&&r("close")}function $(){r("close")}window.addEventListener("mousedown",V,!0),window.addEventListener("keydown",_,!0),window.addEventListener("wheel",$,!0),window.addEventListener("scroll",$,!0),e.onBeforeUnmount(()=>{window.removeEventListener("mousedown",V,!0),window.removeEventListener("keydown",_,!0),window.removeEventListener("wheel",$,!0),window.removeEventListener("scroll",$,!0)});function B(T){T(),r("close")}return(T,E)=>(e.openBlock(),e.createElementBlock("div",{class:"zm-canvas-menu",style:e.normalizeStyle({left:i.value.left+"px",top:i.value.top+"px"}),onContextmenu:E[11]||(E[11]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:E[0]||(E[0]=e.withModifiers(k=>B(()=>r("openData")),["stop"]))},[e.createVNode(ke,{name:"database",size:13,stroke:1.6}),E[12]||(E[12]=e.createElementVNode("span",null,"查看数据",-1))]),e.createElementVNode("div",{ref_key:"importItemRef",ref:c,class:e.normalizeClass(["zm-canvas-menu-item zm-canvas-menu-item-has-submenu",{"is-open":s.value==="import"}]),onMouseenter:E[5]||(E[5]=k=>w("import")),onMouseleave:N},[e.createVNode(ke,{name:"import",size:13,stroke:1.6}),E[16]||(E[16]=e.createElementVNode("span",null,"导入",-1)),E[17]||(E[17]=e.createElementVNode("svg",{class:"zm-canvas-menu-caret",width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[e.createElementVNode("polyline",{points:"2.5 1.8 5.2 4 2.5 6.2"})],-1)),s.value==="import"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-canvas-submenu",style:e.normalizeStyle(d.value),onMouseenter:E[4]||(E[4]=k=>w("import")),onMouseleave:N},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:E[1]||(E[1]=e.withModifiers(k=>B(()=>r("openImport","markdown")),["stop"]))},[e.createVNode(ke,{name:"markdown",size:13,stroke:1.6}),E[13]||(E[13]=e.createElementVNode("span",null,"Markdown 导入",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:E[2]||(E[2]=e.withModifiers(k=>B(()=>r("openImport","json")),["stop"]))},[e.createVNode(ke,{name:"json",size:13,stroke:1.6}),E[14]||(E[14]=e.createElementVNode("span",null,"JSON 文件导入",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:E[3]||(E[3]=e.withModifiers(k=>B(()=>r("openImport","txt")),["stop"]))},[e.createVNode(ke,{name:"txt",size:13,stroke:1.6}),E[15]||(E[15]=e.createElementVNode("span",null,"TXT 文件导入",-1))])],36)):e.createCommentVNode("",!0)],34),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:E[6]||(E[6]=e.withModifiers(k=>B(()=>r("openSettings")),["stop"]))},[e.createVNode(ke,{name:"settings",size:13,stroke:1.6}),E[18]||(E[18]=e.createElementVNode("span",null,"设置",-1))]),E[23]||(E[23]=e.createElementVNode("div",{class:"zm-canvas-menu-divider"},null,-1)),e.createElementVNode("div",{ref_key:"exportItemRef",ref:u,class:e.normalizeClass(["zm-canvas-menu-item zm-canvas-menu-item-has-submenu",{"is-open":s.value==="export"}]),onMouseenter:E[10]||(E[10]=k=>w("export")),onMouseleave:N},[e.createVNode(ke,{name:"export",size:13,stroke:1.6}),E[21]||(E[21]=e.createElementVNode("span",null,"导出",-1)),E[22]||(E[22]=e.createElementVNode("svg",{class:"zm-canvas-menu-caret",width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[e.createElementVNode("polyline",{points:"2.5 1.8 5.2 4 2.5 6.2"})],-1)),s.value==="export"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-canvas-submenu",style:e.normalizeStyle(d.value),onMouseenter:E[9]||(E[9]=k=>w("export")),onMouseleave:N},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:E[7]||(E[7]=e.withModifiers(k=>B(()=>r("exportPng")),["stop"]))},[e.createVNode(ke,{name:"image",size:13,stroke:1.6}),E[19]||(E[19]=e.createElementVNode("span",null,"导出 PNG",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:E[8]||(E[8]=e.withModifiers(k=>B(()=>r("exportSvg")),["stop"]))},[e.createVNode(ke,{name:"svg-export",size:13,stroke:1.6}),E[20]||(E[20]=e.createElementVNode("span",null,"导出 SVG",-1))])],36)):e.createCommentVNode("",!0)],34)],36))}});function Ka(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function ci(t){return t instanceof Map?t.clear=t.delete=t.set=function(){throw new Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=function(){throw new Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach(o=>{const n=t[o],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&ci(n)}),t}class di{constructor(o){o.data===void 0&&(o.data={}),this.data=o.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function ui(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function un(t,...o){const n=Object.create(null);for(const r in t)n[r]=t[r];return o.forEach(function(r){for(const i in r)n[i]=r[i]}),n}const Ya="</span>",fi=t=>!!t.scope,qa=(t,{prefix:o})=>{if(t.startsWith("language:"))return t.replace("language:","language-");if(t.includes(".")){const n=t.split(".");return[`${o}${n.shift()}`,...n.map((r,i)=>`${r}${"_".repeat(i+1)}`)].join(" ")}return`${o}${t}`};class Xa{constructor(o,n){this.buffer="",this.classPrefix=n.classPrefix,o.walk(this)}addText(o){this.buffer+=ui(o)}openNode(o){if(!fi(o))return;const n=qa(o.scope,{prefix:this.classPrefix});this.span(n)}closeNode(o){fi(o)&&(this.buffer+=Ya)}value(){return this.buffer}span(o){this.buffer+=`<span class="${o}">`}}const mi=(t={})=>{const o={children:[]};return Object.assign(o,t),o};class ar{constructor(){this.rootNode=mi(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(o){this.top.children.push(o)}openNode(o){const n=mi({scope:o});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(o){return this.constructor._walk(o,this.rootNode)}static _walk(o,n){return typeof n=="string"?o.addText(n):n.children&&(o.openNode(n),n.children.forEach(r=>this._walk(o,r)),o.closeNode(n)),o}static _collapse(o){typeof o!="string"&&o.children&&(o.children.every(n=>typeof n=="string")?o.children=[o.children.join("")]:o.children.forEach(n=>{ar._collapse(n)}))}}class Za extends ar{constructor(o){super(),this.options=o}addText(o){o!==""&&this.add(o)}startScope(o){this.openNode(o)}endScope(){this.closeNode()}__addSublanguage(o,n){const r=o.root;n&&(r.scope=`language:${n}`),this.add(r)}toHTML(){return new Xa(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function oo(t){return t?typeof t=="string"?t:t.source:null}function pi(t){return Nn("(?=",t,")")}function Ja(t){return Nn("(?:",t,")*")}function Qa(t){return Nn("(?:",t,")?")}function Nn(...t){return t.map(n=>oo(n)).join("")}function es(t){const o=t[t.length-1];return typeof o=="object"&&o.constructor===Object?(t.splice(t.length-1,1),o):{}}function sr(...t){return"("+(es(t).capture?"":"?:")+t.map(r=>oo(r)).join("|")+")"}function gi(t){return new RegExp(t.toString()+"|").exec("").length-1}function ts(t,o){const n=t&&t.exec(o);return n&&n.index===0}const ns=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function cr(t,{joinWith:o}){let n=0;return t.map(r=>{n+=1;const i=n;let s=oo(r),c="";for(;s.length>0;){const u=ns.exec(s);if(!u){c+=s;break}c+=s.substring(0,u.index),s=s.substring(u.index+u[0].length),u[0][0]==="\\"&&u[1]?c+="\\"+String(Number(u[1])+i):(c+=u[0],u[0]==="("&&n++)}return c}).map(r=>`(${r})`).join(o)}const os=/\b\B/,hi="[a-zA-Z]\\w*",dr="[a-zA-Z_]\\w*",bi="\\b\\d+(\\.\\d+)?",ki="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",yi="\\b(0b[01]+)",rs="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",is=(t={})=>{const o=/^#![ ]*\//;return t.binary&&(t.begin=Nn(o,/.*\b/,t.binary,/\b.*/)),un({scope:"meta",begin:o,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},t)},ro={begin:"\\\\[\\s\\S]",relevance:0},ls={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[ro]},as={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[ro]},ss={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/},Io=function(t,o,n={}){const r=un({scope:"comment",begin:t,end:o,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const i=sr("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:Nn(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},cs=Io("//","$"),ds=Io("/\\*","\\*/"),us=Io("#","$"),fs={scope:"number",begin:bi,relevance:0},ms={scope:"number",begin:ki,relevance:0},ps={scope:"number",begin:yi,relevance:0},gs={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[ro,{begin:/\[/,end:/\]/,relevance:0,contains:[ro]}]},hs={scope:"title",begin:hi,relevance:0},bs={scope:"title",begin:dr,relevance:0},ks={begin:"\\.\\s*"+dr,relevance:0};var Oo=Object.freeze({__proto__:null,APOS_STRING_MODE:ls,BACKSLASH_ESCAPE:ro,BINARY_NUMBER_MODE:ps,BINARY_NUMBER_RE:yi,COMMENT:Io,C_BLOCK_COMMENT_MODE:ds,C_LINE_COMMENT_MODE:cs,C_NUMBER_MODE:ms,C_NUMBER_RE:ki,END_SAME_AS_BEGIN:function(t){return Object.assign(t,{"on:begin":(o,n)=>{n.data._beginMatch=o[1]},"on:end":(o,n)=>{n.data._beginMatch!==o[1]&&n.ignoreMatch()}})},HASH_COMMENT_MODE:us,IDENT_RE:hi,MATCH_NOTHING_RE:os,METHOD_GUARD:ks,NUMBER_MODE:fs,NUMBER_RE:bi,PHRASAL_WORDS_MODE:ss,QUOTE_STRING_MODE:as,REGEXP_MODE:gs,RE_STARTERS_RE:rs,SHEBANG:is,TITLE_MODE:hs,UNDERSCORE_IDENT_RE:dr,UNDERSCORE_TITLE_MODE:bs});function ys(t,o){t.input[t.index-1]==="."&&o.ignoreMatch()}function Es(t,o){t.className!==void 0&&(t.scope=t.className,delete t.className)}function xs(t,o){o&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=ys,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function ws(t,o){Array.isArray(t.illegal)&&(t.illegal=sr(...t.illegal))}function Ns(t,o){if(t.match){if(t.begin||t.end)throw new Error("begin & end are not supported with match");t.begin=t.match,delete t.match}}function Ss(t,o){t.relevance===void 0&&(t.relevance=1)}const Ts=(t,o)=>{if(!t.beforeMatch)return;if(t.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},t);Object.keys(t).forEach(r=>{delete t[r]}),t.keywords=n.keywords,t.begin=Nn(n.beforeMatch,pi(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},Cs=["of","and","for","in","not","or","if","then","parent","list","value"],As="keyword";function Ei(t,o,n=As){const r=Object.create(null);return typeof t=="string"?i(n,t.split(" ")):Array.isArray(t)?i(n,t):Object.keys(t).forEach(function(s){Object.assign(r,Ei(t[s],o,s))}),r;function i(s,c){o&&(c=c.map(u=>u.toLowerCase())),c.forEach(function(u){const d=u.split("|");r[d[0]]=[s,_s(d[0],d[1])]})}}function _s(t,o){return o?Number(o):Ms(t)?0:1}function Ms(t){return Cs.includes(t.toLowerCase())}const xi={},Sn=t=>{console.error(t)},wi=(t,...o)=>{console.log(`WARN: ${t}`,...o)},Pn=(t,o)=>{xi[`${t}/${o}`]||(console.log(`Deprecated as of ${t}. ${o}`),xi[`${t}/${o}`]=!0)},Lo=new Error;function Ni(t,o,{key:n}){let r=0;const i=t[n],s={},c={};for(let u=1;u<=o.length;u++)c[u+r]=i[u],s[u+r]=!0,r+=gi(o[u-1]);t[n]=c,t[n]._emit=s,t[n]._multi=!0}function Rs(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw Sn("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Lo;if(typeof t.beginScope!="object"||t.beginScope===null)throw Sn("beginScope must be object"),Lo;Ni(t,t.begin,{key:"beginScope"}),t.begin=cr(t.begin,{joinWith:""})}}function vs(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw Sn("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Lo;if(typeof t.endScope!="object"||t.endScope===null)throw Sn("endScope must be object"),Lo;Ni(t,t.end,{key:"endScope"}),t.end=cr(t.end,{joinWith:""})}}function Bs(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function zs(t){Bs(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),Rs(t),vs(t)}function Is(t){function o(c,u){return new RegExp(oo(c),"m"+(t.case_insensitive?"i":"")+(t.unicodeRegex?"u":"")+(u?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(u,d){d.position=this.position++,this.matchIndexes[this.matchAt]=d,this.regexes.push([d,u]),this.matchAt+=gi(u)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const u=this.regexes.map(d=>d[1]);this.matcherRe=o(cr(u,{joinWith:"|"}),!0),this.lastIndex=0}exec(u){this.matcherRe.lastIndex=this.lastIndex;const d=this.matcherRe.exec(u);if(!d)return null;const g=d.findIndex((w,N)=>N>0&&w!==void 0),b=this.matchIndexes[g];return d.splice(0,g),Object.assign(d,b)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(u){if(this.multiRegexes[u])return this.multiRegexes[u];const d=new n;return this.rules.slice(u).forEach(([g,b])=>d.addRule(g,b)),d.compile(),this.multiRegexes[u]=d,d}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(u,d){this.rules.push([u,d]),d.type==="begin"&&this.count++}exec(u){const d=this.getMatcher(this.regexIndex);d.lastIndex=this.lastIndex;let g=d.exec(u);if(this.resumingScanAtSamePosition()&&!(g&&g.index===this.lastIndex)){const b=this.getMatcher(0);b.lastIndex=this.lastIndex+1,g=b.exec(u)}return g&&(this.regexIndex+=g.position+1,this.regexIndex===this.count&&this.considerAll()),g}}function i(c){const u=new r;return c.contains.forEach(d=>u.addRule(d.begin,{rule:d,type:"begin"})),c.terminatorEnd&&u.addRule(c.terminatorEnd,{type:"end"}),c.illegal&&u.addRule(c.illegal,{type:"illegal"}),u}function s(c,u){const d=c;if(c.isCompiled)return d;[Es,Ns,zs,Ts].forEach(b=>b(c,u)),t.compilerExtensions.forEach(b=>b(c,u)),c.__beforeBegin=null,[xs,ws,Ss].forEach(b=>b(c,u)),c.isCompiled=!0;let g=null;return typeof c.keywords=="object"&&c.keywords.$pattern&&(c.keywords=Object.assign({},c.keywords),g=c.keywords.$pattern,delete c.keywords.$pattern),g=g||/\w+/,c.keywords&&(c.keywords=Ei(c.keywords,t.case_insensitive)),d.keywordPatternRe=o(g,!0),u&&(c.begin||(c.begin=/\B|\b/),d.beginRe=o(d.begin),!c.end&&!c.endsWithParent&&(c.end=/\B|\b/),c.end&&(d.endRe=o(d.end)),d.terminatorEnd=oo(d.end)||"",c.endsWithParent&&u.terminatorEnd&&(d.terminatorEnd+=(c.end?"|":"")+u.terminatorEnd)),c.illegal&&(d.illegalRe=o(c.illegal)),c.contains||(c.contains=[]),c.contains=[].concat(...c.contains.map(function(b){return Os(b==="self"?c:b)})),c.contains.forEach(function(b){s(b,d)}),c.starts&&s(c.starts,u),d.matcher=i(d),d}if(t.compilerExtensions||(t.compilerExtensions=[]),t.contains&&t.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return t.classNameAliases=un(t.classNameAliases||{}),s(t)}function Si(t){return t?t.endsWithParent||Si(t.starts):!1}function Os(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(o){return un(t,{variants:null},o)})),t.cachedVariants?t.cachedVariants:Si(t)?un(t,{starts:t.starts?un(t.starts):null}):Object.isFrozen(t)?un(t):t}var Ls="11.11.1";class Ds extends Error{constructor(o,n){super(o),this.name="HTMLInjectionError",this.html=n}}const ur=ui,Ti=un,Ci=Symbol("nomatch"),Vs=7,Ai=function(t){const o=Object.create(null),n=Object.create(null),r=[];let i=!0;const s="Could not find the language '{}', did you forget to load/include a language module?",c={disableAutodetect:!0,name:"Plain text",contains:[]};let u={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:Za};function d(C){return u.noHighlightRe.test(C)}function g(C){let F=C.className+" ";F+=C.parentNode?C.parentNode.className:"";const P=u.languageDetectRe.exec(F);if(P){const W=K(P[1]);return W||(wi(s.replace("{}",P[1])),wi("Falling back to no-highlight mode for this block.",C)),W?P[1]:"no-highlight"}return F.split(/\s+/).find(W=>d(W)||K(W))}function b(C,F,P){let W="",ae="";typeof F=="object"?(W=C,P=F.ignoreIllegals,ae=F.language):(Pn("10.7.0","highlight(lang, code, ...args) has been deprecated."),Pn("10.7.0",`Please use highlight(code, options) instead.
14
- https://github.com/highlightjs/highlight.js/issues/2277`),ae=C,W=F),P===void 0&&(P=!0);const we={code:W,language:ae};ie("before:highlight",we);const ve=we.result?we.result:w(we.language,we.code,P);return ve.code=we.code,ie("after:highlight",ve),ve}function w(C,F,P,W){const ae=Object.create(null);function we(U,Z){return U.keywords[Z]}function ve(){if(!te.keywords){Be.addText(Te);return}let U=0;te.keywordPatternRe.lastIndex=0;let Z=te.keywordPatternRe.exec(Te),se="";for(;Z;){se+=Te.substring(U,Z.index);const ye=Ke.case_insensitive?Z[0].toLowerCase():Z[0],Me=we(te,ye);if(Me){const[Qe,pt]=Me;if(Be.addText(se),se="",ae[ye]=(ae[ye]||0)+1,ae[ye]<=Vs&&(Ot+=pt),Qe.startsWith("_"))se+=Z[0];else{const gn=Ke.classNameAliases[Qe]||Qe;y(Z[0],gn)}}else se+=Z[0];U=te.keywordPatternRe.lastIndex,Z=te.keywordPatternRe.exec(Te)}se+=Te.substring(U),Be.addText(se)}function ze(){if(Te==="")return;let U=null;if(typeof te.subLanguage=="string"){if(!o[te.subLanguage]){Be.addText(Te);return}U=w(te.subLanguage,Te,!0,Gt[te.subLanguage]),Gt[te.subLanguage]=U._top}else U=V(Te,te.subLanguage.length?te.subLanguage:null);te.relevance>0&&(Ot+=U.relevance),Be.__addSublanguage(U._emitter,U.language)}function Ne(){te.subLanguage!=null?ze():ve(),Te=""}function y(U,Z){U!==""&&(Be.startScope(Z),Be.addText(U),Be.endScope())}function p(U,Z){let se=1;const ye=Z.length-1;for(;se<=ye;){if(!U._emit[se]){se++;continue}const Me=Ke.classNameAliases[U[se]]||U[se],Qe=Z[se];Me?y(Qe,Me):(Te=Qe,ve(),Te=""),se++}}function O(U,Z){return U.scope&&typeof U.scope=="string"&&Be.openNode(Ke.classNameAliases[U.scope]||U.scope),U.beginScope&&(U.beginScope._wrap?(y(Te,Ke.classNameAliases[U.beginScope._wrap]||U.beginScope._wrap),Te=""):U.beginScope._multi&&(p(U.beginScope,Z),Te="")),te=Object.create(U,{parent:{value:te}}),te}function D(U,Z,se){let ye=ts(U.endRe,se);if(ye){if(U["on:end"]){const Me=new di(U);U["on:end"](Z,Me),Me.isMatchIgnored&&(ye=!1)}if(ye){for(;U.endsParent&&U.parent;)U=U.parent;return U}}if(U.endsWithParent)return D(U.parent,Z,se)}function q(U){return te.matcher.regexIndex===0?(Te+=U[0],1):(jt=!0,0)}function de(U){const Z=U[0],se=U.rule,ye=new di(se),Me=[se.__beforeBegin,se["on:begin"]];for(const Qe of Me)if(Qe&&(Qe(U,ye),ye.isMatchIgnored))return q(Z);return se.skip?Te+=Z:(se.excludeBegin&&(Te+=Z),Ne(),!se.returnBegin&&!se.excludeBegin&&(Te=Z)),O(se,U),se.returnBegin?0:Z.length}function ge(U){const Z=U[0],se=F.substring(U.index),ye=D(te,U,se);if(!ye)return Ci;const Me=te;te.endScope&&te.endScope._wrap?(Ne(),y(Z,te.endScope._wrap)):te.endScope&&te.endScope._multi?(Ne(),p(te.endScope,U)):Me.skip?Te+=Z:(Me.returnEnd||Me.excludeEnd||(Te+=Z),Ne(),Me.excludeEnd&&(Te=Z));do te.scope&&Be.closeNode(),!te.skip&&!te.subLanguage&&(Ot+=te.relevance),te=te.parent;while(te!==ye.parent);return ye.starts&&O(ye.starts,U),Me.returnEnd?0:Z.length}function je(){const U=[];for(let Z=te;Z!==Ke;Z=Z.parent)Z.scope&&U.unshift(Z.scope);U.forEach(Z=>Be.openNode(Z))}let Pe={};function Je(U,Z){const se=Z&&Z[0];if(Te+=U,se==null)return Ne(),0;if(Pe.type==="begin"&&Z.type==="end"&&Pe.index===Z.index&&se===""){if(Te+=F.slice(Z.index,Z.index+1),!i){const ye=new Error(`0 width match regex (${C})`);throw ye.languageName=C,ye.badRule=Pe.rule,ye}return 1}if(Pe=Z,Z.type==="begin")return de(Z);if(Z.type==="illegal"&&!P){const ye=new Error('Illegal lexeme "'+se+'" for mode "'+(te.scope||"<unnamed>")+'"');throw ye.mode=te,ye}else if(Z.type==="end"){const ye=ge(Z);if(ye!==Ci)return ye}if(Z.type==="illegal"&&se==="")return Te+=`
15
- `,1;if(Lt>1e5&&Lt>Z.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Te+=se,se.length}const Ke=K(C);if(!Ke)throw Sn(s.replace("{}",C)),new Error('Unknown language: "'+C+'"');const Xn=Is(Ke);let pn="",te=W||Xn;const Gt={},Be=new u.__emitter(u);je();let Te="",Ot=0,it=0,Lt=0,jt=!1;try{if(Ke.__emitTokens)Ke.__emitTokens(F,Be);else{for(te.matcher.considerAll();;){Lt++,jt?jt=!1:te.matcher.considerAll(),te.matcher.lastIndex=it;const U=te.matcher.exec(F);if(!U)break;const Z=F.substring(it,U.index),se=Je(Z,U);it=U.index+se}Je(F.substring(it))}return Be.finalize(),pn=Be.toHTML(),{language:C,value:pn,relevance:Ot,illegal:!1,_emitter:Be,_top:te}}catch(U){if(U.message&&U.message.includes("Illegal"))return{language:C,value:ur(F),illegal:!0,relevance:0,_illegalBy:{message:U.message,index:it,context:F.slice(it-100,it+100),mode:U.mode,resultSoFar:pn},_emitter:Be};if(i)return{language:C,value:ur(F),illegal:!1,relevance:0,errorRaised:U,_emitter:Be,_top:te};throw U}}function N(C){const F={value:ur(C),illegal:!1,relevance:0,_top:c,_emitter:new u.__emitter(u)};return F._emitter.addText(C),F}function V(C,F){F=F||u.languages||Object.keys(o);const P=N(C),W=F.filter(K).filter(ce).map(Ne=>w(Ne,C,!1));W.unshift(P);const ae=W.sort((Ne,y)=>{if(Ne.relevance!==y.relevance)return y.relevance-Ne.relevance;if(Ne.language&&y.language){if(K(Ne.language).supersetOf===y.language)return 1;if(K(y.language).supersetOf===Ne.language)return-1}return 0}),[we,ve]=ae,ze=we;return ze.secondBest=ve,ze}function _(C,F,P){const W=F&&n[F]||P;C.classList.add("hljs"),C.classList.add(`language-${W}`)}function $(C){let F=null;const P=g(C);if(d(P))return;if(ie("before:highlightElement",{el:C,language:P}),C.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",C);return}if(C.children.length>0&&(u.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(C)),u.throwUnescapedHTML))throw new Ds("One of your code blocks includes unescaped HTML.",C.innerHTML);F=C;const W=F.textContent,ae=P?b(W,{language:P,ignoreIllegals:!0}):V(W);C.innerHTML=ae.value,C.dataset.highlighted="yes",_(C,P,ae.language),C.result={language:ae.language,re:ae.relevance,relevance:ae.relevance},ae.secondBest&&(C.secondBest={language:ae.secondBest.language,relevance:ae.secondBest.relevance}),ie("after:highlightElement",{el:C,result:ae,text:W})}function B(C){u=Ti(u,C)}const T=()=>{m(),Pn("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function E(){m(),Pn("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let k=!1;function m(){function C(){m()}if(document.readyState==="loading"){k||window.addEventListener("DOMContentLoaded",C,!1),k=!0;return}document.querySelectorAll(u.cssSelector).forEach($)}function v(C,F){let P=null;try{P=F(t)}catch(W){if(Sn("Language definition for '{}' could not be registered.".replace("{}",C)),i)Sn(W);else throw W;P=c}P.name||(P.name=C),o[C]=P,P.rawDefinition=F.bind(null,t),P.aliases&&ne(P.aliases,{languageName:C})}function x(C){delete o[C];for(const F of Object.keys(n))n[F]===C&&delete n[F]}function j(){return Object.keys(o)}function K(C){return C=(C||"").toLowerCase(),o[C]||o[n[C]]}function ne(C,{languageName:F}){typeof C=="string"&&(C=[C]),C.forEach(P=>{n[P.toLowerCase()]=F})}function ce(C){const F=K(C);return F&&!F.disableAutodetect}function re(C){C["before:highlightBlock"]&&!C["before:highlightElement"]&&(C["before:highlightElement"]=F=>{C["before:highlightBlock"](Object.assign({block:F.el},F))}),C["after:highlightBlock"]&&!C["after:highlightElement"]&&(C["after:highlightElement"]=F=>{C["after:highlightBlock"](Object.assign({block:F.el},F))})}function Y(C){re(C),r.push(C)}function ee(C){const F=r.indexOf(C);F!==-1&&r.splice(F,1)}function ie(C,F){const P=C;r.forEach(function(W){W[P]&&W[P](F)})}function z(C){return Pn("10.7.0","highlightBlock will be removed entirely in v12.0"),Pn("10.7.0","Please use highlightElement now."),$(C)}Object.assign(t,{highlight:b,highlightAuto:V,highlightAll:m,highlightElement:$,highlightBlock:z,configure:B,initHighlighting:T,initHighlightingOnLoad:E,registerLanguage:v,unregisterLanguage:x,listLanguages:j,getLanguage:K,registerAliases:ne,autoDetection:ce,inherit:Ti,addPlugin:Y,removePlugin:ee}),t.debugMode=function(){i=!1},t.safeMode=function(){i=!0},t.versionString=Ls,t.regex={concat:Nn,lookahead:pi,either:sr,optional:Qa,anyNumberOfTimes:Ja};for(const C in Oo)typeof Oo[C]=="object"&&ci(Oo[C]);return Object.assign(t,Oo),t},Fn=Ai({});Fn.newInstance=()=>Ai({});var $s=Fn;Fn.HighlightJS=Fn,Fn.default=Fn;const fr=Ka($s);function mr(t){const o=t.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:o.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const i={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},s=t.inherit(t.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),c={begin:/<<-?\s*(?=\w+)/,starts:{contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},u={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,n,i]};i.contains.push(u);const d={match:/\\"/},g={className:"string",begin:/'/,end:/'/},b={match:/\\'/},w={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,n]},N=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],V=t.SHEBANG({binary:`(${N.join("|")})`,relevance:10}),_={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},$=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],B=["true","false"],T={match:/(\/[a-z._-]+)+/},E=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],k=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],m=["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"],v=["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:$,literal:B,built_in:[...E,...k,"set","shopt",...m,...v]},contains:[V,t.SHEBANG(),_,w,s,c,T,u,d,g,b,n]}}const Ps=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.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:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.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_-]*/}}),Fs=["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"],Us=["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"],Hs=[...Fs,...Us],Ws=["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(),Gs=["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(),js=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Ks=["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 Ys(t){const o=t.regex,n=Ps(t),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i="and or not only",s=/@-?\w[\w]*(-\w+)*/,c="[a-zA-Z-][a-zA-Z0-9_-]*",u=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+c,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+Gs.join("|")+")"},{begin:":(:)?("+js.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Ks.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...u,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...u,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:o.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:s},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:Ws.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...u,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Hs.join("|")+")\\b"}]}}function _i(t){const s={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:s,illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"string",variants:[t.QUOTE_STRING_MODE,t.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:[t.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:s,illegal:/["']/}]}]}}var Un="[0-9](_*[0-9])*",Do=`\\.(${Un})`,Vo="[0-9a-fA-F](_*[0-9a-fA-F])*",Mi={className:"number",variants:[{begin:`(\\b(${Un})((${Do})|\\.)?|(${Do}))[eE][+-]?(${Un})[fFdD]?\\b`},{begin:`\\b(${Un})((${Do})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Do})[fFdD]?\\b`},{begin:`\\b(${Un})[fFdD]\\b`},{begin:`\\b0[xX]((${Vo})\\.?|(${Vo})?\\.(${Vo}))[pP][+-]?(${Un})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Vo})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Ri(t,o,n){return n===-1?"":t.replace(o,r=>Ri(t,o,n-1))}function qs(t){const o=t.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=n+Ri("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),d={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},g={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},b={className:"params",begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[t.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:d,illegal:/<\/|#/,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[t.BACKSLASH_ESCAPE]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[o.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[b,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",t.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:d,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[g,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,Mi,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},Mi,g]}}const vi="[A-Za-z$_][0-9A-Za-z$_]*",Xs=["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"],Zs=["true","false","null","undefined","NaN","Infinity"],Bi=["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"],zi=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Ii=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Js=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Qs=[].concat(Ii,Bi,zi);function Oi(t){const o=t.regex,n=(P,{after:W})=>{const ae="</"+P[0].slice(1);return P.input.indexOf(ae,W)!==-1},r=vi,i={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,c={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(P,W)=>{const ae=P[0].length+P.index,we=P.input[ae];if(we==="<"||we===","){W.ignoreMatch();return}we===">"&&(n(P,{after:ae})||W.ignoreMatch());let ve;const ze=P.input.substring(ae);if(ve=ze.match(/^\s*=/)){W.ignoreMatch();return}if((ve=ze.match(/^\s+extends\s+/))&&ve.index===0){W.ignoreMatch();return}}},u={$pattern:vi,keyword:Xs,literal:Zs,built_in:Qs,"variable.language":Js},d="[0-9](_?[0-9])*",g=`\\.(${d})`,b="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",w={className:"number",variants:[{begin:`(\\b(${b})((${g})|\\.)?|(${g}))[eE][+-]?(${d})\\b`},{begin:`\\b(${b})\\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},N={className:"subst",begin:"\\$\\{",end:"\\}",keywords:u,contains:[]},V={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,N],subLanguage:"xml"}},_={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,N],subLanguage:"css"}},$={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,N],subLanguage:"graphql"}},B={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,N]},E={className:"comment",variants:[t.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}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},k=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,V,_,$,B,{match:/\$\d+/},w];N.contains=k.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(k)});const m=[].concat(E,N.contains),v=m.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(m)}]),x={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:v},j={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,o.concat(r,"(",o.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},K={relevance:0,match:o.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:{_:[...Bi,...zi]}},ne={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},ce={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[x],illegal:/%/},re={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Y(P){return o.concat("(?!",P.join("|"),")")}const ee={match:o.concat(/\b/,Y([...Ii,"super","import"].map(P=>`${P}\\s*\\(`)),r,o.lookahead(/\s*\(/)),className:"title.function",relevance:0},ie={begin:o.concat(/\./,o.lookahead(o.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},z={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},x]},C="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",F={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,o.lookahead(C)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[x]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:v,CLASS_REFERENCE:K},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),ne,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,V,_,$,B,E,{match:/\$\d+/},w,K,{scope:"attr",match:r+o.lookahead(":"),relevance:0},F,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[E,t.REGEXP_MODE,{className:"function",begin:C,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:v}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:s},{begin:c.begin,"on:begin":c.isTrulyOpeningTag,end:c.end}],subLanguage:"xml",contains:[{begin:c.begin,end:c.end,skip:!0,contains:["self"]}]}]},ce,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[x,t.inherit(t.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},ie,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[x]},ee,re,j,z,{match:/\$[(.]/}]}}function ec(t){const o={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],i={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[o,n,t.QUOTE_STRING_MODE,i,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function Li(t){const o=t.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},i={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}]},s={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},c={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},u=/[A-Za-z][A-Za-z0-9+.-]*/,d={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:o.concat(/\[.+?\]\(/,u,/:\/\/.*?\)/),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}/}]},b={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},w=t.inherit(g,{contains:[]}),N=t.inherit(b,{contains:[]});g.contains.push(N),b.contains.push(w);let V=[n,d];return[g,b,w,N].forEach(T=>{T.contains=T.contains.concat(V)}),V=V.concat(g,b),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:V},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:V}]}]},n,s,g,b,{className:"quote",begin:"^>\\s+",contains:V,end:"$"},i,r,d,c,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function Di(t){const o=t.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],u={$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:u,illegal:/#/},b={begin:/\{\{/,relevance:0},w={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,d],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,d],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,d,b,g]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,d,b,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:[t.BACKSLASH_ESCAPE,b,g]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,b,g]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},N="[0-9](_?[0-9])*",V=`(\\b(${N}))?\\.(${N})|\\b(${N})\\.`,_=`\\b|${r.join("|")}`,$={className:"number",relevance:0,variants:[{begin:`(\\b(${N})|(${V}))[eE][+-]?(${N})[jJ]?(?=${_})`},{begin:`(${V})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${_})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${_})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${_})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${_})`},{begin:`\\b(${N})[jJ](?=${_})`}]},B={className:"comment",begin:o.lookahead(/# type:/),end:/$/,keywords:u,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},T={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:["self",d,$,w,t.HASH_COMMENT_MODE]}]};return g.contains=[w,$,d],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:u,illegal:/(<\/|\?)|=>/,contains:[d,$,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},w,B,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[T]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[$,T,w]}]}}function Vi(t){const o=t.regex,n=/(r#)?/,r=o.concat(n,t.UNDERSCORE_IDENT_RE),i=o.concat(n,t.IDENT_RE),s={className:"title.function.invoke",relevance:0,begin:o.concat(/\b/,/(?!let|for|while|if|else|match\b)/,i,o.lookahead(/\s*\(/))},c="([ui](8|16|32|64|128|size)|f(32|64))?",u=["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!"],b=["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:t.IDENT_RE+"!?",type:b,keyword:u,literal:d,built_in:g},illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.COMMENT("/\\*","\\*/",{contains:["self"]}),t.inherit(t.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_]+)"+c},{begin:"\\b0o([0-7_]+)"+c},{begin:"\\b0x([A-Fa-f0-9_]+)"+c},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+c}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[t.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:t.IDENT_RE+"::",keywords:{keyword:"Self",built_in:g,type:b}},{className:"punctuation",begin:"->"},s]}}function tc(t){const o=t.regex,n=t.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},s=["true","false","unknown"],c=["double precision","large object","with timezone","without timezone"],u=["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"],b=["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"],w=["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"],N=["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"],V=b,_=[...g,...d].filter(v=>!b.includes(v)),$={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},B={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},T={match:o.concat(/\b/,o.either(...V),/\s*\(/),relevance:0,keywords:{built_in:V}};function E(v){return o.concat(/\b/,o.either(...v.map(x=>x.replace(/\s+/,"\\s+"))),/\b/)}const k={scope:"keyword",match:E(N),relevance:0};function m(v,{exceptions:x,when:j}={}){const K=j;return x=x||[],v.map(ne=>ne.match(/\|\d+$/)||x.includes(ne)?ne:K(ne)?`${ne}|0`:ne)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:m(_,{when:v=>v.length<3}),literal:s,type:u,built_in:w},contains:[{scope:"type",match:E(c)},k,T,$,r,i,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,n,B]}}const $o="[A-Za-z$_][0-9A-Za-z$_]*",$i=["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"],Pi=["true","false","null","undefined","NaN","Infinity"],Fi=["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"],Ui=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Hi=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Wi=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Gi=[].concat(Hi,Fi,Ui);function nc(t){const o=t.regex,n=(P,{after:W})=>{const ae="</"+P[0].slice(1);return P.input.indexOf(ae,W)!==-1},r=$o,i={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,c={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(P,W)=>{const ae=P[0].length+P.index,we=P.input[ae];if(we==="<"||we===","){W.ignoreMatch();return}we===">"&&(n(P,{after:ae})||W.ignoreMatch());let ve;const ze=P.input.substring(ae);if(ve=ze.match(/^\s*=/)){W.ignoreMatch();return}if((ve=ze.match(/^\s+extends\s+/))&&ve.index===0){W.ignoreMatch();return}}},u={$pattern:$o,keyword:$i,literal:Pi,built_in:Gi,"variable.language":Wi},d="[0-9](_?[0-9])*",g=`\\.(${d})`,b="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",w={className:"number",variants:[{begin:`(\\b(${b})((${g})|\\.)?|(${g}))[eE][+-]?(${d})\\b`},{begin:`\\b(${b})\\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},N={className:"subst",begin:"\\$\\{",end:"\\}",keywords:u,contains:[]},V={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,N],subLanguage:"xml"}},_={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,N],subLanguage:"css"}},$={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,N],subLanguage:"graphql"}},B={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,N]},E={className:"comment",variants:[t.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}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},k=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,V,_,$,B,{match:/\$\d+/},w];N.contains=k.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(k)});const m=[].concat(E,N.contains),v=m.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(m)}]),x={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:v},j={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,o.concat(r,"(",o.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},K={relevance:0,match:o.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:{_:[...Fi,...Ui]}},ne={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},ce={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[x],illegal:/%/},re={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Y(P){return o.concat("(?!",P.join("|"),")")}const ee={match:o.concat(/\b/,Y([...Hi,"super","import"].map(P=>`${P}\\s*\\(`)),r,o.lookahead(/\s*\(/)),className:"title.function",relevance:0},ie={begin:o.concat(/\./,o.lookahead(o.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},z={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},x]},C="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",F={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,o.lookahead(C)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[x]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:v,CLASS_REFERENCE:K},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),ne,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,V,_,$,B,E,{match:/\$\d+/},w,K,{scope:"attr",match:r+o.lookahead(":"),relevance:0},F,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[E,t.REGEXP_MODE,{className:"function",begin:C,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:v}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:s},{begin:c.begin,"on:begin":c.isTrulyOpeningTag,end:c.end}],subLanguage:"xml",contains:[{begin:c.begin,end:c.end,skip:!0,contains:["self"]}]}]},ce,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[x,t.inherit(t.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},ie,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[x]},ee,re,j,z,{match:/\$[(.]/}]}}function ji(t){const o=t.regex,n=nc(t),r=$o,i=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],s={begin:[/namespace/,/\s+/,t.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},c={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:i},contains:[n.exports.CLASS_REFERENCE]},u={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},d=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],g={$pattern:$o,keyword:$i.concat(d),literal:Pi,built_in:Gi.concat(i),"variable.language":Wi},b={className:"meta",begin:"@"+r},w=($,B,T)=>{const E=$.contains.findIndex(k=>k.label===B);if(E===-1)throw new Error("can not find mode to replace");$.contains.splice(E,1,T)};Object.assign(n.keywords,g),n.exports.PARAMS_CONTAINS.push(b);const N=n.contains.find($=>$.scope==="attr"),V=Object.assign({},N,{match:o.concat(r,o.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,N,V]),n.contains=n.contains.concat([b,s,c,V]),w(n,"shebang",t.SHEBANG()),w(n,"use_strict",u);const _=n.contains.find($=>$.label==="func.def");return _.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function Ki(t){const o=t.regex,n=o.concat(/[\p{L}_]/u,o.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},s={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},c=t.inherit(s,{begin:/\(/,end:/\)/}),u=t.inherit(t.APOS_STRING_MODE,{className:"string"}),d=t.inherit(t.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:[i]},{begin:/'/,end:/'/,contains:[i]},{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:[s,d,u,c,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[s,c,d,u]}]}]},t.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{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:o.concat(/</,o.lookahead(o.concat(n,o.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:g}]},{className:"tag",begin:o.concat(/<\//,o.lookahead(o.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function Yi(t){const o="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},i={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},s={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},c={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,i]},u=t.inherit(c,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),N={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"},V={end:",",endsWithParent:!0,excludeEnd:!0,keywords:o,relevance:0},_={begin:/\{/,end:/\}/,contains:[V],illegal:"\\n",relevance:0},$={begin:"\\[",end:"\\]",contains:[V],illegal:"\\n",relevance:0},B=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:o,keywords:{literal:o}},N,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},_,$,s,c],T=[...B];return T.pop(),T.push(u),V.contains=T,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:B}}const pr={bash:mr,sh:mr,shell:mr,css:Ys,go:_i,golang:_i,java:qs,javascript:Oi,js:Oi,json:ec,markdown:Li,md:Li,python:Di,py:Di,rust:Vi,rs:Vi,sql:tc,typescript:ji,ts:ji,xml:Ki,html:Ki,yaml:Yi,yml:Yi};for(const[t,o]of Object.entries(pr))fr.registerLanguage(t,o);function Po(t){const o=t.split(`
16
- `);return/^(`{3,}|~{3,})/.test(o[0]??"")&&o.shift(),/^(`{3,}|~{3,})\s*$/.test(o[o.length-1]??"")&&o.pop(),o.join(`
17
- `).replace(/\n+$/,"")}function Tn(t){const o=/^(`{3,}|~{3,})([^\s`~]*)/.exec(t.split(`
18
- `)[0]??""),n=((o==null?void 0:o[2])??"").toLowerCase();return n&&pr[n]?n:""}function gr(t,o){const n=o&&pr[o]?o:"";try{return n?fr.highlight(t,{language:n,ignoreIllegals:!0}).value:fr.highlightAuto(t).value}catch{return oc(t)}}function hr(t){return t.split(`
19
- `).filter(o=>o.trim().length>0).filter(o=>!/^\s*\|?\s*(:?-+:?\s*\|\s*)+(:?-+:?)(\s*\|)?\s*$/.test(o)).map(o=>o.replace(/^\s*\|/,"").replace(/\|\s*$/,"").split("|").map(n=>n.trim()))}function oc(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function qi(t,o,n){if(t.length<=1)return t.slice();const[r,...i]=t,s=i.map(g=>g[o]??""),c=s.length>0&&s.every(g=>g.trim()!==""&&!Number.isNaN(Number(g))),u=n==="asc"?1:-1,d=i.slice().sort((g,b)=>{const w=g[o]??"",N=b[o]??"";return c?(Number(w)-Number(N))*u:w.localeCompare(N,"zh-Hans-CN",{numeric:!0})*u});return[r,...d]}const rc=["viewBox","width","height"],ic={class:"zm-edges"},lc=["d","fill"],ac=["data-node-id","onClick","onPointerdown","onDblclick","onContextmenu","onMouseenter","onMouseleave"],sc=["src","width","height","alt"],cc=["onDblclick"],dc={key:0,class:"zm-rich-code"},uc=["innerHTML"],fc={key:1,class:"zm-rich-table"},mc=["onClick"],pc={class:"zm-rich-sort-mark","aria-hidden":"true"},gc={key:2,class:"zm-text"},hc={key:0,class:"zm-node-markers"},bc=["title","innerHTML"],kc={class:"zm-text-label"},yc=["href","title"],Ec=["title","onClick"],xc={key:4,class:"zm-node-tags"},wc=["title"],Nc=["title","onClick"],Sc=["onClick"],Tc=["onMousedown"],Cc=["onClick"],Ac=["title"],_c={class:"zm-tb-tip zm-tb-zoom"},Mc=["src"],Rc=["src"],Cn=24,Hn=400,fn=160,Xi=4,Fo=e.defineComponent({__name:"MindMap",props:{data:{},theme:{},previewMode:{type:Boolean,default:!1},markdown:{},lineColors:{},hideCanvasActions:{type:Boolean,default:!1}},emits:["change","select","edit-note","markdownChange","canvas-toggle-preview","canvas-outline","canvas-settings","canvas-data","canvas-import"],setup(t,{expose:o,emit:n}){const r=t,i=n,s=e.ref(null),c=e.ref(null),u=e.ref(""),d=e.ref(new Set),g=e.computed(()=>d.value.values().next().value??null),b=e.ref(new Set),w=e.ref(!1),N=e.ref(null),V=e.ref(0),_=e.ref(0),$=e.ref(null),B=e.ref(null),T=e.ref(null),E=e.ref(""),k=e.ref(new Map),m=e.ref(Ct(r.data)),v=e.ref({}),x=e.ref({}),j=e.ref(r.markdown!==void 0);let K=!1;e.watch(()=>r.markdown,l=>{if(l===void 0){j.value=!1;return}j.value=!0;const a=Vn(l||"");K=!0,m.value=Ct(a),d.value=new Set,b.value=new Set,he(),e.nextTick(()=>{K=!1,rn()})}),e.watch(m,()=>{j.value&&!K&&i("markdownChange",$n(m.value))},{deep:!0});const ne=e.computed(()=>Q.showOrderBadge===!0),ce=e.ref(new Map),re=ce.value;function Y(l,a){const f={};a.bg&&(f.bg=a.bg),a.textColor&&(f.textColor=a.textColor),a.borderColor&&(f.borderColor=a.borderColor),a.fontWeight&&(f.fontWeight=a.fontWeight),a.fontSize&&(f.fontSize=a.fontSize),Object.keys(f).length===0?re.delete(l):re.set(l,f),ce.value=new Map(re)}function ee(l){return re.get(l)??{}}function ie(l,a){const f=le(m.value,l);f&&(f.image={src:a.src,naturalW:a.naturalW,naturalH:a.naturalH,width:F(a.width,Cn,Hn),height:F(a.height,Cn,Hn)},Ce(),he(),i("change",m.value))}function z(l){const a=le(m.value,l);!a||!a.image||(delete a.image,Ce(),he(),i("change",m.value))}function C(l,a){const f=a.trim();if(!le(m.value,l))return;if(!f){z(l);return}const S=new Image;S.onload=()=>{const L=le(m.value,l);if(!L)return;const M=S.naturalWidth&&S.naturalHeight?S.naturalWidth/S.naturalHeight:1,G=F(S.naturalWidth||fn,Cn,Hn),oe=Math.round(G/M);L.image={src:f,naturalW:S.naturalWidth||G,naturalH:S.naturalHeight||oe,width:G,height:oe},Ce(),he(),i("change",m.value)},S.onerror=()=>{},S.src=f}function F(l,a,f){return Math.min(f,Math.max(a,l))}function P(l,a){const f=new FileReader;f.onload=()=>{if(typeof f.result!="string")return;const A=f.result,S=new window.Image;S.onload=()=>{const L=S.naturalWidth||fn,M=S.naturalHeight||fn,G=F(L,Cn,fn),oe=F(Math.round(M*G/L),Cn,Hn);a({src:A,naturalW:L,naturalH:M,width:G,height:oe})},S.onerror=()=>{a({src:A,naturalW:fn,naturalH:fn,width:fn,height:fn})},S.src=A},f.readAsDataURL(l)}function W(l){const a=document.createElement("input");a.type="file",a.accept="image/*",a.style.display="none",a.onchange=()=>{var A;const f=(A=a.files)==null?void 0:A[0];f&&(P(f,S=>ie(l,S)),document.body.removeChild(a))},document.body.appendChild(a),a.click()}function ae(l,a){const f=a.trim(),A=le(m.value,l);A&&(f?A.link={url:f}:delete A.link,Ce(),he(),i("change",m.value))}function we(l){ae(l,"")}function ve(l,a){const f=le(m.value,l);f&&(a?f.note={text:a}:delete f.note,Ce(),he(),i("change",m.value))}function ze(l){ve(l,"")}function Ne(l,a){const f=le(m.value,l);f&&(a?f.richContent=a:delete f.richContent,Ce(),he(),i("change",m.value))}const y=e.ref(null),p=e.ref(null),O=e.computed(()=>["zm-canvas-fab","zm-canvas-fab-preview",!r.hideCanvasActions&&(!r.previewMode||w.value)?"is-visible":""].filter(Boolean).join(" ")),D=e.computed(()=>["zm-canvas-fab","zm-canvas-fab-outline",!r.hideCanvasActions&&(!r.previewMode||w.value)?"is-visible":""].filter(Boolean).join(" "));function q(l,a){r.previewMode||(l.preventDefault(),l.stopPropagation(),p.value=null,d.value=new Set([a.id]),ut(),y.value={nodeId:a.id,x:l.clientX,y:l.clientY})}function de(){y.value=null}function ge(l){const a=l.target;if(!(a!=null&&a.closest(".zm-toolbar, button, input, textarea, .zm-canvas-fab-preview, .zm-canvas-fab-outline"))){if(er&&J.panMoved.value){er=!1,l.preventDefault();return}l.preventDefault(),y.value&&(y.value=null),p.value={x:l.clientX,y:l.clientY}}}function je(){p.value=null}function Pe(){je(),i("canvas-settings")}function Je(){je(),i("canvas-data")}function Ke(l){je(),i("canvas-import",l)}function Xn(){var a;const l=(a=y.value)==null?void 0:a.nodeId;l&&W(l)}function pn(){var A,S,L;const l=(A=y.value)==null?void 0:A.nodeId;if(!l)return;const a=((L=(S=le(m.value,l))==null?void 0:S.link)==null?void 0:L.url)??"",f=window.prompt("输入链接 URL(留空取消)",a);f!==null&&ae(l,f)}function te(){var a;const l=(a=y.value)==null?void 0:a.nodeId;l&&we(l)}function Gt(){var a;const l=(a=y.value)==null?void 0:a.nodeId;l&&U(l)}function Be(){var a;const l=(a=y.value)==null?void 0:a.nodeId;l&&ze(l)}function Te(){var a;const l=(a=y.value)==null?void 0:a.nodeId;l&&z(l)}function Ot(){var Ve,R;const l=(Ve=y.value)==null?void 0:Ve.nodeId;if(!l)return;const a=(R=le(m.value,l))==null?void 0:R.richContent,f=(a==null?void 0:a.kind)==="code"?Po(a.raw):"",A=(a==null?void 0:a.kind)==="code"&&a.lang||"",S=A?"```"+A+`
20
- `:"```\n",M=window.prompt("输入代码块内容(用 ```lang 包裹;留空取消)",f?S+f+(f.endsWith("```")?"":"\n```"):S+"// 你的代码"+"\n```");if(M===null)return;const G=M.trim();if(!G){Ne(l,null);return}const oe=/^```([^\s`]*)/.exec(G),pe=oe?oe[1]:void 0;Ne(l,{kind:"code",raw:G,lang:pe})}function it(){var a;const l=(a=y.value)==null?void 0:a.nodeId;l&&Ne(l,null)}function Lt(){var M,G;const l=(M=y.value)==null?void 0:M.nodeId;if(!l)return;const a=(G=le(m.value,l))==null?void 0:G.richContent,f=(a==null?void 0:a.kind)==="table"?a.raw:"",S=window.prompt("输入 markdown 表格(每行以 | 分隔;留空取消)",f||`| 列1 | 列2 | 列3 |
21
- | --- | --- | --- |
22
- | a | b | c |`);if(S===null)return;const L=S.trim();if(!L){Ne(l,null);return}Ne(l,{kind:"table",raw:L})}function jt(){var a;const l=(a=y.value)==null?void 0:a.nodeId;l&&Ne(l,null)}function U(l){r.previewMode||i("edit-note",l)}function Z(l,a=60){const f=l.replace(/\s+/g," ").trim();return f.length<=a?f||"点击编辑笔记":f.slice(0,a)+"…"}function se(l){var S;if(r.previewMode||c.value)return;const a=l.target;if(a&&(a.tagName==="INPUT"||a.tagName==="TEXTAREA"||a.isContentEditable))return;const f=g.value;if(!f)return;const A=(S=l.clipboardData)==null?void 0:S.items;if(A)for(let L=0;L<A.length;L++){const M=A[L];if(M.kind==="file"&&M.type.startsWith("image/")){const G=M.getAsFile();if(!G)continue;l.preventDefault();const oe=le(m.value,f);if(oe!=null&&oe.image&&!window.confirm("该节点已有图片,要用剪贴板里的图片替换吗?"))return;P(G,pe=>ie(f,pe));return}}}e.onMounted(()=>{window.addEventListener("paste",se),window.addEventListener("keydown",ye),he()}),e.onBeforeUnmount(()=>{window.removeEventListener("paste",se),window.removeEventListener("keydown",ye)});function ye(l){if((l.metaKey||l.ctrlKey)&&(l.key==="f"||l.key==="F")){const f=l.target;if(f&&(f.tagName==="INPUT"||f.tagName==="TEXTAREA"||f.isContentEditable))return;l.preventDefault(),i("canvas-outline")}}const Me=e.ref(null),Qe=e.computed(()=>{var l;return((l=Me.value)==null?void 0:l.nodeId)??null});function pt(l,a){if(!a.image)return;l.preventDefault(),l.stopPropagation();const f=a.image.naturalW||a.image.width,A=a.image.naturalH||a.image.height,S=A>0?A/f:1;Me.value={nodeId:a.id,startX:l.clientX,startY:l.clientY,startW:a.image.width,startH:a.image.height,naturalW:f,naturalH:A,ratio:S,pendingW:a.image.width,pendingH:a.image.height},window.addEventListener("mousemove",gn),window.addEventListener("mouseup",fo)}function gn(l){var oe,pe;const a=Me.value;if(!a)return;const f=J.scale.value||1,A=l.clientX-a.startX,S=F(a.startW+A/f,Cn,Hn),L=F(S*a.ratio,Cn,Hn);a.pendingW=S,a.pendingH=L;const M=(oe=s.value)==null?void 0:oe.querySelector(`[data-node-id="${a.nodeId}"] .zm-node-img`);M&&(M.style.width=`${S}px`,M.style.height=`${L}px`);const G=(pe=s.value)==null?void 0:pe.querySelector(`[data-node-id="${a.nodeId}"]`);G&&(G.style.minWidth=`${Math.max(80,Math.ceil(S+28))}px`,G.style.height=`${Math.ceil(L+8+30)}px`)}function fo(){const l=Me.value;if(window.removeEventListener("mousemove",gn),window.removeEventListener("mouseup",fo),Me.value=null,!l)return;const a=le(m.value,l.nodeId);!a||!a.image||(ie(l.nodeId,{src:a.image.src,naturalW:a.image.naturalW,naturalH:a.image.naturalH,width:l.pendingW,height:l.pendingH}),d.value=new Set([l.nodeId]),ut(),Bn=!0)}const Zn=e.ref(null);let Bn=!1;function qo(l){Zn.value=l}function Jn(l){Zn.value===l&&(Zn.value=null),B.value&&(B.value=null)}function Qn(l,a){var Et;if(!a.text||a.text.length<14)return;const A=l.currentTarget.getBoundingClientRect(),S=(Et=s.value)==null?void 0:Et.getBoundingClientRect();if(!S)return;const L=10,M=240,G=A.top-S.top>60,oe=A.left-S.left+A.width/2,pe=L+M/2,Ve=S.width-M/2-L,R=Math.max(pe,Math.min(oe,Ve)),Ye=G?A.top-S.top-8:A.bottom-S.top+8;B.value={text:a.text,x:R,y:Ye,above:G}}const gt=e.ref(0),Kt=e.ref(!1),_t=Ia(100);function Ce(){_t.record({data:m.value,selectedIds:[...d.value]})}function he(){b.value=new Set(b.value),gt.value++,e.nextTick().then(()=>e.nextTick()).then(()=>mo()).then(()=>{gt.value++})}function mo(){const l=document.querySelectorAll(".zm-rich"),a={},f={};l.forEach(A=>{let S=A,L=null;for(;S&&!L;)L=S.getAttribute("data-node-id"),S=S.parentElement;if(!L)return;const M=A.offsetHeight,G=A.scrollWidth,oe=Math.round(M*2)/2,pe=Math.round(G*2)/2;a[L]=oe,f[L]=pe,v.value[L],x.value[L]}),v.value=a,x.value=f}const lt=e.computed(()=>{var l,a,f,A,S,L,M,G,oe,pe;return{rootBg:((l=r.theme)==null?void 0:l.rootBg)??"#1f2937",rootText:((a=r.theme)==null?void 0:a.rootText)??"#ffffff",branchBg:((f=r.theme)==null?void 0:f.branchBg)??"#ffffff",branchText:((A=r.theme)==null?void 0:A.branchText)??"#1f2937",lineColor:((S=r.theme)==null?void 0:S.lineColor)??"#94a3b8",bgColor:((L=r.theme)==null?void 0:L.bgColor)??"#f8fafc",fontSize:((M=r.theme)==null?void 0:M.fontSize)??14,lineWidthStart:((G=r.theme)==null?void 0:G.lineWidthStart)??2.2,lineWidthEnd:((oe=r.theme)==null?void 0:oe.lineWidthEnd)??.8,rainbowBranch:((pe=r.theme)==null?void 0:pe.rainbowBranch)??!1}}),po=e.computed(()=>Q.canvasBg||lt.value.bgColor),Q=e.reactive({autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:3.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"curve",layoutMode:"mindmap",taperedEdge:!0,showOrderBadge:!1,canvasBg:void 0});function go(l){return Q.taperedEdge?De(l):Qt(l)}function ho(l){return Q.taperedEdge?Q.lineWidthEnd:Qt(l)}function De(l){return l<=0?Q.lineWidthStart:l===1?Math.max(1.5,Q.lineWidthStart*.67):l===2?Math.max(.8,Q.lineWidthStart*.42):Q.lineWidthEnd}function Qt(l){if(l<=0)return Q.lineWidthStart;if(l>=3)return Q.lineWidthEnd;const a=l/3;return Q.lineWidthStart+(Q.lineWidthEnd-Q.lineWidthStart)*a}function Pr(l,a,f,A){const S=1-l,L=S*S*S*a.x+3*S*S*l*f.x1+3*S*l*l*f.x2+l*l*l*A.x,M=S*S*S*a.y+3*S*S*l*f.y1+3*S*l*l*f.y2+l*l*l*A.y;return{x:L,y:M}}function bo(l,a,f,A,S=32,L="curve",M="right"){if(L==="curve"){let kt;if(M==="right"||M==="left"){const Oe=Math.abs(a.x-l.x)*.45,Pt=M==="right"?1:-1;kt={x1:l.x+Pt*Oe,y1:l.y,x2:a.x-Pt*Oe,y2:a.y}}else{const Oe=Math.abs(a.y-l.y)*.45;kt={x1:l.x,y1:l.y+Oe,x2:a.x,y2:a.y-Oe}}const qt=Ee=>{const Oe=1-Ee,Pt=-3*Oe*Oe*l.x+3*(Oe*Oe-2*Oe*Ee)*kt.x1+3*(2*Oe*Ee-Ee*Ee)*kt.x2+3*Ee*Ee*a.x,sn=-3*Oe*Oe*l.y+3*(Oe*Oe-2*Oe*Ee)*kt.y1+3*(2*Oe*Ee-Ee*Ee)*kt.y2+3*Ee*Ee*a.y;return{dx:Pt,dy:sn}},Vt=[],yn=[];for(let Ee=0;Ee<=S;Ee++){const Oe=Ee/S,Pt=Ee===0?l:Ee===S?a:Pr(Oe,l,kt,a),sn=qt(Oe);let to=Math.hypot(sn.dx,sn.dy);to<1e-6&&(to=1);const xt=-sn.dy/to,qe=sn.dx/to,Xe=(f+(A-f)*Oe)/2;Vt.push({x:Pt.x+xt*Xe,y:Pt.y+qe*Xe}),yn.push({x:Pt.x-xt*Xe,y:Pt.y-qe*Xe})}let $t=`M ${Vt[0].x.toFixed(2)} ${Vt[0].y.toFixed(2)}`;for(let Ee=1;Ee<=S;Ee++)$t+=` L ${Vt[Ee].x.toFixed(2)} ${Vt[Ee].y.toFixed(2)}`;for(let Ee=S;Ee>=0;Ee--)$t+=` L ${yn[Ee].x.toFixed(2)} ${yn[Ee].y.toFixed(2)}`;return $t+=" Z",$t}const G=a.x-l.x,oe=a.y-l.y;let pe=Math.hypot(G,oe);pe<1e-6&&(pe=1);const Ve=-oe/pe,R=G/pe,Ye=f/2,Et=A/2,ue={x:l.x+Ve*Ye,y:l.y+R*Ye},ft={x:l.x-Ve*Ye,y:l.y-R*Ye},an={x:a.x-Ve*Et,y:a.y-R*Et},at={x:a.x+Ve*Et,y:a.y+R*Et};return`M ${ue.x.toFixed(2)} ${ue.y.toFixed(2)} L ${at.x.toFixed(2)} ${at.y.toFixed(2)} L ${an.x.toFixed(2)} ${an.y.toFixed(2)} L ${ft.x.toFixed(2)} ${ft.y.toFixed(2)} Z`}const hn=e.computed(()=>et.value.root.children),Xo=Jt[0].colors,ko=e.computed(()=>ya(Q.branchPaletteId,Q.customPalettes)),en=e.computed(()=>{const l=new Map;if(!Q.rainbowBranch)return l;const a=r.lineColors,f=a&&a.length>0?a:ko.value.colors.length>0?ko.value.colors:Xo;for(let S=0;S<hn.value.length;S++){const L=hn.value[S];l.set(L.id,f[S%f.length])}const A=(S,L)=>{l.set(S.id,L);for(const M of S.children)A(M,L)};for(let S=0;S<hn.value.length;S++){const L=hn.value[S];A(L,f[S%f.length])}return l});function ht(l,a){return Q.rainbowBranch?en.value.get(a.id)??lt.value.lineColor:lt.value.lineColor}function Yt(l){const a=ee(l.id);if(a.bg)return a.bg;if(l.isRoot)return lt.value.rootBg;if(Q.rainbowBranch){const f=en.value.get(l.id);if(f)return bn(f,.18)}return lt.value.branchBg}function tn(l){const a=ee(l.id);if(a.textColor)return a.textColor;if(l.isRoot)return lt.value.rootText;if(Q.rainbowBranch){const f=en.value.get(l.id);if(f)return In(f,.55)}return lt.value.branchText}function nn(l){const a=ee(l.id);if(a.borderColor)return a.borderColor;if(l.isRoot)return lt.value.rootBg;if(Q.rainbowBranch){const f=en.value.get(l.id);if(f)return In(f,.3)}return lt.value.lineColor}function eo(l){return ee(l.id).fontWeight??(l.isRoot?600:400)}function zn(l){return ee(l.id).fontSize??lt.value.fontSize}function bn(l,a){const f=l.replace("#",""),A=f.length===6?f:f.split("").map(G=>G+G).join(""),S=parseInt(A.slice(0,2),16),L=parseInt(A.slice(2,4),16),M=parseInt(A.slice(4,6),16);return`rgba(${S}, ${L}, ${M}, ${a})`}function In(l,a){const f=l.replace("#",""),A=f.length===6?f:f.split("").map(G=>G+G).join(""),S=Math.round(parseInt(A.slice(0,2),16)*(1-a)),L=Math.round(parseInt(A.slice(2,4),16)*(1-a)),M=Math.round(parseInt(A.slice(4,6),16)*(1-a));return`rgb(${S}, ${L}, ${M})`}const J=va({getContainer:()=>s.value});J.setOnMarqueeEnd(Ep),za({isEditing:()=>c.value!==null,isReadonly:()=>r.previewMode,getSelectedId:()=>g.value,getSelectedIds:()=>[...d.value],defaultTargetId:()=>m.value.id,onAddChild:on,onAddSibling:Fe,onAddSiblingBefore:Jo,onRemove:Vl,onStartEdit:Mt,onClearSelection:()=>{d.value=new Set,ut()},onDuplicate:xo,onCopy:Ol,onCut:Ll,onPaste:Dl,hasClipboard:()=>!!$.value&&$.value.nodes.length>0,onUndo:Fr,onRedo:Ur,onNavigate:up,onSelectRoot:()=>{d.value=new Set([m.value.id]),ut()}});const et=e.computed(()=>{const l=Ct(m.value);return On(l),ga(l,{mode:Q.layoutMode,baseFontSize:lt.value.fontSize,richHeights:v.value,richWidths:x.value})}),yo=e.ref([]),kn=e.computed(()=>(gt.value,yo.value));e.watch(et,l=>{const a=[],f=A=>{a.push(A);for(const S of A.children)f(S)};f(l.root),yo.value=a},{immediate:!0});const Eo=e.computed(()=>{const l=[];for(const a of kn.value)for(const f of a.children)l.push({from:a,to:f,key:`${a.id}->${f.id}`});return l}),Zo=e.computed(()=>`${et.value.vbX} ${et.value.vbY} ${et.value.vbW} ${et.value.vbH}`);function On(l){if(b.value.has(l.id)){l.children=[],l.collapsed=!0;return}l.collapsed=!1;for(const a of l.children)On(a)}function Mt(l){const a=le(m.value,l);a&&(c.value=l,u.value=a.text,e.nextTick(()=>{const f=document.querySelector(".zm-input");f==null||f.focus(),f==null||f.select()}))}function X(){if(!c.value)return;const l=le(m.value,c.value);l&&l.text!==(u.value.trim()||" ")&&(l.text=u.value.trim()||" ",Ce(),i("change",m.value)),c.value=null}function h(){c.value=null}function I(l){if(r.previewMode)return;const a=le(m.value,l);a!=null&&a.richContent&&(T.value=l,E.value=a.richContent.raw,e.nextTick(()=>{const f=document.querySelector(".zm-node .zm-rich textarea");f==null||f.focus()}))}function H(){if(!T.value)return;const l=T.value,a=le(m.value,l),f=E.value;if(a&&a.richContent&&a.richContent.raw!==f)if(a.richContent.kind==="code"){const A=Tn(f)||void 0;Ne(l,{kind:"code",raw:f,lang:A})}else Ne(l,{kind:"table",raw:f});T.value=null}function Se(){T.value=null}function me(l){l.key==="Escape"?(l.preventDefault(),Se()):l.key==="Enter"&&(l.ctrlKey||l.metaKey)&&(l.preventDefault(),H())}function Ae(l,a){const f=k.value.get(l);!f||f.col!==a?k.value.set(l,{col:a,dir:"asc"}):f.dir==="asc"?k.value.set(l,{col:a,dir:"desc"}):k.value.delete(l)}function We(l,a){const f=k.value.get(l);return!f||a.length<=1?a:qi(a,f.col,f.dir)}function bt(l,a){const f=k.value.get(l);return!f||f.col!==a?"↕":f.dir==="asc"?"▲":"▼"}function yt(l){const a=l.metaKey||l.ctrlKey;a&&(l.key==="z"||l.key==="Z")&&!l.shiftKey?(l.preventDefault(),Fr()):(a&&l.shiftKey&&(l.key==="z"||l.key==="Z")||a&&(l.key==="y"||l.key==="Y")&&!l.shiftKey)&&(l.preventDefault(),Ur())}function on(l){const a=ri(m.value,l,vo);a&&(Ce(),he(),i("change",m.value),e.nextTick(()=>Mt(a.id)))}function Fe(l){if(l===m.value.id){on(l);return}const a=ii(m.value,l,vo);a&&(Ce(),he(),i("change",m.value),e.nextTick(()=>Mt(a.id)))}function Jo(l){if(l===m.value.id){on(l);return}const a=Ca(m.value,l,vo);a&&(Ce(),he(),i("change",m.value),e.nextTick(()=>Mt(a.id)))}function xo(l){if(l===m.value.id)return;const a=Aa(m.value,l);a&&(Ce(),d.value=new Set([a.id]),ut(),i("change",m.value),he())}function zl(l){const a=[],f=new Set;for(const A of l)A!==m.value.id&&(f.has(A)||le(m.value,A)&&(f.add(A),a.push(A)));return a}function Il(l){const a=new Set(l),f=[],A=S=>{a.has(S.id)&&f.push(S.id);for(const L of S.children)A(L)};return A(m.value),f}function Ol(l){const a=Il(zl(l));if(a.length===0)return;const f=[];for(const A of a){const S=li(m.value,A);S&&f.push(S)}f.length!==0&&($.value={nodes:f,originalIds:new Set(a)},he())}function Ll(l){const a=Il(zl(l));if(a.length===0)return;const f=[];for(const A of a){const S=li(m.value,A);S&&f.push(S)}if(f.length!==0){Ce();for(const A of a)Mo(m.value,A);d.value=new Set,ut(),$.value={nodes:f,originalIds:new Set(a)},he(),i("change",m.value)}}function Dl(l){const a=$.value;if(!a||a.nodes.length===0)return;const f=l??m.value.id,A=le(m.value,f);if(A){for(const S of a.originalIds){const L=le(m.value,S);if(L&&le(L,f))return}Ce();for(const S of a.nodes){const L=Ct(S);Ro(L),A.children.push(L)}$.value=null,he(),i("change",m.value)}}function Fr(){const l=_t.undo();l&&(m.value=l.data,d.value=new Set(l.selectedIds??[]),ut(),he(),i("change",m.value))}function Ur(){const l=_t.redo();l&&(m.value=l.data,d.value=new Set(l.selectedIds??[]),ut(),he(),i("change",m.value))}function ut(){const l=[];for(const a of d.value){const f=le(m.value,a);f&&l.push(f)}i("select",l.length>0?l:null)}function up(l,a){const f=g.value??m.value.id,A=le(m.value,f);if(!A)return;let S=null;if(a===1){const L=Bt(m.value,A.id);if(L){const M=L.children.findIndex(G=>G.id===A.id);M>=0&&M<L.children.length-1&&(S=L.children[M+1].id)}}else if(a===-1){const L=Bt(m.value,A.id);if(L){const M=L.children.findIndex(G=>G.id===A.id);M>0&&(S=L.children[M-1].id)}}else if(l===1){const L=Bt(m.value,A.id);L&&(S=L.id)}else l===-1&&A.children.length>0&&(S=A.children[0].id);S&&(d.value=new Set([S]),ut())}function Vl(l){if(l!==m.value.id&&Mo(m.value,l)){if(Ce(),d.value.has(l)){const a=new Set(d.value);a.delete(l),d.value=a,ut()}he(),i("change",m.value)}}function $l(l){b.value.has(l)?b.value.delete(l):b.value.add(l),he()}function Pl(l){const a=[{n:m.value,depth:1}];for(;a.length;){const{n:f,depth:A}=a.pop();l(f,A);for(let S=f.children.length-1;S>=0;S--)a.push({n:f.children[S],depth:A+1})}}function fp(){b.value=new Set,Pl(l=>{l.children.length>0&&b.value.add(l.id)}),he()}function Fl(l){b.value=new Set,Pl((a,f)=>{f>l&&a.children.length>0&&b.value.add(a.id)}),he()}function mp(){b.value=new Set,he()}function pp(l,a){Sa(m.value,l,a)&&(Ce(),he(),i("change",m.value))}function Ul(l,a,f){return Ta(m.value,l,a,f)?(Ce(),he(),i("change",m.value),!0):!1}function gp(l,a){if(l.stopPropagation(),l.shiftKey){const f=new Set(d.value);f.has(a.id)?f.delete(a.id):f.add(a.id),d.value=f}else d.value=new Set([a.id]);ut()}function hp(l,a,f){let A=null;for(const S of kn.value){if(S.id===f)continue;const L=S.width/2,M=S.height/2;l>=S.x-L&&l<=S.x+L&&a>=S.y-M&&a<=S.y+M&&(A=S)}return A}let Dt=null;function bp(l,a){if(r.previewMode||a.isRoot||l.button!==0)return;const f=l.target;if(f!=null&&f.closest(".zm-img-resize-handle"))return;l.stopPropagation();const A=s.value.getBoundingClientRect(),S=a.x*J.scale.value+J.offsetX.value,L=a.y*J.scale.value+J.offsetY.value,M=l.clientX-A.left-S,G=l.clientY-A.top-L;Dt={srcId:a.id,srcText:a.text,pointerOffsetX:M,pointerOffsetY:G,startX:l.clientX,startY:l.clientY},window.addEventListener("pointermove",Hl),window.addEventListener("pointerup",Qo),window.addEventListener("pointercancel",Qo)}function Hl(l){if(Dt){const M=l.clientX-Dt.startX,G=l.clientY-Dt.startY;if(Math.abs(M)<=Xi&&Math.abs(G)<=Xi)return;N.value={srcId:Dt.srcId,srcText:Dt.srcText,pointerOffsetX:Dt.pointerOffsetX,pointerOffsetY:Dt.pointerOffsetY,currentTargetId:null},document.body.classList.add("is-dragging"),Dt=null}const a=N.value;if(!a)return;const f=s.value.getBoundingClientRect();V.value=l.clientX-f.left-a.pointerOffsetX,_.value=l.clientY-f.top-a.pointerOffsetY;const A=(l.clientX-f.left-J.offsetX.value)/J.scale.value,S=(l.clientY-f.top-J.offsetY.value)/J.scale.value,L=hp(A,S,a.srcId);a.currentTargetId=(L==null?void 0:L.id)??null}function Qo(l){if(window.removeEventListener("pointermove",Hl),window.removeEventListener("pointerup",Qo),window.removeEventListener("pointercancel",Qo),Dt){Dt=null;return}const a=N.value;a&&(a.currentTargetId&&(Ul(a.srcId,a.currentTargetId,"child"),d.value=new Set([a.srcId]),ut()),N.value=null,V.value=0,_.value=0,document.body.classList.remove("is-dragging"))}let er=!1;function kp(l){const a=l.target;if(!a||a.closest(".zm-node, .zm-toolbar, button, input, textarea"))return;if(l.button===2){er=!0,J.startPan(l);return}if(er=!1,l.button!==0)return;const f=s.value.getBoundingClientRect(),A=(l.clientX-f.left-J.offsetX.value)/J.scale.value,S=(l.clientY-f.top-J.offsetY.value)/J.scale.value;J.startMarquee(A,S,{shift:l.shiftKey})}function yp(l){if(Bn){Bn=!1;return}const a=l.target;if(!a||a.closest(".zm-node"))return;const f=J.marquee;f.width>=4||f.height>=4||d.value.size>0&&(d.value=new Set,ut())}function Ep(){const l=J.marquee;if(l.width<4&&l.height<4)return;const a=l.x,f=l.y,A=l.x+l.width,S=l.y+l.height,L=[];for(const M of kn.value){const G=M.width/2,oe=M.height/2,pe=M.x-G,Ve=M.x+G,R=M.y-oe,Ye=M.y+oe;pe<=A&&Ve>=a&&R<=S&&Ye>=f&&L.push(M.id)}d.value=l.shiftKey?new Set([...d.value,...L]):new Set(L),ut()}function Wl(l){return b.value.has(l)}function xp(l){const a=le(m.value,l.id);return!!a&&a.children.length>0}function Hr(l){const a=le(m.value,l);return a?a.children.length:0}function Gl(l){if(!le(m.value,l))return 0;const A=[m.value];for(;A.length;){const S=A.pop(),L=S.children.findIndex(M=>M.id===l);if(L>=0)return L;for(const M of S.children)A.push(M)}return 0}function tr(l,a,f,A){if(((A==null?void 0:A._dir)??l._dir)==="down")return a==="out"?{x:l.x,y:l.y+l.height/2}:{x:l.x,y:l.y-l.height/2};let L;a==="in"?L=-l.side:f!==void 0?L=f:L=l.side;const M=a==="in"?l._richInsetX??0:0;return{x:l.x+L*(l.width/2-M),y:l.y}}function rn(){const l=et.value;J.resetView(l.width,l.height,l.root.y)}function wp(){Kt.value=!0,Ce(),he(),e.nextTick(()=>rn())}function Wr(l){Q.layoutMode!==l&&(Q.layoutMode=l,he(),e.nextTick(()=>rn()))}function jl(){return JSON.stringify(m.value,null,2)}function Np(l){const a=le(m.value,l);return a?!!(a.note&&a.note.text||a.link&&a.link.url||a.image&&a.image.src||a.richContent&&a.richContent.raw||a.markers&&a.markers.length>0||a.tags&&a.tags.length>0):!1}function Kl(l){try{const a=JSON.parse(l);return!a.id||!Array.isArray(a.children)?!1:(_t.reset(),m.value=Ct(a),d.value=new Set,b.value=new Set,he(),e.nextTick(()=>rn()),i("change",m.value),!0)}catch{return!1}}function Sp(){const l=document.createElement("input");l.type="file",l.accept="application/json",l.onchange=()=>{var A;const a=(A=l.files)==null?void 0:A[0];if(!a)return;const f=new FileReader;f.onload=()=>{typeof f.result=="string"&&(Kl(f.result)||alert("导入失败:JSON 格式无效"))},f.readAsText(a)},l.click()}function Tp(){const l=new Blob([jl()],{type:"application/json"}),a=URL.createObjectURL(l),f=document.createElement("a");f.href=a,f.download=`${m.value.text||"mindmap"}.json`,f.click(),URL.revokeObjectURL(a)}const Yl=e.ref(""),ln=e.ref([]),wo=e.ref(-1);function Cp(l){Yl.value=l;const a=l.trim();if(!a){ln.value=[],wo.value=-1;return}const f=a.toLowerCase(),A=[],S=L=>{var M;(L.text.toLowerCase().includes(f)||(M=L.note)!=null&&M.text&&L.note.text.toLowerCase().includes(f))&&A.push(L.id);for(const G of L.children)S(G)};S(m.value),ln.value=A,wo.value=A.length>0?0:-1,A.length>0&&(Rp(A),e.nextTick(()=>vp(0)))}function Ap(l){return ln.value.includes(l)}function _p(l){return wo.value>=0&&ln.value[wo.value]===l}function Mp(l){return Yl.value.trim().length>0&&ln.value.length>0&&!ln.value.includes(l)}function Rp(l){if(l.length===0)return;const a=new Set(l),f=new Set,A=S=>{let L=a.has(S.id);for(const M of S.children)A(M)&&(L=!0);return L&&S.children.length>0&&b.value.has(S.id)&&f.add(S.id),L};if(A(m.value),f.size>0){for(const S of f)b.value.delete(S);he()}}function vp(l){const a=ln.value[l];if(!a)return;const f=kn.value.find(A=>A.id===a);f&&(d.value=new Set([a]),ut(),J.centerOn(f.x,f.y,f.width,f.height))}function Bp(l,a){const f=le(m.value,l);f&&(f.markers||(f.markers=[]),!f.markers.includes(a)&&(f.markers.push(a),Ce(),he(),i("change",m.value)))}function zp(l,a){const f=le(m.value,l);if(!f||!f.markers)return;const A=f.markers.indexOf(a);A<0||(f.markers.splice(A,1),f.markers.length===0&&delete f.markers,Ce(),he(),i("change",m.value))}function ql(l,a){const f=le(m.value,l);if(!f)return!1;f.markers||(f.markers=[]);const A=f.markers.indexOf(a);return A>=0?(f.markers.splice(A,1),f.markers.length===0&&delete f.markers,Ce(),he(),i("change",m.value),!1):(f.markers.push(a),Ce(),he(),i("change",m.value),!0)}function Ip(l){const a=le(m.value,l);return a!=null&&a.markers?[...a.markers]:[]}function Op(l){var f;const a=(f=y.value)==null?void 0:f.nodeId;a&&ql(a,l)}function Lp(){var f;const l=(f=y.value)==null?void 0:f.nodeId;if(!l)return;const a=le(m.value,l);!a||!a.markers||(delete a.markers,Ce(),he(),i("change",m.value),de())}function Gr(l,a){const f=le(m.value,l);f&&(a.length===0?f.tags&&delete f.tags:f.tags=[...a],Ce(),he(),i("change",m.value))}function Dp(l){const a=le(m.value,l);return a!=null&&a.tags?[...a.tags]:[]}function Vp(){var L,M;const l=(L=y.value)==null?void 0:L.nodeId;if(!l)return;const a=le(m.value,l),f=((M=a==null?void 0:a.tags)==null?void 0:M.join(", "))??"",A=window.prompt("输入标签(多个用逗号分隔)",f);if(A===null)return;const S=A.split(/[,,]/).map(G=>G.trim()).filter(G=>G.length>0);Gr(l,S),de()}function $p(){var a;const l=(a=y.value)==null?void 0:a.nodeId;l&&(Gr(l,[]),de())}function Xl(){const l=et.value,a="http://www.w3.org/2000/svg",f=document.createElementNS(a,"svg");f.setAttribute("xmlns",a),f.setAttribute("viewBox",`${l.vbX} ${l.vbY} ${l.vbW} ${l.vbH}`),f.setAttribute("width",String(l.vbW)),f.setAttribute("height",String(l.vbH));const A=document.createElementNS(a,"rect");A.setAttribute("x",String(l.vbX)),A.setAttribute("y",String(l.vbY)),A.setAttribute("width",String(l.vbW)),A.setAttribute("height",String(l.vbH)),A.setAttribute("fill",po.value),f.appendChild(A);for(const M of Eo.value){const G=document.createElementNS(a,"path");G.setAttribute("d",bo(tr(M.from,"out",M.to.side,M.to),tr(M.to,"in"),go(M.from.depth),ho(M.to.depth),32,Q.lineStyle,M.to._dir)),G.setAttribute("fill",ht(M.from,M.to)),G.setAttribute("stroke","none"),f.appendChild(G)}const S="-apple-system,BlinkMacSystemFont,'Segoe UI','PingFang SC','Microsoft YaHei',sans-serif";function L(M,G){let oe=0;for(const pe of M)/[\u4e00-\u9fff\u3000-\u30ff\uff00-\uffef]/.test(pe)?oe+=G:oe+=G*.55;return oe}for(const M of kn.value){const G=M.x-M.width/2,oe=M.y-M.height/2,pe=document.createElementNS(a,"rect");pe.setAttribute("x",String(G)),pe.setAttribute("y",String(oe)),pe.setAttribute("width",String(M.width)),pe.setAttribute("height",String(M.height)),pe.setAttribute("rx","8"),pe.setAttribute("fill",Yt(M)),pe.setAttribute("stroke",nn(M)),pe.setAttribute("stroke-width","1"),f.appendChild(pe);const Ve=!!(M.tags&&M.tags.length>0),R=!!(M.markers&&M.markers.length>0),Ye=!!M.image,Et=!!(M.richContent&&(M.richContent.kind==="code"||M.richContent.kind==="table"));let ue=0,ft=0;if(Et){const qe=M.richContent,Xe=M.fontSize*.78*.92,Xt=6,Le=4,En=2,xn=6;if(qe.kind==="code"){const wt=Po(qe.raw),mt=Tn(qe.raw),Nt=wt.split(`
23
- `),Zt=Xe*1.35;let Rt=0;for(const Ie of Nt)Rt=Math.max(Rt,L(Ie,Xe));ft=Math.min(Rt+Xt*2+4,M.width-4),ue=Nt.length*Zt+Le*2+En;const Ze=M.x-ft/2;let st=oe+4;Ye&&(st=oe+M.image.height+xn);const St=document.createElementNS(a,"rect");if(St.setAttribute("x",String(Ze)),St.setAttribute("y",String(st)),St.setAttribute("width",String(ft)),St.setAttribute("height",String(ue-En)),St.setAttribute("rx","6"),St.setAttribute("fill","rgba(255,255,255,0.55)"),St.setAttribute("stroke",nn(M)),St.setAttribute("stroke-width","1"),f.appendChild(St),mt){const Ie=document.createElementNS(a,"text");Ie.setAttribute("x",String(Ze+ft-Xt)),Ie.setAttribute("y",String(st+Le+4)),Ie.setAttribute("text-anchor","end"),Ie.setAttribute("fill",tn(M)),Ie.setAttribute("font-size",String(Xe*.8)),Ie.setAttribute("font-family",S),Ie.setAttribute("opacity","0.5"),Ie.textContent=mt,f.appendChild(Ie)}const So="'JetBrains Mono','Fira Code',Consolas,monospace";for(let Ie=0;Ie<Nt.length;Ie++){const nt=document.createElementNS(a,"text");nt.setAttribute("x",String(Ze+Xt)),nt.setAttribute("y",String(st+Le+(Ie+.5)*Zt+2)),nt.setAttribute("dominant-baseline","central"),nt.setAttribute("fill",tn(M)),nt.setAttribute("font-size",String(Xe)),nt.setAttribute("font-family",So);let vt=Nt[Ie];const Ue=Math.floor((ft-Xt*2)/(Xe*.6));vt.length>Ue&&(vt=vt.substring(0,Ue-1)+"…"),nt.textContent=vt,f.appendChild(nt)}}else if(qe.kind==="table"){const wt=hr(qe.raw);if(wt.length>0){const mt=Xe*1.35,Nt=6,Zt=3,Rt=wt[0].length,Ze=[];for(let Ue=0;Ue<Rt;Ue++){let cn=0;for(const wn of wt)Ue<wn.length&&(cn=Math.max(cn,L(wn[Ue],Xe)));Ze.push(cn+Nt*2)}ft=Math.min(Ze.reduce((Ue,cn)=>Ue+cn,0),M.width-4);const st=ft/Ze.reduce((Ue,cn)=>Ue+cn,0);for(let Ue=0;Ue<Rt;Ue++)Ze[Ue]*=st;ue=wt.length*(mt+Zt*2)+En;const St=M.x-ft/2;let So=oe+4;Ye&&(So=oe+M.image.height+xn);const Ie=document.createElementNS(a,"rect");Ie.setAttribute("x",String(St)),Ie.setAttribute("y",String(So)),Ie.setAttribute("width",String(ft)),Ie.setAttribute("height",String(ue-En)),Ie.setAttribute("rx","6"),Ie.setAttribute("fill","rgba(255,255,255,0.55)"),Ie.setAttribute("stroke",nn(M)),Ie.setAttribute("stroke-width","1"),f.appendChild(Ie);let nt=St,vt=So;for(let Ue=0;Ue<wt.length;Ue++){const cn=wt[Ue],wn=mt+Zt*2;nt=St;for(let To=0;To<Rt;To++){const no=Ze[To],Pp=cn[To]||"";if(To<Rt-1){const He=document.createElementNS(a,"line");He.setAttribute("x1",String(nt+no)),He.setAttribute("y1",String(vt)),He.setAttribute("x2",String(nt+no)),He.setAttribute("y2",String(vt+wn)),He.setAttribute("stroke",nn(M)),He.setAttribute("stroke-width","1"),f.appendChild(He)}if(Ue<wt.length-1){const He=document.createElementNS(a,"line");He.setAttribute("x1",String(nt)),He.setAttribute("y1",String(vt+wn)),He.setAttribute("x2",String(nt+no)),He.setAttribute("y2",String(vt+wn)),He.setAttribute("stroke",nn(M)),He.setAttribute("stroke-width","1"),f.appendChild(He)}if(Ue===0){const He=document.createElementNS(a,"rect");He.setAttribute("x",String(nt)),He.setAttribute("y",String(vt)),He.setAttribute("width",String(no)),He.setAttribute("height",String(wn)),He.setAttribute("fill","rgba(255,255,255,0.4)"),f.appendChild(He)}const dn=document.createElementNS(a,"text");dn.setAttribute("x",String(nt+Nt)),dn.setAttribute("y",String(vt+Zt+mt/2+2)),dn.setAttribute("dominant-baseline","central"),dn.setAttribute("fill",tn(M)),dn.setAttribute("font-size",String(Xe)),dn.setAttribute("font-family",S),Ue===0&&dn.setAttribute("font-weight","600");let nr=Pp;const jr=Math.floor((no-Nt*2)/(Xe*.55));nr.length>jr&&jr>2&&(nr=nr.substring(0,jr-1)+"…"),dn.textContent=nr,f.appendChild(dn),nt+=no}vt+=wn}}}}let an=0;if(Ye){const qe=M.image,Xe=oe+4,Xt=M.x-qe.width/2,Le=document.createElementNS(a,"image");Le.setAttribute("x",String(Xt)),Le.setAttribute("y",String(Xe)),Le.setAttribute("width",String(qe.width)),Le.setAttribute("height",String(qe.height)),Le.setAttribute("href",qe.src),Le.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",qe.src),Le.setAttribute("preserveAspectRatio","xMidYMid meet"),f.appendChild(Le),an=qe.height+6}let at=M.y;const kt=an+ue;kt>0?at=oe+kt+(M.height-kt)/2:Ve&&(at=M.y-8);const qt=14,Vt=2,yn=4,$t=R?M.markers.length:0,Ee=$t>0?$t*qt+($t-1)*Vt+yn:0,Oe=L(M.text,M.fontSize),Pt=Ee+Oe,sn=M.x-Pt/2;if(R){let qe=sn;for(const Xe of M.markers){const Xt=zo(Xe);if(Xt){const Le=document.createElementNS(a,"svg");Le.setAttribute("x",String(qe)),Le.setAttribute("y",String(at-qt/2)),Le.setAttribute("width",String(qt)),Le.setAttribute("height",String(qt)),Le.setAttribute("viewBox","0 0 24 24"),Le.setAttribute("color",tn(M));const xn=new DOMParser().parseFromString(`<svg xmlns="${a}">${Xt}</svg>`,"image/svg+xml");if(!xn.querySelector("parsererror"))for(;xn.documentElement.firstChild;)Le.appendChild(xn.documentElement.firstChild);f.appendChild(Le)}qe+=qt+Vt}}const to=R?sn+Ee+Oe/2:M.x,xt=document.createElementNS(a,"text");if(xt.setAttribute("x",String(to)),xt.setAttribute("y",String(at)),xt.setAttribute("text-anchor","middle"),xt.setAttribute("dominant-baseline","central"),xt.setAttribute("fill",tn(M)),xt.setAttribute("font-size",String(zn(M))),xt.setAttribute("font-weight",String(eo(M))),xt.setAttribute("font-family",S),xt.textContent=M.text,f.appendChild(xt),Ve){const Le=M.y+10,En=M.tags.map(mt=>L(mt,10)+12),xn=En.reduce((mt,Nt)=>mt+Nt+3,-3);let wt=M.x-xn/2;for(let mt=0;mt<M.tags.length;mt++){const Nt=M.tags[mt],Zt=lr(Nt),Rt=En[mt],Ze=document.createElementNS(a,"rect");Ze.setAttribute("x",String(wt)),Ze.setAttribute("y",String(Le-16/2)),Ze.setAttribute("width",String(Rt)),Ze.setAttribute("height",String(16)),Ze.setAttribute("rx",String(16/2)),Ze.setAttribute("fill",Zt.background),Ze.setAttribute("stroke",Zt.borderColor),Ze.setAttribute("stroke-width","1"),f.appendChild(Ze);const st=document.createElementNS(a,"text");st.setAttribute("x",String(wt+Rt/2)),st.setAttribute("y",String(Le)),st.setAttribute("text-anchor","middle"),st.setAttribute("dominant-baseline","central"),st.setAttribute("fill",Zt.color),st.setAttribute("font-size",String(10)),st.setAttribute("font-family",S),st.textContent=Nt,f.appendChild(st),wt+=Rt+3}}}return f}function No(){const l=Xl();let f=new XMLSerializer().serializeToString(l);f.startsWith("<?xml")||(f=`<?xml version="1.0" encoding="UTF-8"?>
24
- `+f);const A=new Blob([f],{type:"image/svg+xml;charset=utf-8"}),S=URL.createObjectURL(A),L=document.createElement("a");L.href=S,L.download=`${m.value.text||"mindmap"}.svg`,L.click(),URL.revokeObjectURL(S)}function Zl(l=2){const a=Xl(),f=et.value;let S=new XMLSerializer().serializeToString(a);S.startsWith("<?xml")||(S=`<?xml version="1.0" encoding="UTF-8"?>
25
- `+S);const L=new Blob([S],{type:"image/svg+xml;charset=utf-8"}),M=URL.createObjectURL(L),G=new window.Image;G.onload=()=>{const oe=document.createElement("canvas");oe.width=Math.ceil(f.vbW*l),oe.height=Math.ceil(f.vbH*l);const pe=oe.getContext("2d");if(!pe){URL.revokeObjectURL(M);return}pe.fillStyle=po.value,pe.fillRect(0,0,oe.width,oe.height),pe.drawImage(G,0,0,oe.width,oe.height),URL.revokeObjectURL(M);try{oe.toBlob(Ve=>{if(!Ve){No();return}const R=URL.createObjectURL(Ve),Ye=document.createElement("a");Ye.href=R,Ye.download=`${m.value.text||"mindmap"}.png`,Ye.click(),URL.revokeObjectURL(R)},"image/png")}catch(Ve){console.warn("PNG export failed, falling back to SVG:",Ve),No()}},G.onerror=()=>{URL.revokeObjectURL(M),No()},G.src=M}return o({addChild:l=>on(l),addSibling:l=>Fe(l),removeNode:l=>Vl(l),duplicateNode:l=>xo(l),setNodeText:(l,a)=>pp(l,a),moveNode:(l,a,f)=>Ul(l,a,f),lineWidthForDepth:go,endWidthForDepth:ho,getData:()=>m.value,nodeHasContent:l=>Np(l),getSelectedIds:()=>[...d.value],copyNodes:l=>Ol(l),cutNodes:l=>Ll(l),pasteNodes:l=>Dl(l),setData:l=>{_t.reset(),m.value=Ct(l),d.value=new Set,b.value=new Set,he(),Ce(),e.nextTick(()=>rn())},resetView:()=>rn(),exportData:jl,importData:Kl,getMarkdown:()=>$n(m.value),setMarkdown:(l,a=!0)=>{const f=Vn(l||"");a&&(j.value=!0),K=!a,_t.reset(),m.value=Ct(f),d.value=new Set,b.value=new Set,he(),Ce(),e.nextTick(()=>{K=!1,rn()}),i("change",m.value)},setBalanced:l=>{Kt.value=l},isBalanced:()=>Kt.value,balance:()=>wp(),applyNodeStyle:(l,a)=>Y(l,a),getNodeStyle:l=>ee(l),applyNodeImage:(l,a)=>ie(l,a),applyNodeImageByUrl:(l,a)=>C(l,a),removeNodeImage:l=>z(l),applyNodeLink:(l,a)=>ae(l,a),removeNodeLink:l=>we(l),applyNodeNote:(l,a)=>ve(l,a),removeNodeNote:l=>ze(l),applyNodeRichContent:(l,a)=>Ne(l,a),addNodeMarker:(l,a)=>Bp(l,a),removeNodeMarker:(l,a)=>zp(l,a),toggleNodeMarker:(l,a)=>ql(l,a),getNodeMarkers:l=>Ip(l),setNodeTags:(l,a)=>Gr(l,a),getNodeTags:l=>Dp(l),exportPNG:l=>Zl(l),exportSVG:()=>No(),searchNodes:l=>(Cp(l),[...ln.value]),undo:()=>Fr(),redo:()=>Ur(),canUndo:()=>_t.canUndo(),canRedo:()=>_t.canRedo(),applySettings:l=>{l.autoBalanceOnChange!==void 0&&(Q.autoBalanceOnChange=l.autoBalanceOnChange),l.lineWidthStart!==void 0&&(Q.lineWidthStart=Math.max(.5,Math.min(20,l.lineWidthStart))),l.lineWidthEnd!==void 0&&(Q.lineWidthEnd=Math.max(.3,Math.min(10,l.lineWidthEnd))),l.rainbowBranch!==void 0&&(Q.rainbowBranch=l.rainbowBranch),l.branchPaletteId!==void 0&&(Q.branchPaletteId=l.branchPaletteId),l.customPalettes!==void 0&&(Q.customPalettes=l.customPalettes),l.lineStyle!==void 0&&(Q.lineStyle=l.lineStyle),l.taperedEdge!==void 0&&(Q.taperedEdge=l.taperedEdge),l.showOrderBadge!==void 0&&(Q.showOrderBadge=l.showOrderBadge),l.canvasBg!==void 0&&(Q.canvasBg=l.canvasBg)},getSettings:()=>({autoBalanceOnChange:Q.autoBalanceOnChange,lineWidthStart:Q.lineWidthStart,lineWidthEnd:Q.lineWidthEnd,rainbowBranch:Q.rainbowBranch,branchPaletteId:Q.branchPaletteId,customPalettes:Q.customPalettes,lineStyle:Q.lineStyle,layoutMode:Q.layoutMode,taperedEdge:Q.taperedEdge,showOrderBadge:Q.showOrderBadge,canvasBg:Q.canvasBg}),setBranchPalette:l=>{if(!l)return;[...Jt,...Q.customPalettes].find(f=>f.id===l)&&(Q.branchPaletteId=l)},getBranchPalette:()=>Q.branchPaletteId,getBranchPalettes:()=>[...Jt,...Q.customPalettes],getSearchResults:()=>[...ln.value],getSearchIndex:()=>wo.value}),e.watch(()=>r.data,l=>{m.value=Ct(l),he()},{deep:!1}),e.onMounted(()=>{Ce(),e.nextTick(()=>rn())}),(l,a)=>{var f,A,S,L,M,G,oe,pe,Ve;return e.openBlock(),e.createElementBlock("div",{class:"zm-mindmap",style:e.normalizeStyle({background:po.value,fontSize:lt.value.fontSize+"px"})},[e.createElementVNode("div",{ref_key:"wrapperRef",ref:s,class:"zm-canvas",onMousedown:kp,onContextmenu:ge,onWheel:a[26]||(a[26]=(...R)=>e.unref(J).onWheel&&e.unref(J).onWheel(...R)),onMouseenter:a[27]||(a[27]=R=>w.value=!0),onMouseleave:a[28]||(a[28]=R=>w.value=!1),onClick:yp},[e.createElementVNode("div",{class:"zm-svg-layer",style:e.normalizeStyle({left:et.value.vbX*e.unref(J).scale.value+e.unref(J).offsetX.value+"px",top:et.value.vbY*e.unref(J).scale.value+e.unref(J).offsetY.value+"px",width:et.value.vbW*e.unref(J).scale.value+"px",height:et.value.vbH*e.unref(J).scale.value+"px"})},[(e.openBlock(),e.createElementBlock("svg",{class:"zm-svg",viewBox:Zo.value,preserveAspectRatio:"xMinYMin meet",width:et.value.vbW*e.unref(J).scale.value,height:et.value.vbH*e.unref(J).scale.value},[e.createElementVNode("g",ic,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Eo.value,R=>(e.openBlock(),e.createElementBlock("path",{key:R.key,d:bo(tr(R.from,"out",R.to.side,R.to),tr(R.to,"in"),go(R.from.depth),ho(R.to.depth),32,Q.lineStyle,R.to._dir),fill:ht(R.from,R.to),stroke:"none"},null,8,lc))),128))])],8,rc))],4),e.unref(J).isMarquee.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-marquee",style:e.normalizeStyle({left:e.unref(J).marquee.x*e.unref(J).scale.value+e.unref(J).offsetX.value+"px",top:e.unref(J).marquee.y*e.unref(J).scale.value+e.unref(J).offsetY.value+"px",width:e.unref(J).marquee.width*e.unref(J).scale.value+"px",height:e.unref(J).marquee.height*e.unref(J).scale.value+"px"})},null,4)):e.createCommentVNode("",!0),N.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"zm-drag-ghost",style:e.normalizeStyle({left:V.value+"px",top:_.value+"px",transform:`scale(${e.unref(J).scale.value})`,transformOrigin:"top left"})},e.toDisplayString(N.value.srcText),5)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"zm-world",style:e.normalizeStyle({transform:`translate(${e.unref(J).offsetX.value}px, ${e.unref(J).offsetY.value}px) scale(${e.unref(J).scale.value})`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(kn.value,R=>{var Ye,Et;return e.openBlock(),e.createElementBlock("div",{key:R.id,class:e.normalizeClass(["zm-node",{"is-root":R.isRoot,"is-selected":g.value===R.id,"is-selected-secondary":g.value!==R.id&&d.value.has(R.id),"is-editing":c.value===R.id,"has-image":!!R.image,"is-resizing":Qe.value===R.id,"is-dragging-source":((Ye=N.value)==null?void 0:Ye.srcId)===R.id,"is-drop-target":((Et=N.value)==null?void 0:Et.currentTargetId)===R.id,"is-search-hit":Ap(R.id),"is-search-current":_p(R.id),"is-search-dimmed":Mp(R.id)}]),"data-node-id":R.id,style:e.normalizeStyle({left:R.x+"px",top:R.y+"px",width:R.width+"px",minWidth:R.width+"px",height:R.height+"px",fontSize:zn(R)+"px",background:Yt(R),color:tn(R),borderColor:nn(R),fontWeight:eo(R),transform:"translate(-50%, -50%)"}),onClick:ue=>gp(ue,R),onPointerdown:ue=>bp(ue,R),onDblclick:ue=>{ue.stopPropagation(),t.previewMode||Mt(R.id)},onContextmenu:ue=>q(ue,R),onMouseenter:ue=>{qo(R.id),Qn(ue,R)},onMouseleave:ue=>Jn(R.id)},[R.image?(e.openBlock(),e.createElementBlock("img",{key:0,class:"zm-node-img",src:R.image.src,width:R.image.width,height:R.image.height,alt:R.text,draggable:"false"},null,8,sc)):e.createCommentVNode("",!0),R.richContent&&(R.richContent.kind==="code"||R.richContent.kind==="table")&&c.value!==R.id?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["zm-rich zm-rich-above",{"zm-rich-no-overflow":R.richContent.kind==="table"||R.richContent.kind==="code"}]),onClick:a[1]||(a[1]=e.withModifiers(()=>{},["stop"])),onDblclick:e.withModifiers(ue=>I(R.id),["stop"]),onMousedown:a[2]||(a[2]=e.withModifiers(()=>{},["stop"]))},[T.value===R.id?e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:0,"onUpdate:modelValue":a[0]||(a[0]=ue=>E.value=ue),class:"zm-rich-edit",spellcheck:"false",onBlur:H,onKeydown:me},null,544)),[[e.vModelText,E.value]]):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[R.richContent.kind==="code"?(e.openBlock(),e.createElementBlock("pre",dc,[e.createElementVNode("code",{innerHTML:e.unref(gr)(e.unref(Po)(R.richContent.raw),e.unref(Tn)(R.richContent.raw))},null,8,uc)])):R.richContent.kind==="table"?(e.openBlock(),e.createElementBlock("table",fc,[e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(We(R.id,e.unref(hr)(R.richContent.raw)),(ue,ft)=>(e.openBlock(),e.createElementBlock("tr",{key:ft},[ft===0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(ue,(an,at)=>{var kt,qt,Vt,yn,$t;return e.openBlock(),e.createElementBlock("th",{key:`h${at}`,class:e.normalizeClass(["zm-rich-table-sort",{"is-sorted":((kt=k.value.get(R.id))==null?void 0:kt.col)===at,"is-asc":((qt=k.value.get(R.id))==null?void 0:qt.col)===at&&((Vt=k.value.get(R.id))==null?void 0:Vt.dir)==="asc","is-desc":((yn=k.value.get(R.id))==null?void 0:yn.col)===at&&(($t=k.value.get(R.id))==null?void 0:$t.dir)==="desc"}]),onClick:e.withModifiers(Ee=>Ae(R.id,at),["stop"])},[e.createElementVNode("span",null,e.toDisplayString(an),1),e.createElementVNode("span",pc,e.toDisplayString(bt(R.id,at)),1)],10,mc)}),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(ue,(an,at)=>(e.openBlock(),e.createElementBlock("td",{key:`c${at}`},e.toDisplayString(an),1))),128))]))),128))])])):e.createCommentVNode("",!0)],64))],42,cc)):e.createCommentVNode("",!0),c.value!==R.id?(e.openBlock(),e.createElementBlock("span",gc,[R.markers&&R.markers.length>0?(e.openBlock(),e.createElementBlock("span",hc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.markers,ue=>(e.openBlock(),e.createElementBlock("span",{key:ue,class:"zm-node-marker",title:e.unref(si)(ue),innerHTML:'<svg viewBox="0 0 24 24" width="14" height="14">'+e.unref(zo)(ue)+"</svg>"},null,8,bc))),128))])):e.createCommentVNode("",!0),e.createElementVNode("span",kc,e.toDisplayString(R.text),1),R.link&&!c.value?(e.openBlock(),e.createElementBlock("a",{key:1,class:"zm-node-link",href:R.link.url,target:"_blank",rel:"noopener noreferrer",title:`打开链接:${R.link.url}`,onClick:a[3]||(a[3]=e.withModifiers(()=>{},["stop"])),onMousedown:a[4]||(a[4]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(ke,{name:"link",size:11,stroke:2})],40,yc)):e.createCommentVNode("",!0),R.note&&!c.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-node-note-btn",type:"button",title:Z(R.note.text),onClick:e.withModifiers(ue=>U(R.id),["stop"]),onMousedown:a[5]||(a[5]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(ke,{name:"note",size:11,stroke:2})],40,Ec)):e.createCommentVNode("",!0)])):e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:3,class:"zm-input","onUpdate:modelValue":a[6]||(a[6]=ue=>u.value=ue),autofocus:"",onBlur:a[7]||(a[7]=ue=>X()),onKeydown:[a[8]||(a[8]=e.withKeys(e.withModifiers(ue=>X(),["exact"]),["enter"])),a[9]||(a[9]=e.withKeys(e.withModifiers(ue=>X(),["prevent"]),["tab"])),e.withKeys(h,["esc"]),yt],onMousedown:a[10]||(a[10]=e.withModifiers(()=>{},["stop"])),onClick:a[11]||(a[11]=e.withModifiers(()=>{},["stop"]))},null,544)),[[e.vModelText,u.value]]),R.tags&&R.tags.length>0&&c.value!==R.id?(e.openBlock(),e.createElementBlock("div",xc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.tags,ue=>(e.openBlock(),e.createElementBlock("span",{key:ue,class:"zm-node-tag",style:e.normalizeStyle(e.unref(lr)(ue))},e.toDisplayString(ue),5))),128))])):e.createCommentVNode("",!0),ne.value?(e.openBlock(),e.createElementBlock("span",{key:5,class:"zm-order-badge",title:`数据顺序:第 ${Gl(R.id)+1} 个`},e.toDisplayString(Gl(R.id)+1),9,wc)):e.createCommentVNode("",!0),Wl(R.id)&&Hr(R.id)>0?(e.openBlock(),e.createElementBlock("span",{key:6,class:e.normalizeClass(["zm-collapse-badge",{"is-on-left":R.side===-1}]),style:e.normalizeStyle({background:en.value.get(R.id)??"#64748b"}),title:`展开 ${Hr(R.id)} 个子节点`,onMousedown:a[12]||(a[12]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(ue=>$l(R.id),["stop"])},e.toDisplayString(Hr(R.id)),47,Nc)):e.createCommentVNode("",!0),xp(R)&&!Wl(R.id)?(e.openBlock(),e.createElementBlock("button",{key:7,class:e.normalizeClass(["zm-btn zm-collapse",{"is-on-left":R.side===-1}]),style:e.normalizeStyle({color:en.value.get(R.id)??"#64748b",borderColor:en.value.get(R.id)??"#64748b"}),title:"折叠",onMousedown:a[13]||(a[13]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(ue=>$l(R.id),["stop"])},[e.createVNode(ke,{name:"minus",size:10,stroke:2.4})],46,Sc)):e.createCommentVNode("",!0),R.image&&g.value===R.id&&c.value!==R.id?(e.openBlock(),e.createElementBlock("span",{key:8,class:"zm-img-resize-handle",title:"拖动调整图片大小",onMousedown:e.withModifiers(ue=>pt(ue,R),["stop"])},null,40,Tc)):e.createCommentVNode("",!0),R.image&&g.value===R.id&&c.value!==R.id?(e.openBlock(),e.createElementBlock("button",{key:9,class:"zm-img-remove-btn",title:"移除图片",onMousedown:a[14]||(a[14]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(ue=>z(R.id),["stop"])},[e.createVNode(ke,{name:"x",size:9,stroke:2.2})],40,Cc)):e.createCommentVNode("",!0)],46,ac)}),128))],4),B.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["zm-tooltip",{"is-below":!B.value.above}]),style:e.normalizeStyle({left:B.value.x+"px",top:B.value.y+"px"})},e.toDisplayString(B.value.text),7)):e.createCommentVNode("",!0),y.value?(e.openBlock(),e.createBlock(Ga,{key:3,x:y.value.x,y:y.value.y,container:s.value,"has-image":!!((f=e.unref(le)(m.value,y.value.nodeId))!=null&&f.image),"has-link":!!((A=e.unref(le)(m.value,y.value.nodeId))!=null&&A.link),"has-note":!!((S=e.unref(le)(m.value,y.value.nodeId))!=null&&S.note),"has-code":((M=(L=e.unref(le)(m.value,y.value.nodeId))==null?void 0:L.richContent)==null?void 0:M.kind)==="code","has-table":((oe=(G=e.unref(le)(m.value,y.value.nodeId))==null?void 0:G.richContent)==null?void 0:oe.kind)==="table","node-markers":((pe=e.unref(le)(m.value,y.value.nodeId))==null?void 0:pe.markers)??[],"node-tags":((Ve=e.unref(le)(m.value,y.value.nodeId))==null?void 0:Ve.tags)??[],onPickImage:Xn,onRemoveImage:Te,onSetLink:pn,onRemoveLink:te,onEditNote:Gt,onRemoveNote:Be,onAddCode:Ot,onEditCode:Ot,onRemoveCode:it,onAddTable:Lt,onEditTable:Lt,onRemoveTable:jt,onToggleMarker:Op,onClearMarkers:Lp,onAddTag:Vp,onRemoveTags:$p,onClose:de},null,8,["x","y","container","has-image","has-link","has-note","has-code","has-table","node-markers","node-tags"])):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createBlock(ja,{key:4,x:p.value.x,y:p.value.y,container:s.value,onOpenSettings:Pe,onOpenData:Je,onOpenImport:Ke,onExportPng:Zl,onExportSvg:No,onClose:je},null,8,["x","y","container"])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(O.value),title:r.previewMode?"退出预览模式":"进入预览模式",onClick:a[15]||(a[15]=R=>i("canvas-toggle-preview"))},[e.createVNode(ke,{name:r.previewMode?"eye-off":"eye",size:16},null,8,["name"])],10,Ac),e.createElementVNode("button",{class:e.normalizeClass(D.value),title:"显示大纲视图",onClick:a[16]||(a[16]=R=>i("canvas-outline"))},[e.createVNode(ke,{name:"outline",size:16})],2),e.createElementVNode("div",{class:e.normalizeClass(["zm-toolbar",{"is-preview-only":r.previewMode,"is-hovered":w.value}])},[e.createElementVNode("span",_c,e.toDisplayString(Math.round(e.unref(J).scale.value*100))+"%",1),e.createElementVNode("button",{class:"zm-tb-btn",title:"放大",onClick:a[17]||(a[17]=(...R)=>e.unref(J).zoomIn&&e.unref(J).zoomIn(...R))},[e.createVNode(ke,{name:"zoom-in"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"缩小",onClick:a[18]||(a[18]=(...R)=>e.unref(J).zoomOut&&e.unref(J).zoomOut(...R))},[e.createVNode(ke,{name:"zoom-out"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"重置视图",onClick:rn},[e.createVNode(ke,{name:"reset"})]),a[32]||(a[32]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"全部收起",onClick:fp},[e.createVNode(ke,{name:"collapse-all"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"展开一级",onClick:a[19]||(a[19]=R=>Fl(1))},[e.createVNode(ke,{name:"expand-level-1"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"展开二级",onClick:a[20]||(a[20]=R=>Fl(2))},[e.createVNode(ke,{name:"expand-level-2"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"全部展开",onClick:mp},[e.createVNode(ke,{name:"expand-all"})]),a[33]||(a[33]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"导出 JSON",onClick:Tp},[e.createVNode(ke,{name:"export"})]),r.previewMode?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[a[29]||(a[29]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"添加子节点 (Tab)",onClick:a[21]||(a[21]=R=>g.value&&on(g.value))},[e.createElementVNode("img",{src:e.unref(Xr),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,Mc)]),e.createElementVNode("button",{class:"zm-tb-btn",title:"添加同级 (Enter)",onClick:a[22]||(a[22]=R=>g.value&&Fe(g.value))},[e.createElementVNode("img",{src:e.unref(qr),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,Rc)]),a[30]||(a[30]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:Q.layoutMode==="mindmap"}]),title:"思维导图布局 (中心辐射)",onClick:a[23]||(a[23]=R=>Wr("mindmap"))},[e.createVNode(ke,{name:"mindmap"})],2),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:Q.layoutMode==="tree"}]),title:"树形布局 (向右展开)",onClick:a[24]||(a[24]=R=>Wr("tree"))},[e.createVNode(ke,{name:"tree"})],2),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:Q.layoutMode==="org"}]),title:"组织结构布局 (向下展开)",onClick:a[25]||(a[25]=R=>Wr("org"))},[e.createVNode(ke,{name:"org"})],2),a[31]||(a[31]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"导入 JSON",onClick:Sp},[e.createVNode(ke,{name:"import"})])],64))],2)],544)],4)}}}),vc={class:"zm-outline-root"},Bc={class:"zm-outline-search"},zc={key:0,class:"zm-outline-search-count"},Ic={key:1,class:"zm-outline-search-count zm-outline-search-empty"},Oc={class:"zm-outline-actions"},Lc={width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Dc={key:0,x:"9",y:"9",width:"13",height:"13",rx:"2"},Vc={key:1,d:"M5 12 L10 17 L19 7"},$c={class:"zm-outline"},Pc=["data-outline-id","onClick","onDblclick","onDragstart","onDragover","onDragleave","onDrop"],Fc=["title","onClick"],Uc={width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round"},Hc={key:0,points:"6 9 12 15 18 9"},Wc={key:1,points:"9 6 15 12 9 18"},Gc={key:1,class:"zm-outline-dot"},jc={class:"zm-outline-index"},Kc={key:3,class:"zm-outline-text"},Yc=["onClick"],qc=["src"],Xc=["onClick"],Zc=["src"],Jc=["title","onClick"],Qc={width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},ed={key:0,x:"9",y:"9",width:"13",height:"13",rx:"2"},td={key:1,d:"M5 12 L10 17 L19 7"},br=e.defineComponent({__name:"Outline",props:{data:{},selectedId:{default:null},collapsedIds:{default:()=>new Set},readonly:{type:Boolean,default:!1}},emits:["select","toggleCollapse","edit","addChild","addSibling","move"],setup(t,{emit:o}){const n=t,r=o,i=e.ref(""),s=e.ref(null),c=e.ref(-1),u=e.computed(()=>{const p=i.value.trim().toLowerCase();if(!p)return new Set;const O=new Set,D=q=>{var de;(q.text.toLowerCase().includes(p)||(de=q.note)!=null&&de.text&&q.note.text.toLowerCase().includes(p))&&O.add(q.id);for(const ge of q.children)D(ge)};return D(n.data),O}),d=e.computed(()=>{if(u.value.size===0)return new Set;const p=new Set,O=D=>{let q=u.value.has(D.id);for(const de of D.children)O(de)&&(q=!0);return q&&p.add(D.id),q};return O(n.data),p}),g=e.computed(()=>{const p=[],O=D=>{u.value.has(D.id)&&p.push(D.id);for(const q of D.children)O(q)};return O(n.data),p}),b=e.computed(()=>i.value.trim().length>0),w=e.computed(()=>{const p=[],O=d.value,D=(q,de,ge)=>{if(b.value&&!O.has(q.id))return;const je=q.children.length>0,Pe=b.value?!1:n.collapsedIds.has(q.id);p.push({id:q.id,text:q.text||"(无标题)",depth:de,siblingIndex:ge,hasChildren:je,collapsed:Pe,node:q}),je&&!Pe&&q.children.forEach((Je,Ke)=>D(Je,de+1,Ke))};return D(n.data,0,0),p});function N(){c.value=g.value.length>0?0:-1}function V(){const p=g.value;p.length!==0&&(c.value=(c.value+1)%p.length,B(c.value))}function _(){const p=g.value;p.length!==0&&(c.value=(c.value-1+p.length)%p.length,B(c.value))}function $(p){p.key==="Enter"?(p.preventDefault(),p.shiftKey?_():V()):p.key==="Escape"&&(p.preventDefault(),i.value="",c.value=-1)}function B(p){const O=g.value[p];if(!O)return;const D=w.value.find(q=>q.id===O);D&&r("select",D.node),e.nextTick(()=>{const q=document.querySelector(`[data-outline-id="${O}"]`);q==null||q.scrollIntoView({block:"nearest",behavior:"smooth"})})}function T(){i.value="",c.value=-1}e.onMounted(()=>{e.nextTick(()=>{var p;return(p=s.value)==null?void 0:p.focus()})});const E=e.ref(null),k=e.ref("");let m=null;function v(p){n.readonly||(E.value=p.id,k.value=p.text,e.nextTick(()=>{m=document.querySelector(".zm-outline-input"),m==null||m.focus(),m==null||m.select()}))}function x(){E.value!=null&&(r("edit",{id:E.value,text:k.value.trim()||"(无标题)"}),j())}function j(){E.value=null,k.value="",m=null}function K(p){p.key==="Enter"?(p.preventDefault(),x()):p.key==="Escape"&&(p.preventDefault(),j())}e.onBeforeUnmount(j);const ne=e.ref(null),ce=e.ref(null),re=e.ref(null);function Y(p,O){if(n.readonly){p.preventDefault();return}ne.value={id:O.id,text:O.text},p.dataTransfer&&(p.dataTransfer.effectAllowed="move",p.dataTransfer.setData("text/plain",O.id))}function ee(){ne.value=null,ce.value=null,re.value=null}function ie(p,O){if(!ne.value)return;p.preventDefault(),p.dataTransfer&&(p.dataTransfer.dropEffect="move");const D=F(p);ce.value=O.id,re.value=D}function z(p){ce.value===p.id&&(ce.value=null,re.value=null)}function C(p,O){p.preventDefault();const D=ne.value;if(!D)return;const q=F(p);D.id!==O.id&&r("move",{srcId:D.id,targetId:O.id,position:q}),ee()}function F(p,O){const q=p.currentTarget.getBoundingClientRect(),de=p.clientY-q.top,ge=q.height;return de<ge*.3?"before":de>ge*.7?"after":"child"}const P=e.ref(null);let W=null;async function ae(p){try{return await navigator.clipboard.writeText(p),!0}catch{const O=document.createElement("textarea");O.value=p,document.body.appendChild(O),O.select();let D=!1;try{D=document.execCommand("copy")}finally{document.body.removeChild(O)}return D}}async function we(p,O,D){p.stopPropagation(),await ae(O)&&(P.value=D,W&&clearTimeout(W),W=setTimeout(()=>P.value=null,1200))}const ve=e.computed(()=>{const p=[],O=(D,q)=>{const de=" ".repeat(q),ge=q===0?"":"- ";p.push(de+ge+(D.text||""));for(const je of D.children)O(je,q+1)};return O(n.data,0),p.join(`
26
- `)}),ze=e.ref(!1);let Ne=null;async function y(){await ae(ve.value)&&(ze.value=!0,Ne&&clearTimeout(Ne),Ne=setTimeout(()=>ze.value=!1,1200))}return(p,O)=>(e.openBlock(),e.createElementBlock("div",vc,[e.createElementVNode("div",Bc,[O[3]||(O[3]=e.createElementVNode("svg",{class:"zm-outline-search-icon",width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"}),e.createElementVNode("line",{x1:"20",y1:"20",x2:"16",y2:"16"})],-1)),e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:s,"onUpdate:modelValue":O[0]||(O[0]=D=>i.value=D),type:"text",class:"zm-outline-search-input",placeholder:"搜索节点… (Enter 下一个, Shift+Enter 上一个)",onInput:N,onKeydown:$},null,544),[[e.vModelText,i.value]]),g.value.length>0?(e.openBlock(),e.createElementBlock("span",zc,e.toDisplayString(c.value+1)+"/"+e.toDisplayString(g.value.length),1)):b.value?(e.openBlock(),e.createElementBlock("span",Ic,"无结果")):e.createCommentVNode("",!0),i.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-outline-search-clear",title:"清除搜索",onClick:T},"×")):e.createCommentVNode("",!0)]),e.createElementVNode("div",Oc,[e.createElementVNode("button",{class:e.normalizeClass(["zm-outline-action-btn",{"is-success":ze.value}]),title:"复制完整大纲为纯文本",onClick:y},[(e.openBlock(),e.createElementBlock("svg",Lc,[ze.value?(e.openBlock(),e.createElementBlock("path",Vc)):(e.openBlock(),e.createElementBlock("rect",Dc)),O[4]||(O[4]=e.createElementVNode("path",{d:"M5 15 H4 a2 2 0 0 1 -2 -2 V4 a2 2 0 0 1 2 -2 h9 a2 2 0 0 1 2 2 v1"},null,-1))])),e.createElementVNode("span",null,e.toDisplayString(ze.value?"已复制":"复制大纲"),1)],2)]),e.createElementVNode("ul",$c,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,D=>(e.openBlock(),e.createElementBlock("li",{key:D.id,"data-outline-id":D.id,class:e.normalizeClass(["zm-outline-row",{"is-selected":D.id===t.selectedId,"is-root":D.depth===0,"is-editing":E.value===D.id,"is-search-hit":u.value.has(D.id),"is-search-current":g.value[c.value]===D.id,"is-drag-over-before":ce.value===D.id&&re.value==="before","is-drag-over-after":ce.value===D.id&&re.value==="after","is-drag-over-child":ce.value===D.id&&re.value==="child"}]),style:e.normalizeStyle({paddingLeft:12+D.depth*16+"px"}),draggable:"true",onClick:q=>r("select",D.node),onDblclick:q=>v(D),onDragstart:q=>Y(q,D),onDragend:ee,onDragover:q=>ie(q,D),onDragleave:()=>z(D),onDrop:q=>C(q,D)},[D.hasChildren?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-outline-toggle",title:D.collapsed?"展开":"折叠",onClick:e.withModifiers(q=>r("toggleCollapse",D.id),["stop"])},[(e.openBlock(),e.createElementBlock("svg",Uc,[D.collapsed?(e.openBlock(),e.createElementBlock("polyline",Wc)):(e.openBlock(),e.createElementBlock("polyline",Hc))]))],8,Fc)):(e.openBlock(),e.createElementBlock("span",Gc)),e.createElementVNode("span",jc,e.toDisplayString(D.siblingIndex+1)+".",1),E.value===D.id?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,"onUpdate:modelValue":O[1]||(O[1]=q=>k.value=q),class:"zm-outline-input",onBlur:x,onKeydown:K,onClick:O[2]||(O[2]=e.withModifiers(()=>{},["stop"]))},null,544)),[[e.vModelText,k.value]]):(e.openBlock(),e.createElementBlock("span",Kc,e.toDisplayString(D.text),1)),n.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:4,class:"zm-outline-row-action",title:"添加同级",onClick:e.withModifiers(q=>r("addSibling",D.id),["stop"])},[e.createElementVNode("img",{src:e.unref(qr),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,qc)],8,Yc)),n.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:5,class:"zm-outline-row-action",title:"添加子节点",onClick:e.withModifiers(q=>r("addChild",D.id),["stop"])},[e.createElementVNode("img",{src:e.unref(Xr),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,Zc)],8,Xc)),e.createElementVNode("button",{class:e.normalizeClass(["zm-outline-row-copy",{"is-success":P.value===D.id}]),title:P.value===D.id?"已复制":"复制节点文本",onClick:q=>we(q,D.text,D.id)},[(e.openBlock(),e.createElementBlock("svg",Qc,[P.value!==D.id?(e.openBlock(),e.createElementBlock("rect",ed)):(e.openBlock(),e.createElementBlock("path",td)),O[5]||(O[5]=e.createElementVNode("path",{d:"M5 15 H4 a2 2 0 0 1 -2 -2 V4 a2 2 0 0 1 2 -2 h9 a2 2 0 0 1 2 2 v1"},null,-1))]))],10,Jc)],46,Pc))),128))])]))}}),nd=["aria-hidden"],od=["aria-hidden"],rd={key:0,class:"zm-drawer-header"},id={key:0,class:"zm-drawer-title"},ld={class:"zm-drawer-body"},ad=["aria-hidden"],sd={key:0,class:"zm-drawer-header"},cd={key:0,class:"zm-drawer-title"},dd={class:"zm-drawer-body"},An=e.defineComponent({__name:"Drawer",props:{side:{default:"left"},width:{default:320},open:{type:Boolean,default:!0},title:{default:""},scope:{default:"page"},closable:{type:Boolean,default:!0},closeOnBackdrop:{type:Boolean,default:!0}},emits:["update:open"],setup(t,{emit:o}){const n=o;function r(){n("update:open",!1)}function i(){n("update:open",!1)}return(s,c)=>t.scope==="canvas"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.Transition,{name:"zm-fade"},{default:e.withCtx(()=>[t.open?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-drawer-canvas-backdrop","aria-hidden":!t.open,onClick:c[0]||(c[0]=u=>t.closeOnBackdrop&&i())},null,8,nd)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:t.side==="left"?"zm-slide-left":"zm-slide-right"},{default:e.withCtx(()=>[t.open?(e.openBlock(),e.createElementBlock("aside",{key:0,class:e.normalizeClass(["zm-drawer zm-drawer--canvas",["zm-drawer--"+t.side]]),style:e.normalizeStyle({width:t.width+"px"}),"aria-hidden":!t.open},[t.title||s.$slots.header?(e.openBlock(),e.createElementBlock("div",rd,[t.title?(e.openBlock(),e.createElementBlock("h3",id,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.renderSlot(s.$slots,"header"),t.closable?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-drawer-close",title:"关闭",onClick:r},[...c[1]||(c[1]=[e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},[e.createElementVNode("path",{d:"M6 6 L18 18 M18 6 L6 18"})],-1)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",ld,[e.renderSlot(s.$slots,"default")])],14,od)):e.createCommentVNode("",!0)]),_:3},8,["name"])],64)):(e.openBlock(),e.createBlock(e.Transition,{key:1,name:"zm-drawer"},{default:e.withCtx(()=>[t.open?(e.openBlock(),e.createElementBlock("aside",{key:0,class:e.normalizeClass(["zm-drawer",["zm-drawer--"+t.side,{"is-open":t.open}]]),style:e.normalizeStyle({width:t.width+"px"}),"aria-hidden":!t.open},[t.title||s.$slots.header?(e.openBlock(),e.createElementBlock("div",sd,[t.title?(e.openBlock(),e.createElementBlock("h3",cd,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.renderSlot(s.$slots,"header"),t.closable?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-drawer-close",title:"关闭",onClick:r},[...c[2]||(c[2]=[e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},[e.createElementVNode("path",{d:"M6 6 L18 18 M18 6 L6 18"})],-1)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",dd,[e.renderSlot(s.$slots,"default")])],14,ad)):e.createCommentVNode("",!0)]),_:3}))}}),ud={key:0,class:"zm-jtv-root"},fd={key:0,class:"zm-jtv-key"},md={key:1,class:"zm-jtv-colon"},pd={key:2,class:"zm-jtv-key zm-jtv-bracket"},gd={key:3,class:"zm-jtv-size"},hd={key:4,class:"zm-jtv-bracket"},bd={key:5,class:"zm-jtv-brace"},kd={key:0,class:"zm-jtv-children"},yd={class:"zm-jtv-key"},Ed={key:0,class:"zm-jtv-key"},xd=["src","alt"],wd=["href"],Nd=e.defineComponent({__name:"JsonTreeViewer",props:{value:{},keyName:{default:""},isRoot:{type:Boolean,default:!0},path:{default:""},depth:{default:0},query:{default:""},collapsedPaths:{default:()=>new Set}},setup(t){const o=t,n=e.computed(()=>o.value===null?"null":Array.isArray(o.value)?"array":typeof o.value),r=e.computed(()=>n.value==="object"),i=e.computed(()=>n.value==="array");e.computed(()=>!r.value&&!i.value);const s=e.computed(()=>{if(i.value)return`Array(${o.value.length})`;if(r.value){const E=o.value,k=Object.keys(E);return`Object(${k.length} ${k.length===1?"key":"keys"})`}return""}),c=e.computed(()=>i.value?o.value.map((E,k)=>({key:String(k),value:E})):r.value?Object.entries(o.value).map(([E,k])=>({key:E,value:k})):[]),u=e.computed(()=>o.isRoot?"<root>":o.path),d=e.computed(()=>o.collapsedPaths.has(u.value));function g(E,k,m){E!=="<root>"&&(m<2||k===null||typeof k!="object"||o.collapsedPaths.has(E)||o.collapsedPaths.add(E))}o.isRoot||g(u.value,o.value,o.depth);function b(){d.value?o.collapsedPaths.delete(u.value):o.collapsedPaths.add(u.value)}function w(E){return u.value===""?E:`${u.value}.${E}`}function N(E){if(!o.query)return!0;const k=o.query.toLowerCase();return typeof E=="string"?E.toLowerCase().includes(k):E===null?"null".includes(k):String(E).toLowerCase().includes(k)}function V(E){return o.query?E.toLowerCase().includes(o.query.toLowerCase()):!0}function _(E,k){return!o.query||V(E)?!0:k===null||typeof k!="object"?N(k):!0}function $(E){return E===null?"null":typeof E=="string"?E.length>80?`"${E.slice(0,80)}..."`:`"${E}"`:typeof E=="boolean"?E?"true":"false":typeof E=="number"?String(E):typeof E>"u"?"undefined":JSON.stringify(E)}function B(E){if(typeof E!="string")return!1;const k=E.trim();return!!(k.startsWith("data:image/")||/^https?:\/\/.+\.(png|jpe?g|gif|webp|svg|bmp|ico)(\?.*)?$/i.test(k)||/^https?:\/\/.+/i.test(k)&&/\/[^/]+\.(png|jpe?g|gif|webp|svg|bmp|ico)(\?.*)?$/i.test(k))}function T(E){if(!o.query)return null;const k=E.toLowerCase().indexOf(o.query.toLowerCase());return k<0?null:{before:E.slice(0,k),match:E.slice(k,k+o.query.length),after:E.slice(k+o.query.length)}}return(E,k)=>{var v,x,j,K,ne,ce;const m=e.resolveComponent("JsonTreeViewer",!0);return t.isRoot?(e.openBlock(),e.createElementBlock("div",ud,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,re=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:re.key,class:"zm-jtv-row"},[e.createVNode(m,{"key-name":re.key,value:re.value,path:w(re.key),depth:t.depth+1,query:t.query,"collapsed-paths":t.collapsedPaths,"is-root":!1},null,8,["key-name","value","path","depth","query","collapsed-paths"])])),[[e.vShow,_(re.key,re.value)]])),128))])):r.value||i.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["zm-jtv-branch",{"is-collapsed":d.value}])},[e.createElementVNode("div",{class:"zm-jtv-header",style:e.normalizeStyle({paddingLeft:6+t.depth*12+"px"}),onClick:b},[e.createElementVNode("span",{class:e.normalizeClass(["zm-jtv-toggle",{"is-leaf":!1}])},e.toDisplayString(d.value?"▶":"▼"),1),i.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",fd,e.toDisplayString(t.keyName),1)),i.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",md,":")),i.value?(e.openBlock(),e.createElementBlock("span",pd,"[")):e.createCommentVNode("",!0),d.value?(e.openBlock(),e.createElementBlock("span",gd,e.toDisplayString(s.value),1)):e.createCommentVNode("",!0),d.value&&i.value?(e.openBlock(),e.createElementBlock("span",hd,"]")):e.createCommentVNode("",!0),d.value&&r.value?(e.openBlock(),e.createElementBlock("span",bd,"}")):e.createCommentVNode("",!0)],4),d.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",kd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,re=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:re.key,class:"zm-jtv-row"},[e.createVNode(m,{"key-name":re.key,value:re.value,path:w(re.key),depth:t.depth+1,query:t.query,"collapsed-paths":t.collapsedPaths,"is-root":!1},null,8,["key-name","value","path","depth","query","collapsed-paths"])])),[[e.vShow,_(re.key,re.value)]])),128))])),!d.value&&i.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"zm-jtv-footer",style:e.normalizeStyle({paddingLeft:6+t.depth*12+"px"})},"]",4)):e.createCommentVNode("",!0),!d.value&&r.value&&!i.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"zm-jtv-footer",style:e.normalizeStyle({paddingLeft:6+t.depth*12+"px"})},"}",4)):e.createCommentVNode("",!0)],2)):(e.openBlock(),e.createElementBlock("div",{key:2,class:"zm-jtv-leaf",style:e.normalizeStyle({paddingLeft:6+t.depth*12+"px"})},[k[2]||(k[2]=e.createElementVNode("span",{class:"zm-jtv-toggle is-leaf"},"·",-1)),e.createElementVNode("span",yd,e.toDisplayString(t.keyName),1),k[3]||(k[3]=e.createElementVNode("span",{class:"zm-jtv-colon"},":",-1)),V(t.keyName)&&T(t.keyName)?(e.openBlock(),e.createElementBlock("span",Ed,[e.createElementVNode("span",null,e.toDisplayString((v=T(t.keyName))==null?void 0:v.before),1),e.createElementVNode("mark",null,e.toDisplayString((x=T(t.keyName))==null?void 0:x.match),1),e.createElementVNode("span",null,e.toDisplayString((j=T(t.keyName))==null?void 0:j.after),1)])):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(["zm-jtv-value",`zm-jtv-${n.value}`])},[T($(t.value))?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("span",null,e.toDisplayString((K=T($(t.value)))==null?void 0:K.before),1),e.createElementVNode("mark",null,e.toDisplayString((ne=T($(t.value)))==null?void 0:ne.match),1),e.createElementVNode("span",null,e.toDisplayString((ce=T($(t.value)))==null?void 0:ce.after),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString($(t.value)),1)],64))],2),B(t.value)?(e.openBlock(),e.createElementBlock("span",{key:1,class:"zm-jtv-thumb-wrap",onClick:k[1]||(k[1]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("img",{class:"zm-jtv-thumb",src:String(t.value),alt:t.keyName,loading:"lazy",referrerpolicy:"no-referrer"},null,8,xd),e.createElementVNode("a",{class:"zm-jtv-thumb-link",href:String(t.value),target:"_blank",rel:"noopener noreferrer",onClick:k[0]||(k[0]=e.withModifiers(()=>{},["stop"]))},"open",8,wd)])):e.createCommentVNode("",!0)],4))}}}),Sd={class:"zm-data-panel"},Td={class:"zm-data-header"},Cd={class:"zm-data-title"},Ad={class:"zm-data-title-meta"},_d={class:"zm-data-toolbar"},Md=["title"],Rd={key:0,width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},vd={key:1,width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.4","stroke-linecap":"round","stroke-linejoin":"round"},Bd={key:0,class:"zm-data-paste"},zd={class:"zm-data-tabs"},Id=["placeholder"],Od={key:0,class:"zm-data-error"},Ld={class:"zm-data-paste-actions"},Dd=["disabled"],Vd={class:"zm-data-tree"},kr=e.defineComponent({__name:"DataPanel",props:{data:{},pendingMode:{default:null}},emits:["import","consumed-mode"],setup(t,{emit:o}){const n=t,r=o,i=e.computed(()=>JSON.stringify(n.data,null,2)),s=e.ref(""),c=e.ref(null),u=e.ref(!1),d=e.ref("json"),g=e.ref("idle"),b=e.ref(new Set),w=e.ref("");e.watch(()=>n.pendingMode,k=>{k&&(u.value=!0,d.value=k,r("consumed-mode"))},{immediate:!0});async function N(){try{await navigator.clipboard.writeText(i.value),g.value="copied",setTimeout(()=>g.value="idle",1500)}catch{const k=document.createElement("textarea");k.value=i.value,document.body.appendChild(k),k.select();try{document.execCommand("copy"),g.value="copied",setTimeout(()=>g.value="idle",1500)}finally{document.body.removeChild(k)}}}function V(){const k=new Blob([i.value],{type:"application/json"}),m=URL.createObjectURL(k),v=document.createElement("a");v.href=m,v.download=`${n.data.text||"mindmap"}.json`,v.click(),URL.revokeObjectURL(m)}function _(){c.value=null;const k=s.value.trim();if(k){if(d.value==="markdown"||d.value==="txt"){try{const m=Vn(k);r("import",m),s.value="",u.value=!1}catch(m){c.value=(d.value==="txt"?"TXT 解析失败:":"Markdown 解析失败:")+m.message}return}try{const m=JSON.parse(k);if(!m.id||!Array.isArray(m.children)){c.value="JSON 缺少 id 或 children 字段";return}r("import",m),s.value="",u.value=!1}catch(m){c.value="JSON 解析失败:"+m.message}}}function $(k){return 1+k.children.reduce((m,v)=>m+$(v),0)}const B=e.computed(()=>$(n.data)),T=e.computed(()=>i.value.length);function E(){const k=document.createElement("input");k.type="file",k.accept="application/json",k.onchange=()=>{var x;const m=(x=k.files)==null?void 0:x[0];if(!m)return;const v=new FileReader;v.onload=()=>{typeof v.result=="string"&&(s.value=v.result,_())},v.readAsText(m)},k.click()}return(k,m)=>(e.openBlock(),e.createElementBlock("div",Sd,[e.createElementVNode("div",Td,[e.createElementVNode("div",Cd,[m[8]||(m[8]=e.createElementVNode("span",{class:"zm-data-title-text"},"数据 JSON",-1)),e.createElementVNode("span",Ad,e.toDisplayString(B.value)+" 节点 · "+e.toDisplayString(T.value)+" chars",1)])]),e.createElementVNode("div",_d,[e.createElementVNode("button",{class:e.normalizeClass(["zm-data-btn is-icon",{"is-success":g.value==="copied"}]),title:g.value==="copied"?"已复制":"复制 JSON 到剪贴板",onClick:N},[g.value==="idle"?(e.openBlock(),e.createElementBlock("svg",Rd,[...m[9]||(m[9]=[e.createElementVNode("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"},null,-1),e.createElementVNode("path",{d:"M5 15 H4 a2 2 0 0 1 -2 -2 V4 a2 2 0 0 1 2 -2 h9 a2 2 0 0 1 2 2 v1"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",vd,[...m[10]||(m[10]=[e.createElementVNode("polyline",{points:"5 12 10 17 19 7"},null,-1)])])),m[11]||(m[11]=e.createElementVNode("span",{class:"zm-data-btn-label"},"复制",-1))],10,Md),e.createElementVNode("button",{class:"zm-data-btn is-icon",title:"导出为 JSON 文件",onClick:V},[...m[12]||(m[12]=[e.createStaticVNode('<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 4 V15"></path><polyline points="7 9 12 4 17 9"></polyline><path d="M4 19 H20"></path></svg><span class="zm-data-btn-label">导出</span>',2)])]),e.createElementVNode("button",{class:"zm-data-btn is-icon",title:"从 JSON 文件导入",onClick:E},[...m[13]||(m[13]=[e.createStaticVNode('<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 15 V4"></path><polyline points="7 9 12 4 17 9"></polyline><path d="M4 19 H20"></path></svg><span class="zm-data-btn-label">导入</span>',2)])]),e.createElementVNode("button",{class:e.normalizeClass(["zm-data-btn is-icon",{"is-active":u.value}]),title:"粘贴 JSON 或 Markdown 替换当前数据",onClick:m[0]||(m[0]=v=>u.value=!u.value)},[...m[14]||(m[14]=[e.createStaticVNode('<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 4 H15 V8 H9 Z"></path><path d="M9 8 H4 V20 H9"></path><path d="M15 8 H20 V20 H15"></path></svg><span class="zm-data-btn-label">粘贴</span>',2)])],2),m[16]||(m[16]=e.createElementVNode("div",{class:"zm-data-toolbar-spacer"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["zm-data-search",{"is-active":w.value.length>0}])},[m[15]||(m[15]=e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"}),e.createElementVNode("line",{x1:"20",y1:"20",x2:"16",y2:"16"})],-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":m[1]||(m[1]=v=>w.value=v),type:"text",placeholder:"过滤 (键 / 值)",spellcheck:"false"},null,512),[[e.vModelText,w.value]]),w.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-data-search-clear",title:"清空过滤",onClick:m[2]||(m[2]=v=>w.value="")},"×")):e.createCommentVNode("",!0)],2)]),u.value?(e.openBlock(),e.createElementBlock("div",Bd,[e.createElementVNode("div",zd,[e.createElementVNode("button",{class:e.normalizeClass(["zm-data-tab",{"is-active":d.value==="json"}]),onClick:m[3]||(m[3]=v=>d.value="json")},"JSON",2),e.createElementVNode("button",{class:e.normalizeClass(["zm-data-tab",{"is-active":d.value==="markdown"}]),onClick:m[4]||(m[4]=v=>d.value="markdown")},"Markdown",2)]),e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":m[5]||(m[5]=v=>s.value=v),placeholder:d.value==="json"?"paste a JSON tree to replace current data":"paste markdown - # / ## / ### become nodes",spellcheck:"false"},null,8,Id),[[e.vModelText,s.value]]),c.value?(e.openBlock(),e.createElementBlock("div",Od,e.toDisplayString(c.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Ld,[e.createElementVNode("button",{class:"zm-data-btn is-primary",disabled:!s.value,onClick:_},"应用",8,Dd),e.createElementVNode("button",{class:"zm-data-btn",onClick:m[6]||(m[6]=v=>{s.value="",c.value=null})},"清空"),e.createElementVNode("button",{class:"zm-data-btn",onClick:m[7]||(m[7]=v=>u.value=!1)},"关闭")])])):e.createCommentVNode("",!0),e.createElementVNode("div",Vd,[e.createVNode(Nd,{value:t.data,query:w.value,"collapsed-paths":b.value},null,8,["value","query","collapsed-paths"])]),m[17]||(m[17]=e.createElementVNode("div",{class:"zm-data-footer"},[e.createElementVNode("span",{class:"zm-data-footer-hint"},[e.createTextVNode(" 图片支持 "),e.createElementVNode("code",null,"data:image/..."),e.createTextVNode(" / "),e.createElementVNode("code",null,"https://..."),e.createTextVNode(" / "),e.createElementVNode("code",null,"/imgs/foo.png"),e.createTextVNode(" (同源)。本地 "),e.createElementVNode("code",null,"file://"),e.createTextVNode(" 路径被浏览器拒绝。 ")])],-1))]))}}),$d={class:"zm-md-panel"},Pd={key:0,class:"zm-md-error"},Fd={class:"zm-md-split"},Ud={class:"zm-md-edit"},Hd={class:"zm-md-preview"},Wd={class:"zm-md-preview-body"},Gd={class:"zm-md-footer"},jd=["disabled"],Kd=`# flow-mindmap 思维导图
9
+ `)[0])==null?void 0:g.slice(0,80))||"(空代码块)",raw:B.join(`
10
+ `),lang:m});continue}const $=w.match(l);if($){n.push({kind:"heading",level:$[1].length,text:$[2].trim(),raw:w}),r++;continue}if(/^\s*\|/.test(w)){const k=[];let m=r,B=!1;for(;m<o.length&&/^\s*\|/.test(o[m]);)k.push(o[m]),c.test(o[m])&&(B=!0),m++;if(B&&k.length>=2){n.push({kind:"table",text:((b=k[0].replace(/^\s*\|/,"").replace(/\|\s*$/,"").split("|")[0])==null?void 0:b.trim())||"表格",raw:k.join(`
11
+ `)}),r=m;continue}}const M=w.match(u),P=w.match(d);if(M||P){let k=r;for(;k<o.length;){const m=o[k].match(u),B=o[k].match(d);if(!(m||B))break;const x=o[k].replace(/^\s*[-*+]\s+/,"").replace(/^\s*\d+\.\s+/,"").trim();x.length>0&&n.push({kind:"list",text:x.slice(0,80)||"(列表项)",raw:o[k]}),k++}r=k;continue}if(w.trim()===""){r++;continue}const I=[w];let C=r+1;for(;C<o.length;){const k=o[C];if(k.trim()===""||l.test(k)||s.test(k)||u.test(k)||d.test(k)||/^\s*\|/.test(k))break;I.push(k),C++}const E=I.join(" ").trim();n.push({kind:"paragraph",text:E.slice(0,80)||"(空段落)",raw:I.join(`
12
+ `)}),r=C}return n}function Ka(t,o="导入的导图"){const n=ja(t||""),r={id:Gt(),text:o,children:[]},l=[r],s=[0];let c=!1;function u(d){if(d.kind==="heading"){const b=d.level;for(;l.length>1&&s[s.length-1]>=b;)l.pop(),s.pop();if(!c&&b===1){c=!0,r.text=d.text,s[0]=1;return}const w={id:Gt(),text:d.text,children:[]};l[l.length-1].children.push(w),l.push(w),s.push(b);return}const g={id:Gt(),text:d.text,children:[],richContent:{kind:d.kind,raw:d.raw,lang:d.lang}};l[l.length-1].children.push(g)}for(const d of n)u(d);return r}function Ya(t){return t.richContent?t.richContent.raw+`
13
+ `:""}function qa(t){const o=t.minScale??.2,n=t.maxScale??1/0,r=t.step??1.2,l=e.ref(1),s=e.ref(0),c=e.ref(0),u=e.ref(!1),d=e.ref(!1),g=e.reactive({x:0,y:0,ox:0,oy:0}),b=e.ref(!1),w=e.reactive({x:0,y:0}),N=e.reactive({x:0,y:0,width:0,height:0}),$=e.ref(0);let M=null;function P(q){M=q}function I(q){q.preventDefault();const Q=t.getContainer();if(!Q)return;const ie=-q.deltaY*.001,z=Math.min(n,Math.max(o,l.value*(1+ie))),A=Q.getBoundingClientRect(),F=q.clientX-A.left,U=q.clientY-A.top,G=(F-s.value)/l.value,le=(U-c.value)/l.value;l.value=z,s.value=F-G*z,c.value=U-le*z}function C(){l.value=Math.min(n,l.value*r)}function E(){l.value=Math.max(o,l.value/r)}function k(q){var ie;q.target.closest(".zm-node, .zm-toolbar, button, input, textarea")||(u.value=!0,d.value=!1,g.x=q.clientX,g.y=q.clientY,g.ox=s.value,g.oy=c.value,window.addEventListener("mousemove",m),window.addEventListener("mouseup",B),(ie=q.preventDefault)==null||ie.call(q))}function m(q){if(!u.value)return;const Q=q.clientX-g.x,ie=q.clientY-g.y;(Math.abs(Q)>3||Math.abs(ie)>3)&&(d.value=!0),s.value=g.ox+Q,c.value=g.oy+ie}function B(){u.value=!1,window.removeEventListener("mousemove",m),window.removeEventListener("mouseup",B)}function x(q,Q,ie){b.value=!0,w.x=q,w.y=Q,N.x=q,N.y=Q,N.width=0,N.height=0,N.shiftKey=!!(ie!=null&&ie.shift),$.value++,window.addEventListener("mousemove",ee),window.addEventListener("mouseup",Y)}function K(q,Q){if(!b.value)return;const ie=Math.min(w.x,q),z=Math.min(w.y,Q),A=Math.max(w.x,q),F=Math.max(w.y,Q);N.x=ie,N.y=z,N.width=A-ie,N.height=F-z,$.value++}function Y(){b.value=!1,window.removeEventListener("mousemove",ee),window.removeEventListener("mouseup",Y),M&&M()}function ee(q){if(!b.value)return;const Q=t.getContainer();if(!Q)return;const ie=Q.getBoundingClientRect(),z=(q.clientX-ie.left-s.value)/l.value,A=(q.clientY-ie.top-c.value)/l.value;K(z,A)}function ae(q,Q,ie,z=60){const A=t.getContainer();if(!A)return;const F=A.getBoundingClientRect(),U=(F.width-z*2)/q,G=(F.height-z*2)/Q,le=Math.min(1,Math.max(.3,Math.min(U,G)));l.value=le,s.value=F.width/2,c.value=F.height/2-ie*le}function re(q,Q,ie,z,A=80){const F=t.getContainer();if(!F)return;const U=F.getBoundingClientRect();let G=l.value;(ie*G<40||z*G<40)&&(G=Math.min(n,Math.max(1,60/Math.min(ie,z)))),l.value=G,s.value=U.width/2-q*G,c.value=U.height/2-Q*G}return{scale:l,offsetX:s,offsetY:c,isPanning:u,panMoved:d,onWheel:I,zoomIn:C,zoomOut:E,startPan:k,startMarquee:x,updateMarquee:K,isMarquee:b,marquee:N,marqueeVersion:$,setOnMarqueeEnd:P,resetView:ae,centerOn:re}}const Xa=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform);function hi(t){return Xa?t.metaKey:t.ctrlKey}function Za(t){function o(){const r=t.getSelectedId();if(r)return r;if(t.defaultTargetId)return t.defaultTargetId();const l=t.getSelectedIds();return l.length>0?l[0]:null}function n(r){var u,d,g;const l=r.target;if(l&&(l.tagName==="INPUT"||l.tagName==="TEXTAREA"||l.isContentEditable)||t.isReadonly()||t.isEditing())return;const s=t.getSelectedId(),c=o();if(c){if(hi(r)&&!r.shiftKey){if(r.key==="d"||r.key==="D"){const b=(u=t.defaultTargetId)==null?void 0:u.call(t);s&&s!==b&&(r.preventDefault(),t.onDuplicate(s));return}if(r.key==="c"||r.key==="C"){const b=t.getSelectedIds();b.length>0&&(r.preventDefault(),t.onCopy(b));return}if(r.key==="x"||r.key==="X"){const b=t.getSelectedIds();b.length>0&&(r.preventDefault(),t.onCut(b));return}if(r.key==="v"||r.key==="V"){if(!t.hasClipboard())return;r.preventDefault();const b=t.getSelectedIds();t.onPaste(b.length>0?b[0]:null);return}if(r.key==="z"||r.key==="Z"){r.preventDefault(),t.onUndo();return}if(r.key==="y"||r.key==="Y"){r.preventDefault(),t.onRedo();return}if(r.key==="Home"){r.preventDefault(),t.onSelectRoot();return}}if(hi(r)&&r.shiftKey&&(r.key==="Z"||r.key==="z")){r.preventDefault(),t.onRedo();return}if(r.key==="Tab")r.preventDefault(),t.onAddChild(c);else if(r.key==="Enter")if(r.preventDefault(),r.shiftKey){const b=(d=t.defaultTargetId)==null?void 0:d.call(t);s&&s!==b&&t.onAddSiblingBefore(s)}else t.onAddSibling(c);else(r.key==="Delete"||r.key==="Backspace")&&s&&s!==((g=t.defaultTargetId)==null?void 0:g.call(t))?(r.preventDefault(),t.onRemove(s)):r.key==="F2"&&s?(r.preventDefault(),t.onStartEdit(s)):r.key==="Escape"?(r.preventDefault(),t.onClearSelection()):r.key==="ArrowDown"?(r.preventDefault(),t.onNavigate(0,1)):r.key==="ArrowUp"?(r.preventDefault(),t.onNavigate(0,-1)):r.key==="ArrowRight"?(r.preventDefault(),t.onNavigate(1,0)):r.key==="ArrowLeft"&&(r.preventDefault(),t.onNavigate(-1,0))}}e.onMounted(()=>{window.addEventListener("keydown",n)}),e.onBeforeUnmount(()=>{window.removeEventListener("keydown",n)})}function Ja(t=100){const o=e.ref([]);let n=-1;function r(){return n>0}function l(){return n<o.value.length-1}function s(g){const b=JSON.stringify(g);for(n<o.value.length-1&&(o.value=o.value.slice(0,n+1)),o.value.push(b),n=o.value.length-1;o.value.length>t;)o.value.shift(),n--}function c(){return r()?(n--,JSON.parse(o.value[n])):null}function u(){return l()?(n++,JSON.parse(o.value[n])):null}function d(){o.value=[],n=-1}return{canUndo:r,canRedo:l,record:s,undo:c,redo:u,reset:d}}const Qa={1:"#ef4444",2:"#f97316",3:"#f59e0b",4:"#eab308",5:"#84cc16",6:"#22c55e",7:"#14b8a6",8:"#3b82f6",9:"#6366f1"},es={label:"优先级",markers:Array.from({length:9},(t,o)=>{const n=o+1,r=Qa[n];return{id:`priority-${n}`,label:`优先级 ${n}`,svg:`<circle cx="12" cy="12" r="10" fill="${r}"/><text x="12" y="16" text-anchor="middle" font-size="12" font-weight="700" fill="#fff" font-family="sans-serif">${n}</text>`}})};function ts(t){if(t===0)return'<circle cx="12" cy="12" r="10" fill="none" stroke="#94a3b8" stroke-width="2"/>';if(t===100)return'<circle cx="12" cy="12" r="10" fill="#22c55e"/>';const o=t/100*2*Math.PI,n=12+10*Math.sin(o),r=12-10*Math.cos(o);return`<circle cx="12" cy="12" r="10" fill="none" stroke="#e2e8f0" stroke-width="2"/><path d="M 12 12 L 12 2 A 10 10 0 ${t>50?1:0} 1 ${n.toFixed(2)} ${r.toFixed(2)} Z" fill="#3b82f6"/><circle cx="12" cy="12" r="10" fill="none" stroke="#cbd5e1" stroke-width="1"/>`}const ns={label:"进度",markers:[0,25,50,75,100].map(t=>({id:`progress-${t}`,label:`进度 ${t}%`,svg:ts(t)}))},os={label:"旗帜",markers:[{id:"flag-red",label:"红旗",color:"#ef4444"},{id:"flag-orange",label:"橙旗",color:"#f97316"},{id:"flag-yellow",label:"黄旗",color:"#eab308"},{id:"flag-green",label:"绿旗",color:"#22c55e"},{id:"flag-blue",label:"蓝旗",color:"#3b82f6"},{id:"flag-gray",label:"灰旗",color:"#94a3b8"}].map(t=>({id:t.id,label:t.label,svg:`<path d="M6 3 V21" stroke="#475569" stroke-width="2" stroke-linecap="round"/><path d="M6 4 H18 L15 7 L18 10 H6 Z" fill="${t.color}" stroke="${t.color}" stroke-width="1" stroke-linejoin="round"/>`}))},pr=[es,ns,os,{label:"星标",markers:[{id:"star",label:"星标",svg:'<path d="M12 2 L14.5 8.5 L21 9 L16 13.5 L17.5 20 L12 16.5 L6.5 20 L8 13.5 L3 9 L9.5 8.5 Z" fill="#f59e0b" stroke="#f59e0b" stroke-width="1" stroke-linejoin="round"/>'},{id:"star-half",label:"半星",svg:'<path d="M12 2 L14.5 8.5 L21 9 L16 13.5 L17.5 20 L12 16.5 L6.5 20 L8 13.5 L3 9 L9.5 8.5 Z" fill="#e2e8f0" stroke="#f59e0b" stroke-width="1.5" stroke-linejoin="round"/><path d="M12 2 L12 16.5 L6.5 20 L8 13.5 L3 9 L9.5 8.5 Z" fill="#f59e0b" stroke="none"/>'}]},{label:"其他",markers:[{id:"smile",label:"微笑",svg:'<circle cx="12" cy="12" r="10" fill="#fef3c7" stroke="#f59e0b" stroke-width="1.5"/><circle cx="9" cy="10" r="1.2" fill="#92400e"/><circle cx="15" cy="10" r="1.2" fill="#92400e"/><path d="M8 14 Q12 17 16 14" stroke="#92400e" stroke-width="1.5" fill="none" stroke-linecap="round"/>'},{id:"people",label:"人员",svg:'<circle cx="9" cy="8" r="2.5" fill="#3b82f6"/><circle cx="16" cy="8" r="2.5" fill="#3b82f6"/><path d="M4 19 C4 15 6 13 9 13 C12 13 14 15 14 19" fill="#3b82f6"/><path d="M14 19 C14 15.5 15.5 13.5 17.5 13.5 C19.5 13.5 21 15.5 21 19" fill="#3b82f6"/>'},{id:"arrow-up",label:"上箭头",svg:'<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M12 17 V7 M8 11 L12 7 L16 11" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>'},{id:"arrow-down",label:"下箭头",svg:'<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M12 7 V17 M8 13 L12 17 L16 13" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>'},{id:"arrow-right",label:"右箭头",svg:'<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M7 12 H17 M13 8 L17 12 L13 16" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>'},{id:"arrow-left",label:"左箭头",svg:'<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M17 12 H7 M11 8 L7 12 L11 16" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>'}]}],Bo={};for(const t of pr)for(const o of t.markers)Bo[o.id]=o;function rs(t){return Bo[t]}function Io(t){var o;return((o=Bo[t])==null?void 0:o.svg)??""}function bi(t){var o;return((o=Bo[t])==null?void 0:o.label)??t}function gr(t){let o=0;for(let r=0;r<t.length;r++)o=(o<<5)-o+t.charCodeAt(r),o|=0;const n=Math.abs(o)%360;return{background:`hsl(${n}, 85%, 92%)`,borderColor:`hsl(${n}, 60%, 70%)`,color:`hsl(${n}, 55%, 30%)`}}const is={key:5,class:"zm-marker-picker"},ls={class:"zm-marker-group-label"},as={class:"zm-marker-grid"},ss=["title","onClick","innerHTML"],cs=e.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},nodeMarkers:{default:()=>[]},nodeTags:{default:()=>[]}},emits:["pickImage","setLink","removeLink","editNote","removeNote","removeImage","addCode","editCode","removeCode","addTable","editTable","removeTable","toggleMarker","clearMarkers","addTag","removeTags","close"],setup(t,{emit:o}){const n=t,r=o,l=e.computed(()=>{let E=n.x+2,k=n.y+2;if(n.container){const m=n.container.getBoundingClientRect(),B=180,K=4+(3+(n.hasImage?1:0)+(n.hasLink?1:0)+(n.hasNote?1:0)+1+(n.hasCode?1:0)+1+(n.hasTable?1:0))*28;E+B>m.right&&(E=Math.max(m.left+4,n.x-B-2)),k+K>m.bottom&&(k=Math.max(m.top+4,n.y-K-2)),E<m.left+2&&(E=m.left+2),k<m.top+2&&(k=m.top+2)}return{left:E,top:k}}),s=e.computed(()=>n.hasImage),c=e.computed(()=>n.hasLink),u=e.computed(()=>n.hasNote),d=e.computed(()=>n.nodeMarkers.length>0),g=e.computed(()=>n.nodeTags.length>0),b=e.ref(!1);function w(){b.value=!b.value}function N(E){return n.nodeMarkers.includes(E)}function $(E){r("toggleMarker",E)}function M(E){const k=E.target;k&&k.closest(".zm-node-menu")||r("close")}function P(E){E.key==="Escape"&&r("close")}function I(){r("close")}window.addEventListener("mousedown",M,!0),window.addEventListener("keydown",P,!0),window.addEventListener("wheel",I,!0),window.addEventListener("scroll",I,!0),e.onBeforeUnmount(()=>{window.removeEventListener("mousedown",M,!0),window.removeEventListener("keydown",P,!0),window.removeEventListener("wheel",I,!0),window.removeEventListener("scroll",I,!0)});function C(E){E(),r("close")}return(E,k)=>(e.openBlock(),e.createElementBlock("div",{class:"zm-node-menu",style:e.normalizeStyle({left:l.value.left+"px",top:l.value.top+"px"}),onContextmenu:k[13]||(k[13]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[0]||(k[0]=e.withModifiers(m=>C(()=>r("pickImage")),["stop"]))},[e.createVNode(be,{name:"image",size:13}),e.createElementVNode("span",null,e.toDisplayString(s.value?"替换图片":"添加图片"),1)]),s.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-node-menu-item",onClick:k[1]||(k[1]=e.withModifiers(m=>C(()=>r("removeImage")),["stop"]))},[e.createVNode(be,{name:"x",size:13}),k[14]||(k[14]=e.createElementVNode("span",null,"移除图片",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[2]||(k[2]=e.withModifiers(m=>C(()=>r("setLink")),["stop"]))},[e.createVNode(be,{name:"link",size:13}),e.createElementVNode("span",null,e.toDisplayString(c.value?"编辑链接":"添加链接"),1)]),c.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-node-menu-item",onClick:k[3]||(k[3]=e.withModifiers(m=>C(()=>r("removeLink")),["stop"]))},[e.createVNode(be,{name:"x",size:13}),k[15]||(k[15]=e.createElementVNode("span",null,"移除链接",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[4]||(k[4]=e.withModifiers(m=>C(()=>r("addCode")),["stop"]))},[k[16]||(k[16]=e.createElementVNode("span",{class:"zm-node-menu-icon zm-node-menu-icon-code","aria-hidden":"true"},"{ }",-1)),e.createElementVNode("span",null,e.toDisplayString(t.hasCode?"编辑代码块":"添加代码块"),1)]),t.hasCode?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-node-menu-item",onClick:k[5]||(k[5]=e.withModifiers(m=>C(()=>r("removeCode")),["stop"]))},[e.createVNode(be,{name:"x",size:13}),k[17]||(k[17]=e.createElementVNode("span",null,"移除代码块",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[6]||(k[6]=e.withModifiers(m=>C(()=>r("addTable")),["stop"]))},[k[18]||(k[18]=e.createElementVNode("span",{class:"zm-node-menu-icon zm-node-menu-icon-table","aria-hidden":"true"},"▦",-1)),e.createElementVNode("span",null,e.toDisplayString(t.hasTable?"编辑表格":"添加表格"),1)]),t.hasTable?(e.openBlock(),e.createElementBlock("button",{key:3,class:"zm-node-menu-item",onClick:k[7]||(k[7]=e.withModifiers(m=>C(()=>r("removeTable")),["stop"]))},[e.createVNode(be,{name:"x",size:13}),k[19]||(k[19]=e.createElementVNode("span",null,"移除表格",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[8]||(k[8]=e.withModifiers(m=>C(()=>r("editNote")),["stop"]))},[e.createVNode(be,{name:"note",size:13}),e.createElementVNode("span",null,e.toDisplayString(u.value?"编辑笔记":"添加笔记"),1)]),u.value?(e.openBlock(),e.createElementBlock("button",{key:4,class:"zm-node-menu-item",onClick:k[9]||(k[9]=e.withModifiers(m=>C(()=>r("removeNote")),["stop"]))},[e.createVNode(be,{name:"x",size:13}),k[20]||(k[20]=e.createElementVNode("span",null,"移除笔记",-1))])):e.createCommentVNode("",!0),k[25]||(k[25]=e.createElementVNode("div",{class:"zm-node-menu-divider"},null,-1)),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:e.withModifiers(w,["stop"])},[k[21]||(k[21]=e.createElementVNode("span",{class:"zm-node-menu-icon","aria-hidden":"true"},"⚑",-1)),k[22]||(k[22]=e.createElementVNode("span",null,"标记图标",-1)),e.createElementVNode("span",{class:e.normalizeClass(["zm-node-menu-arrow",{"is-open":b.value}])},"›",2)]),b.value?(e.openBlock(),e.createElementBlock("div",is,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(pr),m=>(e.openBlock(),e.createElementBlock("div",{key:m.label,class:"zm-marker-group"},[e.createElementVNode("div",ls,e.toDisplayString(m.label),1),e.createElementVNode("div",as,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.markers,B=>(e.openBlock(),e.createElementBlock("button",{key:B.id,class:e.normalizeClass(["zm-marker-cell",{"is-active":N(B.id)}]),title:B.label,onClick:e.withModifiers(x=>$(B.id),["stop"]),innerHTML:'<svg viewBox="0 0 24 24" width="20" height="20">'+e.unref(Io)(B.id)+"</svg>"},null,10,ss))),128))])]))),128)),d.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-marker-clear",onClick:k[10]||(k[10]=e.withModifiers(m=>r("clearMarkers"),["stop"]))}," 清除所有标记 ")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[11]||(k[11]=e.withModifiers(m=>C(()=>r("addTag")),["stop"]))},[k[23]||(k[23]=e.createElementVNode("span",{class:"zm-node-menu-icon","aria-hidden":"true"},"#",-1)),e.createElementVNode("span",null,e.toDisplayString(g.value?"编辑标签":"添加标签"),1)]),g.value?(e.openBlock(),e.createElementBlock("button",{key:6,class:"zm-node-menu-item",onClick:k[12]||(k[12]=e.withModifiers(m=>C(()=>r("removeTags")),["stop"]))},[e.createVNode(be,{name:"x",size:13}),k[24]||(k[24]=e.createElementVNode("span",null,"移除标签",-1))])):e.createCommentVNode("",!0)],36))}}),ds=e.defineComponent({__name:"CanvasContextMenu",props:{x:{},y:{},container:{}},emits:["openSettings","openData","openImport","exportPng","exportSvg","close"],setup(t,{emit:o}){const n=t,r=o,l=e.computed(()=>{let C=n.x+2,E=n.y+2;if(n.container){const k=n.container.getBoundingClientRect(),m=160,B=4+4*28+5;C+m>k.right&&(C=Math.max(k.left+4,n.x-m-2)),E+B>k.bottom&&(E=Math.max(k.top+4,n.y-B-2)),C<k.left+2&&(C=k.left+2),E<k.top+2&&(E=k.top+2)}return{left:C,top:E}}),s=e.ref(null),c=e.ref(null),u=e.ref(null),d=e.computed(()=>{const C=s.value==="import"?c.value:s.value==="export"?u.value:null;if(!C)return{left:"-9999px",top:"-9999px",display:"none"};const E=C.getBoundingClientRect(),k=window.innerWidth,m=window.innerHeight,B=176,x=4+3*28;let K=E.right;K+B>k-4&&(K=Math.max(4,E.left-B));let Y=E.top-4;return Y+x>m-4&&(Y=Math.max(4,m-x-4)),{left:K+"px",top:Y+"px",display:"block"}});let g=null,b=null;function w(C){b&&(clearTimeout(b),b=null),g=setTimeout(()=>{s.value=C},60)}function N(){g&&(clearTimeout(g),g=null),b=setTimeout(()=>{s.value=null},120)}e.onBeforeUnmount(()=>{g&&clearTimeout(g),b&&clearTimeout(b)});function $(C){const E=C.target;E&&E.closest(".zm-canvas-menu")||r("close")}function M(C){C.key==="Escape"&&r("close")}function P(){r("close")}window.addEventListener("mousedown",$,!0),window.addEventListener("keydown",M,!0),window.addEventListener("wheel",P,!0),window.addEventListener("scroll",P,!0),e.onBeforeUnmount(()=>{window.removeEventListener("mousedown",$,!0),window.removeEventListener("keydown",M,!0),window.removeEventListener("wheel",P,!0),window.removeEventListener("scroll",P,!0)});function I(C){C(),r("close")}return(C,E)=>(e.openBlock(),e.createElementBlock("div",{class:"zm-canvas-menu",style:e.normalizeStyle({left:l.value.left+"px",top:l.value.top+"px"}),onContextmenu:E[11]||(E[11]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:E[0]||(E[0]=e.withModifiers(k=>I(()=>r("openData")),["stop"]))},[e.createVNode(be,{name:"database",size:13,stroke:1.6}),E[12]||(E[12]=e.createElementVNode("span",null,"查看数据",-1))]),e.createElementVNode("div",{ref_key:"importItemRef",ref:c,class:e.normalizeClass(["zm-canvas-menu-item zm-canvas-menu-item-has-submenu",{"is-open":s.value==="import"}]),onMouseenter:E[5]||(E[5]=k=>w("import")),onMouseleave:N},[e.createVNode(be,{name:"import",size:13,stroke:1.6}),E[16]||(E[16]=e.createElementVNode("span",null,"导入",-1)),E[17]||(E[17]=e.createElementVNode("svg",{class:"zm-canvas-menu-caret",width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[e.createElementVNode("polyline",{points:"2.5 1.8 5.2 4 2.5 6.2"})],-1)),s.value==="import"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-canvas-submenu",style:e.normalizeStyle(d.value),onMouseenter:E[4]||(E[4]=k=>w("import")),onMouseleave:N},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:E[1]||(E[1]=e.withModifiers(k=>I(()=>r("openImport","markdown")),["stop"]))},[e.createVNode(be,{name:"markdown",size:13,stroke:1.6}),E[13]||(E[13]=e.createElementVNode("span",null,"Markdown 导入",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:E[2]||(E[2]=e.withModifiers(k=>I(()=>r("openImport","json")),["stop"]))},[e.createVNode(be,{name:"json",size:13,stroke:1.6}),E[14]||(E[14]=e.createElementVNode("span",null,"JSON 文件导入",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:E[3]||(E[3]=e.withModifiers(k=>I(()=>r("openImport","txt")),["stop"]))},[e.createVNode(be,{name:"txt",size:13,stroke:1.6}),E[15]||(E[15]=e.createElementVNode("span",null,"TXT 文件导入",-1))])],36)):e.createCommentVNode("",!0)],34),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:E[6]||(E[6]=e.withModifiers(k=>I(()=>r("openSettings")),["stop"]))},[e.createVNode(be,{name:"settings",size:13,stroke:1.6}),E[18]||(E[18]=e.createElementVNode("span",null,"设置",-1))]),E[23]||(E[23]=e.createElementVNode("div",{class:"zm-canvas-menu-divider"},null,-1)),e.createElementVNode("div",{ref_key:"exportItemRef",ref:u,class:e.normalizeClass(["zm-canvas-menu-item zm-canvas-menu-item-has-submenu",{"is-open":s.value==="export"}]),onMouseenter:E[10]||(E[10]=k=>w("export")),onMouseleave:N},[e.createVNode(be,{name:"export",size:13,stroke:1.6}),E[21]||(E[21]=e.createElementVNode("span",null,"导出",-1)),E[22]||(E[22]=e.createElementVNode("svg",{class:"zm-canvas-menu-caret",width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[e.createElementVNode("polyline",{points:"2.5 1.8 5.2 4 2.5 6.2"})],-1)),s.value==="export"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-canvas-submenu",style:e.normalizeStyle(d.value),onMouseenter:E[9]||(E[9]=k=>w("export")),onMouseleave:N},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:E[7]||(E[7]=e.withModifiers(k=>I(()=>r("exportPng")),["stop"]))},[e.createVNode(be,{name:"image",size:13,stroke:1.6}),E[19]||(E[19]=e.createElementVNode("span",null,"导出 PNG",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:E[8]||(E[8]=e.withModifiers(k=>I(()=>r("exportSvg")),["stop"]))},[e.createVNode(be,{name:"svg-export",size:13,stroke:1.6}),E[20]||(E[20]=e.createElementVNode("span",null,"导出 SVG",-1))])],36)):e.createCommentVNode("",!0)],34)],36))}}),us=["aria-hidden"],fs=["aria-hidden"],ms={key:0,class:"zm-drawer-header"},ps={key:0,class:"zm-drawer-title"},gs={class:"zm-drawer-body"},hs=["aria-hidden"],bs={key:0,class:"zm-drawer-header"},ks={key:0,class:"zm-drawer-title"},ys={class:"zm-drawer-body"},Mt=e.defineComponent({__name:"Drawer",props:{side:{default:"left"},width:{default:320},open:{type:Boolean,default:!0},title:{default:""},scope:{default:"page"},closable:{type:Boolean,default:!0},closeOnBackdrop:{type:Boolean,default:!0}},emits:["update:open"],setup(t,{emit:o}){const n=o;function r(){n("update:open",!1)}function l(){n("update:open",!1)}return(s,c)=>t.scope==="canvas"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.Transition,{name:"zm-fade"},{default:e.withCtx(()=>[t.open?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-drawer-canvas-backdrop","aria-hidden":!t.open,onClick:c[0]||(c[0]=u=>t.closeOnBackdrop&&l())},null,8,us)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:t.side==="left"?"zm-slide-left":"zm-slide-right"},{default:e.withCtx(()=>[t.open?(e.openBlock(),e.createElementBlock("aside",{key:0,class:e.normalizeClass(["zm-drawer zm-drawer--canvas",["zm-drawer--"+t.side]]),style:e.normalizeStyle({width:t.width+"px"}),"aria-hidden":!t.open},[t.title||s.$slots.header?(e.openBlock(),e.createElementBlock("div",ms,[t.title?(e.openBlock(),e.createElementBlock("h3",ps,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.renderSlot(s.$slots,"header"),t.closable?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-drawer-close",title:"关闭",onClick:r},[...c[1]||(c[1]=[e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},[e.createElementVNode("path",{d:"M6 6 L18 18 M18 6 L6 18"})],-1)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",gs,[e.renderSlot(s.$slots,"default")])],14,fs)):e.createCommentVNode("",!0)]),_:3},8,["name"])],64)):(e.openBlock(),e.createBlock(e.Transition,{key:1,name:"zm-drawer"},{default:e.withCtx(()=>[t.open?(e.openBlock(),e.createElementBlock("aside",{key:0,class:e.normalizeClass(["zm-drawer",["zm-drawer--"+t.side,{"is-open":t.open}]]),style:e.normalizeStyle({width:t.width+"px"}),"aria-hidden":!t.open},[t.title||s.$slots.header?(e.openBlock(),e.createElementBlock("div",bs,[t.title?(e.openBlock(),e.createElementBlock("h3",ks,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.renderSlot(s.$slots,"header"),t.closable?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-drawer-close",title:"关闭",onClick:r},[...c[2]||(c[2]=[e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},[e.createElementVNode("path",{d:"M6 6 L18 18 M18 6 L6 18"})],-1)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",ys,[e.renderSlot(s.$slots,"default")])],14,hs)):e.createCommentVNode("",!0)]),_:3}))}}),Es={class:"zm-outline-root"},xs={class:"zm-outline-search"},ws={key:0,class:"zm-outline-search-count"},Ns={key:1,class:"zm-outline-search-count zm-outline-search-empty"},Ss={class:"zm-outline-actions"},Ts={width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Cs={key:0,x:"9",y:"9",width:"13",height:"13",rx:"2"},As={key:1,d:"M5 12 L10 17 L19 7"},_s={class:"zm-outline"},Ms=["data-outline-id","onClick","onDblclick","onDragstart","onDragover","onDragleave","onDrop"],vs=["title","onClick"],Rs={width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round"},Bs={key:0,points:"6 9 12 15 18 9"},Is={key:1,points:"9 6 15 12 9 18"},zs={key:1,class:"zm-outline-dot"},Os={class:"zm-outline-index"},Ls={key:3,class:"zm-outline-text"},Ds=["onClick"],Vs=["src"],$s=["onClick"],Ps=["src"],Us=["title","onClick"],Fs={width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Hs={key:0,x:"9",y:"9",width:"13",height:"13",rx:"2"},Ws={key:1,d:"M5 12 L10 17 L19 7"},zo=e.defineComponent({__name:"Outline",props:{data:{},selectedId:{default:null},collapsedIds:{default:()=>new Set},readonly:{type:Boolean,default:!1}},emits:["select","toggleCollapse","edit","addChild","addSibling","move"],setup(t,{emit:o}){const n=t,r=o,l=e.ref(""),s=e.ref(null),c=e.ref(-1),u=e.computed(()=>{const p=l.value.trim().toLowerCase();if(!p)return new Set;const L=new Set,V=X=>{var se;(X.text.toLowerCase().includes(p)||(se=X.note)!=null&&se.text&&X.note.text.toLowerCase().includes(p))&&L.add(X.id);for(const ge of X.children)V(ge)};return V(n.data),L}),d=e.computed(()=>{if(u.value.size===0)return new Set;const p=new Set,L=V=>{let X=u.value.has(V.id);for(const se of V.children)L(se)&&(X=!0);return X&&p.add(V.id),X};return L(n.data),p}),g=e.computed(()=>{const p=[],L=V=>{u.value.has(V.id)&&p.push(V.id);for(const X of V.children)L(X)};return L(n.data),p}),b=e.computed(()=>l.value.trim().length>0),w=e.computed(()=>{const p=[],L=d.value,V=(X,se,ge)=>{if(b.value&&!L.has(X.id))return;const Ge=X.children.length>0,Pe=b.value?!1:n.collapsedIds.has(X.id);p.push({id:X.id,text:X.text||"(无标题)",depth:se,siblingIndex:ge,hasChildren:Ge,collapsed:Pe,node:X}),Ge&&!Pe&&X.children.forEach((Ze,je)=>V(Ze,se+1,je))};return V(n.data,0,0),p});function N(){c.value=g.value.length>0?0:-1}function $(){const p=g.value;p.length!==0&&(c.value=(c.value+1)%p.length,I(c.value))}function M(){const p=g.value;p.length!==0&&(c.value=(c.value-1+p.length)%p.length,I(c.value))}function P(p){p.key==="Enter"?(p.preventDefault(),p.shiftKey?M():$()):p.key==="Escape"&&(p.preventDefault(),l.value="",c.value=-1)}function I(p){const L=g.value[p];if(!L)return;const V=w.value.find(X=>X.id===L);V&&r("select",V.node),e.nextTick(()=>{const X=document.querySelector(`[data-outline-id="${L}"]`);X==null||X.scrollIntoView({block:"nearest",behavior:"smooth"})})}function C(){l.value="",c.value=-1}e.onMounted(()=>{e.nextTick(()=>{var p;return(p=s.value)==null?void 0:p.focus()})});const E=e.ref(null),k=e.ref("");let m=null;function B(p){n.readonly||(E.value=p.id,k.value=p.text,e.nextTick(()=>{m=document.querySelector(".zm-outline-input"),m==null||m.focus(),m==null||m.select()}))}function x(){E.value!=null&&(r("edit",{id:E.value,text:k.value.trim()||"(无标题)"}),K())}function K(){E.value=null,k.value="",m=null}function Y(p){p.key==="Enter"?(p.preventDefault(),x()):p.key==="Escape"&&(p.preventDefault(),K())}e.onBeforeUnmount(K);const ee=e.ref(null),ae=e.ref(null),re=e.ref(null);function q(p,L){if(n.readonly){p.preventDefault();return}ee.value={id:L.id,text:L.text},p.dataTransfer&&(p.dataTransfer.effectAllowed="move",p.dataTransfer.setData("text/plain",L.id))}function Q(){ee.value=null,ae.value=null,re.value=null}function ie(p,L){if(!ee.value)return;p.preventDefault(),p.dataTransfer&&(p.dataTransfer.dropEffect="move");const V=F(p);ae.value=L.id,re.value=V}function z(p){ae.value===p.id&&(ae.value=null,re.value=null)}function A(p,L){p.preventDefault();const V=ee.value;if(!V)return;const X=F(p);V.id!==L.id&&r("move",{srcId:V.id,targetId:L.id,position:X}),Q()}function F(p,L){const X=p.currentTarget.getBoundingClientRect(),se=p.clientY-X.top,ge=X.height;return se<ge*.3?"before":se>ge*.7?"after":"child"}const U=e.ref(null);let G=null;async function le(p){try{return await navigator.clipboard.writeText(p),!0}catch{const L=document.createElement("textarea");L.value=p,document.body.appendChild(L),L.select();let V=!1;try{V=document.execCommand("copy")}finally{document.body.removeChild(L)}return V}}async function Ne(p,L,V){p.stopPropagation(),await le(L)&&(U.value=V,G&&clearTimeout(G),G=setTimeout(()=>U.value=null,1200))}const _e=e.computed(()=>{const p=[],L=(V,X)=>{const se=" ".repeat(X),ge=X===0?"":"- ";p.push(se+ge+(V.text||""));for(const Ge of V.children)L(Ge,X+1)};return L(n.data,0),p.join(`
14
+ `)}),Re=e.ref(!1);let xe=null;async function y(){await le(_e.value)&&(Re.value=!0,xe&&clearTimeout(xe),xe=setTimeout(()=>Re.value=!1,1200))}return(p,L)=>(e.openBlock(),e.createElementBlock("div",Es,[e.createElementVNode("div",xs,[L[3]||(L[3]=e.createElementVNode("svg",{class:"zm-outline-search-icon",width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"}),e.createElementVNode("line",{x1:"20",y1:"20",x2:"16",y2:"16"})],-1)),e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:s,"onUpdate:modelValue":L[0]||(L[0]=V=>l.value=V),type:"text",class:"zm-outline-search-input",placeholder:"搜索节点… (Enter 下一个, Shift+Enter 上一个)",onInput:N,onKeydown:P},null,544),[[e.vModelText,l.value]]),g.value.length>0?(e.openBlock(),e.createElementBlock("span",ws,e.toDisplayString(c.value+1)+"/"+e.toDisplayString(g.value.length),1)):b.value?(e.openBlock(),e.createElementBlock("span",Ns,"无结果")):e.createCommentVNode("",!0),l.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-outline-search-clear",title:"清除搜索",onClick:C},"×")):e.createCommentVNode("",!0)]),e.createElementVNode("div",Ss,[e.createElementVNode("button",{class:e.normalizeClass(["zm-outline-action-btn",{"is-success":Re.value}]),title:"复制完整大纲为纯文本",onClick:y},[(e.openBlock(),e.createElementBlock("svg",Ts,[Re.value?(e.openBlock(),e.createElementBlock("path",As)):(e.openBlock(),e.createElementBlock("rect",Cs)),L[4]||(L[4]=e.createElementVNode("path",{d:"M5 15 H4 a2 2 0 0 1 -2 -2 V4 a2 2 0 0 1 2 -2 h9 a2 2 0 0 1 2 2 v1"},null,-1))])),e.createElementVNode("span",null,e.toDisplayString(Re.value?"已复制":"复制大纲"),1)],2)]),e.createElementVNode("ul",_s,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.id,"data-outline-id":V.id,class:e.normalizeClass(["zm-outline-row",{"is-selected":V.id===t.selectedId,"is-root":V.depth===0,"is-editing":E.value===V.id,"is-search-hit":u.value.has(V.id),"is-search-current":g.value[c.value]===V.id,"is-drag-over-before":ae.value===V.id&&re.value==="before","is-drag-over-after":ae.value===V.id&&re.value==="after","is-drag-over-child":ae.value===V.id&&re.value==="child"}]),style:e.normalizeStyle({paddingLeft:12+V.depth*16+"px"}),draggable:"true",onClick:X=>r("select",V.node),onDblclick:X=>B(V),onDragstart:X=>q(X,V),onDragend:Q,onDragover:X=>ie(X,V),onDragleave:()=>z(V),onDrop:X=>A(X,V)},[V.hasChildren?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-outline-toggle",title:V.collapsed?"展开":"折叠",onClick:e.withModifiers(X=>r("toggleCollapse",V.id),["stop"])},[(e.openBlock(),e.createElementBlock("svg",Rs,[V.collapsed?(e.openBlock(),e.createElementBlock("polyline",Is)):(e.openBlock(),e.createElementBlock("polyline",Bs))]))],8,vs)):(e.openBlock(),e.createElementBlock("span",zs)),e.createElementVNode("span",Os,e.toDisplayString(V.siblingIndex+1)+".",1),E.value===V.id?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,"onUpdate:modelValue":L[1]||(L[1]=X=>k.value=X),class:"zm-outline-input",onBlur:x,onKeydown:Y,onClick:L[2]||(L[2]=e.withModifiers(()=>{},["stop"]))},null,544)),[[e.vModelText,k.value]]):(e.openBlock(),e.createElementBlock("span",Ls,e.toDisplayString(V.text),1)),n.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:4,class:"zm-outline-row-action",title:"添加同级",onClick:e.withModifiers(X=>r("addSibling",V.id),["stop"])},[e.createElementVNode("img",{src:e.unref(ri),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,Vs)],8,Ds)),n.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:5,class:"zm-outline-row-action",title:"添加子节点",onClick:e.withModifiers(X=>r("addChild",V.id),["stop"])},[e.createElementVNode("img",{src:e.unref(ii),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,Ps)],8,$s)),e.createElementVNode("button",{class:e.normalizeClass(["zm-outline-row-copy",{"is-success":U.value===V.id}]),title:U.value===V.id?"已复制":"复制节点文本",onClick:X=>Ne(X,V.text,V.id)},[(e.openBlock(),e.createElementBlock("svg",Fs,[U.value!==V.id?(e.openBlock(),e.createElementBlock("rect",Hs)):(e.openBlock(),e.createElementBlock("path",Ws)),L[5]||(L[5]=e.createElementVNode("path",{d:"M5 15 H4 a2 2 0 0 1 -2 -2 V4 a2 2 0 0 1 2 -2 h9 a2 2 0 0 1 2 2 v1"},null,-1))]))],10,Us)],46,Ms))),128))])]))}}),Gs={key:0,class:"zm-jtv-root"},js={key:0,class:"zm-jtv-key"},Ks={key:1,class:"zm-jtv-colon"},Ys={key:2,class:"zm-jtv-key zm-jtv-bracket"},qs={key:3,class:"zm-jtv-size"},Xs={key:4,class:"zm-jtv-bracket"},Zs={key:5,class:"zm-jtv-brace"},Js={key:0,class:"zm-jtv-children"},Qs={class:"zm-jtv-key"},ec={key:0,class:"zm-jtv-key"},tc=["src","alt"],nc=["href"],oc=e.defineComponent({__name:"JsonTreeViewer",props:{value:{},keyName:{default:""},isRoot:{type:Boolean,default:!0},path:{default:""},depth:{default:0},query:{default:""},collapsedPaths:{default:()=>new Set}},setup(t){const o=t,n=e.computed(()=>o.value===null?"null":Array.isArray(o.value)?"array":typeof o.value),r=e.computed(()=>n.value==="object"),l=e.computed(()=>n.value==="array");e.computed(()=>!r.value&&!l.value);const s=e.computed(()=>{if(l.value)return`Array(${o.value.length})`;if(r.value){const E=o.value,k=Object.keys(E);return`Object(${k.length} ${k.length===1?"key":"keys"})`}return""}),c=e.computed(()=>l.value?o.value.map((E,k)=>({key:String(k),value:E})):r.value?Object.entries(o.value).map(([E,k])=>({key:E,value:k})):[]),u=e.computed(()=>o.isRoot?"<root>":o.path),d=e.computed(()=>o.collapsedPaths.has(u.value));function g(E,k,m){E!=="<root>"&&(m<2||k===null||typeof k!="object"||o.collapsedPaths.has(E)||o.collapsedPaths.add(E))}o.isRoot||g(u.value,o.value,o.depth);function b(){d.value?o.collapsedPaths.delete(u.value):o.collapsedPaths.add(u.value)}function w(E){return u.value===""?E:`${u.value}.${E}`}function N(E){if(!o.query)return!0;const k=o.query.toLowerCase();return typeof E=="string"?E.toLowerCase().includes(k):E===null?"null".includes(k):String(E).toLowerCase().includes(k)}function $(E){return o.query?E.toLowerCase().includes(o.query.toLowerCase()):!0}function M(E,k){return!o.query||$(E)?!0:k===null||typeof k!="object"?N(k):!0}function P(E){return E===null?"null":typeof E=="string"?E.length>80?`"${E.slice(0,80)}..."`:`"${E}"`:typeof E=="boolean"?E?"true":"false":typeof E=="number"?String(E):typeof E>"u"?"undefined":JSON.stringify(E)}function I(E){if(typeof E!="string")return!1;const k=E.trim();return!!(k.startsWith("data:image/")||/^https?:\/\/.+\.(png|jpe?g|gif|webp|svg|bmp|ico)(\?.*)?$/i.test(k)||/^https?:\/\/.+/i.test(k)&&/\/[^/]+\.(png|jpe?g|gif|webp|svg|bmp|ico)(\?.*)?$/i.test(k))}function C(E){if(!o.query)return null;const k=E.toLowerCase().indexOf(o.query.toLowerCase());return k<0?null:{before:E.slice(0,k),match:E.slice(k,k+o.query.length),after:E.slice(k+o.query.length)}}return(E,k)=>{var B,x,K,Y,ee,ae;const m=e.resolveComponent("JsonTreeViewer",!0);return t.isRoot?(e.openBlock(),e.createElementBlock("div",Gs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,re=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:re.key,class:"zm-jtv-row"},[e.createVNode(m,{"key-name":re.key,value:re.value,path:w(re.key),depth:t.depth+1,query:t.query,"collapsed-paths":t.collapsedPaths,"is-root":!1},null,8,["key-name","value","path","depth","query","collapsed-paths"])])),[[e.vShow,M(re.key,re.value)]])),128))])):r.value||l.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["zm-jtv-branch",{"is-collapsed":d.value}])},[e.createElementVNode("div",{class:"zm-jtv-header",style:e.normalizeStyle({paddingLeft:6+t.depth*12+"px"}),onClick:b},[e.createElementVNode("span",{class:e.normalizeClass(["zm-jtv-toggle",{"is-leaf":!1}])},e.toDisplayString(d.value?"▶":"▼"),1),l.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",js,e.toDisplayString(t.keyName),1)),l.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",Ks,":")),l.value?(e.openBlock(),e.createElementBlock("span",Ys,"[")):e.createCommentVNode("",!0),d.value?(e.openBlock(),e.createElementBlock("span",qs,e.toDisplayString(s.value),1)):e.createCommentVNode("",!0),d.value&&l.value?(e.openBlock(),e.createElementBlock("span",Xs,"]")):e.createCommentVNode("",!0),d.value&&r.value?(e.openBlock(),e.createElementBlock("span",Zs,"}")):e.createCommentVNode("",!0)],4),d.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Js,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,re=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:re.key,class:"zm-jtv-row"},[e.createVNode(m,{"key-name":re.key,value:re.value,path:w(re.key),depth:t.depth+1,query:t.query,"collapsed-paths":t.collapsedPaths,"is-root":!1},null,8,["key-name","value","path","depth","query","collapsed-paths"])])),[[e.vShow,M(re.key,re.value)]])),128))])),!d.value&&l.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"zm-jtv-footer",style:e.normalizeStyle({paddingLeft:6+t.depth*12+"px"})},"]",4)):e.createCommentVNode("",!0),!d.value&&r.value&&!l.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"zm-jtv-footer",style:e.normalizeStyle({paddingLeft:6+t.depth*12+"px"})},"}",4)):e.createCommentVNode("",!0)],2)):(e.openBlock(),e.createElementBlock("div",{key:2,class:"zm-jtv-leaf",style:e.normalizeStyle({paddingLeft:6+t.depth*12+"px"})},[k[2]||(k[2]=e.createElementVNode("span",{class:"zm-jtv-toggle is-leaf"},"·",-1)),e.createElementVNode("span",Qs,e.toDisplayString(t.keyName),1),k[3]||(k[3]=e.createElementVNode("span",{class:"zm-jtv-colon"},":",-1)),$(t.keyName)&&C(t.keyName)?(e.openBlock(),e.createElementBlock("span",ec,[e.createElementVNode("span",null,e.toDisplayString((B=C(t.keyName))==null?void 0:B.before),1),e.createElementVNode("mark",null,e.toDisplayString((x=C(t.keyName))==null?void 0:x.match),1),e.createElementVNode("span",null,e.toDisplayString((K=C(t.keyName))==null?void 0:K.after),1)])):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(["zm-jtv-value",`zm-jtv-${n.value}`])},[C(P(t.value))?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("span",null,e.toDisplayString((Y=C(P(t.value)))==null?void 0:Y.before),1),e.createElementVNode("mark",null,e.toDisplayString((ee=C(P(t.value)))==null?void 0:ee.match),1),e.createElementVNode("span",null,e.toDisplayString((ae=C(P(t.value)))==null?void 0:ae.after),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(P(t.value)),1)],64))],2),I(t.value)?(e.openBlock(),e.createElementBlock("span",{key:1,class:"zm-jtv-thumb-wrap",onClick:k[1]||(k[1]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("img",{class:"zm-jtv-thumb",src:String(t.value),alt:t.keyName,loading:"lazy",referrerpolicy:"no-referrer"},null,8,tc),e.createElementVNode("a",{class:"zm-jtv-thumb-link",href:String(t.value),target:"_blank",rel:"noopener noreferrer",onClick:k[0]||(k[0]=e.withModifiers(()=>{},["stop"]))},"open",8,nc)])):e.createCommentVNode("",!0)],4))}}}),rc={class:"zm-data-panel"},ic={class:"zm-data-header"},lc={class:"zm-data-title"},ac={class:"zm-data-title-meta"},sc={class:"zm-data-toolbar"},cc=["title"],dc={key:0,width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},uc={key:1,width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.4","stroke-linecap":"round","stroke-linejoin":"round"},fc={key:0,class:"zm-data-paste"},mc={class:"zm-data-tabs"},pc=["placeholder"],gc={key:0,class:"zm-data-error"},hc={class:"zm-data-paste-actions"},bc=["disabled"],kc={class:"zm-data-tree"},Oo=e.defineComponent({__name:"DataPanel",props:{data:{},pendingMode:{default:null}},emits:["import","consumed-mode"],setup(t,{emit:o}){const n=t,r=o,l=e.computed(()=>JSON.stringify(n.data,null,2)),s=e.ref(""),c=e.ref(null),u=e.ref(!1),d=e.ref("json"),g=e.ref("idle"),b=e.ref(new Set),w=e.ref("");e.watch(()=>n.pendingMode,k=>{k&&(u.value=!0,d.value=k,r("consumed-mode"))},{immediate:!0});async function N(){try{await navigator.clipboard.writeText(l.value),g.value="copied",setTimeout(()=>g.value="idle",1500)}catch{const k=document.createElement("textarea");k.value=l.value,document.body.appendChild(k),k.select();try{document.execCommand("copy"),g.value="copied",setTimeout(()=>g.value="idle",1500)}finally{document.body.removeChild(k)}}}function $(){const k=new Blob([l.value],{type:"application/json"}),m=URL.createObjectURL(k),B=document.createElement("a");B.href=m,B.download=`${n.data.text||"mindmap"}.json`,B.click(),URL.revokeObjectURL(m)}function M(){c.value=null;const k=s.value.trim();if(k){if(d.value==="markdown"||d.value==="txt"){try{const m=zn(k);r("import",m),s.value="",u.value=!1}catch(m){c.value=(d.value==="txt"?"TXT 解析失败:":"Markdown 解析失败:")+m.message}return}try{const m=JSON.parse(k);if(!m.id||!Array.isArray(m.children)){c.value="JSON 缺少 id 或 children 字段";return}r("import",m),s.value="",u.value=!1}catch(m){c.value="JSON 解析失败:"+m.message}}}function P(k){return 1+k.children.reduce((m,B)=>m+P(B),0)}const I=e.computed(()=>P(n.data)),C=e.computed(()=>l.value.length);function E(){const k=document.createElement("input");k.type="file",k.accept="application/json",k.onchange=()=>{var x;const m=(x=k.files)==null?void 0:x[0];if(!m)return;const B=new FileReader;B.onload=()=>{typeof B.result=="string"&&(s.value=B.result,M())},B.readAsText(m)},k.click()}return(k,m)=>(e.openBlock(),e.createElementBlock("div",rc,[e.createElementVNode("div",ic,[e.createElementVNode("div",lc,[m[8]||(m[8]=e.createElementVNode("span",{class:"zm-data-title-text"},"数据 JSON",-1)),e.createElementVNode("span",ac,e.toDisplayString(I.value)+" 节点 · "+e.toDisplayString(C.value)+" chars",1)])]),e.createElementVNode("div",sc,[e.createElementVNode("button",{class:e.normalizeClass(["zm-data-btn is-icon",{"is-success":g.value==="copied"}]),title:g.value==="copied"?"已复制":"复制 JSON 到剪贴板",onClick:N},[g.value==="idle"?(e.openBlock(),e.createElementBlock("svg",dc,[...m[9]||(m[9]=[e.createElementVNode("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"},null,-1),e.createElementVNode("path",{d:"M5 15 H4 a2 2 0 0 1 -2 -2 V4 a2 2 0 0 1 2 -2 h9 a2 2 0 0 1 2 2 v1"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",uc,[...m[10]||(m[10]=[e.createElementVNode("polyline",{points:"5 12 10 17 19 7"},null,-1)])])),m[11]||(m[11]=e.createElementVNode("span",{class:"zm-data-btn-label"},"复制",-1))],10,cc),e.createElementVNode("button",{class:"zm-data-btn is-icon",title:"导出为 JSON 文件",onClick:$},[...m[12]||(m[12]=[e.createStaticVNode('<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 4 V15"></path><polyline points="7 9 12 4 17 9"></polyline><path d="M4 19 H20"></path></svg><span class="zm-data-btn-label">导出</span>',2)])]),e.createElementVNode("button",{class:"zm-data-btn is-icon",title:"从 JSON 文件导入",onClick:E},[...m[13]||(m[13]=[e.createStaticVNode('<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 15 V4"></path><polyline points="7 9 12 4 17 9"></polyline><path d="M4 19 H20"></path></svg><span class="zm-data-btn-label">导入</span>',2)])]),e.createElementVNode("button",{class:e.normalizeClass(["zm-data-btn is-icon",{"is-active":u.value}]),title:"粘贴 JSON 或 Markdown 替换当前数据",onClick:m[0]||(m[0]=B=>u.value=!u.value)},[...m[14]||(m[14]=[e.createStaticVNode('<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 4 H15 V8 H9 Z"></path><path d="M9 8 H4 V20 H9"></path><path d="M15 8 H20 V20 H15"></path></svg><span class="zm-data-btn-label">粘贴</span>',2)])],2),m[16]||(m[16]=e.createElementVNode("div",{class:"zm-data-toolbar-spacer"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["zm-data-search",{"is-active":w.value.length>0}])},[m[15]||(m[15]=e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"}),e.createElementVNode("line",{x1:"20",y1:"20",x2:"16",y2:"16"})],-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":m[1]||(m[1]=B=>w.value=B),type:"text",placeholder:"过滤 (键 / 值)",spellcheck:"false"},null,512),[[e.vModelText,w.value]]),w.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-data-search-clear",title:"清空过滤",onClick:m[2]||(m[2]=B=>w.value="")},"×")):e.createCommentVNode("",!0)],2)]),u.value?(e.openBlock(),e.createElementBlock("div",fc,[e.createElementVNode("div",mc,[e.createElementVNode("button",{class:e.normalizeClass(["zm-data-tab",{"is-active":d.value==="json"}]),onClick:m[3]||(m[3]=B=>d.value="json")},"JSON",2),e.createElementVNode("button",{class:e.normalizeClass(["zm-data-tab",{"is-active":d.value==="markdown"}]),onClick:m[4]||(m[4]=B=>d.value="markdown")},"Markdown",2)]),e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":m[5]||(m[5]=B=>s.value=B),placeholder:d.value==="json"?"paste a JSON tree to replace current data":"paste markdown - # / ## / ### become nodes",spellcheck:"false"},null,8,pc),[[e.vModelText,s.value]]),c.value?(e.openBlock(),e.createElementBlock("div",gc,e.toDisplayString(c.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",hc,[e.createElementVNode("button",{class:"zm-data-btn is-primary",disabled:!s.value,onClick:M},"应用",8,bc),e.createElementVNode("button",{class:"zm-data-btn",onClick:m[6]||(m[6]=B=>{s.value="",c.value=null})},"清空"),e.createElementVNode("button",{class:"zm-data-btn",onClick:m[7]||(m[7]=B=>u.value=!1)},"关闭")])])):e.createCommentVNode("",!0),e.createElementVNode("div",kc,[e.createVNode(oc,{value:t.data,query:w.value,"collapsed-paths":b.value},null,8,["value","query","collapsed-paths"])]),m[17]||(m[17]=e.createElementVNode("div",{class:"zm-data-footer"},[e.createElementVNode("span",{class:"zm-data-footer-hint"},[e.createTextVNode(" 图片支持 "),e.createElementVNode("code",null,"data:image/..."),e.createTextVNode(" / "),e.createElementVNode("code",null,"https://..."),e.createTextVNode(" / "),e.createElementVNode("code",null,"/imgs/foo.png"),e.createTextVNode(" (同源)。本地 "),e.createElementVNode("code",null,"file://"),e.createTextVNode(" 路径被浏览器拒绝。 ")])],-1))]))}}),yc={class:"zm-md-panel"},Ec={key:0,class:"zm-md-error"},xc={class:"zm-md-split"},wc={class:"zm-md-edit"},Nc={class:"zm-md-preview"},Sc={class:"zm-md-preview-body"},Tc={class:"zm-md-footer"},Cc=["disabled"],Ac=`# flow-mindmap 思维导图
27
15
 
28
16
  [GitHub 仓库](https://github.com/xz333221/flow-mindmap)
29
17
 
@@ -62,77 +50,89 @@ https://github.com/highlightjs/highlight.js/issues/2277`),ae=C,W=F),P===void 0&&
62
50
 
63
51
  ## 开源协议
64
52
  [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0)
65
- `,yr=e.defineComponent({__name:"MarkdownPanel",props:{data:{}},emits:["import"],setup(t,{emit:o}){const n=t,r=o,i=e.ref($n(n.data)),s=e.ref(null),c=e.ref(null),u=e.computed(()=>{try{const B=Vn(i.value||"");return s.value=null,B}catch(B){return s.value=B.message,{id:"preview_fallback",text:i.value||"(空)",children:[]}}}),d=e.computed(()=>Ct(u.value));let g=null;e.watch(i,()=>{g&&clearTimeout(g),g=setTimeout(()=>{var B;return(B=c.value)==null?void 0:B.resetView()},250)});function b(){try{const B=Vn(i.value||"");s.value=null,r("import",B)}catch(B){s.value=B.message}}function w(){i.value=$n(n.data),s.value=null,e.nextTick(()=>{var B;return(B=c.value)==null?void 0:B.resetView()})}function N(){i.value="",s.value=null,e.nextTick(()=>{var B;return(B=c.value)==null?void 0:B.resetView()})}function V(){const B=document.createElement("input");B.type="file",B.accept=".md,text/markdown,text/plain",B.onchange=()=>{var k;const T=(k=B.files)==null?void 0:k[0];if(!T)return;const E=new FileReader;E.onload=()=>{typeof E.result=="string"&&(i.value=E.result,s.value=null,e.nextTick(()=>{var m;return(m=c.value)==null?void 0:m.resetView()}))},E.readAsText(T)},B.click()}function _(){const B=new Blob([i.value],{type:"text/markdown;charset=utf-8"}),T=URL.createObjectURL(B),E=document.createElement("a");E.href=T;const k=(n.data.text||"mindmap").trim()||"mindmap";E.download=`${k}.md`,E.click(),URL.revokeObjectURL(T)}function $(){i.value=Kd,s.value=null,e.nextTick(()=>{var B;return(B=c.value)==null?void 0:B.resetView()})}return(B,T)=>(e.openBlock(),e.createElementBlock("div",$d,[e.createElementVNode("div",{class:"zm-md-toolbar"},[e.createElementVNode("button",{class:"zm-md-btn",title:"从 .md 文件加载",onClick:V},[...T[1]||(T[1]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M12 4 V15"}),e.createElementVNode("polyline",{points:"7 9 12 4 17 9"}),e.createElementVNode("path",{d:"M4 19 H20"})],-1),e.createElementVNode("span",null,"加载 .md",-1)])]),e.createElementVNode("button",{class:"zm-md-btn",title:"把当前导图导出为 .md",onClick:_},[...T[2]||(T[2]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M12 15 V4"}),e.createElementVNode("polyline",{points:"7 9 12 4 17 9"}),e.createElementVNode("path",{d:"M4 19 H20"})],-1),e.createElementVNode("span",null,"导出 .md",-1)])]),T[3]||(T[3]=e.createElementVNode("span",{class:"zm-md-spacer"},null,-1)),e.createElementVNode("button",{class:"zm-md-btn",title:"用示例内容填充",onClick:$},"示例"),e.createElementVNode("button",{class:"zm-md-btn",title:"覆盖为当前导图",onClick:w},"同步"),e.createElementVNode("button",{class:"zm-md-btn",title:"清空",onClick:N},"清空")]),s.value?(e.openBlock(),e.createElementBlock("div",Pd,e.toDisplayString(s.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Fd,[e.createElementVNode("div",Ud,[T[4]||(T[4]=e.createElementVNode("div",{class:"zm-md-pane-header"},[e.createElementVNode("span",null,"Markdown"),e.createElementVNode("span",{class:"zm-md-hint"},"# 根 · ## 一级 · ### 二级 …")],-1)),e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":T[0]||(T[0]=E=>i.value=E),class:"zm-md-textarea",spellcheck:"false",placeholder:"# 标题…"},null,512),[[e.vModelText,i.value]])]),e.createElementVNode("div",Hd,[T[5]||(T[5]=e.createElementVNode("div",{class:"zm-md-pane-header"},[e.createElementVNode("span",null,"导图预览"),e.createElementVNode("span",{class:"zm-md-hint"},"只读")],-1)),e.createElementVNode("div",Wd,[e.createVNode(Fo,{ref_key:"previewRef",ref:c,data:d.value,readonly:"","preview-mode":""},null,8,["data"])])])]),e.createElementVNode("div",Gd,[e.createElementVNode("button",{class:"zm-md-btn is-primary",disabled:!i.value.trim(),onClick:b},"应用到导图",8,jd)])]))}}),Yd={class:"zm-settings-panel"},qd={class:"zm-settings-section"},Xd={class:"zm-settings-field"},Zd={class:"zm-settings-control"},Jd={class:"zm-color-input-wrap"},Qd=["value"],eu={class:"zm-color-input-text"},tu={class:"zm-swatch-row zm-swatch-row--compact"},nu=["title","onClick"],ou={class:"zm-settings-field"},ru=["value"],iu={class:"zm-slider"},lu=["value"],au={class:"zm-settings-field"},su=["value"],cu={class:"zm-slider"},du=["value"],uu={class:"zm-settings-field"},fu={class:"zm-line-style-group"},mu=["title","onClick"],pu=["viewBox"],gu={key:0,d:"M 0 12 C 8 0, 20 0, 28 12",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},hu={key:1,x1:"0",y1:"12",x2:"28",y2:"12",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},bu={class:"zm-line-style-label"},ku={class:"zm-settings-field"},yu={key:0,class:"zm-palette-dropdown"},Eu={class:"zm-settings-field"},xu=["value"],wu={label:"内置配色"},Nu=["value"],Su={key:0,label:"自定义"},Tu=["value"],Cu={key:0,class:"zm-palette-preview-bar"},Au={key:1,class:"zm-palette-custom-editor"},_u=["value"],Mu={class:"zm-palette-custom-actions"},Ru={class:"zm-settings-field"},vu={class:"zm-settings-field"},Bu={class:"zm-settings-preview"},zu={viewBox:"0 0 200 70",width:"100%",height:"70",preserveAspectRatio:"none"},Iu=["x1","y1","x2","y2","stroke","stroke-width"],Ou={key:0,class:"zm-settings-section"},Lu={class:"zm-settings-section-title"},Du={key:0,class:"zm-settings-section-sub"},Vu={class:"zm-settings-field"},$u={class:"zm-settings-value-tag"},Pu={class:"zm-swatch-row"},Fu=["title","onClick"],Uu={class:"zm-swatch zm-swatch--custom",title:"自定义颜色"},Hu=["value"],Wu={class:"zm-settings-field"},Gu={class:"zm-settings-value-tag"},ju={class:"zm-swatch-row"},Ku=["title","onClick"],Yu={class:"zm-swatch zm-swatch--custom",title:"自定义颜色"},qu=["value"],Xu={class:"zm-settings-field"},Zu=["value"],Ju=["value"],Qu={class:"zm-settings-field"},ef=["value"],tf={class:"zm-slider"},nf=["value"],of={class:"zm-settings-section zm-settings-section--actions"},Er=((t,o)=>{const n=t.__vccOpts||t;for(const[r,i]of o)n[r]=i;return n})(e.defineComponent({__name:"SettingsPanel",props:{settings:{},hasSelection:{type:Boolean},selectedNodeText:{},nodeStyle:{}},emits:["update:settings","update:nodeStyle","reset"],setup(t,{emit:o}){const n=t,r=o;function i(v,x){r("update:settings",{[v]:x})}const s=[{value:"curve",label:"圆弧",viewBox:"0 0 28 14"},{value:"straight",label:"直线",viewBox:"0 0 28 14"}],c=[{value:100,label:"100"},{value:200,label:"200"},{value:300,label:"300"},{value:400,label:"400 (常规)"},{value:500,label:"500"},{value:600,label:"600 (半粗)"},{value:700,label:"700 (粗体)"},{value:800,label:"800"},{value:900,label:"900"}];function u(v){r("update:nodeStyle",v)}const d=e.computed(()=>[...Jt,...n.settings.customPalettes]),g=e.reactive({});function b(v){return g[v.id]===void 0&&(g[v.id]=v.colors.join(`
66
- `)),g[v.id]}function w(v){const x=g[v.id]??"",j=Ea(x);if(j.length===0){g[v.id]=v.colors.join(`
67
- `);return}const K=n.settings.customPalettes.map(ne=>ne.id===v.id?{...ne,colors:j}:ne);r("update:settings",{customPalettes:K})}function N(){const v=d.value.find(ce=>ce.id===n.settings.branchPaletteId),x=v?[...v.colors]:[...Jt[0].colors],j="custom-";let K=j+(n.settings.customPalettes.length+1);for(;Jt.some(ce=>ce.id===K)||n.settings.customPalettes.some(ce=>ce.id===K);)K=j+Math.random().toString(36).slice(2,7);const ne={id:K,name:`我的配色 ${n.settings.customPalettes.length+1}`,colors:x};r("update:settings",{customPalettes:[...n.settings.customPalettes,ne],branchPaletteId:K}),g[K]=x.join(`
68
- `)}function V(v){const x=n.settings.customPalettes.filter(K=>K.id!==v.id),j=n.settings.branchPaletteId===v.id?"default":n.settings.branchPaletteId;r("update:settings",{customPalettes:x,...j!==n.settings.branchPaletteId?{branchPaletteId:j}:{}}),delete g[v.id]}const _=["#f87171","#fb923c","#fbbf24","#a3e635","#34d399","#22d3ee","#818cf8","#c084fc","#1e2937","#f8fafc","#94a3b8"],$=["#f8fafc","#ffffff","#e2e8f0","#1e2937","#0f172a","#fef3c7","#dbeafe","#dcfce7","#fce7f3","#f1f5f9"],B=[0,1,2,3],T=["#f87171","#fb923c","#34d399","#818cf8"];function E(v,x,j,K){if(x<=1)return j;const ne=v/(x-1);return j+(K-j)*ne}function k(v,x,j){return v<=0?x:v===1?Math.max(1.5,x*.67):v===2?Math.max(.8,x*.42):j}const m=e.computed(()=>{const v=n.settings.lineWidthStart,x=n.settings.lineWidthEnd,j=n.settings.taperedEdge,K=B.length,ne=8,ce=192,re=d.value.find(ee=>ee.id===n.settings.branchPaletteId),Y=re&&re.colors.length?re.colors:T;return B.map((ee,ie)=>{const z=10+ie*60/(K-1);return{x1:ne,y1:z,x2:ce,y2:z,w:j?k(ee,v,x):E(ee,K,v,x),color:n.settings.rainbowBranch?Y[ie%Y.length]:"#94a3b8"}})});return(v,x)=>{var j,K,ne,ce,re,Y,ee,ie;return e.openBlock(),e.createElementBlock("div",Yd,[e.createElementVNode("section",qd,[x[35]||(x[35]=e.createElementVNode("h4",{class:"zm-settings-section-title"},"画布",-1)),e.createElementVNode("div",Xd,[x[21]||(x[21]=e.createElementVNode("span",{class:"zm-settings-label"},"画布背景色",-1)),e.createElementVNode("div",Zd,[e.createElementVNode("label",Jd,[e.createElementVNode("input",{type:"color",class:"zm-color-input",value:t.settings.canvasBg||"#f8fafc",onInput:x[0]||(x[0]=z=>i("canvasBg",z.target.value))},null,40,Qd),e.createElementVNode("span",eu,e.toDisplayString(t.settings.canvasBg||"默认"),1)])])]),e.createElementVNode("div",tu,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList($,z=>e.createElementVNode("button",{key:"cbg-"+z,class:e.normalizeClass(["zm-swatch",{"is-active":(t.settings.canvasBg||"#f8fafc")===z}]),style:e.normalizeStyle({background:z}),title:z,onClick:C=>i("canvasBg",z)},null,14,nu)),64)),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"恢复默认",onClick:x[1]||(x[1]=z=>i("canvasBg",void 0))},"∅")]),x[36]||(x[36]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",ou,[x[22]||(x[22]=e.createElementVNode("span",{class:"zm-settings-label"},"线条粗端 (根部)",-1)),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"0.2",value:t.settings.lineWidthStart,onChange:x[2]||(x[2]=z=>i("lineWidthStart",parseFloat(z.target.value)||0))},null,40,ru)]),e.createElementVNode("div",iu,[x[23]||(x[23]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"0.4",max:"20",step:"0.2",value:t.settings.lineWidthStart,onInput:x[3]||(x[3]=z=>i("lineWidthStart",parseFloat(z.target.value)))},null,40,lu)]),e.createElementVNode("div",au,[x[24]||(x[24]=e.createElementVNode("span",{class:"zm-settings-label"},"线条细端 (子端)",-1)),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"0.2",value:t.settings.lineWidthEnd,onChange:x[4]||(x[4]=z=>i("lineWidthEnd",parseFloat(z.target.value)||0))},null,40,su)]),e.createElementVNode("div",cu,[x[25]||(x[25]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"0.2",max:"6",step:"0.1",value:t.settings.lineWidthEnd,onInput:x[5]||(x[5]=z=>i("lineWidthEnd",parseFloat(z.target.value)))},null,40,du)]),x[37]||(x[37]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",uu,[x[26]||(x[26]=e.createElementVNode("span",{class:"zm-settings-label"},"线条类型",-1)),e.createElementVNode("div",fu,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(s,z=>e.createElementVNode("button",{key:z.value,class:e.normalizeClass(["zm-line-style-btn",{"is-on":t.settings.lineStyle===z.value}]),title:z.label,onClick:C=>i("lineStyle",z.value)},[(e.openBlock(),e.createElementBlock("svg",{viewBox:z.viewBox,width:"28",height:"14",preserveAspectRatio:"none"},[z.value==="curve"?(e.openBlock(),e.createElementBlock("path",gu)):(e.openBlock(),e.createElementBlock("line",hu))],8,pu)),e.createElementVNode("span",bu,e.toDisplayString(z.label),1)],10,mu)),64))])]),e.createElementVNode("div",ku,[x[28]||(x[28]=e.createElementVNode("span",{class:"zm-settings-label"},"一级分支彩虹色",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.rainbowBranch}]),onClick:x[6]||(x[6]=z=>i("rainbowBranch",!t.settings.rainbowBranch))},[...x[27]||(x[27]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),t.settings.rainbowBranch?(e.openBlock(),e.createElementBlock("div",yu,[e.createElementVNode("div",Eu,[x[29]||(x[29]=e.createElementVNode("span",{class:"zm-settings-label"},"配色方案",-1)),e.createElementVNode("select",{class:"zm-select",value:t.settings.branchPaletteId,onChange:x[7]||(x[7]=z=>i("branchPaletteId",z.target.value))},[e.createElementVNode("optgroup",wu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(Jt),z=>(e.openBlock(),e.createElementBlock("option",{key:z.id,value:z.id},e.toDisplayString(z.name),9,Nu))),128))]),t.settings.customPalettes.length?(e.openBlock(),e.createElementBlock("optgroup",Su,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.settings.customPalettes,z=>(e.openBlock(),e.createElementBlock("option",{key:z.id,value:z.id},e.toDisplayString(z.name),9,Tu))),128))])):e.createCommentVNode("",!0)],40,xu)]),d.value.find(z=>z.id===t.settings.branchPaletteId)?(e.openBlock(),e.createElementBlock("div",Cu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((j=d.value.find(z=>z.id===t.settings.branchPaletteId))==null?void 0:j.colors,(z,C)=>(e.openBlock(),e.createElementBlock("span",{key:C,class:"zm-palette-preview-swatch",style:e.normalizeStyle({background:z})},null,4))),128))])):e.createCommentVNode("",!0),t.settings.customPalettes.find(z=>z.id===t.settings.branchPaletteId)?(e.openBlock(),e.createElementBlock("div",Au,[e.createElementVNode("textarea",{class:"zm-palette-textarea",rows:"3",spellcheck:"false",placeholder:"一行一个 hex,例如 #f87171",value:b(t.settings.customPalettes.find(z=>z.id===t.settings.branchPaletteId)),onInput:x[8]||(x[8]=z=>g[t.settings.customPalettes.find(C=>C.id===t.settings.branchPaletteId).id]=z.target.value)},null,40,_u),e.createElementVNode("div",Mu,[e.createElementVNode("button",{type:"button",class:"zm-data-btn is-primary",onClick:x[9]||(x[9]=z=>w(t.settings.customPalettes.find(C=>C.id===t.settings.branchPaletteId)))},"保存"),e.createElementVNode("button",{type:"button",class:"zm-data-btn",onClick:x[10]||(x[10]=z=>V(t.settings.customPalettes.find(C=>C.id===t.settings.branchPaletteId)))},"删除")])])):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"zm-palette-add",onClick:N},"+ 新建配色")])):e.createCommentVNode("",!0),x[38]||(x[38]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",Ru,[x[31]||(x[31]=e.createElementVNode("span",{class:"zm-settings-label"},"每条连线独立渐变",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.taperedEdge}]),onClick:x[11]||(x[11]=z=>i("taperedEdge",!t.settings.taperedEdge))},[...x[30]||(x[30]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),e.createElementVNode("div",vu,[x[33]||(x[33]=e.createElementVNode("span",{class:"zm-settings-label"},"显示节点序号",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.showOrderBadge}]),onClick:x[12]||(x[12]=z=>i("showOrderBadge",!t.settings.showOrderBadge))},[...x[32]||(x[32]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),e.createElementVNode("div",Bu,[(e.openBlock(),e.createElementBlock("svg",zu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(z,C)=>(e.openBlock(),e.createElementBlock("line",{key:C,x1:z.x1,y1:z.y1,x2:z.x2,y2:z.y2,stroke:t.settings.rainbowBranch?z.color:"#94a3b8","stroke-width":z.w,"stroke-linecap":"butt"},null,8,Iu))),128))])),x[34]||(x[34]=e.createElementVNode("div",{class:"zm-settings-preview-labels"},[e.createElementVNode("span",null,"根"),e.createElementVNode("span",null,"1级"),e.createElementVNode("span",null,"2级"),e.createElementVNode("span",null,"3级")],-1))])]),t.hasSelection?(e.openBlock(),e.createElementBlock("section",Ou,[e.createElementVNode("h4",Lu,[x[39]||(x[39]=e.createTextVNode(" 节点 ",-1)),t.selectedNodeText?(e.openBlock(),e.createElementBlock("span",Du,'"'+e.toDisplayString(t.selectedNodeText)+'"',1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Vu,[x[40]||(x[40]=e.createElementVNode("span",{class:"zm-settings-label"},"背景颜色",-1)),e.createElementVNode("span",$u,e.toDisplayString(((K=t.nodeStyle)==null?void 0:K.bg)||"默认"),1)]),e.createElementVNode("div",Pu,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(_,z=>{var C;return e.createElementVNode("button",{key:"bg-"+z,class:e.normalizeClass(["zm-swatch",{"is-active":((C=t.nodeStyle)==null?void 0:C.bg)===z}]),style:e.normalizeStyle({background:z}),title:z,onClick:F=>u({bg:z})},null,14,Fu)}),64)),e.createElementVNode("label",Uu,[e.createElementVNode("input",{type:"color",value:((ne=t.nodeStyle)==null?void 0:ne.bg)||"#ffffff",onInput:x[13]||(x[13]=z=>u({bg:z.target.value}))},null,40,Hu)]),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"清除",onClick:x[14]||(x[14]=z=>u({bg:void 0}))},"∅")]),e.createElementVNode("div",Wu,[x[41]||(x[41]=e.createElementVNode("span",{class:"zm-settings-label"},"文字颜色",-1)),e.createElementVNode("span",Gu,e.toDisplayString(((ce=t.nodeStyle)==null?void 0:ce.textColor)||"默认"),1)]),e.createElementVNode("div",ju,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(_,z=>{var C;return e.createElementVNode("button",{key:"fg-"+z,class:e.normalizeClass(["zm-swatch",{"is-active":((C=t.nodeStyle)==null?void 0:C.textColor)===z}]),style:e.normalizeStyle({background:z}),title:z,onClick:F=>u({textColor:z})},null,14,Ku)}),64)),e.createElementVNode("label",Yu,[e.createElementVNode("input",{type:"color",value:((re=t.nodeStyle)==null?void 0:re.textColor)||"#1e2937",onInput:x[15]||(x[15]=z=>u({textColor:z.target.value}))},null,40,qu)]),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"清除",onClick:x[16]||(x[16]=z=>u({textColor:void 0}))},"∅")]),x[45]||(x[45]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",Xu,[x[42]||(x[42]=e.createElementVNode("span",{class:"zm-settings-label"},"字重",-1)),e.createElementVNode("select",{class:"zm-select",value:((Y=t.nodeStyle)==null?void 0:Y.fontWeight)??400,onChange:x[17]||(x[17]=z=>u({fontWeight:parseInt(z.target.value)}))},[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(c,z=>e.createElementVNode("option",{key:z.value,value:z.value},e.toDisplayString(z.label),9,Ju)),64))],40,Zu)]),e.createElementVNode("div",Qu,[x[43]||(x[43]=e.createElementVNode("span",{class:"zm-settings-label"},"文字大小",-1)),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"1",min:"8",max:"48",value:((ee=t.nodeStyle)==null?void 0:ee.fontSize)??14,onChange:x[18]||(x[18]=z=>u({fontSize:parseInt(z.target.value)||14}))},null,40,ef)]),e.createElementVNode("div",tf,[x[44]||(x[44]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"8",max:"48",step:"1",value:((ie=t.nodeStyle)==null?void 0:ie.fontSize)??14,onInput:x[19]||(x[19]=z=>u({fontSize:parseInt(z.target.value)}))},null,40,nf)]),x[46]||(x[46]=e.createElementVNode("p",{class:"zm-settings-hint"},"仅作用于当前节点,不影响子节点。",-1))])):e.createCommentVNode("",!0),e.createElementVNode("section",of,[e.createElementVNode("button",{class:"zm-settings-reset",onClick:x[20]||(x[20]=z=>r("reset"))},"恢复默认设置")])])}}}),[["__scopeId","data-v-3fc1672c"]]),Zi=20;function rf(t,o){t.style.height="auto";const n=o.minRows*Zi,r=o.maxRows>0?o.maxRows*Zi:1/0,i=Math.max(n,Math.min(r,t.scrollHeight));t.style.height=i+"px",t.style.overflowY=t.scrollHeight>r?"auto":"hidden"}function xr(t,o={}){const n={minRows:o.minRows??3,maxRows:o.maxRows??12};function r(){const s=t.value;s&&rf(s,n)}function i(){r()}e.onMounted(async()=>{await e.nextTick();const s=t.value;s&&(s.addEventListener("input",i),r())}),e.watch(()=>{var s;return(s=t.value)==null?void 0:s.value},()=>r()),e.onBeforeUnmount(()=>{const s=t.value;s&&s.removeEventListener("input",i)})}function wr(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var _n=wr();function Ji(t){_n=t}var Mn={exec:()=>null};function Wn(t){let o=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=o[r];return i||(i=t(r),o[r]=i),i}}function xe(t,o=""){let n=typeof t=="string"?t:t.source,r={replace:(i,s)=>{let c=typeof s=="string"?s:s.source;return c=c.replace(ot.caret,"$1"),n=n.replace(i,c),r},getRegex:()=>new RegExp(n,o)};return r}var lf=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),ot={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:Wn(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Wn(t=>new RegExp(`^ {0,${t}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:Wn(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:Wn(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:Wn(t=>new RegExp(`^ {0,${t}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:Wn(t=>new RegExp(`^ {0,${t}}>`))},af=/^(?:[ \t]*(?:\n|$))+/,sf=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,cf=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,io=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,df=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Nr=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Qi=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,el=xe(Qi).replace(/bull/g,Nr).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),uf=xe(Qi).replace(/bull/g,Nr).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Sr=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,ff=/^[^\n]+/,Tr=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,mf=xe(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Tr).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),pf=xe(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Nr).getRegex(),Uo="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Cr=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,gf=xe("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Cr).replace("tag",Uo).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),tl=xe(Sr).replace("hr",io).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Uo).getRegex(),hf=xe(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",tl).getRegex(),Ar={blockquote:hf,code:sf,def:mf,fences:cf,heading:df,hr:io,html:gf,lheading:el,list:pf,newline:af,paragraph:tl,table:Mn,text:ff},nl=xe("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",io).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Uo).getRegex(),bf={...Ar,lheading:uf,table:nl,paragraph:xe(Sr).replace("hr",io).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",nl).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Uo).getRegex()},kf={...Ar,html:xe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Cr).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Mn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:xe(Sr).replace("hr",io).replace("heading",` *#{1,6} *[^
69
- ]`).replace("lheading",el).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},yf=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Ef=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ol=/^( {2,}|\\)\n(?!\s*$)/,xf=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Gn=/[\p{P}\p{S}]/u,Ho=/[\s\p{P}\p{S}]/u,_r=/[^\s\p{P}\p{S}]/u,wf=xe(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Ho).getRegex(),rl=/(?!~)[\p{P}\p{S}]/u,Nf=/(?!~)[\s\p{P}\p{S}]/u,Sf=/(?:[^\s\p{P}\p{S}]|~)/u,Tf=xe(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",lf?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),il=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Cf=xe(il,"u").replace(/punct/g,Gn).getRegex(),Af=xe(il,"u").replace(/punct/g,rl).getRegex(),ll="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",_f=xe(ll,"gu").replace(/notPunctSpace/g,_r).replace(/punctSpace/g,Ho).replace(/punct/g,Gn).getRegex(),Mf=xe(ll,"gu").replace(/notPunctSpace/g,Sf).replace(/punctSpace/g,Nf).replace(/punct/g,rl).getRegex(),Rf=xe("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,_r).replace(/punctSpace/g,Ho).replace(/punct/g,Gn).getRegex(),vf=xe(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Gn).getRegex(),Bf="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",zf=xe(Bf,"gu").replace(/notPunctSpace/g,_r).replace(/punctSpace/g,Ho).replace(/punct/g,Gn).getRegex(),If=xe(/\\(punct)/,"gu").replace(/punct/g,Gn).getRegex(),Of=xe(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Lf=xe(Cr).replace("(?:-->|$)","-->").getRegex(),Df=xe("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Lf).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Wo=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Vf=xe(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Wo).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),al=xe(/^!?\[(label)\]\[(ref)\]/).replace("label",Wo).replace("ref",Tr).getRegex(),sl=xe(/^!?\[(ref)\](?:\[\])?/).replace("ref",Tr).getRegex(),$f=xe("reflink|nolink(?!\\()","g").replace("reflink",al).replace("nolink",sl).getRegex(),cl=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Mr={_backpedal:Mn,anyPunctuation:If,autolink:Of,blockSkip:Tf,br:ol,code:Ef,del:Mn,delLDelim:Mn,delRDelim:Mn,emStrongLDelim:Cf,emStrongRDelimAst:_f,emStrongRDelimUnd:Rf,escape:yf,link:Vf,nolink:sl,punctuation:wf,reflink:al,reflinkSearch:$f,tag:Df,text:xf,url:Mn},Pf={...Mr,link:xe(/^!?\[(label)\]\((.*?)\)/).replace("label",Wo).getRegex(),reflink:xe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Wo).getRegex()},Rr={...Mr,emStrongRDelimAst:Mf,emStrongLDelim:Af,delLDelim:vf,delRDelim:zf,url:xe(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",cl).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:xe(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",cl).getRegex()},Ff={...Rr,br:xe(ol).replace("{2,}","*").getRegex(),text:xe(Rr.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Go={normal:Ar,gfm:bf,pedantic:kf},lo={normal:Mr,gfm:Rr,breaks:Ff,pedantic:Pf},Uf={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},dl=t=>Uf[t];function Ut(t,o){if(o){if(ot.escapeTest.test(t))return t.replace(ot.escapeReplace,dl)}else if(ot.escapeTestNoEncode.test(t))return t.replace(ot.escapeReplaceNoEncode,dl);return t}function ul(t){try{t=encodeURI(t).replace(ot.percentDecode,"%")}catch{return null}return t}function fl(t,o){var s;let n=t.replace(ot.findPipe,(c,u,d)=>{let g=!1,b=u;for(;--b>=0&&d[b]==="\\";)g=!g;return g?"|":" |"}),r=n.split(ot.splitPipe),i=0;if(r[0].trim()||r.shift(),r.length>0&&!((s=r.at(-1))!=null&&s.trim())&&r.pop(),o)if(r.length>o)r.splice(o);else for(;r.length<o;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(ot.slashPipe,"|");return r}function mn(t,o,n){let r=t.length;if(r===0)return"";let i=0;for(;i<r&&t.charAt(r-i-1)===o;)i++;return t.slice(0,r-i)}function ml(t){let o=t.split(`
53
+ `,Lo=e.defineComponent({__name:"MarkdownPanel",props:{data:{}},emits:["import"],setup(t,{emit:o}){const n=t,r=o,l=e.ref(On(n.data)),s=e.ref(null),c=e.ref(null),u=e.computed(()=>{try{const I=zn(l.value||"");return s.value=null,I}catch(I){return s.value=I.message,{id:"preview_fallback",text:l.value||"(空)",children:[]}}}),d=e.computed(()=>_t(u.value));let g=null;e.watch(l,()=>{g&&clearTimeout(g),g=setTimeout(()=>{var I;return(I=c.value)==null?void 0:I.resetView()},250)});function b(){try{const I=zn(l.value||"");s.value=null,r("import",I)}catch(I){s.value=I.message}}function w(){l.value=On(n.data),s.value=null,e.nextTick(()=>{var I;return(I=c.value)==null?void 0:I.resetView()})}function N(){l.value="",s.value=null,e.nextTick(()=>{var I;return(I=c.value)==null?void 0:I.resetView()})}function $(){const I=document.createElement("input");I.type="file",I.accept=".md,text/markdown,text/plain",I.onchange=()=>{var k;const C=(k=I.files)==null?void 0:k[0];if(!C)return;const E=new FileReader;E.onload=()=>{typeof E.result=="string"&&(l.value=E.result,s.value=null,e.nextTick(()=>{var m;return(m=c.value)==null?void 0:m.resetView()}))},E.readAsText(C)},I.click()}function M(){const I=new Blob([l.value],{type:"text/markdown;charset=utf-8"}),C=URL.createObjectURL(I),E=document.createElement("a");E.href=C;const k=(n.data.text||"mindmap").trim()||"mindmap";E.download=`${k}.md`,E.click(),URL.revokeObjectURL(C)}function P(){l.value=Ac,s.value=null,e.nextTick(()=>{var I;return(I=c.value)==null?void 0:I.resetView()})}return(I,C)=>(e.openBlock(),e.createElementBlock("div",yc,[e.createElementVNode("div",{class:"zm-md-toolbar"},[e.createElementVNode("button",{class:"zm-md-btn",title:"从 .md 文件加载",onClick:$},[...C[1]||(C[1]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M12 4 V15"}),e.createElementVNode("polyline",{points:"7 9 12 4 17 9"}),e.createElementVNode("path",{d:"M4 19 H20"})],-1),e.createElementVNode("span",null,"加载 .md",-1)])]),e.createElementVNode("button",{class:"zm-md-btn",title:"把当前导图导出为 .md",onClick:M},[...C[2]||(C[2]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M12 15 V4"}),e.createElementVNode("polyline",{points:"7 9 12 4 17 9"}),e.createElementVNode("path",{d:"M4 19 H20"})],-1),e.createElementVNode("span",null,"导出 .md",-1)])]),C[3]||(C[3]=e.createElementVNode("span",{class:"zm-md-spacer"},null,-1)),e.createElementVNode("button",{class:"zm-md-btn",title:"用示例内容填充",onClick:P},"示例"),e.createElementVNode("button",{class:"zm-md-btn",title:"覆盖为当前导图",onClick:w},"同步"),e.createElementVNode("button",{class:"zm-md-btn",title:"清空",onClick:N},"清空")]),s.value?(e.openBlock(),e.createElementBlock("div",Ec,e.toDisplayString(s.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",xc,[e.createElementVNode("div",wc,[C[4]||(C[4]=e.createElementVNode("div",{class:"zm-md-pane-header"},[e.createElementVNode("span",null,"Markdown"),e.createElementVNode("span",{class:"zm-md-hint"},"# 根 · ## 一级 · ### 二级 …")],-1)),e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":C[0]||(C[0]=E=>l.value=E),class:"zm-md-textarea",spellcheck:"false",placeholder:"# 标题…"},null,512),[[e.vModelText,l.value]])]),e.createElementVNode("div",Nc,[C[5]||(C[5]=e.createElementVNode("div",{class:"zm-md-pane-header"},[e.createElementVNode("span",null,"导图预览"),e.createElementVNode("span",{class:"zm-md-hint"},"只读")],-1)),e.createElementVNode("div",Sc,[e.createVNode(Jo,{ref_key:"previewRef",ref:c,data:d.value,readonly:"","preview-mode":""},null,8,["data"])])])]),e.createElementVNode("div",Tc,[e.createElementVNode("button",{class:"zm-md-btn is-primary",disabled:!l.value.trim(),onClick:b},"应用到导图",8,Cc)])]))}}),_c={class:"zm-settings-panel"},Mc={class:"zm-settings-section"},vc={class:"zm-settings-field"},Rc={class:"zm-settings-control"},Bc={class:"zm-color-input-wrap"},Ic=["value"],zc={class:"zm-color-input-text"},Oc={class:"zm-swatch-row zm-swatch-row--compact"},Lc=["title","onClick"],Dc={class:"zm-settings-field"},Vc=["value"],$c={class:"zm-slider"},Pc=["value"],Uc={class:"zm-settings-field"},Fc=["value"],Hc={class:"zm-slider"},Wc=["value"],Gc={class:"zm-settings-field"},jc={class:"zm-line-style-group"},Kc=["title","onClick"],Yc=["viewBox"],qc={key:0,d:"M 0 12 C 8 0, 20 0, 28 12",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},Xc={key:1,x1:"0",y1:"12",x2:"28",y2:"12",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},Zc={class:"zm-line-style-label"},Jc={class:"zm-settings-field"},Qc={key:0,class:"zm-palette-dropdown"},ed={class:"zm-settings-field"},td=["value"],nd={label:"内置配色"},od=["value"],rd={key:0,label:"自定义"},id=["value"],ld={key:0,class:"zm-palette-preview-bar"},ad={key:1,class:"zm-palette-custom-editor"},sd=["value"],cd={class:"zm-palette-custom-actions"},dd={class:"zm-settings-field"},ud={class:"zm-settings-field"},fd={class:"zm-settings-preview"},md={viewBox:"0 0 200 70",width:"100%",height:"70",preserveAspectRatio:"none"},pd=["x1","y1","x2","y2","stroke","stroke-width"],gd={key:0,class:"zm-settings-section"},hd={class:"zm-settings-section-title"},bd={key:0,class:"zm-settings-section-sub"},kd={class:"zm-settings-field"},yd={class:"zm-settings-value-tag"},Ed={class:"zm-swatch-row"},xd=["title","onClick"],wd={class:"zm-swatch zm-swatch--custom",title:"自定义颜色"},Nd=["value"],Sd={class:"zm-settings-field"},Td={class:"zm-settings-value-tag"},Cd={class:"zm-swatch-row"},Ad=["title","onClick"],_d={class:"zm-swatch zm-swatch--custom",title:"自定义颜色"},Md=["value"],vd={class:"zm-settings-field"},Rd=["value"],Bd=["value"],Id={class:"zm-settings-field"},zd=["value"],Od={class:"zm-slider"},Ld=["value"],Dd={class:"zm-settings-section zm-settings-section--actions"},Do=((t,o)=>{const n=t.__vccOpts||t;for(const[r,l]of o)n[r]=l;return n})(e.defineComponent({__name:"SettingsPanel",props:{settings:{},hasSelection:{type:Boolean},selectedNodeText:{},nodeStyle:{}},emits:["update:settings","update:nodeStyle","reset"],setup(t,{emit:o}){const n=t,r=o;function l(B,x){r("update:settings",{[B]:x})}const s=[{value:"curve",label:"圆弧",viewBox:"0 0 28 14"},{value:"straight",label:"直线",viewBox:"0 0 28 14"}],c=[{value:100,label:"100"},{value:200,label:"200"},{value:300,label:"300"},{value:400,label:"400 (常规)"},{value:500,label:"500"},{value:600,label:"600 (半粗)"},{value:700,label:"700 (粗体)"},{value:800,label:"800"},{value:900,label:"900"}];function u(B){r("update:nodeStyle",B)}const d=e.computed(()=>[...en,...n.settings.customPalettes]),g=e.reactive({});function b(B){return g[B.id]===void 0&&(g[B.id]=B.colors.join(`
54
+ `)),g[B.id]}function w(B){const x=g[B.id]??"",K=Va(x);if(K.length===0){g[B.id]=B.colors.join(`
55
+ `);return}const Y=n.settings.customPalettes.map(ee=>ee.id===B.id?{...ee,colors:K}:ee);r("update:settings",{customPalettes:Y})}function N(){const B=d.value.find(ae=>ae.id===n.settings.branchPaletteId),x=B?[...B.colors]:[...en[0].colors],K="custom-";let Y=K+(n.settings.customPalettes.length+1);for(;en.some(ae=>ae.id===Y)||n.settings.customPalettes.some(ae=>ae.id===Y);)Y=K+Math.random().toString(36).slice(2,7);const ee={id:Y,name:`我的配色 ${n.settings.customPalettes.length+1}`,colors:x};r("update:settings",{customPalettes:[...n.settings.customPalettes,ee],branchPaletteId:Y}),g[Y]=x.join(`
56
+ `)}function $(B){const x=n.settings.customPalettes.filter(Y=>Y.id!==B.id),K=n.settings.branchPaletteId===B.id?"default":n.settings.branchPaletteId;r("update:settings",{customPalettes:x,...K!==n.settings.branchPaletteId?{branchPaletteId:K}:{}}),delete g[B.id]}const M=["#f87171","#fb923c","#fbbf24","#a3e635","#34d399","#22d3ee","#818cf8","#c084fc","#1e2937","#f8fafc","#94a3b8"],P=["#f8fafc","#ffffff","#e2e8f0","#1e2937","#0f172a","#fef3c7","#dbeafe","#dcfce7","#fce7f3","#f1f5f9"],I=[0,1,2,3],C=["#f87171","#fb923c","#34d399","#818cf8"];function E(B,x,K,Y){if(x<=1)return K;const ee=B/(x-1);return K+(Y-K)*ee}function k(B,x,K){return B<=0?x:B===1?Math.max(1.5,x*.67):B===2?Math.max(.8,x*.42):K}const m=e.computed(()=>{const B=n.settings.lineWidthStart,x=n.settings.lineWidthEnd,K=n.settings.taperedEdge,Y=I.length,ee=8,ae=192,re=d.value.find(Q=>Q.id===n.settings.branchPaletteId),q=re&&re.colors.length?re.colors:C;return I.map((Q,ie)=>{const z=10+ie*60/(Y-1);return{x1:ee,y1:z,x2:ae,y2:z,w:K?k(Q,B,x):E(Q,Y,B,x),color:n.settings.rainbowBranch?q[ie%q.length]:"#94a3b8"}})});return(B,x)=>{var K,Y,ee,ae,re,q,Q,ie;return e.openBlock(),e.createElementBlock("div",_c,[e.createElementVNode("section",Mc,[x[35]||(x[35]=e.createElementVNode("h4",{class:"zm-settings-section-title"},"画布",-1)),e.createElementVNode("div",vc,[x[21]||(x[21]=e.createElementVNode("span",{class:"zm-settings-label"},"画布背景色",-1)),e.createElementVNode("div",Rc,[e.createElementVNode("label",Bc,[e.createElementVNode("input",{type:"color",class:"zm-color-input",value:t.settings.canvasBg||"#f8fafc",onInput:x[0]||(x[0]=z=>l("canvasBg",z.target.value))},null,40,Ic),e.createElementVNode("span",zc,e.toDisplayString(t.settings.canvasBg||"默认"),1)])])]),e.createElementVNode("div",Oc,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(P,z=>e.createElementVNode("button",{key:"cbg-"+z,class:e.normalizeClass(["zm-swatch",{"is-active":(t.settings.canvasBg||"#f8fafc")===z}]),style:e.normalizeStyle({background:z}),title:z,onClick:A=>l("canvasBg",z)},null,14,Lc)),64)),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"恢复默认",onClick:x[1]||(x[1]=z=>l("canvasBg",void 0))},"∅")]),x[36]||(x[36]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",Dc,[x[22]||(x[22]=e.createElementVNode("span",{class:"zm-settings-label"},"线条粗端 (根部)",-1)),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"0.2",value:t.settings.lineWidthStart,onChange:x[2]||(x[2]=z=>l("lineWidthStart",parseFloat(z.target.value)||0))},null,40,Vc)]),e.createElementVNode("div",$c,[x[23]||(x[23]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"0.4",max:"20",step:"0.2",value:t.settings.lineWidthStart,onInput:x[3]||(x[3]=z=>l("lineWidthStart",parseFloat(z.target.value)))},null,40,Pc)]),e.createElementVNode("div",Uc,[x[24]||(x[24]=e.createElementVNode("span",{class:"zm-settings-label"},"线条细端 (子端)",-1)),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"0.2",value:t.settings.lineWidthEnd,onChange:x[4]||(x[4]=z=>l("lineWidthEnd",parseFloat(z.target.value)||0))},null,40,Fc)]),e.createElementVNode("div",Hc,[x[25]||(x[25]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"0.2",max:"6",step:"0.1",value:t.settings.lineWidthEnd,onInput:x[5]||(x[5]=z=>l("lineWidthEnd",parseFloat(z.target.value)))},null,40,Wc)]),x[37]||(x[37]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",Gc,[x[26]||(x[26]=e.createElementVNode("span",{class:"zm-settings-label"},"线条类型",-1)),e.createElementVNode("div",jc,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(s,z=>e.createElementVNode("button",{key:z.value,class:e.normalizeClass(["zm-line-style-btn",{"is-on":t.settings.lineStyle===z.value}]),title:z.label,onClick:A=>l("lineStyle",z.value)},[(e.openBlock(),e.createElementBlock("svg",{viewBox:z.viewBox,width:"28",height:"14",preserveAspectRatio:"none"},[z.value==="curve"?(e.openBlock(),e.createElementBlock("path",qc)):(e.openBlock(),e.createElementBlock("line",Xc))],8,Yc)),e.createElementVNode("span",Zc,e.toDisplayString(z.label),1)],10,Kc)),64))])]),e.createElementVNode("div",Jc,[x[28]||(x[28]=e.createElementVNode("span",{class:"zm-settings-label"},"一级分支彩虹色",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.rainbowBranch}]),onClick:x[6]||(x[6]=z=>l("rainbowBranch",!t.settings.rainbowBranch))},[...x[27]||(x[27]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),t.settings.rainbowBranch?(e.openBlock(),e.createElementBlock("div",Qc,[e.createElementVNode("div",ed,[x[29]||(x[29]=e.createElementVNode("span",{class:"zm-settings-label"},"配色方案",-1)),e.createElementVNode("select",{class:"zm-select",value:t.settings.branchPaletteId,onChange:x[7]||(x[7]=z=>l("branchPaletteId",z.target.value))},[e.createElementVNode("optgroup",nd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(en),z=>(e.openBlock(),e.createElementBlock("option",{key:z.id,value:z.id},e.toDisplayString(z.name),9,od))),128))]),t.settings.customPalettes.length?(e.openBlock(),e.createElementBlock("optgroup",rd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.settings.customPalettes,z=>(e.openBlock(),e.createElementBlock("option",{key:z.id,value:z.id},e.toDisplayString(z.name),9,id))),128))])):e.createCommentVNode("",!0)],40,td)]),d.value.find(z=>z.id===t.settings.branchPaletteId)?(e.openBlock(),e.createElementBlock("div",ld,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((K=d.value.find(z=>z.id===t.settings.branchPaletteId))==null?void 0:K.colors,(z,A)=>(e.openBlock(),e.createElementBlock("span",{key:A,class:"zm-palette-preview-swatch",style:e.normalizeStyle({background:z})},null,4))),128))])):e.createCommentVNode("",!0),t.settings.customPalettes.find(z=>z.id===t.settings.branchPaletteId)?(e.openBlock(),e.createElementBlock("div",ad,[e.createElementVNode("textarea",{class:"zm-palette-textarea",rows:"3",spellcheck:"false",placeholder:"一行一个 hex,例如 #f87171",value:b(t.settings.customPalettes.find(z=>z.id===t.settings.branchPaletteId)),onInput:x[8]||(x[8]=z=>g[t.settings.customPalettes.find(A=>A.id===t.settings.branchPaletteId).id]=z.target.value)},null,40,sd),e.createElementVNode("div",cd,[e.createElementVNode("button",{type:"button",class:"zm-data-btn is-primary",onClick:x[9]||(x[9]=z=>w(t.settings.customPalettes.find(A=>A.id===t.settings.branchPaletteId)))},"保存"),e.createElementVNode("button",{type:"button",class:"zm-data-btn",onClick:x[10]||(x[10]=z=>$(t.settings.customPalettes.find(A=>A.id===t.settings.branchPaletteId)))},"删除")])])):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"zm-palette-add",onClick:N},"+ 新建配色")])):e.createCommentVNode("",!0),x[38]||(x[38]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",dd,[x[31]||(x[31]=e.createElementVNode("span",{class:"zm-settings-label"},"每条连线独立渐变",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.taperedEdge}]),onClick:x[11]||(x[11]=z=>l("taperedEdge",!t.settings.taperedEdge))},[...x[30]||(x[30]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),e.createElementVNode("div",ud,[x[33]||(x[33]=e.createElementVNode("span",{class:"zm-settings-label"},"显示节点序号",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.showOrderBadge}]),onClick:x[12]||(x[12]=z=>l("showOrderBadge",!t.settings.showOrderBadge))},[...x[32]||(x[32]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),e.createElementVNode("div",fd,[(e.openBlock(),e.createElementBlock("svg",md,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(z,A)=>(e.openBlock(),e.createElementBlock("line",{key:A,x1:z.x1,y1:z.y1,x2:z.x2,y2:z.y2,stroke:t.settings.rainbowBranch?z.color:"#94a3b8","stroke-width":z.w,"stroke-linecap":"butt"},null,8,pd))),128))])),x[34]||(x[34]=e.createElementVNode("div",{class:"zm-settings-preview-labels"},[e.createElementVNode("span",null,"根"),e.createElementVNode("span",null,"1级"),e.createElementVNode("span",null,"2级"),e.createElementVNode("span",null,"3级")],-1))])]),t.hasSelection?(e.openBlock(),e.createElementBlock("section",gd,[e.createElementVNode("h4",hd,[x[39]||(x[39]=e.createTextVNode(" 节点 ",-1)),t.selectedNodeText?(e.openBlock(),e.createElementBlock("span",bd,'"'+e.toDisplayString(t.selectedNodeText)+'"',1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",kd,[x[40]||(x[40]=e.createElementVNode("span",{class:"zm-settings-label"},"背景颜色",-1)),e.createElementVNode("span",yd,e.toDisplayString(((Y=t.nodeStyle)==null?void 0:Y.bg)||"默认"),1)]),e.createElementVNode("div",Ed,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(M,z=>{var A;return e.createElementVNode("button",{key:"bg-"+z,class:e.normalizeClass(["zm-swatch",{"is-active":((A=t.nodeStyle)==null?void 0:A.bg)===z}]),style:e.normalizeStyle({background:z}),title:z,onClick:F=>u({bg:z})},null,14,xd)}),64)),e.createElementVNode("label",wd,[e.createElementVNode("input",{type:"color",value:((ee=t.nodeStyle)==null?void 0:ee.bg)||"#ffffff",onInput:x[13]||(x[13]=z=>u({bg:z.target.value}))},null,40,Nd)]),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"清除",onClick:x[14]||(x[14]=z=>u({bg:void 0}))},"∅")]),e.createElementVNode("div",Sd,[x[41]||(x[41]=e.createElementVNode("span",{class:"zm-settings-label"},"文字颜色",-1)),e.createElementVNode("span",Td,e.toDisplayString(((ae=t.nodeStyle)==null?void 0:ae.textColor)||"默认"),1)]),e.createElementVNode("div",Cd,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(M,z=>{var A;return e.createElementVNode("button",{key:"fg-"+z,class:e.normalizeClass(["zm-swatch",{"is-active":((A=t.nodeStyle)==null?void 0:A.textColor)===z}]),style:e.normalizeStyle({background:z}),title:z,onClick:F=>u({textColor:z})},null,14,Ad)}),64)),e.createElementVNode("label",_d,[e.createElementVNode("input",{type:"color",value:((re=t.nodeStyle)==null?void 0:re.textColor)||"#1e2937",onInput:x[15]||(x[15]=z=>u({textColor:z.target.value}))},null,40,Md)]),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"清除",onClick:x[16]||(x[16]=z=>u({textColor:void 0}))},"∅")]),x[45]||(x[45]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",vd,[x[42]||(x[42]=e.createElementVNode("span",{class:"zm-settings-label"},"字重",-1)),e.createElementVNode("select",{class:"zm-select",value:((q=t.nodeStyle)==null?void 0:q.fontWeight)??400,onChange:x[17]||(x[17]=z=>u({fontWeight:parseInt(z.target.value)}))},[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(c,z=>e.createElementVNode("option",{key:z.value,value:z.value},e.toDisplayString(z.label),9,Bd)),64))],40,Rd)]),e.createElementVNode("div",Id,[x[43]||(x[43]=e.createElementVNode("span",{class:"zm-settings-label"},"文字大小",-1)),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"1",min:"8",max:"48",value:((Q=t.nodeStyle)==null?void 0:Q.fontSize)??14,onChange:x[18]||(x[18]=z=>u({fontSize:parseInt(z.target.value)||14}))},null,40,zd)]),e.createElementVNode("div",Od,[x[44]||(x[44]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"8",max:"48",step:"1",value:((ie=t.nodeStyle)==null?void 0:ie.fontSize)??14,onInput:x[19]||(x[19]=z=>u({fontSize:parseInt(z.target.value)}))},null,40,Ld)]),x[46]||(x[46]=e.createElementVNode("p",{class:"zm-settings-hint"},"仅作用于当前节点,不影响子节点。",-1))])):e.createCommentVNode("",!0),e.createElementVNode("section",Dd,[e.createElementVNode("button",{class:"zm-settings-reset",onClick:x[20]||(x[20]=z=>r("reset"))},"恢复默认设置")])])}}}),[["__scopeId","data-v-3fc1672c"]]),ki=20;function Vd(t,o){t.style.height="auto";const n=o.minRows*ki,r=o.maxRows>0?o.maxRows*ki:1/0,l=Math.max(n,Math.min(r,t.scrollHeight));t.style.height=l+"px",t.style.overflowY=t.scrollHeight>r?"auto":"hidden"}function hr(t,o={}){const n={minRows:o.minRows??3,maxRows:o.maxRows??12};function r(){const s=t.value;s&&Vd(s,n)}function l(){r()}e.onMounted(async()=>{await e.nextTick();const s=t.value;s&&(s.addEventListener("input",l),r())}),e.watch(()=>{var s;return(s=t.value)==null?void 0:s.value},()=>r()),e.onBeforeUnmount(()=>{const s=t.value;s&&s.removeEventListener("input",l)})}function $d(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function yi(t){return t instanceof Map?t.clear=t.delete=t.set=function(){throw new Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=function(){throw new Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach(o=>{const n=t[o],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&yi(n)}),t}class Ei{constructor(o){o.data===void 0&&(o.data={}),this.data=o.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function xi(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function dn(t,...o){const n=Object.create(null);for(const r in t)n[r]=t[r];return o.forEach(function(r){for(const l in r)n[l]=r[l]}),n}const Pd="</span>",wi=t=>!!t.scope,Ud=(t,{prefix:o})=>{if(t.startsWith("language:"))return t.replace("language:","language-");if(t.includes(".")){const n=t.split(".");return[`${o}${n.shift()}`,...n.map((r,l)=>`${r}${"_".repeat(l+1)}`)].join(" ")}return`${o}${t}`};class Fd{constructor(o,n){this.buffer="",this.classPrefix=n.classPrefix,o.walk(this)}addText(o){this.buffer+=xi(o)}openNode(o){if(!wi(o))return;const n=Ud(o.scope,{prefix:this.classPrefix});this.span(n)}closeNode(o){wi(o)&&(this.buffer+=Pd)}value(){return this.buffer}span(o){this.buffer+=`<span class="${o}">`}}const Ni=(t={})=>{const o={children:[]};return Object.assign(o,t),o};class br{constructor(){this.rootNode=Ni(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(o){this.top.children.push(o)}openNode(o){const n=Ni({scope:o});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(o){return this.constructor._walk(o,this.rootNode)}static _walk(o,n){return typeof n=="string"?o.addText(n):n.children&&(o.openNode(n),n.children.forEach(r=>this._walk(o,r)),o.closeNode(n)),o}static _collapse(o){typeof o!="string"&&o.children&&(o.children.every(n=>typeof n=="string")?o.children=[o.children.join("")]:o.children.forEach(n=>{br._collapse(n)}))}}class Hd extends br{constructor(o){super(),this.options=o}addText(o){o!==""&&this.add(o)}startScope(o){this.openNode(o)}endScope(){this.closeNode()}__addSublanguage(o,n){const r=o.root;n&&(r.scope=`language:${n}`),this.add(r)}toHTML(){return new Fd(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function ro(t){return t?typeof t=="string"?t:t.source:null}function Si(t){return xn("(?=",t,")")}function Wd(t){return xn("(?:",t,")*")}function Gd(t){return xn("(?:",t,")?")}function xn(...t){return t.map(n=>ro(n)).join("")}function jd(t){const o=t[t.length-1];return typeof o=="object"&&o.constructor===Object?(t.splice(t.length-1,1),o):{}}function kr(...t){return"("+(jd(t).capture?"":"?:")+t.map(r=>ro(r)).join("|")+")"}function Ti(t){return new RegExp(t.toString()+"|").exec("").length-1}function Kd(t,o){const n=t&&t.exec(o);return n&&n.index===0}const Yd=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function yr(t,{joinWith:o}){let n=0;return t.map(r=>{n+=1;const l=n;let s=ro(r),c="";for(;s.length>0;){const u=Yd.exec(s);if(!u){c+=s;break}c+=s.substring(0,u.index),s=s.substring(u.index+u[0].length),u[0][0]==="\\"&&u[1]?c+="\\"+String(Number(u[1])+l):(c+=u[0],u[0]==="("&&n++)}return c}).map(r=>`(${r})`).join(o)}const qd=/\b\B/,Ci="[a-zA-Z]\\w*",Er="[a-zA-Z_]\\w*",Ai="\\b\\d+(\\.\\d+)?",_i="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Mi="\\b(0b[01]+)",Xd="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",Zd=(t={})=>{const o=/^#![ ]*\//;return t.binary&&(t.begin=xn(o,/.*\b/,t.binary,/\b.*/)),dn({scope:"meta",begin:o,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},t)},io={begin:"\\\\[\\s\\S]",relevance:0},Jd={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[io]},Qd={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[io]},eu={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/},Vo=function(t,o,n={}){const r=dn({scope:"comment",begin:t,end:o,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const l=kr("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:xn(/[ ]+/,"(",l,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},tu=Vo("//","$"),nu=Vo("/\\*","\\*/"),ou=Vo("#","$"),ru={scope:"number",begin:Ai,relevance:0},iu={scope:"number",begin:_i,relevance:0},lu={scope:"number",begin:Mi,relevance:0},au={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[io,{begin:/\[/,end:/\]/,relevance:0,contains:[io]}]},su={scope:"title",begin:Ci,relevance:0},cu={scope:"title",begin:Er,relevance:0},du={begin:"\\.\\s*"+Er,relevance:0};var $o=Object.freeze({__proto__:null,APOS_STRING_MODE:Jd,BACKSLASH_ESCAPE:io,BINARY_NUMBER_MODE:lu,BINARY_NUMBER_RE:Mi,COMMENT:Vo,C_BLOCK_COMMENT_MODE:nu,C_LINE_COMMENT_MODE:tu,C_NUMBER_MODE:iu,C_NUMBER_RE:_i,END_SAME_AS_BEGIN:function(t){return Object.assign(t,{"on:begin":(o,n)=>{n.data._beginMatch=o[1]},"on:end":(o,n)=>{n.data._beginMatch!==o[1]&&n.ignoreMatch()}})},HASH_COMMENT_MODE:ou,IDENT_RE:Ci,MATCH_NOTHING_RE:qd,METHOD_GUARD:du,NUMBER_MODE:ru,NUMBER_RE:Ai,PHRASAL_WORDS_MODE:eu,QUOTE_STRING_MODE:Qd,REGEXP_MODE:au,RE_STARTERS_RE:Xd,SHEBANG:Zd,TITLE_MODE:su,UNDERSCORE_IDENT_RE:Er,UNDERSCORE_TITLE_MODE:cu});function uu(t,o){t.input[t.index-1]==="."&&o.ignoreMatch()}function fu(t,o){t.className!==void 0&&(t.scope=t.className,delete t.className)}function mu(t,o){o&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=uu,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function pu(t,o){Array.isArray(t.illegal)&&(t.illegal=kr(...t.illegal))}function gu(t,o){if(t.match){if(t.begin||t.end)throw new Error("begin & end are not supported with match");t.begin=t.match,delete t.match}}function hu(t,o){t.relevance===void 0&&(t.relevance=1)}const bu=(t,o)=>{if(!t.beforeMatch)return;if(t.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},t);Object.keys(t).forEach(r=>{delete t[r]}),t.keywords=n.keywords,t.begin=xn(n.beforeMatch,Si(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},ku=["of","and","for","in","not","or","if","then","parent","list","value"],yu="keyword";function vi(t,o,n=yu){const r=Object.create(null);return typeof t=="string"?l(n,t.split(" ")):Array.isArray(t)?l(n,t):Object.keys(t).forEach(function(s){Object.assign(r,vi(t[s],o,s))}),r;function l(s,c){o&&(c=c.map(u=>u.toLowerCase())),c.forEach(function(u){const d=u.split("|");r[d[0]]=[s,Eu(d[0],d[1])]})}}function Eu(t,o){return o?Number(o):xu(t)?0:1}function xu(t){return ku.includes(t.toLowerCase())}const Ri={},wn=t=>{console.error(t)},Bi=(t,...o)=>{console.log(`WARN: ${t}`,...o)},Ln=(t,o)=>{Ri[`${t}/${o}`]||(console.log(`Deprecated as of ${t}. ${o}`),Ri[`${t}/${o}`]=!0)},Po=new Error;function Ii(t,o,{key:n}){let r=0;const l=t[n],s={},c={};for(let u=1;u<=o.length;u++)c[u+r]=l[u],s[u+r]=!0,r+=Ti(o[u-1]);t[n]=c,t[n]._emit=s,t[n]._multi=!0}function wu(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw wn("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Po;if(typeof t.beginScope!="object"||t.beginScope===null)throw wn("beginScope must be object"),Po;Ii(t,t.begin,{key:"beginScope"}),t.begin=yr(t.begin,{joinWith:""})}}function Nu(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw wn("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Po;if(typeof t.endScope!="object"||t.endScope===null)throw wn("endScope must be object"),Po;Ii(t,t.end,{key:"endScope"}),t.end=yr(t.end,{joinWith:""})}}function Su(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function Tu(t){Su(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),wu(t),Nu(t)}function Cu(t){function o(c,u){return new RegExp(ro(c),"m"+(t.case_insensitive?"i":"")+(t.unicodeRegex?"u":"")+(u?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(u,d){d.position=this.position++,this.matchIndexes[this.matchAt]=d,this.regexes.push([d,u]),this.matchAt+=Ti(u)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const u=this.regexes.map(d=>d[1]);this.matcherRe=o(yr(u,{joinWith:"|"}),!0),this.lastIndex=0}exec(u){this.matcherRe.lastIndex=this.lastIndex;const d=this.matcherRe.exec(u);if(!d)return null;const g=d.findIndex((w,N)=>N>0&&w!==void 0),b=this.matchIndexes[g];return d.splice(0,g),Object.assign(d,b)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(u){if(this.multiRegexes[u])return this.multiRegexes[u];const d=new n;return this.rules.slice(u).forEach(([g,b])=>d.addRule(g,b)),d.compile(),this.multiRegexes[u]=d,d}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(u,d){this.rules.push([u,d]),d.type==="begin"&&this.count++}exec(u){const d=this.getMatcher(this.regexIndex);d.lastIndex=this.lastIndex;let g=d.exec(u);if(this.resumingScanAtSamePosition()&&!(g&&g.index===this.lastIndex)){const b=this.getMatcher(0);b.lastIndex=this.lastIndex+1,g=b.exec(u)}return g&&(this.regexIndex+=g.position+1,this.regexIndex===this.count&&this.considerAll()),g}}function l(c){const u=new r;return c.contains.forEach(d=>u.addRule(d.begin,{rule:d,type:"begin"})),c.terminatorEnd&&u.addRule(c.terminatorEnd,{type:"end"}),c.illegal&&u.addRule(c.illegal,{type:"illegal"}),u}function s(c,u){const d=c;if(c.isCompiled)return d;[fu,gu,Tu,bu].forEach(b=>b(c,u)),t.compilerExtensions.forEach(b=>b(c,u)),c.__beforeBegin=null,[mu,pu,hu].forEach(b=>b(c,u)),c.isCompiled=!0;let g=null;return typeof c.keywords=="object"&&c.keywords.$pattern&&(c.keywords=Object.assign({},c.keywords),g=c.keywords.$pattern,delete c.keywords.$pattern),g=g||/\w+/,c.keywords&&(c.keywords=vi(c.keywords,t.case_insensitive)),d.keywordPatternRe=o(g,!0),u&&(c.begin||(c.begin=/\B|\b/),d.beginRe=o(d.begin),!c.end&&!c.endsWithParent&&(c.end=/\B|\b/),c.end&&(d.endRe=o(d.end)),d.terminatorEnd=ro(d.end)||"",c.endsWithParent&&u.terminatorEnd&&(d.terminatorEnd+=(c.end?"|":"")+u.terminatorEnd)),c.illegal&&(d.illegalRe=o(c.illegal)),c.contains||(c.contains=[]),c.contains=[].concat(...c.contains.map(function(b){return Au(b==="self"?c:b)})),c.contains.forEach(function(b){s(b,d)}),c.starts&&s(c.starts,u),d.matcher=l(d),d}if(t.compilerExtensions||(t.compilerExtensions=[]),t.contains&&t.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return t.classNameAliases=dn(t.classNameAliases||{}),s(t)}function zi(t){return t?t.endsWithParent||zi(t.starts):!1}function Au(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(o){return dn(t,{variants:null},o)})),t.cachedVariants?t.cachedVariants:zi(t)?dn(t,{starts:t.starts?dn(t.starts):null}):Object.isFrozen(t)?dn(t):t}var _u="11.11.1";class Mu extends Error{constructor(o,n){super(o),this.name="HTMLInjectionError",this.html=n}}const xr=xi,Oi=dn,Li=Symbol("nomatch"),vu=7,Di=function(t){const o=Object.create(null),n=Object.create(null),r=[];let l=!0;const s="Could not find the language '{}', did you forget to load/include a language module?",c={disableAutodetect:!0,name:"Plain text",contains:[]};let u={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:Hd};function d(A){return u.noHighlightRe.test(A)}function g(A){let F=A.className+" ";F+=A.parentNode?A.parentNode.className:"";const U=u.languageDetectRe.exec(F);if(U){const G=Y(U[1]);return G||(Bi(s.replace("{}",U[1])),Bi("Falling back to no-highlight mode for this block.",A)),G?U[1]:"no-highlight"}return F.split(/\s+/).find(G=>d(G)||Y(G))}function b(A,F,U){let G="",le="";typeof F=="object"?(G=A,U=F.ignoreIllegals,le=F.language):(Ln("10.7.0","highlight(lang, code, ...args) has been deprecated."),Ln("10.7.0",`Please use highlight(code, options) instead.
57
+ https://github.com/highlightjs/highlight.js/issues/2277`),le=A,G=F),U===void 0&&(U=!0);const Ne={code:G,language:le};ie("before:highlight",Ne);const _e=Ne.result?Ne.result:w(Ne.language,Ne.code,U);return _e.code=Ne.code,ie("after:highlight",_e),_e}function w(A,F,U,G){const le=Object.create(null);function Ne(H,Z){return H.keywords[Z]}function _e(){if(!J.keywords){Te.addText(Se);return}let H=0;J.keywordPatternRe.lastIndex=0;let Z=J.keywordPatternRe.exec(Se),ce="";for(;Z;){ce+=Se.substring(H,Z.index);const ke=je.case_insensitive?Z[0].toLowerCase():Z[0],ze=Ne(J,ke);if(ze){const[Qe,ht]=ze;if(Te.addText(ce),ce="",le[ke]=(le[ke]||0)+1,le[ke]<=vu&&(Bt+=ht),Qe.startsWith("_"))ce+=Z[0];else{const Mn=je.classNameAliases[Qe]||Qe;y(Z[0],Mn)}}else ce+=Z[0];H=J.keywordPatternRe.lastIndex,Z=J.keywordPatternRe.exec(Se)}ce+=Se.substring(H),Te.addText(ce)}function Re(){if(Se==="")return;let H=null;if(typeof J.subLanguage=="string"){if(!o[J.subLanguage]){Te.addText(Se);return}H=w(J.subLanguage,Se,!0,it[J.subLanguage]),it[J.subLanguage]=H._top}else H=$(Se,J.subLanguage.length?J.subLanguage:null);J.relevance>0&&(Bt+=H.relevance),Te.__addSublanguage(H._emitter,H.language)}function xe(){J.subLanguage!=null?Re():_e(),Se=""}function y(H,Z){H!==""&&(Te.startScope(Z),Te.addText(H),Te.endScope())}function p(H,Z){let ce=1;const ke=Z.length-1;for(;ce<=ke;){if(!H._emit[ce]){ce++;continue}const ze=je.classNameAliases[H[ce]]||H[ce],Qe=Z[ce];ze?y(Qe,ze):(Se=Qe,_e(),Se=""),ce++}}function L(H,Z){return H.scope&&typeof H.scope=="string"&&Te.openNode(je.classNameAliases[H.scope]||H.scope),H.beginScope&&(H.beginScope._wrap?(y(Se,je.classNameAliases[H.beginScope._wrap]||H.beginScope._wrap),Se=""):H.beginScope._multi&&(p(H.beginScope,Z),Se="")),J=Object.create(H,{parent:{value:J}}),J}function V(H,Z,ce){let ke=Kd(H.endRe,ce);if(ke){if(H["on:end"]){const ze=new Ei(H);H["on:end"](Z,ze),ze.isMatchIgnored&&(ke=!1)}if(ke){for(;H.endsParent&&H.parent;)H=H.parent;return H}}if(H.endsWithParent)return V(H.parent,Z,ce)}function X(H){return J.matcher.regexIndex===0?(Se+=H[0],1):(dt=!0,0)}function se(H){const Z=H[0],ce=H.rule,ke=new Ei(ce),ze=[ce.__beforeBegin,ce["on:begin"]];for(const Qe of ze)if(Qe&&(Qe(H,ke),ke.isMatchIgnored))return X(Z);return ce.skip?Se+=Z:(ce.excludeBegin&&(Se+=Z),xe(),!ce.returnBegin&&!ce.excludeBegin&&(Se=Z)),L(ce,H),ce.returnBegin?0:Z.length}function ge(H){const Z=H[0],ce=F.substring(H.index),ke=V(J,H,ce);if(!ke)return Li;const ze=J;J.endScope&&J.endScope._wrap?(xe(),y(Z,J.endScope._wrap)):J.endScope&&J.endScope._multi?(xe(),p(J.endScope,H)):ze.skip?Se+=Z:(ze.returnEnd||ze.excludeEnd||(Se+=Z),xe(),ze.excludeEnd&&(Se=Z));do J.scope&&Te.closeNode(),!J.skip&&!J.subLanguage&&(Bt+=J.relevance),J=J.parent;while(J!==ke.parent);return ke.starts&&L(ke.starts,H),ze.returnEnd?0:Z.length}function Ge(){const H=[];for(let Z=J;Z!==je;Z=Z.parent)Z.scope&&H.unshift(Z.scope);H.forEach(Z=>Te.openNode(Z))}let Pe={};function Ze(H,Z){const ce=Z&&Z[0];if(Se+=H,ce==null)return xe(),0;if(Pe.type==="begin"&&Z.type==="end"&&Pe.index===Z.index&&ce===""){if(Se+=F.slice(Z.index,Z.index+1),!l){const ke=new Error(`0 width match regex (${A})`);throw ke.languageName=A,ke.badRule=Pe.rule,ke}return 1}if(Pe=Z,Z.type==="begin")return se(Z);if(Z.type==="illegal"&&!U){const ke=new Error('Illegal lexeme "'+ce+'" for mode "'+(J.scope||"<unnamed>")+'"');throw ke.mode=J,ke}else if(Z.type==="end"){const ke=ge(Z);if(ke!==Li)return ke}if(Z.type==="illegal"&&ce==="")return Se+=`
58
+ `,1;if(gt>1e5&&gt>Z.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Se+=ce,ce.length}const je=Y(A);if(!je)throw wn(s.replace("{}",A)),new Error('Unknown language: "'+A+'"');const tn=Cu(je);let Rt="",J=G||tn;const it={},Te=new u.__emitter(u);Ge();let Se="",Bt=0,Je=0,gt=0,dt=!1;try{if(je.__emitTokens)je.__emitTokens(F,Te);else{for(J.matcher.considerAll();;){gt++,dt?dt=!1:J.matcher.considerAll(),J.matcher.lastIndex=Je;const H=J.matcher.exec(F);if(!H)break;const Z=F.substring(Je,H.index),ce=Ze(Z,H);Je=H.index+ce}Ze(F.substring(Je))}return Te.finalize(),Rt=Te.toHTML(),{language:A,value:Rt,relevance:Bt,illegal:!1,_emitter:Te,_top:J}}catch(H){if(H.message&&H.message.includes("Illegal"))return{language:A,value:xr(F),illegal:!0,relevance:0,_illegalBy:{message:H.message,index:Je,context:F.slice(Je-100,Je+100),mode:H.mode,resultSoFar:Rt},_emitter:Te};if(l)return{language:A,value:xr(F),illegal:!1,relevance:0,errorRaised:H,_emitter:Te,_top:J};throw H}}function N(A){const F={value:xr(A),illegal:!1,relevance:0,_top:c,_emitter:new u.__emitter(u)};return F._emitter.addText(A),F}function $(A,F){F=F||u.languages||Object.keys(o);const U=N(A),G=F.filter(Y).filter(ae).map(xe=>w(xe,A,!1));G.unshift(U);const le=G.sort((xe,y)=>{if(xe.relevance!==y.relevance)return y.relevance-xe.relevance;if(xe.language&&y.language){if(Y(xe.language).supersetOf===y.language)return 1;if(Y(y.language).supersetOf===xe.language)return-1}return 0}),[Ne,_e]=le,Re=Ne;return Re.secondBest=_e,Re}function M(A,F,U){const G=F&&n[F]||U;A.classList.add("hljs"),A.classList.add(`language-${G}`)}function P(A){let F=null;const U=g(A);if(d(U))return;if(ie("before:highlightElement",{el:A,language:U}),A.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",A);return}if(A.children.length>0&&(u.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(A)),u.throwUnescapedHTML))throw new Mu("One of your code blocks includes unescaped HTML.",A.innerHTML);F=A;const G=F.textContent,le=U?b(G,{language:U,ignoreIllegals:!0}):$(G);A.innerHTML=le.value,A.dataset.highlighted="yes",M(A,U,le.language),A.result={language:le.language,re:le.relevance,relevance:le.relevance},le.secondBest&&(A.secondBest={language:le.secondBest.language,relevance:le.secondBest.relevance}),ie("after:highlightElement",{el:A,result:le,text:G})}function I(A){u=Oi(u,A)}const C=()=>{m(),Ln("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function E(){m(),Ln("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let k=!1;function m(){function A(){m()}if(document.readyState==="loading"){k||window.addEventListener("DOMContentLoaded",A,!1),k=!0;return}document.querySelectorAll(u.cssSelector).forEach(P)}function B(A,F){let U=null;try{U=F(t)}catch(G){if(wn("Language definition for '{}' could not be registered.".replace("{}",A)),l)wn(G);else throw G;U=c}U.name||(U.name=A),o[A]=U,U.rawDefinition=F.bind(null,t),U.aliases&&ee(U.aliases,{languageName:A})}function x(A){delete o[A];for(const F of Object.keys(n))n[F]===A&&delete n[F]}function K(){return Object.keys(o)}function Y(A){return A=(A||"").toLowerCase(),o[A]||o[n[A]]}function ee(A,{languageName:F}){typeof A=="string"&&(A=[A]),A.forEach(U=>{n[U.toLowerCase()]=F})}function ae(A){const F=Y(A);return F&&!F.disableAutodetect}function re(A){A["before:highlightBlock"]&&!A["before:highlightElement"]&&(A["before:highlightElement"]=F=>{A["before:highlightBlock"](Object.assign({block:F.el},F))}),A["after:highlightBlock"]&&!A["after:highlightElement"]&&(A["after:highlightElement"]=F=>{A["after:highlightBlock"](Object.assign({block:F.el},F))})}function q(A){re(A),r.push(A)}function Q(A){const F=r.indexOf(A);F!==-1&&r.splice(F,1)}function ie(A,F){const U=A;r.forEach(function(G){G[U]&&G[U](F)})}function z(A){return Ln("10.7.0","highlightBlock will be removed entirely in v12.0"),Ln("10.7.0","Please use highlightElement now."),P(A)}Object.assign(t,{highlight:b,highlightAuto:$,highlightAll:m,highlightElement:P,highlightBlock:z,configure:I,initHighlighting:C,initHighlightingOnLoad:E,registerLanguage:B,unregisterLanguage:x,listLanguages:K,getLanguage:Y,registerAliases:ee,autoDetection:ae,inherit:Oi,addPlugin:q,removePlugin:Q}),t.debugMode=function(){l=!1},t.safeMode=function(){l=!0},t.versionString=_u,t.regex={concat:xn,lookahead:Si,either:kr,optional:Gd,anyNumberOfTimes:Wd};for(const A in $o)typeof $o[A]=="object"&&yi($o[A]);return Object.assign(t,$o),t},Dn=Di({});Dn.newInstance=()=>Di({});var Ru=Dn;Dn.HighlightJS=Dn,Dn.default=Dn;const wr=$d(Ru);function Nr(t){const o=t.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:o.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const l={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},s=t.inherit(t.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),c={begin:/<<-?\s*(?=\w+)/,starts:{contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},u={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,n,l]};l.contains.push(u);const d={match:/\\"/},g={className:"string",begin:/'/,end:/'/},b={match:/\\'/},w={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,n]},N=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],$=t.SHEBANG({binary:`(${N.join("|")})`,relevance:10}),M={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},P=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],I=["true","false"],C={match:/(\/[a-z._-]+)+/},E=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],k=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],m=["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"],B=["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:P,literal:I,built_in:[...E,...k,"set","shopt",...m,...B]},contains:[$,t.SHEBANG(),M,w,s,c,C,u,d,g,b,n]}}const Bu=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.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:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.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_-]*/}}),Iu=["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"],zu=["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"],Ou=[...Iu,...zu],Lu=["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(),Du=["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(),Vu=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),$u=["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 Pu(t){const o=t.regex,n=Bu(t),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},l="and or not only",s=/@-?\w[\w]*(-\w+)*/,c="[a-zA-Z-][a-zA-Z0-9_-]*",u=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+c,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+Du.join("|")+")"},{begin:":(:)?("+Vu.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+$u.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...u,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...u,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:o.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:s},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:l,attribute:Lu.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...u,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Ou.join("|")+")\\b"}]}}function Vi(t){const s={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:s,illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"string",variants:[t.QUOTE_STRING_MODE,t.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:[t.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:s,illegal:/["']/}]}]}}var Vn="[0-9](_*[0-9])*",Uo=`\\.(${Vn})`,Fo="[0-9a-fA-F](_*[0-9a-fA-F])*",$i={className:"number",variants:[{begin:`(\\b(${Vn})((${Uo})|\\.)?|(${Uo}))[eE][+-]?(${Vn})[fFdD]?\\b`},{begin:`\\b(${Vn})((${Uo})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Uo})[fFdD]?\\b`},{begin:`\\b(${Vn})[fFdD]\\b`},{begin:`\\b0[xX]((${Fo})\\.?|(${Fo})?\\.(${Fo}))[pP][+-]?(${Vn})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Fo})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Pi(t,o,n){return n===-1?"":t.replace(o,r=>Pi(t,o,n-1))}function Uu(t){const o=t.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=n+Pi("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),d={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},g={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},b={className:"params",begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[t.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:d,illegal:/<\/|#/,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[t.BACKSLASH_ESCAPE]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[o.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[b,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",t.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:d,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[g,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,$i,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},$i,g]}}const Ui="[A-Za-z$_][0-9A-Za-z$_]*",Fu=["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"],Hu=["true","false","null","undefined","NaN","Infinity"],Fi=["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"],Hi=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Wi=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Wu=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Gu=[].concat(Wi,Fi,Hi);function Gi(t){const o=t.regex,n=(U,{after:G})=>{const le="</"+U[0].slice(1);return U.input.indexOf(le,G)!==-1},r=Ui,l={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,c={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(U,G)=>{const le=U[0].length+U.index,Ne=U.input[le];if(Ne==="<"||Ne===","){G.ignoreMatch();return}Ne===">"&&(n(U,{after:le})||G.ignoreMatch());let _e;const Re=U.input.substring(le);if(_e=Re.match(/^\s*=/)){G.ignoreMatch();return}if((_e=Re.match(/^\s+extends\s+/))&&_e.index===0){G.ignoreMatch();return}}},u={$pattern:Ui,keyword:Fu,literal:Hu,built_in:Gu,"variable.language":Wu},d="[0-9](_?[0-9])*",g=`\\.(${d})`,b="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",w={className:"number",variants:[{begin:`(\\b(${b})((${g})|\\.)?|(${g}))[eE][+-]?(${d})\\b`},{begin:`\\b(${b})\\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},N={className:"subst",begin:"\\$\\{",end:"\\}",keywords:u,contains:[]},$={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,N],subLanguage:"xml"}},M={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,N],subLanguage:"css"}},P={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,N],subLanguage:"graphql"}},I={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,N]},E={className:"comment",variants:[t.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}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},k=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,$,M,P,I,{match:/\$\d+/},w];N.contains=k.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(k)});const m=[].concat(E,N.contains),B=m.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(m)}]),x={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:B},K={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,o.concat(r,"(",o.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},Y={relevance:0,match:o.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:{_:[...Fi,...Hi]}},ee={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},ae={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[x],illegal:/%/},re={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function q(U){return o.concat("(?!",U.join("|"),")")}const Q={match:o.concat(/\b/,q([...Wi,"super","import"].map(U=>`${U}\\s*\\(`)),r,o.lookahead(/\s*\(/)),className:"title.function",relevance:0},ie={begin:o.concat(/\./,o.lookahead(o.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},z={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},x]},A="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",F={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,o.lookahead(A)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[x]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:B,CLASS_REFERENCE:Y},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),ee,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,$,M,P,I,E,{match:/\$\d+/},w,Y,{scope:"attr",match:r+o.lookahead(":"),relevance:0},F,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[E,t.REGEXP_MODE,{className:"function",begin:A,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:B}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:l.begin,end:l.end},{match:s},{begin:c.begin,"on:begin":c.isTrulyOpeningTag,end:c.end}],subLanguage:"xml",contains:[{begin:c.begin,end:c.end,skip:!0,contains:["self"]}]}]},ae,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[x,t.inherit(t.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},ie,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[x]},Q,re,K,z,{match:/\$[(.]/}]}}function ju(t){const o={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],l={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[o,n,t.QUOTE_STRING_MODE,l,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function ji(t){const o=t.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},l={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},s={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},c={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},u=/[A-Za-z][A-Za-z0-9+.-]*/,d={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:o.concat(/\[.+?\]\(/,u,/:\/\/.*?\)/),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}/}]},b={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},w=t.inherit(g,{contains:[]}),N=t.inherit(b,{contains:[]});g.contains.push(N),b.contains.push(w);let $=[n,d];return[g,b,w,N].forEach(C=>{C.contains=C.contains.concat($)}),$=$.concat(g,b),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:$},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:$}]}]},n,s,g,b,{className:"quote",begin:"^>\\s+",contains:$,end:"$"},l,r,d,c,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function Ki(t){const o=t.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],u={$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:u,illegal:/#/},b={begin:/\{\{/,relevance:0},w={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,d],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,d],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,d,b,g]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,d,b,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:[t.BACKSLASH_ESCAPE,b,g]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,b,g]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},N="[0-9](_?[0-9])*",$=`(\\b(${N}))?\\.(${N})|\\b(${N})\\.`,M=`\\b|${r.join("|")}`,P={className:"number",relevance:0,variants:[{begin:`(\\b(${N})|(${$}))[eE][+-]?(${N})[jJ]?(?=${M})`},{begin:`(${$})[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(${N})[jJ](?=${M})`}]},I={className:"comment",begin:o.lookahead(/# type:/),end:/$/,keywords:u,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},C={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:["self",d,P,w,t.HASH_COMMENT_MODE]}]};return g.contains=[w,P,d],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:u,illegal:/(<\/|\?)|=>/,contains:[d,P,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},w,I,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[C]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[P,C,w]}]}}function Yi(t){const o=t.regex,n=/(r#)?/,r=o.concat(n,t.UNDERSCORE_IDENT_RE),l=o.concat(n,t.IDENT_RE),s={className:"title.function.invoke",relevance:0,begin:o.concat(/\b/,/(?!let|for|while|if|else|match\b)/,l,o.lookahead(/\s*\(/))},c="([ui](8|16|32|64|128|size)|f(32|64))?",u=["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!"],b=["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:t.IDENT_RE+"!?",type:b,keyword:u,literal:d,built_in:g},illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.COMMENT("/\\*","\\*/",{contains:["self"]}),t.inherit(t.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_]+)"+c},{begin:"\\b0o([0-7_]+)"+c},{begin:"\\b0x([A-Fa-f0-9_]+)"+c},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+c}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[t.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:t.IDENT_RE+"::",keywords:{keyword:"Self",built_in:g,type:b}},{className:"punctuation",begin:"->"},s]}}function Ku(t){const o=t.regex,n=t.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},l={begin:/"/,end:/"/,contains:[{match:/""/}]},s=["true","false","unknown"],c=["double precision","large object","with timezone","without timezone"],u=["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"],b=["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"],w=["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"],N=["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"],$=b,M=[...g,...d].filter(B=>!b.includes(B)),P={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},I={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},C={match:o.concat(/\b/,o.either(...$),/\s*\(/),relevance:0,keywords:{built_in:$}};function E(B){return o.concat(/\b/,o.either(...B.map(x=>x.replace(/\s+/,"\\s+"))),/\b/)}const k={scope:"keyword",match:E(N),relevance:0};function m(B,{exceptions:x,when:K}={}){const Y=K;return x=x||[],B.map(ee=>ee.match(/\|\d+$/)||x.includes(ee)?ee:Y(ee)?`${ee}|0`:ee)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:m(M,{when:B=>B.length<3}),literal:s,type:u,built_in:w},contains:[{scope:"type",match:E(c)},k,C,P,r,l,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,n,I]}}const Ho="[A-Za-z$_][0-9A-Za-z$_]*",qi=["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"],Xi=["true","false","null","undefined","NaN","Infinity"],Zi=["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"],Ji=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Qi=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],el=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],tl=[].concat(Qi,Zi,Ji);function Yu(t){const o=t.regex,n=(U,{after:G})=>{const le="</"+U[0].slice(1);return U.input.indexOf(le,G)!==-1},r=Ho,l={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,c={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(U,G)=>{const le=U[0].length+U.index,Ne=U.input[le];if(Ne==="<"||Ne===","){G.ignoreMatch();return}Ne===">"&&(n(U,{after:le})||G.ignoreMatch());let _e;const Re=U.input.substring(le);if(_e=Re.match(/^\s*=/)){G.ignoreMatch();return}if((_e=Re.match(/^\s+extends\s+/))&&_e.index===0){G.ignoreMatch();return}}},u={$pattern:Ho,keyword:qi,literal:Xi,built_in:tl,"variable.language":el},d="[0-9](_?[0-9])*",g=`\\.(${d})`,b="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",w={className:"number",variants:[{begin:`(\\b(${b})((${g})|\\.)?|(${g}))[eE][+-]?(${d})\\b`},{begin:`\\b(${b})\\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},N={className:"subst",begin:"\\$\\{",end:"\\}",keywords:u,contains:[]},$={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,N],subLanguage:"xml"}},M={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,N],subLanguage:"css"}},P={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,N],subLanguage:"graphql"}},I={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,N]},E={className:"comment",variants:[t.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}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},k=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,$,M,P,I,{match:/\$\d+/},w];N.contains=k.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(k)});const m=[].concat(E,N.contains),B=m.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(m)}]),x={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:B},K={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,o.concat(r,"(",o.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},Y={relevance:0,match:o.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:{_:[...Zi,...Ji]}},ee={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},ae={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[x],illegal:/%/},re={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function q(U){return o.concat("(?!",U.join("|"),")")}const Q={match:o.concat(/\b/,q([...Qi,"super","import"].map(U=>`${U}\\s*\\(`)),r,o.lookahead(/\s*\(/)),className:"title.function",relevance:0},ie={begin:o.concat(/\./,o.lookahead(o.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},z={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},x]},A="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",F={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,o.lookahead(A)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[x]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:B,CLASS_REFERENCE:Y},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),ee,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,$,M,P,I,E,{match:/\$\d+/},w,Y,{scope:"attr",match:r+o.lookahead(":"),relevance:0},F,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[E,t.REGEXP_MODE,{className:"function",begin:A,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:B}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:l.begin,end:l.end},{match:s},{begin:c.begin,"on:begin":c.isTrulyOpeningTag,end:c.end}],subLanguage:"xml",contains:[{begin:c.begin,end:c.end,skip:!0,contains:["self"]}]}]},ae,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[x,t.inherit(t.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},ie,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[x]},Q,re,K,z,{match:/\$[(.]/}]}}function nl(t){const o=t.regex,n=Yu(t),r=Ho,l=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],s={begin:[/namespace/,/\s+/,t.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},c={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:l},contains:[n.exports.CLASS_REFERENCE]},u={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},d=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],g={$pattern:Ho,keyword:qi.concat(d),literal:Xi,built_in:tl.concat(l),"variable.language":el},b={className:"meta",begin:"@"+r},w=(P,I,C)=>{const E=P.contains.findIndex(k=>k.label===I);if(E===-1)throw new Error("can not find mode to replace");P.contains.splice(E,1,C)};Object.assign(n.keywords,g),n.exports.PARAMS_CONTAINS.push(b);const N=n.contains.find(P=>P.scope==="attr"),$=Object.assign({},N,{match:o.concat(r,o.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,N,$]),n.contains=n.contains.concat([b,s,c,$]),w(n,"shebang",t.SHEBANG()),w(n,"use_strict",u);const M=n.contains.find(P=>P.label==="func.def");return M.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function ol(t){const o=t.regex,n=o.concat(/[\p{L}_]/u,o.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]+;/},s={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},c=t.inherit(s,{begin:/\(/,end:/\)/}),u=t.inherit(t.APOS_STRING_MODE,{className:"string"}),d=t.inherit(t.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:[s,d,u,c,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[s,c,d,u]}]}]},t.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:o.concat(/</,o.lookahead(o.concat(n,o.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:g}]},{className:"tag",begin:o.concat(/<\//,o.lookahead(o.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function rl(t){const o="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},l={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},s={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},c={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,l]},u=t.inherit(c,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),N={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"},$={end:",",endsWithParent:!0,excludeEnd:!0,keywords:o,relevance:0},M={begin:/\{/,end:/\}/,contains:[$],illegal:"\\n",relevance:0},P={begin:"\\[",end:"\\]",contains:[$],illegal:"\\n",relevance:0},I=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:o,keywords:{literal:o}},N,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},M,P,s,c],C=[...I];return C.pop(),C.push(u),$.contains=C,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:I}}const Sr={bash:Nr,sh:Nr,shell:Nr,css:Pu,go:Vi,golang:Vi,java:Uu,javascript:Gi,js:Gi,json:ju,markdown:ji,md:ji,python:Ki,py:Ki,rust:Yi,rs:Yi,sql:Ku,typescript:nl,ts:nl,xml:ol,html:ol,yaml:rl,yml:rl};for(const[t,o]of Object.entries(Sr))wr.registerLanguage(t,o);function Wo(t){const o=t.split(`
59
+ `);return/^(`{3,}|~{3,})/.test(o[0]??"")&&o.shift(),/^(`{3,}|~{3,})\s*$/.test(o[o.length-1]??"")&&o.pop(),o.join(`
60
+ `).replace(/\n+$/,"")}function Nn(t){const o=/^(`{3,}|~{3,})([^\s`~]*)/.exec(t.split(`
61
+ `)[0]??""),n=((o==null?void 0:o[2])??"").toLowerCase();return n&&Sr[n]?n:""}function Tr(t,o){const n=o&&Sr[o]?o:"";try{return n?wr.highlight(t,{language:n,ignoreIllegals:!0}).value:wr.highlightAuto(t).value}catch{return qu(t)}}function Cr(t){return t.split(`
62
+ `).filter(o=>o.trim().length>0).filter(o=>!/^\s*\|?\s*(:?-+:?\s*\|\s*)+(:?-+:?)(\s*\|)?\s*$/.test(o)).map(o=>o.replace(/^\s*\|/,"").replace(/\|\s*$/,"").split("|").map(n=>n.trim()))}function qu(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function il(t,o,n){if(t.length<=1)return t.slice();const[r,...l]=t,s=l.map(g=>g[o]??""),c=s.length>0&&s.every(g=>g.trim()!==""&&!Number.isNaN(Number(g))),u=n==="asc"?1:-1,d=l.slice().sort((g,b)=>{const w=g[o]??"",N=b[o]??"";return c?(Number(w)-Number(N))*u:w.localeCompare(N,"zh-Hans-CN",{numeric:!0})*u});return[r,...d]}function Ar(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Sn=Ar();function ll(t){Sn=t}var Tn={exec:()=>null};function $n(t){let o=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),l=o[r];return l||(l=t(r),o[r]=l),l}}function Ee(t,o=""){let n=typeof t=="string"?t:t.source,r={replace:(l,s)=>{let c=typeof s=="string"?s:s.source;return c=c.replace(ot.caret,"$1"),n=n.replace(l,c),r},getRegex:()=>new RegExp(n,o)};return r}var Xu=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),ot={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:$n(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:$n(t=>new RegExp(`^ {0,${t}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:$n(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:$n(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:$n(t=>new RegExp(`^ {0,${t}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:$n(t=>new RegExp(`^ {0,${t}}>`))},Zu=/^(?:[ \t]*(?:\n|$))+/,Ju=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Qu=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,lo=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ef=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,_r=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,al=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,sl=Ee(al).replace(/bull/g,_r).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),tf=Ee(al).replace(/bull/g,_r).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Mr=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,nf=/^[^\n]+/,vr=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,of=Ee(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",vr).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),rf=Ee(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,_r).getRegex(),Go="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Rr=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,lf=Ee("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Rr).replace("tag",Go).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),cl=Ee(Mr).replace("hr",lo).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Go).getRegex(),af=Ee(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",cl).getRegex(),Br={blockquote:af,code:Ju,def:of,fences:Qu,heading:ef,hr:lo,html:lf,lheading:sl,list:rf,newline:Zu,paragraph:cl,table:Tn,text:nf},dl=Ee("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",lo).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Go).getRegex(),sf={...Br,lheading:tf,table:dl,paragraph:Ee(Mr).replace("hr",lo).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",dl).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Go).getRegex()},cf={...Br,html:Ee(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Rr).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Tn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Ee(Mr).replace("hr",lo).replace("heading",` *#{1,6} *[^
63
+ ]`).replace("lheading",sl).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},df=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,uf=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ul=/^( {2,}|\\)\n(?!\s*$)/,ff=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Pn=/[\p{P}\p{S}]/u,jo=/[\s\p{P}\p{S}]/u,Ir=/[^\s\p{P}\p{S}]/u,mf=Ee(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,jo).getRegex(),fl=/(?!~)[\p{P}\p{S}]/u,pf=/(?!~)[\s\p{P}\p{S}]/u,gf=/(?:[^\s\p{P}\p{S}]|~)/u,hf=Ee(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Xu?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),ml=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,bf=Ee(ml,"u").replace(/punct/g,Pn).getRegex(),kf=Ee(ml,"u").replace(/punct/g,fl).getRegex(),pl="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",yf=Ee(pl,"gu").replace(/notPunctSpace/g,Ir).replace(/punctSpace/g,jo).replace(/punct/g,Pn).getRegex(),Ef=Ee(pl,"gu").replace(/notPunctSpace/g,gf).replace(/punctSpace/g,pf).replace(/punct/g,fl).getRegex(),xf=Ee("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Ir).replace(/punctSpace/g,jo).replace(/punct/g,Pn).getRegex(),wf=Ee(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Pn).getRegex(),Nf="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Sf=Ee(Nf,"gu").replace(/notPunctSpace/g,Ir).replace(/punctSpace/g,jo).replace(/punct/g,Pn).getRegex(),Tf=Ee(/\\(punct)/,"gu").replace(/punct/g,Pn).getRegex(),Cf=Ee(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Af=Ee(Rr).replace("(?:-->|$)","-->").getRegex(),_f=Ee("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Af).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ko=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Mf=Ee(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Ko).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),gl=Ee(/^!?\[(label)\]\[(ref)\]/).replace("label",Ko).replace("ref",vr).getRegex(),hl=Ee(/^!?\[(ref)\](?:\[\])?/).replace("ref",vr).getRegex(),vf=Ee("reflink|nolink(?!\\()","g").replace("reflink",gl).replace("nolink",hl).getRegex(),bl=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,zr={_backpedal:Tn,anyPunctuation:Tf,autolink:Cf,blockSkip:hf,br:ul,code:uf,del:Tn,delLDelim:Tn,delRDelim:Tn,emStrongLDelim:bf,emStrongRDelimAst:yf,emStrongRDelimUnd:xf,escape:df,link:Mf,nolink:hl,punctuation:mf,reflink:gl,reflinkSearch:vf,tag:_f,text:ff,url:Tn},Rf={...zr,link:Ee(/^!?\[(label)\]\((.*?)\)/).replace("label",Ko).getRegex(),reflink:Ee(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ko).getRegex()},Or={...zr,emStrongRDelimAst:Ef,emStrongLDelim:kf,delLDelim:wf,delRDelim:Sf,url:Ee(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",bl).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Ee(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",bl).getRegex()},Bf={...Or,br:Ee(ul).replace("{2,}","*").getRegex(),text:Ee(Or.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Yo={normal:Br,gfm:sf,pedantic:cf},ao={normal:zr,gfm:Or,breaks:Bf,pedantic:Rf},If={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},kl=t=>If[t];function jt(t,o){if(o){if(ot.escapeTest.test(t))return t.replace(ot.escapeReplace,kl)}else if(ot.escapeTestNoEncode.test(t))return t.replace(ot.escapeReplaceNoEncode,kl);return t}function yl(t){try{t=encodeURI(t).replace(ot.percentDecode,"%")}catch{return null}return t}function El(t,o){var s;let n=t.replace(ot.findPipe,(c,u,d)=>{let g=!1,b=u;for(;--b>=0&&d[b]==="\\";)g=!g;return g?"|":" |"}),r=n.split(ot.splitPipe),l=0;if(r[0].trim()||r.shift(),r.length>0&&!((s=r.at(-1))!=null&&s.trim())&&r.pop(),o)if(r.length>o)r.splice(o);else for(;r.length<o;)r.push("");for(;l<r.length;l++)r[l]=r[l].trim().replace(ot.slashPipe,"|");return r}function un(t,o,n){let r=t.length;if(r===0)return"";let l=0;for(;l<r&&t.charAt(r-l-1)===o;)l++;return t.slice(0,r-l)}function xl(t){let o=t.split(`
70
64
  `),n=o.length-1;for(;n>=0&&ot.blankLine.test(o[n]);)n--;return o.length-n<=2?t:o.slice(0,n+1).join(`
71
- `)}function Hf(t,o){if(t.indexOf(o[1])===-1)return-1;let n=0;for(let r=0;r<t.length;r++)if(t[r]==="\\")r++;else if(t[r]===o[0])n++;else if(t[r]===o[1]&&(n--,n<0))return r;return n>0?-2:-1}function Wf(t,o=0){let n=o,r="";for(let i of t)if(i===" "){let s=4-n%4;r+=" ".repeat(s),n+=s}else r+=i,n++;return r}function pl(t,o,n,r,i){let s=o.href,c=o.title||null,u=t[1].replace(i.other.outputLinkReplace,"$1");r.state.inLink=!0;let d={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:s,title:c,text:u,tokens:r.inlineTokens(u)};return r.state.inLink=!1,d}function Gf(t,o,n){let r=t.match(n.other.indentCodeCompensation);if(r===null)return o;let i=r[1];return o.split(`
72
- `).map(s=>{let c=s.match(n.other.beginningSpace);if(c===null)return s;let[u]=c;return u.length>=i.length?s.slice(i.length):s}).join(`
73
- `)}var jo=class{constructor(t){Re(this,"options");Re(this,"rules");Re(this,"lexer");this.options=t||_n}space(t){let o=this.rules.block.newline.exec(t);if(o&&o[0].length>0)return{type:"space",raw:o[0]}}code(t){let o=this.rules.block.code.exec(t);if(o){let n=this.options.pedantic?o[0]:ml(o[0]),r=n.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n,codeBlockStyle:"indented",text:r}}}fences(t){let o=this.rules.block.fences.exec(t);if(o){let n=o[0],r=Gf(n,o[3]||"",this.rules);return{type:"code",raw:n,lang:o[2]?o[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):o[2],text:r}}}heading(t){let o=this.rules.block.heading.exec(t);if(o){let n=o[2].trim();if(this.rules.other.endingHash.test(n)){let r=mn(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:mn(o[0],`
74
- `),depth:o[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){let o=this.rules.block.hr.exec(t);if(o)return{type:"hr",raw:mn(o[0],`
75
- `)}}blockquote(t){let o=this.rules.block.blockquote.exec(t);if(o){let n=mn(o[0],`
65
+ `)}function zf(t,o){if(t.indexOf(o[1])===-1)return-1;let n=0;for(let r=0;r<t.length;r++)if(t[r]==="\\")r++;else if(t[r]===o[0])n++;else if(t[r]===o[1]&&(n--,n<0))return r;return n>0?-2:-1}function Of(t,o=0){let n=o,r="";for(let l of t)if(l===" "){let s=4-n%4;r+=" ".repeat(s),n+=s}else r+=l,n++;return r}function wl(t,o,n,r,l){let s=o.href,c=o.title||null,u=t[1].replace(l.other.outputLinkReplace,"$1");r.state.inLink=!0;let d={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:s,title:c,text:u,tokens:r.inlineTokens(u)};return r.state.inLink=!1,d}function Lf(t,o,n){let r=t.match(n.other.indentCodeCompensation);if(r===null)return o;let l=r[1];return o.split(`
66
+ `).map(s=>{let c=s.match(n.other.beginningSpace);if(c===null)return s;let[u]=c;return u.length>=l.length?s.slice(l.length):s}).join(`
67
+ `)}var qo=class{constructor(t){ve(this,"options");ve(this,"rules");ve(this,"lexer");this.options=t||Sn}space(t){let o=this.rules.block.newline.exec(t);if(o&&o[0].length>0)return{type:"space",raw:o[0]}}code(t){let o=this.rules.block.code.exec(t);if(o){let n=this.options.pedantic?o[0]:xl(o[0]),r=n.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n,codeBlockStyle:"indented",text:r}}}fences(t){let o=this.rules.block.fences.exec(t);if(o){let n=o[0],r=Lf(n,o[3]||"",this.rules);return{type:"code",raw:n,lang:o[2]?o[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):o[2],text:r}}}heading(t){let o=this.rules.block.heading.exec(t);if(o){let n=o[2].trim();if(this.rules.other.endingHash.test(n)){let r=un(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:un(o[0],`
68
+ `),depth:o[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){let o=this.rules.block.hr.exec(t);if(o)return{type:"hr",raw:un(o[0],`
69
+ `)}}blockquote(t){let o=this.rules.block.blockquote.exec(t);if(o){let n=un(o[0],`
76
70
  `).split(`
77
- `),r="",i="",s=[];for(;n.length>0;){let c=!1,u=[],d;for(d=0;d<n.length;d++)if(this.rules.other.blockquoteStart.test(n[d]))u.push(n[d]),c=!0;else if(!c)u.push(n[d]);else break;n=n.slice(d);let g=u.join(`
71
+ `),r="",l="",s=[];for(;n.length>0;){let c=!1,u=[],d;for(d=0;d<n.length;d++)if(this.rules.other.blockquoteStart.test(n[d]))u.push(n[d]),c=!0;else if(!c)u.push(n[d]);else break;n=n.slice(d);let g=u.join(`
78
72
  `),b=g.replace(this.rules.other.blockquoteSetextReplace,`
79
73
  $1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
80
- ${g}`:g,i=i?`${i}
81
- ${b}`:b;let w=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(b,s,!0),this.lexer.state.top=w,n.length===0)break;let N=s.at(-1);if((N==null?void 0:N.type)==="code")break;if((N==null?void 0:N.type)==="blockquote"){let V=N,_=V.raw+`
74
+ ${g}`:g,l=l?`${l}
75
+ ${b}`:b;let w=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(b,s,!0),this.lexer.state.top=w,n.length===0)break;let N=s.at(-1);if((N==null?void 0:N.type)==="code")break;if((N==null?void 0:N.type)==="blockquote"){let $=N,M=$.raw+`
82
76
  `+n.join(`
83
- `),$=this.blockquote(_);s[s.length-1]=$,r=r.substring(0,r.length-V.raw.length)+$.raw,i=i.substring(0,i.length-V.text.length)+$.text;break}else if((N==null?void 0:N.type)==="list"){let V=N,_=V.raw+`
77
+ `),P=this.blockquote(M);s[s.length-1]=P,r=r.substring(0,r.length-$.raw.length)+P.raw,l=l.substring(0,l.length-$.text.length)+P.text;break}else if((N==null?void 0:N.type)==="list"){let $=N,M=$.raw+`
84
78
  `+n.join(`
85
- `),$=this.list(_);s[s.length-1]=$,r=r.substring(0,r.length-N.raw.length)+$.raw,i=i.substring(0,i.length-V.raw.length)+$.raw,n=_.substring(s.at(-1).raw.length).split(`
86
- `);continue}}return{type:"blockquote",raw:r,tokens:s,text:i}}}list(t){let o=this.rules.block.list.exec(t);if(o){let n=o[1].trim(),r=n.length>1,i={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");let s=this.rules.other.listItemRegex(n),c=!1;for(;t;){let d=!1,g="",b="";if(!(o=s.exec(t))||this.rules.block.hr.test(t))break;g=o[0],t=t.substring(g.length);let w=Wf(o[2].split(`
79
+ `),P=this.list(M);s[s.length-1]=P,r=r.substring(0,r.length-N.raw.length)+P.raw,l=l.substring(0,l.length-$.raw.length)+P.raw,n=M.substring(s.at(-1).raw.length).split(`
80
+ `);continue}}return{type:"blockquote",raw:r,tokens:s,text:l}}}list(t){let o=this.rules.block.list.exec(t);if(o){let n=o[1].trim(),r=n.length>1,l={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");let s=this.rules.other.listItemRegex(n),c=!1;for(;t;){let d=!1,g="",b="";if(!(o=s.exec(t))||this.rules.block.hr.test(t))break;g=o[0],t=t.substring(g.length);let w=Of(o[2].split(`
87
81
  `,1)[0],o[1].length),N=t.split(`
88
- `,1)[0],V=!w.trim(),_=0;if(this.options.pedantic?(_=2,b=w.trimStart()):V?_=o[1].length+1:(_=w.search(this.rules.other.nonSpaceChar),_=_>4?1:_,b=w.slice(_),_+=o[1].length),V&&this.rules.other.blankLine.test(N)&&(g+=N+`
89
- `,t=t.substring(N.length+1),d=!0),!d){let $=this.rules.other.nextBulletRegex(_),B=this.rules.other.hrRegex(_),T=this.rules.other.fencesBeginRegex(_),E=this.rules.other.headingBeginRegex(_),k=this.rules.other.htmlBeginRegex(_),m=this.rules.other.blockquoteBeginRegex(_);for(;t;){let v=t.split(`
90
- `,1)[0],x;if(N=v,this.options.pedantic?(N=N.replace(this.rules.other.listReplaceNesting," "),x=N):x=N.replace(this.rules.other.tabCharGlobal," "),T.test(N)||E.test(N)||k.test(N)||m.test(N)||$.test(N)||B.test(N))break;if(x.search(this.rules.other.nonSpaceChar)>=_||!N.trim())b+=`
91
- `+x.slice(_);else{if(V||w.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||T.test(w)||E.test(w)||B.test(w))break;b+=`
92
- `+N}V=!N.trim(),g+=v+`
93
- `,t=t.substring(v.length+1),w=x.slice(_)}}i.loose||(c?i.loose=!0:this.rules.other.doubleBlankLine.test(g)&&(c=!0)),i.items.push({type:"list_item",raw:g,task:!!this.options.gfm&&this.rules.other.listIsTask.test(b),loose:!1,text:b,tokens:[]}),i.raw+=g}let u=i.items.at(-1);if(u)u.raw=u.raw.trimEnd(),u.text=u.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let d of i.items){this.lexer.state.top=!1,d.tokens=this.lexer.blockTokens(d.text,[]);let g=d.tokens[0];if(d.task&&((g==null?void 0:g.type)==="text"||(g==null?void 0:g.type)==="paragraph")){d.text=d.text.replace(this.rules.other.listReplaceTask,""),g.raw=g.raw.replace(this.rules.other.listReplaceTask,""),g.text=g.text.replace(this.rules.other.listReplaceTask,"");for(let w=this.lexer.inlineQueue.length-1;w>=0;w--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[w].src)){this.lexer.inlineQueue[w].src=this.lexer.inlineQueue[w].src.replace(this.rules.other.listReplaceTask,"");break}let b=this.rules.other.listTaskCheckbox.exec(d.raw);if(b){let w={type:"checkbox",raw:b[0]+" ",checked:b[0]!=="[ ]"};d.checked=w.checked,i.loose?d.tokens[0]&&["paragraph","text"].includes(d.tokens[0].type)&&"tokens"in d.tokens[0]&&d.tokens[0].tokens?(d.tokens[0].raw=w.raw+d.tokens[0].raw,d.tokens[0].text=w.raw+d.tokens[0].text,d.tokens[0].tokens.unshift(w)):d.tokens.unshift({type:"paragraph",raw:w.raw,text:w.raw,tokens:[w]}):d.tokens.unshift(w)}}else d.task&&(d.task=!1);if(!i.loose){let b=d.tokens.filter(N=>N.type==="space"),w=b.length>0&&b.some(N=>this.rules.other.anyLine.test(N.raw));i.loose=w}}if(i.loose)for(let d of i.items){d.loose=!0;for(let g of d.tokens)g.type==="text"&&(g.type="paragraph")}return i}}html(t){let o=this.rules.block.html.exec(t);if(o){let n=ml(o[0]);return{type:"html",block:!0,raw:n,pre:o[1]==="pre"||o[1]==="script"||o[1]==="style",text:n}}}def(t){let o=this.rules.block.def.exec(t);if(o){let n=o[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=o[2]?o[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=o[3]?o[3].substring(1,o[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):o[3];return{type:"def",tag:n,raw:mn(o[0],`
94
- `),href:r,title:i}}}table(t){var c;let o=this.rules.block.table.exec(t);if(!o||!this.rules.other.tableDelimiter.test(o[2]))return;let n=fl(o[1]),r=o[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=(c=o[3])!=null&&c.trim()?o[3].replace(this.rules.other.tableRowBlankLine,"").split(`
95
- `):[],s={type:"table",raw:mn(o[0],`
96
- `),header:[],align:[],rows:[]};if(n.length===r.length){for(let u of r)this.rules.other.tableAlignRight.test(u)?s.align.push("right"):this.rules.other.tableAlignCenter.test(u)?s.align.push("center"):this.rules.other.tableAlignLeft.test(u)?s.align.push("left"):s.align.push(null);for(let u=0;u<n.length;u++)s.header.push({text:n[u],tokens:this.lexer.inline(n[u]),header:!0,align:s.align[u]});for(let u of i)s.rows.push(fl(u,s.header.length).map((d,g)=>({text:d,tokens:this.lexer.inline(d),header:!1,align:s.align[g]})));return s}}lheading(t){let o=this.rules.block.lheading.exec(t);if(o){let n=o[1].trim();return{type:"heading",raw:mn(o[0],`
82
+ `,1)[0],$=!w.trim(),M=0;if(this.options.pedantic?(M=2,b=w.trimStart()):$?M=o[1].length+1:(M=w.search(this.rules.other.nonSpaceChar),M=M>4?1:M,b=w.slice(M),M+=o[1].length),$&&this.rules.other.blankLine.test(N)&&(g+=N+`
83
+ `,t=t.substring(N.length+1),d=!0),!d){let P=this.rules.other.nextBulletRegex(M),I=this.rules.other.hrRegex(M),C=this.rules.other.fencesBeginRegex(M),E=this.rules.other.headingBeginRegex(M),k=this.rules.other.htmlBeginRegex(M),m=this.rules.other.blockquoteBeginRegex(M);for(;t;){let B=t.split(`
84
+ `,1)[0],x;if(N=B,this.options.pedantic?(N=N.replace(this.rules.other.listReplaceNesting," "),x=N):x=N.replace(this.rules.other.tabCharGlobal," "),C.test(N)||E.test(N)||k.test(N)||m.test(N)||P.test(N)||I.test(N))break;if(x.search(this.rules.other.nonSpaceChar)>=M||!N.trim())b+=`
85
+ `+x.slice(M);else{if($||w.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||C.test(w)||E.test(w)||I.test(w))break;b+=`
86
+ `+N}$=!N.trim(),g+=B+`
87
+ `,t=t.substring(B.length+1),w=x.slice(M)}}l.loose||(c?l.loose=!0:this.rules.other.doubleBlankLine.test(g)&&(c=!0)),l.items.push({type:"list_item",raw:g,task:!!this.options.gfm&&this.rules.other.listIsTask.test(b),loose:!1,text:b,tokens:[]}),l.raw+=g}let u=l.items.at(-1);if(u)u.raw=u.raw.trimEnd(),u.text=u.text.trimEnd();else return;l.raw=l.raw.trimEnd();for(let d of l.items){this.lexer.state.top=!1,d.tokens=this.lexer.blockTokens(d.text,[]);let g=d.tokens[0];if(d.task&&((g==null?void 0:g.type)==="text"||(g==null?void 0:g.type)==="paragraph")){d.text=d.text.replace(this.rules.other.listReplaceTask,""),g.raw=g.raw.replace(this.rules.other.listReplaceTask,""),g.text=g.text.replace(this.rules.other.listReplaceTask,"");for(let w=this.lexer.inlineQueue.length-1;w>=0;w--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[w].src)){this.lexer.inlineQueue[w].src=this.lexer.inlineQueue[w].src.replace(this.rules.other.listReplaceTask,"");break}let b=this.rules.other.listTaskCheckbox.exec(d.raw);if(b){let w={type:"checkbox",raw:b[0]+" ",checked:b[0]!=="[ ]"};d.checked=w.checked,l.loose?d.tokens[0]&&["paragraph","text"].includes(d.tokens[0].type)&&"tokens"in d.tokens[0]&&d.tokens[0].tokens?(d.tokens[0].raw=w.raw+d.tokens[0].raw,d.tokens[0].text=w.raw+d.tokens[0].text,d.tokens[0].tokens.unshift(w)):d.tokens.unshift({type:"paragraph",raw:w.raw,text:w.raw,tokens:[w]}):d.tokens.unshift(w)}}else d.task&&(d.task=!1);if(!l.loose){let b=d.tokens.filter(N=>N.type==="space"),w=b.length>0&&b.some(N=>this.rules.other.anyLine.test(N.raw));l.loose=w}}if(l.loose)for(let d of l.items){d.loose=!0;for(let g of d.tokens)g.type==="text"&&(g.type="paragraph")}return l}}html(t){let o=this.rules.block.html.exec(t);if(o){let n=xl(o[0]);return{type:"html",block:!0,raw:n,pre:o[1]==="pre"||o[1]==="script"||o[1]==="style",text:n}}}def(t){let o=this.rules.block.def.exec(t);if(o){let n=o[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=o[2]?o[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",l=o[3]?o[3].substring(1,o[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):o[3];return{type:"def",tag:n,raw:un(o[0],`
88
+ `),href:r,title:l}}}table(t){var c;let o=this.rules.block.table.exec(t);if(!o||!this.rules.other.tableDelimiter.test(o[2]))return;let n=El(o[1]),r=o[2].replace(this.rules.other.tableAlignChars,"").split("|"),l=(c=o[3])!=null&&c.trim()?o[3].replace(this.rules.other.tableRowBlankLine,"").split(`
89
+ `):[],s={type:"table",raw:un(o[0],`
90
+ `),header:[],align:[],rows:[]};if(n.length===r.length){for(let u of r)this.rules.other.tableAlignRight.test(u)?s.align.push("right"):this.rules.other.tableAlignCenter.test(u)?s.align.push("center"):this.rules.other.tableAlignLeft.test(u)?s.align.push("left"):s.align.push(null);for(let u=0;u<n.length;u++)s.header.push({text:n[u],tokens:this.lexer.inline(n[u]),header:!0,align:s.align[u]});for(let u of l)s.rows.push(El(u,s.header.length).map((d,g)=>({text:d,tokens:this.lexer.inline(d),header:!1,align:s.align[g]})));return s}}lheading(t){let o=this.rules.block.lheading.exec(t);if(o){let n=o[1].trim();return{type:"heading",raw:un(o[0],`
97
91
  `),depth:o[2].charAt(0)==="="?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(t){let o=this.rules.block.paragraph.exec(t);if(o){let n=o[1].charAt(o[1].length-1)===`
98
- `?o[1].slice(0,-1):o[1];return{type:"paragraph",raw:o[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let o=this.rules.block.text.exec(t);if(o)return{type:"text",raw:o[0],text:o[0],tokens:this.lexer.inline(o[0])}}escape(t){let o=this.rules.inline.escape.exec(t);if(o)return{type:"escape",raw:o[0],text:o[1]}}tag(t){let o=this.rules.inline.tag.exec(t);if(o)return!this.lexer.state.inLink&&this.rules.other.startATag.test(o[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(o[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(o[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(o[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:o[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:o[0]}}link(t){let o=this.rules.inline.link.exec(t);if(o){let n=o[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let s=mn(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=Hf(o[2],"()");if(s===-2)return;if(s>-1){let c=(o[0].indexOf("!")===0?5:4)+o[1].length+s;o[2]=o[2].substring(0,s),o[0]=o[0].substring(0,c).trim(),o[3]=""}}let r=o[2],i="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(r);s&&(r=s[1],i=s[3])}else i=o[3]?o[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),pl(o,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},o[0],this.lexer,this.rules)}}reflink(t,o){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=o[r.toLowerCase()];if(!i){let s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return pl(n,i,n[0],this.lexer,this.rules)}}emStrong(t,o,n=""){let r=this.rules.inline.emStrongLDelim.exec(t);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,s,c,u=i,d=0,g=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(g.lastIndex=0,o=o.slice(-1*t.length+i);(r=g.exec(o))!==null;){if(s=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!s)continue;if(c=[...s].length,r[3]||r[4]){u+=c;continue}else if((r[5]||r[6])&&i%3&&!((i+c)%3)){d+=c;continue}if(u-=c,u>0)continue;c=Math.min(c,c+u+d);let b=[...r[0]][0].length,w=t.slice(0,i+r.index+b+c);if(Math.min(i,c)%2){let V=w.slice(1,-1);return{type:"em",raw:w,text:V,tokens:this.lexer.inlineTokens(V)}}let N=w.slice(2,-2);return{type:"strong",raw:w,text:N,tokens:this.lexer.inlineTokens(N)}}}}codespan(t){let o=this.rules.inline.code.exec(t);if(o){let n=o[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(n),i=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&i&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:o[0],text:n}}}br(t){let o=this.rules.inline.br.exec(t);if(o)return{type:"br",raw:o[0]}}del(t,o,n=""){let r=this.rules.inline.delLDelim.exec(t);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,s,c,u=i,d=this.rules.inline.delRDelim;for(d.lastIndex=0,o=o.slice(-1*t.length+i);(r=d.exec(o))!==null;){if(s=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!s||(c=[...s].length,c!==i))continue;if(r[3]||r[4]){u+=c;continue}if(u-=c,u>0)continue;c=Math.min(c,c+u);let g=[...r[0]][0].length,b=t.slice(0,i+r.index+g+c),w=b.slice(i,-i);return{type:"del",raw:b,text:w,tokens:this.lexer.inlineTokens(w)}}}}autolink(t){let o=this.rules.inline.autolink.exec(t);if(o){let n,r;return o[2]==="@"?(n=o[1],r="mailto:"+n):(n=o[1],r=n),{type:"link",raw:o[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(t){var n;let o;if(o=this.rules.inline.url.exec(t)){let r,i;if(o[2]==="@")r=o[0],i="mailto:"+r;else{let s;do s=o[0],o[0]=((n=this.rules.inline._backpedal.exec(o[0]))==null?void 0:n[0])??"";while(s!==o[0]);r=o[0],o[1]==="www."?i="http://"+o[0]:i=o[0]}return{type:"link",raw:o[0],text:r,href:i,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(t){let o=this.rules.inline.text.exec(t);if(o){let n=this.lexer.state.inRawBlock;return{type:"text",raw:o[0],text:o[0],escaped:n}}}},zt=class Kr{constructor(o){Re(this,"tokens");Re(this,"options");Re(this,"state");Re(this,"inlineQueue");Re(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=o||_n,this.options.tokenizer=this.options.tokenizer||new jo,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:ot,block:Go.normal,inline:lo.normal};this.options.pedantic?(n.block=Go.pedantic,n.inline=lo.pedantic):this.options.gfm&&(n.block=Go.gfm,this.options.breaks?n.inline=lo.breaks:n.inline=lo.gfm),this.tokenizer.rules=n}static get rules(){return{block:Go,inline:lo}}static lex(o,n){return new Kr(n).lex(o)}static lexInline(o,n){return new Kr(n).inlineTokens(o)}lex(o){o=o.replace(ot.carriageReturn,`
99
- `),this.blockTokens(o,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(o,n=[],r=!1){var s,c,u;this.tokenizer.lexer=this,this.options.pedantic&&(o=o.replace(ot.tabCharGlobal," ").replace(ot.spaceLine,""));let i=1/0;for(;o;){if(o.length<i)i=o.length;else{this.infiniteLoopError(o.charCodeAt(0));break}let d;if((c=(s=this.options.extensions)==null?void 0:s.block)!=null&&c.some(b=>(d=b.call({lexer:this},o,n))?(o=o.substring(d.raw.length),n.push(d),!0):!1))continue;if(d=this.tokenizer.space(o)){o=o.substring(d.raw.length);let b=n.at(-1);d.raw.length===1&&b!==void 0?b.raw+=`
92
+ `?o[1].slice(0,-1):o[1];return{type:"paragraph",raw:o[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let o=this.rules.block.text.exec(t);if(o)return{type:"text",raw:o[0],text:o[0],tokens:this.lexer.inline(o[0])}}escape(t){let o=this.rules.inline.escape.exec(t);if(o)return{type:"escape",raw:o[0],text:o[1]}}tag(t){let o=this.rules.inline.tag.exec(t);if(o)return!this.lexer.state.inLink&&this.rules.other.startATag.test(o[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(o[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(o[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(o[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:o[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:o[0]}}link(t){let o=this.rules.inline.link.exec(t);if(o){let n=o[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let s=un(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=zf(o[2],"()");if(s===-2)return;if(s>-1){let c=(o[0].indexOf("!")===0?5:4)+o[1].length+s;o[2]=o[2].substring(0,s),o[0]=o[0].substring(0,c).trim(),o[3]=""}}let r=o[2],l="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(r);s&&(r=s[1],l=s[3])}else l=o[3]?o[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),wl(o,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:l&&l.replace(this.rules.inline.anyPunctuation,"$1")},o[0],this.lexer,this.rules)}}reflink(t,o){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),l=o[r.toLowerCase()];if(!l){let s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return wl(n,l,n[0],this.lexer,this.rules)}}emStrong(t,o,n=""){let r=this.rules.inline.emStrongLDelim.exec(t);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let l=[...r[0]].length-1,s,c,u=l,d=0,g=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(g.lastIndex=0,o=o.slice(-1*t.length+l);(r=g.exec(o))!==null;){if(s=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!s)continue;if(c=[...s].length,r[3]||r[4]){u+=c;continue}else if((r[5]||r[6])&&l%3&&!((l+c)%3)){d+=c;continue}if(u-=c,u>0)continue;c=Math.min(c,c+u+d);let b=[...r[0]][0].length,w=t.slice(0,l+r.index+b+c);if(Math.min(l,c)%2){let $=w.slice(1,-1);return{type:"em",raw:w,text:$,tokens:this.lexer.inlineTokens($)}}let N=w.slice(2,-2);return{type:"strong",raw:w,text:N,tokens:this.lexer.inlineTokens(N)}}}}codespan(t){let o=this.rules.inline.code.exec(t);if(o){let n=o[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(n),l=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&l&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:o[0],text:n}}}br(t){let o=this.rules.inline.br.exec(t);if(o)return{type:"br",raw:o[0]}}del(t,o,n=""){let r=this.rules.inline.delLDelim.exec(t);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let l=[...r[0]].length-1,s,c,u=l,d=this.rules.inline.delRDelim;for(d.lastIndex=0,o=o.slice(-1*t.length+l);(r=d.exec(o))!==null;){if(s=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!s||(c=[...s].length,c!==l))continue;if(r[3]||r[4]){u+=c;continue}if(u-=c,u>0)continue;c=Math.min(c,c+u);let g=[...r[0]][0].length,b=t.slice(0,l+r.index+g+c),w=b.slice(l,-l);return{type:"del",raw:b,text:w,tokens:this.lexer.inlineTokens(w)}}}}autolink(t){let o=this.rules.inline.autolink.exec(t);if(o){let n,r;return o[2]==="@"?(n=o[1],r="mailto:"+n):(n=o[1],r=n),{type:"link",raw:o[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(t){var n;let o;if(o=this.rules.inline.url.exec(t)){let r,l;if(o[2]==="@")r=o[0],l="mailto:"+r;else{let s;do s=o[0],o[0]=((n=this.rules.inline._backpedal.exec(o[0]))==null?void 0:n[0])??"";while(s!==o[0]);r=o[0],o[1]==="www."?l="http://"+o[0]:l=o[0]}return{type:"link",raw:o[0],text:r,href:l,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(t){let o=this.rules.inline.text.exec(t);if(o){let n=this.lexer.state.inRawBlock;return{type:"text",raw:o[0],text:o[0],escaped:n}}}},Dt=class ni{constructor(o){ve(this,"tokens");ve(this,"options");ve(this,"state");ve(this,"inlineQueue");ve(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=o||Sn,this.options.tokenizer=this.options.tokenizer||new qo,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:ot,block:Yo.normal,inline:ao.normal};this.options.pedantic?(n.block=Yo.pedantic,n.inline=ao.pedantic):this.options.gfm&&(n.block=Yo.gfm,this.options.breaks?n.inline=ao.breaks:n.inline=ao.gfm),this.tokenizer.rules=n}static get rules(){return{block:Yo,inline:ao}}static lex(o,n){return new ni(n).lex(o)}static lexInline(o,n){return new ni(n).inlineTokens(o)}lex(o){o=o.replace(ot.carriageReturn,`
93
+ `),this.blockTokens(o,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(o,n=[],r=!1){var s,c,u;this.tokenizer.lexer=this,this.options.pedantic&&(o=o.replace(ot.tabCharGlobal," ").replace(ot.spaceLine,""));let l=1/0;for(;o;){if(o.length<l)l=o.length;else{this.infiniteLoopError(o.charCodeAt(0));break}let d;if((c=(s=this.options.extensions)==null?void 0:s.block)!=null&&c.some(b=>(d=b.call({lexer:this},o,n))?(o=o.substring(d.raw.length),n.push(d),!0):!1))continue;if(d=this.tokenizer.space(o)){o=o.substring(d.raw.length);let b=n.at(-1);d.raw.length===1&&b!==void 0?b.raw+=`
100
94
  `:n.push(d);continue}if(d=this.tokenizer.code(o)){o=o.substring(d.raw.length);let b=n.at(-1);(b==null?void 0:b.type)==="paragraph"||(b==null?void 0:b.type)==="text"?(b.raw+=(b.raw.endsWith(`
101
95
  `)?"":`
102
96
  `)+d.raw,b.text+=`
103
97
  `+d.text,this.inlineQueue.at(-1).src=b.text):n.push(d);continue}if(d=this.tokenizer.fences(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.heading(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.hr(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.blockquote(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.list(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.html(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.def(o)){o=o.substring(d.raw.length);let b=n.at(-1);(b==null?void 0:b.type)==="paragraph"||(b==null?void 0:b.type)==="text"?(b.raw+=(b.raw.endsWith(`
104
98
  `)?"":`
105
99
  `)+d.raw,b.text+=`
106
- `+d.raw,this.inlineQueue.at(-1).src=b.text):this.tokens.links[d.tag]||(this.tokens.links[d.tag]={href:d.href,title:d.title},n.push(d));continue}if(d=this.tokenizer.table(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.lheading(o)){o=o.substring(d.raw.length),n.push(d);continue}let g=o;if((u=this.options.extensions)!=null&&u.startBlock){let b=1/0,w=o.slice(1),N;this.options.extensions.startBlock.forEach(V=>{N=V.call({lexer:this},w),typeof N=="number"&&N>=0&&(b=Math.min(b,N))}),b<1/0&&b>=0&&(g=o.substring(0,b+1))}if(this.state.top&&(d=this.tokenizer.paragraph(g))){let b=n.at(-1);r&&(b==null?void 0:b.type)==="paragraph"?(b.raw+=(b.raw.endsWith(`
100
+ `+d.raw,this.inlineQueue.at(-1).src=b.text):this.tokens.links[d.tag]||(this.tokens.links[d.tag]={href:d.href,title:d.title},n.push(d));continue}if(d=this.tokenizer.table(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.lheading(o)){o=o.substring(d.raw.length),n.push(d);continue}let g=o;if((u=this.options.extensions)!=null&&u.startBlock){let b=1/0,w=o.slice(1),N;this.options.extensions.startBlock.forEach($=>{N=$.call({lexer:this},w),typeof N=="number"&&N>=0&&(b=Math.min(b,N))}),b<1/0&&b>=0&&(g=o.substring(0,b+1))}if(this.state.top&&(d=this.tokenizer.paragraph(g))){let b=n.at(-1);r&&(b==null?void 0:b.type)==="paragraph"?(b.raw+=(b.raw.endsWith(`
107
101
  `)?"":`
108
102
  `)+d.raw,b.text+=`
109
103
  `+d.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=b.text):n.push(d),r=g.length!==o.length,o=o.substring(d.raw.length);continue}if(d=this.tokenizer.text(o)){o=o.substring(d.raw.length);let b=n.at(-1);(b==null?void 0:b.type)==="text"?(b.raw+=(b.raw.endsWith(`
110
104
  `)?"":`
111
105
  `)+d.raw,b.text+=`
112
- `+d.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=b.text):n.push(d);continue}if(o){this.infiniteLoopError(o.charCodeAt(0));break}}return this.state.top=!0,n}inline(o,n=[]){return this.inlineQueue.push({src:o,tokens:n}),n}inlineTokens(o,n=[]){var g,b,w,N,V;this.tokenizer.lexer=this;let r=o,i=null;if(this.tokens.links){let _=Object.keys(this.tokens.links);if(_.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(r))!==null;)_.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(r))!==null;)r=r.slice(0,i.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let s;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(r))!==null;)s=i[2]?i[2].length:0,r=r.slice(0,i.index+s)+"["+"a".repeat(i[0].length-s-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=((b=(g=this.options.hooks)==null?void 0:g.emStrongMask)==null?void 0:b.call({lexer:this},r))??r;let c=!1,u="",d=1/0;for(;o;){if(o.length<d)d=o.length;else{this.infiniteLoopError(o.charCodeAt(0));break}c||(u=""),c=!1;let _;if((N=(w=this.options.extensions)==null?void 0:w.inline)!=null&&N.some(B=>(_=B.call({lexer:this},o,n))?(o=o.substring(_.raw.length),n.push(_),!0):!1))continue;if(_=this.tokenizer.escape(o)){o=o.substring(_.raw.length),n.push(_);continue}if(_=this.tokenizer.tag(o)){o=o.substring(_.raw.length),n.push(_);continue}if(_=this.tokenizer.link(o)){o=o.substring(_.raw.length),n.push(_);continue}if(_=this.tokenizer.reflink(o,this.tokens.links)){o=o.substring(_.raw.length);let B=n.at(-1);_.type==="text"&&(B==null?void 0:B.type)==="text"?(B.raw+=_.raw,B.text+=_.text):n.push(_);continue}if(_=this.tokenizer.emStrong(o,r,u)){o=o.substring(_.raw.length),n.push(_);continue}if(_=this.tokenizer.codespan(o)){o=o.substring(_.raw.length),n.push(_);continue}if(_=this.tokenizer.br(o)){o=o.substring(_.raw.length),n.push(_);continue}if(_=this.tokenizer.del(o,r,u)){o=o.substring(_.raw.length),n.push(_);continue}if(_=this.tokenizer.autolink(o)){o=o.substring(_.raw.length),n.push(_);continue}if(!this.state.inLink&&(_=this.tokenizer.url(o))){o=o.substring(_.raw.length),n.push(_);continue}let $=o;if((V=this.options.extensions)!=null&&V.startInline){let B=1/0,T=o.slice(1),E;this.options.extensions.startInline.forEach(k=>{E=k.call({lexer:this},T),typeof E=="number"&&E>=0&&(B=Math.min(B,E))}),B<1/0&&B>=0&&($=o.substring(0,B+1))}if(_=this.tokenizer.inlineText($)){o=o.substring(_.raw.length),_.raw.slice(-1)!=="_"&&(u=_.raw.slice(-1)),c=!0;let B=n.at(-1);(B==null?void 0:B.type)==="text"?(B.raw+=_.raw,B.text+=_.text):n.push(_);continue}if(o){this.infiniteLoopError(o.charCodeAt(0));break}}return n}infiniteLoopError(o){let n="Infinite loop on byte: "+o;if(this.options.silent)console.error(n);else throw new Error(n)}},ao=class{constructor(t){Re(this,"options");Re(this,"parser");this.options=t||_n}space(t){return""}code({text:t,lang:o,escaped:n}){var s;let r=(s=(o||"").match(ot.notSpaceStart))==null?void 0:s[0],i=t.replace(ot.endingNewline,"")+`
113
- `;return r?'<pre><code class="language-'+Ut(r)+'">'+(n?i:Ut(i,!0))+`</code></pre>
114
- `:"<pre><code>"+(n?i:Ut(i,!0))+`</code></pre>
106
+ `+d.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=b.text):n.push(d);continue}if(o){this.infiniteLoopError(o.charCodeAt(0));break}}return this.state.top=!0,n}inline(o,n=[]){return this.inlineQueue.push({src:o,tokens:n}),n}inlineTokens(o,n=[]){var g,b,w,N,$;this.tokenizer.lexer=this;let r=o,l=null;if(this.tokens.links){let M=Object.keys(this.tokens.links);if(M.length>0)for(;(l=this.tokenizer.rules.inline.reflinkSearch.exec(r))!==null;)M.includes(l[0].slice(l[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,l.index)+"["+"a".repeat(l[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(l=this.tokenizer.rules.inline.anyPunctuation.exec(r))!==null;)r=r.slice(0,l.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let s;for(;(l=this.tokenizer.rules.inline.blockSkip.exec(r))!==null;)s=l[2]?l[2].length:0,r=r.slice(0,l.index+s)+"["+"a".repeat(l[0].length-s-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=((b=(g=this.options.hooks)==null?void 0:g.emStrongMask)==null?void 0:b.call({lexer:this},r))??r;let c=!1,u="",d=1/0;for(;o;){if(o.length<d)d=o.length;else{this.infiniteLoopError(o.charCodeAt(0));break}c||(u=""),c=!1;let M;if((N=(w=this.options.extensions)==null?void 0:w.inline)!=null&&N.some(I=>(M=I.call({lexer:this},o,n))?(o=o.substring(M.raw.length),n.push(M),!0):!1))continue;if(M=this.tokenizer.escape(o)){o=o.substring(M.raw.length),n.push(M);continue}if(M=this.tokenizer.tag(o)){o=o.substring(M.raw.length),n.push(M);continue}if(M=this.tokenizer.link(o)){o=o.substring(M.raw.length),n.push(M);continue}if(M=this.tokenizer.reflink(o,this.tokens.links)){o=o.substring(M.raw.length);let I=n.at(-1);M.type==="text"&&(I==null?void 0:I.type)==="text"?(I.raw+=M.raw,I.text+=M.text):n.push(M);continue}if(M=this.tokenizer.emStrong(o,r,u)){o=o.substring(M.raw.length),n.push(M);continue}if(M=this.tokenizer.codespan(o)){o=o.substring(M.raw.length),n.push(M);continue}if(M=this.tokenizer.br(o)){o=o.substring(M.raw.length),n.push(M);continue}if(M=this.tokenizer.del(o,r,u)){o=o.substring(M.raw.length),n.push(M);continue}if(M=this.tokenizer.autolink(o)){o=o.substring(M.raw.length),n.push(M);continue}if(!this.state.inLink&&(M=this.tokenizer.url(o))){o=o.substring(M.raw.length),n.push(M);continue}let P=o;if(($=this.options.extensions)!=null&&$.startInline){let I=1/0,C=o.slice(1),E;this.options.extensions.startInline.forEach(k=>{E=k.call({lexer:this},C),typeof E=="number"&&E>=0&&(I=Math.min(I,E))}),I<1/0&&I>=0&&(P=o.substring(0,I+1))}if(M=this.tokenizer.inlineText(P)){o=o.substring(M.raw.length),M.raw.slice(-1)!=="_"&&(u=M.raw.slice(-1)),c=!0;let I=n.at(-1);(I==null?void 0:I.type)==="text"?(I.raw+=M.raw,I.text+=M.text):n.push(M);continue}if(o){this.infiniteLoopError(o.charCodeAt(0));break}}return n}infiniteLoopError(o){let n="Infinite loop on byte: "+o;if(this.options.silent)console.error(n);else throw new Error(n)}},so=class{constructor(t){ve(this,"options");ve(this,"parser");this.options=t||Sn}space(t){return""}code({text:t,lang:o,escaped:n}){var s;let r=(s=(o||"").match(ot.notSpaceStart))==null?void 0:s[0],l=t.replace(ot.endingNewline,"")+`
107
+ `;return r?'<pre><code class="language-'+jt(r)+'">'+(n?l:jt(l,!0))+`</code></pre>
108
+ `:"<pre><code>"+(n?l:jt(l,!0))+`</code></pre>
115
109
  `}blockquote({tokens:t}){return`<blockquote>
116
110
  ${this.parser.parse(t)}</blockquote>
117
111
  `}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:o}){return`<h${o}>${this.parser.parseInline(t)}</h${o}>
118
112
  `}hr(t){return`<hr>
119
- `}list(t){let o=t.ordered,n=t.start,r="";for(let c=0;c<t.items.length;c++){let u=t.items[c];r+=this.listitem(u)}let i=o?"ol":"ul",s=o&&n!==1?' start="'+n+'"':"";return"<"+i+s+`>
120
- `+r+"</"+i+`>
113
+ `}list(t){let o=t.ordered,n=t.start,r="";for(let c=0;c<t.items.length;c++){let u=t.items[c];r+=this.listitem(u)}let l=o?"ol":"ul",s=o&&n!==1?' start="'+n+'"':"";return"<"+l+s+`>
114
+ `+r+"</"+l+`>
121
115
  `}listitem(t){return`<li>${this.parser.parse(t.tokens)}</li>
122
116
  `}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
123
- `}table(t){let o="",n="";for(let i=0;i<t.header.length;i++)n+=this.tablecell(t.header[i]);o+=this.tablerow({text:n});let r="";for(let i=0;i<t.rows.length;i++){let s=t.rows[i];n="";for(let c=0;c<s.length;c++)n+=this.tablecell(s[c]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
117
+ `}table(t){let o="",n="";for(let l=0;l<t.header.length;l++)n+=this.tablecell(t.header[l]);o+=this.tablerow({text:n});let r="";for(let l=0;l<t.rows.length;l++){let s=t.rows[l];n="";for(let c=0;c<s.length;c++)n+=this.tablecell(s[c]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
124
118
  <thead>
125
119
  `+o+`</thead>
126
120
  `+r+`</table>
127
121
  `}tablerow({text:t}){return`<tr>
128
122
  ${t}</tr>
129
123
  `}tablecell(t){let o=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+o+`</${n}>
130
- `}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${Ut(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:o,tokens:n}){let r=this.parser.parseInline(n),i=ul(t);if(i===null)return r;t=i;let s='<a href="'+t+'"';return o&&(s+=' title="'+Ut(o)+'"'),s+=">"+r+"</a>",s}image({href:t,title:o,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=ul(t);if(i===null)return Ut(n);t=i;let s=`<img src="${t}" alt="${Ut(n)}"`;return o&&(s+=` title="${Ut(o)}"`),s+=">",s}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Ut(t.text)}},vr=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}checkbox({raw:t}){return t}},It=class Yr{constructor(o){Re(this,"options");Re(this,"renderer");Re(this,"textRenderer");this.options=o||_n,this.options.renderer=this.options.renderer||new ao,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new vr}static parse(o,n){return new Yr(n).parse(o)}static parseInline(o,n){return new Yr(n).parseInline(o)}parse(o){var r,i;this.renderer.parser=this;let n="";for(let s=0;s<o.length;s++){let c=o[s];if((i=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&i[c.type]){let d=c,g=this.options.extensions.renderers[d.type].call({parser:this},d);if(g!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(d.type)){n+=g||"";continue}}let u=c;switch(u.type){case"space":{n+=this.renderer.space(u);break}case"hr":{n+=this.renderer.hr(u);break}case"heading":{n+=this.renderer.heading(u);break}case"code":{n+=this.renderer.code(u);break}case"table":{n+=this.renderer.table(u);break}case"blockquote":{n+=this.renderer.blockquote(u);break}case"list":{n+=this.renderer.list(u);break}case"checkbox":{n+=this.renderer.checkbox(u);break}case"html":{n+=this.renderer.html(u);break}case"def":{n+=this.renderer.def(u);break}case"paragraph":{n+=this.renderer.paragraph(u);break}case"text":{n+=this.renderer.text(u);break}default:{let d='Token with "'+u.type+'" type was not found.';if(this.options.silent)return console.error(d),"";throw new Error(d)}}}return n}parseInline(o,n=this.renderer){var i,s;this.renderer.parser=this;let r="";for(let c=0;c<o.length;c++){let u=o[c];if((s=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&s[u.type]){let g=this.options.extensions.renderers[u.type].call({parser:this},u);if(g!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(u.type)){r+=g||"";continue}}let d=u;switch(d.type){case"escape":{r+=n.text(d);break}case"html":{r+=n.html(d);break}case"link":{r+=n.link(d);break}case"image":{r+=n.image(d);break}case"checkbox":{r+=n.checkbox(d);break}case"strong":{r+=n.strong(d);break}case"em":{r+=n.em(d);break}case"codespan":{r+=n.codespan(d);break}case"br":{r+=n.br(d);break}case"del":{r+=n.del(d);break}case"text":{r+=n.text(d);break}default:{let g='Token with "'+d.type+'" type was not found.';if(this.options.silent)return console.error(g),"";throw new Error(g)}}}return r}},so=(Yo=class{constructor(t){Re(this,"options");Re(this,"block");this.options=t||_n}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?zt.lex:zt.lexInline}provideParser(t=this.block){return t?It.parse:It.parseInline}},Re(Yo,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),Re(Yo,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Yo),gl=class{constructor(...t){Re(this,"defaults",wr());Re(this,"options",this.setOptions);Re(this,"parse",this.parseMarkdown(!0));Re(this,"parseInline",this.parseMarkdown(!1));Re(this,"Parser",It);Re(this,"Renderer",ao);Re(this,"TextRenderer",vr);Re(this,"Lexer",zt);Re(this,"Tokenizer",jo);Re(this,"Hooks",so);this.use(...t)}walkTokens(t,o){var r,i;let n=[];for(let s of t)switch(n=n.concat(o.call(this,s)),s.type){case"table":{let c=s;for(let u of c.header)n=n.concat(this.walkTokens(u.tokens,o));for(let u of c.rows)for(let d of u)n=n.concat(this.walkTokens(d.tokens,o));break}case"list":{let c=s;n=n.concat(this.walkTokens(c.items,o));break}default:{let c=s;(i=(r=this.defaults.extensions)==null?void 0:r.childTokens)!=null&&i[c.type]?this.defaults.extensions.childTokens[c.type].forEach(u=>{let d=c[u].flat(1/0);n=n.concat(this.walkTokens(d,o))}):c.tokens&&(n=n.concat(this.walkTokens(c.tokens,o)))}}return n}use(...t){let o=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let s=o.renderers[i.name];s?o.renderers[i.name]=function(...c){let u=i.renderer.apply(this,c);return u===!1&&(u=s.apply(this,c)),u}:o.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=o[i.level];s?s.unshift(i.tokenizer):o[i.level]=[i.tokenizer],i.start&&(i.level==="block"?o.startBlock?o.startBlock.push(i.start):o.startBlock=[i.start]:i.level==="inline"&&(o.startInline?o.startInline.push(i.start):o.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(o.childTokens[i.name]=i.childTokens)}),r.extensions=o),n.renderer){let i=this.defaults.renderer||new ao(this.defaults);for(let s in n.renderer){if(!(s in i))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let c=s,u=n.renderer[c],d=i[c];i[c]=(...g)=>{let b=u.apply(i,g);return b===!1&&(b=d.apply(i,g)),b||""}}r.renderer=i}if(n.tokenizer){let i=this.defaults.tokenizer||new jo(this.defaults);for(let s in n.tokenizer){if(!(s in i))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let c=s,u=n.tokenizer[c],d=i[c];i[c]=(...g)=>{let b=u.apply(i,g);return b===!1&&(b=d.apply(i,g)),b}}r.tokenizer=i}if(n.hooks){let i=this.defaults.hooks||new so;for(let s in n.hooks){if(!(s in i))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let c=s,u=n.hooks[c],d=i[c];so.passThroughHooks.has(s)?i[c]=g=>{if(this.defaults.async&&so.passThroughHooksRespectAsync.has(s))return(async()=>{let w=await u.call(i,g);return d.call(i,w)})();let b=u.call(i,g);return d.call(i,b)}:i[c]=(...g)=>{if(this.defaults.async)return(async()=>{let w=await u.apply(i,g);return w===!1&&(w=await d.apply(i,g)),w})();let b=u.apply(i,g);return b===!1&&(b=d.apply(i,g)),b}}r.hooks=i}if(n.walkTokens){let i=this.defaults.walkTokens,s=n.walkTokens;r.walkTokens=function(c){let u=[];return u.push(s.call(this,c)),i&&(u=u.concat(i.call(this,c))),u}}this.defaults={...this.defaults,...r}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,o){return zt.lex(t,o??this.defaults)}parser(t,o){return It.parse(t,o??this.defaults)}parseMarkdown(t){return(o,n)=>{let r={...n},i={...this.defaults,...r},s=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return s(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof o>"u"||o===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof o!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(o)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=t),i.async)return(async()=>{let c=i.hooks?await i.hooks.preprocess(o):o,u=await(i.hooks?await i.hooks.provideLexer(t):t?zt.lex:zt.lexInline)(c,i),d=i.hooks?await i.hooks.processAllTokens(u):u;i.walkTokens&&await Promise.all(this.walkTokens(d,i.walkTokens));let g=await(i.hooks?await i.hooks.provideParser(t):t?It.parse:It.parseInline)(d,i);return i.hooks?await i.hooks.postprocess(g):g})().catch(s);try{i.hooks&&(o=i.hooks.preprocess(o));let c=(i.hooks?i.hooks.provideLexer(t):t?zt.lex:zt.lexInline)(o,i);i.hooks&&(c=i.hooks.processAllTokens(c)),i.walkTokens&&this.walkTokens(c,i.walkTokens);let u=(i.hooks?i.hooks.provideParser(t):t?It.parse:It.parseInline)(c,i);return i.hooks&&(u=i.hooks.postprocess(u)),u}catch(c){return s(c)}}}onError(t,o){return n=>{if(n.message+=`
131
- Please report this to https://github.com/markedjs/marked.`,t){let r="<p>An error occurred:</p><pre>"+Ut(n.message+"",!0)+"</pre>";return o?Promise.resolve(r):r}if(o)return Promise.reject(n);throw n}}},Rn=new gl;function _e(t,o){return Rn.parse(t,o)}_e.options=_e.setOptions=function(t){return Rn.setOptions(t),_e.defaults=Rn.defaults,Ji(_e.defaults),_e},_e.getDefaults=wr,_e.defaults=_n,_e.use=function(...t){return Rn.use(...t),_e.defaults=Rn.defaults,Ji(_e.defaults),_e},_e.walkTokens=function(t,o){return Rn.walkTokens(t,o)},_e.parseInline=Rn.parseInline,_e.Parser=It,_e.parser=It.parse,_e.Renderer=ao,_e.TextRenderer=vr,_e.Lexer=zt,_e.lexer=zt.lex,_e.Tokenizer=jo,_e.Hooks=so,_e.parse=_e,_e.options,_e.setOptions,_e.use,_e.walkTokens,_e.parseInline,It.parse,zt.lex;/*! @license DOMPurify 3.4.8 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.8/LICENSE */function hl(t,o){(o==null||o>t.length)&&(o=t.length);for(var n=0,r=Array(o);n<o;n++)r[n]=t[n];return r}function jf(t){if(Array.isArray(t))return t}function Kf(t,o){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,s,c,u=[],d=!0,g=!1;try{if(s=(n=n.call(t)).next,o!==0)for(;!(d=(r=s.call(n)).done)&&(u.push(r.value),u.length!==o);d=!0);}catch(b){g=!0,i=b}finally{try{if(!d&&n.return!=null&&(c=n.return(),Object(c)!==c))return}finally{if(g)throw i}}return u}}function Yf(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
132
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qf(t,o){return jf(t)||Kf(t,o)||Xf(t,o)||Yf()}function Xf(t,o){if(t){if(typeof t=="string")return hl(t,o);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?hl(t,o):void 0}}const bl=Object.entries,kl=Object.setPrototypeOf,Zf=Object.isFrozen,Jf=Object.getPrototypeOf,Qf=Object.getOwnPropertyDescriptor;let ct=Object.freeze,At=Object.seal,jn=Object.create,yl=typeof Reflect<"u"&&Reflect,Br=yl.apply,zr=yl.construct;ct||(ct=function(o){return o}),At||(At=function(o){return o}),Br||(Br=function(o,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),s=2;s<r;s++)i[s-2]=arguments[s];return o.apply(n,i)}),zr||(zr=function(o){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return new o(...r)});const vn=Ge(Array.prototype.forEach),em=Ge(Array.prototype.lastIndexOf),El=Ge(Array.prototype.pop),Kn=Ge(Array.prototype.push),tm=Ge(Array.prototype.splice),dt=Array.isArray,co=Ge(String.prototype.toLowerCase),Ir=Ge(String.prototype.toString),xl=Ge(String.prototype.match),Yn=Ge(String.prototype.replace),wl=Ge(String.prototype.indexOf),nm=Ge(String.prototype.trim),om=Ge(Number.prototype.toString),rm=Ge(Boolean.prototype.toString),Nl=typeof BigInt>"u"?null:Ge(BigInt.prototype.toString),Sl=typeof Symbol>"u"?null:Ge(Symbol.prototype.toString),$e=Ge(Object.prototype.hasOwnProperty),uo=Ge(Object.prototype.toString),tt=Ge(RegExp.prototype.test),qn=im(TypeError);function Ge(t){return function(o){o instanceof RegExp&&(o.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return Br(t,o,r)}}function im(t){return function(){for(var o=arguments.length,n=new Array(o),r=0;r<o;r++)n[r]=arguments[r];return zr(t,n)}}function fe(t,o){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:co;if(kl&&kl(t,null),!dt(o))return t;let r=o.length;for(;r--;){let i=o[r];if(typeof i=="string"){const s=n(i);s!==i&&(Zf(o)||(o[r]=s),i=s)}t[i]=!0}return t}function lm(t){for(let o=0;o<t.length;o++)$e(t,o)||(t[o]=null);return t}function rt(t){const o=jn(null);for(const r of bl(t)){var n=qf(r,2);const i=n[0],s=n[1];$e(t,i)&&(dt(s)?o[i]=lm(s):s&&typeof s=="object"&&s.constructor===Object?o[i]=rt(s):o[i]=s)}return o}function am(t){switch(typeof t){case"string":return t;case"number":return om(t);case"boolean":return rm(t);case"bigint":return Nl?Nl(t):"0";case"symbol":return Sl?Sl(t):"Symbol()";case"undefined":return uo(t);case"function":case"object":{if(t===null)return uo(t);const o=t,n=Ht(o,"toString");if(typeof n=="function"){const r=n(o);return typeof r=="string"?r:uo(r)}return uo(t)}default:return uo(t)}}function Ht(t,o){for(;t!==null;){const r=Qf(t,o);if(r){if(r.get)return Ge(r.get);if(typeof r.value=="function")return Ge(r.value)}t=Jf(t)}function n(){return null}return n}function sm(t){try{return tt(t,""),!0}catch{return!1}}const Tl=ct(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Or=ct(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Lr=ct(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),cm=ct(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Dr=ct(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),dm=ct(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Cl=ct(["#text"]),Al=ct(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Vr=ct(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),_l=ct(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Ko=ct(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),um=At(/{{[\w\W]*|^[\w\W]*}}/g),fm=At(/<%[\w\W]*|^[\w\W]*%>/g),mm=At(/\${[\w\W]*/g),pm=At(/^data-[\-\w.\u00B7-\uFFFF]+$/),gm=At(/^aria-[\-\w]+$/),Ml=At(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),hm=At(/^(?:\w+script|data):/i),bm=At(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),km=At(/^html$/i),ym=At(/^[a-z][.\w]*(-[.\w]+)+$/i),Wt={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Em=function(){return typeof window>"u"?null:window},xm=function(o,n){if(typeof o!="object"||typeof o.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(r=n.getAttribute(i));const s="dompurify"+(r?"#"+r:"");try{return o.createPolicy(s,{createHTML(c){return c},createScriptURL(c){return c}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},Rl=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function vl(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Em();const o=X=>vl(X);if(o.version="3.4.8",o.removed=[],!t||!t.document||t.document.nodeType!==Wt.document||!t.Element)return o.isSupported=!1,o;let n=t.document;const r=n,i=r.currentScript;t.DocumentFragment;const s=t.HTMLTemplateElement,c=t.Node,u=t.Element,d=t.NodeFilter,g=t.NamedNodeMap;g===void 0&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const b=t.DOMParser,w=t.trustedTypes,N=u.prototype,V=Ht(N,"cloneNode"),_=Ht(N,"remove"),$=Ht(N,"nextSibling"),B=Ht(N,"childNodes"),T=Ht(N,"parentNode"),E=Ht(N,"shadowRoot"),k=Ht(N,"attributes"),m=c&&c.prototype?Ht(c.prototype,"nodeType"):null,v=c&&c.prototype?Ht(c.prototype,"nodeName"):null;if(typeof s=="function"){const X=n.createElement("template");X.content&&X.content.ownerDocument&&(n=X.content.ownerDocument)}let x,j="",K=0;const ne=function(h){if(K>0)throw qn('The configured TRUSTED_TYPES_POLICY.createHTML must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose createHTML wraps DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.');K++;try{return x.createHTML(h)}finally{K--}},ce=n,re=ce.implementation,Y=ce.createNodeIterator,ee=ce.createDocumentFragment,ie=ce.getElementsByTagName,z=r.importNode;let C=Rl();o.isSupported=typeof bl=="function"&&typeof T=="function"&&re&&re.createHTMLDocument!==void 0;const F=um,P=fm,W=mm,ae=pm,we=gm,ve=hm,ze=bm,Ne=ym;let y=Ml,p=null;const O=fe({},[...Tl,...Or,...Lr,...Dr,...Cl]);let D=null;const q=fe({},[...Al,...Vr,..._l,...Ko]);let de=Object.seal(jn(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ge=null,je=null;const Pe=Object.seal(jn(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Je=!0,Ke=!0,Xn=!1,pn=!0,te=!1,Gt=!0,Be=!1,Te=!1,Ot=!1,it=!1,Lt=!1,jt=!1,U=!0,Z=!1;const se="user-content-";let ye=!0,Me=!1,Qe={},pt=null;const gn=fe({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let fo=null;const Zn=fe({},["audio","video","img","source","image","track"]);let Bn=null;const qo=fe({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Jn="http://www.w3.org/1998/Math/MathML",Qn="http://www.w3.org/2000/svg",gt="http://www.w3.org/1999/xhtml";let Kt=gt,_t=!1,Ce=null;const he=fe({},[Jn,Qn,gt],Ir);let mo=fe({},["mi","mo","mn","ms","mtext"]),lt=fe({},["annotation-xml"]);const po=fe({},["title","style","font","a","script"]);let Q=null;const go=["application/xhtml+xml","text/html"],ho="text/html";let De=null,Qt=null;const Pr=n.createElement("form"),bo=function(h){return h instanceof RegExp||h instanceof Function},hn=function(){let h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Qt&&Qt===h)return;(!h||typeof h!="object")&&(h={}),h=rt(h),Q=go.indexOf(h.PARSER_MEDIA_TYPE)===-1?ho:h.PARSER_MEDIA_TYPE,De=Q==="application/xhtml+xml"?Ir:co,p=$e(h,"ALLOWED_TAGS")&&dt(h.ALLOWED_TAGS)?fe({},h.ALLOWED_TAGS,De):O,D=$e(h,"ALLOWED_ATTR")&&dt(h.ALLOWED_ATTR)?fe({},h.ALLOWED_ATTR,De):q,Ce=$e(h,"ALLOWED_NAMESPACES")&&dt(h.ALLOWED_NAMESPACES)?fe({},h.ALLOWED_NAMESPACES,Ir):he,Bn=$e(h,"ADD_URI_SAFE_ATTR")&&dt(h.ADD_URI_SAFE_ATTR)?fe(rt(qo),h.ADD_URI_SAFE_ATTR,De):qo,fo=$e(h,"ADD_DATA_URI_TAGS")&&dt(h.ADD_DATA_URI_TAGS)?fe(rt(Zn),h.ADD_DATA_URI_TAGS,De):Zn,pt=$e(h,"FORBID_CONTENTS")&&dt(h.FORBID_CONTENTS)?fe({},h.FORBID_CONTENTS,De):gn,ge=$e(h,"FORBID_TAGS")&&dt(h.FORBID_TAGS)?fe({},h.FORBID_TAGS,De):rt({}),je=$e(h,"FORBID_ATTR")&&dt(h.FORBID_ATTR)?fe({},h.FORBID_ATTR,De):rt({}),Qe=$e(h,"USE_PROFILES")?h.USE_PROFILES&&typeof h.USE_PROFILES=="object"?rt(h.USE_PROFILES):h.USE_PROFILES:!1,Je=h.ALLOW_ARIA_ATTR!==!1,Ke=h.ALLOW_DATA_ATTR!==!1,Xn=h.ALLOW_UNKNOWN_PROTOCOLS||!1,pn=h.ALLOW_SELF_CLOSE_IN_ATTR!==!1,te=h.SAFE_FOR_TEMPLATES||!1,Gt=h.SAFE_FOR_XML!==!1,Be=h.WHOLE_DOCUMENT||!1,it=h.RETURN_DOM||!1,Lt=h.RETURN_DOM_FRAGMENT||!1,jt=h.RETURN_TRUSTED_TYPE||!1,Ot=h.FORCE_BODY||!1,U=h.SANITIZE_DOM!==!1,Z=h.SANITIZE_NAMED_PROPS||!1,ye=h.KEEP_CONTENT!==!1,Me=h.IN_PLACE||!1,y=sm(h.ALLOWED_URI_REGEXP)?h.ALLOWED_URI_REGEXP:Ml,Kt=typeof h.NAMESPACE=="string"?h.NAMESPACE:gt,mo=$e(h,"MATHML_TEXT_INTEGRATION_POINTS")&&h.MATHML_TEXT_INTEGRATION_POINTS&&typeof h.MATHML_TEXT_INTEGRATION_POINTS=="object"?rt(h.MATHML_TEXT_INTEGRATION_POINTS):fe({},["mi","mo","mn","ms","mtext"]),lt=$e(h,"HTML_INTEGRATION_POINTS")&&h.HTML_INTEGRATION_POINTS&&typeof h.HTML_INTEGRATION_POINTS=="object"?rt(h.HTML_INTEGRATION_POINTS):fe({},["annotation-xml"]);const I=$e(h,"CUSTOM_ELEMENT_HANDLING")&&h.CUSTOM_ELEMENT_HANDLING&&typeof h.CUSTOM_ELEMENT_HANDLING=="object"?rt(h.CUSTOM_ELEMENT_HANDLING):jn(null);if(de=jn(null),$e(I,"tagNameCheck")&&bo(I.tagNameCheck)&&(de.tagNameCheck=I.tagNameCheck),$e(I,"attributeNameCheck")&&bo(I.attributeNameCheck)&&(de.attributeNameCheck=I.attributeNameCheck),$e(I,"allowCustomizedBuiltInElements")&&typeof I.allowCustomizedBuiltInElements=="boolean"&&(de.allowCustomizedBuiltInElements=I.allowCustomizedBuiltInElements),te&&(Ke=!1),Lt&&(it=!0),Qe&&(p=fe({},Cl),D=jn(null),Qe.html===!0&&(fe(p,Tl),fe(D,Al)),Qe.svg===!0&&(fe(p,Or),fe(D,Vr),fe(D,Ko)),Qe.svgFilters===!0&&(fe(p,Lr),fe(D,Vr),fe(D,Ko)),Qe.mathMl===!0&&(fe(p,Dr),fe(D,_l),fe(D,Ko))),Pe.tagCheck=null,Pe.attributeCheck=null,$e(h,"ADD_TAGS")&&(typeof h.ADD_TAGS=="function"?Pe.tagCheck=h.ADD_TAGS:dt(h.ADD_TAGS)&&(p===O&&(p=rt(p)),fe(p,h.ADD_TAGS,De))),$e(h,"ADD_ATTR")&&(typeof h.ADD_ATTR=="function"?Pe.attributeCheck=h.ADD_ATTR:dt(h.ADD_ATTR)&&(D===q&&(D=rt(D)),fe(D,h.ADD_ATTR,De))),$e(h,"ADD_URI_SAFE_ATTR")&&dt(h.ADD_URI_SAFE_ATTR)&&fe(Bn,h.ADD_URI_SAFE_ATTR,De),$e(h,"FORBID_CONTENTS")&&dt(h.FORBID_CONTENTS)&&(pt===gn&&(pt=rt(pt)),fe(pt,h.FORBID_CONTENTS,De)),$e(h,"ADD_FORBID_CONTENTS")&&dt(h.ADD_FORBID_CONTENTS)&&(pt===gn&&(pt=rt(pt)),fe(pt,h.ADD_FORBID_CONTENTS,De)),ye&&(p["#text"]=!0),Be&&fe(p,["html","head","body"]),p.table&&(fe(p,["tbody"]),delete ge.tbody),h.TRUSTED_TYPES_POLICY){if(typeof h.TRUSTED_TYPES_POLICY.createHTML!="function")throw qn('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof h.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw qn('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const H=x;x=h.TRUSTED_TYPES_POLICY;try{j=ne("")}catch(Se){throw x=H,Se}}else x===void 0&&h.TRUSTED_TYPES_POLICY!==null&&(x=xm(w,i)),x&&typeof j=="string"&&(j=ne(""));(C.uponSanitizeElement.length>0||C.uponSanitizeAttribute.length>0)&&p===O&&(p=rt(p)),C.uponSanitizeAttribute.length>0&&D===q&&(D=rt(D)),ct&&ct(h),Qt=h},Xo=fe({},[...Or,...Lr,...cm]),ko=fe({},[...Dr,...dm]),en=function(h){let I=T(h);(!I||!I.tagName)&&(I={namespaceURI:Kt,tagName:"template"});const H=co(h.tagName),Se=co(I.tagName);return Ce[h.namespaceURI]?h.namespaceURI===Qn?I.namespaceURI===gt?H==="svg":I.namespaceURI===Jn?H==="svg"&&(Se==="annotation-xml"||mo[Se]):!!Xo[H]:h.namespaceURI===Jn?I.namespaceURI===gt?H==="math":I.namespaceURI===Qn?H==="math"&&lt[Se]:!!ko[H]:h.namespaceURI===gt?I.namespaceURI===Qn&&!lt[Se]||I.namespaceURI===Jn&&!mo[Se]?!1:!ko[H]&&(po[H]||!Xo[H]):!!(Q==="application/xhtml+xml"&&Ce[h.namespaceURI]):!1},ht=function(h){Kn(o.removed,{element:h});try{T(h).removeChild(h)}catch{_(h)}},Yt=function(h,I){try{Kn(o.removed,{attribute:I.getAttributeNode(h),from:I})}catch{Kn(o.removed,{attribute:null,from:I})}if(I.removeAttribute(h),h==="is")if(it||Lt)try{ht(I)}catch{}else try{I.setAttribute(h,"")}catch{}},tn=function(h){let I=null,H=null;if(Ot)h="<remove></remove>"+h;else{const Ae=xl(h,/^[\r\n\t ]+/);H=Ae&&Ae[0]}Q==="application/xhtml+xml"&&Kt===gt&&(h='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+h+"</body></html>");const Se=x?ne(h):h;if(Kt===gt)try{I=new b().parseFromString(Se,Q)}catch{}if(!I||!I.documentElement){I=re.createDocument(Kt,"template",null);try{I.documentElement.innerHTML=_t?j:Se}catch{}}const me=I.body||I.documentElement;return h&&H&&me.insertBefore(n.createTextNode(H),me.childNodes[0]||null),Kt===gt?ie.call(I,Be?"html":"body")[0]:Be?I.documentElement:me},nn=function(h){return Y.call(h.ownerDocument||h,h,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},eo=function(h){var I,H;h.normalize();const Se=Y.call(h.ownerDocument||h,h,d.SHOW_TEXT|d.SHOW_COMMENT|d.SHOW_CDATA_SECTION|d.SHOW_PROCESSING_INSTRUCTION,null);let me=Se.nextNode();for(;me;){let We=me.data;vn([F,P,W],bt=>{We=Yn(We,bt," ")}),me.data=We,me=Se.nextNode()}const Ae=(I=(H=h.querySelectorAll)===null||H===void 0?void 0:H.call(h,"template"))!==null&&I!==void 0?I:[];vn(Array.from(Ae),We=>{bn(We.content)&&eo(We.content)})},zn=function(h){const I=v?v(h):null;return typeof I!="string"||De(I)!=="form"?!1:typeof h.nodeName!="string"||typeof h.textContent!="string"||typeof h.removeChild!="function"||h.attributes!==k(h)||typeof h.removeAttribute!="function"||typeof h.setAttribute!="function"||typeof h.namespaceURI!="string"||typeof h.insertBefore!="function"||typeof h.hasChildNodes!="function"||h.nodeType!==m(h)||h.childNodes!==B(h)},bn=function(h){if(!m||typeof h!="object"||h===null)return!1;try{return m(h)===Wt.documentFragment}catch{return!1}},In=function(h){if(!m||typeof h!="object"||h===null)return!1;try{return typeof m(h)=="number"}catch{return!1}};function J(X,h,I){vn(X,H=>{H.call(o,h,I,Qt)})}const et=function(h){let I=null;if(J(C.beforeSanitizeElements,h,null),zn(h))return ht(h),!0;const H=De(v?v(h):h.nodeName);if(J(C.uponSanitizeElement,h,{tagName:H,allowedTags:p}),Gt&&h.hasChildNodes()&&!In(h.firstElementChild)&&tt(/<[/\w!]/g,h.innerHTML)&&tt(/<[/\w!]/g,h.textContent)||Gt&&h.namespaceURI===gt&&H==="style"&&In(h.firstElementChild)||h.nodeType===Wt.progressingInstruction||Gt&&h.nodeType===Wt.comment&&tt(/<[/\w]/g,h.data))return ht(h),!0;if(ge[H]||!(Pe.tagCheck instanceof Function&&Pe.tagCheck(H))&&!p[H]){if(!ge[H]&&Eo(H)&&(de.tagNameCheck instanceof RegExp&&tt(de.tagNameCheck,H)||de.tagNameCheck instanceof Function&&de.tagNameCheck(H)))return!1;if(ye&&!pt[H]){const me=T(h),Ae=B(h);if(Ae&&me){const We=Ae.length;for(let bt=We-1;bt>=0;--bt){const yt=V(Ae[bt],!0);me.insertBefore(yt,$(h))}}}return ht(h),!0}return(m?m(h):h.nodeType)===Wt.element&&!en(h)||(H==="noscript"||H==="noembed"||H==="noframes")&&tt(/<\/no(script|embed|frames)/i,h.innerHTML)?(ht(h),!0):(te&&h.nodeType===Wt.text&&(I=h.textContent,vn([F,P,W],me=>{I=Yn(I,me," ")}),h.textContent!==I&&(Kn(o.removed,{element:h.cloneNode()}),h.textContent=I)),J(C.afterSanitizeElements,h,null),!1)},yo=function(h,I,H){if(je[I]||U&&(I==="id"||I==="name")&&(H in n||H in Pr))return!1;const Se=D[I]||Pe.attributeCheck instanceof Function&&Pe.attributeCheck(I,h);if(!(Ke&&!je[I]&&tt(ae,I))){if(!(Je&&tt(we,I))){if(!Se||je[I]){if(!(Eo(h)&&(de.tagNameCheck instanceof RegExp&&tt(de.tagNameCheck,h)||de.tagNameCheck instanceof Function&&de.tagNameCheck(h))&&(de.attributeNameCheck instanceof RegExp&&tt(de.attributeNameCheck,I)||de.attributeNameCheck instanceof Function&&de.attributeNameCheck(I,h))||I==="is"&&de.allowCustomizedBuiltInElements&&(de.tagNameCheck instanceof RegExp&&tt(de.tagNameCheck,H)||de.tagNameCheck instanceof Function&&de.tagNameCheck(H))))return!1}else if(!Bn[I]){if(!tt(y,Yn(H,ze,""))){if(!((I==="src"||I==="xlink:href"||I==="href")&&h!=="script"&&wl(H,"data:")===0&&fo[h])){if(!(Xn&&!tt(ve,Yn(H,ze,"")))){if(H)return!1}}}}}}return!0},kn=fe({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Eo=function(h){return!kn[co(h)]&&tt(Ne,h)},Zo=function(h){J(C.beforeSanitizeAttributes,h,null);const I=h.attributes;if(!I||zn(h))return;const H={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:D,forceKeepAttr:void 0};let Se=I.length;for(;Se--;){const me=I[Se],Ae=me.name,We=me.namespaceURI,bt=me.value,yt=De(Ae),on=bt;let Fe=Ae==="value"?on:nm(on);if(H.attrName=yt,H.attrValue=Fe,H.keepAttr=!0,H.forceKeepAttr=void 0,J(C.uponSanitizeAttribute,h,H),Fe=H.attrValue,Z&&(yt==="id"||yt==="name")&&wl(Fe,se)!==0&&(Yt(Ae,h),Fe=se+Fe),Gt&&tt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Fe)){Yt(Ae,h);continue}if(yt==="attributename"&&xl(Fe,"href")){Yt(Ae,h);continue}if(H.forceKeepAttr)continue;if(!H.keepAttr){Yt(Ae,h);continue}if(!pn&&tt(/\/>/i,Fe)){Yt(Ae,h);continue}te&&vn([F,P,W],xo=>{Fe=Yn(Fe,xo," ")});const Jo=De(h.nodeName);if(!yo(Jo,yt,Fe)){Yt(Ae,h);continue}if(x&&typeof w=="object"&&typeof w.getAttributeType=="function"&&!We)switch(w.getAttributeType(Jo,yt)){case"TrustedHTML":{Fe=ne(Fe);break}case"TrustedScriptURL":{Fe=x.createScriptURL(Fe);break}}if(Fe!==on)try{We?h.setAttributeNS(We,Ae,Fe):h.setAttribute(Ae,Fe),zn(h)?ht(h):El(o.removed)}catch{Yt(Ae,h)}}J(C.afterSanitizeAttributes,h,null)},On=function(h){let I=null;const H=nn(h);for(J(C.beforeSanitizeShadowDOM,h,null);I=H.nextNode();)if(J(C.uponSanitizeShadowNode,I,null),et(I),Zo(I),bn(I.content)&&On(I.content),(m?m(I):I.nodeType)===Wt.element){const me=E?E(I):I.shadowRoot;bn(me)&&(Mt(me),On(me))}J(C.afterSanitizeShadowDOM,h,null)},Mt=function(h){const I=m?m(h):h.nodeType;if(I===Wt.element){const me=E?E(h):h.shadowRoot;bn(me)&&(Mt(me),On(me))}const H=B?B(h):h.childNodes;if(!H)return;const Se=[];vn(H,me=>{Kn(Se,me)});for(const me of Se)Mt(me);if(I===Wt.element){const me=v?v(h):null;if(typeof me=="string"&&De(me)==="template"){const Ae=h.content;bn(Ae)&&Mt(Ae)}}};return o.sanitize=function(X){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},I=null,H=null,Se=null,me=null;if(_t=!X,_t&&(X="<!-->"),typeof X!="string"&&!In(X)&&(X=am(X),typeof X!="string"))throw qn("dirty is not a string, aborting");if(!o.isSupported)return X;if(Te||hn(h),o.removed=[],typeof X=="string"&&(Me=!1),Me){const bt=v?v(X):X.nodeName;if(typeof bt=="string"){const yt=De(bt);if(!p[yt]||ge[yt])throw qn("root node is forbidden and cannot be sanitized in-place")}if(zn(X))throw qn("root node is clobbered and cannot be sanitized in-place");Mt(X)}else if(In(X))I=tn("<!---->"),H=I.ownerDocument.importNode(X,!0),H.nodeType===Wt.element&&H.nodeName==="BODY"||H.nodeName==="HTML"?I=H:I.appendChild(H),Mt(H);else{if(!it&&!te&&!Be&&X.indexOf("<")===-1)return x&&jt?ne(X):X;if(I=tn(X),!I)return it?null:jt?j:""}I&&Ot&&ht(I.firstChild);const Ae=nn(Me?X:I);for(;Se=Ae.nextNode();)et(Se),Zo(Se),bn(Se.content)&&On(Se.content);if(Me)return te&&eo(X),X;if(it){if(te&&eo(I),Lt)for(me=ee.call(I.ownerDocument);I.firstChild;)me.appendChild(I.firstChild);else me=I;return(D.shadowroot||D.shadowrootmode)&&(me=z.call(r,me,!0)),me}let We=Be?I.outerHTML:I.innerHTML;return Be&&p["!doctype"]&&I.ownerDocument&&I.ownerDocument.doctype&&I.ownerDocument.doctype.name&&tt(km,I.ownerDocument.doctype.name)&&(We="<!DOCTYPE "+I.ownerDocument.doctype.name+`>
133
- `+We),te&&vn([F,P,W],bt=>{We=Yn(We,bt," ")}),x&&jt?ne(We):We},o.setConfig=function(){let X=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};hn(X),Te=!0},o.clearConfig=function(){Qt=null,Te=!1},o.isValidAttribute=function(X,h,I){Qt||hn({});const H=De(X),Se=De(h);return yo(H,Se,I)},o.addHook=function(X,h){typeof h=="function"&&Kn(C[X],h)},o.removeHook=function(X,h){if(h!==void 0){const I=em(C[X],h);return I===-1?void 0:tm(C[X],I,1)[0]}return El(C[X])},o.removeHooks=function(X){C[X]=[]},o.removeAllHooks=function(){C=Rl()},o}var wm=vl();const Nm=new gl({gfm:!0,breaks:!0,pedantic:!1,renderer:(()=>{const t=new ao;return t.code=({text:o,lang:n})=>{const r=(n??"").toLowerCase(),i=gr(o,r);return`<pre><code${r?` class="language-${r}"`:""}>${i}</code></pre>`},t})()}),Sm=["p","br","strong","em","del","s","u","a","ul","ol","li","h1","h2","h3","h4","h5","h6","blockquote","code","pre","hr","table","thead","tbody","tr","th","td","img","span","input"],Tm=["href","title","target","rel","src","alt","class","checked","type","disabled"],Cm=/^(?:(?:https?|mailto|tel|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i;function Am(t){if(!t)return"";const o=Nm.parse(t,{async:!1});return wm.sanitize(o,{ALLOWED_TAGS:Sm,ALLOWED_ATTR:Tm,ALLOWED_URI_REGEXP:Cm})}const _m={class:"zm-note-panel"},Mm={key:0,class:"zm-note-empty"},Rm={class:"zm-note-header"},vm={class:"zm-note-title-row"},Bm={class:"zm-note-name"},zm={class:"zm-note-meta"},Im={class:"zm-note-scroll"},Om={class:"zm-note-section"},Lm={class:"zm-note-section-head"},Dm={class:"zm-note-split"},Vm=["disabled"],$m={key:0,class:"zm-note-preview"},Pm=["innerHTML"],Fm={key:1,class:"zm-note-preview-hint"},Um={key:0,class:"zm-note-section-actions"},Hm={key:0,class:"zm-note-add-row"},Wm={key:1,class:"zm-note-section"},Gm=["disabled"],jm=["href","title"],Km={key:2,class:"zm-note-section"},Ym=["disabled"],qm=["src","alt"],Xm={key:3,class:"zm-note-section"},Zm={class:"zm-note-section-head"},Jm={key:0,class:"zm-note-section-tag"},Qm=["disabled"],ep={key:0,class:"zm-note-code"},tp=["innerHTML"],np={key:4,class:"zm-note-section"},op=["disabled"],rp={key:0,class:"zm-note-table"},ip=["onClick"],lp={class:"zm-note-table-sort-mark","aria-hidden":"true"},$r=e.defineComponent({__name:"NotePanel",props:{selectedNode:{},readonly:{type:Boolean},focusTick:{}},emits:["apply","remove","set-link","set-image","set-rich"],setup(t,{emit:o}){const n=t,r=o,i=e.ref(""),s=e.ref(null);xr(s,{minRows:4,maxRows:10});const c=e.computed(()=>!i.value||i.value.trim()===""),u=e.computed(()=>Am(i.value)),d=e.ref(!0);function g(){d.value=!d.value}e.watch(()=>{var y,p,O;return[(y=n.selectedNode)==null?void 0:y.id,(O=(p=n.selectedNode)==null?void 0:p.note)==null?void 0:O.text]},()=>{var y,p;i.value=((p=(y=n.selectedNode)==null?void 0:y.note)==null?void 0:p.text)??""},{immediate:!0}),e.watch(()=>n.focusTick,async()=>{if(n.readonly)return;await e.nextTick();const y=document.querySelector(".zm-note-panel textarea.zm-note-textarea");if(y){y.focus();const p=y.value.length;y.setSelectionRange(p,p)}});function b(){var O,D;if(n.readonly)return;const y=i.value,p=((D=(O=n.selectedNode)==null?void 0:O.note)==null?void 0:D.text)??"";y!==p&&r("apply",y)}function w(y){var p,O;n.readonly||(y.key==="Escape"?(y.preventDefault(),i.value=((O=(p=n.selectedNode)==null?void 0:p.note)==null?void 0:O.text)??"",y.target.blur()):y.key==="Enter"&&(y.ctrlKey||y.metaKey)&&(y.preventDefault(),b(),y.target.blur()))}function N(){n.readonly||confirm("移除该节点的笔记?")&&(i.value="",r("remove"))}const V=e.computed(()=>{var y,p;return!!((p=(y=n.selectedNode)==null?void 0:y.link)!=null&&p.url)}),_=e.computed(()=>{var y,p;return!!((p=(y=n.selectedNode)==null?void 0:y.image)!=null&&p.src)}),$=e.computed(()=>{var y,p;return(p=(y=n.selectedNode)==null?void 0:y.richContent)==null?void 0:p.kind}),B=e.computed(()=>$.value==="code"),T=e.computed(()=>$.value==="table"),E=e.ref(!1),k=e.ref(!1),m=e.ref(!1),v=e.ref(!1);e.watch(()=>{var y;return(y=n.selectedNode)==null?void 0:y.id},()=>{E.value=!1,k.value=!1,m.value=!1,v.value=!1});const x=e.ref("");e.watch(()=>{var y,p,O;return[(y=n.selectedNode)==null?void 0:y.id,(O=(p=n.selectedNode)==null?void 0:p.link)==null?void 0:O.url]},()=>{var y,p;x.value=((p=(y=n.selectedNode)==null?void 0:y.link)==null?void 0:p.url)??""},{immediate:!0});function j(){var O,D;if(n.readonly)return;const y=x.value.trim(),p=((D=(O=n.selectedNode)==null?void 0:O.link)==null?void 0:D.url)??"";y!==p&&r("set-link",y)}const K=e.ref("");e.watch(()=>{var y,p,O;return[(y=n.selectedNode)==null?void 0:y.id,(O=(p=n.selectedNode)==null?void 0:p.image)==null?void 0:O.src]},()=>{var y,p;K.value=((p=(y=n.selectedNode)==null?void 0:y.image)==null?void 0:p.src)??""},{immediate:!0});function ne(){var O,D;if(n.readonly)return;const y=K.value.trim(),p=((D=(O=n.selectedNode)==null?void 0:O.image)==null?void 0:D.src)??"";y!==p&&r("set-image",y)}function ce(y){const p=y.target;p.style.display="none"}function re(y){const p=y.target;p.style.display=""}const Y=e.ref(""),ee=e.ref(null);xr(ee,{minRows:4,maxRows:18}),e.watch(()=>{var y,p,O;return[(y=n.selectedNode)==null?void 0:y.id,(O=(p=n.selectedNode)==null?void 0:p.richContent)==null?void 0:O.raw]},()=>{var y,p;Y.value=((p=(y=n.selectedNode)==null?void 0:y.richContent)==null?void 0:p.raw)??""},{immediate:!0});const ie=e.computed(()=>gr(Po(Y.value),Tn(Y.value)));function z(){var D,q;if(n.readonly)return;const y=Y.value,p=((q=(D=n.selectedNode)==null?void 0:D.richContent)==null?void 0:q.raw)??"";if(y===p)return;const O=Tn(y)||void 0;r("set-rich",y?{kind:"code",raw:y,lang:O}:null)}const C=e.ref(""),F=e.ref(null);xr(F,{minRows:4,maxRows:14});const P=e.ref(-1),W=e.ref("asc");e.watch(()=>{var y,p,O;return[(y=n.selectedNode)==null?void 0:y.id,(O=(p=n.selectedNode)==null?void 0:p.richContent)==null?void 0:O.raw]},()=>{var y,p;C.value=((p=(y=n.selectedNode)==null?void 0:y.richContent)==null?void 0:p.raw)??"",P.value=-1,W.value="asc"},{immediate:!0});function ae(){var O,D;if(n.readonly)return;const y=C.value,p=((D=(O=n.selectedNode)==null?void 0:O.richContent)==null?void 0:D.raw)??"";y!==p&&r("set-rich",y?{kind:"table",raw:y}:null)}const we=e.computed(()=>hr(C.value)),ve=e.computed(()=>{const y=we.value;return P.value<0||y.length<=1?y:qi(y,P.value,W.value)});function ze(y){P.value!==y?(P.value=y,W.value="asc"):W.value==="asc"?W.value="desc":P.value=-1}const Ne=e.computed(()=>{const y=[];return c.value||y.push(`${i.value.length} 字`),V.value&&y.push("1 链接"),_.value&&y.push("1 图片"),B.value&&y.push("代码块"),T.value&&y.push("表格"),y.length===0?"节点没有额外内容":y.join(" · ")});return(y,p)=>{var O,D,q,de;return e.openBlock(),e.createElementBlock("div",_m,[t.selectedNode?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",Rm,[e.createElementVNode("div",vm,[p[12]||(p[12]=e.createElementVNode("span",{class:"zm-note-label"},"节点",-1)),e.createElementVNode("span",Bm,e.toDisplayString(t.selectedNode.text||"(无标题)"),1)]),e.createElementVNode("div",zm,e.toDisplayString(Ne.value),1)]),e.createElementVNode("div",Im,[e.createElementVNode("section",Om,[e.createElementVNode("header",Lm,[p[13]||(p[13]=e.createElementVNode("span",{class:"zm-note-section-title"},"笔记",-1)),p[14]||(p[14]=e.createElementVNode("span",{class:"zm-note-section-hint"},"Ctrl+Enter 提交, Esc 取消",-1)),t.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"zm-note-preview-toggle",onClick:g},e.toDisplayString(d.value?"隐藏预览":"显示预览"),1))]),e.createElementVNode("div",Dm,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"noteRef",ref:s,"onUpdate:modelValue":p[0]||(p[0]=ge=>i.value=ge),class:"zm-note-textarea",placeholder:"写点什么吧… 支持 Markdown",spellcheck:"false",disabled:t.readonly,onBlur:b,onKeydown:w},null,40,Vm),[[e.vModelText,i.value]]),d.value?(e.openBlock(),e.createElementBlock("div",$m,[c.value?(e.openBlock(),e.createElementBlock("div",Fm," 渲染后的 Markdown 仅在此面板显示,不会撑大节点框。 ")):(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-note-preview-body",innerHTML:u.value},null,8,Pm))])):e.createCommentVNode("",!0)]),!t.readonly&&!c.value?(e.openBlock(),e.createElementBlock("div",Um,[e.createElementVNode("button",{class:"zm-note-action-btn is-danger",onClick:N},"移除笔记")])):e.createCommentVNode("",!0)]),t.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Hm,[!V.value&&!E.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-note-add-chip",onClick:p[1]||(p[1]=ge=>E.value=!0)},"+ 链接")):e.createCommentVNode("",!0),!_.value&&!k.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-note-add-chip",onClick:p[2]||(p[2]=ge=>k.value=!0)},"+ 图片")):e.createCommentVNode("",!0),!B.value&&!m.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-note-add-chip",onClick:p[3]||(p[3]=ge=>m.value=!0)},"+ 代码块")):e.createCommentVNode("",!0),!T.value&&!v.value?(e.openBlock(),e.createElementBlock("button",{key:3,class:"zm-note-add-chip",onClick:p[4]||(p[4]=ge=>v.value=!0)},"+ 表格")):e.createCommentVNode("",!0)])),V.value||E.value?(e.openBlock(),e.createElementBlock("section",Wm,[p[15]||(p[15]=e.createElementVNode("header",{class:"zm-note-section-head"},[e.createElementVNode("span",{class:"zm-note-section-title"},"链接")],-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":p[5]||(p[5]=ge=>x.value=ge),class:"zm-note-input",type:"url",placeholder:"https://…",disabled:t.readonly,onBlur:j,onKeydown:p[6]||(p[6]=e.withKeys(e.withModifiers(ge=>ge.target.blur(),["prevent"]),["enter"]))},null,40,Gm),[[e.vModelText,x.value]]),V.value?(e.openBlock(),e.createElementBlock("a",{key:0,class:"zm-note-link-chip",href:(O=t.selectedNode.link)==null?void 0:O.url,target:"_blank",rel:"noopener noreferrer",title:(D=t.selectedNode.link)==null?void 0:D.url},e.toDisplayString((q=t.selectedNode.link)==null?void 0:q.url),9,jm)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),_.value||k.value?(e.openBlock(),e.createElementBlock("section",Km,[p[16]||(p[16]=e.createElementVNode("header",{class:"zm-note-section-head"},[e.createElementVNode("span",{class:"zm-note-section-title"},"图片")],-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":p[7]||(p[7]=ge=>K.value=ge),class:"zm-note-input",type:"url",placeholder:"data:image/… 或 https://…",disabled:t.readonly,onBlur:ne,onKeydown:p[8]||(p[8]=e.withKeys(e.withModifiers(ge=>ge.target.blur(),["prevent"]),["enter"]))},null,40,Ym),[[e.vModelText,K.value]]),_.value?(e.openBlock(),e.createElementBlock("img",{key:0,class:"zm-note-image",src:(de=t.selectedNode.image)==null?void 0:de.src,alt:t.selectedNode.text,onError:ce,onLoad:re},null,40,qm)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),B.value||m.value?(e.openBlock(),e.createElementBlock("section",Xm,[e.createElementVNode("header",Zm,[p[17]||(p[17]=e.createElementVNode("span",{class:"zm-note-section-title"},"代码块",-1)),e.unref(Tn)(Y.value)?(e.openBlock(),e.createElementBlock("span",Jm,e.toDisplayString(e.unref(Tn)(Y.value)),1)):e.createCommentVNode("",!0)]),e.withDirectives(e.createElementVNode("textarea",{ref_key:"codeRef",ref:ee,"onUpdate:modelValue":p[9]||(p[9]=ge=>Y.value=ge),class:"zm-note-input zm-note-input-code",placeholder:"```ts\nconsole.log(123)\n```",spellcheck:"false",disabled:t.readonly,onBlur:z},null,40,Qm),[[e.vModelText,Y.value]]),Y.value.trim()?(e.openBlock(),e.createElementBlock("pre",ep,[e.createElementVNode("code",{innerHTML:ie.value},null,8,tp)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),T.value||v.value?(e.openBlock(),e.createElementBlock("section",np,[p[18]||(p[18]=e.createElementVNode("header",{class:"zm-note-section-head"},[e.createElementVNode("span",{class:"zm-note-section-title"},"表格"),e.createElementVNode("span",{class:"zm-note-section-hint"},"点击表头排序")],-1)),e.withDirectives(e.createElementVNode("textarea",{ref_key:"tableRef",ref:F,"onUpdate:modelValue":p[10]||(p[10]=ge=>C.value=ge),class:"zm-note-input zm-note-input-code",placeholder:`| 列1 | 列2 |
124
+ `}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${jt(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:o,tokens:n}){let r=this.parser.parseInline(n),l=yl(t);if(l===null)return r;t=l;let s='<a href="'+t+'"';return o&&(s+=' title="'+jt(o)+'"'),s+=">"+r+"</a>",s}image({href:t,title:o,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let l=yl(t);if(l===null)return jt(n);t=l;let s=`<img src="${t}" alt="${jt(n)}"`;return o&&(s+=` title="${jt(o)}"`),s+=">",s}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:jt(t.text)}},Lr=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}checkbox({raw:t}){return t}},Vt=class oi{constructor(o){ve(this,"options");ve(this,"renderer");ve(this,"textRenderer");this.options=o||Sn,this.options.renderer=this.options.renderer||new so,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Lr}static parse(o,n){return new oi(n).parse(o)}static parseInline(o,n){return new oi(n).parseInline(o)}parse(o){var r,l;this.renderer.parser=this;let n="";for(let s=0;s<o.length;s++){let c=o[s];if((l=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&l[c.type]){let d=c,g=this.options.extensions.renderers[d.type].call({parser:this},d);if(g!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(d.type)){n+=g||"";continue}}let u=c;switch(u.type){case"space":{n+=this.renderer.space(u);break}case"hr":{n+=this.renderer.hr(u);break}case"heading":{n+=this.renderer.heading(u);break}case"code":{n+=this.renderer.code(u);break}case"table":{n+=this.renderer.table(u);break}case"blockquote":{n+=this.renderer.blockquote(u);break}case"list":{n+=this.renderer.list(u);break}case"checkbox":{n+=this.renderer.checkbox(u);break}case"html":{n+=this.renderer.html(u);break}case"def":{n+=this.renderer.def(u);break}case"paragraph":{n+=this.renderer.paragraph(u);break}case"text":{n+=this.renderer.text(u);break}default:{let d='Token with "'+u.type+'" type was not found.';if(this.options.silent)return console.error(d),"";throw new Error(d)}}}return n}parseInline(o,n=this.renderer){var l,s;this.renderer.parser=this;let r="";for(let c=0;c<o.length;c++){let u=o[c];if((s=(l=this.options.extensions)==null?void 0:l.renderers)!=null&&s[u.type]){let g=this.options.extensions.renderers[u.type].call({parser:this},u);if(g!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(u.type)){r+=g||"";continue}}let d=u;switch(d.type){case"escape":{r+=n.text(d);break}case"html":{r+=n.html(d);break}case"link":{r+=n.link(d);break}case"image":{r+=n.image(d);break}case"checkbox":{r+=n.checkbox(d);break}case"strong":{r+=n.strong(d);break}case"em":{r+=n.em(d);break}case"codespan":{r+=n.codespan(d);break}case"br":{r+=n.br(d);break}case"del":{r+=n.del(d);break}case"text":{r+=n.text(d);break}default:{let g='Token with "'+d.type+'" type was not found.';if(this.options.silent)return console.error(g),"";throw new Error(g)}}}return r}},co=(Qo=class{constructor(t){ve(this,"options");ve(this,"block");this.options=t||Sn}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?Dt.lex:Dt.lexInline}provideParser(t=this.block){return t?Vt.parse:Vt.parseInline}},ve(Qo,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),ve(Qo,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Qo),Nl=class{constructor(...t){ve(this,"defaults",Ar());ve(this,"options",this.setOptions);ve(this,"parse",this.parseMarkdown(!0));ve(this,"parseInline",this.parseMarkdown(!1));ve(this,"Parser",Vt);ve(this,"Renderer",so);ve(this,"TextRenderer",Lr);ve(this,"Lexer",Dt);ve(this,"Tokenizer",qo);ve(this,"Hooks",co);this.use(...t)}walkTokens(t,o){var r,l;let n=[];for(let s of t)switch(n=n.concat(o.call(this,s)),s.type){case"table":{let c=s;for(let u of c.header)n=n.concat(this.walkTokens(u.tokens,o));for(let u of c.rows)for(let d of u)n=n.concat(this.walkTokens(d.tokens,o));break}case"list":{let c=s;n=n.concat(this.walkTokens(c.items,o));break}default:{let c=s;(l=(r=this.defaults.extensions)==null?void 0:r.childTokens)!=null&&l[c.type]?this.defaults.extensions.childTokens[c.type].forEach(u=>{let d=c[u].flat(1/0);n=n.concat(this.walkTokens(d,o))}):c.tokens&&(n=n.concat(this.walkTokens(c.tokens,o)))}}return n}use(...t){let o=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(l=>{if(!l.name)throw new Error("extension name required");if("renderer"in l){let s=o.renderers[l.name];s?o.renderers[l.name]=function(...c){let u=l.renderer.apply(this,c);return u===!1&&(u=s.apply(this,c)),u}:o.renderers[l.name]=l.renderer}if("tokenizer"in l){if(!l.level||l.level!=="block"&&l.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=o[l.level];s?s.unshift(l.tokenizer):o[l.level]=[l.tokenizer],l.start&&(l.level==="block"?o.startBlock?o.startBlock.push(l.start):o.startBlock=[l.start]:l.level==="inline"&&(o.startInline?o.startInline.push(l.start):o.startInline=[l.start]))}"childTokens"in l&&l.childTokens&&(o.childTokens[l.name]=l.childTokens)}),r.extensions=o),n.renderer){let l=this.defaults.renderer||new so(this.defaults);for(let s in n.renderer){if(!(s in l))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let c=s,u=n.renderer[c],d=l[c];l[c]=(...g)=>{let b=u.apply(l,g);return b===!1&&(b=d.apply(l,g)),b||""}}r.renderer=l}if(n.tokenizer){let l=this.defaults.tokenizer||new qo(this.defaults);for(let s in n.tokenizer){if(!(s in l))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let c=s,u=n.tokenizer[c],d=l[c];l[c]=(...g)=>{let b=u.apply(l,g);return b===!1&&(b=d.apply(l,g)),b}}r.tokenizer=l}if(n.hooks){let l=this.defaults.hooks||new co;for(let s in n.hooks){if(!(s in l))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let c=s,u=n.hooks[c],d=l[c];co.passThroughHooks.has(s)?l[c]=g=>{if(this.defaults.async&&co.passThroughHooksRespectAsync.has(s))return(async()=>{let w=await u.call(l,g);return d.call(l,w)})();let b=u.call(l,g);return d.call(l,b)}:l[c]=(...g)=>{if(this.defaults.async)return(async()=>{let w=await u.apply(l,g);return w===!1&&(w=await d.apply(l,g)),w})();let b=u.apply(l,g);return b===!1&&(b=d.apply(l,g)),b}}r.hooks=l}if(n.walkTokens){let l=this.defaults.walkTokens,s=n.walkTokens;r.walkTokens=function(c){let u=[];return u.push(s.call(this,c)),l&&(u=u.concat(l.call(this,c))),u}}this.defaults={...this.defaults,...r}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,o){return Dt.lex(t,o??this.defaults)}parser(t,o){return Vt.parse(t,o??this.defaults)}parseMarkdown(t){return(o,n)=>{let r={...n},l={...this.defaults,...r},s=this.onError(!!l.silent,!!l.async);if(this.defaults.async===!0&&r.async===!1)return s(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof o>"u"||o===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof o!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(o)+", string expected"));if(l.hooks&&(l.hooks.options=l,l.hooks.block=t),l.async)return(async()=>{let c=l.hooks?await l.hooks.preprocess(o):o,u=await(l.hooks?await l.hooks.provideLexer(t):t?Dt.lex:Dt.lexInline)(c,l),d=l.hooks?await l.hooks.processAllTokens(u):u;l.walkTokens&&await Promise.all(this.walkTokens(d,l.walkTokens));let g=await(l.hooks?await l.hooks.provideParser(t):t?Vt.parse:Vt.parseInline)(d,l);return l.hooks?await l.hooks.postprocess(g):g})().catch(s);try{l.hooks&&(o=l.hooks.preprocess(o));let c=(l.hooks?l.hooks.provideLexer(t):t?Dt.lex:Dt.lexInline)(o,l);l.hooks&&(c=l.hooks.processAllTokens(c)),l.walkTokens&&this.walkTokens(c,l.walkTokens);let u=(l.hooks?l.hooks.provideParser(t):t?Vt.parse:Vt.parseInline)(c,l);return l.hooks&&(u=l.hooks.postprocess(u)),u}catch(c){return s(c)}}}onError(t,o){return n=>{if(n.message+=`
125
+ Please report this to https://github.com/markedjs/marked.`,t){let r="<p>An error occurred:</p><pre>"+jt(n.message+"",!0)+"</pre>";return o?Promise.resolve(r):r}if(o)return Promise.reject(n);throw n}}},Cn=new Nl;function Ae(t,o){return Cn.parse(t,o)}Ae.options=Ae.setOptions=function(t){return Cn.setOptions(t),Ae.defaults=Cn.defaults,ll(Ae.defaults),Ae},Ae.getDefaults=Ar,Ae.defaults=Sn,Ae.use=function(...t){return Cn.use(...t),Ae.defaults=Cn.defaults,ll(Ae.defaults),Ae},Ae.walkTokens=function(t,o){return Cn.walkTokens(t,o)},Ae.parseInline=Cn.parseInline,Ae.Parser=Vt,Ae.parser=Vt.parse,Ae.Renderer=so,Ae.TextRenderer=Lr,Ae.Lexer=Dt,Ae.lexer=Dt.lex,Ae.Tokenizer=qo,Ae.Hooks=co,Ae.parse=Ae,Ae.options,Ae.setOptions,Ae.use,Ae.walkTokens,Ae.parseInline,Vt.parse,Dt.lex;/*! @license DOMPurify 3.4.8 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.8/LICENSE */function Sl(t,o){(o==null||o>t.length)&&(o=t.length);for(var n=0,r=Array(o);n<o;n++)r[n]=t[n];return r}function Df(t){if(Array.isArray(t))return t}function Vf(t,o){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,l,s,c,u=[],d=!0,g=!1;try{if(s=(n=n.call(t)).next,o!==0)for(;!(d=(r=s.call(n)).done)&&(u.push(r.value),u.length!==o);d=!0);}catch(b){g=!0,l=b}finally{try{if(!d&&n.return!=null&&(c=n.return(),Object(c)!==c))return}finally{if(g)throw l}}return u}}function $f(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
126
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Pf(t,o){return Df(t)||Vf(t,o)||Uf(t,o)||$f()}function Uf(t,o){if(t){if(typeof t=="string")return Sl(t,o);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Sl(t,o):void 0}}const Tl=Object.entries,Cl=Object.setPrototypeOf,Ff=Object.isFrozen,Hf=Object.getPrototypeOf,Wf=Object.getOwnPropertyDescriptor;let st=Object.freeze,vt=Object.seal,Un=Object.create,Al=typeof Reflect<"u"&&Reflect,Dr=Al.apply,Vr=Al.construct;st||(st=function(o){return o}),vt||(vt=function(o){return o}),Dr||(Dr=function(o,n){for(var r=arguments.length,l=new Array(r>2?r-2:0),s=2;s<r;s++)l[s-2]=arguments[s];return o.apply(n,l)}),Vr||(Vr=function(o){for(var n=arguments.length,r=new Array(n>1?n-1:0),l=1;l<n;l++)r[l-1]=arguments[l];return new o(...r)});const An=We(Array.prototype.forEach),Gf=We(Array.prototype.lastIndexOf),_l=We(Array.prototype.pop),Fn=We(Array.prototype.push),jf=We(Array.prototype.splice),ct=Array.isArray,uo=We(String.prototype.toLowerCase),$r=We(String.prototype.toString),Ml=We(String.prototype.match),Hn=We(String.prototype.replace),vl=We(String.prototype.indexOf),Kf=We(String.prototype.trim),Yf=We(Number.prototype.toString),qf=We(Boolean.prototype.toString),Rl=typeof BigInt>"u"?null:We(BigInt.prototype.toString),Bl=typeof Symbol>"u"?null:We(Symbol.prototype.toString),$e=We(Object.prototype.hasOwnProperty),fo=We(Object.prototype.toString),et=We(RegExp.prototype.test),Wn=Xf(TypeError);function We(t){return function(o){o instanceof RegExp&&(o.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),l=1;l<n;l++)r[l-1]=arguments[l];return Dr(t,o,r)}}function Xf(t){return function(){for(var o=arguments.length,n=new Array(o),r=0;r<o;r++)n[r]=arguments[r];return Vr(t,n)}}function ue(t,o){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:uo;if(Cl&&Cl(t,null),!ct(o))return t;let r=o.length;for(;r--;){let l=o[r];if(typeof l=="string"){const s=n(l);s!==l&&(Ff(o)||(o[r]=s),l=s)}t[l]=!0}return t}function Zf(t){for(let o=0;o<t.length;o++)$e(t,o)||(t[o]=null);return t}function rt(t){const o=Un(null);for(const r of Tl(t)){var n=Pf(r,2);const l=n[0],s=n[1];$e(t,l)&&(ct(s)?o[l]=Zf(s):s&&typeof s=="object"&&s.constructor===Object?o[l]=rt(s):o[l]=s)}return o}function Jf(t){switch(typeof t){case"string":return t;case"number":return Yf(t);case"boolean":return qf(t);case"bigint":return Rl?Rl(t):"0";case"symbol":return Bl?Bl(t):"Symbol()";case"undefined":return fo(t);case"function":case"object":{if(t===null)return fo(t);const o=t,n=Kt(o,"toString");if(typeof n=="function"){const r=n(o);return typeof r=="string"?r:fo(r)}return fo(t)}default:return fo(t)}}function Kt(t,o){for(;t!==null;){const r=Wf(t,o);if(r){if(r.get)return We(r.get);if(typeof r.value=="function")return We(r.value)}t=Hf(t)}function n(){return null}return n}function Qf(t){try{return et(t,""),!0}catch{return!1}}const Il=st(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Pr=st(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Ur=st(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),em=st(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Fr=st(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),tm=st(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),zl=st(["#text"]),Ol=st(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Hr=st(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Ll=st(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Xo=st(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),nm=vt(/{{[\w\W]*|^[\w\W]*}}/g),om=vt(/<%[\w\W]*|^[\w\W]*%>/g),rm=vt(/\${[\w\W]*/g),im=vt(/^data-[\-\w.\u00B7-\uFFFF]+$/),lm=vt(/^aria-[\-\w]+$/),Dl=vt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),am=vt(/^(?:\w+script|data):/i),sm=vt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),cm=vt(/^html$/i),dm=vt(/^[a-z][.\w]*(-[.\w]+)+$/i),Yt={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},um=function(){return typeof window>"u"?null:window},fm=function(o,n){if(typeof o!="object"||typeof o.createPolicy!="function")return null;let r=null;const l="data-tt-policy-suffix";n&&n.hasAttribute(l)&&(r=n.getAttribute(l));const s="dompurify"+(r?"#"+r:"");try{return o.createPolicy(s,{createHTML(c){return c},createScriptURL(c){return c}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},Vl=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function $l(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:um();const o=R=>$l(R);if(o.version="3.4.8",o.removed=[],!t||!t.document||t.document.nodeType!==Yt.document||!t.Element)return o.isSupported=!1,o;let n=t.document;const r=n,l=r.currentScript;t.DocumentFragment;const s=t.HTMLTemplateElement,c=t.Node,u=t.Element,d=t.NodeFilter,g=t.NamedNodeMap;g===void 0&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const b=t.DOMParser,w=t.trustedTypes,N=u.prototype,$=Kt(N,"cloneNode"),M=Kt(N,"remove"),P=Kt(N,"nextSibling"),I=Kt(N,"childNodes"),C=Kt(N,"parentNode"),E=Kt(N,"shadowRoot"),k=Kt(N,"attributes"),m=c&&c.prototype?Kt(c.prototype,"nodeType"):null,B=c&&c.prototype?Kt(c.prototype,"nodeName"):null;if(typeof s=="function"){const R=n.createElement("template");R.content&&R.content.ownerDocument&&(n=R.content.ownerDocument)}let x,K="",Y=0;const ee=function(h){if(Y>0)throw Wn('The configured TRUSTED_TYPES_POLICY.createHTML must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose createHTML wraps DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.');Y++;try{return x.createHTML(h)}finally{Y--}},ae=n,re=ae.implementation,q=ae.createNodeIterator,Q=ae.createDocumentFragment,ie=ae.getElementsByTagName,z=r.importNode;let A=Vl();o.isSupported=typeof Tl=="function"&&typeof C=="function"&&re&&re.createHTMLDocument!==void 0;const F=nm,U=om,G=rm,le=im,Ne=lm,_e=am,Re=sm,xe=dm;let y=Dl,p=null;const L=ue({},[...Il,...Pr,...Ur,...Fr,...zl]);let V=null;const X=ue({},[...Ol,...Hr,...Ll,...Xo]);let se=Object.seal(Un(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ge=null,Ge=null;const Pe=Object.seal(Un(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Ze=!0,je=!0,tn=!1,Rt=!0,J=!1,it=!0,Te=!1,Se=!1,Bt=!1,Je=!1,gt=!1,dt=!1,H=!0,Z=!1;const ce="user-content-";let ke=!0,ze=!1,Qe={},ht=null;const Mn=ue({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let er=null;const tr=ue({},["audio","video","img","source","image","track"]);let mo=null;const nr=ue({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),jn="http://www.w3.org/1998/Math/MathML",Kn="http://www.w3.org/2000/svg",It="http://www.w3.org/1999/xhtml";let mn=It,po=!1,go=null;const Wr=ue({},[jn,Kn,It],$r);let ho=ue({},["mi","mo","mn","ms","mtext"]),bo=ue({},["annotation-xml"]);const Gr=ue({},["title","style","font","a","script"]);let vn=null;const or=["application/xhtml+xml","text/html"],jr="text/html";let Oe=null,pn=null;const rr=n.createElement("form"),ir=function(h){return h instanceof RegExp||h instanceof Function},Yn=function(){let h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(pn&&pn===h)return;(!h||typeof h!="object")&&(h={}),h=rt(h),vn=or.indexOf(h.PARSER_MEDIA_TYPE)===-1?jr:h.PARSER_MEDIA_TYPE,Oe=vn==="application/xhtml+xml"?$r:uo,p=$e(h,"ALLOWED_TAGS")&&ct(h.ALLOWED_TAGS)?ue({},h.ALLOWED_TAGS,Oe):L,V=$e(h,"ALLOWED_ATTR")&&ct(h.ALLOWED_ATTR)?ue({},h.ALLOWED_ATTR,Oe):X,go=$e(h,"ALLOWED_NAMESPACES")&&ct(h.ALLOWED_NAMESPACES)?ue({},h.ALLOWED_NAMESPACES,$r):Wr,mo=$e(h,"ADD_URI_SAFE_ATTR")&&ct(h.ADD_URI_SAFE_ATTR)?ue(rt(nr),h.ADD_URI_SAFE_ATTR,Oe):nr,er=$e(h,"ADD_DATA_URI_TAGS")&&ct(h.ADD_DATA_URI_TAGS)?ue(rt(tr),h.ADD_DATA_URI_TAGS,Oe):tr,ht=$e(h,"FORBID_CONTENTS")&&ct(h.FORBID_CONTENTS)?ue({},h.FORBID_CONTENTS,Oe):Mn,ge=$e(h,"FORBID_TAGS")&&ct(h.FORBID_TAGS)?ue({},h.FORBID_TAGS,Oe):rt({}),Ge=$e(h,"FORBID_ATTR")&&ct(h.FORBID_ATTR)?ue({},h.FORBID_ATTR,Oe):rt({}),Qe=$e(h,"USE_PROFILES")?h.USE_PROFILES&&typeof h.USE_PROFILES=="object"?rt(h.USE_PROFILES):h.USE_PROFILES:!1,Ze=h.ALLOW_ARIA_ATTR!==!1,je=h.ALLOW_DATA_ATTR!==!1,tn=h.ALLOW_UNKNOWN_PROTOCOLS||!1,Rt=h.ALLOW_SELF_CLOSE_IN_ATTR!==!1,J=h.SAFE_FOR_TEMPLATES||!1,it=h.SAFE_FOR_XML!==!1,Te=h.WHOLE_DOCUMENT||!1,Je=h.RETURN_DOM||!1,gt=h.RETURN_DOM_FRAGMENT||!1,dt=h.RETURN_TRUSTED_TYPE||!1,Bt=h.FORCE_BODY||!1,H=h.SANITIZE_DOM!==!1,Z=h.SANITIZE_NAMED_PROPS||!1,ke=h.KEEP_CONTENT!==!1,ze=h.IN_PLACE||!1,y=Qf(h.ALLOWED_URI_REGEXP)?h.ALLOWED_URI_REGEXP:Dl,mn=typeof h.NAMESPACE=="string"?h.NAMESPACE:It,ho=$e(h,"MATHML_TEXT_INTEGRATION_POINTS")&&h.MATHML_TEXT_INTEGRATION_POINTS&&typeof h.MATHML_TEXT_INTEGRATION_POINTS=="object"?rt(h.MATHML_TEXT_INTEGRATION_POINTS):ue({},["mi","mo","mn","ms","mtext"]),bo=$e(h,"HTML_INTEGRATION_POINTS")&&h.HTML_INTEGRATION_POINTS&&typeof h.HTML_INTEGRATION_POINTS=="object"?rt(h.HTML_INTEGRATION_POINTS):ue({},["annotation-xml"]);const O=$e(h,"CUSTOM_ELEMENT_HANDLING")&&h.CUSTOM_ELEMENT_HANDLING&&typeof h.CUSTOM_ELEMENT_HANDLING=="object"?rt(h.CUSTOM_ELEMENT_HANDLING):Un(null);if(se=Un(null),$e(O,"tagNameCheck")&&ir(O.tagNameCheck)&&(se.tagNameCheck=O.tagNameCheck),$e(O,"attributeNameCheck")&&ir(O.attributeNameCheck)&&(se.attributeNameCheck=O.attributeNameCheck),$e(O,"allowCustomizedBuiltInElements")&&typeof O.allowCustomizedBuiltInElements=="boolean"&&(se.allowCustomizedBuiltInElements=O.allowCustomizedBuiltInElements),J&&(je=!1),gt&&(Je=!0),Qe&&(p=ue({},zl),V=Un(null),Qe.html===!0&&(ue(p,Il),ue(V,Ol)),Qe.svg===!0&&(ue(p,Pr),ue(V,Hr),ue(V,Xo)),Qe.svgFilters===!0&&(ue(p,Ur),ue(V,Hr),ue(V,Xo)),Qe.mathMl===!0&&(ue(p,Fr),ue(V,Ll),ue(V,Xo))),Pe.tagCheck=null,Pe.attributeCheck=null,$e(h,"ADD_TAGS")&&(typeof h.ADD_TAGS=="function"?Pe.tagCheck=h.ADD_TAGS:ct(h.ADD_TAGS)&&(p===L&&(p=rt(p)),ue(p,h.ADD_TAGS,Oe))),$e(h,"ADD_ATTR")&&(typeof h.ADD_ATTR=="function"?Pe.attributeCheck=h.ADD_ATTR:ct(h.ADD_ATTR)&&(V===X&&(V=rt(V)),ue(V,h.ADD_ATTR,Oe))),$e(h,"ADD_URI_SAFE_ATTR")&&ct(h.ADD_URI_SAFE_ATTR)&&ue(mo,h.ADD_URI_SAFE_ATTR,Oe),$e(h,"FORBID_CONTENTS")&&ct(h.FORBID_CONTENTS)&&(ht===Mn&&(ht=rt(ht)),ue(ht,h.FORBID_CONTENTS,Oe)),$e(h,"ADD_FORBID_CONTENTS")&&ct(h.ADD_FORBID_CONTENTS)&&(ht===Mn&&(ht=rt(ht)),ue(ht,h.ADD_FORBID_CONTENTS,Oe)),ke&&(p["#text"]=!0),Te&&ue(p,["html","head","body"]),p.table&&(ue(p,["tbody"]),delete ge.tbody),h.TRUSTED_TYPES_POLICY){if(typeof h.TRUSTED_TYPES_POLICY.createHTML!="function")throw Wn('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof h.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Wn('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const W=x;x=h.TRUSTED_TYPES_POLICY;try{K=ee("")}catch(we){throw x=W,we}}else x===void 0&&h.TRUSTED_TYPES_POLICY!==null&&(x=fm(w,l)),x&&typeof K=="string"&&(K=ee(""));(A.uponSanitizeElement.length>0||A.uponSanitizeAttribute.length>0)&&p===L&&(p=rt(p)),A.uponSanitizeAttribute.length>0&&V===X&&(V=rt(V)),st&&st(h),pn=h},ko=ue({},[...Pr,...Ur,...em]),gn=ue({},[...Fr,...tm]),Kr=function(h){let O=C(h);(!O||!O.tagName)&&(O={namespaceURI:mn,tagName:"template"});const W=uo(h.tagName),we=uo(O.tagName);return go[h.namespaceURI]?h.namespaceURI===Kn?O.namespaceURI===It?W==="svg":O.namespaceURI===jn?W==="svg"&&(we==="annotation-xml"||ho[we]):!!ko[W]:h.namespaceURI===jn?O.namespaceURI===It?W==="math":O.namespaceURI===Kn?W==="math"&&bo[we]:!!gn[W]:h.namespaceURI===It?O.namespaceURI===Kn&&!bo[we]||O.namespaceURI===jn&&!ho[we]?!1:!gn[W]&&(Gr[W]||!ko[W]):!!(vn==="application/xhtml+xml"&&go[h.namespaceURI]):!1},Et=function(h){Fn(o.removed,{element:h});try{C(h).removeChild(h)}catch{M(h)}},qt=function(h,O){try{Fn(o.removed,{attribute:O.getAttributeNode(h),from:O})}catch{Fn(o.removed,{attribute:null,from:O})}if(O.removeAttribute(h),h==="is")if(Je||gt)try{Et(O)}catch{}else try{O.setAttribute(h,"")}catch{}},yo=function(h){let O=null,W=null;if(Bt)h="<remove></remove>"+h;else{const Ce=Ml(h,/^[\r\n\t ]+/);W=Ce&&Ce[0]}vn==="application/xhtml+xml"&&mn===It&&(h='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+h+"</body></html>");const we=x?ee(h):h;if(mn===It)try{O=new b().parseFromString(we,vn)}catch{}if(!O||!O.documentElement){O=re.createDocument(mn,"template",null);try{O.documentElement.innerHTML=po?K:we}catch{}}const fe=O.body||O.documentElement;return h&&W&&fe.insertBefore(n.createTextNode(W),fe.childNodes[0]||null),mn===It?ie.call(O,Te?"html":"body")[0]:Te?O.documentElement:fe},qn=function(h){return q.call(h.ownerDocument||h,h,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},Rn=function(h){var O,W;h.normalize();const we=q.call(h.ownerDocument||h,h,d.SHOW_TEXT|d.SHOW_COMMENT|d.SHOW_CDATA_SECTION|d.SHOW_PROCESSING_INSTRUCTION,null);let fe=we.nextNode();for(;fe;){let Le=fe.data;An([F,U,G],bt=>{Le=Hn(Le,bt," ")}),fe.data=Le,fe=we.nextNode()}const Ce=(O=(W=h.querySelectorAll)===null||W===void 0?void 0:W.call(h,"template"))!==null&&O!==void 0?O:[];An(Array.from(Ce),Le=>{hn(Le.content)&&Rn(Le.content)})},Xn=function(h){const O=B?B(h):null;return typeof O!="string"||Oe(O)!=="form"?!1:typeof h.nodeName!="string"||typeof h.textContent!="string"||typeof h.removeChild!="function"||h.attributes!==k(h)||typeof h.removeAttribute!="function"||typeof h.setAttribute!="function"||typeof h.namespaceURI!="string"||typeof h.insertBefore!="function"||typeof h.hasChildNodes!="function"||h.nodeType!==m(h)||h.childNodes!==I(h)},hn=function(h){if(!m||typeof h!="object"||h===null)return!1;try{return m(h)===Yt.documentFragment}catch{return!1}},Zn=function(h){if(!m||typeof h!="object"||h===null)return!1;try{return typeof m(h)=="number"}catch{return!1}};function xt(R,h,O){An(R,W=>{W.call(o,h,O,pn)})}const Jn=function(h){let O=null;if(xt(A.beforeSanitizeElements,h,null),Xn(h))return Et(h),!0;const W=Oe(B?B(h):h.nodeName);if(xt(A.uponSanitizeElement,h,{tagName:W,allowedTags:p}),it&&h.hasChildNodes()&&!Zn(h.firstElementChild)&&et(/<[/\w!]/g,h.innerHTML)&&et(/<[/\w!]/g,h.textContent)||it&&h.namespaceURI===It&&W==="style"&&Zn(h.firstElementChild)||h.nodeType===Yt.progressingInstruction||it&&h.nodeType===Yt.comment&&et(/<[/\w]/g,h.data))return Et(h),!0;if(ge[W]||!(Pe.tagCheck instanceof Function&&Pe.tagCheck(W))&&!p[W]){if(!ge[W]&&pe(W)&&(se.tagNameCheck instanceof RegExp&&et(se.tagNameCheck,W)||se.tagNameCheck instanceof Function&&se.tagNameCheck(W)))return!1;if(ke&&!ht[W]){const fe=C(h),Ce=I(h);if(Ce&&fe){const Le=Ce.length;for(let bt=Le-1;bt>=0;--bt){const kt=$(Ce[bt],!0);fe.insertBefore(kt,P(h))}}}return Et(h),!0}return(m?m(h):h.nodeType)===Yt.element&&!Kr(h)||(W==="noscript"||W==="noembed"||W==="noframes")&&et(/<\/no(script|embed|frames)/i,h.innerHTML)?(Et(h),!0):(J&&h.nodeType===Yt.text&&(O=h.textContent,An([F,U,G],fe=>{O=Hn(O,fe," ")}),h.textContent!==O&&(Fn(o.removed,{element:h.cloneNode()}),h.textContent=O)),xt(A.afterSanitizeElements,h,null),!1)},$t=function(h,O,W){if(Ge[O]||H&&(O==="id"||O==="name")&&(W in n||W in rr))return!1;const we=V[O]||Pe.attributeCheck instanceof Function&&Pe.attributeCheck(O,h);if(!(je&&!Ge[O]&&et(le,O))){if(!(Ze&&et(Ne,O))){if(!we||Ge[O]){if(!(pe(h)&&(se.tagNameCheck instanceof RegExp&&et(se.tagNameCheck,h)||se.tagNameCheck instanceof Function&&se.tagNameCheck(h))&&(se.attributeNameCheck instanceof RegExp&&et(se.attributeNameCheck,O)||se.attributeNameCheck instanceof Function&&se.attributeNameCheck(O,h))||O==="is"&&se.allowCustomizedBuiltInElements&&(se.tagNameCheck instanceof RegExp&&et(se.tagNameCheck,W)||se.tagNameCheck instanceof Function&&se.tagNameCheck(W))))return!1}else if(!mo[O]){if(!et(y,Hn(W,Re,""))){if(!((O==="src"||O==="xlink:href"||O==="href")&&h!=="script"&&vl(W,"data:")===0&&er[h])){if(!(tn&&!et(_e,Hn(W,Re,"")))){if(W)return!1}}}}}}return!0},Me=ue({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),pe=function(h){return!Me[uo(h)]&&et(xe,h)},lr=function(h){xt(A.beforeSanitizeAttributes,h,null);const O=h.attributes;if(!O||Xn(h))return;const W={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:V,forceKeepAttr:void 0};let we=O.length;for(;we--;){const fe=O[we],Ce=fe.name,Le=fe.namespaceURI,bt=fe.value,kt=Oe(Ce),Pt=bt;let He=Ce==="value"?Pt:Kf(Pt);if(W.attrName=kt,W.attrValue=He,W.keepAttr=!0,W.forceKeepAttr=void 0,xt(A.uponSanitizeAttribute,h,W),He=W.attrValue,Z&&(kt==="id"||kt==="name")&&vl(He,ce)!==0&&(qt(Ce,h),He=ce+He),it&&et(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,He)){qt(Ce,h);continue}if(kt==="attributename"&&Ml(He,"href")){qt(Ce,h);continue}if(W.forceKeepAttr)continue;if(!W.keepAttr){qt(Ce,h);continue}if(!Rt&&et(/\/>/i,He)){qt(Ce,h);continue}J&&An([F,U,G],nn=>{He=Hn(He,nn," ")});const Eo=Oe(h.nodeName);if(!$t(Eo,kt,He)){qt(Ce,h);continue}if(x&&typeof w=="object"&&typeof w.getAttributeType=="function"&&!Le)switch(w.getAttributeType(Eo,kt)){case"TrustedHTML":{He=ee(He);break}case"TrustedScriptURL":{He=x.createScriptURL(He);break}}if(He!==Pt)try{Le?h.setAttributeNS(Le,Ce,He):h.setAttribute(Ce,He),Xn(h)?Et(h):_l(o.removed)}catch{qt(Ce,h)}}xt(A.afterSanitizeAttributes,h,null)},tt=function(h){let O=null;const W=qn(h);for(xt(A.beforeSanitizeShadowDOM,h,null);O=W.nextNode();)if(xt(A.uponSanitizeShadowNode,O,null),Jn(O),lr(O),hn(O.content)&&tt(O.content),(m?m(O):O.nodeType)===Yt.element){const fe=E?E(O):O.shadowRoot;hn(fe)&&(Xt(fe),tt(fe))}xt(A.afterSanitizeShadowDOM,h,null)},Xt=function(h){const O=m?m(h):h.nodeType;if(O===Yt.element){const fe=E?E(h):h.shadowRoot;hn(fe)&&(Xt(fe),tt(fe))}const W=I?I(h):h.childNodes;if(!W)return;const we=[];An(W,fe=>{Fn(we,fe)});for(const fe of we)Xt(fe);if(O===Yt.element){const fe=B?B(h):null;if(typeof fe=="string"&&Oe(fe)==="template"){const Ce=h.content;hn(Ce)&&Xt(Ce)}}};return o.sanitize=function(R){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},O=null,W=null,we=null,fe=null;if(po=!R,po&&(R="<!-->"),typeof R!="string"&&!Zn(R)&&(R=Jf(R),typeof R!="string"))throw Wn("dirty is not a string, aborting");if(!o.isSupported)return R;if(Se||Yn(h),o.removed=[],typeof R=="string"&&(ze=!1),ze){const bt=B?B(R):R.nodeName;if(typeof bt=="string"){const kt=Oe(bt);if(!p[kt]||ge[kt])throw Wn("root node is forbidden and cannot be sanitized in-place")}if(Xn(R))throw Wn("root node is clobbered and cannot be sanitized in-place");Xt(R)}else if(Zn(R))O=yo("<!---->"),W=O.ownerDocument.importNode(R,!0),W.nodeType===Yt.element&&W.nodeName==="BODY"||W.nodeName==="HTML"?O=W:O.appendChild(W),Xt(W);else{if(!Je&&!J&&!Te&&R.indexOf("<")===-1)return x&&dt?ee(R):R;if(O=yo(R),!O)return Je?null:dt?K:""}O&&Bt&&Et(O.firstChild);const Ce=qn(ze?R:O);for(;we=Ce.nextNode();)Jn(we),lr(we),hn(we.content)&&tt(we.content);if(ze)return J&&Rn(R),R;if(Je){if(J&&Rn(O),gt)for(fe=Q.call(O.ownerDocument);O.firstChild;)fe.appendChild(O.firstChild);else fe=O;return(V.shadowroot||V.shadowrootmode)&&(fe=z.call(r,fe,!0)),fe}let Le=Te?O.outerHTML:O.innerHTML;return Te&&p["!doctype"]&&O.ownerDocument&&O.ownerDocument.doctype&&O.ownerDocument.doctype.name&&et(cm,O.ownerDocument.doctype.name)&&(Le="<!DOCTYPE "+O.ownerDocument.doctype.name+`>
127
+ `+Le),J&&An([F,U,G],bt=>{Le=Hn(Le,bt," ")}),x&&dt?ee(Le):Le},o.setConfig=function(){let R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Yn(R),Se=!0},o.clearConfig=function(){pn=null,Se=!1},o.isValidAttribute=function(R,h,O){pn||Yn({});const W=Oe(R),we=Oe(h);return $t(W,we,O)},o.addHook=function(R,h){typeof h=="function"&&Fn(A[R],h)},o.removeHook=function(R,h){if(h!==void 0){const O=Gf(A[R],h);return O===-1?void 0:jf(A[R],O,1)[0]}return _l(A[R])},o.removeHooks=function(R){A[R]=[]},o.removeAllHooks=function(){A=Vl()},o}var mm=$l();const pm=new Nl({gfm:!0,breaks:!0,pedantic:!1,renderer:(()=>{const t=new so;return t.code=({text:o,lang:n})=>{const r=(n??"").toLowerCase(),l=Tr(o,r);return`<pre><code${r?` class="language-${r}"`:""}>${l}</code></pre>`},t})()}),gm=["p","br","strong","em","del","s","u","a","ul","ol","li","h1","h2","h3","h4","h5","h6","blockquote","code","pre","hr","table","thead","tbody","tr","th","td","img","span","input"],hm=["href","title","target","rel","src","alt","class","checked","type","disabled"],bm=/^(?:(?:https?|mailto|tel|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i;function km(t){if(!t)return"";const o=pm.parse(t,{async:!1});return mm.sanitize(o,{ALLOWED_TAGS:gm,ALLOWED_ATTR:hm,ALLOWED_URI_REGEXP:bm})}const ym={class:"zm-note-panel"},Em={key:0,class:"zm-note-empty"},xm={class:"zm-note-header"},wm={class:"zm-note-title-row"},Nm={class:"zm-note-name"},Sm={class:"zm-note-meta"},Tm={class:"zm-note-scroll"},Cm={class:"zm-note-section"},Am={class:"zm-note-section-head"},_m={class:"zm-note-split"},Mm=["disabled"],vm={key:0,class:"zm-note-preview"},Rm=["innerHTML"],Bm={key:1,class:"zm-note-preview-hint"},Im={key:0,class:"zm-note-section-actions"},zm={key:0,class:"zm-note-add-row"},Om={key:1,class:"zm-note-section"},Lm=["disabled"],Dm=["href","title"],Vm={key:2,class:"zm-note-section"},$m=["disabled"],Pm=["src","alt"],Um={key:3,class:"zm-note-section"},Fm={class:"zm-note-section-head"},Hm={key:0,class:"zm-note-section-tag"},Wm=["disabled"],Gm={key:0,class:"zm-note-code"},jm=["innerHTML"],Km={key:4,class:"zm-note-section"},Ym=["disabled"],qm={key:0,class:"zm-note-table"},Xm=["onClick"],Zm={class:"zm-note-table-sort-mark","aria-hidden":"true"},Zo=e.defineComponent({__name:"NotePanel",props:{selectedNode:{},readonly:{type:Boolean},focusTick:{}},emits:["apply","remove","set-link","set-image","set-rich"],setup(t,{emit:o}){const n=t,r=o,l=e.ref(""),s=e.ref(null);hr(s,{minRows:4,maxRows:10});const c=e.computed(()=>!l.value||l.value.trim()===""),u=e.computed(()=>km(l.value)),d=e.ref(!0);function g(){d.value=!d.value}e.watch(()=>{var y,p,L;return[(y=n.selectedNode)==null?void 0:y.id,(L=(p=n.selectedNode)==null?void 0:p.note)==null?void 0:L.text]},()=>{var y,p;l.value=((p=(y=n.selectedNode)==null?void 0:y.note)==null?void 0:p.text)??""},{immediate:!0}),e.watch(()=>n.focusTick,async()=>{if(n.readonly)return;await e.nextTick();const y=document.querySelector(".zm-note-panel textarea.zm-note-textarea");if(y){y.focus();const p=y.value.length;y.setSelectionRange(p,p)}});function b(){var L,V;if(n.readonly)return;const y=l.value,p=((V=(L=n.selectedNode)==null?void 0:L.note)==null?void 0:V.text)??"";y!==p&&r("apply",y)}function w(y){var p,L;n.readonly||(y.key==="Escape"?(y.preventDefault(),l.value=((L=(p=n.selectedNode)==null?void 0:p.note)==null?void 0:L.text)??"",y.target.blur()):y.key==="Enter"&&(y.ctrlKey||y.metaKey)&&(y.preventDefault(),b(),y.target.blur()))}function N(){n.readonly||confirm("移除该节点的笔记?")&&(l.value="",r("remove"))}const $=e.computed(()=>{var y,p;return!!((p=(y=n.selectedNode)==null?void 0:y.link)!=null&&p.url)}),M=e.computed(()=>{var y,p;return!!((p=(y=n.selectedNode)==null?void 0:y.image)!=null&&p.src)}),P=e.computed(()=>{var y,p;return(p=(y=n.selectedNode)==null?void 0:y.richContent)==null?void 0:p.kind}),I=e.computed(()=>P.value==="code"),C=e.computed(()=>P.value==="table"),E=e.ref(!1),k=e.ref(!1),m=e.ref(!1),B=e.ref(!1);e.watch(()=>{var y;return(y=n.selectedNode)==null?void 0:y.id},()=>{E.value=!1,k.value=!1,m.value=!1,B.value=!1});const x=e.ref("");e.watch(()=>{var y,p,L;return[(y=n.selectedNode)==null?void 0:y.id,(L=(p=n.selectedNode)==null?void 0:p.link)==null?void 0:L.url]},()=>{var y,p;x.value=((p=(y=n.selectedNode)==null?void 0:y.link)==null?void 0:p.url)??""},{immediate:!0});function K(){var L,V;if(n.readonly)return;const y=x.value.trim(),p=((V=(L=n.selectedNode)==null?void 0:L.link)==null?void 0:V.url)??"";y!==p&&r("set-link",y)}const Y=e.ref("");e.watch(()=>{var y,p,L;return[(y=n.selectedNode)==null?void 0:y.id,(L=(p=n.selectedNode)==null?void 0:p.image)==null?void 0:L.src]},()=>{var y,p;Y.value=((p=(y=n.selectedNode)==null?void 0:y.image)==null?void 0:p.src)??""},{immediate:!0});function ee(){var L,V;if(n.readonly)return;const y=Y.value.trim(),p=((V=(L=n.selectedNode)==null?void 0:L.image)==null?void 0:V.src)??"";y!==p&&r("set-image",y)}function ae(y){const p=y.target;p.style.display="none"}function re(y){const p=y.target;p.style.display=""}const q=e.ref(""),Q=e.ref(null);hr(Q,{minRows:4,maxRows:18}),e.watch(()=>{var y,p,L;return[(y=n.selectedNode)==null?void 0:y.id,(L=(p=n.selectedNode)==null?void 0:p.richContent)==null?void 0:L.raw]},()=>{var y,p;q.value=((p=(y=n.selectedNode)==null?void 0:y.richContent)==null?void 0:p.raw)??""},{immediate:!0});const ie=e.computed(()=>Tr(Wo(q.value),Nn(q.value)));function z(){var V,X;if(n.readonly)return;const y=q.value,p=((X=(V=n.selectedNode)==null?void 0:V.richContent)==null?void 0:X.raw)??"";if(y===p)return;const L=Nn(y)||void 0;r("set-rich",y?{kind:"code",raw:y,lang:L}:null)}const A=e.ref(""),F=e.ref(null);hr(F,{minRows:4,maxRows:14});const U=e.ref(-1),G=e.ref("asc");e.watch(()=>{var y,p,L;return[(y=n.selectedNode)==null?void 0:y.id,(L=(p=n.selectedNode)==null?void 0:p.richContent)==null?void 0:L.raw]},()=>{var y,p;A.value=((p=(y=n.selectedNode)==null?void 0:y.richContent)==null?void 0:p.raw)??"",U.value=-1,G.value="asc"},{immediate:!0});function le(){var L,V;if(n.readonly)return;const y=A.value,p=((V=(L=n.selectedNode)==null?void 0:L.richContent)==null?void 0:V.raw)??"";y!==p&&r("set-rich",y?{kind:"table",raw:y}:null)}const Ne=e.computed(()=>Cr(A.value)),_e=e.computed(()=>{const y=Ne.value;return U.value<0||y.length<=1?y:il(y,U.value,G.value)});function Re(y){U.value!==y?(U.value=y,G.value="asc"):G.value==="asc"?G.value="desc":U.value=-1}const xe=e.computed(()=>{const y=[];return c.value||y.push(`${l.value.length} 字`),$.value&&y.push("1 链接"),M.value&&y.push("1 图片"),I.value&&y.push("代码块"),C.value&&y.push("表格"),y.length===0?"节点没有额外内容":y.join(" · ")});return(y,p)=>{var L,V,X,se;return e.openBlock(),e.createElementBlock("div",ym,[t.selectedNode?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",xm,[e.createElementVNode("div",wm,[p[12]||(p[12]=e.createElementVNode("span",{class:"zm-note-label"},"节点",-1)),e.createElementVNode("span",Nm,e.toDisplayString(t.selectedNode.text||"(无标题)"),1)]),e.createElementVNode("div",Sm,e.toDisplayString(xe.value),1)]),e.createElementVNode("div",Tm,[e.createElementVNode("section",Cm,[e.createElementVNode("header",Am,[p[13]||(p[13]=e.createElementVNode("span",{class:"zm-note-section-title"},"笔记",-1)),p[14]||(p[14]=e.createElementVNode("span",{class:"zm-note-section-hint"},"Ctrl+Enter 提交, Esc 取消",-1)),t.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"zm-note-preview-toggle",onClick:g},e.toDisplayString(d.value?"隐藏预览":"显示预览"),1))]),e.createElementVNode("div",_m,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"noteRef",ref:s,"onUpdate:modelValue":p[0]||(p[0]=ge=>l.value=ge),class:"zm-note-textarea",placeholder:"写点什么吧… 支持 Markdown",spellcheck:"false",disabled:t.readonly,onBlur:b,onKeydown:w},null,40,Mm),[[e.vModelText,l.value]]),d.value?(e.openBlock(),e.createElementBlock("div",vm,[c.value?(e.openBlock(),e.createElementBlock("div",Bm," 渲染后的 Markdown 仅在此面板显示,不会撑大节点框。 ")):(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-note-preview-body",innerHTML:u.value},null,8,Rm))])):e.createCommentVNode("",!0)]),!t.readonly&&!c.value?(e.openBlock(),e.createElementBlock("div",Im,[e.createElementVNode("button",{class:"zm-note-action-btn is-danger",onClick:N},"移除笔记")])):e.createCommentVNode("",!0)]),t.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",zm,[!$.value&&!E.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-note-add-chip",onClick:p[1]||(p[1]=ge=>E.value=!0)},"+ 链接")):e.createCommentVNode("",!0),!M.value&&!k.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-note-add-chip",onClick:p[2]||(p[2]=ge=>k.value=!0)},"+ 图片")):e.createCommentVNode("",!0),!I.value&&!m.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-note-add-chip",onClick:p[3]||(p[3]=ge=>m.value=!0)},"+ 代码块")):e.createCommentVNode("",!0),!C.value&&!B.value?(e.openBlock(),e.createElementBlock("button",{key:3,class:"zm-note-add-chip",onClick:p[4]||(p[4]=ge=>B.value=!0)},"+ 表格")):e.createCommentVNode("",!0)])),$.value||E.value?(e.openBlock(),e.createElementBlock("section",Om,[p[15]||(p[15]=e.createElementVNode("header",{class:"zm-note-section-head"},[e.createElementVNode("span",{class:"zm-note-section-title"},"链接")],-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":p[5]||(p[5]=ge=>x.value=ge),class:"zm-note-input",type:"url",placeholder:"https://…",disabled:t.readonly,onBlur:K,onKeydown:p[6]||(p[6]=e.withKeys(e.withModifiers(ge=>ge.target.blur(),["prevent"]),["enter"]))},null,40,Lm),[[e.vModelText,x.value]]),$.value?(e.openBlock(),e.createElementBlock("a",{key:0,class:"zm-note-link-chip",href:(L=t.selectedNode.link)==null?void 0:L.url,target:"_blank",rel:"noopener noreferrer",title:(V=t.selectedNode.link)==null?void 0:V.url},e.toDisplayString((X=t.selectedNode.link)==null?void 0:X.url),9,Dm)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),M.value||k.value?(e.openBlock(),e.createElementBlock("section",Vm,[p[16]||(p[16]=e.createElementVNode("header",{class:"zm-note-section-head"},[e.createElementVNode("span",{class:"zm-note-section-title"},"图片")],-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":p[7]||(p[7]=ge=>Y.value=ge),class:"zm-note-input",type:"url",placeholder:"data:image/… 或 https://…",disabled:t.readonly,onBlur:ee,onKeydown:p[8]||(p[8]=e.withKeys(e.withModifiers(ge=>ge.target.blur(),["prevent"]),["enter"]))},null,40,$m),[[e.vModelText,Y.value]]),M.value?(e.openBlock(),e.createElementBlock("img",{key:0,class:"zm-note-image",src:(se=t.selectedNode.image)==null?void 0:se.src,alt:t.selectedNode.text,onError:ae,onLoad:re},null,40,Pm)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),I.value||m.value?(e.openBlock(),e.createElementBlock("section",Um,[e.createElementVNode("header",Fm,[p[17]||(p[17]=e.createElementVNode("span",{class:"zm-note-section-title"},"代码块",-1)),e.unref(Nn)(q.value)?(e.openBlock(),e.createElementBlock("span",Hm,e.toDisplayString(e.unref(Nn)(q.value)),1)):e.createCommentVNode("",!0)]),e.withDirectives(e.createElementVNode("textarea",{ref_key:"codeRef",ref:Q,"onUpdate:modelValue":p[9]||(p[9]=ge=>q.value=ge),class:"zm-note-input zm-note-input-code",placeholder:"```ts\nconsole.log(123)\n```",spellcheck:"false",disabled:t.readonly,onBlur:z},null,40,Wm),[[e.vModelText,q.value]]),q.value.trim()?(e.openBlock(),e.createElementBlock("pre",Gm,[e.createElementVNode("code",{innerHTML:ie.value},null,8,jm)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),C.value||B.value?(e.openBlock(),e.createElementBlock("section",Km,[p[18]||(p[18]=e.createElementVNode("header",{class:"zm-note-section-head"},[e.createElementVNode("span",{class:"zm-note-section-title"},"表格"),e.createElementVNode("span",{class:"zm-note-section-hint"},"点击表头排序")],-1)),e.withDirectives(e.createElementVNode("textarea",{ref_key:"tableRef",ref:F,"onUpdate:modelValue":p[10]||(p[10]=ge=>A.value=ge),class:"zm-note-input zm-note-input-code",placeholder:`| 列1 | 列2 |
134
128
  | --- | --- |
135
- | a | b |`,spellcheck:"false",disabled:t.readonly,onBlur:ae},null,40,op),[[e.vModelText,C.value]]),we.value.length?(e.openBlock(),e.createElementBlock("table",rp,[e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ve.value,(ge,je)=>(e.openBlock(),e.createElementBlock("tr",{key:je},[je===0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(ge,(Pe,Je)=>(e.openBlock(),e.createElementBlock("th",{key:`h${Je}`,class:e.normalizeClass(["zm-note-table-sort",{"is-sorted":P.value===Je,"is-asc":P.value===Je&&W.value==="asc","is-desc":P.value===Je&&W.value==="desc"}]),onClick:Ke=>ze(Je)},[e.createElementVNode("span",null,e.toDisplayString(Pe),1),e.createElementVNode("span",lp,e.toDisplayString(P.value===Je?W.value==="asc"?"▲":"▼":"↕"),1)],10,ip))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(ge,(Pe,Je)=>(e.openBlock(),e.createElementBlock("td",{key:`c${Je}`},e.toDisplayString(Pe),1))),128))]))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])],64)):(e.openBlock(),e.createElementBlock("div",Mm,[...p[11]||(p[11]=[e.createElementVNode("p",null,"请先在画布上选中一个节点。",-1),e.createElementVNode("p",{class:"zm-note-hint"}," 选中节点后,会在这里展示并可编辑节点的笔记、链接、图片、代码块、表格。 ",-1)])]))])}}}),ap={class:"zm-app"},sp={class:"zm-app-main"},cp={class:"zm-app-canvas"},Bl=e.defineComponent({__name:"App",setup(t){const o={id:"r_root",text:"flow-mindmap 节点能力一览",link:{url:"https://github.com/xz333221/flow-mindmap"},note:{text:`本导图用于演示节点的全部可渲染字段。
129
+ | a | b |`,spellcheck:"false",disabled:t.readonly,onBlur:le},null,40,Ym),[[e.vModelText,A.value]]),Ne.value.length?(e.openBlock(),e.createElementBlock("table",qm,[e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_e.value,(ge,Ge)=>(e.openBlock(),e.createElementBlock("tr",{key:Ge},[Ge===0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(ge,(Pe,Ze)=>(e.openBlock(),e.createElementBlock("th",{key:`h${Ze}`,class:e.normalizeClass(["zm-note-table-sort",{"is-sorted":U.value===Ze,"is-asc":U.value===Ze&&G.value==="asc","is-desc":U.value===Ze&&G.value==="desc"}]),onClick:je=>Re(Ze)},[e.createElementVNode("span",null,e.toDisplayString(Pe),1),e.createElementVNode("span",Zm,e.toDisplayString(U.value===Ze?G.value==="asc"?"▲":"▼":"↕"),1)],10,Xm))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(ge,(Pe,Ze)=>(e.openBlock(),e.createElementBlock("td",{key:`c${Ze}`},e.toDisplayString(Pe),1))),128))]))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])],64)):(e.openBlock(),e.createElementBlock("div",Em,[...p[11]||(p[11]=[e.createElementVNode("p",null,"请先在画布上选中一个节点。",-1),e.createElementVNode("p",{class:"zm-note-hint"}," 选中节点后,会在这里展示并可编辑节点的笔记、链接、图片、代码块、表格。 ",-1)])]))])}}}),Jm=["viewBox","width","height"],Qm={class:"zm-edges"},ep=["d","fill"],tp=["data-node-id","onClick","onPointerdown","onDblclick","onContextmenu","onMouseenter","onMouseleave"],np=["src","width","height","alt"],op=["onDblclick"],rp={key:0,class:"zm-rich-code"},ip=["innerHTML"],lp={key:1,class:"zm-rich-table"},ap=["onClick"],sp={class:"zm-rich-sort-mark","aria-hidden":"true"},cp={key:2,class:"zm-text"},dp={key:0,class:"zm-node-markers"},up=["title","innerHTML"],fp={class:"zm-text-label"},mp=["href","title"],pp=["title","onClick"],gp={key:4,class:"zm-node-tags"},hp=["title"],bp=["title","onClick"],kp=["onClick"],yp=["onMousedown"],Ep=["onClick"],xp=["title"],wp={class:"zm-tb-tip zm-tb-zoom"},Np=["src"],Sp=["src"],_n=24,Gn=400,fn=160,Pl=4,Jo=e.defineComponent({__name:"MindMap",props:{data:{},theme:{},previewMode:{type:Boolean,default:!1},markdown:{},lineColors:{},hideCanvasActions:{type:Boolean,default:!1},builtInDrawers:{type:Boolean,default:!0}},emits:["change","select","edit-note","markdownChange","canvas-toggle-preview","canvas-outline","canvas-settings","canvas-data","canvas-import"],setup(t,{expose:o,emit:n}){const r=t,l=n,s=e.ref(null),c=e.ref(null),u=e.ref(""),d=e.ref(new Set),g=e.computed(()=>d.value.values().next().value??null),b=e.ref(new Set),w=e.ref(!1),N=e.ref(null),$=e.ref(0),M=e.ref(0),P=e.ref(null),I=e.ref(null),C=e.ref(null),E=e.ref(""),k=e.ref(new Map),m=e.ref(_t(r.data)),B=e.ref({}),x=e.ref({}),K=e.ref(r.markdown!==void 0);let Y=!1;e.watch(()=>r.markdown,i=>{if(i===void 0){K.value=!1;return}K.value=!0;const a=zn(i||"");Y=!0,m.value=_t(a),d.value=new Set,b.value=new Set,pe(),e.nextTick(()=>{Y=!1,on()})}),e.watch(m,()=>{K.value&&!Y&&l("markdownChange",On(m.value))},{deep:!0});const ee=e.computed(()=>R.showOrderBadge===!0),ae=e.ref(new Map),re=ae.value;function q(i,a){const f={};a.bg&&(f.bg=a.bg),a.textColor&&(f.textColor=a.textColor),a.borderColor&&(f.borderColor=a.borderColor),a.fontWeight&&(f.fontWeight=a.fontWeight),a.fontSize&&(f.fontSize=a.fontSize),Object.keys(f).length===0?re.delete(i):re.set(i,f),ae.value=new Map(re)}function Q(i){return re.get(i)??{}}function ie(i,a){const f=oe(m.value,i);f&&(f.image={src:a.src,naturalW:a.naturalW,naturalH:a.naturalH,width:F(a.width,_n,Gn),height:F(a.height,_n,Gn)},Me(),pe(),l("change",m.value))}function z(i){const a=oe(m.value,i);!a||!a.image||(delete a.image,Me(),pe(),l("change",m.value))}function A(i,a){const f=a.trim();if(!oe(m.value,i))return;if(!f){z(i);return}const S=new Image;S.onload=()=>{const D=oe(m.value,i);if(!D)return;const v=S.naturalWidth&&S.naturalHeight?S.naturalWidth/S.naturalHeight:1,j=F(S.naturalWidth||fn,_n,Gn),te=Math.round(j/v);D.image={src:f,naturalW:S.naturalWidth||j,naturalH:S.naturalHeight||te,width:j,height:te},Me(),pe(),l("change",m.value)},S.onerror=()=>{},S.src=f}function F(i,a,f){return Math.min(f,Math.max(a,i))}function U(i,a){const f=new FileReader;f.onload=()=>{if(typeof f.result!="string")return;const _=f.result,S=new window.Image;S.onload=()=>{const D=S.naturalWidth||fn,v=S.naturalHeight||fn,j=F(D,_n,fn),te=F(Math.round(v*j/D),_n,Gn);a({src:_,naturalW:D,naturalH:v,width:j,height:te})},S.onerror=()=>{a({src:_,naturalW:fn,naturalH:fn,width:fn,height:fn})},S.src=_},f.readAsDataURL(i)}function G(i){const a=document.createElement("input");a.type="file",a.accept="image/*",a.style.display="none",a.onchange=()=>{var _;const f=(_=a.files)==null?void 0:_[0];f&&(U(f,S=>ie(i,S)),document.body.removeChild(a))},document.body.appendChild(a),a.click()}function le(i,a){const f=a.trim(),_=oe(m.value,i);_&&(f?_.link={url:f}:delete _.link,Me(),pe(),l("change",m.value))}function Ne(i){le(i,"")}function _e(i,a){const f=oe(m.value,i);f&&(a?f.note={text:a}:delete f.note,Me(),pe(),l("change",m.value))}function Re(i){_e(i,"")}function xe(i,a){const f=oe(m.value,i);f&&(a?f.richContent=a:delete f.richContent,Me(),pe(),l("change",m.value))}const y=e.ref(null),p=e.ref(null),L=e.computed(()=>["zm-canvas-fab","zm-canvas-fab-preview",!r.hideCanvasActions&&(!r.previewMode||w.value)?"is-visible":""].filter(Boolean).join(" ")),V=e.computed(()=>["zm-canvas-fab","zm-canvas-fab-outline",!r.hideCanvasActions&&(!r.previewMode||w.value)?"is-visible":""].filter(Boolean).join(" "));function X(i,a){r.previewMode||(i.preventDefault(),i.stopPropagation(),p.value=null,d.value=new Set([a.id]),ft(),y.value={nodeId:a.id,x:i.clientX,y:i.clientY})}function se(){y.value=null}function ge(i){const a=i.target;if(!(a!=null&&a.closest(".zm-toolbar, button, input, textarea, .zm-canvas-fab-preview, .zm-canvas-fab-outline"))){if(cr&&ne.panMoved.value){cr=!1,i.preventDefault();return}i.preventDefault(),y.value&&(y.value=null),p.value={x:i.clientX,y:i.clientY}}}function Ge(){p.value=null}function Pe(){Ge(),r.builtInDrawers&&(gt(),Te.value=!0),l("canvas-settings")}function Ze(){Ge(),r.builtInDrawers&&(gt(),Rt.value=!0),l("canvas-data")}function je(i){Ge(),r.builtInDrawers&&(gt(),Bt.value=i,Rt.value=!0),l("canvas-import",i)}const tn=e.ref(!1),Rt=e.ref(!1),J=e.ref(!1),it=e.ref(!1),Te=e.ref(!1),Se=e.ref(0),Bt=e.ref(null),Je=e.ref(new Set);function gt(){Rt.value=!1,J.value=!1,it.value=!1,Te.value=!1}const dt=e.computed(()=>{const i=g.value;return i?oe(m.value,i)??null:null}),H=e.computed(()=>dt.value?Q(dt.value.id):{});function Z(i){i.autoBalanceOnChange!==void 0&&(R.autoBalanceOnChange=i.autoBalanceOnChange),i.lineWidthStart!==void 0&&(R.lineWidthStart=Math.max(.5,Math.min(20,i.lineWidthStart))),i.lineWidthEnd!==void 0&&(R.lineWidthEnd=Math.max(.3,Math.min(10,i.lineWidthEnd))),i.rainbowBranch!==void 0&&(R.rainbowBranch=i.rainbowBranch),i.branchPaletteId!==void 0&&(R.branchPaletteId=i.branchPaletteId),i.customPalettes!==void 0&&(R.customPalettes=i.customPalettes),i.lineStyle!==void 0&&(R.lineStyle=i.lineStyle),i.taperedEdge!==void 0&&(R.taperedEdge=i.taperedEdge),i.showOrderBadge!==void 0&&(R.showOrderBadge=i.showOrderBadge),i.canvasBg!==void 0&&(R.canvasBg=i.canvasBg)}function ce(i){dt.value&&q(dt.value.id,i)}function ke(){const i={autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"curve",layoutMode:"mindmap",taperedEdge:!0,showOrderBadge:!1,canvasBg:void 0};R.autoBalanceOnChange=i.autoBalanceOnChange,R.lineWidthStart=i.lineWidthStart,R.lineWidthEnd=i.lineWidthEnd,R.rainbowBranch=i.rainbowBranch,R.branchPaletteId=i.branchPaletteId,R.customPalettes=i.customPalettes,R.lineStyle=i.lineStyle,R.layoutMode=i.layoutMode,R.taperedEdge=i.taperedEdge,R.showOrderBadge=i.showOrderBadge,R.canvasBg=i.canvasBg}function ze(){Bt.value=null}function Qe(i){const a=g.value;a&&_e(a,i)}function ht(){const i=g.value;i&&Re(i)}function Mn(i){const a=g.value;a&&le(a,i)}function er(i){const a=g.value;a&&A(a,i)}function tr(i){const a=g.value;a&&xe(a,i)}function mo(i){const a=document.querySelector(`[data-node-id="${i.id}"]`);a&&a.click()}function nr(i){ia(i.id,i.text)}function jn(i){to(i)}function Kn(i){ar(i)}function It(i){Zr(i.srcId,i.targetId,i.position)}function mn(i){const a=new Set(Je.value);a.has(i)?a.delete(i):a.add(i),Je.value=a}function po(){r.builtInDrawers&&(tn.value=!tn.value),l("canvas-outline")}function go(){var a;const i=(a=y.value)==null?void 0:a.nodeId;i&&G(i)}function Wr(){var _,S,D;const i=(_=y.value)==null?void 0:_.nodeId;if(!i)return;const a=((D=(S=oe(m.value,i))==null?void 0:S.link)==null?void 0:D.url)??"",f=window.prompt("输入链接 URL(留空取消)",a);f!==null&&le(i,f)}function ho(){var a;const i=(a=y.value)==null?void 0:a.nodeId;i&&Ne(i)}function bo(){var a;const i=(a=y.value)==null?void 0:a.nodeId;i&&rr(i)}function Gr(){var a;const i=(a=y.value)==null?void 0:a.nodeId;i&&Re(i)}function vn(){var a;const i=(a=y.value)==null?void 0:a.nodeId;i&&z(i)}function or(){var Ve,T;const i=(Ve=y.value)==null?void 0:Ve.nodeId;if(!i)return;const a=(T=oe(m.value,i))==null?void 0:T.richContent,f=(a==null?void 0:a.kind)==="code"?Wo(a.raw):"",_=(a==null?void 0:a.kind)==="code"&&a.lang||"",S=_?"```"+_+`
130
+ `:"```\n",v=window.prompt("输入代码块内容(用 ```lang 包裹;留空取消)",f?S+f+(f.endsWith("```")?"":"\n```"):S+"// 你的代码"+"\n```");if(v===null)return;const j=v.trim();if(!j){xe(i,null);return}const te=/^```([^\s`]*)/.exec(j),me=te?te[1]:void 0;xe(i,{kind:"code",raw:j,lang:me})}function jr(){var a;const i=(a=y.value)==null?void 0:a.nodeId;i&&xe(i,null)}function Oe(){var v,j;const i=(v=y.value)==null?void 0:v.nodeId;if(!i)return;const a=(j=oe(m.value,i))==null?void 0:j.richContent,f=(a==null?void 0:a.kind)==="table"?a.raw:"",S=window.prompt("输入 markdown 表格(每行以 | 分隔;留空取消)",f||`| 列1 | 列2 | 列3 |
131
+ | --- | --- | --- |
132
+ | a | b | c |`);if(S===null)return;const D=S.trim();if(!D){xe(i,null);return}xe(i,{kind:"table",raw:D})}function pn(){var a;const i=(a=y.value)==null?void 0:a.nodeId;i&&xe(i,null)}function rr(i){r.previewMode||(r.builtInDrawers&&(gt(),it.value=!0,Se.value++),l("edit-note",i))}function ir(i,a=60){const f=i.replace(/\s+/g," ").trim();return f.length<=a?f||"点击编辑笔记":f.slice(0,a)+"…"}function Yn(i){var S;if(r.previewMode||c.value)return;const a=i.target;if(a&&(a.tagName==="INPUT"||a.tagName==="TEXTAREA"||a.isContentEditable))return;const f=g.value;if(!f)return;const _=(S=i.clipboardData)==null?void 0:S.items;if(_)for(let D=0;D<_.length;D++){const v=_[D];if(v.kind==="file"&&v.type.startsWith("image/")){const j=v.getAsFile();if(!j)continue;i.preventDefault();const te=oe(m.value,f);if(te!=null&&te.image&&!window.confirm("该节点已有图片,要用剪贴板里的图片替换吗?"))return;U(j,me=>ie(f,me));return}}}e.onMounted(()=>{window.addEventListener("paste",Yn),window.addEventListener("keydown",ko),pe()}),e.onBeforeUnmount(()=>{window.removeEventListener("paste",Yn),window.removeEventListener("keydown",ko)});function ko(i){if((i.metaKey||i.ctrlKey)&&(i.key==="f"||i.key==="F")){const f=i.target;if(f&&(f.tagName==="INPUT"||f.tagName==="TEXTAREA"||f.isContentEditable))return;i.preventDefault(),l("canvas-outline")}}const gn=e.ref(null),Kr=e.computed(()=>{var i;return((i=gn.value)==null?void 0:i.nodeId)??null});function Et(i,a){if(!a.image)return;i.preventDefault(),i.stopPropagation();const f=a.image.naturalW||a.image.width,_=a.image.naturalH||a.image.height,S=_>0?_/f:1;gn.value={nodeId:a.id,startX:i.clientX,startY:i.clientY,startW:a.image.width,startH:a.image.height,naturalW:f,naturalH:_,ratio:S,pendingW:a.image.width,pendingH:a.image.height},window.addEventListener("mousemove",qt),window.addEventListener("mouseup",yo)}function qt(i){var te,me;const a=gn.value;if(!a)return;const f=ne.scale.value||1,_=i.clientX-a.startX,S=F(a.startW+_/f,_n,Gn),D=F(S*a.ratio,_n,Gn);a.pendingW=S,a.pendingH=D;const v=(te=s.value)==null?void 0:te.querySelector(`[data-node-id="${a.nodeId}"] .zm-node-img`);v&&(v.style.width=`${S}px`,v.style.height=`${D}px`);const j=(me=s.value)==null?void 0:me.querySelector(`[data-node-id="${a.nodeId}"]`);j&&(j.style.minWidth=`${Math.max(80,Math.ceil(S+28))}px`,j.style.height=`${Math.ceil(D+8+30)}px`)}function yo(){const i=gn.value;if(window.removeEventListener("mousemove",qt),window.removeEventListener("mouseup",yo),gn.value=null,!i)return;const a=oe(m.value,i.nodeId);!a||!a.image||(ie(i.nodeId,{src:a.image.src,naturalW:a.image.naturalW,naturalH:a.image.naturalH,width:i.pendingW,height:i.pendingH}),d.value=new Set([i.nodeId]),ft(),Rn=!0)}const qn=e.ref(null);let Rn=!1;function Xn(i){qn.value=i}function hn(i){qn.value===i&&(qn.value=null),I.value&&(I.value=null)}function Zn(i,a){var wt;if(!a.text||a.text.length<14)return;const _=i.currentTarget.getBoundingClientRect(),S=(wt=s.value)==null?void 0:wt.getBoundingClientRect();if(!S)return;const D=10,v=240,j=_.top-S.top>60,te=_.left-S.left+_.width/2,me=D+v/2,Ve=S.width-v/2-D,T=Math.max(me,Math.min(te,Ve)),Ke=j?_.top-S.top-8:_.bottom-S.top+8;I.value={text:a.text,x:T,y:Ke,above:j}}const xt=e.ref(0),Jn=e.ref(!1),$t=Ja(100);function Me(){$t.record({data:m.value,selectedIds:[...d.value]})}function pe(){b.value=new Set(b.value),xt.value++,e.nextTick().then(()=>e.nextTick()).then(()=>lr()).then(()=>{xt.value++})}function lr(){const i=document.querySelectorAll(".zm-rich"),a={},f={};i.forEach(_=>{let S=_,D=null;for(;S&&!D;)D=S.getAttribute("data-node-id"),S=S.parentElement;if(!D)return;const v=_.offsetHeight,j=_.scrollWidth,te=Math.round(v*2)/2,me=Math.round(j*2)/2;a[D]=te,f[D]=me,B.value[D],x.value[D]}),B.value=a,x.value=f}const tt=e.computed(()=>{var i,a,f,_,S,D,v,j,te,me;return{rootBg:((i=r.theme)==null?void 0:i.rootBg)??"#1f2937",rootText:((a=r.theme)==null?void 0:a.rootText)??"#ffffff",branchBg:((f=r.theme)==null?void 0:f.branchBg)??"#ffffff",branchText:((_=r.theme)==null?void 0:_.branchText)??"#1f2937",lineColor:((S=r.theme)==null?void 0:S.lineColor)??"#94a3b8",bgColor:((D=r.theme)==null?void 0:D.bgColor)??"#f8fafc",fontSize:((v=r.theme)==null?void 0:v.fontSize)??14,lineWidthStart:((j=r.theme)==null?void 0:j.lineWidthStart)??2.2,lineWidthEnd:((te=r.theme)==null?void 0:te.lineWidthEnd)??.8,rainbowBranch:((me=r.theme)==null?void 0:me.rainbowBranch)??!1}}),Xt=e.computed(()=>R.canvasBg||tt.value.bgColor),R=e.reactive({autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:3.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"curve",layoutMode:"mindmap",taperedEdge:!0,showOrderBadge:!1,canvasBg:void 0});function h(i){return R.taperedEdge?W(i):we(i)}function O(i){return R.taperedEdge?R.lineWidthEnd:we(i)}function W(i){return i<=0?R.lineWidthStart:i===1?Math.max(1.5,R.lineWidthStart*.67):i===2?Math.max(.8,R.lineWidthStart*.42):R.lineWidthEnd}function we(i){if(i<=0)return R.lineWidthStart;if(i>=3)return R.lineWidthEnd;const a=i/3;return R.lineWidthStart+(R.lineWidthEnd-R.lineWidthStart)*a}function fe(i,a,f,_){const S=1-i,D=S*S*S*a.x+3*S*S*i*f.x1+3*S*i*i*f.x2+i*i*i*_.x,v=S*S*S*a.y+3*S*S*i*f.y1+3*S*i*i*f.y2+i*i*i*_.y;return{x:D,y:v}}function Ce(i,a,f,_,S=32,D="curve",v="right"){if(D==="curve"){let yt;if(v==="right"||v==="left"){const Ie=Math.abs(a.x-i.x)*.45,Wt=v==="right"?1:-1;yt={x1:i.x+Wt*Ie,y1:i.y,x2:a.x-Wt*Ie,y2:a.y}}else{const Ie=Math.abs(a.y-i.y)*.45;yt={x1:i.x,y1:i.y+Ie,x2:a.x,y2:a.y-Ie}}const Zt=ye=>{const Ie=1-ye,Wt=-3*Ie*Ie*i.x+3*(Ie*Ie-2*Ie*ye)*yt.x1+3*(2*Ie*ye-ye*ye)*yt.x2+3*ye*ye*a.x,an=-3*Ie*Ie*i.y+3*(Ie*Ie-2*Ie*ye)*yt.y1+3*(2*Ie*ye-ye*ye)*yt.y2+3*ye*ye*a.y;return{dx:Wt,dy:an}},Ft=[],bn=[];for(let ye=0;ye<=S;ye++){const Ie=ye/S,Wt=ye===0?i:ye===S?a:fe(Ie,i,yt,a),an=Zt(Ie);let no=Math.hypot(an.dx,an.dy);no<1e-6&&(no=1);const Nt=-an.dy/no,Ye=an.dx/no,qe=(f+(_-f)*Ie)/2;Ft.push({x:Wt.x+Nt*qe,y:Wt.y+Ye*qe}),bn.push({x:Wt.x-Nt*qe,y:Wt.y-Ye*qe})}let Ht=`M ${Ft[0].x.toFixed(2)} ${Ft[0].y.toFixed(2)}`;for(let ye=1;ye<=S;ye++)Ht+=` L ${Ft[ye].x.toFixed(2)} ${Ft[ye].y.toFixed(2)}`;for(let ye=S;ye>=0;ye--)Ht+=` L ${bn[ye].x.toFixed(2)} ${bn[ye].y.toFixed(2)}`;return Ht+=" Z",Ht}const j=a.x-i.x,te=a.y-i.y;let me=Math.hypot(j,te);me<1e-6&&(me=1);const Ve=-te/me,T=j/me,Ke=f/2,wt=_/2,de={x:i.x+Ve*Ke,y:i.y+T*Ke},mt={x:i.x-Ve*Ke,y:i.y-T*Ke},ln={x:a.x-Ve*wt,y:a.y-T*wt},lt={x:a.x+Ve*wt,y:a.y+T*wt};return`M ${de.x.toFixed(2)} ${de.y.toFixed(2)} L ${lt.x.toFixed(2)} ${lt.y.toFixed(2)} L ${ln.x.toFixed(2)} ${ln.y.toFixed(2)} L ${mt.x.toFixed(2)} ${mt.y.toFixed(2)} Z`}const Le=e.computed(()=>ut.value.root.children),bt=en[0].colors,kt=e.computed(()=>Da(R.branchPaletteId,R.customPalettes)),Pt=e.computed(()=>{const i=new Map;if(!R.rainbowBranch)return i;const a=r.lineColors,f=a&&a.length>0?a:kt.value.colors.length>0?kt.value.colors:bt;for(let S=0;S<Le.value.length;S++){const D=Le.value[S];i.set(D.id,f[S%f.length])}const _=(S,D)=>{i.set(S.id,D);for(const v of S.children)_(v,D)};for(let S=0;S<Le.value.length;S++){const D=Le.value[S];_(D,f[S%f.length])}return i});function He(i,a){return R.rainbowBranch?Pt.value.get(a.id)??tt.value.lineColor:tt.value.lineColor}function Eo(i){const a=Q(i.id);if(a.bg)return a.bg;if(i.isRoot)return tt.value.rootBg;if(R.rainbowBranch){const f=Pt.value.get(i.id);if(f)return vp(f,.18)}return tt.value.branchBg}function nn(i){const a=Q(i.id);if(a.textColor)return a.textColor;if(i.isRoot)return tt.value.rootText;if(R.rainbowBranch){const f=Pt.value.get(i.id);if(f)return Wl(f,.55)}return tt.value.branchText}function Qn(i){const a=Q(i.id);if(a.borderColor)return a.borderColor;if(i.isRoot)return tt.value.rootBg;if(R.rainbowBranch){const f=Pt.value.get(i.id);if(f)return Wl(f,.3)}return tt.value.lineColor}function Fl(i){const a=Q(i.id);return a.fontWeight?a.fontWeight:i.isRoot?700:i.depth<=1?600:i.depth===2?500:400}function Hl(i){return Q(i.id).fontSize??i.fontSize??tt.value.fontSize}function vp(i,a){const f=i.replace("#",""),_=f.length===6?f:f.split("").map(j=>j+j).join(""),S=parseInt(_.slice(0,2),16),D=parseInt(_.slice(2,4),16),v=parseInt(_.slice(4,6),16);return`rgba(${S}, ${D}, ${v}, ${a})`}function Wl(i,a){const f=i.replace("#",""),_=f.length===6?f:f.split("").map(j=>j+j).join(""),S=Math.round(parseInt(_.slice(0,2),16)*(1-a)),D=Math.round(parseInt(_.slice(2,4),16)*(1-a)),v=Math.round(parseInt(_.slice(4,6),16)*(1-a));return`rgb(${S}, ${D}, ${v})`}const ne=qa({getContainer:()=>s.value});ne.setOnMarqueeEnd(qp),Za({isEditing:()=>c.value!==null,isReadonly:()=>r.previewMode,getSelectedId:()=>g.value,getSelectedIds:()=>[...d.value],defaultTargetId:()=>m.value.id,onAddChild:to,onAddSibling:ar,onAddSiblingBefore:Pp,onRemove:ta,onStartEdit:xo,onClearSelection:()=>{d.value=new Set,ft()},onDuplicate:ql,onCopy:Jl,onCut:Ql,onPaste:ea,hasClipboard:()=>!!P.value&&P.value.nodes.length>0,onUndo:qr,onRedo:Xr,onNavigate:Up,onSelectRoot:()=>{d.value=new Set([m.value.id]),ft()}});const ut=e.computed(()=>{const i=_t(m.value);return Kl(i),Ia(i,{mode:R.layoutMode,baseFontSize:tt.value.fontSize,richHeights:B.value,richWidths:x.value})}),Gl=e.ref([]),eo=e.computed(()=>(xt.value,Gl.value));e.watch(ut,i=>{const a=[],f=_=>{a.push(_);for(const S of _.children)f(S)};f(i.root),Gl.value=a},{immediate:!0});const jl=e.computed(()=>{const i=[];for(const a of eo.value)for(const f of a.children)i.push({from:a,to:f,key:`${a.id}->${f.id}`});return i}),Rp=e.computed(()=>`${ut.value.vbX} ${ut.value.vbY} ${ut.value.vbW} ${ut.value.vbH}`);function Kl(i){if(b.value.has(i.id)){i.children=[],i.collapsed=!0;return}i.collapsed=!1;for(const a of i.children)Kl(a)}function xo(i){const a=oe(m.value,i);a&&(c.value=i,u.value=a.text,e.nextTick(()=>{const f=document.querySelector(".zm-input");f==null||f.focus(),f==null||f.select()}))}function Yr(){if(!c.value)return;const i=oe(m.value,c.value);i&&i.text!==(u.value.trim()||" ")&&(i.text=u.value.trim()||" ",Me(),l("change",m.value)),c.value=null}function Bp(){c.value=null}function Ip(i){if(r.previewMode)return;const a=oe(m.value,i);a!=null&&a.richContent&&(C.value=i,E.value=a.richContent.raw,e.nextTick(()=>{const f=document.querySelector(".zm-node .zm-rich textarea");f==null||f.focus()}))}function Yl(){if(!C.value)return;const i=C.value,a=oe(m.value,i),f=E.value;if(a&&a.richContent&&a.richContent.raw!==f)if(a.richContent.kind==="code"){const _=Nn(f)||void 0;xe(i,{kind:"code",raw:f,lang:_})}else xe(i,{kind:"table",raw:f});C.value=null}function zp(){C.value=null}function Op(i){i.key==="Escape"?(i.preventDefault(),zp()):i.key==="Enter"&&(i.ctrlKey||i.metaKey)&&(i.preventDefault(),Yl())}function Lp(i,a){const f=k.value.get(i);!f||f.col!==a?k.value.set(i,{col:a,dir:"asc"}):f.dir==="asc"?k.value.set(i,{col:a,dir:"desc"}):k.value.delete(i)}function Dp(i,a){const f=k.value.get(i);return!f||a.length<=1?a:il(a,f.col,f.dir)}function Vp(i,a){const f=k.value.get(i);return!f||f.col!==a?"↕":f.dir==="asc"?"▲":"▼"}function $p(i){const a=i.metaKey||i.ctrlKey;a&&(i.key==="z"||i.key==="Z")&&!i.shiftKey?(i.preventDefault(),qr()):(a&&i.shiftKey&&(i.key==="z"||i.key==="Z")||a&&(i.key==="y"||i.key==="Y")&&!i.shiftKey)&&(i.preventDefault(),Xr())}function to(i){const a=mi(m.value,i,Ro);a&&(Me(),pe(),l("change",m.value),e.nextTick(()=>xo(a.id)))}function ar(i){if(i===m.value.id){to(i);return}const a=pi(m.value,i,Ro);a&&(Me(),pe(),l("change",m.value),e.nextTick(()=>xo(a.id)))}function Pp(i){if(i===m.value.id){to(i);return}const a=Wa(m.value,i,Ro);a&&(Me(),pe(),l("change",m.value),e.nextTick(()=>xo(a.id)))}function ql(i){if(i===m.value.id)return;const a=Ga(m.value,i);a&&(Me(),d.value=new Set([a.id]),ft(),l("change",m.value),pe())}function Xl(i){const a=[],f=new Set;for(const _ of i)_!==m.value.id&&(f.has(_)||oe(m.value,_)&&(f.add(_),a.push(_)));return a}function Zl(i){const a=new Set(i),f=[],_=S=>{a.has(S.id)&&f.push(S.id);for(const D of S.children)_(D)};return _(m.value),f}function Jl(i){const a=Zl(Xl(i));if(a.length===0)return;const f=[];for(const _ of a){const S=gi(m.value,_);S&&f.push(S)}f.length!==0&&(P.value={nodes:f,originalIds:new Set(a)},pe())}function Ql(i){const a=Zl(Xl(i));if(a.length===0)return;const f=[];for(const _ of a){const S=gi(m.value,_);S&&f.push(S)}if(f.length!==0){Me();for(const _ of a)Mo(m.value,_);d.value=new Set,ft(),P.value={nodes:f,originalIds:new Set(a)},pe(),l("change",m.value)}}function ea(i){const a=P.value;if(!a||a.nodes.length===0)return;const f=i??m.value.id,_=oe(m.value,f);if(_){for(const S of a.originalIds){const D=oe(m.value,S);if(D&&oe(D,f))return}Me();for(const S of a.nodes){const D=_t(S);vo(D),_.children.push(D)}P.value=null,pe(),l("change",m.value)}}function qr(){const i=$t.undo();i&&(m.value=i.data,d.value=new Set(i.selectedIds??[]),ft(),pe(),l("change",m.value))}function Xr(){const i=$t.redo();i&&(m.value=i.data,d.value=new Set(i.selectedIds??[]),ft(),pe(),l("change",m.value))}function ft(){const i=[];for(const a of d.value){const f=oe(m.value,a);f&&i.push(f)}if(r.builtInDrawers&&!r.previewMode&&i.length>0){const a=i[0];!it.value&&da(a.id)&&(gt(),it.value=!0)}else r.builtInDrawers&&i.length===0&&(it.value=!1);l("select",i.length>0?i:null)}function Up(i,a){const f=g.value??m.value.id,_=oe(m.value,f);if(!_)return;let S=null;if(a===1){const D=Lt(m.value,_.id);if(D){const v=D.children.findIndex(j=>j.id===_.id);v>=0&&v<D.children.length-1&&(S=D.children[v+1].id)}}else if(a===-1){const D=Lt(m.value,_.id);if(D){const v=D.children.findIndex(j=>j.id===_.id);v>0&&(S=D.children[v-1].id)}}else if(i===1){const D=Lt(m.value,_.id);D&&(S=D.id)}else i===-1&&_.children.length>0&&(S=_.children[0].id);S&&(d.value=new Set([S]),ft())}function ta(i){if(i!==m.value.id&&Mo(m.value,i)){if(Me(),d.value.has(i)){const a=new Set(d.value);a.delete(i),d.value=a,ft()}pe(),l("change",m.value)}}function na(i){b.value.has(i)?b.value.delete(i):b.value.add(i),pe()}function oa(i){const a=[{n:m.value,depth:1}];for(;a.length;){const{n:f,depth:_}=a.pop();i(f,_);for(let S=f.children.length-1;S>=0;S--)a.push({n:f.children[S],depth:_+1})}}function Fp(){b.value=new Set,oa(i=>{i.children.length>0&&b.value.add(i.id)}),pe()}function ra(i){b.value=new Set,oa((a,f)=>{f>i&&a.children.length>0&&b.value.add(a.id)}),pe()}function Hp(){b.value=new Set,pe()}function ia(i,a){Fa(m.value,i,a)&&(Me(),pe(),l("change",m.value))}function Zr(i,a,f){return Ha(m.value,i,a,f)?(Me(),pe(),l("change",m.value),!0):!1}function Wp(i,a){if(i.stopPropagation(),i.shiftKey){const f=new Set(d.value);f.has(a.id)?f.delete(a.id):f.add(a.id),d.value=f}else d.value=new Set([a.id]);ft()}function Gp(i,a,f){let _=null;for(const S of eo.value){if(S.id===f)continue;const D=S.width/2,v=S.height/2;i>=S.x-D&&i<=S.x+D&&a>=S.y-v&&a<=S.y+v&&(_=S)}return _}let Ut=null;function jp(i,a){if(r.previewMode||a.isRoot||i.button!==0)return;const f=i.target;if(f!=null&&f.closest(".zm-img-resize-handle"))return;i.stopPropagation();const _=s.value.getBoundingClientRect(),S=a.x*ne.scale.value+ne.offsetX.value,D=a.y*ne.scale.value+ne.offsetY.value,v=i.clientX-_.left-S,j=i.clientY-_.top-D;Ut={srcId:a.id,srcText:a.text,pointerOffsetX:v,pointerOffsetY:j,startX:i.clientX,startY:i.clientY},window.addEventListener("pointermove",la),window.addEventListener("pointerup",sr),window.addEventListener("pointercancel",sr)}function la(i){if(Ut){const v=i.clientX-Ut.startX,j=i.clientY-Ut.startY;if(Math.abs(v)<=Pl&&Math.abs(j)<=Pl)return;N.value={srcId:Ut.srcId,srcText:Ut.srcText,pointerOffsetX:Ut.pointerOffsetX,pointerOffsetY:Ut.pointerOffsetY,currentTargetId:null},document.body.classList.add("is-dragging"),Ut=null}const a=N.value;if(!a)return;const f=s.value.getBoundingClientRect();$.value=i.clientX-f.left-a.pointerOffsetX,M.value=i.clientY-f.top-a.pointerOffsetY;const _=(i.clientX-f.left-ne.offsetX.value)/ne.scale.value,S=(i.clientY-f.top-ne.offsetY.value)/ne.scale.value,D=Gp(_,S,a.srcId);a.currentTargetId=(D==null?void 0:D.id)??null}function sr(i){if(window.removeEventListener("pointermove",la),window.removeEventListener("pointerup",sr),window.removeEventListener("pointercancel",sr),Ut){Ut=null;return}const a=N.value;a&&(a.currentTargetId&&(Zr(a.srcId,a.currentTargetId,"child"),d.value=new Set([a.srcId]),ft()),N.value=null,$.value=0,M.value=0,document.body.classList.remove("is-dragging"))}let cr=!1;function Kp(i){const a=i.target;if(!a||a.closest(".zm-node, .zm-toolbar, button, input, textarea"))return;if(i.button===2){cr=!0,ne.startPan(i);return}if(cr=!1,i.button!==0)return;const f=s.value.getBoundingClientRect(),_=(i.clientX-f.left-ne.offsetX.value)/ne.scale.value,S=(i.clientY-f.top-ne.offsetY.value)/ne.scale.value;ne.startMarquee(_,S,{shift:i.shiftKey})}function Yp(i){if(Rn){Rn=!1;return}const a=i.target;if(!a||a.closest(".zm-node"))return;const f=ne.marquee;f.width>=4||f.height>=4||d.value.size>0&&(d.value=new Set,ft())}function qp(){const i=ne.marquee;if(i.width<4&&i.height<4)return;const a=i.x,f=i.y,_=i.x+i.width,S=i.y+i.height,D=[];for(const v of eo.value){const j=v.width/2,te=v.height/2,me=v.x-j,Ve=v.x+j,T=v.y-te,Ke=v.y+te;me<=_&&Ve>=a&&T<=S&&Ke>=f&&D.push(v.id)}d.value=i.shiftKey?new Set([...d.value,...D]):new Set(D),ft()}function aa(i){return b.value.has(i)}function Xp(i){const a=oe(m.value,i.id);return!!a&&a.children.length>0}function Jr(i){const a=oe(m.value,i);return a?a.children.length:0}function sa(i){if(!oe(m.value,i))return 0;const _=[m.value];for(;_.length;){const S=_.pop(),D=S.children.findIndex(v=>v.id===i);if(D>=0)return D;for(const v of S.children)_.push(v)}return 0}function dr(i,a,f,_){if(((_==null?void 0:_._dir)??i._dir)==="down")return a==="out"?{x:i.x,y:i.y+i.height/2}:{x:i.x,y:i.y-i.height/2};let D;a==="in"?D=-i.side:f!==void 0?D=f:D=i.side;const v=a==="in"?i._richInsetX??0:0;return{x:i.x+D*(i.width/2-v),y:i.y}}function on(){const i=ut.value;ne.resetView(i.width,i.height,i.root.y)}function Zp(){Jn.value=!0,Me(),pe(),e.nextTick(()=>on())}function Qr(i){R.layoutMode!==i&&(R.layoutMode=i,pe(),e.nextTick(()=>on()))}function ca(){return JSON.stringify(m.value,null,2)}function da(i){const a=oe(m.value,i);return a?!!(a.note&&a.note.text||a.link&&a.link.url||a.image&&a.image.src||a.richContent&&a.richContent.raw||a.markers&&a.markers.length>0||a.tags&&a.tags.length>0):!1}function ua(i){try{const a=JSON.parse(i);return!a.id||!Array.isArray(a.children)?!1:($t.reset(),m.value=_t(a),d.value=new Set,b.value=new Set,pe(),e.nextTick(()=>on()),l("change",m.value),!0)}catch{return!1}}function Jp(){const i=document.createElement("input");i.type="file",i.accept="application/json",i.onchange=()=>{var _;const a=(_=i.files)==null?void 0:_[0];if(!a)return;const f=new FileReader;f.onload=()=>{typeof f.result=="string"&&(ua(f.result)||alert("导入失败:JSON 格式无效"))},f.readAsText(a)},i.click()}function Qp(){const i=new Blob([ca()],{type:"application/json"}),a=URL.createObjectURL(i),f=document.createElement("a");f.href=a,f.download=`${m.value.text||"mindmap"}.json`,f.click(),URL.revokeObjectURL(a)}const fa=e.ref(""),rn=e.ref([]),wo=e.ref(-1);function eg(i){fa.value=i;const a=i.trim();if(!a){rn.value=[],wo.value=-1;return}const f=a.toLowerCase(),_=[],S=D=>{var v;(D.text.toLowerCase().includes(f)||(v=D.note)!=null&&v.text&&D.note.text.toLowerCase().includes(f))&&_.push(D.id);for(const j of D.children)S(j)};S(m.value),rn.value=_,wo.value=_.length>0?0:-1,_.length>0&&(rg(_),e.nextTick(()=>ig(0)))}function tg(i){return rn.value.includes(i)}function ng(i){return wo.value>=0&&rn.value[wo.value]===i}function og(i){return fa.value.trim().length>0&&rn.value.length>0&&!rn.value.includes(i)}function rg(i){if(i.length===0)return;const a=new Set(i),f=new Set,_=S=>{let D=a.has(S.id);for(const v of S.children)_(v)&&(D=!0);return D&&S.children.length>0&&b.value.has(S.id)&&f.add(S.id),D};if(_(m.value),f.size>0){for(const S of f)b.value.delete(S);pe()}}function ig(i){const a=rn.value[i];if(!a)return;const f=eo.value.find(_=>_.id===a);f&&(d.value=new Set([a]),ft(),ne.centerOn(f.x,f.y,f.width,f.height))}function lg(i,a){const f=oe(m.value,i);f&&(f.markers||(f.markers=[]),!f.markers.includes(a)&&(f.markers.push(a),Me(),pe(),l("change",m.value)))}function ag(i,a){const f=oe(m.value,i);if(!f||!f.markers)return;const _=f.markers.indexOf(a);_<0||(f.markers.splice(_,1),f.markers.length===0&&delete f.markers,Me(),pe(),l("change",m.value))}function ma(i,a){const f=oe(m.value,i);if(!f)return!1;f.markers||(f.markers=[]);const _=f.markers.indexOf(a);return _>=0?(f.markers.splice(_,1),f.markers.length===0&&delete f.markers,Me(),pe(),l("change",m.value),!1):(f.markers.push(a),Me(),pe(),l("change",m.value),!0)}function sg(i){const a=oe(m.value,i);return a!=null&&a.markers?[...a.markers]:[]}function cg(i){var f;const a=(f=y.value)==null?void 0:f.nodeId;a&&ma(a,i)}function dg(){var f;const i=(f=y.value)==null?void 0:f.nodeId;if(!i)return;const a=oe(m.value,i);!a||!a.markers||(delete a.markers,Me(),pe(),l("change",m.value),se())}function ei(i,a){const f=oe(m.value,i);f&&(a.length===0?f.tags&&delete f.tags:f.tags=[...a],Me(),pe(),l("change",m.value))}function ug(i){const a=oe(m.value,i);return a!=null&&a.tags?[...a.tags]:[]}function fg(){var D,v;const i=(D=y.value)==null?void 0:D.nodeId;if(!i)return;const a=oe(m.value,i),f=((v=a==null?void 0:a.tags)==null?void 0:v.join(", "))??"",_=window.prompt("输入标签(多个用逗号分隔)",f);if(_===null)return;const S=_.split(/[,,]/).map(j=>j.trim()).filter(j=>j.length>0);ei(i,S),se()}function mg(){var a;const i=(a=y.value)==null?void 0:a.nodeId;i&&(ei(i,[]),se())}function pa(){const i=ut.value,a="http://www.w3.org/2000/svg",f=document.createElementNS(a,"svg");f.setAttribute("xmlns",a),f.setAttribute("viewBox",`${i.vbX} ${i.vbY} ${i.vbW} ${i.vbH}`),f.setAttribute("width",String(i.vbW)),f.setAttribute("height",String(i.vbH));const _=document.createElementNS(a,"rect");_.setAttribute("x",String(i.vbX)),_.setAttribute("y",String(i.vbY)),_.setAttribute("width",String(i.vbW)),_.setAttribute("height",String(i.vbH)),_.setAttribute("fill",Xt.value),f.appendChild(_);for(const v of jl.value){const j=document.createElementNS(a,"path");j.setAttribute("d",Ce(dr(v.from,"out",v.to.side,v.to),dr(v.to,"in"),h(v.from.depth),O(v.to.depth),32,R.lineStyle,v.to._dir)),j.setAttribute("fill",He(v.from,v.to)),j.setAttribute("stroke","none"),f.appendChild(j)}const S="-apple-system,BlinkMacSystemFont,'Segoe UI','PingFang SC','Microsoft YaHei',sans-serif";function D(v,j){let te=0;for(const me of v)/[\u4e00-\u9fff\u3000-\u30ff\uff00-\uffef]/.test(me)?te+=j:te+=j*.55;return te}for(const v of eo.value){const j=v.x-v.width/2,te=v.y-v.height/2,me=document.createElementNS(a,"rect");me.setAttribute("x",String(j)),me.setAttribute("y",String(te)),me.setAttribute("width",String(v.width)),me.setAttribute("height",String(v.height)),me.setAttribute("rx","8"),me.setAttribute("fill",Eo(v)),me.setAttribute("stroke",Qn(v)),me.setAttribute("stroke-width","1"),f.appendChild(me);const Ve=!!(v.tags&&v.tags.length>0),T=!!(v.markers&&v.markers.length>0),Ke=!!v.image,wt=!!(v.richContent&&(v.richContent.kind==="code"||v.richContent.kind==="table"));let de=0,mt=0;if(wt){const Ye=v.richContent,qe=v.fontSize*.78*.92,Jt=6,De=4,kn=2,yn=6;if(Ye.kind==="code"){const St=Wo(Ye.raw),pt=Nn(Ye.raw),Tt=St.split(`
133
+ `),Qt=qe*1.35;let zt=0;for(const Be of Tt)zt=Math.max(zt,D(Be,qe));mt=Math.min(zt+Jt*2+4,v.width-4),de=Tt.length*Qt+De*2+kn;const Xe=v.x-mt/2;let at=te+4;Ke&&(at=te+v.image.height+yn);const Ct=document.createElementNS(a,"rect");if(Ct.setAttribute("x",String(Xe)),Ct.setAttribute("y",String(at)),Ct.setAttribute("width",String(mt)),Ct.setAttribute("height",String(de-kn)),Ct.setAttribute("rx","6"),Ct.setAttribute("fill","rgba(255,255,255,0.55)"),Ct.setAttribute("stroke",Qn(v)),Ct.setAttribute("stroke-width","1"),f.appendChild(Ct),pt){const Be=document.createElementNS(a,"text");Be.setAttribute("x",String(Xe+mt-Jt)),Be.setAttribute("y",String(at+De+4)),Be.setAttribute("text-anchor","end"),Be.setAttribute("fill",nn(v)),Be.setAttribute("font-size",String(qe*.8)),Be.setAttribute("font-family",S),Be.setAttribute("opacity","0.5"),Be.textContent=pt,f.appendChild(Be)}const So="'JetBrains Mono','Fira Code',Consolas,monospace";for(let Be=0;Be<Tt.length;Be++){const nt=document.createElementNS(a,"text");nt.setAttribute("x",String(Xe+Jt)),nt.setAttribute("y",String(at+De+(Be+.5)*Qt+2)),nt.setAttribute("dominant-baseline","central"),nt.setAttribute("fill",nn(v)),nt.setAttribute("font-size",String(qe)),nt.setAttribute("font-family",So);let Ot=Tt[Be];const Ue=Math.floor((mt-Jt*2)/(qe*.6));Ot.length>Ue&&(Ot=Ot.substring(0,Ue-1)+"…"),nt.textContent=Ot,f.appendChild(nt)}}else if(Ye.kind==="table"){const St=Cr(Ye.raw);if(St.length>0){const pt=qe*1.35,Tt=6,Qt=3,zt=St[0].length,Xe=[];for(let Ue=0;Ue<zt;Ue++){let sn=0;for(const En of St)Ue<En.length&&(sn=Math.max(sn,D(En[Ue],qe)));Xe.push(sn+Tt*2)}mt=Math.min(Xe.reduce((Ue,sn)=>Ue+sn,0),v.width-4);const at=mt/Xe.reduce((Ue,sn)=>Ue+sn,0);for(let Ue=0;Ue<zt;Ue++)Xe[Ue]*=at;de=St.length*(pt+Qt*2)+kn;const Ct=v.x-mt/2;let So=te+4;Ke&&(So=te+v.image.height+yn);const Be=document.createElementNS(a,"rect");Be.setAttribute("x",String(Ct)),Be.setAttribute("y",String(So)),Be.setAttribute("width",String(mt)),Be.setAttribute("height",String(de-kn)),Be.setAttribute("rx","6"),Be.setAttribute("fill","rgba(255,255,255,0.55)"),Be.setAttribute("stroke",Qn(v)),Be.setAttribute("stroke-width","1"),f.appendChild(Be);let nt=Ct,Ot=So;for(let Ue=0;Ue<St.length;Ue++){const sn=St[Ue],En=pt+Qt*2;nt=Ct;for(let To=0;To<zt;To++){const oo=Xe[To],pg=sn[To]||"";if(To<zt-1){const Fe=document.createElementNS(a,"line");Fe.setAttribute("x1",String(nt+oo)),Fe.setAttribute("y1",String(Ot)),Fe.setAttribute("x2",String(nt+oo)),Fe.setAttribute("y2",String(Ot+En)),Fe.setAttribute("stroke",Qn(v)),Fe.setAttribute("stroke-width","1"),f.appendChild(Fe)}if(Ue<St.length-1){const Fe=document.createElementNS(a,"line");Fe.setAttribute("x1",String(nt)),Fe.setAttribute("y1",String(Ot+En)),Fe.setAttribute("x2",String(nt+oo)),Fe.setAttribute("y2",String(Ot+En)),Fe.setAttribute("stroke",Qn(v)),Fe.setAttribute("stroke-width","1"),f.appendChild(Fe)}if(Ue===0){const Fe=document.createElementNS(a,"rect");Fe.setAttribute("x",String(nt)),Fe.setAttribute("y",String(Ot)),Fe.setAttribute("width",String(oo)),Fe.setAttribute("height",String(En)),Fe.setAttribute("fill","rgba(255,255,255,0.4)"),f.appendChild(Fe)}const cn=document.createElementNS(a,"text");cn.setAttribute("x",String(nt+Tt)),cn.setAttribute("y",String(Ot+Qt+pt/2+2)),cn.setAttribute("dominant-baseline","central"),cn.setAttribute("fill",nn(v)),cn.setAttribute("font-size",String(qe)),cn.setAttribute("font-family",S),Ue===0&&cn.setAttribute("font-weight","600");let ur=pg;const ti=Math.floor((oo-Tt*2)/(qe*.55));ur.length>ti&&ti>2&&(ur=ur.substring(0,ti-1)+"…"),cn.textContent=ur,f.appendChild(cn),nt+=oo}Ot+=En}}}}let ln=0;if(Ke){const Ye=v.image,qe=te+4,Jt=v.x-Ye.width/2,De=document.createElementNS(a,"image");De.setAttribute("x",String(Jt)),De.setAttribute("y",String(qe)),De.setAttribute("width",String(Ye.width)),De.setAttribute("height",String(Ye.height)),De.setAttribute("href",Ye.src),De.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",Ye.src),De.setAttribute("preserveAspectRatio","xMidYMid meet"),f.appendChild(De),ln=Ye.height+6}let lt=v.y;const yt=ln+de;yt>0?lt=te+yt+(v.height-yt)/2:Ve&&(lt=v.y-8);const Zt=14,Ft=2,bn=4,Ht=T?v.markers.length:0,ye=Ht>0?Ht*Zt+(Ht-1)*Ft+bn:0,Ie=D(v.text,v.fontSize),Wt=ye+Ie,an=v.x-Wt/2;if(T){let Ye=an;for(const qe of v.markers){const Jt=Io(qe);if(Jt){const De=document.createElementNS(a,"svg");De.setAttribute("x",String(Ye)),De.setAttribute("y",String(lt-Zt/2)),De.setAttribute("width",String(Zt)),De.setAttribute("height",String(Zt)),De.setAttribute("viewBox","0 0 24 24"),De.setAttribute("color",nn(v));const yn=new DOMParser().parseFromString(`<svg xmlns="${a}">${Jt}</svg>`,"image/svg+xml");if(!yn.querySelector("parsererror"))for(;yn.documentElement.firstChild;)De.appendChild(yn.documentElement.firstChild);f.appendChild(De)}Ye+=Zt+Ft}}const no=T?an+ye+Ie/2:v.x,Nt=document.createElementNS(a,"text");if(Nt.setAttribute("x",String(no)),Nt.setAttribute("y",String(lt)),Nt.setAttribute("text-anchor","middle"),Nt.setAttribute("dominant-baseline","central"),Nt.setAttribute("fill",nn(v)),Nt.setAttribute("font-size",String(Hl(v))),Nt.setAttribute("font-weight",String(Fl(v))),Nt.setAttribute("font-family",S),Nt.textContent=v.text,f.appendChild(Nt),Ve){const De=v.y+10,kn=v.tags.map(pt=>D(pt,10)+12),yn=kn.reduce((pt,Tt)=>pt+Tt+3,-3);let St=v.x-yn/2;for(let pt=0;pt<v.tags.length;pt++){const Tt=v.tags[pt],Qt=gr(Tt),zt=kn[pt],Xe=document.createElementNS(a,"rect");Xe.setAttribute("x",String(St)),Xe.setAttribute("y",String(De-16/2)),Xe.setAttribute("width",String(zt)),Xe.setAttribute("height",String(16)),Xe.setAttribute("rx",String(16/2)),Xe.setAttribute("fill",Qt.background),Xe.setAttribute("stroke",Qt.borderColor),Xe.setAttribute("stroke-width","1"),f.appendChild(Xe);const at=document.createElementNS(a,"text");at.setAttribute("x",String(St+zt/2)),at.setAttribute("y",String(De)),at.setAttribute("text-anchor","middle"),at.setAttribute("dominant-baseline","central"),at.setAttribute("fill",Qt.color),at.setAttribute("font-size",String(10)),at.setAttribute("font-family",S),at.textContent=Tt,f.appendChild(at),St+=zt+3}}}return f}function No(){const i=pa();let f=new XMLSerializer().serializeToString(i);f.startsWith("<?xml")||(f=`<?xml version="1.0" encoding="UTF-8"?>
134
+ `+f);const _=new Blob([f],{type:"image/svg+xml;charset=utf-8"}),S=URL.createObjectURL(_),D=document.createElement("a");D.href=S,D.download=`${m.value.text||"mindmap"}.svg`,D.click(),URL.revokeObjectURL(S)}function ga(i=2){const a=pa(),f=ut.value;let S=new XMLSerializer().serializeToString(a);S.startsWith("<?xml")||(S=`<?xml version="1.0" encoding="UTF-8"?>
135
+ `+S);const D=new Blob([S],{type:"image/svg+xml;charset=utf-8"}),v=URL.createObjectURL(D),j=new window.Image;j.onload=()=>{const te=document.createElement("canvas");te.width=Math.ceil(f.vbW*i),te.height=Math.ceil(f.vbH*i);const me=te.getContext("2d");if(!me){URL.revokeObjectURL(v);return}me.fillStyle=Xt.value,me.fillRect(0,0,te.width,te.height),me.drawImage(j,0,0,te.width,te.height),URL.revokeObjectURL(v);try{te.toBlob(Ve=>{if(!Ve){No();return}const T=URL.createObjectURL(Ve),Ke=document.createElement("a");Ke.href=T,Ke.download=`${m.value.text||"mindmap"}.png`,Ke.click(),URL.revokeObjectURL(T)},"image/png")}catch(Ve){console.warn("PNG export failed, falling back to SVG:",Ve),No()}},j.onerror=()=>{URL.revokeObjectURL(v),No()},j.src=v}return o({addChild:i=>to(i),addSibling:i=>ar(i),removeNode:i=>ta(i),duplicateNode:i=>ql(i),setNodeText:(i,a)=>ia(i,a),moveNode:(i,a,f)=>Zr(i,a,f),lineWidthForDepth:h,endWidthForDepth:O,getData:()=>m.value,nodeHasContent:i=>da(i),getSelectedIds:()=>[...d.value],copyNodes:i=>Jl(i),cutNodes:i=>Ql(i),pasteNodes:i=>ea(i),setData:i=>{$t.reset(),m.value=_t(i),d.value=new Set,b.value=new Set,pe(),Me(),e.nextTick(()=>on())},resetView:()=>on(),exportData:ca,importData:ua,getMarkdown:()=>On(m.value),setMarkdown:(i,a=!0)=>{const f=zn(i||"");a&&(K.value=!0),Y=!a,$t.reset(),m.value=_t(f),d.value=new Set,b.value=new Set,pe(),Me(),e.nextTick(()=>{Y=!1,on()}),l("change",m.value)},setBalanced:i=>{Jn.value=i},isBalanced:()=>Jn.value,balance:()=>Zp(),applyNodeStyle:(i,a)=>q(i,a),getNodeStyle:i=>Q(i),applyNodeImage:(i,a)=>ie(i,a),applyNodeImageByUrl:(i,a)=>A(i,a),removeNodeImage:i=>z(i),applyNodeLink:(i,a)=>le(i,a),removeNodeLink:i=>Ne(i),applyNodeNote:(i,a)=>_e(i,a),removeNodeNote:i=>Re(i),applyNodeRichContent:(i,a)=>xe(i,a),addNodeMarker:(i,a)=>lg(i,a),removeNodeMarker:(i,a)=>ag(i,a),toggleNodeMarker:(i,a)=>ma(i,a),getNodeMarkers:i=>sg(i),setNodeTags:(i,a)=>ei(i,a),getNodeTags:i=>ug(i),exportPNG:i=>ga(i),exportSVG:()=>No(),searchNodes:i=>(eg(i),[...rn.value]),undo:()=>qr(),redo:()=>Xr(),canUndo:()=>$t.canUndo(),canRedo:()=>$t.canRedo(),applySettings:i=>{i.autoBalanceOnChange!==void 0&&(R.autoBalanceOnChange=i.autoBalanceOnChange),i.lineWidthStart!==void 0&&(R.lineWidthStart=Math.max(.5,Math.min(20,i.lineWidthStart))),i.lineWidthEnd!==void 0&&(R.lineWidthEnd=Math.max(.3,Math.min(10,i.lineWidthEnd))),i.rainbowBranch!==void 0&&(R.rainbowBranch=i.rainbowBranch),i.branchPaletteId!==void 0&&(R.branchPaletteId=i.branchPaletteId),i.customPalettes!==void 0&&(R.customPalettes=i.customPalettes),i.lineStyle!==void 0&&(R.lineStyle=i.lineStyle),i.taperedEdge!==void 0&&(R.taperedEdge=i.taperedEdge),i.showOrderBadge!==void 0&&(R.showOrderBadge=i.showOrderBadge),i.canvasBg!==void 0&&(R.canvasBg=i.canvasBg)},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,canvasBg:R.canvasBg}),setBranchPalette:i=>{if(!i)return;[...en,...R.customPalettes].find(f=>f.id===i)&&(R.branchPaletteId=i)},getBranchPalette:()=>R.branchPaletteId,getBranchPalettes:()=>[...en,...R.customPalettes],getSearchResults:()=>[...rn.value],getSearchIndex:()=>wo.value}),e.watch(()=>r.data,i=>{m.value=_t(i),pe()},{deep:!1}),e.onMounted(()=>{Me(),e.nextTick(()=>on())}),(i,a)=>{var f,_,S,D,v,j,te,me,Ve;return e.openBlock(),e.createElementBlock("div",{class:"zm-mindmap",style:e.normalizeStyle({background:Xt.value,fontSize:tt.value.fontSize+"px"})},[e.createElementVNode("div",{ref_key:"wrapperRef",ref:s,class:"zm-canvas",onMousedown:Kp,onContextmenu:ge,onWheel:a[25]||(a[25]=(...T)=>e.unref(ne).onWheel&&e.unref(ne).onWheel(...T)),onMouseenter:a[26]||(a[26]=T=>w.value=!0),onMouseleave:a[27]||(a[27]=T=>w.value=!1),onClick:Yp},[e.createElementVNode("div",{class:"zm-svg-layer",style:e.normalizeStyle({left:ut.value.vbX*e.unref(ne).scale.value+e.unref(ne).offsetX.value+"px",top:ut.value.vbY*e.unref(ne).scale.value+e.unref(ne).offsetY.value+"px",width:ut.value.vbW*e.unref(ne).scale.value+"px",height:ut.value.vbH*e.unref(ne).scale.value+"px"})},[(e.openBlock(),e.createElementBlock("svg",{class:"zm-svg",viewBox:Rp.value,preserveAspectRatio:"xMinYMin meet",width:ut.value.vbW*e.unref(ne).scale.value,height:ut.value.vbH*e.unref(ne).scale.value},[e.createElementVNode("g",Qm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(jl.value,T=>(e.openBlock(),e.createElementBlock("path",{key:T.key,d:Ce(dr(T.from,"out",T.to.side,T.to),dr(T.to,"in"),h(T.from.depth),O(T.to.depth),32,R.lineStyle,T.to._dir),fill:He(T.from,T.to),stroke:"none"},null,8,ep))),128))])],8,Jm))],4),e.unref(ne).isMarquee.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-marquee",style:e.normalizeStyle({left:e.unref(ne).marquee.x*e.unref(ne).scale.value+e.unref(ne).offsetX.value+"px",top:e.unref(ne).marquee.y*e.unref(ne).scale.value+e.unref(ne).offsetY.value+"px",width:e.unref(ne).marquee.width*e.unref(ne).scale.value+"px",height:e.unref(ne).marquee.height*e.unref(ne).scale.value+"px"})},null,4)):e.createCommentVNode("",!0),N.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"zm-drag-ghost",style:e.normalizeStyle({left:$.value+"px",top:M.value+"px",transform:`scale(${e.unref(ne).scale.value})`,transformOrigin:"top left"})},e.toDisplayString(N.value.srcText),5)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"zm-world",style:e.normalizeStyle({transform:`translate(${e.unref(ne).offsetX.value}px, ${e.unref(ne).offsetY.value}px) scale(${e.unref(ne).scale.value})`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(eo.value,T=>{var Ke,wt;return e.openBlock(),e.createElementBlock("div",{key:T.id,class:e.normalizeClass(["zm-node",{"is-root":T.isRoot,"is-selected":g.value===T.id,"is-selected-secondary":g.value!==T.id&&d.value.has(T.id),"is-editing":c.value===T.id,"has-image":!!T.image,"is-resizing":Kr.value===T.id,"is-dragging-source":((Ke=N.value)==null?void 0:Ke.srcId)===T.id,"is-drop-target":((wt=N.value)==null?void 0:wt.currentTargetId)===T.id,"is-search-hit":tg(T.id),"is-search-current":ng(T.id),"is-search-dimmed":og(T.id)}]),"data-node-id":T.id,style:e.normalizeStyle({left:T.x+"px",top:T.y+"px",width:T.width+"px",minWidth:T.width+"px",height:T.height+"px",fontSize:Hl(T)+"px",background:Eo(T),color:nn(T),borderColor:Qn(T),fontWeight:Fl(T),transform:"translate(-50%, -50%)"}),onClick:de=>Wp(de,T),onPointerdown:de=>jp(de,T),onDblclick:de=>{de.stopPropagation(),t.previewMode||xo(T.id)},onContextmenu:de=>X(de,T),onMouseenter:de=>{Xn(T.id),Zn(de,T)},onMouseleave:de=>hn(T.id)},[T.image?(e.openBlock(),e.createElementBlock("img",{key:0,class:"zm-node-img",src:T.image.src,width:T.image.width,height:T.image.height,alt:T.text,draggable:"false"},null,8,np)):e.createCommentVNode("",!0),T.richContent&&(T.richContent.kind==="code"||T.richContent.kind==="table")&&c.value!==T.id?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["zm-rich zm-rich-above",{"zm-rich-no-overflow":T.richContent.kind==="table"||T.richContent.kind==="code"}]),onClick:a[1]||(a[1]=e.withModifiers(()=>{},["stop"])),onDblclick:e.withModifiers(de=>Ip(T.id),["stop"]),onMousedown:a[2]||(a[2]=e.withModifiers(()=>{},["stop"]))},[C.value===T.id?e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:0,"onUpdate:modelValue":a[0]||(a[0]=de=>E.value=de),class:"zm-rich-edit",spellcheck:"false",onBlur:Yl,onKeydown:Op},null,544)),[[e.vModelText,E.value]]):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[T.richContent.kind==="code"?(e.openBlock(),e.createElementBlock("pre",rp,[e.createElementVNode("code",{innerHTML:e.unref(Tr)(e.unref(Wo)(T.richContent.raw),e.unref(Nn)(T.richContent.raw))},null,8,ip)])):T.richContent.kind==="table"?(e.openBlock(),e.createElementBlock("table",lp,[e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Dp(T.id,e.unref(Cr)(T.richContent.raw)),(de,mt)=>(e.openBlock(),e.createElementBlock("tr",{key:mt},[mt===0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(de,(ln,lt)=>{var yt,Zt,Ft,bn,Ht;return e.openBlock(),e.createElementBlock("th",{key:`h${lt}`,class:e.normalizeClass(["zm-rich-table-sort",{"is-sorted":((yt=k.value.get(T.id))==null?void 0:yt.col)===lt,"is-asc":((Zt=k.value.get(T.id))==null?void 0:Zt.col)===lt&&((Ft=k.value.get(T.id))==null?void 0:Ft.dir)==="asc","is-desc":((bn=k.value.get(T.id))==null?void 0:bn.col)===lt&&((Ht=k.value.get(T.id))==null?void 0:Ht.dir)==="desc"}]),onClick:e.withModifiers(ye=>Lp(T.id,lt),["stop"])},[e.createElementVNode("span",null,e.toDisplayString(ln),1),e.createElementVNode("span",sp,e.toDisplayString(Vp(T.id,lt)),1)],10,ap)}),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(de,(ln,lt)=>(e.openBlock(),e.createElementBlock("td",{key:`c${lt}`},e.toDisplayString(ln),1))),128))]))),128))])])):e.createCommentVNode("",!0)],64))],42,op)):e.createCommentVNode("",!0),c.value!==T.id?(e.openBlock(),e.createElementBlock("span",cp,[T.markers&&T.markers.length>0?(e.openBlock(),e.createElementBlock("span",dp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.markers,de=>(e.openBlock(),e.createElementBlock("span",{key:de,class:"zm-node-marker",title:e.unref(bi)(de),innerHTML:'<svg viewBox="0 0 24 24" width="14" height="14">'+e.unref(Io)(de)+"</svg>"},null,8,up))),128))])):e.createCommentVNode("",!0),e.createElementVNode("span",fp,e.toDisplayString(T.text),1),T.link&&!c.value?(e.openBlock(),e.createElementBlock("a",{key:1,class:"zm-node-link",href:T.link.url,target:"_blank",rel:"noopener noreferrer",title:`打开链接:${T.link.url}`,onClick:a[3]||(a[3]=e.withModifiers(()=>{},["stop"])),onMousedown:a[4]||(a[4]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(be,{name:"link",size:11,stroke:2})],40,mp)):e.createCommentVNode("",!0),T.note&&!c.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-node-note-btn",type:"button",title:ir(T.note.text),onClick:e.withModifiers(de=>rr(T.id),["stop"]),onMousedown:a[5]||(a[5]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(be,{name:"note",size:11,stroke:2})],40,pp)):e.createCommentVNode("",!0)])):e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:3,class:"zm-input","onUpdate:modelValue":a[6]||(a[6]=de=>u.value=de),autofocus:"",onBlur:a[7]||(a[7]=de=>Yr()),onKeydown:[a[8]||(a[8]=e.withKeys(e.withModifiers(de=>Yr(),["exact"]),["enter"])),a[9]||(a[9]=e.withKeys(e.withModifiers(de=>Yr(),["prevent"]),["tab"])),e.withKeys(Bp,["esc"]),$p],onMousedown:a[10]||(a[10]=e.withModifiers(()=>{},["stop"])),onClick:a[11]||(a[11]=e.withModifiers(()=>{},["stop"]))},null,544)),[[e.vModelText,u.value]]),T.tags&&T.tags.length>0&&c.value!==T.id?(e.openBlock(),e.createElementBlock("div",gp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.tags,de=>(e.openBlock(),e.createElementBlock("span",{key:de,class:"zm-node-tag",style:e.normalizeStyle(e.unref(gr)(de))},e.toDisplayString(de),5))),128))])):e.createCommentVNode("",!0),ee.value?(e.openBlock(),e.createElementBlock("span",{key:5,class:"zm-order-badge",title:`数据顺序:第 ${sa(T.id)+1} 个`},e.toDisplayString(sa(T.id)+1),9,hp)):e.createCommentVNode("",!0),aa(T.id)&&Jr(T.id)>0?(e.openBlock(),e.createElementBlock("span",{key:6,class:e.normalizeClass(["zm-collapse-badge",{"is-on-left":T.side===-1}]),style:e.normalizeStyle({background:Pt.value.get(T.id)??"#64748b"}),title:`展开 ${Jr(T.id)} 个子节点`,onMousedown:a[12]||(a[12]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(de=>na(T.id),["stop"])},e.toDisplayString(Jr(T.id)),47,bp)):e.createCommentVNode("",!0),Xp(T)&&!aa(T.id)?(e.openBlock(),e.createElementBlock("button",{key:7,class:e.normalizeClass(["zm-btn zm-collapse",{"is-on-left":T.side===-1}]),style:e.normalizeStyle({color:Pt.value.get(T.id)??"#64748b",borderColor:Pt.value.get(T.id)??"#64748b"}),title:"折叠",onMousedown:a[13]||(a[13]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(de=>na(T.id),["stop"])},[e.createVNode(be,{name:"minus",size:10,stroke:2.4})],46,kp)):e.createCommentVNode("",!0),T.image&&g.value===T.id&&c.value!==T.id?(e.openBlock(),e.createElementBlock("span",{key:8,class:"zm-img-resize-handle",title:"拖动调整图片大小",onMousedown:e.withModifiers(de=>Et(de,T),["stop"])},null,40,yp)):e.createCommentVNode("",!0),T.image&&g.value===T.id&&c.value!==T.id?(e.openBlock(),e.createElementBlock("button",{key:9,class:"zm-img-remove-btn",title:"移除图片",onMousedown:a[14]||(a[14]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(de=>z(T.id),["stop"])},[e.createVNode(be,{name:"x",size:9,stroke:2.2})],40,Ep)):e.createCommentVNode("",!0)],46,tp)}),128))],4),I.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["zm-tooltip",{"is-below":!I.value.above}]),style:e.normalizeStyle({left:I.value.x+"px",top:I.value.y+"px"})},e.toDisplayString(I.value.text),7)):e.createCommentVNode("",!0),y.value?(e.openBlock(),e.createBlock(cs,{key:3,x:y.value.x,y:y.value.y,container:s.value,"has-image":!!((f=e.unref(oe)(m.value,y.value.nodeId))!=null&&f.image),"has-link":!!((_=e.unref(oe)(m.value,y.value.nodeId))!=null&&_.link),"has-note":!!((S=e.unref(oe)(m.value,y.value.nodeId))!=null&&S.note),"has-code":((v=(D=e.unref(oe)(m.value,y.value.nodeId))==null?void 0:D.richContent)==null?void 0:v.kind)==="code","has-table":((te=(j=e.unref(oe)(m.value,y.value.nodeId))==null?void 0:j.richContent)==null?void 0:te.kind)==="table","node-markers":((me=e.unref(oe)(m.value,y.value.nodeId))==null?void 0:me.markers)??[],"node-tags":((Ve=e.unref(oe)(m.value,y.value.nodeId))==null?void 0:Ve.tags)??[],onPickImage:go,onRemoveImage:vn,onSetLink:Wr,onRemoveLink:ho,onEditNote:bo,onRemoveNote:Gr,onAddCode:or,onEditCode:or,onRemoveCode:jr,onAddTable:Oe,onEditTable:Oe,onRemoveTable:pn,onToggleMarker:cg,onClearMarkers:dg,onAddTag:fg,onRemoveTags:mg,onClose:se},null,8,["x","y","container","has-image","has-link","has-note","has-code","has-table","node-markers","node-tags"])):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createBlock(ds,{key:4,x:p.value.x,y:p.value.y,container:s.value,onOpenSettings:Pe,onOpenData:Ze,onOpenImport:je,onExportPng:ga,onExportSvg:No,onClose:Ge},null,8,["x","y","container"])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(L.value),title:r.previewMode?"退出预览模式":"进入预览模式",onClick:a[15]||(a[15]=T=>l("canvas-toggle-preview"))},[e.createVNode(be,{name:r.previewMode?"eye-off":"eye",size:16},null,8,["name"])],10,xp),e.createElementVNode("button",{class:e.normalizeClass(V.value),title:"显示大纲视图",onClick:po},[e.createVNode(be,{name:"outline",size:16})],2),e.createElementVNode("div",{class:e.normalizeClass(["zm-toolbar",{"is-preview-only":r.previewMode,"is-hovered":w.value}])},[e.createElementVNode("span",wp,e.toDisplayString(Math.round(e.unref(ne).scale.value*100))+"%",1),e.createElementVNode("button",{class:"zm-tb-btn",title:"放大",onClick:a[16]||(a[16]=(...T)=>e.unref(ne).zoomIn&&e.unref(ne).zoomIn(...T))},[e.createVNode(be,{name:"zoom-in"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"缩小",onClick:a[17]||(a[17]=(...T)=>e.unref(ne).zoomOut&&e.unref(ne).zoomOut(...T))},[e.createVNode(be,{name:"zoom-out"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"重置视图",onClick:on},[e.createVNode(be,{name:"reset"})]),a[38]||(a[38]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"全部收起",onClick:Fp},[e.createVNode(be,{name:"collapse-all"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"展开一级",onClick:a[18]||(a[18]=T=>ra(1))},[e.createVNode(be,{name:"expand-level-1"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"展开二级",onClick:a[19]||(a[19]=T=>ra(2))},[e.createVNode(be,{name:"expand-level-2"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"全部展开",onClick:Hp},[e.createVNode(be,{name:"expand-all"})]),a[39]||(a[39]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"导出 JSON",onClick:Qp},[e.createVNode(be,{name:"export"})]),r.previewMode?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[a[35]||(a[35]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"添加子节点 (Tab)",onClick:a[20]||(a[20]=T=>g.value&&to(g.value))},[e.createElementVNode("img",{src:e.unref(ii),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,Np)]),e.createElementVNode("button",{class:"zm-tb-btn",title:"添加同级 (Enter)",onClick:a[21]||(a[21]=T=>g.value&&ar(g.value))},[e.createElementVNode("img",{src:e.unref(ri),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,Sp)]),a[36]||(a[36]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:R.layoutMode==="mindmap"}]),title:"思维导图布局 (中心辐射)",onClick:a[22]||(a[22]=T=>Qr("mindmap"))},[e.createVNode(be,{name:"mindmap"})],2),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:R.layoutMode==="tree"}]),title:"树形布局 (向右展开)",onClick:a[23]||(a[23]=T=>Qr("tree"))},[e.createVNode(be,{name:"tree"})],2),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:R.layoutMode==="org"}]),title:"组织结构布局 (向下展开)",onClick:a[24]||(a[24]=T=>Qr("org"))},[e.createVNode(be,{name:"org"})],2),a[37]||(a[37]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"导入 JSON",onClick:Jp},[e.createVNode(be,{name:"import"})])],64))],2)],544),r.builtInDrawers?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(Mt,{side:"left",scope:"canvas",width:300,open:tn.value&&!t.previewMode,title:"大纲","onUpdate:open":a[28]||(a[28]=T=>tn.value=T)},{default:e.withCtx(()=>[e.createVNode(zo,{data:m.value,"selected-id":g.value,"collapsed-ids":Je.value,onSelect:mo,onToggleCollapse:mn,onEdit:nr,onAddChild:jn,onAddSibling:Kn,onMove:It},null,8,["data","selected-id","collapsed-ids"])]),_:1},8,["open"]),e.createVNode(Mt,{side:"right",scope:"canvas",width:360,open:Rt.value&&!t.previewMode,title:"数据","onUpdate:open":a[30]||(a[30]=T=>Rt.value=T)},{default:e.withCtx(()=>[e.createVNode(Oo,{data:m.value,"pending-mode":Bt.value,onImport:a[29]||(a[29]=T=>m.value=T),onConsumedMode:ze},null,8,["data","pending-mode"])]),_:1},8,["open"]),e.createVNode(Mt,{side:"right",scope:"canvas",width:420,open:J.value&&!t.previewMode,title:"Markdown","onUpdate:open":a[32]||(a[32]=T=>J.value=T)},{default:e.withCtx(()=>[e.createVNode(Lo,{data:m.value,onImport:a[31]||(a[31]=T=>m.value=T)},null,8,["data"])]),_:1},8,["open"]),e.createVNode(Mt,{side:"right",scope:"canvas",width:360,open:it.value&&!t.previewMode,title:"节点内容","onUpdate:open":a[33]||(a[33]=T=>it.value=T)},{default:e.withCtx(()=>[e.createVNode(Zo,{"selected-node":dt.value,"focus-tick":Se.value,onApply:Qe,onRemove:ht,onSetLink:Mn,onSetImage:er,onSetRich:tr},null,8,["selected-node","focus-tick"])]),_:1},8,["open"]),e.createVNode(Mt,{side:"right",scope:"canvas",width:340,open:Te.value&&!t.previewMode,title:"设置","onUpdate:open":a[34]||(a[34]=T=>Te.value=T)},{default:e.withCtx(()=>{var T;return[e.createVNode(Do,{settings:R,"has-selection":g.value!==null,"selected-node-text":(T=dt.value)==null?void 0:T.text,"node-style":H.value,"onUpdate:settings":Z,"onUpdate:nodeStyle":ce,onReset:ke},null,8,["settings","has-selection","selected-node-text","node-style"])]}),_:1},8,["open"])],64)):e.createCommentVNode("",!0)],4)}}}),Tp={class:"zm-app"},Cp={class:"zm-app-main"},Ap={class:"zm-app-canvas"},Ul=e.defineComponent({__name:"App",setup(t){const o={id:"r_root",text:"flow-mindmap 节点能力一览",link:{url:"https://github.com/xz333221/flow-mindmap"},note:{text:`本导图用于演示节点的全部可渲染字段。
136
136
  所有代码块 / 表格在节点标题上方显示,不会撑大节点框。`},children:[{id:"r_image",text:"嵌入图片",image:{src:"data:image/svg+xml;utf8,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 40" width="80" height="40"><rect width="80" height="40" rx="6" fill="#6366f1"/><text x="40" y="24" text-anchor="middle" fill="#fff" font-family="sans-serif" font-size="12" font-weight="600">LOGO</text></svg>'),naturalW:80,naturalH:40,width:80,height:40},children:[{id:"r_image_a",text:"节点上方的图标 / logo",children:[]},{id:"r_image_b",text:"remote URL 或 data: URL",children:[]},{id:"r_image_c",text:"可拖拽改尺寸",children:[]}]},{id:"r_code",text:"代码块",richContent:{kind:"code",lang:"ts",raw:'```ts\nimport { MindMap } from "flow-mindmap"\nconst tree = MindMap.parse(md)\n```'},note:{text:`代码块以 richContent 形式携带,
137
137
  渲染在节点标题上方,自动支持语言 tag。`},link:{url:"https://flow-mindmap.example/docs/api"},children:[{id:"r_code_a",text:"等宽字体,自动换行",richContent:{kind:"code",lang:"js",raw:"```js\nconst sum = (a, b) => a + b\nconsole.log(sum(1, 2)) // 3\n```"},children:[]},{id:"r_code_b",text:"保留原始 ```lang 标签",richContent:{kind:"code",lang:"bash",raw:"```bash\nnpm install flow-mindmap\nnpm run dev\n```"},children:[]},{id:"r_code_c",text:"max-height 截断,框内可滚",richContent:{kind:"code",lang:"ts",raw:`\`\`\`ts
138
138
  interface Node {
@@ -163,4 +163,4 @@ function walk(n: Node) {
163
163
  | --- | --- | --- | --- | --- |
164
164
  | 1 | 2 | 3 | 4 | 5 |
165
165
  | 6 | 7 | 8 | 9 | 10 |`},children:[]}]},{id:"r_note",text:"笔记 (note)",note:{text:`节点右上角的便签图标。
166
- 鼠标悬浮预览前 60 字,点击打开完整笔记编辑器。`},children:[{id:"r_note_a",text:"悬浮预览",children:[]},{id:"r_note_b",text:"点击展开编辑",children:[]},{id:"r_note_c",text:"export → ```note 围栏",children:[]}]},{id:"r_link",text:"链接 (link)",link:{url:"https://github.com/xz333221/flow-mindmap"},children:[{id:"r_link_a",text:"节点右侧的小图标",children:[]},{id:"r_link_b",text:"点击在新 tab 打开",children:[]},{id:"r_link_c",text:"export → [label](url)",children:[]}]},{id:"r_para",text:"段落 / 列表 (子节点)",children:[{id:"r_para_a",text:"段落不再是父节点框内文字",children:[]},{id:"r_para_b",text:"列表每项一个子节点",children:[]},{id:"r_para_c",text:"节点框大小保持一致,边线对齐",children:[]}]}]};function n(){return typeof location<"u"&&location.hash==="#fan"?r:typeof location<"u"&&location.hash==="#stress"?i:(typeof location<"u"&&location.hash==="#rich",o)}const r={id:"root",text:"flow-mindmap 思维导图",children:[{id:"n_a",text:"主题一",children:[]},{id:"n_b",text:"主题二",children:[]},{id:"n_c",text:"主题三",children:[]},{id:"n_d",text:"主题四",children:[]},{id:"n_e",text:"主题五",children:[]},{id:"n_f",text:"主题六",children:[]},{id:"n_g",text:"主题七",children:[]},{id:"n_h",text:"主题八",children:[]},{id:"n_i",text:"主题九",children:[]}]},i=(()=>{const y=(D,q)=>({id:D,text:q,children:[]}),p=[y("s_l1","左一"),y("s_l2","左二"),y("s_l3","左三"),y("s_l4","左四"),y("s_l5","左五"),y("s_l6","左六"),y("s_l7","左七")],O=[y("s_r1","右一"),y("s_r2","右二"),y("s_r3","右三"),y("s_r4","右四"),y("s_r5","右五"),y("s_r6","右六"),y("s_r7","右七")];return{id:"root",text:"flow-mindmap 思维导图",children:[...p,...O]}})(),s=e.ref(o),c=e.ref(null),u=e.ref(new Set),d=e.ref(!1),g=e.ref(!1),b=e.ref(!1),w=e.ref(!1),N=e.ref(0),V=e.ref(!1),_=e.ref(!1),$=e.ref(null);function B(){s.value=n()}function T(){g.value=!0,b.value=!1,w.value=!1}function E(y){T()}const k=e.reactive({autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:3.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"curve",layoutMode:"mindmap",taperedEdge:!0,showOrderBadge:!1,canvasBg:void 0}),m=e.computed(()=>{var y;return c.value?((y=$.value)==null?void 0:y.getNodeStyle(c.value.id))??{}:{}});function v(y){var p;Object.assign(k,y),(p=$.value)==null||p.applySettings(y)}function x(y){var p;c.value&&((p=$.value)==null||p.applyNodeStyle(c.value.id,y))}function j(){var p;const y={autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"curve",layoutMode:"mindmap",taperedEdge:!0,showOrderBadge:!1,canvasBg:void 0};Object.assign(k,y),(p=$.value)==null||p.applySettings(y)}function K(y){if(y.key==="Escape"){if(V.value){V.value=!1,y.stopPropagation();return}_.value&&(_.value=!1,y.stopPropagation())}}e.onMounted(()=>{var y;document.addEventListener("keydown",K),window.addEventListener("hashchange",B),(y=$.value)==null||y.applySettings({rainbowBranch:k.rainbowBranch,branchPaletteId:k.branchPaletteId,customPalettes:k.customPalettes,lineWidthStart:k.lineWidthStart,lineWidthEnd:k.lineWidthEnd,lineStyle:k.lineStyle})}),e.onBeforeUnmount(()=>{document.removeEventListener("keydown",K),window.removeEventListener("hashchange",B)});function ne(y){s.value=y}function ce(y){var O;const p=y&&y.length>0?y[0]:null;c.value=p,p?!w.value&&((O=$.value)!=null&&O.nodeHasContent(p.id))&&(g.value=!1,b.value=!1,w.value=!0):w.value=!1}e.watch(s,y=>{if(!c.value)return;const p=Y(y,c.value.id);p?p!==c.value&&(c.value=p):c.value=null},{deep:!1});function re(y){if(!c.value||c.value.id!==y){const p=Y(s.value,y);p&&(c.value=p)}g.value=!1,b.value=!1,w.value=!0,N.value++}function Y(y,p){if(y.id===p)return y;for(const O of y.children){const D=Y(O,p);if(D)return D}return null}function ee(y){var p;c.value&&((p=$.value)==null||p.applyNodeNote(c.value.id,y))}function ie(){var y;c.value&&((y=$.value)==null||y.removeNodeNote(c.value.id))}function z(y){var p;c.value&&((p=$.value)==null||p.applyNodeLink(c.value.id,y))}function C(y){var p;c.value&&((p=$.value)==null||p.applyNodeImageByUrl(c.value.id,y))}function F(y){var p;c.value&&((p=$.value)==null||p.applyNodeRichContent(c.value.id,y))}function P(y){const p=document.querySelector(`[data-node-id="${y.id}"]`);p&&p.click()}function W(y){const p=new Set(u.value);p.has(y)?p.delete(y):p.add(y),u.value=p}function ae(y){var p;(p=$.value)==null||p.setNodeText(y.id,y.text)}function we(y){var p;(p=$.value)==null||p.addChild(y)}function ve(y){var p;(p=$.value)==null||p.addSibling(y)}function ze(y){var p;(p=$.value)==null||p.moveNode(y.srcId,y.targetId,y.position)}const Ne=e.computed(()=>{var y;return((y=c.value)==null?void 0:y.id)??null});return(y,p)=>(e.openBlock(),e.createElementBlock("div",ap,[e.createVNode(An,{side:"left",width:300,open:d.value,title:"大纲","onUpdate:open":p[0]||(p[0]=O=>d.value=O)},{default:e.withCtx(()=>[e.createVNode(br,{data:s.value,"selected-id":Ne.value,"collapsed-ids":u.value,onSelect:P,onToggleCollapse:W,onEdit:ae,onAddChild:we,onAddSibling:ve,onMove:ze},null,8,["data","selected-id","collapsed-ids"])]),_:1},8,["open"]),e.createElementVNode("main",sp,[_.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-app-preview-exit",title:"退出预览 (Esc)",onClick:p[1]||(p[1]=O=>_.value=!1)},[...p[11]||(p[11]=[e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),e.createElementVNode("line",{x1:"2",y1:"2",x2:"22",y2:"22"})],-1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",cp,[e.createVNode(Fo,{ref_key:"mindMapRef",ref:$,data:s.value,"preview-mode":_.value,onChange:ne,onSelect:ce,onEditNote:re,onCanvasSettings:p[2]||(p[2]=O=>V.value=!0),onCanvasData:T,onCanvasImport:E,onCanvasTogglePreview:p[3]||(p[3]=O=>_.value=!_.value),onCanvasOutline:p[4]||(p[4]=O=>d.value=!0)},null,8,["data","preview-mode"])])]),e.createVNode(An,{side:"right",width:360,open:g.value&&!_.value,title:"数据","onUpdate:open":p[6]||(p[6]=O=>g.value=O)},{default:e.withCtx(()=>[e.createVNode(kr,{data:s.value,onImport:p[5]||(p[5]=O=>s.value=O)},null,8,["data"])]),_:1},8,["open"]),e.createVNode(An,{side:"right",width:420,open:b.value&&!_.value,title:"Markdown","onUpdate:open":p[8]||(p[8]=O=>b.value=O)},{default:e.withCtx(()=>[e.createVNode(yr,{data:s.value,onImport:p[7]||(p[7]=O=>s.value=O)},null,8,["data"])]),_:1},8,["open"]),e.createVNode(An,{side:"right",width:360,open:w.value&&!_.value,title:"节点内容","onUpdate:open":p[9]||(p[9]=O=>w.value=O)},{default:e.withCtx(()=>[e.createVNode($r,{"selected-node":c.value,readonly:!1,"focus-tick":N.value,onApply:ee,onRemove:ie,onSetLink:z,onSetImage:C,onSetRich:F},null,8,["selected-node","focus-tick"])]),_:1},8,["open"]),e.createVNode(An,{side:"right",width:340,open:V.value&&!_.value,title:"设置","onUpdate:open":p[10]||(p[10]=O=>V.value=O)},{default:e.withCtx(()=>{var O;return[e.createVNode(Er,{settings:k,"has-selection":c.value!==null,"selected-node-text":(O=c.value)==null?void 0:O.text,"node-style":m.value,"onUpdate:settings":v,"onUpdate:nodeStyle":x,onReset:j},null,8,["settings","has-selection","selected-node-text","node-style"])]}),_:1},8,["open"])]))}}),dp={install(t){t.component("FlowMindMap",Fo),t.component("FlowMindMapOutline",br),t.component("FlowMindMapDrawer",An),t.component("FlowMindMapDataPanel",kr),t.component("FlowMindMapMarkdownPanel",yr),t.component("FlowMindMapSettingsPanel",Er),t.component("FlowMindMapNotePanel",$r),t.component("FlowMindMapApp",Bl)}};be.DataPanel=kr,be.Drawer=An,be.MARKER_LIB=ir,be.MarkdownPanel=yr,be.MindMap=Fo,be.MindMapApp=Bl,be.NotePanel=$r,be.Outline=br,be.SettingsPanel=Er,be.addChild=ri,be.addSibling=ii,be.clone=Ct,be.default=dp,be.findNode=le,be.findParent=Bt,be.markdownToMindMap=Vn,be.markdownToRichMindMap=Ma,be.markerDef=Pa,be.markerLabel=si,be.markerSvg=zo,be.mindMapToMarkdown=$n,be.removeNode=Mo,be.richBlockToMarkdown=Ra,be.tagColor=lr,be.uid=Ft,Object.defineProperties(be,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
166
+ 鼠标悬浮预览前 60 字,点击打开完整笔记编辑器。`},children:[{id:"r_note_a",text:"悬浮预览",children:[]},{id:"r_note_b",text:"点击展开编辑",children:[]},{id:"r_note_c",text:"export → ```note 围栏",children:[]}]},{id:"r_link",text:"链接 (link)",link:{url:"https://github.com/xz333221/flow-mindmap"},children:[{id:"r_link_a",text:"节点右侧的小图标",children:[]},{id:"r_link_b",text:"点击在新 tab 打开",children:[]},{id:"r_link_c",text:"export → [label](url)",children:[]}]},{id:"r_para",text:"段落 / 列表 (子节点)",children:[{id:"r_para_a",text:"段落不再是父节点框内文字",children:[]},{id:"r_para_b",text:"列表每项一个子节点",children:[]},{id:"r_para_c",text:"节点框大小保持一致,边线对齐",children:[]}]}]};function n(){return typeof location<"u"&&location.hash==="#fan"?r:typeof location<"u"&&location.hash==="#stress"?l:(typeof location<"u"&&location.hash==="#rich",o)}const r={id:"root",text:"flow-mindmap 思维导图",children:[{id:"n_a",text:"主题一",children:[]},{id:"n_b",text:"主题二",children:[]},{id:"n_c",text:"主题三",children:[]},{id:"n_d",text:"主题四",children:[]},{id:"n_e",text:"主题五",children:[]},{id:"n_f",text:"主题六",children:[]},{id:"n_g",text:"主题七",children:[]},{id:"n_h",text:"主题八",children:[]},{id:"n_i",text:"主题九",children:[]}]},l=(()=>{const y=(V,X)=>({id:V,text:X,children:[]}),p=[y("s_l1","左一"),y("s_l2","左二"),y("s_l3","左三"),y("s_l4","左四"),y("s_l5","左五"),y("s_l6","左六"),y("s_l7","左七")],L=[y("s_r1","右一"),y("s_r2","右二"),y("s_r3","右三"),y("s_r4","右四"),y("s_r5","右五"),y("s_r6","右六"),y("s_r7","右七")];return{id:"root",text:"flow-mindmap 思维导图",children:[...p,...L]}})(),s=e.ref(o),c=e.ref(null),u=e.ref(new Set),d=e.ref(!1),g=e.ref(!1),b=e.ref(!1),w=e.ref(!1),N=e.ref(0),$=e.ref(!1),M=e.ref(!1),P=e.ref(null);function I(){s.value=n()}function C(){g.value=!0,b.value=!1,w.value=!1}function E(y){C()}const k=e.reactive({autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:3.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"curve",layoutMode:"mindmap",taperedEdge:!0,showOrderBadge:!1,canvasBg:void 0}),m=e.computed(()=>{var y;return c.value?((y=P.value)==null?void 0:y.getNodeStyle(c.value.id))??{}:{}});function B(y){var p;Object.assign(k,y),(p=P.value)==null||p.applySettings(y)}function x(y){var p;c.value&&((p=P.value)==null||p.applyNodeStyle(c.value.id,y))}function K(){var p;const y={autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"curve",layoutMode:"mindmap",taperedEdge:!0,showOrderBadge:!1,canvasBg:void 0};Object.assign(k,y),(p=P.value)==null||p.applySettings(y)}function Y(y){if(y.key==="Escape"){if($.value){$.value=!1,y.stopPropagation();return}M.value&&(M.value=!1,y.stopPropagation())}}e.onMounted(()=>{var y;document.addEventListener("keydown",Y),window.addEventListener("hashchange",I),(y=P.value)==null||y.applySettings({rainbowBranch:k.rainbowBranch,branchPaletteId:k.branchPaletteId,customPalettes:k.customPalettes,lineWidthStart:k.lineWidthStart,lineWidthEnd:k.lineWidthEnd,lineStyle:k.lineStyle})}),e.onBeforeUnmount(()=>{document.removeEventListener("keydown",Y),window.removeEventListener("hashchange",I)});function ee(y){s.value=y}function ae(y){var L;const p=y&&y.length>0?y[0]:null;c.value=p,p?!w.value&&((L=P.value)!=null&&L.nodeHasContent(p.id))&&(g.value=!1,b.value=!1,w.value=!0):w.value=!1}e.watch(s,y=>{if(!c.value)return;const p=q(y,c.value.id);p?p!==c.value&&(c.value=p):c.value=null},{deep:!1});function re(y){if(!c.value||c.value.id!==y){const p=q(s.value,y);p&&(c.value=p)}g.value=!1,b.value=!1,w.value=!0,N.value++}function q(y,p){if(y.id===p)return y;for(const L of y.children){const V=q(L,p);if(V)return V}return null}function Q(y){var p;c.value&&((p=P.value)==null||p.applyNodeNote(c.value.id,y))}function ie(){var y;c.value&&((y=P.value)==null||y.removeNodeNote(c.value.id))}function z(y){var p;c.value&&((p=P.value)==null||p.applyNodeLink(c.value.id,y))}function A(y){var p;c.value&&((p=P.value)==null||p.applyNodeImageByUrl(c.value.id,y))}function F(y){var p;c.value&&((p=P.value)==null||p.applyNodeRichContent(c.value.id,y))}function U(y){const p=document.querySelector(`[data-node-id="${y.id}"]`);p&&p.click()}function G(y){const p=new Set(u.value);p.has(y)?p.delete(y):p.add(y),u.value=p}function le(y){var p;(p=P.value)==null||p.setNodeText(y.id,y.text)}function Ne(y){var p;(p=P.value)==null||p.addChild(y)}function _e(y){var p;(p=P.value)==null||p.addSibling(y)}function Re(y){var p;(p=P.value)==null||p.moveNode(y.srcId,y.targetId,y.position)}const xe=e.computed(()=>{var y;return((y=c.value)==null?void 0:y.id)??null});return(y,p)=>(e.openBlock(),e.createElementBlock("div",Tp,[e.createVNode(Mt,{side:"left",width:300,open:d.value,title:"大纲","onUpdate:open":p[0]||(p[0]=L=>d.value=L)},{default:e.withCtx(()=>[e.createVNode(zo,{data:s.value,"selected-id":xe.value,"collapsed-ids":u.value,onSelect:U,onToggleCollapse:G,onEdit:le,onAddChild:Ne,onAddSibling:_e,onMove:Re},null,8,["data","selected-id","collapsed-ids"])]),_:1},8,["open"]),e.createElementVNode("main",Cp,[M.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-app-preview-exit",title:"退出预览 (Esc)",onClick:p[1]||(p[1]=L=>M.value=!1)},[...p[11]||(p[11]=[e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),e.createElementVNode("line",{x1:"2",y1:"2",x2:"22",y2:"22"})],-1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",Ap,[e.createVNode(Jo,{ref_key:"mindMapRef",ref:P,data:s.value,"preview-mode":M.value,"built-in-drawers":!1,onChange:ee,onSelect:ae,onEditNote:re,onCanvasSettings:p[2]||(p[2]=L=>$.value=!0),onCanvasData:C,onCanvasImport:E,onCanvasTogglePreview:p[3]||(p[3]=L=>M.value=!M.value),onCanvasOutline:p[4]||(p[4]=L=>d.value=!0)},null,8,["data","preview-mode"])])]),e.createVNode(Mt,{side:"right",width:360,open:g.value&&!M.value,title:"数据","onUpdate:open":p[6]||(p[6]=L=>g.value=L)},{default:e.withCtx(()=>[e.createVNode(Oo,{data:s.value,onImport:p[5]||(p[5]=L=>s.value=L)},null,8,["data"])]),_:1},8,["open"]),e.createVNode(Mt,{side:"right",width:420,open:b.value&&!M.value,title:"Markdown","onUpdate:open":p[8]||(p[8]=L=>b.value=L)},{default:e.withCtx(()=>[e.createVNode(Lo,{data:s.value,onImport:p[7]||(p[7]=L=>s.value=L)},null,8,["data"])]),_:1},8,["open"]),e.createVNode(Mt,{side:"right",width:360,open:w.value&&!M.value,title:"节点内容","onUpdate:open":p[9]||(p[9]=L=>w.value=L)},{default:e.withCtx(()=>[e.createVNode(Zo,{"selected-node":c.value,readonly:!1,"focus-tick":N.value,onApply:Q,onRemove:ie,onSetLink:z,onSetImage:A,onSetRich:F},null,8,["selected-node","focus-tick"])]),_:1},8,["open"]),e.createVNode(Mt,{side:"right",width:340,open:$.value&&!M.value,title:"设置","onUpdate:open":p[10]||(p[10]=L=>$.value=L)},{default:e.withCtx(()=>{var L;return[e.createVNode(Do,{settings:k,"has-selection":c.value!==null,"selected-node-text":(L=c.value)==null?void 0:L.text,"node-style":m.value,"onUpdate:settings":B,"onUpdate:nodeStyle":x,onReset:K},null,8,["settings","has-selection","selected-node-text","node-style"])]}),_:1},8,["open"])]))}}),_p="0.5.1",Mp={install(t){t.component("FlowMindMap",Jo),t.component("FlowMindMapOutline",zo),t.component("FlowMindMapDrawer",Mt),t.component("FlowMindMapDataPanel",Oo),t.component("FlowMindMapMarkdownPanel",Lo),t.component("FlowMindMapSettingsPanel",Do),t.component("FlowMindMapNotePanel",Zo),t.component("FlowMindMapApp",Ul)}};he.DataPanel=Oo,he.Drawer=Mt,he.MARKER_LIB=pr,he.MarkdownPanel=Lo,he.MindMap=Jo,he.MindMapApp=Ul,he.NotePanel=Zo,he.Outline=zo,he.SettingsPanel=Do,he.VERSION=_p,he.addChild=mi,he.addSibling=pi,he.clone=_t,he.default=Mp,he.findNode=oe,he.findParent=Lt,he.markdownToMindMap=zn,he.markdownToRichMindMap=Ka,he.markerDef=rs,he.markerLabel=bi,he.markerSvg=Io,he.mindMapToMarkdown=On,he.removeNode=Mo,he.richBlockToMarkdown=Ya,he.tagColor=gr,he.uid=Gt,Object.defineProperties(he,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});