flow-mindmap 0.5.8 → 0.5.9

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 Hh=Object.defineProperty;var Wh=(Ce,e,vn)=>e in Ce?Hh(Ce,e,{enumerable:!0,configurable:!0,writable:!0,value:vn}):Ce[e]=vn;var $e=(Ce,e,vn)=>Wh(Ce,typeof e!="symbol"?e+"":e,vn);var ei;const vn=["width","height","stroke-width"],Ea={key:4,points:"6 9 12 15 18 9"},xa={key:5,points:"9 6 15 12 9 18"},_e=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",Ea)):t.name==="expand"?(e.openBlock(),e.createElementBlock("polyline",xa)):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,vn))}}),rr="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",lr="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",ar=[22,15,13,12],sr=[700,600,500,400],wa=[46,36,30,26],Na=[120,80,60,44],Sa=[.8,.8,.8,.8],Ta=1,Ca=ar.length-1;function Ma(t,o){return Math.round(fi(t,o)*Sa[Ao(t)])}function Ao(t){return Math.min(Ca,Math.max(0,t))}function fi(t,o=14){return Math.round(ar[Ao(t)]*o/14*10)/10}function Aa(t,o=14){return Math.round(wa[Ao(t)]*o/14)}const io=60,_a=30,Ra=.75,zn=14,vt=24;function cr(t){return Math.max(_a,Math.round(io*Math.pow(Ra,t)))}let mi=null;function Ba(){if(mi)return mi;const t=typeof document<"u"?document.createElement("canvas").getContext("2d"):null;return t?(mi=t,t):{font:"",measureText:()=>({width:0})}}const dr=new Map;function ur(t,o,n){const i=`${n}|${o}|${t}`,a=dr.get(i);if(a!==void 0)return a;const c=Ba();c.font=`${n} ${o}px "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif`;const s=t.split(`
2
- `);let f=0;for(const d of s){const p=c.measureText(d).width;p>f&&(f=p)}return dr.set(i,f),f}const va=24,za=400,Ia=8,fr=16,mr=4,pr=200;function Oa(t,o,n){return Math.min(n,Math.max(o,t))}function La(t,o,n,i,a){const c=Ao(o),s=fi(o,n),f=Math.min(ur(t.text||"",s,sr[c]),pr),d=Ma(o,n),p=Math.ceil(f+d*2+Ta*2),h=(t.text||"").split(`
3
- `);let y=0;for(const de of h){const ye=ur(de,s,sr[c]);y+=Math.max(1,Math.ceil(ye/pr))}y=Math.max(1,y);const D=!!(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table"))?Math.ceil(s*1.2)+6+Math.ceil(s*1.2*(y-1)):Aa(o,n)+Math.ceil(s*1.2*(y-1));let _=0;if(t.link&&(_+=fr),t.note&&(_+=fr),_>0){const de=(t.link?1:0)+(t.note?1:0);_+=mr*de}const F=14,R=2;let M=0;t.markers&&t.markers.length>0&&(M=t.markers.length*F+(t.markers.length-1)*R+mr);const k=18,u=4,N=t.tags&&t.tags.length>0?k:0,$=p+_+M,j=(()=>{const de=Math.round(Na[c]*n/14);if(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table")){const ye=a==null?void 0:a[t.id];return Math.max(de,ye??240)}return de})(),q=!!(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table")),x=i==null?void 0:i[t.id],ae=q?Math.max(24,x??Math.max(70,Math.ceil(s*5))):0,fe=ae>0?10:0;if(!t.image){const de=Math.max(j,$),ye=Math.ceil(D+fe+ae+(N>0?u+N:0));return{w:de,h:ye}}const me=Oa(t.image.width,va,za),J=Math.max(j,$,Math.ceil(me+d*2)),ge=Math.ceil(t.image.height+Ia+D+fe+ae+(N>0?u+N:0));return{w:J,h:ge}}function Da(t,o={}){const n=o.mode??"mindmap",i=o.preservePositions===!0,a=o.baseFontSize??14,c=gr(t,0,null,1,"right",a,o.richHeights,o.richWidths);return $a(c),Va(c,n,i),c.x=0,c.y=0,Pa(c,i)}function Va(t,o,n=!1){if(o==="mindmap"){const i=t.children;if(i.length!==0)if(i.length===1)i[0]._dir="right",i[0].side=1,i[0]._dirRight=1;else{const f=i.reduce((y,C)=>y+C._subtreeH,0);let d=1,p=Math.abs(i[0]._subtreeH-(f-i[0]._subtreeH)),h=0;for(let y=0;y<i.length-1;y++){h+=i[y]._subtreeH;const C=Math.abs(h-(f-h));C<p&&(p=C,d=y+1)}for(let y=0;y<d;y++)i[y]._dir="right",i[y].side=1,i[y]._dirRight=1;for(let y=d;y<i.length;y++)i[y]._dir="left",i[y].side=-1,i[y]._dirRight=-1}const a=t.children.filter(f=>f.side===1),c=t.children.filter(f=>f.side===-1),s=(f,d)=>{const p=d==="right"?1:-1;f._dir=d,f.side=p,f._dirRight=p;for(const h of f.children)s(h,d)};for(const f of a)s(f,"right");for(const f of c)s(f,"left");if(a.length>0){const f={...t,children:a};_o(f,"right",io,!0,n)}if(c.length>0){const f={...t,children:c};_o(f,"left",io,!0,n)}}else if(o==="tree"){const i=a=>{a.side=1,a._dir="right";for(const c of a.children)i(c)};for(const a of t.children)a._dir="right";_o(t,"right",io,!0,n),i(t)}else{for(const i of t.children)i._dir="down";hr(t,io,n)}}function _o(t,o,n,i,a=!1){if(t.children.length===0)return;const c=t.children.reduce((h,y,C)=>h+y._subtreeH+(C>0?zn:0),0),s=o==="right"?1:-1,f=i?s:1;let d=t.y-f*c/2;const p=cr(t.depth);t.children.forEach(h=>{a||(h.x=t.x+s*(t.width/2+p+h.width/2),h.y=d+f*h._subtreeH/2),h._dir=o,d+=f*(h._subtreeH+zn),_o(h,o,n,!1,a)})}function hr(t,o,n=!1){if(t.children.length===0)return;const i=t.children.reduce((s,f,d)=>s+f._subtreeW+(d>0?zn*2:0),0);let a=t.x-i/2;const c=cr(t.depth);t.children.forEach(s=>{n||(s.x=a+s._subtreeW/2,s.y=t.y+t.height/2+c+s.height/2),s._dir="down",a+=s._subtreeW+zn*2,hr(s,o,n)})}function gr(t,o,n,i,a,c,s,f){const d=La(t,o,c,s,f),p={id:t.id,text:t.text,depth:o,x:t._x??0,y:t._y??0,width:d.w,height:d.h,fontSize:fi(o,c),isRoot:o===0,collapsed:t.collapsed,side:i,_dir:a,_dirRight:i,_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 h=t.children.length,y=Math.ceil(h/2);return p.children=t.children.map((C,D)=>{const _=o===0?D<y?1:-1:i;return gr(C,o+1,p,_,a,c,s,f)}),p}function $a(t){const o=[t];for(let n=0;n<o.length;n++){const i=o[n];for(const a of i.children)o.push(a)}for(let n=o.length-1;n>=0;n--){const i=o[n];if(i.collapsed||i.children.length===0){i._subtreeH=i.height,i._subtreeW=i.width;continue}let a=0,c=0;for(const s of i.children)a+=s._subtreeH,c+=s._subtreeW;i.children.length>1&&(a+=zn*(i.children.length-1),c+=zn*2*(i.children.length-1)),i._subtreeH=Math.max(i.height,a),i._subtreeW=Math.max(i.width,c)}}function Pa(t,o=!1){const n=[t];let i=1/0,a=-1/0,c=1/0,s=-1/0;for(;n.length;){const p=n.pop(),h=p.width/2,y=p.height/2;p.x-h<i&&(i=p.x-h),p.x+h>a&&(a=p.x+h),p.y-y<c&&(c=p.y-y),p.y+y>s&&(s=p.y+y),n.push(...p.children)}if(o)return{root:t,width:a-i+vt*2,height:s-c+vt*2,vbX:i-vt,vbY:c-vt,vbW:a-i+vt*2,vbH:s-c+vt*2};const f=vt-c,d=[t];for(;d.length;){const p=d.pop();p.y+=f,d.push(...p.children)}return c+=f,s+=f,{root:t,width:a-i+vt*2,height:s+vt,vbX:i-vt,vbY:0,vbW:a-i+vt*2,vbH:s+vt}}const cn=[{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 Fa(t,o=[]){return[...cn,...o].find(i=>i.id===t)??cn[0]}function Ua(t,o=8){const n=[],i=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 f=null;if(s.startsWith("#")?f=Ha(s):s.startsWith("rgb")?f=Wa(s):f=Ga[s.toLowerCase()]??null,!f)continue;const d=f.toLowerCase();if(!i.has(d)&&(i.add(d),n.push(d),n.length>=o))break}return n}function Ha(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(i=>i+i).join("");else if(o.length===4)n=o.slice(0,3).split("").map(i=>i+i).join("");else if(o.length===6)n=o;else if(o.length===8)n=o.slice(0,6);else return null;return"#"+n.toLowerCase()}function Wa(t){const o=t.match(/^rgba?\(\s*([^)]+?)\s*\)$/i);if(!o)return null;const n=o[1].split(/\s*,\s*/);if(n.length<3)return null;const i=[];for(let a=0;a<3;a++){const c=n[a];if(c.endsWith("%")){const s=parseFloat(c);if(!isFinite(s))return null;i.push(Math.round(s/100*255))}else{const s=parseInt(c,10);if(!isFinite(s)||s<0||s>255)return null;i.push(s)}}return"#"+i.map(a=>a.toString(16).padStart(2,"0")).join("").toLowerCase()}const Ga={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 zt(t){return JSON.parse(JSON.stringify(t))}function he(t,o){if(t.id===o)return t;for(const n of t.children){const i=he(n,o);if(i)return i}return null}function Ft(t,o,n=null){if(t.id===o)return n;for(const i of t.children){const a=Ft(i,o,t);if(a!==null)return a}return null}function Ro(t,o){const n=t.children.findIndex(i=>i.id===o);if(n>=0)return t.children.splice(n,1),!0;for(const i of t.children)if(Ro(i,o))return!0;return!1}function ja(t,o,n){const i=he(t,o);return!i||i.text===n?!1:(i.text=n,!0)}function Ka(t,o,n,i){if(!Ft(t,o)||o===n||he(he(t,o),n))return!1;const a=Ft(t,o),c=a.children.findIndex(p=>p.id===o);if(c<0)return!1;const[s]=a.children.splice(c,1);if(i==="child"){const p=he(t,n);return p?(p.children.push(s),!0):(a.children.splice(c,0,s),!1)}const f=Ft(t,n);if(!f)return a.children.splice(c,0,s),!1;let d=f.children.findIndex(p=>p.id===n);return d<0?(a.children.splice(c,0,s),!1):(i==="after"&&(d+=1),f.children.splice(d,0,s),!0)}function br(t){const o=/^新节点(?:\s+(\d+))?$/;let n=0,i=!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 i=!0}return n===0&&!i?vo:n>0?`新节点 ${n+1}`:"新节点 2"}function kr(t,o,n){const i=he(t,o);if(!i)return null;const a={id:Kt(),text:n??br(i),children:[]};return i.children.push(a),a}function yr(t,o,n){const i=Ft(t,o);if(!i)return null;const a=i.children.findIndex(s=>s.id===o);if(a<0)return null;const c={id:Kt(),text:n??br(i),children:[]};return i.children.splice(a+1,0,c),c}function Ya(t,o,n){const i=Ft(t,o);if(!i)return null;const a=i.children.findIndex(s=>s.id===o);if(a<0)return null;const c={id:Kt(),text:n,children:[]};return i.children.splice(a,0,c),c}function qa(t,o){const n=Ft(t,o);if(!n)return null;const i=n.children.findIndex(s=>s.id===o);if(i<0)return null;const a=n.children[i],c=zt(a);return Bo(c),n.children.splice(i+1,0,c),c}function Bo(t){t.id=Kt();for(const o of t.children)Bo(o)}function Er(t,o){const n=he(t,o);if(!n||n.id===t.id)return null;const i=zt(n);return Bo(i),i}const vo="新节点";function In(t,o="导入的导图"){const n=t.split(/\r?\n/),i={id:Kt(),text:o,children:[]},a=[i],c=[-1/0],s=[],f=/^(#{1,6})\s+(.+?)\s*#*\s*$/,d=/^!\[([^\]]*)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,p=/^\[([^\]]+)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,h=/^(`{3,}|~{3,})\s*(\S+)?\s*$/;let y=!1,C=[],D=null;function _(M){C.push(M)}function F(){if(D&&C.length>0){for(;C.length>0&&C[0].trim()==="";)C.shift();for(;C.length>0&&C[C.length-1].trim()==="";)C.pop();const M=C.join(`
4
- `);M&&(D.note={text:M})}y=!1,C=[]}for(const M of n){if(y){const j=M.match(h);if(j&&j[1][0]==="`"){F();continue}_(M);continue}const k=M.match(f);if(k){const j=k[1].length,q=k[2].trim();s.push({level:j,text:q,body:""}),D=s[s.length-1];continue}const u=M.match(h);if(u&&u[2]==="note"){y=!0,C=[];continue}const N=M.match(d);if(N&&D){const j=N[2],q=160,x=120;D.image={src:j,naturalW:q,naturalH:x,width:q,height:x};continue}const $=M.match(p);if($&&D){D.link={url:$[2]},D.text=$[1];continue}if(M.trim().length>0&&D){const j=M.trim();D.body=D.body?D.body+`
5
- `+j:j}}y&&F();function R(M){for(;a.length>1;){const $=a.length-1,j=c[$];if(j!==void 0&&j<M.level)break;a.pop(),c.pop()}const k=a[a.length-1],u=M.text,N={id:Kt(),text:u,children:[]};M.image&&(N.image={...M.image}),M.link&&(N.link={url:M.link.url}),M.note&&(N.note={text:M.note.text}),M.body&&(N.note={text:M.body}),k.children.push(N),a.push(N),c.push(M.level)}for(const M of s)R(M);if(s.length>0&&s[0].level===1){const M=i.children[0];M&&(i.text=M.text,i.id=M.id,M.image&&(i.image={...M.image}),M.link&&(i.link={url:M.link.url}),M.note&&(i.note={text:M.note.text}),i.children=M.children)}return i}function On(t,o=1){let n="#".repeat(o)+" "+(t.text||"")+`
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 Kh=Object.defineProperty;var Yh=(Ce,e,In)=>e in Ce?Kh(Ce,e,{enumerable:!0,configurable:!0,writable:!0,value:In}):Ce[e]=In;var Ve=(Ce,e,In)=>Yh(Ce,typeof e!="symbol"?e+"":e,In);var ei;const In=["width","height","stroke-width"],Na={key:4,points:"6 9 12 15 18 9"},Sa={key:5,points:"9 6 15 12 9 18"},_e=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",Na)):t.name==="expand"?(e.openBlock(),e.createElementBlock("polyline",Sa)):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))}}),lr="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",ar="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",sr=[22,15,13,12],cr=[700,600,500,400],Ta=[46,36,30,26],Ca=[120,80,60,44],Ma=[.8,.8,.8,.8],Aa=1,_a=sr.length-1;function Ra(t,o){return Math.round(mi(t,o)*Ma[Ao(t)])}function Ao(t){return Math.min(_a,Math.max(0,t))}function mi(t,o=14){return Math.round(sr[Ao(t)]*o/14*10)/10}function Ba(t,o=14){return Math.round(Ta[Ao(t)]*o/14)}const io=60,va=30,Ia=.75,zn=14,vt=24;function dr(t){return Math.max(va,Math.round(io*Math.pow(Ia,t)))}let pi=null;function za(){if(pi)return pi;const t=typeof document<"u"?document.createElement("canvas").getContext("2d"):null;return t?(pi=t,t):{font:"",measureText:()=>({width:0})}}const ur=new Map;function fr(t,o,n){const i=`${n}|${o}|${t}`,a=ur.get(i);if(a!==void 0)return a;const c=za();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 ur.set(i,u),u}const Oa=24,La=400,Da=8,mr=16,pr=4,hr=200;function Va(t,o,n){return Math.min(n,Math.max(o,t))}function $a(t,o,n,i,a){const c=Ao(o),s=mi(o,n),u=Math.min(fr(t.text||"",s,cr[c]),hr),d=Ra(o,n),p=Math.ceil(u+d*2+Aa*2),h=(t.text||"").split(`
3
+ `);let x=0;for(const ae of h){const ke=fr(ae,s,cr[c]);x+=Math.max(1,Math.ceil(ke/hr))}x=Math.max(1,x);const $=!!(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table"))?Math.ceil(s*1.2)+6+Math.ceil(s*1.2*(x-1)):Ba(o,n)+Math.ceil(s*1.2*(x-1));let R=0;if(t.link&&(R+=mr),t.note&&(R+=mr),R>0){const ae=(t.link?1:0)+(t.note?1:0);R+=pr*ae}const F=14,O=2;let A=0;t.markers&&t.markers.length>0&&(A=t.markers.length*F+(t.markers.length-1)*O+pr);const y=18,k=4,m=t.tags&&t.tags.length>0?y:0,P=p+R+A,G=(()=>{const ae=Math.round(Ca[c]*n/14);if(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table")){const ke=a==null?void 0:a[t.id];return Math.max(ae,ke??240)}return ae})(),q=!!(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table")),w=i==null?void 0:i[t.id],ie=q?Math.max(24,w??Math.max(70,Math.ceil(s*5))):0,fe=ie>0?10:0;if(!t.image){const ae=Math.max(G,P),ke=Math.ceil($+fe+ie+(m>0?k+m:0));return{w:ae,h:ke}}const ce=Va(t.image.width,Oa,La),J=Math.max(G,P,Math.ceil(ce+d*2)),me=Math.ceil(t.image.height+Da+$+fe+ie+(m>0?k+m:0));return{w:J,h:me}}function Pa(t,o={}){const n=o.mode??"mindmap",i=o.preservePositions===!0,a=o.baseFontSize??14,c=br(t,0,null,1,"right",a,o.richHeights,o.richWidths);return Ua(c),Fa(c,n,i),c.x=0,c.y=0,Ha(c,i)}function Fa(t,o,n=!1){if(o==="mindmap"){const i=t.children;if(i.length!==0)if(i.length===1)i[0]._dir="right",i[0].side=1,i[0]._dirRight=1;else{const u=i.reduce((x,C)=>x+C._subtreeH,0);let d=1,p=Math.abs(i[0]._subtreeH-(u-i[0]._subtreeH)),h=0;for(let x=0;x<i.length-1;x++){h+=i[x]._subtreeH;const C=Math.abs(h-(u-h));C<p&&(p=C,d=x+1)}for(let x=0;x<d;x++)i[x]._dir="right",i[x].side=1,i[x]._dirRight=1;for(let x=d;x<i.length;x++)i[x]._dir="left",i[x].side=-1,i[x]._dirRight=-1}const a=t.children.filter(u=>u.side===1),c=t.children.filter(u=>u.side===-1),s=(u,d)=>{const p=d==="right"?1:-1;u._dir=d,u.side=p,u._dirRight=p;for(const h of u.children)s(h,d)};for(const u of a)s(u,"right");for(const u of c)s(u,"left");if(a.length>0){const u={...t,children:a};_o(u,"right",io,!0,n)}if(c.length>0){const u={...t,children:c};_o(u,"left",io,!0,n)}}else if(o==="tree"){const i=a=>{a.side=1,a._dir="right";for(const c of a.children)i(c)};for(const a of t.children)a._dir="right";_o(t,"right",io,!0,n),i(t)}else{for(const i of t.children)i._dir="down";gr(t,io,n)}}function _o(t,o,n,i,a=!1){if(t.children.length===0)return;const c=t.children.reduce((h,x,C)=>h+x._subtreeH+(C>0?zn:0),0),s=o==="right"?1:-1,u=i?s:1;let d=t.y-u*c/2;const p=dr(t.depth);t.children.forEach(h=>{a||(h.x=t.x+s*(t.width/2+p+h.width/2),h.y=d+u*h._subtreeH/2),h._dir=o,d+=u*(h._subtreeH+zn),_o(h,o,n,!1,a)})}function gr(t,o,n=!1){if(t.children.length===0)return;const i=t.children.reduce((s,u,d)=>s+u._subtreeW+(d>0?zn*2:0),0);let a=t.x-i/2;const c=dr(t.depth);t.children.forEach(s=>{n||(s.x=a+s._subtreeW/2,s.y=t.y+t.height/2+c+s.height/2),s._dir="down",a+=s._subtreeW+zn*2,gr(s,o,n)})}function br(t,o,n,i,a,c,s,u){const d=$a(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:mi(o,c),isRoot:o===0,collapsed:t.collapsed,side:i,_dir:a,_dirRight:i,_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 h=t.children.length,x=Math.ceil(h/2);return p.children=t.children.map((C,$)=>{const R=o===0?$<x?1:-1:i;return br(C,o+1,p,R,a,c,s,u)}),p}function Ua(t){const o=[t];for(let n=0;n<o.length;n++){const i=o[n];for(const a of i.children)o.push(a)}for(let n=o.length-1;n>=0;n--){const i=o[n];if(i.collapsed||i.children.length===0){i._subtreeH=i.height,i._subtreeW=i.width;continue}let a=0,c=0;for(const s of i.children)a+=s._subtreeH,c+=s._subtreeW;i.children.length>1&&(a+=zn*(i.children.length-1),c+=zn*2*(i.children.length-1)),i._subtreeH=Math.max(i.height,a),i._subtreeW=Math.max(i.width,c)}}function Ha(t,o=!1){const n=[t];let i=1/0,a=-1/0,c=1/0,s=-1/0;for(;n.length;){const p=n.pop(),h=p.width/2,x=p.height/2;p.x-h<i&&(i=p.x-h),p.x+h>a&&(a=p.x+h),p.y-x<c&&(c=p.y-x),p.y+x>s&&(s=p.y+x),n.push(...p.children)}if(o)return{root:t,width:a-i+vt*2,height:s-c+vt*2,vbX:i-vt,vbY:c-vt,vbW:a-i+vt*2,vbH:s-c+vt*2};const u=vt-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-i+vt*2,height:s+vt,vbX:i-vt,vbY:0,vbW:a-i+vt*2,vbH:s+vt}}const dn=[{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 Wa(t,o=[]){return[...dn,...o].find(i=>i.id===t)??dn[0]}function Ga(t,o=8){const n=[],i=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=ja(s):s.startsWith("rgb")?u=Ka(s):u=Ya[s.toLowerCase()]??null,!u)continue;const d=u.toLowerCase();if(!i.has(d)&&(i.add(d),n.push(d),n.length>=o))break}return n}function ja(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(i=>i+i).join("");else if(o.length===4)n=o.slice(0,3).split("").map(i=>i+i).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 Ka(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 i=[];for(let a=0;a<3;a++){const c=n[a];if(c.endsWith("%")){const s=parseFloat(c);if(!isFinite(s))return null;i.push(Math.round(s/100*255))}else{const s=parseInt(c,10);if(!isFinite(s)||s<0||s>255)return null;i.push(s)}}return"#"+i.map(a=>a.toString(16).padStart(2,"0")).join("").toLowerCase()}const Ya={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 Yt(){return"n_"+Math.random().toString(36).slice(2,10)+Date.now().toString(36).slice(-4)}function It(t){return JSON.parse(JSON.stringify(t))}function he(t,o){if(t.id===o)return t;for(const n of t.children){const i=he(n,o);if(i)return i}return null}function zt(t,o,n=null){if(t.id===o)return n;for(const i of t.children){const a=zt(i,o,t);if(a!==null)return a}return null}function Ro(t,o){const n=t.children.findIndex(i=>i.id===o);if(n>=0)return t.children.splice(n,1),!0;for(const i of t.children)if(Ro(i,o))return!0;return!1}function qa(t,o,n){const i=he(t,o);return!i||i.text===n?!1:(i.text=n,!0)}function hi(t,o,n,i){if(!zt(t,o)||o===n||he(he(t,o),n))return!1;const a=zt(t,o),c=a.children.findIndex(p=>p.id===o);if(c<0)return!1;const[s]=a.children.splice(c,1);if(i==="child"){const p=he(t,n);return p?(p.children.push(s),!0):(a.children.splice(c,0,s),!1)}const u=zt(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):(i==="after"&&(d+=1),u.children.splice(d,0,s),!0)}function kr(t){const o=/^新节点(?:\s+(\d+))?$/;let n=0,i=!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 i=!0}return n===0&&!i?vo:n>0?`新节点 ${n+1}`:"新节点 2"}function yr(t,o,n){const i=he(t,o);if(!i)return null;const a={id:Yt(),text:n??kr(i),children:[]};return i.children.push(a),a}function Er(t,o,n){const i=zt(t,o);if(!i)return null;const a=i.children.findIndex(s=>s.id===o);if(a<0)return null;const c={id:Yt(),text:n??kr(i),children:[]};return i.children.splice(a+1,0,c),c}function Xa(t,o,n){const i=zt(t,o);if(!i)return null;const a=i.children.findIndex(s=>s.id===o);if(a<0)return null;const c={id:Yt(),text:n,children:[]};return i.children.splice(a,0,c),c}function Za(t,o){const n=zt(t,o);if(!n)return null;const i=n.children.findIndex(s=>s.id===o);if(i<0)return null;const a=n.children[i],c=It(a);return Bo(c),n.children.splice(i+1,0,c),c}function Bo(t){t.id=Yt();for(const o of t.children)Bo(o)}function xr(t,o){const n=he(t,o);if(!n||n.id===t.id)return null;const i=It(n);return Bo(i),i}const vo="新节点";function On(t,o="导入的导图"){const n=t.split(/\r?\n/),i={id:Yt(),text:o,children:[]},a=[i],c=[-1/0],s=[],u=/^(#{1,6})\s+(.+?)\s*#*\s*$/,d=/^!\[([^\]]*)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,p=/^\[([^\]]+)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,h=/^(`{3,}|~{3,})\s*(\S+)?\s*$/;let x=!1,C=[],$=null;function R(A){C.push(A)}function F(){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 A=C.join(`
4
+ `);A&&($.note={text:A})}x=!1,C=[]}for(const A of n){if(x){const G=A.match(h);if(G&&G[1][0]==="`"){F();continue}R(A);continue}const y=A.match(u);if(y){const G=y[1].length,q=y[2].trim();s.push({level:G,text:q,body:""}),$=s[s.length-1];continue}const k=A.match(h);if(k&&k[2]==="note"){x=!0,C=[];continue}const m=A.match(d);if(m&&$){const G=m[2],q=160,w=120;$.image={src:G,naturalW:q,naturalH:w,width:q,height:w};continue}const P=A.match(p);if(P&&$){$.link={url:P[2]},$.text=P[1];continue}if(A.trim().length>0&&$){const G=A.trim();$.body=$.body?$.body+`
5
+ `+G:G}}x&&F();function O(A){for(;a.length>1;){const P=a.length-1,G=c[P];if(G!==void 0&&G<A.level)break;a.pop(),c.pop()}const y=a[a.length-1],k=A.text,m={id:Yt(),text:k,children:[]};A.image&&(m.image={...A.image}),A.link&&(m.link={url:A.link.url}),A.note&&(m.note={text:A.note.text}),A.body&&(m.note={text:A.body}),y.children.push(m),a.push(m),c.push(A.level)}for(const A of s)O(A);if(s.length>0&&s[0].level===1){const A=i.children[0];A&&(i.text=A.text,i.id=A.id,A.image&&(i.image={...A.image}),A.link&&(i.link={url:A.link.url}),A.note&&(i.note={text:A.note.text}),i.children=A.children)}return i}function Ln(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 i of t.children)n+=On(i,o+1);return n}function Xa(t){var p,h;const o=t.split(/\r?\n/),n=[];let i=0;const a=/^(#{1,6})\s+(.+?)\s*#*\s*$/,c=/^(`{3,}|~{3,})\s*(\S+)?\s*$/,s=/^\s*\|?\s*(:?-+:?\s*\|\s*)+(:?-+:?)(\s*\|)?\s*$/,f=/^(\s*)[-*+]\s+(.*)$/,d=/^(\s*)\d+\.\s+(.*)$/;for(;i<o.length;){const y=o[i],C=y.match(c);if(C){const u=C[1][0],N=C[2]||"",$=[y];for(i++;i<o.length;){const q=o[i].match(c);if(q&&q[1][0]===u){$.push(o[i]),i++;break}$.push(o[i]),i++}const j=$.slice(1,-1).join(`
10
- `).trim();n.push({kind:"code",text:((p=j.split(`
11
- `)[0])==null?void 0:p.slice(0,80))||"(空代码块)",raw:$.join(`
12
- `),lang:N});continue}const D=y.match(a);if(D){n.push({kind:"heading",level:D[1].length,text:D[2].trim(),raw:y}),i++;continue}if(/^\s*\|/.test(y)){const u=[];let N=i,$=!1;for(;N<o.length&&/^\s*\|/.test(o[N]);)u.push(o[N]),s.test(o[N])&&($=!0),N++;if($&&u.length>=2){n.push({kind:"table",text:((h=u[0].replace(/^\s*\|/,"").replace(/\|\s*$/,"").split("|")[0])==null?void 0:h.trim())||"表格",raw:u.join(`
13
- `)}),i=N;continue}}const _=y.match(f),F=y.match(d);if(_||F){let u=i;for(;u<o.length;){const N=o[u].match(f),$=o[u].match(d);if(!(N||$))break;const j=o[u].replace(/^\s*[-*+]\s+/,"").replace(/^\s*\d+\.\s+/,"").trim();j.length>0&&n.push({kind:"list",text:j.slice(0,80)||"(列表项)",raw:o[u]}),u++}i=u;continue}if(y.trim()===""){i++;continue}const R=[y];let M=i+1;for(;M<o.length;){const u=o[M];if(u.trim()===""||a.test(u)||c.test(u)||f.test(u)||d.test(u)||/^\s*\|/.test(u))break;R.push(u),M++}const k=R.join(" ").trim();n.push({kind:"paragraph",text:k.slice(0,80)||"(空段落)",raw:R.join(`
14
- `)}),i=M}return n}function Za(t,o="导入的导图"){const n=Xa(t||""),i={id:Kt(),text:o,children:[]},a=[i],c=[0];let s=!1;function f(d){if(d.kind==="heading"){const h=d.level;for(;a.length>1&&c[c.length-1]>=h;)a.pop(),c.pop();if(!s&&h===1){s=!0,i.text=d.text,c[0]=1;return}const y={id:Kt(),text:d.text,children:[]};a[a.length-1].children.push(y),a.push(y),c.push(h);return}const p={id:Kt(),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)f(d);return i}function Ja(t){return t.richContent?t.richContent.raw+`
15
- `:""}function Qa(t){const o=t.minScale??.2,n=t.maxScale??1/0,i=t.step??1.2,a=e.ref(1),c=e.ref(0),s=e.ref(0),f=e.ref(!1),d=e.ref(!1),p=e.reactive({x:0,y:0,ox:0,oy:0}),h=e.ref(!1),y=e.reactive({x:0,y:0}),C=e.reactive({x:0,y:0,width:0,height:0}),D=e.ref(0);let _=null;function F(J){_=J}function R(J){J.preventDefault();const ge=t.getContainer();if(!ge)return;const de=-J.deltaY*.001,ye=Math.min(n,Math.max(o,a.value*(1+de))),b=ge.getBoundingClientRect(),L=J.clientX-b.left,G=J.clientY-b.top,ee=(L-c.value)/a.value,be=(G-s.value)/a.value;a.value=ye,c.value=L-ee*ye,s.value=G-be*ye}function M(){a.value=Math.min(n,a.value*i)}function k(){a.value=Math.max(o,a.value/i)}function u(J){var de;J.target.closest(".zm-node, .zm-toolbar, button, input, textarea")||(f.value=!0,d.value=!1,p.x=J.clientX,p.y=J.clientY,p.ox=c.value,p.oy=s.value,window.addEventListener("mousemove",N),window.addEventListener("mouseup",$),(de=J.preventDefault)==null||de.call(J))}function N(J){if(!f.value)return;const ge=J.clientX-p.x,de=J.clientY-p.y;(Math.abs(ge)>3||Math.abs(de)>3)&&(d.value=!0),c.value=p.ox+ge,s.value=p.oy+de}function $(){f.value=!1,window.removeEventListener("mousemove",N),window.removeEventListener("mouseup",$)}function j(J,ge,de){h.value=!0,y.x=J,y.y=ge,C.x=J,C.y=ge,C.width=0,C.height=0,C.shiftKey=!!(de!=null&&de.shift),D.value++,window.addEventListener("mousemove",ae),window.addEventListener("mouseup",x)}function q(J,ge){if(!h.value)return;const de=Math.min(y.x,J),ye=Math.min(y.y,ge),b=Math.max(y.x,J),L=Math.max(y.y,ge);C.x=de,C.y=ye,C.width=b-de,C.height=L-ye,D.value++}function x(){h.value=!1,window.removeEventListener("mousemove",ae),window.removeEventListener("mouseup",x),_&&_()}function ae(J){if(!h.value)return;const ge=t.getContainer();if(!ge)return;const de=ge.getBoundingClientRect(),ye=(J.clientX-de.left-c.value)/a.value,b=(J.clientY-de.top-s.value)/a.value;q(ye,b)}function fe(J,ge,de,ye=60){const b=t.getContainer();if(!b)return;const L=b.getBoundingClientRect(),G=(L.width-ye*2)/J,ee=(L.height-ye*2)/ge,be=Math.min(1,Math.max(.3,Math.min(G,ee)));a.value=be,c.value=L.width/2,s.value=L.height/2-de*be}function me(J,ge,de,ye,b=80){const L=t.getContainer();if(!L)return;const G=L.getBoundingClientRect();let ee=a.value;(de*ee<40||ye*ee<40)&&(ee=Math.min(n,Math.max(1,60/Math.min(de,ye)))),a.value=ee,c.value=G.width/2-J*ee,s.value=G.height/2-ge*ee}return{scale:a,offsetX:c,offsetY:s,isPanning:f,panMoved:d,onWheel:R,zoomIn:M,zoomOut:k,startPan:u,startMarquee:j,updateMarquee:q,isMarquee:h,marquee:C,marqueeVersion:D,setOnMarqueeEnd:F,resetView:fe,centerOn:me}}const es=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform);function xr(t){return es?t.metaKey:t.ctrlKey}function ts(t){function o(){const i=t.getSelectedId();if(i)return i;if(t.defaultTargetId)return t.defaultTargetId();const a=t.getSelectedIds();return a.length>0?a[0]:null}function n(i){var f,d,p;const a=i.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(xr(i)&&!i.shiftKey){if(i.key==="d"||i.key==="D"){const h=(f=t.defaultTargetId)==null?void 0:f.call(t);c&&c!==h&&(i.preventDefault(),t.onDuplicate(c));return}if(i.key==="c"||i.key==="C"){const h=t.getSelectedIds();h.length>0&&(i.preventDefault(),t.onCopy(h));return}if(i.key==="x"||i.key==="X"){const h=t.getSelectedIds();h.length>0&&(i.preventDefault(),t.onCut(h));return}if(i.key==="v"||i.key==="V"){if(!t.hasClipboard())return;i.preventDefault();const h=t.getSelectedIds();t.onPaste(h.length>0?h[0]:null);return}if(i.key==="z"||i.key==="Z"){i.preventDefault(),t.onUndo();return}if(i.key==="y"||i.key==="Y"){i.preventDefault(),t.onRedo();return}if(i.key==="Home"){i.preventDefault(),t.onSelectRoot();return}}if(xr(i)&&i.shiftKey&&(i.key==="Z"||i.key==="z")){i.preventDefault(),t.onRedo();return}if(i.key==="Tab")i.preventDefault(),t.onAddChild(s);else if(i.key==="Enter")if(i.preventDefault(),i.shiftKey){const h=(d=t.defaultTargetId)==null?void 0:d.call(t);c&&c!==h&&t.onAddSiblingBefore(c)}else t.onAddSibling(s);else(i.key==="Delete"||i.key==="Backspace")&&c&&c!==((p=t.defaultTargetId)==null?void 0:p.call(t))?(i.preventDefault(),t.onRemove(c)):i.key==="F2"&&c?(i.preventDefault(),t.onStartEdit(c)):i.key==="Escape"?(i.preventDefault(),t.onClearSelection()):i.key==="ArrowDown"?(i.preventDefault(),t.onNavigate(0,1)):i.key==="ArrowUp"?(i.preventDefault(),t.onNavigate(0,-1)):i.key==="ArrowRight"?(i.preventDefault(),t.onNavigate(1,0)):i.key==="ArrowLeft"&&(i.preventDefault(),t.onNavigate(-1,0))}}e.onMounted(()=>{window.addEventListener("keydown",n)}),e.onBeforeUnmount(()=>{window.removeEventListener("keydown",n)})}function ns(t=100){const o=e.ref([]);let n=-1;function i(){return n>0}function a(){return n<o.value.length-1}function c(p){const h=JSON.stringify(p);for(n<o.value.length-1&&(o.value=o.value.slice(0,n+1)),o.value.push(h),n=o.value.length-1;o.value.length>t;)o.value.shift(),n--}function s(){return i()?(n--,JSON.parse(o.value[n])):null}function f(){return a()?(n++,JSON.parse(o.value[n])):null}function d(){o.value=[],n=-1}return{canUndo:i,canRedo:a,record:c,undo:s,redo:f,reset:d}}const os={1:"#ef4444",2:"#f97316",3:"#f59e0b",4:"#eab308",5:"#84cc16",6:"#22c55e",7:"#14b8a6",8:"#3b82f6",9:"#6366f1"},is={label:"优先级",markers:Array.from({length:9},(t,o)=>{const n=o+1,i=os[n];return{id:`priority-${n}`,label:`优先级 ${n}`,svg:`<circle cx="12" cy="12" r="10" fill="${i}"/><text x="12" y="16" text-anchor="middle" font-size="12" font-weight="700" fill="#fff" font-family="sans-serif">${n}</text>`}})};function rs(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),i=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)} ${i.toFixed(2)} Z" fill="#3b82f6"/><circle cx="12" cy="12" r="10" fill="none" stroke="#cbd5e1" stroke-width="1"/>`}const ls={label:"进度",markers:[0,25,50,75,100].map(t=>({id:`progress-${t}`,label:`进度 ${t}%`,svg:rs(t)}))},as={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"/>`}))},pi=[is,ls,as,{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"/>'}]}],zo={};for(const t of pi)for(const o of t.markers)zo[o.id]=o;function ss(t){return zo[t]}function Io(t){var o;return((o=zo[t])==null?void 0:o.svg)??""}function wr(t){var o;return((o=zo[t])==null?void 0:o.label)??t}function hi(t){let o=0;for(let i=0;i<t.length;i++)o=(o<<5)-o+t.charCodeAt(i),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 cs={key:5,class:"zm-marker-picker"},ds={class:"zm-marker-group-label"},us={class:"zm-marker-grid"},fs=["title","onClick","innerHTML"],ms=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,i=o,a=e.computed(()=>{let k=n.x+2,u=n.y+2;if(n.container){const N=n.container.getBoundingClientRect(),$=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))*28;k+$>N.right&&(k=Math.max(N.left+4,n.x-$-2)),u+q>N.bottom&&(u=Math.max(N.top+4,n.y-q-2)),k<N.left+2&&(k=N.left+2),u<N.top+2&&(u=N.top+2)}return{left:k,top:u}}),c=e.computed(()=>n.hasImage),s=e.computed(()=>n.hasLink),f=e.computed(()=>n.hasNote),d=e.computed(()=>n.nodeMarkers.length>0),p=e.computed(()=>n.nodeTags.length>0),h=e.ref(!1);function y(){h.value=!h.value}function C(k){return n.nodeMarkers.includes(k)}function D(k){i("toggleMarker",k)}function _(k){const u=k.target;u&&u.closest(".zm-node-menu")||i("close")}function F(k){k.key==="Escape"&&i("close")}function R(){i("close")}window.addEventListener("mousedown",_,!0),window.addEventListener("keydown",F,!0),window.addEventListener("wheel",R,!0),window.addEventListener("scroll",R,!0),e.onBeforeUnmount(()=>{window.removeEventListener("mousedown",_,!0),window.removeEventListener("keydown",F,!0),window.removeEventListener("wheel",R,!0),window.removeEventListener("scroll",R,!0)});function M(k){k(),i("close")}return(k,u)=>(e.openBlock(),e.createElementBlock("div",{class:"zm-node-menu",style:e.normalizeStyle({left:a.value.left+"px",top:a.value.top+"px"}),onContextmenu:u[13]||(u[13]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("button",{class:"zm-node-menu-item",onClick:u[0]||(u[0]=e.withModifiers(N=>M(()=>i("pickImage")),["stop"]))},[e.createVNode(_e,{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:u[1]||(u[1]=e.withModifiers(N=>M(()=>i("removeImage")),["stop"]))},[e.createVNode(_e,{name:"x",size:13}),u[14]||(u[14]=e.createElementVNode("span",null,"移除图片",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:u[2]||(u[2]=e.withModifiers(N=>M(()=>i("setLink")),["stop"]))},[e.createVNode(_e,{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:u[3]||(u[3]=e.withModifiers(N=>M(()=>i("removeLink")),["stop"]))},[e.createVNode(_e,{name:"x",size:13}),u[15]||(u[15]=e.createElementVNode("span",null,"移除链接",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:u[4]||(u[4]=e.withModifiers(N=>M(()=>i("addCode")),["stop"]))},[u[16]||(u[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:u[5]||(u[5]=e.withModifiers(N=>M(()=>i("removeCode")),["stop"]))},[e.createVNode(_e,{name:"x",size:13}),u[17]||(u[17]=e.createElementVNode("span",null,"移除代码块",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:u[6]||(u[6]=e.withModifiers(N=>M(()=>i("addTable")),["stop"]))},[u[18]||(u[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:u[7]||(u[7]=e.withModifiers(N=>M(()=>i("removeTable")),["stop"]))},[e.createVNode(_e,{name:"x",size:13}),u[19]||(u[19]=e.createElementVNode("span",null,"移除表格",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:u[8]||(u[8]=e.withModifiers(N=>M(()=>i("editNote")),["stop"]))},[e.createVNode(_e,{name:"note",size:13}),e.createElementVNode("span",null,e.toDisplayString(f.value?"编辑笔记":"添加笔记"),1)]),f.value?(e.openBlock(),e.createElementBlock("button",{key:4,class:"zm-node-menu-item",onClick:u[9]||(u[9]=e.withModifiers(N=>M(()=>i("removeNote")),["stop"]))},[e.createVNode(_e,{name:"x",size:13}),u[20]||(u[20]=e.createElementVNode("span",null,"移除笔记",-1))])):e.createCommentVNode("",!0),u[25]||(u[25]=e.createElementVNode("div",{class:"zm-node-menu-divider"},null,-1)),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:e.withModifiers(y,["stop"])},[u[21]||(u[21]=e.createElementVNode("span",{class:"zm-node-menu-icon","aria-hidden":"true"},"⚑",-1)),u[22]||(u[22]=e.createElementVNode("span",null,"标记图标",-1)),e.createElementVNode("span",{class:e.normalizeClass(["zm-node-menu-arrow",{"is-open":h.value}])},"›",2)]),h.value?(e.openBlock(),e.createElementBlock("div",cs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(pi),N=>(e.openBlock(),e.createElementBlock("div",{key:N.label,class:"zm-marker-group"},[e.createElementVNode("div",ds,e.toDisplayString(N.label),1),e.createElementVNode("div",us,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.markers,$=>(e.openBlock(),e.createElementBlock("button",{key:$.id,class:e.normalizeClass(["zm-marker-cell",{"is-active":C($.id)}]),title:$.label,onClick:e.withModifiers(j=>D($.id),["stop"]),innerHTML:'<svg viewBox="0 0 24 24" width="20" height="20">'+e.unref(Io)($.id)+"</svg>"},null,10,fs))),128))])]))),128)),d.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-marker-clear",onClick:u[10]||(u[10]=e.withModifiers(N=>i("clearMarkers"),["stop"]))}," 清除所有标记 ")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:u[11]||(u[11]=e.withModifiers(N=>M(()=>i("addTag")),["stop"]))},[u[23]||(u[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:u[12]||(u[12]=e.withModifiers(N=>M(()=>i("removeTags")),["stop"]))},[e.createVNode(_e,{name:"x",size:13}),u[24]||(u[24]=e.createElementVNode("span",null,"移除标签",-1))])):e.createCommentVNode("",!0)],36))}}),ps=e.defineComponent({__name:"CanvasContextMenu",props:{x:{},y:{},container:{}},emits:["openSettings","openData","openImport","exportPng","exportSvg","close"],setup(t,{emit:o}){const n=t,i=o,a=e.computed(()=>{let M=n.x+2,k=n.y+2;if(n.container){const u=n.container.getBoundingClientRect(),N=160,$=4+4*28+5;M+N>u.right&&(M=Math.max(u.left+4,n.x-N-2)),k+$>u.bottom&&(k=Math.max(u.top+4,n.y-$-2)),M<u.left+2&&(M=u.left+2),k<u.top+2&&(k=u.top+2)}return{left:M,top:k}}),c=e.ref(null),s=e.ref(null),f=e.ref(null),d=e.computed(()=>{const M=c.value==="import"?s.value:c.value==="export"?f.value:null;if(!M)return{left:"-9999px",top:"-9999px",display:"none"};const k=M.getBoundingClientRect(),u=window.innerWidth,N=window.innerHeight,$=176,j=4+3*28;let q=k.right;q+$>u-4&&(q=Math.max(4,k.left-$));let x=k.top-4;return x+j>N-4&&(x=Math.max(4,N-j-4)),{left:q+"px",top:x+"px",display:"block"}});let p=null,h=null;function y(M){h&&(clearTimeout(h),h=null),p=setTimeout(()=>{c.value=M},60)}function C(){p&&(clearTimeout(p),p=null),h=setTimeout(()=>{c.value=null},120)}e.onBeforeUnmount(()=>{p&&clearTimeout(p),h&&clearTimeout(h)});function D(M){const k=M.target;k&&k.closest(".zm-canvas-menu")||i("close")}function _(M){M.key==="Escape"&&i("close")}function F(){i("close")}window.addEventListener("mousedown",D,!0),window.addEventListener("keydown",_,!0),window.addEventListener("wheel",F,!0),window.addEventListener("scroll",F,!0),e.onBeforeUnmount(()=>{window.removeEventListener("mousedown",D,!0),window.removeEventListener("keydown",_,!0),window.removeEventListener("wheel",F,!0),window.removeEventListener("scroll",F,!0)});function R(M){M(),i("close")}return(M,k)=>(e.openBlock(),e.createElementBlock("div",{class:"zm-canvas-menu",style:e.normalizeStyle({left:a.value.left+"px",top:a.value.top+"px"}),onContextmenu:k[11]||(k[11]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:k[0]||(k[0]=e.withModifiers(u=>R(()=>i("openData")),["stop"]))},[e.createVNode(_e,{name:"database",size:13,stroke:1.6}),k[12]||(k[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:k[5]||(k[5]=u=>y("import")),onMouseleave:C},[e.createVNode(_e,{name:"import",size:13,stroke:1.6}),k[16]||(k[16]=e.createElementVNode("span",null,"导入",-1)),k[17]||(k[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:k[4]||(k[4]=u=>y("import")),onMouseleave:C},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:k[1]||(k[1]=e.withModifiers(u=>R(()=>i("openImport","markdown")),["stop"]))},[e.createVNode(_e,{name:"markdown",size:13,stroke:1.6}),k[13]||(k[13]=e.createElementVNode("span",null,"Markdown 导入",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:k[2]||(k[2]=e.withModifiers(u=>R(()=>i("openImport","json")),["stop"]))},[e.createVNode(_e,{name:"json",size:13,stroke:1.6}),k[14]||(k[14]=e.createElementVNode("span",null,"JSON 文件导入",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:k[3]||(k[3]=e.withModifiers(u=>R(()=>i("openImport","txt")),["stop"]))},[e.createVNode(_e,{name:"txt",size:13,stroke:1.6}),k[15]||(k[15]=e.createElementVNode("span",null,"TXT 文件导入",-1))])],36)):e.createCommentVNode("",!0)],34),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:k[6]||(k[6]=e.withModifiers(u=>R(()=>i("openSettings")),["stop"]))},[e.createVNode(_e,{name:"settings",size:13,stroke:1.6}),k[18]||(k[18]=e.createElementVNode("span",null,"设置",-1))]),k[23]||(k[23]=e.createElementVNode("div",{class:"zm-canvas-menu-divider"},null,-1)),e.createElementVNode("div",{ref_key:"exportItemRef",ref:f,class:e.normalizeClass(["zm-canvas-menu-item zm-canvas-menu-item-has-submenu",{"is-open":c.value==="export"}]),onMouseenter:k[10]||(k[10]=u=>y("export")),onMouseleave:C},[e.createVNode(_e,{name:"export",size:13,stroke:1.6}),k[21]||(k[21]=e.createElementVNode("span",null,"导出",-1)),k[22]||(k[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:k[9]||(k[9]=u=>y("export")),onMouseleave:C},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:k[7]||(k[7]=e.withModifiers(u=>R(()=>i("exportPng")),["stop"]))},[e.createVNode(_e,{name:"image",size:13,stroke:1.6}),k[19]||(k[19]=e.createElementVNode("span",null,"导出 PNG",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:k[8]||(k[8]=e.withModifiers(u=>R(()=>i("exportSvg")),["stop"]))},[e.createVNode(_e,{name:"svg-export",size:13,stroke:1.6}),k[20]||(k[20]=e.createElementVNode("span",null,"导出 SVG",-1))])],36)):e.createCommentVNode("",!0)],34)],36))}}),hs=["aria-hidden"],gs=["aria-hidden"],bs={key:0,class:"zm-drawer-header"},ks={key:0,class:"zm-drawer-title"},ys={class:"zm-drawer-body"},Es=["aria-hidden"],xs={key:0,class:"zm-drawer-header"},ws={key:0,class:"zm-drawer-title"},Ns={class:"zm-drawer-body"},It=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 i(){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]=f=>t.closeOnBackdrop&&a())},null,8,hs)):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",bs,[t.title?(e.openBlock(),e.createElementBlock("h3",ks,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:i},[...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",ys,[e.renderSlot(c.$slots,"default")])],14,gs)):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",xs,[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:i},[...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",Ns,[e.renderSlot(c.$slots,"default")])],14,Es)):e.createCommentVNode("",!0)]),_:3}))}}),Ss={class:"zm-outline-root"},Ts={class:"zm-outline-search"},Cs={key:0,class:"zm-outline-search-count"},Ms={key:1,class:"zm-outline-search-count zm-outline-search-empty"},As={class:"zm-outline-actions"},_s={width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Rs={key:0,x:"9",y:"9",width:"13",height:"13",rx:"2"},Bs={key:1,d:"M5 12 L10 17 L19 7"},vs={class:"zm-outline"},zs=["data-outline-id","onClick","onDblclick","onDragstart","onDragover","onDragleave","onDrop"],Is=["title","onClick"],Os={width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round"},Ls={key:0,points:"6 9 12 15 18 9"},Ds={key:1,points:"9 6 15 12 9 18"},Vs={key:1,class:"zm-outline-dot"},$s={key:2,class:"zm-outline-index"},Ps={key:4,class:"zm-outline-text"},Fs=["onClick"],Us=["src"],Hs=["onClick"],Ws=["src"],Gs=["title","onClick"],js={width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Ks={key:0,x:"9",y:"9",width:"13",height:"13",rx:"2"},Ys={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,i=o,a=e.ref(""),c=e.ref(null),s=e.ref(-1),f=e.computed(()=>{const w=a.value.trim().toLowerCase();if(!w)return new Set;const P=new Set,H=ie=>{var xe;(ie.text.toLowerCase().includes(w)||(xe=ie.note)!=null&&xe.text&&ie.note.text.toLowerCase().includes(w))&&P.add(ie.id);for(const Je of ie.children)H(Je)};return H(n.data),P}),d=e.computed(()=>{if(f.value.size===0)return new Set;const w=new Set,P=H=>{let ie=f.value.has(H.id);for(const xe of H.children)P(xe)&&(ie=!0);return ie&&w.add(H.id),ie};return P(n.data),w}),p=e.computed(()=>{const w=[],P=H=>{f.value.has(H.id)&&w.push(H.id);for(const ie of H.children)P(ie)};return P(n.data),w}),h=e.computed(()=>a.value.trim().length>0),y=e.computed(()=>{const w=[],P=d.value,H=(ie,xe,Je)=>{if(h.value&&!P.has(ie.id))return;const Tt=ie.children.length>0,it=h.value?!1:n.collapsedIds.has(ie.id);w.push({id:ie.id,text:ie.text||"(无标题)",depth:xe,siblingIndex:Je,hasChildren:Tt,collapsed:it,node:ie}),Tt&&!it&&ie.children.forEach((nn,Qe)=>H(nn,xe+1,Qe))};return H(n.data,0,0),w});function C(){s.value=p.value.length>0?0:-1}function D(){const w=p.value;w.length!==0&&(s.value=(s.value+1)%w.length,R(s.value))}function _(){const w=p.value;w.length!==0&&(s.value=(s.value-1+w.length)%w.length,R(s.value))}function F(w){w.key==="Enter"?(w.preventDefault(),w.shiftKey?_():D()):w.key==="Escape"&&(w.preventDefault(),a.value="",s.value=-1)}function R(w){const P=p.value[w];if(!P)return;const H=y.value.find(ie=>ie.id===P);H&&i("select",H.node),e.nextTick(()=>{const ie=document.querySelector(`[data-outline-id="${P}"]`);ie==null||ie.scrollIntoView({block:"nearest",behavior:"smooth"})})}function M(){a.value="",s.value=-1}e.onMounted(()=>{e.nextTick(()=>{var w;return(w=c.value)==null?void 0:w.focus()})});const k=e.ref(null),u=e.ref("");let N=null;function $(w){n.readonly||(k.value=w.id,u.value=w.text,e.nextTick(()=>{N=document.querySelector(".zm-outline-input"),N==null||N.focus(),N==null||N.select()}))}function j(){k.value!=null&&(i("edit",{id:k.value,text:u.value.trim()||"(无标题)"}),q())}function q(){k.value=null,u.value="",N=null}function x(w){w.key==="Enter"?(w.preventDefault(),j()):w.key==="Escape"&&(w.preventDefault(),q())}e.onBeforeUnmount(q);const ae=e.ref(null),fe=e.ref(null),me=e.ref(null);function J(w,P){if(n.readonly){w.preventDefault();return}ae.value={id:P.id,text:P.text},w.dataTransfer&&(w.dataTransfer.effectAllowed="move",w.dataTransfer.setData("text/plain",P.id))}function ge(){ae.value=null,fe.value=null,me.value=null}function de(w,P){if(!ae.value)return;w.preventDefault(),w.dataTransfer&&(w.dataTransfer.dropEffect="move");const H=L(w);fe.value=P.id,me.value=H}function ye(w){fe.value===w.id&&(fe.value=null,me.value=null)}function b(w,P){w.preventDefault();const H=ae.value;if(!H)return;const ie=L(w);H.id!==P.id&&i("move",{srcId:H.id,targetId:P.id,position:ie}),ge()}function L(w,P){const ie=w.currentTarget.getBoundingClientRect(),xe=w.clientY-ie.top,Je=ie.height;return xe<Je*.3?"before":xe>Je*.7?"after":"child"}const G=e.ref(null);let ee=null;async function be(w){try{return await navigator.clipboard.writeText(w),!0}catch{const P=document.createElement("textarea");P.value=w,document.body.appendChild(P),P.select();let H=!1;try{H=document.execCommand("copy")}finally{document.body.removeChild(P)}return H}}async function O(w,P,H){w.stopPropagation(),await be(P)&&(G.value=H,ee&&clearTimeout(ee),ee=setTimeout(()=>G.value=null,1200))}const B=e.computed(()=>{const w=[],P=(H,ie)=>{const xe=" ".repeat(ie),Je=ie===0?"":"- ";w.push(xe+Je+(H.text||""));for(const Tt of H.children)P(Tt,ie+1)};return P(n.data,0),w.join(`
16
- `)}),oe=e.ref(!1);let te=null;async function V(){await be(B.value)&&(oe.value=!0,te&&clearTimeout(te),te=setTimeout(()=>oe.value=!1,1200))}return(w,P)=>(e.openBlock(),e.createElementBlock("div",Ss,[e.createElementVNode("div",Ts,[P[3]||(P[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":P[0]||(P[0]=H=>a.value=H),type:"text",class:"zm-outline-search-input",placeholder:"搜索节点… (Enter 下一个, Shift+Enter 上一个)",onInput:C,onKeydown:F},null,544),[[e.vModelText,a.value]]),p.value.length>0?(e.openBlock(),e.createElementBlock("span",Cs,e.toDisplayString(s.value+1)+"/"+e.toDisplayString(p.value.length),1)):h.value?(e.openBlock(),e.createElementBlock("span",Ms,"无结果")):e.createCommentVNode("",!0),a.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-outline-search-clear",title:"清除搜索",onClick:M},"×")):e.createCommentVNode("",!0)]),e.createElementVNode("div",As,[e.createElementVNode("button",{class:e.normalizeClass(["zm-outline-action-btn",{"is-success":oe.value}]),title:"复制完整大纲为纯文本",onClick:V},[(e.openBlock(),e.createElementBlock("svg",_s,[oe.value?(e.openBlock(),e.createElementBlock("path",Bs)):(e.openBlock(),e.createElementBlock("rect",Rs)),P[4]||(P[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(oe.value?"已复制":"复制大纲"),1)],2)]),e.createElementVNode("ul",vs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.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":k.value===H.id,"is-search-hit":f.value.has(H.id),"is-search-current":p.value[s.value]===H.id,"is-drag-over-before":fe.value===H.id&&me.value==="before","is-drag-over-after":fe.value===H.id&&me.value==="after","is-drag-over-child":fe.value===H.id&&me.value==="child"}]),style:e.normalizeStyle({paddingLeft:12+H.depth*16+"px"}),draggable:"true",onClick:ie=>i("select",H.node),onDblclick:ie=>$(H),onDragstart:ie=>J(ie,H),onDragend:ge,onDragover:ie=>de(ie,H),onDragleave:()=>ye(H),onDrop:ie=>b(ie,H)},[H.hasChildren?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-outline-toggle",title:H.collapsed?"展开":"折叠",onClick:e.withModifiers(ie=>i("toggleCollapse",H.id),["stop"])},[(e.openBlock(),e.createElementBlock("svg",Os,[H.collapsed?(e.openBlock(),e.createElementBlock("polyline",Ds)):(e.openBlock(),e.createElementBlock("polyline",Ls))]))],8,Is)):(e.openBlock(),e.createElementBlock("span",Vs)),n.showIndex?(e.openBlock(),e.createElementBlock("span",$s,e.toDisplayString(H.siblingIndex+1)+".",1)):e.createCommentVNode("",!0),k.value===H.id?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:3,"onUpdate:modelValue":P[1]||(P[1]=ie=>u.value=ie),class:"zm-outline-input",onBlur:j,onKeydown:x,onClick:P[2]||(P[2]=e.withModifiers(()=>{},["stop"]))},null,544)),[[e.vModelText,u.value]]):(e.openBlock(),e.createElementBlock("span",Ps,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(ie=>i("addSibling",H.id),["stop"])},[e.createElementVNode("img",{src:e.unref(rr),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,Us)],8,Fs)),n.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:6,class:"zm-outline-row-action",title:"添加子节点",onClick:e.withModifiers(ie=>i("addChild",H.id),["stop"])},[e.createElementVNode("img",{src:e.unref(lr),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,Ws)],8,Hs)),e.createElementVNode("button",{class:e.normalizeClass(["zm-outline-row-copy",{"is-success":G.value===H.id}]),title:G.value===H.id?"已复制":"复制节点文本",onClick:ie=>O(ie,H.text,H.id)},[(e.openBlock(),e.createElementBlock("svg",js,[G.value!==H.id?(e.openBlock(),e.createElementBlock("rect",Ks)):(e.openBlock(),e.createElementBlock("path",Ys)),P[5]||(P[5]=e.createElementVNode("path",{d:"M5 15 H4 a2 2 0 0 1 -2 -2 V4 a2 2 0 0 1 2 -2 h9 a2 2 0 0 1 2 2 v1"},null,-1))]))],10,Gs)],46,zs))),128))])]))}}),qs={key:0,class:"zm-jtv-root"},Xs={key:0,class:"zm-jtv-key"},Zs={key:1,class:"zm-jtv-colon"},Js={key:2,class:"zm-jtv-key zm-jtv-bracket"},Qs={key:3,class:"zm-jtv-size"},ec={key:4,class:"zm-jtv-bracket"},tc={key:5,class:"zm-jtv-brace"},nc={key:0,class:"zm-jtv-children"},oc={class:"zm-jtv-key"},ic={key:0,class:"zm-jtv-key"},rc=["src","alt"],lc=["href"],ac=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),i=e.computed(()=>n.value==="object"),a=e.computed(()=>n.value==="array");e.computed(()=>!i.value&&!a.value);const c=e.computed(()=>{if(a.value)return`Array(${o.value.length})`;if(i.value){const k=o.value,u=Object.keys(k);return`Object(${u.length} ${u.length===1?"key":"keys"})`}return""}),s=e.computed(()=>a.value?o.value.map((k,u)=>({key:String(u),value:k})):i.value?Object.entries(o.value).map(([k,u])=>({key:k,value:u})):[]),f=e.computed(()=>o.isRoot?"<root>":o.path),d=e.computed(()=>o.collapsedPaths.has(f.value));function p(k,u,N){k!=="<root>"&&(N<2||u===null||typeof u!="object"||o.collapsedPaths.has(k)||o.collapsedPaths.add(k))}o.isRoot||p(f.value,o.value,o.depth);function h(){d.value?o.collapsedPaths.delete(f.value):o.collapsedPaths.add(f.value)}function y(k){return f.value===""?k:`${f.value}.${k}`}function C(k){if(!o.query)return!0;const u=o.query.toLowerCase();return typeof k=="string"?k.toLowerCase().includes(u):k===null?"null".includes(u):String(k).toLowerCase().includes(u)}function D(k){return o.query?k.toLowerCase().includes(o.query.toLowerCase()):!0}function _(k,u){return!o.query||D(k)?!0:u===null||typeof u!="object"?C(u):!0}function F(k){return k===null?"null":typeof k=="string"?k.length>80?`"${k.slice(0,80)}..."`:`"${k}"`:typeof k=="boolean"?k?"true":"false":typeof k=="number"?String(k):typeof k>"u"?"undefined":JSON.stringify(k)}function R(k){if(typeof k!="string")return!1;const u=k.trim();return!!(u.startsWith("data:image/")||/^https?:\/\/.+\.(png|jpe?g|gif|webp|svg|bmp|ico)(\?.*)?$/i.test(u)||/^https?:\/\/.+/i.test(u)&&/\/[^/]+\.(png|jpe?g|gif|webp|svg|bmp|ico)(\?.*)?$/i.test(u))}function M(k){if(!o.query)return null;const u=k.toLowerCase().indexOf(o.query.toLowerCase());return u<0?null:{before:k.slice(0,u),match:k.slice(u,u+o.query.length),after:k.slice(u+o.query.length)}}return(k,u)=>{var $,j,q,x,ae,fe;const N=e.resolveComponent("JsonTreeViewer",!0);return t.isRoot?(e.openBlock(),e.createElementBlock("div",qs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,me=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:me.key,class:"zm-jtv-row"},[e.createVNode(N,{"key-name":me.key,value:me.value,path:y(me.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,_(me.key,me.value)]])),128))])):i.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:h},[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",Xs,e.toDisplayString(t.keyName),1)),a.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",Zs,":")),a.value?(e.openBlock(),e.createElementBlock("span",Js,"[")):e.createCommentVNode("",!0),d.value?(e.openBlock(),e.createElementBlock("span",Qs,e.toDisplayString(c.value),1)):e.createCommentVNode("",!0),d.value&&a.value?(e.openBlock(),e.createElementBlock("span",ec,"]")):e.createCommentVNode("",!0),d.value&&i.value?(e.openBlock(),e.createElementBlock("span",tc,"}")):e.createCommentVNode("",!0)],4),d.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",nc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,me=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:me.key,class:"zm-jtv-row"},[e.createVNode(N,{"key-name":me.key,value:me.value,path:y(me.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,_(me.key,me.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&&i.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"})},[u[2]||(u[2]=e.createElementVNode("span",{class:"zm-jtv-toggle is-leaf"},"·",-1)),e.createElementVNode("span",oc,e.toDisplayString(t.keyName),1),u[3]||(u[3]=e.createElementVNode("span",{class:"zm-jtv-colon"},":",-1)),D(t.keyName)&&M(t.keyName)?(e.openBlock(),e.createElementBlock("span",ic,[e.createElementVNode("span",null,e.toDisplayString(($=M(t.keyName))==null?void 0:$.before),1),e.createElementVNode("mark",null,e.toDisplayString((j=M(t.keyName))==null?void 0:j.match),1),e.createElementVNode("span",null,e.toDisplayString((q=M(t.keyName))==null?void 0:q.after),1)])):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(["zm-jtv-value",`zm-jtv-${n.value}`])},[M(F(t.value))?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("span",null,e.toDisplayString((x=M(F(t.value)))==null?void 0:x.before),1),e.createElementVNode("mark",null,e.toDisplayString((ae=M(F(t.value)))==null?void 0:ae.match),1),e.createElementVNode("span",null,e.toDisplayString((fe=M(F(t.value)))==null?void 0:fe.after),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(F(t.value)),1)],64))],2),R(t.value)?(e.openBlock(),e.createElementBlock("span",{key:1,class:"zm-jtv-thumb-wrap",onClick:u[1]||(u[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,rc),e.createElementVNode("a",{class:"zm-jtv-thumb-link",href:String(t.value),target:"_blank",rel:"noopener noreferrer",onClick:u[0]||(u[0]=e.withModifiers(()=>{},["stop"]))},"open",8,lc)])):e.createCommentVNode("",!0)],4))}}}),sc={class:"zm-data-panel"},cc={class:"zm-data-header"},dc={class:"zm-data-title"},uc={class:"zm-data-title-meta"},fc={class:"zm-data-toolbar"},mc=["title"],pc={key:0,width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},hc={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"},gc={key:0,class:"zm-data-paste"},bc={class:"zm-data-tabs"},kc=["placeholder"],yc={key:0,class:"zm-data-error"},Ec={class:"zm-data-paste-actions"},xc=["disabled"],wc={class:"zm-data-tree"},Lo=e.defineComponent({__name:"DataPanel",props:{data:{},pendingMode:{default:null}},emits:["import","consumed-mode"],setup(t,{emit:o}){const n=t,i=o,a=e.computed(()=>JSON.stringify(n.data,null,2)),c=e.ref(""),s=e.ref(null),f=e.ref(!1),d=e.ref("json"),p=e.ref("idle"),h=e.ref(new Set),y=e.ref("");e.watch(()=>n.pendingMode,u=>{u&&(f.value=!0,d.value=u,i("consumed-mode"))},{immediate:!0});async function C(){try{await navigator.clipboard.writeText(a.value),p.value="copied",setTimeout(()=>p.value="idle",1500)}catch{const u=document.createElement("textarea");u.value=a.value,document.body.appendChild(u),u.select();try{document.execCommand("copy"),p.value="copied",setTimeout(()=>p.value="idle",1500)}finally{document.body.removeChild(u)}}}function D(){const u=new Blob([a.value],{type:"application/json"}),N=URL.createObjectURL(u),$=document.createElement("a");$.href=N,$.download=`${n.data.text||"mindmap"}.json`,$.click(),URL.revokeObjectURL(N)}function _(){s.value=null;const u=c.value.trim();if(u){if(d.value==="markdown"||d.value==="txt"){try{const N=In(u);i("import",N),c.value="",f.value=!1}catch(N){s.value=(d.value==="txt"?"TXT 解析失败:":"Markdown 解析失败:")+N.message}return}try{const N=JSON.parse(u);if(!N.id||!Array.isArray(N.children)){s.value="JSON 缺少 id 或 children 字段";return}i("import",N),c.value="",f.value=!1}catch(N){s.value="JSON 解析失败:"+N.message}}}function F(u){return 1+u.children.reduce((N,$)=>N+F($),0)}const R=e.computed(()=>F(n.data)),M=e.computed(()=>a.value.length);function k(){const u=document.createElement("input");u.type="file",u.accept="application/json",u.onchange=()=>{var j;const N=(j=u.files)==null?void 0:j[0];if(!N)return;const $=new FileReader;$.onload=()=>{typeof $.result=="string"&&(c.value=$.result,_())},$.readAsText(N)},u.click()}return(u,N)=>(e.openBlock(),e.createElementBlock("div",sc,[e.createElementVNode("div",cc,[e.createElementVNode("div",dc,[N[8]||(N[8]=e.createElementVNode("span",{class:"zm-data-title-text"},"数据 JSON",-1)),e.createElementVNode("span",uc,e.toDisplayString(R.value)+" 节点 · "+e.toDisplayString(M.value)+" chars",1)])]),e.createElementVNode("div",fc,[e.createElementVNode("button",{class:e.normalizeClass(["zm-data-btn is-icon",{"is-success":p.value==="copied"}]),title:p.value==="copied"?"已复制":"复制 JSON 到剪贴板",onClick:C},[p.value==="idle"?(e.openBlock(),e.createElementBlock("svg",pc,[...N[9]||(N[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",hc,[...N[10]||(N[10]=[e.createElementVNode("polyline",{points:"5 12 10 17 19 7"},null,-1)])])),N[11]||(N[11]=e.createElementVNode("span",{class:"zm-data-btn-label"},"复制",-1))],10,mc),e.createElementVNode("button",{class:"zm-data-btn is-icon",title:"导出为 JSON 文件",onClick:D},[...N[12]||(N[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:k},[...N[13]||(N[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":f.value}]),title:"粘贴 JSON 或 Markdown 替换当前数据",onClick:N[0]||(N[0]=$=>f.value=!f.value)},[...N[14]||(N[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),N[16]||(N[16]=e.createElementVNode("div",{class:"zm-data-toolbar-spacer"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["zm-data-search",{"is-active":y.value.length>0}])},[N[15]||(N[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":N[1]||(N[1]=$=>y.value=$),type:"text",placeholder:"过滤 (键 / 值)",spellcheck:"false"},null,512),[[e.vModelText,y.value]]),y.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-data-search-clear",title:"清空过滤",onClick:N[2]||(N[2]=$=>y.value="")},"×")):e.createCommentVNode("",!0)],2)]),f.value?(e.openBlock(),e.createElementBlock("div",gc,[e.createElementVNode("div",bc,[e.createElementVNode("button",{class:e.normalizeClass(["zm-data-tab",{"is-active":d.value==="json"}]),onClick:N[3]||(N[3]=$=>d.value="json")},"JSON",2),e.createElementVNode("button",{class:e.normalizeClass(["zm-data-tab",{"is-active":d.value==="markdown"}]),onClick:N[4]||(N[4]=$=>d.value="markdown")},"Markdown",2)]),e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":N[5]||(N[5]=$=>c.value=$),placeholder:d.value==="json"?"paste a JSON tree to replace current data":"paste markdown - # / ## / ### become nodes",spellcheck:"false"},null,8,kc),[[e.vModelText,c.value]]),s.value?(e.openBlock(),e.createElementBlock("div",yc,e.toDisplayString(s.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Ec,[e.createElementVNode("button",{class:"zm-data-btn is-primary",disabled:!c.value,onClick:_},"应用",8,xc),e.createElementVNode("button",{class:"zm-data-btn",onClick:N[6]||(N[6]=$=>{c.value="",s.value=null})},"清空"),e.createElementVNode("button",{class:"zm-data-btn",onClick:N[7]||(N[7]=$=>f.value=!1)},"关闭")])])):e.createCommentVNode("",!0),e.createElementVNode("div",wc,[e.createVNode(ac,{value:t.data,query:y.value,"collapsed-paths":h.value},null,8,["value","query","collapsed-paths"])]),N[17]||(N[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))]))}}),Nc={class:"zm-md-panel"},Sc={key:0,class:"zm-md-error"},Tc={class:"zm-md-split"},Cc={class:"zm-md-edit"},Mc={class:"zm-md-preview"},Ac={class:"zm-md-preview-body"},_c={class:"zm-md-footer"},Rc=["disabled"],Bc=`# flow-mindmap 思维导图
9
+ `);for(const i of t.children)n+=Ln(i,o+1);return n}function Ja(t){var p,h;const o=t.split(/\r?\n/),n=[];let i=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(;i<o.length;){const x=o[i],C=x.match(c);if(C){const k=C[1][0],m=C[2]||"",P=[x];for(i++;i<o.length;){const q=o[i].match(c);if(q&&q[1][0]===k){P.push(o[i]),i++;break}P.push(o[i]),i++}const G=P.slice(1,-1).join(`
10
+ `).trim();n.push({kind:"code",text:((p=G.split(`
11
+ `)[0])==null?void 0:p.slice(0,80))||"(空代码块)",raw:P.join(`
12
+ `),lang:m});continue}const $=x.match(a);if($){n.push({kind:"heading",level:$[1].length,text:$[2].trim(),raw:x}),i++;continue}if(/^\s*\|/.test(x)){const k=[];let m=i,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:((h=k[0].replace(/^\s*\|/,"").replace(/\|\s*$/,"").split("|")[0])==null?void 0:h.trim())||"表格",raw:k.join(`
13
+ `)}),i=m;continue}}const R=x.match(u),F=x.match(d);if(R||F){let k=i;for(;k<o.length;){const m=o[k].match(u),P=o[k].match(d);if(!(m||P))break;const G=o[k].replace(/^\s*[-*+]\s+/,"").replace(/^\s*\d+\.\s+/,"").trim();G.length>0&&n.push({kind:"list",text:G.slice(0,80)||"(列表项)",raw:o[k]}),k++}i=k;continue}if(x.trim()===""){i++;continue}const O=[x];let A=i+1;for(;A<o.length;){const k=o[A];if(k.trim()===""||a.test(k)||c.test(k)||u.test(k)||d.test(k)||/^\s*\|/.test(k))break;O.push(k),A++}const y=O.join(" ").trim();n.push({kind:"paragraph",text:y.slice(0,80)||"(空段落)",raw:O.join(`
14
+ `)}),i=A}return n}function Qa(t,o="导入的导图"){const n=Ja(t||""),i={id:Yt(),text:o,children:[]},a=[i],c=[0];let s=!1;function u(d){if(d.kind==="heading"){const h=d.level;for(;a.length>1&&c[c.length-1]>=h;)a.pop(),c.pop();if(!s&&h===1){s=!0,i.text=d.text,c[0]=1;return}const x={id:Yt(),text:d.text,children:[]};a[a.length-1].children.push(x),a.push(x),c.push(h);return}const p={id:Yt(),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 i}function es(t){return t.richContent?t.richContent.raw+`
15
+ `:""}function ts(t){const o=t.minScale??.2,n=t.maxScale??1/0,i=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}),h=e.ref(!1),x=e.reactive({x:0,y:0}),C=e.reactive({x:0,y:0,width:0,height:0}),$=e.ref(0);let R=null;function F(J){R=J}function O(J){J.preventDefault();const me=t.getContainer();if(!me)return;const ae=-J.deltaY*.001,ke=Math.min(n,Math.max(o,a.value*(1+ae))),b=me.getBoundingClientRect(),V=J.clientX-b.left,W=J.clientY-b.top,ee=(V-c.value)/a.value,ge=(W-s.value)/a.value;a.value=ke,c.value=V-ee*ke,s.value=W-ge*ke}function A(){a.value=Math.min(n,a.value*i)}function y(){a.value=Math.max(o,a.value/i)}function k(J){var ae;J.target.closest(".zm-node, .zm-toolbar, button, input, textarea")||(u.value=!0,d.value=!1,p.x=J.clientX,p.y=J.clientY,p.ox=c.value,p.oy=s.value,window.addEventListener("mousemove",m),window.addEventListener("mouseup",P),(ae=J.preventDefault)==null||ae.call(J))}function m(J){if(!u.value)return;const me=J.clientX-p.x,ae=J.clientY-p.y;(Math.abs(me)>3||Math.abs(ae)>3)&&(d.value=!0),c.value=p.ox+me,s.value=p.oy+ae}function P(){u.value=!1,window.removeEventListener("mousemove",m),window.removeEventListener("mouseup",P)}function G(J,me,ae){h.value=!0,x.x=J,x.y=me,C.x=J,C.y=me,C.width=0,C.height=0,C.shiftKey=!!(ae!=null&&ae.shift),$.value++,window.addEventListener("mousemove",ie),window.addEventListener("mouseup",w)}function q(J,me){if(!h.value)return;const ae=Math.min(x.x,J),ke=Math.min(x.y,me),b=Math.max(x.x,J),V=Math.max(x.y,me);C.x=ae,C.y=ke,C.width=b-ae,C.height=V-ke,$.value++}function w(){h.value=!1,window.removeEventListener("mousemove",ie),window.removeEventListener("mouseup",w),R&&R()}function ie(J){if(!h.value)return;const me=t.getContainer();if(!me)return;const ae=me.getBoundingClientRect(),ke=(J.clientX-ae.left-c.value)/a.value,b=(J.clientY-ae.top-s.value)/a.value;q(ke,b)}function fe(J,me,ae,ke=60){const b=t.getContainer();if(!b)return;const V=b.getBoundingClientRect(),W=(V.width-ke*2)/J,ee=(V.height-ke*2)/me,ge=Math.min(1,Math.max(.3,Math.min(W,ee)));a.value=ge,c.value=V.width/2,s.value=V.height/2-ae*ge}function ce(J,me,ae,ke,b=80){const V=t.getContainer();if(!V)return;const W=V.getBoundingClientRect();let ee=a.value;(ae*ee<40||ke*ee<40)&&(ee=Math.min(n,Math.max(1,60/Math.min(ae,ke)))),a.value=ee,c.value=W.width/2-J*ee,s.value=W.height/2-me*ee}return{scale:a,offsetX:c,offsetY:s,isPanning:u,panMoved:d,onWheel:O,zoomIn:A,zoomOut:y,startPan:k,startMarquee:G,updateMarquee:q,isMarquee:h,marquee:C,marqueeVersion:$,setOnMarqueeEnd:F,resetView:fe,centerOn:ce}}const ns=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform);function wr(t){return ns?t.metaKey:t.ctrlKey}function os(t){function o(){const i=t.getSelectedId();if(i)return i;if(t.defaultTargetId)return t.defaultTargetId();const a=t.getSelectedIds();return a.length>0?a[0]:null}function n(i){var u,d,p;const a=i.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(wr(i)&&!i.shiftKey){if(i.key==="d"||i.key==="D"){const h=(u=t.defaultTargetId)==null?void 0:u.call(t);c&&c!==h&&(i.preventDefault(),t.onDuplicate(c));return}if(i.key==="c"||i.key==="C"){const h=t.getSelectedIds();h.length>0&&(i.preventDefault(),t.onCopy(h));return}if(i.key==="x"||i.key==="X"){const h=t.getSelectedIds();h.length>0&&(i.preventDefault(),t.onCut(h));return}if(i.key==="v"||i.key==="V"){if(!t.hasClipboard())return;i.preventDefault();const h=t.getSelectedIds();t.onPaste(h.length>0?h[0]:null);return}if(i.key==="z"||i.key==="Z"){i.preventDefault(),t.onUndo();return}if(i.key==="y"||i.key==="Y"){i.preventDefault(),t.onRedo();return}if(i.key==="Home"){i.preventDefault(),t.onSelectRoot();return}}if(wr(i)&&i.shiftKey&&(i.key==="Z"||i.key==="z")){i.preventDefault(),t.onRedo();return}if(i.key==="Tab")i.preventDefault(),t.onAddChild(s);else if(i.key==="Enter")if(i.preventDefault(),i.shiftKey){const h=(d=t.defaultTargetId)==null?void 0:d.call(t);c&&c!==h&&t.onAddSiblingBefore(c)}else t.onAddSibling(s);else if((i.key==="Delete"||i.key==="Backspace")&&c&&c!==((p=t.defaultTargetId)==null?void 0:p.call(t)))i.preventDefault(),t.onRemove(c);else if(i.key==="F2"&&c)i.preventDefault(),t.onStartEdit(c);else if(i.key==="Escape")i.preventDefault(),t.onClearSelection();else if(i.altKey&&!i.ctrlKey&&!i.metaKey&&!i.shiftKey){if(i.key==="ArrowUp"){i.preventDefault(),t.onMoveSibling(-1);return}else if(i.key==="ArrowDown"){i.preventDefault(),t.onMoveSibling(1);return}}else i.key==="ArrowDown"?(i.preventDefault(),t.onNavigate(0,1)):i.key==="ArrowUp"?(i.preventDefault(),t.onNavigate(0,-1)):i.key==="ArrowRight"?(i.preventDefault(),t.onNavigate(1,0)):i.key==="ArrowLeft"&&(i.preventDefault(),t.onNavigate(-1,0))}}e.onMounted(()=>{window.addEventListener("keydown",n)}),e.onBeforeUnmount(()=>{window.removeEventListener("keydown",n)})}function is(t=100){const o=e.ref([]);let n=-1;function i(){return n>0}function a(){return n<o.value.length-1}function c(p){const h=JSON.stringify(p);for(n<o.value.length-1&&(o.value=o.value.slice(0,n+1)),o.value.push(h),n=o.value.length-1;o.value.length>t;)o.value.shift(),n--}function s(){return i()?(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:i,canRedo:a,record:c,undo:s,redo:u,reset:d}}const rs={1:"#ef4444",2:"#f97316",3:"#f59e0b",4:"#eab308",5:"#84cc16",6:"#22c55e",7:"#14b8a6",8:"#3b82f6",9:"#6366f1"},ls={label:"优先级",markers:Array.from({length:9},(t,o)=>{const n=o+1,i=rs[n];return{id:`priority-${n}`,label:`优先级 ${n}`,svg:`<circle cx="12" cy="12" r="10" fill="${i}"/><text x="12" y="16" text-anchor="middle" font-size="12" font-weight="700" fill="#fff" font-family="sans-serif">${n}</text>`}})};function as(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),i=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)} ${i.toFixed(2)} Z" fill="#3b82f6"/><circle cx="12" cy="12" r="10" fill="none" stroke="#cbd5e1" stroke-width="1"/>`}const ss={label:"进度",markers:[0,25,50,75,100].map(t=>({id:`progress-${t}`,label:`进度 ${t}%`,svg:as(t)}))},cs={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"/>`}))},gi=[ls,ss,cs,{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 gi)for(const o of t.markers)Io[o.id]=o;function ds(t){return Io[t]}function zo(t){var o;return((o=Io[t])==null?void 0:o.svg)??""}function Nr(t){var o;return((o=Io[t])==null?void 0:o.label)??t}function bi(t){let o=0;for(let i=0;i<t.length;i++)o=(o<<5)-o+t.charCodeAt(i),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 us={key:5,class:"zm-marker-picker"},fs={class:"zm-marker-group-label"},ms={class:"zm-marker-grid"},ps=["title","onClick","innerHTML"],hs=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,i=o,a=e.computed(()=>{let y=n.x+2,k=n.y+2;if(n.container){const m=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))*28;y+P>m.right&&(y=Math.max(m.left+4,n.x-P-2)),k+q>m.bottom&&(k=Math.max(m.top+4,n.y-q-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),h=e.ref(!1);function x(){h.value=!h.value}function C(y){return n.nodeMarkers.includes(y)}function $(y){i("toggleMarker",y)}function R(y){const k=y.target;k&&k.closest(".zm-node-menu")||i("close")}function F(y){y.key==="Escape"&&i("close")}function O(){i("close")}window.addEventListener("mousedown",R,!0),window.addEventListener("keydown",F,!0),window.addEventListener("wheel",O,!0),window.addEventListener("scroll",O,!0),e.onBeforeUnmount(()=>{window.removeEventListener("mousedown",R,!0),window.removeEventListener("keydown",F,!0),window.removeEventListener("wheel",O,!0),window.removeEventListener("scroll",O,!0)});function A(y){y(),i("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=>A(()=>i("pickImage")),["stop"]))},[e.createVNode(_e,{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=>A(()=>i("removeImage")),["stop"]))},[e.createVNode(_e,{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=>A(()=>i("setLink")),["stop"]))},[e.createVNode(_e,{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=>A(()=>i("removeLink")),["stop"]))},[e.createVNode(_e,{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=>A(()=>i("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=>A(()=>i("removeCode")),["stop"]))},[e.createVNode(_e,{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=>A(()=>i("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=>A(()=>i("removeTable")),["stop"]))},[e.createVNode(_e,{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=>A(()=>i("editNote")),["stop"]))},[e.createVNode(_e,{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=>A(()=>i("removeNote")),["stop"]))},[e.createVNode(_e,{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(x,["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":h.value}])},"›",2)]),h.value?(e.openBlock(),e.createElementBlock("div",us,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(gi),m=>(e.openBlock(),e.createElementBlock("div",{key:m.label,class:"zm-marker-group"},[e.createElementVNode("div",fs,e.toDisplayString(m.label),1),e.createElementVNode("div",ms,[(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":C(P.id)}]),title:P.label,onClick:e.withModifiers(G=>$(P.id),["stop"]),innerHTML:'<svg viewBox="0 0 24 24" width="20" height="20">'+e.unref(zo)(P.id)+"</svg>"},null,10,ps))),128))])]))),128)),d.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-marker-clear",onClick:k[10]||(k[10]=e.withModifiers(m=>i("clearMarkers"),["stop"]))}," 清除所有标记 ")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[11]||(k[11]=e.withModifiers(m=>A(()=>i("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=>A(()=>i("removeTags")),["stop"]))},[e.createVNode(_e,{name:"x",size:13}),k[24]||(k[24]=e.createElementVNode("span",null,"移除标签",-1))])):e.createCommentVNode("",!0)],36))}}),gs=e.defineComponent({__name:"CanvasContextMenu",props:{x:{},y:{},container:{}},emits:["openSettings","openData","openImport","exportPng","exportSvg","close"],setup(t,{emit:o}){const n=t,i=o,a=e.computed(()=>{let A=n.x+2,y=n.y+2;if(n.container){const k=n.container.getBoundingClientRect(),m=160,P=4+4*28+5;A+m>k.right&&(A=Math.max(k.left+4,n.x-m-2)),y+P>k.bottom&&(y=Math.max(k.top+4,n.y-P-2)),A<k.left+2&&(A=k.left+2),y<k.top+2&&(y=k.top+2)}return{left:A,top:y}}),c=e.ref(null),s=e.ref(null),u=e.ref(null),d=e.computed(()=>{const A=c.value==="import"?s.value:c.value==="export"?u.value:null;if(!A)return{left:"-9999px",top:"-9999px",display:"none"};const y=A.getBoundingClientRect(),k=window.innerWidth,m=window.innerHeight,P=176,G=4+3*28;let q=y.right;q+P>k-4&&(q=Math.max(4,y.left-P));let w=y.top-4;return w+G>m-4&&(w=Math.max(4,m-G-4)),{left:q+"px",top:w+"px",display:"block"}});let p=null,h=null;function x(A){h&&(clearTimeout(h),h=null),p=setTimeout(()=>{c.value=A},60)}function C(){p&&(clearTimeout(p),p=null),h=setTimeout(()=>{c.value=null},120)}e.onBeforeUnmount(()=>{p&&clearTimeout(p),h&&clearTimeout(h)});function $(A){const y=A.target;y&&y.closest(".zm-canvas-menu")||i("close")}function R(A){A.key==="Escape"&&i("close")}function F(){i("close")}window.addEventListener("mousedown",$,!0),window.addEventListener("keydown",R,!0),window.addEventListener("wheel",F,!0),window.addEventListener("scroll",F,!0),e.onBeforeUnmount(()=>{window.removeEventListener("mousedown",$,!0),window.removeEventListener("keydown",R,!0),window.removeEventListener("wheel",F,!0),window.removeEventListener("scroll",F,!0)});function O(A){A(),i("close")}return(A,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=>O(()=>i("openData")),["stop"]))},[e.createVNode(_e,{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=>x("import")),onMouseleave:C},[e.createVNode(_e,{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=>x("import")),onMouseleave:C},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:y[1]||(y[1]=e.withModifiers(k=>O(()=>i("openImport","markdown")),["stop"]))},[e.createVNode(_e,{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=>O(()=>i("openImport","json")),["stop"]))},[e.createVNode(_e,{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=>O(()=>i("openImport","txt")),["stop"]))},[e.createVNode(_e,{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=>O(()=>i("openSettings")),["stop"]))},[e.createVNode(_e,{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=>x("export")),onMouseleave:C},[e.createVNode(_e,{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=>x("export")),onMouseleave:C},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:y[7]||(y[7]=e.withModifiers(k=>O(()=>i("exportPng")),["stop"]))},[e.createVNode(_e,{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=>O(()=>i("exportSvg")),["stop"]))},[e.createVNode(_e,{name:"svg-export",size:13,stroke:1.6}),y[20]||(y[20]=e.createElementVNode("span",null,"导出 SVG",-1))])],36)):e.createCommentVNode("",!0)],34)],36))}}),bs=["aria-hidden"],ks=["aria-hidden"],ys={key:0,class:"zm-drawer-header"},Es={key:0,class:"zm-drawer-title"},xs={class:"zm-drawer-body"},ws=["aria-hidden"],Ns={key:0,class:"zm-drawer-header"},Ss={key:0,class:"zm-drawer-title"},Ts={class:"zm-drawer-body"},Ot=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 i(){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,bs)):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",ys,[t.title?(e.openBlock(),e.createElementBlock("h3",Es,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:i},[...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",xs,[e.renderSlot(c.$slots,"default")])],14,ks)):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",Ns,[t.title?(e.openBlock(),e.createElementBlock("h3",Ss,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:i},[...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",Ts,[e.renderSlot(c.$slots,"default")])],14,ws)):e.createCommentVNode("",!0)]),_:3}))}}),Cs={class:"zm-outline-root"},Ms={class:"zm-outline-search"},As={key:0,class:"zm-outline-search-count"},_s={key:1,class:"zm-outline-search-count zm-outline-search-empty"},Rs={class:"zm-outline-actions"},Bs={width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},vs={key:0,x:"9",y:"9",width:"13",height:"13",rx:"2"},Is={key:1,d:"M5 12 L10 17 L19 7"},zs={class:"zm-outline"},Os=["data-outline-id","onClick","onDblclick","onDragstart","onDragover","onDragleave","onDrop"],Ls=["title","onClick"],Ds={width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round"},Vs={key:0,points:"6 9 12 15 18 9"},$s={key:1,points:"9 6 15 12 9 18"},Ps={key:1,class:"zm-outline-dot"},Fs={key:2,class:"zm-outline-index"},Us={key:4,class:"zm-outline-text"},Hs=["onClick"],Ws=["src"],Gs=["onClick"],js=["src"],Ks=["title","onClick"],Ys={width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},qs={key:0,x:"9",y:"9",width:"13",height:"13",rx:"2"},Xs={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,i=o,a=e.ref(""),c=e.ref(null),s=e.ref(-1),u=e.computed(()=>{const N=a.value.trim().toLowerCase();if(!N)return new Set;const U=new Set,H=oe=>{var Ee;(oe.text.toLowerCase().includes(N)||(Ee=oe.note)!=null&&Ee.text&&oe.note.text.toLowerCase().includes(N))&&U.add(oe.id);for(const et of oe.children)H(et)};return H(n.data),U}),d=e.computed(()=>{if(u.value.size===0)return new Set;const N=new Set,U=H=>{let oe=u.value.has(H.id);for(const Ee of H.children)U(Ee)&&(oe=!0);return oe&&N.add(H.id),oe};return U(n.data),N}),p=e.computed(()=>{const N=[],U=H=>{u.value.has(H.id)&&N.push(H.id);for(const oe of H.children)U(oe)};return U(n.data),N}),h=e.computed(()=>a.value.trim().length>0),x=e.computed(()=>{const N=[],U=d.value,H=(oe,Ee,et)=>{if(h.value&&!U.has(oe.id))return;const ut=oe.children.length>0,tt=h.value?!1:n.collapsedIds.has(oe.id);N.push({id:oe.id,text:oe.text||"(无标题)",depth:Ee,siblingIndex:et,hasChildren:ut,collapsed:tt,node:oe}),ut&&!tt&&oe.children.forEach((nn,nt)=>H(nn,Ee+1,nt))};return H(n.data,0,0),N});function C(){s.value=p.value.length>0?0:-1}function $(){const N=p.value;N.length!==0&&(s.value=(s.value+1)%N.length,O(s.value))}function R(){const N=p.value;N.length!==0&&(s.value=(s.value-1+N.length)%N.length,O(s.value))}function F(N){N.key==="Enter"?(N.preventDefault(),N.shiftKey?R():$()):N.key==="Escape"&&(N.preventDefault(),a.value="",s.value=-1)}function O(N){const U=p.value[N];if(!U)return;const H=x.value.find(oe=>oe.id===U);H&&i("select",H.node),e.nextTick(()=>{const oe=document.querySelector(`[data-outline-id="${U}"]`);oe==null||oe.scrollIntoView({block:"nearest",behavior:"smooth"})})}function A(){a.value="",s.value=-1}e.onMounted(()=>{e.nextTick(()=>{var N;return(N=c.value)==null?void 0:N.focus()})});const y=e.ref(null),k=e.ref("");let m=null;function P(N){n.readonly||(y.value=N.id,k.value=N.text,e.nextTick(()=>{m=document.querySelector(".zm-outline-input"),m==null||m.focus(),m==null||m.select()}))}function G(){y.value!=null&&(i("edit",{id:y.value,text:k.value.trim()||"(无标题)"}),q())}function q(){y.value=null,k.value="",m=null}function w(N){N.key==="Enter"?(N.preventDefault(),G()):N.key==="Escape"&&(N.preventDefault(),q())}e.onBeforeUnmount(q);const ie=e.ref(null),fe=e.ref(null),ce=e.ref(null);function J(N,U){if(n.readonly){N.preventDefault();return}ie.value={id:U.id,text:U.text},N.dataTransfer&&(N.dataTransfer.effectAllowed="move",N.dataTransfer.setData("text/plain",U.id))}function me(){ie.value=null,fe.value=null,ce.value=null}function ae(N,U){if(!ie.value)return;N.preventDefault(),N.dataTransfer&&(N.dataTransfer.dropEffect="move");const H=V(N);fe.value=U.id,ce.value=H}function ke(N){fe.value===N.id&&(fe.value=null,ce.value=null)}function b(N,U){N.preventDefault();const H=ie.value;if(!H)return;const oe=V(N);H.id!==U.id&&i("move",{srcId:H.id,targetId:U.id,position:oe}),me()}function V(N,U){const oe=N.currentTarget.getBoundingClientRect(),Ee=N.clientY-oe.top,et=oe.height;return Ee<et*.3?"before":Ee>et*.7?"after":"child"}const W=e.ref(null);let ee=null;async function ge(N){try{return await navigator.clipboard.writeText(N),!0}catch{const U=document.createElement("textarea");U.value=N,document.body.appendChild(U),U.select();let H=!1;try{H=document.execCommand("copy")}finally{document.body.removeChild(U)}return H}}async function D(N,U,H){N.stopPropagation(),await ge(U)&&(W.value=H,ee&&clearTimeout(ee),ee=setTimeout(()=>W.value=null,1200))}const z=e.computed(()=>{const N=[],U=(H,oe)=>{const Ee=" ".repeat(oe),et=oe===0?"":"- ";N.push(Ee+et+(H.text||""));for(const ut of H.children)U(ut,oe+1)};return U(n.data,0),N.join(`
16
+ `)}),le=e.ref(!1);let be=null;async function I(){await ge(z.value)&&(le.value=!0,be&&clearTimeout(be),be=setTimeout(()=>le.value=!1,1200))}return(N,U)=>(e.openBlock(),e.createElementBlock("div",Cs,[e.createElementVNode("div",Ms,[U[3]||(U[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":U[0]||(U[0]=H=>a.value=H),type:"text",class:"zm-outline-search-input",placeholder:"搜索节点… (Enter 下一个, Shift+Enter 上一个)",onInput:C,onKeydown:F},null,544),[[e.vModelText,a.value]]),p.value.length>0?(e.openBlock(),e.createElementBlock("span",As,e.toDisplayString(s.value+1)+"/"+e.toDisplayString(p.value.length),1)):h.value?(e.openBlock(),e.createElementBlock("span",_s,"无结果")):e.createCommentVNode("",!0),a.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-outline-search-clear",title:"清除搜索",onClick:A},"×")):e.createCommentVNode("",!0)]),e.createElementVNode("div",Rs,[e.createElementVNode("button",{class:e.normalizeClass(["zm-outline-action-btn",{"is-success":le.value}]),title:"复制完整大纲为纯文本",onClick:I},[(e.openBlock(),e.createElementBlock("svg",Bs,[le.value?(e.openBlock(),e.createElementBlock("path",Is)):(e.openBlock(),e.createElementBlock("rect",vs)),U[4]||(U[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(le.value?"已复制":"复制大纲"),1)],2)]),e.createElementVNode("ul",zs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.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":y.value===H.id,"is-search-hit":u.value.has(H.id),"is-search-current":p.value[s.value]===H.id,"is-drag-over-before":fe.value===H.id&&ce.value==="before","is-drag-over-after":fe.value===H.id&&ce.value==="after","is-drag-over-child":fe.value===H.id&&ce.value==="child"}]),style:e.normalizeStyle({paddingLeft:12+H.depth*16+"px"}),draggable:"true",onClick:oe=>i("select",H.node),onDblclick:oe=>P(H),onDragstart:oe=>J(oe,H),onDragend:me,onDragover:oe=>ae(oe,H),onDragleave:()=>ke(H),onDrop:oe=>b(oe,H)},[H.hasChildren?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-outline-toggle",title:H.collapsed?"展开":"折叠",onClick:e.withModifiers(oe=>i("toggleCollapse",H.id),["stop"])},[(e.openBlock(),e.createElementBlock("svg",Ds,[H.collapsed?(e.openBlock(),e.createElementBlock("polyline",$s)):(e.openBlock(),e.createElementBlock("polyline",Vs))]))],8,Ls)):(e.openBlock(),e.createElementBlock("span",Ps)),n.showIndex?(e.openBlock(),e.createElementBlock("span",Fs,e.toDisplayString(H.siblingIndex+1)+".",1)):e.createCommentVNode("",!0),y.value===H.id?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:3,"onUpdate:modelValue":U[1]||(U[1]=oe=>k.value=oe),class:"zm-outline-input",onBlur:G,onKeydown:w,onClick:U[2]||(U[2]=e.withModifiers(()=>{},["stop"]))},null,544)),[[e.vModelText,k.value]]):(e.openBlock(),e.createElementBlock("span",Us,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(oe=>i("addSibling",H.id),["stop"])},[e.createElementVNode("img",{src:e.unref(lr),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,Ws)],8,Hs)),n.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:6,class:"zm-outline-row-action",title:"添加子节点",onClick:e.withModifiers(oe=>i("addChild",H.id),["stop"])},[e.createElementVNode("img",{src:e.unref(ar),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,js)],8,Gs)),e.createElementVNode("button",{class:e.normalizeClass(["zm-outline-row-copy",{"is-success":W.value===H.id}]),title:W.value===H.id?"已复制":"复制节点文本",onClick:oe=>D(oe,H.text,H.id)},[(e.openBlock(),e.createElementBlock("svg",Ys,[W.value!==H.id?(e.openBlock(),e.createElementBlock("rect",qs)):(e.openBlock(),e.createElementBlock("path",Xs)),U[5]||(U[5]=e.createElementVNode("path",{d:"M5 15 H4 a2 2 0 0 1 -2 -2 V4 a2 2 0 0 1 2 -2 h9 a2 2 0 0 1 2 2 v1"},null,-1))]))],10,Ks)],46,Os))),128))])]))}}),Zs={key:0,class:"zm-jtv-root"},Js={key:0,class:"zm-jtv-key"},Qs={key:1,class:"zm-jtv-colon"},ec={key:2,class:"zm-jtv-key zm-jtv-bracket"},tc={key:3,class:"zm-jtv-size"},nc={key:4,class:"zm-jtv-bracket"},oc={key:5,class:"zm-jtv-brace"},ic={key:0,class:"zm-jtv-children"},rc={class:"zm-jtv-key"},lc={key:0,class:"zm-jtv-key"},ac=["src","alt"],sc=["href"],cc=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),i=e.computed(()=>n.value==="object"),a=e.computed(()=>n.value==="array");e.computed(()=>!i.value&&!a.value);const c=e.computed(()=>{if(a.value)return`Array(${o.value.length})`;if(i.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})):i.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 h(){d.value?o.collapsedPaths.delete(u.value):o.collapsedPaths.add(u.value)}function x(y){return u.value===""?y:`${u.value}.${y}`}function C(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 $(y){return o.query?y.toLowerCase().includes(o.query.toLowerCase()):!0}function R(y,k){return!o.query||$(y)?!0:k===null||typeof k!="object"?C(k):!0}function F(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 O(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 A(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,G,q,w,ie,fe;const m=e.resolveComponent("JsonTreeViewer",!0);return t.isRoot?(e.openBlock(),e.createElementBlock("div",Zs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,ce=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:ce.key,class:"zm-jtv-row"},[e.createVNode(m,{"key-name":ce.key,value:ce.value,path:x(ce.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(ce.key,ce.value)]])),128))])):i.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:h},[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",Js,e.toDisplayString(t.keyName),1)),a.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",Qs,":")),a.value?(e.openBlock(),e.createElementBlock("span",ec,"[")):e.createCommentVNode("",!0),d.value?(e.openBlock(),e.createElementBlock("span",tc,e.toDisplayString(c.value),1)):e.createCommentVNode("",!0),d.value&&a.value?(e.openBlock(),e.createElementBlock("span",nc,"]")):e.createCommentVNode("",!0),d.value&&i.value?(e.openBlock(),e.createElementBlock("span",oc,"}")):e.createCommentVNode("",!0)],4),d.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ic,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,ce=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:ce.key,class:"zm-jtv-row"},[e.createVNode(m,{"key-name":ce.key,value:ce.value,path:x(ce.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(ce.key,ce.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&&i.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",rc,e.toDisplayString(t.keyName),1),k[3]||(k[3]=e.createElementVNode("span",{class:"zm-jtv-colon"},":",-1)),$(t.keyName)&&A(t.keyName)?(e.openBlock(),e.createElementBlock("span",lc,[e.createElementVNode("span",null,e.toDisplayString((P=A(t.keyName))==null?void 0:P.before),1),e.createElementVNode("mark",null,e.toDisplayString((G=A(t.keyName))==null?void 0:G.match),1),e.createElementVNode("span",null,e.toDisplayString((q=A(t.keyName))==null?void 0:q.after),1)])):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(["zm-jtv-value",`zm-jtv-${n.value}`])},[A(F(t.value))?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("span",null,e.toDisplayString((w=A(F(t.value)))==null?void 0:w.before),1),e.createElementVNode("mark",null,e.toDisplayString((ie=A(F(t.value)))==null?void 0:ie.match),1),e.createElementVNode("span",null,e.toDisplayString((fe=A(F(t.value)))==null?void 0:fe.after),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(F(t.value)),1)],64))],2),O(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,ac),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,sc)])):e.createCommentVNode("",!0)],4))}}}),dc={class:"zm-data-panel"},uc={class:"zm-data-header"},fc={class:"zm-data-title"},mc={class:"zm-data-title-meta"},pc={class:"zm-data-toolbar"},hc=["title"],gc={key:0,width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},bc={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"},kc={key:0,class:"zm-data-paste"},yc={class:"zm-data-tabs"},Ec=["placeholder"],xc={key:0,class:"zm-data-error"},wc={class:"zm-data-paste-actions"},Nc=["disabled"],Sc={class:"zm-data-tree"},Lo=e.defineComponent({__name:"DataPanel",props:{data:{},pendingMode:{default:null}},emits:["import","consumed-mode"],setup(t,{emit:o}){const n=t,i=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"),h=e.ref(new Set),x=e.ref("");e.watch(()=>n.pendingMode,k=>{k&&(u.value=!0,d.value=k,i("consumed-mode"))},{immediate:!0});async function C(){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 $(){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);i("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}i("import",m),c.value="",u.value=!1}catch(m){s.value="JSON 解析失败:"+m.message}}}function F(k){return 1+k.children.reduce((m,P)=>m+F(P),0)}const O=e.computed(()=>F(n.data)),A=e.computed(()=>a.value.length);function y(){const k=document.createElement("input");k.type="file",k.accept="application/json",k.onchange=()=>{var G;const m=(G=k.files)==null?void 0:G[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",dc,[e.createElementVNode("div",uc,[e.createElementVNode("div",fc,[m[8]||(m[8]=e.createElementVNode("span",{class:"zm-data-title-text"},"数据 JSON",-1)),e.createElementVNode("span",mc,e.toDisplayString(O.value)+" 节点 · "+e.toDisplayString(A.value)+" chars",1)])]),e.createElementVNode("div",pc,[e.createElementVNode("button",{class:e.normalizeClass(["zm-data-btn is-icon",{"is-success":p.value==="copied"}]),title:p.value==="copied"?"已复制":"复制 JSON 到剪贴板",onClick:C},[p.value==="idle"?(e.openBlock(),e.createElementBlock("svg",gc,[...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",bc,[...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,hc),e.createElementVNode("button",{class:"zm-data-btn is-icon",title:"导出为 JSON 文件",onClick:$},[...m[12]||(m[12]=[e.createStaticVNode('<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 4 V15"></path><polyline points="7 9 12 4 17 9"></polyline><path d="M4 19 H20"></path></svg><span class="zm-data-btn-label">导出</span>',2)])]),e.createElementVNode("button",{class:"zm-data-btn is-icon",title:"从 JSON 文件导入",onClick: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":x.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=>x.value=P),type:"text",placeholder:"过滤 (键 / 值)",spellcheck:"false"},null,512),[[e.vModelText,x.value]]),x.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-data-search-clear",title:"清空过滤",onClick:m[2]||(m[2]=P=>x.value="")},"×")):e.createCommentVNode("",!0)],2)]),u.value?(e.openBlock(),e.createElementBlock("div",kc,[e.createElementVNode("div",yc,[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,Ec),[[e.vModelText,c.value]]),s.value?(e.openBlock(),e.createElementBlock("div",xc,e.toDisplayString(s.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",wc,[e.createElementVNode("button",{class:"zm-data-btn is-primary",disabled:!c.value,onClick:R},"应用",8,Nc),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",Sc,[e.createVNode(cc,{value:t.data,query:x.value,"collapsed-paths":h.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))]))}}),Tc={class:"zm-md-panel"},Cc={key:0,class:"zm-md-error"},Mc={class:"zm-md-split"},Ac={class:"zm-md-edit"},_c={class:"zm-md-preview"},Rc={class:"zm-md-preview-body"},Bc={class:"zm-md-footer"},vc=["disabled"],Ic=`# 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
- `,Do=e.defineComponent({__name:"MarkdownPanel",props:{data:{}},emits:["import"],setup(t,{emit:o}){const n=t,i=o,a=e.ref(On(n.data)),c=e.ref(null),s=e.ref(null),f=e.computed(()=>{try{const R=In(a.value||"");return c.value=null,R}catch(R){return c.value=R.message,{id:"preview_fallback",text:a.value||"(空)",children:[]}}}),d=e.computed(()=>zt(f.value));let p=null;e.watch(a,()=>{p&&clearTimeout(p),p=setTimeout(()=>{var R;return(R=s.value)==null?void 0:R.resetView()},250)});function h(){try{const R=In(a.value||"");c.value=null,i("import",R)}catch(R){c.value=R.message}}function y(){a.value=On(n.data),c.value=null,e.nextTick(()=>{var R;return(R=s.value)==null?void 0:R.resetView()})}function C(){a.value="",c.value=null,e.nextTick(()=>{var R;return(R=s.value)==null?void 0:R.resetView()})}function D(){const R=document.createElement("input");R.type="file",R.accept=".md,text/markdown,text/plain",R.onchange=()=>{var u;const M=(u=R.files)==null?void 0:u[0];if(!M)return;const k=new FileReader;k.onload=()=>{typeof k.result=="string"&&(a.value=k.result,c.value=null,e.nextTick(()=>{var N;return(N=s.value)==null?void 0:N.resetView()}))},k.readAsText(M)},R.click()}function _(){const R=new Blob([a.value],{type:"text/markdown;charset=utf-8"}),M=URL.createObjectURL(R),k=document.createElement("a");k.href=M;const u=(n.data.text||"mindmap").trim()||"mindmap";k.download=`${u}.md`,k.click(),URL.revokeObjectURL(M)}function F(){a.value=Bc,c.value=null,e.nextTick(()=>{var R;return(R=s.value)==null?void 0:R.resetView()})}return(R,M)=>(e.openBlock(),e.createElementBlock("div",Nc,[e.createElementVNode("div",{class:"zm-md-toolbar"},[e.createElementVNode("button",{class:"zm-md-btn",title:"从 .md 文件加载",onClick:D},[...M[1]||(M[1]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M12 4 V15"}),e.createElementVNode("polyline",{points:"7 9 12 4 17 9"}),e.createElementVNode("path",{d:"M4 19 H20"})],-1),e.createElementVNode("span",null,"加载 .md",-1)])]),e.createElementVNode("button",{class:"zm-md-btn",title:"把当前导图导出为 .md",onClick:_},[...M[2]||(M[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)])]),M[3]||(M[3]=e.createElementVNode("span",{class:"zm-md-spacer"},null,-1)),e.createElementVNode("button",{class:"zm-md-btn",title:"用示例内容填充",onClick:F},"示例"),e.createElementVNode("button",{class:"zm-md-btn",title:"覆盖为当前导图",onClick:y},"同步"),e.createElementVNode("button",{class:"zm-md-btn",title:"清空",onClick:C},"清空")]),c.value?(e.openBlock(),e.createElementBlock("div",Sc,e.toDisplayString(c.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Tc,[e.createElementVNode("div",Cc,[M[4]||(M[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":M[0]||(M[0]=k=>a.value=k),class:"zm-md-textarea",spellcheck:"false",placeholder:"# 标题…"},null,512),[[e.vModelText,a.value]])]),e.createElementVNode("div",Mc,[M[5]||(M[5]=e.createElementVNode("div",{class:"zm-md-pane-header"},[e.createElementVNode("span",null,"导图预览"),e.createElementVNode("span",{class:"zm-md-hint"},"只读")],-1)),e.createElementVNode("div",Ac,[e.createVNode(Qo,{ref_key:"previewRef",ref:s,data:d.value,readonly:"","preview-mode":""},null,8,["data"])])])]),e.createElementVNode("div",_c,[e.createElementVNode("button",{class:"zm-md-btn is-primary",disabled:!a.value.trim(),onClick:h},"应用到导图",8,Rc)])]))}}),vc={class:"zm-settings-panel"},zc={class:"zm-settings-section"},Ic={class:"zm-settings-field"},Oc={class:"zm-settings-control"},Lc={class:"zm-color-input-wrap"},Dc=["value"],Vc={class:"zm-color-input-text"},$c={class:"zm-swatch-row zm-swatch-row--compact"},Pc=["title","onClick"],Fc={class:"zm-settings-field"},Uc=["value"],Hc={class:"zm-slider"},Wc=["value"],Gc={class:"zm-settings-field"},jc=["value"],Kc={class:"zm-slider"},Yc=["value"],qc={class:"zm-settings-field zm-line-style-field"},Xc={class:"zm-line-style-group"},Zc=["title","onClick"],Jc=["viewBox"],Qc={key:0,d:"M 0 12 Q 14 2, 28 12",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},ed={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"},td={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"},nd={key:3,d:"M 0 12 C 8 0, 20 0, 28 12",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},od={key:4,x1:"0",y1:"12",x2:"28",y2:"12",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},id={class:"zm-line-style-label"},rd={class:"zm-settings-field zm-line-style-field"},ld={class:"zm-line-style-group"},ad=["title","onClick"],sd=["viewBox"],cd={key:0,d:"M 0 12 Q 14 2, 28 12",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},dd={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"},ud={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"},fd={key:3,d:"M 0 12 C 8 0, 20 0, 28 12",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},md={key:4,x1:"0",y1:"12",x2:"28",y2:"12",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},pd={class:"zm-line-style-label"},hd={key:0,class:"zm-settings-field"},gd={class:"zm-settings-label"},bd={class:"zm-settings-sub"},kd=["value"],yd={key:1,class:"zm-slider"},Ed=["value"],xd={class:"zm-settings-field zm-line-style-field"},wd={class:"zm-line-style-group"},Nd=["title","onClick"],Sd={viewBox:"0 0 28 18",width:"28",height:"18",preserveAspectRatio:"none"},Td={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"},Cd={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"},Md={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"},Ad={class:"zm-line-style-label"},_d={class:"zm-settings-field"},Rd={key:2,class:"zm-palette-picker"},Bd={class:"zm-palette-list"},vd=["onClick"],zd={class:"zm-palette-option-name"},Id={class:"zm-palette-option-swatches"},Od={key:0,class:"zm-palette-custom-editor"},Ld=["value"],Dd={class:"zm-palette-custom-actions"},Vd={class:"zm-settings-field"},$d={key:3,class:"zm-settings-field"},Pd={class:"zm-settings-label"},Fd={class:"zm-settings-sub"},Ud=["value"],Hd={key:4,class:"zm-slider"},Wd=["value"],Gd={class:"zm-settings-field"},jd={class:"zm-settings-preview"},Kd={viewBox:"0 0 200 70",width:"100%",height:"70",preserveAspectRatio:"none"},Yd=["x1","y1","x2","y2","stroke","stroke-width"],qd={key:0,class:"zm-settings-section"},Xd={class:"zm-settings-section-title"},Zd={key:0,class:"zm-settings-section-sub"},Jd={class:"zm-settings-field"},Qd={class:"zm-settings-value-tag"},eu={class:"zm-swatch-row"},tu=["title","onClick"],nu={class:"zm-swatch zm-swatch--custom",title:"自定义颜色"},ou=["value"],iu={class:"zm-settings-field"},ru={class:"zm-settings-value-tag"},lu={class:"zm-swatch-row"},au=["title","onClick"],su={class:"zm-swatch zm-swatch--custom",title:"自定义颜色"},cu=["value"],du={class:"zm-settings-field"},uu=["value"],fu=["value"],mu={class:"zm-settings-field"},pu=["value"],hu={class:"zm-slider"},gu=["value"],bu={class:"zm-settings-section zm-settings-section--actions"},Vo=((t,o)=>{const n=t.__vccOpts||t;for(const[i,a]of o)n[i]=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,i=o;function a(q,x){i("update:settings",{[q]: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,f=[{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(q){i("update:nodeStyle",q)}const h=e.computed(()=>[...cn,...n.settings.customPalettes]),y=e.reactive({});function C(q){return y[q.id]===void 0&&(y[q.id]=q.colors.join(`
56
- `)),y[q.id]}function D(q){const x=y[q.id]??"",ae=Ua(x);if(ae.length===0){y[q.id]=q.colors.join(`
57
- `);return}const fe=n.settings.customPalettes.map(me=>me.id===q.id?{...me,colors:ae}:me);i("update:settings",{customPalettes:fe})}function _(){const q=h.value.find(J=>J.id===n.settings.branchPaletteId),x=q?[...q.colors]:[...cn[0].colors],ae="custom-";let fe=ae+(n.settings.customPalettes.length+1);for(;cn.some(J=>J.id===fe)||n.settings.customPalettes.some(J=>J.id===fe);)fe=ae+Math.random().toString(36).slice(2,7);const me={id:fe,name:`我的配色 ${n.settings.customPalettes.length+1}`,colors:x};i("update:settings",{customPalettes:[...n.settings.customPalettes,me],branchPaletteId:fe}),y[fe]=x.join(`
58
- `)}function F(q){const x=n.settings.customPalettes.filter(fe=>fe.id!==q.id),ae=n.settings.branchPaletteId===q.id?"default":n.settings.branchPaletteId;i("update:settings",{customPalettes:x,...ae!==n.settings.branchPaletteId?{branchPaletteId:ae}:{}}),delete y[q.id]}const R=["#f87171","#fb923c","#fbbf24","#a3e635","#34d399","#22d3ee","#818cf8","#c084fc","#1e2937","#f8fafc","#94a3b8"],M=["#f8fafc","#ffffff","#e2e8f0","#1e2937","#0f172a","#fef3c7","#dbeafe","#dcfce7","#fce7f3","#f1f5f9"],k=[0,1,2,3],u=["#f87171","#fb923c","#34d399","#818cf8"];function N(q,x,ae,fe){if(x<=1)return ae;const me=q/(x-1);return ae+(fe-ae)*me}function $(q,x,ae,fe){const me=x*Math.pow(fe,q);return Math.max(ae,me)}const j=e.computed(()=>{const q=n.settings.lineWidthStart,x=n.settings.lineWidthEnd,ae=n.settings.taperedEdge,fe=k.length,me=8,J=192,ge=h.value.find(ye=>ye.id===n.settings.branchPaletteId),de=ge&&ge.colors.length?ge.colors:u;return k.map((ye,b)=>{const L=10+b*60/(fe-1);return{x1:me,y1:L,x2:J,y2:L,w:ae?$(ye,q,x,n.settings.lineWidthTaper):N(ye,fe,q,x),color:n.settings.rainbowBranch?de[b%de.length]:"#94a3b8"}})});return(q,x)=>{var ae,fe,me,J,ge,de,ye;return e.openBlock(),e.createElementBlock("div",vc,[e.createElementVNode("section",zc,[x[45]||(x[45]=e.createElementVNode("h4",{class:"zm-settings-section-title"},"画布",-1)),e.createElementVNode("div",Ic,[x[24]||(x[24]=e.createElementVNode("span",{class:"zm-settings-label"},"画布背景色",-1)),e.createElementVNode("div",Oc,[e.createElementVNode("label",Lc,[e.createElementVNode("input",{type:"color",class:"zm-color-input",value:t.settings.canvasBg||"#f8fafc",onInput:x[0]||(x[0]=b=>a("canvasBg",b.target.value))},null,40,Dc),e.createElementVNode("span",Vc,e.toDisplayString(t.settings.canvasBg||"默认"),1)])])]),e.createElementVNode("div",$c,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(M,b=>e.createElementVNode("button",{key:"cbg-"+b,class:e.normalizeClass(["zm-swatch",{"is-active":(t.settings.canvasBg||"#f8fafc")===b}]),style:e.normalizeStyle({background:b}),title:b,onClick:L=>a("canvasBg",b)},null,14,Pc)),64)),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"恢复默认",onClick:x[1]||(x[1]=b=>a("canvasBg",void 0))},"∅")]),x[46]||(x[46]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",Fc,[x[25]||(x[25]=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]=b=>a("lineWidthStart",parseFloat(b.target.value)||0))},null,40,Uc)]),e.createElementVNode("div",Hc,[x[26]||(x[26]=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]=b=>a("lineWidthStart",parseFloat(b.target.value)))},null,40,Wc)]),e.createElementVNode("div",Gc,[x[27]||(x[27]=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]=b=>a("lineWidthEnd",parseFloat(b.target.value)||0))},null,40,jc)]),e.createElementVNode("div",Kc,[x[28]||(x[28]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"0.2",max:"6",step:"0.1",value:t.settings.lineWidthEnd,onInput:x[5]||(x[5]=b=>a("lineWidthEnd",parseFloat(b.target.value)))},null,40,Yc)]),x[47]||(x[47]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",qc,[x[29]||(x[29]=e.createElementVNode("span",{class:"zm-settings-label"},"根节点线条",-1)),e.createElementVNode("div",Xc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(s),b=>(e.openBlock(),e.createElementBlock("button",{key:b.value,class:e.normalizeClass(["zm-line-style-btn",{"is-on":t.settings.rootLineStyle===b.value}]),title:b.label,onClick:L=>a("rootLineStyle",b.value)},[(e.openBlock(),e.createElementBlock("svg",{viewBox:b.viewBox,width:"28",height:"14",preserveAspectRatio:"none"},[b.value==="arc"?(e.openBlock(),e.createElementBlock("path",Qc)):b.value==="rounded-elbow"?(e.openBlock(),e.createElementBlock("path",ed)):b.value==="elbow"?(e.openBlock(),e.createElementBlock("path",td)):b.value==="curve"?(e.openBlock(),e.createElementBlock("path",nd)):(e.openBlock(),e.createElementBlock("line",od))],8,Jc)),e.createElementVNode("span",id,e.toDisplayString(b.label),1)],10,Zc))),128))])]),e.createElementVNode("div",rd,[x[30]||(x[30]=e.createElementVNode("span",{class:"zm-settings-label"},"其他节点线条",-1)),e.createElementVNode("div",ld,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(c,b=>e.createElementVNode("button",{key:b.value,class:e.normalizeClass(["zm-line-style-btn",{"is-on":t.settings.lineStyle===b.value}]),title:b.label,onClick:L=>a("lineStyle",b.value)},[(e.openBlock(),e.createElementBlock("svg",{viewBox:b.viewBox,width:"28",height:"14",preserveAspectRatio:"none"},[b.value==="arc"?(e.openBlock(),e.createElementBlock("path",cd)):b.value==="rounded-elbow"?(e.openBlock(),e.createElementBlock("path",dd)):b.value==="elbow"?(e.openBlock(),e.createElementBlock("path",ud)):b.value==="curve"?(e.openBlock(),e.createElementBlock("path",fd)):(e.openBlock(),e.createElementBlock("line",md))],8,sd)),e.createElementVNode("span",pd,e.toDisplayString(b.label),1)],10,ad)),64))])]),t.settings.lineStyle==="rounded-elbow"||t.settings.rootLineStyle==="rounded-elbow"?(e.openBlock(),e.createElementBlock("div",hd,[e.createElementVNode("span",gd,[x[31]||(x[31]=e.createTextVNode("圆角大小 ",-1)),e.createElementVNode("span",bd,e.toDisplayString(t.settings.elbowRadius)+"px",1)]),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"1",min:"2",max:"20",value:t.settings.elbowRadius,onChange:x[6]||(x[6]=b=>a("elbowRadius",parseFloat(b.target.value)||8))},null,40,kd)])):e.createCommentVNode("",!0),t.settings.lineStyle==="rounded-elbow"||t.settings.rootLineStyle==="rounded-elbow"?(e.openBlock(),e.createElementBlock("div",yd,[x[32]||(x[32]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"2",max:"20",step:"1",value:t.settings.elbowRadius,onInput:x[7]||(x[7]=b=>a("elbowRadius",parseFloat(b.target.value)))},null,40,Ed)])):e.createCommentVNode("",!0),e.createElementVNode("div",xd,[x[34]||(x[34]=e.createElementVNode("span",{class:"zm-settings-label"},"线条起点",-1)),e.createElementVNode("div",wd,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(f,b=>e.createElementVNode("button",{key:b.value,class:e.normalizeClass(["zm-line-style-btn",{"is-on":t.settings.lineOrigin===b.value}]),title:b.label,onClick:L=>a("lineOrigin",b.value)},[(e.openBlock(),e.createElementBlock("svg",Sd,[x[33]||(x[33]=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)),b.value==="edge"?(e.openBlock(),e.createElementBlock("path",Td)):b.value==="center"?(e.openBlock(),e.createElementBlock("path",Cd)):(e.openBlock(),e.createElementBlock("path",Md))])),e.createElementVNode("span",Ad,e.toDisplayString(b.label),1)],10,Nd)),64))])]),e.createElementVNode("div",_d,[x[36]||(x[36]=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]=b=>a("rainbowBranch",!t.settings.rainbowBranch))},[...x[35]||(x[35]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),t.settings.rainbowBranch?(e.openBlock(),e.createElementBlock("div",Rd,[x[37]||(x[37]=e.createElementVNode("div",{class:"zm-settings-field"},[e.createElementVNode("span",{class:"zm-settings-label"},"配色方案")],-1)),e.createElementVNode("div",Bd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,b=>(e.openBlock(),e.createElementBlock("button",{key:b.id,class:e.normalizeClass(["zm-palette-option",{"is-active":t.settings.branchPaletteId===b.id}]),onClick:L=>a("branchPaletteId",b.id)},[e.createElementVNode("span",zd,e.toDisplayString(b.name),1),e.createElementVNode("span",Id,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.colors,(L,G)=>(e.openBlock(),e.createElementBlock("span",{key:G,class:"zm-palette-option-swatch",style:e.normalizeStyle({background:L})},null,4))),128))])],10,vd))),128))]),t.settings.customPalettes.find(b=>b.id===t.settings.branchPaletteId)?(e.openBlock(),e.createElementBlock("div",Od,[e.createElementVNode("textarea",{class:"zm-palette-textarea",rows:"3",spellcheck:"false",placeholder:"一行一个 hex,例如 #f87171",value:C(t.settings.customPalettes.find(b=>b.id===t.settings.branchPaletteId)),onInput:x[9]||(x[9]=b=>y[t.settings.customPalettes.find(L=>L.id===t.settings.branchPaletteId).id]=b.target.value)},null,40,Ld),e.createElementVNode("div",Dd,[e.createElementVNode("button",{type:"button",class:"zm-data-btn is-primary",onClick:x[10]||(x[10]=b=>D(t.settings.customPalettes.find(L=>L.id===t.settings.branchPaletteId)))},"保存"),e.createElementVNode("button",{type:"button",class:"zm-data-btn",onClick:x[11]||(x[11]=b=>F(t.settings.customPalettes.find(L=>L.id===t.settings.branchPaletteId)))},"删除")])])):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"zm-palette-add",onClick:_},"+ 新建配色")])):e.createCommentVNode("",!0),x[48]||(x[48]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",Vd,[x[39]||(x[39]=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]=b=>a("taperedEdge",!t.settings.taperedEdge))},[...x[38]||(x[38]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),t.settings.taperedEdge?(e.openBlock(),e.createElementBlock("div",$d,[e.createElementVNode("span",Pd,[x[40]||(x[40]=e.createTextVNode("层级衰减 ",-1)),e.createElementVNode("span",Fd,e.toDisplayString(Math.round(t.settings.lineWidthTaper*100))+"%",1)]),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"0.05",min:"0.3",max:"1",value:t.settings.lineWidthTaper,onChange:x[13]||(x[13]=b=>a("lineWidthTaper",parseFloat(b.target.value)||.67))},null,40,Ud)])):e.createCommentVNode("",!0),t.settings.taperedEdge?(e.openBlock(),e.createElementBlock("div",Hd,[x[41]||(x[41]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"0.3",max:"1",step:"0.01",value:t.settings.lineWidthTaper,onInput:x[14]||(x[14]=b=>a("lineWidthTaper",parseFloat(b.target.value)))},null,40,Wd)])):e.createCommentVNode("",!0),e.createElementVNode("div",Gd,[x[43]||(x[43]=e.createElementVNode("span",{class:"zm-settings-label"},"显示节点序号",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.showOrderBadge}]),onClick:x[15]||(x[15]=b=>a("showOrderBadge",!t.settings.showOrderBadge))},[...x[42]||(x[42]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),e.createElementVNode("div",jd,[(e.openBlock(),e.createElementBlock("svg",Kd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(j.value,(b,L)=>(e.openBlock(),e.createElementBlock("line",{key:L,x1:b.x1,y1:b.y1,x2:b.x2,y2:b.y2,stroke:t.settings.rainbowBranch?b.color:"#94a3b8","stroke-width":b.w,"stroke-linecap":"butt"},null,8,Yd))),128))])),x[44]||(x[44]=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",qd,[e.createElementVNode("h4",Xd,[x[49]||(x[49]=e.createTextVNode(" 节点 ",-1)),t.selectedNodeText?(e.openBlock(),e.createElementBlock("span",Zd,'"'+e.toDisplayString(t.selectedNodeText)+'"',1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Jd,[x[50]||(x[50]=e.createElementVNode("span",{class:"zm-settings-label"},"背景颜色",-1)),e.createElementVNode("span",Qd,e.toDisplayString(((ae=t.nodeStyle)==null?void 0:ae.bg)||"默认"),1)]),e.createElementVNode("div",eu,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(R,b=>{var L;return e.createElementVNode("button",{key:"bg-"+b,class:e.normalizeClass(["zm-swatch",{"is-active":((L=t.nodeStyle)==null?void 0:L.bg)===b}]),style:e.normalizeStyle({background:b}),title:b,onClick:G=>p({bg:b})},null,14,tu)}),64)),e.createElementVNode("label",nu,[e.createElementVNode("input",{type:"color",value:((fe=t.nodeStyle)==null?void 0:fe.bg)||"#ffffff",onInput:x[16]||(x[16]=b=>p({bg:b.target.value}))},null,40,ou)]),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"清除",onClick:x[17]||(x[17]=b=>p({bg:void 0}))},"∅")]),e.createElementVNode("div",iu,[x[51]||(x[51]=e.createElementVNode("span",{class:"zm-settings-label"},"文字颜色",-1)),e.createElementVNode("span",ru,e.toDisplayString(((me=t.nodeStyle)==null?void 0:me.textColor)||"默认"),1)]),e.createElementVNode("div",lu,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(R,b=>{var L;return e.createElementVNode("button",{key:"fg-"+b,class:e.normalizeClass(["zm-swatch",{"is-active":((L=t.nodeStyle)==null?void 0:L.textColor)===b}]),style:e.normalizeStyle({background:b}),title:b,onClick:G=>p({textColor:b})},null,14,au)}),64)),e.createElementVNode("label",su,[e.createElementVNode("input",{type:"color",value:((J=t.nodeStyle)==null?void 0:J.textColor)||"#1e2937",onInput:x[18]||(x[18]=b=>p({textColor:b.target.value}))},null,40,cu)]),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"清除",onClick:x[19]||(x[19]=b=>p({textColor:void 0}))},"∅")]),x[55]||(x[55]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",du,[x[52]||(x[52]=e.createElementVNode("span",{class:"zm-settings-label"},"字重",-1)),e.createElementVNode("select",{class:"zm-select",value:((ge=t.nodeStyle)==null?void 0:ge.fontWeight)??400,onChange:x[20]||(x[20]=b=>p({fontWeight:parseInt(b.target.value)}))},[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(d,b=>e.createElementVNode("option",{key:b.value,value:b.value},e.toDisplayString(b.label),9,fu)),64))],40,uu)]),e.createElementVNode("div",mu,[x[53]||(x[53]=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:x[21]||(x[21]=b=>p({fontSize:parseInt(b.target.value)||14}))},null,40,pu)]),e.createElementVNode("div",hu,[x[54]||(x[54]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"8",max:"48",step:"1",value:((ye=t.nodeStyle)==null?void 0:ye.fontSize)??14,onInput:x[22]||(x[22]=b=>p({fontSize:parseInt(b.target.value)}))},null,40,gu)]),x[56]||(x[56]=e.createElementVNode("p",{class:"zm-settings-hint"},"仅作用于当前节点,不影响子节点。",-1))])):e.createCommentVNode("",!0),e.createElementVNode("section",bu,[e.createElementVNode("button",{class:"zm-settings-reset",onClick:x[23]||(x[23]=b=>i("reset"))},"恢复默认设置")])])}}}),[["__scopeId","data-v-f1937c03"]]),Nr=20;function ku(t,o){t.style.height="auto";const n=o.minRows*Nr,i=o.maxRows>0?o.maxRows*Nr:1/0,a=Math.max(n,Math.min(i,t.scrollHeight));t.style.height=a+"px",t.style.overflowY=t.scrollHeight>i?"auto":"hidden"}function gi(t,o={}){const n={minRows:o.minRows??3,maxRows:o.maxRows??12};function i(){const c=t.value;c&&ku(c,n)}function a(){i()}e.onMounted(async()=>{await e.nextTick();const c=t.value;c&&(c.addEventListener("input",a),i())}),e.watch(()=>{var c;return(c=t.value)==null?void 0:c.value},()=>i()),e.onBeforeUnmount(()=>{const c=t.value;c&&c.removeEventListener("input",a)})}function yu(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Sr(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],i=typeof n;(i==="object"||i==="function")&&!Object.isFrozen(n)&&Sr(n)}),t}class Tr{constructor(o){o.data===void 0&&(o.data={}),this.data=o.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function Cr(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function dn(t,...o){const n=Object.create(null);for(const i in t)n[i]=t[i];return o.forEach(function(i){for(const a in i)n[a]=i[a]}),n}const Eu="</span>",Mr=t=>!!t.scope,xu=(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((i,a)=>`${i}${"_".repeat(a+1)}`)].join(" ")}return`${o}${t}`};class wu{constructor(o,n){this.buffer="",this.classPrefix=n.classPrefix,o.walk(this)}addText(o){this.buffer+=Cr(o)}openNode(o){if(!Mr(o))return;const n=xu(o.scope,{prefix:this.classPrefix});this.span(n)}closeNode(o){Mr(o)&&(this.buffer+=Eu)}value(){return this.buffer}span(o){this.buffer+=`<span class="${o}">`}}const Ar=(t={})=>{const o={children:[]};return Object.assign(o,t),o};class bi{constructor(){this.rootNode=Ar(),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=Ar({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(i=>this._walk(o,i)),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=>{bi._collapse(n)}))}}class Nu extends bi{constructor(o){super(),this.options=o}addText(o){o!==""&&this.add(o)}startScope(o){this.openNode(o)}endScope(){this.closeNode()}__addSublanguage(o,n){const i=o.root;n&&(i.scope=`language:${n}`),this.add(i)}toHTML(){return new wu(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function ro(t){return t?typeof t=="string"?t:t.source:null}function _r(t){return xn("(?=",t,")")}function Su(t){return xn("(?:",t,")*")}function Tu(t){return xn("(?:",t,")?")}function xn(...t){return t.map(n=>ro(n)).join("")}function Cu(t){const o=t[t.length-1];return typeof o=="object"&&o.constructor===Object?(t.splice(t.length-1,1),o):{}}function ki(...t){return"("+(Cu(t).capture?"":"?:")+t.map(i=>ro(i)).join("|")+")"}function Rr(t){return new RegExp(t.toString()+"|").exec("").length-1}function Mu(t,o){const n=t&&t.exec(o);return n&&n.index===0}const Au=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function yi(t,{joinWith:o}){let n=0;return t.map(i=>{n+=1;const a=n;let c=ro(i),s="";for(;c.length>0;){const f=Au.exec(c);if(!f){s+=c;break}s+=c.substring(0,f.index),c=c.substring(f.index+f[0].length),f[0][0]==="\\"&&f[1]?s+="\\"+String(Number(f[1])+a):(s+=f[0],f[0]==="("&&n++)}return s}).map(i=>`(${i})`).join(o)}const _u=/\b\B/,Br="[a-zA-Z]\\w*",Ei="[a-zA-Z_]\\w*",vr="\\b\\d+(\\.\\d+)?",zr="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Ir="\\b(0b[01]+)",Ru="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",Bu=(t={})=>{const o=/^#![ ]*\//;return t.binary&&(t.begin=xn(o,/.*\b/,t.binary,/\b.*/)),dn({scope:"meta",begin:o,end:/$/,relevance:0,"on:begin":(n,i)=>{n.index!==0&&i.ignoreMatch()}},t)},lo={begin:"\\\\[\\s\\S]",relevance:0},vu={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[lo]},zu={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[lo]},Iu={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/},$o=function(t,o,n={}){const i=dn({scope:"comment",begin:t,end:o,contains:[]},n);i.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=ki("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 i.contains.push({begin:xn(/[ ]+/,"(",a,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),i},Ou=$o("//","$"),Lu=$o("/\\*","\\*/"),Du=$o("#","$"),Vu={scope:"number",begin:vr,relevance:0},$u={scope:"number",begin:zr,relevance:0},Pu={scope:"number",begin:Ir,relevance:0},Fu={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[lo,{begin:/\[/,end:/\]/,relevance:0,contains:[lo]}]},Uu={scope:"title",begin:Br,relevance:0},Hu={scope:"title",begin:Ei,relevance:0},Wu={begin:"\\.\\s*"+Ei,relevance:0};var Po=Object.freeze({__proto__:null,APOS_STRING_MODE:vu,BACKSLASH_ESCAPE:lo,BINARY_NUMBER_MODE:Pu,BINARY_NUMBER_RE:Ir,COMMENT:$o,C_BLOCK_COMMENT_MODE:Lu,C_LINE_COMMENT_MODE:Ou,C_NUMBER_MODE:$u,C_NUMBER_RE:zr,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:Du,IDENT_RE:Br,MATCH_NOTHING_RE:_u,METHOD_GUARD:Wu,NUMBER_MODE:Vu,NUMBER_RE:vr,PHRASAL_WORDS_MODE:Iu,QUOTE_STRING_MODE:zu,REGEXP_MODE:Fu,RE_STARTERS_RE:Ru,SHEBANG:Bu,TITLE_MODE:Uu,UNDERSCORE_IDENT_RE:Ei,UNDERSCORE_TITLE_MODE:Hu});function Gu(t,o){t.input[t.index-1]==="."&&o.ignoreMatch()}function ju(t,o){t.className!==void 0&&(t.scope=t.className,delete t.className)}function Ku(t,o){o&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=Gu,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function Yu(t,o){Array.isArray(t.illegal)&&(t.illegal=ki(...t.illegal))}function qu(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 Xu(t,o){t.relevance===void 0&&(t.relevance=1)}const Zu=(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(i=>{delete t[i]}),t.keywords=n.keywords,t.begin=xn(n.beforeMatch,_r(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},Ju=["of","and","for","in","not","or","if","then","parent","list","value"],Qu="keyword";function Or(t,o,n=Qu){const i=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(i,Or(t[c],o,c))}),i;function a(c,s){o&&(s=s.map(f=>f.toLowerCase())),s.forEach(function(f){const d=f.split("|");i[d[0]]=[c,ef(d[0],d[1])]})}}function ef(t,o){return o?Number(o):tf(t)?0:1}function tf(t){return Ju.includes(t.toLowerCase())}const Lr={},wn=t=>{console.error(t)},Dr=(t,...o)=>{console.log(`WARN: ${t}`,...o)},Ln=(t,o)=>{Lr[`${t}/${o}`]||(console.log(`Deprecated as of ${t}. ${o}`),Lr[`${t}/${o}`]=!0)},Fo=new Error;function Vr(t,o,{key:n}){let i=0;const a=t[n],c={},s={};for(let f=1;f<=o.length;f++)s[f+i]=a[f],c[f+i]=!0,i+=Rr(o[f-1]);t[n]=s,t[n]._emit=c,t[n]._multi=!0}function nf(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw wn("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Fo;if(typeof t.beginScope!="object"||t.beginScope===null)throw wn("beginScope must be object"),Fo;Vr(t,t.begin,{key:"beginScope"}),t.begin=yi(t.begin,{joinWith:""})}}function of(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw wn("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Fo;if(typeof t.endScope!="object"||t.endScope===null)throw wn("endScope must be object"),Fo;Vr(t,t.end,{key:"endScope"}),t.end=yi(t.end,{joinWith:""})}}function rf(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function lf(t){rf(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),nf(t),of(t)}function af(t){function o(s,f){return new RegExp(ro(s),"m"+(t.case_insensitive?"i":"")+(t.unicodeRegex?"u":"")+(f?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(f,d){d.position=this.position++,this.matchIndexes[this.matchAt]=d,this.regexes.push([d,f]),this.matchAt+=Rr(f)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const f=this.regexes.map(d=>d[1]);this.matcherRe=o(yi(f,{joinWith:"|"}),!0),this.lastIndex=0}exec(f){this.matcherRe.lastIndex=this.lastIndex;const d=this.matcherRe.exec(f);if(!d)return null;const p=d.findIndex((y,C)=>C>0&&y!==void 0),h=this.matchIndexes[p];return d.splice(0,p),Object.assign(d,h)}}class i{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(f){if(this.multiRegexes[f])return this.multiRegexes[f];const d=new n;return this.rules.slice(f).forEach(([p,h])=>d.addRule(p,h)),d.compile(),this.multiRegexes[f]=d,d}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(f,d){this.rules.push([f,d]),d.type==="begin"&&this.count++}exec(f){const d=this.getMatcher(this.regexIndex);d.lastIndex=this.lastIndex;let p=d.exec(f);if(this.resumingScanAtSamePosition()&&!(p&&p.index===this.lastIndex)){const h=this.getMatcher(0);h.lastIndex=this.lastIndex+1,p=h.exec(f)}return p&&(this.regexIndex+=p.position+1,this.regexIndex===this.count&&this.considerAll()),p}}function a(s){const f=new i;return s.contains.forEach(d=>f.addRule(d.begin,{rule:d,type:"begin"})),s.terminatorEnd&&f.addRule(s.terminatorEnd,{type:"end"}),s.illegal&&f.addRule(s.illegal,{type:"illegal"}),f}function c(s,f){const d=s;if(s.isCompiled)return d;[ju,qu,lf,Zu].forEach(h=>h(s,f)),t.compilerExtensions.forEach(h=>h(s,f)),s.__beforeBegin=null,[Ku,Yu,Xu].forEach(h=>h(s,f)),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=Or(s.keywords,t.case_insensitive)),d.keywordPatternRe=o(p,!0),f&&(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=ro(d.end)||"",s.endsWithParent&&f.terminatorEnd&&(d.terminatorEnd+=(s.end?"|":"")+f.terminatorEnd)),s.illegal&&(d.illegalRe=o(s.illegal)),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map(function(h){return sf(h==="self"?s:h)})),s.contains.forEach(function(h){c(h,d)}),s.starts&&c(s.starts,f),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=dn(t.classNameAliases||{}),c(t)}function $r(t){return t?t.endsWithParent||$r(t.starts):!1}function sf(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(o){return dn(t,{variants:null},o)})),t.cachedVariants?t.cachedVariants:$r(t)?dn(t,{starts:t.starts?dn(t.starts):null}):Object.isFrozen(t)?dn(t):t}var cf="11.11.1";class df extends Error{constructor(o,n){super(o),this.name="HTMLInjectionError",this.html=n}}const xi=Cr,Pr=dn,Fr=Symbol("nomatch"),uf=7,Ur=function(t){const o=Object.create(null),n=Object.create(null),i=[];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 f={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:Nu};function d(b){return f.noHighlightRe.test(b)}function p(b){let L=b.className+" ";L+=b.parentNode?b.parentNode.className:"";const G=f.languageDetectRe.exec(L);if(G){const ee=x(G[1]);return ee||(Dr(c.replace("{}",G[1])),Dr("Falling back to no-highlight mode for this block.",b)),ee?G[1]:"no-highlight"}return L.split(/\s+/).find(ee=>d(ee)||x(ee))}function h(b,L,G){let ee="",be="";typeof L=="object"?(ee=b,G=L.ignoreIllegals,be=L.language):(Ln("10.7.0","highlight(lang, code, ...args) has been deprecated."),Ln("10.7.0",`Please use highlight(code, options) instead.
59
- https://github.com/highlightjs/highlight.js/issues/2277`),be=b,ee=L),G===void 0&&(G=!0);const O={code:ee,language:be};de("before:highlight",O);const B=O.result?O.result:y(O.language,O.code,G);return B.code=O.code,de("after:highlight",B),B}function y(b,L,G,ee){const be=Object.create(null);function O(X,se){return X.keywords[se]}function B(){if(!ce.keywords){Ve.addText(Be);return}let X=0;ce.keywordPatternRe.lastIndex=0;let se=ce.keywordPatternRe.exec(Be),Ee="";for(;se;){Ee+=Be.substring(X,se.index);const Ae=Qe.case_insensitive?se[0].toLowerCase():se[0],He=O(ce,Ae);if(He){const[rt,yt]=He;if(Ve.addText(Ee),Ee="",be[Ae]=(be[Ae]||0)+1,be[Ae]<=uf&&(Lt+=yt),rt.startsWith("_"))Ee+=se[0];else{const _n=Qe.classNameAliases[rt]||rt;V(se[0],_n)}}else Ee+=se[0];X=ce.keywordPatternRe.lastIndex,se=ce.keywordPatternRe.exec(Be)}Ee+=Be.substring(X),Ve.addText(Ee)}function oe(){if(Be==="")return;let X=null;if(typeof ce.subLanguage=="string"){if(!o[ce.subLanguage]){Ve.addText(Be);return}X=y(ce.subLanguage,Be,!0,Ct[ce.subLanguage]),Ct[ce.subLanguage]=X._top}else X=D(Be,ce.subLanguage.length?ce.subLanguage:null);ce.relevance>0&&(Lt+=X.relevance),Ve.__addSublanguage(X._emitter,X.language)}function te(){ce.subLanguage!=null?oe():B(),Be=""}function V(X,se){X!==""&&(Ve.startScope(se),Ve.addText(X),Ve.endScope())}function w(X,se){let Ee=1;const Ae=se.length-1;for(;Ee<=Ae;){if(!X._emit[Ee]){Ee++;continue}const He=Qe.classNameAliases[X[Ee]]||X[Ee],rt=se[Ee];He?V(rt,He):(Be=rt,B(),Be=""),Ee++}}function P(X,se){return X.scope&&typeof X.scope=="string"&&Ve.openNode(Qe.classNameAliases[X.scope]||X.scope),X.beginScope&&(X.beginScope._wrap?(V(Be,Qe.classNameAliases[X.beginScope._wrap]||X.beginScope._wrap),Be=""):X.beginScope._multi&&(w(X.beginScope,se),Be="")),ce=Object.create(X,{parent:{value:ce}}),ce}function H(X,se,Ee){let Ae=Mu(X.endRe,Ee);if(Ae){if(X["on:end"]){const He=new Tr(X);X["on:end"](se,He),He.isMatchIgnored&&(Ae=!1)}if(Ae){for(;X.endsParent&&X.parent;)X=X.parent;return X}}if(X.endsWithParent)return H(X.parent,se,Ee)}function ie(X){return ce.matcher.regexIndex===0?(Be+=X[0],1):(Qt=!0,0)}function xe(X){const se=X[0],Ee=X.rule,Ae=new Tr(Ee),He=[Ee.__beforeBegin,Ee["on:begin"]];for(const rt of He)if(rt&&(rt(X,Ae),Ae.isMatchIgnored))return ie(se);return Ee.skip?Be+=se:(Ee.excludeBegin&&(Be+=se),te(),!Ee.returnBegin&&!Ee.excludeBegin&&(Be=se)),P(Ee,X),Ee.returnBegin?0:se.length}function Je(X){const se=X[0],Ee=L.substring(X.index),Ae=H(ce,X,Ee);if(!Ae)return Fr;const He=ce;ce.endScope&&ce.endScope._wrap?(te(),V(se,ce.endScope._wrap)):ce.endScope&&ce.endScope._multi?(te(),w(ce.endScope,X)):He.skip?Be+=se:(He.returnEnd||He.excludeEnd||(Be+=se),te(),He.excludeEnd&&(Be=se));do ce.scope&&Ve.closeNode(),!ce.skip&&!ce.subLanguage&&(Lt+=ce.relevance),ce=ce.parent;while(ce!==Ae.parent);return Ae.starts&&P(Ae.starts,X),He.returnEnd?0:se.length}function Tt(){const X=[];for(let se=ce;se!==Qe;se=se.parent)se.scope&&X.unshift(se.scope);X.forEach(se=>Ve.openNode(se))}let it={};function nn(X,se){const Ee=se&&se[0];if(Be+=X,Ee==null)return te(),0;if(it.type==="begin"&&se.type==="end"&&it.index===se.index&&Ee===""){if(Be+=L.slice(se.index,se.index+1),!a){const Ae=new Error(`0 width match regex (${b})`);throw Ae.languageName=b,Ae.badRule=it.rule,Ae}return 1}if(it=se,se.type==="begin")return xe(se);if(se.type==="illegal"&&!G){const Ae=new Error('Illegal lexeme "'+Ee+'" for mode "'+(ce.scope||"<unnamed>")+'"');throw Ae.mode=ce,Ae}else if(se.type==="end"){const Ae=Je(se);if(Ae!==Fr)return Ae}if(se.type==="illegal"&&Ee==="")return Be+=`
60
- `,1;if(gt>1e5&&gt>se.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Be+=Ee,Ee.length}const Qe=x(b);if(!Qe)throw wn(c.replace("{}",b)),new Error('Unknown language: "'+b+'"');const Zt=af(Qe);let Jt="",ce=ee||Zt;const Ct={},Ve=new f.__emitter(f);Tt();let Be="",Lt=0,tt=0,gt=0,Qt=!1;try{if(Qe.__emitTokens)Qe.__emitTokens(L,Ve);else{for(ce.matcher.considerAll();;){gt++,Qt?Qt=!1:ce.matcher.considerAll(),ce.matcher.lastIndex=tt;const X=ce.matcher.exec(L);if(!X)break;const se=L.substring(tt,X.index),Ee=nn(se,X);tt=X.index+Ee}nn(L.substring(tt))}return Ve.finalize(),Jt=Ve.toHTML(),{language:b,value:Jt,relevance:Lt,illegal:!1,_emitter:Ve,_top:ce}}catch(X){if(X.message&&X.message.includes("Illegal"))return{language:b,value:xi(L),illegal:!0,relevance:0,_illegalBy:{message:X.message,index:tt,context:L.slice(tt-100,tt+100),mode:X.mode,resultSoFar:Jt},_emitter:Ve};if(a)return{language:b,value:xi(L),illegal:!1,relevance:0,errorRaised:X,_emitter:Ve,_top:ce};throw X}}function C(b){const L={value:xi(b),illegal:!1,relevance:0,_top:s,_emitter:new f.__emitter(f)};return L._emitter.addText(b),L}function D(b,L){L=L||f.languages||Object.keys(o);const G=C(b),ee=L.filter(x).filter(fe).map(te=>y(te,b,!1));ee.unshift(G);const be=ee.sort((te,V)=>{if(te.relevance!==V.relevance)return V.relevance-te.relevance;if(te.language&&V.language){if(x(te.language).supersetOf===V.language)return 1;if(x(V.language).supersetOf===te.language)return-1}return 0}),[O,B]=be,oe=O;return oe.secondBest=B,oe}function _(b,L,G){const ee=L&&n[L]||G;b.classList.add("hljs"),b.classList.add(`language-${ee}`)}function F(b){let L=null;const G=p(b);if(d(G))return;if(de("before:highlightElement",{el:b,language:G}),b.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",b);return}if(b.children.length>0&&(f.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(b)),f.throwUnescapedHTML))throw new df("One of your code blocks includes unescaped HTML.",b.innerHTML);L=b;const ee=L.textContent,be=G?h(ee,{language:G,ignoreIllegals:!0}):D(ee);b.innerHTML=be.value,b.dataset.highlighted="yes",_(b,G,be.language),b.result={language:be.language,re:be.relevance,relevance:be.relevance},be.secondBest&&(b.secondBest={language:be.secondBest.language,relevance:be.secondBest.relevance}),de("after:highlightElement",{el:b,result:be,text:ee})}function R(b){f=Pr(f,b)}const M=()=>{N(),Ln("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function k(){N(),Ln("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let u=!1;function N(){function b(){N()}if(document.readyState==="loading"){u||window.addEventListener("DOMContentLoaded",b,!1),u=!0;return}document.querySelectorAll(f.cssSelector).forEach(F)}function $(b,L){let G=null;try{G=L(t)}catch(ee){if(wn("Language definition for '{}' could not be registered.".replace("{}",b)),a)wn(ee);else throw ee;G=s}G.name||(G.name=b),o[b]=G,G.rawDefinition=L.bind(null,t),G.aliases&&ae(G.aliases,{languageName:b})}function j(b){delete o[b];for(const L of Object.keys(n))n[L]===b&&delete n[L]}function q(){return Object.keys(o)}function x(b){return b=(b||"").toLowerCase(),o[b]||o[n[b]]}function ae(b,{languageName:L}){typeof b=="string"&&(b=[b]),b.forEach(G=>{n[G.toLowerCase()]=L})}function fe(b){const L=x(b);return L&&!L.disableAutodetect}function me(b){b["before:highlightBlock"]&&!b["before:highlightElement"]&&(b["before:highlightElement"]=L=>{b["before:highlightBlock"](Object.assign({block:L.el},L))}),b["after:highlightBlock"]&&!b["after:highlightElement"]&&(b["after:highlightElement"]=L=>{b["after:highlightBlock"](Object.assign({block:L.el},L))})}function J(b){me(b),i.push(b)}function ge(b){const L=i.indexOf(b);L!==-1&&i.splice(L,1)}function de(b,L){const G=b;i.forEach(function(ee){ee[G]&&ee[G](L)})}function ye(b){return Ln("10.7.0","highlightBlock will be removed entirely in v12.0"),Ln("10.7.0","Please use highlightElement now."),F(b)}Object.assign(t,{highlight:h,highlightAuto:D,highlightAll:N,highlightElement:F,highlightBlock:ye,configure:R,initHighlighting:M,initHighlightingOnLoad:k,registerLanguage:$,unregisterLanguage:j,listLanguages:q,getLanguage:x,registerAliases:ae,autoDetection:fe,inherit:Pr,addPlugin:J,removePlugin:ge}),t.debugMode=function(){a=!1},t.safeMode=function(){a=!0},t.versionString=cf,t.regex={concat:xn,lookahead:_r,either:ki,optional:Tu,anyNumberOfTimes:Su};for(const b in Po)typeof Po[b]=="object"&&Sr(Po[b]);return Object.assign(t,Po),t},Dn=Ur({});Dn.newInstance=()=>Ur({});var ff=Dn;Dn.HighlightJS=Dn,Dn.default=Dn;const wi=yu(ff);function Ni(t){const o=t.regex,n={},i={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:o.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},i]});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"})]}},f={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,n,a]};a.contains.push(f);const d={match:/\\"/},p={className:"string",begin:/'/,end:/'/},h={match:/\\'/},y={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,n]},C=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],D=t.SHEBANG({binary:`(${C.join("|")})`,relevance:10}),_={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},F=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],R=["true","false"],M={match:/(\/[a-z._-]+)+/},k=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],u=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],N=["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"],$=["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:F,literal:R,built_in:[...k,...u,"set","shopt",...N,...$]},contains:[D,t.SHEBANG(),_,y,c,s,M,f,d,p,h,n]}}const mf=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_-]*/}}),pf=["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"],hf=["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"],gf=[...pf,...hf],bf=["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(),kf=["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(),yf=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Ef=["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 xf(t){const o=t.regex,n=mf(t),i={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},a="and or not only",c=/@-?\w[\w]*(-\w+)*/,s="[a-zA-Z-][a-zA-Z0-9_-]*",f=[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,i,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:":("+kf.join("|")+")"},{begin:":(:)?("+yf.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Ef.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...f,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...f,{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:bf.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...f,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+gf.join("|")+")\\b"}]}}function Hr(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 Vn="[0-9](_*[0-9])*",Uo=`\\.(${Vn})`,Ho="[0-9a-fA-F](_*[0-9a-fA-F])*",Wr={className:"number",variants:[{begin:`(\\b(${Vn})((${Uo})|\\.)?|(${Uo}))[eE][+-]?(${Vn})[fFdD]?\\b`},{begin:`\\b(${Vn})((${Uo})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Uo})[fFdD]?\\b`},{begin:`\\b(${Vn})[fFdD]\\b`},{begin:`\\b0[xX]((${Ho})\\.?|(${Ho})?\\.(${Ho}))[pP][+-]?(${Vn})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Ho})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Gr(t,o,n){return n===-1?"":t.replace(o,i=>Gr(t,o,n-1))}function wf(t){const o=t.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",i=n+Gr("(?:<"+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"]}]},h={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:[h,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+i+"\\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,Wr,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},Wr,p]}}const jr="[A-Za-z$_][0-9A-Za-z$_]*",Nf=["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"],Sf=["true","false","null","undefined","NaN","Infinity"],Kr=["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"],Yr=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],qr=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Tf=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Cf=[].concat(qr,Kr,Yr);function Xr(t){const o=t.regex,n=(G,{after:ee})=>{const be="</"+G[0].slice(1);return G.input.indexOf(be,ee)!==-1},i=jr,a={begin:"<>",end:"</>"},c=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(G,ee)=>{const be=G[0].length+G.index,O=G.input[be];if(O==="<"||O===","){ee.ignoreMatch();return}O===">"&&(n(G,{after:be})||ee.ignoreMatch());let B;const oe=G.input.substring(be);if(B=oe.match(/^\s*=/)){ee.ignoreMatch();return}if((B=oe.match(/^\s+extends\s+/))&&B.index===0){ee.ignoreMatch();return}}},f={$pattern:jr,keyword:Nf,literal:Sf,built_in:Cf,"variable.language":Tf},d="[0-9](_?[0-9])*",p=`\\.(${d})`,h="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",y={className:"number",variants:[{begin:`(\\b(${h})((${p})|\\.)?|(${p}))[eE][+-]?(${d})\\b`},{begin:`\\b(${h})\\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},C={className:"subst",begin:"\\$\\{",end:"\\}",keywords:f,contains:[]},D={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"xml"}},_={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"css"}},F={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"graphql"}},R={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,C]},k={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:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},u=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,D,_,F,R,{match:/\$\d+/},y];C.contains=u.concat({begin:/\{/,end:/\}/,keywords:f,contains:["self"].concat(u)});const N=[].concat(k,C.contains),$=N.concat([{begin:/(\s*)\(/,end:/\)/,keywords:f,contains:["self"].concat(N)}]),j={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:$},q={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,o.concat(i,"(",o.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],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:{_:[...Kr,...Yr]}},ae={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},fe={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[j],illegal:/%/},me={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function J(G){return o.concat("(?!",G.join("|"),")")}const ge={match:o.concat(/\b/,J([...qr,"super","import"].map(G=>`${G}\\s*\\(`)),i,o.lookahead(/\s*\(/)),className:"title.function",relevance:0},de={begin:o.concat(/\./,o.lookahead(o.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ye={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},j]},b="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",L={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,o.lookahead(b)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[j]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:f,exports:{PARAMS_CONTAINS:$,CLASS_REFERENCE:x},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),ae,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,D,_,F,R,k,{match:/\$\d+/},y,x,{scope:"attr",match:i+o.lookahead(":"),relevance:0},L,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[k,t.REGEXP_MODE,{className:"function",begin:b,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:f,contains:$}]}]},{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"]}]}]},fe,{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:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},de,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[j]},ge,me,q,ye,{match:/\$[(.]/}]}}function Mf(t){const o={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},i=["true","false","null"],a={scope:"literal",beginKeywords:i.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:i},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 Zr(t){const o=t.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},i={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}]},f=/[A-Za-z][A-Za-z0-9+.-]*/,d={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:o.concat(/\[.+?\]\(/,f,/:\/\/.*?\)/),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}/}]},h={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},y=t.inherit(p,{contains:[]}),C=t.inherit(h,{contains:[]});p.contains.push(C),h.contains.push(y);let D=[n,d];return[p,h,y,C].forEach(M=>{M.contains=M.contains.concat(D)}),D=D.concat(p,h),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:D},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:D}]}]},n,c,p,h,{className:"quote",begin:"^>\\s+",contains:D,end:"$"},a,i,d,s,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function Jr(t){const o=t.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),i=["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"],f={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:i,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:f,illegal:/#/},h={begin:/\{\{/,relevance:0},y={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,h,p]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,d,h,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,h,p]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,h,p]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},C="[0-9](_?[0-9])*",D=`(\\b(${C}))?\\.(${C})|\\b(${C})\\.`,_=`\\b|${i.join("|")}`,F={className:"number",relevance:0,variants:[{begin:`(\\b(${C})|(${D}))[eE][+-]?(${C})[jJ]?(?=${_})`},{begin:`(${D})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${_})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${_})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${_})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${_})`},{begin:`\\b(${C})[jJ](?=${_})`}]},R={className:"comment",begin:o.lookahead(/# type:/),end:/$/,keywords:f,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},M={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:["self",d,F,y,t.HASH_COMMENT_MODE]}]};return p.contains=[y,F,d],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:f,illegal:/(<\/|\?)|=>/,contains:[d,F,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},y,R,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[M]},{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:[F,M,y]}]}}function Qr(t){const o=t.regex,n=/(r#)?/,i=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))?",f=["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!"],h=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:t.IDENT_RE+"!?",type:h,keyword:f,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+/,i],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,i],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,i,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,i],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,i],className:{1:"keyword",3:"title.class"}},{begin:t.IDENT_RE+"::",keywords:{keyword:"Self",built_in:p,type:h}},{className:"punctuation",begin:"->"},c]}}function Af(t){const o=t.regex,n=t.COMMENT("--","$"),i={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"],f=["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"],h=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],y=["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"],D=h,_=[...p,...d].filter($=>!h.includes($)),F={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},R={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},M={match:o.concat(/\b/,o.either(...D),/\s*\(/),relevance:0,keywords:{built_in:D}};function k($){return o.concat(/\b/,o.either(...$.map(j=>j.replace(/\s+/,"\\s+"))),/\b/)}const u={scope:"keyword",match:k(C),relevance:0};function N($,{exceptions:j,when:q}={}){const x=q;return j=j||[],$.map(ae=>ae.match(/\|\d+$/)||j.includes(ae)?ae:x(ae)?`${ae}|0`:ae)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:N(_,{when:$=>$.length<3}),literal:c,type:f,built_in:y},contains:[{scope:"type",match:k(s)},u,M,F,i,a,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,n,R]}}const Wo="[A-Za-z$_][0-9A-Za-z$_]*",el=["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"],tl=["true","false","null","undefined","NaN","Infinity"],nl=["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"],ol=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],il=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],rl=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],ll=[].concat(il,nl,ol);function _f(t){const o=t.regex,n=(G,{after:ee})=>{const be="</"+G[0].slice(1);return G.input.indexOf(be,ee)!==-1},i=Wo,a={begin:"<>",end:"</>"},c=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(G,ee)=>{const be=G[0].length+G.index,O=G.input[be];if(O==="<"||O===","){ee.ignoreMatch();return}O===">"&&(n(G,{after:be})||ee.ignoreMatch());let B;const oe=G.input.substring(be);if(B=oe.match(/^\s*=/)){ee.ignoreMatch();return}if((B=oe.match(/^\s+extends\s+/))&&B.index===0){ee.ignoreMatch();return}}},f={$pattern:Wo,keyword:el,literal:tl,built_in:ll,"variable.language":rl},d="[0-9](_?[0-9])*",p=`\\.(${d})`,h="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",y={className:"number",variants:[{begin:`(\\b(${h})((${p})|\\.)?|(${p}))[eE][+-]?(${d})\\b`},{begin:`\\b(${h})\\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},C={className:"subst",begin:"\\$\\{",end:"\\}",keywords:f,contains:[]},D={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"xml"}},_={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"css"}},F={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"graphql"}},R={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,C]},k={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:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},u=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,D,_,F,R,{match:/\$\d+/},y];C.contains=u.concat({begin:/\{/,end:/\}/,keywords:f,contains:["self"].concat(u)});const N=[].concat(k,C.contains),$=N.concat([{begin:/(\s*)\(/,end:/\)/,keywords:f,contains:["self"].concat(N)}]),j={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:$},q={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,o.concat(i,"(",o.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],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:{_:[...nl,...ol]}},ae={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},fe={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[j],illegal:/%/},me={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function J(G){return o.concat("(?!",G.join("|"),")")}const ge={match:o.concat(/\b/,J([...il,"super","import"].map(G=>`${G}\\s*\\(`)),i,o.lookahead(/\s*\(/)),className:"title.function",relevance:0},de={begin:o.concat(/\./,o.lookahead(o.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ye={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},j]},b="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",L={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,o.lookahead(b)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[j]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:f,exports:{PARAMS_CONTAINS:$,CLASS_REFERENCE:x},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),ae,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,D,_,F,R,k,{match:/\$\d+/},y,x,{scope:"attr",match:i+o.lookahead(":"),relevance:0},L,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[k,t.REGEXP_MODE,{className:"function",begin:b,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:f,contains:$}]}]},{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"]}]}]},fe,{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:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},de,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[j]},ge,me,q,ye,{match:/\$[(.]/}]}}function al(t){const o=t.regex,n=_f(t),i=Wo,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]},f={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},d=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],p={$pattern:Wo,keyword:el.concat(d),literal:tl,built_in:ll.concat(a),"variable.language":rl},h={className:"meta",begin:"@"+i},y=(F,R,M)=>{const k=F.contains.findIndex(u=>u.label===R);if(k===-1)throw new Error("can not find mode to replace");F.contains.splice(k,1,M)};Object.assign(n.keywords,p),n.exports.PARAMS_CONTAINS.push(h);const C=n.contains.find(F=>F.scope==="attr"),D=Object.assign({},C,{match:o.concat(i,o.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,C,D]),n.contains=n.contains.concat([h,c,s,D]),y(n,"shebang",t.SHEBANG()),y(n,"use_strict",f);const _=n.contains.find(F=>F.label==="func.def");return _.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function sl(t){const o=t.regex,n=o.concat(/[\p{L}_]/u,o.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),i=/[\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:/\)/}),f=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:i,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,f,s,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[c,s,d,f]}]}]},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 cl(t){const o="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",i={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]},f=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"},D={end:",",endsWithParent:!0,excludeEnd:!0,keywords:o,relevance:0},_={begin:/\{/,end:/\}/,contains:[D],illegal:"\\n",relevance:0},F={begin:"\\[",end:"\\]",contains:[D],illegal:"\\n",relevance:0},R=[i,{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},_,F,c,s],M=[...R];return M.pop(),M.push(f),D.contains=M,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:R}}const Si={bash:Ni,sh:Ni,shell:Ni,css:xf,go:Hr,golang:Hr,java:wf,javascript:Xr,js:Xr,json:Mf,markdown:Zr,md:Zr,python:Jr,py:Jr,rust:Qr,rs:Qr,sql:Af,typescript:al,ts:al,xml:sl,html:sl,yaml:cl,yml:cl};for(const[t,o]of Object.entries(Si))wi.registerLanguage(t,o);function Go(t){const o=t.split(`
55
+ `,Do=e.defineComponent({__name:"MarkdownPanel",props:{data:{}},emits:["import"],setup(t,{emit:o}){const n=t,i=o,a=e.ref(Ln(n.data)),c=e.ref(null),s=e.ref(null),u=e.computed(()=>{try{const O=On(a.value||"");return c.value=null,O}catch(O){return c.value=O.message,{id:"preview_fallback",text:a.value||"(空)",children:[]}}}),d=e.computed(()=>It(u.value));let p=null;e.watch(a,()=>{p&&clearTimeout(p),p=setTimeout(()=>{var O;return(O=s.value)==null?void 0:O.resetView()},250)});function h(){try{const O=On(a.value||"");c.value=null,i("import",O)}catch(O){c.value=O.message}}function x(){a.value=Ln(n.data),c.value=null,e.nextTick(()=>{var O;return(O=s.value)==null?void 0:O.resetView()})}function C(){a.value="",c.value=null,e.nextTick(()=>{var O;return(O=s.value)==null?void 0:O.resetView()})}function $(){const O=document.createElement("input");O.type="file",O.accept=".md,text/markdown,text/plain",O.onchange=()=>{var k;const A=(k=O.files)==null?void 0:k[0];if(!A)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(A)},O.click()}function R(){const O=new Blob([a.value],{type:"text/markdown;charset=utf-8"}),A=URL.createObjectURL(O),y=document.createElement("a");y.href=A;const k=(n.data.text||"mindmap").trim()||"mindmap";y.download=`${k}.md`,y.click(),URL.revokeObjectURL(A)}function F(){a.value=Ic,c.value=null,e.nextTick(()=>{var O;return(O=s.value)==null?void 0:O.resetView()})}return(O,A)=>(e.openBlock(),e.createElementBlock("div",Tc,[e.createElementVNode("div",{class:"zm-md-toolbar"},[e.createElementVNode("button",{class:"zm-md-btn",title:"从 .md 文件加载",onClick:$},[...A[1]||(A[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},[...A[2]||(A[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)])]),A[3]||(A[3]=e.createElementVNode("span",{class:"zm-md-spacer"},null,-1)),e.createElementVNode("button",{class:"zm-md-btn",title:"用示例内容填充",onClick:F},"示例"),e.createElementVNode("button",{class:"zm-md-btn",title:"覆盖为当前导图",onClick:x},"同步"),e.createElementVNode("button",{class:"zm-md-btn",title:"清空",onClick:C},"清空")]),c.value?(e.openBlock(),e.createElementBlock("div",Cc,e.toDisplayString(c.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Mc,[e.createElementVNode("div",Ac,[A[4]||(A[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":A[0]||(A[0]=y=>a.value=y),class:"zm-md-textarea",spellcheck:"false",placeholder:"# 标题…"},null,512),[[e.vModelText,a.value]])]),e.createElementVNode("div",_c,[A[5]||(A[5]=e.createElementVNode("div",{class:"zm-md-pane-header"},[e.createElementVNode("span",null,"导图预览"),e.createElementVNode("span",{class:"zm-md-hint"},"只读")],-1)),e.createElementVNode("div",Rc,[e.createVNode(Qo,{ref_key:"previewRef",ref:s,data:d.value,readonly:"","preview-mode":""},null,8,["data"])])])]),e.createElementVNode("div",Bc,[e.createElementVNode("button",{class:"zm-md-btn is-primary",disabled:!a.value.trim(),onClick:h},"应用到导图",8,vc)])]))}}),zc={class:"zm-settings-panel"},Oc={class:"zm-settings-section"},Lc={class:"zm-settings-field"},Dc={class:"zm-settings-control"},Vc={class:"zm-color-input-wrap"},$c=["value"],Pc={class:"zm-color-input-text"},Fc={class:"zm-swatch-row zm-swatch-row--compact"},Uc=["title","onClick"],Hc={class:"zm-settings-field"},Wc=["value"],Gc={class:"zm-slider"},jc=["value"],Kc={class:"zm-settings-field"},Yc=["value"],qc={class:"zm-slider"},Xc=["value"],Zc={class:"zm-settings-field zm-line-style-field"},Jc={class:"zm-line-style-group"},Qc=["title","onClick"],ed=["viewBox"],td={key:0,d:"M 0 12 Q 14 2, 28 12",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},nd={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"},id={key:3,d:"M 0 12 C 8 0, 20 0, 28 12",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},rd={key:4,x1:"0",y1:"12",x2:"28",y2:"12",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},ld={class:"zm-line-style-label"},ad={class:"zm-settings-field zm-line-style-field"},sd={class:"zm-line-style-group"},cd=["title","onClick"],dd=["viewBox"],ud={key:0,d:"M 0 12 Q 14 2, 28 12",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},fd={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"},md={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"},pd={key:3,d:"M 0 12 C 8 0, 20 0, 28 12",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},hd={key:4,x1:"0",y1:"12",x2:"28",y2:"12",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},gd={class:"zm-line-style-label"},bd={key:0,class:"zm-settings-field"},kd={class:"zm-settings-label"},yd={class:"zm-settings-sub"},Ed=["value"],xd={key:1,class:"zm-slider"},wd=["value"],Nd={class:"zm-settings-field zm-line-style-field"},Sd={class:"zm-line-style-group"},Td=["title","onClick"],Cd={viewBox:"0 0 28 18",width:"28",height:"18",preserveAspectRatio:"none"},Md={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"},Ad={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"},_d={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"},Rd={class:"zm-line-style-label"},Bd={class:"zm-settings-field"},vd={key:2,class:"zm-palette-picker"},Id={class:"zm-palette-list"},zd=["onClick"],Od={class:"zm-palette-option-name"},Ld={class:"zm-palette-option-swatches"},Dd={key:0,class:"zm-palette-custom-editor"},Vd=["value"],$d={class:"zm-palette-custom-actions"},Pd={class:"zm-settings-field"},Fd={key:3,class:"zm-settings-field"},Ud={class:"zm-settings-label"},Hd={class:"zm-settings-sub"},Wd=["value"],Gd={key:4,class:"zm-slider"},jd=["value"],Kd={class:"zm-settings-field"},Yd={class:"zm-settings-preview"},qd={viewBox:"0 0 200 70",width:"100%",height:"70",preserveAspectRatio:"none"},Xd=["x1","y1","x2","y2","stroke","stroke-width"],Zd={key:0,class:"zm-settings-section"},Jd={class:"zm-settings-section-title"},Qd={key:0,class:"zm-settings-section-sub"},eu={class:"zm-settings-field"},tu={class:"zm-settings-value-tag"},nu={class:"zm-swatch-row"},ou=["title","onClick"],iu={class:"zm-swatch zm-swatch--custom",title:"自定义颜色"},ru=["value"],lu={class:"zm-settings-field"},au={class:"zm-settings-value-tag"},su={class:"zm-swatch-row"},cu=["title","onClick"],du={class:"zm-swatch zm-swatch--custom",title:"自定义颜色"},uu=["value"],fu={class:"zm-settings-field"},mu=["value"],pu=["value"],hu={class:"zm-settings-field"},gu=["value"],bu={class:"zm-slider"},ku=["value"],yu={class:"zm-settings-section zm-settings-section--actions"},Vo=((t,o)=>{const n=t.__vccOpts||t;for(const[i,a]of o)n[i]=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,i=o;function a(q,w){i("update:settings",{[q]:w})}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(q){i("update:nodeStyle",q)}const h=e.computed(()=>[...dn,...n.settings.customPalettes]),x=e.reactive({});function C(q){return x[q.id]===void 0&&(x[q.id]=q.colors.join(`
56
+ `)),x[q.id]}function $(q){const w=x[q.id]??"",ie=Ga(w);if(ie.length===0){x[q.id]=q.colors.join(`
57
+ `);return}const fe=n.settings.customPalettes.map(ce=>ce.id===q.id?{...ce,colors:ie}:ce);i("update:settings",{customPalettes:fe})}function R(){const q=h.value.find(J=>J.id===n.settings.branchPaletteId),w=q?[...q.colors]:[...dn[0].colors],ie="custom-";let fe=ie+(n.settings.customPalettes.length+1);for(;dn.some(J=>J.id===fe)||n.settings.customPalettes.some(J=>J.id===fe);)fe=ie+Math.random().toString(36).slice(2,7);const ce={id:fe,name:`我的配色 ${n.settings.customPalettes.length+1}`,colors:w};i("update:settings",{customPalettes:[...n.settings.customPalettes,ce],branchPaletteId:fe}),x[fe]=w.join(`
58
+ `)}function F(q){const w=n.settings.customPalettes.filter(fe=>fe.id!==q.id),ie=n.settings.branchPaletteId===q.id?"default":n.settings.branchPaletteId;i("update:settings",{customPalettes:w,...ie!==n.settings.branchPaletteId?{branchPaletteId:ie}:{}}),delete x[q.id]}const O=["#f87171","#fb923c","#fbbf24","#a3e635","#34d399","#22d3ee","#818cf8","#c084fc","#1e2937","#f8fafc","#94a3b8"],A=["#f8fafc","#ffffff","#e2e8f0","#1e2937","#0f172a","#fef3c7","#dbeafe","#dcfce7","#fce7f3","#f1f5f9"],y=[0,1,2,3],k=["#f87171","#fb923c","#34d399","#818cf8"];function m(q,w,ie,fe){if(w<=1)return ie;const ce=q/(w-1);return ie+(fe-ie)*ce}function P(q,w,ie,fe){const ce=w*Math.pow(fe,q);return Math.max(ie,ce)}const G=e.computed(()=>{const q=n.settings.lineWidthStart,w=n.settings.lineWidthEnd,ie=n.settings.taperedEdge,fe=y.length,ce=8,J=192,me=h.value.find(ke=>ke.id===n.settings.branchPaletteId),ae=me&&me.colors.length?me.colors:k;return y.map((ke,b)=>{const V=10+b*60/(fe-1);return{x1:ce,y1:V,x2:J,y2:V,w:ie?P(ke,q,w,n.settings.lineWidthTaper):m(ke,fe,q,w),color:n.settings.rainbowBranch?ae[b%ae.length]:"#94a3b8"}})});return(q,w)=>{var ie,fe,ce,J,me,ae,ke;return e.openBlock(),e.createElementBlock("div",zc,[e.createElementVNode("section",Oc,[w[45]||(w[45]=e.createElementVNode("h4",{class:"zm-settings-section-title"},"画布",-1)),e.createElementVNode("div",Lc,[w[24]||(w[24]=e.createElementVNode("span",{class:"zm-settings-label"},"画布背景色",-1)),e.createElementVNode("div",Dc,[e.createElementVNode("label",Vc,[e.createElementVNode("input",{type:"color",class:"zm-color-input",value:t.settings.canvasBg||"#f8fafc",onInput:w[0]||(w[0]=b=>a("canvasBg",b.target.value))},null,40,$c),e.createElementVNode("span",Pc,e.toDisplayString(t.settings.canvasBg||"默认"),1)])])]),e.createElementVNode("div",Fc,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(A,b=>e.createElementVNode("button",{key:"cbg-"+b,class:e.normalizeClass(["zm-swatch",{"is-active":(t.settings.canvasBg||"#f8fafc")===b}]),style:e.normalizeStyle({background:b}),title:b,onClick:V=>a("canvasBg",b)},null,14,Uc)),64)),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"恢复默认",onClick:w[1]||(w[1]=b=>a("canvasBg",void 0))},"∅")]),w[46]||(w[46]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",Hc,[w[25]||(w[25]=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:w[2]||(w[2]=b=>a("lineWidthStart",parseFloat(b.target.value)||0))},null,40,Wc)]),e.createElementVNode("div",Gc,[w[26]||(w[26]=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:w[3]||(w[3]=b=>a("lineWidthStart",parseFloat(b.target.value)))},null,40,jc)]),e.createElementVNode("div",Kc,[w[27]||(w[27]=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:w[4]||(w[4]=b=>a("lineWidthEnd",parseFloat(b.target.value)||0))},null,40,Yc)]),e.createElementVNode("div",qc,[w[28]||(w[28]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"0.2",max:"6",step:"0.1",value:t.settings.lineWidthEnd,onInput:w[5]||(w[5]=b=>a("lineWidthEnd",parseFloat(b.target.value)))},null,40,Xc)]),w[47]||(w[47]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",Zc,[w[29]||(w[29]=e.createElementVNode("span",{class:"zm-settings-label"},"根节点线条",-1)),e.createElementVNode("div",Jc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(s),b=>(e.openBlock(),e.createElementBlock("button",{key:b.value,class:e.normalizeClass(["zm-line-style-btn",{"is-on":t.settings.rootLineStyle===b.value}]),title:b.label,onClick:V=>a("rootLineStyle",b.value)},[(e.openBlock(),e.createElementBlock("svg",{viewBox:b.viewBox,width:"28",height:"14",preserveAspectRatio:"none"},[b.value==="arc"?(e.openBlock(),e.createElementBlock("path",td)):b.value==="rounded-elbow"?(e.openBlock(),e.createElementBlock("path",nd)):b.value==="elbow"?(e.openBlock(),e.createElementBlock("path",od)):b.value==="curve"?(e.openBlock(),e.createElementBlock("path",id)):(e.openBlock(),e.createElementBlock("line",rd))],8,ed)),e.createElementVNode("span",ld,e.toDisplayString(b.label),1)],10,Qc))),128))])]),e.createElementVNode("div",ad,[w[30]||(w[30]=e.createElementVNode("span",{class:"zm-settings-label"},"其他节点线条",-1)),e.createElementVNode("div",sd,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(c,b=>e.createElementVNode("button",{key:b.value,class:e.normalizeClass(["zm-line-style-btn",{"is-on":t.settings.lineStyle===b.value}]),title:b.label,onClick:V=>a("lineStyle",b.value)},[(e.openBlock(),e.createElementBlock("svg",{viewBox:b.viewBox,width:"28",height:"14",preserveAspectRatio:"none"},[b.value==="arc"?(e.openBlock(),e.createElementBlock("path",ud)):b.value==="rounded-elbow"?(e.openBlock(),e.createElementBlock("path",fd)):b.value==="elbow"?(e.openBlock(),e.createElementBlock("path",md)):b.value==="curve"?(e.openBlock(),e.createElementBlock("path",pd)):(e.openBlock(),e.createElementBlock("line",hd))],8,dd)),e.createElementVNode("span",gd,e.toDisplayString(b.label),1)],10,cd)),64))])]),t.settings.lineStyle==="rounded-elbow"||t.settings.rootLineStyle==="rounded-elbow"?(e.openBlock(),e.createElementBlock("div",bd,[e.createElementVNode("span",kd,[w[31]||(w[31]=e.createTextVNode("圆角大小 ",-1)),e.createElementVNode("span",yd,e.toDisplayString(t.settings.elbowRadius)+"px",1)]),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"1",min:"2",max:"20",value:t.settings.elbowRadius,onChange:w[6]||(w[6]=b=>a("elbowRadius",parseFloat(b.target.value)||8))},null,40,Ed)])):e.createCommentVNode("",!0),t.settings.lineStyle==="rounded-elbow"||t.settings.rootLineStyle==="rounded-elbow"?(e.openBlock(),e.createElementBlock("div",xd,[w[32]||(w[32]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"2",max:"20",step:"1",value:t.settings.elbowRadius,onInput:w[7]||(w[7]=b=>a("elbowRadius",parseFloat(b.target.value)))},null,40,wd)])):e.createCommentVNode("",!0),e.createElementVNode("div",Nd,[w[34]||(w[34]=e.createElementVNode("span",{class:"zm-settings-label"},"线条起点",-1)),e.createElementVNode("div",Sd,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(u,b=>e.createElementVNode("button",{key:b.value,class:e.normalizeClass(["zm-line-style-btn",{"is-on":t.settings.lineOrigin===b.value}]),title:b.label,onClick:V=>a("lineOrigin",b.value)},[(e.openBlock(),e.createElementBlock("svg",Cd,[w[33]||(w[33]=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)),b.value==="edge"?(e.openBlock(),e.createElementBlock("path",Md)):b.value==="center"?(e.openBlock(),e.createElementBlock("path",Ad)):(e.openBlock(),e.createElementBlock("path",_d))])),e.createElementVNode("span",Rd,e.toDisplayString(b.label),1)],10,Td)),64))])]),e.createElementVNode("div",Bd,[w[36]||(w[36]=e.createElementVNode("span",{class:"zm-settings-label"},"一级分支彩虹色",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.rainbowBranch}]),onClick:w[8]||(w[8]=b=>a("rainbowBranch",!t.settings.rainbowBranch))},[...w[35]||(w[35]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),t.settings.rainbowBranch?(e.openBlock(),e.createElementBlock("div",vd,[w[37]||(w[37]=e.createElementVNode("div",{class:"zm-settings-field"},[e.createElementVNode("span",{class:"zm-settings-label"},"配色方案")],-1)),e.createElementVNode("div",Id,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,b=>(e.openBlock(),e.createElementBlock("button",{key:b.id,class:e.normalizeClass(["zm-palette-option",{"is-active":t.settings.branchPaletteId===b.id}]),onClick:V=>a("branchPaletteId",b.id)},[e.createElementVNode("span",Od,e.toDisplayString(b.name),1),e.createElementVNode("span",Ld,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.colors,(V,W)=>(e.openBlock(),e.createElementBlock("span",{key:W,class:"zm-palette-option-swatch",style:e.normalizeStyle({background:V})},null,4))),128))])],10,zd))),128))]),t.settings.customPalettes.find(b=>b.id===t.settings.branchPaletteId)?(e.openBlock(),e.createElementBlock("div",Dd,[e.createElementVNode("textarea",{class:"zm-palette-textarea",rows:"3",spellcheck:"false",placeholder:"一行一个 hex,例如 #f87171",value:C(t.settings.customPalettes.find(b=>b.id===t.settings.branchPaletteId)),onInput:w[9]||(w[9]=b=>x[t.settings.customPalettes.find(V=>V.id===t.settings.branchPaletteId).id]=b.target.value)},null,40,Vd),e.createElementVNode("div",$d,[e.createElementVNode("button",{type:"button",class:"zm-data-btn is-primary",onClick:w[10]||(w[10]=b=>$(t.settings.customPalettes.find(V=>V.id===t.settings.branchPaletteId)))},"保存"),e.createElementVNode("button",{type:"button",class:"zm-data-btn",onClick:w[11]||(w[11]=b=>F(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),w[48]||(w[48]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",Pd,[w[39]||(w[39]=e.createElementVNode("span",{class:"zm-settings-label"},"每条连线独立渐变",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.taperedEdge}]),onClick:w[12]||(w[12]=b=>a("taperedEdge",!t.settings.taperedEdge))},[...w[38]||(w[38]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),t.settings.taperedEdge?(e.openBlock(),e.createElementBlock("div",Fd,[e.createElementVNode("span",Ud,[w[40]||(w[40]=e.createTextVNode("层级衰减 ",-1)),e.createElementVNode("span",Hd,e.toDisplayString(Math.round(t.settings.lineWidthTaper*100))+"%",1)]),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"0.05",min:"0.3",max:"1",value:t.settings.lineWidthTaper,onChange:w[13]||(w[13]=b=>a("lineWidthTaper",parseFloat(b.target.value)||.67))},null,40,Wd)])):e.createCommentVNode("",!0),t.settings.taperedEdge?(e.openBlock(),e.createElementBlock("div",Gd,[w[41]||(w[41]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"0.3",max:"1",step:"0.01",value:t.settings.lineWidthTaper,onInput:w[14]||(w[14]=b=>a("lineWidthTaper",parseFloat(b.target.value)))},null,40,jd)])):e.createCommentVNode("",!0),e.createElementVNode("div",Kd,[w[43]||(w[43]=e.createElementVNode("span",{class:"zm-settings-label"},"显示节点序号",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.showOrderBadge}]),onClick:w[15]||(w[15]=b=>a("showOrderBadge",!t.settings.showOrderBadge))},[...w[42]||(w[42]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),e.createElementVNode("div",Yd,[(e.openBlock(),e.createElementBlock("svg",qd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(G.value,(b,V)=>(e.openBlock(),e.createElementBlock("line",{key:V,x1:b.x1,y1:b.y1,x2:b.x2,y2:b.y2,stroke:t.settings.rainbowBranch?b.color:"#94a3b8","stroke-width":b.w,"stroke-linecap":"butt"},null,8,Xd))),128))])),w[44]||(w[44]=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",Zd,[e.createElementVNode("h4",Jd,[w[49]||(w[49]=e.createTextVNode(" 节点 ",-1)),t.selectedNodeText?(e.openBlock(),e.createElementBlock("span",Qd,'"'+e.toDisplayString(t.selectedNodeText)+'"',1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",eu,[w[50]||(w[50]=e.createElementVNode("span",{class:"zm-settings-label"},"背景颜色",-1)),e.createElementVNode("span",tu,e.toDisplayString(((ie=t.nodeStyle)==null?void 0:ie.bg)||"默认"),1)]),e.createElementVNode("div",nu,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(O,b=>{var V;return e.createElementVNode("button",{key:"bg-"+b,class:e.normalizeClass(["zm-swatch",{"is-active":((V=t.nodeStyle)==null?void 0:V.bg)===b}]),style:e.normalizeStyle({background:b}),title:b,onClick:W=>p({bg:b})},null,14,ou)}),64)),e.createElementVNode("label",iu,[e.createElementVNode("input",{type:"color",value:((fe=t.nodeStyle)==null?void 0:fe.bg)||"#ffffff",onInput:w[16]||(w[16]=b=>p({bg:b.target.value}))},null,40,ru)]),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"清除",onClick:w[17]||(w[17]=b=>p({bg:void 0}))},"∅")]),e.createElementVNode("div",lu,[w[51]||(w[51]=e.createElementVNode("span",{class:"zm-settings-label"},"文字颜色",-1)),e.createElementVNode("span",au,e.toDisplayString(((ce=t.nodeStyle)==null?void 0:ce.textColor)||"默认"),1)]),e.createElementVNode("div",su,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(O,b=>{var V;return e.createElementVNode("button",{key:"fg-"+b,class:e.normalizeClass(["zm-swatch",{"is-active":((V=t.nodeStyle)==null?void 0:V.textColor)===b}]),style:e.normalizeStyle({background:b}),title:b,onClick:W=>p({textColor:b})},null,14,cu)}),64)),e.createElementVNode("label",du,[e.createElementVNode("input",{type:"color",value:((J=t.nodeStyle)==null?void 0:J.textColor)||"#1e2937",onInput:w[18]||(w[18]=b=>p({textColor:b.target.value}))},null,40,uu)]),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"清除",onClick:w[19]||(w[19]=b=>p({textColor:void 0}))},"∅")]),w[55]||(w[55]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",fu,[w[52]||(w[52]=e.createElementVNode("span",{class:"zm-settings-label"},"字重",-1)),e.createElementVNode("select",{class:"zm-select",value:((me=t.nodeStyle)==null?void 0:me.fontWeight)??400,onChange:w[20]||(w[20]=b=>p({fontWeight:parseInt(b.target.value)}))},[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(d,b=>e.createElementVNode("option",{key:b.value,value:b.value},e.toDisplayString(b.label),9,pu)),64))],40,mu)]),e.createElementVNode("div",hu,[w[53]||(w[53]=e.createElementVNode("span",{class:"zm-settings-label"},"文字大小",-1)),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"1",min:"8",max:"48",value:((ae=t.nodeStyle)==null?void 0:ae.fontSize)??14,onChange:w[21]||(w[21]=b=>p({fontSize:parseInt(b.target.value)||14}))},null,40,gu)]),e.createElementVNode("div",bu,[w[54]||(w[54]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"8",max:"48",step:"1",value:((ke=t.nodeStyle)==null?void 0:ke.fontSize)??14,onInput:w[22]||(w[22]=b=>p({fontSize:parseInt(b.target.value)}))},null,40,ku)]),w[56]||(w[56]=e.createElementVNode("p",{class:"zm-settings-hint"},"仅作用于当前节点,不影响子节点。",-1))])):e.createCommentVNode("",!0),e.createElementVNode("section",yu,[e.createElementVNode("button",{class:"zm-settings-reset",onClick:w[23]||(w[23]=b=>i("reset"))},"恢复默认设置")])])}}}),[["__scopeId","data-v-f1937c03"]]),Sr=20;function Eu(t,o){t.style.height="auto";const n=o.minRows*Sr,i=o.maxRows>0?o.maxRows*Sr:1/0,a=Math.max(n,Math.min(i,t.scrollHeight));t.style.height=a+"px",t.style.overflowY=t.scrollHeight>i?"auto":"hidden"}function ki(t,o={}){const n={minRows:o.minRows??3,maxRows:o.maxRows??12};function i(){const c=t.value;c&&Eu(c,n)}function a(){i()}e.onMounted(async()=>{await e.nextTick();const c=t.value;c&&(c.addEventListener("input",a),i())}),e.watch(()=>{var c;return(c=t.value)==null?void 0:c.value},()=>i()),e.onBeforeUnmount(()=>{const c=t.value;c&&c.removeEventListener("input",a)})}function xu(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Tr(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],i=typeof n;(i==="object"||i==="function")&&!Object.isFrozen(n)&&Tr(n)}),t}class Cr{constructor(o){o.data===void 0&&(o.data={}),this.data=o.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function Mr(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function un(t,...o){const n=Object.create(null);for(const i in t)n[i]=t[i];return o.forEach(function(i){for(const a in i)n[a]=i[a]}),n}const wu="</span>",Ar=t=>!!t.scope,Nu=(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((i,a)=>`${i}${"_".repeat(a+1)}`)].join(" ")}return`${o}${t}`};class Su{constructor(o,n){this.buffer="",this.classPrefix=n.classPrefix,o.walk(this)}addText(o){this.buffer+=Mr(o)}openNode(o){if(!Ar(o))return;const n=Nu(o.scope,{prefix:this.classPrefix});this.span(n)}closeNode(o){Ar(o)&&(this.buffer+=wu)}value(){return this.buffer}span(o){this.buffer+=`<span class="${o}">`}}const _r=(t={})=>{const o={children:[]};return Object.assign(o,t),o};class yi{constructor(){this.rootNode=_r(),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=_r({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(i=>this._walk(o,i)),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=>{yi._collapse(n)}))}}class Tu extends yi{constructor(o){super(),this.options=o}addText(o){o!==""&&this.add(o)}startScope(o){this.openNode(o)}endScope(){this.closeNode()}__addSublanguage(o,n){const i=o.root;n&&(i.scope=`language:${n}`),this.add(i)}toHTML(){return new Su(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function ro(t){return t?typeof t=="string"?t:t.source:null}function Rr(t){return En("(?=",t,")")}function Cu(t){return En("(?:",t,")*")}function Mu(t){return En("(?:",t,")?")}function En(...t){return t.map(n=>ro(n)).join("")}function Au(t){const o=t[t.length-1];return typeof o=="object"&&o.constructor===Object?(t.splice(t.length-1,1),o):{}}function Ei(...t){return"("+(Au(t).capture?"":"?:")+t.map(i=>ro(i)).join("|")+")"}function Br(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 Ru=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function xi(t,{joinWith:o}){let n=0;return t.map(i=>{n+=1;const a=n;let c=ro(i),s="";for(;c.length>0;){const u=Ru.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(i=>`(${i})`).join(o)}const Bu=/\b\B/,vr="[a-zA-Z]\\w*",wi="[a-zA-Z_]\\w*",Ir="\\b\\d+(\\.\\d+)?",zr="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Or="\\b(0b[01]+)",vu="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",Iu=(t={})=>{const o=/^#![ ]*\//;return t.binary&&(t.begin=En(o,/.*\b/,t.binary,/\b.*/)),un({scope:"meta",begin:o,end:/$/,relevance:0,"on:begin":(n,i)=>{n.index!==0&&i.ignoreMatch()}},t)},lo={begin:"\\\\[\\s\\S]",relevance:0},zu={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[lo]},Ou={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[lo]},Lu={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/},$o=function(t,o,n={}){const i=un({scope:"comment",begin:t,end:o,contains:[]},n);i.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=Ei("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 i.contains.push({begin:En(/[ ]+/,"(",a,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),i},Du=$o("//","$"),Vu=$o("/\\*","\\*/"),$u=$o("#","$"),Pu={scope:"number",begin:Ir,relevance:0},Fu={scope:"number",begin:zr,relevance:0},Uu={scope:"number",begin:Or,relevance:0},Hu={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[lo,{begin:/\[/,end:/\]/,relevance:0,contains:[lo]}]},Wu={scope:"title",begin:vr,relevance:0},Gu={scope:"title",begin:wi,relevance:0},ju={begin:"\\.\\s*"+wi,relevance:0};var Po=Object.freeze({__proto__:null,APOS_STRING_MODE:zu,BACKSLASH_ESCAPE:lo,BINARY_NUMBER_MODE:Uu,BINARY_NUMBER_RE:Or,COMMENT:$o,C_BLOCK_COMMENT_MODE:Vu,C_LINE_COMMENT_MODE:Du,C_NUMBER_MODE:Fu,C_NUMBER_RE:zr,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:$u,IDENT_RE:vr,MATCH_NOTHING_RE:Bu,METHOD_GUARD:ju,NUMBER_MODE:Pu,NUMBER_RE:Ir,PHRASAL_WORDS_MODE:Lu,QUOTE_STRING_MODE:Ou,REGEXP_MODE:Hu,RE_STARTERS_RE:vu,SHEBANG:Iu,TITLE_MODE:Wu,UNDERSCORE_IDENT_RE:wi,UNDERSCORE_TITLE_MODE:Gu});function Ku(t,o){t.input[t.index-1]==="."&&o.ignoreMatch()}function Yu(t,o){t.className!==void 0&&(t.scope=t.className,delete t.className)}function qu(t,o){o&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=Ku,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function Xu(t,o){Array.isArray(t.illegal)&&(t.illegal=Ei(...t.illegal))}function Zu(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 Ju(t,o){t.relevance===void 0&&(t.relevance=1)}const Qu=(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(i=>{delete t[i]}),t.keywords=n.keywords,t.begin=En(n.beforeMatch,Rr(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},ef=["of","and","for","in","not","or","if","then","parent","list","value"],tf="keyword";function Lr(t,o,n=tf){const i=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(i,Lr(t[c],o,c))}),i;function a(c,s){o&&(s=s.map(u=>u.toLowerCase())),s.forEach(function(u){const d=u.split("|");i[d[0]]=[c,nf(d[0],d[1])]})}}function nf(t,o){return o?Number(o):of(t)?0:1}function of(t){return ef.includes(t.toLowerCase())}const Dr={},xn=t=>{console.error(t)},Vr=(t,...o)=>{console.log(`WARN: ${t}`,...o)},Dn=(t,o)=>{Dr[`${t}/${o}`]||(console.log(`Deprecated as of ${t}. ${o}`),Dr[`${t}/${o}`]=!0)},Fo=new Error;function $r(t,o,{key:n}){let i=0;const a=t[n],c={},s={};for(let u=1;u<=o.length;u++)s[u+i]=a[u],c[u+i]=!0,i+=Br(o[u-1]);t[n]=s,t[n]._emit=c,t[n]._multi=!0}function rf(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw xn("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Fo;if(typeof t.beginScope!="object"||t.beginScope===null)throw xn("beginScope must be object"),Fo;$r(t,t.begin,{key:"beginScope"}),t.begin=xi(t.begin,{joinWith:""})}}function lf(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw xn("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Fo;if(typeof t.endScope!="object"||t.endScope===null)throw xn("endScope must be object"),Fo;$r(t,t.end,{key:"endScope"}),t.end=xi(t.end,{joinWith:""})}}function af(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function sf(t){af(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),rf(t),lf(t)}function cf(t){function o(s,u){return new RegExp(ro(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+=Br(u)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const u=this.regexes.map(d=>d[1]);this.matcherRe=o(xi(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((x,C)=>C>0&&x!==void 0),h=this.matchIndexes[p];return d.splice(0,p),Object.assign(d,h)}}class i{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,h])=>d.addRule(p,h)),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 h=this.getMatcher(0);h.lastIndex=this.lastIndex+1,p=h.exec(u)}return p&&(this.regexIndex+=p.position+1,this.regexIndex===this.count&&this.considerAll()),p}}function a(s){const u=new i;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;[Yu,Zu,sf,Qu].forEach(h=>h(s,u)),t.compilerExtensions.forEach(h=>h(s,u)),s.__beforeBegin=null,[qu,Xu,Ju].forEach(h=>h(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=Lr(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=ro(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(h){return df(h==="self"?s:h)})),s.contains.forEach(function(h){c(h,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=un(t.classNameAliases||{}),c(t)}function Pr(t){return t?t.endsWithParent||Pr(t.starts):!1}function df(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(o){return un(t,{variants:null},o)})),t.cachedVariants?t.cachedVariants:Pr(t)?un(t,{starts:t.starts?un(t.starts):null}):Object.isFrozen(t)?un(t):t}var uf="11.11.1";class ff extends Error{constructor(o,n){super(o),this.name="HTMLInjectionError",this.html=n}}const Ni=Mr,Fr=un,Ur=Symbol("nomatch"),mf=7,Hr=function(t){const o=Object.create(null),n=Object.create(null),i=[];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:Tu};function d(b){return u.noHighlightRe.test(b)}function p(b){let V=b.className+" ";V+=b.parentNode?b.parentNode.className:"";const W=u.languageDetectRe.exec(V);if(W){const ee=w(W[1]);return ee||(Vr(c.replace("{}",W[1])),Vr("Falling back to no-highlight mode for this block.",b)),ee?W[1]:"no-highlight"}return V.split(/\s+/).find(ee=>d(ee)||w(ee))}function h(b,V,W){let ee="",ge="";typeof V=="object"?(ee=b,W=V.ignoreIllegals,ge=V.language):(Dn("10.7.0","highlight(lang, code, ...args) has been deprecated."),Dn("10.7.0",`Please use highlight(code, options) instead.
59
+ https://github.com/highlightjs/highlight.js/issues/2277`),ge=b,ee=V),W===void 0&&(W=!0);const D={code:ee,language:ge};ae("before:highlight",D);const z=D.result?D.result:x(D.language,D.code,W);return z.code=D.code,ae("after:highlight",z),z}function x(b,V,W,ee){const ge=Object.create(null);function D(X,re){return X.keywords[re]}function z(){if(!ue.keywords){ze.addText(Be);return}let X=0;ue.keywordPatternRe.lastIndex=0;let re=ue.keywordPatternRe.exec(Be),xe="";for(;re;){xe+=Be.substring(X,re.index);const Ae=nt.case_insensitive?re[0].toLowerCase():re[0],Ue=D(ue,Ae);if(Ue){const[it,wt]=Ue;if(ze.addText(xe),xe="",ge[Ae]=(ge[Ae]||0)+1,ge[Ae]<=mf&&(Vt+=wt),it.startsWith("_"))xe+=re[0];else{const An=nt.classNameAliases[it]||it;I(re[0],An)}}else xe+=re[0];X=ue.keywordPatternRe.lastIndex,re=ue.keywordPatternRe.exec(Be)}xe+=Be.substring(X),ze.addText(xe)}function le(){if(Be==="")return;let X=null;if(typeof ue.subLanguage=="string"){if(!o[ue.subLanguage]){ze.addText(Be);return}X=x(ue.subLanguage,Be,!0,ft[ue.subLanguage]),ft[ue.subLanguage]=X._top}else X=$(Be,ue.subLanguage.length?ue.subLanguage:null);ue.relevance>0&&(Vt+=X.relevance),ze.__addSublanguage(X._emitter,X.language)}function be(){ue.subLanguage!=null?le():z(),Be=""}function I(X,re){X!==""&&(ze.startScope(re),ze.addText(X),ze.endScope())}function N(X,re){let xe=1;const Ae=re.length-1;for(;xe<=Ae;){if(!X._emit[xe]){xe++;continue}const Ue=nt.classNameAliases[X[xe]]||X[xe],it=re[xe];Ue?I(it,Ue):(Be=it,z(),Be=""),xe++}}function U(X,re){return X.scope&&typeof X.scope=="string"&&ze.openNode(nt.classNameAliases[X.scope]||X.scope),X.beginScope&&(X.beginScope._wrap?(I(Be,nt.classNameAliases[X.beginScope._wrap]||X.beginScope._wrap),Be=""):X.beginScope._multi&&(N(X.beginScope,re),Be="")),ue=Object.create(X,{parent:{value:ue}}),ue}function H(X,re,xe){let Ae=_u(X.endRe,xe);if(Ae){if(X["on:end"]){const Ue=new Cr(X);X["on:end"](re,Ue),Ue.isMatchIgnored&&(Ae=!1)}if(Ae){for(;X.endsParent&&X.parent;)X=X.parent;return X}}if(X.endsWithParent)return H(X.parent,re,xe)}function oe(X){return ue.matcher.regexIndex===0?(Be+=X[0],1):(kt=!0,0)}function Ee(X){const re=X[0],xe=X.rule,Ae=new Cr(xe),Ue=[xe.__beforeBegin,xe["on:begin"]];for(const it of Ue)if(it&&(it(X,Ae),Ae.isMatchIgnored))return oe(re);return xe.skip?Be+=re:(xe.excludeBegin&&(Be+=re),be(),!xe.returnBegin&&!xe.excludeBegin&&(Be=re)),U(xe,X),xe.returnBegin?0:re.length}function et(X){const re=X[0],xe=V.substring(X.index),Ae=H(ue,X,xe);if(!Ae)return Ur;const Ue=ue;ue.endScope&&ue.endScope._wrap?(be(),I(re,ue.endScope._wrap)):ue.endScope&&ue.endScope._multi?(be(),N(ue.endScope,X)):Ue.skip?Be+=re:(Ue.returnEnd||Ue.excludeEnd||(Be+=re),be(),Ue.excludeEnd&&(Be=re));do ue.scope&&ze.closeNode(),!ue.skip&&!ue.subLanguage&&(Vt+=ue.relevance),ue=ue.parent;while(ue!==Ae.parent);return Ae.starts&&U(Ae.starts,X),Ue.returnEnd?0:re.length}function ut(){const X=[];for(let re=ue;re!==nt;re=re.parent)re.scope&&X.unshift(re.scope);X.forEach(re=>ze.openNode(re))}let tt={};function nn(X,re){const xe=re&&re[0];if(Be+=X,xe==null)return be(),0;if(tt.type==="begin"&&re.type==="end"&&tt.index===re.index&&xe===""){if(Be+=V.slice(re.index,re.index+1),!a){const Ae=new Error(`0 width match regex (${b})`);throw Ae.languageName=b,Ae.badRule=tt.rule,Ae}return 1}if(tt=re,re.type==="begin")return Ee(re);if(re.type==="illegal"&&!W){const Ae=new Error('Illegal lexeme "'+xe+'" for mode "'+(ue.scope||"<unnamed>")+'"');throw Ae.mode=ue,Ae}else if(re.type==="end"){const Ae=et(re);if(Ae!==Ur)return Ae}if(re.type==="illegal"&&xe==="")return Be+=`
60
+ `,1;if(xt>1e5&&xt>re.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Be+=xe,xe.length}const nt=w(b);if(!nt)throw xn(c.replace("{}",b)),new Error('Unknown language: "'+b+'"');const on=cf(nt);let Dt="",ue=ee||on;const ft={},ze=new u.__emitter(u);ut();let Be="",Vt=0,ot=0,xt=0,kt=!1;try{if(nt.__emitTokens)nt.__emitTokens(V,ze);else{for(ue.matcher.considerAll();;){xt++,kt?kt=!1:ue.matcher.considerAll(),ue.matcher.lastIndex=ot;const X=ue.matcher.exec(V);if(!X)break;const re=V.substring(ot,X.index),xe=nn(re,X);ot=X.index+xe}nn(V.substring(ot))}return ze.finalize(),Dt=ze.toHTML(),{language:b,value:Dt,relevance:Vt,illegal:!1,_emitter:ze,_top:ue}}catch(X){if(X.message&&X.message.includes("Illegal"))return{language:b,value:Ni(V),illegal:!0,relevance:0,_illegalBy:{message:X.message,index:ot,context:V.slice(ot-100,ot+100),mode:X.mode,resultSoFar:Dt},_emitter:ze};if(a)return{language:b,value:Ni(V),illegal:!1,relevance:0,errorRaised:X,_emitter:ze,_top:ue};throw X}}function C(b){const V={value:Ni(b),illegal:!1,relevance:0,_top:s,_emitter:new u.__emitter(u)};return V._emitter.addText(b),V}function $(b,V){V=V||u.languages||Object.keys(o);const W=C(b),ee=V.filter(w).filter(fe).map(be=>x(be,b,!1));ee.unshift(W);const ge=ee.sort((be,I)=>{if(be.relevance!==I.relevance)return I.relevance-be.relevance;if(be.language&&I.language){if(w(be.language).supersetOf===I.language)return 1;if(w(I.language).supersetOf===be.language)return-1}return 0}),[D,z]=ge,le=D;return le.secondBest=z,le}function R(b,V,W){const ee=V&&n[V]||W;b.classList.add("hljs"),b.classList.add(`language-${ee}`)}function F(b){let V=null;const W=p(b);if(d(W))return;if(ae("before:highlightElement",{el:b,language:W}),b.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",b);return}if(b.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(b)),u.throwUnescapedHTML))throw new ff("One of your code blocks includes unescaped HTML.",b.innerHTML);V=b;const ee=V.textContent,ge=W?h(ee,{language:W,ignoreIllegals:!0}):$(ee);b.innerHTML=ge.value,b.dataset.highlighted="yes",R(b,W,ge.language),b.result={language:ge.language,re:ge.relevance,relevance:ge.relevance},ge.secondBest&&(b.secondBest={language:ge.secondBest.language,relevance:ge.secondBest.relevance}),ae("after:highlightElement",{el:b,result:ge,text:ee})}function O(b){u=Fr(u,b)}const A=()=>{m(),Dn("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function y(){m(),Dn("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let k=!1;function m(){function b(){m()}if(document.readyState==="loading"){k||window.addEventListener("DOMContentLoaded",b,!1),k=!0;return}document.querySelectorAll(u.cssSelector).forEach(F)}function P(b,V){let W=null;try{W=V(t)}catch(ee){if(xn("Language definition for '{}' could not be registered.".replace("{}",b)),a)xn(ee);else throw ee;W=s}W.name||(W.name=b),o[b]=W,W.rawDefinition=V.bind(null,t),W.aliases&&ie(W.aliases,{languageName:b})}function G(b){delete o[b];for(const V of Object.keys(n))n[V]===b&&delete n[V]}function q(){return Object.keys(o)}function w(b){return b=(b||"").toLowerCase(),o[b]||o[n[b]]}function ie(b,{languageName:V}){typeof b=="string"&&(b=[b]),b.forEach(W=>{n[W.toLowerCase()]=V})}function fe(b){const V=w(b);return V&&!V.disableAutodetect}function ce(b){b["before:highlightBlock"]&&!b["before:highlightElement"]&&(b["before:highlightElement"]=V=>{b["before:highlightBlock"](Object.assign({block:V.el},V))}),b["after:highlightBlock"]&&!b["after:highlightElement"]&&(b["after:highlightElement"]=V=>{b["after:highlightBlock"](Object.assign({block:V.el},V))})}function J(b){ce(b),i.push(b)}function me(b){const V=i.indexOf(b);V!==-1&&i.splice(V,1)}function ae(b,V){const W=b;i.forEach(function(ee){ee[W]&&ee[W](V)})}function ke(b){return Dn("10.7.0","highlightBlock will be removed entirely in v12.0"),Dn("10.7.0","Please use highlightElement now."),F(b)}Object.assign(t,{highlight:h,highlightAuto:$,highlightAll:m,highlightElement:F,highlightBlock:ke,configure:O,initHighlighting:A,initHighlightingOnLoad:y,registerLanguage:P,unregisterLanguage:G,listLanguages:q,getLanguage:w,registerAliases:ie,autoDetection:fe,inherit:Fr,addPlugin:J,removePlugin:me}),t.debugMode=function(){a=!1},t.safeMode=function(){a=!0},t.versionString=uf,t.regex={concat:En,lookahead:Rr,either:Ei,optional:Mu,anyNumberOfTimes:Cu};for(const b in Po)typeof Po[b]=="object"&&Tr(Po[b]);return Object.assign(t,Po),t},Vn=Hr({});Vn.newInstance=()=>Hr({});var pf=Vn;Vn.HighlightJS=Vn,Vn.default=Vn;const Si=xu(pf);function Ti(t){const o=t.regex,n={},i={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:o.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},i]});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:/'/},h={match:/\\'/},x={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},F=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],O=["true","false"],A={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:F,literal:O,built_in:[...y,...k,"set","shopt",...m,...P]},contains:[$,t.SHEBANG(),R,x,c,s,A,u,d,p,h,n]}}const hf=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_-]*/}}),gf=["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"],bf=["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"],kf=[...gf,...bf],yf=["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(),Ef=["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(),xf=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),wf=["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 Nf(t){const o=t.regex,n=hf(t),i={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,i,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:":("+Ef.join("|")+")"},{begin:":(:)?("+xf.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+wf.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:yf.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...u,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+kf.join("|")+")\\b"}]}}function Wr(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 $n="[0-9](_*[0-9])*",Uo=`\\.(${$n})`,Ho="[0-9a-fA-F](_*[0-9a-fA-F])*",Gr={className:"number",variants:[{begin:`(\\b(${$n})((${Uo})|\\.)?|(${Uo}))[eE][+-]?(${$n})[fFdD]?\\b`},{begin:`\\b(${$n})((${Uo})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Uo})[fFdD]?\\b`},{begin:`\\b(${$n})[fFdD]\\b`},{begin:`\\b0[xX]((${Ho})\\.?|(${Ho})?\\.(${Ho}))[pP][+-]?(${$n})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Ho})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function jr(t,o,n){return n===-1?"":t.replace(o,i=>jr(t,o,n-1))}function Sf(t){const o=t.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",i=n+jr("(?:<"+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"]}]},h={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:[h,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+i+"\\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,Gr,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},Gr,p]}}const Kr="[A-Za-z$_][0-9A-Za-z$_]*",Tf=["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"],Cf=["true","false","null","undefined","NaN","Infinity"],Yr=["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"],qr=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Xr=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Mf=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Af=[].concat(Xr,Yr,qr);function Zr(t){const o=t.regex,n=(W,{after:ee})=>{const ge="</"+W[0].slice(1);return W.input.indexOf(ge,ee)!==-1},i=Kr,a={begin:"<>",end:"</>"},c=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(W,ee)=>{const ge=W[0].length+W.index,D=W.input[ge];if(D==="<"||D===","){ee.ignoreMatch();return}D===">"&&(n(W,{after:ge})||ee.ignoreMatch());let z;const le=W.input.substring(ge);if(z=le.match(/^\s*=/)){ee.ignoreMatch();return}if((z=le.match(/^\s+extends\s+/))&&z.index===0){ee.ignoreMatch();return}}},u={$pattern:Kr,keyword:Tf,literal:Cf,built_in:Af,"variable.language":Mf},d="[0-9](_?[0-9])*",p=`\\.(${d})`,h="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",x={className:"number",variants:[{begin:`(\\b(${h})((${p})|\\.)?|(${p}))[eE][+-]?(${d})\\b`},{begin:`\\b(${h})\\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},C={className:"subst",begin:"\\$\\{",end:"\\}",keywords:u,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"}},F={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"graphql"}},O={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,C]},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:i+"(?=\\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,$,R,F,O,{match:/\$\d+/},x];C.contains=k.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(k)});const m=[].concat(y,C.contains),P=m.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(m)}]),G={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:P},q={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,o.concat(i,"(",o.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},w={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:{_:[...Yr,...qr]}},ie={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},fe={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[G],illegal:/%/},ce={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function J(W){return o.concat("(?!",W.join("|"),")")}const me={match:o.concat(/\b/,J([...Xr,"super","import"].map(W=>`${W}\\s*\\(`)),i,o.lookahead(/\s*\(/)),className:"title.function",relevance:0},ae={begin:o.concat(/\./,o.lookahead(o.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ke={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},G]},b="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",V={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,o.lookahead(b)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[G]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:P,CLASS_REFERENCE:w},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),ie,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,$,R,F,O,y,{match:/\$\d+/},x,w,{scope:"attr",match:i+o.lookahead(":"),relevance:0},V,{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:b,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"]}]}]},fe,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[G,t.inherit(t.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},ae,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[G]},me,ce,q,ke,{match:/\$[(.]/}]}}function _f(t){const o={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},i=["true","false","null"],a={scope:"literal",beginKeywords:i.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:i},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 Jr(t){const o=t.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},i={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}/}]},h={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},x=t.inherit(p,{contains:[]}),C=t.inherit(h,{contains:[]});p.contains.push(C),h.contains.push(x);let $=[n,d];return[p,h,x,C].forEach(A=>{A.contains=A.contains.concat($)}),$=$.concat(p,h),{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,p,h,{className:"quote",begin:"^>\\s+",contains:$,end:"$"},a,i,d,s,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function Qr(t){const o=t.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),i=["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:i,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:/#/},h={begin:/\{\{/,relevance:0},x={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,h,p]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,d,h,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,h,p]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,h,p]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},C="[0-9](_?[0-9])*",$=`(\\b(${C}))?\\.(${C})|\\b(${C})\\.`,R=`\\b|${i.join("|")}`,F={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})`}]},O={className:"comment",begin:o.lookahead(/# type:/),end:/$/,keywords:u,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},A={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:["self",d,F,x,t.HASH_COMMENT_MODE]}]};return p.contains=[x,F,d],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:u,illegal:/(<\/|\?)|=>/,contains:[d,F,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},x,O,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[A]},{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:[F,A,x]}]}}function el(t){const o=t.regex,n=/(r#)?/,i=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!"],h=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:t.IDENT_RE+"!?",type:h,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+/,i],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,i],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,i,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,i],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,i],className:{1:"keyword",3:"title.class"}},{begin:t.IDENT_RE+"::",keywords:{keyword:"Self",built_in:p,type:h}},{className:"punctuation",begin:"->"},c]}}function Rf(t){const o=t.regex,n=t.COMMENT("--","$"),i={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"],h=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],x=["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"],$=h,R=[...p,...d].filter(P=>!h.includes(P)),F={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},O={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},A={match:o.concat(/\b/,o.either(...$),/\s*\(/),relevance:0,keywords:{built_in:$}};function y(P){return o.concat(/\b/,o.either(...P.map(G=>G.replace(/\s+/,"\\s+"))),/\b/)}const k={scope:"keyword",match:y(C),relevance:0};function m(P,{exceptions:G,when:q}={}){const w=q;return G=G||[],P.map(ie=>ie.match(/\|\d+$/)||G.includes(ie)?ie:w(ie)?`${ie}|0`:ie)}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:x},contains:[{scope:"type",match:y(s)},k,A,F,i,a,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,n,O]}}const Wo="[A-Za-z$_][0-9A-Za-z$_]*",tl=["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"],nl=["true","false","null","undefined","NaN","Infinity"],ol=["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"],il=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],rl=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],ll=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],al=[].concat(rl,ol,il);function Bf(t){const o=t.regex,n=(W,{after:ee})=>{const ge="</"+W[0].slice(1);return W.input.indexOf(ge,ee)!==-1},i=Wo,a={begin:"<>",end:"</>"},c=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(W,ee)=>{const ge=W[0].length+W.index,D=W.input[ge];if(D==="<"||D===","){ee.ignoreMatch();return}D===">"&&(n(W,{after:ge})||ee.ignoreMatch());let z;const le=W.input.substring(ge);if(z=le.match(/^\s*=/)){ee.ignoreMatch();return}if((z=le.match(/^\s+extends\s+/))&&z.index===0){ee.ignoreMatch();return}}},u={$pattern:Wo,keyword:tl,literal:nl,built_in:al,"variable.language":ll},d="[0-9](_?[0-9])*",p=`\\.(${d})`,h="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",x={className:"number",variants:[{begin:`(\\b(${h})((${p})|\\.)?|(${p}))[eE][+-]?(${d})\\b`},{begin:`\\b(${h})\\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},C={className:"subst",begin:"\\$\\{",end:"\\}",keywords:u,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"}},F={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"graphql"}},O={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,C]},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:i+"(?=\\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,$,R,F,O,{match:/\$\d+/},x];C.contains=k.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(k)});const m=[].concat(y,C.contains),P=m.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(m)}]),G={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:P},q={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,o.concat(i,"(",o.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},w={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:{_:[...ol,...il]}},ie={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},fe={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[G],illegal:/%/},ce={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function J(W){return o.concat("(?!",W.join("|"),")")}const me={match:o.concat(/\b/,J([...rl,"super","import"].map(W=>`${W}\\s*\\(`)),i,o.lookahead(/\s*\(/)),className:"title.function",relevance:0},ae={begin:o.concat(/\./,o.lookahead(o.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ke={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},G]},b="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",V={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,o.lookahead(b)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[G]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:P,CLASS_REFERENCE:w},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),ie,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,$,R,F,O,y,{match:/\$\d+/},x,w,{scope:"attr",match:i+o.lookahead(":"),relevance:0},V,{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:b,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"]}]}]},fe,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[G,t.inherit(t.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},ae,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[G]},me,ce,q,ke,{match:/\$[(.]/}]}}function sl(t){const o=t.regex,n=Bf(t),i=Wo,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:Wo,keyword:tl.concat(d),literal:nl,built_in:al.concat(a),"variable.language":ll},h={className:"meta",begin:"@"+i},x=(F,O,A)=>{const y=F.contains.findIndex(k=>k.label===O);if(y===-1)throw new Error("can not find mode to replace");F.contains.splice(y,1,A)};Object.assign(n.keywords,p),n.exports.PARAMS_CONTAINS.push(h);const C=n.contains.find(F=>F.scope==="attr"),$=Object.assign({},C,{match:o.concat(i,o.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,C,$]),n.contains=n.contains.concat([h,c,s,$]),x(n,"shebang",t.SHEBANG()),x(n,"use_strict",u);const R=n.contains.find(F=>F.label==="func.def");return R.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function cl(t){const o=t.regex,n=o.concat(/[\p{L}_]/u,o.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),i=/[\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:i,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 dl(t){const o="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",i={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,{}[\]]+/}]}),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},F={begin:"\\[",end:"\\]",contains:[$],illegal:"\\n",relevance:0},O=[i,{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,F,c,s],A=[...O];return A.pop(),A.push(u),$.contains=A,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:O}}const Ci={bash:Ti,sh:Ti,shell:Ti,css:Nf,go:Wr,golang:Wr,java:Sf,javascript:Zr,js:Zr,json:_f,markdown:Jr,md:Jr,python:Qr,py:Qr,rust:el,rs:el,sql:Rf,typescript:sl,ts:sl,xml:cl,html:cl,yaml:dl,yml:dl};for(const[t,o]of Object.entries(Ci))Si.registerLanguage(t,o);function Go(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 Nn(t){const o=/^(`{3,}|~{3,})([^\s`~]*)/.exec(t.split(`
63
- `)[0]??""),n=((o==null?void 0:o[2])??"").toLowerCase();return n&&Si[n]?n:""}function Ti(t,o){const n=o&&Si[o]?o:"";try{return n?wi.highlight(t,{language:n,ignoreIllegals:!0}).value:wi.highlightAuto(t).value}catch{return Rf(t)}}function Ci(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 Rf(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function Mi(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Sn=Mi();function dl(t){Sn=t}var Tn={exec:()=>null};function $n(t){let o=[];return n=>{let i=Math.max(0,Math.min(3,n-1)),a=o[i];return a||(a=t(i),o[i]=a),a}}function Re(t,o=""){let n=typeof t=="string"?t:t.source,i={replace:(a,c)=>{let s=typeof c=="string"?c:c.source;return s=s.replace(dt.caret,"$1"),n=n.replace(a,s),i},getRegex:()=>new RegExp(n,o)};return i}var Bf=((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:$n(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:$n(t=>new RegExp(`^ {0,${t}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:$n(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:$n(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:$n(t=>new RegExp(`^ {0,${t}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:$n(t=>new RegExp(`^ {0,${t}}>`))},vf=/^(?:[ \t]*(?:\n|$))+/,zf=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,If=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ao=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Of=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ai=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,ul=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,fl=Re(ul).replace(/bull/g,Ai).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(),Lf=Re(ul).replace(/bull/g,Ai).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(),_i=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Df=/^[^\n]+/,Ri=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Vf=Re(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Ri).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),$f=Re(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Ai).getRegex(),jo="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",Bi=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Pf=Re("^ {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",Bi).replace("tag",jo).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ml=Re(_i).replace("hr",ao).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",jo).getRegex(),Ff=Re(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ml).getRegex(),vi={blockquote:Ff,code:zf,def:Vf,fences:If,heading:Of,hr:ao,html:Pf,lheading:fl,list:$f,newline:vf,paragraph:ml,table:Tn,text:Df},pl=Re("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ao).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",jo).getRegex(),Uf={...vi,lheading:Lf,table:pl,paragraph:Re(_i).replace("hr",ao).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",pl).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",jo).getRegex()},Hf={...vi,html:Re(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Bi).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Tn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Re(_i).replace("hr",ao).replace("heading",` *#{1,6} *[^
65
- ]`).replace("lheading",fl).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Wf=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Gf=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,hl=/^( {2,}|\\)\n(?!\s*$)/,jf=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Pn=/[\p{P}\p{S}]/u,Ko=/[\s\p{P}\p{S}]/u,zi=/[^\s\p{P}\p{S}]/u,Kf=Re(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Ko).getRegex(),gl=/(?!~)[\p{P}\p{S}]/u,Yf=/(?!~)[\s\p{P}\p{S}]/u,qf=/(?:[^\s\p{P}\p{S}]|~)/u,Xf=Re(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Bf?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),bl=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Zf=Re(bl,"u").replace(/punct/g,Pn).getRegex(),Jf=Re(bl,"u").replace(/punct/g,gl).getRegex(),kl="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Qf=Re(kl,"gu").replace(/notPunctSpace/g,zi).replace(/punctSpace/g,Ko).replace(/punct/g,Pn).getRegex(),em=Re(kl,"gu").replace(/notPunctSpace/g,qf).replace(/punctSpace/g,Yf).replace(/punct/g,gl).getRegex(),tm=Re("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,zi).replace(/punctSpace/g,Ko).replace(/punct/g,Pn).getRegex(),nm=Re(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Pn).getRegex(),om="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",im=Re(om,"gu").replace(/notPunctSpace/g,zi).replace(/punctSpace/g,Ko).replace(/punct/g,Pn).getRegex(),rm=Re(/\\(punct)/,"gu").replace(/punct/g,Pn).getRegex(),lm=Re(/^<(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(),am=Re(Bi).replace("(?:-->|$)","-->").getRegex(),sm=Re("^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",am).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Yo=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,cm=Re(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Yo).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),yl=Re(/^!?\[(label)\]\[(ref)\]/).replace("label",Yo).replace("ref",Ri).getRegex(),El=Re(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ri).getRegex(),dm=Re("reflink|nolink(?!\\()","g").replace("reflink",yl).replace("nolink",El).getRegex(),xl=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Ii={_backpedal:Tn,anyPunctuation:rm,autolink:lm,blockSkip:Xf,br:hl,code:Gf,del:Tn,delLDelim:Tn,delRDelim:Tn,emStrongLDelim:Zf,emStrongRDelimAst:Qf,emStrongRDelimUnd:tm,escape:Wf,link:cm,nolink:El,punctuation:Kf,reflink:yl,reflinkSearch:dm,tag:sm,text:jf,url:Tn},um={...Ii,link:Re(/^!?\[(label)\]\((.*?)\)/).replace("label",Yo).getRegex(),reflink:Re(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Yo).getRegex()},Oi={...Ii,emStrongRDelimAst:em,emStrongLDelim:Jf,delLDelim:nm,delRDelim:im,url:Re(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",xl).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:Re(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",xl).getRegex()},fm={...Oi,br:Re(hl).replace("{2,}","*").getRegex(),text:Re(Oi.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},qo={normal:vi,gfm:Uf,pedantic:Hf},so={normal:Ii,gfm:Oi,breaks:fm,pedantic:um},mm={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},wl=t=>mm[t];function Yt(t,o){if(o){if(dt.escapeTest.test(t))return t.replace(dt.escapeReplace,wl)}else if(dt.escapeTestNoEncode.test(t))return t.replace(dt.escapeReplaceNoEncode,wl);return t}function Nl(t){try{t=encodeURI(t).replace(dt.percentDecode,"%")}catch{return null}return t}function Sl(t,o){var c;let n=t.replace(dt.findPipe,(s,f,d)=>{let p=!1,h=f;for(;--h>=0&&d[h]==="\\";)p=!p;return p?"|":" |"}),i=n.split(dt.splitPipe),a=0;if(i[0].trim()||i.shift(),i.length>0&&!((c=i.at(-1))!=null&&c.trim())&&i.pop(),o)if(i.length>o)i.splice(o);else for(;i.length<o;)i.push("");for(;a<i.length;a++)i[a]=i[a].trim().replace(dt.slashPipe,"|");return i}function un(t,o,n){let i=t.length;if(i===0)return"";let a=0;for(;a<i&&t.charAt(i-a-1)===o;)a++;return t.slice(0,i-a)}function Tl(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 pm(t,o){if(t.indexOf(o[1])===-1)return-1;let n=0;for(let i=0;i<t.length;i++)if(t[i]==="\\")i++;else if(t[i]===o[0])n++;else if(t[i]===o[1]&&(n--,n<0))return i;return n>0?-2:-1}function hm(t,o=0){let n=o,i="";for(let a of t)if(a===" "){let c=4-n%4;i+=" ".repeat(c),n+=c}else i+=a,n++;return i}function Cl(t,o,n,i,a){let c=o.href,s=o.title||null,f=t[1].replace(a.other.outputLinkReplace,"$1");i.state.inLink=!0;let d={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:c,title:s,text:f,tokens:i.inlineTokens(f)};return i.state.inLink=!1,d}function gm(t,o,n){let i=t.match(n.other.indentCodeCompensation);if(i===null)return o;let a=i[1];return o.split(`
68
- `).map(c=>{let s=c.match(n.other.beginningSpace);if(s===null)return c;let[f]=s;return f.length>=a.length?c.slice(a.length):c}).join(`
69
- `)}var Xo=class{constructor(t){$e(this,"options");$e(this,"rules");$e(this,"lexer");this.options=t||Sn}space(t){let o=this.rules.block.newline.exec(t);if(o&&o[0].length>0)return{type:"space",raw:o[0]}}code(t){let o=this.rules.block.code.exec(t);if(o){let n=this.options.pedantic?o[0]:Tl(o[0]),i=n.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n,codeBlockStyle:"indented",text:i}}}fences(t){let o=this.rules.block.fences.exec(t);if(o){let n=o[0],i=gm(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:i}}}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 i=un(n,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(n=i.trim())}return{type:"heading",raw:un(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:un(o[0],`
71
- `)}}blockquote(t){let o=this.rules.block.blockquote.exec(t);if(o){let n=un(o[0],`
62
+ `).replace(/\n+$/,"")}function wn(t){const o=/^(`{3,}|~{3,})([^\s`~]*)/.exec(t.split(`
63
+ `)[0]??""),n=((o==null?void 0:o[2])??"").toLowerCase();return n&&Ci[n]?n:""}function Mi(t,o){const n=o&&Ci[o]?o:"";try{return n?Si.highlight(t,{language:n,ignoreIllegals:!0}).value:Si.highlightAuto(t).value}catch{return vf(t)}}function Ai(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 vf(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 Nn=_i();function ul(t){Nn=t}var Sn={exec:()=>null};function Pn(t){let o=[];return n=>{let i=Math.max(0,Math.min(3,n-1)),a=o[i];return a||(a=t(i),o[i]=a),a}}function Re(t,o=""){let n=typeof t=="string"?t:t.source,i={replace:(a,c)=>{let s=typeof c=="string"?c:c.source;return s=s.replace(ct.caret,"$1"),n=n.replace(a,s),i},getRegex:()=>new RegExp(n,o)};return i}var If=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),ct={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:Pn(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Pn(t=>new RegExp(`^ {0,${t}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:Pn(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:Pn(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:Pn(t=>new RegExp(`^ {0,${t}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:Pn(t=>new RegExp(`^ {0,${t}}>`))},zf=/^(?:[ \t]*(?:\n|$))+/,Of=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Lf=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ao=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Df=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ri=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,fl=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ml=Re(fl).replace(/bull/g,Ri).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(),Vf=Re(fl).replace(/bull/g,Ri).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(),Bi=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,$f=/^[^\n]+/,vi=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Pf=Re(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",vi).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ff=Re(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Ri).getRegex(),jo="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",Ii=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Uf=Re("^ {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",Ii).replace("tag",jo).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),pl=Re(Bi).replace("hr",ao).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",jo).getRegex(),Hf=Re(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",pl).getRegex(),zi={blockquote:Hf,code:Of,def:Pf,fences:Lf,heading:Df,hr:ao,html:Uf,lheading:ml,list:Ff,newline:zf,paragraph:pl,table:Sn,text:$f},hl=Re("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ao).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",jo).getRegex(),Wf={...zi,lheading:Vf,table:hl,paragraph:Re(Bi).replace("hr",ao).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",hl).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",jo).getRegex()},Gf={...zi,html:Re(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ii).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:Sn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Re(Bi).replace("hr",ao).replace("heading",` *#{1,6} *[^
65
+ ]`).replace("lheading",ml).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},jf=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Kf=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,gl=/^( {2,}|\\)\n(?!\s*$)/,Yf=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Fn=/[\p{P}\p{S}]/u,Ko=/[\s\p{P}\p{S}]/u,Oi=/[^\s\p{P}\p{S}]/u,qf=Re(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Ko).getRegex(),bl=/(?!~)[\p{P}\p{S}]/u,Xf=/(?!~)[\s\p{P}\p{S}]/u,Zf=/(?:[^\s\p{P}\p{S}]|~)/u,Jf=Re(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",If?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),kl=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Qf=Re(kl,"u").replace(/punct/g,Fn).getRegex(),em=Re(kl,"u").replace(/punct/g,bl).getRegex(),yl="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",tm=Re(yl,"gu").replace(/notPunctSpace/g,Oi).replace(/punctSpace/g,Ko).replace(/punct/g,Fn).getRegex(),nm=Re(yl,"gu").replace(/notPunctSpace/g,Zf).replace(/punctSpace/g,Xf).replace(/punct/g,bl).getRegex(),om=Re("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Oi).replace(/punctSpace/g,Ko).replace(/punct/g,Fn).getRegex(),im=Re(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Fn).getRegex(),rm="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",lm=Re(rm,"gu").replace(/notPunctSpace/g,Oi).replace(/punctSpace/g,Ko).replace(/punct/g,Fn).getRegex(),am=Re(/\\(punct)/,"gu").replace(/punct/g,Fn).getRegex(),sm=Re(/^<(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(),cm=Re(Ii).replace("(?:-->|$)","-->").getRegex(),dm=Re("^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",cm).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Yo=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,um=Re(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Yo).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),El=Re(/^!?\[(label)\]\[(ref)\]/).replace("label",Yo).replace("ref",vi).getRegex(),xl=Re(/^!?\[(ref)\](?:\[\])?/).replace("ref",vi).getRegex(),fm=Re("reflink|nolink(?!\\()","g").replace("reflink",El).replace("nolink",xl).getRegex(),wl=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Li={_backpedal:Sn,anyPunctuation:am,autolink:sm,blockSkip:Jf,br:gl,code:Kf,del:Sn,delLDelim:Sn,delRDelim:Sn,emStrongLDelim:Qf,emStrongRDelimAst:tm,emStrongRDelimUnd:om,escape:jf,link:um,nolink:xl,punctuation:qf,reflink:El,reflinkSearch:fm,tag:dm,text:Yf,url:Sn},mm={...Li,link:Re(/^!?\[(label)\]\((.*?)\)/).replace("label",Yo).getRegex(),reflink:Re(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Yo).getRegex()},Di={...Li,emStrongRDelimAst:nm,emStrongLDelim:em,delLDelim:im,delRDelim:lm,url:Re(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",wl).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:Re(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",wl).getRegex()},pm={...Di,br:Re(gl).replace("{2,}","*").getRegex(),text:Re(Di.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},qo={normal:zi,gfm:Wf,pedantic:Gf},so={normal:Li,gfm:Di,breaks:pm,pedantic:mm},hm={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Nl=t=>hm[t];function qt(t,o){if(o){if(ct.escapeTest.test(t))return t.replace(ct.escapeReplace,Nl)}else if(ct.escapeTestNoEncode.test(t))return t.replace(ct.escapeReplaceNoEncode,Nl);return t}function Sl(t){try{t=encodeURI(t).replace(ct.percentDecode,"%")}catch{return null}return t}function Tl(t,o){var c;let n=t.replace(ct.findPipe,(s,u,d)=>{let p=!1,h=u;for(;--h>=0&&d[h]==="\\";)p=!p;return p?"|":" |"}),i=n.split(ct.splitPipe),a=0;if(i[0].trim()||i.shift(),i.length>0&&!((c=i.at(-1))!=null&&c.trim())&&i.pop(),o)if(i.length>o)i.splice(o);else for(;i.length<o;)i.push("");for(;a<i.length;a++)i[a]=i[a].trim().replace(ct.slashPipe,"|");return i}function fn(t,o,n){let i=t.length;if(i===0)return"";let a=0;for(;a<i&&t.charAt(i-a-1)===o;)a++;return t.slice(0,i-a)}function Cl(t){let o=t.split(`
66
+ `),n=o.length-1;for(;n>=0&&ct.blankLine.test(o[n]);)n--;return o.length-n<=2?t:o.slice(0,n+1).join(`
67
+ `)}function gm(t,o){if(t.indexOf(o[1])===-1)return-1;let n=0;for(let i=0;i<t.length;i++)if(t[i]==="\\")i++;else if(t[i]===o[0])n++;else if(t[i]===o[1]&&(n--,n<0))return i;return n>0?-2:-1}function bm(t,o=0){let n=o,i="";for(let a of t)if(a===" "){let c=4-n%4;i+=" ".repeat(c),n+=c}else i+=a,n++;return i}function Ml(t,o,n,i,a){let c=o.href,s=o.title||null,u=t[1].replace(a.other.outputLinkReplace,"$1");i.state.inLink=!0;let d={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:c,title:s,text:u,tokens:i.inlineTokens(u)};return i.state.inLink=!1,d}function km(t,o,n){let i=t.match(n.other.indentCodeCompensation);if(i===null)return o;let a=i[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 Xo=class{constructor(t){Ve(this,"options");Ve(this,"rules");Ve(this,"lexer");this.options=t||Nn}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]:Cl(o[0]),i=n.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n,codeBlockStyle:"indented",text:i}}}fences(t){let o=this.rules.block.fences.exec(t);if(o){let n=o[0],i=km(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:i}}}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 i=fn(n,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(n=i.trim())}return{type:"heading",raw:fn(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:fn(o[0],`
71
+ `)}}blockquote(t){let o=this.rules.block.blockquote.exec(t);if(o){let n=fn(o[0],`
72
72
  `).split(`
73
- `),i="",a="",c=[];for(;n.length>0;){let s=!1,f=[],d;for(d=0;d<n.length;d++)if(this.rules.other.blockquoteStart.test(n[d]))f.push(n[d]),s=!0;else if(!s)f.push(n[d]);else break;n=n.slice(d);let p=f.join(`
73
+ `),i="",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
74
  `),h=p.replace(this.rules.other.blockquoteSetextReplace,`
75
75
  $1`).replace(this.rules.other.blockquoteSetextReplace2,"");i=i?`${i}
76
76
  ${p}`:p,a=a?`${a}
77
- ${h}`:h;let y=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(h,c,!0),this.lexer.state.top=y,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 D=C,_=D.raw+`
77
+ ${h}`:h;let x=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(h,c,!0),this.lexer.state.top=x,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
- `),F=this.blockquote(_);c[c.length-1]=F,i=i.substring(0,i.length-D.raw.length)+F.raw,a=a.substring(0,a.length-D.text.length)+F.text;break}else if((C==null?void 0:C.type)==="list"){let D=C,_=D.raw+`
79
+ `),F=this.blockquote(R);c[c.length-1]=F,i=i.substring(0,i.length-$.raw.length)+F.raw,a=a.substring(0,a.length-$.text.length)+F.text;break}else if((C==null?void 0:C.type)==="list"){let $=C,R=$.raw+`
80
80
  `+n.join(`
81
- `),F=this.list(_);c[c.length-1]=F,i=i.substring(0,i.length-C.raw.length)+F.raw,a=a.substring(0,a.length-D.raw.length)+F.raw,n=_.substring(c.at(-1).raw.length).split(`
82
- `);continue}}return{type:"blockquote",raw:i,tokens:c,text:a}}}list(t){let o=this.rules.block.list.exec(t);if(o){let n=o[1].trim(),i=n.length>1,a={type:"list",raw:"",ordered:i,start:i?+n.slice(0,-1):"",loose:!1,items:[]};n=i?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=i?n:"[*+-]");let c=this.rules.other.listItemRegex(n),s=!1;for(;t;){let d=!1,p="",h="";if(!(o=c.exec(t))||this.rules.block.hr.test(t))break;p=o[0],t=t.substring(p.length);let y=hm(o[2].split(`
81
+ `),F=this.list(R);c[c.length-1]=F,i=i.substring(0,i.length-C.raw.length)+F.raw,a=a.substring(0,a.length-$.raw.length)+F.raw,n=R.substring(c.at(-1).raw.length).split(`
82
+ `);continue}}return{type:"blockquote",raw:i,tokens:c,text:a}}}list(t){let o=this.rules.block.list.exec(t);if(o){let n=o[1].trim(),i=n.length>1,a={type:"list",raw:"",ordered:i,start:i?+n.slice(0,-1):"",loose:!1,items:[]};n=i?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=i?n:"[*+-]");let c=this.rules.other.listItemRegex(n),s=!1;for(;t;){let d=!1,p="",h="";if(!(o=c.exec(t))||this.rules.block.hr.test(t))break;p=o[0],t=t.substring(p.length);let x=bm(o[2].split(`
83
83
  `,1)[0],o[1].length),C=t.split(`
84
- `,1)[0],D=!y.trim(),_=0;if(this.options.pedantic?(_=2,h=y.trimStart()):D?_=o[1].length+1:(_=y.search(this.rules.other.nonSpaceChar),_=_>4?1:_,h=y.slice(_),_+=o[1].length),D&&this.rules.other.blankLine.test(C)&&(p+=C+`
85
- `,t=t.substring(C.length+1),d=!0),!d){let F=this.rules.other.nextBulletRegex(_),R=this.rules.other.hrRegex(_),M=this.rules.other.fencesBeginRegex(_),k=this.rules.other.headingBeginRegex(_),u=this.rules.other.htmlBeginRegex(_),N=this.rules.other.blockquoteBeginRegex(_);for(;t;){let $=t.split(`
86
- `,1)[0],j;if(C=$,this.options.pedantic?(C=C.replace(this.rules.other.listReplaceNesting," "),j=C):j=C.replace(this.rules.other.tabCharGlobal," "),M.test(C)||k.test(C)||u.test(C)||N.test(C)||F.test(C)||R.test(C))break;if(j.search(this.rules.other.nonSpaceChar)>=_||!C.trim())h+=`
87
- `+j.slice(_);else{if(D||y.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||M.test(y)||k.test(y)||R.test(y))break;h+=`
88
- `+C}D=!C.trim(),p+=$+`
89
- `,t=t.substring($.length+1),y=j.slice(_)}}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(h),loose:!1,text:h,tokens:[]}),a.raw+=p}let f=a.items.at(-1);if(f)f.raw=f.raw.trimEnd(),f.text=f.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 y=this.lexer.inlineQueue.length-1;y>=0;y--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[y].src)){this.lexer.inlineQueue[y].src=this.lexer.inlineQueue[y].src.replace(this.rules.other.listReplaceTask,"");break}let h=this.rules.other.listTaskCheckbox.exec(d.raw);if(h){let y={type:"checkbox",raw:h[0]+" ",checked:h[0]!=="[ ]"};d.checked=y.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=y.raw+d.tokens[0].raw,d.tokens[0].text=y.raw+d.tokens[0].text,d.tokens[0].tokens.unshift(y)):d.tokens.unshift({type:"paragraph",raw:y.raw,text:y.raw,tokens:[y]}):d.tokens.unshift(y)}}else d.task&&(d.task=!1);if(!a.loose){let h=d.tokens.filter(C=>C.type==="space"),y=h.length>0&&h.some(C=>this.rules.other.anyLine.test(C.raw));a.loose=y}}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=Tl(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," "),i=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:un(o[0],`
90
- `),href:i,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=Sl(o[1]),i=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:un(o[0],`
92
- `),header:[],align:[],rows:[]};if(n.length===i.length){for(let f of i)this.rules.other.tableAlignRight.test(f)?c.align.push("right"):this.rules.other.tableAlignCenter.test(f)?c.align.push("center"):this.rules.other.tableAlignLeft.test(f)?c.align.push("left"):c.align.push(null);for(let f=0;f<n.length;f++)c.header.push({text:n[f],tokens:this.lexer.inline(n[f]),header:!0,align:c.align[f]});for(let f of a)c.rows.push(Sl(f,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:un(o[0],`
84
+ `,1)[0],$=!x.trim(),R=0;if(this.options.pedantic?(R=2,h=x.trimStart()):$?R=o[1].length+1:(R=x.search(this.rules.other.nonSpaceChar),R=R>4?1:R,h=x.slice(R),R+=o[1].length),$&&this.rules.other.blankLine.test(C)&&(p+=C+`
85
+ `,t=t.substring(C.length+1),d=!0),!d){let F=this.rules.other.nextBulletRegex(R),O=this.rules.other.hrRegex(R),A=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],G;if(C=P,this.options.pedantic?(C=C.replace(this.rules.other.listReplaceNesting," "),G=C):G=C.replace(this.rules.other.tabCharGlobal," "),A.test(C)||y.test(C)||k.test(C)||m.test(C)||F.test(C)||O.test(C))break;if(G.search(this.rules.other.nonSpaceChar)>=R||!C.trim())h+=`
87
+ `+G.slice(R);else{if($||x.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||A.test(x)||y.test(x)||O.test(x))break;h+=`
88
+ `+C}$=!C.trim(),p+=P+`
89
+ `,t=t.substring(P.length+1),x=G.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(h),loose:!1,text:h,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 x=this.lexer.inlineQueue.length-1;x>=0;x--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[x].src)){this.lexer.inlineQueue[x].src=this.lexer.inlineQueue[x].src.replace(this.rules.other.listReplaceTask,"");break}let h=this.rules.other.listTaskCheckbox.exec(d.raw);if(h){let x={type:"checkbox",raw:h[0]+" ",checked:h[0]!=="[ ]"};d.checked=x.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=x.raw+d.tokens[0].raw,d.tokens[0].text=x.raw+d.tokens[0].text,d.tokens[0].tokens.unshift(x)):d.tokens.unshift({type:"paragraph",raw:x.raw,text:x.raw,tokens:[x]}):d.tokens.unshift(x)}}else d.task&&(d.task=!1);if(!a.loose){let h=d.tokens.filter(C=>C.type==="space"),x=h.length>0&&h.some(C=>this.rules.other.anyLine.test(C.raw));a.loose=x}}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=Cl(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," "),i=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:fn(o[0],`
90
+ `),href:i,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=Tl(o[1]),i=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:fn(o[0],`
92
+ `),header:[],align:[],rows:[]};if(n.length===i.length){for(let u of i)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(Tl(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:fn(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=un(n.slice(0,-1),"\\");if((n.length-c.length)%2===0)return}else{let c=pm(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 i=o[2],a="";if(this.options.pedantic){let c=this.rules.other.pedanticHrefTitle.exec(i);c&&(i=c[1],a=c[3])}else a=o[3]?o[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?i=i.slice(1):i=i.slice(1,-1)),Cl(o,{href:i&&i.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 i=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),a=o[i.toLowerCase()];if(!a){let c=n[0].charAt(0);return{type:"text",raw:c,text:c}}return Cl(n,a,n[0],this.lexer,this.rules)}}emStrong(t,o,n=""){let i=this.rules.inline.emStrongLDelim.exec(t);if(!(!i||!i[1]&&!i[2]&&!i[3]&&!i[4]||i[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(i[1]||i[3])||!n||this.rules.inline.punctuation.exec(n))){let a=[...i[0]].length-1,c,s,f=a,d=0,p=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(p.lastIndex=0,o=o.slice(-1*t.length+a);(i=p.exec(o))!==null;){if(c=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!c)continue;if(s=[...c].length,i[3]||i[4]){f+=s;continue}else if((i[5]||i[6])&&a%3&&!((a+s)%3)){d+=s;continue}if(f-=s,f>0)continue;s=Math.min(s,s+f+d);let h=[...i[0]][0].length,y=t.slice(0,a+i.index+h+s);if(Math.min(a,s)%2){let D=y.slice(1,-1);return{type:"em",raw:y,text:D,tokens:this.lexer.inlineTokens(D)}}let C=y.slice(2,-2);return{type:"strong",raw:y,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," "),i=this.rules.other.nonSpaceChar.test(n),a=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return i&&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 i=this.rules.inline.delLDelim.exec(t);if(i&&(!i[1]||!n||this.rules.inline.punctuation.exec(n))){let a=[...i[0]].length-1,c,s,f=a,d=this.rules.inline.delRDelim;for(d.lastIndex=0,o=o.slice(-1*t.length+a);(i=d.exec(o))!==null;){if(c=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!c||(s=[...c].length,s!==a))continue;if(i[3]||i[4]){f+=s;continue}if(f-=s,f>0)continue;s=Math.min(s,s+f);let p=[...i[0]][0].length,h=t.slice(0,a+i.index+p+s),y=h.slice(a,-a);return{type:"del",raw:h,text:y,tokens:this.lexer.inlineTokens(y)}}}}autolink(t){let o=this.rules.inline.autolink.exec(t);if(o){let n,i;return o[2]==="@"?(n=o[1],i="mailto:"+n):(n=o[1],i=n),{type:"link",raw:o[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}url(t){var n;let o;if(o=this.rules.inline.url.exec(t)){let i,a;if(o[2]==="@")i=o[0],a="mailto:"+i;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]);i=o[0],o[1]==="www."?a="http://"+o[0]:a=o[0]}return{type:"link",raw:o[0],text:i,href:a,tokens:[{type:"text",raw:i,text:i}]}}}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}}}},Ut=class or{constructor(o){$e(this,"tokens");$e(this,"options");$e(this,"state");$e(this,"inlineQueue");$e(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=o||Sn,this.options.tokenizer=this.options.tokenizer||new Xo,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:qo.normal,inline:so.normal};this.options.pedantic?(n.block=qo.pedantic,n.inline=so.pedantic):this.options.gfm&&(n.block=qo.gfm,this.options.breaks?n.inline=so.breaks:n.inline=so.gfm),this.tokenizer.rules=n}static get rules(){return{block:qo,inline:so}}static lex(o,n){return new or(n).lex(o)}static lexInline(o,n){return new or(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 i=this.inlineQueue[n];this.inlineTokens(i.src,i.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(o,n=[],i=!1){var c,s,f;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(h=>(d=h.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 h=n.at(-1);d.raw.length===1&&h!==void 0?h.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=fn(n.slice(0,-1),"\\");if((n.length-c.length)%2===0)return}else{let c=gm(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 i=o[2],a="";if(this.options.pedantic){let c=this.rules.other.pedanticHrefTitle.exec(i);c&&(i=c[1],a=c[3])}else a=o[3]?o[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?i=i.slice(1):i=i.slice(1,-1)),Ml(o,{href:i&&i.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 i=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),a=o[i.toLowerCase()];if(!a){let c=n[0].charAt(0);return{type:"text",raw:c,text:c}}return Ml(n,a,n[0],this.lexer,this.rules)}}emStrong(t,o,n=""){let i=this.rules.inline.emStrongLDelim.exec(t);if(!(!i||!i[1]&&!i[2]&&!i[3]&&!i[4]||i[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(i[1]||i[3])||!n||this.rules.inline.punctuation.exec(n))){let a=[...i[0]].length-1,c,s,u=a,d=0,p=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(p.lastIndex=0,o=o.slice(-1*t.length+a);(i=p.exec(o))!==null;){if(c=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!c)continue;if(s=[...c].length,i[3]||i[4]){u+=s;continue}else if((i[5]||i[6])&&a%3&&!((a+s)%3)){d+=s;continue}if(u-=s,u>0)continue;s=Math.min(s,s+u+d);let h=[...i[0]][0].length,x=t.slice(0,a+i.index+h+s);if(Math.min(a,s)%2){let $=x.slice(1,-1);return{type:"em",raw:x,text:$,tokens:this.lexer.inlineTokens($)}}let C=x.slice(2,-2);return{type:"strong",raw:x,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," "),i=this.rules.other.nonSpaceChar.test(n),a=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return i&&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 i=this.rules.inline.delLDelim.exec(t);if(i&&(!i[1]||!n||this.rules.inline.punctuation.exec(n))){let a=[...i[0]].length-1,c,s,u=a,d=this.rules.inline.delRDelim;for(d.lastIndex=0,o=o.slice(-1*t.length+a);(i=d.exec(o))!==null;){if(c=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!c||(s=[...c].length,s!==a))continue;if(i[3]||i[4]){u+=s;continue}if(u-=s,u>0)continue;s=Math.min(s,s+u);let p=[...i[0]][0].length,h=t.slice(0,a+i.index+p+s),x=h.slice(a,-a);return{type:"del",raw:h,text:x,tokens:this.lexer.inlineTokens(x)}}}}autolink(t){let o=this.rules.inline.autolink.exec(t);if(o){let n,i;return o[2]==="@"?(n=o[1],i="mailto:"+n):(n=o[1],i=n),{type:"link",raw:o[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}url(t){var n;let o;if(o=this.rules.inline.url.exec(t)){let i,a;if(o[2]==="@")i=o[0],a="mailto:"+i;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]);i=o[0],o[1]==="www."?a="http://"+o[0]:a=o[0]}return{type:"link",raw:o[0],text:i,href:a,tokens:[{type:"text",raw:i,text:i}]}}}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}}}},Ht=class ir{constructor(o){Ve(this,"tokens");Ve(this,"options");Ve(this,"state");Ve(this,"inlineQueue");Ve(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=o||Nn,this.options.tokenizer=this.options.tokenizer||new Xo,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:ct,block:qo.normal,inline:so.normal};this.options.pedantic?(n.block=qo.pedantic,n.inline=so.pedantic):this.options.gfm&&(n.block=qo.gfm,this.options.breaks?n.inline=so.breaks:n.inline=so.gfm),this.tokenizer.rules=n}static get rules(){return{block:qo,inline:so}}static lex(o,n){return new ir(n).lex(o)}static lexInline(o,n){return new ir(n).inlineTokens(o)}lex(o){o=o.replace(ct.carriageReturn,`
95
+ `),this.blockTokens(o,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let i=this.inlineQueue[n];this.inlineTokens(i.src,i.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(o,n=[],i=!1){var c,s,u;this.tokenizer.lexer=this,this.options.pedantic&&(o=o.replace(ct.tabCharGlobal," ").replace(ct.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(h=>(d=h.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 h=n.at(-1);d.raw.length===1&&h!==void 0?h.raw+=`
96
96
  `:n.push(d);continue}if(d=this.tokenizer.code(o)){o=o.substring(d.raw.length);let h=n.at(-1);(h==null?void 0:h.type)==="paragraph"||(h==null?void 0:h.type)==="text"?(h.raw+=(h.raw.endsWith(`
97
97
  `)?"":`
98
98
  `)+d.raw,h.text+=`
99
99
  `+d.text,this.inlineQueue.at(-1).src=h.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 h=n.at(-1);(h==null?void 0:h.type)==="paragraph"||(h==null?void 0:h.type)==="text"?(h.raw+=(h.raw.endsWith(`
100
100
  `)?"":`
101
101
  `)+d.raw,h.text+=`
102
- `+d.raw,this.inlineQueue.at(-1).src=h.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((f=this.options.extensions)!=null&&f.startBlock){let h=1/0,y=o.slice(1),C;this.options.extensions.startBlock.forEach(D=>{C=D.call({lexer:this},y),typeof C=="number"&&C>=0&&(h=Math.min(h,C))}),h<1/0&&h>=0&&(p=o.substring(0,h+1))}if(this.state.top&&(d=this.tokenizer.paragraph(p))){let h=n.at(-1);i&&(h==null?void 0:h.type)==="paragraph"?(h.raw+=(h.raw.endsWith(`
102
+ `+d.raw,this.inlineQueue.at(-1).src=h.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 h=1/0,x=o.slice(1),C;this.options.extensions.startBlock.forEach($=>{C=$.call({lexer:this},x),typeof C=="number"&&C>=0&&(h=Math.min(h,C))}),h<1/0&&h>=0&&(p=o.substring(0,h+1))}if(this.state.top&&(d=this.tokenizer.paragraph(p))){let h=n.at(-1);i&&(h==null?void 0:h.type)==="paragraph"?(h.raw+=(h.raw.endsWith(`
103
103
  `)?"":`
104
104
  `)+d.raw,h.text+=`
105
105
  `+d.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=h.text):n.push(d),i=p.length!==o.length,o=o.substring(d.raw.length);continue}if(d=this.tokenizer.text(o)){o=o.substring(d.raw.length);let h=n.at(-1);(h==null?void 0:h.type)==="text"?(h.raw+=(h.raw.endsWith(`
106
106
  `)?"":`
107
107
  `)+d.raw,h.text+=`
108
- `+d.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=h.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,h,y,C,D;this.tokenizer.lexer=this;let i=o,a=null;if(this.tokens.links){let _=Object.keys(this.tokens.links);if(_.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(i))!==null;)_.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.anyPunctuation.exec(i))!==null;)i=i.slice(0,a.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let c;for(;(a=this.tokenizer.rules.inline.blockSkip.exec(i))!==null;)c=a[2]?a[2].length:0,i=i.slice(0,a.index+c)+"["+"a".repeat(a[0].length-c-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);i=((h=(p=this.options.hooks)==null?void 0:p.emStrongMask)==null?void 0:h.call({lexer:this},i))??i;let s=!1,f="",d=1/0;for(;o;){if(o.length<d)d=o.length;else{this.infiniteLoopError(o.charCodeAt(0));break}s||(f=""),s=!1;let _;if((C=(y=this.options.extensions)==null?void 0:y.inline)!=null&&C.some(R=>(_=R.call({lexer:this},o,n))?(o=o.substring(_.raw.length),n.push(_),!0):!1))continue;if(_=this.tokenizer.escape(o)){o=o.substring(_.raw.length),n.push(_);continue}if(_=this.tokenizer.tag(o)){o=o.substring(_.raw.length),n.push(_);continue}if(_=this.tokenizer.link(o)){o=o.substring(_.raw.length),n.push(_);continue}if(_=this.tokenizer.reflink(o,this.tokens.links)){o=o.substring(_.raw.length);let R=n.at(-1);_.type==="text"&&(R==null?void 0:R.type)==="text"?(R.raw+=_.raw,R.text+=_.text):n.push(_);continue}if(_=this.tokenizer.emStrong(o,i,f)){o=o.substring(_.raw.length),n.push(_);continue}if(_=this.tokenizer.codespan(o)){o=o.substring(_.raw.length),n.push(_);continue}if(_=this.tokenizer.br(o)){o=o.substring(_.raw.length),n.push(_);continue}if(_=this.tokenizer.del(o,i,f)){o=o.substring(_.raw.length),n.push(_);continue}if(_=this.tokenizer.autolink(o)){o=o.substring(_.raw.length),n.push(_);continue}if(!this.state.inLink&&(_=this.tokenizer.url(o))){o=o.substring(_.raw.length),n.push(_);continue}let F=o;if((D=this.options.extensions)!=null&&D.startInline){let R=1/0,M=o.slice(1),k;this.options.extensions.startInline.forEach(u=>{k=u.call({lexer:this},M),typeof k=="number"&&k>=0&&(R=Math.min(R,k))}),R<1/0&&R>=0&&(F=o.substring(0,R+1))}if(_=this.tokenizer.inlineText(F)){o=o.substring(_.raw.length),_.raw.slice(-1)!=="_"&&(f=_.raw.slice(-1)),s=!0;let R=n.at(-1);(R==null?void 0:R.type)==="text"?(R.raw+=_.raw,R.text+=_.text):n.push(_);continue}if(o){this.infiniteLoopError(o.charCodeAt(0));break}}return n}infiniteLoopError(o){let n="Infinite loop on byte: "+o;if(this.options.silent)console.error(n);else throw new Error(n)}},co=class{constructor(t){$e(this,"options");$e(this,"parser");this.options=t||Sn}space(t){return""}code({text:t,lang:o,escaped:n}){var c;let i=(c=(o||"").match(dt.notSpaceStart))==null?void 0:c[0],a=t.replace(dt.endingNewline,"")+`
109
- `;return i?'<pre><code class="language-'+Yt(i)+'">'+(n?a:Yt(a,!0))+`</code></pre>
110
- `:"<pre><code>"+(n?a:Yt(a,!0))+`</code></pre>
108
+ `+d.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=h.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,h,x,C,$;this.tokenizer.lexer=this;let i=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(i))!==null;)R.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.anyPunctuation.exec(i))!==null;)i=i.slice(0,a.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let c;for(;(a=this.tokenizer.rules.inline.blockSkip.exec(i))!==null;)c=a[2]?a[2].length:0,i=i.slice(0,a.index+c)+"["+"a".repeat(a[0].length-c-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);i=((h=(p=this.options.hooks)==null?void 0:p.emStrongMask)==null?void 0:h.call({lexer:this},i))??i;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((C=(x=this.options.extensions)==null?void 0:x.inline)!=null&&C.some(O=>(R=O.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 O=n.at(-1);R.type==="text"&&(O==null?void 0:O.type)==="text"?(O.raw+=R.raw,O.text+=R.text):n.push(R);continue}if(R=this.tokenizer.emStrong(o,i,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,i,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 F=o;if(($=this.options.extensions)!=null&&$.startInline){let O=1/0,A=o.slice(1),y;this.options.extensions.startInline.forEach(k=>{y=k.call({lexer:this},A),typeof y=="number"&&y>=0&&(O=Math.min(O,y))}),O<1/0&&O>=0&&(F=o.substring(0,O+1))}if(R=this.tokenizer.inlineText(F)){o=o.substring(R.raw.length),R.raw.slice(-1)!=="_"&&(u=R.raw.slice(-1)),s=!0;let O=n.at(-1);(O==null?void 0:O.type)==="text"?(O.raw+=R.raw,O.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)}},co=class{constructor(t){Ve(this,"options");Ve(this,"parser");this.options=t||Nn}space(t){return""}code({text:t,lang:o,escaped:n}){var c;let i=(c=(o||"").match(ct.notSpaceStart))==null?void 0:c[0],a=t.replace(ct.endingNewline,"")+`
109
+ `;return i?'<pre><code class="language-'+qt(i)+'">'+(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,i="";for(let s=0;s<t.items.length;s++){let f=t.items[s];i+=this.listitem(f)}let a=o?"ol":"ul",c=o&&n!==1?' start="'+n+'"':"";return"<"+a+c+`>
115
+ `}list(t){let o=t.ordered,n=t.start,i="";for(let s=0;s<t.items.length;s++){let u=t.items[s];i+=this.listitem(u)}let a=o?"ol":"ul",c=o&&n!==1?' start="'+n+'"':"";return"<"+a+c+`>
116
116
  `+i+"</"+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>${Yt(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 i=this.parser.parseInline(n),a=Nl(t);if(a===null)return i;t=a;let c='<a href="'+t+'"';return o&&(c+=' title="'+Yt(o)+'"'),c+=">"+i+"</a>",c}image({href:t,title:o,text:n,tokens:i}){i&&(n=this.parser.parseInline(i,this.parser.textRenderer));let a=Nl(t);if(a===null)return Yt(n);t=a;let c=`<img src="${t}" alt="${Yt(n)}"`;return o&&(c+=` title="${Yt(o)}"`),c+=">",c}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Yt(t.text)}},Li=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}},Ht=class ir{constructor(o){$e(this,"options");$e(this,"renderer");$e(this,"textRenderer");this.options=o||Sn,this.options.renderer=this.options.renderer||new co,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Li}static parse(o,n){return new ir(n).parse(o)}static parseInline(o,n){return new ir(n).parseInline(o)}parse(o){var i,a;this.renderer.parser=this;let n="";for(let c=0;c<o.length;c++){let s=o[c];if((a=(i=this.options.extensions)==null?void 0:i.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 f=s;switch(f.type){case"space":{n+=this.renderer.space(f);break}case"hr":{n+=this.renderer.hr(f);break}case"heading":{n+=this.renderer.heading(f);break}case"code":{n+=this.renderer.code(f);break}case"table":{n+=this.renderer.table(f);break}case"blockquote":{n+=this.renderer.blockquote(f);break}case"list":{n+=this.renderer.list(f);break}case"checkbox":{n+=this.renderer.checkbox(f);break}case"html":{n+=this.renderer.html(f);break}case"def":{n+=this.renderer.def(f);break}case"paragraph":{n+=this.renderer.paragraph(f);break}case"text":{n+=this.renderer.text(f);break}default:{let d='Token with "'+f.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 i="";for(let s=0;s<o.length;s++){let f=o[s];if((c=(a=this.options.extensions)==null?void 0:a.renderers)!=null&&c[f.type]){let p=this.options.extensions.renderers[f.type].call({parser:this},f);if(p!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(f.type)){i+=p||"";continue}}let d=f;switch(d.type){case"escape":{i+=n.text(d);break}case"html":{i+=n.html(d);break}case"link":{i+=n.link(d);break}case"image":{i+=n.image(d);break}case"checkbox":{i+=n.checkbox(d);break}case"strong":{i+=n.strong(d);break}case"em":{i+=n.em(d);break}case"codespan":{i+=n.codespan(d);break}case"br":{i+=n.br(d);break}case"del":{i+=n.del(d);break}case"text":{i+=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 i}},uo=(ei=class{constructor(t){$e(this,"options");$e(this,"block");this.options=t||Sn}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?Ut.lex:Ut.lexInline}provideParser(t=this.block){return t?Ht.parse:Ht.parseInline}},$e(ei,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),$e(ei,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),ei),Ml=class{constructor(...t){$e(this,"defaults",Mi());$e(this,"options",this.setOptions);$e(this,"parse",this.parseMarkdown(!0));$e(this,"parseInline",this.parseMarkdown(!1));$e(this,"Parser",Ht);$e(this,"Renderer",co);$e(this,"TextRenderer",Li);$e(this,"Lexer",Ut);$e(this,"Tokenizer",Xo);$e(this,"Hooks",uo);this.use(...t)}walkTokens(t,o){var i,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 f of s.header)n=n.concat(this.walkTokens(f.tokens,o));for(let f of s.rows)for(let d of f)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=(i=this.defaults.extensions)==null?void 0:i.childTokens)!=null&&a[s.type]?this.defaults.extensions.childTokens[s.type].forEach(f=>{let d=s[f].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 i={...n};if(i.async=this.defaults.async||i.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 f=a.renderer.apply(this,s);return f===!1&&(f=c.apply(this,s)),f}: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)}),i.extensions=o),n.renderer){let a=this.defaults.renderer||new co(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,f=n.renderer[s],d=a[s];a[s]=(...p)=>{let h=f.apply(a,p);return h===!1&&(h=d.apply(a,p)),h||""}}i.renderer=a}if(n.tokenizer){let a=this.defaults.tokenizer||new Xo(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,f=n.tokenizer[s],d=a[s];a[s]=(...p)=>{let h=f.apply(a,p);return h===!1&&(h=d.apply(a,p)),h}}i.tokenizer=a}if(n.hooks){let a=this.defaults.hooks||new uo;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,f=n.hooks[s],d=a[s];uo.passThroughHooks.has(c)?a[s]=p=>{if(this.defaults.async&&uo.passThroughHooksRespectAsync.has(c))return(async()=>{let y=await f.call(a,p);return d.call(a,y)})();let h=f.call(a,p);return d.call(a,h)}:a[s]=(...p)=>{if(this.defaults.async)return(async()=>{let y=await f.apply(a,p);return y===!1&&(y=await d.apply(a,p)),y})();let h=f.apply(a,p);return h===!1&&(h=d.apply(a,p)),h}}i.hooks=a}if(n.walkTokens){let a=this.defaults.walkTokens,c=n.walkTokens;i.walkTokens=function(s){let f=[];return f.push(c.call(this,s)),a&&(f=f.concat(a.call(this,s))),f}}this.defaults={...this.defaults,...i}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,o){return Ut.lex(t,o??this.defaults)}parser(t,o){return Ht.parse(t,o??this.defaults)}parseMarkdown(t){return(o,n)=>{let i={...n},a={...this.defaults,...i},c=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&i.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,f=await(a.hooks?await a.hooks.provideLexer(t):t?Ut.lex:Ut.lexInline)(s,a),d=a.hooks?await a.hooks.processAllTokens(f):f;a.walkTokens&&await Promise.all(this.walkTokens(d,a.walkTokens));let p=await(a.hooks?await a.hooks.provideParser(t):t?Ht.parse:Ht.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?Ut.lex:Ut.lexInline)(o,a);a.hooks&&(s=a.hooks.processAllTokens(s)),a.walkTokens&&this.walkTokens(s,a.walkTokens);let f=(a.hooks?a.hooks.provideParser(t):t?Ht.parse:Ht.parseInline)(s,a);return a.hooks&&(f=a.hooks.postprocess(f)),f}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 i="<p>An error occurred:</p><pre>"+Yt(n.message+"",!0)+"</pre>";return o?Promise.resolve(i):i}if(o)return Promise.reject(n);throw n}}},Cn=new Ml;function De(t,o){return Cn.parse(t,o)}De.options=De.setOptions=function(t){return Cn.setOptions(t),De.defaults=Cn.defaults,dl(De.defaults),De},De.getDefaults=Mi,De.defaults=Sn,De.use=function(...t){return Cn.use(...t),De.defaults=Cn.defaults,dl(De.defaults),De},De.walkTokens=function(t,o){return Cn.walkTokens(t,o)},De.parseInline=Cn.parseInline,De.Parser=Ht,De.parser=Ht.parse,De.Renderer=co,De.TextRenderer=Li,De.Lexer=Ut,De.lexer=Ut.lex,De.Tokenizer=Xo,De.Hooks=uo,De.parse=De,De.options,De.setOptions,De.use,De.walkTokens,De.parseInline,Ht.parse,Ut.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 Al(t,o){(o==null||o>t.length)&&(o=t.length);for(var n=0,i=Array(o);n<o;n++)i[n]=t[n];return i}function bm(t){if(Array.isArray(t))return t}function km(t,o){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var i,a,c,s,f=[],d=!0,p=!1;try{if(c=(n=n.call(t)).next,o!==0)for(;!(d=(i=c.call(n)).done)&&(f.push(i.value),f.length!==o);d=!0);}catch(h){p=!0,a=h}finally{try{if(!d&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(p)throw a}}return f}}function ym(){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 Em(t,o){return bm(t)||km(t,o)||xm(t,o)||ym()}function xm(t,o){if(t){if(typeof t=="string")return Al(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)?Al(t,o):void 0}}const _l=Object.entries,Rl=Object.setPrototypeOf,wm=Object.isFrozen,Nm=Object.getPrototypeOf,Sm=Object.getOwnPropertyDescriptor;let pt=Object.freeze,Ot=Object.seal,Fn=Object.create,Bl=typeof Reflect<"u"&&Reflect,Di=Bl.apply,Vi=Bl.construct;pt||(pt=function(o){return o}),Ot||(Ot=function(o){return o}),Di||(Di=function(o,n){for(var i=arguments.length,a=new Array(i>2?i-2:0),c=2;c<i;c++)a[c-2]=arguments[c];return o.apply(n,a)}),Vi||(Vi=function(o){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];return new o(...i)});const Mn=et(Array.prototype.forEach),Tm=et(Array.prototype.lastIndexOf),vl=et(Array.prototype.pop),Un=et(Array.prototype.push),Cm=et(Array.prototype.splice),ht=Array.isArray,fo=et(String.prototype.toLowerCase),$i=et(String.prototype.toString),zl=et(String.prototype.match),Hn=et(String.prototype.replace),Il=et(String.prototype.indexOf),Mm=et(String.prototype.trim),Am=et(Number.prototype.toString),_m=et(Boolean.prototype.toString),Ol=typeof BigInt>"u"?null:et(BigInt.prototype.toString),Ll=typeof Symbol>"u"?null:et(Symbol.prototype.toString),je=et(Object.prototype.hasOwnProperty),mo=et(Object.prototype.toString),lt=et(RegExp.prototype.test),Wn=Rm(TypeError);function et(t){return function(o){o instanceof RegExp&&(o.lastIndex=0);for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];return Di(t,o,i)}}function Rm(t){return function(){for(var o=arguments.length,n=new Array(o),i=0;i<o;i++)n[i]=arguments[i];return Vi(t,n)}}function we(t,o){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:fo;if(Rl&&Rl(t,null),!ht(o))return t;let i=o.length;for(;i--;){let a=o[i];if(typeof a=="string"){const c=n(a);c!==a&&(wm(o)||(o[i]=c),a=c)}t[a]=!0}return t}function Bm(t){for(let o=0;o<t.length;o++)je(t,o)||(t[o]=null);return t}function ut(t){const o=Fn(null);for(const i of _l(t)){var n=Em(i,2);const a=n[0],c=n[1];je(t,a)&&(ht(c)?o[a]=Bm(c):c&&typeof c=="object"&&c.constructor===Object?o[a]=ut(c):o[a]=c)}return o}function vm(t){switch(typeof t){case"string":return t;case"number":return Am(t);case"boolean":return _m(t);case"bigint":return Ol?Ol(t):"0";case"symbol":return Ll?Ll(t):"Symbol()";case"undefined":return mo(t);case"function":case"object":{if(t===null)return mo(t);const o=t,n=qt(o,"toString");if(typeof n=="function"){const i=n(o);return typeof i=="string"?i:mo(i)}return mo(t)}default:return mo(t)}}function qt(t,o){for(;t!==null;){const i=Sm(t,o);if(i){if(i.get)return et(i.get);if(typeof i.value=="function")return et(i.value)}t=Nm(t)}function n(){return null}return n}function zm(t){try{return lt(t,""),!0}catch{return!1}}const Dl=pt(["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"]),Pi=pt(["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"]),Fi=pt(["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"]),Im=pt(["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"]),Ui=pt(["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"]),Om=pt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Vl=pt(["#text"]),$l=pt(["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"]),Hi=pt(["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"]),Pl=pt(["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"]),Zo=pt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Lm=Ot(/{{[\w\W]*|^[\w\W]*}}/g),Dm=Ot(/<%[\w\W]*|^[\w\W]*%>/g),Vm=Ot(/\${[\w\W]*/g),$m=Ot(/^data-[\-\w.\u00B7-\uFFFF]+$/),Pm=Ot(/^aria-[\-\w]+$/),Fl=Ot(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Fm=Ot(/^(?:\w+script|data):/i),Um=Ot(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Hm=Ot(/^html$/i),Wm=Ot(/^[a-z][.\w]*(-[.\w]+)+$/i),Xt={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Gm=function(){return typeof window>"u"?null:window},jm=function(o,n){if(typeof o!="object"||typeof o.createPolicy!="function")return null;let i=null;const a="data-tt-policy-suffix";n&&n.hasAttribute(a)&&(i=n.getAttribute(a));const c="dompurify"+(i?"#"+i:"");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}},Ul=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Hl(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Gm();const o=le=>Hl(le);if(o.version="3.4.8",o.removed=[],!t||!t.document||t.document.nodeType!==Xt.document||!t.Element)return o.isSupported=!1,o;let n=t.document;const i=n,a=i.currentScript;t.DocumentFragment;const c=t.HTMLTemplateElement,s=t.Node,f=t.Element,d=t.NodeFilter,p=t.NamedNodeMap;p===void 0&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const h=t.DOMParser,y=t.trustedTypes,C=f.prototype,D=qt(C,"cloneNode"),_=qt(C,"remove"),F=qt(C,"nextSibling"),R=qt(C,"childNodes"),M=qt(C,"parentNode"),k=qt(C,"shadowRoot"),u=qt(C,"attributes"),N=s&&s.prototype?qt(s.prototype,"nodeType"):null,$=s&&s.prototype?qt(s.prototype,"nodeName"):null;if(typeof c=="function"){const le=n.createElement("template");le.content&&le.content.ownerDocument&&(n=le.content.ownerDocument)}let j,q="",x=0;const ae=function(g){if(x>0)throw Wn('The configured TRUSTED_TYPES_POLICY.createHTML must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose createHTML wraps DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.');x++;try{return j.createHTML(g)}finally{x--}},fe=n,me=fe.implementation,J=fe.createNodeIterator,ge=fe.createDocumentFragment,de=fe.getElementsByTagName,ye=i.importNode;let b=Ul();o.isSupported=typeof _l=="function"&&typeof M=="function"&&me&&me.createHTMLDocument!==void 0;const L=Lm,G=Dm,ee=Vm,be=$m,O=Pm,B=Fm,oe=Um,te=Wm;let V=Fl,w=null;const P=we({},[...Dl,...Pi,...Fi,...Ui,...Vl]);let H=null;const ie=we({},[...$l,...Hi,...Pl,...Zo]);let xe=Object.seal(Fn(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}})),Je=null,Tt=null;const it=Object.seal(Fn(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let nn=!0,Qe=!0,Zt=!1,Jt=!0,ce=!1,Ct=!0,Ve=!1,Be=!1,Lt=!1,tt=!1,gt=!1,Qt=!1,X=!0,se=!1;const Ee="user-content-";let Ae=!0,He=!1,rt={},yt=null;const _n=we({},["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 ti=null;const ni=we({},["audio","video","img","source","image","track"]);let po=null;const oi=we({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),jn="http://www.w3.org/1998/Math/MathML",Kn="http://www.w3.org/2000/svg",Dt="http://www.w3.org/1999/xhtml";let mn=Dt,ho=!1,go=null;const Wi=we({},[jn,Kn,Dt],$i);let bo=we({},["mi","mo","mn","ms","mtext"]),ko=we({},["annotation-xml"]);const Gi=we({},["title","style","font","a","script"]);let pn=null;const ji=["application/xhtml+xml","text/html"],ii="text/html";let Ge=null,on=null;const Ki=n.createElement("form"),yo=function(g){return g instanceof RegExp||g instanceof Function},Yn=function(){let g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(on&&on===g)return;(!g||typeof g!="object")&&(g={}),g=ut(g),pn=ji.indexOf(g.PARSER_MEDIA_TYPE)===-1?ii:g.PARSER_MEDIA_TYPE,Ge=pn==="application/xhtml+xml"?$i:fo,w=je(g,"ALLOWED_TAGS")&&ht(g.ALLOWED_TAGS)?we({},g.ALLOWED_TAGS,Ge):P,H=je(g,"ALLOWED_ATTR")&&ht(g.ALLOWED_ATTR)?we({},g.ALLOWED_ATTR,Ge):ie,go=je(g,"ALLOWED_NAMESPACES")&&ht(g.ALLOWED_NAMESPACES)?we({},g.ALLOWED_NAMESPACES,$i):Wi,po=je(g,"ADD_URI_SAFE_ATTR")&&ht(g.ADD_URI_SAFE_ATTR)?we(ut(oi),g.ADD_URI_SAFE_ATTR,Ge):oi,ti=je(g,"ADD_DATA_URI_TAGS")&&ht(g.ADD_DATA_URI_TAGS)?we(ut(ni),g.ADD_DATA_URI_TAGS,Ge):ni,yt=je(g,"FORBID_CONTENTS")&&ht(g.FORBID_CONTENTS)?we({},g.FORBID_CONTENTS,Ge):_n,Je=je(g,"FORBID_TAGS")&&ht(g.FORBID_TAGS)?we({},g.FORBID_TAGS,Ge):ut({}),Tt=je(g,"FORBID_ATTR")&&ht(g.FORBID_ATTR)?we({},g.FORBID_ATTR,Ge):ut({}),rt=je(g,"USE_PROFILES")?g.USE_PROFILES&&typeof g.USE_PROFILES=="object"?ut(g.USE_PROFILES):g.USE_PROFILES:!1,nn=g.ALLOW_ARIA_ATTR!==!1,Qe=g.ALLOW_DATA_ATTR!==!1,Zt=g.ALLOW_UNKNOWN_PROTOCOLS||!1,Jt=g.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ce=g.SAFE_FOR_TEMPLATES||!1,Ct=g.SAFE_FOR_XML!==!1,Ve=g.WHOLE_DOCUMENT||!1,tt=g.RETURN_DOM||!1,gt=g.RETURN_DOM_FRAGMENT||!1,Qt=g.RETURN_TRUSTED_TYPE||!1,Lt=g.FORCE_BODY||!1,X=g.SANITIZE_DOM!==!1,se=g.SANITIZE_NAMED_PROPS||!1,Ae=g.KEEP_CONTENT!==!1,He=g.IN_PLACE||!1,V=zm(g.ALLOWED_URI_REGEXP)?g.ALLOWED_URI_REGEXP:Fl,mn=typeof g.NAMESPACE=="string"?g.NAMESPACE:Dt,bo=je(g,"MATHML_TEXT_INTEGRATION_POINTS")&&g.MATHML_TEXT_INTEGRATION_POINTS&&typeof g.MATHML_TEXT_INTEGRATION_POINTS=="object"?ut(g.MATHML_TEXT_INTEGRATION_POINTS):we({},["mi","mo","mn","ms","mtext"]),ko=je(g,"HTML_INTEGRATION_POINTS")&&g.HTML_INTEGRATION_POINTS&&typeof g.HTML_INTEGRATION_POINTS=="object"?ut(g.HTML_INTEGRATION_POINTS):we({},["annotation-xml"]);const I=je(g,"CUSTOM_ELEMENT_HANDLING")&&g.CUSTOM_ELEMENT_HANDLING&&typeof g.CUSTOM_ELEMENT_HANDLING=="object"?ut(g.CUSTOM_ELEMENT_HANDLING):Fn(null);if(xe=Fn(null),je(I,"tagNameCheck")&&yo(I.tagNameCheck)&&(xe.tagNameCheck=I.tagNameCheck),je(I,"attributeNameCheck")&&yo(I.attributeNameCheck)&&(xe.attributeNameCheck=I.attributeNameCheck),je(I,"allowCustomizedBuiltInElements")&&typeof I.allowCustomizedBuiltInElements=="boolean"&&(xe.allowCustomizedBuiltInElements=I.allowCustomizedBuiltInElements),ce&&(Qe=!1),gt&&(tt=!0),rt&&(w=we({},Vl),H=Fn(null),rt.html===!0&&(we(w,Dl),we(H,$l)),rt.svg===!0&&(we(w,Pi),we(H,Hi),we(H,Zo)),rt.svgFilters===!0&&(we(w,Fi),we(H,Hi),we(H,Zo)),rt.mathMl===!0&&(we(w,Ui),we(H,Pl),we(H,Zo))),it.tagCheck=null,it.attributeCheck=null,je(g,"ADD_TAGS")&&(typeof g.ADD_TAGS=="function"?it.tagCheck=g.ADD_TAGS:ht(g.ADD_TAGS)&&(w===P&&(w=ut(w)),we(w,g.ADD_TAGS,Ge))),je(g,"ADD_ATTR")&&(typeof g.ADD_ATTR=="function"?it.attributeCheck=g.ADD_ATTR:ht(g.ADD_ATTR)&&(H===ie&&(H=ut(H)),we(H,g.ADD_ATTR,Ge))),je(g,"ADD_URI_SAFE_ATTR")&&ht(g.ADD_URI_SAFE_ATTR)&&we(po,g.ADD_URI_SAFE_ATTR,Ge),je(g,"FORBID_CONTENTS")&&ht(g.FORBID_CONTENTS)&&(yt===_n&&(yt=ut(yt)),we(yt,g.FORBID_CONTENTS,Ge)),je(g,"ADD_FORBID_CONTENTS")&&ht(g.ADD_FORBID_CONTENTS)&&(yt===_n&&(yt=ut(yt)),we(yt,g.ADD_FORBID_CONTENTS,Ge)),Ae&&(w["#text"]=!0),Ve&&we(w,["html","head","body"]),w.table&&(we(w,["tbody"]),delete Je.tbody),g.TRUSTED_TYPES_POLICY){if(typeof g.TRUSTED_TYPES_POLICY.createHTML!="function")throw Wn('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof g.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Wn('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const Q=j;j=g.TRUSTED_TYPES_POLICY;try{q=ae("")}catch(ve){throw j=Q,ve}}else j===void 0&&g.TRUSTED_TYPES_POLICY!==null&&(j=jm(y,a)),j&&typeof q=="string"&&(q=ae(""));(b.uponSanitizeElement.length>0||b.uponSanitizeAttribute.length>0)&&w===P&&(w=ut(w)),b.uponSanitizeAttribute.length>0&&H===ie&&(H=ut(H)),pt&&pt(g),on=g},hn=we({},[...Pi,...Fi,...Im]),ri=we({},[...Ui,...Om]),Yi=function(g){let I=M(g);(!I||!I.tagName)&&(I={namespaceURI:mn,tagName:"template"});const Q=fo(g.tagName),ve=fo(I.tagName);return go[g.namespaceURI]?g.namespaceURI===Kn?I.namespaceURI===Dt?Q==="svg":I.namespaceURI===jn?Q==="svg"&&(ve==="annotation-xml"||bo[ve]):!!hn[Q]:g.namespaceURI===jn?I.namespaceURI===Dt?Q==="math":I.namespaceURI===Kn?Q==="math"&&ko[ve]:!!ri[Q]:g.namespaceURI===Dt?I.namespaceURI===Kn&&!ko[ve]||I.namespaceURI===jn&&!bo[ve]?!1:!ri[Q]&&(Gi[Q]||!hn[Q]):!!(pn==="application/xhtml+xml"&&go[g.namespaceURI]):!1},Et=function(g){Un(o.removed,{element:g});try{M(g).removeChild(g)}catch{_(g)}},en=function(g,I){try{Un(o.removed,{attribute:I.getAttributeNode(g),from:I})}catch{Un(o.removed,{attribute:null,from:I})}if(I.removeAttribute(g),g==="is")if(tt||gt)try{Et(I)}catch{}else try{I.setAttribute(g,"")}catch{}},qn=function(g){let I=null,Q=null;if(Lt)g="<remove></remove>"+g;else{const Oe=zl(g,/^[\r\n\t ]+/);Q=Oe&&Oe[0]}pn==="application/xhtml+xml"&&mn===Dt&&(g='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+g+"</body></html>");const ve=j?ae(g):g;if(mn===Dt)try{I=new h().parseFromString(ve,pn)}catch{}if(!I||!I.documentElement){I=me.createDocument(mn,"template",null);try{I.documentElement.innerHTML=ho?q:ve}catch{}}const Ne=I.body||I.documentElement;return g&&Q&&Ne.insertBefore(n.createTextNode(Q),Ne.childNodes[0]||null),mn===Dt?de.call(I,Ve?"html":"body")[0]:Ve?I.documentElement:Ne},Xn=function(g){return J.call(g.ownerDocument||g,g,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},Eo=function(g){var I,Q;g.normalize();const ve=J.call(g.ownerDocument||g,g,d.SHOW_TEXT|d.SHOW_COMMENT|d.SHOW_CDATA_SECTION|d.SHOW_PROCESSING_INSTRUCTION,null);let Ne=ve.nextNode();for(;Ne;){let Ke=Ne.data;Mn([L,G,ee],at=>{Ke=Hn(Ke,at," ")}),Ne.data=Ke,Ne=ve.nextNode()}const Oe=(I=(Q=g.querySelectorAll)===null||Q===void 0?void 0:Q.call(g,"template"))!==null&&I!==void 0?I:[];Mn(Array.from(Oe),Ke=>{gn(Ke.content)&&Eo(Ke.content)})},Zn=function(g){const I=$?$(g):null;return typeof I!="string"||Ge(I)!=="form"?!1:typeof g.nodeName!="string"||typeof g.textContent!="string"||typeof g.removeChild!="function"||g.attributes!==u(g)||typeof g.removeAttribute!="function"||typeof g.setAttribute!="function"||typeof g.namespaceURI!="string"||typeof g.insertBefore!="function"||typeof g.hasChildNodes!="function"||g.nodeType!==N(g)||g.childNodes!==R(g)},gn=function(g){if(!N||typeof g!="object"||g===null)return!1;try{return N(g)===Xt.documentFragment}catch{return!1}},bn=function(g){if(!N||typeof g!="object"||g===null)return!1;try{return typeof N(g)=="number"}catch{return!1}};function Mt(le,g,I){Mn(le,Q=>{Q.call(o,g,I,on)})}const Wt=function(g){let I=null;if(Mt(b.beforeSanitizeElements,g,null),Zn(g))return Et(g),!0;const Q=Ge($?$(g):g.nodeName);if(Mt(b.uponSanitizeElement,g,{tagName:Q,allowedTags:w}),Ct&&g.hasChildNodes()&&!bn(g.firstElementChild)&&lt(/<[/\w!]/g,g.innerHTML)&&lt(/<[/\w!]/g,g.textContent)||Ct&&g.namespaceURI===Dt&&Q==="style"&&bn(g.firstElementChild)||g.nodeType===Xt.progressingInstruction||Ct&&g.nodeType===Xt.comment&&lt(/<[/\w]/g,g.data))return Et(g),!0;if(Je[Q]||!(it.tagCheck instanceof Function&&it.tagCheck(Q))&&!w[Q]){if(!Je[Q]&&li(Q)&&(xe.tagNameCheck instanceof RegExp&&lt(xe.tagNameCheck,Q)||xe.tagNameCheck instanceof Function&&xe.tagNameCheck(Q)))return!1;if(Ae&&!yt[Q]){const Ne=M(g),Oe=R(g);if(Oe&&Ne){const Ke=Oe.length;for(let at=Ke-1;at>=0;--at){const At=D(Oe[at],!0);Ne.insertBefore(At,F(g))}}}return Et(g),!0}return(N?N(g):g.nodeType)===Xt.element&&!Yi(g)||(Q==="noscript"||Q==="noembed"||Q==="noframes")&&lt(/<\/no(script|embed|frames)/i,g.innerHTML)?(Et(g),!0):(ce&&g.nodeType===Xt.text&&(I=g.textContent,Mn([L,G,ee],Ne=>{I=Hn(I,Ne," ")}),g.textContent!==I&&(Un(o.removed,{element:g.cloneNode()}),g.textContent=I)),Mt(b.afterSanitizeElements,g,null),!1)},Ie=function(g,I,Q){if(Tt[I]||X&&(I==="id"||I==="name")&&(Q in n||Q in Ki))return!1;const ve=H[I]||it.attributeCheck instanceof Function&&it.attributeCheck(I,g);if(!(Qe&&!Tt[I]&&lt(be,I))){if(!(nn&&lt(O,I))){if(!ve||Tt[I]){if(!(li(g)&&(xe.tagNameCheck instanceof RegExp&&lt(xe.tagNameCheck,g)||xe.tagNameCheck instanceof Function&&xe.tagNameCheck(g))&&(xe.attributeNameCheck instanceof RegExp&&lt(xe.attributeNameCheck,I)||xe.attributeNameCheck instanceof Function&&xe.attributeNameCheck(I,g))||I==="is"&&xe.allowCustomizedBuiltInElements&&(xe.tagNameCheck instanceof RegExp&&lt(xe.tagNameCheck,Q)||xe.tagNameCheck instanceof Function&&xe.tagNameCheck(Q))))return!1}else if(!po[I]){if(!lt(V,Hn(Q,oe,""))){if(!((I==="src"||I==="xlink:href"||I==="href")&&g!=="script"&&Il(Q,"data:")===0&&ti[g])){if(!(Zt&&!lt(B,Hn(Q,oe,"")))){if(Q)return!1}}}}}}return!0},Te=we({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),li=function(g){return!Te[fo(g)]&&lt(te,g)},bt=function(g){Mt(b.beforeSanitizeAttributes,g,null);const I=g.attributes;if(!I||Zn(g))return;const Q={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:H,forceKeepAttr:void 0};let ve=I.length;for(;ve--;){const Ne=I[ve],Oe=Ne.name,Ke=Ne.namespaceURI,at=Ne.value,At=Ge(Oe),Jn=at;let Pe=Oe==="value"?Jn:Mm(Jn);if(Q.attrName=At,Q.attrValue=Pe,Q.keepAttr=!0,Q.forceKeepAttr=void 0,Mt(b.uponSanitizeAttribute,g,Q),Pe=Q.attrValue,se&&(At==="id"||At==="name")&&Il(Pe,Ee)!==0&&(en(Oe,g),Pe=Ee+Pe),Ct&&lt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Pe)){en(Oe,g);continue}if(At==="attributename"&&zl(Pe,"href")){en(Oe,g);continue}if(Q.forceKeepAttr)continue;if(!Q.keepAttr){en(Oe,g);continue}if(!Jt&&lt(/\/>/i,Pe)){en(Oe,g);continue}ce&&Mn([L,G,ee],wo=>{Pe=Hn(Pe,wo," ")});const xo=Ge(g.nodeName);if(!Ie(xo,At,Pe)){en(Oe,g);continue}if(j&&typeof y=="object"&&typeof y.getAttributeType=="function"&&!Ke)switch(y.getAttributeType(xo,At)){case"TrustedHTML":{Pe=ae(Pe);break}case"TrustedScriptURL":{Pe=j.createScriptURL(Pe);break}}if(Pe!==Jn)try{Ke?g.setAttributeNS(Ke,Oe,Pe):g.setAttribute(Oe,Pe),Zn(g)?Et(g):vl(o.removed)}catch{en(Oe,g)}}Mt(b.afterSanitizeAttributes,g,null)},kn=function(g){let I=null;const Q=Xn(g);for(Mt(b.beforeSanitizeShadowDOM,g,null);I=Q.nextNode();)if(Mt(b.uponSanitizeShadowNode,I,null),Wt(I),bt(I),gn(I.content)&&kn(I.content),(N?N(I):I.nodeType)===Xt.element){const Ne=k?k(I):I.shadowRoot;gn(Ne)&&(U(Ne),kn(Ne))}Mt(b.afterSanitizeShadowDOM,g,null)},U=function(g){const I=N?N(g):g.nodeType;if(I===Xt.element){const Ne=k?k(g):g.shadowRoot;gn(Ne)&&(U(Ne),kn(Ne))}const Q=R?R(g):g.childNodes;if(!Q)return;const ve=[];Mn(Q,Ne=>{Un(ve,Ne)});for(const Ne of ve)U(Ne);if(I===Xt.element){const Ne=$?$(g):null;if(typeof Ne=="string"&&Ge(Ne)==="template"){const Oe=g.content;gn(Oe)&&U(Oe)}}};return o.sanitize=function(le){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},I=null,Q=null,ve=null,Ne=null;if(ho=!le,ho&&(le="<!-->"),typeof le!="string"&&!bn(le)&&(le=vm(le),typeof le!="string"))throw Wn("dirty is not a string, aborting");if(!o.isSupported)return le;if(Be||Yn(g),o.removed=[],typeof le=="string"&&(He=!1),He){const at=$?$(le):le.nodeName;if(typeof at=="string"){const At=Ge(at);if(!w[At]||Je[At])throw Wn("root node is forbidden and cannot be sanitized in-place")}if(Zn(le))throw Wn("root node is clobbered and cannot be sanitized in-place");U(le)}else if(bn(le))I=qn("<!---->"),Q=I.ownerDocument.importNode(le,!0),Q.nodeType===Xt.element&&Q.nodeName==="BODY"||Q.nodeName==="HTML"?I=Q:I.appendChild(Q),U(Q);else{if(!tt&&!ce&&!Ve&&le.indexOf("<")===-1)return j&&Qt?ae(le):le;if(I=qn(le),!I)return tt?null:Qt?q:""}I&&Lt&&Et(I.firstChild);const Oe=Xn(He?le:I);for(;ve=Oe.nextNode();)Wt(ve),bt(ve),gn(ve.content)&&kn(ve.content);if(He)return ce&&Eo(le),le;if(tt){if(ce&&Eo(I),gt)for(Ne=ge.call(I.ownerDocument);I.firstChild;)Ne.appendChild(I.firstChild);else Ne=I;return(H.shadowroot||H.shadowrootmode)&&(Ne=ye.call(i,Ne,!0)),Ne}let Ke=Ve?I.outerHTML:I.innerHTML;return Ve&&w["!doctype"]&&I.ownerDocument&&I.ownerDocument.doctype&&I.ownerDocument.doctype.name&&lt(Hm,I.ownerDocument.doctype.name)&&(Ke="<!DOCTYPE "+I.ownerDocument.doctype.name+`>
129
- `+Ke),ce&&Mn([L,G,ee],at=>{Ke=Hn(Ke,at," ")}),j&&Qt?ae(Ke):Ke},o.setConfig=function(){let le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Yn(le),Be=!0},o.clearConfig=function(){on=null,Be=!1},o.isValidAttribute=function(le,g,I){on||Yn({});const Q=Ge(le),ve=Ge(g);return Ie(Q,ve,I)},o.addHook=function(le,g){typeof g=="function"&&Un(b[le],g)},o.removeHook=function(le,g){if(g!==void 0){const I=Tm(b[le],g);return I===-1?void 0:Cm(b[le],I,1)[0]}return vl(b[le])},o.removeHooks=function(le){b[le]=[]},o.removeAllHooks=function(){b=Ul()},o}var Km=Hl();const Ym=new Ml({gfm:!0,breaks:!0,pedantic:!1,renderer:(()=>{const t=new co;return t.code=({text:o,lang:n})=>{const i=(n??"").toLowerCase(),a=Ti(o,i);return`<pre><code${i?` class="language-${i}"`:""}>${a}</code></pre>`},t})()}),qm=["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"],Xm=["href","title","target","rel","src","alt","class","checked","type","disabled"],Zm=/^(?:(?:https?|mailto|tel|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i;function Jm(t){if(!t)return"";const o=Ym.parse(t,{async:!1});return Km.sanitize(o,{ALLOWED_TAGS:qm,ALLOWED_ATTR:Xm,ALLOWED_URI_REGEXP:Zm})}const Qm={class:"zm-note-panel"},ep={key:0,class:"zm-note-empty"},tp={class:"zm-note-header"},np={class:"zm-note-title-row"},op={class:"zm-note-name"},ip={class:"zm-note-meta"},rp={class:"zm-note-scroll"},lp={class:"zm-note-section"},ap={class:"zm-note-section-head"},sp={class:"zm-note-split"},cp=["disabled"],dp={key:0,class:"zm-note-preview"},up=["innerHTML"],fp={key:1,class:"zm-note-preview-hint"},mp={key:0,class:"zm-note-section-actions"},pp={key:0,class:"zm-note-add-row"},hp={key:1,class:"zm-note-section"},gp=["disabled"],bp=["href","title"],kp={key:2,class:"zm-note-section"},yp=["disabled"],Ep=["src","alt"],xp={key:3,class:"zm-note-section"},wp={class:"zm-note-section-head"},Np={key:0,class:"zm-note-section-tag"},Sp=["disabled"],Tp={key:0,class:"zm-note-code"},Cp=["innerHTML"],Mp={key:4,class:"zm-note-section"},Ap=["disabled"],_p={key:0,class:"zm-note-table"},Jo=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,i=o,a=e.ref(""),c=e.ref(null);gi(c,{minRows:4,maxRows:10});const s=e.computed(()=>!a.value||a.value.trim()===""),f=e.computed(()=>Jm(a.value)),d=e.ref(!0);function p(){d.value=!d.value}e.watch(()=>{var O,B,oe;return[(O=n.selectedNode)==null?void 0:O.id,(oe=(B=n.selectedNode)==null?void 0:B.note)==null?void 0:oe.text]},()=>{var O,B;a.value=((B=(O=n.selectedNode)==null?void 0:O.note)==null?void 0:B.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 B=O.value.length;O.setSelectionRange(B,B)}});function h(){var oe,te;if(n.readonly)return;const O=a.value,B=((te=(oe=n.selectedNode)==null?void 0:oe.note)==null?void 0:te.text)??"";O!==B&&i("apply",O)}function y(O){var B,oe;n.readonly||(O.key==="Escape"?(O.preventDefault(),a.value=((oe=(B=n.selectedNode)==null?void 0:B.note)==null?void 0:oe.text)??"",O.target.blur()):O.key==="Enter"&&(O.ctrlKey||O.metaKey)&&(O.preventDefault(),h(),O.target.blur()))}function C(){n.readonly||confirm("移除该节点的笔记?")&&(a.value="",i("remove"))}const D=e.computed(()=>{var O,B;return!!((B=(O=n.selectedNode)==null?void 0:O.link)!=null&&B.url)}),_=e.computed(()=>{var O,B;return!!((B=(O=n.selectedNode)==null?void 0:O.image)!=null&&B.src)}),F=e.computed(()=>{var O,B;return(B=(O=n.selectedNode)==null?void 0:O.richContent)==null?void 0:B.kind}),R=e.computed(()=>F.value==="code"),M=e.computed(()=>F.value==="table"),k=e.ref(!1),u=e.ref(!1),N=e.ref(!1),$=e.ref(!1);e.watch(()=>{var O;return(O=n.selectedNode)==null?void 0:O.id},()=>{k.value=!1,u.value=!1,N.value=!1,$.value=!1});const j=e.ref("");e.watch(()=>{var O,B,oe;return[(O=n.selectedNode)==null?void 0:O.id,(oe=(B=n.selectedNode)==null?void 0:B.link)==null?void 0:oe.url]},()=>{var O,B;j.value=((B=(O=n.selectedNode)==null?void 0:O.link)==null?void 0:B.url)??""},{immediate:!0});function q(){var oe,te;if(n.readonly)return;const O=j.value.trim(),B=((te=(oe=n.selectedNode)==null?void 0:oe.link)==null?void 0:te.url)??"";O!==B&&i("set-link",O)}const x=e.ref("");e.watch(()=>{var O,B,oe;return[(O=n.selectedNode)==null?void 0:O.id,(oe=(B=n.selectedNode)==null?void 0:B.image)==null?void 0:oe.src]},()=>{var O,B;x.value=((B=(O=n.selectedNode)==null?void 0:O.image)==null?void 0:B.src)??""},{immediate:!0});function ae(){var oe,te;if(n.readonly)return;const O=x.value.trim(),B=((te=(oe=n.selectedNode)==null?void 0:oe.image)==null?void 0:te.src)??"";O!==B&&i("set-image",O)}function fe(O){const B=O.target;B.style.display="none"}function me(O){const B=O.target;B.style.display=""}const J=e.ref(""),ge=e.ref(null);gi(ge,{minRows:4,maxRows:18}),e.watch(()=>{var O,B,oe;return[(O=n.selectedNode)==null?void 0:O.id,(oe=(B=n.selectedNode)==null?void 0:B.richContent)==null?void 0:oe.raw]},()=>{var O,B;J.value=((B=(O=n.selectedNode)==null?void 0:O.richContent)==null?void 0:B.raw)??""},{immediate:!0});const de=e.computed(()=>Ti(Go(J.value),Nn(J.value)));function ye(){var te,V;if(n.readonly)return;const O=J.value,B=((V=(te=n.selectedNode)==null?void 0:te.richContent)==null?void 0:V.raw)??"";if(O===B)return;const oe=Nn(O)||void 0;i("set-rich",O?{kind:"code",raw:O,lang:oe}:null)}const b=e.ref(""),L=e.ref(null);gi(L,{minRows:4,maxRows:14}),e.watch(()=>{var O,B,oe;return[(O=n.selectedNode)==null?void 0:O.id,(oe=(B=n.selectedNode)==null?void 0:B.richContent)==null?void 0:oe.raw]},()=>{var O,B;b.value=((B=(O=n.selectedNode)==null?void 0:O.richContent)==null?void 0:B.raw)??""},{immediate:!0});function G(){var oe,te;if(n.readonly)return;const O=b.value,B=((te=(oe=n.selectedNode)==null?void 0:oe.richContent)==null?void 0:te.raw)??"";O!==B&&i("set-rich",O?{kind:"table",raw:O}:null)}const ee=e.computed(()=>Ci(b.value)),be=e.computed(()=>{const O=[];return s.value||O.push(`${a.value.length} 字`),D.value&&O.push("1 链接"),_.value&&O.push("1 图片"),R.value&&O.push("代码块"),M.value&&O.push("表格"),O.length===0?"节点没有额外内容":O.join(" · ")});return(O,B)=>{var oe,te,V,w;return e.openBlock(),e.createElementBlock("div",Qm,[t.selectedNode?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",tp,[e.createElementVNode("div",np,[B[12]||(B[12]=e.createElementVNode("span",{class:"zm-note-label"},"节点",-1)),e.createElementVNode("span",op,e.toDisplayString(t.selectedNode.text||"(无标题)"),1)]),e.createElementVNode("div",ip,e.toDisplayString(be.value),1)]),e.createElementVNode("div",rp,[e.createElementVNode("section",lp,[e.createElementVNode("header",ap,[B[13]||(B[13]=e.createElementVNode("span",{class:"zm-note-section-title"},"笔记",-1)),B[14]||(B[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",sp,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"noteRef",ref:c,"onUpdate:modelValue":B[0]||(B[0]=P=>a.value=P),class:"zm-note-textarea",placeholder:"写点什么吧… 支持 Markdown",spellcheck:"false",disabled:t.readonly,onBlur:h,onKeydown:y},null,40,cp),[[e.vModelText,a.value]]),d.value?(e.openBlock(),e.createElementBlock("div",dp,[s.value?(e.openBlock(),e.createElementBlock("div",fp," 渲染后的 Markdown 仅在此面板显示,不会撑大节点框。 ")):(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-note-preview-body",innerHTML:f.value},null,8,up))])):e.createCommentVNode("",!0)]),!t.readonly&&!s.value?(e.openBlock(),e.createElementBlock("div",mp,[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",pp,[!D.value&&!k.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-note-add-chip",onClick:B[1]||(B[1]=P=>k.value=!0)},"+ 链接")):e.createCommentVNode("",!0),!_.value&&!u.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-note-add-chip",onClick:B[2]||(B[2]=P=>u.value=!0)},"+ 图片")):e.createCommentVNode("",!0),!R.value&&!N.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-note-add-chip",onClick:B[3]||(B[3]=P=>N.value=!0)},"+ 代码块")):e.createCommentVNode("",!0),!M.value&&!$.value?(e.openBlock(),e.createElementBlock("button",{key:3,class:"zm-note-add-chip",onClick:B[4]||(B[4]=P=>$.value=!0)},"+ 表格")):e.createCommentVNode("",!0)])),D.value||k.value?(e.openBlock(),e.createElementBlock("section",hp,[B[15]||(B[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":B[5]||(B[5]=P=>j.value=P),class:"zm-note-input",type:"url",placeholder:"https://…",disabled:t.readonly,onBlur:q,onKeydown:B[6]||(B[6]=e.withKeys(e.withModifiers(P=>P.target.blur(),["prevent"]),["enter"]))},null,40,gp),[[e.vModelText,j.value]]),D.value?(e.openBlock(),e.createElementBlock("a",{key:0,class:"zm-note-link-chip",href:(oe=t.selectedNode.link)==null?void 0:oe.url,target:"_blank",rel:"noopener noreferrer",title:(te=t.selectedNode.link)==null?void 0:te.url},e.toDisplayString((V=t.selectedNode.link)==null?void 0:V.url),9,bp)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),_.value||u.value?(e.openBlock(),e.createElementBlock("section",kp,[B[16]||(B[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":B[7]||(B[7]=P=>x.value=P),class:"zm-note-input",type:"url",placeholder:"data:image/… 或 https://…",disabled:t.readonly,onBlur:ae,onKeydown:B[8]||(B[8]=e.withKeys(e.withModifiers(P=>P.target.blur(),["prevent"]),["enter"]))},null,40,yp),[[e.vModelText,x.value]]),_.value?(e.openBlock(),e.createElementBlock("img",{key:0,class:"zm-note-image",src:(w=t.selectedNode.image)==null?void 0:w.src,alt:t.selectedNode.text,onError:fe,onLoad:me},null,40,Ep)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),R.value||N.value?(e.openBlock(),e.createElementBlock("section",xp,[e.createElementVNode("header",wp,[B[17]||(B[17]=e.createElementVNode("span",{class:"zm-note-section-title"},"代码块",-1)),e.unref(Nn)(J.value)?(e.openBlock(),e.createElementBlock("span",Np,e.toDisplayString(e.unref(Nn)(J.value)),1)):e.createCommentVNode("",!0)]),e.withDirectives(e.createElementVNode("textarea",{ref_key:"codeRef",ref:ge,"onUpdate:modelValue":B[9]||(B[9]=P=>J.value=P),class:"zm-note-input zm-note-input-code",placeholder:"```ts\nconsole.log(123)\n```",spellcheck:"false",disabled:t.readonly,onBlur:ye},null,40,Sp),[[e.vModelText,J.value]]),J.value.trim()?(e.openBlock(),e.createElementBlock("pre",Tp,[e.createElementVNode("code",{innerHTML:de.value},null,8,Cp)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),M.value||$.value?(e.openBlock(),e.createElementBlock("section",Mp,[B[18]||(B[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:L,"onUpdate:modelValue":B[10]||(B[10]=P=>b.value=P),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 i=this.parser.parseInline(n),a=Sl(t);if(a===null)return i;t=a;let c='<a href="'+t+'"';return o&&(c+=' title="'+qt(o)+'"'),c+=">"+i+"</a>",c}image({href:t,title:o,text:n,tokens:i}){i&&(n=this.parser.parseInline(i,this.parser.textRenderer));let a=Sl(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)}},Vi=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}},Wt=class rr{constructor(o){Ve(this,"options");Ve(this,"renderer");Ve(this,"textRenderer");this.options=o||Nn,this.options.renderer=this.options.renderer||new co,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Vi}static parse(o,n){return new rr(n).parse(o)}static parseInline(o,n){return new rr(n).parseInline(o)}parse(o){var i,a;this.renderer.parser=this;let n="";for(let c=0;c<o.length;c++){let s=o[c];if((a=(i=this.options.extensions)==null?void 0:i.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 i="";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)){i+=p||"";continue}}let d=u;switch(d.type){case"escape":{i+=n.text(d);break}case"html":{i+=n.html(d);break}case"link":{i+=n.link(d);break}case"image":{i+=n.image(d);break}case"checkbox":{i+=n.checkbox(d);break}case"strong":{i+=n.strong(d);break}case"em":{i+=n.em(d);break}case"codespan":{i+=n.codespan(d);break}case"br":{i+=n.br(d);break}case"del":{i+=n.del(d);break}case"text":{i+=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 i}},uo=(ei=class{constructor(t){Ve(this,"options");Ve(this,"block");this.options=t||Nn}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?Ht.lex:Ht.lexInline}provideParser(t=this.block){return t?Wt.parse:Wt.parseInline}},Ve(ei,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),Ve(ei,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),ei),Al=class{constructor(...t){Ve(this,"defaults",_i());Ve(this,"options",this.setOptions);Ve(this,"parse",this.parseMarkdown(!0));Ve(this,"parseInline",this.parseMarkdown(!1));Ve(this,"Parser",Wt);Ve(this,"Renderer",co);Ve(this,"TextRenderer",Vi);Ve(this,"Lexer",Ht);Ve(this,"Tokenizer",Xo);Ve(this,"Hooks",uo);this.use(...t)}walkTokens(t,o){var i,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=(i=this.defaults.extensions)==null?void 0:i.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 i={...n};if(i.async=this.defaults.async||i.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)}),i.extensions=o),n.renderer){let a=this.defaults.renderer||new co(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 h=u.apply(a,p);return h===!1&&(h=d.apply(a,p)),h||""}}i.renderer=a}if(n.tokenizer){let a=this.defaults.tokenizer||new Xo(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 h=u.apply(a,p);return h===!1&&(h=d.apply(a,p)),h}}i.tokenizer=a}if(n.hooks){let a=this.defaults.hooks||new uo;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];uo.passThroughHooks.has(c)?a[s]=p=>{if(this.defaults.async&&uo.passThroughHooksRespectAsync.has(c))return(async()=>{let x=await u.call(a,p);return d.call(a,x)})();let h=u.call(a,p);return d.call(a,h)}:a[s]=(...p)=>{if(this.defaults.async)return(async()=>{let x=await u.apply(a,p);return x===!1&&(x=await d.apply(a,p)),x})();let h=u.apply(a,p);return h===!1&&(h=d.apply(a,p)),h}}i.hooks=a}if(n.walkTokens){let a=this.defaults.walkTokens,c=n.walkTokens;i.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,...i}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,o){return Ht.lex(t,o??this.defaults)}parser(t,o){return Wt.parse(t,o??this.defaults)}parseMarkdown(t){return(o,n)=>{let i={...n},a={...this.defaults,...i},c=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&i.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?Ht.lex:Ht.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?Wt.parse:Wt.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?Ht.lex:Ht.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?Wt.parse:Wt.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 i="<p>An error occurred:</p><pre>"+qt(n.message+"",!0)+"</pre>";return o?Promise.resolve(i):i}if(o)return Promise.reject(n);throw n}}},Tn=new Al;function De(t,o){return Tn.parse(t,o)}De.options=De.setOptions=function(t){return Tn.setOptions(t),De.defaults=Tn.defaults,ul(De.defaults),De},De.getDefaults=_i,De.defaults=Nn,De.use=function(...t){return Tn.use(...t),De.defaults=Tn.defaults,ul(De.defaults),De},De.walkTokens=function(t,o){return Tn.walkTokens(t,o)},De.parseInline=Tn.parseInline,De.Parser=Wt,De.parser=Wt.parse,De.Renderer=co,De.TextRenderer=Vi,De.Lexer=Ht,De.lexer=Ht.lex,De.Tokenizer=Xo,De.Hooks=uo,De.parse=De,De.options,De.setOptions,De.use,De.walkTokens,De.parseInline,Wt.parse,Ht.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 _l(t,o){(o==null||o>t.length)&&(o=t.length);for(var n=0,i=Array(o);n<o;n++)i[n]=t[n];return i}function ym(t){if(Array.isArray(t))return t}function Em(t,o){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var i,a,c,s,u=[],d=!0,p=!1;try{if(c=(n=n.call(t)).next,o!==0)for(;!(d=(i=c.call(n)).done)&&(u.push(i.value),u.length!==o);d=!0);}catch(h){p=!0,a=h}finally{try{if(!d&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(p)throw a}}return u}}function xm(){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 wm(t,o){return ym(t)||Em(t,o)||Nm(t,o)||xm()}function Nm(t,o){if(t){if(typeof t=="string")return _l(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)?_l(t,o):void 0}}const Rl=Object.entries,Bl=Object.setPrototypeOf,Sm=Object.isFrozen,Tm=Object.getPrototypeOf,Cm=Object.getOwnPropertyDescriptor;let gt=Object.freeze,Lt=Object.seal,Un=Object.create,vl=typeof Reflect<"u"&&Reflect,$i=vl.apply,Pi=vl.construct;gt||(gt=function(o){return o}),Lt||(Lt=function(o){return o}),$i||($i=function(o,n){for(var i=arguments.length,a=new Array(i>2?i-2:0),c=2;c<i;c++)a[c-2]=arguments[c];return o.apply(n,a)}),Pi||(Pi=function(o){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];return new o(...i)});const Cn=Je(Array.prototype.forEach),Mm=Je(Array.prototype.lastIndexOf),Il=Je(Array.prototype.pop),Hn=Je(Array.prototype.push),Am=Je(Array.prototype.splice),bt=Array.isArray,fo=Je(String.prototype.toLowerCase),Fi=Je(String.prototype.toString),zl=Je(String.prototype.match),Wn=Je(String.prototype.replace),Ol=Je(String.prototype.indexOf),_m=Je(String.prototype.trim),Rm=Je(Number.prototype.toString),Bm=Je(Boolean.prototype.toString),Ll=typeof BigInt>"u"?null:Je(BigInt.prototype.toString),Dl=typeof Symbol>"u"?null:Je(Symbol.prototype.toString),Ge=Je(Object.prototype.hasOwnProperty),mo=Je(Object.prototype.toString),rt=Je(RegExp.prototype.test),Gn=vm(TypeError);function Je(t){return function(o){o instanceof RegExp&&(o.lastIndex=0);for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];return $i(t,o,i)}}function vm(t){return function(){for(var o=arguments.length,n=new Array(o),i=0;i<o;i++)n[i]=arguments[i];return Pi(t,n)}}function Ne(t,o){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:fo;if(Bl&&Bl(t,null),!bt(o))return t;let i=o.length;for(;i--;){let a=o[i];if(typeof a=="string"){const c=n(a);c!==a&&(Sm(o)||(o[i]=c),a=c)}t[a]=!0}return t}function Im(t){for(let o=0;o<t.length;o++)Ge(t,o)||(t[o]=null);return t}function dt(t){const o=Un(null);for(const i of Rl(t)){var n=wm(i,2);const a=n[0],c=n[1];Ge(t,a)&&(bt(c)?o[a]=Im(c):c&&typeof c=="object"&&c.constructor===Object?o[a]=dt(c):o[a]=c)}return o}function zm(t){switch(typeof t){case"string":return t;case"number":return Rm(t);case"boolean":return Bm(t);case"bigint":return Ll?Ll(t):"0";case"symbol":return Dl?Dl(t):"Symbol()";case"undefined":return mo(t);case"function":case"object":{if(t===null)return mo(t);const o=t,n=Xt(o,"toString");if(typeof n=="function"){const i=n(o);return typeof i=="string"?i:mo(i)}return mo(t)}default:return mo(t)}}function Xt(t,o){for(;t!==null;){const i=Cm(t,o);if(i){if(i.get)return Je(i.get);if(typeof i.value=="function")return Je(i.value)}t=Tm(t)}function n(){return null}return n}function Om(t){try{return rt(t,""),!0}catch{return!1}}const Vl=gt(["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"]),Ui=gt(["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"]),Hi=gt(["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"]),Lm=gt(["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"]),Wi=gt(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Dm=gt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),$l=gt(["#text"]),Pl=gt(["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"]),Gi=gt(["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"]),Fl=gt(["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"]),Zo=gt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Vm=Lt(/{{[\w\W]*|^[\w\W]*}}/g),$m=Lt(/<%[\w\W]*|^[\w\W]*%>/g),Pm=Lt(/\${[\w\W]*/g),Fm=Lt(/^data-[\-\w.\u00B7-\uFFFF]+$/),Um=Lt(/^aria-[\-\w]+$/),Ul=Lt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Hm=Lt(/^(?:\w+script|data):/i),Wm=Lt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Gm=Lt(/^html$/i),jm=Lt(/^[a-z][.\w]*(-[.\w]+)+$/i),Zt={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Km=function(){return typeof window>"u"?null:window},Ym=function(o,n){if(typeof o!="object"||typeof o.createPolicy!="function")return null;let i=null;const a="data-tt-policy-suffix";n&&n.hasAttribute(a)&&(i=n.getAttribute(a));const c="dompurify"+(i?"#"+i:"");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}},Hl=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Wl(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Km();const o=_=>Wl(_);if(o.version="3.4.8",o.removed=[],!t||!t.document||t.document.nodeType!==Zt.document||!t.Element)return o.isSupported=!1,o;let n=t.document;const i=n,a=i.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 h=t.DOMParser,x=t.trustedTypes,C=u.prototype,$=Xt(C,"cloneNode"),R=Xt(C,"remove"),F=Xt(C,"nextSibling"),O=Xt(C,"childNodes"),A=Xt(C,"parentNode"),y=Xt(C,"shadowRoot"),k=Xt(C,"attributes"),m=s&&s.prototype?Xt(s.prototype,"nodeType"):null,P=s&&s.prototype?Xt(s.prototype,"nodeName"):null;if(typeof c=="function"){const _=n.createElement("template");_.content&&_.content.ownerDocument&&(n=_.content.ownerDocument)}let G,q="",w=0;const ie=function(g){if(w>0)throw Gn('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.');w++;try{return G.createHTML(g)}finally{w--}},fe=n,ce=fe.implementation,J=fe.createNodeIterator,me=fe.createDocumentFragment,ae=fe.getElementsByTagName,ke=i.importNode;let b=Hl();o.isSupported=typeof Rl=="function"&&typeof A=="function"&&ce&&ce.createHTMLDocument!==void 0;const V=Vm,W=$m,ee=Pm,ge=Fm,D=Um,z=Hm,le=Wm,be=jm;let I=Ul,N=null;const U=Ne({},[...Vl,...Ui,...Hi,...Wi,...$l]);let H=null;const oe=Ne({},[...Pl,...Gi,...Fl,...Zo]);let Ee=Object.seal(Un(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),et=null,ut=null;const tt=Object.seal(Un(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let nn=!0,nt=!0,on=!1,Dt=!0,ue=!1,ft=!0,ze=!1,Be=!1,Vt=!1,ot=!1,xt=!1,kt=!1,X=!0,re=!1;const xe="user-content-";let Ae=!0,Ue=!1,it={},wt=null;const An=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 ti=null;const ni=Ne({},["audio","video","img","source","image","track"]);let po=null;const oi=Ne({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Kn="http://www.w3.org/1998/Math/MathML",Yn="http://www.w3.org/2000/svg",$t="http://www.w3.org/1999/xhtml";let pn=$t,ho=!1,go=null;const ji=Ne({},[Kn,Yn,$t],Fi);let bo=Ne({},["mi","mo","mn","ms","mtext"]),ko=Ne({},["annotation-xml"]);const Ki=Ne({},["title","style","font","a","script"]);let _n=null;const ii=["application/xhtml+xml","text/html"],Yi="text/html";let He=null,hn=null;const ri=n.createElement("form"),li=function(g){return g instanceof RegExp||g instanceof Function},qn=function(){let g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(hn&&hn===g)return;(!g||typeof g!="object")&&(g={}),g=dt(g),_n=ii.indexOf(g.PARSER_MEDIA_TYPE)===-1?Yi:g.PARSER_MEDIA_TYPE,He=_n==="application/xhtml+xml"?Fi:fo,N=Ge(g,"ALLOWED_TAGS")&&bt(g.ALLOWED_TAGS)?Ne({},g.ALLOWED_TAGS,He):U,H=Ge(g,"ALLOWED_ATTR")&&bt(g.ALLOWED_ATTR)?Ne({},g.ALLOWED_ATTR,He):oe,go=Ge(g,"ALLOWED_NAMESPACES")&&bt(g.ALLOWED_NAMESPACES)?Ne({},g.ALLOWED_NAMESPACES,Fi):ji,po=Ge(g,"ADD_URI_SAFE_ATTR")&&bt(g.ADD_URI_SAFE_ATTR)?Ne(dt(oi),g.ADD_URI_SAFE_ATTR,He):oi,ti=Ge(g,"ADD_DATA_URI_TAGS")&&bt(g.ADD_DATA_URI_TAGS)?Ne(dt(ni),g.ADD_DATA_URI_TAGS,He):ni,wt=Ge(g,"FORBID_CONTENTS")&&bt(g.FORBID_CONTENTS)?Ne({},g.FORBID_CONTENTS,He):An,et=Ge(g,"FORBID_TAGS")&&bt(g.FORBID_TAGS)?Ne({},g.FORBID_TAGS,He):dt({}),ut=Ge(g,"FORBID_ATTR")&&bt(g.FORBID_ATTR)?Ne({},g.FORBID_ATTR,He):dt({}),it=Ge(g,"USE_PROFILES")?g.USE_PROFILES&&typeof g.USE_PROFILES=="object"?dt(g.USE_PROFILES):g.USE_PROFILES:!1,nn=g.ALLOW_ARIA_ATTR!==!1,nt=g.ALLOW_DATA_ATTR!==!1,on=g.ALLOW_UNKNOWN_PROTOCOLS||!1,Dt=g.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ue=g.SAFE_FOR_TEMPLATES||!1,ft=g.SAFE_FOR_XML!==!1,ze=g.WHOLE_DOCUMENT||!1,ot=g.RETURN_DOM||!1,xt=g.RETURN_DOM_FRAGMENT||!1,kt=g.RETURN_TRUSTED_TYPE||!1,Vt=g.FORCE_BODY||!1,X=g.SANITIZE_DOM!==!1,re=g.SANITIZE_NAMED_PROPS||!1,Ae=g.KEEP_CONTENT!==!1,Ue=g.IN_PLACE||!1,I=Om(g.ALLOWED_URI_REGEXP)?g.ALLOWED_URI_REGEXP:Ul,pn=typeof g.NAMESPACE=="string"?g.NAMESPACE:$t,bo=Ge(g,"MATHML_TEXT_INTEGRATION_POINTS")&&g.MATHML_TEXT_INTEGRATION_POINTS&&typeof g.MATHML_TEXT_INTEGRATION_POINTS=="object"?dt(g.MATHML_TEXT_INTEGRATION_POINTS):Ne({},["mi","mo","mn","ms","mtext"]),ko=Ge(g,"HTML_INTEGRATION_POINTS")&&g.HTML_INTEGRATION_POINTS&&typeof g.HTML_INTEGRATION_POINTS=="object"?dt(g.HTML_INTEGRATION_POINTS):Ne({},["annotation-xml"]);const L=Ge(g,"CUSTOM_ELEMENT_HANDLING")&&g.CUSTOM_ELEMENT_HANDLING&&typeof g.CUSTOM_ELEMENT_HANDLING=="object"?dt(g.CUSTOM_ELEMENT_HANDLING):Un(null);if(Ee=Un(null),Ge(L,"tagNameCheck")&&li(L.tagNameCheck)&&(Ee.tagNameCheck=L.tagNameCheck),Ge(L,"attributeNameCheck")&&li(L.attributeNameCheck)&&(Ee.attributeNameCheck=L.attributeNameCheck),Ge(L,"allowCustomizedBuiltInElements")&&typeof L.allowCustomizedBuiltInElements=="boolean"&&(Ee.allowCustomizedBuiltInElements=L.allowCustomizedBuiltInElements),ue&&(nt=!1),xt&&(ot=!0),it&&(N=Ne({},$l),H=Un(null),it.html===!0&&(Ne(N,Vl),Ne(H,Pl)),it.svg===!0&&(Ne(N,Ui),Ne(H,Gi),Ne(H,Zo)),it.svgFilters===!0&&(Ne(N,Hi),Ne(H,Gi),Ne(H,Zo)),it.mathMl===!0&&(Ne(N,Wi),Ne(H,Fl),Ne(H,Zo))),tt.tagCheck=null,tt.attributeCheck=null,Ge(g,"ADD_TAGS")&&(typeof g.ADD_TAGS=="function"?tt.tagCheck=g.ADD_TAGS:bt(g.ADD_TAGS)&&(N===U&&(N=dt(N)),Ne(N,g.ADD_TAGS,He))),Ge(g,"ADD_ATTR")&&(typeof g.ADD_ATTR=="function"?tt.attributeCheck=g.ADD_ATTR:bt(g.ADD_ATTR)&&(H===oe&&(H=dt(H)),Ne(H,g.ADD_ATTR,He))),Ge(g,"ADD_URI_SAFE_ATTR")&&bt(g.ADD_URI_SAFE_ATTR)&&Ne(po,g.ADD_URI_SAFE_ATTR,He),Ge(g,"FORBID_CONTENTS")&&bt(g.FORBID_CONTENTS)&&(wt===An&&(wt=dt(wt)),Ne(wt,g.FORBID_CONTENTS,He)),Ge(g,"ADD_FORBID_CONTENTS")&&bt(g.ADD_FORBID_CONTENTS)&&(wt===An&&(wt=dt(wt)),Ne(wt,g.ADD_FORBID_CONTENTS,He)),Ae&&(N["#text"]=!0),ze&&Ne(N,["html","head","body"]),N.table&&(Ne(N,["tbody"]),delete et.tbody),g.TRUSTED_TYPES_POLICY){if(typeof g.TRUSTED_TYPES_POLICY.createHTML!="function")throw Gn('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof g.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Gn('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const Z=G;G=g.TRUSTED_TYPES_POLICY;try{q=ie("")}catch(ve){throw G=Z,ve}}else G===void 0&&g.TRUSTED_TYPES_POLICY!==null&&(G=Ym(x,a)),G&&typeof q=="string"&&(q=ie(""));(b.uponSanitizeElement.length>0||b.uponSanitizeAttribute.length>0)&&N===U&&(N=dt(N)),b.uponSanitizeAttribute.length>0&&H===oe&&(H=dt(H)),gt&&gt(g),hn=g},yo=Ne({},[...Ui,...Hi,...Lm]),gn=Ne({},[...Wi,...Dm]),qi=function(g){let L=A(g);(!L||!L.tagName)&&(L={namespaceURI:pn,tagName:"template"});const Z=fo(g.tagName),ve=fo(L.tagName);return go[g.namespaceURI]?g.namespaceURI===Yn?L.namespaceURI===$t?Z==="svg":L.namespaceURI===Kn?Z==="svg"&&(ve==="annotation-xml"||bo[ve]):!!yo[Z]:g.namespaceURI===Kn?L.namespaceURI===$t?Z==="math":L.namespaceURI===Yn?Z==="math"&&ko[ve]:!!gn[Z]:g.namespaceURI===$t?L.namespaceURI===Yn&&!ko[ve]||L.namespaceURI===Kn&&!bo[ve]?!1:!gn[Z]&&(Ki[Z]||!yo[Z]):!!(_n==="application/xhtml+xml"&&go[g.namespaceURI]):!1},Mt=function(g){Hn(o.removed,{element:g});try{A(g).removeChild(g)}catch{R(g)}},Jt=function(g,L){try{Hn(o.removed,{attribute:L.getAttributeNode(g),from:L})}catch{Hn(o.removed,{attribute:null,from:L})}if(L.removeAttribute(g),g==="is")if(ot||xt)try{Mt(L)}catch{}else try{L.setAttribute(g,"")}catch{}},Eo=function(g){let L=null,Z=null;if(Vt)g="<remove></remove>"+g;else{const Le=zl(g,/^[\r\n\t ]+/);Z=Le&&Le[0]}_n==="application/xhtml+xml"&&pn===$t&&(g='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+g+"</body></html>");const ve=G?ie(g):g;if(pn===$t)try{L=new h().parseFromString(ve,_n)}catch{}if(!L||!L.documentElement){L=ce.createDocument(pn,"template",null);try{L.documentElement.innerHTML=ho?q:ve}catch{}}const we=L.body||L.documentElement;return g&&Z&&we.insertBefore(n.createTextNode(Z),we.childNodes[0]||null),pn===$t?ae.call(L,ze?"html":"body")[0]:ze?L.documentElement:we},Xn=function(g){return J.call(g.ownerDocument||g,g,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},Rn=function(g){var L,Z;g.normalize();const ve=J.call(g.ownerDocument||g,g,d.SHOW_TEXT|d.SHOW_COMMENT|d.SHOW_CDATA_SECTION|d.SHOW_PROCESSING_INSTRUCTION,null);let we=ve.nextNode();for(;we;){let Xe=we.data;Cn([V,W,ee],yt=>{Xe=Wn(Xe,yt," ")}),we.data=Xe,we=ve.nextNode()}const Le=(L=(Z=g.querySelectorAll)===null||Z===void 0?void 0:Z.call(g,"template"))!==null&&L!==void 0?L:[];Cn(Array.from(Le),Xe=>{bn(Xe.content)&&Rn(Xe.content)})},Zn=function(g){const L=P?P(g):null;return typeof L!="string"||He(L)!=="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!==O(g)},bn=function(g){if(!m||typeof g!="object"||g===null)return!1;try{return m(g)===Zt.documentFragment}catch{return!1}},Jn=function(g){if(!m||typeof g!="object"||g===null)return!1;try{return typeof m(g)=="number"}catch{return!1}};function At(_,g,L){Cn(_,Z=>{Z.call(o,g,L,hn)})}const Qn=function(g){let L=null;if(At(b.beforeSanitizeElements,g,null),Zn(g))return Mt(g),!0;const Z=He(P?P(g):g.nodeName);if(At(b.uponSanitizeElement,g,{tagName:Z,allowedTags:N}),ft&&g.hasChildNodes()&&!Jn(g.firstElementChild)&&rt(/<[/\w!]/g,g.innerHTML)&&rt(/<[/\w!]/g,g.textContent)||ft&&g.namespaceURI===$t&&Z==="style"&&Jn(g.firstElementChild)||g.nodeType===Zt.progressingInstruction||ft&&g.nodeType===Zt.comment&&rt(/<[/\w]/g,g.data))return Mt(g),!0;if(et[Z]||!(tt.tagCheck instanceof Function&&tt.tagCheck(Z))&&!N[Z]){if(!et[Z]&&Se(Z)&&(Ee.tagNameCheck instanceof RegExp&&rt(Ee.tagNameCheck,Z)||Ee.tagNameCheck instanceof Function&&Ee.tagNameCheck(Z)))return!1;if(Ae&&!wt[Z]){const we=A(g),Le=O(g);if(Le&&we){const Xe=Le.length;for(let yt=Xe-1;yt>=0;--yt){const mt=$(Le[yt],!0);we.insertBefore(mt,F(g))}}}return Mt(g),!0}return(m?m(g):g.nodeType)===Zt.element&&!qi(g)||(Z==="noscript"||Z==="noembed"||Z==="noframes")&&rt(/<\/no(script|embed|frames)/i,g.innerHTML)?(Mt(g),!0):(ue&&g.nodeType===Zt.text&&(L=g.textContent,Cn([V,W,ee],we=>{L=Wn(L,we," ")}),g.textContent!==L&&(Hn(o.removed,{element:g.cloneNode()}),g.textContent=L)),At(b.afterSanitizeElements,g,null),!1)},Gt=function(g,L,Z){if(ut[L]||X&&(L==="id"||L==="name")&&(Z in n||Z in ri))return!1;const ve=H[L]||tt.attributeCheck instanceof Function&&tt.attributeCheck(L,g);if(!(nt&&!ut[L]&&rt(ge,L))){if(!(nn&&rt(D,L))){if(!ve||ut[L]){if(!(Se(g)&&(Ee.tagNameCheck instanceof RegExp&&rt(Ee.tagNameCheck,g)||Ee.tagNameCheck instanceof Function&&Ee.tagNameCheck(g))&&(Ee.attributeNameCheck instanceof RegExp&&rt(Ee.attributeNameCheck,L)||Ee.attributeNameCheck instanceof Function&&Ee.attributeNameCheck(L,g))||L==="is"&&Ee.allowCustomizedBuiltInElements&&(Ee.tagNameCheck instanceof RegExp&&rt(Ee.tagNameCheck,Z)||Ee.tagNameCheck instanceof Function&&Ee.tagNameCheck(Z))))return!1}else if(!po[L]){if(!rt(I,Wn(Z,le,""))){if(!((L==="src"||L==="xlink:href"||L==="href")&&g!=="script"&&Ol(Z,"data:")===0&&ti[g])){if(!(on&&!rt(z,Wn(Z,le,"")))){if(Z)return!1}}}}}}return!0},Oe=Ne({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Se=function(g){return!Oe[fo(g)]&&rt(be,g)},ai=function(g){At(b.beforeSanitizeAttributes,g,null);const L=g.attributes;if(!L||Zn(g))return;const Z={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:H,forceKeepAttr:void 0};let ve=L.length;for(;ve--;){const we=L[ve],Le=we.name,Xe=we.namespaceURI,yt=we.value,mt=He(Le),xo=yt;let Ze=Le==="value"?xo:_m(xo);if(Z.attrName=mt,Z.attrValue=Ze,Z.keepAttr=!0,Z.forceKeepAttr=void 0,At(b.uponSanitizeAttribute,g,Z),Ze=Z.attrValue,re&&(mt==="id"||mt==="name")&&Ol(Ze,xe)!==0&&(Jt(Le,g),Ze=xe+Ze),ft&&rt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Ze)){Jt(Le,g);continue}if(mt==="attributename"&&zl(Ze,"href")){Jt(Le,g);continue}if(Z.forceKeepAttr)continue;if(!Z.keepAttr){Jt(Le,g);continue}if(!Dt&&rt(/\/>/i,Ze)){Jt(Le,g);continue}ue&&Cn([V,W,ee],wo=>{Ze=Wn(Ze,wo," ")});const en=He(g.nodeName);if(!Gt(en,mt,Ze)){Jt(Le,g);continue}if(G&&typeof x=="object"&&typeof x.getAttributeType=="function"&&!Xe)switch(x.getAttributeType(en,mt)){case"TrustedHTML":{Ze=ie(Ze);break}case"TrustedScriptURL":{Ze=G.createScriptURL(Ze);break}}if(Ze!==xo)try{Xe?g.setAttributeNS(Xe,Le,Ze):g.setAttribute(Le,Ze),Zn(g)?Mt(g):Il(o.removed)}catch{Jt(Le,g)}}At(b.afterSanitizeAttributes,g,null)},lt=function(g){let L=null;const Z=Xn(g);for(At(b.beforeSanitizeShadowDOM,g,null);L=Z.nextNode();)if(At(b.uponSanitizeShadowNode,L,null),Qn(L),ai(L),bn(L.content)&&lt(L.content),(m?m(L):L.nodeType)===Zt.element){const we=y?y(L):L.shadowRoot;bn(we)&&(Qt(we),lt(we))}At(b.afterSanitizeShadowDOM,g,null)},Qt=function(g){const L=m?m(g):g.nodeType;if(L===Zt.element){const we=y?y(g):g.shadowRoot;bn(we)&&(Qt(we),lt(we))}const Z=O?O(g):g.childNodes;if(!Z)return;const ve=[];Cn(Z,we=>{Hn(ve,we)});for(const we of ve)Qt(we);if(L===Zt.element){const we=P?P(g):null;if(typeof we=="string"&&He(we)==="template"){const Le=g.content;bn(Le)&&Qt(Le)}}};return o.sanitize=function(_){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},L=null,Z=null,ve=null,we=null;if(ho=!_,ho&&(_="<!-->"),typeof _!="string"&&!Jn(_)&&(_=zm(_),typeof _!="string"))throw Gn("dirty is not a string, aborting");if(!o.isSupported)return _;if(Be||qn(g),o.removed=[],typeof _=="string"&&(Ue=!1),Ue){const yt=P?P(_):_.nodeName;if(typeof yt=="string"){const mt=He(yt);if(!N[mt]||et[mt])throw Gn("root node is forbidden and cannot be sanitized in-place")}if(Zn(_))throw Gn("root node is clobbered and cannot be sanitized in-place");Qt(_)}else if(Jn(_))L=Eo("<!---->"),Z=L.ownerDocument.importNode(_,!0),Z.nodeType===Zt.element&&Z.nodeName==="BODY"||Z.nodeName==="HTML"?L=Z:L.appendChild(Z),Qt(Z);else{if(!ot&&!ue&&!ze&&_.indexOf("<")===-1)return G&&kt?ie(_):_;if(L=Eo(_),!L)return ot?null:kt?q:""}L&&Vt&&Mt(L.firstChild);const Le=Xn(Ue?_:L);for(;ve=Le.nextNode();)Qn(ve),ai(ve),bn(ve.content)&&lt(ve.content);if(Ue)return ue&&Rn(_),_;if(ot){if(ue&&Rn(L),xt)for(we=me.call(L.ownerDocument);L.firstChild;)we.appendChild(L.firstChild);else we=L;return(H.shadowroot||H.shadowrootmode)&&(we=ke.call(i,we,!0)),we}let Xe=ze?L.outerHTML:L.innerHTML;return ze&&N["!doctype"]&&L.ownerDocument&&L.ownerDocument.doctype&&L.ownerDocument.doctype.name&&rt(Gm,L.ownerDocument.doctype.name)&&(Xe="<!DOCTYPE "+L.ownerDocument.doctype.name+`>
129
+ `+Xe),ue&&Cn([V,W,ee],yt=>{Xe=Wn(Xe,yt," ")}),G&&kt?ie(Xe):Xe},o.setConfig=function(){let _=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};qn(_),Be=!0},o.clearConfig=function(){hn=null,Be=!1},o.isValidAttribute=function(_,g,L){hn||qn({});const Z=He(_),ve=He(g);return Gt(Z,ve,L)},o.addHook=function(_,g){typeof g=="function"&&Hn(b[_],g)},o.removeHook=function(_,g){if(g!==void 0){const L=Mm(b[_],g);return L===-1?void 0:Am(b[_],L,1)[0]}return Il(b[_])},o.removeHooks=function(_){b[_]=[]},o.removeAllHooks=function(){b=Hl()},o}var qm=Wl();const Xm=new Al({gfm:!0,breaks:!0,pedantic:!1,renderer:(()=>{const t=new co;return t.code=({text:o,lang:n})=>{const i=(n??"").toLowerCase(),a=Mi(o,i);return`<pre><code${i?` class="language-${i}"`:""}>${a}</code></pre>`},t})()}),Zm=["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"],Jm=["href","title","target","rel","src","alt","class","checked","type","disabled"],Qm=/^(?:(?:https?|mailto|tel|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i;function ep(t){if(!t)return"";const o=Xm.parse(t,{async:!1});return qm.sanitize(o,{ALLOWED_TAGS:Zm,ALLOWED_ATTR:Jm,ALLOWED_URI_REGEXP:Qm})}const tp={class:"zm-note-panel"},np={key:0,class:"zm-note-empty"},op={class:"zm-note-header"},ip={class:"zm-note-title-row"},rp={class:"zm-note-name"},lp={class:"zm-note-meta"},ap={class:"zm-note-scroll"},sp={class:"zm-note-section"},cp={class:"zm-note-section-head"},dp={class:"zm-note-split"},up=["disabled"],fp={key:0,class:"zm-note-preview"},mp=["innerHTML"],pp={key:1,class:"zm-note-preview-hint"},hp={key:0,class:"zm-note-section-actions"},gp={key:0,class:"zm-note-add-row"},bp={key:1,class:"zm-note-section"},kp=["disabled"],yp=["href","title"],Ep={key:2,class:"zm-note-section"},xp=["disabled"],wp=["src","alt"],Np={key:3,class:"zm-note-section"},Sp={class:"zm-note-section-head"},Tp={key:0,class:"zm-note-section-tag"},Cp=["disabled"],Mp={key:0,class:"zm-note-code"},Ap=["innerHTML"],_p={key:4,class:"zm-note-section"},Rp=["disabled"],Bp={key:0,class:"zm-note-table"},Jo=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,i=o,a=e.ref(""),c=e.ref(null);ki(c,{minRows:4,maxRows:10});const s=e.computed(()=>!a.value||a.value.trim()===""),u=e.computed(()=>ep(a.value)),d=e.ref(!0);function p(){d.value=!d.value}e.watch(()=>{var D,z,le;return[(D=n.selectedNode)==null?void 0:D.id,(le=(z=n.selectedNode)==null?void 0:z.note)==null?void 0:le.text]},()=>{var D,z;a.value=((z=(D=n.selectedNode)==null?void 0:D.note)==null?void 0:z.text)??""},{immediate:!0}),e.watch(()=>n.focusTick,async()=>{if(n.readonly)return;await e.nextTick();const D=document.querySelector(".zm-note-panel textarea.zm-note-textarea");if(D){D.focus();const z=D.value.length;D.setSelectionRange(z,z)}});function h(){var le,be;if(n.readonly)return;const D=a.value,z=((be=(le=n.selectedNode)==null?void 0:le.note)==null?void 0:be.text)??"";D!==z&&i("apply",D)}function x(D){var z,le;n.readonly||(D.key==="Escape"?(D.preventDefault(),a.value=((le=(z=n.selectedNode)==null?void 0:z.note)==null?void 0:le.text)??"",D.target.blur()):D.key==="Enter"&&(D.ctrlKey||D.metaKey)&&(D.preventDefault(),h(),D.target.blur()))}function C(){n.readonly||confirm("移除该节点的笔记?")&&(a.value="",i("remove"))}const $=e.computed(()=>{var D,z;return!!((z=(D=n.selectedNode)==null?void 0:D.link)!=null&&z.url)}),R=e.computed(()=>{var D,z;return!!((z=(D=n.selectedNode)==null?void 0:D.image)!=null&&z.src)}),F=e.computed(()=>{var D,z;return(z=(D=n.selectedNode)==null?void 0:D.richContent)==null?void 0:z.kind}),O=e.computed(()=>F.value==="code"),A=e.computed(()=>F.value==="table"),y=e.ref(!1),k=e.ref(!1),m=e.ref(!1),P=e.ref(!1);e.watch(()=>{var D;return(D=n.selectedNode)==null?void 0:D.id},()=>{y.value=!1,k.value=!1,m.value=!1,P.value=!1});const G=e.ref("");e.watch(()=>{var D,z,le;return[(D=n.selectedNode)==null?void 0:D.id,(le=(z=n.selectedNode)==null?void 0:z.link)==null?void 0:le.url]},()=>{var D,z;G.value=((z=(D=n.selectedNode)==null?void 0:D.link)==null?void 0:z.url)??""},{immediate:!0});function q(){var le,be;if(n.readonly)return;const D=G.value.trim(),z=((be=(le=n.selectedNode)==null?void 0:le.link)==null?void 0:be.url)??"";D!==z&&i("set-link",D)}const w=e.ref("");e.watch(()=>{var D,z,le;return[(D=n.selectedNode)==null?void 0:D.id,(le=(z=n.selectedNode)==null?void 0:z.image)==null?void 0:le.src]},()=>{var D,z;w.value=((z=(D=n.selectedNode)==null?void 0:D.image)==null?void 0:z.src)??""},{immediate:!0});function ie(){var le,be;if(n.readonly)return;const D=w.value.trim(),z=((be=(le=n.selectedNode)==null?void 0:le.image)==null?void 0:be.src)??"";D!==z&&i("set-image",D)}function fe(D){const z=D.target;z.style.display="none"}function ce(D){const z=D.target;z.style.display=""}const J=e.ref(""),me=e.ref(null);ki(me,{minRows:4,maxRows:18}),e.watch(()=>{var D,z,le;return[(D=n.selectedNode)==null?void 0:D.id,(le=(z=n.selectedNode)==null?void 0:z.richContent)==null?void 0:le.raw]},()=>{var D,z;J.value=((z=(D=n.selectedNode)==null?void 0:D.richContent)==null?void 0:z.raw)??""},{immediate:!0});const ae=e.computed(()=>Mi(Go(J.value),wn(J.value)));function ke(){var be,I;if(n.readonly)return;const D=J.value,z=((I=(be=n.selectedNode)==null?void 0:be.richContent)==null?void 0:I.raw)??"";if(D===z)return;const le=wn(D)||void 0;i("set-rich",D?{kind:"code",raw:D,lang:le}:null)}const b=e.ref(""),V=e.ref(null);ki(V,{minRows:4,maxRows:14}),e.watch(()=>{var D,z,le;return[(D=n.selectedNode)==null?void 0:D.id,(le=(z=n.selectedNode)==null?void 0:z.richContent)==null?void 0:le.raw]},()=>{var D,z;b.value=((z=(D=n.selectedNode)==null?void 0:D.richContent)==null?void 0:z.raw)??""},{immediate:!0});function W(){var le,be;if(n.readonly)return;const D=b.value,z=((be=(le=n.selectedNode)==null?void 0:le.richContent)==null?void 0:be.raw)??"";D!==z&&i("set-rich",D?{kind:"table",raw:D}:null)}const ee=e.computed(()=>Ai(b.value)),ge=e.computed(()=>{const D=[];return s.value||D.push(`${a.value.length} 字`),$.value&&D.push("1 链接"),R.value&&D.push("1 图片"),O.value&&D.push("代码块"),A.value&&D.push("表格"),D.length===0?"节点没有额外内容":D.join(" · ")});return(D,z)=>{var le,be,I,N;return e.openBlock(),e.createElementBlock("div",tp,[t.selectedNode?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",op,[e.createElementVNode("div",ip,[z[12]||(z[12]=e.createElementVNode("span",{class:"zm-note-label"},"节点",-1)),e.createElementVNode("span",rp,e.toDisplayString(t.selectedNode.text||"(无标题)"),1)]),e.createElementVNode("div",lp,e.toDisplayString(ge.value),1)]),e.createElementVNode("div",ap,[e.createElementVNode("section",sp,[e.createElementVNode("header",cp,[z[13]||(z[13]=e.createElementVNode("span",{class:"zm-note-section-title"},"笔记",-1)),z[14]||(z[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",dp,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"noteRef",ref:c,"onUpdate:modelValue":z[0]||(z[0]=U=>a.value=U),class:"zm-note-textarea",placeholder:"写点什么吧… 支持 Markdown",spellcheck:"false",disabled:t.readonly,onBlur:h,onKeydown:x},null,40,up),[[e.vModelText,a.value]]),d.value?(e.openBlock(),e.createElementBlock("div",fp,[s.value?(e.openBlock(),e.createElementBlock("div",pp," 渲染后的 Markdown 仅在此面板显示,不会撑大节点框。 ")):(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-note-preview-body",innerHTML:u.value},null,8,mp))])):e.createCommentVNode("",!0)]),!t.readonly&&!s.value?(e.openBlock(),e.createElementBlock("div",hp,[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",gp,[!$.value&&!y.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-note-add-chip",onClick:z[1]||(z[1]=U=>y.value=!0)},"+ 链接")):e.createCommentVNode("",!0),!R.value&&!k.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-note-add-chip",onClick:z[2]||(z[2]=U=>k.value=!0)},"+ 图片")):e.createCommentVNode("",!0),!O.value&&!m.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-note-add-chip",onClick:z[3]||(z[3]=U=>m.value=!0)},"+ 代码块")):e.createCommentVNode("",!0),!A.value&&!P.value?(e.openBlock(),e.createElementBlock("button",{key:3,class:"zm-note-add-chip",onClick:z[4]||(z[4]=U=>P.value=!0)},"+ 表格")):e.createCommentVNode("",!0)])),$.value||y.value?(e.openBlock(),e.createElementBlock("section",bp,[z[15]||(z[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":z[5]||(z[5]=U=>G.value=U),class:"zm-note-input",type:"url",placeholder:"https://…",disabled:t.readonly,onBlur:q,onKeydown:z[6]||(z[6]=e.withKeys(e.withModifiers(U=>U.target.blur(),["prevent"]),["enter"]))},null,40,kp),[[e.vModelText,G.value]]),$.value?(e.openBlock(),e.createElementBlock("a",{key:0,class:"zm-note-link-chip",href:(le=t.selectedNode.link)==null?void 0:le.url,target:"_blank",rel:"noopener noreferrer",title:(be=t.selectedNode.link)==null?void 0:be.url},e.toDisplayString((I=t.selectedNode.link)==null?void 0:I.url),9,yp)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),R.value||k.value?(e.openBlock(),e.createElementBlock("section",Ep,[z[16]||(z[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":z[7]||(z[7]=U=>w.value=U),class:"zm-note-input",type:"url",placeholder:"data:image/… 或 https://…",disabled:t.readonly,onBlur:ie,onKeydown:z[8]||(z[8]=e.withKeys(e.withModifiers(U=>U.target.blur(),["prevent"]),["enter"]))},null,40,xp),[[e.vModelText,w.value]]),R.value?(e.openBlock(),e.createElementBlock("img",{key:0,class:"zm-note-image",src:(N=t.selectedNode.image)==null?void 0:N.src,alt:t.selectedNode.text,onError:fe,onLoad:ce},null,40,wp)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),O.value||m.value?(e.openBlock(),e.createElementBlock("section",Np,[e.createElementVNode("header",Sp,[z[17]||(z[17]=e.createElementVNode("span",{class:"zm-note-section-title"},"代码块",-1)),e.unref(wn)(J.value)?(e.openBlock(),e.createElementBlock("span",Tp,e.toDisplayString(e.unref(wn)(J.value)),1)):e.createCommentVNode("",!0)]),e.withDirectives(e.createElementVNode("textarea",{ref_key:"codeRef",ref:me,"onUpdate:modelValue":z[9]||(z[9]=U=>J.value=U),class:"zm-note-input zm-note-input-code",placeholder:"```ts\nconsole.log(123)\n```",spellcheck:"false",disabled:t.readonly,onBlur:ke},null,40,Cp),[[e.vModelText,J.value]]),J.value.trim()?(e.openBlock(),e.createElementBlock("pre",Mp,[e.createElementVNode("code",{innerHTML:ae.value},null,8,Ap)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),A.value||P.value?(e.openBlock(),e.createElementBlock("section",_p,[z[18]||(z[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":z[10]||(z[10]=U=>b.value=U),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,Ap),[[e.vModelText,b.value]]),ee.value.length?(e.openBlock(),e.createElementBlock("table",_p,[e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ee.value,(P,H)=>(e.openBlock(),e.createElementBlock("tr",{key:H},[H===0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(P,(ie,xe)=>(e.openBlock(),e.createElementBlock("th",{key:`h${xe}`},e.toDisplayString(ie),1))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(P,(ie,xe)=>(e.openBlock(),e.createElementBlock("td",{key:`c${xe}`},e.toDisplayString(ie),1))),128))]))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])],64)):(e.openBlock(),e.createElementBlock("div",ep,[...B[11]||(B[11]=[e.createElementVNode("p",null,"请先在画布上选中一个节点。",-1),e.createElementVNode("p",{class:"zm-note-hint"}," 选中节点后,会在这里展示并可编辑节点的笔记、链接、图片、代码块、表格。 ",-1)])]))])}}}),Rp=["viewBox","width","height"],Bp={class:"zm-edges"},vp=["d","fill"],zp=["data-node-id","onClick","onPointerdown","onDblclick","onContextmenu","onMouseenter","onMouseleave"],Ip=["src","width","height","alt"],Op=["onDblclick"],Lp={key:0,class:"zm-rich-code"},Dp=["innerHTML"],Vp={key:1,class:"zm-rich-table"},$p={key:2,class:"zm-text"},Pp={key:0,class:"zm-node-markers"},Fp=["title","innerHTML"],Up={class:"zm-text-label"},Hp=["href","title"],Wp=["title","onClick"],Gp={key:4,class:"zm-node-tags"},jp=["title"],Kp=["title","onClick"],Yp=["onClick"],qp=["onMousedown"],Xp=["onClick"],Zp=["title"],Jp={class:"zm-tb-tip zm-tb-zoom"},Qp=["src"],eh=["src"],An=24,Gn=400,fn=160,Wl=4,Qo=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 i=t,a=n,c=e.ref(null),s=e.ref(null),f=e.ref(""),d=e.ref(new Set),p=e.computed(()=>d.value.values().next().value??null),h=e.ref(new Set),y=e.ref(!1),C=e.ref(null),D=e.ref(0),_=e.ref(0),F=e.ref(null),R=e.ref(null),M=e.ref(null),k=e.ref(""),u=e.ref(zt(i.data)),N=e.ref({}),$=e.ref({}),j=e.ref(i.markdown!==void 0);let q=!1;e.watch(()=>i.markdown,r=>{if(r===void 0){j.value=!1;return}j.value=!0;const l=In(r||"");q=!0,u.value=zt(l),d.value=new Set,h.value=new Set,Te(),e.nextTick(()=>{q=!1,rn()})}),e.watch(u,()=>{j.value&&!q&&a("markdownChange",On(u.value))},{deep:!0});const x=e.computed(()=>U.showOrderBadge===!0),ae=e.ref(new Map),fe=ae.value;function me(r,l){const m={};l.bg&&(m.bg=l.bg),l.textColor&&(m.textColor=l.textColor),l.borderColor&&(m.borderColor=l.borderColor),l.fontWeight&&(m.fontWeight=l.fontWeight),l.fontSize&&(m.fontSize=l.fontSize),Object.keys(m).length===0?fe.delete(r):fe.set(r,m),ae.value=new Map(fe)}function J(r){return fe.get(r)??{}}function ge(r,l){const m=he(u.value,r);m&&(m.image={src:l.src,naturalW:l.naturalW,naturalH:l.naturalH,width:b(l.width,An,Gn),height:b(l.height,An,Gn)},Ie(),Te(),a("change",u.value))}function de(r){const l=he(u.value,r);!l||!l.image||(delete l.image,Ie(),Te(),a("change",u.value))}function ye(r,l){const m=l.trim();if(!he(u.value,r))return;if(!m){de(r);return}const E=new Image;E.onload=()=>{const z=he(u.value,r);if(!z)return;const A=E.naturalWidth&&E.naturalHeight?E.naturalWidth/E.naturalHeight:1,v=b(E.naturalWidth||fn,An,Gn),K=Math.round(v/A);z.image={src:m,naturalW:E.naturalWidth||v,naturalH:E.naturalHeight||K,width:v,height:K},Ie(),Te(),a("change",u.value)},E.onerror=()=>{},E.src=m}function b(r,l,m){return Math.min(m,Math.max(l,r))}function L(r,l){const m=new FileReader;m.onload=()=>{if(typeof m.result!="string")return;const T=m.result,E=new window.Image;E.onload=()=>{const z=E.naturalWidth||fn,A=E.naturalHeight||fn,v=b(z,An,fn),K=b(Math.round(A*v/z),An,Gn);l({src:T,naturalW:z,naturalH:A,width:v,height:K})},E.onerror=()=>{l({src:T,naturalW:fn,naturalH:fn,width:fn,height:fn})},E.src=T},m.readAsDataURL(r)}function G(r){const l=document.createElement("input");l.type="file",l.accept="image/*",l.style.display="none",l.onchange=()=>{var T;const m=(T=l.files)==null?void 0:T[0];m&&(L(m,E=>ge(r,E)),document.body.removeChild(l))},document.body.appendChild(l),l.click()}function ee(r,l){const m=l.trim(),T=he(u.value,r);T&&(m?T.link={url:m}:delete T.link,Ie(),Te(),a("change",u.value))}function be(r){ee(r,"")}function O(r,l){const m=he(u.value,r);m&&(l?m.note={text:l}:delete m.note,Ie(),Te(),a("change",u.value))}function B(r){O(r,"")}function oe(r,l){const m=he(u.value,r);m&&(l?m.richContent=l:delete m.richContent,Ie(),Te(),a("change",u.value))}const te=e.ref(null),V=e.ref(null),w=e.computed(()=>["zm-canvas-fab","zm-canvas-fab-preview",!i.hideCanvasActions&&(!i.previewMode||y.value)?"is-visible":""].filter(Boolean).join(" ")),P=e.computed(()=>["zm-canvas-fab","zm-canvas-fab-outline",!i.hideCanvasActions&&(!i.previewMode||y.value)?"is-visible":""].filter(Boolean).join(" "));function H(r,l){i.previewMode||(r.preventDefault(),r.stopPropagation(),V.value=null,d.value=new Set([l.id]),st(),te.value={nodeId:l.id,x:r.clientX,y:r.clientY})}function ie(){te.value=null}function xe(r){const l=r.target;if(!(l!=null&&l.closest(".zm-toolbar, button, input, textarea, .zm-canvas-fab-preview, .zm-canvas-fab-outline"))){if(ci&&pe.panMoved.value){ci=!1,r.preventDefault();return}r.preventDefault(),te.value&&(te.value=null),V.value={x:r.clientX,y:r.clientY}}}function Je(){V.value=null}function Tt(){Je(),i.builtInDrawers&&(tt(),Ct.value=!0),a("canvas-settings")}function it(){Je(),i.builtInDrawers&&(tt(),Zt.value=!0),a("canvas-data")}function nn(r){Je(),i.builtInDrawers&&(tt(),Be.value=r,Zt.value=!0),a("canvas-import",r)}const Qe=e.ref(!1),Zt=e.ref(!1),Jt=e.ref(!1),ce=e.ref(!1),Ct=e.ref(!1),Ve=e.ref(0),Be=e.ref(null),Lt=e.ref(new Set);function tt(){Zt.value=!1,Jt.value=!1,ce.value=!1,Ct.value=!1}const gt=e.computed(()=>{const r=p.value;return r?he(u.value,r)??null:null}),Qt=e.computed(()=>gt.value?J(gt.value.id):{});function X(r){r.autoBalanceOnChange!==void 0&&(U.autoBalanceOnChange=r.autoBalanceOnChange),r.lineWidthStart!==void 0&&(U.lineWidthStart=Math.max(.5,Math.min(20,r.lineWidthStart))),r.lineWidthEnd!==void 0&&(U.lineWidthEnd=Math.max(.3,Math.min(10,r.lineWidthEnd))),r.rainbowBranch!==void 0&&(U.rainbowBranch=r.rainbowBranch),r.branchPaletteId!==void 0&&(U.branchPaletteId=r.branchPaletteId),r.customPalettes!==void 0&&(U.customPalettes=r.customPalettes),r.lineStyle!==void 0&&(U.lineStyle=r.lineStyle),r.rootLineStyle!==void 0&&(U.rootLineStyle=r.rootLineStyle),r.lineOrigin!==void 0&&(U.lineOrigin=r.lineOrigin),r.taperedEdge!==void 0&&(U.taperedEdge=r.taperedEdge),r.lineWidthTaper!==void 0&&(U.lineWidthTaper=Math.max(.3,Math.min(1,r.lineWidthTaper))),r.elbowRadius!==void 0&&(U.elbowRadius=Math.max(2,Math.min(20,r.elbowRadius))),r.showOrderBadge!==void 0&&(U.showOrderBadge=r.showOrderBadge),r.canvasBg!==void 0&&(U.canvasBg=r.canvasBg)}function se(r){gt.value&&me(gt.value.id,r)}function Ee(){const r={autoBalanceOnChange:!0,lineWidthStart:16,lineWidthEnd:.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"rounded-elbow",rootLineStyle:"arc",lineOrigin:"proportional",layoutMode:"mindmap",taperedEdge:!0,lineWidthTaper:.3,elbowRadius:8,showOrderBadge:!1,canvasBg:void 0};U.autoBalanceOnChange=r.autoBalanceOnChange,U.lineWidthStart=r.lineWidthStart,U.lineWidthEnd=r.lineWidthEnd,U.rainbowBranch=r.rainbowBranch,U.branchPaletteId=r.branchPaletteId,U.customPalettes=r.customPalettes,U.lineStyle=r.lineStyle,U.rootLineStyle=r.rootLineStyle,U.lineOrigin=r.lineOrigin,U.layoutMode=r.layoutMode,U.taperedEdge=r.taperedEdge,U.lineWidthTaper=r.lineWidthTaper,U.elbowRadius=r.elbowRadius,U.showOrderBadge=r.showOrderBadge,U.canvasBg=r.canvasBg}function Ae(){Be.value=null}function He(r){const l=p.value;l&&O(l,r)}function rt(){const r=p.value;r&&B(r)}function yt(r){const l=p.value;l&&ee(l,r)}function _n(r){const l=p.value;l&&ye(l,r)}function ti(r){const l=p.value;l&&oe(l,r)}function ni(r){const l=document.querySelector(`[data-node-id="${r.id}"]`);l&&l.click()}function po(r){ua(r.id,r.text)}function oi(r){no(r)}function jn(r){ai(r)}function Kn(r){Ji(r.srcId,r.targetId,r.position)}function Dt(r){const l=new Set(Lt.value);l.has(r)?l.delete(r):l.add(r),Lt.value=l}function mn(){i.builtInDrawers&&(Qe.value=!Qe.value),a("canvas-outline")}function ho(){var l;const r=(l=te.value)==null?void 0:l.nodeId;r&&G(r)}function go(){var T,E,z;const r=(T=te.value)==null?void 0:T.nodeId;if(!r)return;const l=((z=(E=he(u.value,r))==null?void 0:E.link)==null?void 0:z.url)??"",m=window.prompt("输入链接 URL(留空取消)",l);m!==null&&ee(r,m)}function Wi(){var l;const r=(l=te.value)==null?void 0:l.nodeId;r&&be(r)}function bo(){var l;const r=(l=te.value)==null?void 0:l.nodeId;r&&on(r)}function ko(){var l;const r=(l=te.value)==null?void 0:l.nodeId;r&&B(r)}function Gi(){var l;const r=(l=te.value)==null?void 0:l.nodeId;r&&de(r)}function pn(){var ke,S;const r=(ke=te.value)==null?void 0:ke.nodeId;if(!r)return;const l=(S=he(u.value,r))==null?void 0:S.richContent,m=(l==null?void 0:l.kind)==="code"?Go(l.raw):"",T=(l==null?void 0:l.kind)==="code"&&l.lang||"",E=T?"```"+T+`
132
- `:"```\n",A=window.prompt("输入代码块内容(用 ```lang 包裹;留空取消)",m?E+m+(m.endsWith("```")?"":"\n```"):E+"// 你的代码"+"\n```");if(A===null)return;const v=A.trim();if(!v){oe(r,null);return}const K=/^```([^\s`]*)/.exec(v),Y=K?K[1]:void 0;oe(r,{kind:"code",raw:v,lang:Y})}function ji(){var l;const r=(l=te.value)==null?void 0:l.nodeId;r&&oe(r,null)}function ii(){var A,v;const r=(A=te.value)==null?void 0:A.nodeId;if(!r)return;const l=(v=he(u.value,r))==null?void 0:v.richContent,m=(l==null?void 0:l.kind)==="table"?l.raw:"",E=window.prompt("输入 markdown 表格(每行以 | 分隔;留空取消)",m||`| 列1 | 列2 | 列3 |
131
+ | a | b |`,spellcheck:"false",disabled:t.readonly,onBlur:W},null,40,Rp),[[e.vModelText,b.value]]),ee.value.length?(e.openBlock(),e.createElementBlock("table",Bp,[e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ee.value,(U,H)=>(e.openBlock(),e.createElementBlock("tr",{key:H},[H===0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(U,(oe,Ee)=>(e.openBlock(),e.createElementBlock("th",{key:`h${Ee}`},e.toDisplayString(oe),1))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(U,(oe,Ee)=>(e.openBlock(),e.createElementBlock("td",{key:`c${Ee}`},e.toDisplayString(oe),1))),128))]))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])],64)):(e.openBlock(),e.createElementBlock("div",np,[...z[11]||(z[11]=[e.createElementVNode("p",null,"请先在画布上选中一个节点。",-1),e.createElementVNode("p",{class:"zm-note-hint"}," 选中节点后,会在这里展示并可编辑节点的笔记、链接、图片、代码块、表格。 ",-1)])]))])}}}),vp=["viewBox","width","height"],Ip={class:"zm-edges"},zp=["d","fill"],Op=["data-node-id","onClick","onPointerdown","onDblclick","onContextmenu","onMouseenter","onMouseleave"],Lp=["src","width","height","alt"],Dp=["onDblclick"],Vp={key:0,class:"zm-rich-code"},$p=["innerHTML"],Pp={key:1,class:"zm-rich-table"},Fp={key:2,class:"zm-text"},Up={key:0,class:"zm-node-markers"},Hp=["title","innerHTML"],Wp={class:"zm-text-label"},Gp=["href","title"],jp=["title","onClick"],Kp={key:4,class:"zm-node-tags"},Yp=["title"],qp=["title","onClick"],Xp=["onClick"],Zp=["onMousedown"],Jp=["onClick"],Qp=["title"],eh={class:"zm-tb-tip zm-tb-zoom"},th=["src"],nh=["src"],Mn=24,jn=400,mn=160,Gl=4,Qo=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 i=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),h=e.ref(new Set),x=e.ref(!1),C=e.ref(null),$=e.ref(0),R=e.ref(0),F=e.computed(()=>{const r=C.value;if(!r||!r.currentTargetId||!r.dropPosition||r.dropPosition==="child")return null;const l=rn.value.find(B=>B.id===r.currentTargetId);if(!l)return null;const f=l.width/2,S=l.height/2;if(l._dir==="down"){const B=r.dropPosition==="before"?l.x-f:l.x+f;return{x1:B,y1:l.y-S,x2:B,y2:l.y+S,horizontal:!1}}const E=r.dropPosition==="before"?l.y-S:l.y+S;return{x1:l.x-f,y1:E,x2:l.x+f,y2:E,horizontal:!0}}),O=e.ref(null),A=e.ref(null),y=e.ref(null),k=e.ref(""),m=e.ref(It(i.data)),P=e.ref({}),G=e.ref({}),q=e.ref(i.markdown!==void 0);let w=!1;e.watch(()=>i.markdown,r=>{if(r===void 0){q.value=!1;return}q.value=!0;const l=On(r||"");w=!0,m.value=It(l),d.value=new Set,h.value=new Set,Se(),e.nextTick(()=>{w=!1,ln()})}),e.watch(m,()=>{q.value&&!w&&a("markdownChange",Ln(m.value))},{deep:!0});const ie=e.computed(()=>_.showOrderBadge===!0),fe=e.ref(new Map),ce=fe.value;function J(r,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?ce.delete(r):ce.set(r,f),fe.value=new Map(ce)}function me(r){return ce.get(r)??{}}function ae(r,l){const f=he(m.value,r);f&&(f.image={src:l.src,naturalW:l.naturalW,naturalH:l.naturalH,width:V(l.width,Mn,jn),height:V(l.height,Mn,jn)},Oe(),Se(),a("change",m.value))}function ke(r){const l=he(m.value,r);!l||!l.image||(delete l.image,Oe(),Se(),a("change",m.value))}function b(r,l){const f=l.trim();if(!he(m.value,r))return;if(!f){ke(r);return}const E=new Image;E.onload=()=>{const B=he(m.value,r);if(!B)return;const M=E.naturalWidth&&E.naturalHeight?E.naturalWidth/E.naturalHeight:1,v=V(E.naturalWidth||mn,Mn,jn),j=Math.round(v/M);B.image={src:f,naturalW:E.naturalWidth||v,naturalH:E.naturalHeight||j,width:v,height:j},Oe(),Se(),a("change",m.value)},E.onerror=()=>{},E.src=f}function V(r,l,f){return Math.min(f,Math.max(l,r))}function W(r,l){const f=new FileReader;f.onload=()=>{if(typeof f.result!="string")return;const S=f.result,E=new window.Image;E.onload=()=>{const B=E.naturalWidth||mn,M=E.naturalHeight||mn,v=V(B,Mn,mn),j=V(Math.round(M*v/B),Mn,jn);l({src:S,naturalW:B,naturalH:M,width:v,height:j})},E.onerror=()=>{l({src:S,naturalW:mn,naturalH:mn,width:mn,height:mn})},E.src=S},f.readAsDataURL(r)}function ee(r){const l=document.createElement("input");l.type="file",l.accept="image/*",l.style.display="none",l.onchange=()=>{var S;const f=(S=l.files)==null?void 0:S[0];f&&(W(f,E=>ae(r,E)),document.body.removeChild(l))},document.body.appendChild(l),l.click()}function ge(r,l){const f=l.trim(),S=he(m.value,r);S&&(f?S.link={url:f}:delete S.link,Oe(),Se(),a("change",m.value))}function D(r){ge(r,"")}function z(r,l){const f=he(m.value,r);f&&(l?f.note={text:l}:delete f.note,Oe(),Se(),a("change",m.value))}function le(r){z(r,"")}function be(r,l){const f=he(m.value,r);f&&(l?f.richContent=l:delete f.richContent,Oe(),Se(),a("change",m.value))}const I=e.ref(null),N=e.ref(null),U=e.computed(()=>["zm-canvas-fab","zm-canvas-fab-preview",!i.hideCanvasActions&&(!i.previewMode||x.value)?"is-visible":""].filter(Boolean).join(" ")),H=e.computed(()=>["zm-canvas-fab","zm-canvas-fab-outline",!i.hideCanvasActions&&(!i.previewMode||x.value)?"is-visible":""].filter(Boolean).join(" "));function oe(r,l){i.previewMode||(r.preventDefault(),r.stopPropagation(),N.value=null,d.value=new Set([l.id]),at(),I.value={nodeId:l.id,x:r.clientX,y:r.clientY})}function Ee(){I.value=null}function et(r){const l=r.target;if(!(l!=null&&l.closest(".zm-toolbar, button, input, textarea, .zm-canvas-fab-preview, .zm-canvas-fab-outline"))){if(di&&pe.panMoved.value){di=!1,r.preventDefault();return}r.preventDefault(),I.value&&(I.value=null),N.value={x:r.clientX,y:r.clientY}}}function ut(){N.value=null}function tt(){ut(),i.builtInDrawers&&(xt(),ze.value=!0),a("canvas-settings")}function nn(){ut(),i.builtInDrawers&&(xt(),Dt.value=!0),a("canvas-data")}function nt(r){ut(),i.builtInDrawers&&(xt(),Vt.value=r,Dt.value=!0),a("canvas-import",r)}const on=e.ref(!1),Dt=e.ref(!1),ue=e.ref(!1),ft=e.ref(!1),ze=e.ref(!1),Be=e.ref(0),Vt=e.ref(null),ot=e.ref(new Set);function xt(){Dt.value=!1,ue.value=!1,ft.value=!1,ze.value=!1}const kt=e.computed(()=>{const r=p.value;return r?he(m.value,r)??null:null}),X=e.computed(()=>kt.value?me(kt.value.id):{});function re(r){r.autoBalanceOnChange!==void 0&&(_.autoBalanceOnChange=r.autoBalanceOnChange),r.lineWidthStart!==void 0&&(_.lineWidthStart=Math.max(.5,Math.min(20,r.lineWidthStart))),r.lineWidthEnd!==void 0&&(_.lineWidthEnd=Math.max(.3,Math.min(10,r.lineWidthEnd))),r.rainbowBranch!==void 0&&(_.rainbowBranch=r.rainbowBranch),r.branchPaletteId!==void 0&&(_.branchPaletteId=r.branchPaletteId),r.customPalettes!==void 0&&(_.customPalettes=r.customPalettes),r.lineStyle!==void 0&&(_.lineStyle=r.lineStyle),r.rootLineStyle!==void 0&&(_.rootLineStyle=r.rootLineStyle),r.lineOrigin!==void 0&&(_.lineOrigin=r.lineOrigin),r.taperedEdge!==void 0&&(_.taperedEdge=r.taperedEdge),r.lineWidthTaper!==void 0&&(_.lineWidthTaper=Math.max(.3,Math.min(1,r.lineWidthTaper))),r.elbowRadius!==void 0&&(_.elbowRadius=Math.max(2,Math.min(20,r.elbowRadius))),r.showOrderBadge!==void 0&&(_.showOrderBadge=r.showOrderBadge),r.canvasBg!==void 0&&(_.canvasBg=r.canvasBg)}function xe(r){kt.value&&J(kt.value.id,r)}function Ae(){const r={autoBalanceOnChange:!0,lineWidthStart:16,lineWidthEnd:.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"rounded-elbow",rootLineStyle:"arc",lineOrigin:"proportional",layoutMode:"mindmap",taperedEdge:!0,lineWidthTaper:.3,elbowRadius:8,showOrderBadge:!1,canvasBg:void 0};_.autoBalanceOnChange=r.autoBalanceOnChange,_.lineWidthStart=r.lineWidthStart,_.lineWidthEnd=r.lineWidthEnd,_.rainbowBranch=r.rainbowBranch,_.branchPaletteId=r.branchPaletteId,_.customPalettes=r.customPalettes,_.lineStyle=r.lineStyle,_.rootLineStyle=r.rootLineStyle,_.lineOrigin=r.lineOrigin,_.layoutMode=r.layoutMode,_.taperedEdge=r.taperedEdge,_.lineWidthTaper=r.lineWidthTaper,_.elbowRadius=r.elbowRadius,_.showOrderBadge=r.showOrderBadge,_.canvasBg=r.canvasBg}function Ue(){Vt.value=null}function it(r){const l=p.value;l&&z(l,r)}function wt(){const r=p.value;r&&le(r)}function An(r){const l=p.value;l&&ge(l,r)}function ti(r){const l=p.value;l&&b(l,r)}function ni(r){const l=p.value;l&&be(l,r)}function po(r){const l=document.querySelector(`[data-node-id="${r.id}"]`);l&&l.click()}function oi(r){ma(r.id,r.text)}function Kn(r){no(r)}function Yn(r){si(r)}function $t(r){Qi(r.srcId,r.targetId,r.position)}function pn(r){const l=new Set(ot.value);l.has(r)?l.delete(r):l.add(r),ot.value=l}function ho(){i.builtInDrawers&&(on.value=!on.value),a("canvas-outline")}function go(){var l;const r=(l=I.value)==null?void 0:l.nodeId;r&&ee(r)}function ji(){var S,E,B;const r=(S=I.value)==null?void 0:S.nodeId;if(!r)return;const l=((B=(E=he(m.value,r))==null?void 0:E.link)==null?void 0:B.url)??"",f=window.prompt("输入链接 URL(留空取消)",l);f!==null&&ge(r,f)}function bo(){var l;const r=(l=I.value)==null?void 0:l.nodeId;r&&D(r)}function ko(){var l;const r=(l=I.value)==null?void 0:l.nodeId;r&&ri(r)}function Ki(){var l;const r=(l=I.value)==null?void 0:l.nodeId;r&&le(r)}function _n(){var l;const r=(l=I.value)==null?void 0:l.nodeId;r&&ke(r)}function ii(){var ye,T;const r=(ye=I.value)==null?void 0:ye.nodeId;if(!r)return;const l=(T=he(m.value,r))==null?void 0:T.richContent,f=(l==null?void 0:l.kind)==="code"?Go(l.raw):"",S=(l==null?void 0:l.kind)==="code"&&l.lang||"",E=S?"```"+S+`
132
+ `:"```\n",M=window.prompt("输入代码块内容(用 ```lang 包裹;留空取消)",f?E+f+(f.endsWith("```")?"":"\n```"):E+"// 你的代码"+"\n```");if(M===null)return;const v=M.trim();if(!v){be(r,null);return}const j=/^```([^\s`]*)/.exec(v),K=j?j[1]:void 0;be(r,{kind:"code",raw:v,lang:K})}function Yi(){var l;const r=(l=I.value)==null?void 0:l.nodeId;r&&be(r,null)}function He(){var M,v;const r=(M=I.value)==null?void 0:M.nodeId;if(!r)return;const l=(v=he(m.value,r))==null?void 0:v.richContent,f=(l==null?void 0:l.kind)==="table"?l.raw:"",E=window.prompt("输入 markdown 表格(每行以 | 分隔;留空取消)",f||`| 列1 | 列2 | 列3 |
133
133
  | --- | --- | --- |
134
- | a | b | c |`);if(E===null)return;const z=E.trim();if(!z){oe(r,null);return}oe(r,{kind:"table",raw:z})}function Ge(){var l;const r=(l=te.value)==null?void 0:l.nodeId;r&&oe(r,null)}function on(r){i.previewMode||(d.value=new Set([r]),st(),i.builtInDrawers&&(tt(),ce.value=!0,Ve.value++),a("edit-note",r))}function Ki(r,l=60){const m=r.replace(/\s+/g," ").trim();return m.length<=l?m||"点击编辑笔记":m.slice(0,l)+"…"}function yo(r){var E;if(i.previewMode||s.value)return;const l=r.target;if(l&&(l.tagName==="INPUT"||l.tagName==="TEXTAREA"||l.isContentEditable))return;const m=p.value;if(!m)return;const T=(E=r.clipboardData)==null?void 0:E.items;if(T)for(let z=0;z<T.length;z++){const A=T[z];if(A.kind==="file"&&A.type.startsWith("image/")){const v=A.getAsFile();if(!v)continue;r.preventDefault();const K=he(u.value,m);if(K!=null&&K.image&&!window.confirm("该节点已有图片,要用剪贴板里的图片替换吗?"))return;L(v,Y=>ge(m,Y));return}}}e.onMounted(()=>{window.addEventListener("paste",yo),window.addEventListener("keydown",Yn),Te()}),e.onBeforeUnmount(()=>{window.removeEventListener("paste",yo),window.removeEventListener("keydown",Yn)});function Yn(r){if((r.metaKey||r.ctrlKey)&&(r.key==="f"||r.key==="F")){const m=r.target;if(m&&(m.tagName==="INPUT"||m.tagName==="TEXTAREA"||m.isContentEditable))return;r.preventDefault(),a("canvas-outline")}}const hn=e.ref(null),ri=e.computed(()=>{var r;return((r=hn.value)==null?void 0:r.nodeId)??null});function Yi(r,l){if(!l.image)return;r.preventDefault(),r.stopPropagation();const m=l.image.naturalW||l.image.width,T=l.image.naturalH||l.image.height,E=T>0?T/m:1;hn.value={nodeId:l.id,startX:r.clientX,startY:r.clientY,startW:l.image.width,startH:l.image.height,naturalW:m,naturalH:T,ratio:E,pendingW:l.image.width,pendingH:l.image.height},window.addEventListener("mousemove",Et),window.addEventListener("mouseup",en)}function Et(r){var K,Y;const l=hn.value;if(!l)return;const m=pe.scale.value||1,T=r.clientX-l.startX,E=b(l.startW+T/m,An,Gn),z=b(E*l.ratio,An,Gn);l.pendingW=E,l.pendingH=z;const A=(K=c.value)==null?void 0:K.querySelector(`[data-node-id="${l.nodeId}"] .zm-node-img`);A&&(A.style.width=`${E}px`,A.style.height=`${z}px`);const v=(Y=c.value)==null?void 0:Y.querySelector(`[data-node-id="${l.nodeId}"]`);v&&(v.style.minWidth=`${Math.max(80,Math.ceil(E+28))}px`,v.style.height=`${Math.ceil(z+8+30)}px`)}function en(){const r=hn.value;if(window.removeEventListener("mousemove",Et),window.removeEventListener("mouseup",en),hn.value=null,!r)return;const l=he(u.value,r.nodeId);!l||!l.image||(ge(r.nodeId,{src:l.image.src,naturalW:l.image.naturalW,naturalH:l.image.naturalH,width:r.pendingW,height:r.pendingH}),d.value=new Set([r.nodeId]),st(),Xn=!0)}const qn=e.ref(null);let Xn=!1;function Eo(r){qn.value=r}function Zn(r){qn.value===r&&(qn.value=null),R.value&&(R.value=null)}function gn(r,l){var ue;if(!l.text||l.text.length<14)return;const T=r.currentTarget.getBoundingClientRect(),E=(ue=c.value)==null?void 0:ue.getBoundingClientRect();if(!E)return;const z=10,A=240,v=T.top-E.top>60,K=T.left-E.left+T.width/2,Y=z+A/2,ke=E.width-A/2-z,S=Math.max(Y,Math.min(K,ke)),ne=v?T.top-E.top-8:T.bottom-E.top+8;R.value={text:l.text,x:S,y:ne,above:v}}const bn=e.ref(0),Mt=e.ref(!1),Wt=ns(100);function Ie(){Wt.record({data:u.value,selectedIds:[...d.value]})}function Te(){h.value=new Set(h.value),bn.value++,e.nextTick().then(()=>e.nextTick()).then(()=>li()).then(()=>{bn.value++})}function li(){const r=document.querySelectorAll(".zm-rich"),l={},m={};r.forEach(T=>{let E=T,z=null;for(;E&&!z;)z=E.getAttribute("data-node-id"),E=E.parentElement;if(!z)return;const A=T.offsetHeight,v=T.scrollWidth,K=Math.round(A*2)/2,Y=Math.round(v*2)/2;l[z]=K,m[z]=Y,N.value[z],$.value[z]}),N.value=l,$.value=m}const bt=e.computed(()=>{var r,l,m,T,E,z,A,v,K,Y;return{rootBg:((r=i.theme)==null?void 0:r.rootBg)??"#1f2937",rootText:((l=i.theme)==null?void 0:l.rootText)??"#ffffff",branchBg:((m=i.theme)==null?void 0:m.branchBg)??"#ffffff",branchText:((T=i.theme)==null?void 0:T.branchText)??"#1f2937",lineColor:((E=i.theme)==null?void 0:E.lineColor)??"#94a3b8",bgColor:((z=i.theme)==null?void 0:z.bgColor)??"#f8fafc",fontSize:((A=i.theme)==null?void 0:A.fontSize)??14,lineWidthStart:((v=i.theme)==null?void 0:v.lineWidthStart)??2.2,lineWidthEnd:((K=i.theme)==null?void 0:K.lineWidthEnd)??.8,rainbowBranch:((Y=i.theme)==null?void 0:Y.rainbowBranch)??!1}}),kn=e.computed(()=>U.canvasBg||bt.value.bgColor),U=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,elbowRadius:8,showOrderBadge:!1,canvasBg:void 0});function le(r){return r?U.rootLineStyle:U.lineStyle}function g(r){return U.taperedEdge?Q(r):ve(r)}function I(r){return U.taperedEdge?U.lineWidthEnd:ve(r)}function Q(r){const l=U.lineWidthTaper,m=U.lineWidthStart*Math.pow(l,r);return Math.max(U.lineWidthEnd,m)}function ve(r){if(r<=0)return U.lineWidthStart;if(r>=3)return U.lineWidthEnd;const l=r/3;return U.lineWidthStart+(U.lineWidthEnd-U.lineWidthStart)*l}function Ne(r,l,m,T){const E=1-r,z=E*E*E*l.x+3*E*E*r*m.x1+3*E*r*r*m.x2+r*r*r*T.x,A=E*E*E*l.y+3*E*E*r*m.y1+3*E*r*r*m.y2+r*r*r*T.y;return{x:z,y:A}}function Oe(r,l,m,T){const E=1-r,z=E*E*l.x+2*E*r*m.x+r*r*T.x,A=E*E*l.y+2*E*r*m.y+r*r*T.y;return{x:z,y:A}}function Ke(r,l,m,T,E=32,z="curve",A="right"){if(z==="curve"){let v;if(A==="right"||A==="left"){const ue=Math.abs(l.x-r.x)*.45,W=A==="right"?1:-1;v={x1:r.x+W*ue,y1:r.y,x2:l.x-W*ue,y2:l.y}}else{const ue=Math.abs(l.y-r.y)*.45;v={x1:r.x,y1:r.y+ue,x2:l.x,y2:l.y-ue}}const K=ne=>{const ue=1-ne,W=-3*ue*ue*r.x+3*(ue*ue-2*ue*ne)*v.x1+3*(2*ue*ne-ne*ne)*v.x2+3*ne*ne*l.x,Se=-3*ue*ue*r.y+3*(ue*ue-2*ue*ne)*v.y1+3*(2*ue*ne-ne*ne)*v.y2+3*ne*ne*l.y;return{dx:W,dy:Se}},Y=[],ke=[];for(let ne=0;ne<=E;ne++){const ue=ne/E,W=ne===0?r:ne===E?l:Ne(ue,r,v,l),Se=K(ue);let ze=Math.hypot(Se.dx,Se.dy);ze<1e-6&&(ze=1);const Me=-Se.dy/ze,re=Se.dx/ze,Le=(m+(T-m)*ue)/2;Y.push({x:W.x+Me*Le,y:W.y+re*Le}),ke.push({x:W.x-Me*Le,y:W.y-re*Le})}let S=`M ${Y[0].x.toFixed(2)} ${Y[0].y.toFixed(2)}`;for(let ne=1;ne<=E;ne++)S+=` L ${Y[ne].x.toFixed(2)} ${Y[ne].y.toFixed(2)}`;for(let ne=E;ne>=0;ne--)S+=` L ${ke[ne].x.toFixed(2)} ${ke[ne].y.toFixed(2)}`;return S+=" Z",S}if(z==="arc"){let v;A==="right"||A==="left"?v={x:(r.x+l.x)/2,y:l.y}:v={x:l.x,y:(r.y+l.y)/2};const K=W=>{const Se=1-W,ze=2*Se*(v.x-r.x)+2*W*(l.x-v.x),Me=2*Se*(v.y-r.y)+2*W*(l.y-v.y);return{dx:ze,dy:Me}},Y=[],ke=[];for(let W=0;W<=E;W++){const Se=W/E,ze=W===0?r:W===E?l:Oe(Se,r,v,l),Me=K(Se);let re=Math.hypot(Me.dx,Me.dy);re<1e-6&&(re=1);const Le=-Me.dy/re,nt=Me.dx/re,Z=(m+(T-m)*Se)/2;Y.push({x:ze.x+Le*Z,y:ze.y+nt*Z}),ke.push({x:ze.x-Le*Z,y:ze.y-nt*Z})}const S=m/2,ne=T/2;let ue=`M ${Y[0].x.toFixed(2)} ${Y[0].y.toFixed(2)}`;for(let W=1;W<=E;W++)ue+=` L ${Y[W].x.toFixed(2)} ${Y[W].y.toFixed(2)}`;ue+=` A ${ne.toFixed(2)} ${ne.toFixed(2)} 0 0 0 ${ke[E].x.toFixed(2)} ${ke[E].y.toFixed(2)}`;for(let W=E-1;W>=0;W--)ue+=` L ${ke[W].x.toFixed(2)} ${ke[W].y.toFixed(2)}`;return ue+=` A ${S.toFixed(2)} ${S.toFixed(2)} 0 0 0 ${Y[0].x.toFixed(2)} ${Y[0].y.toFixed(2)}`,ue+=" Z",ue}if(z==="elbow"){const v=[];if(A==="down"){const re=(r.y+l.y)/2;v.push(r,{x:r.x,y:re},{x:l.x,y:re},l)}else{const re=(r.x+l.x)/2;v.push(r,{x:re,y:r.y},{x:re,y:l.y},l)}const K=[];let Y=0;for(let re=0;re<v.length-1;re++){const Le=Math.hypot(v[re+1].x-v[re].x,v[re+1].y-v[re].y);K.push(Le),Y+=Le}const ke=[m/2];let S=0;for(let re=0;re<K.length-1;re++){S+=K[re];const Le=Y>0?S/Y:0;ke.push((m+(T-m)*Le)/2)}ke.push(T/2);const ne=[];for(let re=0;re<v.length-1;re++){const Le=v[re+1].x-v[re].x,nt=v[re+1].y-v[re].y;let Z=Math.hypot(Le,nt);Z<1e-6&&(Z=1),ne.push({x:-nt/Z,y:Le/Z})}const ue=[],W=[];ue.push({x:v[0].x+ne[0].x*ke[0],y:v[0].y+ne[0].y*ke[0]}),W.push({x:v[0].x-ne[0].x*ke[0],y:v[0].y-ne[0].y*ke[0]});for(let re=1;re<v.length-1;re++){const Le=ne[re-1],nt=ne[re],Z=ke[re];ue.push({x:v[re].x+Le.x*Z+nt.x*Z,y:v[re].y+Le.y*Z+nt.y*Z}),W.push({x:v[re].x-Le.x*Z-nt.x*Z,y:v[re].y-Le.y*Z-nt.y*Z})}const Se=ne[ne.length-1],ze=ke[ke.length-1];ue.push({x:v[v.length-1].x+Se.x*ze,y:v[v.length-1].y+Se.y*ze}),W.push({x:v[v.length-1].x-Se.x*ze,y:v[v.length-1].y-Se.y*ze});let Me=`M ${ue[0].x.toFixed(2)} ${ue[0].y.toFixed(2)}`;for(let re=1;re<ue.length;re++)Me+=` L ${ue[re].x.toFixed(2)} ${ue[re].y.toFixed(2)}`;for(let re=W.length-1;re>=0;re--)Me+=` L ${W[re].x.toFixed(2)} ${W[re].y.toFixed(2)}`;return Me+=" Z",Me}if(z==="rounded-elbow"){let v=function(Z,Ye,xt){const Vt={x:Z.pos.x-Ye*Z.d1.x,y:Z.pos.y-Ye*Z.d1.y},Rn={x:Z.pos.x+Ye*Z.d2.x,y:Z.pos.y+Ye*Z.d2.y},wt={x:Z.pos.x+Ye*(Z.d2.x-Z.d1.x),y:Z.pos.y+Ye*(Z.d2.y-Z.d1.y)},Bn=Math.atan2(Vt.y-wt.y,Vt.x-wt.x);let We=Math.atan2(Rn.y-wt.y,Rn.x-wt.x)-Bn;for(;We>Math.PI;)We-=2*Math.PI;for(;We<-Math.PI;)We+=2*Math.PI;const qe=[];for(let St=1;St<xt;St++){const Fe=St/xt,jt=Bn+We*Fe;qe.push({x:wt.x+Ye*Math.cos(jt),y:wt.y+Ye*Math.sin(jt)})}return qe};const K=[];let Y;if(A==="down"){const Z=(r.y+l.y)/2,Ye=Math.sign(Z-r.y)||1,xt=Math.sign(l.x-r.x)||1,Vt=Math.sign(l.y-Z)||1;Y=[{pos:{x:r.x,y:Z},d1:{x:0,y:Ye},d2:{x:xt,y:0}},{pos:{x:l.x,y:Z},d1:{x:xt,y:0},d2:{x:0,y:Vt}}]}else{const Z=(r.x+l.x)/2,Ye=Math.sign(Z-r.x)||1,xt=Math.sign(l.y-r.y)||1,Vt=Math.sign(l.x-Z)||1;Y=[{pos:{x:Z,y:r.y},d1:{x:Ye,y:0},d2:{x:0,y:xt}},{pos:{x:Z,y:l.y},d1:{x:0,y:xt},d2:{x:Vt,y:0}}]}const ke=Math.hypot(Y[0].pos.x-r.x,Y[0].pos.y-r.y),S=Math.hypot(Y[1].pos.x-Y[0].pos.x,Y[1].pos.y-Y[0].pos.y),ne=Math.hypot(l.x-Y[1].pos.x,l.y-Y[1].pos.y),ue=Math.min(ke,S,ne,U.elbowRadius)*.45,W=Math.max(2,ue);K.push(r),K.push({x:Y[0].pos.x-W*Y[0].d1.x,y:Y[0].pos.y-W*Y[0].d1.y});for(const Z of v(Y[0],W,7))K.push(Z);K.push({x:Y[1].pos.x-W*Y[1].d1.x,y:Y[1].pos.y-W*Y[1].d1.y});for(const Z of v(Y[1],W,7))K.push(Z);K.push(l);const Se=[];let ze=0;for(let Z=0;Z<K.length-1;Z++){const Ye=Math.hypot(K[Z+1].x-K[Z].x,K[Z+1].y-K[Z].y);Se.push(Ye),ze+=Ye}const Me=[],re=[];let Le=0;for(let Z=0;Z<K.length;Z++){const Ye=K[Math.max(0,Z-1)],xt=K[Math.min(K.length-1,Z+1)],Vt=xt.x-Ye.x,Rn=xt.y-Ye.y;let wt=Math.hypot(Vt,Rn);wt<1e-6&&(wt=1);const Bn=-Rn/wt,Nt=Vt/wt;Z>0&&(Le+=Se[Z-1]);const We=ze>0?Le/ze:0,qe=(m+(T-m)*We)/2;Me.push({x:K[Z].x+Bn*qe,y:K[Z].y+Nt*qe}),re.push({x:K[Z].x-Bn*qe,y:K[Z].y-Nt*qe})}let nt=`M ${Me[0].x.toFixed(2)} ${Me[0].y.toFixed(2)}`;for(let Z=1;Z<Me.length;Z++)nt+=` L ${Me[Z].x.toFixed(2)} ${Me[Z].y.toFixed(2)}`;nt+=` L ${re[Me.length-1].x.toFixed(2)} ${re[Me.length-1].y.toFixed(2)}`;for(let Z=re.length-2;Z>=0;Z--)nt+=` L ${re[Z].x.toFixed(2)} ${re[Z].y.toFixed(2)}`;return nt+=" Z",nt}{const v=l.x-r.x,K=l.y-r.y;let Y=Math.hypot(v,K);Y<1e-6&&(Y=1);const ke=-K/Y,S=v/Y,ne=m/2,ue=T/2,W={x:r.x+ke*ne,y:r.y+S*ne},Se={x:r.x-ke*ne,y:r.y-S*ne},ze={x:l.x-ke*ue,y:l.y-S*ue},Me={x:l.x+ke*ue,y:l.y+S*ue};return`M ${W.x.toFixed(2)} ${W.y.toFixed(2)} L ${Me.x.toFixed(2)} ${Me.y.toFixed(2)} L ${ze.x.toFixed(2)} ${ze.y.toFixed(2)} L ${Se.x.toFixed(2)} ${Se.y.toFixed(2)} Z`}}const at=e.computed(()=>ft.value.root.children),At=cn[0].colors,Jn=e.computed(()=>Fa(U.branchPaletteId,U.customPalettes)),Pe=e.computed(()=>{const r=new Map;if(!U.rainbowBranch)return r;const l=i.lineColors,m=l&&l.length>0?l:Jn.value.colors.length>0?Jn.value.colors:At;for(let E=0;E<at.value.length;E++){const z=at.value[E];r.set(z.id,m[E%m.length])}const T=(E,z)=>{r.set(E.id,z);for(const A of E.children)T(A,z)};for(let E=0;E<at.value.length;E++){const z=at.value[E];T(z,m[E%m.length])}return r});function xo(r,l){return U.rainbowBranch?Pe.value.get(l.id)??bt.value.lineColor:bt.value.lineColor}function wo(r){const l=J(r.id);if(l.bg)return l.bg;if(r.isRoot)return bt.value.rootBg;if(U.rainbowBranch){const m=Pe.value.get(r.id);if(m)return lh(m,.18)}return bt.value.branchBg}function Qn(r){const l=J(r.id);if(l.textColor)return l.textColor;if(r.isRoot)return bt.value.rootText;if(U.rainbowBranch){const m=Pe.value.get(r.id);if(m)return Yl(m,.55)}return bt.value.branchText}function eo(r){const l=J(r.id);if(l.borderColor)return l.borderColor;if(r.isRoot)return bt.value.rootBg;if(U.rainbowBranch){const m=Pe.value.get(r.id);if(m)return Yl(m,.3)}return bt.value.lineColor}function jl(r){const l=J(r.id);return l.fontWeight?l.fontWeight:r.isRoot?700:r.depth<=1?600:r.depth===2?500:400}function Kl(r){return J(r.id).fontSize??r.fontSize??bt.value.fontSize}function lh(r,l){const m=r.replace("#",""),T=m.length===6?m:m.split("").map(v=>v+v).join(""),E=parseInt(T.slice(0,2),16),z=parseInt(T.slice(2,4),16),A=parseInt(T.slice(4,6),16);return`rgba(${E}, ${z}, ${A}, ${l})`}function Yl(r,l){const m=r.replace("#",""),T=m.length===6?m:m.split("").map(v=>v+v).join(""),E=Math.round(parseInt(T.slice(0,2),16)*(1-l)),z=Math.round(parseInt(T.slice(2,4),16)*(1-l)),A=Math.round(parseInt(T.slice(4,6),16)*(1-l));return`rgb(${E}, ${z}, ${A})`}const pe=Qa({getContainer:()=>c.value});pe.setOnMarqueeEnd(Nh),ts({isEditing:()=>s.value!==null,isReadonly:()=>i.previewMode,getSelectedId:()=>p.value,getSelectedIds:()=>[...d.value],defaultTargetId:()=>u.value.id,onAddChild:no,onAddSibling:ai,onAddSiblingBefore:ph,onRemove:aa,onStartEdit:No,onClearSelection:()=>{d.value=new Set,st()},onDuplicate:ea,onCopy:ia,onCut:ra,onPaste:la,hasClipboard:()=>!!F.value&&F.value.nodes.length>0,onUndo:Xi,onRedo:Zi,onNavigate:hh,onSelectRoot:()=>{d.value=new Set([u.value.id]),st()}});const ft=e.computed(()=>{const r=zt(u.value);return Zl(r),Da(r,{mode:U.layoutMode,baseFontSize:bt.value.fontSize,richHeights:N.value,richWidths:$.value})}),ql=e.ref([]),to=e.computed(()=>(bn.value,ql.value));e.watch(ft,r=>{const l=[],m=T=>{l.push(T);for(const E of T.children)m(E)};m(r.root),ql.value=l},{immediate:!0});const Xl=e.computed(()=>{const r=[];for(const l of to.value)for(const m of l.children)r.push({from:l,to:m,key:`${l.id}->${m.id}`});return r}),ah=e.computed(()=>`${ft.value.vbX} ${ft.value.vbY} ${ft.value.vbW} ${ft.value.vbH}`);function Zl(r){if(h.value.has(r.id)){r.children=[],r.collapsed=!0;return}r.collapsed=!1;for(const l of r.children)Zl(l)}function No(r){const l=he(u.value,r);l&&(s.value=r,f.value=l.text,d.value=new Set([r]),st(),e.nextTick(()=>{const m=document.querySelector(".zm-input");m==null||m.focus(),m==null||m.select(),Jl(m)}))}function qi(){if(!s.value)return;const r=he(u.value,s.value);r&&r.text!==(f.value.trim()||" ")&&(r.text=f.value.trim()||" ",Ie(),a("change",u.value)),s.value=null}function sh(){s.value=null}function Jl(r){r&&(r.style.height="auto",r.style.height=r.scrollHeight+"px")}function ch(r){Jl(r.target)}function dh(r){if(i.previewMode)return;const l=he(u.value,r);l!=null&&l.richContent&&(M.value=r,k.value=l.richContent.raw,e.nextTick(()=>{const m=document.querySelector(".zm-node .zm-rich textarea");m==null||m.focus()}))}function Ql(){if(!M.value)return;const r=M.value,l=he(u.value,r),m=k.value;if(l&&l.richContent&&l.richContent.raw!==m)if(l.richContent.kind==="code"){const T=Nn(m)||void 0;oe(r,{kind:"code",raw:m,lang:T})}else oe(r,{kind:"table",raw:m});M.value=null}function uh(){M.value=null}function fh(r){r.key==="Escape"?(r.preventDefault(),uh()):r.key==="Enter"&&(r.ctrlKey||r.metaKey)&&(r.preventDefault(),Ql())}function mh(r){const l=r.metaKey||r.ctrlKey;l&&(r.key==="z"||r.key==="Z")&&!r.shiftKey?(r.preventDefault(),Xi()):(l&&r.shiftKey&&(r.key==="z"||r.key==="Z")||l&&(r.key==="y"||r.key==="Y")&&!r.shiftKey)&&(r.preventDefault(),Zi())}function no(r){const l=kr(u.value,r,vo);l&&(Ie(),Te(),a("change",u.value),e.nextTick(()=>No(l.id)))}function ai(r){if(r===u.value.id){no(r);return}const l=yr(u.value,r,vo);l&&(Ie(),Te(),a("change",u.value),e.nextTick(()=>No(l.id)))}function ph(r){if(r===u.value.id){no(r);return}const l=Ya(u.value,r,vo);l&&(Ie(),Te(),a("change",u.value),e.nextTick(()=>No(l.id)))}function ea(r){if(r===u.value.id)return;const l=qa(u.value,r);l&&(Ie(),d.value=new Set([l.id]),st(),a("change",u.value),Te())}function ta(r){const l=[],m=new Set;for(const T of r)T!==u.value.id&&(m.has(T)||he(u.value,T)&&(m.add(T),l.push(T)));return l}function na(r){const l=new Set(r),m=[],T=E=>{l.has(E.id)&&m.push(E.id);for(const z of E.children)T(z)};return T(u.value),m}function oa(r){var l;try{(l=navigator.clipboard)==null||l.writeText(r)}catch{}}function ia(r){const l=na(ta(r));if(l.length===0)return;const m=[];for(const T of l){const E=Er(u.value,T);E&&m.push(E)}m.length!==0&&(F.value={nodes:m,originalIds:new Set(l)},oa(m.map(T=>T.text).join(`
135
- `)),Te())}function ra(r){const l=na(ta(r));if(l.length===0)return;const m=[];for(const T of l){const E=Er(u.value,T);E&&m.push(E)}if(m.length!==0){Ie();for(const T of l)Ro(u.value,T);d.value=new Set,st(),F.value={nodes:m,originalIds:new Set(l)},oa(m.map(T=>T.text).join(`
136
- `)),Te(),a("change",u.value)}}function la(r){const l=F.value;if(!l||l.nodes.length===0)return;const m=r??u.value.id,T=he(u.value,m);if(T){for(const E of l.originalIds){const z=he(u.value,E);if(z&&he(z,m))return}Ie();for(const E of l.nodes){const z=zt(E);Bo(z),T.children.push(z)}F.value=null,Te(),a("change",u.value)}}function Xi(){const r=Wt.undo();r&&(u.value=r.data,d.value=new Set(r.selectedIds??[]),st(),Te(),a("change",u.value))}function Zi(){const r=Wt.redo();r&&(u.value=r.data,d.value=new Set(r.selectedIds??[]),st(),Te(),a("change",u.value))}function st(){const r=[];for(const l of d.value){const m=he(u.value,l);m&&r.push(m)}if(i.builtInDrawers&&!i.previewMode&&r.length>0){const l=r[0];!ce.value&&ha(l.id)&&(tt(),ce.value=!0)}else i.builtInDrawers&&r.length===0&&(ce.value=!1);a("select",r.length>0?r:null)}function hh(r,l){const m=p.value??u.value.id,T=he(u.value,m);if(!T)return;let E=null;if(l===1){const z=Ft(u.value,T.id);if(z){const A=z.children.findIndex(v=>v.id===T.id);A>=0&&A<z.children.length-1&&(E=z.children[A+1].id)}}else if(l===-1){const z=Ft(u.value,T.id);if(z){const A=z.children.findIndex(v=>v.id===T.id);A>0&&(E=z.children[A-1].id)}}else if(r===1){const z=Ft(u.value,T.id);z&&(E=z.id)}else r===-1&&T.children.length>0&&(E=T.children[0].id);E&&(d.value=new Set([E]),st())}function aa(r){if(r!==u.value.id&&Ro(u.value,r)){if(Ie(),d.value.has(r)){const l=new Set(d.value);l.delete(r),d.value=l,st()}Te(),a("change",u.value)}}function sa(r){h.value.has(r)?h.value.delete(r):h.value.add(r),Te()}function ca(r){const l=[{n:u.value,depth:1}];for(;l.length;){const{n:m,depth:T}=l.pop();r(m,T);for(let E=m.children.length-1;E>=0;E--)l.push({n:m.children[E],depth:T+1})}}function gh(){h.value=new Set,ca(r=>{r.children.length>0&&h.value.add(r.id)}),Te()}function da(r){h.value=new Set,ca((l,m)=>{m>r&&l.children.length>0&&h.value.add(l.id)}),Te()}function bh(){h.value=new Set,Te()}function ua(r,l){ja(u.value,r,l)&&(Ie(),Te(),a("change",u.value))}function Ji(r,l,m){return Ka(u.value,r,l,m)?(Ie(),Te(),a("change",u.value),!0):!1}function kh(r,l){if(r.stopPropagation(),r.shiftKey){const m=new Set(d.value);m.has(l.id)?m.delete(l.id):m.add(l.id),d.value=m}else d.value=new Set([l.id]);st()}function yh(r,l,m){let T=null;for(const E of to.value){if(E.id===m)continue;const z=E.width/2,A=E.height/2;r>=E.x-z&&r<=E.x+z&&l>=E.y-A&&l<=E.y+A&&(T=E)}return T}let Gt=null;function Eh(r,l){if(i.previewMode||l.isRoot||r.button!==0)return;const m=r.target;if(m!=null&&m.closest(".zm-img-resize-handle"))return;r.stopPropagation();const T=c.value.getBoundingClientRect(),E=l.x*pe.scale.value+pe.offsetX.value,z=l.y*pe.scale.value+pe.offsetY.value,A=r.clientX-T.left-E,v=r.clientY-T.top-z;Gt={srcId:l.id,srcText:l.text,pointerOffsetX:A,pointerOffsetY:v,startX:r.clientX,startY:r.clientY},window.addEventListener("pointermove",fa),window.addEventListener("pointerup",si),window.addEventListener("pointercancel",si)}function fa(r){if(Gt){const A=r.clientX-Gt.startX,v=r.clientY-Gt.startY;if(Math.abs(A)<=Wl&&Math.abs(v)<=Wl)return;C.value={srcId:Gt.srcId,srcText:Gt.srcText,pointerOffsetX:Gt.pointerOffsetX,pointerOffsetY:Gt.pointerOffsetY,currentTargetId:null},document.body.classList.add("is-dragging"),Gt=null}const l=C.value;if(!l)return;const m=c.value.getBoundingClientRect();D.value=r.clientX-m.left-l.pointerOffsetX,_.value=r.clientY-m.top-l.pointerOffsetY;const T=(r.clientX-m.left-pe.offsetX.value)/pe.scale.value,E=(r.clientY-m.top-pe.offsetY.value)/pe.scale.value,z=yh(T,E,l.srcId);l.currentTargetId=(z==null?void 0:z.id)??null}function si(r){if(window.removeEventListener("pointermove",fa),window.removeEventListener("pointerup",si),window.removeEventListener("pointercancel",si),Gt){Gt=null;return}const l=C.value;l&&(l.currentTargetId&&(Ji(l.srcId,l.currentTargetId,"child"),d.value=new Set([l.srcId]),st()),C.value=null,D.value=0,_.value=0,document.body.classList.remove("is-dragging"))}let ci=!1;function xh(r){const l=r.target;if(!l||l.closest(".zm-node, .zm-toolbar, button, input, textarea"))return;if(r.button===2){ci=!0,pe.startPan(r);return}if(ci=!1,r.button!==0)return;const m=c.value.getBoundingClientRect(),T=(r.clientX-m.left-pe.offsetX.value)/pe.scale.value,E=(r.clientY-m.top-pe.offsetY.value)/pe.scale.value;pe.startMarquee(T,E,{shift:r.shiftKey})}function wh(r){if(Xn){Xn=!1;return}const l=r.target;if(!l||l.closest(".zm-node"))return;const m=pe.marquee;m.width>=4||m.height>=4||d.value.size>0&&(d.value=new Set,st())}function Nh(){const r=pe.marquee;if(r.width<4&&r.height<4)return;const l=r.x,m=r.y,T=r.x+r.width,E=r.y+r.height,z=[];for(const A of to.value){const v=A.width/2,K=A.height/2,Y=A.x-v,ke=A.x+v,S=A.y-K,ne=A.y+K;Y<=T&&ke>=l&&S<=E&&ne>=m&&z.push(A.id)}d.value=r.shiftKey?new Set([...d.value,...z]):new Set(z),st()}function ma(r){return h.value.has(r)}function Sh(r){const l=he(u.value,r.id);return!!l&&l.children.length>0}function Qi(r){const l=he(u.value,r);return l?l.children.length:0}function pa(r){if(!he(u.value,r))return 0;const T=[u.value];for(;T.length;){const E=T.pop(),z=E.children.findIndex(A=>A.id===r);if(z>=0)return z;for(const A of E.children)T.push(A)}return 0}function di(r,l,m,T){const E=(T==null?void 0:T._dir)??r._dir;if(l==="out"&&r.isRoot&&U.lineOrigin==="center")return{x:r.x,y:r.y};if(l==="out"&&r.isRoot&&U.lineOrigin==="proportional"&&T){const v=ft.value.root.children;if(E==="down"){const ue=v.reduce((Me,re)=>Math.max(Me,Math.abs(re.x-r.x)),1),W=Math.min(1,Math.abs(T.x-r.x)/ue),Se=r.y+r.height/2,ze=r.y;return{x:r.x,y:Se+(ze-Se)*W}}const K=v.reduce((ue,W)=>Math.max(ue,Math.abs(W.y-r.y)),1),Y=Math.min(1,Math.abs(T.y-r.y)/K),ke=m!==void 0?m:r.side,S=r.x+ke*(r.width/2),ne=r.x;return{x:S+(ne-S)*Y,y:r.y}}if(E==="down")return l==="out"?{x:r.x,y:r.y+r.height/2}:{x:r.x,y:r.y-r.height/2};let z;l==="in"?z=-r.side:m!==void 0?z=m:z=r.side;const A=l==="in"?r._richInsetX??0:0;return{x:r.x+z*(r.width/2-A),y:r.y}}function rn(){const r=ft.value;pe.resetView(r.width,r.height,r.root.y)}function Th(){Mt.value=!0,Ie(),Te(),e.nextTick(()=>rn())}function er(r){U.layoutMode!==r&&(U.layoutMode=r,Te(),e.nextTick(()=>rn()))}function Ch(){return JSON.stringify(u.value,null,2)}function ha(r){const l=he(u.value,r);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 Mh(r){try{const l=JSON.parse(r);return!l.id||!Array.isArray(l.children)?!1:(Wt.reset(),u.value=zt(l),d.value=new Set,h.value=new Set,Te(),e.nextTick(()=>rn()),a("change",u.value),!0)}catch{return!1}}const ga=e.ref(""),ln=e.ref([]),So=e.ref(-1);function Ah(r){ga.value=r;const l=r.trim();if(!l){ln.value=[],So.value=-1;return}const m=l.toLowerCase(),T=[],E=z=>{var A;(z.text.toLowerCase().includes(m)||(A=z.note)!=null&&A.text&&z.note.text.toLowerCase().includes(m))&&T.push(z.id);for(const v of z.children)E(v)};E(u.value),ln.value=T,So.value=T.length>0?0:-1,T.length>0&&(vh(T),e.nextTick(()=>zh(0)))}function _h(r){return ln.value.includes(r)}function Rh(r){return So.value>=0&&ln.value[So.value]===r}function Bh(r){return ga.value.trim().length>0&&ln.value.length>0&&!ln.value.includes(r)}function vh(r){if(r.length===0)return;const l=new Set(r),m=new Set,T=E=>{let z=l.has(E.id);for(const A of E.children)T(A)&&(z=!0);return z&&E.children.length>0&&h.value.has(E.id)&&m.add(E.id),z};if(T(u.value),m.size>0){for(const E of m)h.value.delete(E);Te()}}function zh(r){const l=ln.value[r];if(!l)return;const m=to.value.find(T=>T.id===l);m&&(d.value=new Set([l]),st(),pe.centerOn(m.x,m.y,m.width,m.height))}function Ih(r,l){const m=he(u.value,r);m&&(m.markers||(m.markers=[]),!m.markers.includes(l)&&(m.markers.push(l),Ie(),Te(),a("change",u.value)))}function Oh(r,l){const m=he(u.value,r);if(!m||!m.markers)return;const T=m.markers.indexOf(l);T<0||(m.markers.splice(T,1),m.markers.length===0&&delete m.markers,Ie(),Te(),a("change",u.value))}function ba(r,l){const m=he(u.value,r);if(!m)return!1;m.markers||(m.markers=[]);const T=m.markers.indexOf(l);return T>=0?(m.markers.splice(T,1),m.markers.length===0&&delete m.markers,Ie(),Te(),a("change",u.value),!1):(m.markers.push(l),Ie(),Te(),a("change",u.value),!0)}function Lh(r){const l=he(u.value,r);return l!=null&&l.markers?[...l.markers]:[]}function Dh(r){var m;const l=(m=te.value)==null?void 0:m.nodeId;l&&ba(l,r)}function Vh(){var m;const r=(m=te.value)==null?void 0:m.nodeId;if(!r)return;const l=he(u.value,r);!l||!l.markers||(delete l.markers,Ie(),Te(),a("change",u.value),ie())}function tr(r,l){const m=he(u.value,r);m&&(l.length===0?m.tags&&delete m.tags:m.tags=[...l],Ie(),Te(),a("change",u.value))}function $h(r){const l=he(u.value,r);return l!=null&&l.tags?[...l.tags]:[]}function Ph(){var z,A;const r=(z=te.value)==null?void 0:z.nodeId;if(!r)return;const l=he(u.value,r),m=((A=l==null?void 0:l.tags)==null?void 0:A.join(", "))??"",T=window.prompt("输入标签(多个用逗号分隔)",m);if(T===null)return;const E=T.split(/[,,]/).map(v=>v.trim()).filter(v=>v.length>0);tr(r,E),ie()}function Fh(){var l;const r=(l=te.value)==null?void 0:l.nodeId;r&&(tr(r,[]),ie())}function ka(){const r=ft.value,l="http://www.w3.org/2000/svg",m=document.createElementNS(l,"svg");m.setAttribute("xmlns",l),m.setAttribute("viewBox",`${r.vbX} ${r.vbY} ${r.vbW} ${r.vbH}`),m.setAttribute("width",String(r.vbW)),m.setAttribute("height",String(r.vbH));const T=document.createElementNS(l,"rect");T.setAttribute("x",String(r.vbX)),T.setAttribute("y",String(r.vbY)),T.setAttribute("width",String(r.vbW)),T.setAttribute("height",String(r.vbH)),T.setAttribute("fill",kn.value),m.appendChild(T);for(const A of Xl.value){const v=document.createElementNS(l,"path");v.setAttribute("d",Ke(di(A.from,"out",A.to.side,A.to),di(A.to,"in"),g(A.from.depth),I(A.to.depth),32,le(A.from.isRoot),A.to._dir)),v.setAttribute("fill",xo(A.from,A.to)),v.setAttribute("stroke","none"),m.appendChild(v)}const E="-apple-system,BlinkMacSystemFont,'Segoe UI','PingFang SC','Microsoft YaHei',sans-serif";function z(A,v){let K=0;for(const Y of A)/[\u4e00-\u9fff\u3000-\u30ff\uff00-\uffef]/.test(Y)?K+=v:K+=v*.55;return K}for(const A of to.value){const v=A.x-A.width/2,K=A.y-A.height/2,Y=document.createElementNS(l,"rect");Y.setAttribute("x",String(v)),Y.setAttribute("y",String(K)),Y.setAttribute("width",String(A.width)),Y.setAttribute("height",String(A.height)),Y.setAttribute("rx","8"),Y.setAttribute("fill",wo(A)),Y.setAttribute("stroke",eo(A)),Y.setAttribute("stroke-width","1"),m.appendChild(Y);const ke=!!(A.tags&&A.tags.length>0),S=!!(A.markers&&A.markers.length>0),ne=!!A.image,ue=!!(A.richContent&&(A.richContent.kind==="code"||A.richContent.kind==="table"));let W=0,Se=0;if(ue){const We=A.richContent,qe=A.fontSize*.78*.92,St=6,Fe=4,jt=2,yn=6;if(We.kind==="code"){const _t=Go(We.raw),kt=Nn(We.raw),Rt=_t.split(`
137
- `),tn=qe*1.35;let $t=0;for(const Ue of Rt)$t=Math.max($t,z(Ue,qe));Se=Math.min($t+St*2+4,A.width-4),W=Rt.length*tn+Fe*2+jt;const ot=A.x-Se/2;let mt=K+4;ne&&(mt=K+A.image.height+yn);const Bt=document.createElementNS(l,"rect");if(Bt.setAttribute("x",String(ot)),Bt.setAttribute("y",String(mt)),Bt.setAttribute("width",String(Se)),Bt.setAttribute("height",String(W-jt)),Bt.setAttribute("rx","6"),Bt.setAttribute("fill","rgba(255,255,255,0.55)"),Bt.setAttribute("stroke",eo(A)),Bt.setAttribute("stroke-width","1"),m.appendChild(Bt),kt){const Ue=document.createElementNS(l,"text");Ue.setAttribute("x",String(ot+Se-St)),Ue.setAttribute("y",String(mt+Fe+4)),Ue.setAttribute("text-anchor","end"),Ue.setAttribute("fill",Qn(A)),Ue.setAttribute("font-size",String(qe*.8)),Ue.setAttribute("font-family",E),Ue.setAttribute("opacity","0.5"),Ue.textContent=kt,m.appendChild(Ue)}const Co="'JetBrains Mono','Fira Code',Consolas,monospace";for(let Ue=0;Ue<Rt.length;Ue++){const ct=document.createElementNS(l,"text");ct.setAttribute("x",String(ot+St)),ct.setAttribute("y",String(mt+Fe+(Ue+.5)*tn+2)),ct.setAttribute("dominant-baseline","central"),ct.setAttribute("fill",Qn(A)),ct.setAttribute("font-size",String(qe)),ct.setAttribute("font-family",Co);let Pt=Rt[Ue];const Xe=Math.floor((Se-St*2)/(qe*.6));Pt.length>Xe&&(Pt=Pt.substring(0,Xe-1)+"…"),ct.textContent=Pt,m.appendChild(ct)}}else if(We.kind==="table"){const _t=Ci(We.raw);if(_t.length>0){const kt=qe*1.35,Rt=6,tn=3,$t=_t[0].length,ot=[];for(let Xe=0;Xe<$t;Xe++){let an=0;for(const En of _t)Xe<En.length&&(an=Math.max(an,z(En[Xe],qe)));ot.push(an+Rt*2)}Se=Math.min(ot.reduce((Xe,an)=>Xe+an,0),A.width-4);const mt=Se/ot.reduce((Xe,an)=>Xe+an,0);for(let Xe=0;Xe<$t;Xe++)ot[Xe]*=mt;W=_t.length*(kt+tn*2)+jt;const Bt=A.x-Se/2;let Co=K+4;ne&&(Co=K+A.image.height+yn);const Ue=document.createElementNS(l,"rect");Ue.setAttribute("x",String(Bt)),Ue.setAttribute("y",String(Co)),Ue.setAttribute("width",String(Se)),Ue.setAttribute("height",String(W-jt)),Ue.setAttribute("rx","6"),Ue.setAttribute("fill","rgba(255,255,255,0.55)"),Ue.setAttribute("stroke",eo(A)),Ue.setAttribute("stroke-width","1"),m.appendChild(Ue);let ct=Bt,Pt=Co;for(let Xe=0;Xe<_t.length;Xe++){const an=_t[Xe],En=kt+tn*2;ct=Bt;for(let Mo=0;Mo<$t;Mo++){const oo=ot[Mo],Uh=an[Mo]||"";if(Mo<$t-1){const Ze=document.createElementNS(l,"line");Ze.setAttribute("x1",String(ct+oo)),Ze.setAttribute("y1",String(Pt)),Ze.setAttribute("x2",String(ct+oo)),Ze.setAttribute("y2",String(Pt+En)),Ze.setAttribute("stroke",eo(A)),Ze.setAttribute("stroke-width","1"),m.appendChild(Ze)}if(Xe<_t.length-1){const Ze=document.createElementNS(l,"line");Ze.setAttribute("x1",String(ct)),Ze.setAttribute("y1",String(Pt+En)),Ze.setAttribute("x2",String(ct+oo)),Ze.setAttribute("y2",String(Pt+En)),Ze.setAttribute("stroke",eo(A)),Ze.setAttribute("stroke-width","1"),m.appendChild(Ze)}if(Xe===0){const Ze=document.createElementNS(l,"rect");Ze.setAttribute("x",String(ct)),Ze.setAttribute("y",String(Pt)),Ze.setAttribute("width",String(oo)),Ze.setAttribute("height",String(En)),Ze.setAttribute("fill","rgba(255,255,255,0.4)"),m.appendChild(Ze)}const sn=document.createElementNS(l,"text");sn.setAttribute("x",String(ct+Rt)),sn.setAttribute("y",String(Pt+tn+kt/2+2)),sn.setAttribute("dominant-baseline","central"),sn.setAttribute("fill",Qn(A)),sn.setAttribute("font-size",String(qe)),sn.setAttribute("font-family",E),Xe===0&&sn.setAttribute("font-weight","600");let ui=Uh;const nr=Math.floor((oo-Rt*2)/(qe*.55));ui.length>nr&&nr>2&&(ui=ui.substring(0,nr-1)+"…"),sn.textContent=ui,m.appendChild(sn),ct+=oo}Pt+=En}}}}let ze=0;if(ne){const We=A.image,qe=K+4,St=A.x-We.width/2,Fe=document.createElementNS(l,"image");Fe.setAttribute("x",String(St)),Fe.setAttribute("y",String(qe)),Fe.setAttribute("width",String(We.width)),Fe.setAttribute("height",String(We.height)),Fe.setAttribute("href",We.src),Fe.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",We.src),Fe.setAttribute("preserveAspectRatio","xMidYMid meet"),m.appendChild(Fe),ze=We.height+6}let Me=A.y;const re=ze+W;re>0?Me=K+re+(A.height-re)/2:ke&&(Me=A.y-8);const Le=14,nt=2,Z=4,Ye=S?A.markers.length:0,xt=Ye>0?Ye*Le+(Ye-1)*nt+Z:0,Vt=z(A.text,A.fontSize),Rn=xt+Vt,wt=A.x-Rn/2;if(S){let We=wt;for(const qe of A.markers){const St=Io(qe);if(St){const Fe=document.createElementNS(l,"svg");Fe.setAttribute("x",String(We)),Fe.setAttribute("y",String(Me-Le/2)),Fe.setAttribute("width",String(Le)),Fe.setAttribute("height",String(Le)),Fe.setAttribute("viewBox","0 0 24 24"),Fe.setAttribute("color",Qn(A));const yn=new DOMParser().parseFromString(`<svg xmlns="${l}">${St}</svg>`,"image/svg+xml");if(!yn.querySelector("parsererror"))for(;yn.documentElement.firstChild;)Fe.appendChild(yn.documentElement.firstChild);m.appendChild(Fe)}We+=Le+nt}}const Bn=S?wt+xt+Vt/2:A.x,Nt=document.createElementNS(l,"text");if(Nt.setAttribute("x",String(Bn)),Nt.setAttribute("y",String(Me)),Nt.setAttribute("text-anchor","middle"),Nt.setAttribute("dominant-baseline","central"),Nt.setAttribute("fill",Qn(A)),Nt.setAttribute("font-size",String(Kl(A))),Nt.setAttribute("font-weight",String(jl(A))),Nt.setAttribute("font-family",E),Nt.textContent=A.text,m.appendChild(Nt),ke){const Fe=A.y+10,jt=A.tags.map(kt=>z(kt,10)+12),yn=jt.reduce((kt,Rt)=>kt+Rt+3,-3);let _t=A.x-yn/2;for(let kt=0;kt<A.tags.length;kt++){const Rt=A.tags[kt],tn=hi(Rt),$t=jt[kt],ot=document.createElementNS(l,"rect");ot.setAttribute("x",String(_t)),ot.setAttribute("y",String(Fe-16/2)),ot.setAttribute("width",String($t)),ot.setAttribute("height",String(16)),ot.setAttribute("rx",String(16/2)),ot.setAttribute("fill",tn.background),ot.setAttribute("stroke",tn.borderColor),ot.setAttribute("stroke-width","1"),m.appendChild(ot);const mt=document.createElementNS(l,"text");mt.setAttribute("x",String(_t+$t/2)),mt.setAttribute("y",String(Fe)),mt.setAttribute("text-anchor","middle"),mt.setAttribute("dominant-baseline","central"),mt.setAttribute("fill",tn.color),mt.setAttribute("font-size",String(10)),mt.setAttribute("font-family",E),mt.textContent=Rt,m.appendChild(mt),_t+=$t+3}}}return m}function To(){const r=ka();let m=new XMLSerializer().serializeToString(r);m.startsWith("<?xml")||(m=`<?xml version="1.0" encoding="UTF-8"?>
138
- `+m);const T=new Blob([m],{type:"image/svg+xml;charset=utf-8"}),E=URL.createObjectURL(T),z=document.createElement("a");z.href=E,z.download=`${u.value.text||"mindmap"}.svg`,z.click(),URL.revokeObjectURL(E)}function ya(r=2){const l=ka(),m=ft.value;let E=new XMLSerializer().serializeToString(l);E.startsWith("<?xml")||(E=`<?xml version="1.0" encoding="UTF-8"?>
139
- `+E);const z=new Blob([E],{type:"image/svg+xml;charset=utf-8"}),A=URL.createObjectURL(z),v=new window.Image;v.onload=()=>{const K=document.createElement("canvas");K.width=Math.ceil(m.vbW*r),K.height=Math.ceil(m.vbH*r);const Y=K.getContext("2d");if(!Y){URL.revokeObjectURL(A);return}Y.fillStyle=kn.value,Y.fillRect(0,0,K.width,K.height),Y.drawImage(v,0,0,K.width,K.height),URL.revokeObjectURL(A);try{K.toBlob(ke=>{if(!ke){To();return}const S=URL.createObjectURL(ke),ne=document.createElement("a");ne.href=S,ne.download=`${u.value.text||"mindmap"}.png`,ne.click(),URL.revokeObjectURL(S)},"image/png")}catch(ke){console.warn("PNG export failed, falling back to SVG:",ke),To()}},v.onerror=()=>{URL.revokeObjectURL(A),To()},v.src=A}return o({addChild:r=>no(r),addSibling:r=>ai(r),removeNode:r=>aa(r),duplicateNode:r=>ea(r),setNodeText:(r,l)=>ua(r,l),moveNode:(r,l,m)=>Ji(r,l,m),lineWidthForDepth:g,endWidthForDepth:I,getData:()=>u.value,nodeHasContent:r=>ha(r),getSelectedIds:()=>[...d.value],copyNodes:r=>ia(r),cutNodes:r=>ra(r),pasteNodes:r=>la(r),setData:r=>{Wt.reset(),u.value=zt(r),d.value=new Set,h.value=new Set,Te(),Ie(),e.nextTick(()=>rn())},resetView:()=>rn(),exportData:Ch,importData:Mh,getMarkdown:()=>On(u.value),setMarkdown:(r,l=!0)=>{const m=In(r||"");l&&(j.value=!0),q=!l,Wt.reset(),u.value=zt(m),d.value=new Set,h.value=new Set,Te(),Ie(),e.nextTick(()=>{q=!1,rn()}),a("change",u.value)},setBalanced:r=>{Mt.value=r},isBalanced:()=>Mt.value,balance:()=>Th(),applyNodeStyle:(r,l)=>me(r,l),getNodeStyle:r=>J(r),applyNodeImage:(r,l)=>ge(r,l),applyNodeImageByUrl:(r,l)=>ye(r,l),removeNodeImage:r=>de(r),applyNodeLink:(r,l)=>ee(r,l),removeNodeLink:r=>be(r),applyNodeNote:(r,l)=>O(r,l),removeNodeNote:r=>B(r),applyNodeRichContent:(r,l)=>oe(r,l),addNodeMarker:(r,l)=>Ih(r,l),removeNodeMarker:(r,l)=>Oh(r,l),toggleNodeMarker:(r,l)=>ba(r,l),getNodeMarkers:r=>Lh(r),setNodeTags:(r,l)=>tr(r,l),getNodeTags:r=>$h(r),exportPNG:r=>ya(r),exportSVG:()=>To(),searchNodes:r=>(Ah(r),[...ln.value]),undo:()=>Xi(),redo:()=>Zi(),canUndo:()=>Wt.canUndo(),canRedo:()=>Wt.canRedo(),applySettings:r=>{r.autoBalanceOnChange!==void 0&&(U.autoBalanceOnChange=r.autoBalanceOnChange),r.lineWidthStart!==void 0&&(U.lineWidthStart=Math.max(.5,Math.min(20,r.lineWidthStart))),r.lineWidthEnd!==void 0&&(U.lineWidthEnd=Math.max(.3,Math.min(10,r.lineWidthEnd))),r.rainbowBranch!==void 0&&(U.rainbowBranch=r.rainbowBranch),r.branchPaletteId!==void 0&&(U.branchPaletteId=r.branchPaletteId),r.customPalettes!==void 0&&(U.customPalettes=r.customPalettes),r.lineStyle!==void 0&&(U.lineStyle=r.lineStyle),r.rootLineStyle!==void 0&&(U.rootLineStyle=r.rootLineStyle),r.lineOrigin!==void 0&&(U.lineOrigin=r.lineOrigin),r.taperedEdge!==void 0&&(U.taperedEdge=r.taperedEdge),r.lineWidthTaper!==void 0&&(U.lineWidthTaper=Math.max(.3,Math.min(1,r.lineWidthTaper))),r.elbowRadius!==void 0&&(U.elbowRadius=Math.max(2,Math.min(20,r.elbowRadius))),r.showOrderBadge!==void 0&&(U.showOrderBadge=r.showOrderBadge),r.canvasBg!==void 0&&(U.canvasBg=r.canvasBg)},getSettings:()=>({autoBalanceOnChange:U.autoBalanceOnChange,lineWidthStart:U.lineWidthStart,lineWidthEnd:U.lineWidthEnd,rainbowBranch:U.rainbowBranch,branchPaletteId:U.branchPaletteId,customPalettes:U.customPalettes,lineStyle:U.lineStyle,rootLineStyle:U.rootLineStyle,lineOrigin:U.lineOrigin,layoutMode:U.layoutMode,taperedEdge:U.taperedEdge,lineWidthTaper:U.lineWidthTaper,elbowRadius:U.elbowRadius,showOrderBadge:U.showOrderBadge,canvasBg:U.canvasBg}),setBranchPalette:r=>{if(!r)return;[...cn,...U.customPalettes].find(m=>m.id===r)&&(U.branchPaletteId=r)},getBranchPalette:()=>U.branchPaletteId,getBranchPalettes:()=>[...cn,...U.customPalettes],getSearchResults:()=>[...ln.value],getSearchIndex:()=>So.value}),e.watch(()=>i.data,r=>{u.value=zt(r),Te()},{deep:!1}),e.onMounted(()=>{Ie(),e.nextTick(()=>rn())}),(r,l)=>{var m,T,E,z,A,v,K,Y,ke;return e.openBlock(),e.createElementBlock("div",{class:"zm-mindmap",style:e.normalizeStyle({background:kn.value,fontSize:bt.value.fontSize+"px"})},[e.createElementVNode("div",{ref_key:"wrapperRef",ref:c,class:"zm-canvas",onMousedown:xh,onContextmenu:xe,onWheel:l[25]||(l[25]=(...S)=>e.unref(pe).onWheel&&e.unref(pe).onWheel(...S)),onMouseenter:l[26]||(l[26]=S=>y.value=!0),onMouseleave:l[27]||(l[27]=S=>y.value=!1),onClick:wh},[e.createElementVNode("div",{class:"zm-svg-layer",style:e.normalizeStyle({left:ft.value.vbX*e.unref(pe).scale.value+e.unref(pe).offsetX.value+"px",top:ft.value.vbY*e.unref(pe).scale.value+e.unref(pe).offsetY.value+"px",width:ft.value.vbW*e.unref(pe).scale.value+"px",height:ft.value.vbH*e.unref(pe).scale.value+"px"})},[(e.openBlock(),e.createElementBlock("svg",{class:"zm-svg",viewBox:ah.value,preserveAspectRatio:"xMinYMin meet",width:ft.value.vbW*e.unref(pe).scale.value,height:ft.value.vbH*e.unref(pe).scale.value},[e.createElementVNode("g",Bp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xl.value,S=>(e.openBlock(),e.createElementBlock("path",{key:S.key,d:Ke(di(S.from,"out",S.to.side,S.to),di(S.to,"in"),g(S.from.depth),I(S.to.depth),32,le(S.from.isRoot),S.to._dir),fill:xo(S.from,S.to),stroke:"none"},null,8,vp))),128))])],8,Rp))],4),e.unref(pe).isMarquee.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-marquee",style:e.normalizeStyle({left:e.unref(pe).marquee.x*e.unref(pe).scale.value+e.unref(pe).offsetX.value+"px",top:e.unref(pe).marquee.y*e.unref(pe).scale.value+e.unref(pe).offsetY.value+"px",width:e.unref(pe).marquee.width*e.unref(pe).scale.value+"px",height:e.unref(pe).marquee.height*e.unref(pe).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:D.value+"px",top:_.value+"px",transform:`scale(${e.unref(pe).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(pe).offsetX.value}px, ${e.unref(pe).offsetY.value}px) scale(${e.unref(pe).scale.value})`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(to.value,S=>{var ne,ue;return e.openBlock(),e.createElementBlock("div",{key:S.id,class:e.normalizeClass(["zm-node",{"is-root":S.isRoot,"is-selected":p.value===S.id,"is-selected-secondary":p.value!==S.id&&d.value.has(S.id),"is-editing":s.value===S.id,"has-image":!!S.image,"is-resizing":ri.value===S.id,"is-dragging-source":((ne=C.value)==null?void 0:ne.srcId)===S.id,"is-drop-target":((ue=C.value)==null?void 0:ue.currentTargetId)===S.id,"is-search-hit":_h(S.id),"is-search-current":Rh(S.id),"is-search-dimmed":Bh(S.id)}]),"data-node-id":S.id,style:e.normalizeStyle({left:S.x+"px",top:S.y+"px",width:S.width+"px",minWidth:S.width+"px",height:S.height+"px",fontSize:Kl(S)+"px",background:wo(S),color:Qn(S),borderColor:eo(S),fontWeight:jl(S),transform:"translate(-50%, -50%)"}),onClick:W=>kh(W,S),onPointerdown:W=>Eh(W,S),onDblclick:W=>{W.stopPropagation(),t.previewMode||No(S.id)},onContextmenu:W=>H(W,S),onMouseenter:W=>{Eo(S.id),gn(W,S)},onMouseleave:W=>Zn(S.id)},[S.image?(e.openBlock(),e.createElementBlock("img",{key:0,class:"zm-node-img",src:S.image.src,width:S.image.width,height:S.image.height,alt:S.text,draggable:"false"},null,8,Ip)):e.createCommentVNode("",!0),S.richContent&&(S.richContent.kind==="code"||S.richContent.kind==="table")&&s.value!==S.id?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["zm-rich zm-rich-above",{"zm-rich-no-overflow":S.richContent.kind==="table"||S.richContent.kind==="code"}]),onClick:l[1]||(l[1]=e.withModifiers(()=>{},["stop"])),onDblclick:e.withModifiers(W=>dh(S.id),["stop"]),onMousedown:l[2]||(l[2]=e.withModifiers(()=>{},["stop"]))},[M.value===S.id?e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:0,"onUpdate:modelValue":l[0]||(l[0]=W=>k.value=W),class:"zm-rich-edit",spellcheck:"false",onBlur:Ql,onKeydown:fh},null,544)),[[e.vModelText,k.value]]):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[S.richContent.kind==="code"?(e.openBlock(),e.createElementBlock("pre",Lp,[e.createElementVNode("code",{innerHTML:e.unref(Ti)(e.unref(Go)(S.richContent.raw),e.unref(Nn)(S.richContent.raw))},null,8,Dp)])):S.richContent.kind==="table"?(e.openBlock(),e.createElementBlock("table",Vp,[e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(Ci)(S.richContent.raw),(W,Se)=>(e.openBlock(),e.createElementBlock("tr",{key:Se},[Se===0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(W,(ze,Me)=>(e.openBlock(),e.createElementBlock("th",{key:`h${Me}`},e.toDisplayString(ze),1))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(W,(ze,Me)=>(e.openBlock(),e.createElementBlock("td",{key:`c${Me}`},e.toDisplayString(ze),1))),128))]))),128))])])):e.createCommentVNode("",!0)],64))],42,Op)):e.createCommentVNode("",!0),s.value!==S.id?(e.openBlock(),e.createElementBlock("span",$p,[S.markers&&S.markers.length>0?(e.openBlock(),e.createElementBlock("span",Pp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.markers,W=>(e.openBlock(),e.createElementBlock("span",{key:W,class:"zm-node-marker",title:e.unref(wr)(W),innerHTML:'<svg viewBox="0 0 24 24" width="14" height="14">'+e.unref(Io)(W)+"</svg>"},null,8,Fp))),128))])):e.createCommentVNode("",!0),e.createElementVNode("span",Up,e.toDisplayString(S.text),1),S.link&&s.value!==S.id?(e.openBlock(),e.createElementBlock("a",{key:1,class:"zm-node-link",href:S.link.url,target:"_blank",rel:"noopener noreferrer",title:`打开链接:${S.link.url}`,onClick:l[3]||(l[3]=e.withModifiers(()=>{},["stop"])),onMousedown:l[4]||(l[4]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(_e,{name:"link",size:11,stroke:2})],40,Hp)):e.createCommentVNode("",!0),S.note&&s.value!==S.id?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-node-note-btn",type:"button",title:Ki(S.note.text),onClick:e.withModifiers(W=>on(S.id),["stop"]),onMousedown:l[5]||(l[5]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(_e,{name:"note",size:11,stroke:2})],40,Wp)):e.createCommentVNode("",!0)])):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:3,class:"zm-input","onUpdate:modelValue":l[6]||(l[6]=W=>f.value=W),autofocus:"",rows:"1",onBlur:l[7]||(l[7]=W=>qi()),onKeydown:[l[8]||(l[8]=e.withKeys(e.withModifiers(W=>qi(),["exact","prevent"]),["enter"])),l[9]||(l[9]=e.withKeys(e.withModifiers(W=>qi(),["prevent"]),["tab"])),e.withKeys(sh,["esc"]),mh],onInput:ch,onMousedown:l[10]||(l[10]=e.withModifiers(()=>{},["stop"])),onClick:l[11]||(l[11]=e.withModifiers(()=>{},["stop"]))},null,544)),[[e.vModelText,f.value]]),S.tags&&S.tags.length>0&&s.value!==S.id?(e.openBlock(),e.createElementBlock("div",Gp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.tags,W=>(e.openBlock(),e.createElementBlock("span",{key:W,class:"zm-node-tag",style:e.normalizeStyle(e.unref(hi)(W))},e.toDisplayString(W),5))),128))])):e.createCommentVNode("",!0),x.value?(e.openBlock(),e.createElementBlock("span",{key:5,class:"zm-order-badge",title:`数据顺序:第 ${pa(S.id)+1} 个`},e.toDisplayString(pa(S.id)+1),9,jp)):e.createCommentVNode("",!0),ma(S.id)&&Qi(S.id)>0?(e.openBlock(),e.createElementBlock("span",{key:6,class:e.normalizeClass(["zm-collapse-badge",{"is-on-left":S.side===-1}]),style:e.normalizeStyle({background:Pe.value.get(S.id)??"#64748b"}),title:`展开 ${Qi(S.id)} 个子节点`,onMousedown:l[12]||(l[12]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(W=>sa(S.id),["stop"])},e.toDisplayString(Qi(S.id)),47,Kp)):e.createCommentVNode("",!0),Sh(S)&&!ma(S.id)?(e.openBlock(),e.createElementBlock("button",{key:7,class:e.normalizeClass(["zm-btn zm-collapse",{"is-on-left":S.side===-1}]),style:e.normalizeStyle({color:Pe.value.get(S.id)??"#64748b",borderColor:Pe.value.get(S.id)??"#64748b"}),title:"折叠",onMousedown:l[13]||(l[13]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(W=>sa(S.id),["stop"])},[e.createVNode(_e,{name:"minus",size:10,stroke:2.4})],46,Yp)):e.createCommentVNode("",!0),S.image&&p.value===S.id&&s.value!==S.id?(e.openBlock(),e.createElementBlock("span",{key:8,class:"zm-img-resize-handle",title:"拖动调整图片大小",onMousedown:e.withModifiers(W=>Yi(W,S),["stop"])},null,40,qp)):e.createCommentVNode("",!0),S.image&&p.value===S.id&&s.value!==S.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(W=>de(S.id),["stop"])},[e.createVNode(_e,{name:"x",size:10,stroke:2.2})],40,Xp)):e.createCommentVNode("",!0)],46,zp)}),128))],4),R.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["zm-tooltip",{"is-below":!R.value.above}]),style:e.normalizeStyle({left:R.value.x+"px",top:R.value.y+"px"})},e.toDisplayString(R.value.text),7)):e.createCommentVNode("",!0),te.value?(e.openBlock(),e.createBlock(ms,{key:3,x:te.value.x,y:te.value.y,container:c.value,"has-image":!!((m=e.unref(he)(u.value,te.value.nodeId))!=null&&m.image),"has-link":!!((T=e.unref(he)(u.value,te.value.nodeId))!=null&&T.link),"has-note":!!((E=e.unref(he)(u.value,te.value.nodeId))!=null&&E.note),"has-code":((A=(z=e.unref(he)(u.value,te.value.nodeId))==null?void 0:z.richContent)==null?void 0:A.kind)==="code","has-table":((K=(v=e.unref(he)(u.value,te.value.nodeId))==null?void 0:v.richContent)==null?void 0:K.kind)==="table","node-markers":((Y=e.unref(he)(u.value,te.value.nodeId))==null?void 0:Y.markers)??[],"node-tags":((ke=e.unref(he)(u.value,te.value.nodeId))==null?void 0:ke.tags)??[],onPickImage:ho,onRemoveImage:Gi,onSetLink:go,onRemoveLink:Wi,onEditNote:bo,onRemoveNote:ko,onAddCode:pn,onEditCode:pn,onRemoveCode:ji,onAddTable:ii,onEditTable:ii,onRemoveTable:Ge,onToggleMarker:Dh,onClearMarkers:Vh,onAddTag:Ph,onRemoveTags:Fh,onClose:ie},null,8,["x","y","container","has-image","has-link","has-note","has-code","has-table","node-markers","node-tags"])):e.createCommentVNode("",!0),V.value?(e.openBlock(),e.createBlock(ps,{key:4,x:V.value.x,y:V.value.y,container:c.value,onOpenSettings:Tt,onOpenData:it,onOpenImport:nn,onExportPng:ya,onExportSvg:To,onClose:Je},null,8,["x","y","container"])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(w.value),title:i.previewMode?"退出预览模式":"进入预览模式",onClick:l[15]||(l[15]=S=>a("canvas-toggle-preview"))},[e.createVNode(_e,{name:i.previewMode?"eye-off":"eye",size:16},null,8,["name"])],10,Zp),e.createElementVNode("button",{class:e.normalizeClass(P.value),title:"显示大纲视图",onClick:mn},[e.createVNode(_e,{name:"outline",size:16})],2),e.createElementVNode("div",{class:e.normalizeClass(["zm-toolbar",{"is-preview-only":i.previewMode,"is-hovered":y.value}])},[e.createElementVNode("span",Jp,e.toDisplayString(Math.round(e.unref(pe).scale.value*100))+"%",1),e.createElementVNode("button",{class:"zm-tb-btn",title:"放大",onClick:l[16]||(l[16]=(...S)=>e.unref(pe).zoomIn&&e.unref(pe).zoomIn(...S))},[e.createVNode(_e,{name:"zoom-in"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"缩小",onClick:l[17]||(l[17]=(...S)=>e.unref(pe).zoomOut&&e.unref(pe).zoomOut(...S))},[e.createVNode(_e,{name:"zoom-out"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"重置视图",onClick:rn},[e.createVNode(_e,{name:"reset"})]),l[37]||(l[37]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"全部收起",onClick:gh},[e.createVNode(_e,{name:"collapse-all"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"展开一级",onClick:l[18]||(l[18]=S=>da(1))},[e.createVNode(_e,{name:"expand-level-1"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"展开二级",onClick:l[19]||(l[19]=S=>da(2))},[e.createVNode(_e,{name:"expand-level-2"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"全部展开",onClick:bh},[e.createVNode(_e,{name:"expand-all"})]),i.previewMode?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[l[35]||(l[35]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"添加子节点 (Tab)",onClick:l[20]||(l[20]=S=>p.value&&no(p.value))},[e.createElementVNode("img",{src:e.unref(lr),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,Qp)]),e.createElementVNode("button",{class:"zm-tb-btn",title:"添加同级 (Enter)",onClick:l[21]||(l[21]=S=>p.value&&ai(p.value))},[e.createElementVNode("img",{src:e.unref(rr),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,eh)]),l[36]||(l[36]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:U.layoutMode==="mindmap"}]),title:"思维导图布局 (中心辐射)",onClick:l[22]||(l[22]=S=>er("mindmap"))},[e.createVNode(_e,{name:"mindmap"})],2),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:U.layoutMode==="tree"}]),title:"树形布局 (向右展开)",onClick:l[23]||(l[23]=S=>er("tree"))},[e.createVNode(_e,{name:"tree"})],2),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:U.layoutMode==="org"}]),title:"组织结构布局 (向下展开)",onClick:l[24]||(l[24]=S=>er("org"))},[e.createVNode(_e,{name:"org"})],2)],64))],2)],544),i.builtInDrawers?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(It,{side:"left",scope:"canvas",width:300,open:Qe.value&&!t.previewMode,title:"大纲","onUpdate:open":l[28]||(l[28]=S=>Qe.value=S)},{default:e.withCtx(()=>[e.createVNode(Oo,{data:u.value,"selected-id":p.value,"collapsed-ids":Lt.value,"show-index":x.value,onSelect:ni,onToggleCollapse:Dt,onEdit:po,onAddChild:oi,onAddSibling:jn,onMove:Kn},null,8,["data","selected-id","collapsed-ids","show-index"])]),_:1},8,["open"]),e.createVNode(It,{side:"right",scope:"canvas",width:360,open:Zt.value&&!t.previewMode,title:"数据","onUpdate:open":l[30]||(l[30]=S=>Zt.value=S)},{default:e.withCtx(()=>[e.createVNode(Lo,{data:u.value,"pending-mode":Be.value,onImport:l[29]||(l[29]=S=>u.value=S),onConsumedMode:Ae},null,8,["data","pending-mode"])]),_:1},8,["open"]),e.createVNode(It,{side:"right",scope:"canvas",width:420,open:Jt.value&&!t.previewMode,title:"Markdown","onUpdate:open":l[32]||(l[32]=S=>Jt.value=S)},{default:e.withCtx(()=>[e.createVNode(Do,{data:u.value,onImport:l[31]||(l[31]=S=>u.value=S)},null,8,["data"])]),_:1},8,["open"]),e.createVNode(It,{side:"right",scope:"canvas",width:360,open:ce.value&&!t.previewMode,title:"节点内容","onUpdate:open":l[33]||(l[33]=S=>ce.value=S)},{default:e.withCtx(()=>[e.createVNode(Jo,{"selected-node":gt.value,"focus-tick":Ve.value,onApply:He,onRemove:rt,onSetLink:yt,onSetImage:_n,onSetRich:ti},null,8,["selected-node","focus-tick"])]),_:1},8,["open"]),e.createVNode(It,{side:"right",scope:"canvas",width:340,open:Ct.value&&!t.previewMode,title:"设置","onUpdate:open":l[34]||(l[34]=S=>Ct.value=S)},{default:e.withCtx(()=>{var S;return[e.createVNode(Vo,{settings:U,"has-selection":p.value!==null,"selected-node-text":(S=gt.value)==null?void 0:S.text,"node-style":Qt.value,"onUpdate:settings":X,"onUpdate:nodeStyle":se,onReset:Ee},null,8,["settings","has-selection","selected-node-text","node-style"])]}),_:1},8,["open"])],64)):e.createCommentVNode("",!0)],4)}}}),th={class:"zm-app"},nh={class:"zm-app-main"},oh={class:"zm-app-canvas"},Gl=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(E===null)return;const B=E.trim();if(!B){be(r,null);return}be(r,{kind:"table",raw:B})}function hn(){var l;const r=(l=I.value)==null?void 0:l.nodeId;r&&be(r,null)}function ri(r){i.previewMode||(d.value=new Set([r]),at(),i.builtInDrawers&&(xt(),ft.value=!0,Be.value++),a("edit-note",r))}function li(r,l=60){const f=r.replace(/\s+/g," ").trim();return f.length<=l?f||"点击编辑笔记":f.slice(0,l)+"…"}function qn(r){var E;if(i.previewMode||s.value)return;const l=r.target;if(l&&(l.tagName==="INPUT"||l.tagName==="TEXTAREA"||l.isContentEditable))return;const f=p.value;if(!f)return;const S=(E=r.clipboardData)==null?void 0:E.items;if(S)for(let B=0;B<S.length;B++){const M=S[B];if(M.kind==="file"&&M.type.startsWith("image/")){const v=M.getAsFile();if(!v)continue;r.preventDefault();const j=he(m.value,f);if(j!=null&&j.image&&!window.confirm("该节点已有图片,要用剪贴板里的图片替换吗?"))return;W(v,K=>ae(f,K));return}}}e.onMounted(()=>{window.addEventListener("paste",qn),window.addEventListener("keydown",yo),Se()}),e.onBeforeUnmount(()=>{window.removeEventListener("paste",qn),window.removeEventListener("keydown",yo)});function yo(r){if((r.metaKey||r.ctrlKey)&&(r.key==="f"||r.key==="F")){const f=r.target;if(f&&(f.tagName==="INPUT"||f.tagName==="TEXTAREA"||f.isContentEditable))return;r.preventDefault(),a("canvas-outline")}}const gn=e.ref(null),qi=e.computed(()=>{var r;return((r=gn.value)==null?void 0:r.nodeId)??null});function Mt(r,l){if(!l.image)return;r.preventDefault(),r.stopPropagation();const f=l.image.naturalW||l.image.width,S=l.image.naturalH||l.image.height,E=S>0?S/f:1;gn.value={nodeId:l.id,startX:r.clientX,startY:r.clientY,startW:l.image.width,startH:l.image.height,naturalW:f,naturalH:S,ratio:E,pendingW:l.image.width,pendingH:l.image.height},window.addEventListener("mousemove",Jt),window.addEventListener("mouseup",Eo)}function Jt(r){var j,K;const l=gn.value;if(!l)return;const f=pe.scale.value||1,S=r.clientX-l.startX,E=V(l.startW+S/f,Mn,jn),B=V(E*l.ratio,Mn,jn);l.pendingW=E,l.pendingH=B;const M=(j=c.value)==null?void 0:j.querySelector(`[data-node-id="${l.nodeId}"] .zm-node-img`);M&&(M.style.width=`${E}px`,M.style.height=`${B}px`);const v=(K=c.value)==null?void 0:K.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 r=gn.value;if(window.removeEventListener("mousemove",Jt),window.removeEventListener("mouseup",Eo),gn.value=null,!r)return;const l=he(m.value,r.nodeId);!l||!l.image||(ae(r.nodeId,{src:l.image.src,naturalW:l.image.naturalW,naturalH:l.image.naturalH,width:r.pendingW,height:r.pendingH}),d.value=new Set([r.nodeId]),at(),Rn=!0)}const Xn=e.ref(null);let Rn=!1;function Zn(r){Xn.value=r}function bn(r){Xn.value===r&&(Xn.value=null),A.value&&(A.value=null)}function Jn(r,l){var de;if(!l.text||l.text.length<14)return;const S=r.currentTarget.getBoundingClientRect(),E=(de=c.value)==null?void 0:de.getBoundingClientRect();if(!E)return;const B=10,M=240,v=S.top-E.top>60,j=S.left-E.left+S.width/2,K=B+M/2,ye=E.width-M/2-B,T=Math.max(K,Math.min(j,ye)),Q=v?S.top-E.top-8:S.bottom-E.top+8;A.value={text:l.text,x:T,y:Q,above:v}}const At=e.ref(0),Qn=e.ref(!1),Gt=is(100);function Oe(){Gt.record({data:m.value,selectedIds:[...d.value]})}function Se(){h.value=new Set(h.value),At.value++,e.nextTick().then(()=>e.nextTick()).then(()=>ai()).then(()=>{At.value++})}function ai(){const r=document.querySelectorAll(".zm-rich"),l={},f={};r.forEach(S=>{let E=S,B=null;for(;E&&!B;)B=E.getAttribute("data-node-id"),E=E.parentElement;if(!B)return;const M=S.offsetHeight,v=S.scrollWidth,j=Math.round(M*2)/2,K=Math.round(v*2)/2;l[B]=j,f[B]=K,P.value[B],G.value[B]}),P.value=l,G.value=f}const lt=e.computed(()=>{var r,l,f,S,E,B,M,v,j,K;return{rootBg:((r=i.theme)==null?void 0:r.rootBg)??"#1f2937",rootText:((l=i.theme)==null?void 0:l.rootText)??"#ffffff",branchBg:((f=i.theme)==null?void 0:f.branchBg)??"#ffffff",branchText:((S=i.theme)==null?void 0:S.branchText)??"#1f2937",lineColor:((E=i.theme)==null?void 0:E.lineColor)??"#94a3b8",bgColor:((B=i.theme)==null?void 0:B.bgColor)??"#f8fafc",fontSize:((M=i.theme)==null?void 0:M.fontSize)??14,lineWidthStart:((v=i.theme)==null?void 0:v.lineWidthStart)??2.2,lineWidthEnd:((j=i.theme)==null?void 0:j.lineWidthEnd)??.8,rainbowBranch:((K=i.theme)==null?void 0:K.rainbowBranch)??!1}}),Qt=e.computed(()=>_.canvasBg||lt.value.bgColor),_=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,elbowRadius:8,showOrderBadge:!1,canvasBg:void 0});function g(r){return r?_.rootLineStyle:_.lineStyle}function L(r){return _.taperedEdge?ve(r):we(r)}function Z(r){return _.taperedEdge?_.lineWidthEnd:we(r)}function ve(r){const l=_.lineWidthTaper,f=_.lineWidthStart*Math.pow(l,r);return Math.max(_.lineWidthEnd,f)}function we(r){if(r<=0)return _.lineWidthStart;if(r>=3)return _.lineWidthEnd;const l=r/3;return _.lineWidthStart+(_.lineWidthEnd-_.lineWidthStart)*l}function Le(r,l,f,S){const E=1-r,B=E*E*E*l.x+3*E*E*r*f.x1+3*E*r*r*f.x2+r*r*r*S.x,M=E*E*E*l.y+3*E*E*r*f.y1+3*E*r*r*f.y2+r*r*r*S.y;return{x:B,y:M}}function Xe(r,l,f,S){const E=1-r,B=E*E*l.x+2*E*r*f.x+r*r*S.x,M=E*E*l.y+2*E*r*f.y+r*r*S.y;return{x:B,y:M}}function yt(r,l,f,S,E=32,B="curve",M="right"){if(B==="curve"){let v;if(M==="right"||M==="left"){const de=Math.abs(l.x-r.x)*.45,se=M==="right"?1:-1;v={x1:r.x+se*de,y1:r.y,x2:l.x-se*de,y2:l.y}}else{const de=Math.abs(l.y-r.y)*.45;v={x1:r.x,y1:r.y+de,x2:l.x,y2:l.y-de}}const j=Q=>{const de=1-Q,se=-3*de*de*r.x+3*(de*de-2*de*Q)*v.x1+3*(2*de*Q-Q*Q)*v.x2+3*Q*Q*l.x,Te=-3*de*de*r.y+3*(de*de-2*de*Q)*v.y1+3*(2*de*Q-Q*Q)*v.y2+3*Q*Q*l.y;return{dx:se,dy:Te}},K=[],ye=[];for(let Q=0;Q<=E;Q++){const de=Q/E,se=Q===0?r:Q===E?l:Le(de,r,v,l),Te=j(de);let Ie=Math.hypot(Te.dx,Te.dy);Ie<1e-6&&(Ie=1);const Me=-Te.dy/Ie,te=Te.dx/Ie,ne=(f+(S-f)*de)/2;K.push({x:se.x+Me*ne,y:se.y+te*ne}),ye.push({x:se.x-Me*ne,y:se.y-te*ne})}let T=`M ${K[0].x.toFixed(2)} ${K[0].y.toFixed(2)}`;for(let Q=1;Q<=E;Q++)T+=` L ${K[Q].x.toFixed(2)} ${K[Q].y.toFixed(2)}`;for(let Q=E;Q>=0;Q--)T+=` L ${ye[Q].x.toFixed(2)} ${ye[Q].y.toFixed(2)}`;return T+=" Z",T}if(B==="arc"){let v;M==="right"||M==="left"?v={x:(r.x+l.x)/2,y:l.y}:v={x:l.x,y:(r.y+l.y)/2};const j=se=>{const Te=1-se,Ie=2*Te*(v.x-r.x)+2*se*(l.x-v.x),Me=2*Te*(v.y-r.y)+2*se*(l.y-v.y);return{dx:Ie,dy:Me}},K=[],ye=[];for(let se=0;se<=E;se++){const Te=se/E,Ie=se===0?r:se===E?l:Xe(Te,r,v,l),Me=j(Te);let te=Math.hypot(Me.dx,Me.dy);te<1e-6&&(te=1);const ne=-Me.dy/te,je=Me.dx/te,Y=(f+(S-f)*Te)/2;K.push({x:Ie.x+ne*Y,y:Ie.y+je*Y}),ye.push({x:Ie.x-ne*Y,y:Ie.y-je*Y})}const T=f/2,Q=S/2;let de=`M ${K[0].x.toFixed(2)} ${K[0].y.toFixed(2)}`;for(let se=1;se<=E;se++)de+=` L ${K[se].x.toFixed(2)} ${K[se].y.toFixed(2)}`;de+=` A ${Q.toFixed(2)} ${Q.toFixed(2)} 0 0 0 ${ye[E].x.toFixed(2)} ${ye[E].y.toFixed(2)}`;for(let se=E-1;se>=0;se--)de+=` L ${ye[se].x.toFixed(2)} ${ye[se].y.toFixed(2)}`;return de+=` A ${T.toFixed(2)} ${T.toFixed(2)} 0 0 0 ${K[0].x.toFixed(2)} ${K[0].y.toFixed(2)}`,de+=" Z",de}if(B==="elbow"){const v=[];if(M==="down"){const te=(r.y+l.y)/2;v.push(r,{x:r.x,y:te},{x:l.x,y:te},l)}else{const te=(r.x+l.x)/2;v.push(r,{x:te,y:r.y},{x:te,y:l.y},l)}const j=[];let K=0;for(let te=0;te<v.length-1;te++){const ne=Math.hypot(v[te+1].x-v[te].x,v[te+1].y-v[te].y);j.push(ne),K+=ne}const ye=[f/2];let T=0;for(let te=0;te<j.length-1;te++){T+=j[te];const ne=K>0?T/K:0;ye.push((f+(S-f)*ne)/2)}ye.push(S/2);const Q=[];for(let te=0;te<v.length-1;te++){const ne=v[te+1].x-v[te].x,je=v[te+1].y-v[te].y;let Y=Math.hypot(ne,je);Y<1e-6&&(Y=1),Q.push({x:-je/Y,y:ne/Y})}const de=[],se=[];de.push({x:v[0].x+Q[0].x*ye[0],y:v[0].y+Q[0].y*ye[0]}),se.push({x:v[0].x-Q[0].x*ye[0],y:v[0].y-Q[0].y*ye[0]});for(let te=1;te<v.length-1;te++){const ne=Q[te-1],je=Q[te],Y=ye[te];de.push({x:v[te].x+ne.x*Y+je.x*Y,y:v[te].y+ne.y*Y+je.y*Y}),se.push({x:v[te].x-ne.x*Y-je.x*Y,y:v[te].y-ne.y*Y-je.y*Y})}const Te=Q[Q.length-1],Ie=ye[ye.length-1];de.push({x:v[v.length-1].x+Te.x*Ie,y:v[v.length-1].y+Te.y*Ie}),se.push({x:v[v.length-1].x-Te.x*Ie,y:v[v.length-1].y-Te.y*Ie});let Me=`M ${de[0].x.toFixed(2)} ${de[0].y.toFixed(2)}`;for(let te=1;te<de.length;te++)Me+=` L ${de[te].x.toFixed(2)} ${de[te].y.toFixed(2)}`;for(let te=se.length-1;te>=0;te--)Me+=` L ${se[te].x.toFixed(2)} ${se[te].y.toFixed(2)}`;return Me+=" Z",Me}if(B==="rounded-elbow"){let v=function(Y,$e,Nt){const Pt={x:Y.pos.x-$e*Y.d1.x,y:Y.pos.y-$e*Y.d1.y},Bn={x:Y.pos.x+$e*Y.d2.x,y:Y.pos.y+$e*Y.d2.y},St={x:Y.pos.x+$e*(Y.d2.x-Y.d1.x),y:Y.pos.y+$e*(Y.d2.y-Y.d1.y)},vn=Math.atan2(Pt.y-St.y,Pt.x-St.x);let We=Math.atan2(Bn.y-St.y,Bn.x-St.x)-vn;for(;We>Math.PI;)We-=2*Math.PI;for(;We<-Math.PI;)We+=2*Math.PI;const Ke=[];for(let Ct=1;Ct<Nt;Ct++){const Pe=Ct/Nt,Kt=vn+We*Pe;Ke.push({x:St.x+$e*Math.cos(Kt),y:St.y+$e*Math.sin(Kt)})}return Ke};const j=[];let K;if(M==="down"){const Y=(r.y+l.y)/2,$e=Math.sign(Y-r.y)||1,Nt=Math.sign(l.x-r.x)||1,Pt=Math.sign(l.y-Y)||1;K=[{pos:{x:r.x,y:Y},d1:{x:0,y:$e},d2:{x:Nt,y:0}},{pos:{x:l.x,y:Y},d1:{x:Nt,y:0},d2:{x:0,y:Pt}}]}else{const Y=(r.x+l.x)/2,$e=Math.sign(Y-r.x)||1,Nt=Math.sign(l.y-r.y)||1,Pt=Math.sign(l.x-Y)||1;K=[{pos:{x:Y,y:r.y},d1:{x:$e,y:0},d2:{x:0,y:Nt}},{pos:{x:Y,y:l.y},d1:{x:0,y:Nt},d2:{x:Pt,y:0}}]}const ye=Math.hypot(K[0].pos.x-r.x,K[0].pos.y-r.y),T=Math.hypot(K[1].pos.x-K[0].pos.x,K[1].pos.y-K[0].pos.y),Q=Math.hypot(l.x-K[1].pos.x,l.y-K[1].pos.y),de=Math.min(ye,T,Q,_.elbowRadius)*.45,se=Math.max(2,de);j.push(r),j.push({x:K[0].pos.x-se*K[0].d1.x,y:K[0].pos.y-se*K[0].d1.y});for(const Y of v(K[0],se,7))j.push(Y);j.push({x:K[1].pos.x-se*K[1].d1.x,y:K[1].pos.y-se*K[1].d1.y});for(const Y of v(K[1],se,7))j.push(Y);j.push(l);const Te=[];let Ie=0;for(let Y=0;Y<j.length-1;Y++){const $e=Math.hypot(j[Y+1].x-j[Y].x,j[Y+1].y-j[Y].y);Te.push($e),Ie+=$e}const Me=[],te=[];let ne=0;for(let Y=0;Y<j.length;Y++){const $e=j[Math.max(0,Y-1)],Nt=j[Math.min(j.length-1,Y+1)],Pt=Nt.x-$e.x,Bn=Nt.y-$e.y;let St=Math.hypot(Pt,Bn);St<1e-6&&(St=1);const vn=-Bn/St,Tt=Pt/St;Y>0&&(ne+=Te[Y-1]);const We=Ie>0?ne/Ie:0,Ke=(f+(S-f)*We)/2;Me.push({x:j[Y].x+vn*Ke,y:j[Y].y+Tt*Ke}),te.push({x:j[Y].x-vn*Ke,y:j[Y].y-Tt*Ke})}let je=`M ${Me[0].x.toFixed(2)} ${Me[0].y.toFixed(2)}`;for(let Y=1;Y<Me.length;Y++)je+=` L ${Me[Y].x.toFixed(2)} ${Me[Y].y.toFixed(2)}`;je+=` L ${te[Me.length-1].x.toFixed(2)} ${te[Me.length-1].y.toFixed(2)}`;for(let Y=te.length-2;Y>=0;Y--)je+=` L ${te[Y].x.toFixed(2)} ${te[Y].y.toFixed(2)}`;return je+=" Z",je}{const v=l.x-r.x,j=l.y-r.y;let K=Math.hypot(v,j);K<1e-6&&(K=1);const ye=-j/K,T=v/K,Q=f/2,de=S/2,se={x:r.x+ye*Q,y:r.y+T*Q},Te={x:r.x-ye*Q,y:r.y-T*Q},Ie={x:l.x-ye*de,y:l.y-T*de},Me={x:l.x+ye*de,y:l.y+T*de};return`M ${se.x.toFixed(2)} ${se.y.toFixed(2)} L ${Me.x.toFixed(2)} ${Me.y.toFixed(2)} L ${Ie.x.toFixed(2)} ${Ie.y.toFixed(2)} L ${Te.x.toFixed(2)} ${Te.y.toFixed(2)} Z`}}const mt=e.computed(()=>pt.value.root.children),xo=dn[0].colors,Ze=e.computed(()=>Wa(_.branchPaletteId,_.customPalettes)),en=e.computed(()=>{const r=new Map;if(!_.rainbowBranch)return r;const l=i.lineColors,f=l&&l.length>0?l:Ze.value.colors.length>0?Ze.value.colors:xo;for(let E=0;E<mt.value.length;E++){const B=mt.value[E];r.set(B.id,f[E%f.length])}const S=(E,B)=>{r.set(E.id,B);for(const M of E.children)S(M,B)};for(let E=0;E<mt.value.length;E++){const B=mt.value[E];S(B,f[E%f.length])}return r});function wo(r,l){return _.rainbowBranch?en.value.get(l.id)??lt.value.lineColor:lt.value.lineColor}function Kl(r){const l=me(r.id);if(l.bg)return l.bg;if(r.isRoot)return lt.value.rootBg;if(_.rainbowBranch){const f=en.value.get(r.id);if(f)return sh(f,.18)}return lt.value.branchBg}function eo(r){const l=me(r.id);if(l.textColor)return l.textColor;if(r.isRoot)return lt.value.rootText;if(_.rainbowBranch){const f=en.value.get(r.id);if(f)return Xl(f,.55)}return lt.value.branchText}function to(r){const l=me(r.id);if(l.borderColor)return l.borderColor;if(r.isRoot)return lt.value.rootBg;if(_.rainbowBranch){const f=en.value.get(r.id);if(f)return Xl(f,.3)}return lt.value.lineColor}function Yl(r){const l=me(r.id);return l.fontWeight?l.fontWeight:r.isRoot?700:r.depth<=1?600:r.depth===2?500:400}function ql(r){return me(r.id).fontSize??r.fontSize??lt.value.fontSize}function sh(r,l){const f=r.replace("#",""),S=f.length===6?f:f.split("").map(v=>v+v).join(""),E=parseInt(S.slice(0,2),16),B=parseInt(S.slice(2,4),16),M=parseInt(S.slice(4,6),16);return`rgba(${E}, ${B}, ${M}, ${l})`}function Xl(r,l){const f=r.replace("#",""),S=f.length===6?f:f.split("").map(v=>v+v).join(""),E=Math.round(parseInt(S.slice(0,2),16)*(1-l)),B=Math.round(parseInt(S.slice(2,4),16)*(1-l)),M=Math.round(parseInt(S.slice(4,6),16)*(1-l));return`rgb(${E}, ${B}, ${M})`}const pe=ts({getContainer:()=>c.value});pe.setOnMarqueeEnd(Mh),os({isEditing:()=>s.value!==null,isReadonly:()=>i.previewMode,getSelectedId:()=>p.value,getSelectedIds:()=>[...d.value],defaultTargetId:()=>m.value.id,onAddChild:no,onAddSibling:si,onAddSiblingBefore:gh,onRemove:ca,onStartEdit:No,onClearSelection:()=>{d.value=new Set,at()},onDuplicate:na,onCopy:la,onCut:aa,onPaste:sa,hasClipboard:()=>!!O.value&&O.value.nodes.length>0,onUndo:Zi,onRedo:Ji,onNavigate:bh,onMoveSibling:Eh,onSelectRoot:()=>{d.value=new Set([m.value.id]),at()}});const pt=e.computed(()=>{const r=It(m.value);return Ql(r),Pa(r,{mode:_.layoutMode,baseFontSize:lt.value.fontSize,richHeights:P.value,richWidths:G.value})}),Zl=e.ref([]),rn=e.computed(()=>(At.value,Zl.value));e.watch(pt,r=>{const l=[],f=S=>{l.push(S);for(const E of S.children)f(E)};f(r.root),Zl.value=l},{immediate:!0});const Jl=e.computed(()=>{const r=[];for(const l of rn.value)for(const f of l.children)r.push({from:l,to:f,key:`${l.id}->${f.id}`});return r}),ch=e.computed(()=>`${pt.value.vbX} ${pt.value.vbY} ${pt.value.vbW} ${pt.value.vbH}`);function Ql(r){if(h.value.has(r.id)){r.children=[],r.collapsed=!0;return}r.collapsed=!1;for(const l of r.children)Ql(l)}function No(r){const l=he(m.value,r);l&&(s.value=r,u.value=l.text,d.value=new Set([r]),at(),e.nextTick(()=>{const f=document.querySelector(".zm-input");f==null||f.focus(),f==null||f.select(),ea(f)}))}function Xi(){if(!s.value)return;const r=he(m.value,s.value);r&&r.text!==(u.value.trim()||" ")&&(r.text=u.value.trim()||" ",Oe(),a("change",m.value)),s.value=null}function dh(){s.value=null}function ea(r){r&&(r.style.height="auto",r.style.height=r.scrollHeight+"px")}function uh(r){ea(r.target)}function fh(r){if(i.previewMode)return;const l=he(m.value,r);l!=null&&l.richContent&&(y.value=r,k.value=l.richContent.raw,e.nextTick(()=>{const f=document.querySelector(".zm-node .zm-rich textarea");f==null||f.focus()}))}function ta(){if(!y.value)return;const r=y.value,l=he(m.value,r),f=k.value;if(l&&l.richContent&&l.richContent.raw!==f)if(l.richContent.kind==="code"){const S=wn(f)||void 0;be(r,{kind:"code",raw:f,lang:S})}else be(r,{kind:"table",raw:f});y.value=null}function mh(){y.value=null}function ph(r){r.key==="Escape"?(r.preventDefault(),mh()):r.key==="Enter"&&(r.ctrlKey||r.metaKey)&&(r.preventDefault(),ta())}function hh(r){const l=r.metaKey||r.ctrlKey;l&&(r.key==="z"||r.key==="Z")&&!r.shiftKey?(r.preventDefault(),Zi()):(l&&r.shiftKey&&(r.key==="z"||r.key==="Z")||l&&(r.key==="y"||r.key==="Y")&&!r.shiftKey)&&(r.preventDefault(),Ji())}function no(r){const l=yr(m.value,r,vo);l&&(Oe(),Se(),a("change",m.value),e.nextTick(()=>No(l.id)))}function si(r){if(r===m.value.id){no(r);return}const l=Er(m.value,r,vo);l&&(Oe(),Se(),a("change",m.value),e.nextTick(()=>No(l.id)))}function gh(r){if(r===m.value.id){no(r);return}const l=Xa(m.value,r,vo);l&&(Oe(),Se(),a("change",m.value),e.nextTick(()=>No(l.id)))}function na(r){if(r===m.value.id)return;const l=Za(m.value,r);l&&(Oe(),d.value=new Set([l.id]),at(),a("change",m.value),Se())}function oa(r){const l=[],f=new Set;for(const S of r)S!==m.value.id&&(f.has(S)||he(m.value,S)&&(f.add(S),l.push(S)));return l}function ia(r){const l=new Set(r),f=[],S=E=>{l.has(E.id)&&f.push(E.id);for(const B of E.children)S(B)};return S(m.value),f}function ra(r){var l;try{(l=navigator.clipboard)==null||l.writeText(r)}catch{}}function la(r){const l=ia(oa(r));if(l.length===0)return;const f=[];for(const S of l){const E=xr(m.value,S);E&&f.push(E)}f.length!==0&&(O.value={nodes:f,originalIds:new Set(l)},ra(f.map(S=>S.text).join(`
135
+ `)),Se())}function aa(r){const l=ia(oa(r));if(l.length===0)return;const f=[];for(const S of l){const E=xr(m.value,S);E&&f.push(E)}if(f.length!==0){Oe();for(const S of l)Ro(m.value,S);d.value=new Set,at(),O.value={nodes:f,originalIds:new Set(l)},ra(f.map(S=>S.text).join(`
136
+ `)),Se(),a("change",m.value)}}function sa(r){const l=O.value;if(!l||l.nodes.length===0)return;const f=r??m.value.id,S=he(m.value,f);if(S){for(const E of l.originalIds){const B=he(m.value,E);if(B&&he(B,f))return}Oe();for(const E of l.nodes){const B=It(E);Bo(B),S.children.push(B)}O.value=null,Se(),a("change",m.value)}}function Zi(){const r=Gt.undo();r&&(m.value=r.data,d.value=new Set(r.selectedIds??[]),at(),Se(),a("change",m.value))}function Ji(){const r=Gt.redo();r&&(m.value=r.data,d.value=new Set(r.selectedIds??[]),at(),Se(),a("change",m.value))}function at(){const r=[];for(const l of d.value){const f=he(m.value,l);f&&r.push(f)}if(i.builtInDrawers&&!i.previewMode&&r.length>0){const l=r[0];!ft.value&&ka(l.id)&&(xt(),ft.value=!0)}else i.builtInDrawers&&r.length===0&&(ft.value=!1);a("select",r.length>0?r:null)}function bh(r,l){const f=p.value??m.value.id,S=he(m.value,f);if(!S)return;let E=null;if(l===1){const B=zt(m.value,S.id);if(B){const M=B.children.findIndex(v=>v.id===S.id);M>=0&&M<B.children.length-1&&(E=B.children[M+1].id)}}else if(l===-1){const B=zt(m.value,S.id);if(B){const M=B.children.findIndex(v=>v.id===S.id);M>0&&(E=B.children[M-1].id)}}else if(r===1){const B=zt(m.value,S.id);B&&(E=B.id)}else r===-1&&S.children.length>0&&(E=S.children[0].id);E&&(d.value=new Set([E]),at())}function ca(r){if(r!==m.value.id&&Ro(m.value,r)){if(Oe(),d.value.has(r)){const l=new Set(d.value);l.delete(r),d.value=l,at()}Se(),a("change",m.value)}}function da(r){h.value.has(r)?h.value.delete(r):h.value.add(r),Se()}function ua(r){const l=[{n:m.value,depth:1}];for(;l.length;){const{n:f,depth:S}=l.pop();r(f,S);for(let E=f.children.length-1;E>=0;E--)l.push({n:f.children[E],depth:S+1})}}function kh(){h.value=new Set,ua(r=>{r.children.length>0&&h.value.add(r.id)}),Se()}function fa(r){h.value=new Set,ua((l,f)=>{f>r&&l.children.length>0&&h.value.add(l.id)}),Se()}function yh(){h.value=new Set,Se()}function ma(r,l){qa(m.value,r,l)&&(Oe(),Se(),a("change",m.value))}function Qi(r,l,f){return hi(m.value,r,l,f)?(Oe(),Se(),a("change",m.value),!0):!1}function Eh(r){const l=p.value;if(!l)return;const f=m.value;if(l===f.id)return;const S=zt(f,l);if(!S)return;const E=S.children.findIndex(v=>v.id===l);if(E<0)return;let B=r;const M=rn.value.find(v=>v.id===l);if(M&&ha(M)&&(B=-r),B<0){if(E===0)return;const v=S.children[E-1].id;hi(f,l,v,"before")}else{if(E>=S.children.length-1)return;const v=S.children[E+1].id;hi(f,l,v,"after")}Oe(),Se(),a("change",f)}function xh(r,l){if(r.stopPropagation(),r.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]);at()}function wh(r,l,f){let S=null;for(const E of rn.value){if(E.id===f)continue;const B=E.width/2,M=E.height/2;r>=E.x-B&&r<=E.x+B&&l>=E.y-M&&l<=E.y+M&&(S=E)}return S}let jt=null;function Nh(r,l){if(i.previewMode||l.isRoot||r.button!==0)return;const f=r.target;if(f!=null&&f.closest(".zm-img-resize-handle"))return;r.stopPropagation();const S=c.value.getBoundingClientRect(),E=l.x*pe.scale.value+pe.offsetX.value,B=l.y*pe.scale.value+pe.offsetY.value,M=r.clientX-S.left-E,v=r.clientY-S.top-B;jt={srcId:l.id,srcText:l.text,pointerOffsetX:M,pointerOffsetY:v,startX:r.clientX,startY:r.clientY},window.addEventListener("pointermove",pa),window.addEventListener("pointerup",ci),window.addEventListener("pointercancel",ci)}function pa(r){if(jt){const M=r.clientX-jt.startX,v=r.clientY-jt.startY;if(Math.abs(M)<=Gl&&Math.abs(v)<=Gl)return;C.value={srcId:jt.srcId,srcText:jt.srcText,pointerOffsetX:jt.pointerOffsetX,pointerOffsetY:jt.pointerOffsetY,currentTargetId:null,dropPosition:null},document.body.classList.add("is-dragging"),jt=null}const l=C.value;if(!l)return;const f=c.value.getBoundingClientRect();$.value=r.clientX-f.left-l.pointerOffsetX,R.value=r.clientY-f.top-l.pointerOffsetY;const S=(r.clientX-f.left-pe.offsetX.value)/pe.scale.value,E=(r.clientY-f.top-pe.offsetY.value)/pe.scale.value,B=wh(S,E,l.srcId);l.currentTargetId=(B==null?void 0:B.id)??null,B?l.dropPosition=Sh(S,E,B):l.dropPosition=null}function Sh(r,l,f){if(f.isRoot)return"child";const S=f.width/2,E=f.height/2;if(f._dir==="down"){const M=r-f.x;return M<-S*.3?"before":M>S*.3?"after":"child"}const B=l-f.y;return B<-E*.3?"before":B>E*.3?"after":"child"}function ha(r){var l;return!!((l=r.parent)!=null&&l.isRoot)&&r._dir==="left"}function ci(r){if(window.removeEventListener("pointermove",pa),window.removeEventListener("pointerup",ci),window.removeEventListener("pointercancel",ci),jt){jt=null;return}const l=C.value;if(l){if(l.currentTargetId&&l.dropPosition){let f=l.dropPosition;if(f!=="child"){const S=rn.value.find(E=>E.id===l.currentTargetId);S&&ha(S)&&(f=f==="before"?"after":"before")}Qi(l.srcId,l.currentTargetId,f),d.value=new Set([l.srcId]),at()}C.value=null,$.value=0,R.value=0,document.body.classList.remove("is-dragging")}}let di=!1;function Th(r){const l=r.target;if(!l||l.closest(".zm-node, .zm-toolbar, button, input, textarea"))return;if(r.button===2){di=!0,pe.startPan(r);return}if(di=!1,r.button!==0)return;const f=c.value.getBoundingClientRect(),S=(r.clientX-f.left-pe.offsetX.value)/pe.scale.value,E=(r.clientY-f.top-pe.offsetY.value)/pe.scale.value;pe.startMarquee(S,E,{shift:r.shiftKey})}function Ch(r){if(Rn){Rn=!1;return}const l=r.target;if(!l||l.closest(".zm-node"))return;const f=pe.marquee;f.width>=4||f.height>=4||d.value.size>0&&(d.value=new Set,at())}function Mh(){const r=pe.marquee;if(r.width<4&&r.height<4)return;const l=r.x,f=r.y,S=r.x+r.width,E=r.y+r.height,B=[];for(const M of rn.value){const v=M.width/2,j=M.height/2,K=M.x-v,ye=M.x+v,T=M.y-j,Q=M.y+j;K<=S&&ye>=l&&T<=E&&Q>=f&&B.push(M.id)}d.value=r.shiftKey?new Set([...d.value,...B]):new Set(B),at()}function ga(r){return h.value.has(r)}function Ah(r){const l=he(m.value,r.id);return!!l&&l.children.length>0}function er(r){const l=he(m.value,r);return l?l.children.length:0}function ba(r){if(!he(m.value,r))return 0;const S=[m.value];for(;S.length;){const E=S.pop(),B=E.children.findIndex(M=>M.id===r);if(B>=0)return B;for(const M of E.children)S.push(M)}return 0}function ui(r,l,f,S){const E=(S==null?void 0:S._dir)??r._dir;if(l==="out"&&r.isRoot&&_.lineOrigin==="center")return{x:r.x,y:r.y};if(l==="out"&&r.isRoot&&_.lineOrigin==="proportional"&&S){const v=pt.value.root.children;if(E==="down"){const de=v.reduce((Me,te)=>Math.max(Me,Math.abs(te.x-r.x)),1),se=Math.min(1,Math.abs(S.x-r.x)/de),Te=r.y+r.height/2,Ie=r.y;return{x:r.x,y:Te+(Ie-Te)*se}}const j=v.reduce((de,se)=>Math.max(de,Math.abs(se.y-r.y)),1),K=Math.min(1,Math.abs(S.y-r.y)/j),ye=f!==void 0?f:r.side,T=r.x+ye*(r.width/2),Q=r.x;return{x:T+(Q-T)*K,y:r.y}}if(E==="down")return l==="out"?{x:r.x,y:r.y+r.height/2}:{x:r.x,y:r.y-r.height/2};let B;l==="in"?B=-r.side:f!==void 0?B=f:B=r.side;const M=l==="in"?r._richInsetX??0:0;return{x:r.x+B*(r.width/2-M),y:r.y}}function ln(){const r=pt.value;pe.resetView(r.width,r.height,r.root.y)}function _h(){Qn.value=!0,Oe(),Se(),e.nextTick(()=>ln())}function tr(r){_.layoutMode!==r&&(_.layoutMode=r,Se(),e.nextTick(()=>ln()))}function Rh(){return JSON.stringify(m.value,null,2)}function ka(r){const l=he(m.value,r);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 Bh(r){try{const l=JSON.parse(r);return!l.id||!Array.isArray(l.children)?!1:(Gt.reset(),m.value=It(l),d.value=new Set,h.value=new Set,Se(),e.nextTick(()=>ln()),a("change",m.value),!0)}catch{return!1}}const ya=e.ref(""),an=e.ref([]),So=e.ref(-1);function vh(r){ya.value=r;const l=r.trim();if(!l){an.value=[],So.value=-1;return}const f=l.toLowerCase(),S=[],E=B=>{var M;(B.text.toLowerCase().includes(f)||(M=B.note)!=null&&M.text&&B.note.text.toLowerCase().includes(f))&&S.push(B.id);for(const v of B.children)E(v)};E(m.value),an.value=S,So.value=S.length>0?0:-1,S.length>0&&(Lh(S),e.nextTick(()=>Dh(0)))}function Ih(r){return an.value.includes(r)}function zh(r){return So.value>=0&&an.value[So.value]===r}function Oh(r){return ya.value.trim().length>0&&an.value.length>0&&!an.value.includes(r)}function Lh(r){if(r.length===0)return;const l=new Set(r),f=new Set,S=E=>{let B=l.has(E.id);for(const M of E.children)S(M)&&(B=!0);return B&&E.children.length>0&&h.value.has(E.id)&&f.add(E.id),B};if(S(m.value),f.size>0){for(const E of f)h.value.delete(E);Se()}}function Dh(r){const l=an.value[r];if(!l)return;const f=rn.value.find(S=>S.id===l);f&&(d.value=new Set([l]),at(),pe.centerOn(f.x,f.y,f.width,f.height))}function Vh(r,l){const f=he(m.value,r);f&&(f.markers||(f.markers=[]),!f.markers.includes(l)&&(f.markers.push(l),Oe(),Se(),a("change",m.value)))}function $h(r,l){const f=he(m.value,r);if(!f||!f.markers)return;const S=f.markers.indexOf(l);S<0||(f.markers.splice(S,1),f.markers.length===0&&delete f.markers,Oe(),Se(),a("change",m.value))}function Ea(r,l){const f=he(m.value,r);if(!f)return!1;f.markers||(f.markers=[]);const S=f.markers.indexOf(l);return S>=0?(f.markers.splice(S,1),f.markers.length===0&&delete f.markers,Oe(),Se(),a("change",m.value),!1):(f.markers.push(l),Oe(),Se(),a("change",m.value),!0)}function Ph(r){const l=he(m.value,r);return l!=null&&l.markers?[...l.markers]:[]}function Fh(r){var f;const l=(f=I.value)==null?void 0:f.nodeId;l&&Ea(l,r)}function Uh(){var f;const r=(f=I.value)==null?void 0:f.nodeId;if(!r)return;const l=he(m.value,r);!l||!l.markers||(delete l.markers,Oe(),Se(),a("change",m.value),Ee())}function nr(r,l){const f=he(m.value,r);f&&(l.length===0?f.tags&&delete f.tags:f.tags=[...l],Oe(),Se(),a("change",m.value))}function Hh(r){const l=he(m.value,r);return l!=null&&l.tags?[...l.tags]:[]}function Wh(){var B,M;const r=(B=I.value)==null?void 0:B.nodeId;if(!r)return;const l=he(m.value,r),f=((M=l==null?void 0:l.tags)==null?void 0:M.join(", "))??"",S=window.prompt("输入标签(多个用逗号分隔)",f);if(S===null)return;const E=S.split(/[,,]/).map(v=>v.trim()).filter(v=>v.length>0);nr(r,E),Ee()}function Gh(){var l;const r=(l=I.value)==null?void 0:l.nodeId;r&&(nr(r,[]),Ee())}function xa(){const r=pt.value,l="http://www.w3.org/2000/svg",f=document.createElementNS(l,"svg");f.setAttribute("xmlns",l),f.setAttribute("viewBox",`${r.vbX} ${r.vbY} ${r.vbW} ${r.vbH}`),f.setAttribute("width",String(r.vbW)),f.setAttribute("height",String(r.vbH));const S=document.createElementNS(l,"rect");S.setAttribute("x",String(r.vbX)),S.setAttribute("y",String(r.vbY)),S.setAttribute("width",String(r.vbW)),S.setAttribute("height",String(r.vbH)),S.setAttribute("fill",Qt.value),f.appendChild(S);for(const M of Jl.value){const v=document.createElementNS(l,"path");v.setAttribute("d",yt(ui(M.from,"out",M.to.side,M.to),ui(M.to,"in"),L(M.from.depth),Z(M.to.depth),32,g(M.from.isRoot),M.to._dir)),v.setAttribute("fill",wo(M.from,M.to)),v.setAttribute("stroke","none"),f.appendChild(v)}const E="-apple-system,BlinkMacSystemFont,'Segoe UI','PingFang SC','Microsoft YaHei',sans-serif";function B(M,v){let j=0;for(const K of M)/[\u4e00-\u9fff\u3000-\u30ff\uff00-\uffef]/.test(K)?j+=v:j+=v*.55;return j}for(const M of rn.value){const v=M.x-M.width/2,j=M.y-M.height/2,K=document.createElementNS(l,"rect");K.setAttribute("x",String(v)),K.setAttribute("y",String(j)),K.setAttribute("width",String(M.width)),K.setAttribute("height",String(M.height)),K.setAttribute("rx","8"),K.setAttribute("fill",Kl(M)),K.setAttribute("stroke",to(M)),K.setAttribute("stroke-width","1"),f.appendChild(K);const ye=!!(M.tags&&M.tags.length>0),T=!!(M.markers&&M.markers.length>0),Q=!!M.image,de=!!(M.richContent&&(M.richContent.kind==="code"||M.richContent.kind==="table"));let se=0,Te=0;if(de){const We=M.richContent,Ke=M.fontSize*.78*.92,Ct=6,Pe=4,Kt=2,kn=6;if(We.kind==="code"){const _t=Go(We.raw),Et=wn(We.raw),Rt=_t.split(`
137
+ `),tn=Ke*1.35;let Ft=0;for(const Fe of Rt)Ft=Math.max(Ft,B(Fe,Ke));Te=Math.min(Ft+Ct*2+4,M.width-4),se=Rt.length*tn+Pe*2+Kt;const Qe=M.x-Te/2;let ht=j+4;Q&&(ht=j+M.image.height+kn);const Bt=document.createElementNS(l,"rect");if(Bt.setAttribute("x",String(Qe)),Bt.setAttribute("y",String(ht)),Bt.setAttribute("width",String(Te)),Bt.setAttribute("height",String(se-Kt)),Bt.setAttribute("rx","6"),Bt.setAttribute("fill","rgba(255,255,255,0.55)"),Bt.setAttribute("stroke",to(M)),Bt.setAttribute("stroke-width","1"),f.appendChild(Bt),Et){const Fe=document.createElementNS(l,"text");Fe.setAttribute("x",String(Qe+Te-Ct)),Fe.setAttribute("y",String(ht+Pe+4)),Fe.setAttribute("text-anchor","end"),Fe.setAttribute("fill",eo(M)),Fe.setAttribute("font-size",String(Ke*.8)),Fe.setAttribute("font-family",E),Fe.setAttribute("opacity","0.5"),Fe.textContent=Et,f.appendChild(Fe)}const Co="'JetBrains Mono','Fira Code',Consolas,monospace";for(let Fe=0;Fe<Rt.length;Fe++){const st=document.createElementNS(l,"text");st.setAttribute("x",String(Qe+Ct)),st.setAttribute("y",String(ht+Pe+(Fe+.5)*tn+2)),st.setAttribute("dominant-baseline","central"),st.setAttribute("fill",eo(M)),st.setAttribute("font-size",String(Ke)),st.setAttribute("font-family",Co);let Ut=Rt[Fe];const Ye=Math.floor((Te-Ct*2)/(Ke*.6));Ut.length>Ye&&(Ut=Ut.substring(0,Ye-1)+"…"),st.textContent=Ut,f.appendChild(st)}}else if(We.kind==="table"){const _t=Ai(We.raw);if(_t.length>0){const Et=Ke*1.35,Rt=6,tn=3,Ft=_t[0].length,Qe=[];for(let Ye=0;Ye<Ft;Ye++){let sn=0;for(const yn of _t)Ye<yn.length&&(sn=Math.max(sn,B(yn[Ye],Ke)));Qe.push(sn+Rt*2)}Te=Math.min(Qe.reduce((Ye,sn)=>Ye+sn,0),M.width-4);const ht=Te/Qe.reduce((Ye,sn)=>Ye+sn,0);for(let Ye=0;Ye<Ft;Ye++)Qe[Ye]*=ht;se=_t.length*(Et+tn*2)+Kt;const Bt=M.x-Te/2;let Co=j+4;Q&&(Co=j+M.image.height+kn);const Fe=document.createElementNS(l,"rect");Fe.setAttribute("x",String(Bt)),Fe.setAttribute("y",String(Co)),Fe.setAttribute("width",String(Te)),Fe.setAttribute("height",String(se-Kt)),Fe.setAttribute("rx","6"),Fe.setAttribute("fill","rgba(255,255,255,0.55)"),Fe.setAttribute("stroke",to(M)),Fe.setAttribute("stroke-width","1"),f.appendChild(Fe);let st=Bt,Ut=Co;for(let Ye=0;Ye<_t.length;Ye++){const sn=_t[Ye],yn=Et+tn*2;st=Bt;for(let Mo=0;Mo<Ft;Mo++){const oo=Qe[Mo],jh=sn[Mo]||"";if(Mo<Ft-1){const qe=document.createElementNS(l,"line");qe.setAttribute("x1",String(st+oo)),qe.setAttribute("y1",String(Ut)),qe.setAttribute("x2",String(st+oo)),qe.setAttribute("y2",String(Ut+yn)),qe.setAttribute("stroke",to(M)),qe.setAttribute("stroke-width","1"),f.appendChild(qe)}if(Ye<_t.length-1){const qe=document.createElementNS(l,"line");qe.setAttribute("x1",String(st)),qe.setAttribute("y1",String(Ut+yn)),qe.setAttribute("x2",String(st+oo)),qe.setAttribute("y2",String(Ut+yn)),qe.setAttribute("stroke",to(M)),qe.setAttribute("stroke-width","1"),f.appendChild(qe)}if(Ye===0){const qe=document.createElementNS(l,"rect");qe.setAttribute("x",String(st)),qe.setAttribute("y",String(Ut)),qe.setAttribute("width",String(oo)),qe.setAttribute("height",String(yn)),qe.setAttribute("fill","rgba(255,255,255,0.4)"),f.appendChild(qe)}const cn=document.createElementNS(l,"text");cn.setAttribute("x",String(st+Rt)),cn.setAttribute("y",String(Ut+tn+Et/2+2)),cn.setAttribute("dominant-baseline","central"),cn.setAttribute("fill",eo(M)),cn.setAttribute("font-size",String(Ke)),cn.setAttribute("font-family",E),Ye===0&&cn.setAttribute("font-weight","600");let fi=jh;const or=Math.floor((oo-Rt*2)/(Ke*.55));fi.length>or&&or>2&&(fi=fi.substring(0,or-1)+"…"),cn.textContent=fi,f.appendChild(cn),st+=oo}Ut+=yn}}}}let Ie=0;if(Q){const We=M.image,Ke=j+4,Ct=M.x-We.width/2,Pe=document.createElementNS(l,"image");Pe.setAttribute("x",String(Ct)),Pe.setAttribute("y",String(Ke)),Pe.setAttribute("width",String(We.width)),Pe.setAttribute("height",String(We.height)),Pe.setAttribute("href",We.src),Pe.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",We.src),Pe.setAttribute("preserveAspectRatio","xMidYMid meet"),f.appendChild(Pe),Ie=We.height+6}let Me=M.y;const te=Ie+se;te>0?Me=j+te+(M.height-te)/2:ye&&(Me=M.y-8);const ne=14,je=2,Y=4,$e=T?M.markers.length:0,Nt=$e>0?$e*ne+($e-1)*je+Y:0,Pt=B(M.text,M.fontSize),Bn=Nt+Pt,St=M.x-Bn/2;if(T){let We=St;for(const Ke of M.markers){const Ct=zo(Ke);if(Ct){const Pe=document.createElementNS(l,"svg");Pe.setAttribute("x",String(We)),Pe.setAttribute("y",String(Me-ne/2)),Pe.setAttribute("width",String(ne)),Pe.setAttribute("height",String(ne)),Pe.setAttribute("viewBox","0 0 24 24"),Pe.setAttribute("color",eo(M));const kn=new DOMParser().parseFromString(`<svg xmlns="${l}">${Ct}</svg>`,"image/svg+xml");if(!kn.querySelector("parsererror"))for(;kn.documentElement.firstChild;)Pe.appendChild(kn.documentElement.firstChild);f.appendChild(Pe)}We+=ne+je}}const vn=T?St+Nt+Pt/2:M.x,Tt=document.createElementNS(l,"text");if(Tt.setAttribute("x",String(vn)),Tt.setAttribute("y",String(Me)),Tt.setAttribute("text-anchor","middle"),Tt.setAttribute("dominant-baseline","central"),Tt.setAttribute("fill",eo(M)),Tt.setAttribute("font-size",String(ql(M))),Tt.setAttribute("font-weight",String(Yl(M))),Tt.setAttribute("font-family",E),Tt.textContent=M.text,f.appendChild(Tt),ye){const Pe=M.y+10,Kt=M.tags.map(Et=>B(Et,10)+12),kn=Kt.reduce((Et,Rt)=>Et+Rt+3,-3);let _t=M.x-kn/2;for(let Et=0;Et<M.tags.length;Et++){const Rt=M.tags[Et],tn=bi(Rt),Ft=Kt[Et],Qe=document.createElementNS(l,"rect");Qe.setAttribute("x",String(_t)),Qe.setAttribute("y",String(Pe-16/2)),Qe.setAttribute("width",String(Ft)),Qe.setAttribute("height",String(16)),Qe.setAttribute("rx",String(16/2)),Qe.setAttribute("fill",tn.background),Qe.setAttribute("stroke",tn.borderColor),Qe.setAttribute("stroke-width","1"),f.appendChild(Qe);const ht=document.createElementNS(l,"text");ht.setAttribute("x",String(_t+Ft/2)),ht.setAttribute("y",String(Pe)),ht.setAttribute("text-anchor","middle"),ht.setAttribute("dominant-baseline","central"),ht.setAttribute("fill",tn.color),ht.setAttribute("font-size",String(10)),ht.setAttribute("font-family",E),ht.textContent=Rt,f.appendChild(ht),_t+=Ft+3}}}return f}function To(){const r=xa();let f=new XMLSerializer().serializeToString(r);f.startsWith("<?xml")||(f=`<?xml version="1.0" encoding="UTF-8"?>
138
+ `+f);const S=new Blob([f],{type:"image/svg+xml;charset=utf-8"}),E=URL.createObjectURL(S),B=document.createElement("a");B.href=E,B.download=`${m.value.text||"mindmap"}.svg`,B.click(),URL.revokeObjectURL(E)}function wa(r=2){const l=xa(),f=pt.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"}),M=URL.createObjectURL(B),v=new window.Image;v.onload=()=>{const j=document.createElement("canvas");j.width=Math.ceil(f.vbW*r),j.height=Math.ceil(f.vbH*r);const K=j.getContext("2d");if(!K){URL.revokeObjectURL(M);return}K.fillStyle=Qt.value,K.fillRect(0,0,j.width,j.height),K.drawImage(v,0,0,j.width,j.height),URL.revokeObjectURL(M);try{j.toBlob(ye=>{if(!ye){To();return}const T=URL.createObjectURL(ye),Q=document.createElement("a");Q.href=T,Q.download=`${m.value.text||"mindmap"}.png`,Q.click(),URL.revokeObjectURL(T)},"image/png")}catch(ye){console.warn("PNG export failed, falling back to SVG:",ye),To()}},v.onerror=()=>{URL.revokeObjectURL(M),To()},v.src=M}return o({addChild:r=>no(r),addSibling:r=>si(r),removeNode:r=>ca(r),duplicateNode:r=>na(r),setNodeText:(r,l)=>ma(r,l),moveNode:(r,l,f)=>Qi(r,l,f),lineWidthForDepth:L,endWidthForDepth:Z,getData:()=>m.value,nodeHasContent:r=>ka(r),getSelectedIds:()=>[...d.value],copyNodes:r=>la(r),cutNodes:r=>aa(r),pasteNodes:r=>sa(r),setData:r=>{Gt.reset(),m.value=It(r),d.value=new Set,h.value=new Set,Se(),Oe(),e.nextTick(()=>ln())},resetView:()=>ln(),exportData:Rh,importData:Bh,getMarkdown:()=>Ln(m.value),setMarkdown:(r,l=!0)=>{const f=On(r||"");l&&(q.value=!0),w=!l,Gt.reset(),m.value=It(f),d.value=new Set,h.value=new Set,Se(),Oe(),e.nextTick(()=>{w=!1,ln()}),a("change",m.value)},setBalanced:r=>{Qn.value=r},isBalanced:()=>Qn.value,balance:()=>_h(),applyNodeStyle:(r,l)=>J(r,l),getNodeStyle:r=>me(r),applyNodeImage:(r,l)=>ae(r,l),applyNodeImageByUrl:(r,l)=>b(r,l),removeNodeImage:r=>ke(r),applyNodeLink:(r,l)=>ge(r,l),removeNodeLink:r=>D(r),applyNodeNote:(r,l)=>z(r,l),removeNodeNote:r=>le(r),applyNodeRichContent:(r,l)=>be(r,l),addNodeMarker:(r,l)=>Vh(r,l),removeNodeMarker:(r,l)=>$h(r,l),toggleNodeMarker:(r,l)=>Ea(r,l),getNodeMarkers:r=>Ph(r),setNodeTags:(r,l)=>nr(r,l),getNodeTags:r=>Hh(r),exportPNG:r=>wa(r),exportSVG:()=>To(),searchNodes:r=>(vh(r),[...an.value]),undo:()=>Zi(),redo:()=>Ji(),canUndo:()=>Gt.canUndo(),canRedo:()=>Gt.canRedo(),applySettings:r=>{r.autoBalanceOnChange!==void 0&&(_.autoBalanceOnChange=r.autoBalanceOnChange),r.lineWidthStart!==void 0&&(_.lineWidthStart=Math.max(.5,Math.min(20,r.lineWidthStart))),r.lineWidthEnd!==void 0&&(_.lineWidthEnd=Math.max(.3,Math.min(10,r.lineWidthEnd))),r.rainbowBranch!==void 0&&(_.rainbowBranch=r.rainbowBranch),r.branchPaletteId!==void 0&&(_.branchPaletteId=r.branchPaletteId),r.customPalettes!==void 0&&(_.customPalettes=r.customPalettes),r.lineStyle!==void 0&&(_.lineStyle=r.lineStyle),r.rootLineStyle!==void 0&&(_.rootLineStyle=r.rootLineStyle),r.lineOrigin!==void 0&&(_.lineOrigin=r.lineOrigin),r.taperedEdge!==void 0&&(_.taperedEdge=r.taperedEdge),r.lineWidthTaper!==void 0&&(_.lineWidthTaper=Math.max(.3,Math.min(1,r.lineWidthTaper))),r.elbowRadius!==void 0&&(_.elbowRadius=Math.max(2,Math.min(20,r.elbowRadius))),r.showOrderBadge!==void 0&&(_.showOrderBadge=r.showOrderBadge),r.canvasBg!==void 0&&(_.canvasBg=r.canvasBg)},getSettings:()=>({autoBalanceOnChange:_.autoBalanceOnChange,lineWidthStart:_.lineWidthStart,lineWidthEnd:_.lineWidthEnd,rainbowBranch:_.rainbowBranch,branchPaletteId:_.branchPaletteId,customPalettes:_.customPalettes,lineStyle:_.lineStyle,rootLineStyle:_.rootLineStyle,lineOrigin:_.lineOrigin,layoutMode:_.layoutMode,taperedEdge:_.taperedEdge,lineWidthTaper:_.lineWidthTaper,elbowRadius:_.elbowRadius,showOrderBadge:_.showOrderBadge,canvasBg:_.canvasBg}),setBranchPalette:r=>{if(!r)return;[...dn,..._.customPalettes].find(f=>f.id===r)&&(_.branchPaletteId=r)},getBranchPalette:()=>_.branchPaletteId,getBranchPalettes:()=>[...dn,..._.customPalettes],getSearchResults:()=>[...an.value],getSearchIndex:()=>So.value}),e.watch(()=>i.data,r=>{m.value=It(r),Se()},{deep:!1}),e.onMounted(()=>{Oe(),e.nextTick(()=>ln())}),(r,l)=>{var f,S,E,B,M,v,j,K,ye;return e.openBlock(),e.createElementBlock("div",{class:"zm-mindmap",style:e.normalizeStyle({background:Qt.value,fontSize:lt.value.fontSize+"px"})},[e.createElementVNode("div",{ref_key:"wrapperRef",ref:c,class:"zm-canvas",onMousedown:Th,onContextmenu:et,onWheel:l[25]||(l[25]=(...T)=>e.unref(pe).onWheel&&e.unref(pe).onWheel(...T)),onMouseenter:l[26]||(l[26]=T=>x.value=!0),onMouseleave:l[27]||(l[27]=T=>x.value=!1),onClick:Ch},[e.createElementVNode("div",{class:"zm-svg-layer",style:e.normalizeStyle({left:pt.value.vbX*e.unref(pe).scale.value+e.unref(pe).offsetX.value+"px",top:pt.value.vbY*e.unref(pe).scale.value+e.unref(pe).offsetY.value+"px",width:pt.value.vbW*e.unref(pe).scale.value+"px",height:pt.value.vbH*e.unref(pe).scale.value+"px"})},[(e.openBlock(),e.createElementBlock("svg",{class:"zm-svg",viewBox:ch.value,preserveAspectRatio:"xMinYMin meet",width:pt.value.vbW*e.unref(pe).scale.value,height:pt.value.vbH*e.unref(pe).scale.value},[e.createElementVNode("g",Ip,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Jl.value,T=>(e.openBlock(),e.createElementBlock("path",{key:T.key,d:yt(ui(T.from,"out",T.to.side,T.to),ui(T.to,"in"),L(T.from.depth),Z(T.to.depth),32,g(T.from.isRoot),T.to._dir),fill:wo(T.from,T.to),stroke:"none"},null,8,zp))),128))])],8,vp))],4),e.unref(pe).isMarquee.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-marquee",style:e.normalizeStyle({left:e.unref(pe).marquee.x*e.unref(pe).scale.value+e.unref(pe).offsetX.value+"px",top:e.unref(pe).marquee.y*e.unref(pe).scale.value+e.unref(pe).offsetY.value+"px",width:e.unref(pe).marquee.width*e.unref(pe).scale.value+"px",height:e.unref(pe).marquee.height*e.unref(pe).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(pe).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(pe).offsetX.value}px, ${e.unref(pe).offsetY.value}px) scale(${e.unref(pe).scale.value})`})},[F.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-drop-indicator",style:e.normalizeStyle({left:F.value.x1+"px",top:F.value.y1+"px",width:F.value.horizontal?F.value.x2-F.value.x1+"px":"3px",height:F.value.horizontal?"3px":F.value.y2-F.value.y1+"px",transform:F.value.horizontal?"translateY(-1.5px)":"translateX(-1.5px)"})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(rn.value,T=>{var Q,de,se,Te,Ie,Me,te;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":qi.value===T.id,"is-dragging-source":((Q=C.value)==null?void 0:Q.srcId)===T.id,"is-drop-target":((de=C.value)==null?void 0:de.currentTargetId)===T.id&&((se=C.value)==null?void 0:se.dropPosition)==="child","is-drop-target-before":((Te=C.value)==null?void 0:Te.currentTargetId)===T.id&&((Ie=C.value)==null?void 0:Ie.dropPosition)==="before","is-drop-target-after":((Me=C.value)==null?void 0:Me.currentTargetId)===T.id&&((te=C.value)==null?void 0:te.dropPosition)==="after","is-search-hit":Ih(T.id),"is-search-current":zh(T.id),"is-search-dimmed":Oh(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:ql(T)+"px",background:Kl(T),color:eo(T),borderColor:to(T),fontWeight:Yl(T),transform:"translate(-50%, -50%)"}),onClick:ne=>xh(ne,T),onPointerdown:ne=>Nh(ne,T),onDblclick:ne=>{ne.stopPropagation(),t.previewMode||No(T.id)},onContextmenu:ne=>oe(ne,T),onMouseenter:ne=>{Zn(T.id),Jn(ne,T)},onMouseleave:ne=>bn(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,Lp)):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=>fh(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:ta,onKeydown:ph},null,544)),[[e.vModelText,k.value]]):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[T.richContent.kind==="code"?(e.openBlock(),e.createElementBlock("pre",Vp,[e.createElementVNode("code",{innerHTML:e.unref(Mi)(e.unref(Go)(T.richContent.raw),e.unref(wn)(T.richContent.raw))},null,8,$p)])):T.richContent.kind==="table"?(e.openBlock(),e.createElementBlock("table",Pp,[e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(Ai)(T.richContent.raw),(ne,je)=>(e.openBlock(),e.createElementBlock("tr",{key:je},[je===0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(ne,(Y,$e)=>(e.openBlock(),e.createElementBlock("th",{key:`h${$e}`},e.toDisplayString(Y),1))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(ne,(Y,$e)=>(e.openBlock(),e.createElementBlock("td",{key:`c${$e}`},e.toDisplayString(Y),1))),128))]))),128))])])):e.createCommentVNode("",!0)],64))],42,Dp)):e.createCommentVNode("",!0),s.value!==T.id?(e.openBlock(),e.createElementBlock("span",Fp,[T.markers&&T.markers.length>0?(e.openBlock(),e.createElementBlock("span",Up,[(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(Nr)(ne),innerHTML:'<svg viewBox="0 0 24 24" width="14" height="14">'+e.unref(zo)(ne)+"</svg>"},null,8,Hp))),128))])):e.createCommentVNode("",!0),e.createElementVNode("span",Wp,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(_e,{name:"link",size:11,stroke:2})],40,Gp)):e.createCommentVNode("",!0),T.note&&s.value!==T.id?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-node-note-btn",type:"button",title:li(T.note.text),onClick:e.withModifiers(ne=>ri(T.id),["stop"]),onMousedown:l[5]||(l[5]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(_e,{name:"note",size:11,stroke:2})],40,jp)):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=>Xi()),onKeydown:[l[8]||(l[8]=e.withKeys(e.withModifiers(ne=>Xi(),["exact","prevent"]),["enter"])),l[9]||(l[9]=e.withKeys(e.withModifiers(ne=>Xi(),["prevent"]),["tab"])),e.withKeys(dh,["esc"]),hh],onInput:uh,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",Kp,[(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(bi)(ne))},e.toDisplayString(ne),5))),128))])):e.createCommentVNode("",!0),ie.value?(e.openBlock(),e.createElementBlock("span",{key:5,class:"zm-order-badge",title:`数据顺序:第 ${ba(T.id)+1} 个`},e.toDisplayString(ba(T.id)+1),9,Yp)):e.createCommentVNode("",!0),ga(T.id)&&er(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:`展开 ${er(T.id)} 个子节点`,onMousedown:l[12]||(l[12]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(ne=>da(T.id),["stop"])},e.toDisplayString(er(T.id)),47,qp)):e.createCommentVNode("",!0),Ah(T)&&!ga(T.id)?(e.openBlock(),e.createElementBlock("button",{key:7,class:e.normalizeClass(["zm-btn zm-collapse",{"is-on-left":T.side===-1}]),style:e.normalizeStyle({color:en.value.get(T.id)??"#64748b",borderColor:en.value.get(T.id)??"#64748b"}),title:"折叠",onMousedown:l[13]||(l[13]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(ne=>da(T.id),["stop"])},[e.createVNode(_e,{name:"minus",size:10,stroke:2.4})],46,Xp)):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=>Mt(ne,T),["stop"])},null,40,Zp)):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=>ke(T.id),["stop"])},[e.createVNode(_e,{name:"x",size:10,stroke:2.2})],40,Jp)):e.createCommentVNode("",!0)],46,Op)}),128))],4),A.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["zm-tooltip",{"is-below":!A.value.above}]),style:e.normalizeStyle({left:A.value.x+"px",top:A.value.y+"px"})},e.toDisplayString(A.value.text),7)):e.createCommentVNode("",!0),I.value?(e.openBlock(),e.createBlock(hs,{key:3,x:I.value.x,y:I.value.y,container:c.value,"has-image":!!((f=e.unref(he)(m.value,I.value.nodeId))!=null&&f.image),"has-link":!!((S=e.unref(he)(m.value,I.value.nodeId))!=null&&S.link),"has-note":!!((E=e.unref(he)(m.value,I.value.nodeId))!=null&&E.note),"has-code":((M=(B=e.unref(he)(m.value,I.value.nodeId))==null?void 0:B.richContent)==null?void 0:M.kind)==="code","has-table":((j=(v=e.unref(he)(m.value,I.value.nodeId))==null?void 0:v.richContent)==null?void 0:j.kind)==="table","node-markers":((K=e.unref(he)(m.value,I.value.nodeId))==null?void 0:K.markers)??[],"node-tags":((ye=e.unref(he)(m.value,I.value.nodeId))==null?void 0:ye.tags)??[],onPickImage:go,onRemoveImage:_n,onSetLink:ji,onRemoveLink:bo,onEditNote:ko,onRemoveNote:Ki,onAddCode:ii,onEditCode:ii,onRemoveCode:Yi,onAddTable:He,onEditTable:He,onRemoveTable:hn,onToggleMarker:Fh,onClearMarkers:Uh,onAddTag:Wh,onRemoveTags:Gh,onClose:Ee},null,8,["x","y","container","has-image","has-link","has-note","has-code","has-table","node-markers","node-tags"])):e.createCommentVNode("",!0),N.value?(e.openBlock(),e.createBlock(gs,{key:4,x:N.value.x,y:N.value.y,container:c.value,onOpenSettings:tt,onOpenData:nn,onOpenImport:nt,onExportPng:wa,onExportSvg:To,onClose:ut},null,8,["x","y","container"])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(U.value),title:i.previewMode?"退出预览模式":"进入预览模式",onClick:l[15]||(l[15]=T=>a("canvas-toggle-preview"))},[e.createVNode(_e,{name:i.previewMode?"eye-off":"eye",size:16},null,8,["name"])],10,Qp),e.createElementVNode("button",{class:e.normalizeClass(H.value),title:"显示大纲视图",onClick:ho},[e.createVNode(_e,{name:"outline",size:16})],2),e.createElementVNode("div",{class:e.normalizeClass(["zm-toolbar",{"is-preview-only":i.previewMode,"is-hovered":x.value}])},[e.createElementVNode("span",eh,e.toDisplayString(Math.round(e.unref(pe).scale.value*100))+"%",1),e.createElementVNode("button",{class:"zm-tb-btn",title:"放大",onClick:l[16]||(l[16]=(...T)=>e.unref(pe).zoomIn&&e.unref(pe).zoomIn(...T))},[e.createVNode(_e,{name:"zoom-in"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"缩小",onClick:l[17]||(l[17]=(...T)=>e.unref(pe).zoomOut&&e.unref(pe).zoomOut(...T))},[e.createVNode(_e,{name:"zoom-out"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"重置视图",onClick:ln},[e.createVNode(_e,{name:"reset"})]),l[37]||(l[37]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"全部收起",onClick:kh},[e.createVNode(_e,{name:"collapse-all"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"展开一级",onClick:l[18]||(l[18]=T=>fa(1))},[e.createVNode(_e,{name:"expand-level-1"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"展开二级",onClick:l[19]||(l[19]=T=>fa(2))},[e.createVNode(_e,{name:"expand-level-2"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"全部展开",onClick:yh},[e.createVNode(_e,{name:"expand-all"})]),i.previewMode?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[l[35]||(l[35]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"添加子节点 (Tab)",onClick:l[20]||(l[20]=T=>p.value&&no(p.value))},[e.createElementVNode("img",{src:e.unref(ar),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,th)]),e.createElementVNode("button",{class:"zm-tb-btn",title:"添加同级 (Enter)",onClick:l[21]||(l[21]=T=>p.value&&si(p.value))},[e.createElementVNode("img",{src:e.unref(lr),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,nh)]),l[36]||(l[36]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:_.layoutMode==="mindmap"}]),title:"思维导图布局 (中心辐射)",onClick:l[22]||(l[22]=T=>tr("mindmap"))},[e.createVNode(_e,{name:"mindmap"})],2),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:_.layoutMode==="tree"}]),title:"树形布局 (向右展开)",onClick:l[23]||(l[23]=T=>tr("tree"))},[e.createVNode(_e,{name:"tree"})],2),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:_.layoutMode==="org"}]),title:"组织结构布局 (向下展开)",onClick:l[24]||(l[24]=T=>tr("org"))},[e.createVNode(_e,{name:"org"})],2)],64))],2)],544),i.builtInDrawers?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(Ot,{side:"left",scope:"canvas",width:300,open:on.value&&!t.previewMode,title:"大纲","onUpdate:open":l[28]||(l[28]=T=>on.value=T)},{default:e.withCtx(()=>[e.createVNode(Oo,{data:m.value,"selected-id":p.value,"collapsed-ids":ot.value,"show-index":ie.value,onSelect:po,onToggleCollapse:pn,onEdit:oi,onAddChild:Kn,onAddSibling:Yn,onMove:$t},null,8,["data","selected-id","collapsed-ids","show-index"])]),_:1},8,["open"]),e.createVNode(Ot,{side:"right",scope:"canvas",width:360,open:Dt.value&&!t.previewMode,title:"数据","onUpdate:open":l[30]||(l[30]=T=>Dt.value=T)},{default:e.withCtx(()=>[e.createVNode(Lo,{data:m.value,"pending-mode":Vt.value,onImport:l[29]||(l[29]=T=>m.value=T),onConsumedMode:Ue},null,8,["data","pending-mode"])]),_:1},8,["open"]),e.createVNode(Ot,{side:"right",scope:"canvas",width:420,open:ue.value&&!t.previewMode,title:"Markdown","onUpdate:open":l[32]||(l[32]=T=>ue.value=T)},{default:e.withCtx(()=>[e.createVNode(Do,{data:m.value,onImport:l[31]||(l[31]=T=>m.value=T)},null,8,["data"])]),_:1},8,["open"]),e.createVNode(Ot,{side:"right",scope:"canvas",width:360,open:ft.value&&!t.previewMode,title:"节点内容","onUpdate:open":l[33]||(l[33]=T=>ft.value=T)},{default:e.withCtx(()=>[e.createVNode(Jo,{"selected-node":kt.value,"focus-tick":Be.value,onApply:it,onRemove:wt,onSetLink:An,onSetImage:ti,onSetRich:ni},null,8,["selected-node","focus-tick"])]),_:1},8,["open"]),e.createVNode(Ot,{side:"right",scope:"canvas",width:340,open:ze.value&&!t.previewMode,title:"设置","onUpdate:open":l[34]||(l[34]=T=>ze.value=T)},{default:e.withCtx(()=>{var T;return[e.createVNode(Vo,{settings:_,"has-selection":p.value!==null,"selected-node-text":(T=kt.value)==null?void 0:T.text,"node-style":X.value,"onUpdate:settings":re,"onUpdate:nodeStyle":xe,onReset:Ae},null,8,["settings","has-selection","selected-node-text","node-style"])]}),_:1},8,["open"])],64)):e.createCommentVNode("",!0)],4)}}}),oh={class:"zm-app"},ih={class:"zm-app-main"},rh={class:"zm-app-canvas"},jl=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"?i:typeof location<"u"&&location.hash==="#stress"?a:(typeof location<"u"&&location.hash==="#rich",o)}const i={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 V=(H,ie)=>({id:H,text:ie,children:[]}),w=[V("s_l1","左一"),V("s_l2","左二"),V("s_l3","左三"),V("s_l4","左四"),V("s_l5","左五"),V("s_l6","左六"),V("s_l7","左七")],P=[V("s_r1","右一"),V("s_r2","右二"),V("s_r3","右三"),V("s_r4","右四"),V("s_r5","右五"),V("s_r6","右六"),V("s_r7","右七")];return{id:"root",text:"flow-mindmap 思维导图",children:[...w,...P]}})(),c=e.ref(o),s=e.ref(null),f=e.ref(new Set),d=e.ref(!1),p=e.ref(!1),h=e.ref(!1),y=e.ref(!1),C=e.ref(0),D=e.ref(!1),_=e.ref(!1),F=e.ref(null);function R(){c.value=n()}function M(){p.value=!0,h.value=!1,y.value=!1}function k(V){M()}const u=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,elbowRadius:8,showOrderBadge:!1,canvasBg:void 0}),N=e.computed(()=>{var V;return s.value?((V=F.value)==null?void 0:V.getNodeStyle(s.value.id))??{}:{}});function $(V){var w;Object.assign(u,V),(w=F.value)==null||w.applySettings(V)}function j(V){var w;s.value&&((w=F.value)==null||w.applyNodeStyle(s.value.id,V))}function q(){var w;const V={autoBalanceOnChange:!0,lineWidthStart:16,lineWidthEnd:.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"rounded-elbow",rootLineStyle:"arc",lineOrigin:"proportional",layoutMode:"mindmap",taperedEdge:!0,lineWidthTaper:.3,elbowRadius:8,showOrderBadge:!1,canvasBg:void 0};Object.assign(u,V),(w=F.value)==null||w.applySettings(V)}function x(V){if(V.key==="Escape"){if(D.value){D.value=!1,V.stopPropagation();return}_.value&&(_.value=!1,V.stopPropagation())}}e.onMounted(()=>{var V;document.addEventListener("keydown",x),window.addEventListener("hashchange",R),(V=F.value)==null||V.applySettings({rainbowBranch:u.rainbowBranch,branchPaletteId:u.branchPaletteId,customPalettes:u.customPalettes,lineWidthStart:u.lineWidthStart,lineWidthEnd:u.lineWidthEnd,lineStyle:u.lineStyle,rootLineStyle:u.rootLineStyle,lineOrigin:u.lineOrigin})}),e.onBeforeUnmount(()=>{document.removeEventListener("keydown",x),window.removeEventListener("hashchange",R)});function ae(V){c.value=V}function fe(V){var P;const w=V&&V.length>0?V[0]:null;s.value=w,w?!y.value&&((P=F.value)!=null&&P.nodeHasContent(w.id))&&(p.value=!1,h.value=!1,y.value=!0):y.value=!1}e.watch(c,V=>{if(!s.value)return;const w=J(V,s.value.id);w?w!==s.value&&(s.value=w):s.value=null},{deep:!1});function me(V){if(!s.value||s.value.id!==V){const w=J(c.value,V);w&&(s.value=w)}p.value=!1,h.value=!1,y.value=!0,C.value++}function J(V,w){if(V.id===w)return V;for(const P of V.children){const H=J(P,w);if(H)return H}return null}function ge(V){var w;s.value&&((w=F.value)==null||w.applyNodeNote(s.value.id,V))}function de(){var V;s.value&&((V=F.value)==null||V.removeNodeNote(s.value.id))}function ye(V){var w;s.value&&((w=F.value)==null||w.applyNodeLink(s.value.id,V))}function b(V){var w;s.value&&((w=F.value)==null||w.applyNodeImageByUrl(s.value.id,V))}function L(V){var w;s.value&&((w=F.value)==null||w.applyNodeRichContent(s.value.id,V))}function G(V){const w=document.querySelector(`[data-node-id="${V.id}"]`);w&&w.click()}function ee(V){const w=new Set(f.value);w.has(V)?w.delete(V):w.add(V),f.value=w}function be(V){var w;(w=F.value)==null||w.setNodeText(V.id,V.text)}function O(V){var w;(w=F.value)==null||w.addChild(V)}function B(V){var w;(w=F.value)==null||w.addSibling(V)}function oe(V){var w;(w=F.value)==null||w.moveNode(V.srcId,V.targetId,V.position)}const te=e.computed(()=>{var V;return((V=s.value)==null?void 0:V.id)??null});return(V,w)=>(e.openBlock(),e.createElementBlock("div",th,[e.createVNode(It,{side:"left",width:300,open:d.value,title:"大纲","onUpdate:open":w[0]||(w[0]=P=>d.value=P)},{default:e.withCtx(()=>[e.createVNode(Oo,{data:c.value,"selected-id":te.value,"collapsed-ids":f.value,onSelect:G,onToggleCollapse:ee,onEdit:be,onAddChild:O,onAddSibling:B,onMove:oe},null,8,["data","selected-id","collapsed-ids"])]),_:1},8,["open"]),e.createElementVNode("main",nh,[_.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-app-preview-exit",title:"退出预览 (Esc)",onClick:w[1]||(w[1]=P=>_.value=!1)},[...w[11]||(w[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",oh,[e.createVNode(Qo,{ref_key:"mindMapRef",ref:F,data:c.value,"preview-mode":_.value,"built-in-drawers":!1,onChange:ae,onSelect:fe,onEditNote:me,onCanvasSettings:w[2]||(w[2]=P=>D.value=!0),onCanvasData:M,onCanvasImport:k,onCanvasTogglePreview:w[3]||(w[3]=P=>_.value=!_.value),onCanvasOutline:w[4]||(w[4]=P=>d.value=!0)},null,8,["data","preview-mode"])])]),e.createVNode(It,{side:"right",width:360,open:p.value&&!_.value,title:"数据","onUpdate:open":w[6]||(w[6]=P=>p.value=P)},{default:e.withCtx(()=>[e.createVNode(Lo,{data:c.value,onImport:w[5]||(w[5]=P=>c.value=P)},null,8,["data"])]),_:1},8,["open"]),e.createVNode(It,{side:"right",width:420,open:h.value&&!_.value,title:"Markdown","onUpdate:open":w[8]||(w[8]=P=>h.value=P)},{default:e.withCtx(()=>[e.createVNode(Do,{data:c.value,onImport:w[7]||(w[7]=P=>c.value=P)},null,8,["data"])]),_:1},8,["open"]),e.createVNode(It,{side:"right",width:360,open:y.value&&!_.value,title:"节点内容","onUpdate:open":w[9]||(w[9]=P=>y.value=P)},{default:e.withCtx(()=>[e.createVNode(Jo,{"selected-node":s.value,readonly:!1,"focus-tick":C.value,onApply:ge,onRemove:de,onSetLink:ye,onSetImage:b,onSetRich:L},null,8,["selected-node","focus-tick"])]),_:1},8,["open"]),e.createVNode(It,{side:"right",width:340,open:D.value&&!_.value,title:"设置","onUpdate:open":w[10]||(w[10]=P=>D.value=P)},{default:e.withCtx(()=>{var P;return[e.createVNode(Vo,{settings:u,"has-selection":s.value!==null,"selected-node-text":(P=s.value)==null?void 0:P.text,"node-style":N.value,"onUpdate:settings":$,"onUpdate:nodeStyle":j,onReset:q},null,8,["settings","has-selection","selected-node-text","node-style"])]}),_:1},8,["open"])]))}}),ih="0.5.8",rh={install(t){t.component("FlowMindMap",Qo),t.component("FlowMindMapOutline",Oo),t.component("FlowMindMapDrawer",It),t.component("FlowMindMapDataPanel",Lo),t.component("FlowMindMapMarkdownPanel",Do),t.component("FlowMindMapSettingsPanel",Vo),t.component("FlowMindMapNotePanel",Jo),t.component("FlowMindMapApp",Gl)}};Ce.DataPanel=Lo,Ce.Drawer=It,Ce.MARKER_LIB=pi,Ce.MarkdownPanel=Do,Ce.MindMap=Qo,Ce.MindMapApp=Gl,Ce.NotePanel=Jo,Ce.Outline=Oo,Ce.SettingsPanel=Vo,Ce.VERSION=ih,Ce.addChild=kr,Ce.addSibling=yr,Ce.clone=zt,Ce.default=rh,Ce.findNode=he,Ce.findParent=Ft,Ce.markdownToMindMap=In,Ce.markdownToRichMindMap=Za,Ce.markerDef=ss,Ce.markerLabel=wr,Ce.markerSvg=Io,Ce.mindMapToMarkdown=On,Ce.removeNode=Ro,Ce.richBlockToMarkdown=Ja,Ce.tagColor=hi,Ce.uid=Kt,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"?i:typeof location<"u"&&location.hash==="#stress"?a:(typeof location<"u"&&location.hash==="#rich",o)}const i={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 I=(H,oe)=>({id:H,text:oe,children:[]}),N=[I("s_l1","左一"),I("s_l2","左二"),I("s_l3","左三"),I("s_l4","左四"),I("s_l5","左五"),I("s_l6","左六"),I("s_l7","左七")],U=[I("s_r1","右一"),I("s_r2","右二"),I("s_r3","右三"),I("s_r4","右四"),I("s_r5","右五"),I("s_r6","右六"),I("s_r7","右七")];return{id:"root",text:"flow-mindmap 思维导图",children:[...N,...U]}})(),c=e.ref(o),s=e.ref(null),u=e.ref(new Set),d=e.ref(!1),p=e.ref(!1),h=e.ref(!1),x=e.ref(!1),C=e.ref(0),$=e.ref(!1),R=e.ref(!1),F=e.ref(null);function O(){c.value=n()}function A(){p.value=!0,h.value=!1,x.value=!1}function y(I){A()}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:.3,elbowRadius:8,showOrderBadge:!1,canvasBg:void 0}),m=e.computed(()=>{var I;return s.value?((I=F.value)==null?void 0:I.getNodeStyle(s.value.id))??{}:{}});function P(I){var N;Object.assign(k,I),(N=F.value)==null||N.applySettings(I)}function G(I){var N;s.value&&((N=F.value)==null||N.applyNodeStyle(s.value.id,I))}function q(){var N;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,elbowRadius:8,showOrderBadge:!1,canvasBg:void 0};Object.assign(k,I),(N=F.value)==null||N.applySettings(I)}function w(I){if(I.key==="Escape"){if($.value){$.value=!1,I.stopPropagation();return}R.value&&(R.value=!1,I.stopPropagation())}}e.onMounted(()=>{var I;document.addEventListener("keydown",w),window.addEventListener("hashchange",O),(I=F.value)==null||I.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",w),window.removeEventListener("hashchange",O)});function ie(I){c.value=I}function fe(I){var U;const N=I&&I.length>0?I[0]:null;s.value=N,N?!x.value&&((U=F.value)!=null&&U.nodeHasContent(N.id))&&(p.value=!1,h.value=!1,x.value=!0):x.value=!1}e.watch(c,I=>{if(!s.value)return;const N=J(I,s.value.id);N?N!==s.value&&(s.value=N):s.value=null},{deep:!1});function ce(I){if(!s.value||s.value.id!==I){const N=J(c.value,I);N&&(s.value=N)}p.value=!1,h.value=!1,x.value=!0,C.value++}function J(I,N){if(I.id===N)return I;for(const U of I.children){const H=J(U,N);if(H)return H}return null}function me(I){var N;s.value&&((N=F.value)==null||N.applyNodeNote(s.value.id,I))}function ae(){var I;s.value&&((I=F.value)==null||I.removeNodeNote(s.value.id))}function ke(I){var N;s.value&&((N=F.value)==null||N.applyNodeLink(s.value.id,I))}function b(I){var N;s.value&&((N=F.value)==null||N.applyNodeImageByUrl(s.value.id,I))}function V(I){var N;s.value&&((N=F.value)==null||N.applyNodeRichContent(s.value.id,I))}function W(I){const N=document.querySelector(`[data-node-id="${I.id}"]`);N&&N.click()}function ee(I){const N=new Set(u.value);N.has(I)?N.delete(I):N.add(I),u.value=N}function ge(I){var N;(N=F.value)==null||N.setNodeText(I.id,I.text)}function D(I){var N;(N=F.value)==null||N.addChild(I)}function z(I){var N;(N=F.value)==null||N.addSibling(I)}function le(I){var N;(N=F.value)==null||N.moveNode(I.srcId,I.targetId,I.position)}const be=e.computed(()=>{var I;return((I=s.value)==null?void 0:I.id)??null});return(I,N)=>(e.openBlock(),e.createElementBlock("div",oh,[e.createVNode(Ot,{side:"left",width:300,open:d.value,title:"大纲","onUpdate:open":N[0]||(N[0]=U=>d.value=U)},{default:e.withCtx(()=>[e.createVNode(Oo,{data:c.value,"selected-id":be.value,"collapsed-ids":u.value,onSelect:W,onToggleCollapse:ee,onEdit:ge,onAddChild:D,onAddSibling:z,onMove:le},null,8,["data","selected-id","collapsed-ids"])]),_:1},8,["open"]),e.createElementVNode("main",ih,[R.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-app-preview-exit",title:"退出预览 (Esc)",onClick:N[1]||(N[1]=U=>R.value=!1)},[...N[11]||(N[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",rh,[e.createVNode(Qo,{ref_key:"mindMapRef",ref:F,data:c.value,"preview-mode":R.value,"built-in-drawers":!1,onChange:ie,onSelect:fe,onEditNote:ce,onCanvasSettings:N[2]||(N[2]=U=>$.value=!0),onCanvasData:A,onCanvasImport:y,onCanvasTogglePreview:N[3]||(N[3]=U=>R.value=!R.value),onCanvasOutline:N[4]||(N[4]=U=>d.value=!0)},null,8,["data","preview-mode"])])]),e.createVNode(Ot,{side:"right",width:360,open:p.value&&!R.value,title:"数据","onUpdate:open":N[6]||(N[6]=U=>p.value=U)},{default:e.withCtx(()=>[e.createVNode(Lo,{data:c.value,onImport:N[5]||(N[5]=U=>c.value=U)},null,8,["data"])]),_:1},8,["open"]),e.createVNode(Ot,{side:"right",width:420,open:h.value&&!R.value,title:"Markdown","onUpdate:open":N[8]||(N[8]=U=>h.value=U)},{default:e.withCtx(()=>[e.createVNode(Do,{data:c.value,onImport:N[7]||(N[7]=U=>c.value=U)},null,8,["data"])]),_:1},8,["open"]),e.createVNode(Ot,{side:"right",width:360,open:x.value&&!R.value,title:"节点内容","onUpdate:open":N[9]||(N[9]=U=>x.value=U)},{default:e.withCtx(()=>[e.createVNode(Jo,{"selected-node":s.value,readonly:!1,"focus-tick":C.value,onApply:me,onRemove:ae,onSetLink:ke,onSetImage:b,onSetRich:V},null,8,["selected-node","focus-tick"])]),_:1},8,["open"]),e.createVNode(Ot,{side:"right",width:340,open:$.value&&!R.value,title:"设置","onUpdate:open":N[10]||(N[10]=U=>$.value=U)},{default:e.withCtx(()=>{var U;return[e.createVNode(Vo,{settings:k,"has-selection":s.value!==null,"selected-node-text":(U=s.value)==null?void 0:U.text,"node-style":m.value,"onUpdate:settings":P,"onUpdate:nodeStyle":G,onReset:q},null,8,["settings","has-selection","selected-node-text","node-style"])]}),_:1},8,["open"])]))}}),lh="0.5.9",ah={install(t){t.component("FlowMindMap",Qo),t.component("FlowMindMapOutline",Oo),t.component("FlowMindMapDrawer",Ot),t.component("FlowMindMapDataPanel",Lo),t.component("FlowMindMapMarkdownPanel",Do),t.component("FlowMindMapSettingsPanel",Vo),t.component("FlowMindMapNotePanel",Jo),t.component("FlowMindMapApp",jl)}};Ce.DataPanel=Lo,Ce.Drawer=Ot,Ce.MARKER_LIB=gi,Ce.MarkdownPanel=Do,Ce.MindMap=Qo,Ce.MindMapApp=jl,Ce.NotePanel=Jo,Ce.Outline=Oo,Ce.SettingsPanel=Vo,Ce.VERSION=lh,Ce.addChild=yr,Ce.addSibling=Er,Ce.clone=It,Ce.default=ah,Ce.findNode=he,Ce.findParent=zt,Ce.markdownToMindMap=On,Ce.markdownToRichMindMap=Qa,Ce.markerDef=ds,Ce.markerLabel=Nr,Ce.markerSvg=zo,Ce.mindMapToMarkdown=Ln,Ce.removeNode=Ro,Ce.richBlockToMarkdown=es,Ce.tagColor=bi,Ce.uid=Yt,Object.defineProperties(Ce,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});