flow-mindmap 0.5.14 → 0.6.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,19 +1,19 @@
1
- (function(Ce,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(Ce=typeof globalThis<"u"?globalThis:Ce||self,e(Ce.FlowMind={},Ce.Vue))})(this,function(Ce,e){"use strict";var ng=Object.defineProperty;var og=(Ce,e,In)=>e in Ce?ng(Ce,e,{enumerable:!0,configurable:!0,writable:!0,value:In}):Ce[e]=In;var He=(Ce,e,In)=>og(Ce,typeof e!="symbol"?e+"":e,In);var ti;const In=["width","height","stroke-width"],Ta={key:4,points:"6 9 12 15 18 9"},Ca={key:5,points:"9 6 15 12 9 18"},ve=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",Ta)):t.name==="expand"?(e.openBlock(),e.createElementBlock("polyline",Ca)):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,In))}}),sr="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",cr="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",dr=[22,15,13,12],ur=[700,600,500,400],Ma=[46,36,30,26],Aa=[120,80,60,44],_a=[.8,.8,.8,.8],Ra=1,Ba=dr.length-1;function va(t,o){return Math.round(pi(t,o)*_a[_o(t)])}function _o(t){return Math.min(Ba,Math.max(0,t))}function pi(t,o=14){return Math.round(dr[_o(t)]*o/14*10)/10}function za(t,o=14){return Math.round(Ma[_o(t)]*o/14)}const ro=60,Ia=30,La=.75,Ln=14,Lt=24;function fr(t){return Math.max(Ia,Math.round(ro*Math.pow(La,t)))}let hi=null;function Oa(){if(hi)return hi;const t=typeof document<"u"?document.createElement("canvas").getContext("2d"):null;return t?(hi=t,t):{font:"",measureText:()=>({width:0})}}const mr=new Map;function pr(t,o,n){const r=`${n}|${o}|${t}`,a=mr.get(r);if(a!==void 0)return a;const c=Oa();c.font=`${n} ${o}px "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif`;const s=t.split(`
2
- `);let u=0;for(const d of s){const p=c.measureText(d).width;p>u&&(u=p)}return mr.set(r,u),u}const Da=24,Va=400,$a=8,hr=16,gr=4,br=200;function Pa(t,o,n){return Math.min(n,Math.max(o,t))}function Fa(t,o,n,r,a){const c=_o(o),s=pi(o,n),u=Math.min(pr(t.text||"",s,ur[c]),br),d=va(o,n),p=Math.ceil(u+d*2+Ra*2),b=(t.text||"").split(`
3
- `);let C=0;for(const ce of b){const ue=pr(ce,s,ur[c]);C+=Math.max(1,Math.ceil(ue/br))}C=Math.max(1,C);const V=!!(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table"))?Math.ceil(s*1.2)+6+Math.ceil(s*1.2*(C-1)):za(o,n)+Math.ceil(s*1.2*(C-1));let R=0;if(t.link&&(R+=hr),t.note&&(R+=hr),R>0){const ce=(t.link?1:0)+(t.note?1:0);R+=gr*ce}const U=14,I=2;let _=0;t.markers&&t.markers.length>0&&(_=t.markers.length*U+(t.markers.length-1)*I+gr);const y=18,k=4,m=t.tags&&t.tags.length>0?y:0,P=p+R+_,j=(()=>{const ce=Math.round(Aa[c]*n/14);if(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table")){const ue=a==null?void 0:a[t.id];return Math.max(ce,ue??240)}return ce})(),Y=!!(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table")),x=r==null?void 0:r[t.id],re=Y?Math.max(24,x??Math.max(70,Math.ceil(s*5))):0,pe=re>0?10:0;if(!t.image){const ce=Math.max(j,P),ue=Math.ceil(V+pe+re+(m>0?k+m:0));return{w:ce,h:ue}}const de=Pa(t.image.width,Da,Va),we=Math.max(j,P,Math.ceil(de+d*2)),ee=Math.ceil(t.image.height+$a+V+pe+re+(m>0?k+m:0));return{w:we,h:ee}}function Ua(t,o={}){const n=o.mode??"mindmap",r=o.preservePositions===!0,a=o.baseFontSize??14,c=o.branchGap??0,s=yr(t,0,null,1,"right",a,o.richHeights,o.richWidths);return Wa(s,c),Ha(s,n,r,c),s.x=0,s.y=0,Ga(s,r)}function Ha(t,o,n=!1,r=0){if(o==="mindmap"){const a=t.children;if(a.length!==0)if(a.length===1)a[0]._dir="right",a[0].side=1,a[0]._dirRight=1;else{const d=a.reduce((w,V)=>w+V._subtreeH,0);let p=1,b=Math.abs(a[0]._subtreeH-(d-a[0]._subtreeH)),C=0;for(let w=0;w<a.length-1;w++){C+=a[w]._subtreeH;const V=Math.abs(C-(d-C));V<b&&(b=V,p=w+1)}for(let w=0;w<p;w++)a[w]._dir="right",a[w].side=1,a[w]._dirRight=1;for(let w=p;w<a.length;w++)a[w]._dir="left",a[w].side=-1,a[w]._dirRight=-1}const c=t.children.filter(d=>d.side===1),s=t.children.filter(d=>d.side===-1),u=(d,p)=>{const b=p==="right"?1:-1;d._dir=p,d.side=b,d._dirRight=b;for(const C of d.children)u(C,p)};for(const d of c)u(d,"right");for(const d of s)u(d,"left");if(c.length>0){const d={...t,children:c};Ro(d,"right",ro,!0,n,r)}if(s.length>0){const d={...t,children:s};Ro(d,"left",ro,!0,n,r)}}else if(o==="tree"){const a=c=>{c.side=1,c._dir="right";for(const s of c.children)a(s)};for(const c of t.children)c._dir="right";Ro(t,"right",ro,!0,n,r),a(t)}else{for(const a of t.children)a._dir="down";kr(t,ro,n,r)}}function Ro(t,o,n,r,a=!1,c=0){if(t.children.length===0)return;const s=r?Ln+c:Ln,u=t.children.reduce((w,V,R)=>w+V._subtreeH+(R>0?s:0),0),d=o==="right"?1:-1,p=r?d:1;let b=t.y-p*u/2;const C=fr(t.depth);t.children.forEach(w=>{a||(w.x=t.x+d*(t.width/2+C+w.width/2),w.y=b+p*w._subtreeH/2),w._dir=o,b+=p*(w._subtreeH+s),Ro(w,o,n,!1,a,0)})}function kr(t,o,n=!1,r=0){if(t.children.length===0)return;const a=t.depth===0?Ln+r:Ln,c=t.children.reduce((d,p,b)=>d+p._subtreeW+(b>0?a*2:0),0);let s=t.x-c/2;const u=fr(t.depth);t.children.forEach(d=>{n||(d.x=s+d._subtreeW/2,d.y=t.y+t.height/2+u+d.height/2),d._dir="down",s+=d._subtreeW+a*2,kr(d,o,n,0)})}function yr(t,o,n,r,a,c,s,u){const d=Fa(t,o,c,s,u),p={id:t.id,text:t.text,depth:o,x:t._x??0,y:t._y??0,width:d.w,height:d.h,fontSize:pi(o,c),isRoot:o===0,collapsed:t.collapsed,side:r,_dir:a,_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 p;const b=t.children.length,C=Math.ceil(b/2);return p.children=t.children.map((w,V)=>{const R=o===0?V<C?1:-1:r;return yr(w,o+1,p,R,a,c,s,u)}),p}function Wa(t,o=0){const n=[t];for(let r=0;r<n.length;r++){const a=n[r];for(const c of a.children)n.push(c)}for(let r=n.length-1;r>=0;r--){const a=n[r];if(a.collapsed||a.children.length===0){a._subtreeH=a.height,a._subtreeW=a.width;continue}const c=a.depth===0?Ln+o:Ln;let s=0,u=0;for(const d of a.children)s+=d._subtreeH,u+=d._subtreeW;a.children.length>1&&(s+=c*(a.children.length-1),u+=c*2*(a.children.length-1)),a._subtreeH=Math.max(a.height,s),a._subtreeW=Math.max(a.width,u)}}function Ga(t,o=!1){const n=[t];let r=1/0,a=-1/0,c=1/0,s=-1/0;for(;n.length;){const p=n.pop(),b=p.width/2,C=p.height/2;p.x-b<r&&(r=p.x-b),p.x+b>a&&(a=p.x+b),p.y-C<c&&(c=p.y-C),p.y+C>s&&(s=p.y+C),n.push(...p.children)}if(o)return{root:t,width:a-r+Lt*2,height:s-c+Lt*2,vbX:r-Lt,vbY:c-Lt,vbW:a-r+Lt*2,vbH:s-c+Lt*2};const u=Lt-c,d=[t];for(;d.length;){const p=d.pop();p.y+=u,d.push(...p.children)}return c+=u,s+=u,{root:t,width:a-r+Lt*2,height:s+Lt,vbX:r-Lt,vbY:0,vbW:a-r+Lt*2,vbH:s+Lt}}const mn=[{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 ja(t,o=[]){return[...mn,...o].find(r=>r.id===t)??mn[0]}function Ka(t,o=8){const n=[],r=new Set,a=/#[0-9a-fA-F]{3,8}\b|rgba?\([^)]+\)|[A-Za-z][A-Za-z0-9_-]{2,30}/g;let c;for(;(c=a.exec(t))!==null;){const s=c[0];let u=null;if(s.startsWith("#")?u=Ya(s):s.startsWith("rgb")?u=qa(s):u=Xa[s.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 Ya(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 qa(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 a=0;a<3;a++){const c=n[a];if(c.endsWith("%")){const s=parseFloat(c);if(!isFinite(s))return null;r.push(Math.round(s/100*255))}else{const s=parseInt(c,10);if(!isFinite(s)||s<0||s>255)return null;r.push(s)}}return"#"+r.map(a=>a.toString(16).padStart(2,"0")).join("").toLowerCase()}const Xa={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 Xt(){return"n_"+Math.random().toString(36).slice(2,10)+Date.now().toString(36).slice(-4)}function Ot(t){return JSON.parse(JSON.stringify(t))}function be(t,o){if(t.id===o)return t;for(const n of t.children){const r=be(n,o);if(r)return r}return null}function Dt(t,o,n=null){if(t.id===o)return n;for(const r of t.children){const a=Dt(r,o,t);if(a!==null)return a}return null}function Bo(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(Bo(r,o))return!0;return!1}function Za(t,o,n){const r=be(t,o);return!r||r.text===n?!1:(r.text=n,!0)}function gi(t,o,n,r){if(!Dt(t,o)||o===n||be(be(t,o),n))return!1;const a=Dt(t,o),c=a.children.findIndex(p=>p.id===o);if(c<0)return!1;const[s]=a.children.splice(c,1);if(r==="child"){const p=be(t,n);return p?(p.children.push(s),!0):(a.children.splice(c,0,s),!1)}const u=Dt(t,n);if(!u)return a.children.splice(c,0,s),!1;let d=u.children.findIndex(p=>p.id===n);return d<0?(a.children.splice(c,0,s),!1):(r==="after"&&(d+=1),u.children.splice(d,0,s),!0)}function xr(t){const o=/^新节点(?:\s+(\d+))?$/;let n=0,r=!1;for(const a of t.children){const c=a.text.match(o);if(c)if(c[1]){const s=parseInt(c[1],10);s>n&&(n=s)}else r=!0}return n===0&&!r?zo:n>0?`新节点 ${n+1}`:"新节点 2"}function bi(t,o,n){const r=be(t,o);if(!r)return null;const a={id:Xt(),text:n??xr(r),children:[]};return r.children.push(a),a}function Er(t,o,n){const r=Dt(t,o);if(!r)return null;const a=r.children.findIndex(s=>s.id===o);if(a<0)return null;const c={id:Xt(),text:n??xr(r),children:[]};return r.children.splice(a+1,0,c),c}function Ja(t,o,n){const r=Dt(t,o);if(!r)return null;const a=r.children.findIndex(s=>s.id===o);if(a<0)return null;const c={id:Xt(),text:n,children:[]};return r.children.splice(a,0,c),c}function Qa(t,o){const n=Dt(t,o);if(!n)return null;const r=n.children.findIndex(s=>s.id===o);if(r<0)return null;const a=n.children[r],c=Ot(a);return vo(c),n.children.splice(r+1,0,c),c}function vo(t){t.id=Xt();for(const o of t.children)vo(o)}function wr(t,o){const n=be(t,o);if(!n||n.id===t.id)return null;const r=Ot(n);return vo(r),r}function Nr(t){return t.children.reduce((o,n)=>o+1+Nr(n),0)}const zo="新节点";function On(t,o="导入的导图"){const n=t.split(/\r?\n/),r={id:Xt(),text:o,children:[]},a=[r],c=[-1/0],s=[],u=/^(#{1,6})\s+(.+?)\s*#*\s*$/,d=/^!\[([^\]]*)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,p=/^\[([^\]]+)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,b=/^(`{3,}|~{3,})\s*(\S+)?\s*$/;let C=!1,w=[],V=null;function R(_){w.push(_)}function U(){if(V&&w.length>0){for(;w.length>0&&w[0].trim()==="";)w.shift();for(;w.length>0&&w[w.length-1].trim()==="";)w.pop();const _=w.join(`
4
- `);_&&(V.note={text:_})}C=!1,w=[]}for(const _ of n){if(C){const j=_.match(b);if(j&&j[1][0]==="`"){U();continue}R(_);continue}const y=_.match(u);if(y){const j=y[1].length,Y=y[2].trim();s.push({level:j,text:Y,body:""}),V=s[s.length-1];continue}const k=_.match(b);if(k&&k[2]==="note"){C=!0,w=[];continue}const m=_.match(d);if(m&&V){const j=m[2],Y=160,x=120;V.image={src:j,naturalW:Y,naturalH:x,width:Y,height:x};continue}const P=_.match(p);if(P&&V){V.link={url:P[2]},V.text=P[1];continue}if(_.trim().length>0&&V){const j=_.trim();V.body=V.body?V.body+`
5
- `+j:j}}C&&U();function I(_){for(;a.length>1;){const P=a.length-1,j=c[P];if(j!==void 0&&j<_.level)break;a.pop(),c.pop()}const y=a[a.length-1],k=_.text,m={id:Xt(),text:k,children:[]};_.image&&(m.image={..._.image}),_.link&&(m.link={url:_.link.url}),_.note&&(m.note={text:_.note.text}),_.body&&(m.note={text:_.body}),y.children.push(m),a.push(m),c.push(_.level)}for(const _ of s)I(_);if(s.length>0&&s[0].level===1){const _=r.children[0];_&&(r.text=_.text,r.id=_.id,_.image&&(r.image={..._.image}),_.link&&(r.link={url:_.link.url}),_.note&&(r.note={text:_.note.text}),r.children=_.children)}return r}function Dn(t,o=1){let n="#".repeat(o)+" "+(t.text||"")+`
1
+ (function(Ae,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(Ae=typeof globalThis<"u"?globalThis:Ae||self,e(Ae.FlowMind={},Ae.Vue))})(this,function(Ae,e){"use strict";var Yg=Object.defineProperty;var qg=(Ae,e,$n)=>e in Ae?Yg(Ae,e,{enumerable:!0,configurable:!0,writable:!0,value:$n}):Ae[e]=$n;var He=(Ae,e,$n)=>qg(Ae,typeof e!="symbol"?e+"":e,$n);var ci;const $n=["width","height","stroke-width"],Xa={key:4,points:"6 9 12 15 18 9"},Za={key:5,points:"9 6 15 12 9 18"},Re=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",Xa)):t.name==="expand"?(e.openBlock(),e.createElementBlock("polyline",Za)):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)):t.name==="relation"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:34},[n[75]||(n[75]=e.createElementVNode("circle",{cx:"5",cy:"19",r:"2.5"},null,-1)),n[76]||(n[76]=e.createElementVNode("circle",{cx:"19",cy:"5",r:"2.5"},null,-1)),n[77]||(n[77]=e.createElementVNode("path",{d:"M7 17 C 10 12, 14 12, 17 7","stroke-dasharray":"3 2.2"},null,-1))],64)):e.createCommentVNode("",!0)],8,$n))}}),yr="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",Er=[22,15,13,12],wr=[700,600,500,400],Ja=[46,36,30,26],Qa=[120,80,60,44],es=[.8,.8,.8,.8],ts=1,ns=Er.length-1;function os(t,o){return Math.round(wi(t,o)*es[Vo(t)])}function Vo(t){return Math.min(ns,Math.max(0,t))}function wi(t,o=14){return Math.round(Er[Vo(t)]*o/14*10)/10}function is(t,o=14){return Math.round(Ja[Vo(t)]*o/14)}const uo=60,rs=30,ls=.75,Pn=14,Vt=24;function Nr(t){return Math.max(rs,Math.round(uo*Math.pow(ls,t)))}let Ni=null;function as(){if(Ni)return Ni;const t=typeof document<"u"?document.createElement("canvas").getContext("2d"):null;return t?(Ni=t,t):{font:"",measureText:()=>({width:0})}}const Sr=new Map;function Cr(t,o,n){const r=`${n}|${o}|${t}`,a=Sr.get(r);if(a!==void 0)return a;const c=as();c.font=`${n} ${o}px "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif`;const s=t.split(`
2
+ `);let m=0;for(const d of s){const h=c.measureText(d).width;h>m&&(m=h)}return Sr.set(r,m),m}const ss=24,cs=400,ds=8,Tr=16,Mr=4,Ar=200;function us(t,o,n){return Math.min(n,Math.max(o,t))}function fs(t,o,n,r,a){const c=Vo(o),s=wi(o,n),m=Math.min(Cr(t.text||"",s,wr[c]),Ar),d=os(o,n),h=Math.ceil(m+d*2+ts*2),b=(t.text||"").split(`
3
+ `);let A=0;for(const de of b){const fe=Cr(de,s,wr[c]);A+=Math.max(1,Math.ceil(fe/Ar))}A=Math.max(1,A);const $=!!(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table"))?Math.ceil(s*1.2)+6+Math.ceil(s*1.2*(A-1)):is(o,n)+Math.ceil(s*1.2*(A-1));let R=0;if(t.link&&(R+=Tr),t.note&&(R+=Tr),R>0){const de=(t.link?1:0)+(t.note?1:0);R+=Mr*de}const U=14,I=2;let v=0;t.markers&&t.markers.length>0&&(v=t.markers.length*U+(t.markers.length-1)*I+Mr);const w=18,y=4,p=t.tags&&t.tags.length>0?w:0,P=h+R+v,Y=(()=>{const de=Math.round(Qa[c]*n/14);if(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table")){const fe=a==null?void 0:a[t.id];return Math.max(de,fe??240)}return de})(),q=!!(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table")),N=r==null?void 0:r[t.id],ae=q?Math.max(24,N??Math.max(70,Math.ceil(s*5))):0,ge=ae>0?10:0;if(!t.image){const de=Math.max(Y,P),fe=Math.ceil($+ge+ae+(p>0?y+p:0));return{w:de,h:fe}}const ue=us(t.image.width,ss,cs),we=Math.max(Y,P,Math.ceil(ue+d*2)),te=Math.ceil(t.image.height+ds+$+ge+ae+(p>0?y+p:0));return{w:we,h:te}}function ms(t,o={}){const n=o.mode??"mindmap",r=o.preservePositions===!0,a=o.baseFontSize??14,c=o.branchGap??0,s=vr(t,0,null,1,"right",a,o.richHeights,o.richWidths);return hs(s,c),ps(s,n,r,c),s.x=0,s.y=0,gs(s,r)}function ps(t,o,n=!1,r=0){if(o==="mindmap"){const a=t.children;if(a.length!==0)if(a.length===1)a[0]._dir="right",a[0].side=1,a[0]._dirRight=1;else{const d=a.reduce((C,$)=>C+$._subtreeH,0);let h=1,b=Math.abs(a[0]._subtreeH-(d-a[0]._subtreeH)),A=0;for(let C=0;C<a.length-1;C++){A+=a[C]._subtreeH;const $=Math.abs(A-(d-A));$<b&&(b=$,h=C+1)}for(let C=0;C<h;C++)a[C]._dir="right",a[C].side=1,a[C]._dirRight=1;for(let C=h;C<a.length;C++)a[C]._dir="left",a[C].side=-1,a[C]._dirRight=-1}const c=t.children.filter(d=>d.side===1),s=t.children.filter(d=>d.side===-1),m=(d,h)=>{const b=h==="right"?1:-1;d._dir=h,d.side=b,d._dirRight=b;for(const A of d.children)m(A,h)};for(const d of c)m(d,"right");for(const d of s)m(d,"left");if(c.length>0){const d={...t,children:c};Do(d,"right",uo,!0,n,r)}if(s.length>0){const d={...t,children:s};Do(d,"left",uo,!0,n,r)}}else if(o==="tree"){const a=c=>{c.side=1,c._dir="right";for(const s of c.children)a(s)};for(const c of t.children)c._dir="right";Do(t,"right",uo,!0,n,r),a(t)}else{for(const a of t.children)a._dir="down";_r(t,uo,n,r)}}function Do(t,o,n,r,a=!1,c=0){if(t.children.length===0)return;const s=r?Pn+c:Pn,m=t.children.reduce((C,$,R)=>C+$._subtreeH+(R>0?s:0),0),d=o==="right"?1:-1,h=r?d:1;let b=t.y-h*m/2;const A=Nr(t.depth);t.children.forEach(C=>{a||(C.x=t.x+d*(t.width/2+A+C.width/2),C.y=b+h*C._subtreeH/2),C._dir=o,b+=h*(C._subtreeH+s),Do(C,o,n,!1,a,0)})}function _r(t,o,n=!1,r=0){if(t.children.length===0)return;const a=t.depth===0?Pn+r:Pn,c=t.children.reduce((d,h,b)=>d+h._subtreeW+(b>0?a*2:0),0);let s=t.x-c/2;const m=Nr(t.depth);t.children.forEach(d=>{n||(d.x=s+d._subtreeW/2,d.y=t.y+t.height/2+m+d.height/2),d._dir="down",s+=d._subtreeW+a*2,_r(d,o,n,0)})}function vr(t,o,n,r,a,c,s,m){const d=fs(t,o,c,s,m),h={id:t.id,text:t.text,depth:o,x:t._x??0,y:t._y??0,width:d.w,height:d.h,fontSize:wi(o,c),isRoot:o===0,collapsed:t.collapsed,side:r,_dir:a,_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 h;const b=t.children.length,A=Math.ceil(b/2);return h.children=t.children.map((C,$)=>{const R=o===0?$<A?1:-1:r;return vr(C,o+1,h,R,a,c,s,m)}),h}function hs(t,o=0){const n=[t];for(let r=0;r<n.length;r++){const a=n[r];for(const c of a.children)n.push(c)}for(let r=n.length-1;r>=0;r--){const a=n[r];if(a.collapsed||a.children.length===0){a._subtreeH=a.height,a._subtreeW=a.width;continue}const c=a.depth===0?Pn+o:Pn;let s=0,m=0;for(const d of a.children)s+=d._subtreeH,m+=d._subtreeW;a.children.length>1&&(s+=c*(a.children.length-1),m+=c*2*(a.children.length-1)),a._subtreeH=Math.max(a.height,s),a._subtreeW=Math.max(a.width,m)}}function gs(t,o=!1){const n=[t];let r=1/0,a=-1/0,c=1/0,s=-1/0;for(;n.length;){const h=n.pop(),b=h.width/2,A=h.height/2;h.x-b<r&&(r=h.x-b),h.x+b>a&&(a=h.x+b),h.y-A<c&&(c=h.y-A),h.y+A>s&&(s=h.y+A),n.push(...h.children)}if(o)return{root:t,width:a-r+Vt*2,height:s-c+Vt*2,vbX:r-Vt,vbY:c-Vt,vbW:a-r+Vt*2,vbH:s-c+Vt*2};const m=Vt-c,d=[t];for(;d.length;){const h=d.pop();h.y+=m,d.push(...h.children)}return c+=m,s+=m,{root:t,width:a-r+Vt*2,height:s+Vt,vbX:r-Vt,vbY:0,vbW:a-r+Vt*2,vbH:s+Vt}}const hn=[{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 bs(t,o=[]){return[...hn,...o].find(r=>r.id===t)??hn[0]}function ks(t,o=8){const n=[],r=new Set,a=/#[0-9a-fA-F]{3,8}\b|rgba?\([^)]+\)|[A-Za-z][A-Za-z0-9_-]{2,30}/g;let c;for(;(c=a.exec(t))!==null;){const s=c[0];let m=null;if(s.startsWith("#")?m=ys(s):s.startsWith("rgb")?m=xs(s):m=Es[s.toLowerCase()]??null,!m)continue;const d=m.toLowerCase();if(!r.has(d)&&(r.add(d),n.push(d),n.length>=o))break}return n}function ys(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 xs(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 a=0;a<3;a++){const c=n[a];if(c.endsWith("%")){const s=parseFloat(c);if(!isFinite(s))return null;r.push(Math.round(s/100*255))}else{const s=parseInt(c,10);if(!isFinite(s)||s<0||s>255)return null;r.push(s)}}return"#"+r.map(a=>a.toString(16).padStart(2,"0")).join("").toLowerCase()}const Es={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 Kt(){return"n_"+Math.random().toString(36).slice(2,10)+Date.now().toString(36).slice(-4)}function vt(t){return JSON.parse(JSON.stringify(t))}function he(t,o){if(t.id===o)return t;for(const n of t.children){const r=he(n,o);if(r)return r}return null}function Dt(t,o,n=null){if(t.id===o)return n;for(const r of t.children){const a=Dt(r,o,t);if(a!==null)return a}return null}function $o(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($o(r,o))return!0;return!1}function ws(t,o,n){const r=he(t,o);return!r||r.text===n?!1:(r.text=n,!0)}function Si(t,o,n,r){if(!Dt(t,o)||o===n||he(he(t,o),n))return!1;const a=Dt(t,o),c=a.children.findIndex(h=>h.id===o);if(c<0)return!1;const[s]=a.children.splice(c,1);if(r==="child"){const h=he(t,n);return h?(h.children.push(s),!0):(a.children.splice(c,0,s),!1)}const m=Dt(t,n);if(!m)return a.children.splice(c,0,s),!1;let d=m.children.findIndex(h=>h.id===n);return d<0?(a.children.splice(c,0,s),!1):(r==="after"&&(d+=1),m.children.splice(d,0,s),!0)}function Rr(t){const o=/^新节点(?:\s+(\d+))?$/;let n=0,r=!1;for(const a of t.children){const c=a.text.match(o);if(c)if(c[1]){const s=parseInt(c[1],10);s>n&&(n=s)}else r=!0}return n===0&&!r?Fo:n>0?`新节点 ${n+1}`:"新节点 2"}function Ci(t,o,n){const r=he(t,o);if(!r)return null;const a={id:Kt(),text:n??Rr(r),children:[]};return r.children.push(a),a}function Br(t,o,n){const r=Dt(t,o);if(!r)return null;const a=r.children.findIndex(s=>s.id===o);if(a<0)return null;const c={id:Kt(),text:n??Rr(r),children:[]};return r.children.splice(a+1,0,c),c}function Ns(t,o,n){const r=Dt(t,o);if(!r)return null;const a=r.children.findIndex(s=>s.id===o);if(a<0)return null;const c={id:Kt(),text:n,children:[]};return r.children.splice(a,0,c),c}function Ss(t,o){const n=Dt(t,o);if(!n)return null;const r=n.children.findIndex(s=>s.id===o);if(r<0)return null;const a=n.children[r],c=vt(a);return Po(c),n.children.splice(r+1,0,c),c}function Po(t){t.id=Kt();for(const o of t.children)Po(o)}function zr(t,o){const n=he(t,o);if(!n||n.id===t.id)return null;const r=vt(n);return Po(r),r}function Ir(t){return t.children.reduce((o,n)=>o+1+Ir(n),0)}const Fo="新节点";function Cs(t){return t.relations||(t.relations=[]),t.relations}function Fn(t,o){var n;return((n=t.relations)==null?void 0:n.find(r=>r.id===o))??null}function Ts(t,o,n){if(o===n||!he(t,o)||!he(t,n))return null;const r=Cs(t);if(r.some(c=>c.fromId===o&&c.toId===n))return null;const a={id:Kt(),fromId:o,toId:n};return r.push(a),a}function Ms(t,o){const n=t.relations;if(!n)return!1;const r=n.findIndex(a=>a.id===o);return r<0?!1:(n.splice(r,1),!0)}function As(t,o,n){const r=Fn(t,o);return r?(Object.assign(r,n),!0):!1}function _s(t,o,n,r){var d;const a=Fn(t,o);if(!a||!he(t,r))return!1;const c=n==="from"?a.toId:a.fromId;if(r===c)return!1;const s=n==="from"?r:a.fromId,m=n==="to"?r:a.toId;return(d=t.relations)!=null&&d.some(h=>h.id!==o&&h.fromId===s&&h.toId===m)?!1:(n==="from"?(a.fromId=r,delete a.fromT):(a.toId=r,delete a.toT),delete a.c1,delete a.c2,!0)}function Lr(t,o){const n=t.relations;if(!n||n.length===0)return 0;const r=n.length;return t.relations=n.filter(a=>a.fromId!==o&&a.toId!==o),r-t.relations.length}function Un(t,o="导入的导图"){const n=t.split(/\r?\n/),r={id:Kt(),text:o,children:[]},a=[r],c=[-1/0],s=[],m=/^(#{1,6})\s+(.+?)\s*#*\s*$/,d=/^!\[([^\]]*)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,h=/^\[([^\]]+)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,b=/^(`{3,}|~{3,})\s*(\S+)?\s*$/;let A=!1,C=[],$=null;function R(v){C.push(v)}function U(){if($&&C.length>0){for(;C.length>0&&C[0].trim()==="";)C.shift();for(;C.length>0&&C[C.length-1].trim()==="";)C.pop();const v=C.join(`
4
+ `);v&&($.note={text:v})}A=!1,C=[]}for(const v of n){if(A){const Y=v.match(b);if(Y&&Y[1][0]==="`"){U();continue}R(v);continue}const w=v.match(m);if(w){const Y=w[1].length,q=w[2].trim();s.push({level:Y,text:q,body:""}),$=s[s.length-1];continue}const y=v.match(b);if(y&&y[2]==="note"){A=!0,C=[];continue}const p=v.match(d);if(p&&$){const Y=p[2],q=160,N=120;$.image={src:Y,naturalW:q,naturalH:N,width:q,height:N};continue}const P=v.match(h);if(P&&$){$.link={url:P[2]},$.text=P[1];continue}if(v.trim().length>0&&$){const Y=v.trim();$.body=$.body?$.body+`
5
+ `+Y:Y}}A&&U();function I(v){for(;a.length>1;){const P=a.length-1,Y=c[P];if(Y!==void 0&&Y<v.level)break;a.pop(),c.pop()}const w=a[a.length-1],y=v.text,p={id:Kt(),text:y,children:[]};v.image&&(p.image={...v.image}),v.link&&(p.link={url:v.link.url}),v.note&&(p.note={text:v.note.text}),v.body&&(p.note={text:v.body}),w.children.push(p),a.push(p),c.push(v.level)}for(const v of s)I(v);if(s.length>0&&s[0].level===1){const v=r.children[0];v&&(r.text=v.text,r.id=v.id,v.image&&(r.image={...v.image}),v.link&&(r.link={url:v.link.url}),v.note&&(r.note={text:v.note.text}),r.children=v.children)}return r}function Hn(t,o=1){let n="#".repeat(o)+" "+(t.text||"")+`
6
6
  `;t.link&&(n+=`[${t.text||"link"}](${t.link.url})
7
7
  `),t.image&&(n+=`![image](${t.image.src})
8
8
  `),t.note&&(n+="```note\n"+t.note.text+"\n```\n"),t.richContent&&(n+=t.richContent.raw+`
9
- `);for(const r of t.children)n+=Dn(r,o+1);return n}function es(t){var p,b;const o=t.split(/\r?\n/),n=[];let r=0;const a=/^(#{1,6})\s+(.+?)\s*#*\s*$/,c=/^(`{3,}|~{3,})\s*(\S+)?\s*$/,s=/^\s*\|?\s*(:?-+:?\s*\|\s*)+(:?-+:?)(\s*\|)?\s*$/,u=/^(\s*)[-*+]\s+(.*)$/,d=/^(\s*)\d+\.\s+(.*)$/;for(;r<o.length;){const C=o[r],w=C.match(c);if(w){const k=w[1][0],m=w[2]||"",P=[C];for(r++;r<o.length;){const Y=o[r].match(c);if(Y&&Y[1][0]===k){P.push(o[r]),r++;break}P.push(o[r]),r++}const j=P.slice(1,-1).join(`
10
- `).trim();n.push({kind:"code",text:((p=j.split(`
11
- `)[0])==null?void 0:p.slice(0,80))||"(空代码块)",raw:P.join(`
12
- `),lang:m});continue}const V=C.match(a);if(V){n.push({kind:"heading",level:V[1].length,text:V[2].trim(),raw:C}),r++;continue}if(/^\s*\|/.test(C)){const k=[];let m=r,P=!1;for(;m<o.length&&/^\s*\|/.test(o[m]);)k.push(o[m]),s.test(o[m])&&(P=!0),m++;if(P&&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(`
13
- `)}),r=m;continue}}const R=C.match(u),U=C.match(d);if(R||U){let k=r;for(;k<o.length;){const m=o[k].match(u),P=o[k].match(d);if(!(m||P))break;const j=o[k].replace(/^\s*[-*+]\s+/,"").replace(/^\s*\d+\.\s+/,"").trim();j.length>0&&n.push({kind:"list",text:j.slice(0,80)||"(列表项)",raw:o[k]}),k++}r=k;continue}if(C.trim()===""){r++;continue}const I=[C];let _=r+1;for(;_<o.length;){const k=o[_];if(k.trim()===""||a.test(k)||c.test(k)||u.test(k)||d.test(k)||/^\s*\|/.test(k))break;I.push(k),_++}const y=I.join(" ").trim();n.push({kind:"paragraph",text:y.slice(0,80)||"(空段落)",raw:I.join(`
14
- `)}),r=_}return n}function ts(t,o="导入的导图"){const n=es(t||""),r={id:Xt(),text:o,children:[]},a=[r],c=[0];let s=!1;function u(d){if(d.kind==="heading"){const b=d.level;for(;a.length>1&&c[c.length-1]>=b;)a.pop(),c.pop();if(!s&&b===1){s=!0,r.text=d.text,c[0]=1;return}const C={id:Xt(),text:d.text,children:[]};a[a.length-1].children.push(C),a.push(C),c.push(b);return}const p={id:Xt(),text:d.text,children:[],richContent:{kind:d.kind,raw:d.raw,lang:d.lang}};a[a.length-1].children.push(p)}for(const d of n)u(d);return r}function ns(t){return t.richContent?t.richContent.raw+`
15
- `:""}function os(t){const o=t.minScale??.2,n=t.maxScale??1/0,r=t.step??1.2,a=e.ref(1),c=e.ref(0),s=e.ref(0),u=e.ref(!1),d=e.ref(!1),p=e.reactive({x:0,y:0,ox:0,oy:0}),b=e.ref(!1),C=e.reactive({x:0,y:0}),w=e.reactive({x:0,y:0,width:0,height:0}),V=e.ref(0);let R=null;function U(ee){R=ee}function I(ee){ee.preventDefault();const ce=t.getContainer();if(!ce)return;const ue=-ee.deltaY*.001,h=Math.min(n,Math.max(o,a.value*(1+ue))),$=ce.getBoundingClientRect(),G=ee.clientX-$.left,oe=ee.clientY-$.top,fe=(G-c.value)/a.value,O=(oe-s.value)/a.value;a.value=h,c.value=G-fe*h,s.value=oe-O*h}function _(){a.value=Math.min(n,a.value*r)}function y(){a.value=Math.max(o,a.value/r)}function k(ee){var ue;ee.target.closest(".zm-node, .zm-toolbar, button, input, textarea")||(u.value=!0,d.value=!1,p.x=ee.clientX,p.y=ee.clientY,p.ox=c.value,p.oy=s.value,window.addEventListener("mousemove",m),window.addEventListener("mouseup",P),(ue=ee.preventDefault)==null||ue.call(ee))}function m(ee){if(!u.value)return;const ce=ee.clientX-p.x,ue=ee.clientY-p.y;(Math.abs(ce)>3||Math.abs(ue)>3)&&(d.value=!0),c.value=p.ox+ce,s.value=p.oy+ue}function P(){u.value=!1,window.removeEventListener("mousemove",m),window.removeEventListener("mouseup",P)}function j(ee,ce,ue){b.value=!0,C.x=ee,C.y=ce,w.x=ee,w.y=ce,w.width=0,w.height=0,w.shiftKey=!!(ue!=null&&ue.shift),V.value++,window.addEventListener("mousemove",re),window.addEventListener("mouseup",x)}function Y(ee,ce){if(!b.value)return;const ue=Math.min(C.x,ee),h=Math.min(C.y,ce),$=Math.max(C.x,ee),G=Math.max(C.y,ce);w.x=ue,w.y=h,w.width=$-ue,w.height=G-h,V.value++}function x(){b.value=!1,window.removeEventListener("mousemove",re),window.removeEventListener("mouseup",x),R&&R()}function re(ee){if(!b.value)return;const ce=t.getContainer();if(!ce)return;const ue=ce.getBoundingClientRect(),h=(ee.clientX-ue.left-c.value)/a.value,$=(ee.clientY-ue.top-s.value)/a.value;Y(h,$)}function pe(ee,ce,ue,h=60){const $=t.getContainer();if(!$)return;const G=$.getBoundingClientRect(),oe=(G.width-h*2)/ee,fe=(G.height-h*2)/ce,O=Math.min(1,Math.max(.3,Math.min(oe,fe)));a.value=O,c.value=G.width/2,s.value=G.height/2-ue*O}function de(){const ee=t.getContainer();if(!ee)return;const ce=ee.getBoundingClientRect(),ue=ce.width/2,h=ce.height/2,$=(ue-c.value)/a.value,G=(h-s.value)/a.value;a.value=1,c.value=ue-$,s.value=h-G}function we(ee,ce,ue,h,$=80){const G=t.getContainer();if(!G)return;const oe=G.getBoundingClientRect();let fe=a.value;(ue*fe<40||h*fe<40)&&(fe=Math.min(n,Math.max(1,60/Math.min(ue,h)))),a.value=fe,c.value=oe.width/2-ee*fe,s.value=oe.height/2-ce*fe}return{scale:a,offsetX:c,offsetY:s,isPanning:u,panMoved:d,onWheel:I,zoomIn:_,zoomOut:y,zoomTo100:de,startPan:k,startMarquee:j,updateMarquee:Y,isMarquee:b,marquee:w,marqueeVersion:V,setOnMarqueeEnd:U,resetView:pe,centerOn:we}}const is=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform);function Sr(t){return is?t.metaKey:t.ctrlKey}function rs(t){function o(){const r=t.getSelectedId();if(r)return r;if(t.defaultTargetId)return t.defaultTargetId();const a=t.getSelectedIds();return a.length>0?a[0]:null}function n(r){var u,d,p;const a=r.target;if(a&&(a.tagName==="INPUT"||a.tagName==="TEXTAREA"||a.isContentEditable)||t.isReadonly()||t.isEditing())return;const c=t.getSelectedId(),s=o();if(s){if(Sr(r)&&!r.shiftKey){if(r.key==="d"||r.key==="D"){const b=(u=t.defaultTargetId)==null?void 0:u.call(t);c&&c!==b&&(r.preventDefault(),t.onDuplicate(c));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(Sr(r)&&r.shiftKey&&(r.key==="Z"||r.key==="z")){r.preventDefault(),t.onRedo();return}if(r.key==="Tab")r.preventDefault(),t.onAddChild(s);else if(r.key==="Enter")if(r.preventDefault(),r.shiftKey){const b=(d=t.defaultTargetId)==null?void 0:d.call(t);c&&c!==b&&t.onAddSiblingBefore(c)}else t.onAddSibling(s);else if((r.key==="Delete"||r.key==="Backspace")&&c&&c!==((p=t.defaultTargetId)==null?void 0:p.call(t)))r.preventDefault(),t.onRemove(c);else if(r.key==="F2"&&c)r.preventDefault(),t.onStartEdit(c);else if(r.key===" "&&c)r.preventDefault(),t.onStartEdit(c);else if(r.key==="Escape")r.preventDefault(),t.onClearSelection();else if(r.altKey&&!r.ctrlKey&&!r.metaKey&&!r.shiftKey){if(r.key==="ArrowUp"){r.preventDefault(),t.onMoveSibling(-1);return}else if(r.key==="ArrowDown"){r.preventDefault(),t.onMoveSibling(1);return}}else 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 ls(t=100){const o=e.ref([]);let n=-1;function r(){return n>0}function a(){return n<o.value.length-1}function c(p){const b=JSON.stringify(p);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 s(){return r()?(n--,JSON.parse(o.value[n])):null}function u(){return a()?(n++,JSON.parse(o.value[n])):null}function d(){o.value=[],n=-1}return{canUndo:r,canRedo:a,record:c,undo:s,redo:u,reset:d}}const as={1:"#ef4444",2:"#f97316",3:"#f59e0b",4:"#eab308",5:"#84cc16",6:"#22c55e",7:"#14b8a6",8:"#3b82f6",9:"#6366f1"},ss={label:"优先级",markers:Array.from({length:9},(t,o)=>{const n=o+1,r=as[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 cs(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 ds={label:"进度",markers:[0,25,50,75,100].map(t=>({id:`progress-${t}`,label:`进度 ${t}%`,svg:cs(t)}))},us={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"/>`}))},ki=[ss,ds,us,{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"/>'}]}],Io={};for(const t of ki)for(const o of t.markers)Io[o.id]=o;function fs(t){return Io[t]}function Lo(t){var o;return((o=Io[t])==null?void 0:o.svg)??""}function Tr(t){var o;return((o=Io[t])==null?void 0:o.label)??t}function yi(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 ms={key:5,class:"zm-marker-picker"},ps={class:"zm-marker-group-label"},hs={class:"zm-marker-grid"},gs=["title","onClick","innerHTML"],bs=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,a=e.computed(()=>{let y=n.x+2,k=n.y+2;if(n.container){const m=n.container.getBoundingClientRect(),P=180,Y=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;y+P>m.right&&(y=Math.max(m.left+4,n.x-P-2)),k+Y>m.bottom&&(k=Math.max(m.top+4,n.y-Y-2)),y<m.left+2&&(y=m.left+2),k<m.top+2&&(k=m.top+2)}return{left:y,top:k}}),c=e.computed(()=>n.hasImage),s=e.computed(()=>n.hasLink),u=e.computed(()=>n.hasNote),d=e.computed(()=>n.nodeMarkers.length>0),p=e.computed(()=>n.nodeTags.length>0),b=e.ref(!1);function C(){b.value=!b.value}function w(y){return n.nodeMarkers.includes(y)}function V(y){r("toggleMarker",y)}function R(y){const k=y.target;k&&k.closest(".zm-node-menu")||r("close")}function U(y){y.key==="Escape"&&r("close")}function I(){r("close")}window.addEventListener("mousedown",R,!0),window.addEventListener("keydown",U,!0),window.addEventListener("wheel",I,!0),window.addEventListener("scroll",I,!0),e.onBeforeUnmount(()=>{window.removeEventListener("mousedown",R,!0),window.removeEventListener("keydown",U,!0),window.removeEventListener("wheel",I,!0),window.removeEventListener("scroll",I,!0)});function _(y){y(),r("close")}return(y,k)=>(e.openBlock(),e.createElementBlock("div",{class:"zm-node-menu",style:e.normalizeStyle({left:a.value.left+"px",top:a.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=>_(()=>r("pickImage")),["stop"]))},[e.createVNode(ve,{name:"image",size:13}),e.createElementVNode("span",null,e.toDisplayString(c.value?"替换图片":"添加图片"),1)]),c.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-node-menu-item",onClick:k[1]||(k[1]=e.withModifiers(m=>_(()=>r("removeImage")),["stop"]))},[e.createVNode(ve,{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=>_(()=>r("setLink")),["stop"]))},[e.createVNode(ve,{name:"link",size:13}),e.createElementVNode("span",null,e.toDisplayString(s.value?"编辑链接":"添加链接"),1)]),s.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-node-menu-item",onClick:k[3]||(k[3]=e.withModifiers(m=>_(()=>r("removeLink")),["stop"]))},[e.createVNode(ve,{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=>_(()=>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=>_(()=>r("removeCode")),["stop"]))},[e.createVNode(ve,{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=>_(()=>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=>_(()=>r("removeTable")),["stop"]))},[e.createVNode(ve,{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=>_(()=>r("editNote")),["stop"]))},[e.createVNode(ve,{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=>_(()=>r("removeNote")),["stop"]))},[e.createVNode(ve,{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(C,["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",ms,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(ki),m=>(e.openBlock(),e.createElementBlock("div",{key:m.label,class:"zm-marker-group"},[e.createElementVNode("div",ps,e.toDisplayString(m.label),1),e.createElementVNode("div",hs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.markers,P=>(e.openBlock(),e.createElementBlock("button",{key:P.id,class:e.normalizeClass(["zm-marker-cell",{"is-active":w(P.id)}]),title:P.label,onClick:e.withModifiers(j=>V(P.id),["stop"]),innerHTML:'<svg viewBox="0 0 24 24" width="20" height="20">'+e.unref(Lo)(P.id)+"</svg>"},null,10,gs))),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=>_(()=>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(p.value?"编辑标签":"添加标签"),1)]),p.value?(e.openBlock(),e.createElementBlock("button",{key:6,class:"zm-node-menu-item",onClick:k[12]||(k[12]=e.withModifiers(m=>_(()=>r("removeTags")),["stop"]))},[e.createVNode(ve,{name:"x",size:13}),k[24]||(k[24]=e.createElementVNode("span",null,"移除标签",-1))])):e.createCommentVNode("",!0)],36))}}),ks=e.defineComponent({__name:"CanvasContextMenu",props:{x:{},y:{},container:{}},emits:["openSettings","openData","openImport","exportPng","exportSvg","close"],setup(t,{emit:o}){const n=t,r=o,a=e.computed(()=>{let _=n.x+2,y=n.y+2;if(n.container){const k=n.container.getBoundingClientRect(),m=160,P=4+4*28+5;_+m>k.right&&(_=Math.max(k.left+4,n.x-m-2)),y+P>k.bottom&&(y=Math.max(k.top+4,n.y-P-2)),_<k.left+2&&(_=k.left+2),y<k.top+2&&(y=k.top+2)}return{left:_,top:y}}),c=e.ref(null),s=e.ref(null),u=e.ref(null),d=e.computed(()=>{const _=c.value==="import"?s.value:c.value==="export"?u.value:null;if(!_)return{left:"-9999px",top:"-9999px",display:"none"};const y=_.getBoundingClientRect(),k=window.innerWidth,m=window.innerHeight,P=176,j=4+3*28;let Y=y.right;Y+P>k-4&&(Y=Math.max(4,y.left-P));let x=y.top-4;return x+j>m-4&&(x=Math.max(4,m-j-4)),{left:Y+"px",top:x+"px",display:"block"}});let p=null,b=null;function C(_){b&&(clearTimeout(b),b=null),p=setTimeout(()=>{c.value=_},60)}function w(){p&&(clearTimeout(p),p=null),b=setTimeout(()=>{c.value=null},120)}e.onBeforeUnmount(()=>{p&&clearTimeout(p),b&&clearTimeout(b)});function V(_){const y=_.target;y&&y.closest(".zm-canvas-menu")||r("close")}function R(_){_.key==="Escape"&&r("close")}function U(){r("close")}window.addEventListener("mousedown",V,!0),window.addEventListener("keydown",R,!0),window.addEventListener("wheel",U,!0),window.addEventListener("scroll",U,!0),e.onBeforeUnmount(()=>{window.removeEventListener("mousedown",V,!0),window.removeEventListener("keydown",R,!0),window.removeEventListener("wheel",U,!0),window.removeEventListener("scroll",U,!0)});function I(_){_(),r("close")}return(_,y)=>(e.openBlock(),e.createElementBlock("div",{class:"zm-canvas-menu",style:e.normalizeStyle({left:a.value.left+"px",top:a.value.top+"px"}),onContextmenu:y[11]||(y[11]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:y[0]||(y[0]=e.withModifiers(k=>I(()=>r("openData")),["stop"]))},[e.createVNode(ve,{name:"database",size:13,stroke:1.6}),y[12]||(y[12]=e.createElementVNode("span",null,"查看数据",-1))]),e.createElementVNode("div",{ref_key:"importItemRef",ref:s,class:e.normalizeClass(["zm-canvas-menu-item zm-canvas-menu-item-has-submenu",{"is-open":c.value==="import"}]),onMouseenter:y[5]||(y[5]=k=>C("import")),onMouseleave:w},[e.createVNode(ve,{name:"import",size:13,stroke:1.6}),y[16]||(y[16]=e.createElementVNode("span",null,"导入",-1)),y[17]||(y[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)),c.value==="import"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-canvas-submenu",style:e.normalizeStyle(d.value),onMouseenter:y[4]||(y[4]=k=>C("import")),onMouseleave:w},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:y[1]||(y[1]=e.withModifiers(k=>I(()=>r("openImport","markdown")),["stop"]))},[e.createVNode(ve,{name:"markdown",size:13,stroke:1.6}),y[13]||(y[13]=e.createElementVNode("span",null,"Markdown 导入",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:y[2]||(y[2]=e.withModifiers(k=>I(()=>r("openImport","json")),["stop"]))},[e.createVNode(ve,{name:"json",size:13,stroke:1.6}),y[14]||(y[14]=e.createElementVNode("span",null,"JSON 文件导入",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:y[3]||(y[3]=e.withModifiers(k=>I(()=>r("openImport","txt")),["stop"]))},[e.createVNode(ve,{name:"txt",size:13,stroke:1.6}),y[15]||(y[15]=e.createElementVNode("span",null,"TXT 文件导入",-1))])],36)):e.createCommentVNode("",!0)],34),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:y[6]||(y[6]=e.withModifiers(k=>I(()=>r("openSettings")),["stop"]))},[e.createVNode(ve,{name:"settings",size:13,stroke:1.6}),y[18]||(y[18]=e.createElementVNode("span",null,"设置",-1))]),y[23]||(y[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":c.value==="export"}]),onMouseenter:y[10]||(y[10]=k=>C("export")),onMouseleave:w},[e.createVNode(ve,{name:"export",size:13,stroke:1.6}),y[21]||(y[21]=e.createElementVNode("span",null,"导出",-1)),y[22]||(y[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)),c.value==="export"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-canvas-submenu",style:e.normalizeStyle(d.value),onMouseenter:y[9]||(y[9]=k=>C("export")),onMouseleave:w},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:y[7]||(y[7]=e.withModifiers(k=>I(()=>r("exportPng")),["stop"]))},[e.createVNode(ve,{name:"image",size:13,stroke:1.6}),y[19]||(y[19]=e.createElementVNode("span",null,"导出 PNG",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:y[8]||(y[8]=e.withModifiers(k=>I(()=>r("exportSvg")),["stop"]))},[e.createVNode(ve,{name:"svg-export",size:13,stroke:1.6}),y[20]||(y[20]=e.createElementVNode("span",null,"导出 SVG",-1))])],36)):e.createCommentVNode("",!0)],34)],36))}}),ys=["aria-hidden"],xs=["aria-hidden"],Es={key:0,class:"zm-drawer-header"},ws={key:0,class:"zm-drawer-title"},Ns={class:"zm-drawer-body"},Ss=["aria-hidden"],Ts={key:0,class:"zm-drawer-header"},Cs={key:0,class:"zm-drawer-title"},Ms={class:"zm-drawer-body"},Vt=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 a(){n("update:open",!1)}return(c,s)=>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:s[0]||(s[0]=u=>t.closeOnBackdrop&&a())},null,8,ys)):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||c.$slots.header?(e.openBlock(),e.createElementBlock("div",Es,[t.title?(e.openBlock(),e.createElementBlock("h3",ws,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.renderSlot(c.$slots,"header"),t.closable?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-drawer-close",title:"关闭",onClick:r},[...s[1]||(s[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",Ns,[e.renderSlot(c.$slots,"default")])],14,xs)):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||c.$slots.header?(e.openBlock(),e.createElementBlock("div",Ts,[t.title?(e.openBlock(),e.createElementBlock("h3",Cs,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.renderSlot(c.$slots,"header"),t.closable?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-drawer-close",title:"关闭",onClick:r},[...s[2]||(s[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",Ms,[e.renderSlot(c.$slots,"default")])],14,Ss)):e.createCommentVNode("",!0)]),_:3}))}}),As={class:"zm-outline-root"},_s={class:"zm-outline-search"},Rs={key:0,class:"zm-outline-search-count"},Bs={key:1,class:"zm-outline-search-count zm-outline-search-empty"},vs={class:"zm-outline-actions"},zs={width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Is={key:0,x:"9",y:"9",width:"13",height:"13",rx:"2"},Ls={key:1,d:"M5 12 L10 17 L19 7"},Os={class:"zm-outline"},Ds=["data-outline-id","onClick","onDblclick","onDragstart","onDragover","onDragleave","onDrop"],Vs=["title","onClick"],$s={width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round"},Ps={key:0,points:"6 9 12 15 18 9"},Fs={key:1,points:"9 6 15 12 9 18"},Us={key:1,class:"zm-outline-dot"},Hs={key:2,class:"zm-outline-index"},Ws={key:4,class:"zm-outline-text"},Gs=["onClick"],js=["onClick"],Ks=["src"],Ys=["onClick"],qs=["src"],Xs=["title","onClick"],Zs={width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Js={key:0,x:"9",y:"9",width:"13",height:"13",rx:"2"},Qs={key:1,d:"M5 12 L10 17 L19 7"},Oo=e.defineComponent({__name:"Outline",props:{data:{},selectedId:{default:null},collapsedIds:{default:()=>new Set},readonly:{type:Boolean,default:!1},showIndex:{type:Boolean,default:!1}},emits:["select","toggleCollapse","edit","addChild","addSibling","move"],setup(t,{emit:o}){const n=t,r=o,a=e.ref(""),c=e.ref(null),s=e.ref(-1),u=e.computed(()=>{const S=a.value.trim().toLowerCase();if(!S)return new Set;const F=new Set,W=te=>{var ye;(te.text.toLowerCase().includes(S)||(ye=te.note)!=null&&ye.text&&te.note.text.toLowerCase().includes(S))&&F.add(te.id);for(const nt of te.children)W(nt)};return W(n.data),F}),d=e.computed(()=>{if(u.value.size===0)return new Set;const S=new Set,F=W=>{let te=u.value.has(W.id);for(const ye of W.children)F(ye)&&(te=!0);return te&&S.add(W.id),te};return F(n.data),S}),p=e.computed(()=>{const S=[],F=W=>{u.value.has(W.id)&&S.push(W.id);for(const te of W.children)F(te)};return F(n.data),S}),b=e.computed(()=>a.value.trim().length>0),C=e.computed(()=>{const S=[],F=d.value,W=(te,ye,nt)=>{if(b.value&&!F.has(te.id))return;const ft=te.children.length>0,ot=b.value?!1:n.collapsedIds.has(te.id);S.push({id:te.id,text:te.text||"(无标题)",depth:ye,siblingIndex:nt,hasChildren:ft,collapsed:ot,node:te}),ft&&!ot&&te.children.forEach((an,it)=>W(an,ye+1,it))};return W(n.data,0,0),S});function w(){s.value=p.value.length>0?0:-1}function V(){const S=p.value;S.length!==0&&(s.value=(s.value+1)%S.length,I(s.value))}function R(){const S=p.value;S.length!==0&&(s.value=(s.value-1+S.length)%S.length,I(s.value))}function U(S){S.key==="Enter"?(S.preventDefault(),S.shiftKey?R():V()):S.key==="Escape"&&(S.preventDefault(),a.value="",s.value=-1)}function I(S){const F=p.value[S];if(!F)return;const W=C.value.find(te=>te.id===F);W&&r("select",W.node),e.nextTick(()=>{const te=document.querySelector(`[data-outline-id="${F}"]`);te==null||te.scrollIntoView({block:"nearest",behavior:"smooth"})})}function _(){a.value="",s.value=-1}e.onMounted(()=>{e.nextTick(()=>{var S;return(S=c.value)==null?void 0:S.focus()})});const y=e.ref(null),k=e.ref("");let m=null;function P(S){n.readonly||(y.value=S.id,k.value=S.text,e.nextTick(()=>{m=document.querySelector(".zm-outline-input"),m==null||m.focus(),m==null||m.select()}))}function j(){y.value!=null&&(r("edit",{id:y.value,text:k.value.trim()||"(无标题)"}),Y())}function Y(){y.value=null,k.value="",m=null}function x(S){S.key==="Enter"?(S.preventDefault(),j()):S.key==="Escape"&&(S.preventDefault(),Y())}e.onBeforeUnmount(Y);const re=e.ref(null),pe=e.ref(null),de=e.ref(null);function we(S,F){if(n.readonly){S.preventDefault();return}re.value={id:F.id,text:F.text},S.dataTransfer&&(S.dataTransfer.effectAllowed="move",S.dataTransfer.setData("text/plain",F.id))}function ee(){re.value=null,pe.value=null,de.value=null}function ce(S,F){if(!re.value)return;S.preventDefault(),S.dataTransfer&&(S.dataTransfer.dropEffect="move");const W=$(S);pe.value=F.id,de.value=W}function ue(S){pe.value===S.id&&(pe.value=null,de.value=null)}function h(S,F){S.preventDefault();const W=re.value;if(!W)return;const te=$(S);W.id!==F.id&&r("move",{srcId:W.id,targetId:F.id,position:te}),ee()}function $(S,F){const te=S.currentTarget.getBoundingClientRect(),ye=S.clientY-te.top,nt=te.height;return ye<nt*.3?"before":ye>nt*.7?"after":"child"}const G=e.ref(null);let oe=null;async function fe(S){try{return await navigator.clipboard.writeText(S),!0}catch{const F=document.createElement("textarea");F.value=S,document.body.appendChild(F),F.select();let W=!1;try{W=document.execCommand("copy")}finally{document.body.removeChild(F)}return W}}async function O(S,F,W){S.stopPropagation(),await fe(F)&&(G.value=W,oe&&clearTimeout(oe),oe=setTimeout(()=>G.value=null,1200))}const L=e.computed(()=>{const S=[],F=(W,te)=>{const ye=" ".repeat(te),nt=te===0?"":"- ";S.push(ye+nt+(W.text||""));for(const ft of W.children)F(ft,te+1)};return F(n.data,0),S.join(`
16
- `)}),se=e.ref(!1);let ke=null;async function z(){await fe(L.value)&&(se.value=!0,ke&&clearTimeout(ke),ke=setTimeout(()=>se.value=!1,1200))}return(S,F)=>(e.openBlock(),e.createElementBlock("div",As,[e.createElementVNode("div",_s,[F[3]||(F[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:c,"onUpdate:modelValue":F[0]||(F[0]=W=>a.value=W),type:"text",class:"zm-outline-search-input",placeholder:"搜索节点… (Enter 下一个, Shift+Enter 上一个)",onInput:w,onKeydown:U},null,544),[[e.vModelText,a.value]]),p.value.length>0?(e.openBlock(),e.createElementBlock("span",Rs,e.toDisplayString(s.value+1)+"/"+e.toDisplayString(p.value.length),1)):b.value?(e.openBlock(),e.createElementBlock("span",Bs,"无结果")):e.createCommentVNode("",!0),a.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-outline-search-clear",title:"清除搜索",onClick:_},"×")):e.createCommentVNode("",!0)]),e.createElementVNode("div",vs,[e.createElementVNode("button",{class:e.normalizeClass(["zm-outline-action-btn",{"is-success":se.value}]),title:"复制完整大纲为纯文本",onClick:z},[(e.openBlock(),e.createElementBlock("svg",zs,[se.value?(e.openBlock(),e.createElementBlock("path",Ls)):(e.openBlock(),e.createElementBlock("rect",Is)),F[4]||(F[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(se.value?"已复制":"复制大纲"),1)],2)]),e.createElementVNode("ul",Os,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.value,W=>(e.openBlock(),e.createElementBlock("li",{key:W.id,"data-outline-id":W.id,class:e.normalizeClass(["zm-outline-row",{"is-selected":W.id===t.selectedId,"is-root":W.depth===0,"is-editing":y.value===W.id,"is-search-hit":u.value.has(W.id),"is-search-current":p.value[s.value]===W.id,"is-drag-over-before":pe.value===W.id&&de.value==="before","is-drag-over-after":pe.value===W.id&&de.value==="after","is-drag-over-child":pe.value===W.id&&de.value==="child"}]),style:e.normalizeStyle({paddingLeft:12+W.depth*16+"px"}),draggable:"true",onClick:te=>r("select",W.node),onDblclick:te=>P(W),onDragstart:te=>we(te,W),onDragend:ee,onDragover:te=>ce(te,W),onDragleave:()=>ue(W),onDrop:te=>h(te,W)},[W.hasChildren?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-outline-toggle",title:W.collapsed?"展开":"折叠",onClick:e.withModifiers(te=>r("toggleCollapse",W.id),["stop"])},[(e.openBlock(),e.createElementBlock("svg",$s,[W.collapsed?(e.openBlock(),e.createElementBlock("polyline",Fs)):(e.openBlock(),e.createElementBlock("polyline",Ps))]))],8,Vs)):(e.openBlock(),e.createElementBlock("span",Us)),n.showIndex?(e.openBlock(),e.createElementBlock("span",Hs,e.toDisplayString(W.siblingIndex+1)+".",1)):e.createCommentVNode("",!0),y.value===W.id?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:3,"onUpdate:modelValue":F[1]||(F[1]=te=>k.value=te),class:"zm-outline-input",onBlur:j,onKeydown:x,onClick:F[2]||(F[2]=e.withModifiers(()=>{},["stop"]))},null,544)),[[e.vModelText,k.value]]):(e.openBlock(),e.createElementBlock("span",Ws,e.toDisplayString(W.text),1)),n.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:5,class:"zm-outline-row-action",title:"编辑文字",onClick:e.withModifiers(te=>P(W),["stop"])},[...F[5]||(F[5]=[e.createElementVNode("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M4 20 l4 -1 11 -11 -3 -3 -11 11 z"}),e.createElementVNode("line",{x1:"14",y1:"6",x2:"18",y2:"10"})],-1)])],8,Gs)),n.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:6,class:"zm-outline-row-action",title:"添加同级",onClick:e.withModifiers(te=>r("addSibling",W.id),["stop"])},[e.createElementVNode("img",{src:e.unref(sr),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,Ks)],8,js)),n.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:7,class:"zm-outline-row-action",title:"添加子节点",onClick:e.withModifiers(te=>r("addChild",W.id),["stop"])},[e.createElementVNode("img",{src:e.unref(cr),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,qs)],8,Ys)),e.createElementVNode("button",{class:e.normalizeClass(["zm-outline-row-copy",{"is-success":G.value===W.id}]),title:G.value===W.id?"已复制":"复制节点文本",onClick:te=>O(te,W.text,W.id)},[(e.openBlock(),e.createElementBlock("svg",Zs,[G.value!==W.id?(e.openBlock(),e.createElementBlock("rect",Js)):(e.openBlock(),e.createElementBlock("path",Qs)),F[6]||(F[6]=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,Xs)],46,Ds))),128))])]))}}),ec={key:0,class:"zm-jtv-root"},tc={key:0,class:"zm-jtv-key"},nc={key:1,class:"zm-jtv-colon"},oc={key:2,class:"zm-jtv-key zm-jtv-bracket"},ic={key:3,class:"zm-jtv-size"},rc={key:4,class:"zm-jtv-bracket"},lc={key:5,class:"zm-jtv-brace"},ac={key:0,class:"zm-jtv-children"},sc={class:"zm-jtv-key"},cc={key:0,class:"zm-jtv-key"},dc=["src","alt"],uc=["href"],fc=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"),a=e.computed(()=>n.value==="array");e.computed(()=>!r.value&&!a.value);const c=e.computed(()=>{if(a.value)return`Array(${o.value.length})`;if(r.value){const y=o.value,k=Object.keys(y);return`Object(${k.length} ${k.length===1?"key":"keys"})`}return""}),s=e.computed(()=>a.value?o.value.map((y,k)=>({key:String(k),value:y})):r.value?Object.entries(o.value).map(([y,k])=>({key:y,value:k})):[]),u=e.computed(()=>o.isRoot?"<root>":o.path),d=e.computed(()=>o.collapsedPaths.has(u.value));function p(y,k,m){y!=="<root>"&&(m<2||k===null||typeof k!="object"||o.collapsedPaths.has(y)||o.collapsedPaths.add(y))}o.isRoot||p(u.value,o.value,o.depth);function b(){d.value?o.collapsedPaths.delete(u.value):o.collapsedPaths.add(u.value)}function C(y){return u.value===""?y:`${u.value}.${y}`}function w(y){if(!o.query)return!0;const k=o.query.toLowerCase();return typeof y=="string"?y.toLowerCase().includes(k):y===null?"null".includes(k):String(y).toLowerCase().includes(k)}function V(y){return o.query?y.toLowerCase().includes(o.query.toLowerCase()):!0}function R(y,k){return!o.query||V(y)?!0:k===null||typeof k!="object"?w(k):!0}function U(y){return y===null?"null":typeof y=="string"?y.length>80?`"${y.slice(0,80)}..."`:`"${y}"`:typeof y=="boolean"?y?"true":"false":typeof y=="number"?String(y):typeof y>"u"?"undefined":JSON.stringify(y)}function I(y){if(typeof y!="string")return!1;const k=y.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 _(y){if(!o.query)return null;const k=y.toLowerCase().indexOf(o.query.toLowerCase());return k<0?null:{before:y.slice(0,k),match:y.slice(k,k+o.query.length),after:y.slice(k+o.query.length)}}return(y,k)=>{var P,j,Y,x,re,pe;const m=e.resolveComponent("JsonTreeViewer",!0);return t.isRoot?(e.openBlock(),e.createElementBlock("div",ec,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,de=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:de.key,class:"zm-jtv-row"},[e.createVNode(m,{"key-name":de.key,value:de.value,path:C(de.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,R(de.key,de.value)]])),128))])):r.value||a.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),a.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",tc,e.toDisplayString(t.keyName),1)),a.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",nc,":")),a.value?(e.openBlock(),e.createElementBlock("span",oc,"[")):e.createCommentVNode("",!0),d.value?(e.openBlock(),e.createElementBlock("span",ic,e.toDisplayString(c.value),1)):e.createCommentVNode("",!0),d.value&&a.value?(e.openBlock(),e.createElementBlock("span",rc,"]")):e.createCommentVNode("",!0),d.value&&r.value?(e.openBlock(),e.createElementBlock("span",lc,"}")):e.createCommentVNode("",!0)],4),d.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ac,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,de=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:de.key,class:"zm-jtv-row"},[e.createVNode(m,{"key-name":de.key,value:de.value,path:C(de.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,R(de.key,de.value)]])),128))])),!d.value&&a.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&&!a.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",sc,e.toDisplayString(t.keyName),1),k[3]||(k[3]=e.createElementVNode("span",{class:"zm-jtv-colon"},":",-1)),V(t.keyName)&&_(t.keyName)?(e.openBlock(),e.createElementBlock("span",cc,[e.createElementVNode("span",null,e.toDisplayString((P=_(t.keyName))==null?void 0:P.before),1),e.createElementVNode("mark",null,e.toDisplayString((j=_(t.keyName))==null?void 0:j.match),1),e.createElementVNode("span",null,e.toDisplayString((Y=_(t.keyName))==null?void 0:Y.after),1)])):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(["zm-jtv-value",`zm-jtv-${n.value}`])},[_(U(t.value))?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("span",null,e.toDisplayString((x=_(U(t.value)))==null?void 0:x.before),1),e.createElementVNode("mark",null,e.toDisplayString((re=_(U(t.value)))==null?void 0:re.match),1),e.createElementVNode("span",null,e.toDisplayString((pe=_(U(t.value)))==null?void 0:pe.after),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(U(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,dc),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,uc)])):e.createCommentVNode("",!0)],4))}}}),mc={class:"zm-data-panel"},pc={class:"zm-data-header"},hc={class:"zm-data-title"},gc={class:"zm-data-title-meta"},bc={class:"zm-data-toolbar"},kc=["title"],yc={key:0,width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},xc={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"},Ec={key:0,class:"zm-data-paste"},wc={class:"zm-data-tabs"},Nc=["placeholder"],Sc={key:0,class:"zm-data-error"},Tc={class:"zm-data-paste-actions"},Cc=["disabled"],Mc={class:"zm-data-tree"},Do=e.defineComponent({__name:"DataPanel",props:{data:{},pendingMode:{default:null}},emits:["import","consumed-mode"],setup(t,{emit:o}){const n=t,r=o,a=e.computed(()=>JSON.stringify(n.data,null,2)),c=e.ref(""),s=e.ref(null),u=e.ref(!1),d=e.ref("json"),p=e.ref("idle"),b=e.ref(new Set),C=e.ref("");e.watch(()=>n.pendingMode,k=>{k&&(u.value=!0,d.value=k,r("consumed-mode"))},{immediate:!0});async function w(){try{await navigator.clipboard.writeText(a.value),p.value="copied",setTimeout(()=>p.value="idle",1500)}catch{const k=document.createElement("textarea");k.value=a.value,document.body.appendChild(k),k.select();try{document.execCommand("copy"),p.value="copied",setTimeout(()=>p.value="idle",1500)}finally{document.body.removeChild(k)}}}function V(){const k=new Blob([a.value],{type:"application/json"}),m=URL.createObjectURL(k),P=document.createElement("a");P.href=m,P.download=`${n.data.text||"mindmap"}.json`,P.click(),URL.revokeObjectURL(m)}function R(){s.value=null;const k=c.value.trim();if(k){if(d.value==="markdown"||d.value==="txt"){try{const m=On(k);r("import",m),c.value="",u.value=!1}catch(m){s.value=(d.value==="txt"?"TXT 解析失败:":"Markdown 解析失败:")+m.message}return}try{const m=JSON.parse(k);if(!m.id||!Array.isArray(m.children)){s.value="JSON 缺少 id 或 children 字段";return}r("import",m),c.value="",u.value=!1}catch(m){s.value="JSON 解析失败:"+m.message}}}function U(k){return 1+k.children.reduce((m,P)=>m+U(P),0)}const I=e.computed(()=>U(n.data)),_=e.computed(()=>a.value.length);function y(){const k=document.createElement("input");k.type="file",k.accept="application/json",k.onchange=()=>{var j;const m=(j=k.files)==null?void 0:j[0];if(!m)return;const P=new FileReader;P.onload=()=>{typeof P.result=="string"&&(c.value=P.result,R())},P.readAsText(m)},k.click()}return(k,m)=>(e.openBlock(),e.createElementBlock("div",mc,[e.createElementVNode("div",pc,[e.createElementVNode("div",hc,[m[8]||(m[8]=e.createElementVNode("span",{class:"zm-data-title-text"},"数据 JSON",-1)),e.createElementVNode("span",gc,e.toDisplayString(I.value)+" 节点 · "+e.toDisplayString(_.value)+" chars",1)])]),e.createElementVNode("div",bc,[e.createElementVNode("button",{class:e.normalizeClass(["zm-data-btn is-icon",{"is-success":p.value==="copied"}]),title:p.value==="copied"?"已复制":"复制 JSON 到剪贴板",onClick:w},[p.value==="idle"?(e.openBlock(),e.createElementBlock("svg",yc,[...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",xc,[...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,kc),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:y},[...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]=P=>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":C.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]=P=>C.value=P),type:"text",placeholder:"过滤 (键 / 值)",spellcheck:"false"},null,512),[[e.vModelText,C.value]]),C.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-data-search-clear",title:"清空过滤",onClick:m[2]||(m[2]=P=>C.value="")},"×")):e.createCommentVNode("",!0)],2)]),u.value?(e.openBlock(),e.createElementBlock("div",Ec,[e.createElementVNode("div",wc,[e.createElementVNode("button",{class:e.normalizeClass(["zm-data-tab",{"is-active":d.value==="json"}]),onClick:m[3]||(m[3]=P=>d.value="json")},"JSON",2),e.createElementVNode("button",{class:e.normalizeClass(["zm-data-tab",{"is-active":d.value==="markdown"}]),onClick:m[4]||(m[4]=P=>d.value="markdown")},"Markdown",2)]),e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":m[5]||(m[5]=P=>c.value=P),placeholder:d.value==="json"?"paste a JSON tree to replace current data":"paste markdown - # / ## / ### become nodes",spellcheck:"false"},null,8,Nc),[[e.vModelText,c.value]]),s.value?(e.openBlock(),e.createElementBlock("div",Sc,e.toDisplayString(s.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Tc,[e.createElementVNode("button",{class:"zm-data-btn is-primary",disabled:!c.value,onClick:R},"应用",8,Cc),e.createElementVNode("button",{class:"zm-data-btn",onClick:m[6]||(m[6]=P=>{c.value="",s.value=null})},"清空"),e.createElementVNode("button",{class:"zm-data-btn",onClick:m[7]||(m[7]=P=>u.value=!1)},"关闭")])])):e.createCommentVNode("",!0),e.createElementVNode("div",Mc,[e.createVNode(fc,{value:t.data,query:C.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))]))}}),Ac={class:"zm-md-panel"},_c={key:0,class:"zm-md-error"},Rc={class:"zm-md-split"},Bc={class:"zm-md-edit"},vc={class:"zm-md-preview"},zc={class:"zm-md-preview-body"},Ic={class:"zm-md-footer"},Lc=["disabled"],Oc=`# flow-mindmap 思维导图
9
+ `);for(const r of t.children)n+=Hn(r,o+1);return n}function vs(t){var h,b;const o=t.split(/\r?\n/),n=[];let r=0;const a=/^(#{1,6})\s+(.+?)\s*#*\s*$/,c=/^(`{3,}|~{3,})\s*(\S+)?\s*$/,s=/^\s*\|?\s*(:?-+:?\s*\|\s*)+(:?-+:?)(\s*\|)?\s*$/,m=/^(\s*)[-*+]\s+(.*)$/,d=/^(\s*)\d+\.\s+(.*)$/;for(;r<o.length;){const A=o[r],C=A.match(c);if(C){const y=C[1][0],p=C[2]||"",P=[A];for(r++;r<o.length;){const q=o[r].match(c);if(q&&q[1][0]===y){P.push(o[r]),r++;break}P.push(o[r]),r++}const Y=P.slice(1,-1).join(`
10
+ `).trim();n.push({kind:"code",text:((h=Y.split(`
11
+ `)[0])==null?void 0:h.slice(0,80))||"(空代码块)",raw:P.join(`
12
+ `),lang:p});continue}const $=A.match(a);if($){n.push({kind:"heading",level:$[1].length,text:$[2].trim(),raw:A}),r++;continue}if(/^\s*\|/.test(A)){const y=[];let p=r,P=!1;for(;p<o.length&&/^\s*\|/.test(o[p]);)y.push(o[p]),s.test(o[p])&&(P=!0),p++;if(P&&y.length>=2){n.push({kind:"table",text:((b=y[0].replace(/^\s*\|/,"").replace(/\|\s*$/,"").split("|")[0])==null?void 0:b.trim())||"表格",raw:y.join(`
13
+ `)}),r=p;continue}}const R=A.match(m),U=A.match(d);if(R||U){let y=r;for(;y<o.length;){const p=o[y].match(m),P=o[y].match(d);if(!(p||P))break;const Y=o[y].replace(/^\s*[-*+]\s+/,"").replace(/^\s*\d+\.\s+/,"").trim();Y.length>0&&n.push({kind:"list",text:Y.slice(0,80)||"(列表项)",raw:o[y]}),y++}r=y;continue}if(A.trim()===""){r++;continue}const I=[A];let v=r+1;for(;v<o.length;){const y=o[v];if(y.trim()===""||a.test(y)||c.test(y)||m.test(y)||d.test(y)||/^\s*\|/.test(y))break;I.push(y),v++}const w=I.join(" ").trim();n.push({kind:"paragraph",text:w.slice(0,80)||"(空段落)",raw:I.join(`
14
+ `)}),r=v}return n}function Rs(t,o="导入的导图"){const n=vs(t||""),r={id:Kt(),text:o,children:[]},a=[r],c=[0];let s=!1;function m(d){if(d.kind==="heading"){const b=d.level;for(;a.length>1&&c[c.length-1]>=b;)a.pop(),c.pop();if(!s&&b===1){s=!0,r.text=d.text,c[0]=1;return}const A={id:Kt(),text:d.text,children:[]};a[a.length-1].children.push(A),a.push(A),c.push(b);return}const h={id:Kt(),text:d.text,children:[],richContent:{kind:d.kind,raw:d.raw,lang:d.lang}};a[a.length-1].children.push(h)}for(const d of n)m(d);return r}function Bs(t){return t.richContent?t.richContent.raw+`
15
+ `:""}function zs(t){const o=t.minScale??.2,n=t.maxScale??1/0,r=t.step??1.2,a=e.ref(1),c=e.ref(0),s=e.ref(0),m=e.ref(!1),d=e.ref(!1),h=e.reactive({x:0,y:0,ox:0,oy:0}),b=e.ref(!1),A=e.reactive({x:0,y:0}),C=e.reactive({x:0,y:0,width:0,height:0}),$=e.ref(0);let R=null;function U(te){R=te}function I(te){te.preventDefault();const de=t.getContainer();if(!de)return;const fe=-te.deltaY*.001,g=Math.min(n,Math.max(o,a.value*(1+fe))),V=de.getBoundingClientRect(),G=te.clientX-V.left,le=te.clientY-V.top,me=(G-c.value)/a.value,O=(le-s.value)/a.value;a.value=g,c.value=G-me*g,s.value=le-O*g}function v(){a.value=Math.min(n,a.value*r)}function w(){a.value=Math.max(o,a.value/r)}function y(te){var fe;te.target.closest(".zm-node, .zm-toolbar, button, input, textarea")||(m.value=!0,d.value=!1,h.x=te.clientX,h.y=te.clientY,h.ox=c.value,h.oy=s.value,window.addEventListener("mousemove",p),window.addEventListener("mouseup",P),(fe=te.preventDefault)==null||fe.call(te))}function p(te){if(!m.value)return;const de=te.clientX-h.x,fe=te.clientY-h.y;(Math.abs(de)>3||Math.abs(fe)>3)&&(d.value=!0),c.value=h.ox+de,s.value=h.oy+fe}function P(){m.value=!1,window.removeEventListener("mousemove",p),window.removeEventListener("mouseup",P)}function Y(te,de,fe){b.value=!0,A.x=te,A.y=de,C.x=te,C.y=de,C.width=0,C.height=0,C.shiftKey=!!(fe!=null&&fe.shift),$.value++,window.addEventListener("mousemove",ae),window.addEventListener("mouseup",N)}function q(te,de){if(!b.value)return;const fe=Math.min(A.x,te),g=Math.min(A.y,de),V=Math.max(A.x,te),G=Math.max(A.y,de);C.x=fe,C.y=g,C.width=V-fe,C.height=G-g,$.value++}function N(){b.value=!1,window.removeEventListener("mousemove",ae),window.removeEventListener("mouseup",N),R&&R()}function ae(te){if(!b.value)return;const de=t.getContainer();if(!de)return;const fe=de.getBoundingClientRect(),g=(te.clientX-fe.left-c.value)/a.value,V=(te.clientY-fe.top-s.value)/a.value;q(g,V)}function ge(te,de,fe,g=60){const V=t.getContainer();if(!V)return;const G=V.getBoundingClientRect(),le=(G.width-g*2)/te,me=(G.height-g*2)/de,O=Math.min(1,Math.max(.3,Math.min(le,me)));a.value=O,c.value=G.width/2,s.value=G.height/2-fe*O}function ue(){const te=t.getContainer();if(!te)return;const de=te.getBoundingClientRect(),fe=de.width/2,g=de.height/2,V=(fe-c.value)/a.value,G=(g-s.value)/a.value;a.value=1,c.value=fe-V,s.value=g-G}function we(te,de,fe,g,V=80){const G=t.getContainer();if(!G)return;const le=G.getBoundingClientRect();let me=a.value;(fe*me<40||g*me<40)&&(me=Math.min(n,Math.max(1,60/Math.min(fe,g)))),a.value=me,c.value=le.width/2-te*me,s.value=le.height/2-de*me}return{scale:a,offsetX:c,offsetY:s,isPanning:m,panMoved:d,onWheel:I,zoomIn:v,zoomOut:w,zoomTo100:ue,startPan:y,startMarquee:Y,updateMarquee:q,isMarquee:b,marquee:C,marqueeVersion:$,setOnMarqueeEnd:U,resetView:ge,centerOn:we}}const Is=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform);function Or(t){return Is?t.metaKey:t.ctrlKey}function Ls(t){function o(){const r=t.getSelectedId();if(r)return r;if(t.defaultTargetId)return t.defaultTargetId();const a=t.getSelectedIds();return a.length>0?a[0]:null}function n(r){var m,d,h;const a=r.target;if(a&&(a.tagName==="INPUT"||a.tagName==="TEXTAREA"||a.isContentEditable)||t.isReadonly()||t.isEditing())return;const c=t.getSelectedId(),s=o();if(s){if(Or(r)&&!r.shiftKey){if(r.key==="d"||r.key==="D"){const b=(m=t.defaultTargetId)==null?void 0:m.call(t);c&&c!==b&&(r.preventDefault(),t.onDuplicate(c));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(Or(r)&&r.shiftKey&&(r.key==="Z"||r.key==="z")){r.preventDefault(),t.onRedo();return}if(r.key==="Tab")r.preventDefault(),t.onAddChild(s);else if(r.key==="Enter")if(r.preventDefault(),r.shiftKey){const b=(d=t.defaultTargetId)==null?void 0:d.call(t);c&&c!==b&&t.onAddSiblingBefore(c)}else t.onAddSibling(s);else if((r.key==="Delete"||r.key==="Backspace")&&c&&c!==((h=t.defaultTargetId)==null?void 0:h.call(t)))r.preventDefault(),t.onRemove(c);else if(r.key==="F2"&&c)r.preventDefault(),t.onStartEdit(c);else if(r.key===" "&&c)r.preventDefault(),t.onStartEdit(c);else if(r.key==="Escape")r.preventDefault(),t.onClearSelection();else if(r.altKey&&!r.ctrlKey&&!r.metaKey&&!r.shiftKey){if(r.key==="ArrowUp"){r.preventDefault(),t.onMoveSibling(-1);return}else if(r.key==="ArrowDown"){r.preventDefault(),t.onMoveSibling(1);return}}else 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 Os(t=100){const o=e.ref([]);let n=-1;function r(){return n>0}function a(){return n<o.value.length-1}function c(h){const b=JSON.stringify(h);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 s(){return r()?(n--,JSON.parse(o.value[n])):null}function m(){return a()?(n++,JSON.parse(o.value[n])):null}function d(){o.value=[],n=-1}return{canUndo:r,canRedo:a,record:c,undo:s,redo:m,reset:d}}const Vs={1:"#ef4444",2:"#f97316",3:"#f59e0b",4:"#eab308",5:"#84cc16",6:"#22c55e",7:"#14b8a6",8:"#3b82f6",9:"#6366f1"},Ds={label:"优先级",markers:Array.from({length:9},(t,o)=>{const n=o+1,r=Vs[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 $s(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 Ps={label:"进度",markers:[0,25,50,75,100].map(t=>({id:`progress-${t}`,label:`进度 ${t}%`,svg:$s(t)}))},Fs={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"/>`}))},Ti=[Ds,Ps,Fs,{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"/>'}]}],Uo={};for(const t of Ti)for(const o of t.markers)Uo[o.id]=o;function Us(t){return Uo[t]}function Ho(t){var o;return((o=Uo[t])==null?void 0:o.svg)??""}function Vr(t){var o;return((o=Uo[t])==null?void 0:o.label)??t}function Mi(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 Hs={key:5,class:"zm-marker-picker"},Ws={class:"zm-marker-group-label"},Gs={class:"zm-marker-grid"},js=["title","onClick","innerHTML"],Ks=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","addRelation","close"],setup(t,{emit:o}){const n=t,r=o,a=e.computed(()=>{let w=n.x+2,y=n.y+2;if(n.container){const p=n.container.getBoundingClientRect(),P=180,q=4+(3+(n.hasImage?1:0)+(n.hasLink?1:0)+(n.hasNote?1:0)+1+(n.hasCode?1:0)+1+(n.hasTable?1:0)+1+(n.nodeTags.length>0?1:0)+1)*28;w+P>p.right&&(w=Math.max(p.left+4,n.x-P-2)),y+q>p.bottom&&(y=Math.max(p.top+4,n.y-q-2)),w<p.left+2&&(w=p.left+2),y<p.top+2&&(y=p.top+2)}return{left:w,top:y}}),c=e.computed(()=>n.hasImage),s=e.computed(()=>n.hasLink),m=e.computed(()=>n.hasNote),d=e.computed(()=>n.nodeMarkers.length>0),h=e.computed(()=>n.nodeTags.length>0),b=e.ref(!1);function A(){b.value=!b.value}function C(w){return n.nodeMarkers.includes(w)}function $(w){r("toggleMarker",w)}function R(w){const y=w.target;y&&y.closest(".zm-node-menu")||r("close")}function U(w){w.key==="Escape"&&r("close")}function I(){r("close")}window.addEventListener("mousedown",R,!0),window.addEventListener("keydown",U,!0),window.addEventListener("wheel",I,!0),window.addEventListener("scroll",I,!0),e.onBeforeUnmount(()=>{window.removeEventListener("mousedown",R,!0),window.removeEventListener("keydown",U,!0),window.removeEventListener("wheel",I,!0),window.removeEventListener("scroll",I,!0)});function v(w){w(),r("close")}return(w,y)=>(e.openBlock(),e.createElementBlock("div",{class:"zm-node-menu",style:e.normalizeStyle({left:a.value.left+"px",top:a.value.top+"px"}),onContextmenu:y[14]||(y[14]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("button",{class:"zm-node-menu-item",onClick:y[0]||(y[0]=e.withModifiers(p=>v(()=>r("pickImage")),["stop"]))},[e.createVNode(Re,{name:"image",size:13}),e.createElementVNode("span",null,e.toDisplayString(c.value?"替换图片":"添加图片"),1)]),c.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-node-menu-item",onClick:y[1]||(y[1]=e.withModifiers(p=>v(()=>r("removeImage")),["stop"]))},[e.createVNode(Re,{name:"x",size:13}),y[15]||(y[15]=e.createElementVNode("span",null,"移除图片",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:y[2]||(y[2]=e.withModifiers(p=>v(()=>r("setLink")),["stop"]))},[e.createVNode(Re,{name:"link",size:13}),e.createElementVNode("span",null,e.toDisplayString(s.value?"编辑链接":"添加链接"),1)]),s.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-node-menu-item",onClick:y[3]||(y[3]=e.withModifiers(p=>v(()=>r("removeLink")),["stop"]))},[e.createVNode(Re,{name:"x",size:13}),y[16]||(y[16]=e.createElementVNode("span",null,"移除链接",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:y[4]||(y[4]=e.withModifiers(p=>v(()=>r("addCode")),["stop"]))},[y[17]||(y[17]=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:y[5]||(y[5]=e.withModifiers(p=>v(()=>r("removeCode")),["stop"]))},[e.createVNode(Re,{name:"x",size:13}),y[18]||(y[18]=e.createElementVNode("span",null,"移除代码块",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:y[6]||(y[6]=e.withModifiers(p=>v(()=>r("addTable")),["stop"]))},[y[19]||(y[19]=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:y[7]||(y[7]=e.withModifiers(p=>v(()=>r("removeTable")),["stop"]))},[e.createVNode(Re,{name:"x",size:13}),y[20]||(y[20]=e.createElementVNode("span",null,"移除表格",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:y[8]||(y[8]=e.withModifiers(p=>v(()=>r("editNote")),["stop"]))},[e.createVNode(Re,{name:"note",size:13}),e.createElementVNode("span",null,e.toDisplayString(m.value?"编辑笔记":"添加笔记"),1)]),m.value?(e.openBlock(),e.createElementBlock("button",{key:4,class:"zm-node-menu-item",onClick:y[9]||(y[9]=e.withModifiers(p=>v(()=>r("removeNote")),["stop"]))},[e.createVNode(Re,{name:"x",size:13}),y[21]||(y[21]=e.createElementVNode("span",null,"移除笔记",-1))])):e.createCommentVNode("",!0),y[27]||(y[27]=e.createElementVNode("div",{class:"zm-node-menu-divider"},null,-1)),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:e.withModifiers(A,["stop"])},[y[22]||(y[22]=e.createElementVNode("span",{class:"zm-node-menu-icon","aria-hidden":"true"},"⚑",-1)),y[23]||(y[23]=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",Hs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(Ti),p=>(e.openBlock(),e.createElementBlock("div",{key:p.label,class:"zm-marker-group"},[e.createElementVNode("div",Ws,e.toDisplayString(p.label),1),e.createElementVNode("div",Gs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.markers,P=>(e.openBlock(),e.createElementBlock("button",{key:P.id,class:e.normalizeClass(["zm-marker-cell",{"is-active":C(P.id)}]),title:P.label,onClick:e.withModifiers(Y=>$(P.id),["stop"]),innerHTML:'<svg viewBox="0 0 24 24" width="20" height="20">'+e.unref(Ho)(P.id)+"</svg>"},null,10,js))),128))])]))),128)),d.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-marker-clear",onClick:y[10]||(y[10]=e.withModifiers(p=>r("clearMarkers"),["stop"]))}," 清除所有标记 ")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:y[11]||(y[11]=e.withModifiers(p=>v(()=>r("addTag")),["stop"]))},[y[24]||(y[24]=e.createElementVNode("span",{class:"zm-node-menu-icon","aria-hidden":"true"},"#",-1)),e.createElementVNode("span",null,e.toDisplayString(h.value?"编辑标签":"添加标签"),1)]),h.value?(e.openBlock(),e.createElementBlock("button",{key:6,class:"zm-node-menu-item",onClick:y[12]||(y[12]=e.withModifiers(p=>v(()=>r("removeTags")),["stop"]))},[e.createVNode(Re,{name:"x",size:13}),y[25]||(y[25]=e.createElementVNode("span",null,"移除标签",-1))])):e.createCommentVNode("",!0),y[28]||(y[28]=e.createElementVNode("div",{class:"zm-node-menu-divider"},null,-1)),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:y[13]||(y[13]=e.withModifiers(p=>v(()=>r("addRelation")),["stop"]))},[e.createVNode(Re,{name:"relation",size:13}),y[26]||(y[26]=e.createElementVNode("span",null,"添加联系",-1))])],36))}}),Ys=e.defineComponent({__name:"CanvasContextMenu",props:{x:{},y:{},container:{}},emits:["openSettings","openData","openImport","exportPng","exportSvg","close"],setup(t,{emit:o}){const n=t,r=o,a=e.computed(()=>{let v=n.x+2,w=n.y+2;if(n.container){const y=n.container.getBoundingClientRect(),p=160,P=4+4*28+5;v+p>y.right&&(v=Math.max(y.left+4,n.x-p-2)),w+P>y.bottom&&(w=Math.max(y.top+4,n.y-P-2)),v<y.left+2&&(v=y.left+2),w<y.top+2&&(w=y.top+2)}return{left:v,top:w}}),c=e.ref(null),s=e.ref(null),m=e.ref(null),d=e.computed(()=>{const v=c.value==="import"?s.value:c.value==="export"?m.value:null;if(!v)return{left:"-9999px",top:"-9999px",display:"none"};const w=v.getBoundingClientRect(),y=window.innerWidth,p=window.innerHeight,P=176,Y=4+3*28;let q=w.right;q+P>y-4&&(q=Math.max(4,w.left-P));let N=w.top-4;return N+Y>p-4&&(N=Math.max(4,p-Y-4)),{left:q+"px",top:N+"px",display:"block"}});let h=null,b=null;function A(v){b&&(clearTimeout(b),b=null),h=setTimeout(()=>{c.value=v},60)}function C(){h&&(clearTimeout(h),h=null),b=setTimeout(()=>{c.value=null},120)}e.onBeforeUnmount(()=>{h&&clearTimeout(h),b&&clearTimeout(b)});function $(v){const w=v.target;w&&w.closest(".zm-canvas-menu")||r("close")}function R(v){v.key==="Escape"&&r("close")}function U(){r("close")}window.addEventListener("mousedown",$,!0),window.addEventListener("keydown",R,!0),window.addEventListener("wheel",U,!0),window.addEventListener("scroll",U,!0),e.onBeforeUnmount(()=>{window.removeEventListener("mousedown",$,!0),window.removeEventListener("keydown",R,!0),window.removeEventListener("wheel",U,!0),window.removeEventListener("scroll",U,!0)});function I(v){v(),r("close")}return(v,w)=>(e.openBlock(),e.createElementBlock("div",{class:"zm-canvas-menu",style:e.normalizeStyle({left:a.value.left+"px",top:a.value.top+"px"}),onContextmenu:w[11]||(w[11]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:w[0]||(w[0]=e.withModifiers(y=>I(()=>r("openData")),["stop"]))},[e.createVNode(Re,{name:"database",size:13,stroke:1.6}),w[12]||(w[12]=e.createElementVNode("span",null,"查看数据",-1))]),e.createElementVNode("div",{ref_key:"importItemRef",ref:s,class:e.normalizeClass(["zm-canvas-menu-item zm-canvas-menu-item-has-submenu",{"is-open":c.value==="import"}]),onMouseenter:w[5]||(w[5]=y=>A("import")),onMouseleave:C},[e.createVNode(Re,{name:"import",size:13,stroke:1.6}),w[16]||(w[16]=e.createElementVNode("span",null,"导入",-1)),w[17]||(w[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)),c.value==="import"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-canvas-submenu",style:e.normalizeStyle(d.value),onMouseenter:w[4]||(w[4]=y=>A("import")),onMouseleave:C},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:w[1]||(w[1]=e.withModifiers(y=>I(()=>r("openImport","markdown")),["stop"]))},[e.createVNode(Re,{name:"markdown",size:13,stroke:1.6}),w[13]||(w[13]=e.createElementVNode("span",null,"Markdown 导入",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:w[2]||(w[2]=e.withModifiers(y=>I(()=>r("openImport","json")),["stop"]))},[e.createVNode(Re,{name:"json",size:13,stroke:1.6}),w[14]||(w[14]=e.createElementVNode("span",null,"JSON 文件导入",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:w[3]||(w[3]=e.withModifiers(y=>I(()=>r("openImport","txt")),["stop"]))},[e.createVNode(Re,{name:"txt",size:13,stroke:1.6}),w[15]||(w[15]=e.createElementVNode("span",null,"TXT 文件导入",-1))])],36)):e.createCommentVNode("",!0)],34),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:w[6]||(w[6]=e.withModifiers(y=>I(()=>r("openSettings")),["stop"]))},[e.createVNode(Re,{name:"settings",size:13,stroke:1.6}),w[18]||(w[18]=e.createElementVNode("span",null,"设置",-1))]),w[23]||(w[23]=e.createElementVNode("div",{class:"zm-canvas-menu-divider"},null,-1)),e.createElementVNode("div",{ref_key:"exportItemRef",ref:m,class:e.normalizeClass(["zm-canvas-menu-item zm-canvas-menu-item-has-submenu",{"is-open":c.value==="export"}]),onMouseenter:w[10]||(w[10]=y=>A("export")),onMouseleave:C},[e.createVNode(Re,{name:"export",size:13,stroke:1.6}),w[21]||(w[21]=e.createElementVNode("span",null,"导出",-1)),w[22]||(w[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)),c.value==="export"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-canvas-submenu",style:e.normalizeStyle(d.value),onMouseenter:w[9]||(w[9]=y=>A("export")),onMouseleave:C},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:w[7]||(w[7]=e.withModifiers(y=>I(()=>r("exportPng")),["stop"]))},[e.createVNode(Re,{name:"image",size:13,stroke:1.6}),w[19]||(w[19]=e.createElementVNode("span",null,"导出 PNG",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:w[8]||(w[8]=e.withModifiers(y=>I(()=>r("exportSvg")),["stop"]))},[e.createVNode(Re,{name:"svg-export",size:13,stroke:1.6}),w[20]||(w[20]=e.createElementVNode("span",null,"导出 SVG",-1))])],36)):e.createCommentVNode("",!0)],34)],36))}}),qs=["aria-hidden"],Xs=["aria-hidden"],Zs={key:0,class:"zm-drawer-header"},Js={key:0,class:"zm-drawer-title"},Qs={class:"zm-drawer-body"},ec=["aria-hidden"],tc={key:0,class:"zm-drawer-header"},nc={key:0,class:"zm-drawer-title"},oc={class:"zm-drawer-body"},$t=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 a(){n("update:open",!1)}return(c,s)=>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:s[0]||(s[0]=m=>t.closeOnBackdrop&&a())},null,8,qs)):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||c.$slots.header?(e.openBlock(),e.createElementBlock("div",Zs,[t.title?(e.openBlock(),e.createElementBlock("h3",Js,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.renderSlot(c.$slots,"header"),t.closable?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-drawer-close",title:"关闭",onClick:r},[...s[1]||(s[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",Qs,[e.renderSlot(c.$slots,"default")])],14,Xs)):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||c.$slots.header?(e.openBlock(),e.createElementBlock("div",tc,[t.title?(e.openBlock(),e.createElementBlock("h3",nc,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.renderSlot(c.$slots,"header"),t.closable?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-drawer-close",title:"关闭",onClick:r},[...s[2]||(s[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",oc,[e.renderSlot(c.$slots,"default")])],14,ec)):e.createCommentVNode("",!0)]),_:3}))}}),ic={class:"zm-outline-root"},rc={class:"zm-outline-search"},lc={key:0,class:"zm-outline-search-count"},ac={key:1,class:"zm-outline-search-count zm-outline-search-empty"},sc={class:"zm-outline-actions"},cc={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"},uc={key:1,d:"M5 12 L10 17 L19 7"},fc={class:"zm-outline"},mc=["data-outline-id","onClick","onDblclick","onDragstart","onDragover","onDragleave","onDrop"],pc=["title","onClick"],hc={width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round"},gc={key:0,points:"6 9 12 15 18 9"},bc={key:1,points:"9 6 15 12 9 18"},kc={key:1,class:"zm-outline-dot"},yc={key:2,class:"zm-outline-index"},xc={key:4,class:"zm-outline-text"},Ec=["onClick"],wc=["onClick"],Nc=["src"],Sc=["onClick"],Cc=["src"],Tc=["title","onClick"],Mc={width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Ac={key:0,x:"9",y:"9",width:"13",height:"13",rx:"2"},_c={key:1,d:"M5 12 L10 17 L19 7"},Wo=e.defineComponent({__name:"Outline",props:{data:{},selectedId:{default:null},collapsedIds:{default:()=>new Set},readonly:{type:Boolean,default:!1},showIndex:{type:Boolean,default:!1}},emits:["select","toggleCollapse","edit","addChild","addSibling","move"],setup(t,{emit:o}){const n=t,r=o,a=e.ref(""),c=e.ref(null),s=e.ref(-1),m=e.computed(()=>{const T=a.value.trim().toLowerCase();if(!T)return new Set;const F=new Set,H=ne=>{var xe;(ne.text.toLowerCase().includes(T)||(xe=ne.note)!=null&&xe.text&&ne.note.text.toLowerCase().includes(T))&&F.add(ne.id);for(const ot of ne.children)H(ot)};return H(n.data),F}),d=e.computed(()=>{if(m.value.size===0)return new Set;const T=new Set,F=H=>{let ne=m.value.has(H.id);for(const xe of H.children)F(xe)&&(ne=!0);return ne&&T.add(H.id),ne};return F(n.data),T}),h=e.computed(()=>{const T=[],F=H=>{m.value.has(H.id)&&T.push(H.id);for(const ne of H.children)F(ne)};return F(n.data),T}),b=e.computed(()=>a.value.trim().length>0),A=e.computed(()=>{const T=[],F=d.value,H=(ne,xe,ot)=>{if(b.value&&!F.has(ne.id))return;const mt=ne.children.length>0,it=b.value?!1:n.collapsedIds.has(ne.id);T.push({id:ne.id,text:ne.text||"(无标题)",depth:xe,siblingIndex:ot,hasChildren:mt,collapsed:it,node:ne}),mt&&!it&&ne.children.forEach((cn,rt)=>H(cn,xe+1,rt))};return H(n.data,0,0),T});function C(){s.value=h.value.length>0?0:-1}function $(){const T=h.value;T.length!==0&&(s.value=(s.value+1)%T.length,I(s.value))}function R(){const T=h.value;T.length!==0&&(s.value=(s.value-1+T.length)%T.length,I(s.value))}function U(T){T.key==="Enter"?(T.preventDefault(),T.shiftKey?R():$()):T.key==="Escape"&&(T.preventDefault(),a.value="",s.value=-1)}function I(T){const F=h.value[T];if(!F)return;const H=A.value.find(ne=>ne.id===F);H&&r("select",H.node),e.nextTick(()=>{const ne=document.querySelector(`[data-outline-id="${F}"]`);ne==null||ne.scrollIntoView({block:"nearest",behavior:"smooth"})})}function v(){a.value="",s.value=-1}e.onMounted(()=>{e.nextTick(()=>{var T;return(T=c.value)==null?void 0:T.focus()})});const w=e.ref(null),y=e.ref("");let p=null;function P(T){n.readonly||(w.value=T.id,y.value=T.text,e.nextTick(()=>{p=document.querySelector(".zm-outline-input"),p==null||p.focus(),p==null||p.select()}))}function Y(){w.value!=null&&(r("edit",{id:w.value,text:y.value.trim()||"(无标题)"}),q())}function q(){w.value=null,y.value="",p=null}function N(T){T.key==="Enter"?(T.preventDefault(),Y()):T.key==="Escape"&&(T.preventDefault(),q())}e.onBeforeUnmount(q);const ae=e.ref(null),ge=e.ref(null),ue=e.ref(null);function we(T,F){if(n.readonly){T.preventDefault();return}ae.value={id:F.id,text:F.text},T.dataTransfer&&(T.dataTransfer.effectAllowed="move",T.dataTransfer.setData("text/plain",F.id))}function te(){ae.value=null,ge.value=null,ue.value=null}function de(T,F){if(!ae.value)return;T.preventDefault(),T.dataTransfer&&(T.dataTransfer.dropEffect="move");const H=V(T);ge.value=F.id,ue.value=H}function fe(T){ge.value===T.id&&(ge.value=null,ue.value=null)}function g(T,F){T.preventDefault();const H=ae.value;if(!H)return;const ne=V(T);H.id!==F.id&&r("move",{srcId:H.id,targetId:F.id,position:ne}),te()}function V(T,F){const ne=T.currentTarget.getBoundingClientRect(),xe=T.clientY-ne.top,ot=ne.height;return xe<ot*.3?"before":xe>ot*.7?"after":"child"}const G=e.ref(null);let le=null;async function me(T){try{return await navigator.clipboard.writeText(T),!0}catch{const F=document.createElement("textarea");F.value=T,document.body.appendChild(F),F.select();let H=!1;try{H=document.execCommand("copy")}finally{document.body.removeChild(F)}return H}}async function O(T,F,H){T.stopPropagation(),await me(F)&&(G.value=H,le&&clearTimeout(le),le=setTimeout(()=>G.value=null,1200))}const L=e.computed(()=>{const T=[],F=(H,ne)=>{const xe=" ".repeat(ne),ot=ne===0?"":"- ";T.push(xe+ot+(H.text||""));for(const mt of H.children)F(mt,ne+1)};return F(n.data,0),T.join(`
16
+ `)}),ce=e.ref(!1);let ke=null;async function z(){await me(L.value)&&(ce.value=!0,ke&&clearTimeout(ke),ke=setTimeout(()=>ce.value=!1,1200))}return(T,F)=>(e.openBlock(),e.createElementBlock("div",ic,[e.createElementVNode("div",rc,[F[3]||(F[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:c,"onUpdate:modelValue":F[0]||(F[0]=H=>a.value=H),type:"text",class:"zm-outline-search-input",placeholder:"搜索节点… (Enter 下一个, Shift+Enter 上一个)",onInput:C,onKeydown:U},null,544),[[e.vModelText,a.value]]),h.value.length>0?(e.openBlock(),e.createElementBlock("span",lc,e.toDisplayString(s.value+1)+"/"+e.toDisplayString(h.value.length),1)):b.value?(e.openBlock(),e.createElementBlock("span",ac,"无结果")):e.createCommentVNode("",!0),a.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-outline-search-clear",title:"清除搜索",onClick:v},"×")):e.createCommentVNode("",!0)]),e.createElementVNode("div",sc,[e.createElementVNode("button",{class:e.normalizeClass(["zm-outline-action-btn",{"is-success":ce.value}]),title:"复制完整大纲为纯文本",onClick:z},[(e.openBlock(),e.createElementBlock("svg",cc,[ce.value?(e.openBlock(),e.createElementBlock("path",uc)):(e.openBlock(),e.createElementBlock("rect",dc)),F[4]||(F[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(ce.value?"已复制":"复制大纲"),1)],2)]),e.createElementVNode("ul",fc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(A.value,H=>(e.openBlock(),e.createElementBlock("li",{key:H.id,"data-outline-id":H.id,class:e.normalizeClass(["zm-outline-row",{"is-selected":H.id===t.selectedId,"is-root":H.depth===0,"is-editing":w.value===H.id,"is-search-hit":m.value.has(H.id),"is-search-current":h.value[s.value]===H.id,"is-drag-over-before":ge.value===H.id&&ue.value==="before","is-drag-over-after":ge.value===H.id&&ue.value==="after","is-drag-over-child":ge.value===H.id&&ue.value==="child"}]),style:e.normalizeStyle({paddingLeft:12+H.depth*16+"px"}),draggable:"true",onClick:ne=>r("select",H.node),onDblclick:ne=>P(H),onDragstart:ne=>we(ne,H),onDragend:te,onDragover:ne=>de(ne,H),onDragleave:()=>fe(H),onDrop:ne=>g(ne,H)},[H.hasChildren?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-outline-toggle",title:H.collapsed?"展开":"折叠",onClick:e.withModifiers(ne=>r("toggleCollapse",H.id),["stop"])},[(e.openBlock(),e.createElementBlock("svg",hc,[H.collapsed?(e.openBlock(),e.createElementBlock("polyline",bc)):(e.openBlock(),e.createElementBlock("polyline",gc))]))],8,pc)):(e.openBlock(),e.createElementBlock("span",kc)),n.showIndex?(e.openBlock(),e.createElementBlock("span",yc,e.toDisplayString(H.siblingIndex+1)+".",1)):e.createCommentVNode("",!0),w.value===H.id?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:3,"onUpdate:modelValue":F[1]||(F[1]=ne=>y.value=ne),class:"zm-outline-input",onBlur:Y,onKeydown:N,onClick:F[2]||(F[2]=e.withModifiers(()=>{},["stop"]))},null,544)),[[e.vModelText,y.value]]):(e.openBlock(),e.createElementBlock("span",xc,e.toDisplayString(H.text),1)),n.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:5,class:"zm-outline-row-action",title:"编辑文字",onClick:e.withModifiers(ne=>P(H),["stop"])},[...F[5]||(F[5]=[e.createElementVNode("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M4 20 l4 -1 11 -11 -3 -3 -11 11 z"}),e.createElementVNode("line",{x1:"14",y1:"6",x2:"18",y2:"10"})],-1)])],8,Ec)),n.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:6,class:"zm-outline-row-action",title:"添加同级",onClick:e.withModifiers(ne=>r("addSibling",H.id),["stop"])},[e.createElementVNode("img",{src:e.unref(yr),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,Nc)],8,wc)),n.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:7,class:"zm-outline-row-action",title:"添加子节点",onClick:e.withModifiers(ne=>r("addChild",H.id),["stop"])},[e.createElementVNode("img",{src:e.unref(xr),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,Cc)],8,Sc)),e.createElementVNode("button",{class:e.normalizeClass(["zm-outline-row-copy",{"is-success":G.value===H.id}]),title:G.value===H.id?"已复制":"复制节点文本",onClick:ne=>O(ne,H.text,H.id)},[(e.openBlock(),e.createElementBlock("svg",Mc,[G.value!==H.id?(e.openBlock(),e.createElementBlock("rect",Ac)):(e.openBlock(),e.createElementBlock("path",_c)),F[6]||(F[6]=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,Tc)],46,mc))),128))])]))}}),vc={key:0,class:"zm-jtv-root"},Rc={key:0,class:"zm-jtv-key"},Bc={key:1,class:"zm-jtv-colon"},zc={key:2,class:"zm-jtv-key zm-jtv-bracket"},Ic={key:3,class:"zm-jtv-size"},Lc={key:4,class:"zm-jtv-bracket"},Oc={key:5,class:"zm-jtv-brace"},Vc={key:0,class:"zm-jtv-children"},Dc={class:"zm-jtv-key"},$c={key:0,class:"zm-jtv-key"},Pc=["src","alt"],Fc=["href"],Uc=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"),a=e.computed(()=>n.value==="array");e.computed(()=>!r.value&&!a.value);const c=e.computed(()=>{if(a.value)return`Array(${o.value.length})`;if(r.value){const w=o.value,y=Object.keys(w);return`Object(${y.length} ${y.length===1?"key":"keys"})`}return""}),s=e.computed(()=>a.value?o.value.map((w,y)=>({key:String(y),value:w})):r.value?Object.entries(o.value).map(([w,y])=>({key:w,value:y})):[]),m=e.computed(()=>o.isRoot?"<root>":o.path),d=e.computed(()=>o.collapsedPaths.has(m.value));function h(w,y,p){w!=="<root>"&&(p<2||y===null||typeof y!="object"||o.collapsedPaths.has(w)||o.collapsedPaths.add(w))}o.isRoot||h(m.value,o.value,o.depth);function b(){d.value?o.collapsedPaths.delete(m.value):o.collapsedPaths.add(m.value)}function A(w){return m.value===""?w:`${m.value}.${w}`}function C(w){if(!o.query)return!0;const y=o.query.toLowerCase();return typeof w=="string"?w.toLowerCase().includes(y):w===null?"null".includes(y):String(w).toLowerCase().includes(y)}function $(w){return o.query?w.toLowerCase().includes(o.query.toLowerCase()):!0}function R(w,y){return!o.query||$(w)?!0:y===null||typeof y!="object"?C(y):!0}function U(w){return w===null?"null":typeof w=="string"?w.length>80?`"${w.slice(0,80)}..."`:`"${w}"`:typeof w=="boolean"?w?"true":"false":typeof w=="number"?String(w):typeof w>"u"?"undefined":JSON.stringify(w)}function I(w){if(typeof w!="string")return!1;const y=w.trim();return!!(y.startsWith("data:image/")||/^https?:\/\/.+\.(png|jpe?g|gif|webp|svg|bmp|ico)(\?.*)?$/i.test(y)||/^https?:\/\/.+/i.test(y)&&/\/[^/]+\.(png|jpe?g|gif|webp|svg|bmp|ico)(\?.*)?$/i.test(y))}function v(w){if(!o.query)return null;const y=w.toLowerCase().indexOf(o.query.toLowerCase());return y<0?null:{before:w.slice(0,y),match:w.slice(y,y+o.query.length),after:w.slice(y+o.query.length)}}return(w,y)=>{var P,Y,q,N,ae,ge;const p=e.resolveComponent("JsonTreeViewer",!0);return t.isRoot?(e.openBlock(),e.createElementBlock("div",vc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,ue=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:ue.key,class:"zm-jtv-row"},[e.createVNode(p,{"key-name":ue.key,value:ue.value,path:A(ue.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,R(ue.key,ue.value)]])),128))])):r.value||a.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),a.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",Rc,e.toDisplayString(t.keyName),1)),a.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",Bc,":")),a.value?(e.openBlock(),e.createElementBlock("span",zc,"[")):e.createCommentVNode("",!0),d.value?(e.openBlock(),e.createElementBlock("span",Ic,e.toDisplayString(c.value),1)):e.createCommentVNode("",!0),d.value&&a.value?(e.openBlock(),e.createElementBlock("span",Lc,"]")):e.createCommentVNode("",!0),d.value&&r.value?(e.openBlock(),e.createElementBlock("span",Oc,"}")):e.createCommentVNode("",!0)],4),d.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Vc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,ue=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:ue.key,class:"zm-jtv-row"},[e.createVNode(p,{"key-name":ue.key,value:ue.value,path:A(ue.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,R(ue.key,ue.value)]])),128))])),!d.value&&a.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&&!a.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"})},[y[2]||(y[2]=e.createElementVNode("span",{class:"zm-jtv-toggle is-leaf"},"·",-1)),e.createElementVNode("span",Dc,e.toDisplayString(t.keyName),1),y[3]||(y[3]=e.createElementVNode("span",{class:"zm-jtv-colon"},":",-1)),$(t.keyName)&&v(t.keyName)?(e.openBlock(),e.createElementBlock("span",$c,[e.createElementVNode("span",null,e.toDisplayString((P=v(t.keyName))==null?void 0:P.before),1),e.createElementVNode("mark",null,e.toDisplayString((Y=v(t.keyName))==null?void 0:Y.match),1),e.createElementVNode("span",null,e.toDisplayString((q=v(t.keyName))==null?void 0:q.after),1)])):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(["zm-jtv-value",`zm-jtv-${n.value}`])},[v(U(t.value))?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("span",null,e.toDisplayString((N=v(U(t.value)))==null?void 0:N.before),1),e.createElementVNode("mark",null,e.toDisplayString((ae=v(U(t.value)))==null?void 0:ae.match),1),e.createElementVNode("span",null,e.toDisplayString((ge=v(U(t.value)))==null?void 0:ge.after),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(U(t.value)),1)],64))],2),I(t.value)?(e.openBlock(),e.createElementBlock("span",{key:1,class:"zm-jtv-thumb-wrap",onClick:y[1]||(y[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,Pc),e.createElementVNode("a",{class:"zm-jtv-thumb-link",href:String(t.value),target:"_blank",rel:"noopener noreferrer",onClick:y[0]||(y[0]=e.withModifiers(()=>{},["stop"]))},"open",8,Fc)])):e.createCommentVNode("",!0)],4))}}}),Hc={class:"zm-data-panel"},Wc={class:"zm-data-header"},Gc={class:"zm-data-title"},jc={class:"zm-data-title-meta"},Kc={class:"zm-data-toolbar"},Yc=["title"],qc={key:0,width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Xc={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"},Zc={key:0,class:"zm-data-paste"},Jc={class:"zm-data-tabs"},Qc=["placeholder"],ed={key:0,class:"zm-data-error"},td={class:"zm-data-paste-actions"},nd=["disabled"],od={class:"zm-data-tree"},Go=e.defineComponent({__name:"DataPanel",props:{data:{},pendingMode:{default:null}},emits:["import","consumed-mode"],setup(t,{emit:o}){const n=t,r=o,a=e.computed(()=>JSON.stringify(n.data,null,2)),c=e.ref(""),s=e.ref(null),m=e.ref(!1),d=e.ref("json"),h=e.ref("idle"),b=e.ref(new Set),A=e.ref("");e.watch(()=>n.pendingMode,y=>{y&&(m.value=!0,d.value=y,r("consumed-mode"))},{immediate:!0});async function C(){try{await navigator.clipboard.writeText(a.value),h.value="copied",setTimeout(()=>h.value="idle",1500)}catch{const y=document.createElement("textarea");y.value=a.value,document.body.appendChild(y),y.select();try{document.execCommand("copy"),h.value="copied",setTimeout(()=>h.value="idle",1500)}finally{document.body.removeChild(y)}}}function $(){const y=new Blob([a.value],{type:"application/json"}),p=URL.createObjectURL(y),P=document.createElement("a");P.href=p,P.download=`${n.data.text||"mindmap"}.json`,P.click(),URL.revokeObjectURL(p)}function R(){s.value=null;const y=c.value.trim();if(y){if(d.value==="markdown"||d.value==="txt"){try{const p=Un(y);r("import",p),c.value="",m.value=!1}catch(p){s.value=(d.value==="txt"?"TXT 解析失败:":"Markdown 解析失败:")+p.message}return}try{const p=JSON.parse(y);if(!p.id||!Array.isArray(p.children)){s.value="JSON 缺少 id 或 children 字段";return}r("import",p),c.value="",m.value=!1}catch(p){s.value="JSON 解析失败:"+p.message}}}function U(y){return 1+y.children.reduce((p,P)=>p+U(P),0)}const I=e.computed(()=>U(n.data)),v=e.computed(()=>a.value.length);function w(){const y=document.createElement("input");y.type="file",y.accept="application/json",y.onchange=()=>{var Y;const p=(Y=y.files)==null?void 0:Y[0];if(!p)return;const P=new FileReader;P.onload=()=>{typeof P.result=="string"&&(c.value=P.result,R())},P.readAsText(p)},y.click()}return(y,p)=>(e.openBlock(),e.createElementBlock("div",Hc,[e.createElementVNode("div",Wc,[e.createElementVNode("div",Gc,[p[8]||(p[8]=e.createElementVNode("span",{class:"zm-data-title-text"},"数据 JSON",-1)),e.createElementVNode("span",jc,e.toDisplayString(I.value)+" 节点 · "+e.toDisplayString(v.value)+" chars",1)])]),e.createElementVNode("div",Kc,[e.createElementVNode("button",{class:e.normalizeClass(["zm-data-btn is-icon",{"is-success":h.value==="copied"}]),title:h.value==="copied"?"已复制":"复制 JSON 到剪贴板",onClick:C},[h.value==="idle"?(e.openBlock(),e.createElementBlock("svg",qc,[...p[9]||(p[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",Xc,[...p[10]||(p[10]=[e.createElementVNode("polyline",{points:"5 12 10 17 19 7"},null,-1)])])),p[11]||(p[11]=e.createElementVNode("span",{class:"zm-data-btn-label"},"复制",-1))],10,Yc),e.createElementVNode("button",{class:"zm-data-btn is-icon",title:"导出为 JSON 文件",onClick:$},[...p[12]||(p[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:w},[...p[13]||(p[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":m.value}]),title:"粘贴 JSON 或 Markdown 替换当前数据",onClick:p[0]||(p[0]=P=>m.value=!m.value)},[...p[14]||(p[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),p[16]||(p[16]=e.createElementVNode("div",{class:"zm-data-toolbar-spacer"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["zm-data-search",{"is-active":A.value.length>0}])},[p[15]||(p[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":p[1]||(p[1]=P=>A.value=P),type:"text",placeholder:"过滤 (键 / 值)",spellcheck:"false"},null,512),[[e.vModelText,A.value]]),A.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-data-search-clear",title:"清空过滤",onClick:p[2]||(p[2]=P=>A.value="")},"×")):e.createCommentVNode("",!0)],2)]),m.value?(e.openBlock(),e.createElementBlock("div",Zc,[e.createElementVNode("div",Jc,[e.createElementVNode("button",{class:e.normalizeClass(["zm-data-tab",{"is-active":d.value==="json"}]),onClick:p[3]||(p[3]=P=>d.value="json")},"JSON",2),e.createElementVNode("button",{class:e.normalizeClass(["zm-data-tab",{"is-active":d.value==="markdown"}]),onClick:p[4]||(p[4]=P=>d.value="markdown")},"Markdown",2)]),e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":p[5]||(p[5]=P=>c.value=P),placeholder:d.value==="json"?"paste a JSON tree to replace current data":"paste markdown - # / ## / ### become nodes",spellcheck:"false"},null,8,Qc),[[e.vModelText,c.value]]),s.value?(e.openBlock(),e.createElementBlock("div",ed,e.toDisplayString(s.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",td,[e.createElementVNode("button",{class:"zm-data-btn is-primary",disabled:!c.value,onClick:R},"应用",8,nd),e.createElementVNode("button",{class:"zm-data-btn",onClick:p[6]||(p[6]=P=>{c.value="",s.value=null})},"清空"),e.createElementVNode("button",{class:"zm-data-btn",onClick:p[7]||(p[7]=P=>m.value=!1)},"关闭")])])):e.createCommentVNode("",!0),e.createElementVNode("div",od,[e.createVNode(Uc,{value:t.data,query:A.value,"collapsed-paths":b.value},null,8,["value","query","collapsed-paths"])]),p[17]||(p[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))]))}}),id={class:"zm-md-panel"},rd={key:0,class:"zm-md-error"},ld={class:"zm-md-split"},ad={class:"zm-md-edit"},sd={class:"zm-md-preview"},cd={class:"zm-md-preview-body"},dd={class:"zm-md-footer"},ud=["disabled"],fd=`# flow-mindmap 思维导图
17
17
 
18
18
  [GitHub 仓库](https://github.com/xz333221/flow-mindmap)
19
19
 
@@ -52,67 +52,67 @@
52
52
 
53
53
  ## 开源协议
54
54
  [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0)
55
- `,Vo=e.defineComponent({__name:"MarkdownPanel",props:{data:{}},emits:["import"],setup(t,{emit:o}){const n=t,r=o,a=e.ref(Dn(n.data)),c=e.ref(null),s=e.ref(null),u=e.computed(()=>{try{const I=On(a.value||"");return c.value=null,I}catch(I){return c.value=I.message,{id:"preview_fallback",text:a.value||"(空)",children:[]}}}),d=e.computed(()=>Ot(u.value));let p=null;e.watch(a,()=>{p&&clearTimeout(p),p=setTimeout(()=>{var I;return(I=s.value)==null?void 0:I.resetView()},250)});function b(){try{const I=On(a.value||"");c.value=null,r("import",I)}catch(I){c.value=I.message}}function C(){a.value=Dn(n.data),c.value=null,e.nextTick(()=>{var I;return(I=s.value)==null?void 0:I.resetView()})}function w(){a.value="",c.value=null,e.nextTick(()=>{var I;return(I=s.value)==null?void 0:I.resetView()})}function V(){const I=document.createElement("input");I.type="file",I.accept=".md,text/markdown,text/plain",I.onchange=()=>{var k;const _=(k=I.files)==null?void 0:k[0];if(!_)return;const y=new FileReader;y.onload=()=>{typeof y.result=="string"&&(a.value=y.result,c.value=null,e.nextTick(()=>{var m;return(m=s.value)==null?void 0:m.resetView()}))},y.readAsText(_)},I.click()}function R(){const I=new Blob([a.value],{type:"text/markdown;charset=utf-8"}),_=URL.createObjectURL(I),y=document.createElement("a");y.href=_;const k=(n.data.text||"mindmap").trim()||"mindmap";y.download=`${k}.md`,y.click(),URL.revokeObjectURL(_)}function U(){a.value=Oc,c.value=null,e.nextTick(()=>{var I;return(I=s.value)==null?void 0:I.resetView()})}return(I,_)=>(e.openBlock(),e.createElementBlock("div",Ac,[e.createElementVNode("div",{class:"zm-md-toolbar"},[e.createElementVNode("button",{class:"zm-md-btn",title:"从 .md 文件加载",onClick:V},[..._[1]||(_[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:R},[..._[2]||(_[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)])]),_[3]||(_[3]=e.createElementVNode("span",{class:"zm-md-spacer"},null,-1)),e.createElementVNode("button",{class:"zm-md-btn",title:"用示例内容填充",onClick:U},"示例"),e.createElementVNode("button",{class:"zm-md-btn",title:"覆盖为当前导图",onClick:C},"同步"),e.createElementVNode("button",{class:"zm-md-btn",title:"清空",onClick:w},"清空")]),c.value?(e.openBlock(),e.createElementBlock("div",_c,e.toDisplayString(c.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Rc,[e.createElementVNode("div",Bc,[_[4]||(_[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":_[0]||(_[0]=y=>a.value=y),class:"zm-md-textarea",spellcheck:"false",placeholder:"# 标题…"},null,512),[[e.vModelText,a.value]])]),e.createElementVNode("div",vc,[_[5]||(_[5]=e.createElementVNode("div",{class:"zm-md-pane-header"},[e.createElementVNode("span",null,"导图预览"),e.createElementVNode("span",{class:"zm-md-hint"},"只读")],-1)),e.createElementVNode("div",zc,[e.createVNode(ei,{ref_key:"previewRef",ref:s,data:d.value,readonly:"","preview-mode":""},null,8,["data"])])])]),e.createElementVNode("div",Ic,[e.createElementVNode("button",{class:"zm-md-btn is-primary",disabled:!a.value.trim(),onClick:b},"应用到导图",8,Lc)])]))}}),Dc={class:"zm-settings-panel"},Vc={class:"zm-settings-section"},$c={class:"zm-settings-field"},Pc={class:"zm-settings-control"},Fc={class:"zm-color-input-wrap"},Uc=["value"],Hc={class:"zm-color-input-text"},Wc={class:"zm-swatch-row zm-swatch-row--compact"},Gc=["title","onClick"],jc={class:"zm-settings-field"},Kc=["value"],Yc={class:"zm-slider"},qc=["value"],Xc={class:"zm-settings-field"},Zc=["value"],Jc={class:"zm-slider"},Qc=["value"],ed={class:"zm-settings-field zm-line-style-field"},td={class:"zm-line-style-group"},nd=["title","onClick"],od=["viewBox"],id={key:0,d:"M 0 12 Q 14 2, 28 12",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},rd={key:1,d:"M 0 10 L 12 10 Q 16 10 16 6 L 16 4 L 28 4",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round","stroke-linejoin":"round"},ld={key:2,d:"M 0 10 L 16 10 L 16 4 L 28 4",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round","stroke-linejoin":"round"},ad={key:3,d:"M 0 12 C 8 0, 20 0, 28 12",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},sd={key:4,x1:"0",y1:"12",x2:"28",y2:"12",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},cd={class:"zm-line-style-label"},dd={class:"zm-settings-field zm-line-style-field"},ud={class:"zm-line-style-group"},fd=["title","onClick"],md=["viewBox"],pd={key:0,d:"M 0 12 Q 14 2, 28 12",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},hd={key:1,d:"M 0 10 L 12 10 Q 16 10 16 6 L 16 4 L 28 4",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round","stroke-linejoin":"round"},gd={key:2,d:"M 0 10 L 16 10 L 16 4 L 28 4",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round","stroke-linejoin":"round"},bd={key:3,d:"M 0 12 C 8 0, 20 0, 28 12",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},kd={key:4,x1:"0",y1:"12",x2:"28",y2:"12",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},yd={class:"zm-line-style-label"},xd={key:0,class:"zm-settings-field"},Ed={class:"zm-settings-label"},wd={class:"zm-settings-sub"},Nd=["value"],Sd={key:1,class:"zm-slider"},Td=["value"],Cd={class:"zm-settings-field zm-line-style-field"},Md={class:"zm-line-style-group"},Ad=["title","onClick"],_d={viewBox:"0 0 28 18",width:"28",height:"18",preserveAspectRatio:"none"},Rd={key:0,d:"M 8 9 L 0 9 M 20 9 L 28 9",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},Bd={key:1,d:"M 14 9 L 0 9 M 14 9 L 28 9",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},vd={key:2,d:"M 8 7 L 0 4 M 8 9 L 0 9 M 8 11 L 0 14 M 20 7 L 28 4 M 20 9 L 28 9 M 20 11 L 28 14",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},zd={class:"zm-line-style-label"},Id={class:"zm-settings-field"},Ld={key:2,class:"zm-palette-picker"},Od={class:"zm-palette-list"},Dd=["onClick"],Vd={class:"zm-palette-option-name"},$d={class:"zm-palette-option-swatches"},Pd={key:0,class:"zm-palette-custom-editor"},Fd=["value"],Ud={class:"zm-palette-custom-actions"},Hd={class:"zm-settings-field"},Wd={key:3,class:"zm-settings-field"},Gd={class:"zm-settings-label"},jd={class:"zm-settings-sub"},Kd=["value"],Yd={key:4,class:"zm-slider"},qd=["value"],Xd={key:5,class:"zm-settings-field"},Zd={class:"zm-settings-field"},Jd={class:"zm-settings-label"},Qd={class:"zm-settings-sub"},eu=["value"],tu={class:"zm-slider"},nu=["value"],ou={class:"zm-settings-field"},iu={class:"zm-settings-preview"},ru={viewBox:"0 0 200 70",width:"100%",height:"70",preserveAspectRatio:"none"},lu=["x1","y1","x2","y2","stroke","stroke-width"],au={key:0,class:"zm-settings-section"},su={class:"zm-settings-section-title"},cu={key:0,class:"zm-settings-section-sub"},du={class:"zm-settings-field"},uu={class:"zm-settings-value-tag"},fu={class:"zm-swatch-row"},mu=["title","onClick"],pu={class:"zm-swatch zm-swatch--custom",title:"自定义颜色"},hu=["value"],gu={class:"zm-settings-field"},bu={class:"zm-settings-value-tag"},ku={class:"zm-swatch-row"},yu=["title","onClick"],xu={class:"zm-swatch zm-swatch--custom",title:"自定义颜色"},Eu=["value"],wu={class:"zm-settings-field"},Nu=["value"],Su=["value"],Tu={class:"zm-settings-field"},Cu=["value"],Mu={class:"zm-slider"},Au=["value"],_u={class:"zm-settings-section zm-settings-section--actions"},$o=((t,o)=>{const n=t.__vccOpts||t;for(const[r,a]of o)n[r]=a;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 a(Y,x){r("update:settings",{[Y]:x})}const c=[{value:"arc",label:"圆弧",viewBox:"0 0 28 14"},{value:"rounded-elbow",label:"圆角折线",viewBox:"0 0 28 14"},{value:"elbow",label:"折线",viewBox:"0 0 28 14"},{value:"straight",label:"直线",viewBox:"0 0 28 14"},{value:"curve",label:"S曲线",viewBox:"0 0 28 14"}],s=c,u=[{value:"edge",label:"左右中点"},{value:"center",label:"节点正中心"},{value:"proportional",label:"按比例计算"}],d=[{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 p(Y){r("update:nodeStyle",Y)}const b=e.computed(()=>[...mn,...n.settings.customPalettes]),C=e.reactive({});function w(Y){return C[Y.id]===void 0&&(C[Y.id]=Y.colors.join(`
56
- `)),C[Y.id]}function V(Y){const x=C[Y.id]??"",re=Ka(x);if(re.length===0){C[Y.id]=Y.colors.join(`
57
- `);return}const pe=n.settings.customPalettes.map(de=>de.id===Y.id?{...de,colors:re}:de);r("update:settings",{customPalettes:pe})}function R(){const Y=b.value.find(we=>we.id===n.settings.branchPaletteId),x=Y?[...Y.colors]:[...mn[0].colors],re="custom-";let pe=re+(n.settings.customPalettes.length+1);for(;mn.some(we=>we.id===pe)||n.settings.customPalettes.some(we=>we.id===pe);)pe=re+Math.random().toString(36).slice(2,7);const de={id:pe,name:`我的配色 ${n.settings.customPalettes.length+1}`,colors:x};r("update:settings",{customPalettes:[...n.settings.customPalettes,de],branchPaletteId:pe}),C[pe]=x.join(`
58
- `)}function U(Y){const x=n.settings.customPalettes.filter(pe=>pe.id!==Y.id),re=n.settings.branchPaletteId===Y.id?"default":n.settings.branchPaletteId;r("update:settings",{customPalettes:x,...re!==n.settings.branchPaletteId?{branchPaletteId:re}:{}}),delete C[Y.id]}const I=["#f87171","#fb923c","#fbbf24","#a3e635","#34d399","#22d3ee","#818cf8","#c084fc","#1e2937","#f8fafc","#94a3b8"],_=["#f8fafc","#ffffff","#e2e8f0","#1e2937","#0f172a","#fef3c7","#dbeafe","#dcfce7","#fce7f3","#f1f5f9"],y=[0,1,2,3],k=["#f87171","#fb923c","#34d399","#818cf8"];function m(Y,x,re,pe){if(x<=1)return re;const de=Y/(x-1);return re+(pe-re)*de}function P(Y,x,re,pe){const de=x*Math.pow(pe,Y);return Math.max(re,de)}const j=e.computed(()=>{const Y=n.settings.lineWidthStart,x=n.settings.lineWidthEnd,re=n.settings.taperedEdge,pe=y.length,de=8,we=192,ee=b.value.find(ue=>ue.id===n.settings.branchPaletteId),ce=ee&&ee.colors.length?ee.colors:k;return y.map((ue,h)=>{const $=10+h*60/(pe-1);return{x1:de,y1:$,x2:we,y2:$,w:re?P(ue,Y,x,n.settings.lineWidthTaper):m(ue,pe,Y,x),color:n.settings.rainbowBranch?ce[h%ce.length]:"#94a3b8"}})});return(Y,x)=>{var re,pe,de,we,ee,ce,ue;return e.openBlock(),e.createElementBlock("div",Dc,[e.createElementVNode("section",Vc,[x[52]||(x[52]=e.createElementVNode("h4",{class:"zm-settings-section-title"},"画布",-1)),e.createElementVNode("div",$c,[x[27]||(x[27]=e.createElementVNode("span",{class:"zm-settings-label"},"画布背景色",-1)),e.createElementVNode("div",Pc,[e.createElementVNode("label",Fc,[e.createElementVNode("input",{type:"color",class:"zm-color-input",value:t.settings.canvasBg||"#f8fafc",onInput:x[0]||(x[0]=h=>a("canvasBg",h.target.value))},null,40,Uc),e.createElementVNode("span",Hc,e.toDisplayString(t.settings.canvasBg||"默认"),1)])])]),e.createElementVNode("div",Wc,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(_,h=>e.createElementVNode("button",{key:"cbg-"+h,class:e.normalizeClass(["zm-swatch",{"is-active":(t.settings.canvasBg||"#f8fafc")===h}]),style:e.normalizeStyle({background:h}),title:h,onClick:$=>a("canvasBg",h)},null,14,Gc)),64)),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"恢复默认",onClick:x[1]||(x[1]=h=>a("canvasBg",void 0))},"∅")]),x[53]||(x[53]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",jc,[x[28]||(x[28]=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]=h=>a("lineWidthStart",parseFloat(h.target.value)||0))},null,40,Kc)]),e.createElementVNode("div",Yc,[x[29]||(x[29]=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]=h=>a("lineWidthStart",parseFloat(h.target.value)))},null,40,qc)]),e.createElementVNode("div",Xc,[x[30]||(x[30]=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]=h=>a("lineWidthEnd",parseFloat(h.target.value)||0))},null,40,Zc)]),e.createElementVNode("div",Jc,[x[31]||(x[31]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"0.1",max:"6",step:"0.1",value:t.settings.lineWidthEnd,onInput:x[5]||(x[5]=h=>a("lineWidthEnd",parseFloat(h.target.value)))},null,40,Qc)]),x[54]||(x[54]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",ed,[x[32]||(x[32]=e.createElementVNode("span",{class:"zm-settings-label"},"根节点线条",-1)),e.createElementVNode("div",td,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(s),h=>(e.openBlock(),e.createElementBlock("button",{key:h.value,class:e.normalizeClass(["zm-line-style-btn",{"is-on":t.settings.rootLineStyle===h.value}]),title:h.label,onClick:$=>a("rootLineStyle",h.value)},[(e.openBlock(),e.createElementBlock("svg",{viewBox:h.viewBox,width:"28",height:"14",preserveAspectRatio:"none"},[h.value==="arc"?(e.openBlock(),e.createElementBlock("path",id)):h.value==="rounded-elbow"?(e.openBlock(),e.createElementBlock("path",rd)):h.value==="elbow"?(e.openBlock(),e.createElementBlock("path",ld)):h.value==="curve"?(e.openBlock(),e.createElementBlock("path",ad)):(e.openBlock(),e.createElementBlock("line",sd))],8,od)),e.createElementVNode("span",cd,e.toDisplayString(h.label),1)],10,nd))),128))])]),e.createElementVNode("div",dd,[x[33]||(x[33]=e.createElementVNode("span",{class:"zm-settings-label"},"非根节点线条",-1)),e.createElementVNode("div",ud,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(c,h=>e.createElementVNode("button",{key:h.value,class:e.normalizeClass(["zm-line-style-btn",{"is-on":t.settings.lineStyle===h.value}]),title:h.label,onClick:$=>a("lineStyle",h.value)},[(e.openBlock(),e.createElementBlock("svg",{viewBox:h.viewBox,width:"28",height:"14",preserveAspectRatio:"none"},[h.value==="arc"?(e.openBlock(),e.createElementBlock("path",pd)):h.value==="rounded-elbow"?(e.openBlock(),e.createElementBlock("path",hd)):h.value==="elbow"?(e.openBlock(),e.createElementBlock("path",gd)):h.value==="curve"?(e.openBlock(),e.createElementBlock("path",bd)):(e.openBlock(),e.createElementBlock("line",kd))],8,md)),e.createElementVNode("span",yd,e.toDisplayString(h.label),1)],10,fd)),64))])]),t.settings.lineStyle==="rounded-elbow"||t.settings.rootLineStyle==="rounded-elbow"?(e.openBlock(),e.createElementBlock("div",xd,[e.createElementVNode("span",Ed,[x[34]||(x[34]=e.createTextVNode("圆角大小 ",-1)),e.createElementVNode("span",wd,e.toDisplayString(t.settings.elbowRadius)+"px",1)]),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"1",min:"2",max:"40",value:t.settings.elbowRadius,onChange:x[6]||(x[6]=h=>a("elbowRadius",parseFloat(h.target.value)||20))},null,40,Nd)])):e.createCommentVNode("",!0),t.settings.lineStyle==="rounded-elbow"||t.settings.rootLineStyle==="rounded-elbow"?(e.openBlock(),e.createElementBlock("div",Sd,[x[35]||(x[35]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"2",max:"40",step:"1",value:t.settings.elbowRadius,onInput:x[7]||(x[7]=h=>a("elbowRadius",parseFloat(h.target.value)))},null,40,Td)])):e.createCommentVNode("",!0),e.createElementVNode("div",Cd,[x[37]||(x[37]=e.createElementVNode("span",{class:"zm-settings-label"},"线条起点",-1)),e.createElementVNode("div",Md,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(u,h=>e.createElementVNode("button",{key:h.value,class:e.normalizeClass(["zm-line-style-btn",{"is-on":t.settings.lineOrigin===h.value}]),title:h.label,onClick:$=>a("lineOrigin",h.value)},[(e.openBlock(),e.createElementBlock("svg",_d,[x[36]||(x[36]=e.createElementVNode("rect",{x:"8",y:"6",width:"12",height:"6",rx:"2",fill:"none",stroke:"currentColor","stroke-width":"1.2",opacity:"0.5"},null,-1)),h.value==="edge"?(e.openBlock(),e.createElementBlock("path",Rd)):h.value==="center"?(e.openBlock(),e.createElementBlock("path",Bd)):(e.openBlock(),e.createElementBlock("path",vd))])),e.createElementVNode("span",zd,e.toDisplayString(h.label),1)],10,Ad)),64))])]),e.createElementVNode("div",Id,[x[39]||(x[39]=e.createElementVNode("span",{class:"zm-settings-label"},"一级分支彩虹色",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.rainbowBranch}]),onClick:x[8]||(x[8]=h=>a("rainbowBranch",!t.settings.rainbowBranch))},[...x[38]||(x[38]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),t.settings.rainbowBranch?(e.openBlock(),e.createElementBlock("div",Ld,[x[40]||(x[40]=e.createElementVNode("div",{class:"zm-settings-field"},[e.createElementVNode("span",{class:"zm-settings-label"},"配色方案")],-1)),e.createElementVNode("div",Od,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,h=>(e.openBlock(),e.createElementBlock("button",{key:h.id,class:e.normalizeClass(["zm-palette-option",{"is-active":t.settings.branchPaletteId===h.id}]),onClick:$=>a("branchPaletteId",h.id)},[e.createElementVNode("span",Vd,e.toDisplayString(h.name),1),e.createElementVNode("span",$d,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.colors,($,G)=>(e.openBlock(),e.createElementBlock("span",{key:G,class:"zm-palette-option-swatch",style:e.normalizeStyle({background:$})},null,4))),128))])],10,Dd))),128))]),t.settings.customPalettes.find(h=>h.id===t.settings.branchPaletteId)?(e.openBlock(),e.createElementBlock("div",Pd,[e.createElementVNode("textarea",{class:"zm-palette-textarea",rows:"3",spellcheck:"false",placeholder:"一行一个 hex,例如 #f87171",value:w(t.settings.customPalettes.find(h=>h.id===t.settings.branchPaletteId)),onInput:x[9]||(x[9]=h=>C[t.settings.customPalettes.find($=>$.id===t.settings.branchPaletteId).id]=h.target.value)},null,40,Fd),e.createElementVNode("div",Ud,[e.createElementVNode("button",{type:"button",class:"zm-data-btn is-primary",onClick:x[10]||(x[10]=h=>V(t.settings.customPalettes.find($=>$.id===t.settings.branchPaletteId)))},"保存"),e.createElementVNode("button",{type:"button",class:"zm-data-btn",onClick:x[11]||(x[11]=h=>U(t.settings.customPalettes.find($=>$.id===t.settings.branchPaletteId)))},"删除")])])):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"zm-palette-add",onClick:R},"+ 新建配色")])):e.createCommentVNode("",!0),x[55]||(x[55]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",Hd,[x[42]||(x[42]=e.createElementVNode("span",{class:"zm-settings-label"},"每条连线独立渐变",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.taperedEdge}]),onClick:x[12]||(x[12]=h=>a("taperedEdge",!t.settings.taperedEdge))},[...x[41]||(x[41]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),t.settings.taperedEdge?(e.openBlock(),e.createElementBlock("div",Wd,[e.createElementVNode("span",Gd,[x[43]||(x[43]=e.createTextVNode("层级衰减 ",-1)),e.createElementVNode("span",jd,e.toDisplayString(Math.round(t.settings.lineWidthTaper*100))+"%",1)]),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"0.05",min:"0.1",max:"1",value:t.settings.lineWidthTaper,onChange:x[13]||(x[13]=h=>a("lineWidthTaper",parseFloat(h.target.value)||.67))},null,40,Kd)])):e.createCommentVNode("",!0),t.settings.taperedEdge?(e.openBlock(),e.createElementBlock("div",Yd,[x[44]||(x[44]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"0.1",max:"1",step:"0.01",value:t.settings.lineWidthTaper,onInput:x[14]||(x[14]=h=>a("lineWidthTaper",parseFloat(h.target.value)))},null,40,qd)])):e.createCommentVNode("",!0),t.settings.taperedEdge?(e.openBlock(),e.createElementBlock("div",Xd,[x[46]||(x[46]=e.createElementVNode("span",{class:"zm-settings-label"},"非根节点相同粗细",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.uniformLineWidth}]),onClick:x[15]||(x[15]=h=>a("uniformLineWidth",!t.settings.uniformLineWidth))},[...x[45]||(x[45]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)])):e.createCommentVNode("",!0),e.createElementVNode("div",Zd,[e.createElementVNode("span",Jd,[x[47]||(x[47]=e.createTextVNode("一级分支间距 ",-1)),e.createElementVNode("span",Qd,e.toDisplayString(t.settings.branchGap)+"px",1)]),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"2",min:"0",max:"80",value:t.settings.branchGap,onChange:x[16]||(x[16]=h=>a("branchGap",parseFloat(h.target.value)||0))},null,40,eu)]),e.createElementVNode("div",tu,[x[48]||(x[48]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"0",max:"80",step:"2",value:t.settings.branchGap,onInput:x[17]||(x[17]=h=>a("branchGap",parseFloat(h.target.value)))},null,40,nu)]),e.createElementVNode("div",ou,[x[50]||(x[50]=e.createElementVNode("span",{class:"zm-settings-label"},"显示节点序号",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.showOrderBadge}]),onClick:x[18]||(x[18]=h=>a("showOrderBadge",!t.settings.showOrderBadge))},[...x[49]||(x[49]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),e.createElementVNode("div",iu,[(e.openBlock(),e.createElementBlock("svg",ru,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(j.value,(h,$)=>(e.openBlock(),e.createElementBlock("line",{key:$,x1:h.x1,y1:h.y1,x2:h.x2,y2:h.y2,stroke:t.settings.rainbowBranch?h.color:"#94a3b8","stroke-width":h.w,"stroke-linecap":"butt"},null,8,lu))),128))])),x[51]||(x[51]=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",au,[e.createElementVNode("h4",su,[x[56]||(x[56]=e.createTextVNode(" 节点 ",-1)),t.selectedNodeText?(e.openBlock(),e.createElementBlock("span",cu,'"'+e.toDisplayString(t.selectedNodeText)+'"',1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",du,[x[57]||(x[57]=e.createElementVNode("span",{class:"zm-settings-label"},"背景颜色",-1)),e.createElementVNode("span",uu,e.toDisplayString(((re=t.nodeStyle)==null?void 0:re.bg)||"默认"),1)]),e.createElementVNode("div",fu,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(I,h=>{var $;return e.createElementVNode("button",{key:"bg-"+h,class:e.normalizeClass(["zm-swatch",{"is-active":(($=t.nodeStyle)==null?void 0:$.bg)===h}]),style:e.normalizeStyle({background:h}),title:h,onClick:G=>p({bg:h})},null,14,mu)}),64)),e.createElementVNode("label",pu,[e.createElementVNode("input",{type:"color",value:((pe=t.nodeStyle)==null?void 0:pe.bg)||"#ffffff",onInput:x[19]||(x[19]=h=>p({bg:h.target.value}))},null,40,hu)]),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"清除",onClick:x[20]||(x[20]=h=>p({bg:void 0}))},"∅")]),e.createElementVNode("div",gu,[x[58]||(x[58]=e.createElementVNode("span",{class:"zm-settings-label"},"文字颜色",-1)),e.createElementVNode("span",bu,e.toDisplayString(((de=t.nodeStyle)==null?void 0:de.textColor)||"默认"),1)]),e.createElementVNode("div",ku,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(I,h=>{var $;return e.createElementVNode("button",{key:"fg-"+h,class:e.normalizeClass(["zm-swatch",{"is-active":(($=t.nodeStyle)==null?void 0:$.textColor)===h}]),style:e.normalizeStyle({background:h}),title:h,onClick:G=>p({textColor:h})},null,14,yu)}),64)),e.createElementVNode("label",xu,[e.createElementVNode("input",{type:"color",value:((we=t.nodeStyle)==null?void 0:we.textColor)||"#1e2937",onInput:x[21]||(x[21]=h=>p({textColor:h.target.value}))},null,40,Eu)]),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"清除",onClick:x[22]||(x[22]=h=>p({textColor:void 0}))},"∅")]),x[62]||(x[62]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",wu,[x[59]||(x[59]=e.createElementVNode("span",{class:"zm-settings-label"},"字重",-1)),e.createElementVNode("select",{class:"zm-select",value:((ee=t.nodeStyle)==null?void 0:ee.fontWeight)??400,onChange:x[23]||(x[23]=h=>p({fontWeight:parseInt(h.target.value)}))},[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(d,h=>e.createElementVNode("option",{key:h.value,value:h.value},e.toDisplayString(h.label),9,Su)),64))],40,Nu)]),e.createElementVNode("div",Tu,[x[60]||(x[60]=e.createElementVNode("span",{class:"zm-settings-label"},"文字大小",-1)),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"1",min:"8",max:"48",value:((ce=t.nodeStyle)==null?void 0:ce.fontSize)??14,onChange:x[24]||(x[24]=h=>p({fontSize:parseInt(h.target.value)||14}))},null,40,Cu)]),e.createElementVNode("div",Mu,[x[61]||(x[61]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"8",max:"48",step:"1",value:((ue=t.nodeStyle)==null?void 0:ue.fontSize)??14,onInput:x[25]||(x[25]=h=>p({fontSize:parseInt(h.target.value)}))},null,40,Au)]),x[63]||(x[63]=e.createElementVNode("p",{class:"zm-settings-hint"},"仅作用于当前节点,不影响子节点。",-1))])):e.createCommentVNode("",!0),e.createElementVNode("section",_u,[e.createElementVNode("button",{class:"zm-settings-reset",onClick:x[26]||(x[26]=h=>r("reset"))},"恢复默认设置")])])}}}),[["__scopeId","data-v-ed1e759c"]]),Cr=20;function Ru(t,o){t.style.height="auto";const n=o.minRows*Cr,r=o.maxRows>0?o.maxRows*Cr:1/0,a=Math.max(n,Math.min(r,t.scrollHeight));t.style.height=a+"px",t.style.overflowY=t.scrollHeight>r?"auto":"hidden"}function xi(t,o={}){const n={minRows:o.minRows??3,maxRows:o.maxRows??12};function r(){const c=t.value;c&&Ru(c,n)}function a(){r()}e.onMounted(async()=>{await e.nextTick();const c=t.value;c&&(c.addEventListener("input",a),r())}),e.watch(()=>{var c;return(c=t.value)==null?void 0:c.value},()=>r()),e.onBeforeUnmount(()=>{const c=t.value;c&&c.removeEventListener("input",a)})}function Bu(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Mr(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)&&Mr(n)}),t}class Ar{constructor(o){o.data===void 0&&(o.data={}),this.data=o.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function _r(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function pn(t,...o){const n=Object.create(null);for(const r in t)n[r]=t[r];return o.forEach(function(r){for(const a in r)n[a]=r[a]}),n}const vu="</span>",Rr=t=>!!t.scope,zu=(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,a)=>`${r}${"_".repeat(a+1)}`)].join(" ")}return`${o}${t}`};class Iu{constructor(o,n){this.buffer="",this.classPrefix=n.classPrefix,o.walk(this)}addText(o){this.buffer+=_r(o)}openNode(o){if(!Rr(o))return;const n=zu(o.scope,{prefix:this.classPrefix});this.span(n)}closeNode(o){Rr(o)&&(this.buffer+=vu)}value(){return this.buffer}span(o){this.buffer+=`<span class="${o}">`}}const Br=(t={})=>{const o={children:[]};return Object.assign(o,t),o};class Ei{constructor(){this.rootNode=Br(),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=Br({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=>{Ei._collapse(n)}))}}class Lu extends Ei{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 Iu(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function lo(t){return t?typeof t=="string"?t:t.source:null}function vr(t){return Nn("(?=",t,")")}function Ou(t){return Nn("(?:",t,")*")}function Du(t){return Nn("(?:",t,")?")}function Nn(...t){return t.map(n=>lo(n)).join("")}function Vu(t){const o=t[t.length-1];return typeof o=="object"&&o.constructor===Object?(t.splice(t.length-1,1),o):{}}function wi(...t){return"("+(Vu(t).capture?"":"?:")+t.map(r=>lo(r)).join("|")+")"}function zr(t){return new RegExp(t.toString()+"|").exec("").length-1}function $u(t,o){const n=t&&t.exec(o);return n&&n.index===0}const Pu=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Ni(t,{joinWith:o}){let n=0;return t.map(r=>{n+=1;const a=n;let c=lo(r),s="";for(;c.length>0;){const u=Pu.exec(c);if(!u){s+=c;break}s+=c.substring(0,u.index),c=c.substring(u.index+u[0].length),u[0][0]==="\\"&&u[1]?s+="\\"+String(Number(u[1])+a):(s+=u[0],u[0]==="("&&n++)}return s}).map(r=>`(${r})`).join(o)}const Fu=/\b\B/,Ir="[a-zA-Z]\\w*",Si="[a-zA-Z_]\\w*",Lr="\\b\\d+(\\.\\d+)?",Or="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Dr="\\b(0b[01]+)",Uu="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",Hu=(t={})=>{const o=/^#![ ]*\//;return t.binary&&(t.begin=Nn(o,/.*\b/,t.binary,/\b.*/)),pn({scope:"meta",begin:o,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},t)},ao={begin:"\\\\[\\s\\S]",relevance:0},Wu={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[ao]},Gu={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[ao]},ju={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/},Po=function(t,o,n={}){const r=pn({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 a=wi("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(/[ ]+/,"(",a,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},Ku=Po("//","$"),Yu=Po("/\\*","\\*/"),qu=Po("#","$"),Xu={scope:"number",begin:Lr,relevance:0},Zu={scope:"number",begin:Or,relevance:0},Ju={scope:"number",begin:Dr,relevance:0},Qu={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[ao,{begin:/\[/,end:/\]/,relevance:0,contains:[ao]}]},ef={scope:"title",begin:Ir,relevance:0},tf={scope:"title",begin:Si,relevance:0},nf={begin:"\\.\\s*"+Si,relevance:0};var Fo=Object.freeze({__proto__:null,APOS_STRING_MODE:Wu,BACKSLASH_ESCAPE:ao,BINARY_NUMBER_MODE:Ju,BINARY_NUMBER_RE:Dr,COMMENT:Po,C_BLOCK_COMMENT_MODE:Yu,C_LINE_COMMENT_MODE:Ku,C_NUMBER_MODE:Zu,C_NUMBER_RE:Or,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:qu,IDENT_RE:Ir,MATCH_NOTHING_RE:Fu,METHOD_GUARD:nf,NUMBER_MODE:Xu,NUMBER_RE:Lr,PHRASAL_WORDS_MODE:ju,QUOTE_STRING_MODE:Gu,REGEXP_MODE:Qu,RE_STARTERS_RE:Uu,SHEBANG:Hu,TITLE_MODE:ef,UNDERSCORE_IDENT_RE:Si,UNDERSCORE_TITLE_MODE:tf});function of(t,o){t.input[t.index-1]==="."&&o.ignoreMatch()}function rf(t,o){t.className!==void 0&&(t.scope=t.className,delete t.className)}function lf(t,o){o&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=of,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function af(t,o){Array.isArray(t.illegal)&&(t.illegal=wi(...t.illegal))}function sf(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 cf(t,o){t.relevance===void 0&&(t.relevance=1)}const df=(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,vr(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},uf=["of","and","for","in","not","or","if","then","parent","list","value"],ff="keyword";function Vr(t,o,n=ff){const r=Object.create(null);return typeof t=="string"?a(n,t.split(" ")):Array.isArray(t)?a(n,t):Object.keys(t).forEach(function(c){Object.assign(r,Vr(t[c],o,c))}),r;function a(c,s){o&&(s=s.map(u=>u.toLowerCase())),s.forEach(function(u){const d=u.split("|");r[d[0]]=[c,mf(d[0],d[1])]})}}function mf(t,o){return o?Number(o):pf(t)?0:1}function pf(t){return uf.includes(t.toLowerCase())}const $r={},Sn=t=>{console.error(t)},Pr=(t,...o)=>{console.log(`WARN: ${t}`,...o)},Vn=(t,o)=>{$r[`${t}/${o}`]||(console.log(`Deprecated as of ${t}. ${o}`),$r[`${t}/${o}`]=!0)},Uo=new Error;function Fr(t,o,{key:n}){let r=0;const a=t[n],c={},s={};for(let u=1;u<=o.length;u++)s[u+r]=a[u],c[u+r]=!0,r+=zr(o[u-1]);t[n]=s,t[n]._emit=c,t[n]._multi=!0}function hf(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw Sn("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Uo;if(typeof t.beginScope!="object"||t.beginScope===null)throw Sn("beginScope must be object"),Uo;Fr(t,t.begin,{key:"beginScope"}),t.begin=Ni(t.begin,{joinWith:""})}}function gf(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw Sn("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Uo;if(typeof t.endScope!="object"||t.endScope===null)throw Sn("endScope must be object"),Uo;Fr(t,t.end,{key:"endScope"}),t.end=Ni(t.end,{joinWith:""})}}function bf(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function kf(t){bf(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),hf(t),gf(t)}function yf(t){function o(s,u){return new RegExp(lo(s),"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+=zr(u)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const u=this.regexes.map(d=>d[1]);this.matcherRe=o(Ni(u,{joinWith:"|"}),!0),this.lastIndex=0}exec(u){this.matcherRe.lastIndex=this.lastIndex;const d=this.matcherRe.exec(u);if(!d)return null;const p=d.findIndex((C,w)=>w>0&&C!==void 0),b=this.matchIndexes[p];return d.splice(0,p),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(([p,b])=>d.addRule(p,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 p=d.exec(u);if(this.resumingScanAtSamePosition()&&!(p&&p.index===this.lastIndex)){const b=this.getMatcher(0);b.lastIndex=this.lastIndex+1,p=b.exec(u)}return p&&(this.regexIndex+=p.position+1,this.regexIndex===this.count&&this.considerAll()),p}}function a(s){const u=new r;return s.contains.forEach(d=>u.addRule(d.begin,{rule:d,type:"begin"})),s.terminatorEnd&&u.addRule(s.terminatorEnd,{type:"end"}),s.illegal&&u.addRule(s.illegal,{type:"illegal"}),u}function c(s,u){const d=s;if(s.isCompiled)return d;[rf,sf,kf,df].forEach(b=>b(s,u)),t.compilerExtensions.forEach(b=>b(s,u)),s.__beforeBegin=null,[lf,af,cf].forEach(b=>b(s,u)),s.isCompiled=!0;let p=null;return typeof s.keywords=="object"&&s.keywords.$pattern&&(s.keywords=Object.assign({},s.keywords),p=s.keywords.$pattern,delete s.keywords.$pattern),p=p||/\w+/,s.keywords&&(s.keywords=Vr(s.keywords,t.case_insensitive)),d.keywordPatternRe=o(p,!0),u&&(s.begin||(s.begin=/\B|\b/),d.beginRe=o(d.begin),!s.end&&!s.endsWithParent&&(s.end=/\B|\b/),s.end&&(d.endRe=o(d.end)),d.terminatorEnd=lo(d.end)||"",s.endsWithParent&&u.terminatorEnd&&(d.terminatorEnd+=(s.end?"|":"")+u.terminatorEnd)),s.illegal&&(d.illegalRe=o(s.illegal)),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map(function(b){return xf(b==="self"?s:b)})),s.contains.forEach(function(b){c(b,d)}),s.starts&&c(s.starts,u),d.matcher=a(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=pn(t.classNameAliases||{}),c(t)}function Ur(t){return t?t.endsWithParent||Ur(t.starts):!1}function xf(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(o){return pn(t,{variants:null},o)})),t.cachedVariants?t.cachedVariants:Ur(t)?pn(t,{starts:t.starts?pn(t.starts):null}):Object.isFrozen(t)?pn(t):t}var Ef="11.11.1";class wf extends Error{constructor(o,n){super(o),this.name="HTMLInjectionError",this.html=n}}const Ti=_r,Hr=pn,Wr=Symbol("nomatch"),Nf=7,Gr=function(t){const o=Object.create(null),n=Object.create(null),r=[];let a=!0;const c="Could not find the language '{}', did you forget to load/include a language module?",s={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:Lu};function d(h){return u.noHighlightRe.test(h)}function p(h){let $=h.className+" ";$+=h.parentNode?h.parentNode.className:"";const G=u.languageDetectRe.exec($);if(G){const oe=x(G[1]);return oe||(Pr(c.replace("{}",G[1])),Pr("Falling back to no-highlight mode for this block.",h)),oe?G[1]:"no-highlight"}return $.split(/\s+/).find(oe=>d(oe)||x(oe))}function b(h,$,G){let oe="",fe="";typeof $=="object"?(oe=h,G=$.ignoreIllegals,fe=$.language):(Vn("10.7.0","highlight(lang, code, ...args) has been deprecated."),Vn("10.7.0",`Please use highlight(code, options) instead.
59
- https://github.com/highlightjs/highlight.js/issues/2277`),fe=h,oe=$),G===void 0&&(G=!0);const O={code:oe,language:fe};ce("before:highlight",O);const L=O.result?O.result:C(O.language,O.code,G);return L.code=O.code,ce("after:highlight",L),L}function C(h,$,G,oe){const fe=Object.create(null);function O(q,le){return q.keywords[le]}function L(){if(!me.keywords){De.addText(ze);return}let q=0;me.keywordPatternRe.lastIndex=0;let le=me.keywordPatternRe.exec(ze),xe="";for(;le;){xe+=ze.substring(q,le.index);const Re=it.case_insensitive?le[0].toLowerCase():le[0],Ge=O(me,Re);if(Ge){const[lt,Mt]=Ge;if(De.addText(xe),xe="",fe[Re]=(fe[Re]||0)+1,fe[Re]<=Nf&&(Ft+=Mt),lt.startsWith("_"))xe+=le[0];else{const Bn=it.classNameAliases[lt]||lt;z(le[0],Bn)}}else xe+=le[0];q=me.keywordPatternRe.lastIndex,le=me.keywordPatternRe.exec(ze)}xe+=ze.substring(q),De.addText(xe)}function se(){if(ze==="")return;let q=null;if(typeof me.subLanguage=="string"){if(!o[me.subLanguage]){De.addText(ze);return}q=C(me.subLanguage,ze,!0,mt[me.subLanguage]),mt[me.subLanguage]=q._top}else q=V(ze,me.subLanguage.length?me.subLanguage:null);me.relevance>0&&(Ft+=q.relevance),De.__addSublanguage(q._emitter,q.language)}function ke(){me.subLanguage!=null?se():L(),ze=""}function z(q,le){q!==""&&(De.startScope(le),De.addText(q),De.endScope())}function S(q,le){let xe=1;const Re=le.length-1;for(;xe<=Re;){if(!q._emit[xe]){xe++;continue}const Ge=it.classNameAliases[q[xe]]||q[xe],lt=le[xe];Ge?z(lt,Ge):(ze=lt,L(),ze=""),xe++}}function F(q,le){return q.scope&&typeof q.scope=="string"&&De.openNode(it.classNameAliases[q.scope]||q.scope),q.beginScope&&(q.beginScope._wrap?(z(ze,it.classNameAliases[q.beginScope._wrap]||q.beginScope._wrap),ze=""):q.beginScope._multi&&(S(q.beginScope,le),ze="")),me=Object.create(q,{parent:{value:me}}),me}function W(q,le,xe){let Re=$u(q.endRe,xe);if(Re){if(q["on:end"]){const Ge=new Ar(q);q["on:end"](le,Ge),Ge.isMatchIgnored&&(Re=!1)}if(Re){for(;q.endsParent&&q.parent;)q=q.parent;return q}}if(q.endsWithParent)return W(q.parent,le,xe)}function te(q){return me.matcher.regexIndex===0?(ze+=q[0],1):(wt=!0,0)}function ye(q){const le=q[0],xe=q.rule,Re=new Ar(xe),Ge=[xe.__beforeBegin,xe["on:begin"]];for(const lt of Ge)if(lt&&(lt(q,Re),Re.isMatchIgnored))return te(le);return xe.skip?ze+=le:(xe.excludeBegin&&(ze+=le),ke(),!xe.returnBegin&&!xe.excludeBegin&&(ze=le)),F(xe,q),xe.returnBegin?0:le.length}function nt(q){const le=q[0],xe=$.substring(q.index),Re=W(me,q,xe);if(!Re)return Wr;const Ge=me;me.endScope&&me.endScope._wrap?(ke(),z(le,me.endScope._wrap)):me.endScope&&me.endScope._multi?(ke(),S(me.endScope,q)):Ge.skip?ze+=le:(Ge.returnEnd||Ge.excludeEnd||(ze+=le),ke(),Ge.excludeEnd&&(ze=le));do me.scope&&De.closeNode(),!me.skip&&!me.subLanguage&&(Ft+=me.relevance),me=me.parent;while(me!==Re.parent);return Re.starts&&F(Re.starts,q),Ge.returnEnd?0:le.length}function ft(){const q=[];for(let le=me;le!==it;le=le.parent)le.scope&&q.unshift(le.scope);q.forEach(le=>De.openNode(le))}let ot={};function an(q,le){const xe=le&&le[0];if(ze+=q,xe==null)return ke(),0;if(ot.type==="begin"&&le.type==="end"&&ot.index===le.index&&xe===""){if(ze+=$.slice(le.index,le.index+1),!a){const Re=new Error(`0 width match regex (${h})`);throw Re.languageName=h,Re.badRule=ot.rule,Re}return 1}if(ot=le,le.type==="begin")return ye(le);if(le.type==="illegal"&&!G){const Re=new Error('Illegal lexeme "'+xe+'" for mode "'+(me.scope||"<unnamed>")+'"');throw Re.mode=me,Re}else if(le.type==="end"){const Re=nt(le);if(Re!==Wr)return Re}if(le.type==="illegal"&&xe==="")return ze+=`
60
- `,1;if(Ct>1e5&&Ct>le.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ze+=xe,xe.length}const it=x(h);if(!it)throw Sn(c.replace("{}",h)),new Error('Unknown language: "'+h+'"');const sn=yf(it);let Pt="",me=oe||sn;const mt={},De=new u.__emitter(u);ft();let ze="",Ft=0,rt=0,Ct=0,wt=!1;try{if(it.__emitTokens)it.__emitTokens($,De);else{for(me.matcher.considerAll();;){Ct++,wt?wt=!1:me.matcher.considerAll(),me.matcher.lastIndex=rt;const q=me.matcher.exec($);if(!q)break;const le=$.substring(rt,q.index),xe=an(le,q);rt=q.index+xe}an($.substring(rt))}return De.finalize(),Pt=De.toHTML(),{language:h,value:Pt,relevance:Ft,illegal:!1,_emitter:De,_top:me}}catch(q){if(q.message&&q.message.includes("Illegal"))return{language:h,value:Ti($),illegal:!0,relevance:0,_illegalBy:{message:q.message,index:rt,context:$.slice(rt-100,rt+100),mode:q.mode,resultSoFar:Pt},_emitter:De};if(a)return{language:h,value:Ti($),illegal:!1,relevance:0,errorRaised:q,_emitter:De,_top:me};throw q}}function w(h){const $={value:Ti(h),illegal:!1,relevance:0,_top:s,_emitter:new u.__emitter(u)};return $._emitter.addText(h),$}function V(h,$){$=$||u.languages||Object.keys(o);const G=w(h),oe=$.filter(x).filter(pe).map(ke=>C(ke,h,!1));oe.unshift(G);const fe=oe.sort((ke,z)=>{if(ke.relevance!==z.relevance)return z.relevance-ke.relevance;if(ke.language&&z.language){if(x(ke.language).supersetOf===z.language)return 1;if(x(z.language).supersetOf===ke.language)return-1}return 0}),[O,L]=fe,se=O;return se.secondBest=L,se}function R(h,$,G){const oe=$&&n[$]||G;h.classList.add("hljs"),h.classList.add(`language-${oe}`)}function U(h){let $=null;const G=p(h);if(d(G))return;if(ce("before:highlightElement",{el:h,language:G}),h.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",h);return}if(h.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(h)),u.throwUnescapedHTML))throw new wf("One of your code blocks includes unescaped HTML.",h.innerHTML);$=h;const oe=$.textContent,fe=G?b(oe,{language:G,ignoreIllegals:!0}):V(oe);h.innerHTML=fe.value,h.dataset.highlighted="yes",R(h,G,fe.language),h.result={language:fe.language,re:fe.relevance,relevance:fe.relevance},fe.secondBest&&(h.secondBest={language:fe.secondBest.language,relevance:fe.secondBest.relevance}),ce("after:highlightElement",{el:h,result:fe,text:oe})}function I(h){u=Hr(u,h)}const _=()=>{m(),Vn("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function y(){m(),Vn("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let k=!1;function m(){function h(){m()}if(document.readyState==="loading"){k||window.addEventListener("DOMContentLoaded",h,!1),k=!0;return}document.querySelectorAll(u.cssSelector).forEach(U)}function P(h,$){let G=null;try{G=$(t)}catch(oe){if(Sn("Language definition for '{}' could not be registered.".replace("{}",h)),a)Sn(oe);else throw oe;G=s}G.name||(G.name=h),o[h]=G,G.rawDefinition=$.bind(null,t),G.aliases&&re(G.aliases,{languageName:h})}function j(h){delete o[h];for(const $ of Object.keys(n))n[$]===h&&delete n[$]}function Y(){return Object.keys(o)}function x(h){return h=(h||"").toLowerCase(),o[h]||o[n[h]]}function re(h,{languageName:$}){typeof h=="string"&&(h=[h]),h.forEach(G=>{n[G.toLowerCase()]=$})}function pe(h){const $=x(h);return $&&!$.disableAutodetect}function de(h){h["before:highlightBlock"]&&!h["before:highlightElement"]&&(h["before:highlightElement"]=$=>{h["before:highlightBlock"](Object.assign({block:$.el},$))}),h["after:highlightBlock"]&&!h["after:highlightElement"]&&(h["after:highlightElement"]=$=>{h["after:highlightBlock"](Object.assign({block:$.el},$))})}function we(h){de(h),r.push(h)}function ee(h){const $=r.indexOf(h);$!==-1&&r.splice($,1)}function ce(h,$){const G=h;r.forEach(function(oe){oe[G]&&oe[G]($)})}function ue(h){return Vn("10.7.0","highlightBlock will be removed entirely in v12.0"),Vn("10.7.0","Please use highlightElement now."),U(h)}Object.assign(t,{highlight:b,highlightAuto:V,highlightAll:m,highlightElement:U,highlightBlock:ue,configure:I,initHighlighting:_,initHighlightingOnLoad:y,registerLanguage:P,unregisterLanguage:j,listLanguages:Y,getLanguage:x,registerAliases:re,autoDetection:pe,inherit:Hr,addPlugin:we,removePlugin:ee}),t.debugMode=function(){a=!1},t.safeMode=function(){a=!0},t.versionString=Ef,t.regex={concat:Nn,lookahead:vr,either:wi,optional:Du,anyNumberOfTimes:Ou};for(const h in Fo)typeof Fo[h]=="object"&&Mr(Fo[h]);return Object.assign(t,Fo),t},$n=Gr({});$n.newInstance=()=>Gr({});var Sf=$n;$n.HighlightJS=$n,$n.default=$n;const Ci=Bu(Sf);function Mi(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 a={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},c=t.inherit(t.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),s={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,a]};a.contains.push(u);const d={match:/\\"/},p={className:"string",begin:/'/,end:/'/},b={match:/\\'/},C={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,n]},w=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],V=t.SHEBANG({binary:`(${w.join("|")})`,relevance:10}),R={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},U=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],I=["true","false"],_={match:/(\/[a-z._-]+)+/},y=["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"],P=["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:U,literal:I,built_in:[...y,...k,"set","shopt",...m,...P]},contains:[V,t.SHEBANG(),R,C,c,s,_,u,d,p,b,n]}}const Tf=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_-]*/}}),Cf=["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"],Mf=["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"],Af=[...Cf,...Mf],_f=["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(),Rf=["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(),Bf=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),vf=["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 zf(t){const o=t.regex,n=Tf(t),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},a="and or not only",c=/@-?\w[\w]*(-\w+)*/,s="[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:"\\."+s,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+Rf.join("|")+")"},{begin:":(:)?("+Bf.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+vf.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:c},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:a,attribute:_f.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...u,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Af.join("|")+")\\b"}]}}function jr(t){const c={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:c,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:c,illegal:/["']/}]}]}}var Pn="[0-9](_*[0-9])*",Ho=`\\.(${Pn})`,Wo="[0-9a-fA-F](_*[0-9a-fA-F])*",Kr={className:"number",variants:[{begin:`(\\b(${Pn})((${Ho})|\\.)?|(${Ho}))[eE][+-]?(${Pn})[fFdD]?\\b`},{begin:`\\b(${Pn})((${Ho})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Ho})[fFdD]?\\b`},{begin:`\\b(${Pn})[fFdD]\\b`},{begin:`\\b0[xX]((${Wo})\\.?|(${Wo})?\\.(${Wo}))[pP][+-]?(${Pn})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Wo})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Yr(t,o,n){return n===-1?"":t.replace(o,r=>Yr(t,o,n-1))}function If(t){const o=t.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=n+Yr("(?:<"+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"]},p={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:[p,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,Kr,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},Kr,p]}}const qr="[A-Za-z$_][0-9A-Za-z$_]*",Lf=["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"],Of=["true","false","null","undefined","NaN","Infinity"],Xr=["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"],Zr=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Jr=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Df=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Vf=[].concat(Jr,Xr,Zr);function Qr(t){const o=t.regex,n=(G,{after:oe})=>{const fe="</"+G[0].slice(1);return G.input.indexOf(fe,oe)!==-1},r=qr,a={begin:"<>",end:"</>"},c=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(G,oe)=>{const fe=G[0].length+G.index,O=G.input[fe];if(O==="<"||O===","){oe.ignoreMatch();return}O===">"&&(n(G,{after:fe})||oe.ignoreMatch());let L;const se=G.input.substring(fe);if(L=se.match(/^\s*=/)){oe.ignoreMatch();return}if((L=se.match(/^\s+extends\s+/))&&L.index===0){oe.ignoreMatch();return}}},u={$pattern:qr,keyword:Lf,literal:Of,built_in:Vf,"variable.language":Df},d="[0-9](_?[0-9])*",p=`\\.(${d})`,b="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",C={className:"number",variants:[{begin:`(\\b(${b})((${p})|\\.)?|(${p}))[eE][+-]?(${d})\\b`},{begin:`\\b(${b})\\b((${p})\\b|\\.)?|(${p})\\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},w={className:"subst",begin:"\\$\\{",end:"\\}",keywords:u,contains:[]},V={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,w],subLanguage:"xml"}},R={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,w],subLanguage:"css"}},U={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,w],subLanguage:"graphql"}},I={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,w]},y={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,R,U,I,{match:/\$\d+/},C];w.contains=k.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(k)});const m=[].concat(y,w.contains),P=m.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(m)}]),j={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:P},Y={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"}}]},x={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:{_:[...Xr,...Zr]}},re={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},pe={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[j],illegal:/%/},de={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function we(G){return o.concat("(?!",G.join("|"),")")}const ee={match:o.concat(/\b/,we([...Jr,"super","import"].map(G=>`${G}\\s*\\(`)),r,o.lookahead(/\s*\(/)),className:"title.function",relevance:0},ce={begin:o.concat(/\./,o.lookahead(o.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ue={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},j]},h="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",$={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,o.lookahead(h)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[j]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:P,CLASS_REFERENCE:x},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),re,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,V,R,U,I,y,{match:/\$\d+/},C,x,{scope:"attr",match:r+o.lookahead(":"),relevance:0},$,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[y,t.REGEXP_MODE,{className:"function",begin:h,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:P}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:a.begin,end:a.end},{match:c},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},pe,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[j,t.inherit(t.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},ce,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[j]},ee,de,Y,ue,{match:/\$[(.]/}]}}function $f(t){const o={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],a={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[o,n,t.QUOTE_STRING_MODE,a,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function el(t){const o=t.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},a={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}]},c={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},s={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},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}]},p={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}]},C=t.inherit(p,{contains:[]}),w=t.inherit(b,{contains:[]});p.contains.push(w),b.contains.push(C);let V=[n,d];return[p,b,C,w].forEach(_=>{_.contains=_.contains.concat(V)}),V=V.concat(p,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,c,p,b,{className:"quote",begin:"^>\\s+",contains:V,end:"$"},a,r,d,s,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function tl(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:/^(>>>|\.\.\.) /},p={className:"subst",begin:/\{/,end:/\}/,keywords:u,illegal:/#/},b={begin:/\{\{/,relevance:0},C={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,p]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,d,b,p]},{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,p]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,b,p]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},w="[0-9](_?[0-9])*",V=`(\\b(${w}))?\\.(${w})|\\b(${w})\\.`,R=`\\b|${r.join("|")}`,U={className:"number",relevance:0,variants:[{begin:`(\\b(${w})|(${V}))[eE][+-]?(${w})[jJ]?(?=${R})`},{begin:`(${V})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${R})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${R})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${R})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${R})`},{begin:`\\b(${w})[jJ](?=${R})`}]},I={className:"comment",begin:o.lookahead(/# type:/),end:/$/,keywords:u,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},_={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:["self",d,U,C,t.HASH_COMMENT_MODE]}]};return p.contains=[C,U,d],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:u,illegal:/(<\/|\?)|=>/,contains:[d,U,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},C,I,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[_]},{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:[U,_,C]}]}}function nl(t){const o=t.regex,n=/(r#)?/,r=o.concat(n,t.UNDERSCORE_IDENT_RE),a=o.concat(n,t.IDENT_RE),c={className:"title.function.invoke",relevance:0,begin:o.concat(/\b/,/(?!let|for|while|if|else|match\b)/,a,o.lookahead(/\s*\(/))},s="([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"],p=["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:p},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_]+)"+s},{begin:"\\b0o([0-7_]+)"+s},{begin:"\\b0x([A-Fa-f0-9_]+)"+s},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+s}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[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:p,type:b}},{className:"punctuation",begin:"->"},c]}}function Pf(t){const o=t.regex,n=t.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},a={begin:/"/,end:/"/,contains:[{match:/""/}]},c=["true","false","unknown"],s=["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"],p=["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"],C=["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"],w=["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,R=[...p,...d].filter(P=>!b.includes(P)),U={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},I={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},_={match:o.concat(/\b/,o.either(...V),/\s*\(/),relevance:0,keywords:{built_in:V}};function y(P){return o.concat(/\b/,o.either(...P.map(j=>j.replace(/\s+/,"\\s+"))),/\b/)}const k={scope:"keyword",match:y(w),relevance:0};function m(P,{exceptions:j,when:Y}={}){const x=Y;return j=j||[],P.map(re=>re.match(/\|\d+$/)||j.includes(re)?re:x(re)?`${re}|0`:re)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:m(R,{when:P=>P.length<3}),literal:c,type:u,built_in:C},contains:[{scope:"type",match:y(s)},k,_,U,r,a,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,n,I]}}const Go="[A-Za-z$_][0-9A-Za-z$_]*",ol=["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"],il=["true","false","null","undefined","NaN","Infinity"],rl=["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"],ll=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],al=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],sl=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],cl=[].concat(al,rl,ll);function Ff(t){const o=t.regex,n=(G,{after:oe})=>{const fe="</"+G[0].slice(1);return G.input.indexOf(fe,oe)!==-1},r=Go,a={begin:"<>",end:"</>"},c=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(G,oe)=>{const fe=G[0].length+G.index,O=G.input[fe];if(O==="<"||O===","){oe.ignoreMatch();return}O===">"&&(n(G,{after:fe})||oe.ignoreMatch());let L;const se=G.input.substring(fe);if(L=se.match(/^\s*=/)){oe.ignoreMatch();return}if((L=se.match(/^\s+extends\s+/))&&L.index===0){oe.ignoreMatch();return}}},u={$pattern:Go,keyword:ol,literal:il,built_in:cl,"variable.language":sl},d="[0-9](_?[0-9])*",p=`\\.(${d})`,b="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",C={className:"number",variants:[{begin:`(\\b(${b})((${p})|\\.)?|(${p}))[eE][+-]?(${d})\\b`},{begin:`\\b(${b})\\b((${p})\\b|\\.)?|(${p})\\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},w={className:"subst",begin:"\\$\\{",end:"\\}",keywords:u,contains:[]},V={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,w],subLanguage:"xml"}},R={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,w],subLanguage:"css"}},U={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,w],subLanguage:"graphql"}},I={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,w]},y={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,R,U,I,{match:/\$\d+/},C];w.contains=k.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(k)});const m=[].concat(y,w.contains),P=m.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(m)}]),j={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:P},Y={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"}}]},x={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:{_:[...rl,...ll]}},re={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},pe={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[j],illegal:/%/},de={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function we(G){return o.concat("(?!",G.join("|"),")")}const ee={match:o.concat(/\b/,we([...al,"super","import"].map(G=>`${G}\\s*\\(`)),r,o.lookahead(/\s*\(/)),className:"title.function",relevance:0},ce={begin:o.concat(/\./,o.lookahead(o.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ue={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},j]},h="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",$={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,o.lookahead(h)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[j]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:P,CLASS_REFERENCE:x},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),re,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,V,R,U,I,y,{match:/\$\d+/},C,x,{scope:"attr",match:r+o.lookahead(":"),relevance:0},$,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[y,t.REGEXP_MODE,{className:"function",begin:h,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:P}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:a.begin,end:a.end},{match:c},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},pe,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[j,t.inherit(t.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},ce,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[j]},ee,de,Y,ue,{match:/\$[(.]/}]}}function dl(t){const o=t.regex,n=Ff(t),r=Go,a=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],c={begin:[/namespace/,/\s+/,t.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},s={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:a},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"],p={$pattern:Go,keyword:ol.concat(d),literal:il,built_in:cl.concat(a),"variable.language":sl},b={className:"meta",begin:"@"+r},C=(U,I,_)=>{const y=U.contains.findIndex(k=>k.label===I);if(y===-1)throw new Error("can not find mode to replace");U.contains.splice(y,1,_)};Object.assign(n.keywords,p),n.exports.PARAMS_CONTAINS.push(b);const w=n.contains.find(U=>U.scope==="attr"),V=Object.assign({},w,{match:o.concat(r,o.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,w,V]),n.contains=n.contains.concat([b,c,s,V]),C(n,"shebang",t.SHEBANG()),C(n,"use_strict",u);const R=n.contains.find(U=>U.label==="func.def");return R.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function ul(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,a={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},c={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},s=t.inherit(c,{begin:/\(/,end:/\)/}),u=t.inherit(t.APOS_STRING_MODE,{className:"string"}),d=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),p={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:[a]},{begin:/'/,end:/'/,contains:[a]},{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:[c,d,u,s,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[c,s,d,u]}]}]},t.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},a,{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:[p],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[p],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:p}]},{className:"tag",begin:o.concat(/<\//,o.lookahead(o.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function fl(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]|$)/}]},a={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},c={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},s={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,a]},u=t.inherit(s,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),w={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},R={begin:/\{/,end:/\}/,contains:[V],illegal:"\\n",relevance:0},U={begin:"\\[",end:"\\]",contains:[V],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}},w,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},R,U,c,s],_=[...I];return _.pop(),_.push(u),V.contains=_,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:I}}const Ai={bash:Mi,sh:Mi,shell:Mi,css:zf,go:jr,golang:jr,java:If,javascript:Qr,js:Qr,json:$f,markdown:el,md:el,python:tl,py:tl,rust:nl,rs:nl,sql:Pf,typescript:dl,ts:dl,xml:ul,html:ul,yaml:fl,yml:fl};for(const[t,o]of Object.entries(Ai))Ci.registerLanguage(t,o);function jo(t){const o=t.split(`
55
+ `,jo=e.defineComponent({__name:"MarkdownPanel",props:{data:{}},emits:["import"],setup(t,{emit:o}){const n=t,r=o,a=e.ref(Hn(n.data)),c=e.ref(null),s=e.ref(null),m=e.computed(()=>{try{const I=Un(a.value||"");return c.value=null,I}catch(I){return c.value=I.message,{id:"preview_fallback",text:a.value||"(空)",children:[]}}}),d=e.computed(()=>vt(m.value));let h=null;e.watch(a,()=>{h&&clearTimeout(h),h=setTimeout(()=>{var I;return(I=s.value)==null?void 0:I.resetView()},250)});function b(){try{const I=Un(a.value||"");c.value=null,r("import",I)}catch(I){c.value=I.message}}function A(){a.value=Hn(n.data),c.value=null,e.nextTick(()=>{var I;return(I=s.value)==null?void 0:I.resetView()})}function C(){a.value="",c.value=null,e.nextTick(()=>{var I;return(I=s.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 y;const v=(y=I.files)==null?void 0:y[0];if(!v)return;const w=new FileReader;w.onload=()=>{typeof w.result=="string"&&(a.value=w.result,c.value=null,e.nextTick(()=>{var p;return(p=s.value)==null?void 0:p.resetView()}))},w.readAsText(v)},I.click()}function R(){const I=new Blob([a.value],{type:"text/markdown;charset=utf-8"}),v=URL.createObjectURL(I),w=document.createElement("a");w.href=v;const y=(n.data.text||"mindmap").trim()||"mindmap";w.download=`${y}.md`,w.click(),URL.revokeObjectURL(v)}function U(){a.value=fd,c.value=null,e.nextTick(()=>{var I;return(I=s.value)==null?void 0:I.resetView()})}return(I,v)=>(e.openBlock(),e.createElementBlock("div",id,[e.createElementVNode("div",{class:"zm-md-toolbar"},[e.createElementVNode("button",{class:"zm-md-btn",title:"从 .md 文件加载",onClick:$},[...v[1]||(v[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:R},[...v[2]||(v[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)])]),v[3]||(v[3]=e.createElementVNode("span",{class:"zm-md-spacer"},null,-1)),e.createElementVNode("button",{class:"zm-md-btn",title:"用示例内容填充",onClick:U},"示例"),e.createElementVNode("button",{class:"zm-md-btn",title:"覆盖为当前导图",onClick:A},"同步"),e.createElementVNode("button",{class:"zm-md-btn",title:"清空",onClick:C},"清空")]),c.value?(e.openBlock(),e.createElementBlock("div",rd,e.toDisplayString(c.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",ld,[e.createElementVNode("div",ad,[v[4]||(v[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":v[0]||(v[0]=w=>a.value=w),class:"zm-md-textarea",spellcheck:"false",placeholder:"# 标题…"},null,512),[[e.vModelText,a.value]])]),e.createElementVNode("div",sd,[v[5]||(v[5]=e.createElementVNode("div",{class:"zm-md-pane-header"},[e.createElementVNode("span",null,"导图预览"),e.createElementVNode("span",{class:"zm-md-hint"},"只读")],-1)),e.createElementVNode("div",cd,[e.createVNode(si,{ref_key:"previewRef",ref:s,data:d.value,readonly:"","preview-mode":""},null,8,["data"])])])]),e.createElementVNode("div",dd,[e.createElementVNode("button",{class:"zm-md-btn is-primary",disabled:!a.value.trim(),onClick:b},"应用到导图",8,ud)])]))}}),md={class:"zm-settings-panel"},pd={class:"zm-settings-section"},hd={class:"zm-settings-field"},gd={class:"zm-settings-control"},bd={class:"zm-color-input-wrap"},kd=["value"],yd={class:"zm-color-input-text"},xd={class:"zm-swatch-row zm-swatch-row--compact"},Ed=["title","onClick"],wd={class:"zm-settings-field"},Nd=["value"],Sd={class:"zm-slider"},Cd=["value"],Td={class:"zm-settings-field"},Md=["value"],Ad={class:"zm-slider"},_d=["value"],vd={class:"zm-settings-field zm-line-style-field"},Rd={class:"zm-line-style-group"},Bd=["title","onClick"],zd=["viewBox"],Id={key:0,d:"M 0 12 Q 14 2, 28 12",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},Ld={key:1,d:"M 0 10 L 12 10 Q 16 10 16 6 L 16 4 L 28 4",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round","stroke-linejoin":"round"},Od={key:2,d:"M 0 10 L 16 10 L 16 4 L 28 4",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round","stroke-linejoin":"round"},Vd={key:3,d:"M 0 12 C 8 0, 20 0, 28 12",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},Dd={key:4,x1:"0",y1:"12",x2:"28",y2:"12",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},$d={class:"zm-line-style-label"},Pd={class:"zm-settings-field zm-line-style-field"},Fd={class:"zm-line-style-group"},Ud=["title","onClick"],Hd=["viewBox"],Wd={key:0,d:"M 0 12 Q 14 2, 28 12",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},Gd={key:1,d:"M 0 10 L 12 10 Q 16 10 16 6 L 16 4 L 28 4",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round","stroke-linejoin":"round"},jd={key:2,d:"M 0 10 L 16 10 L 16 4 L 28 4",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round","stroke-linejoin":"round"},Kd={key:3,d:"M 0 12 C 8 0, 20 0, 28 12",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},Yd={key:4,x1:"0",y1:"12",x2:"28",y2:"12",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},qd={class:"zm-line-style-label"},Xd={key:0,class:"zm-settings-field"},Zd={class:"zm-settings-label"},Jd={class:"zm-settings-sub"},Qd=["value"],eu={key:1,class:"zm-slider"},tu=["value"],nu={class:"zm-settings-field zm-line-style-field"},ou={class:"zm-line-style-group"},iu=["title","onClick"],ru={viewBox:"0 0 28 18",width:"28",height:"18",preserveAspectRatio:"none"},lu={key:0,d:"M 8 9 L 0 9 M 20 9 L 28 9",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},au={key:1,d:"M 14 9 L 0 9 M 14 9 L 28 9",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},su={key:2,d:"M 8 7 L 0 4 M 8 9 L 0 9 M 8 11 L 0 14 M 20 7 L 28 4 M 20 9 L 28 9 M 20 11 L 28 14",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},cu={key:3,d:"M 11 6 L 8 0 M 8 8 L 0 7 M 8 11 L 0 14 M 17 6 L 20 0 M 20 8 L 28 7 M 20 11 L 28 14",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},du={class:"zm-line-style-label"},uu={class:"zm-settings-field"},fu={key:2,class:"zm-palette-picker"},mu={class:"zm-palette-list"},pu=["onClick"],hu={class:"zm-palette-option-name"},gu={class:"zm-palette-option-swatches"},bu={key:0,class:"zm-palette-custom-editor"},ku=["value"],yu={class:"zm-palette-custom-actions"},xu={class:"zm-settings-field"},Eu={key:3,class:"zm-settings-field"},wu={class:"zm-settings-label"},Nu={class:"zm-settings-sub"},Su=["value"],Cu={key:4,class:"zm-slider"},Tu=["value"],Mu={key:5,class:"zm-settings-field"},Au={class:"zm-settings-field"},_u={class:"zm-settings-label"},vu={class:"zm-settings-sub"},Ru=["value"],Bu={class:"zm-slider"},zu=["value"],Iu={class:"zm-settings-field"},Lu={class:"zm-settings-preview"},Ou={viewBox:"0 0 200 70",width:"100%",height:"70",preserveAspectRatio:"none"},Vu=["x1","y1","x2","y2","stroke","stroke-width"],Du={key:0,class:"zm-settings-section"},$u={class:"zm-settings-section-title"},Pu={key:0,class:"zm-settings-section-sub"},Fu={class:"zm-settings-field"},Uu={class:"zm-settings-value-tag"},Hu={class:"zm-swatch-row"},Wu=["title","onClick"],Gu={class:"zm-swatch zm-swatch--custom",title:"自定义颜色"},ju=["value"],Ku={class:"zm-settings-field"},Yu={class:"zm-settings-value-tag"},qu={class:"zm-swatch-row"},Xu=["title","onClick"],Zu={class:"zm-swatch zm-swatch--custom",title:"自定义颜色"},Ju=["value"],Qu={class:"zm-settings-field"},ef=["value"],tf=["value"],nf={class:"zm-settings-field"},of=["value"],rf={class:"zm-slider"},lf=["value"],af={class:"zm-settings-section zm-settings-section--actions"},Ko=((t,o)=>{const n=t.__vccOpts||t;for(const[r,a]of o)n[r]=a;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 a(q,N){r("update:settings",{[q]:N})}const c=[{value:"arc",label:"圆弧",viewBox:"0 0 28 14"},{value:"rounded-elbow",label:"圆角折线",viewBox:"0 0 28 14"},{value:"elbow",label:"折线",viewBox:"0 0 28 14"},{value:"straight",label:"直线",viewBox:"0 0 28 14"},{value:"curve",label:"S曲线",viewBox:"0 0 28 14"}],s=c,m=[{value:"edge",label:"左右中点"},{value:"center",label:"节点正中心"},{value:"proportional",label:"按比例计算"},{value:"xmind",label:"分散排布"}],d=[{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 h(q){r("update:nodeStyle",q)}const b=e.computed(()=>[...hn,...n.settings.customPalettes]),A=e.reactive({});function C(q){return A[q.id]===void 0&&(A[q.id]=q.colors.join(`
56
+ `)),A[q.id]}function $(q){const N=A[q.id]??"",ae=ks(N);if(ae.length===0){A[q.id]=q.colors.join(`
57
+ `);return}const ge=n.settings.customPalettes.map(ue=>ue.id===q.id?{...ue,colors:ae}:ue);r("update:settings",{customPalettes:ge})}function R(){const q=b.value.find(we=>we.id===n.settings.branchPaletteId),N=q?[...q.colors]:[...hn[0].colors],ae="custom-";let ge=ae+(n.settings.customPalettes.length+1);for(;hn.some(we=>we.id===ge)||n.settings.customPalettes.some(we=>we.id===ge);)ge=ae+Math.random().toString(36).slice(2,7);const ue={id:ge,name:`我的配色 ${n.settings.customPalettes.length+1}`,colors:N};r("update:settings",{customPalettes:[...n.settings.customPalettes,ue],branchPaletteId:ge}),A[ge]=N.join(`
58
+ `)}function U(q){const N=n.settings.customPalettes.filter(ge=>ge.id!==q.id),ae=n.settings.branchPaletteId===q.id?"default":n.settings.branchPaletteId;r("update:settings",{customPalettes:N,...ae!==n.settings.branchPaletteId?{branchPaletteId:ae}:{}}),delete A[q.id]}const I=["#f87171","#fb923c","#fbbf24","#a3e635","#34d399","#22d3ee","#818cf8","#c084fc","#1e2937","#f8fafc","#94a3b8"],v=["#f8fafc","#ffffff","#e2e8f0","#1e2937","#0f172a","#fef3c7","#dbeafe","#dcfce7","#fce7f3","#f1f5f9"],w=[0,1,2,3],y=["#f87171","#fb923c","#34d399","#818cf8"];function p(q,N,ae,ge){if(N<=1)return ae;const ue=q/(N-1);return ae+(ge-ae)*ue}function P(q,N,ae,ge){const ue=N*Math.pow(ge,q);return Math.max(ae,ue)}const Y=e.computed(()=>{const q=n.settings.lineWidthStart,N=n.settings.lineWidthEnd,ae=n.settings.taperedEdge,ge=w.length,ue=8,we=192,te=b.value.find(fe=>fe.id===n.settings.branchPaletteId),de=te&&te.colors.length?te.colors:y;return w.map((fe,g)=>{const V=10+g*60/(ge-1);return{x1:ue,y1:V,x2:we,y2:V,w:ae?P(fe,q,N,n.settings.lineWidthTaper):p(fe,ge,q,N),color:n.settings.rainbowBranch?de[g%de.length]:"#94a3b8"}})});return(q,N)=>{var ae,ge,ue,we,te,de,fe;return e.openBlock(),e.createElementBlock("div",md,[e.createElementVNode("section",pd,[N[52]||(N[52]=e.createElementVNode("h4",{class:"zm-settings-section-title"},"画布",-1)),e.createElementVNode("div",hd,[N[27]||(N[27]=e.createElementVNode("span",{class:"zm-settings-label"},"画布背景色",-1)),e.createElementVNode("div",gd,[e.createElementVNode("label",bd,[e.createElementVNode("input",{type:"color",class:"zm-color-input",value:t.settings.canvasBg||"#f8fafc",onInput:N[0]||(N[0]=g=>a("canvasBg",g.target.value))},null,40,kd),e.createElementVNode("span",yd,e.toDisplayString(t.settings.canvasBg||"默认"),1)])])]),e.createElementVNode("div",xd,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(v,g=>e.createElementVNode("button",{key:"cbg-"+g,class:e.normalizeClass(["zm-swatch",{"is-active":(t.settings.canvasBg||"#f8fafc")===g}]),style:e.normalizeStyle({background:g}),title:g,onClick:V=>a("canvasBg",g)},null,14,Ed)),64)),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"恢复默认",onClick:N[1]||(N[1]=g=>a("canvasBg",void 0))},"∅")]),N[53]||(N[53]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",wd,[N[28]||(N[28]=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:N[2]||(N[2]=g=>a("lineWidthStart",parseFloat(g.target.value)||0))},null,40,Nd)]),e.createElementVNode("div",Sd,[N[29]||(N[29]=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:N[3]||(N[3]=g=>a("lineWidthStart",parseFloat(g.target.value)))},null,40,Cd)]),e.createElementVNode("div",Td,[N[30]||(N[30]=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:N[4]||(N[4]=g=>a("lineWidthEnd",parseFloat(g.target.value)||0))},null,40,Md)]),e.createElementVNode("div",Ad,[N[31]||(N[31]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"0.1",max:"6",step:"0.1",value:t.settings.lineWidthEnd,onInput:N[5]||(N[5]=g=>a("lineWidthEnd",parseFloat(g.target.value)))},null,40,_d)]),N[54]||(N[54]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",vd,[N[32]||(N[32]=e.createElementVNode("span",{class:"zm-settings-label"},"根节点线条",-1)),e.createElementVNode("div",Rd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(s),g=>(e.openBlock(),e.createElementBlock("button",{key:g.value,class:e.normalizeClass(["zm-line-style-btn",{"is-on":t.settings.rootLineStyle===g.value}]),title:g.label,onClick:V=>a("rootLineStyle",g.value)},[(e.openBlock(),e.createElementBlock("svg",{viewBox:g.viewBox,width:"28",height:"14",preserveAspectRatio:"none"},[g.value==="arc"?(e.openBlock(),e.createElementBlock("path",Id)):g.value==="rounded-elbow"?(e.openBlock(),e.createElementBlock("path",Ld)):g.value==="elbow"?(e.openBlock(),e.createElementBlock("path",Od)):g.value==="curve"?(e.openBlock(),e.createElementBlock("path",Vd)):(e.openBlock(),e.createElementBlock("line",Dd))],8,zd)),e.createElementVNode("span",$d,e.toDisplayString(g.label),1)],10,Bd))),128))])]),e.createElementVNode("div",Pd,[N[33]||(N[33]=e.createElementVNode("span",{class:"zm-settings-label"},"非根节点线条",-1)),e.createElementVNode("div",Fd,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(c,g=>e.createElementVNode("button",{key:g.value,class:e.normalizeClass(["zm-line-style-btn",{"is-on":t.settings.lineStyle===g.value}]),title:g.label,onClick:V=>a("lineStyle",g.value)},[(e.openBlock(),e.createElementBlock("svg",{viewBox:g.viewBox,width:"28",height:"14",preserveAspectRatio:"none"},[g.value==="arc"?(e.openBlock(),e.createElementBlock("path",Wd)):g.value==="rounded-elbow"?(e.openBlock(),e.createElementBlock("path",Gd)):g.value==="elbow"?(e.openBlock(),e.createElementBlock("path",jd)):g.value==="curve"?(e.openBlock(),e.createElementBlock("path",Kd)):(e.openBlock(),e.createElementBlock("line",Yd))],8,Hd)),e.createElementVNode("span",qd,e.toDisplayString(g.label),1)],10,Ud)),64))])]),t.settings.lineStyle==="rounded-elbow"||t.settings.rootLineStyle==="rounded-elbow"?(e.openBlock(),e.createElementBlock("div",Xd,[e.createElementVNode("span",Zd,[N[34]||(N[34]=e.createTextVNode("圆角大小 ",-1)),e.createElementVNode("span",Jd,e.toDisplayString(t.settings.elbowRadius)+"px",1)]),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"1",min:"2",max:"40",value:t.settings.elbowRadius,onChange:N[6]||(N[6]=g=>a("elbowRadius",parseFloat(g.target.value)||20))},null,40,Qd)])):e.createCommentVNode("",!0),t.settings.lineStyle==="rounded-elbow"||t.settings.rootLineStyle==="rounded-elbow"?(e.openBlock(),e.createElementBlock("div",eu,[N[35]||(N[35]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"2",max:"40",step:"1",value:t.settings.elbowRadius,onInput:N[7]||(N[7]=g=>a("elbowRadius",parseFloat(g.target.value)))},null,40,tu)])):e.createCommentVNode("",!0),e.createElementVNode("div",nu,[N[37]||(N[37]=e.createElementVNode("span",{class:"zm-settings-label"},"线条起点",-1)),e.createElementVNode("div",ou,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(m,g=>e.createElementVNode("button",{key:g.value,class:e.normalizeClass(["zm-line-style-btn",{"is-on":t.settings.lineOrigin===g.value}]),title:g.label,onClick:V=>a("lineOrigin",g.value)},[(e.openBlock(),e.createElementBlock("svg",ru,[N[36]||(N[36]=e.createElementVNode("rect",{x:"8",y:"6",width:"12",height:"6",rx:"2",fill:"none",stroke:"currentColor","stroke-width":"1.2",opacity:"0.5"},null,-1)),g.value==="edge"?(e.openBlock(),e.createElementBlock("path",lu)):g.value==="center"?(e.openBlock(),e.createElementBlock("path",au)):g.value==="proportional"?(e.openBlock(),e.createElementBlock("path",su)):(e.openBlock(),e.createElementBlock("path",cu))])),e.createElementVNode("span",du,e.toDisplayString(g.label),1)],10,iu)),64))])]),e.createElementVNode("div",uu,[N[39]||(N[39]=e.createElementVNode("span",{class:"zm-settings-label"},"一级分支彩虹色",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.rainbowBranch}]),onClick:N[8]||(N[8]=g=>a("rainbowBranch",!t.settings.rainbowBranch))},[...N[38]||(N[38]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),t.settings.rainbowBranch?(e.openBlock(),e.createElementBlock("div",fu,[N[40]||(N[40]=e.createElementVNode("div",{class:"zm-settings-field"},[e.createElementVNode("span",{class:"zm-settings-label"},"配色方案")],-1)),e.createElementVNode("div",mu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,g=>(e.openBlock(),e.createElementBlock("button",{key:g.id,class:e.normalizeClass(["zm-palette-option",{"is-active":t.settings.branchPaletteId===g.id}]),onClick:V=>a("branchPaletteId",g.id)},[e.createElementVNode("span",hu,e.toDisplayString(g.name),1),e.createElementVNode("span",gu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.colors,(V,G)=>(e.openBlock(),e.createElementBlock("span",{key:G,class:"zm-palette-option-swatch",style:e.normalizeStyle({background:V})},null,4))),128))])],10,pu))),128))]),t.settings.customPalettes.find(g=>g.id===t.settings.branchPaletteId)?(e.openBlock(),e.createElementBlock("div",bu,[e.createElementVNode("textarea",{class:"zm-palette-textarea",rows:"3",spellcheck:"false",placeholder:"一行一个 hex,例如 #f87171",value:C(t.settings.customPalettes.find(g=>g.id===t.settings.branchPaletteId)),onInput:N[9]||(N[9]=g=>A[t.settings.customPalettes.find(V=>V.id===t.settings.branchPaletteId).id]=g.target.value)},null,40,ku),e.createElementVNode("div",yu,[e.createElementVNode("button",{type:"button",class:"zm-data-btn is-primary",onClick:N[10]||(N[10]=g=>$(t.settings.customPalettes.find(V=>V.id===t.settings.branchPaletteId)))},"保存"),e.createElementVNode("button",{type:"button",class:"zm-data-btn",onClick:N[11]||(N[11]=g=>U(t.settings.customPalettes.find(V=>V.id===t.settings.branchPaletteId)))},"删除")])])):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"zm-palette-add",onClick:R},"+ 新建配色")])):e.createCommentVNode("",!0),N[55]||(N[55]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",xu,[N[42]||(N[42]=e.createElementVNode("span",{class:"zm-settings-label"},"每条连线独立渐变",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.taperedEdge}]),onClick:N[12]||(N[12]=g=>a("taperedEdge",!t.settings.taperedEdge))},[...N[41]||(N[41]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),t.settings.taperedEdge?(e.openBlock(),e.createElementBlock("div",Eu,[e.createElementVNode("span",wu,[N[43]||(N[43]=e.createTextVNode("层级衰减 ",-1)),e.createElementVNode("span",Nu,e.toDisplayString(Math.round(t.settings.lineWidthTaper*100))+"%",1)]),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"0.05",min:"0.1",max:"1",value:t.settings.lineWidthTaper,onChange:N[13]||(N[13]=g=>a("lineWidthTaper",parseFloat(g.target.value)||.67))},null,40,Su)])):e.createCommentVNode("",!0),t.settings.taperedEdge?(e.openBlock(),e.createElementBlock("div",Cu,[N[44]||(N[44]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"0.1",max:"1",step:"0.01",value:t.settings.lineWidthTaper,onInput:N[14]||(N[14]=g=>a("lineWidthTaper",parseFloat(g.target.value)))},null,40,Tu)])):e.createCommentVNode("",!0),t.settings.taperedEdge?(e.openBlock(),e.createElementBlock("div",Mu,[N[46]||(N[46]=e.createElementVNode("span",{class:"zm-settings-label"},"非根节点相同粗细",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.uniformLineWidth}]),onClick:N[15]||(N[15]=g=>a("uniformLineWidth",!t.settings.uniformLineWidth))},[...N[45]||(N[45]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)])):e.createCommentVNode("",!0),e.createElementVNode("div",Au,[e.createElementVNode("span",_u,[N[47]||(N[47]=e.createTextVNode("一级分支间距 ",-1)),e.createElementVNode("span",vu,e.toDisplayString(t.settings.branchGap)+"px",1)]),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"2",min:"0",max:"80",value:t.settings.branchGap,onChange:N[16]||(N[16]=g=>a("branchGap",parseFloat(g.target.value)||0))},null,40,Ru)]),e.createElementVNode("div",Bu,[N[48]||(N[48]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"0",max:"80",step:"2",value:t.settings.branchGap,onInput:N[17]||(N[17]=g=>a("branchGap",parseFloat(g.target.value)))},null,40,zu)]),e.createElementVNode("div",Iu,[N[50]||(N[50]=e.createElementVNode("span",{class:"zm-settings-label"},"显示节点序号",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.showOrderBadge}]),onClick:N[18]||(N[18]=g=>a("showOrderBadge",!t.settings.showOrderBadge))},[...N[49]||(N[49]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),e.createElementVNode("div",Lu,[(e.openBlock(),e.createElementBlock("svg",Ou,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Y.value,(g,V)=>(e.openBlock(),e.createElementBlock("line",{key:V,x1:g.x1,y1:g.y1,x2:g.x2,y2:g.y2,stroke:t.settings.rainbowBranch?g.color:"#94a3b8","stroke-width":g.w,"stroke-linecap":"butt"},null,8,Vu))),128))])),N[51]||(N[51]=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",Du,[e.createElementVNode("h4",$u,[N[56]||(N[56]=e.createTextVNode(" 节点 ",-1)),t.selectedNodeText?(e.openBlock(),e.createElementBlock("span",Pu,'"'+e.toDisplayString(t.selectedNodeText)+'"',1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Fu,[N[57]||(N[57]=e.createElementVNode("span",{class:"zm-settings-label"},"背景颜色",-1)),e.createElementVNode("span",Uu,e.toDisplayString(((ae=t.nodeStyle)==null?void 0:ae.bg)||"默认"),1)]),e.createElementVNode("div",Hu,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(I,g=>{var V;return e.createElementVNode("button",{key:"bg-"+g,class:e.normalizeClass(["zm-swatch",{"is-active":((V=t.nodeStyle)==null?void 0:V.bg)===g}]),style:e.normalizeStyle({background:g}),title:g,onClick:G=>h({bg:g})},null,14,Wu)}),64)),e.createElementVNode("label",Gu,[e.createElementVNode("input",{type:"color",value:((ge=t.nodeStyle)==null?void 0:ge.bg)||"#ffffff",onInput:N[19]||(N[19]=g=>h({bg:g.target.value}))},null,40,ju)]),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"清除",onClick:N[20]||(N[20]=g=>h({bg:void 0}))},"∅")]),e.createElementVNode("div",Ku,[N[58]||(N[58]=e.createElementVNode("span",{class:"zm-settings-label"},"文字颜色",-1)),e.createElementVNode("span",Yu,e.toDisplayString(((ue=t.nodeStyle)==null?void 0:ue.textColor)||"默认"),1)]),e.createElementVNode("div",qu,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(I,g=>{var V;return e.createElementVNode("button",{key:"fg-"+g,class:e.normalizeClass(["zm-swatch",{"is-active":((V=t.nodeStyle)==null?void 0:V.textColor)===g}]),style:e.normalizeStyle({background:g}),title:g,onClick:G=>h({textColor:g})},null,14,Xu)}),64)),e.createElementVNode("label",Zu,[e.createElementVNode("input",{type:"color",value:((we=t.nodeStyle)==null?void 0:we.textColor)||"#1e2937",onInput:N[21]||(N[21]=g=>h({textColor:g.target.value}))},null,40,Ju)]),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"清除",onClick:N[22]||(N[22]=g=>h({textColor:void 0}))},"∅")]),N[62]||(N[62]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",Qu,[N[59]||(N[59]=e.createElementVNode("span",{class:"zm-settings-label"},"字重",-1)),e.createElementVNode("select",{class:"zm-select",value:((te=t.nodeStyle)==null?void 0:te.fontWeight)??400,onChange:N[23]||(N[23]=g=>h({fontWeight:parseInt(g.target.value)}))},[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(d,g=>e.createElementVNode("option",{key:g.value,value:g.value},e.toDisplayString(g.label),9,tf)),64))],40,ef)]),e.createElementVNode("div",nf,[N[60]||(N[60]=e.createElementVNode("span",{class:"zm-settings-label"},"文字大小",-1)),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"1",min:"8",max:"48",value:((de=t.nodeStyle)==null?void 0:de.fontSize)??14,onChange:N[24]||(N[24]=g=>h({fontSize:parseInt(g.target.value)||14}))},null,40,of)]),e.createElementVNode("div",rf,[N[61]||(N[61]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"8",max:"48",step:"1",value:((fe=t.nodeStyle)==null?void 0:fe.fontSize)??14,onInput:N[25]||(N[25]=g=>h({fontSize:parseInt(g.target.value)}))},null,40,lf)]),N[63]||(N[63]=e.createElementVNode("p",{class:"zm-settings-hint"},"仅作用于当前节点,不影响子节点。",-1))])):e.createCommentVNode("",!0),e.createElementVNode("section",af,[e.createElementVNode("button",{class:"zm-settings-reset",onClick:N[26]||(N[26]=g=>r("reset"))},"恢复默认设置")])])}}}),[["__scopeId","data-v-d9ae9516"]]),Dr=20;function sf(t,o){t.style.height="auto";const n=o.minRows*Dr,r=o.maxRows>0?o.maxRows*Dr:1/0,a=Math.max(n,Math.min(r,t.scrollHeight));t.style.height=a+"px",t.style.overflowY=t.scrollHeight>r?"auto":"hidden"}function Ai(t,o={}){const n={minRows:o.minRows??3,maxRows:o.maxRows??12};function r(){const c=t.value;c&&sf(c,n)}function a(){r()}e.onMounted(async()=>{await e.nextTick();const c=t.value;c&&(c.addEventListener("input",a),r())}),e.watch(()=>{var c;return(c=t.value)==null?void 0:c.value},()=>r()),e.onBeforeUnmount(()=>{const c=t.value;c&&c.removeEventListener("input",a)})}function cf(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function $r(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)&&$r(n)}),t}class Pr{constructor(o){o.data===void 0&&(o.data={}),this.data=o.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function Fr(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function gn(t,...o){const n=Object.create(null);for(const r in t)n[r]=t[r];return o.forEach(function(r){for(const a in r)n[a]=r[a]}),n}const df="</span>",Ur=t=>!!t.scope,uf=(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,a)=>`${r}${"_".repeat(a+1)}`)].join(" ")}return`${o}${t}`};class ff{constructor(o,n){this.buffer="",this.classPrefix=n.classPrefix,o.walk(this)}addText(o){this.buffer+=Fr(o)}openNode(o){if(!Ur(o))return;const n=uf(o.scope,{prefix:this.classPrefix});this.span(n)}closeNode(o){Ur(o)&&(this.buffer+=df)}value(){return this.buffer}span(o){this.buffer+=`<span class="${o}">`}}const Hr=(t={})=>{const o={children:[]};return Object.assign(o,t),o};class _i{constructor(){this.rootNode=Hr(),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=Hr({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=>{_i._collapse(n)}))}}class mf extends _i{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 ff(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function fo(t){return t?typeof t=="string"?t:t.source:null}function Wr(t){return Mn("(?=",t,")")}function pf(t){return Mn("(?:",t,")*")}function hf(t){return Mn("(?:",t,")?")}function Mn(...t){return t.map(n=>fo(n)).join("")}function gf(t){const o=t[t.length-1];return typeof o=="object"&&o.constructor===Object?(t.splice(t.length-1,1),o):{}}function vi(...t){return"("+(gf(t).capture?"":"?:")+t.map(r=>fo(r)).join("|")+")"}function Gr(t){return new RegExp(t.toString()+"|").exec("").length-1}function bf(t,o){const n=t&&t.exec(o);return n&&n.index===0}const kf=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Ri(t,{joinWith:o}){let n=0;return t.map(r=>{n+=1;const a=n;let c=fo(r),s="";for(;c.length>0;){const m=kf.exec(c);if(!m){s+=c;break}s+=c.substring(0,m.index),c=c.substring(m.index+m[0].length),m[0][0]==="\\"&&m[1]?s+="\\"+String(Number(m[1])+a):(s+=m[0],m[0]==="("&&n++)}return s}).map(r=>`(${r})`).join(o)}const yf=/\b\B/,jr="[a-zA-Z]\\w*",Bi="[a-zA-Z_]\\w*",Kr="\\b\\d+(\\.\\d+)?",Yr="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",qr="\\b(0b[01]+)",xf="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",Ef=(t={})=>{const o=/^#![ ]*\//;return t.binary&&(t.begin=Mn(o,/.*\b/,t.binary,/\b.*/)),gn({scope:"meta",begin:o,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},t)},mo={begin:"\\\\[\\s\\S]",relevance:0},wf={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[mo]},Nf={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[mo]},Sf={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/},Yo=function(t,o,n={}){const r=gn({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 a=vi("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:Mn(/[ ]+/,"(",a,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},Cf=Yo("//","$"),Tf=Yo("/\\*","\\*/"),Mf=Yo("#","$"),Af={scope:"number",begin:Kr,relevance:0},_f={scope:"number",begin:Yr,relevance:0},vf={scope:"number",begin:qr,relevance:0},Rf={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[mo,{begin:/\[/,end:/\]/,relevance:0,contains:[mo]}]},Bf={scope:"title",begin:jr,relevance:0},zf={scope:"title",begin:Bi,relevance:0},If={begin:"\\.\\s*"+Bi,relevance:0};var qo=Object.freeze({__proto__:null,APOS_STRING_MODE:wf,BACKSLASH_ESCAPE:mo,BINARY_NUMBER_MODE:vf,BINARY_NUMBER_RE:qr,COMMENT:Yo,C_BLOCK_COMMENT_MODE:Tf,C_LINE_COMMENT_MODE:Cf,C_NUMBER_MODE:_f,C_NUMBER_RE:Yr,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:Mf,IDENT_RE:jr,MATCH_NOTHING_RE:yf,METHOD_GUARD:If,NUMBER_MODE:Af,NUMBER_RE:Kr,PHRASAL_WORDS_MODE:Sf,QUOTE_STRING_MODE:Nf,REGEXP_MODE:Rf,RE_STARTERS_RE:xf,SHEBANG:Ef,TITLE_MODE:Bf,UNDERSCORE_IDENT_RE:Bi,UNDERSCORE_TITLE_MODE:zf});function Lf(t,o){t.input[t.index-1]==="."&&o.ignoreMatch()}function Of(t,o){t.className!==void 0&&(t.scope=t.className,delete t.className)}function Vf(t,o){o&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=Lf,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function Df(t,o){Array.isArray(t.illegal)&&(t.illegal=vi(...t.illegal))}function $f(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 Pf(t,o){t.relevance===void 0&&(t.relevance=1)}const Ff=(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=Mn(n.beforeMatch,Wr(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},Uf=["of","and","for","in","not","or","if","then","parent","list","value"],Hf="keyword";function Xr(t,o,n=Hf){const r=Object.create(null);return typeof t=="string"?a(n,t.split(" ")):Array.isArray(t)?a(n,t):Object.keys(t).forEach(function(c){Object.assign(r,Xr(t[c],o,c))}),r;function a(c,s){o&&(s=s.map(m=>m.toLowerCase())),s.forEach(function(m){const d=m.split("|");r[d[0]]=[c,Wf(d[0],d[1])]})}}function Wf(t,o){return o?Number(o):Gf(t)?0:1}function Gf(t){return Uf.includes(t.toLowerCase())}const Zr={},An=t=>{console.error(t)},Jr=(t,...o)=>{console.log(`WARN: ${t}`,...o)},Wn=(t,o)=>{Zr[`${t}/${o}`]||(console.log(`Deprecated as of ${t}. ${o}`),Zr[`${t}/${o}`]=!0)},Xo=new Error;function Qr(t,o,{key:n}){let r=0;const a=t[n],c={},s={};for(let m=1;m<=o.length;m++)s[m+r]=a[m],c[m+r]=!0,r+=Gr(o[m-1]);t[n]=s,t[n]._emit=c,t[n]._multi=!0}function jf(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw An("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Xo;if(typeof t.beginScope!="object"||t.beginScope===null)throw An("beginScope must be object"),Xo;Qr(t,t.begin,{key:"beginScope"}),t.begin=Ri(t.begin,{joinWith:""})}}function Kf(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw An("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Xo;if(typeof t.endScope!="object"||t.endScope===null)throw An("endScope must be object"),Xo;Qr(t,t.end,{key:"endScope"}),t.end=Ri(t.end,{joinWith:""})}}function Yf(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function qf(t){Yf(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),jf(t),Kf(t)}function Xf(t){function o(s,m){return new RegExp(fo(s),"m"+(t.case_insensitive?"i":"")+(t.unicodeRegex?"u":"")+(m?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(m,d){d.position=this.position++,this.matchIndexes[this.matchAt]=d,this.regexes.push([d,m]),this.matchAt+=Gr(m)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const m=this.regexes.map(d=>d[1]);this.matcherRe=o(Ri(m,{joinWith:"|"}),!0),this.lastIndex=0}exec(m){this.matcherRe.lastIndex=this.lastIndex;const d=this.matcherRe.exec(m);if(!d)return null;const h=d.findIndex((A,C)=>C>0&&A!==void 0),b=this.matchIndexes[h];return d.splice(0,h),Object.assign(d,b)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(m){if(this.multiRegexes[m])return this.multiRegexes[m];const d=new n;return this.rules.slice(m).forEach(([h,b])=>d.addRule(h,b)),d.compile(),this.multiRegexes[m]=d,d}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(m,d){this.rules.push([m,d]),d.type==="begin"&&this.count++}exec(m){const d=this.getMatcher(this.regexIndex);d.lastIndex=this.lastIndex;let h=d.exec(m);if(this.resumingScanAtSamePosition()&&!(h&&h.index===this.lastIndex)){const b=this.getMatcher(0);b.lastIndex=this.lastIndex+1,h=b.exec(m)}return h&&(this.regexIndex+=h.position+1,this.regexIndex===this.count&&this.considerAll()),h}}function a(s){const m=new r;return s.contains.forEach(d=>m.addRule(d.begin,{rule:d,type:"begin"})),s.terminatorEnd&&m.addRule(s.terminatorEnd,{type:"end"}),s.illegal&&m.addRule(s.illegal,{type:"illegal"}),m}function c(s,m){const d=s;if(s.isCompiled)return d;[Of,$f,qf,Ff].forEach(b=>b(s,m)),t.compilerExtensions.forEach(b=>b(s,m)),s.__beforeBegin=null,[Vf,Df,Pf].forEach(b=>b(s,m)),s.isCompiled=!0;let h=null;return typeof s.keywords=="object"&&s.keywords.$pattern&&(s.keywords=Object.assign({},s.keywords),h=s.keywords.$pattern,delete s.keywords.$pattern),h=h||/\w+/,s.keywords&&(s.keywords=Xr(s.keywords,t.case_insensitive)),d.keywordPatternRe=o(h,!0),m&&(s.begin||(s.begin=/\B|\b/),d.beginRe=o(d.begin),!s.end&&!s.endsWithParent&&(s.end=/\B|\b/),s.end&&(d.endRe=o(d.end)),d.terminatorEnd=fo(d.end)||"",s.endsWithParent&&m.terminatorEnd&&(d.terminatorEnd+=(s.end?"|":"")+m.terminatorEnd)),s.illegal&&(d.illegalRe=o(s.illegal)),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map(function(b){return Zf(b==="self"?s:b)})),s.contains.forEach(function(b){c(b,d)}),s.starts&&c(s.starts,m),d.matcher=a(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=gn(t.classNameAliases||{}),c(t)}function el(t){return t?t.endsWithParent||el(t.starts):!1}function Zf(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(o){return gn(t,{variants:null},o)})),t.cachedVariants?t.cachedVariants:el(t)?gn(t,{starts:t.starts?gn(t.starts):null}):Object.isFrozen(t)?gn(t):t}var Jf="11.11.1";class Qf extends Error{constructor(o,n){super(o),this.name="HTMLInjectionError",this.html=n}}const zi=Fr,tl=gn,nl=Symbol("nomatch"),em=7,ol=function(t){const o=Object.create(null),n=Object.create(null),r=[];let a=!0;const c="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]};let m={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:mf};function d(g){return m.noHighlightRe.test(g)}function h(g){let V=g.className+" ";V+=g.parentNode?g.parentNode.className:"";const G=m.languageDetectRe.exec(V);if(G){const le=N(G[1]);return le||(Jr(c.replace("{}",G[1])),Jr("Falling back to no-highlight mode for this block.",g)),le?G[1]:"no-highlight"}return V.split(/\s+/).find(le=>d(le)||N(le))}function b(g,V,G){let le="",me="";typeof V=="object"?(le=g,G=V.ignoreIllegals,me=V.language):(Wn("10.7.0","highlight(lang, code, ...args) has been deprecated."),Wn("10.7.0",`Please use highlight(code, options) instead.
59
+ https://github.com/highlightjs/highlight.js/issues/2277`),me=g,le=V),G===void 0&&(G=!0);const O={code:le,language:me};de("before:highlight",O);const L=O.result?O.result:A(O.language,O.code,G);return L.code=O.code,de("after:highlight",L),L}function A(g,V,G,le){const me=Object.create(null);function O(X,se){return X.keywords[se]}function L(){if(!pe.keywords){$e.addText(De);return}let X=0;pe.keywordPatternRe.lastIndex=0;let se=pe.keywordPatternRe.exec(De),Ee="";for(;se;){Ee+=De.substring(X,se.index);const Be=rt.case_insensitive?se[0].toLowerCase():se[0],Ge=O(pe,Be);if(Ge){const[at,Mt]=Ge;if($e.addText(Ee),Ee="",me[Be]=(me[Be]||0)+1,me[Be]<=em&&(Ut+=Mt),at.startsWith("_"))Ee+=se[0];else{const Ln=rt.classNameAliases[at]||at;z(se[0],Ln)}}else Ee+=se[0];X=pe.keywordPatternRe.lastIndex,se=pe.keywordPatternRe.exec(De)}Ee+=De.substring(X),$e.addText(Ee)}function ce(){if(De==="")return;let X=null;if(typeof pe.subLanguage=="string"){if(!o[pe.subLanguage]){$e.addText(De);return}X=A(pe.subLanguage,De,!0,pt[pe.subLanguage]),pt[pe.subLanguage]=X._top}else X=$(De,pe.subLanguage.length?pe.subLanguage:null);pe.relevance>0&&(Ut+=X.relevance),$e.__addSublanguage(X._emitter,X.language)}function ke(){pe.subLanguage!=null?ce():L(),De=""}function z(X,se){X!==""&&($e.startScope(se),$e.addText(X),$e.endScope())}function T(X,se){let Ee=1;const Be=se.length-1;for(;Ee<=Be;){if(!X._emit[Ee]){Ee++;continue}const Ge=rt.classNameAliases[X[Ee]]||X[Ee],at=se[Ee];Ge?z(at,Ge):(De=at,L(),De=""),Ee++}}function F(X,se){return X.scope&&typeof X.scope=="string"&&$e.openNode(rt.classNameAliases[X.scope]||X.scope),X.beginScope&&(X.beginScope._wrap?(z(De,rt.classNameAliases[X.beginScope._wrap]||X.beginScope._wrap),De=""):X.beginScope._multi&&(T(X.beginScope,se),De="")),pe=Object.create(X,{parent:{value:pe}}),pe}function H(X,se,Ee){let Be=bf(X.endRe,Ee);if(Be){if(X["on:end"]){const Ge=new Pr(X);X["on:end"](se,Ge),Ge.isMatchIgnored&&(Be=!1)}if(Be){for(;X.endsParent&&X.parent;)X=X.parent;return X}}if(X.endsWithParent)return H(X.parent,se,Ee)}function ne(X){return pe.matcher.regexIndex===0?(De+=X[0],1):(Nt=!0,0)}function xe(X){const se=X[0],Ee=X.rule,Be=new Pr(Ee),Ge=[Ee.__beforeBegin,Ee["on:begin"]];for(const at of Ge)if(at&&(at(X,Be),Be.isMatchIgnored))return ne(se);return Ee.skip?De+=se:(Ee.excludeBegin&&(De+=se),ke(),!Ee.returnBegin&&!Ee.excludeBegin&&(De=se)),F(Ee,X),Ee.returnBegin?0:se.length}function ot(X){const se=X[0],Ee=V.substring(X.index),Be=H(pe,X,Ee);if(!Be)return nl;const Ge=pe;pe.endScope&&pe.endScope._wrap?(ke(),z(se,pe.endScope._wrap)):pe.endScope&&pe.endScope._multi?(ke(),T(pe.endScope,X)):Ge.skip?De+=se:(Ge.returnEnd||Ge.excludeEnd||(De+=se),ke(),Ge.excludeEnd&&(De=se));do pe.scope&&$e.closeNode(),!pe.skip&&!pe.subLanguage&&(Ut+=pe.relevance),pe=pe.parent;while(pe!==Be.parent);return Be.starts&&F(Be.starts,X),Ge.returnEnd?0:se.length}function mt(){const X=[];for(let se=pe;se!==rt;se=se.parent)se.scope&&X.unshift(se.scope);X.forEach(se=>$e.openNode(se))}let it={};function cn(X,se){const Ee=se&&se[0];if(De+=X,Ee==null)return ke(),0;if(it.type==="begin"&&se.type==="end"&&it.index===se.index&&Ee===""){if(De+=V.slice(se.index,se.index+1),!a){const Be=new Error(`0 width match regex (${g})`);throw Be.languageName=g,Be.badRule=it.rule,Be}return 1}if(it=se,se.type==="begin")return xe(se);if(se.type==="illegal"&&!G){const Be=new Error('Illegal lexeme "'+Ee+'" for mode "'+(pe.scope||"<unnamed>")+'"');throw Be.mode=pe,Be}else if(se.type==="end"){const Be=ot(se);if(Be!==nl)return Be}if(se.type==="illegal"&&Ee==="")return De+=`
60
+ `,1;if(Tt>1e5&&Tt>se.index*3)throw new Error("potential infinite loop, way more iterations than matches");return De+=Ee,Ee.length}const rt=N(g);if(!rt)throw An(c.replace("{}",g)),new Error('Unknown language: "'+g+'"');const dn=Xf(rt);let Ft="",pe=le||dn;const pt={},$e=new m.__emitter(m);mt();let De="",Ut=0,lt=0,Tt=0,Nt=!1;try{if(rt.__emitTokens)rt.__emitTokens(V,$e);else{for(pe.matcher.considerAll();;){Tt++,Nt?Nt=!1:pe.matcher.considerAll(),pe.matcher.lastIndex=lt;const X=pe.matcher.exec(V);if(!X)break;const se=V.substring(lt,X.index),Ee=cn(se,X);lt=X.index+Ee}cn(V.substring(lt))}return $e.finalize(),Ft=$e.toHTML(),{language:g,value:Ft,relevance:Ut,illegal:!1,_emitter:$e,_top:pe}}catch(X){if(X.message&&X.message.includes("Illegal"))return{language:g,value:zi(V),illegal:!0,relevance:0,_illegalBy:{message:X.message,index:lt,context:V.slice(lt-100,lt+100),mode:X.mode,resultSoFar:Ft},_emitter:$e};if(a)return{language:g,value:zi(V),illegal:!1,relevance:0,errorRaised:X,_emitter:$e,_top:pe};throw X}}function C(g){const V={value:zi(g),illegal:!1,relevance:0,_top:s,_emitter:new m.__emitter(m)};return V._emitter.addText(g),V}function $(g,V){V=V||m.languages||Object.keys(o);const G=C(g),le=V.filter(N).filter(ge).map(ke=>A(ke,g,!1));le.unshift(G);const me=le.sort((ke,z)=>{if(ke.relevance!==z.relevance)return z.relevance-ke.relevance;if(ke.language&&z.language){if(N(ke.language).supersetOf===z.language)return 1;if(N(z.language).supersetOf===ke.language)return-1}return 0}),[O,L]=me,ce=O;return ce.secondBest=L,ce}function R(g,V,G){const le=V&&n[V]||G;g.classList.add("hljs"),g.classList.add(`language-${le}`)}function U(g){let V=null;const G=h(g);if(d(G))return;if(de("before:highlightElement",{el:g,language:G}),g.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",g);return}if(g.children.length>0&&(m.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(g)),m.throwUnescapedHTML))throw new Qf("One of your code blocks includes unescaped HTML.",g.innerHTML);V=g;const le=V.textContent,me=G?b(le,{language:G,ignoreIllegals:!0}):$(le);g.innerHTML=me.value,g.dataset.highlighted="yes",R(g,G,me.language),g.result={language:me.language,re:me.relevance,relevance:me.relevance},me.secondBest&&(g.secondBest={language:me.secondBest.language,relevance:me.secondBest.relevance}),de("after:highlightElement",{el:g,result:me,text:le})}function I(g){m=tl(m,g)}const v=()=>{p(),Wn("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function w(){p(),Wn("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let y=!1;function p(){function g(){p()}if(document.readyState==="loading"){y||window.addEventListener("DOMContentLoaded",g,!1),y=!0;return}document.querySelectorAll(m.cssSelector).forEach(U)}function P(g,V){let G=null;try{G=V(t)}catch(le){if(An("Language definition for '{}' could not be registered.".replace("{}",g)),a)An(le);else throw le;G=s}G.name||(G.name=g),o[g]=G,G.rawDefinition=V.bind(null,t),G.aliases&&ae(G.aliases,{languageName:g})}function Y(g){delete o[g];for(const V of Object.keys(n))n[V]===g&&delete n[V]}function q(){return Object.keys(o)}function N(g){return g=(g||"").toLowerCase(),o[g]||o[n[g]]}function ae(g,{languageName:V}){typeof g=="string"&&(g=[g]),g.forEach(G=>{n[G.toLowerCase()]=V})}function ge(g){const V=N(g);return V&&!V.disableAutodetect}function ue(g){g["before:highlightBlock"]&&!g["before:highlightElement"]&&(g["before:highlightElement"]=V=>{g["before:highlightBlock"](Object.assign({block:V.el},V))}),g["after:highlightBlock"]&&!g["after:highlightElement"]&&(g["after:highlightElement"]=V=>{g["after:highlightBlock"](Object.assign({block:V.el},V))})}function we(g){ue(g),r.push(g)}function te(g){const V=r.indexOf(g);V!==-1&&r.splice(V,1)}function de(g,V){const G=g;r.forEach(function(le){le[G]&&le[G](V)})}function fe(g){return Wn("10.7.0","highlightBlock will be removed entirely in v12.0"),Wn("10.7.0","Please use highlightElement now."),U(g)}Object.assign(t,{highlight:b,highlightAuto:$,highlightAll:p,highlightElement:U,highlightBlock:fe,configure:I,initHighlighting:v,initHighlightingOnLoad:w,registerLanguage:P,unregisterLanguage:Y,listLanguages:q,getLanguage:N,registerAliases:ae,autoDetection:ge,inherit:tl,addPlugin:we,removePlugin:te}),t.debugMode=function(){a=!1},t.safeMode=function(){a=!0},t.versionString=Jf,t.regex={concat:Mn,lookahead:Wr,either:vi,optional:hf,anyNumberOfTimes:pf};for(const g in qo)typeof qo[g]=="object"&&$r(qo[g]);return Object.assign(t,qo),t},Gn=ol({});Gn.newInstance=()=>ol({});var tm=Gn;Gn.HighlightJS=Gn,Gn.default=Gn;const Ii=cf(tm);function Li(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 a={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},c=t.inherit(t.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),s={begin:/<<-?\s*(?=\w+)/,starts:{contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},m={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,n,a]};a.contains.push(m);const d={match:/\\"/},h={className:"string",begin:/'/,end:/'/},b={match:/\\'/},A={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,n]},C=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],$=t.SHEBANG({binary:`(${C.join("|")})`,relevance:10}),R={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},U=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],I=["true","false"],v={match:/(\/[a-z._-]+)+/},w=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],y=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],p=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],P=["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:U,literal:I,built_in:[...w,...y,"set","shopt",...p,...P]},contains:[$,t.SHEBANG(),R,A,c,s,v,m,d,h,b,n]}}const nm=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_-]*/}}),om=["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"],im=["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"],rm=[...om,...im],lm=["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(),am=["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(),sm=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),cm=["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 dm(t){const o=t.regex,n=nm(t),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},a="and or not only",c=/@-?\w[\w]*(-\w+)*/,s="[a-zA-Z-][a-zA-Z0-9_-]*",m=[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:"\\."+s,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+am.join("|")+")"},{begin:":(:)?("+sm.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+cm.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...m,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...m,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:o.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:c},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:a,attribute:lm.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...m,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+rm.join("|")+")\\b"}]}}function il(t){const c={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:c,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:c,illegal:/["']/}]}]}}var jn="[0-9](_*[0-9])*",Zo=`\\.(${jn})`,Jo="[0-9a-fA-F](_*[0-9a-fA-F])*",rl={className:"number",variants:[{begin:`(\\b(${jn})((${Zo})|\\.)?|(${Zo}))[eE][+-]?(${jn})[fFdD]?\\b`},{begin:`\\b(${jn})((${Zo})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Zo})[fFdD]?\\b`},{begin:`\\b(${jn})[fFdD]\\b`},{begin:`\\b0[xX]((${Jo})\\.?|(${Jo})?\\.(${Jo}))[pP][+-]?(${jn})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Jo})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function ll(t,o,n){return n===-1?"":t.replace(o,r=>ll(t,o,n-1))}function um(t){const o=t.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=n+ll("(?:<"+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"]},h={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:[h,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,rl,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},rl,h]}}const al="[A-Za-z$_][0-9A-Za-z$_]*",fm=["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"],mm=["true","false","null","undefined","NaN","Infinity"],sl=["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"],cl=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],dl=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],pm=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],hm=[].concat(dl,sl,cl);function ul(t){const o=t.regex,n=(G,{after:le})=>{const me="</"+G[0].slice(1);return G.input.indexOf(me,le)!==-1},r=al,a={begin:"<>",end:"</>"},c=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(G,le)=>{const me=G[0].length+G.index,O=G.input[me];if(O==="<"||O===","){le.ignoreMatch();return}O===">"&&(n(G,{after:me})||le.ignoreMatch());let L;const ce=G.input.substring(me);if(L=ce.match(/^\s*=/)){le.ignoreMatch();return}if((L=ce.match(/^\s+extends\s+/))&&L.index===0){le.ignoreMatch();return}}},m={$pattern:al,keyword:fm,literal:mm,built_in:hm,"variable.language":pm},d="[0-9](_?[0-9])*",h=`\\.(${d})`,b="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",A={className:"number",variants:[{begin:`(\\b(${b})((${h})|\\.)?|(${h}))[eE][+-]?(${d})\\b`},{begin:`\\b(${b})\\b((${h})\\b|\\.)?|(${h})\\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},C={className:"subst",begin:"\\$\\{",end:"\\}",keywords:m,contains:[]},$={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"xml"}},R={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"css"}},U={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"graphql"}},I={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,C]},w={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]},y=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,$,R,U,I,{match:/\$\d+/},A];C.contains=y.concat({begin:/\{/,end:/\}/,keywords:m,contains:["self"].concat(y)});const p=[].concat(w,C.contains),P=p.concat([{begin:/(\s*)\(/,end:/\)/,keywords:m,contains:["self"].concat(p)}]),Y={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:m,contains:P},q={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"}}]},N={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:{_:[...sl,...cl]}},ae={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},ge={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[Y],illegal:/%/},ue={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function we(G){return o.concat("(?!",G.join("|"),")")}const te={match:o.concat(/\b/,we([...dl,"super","import"].map(G=>`${G}\\s*\\(`)),r,o.lookahead(/\s*\(/)),className:"title.function",relevance:0},de={begin:o.concat(/\./,o.lookahead(o.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},fe={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},Y]},g="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",V={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,o.lookahead(g)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[Y]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:m,exports:{PARAMS_CONTAINS:P,CLASS_REFERENCE:N},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),ae,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,$,R,U,I,w,{match:/\$\d+/},A,N,{scope:"attr",match:r+o.lookahead(":"),relevance:0},V,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[w,t.REGEXP_MODE,{className:"function",begin:g,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:m,contains:P}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:a.begin,end:a.end},{match:c},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},ge,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[Y,t.inherit(t.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},de,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[Y]},te,ue,q,fe,{match:/\$[(.]/}]}}function gm(t){const o={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],a={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[o,n,t.QUOTE_STRING_MODE,a,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function fl(t){const o=t.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},a={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}]},c={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},s={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},m=/[A-Za-z][A-Za-z0-9+.-]*/,d={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:o.concat(/\[.+?\]\(/,m,/:\/\/.*?\)/),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}]},h={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}]},A=t.inherit(h,{contains:[]}),C=t.inherit(b,{contains:[]});h.contains.push(C),b.contains.push(A);let $=[n,d];return[h,b,A,C].forEach(v=>{v.contains=v.contains.concat($)}),$=$.concat(h,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,c,h,b,{className:"quote",begin:"^>\\s+",contains:$,end:"$"},a,r,d,s,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function ml(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"],m={$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:/^(>>>|\.\.\.) /},h={className:"subst",begin:/\{/,end:/\}/,keywords:m,illegal:/#/},b={begin:/\{\{/,relevance:0},A={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,h]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,d,b,h]},{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,h]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,b,h]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},C="[0-9](_?[0-9])*",$=`(\\b(${C}))?\\.(${C})|\\b(${C})\\.`,R=`\\b|${r.join("|")}`,U={className:"number",relevance:0,variants:[{begin:`(\\b(${C})|(${$}))[eE][+-]?(${C})[jJ]?(?=${R})`},{begin:`(${$})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${R})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${R})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${R})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${R})`},{begin:`\\b(${C})[jJ](?=${R})`}]},I={className:"comment",begin:o.lookahead(/# type:/),end:/$/,keywords:m,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},v={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:m,contains:["self",d,U,A,t.HASH_COMMENT_MODE]}]};return h.contains=[A,U,d],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:m,illegal:/(<\/|\?)|=>/,contains:[d,U,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},A,I,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[v]},{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:[U,v,A]}]}}function pl(t){const o=t.regex,n=/(r#)?/,r=o.concat(n,t.UNDERSCORE_IDENT_RE),a=o.concat(n,t.IDENT_RE),c={className:"title.function.invoke",relevance:0,begin:o.concat(/\b/,/(?!let|for|while|if|else|match\b)/,a,o.lookahead(/\s*\(/))},s="([ui](8|16|32|64|128|size)|f(32|64))?",m=["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"],h=["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:m,literal:d,built_in:h},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_]+)"+s},{begin:"\\b0o([0-7_]+)"+s},{begin:"\\b0x([A-Fa-f0-9_]+)"+s},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+s}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[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:h,type:b}},{className:"punctuation",begin:"->"},c]}}function bm(t){const o=t.regex,n=t.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},a={begin:/"/,end:/"/,contains:[{match:/""/}]},c=["true","false","unknown"],s=["double precision","large object","with timezone","without timezone"],m=["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"],h=["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"],A=["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"],C=["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,R=[...h,...d].filter(P=>!b.includes(P)),U={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},I={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},v={match:o.concat(/\b/,o.either(...$),/\s*\(/),relevance:0,keywords:{built_in:$}};function w(P){return o.concat(/\b/,o.either(...P.map(Y=>Y.replace(/\s+/,"\\s+"))),/\b/)}const y={scope:"keyword",match:w(C),relevance:0};function p(P,{exceptions:Y,when:q}={}){const N=q;return Y=Y||[],P.map(ae=>ae.match(/\|\d+$/)||Y.includes(ae)?ae:N(ae)?`${ae}|0`:ae)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:p(R,{when:P=>P.length<3}),literal:c,type:m,built_in:A},contains:[{scope:"type",match:w(s)},y,v,U,r,a,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,n,I]}}const Qo="[A-Za-z$_][0-9A-Za-z$_]*",hl=["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"],gl=["true","false","null","undefined","NaN","Infinity"],bl=["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"],kl=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],yl=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],xl=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],El=[].concat(yl,bl,kl);function km(t){const o=t.regex,n=(G,{after:le})=>{const me="</"+G[0].slice(1);return G.input.indexOf(me,le)!==-1},r=Qo,a={begin:"<>",end:"</>"},c=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(G,le)=>{const me=G[0].length+G.index,O=G.input[me];if(O==="<"||O===","){le.ignoreMatch();return}O===">"&&(n(G,{after:me})||le.ignoreMatch());let L;const ce=G.input.substring(me);if(L=ce.match(/^\s*=/)){le.ignoreMatch();return}if((L=ce.match(/^\s+extends\s+/))&&L.index===0){le.ignoreMatch();return}}},m={$pattern:Qo,keyword:hl,literal:gl,built_in:El,"variable.language":xl},d="[0-9](_?[0-9])*",h=`\\.(${d})`,b="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",A={className:"number",variants:[{begin:`(\\b(${b})((${h})|\\.)?|(${h}))[eE][+-]?(${d})\\b`},{begin:`\\b(${b})\\b((${h})\\b|\\.)?|(${h})\\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},C={className:"subst",begin:"\\$\\{",end:"\\}",keywords:m,contains:[]},$={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"xml"}},R={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"css"}},U={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"graphql"}},I={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,C]},w={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]},y=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,$,R,U,I,{match:/\$\d+/},A];C.contains=y.concat({begin:/\{/,end:/\}/,keywords:m,contains:["self"].concat(y)});const p=[].concat(w,C.contains),P=p.concat([{begin:/(\s*)\(/,end:/\)/,keywords:m,contains:["self"].concat(p)}]),Y={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:m,contains:P},q={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"}}]},N={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:{_:[...bl,...kl]}},ae={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},ge={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[Y],illegal:/%/},ue={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function we(G){return o.concat("(?!",G.join("|"),")")}const te={match:o.concat(/\b/,we([...yl,"super","import"].map(G=>`${G}\\s*\\(`)),r,o.lookahead(/\s*\(/)),className:"title.function",relevance:0},de={begin:o.concat(/\./,o.lookahead(o.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},fe={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},Y]},g="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",V={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,o.lookahead(g)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[Y]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:m,exports:{PARAMS_CONTAINS:P,CLASS_REFERENCE:N},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),ae,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,$,R,U,I,w,{match:/\$\d+/},A,N,{scope:"attr",match:r+o.lookahead(":"),relevance:0},V,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[w,t.REGEXP_MODE,{className:"function",begin:g,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:m,contains:P}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:a.begin,end:a.end},{match:c},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},ge,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[Y,t.inherit(t.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},de,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[Y]},te,ue,q,fe,{match:/\$[(.]/}]}}function wl(t){const o=t.regex,n=km(t),r=Qo,a=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],c={begin:[/namespace/,/\s+/,t.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},s={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:a},contains:[n.exports.CLASS_REFERENCE]},m={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},d=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],h={$pattern:Qo,keyword:hl.concat(d),literal:gl,built_in:El.concat(a),"variable.language":xl},b={className:"meta",begin:"@"+r},A=(U,I,v)=>{const w=U.contains.findIndex(y=>y.label===I);if(w===-1)throw new Error("can not find mode to replace");U.contains.splice(w,1,v)};Object.assign(n.keywords,h),n.exports.PARAMS_CONTAINS.push(b);const C=n.contains.find(U=>U.scope==="attr"),$=Object.assign({},C,{match:o.concat(r,o.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,C,$]),n.contains=n.contains.concat([b,c,s,$]),A(n,"shebang",t.SHEBANG()),A(n,"use_strict",m);const R=n.contains.find(U=>U.label==="func.def");return R.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function Nl(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,a={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},c={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},s=t.inherit(c,{begin:/\(/,end:/\)/}),m=t.inherit(t.APOS_STRING_MODE,{className:"string"}),d=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),h={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:[a]},{begin:/'/,end:/'/,contains:[a]},{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:[c,d,m,s,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[c,s,d,m]}]}]},t.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},a,{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:[h],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[h],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:h}]},{className:"tag",begin:o.concat(/<\//,o.lookahead(o.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function Sl(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]|$)/}]},a={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},c={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},s={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,a]},m=t.inherit(s,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),C={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},R={begin:/\{/,end:/\}/,contains:[$],illegal:"\\n",relevance:0},U={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}},C,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},R,U,c,s],v=[...I];return v.pop(),v.push(m),$.contains=v,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:I}}const Oi={bash:Li,sh:Li,shell:Li,css:dm,go:il,golang:il,java:um,javascript:ul,js:ul,json:gm,markdown:fl,md:fl,python:ml,py:ml,rust:pl,rs:pl,sql:bm,typescript:wl,ts:wl,xml:Nl,html:Nl,yaml:Sl,yml:Sl};for(const[t,o]of Object.entries(Oi))Ii.registerLanguage(t,o);function ei(t){const o=t.split(`
61
61
  `);return/^(`{3,}|~{3,})/.test(o[0]??"")&&o.shift(),/^(`{3,}|~{3,})\s*$/.test(o[o.length-1]??"")&&o.pop(),o.join(`
62
- `).replace(/\n+$/,"")}function Tn(t){const o=/^(`{3,}|~{3,})([^\s`~]*)/.exec(t.split(`
63
- `)[0]??""),n=((o==null?void 0:o[2])??"").toLowerCase();return n&&Ai[n]?n:""}function _i(t,o){const n=o&&Ai[o]?o:"";try{return n?Ci.highlight(t,{language:n,ignoreIllegals:!0}).value:Ci.highlightAuto(t).value}catch{return Uf(t)}}function Ri(t){return t.split(`
64
- `).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 Uf(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function Bi(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Cn=Bi();function ml(t){Cn=t}var Mn={exec:()=>null};function Fn(t){let o=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),a=o[r];return a||(a=t(r),o[r]=a),a}}function Be(t,o=""){let n=typeof t=="string"?t:t.source,r={replace:(a,c)=>{let s=typeof c=="string"?c:c.source;return s=s.replace(dt.caret,"$1"),n=n.replace(a,s),r},getRegex:()=>new RegExp(n,o)};return r}var Hf=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),dt={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:Fn(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Fn(t=>new RegExp(`^ {0,${t}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:Fn(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:Fn(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:Fn(t=>new RegExp(`^ {0,${t}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:Fn(t=>new RegExp(`^ {0,${t}}>`))},Wf=/^(?:[ \t]*(?:\n|$))+/,Gf=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,jf=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,so=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Kf=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,vi=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,pl=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,hl=Be(pl).replace(/bull/g,vi).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(),Yf=Be(pl).replace(/bull/g,vi).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(),zi=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,qf=/^[^\n]+/,Ii=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Xf=Be(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Ii).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Zf=Be(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,vi).getRegex(),Ko="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",Li=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Jf=Be("^ {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",Li).replace("tag",Ko).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),gl=Be(zi).replace("hr",so).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",Ko).getRegex(),Qf=Be(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",gl).getRegex(),Oi={blockquote:Qf,code:Gf,def:Xf,fences:jf,heading:Kf,hr:so,html:Jf,lheading:hl,list:Zf,newline:Wf,paragraph:gl,table:Mn,text:qf},bl=Be("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",so).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",Ko).getRegex(),em={...Oi,lheading:Yf,table:bl,paragraph:Be(zi).replace("hr",so).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",bl).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",Ko).getRegex()},tm={...Oi,html:Be(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Li).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:Be(zi).replace("hr",so).replace("heading",` *#{1,6} *[^
65
- ]`).replace("lheading",hl).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},nm=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,om=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,kl=/^( {2,}|\\)\n(?!\s*$)/,im=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Un=/[\p{P}\p{S}]/u,Yo=/[\s\p{P}\p{S}]/u,Di=/[^\s\p{P}\p{S}]/u,rm=Be(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Yo).getRegex(),yl=/(?!~)[\p{P}\p{S}]/u,lm=/(?!~)[\s\p{P}\p{S}]/u,am=/(?:[^\s\p{P}\p{S}]|~)/u,sm=Be(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Hf?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),xl=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,cm=Be(xl,"u").replace(/punct/g,Un).getRegex(),dm=Be(xl,"u").replace(/punct/g,yl).getRegex(),El="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",um=Be(El,"gu").replace(/notPunctSpace/g,Di).replace(/punctSpace/g,Yo).replace(/punct/g,Un).getRegex(),fm=Be(El,"gu").replace(/notPunctSpace/g,am).replace(/punctSpace/g,lm).replace(/punct/g,yl).getRegex(),mm=Be("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Di).replace(/punctSpace/g,Yo).replace(/punct/g,Un).getRegex(),pm=Be(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Un).getRegex(),hm="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",gm=Be(hm,"gu").replace(/notPunctSpace/g,Di).replace(/punctSpace/g,Yo).replace(/punct/g,Un).getRegex(),bm=Be(/\\(punct)/,"gu").replace(/punct/g,Un).getRegex(),km=Be(/^<(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(),ym=Be(Li).replace("(?:-->|$)","-->").getRegex(),xm=Be("^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",ym).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),qo=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Em=Be(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",qo).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),wl=Be(/^!?\[(label)\]\[(ref)\]/).replace("label",qo).replace("ref",Ii).getRegex(),Nl=Be(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ii).getRegex(),wm=Be("reflink|nolink(?!\\()","g").replace("reflink",wl).replace("nolink",Nl).getRegex(),Sl=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Vi={_backpedal:Mn,anyPunctuation:bm,autolink:km,blockSkip:sm,br:kl,code:om,del:Mn,delLDelim:Mn,delRDelim:Mn,emStrongLDelim:cm,emStrongRDelimAst:um,emStrongRDelimUnd:mm,escape:nm,link:Em,nolink:Nl,punctuation:rm,reflink:wl,reflinkSearch:wm,tag:xm,text:im,url:Mn},Nm={...Vi,link:Be(/^!?\[(label)\]\((.*?)\)/).replace("label",qo).getRegex(),reflink:Be(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",qo).getRegex()},$i={...Vi,emStrongRDelimAst:fm,emStrongLDelim:dm,delLDelim:pm,delRDelim:gm,url:Be(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Sl).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:Be(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Sl).getRegex()},Sm={...$i,br:Be(kl).replace("{2,}","*").getRegex(),text:Be($i.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Xo={normal:Oi,gfm:em,pedantic:tm},co={normal:Vi,gfm:$i,breaks:Sm,pedantic:Nm},Tm={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Tl=t=>Tm[t];function Zt(t,o){if(o){if(dt.escapeTest.test(t))return t.replace(dt.escapeReplace,Tl)}else if(dt.escapeTestNoEncode.test(t))return t.replace(dt.escapeReplaceNoEncode,Tl);return t}function Cl(t){try{t=encodeURI(t).replace(dt.percentDecode,"%")}catch{return null}return t}function Ml(t,o){var c;let n=t.replace(dt.findPipe,(s,u,d)=>{let p=!1,b=u;for(;--b>=0&&d[b]==="\\";)p=!p;return p?"|":" |"}),r=n.split(dt.splitPipe),a=0;if(r[0].trim()||r.shift(),r.length>0&&!((c=r.at(-1))!=null&&c.trim())&&r.pop(),o)if(r.length>o)r.splice(o);else for(;r.length<o;)r.push("");for(;a<r.length;a++)r[a]=r[a].trim().replace(dt.slashPipe,"|");return r}function hn(t,o,n){let r=t.length;if(r===0)return"";let a=0;for(;a<r&&t.charAt(r-a-1)===o;)a++;return t.slice(0,r-a)}function Al(t){let o=t.split(`
66
- `),n=o.length-1;for(;n>=0&&dt.blankLine.test(o[n]);)n--;return o.length-n<=2?t:o.slice(0,n+1).join(`
67
- `)}function Cm(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 Mm(t,o=0){let n=o,r="";for(let a of t)if(a===" "){let c=4-n%4;r+=" ".repeat(c),n+=c}else r+=a,n++;return r}function _l(t,o,n,r,a){let c=o.href,s=o.title||null,u=t[1].replace(a.other.outputLinkReplace,"$1");r.state.inLink=!0;let d={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:c,title:s,text:u,tokens:r.inlineTokens(u)};return r.state.inLink=!1,d}function Am(t,o,n){let r=t.match(n.other.indentCodeCompensation);if(r===null)return o;let a=r[1];return o.split(`
68
- `).map(c=>{let s=c.match(n.other.beginningSpace);if(s===null)return c;let[u]=s;return u.length>=a.length?c.slice(a.length):c}).join(`
69
- `)}var Zo=class{constructor(t){He(this,"options");He(this,"rules");He(this,"lexer");this.options=t||Cn}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]:Al(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=Am(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=hn(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:hn(o[0],`
70
- `),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:hn(o[0],`
71
- `)}}blockquote(t){let o=this.rules.block.blockquote.exec(t);if(o){let n=hn(o[0],`
62
+ `).replace(/\n+$/,"")}function _n(t){const o=/^(`{3,}|~{3,})([^\s`~]*)/.exec(t.split(`
63
+ `)[0]??""),n=((o==null?void 0:o[2])??"").toLowerCase();return n&&Oi[n]?n:""}function Vi(t,o){const n=o&&Oi[o]?o:"";try{return n?Ii.highlight(t,{language:n,ignoreIllegals:!0}).value:Ii.highlightAuto(t).value}catch{return ym(t)}}function Di(t){return t.split(`
64
+ `).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 ym(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function $i(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var vn=$i();function Cl(t){vn=t}var Rn={exec:()=>null};function Kn(t){let o=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),a=o[r];return a||(a=t(r),o[r]=a),a}}function Le(t,o=""){let n=typeof t=="string"?t:t.source,r={replace:(a,c)=>{let s=typeof c=="string"?c:c.source;return s=s.replace(ut.caret,"$1"),n=n.replace(a,s),r},getRegex:()=>new RegExp(n,o)};return r}var xm=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),ut={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:Kn(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Kn(t=>new RegExp(`^ {0,${t}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:Kn(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:Kn(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:Kn(t=>new RegExp(`^ {0,${t}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:Kn(t=>new RegExp(`^ {0,${t}}>`))},Em=/^(?:[ \t]*(?:\n|$))+/,wm=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Nm=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,po=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Sm=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Pi=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Tl=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Ml=Le(Tl).replace(/bull/g,Pi).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(),Cm=Le(Tl).replace(/bull/g,Pi).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(),Fi=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Tm=/^[^\n]+/,Ui=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Mm=Le(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Ui).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Am=Le(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Pi).getRegex(),ti="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",Hi=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,_m=Le("^ {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",Hi).replace("tag",ti).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Al=Le(Fi).replace("hr",po).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",ti).getRegex(),vm=Le(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Al).getRegex(),Wi={blockquote:vm,code:wm,def:Mm,fences:Nm,heading:Sm,hr:po,html:_m,lheading:Ml,list:Am,newline:Em,paragraph:Al,table:Rn,text:Tm},_l=Le("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",po).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",ti).getRegex(),Rm={...Wi,lheading:Cm,table:_l,paragraph:Le(Fi).replace("hr",po).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",_l).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",ti).getRegex()},Bm={...Wi,html:Le(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Hi).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:Rn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Le(Fi).replace("hr",po).replace("heading",` *#{1,6} *[^
65
+ ]`).replace("lheading",Ml).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},zm=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Im=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,vl=/^( {2,}|\\)\n(?!\s*$)/,Lm=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Yn=/[\p{P}\p{S}]/u,ni=/[\s\p{P}\p{S}]/u,Gi=/[^\s\p{P}\p{S}]/u,Om=Le(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,ni).getRegex(),Rl=/(?!~)[\p{P}\p{S}]/u,Vm=/(?!~)[\s\p{P}\p{S}]/u,Dm=/(?:[^\s\p{P}\p{S}]|~)/u,$m=Le(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",xm?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Bl=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Pm=Le(Bl,"u").replace(/punct/g,Yn).getRegex(),Fm=Le(Bl,"u").replace(/punct/g,Rl).getRegex(),zl="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Um=Le(zl,"gu").replace(/notPunctSpace/g,Gi).replace(/punctSpace/g,ni).replace(/punct/g,Yn).getRegex(),Hm=Le(zl,"gu").replace(/notPunctSpace/g,Dm).replace(/punctSpace/g,Vm).replace(/punct/g,Rl).getRegex(),Wm=Le("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Gi).replace(/punctSpace/g,ni).replace(/punct/g,Yn).getRegex(),Gm=Le(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Yn).getRegex(),jm="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Km=Le(jm,"gu").replace(/notPunctSpace/g,Gi).replace(/punctSpace/g,ni).replace(/punct/g,Yn).getRegex(),Ym=Le(/\\(punct)/,"gu").replace(/punct/g,Yn).getRegex(),qm=Le(/^<(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(),Xm=Le(Hi).replace("(?:-->|$)","-->").getRegex(),Zm=Le("^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",Xm).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),oi=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Jm=Le(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",oi).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Il=Le(/^!?\[(label)\]\[(ref)\]/).replace("label",oi).replace("ref",Ui).getRegex(),Ll=Le(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ui).getRegex(),Qm=Le("reflink|nolink(?!\\()","g").replace("reflink",Il).replace("nolink",Ll).getRegex(),Ol=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,ji={_backpedal:Rn,anyPunctuation:Ym,autolink:qm,blockSkip:$m,br:vl,code:Im,del:Rn,delLDelim:Rn,delRDelim:Rn,emStrongLDelim:Pm,emStrongRDelimAst:Um,emStrongRDelimUnd:Wm,escape:zm,link:Jm,nolink:Ll,punctuation:Om,reflink:Il,reflinkSearch:Qm,tag:Zm,text:Lm,url:Rn},ep={...ji,link:Le(/^!?\[(label)\]\((.*?)\)/).replace("label",oi).getRegex(),reflink:Le(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",oi).getRegex()},Ki={...ji,emStrongRDelimAst:Hm,emStrongLDelim:Fm,delLDelim:Gm,delRDelim:Km,url:Le(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Ol).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:Le(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Ol).getRegex()},tp={...Ki,br:Le(vl).replace("{2,}","*").getRegex(),text:Le(Ki.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},ii={normal:Wi,gfm:Rm,pedantic:Bm},ho={normal:ji,gfm:Ki,breaks:tp,pedantic:ep},np={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Vl=t=>np[t];function Qt(t,o){if(o){if(ut.escapeTest.test(t))return t.replace(ut.escapeReplace,Vl)}else if(ut.escapeTestNoEncode.test(t))return t.replace(ut.escapeReplaceNoEncode,Vl);return t}function Dl(t){try{t=encodeURI(t).replace(ut.percentDecode,"%")}catch{return null}return t}function $l(t,o){var c;let n=t.replace(ut.findPipe,(s,m,d)=>{let h=!1,b=m;for(;--b>=0&&d[b]==="\\";)h=!h;return h?"|":" |"}),r=n.split(ut.splitPipe),a=0;if(r[0].trim()||r.shift(),r.length>0&&!((c=r.at(-1))!=null&&c.trim())&&r.pop(),o)if(r.length>o)r.splice(o);else for(;r.length<o;)r.push("");for(;a<r.length;a++)r[a]=r[a].trim().replace(ut.slashPipe,"|");return r}function bn(t,o,n){let r=t.length;if(r===0)return"";let a=0;for(;a<r&&t.charAt(r-a-1)===o;)a++;return t.slice(0,r-a)}function Pl(t){let o=t.split(`
66
+ `),n=o.length-1;for(;n>=0&&ut.blankLine.test(o[n]);)n--;return o.length-n<=2?t:o.slice(0,n+1).join(`
67
+ `)}function op(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 ip(t,o=0){let n=o,r="";for(let a of t)if(a===" "){let c=4-n%4;r+=" ".repeat(c),n+=c}else r+=a,n++;return r}function Fl(t,o,n,r,a){let c=o.href,s=o.title||null,m=t[1].replace(a.other.outputLinkReplace,"$1");r.state.inLink=!0;let d={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:c,title:s,text:m,tokens:r.inlineTokens(m)};return r.state.inLink=!1,d}function rp(t,o,n){let r=t.match(n.other.indentCodeCompensation);if(r===null)return o;let a=r[1];return o.split(`
68
+ `).map(c=>{let s=c.match(n.other.beginningSpace);if(s===null)return c;let[m]=s;return m.length>=a.length?c.slice(a.length):c}).join(`
69
+ `)}var ri=class{constructor(t){He(this,"options");He(this,"rules");He(this,"lexer");this.options=t||vn}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]:Pl(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=rp(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=bn(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:bn(o[0],`
70
+ `),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:bn(o[0],`
71
+ `)}}blockquote(t){let o=this.rules.block.blockquote.exec(t);if(o){let n=bn(o[0],`
72
72
  `).split(`
73
- `),r="",a="",c=[];for(;n.length>0;){let s=!1,u=[],d;for(d=0;d<n.length;d++)if(this.rules.other.blockquoteStart.test(n[d]))u.push(n[d]),s=!0;else if(!s)u.push(n[d]);else break;n=n.slice(d);let p=u.join(`
74
- `),b=p.replace(this.rules.other.blockquoteSetextReplace,`
73
+ `),r="",a="",c=[];for(;n.length>0;){let s=!1,m=[],d;for(d=0;d<n.length;d++)if(this.rules.other.blockquoteStart.test(n[d]))m.push(n[d]),s=!0;else if(!s)m.push(n[d]);else break;n=n.slice(d);let h=m.join(`
74
+ `),b=h.replace(this.rules.other.blockquoteSetextReplace,`
75
75
  $1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
76
- ${p}`:p,a=a?`${a}
77
- ${b}`:b;let C=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(b,c,!0),this.lexer.state.top=C,n.length===0)break;let w=c.at(-1);if((w==null?void 0:w.type)==="code")break;if((w==null?void 0:w.type)==="blockquote"){let V=w,R=V.raw+`
76
+ ${h}`:h,a=a?`${a}
77
+ ${b}`:b;let A=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(b,c,!0),this.lexer.state.top=A,n.length===0)break;let C=c.at(-1);if((C==null?void 0:C.type)==="code")break;if((C==null?void 0:C.type)==="blockquote"){let $=C,R=$.raw+`
78
78
  `+n.join(`
79
- `),U=this.blockquote(R);c[c.length-1]=U,r=r.substring(0,r.length-V.raw.length)+U.raw,a=a.substring(0,a.length-V.text.length)+U.text;break}else if((w==null?void 0:w.type)==="list"){let V=w,R=V.raw+`
79
+ `),U=this.blockquote(R);c[c.length-1]=U,r=r.substring(0,r.length-$.raw.length)+U.raw,a=a.substring(0,a.length-$.text.length)+U.text;break}else if((C==null?void 0:C.type)==="list"){let $=C,R=$.raw+`
80
80
  `+n.join(`
81
- `),U=this.list(R);c[c.length-1]=U,r=r.substring(0,r.length-w.raw.length)+U.raw,a=a.substring(0,a.length-V.raw.length)+U.raw,n=R.substring(c.at(-1).raw.length).split(`
82
- `);continue}}return{type:"blockquote",raw:r,tokens:c,text:a}}}list(t){let o=this.rules.block.list.exec(t);if(o){let n=o[1].trim(),r=n.length>1,a={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 c=this.rules.other.listItemRegex(n),s=!1;for(;t;){let d=!1,p="",b="";if(!(o=c.exec(t))||this.rules.block.hr.test(t))break;p=o[0],t=t.substring(p.length);let C=Mm(o[2].split(`
83
- `,1)[0],o[1].length),w=t.split(`
84
- `,1)[0],V=!C.trim(),R=0;if(this.options.pedantic?(R=2,b=C.trimStart()):V?R=o[1].length+1:(R=C.search(this.rules.other.nonSpaceChar),R=R>4?1:R,b=C.slice(R),R+=o[1].length),V&&this.rules.other.blankLine.test(w)&&(p+=w+`
85
- `,t=t.substring(w.length+1),d=!0),!d){let U=this.rules.other.nextBulletRegex(R),I=this.rules.other.hrRegex(R),_=this.rules.other.fencesBeginRegex(R),y=this.rules.other.headingBeginRegex(R),k=this.rules.other.htmlBeginRegex(R),m=this.rules.other.blockquoteBeginRegex(R);for(;t;){let P=t.split(`
86
- `,1)[0],j;if(w=P,this.options.pedantic?(w=w.replace(this.rules.other.listReplaceNesting," "),j=w):j=w.replace(this.rules.other.tabCharGlobal," "),_.test(w)||y.test(w)||k.test(w)||m.test(w)||U.test(w)||I.test(w))break;if(j.search(this.rules.other.nonSpaceChar)>=R||!w.trim())b+=`
87
- `+j.slice(R);else{if(V||C.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||_.test(C)||y.test(C)||I.test(C))break;b+=`
88
- `+w}V=!w.trim(),p+=P+`
89
- `,t=t.substring(P.length+1),C=j.slice(R)}}a.loose||(s?a.loose=!0:this.rules.other.doubleBlankLine.test(p)&&(s=!0)),a.items.push({type:"list_item",raw:p,task:!!this.options.gfm&&this.rules.other.listIsTask.test(b),loose:!1,text:b,tokens:[]}),a.raw+=p}let u=a.items.at(-1);if(u)u.raw=u.raw.trimEnd(),u.text=u.text.trimEnd();else return;a.raw=a.raw.trimEnd();for(let d of a.items){this.lexer.state.top=!1,d.tokens=this.lexer.blockTokens(d.text,[]);let p=d.tokens[0];if(d.task&&((p==null?void 0:p.type)==="text"||(p==null?void 0:p.type)==="paragraph")){d.text=d.text.replace(this.rules.other.listReplaceTask,""),p.raw=p.raw.replace(this.rules.other.listReplaceTask,""),p.text=p.text.replace(this.rules.other.listReplaceTask,"");for(let C=this.lexer.inlineQueue.length-1;C>=0;C--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[C].src)){this.lexer.inlineQueue[C].src=this.lexer.inlineQueue[C].src.replace(this.rules.other.listReplaceTask,"");break}let b=this.rules.other.listTaskCheckbox.exec(d.raw);if(b){let C={type:"checkbox",raw:b[0]+" ",checked:b[0]!=="[ ]"};d.checked=C.checked,a.loose?d.tokens[0]&&["paragraph","text"].includes(d.tokens[0].type)&&"tokens"in d.tokens[0]&&d.tokens[0].tokens?(d.tokens[0].raw=C.raw+d.tokens[0].raw,d.tokens[0].text=C.raw+d.tokens[0].text,d.tokens[0].tokens.unshift(C)):d.tokens.unshift({type:"paragraph",raw:C.raw,text:C.raw,tokens:[C]}):d.tokens.unshift(C)}}else d.task&&(d.task=!1);if(!a.loose){let b=d.tokens.filter(w=>w.type==="space"),C=b.length>0&&b.some(w=>this.rules.other.anyLine.test(w.raw));a.loose=C}}if(a.loose)for(let d of a.items){d.loose=!0;for(let p of d.tokens)p.type==="text"&&(p.type="paragraph")}return a}}html(t){let o=this.rules.block.html.exec(t);if(o){let n=Al(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"):"",a=o[3]?o[3].substring(1,o[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):o[3];return{type:"def",tag:n,raw:hn(o[0],`
90
- `),href:r,title:a}}}table(t){var s;let o=this.rules.block.table.exec(t);if(!o||!this.rules.other.tableDelimiter.test(o[2]))return;let n=Ml(o[1]),r=o[2].replace(this.rules.other.tableAlignChars,"").split("|"),a=(s=o[3])!=null&&s.trim()?o[3].replace(this.rules.other.tableRowBlankLine,"").split(`
91
- `):[],c={type:"table",raw:hn(o[0],`
92
- `),header:[],align:[],rows:[]};if(n.length===r.length){for(let u of r)this.rules.other.tableAlignRight.test(u)?c.align.push("right"):this.rules.other.tableAlignCenter.test(u)?c.align.push("center"):this.rules.other.tableAlignLeft.test(u)?c.align.push("left"):c.align.push(null);for(let u=0;u<n.length;u++)c.header.push({text:n[u],tokens:this.lexer.inline(n[u]),header:!0,align:c.align[u]});for(let u of a)c.rows.push(Ml(u,c.header.length).map((d,p)=>({text:d,tokens:this.lexer.inline(d),header:!1,align:c.align[p]})));return c}}lheading(t){let o=this.rules.block.lheading.exec(t);if(o){let n=o[1].trim();return{type:"heading",raw:hn(o[0],`
81
+ `),U=this.list(R);c[c.length-1]=U,r=r.substring(0,r.length-C.raw.length)+U.raw,a=a.substring(0,a.length-$.raw.length)+U.raw,n=R.substring(c.at(-1).raw.length).split(`
82
+ `);continue}}return{type:"blockquote",raw:r,tokens:c,text:a}}}list(t){let o=this.rules.block.list.exec(t);if(o){let n=o[1].trim(),r=n.length>1,a={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 c=this.rules.other.listItemRegex(n),s=!1;for(;t;){let d=!1,h="",b="";if(!(o=c.exec(t))||this.rules.block.hr.test(t))break;h=o[0],t=t.substring(h.length);let A=ip(o[2].split(`
83
+ `,1)[0],o[1].length),C=t.split(`
84
+ `,1)[0],$=!A.trim(),R=0;if(this.options.pedantic?(R=2,b=A.trimStart()):$?R=o[1].length+1:(R=A.search(this.rules.other.nonSpaceChar),R=R>4?1:R,b=A.slice(R),R+=o[1].length),$&&this.rules.other.blankLine.test(C)&&(h+=C+`
85
+ `,t=t.substring(C.length+1),d=!0),!d){let U=this.rules.other.nextBulletRegex(R),I=this.rules.other.hrRegex(R),v=this.rules.other.fencesBeginRegex(R),w=this.rules.other.headingBeginRegex(R),y=this.rules.other.htmlBeginRegex(R),p=this.rules.other.blockquoteBeginRegex(R);for(;t;){let P=t.split(`
86
+ `,1)[0],Y;if(C=P,this.options.pedantic?(C=C.replace(this.rules.other.listReplaceNesting," "),Y=C):Y=C.replace(this.rules.other.tabCharGlobal," "),v.test(C)||w.test(C)||y.test(C)||p.test(C)||U.test(C)||I.test(C))break;if(Y.search(this.rules.other.nonSpaceChar)>=R||!C.trim())b+=`
87
+ `+Y.slice(R);else{if($||A.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||v.test(A)||w.test(A)||I.test(A))break;b+=`
88
+ `+C}$=!C.trim(),h+=P+`
89
+ `,t=t.substring(P.length+1),A=Y.slice(R)}}a.loose||(s?a.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(s=!0)),a.items.push({type:"list_item",raw:h,task:!!this.options.gfm&&this.rules.other.listIsTask.test(b),loose:!1,text:b,tokens:[]}),a.raw+=h}let m=a.items.at(-1);if(m)m.raw=m.raw.trimEnd(),m.text=m.text.trimEnd();else return;a.raw=a.raw.trimEnd();for(let d of a.items){this.lexer.state.top=!1,d.tokens=this.lexer.blockTokens(d.text,[]);let h=d.tokens[0];if(d.task&&((h==null?void 0:h.type)==="text"||(h==null?void 0:h.type)==="paragraph")){d.text=d.text.replace(this.rules.other.listReplaceTask,""),h.raw=h.raw.replace(this.rules.other.listReplaceTask,""),h.text=h.text.replace(this.rules.other.listReplaceTask,"");for(let A=this.lexer.inlineQueue.length-1;A>=0;A--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[A].src)){this.lexer.inlineQueue[A].src=this.lexer.inlineQueue[A].src.replace(this.rules.other.listReplaceTask,"");break}let b=this.rules.other.listTaskCheckbox.exec(d.raw);if(b){let A={type:"checkbox",raw:b[0]+" ",checked:b[0]!=="[ ]"};d.checked=A.checked,a.loose?d.tokens[0]&&["paragraph","text"].includes(d.tokens[0].type)&&"tokens"in d.tokens[0]&&d.tokens[0].tokens?(d.tokens[0].raw=A.raw+d.tokens[0].raw,d.tokens[0].text=A.raw+d.tokens[0].text,d.tokens[0].tokens.unshift(A)):d.tokens.unshift({type:"paragraph",raw:A.raw,text:A.raw,tokens:[A]}):d.tokens.unshift(A)}}else d.task&&(d.task=!1);if(!a.loose){let b=d.tokens.filter(C=>C.type==="space"),A=b.length>0&&b.some(C=>this.rules.other.anyLine.test(C.raw));a.loose=A}}if(a.loose)for(let d of a.items){d.loose=!0;for(let h of d.tokens)h.type==="text"&&(h.type="paragraph")}return a}}html(t){let o=this.rules.block.html.exec(t);if(o){let n=Pl(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"):"",a=o[3]?o[3].substring(1,o[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):o[3];return{type:"def",tag:n,raw:bn(o[0],`
90
+ `),href:r,title:a}}}table(t){var s;let o=this.rules.block.table.exec(t);if(!o||!this.rules.other.tableDelimiter.test(o[2]))return;let n=$l(o[1]),r=o[2].replace(this.rules.other.tableAlignChars,"").split("|"),a=(s=o[3])!=null&&s.trim()?o[3].replace(this.rules.other.tableRowBlankLine,"").split(`
91
+ `):[],c={type:"table",raw:bn(o[0],`
92
+ `),header:[],align:[],rows:[]};if(n.length===r.length){for(let m of r)this.rules.other.tableAlignRight.test(m)?c.align.push("right"):this.rules.other.tableAlignCenter.test(m)?c.align.push("center"):this.rules.other.tableAlignLeft.test(m)?c.align.push("left"):c.align.push(null);for(let m=0;m<n.length;m++)c.header.push({text:n[m],tokens:this.lexer.inline(n[m]),header:!0,align:c.align[m]});for(let m of a)c.rows.push($l(m,c.header.length).map((d,h)=>({text:d,tokens:this.lexer.inline(d),header:!1,align:c.align[h]})));return c}}lheading(t){let o=this.rules.block.lheading.exec(t);if(o){let n=o[1].trim();return{type:"heading",raw:bn(o[0],`
93
93
  `),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)===`
94
- `?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 c=hn(n.slice(0,-1),"\\");if((n.length-c.length)%2===0)return}else{let c=Cm(o[2],"()");if(c===-2)return;if(c>-1){let s=(o[0].indexOf("!")===0?5:4)+o[1].length+c;o[2]=o[2].substring(0,c),o[0]=o[0].substring(0,s).trim(),o[3]=""}}let r=o[2],a="";if(this.options.pedantic){let c=this.rules.other.pedanticHrefTitle.exec(r);c&&(r=c[1],a=c[3])}else a=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)),_l(o,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.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," "),a=o[r.toLowerCase()];if(!a){let c=n[0].charAt(0);return{type:"text",raw:c,text:c}}return _l(n,a,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 a=[...r[0]].length-1,c,s,u=a,d=0,p=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(p.lastIndex=0,o=o.slice(-1*t.length+a);(r=p.exec(o))!==null;){if(c=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!c)continue;if(s=[...c].length,r[3]||r[4]){u+=s;continue}else if((r[5]||r[6])&&a%3&&!((a+s)%3)){d+=s;continue}if(u-=s,u>0)continue;s=Math.min(s,s+u+d);let b=[...r[0]][0].length,C=t.slice(0,a+r.index+b+s);if(Math.min(a,s)%2){let V=C.slice(1,-1);return{type:"em",raw:C,text:V,tokens:this.lexer.inlineTokens(V)}}let w=C.slice(2,-2);return{type:"strong",raw:C,text:w,tokens:this.lexer.inlineTokens(w)}}}}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),a=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&a&&(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 a=[...r[0]].length-1,c,s,u=a,d=this.rules.inline.delRDelim;for(d.lastIndex=0,o=o.slice(-1*t.length+a);(r=d.exec(o))!==null;){if(c=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!c||(s=[...c].length,s!==a))continue;if(r[3]||r[4]){u+=s;continue}if(u-=s,u>0)continue;s=Math.min(s,s+u);let p=[...r[0]][0].length,b=t.slice(0,a+r.index+p+s),C=b.slice(a,-a);return{type:"del",raw:b,text:C,tokens:this.lexer.inlineTokens(C)}}}}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,a;if(o[2]==="@")r=o[0],a="mailto:"+r;else{let c;do c=o[0],o[0]=((n=this.rules.inline._backpedal.exec(o[0]))==null?void 0:n[0])??"";while(c!==o[0]);r=o[0],o[1]==="www."?a="http://"+o[0]:a=o[0]}return{type:"link",raw:o[0],text:r,href:a,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}}}},Gt=class lr{constructor(o){He(this,"tokens");He(this,"options");He(this,"state");He(this,"inlineQueue");He(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=o||Cn,this.options.tokenizer=this.options.tokenizer||new Zo,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:dt,block:Xo.normal,inline:co.normal};this.options.pedantic?(n.block=Xo.pedantic,n.inline=co.pedantic):this.options.gfm&&(n.block=Xo.gfm,this.options.breaks?n.inline=co.breaks:n.inline=co.gfm),this.tokenizer.rules=n}static get rules(){return{block:Xo,inline:co}}static lex(o,n){return new lr(n).lex(o)}static lexInline(o,n){return new lr(n).inlineTokens(o)}lex(o){o=o.replace(dt.carriageReturn,`
95
- `),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 c,s,u;this.tokenizer.lexer=this,this.options.pedantic&&(o=o.replace(dt.tabCharGlobal," ").replace(dt.spaceLine,""));let a=1/0;for(;o;){if(o.length<a)a=o.length;else{this.infiniteLoopError(o.charCodeAt(0));break}let d;if((s=(c=this.options.extensions)==null?void 0:c.block)!=null&&s.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+=`
94
+ `?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 c=bn(n.slice(0,-1),"\\");if((n.length-c.length)%2===0)return}else{let c=op(o[2],"()");if(c===-2)return;if(c>-1){let s=(o[0].indexOf("!")===0?5:4)+o[1].length+c;o[2]=o[2].substring(0,c),o[0]=o[0].substring(0,s).trim(),o[3]=""}}let r=o[2],a="";if(this.options.pedantic){let c=this.rules.other.pedanticHrefTitle.exec(r);c&&(r=c[1],a=c[3])}else a=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)),Fl(o,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.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," "),a=o[r.toLowerCase()];if(!a){let c=n[0].charAt(0);return{type:"text",raw:c,text:c}}return Fl(n,a,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 a=[...r[0]].length-1,c,s,m=a,d=0,h=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,o=o.slice(-1*t.length+a);(r=h.exec(o))!==null;){if(c=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!c)continue;if(s=[...c].length,r[3]||r[4]){m+=s;continue}else if((r[5]||r[6])&&a%3&&!((a+s)%3)){d+=s;continue}if(m-=s,m>0)continue;s=Math.min(s,s+m+d);let b=[...r[0]][0].length,A=t.slice(0,a+r.index+b+s);if(Math.min(a,s)%2){let $=A.slice(1,-1);return{type:"em",raw:A,text:$,tokens:this.lexer.inlineTokens($)}}let C=A.slice(2,-2);return{type:"strong",raw:A,text:C,tokens:this.lexer.inlineTokens(C)}}}}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),a=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&a&&(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 a=[...r[0]].length-1,c,s,m=a,d=this.rules.inline.delRDelim;for(d.lastIndex=0,o=o.slice(-1*t.length+a);(r=d.exec(o))!==null;){if(c=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!c||(s=[...c].length,s!==a))continue;if(r[3]||r[4]){m+=s;continue}if(m-=s,m>0)continue;s=Math.min(s,s+m);let h=[...r[0]][0].length,b=t.slice(0,a+r.index+h+s),A=b.slice(a,-a);return{type:"del",raw:b,text:A,tokens:this.lexer.inlineTokens(A)}}}}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,a;if(o[2]==="@")r=o[0],a="mailto:"+r;else{let c;do c=o[0],o[0]=((n=this.rules.inline._backpedal.exec(o[0]))==null?void 0:n[0])??"";while(c!==o[0]);r=o[0],o[1]==="www."?a="http://"+o[0]:a=o[0]}return{type:"link",raw:o[0],text:r,href:a,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}}}},Yt=class br{constructor(o){He(this,"tokens");He(this,"options");He(this,"state");He(this,"inlineQueue");He(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=o||vn,this.options.tokenizer=this.options.tokenizer||new ri,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:ut,block:ii.normal,inline:ho.normal};this.options.pedantic?(n.block=ii.pedantic,n.inline=ho.pedantic):this.options.gfm&&(n.block=ii.gfm,this.options.breaks?n.inline=ho.breaks:n.inline=ho.gfm),this.tokenizer.rules=n}static get rules(){return{block:ii,inline:ho}}static lex(o,n){return new br(n).lex(o)}static lexInline(o,n){return new br(n).inlineTokens(o)}lex(o){o=o.replace(ut.carriageReturn,`
95
+ `),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 c,s,m;this.tokenizer.lexer=this,this.options.pedantic&&(o=o.replace(ut.tabCharGlobal," ").replace(ut.spaceLine,""));let a=1/0;for(;o;){if(o.length<a)a=o.length;else{this.infiniteLoopError(o.charCodeAt(0));break}let d;if((s=(c=this.options.extensions)==null?void 0:c.block)!=null&&s.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+=`
96
96
  `: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(`
97
97
  `)?"":`
98
98
  `)+d.raw,b.text+=`
99
99
  `+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(`
100
100
  `)?"":`
101
101
  `)+d.raw,b.text+=`
102
- `+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 p=o;if((u=this.options.extensions)!=null&&u.startBlock){let b=1/0,C=o.slice(1),w;this.options.extensions.startBlock.forEach(V=>{w=V.call({lexer:this},C),typeof w=="number"&&w>=0&&(b=Math.min(b,w))}),b<1/0&&b>=0&&(p=o.substring(0,b+1))}if(this.state.top&&(d=this.tokenizer.paragraph(p))){let b=n.at(-1);r&&(b==null?void 0:b.type)==="paragraph"?(b.raw+=(b.raw.endsWith(`
102
+ `+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 h=o;if((m=this.options.extensions)!=null&&m.startBlock){let b=1/0,A=o.slice(1),C;this.options.extensions.startBlock.forEach($=>{C=$.call({lexer:this},A),typeof C=="number"&&C>=0&&(b=Math.min(b,C))}),b<1/0&&b>=0&&(h=o.substring(0,b+1))}if(this.state.top&&(d=this.tokenizer.paragraph(h))){let b=n.at(-1);r&&(b==null?void 0:b.type)==="paragraph"?(b.raw+=(b.raw.endsWith(`
103
103
  `)?"":`
104
104
  `)+d.raw,b.text+=`
105
- `+d.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=b.text):n.push(d),r=p.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(`
105
+ `+d.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=b.text):n.push(d),r=h.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(`
106
106
  `)?"":`
107
107
  `)+d.raw,b.text+=`
108
- `+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 p,b,C,w,V;this.tokenizer.lexer=this;let r=o,a=null;if(this.tokens.links){let R=Object.keys(this.tokens.links);if(R.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(r))!==null;)R.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.anyPunctuation.exec(r))!==null;)r=r.slice(0,a.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let c;for(;(a=this.tokenizer.rules.inline.blockSkip.exec(r))!==null;)c=a[2]?a[2].length:0,r=r.slice(0,a.index+c)+"["+"a".repeat(a[0].length-c-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=((b=(p=this.options.hooks)==null?void 0:p.emStrongMask)==null?void 0:b.call({lexer:this},r))??r;let s=!1,u="",d=1/0;for(;o;){if(o.length<d)d=o.length;else{this.infiniteLoopError(o.charCodeAt(0));break}s||(u=""),s=!1;let R;if((w=(C=this.options.extensions)==null?void 0:C.inline)!=null&&w.some(I=>(R=I.call({lexer:this},o,n))?(o=o.substring(R.raw.length),n.push(R),!0):!1))continue;if(R=this.tokenizer.escape(o)){o=o.substring(R.raw.length),n.push(R);continue}if(R=this.tokenizer.tag(o)){o=o.substring(R.raw.length),n.push(R);continue}if(R=this.tokenizer.link(o)){o=o.substring(R.raw.length),n.push(R);continue}if(R=this.tokenizer.reflink(o,this.tokens.links)){o=o.substring(R.raw.length);let I=n.at(-1);R.type==="text"&&(I==null?void 0:I.type)==="text"?(I.raw+=R.raw,I.text+=R.text):n.push(R);continue}if(R=this.tokenizer.emStrong(o,r,u)){o=o.substring(R.raw.length),n.push(R);continue}if(R=this.tokenizer.codespan(o)){o=o.substring(R.raw.length),n.push(R);continue}if(R=this.tokenizer.br(o)){o=o.substring(R.raw.length),n.push(R);continue}if(R=this.tokenizer.del(o,r,u)){o=o.substring(R.raw.length),n.push(R);continue}if(R=this.tokenizer.autolink(o)){o=o.substring(R.raw.length),n.push(R);continue}if(!this.state.inLink&&(R=this.tokenizer.url(o))){o=o.substring(R.raw.length),n.push(R);continue}let U=o;if((V=this.options.extensions)!=null&&V.startInline){let I=1/0,_=o.slice(1),y;this.options.extensions.startInline.forEach(k=>{y=k.call({lexer:this},_),typeof y=="number"&&y>=0&&(I=Math.min(I,y))}),I<1/0&&I>=0&&(U=o.substring(0,I+1))}if(R=this.tokenizer.inlineText(U)){o=o.substring(R.raw.length),R.raw.slice(-1)!=="_"&&(u=R.raw.slice(-1)),s=!0;let I=n.at(-1);(I==null?void 0:I.type)==="text"?(I.raw+=R.raw,I.text+=R.text):n.push(R);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)}},uo=class{constructor(t){He(this,"options");He(this,"parser");this.options=t||Cn}space(t){return""}code({text:t,lang:o,escaped:n}){var c;let r=(c=(o||"").match(dt.notSpaceStart))==null?void 0:c[0],a=t.replace(dt.endingNewline,"")+`
109
- `;return r?'<pre><code class="language-'+Zt(r)+'">'+(n?a:Zt(a,!0))+`</code></pre>
110
- `:"<pre><code>"+(n?a:Zt(a,!0))+`</code></pre>
108
+ `+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 h,b,A,C,$;this.tokenizer.lexer=this;let r=o,a=null;if(this.tokens.links){let R=Object.keys(this.tokens.links);if(R.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(r))!==null;)R.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.anyPunctuation.exec(r))!==null;)r=r.slice(0,a.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let c;for(;(a=this.tokenizer.rules.inline.blockSkip.exec(r))!==null;)c=a[2]?a[2].length:0,r=r.slice(0,a.index+c)+"["+"a".repeat(a[0].length-c-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=((b=(h=this.options.hooks)==null?void 0:h.emStrongMask)==null?void 0:b.call({lexer:this},r))??r;let s=!1,m="",d=1/0;for(;o;){if(o.length<d)d=o.length;else{this.infiniteLoopError(o.charCodeAt(0));break}s||(m=""),s=!1;let R;if((C=(A=this.options.extensions)==null?void 0:A.inline)!=null&&C.some(I=>(R=I.call({lexer:this},o,n))?(o=o.substring(R.raw.length),n.push(R),!0):!1))continue;if(R=this.tokenizer.escape(o)){o=o.substring(R.raw.length),n.push(R);continue}if(R=this.tokenizer.tag(o)){o=o.substring(R.raw.length),n.push(R);continue}if(R=this.tokenizer.link(o)){o=o.substring(R.raw.length),n.push(R);continue}if(R=this.tokenizer.reflink(o,this.tokens.links)){o=o.substring(R.raw.length);let I=n.at(-1);R.type==="text"&&(I==null?void 0:I.type)==="text"?(I.raw+=R.raw,I.text+=R.text):n.push(R);continue}if(R=this.tokenizer.emStrong(o,r,m)){o=o.substring(R.raw.length),n.push(R);continue}if(R=this.tokenizer.codespan(o)){o=o.substring(R.raw.length),n.push(R);continue}if(R=this.tokenizer.br(o)){o=o.substring(R.raw.length),n.push(R);continue}if(R=this.tokenizer.del(o,r,m)){o=o.substring(R.raw.length),n.push(R);continue}if(R=this.tokenizer.autolink(o)){o=o.substring(R.raw.length),n.push(R);continue}if(!this.state.inLink&&(R=this.tokenizer.url(o))){o=o.substring(R.raw.length),n.push(R);continue}let U=o;if(($=this.options.extensions)!=null&&$.startInline){let I=1/0,v=o.slice(1),w;this.options.extensions.startInline.forEach(y=>{w=y.call({lexer:this},v),typeof w=="number"&&w>=0&&(I=Math.min(I,w))}),I<1/0&&I>=0&&(U=o.substring(0,I+1))}if(R=this.tokenizer.inlineText(U)){o=o.substring(R.raw.length),R.raw.slice(-1)!=="_"&&(m=R.raw.slice(-1)),s=!0;let I=n.at(-1);(I==null?void 0:I.type)==="text"?(I.raw+=R.raw,I.text+=R.text):n.push(R);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)}},go=class{constructor(t){He(this,"options");He(this,"parser");this.options=t||vn}space(t){return""}code({text:t,lang:o,escaped:n}){var c;let r=(c=(o||"").match(ut.notSpaceStart))==null?void 0:c[0],a=t.replace(ut.endingNewline,"")+`
109
+ `;return r?'<pre><code class="language-'+Qt(r)+'">'+(n?a:Qt(a,!0))+`</code></pre>
110
+ `:"<pre><code>"+(n?a:Qt(a,!0))+`</code></pre>
111
111
  `}blockquote({tokens:t}){return`<blockquote>
112
112
  ${this.parser.parse(t)}</blockquote>
113
113
  `}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:o}){return`<h${o}>${this.parser.parseInline(t)}</h${o}>
114
114
  `}hr(t){return`<hr>
115
- `}list(t){let o=t.ordered,n=t.start,r="";for(let s=0;s<t.items.length;s++){let u=t.items[s];r+=this.listitem(u)}let a=o?"ol":"ul",c=o&&n!==1?' start="'+n+'"':"";return"<"+a+c+`>
115
+ `}list(t){let o=t.ordered,n=t.start,r="";for(let s=0;s<t.items.length;s++){let m=t.items[s];r+=this.listitem(m)}let a=o?"ol":"ul",c=o&&n!==1?' start="'+n+'"':"";return"<"+a+c+`>
116
116
  `+r+"</"+a+`>
117
117
  `}listitem(t){return`<li>${this.parser.parse(t.tokens)}</li>
118
118
  `}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
@@ -123,20 +123,20 @@ ${this.parser.parse(t)}</blockquote>
123
123
  `}tablerow({text:t}){return`<tr>
124
124
  ${t}</tr>
125
125
  `}tablecell(t){let o=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+o+`</${n}>
126
- `}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>${Zt(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),a=Cl(t);if(a===null)return r;t=a;let c='<a href="'+t+'"';return o&&(c+=' title="'+Zt(o)+'"'),c+=">"+r+"</a>",c}image({href:t,title:o,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let a=Cl(t);if(a===null)return Zt(n);t=a;let c=`<img src="${t}" alt="${Zt(n)}"`;return o&&(c+=` title="${Zt(o)}"`),c+=">",c}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Zt(t.text)}},Pi=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}},jt=class ar{constructor(o){He(this,"options");He(this,"renderer");He(this,"textRenderer");this.options=o||Cn,this.options.renderer=this.options.renderer||new uo,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Pi}static parse(o,n){return new ar(n).parse(o)}static parseInline(o,n){return new ar(n).parseInline(o)}parse(o){var r,a;this.renderer.parser=this;let n="";for(let c=0;c<o.length;c++){let s=o[c];if((a=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&a[s.type]){let d=s,p=this.options.extensions.renderers[d.type].call({parser:this},d);if(p!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(d.type)){n+=p||"";continue}}let u=s;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 a,c;this.renderer.parser=this;let r="";for(let s=0;s<o.length;s++){let u=o[s];if((c=(a=this.options.extensions)==null?void 0:a.renderers)!=null&&c[u.type]){let p=this.options.extensions.renderers[u.type].call({parser:this},u);if(p!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(u.type)){r+=p||"";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 p='Token with "'+d.type+'" type was not found.';if(this.options.silent)return console.error(p),"";throw new Error(p)}}}return r}},fo=(ti=class{constructor(t){He(this,"options");He(this,"block");this.options=t||Cn}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?Gt.lex:Gt.lexInline}provideParser(t=this.block){return t?jt.parse:jt.parseInline}},He(ti,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),He(ti,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),ti),Rl=class{constructor(...t){He(this,"defaults",Bi());He(this,"options",this.setOptions);He(this,"parse",this.parseMarkdown(!0));He(this,"parseInline",this.parseMarkdown(!1));He(this,"Parser",jt);He(this,"Renderer",uo);He(this,"TextRenderer",Pi);He(this,"Lexer",Gt);He(this,"Tokenizer",Zo);He(this,"Hooks",fo);this.use(...t)}walkTokens(t,o){var r,a;let n=[];for(let c of t)switch(n=n.concat(o.call(this,c)),c.type){case"table":{let s=c;for(let u of s.header)n=n.concat(this.walkTokens(u.tokens,o));for(let u of s.rows)for(let d of u)n=n.concat(this.walkTokens(d.tokens,o));break}case"list":{let s=c;n=n.concat(this.walkTokens(s.items,o));break}default:{let s=c;(a=(r=this.defaults.extensions)==null?void 0:r.childTokens)!=null&&a[s.type]?this.defaults.extensions.childTokens[s.type].forEach(u=>{let d=s[u].flat(1/0);n=n.concat(this.walkTokens(d,o))}):s.tokens&&(n=n.concat(this.walkTokens(s.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(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){let c=o.renderers[a.name];c?o.renderers[a.name]=function(...s){let u=a.renderer.apply(this,s);return u===!1&&(u=c.apply(this,s)),u}:o.renderers[a.name]=a.renderer}if("tokenizer"in a){if(!a.level||a.level!=="block"&&a.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let c=o[a.level];c?c.unshift(a.tokenizer):o[a.level]=[a.tokenizer],a.start&&(a.level==="block"?o.startBlock?o.startBlock.push(a.start):o.startBlock=[a.start]:a.level==="inline"&&(o.startInline?o.startInline.push(a.start):o.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(o.childTokens[a.name]=a.childTokens)}),r.extensions=o),n.renderer){let a=this.defaults.renderer||new uo(this.defaults);for(let c in n.renderer){if(!(c in a))throw new Error(`renderer '${c}' does not exist`);if(["options","parser"].includes(c))continue;let s=c,u=n.renderer[s],d=a[s];a[s]=(...p)=>{let b=u.apply(a,p);return b===!1&&(b=d.apply(a,p)),b||""}}r.renderer=a}if(n.tokenizer){let a=this.defaults.tokenizer||new Zo(this.defaults);for(let c in n.tokenizer){if(!(c in a))throw new Error(`tokenizer '${c}' does not exist`);if(["options","rules","lexer"].includes(c))continue;let s=c,u=n.tokenizer[s],d=a[s];a[s]=(...p)=>{let b=u.apply(a,p);return b===!1&&(b=d.apply(a,p)),b}}r.tokenizer=a}if(n.hooks){let a=this.defaults.hooks||new fo;for(let c in n.hooks){if(!(c in a))throw new Error(`hook '${c}' does not exist`);if(["options","block"].includes(c))continue;let s=c,u=n.hooks[s],d=a[s];fo.passThroughHooks.has(c)?a[s]=p=>{if(this.defaults.async&&fo.passThroughHooksRespectAsync.has(c))return(async()=>{let C=await u.call(a,p);return d.call(a,C)})();let b=u.call(a,p);return d.call(a,b)}:a[s]=(...p)=>{if(this.defaults.async)return(async()=>{let C=await u.apply(a,p);return C===!1&&(C=await d.apply(a,p)),C})();let b=u.apply(a,p);return b===!1&&(b=d.apply(a,p)),b}}r.hooks=a}if(n.walkTokens){let a=this.defaults.walkTokens,c=n.walkTokens;r.walkTokens=function(s){let u=[];return u.push(c.call(this,s)),a&&(u=u.concat(a.call(this,s))),u}}this.defaults={...this.defaults,...r}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,o){return Gt.lex(t,o??this.defaults)}parser(t,o){return jt.parse(t,o??this.defaults)}parseMarkdown(t){return(o,n)=>{let r={...n},a={...this.defaults,...r},c=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&r.async===!1)return c(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 c(new Error("marked(): input parameter is undefined or null"));if(typeof o!="string")return c(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(o)+", string expected"));if(a.hooks&&(a.hooks.options=a,a.hooks.block=t),a.async)return(async()=>{let s=a.hooks?await a.hooks.preprocess(o):o,u=await(a.hooks?await a.hooks.provideLexer(t):t?Gt.lex:Gt.lexInline)(s,a),d=a.hooks?await a.hooks.processAllTokens(u):u;a.walkTokens&&await Promise.all(this.walkTokens(d,a.walkTokens));let p=await(a.hooks?await a.hooks.provideParser(t):t?jt.parse:jt.parseInline)(d,a);return a.hooks?await a.hooks.postprocess(p):p})().catch(c);try{a.hooks&&(o=a.hooks.preprocess(o));let s=(a.hooks?a.hooks.provideLexer(t):t?Gt.lex:Gt.lexInline)(o,a);a.hooks&&(s=a.hooks.processAllTokens(s)),a.walkTokens&&this.walkTokens(s,a.walkTokens);let u=(a.hooks?a.hooks.provideParser(t):t?jt.parse:jt.parseInline)(s,a);return a.hooks&&(u=a.hooks.postprocess(u)),u}catch(s){return c(s)}}}onError(t,o){return n=>{if(n.message+=`
127
- Please report this to https://github.com/markedjs/marked.`,t){let r="<p>An error occurred:</p><pre>"+Zt(n.message+"",!0)+"</pre>";return o?Promise.resolve(r):r}if(o)return Promise.reject(n);throw n}}},An=new Rl;function Fe(t,o){return An.parse(t,o)}Fe.options=Fe.setOptions=function(t){return An.setOptions(t),Fe.defaults=An.defaults,ml(Fe.defaults),Fe},Fe.getDefaults=Bi,Fe.defaults=Cn,Fe.use=function(...t){return An.use(...t),Fe.defaults=An.defaults,ml(Fe.defaults),Fe},Fe.walkTokens=function(t,o){return An.walkTokens(t,o)},Fe.parseInline=An.parseInline,Fe.Parser=jt,Fe.parser=jt.parse,Fe.Renderer=uo,Fe.TextRenderer=Pi,Fe.Lexer=Gt,Fe.lexer=Gt.lex,Fe.Tokenizer=Zo,Fe.Hooks=fo,Fe.parse=Fe,Fe.options,Fe.setOptions,Fe.use,Fe.walkTokens,Fe.parseInline,jt.parse,Gt.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 Bl(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 _m(t){if(Array.isArray(t))return t}function Rm(t,o){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,a,c,s,u=[],d=!0,p=!1;try{if(c=(n=n.call(t)).next,o!==0)for(;!(d=(r=c.call(n)).done)&&(u.push(r.value),u.length!==o);d=!0);}catch(b){p=!0,a=b}finally{try{if(!d&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(p)throw a}}return u}}function Bm(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
128
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vm(t,o){return _m(t)||Rm(t,o)||zm(t,o)||Bm()}function zm(t,o){if(t){if(typeof t=="string")return Bl(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)?Bl(t,o):void 0}}const vl=Object.entries,zl=Object.setPrototypeOf,Im=Object.isFrozen,Lm=Object.getPrototypeOf,Om=Object.getOwnPropertyDescriptor;let xt=Object.freeze,$t=Object.seal,Hn=Object.create,Il=typeof Reflect<"u"&&Reflect,Fi=Il.apply,Ui=Il.construct;xt||(xt=function(o){return o}),$t||($t=function(o){return o}),Fi||(Fi=function(o,n){for(var r=arguments.length,a=new Array(r>2?r-2:0),c=2;c<r;c++)a[c-2]=arguments[c];return o.apply(n,a)}),Ui||(Ui=function(o){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];return new o(...r)});const _n=Qe(Array.prototype.forEach),Dm=Qe(Array.prototype.lastIndexOf),Ll=Qe(Array.prototype.pop),Wn=Qe(Array.prototype.push),Vm=Qe(Array.prototype.splice),Et=Array.isArray,mo=Qe(String.prototype.toLowerCase),Hi=Qe(String.prototype.toString),Ol=Qe(String.prototype.match),Gn=Qe(String.prototype.replace),Dl=Qe(String.prototype.indexOf),$m=Qe(String.prototype.trim),Pm=Qe(Number.prototype.toString),Fm=Qe(Boolean.prototype.toString),Vl=typeof BigInt>"u"?null:Qe(BigInt.prototype.toString),$l=typeof Symbol>"u"?null:Qe(Symbol.prototype.toString),Ke=Qe(Object.prototype.hasOwnProperty),po=Qe(Object.prototype.toString),at=Qe(RegExp.prototype.test),jn=Um(TypeError);function Qe(t){return function(o){o instanceof RegExp&&(o.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];return Fi(t,o,r)}}function Um(t){return function(){for(var o=arguments.length,n=new Array(o),r=0;r<o;r++)n[r]=arguments[r];return Ui(t,n)}}function Se(t,o){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:mo;if(zl&&zl(t,null),!Et(o))return t;let r=o.length;for(;r--;){let a=o[r];if(typeof a=="string"){const c=n(a);c!==a&&(Im(o)||(o[r]=c),a=c)}t[a]=!0}return t}function Hm(t){for(let o=0;o<t.length;o++)Ke(t,o)||(t[o]=null);return t}function ut(t){const o=Hn(null);for(const r of vl(t)){var n=vm(r,2);const a=n[0],c=n[1];Ke(t,a)&&(Et(c)?o[a]=Hm(c):c&&typeof c=="object"&&c.constructor===Object?o[a]=ut(c):o[a]=c)}return o}function Wm(t){switch(typeof t){case"string":return t;case"number":return Pm(t);case"boolean":return Fm(t);case"bigint":return Vl?Vl(t):"0";case"symbol":return $l?$l(t):"Symbol()";case"undefined":return po(t);case"function":case"object":{if(t===null)return po(t);const o=t,n=Jt(o,"toString");if(typeof n=="function"){const r=n(o);return typeof r=="string"?r:po(r)}return po(t)}default:return po(t)}}function Jt(t,o){for(;t!==null;){const r=Om(t,o);if(r){if(r.get)return Qe(r.get);if(typeof r.value=="function")return Qe(r.value)}t=Lm(t)}function n(){return null}return n}function Gm(t){try{return at(t,""),!0}catch{return!1}}const Pl=xt(["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"]),Wi=xt(["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"]),Gi=xt(["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"]),jm=xt(["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"]),ji=xt(["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"]),Km=xt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Fl=xt(["#text"]),Ul=xt(["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"]),Ki=xt(["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"]),Hl=xt(["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"]),Jo=xt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Ym=$t(/{{[\w\W]*|^[\w\W]*}}/g),qm=$t(/<%[\w\W]*|^[\w\W]*%>/g),Xm=$t(/\${[\w\W]*/g),Zm=$t(/^data-[\-\w.\u00B7-\uFFFF]+$/),Jm=$t(/^aria-[\-\w]+$/),Wl=$t(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Qm=$t(/^(?:\w+script|data):/i),ep=$t(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),tp=$t(/^html$/i),np=$t(/^[a-z][.\w]*(-[.\w]+)+$/i),Qt={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},op=function(){return typeof window>"u"?null:window},ip=function(o,n){if(typeof o!="object"||typeof o.createPolicy!="function")return null;let r=null;const a="data-tt-policy-suffix";n&&n.hasAttribute(a)&&(r=n.getAttribute(a));const c="dompurify"+(r?"#"+r:"");try{return o.createPolicy(c,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+c+" could not be created."),null}},Gl=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function jl(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:op();const o=M=>jl(M);if(o.version="3.4.8",o.removed=[],!t||!t.document||t.document.nodeType!==Qt.document||!t.Element)return o.isSupported=!1,o;let n=t.document;const r=n,a=r.currentScript;t.DocumentFragment;const c=t.HTMLTemplateElement,s=t.Node,u=t.Element,d=t.NodeFilter,p=t.NamedNodeMap;p===void 0&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const b=t.DOMParser,C=t.trustedTypes,w=u.prototype,V=Jt(w,"cloneNode"),R=Jt(w,"remove"),U=Jt(w,"nextSibling"),I=Jt(w,"childNodes"),_=Jt(w,"parentNode"),y=Jt(w,"shadowRoot"),k=Jt(w,"attributes"),m=s&&s.prototype?Jt(s.prototype,"nodeType"):null,P=s&&s.prototype?Jt(s.prototype,"nodeName"):null;if(typeof c=="function"){const M=n.createElement("template");M.content&&M.content.ownerDocument&&(n=M.content.ownerDocument)}let j,Y="",x=0;const re=function(g){if(x>0)throw jn('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.');x++;try{return j.createHTML(g)}finally{x--}},pe=n,de=pe.implementation,we=pe.createNodeIterator,ee=pe.createDocumentFragment,ce=pe.getElementsByTagName,ue=r.importNode;let h=Gl();o.isSupported=typeof vl=="function"&&typeof _=="function"&&de&&de.createHTMLDocument!==void 0;const $=Ym,G=qm,oe=Xm,fe=Zm,O=Jm,L=Qm,se=ep,ke=np;let z=Wl,S=null;const F=Se({},[...Pl,...Wi,...Gi,...ji,...Fl]);let W=null;const te=Se({},[...Ul,...Ki,...Hl,...Jo]);let ye=Object.seal(Hn(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}})),nt=null,ft=null;const ot=Object.seal(Hn(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let an=!0,it=!0,sn=!1,Pt=!0,me=!1,mt=!0,De=!1,ze=!1,Ft=!1,rt=!1,Ct=!1,wt=!1,q=!0,le=!1;const xe="user-content-";let Re=!0,Ge=!1,lt={},Mt=null;const Bn=Se({},["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 ni=null;const oi=Se({},["audio","video","img","source","image","track"]);let ho=null;const ii=Se({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Yn="http://www.w3.org/1998/Math/MathML",qn="http://www.w3.org/2000/svg",Ut="http://www.w3.org/1999/xhtml";let bn=Ut,go=!1,bo=null;const Yi=Se({},[Yn,qn,Ut],Hi);let ko=Se({},["mi","mo","mn","ms","mtext"]),yo=Se({},["annotation-xml"]);const qi=Se({},["title","style","font","a","script"]);let vn=null;const ri=["application/xhtml+xml","text/html"],Xi="text/html";let je=null,kn=null;const li=n.createElement("form"),ai=function(g){return g instanceof RegExp||g instanceof Function},Xn=function(){let g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(kn&&kn===g)return;(!g||typeof g!="object")&&(g={}),g=ut(g),vn=ri.indexOf(g.PARSER_MEDIA_TYPE)===-1?Xi:g.PARSER_MEDIA_TYPE,je=vn==="application/xhtml+xml"?Hi:mo,S=Ke(g,"ALLOWED_TAGS")&&Et(g.ALLOWED_TAGS)?Se({},g.ALLOWED_TAGS,je):F,W=Ke(g,"ALLOWED_ATTR")&&Et(g.ALLOWED_ATTR)?Se({},g.ALLOWED_ATTR,je):te,bo=Ke(g,"ALLOWED_NAMESPACES")&&Et(g.ALLOWED_NAMESPACES)?Se({},g.ALLOWED_NAMESPACES,Hi):Yi,ho=Ke(g,"ADD_URI_SAFE_ATTR")&&Et(g.ADD_URI_SAFE_ATTR)?Se(ut(ii),g.ADD_URI_SAFE_ATTR,je):ii,ni=Ke(g,"ADD_DATA_URI_TAGS")&&Et(g.ADD_DATA_URI_TAGS)?Se(ut(oi),g.ADD_DATA_URI_TAGS,je):oi,Mt=Ke(g,"FORBID_CONTENTS")&&Et(g.FORBID_CONTENTS)?Se({},g.FORBID_CONTENTS,je):Bn,nt=Ke(g,"FORBID_TAGS")&&Et(g.FORBID_TAGS)?Se({},g.FORBID_TAGS,je):ut({}),ft=Ke(g,"FORBID_ATTR")&&Et(g.FORBID_ATTR)?Se({},g.FORBID_ATTR,je):ut({}),lt=Ke(g,"USE_PROFILES")?g.USE_PROFILES&&typeof g.USE_PROFILES=="object"?ut(g.USE_PROFILES):g.USE_PROFILES:!1,an=g.ALLOW_ARIA_ATTR!==!1,it=g.ALLOW_DATA_ATTR!==!1,sn=g.ALLOW_UNKNOWN_PROTOCOLS||!1,Pt=g.ALLOW_SELF_CLOSE_IN_ATTR!==!1,me=g.SAFE_FOR_TEMPLATES||!1,mt=g.SAFE_FOR_XML!==!1,De=g.WHOLE_DOCUMENT||!1,rt=g.RETURN_DOM||!1,Ct=g.RETURN_DOM_FRAGMENT||!1,wt=g.RETURN_TRUSTED_TYPE||!1,Ft=g.FORCE_BODY||!1,q=g.SANITIZE_DOM!==!1,le=g.SANITIZE_NAMED_PROPS||!1,Re=g.KEEP_CONTENT!==!1,Ge=g.IN_PLACE||!1,z=Gm(g.ALLOWED_URI_REGEXP)?g.ALLOWED_URI_REGEXP:Wl,bn=typeof g.NAMESPACE=="string"?g.NAMESPACE:Ut,ko=Ke(g,"MATHML_TEXT_INTEGRATION_POINTS")&&g.MATHML_TEXT_INTEGRATION_POINTS&&typeof g.MATHML_TEXT_INTEGRATION_POINTS=="object"?ut(g.MATHML_TEXT_INTEGRATION_POINTS):Se({},["mi","mo","mn","ms","mtext"]),yo=Ke(g,"HTML_INTEGRATION_POINTS")&&g.HTML_INTEGRATION_POINTS&&typeof g.HTML_INTEGRATION_POINTS=="object"?ut(g.HTML_INTEGRATION_POINTS):Se({},["annotation-xml"]);const D=Ke(g,"CUSTOM_ELEMENT_HANDLING")&&g.CUSTOM_ELEMENT_HANDLING&&typeof g.CUSTOM_ELEMENT_HANDLING=="object"?ut(g.CUSTOM_ELEMENT_HANDLING):Hn(null);if(ye=Hn(null),Ke(D,"tagNameCheck")&&ai(D.tagNameCheck)&&(ye.tagNameCheck=D.tagNameCheck),Ke(D,"attributeNameCheck")&&ai(D.attributeNameCheck)&&(ye.attributeNameCheck=D.attributeNameCheck),Ke(D,"allowCustomizedBuiltInElements")&&typeof D.allowCustomizedBuiltInElements=="boolean"&&(ye.allowCustomizedBuiltInElements=D.allowCustomizedBuiltInElements),me&&(it=!1),Ct&&(rt=!0),lt&&(S=Se({},Fl),W=Hn(null),lt.html===!0&&(Se(S,Pl),Se(W,Ul)),lt.svg===!0&&(Se(S,Wi),Se(W,Ki),Se(W,Jo)),lt.svgFilters===!0&&(Se(S,Gi),Se(W,Ki),Se(W,Jo)),lt.mathMl===!0&&(Se(S,ji),Se(W,Hl),Se(W,Jo))),ot.tagCheck=null,ot.attributeCheck=null,Ke(g,"ADD_TAGS")&&(typeof g.ADD_TAGS=="function"?ot.tagCheck=g.ADD_TAGS:Et(g.ADD_TAGS)&&(S===F&&(S=ut(S)),Se(S,g.ADD_TAGS,je))),Ke(g,"ADD_ATTR")&&(typeof g.ADD_ATTR=="function"?ot.attributeCheck=g.ADD_ATTR:Et(g.ADD_ATTR)&&(W===te&&(W=ut(W)),Se(W,g.ADD_ATTR,je))),Ke(g,"ADD_URI_SAFE_ATTR")&&Et(g.ADD_URI_SAFE_ATTR)&&Se(ho,g.ADD_URI_SAFE_ATTR,je),Ke(g,"FORBID_CONTENTS")&&Et(g.FORBID_CONTENTS)&&(Mt===Bn&&(Mt=ut(Mt)),Se(Mt,g.FORBID_CONTENTS,je)),Ke(g,"ADD_FORBID_CONTENTS")&&Et(g.ADD_FORBID_CONTENTS)&&(Mt===Bn&&(Mt=ut(Mt)),Se(Mt,g.ADD_FORBID_CONTENTS,je)),Re&&(S["#text"]=!0),De&&Se(S,["html","head","body"]),S.table&&(Se(S,["tbody"]),delete nt.tbody),g.TRUSTED_TYPES_POLICY){if(typeof g.TRUSTED_TYPES_POLICY.createHTML!="function")throw jn('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof g.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw jn('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const X=j;j=g.TRUSTED_TYPES_POLICY;try{Y=re("")}catch(Ie){throw j=X,Ie}}else j===void 0&&g.TRUSTED_TYPES_POLICY!==null&&(j=ip(C,a)),j&&typeof Y=="string"&&(Y=re(""));(h.uponSanitizeElement.length>0||h.uponSanitizeAttribute.length>0)&&S===F&&(S=ut(S)),h.uponSanitizeAttribute.length>0&&W===te&&(W=ut(W)),xt&&xt(g),kn=g},xo=Se({},[...Wi,...Gi,...jm]),yn=Se({},[...ji,...Km]),Zi=function(g){let D=_(g);(!D||!D.tagName)&&(D={namespaceURI:bn,tagName:"template"});const X=mo(g.tagName),Ie=mo(D.tagName);return bo[g.namespaceURI]?g.namespaceURI===qn?D.namespaceURI===Ut?X==="svg":D.namespaceURI===Yn?X==="svg"&&(Ie==="annotation-xml"||ko[Ie]):!!xo[X]:g.namespaceURI===Yn?D.namespaceURI===Ut?X==="math":D.namespaceURI===qn?X==="math"&&yo[Ie]:!!yn[X]:g.namespaceURI===Ut?D.namespaceURI===qn&&!yo[Ie]||D.namespaceURI===Yn&&!ko[Ie]?!1:!yn[X]&&(qi[X]||!xo[X]):!!(vn==="application/xhtml+xml"&&bo[g.namespaceURI]):!1},At=function(g){Wn(o.removed,{element:g});try{_(g).removeChild(g)}catch{R(g)}},en=function(g,D){try{Wn(o.removed,{attribute:D.getAttributeNode(g),from:D})}catch{Wn(o.removed,{attribute:null,from:D})}if(D.removeAttribute(g),g==="is")if(rt||Ct)try{At(D)}catch{}else try{D.setAttribute(g,"")}catch{}},Eo=function(g){let D=null,X=null;if(Ft)g="<remove></remove>"+g;else{const $e=Ol(g,/^[\r\n\t ]+/);X=$e&&$e[0]}vn==="application/xhtml+xml"&&bn===Ut&&(g='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+g+"</body></html>");const Ie=j?re(g):g;if(bn===Ut)try{D=new b().parseFromString(Ie,vn)}catch{}if(!D||!D.documentElement){D=de.createDocument(bn,"template",null);try{D.documentElement.innerHTML=go?Y:Ie}catch{}}const Ne=D.body||D.documentElement;return g&&X&&Ne.insertBefore(n.createTextNode(X),Ne.childNodes[0]||null),bn===Ut?ce.call(D,De?"html":"body")[0]:De?D.documentElement:Ne},Zn=function(g){return we.call(g.ownerDocument||g,g,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},zn=function(g){var D,X;g.normalize();const Ie=we.call(g.ownerDocument||g,g,d.SHOW_TEXT|d.SHOW_COMMENT|d.SHOW_CDATA_SECTION|d.SHOW_PROCESSING_INSTRUCTION,null);let Ne=Ie.nextNode();for(;Ne;){let Ze=Ne.data;_n([$,G,oe],St=>{Ze=Gn(Ze,St," ")}),Ne.data=Ze,Ne=Ie.nextNode()}const $e=(D=(X=g.querySelectorAll)===null||X===void 0?void 0:X.call(g,"template"))!==null&&D!==void 0?D:[];_n(Array.from($e),Ze=>{xn(Ze.content)&&zn(Ze.content)})},Jn=function(g){const D=P?P(g):null;return typeof D!="string"||je(D)!=="form"?!1:typeof g.nodeName!="string"||typeof g.textContent!="string"||typeof g.removeChild!="function"||g.attributes!==k(g)||typeof g.removeAttribute!="function"||typeof g.setAttribute!="function"||typeof g.namespaceURI!="string"||typeof g.insertBefore!="function"||typeof g.hasChildNodes!="function"||g.nodeType!==m(g)||g.childNodes!==I(g)},xn=function(g){if(!m||typeof g!="object"||g===null)return!1;try{return m(g)===Qt.documentFragment}catch{return!1}},Qn=function(g){if(!m||typeof g!="object"||g===null)return!1;try{return typeof m(g)=="number"}catch{return!1}};function _t(M,g,D){_n(M,X=>{X.call(o,g,D,kn)})}const eo=function(g){let D=null;if(_t(h.beforeSanitizeElements,g,null),Jn(g))return At(g),!0;const X=je(P?P(g):g.nodeName);if(_t(h.uponSanitizeElement,g,{tagName:X,allowedTags:S}),mt&&g.hasChildNodes()&&!Qn(g.firstElementChild)&&at(/<[/\w!]/g,g.innerHTML)&&at(/<[/\w!]/g,g.textContent)||mt&&g.namespaceURI===Ut&&X==="style"&&Qn(g.firstElementChild)||g.nodeType===Qt.progressingInstruction||mt&&g.nodeType===Qt.comment&&at(/<[/\w]/g,g.data))return At(g),!0;if(nt[X]||!(ot.tagCheck instanceof Function&&ot.tagCheck(X))&&!S[X]){if(!nt[X]&&Ee(X)&&(ye.tagNameCheck instanceof RegExp&&at(ye.tagNameCheck,X)||ye.tagNameCheck instanceof Function&&ye.tagNameCheck(X)))return!1;if(Re&&!Mt[X]){const Ne=_(g),$e=I(g);if($e&&Ne){const Ze=$e.length;for(let St=Ze-1;St>=0;--St){const pt=V($e[St],!0);Ne.insertBefore(pt,U(g))}}}return At(g),!0}return(m?m(g):g.nodeType)===Qt.element&&!Zi(g)||(X==="noscript"||X==="noembed"||X==="noframes")&&at(/<\/no(script|embed|frames)/i,g.innerHTML)?(At(g),!0):(me&&g.nodeType===Qt.text&&(D=g.textContent,_n([$,G,oe],Ne=>{D=Gn(D,Ne," ")}),g.textContent!==D&&(Wn(o.removed,{element:g.cloneNode()}),g.textContent=D)),_t(h.afterSanitizeElements,g,null),!1)},Kt=function(g,D,X){if(ft[D]||q&&(D==="id"||D==="name")&&(X in n||X in li))return!1;const Ie=W[D]||ot.attributeCheck instanceof Function&&ot.attributeCheck(D,g);if(!(it&&!ft[D]&&at(fe,D))){if(!(an&&at(O,D))){if(!Ie||ft[D]){if(!(Ee(g)&&(ye.tagNameCheck instanceof RegExp&&at(ye.tagNameCheck,g)||ye.tagNameCheck instanceof Function&&ye.tagNameCheck(g))&&(ye.attributeNameCheck instanceof RegExp&&at(ye.attributeNameCheck,D)||ye.attributeNameCheck instanceof Function&&ye.attributeNameCheck(D,g))||D==="is"&&ye.allowCustomizedBuiltInElements&&(ye.tagNameCheck instanceof RegExp&&at(ye.tagNameCheck,X)||ye.tagNameCheck instanceof Function&&ye.tagNameCheck(X))))return!1}else if(!ho[D]){if(!at(z,Gn(X,se,""))){if(!((D==="src"||D==="xlink:href"||D==="href")&&g!=="script"&&Dl(X,"data:")===0&&ni[g])){if(!(sn&&!at(L,Gn(X,se,"")))){if(X)return!1}}}}}}return!0},Ve=Se({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Ee=function(g){return!Ve[mo(g)]&&at(ke,g)},si=function(g){_t(h.beforeSanitizeAttributes,g,null);const D=g.attributes;if(!D||Jn(g))return;const X={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:W,forceKeepAttr:void 0};let Ie=D.length;for(;Ie--;){const Ne=D[Ie],$e=Ne.name,Ze=Ne.namespaceURI,St=Ne.value,pt=je($e),wo=St;let Je=$e==="value"?wo:$m(wo);if(X.attrName=pt,X.attrValue=Je,X.keepAttr=!0,X.forceKeepAttr=void 0,_t(h.uponSanitizeAttribute,g,X),Je=X.attrValue,le&&(pt==="id"||pt==="name")&&Dl(Je,xe)!==0&&(en($e,g),Je=xe+Je),mt&&at(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Je)){en($e,g);continue}if(pt==="attributename"&&Ol(Je,"href")){en($e,g);continue}if(X.forceKeepAttr)continue;if(!X.keepAttr){en($e,g);continue}if(!Pt&&at(/\/>/i,Je)){en($e,g);continue}me&&_n([$,G,oe],No=>{Je=Gn(Je,No," ")});const En=je(g.nodeName);if(!Kt(En,pt,Je)){en($e,g);continue}if(j&&typeof C=="object"&&typeof C.getAttributeType=="function"&&!Ze)switch(C.getAttributeType(En,pt)){case"TrustedHTML":{Je=re(Je);break}case"TrustedScriptURL":{Je=j.createScriptURL(Je);break}}if(Je!==wo)try{Ze?g.setAttributeNS(Ze,$e,Je):g.setAttribute($e,Je),Jn(g)?At(g):Ll(o.removed)}catch{en($e,g)}}_t(h.afterSanitizeAttributes,g,null)},Nt=function(g){let D=null;const X=Zn(g);for(_t(h.beforeSanitizeShadowDOM,g,null);D=X.nextNode();)if(_t(h.uponSanitizeShadowNode,D,null),eo(D),si(D),xn(D.content)&&Nt(D.content),(m?m(D):D.nodeType)===Qt.element){const Ne=y?y(D):D.shadowRoot;xn(Ne)&&(tn(Ne),Nt(Ne))}_t(h.afterSanitizeShadowDOM,g,null)},tn=function(g){const D=m?m(g):g.nodeType;if(D===Qt.element){const Ne=y?y(g):g.shadowRoot;xn(Ne)&&(tn(Ne),Nt(Ne))}const X=I?I(g):g.childNodes;if(!X)return;const Ie=[];_n(X,Ne=>{Wn(Ie,Ne)});for(const Ne of Ie)tn(Ne);if(D===Qt.element){const Ne=P?P(g):null;if(typeof Ne=="string"&&je(Ne)==="template"){const $e=g.content;xn($e)&&tn($e)}}};return o.sanitize=function(M){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},D=null,X=null,Ie=null,Ne=null;if(go=!M,go&&(M="<!-->"),typeof M!="string"&&!Qn(M)&&(M=Wm(M),typeof M!="string"))throw jn("dirty is not a string, aborting");if(!o.isSupported)return M;if(ze||Xn(g),o.removed=[],typeof M=="string"&&(Ge=!1),Ge){const St=P?P(M):M.nodeName;if(typeof St=="string"){const pt=je(St);if(!S[pt]||nt[pt])throw jn("root node is forbidden and cannot be sanitized in-place")}if(Jn(M))throw jn("root node is clobbered and cannot be sanitized in-place");tn(M)}else if(Qn(M))D=Eo("<!---->"),X=D.ownerDocument.importNode(M,!0),X.nodeType===Qt.element&&X.nodeName==="BODY"||X.nodeName==="HTML"?D=X:D.appendChild(X),tn(X);else{if(!rt&&!me&&!De&&M.indexOf("<")===-1)return j&&wt?re(M):M;if(D=Eo(M),!D)return rt?null:wt?Y:""}D&&Ft&&At(D.firstChild);const $e=Zn(Ge?M:D);for(;Ie=$e.nextNode();)eo(Ie),si(Ie),xn(Ie.content)&&Nt(Ie.content);if(Ge)return me&&zn(M),M;if(rt){if(me&&zn(D),Ct)for(Ne=ee.call(D.ownerDocument);D.firstChild;)Ne.appendChild(D.firstChild);else Ne=D;return(W.shadowroot||W.shadowrootmode)&&(Ne=ue.call(r,Ne,!0)),Ne}let Ze=De?D.outerHTML:D.innerHTML;return De&&S["!doctype"]&&D.ownerDocument&&D.ownerDocument.doctype&&D.ownerDocument.doctype.name&&at(tp,D.ownerDocument.doctype.name)&&(Ze="<!DOCTYPE "+D.ownerDocument.doctype.name+`>
129
- `+Ze),me&&_n([$,G,oe],St=>{Ze=Gn(Ze,St," ")}),j&&wt?re(Ze):Ze},o.setConfig=function(){let M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Xn(M),ze=!0},o.clearConfig=function(){kn=null,ze=!1},o.isValidAttribute=function(M,g,D){kn||Xn({});const X=je(M),Ie=je(g);return Kt(X,Ie,D)},o.addHook=function(M,g){typeof g=="function"&&Wn(h[M],g)},o.removeHook=function(M,g){if(g!==void 0){const D=Dm(h[M],g);return D===-1?void 0:Vm(h[M],D,1)[0]}return Ll(h[M])},o.removeHooks=function(M){h[M]=[]},o.removeAllHooks=function(){h=Gl()},o}var rp=jl();const lp=new Rl({gfm:!0,breaks:!0,pedantic:!1,renderer:(()=>{const t=new uo;return t.code=({text:o,lang:n})=>{const r=(n??"").toLowerCase(),a=_i(o,r);return`<pre><code${r?` class="language-${r}"`:""}>${a}</code></pre>`},t})()}),ap=["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"],sp=["href","title","target","rel","src","alt","class","checked","type","disabled"],cp=/^(?:(?:https?|mailto|tel|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i;function dp(t){if(!t)return"";const o=lp.parse(t,{async:!1});return rp.sanitize(o,{ALLOWED_TAGS:ap,ALLOWED_ATTR:sp,ALLOWED_URI_REGEXP:cp})}const up={class:"zm-note-panel"},fp={key:0,class:"zm-note-empty"},mp={class:"zm-note-header"},pp={class:"zm-note-title-row"},hp={class:"zm-note-name"},gp={class:"zm-note-meta"},bp={class:"zm-note-scroll"},kp={class:"zm-note-section"},yp={class:"zm-note-section-head"},xp={class:"zm-note-split"},Ep=["disabled"],wp={key:0,class:"zm-note-preview"},Np=["innerHTML"],Sp={key:1,class:"zm-note-preview-hint"},Tp={key:0,class:"zm-note-section-actions"},Cp={key:0,class:"zm-note-add-row"},Mp={key:1,class:"zm-note-section"},Ap=["disabled"],_p=["href","title"],Rp={key:2,class:"zm-note-section"},Bp=["disabled"],vp=["src","alt"],zp={key:3,class:"zm-note-section"},Ip={class:"zm-note-section-head"},Lp={key:0,class:"zm-note-section-tag"},Op=["disabled"],Dp={key:0,class:"zm-note-code"},Vp=["innerHTML"],$p={key:4,class:"zm-note-section"},Pp=["disabled"],Fp={key:0,class:"zm-note-table"},Qo=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,a=e.ref(""),c=e.ref(null);xi(c,{minRows:4,maxRows:10});const s=e.computed(()=>!a.value||a.value.trim()===""),u=e.computed(()=>dp(a.value)),d=e.ref(!0);function p(){d.value=!d.value}e.watch(()=>{var O,L,se;return[(O=n.selectedNode)==null?void 0:O.id,(se=(L=n.selectedNode)==null?void 0:L.note)==null?void 0:se.text]},()=>{var O,L;a.value=((L=(O=n.selectedNode)==null?void 0:O.note)==null?void 0:L.text)??""},{immediate:!0}),e.watch(()=>n.focusTick,async()=>{if(n.readonly)return;await e.nextTick();const O=document.querySelector(".zm-note-panel textarea.zm-note-textarea");if(O){O.focus();const L=O.value.length;O.setSelectionRange(L,L)}});function b(){var se,ke;if(n.readonly)return;const O=a.value,L=((ke=(se=n.selectedNode)==null?void 0:se.note)==null?void 0:ke.text)??"";O!==L&&r("apply",O)}function C(O){var L,se;n.readonly||(O.key==="Escape"?(O.preventDefault(),a.value=((se=(L=n.selectedNode)==null?void 0:L.note)==null?void 0:se.text)??"",O.target.blur()):O.key==="Enter"&&(O.ctrlKey||O.metaKey)&&(O.preventDefault(),b(),O.target.blur()))}function w(){n.readonly||confirm("移除该节点的笔记?")&&(a.value="",r("remove"))}const V=e.computed(()=>{var O,L;return!!((L=(O=n.selectedNode)==null?void 0:O.link)!=null&&L.url)}),R=e.computed(()=>{var O,L;return!!((L=(O=n.selectedNode)==null?void 0:O.image)!=null&&L.src)}),U=e.computed(()=>{var O,L;return(L=(O=n.selectedNode)==null?void 0:O.richContent)==null?void 0:L.kind}),I=e.computed(()=>U.value==="code"),_=e.computed(()=>U.value==="table"),y=e.ref(!1),k=e.ref(!1),m=e.ref(!1),P=e.ref(!1);e.watch(()=>{var O;return(O=n.selectedNode)==null?void 0:O.id},()=>{y.value=!1,k.value=!1,m.value=!1,P.value=!1});const j=e.ref("");e.watch(()=>{var O,L,se;return[(O=n.selectedNode)==null?void 0:O.id,(se=(L=n.selectedNode)==null?void 0:L.link)==null?void 0:se.url]},()=>{var O,L;j.value=((L=(O=n.selectedNode)==null?void 0:O.link)==null?void 0:L.url)??""},{immediate:!0});function Y(){var se,ke;if(n.readonly)return;const O=j.value.trim(),L=((ke=(se=n.selectedNode)==null?void 0:se.link)==null?void 0:ke.url)??"";O!==L&&r("set-link",O)}const x=e.ref("");e.watch(()=>{var O,L,se;return[(O=n.selectedNode)==null?void 0:O.id,(se=(L=n.selectedNode)==null?void 0:L.image)==null?void 0:se.src]},()=>{var O,L;x.value=((L=(O=n.selectedNode)==null?void 0:O.image)==null?void 0:L.src)??""},{immediate:!0});function re(){var se,ke;if(n.readonly)return;const O=x.value.trim(),L=((ke=(se=n.selectedNode)==null?void 0:se.image)==null?void 0:ke.src)??"";O!==L&&r("set-image",O)}function pe(O){const L=O.target;L.style.display="none"}function de(O){const L=O.target;L.style.display=""}const we=e.ref(""),ee=e.ref(null);xi(ee,{minRows:4,maxRows:18}),e.watch(()=>{var O,L,se;return[(O=n.selectedNode)==null?void 0:O.id,(se=(L=n.selectedNode)==null?void 0:L.richContent)==null?void 0:se.raw]},()=>{var O,L;we.value=((L=(O=n.selectedNode)==null?void 0:O.richContent)==null?void 0:L.raw)??""},{immediate:!0});const ce=e.computed(()=>_i(jo(we.value),Tn(we.value)));function ue(){var ke,z;if(n.readonly)return;const O=we.value,L=((z=(ke=n.selectedNode)==null?void 0:ke.richContent)==null?void 0:z.raw)??"";if(O===L)return;const se=Tn(O)||void 0;r("set-rich",O?{kind:"code",raw:O,lang:se}:null)}const h=e.ref(""),$=e.ref(null);xi($,{minRows:4,maxRows:14}),e.watch(()=>{var O,L,se;return[(O=n.selectedNode)==null?void 0:O.id,(se=(L=n.selectedNode)==null?void 0:L.richContent)==null?void 0:se.raw]},()=>{var O,L;h.value=((L=(O=n.selectedNode)==null?void 0:O.richContent)==null?void 0:L.raw)??""},{immediate:!0});function G(){var se,ke;if(n.readonly)return;const O=h.value,L=((ke=(se=n.selectedNode)==null?void 0:se.richContent)==null?void 0:ke.raw)??"";O!==L&&r("set-rich",O?{kind:"table",raw:O}:null)}const oe=e.computed(()=>Ri(h.value)),fe=e.computed(()=>{const O=[];return s.value||O.push(`${a.value.length} 字`),V.value&&O.push("1 链接"),R.value&&O.push("1 图片"),I.value&&O.push("代码块"),_.value&&O.push("表格"),O.length===0?"节点没有额外内容":O.join(" · ")});return(O,L)=>{var se,ke,z,S;return e.openBlock(),e.createElementBlock("div",up,[t.selectedNode?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",mp,[e.createElementVNode("div",pp,[L[12]||(L[12]=e.createElementVNode("span",{class:"zm-note-label"},"节点",-1)),e.createElementVNode("span",hp,e.toDisplayString(t.selectedNode.text||"(无标题)"),1)]),e.createElementVNode("div",gp,e.toDisplayString(fe.value),1)]),e.createElementVNode("div",bp,[e.createElementVNode("section",kp,[e.createElementVNode("header",yp,[L[13]||(L[13]=e.createElementVNode("span",{class:"zm-note-section-title"},"笔记",-1)),L[14]||(L[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:p},e.toDisplayString(d.value?"隐藏预览":"显示预览"),1))]),e.createElementVNode("div",xp,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"noteRef",ref:c,"onUpdate:modelValue":L[0]||(L[0]=F=>a.value=F),class:"zm-note-textarea",placeholder:"写点什么吧… 支持 Markdown",spellcheck:"false",disabled:t.readonly,onBlur:b,onKeydown:C},null,40,Ep),[[e.vModelText,a.value]]),d.value?(e.openBlock(),e.createElementBlock("div",wp,[s.value?(e.openBlock(),e.createElementBlock("div",Sp," 渲染后的 Markdown 仅在此面板显示,不会撑大节点框。 ")):(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-note-preview-body",innerHTML:u.value},null,8,Np))])):e.createCommentVNode("",!0)]),!t.readonly&&!s.value?(e.openBlock(),e.createElementBlock("div",Tp,[e.createElementVNode("button",{class:"zm-note-action-btn is-danger",onClick:w},"移除笔记")])):e.createCommentVNode("",!0)]),t.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Cp,[!V.value&&!y.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-note-add-chip",onClick:L[1]||(L[1]=F=>y.value=!0)},"+ 链接")):e.createCommentVNode("",!0),!R.value&&!k.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-note-add-chip",onClick:L[2]||(L[2]=F=>k.value=!0)},"+ 图片")):e.createCommentVNode("",!0),!I.value&&!m.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-note-add-chip",onClick:L[3]||(L[3]=F=>m.value=!0)},"+ 代码块")):e.createCommentVNode("",!0),!_.value&&!P.value?(e.openBlock(),e.createElementBlock("button",{key:3,class:"zm-note-add-chip",onClick:L[4]||(L[4]=F=>P.value=!0)},"+ 表格")):e.createCommentVNode("",!0)])),V.value||y.value?(e.openBlock(),e.createElementBlock("section",Mp,[L[15]||(L[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":L[5]||(L[5]=F=>j.value=F),class:"zm-note-input",type:"url",placeholder:"https://…",disabled:t.readonly,onBlur:Y,onKeydown:L[6]||(L[6]=e.withKeys(e.withModifiers(F=>F.target.blur(),["prevent"]),["enter"]))},null,40,Ap),[[e.vModelText,j.value]]),V.value?(e.openBlock(),e.createElementBlock("a",{key:0,class:"zm-note-link-chip",href:(se=t.selectedNode.link)==null?void 0:se.url,target:"_blank",rel:"noopener noreferrer",title:(ke=t.selectedNode.link)==null?void 0:ke.url},e.toDisplayString((z=t.selectedNode.link)==null?void 0:z.url),9,_p)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),R.value||k.value?(e.openBlock(),e.createElementBlock("section",Rp,[L[16]||(L[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":L[7]||(L[7]=F=>x.value=F),class:"zm-note-input",type:"url",placeholder:"data:image/… 或 https://…",disabled:t.readonly,onBlur:re,onKeydown:L[8]||(L[8]=e.withKeys(e.withModifiers(F=>F.target.blur(),["prevent"]),["enter"]))},null,40,Bp),[[e.vModelText,x.value]]),R.value?(e.openBlock(),e.createElementBlock("img",{key:0,class:"zm-note-image",src:(S=t.selectedNode.image)==null?void 0:S.src,alt:t.selectedNode.text,onError:pe,onLoad:de},null,40,vp)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),I.value||m.value?(e.openBlock(),e.createElementBlock("section",zp,[e.createElementVNode("header",Ip,[L[17]||(L[17]=e.createElementVNode("span",{class:"zm-note-section-title"},"代码块",-1)),e.unref(Tn)(we.value)?(e.openBlock(),e.createElementBlock("span",Lp,e.toDisplayString(e.unref(Tn)(we.value)),1)):e.createCommentVNode("",!0)]),e.withDirectives(e.createElementVNode("textarea",{ref_key:"codeRef",ref:ee,"onUpdate:modelValue":L[9]||(L[9]=F=>we.value=F),class:"zm-note-input zm-note-input-code",placeholder:"```ts\nconsole.log(123)\n```",spellcheck:"false",disabled:t.readonly,onBlur:ue},null,40,Op),[[e.vModelText,we.value]]),we.value.trim()?(e.openBlock(),e.createElementBlock("pre",Dp,[e.createElementVNode("code",{innerHTML:ce.value},null,8,Vp)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),_.value||P.value?(e.openBlock(),e.createElementBlock("section",$p,[L[18]||(L[18]=e.createElementVNode("header",{class:"zm-note-section-head"},[e.createElementVNode("span",{class:"zm-note-section-title"},"表格")],-1)),e.withDirectives(e.createElementVNode("textarea",{ref_key:"tableRef",ref:$,"onUpdate:modelValue":L[10]||(L[10]=F=>h.value=F),class:"zm-note-input zm-note-input-code",placeholder:`| 列1 | 列2 |
126
+ `}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>${Qt(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),a=Dl(t);if(a===null)return r;t=a;let c='<a href="'+t+'"';return o&&(c+=' title="'+Qt(o)+'"'),c+=">"+r+"</a>",c}image({href:t,title:o,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let a=Dl(t);if(a===null)return Qt(n);t=a;let c=`<img src="${t}" alt="${Qt(n)}"`;return o&&(c+=` title="${Qt(o)}"`),c+=">",c}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Qt(t.text)}},Yi=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}},qt=class kr{constructor(o){He(this,"options");He(this,"renderer");He(this,"textRenderer");this.options=o||vn,this.options.renderer=this.options.renderer||new go,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Yi}static parse(o,n){return new kr(n).parse(o)}static parseInline(o,n){return new kr(n).parseInline(o)}parse(o){var r,a;this.renderer.parser=this;let n="";for(let c=0;c<o.length;c++){let s=o[c];if((a=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&a[s.type]){let d=s,h=this.options.extensions.renderers[d.type].call({parser:this},d);if(h!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(d.type)){n+=h||"";continue}}let m=s;switch(m.type){case"space":{n+=this.renderer.space(m);break}case"hr":{n+=this.renderer.hr(m);break}case"heading":{n+=this.renderer.heading(m);break}case"code":{n+=this.renderer.code(m);break}case"table":{n+=this.renderer.table(m);break}case"blockquote":{n+=this.renderer.blockquote(m);break}case"list":{n+=this.renderer.list(m);break}case"checkbox":{n+=this.renderer.checkbox(m);break}case"html":{n+=this.renderer.html(m);break}case"def":{n+=this.renderer.def(m);break}case"paragraph":{n+=this.renderer.paragraph(m);break}case"text":{n+=this.renderer.text(m);break}default:{let d='Token with "'+m.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 a,c;this.renderer.parser=this;let r="";for(let s=0;s<o.length;s++){let m=o[s];if((c=(a=this.options.extensions)==null?void 0:a.renderers)!=null&&c[m.type]){let h=this.options.extensions.renderers[m.type].call({parser:this},m);if(h!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(m.type)){r+=h||"";continue}}let d=m;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 h='Token with "'+d.type+'" type was not found.';if(this.options.silent)return console.error(h),"";throw new Error(h)}}}return r}},bo=(ci=class{constructor(t){He(this,"options");He(this,"block");this.options=t||vn}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?Yt.lex:Yt.lexInline}provideParser(t=this.block){return t?qt.parse:qt.parseInline}},He(ci,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),He(ci,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),ci),Ul=class{constructor(...t){He(this,"defaults",$i());He(this,"options",this.setOptions);He(this,"parse",this.parseMarkdown(!0));He(this,"parseInline",this.parseMarkdown(!1));He(this,"Parser",qt);He(this,"Renderer",go);He(this,"TextRenderer",Yi);He(this,"Lexer",Yt);He(this,"Tokenizer",ri);He(this,"Hooks",bo);this.use(...t)}walkTokens(t,o){var r,a;let n=[];for(let c of t)switch(n=n.concat(o.call(this,c)),c.type){case"table":{let s=c;for(let m of s.header)n=n.concat(this.walkTokens(m.tokens,o));for(let m of s.rows)for(let d of m)n=n.concat(this.walkTokens(d.tokens,o));break}case"list":{let s=c;n=n.concat(this.walkTokens(s.items,o));break}default:{let s=c;(a=(r=this.defaults.extensions)==null?void 0:r.childTokens)!=null&&a[s.type]?this.defaults.extensions.childTokens[s.type].forEach(m=>{let d=s[m].flat(1/0);n=n.concat(this.walkTokens(d,o))}):s.tokens&&(n=n.concat(this.walkTokens(s.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(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){let c=o.renderers[a.name];c?o.renderers[a.name]=function(...s){let m=a.renderer.apply(this,s);return m===!1&&(m=c.apply(this,s)),m}:o.renderers[a.name]=a.renderer}if("tokenizer"in a){if(!a.level||a.level!=="block"&&a.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let c=o[a.level];c?c.unshift(a.tokenizer):o[a.level]=[a.tokenizer],a.start&&(a.level==="block"?o.startBlock?o.startBlock.push(a.start):o.startBlock=[a.start]:a.level==="inline"&&(o.startInline?o.startInline.push(a.start):o.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(o.childTokens[a.name]=a.childTokens)}),r.extensions=o),n.renderer){let a=this.defaults.renderer||new go(this.defaults);for(let c in n.renderer){if(!(c in a))throw new Error(`renderer '${c}' does not exist`);if(["options","parser"].includes(c))continue;let s=c,m=n.renderer[s],d=a[s];a[s]=(...h)=>{let b=m.apply(a,h);return b===!1&&(b=d.apply(a,h)),b||""}}r.renderer=a}if(n.tokenizer){let a=this.defaults.tokenizer||new ri(this.defaults);for(let c in n.tokenizer){if(!(c in a))throw new Error(`tokenizer '${c}' does not exist`);if(["options","rules","lexer"].includes(c))continue;let s=c,m=n.tokenizer[s],d=a[s];a[s]=(...h)=>{let b=m.apply(a,h);return b===!1&&(b=d.apply(a,h)),b}}r.tokenizer=a}if(n.hooks){let a=this.defaults.hooks||new bo;for(let c in n.hooks){if(!(c in a))throw new Error(`hook '${c}' does not exist`);if(["options","block"].includes(c))continue;let s=c,m=n.hooks[s],d=a[s];bo.passThroughHooks.has(c)?a[s]=h=>{if(this.defaults.async&&bo.passThroughHooksRespectAsync.has(c))return(async()=>{let A=await m.call(a,h);return d.call(a,A)})();let b=m.call(a,h);return d.call(a,b)}:a[s]=(...h)=>{if(this.defaults.async)return(async()=>{let A=await m.apply(a,h);return A===!1&&(A=await d.apply(a,h)),A})();let b=m.apply(a,h);return b===!1&&(b=d.apply(a,h)),b}}r.hooks=a}if(n.walkTokens){let a=this.defaults.walkTokens,c=n.walkTokens;r.walkTokens=function(s){let m=[];return m.push(c.call(this,s)),a&&(m=m.concat(a.call(this,s))),m}}this.defaults={...this.defaults,...r}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,o){return Yt.lex(t,o??this.defaults)}parser(t,o){return qt.parse(t,o??this.defaults)}parseMarkdown(t){return(o,n)=>{let r={...n},a={...this.defaults,...r},c=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&r.async===!1)return c(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 c(new Error("marked(): input parameter is undefined or null"));if(typeof o!="string")return c(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(o)+", string expected"));if(a.hooks&&(a.hooks.options=a,a.hooks.block=t),a.async)return(async()=>{let s=a.hooks?await a.hooks.preprocess(o):o,m=await(a.hooks?await a.hooks.provideLexer(t):t?Yt.lex:Yt.lexInline)(s,a),d=a.hooks?await a.hooks.processAllTokens(m):m;a.walkTokens&&await Promise.all(this.walkTokens(d,a.walkTokens));let h=await(a.hooks?await a.hooks.provideParser(t):t?qt.parse:qt.parseInline)(d,a);return a.hooks?await a.hooks.postprocess(h):h})().catch(c);try{a.hooks&&(o=a.hooks.preprocess(o));let s=(a.hooks?a.hooks.provideLexer(t):t?Yt.lex:Yt.lexInline)(o,a);a.hooks&&(s=a.hooks.processAllTokens(s)),a.walkTokens&&this.walkTokens(s,a.walkTokens);let m=(a.hooks?a.hooks.provideParser(t):t?qt.parse:qt.parseInline)(s,a);return a.hooks&&(m=a.hooks.postprocess(m)),m}catch(s){return c(s)}}}onError(t,o){return n=>{if(n.message+=`
127
+ Please report this to https://github.com/markedjs/marked.`,t){let r="<p>An error occurred:</p><pre>"+Qt(n.message+"",!0)+"</pre>";return o?Promise.resolve(r):r}if(o)return Promise.reject(n);throw n}}},Bn=new Ul;function Fe(t,o){return Bn.parse(t,o)}Fe.options=Fe.setOptions=function(t){return Bn.setOptions(t),Fe.defaults=Bn.defaults,Cl(Fe.defaults),Fe},Fe.getDefaults=$i,Fe.defaults=vn,Fe.use=function(...t){return Bn.use(...t),Fe.defaults=Bn.defaults,Cl(Fe.defaults),Fe},Fe.walkTokens=function(t,o){return Bn.walkTokens(t,o)},Fe.parseInline=Bn.parseInline,Fe.Parser=qt,Fe.parser=qt.parse,Fe.Renderer=go,Fe.TextRenderer=Yi,Fe.Lexer=Yt,Fe.lexer=Yt.lex,Fe.Tokenizer=ri,Fe.Hooks=bo,Fe.parse=Fe,Fe.options,Fe.setOptions,Fe.use,Fe.walkTokens,Fe.parseInline,qt.parse,Yt.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 lp(t){if(Array.isArray(t))return t}function ap(t,o){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,a,c,s,m=[],d=!0,h=!1;try{if(c=(n=n.call(t)).next,o!==0)for(;!(d=(r=c.call(n)).done)&&(m.push(r.value),m.length!==o);d=!0);}catch(b){h=!0,a=b}finally{try{if(!d&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(h)throw a}}return m}}function sp(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
128
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function cp(t,o){return lp(t)||ap(t,o)||dp(t,o)||sp()}function dp(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 Wl=Object.entries,Gl=Object.setPrototypeOf,up=Object.isFrozen,fp=Object.getPrototypeOf,mp=Object.getOwnPropertyDescriptor;let Et=Object.freeze,Pt=Object.seal,qn=Object.create,jl=typeof Reflect<"u"&&Reflect,qi=jl.apply,Xi=jl.construct;Et||(Et=function(o){return o}),Pt||(Pt=function(o){return o}),qi||(qi=function(o,n){for(var r=arguments.length,a=new Array(r>2?r-2:0),c=2;c<r;c++)a[c-2]=arguments[c];return o.apply(n,a)}),Xi||(Xi=function(o){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];return new o(...r)});const zn=Qe(Array.prototype.forEach),pp=Qe(Array.prototype.lastIndexOf),Kl=Qe(Array.prototype.pop),Xn=Qe(Array.prototype.push),hp=Qe(Array.prototype.splice),wt=Array.isArray,ko=Qe(String.prototype.toLowerCase),Zi=Qe(String.prototype.toString),Yl=Qe(String.prototype.match),Zn=Qe(String.prototype.replace),ql=Qe(String.prototype.indexOf),gp=Qe(String.prototype.trim),bp=Qe(Number.prototype.toString),kp=Qe(Boolean.prototype.toString),Xl=typeof BigInt>"u"?null:Qe(BigInt.prototype.toString),Zl=typeof Symbol>"u"?null:Qe(Symbol.prototype.toString),Ke=Qe(Object.prototype.hasOwnProperty),yo=Qe(Object.prototype.toString),st=Qe(RegExp.prototype.test),Jn=yp(TypeError);function Qe(t){return function(o){o instanceof RegExp&&(o.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];return qi(t,o,r)}}function yp(t){return function(){for(var o=arguments.length,n=new Array(o),r=0;r<o;r++)n[r]=arguments[r];return Xi(t,n)}}function Ne(t,o){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ko;if(Gl&&Gl(t,null),!wt(o))return t;let r=o.length;for(;r--;){let a=o[r];if(typeof a=="string"){const c=n(a);c!==a&&(up(o)||(o[r]=c),a=c)}t[a]=!0}return t}function xp(t){for(let o=0;o<t.length;o++)Ke(t,o)||(t[o]=null);return t}function ft(t){const o=qn(null);for(const r of Wl(t)){var n=cp(r,2);const a=n[0],c=n[1];Ke(t,a)&&(wt(c)?o[a]=xp(c):c&&typeof c=="object"&&c.constructor===Object?o[a]=ft(c):o[a]=c)}return o}function Ep(t){switch(typeof t){case"string":return t;case"number":return bp(t);case"boolean":return kp(t);case"bigint":return Xl?Xl(t):"0";case"symbol":return Zl?Zl(t):"Symbol()";case"undefined":return yo(t);case"function":case"object":{if(t===null)return yo(t);const o=t,n=en(o,"toString");if(typeof n=="function"){const r=n(o);return typeof r=="string"?r:yo(r)}return yo(t)}default:return yo(t)}}function en(t,o){for(;t!==null;){const r=mp(t,o);if(r){if(r.get)return Qe(r.get);if(typeof r.value=="function")return Qe(r.value)}t=fp(t)}function n(){return null}return n}function wp(t){try{return st(t,""),!0}catch{return!1}}const Jl=Et(["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"]),Ji=Et(["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"]),Qi=Et(["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"]),Np=Et(["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"]),er=Et(["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"]),Sp=Et(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Ql=Et(["#text"]),ea=Et(["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"]),tr=Et(["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"]),ta=Et(["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"]),li=Et(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Cp=Pt(/{{[\w\W]*|^[\w\W]*}}/g),Tp=Pt(/<%[\w\W]*|^[\w\W]*%>/g),Mp=Pt(/\${[\w\W]*/g),Ap=Pt(/^data-[\-\w.\u00B7-\uFFFF]+$/),_p=Pt(/^aria-[\-\w]+$/),na=Pt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),vp=Pt(/^(?:\w+script|data):/i),Rp=Pt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Bp=Pt(/^html$/i),zp=Pt(/^[a-z][.\w]*(-[.\w]+)+$/i),tn={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Ip=function(){return typeof window>"u"?null:window},Lp=function(o,n){if(typeof o!="object"||typeof o.createPolicy!="function")return null;let r=null;const a="data-tt-policy-suffix";n&&n.hasAttribute(a)&&(r=n.getAttribute(a));const c="dompurify"+(r?"#"+r:"");try{return o.createPolicy(c,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+c+" could not be created."),null}},oa=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function ia(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ip();const o=oe=>ia(oe);if(o.version="3.4.8",o.removed=[],!t||!t.document||t.document.nodeType!==tn.document||!t.Element)return o.isSupported=!1,o;let n=t.document;const r=n,a=r.currentScript;t.DocumentFragment;const c=t.HTMLTemplateElement,s=t.Node,m=t.Element,d=t.NodeFilter,h=t.NamedNodeMap;h===void 0&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const b=t.DOMParser,A=t.trustedTypes,C=m.prototype,$=en(C,"cloneNode"),R=en(C,"remove"),U=en(C,"nextSibling"),I=en(C,"childNodes"),v=en(C,"parentNode"),w=en(C,"shadowRoot"),y=en(C,"attributes"),p=s&&s.prototype?en(s.prototype,"nodeType"):null,P=s&&s.prototype?en(s.prototype,"nodeName"):null;if(typeof c=="function"){const oe=n.createElement("template");oe.content&&oe.content.ownerDocument&&(n=oe.content.ownerDocument)}let Y,q="",N=0;const ae=function(f){if(N>0)throw Jn('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.');N++;try{return Y.createHTML(f)}finally{N--}},ge=n,ue=ge.implementation,we=ge.createNodeIterator,te=ge.createDocumentFragment,de=ge.getElementsByTagName,fe=r.importNode;let g=oa();o.isSupported=typeof Wl=="function"&&typeof v=="function"&&ue&&ue.createHTMLDocument!==void 0;const V=Cp,G=Tp,le=Mp,me=Ap,O=_p,L=vp,ce=Rp,ke=zp;let z=na,T=null;const F=Ne({},[...Jl,...Ji,...Qi,...er,...Ql]);let H=null;const ne=Ne({},[...ea,...tr,...ta,...li]);let xe=Object.seal(qn(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}})),ot=null,mt=null;const it=Object.seal(qn(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let cn=!0,rt=!0,dn=!1,Ft=!0,pe=!1,pt=!0,$e=!1,De=!1,Ut=!1,lt=!1,Tt=!1,Nt=!1,X=!0,se=!1;const Ee="user-content-";let Be=!0,Ge=!1,at={},Mt=null;const Ln=Ne({},["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 di=null;const ui=Ne({},["audio","video","img","source","image","track"]);let xo=null;const fi=Ne({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),eo="http://www.w3.org/1998/Math/MathML",to="http://www.w3.org/2000/svg",Ht="http://www.w3.org/1999/xhtml";let yn=Ht,Eo=!1,wo=null;const nr=Ne({},[eo,to,Ht],Zi);let No=Ne({},["mi","mo","mn","ms","mtext"]),So=Ne({},["annotation-xml"]);const or=Ne({},["title","style","font","a","script"]);let On=null;const mi=["application/xhtml+xml","text/html"],ir="text/html";let je=null,xn=null;const rr=n.createElement("form"),Co=function(f){return f instanceof RegExp||f instanceof Function},To=function(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(xn&&xn===f)return;(!f||typeof f!="object")&&(f={}),f=ft(f),On=mi.indexOf(f.PARSER_MEDIA_TYPE)===-1?ir:f.PARSER_MEDIA_TYPE,je=On==="application/xhtml+xml"?Zi:ko,T=Ke(f,"ALLOWED_TAGS")&&wt(f.ALLOWED_TAGS)?Ne({},f.ALLOWED_TAGS,je):F,H=Ke(f,"ALLOWED_ATTR")&&wt(f.ALLOWED_ATTR)?Ne({},f.ALLOWED_ATTR,je):ne,wo=Ke(f,"ALLOWED_NAMESPACES")&&wt(f.ALLOWED_NAMESPACES)?Ne({},f.ALLOWED_NAMESPACES,Zi):nr,xo=Ke(f,"ADD_URI_SAFE_ATTR")&&wt(f.ADD_URI_SAFE_ATTR)?Ne(ft(fi),f.ADD_URI_SAFE_ATTR,je):fi,di=Ke(f,"ADD_DATA_URI_TAGS")&&wt(f.ADD_DATA_URI_TAGS)?Ne(ft(ui),f.ADD_DATA_URI_TAGS,je):ui,Mt=Ke(f,"FORBID_CONTENTS")&&wt(f.FORBID_CONTENTS)?Ne({},f.FORBID_CONTENTS,je):Ln,ot=Ke(f,"FORBID_TAGS")&&wt(f.FORBID_TAGS)?Ne({},f.FORBID_TAGS,je):ft({}),mt=Ke(f,"FORBID_ATTR")&&wt(f.FORBID_ATTR)?Ne({},f.FORBID_ATTR,je):ft({}),at=Ke(f,"USE_PROFILES")?f.USE_PROFILES&&typeof f.USE_PROFILES=="object"?ft(f.USE_PROFILES):f.USE_PROFILES:!1,cn=f.ALLOW_ARIA_ATTR!==!1,rt=f.ALLOW_DATA_ATTR!==!1,dn=f.ALLOW_UNKNOWN_PROTOCOLS||!1,Ft=f.ALLOW_SELF_CLOSE_IN_ATTR!==!1,pe=f.SAFE_FOR_TEMPLATES||!1,pt=f.SAFE_FOR_XML!==!1,$e=f.WHOLE_DOCUMENT||!1,lt=f.RETURN_DOM||!1,Tt=f.RETURN_DOM_FRAGMENT||!1,Nt=f.RETURN_TRUSTED_TYPE||!1,Ut=f.FORCE_BODY||!1,X=f.SANITIZE_DOM!==!1,se=f.SANITIZE_NAMED_PROPS||!1,Be=f.KEEP_CONTENT!==!1,Ge=f.IN_PLACE||!1,z=wp(f.ALLOWED_URI_REGEXP)?f.ALLOWED_URI_REGEXP:na,yn=typeof f.NAMESPACE=="string"?f.NAMESPACE:Ht,No=Ke(f,"MATHML_TEXT_INTEGRATION_POINTS")&&f.MATHML_TEXT_INTEGRATION_POINTS&&typeof f.MATHML_TEXT_INTEGRATION_POINTS=="object"?ft(f.MATHML_TEXT_INTEGRATION_POINTS):Ne({},["mi","mo","mn","ms","mtext"]),So=Ke(f,"HTML_INTEGRATION_POINTS")&&f.HTML_INTEGRATION_POINTS&&typeof f.HTML_INTEGRATION_POINTS=="object"?ft(f.HTML_INTEGRATION_POINTS):Ne({},["annotation-xml"]);const D=Ke(f,"CUSTOM_ELEMENT_HANDLING")&&f.CUSTOM_ELEMENT_HANDLING&&typeof f.CUSTOM_ELEMENT_HANDLING=="object"?ft(f.CUSTOM_ELEMENT_HANDLING):qn(null);if(xe=qn(null),Ke(D,"tagNameCheck")&&Co(D.tagNameCheck)&&(xe.tagNameCheck=D.tagNameCheck),Ke(D,"attributeNameCheck")&&Co(D.attributeNameCheck)&&(xe.attributeNameCheck=D.attributeNameCheck),Ke(D,"allowCustomizedBuiltInElements")&&typeof D.allowCustomizedBuiltInElements=="boolean"&&(xe.allowCustomizedBuiltInElements=D.allowCustomizedBuiltInElements),pe&&(rt=!1),Tt&&(lt=!0),at&&(T=Ne({},Ql),H=qn(null),at.html===!0&&(Ne(T,Jl),Ne(H,ea)),at.svg===!0&&(Ne(T,Ji),Ne(H,tr),Ne(H,li)),at.svgFilters===!0&&(Ne(T,Qi),Ne(H,tr),Ne(H,li)),at.mathMl===!0&&(Ne(T,er),Ne(H,ta),Ne(H,li))),it.tagCheck=null,it.attributeCheck=null,Ke(f,"ADD_TAGS")&&(typeof f.ADD_TAGS=="function"?it.tagCheck=f.ADD_TAGS:wt(f.ADD_TAGS)&&(T===F&&(T=ft(T)),Ne(T,f.ADD_TAGS,je))),Ke(f,"ADD_ATTR")&&(typeof f.ADD_ATTR=="function"?it.attributeCheck=f.ADD_ATTR:wt(f.ADD_ATTR)&&(H===ne&&(H=ft(H)),Ne(H,f.ADD_ATTR,je))),Ke(f,"ADD_URI_SAFE_ATTR")&&wt(f.ADD_URI_SAFE_ATTR)&&Ne(xo,f.ADD_URI_SAFE_ATTR,je),Ke(f,"FORBID_CONTENTS")&&wt(f.FORBID_CONTENTS)&&(Mt===Ln&&(Mt=ft(Mt)),Ne(Mt,f.FORBID_CONTENTS,je)),Ke(f,"ADD_FORBID_CONTENTS")&&wt(f.ADD_FORBID_CONTENTS)&&(Mt===Ln&&(Mt=ft(Mt)),Ne(Mt,f.ADD_FORBID_CONTENTS,je)),Be&&(T["#text"]=!0),$e&&Ne(T,["html","head","body"]),T.table&&(Ne(T,["tbody"]),delete ot.tbody),f.TRUSTED_TYPES_POLICY){if(typeof f.TRUSTED_TYPES_POLICY.createHTML!="function")throw Jn('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof f.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Jn('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const Z=Y;Y=f.TRUSTED_TYPES_POLICY;try{q=ae("")}catch(Ie){throw Y=Z,Ie}}else Y===void 0&&f.TRUSTED_TYPES_POLICY!==null&&(Y=Lp(A,a)),Y&&typeof q=="string"&&(q=ae(""));(g.uponSanitizeElement.length>0||g.uponSanitizeAttribute.length>0)&&T===F&&(T=ft(T)),g.uponSanitizeAttribute.length>0&&H===ne&&(H=ft(H)),Et&&Et(f),xn=f},Mo=Ne({},[...Ji,...Qi,...Np]),Ao=Ne({},[...er,...Sp]),Vn=function(f){let D=v(f);(!D||!D.tagName)&&(D={namespaceURI:yn,tagName:"template"});const Z=ko(f.tagName),Ie=ko(D.tagName);return wo[f.namespaceURI]?f.namespaceURI===to?D.namespaceURI===Ht?Z==="svg":D.namespaceURI===eo?Z==="svg"&&(Ie==="annotation-xml"||No[Ie]):!!Mo[Z]:f.namespaceURI===eo?D.namespaceURI===Ht?Z==="math":D.namespaceURI===to?Z==="math"&&So[Ie]:!!Ao[Z]:f.namespaceURI===Ht?D.namespaceURI===to&&!So[Ie]||D.namespaceURI===eo&&!No[Ie]?!1:!Ao[Z]&&(or[Z]||!Mo[Z]):!!(On==="application/xhtml+xml"&&wo[f.namespaceURI]):!1},Rt=function(f){Xn(o.removed,{element:f});try{v(f).removeChild(f)}catch{R(f)}},un=function(f,D){try{Xn(o.removed,{attribute:D.getAttributeNode(f),from:D})}catch{Xn(o.removed,{attribute:null,from:D})}if(D.removeAttribute(f),f==="is")if(lt||Tt)try{Rt(D)}catch{}else try{D.setAttribute(f,"")}catch{}},_o=function(f){let D=null,Z=null;if(Ut)f="<remove></remove>"+f;else{const Pe=Yl(f,/^[\r\n\t ]+/);Z=Pe&&Pe[0]}On==="application/xhtml+xml"&&yn===Ht&&(f='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+f+"</body></html>");const Ie=Y?ae(f):f;if(yn===Ht)try{D=new b().parseFromString(Ie,On)}catch{}if(!D||!D.documentElement){D=ue.createDocument(yn,"template",null);try{D.documentElement.innerHTML=Eo?q:Ie}catch{}}const Se=D.body||D.documentElement;return f&&Z&&Se.insertBefore(n.createTextNode(Z),Se.childNodes[0]||null),yn===Ht?de.call(D,$e?"html":"body")[0]:$e?D.documentElement:Se},vo=function(f){return we.call(f.ownerDocument||f,f,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},Dn=function(f){var D,Z;f.normalize();const Ie=we.call(f.ownerDocument||f,f,d.SHOW_TEXT|d.SHOW_COMMENT|d.SHOW_CDATA_SECTION|d.SHOW_PROCESSING_INSTRUCTION,null);let Se=Ie.nextNode();for(;Se;){let Ye=Se.data;zn([V,G,le],At=>{Ye=Zn(Ye,At," ")}),Se.data=Ye,Se=Ie.nextNode()}const Pe=(D=(Z=f.querySelectorAll)===null||Z===void 0?void 0:Z.call(f,"template"))!==null&&D!==void 0?D:[];zn(Array.from(Pe),Ye=>{wn(Ye.content)&&Dn(Ye.content)})},En=function(f){const D=P?P(f):null;return typeof D!="string"||je(D)!=="form"?!1:typeof f.nodeName!="string"||typeof f.textContent!="string"||typeof f.removeChild!="function"||f.attributes!==y(f)||typeof f.removeAttribute!="function"||typeof f.setAttribute!="function"||typeof f.namespaceURI!="string"||typeof f.insertBefore!="function"||typeof f.hasChildNodes!="function"||f.nodeType!==p(f)||f.childNodes!==I(f)},wn=function(f){if(!p||typeof f!="object"||f===null)return!1;try{return p(f)===tn.documentFragment}catch{return!1}},no=function(f){if(!p||typeof f!="object"||f===null)return!1;try{return typeof p(f)=="number"}catch{return!1}};function Xt(oe,f,D){zn(oe,Z=>{Z.call(o,f,D,xn)})}const oo=function(f){let D=null;if(Xt(g.beforeSanitizeElements,f,null),En(f))return Rt(f),!0;const Z=je(P?P(f):f.nodeName);if(Xt(g.uponSanitizeElement,f,{tagName:Z,allowedTags:T}),pt&&f.hasChildNodes()&&!no(f.firstElementChild)&&st(/<[/\w!]/g,f.innerHTML)&&st(/<[/\w!]/g,f.textContent)||pt&&f.namespaceURI===Ht&&Z==="style"&&no(f.firstElementChild)||f.nodeType===tn.progressingInstruction||pt&&f.nodeType===tn.comment&&st(/<[/\w]/g,f.data))return Rt(f),!0;if(ot[Z]||!(it.tagCheck instanceof Function&&it.tagCheck(Z))&&!T[Z]){if(!ot[Z]&&ze(Z)&&(xe.tagNameCheck instanceof RegExp&&st(xe.tagNameCheck,Z)||xe.tagNameCheck instanceof Function&&xe.tagNameCheck(Z)))return!1;if(Be&&!Mt[Z]){const Se=v(f),Pe=I(f);if(Pe&&Se){const Ye=Pe.length;for(let At=Ye-1;At>=0;--At){const _t=$(Pe[At],!0);Se.insertBefore(_t,U(f))}}}return Rt(f),!0}return(p?p(f):f.nodeType)===tn.element&&!Vn(f)||(Z==="noscript"||Z==="noembed"||Z==="noframes")&&st(/<\/no(script|embed|frames)/i,f.innerHTML)?(Rt(f),!0):(pe&&f.nodeType===tn.text&&(D=f.textContent,zn([V,G,le],Se=>{D=Zn(D,Se," ")}),f.textContent!==D&&(Xn(o.removed,{element:f.cloneNode()}),f.textContent=D)),Xt(g.afterSanitizeElements,f,null),!1)},io=function(f,D,Z){if(mt[D]||X&&(D==="id"||D==="name")&&(Z in n||Z in rr))return!1;const Ie=H[D]||it.attributeCheck instanceof Function&&it.attributeCheck(D,f);if(!(rt&&!mt[D]&&st(me,D))){if(!(cn&&st(O,D))){if(!Ie||mt[D]){if(!(ze(f)&&(xe.tagNameCheck instanceof RegExp&&st(xe.tagNameCheck,f)||xe.tagNameCheck instanceof Function&&xe.tagNameCheck(f))&&(xe.attributeNameCheck instanceof RegExp&&st(xe.attributeNameCheck,D)||xe.attributeNameCheck instanceof Function&&xe.attributeNameCheck(D,f))||D==="is"&&xe.allowCustomizedBuiltInElements&&(xe.tagNameCheck instanceof RegExp&&st(xe.tagNameCheck,Z)||xe.tagNameCheck instanceof Function&&xe.tagNameCheck(Z))))return!1}else if(!xo[D]){if(!st(z,Zn(Z,ce,""))){if(!((D==="src"||D==="xlink:href"||D==="href")&&f!=="script"&&ql(Z,"data:")===0&&di[f])){if(!(dn&&!st(L,Zn(Z,ce,"")))){if(Z)return!1}}}}}}return!0},nn=Ne({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),ze=function(f){return!nn[ko(f)]&&st(ke,f)},ye=function(f){Xt(g.beforeSanitizeAttributes,f,null);const D=f.attributes;if(!D||En(f))return;const Z={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:H,forceKeepAttr:void 0};let Ie=D.length;for(;Ie--;){const Se=D[Ie],Pe=Se.name,Ye=Se.namespaceURI,At=Se.value,_t=je(Pe),Nn=At;let et=Pe==="value"?Nn:gp(Nn);if(Z.attrName=_t,Z.attrValue=et,Z.keepAttr=!0,Z.forceKeepAttr=void 0,Xt(g.uponSanitizeAttribute,f,Z),et=Z.attrValue,se&&(_t==="id"||_t==="name")&&ql(et,Ee)!==0&&(un(Pe,f),et=Ee+et),pt&&st(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,et)){un(Pe,f);continue}if(_t==="attributename"&&Yl(et,"href")){un(Pe,f);continue}if(Z.forceKeepAttr)continue;if(!Z.keepAttr){un(Pe,f);continue}if(!Ft&&st(/\/>/i,et)){un(Pe,f);continue}pe&&zn([V,G,le],Sn=>{et=Zn(et,Sn," ")});const Ro=je(f.nodeName);if(!io(Ro,_t,et)){un(Pe,f);continue}if(Y&&typeof A=="object"&&typeof A.getAttributeType=="function"&&!Ye)switch(A.getAttributeType(Ro,_t)){case"TrustedHTML":{et=ae(et);break}case"TrustedScriptURL":{et=Y.createScriptURL(et);break}}if(et!==Nn)try{Ye?f.setAttributeNS(Ye,Pe,et):f.setAttribute(Pe,et),En(f)?Rt(f):Kl(o.removed)}catch{un(Pe,f)}}Xt(g.afterSanitizeAttributes,f,null)},ro=function(f){let D=null;const Z=vo(f);for(Xt(g.beforeSanitizeShadowDOM,f,null);D=Z.nextNode();)if(Xt(g.uponSanitizeShadowNode,D,null),oo(D),ye(D),wn(D.content)&&ro(D.content),(p?p(D):D.nodeType)===tn.element){const Se=w?w(D):D.shadowRoot;wn(Se)&&(ct(Se),ro(Se))}Xt(g.afterSanitizeShadowDOM,f,null)},ct=function(f){const D=p?p(f):f.nodeType;if(D===tn.element){const Se=w?w(f):f.shadowRoot;wn(Se)&&(ct(Se),ro(Se))}const Z=I?I(f):f.childNodes;if(!Z)return;const Ie=[];zn(Z,Se=>{Xn(Ie,Se)});for(const Se of Ie)ct(Se);if(D===tn.element){const Se=P?P(f):null;if(typeof Se=="string"&&je(Se)==="template"){const Pe=f.content;wn(Pe)&&ct(Pe)}}};return o.sanitize=function(oe){let f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},D=null,Z=null,Ie=null,Se=null;if(Eo=!oe,Eo&&(oe="<!-->"),typeof oe!="string"&&!no(oe)&&(oe=Ep(oe),typeof oe!="string"))throw Jn("dirty is not a string, aborting");if(!o.isSupported)return oe;if(De||To(f),o.removed=[],typeof oe=="string"&&(Ge=!1),Ge){const At=P?P(oe):oe.nodeName;if(typeof At=="string"){const _t=je(At);if(!T[_t]||ot[_t])throw Jn("root node is forbidden and cannot be sanitized in-place")}if(En(oe))throw Jn("root node is clobbered and cannot be sanitized in-place");ct(oe)}else if(no(oe))D=_o("<!---->"),Z=D.ownerDocument.importNode(oe,!0),Z.nodeType===tn.element&&Z.nodeName==="BODY"||Z.nodeName==="HTML"?D=Z:D.appendChild(Z),ct(Z);else{if(!lt&&!pe&&!$e&&oe.indexOf("<")===-1)return Y&&Nt?ae(oe):oe;if(D=_o(oe),!D)return lt?null:Nt?q:""}D&&Ut&&Rt(D.firstChild);const Pe=vo(Ge?oe:D);for(;Ie=Pe.nextNode();)oo(Ie),ye(Ie),wn(Ie.content)&&ro(Ie.content);if(Ge)return pe&&Dn(oe),oe;if(lt){if(pe&&Dn(D),Tt)for(Se=te.call(D.ownerDocument);D.firstChild;)Se.appendChild(D.firstChild);else Se=D;return(H.shadowroot||H.shadowrootmode)&&(Se=fe.call(r,Se,!0)),Se}let Ye=$e?D.outerHTML:D.innerHTML;return $e&&T["!doctype"]&&D.ownerDocument&&D.ownerDocument.doctype&&D.ownerDocument.doctype.name&&st(Bp,D.ownerDocument.doctype.name)&&(Ye="<!DOCTYPE "+D.ownerDocument.doctype.name+`>
129
+ `+Ye),pe&&zn([V,G,le],At=>{Ye=Zn(Ye,At," ")}),Y&&Nt?ae(Ye):Ye},o.setConfig=function(){let oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};To(oe),De=!0},o.clearConfig=function(){xn=null,De=!1},o.isValidAttribute=function(oe,f,D){xn||To({});const Z=je(oe),Ie=je(f);return io(Z,Ie,D)},o.addHook=function(oe,f){typeof f=="function"&&Xn(g[oe],f)},o.removeHook=function(oe,f){if(f!==void 0){const D=pp(g[oe],f);return D===-1?void 0:hp(g[oe],D,1)[0]}return Kl(g[oe])},o.removeHooks=function(oe){g[oe]=[]},o.removeAllHooks=function(){g=oa()},o}var Op=ia();const Vp=new Ul({gfm:!0,breaks:!0,pedantic:!1,renderer:(()=>{const t=new go;return t.code=({text:o,lang:n})=>{const r=(n??"").toLowerCase(),a=Vi(o,r);return`<pre><code${r?` class="language-${r}"`:""}>${a}</code></pre>`},t})()}),Dp=["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"],$p=["href","title","target","rel","src","alt","class","checked","type","disabled"],Pp=/^(?:(?:https?|mailto|tel|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i;function Fp(t){if(!t)return"";const o=Vp.parse(t,{async:!1});return Op.sanitize(o,{ALLOWED_TAGS:Dp,ALLOWED_ATTR:$p,ALLOWED_URI_REGEXP:Pp})}const Up={class:"zm-note-panel"},Hp={key:0,class:"zm-note-empty"},Wp={class:"zm-note-header"},Gp={class:"zm-note-title-row"},jp={class:"zm-note-name"},Kp={class:"zm-note-meta"},Yp={class:"zm-note-scroll"},qp={class:"zm-note-section"},Xp={class:"zm-note-section-head"},Zp={class:"zm-note-split"},Jp=["disabled"],Qp={key:0,class:"zm-note-preview"},eh=["innerHTML"],th={key:1,class:"zm-note-preview-hint"},nh={key:0,class:"zm-note-section-actions"},oh={key:0,class:"zm-note-add-row"},ih={key:1,class:"zm-note-section"},rh=["disabled"],lh=["href","title"],ah={key:2,class:"zm-note-section"},sh=["disabled"],ch=["src","alt"],dh={key:3,class:"zm-note-section"},uh={class:"zm-note-section-head"},fh={key:0,class:"zm-note-section-tag"},mh=["disabled"],ph={key:0,class:"zm-note-code"},hh=["innerHTML"],gh={key:4,class:"zm-note-section"},bh=["disabled"],kh={key:0,class:"zm-note-table"},ai=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,a=e.ref(""),c=e.ref(null);Ai(c,{minRows:4,maxRows:10});const s=e.computed(()=>!a.value||a.value.trim()===""),m=e.computed(()=>Fp(a.value)),d=e.ref(!0);function h(){d.value=!d.value}e.watch(()=>{var O,L,ce;return[(O=n.selectedNode)==null?void 0:O.id,(ce=(L=n.selectedNode)==null?void 0:L.note)==null?void 0:ce.text]},()=>{var O,L;a.value=((L=(O=n.selectedNode)==null?void 0:O.note)==null?void 0:L.text)??""},{immediate:!0}),e.watch(()=>n.focusTick,async()=>{if(n.readonly)return;await e.nextTick();const O=document.querySelector(".zm-note-panel textarea.zm-note-textarea");if(O){O.focus();const L=O.value.length;O.setSelectionRange(L,L)}});function b(){var ce,ke;if(n.readonly)return;const O=a.value,L=((ke=(ce=n.selectedNode)==null?void 0:ce.note)==null?void 0:ke.text)??"";O!==L&&r("apply",O)}function A(O){var L,ce;n.readonly||(O.key==="Escape"?(O.preventDefault(),a.value=((ce=(L=n.selectedNode)==null?void 0:L.note)==null?void 0:ce.text)??"",O.target.blur()):O.key==="Enter"&&(O.ctrlKey||O.metaKey)&&(O.preventDefault(),b(),O.target.blur()))}function C(){n.readonly||confirm("移除该节点的笔记?")&&(a.value="",r("remove"))}const $=e.computed(()=>{var O,L;return!!((L=(O=n.selectedNode)==null?void 0:O.link)!=null&&L.url)}),R=e.computed(()=>{var O,L;return!!((L=(O=n.selectedNode)==null?void 0:O.image)!=null&&L.src)}),U=e.computed(()=>{var O,L;return(L=(O=n.selectedNode)==null?void 0:O.richContent)==null?void 0:L.kind}),I=e.computed(()=>U.value==="code"),v=e.computed(()=>U.value==="table"),w=e.ref(!1),y=e.ref(!1),p=e.ref(!1),P=e.ref(!1);e.watch(()=>{var O;return(O=n.selectedNode)==null?void 0:O.id},()=>{w.value=!1,y.value=!1,p.value=!1,P.value=!1});const Y=e.ref("");e.watch(()=>{var O,L,ce;return[(O=n.selectedNode)==null?void 0:O.id,(ce=(L=n.selectedNode)==null?void 0:L.link)==null?void 0:ce.url]},()=>{var O,L;Y.value=((L=(O=n.selectedNode)==null?void 0:O.link)==null?void 0:L.url)??""},{immediate:!0});function q(){var ce,ke;if(n.readonly)return;const O=Y.value.trim(),L=((ke=(ce=n.selectedNode)==null?void 0:ce.link)==null?void 0:ke.url)??"";O!==L&&r("set-link",O)}const N=e.ref("");e.watch(()=>{var O,L,ce;return[(O=n.selectedNode)==null?void 0:O.id,(ce=(L=n.selectedNode)==null?void 0:L.image)==null?void 0:ce.src]},()=>{var O,L;N.value=((L=(O=n.selectedNode)==null?void 0:O.image)==null?void 0:L.src)??""},{immediate:!0});function ae(){var ce,ke;if(n.readonly)return;const O=N.value.trim(),L=((ke=(ce=n.selectedNode)==null?void 0:ce.image)==null?void 0:ke.src)??"";O!==L&&r("set-image",O)}function ge(O){const L=O.target;L.style.display="none"}function ue(O){const L=O.target;L.style.display=""}const we=e.ref(""),te=e.ref(null);Ai(te,{minRows:4,maxRows:18}),e.watch(()=>{var O,L,ce;return[(O=n.selectedNode)==null?void 0:O.id,(ce=(L=n.selectedNode)==null?void 0:L.richContent)==null?void 0:ce.raw]},()=>{var O,L;we.value=((L=(O=n.selectedNode)==null?void 0:O.richContent)==null?void 0:L.raw)??""},{immediate:!0});const de=e.computed(()=>Vi(ei(we.value),_n(we.value)));function fe(){var ke,z;if(n.readonly)return;const O=we.value,L=((z=(ke=n.selectedNode)==null?void 0:ke.richContent)==null?void 0:z.raw)??"";if(O===L)return;const ce=_n(O)||void 0;r("set-rich",O?{kind:"code",raw:O,lang:ce}:null)}const g=e.ref(""),V=e.ref(null);Ai(V,{minRows:4,maxRows:14}),e.watch(()=>{var O,L,ce;return[(O=n.selectedNode)==null?void 0:O.id,(ce=(L=n.selectedNode)==null?void 0:L.richContent)==null?void 0:ce.raw]},()=>{var O,L;g.value=((L=(O=n.selectedNode)==null?void 0:O.richContent)==null?void 0:L.raw)??""},{immediate:!0});function G(){var ce,ke;if(n.readonly)return;const O=g.value,L=((ke=(ce=n.selectedNode)==null?void 0:ce.richContent)==null?void 0:ke.raw)??"";O!==L&&r("set-rich",O?{kind:"table",raw:O}:null)}const le=e.computed(()=>Di(g.value)),me=e.computed(()=>{const O=[];return s.value||O.push(`${a.value.length} 字`),$.value&&O.push("1 链接"),R.value&&O.push("1 图片"),I.value&&O.push("代码块"),v.value&&O.push("表格"),O.length===0?"节点没有额外内容":O.join(" · ")});return(O,L)=>{var ce,ke,z,T;return e.openBlock(),e.createElementBlock("div",Up,[t.selectedNode?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",Wp,[e.createElementVNode("div",Gp,[L[12]||(L[12]=e.createElementVNode("span",{class:"zm-note-label"},"节点",-1)),e.createElementVNode("span",jp,e.toDisplayString(t.selectedNode.text||"(无标题)"),1)]),e.createElementVNode("div",Kp,e.toDisplayString(me.value),1)]),e.createElementVNode("div",Yp,[e.createElementVNode("section",qp,[e.createElementVNode("header",Xp,[L[13]||(L[13]=e.createElementVNode("span",{class:"zm-note-section-title"},"笔记",-1)),L[14]||(L[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:h},e.toDisplayString(d.value?"隐藏预览":"显示预览"),1))]),e.createElementVNode("div",Zp,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"noteRef",ref:c,"onUpdate:modelValue":L[0]||(L[0]=F=>a.value=F),class:"zm-note-textarea",placeholder:"写点什么吧… 支持 Markdown",spellcheck:"false",disabled:t.readonly,onBlur:b,onKeydown:A},null,40,Jp),[[e.vModelText,a.value]]),d.value?(e.openBlock(),e.createElementBlock("div",Qp,[s.value?(e.openBlock(),e.createElementBlock("div",th," 渲染后的 Markdown 仅在此面板显示,不会撑大节点框。 ")):(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-note-preview-body",innerHTML:m.value},null,8,eh))])):e.createCommentVNode("",!0)]),!t.readonly&&!s.value?(e.openBlock(),e.createElementBlock("div",nh,[e.createElementVNode("button",{class:"zm-note-action-btn is-danger",onClick:C},"移除笔记")])):e.createCommentVNode("",!0)]),t.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",oh,[!$.value&&!w.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-note-add-chip",onClick:L[1]||(L[1]=F=>w.value=!0)},"+ 链接")):e.createCommentVNode("",!0),!R.value&&!y.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-note-add-chip",onClick:L[2]||(L[2]=F=>y.value=!0)},"+ 图片")):e.createCommentVNode("",!0),!I.value&&!p.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-note-add-chip",onClick:L[3]||(L[3]=F=>p.value=!0)},"+ 代码块")):e.createCommentVNode("",!0),!v.value&&!P.value?(e.openBlock(),e.createElementBlock("button",{key:3,class:"zm-note-add-chip",onClick:L[4]||(L[4]=F=>P.value=!0)},"+ 表格")):e.createCommentVNode("",!0)])),$.value||w.value?(e.openBlock(),e.createElementBlock("section",ih,[L[15]||(L[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":L[5]||(L[5]=F=>Y.value=F),class:"zm-note-input",type:"url",placeholder:"https://…",disabled:t.readonly,onBlur:q,onKeydown:L[6]||(L[6]=e.withKeys(e.withModifiers(F=>F.target.blur(),["prevent"]),["enter"]))},null,40,rh),[[e.vModelText,Y.value]]),$.value?(e.openBlock(),e.createElementBlock("a",{key:0,class:"zm-note-link-chip",href:(ce=t.selectedNode.link)==null?void 0:ce.url,target:"_blank",rel:"noopener noreferrer",title:(ke=t.selectedNode.link)==null?void 0:ke.url},e.toDisplayString((z=t.selectedNode.link)==null?void 0:z.url),9,lh)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),R.value||y.value?(e.openBlock(),e.createElementBlock("section",ah,[L[16]||(L[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":L[7]||(L[7]=F=>N.value=F),class:"zm-note-input",type:"url",placeholder:"data:image/… 或 https://…",disabled:t.readonly,onBlur:ae,onKeydown:L[8]||(L[8]=e.withKeys(e.withModifiers(F=>F.target.blur(),["prevent"]),["enter"]))},null,40,sh),[[e.vModelText,N.value]]),R.value?(e.openBlock(),e.createElementBlock("img",{key:0,class:"zm-note-image",src:(T=t.selectedNode.image)==null?void 0:T.src,alt:t.selectedNode.text,onError:ge,onLoad:ue},null,40,ch)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),I.value||p.value?(e.openBlock(),e.createElementBlock("section",dh,[e.createElementVNode("header",uh,[L[17]||(L[17]=e.createElementVNode("span",{class:"zm-note-section-title"},"代码块",-1)),e.unref(_n)(we.value)?(e.openBlock(),e.createElementBlock("span",fh,e.toDisplayString(e.unref(_n)(we.value)),1)):e.createCommentVNode("",!0)]),e.withDirectives(e.createElementVNode("textarea",{ref_key:"codeRef",ref:te,"onUpdate:modelValue":L[9]||(L[9]=F=>we.value=F),class:"zm-note-input zm-note-input-code",placeholder:"```ts\nconsole.log(123)\n```",spellcheck:"false",disabled:t.readonly,onBlur:fe},null,40,mh),[[e.vModelText,we.value]]),we.value.trim()?(e.openBlock(),e.createElementBlock("pre",ph,[e.createElementVNode("code",{innerHTML:de.value},null,8,hh)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),v.value||P.value?(e.openBlock(),e.createElementBlock("section",gh,[L[18]||(L[18]=e.createElementVNode("header",{class:"zm-note-section-head"},[e.createElementVNode("span",{class:"zm-note-section-title"},"表格")],-1)),e.withDirectives(e.createElementVNode("textarea",{ref_key:"tableRef",ref:V,"onUpdate:modelValue":L[10]||(L[10]=F=>g.value=F),class:"zm-note-input zm-note-input-code",placeholder:`| 列1 | 列2 |
130
130
  | --- | --- |
131
- | a | b |`,spellcheck:"false",disabled:t.readonly,onBlur:G},null,40,Pp),[[e.vModelText,h.value]]),oe.value.length?(e.openBlock(),e.createElementBlock("table",Fp,[e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(oe.value,(F,W)=>(e.openBlock(),e.createElementBlock("tr",{key:W},[W===0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(F,(te,ye)=>(e.openBlock(),e.createElementBlock("th",{key:`h${ye}`},e.toDisplayString(te),1))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(F,(te,ye)=>(e.openBlock(),e.createElementBlock("td",{key:`c${ye}`},e.toDisplayString(te),1))),128))]))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])],64)):(e.openBlock(),e.createElementBlock("div",fp,[...L[11]||(L[11]=[e.createElementVNode("p",null,"请先在画布上选中一个节点。",-1),e.createElementVNode("p",{class:"zm-note-hint"}," 选中节点后,会在这里展示并可编辑节点的笔记、链接、图片、代码块、表格。 ",-1)])]))])}}}),Up=["viewBox","width","height"],Hp={class:"zm-edges"},Wp=["d","fill"],Gp=["data-node-id","onClick","onPointerdown","onDblclick","onContextmenu","onMouseenter","onMouseleave"],jp=["src","width","height","alt"],Kp=["onDblclick"],Yp={key:0,class:"zm-rich-code"},qp=["innerHTML"],Xp={key:1,class:"zm-rich-table"},Zp={key:2,class:"zm-text"},Jp={key:0,class:"zm-node-markers"},Qp=["title","innerHTML"],eh={class:"zm-text-label"},th=["href","title"],nh=["title","onClick"],oh={key:4,class:"zm-node-tags"},ih=["title"],rh=["title","onClick"],lh=["onClick"],ah=["onMousedown"],sh=["onClick"],ch=["title"],dh=["src"],uh=["src"],Rn=24,Kn=400,gn=160,Kl=4,ei=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,a=n,c=e.ref(null),s=e.ref(null),u=e.ref(""),d=e.ref(new Set),p=e.computed(()=>d.value.values().next().value??null),b=e.ref(new Set),C=e.ref(!1),w=e.ref(null),V=e.ref(0),R=e.ref(0),U=e.computed(()=>{const i=w.value;if(!i||!i.currentTargetId||!i.dropPosition||i.dropPosition==="child")return null;const l=cn.value.find(B=>B.id===i.currentTargetId);if(!l)return null;const f=l.width/2,N=l.height/2;if(l._dir==="down"){const B=i.dropPosition==="before"?l.x-f:l.x+f;return{x1:B,y1:l.y-N,x2:B,y2:l.y+N,horizontal:!1}}const E=i.dropPosition==="before"?l.y-N:l.y+N;return{x1:l.x-f,y1:E,x2:l.x+f,y2:E,horizontal:!0}}),I=e.ref(null),_=e.ref(null),y=e.ref(null),k=e.ref(""),m=e.ref(Ot(r.data)),P=e.ref({}),j=e.ref({}),Y=e.ref(r.markdown!==void 0);let x=!1;e.watch(()=>r.markdown,i=>{if(i===void 0){Y.value=!1;return}Y.value=!0;const l=On(i||"");x=!0,m.value=Ot(l),d.value=new Set,b.value=new Set,Ee(),e.nextTick(()=>{x=!1,nn()})}),e.watch(m,()=>{Y.value&&!x&&a("markdownChange",Dn(m.value))},{deep:!0});const re=e.computed(()=>M.showOrderBadge===!0),pe=e.ref(new Map),de=pe.value;function we(i,l){const f={};l.bg&&(f.bg=l.bg),l.textColor&&(f.textColor=l.textColor),l.borderColor&&(f.borderColor=l.borderColor),l.fontWeight&&(f.fontWeight=l.fontWeight),l.fontSize&&(f.fontSize=l.fontSize),Object.keys(f).length===0?de.delete(i):de.set(i,f),pe.value=new Map(de)}function ee(i){return de.get(i)??{}}function ce(i,l){const f=be(m.value,i);f&&(f.image={src:l.src,naturalW:l.naturalW,naturalH:l.naturalH,width:$(l.width,Rn,Kn),height:$(l.height,Rn,Kn)},Ve(),Ee(),a("change",m.value))}function ue(i){const l=be(m.value,i);!l||!l.image||(delete l.image,Ve(),Ee(),a("change",m.value))}function h(i,l){const f=l.trim();if(!be(m.value,i))return;if(!f){ue(i);return}const E=new Image;E.onload=()=>{const B=be(m.value,i);if(!B)return;const A=E.naturalWidth&&E.naturalHeight?E.naturalWidth/E.naturalHeight:1,v=$(E.naturalWidth||gn,Rn,Kn),Z=Math.round(v/A);B.image={src:f,naturalW:E.naturalWidth||v,naturalH:E.naturalHeight||Z,width:v,height:Z},Ve(),Ee(),a("change",m.value)},E.onerror=()=>{},E.src=f}function $(i,l,f){return Math.min(f,Math.max(l,i))}function G(i,l){const f=new FileReader;f.onload=()=>{if(typeof f.result!="string")return;const N=f.result,E=new window.Image;E.onload=()=>{const B=E.naturalWidth||gn,A=E.naturalHeight||gn,v=$(B,Rn,gn),Z=$(Math.round(A*v/B),Rn,Kn);l({src:N,naturalW:B,naturalH:A,width:v,height:Z})},E.onerror=()=>{l({src:N,naturalW:gn,naturalH:gn,width:gn,height:gn})},E.src=N},f.readAsDataURL(i)}function oe(i){const l=document.createElement("input");l.type="file",l.accept="image/*",l.style.display="none",l.onchange=()=>{var N;const f=(N=l.files)==null?void 0:N[0];f&&(G(f,E=>ce(i,E)),document.body.removeChild(l))},document.body.appendChild(l),l.click()}function fe(i,l){const f=l.trim(),N=be(m.value,i);N&&(f?N.link={url:f}:delete N.link,Ve(),Ee(),a("change",m.value))}function O(i){fe(i,"")}function L(i,l){const f=be(m.value,i);f&&(l?f.note={text:l}:delete f.note,Ve(),Ee(),a("change",m.value))}function se(i){L(i,"")}function ke(i,l){const f=be(m.value,i);f&&(l?f.richContent=l:delete f.richContent,Ve(),Ee(),a("change",m.value))}const z=e.ref(null),S=e.ref(null),F=e.computed(()=>["zm-canvas-fab","zm-canvas-fab-preview",!r.hideCanvasActions&&(!r.previewMode||C.value)?"is-visible":""].filter(Boolean).join(" ")),W=e.computed(()=>["zm-canvas-fab","zm-canvas-fab-outline",!r.hideCanvasActions&&(!r.previewMode||C.value)?"is-visible":""].filter(Boolean).join(" "));function te(i,l){r.previewMode||(i.preventDefault(),i.stopPropagation(),S.value=null,d.value=new Set([l.id]),st(),z.value={nodeId:l.id,x:i.clientX,y:i.clientY})}function ye(){z.value=null}function nt(i){const l=i.target;if(!(l!=null&&l.closest(".zm-toolbar, button, input, textarea, .zm-canvas-fab-preview, .zm-canvas-fab-outline"))){if(ui&&ge.panMoved.value){ui=!1,i.preventDefault();return}i.preventDefault(),z.value&&(z.value=null),S.value={x:i.clientX,y:i.clientY}}}function ft(){S.value=null}function ot(){ft(),r.builtInDrawers&&(Ct(),De.value=!0),a("canvas-settings")}function an(){ft(),r.builtInDrawers&&(Ct(),Pt.value=!0),a("canvas-data")}function it(i){ft(),r.builtInDrawers&&(Ct(),Ft.value=i,Pt.value=!0),a("canvas-import",i)}const sn=e.ref(!1),Pt=e.ref(!1),me=e.ref(!1),mt=e.ref(!1),De=e.ref(!1),ze=e.ref(0),Ft=e.ref(null),rt=e.ref(new Set);function Ct(){Pt.value=!1,me.value=!1,mt.value=!1,De.value=!1}const wt=e.computed(()=>{const i=p.value;return i?be(m.value,i)??null:null}),q=e.computed(()=>wt.value?ee(wt.value.id):{});function le(i){i.autoBalanceOnChange!==void 0&&(M.autoBalanceOnChange=i.autoBalanceOnChange),i.lineWidthStart!==void 0&&(M.lineWidthStart=Math.max(.5,Math.min(20,i.lineWidthStart))),i.lineWidthEnd!==void 0&&(M.lineWidthEnd=Math.max(.1,Math.min(10,i.lineWidthEnd))),i.rainbowBranch!==void 0&&(M.rainbowBranch=i.rainbowBranch),i.branchPaletteId!==void 0&&(M.branchPaletteId=i.branchPaletteId),i.customPalettes!==void 0&&(M.customPalettes=i.customPalettes),i.lineStyle!==void 0&&(M.lineStyle=i.lineStyle),i.rootLineStyle!==void 0&&(M.rootLineStyle=i.rootLineStyle),i.lineOrigin!==void 0&&(M.lineOrigin=i.lineOrigin),i.taperedEdge!==void 0&&(M.taperedEdge=i.taperedEdge),i.lineWidthTaper!==void 0&&(M.lineWidthTaper=Math.max(.1,Math.min(1,i.lineWidthTaper))),i.uniformLineWidth!==void 0&&(M.uniformLineWidth=i.uniformLineWidth),i.elbowRadius!==void 0&&(M.elbowRadius=Math.max(2,Math.min(40,i.elbowRadius))),i.showOrderBadge!==void 0&&(M.showOrderBadge=i.showOrderBadge),i.canvasBg!==void 0&&(M.canvasBg=i.canvasBg),i.branchGap!==void 0&&(M.branchGap=Math.max(0,Math.min(80,i.branchGap)))}function xe(i){wt.value&&we(wt.value.id,i)}function Re(){const i={autoBalanceOnChange:!0,lineWidthStart:16,lineWidthEnd:.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"rounded-elbow",rootLineStyle:"arc",lineOrigin:"proportional",layoutMode:"mindmap",taperedEdge:!0,lineWidthTaper:.3,uniformLineWidth:!0,elbowRadius:20,showOrderBadge:!1,canvasBg:void 0,branchGap:20};M.autoBalanceOnChange=i.autoBalanceOnChange,M.lineWidthStart=i.lineWidthStart,M.lineWidthEnd=i.lineWidthEnd,M.rainbowBranch=i.rainbowBranch,M.branchPaletteId=i.branchPaletteId,M.customPalettes=i.customPalettes,M.lineStyle=i.lineStyle,M.rootLineStyle=i.rootLineStyle,M.lineOrigin=i.lineOrigin,M.layoutMode=i.layoutMode,M.taperedEdge=i.taperedEdge,M.lineWidthTaper=i.lineWidthTaper,M.uniformLineWidth=i.uniformLineWidth,M.elbowRadius=i.elbowRadius,M.showOrderBadge=i.showOrderBadge,M.canvasBg=i.canvasBg,M.branchGap=i.branchGap}function Ge(){Ft.value=null}function lt(i){const l=p.value;l&&L(l,i)}function Mt(){const i=p.value;i&&se(i)}function Bn(i){const l=p.value;l&&fe(l,i)}function ni(i){const l=p.value;l&&h(l,i)}function oi(i){const l=p.value;l&&ke(l,i)}function ho(i){const l=document.querySelector(`[data-node-id="${i.id}"]`);l&&l.click()}function ii(i){ha(i.id,i.text)}function Yn(i){oo(i)}function qn(i){ci(i)}function Ut(i){tr(i.srcId,i.targetId,i.position)}function bn(i){const l=new Set(rt.value);l.has(i)?l.delete(i):l.add(i),rt.value=l}function go(){r.builtInDrawers&&(sn.value=!sn.value),a("canvas-outline")}function bo(){var l;const i=(l=z.value)==null?void 0:l.nodeId;i&&oe(i)}function Yi(){var N,E,B;const i=(N=z.value)==null?void 0:N.nodeId;if(!i)return;const l=((B=(E=be(m.value,i))==null?void 0:E.link)==null?void 0:B.url)??"",f=window.prompt("输入链接 URL(留空取消)",l);f!==null&&fe(i,f)}function ko(){var l;const i=(l=z.value)==null?void 0:l.nodeId;i&&O(i)}function yo(){var l;const i=(l=z.value)==null?void 0:l.nodeId;i&&li(i)}function qi(){var l;const i=(l=z.value)==null?void 0:l.nodeId;i&&se(i)}function vn(){var l;const i=(l=z.value)==null?void 0:l.nodeId;i&&ue(i)}function ri(){var ie,T;const i=(ie=z.value)==null?void 0:ie.nodeId;if(!i)return;const l=(T=be(m.value,i))==null?void 0:T.richContent,f=(l==null?void 0:l.kind)==="code"?jo(l.raw):"",N=(l==null?void 0:l.kind)==="code"&&l.lang||"",E=N?"```"+N+`
132
- `:"```\n",A=window.prompt("输入代码块内容(用 ```lang 包裹;留空取消)",f?E+f+(f.endsWith("```")?"":"\n```"):E+"// 你的代码"+"\n```");if(A===null)return;const v=A.trim();if(!v){ke(i,null);return}const Z=/^```([^\s`]*)/.exec(v),H=Z?Z[1]:void 0;ke(i,{kind:"code",raw:v,lang:H})}function Xi(){var l;const i=(l=z.value)==null?void 0:l.nodeId;i&&ke(i,null)}function je(){var A,v;const i=(A=z.value)==null?void 0:A.nodeId;if(!i)return;const l=(v=be(m.value,i))==null?void 0:v.richContent,f=(l==null?void 0:l.kind)==="table"?l.raw:"",E=window.prompt("输入 markdown 表格(每行以 | 分隔;留空取消)",f||`| 列1 | 列2 | 列3 |
131
+ | a | b |`,spellcheck:"false",disabled:t.readonly,onBlur:G},null,40,bh),[[e.vModelText,g.value]]),le.value.length?(e.openBlock(),e.createElementBlock("table",kh,[e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(le.value,(F,H)=>(e.openBlock(),e.createElementBlock("tr",{key:H},[H===0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(F,(ne,xe)=>(e.openBlock(),e.createElementBlock("th",{key:`h${xe}`},e.toDisplayString(ne),1))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(F,(ne,xe)=>(e.openBlock(),e.createElementBlock("td",{key:`c${xe}`},e.toDisplayString(ne),1))),128))]))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])],64)):(e.openBlock(),e.createElementBlock("div",Hp,[...L[11]||(L[11]=[e.createElementVNode("p",null,"请先在画布上选中一个节点。",-1),e.createElementVNode("p",{class:"zm-note-hint"}," 选中节点后,会在这里展示并可编辑节点的笔记、链接、图片、代码块、表格。 ",-1)])]))])}}}),yh=["viewBox","width","height"],xh={class:"zm-edges"},Eh=["d","fill"],wh={class:"zm-relations"},Nh=["d","onClick","onDblclick"],Sh=["d"],Ch=["d"],Th=["d"],Mh=["x","y","onClick","onDblclick"],Ah=["x1","y1","x2","y2"],_h=["x1","y1","x2","y2"],vh=["cx","cy","r","onPointerdown"],Rh=["cx","cy","r","onPointerdown"],Bh=["x","y","width","height","onPointerdown"],zh=["x","y","width","height","onPointerdown"],Ih=["data-node-id","onClick","onPointerdown","onDblclick","onContextmenu","onMouseenter","onMouseleave"],Lh=["src","width","height","alt"],Oh=["onDblclick"],Vh={key:0,class:"zm-rich-code"},Dh=["innerHTML"],$h={key:1,class:"zm-rich-table"},Ph={key:2,class:"zm-text"},Fh={key:0,class:"zm-node-markers"},Uh=["title","innerHTML"],Hh={class:"zm-text-label"},Wh=["href","title"],Gh=["title","onClick"],jh={key:4,class:"zm-node-tags"},Kh=["title"],Yh=["title","onClick"],qh=["onClick"],Xh=["onMousedown"],Zh=["onClick"],Jh=["onKeydown"],Qh=["title"],eg=["src"],tg=["src"],In=24,Qn=400,kn=160,ra=4,si=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,a=n,c=e.ref(null),s=e.ref(null),m=e.ref(""),d=e.ref(new Set),h=e.computed(()=>d.value.values().next().value??null),b=e.ref(new Set),A=e.ref(!1),C=e.ref(null),$=e.ref(0),R=e.ref(0),U=e.computed(()=>{const i=C.value;if(!i||!i.currentTargetId||!i.dropPosition||i.dropPosition==="child")return null;const l=Wt.value.find(M=>M.id===i.currentTargetId);if(!l)return null;const u=l.width/2,x=l.height/2;if(l._dir==="down"){const M=i.dropPosition==="before"?l.x-u:l.x+u;return{x1:M,y1:l.y-x,x2:M,y2:l.y+x,horizontal:!1}}const k=i.dropPosition==="before"?l.y-x:l.y+x;return{x1:l.x-u,y1:k,x2:l.x+u,y2:k,horizontal:!0}}),I=e.ref(null),v=e.ref(null),w=e.ref(null),y=e.ref(""),p=e.ref(vt(r.data)),P=e.ref({}),Y=e.ref({}),q=e.ref(r.markdown!==void 0);let N=!1;e.watch(()=>r.markdown,i=>{if(i===void 0){q.value=!1;return}q.value=!0;const l=Un(i||"");N=!0,p.value=vt(l),d.value=new Set,b.value=new Set,ye(),e.nextTick(()=>{N=!1,rn()})}),e.watch(p,()=>{q.value&&!N&&a("markdownChange",Hn(p.value))},{deep:!0});const ae=e.computed(()=>f.showOrderBadge===!0),ge=e.ref(new Map),ue=ge.value;function we(i,l){const u={};l.bg&&(u.bg=l.bg),l.textColor&&(u.textColor=l.textColor),l.borderColor&&(u.borderColor=l.borderColor),l.fontWeight&&(u.fontWeight=l.fontWeight),l.fontSize&&(u.fontSize=l.fontSize),Object.keys(u).length===0?ue.delete(i):ue.set(i,u),ge.value=new Map(ue)}function te(i){return ue.get(i)??{}}function de(i,l){const u=he(p.value,i);u&&(u.image={src:l.src,naturalW:l.naturalW,naturalH:l.naturalH,width:V(l.width,In,Qn),height:V(l.height,In,Qn)},ze(),ye(),a("change",p.value))}function fe(i){const l=he(p.value,i);!l||!l.image||(delete l.image,ze(),ye(),a("change",p.value))}function g(i,l){const u=l.trim();if(!he(p.value,i))return;if(!u){fe(i);return}const k=new Image;k.onload=()=>{const M=he(p.value,i);if(!M)return;const S=k.naturalWidth&&k.naturalHeight?k.naturalWidth/k.naturalHeight:1,_=V(k.naturalWidth||kn,In,Qn),W=Math.round(_/S);M.image={src:u,naturalW:k.naturalWidth||_,naturalH:k.naturalHeight||W,width:_,height:W},ze(),ye(),a("change",p.value)},k.onerror=()=>{},k.src=u}function V(i,l,u){return Math.min(u,Math.max(l,i))}function G(i,l){const u=new FileReader;u.onload=()=>{if(typeof u.result!="string")return;const x=u.result,k=new window.Image;k.onload=()=>{const M=k.naturalWidth||kn,S=k.naturalHeight||kn,_=V(M,In,kn),W=V(Math.round(S*_/M),In,Qn);l({src:x,naturalW:M,naturalH:S,width:_,height:W})},k.onerror=()=>{l({src:x,naturalW:kn,naturalH:kn,width:kn,height:kn})},k.src=x},u.readAsDataURL(i)}function le(i){const l=document.createElement("input");l.type="file",l.accept="image/*",l.style.display="none",l.onchange=()=>{var x;const u=(x=l.files)==null?void 0:x[0];u&&(G(u,k=>de(i,k)),document.body.removeChild(l))},document.body.appendChild(l),l.click()}function me(i,l){const u=l.trim(),x=he(p.value,i);x&&(u?x.link={url:u}:delete x.link,ze(),ye(),a("change",p.value))}function O(i){me(i,"")}function L(i,l){const u=he(p.value,i);u&&(l?u.note={text:l}:delete u.note,ze(),ye(),a("change",p.value))}function ce(i){L(i,"")}function ke(i,l){const u=he(p.value,i);u&&(l?u.richContent=l:delete u.richContent,ze(),ye(),a("change",p.value))}const z=e.ref(null),T=e.ref(null),F=e.computed(()=>["zm-canvas-fab","zm-canvas-fab-preview",!r.hideCanvasActions&&(!r.previewMode||A.value)?"is-visible":""].filter(Boolean).join(" ")),H=e.computed(()=>["zm-canvas-fab","zm-canvas-fab-outline",!r.hideCanvasActions&&(!r.previewMode||A.value)?"is-visible":""].filter(Boolean).join(" "));function ne(i,l){r.previewMode||(i.preventDefault(),i.stopPropagation(),T.value=null,d.value=new Set([l.id]),Je(),z.value={nodeId:l.id,x:i.clientX,y:i.clientY})}function xe(){z.value=null}function ot(i){const l=i.target;if(!(l!=null&&l.closest(".zm-toolbar, button, input, textarea, .zm-canvas-fab-preview, .zm-canvas-fab-outline"))){if(yi&&Q.panMoved.value){yi=!1,i.preventDefault();return}i.preventDefault(),z.value&&(z.value=null),T.value={x:i.clientX,y:i.clientY}}}function mt(){T.value=null}function it(){mt(),r.builtInDrawers&&(Tt(),$e.value=!0),a("canvas-settings")}function cn(){mt(),r.builtInDrawers&&(Tt(),Ft.value=!0),a("canvas-data")}function rt(i){mt(),r.builtInDrawers&&(Tt(),Ut.value=i,Ft.value=!0),a("canvas-import",i)}const dn=e.ref(!1),Ft=e.ref(!1),pe=e.ref(!1),pt=e.ref(!1),$e=e.ref(!1),De=e.ref(0),Ut=e.ref(null),lt=e.ref(new Set);function Tt(){Ft.value=!1,pe.value=!1,pt.value=!1,$e.value=!1}const Nt=e.computed(()=>{const i=h.value;return i?he(p.value,i)??null:null}),X=e.computed(()=>Nt.value?te(Nt.value.id):{});function se(i){i.autoBalanceOnChange!==void 0&&(f.autoBalanceOnChange=i.autoBalanceOnChange),i.lineWidthStart!==void 0&&(f.lineWidthStart=Math.max(.5,Math.min(20,i.lineWidthStart))),i.lineWidthEnd!==void 0&&(f.lineWidthEnd=Math.max(.1,Math.min(10,i.lineWidthEnd))),i.rainbowBranch!==void 0&&(f.rainbowBranch=i.rainbowBranch),i.branchPaletteId!==void 0&&(f.branchPaletteId=i.branchPaletteId),i.customPalettes!==void 0&&(f.customPalettes=i.customPalettes),i.lineStyle!==void 0&&(f.lineStyle=i.lineStyle),i.rootLineStyle!==void 0&&(f.rootLineStyle=i.rootLineStyle),i.lineOrigin!==void 0&&(f.lineOrigin=i.lineOrigin),i.taperedEdge!==void 0&&(f.taperedEdge=i.taperedEdge),i.lineWidthTaper!==void 0&&(f.lineWidthTaper=Math.max(.1,Math.min(1,i.lineWidthTaper))),i.uniformLineWidth!==void 0&&(f.uniformLineWidth=i.uniformLineWidth),i.elbowRadius!==void 0&&(f.elbowRadius=Math.max(2,Math.min(40,i.elbowRadius))),i.showOrderBadge!==void 0&&(f.showOrderBadge=i.showOrderBadge),i.canvasBg!==void 0&&(f.canvasBg=i.canvasBg),i.branchGap!==void 0&&(f.branchGap=Math.max(0,Math.min(80,i.branchGap)))}function Ee(i){Nt.value&&we(Nt.value.id,i)}function Be(){const i={autoBalanceOnChange:!0,lineWidthStart:16,lineWidthEnd:.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"rounded-elbow",rootLineStyle:"arc",lineOrigin:"proportional",layoutMode:"mindmap",taperedEdge:!0,lineWidthTaper:.3,uniformLineWidth:!0,elbowRadius:20,showOrderBadge:!1,canvasBg:void 0,branchGap:20};f.autoBalanceOnChange=i.autoBalanceOnChange,f.lineWidthStart=i.lineWidthStart,f.lineWidthEnd=i.lineWidthEnd,f.rainbowBranch=i.rainbowBranch,f.branchPaletteId=i.branchPaletteId,f.customPalettes=i.customPalettes,f.lineStyle=i.lineStyle,f.rootLineStyle=i.rootLineStyle,f.lineOrigin=i.lineOrigin,f.layoutMode=i.layoutMode,f.taperedEdge=i.taperedEdge,f.lineWidthTaper=i.lineWidthTaper,f.uniformLineWidth=i.uniformLineWidth,f.elbowRadius=i.elbowRadius,f.showOrderBadge=i.showOrderBadge,f.canvasBg=i.canvasBg,f.branchGap=i.branchGap}function Ge(){Ut.value=null}function at(i){const l=h.value;l&&L(l,i)}function Mt(){const i=h.value;i&&ce(i)}function Ln(i){const l=h.value;l&&me(l,i)}function di(i){const l=h.value;l&&g(l,i)}function ui(i){const l=h.value;l&&ke(l,i)}function xo(i){const l=document.querySelector(`[data-node-id="${i.id}"]`);l&&l.click()}function fi(i){Aa(i.id,i.text)}function eo(i){so(i)}function to(i){pi(i)}function Ht(i){cr(i.srcId,i.targetId,i.position)}function yn(i){const l=new Set(lt.value);l.has(i)?l.delete(i):l.add(i),lt.value=l}function Eo(){r.builtInDrawers&&(dn.value=!dn.value),a("canvas-outline")}function wo(){var l;const i=(l=z.value)==null?void 0:l.nodeId;i&&le(i)}function nr(){var x,k,M;const i=(x=z.value)==null?void 0:x.nodeId;if(!i)return;const l=((M=(k=he(p.value,i))==null?void 0:k.link)==null?void 0:M.url)??"",u=window.prompt("输入链接 URL(留空取消)",l);u!==null&&me(i,u)}function No(){var l;const i=(l=z.value)==null?void 0:l.nodeId;i&&O(i)}function So(){var l;const i=(l=z.value)==null?void 0:l.nodeId;i&&Co(i)}function or(){var l;const i=(l=z.value)==null?void 0:l.nodeId;i&&ce(i)}function On(){var l;const i=(l=z.value)==null?void 0:l.nodeId;i&&fe(i)}function mi(){var J,E;const i=(J=z.value)==null?void 0:J.nodeId;if(!i)return;const l=(E=he(p.value,i))==null?void 0:E.richContent,u=(l==null?void 0:l.kind)==="code"?ei(l.raw):"",x=(l==null?void 0:l.kind)==="code"&&l.lang||"",k=x?"```"+x+`
132
+ `:"```\n",S=window.prompt("输入代码块内容(用 ```lang 包裹;留空取消)",u?k+u+(u.endsWith("```")?"":"\n```"):k+"// 你的代码"+"\n```");if(S===null)return;const _=S.trim();if(!_){ke(i,null);return}const W=/^```([^\s`]*)/.exec(_),B=W?W[1]:void 0;ke(i,{kind:"code",raw:_,lang:B})}function ir(){var l;const i=(l=z.value)==null?void 0:l.nodeId;i&&ke(i,null)}function je(){var S,_;const i=(S=z.value)==null?void 0:S.nodeId;if(!i)return;const l=(_=he(p.value,i))==null?void 0:_.richContent,u=(l==null?void 0:l.kind)==="table"?l.raw:"",k=window.prompt("输入 markdown 表格(每行以 | 分隔;留空取消)",u||`| 列1 | 列2 | 列3 |
133
133
  | --- | --- | --- |
134
- | a | b | c |`);if(E===null)return;const B=E.trim();if(!B){ke(i,null);return}ke(i,{kind:"table",raw:B})}function kn(){var l;const i=(l=z.value)==null?void 0:l.nodeId;i&&ke(i,null)}function li(i){r.previewMode||(d.value=new Set([i]),st(),r.builtInDrawers&&(Ct(),mt.value=!0,ze.value++),a("edit-note",i))}function ai(i,l=60){const f=i.replace(/\s+/g," ").trim();return f.length<=l?f||"点击编辑笔记":f.slice(0,l)+"…"}function Xn(i){var A,v;if(r.previewMode||s.value)return;const l=i.target;if(l&&(l.tagName==="INPUT"||l.tagName==="TEXTAREA"||l.isContentEditable))return;const f=p.value;if(!f)return;const N=(A=i.clipboardData)==null?void 0:A.items;if(!N)return;for(let Z=0;Z<N.length;Z++){const H=N[Z];if(H.kind==="file"&&H.type.startsWith("image/")){const ie=H.getAsFile();if(!ie)continue;i.preventDefault();const T=be(m.value,f);if(T!=null&&T.image&&!window.confirm("该节点已有图片,要用剪贴板里的图片替换吗?"))return;G(ie,J=>ce(f,J));return}}if(I.value&&I.value.nodes.length>0)return;let E=null;for(let Z=0;Z<N.length;Z++){const H=N[Z];if(H.kind==="string"&&H.type==="text/plain"){E=((v=i.clipboardData)==null?void 0:v.getData("text/plain"))??null;break}}if(!E)return;const B=E.split(/\r?\n/).map(Z=>Z.replace(/^\s*[-*+]\s+/,"").trim()).filter(Z=>Z.length>0);if(B.length!==0){i.preventDefault(),Ve();for(const Z of B)bi(m.value,f,Z);Ee(),a("change",m.value)}}e.onMounted(()=>{window.addEventListener("paste",Xn),window.addEventListener("keydown",xo),Ee()}),e.onBeforeUnmount(()=>{window.removeEventListener("paste",Xn),window.removeEventListener("keydown",xo)});function xo(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(),a("canvas-outline")}}const yn=e.ref(null),Zi=e.computed(()=>{var i;return((i=yn.value)==null?void 0:i.nodeId)??null});function At(i,l){if(!l.image)return;i.preventDefault(),i.stopPropagation();const f=l.image.naturalW||l.image.width,N=l.image.naturalH||l.image.height,E=N>0?N/f:1;yn.value={nodeId:l.id,startX:i.clientX,startY:i.clientY,startW:l.image.width,startH:l.image.height,naturalW:f,naturalH:N,ratio:E,pendingW:l.image.width,pendingH:l.image.height},window.addEventListener("mousemove",en),window.addEventListener("mouseup",Eo)}function en(i){var Z,H;const l=yn.value;if(!l)return;const f=ge.scale.value||1,N=i.clientX-l.startX,E=$(l.startW+N/f,Rn,Kn),B=$(E*l.ratio,Rn,Kn);l.pendingW=E,l.pendingH=B;const A=(Z=c.value)==null?void 0:Z.querySelector(`[data-node-id="${l.nodeId}"] .zm-node-img`);A&&(A.style.width=`${E}px`,A.style.height=`${B}px`);const v=(H=c.value)==null?void 0:H.querySelector(`[data-node-id="${l.nodeId}"]`);v&&(v.style.minWidth=`${Math.max(80,Math.ceil(E+28))}px`,v.style.height=`${Math.ceil(B+8+30)}px`)}function Eo(){const i=yn.value;if(window.removeEventListener("mousemove",en),window.removeEventListener("mouseup",Eo),yn.value=null,!i)return;const l=be(m.value,i.nodeId);!l||!l.image||(ce(i.nodeId,{src:l.image.src,naturalW:l.image.naturalW,naturalH:l.image.naturalH,width:i.pendingW,height:i.pendingH}),d.value=new Set([i.nodeId]),st(),zn=!0)}const Zn=e.ref(null);let zn=!1;function Jn(i){Zn.value=i}function xn(i){Zn.value===i&&(Zn.value=null),_.value&&(_.value=null)}function Qn(i,l){var ae;if(!l.text||l.text.length<14)return;const N=i.currentTarget.getBoundingClientRect(),E=(ae=c.value)==null?void 0:ae.getBoundingClientRect();if(!E)return;const B=10,A=240,v=N.top-E.top>60,Z=N.left-E.left+N.width/2,H=B+A/2,ie=E.width-A/2-B,T=Math.max(H,Math.min(Z,ie)),J=v?N.top-E.top-8:N.bottom-E.top+8;_.value={text:l.text,x:T,y:J,above:v}}const _t=e.ref(0),eo=e.ref(!1),Kt=ls(100);function Ve(){Kt.record({data:m.value,selectedIds:[...d.value]})}function Ee(){b.value=new Set(b.value),_t.value++,e.nextTick().then(()=>e.nextTick()).then(()=>si()).then(()=>{_t.value++})}function si(){const i=document.querySelectorAll(".zm-rich"),l={},f={};i.forEach(N=>{let E=N,B=null;for(;E&&!B;)B=E.getAttribute("data-node-id"),E=E.parentElement;if(!B)return;const A=N.offsetHeight,v=N.scrollWidth,Z=Math.round(A*2)/2,H=Math.round(v*2)/2;l[B]=Z,f[B]=H,P.value[B],j.value[B]}),P.value=l,j.value=f}const Nt=e.computed(()=>{var i,l,f,N,E,B,A,v,Z,H;return{rootBg:((i=r.theme)==null?void 0:i.rootBg)??"#1f2937",rootText:((l=r.theme)==null?void 0:l.rootText)??"#ffffff",branchBg:((f=r.theme)==null?void 0:f.branchBg)??"#ffffff",branchText:((N=r.theme)==null?void 0:N.branchText)??"#1f2937",lineColor:((E=r.theme)==null?void 0:E.lineColor)??"#94a3b8",bgColor:((B=r.theme)==null?void 0:B.bgColor)??"#f8fafc",fontSize:((A=r.theme)==null?void 0:A.fontSize)??14,lineWidthStart:((v=r.theme)==null?void 0:v.lineWidthStart)??2.2,lineWidthEnd:((Z=r.theme)==null?void 0:Z.lineWidthEnd)??.8,rainbowBranch:((H=r.theme)==null?void 0:H.rainbowBranch)??!1}}),tn=e.computed(()=>M.canvasBg||Nt.value.bgColor),M=e.reactive({autoBalanceOnChange:!0,lineWidthStart:16,lineWidthEnd:3.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"rounded-elbow",rootLineStyle:"arc",lineOrigin:"proportional",layoutMode:"mindmap",taperedEdge:!0,lineWidthTaper:.3,uniformLineWidth:!0,elbowRadius:20,showOrderBadge:!1,canvasBg:void 0,branchGap:20});function g(i){return i?M.rootLineStyle:M.lineStyle}function D(i){return M.taperedEdge?M.uniformLineWidth&&i>0?M.lineWidthEnd:Ie(i):Ne(i)}function X(i){return M.taperedEdge?M.lineWidthEnd:Ne(i)}function Ie(i){const l=M.lineWidthTaper,f=M.lineWidthStart*Math.pow(l,i);return Math.max(M.lineWidthEnd,f)}function Ne(i){if(i<=0)return M.lineWidthStart;if(i>=3)return M.lineWidthEnd;const l=i/3;return M.lineWidthStart+(M.lineWidthEnd-M.lineWidthStart)*l}function $e(i,l,f,N){const E=1-i,B=E*E*E*l.x+3*E*E*i*f.x1+3*E*i*i*f.x2+i*i*i*N.x,A=E*E*E*l.y+3*E*E*i*f.y1+3*E*i*i*f.y2+i*i*i*N.y;return{x:B,y:A}}function Ze(i,l,f,N){const E=1-i,B=E*E*l.x+2*E*i*f.x+i*i*N.x,A=E*E*l.y+2*E*i*f.y+i*i*N.y;return{x:B,y:A}}function St(i,l,f,N,E=32,B="curve",A="right"){if(B==="curve"){let v;if(A==="right"||A==="left"){const ae=Math.abs(l.x-i.x)*.45,he=A==="right"?1:-1;v={x1:i.x+he*ae,y1:i.y,x2:l.x-he*ae,y2:l.y}}else{const ae=Math.abs(l.y-i.y)*.45;v={x1:i.x,y1:i.y+ae,x2:l.x,y2:l.y-ae}}const Z=J=>{const ae=1-J,he=-3*ae*ae*i.x+3*(ae*ae-2*ae*J)*v.x1+3*(2*ae*J-J*J)*v.x2+3*J*J*l.x,Ae=-3*ae*ae*i.y+3*(ae*ae-2*ae*J)*v.y1+3*(2*ae*J-J*J)*v.y2+3*J*J*l.y;return{dx:he,dy:Ae}},H=[],ie=[];for(let J=0;J<=E;J++){const ae=J/E,he=J===0?i:J===E?l:$e(ae,i,v,l),Ae=Z(ae);let Me=Math.hypot(Ae.dx,Ae.dy);Me<1e-6&&(Me=1);const Le=-Ae.dy/Me,Q=Ae.dx/Me,ne=(f+(N-f)*ae)/2;H.push({x:he.x+Le*ne,y:he.y+Q*ne}),ie.push({x:he.x-Le*ne,y:he.y-Q*ne})}let T=`M ${H[0].x.toFixed(2)} ${H[0].y.toFixed(2)}`;for(let J=1;J<=E;J++)T+=` L ${H[J].x.toFixed(2)} ${H[J].y.toFixed(2)}`;for(let J=E;J>=0;J--)T+=` L ${ie[J].x.toFixed(2)} ${ie[J].y.toFixed(2)}`;return T+=" Z",T}if(B==="arc"){let v;A==="right"||A==="left"?v={x:(i.x+l.x)/2,y:l.y}:v={x:l.x,y:(i.y+l.y)/2};const Z=he=>{const Ae=1-he,Me=2*Ae*(v.x-i.x)+2*he*(l.x-v.x),Le=2*Ae*(v.y-i.y)+2*he*(l.y-v.y);return{dx:Me,dy:Le}},H=[],ie=[];for(let he=0;he<=E;he++){const Ae=he/E,Me=he===0?i:he===E?l:Ze(Ae,i,v,l),Le=Z(Ae);let Q=Math.hypot(Le.dx,Le.dy);Q<1e-6&&(Q=1);const ne=-Le.dy/Q,Pe=Le.dx/Q,Oe=(f+(N-f)*Ae)/2;H.push({x:Me.x+ne*Oe,y:Me.y+Pe*Oe}),ie.push({x:Me.x-ne*Oe,y:Me.y-Pe*Oe})}const T=f/2,J=N/2;let ae=`M ${H[0].x.toFixed(2)} ${H[0].y.toFixed(2)}`;for(let he=1;he<=E;he++)ae+=` L ${H[he].x.toFixed(2)} ${H[he].y.toFixed(2)}`;ae+=` A ${J.toFixed(2)} ${J.toFixed(2)} 0 0 0 ${ie[E].x.toFixed(2)} ${ie[E].y.toFixed(2)}`;for(let he=E-1;he>=0;he--)ae+=` L ${ie[he].x.toFixed(2)} ${ie[he].y.toFixed(2)}`;return ae+=` A ${T.toFixed(2)} ${T.toFixed(2)} 0 0 0 ${H[0].x.toFixed(2)} ${H[0].y.toFixed(2)}`,ae+=" Z",ae}if(B==="elbow"){const v=[];if(A==="down"){const Q=(i.y+l.y)/2;v.push(i,{x:i.x,y:Q},{x:l.x,y:Q},l)}else{const Q=(i.x+l.x)/2;v.push(i,{x:Q,y:i.y},{x:Q,y:l.y},l)}const Z=[];let H=0;for(let Q=0;Q<v.length-1;Q++){const ne=Math.hypot(v[Q+1].x-v[Q].x,v[Q+1].y-v[Q].y);Z.push(ne),H+=ne}const ie=[f/2];let T=0;for(let Q=0;Q<Z.length-1;Q++){T+=Z[Q];const ne=H>0?T/H:0;ie.push((f+(N-f)*ne)/2)}ie.push(N/2);const J=[];for(let Q=0;Q<v.length-1;Q++){const ne=v[Q+1].x-v[Q].x,Pe=v[Q+1].y-v[Q].y;let Oe=Math.hypot(ne,Pe);Oe<1e-6&&(Oe=1),J.push({x:-Pe/Oe,y:ne/Oe})}const ae=[],he=[];ae.push({x:v[0].x+J[0].x*ie[0],y:v[0].y+J[0].y*ie[0]}),he.push({x:v[0].x-J[0].x*ie[0],y:v[0].y-J[0].y*ie[0]});for(let Q=1;Q<v.length-1;Q++){const ne=J[Q-1],Pe=J[Q],Oe=ie[Q],gt=ne.x+Pe.x,K=ne.y+Pe.y,Te=gt*gt+K*K;if(Te<1e-6)ae.push({x:v[Q].x+ne.x*Oe,y:v[Q].y+ne.y*Oe}),he.push({x:v[Q].x-ne.x*Oe,y:v[Q].y-ne.y*Oe});else{const _e=2*Oe/Te;ae.push({x:v[Q].x+gt*_e,y:v[Q].y+K*_e}),he.push({x:v[Q].x-gt*_e,y:v[Q].y-K*_e})}}const Ae=J[J.length-1],Me=ie[ie.length-1];ae.push({x:v[v.length-1].x+Ae.x*Me,y:v[v.length-1].y+Ae.y*Me}),he.push({x:v[v.length-1].x-Ae.x*Me,y:v[v.length-1].y-Ae.y*Me});let Le=`M ${ae[0].x.toFixed(2)} ${ae[0].y.toFixed(2)}`;for(let Q=1;Q<ae.length;Q++)Le+=` L ${ae[Q].x.toFixed(2)} ${ae[Q].y.toFixed(2)}`;for(let Q=he.length-1;Q>=0;Q--)Le+=` L ${he[Q].x.toFixed(2)} ${he[Q].y.toFixed(2)}`;return Le+=" Z",Le}if(B==="rounded-elbow"&&!(A==="down"?Math.abs(i.x-l.x)<.5:Math.abs(i.y-l.y)<.5)){let Z=function(K,Te,_e){const bt={x:K.pos.x-Te*K.d1.x,y:K.pos.y-Te*K.d1.y},on={x:K.pos.x+Te*K.d2.x,y:K.pos.y+Te*K.d2.y},Rt={x:K.pos.x+Te*(K.d2.x-K.d1.x),y:K.pos.y+Te*(K.d2.y-K.d1.y)},kt=Math.atan2(bt.y-Rt.y,bt.x-Rt.x);let et=Math.atan2(on.y-Rt.y,on.x-Rt.x)-kt;for(;et>Math.PI;)et-=2*Math.PI;for(;et<-Math.PI;)et+=2*Math.PI;const Bt=[];for(let Ue=1;Ue<_e;Ue++){const rn=Ue/_e,qt=kt+et*rn;Bt.push({x:Rt.x+Te*Math.cos(qt),y:Rt.y+Te*Math.sin(qt)})}return Bt};const H=[];let ie;if(A==="down"){const K=(i.y+l.y)/2,Te=Math.sign(K-i.y)||1,_e=Math.sign(l.x-i.x)||1,bt=Math.sign(l.y-K)||1;ie=[{pos:{x:i.x,y:K},d1:{x:0,y:Te},d2:{x:_e,y:0}},{pos:{x:l.x,y:K},d1:{x:_e,y:0},d2:{x:0,y:bt}}]}else{const K=(i.x+l.x)/2,Te=Math.sign(K-i.x)||1,_e=Math.sign(l.y-i.y)||1,bt=Math.sign(l.x-K)||1;ie=[{pos:{x:K,y:i.y},d1:{x:Te,y:0},d2:{x:0,y:_e}},{pos:{x:K,y:l.y},d1:{x:0,y:_e},d2:{x:bt,y:0}}]}const T=Math.hypot(ie[1].pos.x-ie[0].pos.x,ie[1].pos.y-ie[0].pos.y),J=Math.hypot(l.x-ie[1].pos.x,l.y-ie[1].pos.y),ae=Math.min(T,J,M.elbowRadius)*.5,he=Math.max(2,ae);H.push(i),H.push(ie[0].pos),H.push({x:ie[1].pos.x-he*ie[1].d1.x,y:ie[1].pos.y-he*ie[1].d1.y});for(const K of Z(ie[1],he,12))H.push(K);H.push(l);const Ae=[];let Me=0;for(let K=0;K<H.length-1;K++){const Te=Math.hypot(H[K+1].x-H[K].x,H[K+1].y-H[K].y);Ae.push(Te),Me+=Te}const Le=[];for(let K=0;K<H.length-1;K++){const Te=H[K+1].x-H[K].x,_e=H[K+1].y-H[K].y;let bt=Math.hypot(Te,_e);bt<1e-6&&(bt=1),Le.push({x:-_e/bt,y:Te/bt})}const Q=[];let ne=0;for(let K=0;K<H.length;K++){K>0&&(ne+=Ae[K-1]);const Te=Me>0?ne/Me:0;Q.push((f+(N-f)*Te)/2)}const Pe=[],Oe=[];for(let K=0;K<H.length;K++){const Te=Q[K];if(K===0){const _e=Le[0];Pe.push({x:H[K].x+_e.x*Te,y:H[K].y+_e.y*Te}),Oe.push({x:H[K].x-_e.x*Te,y:H[K].y-_e.y*Te})}else if(K===H.length-1){const _e=Le[Le.length-1];Pe.push({x:H[K].x+_e.x*Te,y:H[K].y+_e.y*Te}),Oe.push({x:H[K].x-_e.x*Te,y:H[K].y-_e.y*Te})}else{const _e=Le[K-1],bt=Le[K],on=_e.x+bt.x,Rt=_e.y+bt.y,kt=on*on+Rt*Rt;if(kt<1e-6)Pe.push({x:H[K].x+_e.x*Te,y:H[K].y+_e.y*Te}),Oe.push({x:H[K].x-_e.x*Te,y:H[K].y-_e.y*Te});else{const Ye=2*Te/kt;Pe.push({x:H[K].x+on*Ye,y:H[K].y+Rt*Ye}),Oe.push({x:H[K].x-on*Ye,y:H[K].y-Rt*Ye})}}}let gt=`M ${Pe[0].x.toFixed(2)} ${Pe[0].y.toFixed(2)}`;for(let K=1;K<Pe.length;K++)gt+=` L ${Pe[K].x.toFixed(2)} ${Pe[K].y.toFixed(2)}`;gt+=` L ${Oe[Pe.length-1].x.toFixed(2)} ${Oe[Pe.length-1].y.toFixed(2)}`;for(let K=Oe.length-2;K>=0;K--)gt+=` L ${Oe[K].x.toFixed(2)} ${Oe[K].y.toFixed(2)}`;return gt+=" Z",gt}{const v=l.x-i.x,Z=l.y-i.y;let H=Math.hypot(v,Z);H<1e-6&&(H=1);const ie=-Z/H,T=v/H,J=f/2,ae=N/2,he={x:i.x+ie*J,y:i.y+T*J},Ae={x:i.x-ie*J,y:i.y-T*J},Me={x:l.x-ie*ae,y:l.y-T*ae},Le={x:l.x+ie*ae,y:l.y+T*ae};return`M ${he.x.toFixed(2)} ${he.y.toFixed(2)} L ${Le.x.toFixed(2)} ${Le.y.toFixed(2)} L ${Me.x.toFixed(2)} ${Me.y.toFixed(2)} L ${Ae.x.toFixed(2)} ${Ae.y.toFixed(2)} Z`}}const pt=e.computed(()=>ht.value.root.children),wo=mn[0].colors,Je=e.computed(()=>ja(M.branchPaletteId,M.customPalettes)),En=e.computed(()=>{const i=new Map;if(!M.rainbowBranch)return i;const l=r.lineColors,f=l&&l.length>0?l:Je.value.colors.length>0?Je.value.colors:wo;for(let E=0;E<pt.value.length;E++){const B=pt.value[E];i.set(B.id,f[E%f.length])}const N=(E,B)=>{i.set(E.id,B);for(const A of E.children)N(A,B)};for(let E=0;E<pt.value.length;E++){const B=pt.value[E];N(B,f[E%f.length])}return i});function No(i,l){return M.rainbowBranch?En.value.get(l.id)??Nt.value.lineColor:Nt.value.lineColor}function ql(i){const l=ee(i.id);if(l.bg)return l.bg;if(i.isRoot)return Nt.value.rootBg;if(i.depth>=3)return"transparent";const f=i.depth===1?.15:.08;if(M.rainbowBranch){const N=En.value.get(i.id);if(N)return Jl(N,f)}return Jl(Nt.value.rootBg,f)}function to(i){const l=ee(i.id);if(l.textColor)return l.textColor;if(i.isRoot)return Nt.value.rootText;if(M.rainbowBranch){const f=En.value.get(i.id);if(f)return bh(f,.55)}return Nt.value.branchText}function no(i){const l=ee(i.id);return l.borderColor?l.borderColor:"transparent"}function Xl(i){const l=ee(i.id);return l.fontWeight?l.fontWeight:i.isRoot?700:i.depth<=1?600:i.depth===2?500:400}function Zl(i){return ee(i.id).fontSize??i.fontSize??Nt.value.fontSize}function Jl(i,l){const f=i.replace("#",""),N=f.length===6?f:f.split("").map(v=>v+v).join(""),E=parseInt(N.slice(0,2),16),B=parseInt(N.slice(2,4),16),A=parseInt(N.slice(4,6),16);return`rgba(${E}, ${B}, ${A}, ${l})`}function bh(i,l){const f=i.replace("#",""),N=f.length===6?f:f.split("").map(v=>v+v).join(""),E=Math.round(parseInt(N.slice(0,2),16)*(1-l)),B=Math.round(parseInt(N.slice(2,4),16)*(1-l)),A=Math.round(parseInt(N.slice(4,6),16)*(1-l));return`rgb(${E}, ${B}, ${A})`}const ge=os({getContainer:()=>c.value});ge.setOnMarqueeEnd(Oh),rs({isEditing:()=>s.value!==null,isReadonly:()=>r.previewMode,getSelectedId:()=>p.value,getSelectedIds:()=>[...d.value],defaultTargetId:()=>m.value.id,onAddChild:oo,onAddSibling:ci,onAddSiblingBefore:Th,onRemove:ua,onStartEdit:So,onClearSelection:()=>{d.value=new Set,st()},onDuplicate:ia,onCopy:sa,onCut:ca,onPaste:da,hasClipboard:()=>!!I.value&&I.value.nodes.length>0,onUndo:Qi,onRedo:er,onNavigate:Ch,onMoveSibling:_h,onSelectRoot:()=>{d.value=new Set([m.value.id]),st()}});const ht=e.computed(()=>{const i=Ot(m.value);return ta(i),Ua(i,{mode:M.layoutMode,baseFontSize:Nt.value.fontSize,richHeights:P.value,richWidths:j.value,branchGap:M.branchGap})}),Ql=e.ref([]),cn=e.computed(()=>(_t.value,Ql.value));e.watch(ht,i=>{const l=[],f=N=>{l.push(N);for(const E of N.children)f(E)};f(i.root),Ql.value=l},{immediate:!0});const ea=e.computed(()=>{const i=[];for(const l of cn.value)for(const f of l.children)i.push({from:l,to:f,key:`${l.id}->${f.id}`});return i}),kh=e.computed(()=>`${ht.value.vbX} ${ht.value.vbY} ${ht.value.vbW} ${ht.value.vbH}`);function ta(i){if(b.value.has(i.id)){i.children=[],i.collapsed=!0;return}i.collapsed=!1;for(const l of i.children)ta(l)}function So(i){const l=be(m.value,i);l&&(s.value=i,u.value=l.text,d.value=new Set([i]),st(),e.nextTick(()=>{const f=document.querySelector(".zm-input");f==null||f.focus(),f==null||f.select(),na(f)}))}function Ji(){if(!s.value)return;const i=be(m.value,s.value);i&&i.text!==(u.value.trim()||" ")&&(i.text=u.value.trim()||" ",Ve(),a("change",m.value)),s.value=null}function yh(){s.value=null}function na(i){i&&(i.style.height="auto",i.style.height=i.scrollHeight+"px")}function xh(i){na(i.target)}function Eh(i){if(r.previewMode)return;const l=be(m.value,i);l!=null&&l.richContent&&(y.value=i,k.value=l.richContent.raw,e.nextTick(()=>{const f=document.querySelector(".zm-node .zm-rich textarea");f==null||f.focus()}))}function oa(){if(!y.value)return;const i=y.value,l=be(m.value,i),f=k.value;if(l&&l.richContent&&l.richContent.raw!==f)if(l.richContent.kind==="code"){const N=Tn(f)||void 0;ke(i,{kind:"code",raw:f,lang:N})}else ke(i,{kind:"table",raw:f});y.value=null}function wh(){y.value=null}function Nh(i){i.key==="Escape"?(i.preventDefault(),wh()):i.key==="Enter"&&(i.ctrlKey||i.metaKey)&&(i.preventDefault(),oa())}function Sh(i){const l=i.metaKey||i.ctrlKey;l&&(i.key==="z"||i.key==="Z")&&!i.shiftKey?(i.preventDefault(),Qi()):(l&&i.shiftKey&&(i.key==="z"||i.key==="Z")||l&&(i.key==="y"||i.key==="Y")&&!i.shiftKey)&&(i.preventDefault(),er())}function oo(i){const l=bi(m.value,i,zo);l&&(Ve(),Ee(),a("change",m.value),e.nextTick(()=>So(l.id)))}function ci(i){if(i===m.value.id){oo(i);return}const l=Er(m.value,i,zo);l&&(Ve(),Ee(),a("change",m.value),e.nextTick(()=>So(l.id)))}function Th(i){if(i===m.value.id){oo(i);return}const l=Ja(m.value,i,zo);l&&(Ve(),Ee(),a("change",m.value),e.nextTick(()=>So(l.id)))}function ia(i){if(i===m.value.id)return;const l=Qa(m.value,i);l&&(Ve(),d.value=new Set([l.id]),st(),a("change",m.value),Ee())}function ra(i){const l=[],f=new Set;for(const N of i)N!==m.value.id&&(f.has(N)||be(m.value,N)&&(f.add(N),l.push(N)));return l}function la(i){const l=new Set(i),f=[],N=E=>{l.has(E.id)&&f.push(E.id);for(const B of E.children)N(B)};return N(m.value),f}function aa(i){var l;try{(l=navigator.clipboard)==null||l.writeText(i)}catch{}}function sa(i){const l=la(ra(i));if(l.length===0)return;const f=[];for(const N of l){const E=wr(m.value,N);E&&f.push(E)}f.length!==0&&(I.value={nodes:f,originalIds:new Set(l)},aa(f.map(N=>N.text).join(`
135
- `)),Ee())}function ca(i){const l=la(ra(i));if(l.length===0)return;const f=[];for(const N of l){const E=wr(m.value,N);E&&f.push(E)}if(f.length!==0){Ve();for(const N of l)Bo(m.value,N);d.value=new Set,st(),I.value={nodes:f,originalIds:new Set(l)},aa(f.map(N=>N.text).join(`
136
- `)),Ee(),a("change",m.value)}}function da(i){const l=I.value;if(!l||l.nodes.length===0)return;const f=i??m.value.id,N=be(m.value,f);if(N){for(const E of l.originalIds){const B=be(m.value,E);if(B&&be(B,f))return}Ve();for(const E of l.nodes){const B=Ot(E);vo(B),N.children.push(B)}I.value=null,Ee(),a("change",m.value)}}function Qi(){const i=Kt.undo();i&&(m.value=i.data,d.value=new Set(i.selectedIds??[]),st(),Ee(),a("change",m.value))}function er(){const i=Kt.redo();i&&(m.value=i.data,d.value=new Set(i.selectedIds??[]),st(),Ee(),a("change",m.value))}function st(){const i=[];for(const l of d.value){const f=be(m.value,l);f&&i.push(f)}if(r.builtInDrawers&&!r.previewMode&&i.length>0){const l=i[0];!mt.value&&xa(l.id)&&(Ct(),mt.value=!0)}else r.builtInDrawers&&i.length===0&&(mt.value=!1);a("select",i.length>0?i:null)}function Ch(i,l){const f=p.value??m.value.id,N=be(m.value,f);if(!N)return;let E=null;if(l===1){const B=Dt(m.value,N.id);if(B){const A=B.children.findIndex(v=>v.id===N.id);A>=0&&A<B.children.length-1&&(E=B.children[A+1].id)}}else if(l===-1){const B=Dt(m.value,N.id);if(B){const A=B.children.findIndex(v=>v.id===N.id);A>0&&(E=B.children[A-1].id)}}else if(i===1){const B=Dt(m.value,N.id);B&&(E=B.id)}else i===-1&&N.children.length>0&&(E=N.children[0].id);E&&(d.value=new Set([E]),st())}function ua(i){if(i!==m.value.id&&Bo(m.value,i)){if(Ve(),d.value.has(i)){const l=new Set(d.value);l.delete(i),d.value=l,st()}Ee(),a("change",m.value)}}function fa(i){b.value.has(i)?b.value.delete(i):b.value.add(i),Ee()}function ma(i){const l=[{n:m.value,depth:1}];for(;l.length;){const{n:f,depth:N}=l.pop();i(f,N);for(let E=f.children.length-1;E>=0;E--)l.push({n:f.children[E],depth:N+1})}}function Mh(){b.value=new Set,ma(i=>{i.children.length>0&&b.value.add(i.id)}),Ee()}function pa(i){b.value=new Set,ma((l,f)=>{f>i&&l.children.length>0&&b.value.add(l.id)}),Ee()}function Ah(){b.value=new Set,Ee()}function ha(i,l){Za(m.value,i,l)&&(Ve(),Ee(),a("change",m.value))}function tr(i,l,f){return gi(m.value,i,l,f)?(Ve(),Ee(),a("change",m.value),!0):!1}function _h(i){const l=p.value;if(!l)return;const f=m.value;if(l===f.id)return;const N=Dt(f,l);if(!N)return;const E=N.children.findIndex(v=>v.id===l);if(E<0)return;let B=i;const A=cn.value.find(v=>v.id===l);if(A&&ba(A)&&(B=-i),B<0){if(E===0)return;const v=N.children[E-1].id;gi(f,l,v,"before")}else{if(E>=N.children.length-1)return;const v=N.children[E+1].id;gi(f,l,v,"after")}Ve(),Ee(),a("change",f)}function Rh(i,l){if(i.stopPropagation(),i.shiftKey){const f=new Set(d.value);f.has(l.id)?f.delete(l.id):f.add(l.id),d.value=f}else d.value=new Set([l.id]);st()}function Bh(i,l,f){let N=null;for(const E of cn.value){if(E.id===f)continue;const B=E.width/2,A=E.height/2;i>=E.x-B&&i<=E.x+B&&l>=E.y-A&&l<=E.y+A&&(N=E)}return N}let Yt=null;function vh(i,l){if(r.previewMode||l.isRoot||i.button!==0)return;const f=i.target;if(f!=null&&f.closest(".zm-img-resize-handle"))return;i.stopPropagation();const N=c.value.getBoundingClientRect(),E=l.x*ge.scale.value+ge.offsetX.value,B=l.y*ge.scale.value+ge.offsetY.value,A=i.clientX-N.left-E,v=i.clientY-N.top-B;Yt={srcId:l.id,srcText:l.text,pointerOffsetX:A,pointerOffsetY:v,startX:i.clientX,startY:i.clientY},window.addEventListener("pointermove",ga),window.addEventListener("pointerup",di),window.addEventListener("pointercancel",di)}function ga(i){if(Yt){const A=i.clientX-Yt.startX,v=i.clientY-Yt.startY;if(Math.abs(A)<=Kl&&Math.abs(v)<=Kl)return;w.value={srcId:Yt.srcId,srcText:Yt.srcText,pointerOffsetX:Yt.pointerOffsetX,pointerOffsetY:Yt.pointerOffsetY,currentTargetId:null,dropPosition:null},document.body.classList.add("is-dragging"),Yt=null}const l=w.value;if(!l)return;const f=c.value.getBoundingClientRect();V.value=i.clientX-f.left-l.pointerOffsetX,R.value=i.clientY-f.top-l.pointerOffsetY;const N=(i.clientX-f.left-ge.offsetX.value)/ge.scale.value,E=(i.clientY-f.top-ge.offsetY.value)/ge.scale.value,B=Bh(N,E,l.srcId);l.currentTargetId=(B==null?void 0:B.id)??null,B?l.dropPosition=zh(N,E,B):l.dropPosition=null}function zh(i,l,f){if(f.isRoot)return"child";const N=f.width/2,E=f.height/2;if(f._dir==="down"){const A=i-f.x;return A<-N*.3?"before":A>N*.3?"after":"child"}const B=l-f.y;return B<-E*.3?"before":B>E*.3?"after":"child"}function ba(i){var l;return!!((l=i.parent)!=null&&l.isRoot)&&i._dir==="left"}function di(i){if(window.removeEventListener("pointermove",ga),window.removeEventListener("pointerup",di),window.removeEventListener("pointercancel",di),Yt){Yt=null;return}const l=w.value;if(l){if(l.currentTargetId&&l.dropPosition){let f=l.dropPosition;if(f!=="child"){const N=cn.value.find(E=>E.id===l.currentTargetId);N&&ba(N)&&(f=f==="before"?"after":"before")}tr(l.srcId,l.currentTargetId,f),d.value=new Set([l.srcId]),st()}w.value=null,V.value=0,R.value=0,document.body.classList.remove("is-dragging")}}let ui=!1;function Ih(i){const l=i.target;if(!l||l.closest(".zm-node, .zm-toolbar, button, input, textarea"))return;if(i.button===2){ui=!0,ge.startPan(i);return}if(ui=!1,i.button!==0)return;const f=c.value.getBoundingClientRect(),N=(i.clientX-f.left-ge.offsetX.value)/ge.scale.value,E=(i.clientY-f.top-ge.offsetY.value)/ge.scale.value;ge.startMarquee(N,E,{shift:i.shiftKey})}function Lh(i){if(zn){zn=!1;return}const l=i.target;if(!l||l.closest(".zm-node"))return;const f=ge.marquee;f.width>=4||f.height>=4||d.value.size>0&&(d.value=new Set,st())}function Oh(){const i=ge.marquee;if(i.width<4&&i.height<4)return;const l=i.x,f=i.y,N=i.x+i.width,E=i.y+i.height,B=[];for(const A of cn.value){const v=A.width/2,Z=A.height/2,H=A.x-v,ie=A.x+v,T=A.y-Z,J=A.y+Z;H<=N&&ie>=l&&T<=E&&J>=f&&B.push(A.id)}d.value=i.shiftKey?new Set([...d.value,...B]):new Set(B),st()}function ka(i){return b.value.has(i)}function Dh(i){const l=be(m.value,i.id);return!!l&&l.children.length>0}function nr(i){const l=be(m.value,i);return l?Nr(l):0}function ya(i){if(!be(m.value,i))return 0;const N=[m.value];for(;N.length;){const E=N.pop(),B=E.children.findIndex(A=>A.id===i);if(B>=0)return B;for(const A of E.children)N.push(A)}return 0}function fi(i,l,f,N){const E=(N==null?void 0:N._dir)??i._dir;if(l==="out"&&i.isRoot&&M.lineOrigin==="center")return{x:i.x,y:i.y};if(l==="out"&&i.isRoot&&M.lineOrigin==="proportional"&&N){const v=ht.value.root.children;if(E==="down"){const ae=v.reduce((Le,Q)=>Math.max(Le,Math.abs(Q.x-i.x)),1),he=Math.min(1,Math.abs(N.x-i.x)/ae),Ae=i.y+i.height/2,Me=i.y;return{x:i.x,y:Ae+(Me-Ae)*he}}const Z=v.reduce((ae,he)=>Math.max(ae,Math.abs(he.y-i.y)),1),H=Math.min(1,Math.abs(N.y-i.y)/Z),ie=f!==void 0?f:i.side,T=i.x+ie*(i.width/2),J=i.x;return{x:T+(J-T)*H,y:i.y}}if(E==="down")return l==="out"?{x:i.x,y:i.y+i.height/2}:{x:i.x,y:i.y-i.height/2};let B;l==="in"?B=-i.side:f!==void 0?B=f:B=i.side;const A=l==="in"?i._richInsetX??0:0;return{x:i.x+B*(i.width/2-A),y:i.y}}function nn(){const i=ht.value;ge.resetView(i.width,i.height,i.root.y)}function Vh(){eo.value=!0,Ve(),Ee(),e.nextTick(()=>nn())}function or(i){M.layoutMode!==i&&(M.layoutMode=i,Ee(),e.nextTick(()=>nn()))}function $h(){return JSON.stringify(m.value,null,2)}function xa(i){const l=be(m.value,i);return l?!!(l.note&&l.note.text||l.link&&l.link.url||l.image&&l.image.src||l.richContent&&l.richContent.raw||l.markers&&l.markers.length>0||l.tags&&l.tags.length>0):!1}function Ph(i){try{const l=JSON.parse(i);return!l.id||!Array.isArray(l.children)?!1:(Kt.reset(),m.value=Ot(l),d.value=new Set,b.value=new Set,Ee(),e.nextTick(()=>nn()),a("change",m.value),!0)}catch{return!1}}const Ea=e.ref(""),dn=e.ref([]),To=e.ref(-1);function Fh(i){Ea.value=i;const l=i.trim();if(!l){dn.value=[],To.value=-1;return}const f=l.toLowerCase(),N=[],E=B=>{var A;(B.text.toLowerCase().includes(f)||(A=B.note)!=null&&A.text&&B.note.text.toLowerCase().includes(f))&&N.push(B.id);for(const v of B.children)E(v)};E(m.value),dn.value=N,To.value=N.length>0?0:-1,N.length>0&&(Gh(N),e.nextTick(()=>jh(0)))}function Uh(i){return dn.value.includes(i)}function Hh(i){return To.value>=0&&dn.value[To.value]===i}function Wh(i){return Ea.value.trim().length>0&&dn.value.length>0&&!dn.value.includes(i)}function Gh(i){if(i.length===0)return;const l=new Set(i),f=new Set,N=E=>{let B=l.has(E.id);for(const A of E.children)N(A)&&(B=!0);return B&&E.children.length>0&&b.value.has(E.id)&&f.add(E.id),B};if(N(m.value),f.size>0){for(const E of f)b.value.delete(E);Ee()}}function jh(i){const l=dn.value[i];if(!l)return;const f=cn.value.find(N=>N.id===l);f&&(d.value=new Set([l]),st(),ge.centerOn(f.x,f.y,f.width,f.height))}function Kh(i,l){const f=be(m.value,i);f&&(f.markers||(f.markers=[]),!f.markers.includes(l)&&(f.markers.push(l),Ve(),Ee(),a("change",m.value)))}function Yh(i,l){const f=be(m.value,i);if(!f||!f.markers)return;const N=f.markers.indexOf(l);N<0||(f.markers.splice(N,1),f.markers.length===0&&delete f.markers,Ve(),Ee(),a("change",m.value))}function wa(i,l){const f=be(m.value,i);if(!f)return!1;f.markers||(f.markers=[]);const N=f.markers.indexOf(l);return N>=0?(f.markers.splice(N,1),f.markers.length===0&&delete f.markers,Ve(),Ee(),a("change",m.value),!1):(f.markers.push(l),Ve(),Ee(),a("change",m.value),!0)}function qh(i){const l=be(m.value,i);return l!=null&&l.markers?[...l.markers]:[]}function Xh(i){var f;const l=(f=z.value)==null?void 0:f.nodeId;l&&wa(l,i)}function Zh(){var f;const i=(f=z.value)==null?void 0:f.nodeId;if(!i)return;const l=be(m.value,i);!l||!l.markers||(delete l.markers,Ve(),Ee(),a("change",m.value),ye())}function ir(i,l){const f=be(m.value,i);f&&(l.length===0?f.tags&&delete f.tags:f.tags=[...l],Ve(),Ee(),a("change",m.value))}function Jh(i){const l=be(m.value,i);return l!=null&&l.tags?[...l.tags]:[]}function Qh(){var B,A;const i=(B=z.value)==null?void 0:B.nodeId;if(!i)return;const l=be(m.value,i),f=((A=l==null?void 0:l.tags)==null?void 0:A.join(", "))??"",N=window.prompt("输入标签(多个用逗号分隔)",f);if(N===null)return;const E=N.split(/[,,]/).map(v=>v.trim()).filter(v=>v.length>0);ir(i,E),ye()}function eg(){var l;const i=(l=z.value)==null?void 0:l.nodeId;i&&(ir(i,[]),ye())}function Na(){const i=ht.value,l="http://www.w3.org/2000/svg",f=document.createElementNS(l,"svg");f.setAttribute("xmlns",l),f.setAttribute("viewBox",`${i.vbX} ${i.vbY} ${i.vbW} ${i.vbH}`),f.setAttribute("width",String(i.vbW)),f.setAttribute("height",String(i.vbH));const N=document.createElementNS(l,"rect");N.setAttribute("x",String(i.vbX)),N.setAttribute("y",String(i.vbY)),N.setAttribute("width",String(i.vbW)),N.setAttribute("height",String(i.vbH)),N.setAttribute("fill",tn.value),f.appendChild(N);for(const A of ea.value){const v=document.createElementNS(l,"path");v.setAttribute("d",St(fi(A.from,"out",A.to.side,A.to),fi(A.to,"in"),D(A.from.depth),X(A.to.depth),32,g(A.from.isRoot),A.to._dir)),v.setAttribute("fill",No(A.from,A.to)),v.setAttribute("stroke","none"),f.appendChild(v)}const E="-apple-system,BlinkMacSystemFont,'Segoe UI','PingFang SC','Microsoft YaHei',sans-serif";function B(A,v){let Z=0;for(const H of A)/[\u4e00-\u9fff\u3000-\u30ff\uff00-\uffef]/.test(H)?Z+=v:Z+=v*.55;return Z}for(const A of cn.value){const v=A.x-A.width/2,Z=A.y-A.height/2,H=document.createElementNS(l,"rect");H.setAttribute("x",String(v)),H.setAttribute("y",String(Z)),H.setAttribute("width",String(A.width)),H.setAttribute("height",String(A.height)),H.setAttribute("rx","8"),H.setAttribute("fill",ql(A));const ie=no(A);ie!=="transparent"&&(H.setAttribute("stroke",ie),H.setAttribute("stroke-width","1")),f.appendChild(H);const T=!!(A.tags&&A.tags.length>0),J=!!(A.markers&&A.markers.length>0),ae=!!A.image,he=!!(A.richContent&&(A.richContent.kind==="code"||A.richContent.kind==="table"));let Ae=0,Me=0;if(he){const Ye=A.richContent,et=A.fontSize*.78*.92,Bt=6,Ue=4,rn=2,qt=6;if(Ye.kind==="code"){const vt=jo(Ye.raw),Tt=Tn(Ye.raw),zt=vt.split(`
137
- `),ln=et*1.35;let Ht=0;for(const We of zt)Ht=Math.max(Ht,B(We,et));Me=Math.min(Ht+Bt*2+4,A.width-4),Ae=zt.length*ln+Ue*2+rn;const tt=A.x-Me/2;let yt=Z+4;ae&&(yt=Z+A.image.height+qt);const It=document.createElementNS(l,"rect");if(It.setAttribute("x",String(tt)),It.setAttribute("y",String(yt)),It.setAttribute("width",String(Me)),It.setAttribute("height",String(Ae-rn)),It.setAttribute("rx","6"),It.setAttribute("fill","rgba(255,255,255,0.55)"),It.setAttribute("stroke",no(A)),It.setAttribute("stroke-width","1"),f.appendChild(It),Tt){const We=document.createElementNS(l,"text");We.setAttribute("x",String(tt+Me-Bt)),We.setAttribute("y",String(yt+Ue+4)),We.setAttribute("text-anchor","end"),We.setAttribute("fill",to(A)),We.setAttribute("font-size",String(et*.8)),We.setAttribute("font-family",E),We.setAttribute("opacity","0.5"),We.textContent=Tt,f.appendChild(We)}const Mo="'JetBrains Mono','Fira Code',Consolas,monospace";for(let We=0;We<zt.length;We++){const ct=document.createElementNS(l,"text");ct.setAttribute("x",String(tt+Bt)),ct.setAttribute("y",String(yt+Ue+(We+.5)*ln+2)),ct.setAttribute("dominant-baseline","central"),ct.setAttribute("fill",to(A)),ct.setAttribute("font-size",String(et)),ct.setAttribute("font-family",Mo);let Wt=zt[We];const qe=Math.floor((Me-Bt*2)/(et*.6));Wt.length>qe&&(Wt=Wt.substring(0,qe-1)+"…"),ct.textContent=Wt,f.appendChild(ct)}}else if(Ye.kind==="table"){const vt=Ri(Ye.raw);if(vt.length>0){const Tt=et*1.35,zt=6,ln=3,Ht=vt[0].length,tt=[];for(let qe=0;qe<Ht;qe++){let un=0;for(const wn of vt)qe<wn.length&&(un=Math.max(un,B(wn[qe],et)));tt.push(un+zt*2)}Me=Math.min(tt.reduce((qe,un)=>qe+un,0),A.width-4);const yt=Me/tt.reduce((qe,un)=>qe+un,0);for(let qe=0;qe<Ht;qe++)tt[qe]*=yt;Ae=vt.length*(Tt+ln*2)+rn;const It=A.x-Me/2;let Mo=Z+4;ae&&(Mo=Z+A.image.height+qt);const We=document.createElementNS(l,"rect");We.setAttribute("x",String(It)),We.setAttribute("y",String(Mo)),We.setAttribute("width",String(Me)),We.setAttribute("height",String(Ae-rn)),We.setAttribute("rx","6"),We.setAttribute("fill","rgba(255,255,255,0.55)"),We.setAttribute("stroke",no(A)),We.setAttribute("stroke-width","1"),f.appendChild(We);let ct=It,Wt=Mo;for(let qe=0;qe<vt.length;qe++){const un=vt[qe],wn=Tt+ln*2;ct=It;for(let Ao=0;Ao<Ht;Ao++){const io=tt[Ao],tg=un[Ao]||"";if(Ao<Ht-1){const Xe=document.createElementNS(l,"line");Xe.setAttribute("x1",String(ct+io)),Xe.setAttribute("y1",String(Wt)),Xe.setAttribute("x2",String(ct+io)),Xe.setAttribute("y2",String(Wt+wn)),Xe.setAttribute("stroke",no(A)),Xe.setAttribute("stroke-width","1"),f.appendChild(Xe)}if(qe<vt.length-1){const Xe=document.createElementNS(l,"line");Xe.setAttribute("x1",String(ct)),Xe.setAttribute("y1",String(Wt+wn)),Xe.setAttribute("x2",String(ct+io)),Xe.setAttribute("y2",String(Wt+wn)),Xe.setAttribute("stroke",no(A)),Xe.setAttribute("stroke-width","1"),f.appendChild(Xe)}if(qe===0){const Xe=document.createElementNS(l,"rect");Xe.setAttribute("x",String(ct)),Xe.setAttribute("y",String(Wt)),Xe.setAttribute("width",String(io)),Xe.setAttribute("height",String(wn)),Xe.setAttribute("fill","rgba(255,255,255,0.4)"),f.appendChild(Xe)}const fn=document.createElementNS(l,"text");fn.setAttribute("x",String(ct+zt)),fn.setAttribute("y",String(Wt+ln+Tt/2+2)),fn.setAttribute("dominant-baseline","central"),fn.setAttribute("fill",to(A)),fn.setAttribute("font-size",String(et)),fn.setAttribute("font-family",E),qe===0&&fn.setAttribute("font-weight","600");let mi=tg;const rr=Math.floor((io-zt*2)/(et*.55));mi.length>rr&&rr>2&&(mi=mi.substring(0,rr-1)+"…"),fn.textContent=mi,f.appendChild(fn),ct+=io}Wt+=wn}}}}let Le=0;if(ae){const Ye=A.image,et=Z+4,Bt=A.x-Ye.width/2,Ue=document.createElementNS(l,"image");Ue.setAttribute("x",String(Bt)),Ue.setAttribute("y",String(et)),Ue.setAttribute("width",String(Ye.width)),Ue.setAttribute("height",String(Ye.height)),Ue.setAttribute("href",Ye.src),Ue.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",Ye.src),Ue.setAttribute("preserveAspectRatio","xMidYMid meet"),f.appendChild(Ue),Le=Ye.height+6}let Q=A.y;const ne=Le+Ae;ne>0?Q=Z+ne+(A.height-ne)/2:T&&(Q=A.y-8);const Pe=14,Oe=2,gt=4,K=J?A.markers.length:0,Te=K>0?K*Pe+(K-1)*Oe+gt:0,_e=B(A.text,A.fontSize),bt=Te+_e,on=A.x-bt/2;if(J){let Ye=on;for(const et of A.markers){const Bt=Lo(et);if(Bt){const Ue=document.createElementNS(l,"svg");Ue.setAttribute("x",String(Ye)),Ue.setAttribute("y",String(Q-Pe/2)),Ue.setAttribute("width",String(Pe)),Ue.setAttribute("height",String(Pe)),Ue.setAttribute("viewBox","0 0 24 24"),Ue.setAttribute("color",to(A));const qt=new DOMParser().parseFromString(`<svg xmlns="${l}">${Bt}</svg>`,"image/svg+xml");if(!qt.querySelector("parsererror"))for(;qt.documentElement.firstChild;)Ue.appendChild(qt.documentElement.firstChild);f.appendChild(Ue)}Ye+=Pe+Oe}}const Rt=J?on+Te+_e/2:A.x,kt=document.createElementNS(l,"text");if(kt.setAttribute("x",String(Rt)),kt.setAttribute("y",String(Q)),kt.setAttribute("text-anchor","middle"),kt.setAttribute("dominant-baseline","central"),kt.setAttribute("fill",to(A)),kt.setAttribute("font-size",String(Zl(A))),kt.setAttribute("font-weight",String(Xl(A))),kt.setAttribute("font-family",E),kt.textContent=A.text,f.appendChild(kt),T){const Ue=A.y+10,rn=A.tags.map(Tt=>B(Tt,10)+12),qt=rn.reduce((Tt,zt)=>Tt+zt+3,-3);let vt=A.x-qt/2;for(let Tt=0;Tt<A.tags.length;Tt++){const zt=A.tags[Tt],ln=yi(zt),Ht=rn[Tt],tt=document.createElementNS(l,"rect");tt.setAttribute("x",String(vt)),tt.setAttribute("y",String(Ue-16/2)),tt.setAttribute("width",String(Ht)),tt.setAttribute("height",String(16)),tt.setAttribute("rx",String(16/2)),tt.setAttribute("fill",ln.background),tt.setAttribute("stroke",ln.borderColor),tt.setAttribute("stroke-width","1"),f.appendChild(tt);const yt=document.createElementNS(l,"text");yt.setAttribute("x",String(vt+Ht/2)),yt.setAttribute("y",String(Ue)),yt.setAttribute("text-anchor","middle"),yt.setAttribute("dominant-baseline","central"),yt.setAttribute("fill",ln.color),yt.setAttribute("font-size",String(10)),yt.setAttribute("font-family",E),yt.textContent=zt,f.appendChild(yt),vt+=Ht+3}}}return f}function Co(){const i=Na();let f=new XMLSerializer().serializeToString(i);f.startsWith("<?xml")||(f=`<?xml version="1.0" encoding="UTF-8"?>
138
- `+f);const N=new Blob([f],{type:"image/svg+xml;charset=utf-8"}),E=URL.createObjectURL(N),B=document.createElement("a");B.href=E,B.download=`${m.value.text||"mindmap"}.svg`,B.click(),URL.revokeObjectURL(E)}function Sa(i=2){const l=Na(),f=ht.value;let E=new XMLSerializer().serializeToString(l);E.startsWith("<?xml")||(E=`<?xml version="1.0" encoding="UTF-8"?>
139
- `+E);const B=new Blob([E],{type:"image/svg+xml;charset=utf-8"}),A=URL.createObjectURL(B),v=new window.Image;v.onload=()=>{const Z=document.createElement("canvas");Z.width=Math.ceil(f.vbW*i),Z.height=Math.ceil(f.vbH*i);const H=Z.getContext("2d");if(!H){URL.revokeObjectURL(A);return}H.fillStyle=tn.value,H.fillRect(0,0,Z.width,Z.height),H.drawImage(v,0,0,Z.width,Z.height),URL.revokeObjectURL(A);try{Z.toBlob(ie=>{if(!ie){Co();return}const T=URL.createObjectURL(ie),J=document.createElement("a");J.href=T,J.download=`${m.value.text||"mindmap"}.png`,J.click(),URL.revokeObjectURL(T)},"image/png")}catch(ie){console.warn("PNG export failed, falling back to SVG:",ie),Co()}},v.onerror=()=>{URL.revokeObjectURL(A),Co()},v.src=A}return o({addChild:i=>oo(i),addSibling:i=>ci(i),removeNode:i=>ua(i),duplicateNode:i=>ia(i),setNodeText:(i,l)=>ha(i,l),moveNode:(i,l,f)=>tr(i,l,f),lineWidthForDepth:D,endWidthForDepth:X,getData:()=>m.value,nodeHasContent:i=>xa(i),getSelectedIds:()=>[...d.value],copyNodes:i=>sa(i),cutNodes:i=>ca(i),pasteNodes:i=>da(i),setData:i=>{Kt.reset(),m.value=Ot(i),d.value=new Set,b.value=new Set,Ee(),Ve(),e.nextTick(()=>nn())},resetView:()=>nn(),exportData:$h,importData:Ph,getMarkdown:()=>Dn(m.value),setMarkdown:(i,l=!0)=>{const f=On(i||"");l&&(Y.value=!0),x=!l,Kt.reset(),m.value=Ot(f),d.value=new Set,b.value=new Set,Ee(),Ve(),e.nextTick(()=>{x=!1,nn()}),a("change",m.value)},setBalanced:i=>{eo.value=i},isBalanced:()=>eo.value,balance:()=>Vh(),applyNodeStyle:(i,l)=>we(i,l),getNodeStyle:i=>ee(i),applyNodeImage:(i,l)=>ce(i,l),applyNodeImageByUrl:(i,l)=>h(i,l),removeNodeImage:i=>ue(i),applyNodeLink:(i,l)=>fe(i,l),removeNodeLink:i=>O(i),applyNodeNote:(i,l)=>L(i,l),removeNodeNote:i=>se(i),applyNodeRichContent:(i,l)=>ke(i,l),addNodeMarker:(i,l)=>Kh(i,l),removeNodeMarker:(i,l)=>Yh(i,l),toggleNodeMarker:(i,l)=>wa(i,l),getNodeMarkers:i=>qh(i),setNodeTags:(i,l)=>ir(i,l),getNodeTags:i=>Jh(i),exportPNG:i=>Sa(i),exportSVG:()=>Co(),searchNodes:i=>(Fh(i),[...dn.value]),undo:()=>Qi(),redo:()=>er(),canUndo:()=>Kt.canUndo(),canRedo:()=>Kt.canRedo(),applySettings:i=>{i.autoBalanceOnChange!==void 0&&(M.autoBalanceOnChange=i.autoBalanceOnChange),i.lineWidthStart!==void 0&&(M.lineWidthStart=Math.max(.5,Math.min(20,i.lineWidthStart))),i.lineWidthEnd!==void 0&&(M.lineWidthEnd=Math.max(.3,Math.min(10,i.lineWidthEnd))),i.rainbowBranch!==void 0&&(M.rainbowBranch=i.rainbowBranch),i.branchPaletteId!==void 0&&(M.branchPaletteId=i.branchPaletteId),i.customPalettes!==void 0&&(M.customPalettes=i.customPalettes),i.lineStyle!==void 0&&(M.lineStyle=i.lineStyle),i.rootLineStyle!==void 0&&(M.rootLineStyle=i.rootLineStyle),i.lineOrigin!==void 0&&(M.lineOrigin=i.lineOrigin),i.taperedEdge!==void 0&&(M.taperedEdge=i.taperedEdge),i.lineWidthTaper!==void 0&&(M.lineWidthTaper=Math.max(.1,Math.min(1,i.lineWidthTaper))),i.uniformLineWidth!==void 0&&(M.uniformLineWidth=i.uniformLineWidth),i.elbowRadius!==void 0&&(M.elbowRadius=Math.max(2,Math.min(40,i.elbowRadius))),i.showOrderBadge!==void 0&&(M.showOrderBadge=i.showOrderBadge),i.canvasBg!==void 0&&(M.canvasBg=i.canvasBg),i.branchGap!==void 0&&(M.branchGap=Math.max(0,Math.min(80,i.branchGap))),i.layoutMode!==void 0&&M.layoutMode!==i.layoutMode&&(M.layoutMode=i.layoutMode,Ee(),e.nextTick(()=>nn()))},getSettings:()=>({autoBalanceOnChange:M.autoBalanceOnChange,lineWidthStart:M.lineWidthStart,lineWidthEnd:M.lineWidthEnd,rainbowBranch:M.rainbowBranch,branchPaletteId:M.branchPaletteId,customPalettes:M.customPalettes,lineStyle:M.lineStyle,rootLineStyle:M.rootLineStyle,lineOrigin:M.lineOrigin,layoutMode:M.layoutMode,taperedEdge:M.taperedEdge,lineWidthTaper:M.lineWidthTaper,uniformLineWidth:M.uniformLineWidth,elbowRadius:M.elbowRadius,showOrderBadge:M.showOrderBadge,canvasBg:M.canvasBg,branchGap:M.branchGap}),setBranchPalette:i=>{if(!i)return;[...mn,...M.customPalettes].find(f=>f.id===i)&&(M.branchPaletteId=i)},getBranchPalette:()=>M.branchPaletteId,getBranchPalettes:()=>[...mn,...M.customPalettes],getSearchResults:()=>[...dn.value],getSearchIndex:()=>To.value}),e.watch(()=>r.data,i=>{m.value=Ot(i),Ee()},{deep:!1}),e.onMounted(()=>{Ve(),e.nextTick(()=>nn())}),(i,l)=>{var f,N,E,B,A,v,Z,H,ie;return e.openBlock(),e.createElementBlock("div",{class:"zm-mindmap",style:e.normalizeStyle({background:tn.value,fontSize:Nt.value.fontSize+"px"})},[e.createElementVNode("div",{ref_key:"wrapperRef",ref:c,class:"zm-canvas",onMousedown:Ih,onContextmenu:nt,onWheel:l[26]||(l[26]=(...T)=>e.unref(ge).onWheel&&e.unref(ge).onWheel(...T)),onMouseenter:l[27]||(l[27]=T=>C.value=!0),onMouseleave:l[28]||(l[28]=T=>C.value=!1),onClick:Lh},[e.createElementVNode("div",{class:"zm-svg-layer",style:e.normalizeStyle({left:ht.value.vbX*e.unref(ge).scale.value+e.unref(ge).offsetX.value+"px",top:ht.value.vbY*e.unref(ge).scale.value+e.unref(ge).offsetY.value+"px",width:ht.value.vbW*e.unref(ge).scale.value+"px",height:ht.value.vbH*e.unref(ge).scale.value+"px"})},[(e.openBlock(),e.createElementBlock("svg",{class:"zm-svg",viewBox:kh.value,preserveAspectRatio:"xMinYMin meet",width:ht.value.vbW*e.unref(ge).scale.value,height:ht.value.vbH*e.unref(ge).scale.value},[e.createElementVNode("g",Hp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ea.value,T=>(e.openBlock(),e.createElementBlock("path",{key:T.key,d:St(fi(T.from,"out",T.to.side,T.to),fi(T.to,"in"),D(T.from.depth),X(T.to.depth),32,g(T.from.isRoot),T.to._dir),fill:No(T.from,T.to),stroke:"none"},null,8,Wp))),128))])],8,Up))],4),e.unref(ge).isMarquee.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-marquee",style:e.normalizeStyle({left:e.unref(ge).marquee.x*e.unref(ge).scale.value+e.unref(ge).offsetX.value+"px",top:e.unref(ge).marquee.y*e.unref(ge).scale.value+e.unref(ge).offsetY.value+"px",width:e.unref(ge).marquee.width*e.unref(ge).scale.value+"px",height:e.unref(ge).marquee.height*e.unref(ge).scale.value+"px"})},null,4)):e.createCommentVNode("",!0),w.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"zm-drag-ghost",style:e.normalizeStyle({left:V.value+"px",top:R.value+"px",transform:`scale(${e.unref(ge).scale.value})`,transformOrigin:"top left"})},e.toDisplayString(w.value.srcText),5)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"zm-world",style:e.normalizeStyle({transform:`translate(${e.unref(ge).offsetX.value}px, ${e.unref(ge).offsetY.value}px) scale(${e.unref(ge).scale.value})`})},[U.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-drop-indicator",style:e.normalizeStyle({left:U.value.x1+"px",top:U.value.y1+"px",width:U.value.horizontal?U.value.x2-U.value.x1+"px":"3px",height:U.value.horizontal?"3px":U.value.y2-U.value.y1+"px",transform:U.value.horizontal?"translateY(-1.5px)":"translateX(-1.5px)"})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(cn.value,T=>{var J,ae,he,Ae,Me,Le,Q;return e.openBlock(),e.createElementBlock("div",{key:T.id,class:e.normalizeClass(["zm-node",{"is-root":T.isRoot,"is-selected":p.value===T.id,"is-selected-secondary":p.value!==T.id&&d.value.has(T.id),"is-editing":s.value===T.id,"has-image":!!T.image,"is-resizing":Zi.value===T.id,"is-dragging-source":((J=w.value)==null?void 0:J.srcId)===T.id,"is-drop-target":((ae=w.value)==null?void 0:ae.currentTargetId)===T.id&&((he=w.value)==null?void 0:he.dropPosition)==="child","is-drop-target-before":((Ae=w.value)==null?void 0:Ae.currentTargetId)===T.id&&((Me=w.value)==null?void 0:Me.dropPosition)==="before","is-drop-target-after":((Le=w.value)==null?void 0:Le.currentTargetId)===T.id&&((Q=w.value)==null?void 0:Q.dropPosition)==="after","is-search-hit":Uh(T.id),"is-search-current":Hh(T.id),"is-search-dimmed":Wh(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:Zl(T)+"px",background:ql(T),color:to(T),borderColor:no(T),fontWeight:Xl(T),transform:"translate(-50%, -50%)"}),onClick:ne=>Rh(ne,T),onPointerdown:ne=>vh(ne,T),onDblclick:ne=>{ne.stopPropagation(),t.previewMode||So(T.id)},onContextmenu:ne=>te(ne,T),onMouseenter:ne=>{Jn(T.id),Qn(ne,T)},onMouseleave:ne=>xn(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,jp)):e.createCommentVNode("",!0),T.richContent&&(T.richContent.kind==="code"||T.richContent.kind==="table")&&s.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:l[1]||(l[1]=e.withModifiers(()=>{},["stop"])),onDblclick:e.withModifiers(ne=>Eh(T.id),["stop"]),onMousedown:l[2]||(l[2]=e.withModifiers(()=>{},["stop"]))},[y.value===T.id?e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:0,"onUpdate:modelValue":l[0]||(l[0]=ne=>k.value=ne),class:"zm-rich-edit",spellcheck:"false",onBlur:oa,onKeydown:Nh},null,544)),[[e.vModelText,k.value]]):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[T.richContent.kind==="code"?(e.openBlock(),e.createElementBlock("pre",Yp,[e.createElementVNode("code",{innerHTML:e.unref(_i)(e.unref(jo)(T.richContent.raw),e.unref(Tn)(T.richContent.raw))},null,8,qp)])):T.richContent.kind==="table"?(e.openBlock(),e.createElementBlock("table",Xp,[e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(Ri)(T.richContent.raw),(ne,Pe)=>(e.openBlock(),e.createElementBlock("tr",{key:Pe},[Pe===0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(ne,(Oe,gt)=>(e.openBlock(),e.createElementBlock("th",{key:`h${gt}`},e.toDisplayString(Oe),1))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(ne,(Oe,gt)=>(e.openBlock(),e.createElementBlock("td",{key:`c${gt}`},e.toDisplayString(Oe),1))),128))]))),128))])])):e.createCommentVNode("",!0)],64))],42,Kp)):e.createCommentVNode("",!0),s.value!==T.id?(e.openBlock(),e.createElementBlock("span",Zp,[T.markers&&T.markers.length>0?(e.openBlock(),e.createElementBlock("span",Jp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.markers,ne=>(e.openBlock(),e.createElementBlock("span",{key:ne,class:"zm-node-marker",title:e.unref(Tr)(ne),innerHTML:'<svg viewBox="0 0 24 24" width="14" height="14">'+e.unref(Lo)(ne)+"</svg>"},null,8,Qp))),128))])):e.createCommentVNode("",!0),e.createElementVNode("span",eh,e.toDisplayString(T.text),1),T.link&&s.value!==T.id?(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:l[3]||(l[3]=e.withModifiers(()=>{},["stop"])),onMousedown:l[4]||(l[4]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(ve,{name:"link",size:11,stroke:2})],40,th)):e.createCommentVNode("",!0),T.note&&s.value!==T.id?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-node-note-btn",type:"button",title:ai(T.note.text),onClick:e.withModifiers(ne=>li(T.id),["stop"]),onMousedown:l[5]||(l[5]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(ve,{name:"note",size:11,stroke:2})],40,nh)):e.createCommentVNode("",!0)])):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:3,class:"zm-input","onUpdate:modelValue":l[6]||(l[6]=ne=>u.value=ne),autofocus:"",rows:"1",onBlur:l[7]||(l[7]=ne=>Ji()),onKeydown:[l[8]||(l[8]=e.withKeys(e.withModifiers(ne=>Ji(),["exact","prevent"]),["enter"])),l[9]||(l[9]=e.withKeys(e.withModifiers(ne=>Ji(),["prevent"]),["tab"])),e.withKeys(yh,["esc"]),Sh],onInput:xh,onMousedown:l[10]||(l[10]=e.withModifiers(()=>{},["stop"])),onClick:l[11]||(l[11]=e.withModifiers(()=>{},["stop"]))},null,544)),[[e.vModelText,u.value]]),T.tags&&T.tags.length>0&&s.value!==T.id?(e.openBlock(),e.createElementBlock("div",oh,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.tags,ne=>(e.openBlock(),e.createElementBlock("span",{key:ne,class:"zm-node-tag",style:e.normalizeStyle(e.unref(yi)(ne))},e.toDisplayString(ne),5))),128))])):e.createCommentVNode("",!0),re.value?(e.openBlock(),e.createElementBlock("span",{key:5,class:"zm-order-badge",title:`数据顺序:第 ${ya(T.id)+1} 个`},e.toDisplayString(ya(T.id)+1),9,ih)):e.createCommentVNode("",!0),ka(T.id)&&nr(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:En.value.get(T.id)??"#64748b"}),title:`展开 ${nr(T.id)} 个子节点`,onMousedown:l[12]||(l[12]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(ne=>fa(T.id),["stop"])},e.toDisplayString(nr(T.id)),47,rh)):e.createCommentVNode("",!0),Dh(T)&&!ka(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({"--zm-collapse-color":En.value.get(T.id)??"#64748b"}),title:"折叠",onMousedown:l[13]||(l[13]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(ne=>fa(T.id),["stop"])},[...l[36]||(l[36]=[e.createElementVNode("span",{class:"zm-collapse-bar"},null,-1)])],46,lh)):e.createCommentVNode("",!0),T.image&&p.value===T.id&&s.value!==T.id?(e.openBlock(),e.createElementBlock("span",{key:8,class:"zm-img-resize-handle",title:"拖动调整图片大小",onMousedown:e.withModifiers(ne=>At(ne,T),["stop"])},null,40,ah)):e.createCommentVNode("",!0),T.image&&p.value===T.id&&s.value!==T.id?(e.openBlock(),e.createElementBlock("button",{key:9,class:"zm-img-remove-btn",title:"移除图片",onMousedown:l[14]||(l[14]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(ne=>ue(T.id),["stop"])},[e.createVNode(ve,{name:"x",size:10,stroke:2.2})],40,sh)):e.createCommentVNode("",!0)],46,Gp)}),128))],4),_.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["zm-tooltip",{"is-below":!_.value.above}]),style:e.normalizeStyle({left:_.value.x+"px",top:_.value.y+"px"})},e.toDisplayString(_.value.text),7)):e.createCommentVNode("",!0),z.value?(e.openBlock(),e.createBlock(bs,{key:3,x:z.value.x,y:z.value.y,container:c.value,"has-image":!!((f=e.unref(be)(m.value,z.value.nodeId))!=null&&f.image),"has-link":!!((N=e.unref(be)(m.value,z.value.nodeId))!=null&&N.link),"has-note":!!((E=e.unref(be)(m.value,z.value.nodeId))!=null&&E.note),"has-code":((A=(B=e.unref(be)(m.value,z.value.nodeId))==null?void 0:B.richContent)==null?void 0:A.kind)==="code","has-table":((Z=(v=e.unref(be)(m.value,z.value.nodeId))==null?void 0:v.richContent)==null?void 0:Z.kind)==="table","node-markers":((H=e.unref(be)(m.value,z.value.nodeId))==null?void 0:H.markers)??[],"node-tags":((ie=e.unref(be)(m.value,z.value.nodeId))==null?void 0:ie.tags)??[],onPickImage:bo,onRemoveImage:vn,onSetLink:Yi,onRemoveLink:ko,onEditNote:yo,onRemoveNote:qi,onAddCode:ri,onEditCode:ri,onRemoveCode:Xi,onAddTable:je,onEditTable:je,onRemoveTable:kn,onToggleMarker:Xh,onClearMarkers:Zh,onAddTag:Qh,onRemoveTags:eg,onClose:ye},null,8,["x","y","container","has-image","has-link","has-note","has-code","has-table","node-markers","node-tags"])):e.createCommentVNode("",!0),S.value?(e.openBlock(),e.createBlock(ks,{key:4,x:S.value.x,y:S.value.y,container:c.value,onOpenSettings:ot,onOpenData:an,onOpenImport:it,onExportPng:Sa,onExportSvg:Co,onClose:ft},null,8,["x","y","container"])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(F.value),title:r.previewMode?"退出预览模式":"进入预览模式",onClick:l[15]||(l[15]=T=>a("canvas-toggle-preview"))},[e.createVNode(ve,{name:r.previewMode?"eye-off":"eye",size:16},null,8,["name"])],10,ch),e.createElementVNode("button",{class:e.normalizeClass(W.value),title:"显示大纲视图",onClick:go},[e.createVNode(ve,{name:"outline",size:16})],2),e.createElementVNode("div",{class:e.normalizeClass(["zm-toolbar",{"is-preview-only":r.previewMode,"is-hovered":C.value}])},[e.createElementVNode("span",{class:"zm-tb-tip zm-tb-zoom",title:"点击重置为 100%",onClick:l[16]||(l[16]=T=>e.unref(ge).zoomTo100())},e.toDisplayString(Math.round(e.unref(ge).scale.value*100))+"%",1),e.createElementVNode("button",{class:"zm-tb-btn",title:"放大",onClick:l[17]||(l[17]=(...T)=>e.unref(ge).zoomIn&&e.unref(ge).zoomIn(...T))},[e.createVNode(ve,{name:"zoom-in"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"缩小",onClick:l[18]||(l[18]=(...T)=>e.unref(ge).zoomOut&&e.unref(ge).zoomOut(...T))},[e.createVNode(ve,{name:"zoom-out"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"重置视图",onClick:nn},[e.createVNode(ve,{name:"reset"})]),l[39]||(l[39]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"全部收起",onClick:Mh},[e.createVNode(ve,{name:"collapse-all"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"展开一级",onClick:l[19]||(l[19]=T=>pa(1))},[e.createVNode(ve,{name:"expand-level-1"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"展开二级",onClick:l[20]||(l[20]=T=>pa(2))},[e.createVNode(ve,{name:"expand-level-2"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"全部展开",onClick:Ah},[e.createVNode(ve,{name:"expand-all"})]),r.previewMode?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[l[37]||(l[37]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"添加子节点 (Tab)",onClick:l[21]||(l[21]=T=>p.value&&oo(p.value))},[e.createElementVNode("img",{src:e.unref(cr),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,dh)]),e.createElementVNode("button",{class:"zm-tb-btn",title:"添加同级 (Enter)",onClick:l[22]||(l[22]=T=>p.value&&ci(p.value))},[e.createElementVNode("img",{src:e.unref(sr),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,uh)]),l[38]||(l[38]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:M.layoutMode==="mindmap"}]),title:"思维导图布局 (中心辐射)",onClick:l[23]||(l[23]=T=>or("mindmap"))},[e.createVNode(ve,{name:"mindmap"})],2),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:M.layoutMode==="tree"}]),title:"树形布局 (向右展开)",onClick:l[24]||(l[24]=T=>or("tree"))},[e.createVNode(ve,{name:"tree"})],2),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:M.layoutMode==="org"}]),title:"组织结构布局 (向下展开)",onClick:l[25]||(l[25]=T=>or("org"))},[e.createVNode(ve,{name:"org"})],2)],64))],2)],544),r.builtInDrawers?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(Vt,{side:"left",scope:"canvas",width:300,open:sn.value&&!t.previewMode,title:"大纲","onUpdate:open":l[29]||(l[29]=T=>sn.value=T)},{default:e.withCtx(()=>[e.createVNode(Oo,{data:m.value,"selected-id":p.value,"collapsed-ids":rt.value,"show-index":re.value,onSelect:ho,onToggleCollapse:bn,onEdit:ii,onAddChild:Yn,onAddSibling:qn,onMove:Ut},null,8,["data","selected-id","collapsed-ids","show-index"])]),_:1},8,["open"]),e.createVNode(Vt,{side:"right",scope:"canvas",width:360,open:Pt.value&&!t.previewMode,title:"数据","onUpdate:open":l[31]||(l[31]=T=>Pt.value=T)},{default:e.withCtx(()=>[e.createVNode(Do,{data:m.value,"pending-mode":Ft.value,onImport:l[30]||(l[30]=T=>m.value=T),onConsumedMode:Ge},null,8,["data","pending-mode"])]),_:1},8,["open"]),e.createVNode(Vt,{side:"right",scope:"canvas",width:420,open:me.value&&!t.previewMode,title:"Markdown","onUpdate:open":l[33]||(l[33]=T=>me.value=T)},{default:e.withCtx(()=>[e.createVNode(Vo,{data:m.value,onImport:l[32]||(l[32]=T=>m.value=T)},null,8,["data"])]),_:1},8,["open"]),e.createVNode(Vt,{side:"right",scope:"canvas",width:360,open:mt.value&&!t.previewMode,title:"节点内容","onUpdate:open":l[34]||(l[34]=T=>mt.value=T)},{default:e.withCtx(()=>[e.createVNode(Qo,{"selected-node":wt.value,"focus-tick":ze.value,onApply:lt,onRemove:Mt,onSetLink:Bn,onSetImage:ni,onSetRich:oi},null,8,["selected-node","focus-tick"])]),_:1},8,["open"]),e.createVNode(Vt,{side:"right",scope:"canvas",width:340,open:De.value&&!t.previewMode,title:"设置","onUpdate:open":l[35]||(l[35]=T=>De.value=T)},{default:e.withCtx(()=>{var T;return[e.createVNode($o,{settings:M,"has-selection":p.value!==null,"selected-node-text":(T=wt.value)==null?void 0:T.text,"node-style":q.value,"onUpdate:settings":le,"onUpdate:nodeStyle":xe,onReset:Re},null,8,["settings","has-selection","selected-node-text","node-style"])]}),_:1},8,["open"])],64)):e.createCommentVNode("",!0)],4)}}}),fh={class:"zm-app"},mh={class:"zm-app-main"},ph={class:"zm-app-canvas"},Yl=e.defineComponent({__name:"App",setup(t){const o={id:"r_root",text:"flow-mindmap 节点能力一览",link:{url:"https://github.com/xz333221/flow-mindmap"},note:{text:`本导图用于演示节点的全部可渲染字段。
134
+ | a | b | c |`);if(k===null)return;const M=k.trim();if(!M){ke(i,null);return}ke(i,{kind:"table",raw:M})}function xn(){var l;const i=(l=z.value)==null?void 0:l.nodeId;i&&ke(i,null)}function rr(){var l;const i=(l=z.value)==null?void 0:l.nodeId;i&&Va(i)}function Co(i){r.previewMode||(d.value=new Set([i]),Je(),r.builtInDrawers&&(Tt(),pt.value=!0,De.value++),a("edit-note",i))}function To(i,l=60){const u=i.replace(/\s+/g," ").trim();return u.length<=l?u||"点击编辑笔记":u.slice(0,l)+"…"}function Mo(i){var S,_;if(r.previewMode||s.value)return;const l=i.target;if(l&&(l.tagName==="INPUT"||l.tagName==="TEXTAREA"||l.isContentEditable))return;const u=h.value;if(!u)return;const x=(S=i.clipboardData)==null?void 0:S.items;if(!x)return;for(let W=0;W<x.length;W++){const B=x[W];if(B.kind==="file"&&B.type.startsWith("image/")){const J=B.getAsFile();if(!J)continue;i.preventDefault();const E=he(p.value,u);if(E!=null&&E.image&&!window.confirm("该节点已有图片,要用剪贴板里的图片替换吗?"))return;G(J,j=>de(u,j));return}}if(I.value&&I.value.nodes.length>0)return;let k=null;for(let W=0;W<x.length;W++){const B=x[W];if(B.kind==="string"&&B.type==="text/plain"){k=((_=i.clipboardData)==null?void 0:_.getData("text/plain"))??null;break}}if(!k)return;const M=k.split(/\r?\n/).map(W=>W.replace(/^\s*[-*+]\s+/,"").trim()).filter(W=>W.length>0);if(M.length!==0){i.preventDefault(),ze();for(const W of M)Ci(p.value,u,W);ye(),a("change",p.value)}}e.onMounted(()=>{window.addEventListener("paste",Mo),window.addEventListener("keydown",Ao),ye()}),e.onBeforeUnmount(()=>{window.removeEventListener("paste",Mo),window.removeEventListener("keydown",Ao)});function Ao(i){if((i.metaKey||i.ctrlKey)&&(i.key==="f"||i.key==="F")){const u=i.target;if(u&&(u.tagName==="INPUT"||u.tagName==="TEXTAREA"||u.isContentEditable))return;i.preventDefault(),a("canvas-outline");return}if((i.key==="Delete"||i.key==="Backspace")&&ht.value){const u=i.target;if(u&&(u.tagName==="INPUT"||u.tagName==="TEXTAREA"||u.isContentEditable)||r.previewMode)return;i.preventDefault(),La(ht.value)}}const Vn=e.ref(null),Rt=e.computed(()=>{var i;return((i=Vn.value)==null?void 0:i.nodeId)??null});function un(i,l){if(!l.image)return;i.preventDefault(),i.stopPropagation();const u=l.image.naturalW||l.image.width,x=l.image.naturalH||l.image.height,k=x>0?x/u:1;Vn.value={nodeId:l.id,startX:i.clientX,startY:i.clientY,startW:l.image.width,startH:l.image.height,naturalW:u,naturalH:x,ratio:k,pendingW:l.image.width,pendingH:l.image.height},window.addEventListener("mousemove",_o),window.addEventListener("mouseup",vo)}function _o(i){var W,B;const l=Vn.value;if(!l)return;const u=Q.scale.value||1,x=i.clientX-l.startX,k=V(l.startW+x/u,In,Qn),M=V(k*l.ratio,In,Qn);l.pendingW=k,l.pendingH=M;const S=(W=c.value)==null?void 0:W.querySelector(`[data-node-id="${l.nodeId}"] .zm-node-img`);S&&(S.style.width=`${k}px`,S.style.height=`${M}px`);const _=(B=c.value)==null?void 0:B.querySelector(`[data-node-id="${l.nodeId}"]`);_&&(_.style.minWidth=`${Math.max(80,Math.ceil(k+28))}px`,_.style.height=`${Math.ceil(M+8+30)}px`)}function vo(){const i=Vn.value;if(window.removeEventListener("mousemove",_o),window.removeEventListener("mouseup",vo),Vn.value=null,!i)return;const l=he(p.value,i.nodeId);!l||!l.image||(de(i.nodeId,{src:l.image.src,naturalW:l.image.naturalW,naturalH:l.image.naturalH,width:i.pendingW,height:i.pendingH}),d.value=new Set([i.nodeId]),Je(),En=!0)}const Dn=e.ref(null);let En=!1;function wn(i){Dn.value=i}function no(i){Dn.value===i&&(Dn.value=null),v.value&&(v.value=null)}function Xt(i,l){var ie;if(!l.text||l.text.length<14)return;const x=i.currentTarget.getBoundingClientRect(),k=(ie=c.value)==null?void 0:ie.getBoundingClientRect();if(!k)return;const M=10,S=240,_=x.top-k.top>60,W=x.left-k.left+x.width/2,B=M+S/2,J=k.width-S/2-M,E=Math.max(B,Math.min(W,J)),j=_?x.top-k.top-8:x.bottom-k.top+8;v.value={text:l.text,x:E,y:j,above:_}}const oo=e.ref(0),io=e.ref(!1),nn=Os(100);function ze(){nn.record({data:p.value,selectedIds:[...d.value]})}function ye(){b.value=new Set(b.value),oo.value++,e.nextTick().then(()=>e.nextTick()).then(()=>ro()).then(()=>{oo.value++})}function ro(){const i=document.querySelectorAll(".zm-rich"),l={},u={};i.forEach(x=>{let k=x,M=null;for(;k&&!M;)M=k.getAttribute("data-node-id"),k=k.parentElement;if(!M)return;const S=x.offsetHeight,_=x.scrollWidth,W=Math.round(S*2)/2,B=Math.round(_*2)/2;l[M]=W,u[M]=B,P.value[M],Y.value[M]}),P.value=l,Y.value=u}const ct=e.computed(()=>{var i,l,u,x,k,M,S,_,W,B;return{rootBg:((i=r.theme)==null?void 0:i.rootBg)??"#1f2937",rootText:((l=r.theme)==null?void 0:l.rootText)??"#ffffff",branchBg:((u=r.theme)==null?void 0:u.branchBg)??"#ffffff",branchText:((x=r.theme)==null?void 0:x.branchText)??"#1f2937",lineColor:((k=r.theme)==null?void 0:k.lineColor)??"#94a3b8",bgColor:((M=r.theme)==null?void 0:M.bgColor)??"#f8fafc",fontSize:((S=r.theme)==null?void 0:S.fontSize)??14,lineWidthStart:((_=r.theme)==null?void 0:_.lineWidthStart)??2.2,lineWidthEnd:((W=r.theme)==null?void 0:W.lineWidthEnd)??.8,rainbowBranch:((B=r.theme)==null?void 0:B.rainbowBranch)??!1}}),oe=e.computed(()=>f.canvasBg||ct.value.bgColor),f=e.reactive({autoBalanceOnChange:!0,lineWidthStart:16,lineWidthEnd:3.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"rounded-elbow",rootLineStyle:"arc",lineOrigin:"proportional",layoutMode:"mindmap",taperedEdge:!0,lineWidthTaper:.3,uniformLineWidth:!0,elbowRadius:20,showOrderBadge:!1,canvasBg:void 0,branchGap:20});function D(i){return i?f.rootLineStyle:f.lineStyle}function Z(i){return f.taperedEdge?f.uniformLineWidth&&i>0?f.lineWidthEnd:Se(i):Pe(i)}function Ie(i){return f.taperedEdge?f.lineWidthEnd:Pe(i)}function Se(i){const l=f.lineWidthTaper,u=f.lineWidthStart*Math.pow(l,i);return Math.max(f.lineWidthEnd,u)}function Pe(i){if(i<=0)return f.lineWidthStart;if(i>=3)return f.lineWidthEnd;const l=i/3;return f.lineWidthStart+(f.lineWidthEnd-f.lineWidthStart)*l}function Ye(i,l,u,x){const k=1-i,M=k*k*k*l.x+3*k*k*i*u.x1+3*k*i*i*u.x2+i*i*i*x.x,S=k*k*k*l.y+3*k*k*i*u.y1+3*k*i*i*u.y2+i*i*i*x.y;return{x:M,y:S}}function At(i,l,u,x){const k=1-i,M=k*k*l.x+2*k*i*u.x+i*i*x.x,S=k*k*l.y+2*k*i*u.y+i*i*x.y;return{x:M,y:S}}function _t(i,l,u,x,k=32,M="curve",S="right"){if(M==="curve"){let _;if(S==="right"||S==="left"){const ie=Math.abs(l.x-i.x)*.45,be=S==="right"?1:-1;_={x1:i.x+be*ie,y1:i.y,x2:l.x-be*ie,y2:l.y}}else{const ie=Math.abs(l.y-i.y)*.45;_={x1:i.x,y1:i.y+ie,x2:l.x,y2:l.y-ie}}const W=j=>{const ie=1-j,be=-3*ie*ie*i.x+3*(ie*ie-2*ie*j)*_.x1+3*(2*ie*j-j*j)*_.x2+3*j*j*l.x,Ce=-3*ie*ie*i.y+3*(ie*ie-2*ie*j)*_.y1+3*(2*ie*j-j*j)*_.y2+3*j*j*l.y;return{dx:be,dy:Ce}},B=[],J=[];for(let j=0;j<=k;j++){const ie=j/k,be=j===0?i:j===k?l:Ye(ie,i,_,l),Ce=W(ie);let Me=Math.hypot(Ce.dx,Ce.dy);Me<1e-6&&(Me=1);const Oe=-Ce.dy/Me,ee=Ce.dx/Me,_e=(u+(x-u)*ie)/2;B.push({x:be.x+Oe*_e,y:be.y+ee*_e}),J.push({x:be.x-Oe*_e,y:be.y-ee*_e})}let E=`M ${B[0].x.toFixed(2)} ${B[0].y.toFixed(2)}`;for(let j=1;j<=k;j++)E+=` L ${B[j].x.toFixed(2)} ${B[j].y.toFixed(2)}`;for(let j=k;j>=0;j--)E+=` L ${J[j].x.toFixed(2)} ${J[j].y.toFixed(2)}`;return E+=" Z",E}if(M==="arc"){let _;S==="right"||S==="left"?_={x:(i.x+l.x)/2,y:l.y}:_={x:l.x,y:(i.y+l.y)/2};const W=be=>{const Ce=1-be,Me=2*Ce*(_.x-i.x)+2*be*(l.x-_.x),Oe=2*Ce*(_.y-i.y)+2*be*(l.y-_.y);return{dx:Me,dy:Oe}},B=[],J=[];for(let be=0;be<=k;be++){const Ce=be/k,Me=be===0?i:be===k?l:At(Ce,i,_,l),Oe=W(Ce);let ee=Math.hypot(Oe.dx,Oe.dy);ee<1e-6&&(ee=1);const _e=-Oe.dy/ee,re=Oe.dx/ee,Ve=(u+(x-u)*Ce)/2;B.push({x:Me.x+_e*Ve,y:Me.y+re*Ve}),J.push({x:Me.x-_e*Ve,y:Me.y-re*Ve})}const E=u/2,j=x/2;let ie=`M ${B[0].x.toFixed(2)} ${B[0].y.toFixed(2)}`;for(let be=1;be<=k;be++)ie+=` L ${B[be].x.toFixed(2)} ${B[be].y.toFixed(2)}`;ie+=` A ${j.toFixed(2)} ${j.toFixed(2)} 0 0 0 ${J[k].x.toFixed(2)} ${J[k].y.toFixed(2)}`;for(let be=k-1;be>=0;be--)ie+=` L ${J[be].x.toFixed(2)} ${J[be].y.toFixed(2)}`;return ie+=` A ${E.toFixed(2)} ${E.toFixed(2)} 0 0 0 ${B[0].x.toFixed(2)} ${B[0].y.toFixed(2)}`,ie+=" Z",ie}if(M==="elbow"){const _=[];if(S==="down"){const ee=(i.y+l.y)/2;_.push(i,{x:i.x,y:ee},{x:l.x,y:ee},l)}else{const ee=(i.x+l.x)/2;_.push(i,{x:ee,y:i.y},{x:ee,y:l.y},l)}const W=[];let B=0;for(let ee=0;ee<_.length-1;ee++){const _e=Math.hypot(_[ee+1].x-_[ee].x,_[ee+1].y-_[ee].y);W.push(_e),B+=_e}const J=[u/2];let E=0;for(let ee=0;ee<W.length-1;ee++){E+=W[ee];const _e=B>0?E/B:0;J.push((u+(x-u)*_e)/2)}J.push(x/2);const j=[];for(let ee=0;ee<_.length-1;ee++){const _e=_[ee+1].x-_[ee].x,re=_[ee+1].y-_[ee].y;let Ve=Math.hypot(_e,re);Ve<1e-6&&(Ve=1),j.push({x:-re/Ve,y:_e/Ve})}const ie=[],be=[];ie.push({x:_[0].x+j[0].x*J[0],y:_[0].y+j[0].y*J[0]}),be.push({x:_[0].x-j[0].x*J[0],y:_[0].y-j[0].y*J[0]});for(let ee=1;ee<_.length-1;ee++){const _e=j[ee-1],re=j[ee],Ve=J[ee],bt=_e.x+re.x,K=_e.y+re.y,Te=bt*bt+K*K;if(Te<1e-6)ie.push({x:_[ee].x+_e.x*Ve,y:_[ee].y+_e.y*Ve}),be.push({x:_[ee].x-_e.x*Ve,y:_[ee].y-_e.y*Ve});else{const ve=2*Ve/Te;ie.push({x:_[ee].x+bt*ve,y:_[ee].y+K*ve}),be.push({x:_[ee].x-bt*ve,y:_[ee].y-K*ve})}}const Ce=j[j.length-1],Me=J[J.length-1];ie.push({x:_[_.length-1].x+Ce.x*Me,y:_[_.length-1].y+Ce.y*Me}),be.push({x:_[_.length-1].x-Ce.x*Me,y:_[_.length-1].y-Ce.y*Me});let Oe=`M ${ie[0].x.toFixed(2)} ${ie[0].y.toFixed(2)}`;for(let ee=1;ee<ie.length;ee++)Oe+=` L ${ie[ee].x.toFixed(2)} ${ie[ee].y.toFixed(2)}`;for(let ee=be.length-1;ee>=0;ee--)Oe+=` L ${be[ee].x.toFixed(2)} ${be[ee].y.toFixed(2)}`;return Oe+=" Z",Oe}if(M==="rounded-elbow"&&!(S==="down"?Math.abs(i.x-l.x)<.5:Math.abs(i.y-l.y)<.5)){let W=function(K,Te,ve){const kt={x:K.pos.x-Te*K.d1.x,y:K.pos.y-Te*K.d1.y},ln={x:K.pos.x+Te*K.d2.x,y:K.pos.y+Te*K.d2.y},Bt={x:K.pos.x+Te*(K.d2.x-K.d1.x),y:K.pos.y+Te*(K.d2.y-K.d1.y)},yt=Math.atan2(kt.y-Bt.y,kt.x-Bt.x);let tt=Math.atan2(ln.y-Bt.y,ln.x-Bt.x)-yt;for(;tt>Math.PI;)tt-=2*Math.PI;for(;tt<-Math.PI;)tt+=2*Math.PI;const zt=[];for(let Ue=1;Ue<ve;Ue++){const an=Ue/ve,Jt=yt+tt*an;zt.push({x:Bt.x+Te*Math.cos(Jt),y:Bt.y+Te*Math.sin(Jt)})}return zt};const B=[];let J;if(S==="down"){const K=(i.y+l.y)/2,Te=Math.sign(K-i.y)||1,ve=Math.sign(l.x-i.x)||1,kt=Math.sign(l.y-K)||1;J=[{pos:{x:i.x,y:K},d1:{x:0,y:Te},d2:{x:ve,y:0}},{pos:{x:l.x,y:K},d1:{x:ve,y:0},d2:{x:0,y:kt}}]}else{const K=(i.x+l.x)/2,Te=Math.sign(K-i.x)||1,ve=Math.sign(l.y-i.y)||1,kt=Math.sign(l.x-K)||1;J=[{pos:{x:K,y:i.y},d1:{x:Te,y:0},d2:{x:0,y:ve}},{pos:{x:K,y:l.y},d1:{x:0,y:ve},d2:{x:kt,y:0}}]}const E=Math.hypot(J[1].pos.x-J[0].pos.x,J[1].pos.y-J[0].pos.y),j=Math.hypot(l.x-J[1].pos.x,l.y-J[1].pos.y),ie=Math.min(E,j,f.elbowRadius)*.5,be=Math.max(2,ie);B.push(i),B.push(J[0].pos),B.push({x:J[1].pos.x-be*J[1].d1.x,y:J[1].pos.y-be*J[1].d1.y});for(const K of W(J[1],be,12))B.push(K);B.push(l);const Ce=[];let Me=0;for(let K=0;K<B.length-1;K++){const Te=Math.hypot(B[K+1].x-B[K].x,B[K+1].y-B[K].y);Ce.push(Te),Me+=Te}const Oe=[];for(let K=0;K<B.length-1;K++){const Te=B[K+1].x-B[K].x,ve=B[K+1].y-B[K].y;let kt=Math.hypot(Te,ve);kt<1e-6&&(kt=1),Oe.push({x:-ve/kt,y:Te/kt})}const ee=[];let _e=0;for(let K=0;K<B.length;K++){K>0&&(_e+=Ce[K-1]);const Te=Me>0?_e/Me:0;ee.push((u+(x-u)*Te)/2)}const re=[],Ve=[];for(let K=0;K<B.length;K++){const Te=ee[K];if(K===0){const ve=Oe[0];re.push({x:B[K].x+ve.x*Te,y:B[K].y+ve.y*Te}),Ve.push({x:B[K].x-ve.x*Te,y:B[K].y-ve.y*Te})}else if(K===B.length-1){const ve=Oe[Oe.length-1];re.push({x:B[K].x+ve.x*Te,y:B[K].y+ve.y*Te}),Ve.push({x:B[K].x-ve.x*Te,y:B[K].y-ve.y*Te})}else{const ve=Oe[K-1],kt=Oe[K],ln=ve.x+kt.x,Bt=ve.y+kt.y,yt=ln*ln+Bt*Bt;if(yt<1e-6)re.push({x:B[K].x+ve.x*Te,y:B[K].y+ve.y*Te}),Ve.push({x:B[K].x-ve.x*Te,y:B[K].y-ve.y*Te});else{const qe=2*Te/yt;re.push({x:B[K].x+ln*qe,y:B[K].y+Bt*qe}),Ve.push({x:B[K].x-ln*qe,y:B[K].y-Bt*qe})}}}let bt=`M ${re[0].x.toFixed(2)} ${re[0].y.toFixed(2)}`;for(let K=1;K<re.length;K++)bt+=` L ${re[K].x.toFixed(2)} ${re[K].y.toFixed(2)}`;bt+=` L ${Ve[re.length-1].x.toFixed(2)} ${Ve[re.length-1].y.toFixed(2)}`;for(let K=Ve.length-2;K>=0;K--)bt+=` L ${Ve[K].x.toFixed(2)} ${Ve[K].y.toFixed(2)}`;return bt+=" Z",bt}{const _=l.x-i.x,W=l.y-i.y;let B=Math.hypot(_,W);B<1e-6&&(B=1);const J=-W/B,E=_/B,j=u/2,ie=x/2,be={x:i.x+J*j,y:i.y+E*j},Ce={x:i.x-J*j,y:i.y-E*j},Me={x:l.x-J*ie,y:l.y-E*ie},Oe={x:l.x+J*ie,y:l.y+E*ie};return`M ${be.x.toFixed(2)} ${be.y.toFixed(2)} L ${Oe.x.toFixed(2)} ${Oe.y.toFixed(2)} L ${Me.x.toFixed(2)} ${Me.y.toFixed(2)} L ${Ce.x.toFixed(2)} ${Ce.y.toFixed(2)} Z`}}const Nn=e.computed(()=>St.value.root.children),et=hn[0].colors,Ro=e.computed(()=>bs(f.branchPaletteId,f.customPalettes)),Sn=e.computed(()=>{const i=new Map;if(!f.rainbowBranch)return i;const l=r.lineColors,u=l&&l.length>0?l:Ro.value.colors.length>0?Ro.value.colors:et;for(let k=0;k<Nn.value.length;k++){const M=Nn.value[k];i.set(M.id,u[k%u.length])}const x=(k,M)=>{i.set(k.id,M);for(const S of k.children)x(S,M)};for(let k=0;k<Nn.value.length;k++){const M=Nn.value[k];x(M,u[k%u.length])}return i});function aa(i,l){return f.rainbowBranch?Sn.value.get(l.id)??ct.value.lineColor:ct.value.lineColor}function sa(i){const l=te(i.id);if(l.bg)return l.bg;if(i.isRoot)return ct.value.rootBg;if(i.depth>=3)return"transparent";const u=i.depth===1?.15:.08;if(f.rainbowBranch){const x=Sn.value.get(i.id);if(x)return ua(x,u)}return ua(ct.value.rootBg,u)}function lo(i){const l=te(i.id);if(l.textColor)return l.textColor;if(i.isRoot)return ct.value.rootText;if(f.rainbowBranch){const u=Sn.value.get(i.id);if(u)return ag(u,.55)}return ct.value.branchText}function ao(i){const l=te(i.id);return l.borderColor?l.borderColor:"transparent"}function ca(i){const l=te(i.id);return l.fontWeight?l.fontWeight:i.isRoot?700:i.depth<=1?600:i.depth===2?500:400}function da(i){return te(i.id).fontSize??i.fontSize??ct.value.fontSize}function ua(i,l){const u=i.replace("#",""),x=u.length===6?u:u.split("").map(_=>_+_).join(""),k=parseInt(x.slice(0,2),16),M=parseInt(x.slice(2,4),16),S=parseInt(x.slice(4,6),16);return`rgba(${k}, ${M}, ${S}, ${l})`}function ag(i,l){const u=i.replace("#",""),x=u.length===6?u:u.split("").map(_=>_+_).join(""),k=Math.round(parseInt(x.slice(0,2),16)*(1-l)),M=Math.round(parseInt(x.slice(2,4),16)*(1-l)),S=Math.round(parseInt(x.slice(4,6),16)*(1-l));return`rgb(${k}, ${M}, ${S})`}const Q=zs({getContainer:()=>c.value});Q.setOnMarqueeEnd(Ag),Ls({isEditing:()=>s.value!==null,isReadonly:()=>r.previewMode,getSelectedId:()=>h.value,getSelectedIds:()=>[...d.value],defaultTargetId:()=>p.value.id,onAddChild:so,onAddSibling:pi,onAddSiblingBefore:hg,onRemove:Sa,onStartEdit:Bo,onClearSelection:()=>{if(gt.value){gt.value=null;return}if(ht.value){ht.value=null;return}d.value=new Set,Je()},onDuplicate:ba,onCopy:Ea,onCut:wa,onPaste:Na,hasClipboard:()=>!!I.value&&I.value.nodes.length>0,onUndo:ar,onRedo:sr,onNavigate:gg,onMoveSibling:yg,onSelectRoot:()=>{d.value=new Set([p.value.id]),Je()}});const St=e.computed(()=>{const i=vt(p.value);return pa(i),ms(i,{mode:f.layoutMode,baseFontSize:ct.value.fontSize,richHeights:P.value,richWidths:Y.value,branchGap:f.branchGap})}),fa=e.ref([]),Wt=e.computed(()=>(oo.value,fa.value));e.watch(St,i=>{const l=[],u=x=>{l.push(x);for(const k of x.children)u(k)};u(i.root),fa.value=l},{immediate:!0});const ma=e.computed(()=>{const i=[];for(const l of Wt.value)for(const u of l.children)i.push({from:l,to:u,key:`${l.id}->${u.id}`});return i}),sg=e.computed(()=>`${St.value.vbX} ${St.value.vbY} ${St.value.vbW} ${St.value.vbH}`);function pa(i){if(b.value.has(i.id)){i.children=[],i.collapsed=!0;return}i.collapsed=!1;for(const l of i.children)pa(l)}function Bo(i){const l=he(p.value,i);l&&(s.value=i,m.value=l.text,d.value=new Set([i]),Je(),e.nextTick(()=>{const u=document.querySelector(".zm-input");u==null||u.focus(),u==null||u.select(),ha(u)}))}function lr(){if(!s.value)return;const i=he(p.value,s.value);i&&i.text!==(m.value.trim()||" ")&&(i.text=m.value.trim()||" ",ze(),a("change",p.value)),s.value=null}function cg(){s.value=null}function ha(i){i&&(i.style.height="auto",i.style.height=i.scrollHeight+"px")}function dg(i){ha(i.target)}function ug(i){if(r.previewMode)return;const l=he(p.value,i);l!=null&&l.richContent&&(w.value=i,y.value=l.richContent.raw,e.nextTick(()=>{const u=document.querySelector(".zm-node .zm-rich textarea");u==null||u.focus()}))}function ga(){if(!w.value)return;const i=w.value,l=he(p.value,i),u=y.value;if(l&&l.richContent&&l.richContent.raw!==u)if(l.richContent.kind==="code"){const x=_n(u)||void 0;ke(i,{kind:"code",raw:u,lang:x})}else ke(i,{kind:"table",raw:u});w.value=null}function fg(){w.value=null}function mg(i){i.key==="Escape"?(i.preventDefault(),fg()):i.key==="Enter"&&(i.ctrlKey||i.metaKey)&&(i.preventDefault(),ga())}function pg(i){const l=i.metaKey||i.ctrlKey;l&&(i.key==="z"||i.key==="Z")&&!i.shiftKey?(i.preventDefault(),ar()):(l&&i.shiftKey&&(i.key==="z"||i.key==="Z")||l&&(i.key==="y"||i.key==="Y")&&!i.shiftKey)&&(i.preventDefault(),sr())}function so(i){const l=Ci(p.value,i,Fo);l&&(ze(),ye(),a("change",p.value),e.nextTick(()=>Bo(l.id)))}function pi(i){if(i===p.value.id){so(i);return}const l=Br(p.value,i,Fo);l&&(ze(),ye(),a("change",p.value),e.nextTick(()=>Bo(l.id)))}function hg(i){if(i===p.value.id){so(i);return}const l=Ns(p.value,i,Fo);l&&(ze(),ye(),a("change",p.value),e.nextTick(()=>Bo(l.id)))}function ba(i){if(i===p.value.id)return;const l=Ss(p.value,i);l&&(ze(),d.value=new Set([l.id]),Je(),a("change",p.value),ye())}function ka(i){const l=[],u=new Set;for(const x of i)x!==p.value.id&&(u.has(x)||he(p.value,x)&&(u.add(x),l.push(x)));return l}function ya(i){const l=new Set(i),u=[],x=k=>{l.has(k.id)&&u.push(k.id);for(const M of k.children)x(M)};return x(p.value),u}function xa(i){var l;try{(l=navigator.clipboard)==null||l.writeText(i)}catch{}}function Ea(i){const l=ya(ka(i));if(l.length===0)return;const u=[];for(const x of l){const k=zr(p.value,x);k&&u.push(k)}u.length!==0&&(I.value={nodes:u,originalIds:new Set(l)},xa(u.map(x=>x.text).join(`
135
+ `)),ye())}function wa(i){const l=ya(ka(i));if(l.length===0)return;const u=[];for(const k of l){const M=zr(p.value,k);M&&u.push(M)}if(u.length===0)return;ze();const x=[];for(const k of l){const M=he(p.value,k);M&&x.push(...Ua(M))}for(const k of l)$o(p.value,k);for(const k of x)Lr(p.value,k);d.value=new Set,Je(),I.value={nodes:u,originalIds:new Set(l)},xa(u.map(k=>k.text).join(`
136
+ `)),ye(),a("change",p.value)}function Na(i){const l=I.value;if(!l||l.nodes.length===0)return;const u=i??p.value.id,x=he(p.value,u);if(x){for(const k of l.originalIds){const M=he(p.value,k);if(M&&he(M,u))return}ze();for(const k of l.nodes){const M=vt(k);Po(M),x.children.push(M)}I.value=null,ye(),a("change",p.value)}}function ar(){const i=nn.undo();i&&(p.value=i.data,d.value=new Set(i.selectedIds??[]),Je(),ye(),a("change",p.value))}function sr(){const i=nn.redo();i&&(p.value=i.data,d.value=new Set(i.selectedIds??[]),Je(),ye(),a("change",p.value))}function Je(){const i=[];for(const l of d.value){const u=he(p.value,l);u&&i.push(u)}if(r.builtInDrawers&&!r.previewMode&&i.length>0){const l=i[0];!pt.value&&Ga(l.id)&&(Tt(),pt.value=!0)}else r.builtInDrawers&&i.length===0&&(pt.value=!1);a("select",i.length>0?i:null)}function gg(i,l){const u=h.value??p.value.id,x=he(p.value,u);if(!x)return;let k=null;if(l===1){const M=Dt(p.value,x.id);if(M){const S=M.children.findIndex(_=>_.id===x.id);S>=0&&S<M.children.length-1&&(k=M.children[S+1].id)}}else if(l===-1){const M=Dt(p.value,x.id);if(M){const S=M.children.findIndex(_=>_.id===x.id);S>0&&(k=M.children[S-1].id)}}else if(i===1){const M=Dt(p.value,x.id);M&&(k=M.id)}else i===-1&&x.children.length>0&&(k=x.children[0].id);k&&(d.value=new Set([k]),Je())}function Sa(i){var x;if(i===p.value.id)return;const l=he(p.value,i),u=l?Ua(l):[i];if($o(p.value,i)){for(const k of u)Lr(p.value,k);if((x=gt.value)!=null&&x.fromId&&u.includes(gt.value.fromId)&&(gt.value=null),ze(),d.value.has(i)){const k=new Set(d.value);k.delete(i),d.value=k,Je()}ye(),a("change",p.value)}}function Ca(i){b.value.has(i)?b.value.delete(i):b.value.add(i),ye()}function Ta(i){const l=[{n:p.value,depth:1}];for(;l.length;){const{n:u,depth:x}=l.pop();i(u,x);for(let k=u.children.length-1;k>=0;k--)l.push({n:u.children[k],depth:x+1})}}function bg(){b.value=new Set,Ta(i=>{i.children.length>0&&b.value.add(i.id)}),ye()}function Ma(i){b.value=new Set,Ta((l,u)=>{u>i&&l.children.length>0&&b.value.add(l.id)}),ye()}function kg(){b.value=new Set,ye()}function Aa(i,l){ws(p.value,i,l)&&(ze(),ye(),a("change",p.value))}function cr(i,l,u){return Si(p.value,i,l,u)?(ze(),ye(),a("change",p.value),!0):!1}function yg(i){const l=h.value;if(!l)return;const u=p.value;if(l===u.id)return;const x=Dt(u,l);if(!x)return;const k=x.children.findIndex(_=>_.id===l);if(k<0)return;let M=i;const S=Wt.value.find(_=>_.id===l);if(S&&Ra(S)&&(M=-i),M<0){if(k===0)return;const _=x.children[k-1].id;Si(u,l,_,"before")}else{if(k>=x.children.length-1)return;const _=x.children[k+1].id;Si(u,l,_,"after")}ze(),ye(),a("change",u)}function xg(i,l){if(i.stopPropagation(),gt.value){const u=gt.value;u.fromId?u.fromId!==l.id&&(Ia(u.fromId,l.id),gt.value=null):(u.fromId=l.id,d.value=new Set([l.id]),Je());return}if(ht.value=null,i.shiftKey){const u=new Set(d.value);u.has(l.id)?u.delete(l.id):u.add(l.id),d.value=u}else d.value=new Set([l.id]);Je()}function _a(i,l,u){let x=null;for(const k of Wt.value){if(k.id===u)continue;const M=k.width/2,S=k.height/2;i>=k.x-M&&i<=k.x+M&&l>=k.y-S&&l<=k.y+S&&(x=k)}return x}let Zt=null;function Eg(i,l){if(r.previewMode||l.isRoot||i.button!==0)return;const u=i.target;if(u!=null&&u.closest(".zm-img-resize-handle"))return;i.stopPropagation();const x=c.value.getBoundingClientRect(),k=l.x*Q.scale.value+Q.offsetX.value,M=l.y*Q.scale.value+Q.offsetY.value,S=i.clientX-x.left-k,_=i.clientY-x.top-M;Zt={srcId:l.id,srcText:l.text,pointerOffsetX:S,pointerOffsetY:_,startX:i.clientX,startY:i.clientY},window.addEventListener("pointermove",va),window.addEventListener("pointerup",hi),window.addEventListener("pointercancel",hi)}function va(i){if(Zt){const S=i.clientX-Zt.startX,_=i.clientY-Zt.startY;if(Math.abs(S)<=ra&&Math.abs(_)<=ra)return;C.value={srcId:Zt.srcId,srcText:Zt.srcText,pointerOffsetX:Zt.pointerOffsetX,pointerOffsetY:Zt.pointerOffsetY,currentTargetId:null,dropPosition:null},document.body.classList.add("is-dragging"),Zt=null}const l=C.value;if(!l)return;const u=c.value.getBoundingClientRect();$.value=i.clientX-u.left-l.pointerOffsetX,R.value=i.clientY-u.top-l.pointerOffsetY;const x=(i.clientX-u.left-Q.offsetX.value)/Q.scale.value,k=(i.clientY-u.top-Q.offsetY.value)/Q.scale.value,M=_a(x,k,l.srcId);l.currentTargetId=(M==null?void 0:M.id)??null,M?l.dropPosition=wg(x,k,M):l.dropPosition=null}function wg(i,l,u){if(u.isRoot)return"child";const x=u.width/2,k=u.height/2;if(u._dir==="down"){const S=i-u.x;return S<-x*.3?"before":S>x*.3?"after":"child"}const M=l-u.y;return M<-k*.3?"before":M>k*.3?"after":"child"}function Ra(i){var l;return!!((l=i.parent)!=null&&l.isRoot)&&i._dir==="left"}function hi(i){if(window.removeEventListener("pointermove",va),window.removeEventListener("pointerup",hi),window.removeEventListener("pointercancel",hi),Zt){Zt=null;return}const l=C.value;if(l){if(l.currentTargetId&&l.dropPosition){let u=l.dropPosition;if(u!=="child"){const x=Wt.value.find(k=>k.id===l.currentTargetId);x&&Ra(x)&&(u=u==="before"?"after":"before")}cr(l.srcId,l.currentTargetId,u),d.value=new Set([l.srcId]),Je()}C.value=null,$.value=0,R.value=0,document.body.classList.remove("is-dragging")}}const ht=e.ref(null),gt=e.ref(null),on=e.ref(null),Cn=e.ref(null),gi=e.ref("");function Ng(i,l){const u=i.width/2,x=i.height/2,k=(l%4+4)%4;return k<1?{x:i.x-u+2*u*k,y:i.y-x}:k<2?{x:i.x+u,y:i.y-x+2*x*(k-1)}:k<3?{x:i.x+u-2*u*(k-2),y:i.y+x}:{x:i.x-u,y:i.y+x-2*x*(k-3)}}function dr(i,l){const u=l.x-i.x,x=l.y-i.y,k=i.width/2,M=i.height/2;if(Math.abs(u)<1e-6&&Math.abs(x)<1e-6)return{x:i.x+k,y:i.y};const S=Math.abs(u)>1e-6?k/Math.abs(u):1/0,_=Math.abs(x)>1e-6?M/Math.abs(x):1/0,W=Math.min(S,_);return{x:i.x+u*W,y:i.y+x*W}}function Sg(i,l){const u=i.width/2||1,x=i.height/2||1,k=l.x-i.x,M=l.y-i.y;return Math.abs(k)/u>Math.abs(M)/x?k>0?1+V((M+x)/(2*x),0,1):3+V((x-M)/(2*x),0,1):M<0?V((k+u)/(2*u),0,1):2+V((u-k)/(2*u),0,1)}function Ba(i,l,u,x){const k=l==="from"?u:x,M=l==="from"?x:u,S=on.value;if(S&&S.id===i.id&&S.end===l)return dr(k,{x:S.wx,y:S.wy});const _=l==="from"?i.fromT:i.toT;return _!==void 0?Ng(k,_):dr(k,{x:M.x,y:M.y})}function za(i,l){const u=Math.hypot(l.x,l.y);if(u<1e-6)return null;const x=l.x/u,k=l.y/u,M=9,S=7,_=i.x-x*M,W=i.y-k*M,B=-k*(S/2),J=x*(S/2);return`M ${i.x.toFixed(2)} ${i.y.toFixed(2)} L ${(_+B).toFixed(2)} ${(W+J).toFixed(2)} L ${(_-B).toFixed(2)} ${(W-J).toFixed(2)} Z`}const ur=e.computed(()=>{const i=p.value.relations;if(!i||i.length===0)return[];const l=[];for(const u of i){const x=Wt.value.find(Ce=>Ce.id===u.fromId),k=Wt.value.find(Ce=>Ce.id===u.toId);if(!x||!k)continue;const M=Ba(u,"from",x,k),S=Ba(u,"to",x,k),_=on.value;let W=u.c1,B=u.c2;if(_&&_.id===u.id&&_.end==="c1"&&(W={x:_.wx,y:_.wy}),_&&_.id===u.id&&_.end==="c2"&&(B={x:_.wx,y:_.wy}),!W||!B){const Ce=S.x-M.x,Me=S.y-M.y,Oe=Math.hypot(Ce,Me)||1;let ee=-Me/Oe,_e=Ce/Oe;_e>0&&(ee=-ee,_e=-_e);const re=V(Oe*.18,24,160),Ve={x:(M.x+S.x)/2+ee*re,y:(M.y+S.y)/2+_e*re};W||(W=Ve),B||(B=Ve)}const J=`M ${M.x.toFixed(2)} ${M.y.toFixed(2)} C ${W.x.toFixed(2)} ${W.y.toFixed(2)} ${B.x.toFixed(2)} ${B.y.toFixed(2)} ${S.x.toFixed(2)} ${S.y.toFixed(2)}`,E=Ye(.5,M,{x1:W.x,y1:W.y,x2:B.x,y2:B.y},S),j=u.arrow??"end",ie=j==="none"?null:za(S,{x:S.x-B.x,y:S.y-B.y}),be=j==="both"?za(M,{x:M.x-W.x,y:M.y-W.y}):null;l.push({rel:u,from:M,to:S,c1:W,c2:B,d:J,labelPos:E,arrowEnd:ie,arrowStart:be})}return l}),fr=e.computed(()=>ur.value.find(i=>i.rel.id===Cn.value)??null);function Ia(i,l){const u=Ts(p.value,i,l);return u?(ze(),ye(),a("change",p.value),ht.value=u.id,d.value=new Set,Je(),u.id):null}function La(i){Ms(p.value,i)&&(ze(),ht.value===i&&(ht.value=null),Cn.value===i&&(Cn.value=null),ye(),a("change",p.value))}function Oa(i,l){As(p.value,i,l)&&(ze(),ye(),a("change",p.value))}function Va(i){r.previewMode||(gt.value={fromId:i},i&&(d.value=new Set([i]),Je()))}function Cg(){if(gt.value){gt.value=null;return}Va(h.value)}function Da(i,l){i.stopPropagation(),ht.value=l,d.value=new Set,Je()}function bi(i,l,u){if(r.previewMode)return;i.stopPropagation(),i.preventDefault();const x=c.value.getBoundingClientRect();on.value={id:l,end:u,wx:(i.clientX-x.left-Q.offsetX.value)/Q.scale.value,wy:(i.clientY-x.top-Q.offsetY.value)/Q.scale.value,hoverNodeId:null},window.addEventListener("pointermove",$a),window.addEventListener("pointerup",ki),window.addEventListener("pointercancel",ki)}function $a(i){const l=on.value;if(!l)return;const u=c.value.getBoundingClientRect();if(l.wx=(i.clientX-u.left-Q.offsetX.value)/Q.scale.value,l.wy=(i.clientY-u.top-Q.offsetY.value)/Q.scale.value,l.end==="from"||l.end==="to"){const x=Fn(p.value,l.id),k=x?l.end==="from"?x.fromId:x.toId:null,M=_a(l.wx,l.wy,k);l.hoverNodeId=(M==null?void 0:M.id)??null}}function ki(){window.removeEventListener("pointermove",$a),window.removeEventListener("pointerup",ki),window.removeEventListener("pointercancel",ki);const i=on.value;if(on.value=null,!i)return;const l=Fn(p.value,i.id);if(l){if(i.end==="c1"||i.end==="c2")l[i.end]={x:Math.round(i.wx*2)/2,y:Math.round(i.wy*2)/2};else{const u=i.end==="from"?l.fromId:l.toId;if(!(i.hoverNodeId&&i.hoverNodeId!==u?_s(p.value,i.id,i.end,i.hoverNodeId):!1)){const k=Wt.value.find(M=>M.id===u);if(k){const M=dr(k,{x:i.wx,y:i.wy}),S=Sg(k,M);i.end==="from"?l.fromT=S:l.toT=S}}}ze(),ye(),a("change",p.value)}}function Pa(i){if(r.previewMode)return;const l=Fn(p.value,i);l&&(Cn.value=i,gi.value=l.label??"",ht.value=i,e.nextTick(()=>{const u=document.querySelector(".zm-relation-label-input");u==null||u.focus(),u==null||u.select()}))}function Fa(){const i=Cn.value;if(!i)return;Cn.value=null;const l=Fn(p.value,i);if(!l)return;const u=gi.value.trim();(l.label??"")!==u&&Oa(i,{label:u||void 0})}function Ua(i){const l=[],u=x=>{l.push(x.id);for(const k of x.children)u(k)};return u(i),l}let yi=!1;function Tg(i){const l=i.target;if(!l||l.closest(".zm-node, .zm-toolbar, button, input, textarea, .zm-relations"))return;if(i.button===2){yi=!0,Q.startPan(i);return}if(yi=!1,i.button!==0)return;const u=c.value.getBoundingClientRect(),x=(i.clientX-u.left-Q.offsetX.value)/Q.scale.value,k=(i.clientY-u.top-Q.offsetY.value)/Q.scale.value;Q.startMarquee(x,k,{shift:i.shiftKey})}function Mg(i){if(En){En=!1;return}const l=i.target;if(!l||l.closest(".zm-node")||l.closest(".zm-toolbar"))return;const u=Q.marquee;if(!(u.width>=4||u.height>=4)){if(gt.value){gt.value=null;return}if(ht.value){ht.value=null;return}d.value.size>0&&(d.value=new Set,Je())}}function Ag(){const i=Q.marquee;if(i.width<4&&i.height<4)return;const l=i.x,u=i.y,x=i.x+i.width,k=i.y+i.height,M=[];for(const S of Wt.value){const _=S.width/2,W=S.height/2,B=S.x-_,J=S.x+_,E=S.y-W,j=S.y+W;B<=x&&J>=l&&E<=k&&j>=u&&M.push(S.id)}d.value=i.shiftKey?new Set([...d.value,...M]):new Set(M),Je()}function Ha(i){return b.value.has(i)}function _g(i){const l=he(p.value,i.id);return!!l&&l.children.length>0}function mr(i){const l=he(p.value,i);return l?Ir(l):0}function Wa(i){if(!he(p.value,i))return 0;const x=[p.value];for(;x.length;){const k=x.pop(),M=k.children.findIndex(S=>S.id===i);if(M>=0)return M;for(const S of k.children)x.push(S)}return 0}function xi(i,l,u,x){const k=(x==null?void 0:x._dir)??i._dir;if(l==="out"&&i.isRoot&&f.lineOrigin==="center")return{x:i.x,y:i.y};if(l==="out"&&i.isRoot&&f.lineOrigin==="xmind"&&x){if(k==="down")return{x:i.x,y:i.y};const _=u!==void 0?u:i.side,W=i.children.filter(j=>j.side===_).sort((j,ie)=>j.y-ie.y),B=W.length,J=Math.max(0,W.findIndex(j=>j.id===x.id));let E=0;return B===2?E=.7:B>=3&&(E=J===0||J===B-1?.17:.45),{x:i.x+_*(i.width/2)*E,y:i.y}}if(l==="out"&&i.isRoot&&f.lineOrigin==="proportional"&&x){const _=x.x-i.x,W=x.y-i.y,B=i.width/2,J=i.height/2,E=_!==0?B/Math.abs(_):1/0,j=W!==0?J/Math.abs(W):1/0,ie=Math.min(E,j);return Number.isFinite(ie)?{x:i.x+_*ie,y:i.y+W*ie}:{x:i.x,y:i.y}}if(k==="down")return l==="out"?{x:i.x,y:i.y+i.height/2}:{x:i.x,y:i.y-i.height/2};let M;l==="in"?M=-i.side:u!==void 0?M=u:M=i.side;const S=l==="in"?i._richInsetX??0:0;return{x:i.x+M*(i.width/2-S),y:i.y}}function rn(){const i=St.value;Q.resetView(i.width,i.height,i.root.y)}function vg(){io.value=!0,ze(),ye(),e.nextTick(()=>rn())}function pr(i){f.layoutMode!==i&&(f.layoutMode=i,ye(),e.nextTick(()=>rn()))}function Rg(){return JSON.stringify(p.value,null,2)}function Ga(i){const l=he(p.value,i);return l?!!(l.note&&l.note.text||l.link&&l.link.url||l.image&&l.image.src||l.richContent&&l.richContent.raw||l.markers&&l.markers.length>0||l.tags&&l.tags.length>0):!1}function Bg(i){try{const l=JSON.parse(i);return!l.id||!Array.isArray(l.children)?!1:(nn.reset(),p.value=vt(l),d.value=new Set,b.value=new Set,ye(),e.nextTick(()=>rn()),a("change",p.value),!0)}catch{return!1}}const ja=e.ref(""),fn=e.ref([]),zo=e.ref(-1);function zg(i){ja.value=i;const l=i.trim();if(!l){fn.value=[],zo.value=-1;return}const u=l.toLowerCase(),x=[],k=M=>{var S;(M.text.toLowerCase().includes(u)||(S=M.note)!=null&&S.text&&M.note.text.toLowerCase().includes(u))&&x.push(M.id);for(const _ of M.children)k(_)};k(p.value),fn.value=x,zo.value=x.length>0?0:-1,x.length>0&&(Vg(x),e.nextTick(()=>Dg(0)))}function Ig(i){return fn.value.includes(i)}function Lg(i){return zo.value>=0&&fn.value[zo.value]===i}function Og(i){return ja.value.trim().length>0&&fn.value.length>0&&!fn.value.includes(i)}function Vg(i){if(i.length===0)return;const l=new Set(i),u=new Set,x=k=>{let M=l.has(k.id);for(const S of k.children)x(S)&&(M=!0);return M&&k.children.length>0&&b.value.has(k.id)&&u.add(k.id),M};if(x(p.value),u.size>0){for(const k of u)b.value.delete(k);ye()}}function Dg(i){const l=fn.value[i];if(!l)return;const u=Wt.value.find(x=>x.id===l);u&&(d.value=new Set([l]),Je(),Q.centerOn(u.x,u.y,u.width,u.height))}function $g(i,l){const u=he(p.value,i);u&&(u.markers||(u.markers=[]),!u.markers.includes(l)&&(u.markers.push(l),ze(),ye(),a("change",p.value)))}function Pg(i,l){const u=he(p.value,i);if(!u||!u.markers)return;const x=u.markers.indexOf(l);x<0||(u.markers.splice(x,1),u.markers.length===0&&delete u.markers,ze(),ye(),a("change",p.value))}function Ka(i,l){const u=he(p.value,i);if(!u)return!1;u.markers||(u.markers=[]);const x=u.markers.indexOf(l);return x>=0?(u.markers.splice(x,1),u.markers.length===0&&delete u.markers,ze(),ye(),a("change",p.value),!1):(u.markers.push(l),ze(),ye(),a("change",p.value),!0)}function Fg(i){const l=he(p.value,i);return l!=null&&l.markers?[...l.markers]:[]}function Ug(i){var u;const l=(u=z.value)==null?void 0:u.nodeId;l&&Ka(l,i)}function Hg(){var u;const i=(u=z.value)==null?void 0:u.nodeId;if(!i)return;const l=he(p.value,i);!l||!l.markers||(delete l.markers,ze(),ye(),a("change",p.value),xe())}function hr(i,l){const u=he(p.value,i);u&&(l.length===0?u.tags&&delete u.tags:u.tags=[...l],ze(),ye(),a("change",p.value))}function Wg(i){const l=he(p.value,i);return l!=null&&l.tags?[...l.tags]:[]}function Gg(){var M,S;const i=(M=z.value)==null?void 0:M.nodeId;if(!i)return;const l=he(p.value,i),u=((S=l==null?void 0:l.tags)==null?void 0:S.join(", "))??"",x=window.prompt("输入标签(多个用逗号分隔)",u);if(x===null)return;const k=x.split(/[,,]/).map(_=>_.trim()).filter(_=>_.length>0);hr(i,k),xe()}function jg(){var l;const i=(l=z.value)==null?void 0:l.nodeId;i&&(hr(i,[]),xe())}function Ya(){const i=St.value,l="http://www.w3.org/2000/svg",u=document.createElementNS(l,"svg");u.setAttribute("xmlns",l),u.setAttribute("viewBox",`${i.vbX} ${i.vbY} ${i.vbW} ${i.vbH}`),u.setAttribute("width",String(i.vbW)),u.setAttribute("height",String(i.vbH));const x=document.createElementNS(l,"rect");x.setAttribute("x",String(i.vbX)),x.setAttribute("y",String(i.vbY)),x.setAttribute("width",String(i.vbW)),x.setAttribute("height",String(i.vbH)),x.setAttribute("fill",oe.value),u.appendChild(x);for(const S of ma.value){const _=document.createElementNS(l,"path");_.setAttribute("d",_t(xi(S.from,"out",S.to.side,S.to),xi(S.to,"in"),Z(S.from.depth),Ie(S.to.depth),32,D(S.from.isRoot),S.to._dir)),_.setAttribute("fill",aa(S.from,S.to)),_.setAttribute("stroke","none"),u.appendChild(_)}const k="-apple-system,BlinkMacSystemFont,'Segoe UI','PingFang SC','Microsoft YaHei',sans-serif";function M(S,_){let W=0;for(const B of S)/[\u4e00-\u9fff\u3000-\u30ff\uff00-\uffef]/.test(B)?W+=_:W+=_*.55;return W}for(const S of ur.value){const _=document.createElementNS(l,"path");_.setAttribute("d",S.d),_.setAttribute("fill","none"),_.setAttribute("stroke",S.rel.color??"#94a3b8"),_.setAttribute("stroke-width","1.5"),_.setAttribute("stroke-dasharray","6 4"),_.setAttribute("stroke-linecap","round"),u.appendChild(_);const W=S.rel.color??"#94a3b8";for(const B of[S.arrowEnd,S.arrowStart]){if(!B)continue;const J=document.createElementNS(l,"path");J.setAttribute("d",B),J.setAttribute("fill",W),J.setAttribute("stroke","none"),u.appendChild(J)}if(S.rel.label){const B=document.createElementNS(l,"text");B.setAttribute("x",String(S.labelPos.x)),B.setAttribute("y",String(S.labelPos.y-6)),B.setAttribute("text-anchor","middle"),B.setAttribute("font-size","12"),B.setAttribute("font-family",k),B.setAttribute("fill","#64748b"),B.setAttribute("stroke",oe.value),B.setAttribute("stroke-width","3"),B.setAttribute("paint-order","stroke"),B.textContent=S.rel.label,u.appendChild(B)}}for(const S of Wt.value){const _=S.x-S.width/2,W=S.y-S.height/2,B=document.createElementNS(l,"rect");B.setAttribute("x",String(_)),B.setAttribute("y",String(W)),B.setAttribute("width",String(S.width)),B.setAttribute("height",String(S.height)),B.setAttribute("rx","8"),B.setAttribute("fill",sa(S));const J=ao(S);J!=="transparent"&&(B.setAttribute("stroke",J),B.setAttribute("stroke-width","1")),u.appendChild(B);const E=!!(S.tags&&S.tags.length>0),j=!!(S.markers&&S.markers.length>0),ie=!!S.image,be=!!(S.richContent&&(S.richContent.kind==="code"||S.richContent.kind==="table"));let Ce=0,Me=0;if(be){const qe=S.richContent,tt=S.fontSize*.78*.92,zt=6,Ue=4,an=2,Jt=6;if(qe.kind==="code"){const It=ei(qe.raw),Ct=_n(qe.raw),Lt=It.split(`
137
+ `),sn=tt*1.35;let Gt=0;for(const We of Lt)Gt=Math.max(Gt,M(We,tt));Me=Math.min(Gt+zt*2+4,S.width-4),Ce=Lt.length*sn+Ue*2+an;const nt=S.x-Me/2;let xt=W+4;ie&&(xt=W+S.image.height+Jt);const Ot=document.createElementNS(l,"rect");if(Ot.setAttribute("x",String(nt)),Ot.setAttribute("y",String(xt)),Ot.setAttribute("width",String(Me)),Ot.setAttribute("height",String(Ce-an)),Ot.setAttribute("rx","6"),Ot.setAttribute("fill","rgba(255,255,255,0.55)"),Ot.setAttribute("stroke",ao(S)),Ot.setAttribute("stroke-width","1"),u.appendChild(Ot),Ct){const We=document.createElementNS(l,"text");We.setAttribute("x",String(nt+Me-zt)),We.setAttribute("y",String(xt+Ue+4)),We.setAttribute("text-anchor","end"),We.setAttribute("fill",lo(S)),We.setAttribute("font-size",String(tt*.8)),We.setAttribute("font-family",k),We.setAttribute("opacity","0.5"),We.textContent=Ct,u.appendChild(We)}const Lo="'JetBrains Mono','Fira Code',Consolas,monospace";for(let We=0;We<Lt.length;We++){const dt=document.createElementNS(l,"text");dt.setAttribute("x",String(nt+zt)),dt.setAttribute("y",String(xt+Ue+(We+.5)*sn+2)),dt.setAttribute("dominant-baseline","central"),dt.setAttribute("fill",lo(S)),dt.setAttribute("font-size",String(tt)),dt.setAttribute("font-family",Lo);let jt=Lt[We];const Xe=Math.floor((Me-zt*2)/(tt*.6));jt.length>Xe&&(jt=jt.substring(0,Xe-1)+"…"),dt.textContent=jt,u.appendChild(dt)}}else if(qe.kind==="table"){const It=Di(qe.raw);if(It.length>0){const Ct=tt*1.35,Lt=6,sn=3,Gt=It[0].length,nt=[];for(let Xe=0;Xe<Gt;Xe++){let mn=0;for(const Tn of It)Xe<Tn.length&&(mn=Math.max(mn,M(Tn[Xe],tt)));nt.push(mn+Lt*2)}Me=Math.min(nt.reduce((Xe,mn)=>Xe+mn,0),S.width-4);const xt=Me/nt.reduce((Xe,mn)=>Xe+mn,0);for(let Xe=0;Xe<Gt;Xe++)nt[Xe]*=xt;Ce=It.length*(Ct+sn*2)+an;const Ot=S.x-Me/2;let Lo=W+4;ie&&(Lo=W+S.image.height+Jt);const We=document.createElementNS(l,"rect");We.setAttribute("x",String(Ot)),We.setAttribute("y",String(Lo)),We.setAttribute("width",String(Me)),We.setAttribute("height",String(Ce-an)),We.setAttribute("rx","6"),We.setAttribute("fill","rgba(255,255,255,0.55)"),We.setAttribute("stroke",ao(S)),We.setAttribute("stroke-width","1"),u.appendChild(We);let dt=Ot,jt=Lo;for(let Xe=0;Xe<It.length;Xe++){const mn=It[Xe],Tn=Ct+sn*2;dt=Ot;for(let Oo=0;Oo<Gt;Oo++){const co=nt[Oo],Kg=mn[Oo]||"";if(Oo<Gt-1){const Ze=document.createElementNS(l,"line");Ze.setAttribute("x1",String(dt+co)),Ze.setAttribute("y1",String(jt)),Ze.setAttribute("x2",String(dt+co)),Ze.setAttribute("y2",String(jt+Tn)),Ze.setAttribute("stroke",ao(S)),Ze.setAttribute("stroke-width","1"),u.appendChild(Ze)}if(Xe<It.length-1){const Ze=document.createElementNS(l,"line");Ze.setAttribute("x1",String(dt)),Ze.setAttribute("y1",String(jt+Tn)),Ze.setAttribute("x2",String(dt+co)),Ze.setAttribute("y2",String(jt+Tn)),Ze.setAttribute("stroke",ao(S)),Ze.setAttribute("stroke-width","1"),u.appendChild(Ze)}if(Xe===0){const Ze=document.createElementNS(l,"rect");Ze.setAttribute("x",String(dt)),Ze.setAttribute("y",String(jt)),Ze.setAttribute("width",String(co)),Ze.setAttribute("height",String(Tn)),Ze.setAttribute("fill","rgba(255,255,255,0.4)"),u.appendChild(Ze)}const pn=document.createElementNS(l,"text");pn.setAttribute("x",String(dt+Lt)),pn.setAttribute("y",String(jt+sn+Ct/2+2)),pn.setAttribute("dominant-baseline","central"),pn.setAttribute("fill",lo(S)),pn.setAttribute("font-size",String(tt)),pn.setAttribute("font-family",k),Xe===0&&pn.setAttribute("font-weight","600");let Ei=Kg;const gr=Math.floor((co-Lt*2)/(tt*.55));Ei.length>gr&&gr>2&&(Ei=Ei.substring(0,gr-1)+"…"),pn.textContent=Ei,u.appendChild(pn),dt+=co}jt+=Tn}}}}let Oe=0;if(ie){const qe=S.image,tt=W+4,zt=S.x-qe.width/2,Ue=document.createElementNS(l,"image");Ue.setAttribute("x",String(zt)),Ue.setAttribute("y",String(tt)),Ue.setAttribute("width",String(qe.width)),Ue.setAttribute("height",String(qe.height)),Ue.setAttribute("href",qe.src),Ue.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",qe.src),Ue.setAttribute("preserveAspectRatio","xMidYMid meet"),u.appendChild(Ue),Oe=qe.height+6}let ee=S.y;const _e=Oe+Ce;_e>0?ee=W+_e+(S.height-_e)/2:E&&(ee=S.y-8);const re=14,Ve=2,bt=4,K=j?S.markers.length:0,Te=K>0?K*re+(K-1)*Ve+bt:0,ve=M(S.text,S.fontSize),kt=Te+ve,ln=S.x-kt/2;if(j){let qe=ln;for(const tt of S.markers){const zt=Ho(tt);if(zt){const Ue=document.createElementNS(l,"svg");Ue.setAttribute("x",String(qe)),Ue.setAttribute("y",String(ee-re/2)),Ue.setAttribute("width",String(re)),Ue.setAttribute("height",String(re)),Ue.setAttribute("viewBox","0 0 24 24"),Ue.setAttribute("color",lo(S));const Jt=new DOMParser().parseFromString(`<svg xmlns="${l}">${zt}</svg>`,"image/svg+xml");if(!Jt.querySelector("parsererror"))for(;Jt.documentElement.firstChild;)Ue.appendChild(Jt.documentElement.firstChild);u.appendChild(Ue)}qe+=re+Ve}}const Bt=j?ln+Te+ve/2:S.x,yt=document.createElementNS(l,"text");if(yt.setAttribute("x",String(Bt)),yt.setAttribute("y",String(ee)),yt.setAttribute("text-anchor","middle"),yt.setAttribute("dominant-baseline","central"),yt.setAttribute("fill",lo(S)),yt.setAttribute("font-size",String(da(S))),yt.setAttribute("font-weight",String(ca(S))),yt.setAttribute("font-family",k),yt.textContent=S.text,u.appendChild(yt),E){const Ue=S.y+10,an=S.tags.map(Ct=>M(Ct,10)+12),Jt=an.reduce((Ct,Lt)=>Ct+Lt+3,-3);let It=S.x-Jt/2;for(let Ct=0;Ct<S.tags.length;Ct++){const Lt=S.tags[Ct],sn=Mi(Lt),Gt=an[Ct],nt=document.createElementNS(l,"rect");nt.setAttribute("x",String(It)),nt.setAttribute("y",String(Ue-16/2)),nt.setAttribute("width",String(Gt)),nt.setAttribute("height",String(16)),nt.setAttribute("rx",String(16/2)),nt.setAttribute("fill",sn.background),nt.setAttribute("stroke",sn.borderColor),nt.setAttribute("stroke-width","1"),u.appendChild(nt);const xt=document.createElementNS(l,"text");xt.setAttribute("x",String(It+Gt/2)),xt.setAttribute("y",String(Ue)),xt.setAttribute("text-anchor","middle"),xt.setAttribute("dominant-baseline","central"),xt.setAttribute("fill",sn.color),xt.setAttribute("font-size",String(10)),xt.setAttribute("font-family",k),xt.textContent=Lt,u.appendChild(xt),It+=Gt+3}}}return u}function Io(){const i=Ya();let u=new XMLSerializer().serializeToString(i);u.startsWith("<?xml")||(u=`<?xml version="1.0" encoding="UTF-8"?>
138
+ `+u);const x=new Blob([u],{type:"image/svg+xml;charset=utf-8"}),k=URL.createObjectURL(x),M=document.createElement("a");M.href=k,M.download=`${p.value.text||"mindmap"}.svg`,M.click(),URL.revokeObjectURL(k)}function qa(i=2){const l=Ya(),u=St.value;let k=new XMLSerializer().serializeToString(l);k.startsWith("<?xml")||(k=`<?xml version="1.0" encoding="UTF-8"?>
139
+ `+k);const M=new Blob([k],{type:"image/svg+xml;charset=utf-8"}),S=URL.createObjectURL(M),_=new window.Image;_.onload=()=>{const W=document.createElement("canvas");W.width=Math.ceil(u.vbW*i),W.height=Math.ceil(u.vbH*i);const B=W.getContext("2d");if(!B){URL.revokeObjectURL(S);return}B.fillStyle=oe.value,B.fillRect(0,0,W.width,W.height),B.drawImage(_,0,0,W.width,W.height),URL.revokeObjectURL(S);try{W.toBlob(J=>{if(!J){Io();return}const E=URL.createObjectURL(J),j=document.createElement("a");j.href=E,j.download=`${p.value.text||"mindmap"}.png`,j.click(),URL.revokeObjectURL(E)},"image/png")}catch(J){console.warn("PNG export failed, falling back to SVG:",J),Io()}},_.onerror=()=>{URL.revokeObjectURL(S),Io()},_.src=S}return o({addChild:i=>so(i),addSibling:i=>pi(i),removeNode:i=>Sa(i),duplicateNode:i=>ba(i),setNodeText:(i,l)=>Aa(i,l),moveNode:(i,l,u)=>cr(i,l,u),lineWidthForDepth:Z,endWidthForDepth:Ie,getData:()=>p.value,nodeHasContent:i=>Ga(i),getSelectedIds:()=>[...d.value],copyNodes:i=>Ea(i),cutNodes:i=>wa(i),pasteNodes:i=>Na(i),setData:i=>{nn.reset(),p.value=vt(i),d.value=new Set,b.value=new Set,ye(),ze(),e.nextTick(()=>rn())},resetView:()=>rn(),exportData:Rg,importData:Bg,getMarkdown:()=>Hn(p.value),setMarkdown:(i,l=!0)=>{const u=Un(i||"");l&&(q.value=!0),N=!l,nn.reset(),p.value=vt(u),d.value=new Set,b.value=new Set,ye(),ze(),e.nextTick(()=>{N=!1,rn()}),a("change",p.value)},setBalanced:i=>{io.value=i},isBalanced:()=>io.value,balance:()=>vg(),applyNodeStyle:(i,l)=>we(i,l),getNodeStyle:i=>te(i),applyNodeImage:(i,l)=>de(i,l),applyNodeImageByUrl:(i,l)=>g(i,l),removeNodeImage:i=>fe(i),applyNodeLink:(i,l)=>me(i,l),removeNodeLink:i=>O(i),applyNodeNote:(i,l)=>L(i,l),removeNodeNote:i=>ce(i),applyNodeRichContent:(i,l)=>ke(i,l),addNodeMarker:(i,l)=>$g(i,l),removeNodeMarker:(i,l)=>Pg(i,l),toggleNodeMarker:(i,l)=>Ka(i,l),getNodeMarkers:i=>Fg(i),setNodeTags:(i,l)=>hr(i,l),getNodeTags:i=>Wg(i),exportPNG:i=>qa(i),exportSVG:()=>Io(),searchNodes:i=>(zg(i),[...fn.value]),undo:()=>ar(),redo:()=>sr(),canUndo:()=>nn.canUndo(),canRedo:()=>nn.canRedo(),applySettings:i=>{i.autoBalanceOnChange!==void 0&&(f.autoBalanceOnChange=i.autoBalanceOnChange),i.lineWidthStart!==void 0&&(f.lineWidthStart=Math.max(.5,Math.min(20,i.lineWidthStart))),i.lineWidthEnd!==void 0&&(f.lineWidthEnd=Math.max(.3,Math.min(10,i.lineWidthEnd))),i.rainbowBranch!==void 0&&(f.rainbowBranch=i.rainbowBranch),i.branchPaletteId!==void 0&&(f.branchPaletteId=i.branchPaletteId),i.customPalettes!==void 0&&(f.customPalettes=i.customPalettes),i.lineStyle!==void 0&&(f.lineStyle=i.lineStyle),i.rootLineStyle!==void 0&&(f.rootLineStyle=i.rootLineStyle),i.lineOrigin!==void 0&&(f.lineOrigin=i.lineOrigin),i.taperedEdge!==void 0&&(f.taperedEdge=i.taperedEdge),i.lineWidthTaper!==void 0&&(f.lineWidthTaper=Math.max(.1,Math.min(1,i.lineWidthTaper))),i.uniformLineWidth!==void 0&&(f.uniformLineWidth=i.uniformLineWidth),i.elbowRadius!==void 0&&(f.elbowRadius=Math.max(2,Math.min(40,i.elbowRadius))),i.showOrderBadge!==void 0&&(f.showOrderBadge=i.showOrderBadge),i.canvasBg!==void 0&&(f.canvasBg=i.canvasBg),i.branchGap!==void 0&&(f.branchGap=Math.max(0,Math.min(80,i.branchGap))),i.layoutMode!==void 0&&f.layoutMode!==i.layoutMode&&(f.layoutMode=i.layoutMode,ye(),e.nextTick(()=>rn()))},getSettings:()=>({autoBalanceOnChange:f.autoBalanceOnChange,lineWidthStart:f.lineWidthStart,lineWidthEnd:f.lineWidthEnd,rainbowBranch:f.rainbowBranch,branchPaletteId:f.branchPaletteId,customPalettes:f.customPalettes,lineStyle:f.lineStyle,rootLineStyle:f.rootLineStyle,lineOrigin:f.lineOrigin,layoutMode:f.layoutMode,taperedEdge:f.taperedEdge,lineWidthTaper:f.lineWidthTaper,uniformLineWidth:f.uniformLineWidth,elbowRadius:f.elbowRadius,showOrderBadge:f.showOrderBadge,canvasBg:f.canvasBg,branchGap:f.branchGap}),setBranchPalette:i=>{if(!i)return;[...hn,...f.customPalettes].find(u=>u.id===i)&&(f.branchPaletteId=i)},getBranchPalette:()=>f.branchPaletteId,getBranchPalettes:()=>[...hn,...f.customPalettes],getSearchResults:()=>[...fn.value],getSearchIndex:()=>zo.value,addRelation:(i,l)=>Ia(i,l),removeRelation:i=>La(i),updateRelation:(i,l)=>Oa(i,l),getRelations:()=>vt(p.value.relations??[])}),e.watch(()=>r.data,i=>{p.value=vt(i),ye()},{deep:!1}),e.onMounted(()=>{ze(),e.nextTick(()=>rn())}),(i,l)=>{var u,x,k,M,S,_,W,B,J;return e.openBlock(),e.createElementBlock("div",{class:"zm-mindmap",style:e.normalizeStyle({background:oe.value,fontSize:ct.value.fontSize+"px"})},[e.createElementVNode("div",{ref_key:"wrapperRef",ref:c,class:e.normalizeClass(["zm-canvas",{"is-relation-mode":!!gt.value}]),onMousedown:Tg,onContextmenu:ot,onWheel:l[30]||(l[30]=(...E)=>e.unref(Q).onWheel&&e.unref(Q).onWheel(...E)),onMouseenter:l[31]||(l[31]=E=>A.value=!0),onMouseleave:l[32]||(l[32]=E=>A.value=!1),onClick:Mg},[e.createElementVNode("div",{class:"zm-svg-layer",style:e.normalizeStyle({left:St.value.vbX*e.unref(Q).scale.value+e.unref(Q).offsetX.value+"px",top:St.value.vbY*e.unref(Q).scale.value+e.unref(Q).offsetY.value+"px",width:St.value.vbW*e.unref(Q).scale.value+"px",height:St.value.vbH*e.unref(Q).scale.value+"px"})},[(e.openBlock(),e.createElementBlock("svg",{class:"zm-svg",viewBox:sg.value,preserveAspectRatio:"xMinYMin meet",width:St.value.vbW*e.unref(Q).scale.value,height:St.value.vbH*e.unref(Q).scale.value},[e.createElementVNode("g",xh,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ma.value,E=>(e.openBlock(),e.createElementBlock("path",{key:E.key,d:_t(xi(E.from,"out",E.to.side,E.to),xi(E.to,"in"),Z(E.from.depth),Ie(E.to.depth),32,D(E.from.isRoot),E.to._dir),fill:aa(E.from,E.to),stroke:"none"},null,8,Eh))),128))]),e.createElementVNode("g",wh,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ur.value,E=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:E.rel.id},[e.createElementVNode("path",{class:"zm-relation-hit",d:E.d,onClick:j=>Da(j,E.rel.id),onDblclick:j=>{j.stopPropagation(),Pa(E.rel.id)}},null,40,Nh),e.createElementVNode("path",{class:e.normalizeClass(["zm-relation-path",{"is-selected":ht.value===E.rel.id}]),d:E.d},null,10,Sh),E.arrowEnd?(e.openBlock(),e.createElementBlock("path",{key:0,class:e.normalizeClass(["zm-relation-arrow",{"is-selected":ht.value===E.rel.id}]),d:E.arrowEnd},null,10,Ch)):e.createCommentVNode("",!0),E.arrowStart?(e.openBlock(),e.createElementBlock("path",{key:1,class:e.normalizeClass(["zm-relation-arrow",{"is-selected":ht.value===E.rel.id}]),d:E.arrowStart},null,10,Th)):e.createCommentVNode("",!0),E.rel.label&&Cn.value!==E.rel.id?(e.openBlock(),e.createElementBlock("text",{key:2,class:"zm-relation-label",x:E.labelPos.x,y:E.labelPos.y-6,"text-anchor":"middle",onClick:j=>Da(j,E.rel.id),onDblclick:j=>{j.stopPropagation(),Pa(E.rel.id)}},e.toDisplayString(E.rel.label),41,Mh)):e.createCommentVNode("",!0),ht.value===E.rel.id&&!r.previewMode?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("line",{class:"zm-relation-guide",x1:E.from.x,y1:E.from.y,x2:E.c1.x,y2:E.c1.y},null,8,Ah),e.createElementVNode("line",{class:"zm-relation-guide",x1:E.to.x,y1:E.to.y,x2:E.c2.x,y2:E.c2.y},null,8,_h),e.createElementVNode("circle",{class:"zm-relation-handle zm-relation-handle-endpoint",cx:E.from.x,cy:E.from.y,r:6/e.unref(Q).scale.value,onPointerdown:j=>bi(j,E.rel.id,"from")},null,40,vh),e.createElementVNode("circle",{class:"zm-relation-handle zm-relation-handle-endpoint",cx:E.to.x,cy:E.to.y,r:6/e.unref(Q).scale.value,onPointerdown:j=>bi(j,E.rel.id,"to")},null,40,Rh),e.createElementVNode("rect",{class:"zm-relation-handle zm-relation-handle-ctrl",x:E.c1.x-5/e.unref(Q).scale.value,y:E.c1.y-5/e.unref(Q).scale.value,width:10/e.unref(Q).scale.value,height:10/e.unref(Q).scale.value,onPointerdown:j=>bi(j,E.rel.id,"c1")},null,40,Bh),e.createElementVNode("rect",{class:"zm-relation-handle zm-relation-handle-ctrl",x:E.c2.x-5/e.unref(Q).scale.value,y:E.c2.y-5/e.unref(Q).scale.value,width:10/e.unref(Q).scale.value,height:10/e.unref(Q).scale.value,onPointerdown:j=>bi(j,E.rel.id,"c2")},null,40,zh)],64)):e.createCommentVNode("",!0)],64))),128))])],8,yh))],4),e.unref(Q).isMarquee.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-marquee",style:e.normalizeStyle({left:e.unref(Q).marquee.x*e.unref(Q).scale.value+e.unref(Q).offsetX.value+"px",top:e.unref(Q).marquee.y*e.unref(Q).scale.value+e.unref(Q).offsetY.value+"px",width:e.unref(Q).marquee.width*e.unref(Q).scale.value+"px",height:e.unref(Q).marquee.height*e.unref(Q).scale.value+"px"})},null,4)):e.createCommentVNode("",!0),C.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"zm-drag-ghost",style:e.normalizeStyle({left:$.value+"px",top:R.value+"px",transform:`scale(${e.unref(Q).scale.value})`,transformOrigin:"top left"})},e.toDisplayString(C.value.srcText),5)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"zm-world",style:e.normalizeStyle({transform:`translate(${e.unref(Q).offsetX.value}px, ${e.unref(Q).offsetY.value}px) scale(${e.unref(Q).scale.value})`})},[U.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-drop-indicator",style:e.normalizeStyle({left:U.value.x1+"px",top:U.value.y1+"px",width:U.value.horizontal?U.value.x2-U.value.x1+"px":"3px",height:U.value.horizontal?"3px":U.value.y2-U.value.y1+"px",transform:U.value.horizontal?"translateY(-1.5px)":"translateX(-1.5px)"})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Wt.value,E=>{var j,ie,be,Ce,Me,Oe,ee,_e;return e.openBlock(),e.createElementBlock("div",{key:E.id,class:e.normalizeClass(["zm-node",{"is-root":E.isRoot,"is-selected":h.value===E.id,"is-selected-secondary":h.value!==E.id&&d.value.has(E.id),"is-editing":s.value===E.id,"has-image":!!E.image,"is-resizing":Rt.value===E.id,"is-dragging-source":((j=C.value)==null?void 0:j.srcId)===E.id,"is-drop-target":((ie=C.value)==null?void 0:ie.currentTargetId)===E.id&&((be=C.value)==null?void 0:be.dropPosition)==="child","is-drop-target-before":((Ce=C.value)==null?void 0:Ce.currentTargetId)===E.id&&((Me=C.value)==null?void 0:Me.dropPosition)==="before","is-drop-target-after":((Oe=C.value)==null?void 0:Oe.currentTargetId)===E.id&&((ee=C.value)==null?void 0:ee.dropPosition)==="after","is-search-hit":Ig(E.id),"is-search-current":Lg(E.id),"is-search-dimmed":Og(E.id),"is-relation-source":((_e=gt.value)==null?void 0:_e.fromId)===E.id,"is-relation-target":on.value!==null&&(on.value.end==="from"||on.value.end==="to")&&on.value.hoverNodeId===E.id}]),"data-node-id":E.id,style:e.normalizeStyle({left:E.x+"px",top:E.y+"px",width:E.width+"px",minWidth:E.width+"px",height:E.height+"px",fontSize:da(E)+"px",background:sa(E),color:lo(E),borderColor:ao(E),fontWeight:ca(E),transform:"translate(-50%, -50%)"}),onClick:re=>xg(re,E),onPointerdown:re=>Eg(re,E),onDblclick:re=>{re.stopPropagation(),t.previewMode||Bo(E.id)},onContextmenu:re=>ne(re,E),onMouseenter:re=>{wn(E.id),Xt(re,E)},onMouseleave:re=>no(E.id)},[E.image?(e.openBlock(),e.createElementBlock("img",{key:0,class:"zm-node-img",src:E.image.src,width:E.image.width,height:E.image.height,alt:E.text,draggable:"false"},null,8,Lh)):e.createCommentVNode("",!0),E.richContent&&(E.richContent.kind==="code"||E.richContent.kind==="table")&&s.value!==E.id?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["zm-rich zm-rich-above",{"zm-rich-no-overflow":E.richContent.kind==="table"||E.richContent.kind==="code"}]),onClick:l[1]||(l[1]=e.withModifiers(()=>{},["stop"])),onDblclick:e.withModifiers(re=>ug(E.id),["stop"]),onMousedown:l[2]||(l[2]=e.withModifiers(()=>{},["stop"]))},[w.value===E.id?e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:0,"onUpdate:modelValue":l[0]||(l[0]=re=>y.value=re),class:"zm-rich-edit",spellcheck:"false",onBlur:ga,onKeydown:mg},null,544)),[[e.vModelText,y.value]]):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[E.richContent.kind==="code"?(e.openBlock(),e.createElementBlock("pre",Vh,[e.createElementVNode("code",{innerHTML:e.unref(Vi)(e.unref(ei)(E.richContent.raw),e.unref(_n)(E.richContent.raw))},null,8,Dh)])):E.richContent.kind==="table"?(e.openBlock(),e.createElementBlock("table",$h,[e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(Di)(E.richContent.raw),(re,Ve)=>(e.openBlock(),e.createElementBlock("tr",{key:Ve},[Ve===0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(re,(bt,K)=>(e.openBlock(),e.createElementBlock("th",{key:`h${K}`},e.toDisplayString(bt),1))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(re,(bt,K)=>(e.openBlock(),e.createElementBlock("td",{key:`c${K}`},e.toDisplayString(bt),1))),128))]))),128))])])):e.createCommentVNode("",!0)],64))],42,Oh)):e.createCommentVNode("",!0),s.value!==E.id?(e.openBlock(),e.createElementBlock("span",Ph,[E.markers&&E.markers.length>0?(e.openBlock(),e.createElementBlock("span",Fh,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.markers,re=>(e.openBlock(),e.createElementBlock("span",{key:re,class:"zm-node-marker",title:e.unref(Vr)(re),innerHTML:'<svg viewBox="0 0 24 24" width="14" height="14">'+e.unref(Ho)(re)+"</svg>"},null,8,Uh))),128))])):e.createCommentVNode("",!0),e.createElementVNode("span",Hh,e.toDisplayString(E.text),1),E.link&&s.value!==E.id?(e.openBlock(),e.createElementBlock("a",{key:1,class:"zm-node-link",href:E.link.url,target:"_blank",rel:"noopener noreferrer",title:`打开链接:${E.link.url}`,onClick:l[3]||(l[3]=e.withModifiers(()=>{},["stop"])),onMousedown:l[4]||(l[4]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(Re,{name:"link",size:11,stroke:2})],40,Wh)):e.createCommentVNode("",!0),E.note&&s.value!==E.id?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-node-note-btn",type:"button",title:To(E.note.text),onClick:e.withModifiers(re=>Co(E.id),["stop"]),onMousedown:l[5]||(l[5]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(Re,{name:"note",size:11,stroke:2})],40,Gh)):e.createCommentVNode("",!0)])):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:3,class:"zm-input","onUpdate:modelValue":l[6]||(l[6]=re=>m.value=re),autofocus:"",rows:"1",onBlur:l[7]||(l[7]=re=>lr()),onKeydown:[l[8]||(l[8]=e.withKeys(e.withModifiers(re=>lr(),["exact","prevent"]),["enter"])),l[9]||(l[9]=e.withKeys(e.withModifiers(re=>lr(),["prevent"]),["tab"])),e.withKeys(cg,["esc"]),pg],onInput:dg,onMousedown:l[10]||(l[10]=e.withModifiers(()=>{},["stop"])),onClick:l[11]||(l[11]=e.withModifiers(()=>{},["stop"]))},null,544)),[[e.vModelText,m.value]]),E.tags&&E.tags.length>0&&s.value!==E.id?(e.openBlock(),e.createElementBlock("div",jh,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.tags,re=>(e.openBlock(),e.createElementBlock("span",{key:re,class:"zm-node-tag",style:e.normalizeStyle(e.unref(Mi)(re))},e.toDisplayString(re),5))),128))])):e.createCommentVNode("",!0),ae.value?(e.openBlock(),e.createElementBlock("span",{key:5,class:"zm-order-badge",title:`数据顺序:第 ${Wa(E.id)+1} 个`},e.toDisplayString(Wa(E.id)+1),9,Kh)):e.createCommentVNode("",!0),Ha(E.id)&&mr(E.id)>0?(e.openBlock(),e.createElementBlock("span",{key:6,class:e.normalizeClass(["zm-collapse-badge",{"is-on-left":E.side===-1}]),style:e.normalizeStyle({background:Sn.value.get(E.id)??"#64748b"}),title:`展开 ${mr(E.id)} 个子节点`,onMousedown:l[12]||(l[12]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(re=>Ca(E.id),["stop"])},e.toDisplayString(mr(E.id)),47,Yh)):e.createCommentVNode("",!0),_g(E)&&!Ha(E.id)?(e.openBlock(),e.createElementBlock("button",{key:7,class:e.normalizeClass(["zm-btn zm-collapse",{"is-on-left":E.side===-1}]),style:e.normalizeStyle({"--zm-collapse-color":Sn.value.get(E.id)??"#64748b"}),title:"折叠",onMousedown:l[13]||(l[13]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(re=>Ca(E.id),["stop"])},[...l[40]||(l[40]=[e.createElementVNode("span",{class:"zm-collapse-bar"},null,-1)])],46,qh)):e.createCommentVNode("",!0),E.image&&h.value===E.id&&s.value!==E.id?(e.openBlock(),e.createElementBlock("span",{key:8,class:"zm-img-resize-handle",title:"拖动调整图片大小",onMousedown:e.withModifiers(re=>un(re,E),["stop"])},null,40,Xh)):e.createCommentVNode("",!0),E.image&&h.value===E.id&&s.value!==E.id?(e.openBlock(),e.createElementBlock("button",{key:9,class:"zm-img-remove-btn",title:"移除图片",onMousedown:l[14]||(l[14]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(re=>fe(E.id),["stop"])},[e.createVNode(Re,{name:"x",size:10,stroke:2.2})],40,Zh)):e.createCommentVNode("",!0)],46,Ih)}),128)),fr.value?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:1,"onUpdate:modelValue":l[15]||(l[15]=E=>gi.value=E),class:"zm-relation-label-input",placeholder:"联系",style:e.normalizeStyle({left:fr.value.labelPos.x+"px",top:fr.value.labelPos.y+"px"}),onBlur:Fa,onKeydown:[e.withKeys(e.withModifiers(Fa,["prevent"]),["enter"]),l[16]||(l[16]=e.withKeys(E=>Cn.value=null,["esc"]))],onMousedown:l[17]||(l[17]=e.withModifiers(()=>{},["stop"])),onClick:l[18]||(l[18]=e.withModifiers(()=>{},["stop"]))},null,44,Jh)),[[e.vModelText,gi.value]]):e.createCommentVNode("",!0)],4),v.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["zm-tooltip",{"is-below":!v.value.above}]),style:e.normalizeStyle({left:v.value.x+"px",top:v.value.y+"px"})},e.toDisplayString(v.value.text),7)):e.createCommentVNode("",!0),z.value?(e.openBlock(),e.createBlock(Ks,{key:3,x:z.value.x,y:z.value.y,container:c.value,"has-image":!!((u=e.unref(he)(p.value,z.value.nodeId))!=null&&u.image),"has-link":!!((x=e.unref(he)(p.value,z.value.nodeId))!=null&&x.link),"has-note":!!((k=e.unref(he)(p.value,z.value.nodeId))!=null&&k.note),"has-code":((S=(M=e.unref(he)(p.value,z.value.nodeId))==null?void 0:M.richContent)==null?void 0:S.kind)==="code","has-table":((W=(_=e.unref(he)(p.value,z.value.nodeId))==null?void 0:_.richContent)==null?void 0:W.kind)==="table","node-markers":((B=e.unref(he)(p.value,z.value.nodeId))==null?void 0:B.markers)??[],"node-tags":((J=e.unref(he)(p.value,z.value.nodeId))==null?void 0:J.tags)??[],onPickImage:wo,onRemoveImage:On,onSetLink:nr,onRemoveLink:No,onEditNote:So,onRemoveNote:or,onAddCode:mi,onEditCode:mi,onRemoveCode:ir,onAddTable:je,onEditTable:je,onRemoveTable:xn,onToggleMarker:Ug,onClearMarkers:Hg,onAddTag:Gg,onRemoveTags:jg,onAddRelation:rr,onClose:xe},null,8,["x","y","container","has-image","has-link","has-note","has-code","has-table","node-markers","node-tags"])):e.createCommentVNode("",!0),T.value?(e.openBlock(),e.createBlock(Ys,{key:4,x:T.value.x,y:T.value.y,container:c.value,onOpenSettings:it,onOpenData:cn,onOpenImport:rt,onExportPng:qa,onExportSvg:Io,onClose:mt},null,8,["x","y","container"])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(F.value),title:r.previewMode?"退出预览模式":"进入预览模式",onClick:l[19]||(l[19]=E=>a("canvas-toggle-preview"))},[e.createVNode(Re,{name:r.previewMode?"eye-off":"eye",size:16},null,8,["name"])],10,Qh),e.createElementVNode("button",{class:e.normalizeClass(H.value),title:"显示大纲视图",onClick:Eo},[e.createVNode(Re,{name:"outline",size:16})],2),e.createElementVNode("div",{class:e.normalizeClass(["zm-toolbar",{"is-preview-only":r.previewMode,"is-hovered":A.value}])},[e.createElementVNode("span",{class:"zm-tb-tip zm-tb-zoom",title:"点击重置为 100%",onClick:l[20]||(l[20]=E=>e.unref(Q).zoomTo100())},e.toDisplayString(Math.round(e.unref(Q).scale.value*100))+"%",1),e.createElementVNode("button",{class:"zm-tb-btn",title:"放大",onClick:l[21]||(l[21]=(...E)=>e.unref(Q).zoomIn&&e.unref(Q).zoomIn(...E))},[e.createVNode(Re,{name:"zoom-in"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"缩小",onClick:l[22]||(l[22]=(...E)=>e.unref(Q).zoomOut&&e.unref(Q).zoomOut(...E))},[e.createVNode(Re,{name:"zoom-out"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"重置视图",onClick:rn},[e.createVNode(Re,{name:"reset"})]),l[43]||(l[43]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"全部收起",onClick:bg},[e.createVNode(Re,{name:"collapse-all"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"展开一级",onClick:l[23]||(l[23]=E=>Ma(1))},[e.createVNode(Re,{name:"expand-level-1"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"展开二级",onClick:l[24]||(l[24]=E=>Ma(2))},[e.createVNode(Re,{name:"expand-level-2"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"全部展开",onClick:kg},[e.createVNode(Re,{name:"expand-all"})]),r.previewMode?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[l[41]||(l[41]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"添加子节点 (Tab)",onClick:l[25]||(l[25]=E=>h.value&&so(h.value))},[e.createElementVNode("img",{src:e.unref(xr),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,eg)]),e.createElementVNode("button",{class:"zm-tb-btn",title:"添加同级 (Enter)",onClick:l[26]||(l[26]=E=>h.value&&pi(h.value))},[e.createElementVNode("img",{src:e.unref(yr),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,tg)]),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:!!gt.value}]),title:"联系(依次点选两个节点,Esc 取消)",onClick:Cg},[e.createVNode(Re,{name:"relation"})],2),l[42]||(l[42]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:f.layoutMode==="mindmap"}]),title:"思维导图布局 (中心辐射)",onClick:l[27]||(l[27]=E=>pr("mindmap"))},[e.createVNode(Re,{name:"mindmap"})],2),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:f.layoutMode==="tree"}]),title:"树形布局 (向右展开)",onClick:l[28]||(l[28]=E=>pr("tree"))},[e.createVNode(Re,{name:"tree"})],2),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:f.layoutMode==="org"}]),title:"组织结构布局 (向下展开)",onClick:l[29]||(l[29]=E=>pr("org"))},[e.createVNode(Re,{name:"org"})],2)],64))],2)],34),r.builtInDrawers?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode($t,{side:"left",scope:"canvas",width:300,open:dn.value&&!t.previewMode,title:"大纲","onUpdate:open":l[33]||(l[33]=E=>dn.value=E)},{default:e.withCtx(()=>[e.createVNode(Wo,{data:p.value,"selected-id":h.value,"collapsed-ids":lt.value,"show-index":ae.value,onSelect:xo,onToggleCollapse:yn,onEdit:fi,onAddChild:eo,onAddSibling:to,onMove:Ht},null,8,["data","selected-id","collapsed-ids","show-index"])]),_:1},8,["open"]),e.createVNode($t,{side:"right",scope:"canvas",width:360,open:Ft.value&&!t.previewMode,title:"数据","onUpdate:open":l[35]||(l[35]=E=>Ft.value=E)},{default:e.withCtx(()=>[e.createVNode(Go,{data:p.value,"pending-mode":Ut.value,onImport:l[34]||(l[34]=E=>p.value=E),onConsumedMode:Ge},null,8,["data","pending-mode"])]),_:1},8,["open"]),e.createVNode($t,{side:"right",scope:"canvas",width:420,open:pe.value&&!t.previewMode,title:"Markdown","onUpdate:open":l[37]||(l[37]=E=>pe.value=E)},{default:e.withCtx(()=>[e.createVNode(jo,{data:p.value,onImport:l[36]||(l[36]=E=>p.value=E)},null,8,["data"])]),_:1},8,["open"]),e.createVNode($t,{side:"right",scope:"canvas",width:360,open:pt.value&&!t.previewMode,title:"节点内容","onUpdate:open":l[38]||(l[38]=E=>pt.value=E)},{default:e.withCtx(()=>[e.createVNode(ai,{"selected-node":Nt.value,"focus-tick":De.value,onApply:at,onRemove:Mt,onSetLink:Ln,onSetImage:di,onSetRich:ui},null,8,["selected-node","focus-tick"])]),_:1},8,["open"]),e.createVNode($t,{side:"right",scope:"canvas",width:340,open:$e.value&&!t.previewMode,title:"设置","onUpdate:open":l[39]||(l[39]=E=>$e.value=E)},{default:e.withCtx(()=>{var E;return[e.createVNode(Ko,{settings:f,"has-selection":h.value!==null,"selected-node-text":(E=Nt.value)==null?void 0:E.text,"node-style":X.value,"onUpdate:settings":se,"onUpdate:nodeStyle":Ee,onReset:Be},null,8,["settings","has-selection","selected-node-text","node-style"])]}),_:1},8,["open"])],64)):e.createCommentVNode("",!0)],4)}}}),ng={class:"zm-app"},og={class:"zm-app-main"},ig={class:"zm-app-canvas"},la=e.defineComponent({__name:"App",setup(t){const o={id:"r_root",text:"flow-mindmap 节点能力一览",link:{url:"https://github.com/xz333221/flow-mindmap"},note:{text:`本导图用于演示节点的全部可渲染字段。
140
140
  所有代码块 / 表格在节点标题上方显示,不会撑大节点框。`},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 形式携带,
141
141
  渲染在节点标题上方,自动支持语言 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
142
142
  interface Node {
@@ -167,4 +167,4 @@ function walk(n: Node) {
167
167
  | --- | --- | --- | --- | --- |
168
168
  | 1 | 2 | 3 | 4 | 5 |
169
169
  | 6 | 7 | 8 | 9 | 10 |`},children:[]}]},{id:"r_note",text:"笔记 (note)",note:{text:`节点右上角的便签图标。
170
- 鼠标悬浮预览前 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"?a:(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:[]}]},a=(()=>{const z=(W,te)=>({id:W,text:te,children:[]}),S=[z("s_l1","左一"),z("s_l2","左二"),z("s_l3","左三"),z("s_l4","左四"),z("s_l5","左五"),z("s_l6","左六"),z("s_l7","左七")],F=[z("s_r1","右一"),z("s_r2","右二"),z("s_r3","右三"),z("s_r4","右四"),z("s_r5","右五"),z("s_r6","右六"),z("s_r7","右七")];return{id:"root",text:"flow-mindmap 思维导图",children:[...S,...F]}})(),c=e.ref(o),s=e.ref(null),u=e.ref(new Set),d=e.ref(!1),p=e.ref(!1),b=e.ref(!1),C=e.ref(!1),w=e.ref(0),V=e.ref(!1),R=e.ref(!1),U=e.ref(null);function I(){c.value=n()}function _(){p.value=!0,b.value=!1,C.value=!1}function y(z){_()}const k=e.reactive({autoBalanceOnChange:!0,lineWidthStart:16,lineWidthEnd:3.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"rounded-elbow",rootLineStyle:"arc",lineOrigin:"proportional",layoutMode:"mindmap",taperedEdge:!0,lineWidthTaper:.1,uniformLineWidth:!0,elbowRadius:20,showOrderBadge:!1,canvasBg:void 0,branchGap:20}),m=e.computed(()=>{var z;return s.value?((z=U.value)==null?void 0:z.getNodeStyle(s.value.id))??{}:{}});function P(z){var S;Object.assign(k,z),(S=U.value)==null||S.applySettings(z)}function j(z){var S;s.value&&((S=U.value)==null||S.applyNodeStyle(s.value.id,z))}function Y(){var S;const z={autoBalanceOnChange:!0,lineWidthStart:16,lineWidthEnd:.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"rounded-elbow",rootLineStyle:"arc",lineOrigin:"proportional",layoutMode:"mindmap",taperedEdge:!0,lineWidthTaper:.1,uniformLineWidth:!0,elbowRadius:20,showOrderBadge:!1,canvasBg:void 0,branchGap:20};Object.assign(k,z),(S=U.value)==null||S.applySettings(z)}function x(z){if(z.key==="Escape"){if(V.value){V.value=!1,z.stopPropagation();return}R.value&&(R.value=!1,z.stopPropagation())}}e.onMounted(()=>{var z;document.addEventListener("keydown",x),window.addEventListener("hashchange",I),(z=U.value)==null||z.applySettings({rainbowBranch:k.rainbowBranch,branchPaletteId:k.branchPaletteId,customPalettes:k.customPalettes,lineWidthStart:k.lineWidthStart,lineWidthEnd:k.lineWidthEnd,lineStyle:k.lineStyle,rootLineStyle:k.rootLineStyle,lineOrigin:k.lineOrigin})}),e.onBeforeUnmount(()=>{document.removeEventListener("keydown",x),window.removeEventListener("hashchange",I)});function re(z){c.value=z}function pe(z){var F;const S=z&&z.length>0?z[0]:null;s.value=S,S?!C.value&&((F=U.value)!=null&&F.nodeHasContent(S.id))&&(p.value=!1,b.value=!1,C.value=!0):C.value=!1}e.watch(c,z=>{if(!s.value)return;const S=we(z,s.value.id);S?S!==s.value&&(s.value=S):s.value=null},{deep:!1});function de(z){if(!s.value||s.value.id!==z){const S=we(c.value,z);S&&(s.value=S)}p.value=!1,b.value=!1,C.value=!0,w.value++}function we(z,S){if(z.id===S)return z;for(const F of z.children){const W=we(F,S);if(W)return W}return null}function ee(z){var S;s.value&&((S=U.value)==null||S.applyNodeNote(s.value.id,z))}function ce(){var z;s.value&&((z=U.value)==null||z.removeNodeNote(s.value.id))}function ue(z){var S;s.value&&((S=U.value)==null||S.applyNodeLink(s.value.id,z))}function h(z){var S;s.value&&((S=U.value)==null||S.applyNodeImageByUrl(s.value.id,z))}function $(z){var S;s.value&&((S=U.value)==null||S.applyNodeRichContent(s.value.id,z))}function G(z){const S=document.querySelector(`[data-node-id="${z.id}"]`);S&&S.click()}function oe(z){const S=new Set(u.value);S.has(z)?S.delete(z):S.add(z),u.value=S}function fe(z){var S;(S=U.value)==null||S.setNodeText(z.id,z.text)}function O(z){var S;(S=U.value)==null||S.addChild(z)}function L(z){var S;(S=U.value)==null||S.addSibling(z)}function se(z){var S;(S=U.value)==null||S.moveNode(z.srcId,z.targetId,z.position)}const ke=e.computed(()=>{var z;return((z=s.value)==null?void 0:z.id)??null});return(z,S)=>(e.openBlock(),e.createElementBlock("div",fh,[e.createVNode(Vt,{side:"left",width:300,open:d.value,title:"大纲","onUpdate:open":S[0]||(S[0]=F=>d.value=F)},{default:e.withCtx(()=>[e.createVNode(Oo,{data:c.value,"selected-id":ke.value,"collapsed-ids":u.value,onSelect:G,onToggleCollapse:oe,onEdit:fe,onAddChild:O,onAddSibling:L,onMove:se},null,8,["data","selected-id","collapsed-ids"])]),_:1},8,["open"]),e.createElementVNode("main",mh,[R.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-app-preview-exit",title:"退出预览 (Esc)",onClick:S[1]||(S[1]=F=>R.value=!1)},[...S[11]||(S[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",ph,[e.createVNode(ei,{ref_key:"mindMapRef",ref:U,data:c.value,"preview-mode":R.value,"built-in-drawers":!1,onChange:re,onSelect:pe,onEditNote:de,onCanvasSettings:S[2]||(S[2]=F=>V.value=!0),onCanvasData:_,onCanvasImport:y,onCanvasTogglePreview:S[3]||(S[3]=F=>R.value=!R.value),onCanvasOutline:S[4]||(S[4]=F=>d.value=!0)},null,8,["data","preview-mode"])])]),e.createVNode(Vt,{side:"right",width:360,open:p.value&&!R.value,title:"数据","onUpdate:open":S[6]||(S[6]=F=>p.value=F)},{default:e.withCtx(()=>[e.createVNode(Do,{data:c.value,onImport:S[5]||(S[5]=F=>c.value=F)},null,8,["data"])]),_:1},8,["open"]),e.createVNode(Vt,{side:"right",width:420,open:b.value&&!R.value,title:"Markdown","onUpdate:open":S[8]||(S[8]=F=>b.value=F)},{default:e.withCtx(()=>[e.createVNode(Vo,{data:c.value,onImport:S[7]||(S[7]=F=>c.value=F)},null,8,["data"])]),_:1},8,["open"]),e.createVNode(Vt,{side:"right",width:360,open:C.value&&!R.value,title:"节点内容","onUpdate:open":S[9]||(S[9]=F=>C.value=F)},{default:e.withCtx(()=>[e.createVNode(Qo,{"selected-node":s.value,readonly:!1,"focus-tick":w.value,onApply:ee,onRemove:ce,onSetLink:ue,onSetImage:h,onSetRich:$},null,8,["selected-node","focus-tick"])]),_:1},8,["open"]),e.createVNode(Vt,{side:"right",width:340,open:V.value&&!R.value,title:"设置","onUpdate:open":S[10]||(S[10]=F=>V.value=F)},{default:e.withCtx(()=>{var F;return[e.createVNode($o,{settings:k,"has-selection":s.value!==null,"selected-node-text":(F=s.value)==null?void 0:F.text,"node-style":m.value,"onUpdate:settings":P,"onUpdate:nodeStyle":j,onReset:Y},null,8,["settings","has-selection","selected-node-text","node-style"])]}),_:1},8,["open"])]))}}),hh="0.5.13",gh={install(t){t.component("FlowMindMap",ei),t.component("FlowMindMapOutline",Oo),t.component("FlowMindMapDrawer",Vt),t.component("FlowMindMapDataPanel",Do),t.component("FlowMindMapMarkdownPanel",Vo),t.component("FlowMindMapSettingsPanel",$o),t.component("FlowMindMapNotePanel",Qo),t.component("FlowMindMapApp",Yl)}};Ce.DataPanel=Do,Ce.Drawer=Vt,Ce.MARKER_LIB=ki,Ce.MarkdownPanel=Vo,Ce.MindMap=ei,Ce.MindMapApp=Yl,Ce.NotePanel=Qo,Ce.Outline=Oo,Ce.SettingsPanel=$o,Ce.VERSION=hh,Ce.addChild=bi,Ce.addSibling=Er,Ce.clone=Ot,Ce.default=gh,Ce.findNode=be,Ce.findParent=Dt,Ce.markdownToMindMap=On,Ce.markdownToRichMindMap=ts,Ce.markerDef=fs,Ce.markerLabel=Tr,Ce.markerSvg=Lo,Ce.mindMapToMarkdown=Dn,Ce.removeNode=Bo,Ce.richBlockToMarkdown=ns,Ce.tagColor=yi,Ce.uid=Xt,Object.defineProperties(Ce,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
170
+ 鼠标悬浮预览前 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"?a:(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:[]}]},a=(()=>{const z=(H,ne)=>({id:H,text:ne,children:[]}),T=[z("s_l1","左一"),z("s_l2","左二"),z("s_l3","左三"),z("s_l4","左四"),z("s_l5","左五"),z("s_l6","左六"),z("s_l7","左七")],F=[z("s_r1","右一"),z("s_r2","右二"),z("s_r3","右三"),z("s_r4","右四"),z("s_r5","右五"),z("s_r6","右六"),z("s_r7","右七")];return{id:"root",text:"flow-mindmap 思维导图",children:[...T,...F]}})(),c=e.ref(o),s=e.ref(null),m=e.ref(new Set),d=e.ref(!1),h=e.ref(!1),b=e.ref(!1),A=e.ref(!1),C=e.ref(0),$=e.ref(!1),R=e.ref(!1),U=e.ref(null);function I(){c.value=n()}function v(){h.value=!0,b.value=!1,A.value=!1}function w(z){v()}const y=e.reactive({autoBalanceOnChange:!0,lineWidthStart:16,lineWidthEnd:3.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"rounded-elbow",rootLineStyle:"arc",lineOrigin:"proportional",layoutMode:"mindmap",taperedEdge:!0,lineWidthTaper:.1,uniformLineWidth:!0,elbowRadius:20,showOrderBadge:!1,canvasBg:void 0,branchGap:20}),p=e.computed(()=>{var z;return s.value?((z=U.value)==null?void 0:z.getNodeStyle(s.value.id))??{}:{}});function P(z){var T;Object.assign(y,z),(T=U.value)==null||T.applySettings(z)}function Y(z){var T;s.value&&((T=U.value)==null||T.applyNodeStyle(s.value.id,z))}function q(){var T;const z={autoBalanceOnChange:!0,lineWidthStart:16,lineWidthEnd:.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"rounded-elbow",rootLineStyle:"arc",lineOrigin:"proportional",layoutMode:"mindmap",taperedEdge:!0,lineWidthTaper:.1,uniformLineWidth:!0,elbowRadius:20,showOrderBadge:!1,canvasBg:void 0,branchGap:20};Object.assign(y,z),(T=U.value)==null||T.applySettings(z)}function N(z){if(z.key==="Escape"){if($.value){$.value=!1,z.stopPropagation();return}R.value&&(R.value=!1,z.stopPropagation())}}e.onMounted(()=>{var z;document.addEventListener("keydown",N),window.addEventListener("hashchange",I),(z=U.value)==null||z.applySettings({rainbowBranch:y.rainbowBranch,branchPaletteId:y.branchPaletteId,customPalettes:y.customPalettes,lineWidthStart:y.lineWidthStart,lineWidthEnd:y.lineWidthEnd,lineStyle:y.lineStyle,rootLineStyle:y.rootLineStyle,lineOrigin:y.lineOrigin})}),e.onBeforeUnmount(()=>{document.removeEventListener("keydown",N),window.removeEventListener("hashchange",I)});function ae(z){c.value=z}function ge(z){var F;const T=z&&z.length>0?z[0]:null;s.value=T,T?!A.value&&((F=U.value)!=null&&F.nodeHasContent(T.id))&&(h.value=!1,b.value=!1,A.value=!0):A.value=!1}e.watch(c,z=>{if(!s.value)return;const T=we(z,s.value.id);T?T!==s.value&&(s.value=T):s.value=null},{deep:!1});function ue(z){if(!s.value||s.value.id!==z){const T=we(c.value,z);T&&(s.value=T)}h.value=!1,b.value=!1,A.value=!0,C.value++}function we(z,T){if(z.id===T)return z;for(const F of z.children){const H=we(F,T);if(H)return H}return null}function te(z){var T;s.value&&((T=U.value)==null||T.applyNodeNote(s.value.id,z))}function de(){var z;s.value&&((z=U.value)==null||z.removeNodeNote(s.value.id))}function fe(z){var T;s.value&&((T=U.value)==null||T.applyNodeLink(s.value.id,z))}function g(z){var T;s.value&&((T=U.value)==null||T.applyNodeImageByUrl(s.value.id,z))}function V(z){var T;s.value&&((T=U.value)==null||T.applyNodeRichContent(s.value.id,z))}function G(z){const T=document.querySelector(`[data-node-id="${z.id}"]`);T&&T.click()}function le(z){const T=new Set(m.value);T.has(z)?T.delete(z):T.add(z),m.value=T}function me(z){var T;(T=U.value)==null||T.setNodeText(z.id,z.text)}function O(z){var T;(T=U.value)==null||T.addChild(z)}function L(z){var T;(T=U.value)==null||T.addSibling(z)}function ce(z){var T;(T=U.value)==null||T.moveNode(z.srcId,z.targetId,z.position)}const ke=e.computed(()=>{var z;return((z=s.value)==null?void 0:z.id)??null});return(z,T)=>(e.openBlock(),e.createElementBlock("div",ng,[e.createVNode($t,{side:"left",width:300,open:d.value,title:"大纲","onUpdate:open":T[0]||(T[0]=F=>d.value=F)},{default:e.withCtx(()=>[e.createVNode(Wo,{data:c.value,"selected-id":ke.value,"collapsed-ids":m.value,onSelect:G,onToggleCollapse:le,onEdit:me,onAddChild:O,onAddSibling:L,onMove:ce},null,8,["data","selected-id","collapsed-ids"])]),_:1},8,["open"]),e.createElementVNode("main",og,[R.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-app-preview-exit",title:"退出预览 (Esc)",onClick:T[1]||(T[1]=F=>R.value=!1)},[...T[11]||(T[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",ig,[e.createVNode(si,{ref_key:"mindMapRef",ref:U,data:c.value,"preview-mode":R.value,"built-in-drawers":!1,onChange:ae,onSelect:ge,onEditNote:ue,onCanvasSettings:T[2]||(T[2]=F=>$.value=!0),onCanvasData:v,onCanvasImport:w,onCanvasTogglePreview:T[3]||(T[3]=F=>R.value=!R.value),onCanvasOutline:T[4]||(T[4]=F=>d.value=!0)},null,8,["data","preview-mode"])])]),e.createVNode($t,{side:"right",width:360,open:h.value&&!R.value,title:"数据","onUpdate:open":T[6]||(T[6]=F=>h.value=F)},{default:e.withCtx(()=>[e.createVNode(Go,{data:c.value,onImport:T[5]||(T[5]=F=>c.value=F)},null,8,["data"])]),_:1},8,["open"]),e.createVNode($t,{side:"right",width:420,open:b.value&&!R.value,title:"Markdown","onUpdate:open":T[8]||(T[8]=F=>b.value=F)},{default:e.withCtx(()=>[e.createVNode(jo,{data:c.value,onImport:T[7]||(T[7]=F=>c.value=F)},null,8,["data"])]),_:1},8,["open"]),e.createVNode($t,{side:"right",width:360,open:A.value&&!R.value,title:"节点内容","onUpdate:open":T[9]||(T[9]=F=>A.value=F)},{default:e.withCtx(()=>[e.createVNode(ai,{"selected-node":s.value,readonly:!1,"focus-tick":C.value,onApply:te,onRemove:de,onSetLink:fe,onSetImage:g,onSetRich:V},null,8,["selected-node","focus-tick"])]),_:1},8,["open"]),e.createVNode($t,{side:"right",width:340,open:$.value&&!R.value,title:"设置","onUpdate:open":T[10]||(T[10]=F=>$.value=F)},{default:e.withCtx(()=>{var F;return[e.createVNode(Ko,{settings:y,"has-selection":s.value!==null,"selected-node-text":(F=s.value)==null?void 0:F.text,"node-style":p.value,"onUpdate:settings":P,"onUpdate:nodeStyle":Y,onReset:q},null,8,["settings","has-selection","selected-node-text","node-style"])]}),_:1},8,["open"])]))}}),rg="0.6.1",lg={install(t){t.component("FlowMindMap",si),t.component("FlowMindMapOutline",Wo),t.component("FlowMindMapDrawer",$t),t.component("FlowMindMapDataPanel",Go),t.component("FlowMindMapMarkdownPanel",jo),t.component("FlowMindMapSettingsPanel",Ko),t.component("FlowMindMapNotePanel",ai),t.component("FlowMindMapApp",la)}};Ae.DataPanel=Go,Ae.Drawer=$t,Ae.MARKER_LIB=Ti,Ae.MarkdownPanel=jo,Ae.MindMap=si,Ae.MindMapApp=la,Ae.NotePanel=ai,Ae.Outline=Wo,Ae.SettingsPanel=Ko,Ae.VERSION=rg,Ae.addChild=Ci,Ae.addSibling=Br,Ae.clone=vt,Ae.default=lg,Ae.findNode=he,Ae.findParent=Dt,Ae.markdownToMindMap=Un,Ae.markdownToRichMindMap=Rs,Ae.markerDef=Us,Ae.markerLabel=Vr,Ae.markerSvg=Ho,Ae.mindMapToMarkdown=Hn,Ae.removeNode=$o,Ae.richBlockToMarkdown=Bs,Ae.tagColor=Mi,Ae.uid=Kt,Object.defineProperties(Ae,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});