flow-mindmap 0.4.7 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,26 +1,17 @@
1
- (function(Ee,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(Ee=typeof globalThis<"u"?globalThis:Ee||self,e(Ee.FlowMind={},Ee.Vue))})(this,function(Ee,e){"use strict";var ym=Object.defineProperty;var Em=(Ee,e,Xt)=>e in Ee?ym(Ee,e,{enumerable:!0,configurable:!0,writable:!0,value:Xt}):Ee[e]=Xt;var Ae=(Ee,e,Xt)=>Em(Ee,typeof e!="symbol"?e+"":e,Xt);var oo;const Xt=["width","height","stroke-width"],dl={key:4,points:"6 9 12 15 18 9"},ul={key:5,points:"9 6 15 12 9 18"},xe=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",dl)):t.name==="expand"?(e.openBlock(),e.createElementBlock("polyline",ul)):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)):e.createCommentVNode("",!0)],8,Xt))}}),fi="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",mi="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",pi=[18,15,13,12],fl=[700,600,500,400],ml=[52,40,32,28],pl=[120,80,60,44],gl=[.8,.8,.8,.8],hl=pi.length-1;function bl(t,o){return Math.round(wo(t,o)*gl[Vn(t)])}function Vn(t){return Math.min(hl,Math.max(0,t))}function wo(t,o=14){return Math.round(pi[Vn(t)]*o/14*10)/10}function kl(t,o=14){return Math.round(ml[Vn(t)]*o/14)}const $n=60,Zt=14,st=24;let No=null;function yl(){if(No)return No;const t=typeof document<"u"?document.createElement("canvas").getContext("2d"):null;return t?(No=t,t):{font:"",measureText:()=>({width:0})}}const gi=new Map;function El(t,o,n){const i=`${n}|${o}|${t}`,r=gi.get(i);if(r!==void 0)return r;const s=yl();s.font=`${n} ${o}px "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif`;const c=s.measureText(t).width;return gi.set(i,c),c}const xl=24,wl=400,Nl=8,hi=16,Sl=4,Tl=200;function Cl(t,o,n){return Math.min(n,Math.max(o,t))}function _l(t,o,n,i,r){const s=Vn(o),c=wo(o,n),u=Math.min(El(t.text||"",c,fl[s]),Tl),d=bl(o,n),f=Math.ceil(u+d*2),k=!!(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table"))?Math.ceil(c*1.2)+6:kl(o,n);let y=0;if(t.link&&(y+=hi),t.note&&(y+=hi),y>0){const b=(t.link?1:0)+(t.note?1:0);y+=Sl*b}const N=f+y,E=(()=>{const b=Math.round(pl[s]*n/14);if(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table")){const O=r==null?void 0:r[t.id];return Math.max(b,O??240)}return b})(),L=!!(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table")),C=i==null?void 0:i[t.id],x=L?Math.max(24,C??Math.max(70,Math.ceil(c*5))):0,R=x>0?10:0;if(!t.image){const b=Math.max(E,N),O=Math.ceil(k+R+x);return{w:b,h:O}}const S=Cl(t.image.width,xl,wl),g=Math.max(E,N,Math.ceil(S+d*2)),_=Math.ceil(t.image.height+Nl+k+R+x);return{w:g,h:_}}function Al(t,o={}){const n=o.mode??"mindmap",i=o.preservePositions===!0,r=o.baseFontSize??14,s=ki(t,0,null,1,"right",r,o.richHeights,o.richWidths);return Rl(s),Ml(s,n,i),s.x=0,s.y=0,Bl(s,i)}function Ml(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((k,y)=>k+y._subtreeH,0);let d=1,f=Math.abs(i[0]._subtreeH-(u-i[0]._subtreeH)),p=0;for(let k=0;k<i.length-1;k++){p+=i[k]._subtreeH;const y=Math.abs(p-(u-p));y<f&&(f=y,d=k+1)}for(let k=0;k<d;k++)i[k]._dir="right",i[k].side=1,i[k]._dirRight=1;for(let k=d;k<i.length;k++)i[k]._dir="left",i[k].side=-1,i[k]._dirRight=-1}const r=t.children.filter(u=>u.side===1),s=t.children.filter(u=>u.side===-1),c=(u,d)=>{const f=d==="right"?1:-1;u._dir=d,u.side=f,u._dirRight=f;for(const p of u.children)c(p,d)};for(const u of r)c(u,"right");for(const u of s)c(u,"left");if(r.length>0){const u={...t,children:r};Pn(u,"right",$n,!0,n)}if(s.length>0){const u={...t,children:s};Pn(u,"left",$n,!0,n)}}else if(o==="tree"){const i=r=>{r.side=1,r._dir="right";for(const s of r.children)i(s)};for(const r of t.children)r._dir="right";Pn(t,"right",$n,!0,n),i(t)}else{for(const i of t.children)i._dir="down";bi(t,$n,n)}}function Pn(t,o,n,i,r=!1){if(t.children.length===0)return;const s=t.children.reduce((f,p,k)=>f+p._subtreeH+(k>0?Zt:0),0),c=o==="right"?1:-1,u=i?c:1;let d=t.y-u*s/2;t.children.forEach(f=>{r||(f.x=t.x+c*(t.width/2+n+f.width/2),f.y=d+u*f._subtreeH/2),f._dir=o,d+=u*(f._subtreeH+Zt),Pn(f,o,n,!1,r)})}function bi(t,o,n=!1){if(t.children.length===0)return;const i=t.children.reduce((s,c,u)=>s+c._subtreeW+(u>0?Zt*2:0),0);let r=t.x-i/2;t.children.forEach(s=>{n||(s.x=r+s._subtreeW/2,s.y=t.y+t.height/2+o+s.height/2),s._dir="down",r+=s._subtreeW+Zt*2,bi(s,o,n)})}function ki(t,o,n,i,r,s,c,u){const d=_l(t,o,s,c,u),f={id:t.id,text:t.text,depth:o,x:t._x??0,y:t._y??0,width:d.w,height:d.h,fontSize:wo(o,s),isRoot:o===0,collapsed:t.collapsed,side:i,_dir:r,_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,children:[],parent:n};if(t.collapsed)return f;const p=t.children.length,k=Math.ceil(p/2);return f.children=t.children.map((y,N)=>{const E=o===0?N<k?1:-1:i;return ki(y,o+1,f,E,r,s,c,u)}),f}function Rl(t){const o=[t];for(let n=0;n<o.length;n++){const i=o[n];for(const r of i.children)o.push(r)}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 r=0,s=0;for(const c of i.children)r+=c._subtreeH,s+=c._subtreeW;i.children.length>1&&(r+=Zt*(i.children.length-1),s+=Zt*2*(i.children.length-1)),i._subtreeH=Math.max(i.height,r),i._subtreeW=Math.max(i.width,s)}}function Bl(t,o=!1){const n=[t];let i=1/0,r=-1/0,s=1/0,c=-1/0;for(;n.length;){const f=n.pop(),p=f.width/2,k=f.height/2;f.x-p<i&&(i=f.x-p),f.x+p>r&&(r=f.x+p),f.y-k<s&&(s=f.y-k),f.y+k>c&&(c=f.y+k),n.push(...f.children)}if(o)return{root:t,width:r-i+st*2,height:c-s+st*2,vbX:i-st,vbY:s-st,vbW:r-i+st*2,vbH:c-s+st*2};const u=st-s,d=[t];for(;d.length;){const f=d.pop();f.y+=u,d.push(...f.children)}return s+=u,c+=u,{root:t,width:r-i+st*2,height:c+st,vbX:i-st,vbY:0,vbW:r-i+st*2,vbH:c+st}}const _t=[{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 zl(t,o=[]){return[..._t,...o].find(i=>i.id===t)??_t[0]}function Il(t,o=8){const n=[],i=new Set,r=/#[0-9a-fA-F]{3,8}\b|rgba?\([^)]+\)|[A-Za-z][A-Za-z0-9_-]{2,30}/g;let s;for(;(s=r.exec(t))!==null;){const c=s[0];let u=null;if(c.startsWith("#")?u=Ol(c):c.startsWith("rgb")?u=vl(c):u=Ll[c.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 Ol(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 vl(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 r=0;r<3;r++){const s=n[r];if(s.endsWith("%")){const c=parseFloat(s);if(!isFinite(c))return null;i.push(Math.round(c/100*255))}else{const c=parseInt(s,10);if(!isFinite(c)||c<0||c>255)return null;i.push(c)}}return"#"+i.map(r=>r.toString(16).padStart(2,"0")).join("").toLowerCase()}const Ll={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 ct(t){return JSON.parse(JSON.stringify(t))}function fe(t,o){if(t.id===o)return t;for(const n of t.children){const i=fe(n,o);if(i)return i}return null}function ut(t,o,n=null){if(t.id===o)return n;for(const i of t.children){const r=ut(i,o,t);if(r!==null)return r}return null}function Fn(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(Fn(i,o))return!0;return!1}function Dl(t,o,n){const i=fe(t,o);return!i||i.text===n?!1:(i.text=n,!0)}function Vl(t,o,n,i){if(!ut(t,o)||o===n||fe(fe(t,o),n))return!1;const r=ut(t,o),s=r.children.findIndex(f=>f.id===o);if(s<0)return!1;const[c]=r.children.splice(s,1);if(i==="child"){const f=fe(t,n);return f?(f.children.push(c),!0):(r.children.splice(s,0,c),!1)}const u=ut(t,n);if(!u)return r.children.splice(s,0,c),!1;let d=u.children.findIndex(f=>f.id===n);return d<0?(r.children.splice(s,0,c),!1):(i==="after"&&(d+=1),u.children.splice(d,0,c),!0)}function yi(t){const o=/^新节点(?:\s+(\d+))?$/;let n=0,i=!1;for(const r of t.children){const s=r.text.match(o);if(s)if(s[1]){const c=parseInt(s[1],10);c>n&&(n=c)}else i=!0}return n===0&&!i?Hn:n>0?`新节点 ${n+1}`:"新节点 2"}function Ei(t,o,n){const i=fe(t,o);if(!i)return null;const r={id:yt(),text:n??yi(i),children:[]};return i.children.push(r),r}function xi(t,o,n){const i=ut(t,o);if(!i)return null;const r=i.children.findIndex(c=>c.id===o);if(r<0)return null;const s={id:yt(),text:n??yi(i),children:[]};return i.children.splice(r+1,0,s),s}function $l(t,o,n){const i=ut(t,o);if(!i)return null;const r=i.children.findIndex(c=>c.id===o);if(r<0)return null;const s={id:yt(),text:n,children:[]};return i.children.splice(r,0,s),s}function Pl(t,o){const n=ut(t,o);if(!n)return null;const i=n.children.findIndex(c=>c.id===o);if(i<0)return null;const r=n.children[i],s=ct(r);return Un(s),n.children.splice(i+1,0,s),s}function Un(t){t.id=yt();for(const o of t.children)Un(o)}function wi(t,o){const n=fe(t,o);if(!n||n.id===t.id)return null;const i=ct(n);return Un(i),i}const Hn="新节点";function Jt(t,o="导入的导图"){const n=t.split(/\r?\n/),i={id:yt(),text:o,children:[]},r=[i],s=[-1/0],c=[],u=/^(#{1,6})\s+(.+?)\s*#*\s*$/,d=/^!\[([^\]]*)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,f=/^\[([^\]]+)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,p=/^(`{3,}|~{3,})\s*(\S+)?\s*$/;let k=!1,y=[],N=null;function E(x){y.push(x)}function L(){if(N&&y.length>0){for(;y.length>0&&y[0].trim()==="";)y.shift();for(;y.length>0&&y[y.length-1].trim()==="";)y.pop();const x=y.join(`
2
- `);x&&(N.note={text:x})}k=!1,y=[]}for(const x of n){if(k){const b=x.match(p);if(b&&b[1][0]==="`"){L();continue}E(x);continue}const R=x.match(u);if(R){const b=R[1].length,O=R[2].trim();c.push({level:b,text:O,body:""}),N=c[c.length-1];continue}const S=x.match(p);if(S&&S[2]==="note"){k=!0,y=[];continue}const g=x.match(d);if(g&&N){const b=g[2],O=160,W=120;N.image={src:b,naturalW:O,naturalH:W,width:O,height:W};continue}const _=x.match(f);if(_&&N){N.link={url:_[2]},N.text=_[1];continue}if(x.trim().length>0&&N){const b=x.trim();N.body=N.body?N.body+`
3
- `+b:b}}k&&L();function C(x){for(;r.length>1;){const _=r.length-1,b=s[_];if(b!==void 0&&b<x.level)break;r.pop(),s.pop()}const R=r[r.length-1],S=x.text,g={id:yt(),text:S,children:[]};x.image&&(g.image={...x.image}),x.link&&(g.link={url:x.link.url}),x.note&&(g.note={text:x.note.text}),x.body&&(g.note={text:x.body}),R.children.push(g),r.push(g),s.push(x.level)}for(const x of c)C(x);if(c.length>0&&c[0].level===1){const x=i.children[0];x&&(i.text=x.text,i.id=x.id,x.image&&(i.image={...x.image}),x.link&&(i.link={url:x.link.url}),x.note&&(i.note={text:x.note.text}),i.children=x.children)}return i}function Qt(t,o=1){let n="#".repeat(o)+" "+(t.text||"")+`
1
+ (function(he,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(he=typeof globalThis<"u"?globalThis:he||self,e(he.FlowMind={},he.Vue))})(this,function(he,e){"use strict";var gg=Object.defineProperty;var hg=(he,e,Bn)=>e in he?gg(he,e,{enumerable:!0,configurable:!0,writable:!0,value:Bn}):he[e]=Bn;var ve=(he,e,Bn)=>hg(he,typeof e!="symbol"?e+"":e,Bn);var Qo;const Bn=["width","height","stroke-width"],ha={key:4,points:"6 9 12 15 18 9"},ba={key:5,points:"9 6 15 12 9 18"},be=e.defineComponent({__name:"Icon",props:{name:{},size:{},stroke:{}},setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("svg",{width:t.size??16,height:t.size??16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":t.stroke??1.8,"stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[t.name==="add"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[n[0]||(n[0]=e.createElementVNode("circle",{cx:"12",cy:"12",r:"9"},null,-1)),n[1]||(n[1]=e.createElementVNode("line",{x1:"12",y1:"8",x2:"12",y2:"16"},null,-1)),n[2]||(n[2]=e.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1))],64)):t.name==="minus"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[n[3]||(n[3]=e.createElementVNode("circle",{cx:"12",cy:"12",r:"9"},null,-1)),n[4]||(n[4]=e.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1))],64)):t.name==="delete"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[n[5]||(n[5]=e.createStaticVNode('<polyline points="4 7 20 7"></polyline><path d="M9 7 V5 a1 1 0 0 1 1 -1 h4 a1 1 0 0 1 1 1 V7"></path><path d="M6 7 l1 12 a1 1 0 0 0 1 1 h8 a1 1 0 0 0 1 -1 l1 -12"></path><line x1="10" y1="11" x2="10" y2="18"></line><line x1="14" y1="11" x2="14" y2="18"></line>',5))],64)):t.name==="edit"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[n[6]||(n[6]=e.createElementVNode("path",{d:"M4 20 l4 -1 11 -11 -3 -3 -11 11 z"},null,-1)),n[7]||(n[7]=e.createElementVNode("line",{x1:"14",y1:"6",x2:"18",y2:"10"},null,-1))],64)):t.name==="collapse"?(e.openBlock(),e.createElementBlock("polyline",ha)):t.name==="expand"?(e.openBlock(),e.createElementBlock("polyline",ba)):t.name==="collapse-all"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:6},[n[8]||(n[8]=e.createStaticVNode('<line x1="4" y1="4" x2="10" y2="10"></line><polyline points="6 10 10 10 10 6"></polyline><line x1="20" y1="4" x2="14" y2="10"></line><polyline points="14 6 14 10 18 10"></polyline><line x1="20" y1="20" x2="14" y2="14"></line><polyline points="14 18 14 14 18 14"></polyline><line x1="4" y1="20" x2="10" y2="14"></line><polyline points="6 14 10 14 10 18"></polyline>',8))],64)):t.name==="expand-all"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:7},[n[9]||(n[9]=e.createStaticVNode('<line x1="10" y1="10" x2="4" y2="4"></line><polyline points="4 6 4 4 6 4"></polyline><line x1="14" y1="10" x2="20" y2="4"></line><polyline points="20 6 20 4 18 4"></polyline><line x1="14" y1="14" x2="20" y2="20"></line><polyline points="20 18 20 20 18 20"></polyline><line x1="10" y1="14" x2="4" y2="20"></line><polyline points="4 18 4 20 6 20"></polyline>',8))],64)):t.name==="expand-level-1"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:8},[n[10]||(n[10]=e.createStaticVNode('<circle cx="12" cy="5" r="1.8" fill="currentColor" stroke="none"></circle><line x1="12" y1="7" x2="12" y2="11"></line><line x1="12" y1="11" x2="5" y2="17"></line><line x1="12" y1="11" x2="12" y2="17"></line><line x1="12" y1="11" x2="19" y2="17"></line><circle cx="5" cy="19" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="12" cy="19" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="19" cy="19" r="1.8" fill="currentColor" stroke="none"></circle>',8))],64)):t.name==="expand-level-2"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:9},[n[11]||(n[11]=e.createStaticVNode('<circle cx="12" cy="3" r="1.4" fill="currentColor" stroke="none"></circle><line x1="12" y1="4.5" x2="12" y2="7"></line><line x1="12" y1="7" x2="5" y2="11"></line><line x1="12" y1="7" x2="12" y2="11"></line><line x1="12" y1="7" x2="19" y2="11"></line><line x1="5" y1="11" x2="3" y2="16"></line><line x1="5" y1="11" x2="7" y2="16"></line><line x1="12" y1="11" x2="10" y2="16"></line><line x1="12" y1="11" x2="14" y2="16"></line><line x1="19" y1="11" x2="17" y2="16"></line><line x1="19" y1="11" x2="21" y2="16"></line><circle cx="5" cy="11" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="12" cy="11" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="19" cy="11" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="3" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="7" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="10" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="14" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="17" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="21" cy="18" r="1.4" fill="currentColor" stroke="none"></circle>',20))],64)):t.name==="zoom-in"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:10},[n[12]||(n[12]=e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"},null,-1)),n[13]||(n[13]=e.createElementVNode("line",{x1:"11",y1:"8",x2:"11",y2:"14"},null,-1)),n[14]||(n[14]=e.createElementVNode("line",{x1:"8",y1:"11",x2:"14",y2:"11"},null,-1)),n[15]||(n[15]=e.createElementVNode("line",{x1:"16",y1:"16",x2:"21",y2:"21"},null,-1))],64)):t.name==="zoom-out"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:11},[n[16]||(n[16]=e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"},null,-1)),n[17]||(n[17]=e.createElementVNode("line",{x1:"8",y1:"11",x2:"14",y2:"11"},null,-1)),n[18]||(n[18]=e.createElementVNode("line",{x1:"16",y1:"16",x2:"21",y2:"21"},null,-1))],64)):t.name==="reset"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:12},[n[19]||(n[19]=e.createElementVNode("polyline",{points:"4 9 4 4 9 4"},null,-1)),n[20]||(n[20]=e.createElementVNode("polyline",{points:"15 4 20 4 20 9"},null,-1)),n[21]||(n[21]=e.createElementVNode("polyline",{points:"20 15 20 20 15 20"},null,-1)),n[22]||(n[22]=e.createElementVNode("polyline",{points:"9 20 4 20 4 15"},null,-1))],64)):t.name==="database"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:13},[n[23]||(n[23]=e.createElementVNode("ellipse",{cx:"12",cy:"6",rx:"7",ry:"2.5"},null,-1)),n[24]||(n[24]=e.createElementVNode("path",{d:"M5 6 V18 C5 19.4 8 20.5 12 20.5 C16 20.5 19 19.4 19 18 V6"},null,-1)),n[25]||(n[25]=e.createElementVNode("path",{d:"M5 12 C5 13.4 8 14.5 12 14.5 C16 14.5 19 13.4 19 12"},null,-1))],64)):t.name==="settings"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:14},[n[26]||(n[26]=e.createElementVNode("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"},null,-1)),n[27]||(n[27]=e.createElementVNode("circle",{cx:"12",cy:"12",r:"3"},null,-1))],64)):t.name==="markdown"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:15},[n[28]||(n[28]=e.createElementVNode("rect",{x:"2",y:"5",width:"20",height:"14",rx:"2"},null,-1)),n[29]||(n[29]=e.createElementVNode("path",{d:"M6 15 V9 L9 12 L12 9 V15"},null,-1)),n[30]||(n[30]=e.createElementVNode("path",{d:"M15 15 V9 L18 12 V9 M15 12 L18 15"},null,-1))],64)):t.name==="txt"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:16},[n[31]||(n[31]=e.createElementVNode("rect",{x:"5",y:"3",width:"14",height:"18",rx:"1.5"},null,-1)),n[32]||(n[32]=e.createElementVNode("line",{x1:"8",y1:"8",x2:"16",y2:"8"},null,-1)),n[33]||(n[33]=e.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1)),n[34]||(n[34]=e.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):t.name==="eye"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:17},[n[35]||(n[35]=e.createElementVNode("path",{d:"M2 12 C4 6 8 3 12 3 C16 3 20 6 22 12 C20 18 16 21 12 21 C8 21 4 18 2 12 Z"},null,-1)),n[36]||(n[36]=e.createElementVNode("circle",{cx:"12",cy:"12",r:"3.2"},null,-1))],64)):t.name==="eye-off"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:18},[n[37]||(n[37]=e.createElementVNode("path",{d:"M3 3 L21 21"},null,-1)),n[38]||(n[38]=e.createElementVNode("path",{d:"M10.5 6.2 C11 6.1 11.5 6 12 6 C16 6 19.5 8.5 21 12 C20.4 13.2 19.6 14.3 18.7 15.2"},null,-1)),n[39]||(n[39]=e.createElementVNode("path",{d:"M6.6 6.6 C4 8.2 2.7 10.2 2 12 C3 14.5 5.2 16.8 8 18.3 C9.2 19 10.6 19.4 12 19.4 C13.5 19.4 14.9 19 16.2 18.3"},null,-1)),n[40]||(n[40]=e.createElementVNode("path",{d:"M9.5 9.5 C9.1 10.2 9 11.1 9 12 C9 13.7 9.8 15.2 11 16.1"},null,-1))],64)):t.name==="outline"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:19},[n[41]||(n[41]=e.createElementVNode("rect",{x:"4",y:"3",width:"16",height:"18",rx:"2"},null,-1)),n[42]||(n[42]=e.createElementVNode("line",{x1:"8",y1:"8",x2:"16",y2:"8"},null,-1)),n[43]||(n[43]=e.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1)),n[44]||(n[44]=e.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):t.name==="logo"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:20},[n[45]||(n[45]=e.createStaticVNode('<circle cx="12" cy="12" r="2.2"></circle><circle cx="4" cy="5" r="1.6"></circle><circle cx="20" cy="5" r="1.6"></circle><circle cx="4" cy="19" r="1.6"></circle><circle cx="20" cy="19" r="1.6"></circle><line x1="10.5" y1="10.8" x2="5.2" y2="6.4"></line><line x1="13.5" y1="10.8" x2="18.8" y2="6.4"></line><line x1="10.5" y1="13.2" x2="5.2" y2="17.6"></line><line x1="13.5" y1="13.2" x2="18.8" y2="17.6"></line>',9))],64)):t.name==="import"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:21},[n[46]||(n[46]=e.createElementVNode("path",{d:"M12 4 V15"},null,-1)),n[47]||(n[47]=e.createElementVNode("polyline",{points:"7 10 12 15 17 10"},null,-1)),n[48]||(n[48]=e.createElementVNode("path",{d:"M4 19 H20"},null,-1))],64)):t.name==="export"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:22},[n[49]||(n[49]=e.createElementVNode("path",{d:"M12 15 V4"},null,-1)),n[50]||(n[50]=e.createElementVNode("polyline",{points:"7 9 12 4 17 9"},null,-1)),n[51]||(n[51]=e.createElementVNode("path",{d:"M4 19 H20"},null,-1))],64)):t.name==="balance"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:23},[n[52]||(n[52]=e.createStaticVNode('<line x1="3" y1="6" x2="21" y2="6"></line><line x1="3" y1="12" x2="21" y2="12"></line><line x1="3" y1="18" x2="21" y2="18"></line><polyline points="9 4 5 6 9 8"></polyline><polyline points="15 4 19 6 15 8"></polyline><polyline points="9 10 5 12 9 14"></polyline><polyline points="15 10 19 12 15 14"></polyline><polyline points="9 16 5 18 9 20"></polyline><polyline points="15 16 19 18 15 20"></polyline>',9))],64)):t.name==="mindmap"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:24},[n[53]||(n[53]=e.createStaticVNode('<circle cx="12" cy="12" r="2.4" fill="currentColor" stroke="none"></circle><line x1="13.4" y1="10.6" x2="18.5" y2="5.5"></line><line x1="13.4" y1="13.4" x2="18.5" y2="18.5"></line><line x1="10.6" y1="10.6" x2="5.5" y2="5.5"></line><line x1="10.6" y1="13.4" x2="5.5" y2="18.5"></line><circle cx="19.5" cy="4.5" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="19.5" cy="19.5" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="4.5" cy="4.5" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="4.5" cy="19.5" r="1.8" fill="currentColor" stroke="none"></circle>',9))],64)):t.name==="tree"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:25},[n[54]||(n[54]=e.createStaticVNode('<circle cx="5" cy="12" r="2" fill="currentColor" stroke="none"></circle><circle cx="19" cy="5" r="2" fill="currentColor" stroke="none"></circle><circle cx="19" cy="12" r="2" fill="currentColor" stroke="none"></circle><circle cx="19" cy="19" r="2" fill="currentColor" stroke="none"></circle><line x1="7" y1="12" x2="12" y2="12"></line><line x1="12" y1="12" x2="12" y2="5"></line><line x1="12" y1="12" x2="12" y2="19"></line><line x1="12" y1="5" x2="17" y2="5"></line><line x1="12" y1="19" x2="17" y2="19"></line>',9))],64)):t.name==="org"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:26},[n[55]||(n[55]=e.createStaticVNode('<circle cx="12" cy="5" r="2" fill="currentColor" stroke="none"></circle><circle cx="6" cy="19" r="2" fill="currentColor" stroke="none"></circle><circle cx="12" cy="19" r="2" fill="currentColor" stroke="none"></circle><circle cx="18" cy="19" r="2" fill="currentColor" stroke="none"></circle><line x1="12" y1="7" x2="12" y2="13"></line><line x1="6" y1="13" x2="18" y2="13"></line><line x1="6" y1="13" x2="6" y2="17"></line><line x1="12" y1="13" x2="12" y2="17"></line><line x1="18" y1="13" x2="18" y2="17"></line>',9))],64)):t.name==="image"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:27},[n[56]||(n[56]=e.createElementVNode("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"},null,-1)),n[57]||(n[57]=e.createElementVNode("circle",{cx:"9",cy:"11",r:"1.6"},null,-1)),n[58]||(n[58]=e.createElementVNode("polyline",{points:"3 17 9 12 13 15 16 13 21 17"},null,-1))],64)):t.name==="x"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:28},[n[59]||(n[59]=e.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"},null,-1)),n[60]||(n[60]=e.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"},null,-1))],64)):t.name==="link"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:29},[n[61]||(n[61]=e.createElementVNode("path",{d:"M10 13 a4 4 0 0 0 5.66 0 l3 -3 a4 4 0 1 0 -5.66 -5.66 l-1 1"},null,-1)),n[62]||(n[62]=e.createElementVNode("path",{d:"M14 11 a4 4 0 0 0 -5.66 0 l-3 3 a4 4 0 1 0 5.66 5.66 l1 -1"},null,-1))],64)):t.name==="note"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:30},[n[63]||(n[63]=e.createElementVNode("path",{d:"M6 4 h9 l3 3 v13 a1 1 0 0 1 -1 1 h-11 a1 1 0 0 1 -1 -1 v-15 a1 1 0 0 1 1 -1 z"},null,-1)),n[64]||(n[64]=e.createElementVNode("line",{x1:"8",y1:"10",x2:"16",y2:"10"},null,-1)),n[65]||(n[65]=e.createElementVNode("line",{x1:"8",y1:"13",x2:"16",y2:"13"},null,-1)),n[66]||(n[66]=e.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):t.name==="search"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:31},[n[67]||(n[67]=e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"},null,-1)),n[68]||(n[68]=e.createElementVNode("line",{x1:"16",y1:"16",x2:"21",y2:"21"},null,-1))],64)):t.name==="json"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:32},[n[69]||(n[69]=e.createElementVNode("path",{d:"M8 4 C6 4 6 6 6 7 C6 8 5 8 5 9 C5 10 6 10 6 11 C6 12 6 14 8 14"},null,-1)),n[70]||(n[70]=e.createElementVNode("path",{d:"M16 4 C18 4 18 6 18 7 C18 8 19 8 19 9 C19 10 18 10 18 11 C18 12 18 14 16 14"},null,-1))],64)):t.name==="svg-export"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:33},[n[71]||(n[71]=e.createElementVNode("path",{d:"M6 3 h8 l4 4 v14 a1 1 0 0 1 -1 1 h-11 a1 1 0 0 1 -1 -1 v-15 a1 1 0 0 1 1 -1 z"},null,-1)),n[72]||(n[72]=e.createElementVNode("polyline",{points:"14 3 14 7 18 7"},null,-1)),n[73]||(n[73]=e.createElementVNode("polyline",{points:"8 14 6 16 8 18"},null,-1)),n[74]||(n[74]=e.createElementVNode("polyline",{points:"14 14 16 16 14 18"},null,-1))],64)):e.createCommentVNode("",!0)],8,Bn))}}),ri="data:image/svg+xml,%3csvg%20t='1780822312364'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='7459'%20width='200'%20height='200'%3e%3cpath%20d='M329.16%20292.571h658.286V512H329.16zM329.16%200h658.286v219.429H329.16z'%20fill='%239AA1A2'%20p-id='7460'%3e%3c/path%3e%3cpath%20d='M44.927%20146.286a46.519%2046.519%200%200%201%2038.107-73.143h319.269v73.143H109.73V791.99l-48.713%205.705-24.43-651.41h8.339z'%20fill='%239AA1A2'%20p-id='7461'%3e%3c/path%3e%3cpath%20d='M363.83%20877.714H179.51c-78.775%200-142.921-66.12-142.921-147.31V112.787c0-21.943%2017.188-39.643%2038.473-39.643%2021.211%200%2033.5%2017.774%2033.5%2039.643v617.619c0%2037.522%2028.013%2076.58%2064.438%2076.58h190.903c21.211%200%2038.766%2013.97%2038.766%2035.84%200%2021.943-17.555%2034.89-38.766%2034.89z'%20fill='%239AA1A2'%20p-id='7462'%3e%3c/path%3e%3cpath%20d='M432.95%20438.857H179.51c-78.775%200-81.043-18.578-81.043-62.903l10.094-90.624c0%2020.48%2013.458%2080.677%2049.884%2080.677h210.139c21.211%200%20120.613%204.023%20120.613%2016.018%200%2011.922-35.036%2056.832-56.32%2056.832zM640.017%20749.714V640a54.857%2054.857%200%200%201%20109.714%200v109.714h109.715a54.857%2054.857%200%200%201%200%20109.715H749.73v109.714a54.857%2054.857%200%200%201-109.714%200V859.429H530.303a54.857%2054.857%200%200%201%200-109.715h109.714z'%20fill='%239AA1A2'%20p-id='7463'%3e%3c/path%3e%3c/svg%3e",ii="data:image/svg+xml,%3csvg%20t='1780822464335'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='8457'%20width='200'%20height='200'%3e%3cpath%20d='M512%20804.571h512V1024H512V804.571zM0%200h658.286v219.429H0V0z'%20fill='%239AA1A2'%20p-id='8458'%3e%3c/path%3e%3cpath%20d='M619.813%20950.857h-184.32c-78.775%200-142.922-66.121-142.922-147.31V185.93c0-21.943%2017.189-39.643%2038.474-39.643%2021.211%200%2033.353%2017.773%2033.353%2039.643v617.618c0%2037.523%2034.743%2073.728%2071.095%2073.728h184.32c21.211%200%2038.473%2012.069%2038.473%2033.939%200%2021.943-17.189%2039.643-38.473%2039.643z'%20fill='%239AA1A2'%20p-id='8459'%3e%3c/path%3e%3cpath%20d='M676.571%20457.143V347.429a54.857%2054.857%200%200%201%20109.715%200v109.714H896a54.857%2054.857%200%200%201%200%20109.714H786.286v109.714a54.857%2054.857%200%200%201-109.715%200V566.857H566.857a54.857%2054.857%200%200%201%200-109.714h109.714z'%20fill='%239AA1A2'%20p-id='8460'%3e%3c/path%3e%3c/svg%3e",li=[22,15,13,12],ka=[700,600,500,400],ya=[52,40,32,28],Ea=[120,80,60,44],xa=[.8,.8,.8,.8],wa=li.length-1;function Na(t,o){return Math.round(fr(t,o)*xa[Co(t)])}function Co(t){return Math.min(wa,Math.max(0,t))}function fr(t,o=14){return Math.round(li[Co(t)]*o/14*10)/10}function Sa(t,o=14){return Math.round(ya[Co(t)]*o/14)}const Ao=60,In=14,At=24;let mr=null;function Ta(){if(mr)return mr;const t=typeof document<"u"?document.createElement("canvas").getContext("2d"):null;return t?(mr=t,t):{font:"",measureText:()=>({width:0})}}const ai=new Map;function Ca(t,o,n){const r=`${n}|${o}|${t}`,l=ai.get(r);if(l!==void 0)return l;const s=Ta();s.font=`${n} ${o}px "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif`;const c=s.measureText(t).width;return ai.set(r,c),c}const Aa=24,_a=400,Ma=8,si=16,ci=4,va=200;function Ra(t,o,n){return Math.min(n,Math.max(o,t))}function Ba(t,o,n,r,l){const s=Co(o),c=fr(o,n),u=Math.min(Ca(t.text||"",c,ka[s]),va),d=Na(o,n),g=Math.ceil(u+d*2),w=!!(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table"))?Math.ceil(c*1.2)+6:Sa(o,n);let N=0;if(t.link&&(N+=si),t.note&&(N+=si),N>0){const q=(t.link?1:0)+(t.note?1:0);N+=ci*q}const $=14,M=2;let P=0;t.markers&&t.markers.length>0&&(P=t.markers.length*$+(t.markers.length-1)*M+ci);const I=18,C=4,E=t.tags&&t.tags.length>0?I:0,k=g+N+P,m=(()=>{const q=Math.round(Ea[s]*n/14);if(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table")){const Q=l==null?void 0:l[t.id];return Math.max(q,Q??240)}return q})(),B=!!(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table")),x=r==null?void 0:r[t.id],K=B?Math.max(24,x??Math.max(70,Math.ceil(c*5))):0,Y=K>0?10:0;if(!t.image){const q=Math.max(m,k),Q=Math.ceil(w+Y+K+(E>0?C+E:0));return{w:q,h:Q}}const ee=Ra(t.image.width,Aa,_a),ae=Math.max(m,k,Math.ceil(ee+d*2)),re=Math.ceil(t.image.height+Ma+w+Y+K+(E>0?C+E:0));return{w:ae,h:re}}function Ia(t,o={}){const n=o.mode??"mindmap",r=o.preservePositions===!0,l=o.baseFontSize??14,s=ui(t,0,null,1,"right",l,o.richHeights,o.richWidths);return Oa(s),za(s,n,r),s.x=0,s.y=0,La(s,r)}function za(t,o,n=!1){if(o==="mindmap"){const r=t.children;if(r.length!==0)if(r.length===1)r[0]._dir="right",r[0].side=1,r[0]._dirRight=1;else{const u=r.reduce((w,N)=>w+N._subtreeH,0);let d=1,g=Math.abs(r[0]._subtreeH-(u-r[0]._subtreeH)),b=0;for(let w=0;w<r.length-1;w++){b+=r[w]._subtreeH;const N=Math.abs(b-(u-b));N<g&&(g=N,d=w+1)}for(let w=0;w<d;w++)r[w]._dir="right",r[w].side=1,r[w]._dirRight=1;for(let w=d;w<r.length;w++)r[w]._dir="left",r[w].side=-1,r[w]._dirRight=-1}const l=t.children.filter(u=>u.side===1),s=t.children.filter(u=>u.side===-1),c=(u,d)=>{const g=d==="right"?1:-1;u._dir=d,u.side=g,u._dirRight=g;for(const b of u.children)c(b,d)};for(const u of l)c(u,"right");for(const u of s)c(u,"left");if(l.length>0){const u={...t,children:l};_o(u,"right",Ao,!0,n)}if(s.length>0){const u={...t,children:s};_o(u,"left",Ao,!0,n)}}else if(o==="tree"){const r=l=>{l.side=1,l._dir="right";for(const s of l.children)r(s)};for(const l of t.children)l._dir="right";_o(t,"right",Ao,!0,n),r(t)}else{for(const r of t.children)r._dir="down";di(t,Ao,n)}}function _o(t,o,n,r,l=!1){if(t.children.length===0)return;const s=t.children.reduce((g,b,w)=>g+b._subtreeH+(w>0?In:0),0),c=o==="right"?1:-1,u=r?c:1;let d=t.y-u*s/2;t.children.forEach(g=>{l||(g.x=t.x+c*(t.width/2+n+g.width/2),g.y=d+u*g._subtreeH/2),g._dir=o,d+=u*(g._subtreeH+In),_o(g,o,n,!1,l)})}function di(t,o,n=!1){if(t.children.length===0)return;const r=t.children.reduce((s,c,u)=>s+c._subtreeW+(u>0?In*2:0),0);let l=t.x-r/2;t.children.forEach(s=>{n||(s.x=l+s._subtreeW/2,s.y=t.y+t.height/2+o+s.height/2),s._dir="down",l+=s._subtreeW+In*2,di(s,o,n)})}function ui(t,o,n,r,l,s,c,u){const d=Ba(t,o,s,c,u),g={id:t.id,text:t.text,depth:o,x:t._x??0,y:t._y??0,width:d.w,height:d.h,fontSize:fr(o,s),isRoot:o===0,collapsed:t.collapsed,side:r,_dir:l,_dirRight:r,_subtreeH:d.h,_subtreeW:d.w,image:t.image?{...t.image}:void 0,link:t.link?{url:t.link.url}:void 0,note:t.note?{text:t.note.text}:void 0,richContent:t.richContent?{kind:t.richContent.kind,raw:t.richContent.raw,lang:t.richContent.lang}:void 0,markers:t.markers?[...t.markers]:void 0,tags:t.tags?[...t.tags]:void 0,children:[],parent:n};if(t.collapsed)return g;const b=t.children.length,w=Math.ceil(b/2);return g.children=t.children.map((N,$)=>{const M=o===0?$<w?1:-1:r;return ui(N,o+1,g,M,l,s,c,u)}),g}function Oa(t){const o=[t];for(let n=0;n<o.length;n++){const r=o[n];for(const l of r.children)o.push(l)}for(let n=o.length-1;n>=0;n--){const r=o[n];if(r.collapsed||r.children.length===0){r._subtreeH=r.height,r._subtreeW=r.width;continue}let l=0,s=0;for(const c of r.children)l+=c._subtreeH,s+=c._subtreeW;r.children.length>1&&(l+=In*(r.children.length-1),s+=In*2*(r.children.length-1)),r._subtreeH=Math.max(r.height,l),r._subtreeW=Math.max(r.width,s)}}function La(t,o=!1){const n=[t];let r=1/0,l=-1/0,s=1/0,c=-1/0;for(;n.length;){const g=n.pop(),b=g.width/2,w=g.height/2;g.x-b<r&&(r=g.x-b),g.x+b>l&&(l=g.x+b),g.y-w<s&&(s=g.y-w),g.y+w>c&&(c=g.y+w),n.push(...g.children)}if(o)return{root:t,width:l-r+At*2,height:c-s+At*2,vbX:r-At,vbY:s-At,vbW:l-r+At*2,vbH:c-s+At*2};const u=At-s,d=[t];for(;d.length;){const g=d.pop();g.y+=u,d.push(...g.children)}return s+=u,c+=u,{root:t,width:l-r+At*2,height:c+At,vbX:r-At,vbY:0,vbW:l-r+At*2,vbH:c+At}}const en=[{id:"default",name:"默认",colors:["#f87171","#fb923c","#fbbf24","#a3e635","#34d399","#22d3ee","#818cf8","#c084fc"]},{id:"classic",name:"经典",colors:["#ef4444","#f59e0b","#10b981","#3b82f6","#6366f1","#8b5cf6","#ec4899","#14b8a6"]},{id:"vivid",name:"活力",colors:["#dc2626","#ea580c","#ca8a04","#16a34a","#0891b2","#2563eb","#7c3aed","#db2777"]},{id:"dev",name:"代码",colors:["#f472b6","#a78bfa","#60a5fa","#38bdf8","#22d3ee","#34d399","#facc15","#fb923c"]},{id:"mint",name:"薄荷",colors:["#5eead4","#67e8f9","#93c5fd","#c4b5fd","#fbcfe8","#fde68a","#a7f3d0","#bae6fd"]}];function Da(t,o=[]){return[...en,...o].find(r=>r.id===t)??en[0]}function Va(t,o=8){const n=[],r=new Set,l=/#[0-9a-fA-F]{3,8}\b|rgba?\([^)]+\)|[A-Za-z][A-Za-z0-9_-]{2,30}/g;let s;for(;(s=l.exec(t))!==null;){const c=s[0];let u=null;if(c.startsWith("#")?u=$a(c):c.startsWith("rgb")?u=Pa(c):u=Ua[c.toLowerCase()]??null,!u)continue;const d=u.toLowerCase();if(!r.has(d)&&(r.add(d),n.push(d),n.length>=o))break}return n}function $a(t){const o=t.startsWith("#")?t.slice(1):t;if(!/^[0-9a-fA-F]+$/.test(o))return null;let n;if(o.length===3)n=o.split("").map(r=>r+r).join("");else if(o.length===4)n=o.slice(0,3).split("").map(r=>r+r).join("");else if(o.length===6)n=o;else if(o.length===8)n=o.slice(0,6);else return null;return"#"+n.toLowerCase()}function Pa(t){const o=t.match(/^rgba?\(\s*([^)]+?)\s*\)$/i);if(!o)return null;const n=o[1].split(/\s*,\s*/);if(n.length<3)return null;const r=[];for(let l=0;l<3;l++){const s=n[l];if(s.endsWith("%")){const c=parseFloat(s);if(!isFinite(c))return null;r.push(Math.round(c/100*255))}else{const c=parseInt(s,10);if(!isFinite(c)||c<0||c>255)return null;r.push(c)}}return"#"+r.map(l=>l.toString(16).padStart(2,"0")).join("").toLowerCase()}const Ua={black:"#000000",white:"#ffffff",red:"#ff0000",green:"#008000",blue:"#0000ff",yellow:"#ffff00",cyan:"#00ffff",magenta:"#ff00ff",gray:"#808080",grey:"#808080",silver:"#c0c0c0",maroon:"#800000",olive:"#808000",lime:"#00ff00",aqua:"#00ffff",teal:"#008080",navy:"#000080",fuchsia:"#ff00ff",purple:"#800080",orange:"#ffa500",pink:"#ffc0cb",brown:"#a52a2a",gold:"#ffd700",coral:"#ff7f50",tomato:"#ff6347",salmon:"#fa8072",khaki:"#f0e68c",violet:"#ee82ee",indigo:"#4b0082",turquoise:"#40e0d0",chocolate:"#d2691e",crimson:"#dc143c",darkred:"#8b0000",darkblue:"#00008b",darkgreen:"#006400",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightblue:"#add8e6",lightgreen:"#90ee90",lightyellow:"#ffffe0",lightpink:"#ffb6c1",skyblue:"#87ceeb",forestgreen:"#228b22",royalblue:"#4169e1",steelblue:"#4682b4",hotpink:"#ff69b4",deeppink:"#ff1493",orangered:"#ff4500",goldenrod:"#daa520",mediumpurple:"#9370db"};function Gt(){return"n_"+Math.random().toString(36).slice(2,10)+Date.now().toString(36).slice(-4)}function _t(t){return JSON.parse(JSON.stringify(t))}function oe(t,o){if(t.id===o)return t;for(const n of t.children){const r=oe(n,o);if(r)return r}return null}function Lt(t,o,n=null){if(t.id===o)return n;for(const r of t.children){const l=Lt(r,o,t);if(l!==null)return l}return null}function Mo(t,o){const n=t.children.findIndex(r=>r.id===o);if(n>=0)return t.children.splice(n,1),!0;for(const r of t.children)if(Mo(r,o))return!0;return!1}function Fa(t,o,n){const r=oe(t,o);return!r||r.text===n?!1:(r.text=n,!0)}function Ha(t,o,n,r){if(!Lt(t,o)||o===n||oe(oe(t,o),n))return!1;const l=Lt(t,o),s=l.children.findIndex(g=>g.id===o);if(s<0)return!1;const[c]=l.children.splice(s,1);if(r==="child"){const g=oe(t,n);return g?(g.children.push(c),!0):(l.children.splice(s,0,c),!1)}const u=Lt(t,n);if(!u)return l.children.splice(s,0,c),!1;let d=u.children.findIndex(g=>g.id===n);return d<0?(l.children.splice(s,0,c),!1):(r==="after"&&(d+=1),u.children.splice(d,0,c),!0)}function fi(t){const o=/^新节点(?:\s+(\d+))?$/;let n=0,r=!1;for(const l of t.children){const s=l.text.match(o);if(s)if(s[1]){const c=parseInt(s[1],10);c>n&&(n=c)}else r=!0}return n===0&&!r?Ro:n>0?`新节点 ${n+1}`:"新节点 2"}function mi(t,o,n){const r=oe(t,o);if(!r)return null;const l={id:Gt(),text:n??fi(r),children:[]};return r.children.push(l),l}function pi(t,o,n){const r=Lt(t,o);if(!r)return null;const l=r.children.findIndex(c=>c.id===o);if(l<0)return null;const s={id:Gt(),text:n??fi(r),children:[]};return r.children.splice(l+1,0,s),s}function Wa(t,o,n){const r=Lt(t,o);if(!r)return null;const l=r.children.findIndex(c=>c.id===o);if(l<0)return null;const s={id:Gt(),text:n,children:[]};return r.children.splice(l,0,s),s}function Ga(t,o){const n=Lt(t,o);if(!n)return null;const r=n.children.findIndex(c=>c.id===o);if(r<0)return null;const l=n.children[r],s=_t(l);return vo(s),n.children.splice(r+1,0,s),s}function vo(t){t.id=Gt();for(const o of t.children)vo(o)}function gi(t,o){const n=oe(t,o);if(!n||n.id===t.id)return null;const r=_t(n);return vo(r),r}const Ro="新节点";function zn(t,o="导入的导图"){const n=t.split(/\r?\n/),r={id:Gt(),text:o,children:[]},l=[r],s=[-1/0],c=[],u=/^(#{1,6})\s+(.+?)\s*#*\s*$/,d=/^!\[([^\]]*)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,g=/^\[([^\]]+)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,b=/^(`{3,}|~{3,})\s*(\S+)?\s*$/;let w=!1,N=[],$=null;function M(C){N.push(C)}function P(){if($&&N.length>0){for(;N.length>0&&N[0].trim()==="";)N.shift();for(;N.length>0&&N[N.length-1].trim()==="";)N.pop();const C=N.join(`
2
+ `);C&&($.note={text:C})}w=!1,N=[]}for(const C of n){if(w){const x=C.match(b);if(x&&x[1][0]==="`"){P();continue}M(C);continue}const E=C.match(u);if(E){const x=E[1].length,K=E[2].trim();c.push({level:x,text:K,body:""}),$=c[c.length-1];continue}const k=C.match(b);if(k&&k[2]==="note"){w=!0,N=[];continue}const m=C.match(d);if(m&&$){const x=m[2],K=160,Y=120;$.image={src:x,naturalW:K,naturalH:Y,width:K,height:Y};continue}const B=C.match(g);if(B&&$){$.link={url:B[2]},$.text=B[1];continue}if(C.trim().length>0&&$){const x=C.trim();$.body=$.body?$.body+`
3
+ `+x:x}}w&&P();function I(C){for(;l.length>1;){const B=l.length-1,x=s[B];if(x!==void 0&&x<C.level)break;l.pop(),s.pop()}const E=l[l.length-1],k=C.text,m={id:Gt(),text:k,children:[]};C.image&&(m.image={...C.image}),C.link&&(m.link={url:C.link.url}),C.note&&(m.note={text:C.note.text}),C.body&&(m.note={text:C.body}),E.children.push(m),l.push(m),s.push(C.level)}for(const C of c)I(C);if(c.length>0&&c[0].level===1){const C=r.children[0];C&&(r.text=C.text,r.id=C.id,C.image&&(r.image={...C.image}),C.link&&(r.link={url:C.link.url}),C.note&&(r.note={text:C.note.text}),r.children=C.children)}return r}function On(t,o=1){let n="#".repeat(o)+" "+(t.text||"")+`
4
4
  `;t.link&&(n+=`[${t.text||"link"}](${t.link.url})
5
5
  `),t.image&&(n+=`![image](${t.image.src})
6
6
  `),t.note&&(n+="```note\n"+t.note.text+"\n```\n"),t.richContent&&(n+=t.richContent.raw+`
7
- `);for(const i of t.children)n+=Qt(i,o+1);return n}function Fl(t){var f,p;const o=t.split(/\r?\n/),n=[];let i=0;const r=/^(#{1,6})\s+(.+?)\s*#*\s*$/,s=/^(`{3,}|~{3,})\s*(\S+)?\s*$/,c=/^\s*\|?\s*(:?-+:?\s*\|\s*)+(:?-+:?)(\s*\|)?\s*$/,u=/^(\s*)[-*+]\s+(.*)$/,d=/^(\s*)\d+\.\s+(.*)$/;for(;i<o.length;){const k=o[i],y=k.match(s);if(y){const S=y[1][0],g=y[2]||"",_=[k];for(i++;i<o.length;){const O=o[i].match(s);if(O&&O[1][0]===S){_.push(o[i]),i++;break}_.push(o[i]),i++}const b=_.slice(1,-1).join(`
8
- `).trim();n.push({kind:"code",text:((f=b.split(`
9
- `)[0])==null?void 0:f.slice(0,80))||"(空代码块)",raw:_.join(`
10
- `),lang:g});continue}const N=k.match(r);if(N){n.push({kind:"heading",level:N[1].length,text:N[2].trim(),raw:k}),i++;continue}if(/^\s*\|/.test(k)){const S=[];let g=i,_=!1;for(;g<o.length&&/^\s*\|/.test(o[g]);)S.push(o[g]),c.test(o[g])&&(_=!0),g++;if(_&&S.length>=2){n.push({kind:"table",text:((p=S[0].replace(/^\s*\|/,"").replace(/\|\s*$/,"").split("|")[0])==null?void 0:p.trim())||"表格",raw:S.join(`
11
- `)}),i=g;continue}}const E=k.match(u),L=k.match(d);if(E||L){let S=i;for(;S<o.length;){const g=o[S].match(u),_=o[S].match(d);if(!(g||_))break;const b=o[S].replace(/^\s*[-*+]\s+/,"").replace(/^\s*\d+\.\s+/,"").trim();b.length>0&&n.push({kind:"list",text:b.slice(0,80)||"(列表项)",raw:o[S]}),S++}i=S;continue}if(k.trim()===""){i++;continue}const C=[k];let x=i+1;for(;x<o.length;){const S=o[x];if(S.trim()===""||r.test(S)||s.test(S)||u.test(S)||d.test(S)||/^\s*\|/.test(S))break;C.push(S),x++}const R=C.join(" ").trim();n.push({kind:"paragraph",text:R.slice(0,80)||"(空段落)",raw:C.join(`
12
- `)}),i=x}return n}function Ul(t,o="导入的导图"){const n=Fl(t||""),i={id:yt(),text:o,children:[]},r=[i],s=[0];let c=!1;function u(d){if(d.kind==="heading"){const p=d.level;for(;r.length>1&&s[s.length-1]>=p;)r.pop(),s.pop();if(!c&&p===1){c=!0,i.text=d.text,s[0]=1;return}const k={id:yt(),text:d.text,children:[]};r[r.length-1].children.push(k),r.push(k),s.push(p);return}const f={id:yt(),text:d.text,children:[],richContent:{kind:d.kind,raw:d.raw,lang:d.lang}};r[r.length-1].children.push(f)}for(const d of n)u(d);return i}function Hl(t){return t.richContent?t.richContent.raw+`
13
- `:""}function Wl(t){const o=t.minScale??.2,n=t.maxScale??1/0,i=t.step??1.2,r=e.ref(1),s=e.ref(0),c=e.ref(0),u=e.ref(!1),d=e.ref(!1),f=e.reactive({x:0,y:0,ox:0,oy:0}),p=e.ref(!1),k=e.reactive({x:0,y:0}),y=e.reactive({x:0,y:0,width:0,height:0}),N=e.ref(0);let E=null;function L(K){E=K}function C(K){K.preventDefault();const ie=t.getContainer();if(!ie)return;const F=-K.deltaY*.001,q=Math.min(n,Math.max(o,r.value*(1+F))),U=ie.getBoundingClientRect(),w=K.clientX-U.left,P=K.clientY-U.top,V=(w-s.value)/r.value,Y=(P-c.value)/r.value;r.value=q,s.value=w-V*q,c.value=P-Y*q}function x(){r.value=Math.min(n,r.value*i)}function R(){r.value=Math.max(o,r.value/i)}function S(K){var F;K.target.closest(".zm-node, .zm-toolbar, button, input, textarea")||(u.value=!0,d.value=!1,f.x=K.clientX,f.y=K.clientY,f.ox=s.value,f.oy=c.value,window.addEventListener("mousemove",g),window.addEventListener("mouseup",_),(F=K.preventDefault)==null||F.call(K))}function g(K){if(!u.value)return;const ie=K.clientX-f.x,F=K.clientY-f.y;(Math.abs(ie)>3||Math.abs(F)>3)&&(d.value=!0),s.value=f.ox+ie,c.value=f.oy+F}function _(){u.value=!1,window.removeEventListener("mousemove",g),window.removeEventListener("mouseup",_)}function b(K,ie,F){p.value=!0,k.x=K,k.y=ie,y.x=K,y.y=ie,y.width=0,y.height=0,y.shiftKey=!!(F!=null&&F.shift),N.value++,window.addEventListener("mousemove",ne),window.addEventListener("mouseup",W)}function O(K,ie){if(!p.value)return;const F=Math.min(k.x,K),q=Math.min(k.y,ie),U=Math.max(k.x,K),w=Math.max(k.y,ie);y.x=F,y.y=q,y.width=U-F,y.height=w-q,N.value++}function W(){p.value=!1,window.removeEventListener("mousemove",ne),window.removeEventListener("mouseup",W),E&&E()}function ne(K){if(!p.value)return;const ie=t.getContainer();if(!ie)return;const F=ie.getBoundingClientRect(),q=(K.clientX-F.left-s.value)/r.value,U=(K.clientY-F.top-c.value)/r.value;O(q,U)}function pe(K,ie,F,q=60){const U=t.getContainer();if(!U)return;const w=U.getBoundingClientRect(),P=(w.width-q*2)/K,V=(w.height-q*2)/ie,Y=Math.min(1,Math.max(.3,Math.min(P,V)));r.value=Y,s.value=w.width/2,c.value=w.height/2-F*Y}return{scale:r,offsetX:s,offsetY:c,isPanning:u,panMoved:d,onWheel:C,zoomIn:x,zoomOut:R,startPan:S,startMarquee:b,updateMarquee:O,isMarquee:p,marquee:y,marqueeVersion:N,setOnMarqueeEnd:L,resetView:pe}}const Gl=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform);function Ni(t){return Gl?t.metaKey:t.ctrlKey}function jl(t){function o(){const i=t.getSelectedId();if(i)return i;if(t.defaultTargetId)return t.defaultTargetId();const r=t.getSelectedIds();return r.length>0?r[0]:null}function n(i){var u,d,f;const r=i.target;if(r&&(r.tagName==="INPUT"||r.tagName==="TEXTAREA"||r.isContentEditable)||t.isReadonly()||t.isEditing())return;const s=t.getSelectedId(),c=o();if(c){if(Ni(i)&&!i.shiftKey){if(i.key==="d"||i.key==="D"){const p=(u=t.defaultTargetId)==null?void 0:u.call(t);s&&s!==p&&(i.preventDefault(),t.onDuplicate(s));return}if(i.key==="c"||i.key==="C"){const p=t.getSelectedIds();p.length>0&&(i.preventDefault(),t.onCopy(p));return}if(i.key==="x"||i.key==="X"){const p=t.getSelectedIds();p.length>0&&(i.preventDefault(),t.onCut(p));return}if(i.key==="v"||i.key==="V"){if(!t.hasClipboard())return;i.preventDefault();const p=t.getSelectedIds();t.onPaste(p.length>0?p[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(Ni(i)&&i.shiftKey&&(i.key==="Z"||i.key==="z")){i.preventDefault(),t.onRedo();return}if(i.key==="Tab")i.preventDefault(),t.onAddChild(c);else if(i.key==="Enter")if(i.preventDefault(),i.shiftKey){const p=(d=t.defaultTargetId)==null?void 0:d.call(t);s&&s!==p&&t.onAddSiblingBefore(s)}else t.onAddSibling(c);else(i.key==="Delete"||i.key==="Backspace")&&s&&s!==((f=t.defaultTargetId)==null?void 0:f.call(t))?(i.preventDefault(),t.onRemove(s)):i.key==="F2"&&s?(i.preventDefault(),t.onStartEdit(s)):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 Kl(t=100){const o=e.ref([]);let n=-1;function i(){return n>0}function r(){return n<o.value.length-1}function s(f){const p=JSON.stringify(f);for(n<o.value.length-1&&(o.value=o.value.slice(0,n+1)),o.value.push(p),n=o.value.length-1;o.value.length>t;)o.value.shift(),n--}function c(){return i()?(n--,JSON.parse(o.value[n])):null}function u(){return r()?(n++,JSON.parse(o.value[n])):null}function d(){o.value=[],n=-1}return{canUndo:i,canRedo:r,record:s,undo:c,redo:u,reset:d}}const ql=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}},emits:["pickImage","setLink","removeLink","editNote","removeNote","removeImage","addCode","editCode","removeCode","addTable","editTable","removeTable","close"],setup(t,{emit:o}){const n=t,i=o,r=e.computed(()=>{let y=n.x+2,N=n.y+2;if(n.container){const E=n.container.getBoundingClientRect(),L=180,x=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+L>E.right&&(y=Math.max(E.left+4,n.x-L-2)),N+x>E.bottom&&(N=Math.max(E.top+4,n.y-x-2)),y<E.left+2&&(y=E.left+2),N<E.top+2&&(N=E.top+2)}return{left:y,top:N}}),s=e.computed(()=>n.hasImage),c=e.computed(()=>n.hasLink),u=e.computed(()=>n.hasNote);function d(y){const N=y.target;N&&N.closest(".zm-node-menu")||i("close")}function f(y){y.key==="Escape"&&i("close")}function p(){i("close")}window.addEventListener("mousedown",d,!0),window.addEventListener("keydown",f,!0),window.addEventListener("wheel",p,!0),window.addEventListener("scroll",p,!0),e.onBeforeUnmount(()=>{window.removeEventListener("mousedown",d,!0),window.removeEventListener("keydown",f,!0),window.removeEventListener("wheel",p,!0),window.removeEventListener("scroll",p,!0)});function k(y){y(),i("close")}return(y,N)=>(e.openBlock(),e.createElementBlock("div",{class:"zm-node-menu",style:e.normalizeStyle({left:r.value.left+"px",top:r.value.top+"px"}),onContextmenu:N[10]||(N[10]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("button",{class:"zm-node-menu-item",onClick:N[0]||(N[0]=e.withModifiers(E=>k(()=>i("pickImage")),["stop"]))},[e.createVNode(xe,{name:"image",size:13}),e.createElementVNode("span",null,e.toDisplayString(s.value?"替换图片":"添加图片"),1)]),s.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-node-menu-item",onClick:N[1]||(N[1]=e.withModifiers(E=>k(()=>i("removeImage")),["stop"]))},[e.createVNode(xe,{name:"x",size:13}),N[11]||(N[11]=e.createElementVNode("span",null,"移除图片",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:N[2]||(N[2]=e.withModifiers(E=>k(()=>i("setLink")),["stop"]))},[e.createVNode(xe,{name:"link",size:13}),e.createElementVNode("span",null,e.toDisplayString(c.value?"编辑链接":"添加链接"),1)]),c.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-node-menu-item",onClick:N[3]||(N[3]=e.withModifiers(E=>k(()=>i("removeLink")),["stop"]))},[e.createVNode(xe,{name:"x",size:13}),N[12]||(N[12]=e.createElementVNode("span",null,"移除链接",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:N[4]||(N[4]=e.withModifiers(E=>k(()=>i("addCode")),["stop"]))},[N[13]||(N[13]=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:N[5]||(N[5]=e.withModifiers(E=>k(()=>i("removeCode")),["stop"]))},[e.createVNode(xe,{name:"x",size:13}),N[14]||(N[14]=e.createElementVNode("span",null,"移除代码块",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:N[6]||(N[6]=e.withModifiers(E=>k(()=>i("addTable")),["stop"]))},[N[15]||(N[15]=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:N[7]||(N[7]=e.withModifiers(E=>k(()=>i("removeTable")),["stop"]))},[e.createVNode(xe,{name:"x",size:13}),N[16]||(N[16]=e.createElementVNode("span",null,"移除表格",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:N[8]||(N[8]=e.withModifiers(E=>k(()=>i("editNote")),["stop"]))},[e.createVNode(xe,{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:N[9]||(N[9]=e.withModifiers(E=>k(()=>i("removeNote")),["stop"]))},[e.createVNode(xe,{name:"x",size:13}),N[17]||(N[17]=e.createElementVNode("span",null,"移除笔记",-1))])):e.createCommentVNode("",!0)],36))}}),Yl=e.defineComponent({__name:"CanvasContextMenu",props:{x:{},y:{},container:{}},emits:["openSettings","openData","openImport","close"],setup(t,{emit:o}){const n=t,i=o,r=e.computed(()=>{let C=n.x+2,x=n.y+2;if(n.container){const R=n.container.getBoundingClientRect(),S=160,g=4+3*28;C+S>R.right&&(C=Math.max(R.left+4,n.x-S-2)),x+g>R.bottom&&(x=Math.max(R.top+4,n.y-g-2)),C<R.left+2&&(C=R.left+2),x<R.top+2&&(x=R.top+2)}return{left:C,top:x}}),s=e.ref(!1),c=e.ref(null),u=e.computed(()=>{if(!c.value)return{left:"-9999px",top:"-9999px",display:"none"};const C=c.value.getBoundingClientRect(),x=window.innerWidth,R=window.innerHeight,S=176,g=4+3*28;let _=C.right;_+S>x-4&&(_=Math.max(4,C.left-S));let b=C.top-4;return b+g>R-4&&(b=Math.max(4,R-g-4)),{left:_+"px",top:b+"px",display:"block"}});let d=null,f=null;function p(){f&&(clearTimeout(f),f=null),d=setTimeout(()=>{s.value=!0},60)}function k(){d&&(clearTimeout(d),d=null),f=setTimeout(()=>{s.value=!1},120)}e.onBeforeUnmount(()=>{d&&clearTimeout(d),f&&clearTimeout(f)});function y(C){const x=C.target;x&&x.closest(".zm-canvas-menu")||i("close")}function N(C){C.key==="Escape"&&i("close")}function E(){i("close")}window.addEventListener("mousedown",y,!0),window.addEventListener("keydown",N,!0),window.addEventListener("wheel",E,!0),window.addEventListener("scroll",E,!0),e.onBeforeUnmount(()=>{window.removeEventListener("mousedown",y,!0),window.removeEventListener("keydown",N,!0),window.removeEventListener("wheel",E,!0),window.removeEventListener("scroll",E,!0)});function L(C){C(),i("close")}return(C,x)=>(e.openBlock(),e.createElementBlock("div",{class:"zm-canvas-menu",style:e.normalizeStyle({left:r.value.left+"px",top:r.value.top+"px"}),onContextmenu:x[5]||(x[5]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[0]||(x[0]=e.withModifiers(R=>L(()=>i("openData")),["stop"]))},[e.createVNode(xe,{name:"database",size:13,stroke:1.6}),x[6]||(x[6]=e.createElementVNode("span",null,"查看数据",-1))]),e.createElementVNode("div",{ref_key:"importItemRef",ref:c,class:e.normalizeClass(["zm-canvas-menu-item zm-canvas-menu-item-has-submenu",{"is-open":s.value}]),onMouseenter:p,onMouseleave:k},[e.createVNode(xe,{name:"import",size:13,stroke:1.6}),x[10]||(x[10]=e.createElementVNode("span",null,"导入",-1)),x[11]||(x[11]=e.createElementVNode("svg",{class:"zm-canvas-menu-caret",width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[e.createElementVNode("polyline",{points:"2.5 1.8 5.2 4 2.5 6.2"})],-1)),s.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-canvas-submenu",style:e.normalizeStyle(u.value),onMouseenter:p,onMouseleave:k},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[1]||(x[1]=e.withModifiers(R=>L(()=>i("openImport","markdown")),["stop"]))},[e.createVNode(xe,{name:"markdown",size:13,stroke:1.6}),x[7]||(x[7]=e.createElementVNode("span",null,"Markdown 导入",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[2]||(x[2]=e.withModifiers(R=>L(()=>i("openImport","json")),["stop"]))},[e.createVNode(xe,{name:"data",size:13,stroke:1.6}),x[8]||(x[8]=e.createElementVNode("span",null,"JSON 文件导入",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[3]||(x[3]=e.withModifiers(R=>L(()=>i("openImport","txt")),["stop"]))},[e.createVNode(xe,{name:"txt",size:13,stroke:1.6}),x[9]||(x[9]=e.createElementVNode("span",null,"TXT 文件导入",-1))])],36)):e.createCommentVNode("",!0)],34),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[4]||(x[4]=e.withModifiers(R=>L(()=>i("openSettings")),["stop"]))},[e.createVNode(xe,{name:"settings",size:13,stroke:1.6}),x[12]||(x[12]=e.createElementVNode("span",null,"设置",-1))])],36))}});function Xl(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Si(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)&&Si(n)}),t}class Ti{constructor(o){o.data===void 0&&(o.data={}),this.data=o.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function Ci(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function Bt(t,...o){const n=Object.create(null);for(const i in t)n[i]=t[i];return o.forEach(function(i){for(const r in i)n[r]=i[r]}),n}const Zl="</span>",_i=t=>!!t.scope,Jl=(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,r)=>`${i}${"_".repeat(r+1)}`)].join(" ")}return`${o}${t}`};class Ql{constructor(o,n){this.buffer="",this.classPrefix=n.classPrefix,o.walk(this)}addText(o){this.buffer+=Ci(o)}openNode(o){if(!_i(o))return;const n=Jl(o.scope,{prefix:this.classPrefix});this.span(n)}closeNode(o){_i(o)&&(this.buffer+=Zl)}value(){return this.buffer}span(o){this.buffer+=`<span class="${o}">`}}const Ai=(t={})=>{const o={children:[]};return Object.assign(o,t),o};class So{constructor(){this.rootNode=Ai(),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=Ai({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=>{So._collapse(n)}))}}class ea extends So{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 Ql(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function Tn(t){return t?typeof t=="string"?t:t.source:null}function Mi(t){return Ut("(?=",t,")")}function ta(t){return Ut("(?:",t,")*")}function na(t){return Ut("(?:",t,")?")}function Ut(...t){return t.map(n=>Tn(n)).join("")}function oa(t){const o=t[t.length-1];return typeof o=="object"&&o.constructor===Object?(t.splice(t.length-1,1),o):{}}function To(...t){return"("+(oa(t).capture?"":"?:")+t.map(i=>Tn(i)).join("|")+")"}function Ri(t){return new RegExp(t.toString()+"|").exec("").length-1}function ia(t,o){const n=t&&t.exec(o);return n&&n.index===0}const ra=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Co(t,{joinWith:o}){let n=0;return t.map(i=>{n+=1;const r=n;let s=Tn(i),c="";for(;s.length>0;){const u=ra.exec(s);if(!u){c+=s;break}c+=s.substring(0,u.index),s=s.substring(u.index+u[0].length),u[0][0]==="\\"&&u[1]?c+="\\"+String(Number(u[1])+r):(c+=u[0],u[0]==="("&&n++)}return c}).map(i=>`(${i})`).join(o)}const la=/\b\B/,Bi="[a-zA-Z]\\w*",_o="[a-zA-Z_]\\w*",zi="\\b\\d+(\\.\\d+)?",Ii="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Oi="\\b(0b[01]+)",aa="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",sa=(t={})=>{const o=/^#![ ]*\//;return t.binary&&(t.begin=Ut(o,/.*\b/,t.binary,/\b.*/)),Bt({scope:"meta",begin:o,end:/$/,relevance:0,"on:begin":(n,i)=>{n.index!==0&&i.ignoreMatch()}},t)},Cn={begin:"\\\\[\\s\\S]",relevance:0},ca={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Cn]},da={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Cn]},ua={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/},Wn=function(t,o,n={}){const i=Bt({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 r=To("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:Ut(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),i},fa=Wn("//","$"),ma=Wn("/\\*","\\*/"),pa=Wn("#","$"),ga={scope:"number",begin:zi,relevance:0},ha={scope:"number",begin:Ii,relevance:0},ba={scope:"number",begin:Oi,relevance:0},ka={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Cn,{begin:/\[/,end:/\]/,relevance:0,contains:[Cn]}]},ya={scope:"title",begin:Bi,relevance:0},Ea={scope:"title",begin:_o,relevance:0},xa={begin:"\\.\\s*"+_o,relevance:0};var Gn=Object.freeze({__proto__:null,APOS_STRING_MODE:ca,BACKSLASH_ESCAPE:Cn,BINARY_NUMBER_MODE:ba,BINARY_NUMBER_RE:Oi,COMMENT:Wn,C_BLOCK_COMMENT_MODE:ma,C_LINE_COMMENT_MODE:fa,C_NUMBER_MODE:ha,C_NUMBER_RE:Ii,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:pa,IDENT_RE:Bi,MATCH_NOTHING_RE:la,METHOD_GUARD:xa,NUMBER_MODE:ga,NUMBER_RE:zi,PHRASAL_WORDS_MODE:ua,QUOTE_STRING_MODE:da,REGEXP_MODE:ka,RE_STARTERS_RE:aa,SHEBANG:sa,TITLE_MODE:ya,UNDERSCORE_IDENT_RE:_o,UNDERSCORE_TITLE_MODE:Ea});function wa(t,o){t.input[t.index-1]==="."&&o.ignoreMatch()}function Na(t,o){t.className!==void 0&&(t.scope=t.className,delete t.className)}function Sa(t,o){o&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=wa,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function Ta(t,o){Array.isArray(t.illegal)&&(t.illegal=To(...t.illegal))}function Ca(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 _a(t,o){t.relevance===void 0&&(t.relevance=1)}const Aa=(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=Ut(n.beforeMatch,Mi(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},Ma=["of","and","for","in","not","or","if","then","parent","list","value"],Ra="keyword";function vi(t,o,n=Ra){const i=Object.create(null);return typeof t=="string"?r(n,t.split(" ")):Array.isArray(t)?r(n,t):Object.keys(t).forEach(function(s){Object.assign(i,vi(t[s],o,s))}),i;function r(s,c){o&&(c=c.map(u=>u.toLowerCase())),c.forEach(function(u){const d=u.split("|");i[d[0]]=[s,Ba(d[0],d[1])]})}}function Ba(t,o){return o?Number(o):za(t)?0:1}function za(t){return Ma.includes(t.toLowerCase())}const Li={},Ht=t=>{console.error(t)},Di=(t,...o)=>{console.log(`WARN: ${t}`,...o)},en=(t,o)=>{Li[`${t}/${o}`]||(console.log(`Deprecated as of ${t}. ${o}`),Li[`${t}/${o}`]=!0)},jn=new Error;function Vi(t,o,{key:n}){let i=0;const r=t[n],s={},c={};for(let u=1;u<=o.length;u++)c[u+i]=r[u],s[u+i]=!0,i+=Ri(o[u-1]);t[n]=c,t[n]._emit=s,t[n]._multi=!0}function Ia(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw Ht("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),jn;if(typeof t.beginScope!="object"||t.beginScope===null)throw Ht("beginScope must be object"),jn;Vi(t,t.begin,{key:"beginScope"}),t.begin=Co(t.begin,{joinWith:""})}}function Oa(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw Ht("skip, excludeEnd, returnEnd not compatible with endScope: {}"),jn;if(typeof t.endScope!="object"||t.endScope===null)throw Ht("endScope must be object"),jn;Vi(t,t.end,{key:"endScope"}),t.end=Co(t.end,{joinWith:""})}}function va(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function La(t){va(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),Ia(t),Oa(t)}function Da(t){function o(c,u){return new RegExp(Tn(c),"m"+(t.case_insensitive?"i":"")+(t.unicodeRegex?"u":"")+(u?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(u,d){d.position=this.position++,this.matchIndexes[this.matchAt]=d,this.regexes.push([d,u]),this.matchAt+=Ri(u)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const u=this.regexes.map(d=>d[1]);this.matcherRe=o(Co(u,{joinWith:"|"}),!0),this.lastIndex=0}exec(u){this.matcherRe.lastIndex=this.lastIndex;const d=this.matcherRe.exec(u);if(!d)return null;const f=d.findIndex((k,y)=>y>0&&k!==void 0),p=this.matchIndexes[f];return d.splice(0,f),Object.assign(d,p)}}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(([f,p])=>d.addRule(f,p)),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 f=d.exec(u);if(this.resumingScanAtSamePosition()&&!(f&&f.index===this.lastIndex)){const p=this.getMatcher(0);p.lastIndex=this.lastIndex+1,f=p.exec(u)}return f&&(this.regexIndex+=f.position+1,this.regexIndex===this.count&&this.considerAll()),f}}function r(c){const u=new i;return c.contains.forEach(d=>u.addRule(d.begin,{rule:d,type:"begin"})),c.terminatorEnd&&u.addRule(c.terminatorEnd,{type:"end"}),c.illegal&&u.addRule(c.illegal,{type:"illegal"}),u}function s(c,u){const d=c;if(c.isCompiled)return d;[Na,Ca,La,Aa].forEach(p=>p(c,u)),t.compilerExtensions.forEach(p=>p(c,u)),c.__beforeBegin=null,[Sa,Ta,_a].forEach(p=>p(c,u)),c.isCompiled=!0;let f=null;return typeof c.keywords=="object"&&c.keywords.$pattern&&(c.keywords=Object.assign({},c.keywords),f=c.keywords.$pattern,delete c.keywords.$pattern),f=f||/\w+/,c.keywords&&(c.keywords=vi(c.keywords,t.case_insensitive)),d.keywordPatternRe=o(f,!0),u&&(c.begin||(c.begin=/\B|\b/),d.beginRe=o(d.begin),!c.end&&!c.endsWithParent&&(c.end=/\B|\b/),c.end&&(d.endRe=o(d.end)),d.terminatorEnd=Tn(d.end)||"",c.endsWithParent&&u.terminatorEnd&&(d.terminatorEnd+=(c.end?"|":"")+u.terminatorEnd)),c.illegal&&(d.illegalRe=o(c.illegal)),c.contains||(c.contains=[]),c.contains=[].concat(...c.contains.map(function(p){return Va(p==="self"?c:p)})),c.contains.forEach(function(p){s(p,d)}),c.starts&&s(c.starts,u),d.matcher=r(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=Bt(t.classNameAliases||{}),s(t)}function $i(t){return t?t.endsWithParent||$i(t.starts):!1}function Va(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(o){return Bt(t,{variants:null},o)})),t.cachedVariants?t.cachedVariants:$i(t)?Bt(t,{starts:t.starts?Bt(t.starts):null}):Object.isFrozen(t)?Bt(t):t}var $a="11.11.1";class Pa extends Error{constructor(o,n){super(o),this.name="HTMLInjectionError",this.html=n}}const Ao=Ci,Pi=Bt,Fi=Symbol("nomatch"),Fa=7,Ui=function(t){const o=Object.create(null),n=Object.create(null),i=[];let r=!0;const s="Could not find the language '{}', did you forget to load/include a language module?",c={disableAutodetect:!0,name:"Plain text",contains:[]};let u={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:ea};function d(w){return u.noHighlightRe.test(w)}function f(w){let P=w.className+" ";P+=w.parentNode?w.parentNode.className:"";const V=u.languageDetectRe.exec(P);if(V){const Y=W(V[1]);return Y||(Di(s.replace("{}",V[1])),Di("Falling back to no-highlight mode for this block.",w)),Y?V[1]:"no-highlight"}return P.split(/\s+/).find(Y=>d(Y)||W(Y))}function p(w,P,V){let Y="",ae="";typeof P=="object"?(Y=w,V=P.ignoreIllegals,ae=P.language):(en("10.7.0","highlight(lang, code, ...args) has been deprecated."),en("10.7.0",`Please use highlight(code, options) instead.
14
- https://github.com/highlightjs/highlight.js/issues/2277`),ae=w,Y=P),V===void 0&&(V=!0);const ke={code:Y,language:ae};q("before:highlight",ke);const Re=ke.result?ke.result:k(ke.language,ke.code,V);return Re.code=ke.code,q("after:highlight",Re),Re}function k(w,P,V,Y){const ae=Object.create(null);function ke(H,Z){return H.keywords[Z]}function Re(){if(!Q.keywords){Me.addText(we);return}let H=0;Q.keywordPatternRe.lastIndex=0;let Z=Q.keywordPatternRe.exec(we),le="";for(;Z;){le+=we.substring(H,Z.index);const me=We.case_insensitive?Z[0].toLowerCase():Z[0],ze=ke(Q,me);if(ze){const[Ue,Je]=ze;if(Me.addText(le),le="",ae[me]=(ae[me]||0)+1,ae[me]<=Fa&&(pt+=Je),Ue.startsWith("_"))le+=Z[0];else{const vt=We.classNameAliases[Ue]||Ue;B(Z[0],vt)}}else le+=Z[0];H=Q.keywordPatternRe.lastIndex,Z=Q.keywordPatternRe.exec(we)}le+=we.substring(H),Me.addText(le)}function Pe(){if(we==="")return;let H=null;if(typeof Q.subLanguage=="string"){if(!o[Q.subLanguage]){Me.addText(we);return}H=k(Q.subLanguage,we,!0,Nt[Q.subLanguage]),Nt[Q.subLanguage]=H._top}else H=N(we,Q.subLanguage.length?Q.subLanguage:null);Q.relevance>0&&(pt+=H.relevance),Me.__addSublanguage(H._emitter,H.language)}function Te(){Q.subLanguage!=null?Pe():Re(),we=""}function B(H,Z){H!==""&&(Me.startScope(Z),Me.addText(H),Me.endScope())}function z(H,Z){let le=1;const me=Z.length-1;for(;le<=me;){if(!H._emit[le]){le++;continue}const ze=We.classNameAliases[H[le]]||H[le],Ue=Z[le];ze?B(Ue,ze):(we=Ue,Re(),we=""),le++}}function oe(H,Z){return H.scope&&typeof H.scope=="string"&&Me.openNode(We.classNameAliases[H.scope]||H.scope),H.beginScope&&(H.beginScope._wrap?(B(we,We.classNameAliases[H.beginScope._wrap]||H.beginScope._wrap),we=""):H.beginScope._multi&&(z(H.beginScope,Z),we="")),Q=Object.create(H,{parent:{value:Q}}),Q}function re(H,Z,le){let me=ia(H.endRe,le);if(me){if(H["on:end"]){const ze=new Ti(H);H["on:end"](Z,ze),ze.isMatchIgnored&&(me=!1)}if(me){for(;H.endsParent&&H.parent;)H=H.parent;return H}}if(H.endsWithParent)return re(H.parent,Z,le)}function D(H){return Q.matcher.regexIndex===0?(we+=H[0],1):(St=!0,0)}function T(H){const Z=H[0],le=H.rule,me=new Ti(le),ze=[le.__beforeBegin,le["on:begin"]];for(const Ue of ze)if(Ue&&(Ue(H,me),me.isMatchIgnored))return D(Z);return le.skip?we+=Z:(le.excludeBegin&&(we+=Z),Te(),!le.returnBegin&&!le.excludeBegin&&(we=Z)),oe(le,H),le.returnBegin?0:Z.length}function se(H){const Z=H[0],le=P.substring(H.index),me=re(Q,H,le);if(!me)return Fi;const ze=Q;Q.endScope&&Q.endScope._wrap?(Te(),B(Z,Q.endScope._wrap)):Q.endScope&&Q.endScope._multi?(Te(),z(Q.endScope,H)):ze.skip?we+=Z:(ze.returnEnd||ze.excludeEnd||(we+=Z),Te(),ze.excludeEnd&&(we=Z));do Q.scope&&Me.closeNode(),!Q.skip&&!Q.subLanguage&&(pt+=Q.relevance),Q=Q.parent;while(Q!==me.parent);return me.starts&&oe(me.starts,H),ze.returnEnd?0:Z.length}function ce(){const H=[];for(let Z=Q;Z!==We;Z=Z.parent)Z.scope&&H.unshift(Z.scope);H.forEach(Z=>Me.openNode(Z))}let De={};function Ke(H,Z){const le=Z&&Z[0];if(we+=H,le==null)return Te(),0;if(De.type==="begin"&&Z.type==="end"&&De.index===Z.index&&le===""){if(we+=P.slice(Z.index,Z.index+1),!r){const me=new Error(`0 width match regex (${w})`);throw me.languageName=w,me.badRule=De.rule,me}return 1}if(De=Z,Z.type==="begin")return T(Z);if(Z.type==="illegal"&&!V){const me=new Error('Illegal lexeme "'+le+'" for mode "'+(Q.scope||"<unnamed>")+'"');throw me.mode=Q,me}else if(Z.type==="end"){const me=se(Z);if(me!==Fi)return me}if(Z.type==="illegal"&&le==="")return we+=`
15
- `,1;if(gt>1e5&&gt>Z.index*3)throw new Error("potential infinite loop, way more iterations than matches");return we+=le,le.length}const We=W(w);if(!We)throw Ht(s.replace("{}",w)),new Error('Unknown language: "'+w+'"');const mn=Da(We);let Ot="",Q=Y||mn;const Nt={},Me=new u.__emitter(u);ce();let we="",pt=0,qe=0,gt=0,St=!1;try{if(We.__emitTokens)We.__emitTokens(P,Me);else{for(Q.matcher.considerAll();;){gt++,St?St=!1:Q.matcher.considerAll(),Q.matcher.lastIndex=qe;const H=Q.matcher.exec(P);if(!H)break;const Z=P.substring(qe,H.index),le=Ke(Z,H);qe=H.index+le}Ke(P.substring(qe))}return Me.finalize(),Ot=Me.toHTML(),{language:w,value:Ot,relevance:pt,illegal:!1,_emitter:Me,_top:Q}}catch(H){if(H.message&&H.message.includes("Illegal"))return{language:w,value:Ao(P),illegal:!0,relevance:0,_illegalBy:{message:H.message,index:qe,context:P.slice(qe-100,qe+100),mode:H.mode,resultSoFar:Ot},_emitter:Me};if(r)return{language:w,value:Ao(P),illegal:!1,relevance:0,errorRaised:H,_emitter:Me,_top:Q};throw H}}function y(w){const P={value:Ao(w),illegal:!1,relevance:0,_top:c,_emitter:new u.__emitter(u)};return P._emitter.addText(w),P}function N(w,P){P=P||u.languages||Object.keys(o);const V=y(w),Y=P.filter(W).filter(pe).map(Te=>k(Te,w,!1));Y.unshift(V);const ae=Y.sort((Te,B)=>{if(Te.relevance!==B.relevance)return B.relevance-Te.relevance;if(Te.language&&B.language){if(W(Te.language).supersetOf===B.language)return 1;if(W(B.language).supersetOf===Te.language)return-1}return 0}),[ke,Re]=ae,Pe=ke;return Pe.secondBest=Re,Pe}function E(w,P,V){const Y=P&&n[P]||V;w.classList.add("hljs"),w.classList.add(`language-${Y}`)}function L(w){let P=null;const V=f(w);if(d(V))return;if(q("before:highlightElement",{el:w,language:V}),w.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",w);return}if(w.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(w)),u.throwUnescapedHTML))throw new Pa("One of your code blocks includes unescaped HTML.",w.innerHTML);P=w;const Y=P.textContent,ae=V?p(Y,{language:V,ignoreIllegals:!0}):N(Y);w.innerHTML=ae.value,w.dataset.highlighted="yes",E(w,V,ae.language),w.result={language:ae.language,re:ae.relevance,relevance:ae.relevance},ae.secondBest&&(w.secondBest={language:ae.secondBest.language,relevance:ae.secondBest.relevance}),q("after:highlightElement",{el:w,result:ae,text:Y})}function C(w){u=Pi(u,w)}const x=()=>{g(),en("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function R(){g(),en("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let S=!1;function g(){function w(){g()}if(document.readyState==="loading"){S||window.addEventListener("DOMContentLoaded",w,!1),S=!0;return}document.querySelectorAll(u.cssSelector).forEach(L)}function _(w,P){let V=null;try{V=P(t)}catch(Y){if(Ht("Language definition for '{}' could not be registered.".replace("{}",w)),r)Ht(Y);else throw Y;V=c}V.name||(V.name=w),o[w]=V,V.rawDefinition=P.bind(null,t),V.aliases&&ne(V.aliases,{languageName:w})}function b(w){delete o[w];for(const P of Object.keys(n))n[P]===w&&delete n[P]}function O(){return Object.keys(o)}function W(w){return w=(w||"").toLowerCase(),o[w]||o[n[w]]}function ne(w,{languageName:P}){typeof w=="string"&&(w=[w]),w.forEach(V=>{n[V.toLowerCase()]=P})}function pe(w){const P=W(w);return P&&!P.disableAutodetect}function K(w){w["before:highlightBlock"]&&!w["before:highlightElement"]&&(w["before:highlightElement"]=P=>{w["before:highlightBlock"](Object.assign({block:P.el},P))}),w["after:highlightBlock"]&&!w["after:highlightElement"]&&(w["after:highlightElement"]=P=>{w["after:highlightBlock"](Object.assign({block:P.el},P))})}function ie(w){K(w),i.push(w)}function F(w){const P=i.indexOf(w);P!==-1&&i.splice(P,1)}function q(w,P){const V=w;i.forEach(function(Y){Y[V]&&Y[V](P)})}function U(w){return en("10.7.0","highlightBlock will be removed entirely in v12.0"),en("10.7.0","Please use highlightElement now."),L(w)}Object.assign(t,{highlight:p,highlightAuto:N,highlightAll:g,highlightElement:L,highlightBlock:U,configure:C,initHighlighting:x,initHighlightingOnLoad:R,registerLanguage:_,unregisterLanguage:b,listLanguages:O,getLanguage:W,registerAliases:ne,autoDetection:pe,inherit:Pi,addPlugin:ie,removePlugin:F}),t.debugMode=function(){r=!1},t.safeMode=function(){r=!0},t.versionString=$a,t.regex={concat:Ut,lookahead:Mi,either:To,optional:na,anyNumberOfTimes:ta};for(const w in Gn)typeof Gn[w]=="object"&&Si(Gn[w]);return Object.assign(t,Gn),t},tn=Ui({});tn.newInstance=()=>Ui({});var Ua=tn;tn.HighlightJS=tn,tn.default=tn;const Mo=Xl(Ua);function Ro(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 r={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},s=t.inherit(t.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),c={begin:/<<-?\s*(?=\w+)/,starts:{contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},u={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,n,r]};r.contains.push(u);const d={match:/\\"/},f={className:"string",begin:/'/,end:/'/},p={match:/\\'/},k={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,n]},y=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],N=t.SHEBANG({binary:`(${y.join("|")})`,relevance:10}),E={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},L=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],C=["true","false"],x={match:/(\/[a-z._-]+)+/},R=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],S=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],g=["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:L,literal:C,built_in:[...R,...S,"set","shopt",...g,..._]},contains:[N,t.SHEBANG(),E,k,s,c,x,u,d,f,p,n]}}const Ha=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_-]*/}}),Wa=["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"],Ga=["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"],ja=[...Wa,...Ga],Ka=["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(),qa=["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(),Ya=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Xa=["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 Za(t){const o=t.regex,n=Ha(t),i={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},r="and or not only",s=/@-?\w[\w]*(-\w+)*/,c="[a-zA-Z-][a-zA-Z0-9_-]*",u=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,i,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+c,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+qa.join("|")+")"},{begin:":(:)?("+Ya.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Xa.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...u,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...u,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:o.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:s},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:r,attribute:Ka.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...u,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+ja.join("|")+")\\b"}]}}function Hi(t){const s={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:s,illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"string",variants:[t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[t.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:s,illegal:/["']/}]}]}}var nn="[0-9](_*[0-9])*",Kn=`\\.(${nn})`,qn="[0-9a-fA-F](_*[0-9a-fA-F])*",Wi={className:"number",variants:[{begin:`(\\b(${nn})((${Kn})|\\.)?|(${Kn}))[eE][+-]?(${nn})[fFdD]?\\b`},{begin:`\\b(${nn})((${Kn})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Kn})[fFdD]?\\b`},{begin:`\\b(${nn})[fFdD]\\b`},{begin:`\\b0[xX]((${qn})\\.?|(${qn})?\\.(${qn}))[pP][+-]?(${nn})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${qn})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Gi(t,o,n){return n===-1?"":t.replace(o,i=>Gi(t,o,n-1))}function Ja(t){const o=t.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",i=n+Gi("(?:<"+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"]},f={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},p={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:[p,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:[f,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,Wi,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},Wi,f]}}const ji="[A-Za-z$_][0-9A-Za-z$_]*",Qa=["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"],es=["true","false","null","undefined","NaN","Infinity"],Ki=["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"],qi=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Yi=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],ts=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],ns=[].concat(Yi,Ki,qi);function Xi(t){const o=t.regex,n=(V,{after:Y})=>{const ae="</"+V[0].slice(1);return V.input.indexOf(ae,Y)!==-1},i=ji,r={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,c={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(V,Y)=>{const ae=V[0].length+V.index,ke=V.input[ae];if(ke==="<"||ke===","){Y.ignoreMatch();return}ke===">"&&(n(V,{after:ae})||Y.ignoreMatch());let Re;const Pe=V.input.substring(ae);if(Re=Pe.match(/^\s*=/)){Y.ignoreMatch();return}if((Re=Pe.match(/^\s+extends\s+/))&&Re.index===0){Y.ignoreMatch();return}}},u={$pattern:ji,keyword:Qa,literal:es,built_in:ns,"variable.language":ts},d="[0-9](_?[0-9])*",f=`\\.(${d})`,p="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",k={className:"number",variants:[{begin:`(\\b(${p})((${f})|\\.)?|(${f}))[eE][+-]?(${d})\\b`},{begin:`\\b(${p})\\b((${f})\\b|\\.)?|(${f})\\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},y={className:"subst",begin:"\\$\\{",end:"\\}",keywords:u,contains:[]},N={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,y],subLanguage:"xml"}},E={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,y],subLanguage:"css"}},L={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,y],subLanguage:"graphql"}},C={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,y]},R={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]},S=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,N,E,L,C,{match:/\$\d+/},k];y.contains=S.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(S)});const g=[].concat(R,y.contains),_=g.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(g)}]),b={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:_},O={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:{_:[...Ki,...qi]}},ne={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},pe={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[b],illegal:/%/},K={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function ie(V){return o.concat("(?!",V.join("|"),")")}const F={match:o.concat(/\b/,ie([...Yi,"super","import"].map(V=>`${V}\\s*\\(`)),i,o.lookahead(/\s*\(/)),className:"title.function",relevance:0},q={begin:o.concat(/\./,o.lookahead(o.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},U={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},b]},w="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",P={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,o.lookahead(w)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[b]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:_,CLASS_REFERENCE:W},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),ne,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,N,E,L,C,R,{match:/\$\d+/},k,W,{scope:"attr",match:i+o.lookahead(":"),relevance:0},P,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[R,t.REGEXP_MODE,{className:"function",begin:w,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:_}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:s},{begin:c.begin,"on:begin":c.isTrulyOpeningTag,end:c.end}],subLanguage:"xml",contains:[{begin:c.begin,end:c.end,skip:!0,contains:["self"]}]}]},pe,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[b,t.inherit(t.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},q,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[b]},F,K,O,U,{match:/\$[(.]/}]}}function os(t){const o={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},i=["true","false","null"],r={scope:"literal",beginKeywords:i.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:i},contains:[o,n,t.QUOTE_STRING_MODE,r,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function Zi(t){const o=t.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},i={begin:"^[-\\*]{3,}",end:"$"},r={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},s={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},c={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},u=/[A-Za-z][A-Za-z0-9+.-]*/,d={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:o.concat(/\[.+?\]\(/,u,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},f={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},p={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},k=t.inherit(f,{contains:[]}),y=t.inherit(p,{contains:[]});f.contains.push(y),p.contains.push(k);let N=[n,d];return[f,p,k,y].forEach(x=>{x.contains=x.contains.concat(N)}),N=N.concat(f,p),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:N},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:N}]}]},n,s,f,p,{className:"quote",begin:"^>\\s+",contains:N,end:"$"},r,i,d,c,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function Ji(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:/^(>>>|\.\.\.) /},f={className:"subst",begin:/\{/,end:/\}/,keywords:u,illegal:/#/},p={begin:/\{\{/,relevance:0},k={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,p,f]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,d,p,f]},{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,p,f]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,p,f]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},y="[0-9](_?[0-9])*",N=`(\\b(${y}))?\\.(${y})|\\b(${y})\\.`,E=`\\b|${i.join("|")}`,L={className:"number",relevance:0,variants:[{begin:`(\\b(${y})|(${N}))[eE][+-]?(${y})[jJ]?(?=${E})`},{begin:`(${N})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${E})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${E})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${E})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${E})`},{begin:`\\b(${y})[jJ](?=${E})`}]},C={className:"comment",begin:o.lookahead(/# type:/),end:/$/,keywords:u,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},x={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:["self",d,L,k,t.HASH_COMMENT_MODE]}]};return f.contains=[k,L,d],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:u,illegal:/(<\/|\?)|=>/,contains:[d,L,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},k,C,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[x]},{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:[L,x,k]}]}}function Qi(t){const o=t.regex,n=/(r#)?/,i=o.concat(n,t.UNDERSCORE_IDENT_RE),r=o.concat(n,t.IDENT_RE),s={className:"title.function.invoke",relevance:0,begin:o.concat(/\b/,/(?!let|for|while|if|else|match\b)/,r,o.lookahead(/\s*\(/))},c="([ui](8|16|32|64|128|size)|f(32|64))?",u=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],d=["true","false","Some","None","Ok","Err"],f=["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!"],p=["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:p,keyword:u,literal:d,built_in:f},illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.COMMENT("/\\*","\\*/",{contains:["self"]}),t.inherit(t.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+c},{begin:"\\b0o([0-7_]+)"+c},{begin:"\\b0x([A-Fa-f0-9_]+)"+c},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+c}],relevance:0},{begin:[/fn/,/\s+/,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:f,type:p}},{className:"punctuation",begin:"->"},s]}}function is(t){const o=t.regex,n=t.COMMENT("--","$"),i={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},r={begin:/"/,end:/"/,contains:[{match:/""/}]},s=["true","false","unknown"],c=["double precision","large object","with timezone","without timezone"],u=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],d=["add","asc","collation","desc","final","first","last","view"],f=["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"],p=["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"],k=["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"],y=["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"],N=p,E=[...f,...d].filter(_=>!p.includes(_)),L={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},C={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},x={match:o.concat(/\b/,o.either(...N),/\s*\(/),relevance:0,keywords:{built_in:N}};function R(_){return o.concat(/\b/,o.either(..._.map(b=>b.replace(/\s+/,"\\s+"))),/\b/)}const S={scope:"keyword",match:R(y),relevance:0};function g(_,{exceptions:b,when:O}={}){const W=O;return b=b||[],_.map(ne=>ne.match(/\|\d+$/)||b.includes(ne)?ne:W(ne)?`${ne}|0`:ne)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:g(E,{when:_=>_.length<3}),literal:s,type:u,built_in:k},contains:[{scope:"type",match:R(c)},S,x,L,i,r,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,n,C]}}const Yn="[A-Za-z$_][0-9A-Za-z$_]*",er=["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"],tr=["true","false","null","undefined","NaN","Infinity"],nr=["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"],or=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],ir=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],rr=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],lr=[].concat(ir,nr,or);function rs(t){const o=t.regex,n=(V,{after:Y})=>{const ae="</"+V[0].slice(1);return V.input.indexOf(ae,Y)!==-1},i=Yn,r={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,c={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(V,Y)=>{const ae=V[0].length+V.index,ke=V.input[ae];if(ke==="<"||ke===","){Y.ignoreMatch();return}ke===">"&&(n(V,{after:ae})||Y.ignoreMatch());let Re;const Pe=V.input.substring(ae);if(Re=Pe.match(/^\s*=/)){Y.ignoreMatch();return}if((Re=Pe.match(/^\s+extends\s+/))&&Re.index===0){Y.ignoreMatch();return}}},u={$pattern:Yn,keyword:er,literal:tr,built_in:lr,"variable.language":rr},d="[0-9](_?[0-9])*",f=`\\.(${d})`,p="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",k={className:"number",variants:[{begin:`(\\b(${p})((${f})|\\.)?|(${f}))[eE][+-]?(${d})\\b`},{begin:`\\b(${p})\\b((${f})\\b|\\.)?|(${f})\\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},y={className:"subst",begin:"\\$\\{",end:"\\}",keywords:u,contains:[]},N={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,y],subLanguage:"xml"}},E={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,y],subLanguage:"css"}},L={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,y],subLanguage:"graphql"}},C={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,y]},R={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]},S=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,N,E,L,C,{match:/\$\d+/},k];y.contains=S.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(S)});const g=[].concat(R,y.contains),_=g.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(g)}]),b={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:_},O={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:{_:[...nr,...or]}},ne={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},pe={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[b],illegal:/%/},K={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function ie(V){return o.concat("(?!",V.join("|"),")")}const F={match:o.concat(/\b/,ie([...ir,"super","import"].map(V=>`${V}\\s*\\(`)),i,o.lookahead(/\s*\(/)),className:"title.function",relevance:0},q={begin:o.concat(/\./,o.lookahead(o.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},U={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},b]},w="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",P={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,o.lookahead(w)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[b]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:_,CLASS_REFERENCE:W},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),ne,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,N,E,L,C,R,{match:/\$\d+/},k,W,{scope:"attr",match:i+o.lookahead(":"),relevance:0},P,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[R,t.REGEXP_MODE,{className:"function",begin:w,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:_}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:s},{begin:c.begin,"on:begin":c.isTrulyOpeningTag,end:c.end}],subLanguage:"xml",contains:[{begin:c.begin,end:c.end,skip:!0,contains:["self"]}]}]},pe,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[b,t.inherit(t.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},q,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[b]},F,K,O,U,{match:/\$[(.]/}]}}function ar(t){const o=t.regex,n=rs(t),i=Yn,r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],s={begin:[/namespace/,/\s+/,t.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},c={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:r},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"],f={$pattern:Yn,keyword:er.concat(d),literal:tr,built_in:lr.concat(r),"variable.language":rr},p={className:"meta",begin:"@"+i},k=(L,C,x)=>{const R=L.contains.findIndex(S=>S.label===C);if(R===-1)throw new Error("can not find mode to replace");L.contains.splice(R,1,x)};Object.assign(n.keywords,f),n.exports.PARAMS_CONTAINS.push(p);const y=n.contains.find(L=>L.scope==="attr"),N=Object.assign({},y,{match:o.concat(i,o.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,y,N]),n.contains=n.contains.concat([p,s,c,N]),k(n,"shebang",t.SHEBANG()),k(n,"use_strict",u);const E=n.contains.find(L=>L.label==="func.def");return E.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function sr(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,r={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},s={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},c=t.inherit(s,{begin:/\(/,end:/\)/}),u=t.inherit(t.APOS_STRING_MODE,{className:"string"}),d=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),f={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:[r]},{begin:/'/,end:/'/,contains:[r]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[s,d,u,c,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[s,c,d,u]}]}]},t.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},r,{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:[f],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[f],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:f}]},{className:"tag",begin:o.concat(/<\//,o.lookahead(o.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function cr(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]|$)/}]},r={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},s={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},c={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,r]},u=t.inherit(c,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),y={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"},N={end:",",endsWithParent:!0,excludeEnd:!0,keywords:o,relevance:0},E={begin:/\{/,end:/\}/,contains:[N],illegal:"\\n",relevance:0},L={begin:"\\[",end:"\\]",contains:[N],illegal:"\\n",relevance:0},C=[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}},y,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},E,L,s,c],x=[...C];return x.pop(),x.push(u),N.contains=x,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:C}}const Bo={bash:Ro,sh:Ro,shell:Ro,css:Za,go:Hi,golang:Hi,java:Ja,javascript:Xi,js:Xi,json:os,markdown:Zi,md:Zi,python:Ji,py:Ji,rust:Qi,rs:Qi,sql:is,typescript:ar,ts:ar,xml:sr,html:sr,yaml:cr,yml:cr};for(const[t,o]of Object.entries(Bo))Mo.registerLanguage(t,o);function zo(t){const o=t.split(`
16
- `);return/^(`{3,}|~{3,})/.test(o[0]??"")&&o.shift(),/^(`{3,}|~{3,})\s*$/.test(o[o.length-1]??"")&&o.pop(),o.join(`
17
- `).replace(/\n+$/,"")}function on(t){const o=/^(`{3,}|~{3,})([^\s`~]*)/.exec(t.split(`
18
- `)[0]??""),n=((o==null?void 0:o[2])??"").toLowerCase();return n&&Bo[n]?n:""}function Io(t,o){const n=o&&Bo[o]?o:"";try{return n?Mo.highlight(t,{language:n,ignoreIllegals:!0}).value:Mo.highlightAuto(t).value}catch{return ls(t)}}function dr(t){return t.split(`
19
- `).filter(o=>o.trim().length>0).filter(o=>!/^\s*\|?\s*(:?-+:?\s*\|\s*)+(:?-+:?)(\s*\|)?\s*$/.test(o)).map(o=>o.replace(/^\s*\|/,"").replace(/\|\s*$/,"").split("|").map(n=>n.trim()))}function ls(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function ur(t,o,n){if(t.length<=1)return t.slice();const[i,...r]=t,s=r.map(f=>f[o]??""),c=s.length>0&&s.every(f=>f.trim()!==""&&!Number.isNaN(Number(f))),u=n==="asc"?1:-1,d=r.slice().sort((f,p)=>{const k=f[o]??"",y=p[o]??"";return c?(Number(k)-Number(y))*u:k.localeCompare(y,"zh-Hans-CN",{numeric:!0})*u});return[i,...d]}const as=["viewBox","width","height"],ss={class:"zm-edges"},cs=["d","fill"],ds=["data-node-id","onClick","onPointerdown","onDblclick","onContextmenu","onMouseenter","onMouseleave"],us=["src","width","height","alt"],fs=["onDblclick"],ms={key:0,class:"zm-rich-code"},ps=["innerHTML"],gs={key:1,class:"zm-rich-table"},hs=["onClick"],bs={class:"zm-rich-sort-mark","aria-hidden":"true"},ks={key:2,class:"zm-text"},ys={class:"zm-text-label"},Es=["href","title"],xs=["title","onClick"],ws=["title"],Ns=["title","onClick"],Ss=["onClick"],Ts=["onMousedown"],Cs=["onClick"],_s=["title"],As={class:"zm-tb-tip zm-tb-zoom"},Ms=["src"],Rs=["src"],Wt=24,rn=400,zt=160,fr=4,Xn=e.defineComponent({__name:"MindMap",props:{data:{},theme:{},previewMode:{type:Boolean,default:!1},markdown:{},lineColors:{},hideCanvasActions:{type:Boolean,default:!1}},emits:["change","select","edit-note","markdownChange","canvas-toggle-preview","canvas-outline","canvas-settings","canvas-data","canvas-import"],setup(t,{expose:o,emit:n}){const i=t,r=n,s=e.ref(null),c=e.ref(null),u=e.ref(""),d=e.ref(new Set),f=e.computed(()=>d.value.values().next().value??null),p=e.ref(new Set),k=e.ref(!1),y=e.ref(null),N=e.ref(0),E=e.ref(0),L=e.ref(null),C=e.ref(null),x=e.ref(null),R=e.ref(""),S=e.ref(new Map),g=e.ref(ct(i.data)),_=e.ref({}),b=e.ref({}),O=e.ref(i.markdown!==void 0);let W=!1;e.watch(()=>i.markdown,l=>{if(l===void 0){O.value=!1;return}O.value=!0;const a=Jt(l||"");W=!0,g.value=ct(a),d.value=new Set,p.value=new Set,be(),e.nextTick(()=>{W=!1,Mt()})}),e.watch(g,()=>{O.value&&!W&&r("markdownChange",Qt(g.value))},{deep:!0});const ne=e.computed(()=>ee.showOrderBadge===!0),pe=e.ref(new Map),K=pe.value;function ie(l,a){const h={};a.bg&&(h.bg=a.bg),a.textColor&&(h.textColor=a.textColor),a.borderColor&&(h.borderColor=a.borderColor),a.fontWeight&&(h.fontWeight=a.fontWeight),Object.keys(h).length===0?K.delete(l):K.set(l,h),pe.value=new Map(K)}function F(l){return K.get(l)??{}}function q(l,a){const h=fe(g.value,l);h&&(h.image={src:a.src,naturalW:a.naturalW,naturalH:a.naturalH,width:P(a.width,Wt,rn),height:P(a.height,Wt,rn)},Ie(),be(),r("change",g.value))}function U(l){const a=fe(g.value,l);!a||!a.image||(delete a.image,Ie(),be(),r("change",g.value))}function w(l,a){const h=a.trim();if(!fe(g.value,l))return;if(!h){U(l);return}const A=new Image;A.onload=()=>{const $=fe(g.value,l);if(!$)return;const j=A.naturalWidth&&A.naturalHeight?A.naturalWidth/A.naturalHeight:1,te=P(A.naturalWidth||zt,Wt,rn),Ne=Math.round(te/j);$.image={src:h,naturalW:A.naturalWidth||te,naturalH:A.naturalHeight||Ne,width:te,height:Ne},Ie(),be(),r("change",g.value)},A.onerror=()=>{},A.src=h}function P(l,a,h){return Math.min(h,Math.max(a,l))}function V(l,a){const h=new FileReader;h.onload=()=>{if(typeof h.result!="string")return;const v=h.result,A=new window.Image;A.onload=()=>{const $=A.naturalWidth||zt,j=A.naturalHeight||zt,te=P($,Wt,zt),Ne=P(Math.round(j*te/$),Wt,rn);a({src:v,naturalW:$,naturalH:j,width:te,height:Ne})},A.onerror=()=>{a({src:v,naturalW:zt,naturalH:zt,width:zt,height:zt})},A.src=v},h.readAsDataURL(l)}function Y(l){const a=document.createElement("input");a.type="file",a.accept="image/*",a.style.display="none",a.onchange=()=>{var v;const h=(v=a.files)==null?void 0:v[0];h&&(V(h,A=>q(l,A)),document.body.removeChild(a))},document.body.appendChild(a),a.click()}function ae(l,a){const h=a.trim(),v=fe(g.value,l);v&&(h?v.link={url:h}:delete v.link,Ie(),be(),r("change",g.value))}function ke(l){ae(l,"")}function Re(l,a){const h=fe(g.value,l);h&&(a?h.note={text:a}:delete h.note,Ie(),be(),r("change",g.value))}function Pe(l){Re(l,"")}function Te(l,a){const h=fe(g.value,l);h&&(a?h.richContent=a:delete h.richContent,Ie(),be(),r("change",g.value))}const B=e.ref(null),z=e.ref(null),oe=e.computed(()=>["zm-canvas-fab","zm-canvas-fab-preview",!i.hideCanvasActions&&(!i.previewMode||k.value)?"is-visible":""].filter(Boolean).join(" ")),re=e.computed(()=>["zm-canvas-fab","zm-canvas-fab-outline",!i.hideCanvasActions&&(!i.previewMode||k.value)?"is-visible":""].filter(Boolean).join(" "));function D(l,a){i.previewMode||(l.preventDefault(),l.stopPropagation(),z.value=null,d.value=new Set([a.id]),it(),B.value={nodeId:a.id,x:l.clientX,y:l.clientY})}function T(){B.value=null}function se(l){const a=l.target;if(!(a!=null&&a.closest(".zm-toolbar, button, input, textarea, .zm-canvas-fab-preview, .zm-canvas-fab-outline"))){if(ho&&J.panMoved.value){ho=!1,l.preventDefault();return}l.preventDefault(),B.value&&(B.value=null),z.value={x:l.clientX,y:l.clientY}}}function ce(){z.value=null}function De(){ce(),r("canvas-settings")}function Ke(){ce(),r("canvas-data")}function We(l){ce(),r("canvas-import",l)}function mn(){var a;const l=(a=B.value)==null?void 0:a.nodeId;l&&Y(l)}function Ot(){var v,A,$;const l=(v=B.value)==null?void 0:v.nodeId;if(!l)return;const a=(($=(A=fe(g.value,l))==null?void 0:A.link)==null?void 0:$.url)??"",h=window.prompt("输入链接 URL(留空取消)",a);h!==null&&ae(l,h)}function Q(){var a;const l=(a=B.value)==null?void 0:a.nodeId;l&&ke(l)}function Nt(){var a;const l=(a=B.value)==null?void 0:a.nodeId;l&&H(l)}function Me(){var a;const l=(a=B.value)==null?void 0:a.nodeId;l&&Pe(l)}function we(){var a;const l=(a=B.value)==null?void 0:a.nodeId;l&&U(l)}function pt(){var tt,rt;const l=(tt=B.value)==null?void 0:tt.nodeId;if(!l)return;const a=(rt=fe(g.value,l))==null?void 0:rt.richContent,h=(a==null?void 0:a.kind)==="code"?zo(a.raw):"",v=(a==null?void 0:a.kind)==="code"&&a.lang||"",A=v?"```"+v+`
20
- `:"```\n",j=window.prompt("输入代码块内容(用 ```lang 包裹;留空取消)",h?A+h+(h.endsWith("```")?"":"\n```"):A+"// 你的代码"+"\n```");if(j===null)return;const te=j.trim();if(!te){Te(l,null);return}const Ne=/^```([^\s`]*)/.exec(te),M=Ne?Ne[1]:void 0;Te(l,{kind:"code",raw:te,lang:M})}function qe(){var a;const l=(a=B.value)==null?void 0:a.nodeId;l&&Te(l,null)}function gt(){var j,te;const l=(j=B.value)==null?void 0:j.nodeId;if(!l)return;const a=(te=fe(g.value,l))==null?void 0:te.richContent,h=(a==null?void 0:a.kind)==="table"?a.raw:"",A=window.prompt("输入 markdown 表格(每行以 | 分隔;留空取消)",h||`| 列1 | 列2 | 列3 |
21
- | --- | --- | --- |
22
- | a | b | c |`);if(A===null)return;const $=A.trim();if(!$){Te(l,null);return}Te(l,{kind:"table",raw:$})}function St(){var a;const l=(a=B.value)==null?void 0:a.nodeId;l&&Te(l,null)}function H(l){i.previewMode||r("edit-note",l)}function Z(l,a=60){const h=l.replace(/\s+/g," ").trim();return h.length<=a?h||"点击编辑笔记":h.slice(0,a)+"…"}function le(l){var A;if(i.previewMode||c.value)return;const a=l.target;if(a&&(a.tagName==="INPUT"||a.tagName==="TEXTAREA"||a.isContentEditable))return;const h=f.value;if(!h)return;const v=(A=l.clipboardData)==null?void 0:A.items;if(v)for(let $=0;$<v.length;$++){const j=v[$];if(j.kind==="file"&&j.type.startsWith("image/")){const te=j.getAsFile();if(!te)continue;l.preventDefault();const Ne=fe(g.value,h);if(Ne!=null&&Ne.image&&!window.confirm("该节点已有图片,要用剪贴板里的图片替换吗?"))return;V(te,M=>q(h,M));return}}}e.onMounted(()=>{window.addEventListener("paste",le),be()}),e.onBeforeUnmount(()=>{window.removeEventListener("paste",le)});const me=e.ref(null),ze=e.computed(()=>{var l;return((l=me.value)==null?void 0:l.nodeId)??null});function Ue(l,a){if(!a.image)return;l.preventDefault(),l.stopPropagation();const h=a.image.naturalW||a.image.width,v=a.image.naturalH||a.image.height,A=v>0?v/h:1;me.value={nodeId:a.id,startX:l.clientX,startY:l.clientY,startW:a.image.width,startH:a.image.height,naturalW:h,naturalH:v,ratio:A,pendingW:a.image.width,pendingH:a.image.height},window.addEventListener("mousemove",Je),window.addEventListener("mouseup",vt)}function Je(l){var Ne,M;const a=me.value;if(!a)return;const h=J.scale.value||1,v=l.clientX-a.startX,A=P(a.startW+v/h,Wt,rn),$=P(A*a.ratio,Wt,rn);a.pendingW=A,a.pendingH=$;const j=(Ne=s.value)==null?void 0:Ne.querySelector(`[data-node-id="${a.nodeId}"] .zm-node-img`);j&&(j.style.width=`${A}px`,j.style.height=`${$}px`);const te=(M=s.value)==null?void 0:M.querySelector(`[data-node-id="${a.nodeId}"]`);te&&(te.style.minWidth=`${Math.max(80,Math.ceil(A+28))}px`,te.style.height=`${Math.ceil($+8+30)}px`)}function vt(){const l=me.value;if(window.removeEventListener("mousemove",Je),window.removeEventListener("mouseup",vt),me.value=null,!l)return;const a=fe(g.value,l.nodeId);!a||!a.image||(q(l.nodeId,{src:a.image.src,naturalW:a.image.naturalW,naturalH:a.image.naturalH,width:l.pendingW,height:l.pendingH}),d.value=new Set([l.nodeId]),it(),gn=!0)}const pn=e.ref(null);let gn=!1;function In(l){pn.value=l}function io(l){pn.value===l&&(pn.value=null),C.value&&(C.value=null)}function hn(l,a){var bt;if(!a.text||a.text.length<14)return;const v=l.currentTarget.getBoundingClientRect(),A=(bt=s.value)==null?void 0:bt.getBoundingClientRect();if(!A)return;const $=10,j=240,te=v.top-A.top>60,Ne=v.left-A.left+v.width/2,M=$+j/2,tt=A.width-j/2-$,rt=Math.max(M,Math.min(Ne,tt)),ge=te?v.top-A.top-8:v.bottom-A.top+8;C.value={text:a.text,x:rt,y:ge,above:te}}const Lt=e.ref(0),nt=e.ref(!1),Qe=Kl(100);function Ie(){Qe.record({data:g.value,selectedIds:[...d.value]})}function be(){p.value=new Set(p.value),Lt.value++,e.nextTick().then(()=>e.nextTick()).then(()=>oi()).then(()=>{Lt.value++})}function oi(){const l=document.querySelectorAll(".zm-rich"),a={},h={};l.forEach(v=>{let A=v,$=null;for(;A&&!$;)$=A.getAttribute("data-node-id"),A=A.parentElement;if(!$)return;const j=v.offsetHeight,te=v.scrollWidth,Ne=Math.round(j*2)/2,M=Math.round(te*2)/2;a[$]=Ne,h[$]=M,_.value[$],b.value[$]}),_.value=a,b.value=h}const et=e.computed(()=>{var l,a,h,v,A,$,j,te,Ne,M;return{rootBg:((l=i.theme)==null?void 0:l.rootBg)??"#1f2937",rootText:((a=i.theme)==null?void 0:a.rootText)??"#ffffff",branchBg:((h=i.theme)==null?void 0:h.branchBg)??"#ffffff",branchText:((v=i.theme)==null?void 0:v.branchText)??"#1f2937",lineColor:((A=i.theme)==null?void 0:A.lineColor)??"#94a3b8",bgColor:(($=i.theme)==null?void 0:$.bgColor)??"#f8fafc",fontSize:((j=i.theme)==null?void 0:j.fontSize)??14,lineWidthStart:((te=i.theme)==null?void 0:te.lineWidthStart)??2.2,lineWidthEnd:((Ne=i.theme)==null?void 0:Ne.lineWidthEnd)??.8,rainbowBranch:((M=i.theme)==null?void 0:M.rainbowBranch)??!1}}),ee=e.reactive({autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:3.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"curve",layoutMode:"mindmap",taperedEdge:!0,showOrderBadge:!1});function ro(l){return ee.taperedEdge?ii(l):lo(l)}function Dt(l){return ee.taperedEdge?ee.lineWidthEnd:lo(l)}function ii(l){return l<=0?ee.lineWidthStart:l===1?Math.max(1.5,ee.lineWidthStart*.67):l===2?Math.max(.8,ee.lineWidthStart*.42):ee.lineWidthEnd}function lo(l){if(l<=0)return ee.lineWidthStart;if(l>=3)return ee.lineWidthEnd;const a=l/3;return ee.lineWidthStart+(ee.lineWidthEnd-ee.lineWidthStart)*a}function Oe(l,a,h,v){const A=1-l,$=A*A*A*a.x+3*A*A*l*h.x1+3*A*l*l*h.x2+l*l*l*v.x,j=A*A*A*a.y+3*A*A*l*h.y1+3*A*l*l*h.y2+l*l*l*v.y;return{x:$,y:j}}function Vt(l,a,h,v,A=32,$="curve",j="right"){if($==="curve"){let Ct;if(j==="right"||j==="left"){const Le=Math.abs(a.x-l.x)*.45,Rt=j==="right"?1:-1;Ct={x1:l.x+Rt*Le,y1:l.y,x2:a.x-Rt*Le,y2:a.y}}else{const Le=Math.abs(a.y-l.y)*.45;Ct={x1:l.x,y1:l.y+Le,x2:a.x,y2:a.y-Le}}const bo=Se=>{const Le=1-Se,Rt=-3*Le*Le*l.x+3*(Le*Le-2*Le*Se)*Ct.x1+3*(2*Le*Se-Se*Se)*Ct.x2+3*Se*Se*a.x,Sn=-3*Le*Le*l.y+3*(Le*Le-2*Le*Se)*Ct.y1+3*(2*Le*Se-Se*Se)*Ct.y2+3*Se*Se*a.y;return{dx:Rt,dy:Sn}},Ft=[],ko=[];for(let Se=0;Se<=A;Se++){const Le=Se/A,Rt=Se===0?l:Se===A?a:Oe(Le,l,Ct,a),Sn=bo(Le);let Eo=Math.hypot(Sn.dx,Sn.dy);Eo<1e-6&&(Eo=1);const sl=-Sn.dy/Eo,cl=Sn.dx/Eo,xo=(h+(v-h)*Le)/2;Ft.push({x:Rt.x+sl*xo,y:Rt.y+cl*xo}),ko.push({x:Rt.x-sl*xo,y:Rt.y-cl*xo})}let yo=`M ${Ft[0].x.toFixed(2)} ${Ft[0].y.toFixed(2)}`;for(let Se=1;Se<=A;Se++)yo+=` L ${Ft[Se].x.toFixed(2)} ${Ft[Se].y.toFixed(2)}`;for(let Se=A;Se>=0;Se--)yo+=` L ${ko[Se].x.toFixed(2)} ${ko[Se].y.toFixed(2)}`;return yo+=" Z",yo}const te=a.x-l.x,Ne=a.y-l.y;let M=Math.hypot(te,Ne);M<1e-6&&(M=1);const tt=-Ne/M,rt=te/M,ge=h/2,bt=v/2,Nn={x:l.x+tt*ge,y:l.y+rt*ge},kt={x:l.x-tt*ge,y:l.y-rt*ge},Ln={x:a.x-tt*bt,y:a.y-rt*bt},Dn={x:a.x+tt*bt,y:a.y+rt*bt};return`M ${Nn.x.toFixed(2)} ${Nn.y.toFixed(2)} L ${Dn.x.toFixed(2)} ${Dn.y.toFixed(2)} L ${Ln.x.toFixed(2)} ${Ln.y.toFixed(2)} L ${kt.x.toFixed(2)} ${kt.y.toFixed(2)} Z`}const bn=e.computed(()=>Fe.value.root.children),ao=_t[0].colors,kn=e.computed(()=>zl(ee.branchPaletteId,ee.customPalettes)),Tt=e.computed(()=>{const l=new Map;if(!ee.rainbowBranch)return l;const a=i.lineColors,h=a&&a.length>0?a:kn.value.colors.length>0?kn.value.colors:ao;for(let A=0;A<bn.value.length;A++){const $=bn.value[A];l.set($.id,h[A%h.length])}const v=(A,$)=>{l.set(A.id,$);for(const j of A.children)v(j,$)};for(let A=0;A<bn.value.length;A++){const $=bn.value[A];v($,h[A%h.length])}return l});function so(l,a){return ee.rainbowBranch?Tt.value.get(a.id)??et.value.lineColor:et.value.lineColor}function ri(l){const a=F(l.id);if(a.bg)return a.bg;if(l.isRoot)return et.value.rootBg;if(ee.rainbowBranch){const h=Tt.value.get(l.id);if(h)return uo(h,.18)}return et.value.branchBg}function lt(l){const a=F(l.id);if(a.textColor)return a.textColor;if(l.isRoot)return et.value.rootText;if(ee.rainbowBranch){const h=Tt.value.get(l.id);if(h)return yn(h,.55)}return et.value.branchText}function At(l){const a=F(l.id);if(a.borderColor)return a.borderColor;if(l.isRoot)return et.value.rootBg;if(ee.rainbowBranch){const h=Tt.value.get(l.id);if(h)return yn(h,.3)}return et.value.lineColor}function co(l){return F(l.id).fontWeight??(l.isRoot?600:400)}function uo(l,a){const h=l.replace("#",""),v=h.length===6?h:h.split("").map(te=>te+te).join(""),A=parseInt(v.slice(0,2),16),$=parseInt(v.slice(2,4),16),j=parseInt(v.slice(4,6),16);return`rgba(${A}, ${$}, ${j}, ${a})`}function yn(l,a){const h=l.replace("#",""),v=h.length===6?h:h.split("").map(te=>te+te).join(""),A=Math.round(parseInt(v.slice(0,2),16)*(1-a)),$=Math.round(parseInt(v.slice(2,4),16)*(1-a)),j=Math.round(parseInt(v.slice(4,6),16)*(1-a));return`rgb(${A}, ${$}, ${j})`}const J=Wl({getContainer:()=>s.value});J.setOnMarqueeEnd(mm),jl({isEditing:()=>c.value!==null,isReadonly:()=>i.previewMode,getSelectedId:()=>f.value,getSelectedIds:()=>[...d.value],defaultTargetId:()=>g.value.id,onAddChild:Be,onAddSibling:Ye,onAddSiblingBefore:at,onRemove:Zr,onStartEdit:$t,onClearSelection:()=>{d.value=new Set,it()},onDuplicate:wn,onCopy:vn,onCut:Yr,onPaste:Xr,hasClipboard:()=>!!L.value&&L.value.nodes.length>0,onUndo:li,onRedo:ai,onNavigate:im,onSelectRoot:()=>{d.value=new Set([g.value.id]),it()}});const Fe=e.computed(()=>{const l=ct(g.value);return po(l),Al(l,{mode:ee.layoutMode,baseFontSize:et.value.fontSize,richHeights:_.value,richWidths:b.value})}),Yt=e.ref([]),ot=e.computed(()=>(Lt.value,Yt.value));e.watch(Fe,l=>{const a=[],h=v=>{a.push(v);for(const A of v.children)h(A)};h(l.root),Yt.value=a},{immediate:!0});const fo=e.computed(()=>{const l=[];for(const a of ot.value)for(const h of a.children)l.push({from:a,to:h,key:`${a.id}->${h.id}`});return l}),mo=e.computed(()=>`${Fe.value.vbX} ${Fe.value.vbY} ${Fe.value.vbW} ${Fe.value.vbH}`);function po(l){if(p.value.has(l.id)){l.children=[],l.collapsed=!0;return}l.collapsed=!1;for(const a of l.children)po(a)}function $t(l){const a=fe(g.value,l);a&&(c.value=l,u.value=a.text,e.nextTick(()=>{const h=document.querySelector(".zm-input");h==null||h.focus(),h==null||h.select()}))}function En(){if(!c.value)return;const l=fe(g.value,c.value);l&&l.text!==(u.value.trim()||" ")&&(l.text=u.value.trim()||" ",Ie(),r("change",g.value)),c.value=null}function xn(){c.value=null}function Pt(l){if(i.previewMode)return;const a=fe(g.value,l);a!=null&&a.richContent&&(x.value=l,R.value=a.richContent.raw,e.nextTick(()=>{const h=document.querySelector(".zm-node .zm-rich textarea");h==null||h.focus()}))}function X(){if(!x.value)return;const l=x.value,a=fe(g.value,l),h=R.value;if(a&&a.richContent&&a.richContent.raw!==h)if(a.richContent.kind==="code"){const v=on(h)||void 0;Te(l,{kind:"code",raw:h,lang:v})}else Te(l,{kind:"table",raw:h});x.value=null}function m(){x.value=null}function I(l){l.key==="Escape"?(l.preventDefault(),m()):l.key==="Enter"&&(l.ctrlKey||l.metaKey)&&(l.preventDefault(),X())}function G(l,a){const h=S.value.get(l);!h||h.col!==a?S.value.set(l,{col:a,dir:"asc"}):h.dir==="asc"?S.value.set(l,{col:a,dir:"desc"}):S.value.delete(l)}function ye(l,a){const h=S.value.get(l);return!h||a.length<=1?a:ur(a,h.col,h.dir)}function ue(l,a){const h=S.value.get(l);return!h||h.col!==a?"↕":h.dir==="asc"?"▲":"▼"}function Ce(l){const a=l.metaKey||l.ctrlKey;a&&(l.key==="z"||l.key==="Z")&&!l.shiftKey?(l.preventDefault(),li()):(a&&l.shiftKey&&(l.key==="z"||l.key==="Z")||a&&(l.key==="y"||l.key==="Y")&&!l.shiftKey)&&(l.preventDefault(),ai())}function Be(l){const a=Ei(g.value,l,Hn);a&&(Ie(),be(),r("change",g.value),e.nextTick(()=>$t(a.id)))}function Ye(l){if(l===g.value.id){Be(l);return}const a=xi(g.value,l,Hn);a&&(Ie(),be(),r("change",g.value),e.nextTick(()=>$t(a.id)))}function at(l){if(l===g.value.id){Be(l);return}const a=$l(g.value,l,Hn);a&&(Ie(),be(),r("change",g.value),e.nextTick(()=>$t(a.id)))}function wn(l){if(l===g.value.id)return;const a=Pl(g.value,l);a&&(Ie(),d.value=new Set([a.id]),it(),r("change",g.value),be())}function Ve(l){const a=[],h=new Set;for(const v of l)v!==g.value.id&&(h.has(v)||fe(g.value,v)&&(h.add(v),a.push(v)));return a}function On(l){const a=new Set(l),h=[],v=A=>{a.has(A.id)&&h.push(A.id);for(const $ of A.children)v($)};return v(g.value),h}function vn(l){const a=On(Ve(l));if(a.length===0)return;const h=[];for(const v of a){const A=wi(g.value,v);A&&h.push(A)}h.length!==0&&(L.value={nodes:h,originalIds:new Set(a)},be())}function Yr(l){const a=On(Ve(l));if(a.length===0)return;const h=[];for(const v of a){const A=wi(g.value,v);A&&h.push(A)}if(h.length!==0){Ie();for(const v of a)Fn(g.value,v);d.value=new Set,it(),L.value={nodes:h,originalIds:new Set(a)},be(),r("change",g.value)}}function Xr(l){const a=L.value;if(!a||a.nodes.length===0)return;const h=l??g.value.id,v=fe(g.value,h);if(v){for(const A of a.originalIds){const $=fe(g.value,A);if($&&fe($,h))return}Ie();for(const A of a.nodes){const $=ct(A);Un($),v.children.push($)}L.value=null,be(),r("change",g.value)}}function li(){const l=Qe.undo();l&&(g.value=l.data,d.value=new Set(l.selectedIds??[]),it(),be(),r("change",g.value))}function ai(){const l=Qe.redo();l&&(g.value=l.data,d.value=new Set(l.selectedIds??[]),it(),be(),r("change",g.value))}function it(){const l=[];for(const a of d.value){const h=fe(g.value,a);h&&l.push(h)}r("select",l.length>0?l:null)}function im(l,a){const h=f.value??g.value.id,v=fe(g.value,h);if(!v)return;let A=null;if(a===1){const $=ut(g.value,v.id);if($){const j=$.children.findIndex(te=>te.id===v.id);j>=0&&j<$.children.length-1&&(A=$.children[j+1].id)}}else if(a===-1){const $=ut(g.value,v.id);if($){const j=$.children.findIndex(te=>te.id===v.id);j>0&&(A=$.children[j-1].id)}}else if(l===1){const $=ut(g.value,v.id);$&&(A=$.id)}else l===-1&&v.children.length>0&&(A=v.children[0].id);A&&(d.value=new Set([A]),it())}function Zr(l){if(l!==g.value.id&&Fn(g.value,l)){if(Ie(),d.value.has(l)){const a=new Set(d.value);a.delete(l),d.value=a,it()}be(),r("change",g.value)}}function Jr(l){p.value.has(l)?p.value.delete(l):p.value.add(l),be()}function Qr(l){const a=[{n:g.value,depth:1}];for(;a.length;){const{n:h,depth:v}=a.pop();l(h,v);for(let A=h.children.length-1;A>=0;A--)a.push({n:h.children[A],depth:v+1})}}function rm(){p.value=new Set,Qr(l=>{l.children.length>0&&p.value.add(l.id)}),be()}function el(l){p.value=new Set,Qr((a,h)=>{h>l&&a.children.length>0&&p.value.add(a.id)}),be()}function lm(){p.value=new Set,be()}function am(l,a){Dl(g.value,l,a)&&(Ie(),be(),r("change",g.value))}function tl(l,a,h){return Vl(g.value,l,a,h)?(Ie(),be(),r("change",g.value),!0):!1}function sm(l,a){if(l.stopPropagation(),l.shiftKey){const h=new Set(d.value);h.has(a.id)?h.delete(a.id):h.add(a.id),d.value=h}else d.value=new Set([a.id]);it()}function cm(l,a,h){let v=null;for(const A of ot.value){if(A.id===h)continue;const $=A.width/2,j=A.height/2;l>=A.x-$&&l<=A.x+$&&a>=A.y-j&&a<=A.y+j&&(v=A)}return v}let ht=null;function dm(l,a){if(i.previewMode||a.isRoot||l.button!==0)return;const h=l.target;if(h!=null&&h.closest(".zm-img-resize-handle"))return;l.stopPropagation();const v=s.value.getBoundingClientRect(),A=a.x*J.scale.value+J.offsetX.value,$=a.y*J.scale.value+J.offsetY.value,j=l.clientX-v.left-A,te=l.clientY-v.top-$;ht={srcId:a.id,srcText:a.text,pointerOffsetX:j,pointerOffsetY:te,startX:l.clientX,startY:l.clientY},window.addEventListener("pointermove",nl),window.addEventListener("pointerup",go),window.addEventListener("pointercancel",go)}function nl(l){if(ht){const j=l.clientX-ht.startX,te=l.clientY-ht.startY;if(Math.abs(j)<=fr&&Math.abs(te)<=fr)return;y.value={srcId:ht.srcId,srcText:ht.srcText,pointerOffsetX:ht.pointerOffsetX,pointerOffsetY:ht.pointerOffsetY,currentTargetId:null},document.body.classList.add("is-dragging"),ht=null}const a=y.value;if(!a)return;const h=s.value.getBoundingClientRect();N.value=l.clientX-h.left-a.pointerOffsetX,E.value=l.clientY-h.top-a.pointerOffsetY;const v=(l.clientX-h.left-J.offsetX.value)/J.scale.value,A=(l.clientY-h.top-J.offsetY.value)/J.scale.value,$=cm(v,A,a.srcId);a.currentTargetId=($==null?void 0:$.id)??null}function go(l){if(window.removeEventListener("pointermove",nl),window.removeEventListener("pointerup",go),window.removeEventListener("pointercancel",go),ht){ht=null;return}const a=y.value;a&&(a.currentTargetId&&(tl(a.srcId,a.currentTargetId,"child"),d.value=new Set([a.srcId]),it()),y.value=null,N.value=0,E.value=0,document.body.classList.remove("is-dragging"))}let ho=!1;function um(l){const a=l.target;if(!a||a.closest(".zm-node, .zm-toolbar, button, input, textarea"))return;if(l.button===2){ho=!0,J.startPan(l);return}if(ho=!1,l.button!==0)return;const h=s.value.getBoundingClientRect(),v=(l.clientX-h.left-J.offsetX.value)/J.scale.value,A=(l.clientY-h.top-J.offsetY.value)/J.scale.value;J.startMarquee(v,A,{shift:l.shiftKey})}function fm(l){if(gn){gn=!1;return}const a=l.target;if(!a||a.closest(".zm-node"))return;const h=J.marquee;h.width>=4||h.height>=4||d.value.size>0&&(d.value=new Set,it())}function mm(){const l=J.marquee;if(l.width<4&&l.height<4)return;const a=l.x,h=l.y,v=l.x+l.width,A=l.y+l.height,$=[];for(const j of ot.value){const te=j.width/2,Ne=j.height/2,M=j.x-te,tt=j.x+te,rt=j.y-Ne,ge=j.y+Ne;M<=v&&tt>=a&&rt<=A&&ge>=h&&$.push(j.id)}d.value=l.shiftKey?new Set([...d.value,...$]):new Set($),it()}function ol(l){return p.value.has(l)}function pm(l){const a=fe(g.value,l.id);return!!a&&a.children.length>0}function si(l){const a=fe(g.value,l);return a?a.children.length:0}function il(l){if(!fe(g.value,l))return 0;const v=[g.value];for(;v.length;){const A=v.pop(),$=A.children.findIndex(j=>j.id===l);if($>=0)return $;for(const j of A.children)v.push(j)}return 0}function rl(l,a,h,v){if(((v==null?void 0:v._dir)??l._dir)==="down")return a==="out"?{x:l.x,y:l.y+l.height/2}:{x:l.x,y:l.y-l.height/2};let $;a==="in"?$=-l.side:h!==void 0?$=h:$=l.side;const j=a==="in"?l._richInsetX??0:0;return{x:l.x+$*(l.width/2-j),y:l.y}}function Mt(){const l=Fe.value;J.resetView(l.width,l.height,l.root.y)}function gm(){nt.value=!0,Ie(),be(),e.nextTick(()=>Mt())}function ci(l){ee.layoutMode!==l&&(ee.layoutMode=l,be(),e.nextTick(()=>Mt()))}function ll(){return JSON.stringify(g.value,null,2)}function hm(l){const a=fe(g.value,l);return a?!!(a.note&&a.note.text||a.link&&a.link.url||a.image&&a.image.src||a.richContent&&a.richContent.raw):!1}function al(l){try{const a=JSON.parse(l);return!a.id||!Array.isArray(a.children)?!1:(Qe.reset(),g.value=ct(a),d.value=new Set,p.value=new Set,be(),e.nextTick(()=>Mt()),r("change",g.value),!0)}catch{return!1}}function bm(){const l=document.createElement("input");l.type="file",l.accept="application/json",l.onchange=()=>{var v;const a=(v=l.files)==null?void 0:v[0];if(!a)return;const h=new FileReader;h.onload=()=>{typeof h.result=="string"&&(al(h.result)||alert("导入失败:JSON 格式无效"))},h.readAsText(a)},l.click()}function km(){const l=new Blob([ll()],{type:"application/json"}),a=URL.createObjectURL(l),h=document.createElement("a");h.href=a,h.download=`${g.value.text||"mindmap"}.json`,h.click(),URL.revokeObjectURL(a)}return o({addChild:l=>Be(l),addSibling:l=>Ye(l),removeNode:l=>Zr(l),duplicateNode:l=>wn(l),setNodeText:(l,a)=>am(l,a),moveNode:(l,a,h)=>tl(l,a,h),lineWidthForDepth:ro,endWidthForDepth:Dt,getData:()=>g.value,nodeHasContent:l=>hm(l),getSelectedIds:()=>[...d.value],copyNodes:l=>vn(l),cutNodes:l=>Yr(l),pasteNodes:l=>Xr(l),setData:l=>{Qe.reset(),g.value=ct(l),d.value=new Set,p.value=new Set,be(),Ie(),e.nextTick(()=>Mt())},resetView:()=>Mt(),exportData:ll,importData:al,getMarkdown:()=>Qt(g.value),setMarkdown:(l,a=!0)=>{const h=Jt(l||"");a&&(O.value=!0),W=!a,Qe.reset(),g.value=ct(h),d.value=new Set,p.value=new Set,be(),Ie(),e.nextTick(()=>{W=!1,Mt()}),r("change",g.value)},setBalanced:l=>{nt.value=l},isBalanced:()=>nt.value,balance:()=>gm(),applyNodeStyle:(l,a)=>ie(l,a),getNodeStyle:l=>F(l),applyNodeImage:(l,a)=>q(l,a),applyNodeImageByUrl:(l,a)=>w(l,a),removeNodeImage:l=>U(l),applyNodeLink:(l,a)=>ae(l,a),removeNodeLink:l=>ke(l),applyNodeNote:(l,a)=>Re(l,a),removeNodeNote:l=>Pe(l),applyNodeRichContent:(l,a)=>Te(l,a),undo:()=>li(),redo:()=>ai(),canUndo:()=>Qe.canUndo(),canRedo:()=>Qe.canRedo(),applySettings:l=>{l.autoBalanceOnChange!==void 0&&(ee.autoBalanceOnChange=l.autoBalanceOnChange),l.lineWidthStart!==void 0&&(ee.lineWidthStart=Math.max(.5,Math.min(20,l.lineWidthStart))),l.lineWidthEnd!==void 0&&(ee.lineWidthEnd=Math.max(.3,Math.min(10,l.lineWidthEnd))),l.rainbowBranch!==void 0&&(ee.rainbowBranch=l.rainbowBranch),l.branchPaletteId!==void 0&&(ee.branchPaletteId=l.branchPaletteId),l.customPalettes!==void 0&&(ee.customPalettes=l.customPalettes),l.lineStyle!==void 0&&(ee.lineStyle=l.lineStyle),l.taperedEdge!==void 0&&(ee.taperedEdge=l.taperedEdge),l.showOrderBadge!==void 0&&(ee.showOrderBadge=l.showOrderBadge)},getSettings:()=>({autoBalanceOnChange:ee.autoBalanceOnChange,lineWidthStart:ee.lineWidthStart,lineWidthEnd:ee.lineWidthEnd,rainbowBranch:ee.rainbowBranch,branchPaletteId:ee.branchPaletteId,customPalettes:ee.customPalettes,lineStyle:ee.lineStyle,layoutMode:ee.layoutMode,taperedEdge:ee.taperedEdge,showOrderBadge:ee.showOrderBadge}),setBranchPalette:l=>{if(!l)return;[..._t,...ee.customPalettes].find(h=>h.id===l)&&(ee.branchPaletteId=l)},getBranchPalette:()=>ee.branchPaletteId,getBranchPalettes:()=>[..._t,...ee.customPalettes]}),e.watch(()=>i.data,l=>{g.value=ct(l),be()},{deep:!1}),e.onMounted(()=>{Ie(),e.nextTick(()=>Mt())}),(l,a)=>{var h,v,A,$,j,te,Ne;return e.openBlock(),e.createElementBlock("div",{class:"zm-mindmap",style:e.normalizeStyle({background:et.value.bgColor,fontSize:et.value.fontSize+"px"})},[e.createElementVNode("div",{ref_key:"wrapperRef",ref:s,class:"zm-canvas",onMousedown:um,onContextmenu:se,onWheel:a[26]||(a[26]=(...M)=>e.unref(J).onWheel&&e.unref(J).onWheel(...M)),onMouseenter:a[27]||(a[27]=M=>k.value=!0),onMouseleave:a[28]||(a[28]=M=>k.value=!1),onClick:fm},[e.createElementVNode("div",{class:"zm-svg-layer",style:e.normalizeStyle({left:Fe.value.vbX*e.unref(J).scale.value+e.unref(J).offsetX.value+"px",top:Fe.value.vbY*e.unref(J).scale.value+e.unref(J).offsetY.value+"px",width:Fe.value.vbW*e.unref(J).scale.value+"px",height:Fe.value.vbH*e.unref(J).scale.value+"px"})},[(e.openBlock(),e.createElementBlock("svg",{class:"zm-svg",viewBox:mo.value,preserveAspectRatio:"xMinYMin meet",width:Fe.value.vbW*e.unref(J).scale.value,height:Fe.value.vbH*e.unref(J).scale.value},[e.createElementVNode("g",ss,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fo.value,M=>(e.openBlock(),e.createElementBlock("path",{key:M.key,d:Vt(rl(M.from,"out",M.to.side,M.to),rl(M.to,"in"),ro(M.from.depth),Dt(M.to.depth),32,ee.lineStyle,M.to._dir),fill:so(M.from,M.to),stroke:"none"},null,8,cs))),128))])],8,as))],4),e.unref(J).isMarquee.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-marquee",style:e.normalizeStyle({left:e.unref(J).marquee.x*e.unref(J).scale.value+e.unref(J).offsetX.value+"px",top:e.unref(J).marquee.y*e.unref(J).scale.value+e.unref(J).offsetY.value+"px",width:e.unref(J).marquee.width*e.unref(J).scale.value+"px",height:e.unref(J).marquee.height*e.unref(J).scale.value+"px"})},null,4)):e.createCommentVNode("",!0),y.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"zm-drag-ghost",style:e.normalizeStyle({left:N.value+"px",top:E.value+"px",transform:`scale(${e.unref(J).scale.value})`,transformOrigin:"top left"})},e.toDisplayString(y.value.srcText),5)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"zm-world",style:e.normalizeStyle({transform:`translate(${e.unref(J).offsetX.value}px, ${e.unref(J).offsetY.value}px) scale(${e.unref(J).scale.value})`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ot.value,M=>{var tt,rt;return e.openBlock(),e.createElementBlock("div",{key:M.id,class:e.normalizeClass(["zm-node",{"is-root":M.isRoot,"is-selected":f.value===M.id,"is-selected-secondary":f.value!==M.id&&d.value.has(M.id),"is-editing":c.value===M.id,"has-image":!!M.image,"is-resizing":ze.value===M.id,"is-dragging-source":((tt=y.value)==null?void 0:tt.srcId)===M.id,"is-drop-target":((rt=y.value)==null?void 0:rt.currentTargetId)===M.id}]),"data-node-id":M.id,style:e.normalizeStyle({left:M.x+"px",top:M.y+"px",width:M.width+"px",minWidth:M.width+"px",height:M.height+"px",fontSize:M.fontSize+"px",background:ri(M),color:lt(M),borderColor:At(M),fontWeight:co(M),transform:"translate(-50%, -50%)"}),onClick:ge=>sm(ge,M),onPointerdown:ge=>dm(ge,M),onDblclick:ge=>{ge.stopPropagation(),t.previewMode||$t(M.id)},onContextmenu:ge=>D(ge,M),onMouseenter:ge=>{In(M.id),hn(ge,M)},onMouseleave:ge=>io(M.id)},[M.image?(e.openBlock(),e.createElementBlock("img",{key:0,class:"zm-node-img",src:M.image.src,width:M.image.width,height:M.image.height,alt:M.text,draggable:"false"},null,8,us)):e.createCommentVNode("",!0),M.richContent&&(M.richContent.kind==="code"||M.richContent.kind==="table")&&c.value!==M.id?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["zm-rich zm-rich-above",{"zm-rich-no-overflow":M.richContent.kind==="table"||M.richContent.kind==="code"}]),onClick:a[1]||(a[1]=e.withModifiers(()=>{},["stop"])),onDblclick:e.withModifiers(ge=>Pt(M.id),["stop"]),onMousedown:a[2]||(a[2]=e.withModifiers(()=>{},["stop"]))},[x.value===M.id?e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:0,"onUpdate:modelValue":a[0]||(a[0]=ge=>R.value=ge),class:"zm-rich-edit",spellcheck:"false",onBlur:X,onKeydown:I},null,544)),[[e.vModelText,R.value]]):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[M.richContent.kind==="code"?(e.openBlock(),e.createElementBlock("pre",ms,[e.createElementVNode("code",{innerHTML:e.unref(Io)(e.unref(zo)(M.richContent.raw),e.unref(on)(M.richContent.raw))},null,8,ps)])):M.richContent.kind==="table"?(e.openBlock(),e.createElementBlock("table",gs,[e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ye(M.id,e.unref(dr)(M.richContent.raw)),(ge,bt)=>(e.openBlock(),e.createElementBlock("tr",{key:bt},[bt===0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(ge,(Nn,kt)=>{var Ln,Dn,Ct,bo,Ft;return e.openBlock(),e.createElementBlock("th",{key:`h${kt}`,class:e.normalizeClass(["zm-rich-table-sort",{"is-sorted":((Ln=S.value.get(M.id))==null?void 0:Ln.col)===kt,"is-asc":((Dn=S.value.get(M.id))==null?void 0:Dn.col)===kt&&((Ct=S.value.get(M.id))==null?void 0:Ct.dir)==="asc","is-desc":((bo=S.value.get(M.id))==null?void 0:bo.col)===kt&&((Ft=S.value.get(M.id))==null?void 0:Ft.dir)==="desc"}]),onClick:e.withModifiers(ko=>G(M.id,kt),["stop"])},[e.createElementVNode("span",null,e.toDisplayString(Nn),1),e.createElementVNode("span",bs,e.toDisplayString(ue(M.id,kt)),1)],10,hs)}),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(ge,(Nn,kt)=>(e.openBlock(),e.createElementBlock("td",{key:`c${kt}`},e.toDisplayString(Nn),1))),128))]))),128))])])):e.createCommentVNode("",!0)],64))],42,fs)):e.createCommentVNode("",!0),c.value!==M.id?(e.openBlock(),e.createElementBlock("span",ks,[e.createElementVNode("span",ys,e.toDisplayString(M.text),1),M.link&&!c.value?(e.openBlock(),e.createElementBlock("a",{key:0,class:"zm-node-link",href:M.link.url,target:"_blank",rel:"noopener noreferrer",title:`打开链接:${M.link.url}`,onClick:a[3]||(a[3]=e.withModifiers(()=>{},["stop"])),onMousedown:a[4]||(a[4]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(xe,{name:"link",size:11,stroke:2})],40,Es)):e.createCommentVNode("",!0),M.note&&!c.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-node-note-btn",type:"button",title:Z(M.note.text),onClick:e.withModifiers(ge=>H(M.id),["stop"]),onMousedown:a[5]||(a[5]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(xe,{name:"note",size:11,stroke:2})],40,xs)):e.createCommentVNode("",!0)])):e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:3,class:"zm-input","onUpdate:modelValue":a[6]||(a[6]=ge=>u.value=ge),autofocus:"",onBlur:a[7]||(a[7]=ge=>En()),onKeydown:[a[8]||(a[8]=e.withKeys(e.withModifiers(ge=>En(),["exact"]),["enter"])),a[9]||(a[9]=e.withKeys(e.withModifiers(ge=>En(),["prevent"]),["tab"])),e.withKeys(xn,["esc"]),Ce],onMousedown:a[10]||(a[10]=e.withModifiers(()=>{},["stop"])),onClick:a[11]||(a[11]=e.withModifiers(()=>{},["stop"]))},null,544)),[[e.vModelText,u.value]]),ne.value?(e.openBlock(),e.createElementBlock("span",{key:4,class:"zm-order-badge",title:`数据顺序:第 ${il(M.id)+1} 个`},e.toDisplayString(il(M.id)+1),9,ws)):e.createCommentVNode("",!0),ol(M.id)&&si(M.id)>0?(e.openBlock(),e.createElementBlock("span",{key:5,class:e.normalizeClass(["zm-collapse-badge",{"is-on-left":M.side===-1}]),style:e.normalizeStyle({background:Tt.value.get(M.id)??"#64748b"}),title:`展开 ${si(M.id)} 个子节点`,onMousedown:a[12]||(a[12]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(ge=>Jr(M.id),["stop"])},e.toDisplayString(si(M.id)),47,Ns)):e.createCommentVNode("",!0),pm(M)&&!ol(M.id)?(e.openBlock(),e.createElementBlock("button",{key:6,class:e.normalizeClass(["zm-btn zm-collapse",{"is-on-left":M.side===-1}]),style:e.normalizeStyle({color:Tt.value.get(M.id)??"#64748b",borderColor:Tt.value.get(M.id)??"#64748b"}),title:"折叠",onMousedown:a[13]||(a[13]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(ge=>Jr(M.id),["stop"])},[e.createVNode(xe,{name:"minus",size:10,stroke:2.4})],46,Ss)):e.createCommentVNode("",!0),M.image&&f.value===M.id&&c.value!==M.id?(e.openBlock(),e.createElementBlock("span",{key:7,class:"zm-img-resize-handle",title:"拖动调整图片大小",onMousedown:e.withModifiers(ge=>Ue(ge,M),["stop"])},null,40,Ts)):e.createCommentVNode("",!0),M.image&&f.value===M.id&&c.value!==M.id?(e.openBlock(),e.createElementBlock("button",{key:8,class:"zm-img-remove-btn",title:"移除图片",onMousedown:a[14]||(a[14]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(ge=>U(M.id),["stop"])},[e.createVNode(xe,{name:"x",size:9,stroke:2.2})],40,Cs)):e.createCommentVNode("",!0)],46,ds)}),128))],4),C.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["zm-tooltip",{"is-below":!C.value.above}]),style:e.normalizeStyle({left:C.value.x+"px",top:C.value.y+"px"})},e.toDisplayString(C.value.text),7)):e.createCommentVNode("",!0),B.value?(e.openBlock(),e.createBlock(ql,{key:3,x:B.value.x,y:B.value.y,container:s.value,"has-image":!!((h=e.unref(fe)(g.value,B.value.nodeId))!=null&&h.image),"has-link":!!((v=e.unref(fe)(g.value,B.value.nodeId))!=null&&v.link),"has-note":!!((A=e.unref(fe)(g.value,B.value.nodeId))!=null&&A.note),"has-code":((j=($=e.unref(fe)(g.value,B.value.nodeId))==null?void 0:$.richContent)==null?void 0:j.kind)==="code","has-table":((Ne=(te=e.unref(fe)(g.value,B.value.nodeId))==null?void 0:te.richContent)==null?void 0:Ne.kind)==="table",onPickImage:mn,onRemoveImage:we,onSetLink:Ot,onRemoveLink:Q,onEditNote:Nt,onRemoveNote:Me,onAddCode:pt,onEditCode:pt,onRemoveCode:qe,onAddTable:gt,onEditTable:gt,onRemoveTable:St,onClose:T},null,8,["x","y","container","has-image","has-link","has-note","has-code","has-table"])):e.createCommentVNode("",!0),z.value?(e.openBlock(),e.createBlock(Yl,{key:4,x:z.value.x,y:z.value.y,container:s.value,onOpenSettings:De,onOpenData:Ke,onOpenImport:We,onClose:ce},null,8,["x","y","container"])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(oe.value),title:i.previewMode?"退出预览模式":"进入预览模式",onClick:a[15]||(a[15]=M=>r("canvas-toggle-preview"))},[e.createVNode(xe,{name:i.previewMode?"eye-off":"eye",size:16},null,8,["name"])],10,_s),e.createElementVNode("button",{class:e.normalizeClass(re.value),title:"显示大纲视图",onClick:a[16]||(a[16]=M=>r("canvas-outline"))},[e.createVNode(xe,{name:"outline",size:16})],2),e.createElementVNode("div",{class:e.normalizeClass(["zm-toolbar",{"is-preview-only":i.previewMode,"is-hovered":k.value}])},[e.createElementVNode("span",As,e.toDisplayString(Math.round(e.unref(J).scale.value*100))+"%",1),e.createElementVNode("button",{class:"zm-tb-btn",title:"放大",onClick:a[17]||(a[17]=(...M)=>e.unref(J).zoomIn&&e.unref(J).zoomIn(...M))},[e.createVNode(xe,{name:"zoom-in"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"缩小",onClick:a[18]||(a[18]=(...M)=>e.unref(J).zoomOut&&e.unref(J).zoomOut(...M))},[e.createVNode(xe,{name:"zoom-out"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"重置视图",onClick:Mt},[e.createVNode(xe,{name:"reset"})]),a[32]||(a[32]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"全部收起",onClick:rm},[e.createVNode(xe,{name:"collapse-all"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"展开一级",onClick:a[19]||(a[19]=M=>el(1))},[e.createVNode(xe,{name:"expand-level-1"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"展开二级",onClick:a[20]||(a[20]=M=>el(2))},[e.createVNode(xe,{name:"expand-level-2"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"全部展开",onClick:lm},[e.createVNode(xe,{name:"expand-all"})]),a[33]||(a[33]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"导出 JSON",onClick:km},[e.createVNode(xe,{name:"export"})]),i.previewMode?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[a[29]||(a[29]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"添加子节点 (Tab)",onClick:a[21]||(a[21]=M=>f.value&&Be(f.value))},[e.createElementVNode("img",{src:e.unref(mi),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,Ms)]),e.createElementVNode("button",{class:"zm-tb-btn",title:"添加同级 (Enter)",onClick:a[22]||(a[22]=M=>f.value&&Ye(f.value))},[e.createElementVNode("img",{src:e.unref(fi),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,Rs)]),a[30]||(a[30]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:ee.layoutMode==="mindmap"}]),title:"思维导图布局 (中心辐射)",onClick:a[23]||(a[23]=M=>ci("mindmap"))},[e.createVNode(xe,{name:"mindmap"})],2),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:ee.layoutMode==="tree"}]),title:"树形布局 (向右展开)",onClick:a[24]||(a[24]=M=>ci("tree"))},[e.createVNode(xe,{name:"tree"})],2),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:ee.layoutMode==="org"}]),title:"组织结构布局 (向下展开)",onClick:a[25]||(a[25]=M=>ci("org"))},[e.createVNode(xe,{name:"org"})],2),a[31]||(a[31]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"导入 JSON",onClick:bm},[e.createVNode(xe,{name:"import"})])],64))],2)],544)],4)}}}),Bs={class:"zm-outline-root"},zs={class:"zm-outline-actions"},Is={width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Os={key:0,x:"9",y:"9",width:"13",height:"13",rx:"2"},vs={key:1,d:"M5 12 L10 17 L19 7"},Ls={class:"zm-outline"},Ds=["onClick","onDblclick","onDragstart","onDragover","onDragleave","onDrop"],Vs=["title","onClick"],$s={width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round"},Ps={key:0,points:"6 9 12 15 18 9"},Fs={key:1,points:"9 6 15 12 9 18"},Us={key:1,class:"zm-outline-dot"},Hs={class:"zm-outline-index"},Ws={key:3,class:"zm-outline-text"},Gs=["onClick"],js=["src"],Ks=["onClick"],qs=["src"],Ys=["title","onClick"],Xs={width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Zs={key:0,x:"9",y:"9",width:"13",height:"13",rx:"2"},Js={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}},emits:["select","toggleCollapse","edit","addChild","addSibling","move"],setup(t,{emit:o}){const n=t,i=o,r=e.computed(()=>{const F=[],q=(U,w,P)=>{const V=U.children.length>0,Y=n.collapsedIds.has(U.id);F.push({id:U.id,text:U.text||"(无标题)",depth:w,siblingIndex:P,hasChildren:V,collapsed:Y,node:U}),V&&!Y&&U.children.forEach((ae,ke)=>q(ae,w+1,ke))};return q(n.data,0,0),F}),s=e.ref(null),c=e.ref("");let u=null;function d(F){n.readonly||(s.value=F.id,c.value=F.text,e.nextTick(()=>{u=document.querySelector(".zm-outline-input"),u==null||u.focus(),u==null||u.select()}))}function f(){s.value!=null&&(i("edit",{id:s.value,text:c.value.trim()||"(无标题)"}),p())}function p(){s.value=null,c.value="",u=null}function k(F){F.key==="Enter"?(F.preventDefault(),f()):F.key==="Escape"&&(F.preventDefault(),p())}e.onBeforeUnmount(p);const y=e.ref(null),N=e.ref(null),E=e.ref(null);function L(F,q){if(n.readonly){F.preventDefault();return}y.value={id:q.id,text:q.text},F.dataTransfer&&(F.dataTransfer.effectAllowed="move",F.dataTransfer.setData("text/plain",q.id))}function C(){y.value=null,N.value=null,E.value=null}function x(F,q){if(!y.value)return;F.preventDefault(),F.dataTransfer&&(F.dataTransfer.dropEffect="move");const U=g(F);N.value=q.id,E.value=U}function R(F){N.value===F.id&&(N.value=null,E.value=null)}function S(F,q){F.preventDefault();const U=y.value;if(!U)return;const w=g(F);U.id!==q.id&&i("move",{srcId:U.id,targetId:q.id,position:w}),C()}function g(F,q){const w=F.currentTarget.getBoundingClientRect(),P=F.clientY-w.top,V=w.height;return P<V*.3?"before":P>V*.7?"after":"child"}const _=e.ref(null);let b=null;async function O(F){try{return await navigator.clipboard.writeText(F),!0}catch{const q=document.createElement("textarea");q.value=F,document.body.appendChild(q),q.select();let U=!1;try{U=document.execCommand("copy")}finally{document.body.removeChild(q)}return U}}async function W(F,q,U){F.stopPropagation(),await O(q)&&(_.value=U,b&&clearTimeout(b),b=setTimeout(()=>_.value=null,1200))}const ne=e.computed(()=>{const F=[],q=(U,w)=>{const P=" ".repeat(w),V=w===0?"":"- ";F.push(P+V+(U.text||""));for(const Y of U.children)q(Y,w+1)};return q(n.data,0),F.join(`
23
- `)}),pe=e.ref(!1);let K=null;async function ie(){await O(ne.value)&&(pe.value=!0,K&&clearTimeout(K),K=setTimeout(()=>pe.value=!1,1200))}return(F,q)=>(e.openBlock(),e.createElementBlock("div",Bs,[e.createElementVNode("div",zs,[e.createElementVNode("button",{class:e.normalizeClass(["zm-outline-action-btn",{"is-success":pe.value}]),title:"复制完整大纲为纯文本",onClick:ie},[(e.openBlock(),e.createElementBlock("svg",Is,[pe.value?(e.openBlock(),e.createElementBlock("path",vs)):(e.openBlock(),e.createElementBlock("rect",Os)),q[2]||(q[2]=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(pe.value?"已复制":"复制大纲"),1)],2)]),e.createElementVNode("ul",Ls,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,U=>(e.openBlock(),e.createElementBlock("li",{key:U.id,class:e.normalizeClass(["zm-outline-row",{"is-selected":U.id===t.selectedId,"is-root":U.depth===0,"is-editing":s.value===U.id,"is-drag-over-before":N.value===U.id&&E.value==="before","is-drag-over-after":N.value===U.id&&E.value==="after","is-drag-over-child":N.value===U.id&&E.value==="child"}]),style:e.normalizeStyle({paddingLeft:12+U.depth*16+"px"}),draggable:"true",onClick:w=>i("select",U.node),onDblclick:w=>d(U),onDragstart:w=>L(w,U),onDragend:C,onDragover:w=>x(w,U),onDragleave:()=>R(U),onDrop:w=>S(w,U)},[U.hasChildren?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-outline-toggle",title:U.collapsed?"展开":"折叠",onClick:e.withModifiers(w=>i("toggleCollapse",U.id),["stop"])},[(e.openBlock(),e.createElementBlock("svg",$s,[U.collapsed?(e.openBlock(),e.createElementBlock("polyline",Fs)):(e.openBlock(),e.createElementBlock("polyline",Ps))]))],8,Vs)):(e.openBlock(),e.createElementBlock("span",Us)),e.createElementVNode("span",Hs,e.toDisplayString(U.siblingIndex+1)+".",1),s.value===U.id?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,"onUpdate:modelValue":q[0]||(q[0]=w=>c.value=w),class:"zm-outline-input",onBlur:f,onKeydown:k,onClick:q[1]||(q[1]=e.withModifiers(()=>{},["stop"]))},null,544)),[[e.vModelText,c.value]]):(e.openBlock(),e.createElementBlock("span",Ws,e.toDisplayString(U.text),1)),n.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:4,class:"zm-outline-row-action",title:"添加同级",onClick:e.withModifiers(w=>i("addSibling",U.id),["stop"])},[e.createElementVNode("img",{src:e.unref(fi),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,js)],8,Gs)),n.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:5,class:"zm-outline-row-action",title:"添加子节点",onClick:e.withModifiers(w=>i("addChild",U.id),["stop"])},[e.createElementVNode("img",{src:e.unref(mi),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,qs)],8,Ks)),e.createElementVNode("button",{class:e.normalizeClass(["zm-outline-row-copy",{"is-success":_.value===U.id}]),title:_.value===U.id?"已复制":"复制节点文本",onClick:w=>W(w,U.text,U.id)},[(e.openBlock(),e.createElementBlock("svg",Xs,[_.value!==U.id?(e.openBlock(),e.createElementBlock("rect",Zs)):(e.openBlock(),e.createElementBlock("path",Js)),q[3]||(q[3]=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,Ys)],46,Ds))),128))])]))}}),Qs=["aria-hidden"],ec=["aria-hidden"],tc={key:0,class:"zm-drawer-header"},nc={key:0,class:"zm-drawer-title"},oc={class:"zm-drawer-body"},ic=["aria-hidden"],rc={key:0,class:"zm-drawer-header"},lc={key:0,class:"zm-drawer-title"},ac={class:"zm-drawer-body"},ln=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 r(){n("update:open",!1)}return(s,c)=>t.scope==="canvas"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.Transition,{name:"zm-fade"},{default:e.withCtx(()=>[t.open?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-drawer-canvas-backdrop","aria-hidden":!t.open,onClick:c[0]||(c[0]=u=>t.closeOnBackdrop&&r())},null,8,Qs)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:t.side==="left"?"zm-slide-left":"zm-slide-right"},{default:e.withCtx(()=>[t.open?(e.openBlock(),e.createElementBlock("aside",{key:0,class:e.normalizeClass(["zm-drawer zm-drawer--canvas",["zm-drawer--"+t.side]]),style:e.normalizeStyle({width:t.width+"px"}),"aria-hidden":!t.open},[t.title||s.$slots.header?(e.openBlock(),e.createElementBlock("div",tc,[t.title?(e.openBlock(),e.createElementBlock("h3",nc,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.renderSlot(s.$slots,"header"),t.closable?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-drawer-close",title:"关闭",onClick:i},[...c[1]||(c[1]=[e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},[e.createElementVNode("path",{d:"M6 6 L18 18 M18 6 L6 18"})],-1)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",oc,[e.renderSlot(s.$slots,"default")])],14,ec)):e.createCommentVNode("",!0)]),_:3},8,["name"])],64)):(e.openBlock(),e.createBlock(e.Transition,{key:1,name:"zm-drawer"},{default:e.withCtx(()=>[t.open?(e.openBlock(),e.createElementBlock("aside",{key:0,class:e.normalizeClass(["zm-drawer",["zm-drawer--"+t.side,{"is-open":t.open}]]),style:e.normalizeStyle({width:t.width+"px"}),"aria-hidden":!t.open},[t.title||s.$slots.header?(e.openBlock(),e.createElementBlock("div",rc,[t.title?(e.openBlock(),e.createElementBlock("h3",lc,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.renderSlot(s.$slots,"header"),t.closable?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-drawer-close",title:"关闭",onClick:i},[...c[2]||(c[2]=[e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},[e.createElementVNode("path",{d:"M6 6 L18 18 M18 6 L6 18"})],-1)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",ac,[e.renderSlot(s.$slots,"default")])],14,ic)):e.createCommentVNode("",!0)]),_:3}))}}),sc={key:0,class:"zm-jtv-root"},cc={key:0,class:"zm-jtv-key"},dc={key:1,class:"zm-jtv-colon"},uc={key:2,class:"zm-jtv-key zm-jtv-bracket"},fc={key:3,class:"zm-jtv-size"},mc={key:4,class:"zm-jtv-bracket"},pc={key:5,class:"zm-jtv-brace"},gc={key:0,class:"zm-jtv-children"},hc={class:"zm-jtv-key"},bc={key:0,class:"zm-jtv-key"},kc=["src","alt"],yc=["href"],Ec=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"),r=e.computed(()=>n.value==="array");e.computed(()=>!i.value&&!r.value);const s=e.computed(()=>{if(r.value)return`Array(${o.value.length})`;if(i.value){const R=o.value,S=Object.keys(R);return`Object(${S.length} ${S.length===1?"key":"keys"})`}return""}),c=e.computed(()=>r.value?o.value.map((R,S)=>({key:String(S),value:R})):i.value?Object.entries(o.value).map(([R,S])=>({key:R,value:S})):[]),u=e.computed(()=>o.isRoot?"<root>":o.path),d=e.computed(()=>o.collapsedPaths.has(u.value));function f(R,S,g){R!=="<root>"&&(g<2||S===null||typeof S!="object"||o.collapsedPaths.has(R)||o.collapsedPaths.add(R))}o.isRoot||f(u.value,o.value,o.depth);function p(){d.value?o.collapsedPaths.delete(u.value):o.collapsedPaths.add(u.value)}function k(R){return u.value===""?R:`${u.value}.${R}`}function y(R){if(!o.query)return!0;const S=o.query.toLowerCase();return typeof R=="string"?R.toLowerCase().includes(S):R===null?"null".includes(S):String(R).toLowerCase().includes(S)}function N(R){return o.query?R.toLowerCase().includes(o.query.toLowerCase()):!0}function E(R,S){return!o.query||N(R)?!0:S===null||typeof S!="object"?y(S):!0}function L(R){return R===null?"null":typeof R=="string"?R.length>80?`"${R.slice(0,80)}..."`:`"${R}"`:typeof R=="boolean"?R?"true":"false":typeof R=="number"?String(R):typeof R>"u"?"undefined":JSON.stringify(R)}function C(R){if(typeof R!="string")return!1;const S=R.trim();return!!(S.startsWith("data:image/")||/^https?:\/\/.+\.(png|jpe?g|gif|webp|svg|bmp|ico)(\?.*)?$/i.test(S)||/^https?:\/\/.+/i.test(S)&&/\/[^/]+\.(png|jpe?g|gif|webp|svg|bmp|ico)(\?.*)?$/i.test(S))}function x(R){if(!o.query)return null;const S=R.toLowerCase().indexOf(o.query.toLowerCase());return S<0?null:{before:R.slice(0,S),match:R.slice(S,S+o.query.length),after:R.slice(S+o.query.length)}}return(R,S)=>{var _,b,O,W,ne,pe;const g=e.resolveComponent("JsonTreeViewer",!0);return t.isRoot?(e.openBlock(),e.createElementBlock("div",sc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,K=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:K.key,class:"zm-jtv-row"},[e.createVNode(g,{"key-name":K.key,value:K.value,path:k(K.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,E(K.key,K.value)]])),128))])):i.value||r.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:p},[e.createElementVNode("span",{class:e.normalizeClass(["zm-jtv-toggle",{"is-leaf":!1}])},e.toDisplayString(d.value?"▶":"▼"),1),r.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",cc,e.toDisplayString(t.keyName),1)),r.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",dc,":")),r.value?(e.openBlock(),e.createElementBlock("span",uc,"[")):e.createCommentVNode("",!0),d.value?(e.openBlock(),e.createElementBlock("span",fc,e.toDisplayString(s.value),1)):e.createCommentVNode("",!0),d.value&&r.value?(e.openBlock(),e.createElementBlock("span",mc,"]")):e.createCommentVNode("",!0),d.value&&i.value?(e.openBlock(),e.createElementBlock("span",pc,"}")):e.createCommentVNode("",!0)],4),d.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",gc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,K=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:K.key,class:"zm-jtv-row"},[e.createVNode(g,{"key-name":K.key,value:K.value,path:k(K.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,E(K.key,K.value)]])),128))])),!d.value&&r.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&&!r.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"})},[S[2]||(S[2]=e.createElementVNode("span",{class:"zm-jtv-toggle is-leaf"},"·",-1)),e.createElementVNode("span",hc,e.toDisplayString(t.keyName),1),S[3]||(S[3]=e.createElementVNode("span",{class:"zm-jtv-colon"},":",-1)),N(t.keyName)&&x(t.keyName)?(e.openBlock(),e.createElementBlock("span",bc,[e.createElementVNode("span",null,e.toDisplayString((_=x(t.keyName))==null?void 0:_.before),1),e.createElementVNode("mark",null,e.toDisplayString((b=x(t.keyName))==null?void 0:b.match),1),e.createElementVNode("span",null,e.toDisplayString((O=x(t.keyName))==null?void 0:O.after),1)])):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(["zm-jtv-value",`zm-jtv-${n.value}`])},[x(L(t.value))?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("span",null,e.toDisplayString((W=x(L(t.value)))==null?void 0:W.before),1),e.createElementVNode("mark",null,e.toDisplayString((ne=x(L(t.value)))==null?void 0:ne.match),1),e.createElementVNode("span",null,e.toDisplayString((pe=x(L(t.value)))==null?void 0:pe.after),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(L(t.value)),1)],64))],2),C(t.value)?(e.openBlock(),e.createElementBlock("span",{key:1,class:"zm-jtv-thumb-wrap",onClick:S[1]||(S[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,kc),e.createElementVNode("a",{class:"zm-jtv-thumb-link",href:String(t.value),target:"_blank",rel:"noopener noreferrer",onClick:S[0]||(S[0]=e.withModifiers(()=>{},["stop"]))},"open",8,yc)])):e.createCommentVNode("",!0)],4))}}}),xc={class:"zm-data-panel"},wc={class:"zm-data-header"},Nc={class:"zm-data-title"},Sc={class:"zm-data-title-meta"},Tc={class:"zm-data-toolbar"},Cc=["title"],_c={key:0,width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Ac={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"},Mc={key:0,class:"zm-data-paste"},Rc={class:"zm-data-tabs"},Bc=["placeholder"],zc={key:0,class:"zm-data-error"},Ic={class:"zm-data-paste-actions"},Oc=["disabled"],vc={class:"zm-data-tree"},vo=e.defineComponent({__name:"DataPanel",props:{data:{},pendingMode:{default:null}},emits:["import","consumed-mode"],setup(t,{emit:o}){const n=t,i=o,r=e.computed(()=>JSON.stringify(n.data,null,2)),s=e.ref(""),c=e.ref(null),u=e.ref(!1),d=e.ref("json"),f=e.ref("idle"),p=e.ref(new Set),k=e.ref("");e.watch(()=>n.pendingMode,S=>{S&&(u.value=!0,d.value=S,i("consumed-mode"))},{immediate:!0});async function y(){try{await navigator.clipboard.writeText(r.value),f.value="copied",setTimeout(()=>f.value="idle",1500)}catch{const S=document.createElement("textarea");S.value=r.value,document.body.appendChild(S),S.select();try{document.execCommand("copy"),f.value="copied",setTimeout(()=>f.value="idle",1500)}finally{document.body.removeChild(S)}}}function N(){const S=new Blob([r.value],{type:"application/json"}),g=URL.createObjectURL(S),_=document.createElement("a");_.href=g,_.download=`${n.data.text||"mindmap"}.json`,_.click(),URL.revokeObjectURL(g)}function E(){c.value=null;const S=s.value.trim();if(S){if(d.value==="markdown"||d.value==="txt"){try{const g=Jt(S);i("import",g),s.value="",u.value=!1}catch(g){c.value=(d.value==="txt"?"TXT 解析失败:":"Markdown 解析失败:")+g.message}return}try{const g=JSON.parse(S);if(!g.id||!Array.isArray(g.children)){c.value="JSON 缺少 id 或 children 字段";return}i("import",g),s.value="",u.value=!1}catch(g){c.value="JSON 解析失败:"+g.message}}}function L(S){return 1+S.children.reduce((g,_)=>g+L(_),0)}const C=e.computed(()=>L(n.data)),x=e.computed(()=>r.value.length);function R(){const S=document.createElement("input");S.type="file",S.accept="application/json",S.onchange=()=>{var b;const g=(b=S.files)==null?void 0:b[0];if(!g)return;const _=new FileReader;_.onload=()=>{typeof _.result=="string"&&(s.value=_.result,E())},_.readAsText(g)},S.click()}return(S,g)=>(e.openBlock(),e.createElementBlock("div",xc,[e.createElementVNode("div",wc,[e.createElementVNode("div",Nc,[g[8]||(g[8]=e.createElementVNode("span",{class:"zm-data-title-text"},"数据 JSON",-1)),e.createElementVNode("span",Sc,e.toDisplayString(C.value)+" 节点 · "+e.toDisplayString(x.value)+" chars",1)])]),e.createElementVNode("div",Tc,[e.createElementVNode("button",{class:e.normalizeClass(["zm-data-btn is-icon",{"is-success":f.value==="copied"}]),title:f.value==="copied"?"已复制":"复制 JSON 到剪贴板",onClick:y},[f.value==="idle"?(e.openBlock(),e.createElementBlock("svg",_c,[...g[9]||(g[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",Ac,[...g[10]||(g[10]=[e.createElementVNode("polyline",{points:"5 12 10 17 19 7"},null,-1)])])),g[11]||(g[11]=e.createElementVNode("span",{class:"zm-data-btn-label"},"复制",-1))],10,Cc),e.createElementVNode("button",{class:"zm-data-btn is-icon",title:"导出为 JSON 文件",onClick:N},[...g[12]||(g[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:R},[...g[13]||(g[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:g[0]||(g[0]=_=>u.value=!u.value)},[...g[14]||(g[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),g[16]||(g[16]=e.createElementVNode("div",{class:"zm-data-toolbar-spacer"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["zm-data-search",{"is-active":k.value.length>0}])},[g[15]||(g[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":g[1]||(g[1]=_=>k.value=_),type:"text",placeholder:"过滤 (键 / 值)",spellcheck:"false"},null,512),[[e.vModelText,k.value]]),k.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-data-search-clear",title:"清空过滤",onClick:g[2]||(g[2]=_=>k.value="")},"×")):e.createCommentVNode("",!0)],2)]),u.value?(e.openBlock(),e.createElementBlock("div",Mc,[e.createElementVNode("div",Rc,[e.createElementVNode("button",{class:e.normalizeClass(["zm-data-tab",{"is-active":d.value==="json"}]),onClick:g[3]||(g[3]=_=>d.value="json")},"JSON",2),e.createElementVNode("button",{class:e.normalizeClass(["zm-data-tab",{"is-active":d.value==="markdown"}]),onClick:g[4]||(g[4]=_=>d.value="markdown")},"Markdown",2)]),e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":g[5]||(g[5]=_=>s.value=_),placeholder:d.value==="json"?"paste a JSON tree to replace current data":"paste markdown - # / ## / ### become nodes",spellcheck:"false"},null,8,Bc),[[e.vModelText,s.value]]),c.value?(e.openBlock(),e.createElementBlock("div",zc,e.toDisplayString(c.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Ic,[e.createElementVNode("button",{class:"zm-data-btn is-primary",disabled:!s.value,onClick:E},"应用",8,Oc),e.createElementVNode("button",{class:"zm-data-btn",onClick:g[6]||(g[6]=_=>{s.value="",c.value=null})},"清空"),e.createElementVNode("button",{class:"zm-data-btn",onClick:g[7]||(g[7]=_=>u.value=!1)},"关闭")])])):e.createCommentVNode("",!0),e.createElementVNode("div",vc,[e.createVNode(Ec,{value:t.data,query:k.value,"collapsed-paths":p.value},null,8,["value","query","collapsed-paths"])]),g[17]||(g[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))]))}}),Lc={class:"zm-md-panel"},Dc={key:0,class:"zm-md-error"},Vc={class:"zm-md-split"},$c={class:"zm-md-edit"},Pc={class:"zm-md-preview"},Fc={class:"zm-md-preview-body"},Uc={class:"zm-md-footer"},Hc=["disabled"],Wc=`# flow-mindmap 思维导图
7
+ `);for(const r of t.children)n+=On(r,o+1);return n}function ja(t){var g,b;const o=t.split(/\r?\n/),n=[];let r=0;const l=/^(#{1,6})\s+(.+?)\s*#*\s*$/,s=/^(`{3,}|~{3,})\s*(\S+)?\s*$/,c=/^\s*\|?\s*(:?-+:?\s*\|\s*)+(:?-+:?)(\s*\|)?\s*$/,u=/^(\s*)[-*+]\s+(.*)$/,d=/^(\s*)\d+\.\s+(.*)$/;for(;r<o.length;){const w=o[r],N=w.match(s);if(N){const k=N[1][0],m=N[2]||"",B=[w];for(r++;r<o.length;){const K=o[r].match(s);if(K&&K[1][0]===k){B.push(o[r]),r++;break}B.push(o[r]),r++}const x=B.slice(1,-1).join(`
8
+ `).trim();n.push({kind:"code",text:((g=x.split(`
9
+ `)[0])==null?void 0:g.slice(0,80))||"(空代码块)",raw:B.join(`
10
+ `),lang:m});continue}const $=w.match(l);if($){n.push({kind:"heading",level:$[1].length,text:$[2].trim(),raw:w}),r++;continue}if(/^\s*\|/.test(w)){const k=[];let m=r,B=!1;for(;m<o.length&&/^\s*\|/.test(o[m]);)k.push(o[m]),c.test(o[m])&&(B=!0),m++;if(B&&k.length>=2){n.push({kind:"table",text:((b=k[0].replace(/^\s*\|/,"").replace(/\|\s*$/,"").split("|")[0])==null?void 0:b.trim())||"表格",raw:k.join(`
11
+ `)}),r=m;continue}}const M=w.match(u),P=w.match(d);if(M||P){let k=r;for(;k<o.length;){const m=o[k].match(u),B=o[k].match(d);if(!(m||B))break;const x=o[k].replace(/^\s*[-*+]\s+/,"").replace(/^\s*\d+\.\s+/,"").trim();x.length>0&&n.push({kind:"list",text:x.slice(0,80)||"(列表项)",raw:o[k]}),k++}r=k;continue}if(w.trim()===""){r++;continue}const I=[w];let C=r+1;for(;C<o.length;){const k=o[C];if(k.trim()===""||l.test(k)||s.test(k)||u.test(k)||d.test(k)||/^\s*\|/.test(k))break;I.push(k),C++}const E=I.join(" ").trim();n.push({kind:"paragraph",text:E.slice(0,80)||"(空段落)",raw:I.join(`
12
+ `)}),r=C}return n}function Ka(t,o="导入的导图"){const n=ja(t||""),r={id:Gt(),text:o,children:[]},l=[r],s=[0];let c=!1;function u(d){if(d.kind==="heading"){const b=d.level;for(;l.length>1&&s[s.length-1]>=b;)l.pop(),s.pop();if(!c&&b===1){c=!0,r.text=d.text,s[0]=1;return}const w={id:Gt(),text:d.text,children:[]};l[l.length-1].children.push(w),l.push(w),s.push(b);return}const g={id:Gt(),text:d.text,children:[],richContent:{kind:d.kind,raw:d.raw,lang:d.lang}};l[l.length-1].children.push(g)}for(const d of n)u(d);return r}function Ya(t){return t.richContent?t.richContent.raw+`
13
+ `:""}function qa(t){const o=t.minScale??.2,n=t.maxScale??1/0,r=t.step??1.2,l=e.ref(1),s=e.ref(0),c=e.ref(0),u=e.ref(!1),d=e.ref(!1),g=e.reactive({x:0,y:0,ox:0,oy:0}),b=e.ref(!1),w=e.reactive({x:0,y:0}),N=e.reactive({x:0,y:0,width:0,height:0}),$=e.ref(0);let M=null;function P(q){M=q}function I(q){q.preventDefault();const Q=t.getContainer();if(!Q)return;const ie=-q.deltaY*.001,z=Math.min(n,Math.max(o,l.value*(1+ie))),A=Q.getBoundingClientRect(),F=q.clientX-A.left,U=q.clientY-A.top,G=(F-s.value)/l.value,le=(U-c.value)/l.value;l.value=z,s.value=F-G*z,c.value=U-le*z}function C(){l.value=Math.min(n,l.value*r)}function E(){l.value=Math.max(o,l.value/r)}function k(q){var ie;q.target.closest(".zm-node, .zm-toolbar, button, input, textarea")||(u.value=!0,d.value=!1,g.x=q.clientX,g.y=q.clientY,g.ox=s.value,g.oy=c.value,window.addEventListener("mousemove",m),window.addEventListener("mouseup",B),(ie=q.preventDefault)==null||ie.call(q))}function m(q){if(!u.value)return;const Q=q.clientX-g.x,ie=q.clientY-g.y;(Math.abs(Q)>3||Math.abs(ie)>3)&&(d.value=!0),s.value=g.ox+Q,c.value=g.oy+ie}function B(){u.value=!1,window.removeEventListener("mousemove",m),window.removeEventListener("mouseup",B)}function x(q,Q,ie){b.value=!0,w.x=q,w.y=Q,N.x=q,N.y=Q,N.width=0,N.height=0,N.shiftKey=!!(ie!=null&&ie.shift),$.value++,window.addEventListener("mousemove",ee),window.addEventListener("mouseup",Y)}function K(q,Q){if(!b.value)return;const ie=Math.min(w.x,q),z=Math.min(w.y,Q),A=Math.max(w.x,q),F=Math.max(w.y,Q);N.x=ie,N.y=z,N.width=A-ie,N.height=F-z,$.value++}function Y(){b.value=!1,window.removeEventListener("mousemove",ee),window.removeEventListener("mouseup",Y),M&&M()}function ee(q){if(!b.value)return;const Q=t.getContainer();if(!Q)return;const ie=Q.getBoundingClientRect(),z=(q.clientX-ie.left-s.value)/l.value,A=(q.clientY-ie.top-c.value)/l.value;K(z,A)}function ae(q,Q,ie,z=60){const A=t.getContainer();if(!A)return;const F=A.getBoundingClientRect(),U=(F.width-z*2)/q,G=(F.height-z*2)/Q,le=Math.min(1,Math.max(.3,Math.min(U,G)));l.value=le,s.value=F.width/2,c.value=F.height/2-ie*le}function re(q,Q,ie,z,A=80){const F=t.getContainer();if(!F)return;const U=F.getBoundingClientRect();let G=l.value;(ie*G<40||z*G<40)&&(G=Math.min(n,Math.max(1,60/Math.min(ie,z)))),l.value=G,s.value=U.width/2-q*G,c.value=U.height/2-Q*G}return{scale:l,offsetX:s,offsetY:c,isPanning:u,panMoved:d,onWheel:I,zoomIn:C,zoomOut:E,startPan:k,startMarquee:x,updateMarquee:K,isMarquee:b,marquee:N,marqueeVersion:$,setOnMarqueeEnd:P,resetView:ae,centerOn:re}}const Xa=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform);function hi(t){return Xa?t.metaKey:t.ctrlKey}function Za(t){function o(){const r=t.getSelectedId();if(r)return r;if(t.defaultTargetId)return t.defaultTargetId();const l=t.getSelectedIds();return l.length>0?l[0]:null}function n(r){var u,d,g;const l=r.target;if(l&&(l.tagName==="INPUT"||l.tagName==="TEXTAREA"||l.isContentEditable)||t.isReadonly()||t.isEditing())return;const s=t.getSelectedId(),c=o();if(c){if(hi(r)&&!r.shiftKey){if(r.key==="d"||r.key==="D"){const b=(u=t.defaultTargetId)==null?void 0:u.call(t);s&&s!==b&&(r.preventDefault(),t.onDuplicate(s));return}if(r.key==="c"||r.key==="C"){const b=t.getSelectedIds();b.length>0&&(r.preventDefault(),t.onCopy(b));return}if(r.key==="x"||r.key==="X"){const b=t.getSelectedIds();b.length>0&&(r.preventDefault(),t.onCut(b));return}if(r.key==="v"||r.key==="V"){if(!t.hasClipboard())return;r.preventDefault();const b=t.getSelectedIds();t.onPaste(b.length>0?b[0]:null);return}if(r.key==="z"||r.key==="Z"){r.preventDefault(),t.onUndo();return}if(r.key==="y"||r.key==="Y"){r.preventDefault(),t.onRedo();return}if(r.key==="Home"){r.preventDefault(),t.onSelectRoot();return}}if(hi(r)&&r.shiftKey&&(r.key==="Z"||r.key==="z")){r.preventDefault(),t.onRedo();return}if(r.key==="Tab")r.preventDefault(),t.onAddChild(c);else if(r.key==="Enter")if(r.preventDefault(),r.shiftKey){const b=(d=t.defaultTargetId)==null?void 0:d.call(t);s&&s!==b&&t.onAddSiblingBefore(s)}else t.onAddSibling(c);else(r.key==="Delete"||r.key==="Backspace")&&s&&s!==((g=t.defaultTargetId)==null?void 0:g.call(t))?(r.preventDefault(),t.onRemove(s)):r.key==="F2"&&s?(r.preventDefault(),t.onStartEdit(s)):r.key==="Escape"?(r.preventDefault(),t.onClearSelection()):r.key==="ArrowDown"?(r.preventDefault(),t.onNavigate(0,1)):r.key==="ArrowUp"?(r.preventDefault(),t.onNavigate(0,-1)):r.key==="ArrowRight"?(r.preventDefault(),t.onNavigate(1,0)):r.key==="ArrowLeft"&&(r.preventDefault(),t.onNavigate(-1,0))}}e.onMounted(()=>{window.addEventListener("keydown",n)}),e.onBeforeUnmount(()=>{window.removeEventListener("keydown",n)})}function Ja(t=100){const o=e.ref([]);let n=-1;function r(){return n>0}function l(){return n<o.value.length-1}function s(g){const b=JSON.stringify(g);for(n<o.value.length-1&&(o.value=o.value.slice(0,n+1)),o.value.push(b),n=o.value.length-1;o.value.length>t;)o.value.shift(),n--}function c(){return r()?(n--,JSON.parse(o.value[n])):null}function u(){return l()?(n++,JSON.parse(o.value[n])):null}function d(){o.value=[],n=-1}return{canUndo:r,canRedo:l,record:s,undo:c,redo:u,reset:d}}const Qa={1:"#ef4444",2:"#f97316",3:"#f59e0b",4:"#eab308",5:"#84cc16",6:"#22c55e",7:"#14b8a6",8:"#3b82f6",9:"#6366f1"},es={label:"优先级",markers:Array.from({length:9},(t,o)=>{const n=o+1,r=Qa[n];return{id:`priority-${n}`,label:`优先级 ${n}`,svg:`<circle cx="12" cy="12" r="10" fill="${r}"/><text x="12" y="16" text-anchor="middle" font-size="12" font-weight="700" fill="#fff" font-family="sans-serif">${n}</text>`}})};function ts(t){if(t===0)return'<circle cx="12" cy="12" r="10" fill="none" stroke="#94a3b8" stroke-width="2"/>';if(t===100)return'<circle cx="12" cy="12" r="10" fill="#22c55e"/>';const o=t/100*2*Math.PI,n=12+10*Math.sin(o),r=12-10*Math.cos(o);return`<circle cx="12" cy="12" r="10" fill="none" stroke="#e2e8f0" stroke-width="2"/><path d="M 12 12 L 12 2 A 10 10 0 ${t>50?1:0} 1 ${n.toFixed(2)} ${r.toFixed(2)} Z" fill="#3b82f6"/><circle cx="12" cy="12" r="10" fill="none" stroke="#cbd5e1" stroke-width="1"/>`}const ns={label:"进度",markers:[0,25,50,75,100].map(t=>({id:`progress-${t}`,label:`进度 ${t}%`,svg:ts(t)}))},os={label:"旗帜",markers:[{id:"flag-red",label:"红旗",color:"#ef4444"},{id:"flag-orange",label:"橙旗",color:"#f97316"},{id:"flag-yellow",label:"黄旗",color:"#eab308"},{id:"flag-green",label:"绿旗",color:"#22c55e"},{id:"flag-blue",label:"蓝旗",color:"#3b82f6"},{id:"flag-gray",label:"灰旗",color:"#94a3b8"}].map(t=>({id:t.id,label:t.label,svg:`<path d="M6 3 V21" stroke="#475569" stroke-width="2" stroke-linecap="round"/><path d="M6 4 H18 L15 7 L18 10 H6 Z" fill="${t.color}" stroke="${t.color}" stroke-width="1" stroke-linejoin="round"/>`}))},pr=[es,ns,os,{label:"星标",markers:[{id:"star",label:"星标",svg:'<path d="M12 2 L14.5 8.5 L21 9 L16 13.5 L17.5 20 L12 16.5 L6.5 20 L8 13.5 L3 9 L9.5 8.5 Z" fill="#f59e0b" stroke="#f59e0b" stroke-width="1" stroke-linejoin="round"/>'},{id:"star-half",label:"半星",svg:'<path d="M12 2 L14.5 8.5 L21 9 L16 13.5 L17.5 20 L12 16.5 L6.5 20 L8 13.5 L3 9 L9.5 8.5 Z" fill="#e2e8f0" stroke="#f59e0b" stroke-width="1.5" stroke-linejoin="round"/><path d="M12 2 L12 16.5 L6.5 20 L8 13.5 L3 9 L9.5 8.5 Z" fill="#f59e0b" stroke="none"/>'}]},{label:"其他",markers:[{id:"smile",label:"微笑",svg:'<circle cx="12" cy="12" r="10" fill="#fef3c7" stroke="#f59e0b" stroke-width="1.5"/><circle cx="9" cy="10" r="1.2" fill="#92400e"/><circle cx="15" cy="10" r="1.2" fill="#92400e"/><path d="M8 14 Q12 17 16 14" stroke="#92400e" stroke-width="1.5" fill="none" stroke-linecap="round"/>'},{id:"people",label:"人员",svg:'<circle cx="9" cy="8" r="2.5" fill="#3b82f6"/><circle cx="16" cy="8" r="2.5" fill="#3b82f6"/><path d="M4 19 C4 15 6 13 9 13 C12 13 14 15 14 19" fill="#3b82f6"/><path d="M14 19 C14 15.5 15.5 13.5 17.5 13.5 C19.5 13.5 21 15.5 21 19" fill="#3b82f6"/>'},{id:"arrow-up",label:"上箭头",svg:'<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M12 17 V7 M8 11 L12 7 L16 11" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>'},{id:"arrow-down",label:"下箭头",svg:'<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M12 7 V17 M8 13 L12 17 L16 13" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>'},{id:"arrow-right",label:"右箭头",svg:'<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M7 12 H17 M13 8 L17 12 L13 16" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>'},{id:"arrow-left",label:"左箭头",svg:'<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M17 12 H7 M11 8 L7 12 L11 16" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>'}]}],Bo={};for(const t of pr)for(const o of t.markers)Bo[o.id]=o;function rs(t){return Bo[t]}function Io(t){var o;return((o=Bo[t])==null?void 0:o.svg)??""}function bi(t){var o;return((o=Bo[t])==null?void 0:o.label)??t}function gr(t){let o=0;for(let r=0;r<t.length;r++)o=(o<<5)-o+t.charCodeAt(r),o|=0;const n=Math.abs(o)%360;return{background:`hsl(${n}, 85%, 92%)`,borderColor:`hsl(${n}, 60%, 70%)`,color:`hsl(${n}, 55%, 30%)`}}const is={key:5,class:"zm-marker-picker"},ls={class:"zm-marker-group-label"},as={class:"zm-marker-grid"},ss=["title","onClick","innerHTML"],cs=e.defineComponent({__name:"NodeContextMenu",props:{x:{},y:{},container:{},hasImage:{type:Boolean,default:!1},hasLink:{type:Boolean,default:!1},hasNote:{type:Boolean,default:!1},hasCode:{type:Boolean,default:!1},hasTable:{type:Boolean,default:!1},nodeMarkers:{default:()=>[]},nodeTags:{default:()=>[]}},emits:["pickImage","setLink","removeLink","editNote","removeNote","removeImage","addCode","editCode","removeCode","addTable","editTable","removeTable","toggleMarker","clearMarkers","addTag","removeTags","close"],setup(t,{emit:o}){const n=t,r=o,l=e.computed(()=>{let E=n.x+2,k=n.y+2;if(n.container){const m=n.container.getBoundingClientRect(),B=180,K=4+(3+(n.hasImage?1:0)+(n.hasLink?1:0)+(n.hasNote?1:0)+1+(n.hasCode?1:0)+1+(n.hasTable?1:0))*28;E+B>m.right&&(E=Math.max(m.left+4,n.x-B-2)),k+K>m.bottom&&(k=Math.max(m.top+4,n.y-K-2)),E<m.left+2&&(E=m.left+2),k<m.top+2&&(k=m.top+2)}return{left:E,top:k}}),s=e.computed(()=>n.hasImage),c=e.computed(()=>n.hasLink),u=e.computed(()=>n.hasNote),d=e.computed(()=>n.nodeMarkers.length>0),g=e.computed(()=>n.nodeTags.length>0),b=e.ref(!1);function w(){b.value=!b.value}function N(E){return n.nodeMarkers.includes(E)}function $(E){r("toggleMarker",E)}function M(E){const k=E.target;k&&k.closest(".zm-node-menu")||r("close")}function P(E){E.key==="Escape"&&r("close")}function I(){r("close")}window.addEventListener("mousedown",M,!0),window.addEventListener("keydown",P,!0),window.addEventListener("wheel",I,!0),window.addEventListener("scroll",I,!0),e.onBeforeUnmount(()=>{window.removeEventListener("mousedown",M,!0),window.removeEventListener("keydown",P,!0),window.removeEventListener("wheel",I,!0),window.removeEventListener("scroll",I,!0)});function C(E){E(),r("close")}return(E,k)=>(e.openBlock(),e.createElementBlock("div",{class:"zm-node-menu",style:e.normalizeStyle({left:l.value.left+"px",top:l.value.top+"px"}),onContextmenu:k[13]||(k[13]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[0]||(k[0]=e.withModifiers(m=>C(()=>r("pickImage")),["stop"]))},[e.createVNode(be,{name:"image",size:13}),e.createElementVNode("span",null,e.toDisplayString(s.value?"替换图片":"添加图片"),1)]),s.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-node-menu-item",onClick:k[1]||(k[1]=e.withModifiers(m=>C(()=>r("removeImage")),["stop"]))},[e.createVNode(be,{name:"x",size:13}),k[14]||(k[14]=e.createElementVNode("span",null,"移除图片",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[2]||(k[2]=e.withModifiers(m=>C(()=>r("setLink")),["stop"]))},[e.createVNode(be,{name:"link",size:13}),e.createElementVNode("span",null,e.toDisplayString(c.value?"编辑链接":"添加链接"),1)]),c.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-node-menu-item",onClick:k[3]||(k[3]=e.withModifiers(m=>C(()=>r("removeLink")),["stop"]))},[e.createVNode(be,{name:"x",size:13}),k[15]||(k[15]=e.createElementVNode("span",null,"移除链接",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[4]||(k[4]=e.withModifiers(m=>C(()=>r("addCode")),["stop"]))},[k[16]||(k[16]=e.createElementVNode("span",{class:"zm-node-menu-icon zm-node-menu-icon-code","aria-hidden":"true"},"{ }",-1)),e.createElementVNode("span",null,e.toDisplayString(t.hasCode?"编辑代码块":"添加代码块"),1)]),t.hasCode?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-node-menu-item",onClick:k[5]||(k[5]=e.withModifiers(m=>C(()=>r("removeCode")),["stop"]))},[e.createVNode(be,{name:"x",size:13}),k[17]||(k[17]=e.createElementVNode("span",null,"移除代码块",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[6]||(k[6]=e.withModifiers(m=>C(()=>r("addTable")),["stop"]))},[k[18]||(k[18]=e.createElementVNode("span",{class:"zm-node-menu-icon zm-node-menu-icon-table","aria-hidden":"true"},"▦",-1)),e.createElementVNode("span",null,e.toDisplayString(t.hasTable?"编辑表格":"添加表格"),1)]),t.hasTable?(e.openBlock(),e.createElementBlock("button",{key:3,class:"zm-node-menu-item",onClick:k[7]||(k[7]=e.withModifiers(m=>C(()=>r("removeTable")),["stop"]))},[e.createVNode(be,{name:"x",size:13}),k[19]||(k[19]=e.createElementVNode("span",null,"移除表格",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[8]||(k[8]=e.withModifiers(m=>C(()=>r("editNote")),["stop"]))},[e.createVNode(be,{name:"note",size:13}),e.createElementVNode("span",null,e.toDisplayString(u.value?"编辑笔记":"添加笔记"),1)]),u.value?(e.openBlock(),e.createElementBlock("button",{key:4,class:"zm-node-menu-item",onClick:k[9]||(k[9]=e.withModifiers(m=>C(()=>r("removeNote")),["stop"]))},[e.createVNode(be,{name:"x",size:13}),k[20]||(k[20]=e.createElementVNode("span",null,"移除笔记",-1))])):e.createCommentVNode("",!0),k[25]||(k[25]=e.createElementVNode("div",{class:"zm-node-menu-divider"},null,-1)),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:e.withModifiers(w,["stop"])},[k[21]||(k[21]=e.createElementVNode("span",{class:"zm-node-menu-icon","aria-hidden":"true"},"⚑",-1)),k[22]||(k[22]=e.createElementVNode("span",null,"标记图标",-1)),e.createElementVNode("span",{class:e.normalizeClass(["zm-node-menu-arrow",{"is-open":b.value}])},"›",2)]),b.value?(e.openBlock(),e.createElementBlock("div",is,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(pr),m=>(e.openBlock(),e.createElementBlock("div",{key:m.label,class:"zm-marker-group"},[e.createElementVNode("div",ls,e.toDisplayString(m.label),1),e.createElementVNode("div",as,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.markers,B=>(e.openBlock(),e.createElementBlock("button",{key:B.id,class:e.normalizeClass(["zm-marker-cell",{"is-active":N(B.id)}]),title:B.label,onClick:e.withModifiers(x=>$(B.id),["stop"]),innerHTML:'<svg viewBox="0 0 24 24" width="20" height="20">'+e.unref(Io)(B.id)+"</svg>"},null,10,ss))),128))])]))),128)),d.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-marker-clear",onClick:k[10]||(k[10]=e.withModifiers(m=>r("clearMarkers"),["stop"]))}," 清除所有标记 ")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[11]||(k[11]=e.withModifiers(m=>C(()=>r("addTag")),["stop"]))},[k[23]||(k[23]=e.createElementVNode("span",{class:"zm-node-menu-icon","aria-hidden":"true"},"#",-1)),e.createElementVNode("span",null,e.toDisplayString(g.value?"编辑标签":"添加标签"),1)]),g.value?(e.openBlock(),e.createElementBlock("button",{key:6,class:"zm-node-menu-item",onClick:k[12]||(k[12]=e.withModifiers(m=>C(()=>r("removeTags")),["stop"]))},[e.createVNode(be,{name:"x",size:13}),k[24]||(k[24]=e.createElementVNode("span",null,"移除标签",-1))])):e.createCommentVNode("",!0)],36))}}),ds=e.defineComponent({__name:"CanvasContextMenu",props:{x:{},y:{},container:{}},emits:["openSettings","openData","openImport","exportPng","exportSvg","close"],setup(t,{emit:o}){const n=t,r=o,l=e.computed(()=>{let C=n.x+2,E=n.y+2;if(n.container){const k=n.container.getBoundingClientRect(),m=160,B=4+4*28+5;C+m>k.right&&(C=Math.max(k.left+4,n.x-m-2)),E+B>k.bottom&&(E=Math.max(k.top+4,n.y-B-2)),C<k.left+2&&(C=k.left+2),E<k.top+2&&(E=k.top+2)}return{left:C,top:E}}),s=e.ref(null),c=e.ref(null),u=e.ref(null),d=e.computed(()=>{const C=s.value==="import"?c.value:s.value==="export"?u.value:null;if(!C)return{left:"-9999px",top:"-9999px",display:"none"};const E=C.getBoundingClientRect(),k=window.innerWidth,m=window.innerHeight,B=176,x=4+3*28;let K=E.right;K+B>k-4&&(K=Math.max(4,E.left-B));let Y=E.top-4;return Y+x>m-4&&(Y=Math.max(4,m-x-4)),{left:K+"px",top:Y+"px",display:"block"}});let g=null,b=null;function w(C){b&&(clearTimeout(b),b=null),g=setTimeout(()=>{s.value=C},60)}function N(){g&&(clearTimeout(g),g=null),b=setTimeout(()=>{s.value=null},120)}e.onBeforeUnmount(()=>{g&&clearTimeout(g),b&&clearTimeout(b)});function $(C){const E=C.target;E&&E.closest(".zm-canvas-menu")||r("close")}function M(C){C.key==="Escape"&&r("close")}function P(){r("close")}window.addEventListener("mousedown",$,!0),window.addEventListener("keydown",M,!0),window.addEventListener("wheel",P,!0),window.addEventListener("scroll",P,!0),e.onBeforeUnmount(()=>{window.removeEventListener("mousedown",$,!0),window.removeEventListener("keydown",M,!0),window.removeEventListener("wheel",P,!0),window.removeEventListener("scroll",P,!0)});function I(C){C(),r("close")}return(C,E)=>(e.openBlock(),e.createElementBlock("div",{class:"zm-canvas-menu",style:e.normalizeStyle({left:l.value.left+"px",top:l.value.top+"px"}),onContextmenu:E[11]||(E[11]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:E[0]||(E[0]=e.withModifiers(k=>I(()=>r("openData")),["stop"]))},[e.createVNode(be,{name:"database",size:13,stroke:1.6}),E[12]||(E[12]=e.createElementVNode("span",null,"查看数据",-1))]),e.createElementVNode("div",{ref_key:"importItemRef",ref:c,class:e.normalizeClass(["zm-canvas-menu-item zm-canvas-menu-item-has-submenu",{"is-open":s.value==="import"}]),onMouseenter:E[5]||(E[5]=k=>w("import")),onMouseleave:N},[e.createVNode(be,{name:"import",size:13,stroke:1.6}),E[16]||(E[16]=e.createElementVNode("span",null,"导入",-1)),E[17]||(E[17]=e.createElementVNode("svg",{class:"zm-canvas-menu-caret",width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[e.createElementVNode("polyline",{points:"2.5 1.8 5.2 4 2.5 6.2"})],-1)),s.value==="import"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-canvas-submenu",style:e.normalizeStyle(d.value),onMouseenter:E[4]||(E[4]=k=>w("import")),onMouseleave:N},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:E[1]||(E[1]=e.withModifiers(k=>I(()=>r("openImport","markdown")),["stop"]))},[e.createVNode(be,{name:"markdown",size:13,stroke:1.6}),E[13]||(E[13]=e.createElementVNode("span",null,"Markdown 导入",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:E[2]||(E[2]=e.withModifiers(k=>I(()=>r("openImport","json")),["stop"]))},[e.createVNode(be,{name:"json",size:13,stroke:1.6}),E[14]||(E[14]=e.createElementVNode("span",null,"JSON 文件导入",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:E[3]||(E[3]=e.withModifiers(k=>I(()=>r("openImport","txt")),["stop"]))},[e.createVNode(be,{name:"txt",size:13,stroke:1.6}),E[15]||(E[15]=e.createElementVNode("span",null,"TXT 文件导入",-1))])],36)):e.createCommentVNode("",!0)],34),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:E[6]||(E[6]=e.withModifiers(k=>I(()=>r("openSettings")),["stop"]))},[e.createVNode(be,{name:"settings",size:13,stroke:1.6}),E[18]||(E[18]=e.createElementVNode("span",null,"设置",-1))]),E[23]||(E[23]=e.createElementVNode("div",{class:"zm-canvas-menu-divider"},null,-1)),e.createElementVNode("div",{ref_key:"exportItemRef",ref:u,class:e.normalizeClass(["zm-canvas-menu-item zm-canvas-menu-item-has-submenu",{"is-open":s.value==="export"}]),onMouseenter:E[10]||(E[10]=k=>w("export")),onMouseleave:N},[e.createVNode(be,{name:"export",size:13,stroke:1.6}),E[21]||(E[21]=e.createElementVNode("span",null,"导出",-1)),E[22]||(E[22]=e.createElementVNode("svg",{class:"zm-canvas-menu-caret",width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[e.createElementVNode("polyline",{points:"2.5 1.8 5.2 4 2.5 6.2"})],-1)),s.value==="export"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-canvas-submenu",style:e.normalizeStyle(d.value),onMouseenter:E[9]||(E[9]=k=>w("export")),onMouseleave:N},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:E[7]||(E[7]=e.withModifiers(k=>I(()=>r("exportPng")),["stop"]))},[e.createVNode(be,{name:"image",size:13,stroke:1.6}),E[19]||(E[19]=e.createElementVNode("span",null,"导出 PNG",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:E[8]||(E[8]=e.withModifiers(k=>I(()=>r("exportSvg")),["stop"]))},[e.createVNode(be,{name:"svg-export",size:13,stroke:1.6}),E[20]||(E[20]=e.createElementVNode("span",null,"导出 SVG",-1))])],36)):e.createCommentVNode("",!0)],34)],36))}}),us=["aria-hidden"],fs=["aria-hidden"],ms={key:0,class:"zm-drawer-header"},ps={key:0,class:"zm-drawer-title"},gs={class:"zm-drawer-body"},hs=["aria-hidden"],bs={key:0,class:"zm-drawer-header"},ks={key:0,class:"zm-drawer-title"},ys={class:"zm-drawer-body"},Mt=e.defineComponent({__name:"Drawer",props:{side:{default:"left"},width:{default:320},open:{type:Boolean,default:!0},title:{default:""},scope:{default:"page"},closable:{type:Boolean,default:!0},closeOnBackdrop:{type:Boolean,default:!0}},emits:["update:open"],setup(t,{emit:o}){const n=o;function r(){n("update:open",!1)}function l(){n("update:open",!1)}return(s,c)=>t.scope==="canvas"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.Transition,{name:"zm-fade"},{default:e.withCtx(()=>[t.open?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-drawer-canvas-backdrop","aria-hidden":!t.open,onClick:c[0]||(c[0]=u=>t.closeOnBackdrop&&l())},null,8,us)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:t.side==="left"?"zm-slide-left":"zm-slide-right"},{default:e.withCtx(()=>[t.open?(e.openBlock(),e.createElementBlock("aside",{key:0,class:e.normalizeClass(["zm-drawer zm-drawer--canvas",["zm-drawer--"+t.side]]),style:e.normalizeStyle({width:t.width+"px"}),"aria-hidden":!t.open},[t.title||s.$slots.header?(e.openBlock(),e.createElementBlock("div",ms,[t.title?(e.openBlock(),e.createElementBlock("h3",ps,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.renderSlot(s.$slots,"header"),t.closable?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-drawer-close",title:"关闭",onClick:r},[...c[1]||(c[1]=[e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},[e.createElementVNode("path",{d:"M6 6 L18 18 M18 6 L6 18"})],-1)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",gs,[e.renderSlot(s.$slots,"default")])],14,fs)):e.createCommentVNode("",!0)]),_:3},8,["name"])],64)):(e.openBlock(),e.createBlock(e.Transition,{key:1,name:"zm-drawer"},{default:e.withCtx(()=>[t.open?(e.openBlock(),e.createElementBlock("aside",{key:0,class:e.normalizeClass(["zm-drawer",["zm-drawer--"+t.side,{"is-open":t.open}]]),style:e.normalizeStyle({width:t.width+"px"}),"aria-hidden":!t.open},[t.title||s.$slots.header?(e.openBlock(),e.createElementBlock("div",bs,[t.title?(e.openBlock(),e.createElementBlock("h3",ks,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.renderSlot(s.$slots,"header"),t.closable?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-drawer-close",title:"关闭",onClick:r},[...c[2]||(c[2]=[e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},[e.createElementVNode("path",{d:"M6 6 L18 18 M18 6 L6 18"})],-1)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",ys,[e.renderSlot(s.$slots,"default")])],14,hs)):e.createCommentVNode("",!0)]),_:3}))}}),Es={class:"zm-outline-root"},xs={class:"zm-outline-search"},ws={key:0,class:"zm-outline-search-count"},Ns={key:1,class:"zm-outline-search-count zm-outline-search-empty"},Ss={class:"zm-outline-actions"},Ts={width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Cs={key:0,x:"9",y:"9",width:"13",height:"13",rx:"2"},As={key:1,d:"M5 12 L10 17 L19 7"},_s={class:"zm-outline"},Ms=["data-outline-id","onClick","onDblclick","onDragstart","onDragover","onDragleave","onDrop"],vs=["title","onClick"],Rs={width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round"},Bs={key:0,points:"6 9 12 15 18 9"},Is={key:1,points:"9 6 15 12 9 18"},zs={key:1,class:"zm-outline-dot"},Os={class:"zm-outline-index"},Ls={key:3,class:"zm-outline-text"},Ds=["onClick"],Vs=["src"],$s=["onClick"],Ps=["src"],Us=["title","onClick"],Fs={width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Hs={key:0,x:"9",y:"9",width:"13",height:"13",rx:"2"},Ws={key:1,d:"M5 12 L10 17 L19 7"},zo=e.defineComponent({__name:"Outline",props:{data:{},selectedId:{default:null},collapsedIds:{default:()=>new Set},readonly:{type:Boolean,default:!1}},emits:["select","toggleCollapse","edit","addChild","addSibling","move"],setup(t,{emit:o}){const n=t,r=o,l=e.ref(""),s=e.ref(null),c=e.ref(-1),u=e.computed(()=>{const p=l.value.trim().toLowerCase();if(!p)return new Set;const L=new Set,V=X=>{var se;(X.text.toLowerCase().includes(p)||(se=X.note)!=null&&se.text&&X.note.text.toLowerCase().includes(p))&&L.add(X.id);for(const ge of X.children)V(ge)};return V(n.data),L}),d=e.computed(()=>{if(u.value.size===0)return new Set;const p=new Set,L=V=>{let X=u.value.has(V.id);for(const se of V.children)L(se)&&(X=!0);return X&&p.add(V.id),X};return L(n.data),p}),g=e.computed(()=>{const p=[],L=V=>{u.value.has(V.id)&&p.push(V.id);for(const X of V.children)L(X)};return L(n.data),p}),b=e.computed(()=>l.value.trim().length>0),w=e.computed(()=>{const p=[],L=d.value,V=(X,se,ge)=>{if(b.value&&!L.has(X.id))return;const Ge=X.children.length>0,Pe=b.value?!1:n.collapsedIds.has(X.id);p.push({id:X.id,text:X.text||"(无标题)",depth:se,siblingIndex:ge,hasChildren:Ge,collapsed:Pe,node:X}),Ge&&!Pe&&X.children.forEach((Ze,je)=>V(Ze,se+1,je))};return V(n.data,0,0),p});function N(){c.value=g.value.length>0?0:-1}function $(){const p=g.value;p.length!==0&&(c.value=(c.value+1)%p.length,I(c.value))}function M(){const p=g.value;p.length!==0&&(c.value=(c.value-1+p.length)%p.length,I(c.value))}function P(p){p.key==="Enter"?(p.preventDefault(),p.shiftKey?M():$()):p.key==="Escape"&&(p.preventDefault(),l.value="",c.value=-1)}function I(p){const L=g.value[p];if(!L)return;const V=w.value.find(X=>X.id===L);V&&r("select",V.node),e.nextTick(()=>{const X=document.querySelector(`[data-outline-id="${L}"]`);X==null||X.scrollIntoView({block:"nearest",behavior:"smooth"})})}function C(){l.value="",c.value=-1}e.onMounted(()=>{e.nextTick(()=>{var p;return(p=s.value)==null?void 0:p.focus()})});const E=e.ref(null),k=e.ref("");let m=null;function B(p){n.readonly||(E.value=p.id,k.value=p.text,e.nextTick(()=>{m=document.querySelector(".zm-outline-input"),m==null||m.focus(),m==null||m.select()}))}function x(){E.value!=null&&(r("edit",{id:E.value,text:k.value.trim()||"(无标题)"}),K())}function K(){E.value=null,k.value="",m=null}function Y(p){p.key==="Enter"?(p.preventDefault(),x()):p.key==="Escape"&&(p.preventDefault(),K())}e.onBeforeUnmount(K);const ee=e.ref(null),ae=e.ref(null),re=e.ref(null);function q(p,L){if(n.readonly){p.preventDefault();return}ee.value={id:L.id,text:L.text},p.dataTransfer&&(p.dataTransfer.effectAllowed="move",p.dataTransfer.setData("text/plain",L.id))}function Q(){ee.value=null,ae.value=null,re.value=null}function ie(p,L){if(!ee.value)return;p.preventDefault(),p.dataTransfer&&(p.dataTransfer.dropEffect="move");const V=F(p);ae.value=L.id,re.value=V}function z(p){ae.value===p.id&&(ae.value=null,re.value=null)}function A(p,L){p.preventDefault();const V=ee.value;if(!V)return;const X=F(p);V.id!==L.id&&r("move",{srcId:V.id,targetId:L.id,position:X}),Q()}function F(p,L){const X=p.currentTarget.getBoundingClientRect(),se=p.clientY-X.top,ge=X.height;return se<ge*.3?"before":se>ge*.7?"after":"child"}const U=e.ref(null);let G=null;async function le(p){try{return await navigator.clipboard.writeText(p),!0}catch{const L=document.createElement("textarea");L.value=p,document.body.appendChild(L),L.select();let V=!1;try{V=document.execCommand("copy")}finally{document.body.removeChild(L)}return V}}async function Ne(p,L,V){p.stopPropagation(),await le(L)&&(U.value=V,G&&clearTimeout(G),G=setTimeout(()=>U.value=null,1200))}const _e=e.computed(()=>{const p=[],L=(V,X)=>{const se=" ".repeat(X),ge=X===0?"":"- ";p.push(se+ge+(V.text||""));for(const Ge of V.children)L(Ge,X+1)};return L(n.data,0),p.join(`
14
+ `)}),Re=e.ref(!1);let xe=null;async function y(){await le(_e.value)&&(Re.value=!0,xe&&clearTimeout(xe),xe=setTimeout(()=>Re.value=!1,1200))}return(p,L)=>(e.openBlock(),e.createElementBlock("div",Es,[e.createElementVNode("div",xs,[L[3]||(L[3]=e.createElementVNode("svg",{class:"zm-outline-search-icon",width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"}),e.createElementVNode("line",{x1:"20",y1:"20",x2:"16",y2:"16"})],-1)),e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:s,"onUpdate:modelValue":L[0]||(L[0]=V=>l.value=V),type:"text",class:"zm-outline-search-input",placeholder:"搜索节点… (Enter 下一个, Shift+Enter 上一个)",onInput:N,onKeydown:P},null,544),[[e.vModelText,l.value]]),g.value.length>0?(e.openBlock(),e.createElementBlock("span",ws,e.toDisplayString(c.value+1)+"/"+e.toDisplayString(g.value.length),1)):b.value?(e.openBlock(),e.createElementBlock("span",Ns,"无结果")):e.createCommentVNode("",!0),l.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-outline-search-clear",title:"清除搜索",onClick:C},"×")):e.createCommentVNode("",!0)]),e.createElementVNode("div",Ss,[e.createElementVNode("button",{class:e.normalizeClass(["zm-outline-action-btn",{"is-success":Re.value}]),title:"复制完整大纲为纯文本",onClick:y},[(e.openBlock(),e.createElementBlock("svg",Ts,[Re.value?(e.openBlock(),e.createElementBlock("path",As)):(e.openBlock(),e.createElementBlock("rect",Cs)),L[4]||(L[4]=e.createElementVNode("path",{d:"M5 15 H4 a2 2 0 0 1 -2 -2 V4 a2 2 0 0 1 2 -2 h9 a2 2 0 0 1 2 2 v1"},null,-1))])),e.createElementVNode("span",null,e.toDisplayString(Re.value?"已复制":"复制大纲"),1)],2)]),e.createElementVNode("ul",_s,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.id,"data-outline-id":V.id,class:e.normalizeClass(["zm-outline-row",{"is-selected":V.id===t.selectedId,"is-root":V.depth===0,"is-editing":E.value===V.id,"is-search-hit":u.value.has(V.id),"is-search-current":g.value[c.value]===V.id,"is-drag-over-before":ae.value===V.id&&re.value==="before","is-drag-over-after":ae.value===V.id&&re.value==="after","is-drag-over-child":ae.value===V.id&&re.value==="child"}]),style:e.normalizeStyle({paddingLeft:12+V.depth*16+"px"}),draggable:"true",onClick:X=>r("select",V.node),onDblclick:X=>B(V),onDragstart:X=>q(X,V),onDragend:Q,onDragover:X=>ie(X,V),onDragleave:()=>z(V),onDrop:X=>A(X,V)},[V.hasChildren?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-outline-toggle",title:V.collapsed?"展开":"折叠",onClick:e.withModifiers(X=>r("toggleCollapse",V.id),["stop"])},[(e.openBlock(),e.createElementBlock("svg",Rs,[V.collapsed?(e.openBlock(),e.createElementBlock("polyline",Is)):(e.openBlock(),e.createElementBlock("polyline",Bs))]))],8,vs)):(e.openBlock(),e.createElementBlock("span",zs)),e.createElementVNode("span",Os,e.toDisplayString(V.siblingIndex+1)+".",1),E.value===V.id?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,"onUpdate:modelValue":L[1]||(L[1]=X=>k.value=X),class:"zm-outline-input",onBlur:x,onKeydown:Y,onClick:L[2]||(L[2]=e.withModifiers(()=>{},["stop"]))},null,544)),[[e.vModelText,k.value]]):(e.openBlock(),e.createElementBlock("span",Ls,e.toDisplayString(V.text),1)),n.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:4,class:"zm-outline-row-action",title:"添加同级",onClick:e.withModifiers(X=>r("addSibling",V.id),["stop"])},[e.createElementVNode("img",{src:e.unref(ri),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,Vs)],8,Ds)),n.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:5,class:"zm-outline-row-action",title:"添加子节点",onClick:e.withModifiers(X=>r("addChild",V.id),["stop"])},[e.createElementVNode("img",{src:e.unref(ii),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,Ps)],8,$s)),e.createElementVNode("button",{class:e.normalizeClass(["zm-outline-row-copy",{"is-success":U.value===V.id}]),title:U.value===V.id?"已复制":"复制节点文本",onClick:X=>Ne(X,V.text,V.id)},[(e.openBlock(),e.createElementBlock("svg",Fs,[U.value!==V.id?(e.openBlock(),e.createElementBlock("rect",Hs)):(e.openBlock(),e.createElementBlock("path",Ws)),L[5]||(L[5]=e.createElementVNode("path",{d:"M5 15 H4 a2 2 0 0 1 -2 -2 V4 a2 2 0 0 1 2 -2 h9 a2 2 0 0 1 2 2 v1"},null,-1))]))],10,Us)],46,Ms))),128))])]))}}),Gs={key:0,class:"zm-jtv-root"},js={key:0,class:"zm-jtv-key"},Ks={key:1,class:"zm-jtv-colon"},Ys={key:2,class:"zm-jtv-key zm-jtv-bracket"},qs={key:3,class:"zm-jtv-size"},Xs={key:4,class:"zm-jtv-bracket"},Zs={key:5,class:"zm-jtv-brace"},Js={key:0,class:"zm-jtv-children"},Qs={class:"zm-jtv-key"},ec={key:0,class:"zm-jtv-key"},tc=["src","alt"],nc=["href"],oc=e.defineComponent({__name:"JsonTreeViewer",props:{value:{},keyName:{default:""},isRoot:{type:Boolean,default:!0},path:{default:""},depth:{default:0},query:{default:""},collapsedPaths:{default:()=>new Set}},setup(t){const o=t,n=e.computed(()=>o.value===null?"null":Array.isArray(o.value)?"array":typeof o.value),r=e.computed(()=>n.value==="object"),l=e.computed(()=>n.value==="array");e.computed(()=>!r.value&&!l.value);const s=e.computed(()=>{if(l.value)return`Array(${o.value.length})`;if(r.value){const E=o.value,k=Object.keys(E);return`Object(${k.length} ${k.length===1?"key":"keys"})`}return""}),c=e.computed(()=>l.value?o.value.map((E,k)=>({key:String(k),value:E})):r.value?Object.entries(o.value).map(([E,k])=>({key:E,value:k})):[]),u=e.computed(()=>o.isRoot?"<root>":o.path),d=e.computed(()=>o.collapsedPaths.has(u.value));function g(E,k,m){E!=="<root>"&&(m<2||k===null||typeof k!="object"||o.collapsedPaths.has(E)||o.collapsedPaths.add(E))}o.isRoot||g(u.value,o.value,o.depth);function b(){d.value?o.collapsedPaths.delete(u.value):o.collapsedPaths.add(u.value)}function w(E){return u.value===""?E:`${u.value}.${E}`}function N(E){if(!o.query)return!0;const k=o.query.toLowerCase();return typeof E=="string"?E.toLowerCase().includes(k):E===null?"null".includes(k):String(E).toLowerCase().includes(k)}function $(E){return o.query?E.toLowerCase().includes(o.query.toLowerCase()):!0}function M(E,k){return!o.query||$(E)?!0:k===null||typeof k!="object"?N(k):!0}function P(E){return E===null?"null":typeof E=="string"?E.length>80?`"${E.slice(0,80)}..."`:`"${E}"`:typeof E=="boolean"?E?"true":"false":typeof E=="number"?String(E):typeof E>"u"?"undefined":JSON.stringify(E)}function I(E){if(typeof E!="string")return!1;const k=E.trim();return!!(k.startsWith("data:image/")||/^https?:\/\/.+\.(png|jpe?g|gif|webp|svg|bmp|ico)(\?.*)?$/i.test(k)||/^https?:\/\/.+/i.test(k)&&/\/[^/]+\.(png|jpe?g|gif|webp|svg|bmp|ico)(\?.*)?$/i.test(k))}function C(E){if(!o.query)return null;const k=E.toLowerCase().indexOf(o.query.toLowerCase());return k<0?null:{before:E.slice(0,k),match:E.slice(k,k+o.query.length),after:E.slice(k+o.query.length)}}return(E,k)=>{var B,x,K,Y,ee,ae;const m=e.resolveComponent("JsonTreeViewer",!0);return t.isRoot?(e.openBlock(),e.createElementBlock("div",Gs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,re=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:re.key,class:"zm-jtv-row"},[e.createVNode(m,{"key-name":re.key,value:re.value,path:w(re.key),depth:t.depth+1,query:t.query,"collapsed-paths":t.collapsedPaths,"is-root":!1},null,8,["key-name","value","path","depth","query","collapsed-paths"])])),[[e.vShow,M(re.key,re.value)]])),128))])):r.value||l.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["zm-jtv-branch",{"is-collapsed":d.value}])},[e.createElementVNode("div",{class:"zm-jtv-header",style:e.normalizeStyle({paddingLeft:6+t.depth*12+"px"}),onClick:b},[e.createElementVNode("span",{class:e.normalizeClass(["zm-jtv-toggle",{"is-leaf":!1}])},e.toDisplayString(d.value?"▶":"▼"),1),l.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",js,e.toDisplayString(t.keyName),1)),l.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",Ks,":")),l.value?(e.openBlock(),e.createElementBlock("span",Ys,"[")):e.createCommentVNode("",!0),d.value?(e.openBlock(),e.createElementBlock("span",qs,e.toDisplayString(s.value),1)):e.createCommentVNode("",!0),d.value&&l.value?(e.openBlock(),e.createElementBlock("span",Xs,"]")):e.createCommentVNode("",!0),d.value&&r.value?(e.openBlock(),e.createElementBlock("span",Zs,"}")):e.createCommentVNode("",!0)],4),d.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Js,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,re=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:re.key,class:"zm-jtv-row"},[e.createVNode(m,{"key-name":re.key,value:re.value,path:w(re.key),depth:t.depth+1,query:t.query,"collapsed-paths":t.collapsedPaths,"is-root":!1},null,8,["key-name","value","path","depth","query","collapsed-paths"])])),[[e.vShow,M(re.key,re.value)]])),128))])),!d.value&&l.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"zm-jtv-footer",style:e.normalizeStyle({paddingLeft:6+t.depth*12+"px"})},"]",4)):e.createCommentVNode("",!0),!d.value&&r.value&&!l.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"zm-jtv-footer",style:e.normalizeStyle({paddingLeft:6+t.depth*12+"px"})},"}",4)):e.createCommentVNode("",!0)],2)):(e.openBlock(),e.createElementBlock("div",{key:2,class:"zm-jtv-leaf",style:e.normalizeStyle({paddingLeft:6+t.depth*12+"px"})},[k[2]||(k[2]=e.createElementVNode("span",{class:"zm-jtv-toggle is-leaf"},"·",-1)),e.createElementVNode("span",Qs,e.toDisplayString(t.keyName),1),k[3]||(k[3]=e.createElementVNode("span",{class:"zm-jtv-colon"},":",-1)),$(t.keyName)&&C(t.keyName)?(e.openBlock(),e.createElementBlock("span",ec,[e.createElementVNode("span",null,e.toDisplayString((B=C(t.keyName))==null?void 0:B.before),1),e.createElementVNode("mark",null,e.toDisplayString((x=C(t.keyName))==null?void 0:x.match),1),e.createElementVNode("span",null,e.toDisplayString((K=C(t.keyName))==null?void 0:K.after),1)])):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(["zm-jtv-value",`zm-jtv-${n.value}`])},[C(P(t.value))?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("span",null,e.toDisplayString((Y=C(P(t.value)))==null?void 0:Y.before),1),e.createElementVNode("mark",null,e.toDisplayString((ee=C(P(t.value)))==null?void 0:ee.match),1),e.createElementVNode("span",null,e.toDisplayString((ae=C(P(t.value)))==null?void 0:ae.after),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(P(t.value)),1)],64))],2),I(t.value)?(e.openBlock(),e.createElementBlock("span",{key:1,class:"zm-jtv-thumb-wrap",onClick:k[1]||(k[1]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("img",{class:"zm-jtv-thumb",src:String(t.value),alt:t.keyName,loading:"lazy",referrerpolicy:"no-referrer"},null,8,tc),e.createElementVNode("a",{class:"zm-jtv-thumb-link",href:String(t.value),target:"_blank",rel:"noopener noreferrer",onClick:k[0]||(k[0]=e.withModifiers(()=>{},["stop"]))},"open",8,nc)])):e.createCommentVNode("",!0)],4))}}}),rc={class:"zm-data-panel"},ic={class:"zm-data-header"},lc={class:"zm-data-title"},ac={class:"zm-data-title-meta"},sc={class:"zm-data-toolbar"},cc=["title"],dc={key:0,width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},uc={key:1,width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.4","stroke-linecap":"round","stroke-linejoin":"round"},fc={key:0,class:"zm-data-paste"},mc={class:"zm-data-tabs"},pc=["placeholder"],gc={key:0,class:"zm-data-error"},hc={class:"zm-data-paste-actions"},bc=["disabled"],kc={class:"zm-data-tree"},Oo=e.defineComponent({__name:"DataPanel",props:{data:{},pendingMode:{default:null}},emits:["import","consumed-mode"],setup(t,{emit:o}){const n=t,r=o,l=e.computed(()=>JSON.stringify(n.data,null,2)),s=e.ref(""),c=e.ref(null),u=e.ref(!1),d=e.ref("json"),g=e.ref("idle"),b=e.ref(new Set),w=e.ref("");e.watch(()=>n.pendingMode,k=>{k&&(u.value=!0,d.value=k,r("consumed-mode"))},{immediate:!0});async function N(){try{await navigator.clipboard.writeText(l.value),g.value="copied",setTimeout(()=>g.value="idle",1500)}catch{const k=document.createElement("textarea");k.value=l.value,document.body.appendChild(k),k.select();try{document.execCommand("copy"),g.value="copied",setTimeout(()=>g.value="idle",1500)}finally{document.body.removeChild(k)}}}function $(){const k=new Blob([l.value],{type:"application/json"}),m=URL.createObjectURL(k),B=document.createElement("a");B.href=m,B.download=`${n.data.text||"mindmap"}.json`,B.click(),URL.revokeObjectURL(m)}function M(){c.value=null;const k=s.value.trim();if(k){if(d.value==="markdown"||d.value==="txt"){try{const m=zn(k);r("import",m),s.value="",u.value=!1}catch(m){c.value=(d.value==="txt"?"TXT 解析失败:":"Markdown 解析失败:")+m.message}return}try{const m=JSON.parse(k);if(!m.id||!Array.isArray(m.children)){c.value="JSON 缺少 id 或 children 字段";return}r("import",m),s.value="",u.value=!1}catch(m){c.value="JSON 解析失败:"+m.message}}}function P(k){return 1+k.children.reduce((m,B)=>m+P(B),0)}const I=e.computed(()=>P(n.data)),C=e.computed(()=>l.value.length);function E(){const k=document.createElement("input");k.type="file",k.accept="application/json",k.onchange=()=>{var x;const m=(x=k.files)==null?void 0:x[0];if(!m)return;const B=new FileReader;B.onload=()=>{typeof B.result=="string"&&(s.value=B.result,M())},B.readAsText(m)},k.click()}return(k,m)=>(e.openBlock(),e.createElementBlock("div",rc,[e.createElementVNode("div",ic,[e.createElementVNode("div",lc,[m[8]||(m[8]=e.createElementVNode("span",{class:"zm-data-title-text"},"数据 JSON",-1)),e.createElementVNode("span",ac,e.toDisplayString(I.value)+" 节点 · "+e.toDisplayString(C.value)+" chars",1)])]),e.createElementVNode("div",sc,[e.createElementVNode("button",{class:e.normalizeClass(["zm-data-btn is-icon",{"is-success":g.value==="copied"}]),title:g.value==="copied"?"已复制":"复制 JSON 到剪贴板",onClick:N},[g.value==="idle"?(e.openBlock(),e.createElementBlock("svg",dc,[...m[9]||(m[9]=[e.createElementVNode("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"},null,-1),e.createElementVNode("path",{d:"M5 15 H4 a2 2 0 0 1 -2 -2 V4 a2 2 0 0 1 2 -2 h9 a2 2 0 0 1 2 2 v1"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",uc,[...m[10]||(m[10]=[e.createElementVNode("polyline",{points:"5 12 10 17 19 7"},null,-1)])])),m[11]||(m[11]=e.createElementVNode("span",{class:"zm-data-btn-label"},"复制",-1))],10,cc),e.createElementVNode("button",{class:"zm-data-btn is-icon",title:"导出为 JSON 文件",onClick:$},[...m[12]||(m[12]=[e.createStaticVNode('<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 4 V15"></path><polyline points="7 9 12 4 17 9"></polyline><path d="M4 19 H20"></path></svg><span class="zm-data-btn-label">导出</span>',2)])]),e.createElementVNode("button",{class:"zm-data-btn is-icon",title:"从 JSON 文件导入",onClick:E},[...m[13]||(m[13]=[e.createStaticVNode('<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 15 V4"></path><polyline points="7 9 12 4 17 9"></polyline><path d="M4 19 H20"></path></svg><span class="zm-data-btn-label">导入</span>',2)])]),e.createElementVNode("button",{class:e.normalizeClass(["zm-data-btn is-icon",{"is-active":u.value}]),title:"粘贴 JSON 或 Markdown 替换当前数据",onClick:m[0]||(m[0]=B=>u.value=!u.value)},[...m[14]||(m[14]=[e.createStaticVNode('<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 4 H15 V8 H9 Z"></path><path d="M9 8 H4 V20 H9"></path><path d="M15 8 H20 V20 H15"></path></svg><span class="zm-data-btn-label">粘贴</span>',2)])],2),m[16]||(m[16]=e.createElementVNode("div",{class:"zm-data-toolbar-spacer"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["zm-data-search",{"is-active":w.value.length>0}])},[m[15]||(m[15]=e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"}),e.createElementVNode("line",{x1:"20",y1:"20",x2:"16",y2:"16"})],-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":m[1]||(m[1]=B=>w.value=B),type:"text",placeholder:"过滤 (键 / 值)",spellcheck:"false"},null,512),[[e.vModelText,w.value]]),w.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-data-search-clear",title:"清空过滤",onClick:m[2]||(m[2]=B=>w.value="")},"×")):e.createCommentVNode("",!0)],2)]),u.value?(e.openBlock(),e.createElementBlock("div",fc,[e.createElementVNode("div",mc,[e.createElementVNode("button",{class:e.normalizeClass(["zm-data-tab",{"is-active":d.value==="json"}]),onClick:m[3]||(m[3]=B=>d.value="json")},"JSON",2),e.createElementVNode("button",{class:e.normalizeClass(["zm-data-tab",{"is-active":d.value==="markdown"}]),onClick:m[4]||(m[4]=B=>d.value="markdown")},"Markdown",2)]),e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":m[5]||(m[5]=B=>s.value=B),placeholder:d.value==="json"?"paste a JSON tree to replace current data":"paste markdown - # / ## / ### become nodes",spellcheck:"false"},null,8,pc),[[e.vModelText,s.value]]),c.value?(e.openBlock(),e.createElementBlock("div",gc,e.toDisplayString(c.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",hc,[e.createElementVNode("button",{class:"zm-data-btn is-primary",disabled:!s.value,onClick:M},"应用",8,bc),e.createElementVNode("button",{class:"zm-data-btn",onClick:m[6]||(m[6]=B=>{s.value="",c.value=null})},"清空"),e.createElementVNode("button",{class:"zm-data-btn",onClick:m[7]||(m[7]=B=>u.value=!1)},"关闭")])])):e.createCommentVNode("",!0),e.createElementVNode("div",kc,[e.createVNode(oc,{value:t.data,query:w.value,"collapsed-paths":b.value},null,8,["value","query","collapsed-paths"])]),m[17]||(m[17]=e.createElementVNode("div",{class:"zm-data-footer"},[e.createElementVNode("span",{class:"zm-data-footer-hint"},[e.createTextVNode(" 图片支持 "),e.createElementVNode("code",null,"data:image/..."),e.createTextVNode(" / "),e.createElementVNode("code",null,"https://..."),e.createTextVNode(" / "),e.createElementVNode("code",null,"/imgs/foo.png"),e.createTextVNode(" (同源)。本地 "),e.createElementVNode("code",null,"file://"),e.createTextVNode(" 路径被浏览器拒绝。 ")])],-1))]))}}),yc={class:"zm-md-panel"},Ec={key:0,class:"zm-md-error"},xc={class:"zm-md-split"},wc={class:"zm-md-edit"},Nc={class:"zm-md-preview"},Sc={class:"zm-md-preview-body"},Tc={class:"zm-md-footer"},Cc=["disabled"],Ac=`# flow-mindmap 思维导图
24
15
 
25
16
  [GitHub 仓库](https://github.com/xz333221/flow-mindmap)
26
17
 
@@ -59,77 +50,89 @@ https://github.com/highlightjs/highlight.js/issues/2277`),ae=w,Y=P),V===void 0&&
59
50
 
60
51
  ## 开源协议
61
52
  [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0)
62
- `,Lo=e.defineComponent({__name:"MarkdownPanel",props:{data:{}},emits:["import"],setup(t,{emit:o}){const n=t,i=o,r=e.ref(Qt(n.data)),s=e.ref(null),c=e.ref(null),u=e.computed(()=>{try{const C=Jt(r.value||"");return s.value=null,C}catch(C){return s.value=C.message,{id:"preview_fallback",text:r.value||"(空)",children:[]}}}),d=e.computed(()=>ct(u.value));let f=null;e.watch(r,()=>{f&&clearTimeout(f),f=setTimeout(()=>{var C;return(C=c.value)==null?void 0:C.resetView()},250)});function p(){try{const C=Jt(r.value||"");s.value=null,i("import",C)}catch(C){s.value=C.message}}function k(){r.value=Qt(n.data),s.value=null,e.nextTick(()=>{var C;return(C=c.value)==null?void 0:C.resetView()})}function y(){r.value="",s.value=null,e.nextTick(()=>{var C;return(C=c.value)==null?void 0:C.resetView()})}function N(){const C=document.createElement("input");C.type="file",C.accept=".md,text/markdown,text/plain",C.onchange=()=>{var S;const x=(S=C.files)==null?void 0:S[0];if(!x)return;const R=new FileReader;R.onload=()=>{typeof R.result=="string"&&(r.value=R.result,s.value=null,e.nextTick(()=>{var g;return(g=c.value)==null?void 0:g.resetView()}))},R.readAsText(x)},C.click()}function E(){const C=new Blob([r.value],{type:"text/markdown;charset=utf-8"}),x=URL.createObjectURL(C),R=document.createElement("a");R.href=x;const S=(n.data.text||"mindmap").trim()||"mindmap";R.download=`${S}.md`,R.click(),URL.revokeObjectURL(x)}function L(){r.value=Wc,s.value=null,e.nextTick(()=>{var C;return(C=c.value)==null?void 0:C.resetView()})}return(C,x)=>(e.openBlock(),e.createElementBlock("div",Lc,[e.createElementVNode("div",{class:"zm-md-toolbar"},[e.createElementVNode("button",{class:"zm-md-btn",title:"从 .md 文件加载",onClick:N},[...x[1]||(x[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:E},[...x[2]||(x[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)])]),x[3]||(x[3]=e.createElementVNode("span",{class:"zm-md-spacer"},null,-1)),e.createElementVNode("button",{class:"zm-md-btn",title:"用示例内容填充",onClick:L},"示例"),e.createElementVNode("button",{class:"zm-md-btn",title:"覆盖为当前导图",onClick:k},"同步"),e.createElementVNode("button",{class:"zm-md-btn",title:"清空",onClick:y},"清空")]),s.value?(e.openBlock(),e.createElementBlock("div",Dc,e.toDisplayString(s.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Vc,[e.createElementVNode("div",$c,[x[4]||(x[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":x[0]||(x[0]=R=>r.value=R),class:"zm-md-textarea",spellcheck:"false",placeholder:"# 标题…"},null,512),[[e.vModelText,r.value]])]),e.createElementVNode("div",Pc,[x[5]||(x[5]=e.createElementVNode("div",{class:"zm-md-pane-header"},[e.createElementVNode("span",null,"导图预览"),e.createElementVNode("span",{class:"zm-md-hint"},"只读")],-1)),e.createElementVNode("div",Fc,[e.createVNode(Xn,{ref_key:"previewRef",ref:c,data:d.value,readonly:"","preview-mode":""},null,8,["data"])])])]),e.createElementVNode("div",Uc,[e.createElementVNode("button",{class:"zm-md-btn is-primary",disabled:!r.value.trim(),onClick:p},"应用到导图",8,Hc)])]))}}),Gc={class:"zm-settings-panel"},jc={key:0,class:"zm-settings-section"},Kc={class:"zm-settings-row"},qc=["value"],Yc={class:"zm-slider"},Xc=["value"],Zc={class:"zm-settings-row"},Jc=["value"],Qc={class:"zm-slider"},ed=["value"],td={class:"zm-settings-row"},nd={class:"zm-line-style-group"},od=["title","onClick"],id=["viewBox"],rd={key:0,d:"M 0 12 C 8 0, 20 0, 28 12",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},ld={key:1,x1:"0",y1:"12",x2:"28",y2:"12",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},ad={class:"zm-line-style-label"},sd={class:"zm-settings-row"},cd={key:0,class:"zm-palette-picker"},dd={class:"zm-palette-grid"},ud=["title","onClick"],fd={class:"zm-palette-card-name"},md={class:"zm-palette-card-swatches"},pd={key:0,class:"zm-palette-customs"},gd=["title","onClick"],hd={class:"zm-palette-card-name"},bd={class:"zm-palette-card-swatches"},kd=["value","onInput"],yd={class:"zm-palette-custom-actions"},Ed=["onClick"],xd=["onClick"],wd={class:"zm-settings-row"},Nd={class:"zm-settings-row"},Sd={class:"zm-settings-preview"},Td={viewBox:"0 0 200 70",width:"100%",height:"70",preserveAspectRatio:"none"},Cd=["x1","y1","x2","y2","stroke","stroke-width"],_d={key:1,class:"zm-settings-section"},Ad={class:"zm-settings-row"},Md={class:"zm-settings-value-tag"},Rd={class:"zm-settings-row"},Bd={class:"zm-settings-value-tag"},zd={class:"zm-settings-row"},Id={class:"zm-settings-value-tag"},Od={class:"zm-settings-row"},vd={key:2,class:"zm-settings-section"},Ld={class:"zm-settings-section-title"},Dd={key:0,class:"zm-settings-section-sub"},Vd={class:"zm-settings-row"},$d={class:"zm-settings-value-tag"},Pd={class:"zm-swatch-row"},Fd=["title","onClick"],Ud={class:"zm-settings-row"},Hd={class:"zm-settings-value-tag"},Wd={class:"zm-swatch-row"},Gd=["title","onClick"],jd={class:"zm-settings-row"},Kd={class:"zm-settings-section"},Do=((t,o)=>{const n=t.__vccOpts||t;for(const[i,r]of o)n[i]=r;return n})(e.defineComponent({__name:"SettingsPanel",props:{settings:{},hasSelection:{type:Boolean},selectedNodeText:{}},emits:["update:settings","update:nodeStyle","reset"],setup(t,{emit:o}){const n=t,i=o;function r(_,b){i("update:settings",{[_]:b})}e.computed(()=>{const _=n.settings.lineWidthStart;return _<1.2?"细":_<2.5?"中":_<4?"粗":"极粗"}),e.computed(()=>{const _=n.settings.lineWidthEnd;return _<.6?"极细":_<1.2?"细":_<2?"中":"粗"});const s=[{value:"curve",label:"圆弧",viewBox:"0 0 28 14"},{value:"straight",label:"直线",viewBox:"0 0 28 14"}],c=e.reactive({fontWeight:400});function u(){i("update:nodeStyle",{...c})}function d(){c.bg=void 0,c.textColor=void 0,c.borderColor=void 0,c.fontWeight=400,i("update:nodeStyle",{...c})}const f=e.reactive({});function p(_){return f[_.id]===void 0&&(f[_.id]=_.colors.join(`
63
- `)),f[_.id]}function k(_){const b=f[_.id]??"",O=Il(b);if(O.length===0){f[_.id]=_.colors.join(`
64
- `);return}const W=n.settings.customPalettes.map(ne=>ne.id===_.id?{...ne,colors:O}:ne);i("update:settings",{customPalettes:W})}function y(){const _=E.value.find(pe=>pe.id===n.settings.branchPaletteId),b=_?[..._.colors]:[..._t[0].colors],O="custom-";let W=O+(n.settings.customPalettes.length+1);for(;_t.some(pe=>pe.id===W)||n.settings.customPalettes.some(pe=>pe.id===W);)W=O+Math.random().toString(36).slice(2,7);const ne={id:W,name:`我的配色 ${n.settings.customPalettes.length+1}`,colors:b};i("update:settings",{customPalettes:[...n.settings.customPalettes,ne],branchPaletteId:W}),f[W]=b.join(`
65
- `)}function N(_){const b=n.settings.customPalettes.filter(W=>W.id!==_.id),O=n.settings.branchPaletteId===_.id?"default":n.settings.branchPaletteId;i("update:settings",{customPalettes:b,...O!==n.settings.branchPaletteId?{branchPaletteId:O}:{}}),delete f[_.id]}const E=e.computed(()=>[..._t,...n.settings.customPalettes]),L=["#f87171","#fb923c","#fbbf24","#a3e635","#34d399","#22d3ee","#818cf8","#c084fc","#1e2937","#f8fafc","#94a3b8"],C=[0,1,2,3],x=["#f87171","#fb923c","#34d399","#818cf8"];function R(_,b,O,W){if(b<=1)return O;const ne=_/(b-1);return O+(W-O)*ne}function S(_,b,O){return _<=0?b:_===1?Math.max(1.5,b*.67):_===2?Math.max(.8,b*.42):O}const g=e.computed(()=>{const _=n.settings.lineWidthStart,b=n.settings.lineWidthEnd,O=n.settings.taperedEdge,W=C.length,ne=8,pe=192,K=E.value.find(F=>F.id===n.settings.branchPaletteId),ie=K&&K.colors.length?K.colors:x;return C.map((F,q)=>{const U=10+q*60/(W-1);return{x1:ne,y1:U,x2:pe,y2:U,w:O?S(F,_,b):R(F,W,_,b),color:n.settings.rainbowBranch?ie[q%ie.length]:"#94a3b8"}})});return(_,b)=>(e.openBlock(),e.createElementBlock("div",Gc,[t.hasSelection?(e.openBlock(),e.createElementBlock("section",_d,[b[32]||(b[32]=e.createElementVNode("h4",{class:"zm-settings-section-title"},"画布",-1)),e.createElementVNode("div",Ad,[b[27]||(b[27]=e.createElementVNode("span",{class:"zm-settings-label"},"线条粗端",-1)),e.createElementVNode("span",Md,e.toDisplayString(t.settings.lineWidthStart.toFixed(1)),1)]),e.createElementVNode("div",Rd,[b[28]||(b[28]=e.createElementVNode("span",{class:"zm-settings-label"},"线条细端",-1)),e.createElementVNode("span",Bd,e.toDisplayString(t.settings.lineWidthEnd.toFixed(1)),1)]),e.createElementVNode("div",zd,[b[29]||(b[29]=e.createElementVNode("span",{class:"zm-settings-label"},"线条类型",-1)),e.createElementVNode("span",Id,e.toDisplayString(t.settings.lineStyle==="curve"?"圆弧":"直线"),1)]),e.createElementVNode("label",Od,[b[31]||(b[31]=e.createElementVNode("span",{class:"zm-settings-label"},"一级分支彩虹色",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.rainbowBranch}]),onClick:b[7]||(b[7]=O=>r("rainbowBranch",!t.settings.rainbowBranch))},[...b[30]||(b[30]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),b[33]||(b[33]=e.createElementVNode("p",{class:"zm-settings-hint"},"画布级别的设置会影响整张图。",-1))])):(e.openBlock(),e.createElementBlock("section",jc,[b[23]||(b[23]=e.createElementVNode("h4",{class:"zm-settings-section-title"},"画布",-1)),e.createElementVNode("div",Kc,[b[12]||(b[12]=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:b[0]||(b[0]=O=>r("lineWidthStart",parseFloat(O.target.value)||0))},null,40,qc)]),e.createElementVNode("div",Yc,[e.createElementVNode("input",{type:"range",min:"0.4",max:"20",step:"0.2",value:t.settings.lineWidthStart,onInput:b[1]||(b[1]=O=>r("lineWidthStart",parseFloat(O.target.value)))},null,40,Xc)]),e.createElementVNode("div",Zc,[b[13]||(b[13]=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:b[2]||(b[2]=O=>r("lineWidthEnd",parseFloat(O.target.value)||0))},null,40,Jc)]),e.createElementVNode("div",Qc,[e.createElementVNode("input",{type:"range",min:"0.2",max:"6",step:"0.1",value:t.settings.lineWidthEnd,onInput:b[3]||(b[3]=O=>r("lineWidthEnd",parseFloat(O.target.value)))},null,40,ed)]),e.createElementVNode("div",td,[b[14]||(b[14]=e.createElementVNode("span",{class:"zm-settings-label"},"线条类型",-1)),e.createElementVNode("div",nd,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(s,O=>e.createElementVNode("button",{key:O.value,class:e.normalizeClass(["zm-line-style-btn",{"is-on":t.settings.lineStyle===O.value}]),title:O.label,onClick:W=>r("lineStyle",O.value)},[(e.openBlock(),e.createElementBlock("svg",{viewBox:O.viewBox,width:"28",height:"14",preserveAspectRatio:"none"},[O.value==="curve"?(e.openBlock(),e.createElementBlock("path",rd)):(e.openBlock(),e.createElementBlock("line",ld))],8,id)),e.createElementVNode("span",ad,e.toDisplayString(O.label),1)],10,od)),64))])]),e.createElementVNode("label",sd,[b[16]||(b[16]=e.createElementVNode("span",{class:"zm-settings-label"},"一级分支彩虹色",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.rainbowBranch}]),onClick:b[4]||(b[4]=O=>r("rainbowBranch",!t.settings.rainbowBranch))},[...b[15]||(b[15]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),b[24]||(b[24]=e.createElementVNode("p",{class:"zm-settings-hint"},"关闭时所有线条使用统一的 lineColor。",-1)),t.settings.rainbowBranch?(e.openBlock(),e.createElementBlock("div",cd,[b[17]||(b[17]=e.createElementVNode("h5",{class:"zm-palette-picker-title"},"配色方案",-1)),e.createElementVNode("div",dd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(_t),O=>(e.openBlock(),e.createElementBlock("button",{key:O.id,type:"button",class:e.normalizeClass(["zm-palette-card",{"is-active":t.settings.branchPaletteId===O.id}]),title:O.name,onClick:W=>r("branchPaletteId",O.id)},[e.createElementVNode("span",fd,e.toDisplayString(O.name),1),e.createElementVNode("span",md,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(O.colors,(W,ne)=>(e.openBlock(),e.createElementBlock("span",{key:ne,class:"zm-palette-card-swatch",style:e.normalizeStyle({background:W})},null,4))),128))])],10,ud))),128))]),t.settings.customPalettes.length?(e.openBlock(),e.createElementBlock("div",pd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.settings.customPalettes,O=>(e.openBlock(),e.createElementBlock("div",{key:O.id,class:"zm-palette-custom"},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["zm-palette-card",{"is-active":t.settings.branchPaletteId===O.id}]),title:O.name,onClick:W=>r("branchPaletteId",O.id)},[e.createElementVNode("span",hd,e.toDisplayString(O.name),1),e.createElementVNode("span",bd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(O.colors,(W,ne)=>(e.openBlock(),e.createElementBlock("span",{key:ne,class:"zm-palette-card-swatch",style:e.normalizeStyle({background:W})},null,4))),128))])],10,gd),e.createElementVNode("textarea",{class:"zm-palette-textarea",rows:"2",spellcheck:"false",placeholder:"一行一个 hex,例如 #f87171",value:p(O),onInput:W=>f[O.id]=W.target.value},null,40,kd),e.createElementVNode("div",yd,[e.createElementVNode("button",{type:"button",class:"zm-data-btn is-primary",onClick:W=>k(O)},"保存",8,Ed),e.createElementVNode("button",{type:"button",class:"zm-data-btn",onClick:W=>N(O)},"删除",8,xd)])]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"zm-palette-add",onClick:y},"+ 新建配色")])):e.createCommentVNode("",!0),e.createElementVNode("label",wd,[b[19]||(b[19]=e.createElementVNode("span",{class:"zm-settings-label"},"每条连线独立渐变",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.taperedEdge}]),onClick:b[5]||(b[5]=O=>r("taperedEdge",!t.settings.taperedEdge))},[...b[18]||(b[18]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),b[25]||(b[25]=e.createElementVNode("p",{class:"zm-settings-hint"}," 开启时每条边都从根部粗端收回到细端子端,父子边之间可能形成粗细跳变; 关闭时整棵树从最粗平滑过渡到最细,所有边连成一条带子。 ",-1)),e.createElementVNode("label",Nd,[b[21]||(b[21]=e.createElementVNode("span",{class:"zm-settings-label"},"显示节点序号",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.showOrderBadge}]),onClick:b[6]||(b[6]=O=>r("showOrderBadge",!t.settings.showOrderBadge))},[...b[20]||(b[20]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),b[26]||(b[26]=e.createElementVNode("p",{class:"zm-settings-hint"}," 在每个节点右上角标注它是同级中的第几个 (1, 2, 3, ...), 方便对比画布位置与数据顺序。 ",-1)),e.createElementVNode("div",Sd,[(e.openBlock(),e.createElementBlock("svg",Td,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(O,W)=>(e.openBlock(),e.createElementBlock("line",{key:W,x1:O.x1,y1:O.y1,x2:O.x2,y2:O.y2,stroke:t.settings.rainbowBranch?O.color:"#94a3b8","stroke-width":O.w,"stroke-linecap":"butt"},null,8,Cd))),128))])),b[22]||(b[22]=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",vd,[e.createElementVNode("h4",Ld,[b[34]||(b[34]=e.createTextVNode(" 节点 ",-1)),t.selectedNodeText?(e.openBlock(),e.createElementBlock("span",Dd,"“"+e.toDisplayString(t.selectedNodeText)+"”",1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Vd,[b[35]||(b[35]=e.createElementVNode("span",{class:"zm-settings-label"},"背景颜色",-1)),e.createElementVNode("span",$d,e.toDisplayString(c.bg||"默认"),1)]),e.createElementVNode("div",Pd,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(L,O=>e.createElementVNode("button",{key:"bg-"+O,class:"zm-swatch",style:e.normalizeStyle({background:O}),title:O,onClick:W=>c.bg=O},null,12,Fd)),64)),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"清除",onClick:b[8]||(b[8]=O=>c.bg=void 0)},"∅")]),e.createElementVNode("div",Ud,[b[36]||(b[36]=e.createElementVNode("span",{class:"zm-settings-label"},"文字颜色",-1)),e.createElementVNode("span",Hd,e.toDisplayString(c.textColor||"默认"),1)]),e.createElementVNode("div",Wd,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(L,O=>e.createElementVNode("button",{key:"fg-"+O,class:"zm-swatch",style:e.normalizeStyle({background:O}),title:O,onClick:W=>c.textColor=O},null,12,Gd)),64)),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"清除",onClick:b[9]||(b[9]=O=>c.textColor=void 0)},"∅")]),e.createElementVNode("div",jd,[b[38]||(b[38]=e.createElementVNode("span",{class:"zm-settings-label"},"字重",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":c.fontWeight===600}]),onClick:b[10]||(b[10]=O=>c.fontWeight=c.fontWeight===600?400:600)},[...b[37]||(b[37]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),e.createElementVNode("div",{class:"zm-data-paste-actions"},[e.createElementVNode("button",{class:"zm-data-btn is-primary",onClick:u},"应用到该节点"),e.createElementVNode("button",{class:"zm-data-btn",onClick:d},"清除该节点样式")]),b[39]||(b[39]=e.createElementVNode("p",{class:"zm-settings-hint"},"仅作用于当前节点,不影响子节点。",-1))])):e.createCommentVNode("",!0),e.createElementVNode("section",Kd,[e.createElementVNode("button",{class:"zm-settings-reset",onClick:b[11]||(b[11]=O=>i("reset"))},"恢复默认设置")])]))}}),[["__scopeId","data-v-17ef65d1"]]),mr=20;function qd(t,o){t.style.height="auto";const n=o.minRows*mr,i=o.maxRows>0?o.maxRows*mr:1/0,r=Math.max(n,Math.min(i,t.scrollHeight));t.style.height=r+"px",t.style.overflowY=t.scrollHeight>i?"auto":"hidden"}function Vo(t,o={}){const n={minRows:o.minRows??3,maxRows:o.maxRows??12};function i(){const s=t.value;s&&qd(s,n)}function r(){i()}e.onMounted(async()=>{await e.nextTick();const s=t.value;s&&(s.addEventListener("input",r),i())}),e.watch(()=>{var s;return(s=t.value)==null?void 0:s.value},()=>i()),e.onBeforeUnmount(()=>{const s=t.value;s&&s.removeEventListener("input",r)})}function $o(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Gt=$o();function pr(t){Gt=t}var jt={exec:()=>null};function an(t){let o=[];return n=>{let i=Math.max(0,Math.min(3,n-1)),r=o[i];return r||(r=t(i),o[i]=r),r}}function he(t,o=""){let n=typeof t=="string"?t:t.source,i={replace:(r,s)=>{let c=typeof s=="string"?s:s.source;return c=c.replace(Ge.caret,"$1"),n=n.replace(r,c),i},getRegex:()=>new RegExp(n,o)};return i}var Yd=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),Ge={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:an(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:an(t=>new RegExp(`^ {0,${t}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:an(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:an(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:an(t=>new RegExp(`^ {0,${t}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:an(t=>new RegExp(`^ {0,${t}}>`))},Xd=/^(?:[ \t]*(?:\n|$))+/,Zd=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Jd=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,_n=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Qd=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Po=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,gr=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,hr=he(gr).replace(/bull/g,Po).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(),eu=he(gr).replace(/bull/g,Po).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(),Fo=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,tu=/^[^\n]+/,Uo=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,nu=he(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Uo).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ou=he(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Po).getRegex(),Zn="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",Ho=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,iu=he("^ {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",Ho).replace("tag",Zn).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),br=he(Fo).replace("hr",_n).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",Zn).getRegex(),ru=he(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",br).getRegex(),Wo={blockquote:ru,code:Zd,def:nu,fences:Jd,heading:Qd,hr:_n,html:iu,lheading:hr,list:ou,newline:Xd,paragraph:br,table:jt,text:tu},kr=he("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",_n).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",Zn).getRegex(),lu={...Wo,lheading:eu,table:kr,paragraph:he(Fo).replace("hr",_n).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",kr).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",Zn).getRegex()},au={...Wo,html:he(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ho).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:jt,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:he(Fo).replace("hr",_n).replace("heading",` *#{1,6} *[^
66
- ]`).replace("lheading",hr).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},su=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,cu=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,yr=/^( {2,}|\\)\n(?!\s*$)/,du=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,sn=/[\p{P}\p{S}]/u,Jn=/[\s\p{P}\p{S}]/u,Go=/[^\s\p{P}\p{S}]/u,uu=he(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Jn).getRegex(),Er=/(?!~)[\p{P}\p{S}]/u,fu=/(?!~)[\s\p{P}\p{S}]/u,mu=/(?:[^\s\p{P}\p{S}]|~)/u,pu=he(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Yd?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),xr=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,gu=he(xr,"u").replace(/punct/g,sn).getRegex(),hu=he(xr,"u").replace(/punct/g,Er).getRegex(),wr="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",bu=he(wr,"gu").replace(/notPunctSpace/g,Go).replace(/punctSpace/g,Jn).replace(/punct/g,sn).getRegex(),ku=he(wr,"gu").replace(/notPunctSpace/g,mu).replace(/punctSpace/g,fu).replace(/punct/g,Er).getRegex(),yu=he("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Go).replace(/punctSpace/g,Jn).replace(/punct/g,sn).getRegex(),Eu=he(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,sn).getRegex(),xu="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",wu=he(xu,"gu").replace(/notPunctSpace/g,Go).replace(/punctSpace/g,Jn).replace(/punct/g,sn).getRegex(),Nu=he(/\\(punct)/,"gu").replace(/punct/g,sn).getRegex(),Su=he(/^<(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(),Tu=he(Ho).replace("(?:-->|$)","-->").getRegex(),Cu=he("^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",Tu).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Qn=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,_u=he(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Qn).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Nr=he(/^!?\[(label)\]\[(ref)\]/).replace("label",Qn).replace("ref",Uo).getRegex(),Sr=he(/^!?\[(ref)\](?:\[\])?/).replace("ref",Uo).getRegex(),Au=he("reflink|nolink(?!\\()","g").replace("reflink",Nr).replace("nolink",Sr).getRegex(),Tr=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,jo={_backpedal:jt,anyPunctuation:Nu,autolink:Su,blockSkip:pu,br:yr,code:cu,del:jt,delLDelim:jt,delRDelim:jt,emStrongLDelim:gu,emStrongRDelimAst:bu,emStrongRDelimUnd:yu,escape:su,link:_u,nolink:Sr,punctuation:uu,reflink:Nr,reflinkSearch:Au,tag:Cu,text:du,url:jt},Mu={...jo,link:he(/^!?\[(label)\]\((.*?)\)/).replace("label",Qn).getRegex(),reflink:he(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Qn).getRegex()},Ko={...jo,emStrongRDelimAst:ku,emStrongLDelim:hu,delLDelim:Eu,delRDelim:wu,url:he(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Tr).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:he(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Tr).getRegex()},Ru={...Ko,br:he(yr).replace("{2,}","*").getRegex(),text:he(Ko.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},eo={normal:Wo,gfm:lu,pedantic:au},An={normal:jo,gfm:Ko,breaks:Ru,pedantic:Mu},Bu={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Cr=t=>Bu[t];function Et(t,o){if(o){if(Ge.escapeTest.test(t))return t.replace(Ge.escapeReplace,Cr)}else if(Ge.escapeTestNoEncode.test(t))return t.replace(Ge.escapeReplaceNoEncode,Cr);return t}function _r(t){try{t=encodeURI(t).replace(Ge.percentDecode,"%")}catch{return null}return t}function Ar(t,o){var s;let n=t.replace(Ge.findPipe,(c,u,d)=>{let f=!1,p=u;for(;--p>=0&&d[p]==="\\";)f=!f;return f?"|":" |"}),i=n.split(Ge.splitPipe),r=0;if(i[0].trim()||i.shift(),i.length>0&&!((s=i.at(-1))!=null&&s.trim())&&i.pop(),o)if(i.length>o)i.splice(o);else for(;i.length<o;)i.push("");for(;r<i.length;r++)i[r]=i[r].trim().replace(Ge.slashPipe,"|");return i}function It(t,o,n){let i=t.length;if(i===0)return"";let r=0;for(;r<i&&t.charAt(i-r-1)===o;)r++;return t.slice(0,i-r)}function Mr(t){let o=t.split(`
67
- `),n=o.length-1;for(;n>=0&&Ge.blankLine.test(o[n]);)n--;return o.length-n<=2?t:o.slice(0,n+1).join(`
68
- `)}function zu(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 Iu(t,o=0){let n=o,i="";for(let r of t)if(r===" "){let s=4-n%4;i+=" ".repeat(s),n+=s}else i+=r,n++;return i}function Rr(t,o,n,i,r){let s=o.href,c=o.title||null,u=t[1].replace(r.other.outputLinkReplace,"$1");i.state.inLink=!0;let d={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:s,title:c,text:u,tokens:i.inlineTokens(u)};return i.state.inLink=!1,d}function Ou(t,o,n){let i=t.match(n.other.indentCodeCompensation);if(i===null)return o;let r=i[1];return o.split(`
69
- `).map(s=>{let c=s.match(n.other.beginningSpace);if(c===null)return s;let[u]=c;return u.length>=r.length?s.slice(r.length):s}).join(`
70
- `)}var to=class{constructor(t){Ae(this,"options");Ae(this,"rules");Ae(this,"lexer");this.options=t||Gt}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]:Mr(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=Ou(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=It(n,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(n=i.trim())}return{type:"heading",raw:It(o[0],`
71
- `),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:It(o[0],`
72
- `)}}blockquote(t){let o=this.rules.block.blockquote.exec(t);if(o){let n=It(o[0],`
53
+ `,Lo=e.defineComponent({__name:"MarkdownPanel",props:{data:{}},emits:["import"],setup(t,{emit:o}){const n=t,r=o,l=e.ref(On(n.data)),s=e.ref(null),c=e.ref(null),u=e.computed(()=>{try{const I=zn(l.value||"");return s.value=null,I}catch(I){return s.value=I.message,{id:"preview_fallback",text:l.value||"(空)",children:[]}}}),d=e.computed(()=>_t(u.value));let g=null;e.watch(l,()=>{g&&clearTimeout(g),g=setTimeout(()=>{var I;return(I=c.value)==null?void 0:I.resetView()},250)});function b(){try{const I=zn(l.value||"");s.value=null,r("import",I)}catch(I){s.value=I.message}}function w(){l.value=On(n.data),s.value=null,e.nextTick(()=>{var I;return(I=c.value)==null?void 0:I.resetView()})}function N(){l.value="",s.value=null,e.nextTick(()=>{var I;return(I=c.value)==null?void 0:I.resetView()})}function $(){const I=document.createElement("input");I.type="file",I.accept=".md,text/markdown,text/plain",I.onchange=()=>{var k;const C=(k=I.files)==null?void 0:k[0];if(!C)return;const E=new FileReader;E.onload=()=>{typeof E.result=="string"&&(l.value=E.result,s.value=null,e.nextTick(()=>{var m;return(m=c.value)==null?void 0:m.resetView()}))},E.readAsText(C)},I.click()}function M(){const I=new Blob([l.value],{type:"text/markdown;charset=utf-8"}),C=URL.createObjectURL(I),E=document.createElement("a");E.href=C;const k=(n.data.text||"mindmap").trim()||"mindmap";E.download=`${k}.md`,E.click(),URL.revokeObjectURL(C)}function P(){l.value=Ac,s.value=null,e.nextTick(()=>{var I;return(I=c.value)==null?void 0:I.resetView()})}return(I,C)=>(e.openBlock(),e.createElementBlock("div",yc,[e.createElementVNode("div",{class:"zm-md-toolbar"},[e.createElementVNode("button",{class:"zm-md-btn",title:"从 .md 文件加载",onClick:$},[...C[1]||(C[1]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M12 4 V15"}),e.createElementVNode("polyline",{points:"7 9 12 4 17 9"}),e.createElementVNode("path",{d:"M4 19 H20"})],-1),e.createElementVNode("span",null,"加载 .md",-1)])]),e.createElementVNode("button",{class:"zm-md-btn",title:"把当前导图导出为 .md",onClick:M},[...C[2]||(C[2]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M12 15 V4"}),e.createElementVNode("polyline",{points:"7 9 12 4 17 9"}),e.createElementVNode("path",{d:"M4 19 H20"})],-1),e.createElementVNode("span",null,"导出 .md",-1)])]),C[3]||(C[3]=e.createElementVNode("span",{class:"zm-md-spacer"},null,-1)),e.createElementVNode("button",{class:"zm-md-btn",title:"用示例内容填充",onClick:P},"示例"),e.createElementVNode("button",{class:"zm-md-btn",title:"覆盖为当前导图",onClick:w},"同步"),e.createElementVNode("button",{class:"zm-md-btn",title:"清空",onClick:N},"清空")]),s.value?(e.openBlock(),e.createElementBlock("div",Ec,e.toDisplayString(s.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",xc,[e.createElementVNode("div",wc,[C[4]||(C[4]=e.createElementVNode("div",{class:"zm-md-pane-header"},[e.createElementVNode("span",null,"Markdown"),e.createElementVNode("span",{class:"zm-md-hint"},"# 根 · ## 一级 · ### 二级 …")],-1)),e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":C[0]||(C[0]=E=>l.value=E),class:"zm-md-textarea",spellcheck:"false",placeholder:"# 标题…"},null,512),[[e.vModelText,l.value]])]),e.createElementVNode("div",Nc,[C[5]||(C[5]=e.createElementVNode("div",{class:"zm-md-pane-header"},[e.createElementVNode("span",null,"导图预览"),e.createElementVNode("span",{class:"zm-md-hint"},"只读")],-1)),e.createElementVNode("div",Sc,[e.createVNode(Jo,{ref_key:"previewRef",ref:c,data:d.value,readonly:"","preview-mode":""},null,8,["data"])])])]),e.createElementVNode("div",Tc,[e.createElementVNode("button",{class:"zm-md-btn is-primary",disabled:!l.value.trim(),onClick:b},"应用到导图",8,Cc)])]))}}),_c={class:"zm-settings-panel"},Mc={class:"zm-settings-section"},vc={class:"zm-settings-field"},Rc={class:"zm-settings-control"},Bc={class:"zm-color-input-wrap"},Ic=["value"],zc={class:"zm-color-input-text"},Oc={class:"zm-swatch-row zm-swatch-row--compact"},Lc=["title","onClick"],Dc={class:"zm-settings-field"},Vc=["value"],$c={class:"zm-slider"},Pc=["value"],Uc={class:"zm-settings-field"},Fc=["value"],Hc={class:"zm-slider"},Wc=["value"],Gc={class:"zm-settings-field"},jc={class:"zm-line-style-group"},Kc=["title","onClick"],Yc=["viewBox"],qc={key:0,d:"M 0 12 C 8 0, 20 0, 28 12",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},Xc={key:1,x1:"0",y1:"12",x2:"28",y2:"12",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},Zc={class:"zm-line-style-label"},Jc={class:"zm-settings-field"},Qc={key:0,class:"zm-palette-dropdown"},ed={class:"zm-settings-field"},td=["value"],nd={label:"内置配色"},od=["value"],rd={key:0,label:"自定义"},id=["value"],ld={key:0,class:"zm-palette-preview-bar"},ad={key:1,class:"zm-palette-custom-editor"},sd=["value"],cd={class:"zm-palette-custom-actions"},dd={class:"zm-settings-field"},ud={class:"zm-settings-field"},fd={class:"zm-settings-preview"},md={viewBox:"0 0 200 70",width:"100%",height:"70",preserveAspectRatio:"none"},pd=["x1","y1","x2","y2","stroke","stroke-width"],gd={key:0,class:"zm-settings-section"},hd={class:"zm-settings-section-title"},bd={key:0,class:"zm-settings-section-sub"},kd={class:"zm-settings-field"},yd={class:"zm-settings-value-tag"},Ed={class:"zm-swatch-row"},xd=["title","onClick"],wd={class:"zm-swatch zm-swatch--custom",title:"自定义颜色"},Nd=["value"],Sd={class:"zm-settings-field"},Td={class:"zm-settings-value-tag"},Cd={class:"zm-swatch-row"},Ad=["title","onClick"],_d={class:"zm-swatch zm-swatch--custom",title:"自定义颜色"},Md=["value"],vd={class:"zm-settings-field"},Rd=["value"],Bd=["value"],Id={class:"zm-settings-field"},zd=["value"],Od={class:"zm-slider"},Ld=["value"],Dd={class:"zm-settings-section zm-settings-section--actions"},Do=((t,o)=>{const n=t.__vccOpts||t;for(const[r,l]of o)n[r]=l;return n})(e.defineComponent({__name:"SettingsPanel",props:{settings:{},hasSelection:{type:Boolean},selectedNodeText:{},nodeStyle:{}},emits:["update:settings","update:nodeStyle","reset"],setup(t,{emit:o}){const n=t,r=o;function l(B,x){r("update:settings",{[B]:x})}const s=[{value:"curve",label:"圆弧",viewBox:"0 0 28 14"},{value:"straight",label:"直线",viewBox:"0 0 28 14"}],c=[{value:100,label:"100"},{value:200,label:"200"},{value:300,label:"300"},{value:400,label:"400 (常规)"},{value:500,label:"500"},{value:600,label:"600 (半粗)"},{value:700,label:"700 (粗体)"},{value:800,label:"800"},{value:900,label:"900"}];function u(B){r("update:nodeStyle",B)}const d=e.computed(()=>[...en,...n.settings.customPalettes]),g=e.reactive({});function b(B){return g[B.id]===void 0&&(g[B.id]=B.colors.join(`
54
+ `)),g[B.id]}function w(B){const x=g[B.id]??"",K=Va(x);if(K.length===0){g[B.id]=B.colors.join(`
55
+ `);return}const Y=n.settings.customPalettes.map(ee=>ee.id===B.id?{...ee,colors:K}:ee);r("update:settings",{customPalettes:Y})}function N(){const B=d.value.find(ae=>ae.id===n.settings.branchPaletteId),x=B?[...B.colors]:[...en[0].colors],K="custom-";let Y=K+(n.settings.customPalettes.length+1);for(;en.some(ae=>ae.id===Y)||n.settings.customPalettes.some(ae=>ae.id===Y);)Y=K+Math.random().toString(36).slice(2,7);const ee={id:Y,name:`我的配色 ${n.settings.customPalettes.length+1}`,colors:x};r("update:settings",{customPalettes:[...n.settings.customPalettes,ee],branchPaletteId:Y}),g[Y]=x.join(`
56
+ `)}function $(B){const x=n.settings.customPalettes.filter(Y=>Y.id!==B.id),K=n.settings.branchPaletteId===B.id?"default":n.settings.branchPaletteId;r("update:settings",{customPalettes:x,...K!==n.settings.branchPaletteId?{branchPaletteId:K}:{}}),delete g[B.id]}const M=["#f87171","#fb923c","#fbbf24","#a3e635","#34d399","#22d3ee","#818cf8","#c084fc","#1e2937","#f8fafc","#94a3b8"],P=["#f8fafc","#ffffff","#e2e8f0","#1e2937","#0f172a","#fef3c7","#dbeafe","#dcfce7","#fce7f3","#f1f5f9"],I=[0,1,2,3],C=["#f87171","#fb923c","#34d399","#818cf8"];function E(B,x,K,Y){if(x<=1)return K;const ee=B/(x-1);return K+(Y-K)*ee}function k(B,x,K){return B<=0?x:B===1?Math.max(1.5,x*.67):B===2?Math.max(.8,x*.42):K}const m=e.computed(()=>{const B=n.settings.lineWidthStart,x=n.settings.lineWidthEnd,K=n.settings.taperedEdge,Y=I.length,ee=8,ae=192,re=d.value.find(Q=>Q.id===n.settings.branchPaletteId),q=re&&re.colors.length?re.colors:C;return I.map((Q,ie)=>{const z=10+ie*60/(Y-1);return{x1:ee,y1:z,x2:ae,y2:z,w:K?k(Q,B,x):E(Q,Y,B,x),color:n.settings.rainbowBranch?q[ie%q.length]:"#94a3b8"}})});return(B,x)=>{var K,Y,ee,ae,re,q,Q,ie;return e.openBlock(),e.createElementBlock("div",_c,[e.createElementVNode("section",Mc,[x[35]||(x[35]=e.createElementVNode("h4",{class:"zm-settings-section-title"},"画布",-1)),e.createElementVNode("div",vc,[x[21]||(x[21]=e.createElementVNode("span",{class:"zm-settings-label"},"画布背景色",-1)),e.createElementVNode("div",Rc,[e.createElementVNode("label",Bc,[e.createElementVNode("input",{type:"color",class:"zm-color-input",value:t.settings.canvasBg||"#f8fafc",onInput:x[0]||(x[0]=z=>l("canvasBg",z.target.value))},null,40,Ic),e.createElementVNode("span",zc,e.toDisplayString(t.settings.canvasBg||"默认"),1)])])]),e.createElementVNode("div",Oc,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(P,z=>e.createElementVNode("button",{key:"cbg-"+z,class:e.normalizeClass(["zm-swatch",{"is-active":(t.settings.canvasBg||"#f8fafc")===z}]),style:e.normalizeStyle({background:z}),title:z,onClick:A=>l("canvasBg",z)},null,14,Lc)),64)),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"恢复默认",onClick:x[1]||(x[1]=z=>l("canvasBg",void 0))},"∅")]),x[36]||(x[36]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",Dc,[x[22]||(x[22]=e.createElementVNode("span",{class:"zm-settings-label"},"线条粗端 (根部)",-1)),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"0.2",value:t.settings.lineWidthStart,onChange:x[2]||(x[2]=z=>l("lineWidthStart",parseFloat(z.target.value)||0))},null,40,Vc)]),e.createElementVNode("div",$c,[x[23]||(x[23]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"0.4",max:"20",step:"0.2",value:t.settings.lineWidthStart,onInput:x[3]||(x[3]=z=>l("lineWidthStart",parseFloat(z.target.value)))},null,40,Pc)]),e.createElementVNode("div",Uc,[x[24]||(x[24]=e.createElementVNode("span",{class:"zm-settings-label"},"线条细端 (子端)",-1)),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"0.2",value:t.settings.lineWidthEnd,onChange:x[4]||(x[4]=z=>l("lineWidthEnd",parseFloat(z.target.value)||0))},null,40,Fc)]),e.createElementVNode("div",Hc,[x[25]||(x[25]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"0.2",max:"6",step:"0.1",value:t.settings.lineWidthEnd,onInput:x[5]||(x[5]=z=>l("lineWidthEnd",parseFloat(z.target.value)))},null,40,Wc)]),x[37]||(x[37]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",Gc,[x[26]||(x[26]=e.createElementVNode("span",{class:"zm-settings-label"},"线条类型",-1)),e.createElementVNode("div",jc,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(s,z=>e.createElementVNode("button",{key:z.value,class:e.normalizeClass(["zm-line-style-btn",{"is-on":t.settings.lineStyle===z.value}]),title:z.label,onClick:A=>l("lineStyle",z.value)},[(e.openBlock(),e.createElementBlock("svg",{viewBox:z.viewBox,width:"28",height:"14",preserveAspectRatio:"none"},[z.value==="curve"?(e.openBlock(),e.createElementBlock("path",qc)):(e.openBlock(),e.createElementBlock("line",Xc))],8,Yc)),e.createElementVNode("span",Zc,e.toDisplayString(z.label),1)],10,Kc)),64))])]),e.createElementVNode("div",Jc,[x[28]||(x[28]=e.createElementVNode("span",{class:"zm-settings-label"},"一级分支彩虹色",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.rainbowBranch}]),onClick:x[6]||(x[6]=z=>l("rainbowBranch",!t.settings.rainbowBranch))},[...x[27]||(x[27]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),t.settings.rainbowBranch?(e.openBlock(),e.createElementBlock("div",Qc,[e.createElementVNode("div",ed,[x[29]||(x[29]=e.createElementVNode("span",{class:"zm-settings-label"},"配色方案",-1)),e.createElementVNode("select",{class:"zm-select",value:t.settings.branchPaletteId,onChange:x[7]||(x[7]=z=>l("branchPaletteId",z.target.value))},[e.createElementVNode("optgroup",nd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(en),z=>(e.openBlock(),e.createElementBlock("option",{key:z.id,value:z.id},e.toDisplayString(z.name),9,od))),128))]),t.settings.customPalettes.length?(e.openBlock(),e.createElementBlock("optgroup",rd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.settings.customPalettes,z=>(e.openBlock(),e.createElementBlock("option",{key:z.id,value:z.id},e.toDisplayString(z.name),9,id))),128))])):e.createCommentVNode("",!0)],40,td)]),d.value.find(z=>z.id===t.settings.branchPaletteId)?(e.openBlock(),e.createElementBlock("div",ld,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((K=d.value.find(z=>z.id===t.settings.branchPaletteId))==null?void 0:K.colors,(z,A)=>(e.openBlock(),e.createElementBlock("span",{key:A,class:"zm-palette-preview-swatch",style:e.normalizeStyle({background:z})},null,4))),128))])):e.createCommentVNode("",!0),t.settings.customPalettes.find(z=>z.id===t.settings.branchPaletteId)?(e.openBlock(),e.createElementBlock("div",ad,[e.createElementVNode("textarea",{class:"zm-palette-textarea",rows:"3",spellcheck:"false",placeholder:"一行一个 hex,例如 #f87171",value:b(t.settings.customPalettes.find(z=>z.id===t.settings.branchPaletteId)),onInput:x[8]||(x[8]=z=>g[t.settings.customPalettes.find(A=>A.id===t.settings.branchPaletteId).id]=z.target.value)},null,40,sd),e.createElementVNode("div",cd,[e.createElementVNode("button",{type:"button",class:"zm-data-btn is-primary",onClick:x[9]||(x[9]=z=>w(t.settings.customPalettes.find(A=>A.id===t.settings.branchPaletteId)))},"保存"),e.createElementVNode("button",{type:"button",class:"zm-data-btn",onClick:x[10]||(x[10]=z=>$(t.settings.customPalettes.find(A=>A.id===t.settings.branchPaletteId)))},"删除")])])):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"zm-palette-add",onClick:N},"+ 新建配色")])):e.createCommentVNode("",!0),x[38]||(x[38]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",dd,[x[31]||(x[31]=e.createElementVNode("span",{class:"zm-settings-label"},"每条连线独立渐变",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.taperedEdge}]),onClick:x[11]||(x[11]=z=>l("taperedEdge",!t.settings.taperedEdge))},[...x[30]||(x[30]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),e.createElementVNode("div",ud,[x[33]||(x[33]=e.createElementVNode("span",{class:"zm-settings-label"},"显示节点序号",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.showOrderBadge}]),onClick:x[12]||(x[12]=z=>l("showOrderBadge",!t.settings.showOrderBadge))},[...x[32]||(x[32]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),e.createElementVNode("div",fd,[(e.openBlock(),e.createElementBlock("svg",md,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(z,A)=>(e.openBlock(),e.createElementBlock("line",{key:A,x1:z.x1,y1:z.y1,x2:z.x2,y2:z.y2,stroke:t.settings.rainbowBranch?z.color:"#94a3b8","stroke-width":z.w,"stroke-linecap":"butt"},null,8,pd))),128))])),x[34]||(x[34]=e.createElementVNode("div",{class:"zm-settings-preview-labels"},[e.createElementVNode("span",null,"根"),e.createElementVNode("span",null,"1级"),e.createElementVNode("span",null,"2级"),e.createElementVNode("span",null,"3级")],-1))])]),t.hasSelection?(e.openBlock(),e.createElementBlock("section",gd,[e.createElementVNode("h4",hd,[x[39]||(x[39]=e.createTextVNode(" 节点 ",-1)),t.selectedNodeText?(e.openBlock(),e.createElementBlock("span",bd,'"'+e.toDisplayString(t.selectedNodeText)+'"',1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",kd,[x[40]||(x[40]=e.createElementVNode("span",{class:"zm-settings-label"},"背景颜色",-1)),e.createElementVNode("span",yd,e.toDisplayString(((Y=t.nodeStyle)==null?void 0:Y.bg)||"默认"),1)]),e.createElementVNode("div",Ed,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(M,z=>{var A;return e.createElementVNode("button",{key:"bg-"+z,class:e.normalizeClass(["zm-swatch",{"is-active":((A=t.nodeStyle)==null?void 0:A.bg)===z}]),style:e.normalizeStyle({background:z}),title:z,onClick:F=>u({bg:z})},null,14,xd)}),64)),e.createElementVNode("label",wd,[e.createElementVNode("input",{type:"color",value:((ee=t.nodeStyle)==null?void 0:ee.bg)||"#ffffff",onInput:x[13]||(x[13]=z=>u({bg:z.target.value}))},null,40,Nd)]),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"清除",onClick:x[14]||(x[14]=z=>u({bg:void 0}))},"∅")]),e.createElementVNode("div",Sd,[x[41]||(x[41]=e.createElementVNode("span",{class:"zm-settings-label"},"文字颜色",-1)),e.createElementVNode("span",Td,e.toDisplayString(((ae=t.nodeStyle)==null?void 0:ae.textColor)||"默认"),1)]),e.createElementVNode("div",Cd,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(M,z=>{var A;return e.createElementVNode("button",{key:"fg-"+z,class:e.normalizeClass(["zm-swatch",{"is-active":((A=t.nodeStyle)==null?void 0:A.textColor)===z}]),style:e.normalizeStyle({background:z}),title:z,onClick:F=>u({textColor:z})},null,14,Ad)}),64)),e.createElementVNode("label",_d,[e.createElementVNode("input",{type:"color",value:((re=t.nodeStyle)==null?void 0:re.textColor)||"#1e2937",onInput:x[15]||(x[15]=z=>u({textColor:z.target.value}))},null,40,Md)]),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"清除",onClick:x[16]||(x[16]=z=>u({textColor:void 0}))},"∅")]),x[45]||(x[45]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",vd,[x[42]||(x[42]=e.createElementVNode("span",{class:"zm-settings-label"},"字重",-1)),e.createElementVNode("select",{class:"zm-select",value:((q=t.nodeStyle)==null?void 0:q.fontWeight)??400,onChange:x[17]||(x[17]=z=>u({fontWeight:parseInt(z.target.value)}))},[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(c,z=>e.createElementVNode("option",{key:z.value,value:z.value},e.toDisplayString(z.label),9,Bd)),64))],40,Rd)]),e.createElementVNode("div",Id,[x[43]||(x[43]=e.createElementVNode("span",{class:"zm-settings-label"},"文字大小",-1)),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"1",min:"8",max:"48",value:((Q=t.nodeStyle)==null?void 0:Q.fontSize)??14,onChange:x[18]||(x[18]=z=>u({fontSize:parseInt(z.target.value)||14}))},null,40,zd)]),e.createElementVNode("div",Od,[x[44]||(x[44]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"8",max:"48",step:"1",value:((ie=t.nodeStyle)==null?void 0:ie.fontSize)??14,onInput:x[19]||(x[19]=z=>u({fontSize:parseInt(z.target.value)}))},null,40,Ld)]),x[46]||(x[46]=e.createElementVNode("p",{class:"zm-settings-hint"},"仅作用于当前节点,不影响子节点。",-1))])):e.createCommentVNode("",!0),e.createElementVNode("section",Dd,[e.createElementVNode("button",{class:"zm-settings-reset",onClick:x[20]||(x[20]=z=>r("reset"))},"恢复默认设置")])])}}}),[["__scopeId","data-v-3fc1672c"]]),ki=20;function Vd(t,o){t.style.height="auto";const n=o.minRows*ki,r=o.maxRows>0?o.maxRows*ki:1/0,l=Math.max(n,Math.min(r,t.scrollHeight));t.style.height=l+"px",t.style.overflowY=t.scrollHeight>r?"auto":"hidden"}function hr(t,o={}){const n={minRows:o.minRows??3,maxRows:o.maxRows??12};function r(){const s=t.value;s&&Vd(s,n)}function l(){r()}e.onMounted(async()=>{await e.nextTick();const s=t.value;s&&(s.addEventListener("input",l),r())}),e.watch(()=>{var s;return(s=t.value)==null?void 0:s.value},()=>r()),e.onBeforeUnmount(()=>{const s=t.value;s&&s.removeEventListener("input",l)})}function $d(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function yi(t){return t instanceof Map?t.clear=t.delete=t.set=function(){throw new Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=function(){throw new Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach(o=>{const n=t[o],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&yi(n)}),t}class Ei{constructor(o){o.data===void 0&&(o.data={}),this.data=o.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function xi(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function dn(t,...o){const n=Object.create(null);for(const r in t)n[r]=t[r];return o.forEach(function(r){for(const l in r)n[l]=r[l]}),n}const Pd="</span>",wi=t=>!!t.scope,Ud=(t,{prefix:o})=>{if(t.startsWith("language:"))return t.replace("language:","language-");if(t.includes(".")){const n=t.split(".");return[`${o}${n.shift()}`,...n.map((r,l)=>`${r}${"_".repeat(l+1)}`)].join(" ")}return`${o}${t}`};class Fd{constructor(o,n){this.buffer="",this.classPrefix=n.classPrefix,o.walk(this)}addText(o){this.buffer+=xi(o)}openNode(o){if(!wi(o))return;const n=Ud(o.scope,{prefix:this.classPrefix});this.span(n)}closeNode(o){wi(o)&&(this.buffer+=Pd)}value(){return this.buffer}span(o){this.buffer+=`<span class="${o}">`}}const Ni=(t={})=>{const o={children:[]};return Object.assign(o,t),o};class br{constructor(){this.rootNode=Ni(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(o){this.top.children.push(o)}openNode(o){const n=Ni({scope:o});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(o){return this.constructor._walk(o,this.rootNode)}static _walk(o,n){return typeof n=="string"?o.addText(n):n.children&&(o.openNode(n),n.children.forEach(r=>this._walk(o,r)),o.closeNode(n)),o}static _collapse(o){typeof o!="string"&&o.children&&(o.children.every(n=>typeof n=="string")?o.children=[o.children.join("")]:o.children.forEach(n=>{br._collapse(n)}))}}class Hd extends br{constructor(o){super(),this.options=o}addText(o){o!==""&&this.add(o)}startScope(o){this.openNode(o)}endScope(){this.closeNode()}__addSublanguage(o,n){const r=o.root;n&&(r.scope=`language:${n}`),this.add(r)}toHTML(){return new Fd(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function ro(t){return t?typeof t=="string"?t:t.source:null}function Si(t){return xn("(?=",t,")")}function Wd(t){return xn("(?:",t,")*")}function Gd(t){return xn("(?:",t,")?")}function xn(...t){return t.map(n=>ro(n)).join("")}function jd(t){const o=t[t.length-1];return typeof o=="object"&&o.constructor===Object?(t.splice(t.length-1,1),o):{}}function kr(...t){return"("+(jd(t).capture?"":"?:")+t.map(r=>ro(r)).join("|")+")"}function Ti(t){return new RegExp(t.toString()+"|").exec("").length-1}function Kd(t,o){const n=t&&t.exec(o);return n&&n.index===0}const Yd=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function yr(t,{joinWith:o}){let n=0;return t.map(r=>{n+=1;const l=n;let s=ro(r),c="";for(;s.length>0;){const u=Yd.exec(s);if(!u){c+=s;break}c+=s.substring(0,u.index),s=s.substring(u.index+u[0].length),u[0][0]==="\\"&&u[1]?c+="\\"+String(Number(u[1])+l):(c+=u[0],u[0]==="("&&n++)}return c}).map(r=>`(${r})`).join(o)}const qd=/\b\B/,Ci="[a-zA-Z]\\w*",Er="[a-zA-Z_]\\w*",Ai="\\b\\d+(\\.\\d+)?",_i="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Mi="\\b(0b[01]+)",Xd="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",Zd=(t={})=>{const o=/^#![ ]*\//;return t.binary&&(t.begin=xn(o,/.*\b/,t.binary,/\b.*/)),dn({scope:"meta",begin:o,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},t)},io={begin:"\\\\[\\s\\S]",relevance:0},Jd={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[io]},Qd={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[io]},eu={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Vo=function(t,o,n={}){const r=dn({scope:"comment",begin:t,end:o,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const l=kr("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:xn(/[ ]+/,"(",l,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},tu=Vo("//","$"),nu=Vo("/\\*","\\*/"),ou=Vo("#","$"),ru={scope:"number",begin:Ai,relevance:0},iu={scope:"number",begin:_i,relevance:0},lu={scope:"number",begin:Mi,relevance:0},au={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[io,{begin:/\[/,end:/\]/,relevance:0,contains:[io]}]},su={scope:"title",begin:Ci,relevance:0},cu={scope:"title",begin:Er,relevance:0},du={begin:"\\.\\s*"+Er,relevance:0};var $o=Object.freeze({__proto__:null,APOS_STRING_MODE:Jd,BACKSLASH_ESCAPE:io,BINARY_NUMBER_MODE:lu,BINARY_NUMBER_RE:Mi,COMMENT:Vo,C_BLOCK_COMMENT_MODE:nu,C_LINE_COMMENT_MODE:tu,C_NUMBER_MODE:iu,C_NUMBER_RE:_i,END_SAME_AS_BEGIN:function(t){return Object.assign(t,{"on:begin":(o,n)=>{n.data._beginMatch=o[1]},"on:end":(o,n)=>{n.data._beginMatch!==o[1]&&n.ignoreMatch()}})},HASH_COMMENT_MODE:ou,IDENT_RE:Ci,MATCH_NOTHING_RE:qd,METHOD_GUARD:du,NUMBER_MODE:ru,NUMBER_RE:Ai,PHRASAL_WORDS_MODE:eu,QUOTE_STRING_MODE:Qd,REGEXP_MODE:au,RE_STARTERS_RE:Xd,SHEBANG:Zd,TITLE_MODE:su,UNDERSCORE_IDENT_RE:Er,UNDERSCORE_TITLE_MODE:cu});function uu(t,o){t.input[t.index-1]==="."&&o.ignoreMatch()}function fu(t,o){t.className!==void 0&&(t.scope=t.className,delete t.className)}function mu(t,o){o&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=uu,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function pu(t,o){Array.isArray(t.illegal)&&(t.illegal=kr(...t.illegal))}function gu(t,o){if(t.match){if(t.begin||t.end)throw new Error("begin & end are not supported with match");t.begin=t.match,delete t.match}}function hu(t,o){t.relevance===void 0&&(t.relevance=1)}const bu=(t,o)=>{if(!t.beforeMatch)return;if(t.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},t);Object.keys(t).forEach(r=>{delete t[r]}),t.keywords=n.keywords,t.begin=xn(n.beforeMatch,Si(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},ku=["of","and","for","in","not","or","if","then","parent","list","value"],yu="keyword";function vi(t,o,n=yu){const r=Object.create(null);return typeof t=="string"?l(n,t.split(" ")):Array.isArray(t)?l(n,t):Object.keys(t).forEach(function(s){Object.assign(r,vi(t[s],o,s))}),r;function l(s,c){o&&(c=c.map(u=>u.toLowerCase())),c.forEach(function(u){const d=u.split("|");r[d[0]]=[s,Eu(d[0],d[1])]})}}function Eu(t,o){return o?Number(o):xu(t)?0:1}function xu(t){return ku.includes(t.toLowerCase())}const Ri={},wn=t=>{console.error(t)},Bi=(t,...o)=>{console.log(`WARN: ${t}`,...o)},Ln=(t,o)=>{Ri[`${t}/${o}`]||(console.log(`Deprecated as of ${t}. ${o}`),Ri[`${t}/${o}`]=!0)},Po=new Error;function Ii(t,o,{key:n}){let r=0;const l=t[n],s={},c={};for(let u=1;u<=o.length;u++)c[u+r]=l[u],s[u+r]=!0,r+=Ti(o[u-1]);t[n]=c,t[n]._emit=s,t[n]._multi=!0}function wu(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw wn("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Po;if(typeof t.beginScope!="object"||t.beginScope===null)throw wn("beginScope must be object"),Po;Ii(t,t.begin,{key:"beginScope"}),t.begin=yr(t.begin,{joinWith:""})}}function Nu(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw wn("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Po;if(typeof t.endScope!="object"||t.endScope===null)throw wn("endScope must be object"),Po;Ii(t,t.end,{key:"endScope"}),t.end=yr(t.end,{joinWith:""})}}function Su(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function Tu(t){Su(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),wu(t),Nu(t)}function Cu(t){function o(c,u){return new RegExp(ro(c),"m"+(t.case_insensitive?"i":"")+(t.unicodeRegex?"u":"")+(u?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(u,d){d.position=this.position++,this.matchIndexes[this.matchAt]=d,this.regexes.push([d,u]),this.matchAt+=Ti(u)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const u=this.regexes.map(d=>d[1]);this.matcherRe=o(yr(u,{joinWith:"|"}),!0),this.lastIndex=0}exec(u){this.matcherRe.lastIndex=this.lastIndex;const d=this.matcherRe.exec(u);if(!d)return null;const g=d.findIndex((w,N)=>N>0&&w!==void 0),b=this.matchIndexes[g];return d.splice(0,g),Object.assign(d,b)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(u){if(this.multiRegexes[u])return this.multiRegexes[u];const d=new n;return this.rules.slice(u).forEach(([g,b])=>d.addRule(g,b)),d.compile(),this.multiRegexes[u]=d,d}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(u,d){this.rules.push([u,d]),d.type==="begin"&&this.count++}exec(u){const d=this.getMatcher(this.regexIndex);d.lastIndex=this.lastIndex;let g=d.exec(u);if(this.resumingScanAtSamePosition()&&!(g&&g.index===this.lastIndex)){const b=this.getMatcher(0);b.lastIndex=this.lastIndex+1,g=b.exec(u)}return g&&(this.regexIndex+=g.position+1,this.regexIndex===this.count&&this.considerAll()),g}}function l(c){const u=new r;return c.contains.forEach(d=>u.addRule(d.begin,{rule:d,type:"begin"})),c.terminatorEnd&&u.addRule(c.terminatorEnd,{type:"end"}),c.illegal&&u.addRule(c.illegal,{type:"illegal"}),u}function s(c,u){const d=c;if(c.isCompiled)return d;[fu,gu,Tu,bu].forEach(b=>b(c,u)),t.compilerExtensions.forEach(b=>b(c,u)),c.__beforeBegin=null,[mu,pu,hu].forEach(b=>b(c,u)),c.isCompiled=!0;let g=null;return typeof c.keywords=="object"&&c.keywords.$pattern&&(c.keywords=Object.assign({},c.keywords),g=c.keywords.$pattern,delete c.keywords.$pattern),g=g||/\w+/,c.keywords&&(c.keywords=vi(c.keywords,t.case_insensitive)),d.keywordPatternRe=o(g,!0),u&&(c.begin||(c.begin=/\B|\b/),d.beginRe=o(d.begin),!c.end&&!c.endsWithParent&&(c.end=/\B|\b/),c.end&&(d.endRe=o(d.end)),d.terminatorEnd=ro(d.end)||"",c.endsWithParent&&u.terminatorEnd&&(d.terminatorEnd+=(c.end?"|":"")+u.terminatorEnd)),c.illegal&&(d.illegalRe=o(c.illegal)),c.contains||(c.contains=[]),c.contains=[].concat(...c.contains.map(function(b){return Au(b==="self"?c:b)})),c.contains.forEach(function(b){s(b,d)}),c.starts&&s(c.starts,u),d.matcher=l(d),d}if(t.compilerExtensions||(t.compilerExtensions=[]),t.contains&&t.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return t.classNameAliases=dn(t.classNameAliases||{}),s(t)}function zi(t){return t?t.endsWithParent||zi(t.starts):!1}function Au(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(o){return dn(t,{variants:null},o)})),t.cachedVariants?t.cachedVariants:zi(t)?dn(t,{starts:t.starts?dn(t.starts):null}):Object.isFrozen(t)?dn(t):t}var _u="11.11.1";class Mu extends Error{constructor(o,n){super(o),this.name="HTMLInjectionError",this.html=n}}const xr=xi,Oi=dn,Li=Symbol("nomatch"),vu=7,Di=function(t){const o=Object.create(null),n=Object.create(null),r=[];let l=!0;const s="Could not find the language '{}', did you forget to load/include a language module?",c={disableAutodetect:!0,name:"Plain text",contains:[]};let u={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:Hd};function d(A){return u.noHighlightRe.test(A)}function g(A){let F=A.className+" ";F+=A.parentNode?A.parentNode.className:"";const U=u.languageDetectRe.exec(F);if(U){const G=Y(U[1]);return G||(Bi(s.replace("{}",U[1])),Bi("Falling back to no-highlight mode for this block.",A)),G?U[1]:"no-highlight"}return F.split(/\s+/).find(G=>d(G)||Y(G))}function b(A,F,U){let G="",le="";typeof F=="object"?(G=A,U=F.ignoreIllegals,le=F.language):(Ln("10.7.0","highlight(lang, code, ...args) has been deprecated."),Ln("10.7.0",`Please use highlight(code, options) instead.
57
+ https://github.com/highlightjs/highlight.js/issues/2277`),le=A,G=F),U===void 0&&(U=!0);const Ne={code:G,language:le};ie("before:highlight",Ne);const _e=Ne.result?Ne.result:w(Ne.language,Ne.code,U);return _e.code=Ne.code,ie("after:highlight",_e),_e}function w(A,F,U,G){const le=Object.create(null);function Ne(H,Z){return H.keywords[Z]}function _e(){if(!J.keywords){Te.addText(Se);return}let H=0;J.keywordPatternRe.lastIndex=0;let Z=J.keywordPatternRe.exec(Se),ce="";for(;Z;){ce+=Se.substring(H,Z.index);const ke=je.case_insensitive?Z[0].toLowerCase():Z[0],ze=Ne(J,ke);if(ze){const[Qe,ht]=ze;if(Te.addText(ce),ce="",le[ke]=(le[ke]||0)+1,le[ke]<=vu&&(Bt+=ht),Qe.startsWith("_"))ce+=Z[0];else{const Mn=je.classNameAliases[Qe]||Qe;y(Z[0],Mn)}}else ce+=Z[0];H=J.keywordPatternRe.lastIndex,Z=J.keywordPatternRe.exec(Se)}ce+=Se.substring(H),Te.addText(ce)}function Re(){if(Se==="")return;let H=null;if(typeof J.subLanguage=="string"){if(!o[J.subLanguage]){Te.addText(Se);return}H=w(J.subLanguage,Se,!0,it[J.subLanguage]),it[J.subLanguage]=H._top}else H=$(Se,J.subLanguage.length?J.subLanguage:null);J.relevance>0&&(Bt+=H.relevance),Te.__addSublanguage(H._emitter,H.language)}function xe(){J.subLanguage!=null?Re():_e(),Se=""}function y(H,Z){H!==""&&(Te.startScope(Z),Te.addText(H),Te.endScope())}function p(H,Z){let ce=1;const ke=Z.length-1;for(;ce<=ke;){if(!H._emit[ce]){ce++;continue}const ze=je.classNameAliases[H[ce]]||H[ce],Qe=Z[ce];ze?y(Qe,ze):(Se=Qe,_e(),Se=""),ce++}}function L(H,Z){return H.scope&&typeof H.scope=="string"&&Te.openNode(je.classNameAliases[H.scope]||H.scope),H.beginScope&&(H.beginScope._wrap?(y(Se,je.classNameAliases[H.beginScope._wrap]||H.beginScope._wrap),Se=""):H.beginScope._multi&&(p(H.beginScope,Z),Se="")),J=Object.create(H,{parent:{value:J}}),J}function V(H,Z,ce){let ke=Kd(H.endRe,ce);if(ke){if(H["on:end"]){const ze=new Ei(H);H["on:end"](Z,ze),ze.isMatchIgnored&&(ke=!1)}if(ke){for(;H.endsParent&&H.parent;)H=H.parent;return H}}if(H.endsWithParent)return V(H.parent,Z,ce)}function X(H){return J.matcher.regexIndex===0?(Se+=H[0],1):(dt=!0,0)}function se(H){const Z=H[0],ce=H.rule,ke=new Ei(ce),ze=[ce.__beforeBegin,ce["on:begin"]];for(const Qe of ze)if(Qe&&(Qe(H,ke),ke.isMatchIgnored))return X(Z);return ce.skip?Se+=Z:(ce.excludeBegin&&(Se+=Z),xe(),!ce.returnBegin&&!ce.excludeBegin&&(Se=Z)),L(ce,H),ce.returnBegin?0:Z.length}function ge(H){const Z=H[0],ce=F.substring(H.index),ke=V(J,H,ce);if(!ke)return Li;const ze=J;J.endScope&&J.endScope._wrap?(xe(),y(Z,J.endScope._wrap)):J.endScope&&J.endScope._multi?(xe(),p(J.endScope,H)):ze.skip?Se+=Z:(ze.returnEnd||ze.excludeEnd||(Se+=Z),xe(),ze.excludeEnd&&(Se=Z));do J.scope&&Te.closeNode(),!J.skip&&!J.subLanguage&&(Bt+=J.relevance),J=J.parent;while(J!==ke.parent);return ke.starts&&L(ke.starts,H),ze.returnEnd?0:Z.length}function Ge(){const H=[];for(let Z=J;Z!==je;Z=Z.parent)Z.scope&&H.unshift(Z.scope);H.forEach(Z=>Te.openNode(Z))}let Pe={};function Ze(H,Z){const ce=Z&&Z[0];if(Se+=H,ce==null)return xe(),0;if(Pe.type==="begin"&&Z.type==="end"&&Pe.index===Z.index&&ce===""){if(Se+=F.slice(Z.index,Z.index+1),!l){const ke=new Error(`0 width match regex (${A})`);throw ke.languageName=A,ke.badRule=Pe.rule,ke}return 1}if(Pe=Z,Z.type==="begin")return se(Z);if(Z.type==="illegal"&&!U){const ke=new Error('Illegal lexeme "'+ce+'" for mode "'+(J.scope||"<unnamed>")+'"');throw ke.mode=J,ke}else if(Z.type==="end"){const ke=ge(Z);if(ke!==Li)return ke}if(Z.type==="illegal"&&ce==="")return Se+=`
58
+ `,1;if(gt>1e5&&gt>Z.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Se+=ce,ce.length}const je=Y(A);if(!je)throw wn(s.replace("{}",A)),new Error('Unknown language: "'+A+'"');const tn=Cu(je);let Rt="",J=G||tn;const it={},Te=new u.__emitter(u);Ge();let Se="",Bt=0,Je=0,gt=0,dt=!1;try{if(je.__emitTokens)je.__emitTokens(F,Te);else{for(J.matcher.considerAll();;){gt++,dt?dt=!1:J.matcher.considerAll(),J.matcher.lastIndex=Je;const H=J.matcher.exec(F);if(!H)break;const Z=F.substring(Je,H.index),ce=Ze(Z,H);Je=H.index+ce}Ze(F.substring(Je))}return Te.finalize(),Rt=Te.toHTML(),{language:A,value:Rt,relevance:Bt,illegal:!1,_emitter:Te,_top:J}}catch(H){if(H.message&&H.message.includes("Illegal"))return{language:A,value:xr(F),illegal:!0,relevance:0,_illegalBy:{message:H.message,index:Je,context:F.slice(Je-100,Je+100),mode:H.mode,resultSoFar:Rt},_emitter:Te};if(l)return{language:A,value:xr(F),illegal:!1,relevance:0,errorRaised:H,_emitter:Te,_top:J};throw H}}function N(A){const F={value:xr(A),illegal:!1,relevance:0,_top:c,_emitter:new u.__emitter(u)};return F._emitter.addText(A),F}function $(A,F){F=F||u.languages||Object.keys(o);const U=N(A),G=F.filter(Y).filter(ae).map(xe=>w(xe,A,!1));G.unshift(U);const le=G.sort((xe,y)=>{if(xe.relevance!==y.relevance)return y.relevance-xe.relevance;if(xe.language&&y.language){if(Y(xe.language).supersetOf===y.language)return 1;if(Y(y.language).supersetOf===xe.language)return-1}return 0}),[Ne,_e]=le,Re=Ne;return Re.secondBest=_e,Re}function M(A,F,U){const G=F&&n[F]||U;A.classList.add("hljs"),A.classList.add(`language-${G}`)}function P(A){let F=null;const U=g(A);if(d(U))return;if(ie("before:highlightElement",{el:A,language:U}),A.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",A);return}if(A.children.length>0&&(u.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(A)),u.throwUnescapedHTML))throw new Mu("One of your code blocks includes unescaped HTML.",A.innerHTML);F=A;const G=F.textContent,le=U?b(G,{language:U,ignoreIllegals:!0}):$(G);A.innerHTML=le.value,A.dataset.highlighted="yes",M(A,U,le.language),A.result={language:le.language,re:le.relevance,relevance:le.relevance},le.secondBest&&(A.secondBest={language:le.secondBest.language,relevance:le.secondBest.relevance}),ie("after:highlightElement",{el:A,result:le,text:G})}function I(A){u=Oi(u,A)}const C=()=>{m(),Ln("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function E(){m(),Ln("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let k=!1;function m(){function A(){m()}if(document.readyState==="loading"){k||window.addEventListener("DOMContentLoaded",A,!1),k=!0;return}document.querySelectorAll(u.cssSelector).forEach(P)}function B(A,F){let U=null;try{U=F(t)}catch(G){if(wn("Language definition for '{}' could not be registered.".replace("{}",A)),l)wn(G);else throw G;U=c}U.name||(U.name=A),o[A]=U,U.rawDefinition=F.bind(null,t),U.aliases&&ee(U.aliases,{languageName:A})}function x(A){delete o[A];for(const F of Object.keys(n))n[F]===A&&delete n[F]}function K(){return Object.keys(o)}function Y(A){return A=(A||"").toLowerCase(),o[A]||o[n[A]]}function ee(A,{languageName:F}){typeof A=="string"&&(A=[A]),A.forEach(U=>{n[U.toLowerCase()]=F})}function ae(A){const F=Y(A);return F&&!F.disableAutodetect}function re(A){A["before:highlightBlock"]&&!A["before:highlightElement"]&&(A["before:highlightElement"]=F=>{A["before:highlightBlock"](Object.assign({block:F.el},F))}),A["after:highlightBlock"]&&!A["after:highlightElement"]&&(A["after:highlightElement"]=F=>{A["after:highlightBlock"](Object.assign({block:F.el},F))})}function q(A){re(A),r.push(A)}function Q(A){const F=r.indexOf(A);F!==-1&&r.splice(F,1)}function ie(A,F){const U=A;r.forEach(function(G){G[U]&&G[U](F)})}function z(A){return Ln("10.7.0","highlightBlock will be removed entirely in v12.0"),Ln("10.7.0","Please use highlightElement now."),P(A)}Object.assign(t,{highlight:b,highlightAuto:$,highlightAll:m,highlightElement:P,highlightBlock:z,configure:I,initHighlighting:C,initHighlightingOnLoad:E,registerLanguage:B,unregisterLanguage:x,listLanguages:K,getLanguage:Y,registerAliases:ee,autoDetection:ae,inherit:Oi,addPlugin:q,removePlugin:Q}),t.debugMode=function(){l=!1},t.safeMode=function(){l=!0},t.versionString=_u,t.regex={concat:xn,lookahead:Si,either:kr,optional:Gd,anyNumberOfTimes:Wd};for(const A in $o)typeof $o[A]=="object"&&yi($o[A]);return Object.assign(t,$o),t},Dn=Di({});Dn.newInstance=()=>Di({});var Ru=Dn;Dn.HighlightJS=Dn,Dn.default=Dn;const wr=$d(Ru);function Nr(t){const o=t.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:o.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const l={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},s=t.inherit(t.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),c={begin:/<<-?\s*(?=\w+)/,starts:{contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},u={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,n,l]};l.contains.push(u);const d={match:/\\"/},g={className:"string",begin:/'/,end:/'/},b={match:/\\'/},w={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,n]},N=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],$=t.SHEBANG({binary:`(${N.join("|")})`,relevance:10}),M={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},P=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],I=["true","false"],C={match:/(\/[a-z._-]+)+/},E=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],k=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],m=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],B=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:P,literal:I,built_in:[...E,...k,"set","shopt",...m,...B]},contains:[$,t.SHEBANG(),M,w,s,c,C,u,d,g,b,n]}}const Bu=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),Iu=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],zu=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],Ou=[...Iu,...zu],Lu=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),Du=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),Vu=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),$u=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function Pu(t){const o=t.regex,n=Bu(t),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},l="and or not only",s=/@-?\w[\w]*(-\w+)*/,c="[a-zA-Z-][a-zA-Z0-9_-]*",u=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+c,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+Du.join("|")+")"},{begin:":(:)?("+Vu.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+$u.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...u,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...u,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:o.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:s},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:l,attribute:Lu.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...u,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Ou.join("|")+")\\b"}]}}function Vi(t){const s={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:s,illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"string",variants:[t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[t.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:s,illegal:/["']/}]}]}}var Vn="[0-9](_*[0-9])*",Uo=`\\.(${Vn})`,Fo="[0-9a-fA-F](_*[0-9a-fA-F])*",$i={className:"number",variants:[{begin:`(\\b(${Vn})((${Uo})|\\.)?|(${Uo}))[eE][+-]?(${Vn})[fFdD]?\\b`},{begin:`\\b(${Vn})((${Uo})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Uo})[fFdD]?\\b`},{begin:`\\b(${Vn})[fFdD]\\b`},{begin:`\\b0[xX]((${Fo})\\.?|(${Fo})?\\.(${Fo}))[pP][+-]?(${Vn})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Fo})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Pi(t,o,n){return n===-1?"":t.replace(o,r=>Pi(t,o,n-1))}function Uu(t){const o=t.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=n+Pi("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),d={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},g={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},b={className:"params",begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[t.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:d,illegal:/<\/|#/,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[t.BACKSLASH_ESCAPE]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[o.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[b,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",t.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:d,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[g,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,$i,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},$i,g]}}const Ui="[A-Za-z$_][0-9A-Za-z$_]*",Fu=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],Hu=["true","false","null","undefined","NaN","Infinity"],Fi=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Hi=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Wi=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Wu=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Gu=[].concat(Wi,Fi,Hi);function Gi(t){const o=t.regex,n=(U,{after:G})=>{const le="</"+U[0].slice(1);return U.input.indexOf(le,G)!==-1},r=Ui,l={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,c={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(U,G)=>{const le=U[0].length+U.index,Ne=U.input[le];if(Ne==="<"||Ne===","){G.ignoreMatch();return}Ne===">"&&(n(U,{after:le})||G.ignoreMatch());let _e;const Re=U.input.substring(le);if(_e=Re.match(/^\s*=/)){G.ignoreMatch();return}if((_e=Re.match(/^\s+extends\s+/))&&_e.index===0){G.ignoreMatch();return}}},u={$pattern:Ui,keyword:Fu,literal:Hu,built_in:Gu,"variable.language":Wu},d="[0-9](_?[0-9])*",g=`\\.(${d})`,b="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",w={className:"number",variants:[{begin:`(\\b(${b})((${g})|\\.)?|(${g}))[eE][+-]?(${d})\\b`},{begin:`\\b(${b})\\b((${g})\\b|\\.)?|(${g})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},N={className:"subst",begin:"\\$\\{",end:"\\}",keywords:u,contains:[]},$={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,N],subLanguage:"xml"}},M={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,N],subLanguage:"css"}},P={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,N],subLanguage:"graphql"}},I={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,N]},E={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},k=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,$,M,P,I,{match:/\$\d+/},w];N.contains=k.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(k)});const m=[].concat(E,N.contains),B=m.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(m)}]),x={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:B},K={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,o.concat(r,"(",o.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},Y={relevance:0,match:o.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Fi,...Hi]}},ee={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},ae={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[x],illegal:/%/},re={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function q(U){return o.concat("(?!",U.join("|"),")")}const Q={match:o.concat(/\b/,q([...Wi,"super","import"].map(U=>`${U}\\s*\\(`)),r,o.lookahead(/\s*\(/)),className:"title.function",relevance:0},ie={begin:o.concat(/\./,o.lookahead(o.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},z={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},x]},A="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",F={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,o.lookahead(A)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[x]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:B,CLASS_REFERENCE:Y},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),ee,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,$,M,P,I,E,{match:/\$\d+/},w,Y,{scope:"attr",match:r+o.lookahead(":"),relevance:0},F,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[E,t.REGEXP_MODE,{className:"function",begin:A,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:B}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:l.begin,end:l.end},{match:s},{begin:c.begin,"on:begin":c.isTrulyOpeningTag,end:c.end}],subLanguage:"xml",contains:[{begin:c.begin,end:c.end,skip:!0,contains:["self"]}]}]},ae,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[x,t.inherit(t.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},ie,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[x]},Q,re,K,z,{match:/\$[(.]/}]}}function ju(t){const o={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],l={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[o,n,t.QUOTE_STRING_MODE,l,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function ji(t){const o=t.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},l={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},s={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},c={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},u=/[A-Za-z][A-Za-z0-9+.-]*/,d={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:o.concat(/\[.+?\]\(/,u,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},g={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},b={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},w=t.inherit(g,{contains:[]}),N=t.inherit(b,{contains:[]});g.contains.push(N),b.contains.push(w);let $=[n,d];return[g,b,w,N].forEach(C=>{C.contains=C.contains.concat($)}),$=$.concat(g,b),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:$},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:$}]}]},n,s,g,b,{className:"quote",begin:"^>\\s+",contains:$,end:"$"},l,r,d,c,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function Ki(t){const o=t.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],u={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},d={className:"meta",begin:/^(>>>|\.\.\.) /},g={className:"subst",begin:/\{/,end:/\}/,keywords:u,illegal:/#/},b={begin:/\{\{/,relevance:0},w={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,d],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,d],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,d,b,g]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,d,b,g]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[t.BACKSLASH_ESCAPE,b,g]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,b,g]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},N="[0-9](_?[0-9])*",$=`(\\b(${N}))?\\.(${N})|\\b(${N})\\.`,M=`\\b|${r.join("|")}`,P={className:"number",relevance:0,variants:[{begin:`(\\b(${N})|(${$}))[eE][+-]?(${N})[jJ]?(?=${M})`},{begin:`(${$})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${M})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${M})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${M})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${M})`},{begin:`\\b(${N})[jJ](?=${M})`}]},I={className:"comment",begin:o.lookahead(/# type:/),end:/$/,keywords:u,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},C={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:["self",d,P,w,t.HASH_COMMENT_MODE]}]};return g.contains=[w,P,d],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:u,illegal:/(<\/|\?)|=>/,contains:[d,P,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},w,I,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[C]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[P,C,w]}]}}function Yi(t){const o=t.regex,n=/(r#)?/,r=o.concat(n,t.UNDERSCORE_IDENT_RE),l=o.concat(n,t.IDENT_RE),s={className:"title.function.invoke",relevance:0,begin:o.concat(/\b/,/(?!let|for|while|if|else|match\b)/,l,o.lookahead(/\s*\(/))},c="([ui](8|16|32|64|128|size)|f(32|64))?",u=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],d=["true","false","Some","None","Ok","Err"],g=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],b=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:t.IDENT_RE+"!?",type:b,keyword:u,literal:d,built_in:g},illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.COMMENT("/\\*","\\*/",{contains:["self"]}),t.inherit(t.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+c},{begin:"\\b0o([0-7_]+)"+c},{begin:"\\b0x([A-Fa-f0-9_]+)"+c},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+c}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,r,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:t.IDENT_RE+"::",keywords:{keyword:"Self",built_in:g,type:b}},{className:"punctuation",begin:"->"},s]}}function Ku(t){const o=t.regex,n=t.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},l={begin:/"/,end:/"/,contains:[{match:/""/}]},s=["true","false","unknown"],c=["double precision","large object","with timezone","without timezone"],u=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],d=["add","asc","collation","desc","final","first","last","view"],g=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],b=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],w=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],N=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],$=b,M=[...g,...d].filter(B=>!b.includes(B)),P={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},I={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},C={match:o.concat(/\b/,o.either(...$),/\s*\(/),relevance:0,keywords:{built_in:$}};function E(B){return o.concat(/\b/,o.either(...B.map(x=>x.replace(/\s+/,"\\s+"))),/\b/)}const k={scope:"keyword",match:E(N),relevance:0};function m(B,{exceptions:x,when:K}={}){const Y=K;return x=x||[],B.map(ee=>ee.match(/\|\d+$/)||x.includes(ee)?ee:Y(ee)?`${ee}|0`:ee)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:m(M,{when:B=>B.length<3}),literal:s,type:u,built_in:w},contains:[{scope:"type",match:E(c)},k,C,P,r,l,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,n,I]}}const Ho="[A-Za-z$_][0-9A-Za-z$_]*",qi=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],Xi=["true","false","null","undefined","NaN","Infinity"],Zi=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Ji=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Qi=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],el=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],tl=[].concat(Qi,Zi,Ji);function Yu(t){const o=t.regex,n=(U,{after:G})=>{const le="</"+U[0].slice(1);return U.input.indexOf(le,G)!==-1},r=Ho,l={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,c={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(U,G)=>{const le=U[0].length+U.index,Ne=U.input[le];if(Ne==="<"||Ne===","){G.ignoreMatch();return}Ne===">"&&(n(U,{after:le})||G.ignoreMatch());let _e;const Re=U.input.substring(le);if(_e=Re.match(/^\s*=/)){G.ignoreMatch();return}if((_e=Re.match(/^\s+extends\s+/))&&_e.index===0){G.ignoreMatch();return}}},u={$pattern:Ho,keyword:qi,literal:Xi,built_in:tl,"variable.language":el},d="[0-9](_?[0-9])*",g=`\\.(${d})`,b="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",w={className:"number",variants:[{begin:`(\\b(${b})((${g})|\\.)?|(${g}))[eE][+-]?(${d})\\b`},{begin:`\\b(${b})\\b((${g})\\b|\\.)?|(${g})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},N={className:"subst",begin:"\\$\\{",end:"\\}",keywords:u,contains:[]},$={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,N],subLanguage:"xml"}},M={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,N],subLanguage:"css"}},P={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,N],subLanguage:"graphql"}},I={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,N]},E={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},k=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,$,M,P,I,{match:/\$\d+/},w];N.contains=k.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(k)});const m=[].concat(E,N.contains),B=m.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(m)}]),x={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:B},K={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,o.concat(r,"(",o.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},Y={relevance:0,match:o.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Zi,...Ji]}},ee={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},ae={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[x],illegal:/%/},re={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function q(U){return o.concat("(?!",U.join("|"),")")}const Q={match:o.concat(/\b/,q([...Qi,"super","import"].map(U=>`${U}\\s*\\(`)),r,o.lookahead(/\s*\(/)),className:"title.function",relevance:0},ie={begin:o.concat(/\./,o.lookahead(o.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},z={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},x]},A="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",F={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,o.lookahead(A)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[x]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:B,CLASS_REFERENCE:Y},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),ee,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,$,M,P,I,E,{match:/\$\d+/},w,Y,{scope:"attr",match:r+o.lookahead(":"),relevance:0},F,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[E,t.REGEXP_MODE,{className:"function",begin:A,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:B}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:l.begin,end:l.end},{match:s},{begin:c.begin,"on:begin":c.isTrulyOpeningTag,end:c.end}],subLanguage:"xml",contains:[{begin:c.begin,end:c.end,skip:!0,contains:["self"]}]}]},ae,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[x,t.inherit(t.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},ie,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[x]},Q,re,K,z,{match:/\$[(.]/}]}}function nl(t){const o=t.regex,n=Yu(t),r=Ho,l=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],s={begin:[/namespace/,/\s+/,t.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},c={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:l},contains:[n.exports.CLASS_REFERENCE]},u={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},d=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],g={$pattern:Ho,keyword:qi.concat(d),literal:Xi,built_in:tl.concat(l),"variable.language":el},b={className:"meta",begin:"@"+r},w=(P,I,C)=>{const E=P.contains.findIndex(k=>k.label===I);if(E===-1)throw new Error("can not find mode to replace");P.contains.splice(E,1,C)};Object.assign(n.keywords,g),n.exports.PARAMS_CONTAINS.push(b);const N=n.contains.find(P=>P.scope==="attr"),$=Object.assign({},N,{match:o.concat(r,o.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,N,$]),n.contains=n.contains.concat([b,s,c,$]),w(n,"shebang",t.SHEBANG()),w(n,"use_strict",u);const M=n.contains.find(P=>P.label==="func.def");return M.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function ol(t){const o=t.regex,n=o.concat(/[\p{L}_]/u,o.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,l={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},s={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},c=t.inherit(s,{begin:/\(/,end:/\)/}),u=t.inherit(t.APOS_STRING_MODE,{className:"string"}),d=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),g={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[l]},{begin:/'/,end:/'/,contains:[l]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[s,d,u,c,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[s,c,d,u]}]}]},t.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},l,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[d]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[g],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[g],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:o.concat(/</,o.lookahead(o.concat(n,o.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:g}]},{className:"tag",begin:o.concat(/<\//,o.lookahead(o.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function rl(t){const o="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},l={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},s={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},c={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,l]},u=t.inherit(c,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),N={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},$={end:",",endsWithParent:!0,excludeEnd:!0,keywords:o,relevance:0},M={begin:/\{/,end:/\}/,contains:[$],illegal:"\\n",relevance:0},P={begin:"\\[",end:"\\]",contains:[$],illegal:"\\n",relevance:0},I=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:o,keywords:{literal:o}},N,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},M,P,s,c],C=[...I];return C.pop(),C.push(u),$.contains=C,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:I}}const Sr={bash:Nr,sh:Nr,shell:Nr,css:Pu,go:Vi,golang:Vi,java:Uu,javascript:Gi,js:Gi,json:ju,markdown:ji,md:ji,python:Ki,py:Ki,rust:Yi,rs:Yi,sql:Ku,typescript:nl,ts:nl,xml:ol,html:ol,yaml:rl,yml:rl};for(const[t,o]of Object.entries(Sr))wr.registerLanguage(t,o);function Wo(t){const o=t.split(`
59
+ `);return/^(`{3,}|~{3,})/.test(o[0]??"")&&o.shift(),/^(`{3,}|~{3,})\s*$/.test(o[o.length-1]??"")&&o.pop(),o.join(`
60
+ `).replace(/\n+$/,"")}function Nn(t){const o=/^(`{3,}|~{3,})([^\s`~]*)/.exec(t.split(`
61
+ `)[0]??""),n=((o==null?void 0:o[2])??"").toLowerCase();return n&&Sr[n]?n:""}function Tr(t,o){const n=o&&Sr[o]?o:"";try{return n?wr.highlight(t,{language:n,ignoreIllegals:!0}).value:wr.highlightAuto(t).value}catch{return qu(t)}}function Cr(t){return t.split(`
62
+ `).filter(o=>o.trim().length>0).filter(o=>!/^\s*\|?\s*(:?-+:?\s*\|\s*)+(:?-+:?)(\s*\|)?\s*$/.test(o)).map(o=>o.replace(/^\s*\|/,"").replace(/\|\s*$/,"").split("|").map(n=>n.trim()))}function qu(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function il(t,o,n){if(t.length<=1)return t.slice();const[r,...l]=t,s=l.map(g=>g[o]??""),c=s.length>0&&s.every(g=>g.trim()!==""&&!Number.isNaN(Number(g))),u=n==="asc"?1:-1,d=l.slice().sort((g,b)=>{const w=g[o]??"",N=b[o]??"";return c?(Number(w)-Number(N))*u:w.localeCompare(N,"zh-Hans-CN",{numeric:!0})*u});return[r,...d]}function Ar(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Sn=Ar();function ll(t){Sn=t}var Tn={exec:()=>null};function $n(t){let o=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),l=o[r];return l||(l=t(r),o[r]=l),l}}function Ee(t,o=""){let n=typeof t=="string"?t:t.source,r={replace:(l,s)=>{let c=typeof s=="string"?s:s.source;return c=c.replace(ot.caret,"$1"),n=n.replace(l,c),r},getRegex:()=>new RegExp(n,o)};return r}var Xu=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),ot={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:$n(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:$n(t=>new RegExp(`^ {0,${t}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:$n(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:$n(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:$n(t=>new RegExp(`^ {0,${t}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:$n(t=>new RegExp(`^ {0,${t}}>`))},Zu=/^(?:[ \t]*(?:\n|$))+/,Ju=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Qu=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,lo=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ef=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,_r=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,al=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,sl=Ee(al).replace(/bull/g,_r).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),tf=Ee(al).replace(/bull/g,_r).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Mr=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,nf=/^[^\n]+/,vr=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,of=Ee(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",vr).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),rf=Ee(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,_r).getRegex(),Go="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Rr=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,lf=Ee("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Rr).replace("tag",Go).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),cl=Ee(Mr).replace("hr",lo).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Go).getRegex(),af=Ee(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",cl).getRegex(),Br={blockquote:af,code:Ju,def:of,fences:Qu,heading:ef,hr:lo,html:lf,lheading:sl,list:rf,newline:Zu,paragraph:cl,table:Tn,text:nf},dl=Ee("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",lo).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Go).getRegex(),sf={...Br,lheading:tf,table:dl,paragraph:Ee(Mr).replace("hr",lo).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",dl).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Go).getRegex()},cf={...Br,html:Ee(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Rr).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Tn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Ee(Mr).replace("hr",lo).replace("heading",` *#{1,6} *[^
63
+ ]`).replace("lheading",sl).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},df=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,uf=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ul=/^( {2,}|\\)\n(?!\s*$)/,ff=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Pn=/[\p{P}\p{S}]/u,jo=/[\s\p{P}\p{S}]/u,Ir=/[^\s\p{P}\p{S}]/u,mf=Ee(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,jo).getRegex(),fl=/(?!~)[\p{P}\p{S}]/u,pf=/(?!~)[\s\p{P}\p{S}]/u,gf=/(?:[^\s\p{P}\p{S}]|~)/u,hf=Ee(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Xu?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),ml=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,bf=Ee(ml,"u").replace(/punct/g,Pn).getRegex(),kf=Ee(ml,"u").replace(/punct/g,fl).getRegex(),pl="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",yf=Ee(pl,"gu").replace(/notPunctSpace/g,Ir).replace(/punctSpace/g,jo).replace(/punct/g,Pn).getRegex(),Ef=Ee(pl,"gu").replace(/notPunctSpace/g,gf).replace(/punctSpace/g,pf).replace(/punct/g,fl).getRegex(),xf=Ee("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Ir).replace(/punctSpace/g,jo).replace(/punct/g,Pn).getRegex(),wf=Ee(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Pn).getRegex(),Nf="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Sf=Ee(Nf,"gu").replace(/notPunctSpace/g,Ir).replace(/punctSpace/g,jo).replace(/punct/g,Pn).getRegex(),Tf=Ee(/\\(punct)/,"gu").replace(/punct/g,Pn).getRegex(),Cf=Ee(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Af=Ee(Rr).replace("(?:-->|$)","-->").getRegex(),_f=Ee("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Af).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ko=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Mf=Ee(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Ko).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),gl=Ee(/^!?\[(label)\]\[(ref)\]/).replace("label",Ko).replace("ref",vr).getRegex(),hl=Ee(/^!?\[(ref)\](?:\[\])?/).replace("ref",vr).getRegex(),vf=Ee("reflink|nolink(?!\\()","g").replace("reflink",gl).replace("nolink",hl).getRegex(),bl=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,zr={_backpedal:Tn,anyPunctuation:Tf,autolink:Cf,blockSkip:hf,br:ul,code:uf,del:Tn,delLDelim:Tn,delRDelim:Tn,emStrongLDelim:bf,emStrongRDelimAst:yf,emStrongRDelimUnd:xf,escape:df,link:Mf,nolink:hl,punctuation:mf,reflink:gl,reflinkSearch:vf,tag:_f,text:ff,url:Tn},Rf={...zr,link:Ee(/^!?\[(label)\]\((.*?)\)/).replace("label",Ko).getRegex(),reflink:Ee(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ko).getRegex()},Or={...zr,emStrongRDelimAst:Ef,emStrongLDelim:kf,delLDelim:wf,delRDelim:Sf,url:Ee(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",bl).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Ee(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",bl).getRegex()},Bf={...Or,br:Ee(ul).replace("{2,}","*").getRegex(),text:Ee(Or.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Yo={normal:Br,gfm:sf,pedantic:cf},ao={normal:zr,gfm:Or,breaks:Bf,pedantic:Rf},If={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},kl=t=>If[t];function jt(t,o){if(o){if(ot.escapeTest.test(t))return t.replace(ot.escapeReplace,kl)}else if(ot.escapeTestNoEncode.test(t))return t.replace(ot.escapeReplaceNoEncode,kl);return t}function yl(t){try{t=encodeURI(t).replace(ot.percentDecode,"%")}catch{return null}return t}function El(t,o){var s;let n=t.replace(ot.findPipe,(c,u,d)=>{let g=!1,b=u;for(;--b>=0&&d[b]==="\\";)g=!g;return g?"|":" |"}),r=n.split(ot.splitPipe),l=0;if(r[0].trim()||r.shift(),r.length>0&&!((s=r.at(-1))!=null&&s.trim())&&r.pop(),o)if(r.length>o)r.splice(o);else for(;r.length<o;)r.push("");for(;l<r.length;l++)r[l]=r[l].trim().replace(ot.slashPipe,"|");return r}function un(t,o,n){let r=t.length;if(r===0)return"";let l=0;for(;l<r&&t.charAt(r-l-1)===o;)l++;return t.slice(0,r-l)}function xl(t){let o=t.split(`
64
+ `),n=o.length-1;for(;n>=0&&ot.blankLine.test(o[n]);)n--;return o.length-n<=2?t:o.slice(0,n+1).join(`
65
+ `)}function zf(t,o){if(t.indexOf(o[1])===-1)return-1;let n=0;for(let r=0;r<t.length;r++)if(t[r]==="\\")r++;else if(t[r]===o[0])n++;else if(t[r]===o[1]&&(n--,n<0))return r;return n>0?-2:-1}function Of(t,o=0){let n=o,r="";for(let l of t)if(l===" "){let s=4-n%4;r+=" ".repeat(s),n+=s}else r+=l,n++;return r}function wl(t,o,n,r,l){let s=o.href,c=o.title||null,u=t[1].replace(l.other.outputLinkReplace,"$1");r.state.inLink=!0;let d={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:s,title:c,text:u,tokens:r.inlineTokens(u)};return r.state.inLink=!1,d}function Lf(t,o,n){let r=t.match(n.other.indentCodeCompensation);if(r===null)return o;let l=r[1];return o.split(`
66
+ `).map(s=>{let c=s.match(n.other.beginningSpace);if(c===null)return s;let[u]=c;return u.length>=l.length?s.slice(l.length):s}).join(`
67
+ `)}var qo=class{constructor(t){ve(this,"options");ve(this,"rules");ve(this,"lexer");this.options=t||Sn}space(t){let o=this.rules.block.newline.exec(t);if(o&&o[0].length>0)return{type:"space",raw:o[0]}}code(t){let o=this.rules.block.code.exec(t);if(o){let n=this.options.pedantic?o[0]:xl(o[0]),r=n.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n,codeBlockStyle:"indented",text:r}}}fences(t){let o=this.rules.block.fences.exec(t);if(o){let n=o[0],r=Lf(n,o[3]||"",this.rules);return{type:"code",raw:n,lang:o[2]?o[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):o[2],text:r}}}heading(t){let o=this.rules.block.heading.exec(t);if(o){let n=o[2].trim();if(this.rules.other.endingHash.test(n)){let r=un(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:un(o[0],`
68
+ `),depth:o[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){let o=this.rules.block.hr.exec(t);if(o)return{type:"hr",raw:un(o[0],`
69
+ `)}}blockquote(t){let o=this.rules.block.blockquote.exec(t);if(o){let n=un(o[0],`
73
70
  `).split(`
74
- `),i="",r="",s=[];for(;n.length>0;){let c=!1,u=[],d;for(d=0;d<n.length;d++)if(this.rules.other.blockquoteStart.test(n[d]))u.push(n[d]),c=!0;else if(!c)u.push(n[d]);else break;n=n.slice(d);let f=u.join(`
75
- `),p=f.replace(this.rules.other.blockquoteSetextReplace,`
76
- $1`).replace(this.rules.other.blockquoteSetextReplace2,"");i=i?`${i}
77
- ${f}`:f,r=r?`${r}
78
- ${p}`:p;let k=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,s,!0),this.lexer.state.top=k,n.length===0)break;let y=s.at(-1);if((y==null?void 0:y.type)==="code")break;if((y==null?void 0:y.type)==="blockquote"){let N=y,E=N.raw+`
71
+ `),r="",l="",s=[];for(;n.length>0;){let c=!1,u=[],d;for(d=0;d<n.length;d++)if(this.rules.other.blockquoteStart.test(n[d]))u.push(n[d]),c=!0;else if(!c)u.push(n[d]);else break;n=n.slice(d);let g=u.join(`
72
+ `),b=g.replace(this.rules.other.blockquoteSetextReplace,`
73
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
74
+ ${g}`:g,l=l?`${l}
75
+ ${b}`:b;let w=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(b,s,!0),this.lexer.state.top=w,n.length===0)break;let N=s.at(-1);if((N==null?void 0:N.type)==="code")break;if((N==null?void 0:N.type)==="blockquote"){let $=N,M=$.raw+`
79
76
  `+n.join(`
80
- `),L=this.blockquote(E);s[s.length-1]=L,i=i.substring(0,i.length-N.raw.length)+L.raw,r=r.substring(0,r.length-N.text.length)+L.text;break}else if((y==null?void 0:y.type)==="list"){let N=y,E=N.raw+`
77
+ `),P=this.blockquote(M);s[s.length-1]=P,r=r.substring(0,r.length-$.raw.length)+P.raw,l=l.substring(0,l.length-$.text.length)+P.text;break}else if((N==null?void 0:N.type)==="list"){let $=N,M=$.raw+`
81
78
  `+n.join(`
82
- `),L=this.list(E);s[s.length-1]=L,i=i.substring(0,i.length-y.raw.length)+L.raw,r=r.substring(0,r.length-N.raw.length)+L.raw,n=E.substring(s.at(-1).raw.length).split(`
83
- `);continue}}return{type:"blockquote",raw:i,tokens:s,text:r}}}list(t){let o=this.rules.block.list.exec(t);if(o){let n=o[1].trim(),i=n.length>1,r={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 s=this.rules.other.listItemRegex(n),c=!1;for(;t;){let d=!1,f="",p="";if(!(o=s.exec(t))||this.rules.block.hr.test(t))break;f=o[0],t=t.substring(f.length);let k=Iu(o[2].split(`
84
- `,1)[0],o[1].length),y=t.split(`
85
- `,1)[0],N=!k.trim(),E=0;if(this.options.pedantic?(E=2,p=k.trimStart()):N?E=o[1].length+1:(E=k.search(this.rules.other.nonSpaceChar),E=E>4?1:E,p=k.slice(E),E+=o[1].length),N&&this.rules.other.blankLine.test(y)&&(f+=y+`
86
- `,t=t.substring(y.length+1),d=!0),!d){let L=this.rules.other.nextBulletRegex(E),C=this.rules.other.hrRegex(E),x=this.rules.other.fencesBeginRegex(E),R=this.rules.other.headingBeginRegex(E),S=this.rules.other.htmlBeginRegex(E),g=this.rules.other.blockquoteBeginRegex(E);for(;t;){let _=t.split(`
87
- `,1)[0],b;if(y=_,this.options.pedantic?(y=y.replace(this.rules.other.listReplaceNesting," "),b=y):b=y.replace(this.rules.other.tabCharGlobal," "),x.test(y)||R.test(y)||S.test(y)||g.test(y)||L.test(y)||C.test(y))break;if(b.search(this.rules.other.nonSpaceChar)>=E||!y.trim())p+=`
88
- `+b.slice(E);else{if(N||k.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||x.test(k)||R.test(k)||C.test(k))break;p+=`
89
- `+y}N=!y.trim(),f+=_+`
90
- `,t=t.substring(_.length+1),k=b.slice(E)}}r.loose||(c?r.loose=!0:this.rules.other.doubleBlankLine.test(f)&&(c=!0)),r.items.push({type:"list_item",raw:f,task:!!this.options.gfm&&this.rules.other.listIsTask.test(p),loose:!1,text:p,tokens:[]}),r.raw+=f}let u=r.items.at(-1);if(u)u.raw=u.raw.trimEnd(),u.text=u.text.trimEnd();else return;r.raw=r.raw.trimEnd();for(let d of r.items){this.lexer.state.top=!1,d.tokens=this.lexer.blockTokens(d.text,[]);let f=d.tokens[0];if(d.task&&((f==null?void 0:f.type)==="text"||(f==null?void 0:f.type)==="paragraph")){d.text=d.text.replace(this.rules.other.listReplaceTask,""),f.raw=f.raw.replace(this.rules.other.listReplaceTask,""),f.text=f.text.replace(this.rules.other.listReplaceTask,"");for(let k=this.lexer.inlineQueue.length-1;k>=0;k--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[k].src)){this.lexer.inlineQueue[k].src=this.lexer.inlineQueue[k].src.replace(this.rules.other.listReplaceTask,"");break}let p=this.rules.other.listTaskCheckbox.exec(d.raw);if(p){let k={type:"checkbox",raw:p[0]+" ",checked:p[0]!=="[ ]"};d.checked=k.checked,r.loose?d.tokens[0]&&["paragraph","text"].includes(d.tokens[0].type)&&"tokens"in d.tokens[0]&&d.tokens[0].tokens?(d.tokens[0].raw=k.raw+d.tokens[0].raw,d.tokens[0].text=k.raw+d.tokens[0].text,d.tokens[0].tokens.unshift(k)):d.tokens.unshift({type:"paragraph",raw:k.raw,text:k.raw,tokens:[k]}):d.tokens.unshift(k)}}else d.task&&(d.task=!1);if(!r.loose){let p=d.tokens.filter(y=>y.type==="space"),k=p.length>0&&p.some(y=>this.rules.other.anyLine.test(y.raw));r.loose=k}}if(r.loose)for(let d of r.items){d.loose=!0;for(let f of d.tokens)f.type==="text"&&(f.type="paragraph")}return r}}html(t){let o=this.rules.block.html.exec(t);if(o){let n=Mr(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"):"",r=o[3]?o[3].substring(1,o[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):o[3];return{type:"def",tag:n,raw:It(o[0],`
91
- `),href:i,title:r}}}table(t){var c;let o=this.rules.block.table.exec(t);if(!o||!this.rules.other.tableDelimiter.test(o[2]))return;let n=Ar(o[1]),i=o[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=(c=o[3])!=null&&c.trim()?o[3].replace(this.rules.other.tableRowBlankLine,"").split(`
92
- `):[],s={type:"table",raw:It(o[0],`
93
- `),header:[],align:[],rows:[]};if(n.length===i.length){for(let u of i)this.rules.other.tableAlignRight.test(u)?s.align.push("right"):this.rules.other.tableAlignCenter.test(u)?s.align.push("center"):this.rules.other.tableAlignLeft.test(u)?s.align.push("left"):s.align.push(null);for(let u=0;u<n.length;u++)s.header.push({text:n[u],tokens:this.lexer.inline(n[u]),header:!0,align:s.align[u]});for(let u of r)s.rows.push(Ar(u,s.header.length).map((d,f)=>({text:d,tokens:this.lexer.inline(d),header:!1,align:s.align[f]})));return s}}lheading(t){let o=this.rules.block.lheading.exec(t);if(o){let n=o[1].trim();return{type:"heading",raw:It(o[0],`
79
+ `),P=this.list(M);s[s.length-1]=P,r=r.substring(0,r.length-N.raw.length)+P.raw,l=l.substring(0,l.length-$.raw.length)+P.raw,n=M.substring(s.at(-1).raw.length).split(`
80
+ `);continue}}return{type:"blockquote",raw:r,tokens:s,text:l}}}list(t){let o=this.rules.block.list.exec(t);if(o){let n=o[1].trim(),r=n.length>1,l={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");let s=this.rules.other.listItemRegex(n),c=!1;for(;t;){let d=!1,g="",b="";if(!(o=s.exec(t))||this.rules.block.hr.test(t))break;g=o[0],t=t.substring(g.length);let w=Of(o[2].split(`
81
+ `,1)[0],o[1].length),N=t.split(`
82
+ `,1)[0],$=!w.trim(),M=0;if(this.options.pedantic?(M=2,b=w.trimStart()):$?M=o[1].length+1:(M=w.search(this.rules.other.nonSpaceChar),M=M>4?1:M,b=w.slice(M),M+=o[1].length),$&&this.rules.other.blankLine.test(N)&&(g+=N+`
83
+ `,t=t.substring(N.length+1),d=!0),!d){let P=this.rules.other.nextBulletRegex(M),I=this.rules.other.hrRegex(M),C=this.rules.other.fencesBeginRegex(M),E=this.rules.other.headingBeginRegex(M),k=this.rules.other.htmlBeginRegex(M),m=this.rules.other.blockquoteBeginRegex(M);for(;t;){let B=t.split(`
84
+ `,1)[0],x;if(N=B,this.options.pedantic?(N=N.replace(this.rules.other.listReplaceNesting," "),x=N):x=N.replace(this.rules.other.tabCharGlobal," "),C.test(N)||E.test(N)||k.test(N)||m.test(N)||P.test(N)||I.test(N))break;if(x.search(this.rules.other.nonSpaceChar)>=M||!N.trim())b+=`
85
+ `+x.slice(M);else{if($||w.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||C.test(w)||E.test(w)||I.test(w))break;b+=`
86
+ `+N}$=!N.trim(),g+=B+`
87
+ `,t=t.substring(B.length+1),w=x.slice(M)}}l.loose||(c?l.loose=!0:this.rules.other.doubleBlankLine.test(g)&&(c=!0)),l.items.push({type:"list_item",raw:g,task:!!this.options.gfm&&this.rules.other.listIsTask.test(b),loose:!1,text:b,tokens:[]}),l.raw+=g}let u=l.items.at(-1);if(u)u.raw=u.raw.trimEnd(),u.text=u.text.trimEnd();else return;l.raw=l.raw.trimEnd();for(let d of l.items){this.lexer.state.top=!1,d.tokens=this.lexer.blockTokens(d.text,[]);let g=d.tokens[0];if(d.task&&((g==null?void 0:g.type)==="text"||(g==null?void 0:g.type)==="paragraph")){d.text=d.text.replace(this.rules.other.listReplaceTask,""),g.raw=g.raw.replace(this.rules.other.listReplaceTask,""),g.text=g.text.replace(this.rules.other.listReplaceTask,"");for(let w=this.lexer.inlineQueue.length-1;w>=0;w--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[w].src)){this.lexer.inlineQueue[w].src=this.lexer.inlineQueue[w].src.replace(this.rules.other.listReplaceTask,"");break}let b=this.rules.other.listTaskCheckbox.exec(d.raw);if(b){let w={type:"checkbox",raw:b[0]+" ",checked:b[0]!=="[ ]"};d.checked=w.checked,l.loose?d.tokens[0]&&["paragraph","text"].includes(d.tokens[0].type)&&"tokens"in d.tokens[0]&&d.tokens[0].tokens?(d.tokens[0].raw=w.raw+d.tokens[0].raw,d.tokens[0].text=w.raw+d.tokens[0].text,d.tokens[0].tokens.unshift(w)):d.tokens.unshift({type:"paragraph",raw:w.raw,text:w.raw,tokens:[w]}):d.tokens.unshift(w)}}else d.task&&(d.task=!1);if(!l.loose){let b=d.tokens.filter(N=>N.type==="space"),w=b.length>0&&b.some(N=>this.rules.other.anyLine.test(N.raw));l.loose=w}}if(l.loose)for(let d of l.items){d.loose=!0;for(let g of d.tokens)g.type==="text"&&(g.type="paragraph")}return l}}html(t){let o=this.rules.block.html.exec(t);if(o){let n=xl(o[0]);return{type:"html",block:!0,raw:n,pre:o[1]==="pre"||o[1]==="script"||o[1]==="style",text:n}}}def(t){let o=this.rules.block.def.exec(t);if(o){let n=o[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=o[2]?o[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",l=o[3]?o[3].substring(1,o[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):o[3];return{type:"def",tag:n,raw:un(o[0],`
88
+ `),href:r,title:l}}}table(t){var c;let o=this.rules.block.table.exec(t);if(!o||!this.rules.other.tableDelimiter.test(o[2]))return;let n=El(o[1]),r=o[2].replace(this.rules.other.tableAlignChars,"").split("|"),l=(c=o[3])!=null&&c.trim()?o[3].replace(this.rules.other.tableRowBlankLine,"").split(`
89
+ `):[],s={type:"table",raw:un(o[0],`
90
+ `),header:[],align:[],rows:[]};if(n.length===r.length){for(let u of r)this.rules.other.tableAlignRight.test(u)?s.align.push("right"):this.rules.other.tableAlignCenter.test(u)?s.align.push("center"):this.rules.other.tableAlignLeft.test(u)?s.align.push("left"):s.align.push(null);for(let u=0;u<n.length;u++)s.header.push({text:n[u],tokens:this.lexer.inline(n[u]),header:!0,align:s.align[u]});for(let u of l)s.rows.push(El(u,s.header.length).map((d,g)=>({text:d,tokens:this.lexer.inline(d),header:!1,align:s.align[g]})));return s}}lheading(t){let o=this.rules.block.lheading.exec(t);if(o){let n=o[1].trim();return{type:"heading",raw:un(o[0],`
94
91
  `),depth:o[2].charAt(0)==="="?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(t){let o=this.rules.block.paragraph.exec(t);if(o){let n=o[1].charAt(o[1].length-1)===`
95
- `?o[1].slice(0,-1):o[1];return{type:"paragraph",raw:o[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let o=this.rules.block.text.exec(t);if(o)return{type:"text",raw:o[0],text:o[0],tokens:this.lexer.inline(o[0])}}escape(t){let o=this.rules.inline.escape.exec(t);if(o)return{type:"escape",raw:o[0],text:o[1]}}tag(t){let o=this.rules.inline.tag.exec(t);if(o)return!this.lexer.state.inLink&&this.rules.other.startATag.test(o[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(o[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(o[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(o[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:o[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:o[0]}}link(t){let o=this.rules.inline.link.exec(t);if(o){let n=o[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let s=It(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=zu(o[2],"()");if(s===-2)return;if(s>-1){let c=(o[0].indexOf("!")===0?5:4)+o[1].length+s;o[2]=o[2].substring(0,s),o[0]=o[0].substring(0,c).trim(),o[3]=""}}let i=o[2],r="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(i);s&&(i=s[1],r=s[3])}else r=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)),Rr(o,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.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," "),r=o[i.toLowerCase()];if(!r){let s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return Rr(n,r,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 r=[...i[0]].length-1,s,c,u=r,d=0,f=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(f.lastIndex=0,o=o.slice(-1*t.length+r);(i=f.exec(o))!==null;){if(s=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!s)continue;if(c=[...s].length,i[3]||i[4]){u+=c;continue}else if((i[5]||i[6])&&r%3&&!((r+c)%3)){d+=c;continue}if(u-=c,u>0)continue;c=Math.min(c,c+u+d);let p=[...i[0]][0].length,k=t.slice(0,r+i.index+p+c);if(Math.min(r,c)%2){let N=k.slice(1,-1);return{type:"em",raw:k,text:N,tokens:this.lexer.inlineTokens(N)}}let y=k.slice(2,-2);return{type:"strong",raw:k,text:y,tokens:this.lexer.inlineTokens(y)}}}}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),r=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return i&&r&&(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 r=[...i[0]].length-1,s,c,u=r,d=this.rules.inline.delRDelim;for(d.lastIndex=0,o=o.slice(-1*t.length+r);(i=d.exec(o))!==null;){if(s=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!s||(c=[...s].length,c!==r))continue;if(i[3]||i[4]){u+=c;continue}if(u-=c,u>0)continue;c=Math.min(c,c+u);let f=[...i[0]][0].length,p=t.slice(0,r+i.index+f+c),k=p.slice(r,-r);return{type:"del",raw:p,text:k,tokens:this.lexer.inlineTokens(k)}}}}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,r;if(o[2]==="@")i=o[0],r="mailto:"+i;else{let s;do s=o[0],o[0]=((n=this.rules.inline._backpedal.exec(o[0]))==null?void 0:n[0])??"";while(s!==o[0]);i=o[0],o[1]==="www."?r="http://"+o[0]:r=o[0]}return{type:"link",raw:o[0],text:i,href:r,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}}}},ft=class di{constructor(o){Ae(this,"tokens");Ae(this,"options");Ae(this,"state");Ae(this,"inlineQueue");Ae(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=o||Gt,this.options.tokenizer=this.options.tokenizer||new to,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:Ge,block:eo.normal,inline:An.normal};this.options.pedantic?(n.block=eo.pedantic,n.inline=An.pedantic):this.options.gfm&&(n.block=eo.gfm,this.options.breaks?n.inline=An.breaks:n.inline=An.gfm),this.tokenizer.rules=n}static get rules(){return{block:eo,inline:An}}static lex(o,n){return new di(n).lex(o)}static lexInline(o,n){return new di(n).inlineTokens(o)}lex(o){o=o.replace(Ge.carriageReturn,`
96
- `),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 s,c,u;this.tokenizer.lexer=this,this.options.pedantic&&(o=o.replace(Ge.tabCharGlobal," ").replace(Ge.spaceLine,""));let r=1/0;for(;o;){if(o.length<r)r=o.length;else{this.infiniteLoopError(o.charCodeAt(0));break}let d;if((c=(s=this.options.extensions)==null?void 0:s.block)!=null&&c.some(p=>(d=p.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 p=n.at(-1);d.raw.length===1&&p!==void 0?p.raw+=`
97
- `:n.push(d);continue}if(d=this.tokenizer.code(o)){o=o.substring(d.raw.length);let p=n.at(-1);(p==null?void 0:p.type)==="paragraph"||(p==null?void 0:p.type)==="text"?(p.raw+=(p.raw.endsWith(`
92
+ `?o[1].slice(0,-1):o[1];return{type:"paragraph",raw:o[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let o=this.rules.block.text.exec(t);if(o)return{type:"text",raw:o[0],text:o[0],tokens:this.lexer.inline(o[0])}}escape(t){let o=this.rules.inline.escape.exec(t);if(o)return{type:"escape",raw:o[0],text:o[1]}}tag(t){let o=this.rules.inline.tag.exec(t);if(o)return!this.lexer.state.inLink&&this.rules.other.startATag.test(o[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(o[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(o[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(o[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:o[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:o[0]}}link(t){let o=this.rules.inline.link.exec(t);if(o){let n=o[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let s=un(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=zf(o[2],"()");if(s===-2)return;if(s>-1){let c=(o[0].indexOf("!")===0?5:4)+o[1].length+s;o[2]=o[2].substring(0,s),o[0]=o[0].substring(0,c).trim(),o[3]=""}}let r=o[2],l="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(r);s&&(r=s[1],l=s[3])}else l=o[3]?o[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),wl(o,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:l&&l.replace(this.rules.inline.anyPunctuation,"$1")},o[0],this.lexer,this.rules)}}reflink(t,o){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),l=o[r.toLowerCase()];if(!l){let s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return wl(n,l,n[0],this.lexer,this.rules)}}emStrong(t,o,n=""){let r=this.rules.inline.emStrongLDelim.exec(t);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let l=[...r[0]].length-1,s,c,u=l,d=0,g=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(g.lastIndex=0,o=o.slice(-1*t.length+l);(r=g.exec(o))!==null;){if(s=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!s)continue;if(c=[...s].length,r[3]||r[4]){u+=c;continue}else if((r[5]||r[6])&&l%3&&!((l+c)%3)){d+=c;continue}if(u-=c,u>0)continue;c=Math.min(c,c+u+d);let b=[...r[0]][0].length,w=t.slice(0,l+r.index+b+c);if(Math.min(l,c)%2){let $=w.slice(1,-1);return{type:"em",raw:w,text:$,tokens:this.lexer.inlineTokens($)}}let N=w.slice(2,-2);return{type:"strong",raw:w,text:N,tokens:this.lexer.inlineTokens(N)}}}}codespan(t){let o=this.rules.inline.code.exec(t);if(o){let n=o[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(n),l=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&l&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:o[0],text:n}}}br(t){let o=this.rules.inline.br.exec(t);if(o)return{type:"br",raw:o[0]}}del(t,o,n=""){let r=this.rules.inline.delLDelim.exec(t);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let l=[...r[0]].length-1,s,c,u=l,d=this.rules.inline.delRDelim;for(d.lastIndex=0,o=o.slice(-1*t.length+l);(r=d.exec(o))!==null;){if(s=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!s||(c=[...s].length,c!==l))continue;if(r[3]||r[4]){u+=c;continue}if(u-=c,u>0)continue;c=Math.min(c,c+u);let g=[...r[0]][0].length,b=t.slice(0,l+r.index+g+c),w=b.slice(l,-l);return{type:"del",raw:b,text:w,tokens:this.lexer.inlineTokens(w)}}}}autolink(t){let o=this.rules.inline.autolink.exec(t);if(o){let n,r;return o[2]==="@"?(n=o[1],r="mailto:"+n):(n=o[1],r=n),{type:"link",raw:o[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(t){var n;let o;if(o=this.rules.inline.url.exec(t)){let r,l;if(o[2]==="@")r=o[0],l="mailto:"+r;else{let s;do s=o[0],o[0]=((n=this.rules.inline._backpedal.exec(o[0]))==null?void 0:n[0])??"";while(s!==o[0]);r=o[0],o[1]==="www."?l="http://"+o[0]:l=o[0]}return{type:"link",raw:o[0],text:r,href:l,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(t){let o=this.rules.inline.text.exec(t);if(o){let n=this.lexer.state.inRawBlock;return{type:"text",raw:o[0],text:o[0],escaped:n}}}},Dt=class ni{constructor(o){ve(this,"tokens");ve(this,"options");ve(this,"state");ve(this,"inlineQueue");ve(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=o||Sn,this.options.tokenizer=this.options.tokenizer||new qo,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:ot,block:Yo.normal,inline:ao.normal};this.options.pedantic?(n.block=Yo.pedantic,n.inline=ao.pedantic):this.options.gfm&&(n.block=Yo.gfm,this.options.breaks?n.inline=ao.breaks:n.inline=ao.gfm),this.tokenizer.rules=n}static get rules(){return{block:Yo,inline:ao}}static lex(o,n){return new ni(n).lex(o)}static lexInline(o,n){return new ni(n).inlineTokens(o)}lex(o){o=o.replace(ot.carriageReturn,`
93
+ `),this.blockTokens(o,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(o,n=[],r=!1){var s,c,u;this.tokenizer.lexer=this,this.options.pedantic&&(o=o.replace(ot.tabCharGlobal," ").replace(ot.spaceLine,""));let l=1/0;for(;o;){if(o.length<l)l=o.length;else{this.infiniteLoopError(o.charCodeAt(0));break}let d;if((c=(s=this.options.extensions)==null?void 0:s.block)!=null&&c.some(b=>(d=b.call({lexer:this},o,n))?(o=o.substring(d.raw.length),n.push(d),!0):!1))continue;if(d=this.tokenizer.space(o)){o=o.substring(d.raw.length);let b=n.at(-1);d.raw.length===1&&b!==void 0?b.raw+=`
94
+ `:n.push(d);continue}if(d=this.tokenizer.code(o)){o=o.substring(d.raw.length);let b=n.at(-1);(b==null?void 0:b.type)==="paragraph"||(b==null?void 0:b.type)==="text"?(b.raw+=(b.raw.endsWith(`
98
95
  `)?"":`
99
- `)+d.raw,p.text+=`
100
- `+d.text,this.inlineQueue.at(-1).src=p.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 p=n.at(-1);(p==null?void 0:p.type)==="paragraph"||(p==null?void 0:p.type)==="text"?(p.raw+=(p.raw.endsWith(`
96
+ `)+d.raw,b.text+=`
97
+ `+d.text,this.inlineQueue.at(-1).src=b.text):n.push(d);continue}if(d=this.tokenizer.fences(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.heading(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.hr(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.blockquote(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.list(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.html(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.def(o)){o=o.substring(d.raw.length);let b=n.at(-1);(b==null?void 0:b.type)==="paragraph"||(b==null?void 0:b.type)==="text"?(b.raw+=(b.raw.endsWith(`
101
98
  `)?"":`
102
- `)+d.raw,p.text+=`
103
- `+d.raw,this.inlineQueue.at(-1).src=p.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 f=o;if((u=this.options.extensions)!=null&&u.startBlock){let p=1/0,k=o.slice(1),y;this.options.extensions.startBlock.forEach(N=>{y=N.call({lexer:this},k),typeof y=="number"&&y>=0&&(p=Math.min(p,y))}),p<1/0&&p>=0&&(f=o.substring(0,p+1))}if(this.state.top&&(d=this.tokenizer.paragraph(f))){let p=n.at(-1);i&&(p==null?void 0:p.type)==="paragraph"?(p.raw+=(p.raw.endsWith(`
99
+ `)+d.raw,b.text+=`
100
+ `+d.raw,this.inlineQueue.at(-1).src=b.text):this.tokens.links[d.tag]||(this.tokens.links[d.tag]={href:d.href,title:d.title},n.push(d));continue}if(d=this.tokenizer.table(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.lheading(o)){o=o.substring(d.raw.length),n.push(d);continue}let g=o;if((u=this.options.extensions)!=null&&u.startBlock){let b=1/0,w=o.slice(1),N;this.options.extensions.startBlock.forEach($=>{N=$.call({lexer:this},w),typeof N=="number"&&N>=0&&(b=Math.min(b,N))}),b<1/0&&b>=0&&(g=o.substring(0,b+1))}if(this.state.top&&(d=this.tokenizer.paragraph(g))){let b=n.at(-1);r&&(b==null?void 0:b.type)==="paragraph"?(b.raw+=(b.raw.endsWith(`
104
101
  `)?"":`
105
- `)+d.raw,p.text+=`
106
- `+d.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=p.text):n.push(d),i=f.length!==o.length,o=o.substring(d.raw.length);continue}if(d=this.tokenizer.text(o)){o=o.substring(d.raw.length);let p=n.at(-1);(p==null?void 0:p.type)==="text"?(p.raw+=(p.raw.endsWith(`
102
+ `)+d.raw,b.text+=`
103
+ `+d.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=b.text):n.push(d),r=g.length!==o.length,o=o.substring(d.raw.length);continue}if(d=this.tokenizer.text(o)){o=o.substring(d.raw.length);let b=n.at(-1);(b==null?void 0:b.type)==="text"?(b.raw+=(b.raw.endsWith(`
107
104
  `)?"":`
108
- `)+d.raw,p.text+=`
109
- `+d.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=p.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 f,p,k,y,N;this.tokenizer.lexer=this;let i=o,r=null;if(this.tokens.links){let E=Object.keys(this.tokens.links);if(E.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(i))!==null;)E.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(i))!==null;)i=i.slice(0,r.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let s;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(i))!==null;)s=r[2]?r[2].length:0,i=i.slice(0,r.index+s)+"["+"a".repeat(r[0].length-s-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);i=((p=(f=this.options.hooks)==null?void 0:f.emStrongMask)==null?void 0:p.call({lexer:this},i))??i;let c=!1,u="",d=1/0;for(;o;){if(o.length<d)d=o.length;else{this.infiniteLoopError(o.charCodeAt(0));break}c||(u=""),c=!1;let E;if((y=(k=this.options.extensions)==null?void 0:k.inline)!=null&&y.some(C=>(E=C.call({lexer:this},o,n))?(o=o.substring(E.raw.length),n.push(E),!0):!1))continue;if(E=this.tokenizer.escape(o)){o=o.substring(E.raw.length),n.push(E);continue}if(E=this.tokenizer.tag(o)){o=o.substring(E.raw.length),n.push(E);continue}if(E=this.tokenizer.link(o)){o=o.substring(E.raw.length),n.push(E);continue}if(E=this.tokenizer.reflink(o,this.tokens.links)){o=o.substring(E.raw.length);let C=n.at(-1);E.type==="text"&&(C==null?void 0:C.type)==="text"?(C.raw+=E.raw,C.text+=E.text):n.push(E);continue}if(E=this.tokenizer.emStrong(o,i,u)){o=o.substring(E.raw.length),n.push(E);continue}if(E=this.tokenizer.codespan(o)){o=o.substring(E.raw.length),n.push(E);continue}if(E=this.tokenizer.br(o)){o=o.substring(E.raw.length),n.push(E);continue}if(E=this.tokenizer.del(o,i,u)){o=o.substring(E.raw.length),n.push(E);continue}if(E=this.tokenizer.autolink(o)){o=o.substring(E.raw.length),n.push(E);continue}if(!this.state.inLink&&(E=this.tokenizer.url(o))){o=o.substring(E.raw.length),n.push(E);continue}let L=o;if((N=this.options.extensions)!=null&&N.startInline){let C=1/0,x=o.slice(1),R;this.options.extensions.startInline.forEach(S=>{R=S.call({lexer:this},x),typeof R=="number"&&R>=0&&(C=Math.min(C,R))}),C<1/0&&C>=0&&(L=o.substring(0,C+1))}if(E=this.tokenizer.inlineText(L)){o=o.substring(E.raw.length),E.raw.slice(-1)!=="_"&&(u=E.raw.slice(-1)),c=!0;let C=n.at(-1);(C==null?void 0:C.type)==="text"?(C.raw+=E.raw,C.text+=E.text):n.push(E);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)}},Mn=class{constructor(t){Ae(this,"options");Ae(this,"parser");this.options=t||Gt}space(t){return""}code({text:t,lang:o,escaped:n}){var s;let i=(s=(o||"").match(Ge.notSpaceStart))==null?void 0:s[0],r=t.replace(Ge.endingNewline,"")+`
110
- `;return i?'<pre><code class="language-'+Et(i)+'">'+(n?r:Et(r,!0))+`</code></pre>
111
- `:"<pre><code>"+(n?r:Et(r,!0))+`</code></pre>
105
+ `)+d.raw,b.text+=`
106
+ `+d.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=b.text):n.push(d);continue}if(o){this.infiniteLoopError(o.charCodeAt(0));break}}return this.state.top=!0,n}inline(o,n=[]){return this.inlineQueue.push({src:o,tokens:n}),n}inlineTokens(o,n=[]){var g,b,w,N,$;this.tokenizer.lexer=this;let r=o,l=null;if(this.tokens.links){let M=Object.keys(this.tokens.links);if(M.length>0)for(;(l=this.tokenizer.rules.inline.reflinkSearch.exec(r))!==null;)M.includes(l[0].slice(l[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,l.index)+"["+"a".repeat(l[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(l=this.tokenizer.rules.inline.anyPunctuation.exec(r))!==null;)r=r.slice(0,l.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let s;for(;(l=this.tokenizer.rules.inline.blockSkip.exec(r))!==null;)s=l[2]?l[2].length:0,r=r.slice(0,l.index+s)+"["+"a".repeat(l[0].length-s-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=((b=(g=this.options.hooks)==null?void 0:g.emStrongMask)==null?void 0:b.call({lexer:this},r))??r;let c=!1,u="",d=1/0;for(;o;){if(o.length<d)d=o.length;else{this.infiniteLoopError(o.charCodeAt(0));break}c||(u=""),c=!1;let M;if((N=(w=this.options.extensions)==null?void 0:w.inline)!=null&&N.some(I=>(M=I.call({lexer:this},o,n))?(o=o.substring(M.raw.length),n.push(M),!0):!1))continue;if(M=this.tokenizer.escape(o)){o=o.substring(M.raw.length),n.push(M);continue}if(M=this.tokenizer.tag(o)){o=o.substring(M.raw.length),n.push(M);continue}if(M=this.tokenizer.link(o)){o=o.substring(M.raw.length),n.push(M);continue}if(M=this.tokenizer.reflink(o,this.tokens.links)){o=o.substring(M.raw.length);let I=n.at(-1);M.type==="text"&&(I==null?void 0:I.type)==="text"?(I.raw+=M.raw,I.text+=M.text):n.push(M);continue}if(M=this.tokenizer.emStrong(o,r,u)){o=o.substring(M.raw.length),n.push(M);continue}if(M=this.tokenizer.codespan(o)){o=o.substring(M.raw.length),n.push(M);continue}if(M=this.tokenizer.br(o)){o=o.substring(M.raw.length),n.push(M);continue}if(M=this.tokenizer.del(o,r,u)){o=o.substring(M.raw.length),n.push(M);continue}if(M=this.tokenizer.autolink(o)){o=o.substring(M.raw.length),n.push(M);continue}if(!this.state.inLink&&(M=this.tokenizer.url(o))){o=o.substring(M.raw.length),n.push(M);continue}let P=o;if(($=this.options.extensions)!=null&&$.startInline){let I=1/0,C=o.slice(1),E;this.options.extensions.startInline.forEach(k=>{E=k.call({lexer:this},C),typeof E=="number"&&E>=0&&(I=Math.min(I,E))}),I<1/0&&I>=0&&(P=o.substring(0,I+1))}if(M=this.tokenizer.inlineText(P)){o=o.substring(M.raw.length),M.raw.slice(-1)!=="_"&&(u=M.raw.slice(-1)),c=!0;let I=n.at(-1);(I==null?void 0:I.type)==="text"?(I.raw+=M.raw,I.text+=M.text):n.push(M);continue}if(o){this.infiniteLoopError(o.charCodeAt(0));break}}return n}infiniteLoopError(o){let n="Infinite loop on byte: "+o;if(this.options.silent)console.error(n);else throw new Error(n)}},so=class{constructor(t){ve(this,"options");ve(this,"parser");this.options=t||Sn}space(t){return""}code({text:t,lang:o,escaped:n}){var s;let r=(s=(o||"").match(ot.notSpaceStart))==null?void 0:s[0],l=t.replace(ot.endingNewline,"")+`
107
+ `;return r?'<pre><code class="language-'+jt(r)+'">'+(n?l:jt(l,!0))+`</code></pre>
108
+ `:"<pre><code>"+(n?l:jt(l,!0))+`</code></pre>
112
109
  `}blockquote({tokens:t}){return`<blockquote>
113
110
  ${this.parser.parse(t)}</blockquote>
114
111
  `}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:o}){return`<h${o}>${this.parser.parseInline(t)}</h${o}>
115
112
  `}hr(t){return`<hr>
116
- `}list(t){let o=t.ordered,n=t.start,i="";for(let c=0;c<t.items.length;c++){let u=t.items[c];i+=this.listitem(u)}let r=o?"ol":"ul",s=o&&n!==1?' start="'+n+'"':"";return"<"+r+s+`>
117
- `+i+"</"+r+`>
113
+ `}list(t){let o=t.ordered,n=t.start,r="";for(let c=0;c<t.items.length;c++){let u=t.items[c];r+=this.listitem(u)}let l=o?"ol":"ul",s=o&&n!==1?' start="'+n+'"':"";return"<"+l+s+`>
114
+ `+r+"</"+l+`>
118
115
  `}listitem(t){return`<li>${this.parser.parse(t.tokens)}</li>
119
116
  `}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
120
- `}table(t){let o="",n="";for(let r=0;r<t.header.length;r++)n+=this.tablecell(t.header[r]);o+=this.tablerow({text:n});let i="";for(let r=0;r<t.rows.length;r++){let s=t.rows[r];n="";for(let c=0;c<s.length;c++)n+=this.tablecell(s[c]);i+=this.tablerow({text:n})}return i&&(i=`<tbody>${i}</tbody>`),`<table>
117
+ `}table(t){let o="",n="";for(let l=0;l<t.header.length;l++)n+=this.tablecell(t.header[l]);o+=this.tablerow({text:n});let r="";for(let l=0;l<t.rows.length;l++){let s=t.rows[l];n="";for(let c=0;c<s.length;c++)n+=this.tablecell(s[c]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
121
118
  <thead>
122
119
  `+o+`</thead>
123
- `+i+`</table>
120
+ `+r+`</table>
124
121
  `}tablerow({text:t}){return`<tr>
125
122
  ${t}</tr>
126
123
  `}tablecell(t){let o=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+o+`</${n}>
127
- `}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>${Et(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),r=_r(t);if(r===null)return i;t=r;let s='<a href="'+t+'"';return o&&(s+=' title="'+Et(o)+'"'),s+=">"+i+"</a>",s}image({href:t,title:o,text:n,tokens:i}){i&&(n=this.parser.parseInline(i,this.parser.textRenderer));let r=_r(t);if(r===null)return Et(n);t=r;let s=`<img src="${t}" alt="${Et(n)}"`;return o&&(s+=` title="${Et(o)}"`),s+=">",s}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Et(t.text)}},qo=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}},mt=class ui{constructor(o){Ae(this,"options");Ae(this,"renderer");Ae(this,"textRenderer");this.options=o||Gt,this.options.renderer=this.options.renderer||new Mn,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new qo}static parse(o,n){return new ui(n).parse(o)}static parseInline(o,n){return new ui(n).parseInline(o)}parse(o){var i,r;this.renderer.parser=this;let n="";for(let s=0;s<o.length;s++){let c=o[s];if((r=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&r[c.type]){let d=c,f=this.options.extensions.renderers[d.type].call({parser:this},d);if(f!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(d.type)){n+=f||"";continue}}let u=c;switch(u.type){case"space":{n+=this.renderer.space(u);break}case"hr":{n+=this.renderer.hr(u);break}case"heading":{n+=this.renderer.heading(u);break}case"code":{n+=this.renderer.code(u);break}case"table":{n+=this.renderer.table(u);break}case"blockquote":{n+=this.renderer.blockquote(u);break}case"list":{n+=this.renderer.list(u);break}case"checkbox":{n+=this.renderer.checkbox(u);break}case"html":{n+=this.renderer.html(u);break}case"def":{n+=this.renderer.def(u);break}case"paragraph":{n+=this.renderer.paragraph(u);break}case"text":{n+=this.renderer.text(u);break}default:{let d='Token with "'+u.type+'" type was not found.';if(this.options.silent)return console.error(d),"";throw new Error(d)}}}return n}parseInline(o,n=this.renderer){var r,s;this.renderer.parser=this;let i="";for(let c=0;c<o.length;c++){let u=o[c];if((s=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&s[u.type]){let f=this.options.extensions.renderers[u.type].call({parser:this},u);if(f!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(u.type)){i+=f||"";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 f='Token with "'+d.type+'" type was not found.';if(this.options.silent)return console.error(f),"";throw new Error(f)}}}return i}},Rn=(oo=class{constructor(t){Ae(this,"options");Ae(this,"block");this.options=t||Gt}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?ft.lex:ft.lexInline}provideParser(t=this.block){return t?mt.parse:mt.parseInline}},Ae(oo,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),Ae(oo,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),oo),Br=class{constructor(...t){Ae(this,"defaults",$o());Ae(this,"options",this.setOptions);Ae(this,"parse",this.parseMarkdown(!0));Ae(this,"parseInline",this.parseMarkdown(!1));Ae(this,"Parser",mt);Ae(this,"Renderer",Mn);Ae(this,"TextRenderer",qo);Ae(this,"Lexer",ft);Ae(this,"Tokenizer",to);Ae(this,"Hooks",Rn);this.use(...t)}walkTokens(t,o){var i,r;let n=[];for(let s of t)switch(n=n.concat(o.call(this,s)),s.type){case"table":{let c=s;for(let u of c.header)n=n.concat(this.walkTokens(u.tokens,o));for(let u of c.rows)for(let d of u)n=n.concat(this.walkTokens(d.tokens,o));break}case"list":{let c=s;n=n.concat(this.walkTokens(c.items,o));break}default:{let c=s;(r=(i=this.defaults.extensions)==null?void 0:i.childTokens)!=null&&r[c.type]?this.defaults.extensions.childTokens[c.type].forEach(u=>{let d=c[u].flat(1/0);n=n.concat(this.walkTokens(d,o))}):c.tokens&&(n=n.concat(this.walkTokens(c.tokens,o)))}}return n}use(...t){let o=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let i={...n};if(i.async=this.defaults.async||i.async||!1,n.extensions&&(n.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){let s=o.renderers[r.name];s?o.renderers[r.name]=function(...c){let u=r.renderer.apply(this,c);return u===!1&&(u=s.apply(this,c)),u}:o.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=o[r.level];s?s.unshift(r.tokenizer):o[r.level]=[r.tokenizer],r.start&&(r.level==="block"?o.startBlock?o.startBlock.push(r.start):o.startBlock=[r.start]:r.level==="inline"&&(o.startInline?o.startInline.push(r.start):o.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(o.childTokens[r.name]=r.childTokens)}),i.extensions=o),n.renderer){let r=this.defaults.renderer||new Mn(this.defaults);for(let s in n.renderer){if(!(s in r))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let c=s,u=n.renderer[c],d=r[c];r[c]=(...f)=>{let p=u.apply(r,f);return p===!1&&(p=d.apply(r,f)),p||""}}i.renderer=r}if(n.tokenizer){let r=this.defaults.tokenizer||new to(this.defaults);for(let s in n.tokenizer){if(!(s in r))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let c=s,u=n.tokenizer[c],d=r[c];r[c]=(...f)=>{let p=u.apply(r,f);return p===!1&&(p=d.apply(r,f)),p}}i.tokenizer=r}if(n.hooks){let r=this.defaults.hooks||new Rn;for(let s in n.hooks){if(!(s in r))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let c=s,u=n.hooks[c],d=r[c];Rn.passThroughHooks.has(s)?r[c]=f=>{if(this.defaults.async&&Rn.passThroughHooksRespectAsync.has(s))return(async()=>{let k=await u.call(r,f);return d.call(r,k)})();let p=u.call(r,f);return d.call(r,p)}:r[c]=(...f)=>{if(this.defaults.async)return(async()=>{let k=await u.apply(r,f);return k===!1&&(k=await d.apply(r,f)),k})();let p=u.apply(r,f);return p===!1&&(p=d.apply(r,f)),p}}i.hooks=r}if(n.walkTokens){let r=this.defaults.walkTokens,s=n.walkTokens;i.walkTokens=function(c){let u=[];return u.push(s.call(this,c)),r&&(u=u.concat(r.call(this,c))),u}}this.defaults={...this.defaults,...i}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,o){return ft.lex(t,o??this.defaults)}parser(t,o){return mt.parse(t,o??this.defaults)}parseMarkdown(t){return(o,n)=>{let i={...n},r={...this.defaults,...i},s=this.onError(!!r.silent,!!r.async);if(this.defaults.async===!0&&i.async===!1)return s(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof o>"u"||o===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof o!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(o)+", string expected"));if(r.hooks&&(r.hooks.options=r,r.hooks.block=t),r.async)return(async()=>{let c=r.hooks?await r.hooks.preprocess(o):o,u=await(r.hooks?await r.hooks.provideLexer(t):t?ft.lex:ft.lexInline)(c,r),d=r.hooks?await r.hooks.processAllTokens(u):u;r.walkTokens&&await Promise.all(this.walkTokens(d,r.walkTokens));let f=await(r.hooks?await r.hooks.provideParser(t):t?mt.parse:mt.parseInline)(d,r);return r.hooks?await r.hooks.postprocess(f):f})().catch(s);try{r.hooks&&(o=r.hooks.preprocess(o));let c=(r.hooks?r.hooks.provideLexer(t):t?ft.lex:ft.lexInline)(o,r);r.hooks&&(c=r.hooks.processAllTokens(c)),r.walkTokens&&this.walkTokens(c,r.walkTokens);let u=(r.hooks?r.hooks.provideParser(t):t?mt.parse:mt.parseInline)(c,r);return r.hooks&&(u=r.hooks.postprocess(u)),u}catch(c){return s(c)}}}onError(t,o){return n=>{if(n.message+=`
128
- Please report this to https://github.com/markedjs/marked.`,t){let i="<p>An error occurred:</p><pre>"+Et(n.message+"",!0)+"</pre>";return o?Promise.resolve(i):i}if(o)return Promise.reject(n);throw n}}},Kt=new Br;function _e(t,o){return Kt.parse(t,o)}_e.options=_e.setOptions=function(t){return Kt.setOptions(t),_e.defaults=Kt.defaults,pr(_e.defaults),_e},_e.getDefaults=$o,_e.defaults=Gt,_e.use=function(...t){return Kt.use(...t),_e.defaults=Kt.defaults,pr(_e.defaults),_e},_e.walkTokens=function(t,o){return Kt.walkTokens(t,o)},_e.parseInline=Kt.parseInline,_e.Parser=mt,_e.parser=mt.parse,_e.Renderer=Mn,_e.TextRenderer=qo,_e.Lexer=ft,_e.lexer=ft.lex,_e.Tokenizer=to,_e.Hooks=Rn,_e.parse=_e,_e.options,_e.setOptions,_e.use,_e.walkTokens,_e.parseInline,mt.parse,ft.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 zr(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 vu(t){if(Array.isArray(t))return t}function Lu(t,o){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var i,r,s,c,u=[],d=!0,f=!1;try{if(s=(n=n.call(t)).next,o!==0)for(;!(d=(i=s.call(n)).done)&&(u.push(i.value),u.length!==o);d=!0);}catch(p){f=!0,r=p}finally{try{if(!d&&n.return!=null&&(c=n.return(),Object(c)!==c))return}finally{if(f)throw r}}return u}}function Du(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
129
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Vu(t,o){return vu(t)||Lu(t,o)||$u(t,o)||Du()}function $u(t,o){if(t){if(typeof t=="string")return zr(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)?zr(t,o):void 0}}const Ir=Object.entries,Or=Object.setPrototypeOf,Pu=Object.isFrozen,Fu=Object.getPrototypeOf,Uu=Object.getOwnPropertyDescriptor;let Xe=Object.freeze,dt=Object.seal,cn=Object.create,vr=typeof Reflect<"u"&&Reflect,Yo=vr.apply,Xo=vr.construct;Xe||(Xe=function(o){return o}),dt||(dt=function(o){return o}),Yo||(Yo=function(o,n){for(var i=arguments.length,r=new Array(i>2?i-2:0),s=2;s<i;s++)r[s-2]=arguments[s];return o.apply(n,r)}),Xo||(Xo=function(o){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return new o(...i)});const qt=$e(Array.prototype.forEach),Hu=$e(Array.prototype.lastIndexOf),Lr=$e(Array.prototype.pop),dn=$e(Array.prototype.push),Wu=$e(Array.prototype.splice),Ze=Array.isArray,Bn=$e(String.prototype.toLowerCase),Zo=$e(String.prototype.toString),Dr=$e(String.prototype.match),un=$e(String.prototype.replace),Vr=$e(String.prototype.indexOf),Gu=$e(String.prototype.trim),ju=$e(Number.prototype.toString),Ku=$e(Boolean.prototype.toString),$r=typeof BigInt>"u"?null:$e(BigInt.prototype.toString),Pr=typeof Symbol>"u"?null:$e(Symbol.prototype.toString),ve=$e(Object.prototype.hasOwnProperty),zn=$e(Object.prototype.toString),He=$e(RegExp.prototype.test),fn=qu(TypeError);function $e(t){return function(o){o instanceof RegExp&&(o.lastIndex=0);for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return Yo(t,o,i)}}function qu(t){return function(){for(var o=arguments.length,n=new Array(o),i=0;i<o;i++)n[i]=arguments[i];return Xo(t,n)}}function de(t,o){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Bn;if(Or&&Or(t,null),!Ze(o))return t;let i=o.length;for(;i--;){let r=o[i];if(typeof r=="string"){const s=n(r);s!==r&&(Pu(o)||(o[i]=s),r=s)}t[r]=!0}return t}function Yu(t){for(let o=0;o<t.length;o++)ve(t,o)||(t[o]=null);return t}function je(t){const o=cn(null);for(const i of Ir(t)){var n=Vu(i,2);const r=n[0],s=n[1];ve(t,r)&&(Ze(s)?o[r]=Yu(s):s&&typeof s=="object"&&s.constructor===Object?o[r]=je(s):o[r]=s)}return o}function Xu(t){switch(typeof t){case"string":return t;case"number":return ju(t);case"boolean":return Ku(t);case"bigint":return $r?$r(t):"0";case"symbol":return Pr?Pr(t):"Symbol()";case"undefined":return zn(t);case"function":case"object":{if(t===null)return zn(t);const o=t,n=xt(o,"toString");if(typeof n=="function"){const i=n(o);return typeof i=="string"?i:zn(i)}return zn(t)}default:return zn(t)}}function xt(t,o){for(;t!==null;){const i=Uu(t,o);if(i){if(i.get)return $e(i.get);if(typeof i.value=="function")return $e(i.value)}t=Fu(t)}function n(){return null}return n}function Zu(t){try{return He(t,""),!0}catch{return!1}}const Fr=Xe(["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"]),Jo=Xe(["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"]),Qo=Xe(["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"]),Ju=Xe(["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"]),ei=Xe(["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"]),Qu=Xe(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Ur=Xe(["#text"]),Hr=Xe(["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"]),ti=Xe(["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"]),Wr=Xe(["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"]),no=Xe(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),ef=dt(/{{[\w\W]*|^[\w\W]*}}/g),tf=dt(/<%[\w\W]*|^[\w\W]*%>/g),nf=dt(/\${[\w\W]*/g),of=dt(/^data-[\-\w.\u00B7-\uFFFF]+$/),rf=dt(/^aria-[\-\w]+$/),Gr=dt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),lf=dt(/^(?:\w+script|data):/i),af=dt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),sf=dt(/^html$/i),cf=dt(/^[a-z][.\w]*(-[.\w]+)+$/i),wt={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},df=function(){return typeof window>"u"?null:window},uf=function(o,n){if(typeof o!="object"||typeof o.createPolicy!="function")return null;let i=null;const r="data-tt-policy-suffix";n&&n.hasAttribute(r)&&(i=n.getAttribute(r));const s="dompurify"+(i?"#"+i:"");try{return o.createPolicy(s,{createHTML(c){return c},createScriptURL(c){return c}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},jr=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Kr(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:df();const o=X=>Kr(X);if(o.version="3.4.8",o.removed=[],!t||!t.document||t.document.nodeType!==wt.document||!t.Element)return o.isSupported=!1,o;let n=t.document;const i=n,r=i.currentScript;t.DocumentFragment;const s=t.HTMLTemplateElement,c=t.Node,u=t.Element,d=t.NodeFilter,f=t.NamedNodeMap;f===void 0&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const p=t.DOMParser,k=t.trustedTypes,y=u.prototype,N=xt(y,"cloneNode"),E=xt(y,"remove"),L=xt(y,"nextSibling"),C=xt(y,"childNodes"),x=xt(y,"parentNode"),R=xt(y,"shadowRoot"),S=xt(y,"attributes"),g=c&&c.prototype?xt(c.prototype,"nodeType"):null,_=c&&c.prototype?xt(c.prototype,"nodeName"):null;if(typeof s=="function"){const X=n.createElement("template");X.content&&X.content.ownerDocument&&(n=X.content.ownerDocument)}let b,O="",W=0;const ne=function(m){if(W>0)throw fn('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 b.createHTML(m)}finally{W--}},pe=n,K=pe.implementation,ie=pe.createNodeIterator,F=pe.createDocumentFragment,q=pe.getElementsByTagName,U=i.importNode;let w=jr();o.isSupported=typeof Ir=="function"&&typeof x=="function"&&K&&K.createHTMLDocument!==void 0;const P=ef,V=tf,Y=nf,ae=of,ke=rf,Re=lf,Pe=af,Te=cf;let B=Gr,z=null;const oe=de({},[...Fr,...Jo,...Qo,...ei,...Ur]);let re=null;const D=de({},[...Hr,...ti,...Wr,...no]);let T=Object.seal(cn(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}})),se=null,ce=null;const De=Object.seal(cn(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Ke=!0,We=!0,mn=!1,Ot=!0,Q=!1,Nt=!0,Me=!1,we=!1,pt=!1,qe=!1,gt=!1,St=!1,H=!0,Z=!1;const le="user-content-";let me=!0,ze=!1,Ue={},Je=null;const vt=de({},["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 pn=null;const gn=de({},["audio","video","img","source","image","track"]);let In=null;const io=de({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),hn="http://www.w3.org/1998/Math/MathML",Lt="http://www.w3.org/2000/svg",nt="http://www.w3.org/1999/xhtml";let Qe=nt,Ie=!1,be=null;const oi=de({},[hn,Lt,nt],Zo);let et=de({},["mi","mo","mn","ms","mtext"]),ee=de({},["annotation-xml"]);const ro=de({},["title","style","font","a","script"]);let Dt=null;const ii=["application/xhtml+xml","text/html"],lo="text/html";let Oe=null,Vt=null;const bn=n.createElement("form"),ao=function(m){return m instanceof RegExp||m instanceof Function},kn=function(){let m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Vt&&Vt===m)return;(!m||typeof m!="object")&&(m={}),m=je(m),Dt=ii.indexOf(m.PARSER_MEDIA_TYPE)===-1?lo:m.PARSER_MEDIA_TYPE,Oe=Dt==="application/xhtml+xml"?Zo:Bn,z=ve(m,"ALLOWED_TAGS")&&Ze(m.ALLOWED_TAGS)?de({},m.ALLOWED_TAGS,Oe):oe,re=ve(m,"ALLOWED_ATTR")&&Ze(m.ALLOWED_ATTR)?de({},m.ALLOWED_ATTR,Oe):D,be=ve(m,"ALLOWED_NAMESPACES")&&Ze(m.ALLOWED_NAMESPACES)?de({},m.ALLOWED_NAMESPACES,Zo):oi,In=ve(m,"ADD_URI_SAFE_ATTR")&&Ze(m.ADD_URI_SAFE_ATTR)?de(je(io),m.ADD_URI_SAFE_ATTR,Oe):io,pn=ve(m,"ADD_DATA_URI_TAGS")&&Ze(m.ADD_DATA_URI_TAGS)?de(je(gn),m.ADD_DATA_URI_TAGS,Oe):gn,Je=ve(m,"FORBID_CONTENTS")&&Ze(m.FORBID_CONTENTS)?de({},m.FORBID_CONTENTS,Oe):vt,se=ve(m,"FORBID_TAGS")&&Ze(m.FORBID_TAGS)?de({},m.FORBID_TAGS,Oe):je({}),ce=ve(m,"FORBID_ATTR")&&Ze(m.FORBID_ATTR)?de({},m.FORBID_ATTR,Oe):je({}),Ue=ve(m,"USE_PROFILES")?m.USE_PROFILES&&typeof m.USE_PROFILES=="object"?je(m.USE_PROFILES):m.USE_PROFILES:!1,Ke=m.ALLOW_ARIA_ATTR!==!1,We=m.ALLOW_DATA_ATTR!==!1,mn=m.ALLOW_UNKNOWN_PROTOCOLS||!1,Ot=m.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Q=m.SAFE_FOR_TEMPLATES||!1,Nt=m.SAFE_FOR_XML!==!1,Me=m.WHOLE_DOCUMENT||!1,qe=m.RETURN_DOM||!1,gt=m.RETURN_DOM_FRAGMENT||!1,St=m.RETURN_TRUSTED_TYPE||!1,pt=m.FORCE_BODY||!1,H=m.SANITIZE_DOM!==!1,Z=m.SANITIZE_NAMED_PROPS||!1,me=m.KEEP_CONTENT!==!1,ze=m.IN_PLACE||!1,B=Zu(m.ALLOWED_URI_REGEXP)?m.ALLOWED_URI_REGEXP:Gr,Qe=typeof m.NAMESPACE=="string"?m.NAMESPACE:nt,et=ve(m,"MATHML_TEXT_INTEGRATION_POINTS")&&m.MATHML_TEXT_INTEGRATION_POINTS&&typeof m.MATHML_TEXT_INTEGRATION_POINTS=="object"?je(m.MATHML_TEXT_INTEGRATION_POINTS):de({},["mi","mo","mn","ms","mtext"]),ee=ve(m,"HTML_INTEGRATION_POINTS")&&m.HTML_INTEGRATION_POINTS&&typeof m.HTML_INTEGRATION_POINTS=="object"?je(m.HTML_INTEGRATION_POINTS):de({},["annotation-xml"]);const I=ve(m,"CUSTOM_ELEMENT_HANDLING")&&m.CUSTOM_ELEMENT_HANDLING&&typeof m.CUSTOM_ELEMENT_HANDLING=="object"?je(m.CUSTOM_ELEMENT_HANDLING):cn(null);if(T=cn(null),ve(I,"tagNameCheck")&&ao(I.tagNameCheck)&&(T.tagNameCheck=I.tagNameCheck),ve(I,"attributeNameCheck")&&ao(I.attributeNameCheck)&&(T.attributeNameCheck=I.attributeNameCheck),ve(I,"allowCustomizedBuiltInElements")&&typeof I.allowCustomizedBuiltInElements=="boolean"&&(T.allowCustomizedBuiltInElements=I.allowCustomizedBuiltInElements),Q&&(We=!1),gt&&(qe=!0),Ue&&(z=de({},Ur),re=cn(null),Ue.html===!0&&(de(z,Fr),de(re,Hr)),Ue.svg===!0&&(de(z,Jo),de(re,ti),de(re,no)),Ue.svgFilters===!0&&(de(z,Qo),de(re,ti),de(re,no)),Ue.mathMl===!0&&(de(z,ei),de(re,Wr),de(re,no))),De.tagCheck=null,De.attributeCheck=null,ve(m,"ADD_TAGS")&&(typeof m.ADD_TAGS=="function"?De.tagCheck=m.ADD_TAGS:Ze(m.ADD_TAGS)&&(z===oe&&(z=je(z)),de(z,m.ADD_TAGS,Oe))),ve(m,"ADD_ATTR")&&(typeof m.ADD_ATTR=="function"?De.attributeCheck=m.ADD_ATTR:Ze(m.ADD_ATTR)&&(re===D&&(re=je(re)),de(re,m.ADD_ATTR,Oe))),ve(m,"ADD_URI_SAFE_ATTR")&&Ze(m.ADD_URI_SAFE_ATTR)&&de(In,m.ADD_URI_SAFE_ATTR,Oe),ve(m,"FORBID_CONTENTS")&&Ze(m.FORBID_CONTENTS)&&(Je===vt&&(Je=je(Je)),de(Je,m.FORBID_CONTENTS,Oe)),ve(m,"ADD_FORBID_CONTENTS")&&Ze(m.ADD_FORBID_CONTENTS)&&(Je===vt&&(Je=je(Je)),de(Je,m.ADD_FORBID_CONTENTS,Oe)),me&&(z["#text"]=!0),Me&&de(z,["html","head","body"]),z.table&&(de(z,["tbody"]),delete se.tbody),m.TRUSTED_TYPES_POLICY){if(typeof m.TRUSTED_TYPES_POLICY.createHTML!="function")throw fn('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof m.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw fn('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const G=b;b=m.TRUSTED_TYPES_POLICY;try{O=ne("")}catch(ye){throw b=G,ye}}else b===void 0&&m.TRUSTED_TYPES_POLICY!==null&&(b=uf(k,r)),b&&typeof O=="string"&&(O=ne(""));(w.uponSanitizeElement.length>0||w.uponSanitizeAttribute.length>0)&&z===oe&&(z=je(z)),w.uponSanitizeAttribute.length>0&&re===D&&(re=je(re)),Xe&&Xe(m),Vt=m},Tt=de({},[...Jo,...Qo,...Ju]),so=de({},[...ei,...Qu]),ri=function(m){let I=x(m);(!I||!I.tagName)&&(I={namespaceURI:Qe,tagName:"template"});const G=Bn(m.tagName),ye=Bn(I.tagName);return be[m.namespaceURI]?m.namespaceURI===Lt?I.namespaceURI===nt?G==="svg":I.namespaceURI===hn?G==="svg"&&(ye==="annotation-xml"||et[ye]):!!Tt[G]:m.namespaceURI===hn?I.namespaceURI===nt?G==="math":I.namespaceURI===Lt?G==="math"&&ee[ye]:!!so[G]:m.namespaceURI===nt?I.namespaceURI===Lt&&!ee[ye]||I.namespaceURI===hn&&!et[ye]?!1:!so[G]&&(ro[G]||!Tt[G]):!!(Dt==="application/xhtml+xml"&&be[m.namespaceURI]):!1},lt=function(m){dn(o.removed,{element:m});try{x(m).removeChild(m)}catch{E(m)}},At=function(m,I){try{dn(o.removed,{attribute:I.getAttributeNode(m),from:I})}catch{dn(o.removed,{attribute:null,from:I})}if(I.removeAttribute(m),m==="is")if(qe||gt)try{lt(I)}catch{}else try{I.setAttribute(m,"")}catch{}},co=function(m){let I=null,G=null;if(pt)m="<remove></remove>"+m;else{const Ce=Dr(m,/^[\r\n\t ]+/);G=Ce&&Ce[0]}Dt==="application/xhtml+xml"&&Qe===nt&&(m='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+m+"</body></html>");const ye=b?ne(m):m;if(Qe===nt)try{I=new p().parseFromString(ye,Dt)}catch{}if(!I||!I.documentElement){I=K.createDocument(Qe,"template",null);try{I.documentElement.innerHTML=Ie?O:ye}catch{}}const ue=I.body||I.documentElement;return m&&G&&ue.insertBefore(n.createTextNode(G),ue.childNodes[0]||null),Qe===nt?q.call(I,Me?"html":"body")[0]:Me?I.documentElement:ue},uo=function(m){return ie.call(m.ownerDocument||m,m,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},yn=function(m){var I,G;m.normalize();const ye=ie.call(m.ownerDocument||m,m,d.SHOW_TEXT|d.SHOW_COMMENT|d.SHOW_CDATA_SECTION|d.SHOW_PROCESSING_INSTRUCTION,null);let ue=ye.nextNode();for(;ue;){let Be=ue.data;qt([P,V,Y],Ye=>{Be=un(Be,Ye," ")}),ue.data=Be,ue=ye.nextNode()}const Ce=(I=(G=m.querySelectorAll)===null||G===void 0?void 0:G.call(m,"template"))!==null&&I!==void 0?I:[];qt(Array.from(Ce),Be=>{Fe(Be.content)&&yn(Be.content)})},J=function(m){const I=_?_(m):null;return typeof I!="string"||Oe(I)!=="form"?!1:typeof m.nodeName!="string"||typeof m.textContent!="string"||typeof m.removeChild!="function"||m.attributes!==S(m)||typeof m.removeAttribute!="function"||typeof m.setAttribute!="function"||typeof m.namespaceURI!="string"||typeof m.insertBefore!="function"||typeof m.hasChildNodes!="function"||m.nodeType!==g(m)||m.childNodes!==C(m)},Fe=function(m){if(!g||typeof m!="object"||m===null)return!1;try{return g(m)===wt.documentFragment}catch{return!1}},Yt=function(m){if(!g||typeof m!="object"||m===null)return!1;try{return typeof g(m)=="number"}catch{return!1}};function ot(X,m,I){qt(X,G=>{G.call(o,m,I,Vt)})}const fo=function(m){let I=null;if(ot(w.beforeSanitizeElements,m,null),J(m))return lt(m),!0;const G=Oe(_?_(m):m.nodeName);if(ot(w.uponSanitizeElement,m,{tagName:G,allowedTags:z}),Nt&&m.hasChildNodes()&&!Yt(m.firstElementChild)&&He(/<[/\w!]/g,m.innerHTML)&&He(/<[/\w!]/g,m.textContent)||Nt&&m.namespaceURI===nt&&G==="style"&&Yt(m.firstElementChild)||m.nodeType===wt.progressingInstruction||Nt&&m.nodeType===wt.comment&&He(/<[/\w]/g,m.data))return lt(m),!0;if(se[G]||!(De.tagCheck instanceof Function&&De.tagCheck(G))&&!z[G]){if(!se[G]&&$t(G)&&(T.tagNameCheck instanceof RegExp&&He(T.tagNameCheck,G)||T.tagNameCheck instanceof Function&&T.tagNameCheck(G)))return!1;if(me&&!Je[G]){const ue=x(m),Ce=C(m);if(Ce&&ue){const Be=Ce.length;for(let Ye=Be-1;Ye>=0;--Ye){const at=N(Ce[Ye],!0);ue.insertBefore(at,L(m))}}}return lt(m),!0}return(g?g(m):m.nodeType)===wt.element&&!ri(m)||(G==="noscript"||G==="noembed"||G==="noframes")&&He(/<\/no(script|embed|frames)/i,m.innerHTML)?(lt(m),!0):(Q&&m.nodeType===wt.text&&(I=m.textContent,qt([P,V,Y],ue=>{I=un(I,ue," ")}),m.textContent!==I&&(dn(o.removed,{element:m.cloneNode()}),m.textContent=I)),ot(w.afterSanitizeElements,m,null),!1)},mo=function(m,I,G){if(ce[I]||H&&(I==="id"||I==="name")&&(G in n||G in bn))return!1;const ye=re[I]||De.attributeCheck instanceof Function&&De.attributeCheck(I,m);if(!(We&&!ce[I]&&He(ae,I))){if(!(Ke&&He(ke,I))){if(!ye||ce[I]){if(!($t(m)&&(T.tagNameCheck instanceof RegExp&&He(T.tagNameCheck,m)||T.tagNameCheck instanceof Function&&T.tagNameCheck(m))&&(T.attributeNameCheck instanceof RegExp&&He(T.attributeNameCheck,I)||T.attributeNameCheck instanceof Function&&T.attributeNameCheck(I,m))||I==="is"&&T.allowCustomizedBuiltInElements&&(T.tagNameCheck instanceof RegExp&&He(T.tagNameCheck,G)||T.tagNameCheck instanceof Function&&T.tagNameCheck(G))))return!1}else if(!In[I]){if(!He(B,un(G,Pe,""))){if(!((I==="src"||I==="xlink:href"||I==="href")&&m!=="script"&&Vr(G,"data:")===0&&pn[m])){if(!(mn&&!He(Re,un(G,Pe,"")))){if(G)return!1}}}}}}return!0},po=de({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),$t=function(m){return!po[Bn(m)]&&He(Te,m)},En=function(m){ot(w.beforeSanitizeAttributes,m,null);const I=m.attributes;if(!I||J(m))return;const G={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:re,forceKeepAttr:void 0};let ye=I.length;for(;ye--;){const ue=I[ye],Ce=ue.name,Be=ue.namespaceURI,Ye=ue.value,at=Oe(Ce),wn=Ye;let Ve=Ce==="value"?wn:Gu(wn);if(G.attrName=at,G.attrValue=Ve,G.keepAttr=!0,G.forceKeepAttr=void 0,ot(w.uponSanitizeAttribute,m,G),Ve=G.attrValue,Z&&(at==="id"||at==="name")&&Vr(Ve,le)!==0&&(At(Ce,m),Ve=le+Ve),Nt&&He(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Ve)){At(Ce,m);continue}if(at==="attributename"&&Dr(Ve,"href")){At(Ce,m);continue}if(G.forceKeepAttr)continue;if(!G.keepAttr){At(Ce,m);continue}if(!Ot&&He(/\/>/i,Ve)){At(Ce,m);continue}Q&&qt([P,V,Y],vn=>{Ve=un(Ve,vn," ")});const On=Oe(m.nodeName);if(!mo(On,at,Ve)){At(Ce,m);continue}if(b&&typeof k=="object"&&typeof k.getAttributeType=="function"&&!Be)switch(k.getAttributeType(On,at)){case"TrustedHTML":{Ve=ne(Ve);break}case"TrustedScriptURL":{Ve=b.createScriptURL(Ve);break}}if(Ve!==wn)try{Be?m.setAttributeNS(Be,Ce,Ve):m.setAttribute(Ce,Ve),J(m)?lt(m):Lr(o.removed)}catch{At(Ce,m)}}ot(w.afterSanitizeAttributes,m,null)},xn=function(m){let I=null;const G=uo(m);for(ot(w.beforeSanitizeShadowDOM,m,null);I=G.nextNode();)if(ot(w.uponSanitizeShadowNode,I,null),fo(I),En(I),Fe(I.content)&&xn(I.content),(g?g(I):I.nodeType)===wt.element){const ue=R?R(I):I.shadowRoot;Fe(ue)&&(Pt(ue),xn(ue))}ot(w.afterSanitizeShadowDOM,m,null)},Pt=function(m){const I=g?g(m):m.nodeType;if(I===wt.element){const ue=R?R(m):m.shadowRoot;Fe(ue)&&(Pt(ue),xn(ue))}const G=C?C(m):m.childNodes;if(!G)return;const ye=[];qt(G,ue=>{dn(ye,ue)});for(const ue of ye)Pt(ue);if(I===wt.element){const ue=_?_(m):null;if(typeof ue=="string"&&Oe(ue)==="template"){const Ce=m.content;Fe(Ce)&&Pt(Ce)}}};return o.sanitize=function(X){let m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},I=null,G=null,ye=null,ue=null;if(Ie=!X,Ie&&(X="<!-->"),typeof X!="string"&&!Yt(X)&&(X=Xu(X),typeof X!="string"))throw fn("dirty is not a string, aborting");if(!o.isSupported)return X;if(we||kn(m),o.removed=[],typeof X=="string"&&(ze=!1),ze){const Ye=_?_(X):X.nodeName;if(typeof Ye=="string"){const at=Oe(Ye);if(!z[at]||se[at])throw fn("root node is forbidden and cannot be sanitized in-place")}if(J(X))throw fn("root node is clobbered and cannot be sanitized in-place");Pt(X)}else if(Yt(X))I=co("<!---->"),G=I.ownerDocument.importNode(X,!0),G.nodeType===wt.element&&G.nodeName==="BODY"||G.nodeName==="HTML"?I=G:I.appendChild(G),Pt(G);else{if(!qe&&!Q&&!Me&&X.indexOf("<")===-1)return b&&St?ne(X):X;if(I=co(X),!I)return qe?null:St?O:""}I&&pt&&lt(I.firstChild);const Ce=uo(ze?X:I);for(;ye=Ce.nextNode();)fo(ye),En(ye),Fe(ye.content)&&xn(ye.content);if(ze)return Q&&yn(X),X;if(qe){if(Q&&yn(I),gt)for(ue=F.call(I.ownerDocument);I.firstChild;)ue.appendChild(I.firstChild);else ue=I;return(re.shadowroot||re.shadowrootmode)&&(ue=U.call(i,ue,!0)),ue}let Be=Me?I.outerHTML:I.innerHTML;return Me&&z["!doctype"]&&I.ownerDocument&&I.ownerDocument.doctype&&I.ownerDocument.doctype.name&&He(sf,I.ownerDocument.doctype.name)&&(Be="<!DOCTYPE "+I.ownerDocument.doctype.name+`>
130
- `+Be),Q&&qt([P,V,Y],Ye=>{Be=un(Be,Ye," ")}),b&&St?ne(Be):Be},o.setConfig=function(){let X=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};kn(X),we=!0},o.clearConfig=function(){Vt=null,we=!1},o.isValidAttribute=function(X,m,I){Vt||kn({});const G=Oe(X),ye=Oe(m);return mo(G,ye,I)},o.addHook=function(X,m){typeof m=="function"&&dn(w[X],m)},o.removeHook=function(X,m){if(m!==void 0){const I=Hu(w[X],m);return I===-1?void 0:Wu(w[X],I,1)[0]}return Lr(w[X])},o.removeHooks=function(X){w[X]=[]},o.removeAllHooks=function(){w=jr()},o}var ff=Kr();const mf=new Br({gfm:!0,breaks:!0,pedantic:!1,renderer:(()=>{const t=new Mn;return t.code=({text:o,lang:n})=>{const i=(n??"").toLowerCase(),r=Io(o,i);return`<pre><code${i?` class="language-${i}"`:""}>${r}</code></pre>`},t})()}),pf=["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"],gf=["href","title","target","rel","src","alt","class","checked","type","disabled"],hf=/^(?:(?:https?|mailto|tel|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i;function bf(t){if(!t)return"";const o=mf.parse(t,{async:!1});return ff.sanitize(o,{ALLOWED_TAGS:pf,ALLOWED_ATTR:gf,ALLOWED_URI_REGEXP:hf})}const kf={class:"zm-note-panel"},yf={key:0,class:"zm-note-empty"},Ef={class:"zm-note-header"},xf={class:"zm-note-title-row"},wf={class:"zm-note-name"},Nf={class:"zm-note-meta"},Sf={class:"zm-note-scroll"},Tf={class:"zm-note-section"},Cf={class:"zm-note-section-head"},_f={class:"zm-note-split"},Af=["disabled"],Mf={key:0,class:"zm-note-preview"},Rf=["innerHTML"],Bf={key:1,class:"zm-note-preview-hint"},zf={key:0,class:"zm-note-section-actions"},If={key:0,class:"zm-note-add-row"},Of={key:1,class:"zm-note-section"},vf=["disabled"],Lf=["href","title"],Df={key:2,class:"zm-note-section"},Vf=["disabled"],$f=["src","alt"],Pf={key:3,class:"zm-note-section"},Ff={class:"zm-note-section-head"},Uf={key:0,class:"zm-note-section-tag"},Hf=["disabled"],Wf={key:0,class:"zm-note-code"},Gf=["innerHTML"],jf={key:4,class:"zm-note-section"},Kf=["disabled"],qf={key:0,class:"zm-note-table"},Yf=["onClick"],Xf={class:"zm-note-table-sort-mark","aria-hidden":"true"},ni=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,r=e.ref(""),s=e.ref(null);Vo(s,{minRows:4,maxRows:10});const c=e.computed(()=>!r.value||r.value.trim()===""),u=e.computed(()=>bf(r.value)),d=e.ref(!0);function f(){d.value=!d.value}e.watch(()=>{var B,z,oe;return[(B=n.selectedNode)==null?void 0:B.id,(oe=(z=n.selectedNode)==null?void 0:z.note)==null?void 0:oe.text]},()=>{var B,z;r.value=((z=(B=n.selectedNode)==null?void 0:B.note)==null?void 0:z.text)??""},{immediate:!0}),e.watch(()=>n.focusTick,async()=>{if(n.readonly)return;await e.nextTick();const B=document.querySelector(".zm-note-panel textarea.zm-note-textarea");if(B){B.focus();const z=B.value.length;B.setSelectionRange(z,z)}});function p(){var oe,re;if(n.readonly)return;const B=r.value,z=((re=(oe=n.selectedNode)==null?void 0:oe.note)==null?void 0:re.text)??"";B!==z&&i("apply",B)}function k(B){var z,oe;n.readonly||(B.key==="Escape"?(B.preventDefault(),r.value=((oe=(z=n.selectedNode)==null?void 0:z.note)==null?void 0:oe.text)??"",B.target.blur()):B.key==="Enter"&&(B.ctrlKey||B.metaKey)&&(B.preventDefault(),p(),B.target.blur()))}function y(){n.readonly||confirm("移除该节点的笔记?")&&(r.value="",i("remove"))}const N=e.computed(()=>{var B,z;return!!((z=(B=n.selectedNode)==null?void 0:B.link)!=null&&z.url)}),E=e.computed(()=>{var B,z;return!!((z=(B=n.selectedNode)==null?void 0:B.image)!=null&&z.src)}),L=e.computed(()=>{var B,z;return(z=(B=n.selectedNode)==null?void 0:B.richContent)==null?void 0:z.kind}),C=e.computed(()=>L.value==="code"),x=e.computed(()=>L.value==="table"),R=e.ref(!1),S=e.ref(!1),g=e.ref(!1),_=e.ref(!1);e.watch(()=>{var B;return(B=n.selectedNode)==null?void 0:B.id},()=>{R.value=!1,S.value=!1,g.value=!1,_.value=!1});const b=e.ref("");e.watch(()=>{var B,z,oe;return[(B=n.selectedNode)==null?void 0:B.id,(oe=(z=n.selectedNode)==null?void 0:z.link)==null?void 0:oe.url]},()=>{var B,z;b.value=((z=(B=n.selectedNode)==null?void 0:B.link)==null?void 0:z.url)??""},{immediate:!0});function O(){var oe,re;if(n.readonly)return;const B=b.value.trim(),z=((re=(oe=n.selectedNode)==null?void 0:oe.link)==null?void 0:re.url)??"";B!==z&&i("set-link",B)}const W=e.ref("");e.watch(()=>{var B,z,oe;return[(B=n.selectedNode)==null?void 0:B.id,(oe=(z=n.selectedNode)==null?void 0:z.image)==null?void 0:oe.src]},()=>{var B,z;W.value=((z=(B=n.selectedNode)==null?void 0:B.image)==null?void 0:z.src)??""},{immediate:!0});function ne(){var oe,re;if(n.readonly)return;const B=W.value.trim(),z=((re=(oe=n.selectedNode)==null?void 0:oe.image)==null?void 0:re.src)??"";B!==z&&i("set-image",B)}function pe(B){const z=B.target;z.style.display="none"}function K(B){const z=B.target;z.style.display=""}const ie=e.ref(""),F=e.ref(null);Vo(F,{minRows:4,maxRows:18}),e.watch(()=>{var B,z,oe;return[(B=n.selectedNode)==null?void 0:B.id,(oe=(z=n.selectedNode)==null?void 0:z.richContent)==null?void 0:oe.raw]},()=>{var B,z;ie.value=((z=(B=n.selectedNode)==null?void 0:B.richContent)==null?void 0:z.raw)??""},{immediate:!0});const q=e.computed(()=>Io(zo(ie.value),on(ie.value)));function U(){var re,D;if(n.readonly)return;const B=ie.value,z=((D=(re=n.selectedNode)==null?void 0:re.richContent)==null?void 0:D.raw)??"";if(B===z)return;const oe=on(B)||void 0;i("set-rich",B?{kind:"code",raw:B,lang:oe}:null)}const w=e.ref(""),P=e.ref(null);Vo(P,{minRows:4,maxRows:14});const V=e.ref(-1),Y=e.ref("asc");e.watch(()=>{var B,z,oe;return[(B=n.selectedNode)==null?void 0:B.id,(oe=(z=n.selectedNode)==null?void 0:z.richContent)==null?void 0:oe.raw]},()=>{var B,z;w.value=((z=(B=n.selectedNode)==null?void 0:B.richContent)==null?void 0:z.raw)??"",V.value=-1,Y.value="asc"},{immediate:!0});function ae(){var oe,re;if(n.readonly)return;const B=w.value,z=((re=(oe=n.selectedNode)==null?void 0:oe.richContent)==null?void 0:re.raw)??"";B!==z&&i("set-rich",B?{kind:"table",raw:B}:null)}const ke=e.computed(()=>dr(w.value)),Re=e.computed(()=>{const B=ke.value;return V.value<0||B.length<=1?B:ur(B,V.value,Y.value)});function Pe(B){V.value!==B?(V.value=B,Y.value="asc"):Y.value==="asc"?Y.value="desc":V.value=-1}const Te=e.computed(()=>{const B=[];return c.value||B.push(`${r.value.length} 字`),N.value&&B.push("1 链接"),E.value&&B.push("1 图片"),C.value&&B.push("代码块"),x.value&&B.push("表格"),B.length===0?"节点没有额外内容":B.join(" · ")});return(B,z)=>{var oe,re,D,T;return e.openBlock(),e.createElementBlock("div",kf,[t.selectedNode?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",Ef,[e.createElementVNode("div",xf,[z[12]||(z[12]=e.createElementVNode("span",{class:"zm-note-label"},"节点",-1)),e.createElementVNode("span",wf,e.toDisplayString(t.selectedNode.text||"(无标题)"),1)]),e.createElementVNode("div",Nf,e.toDisplayString(Te.value),1)]),e.createElementVNode("div",Sf,[e.createElementVNode("section",Tf,[e.createElementVNode("header",Cf,[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:f},e.toDisplayString(d.value?"隐藏预览":"显示预览"),1))]),e.createElementVNode("div",_f,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"noteRef",ref:s,"onUpdate:modelValue":z[0]||(z[0]=se=>r.value=se),class:"zm-note-textarea",placeholder:"写点什么吧… 支持 Markdown",spellcheck:"false",disabled:t.readonly,onBlur:p,onKeydown:k},null,40,Af),[[e.vModelText,r.value]]),d.value?(e.openBlock(),e.createElementBlock("div",Mf,[c.value?(e.openBlock(),e.createElementBlock("div",Bf," 渲染后的 Markdown 仅在此面板显示,不会撑大节点框。 ")):(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-note-preview-body",innerHTML:u.value},null,8,Rf))])):e.createCommentVNode("",!0)]),!t.readonly&&!c.value?(e.openBlock(),e.createElementBlock("div",zf,[e.createElementVNode("button",{class:"zm-note-action-btn is-danger",onClick:y},"移除笔记")])):e.createCommentVNode("",!0)]),t.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",If,[!N.value&&!R.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-note-add-chip",onClick:z[1]||(z[1]=se=>R.value=!0)},"+ 链接")):e.createCommentVNode("",!0),!E.value&&!S.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-note-add-chip",onClick:z[2]||(z[2]=se=>S.value=!0)},"+ 图片")):e.createCommentVNode("",!0),!C.value&&!g.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-note-add-chip",onClick:z[3]||(z[3]=se=>g.value=!0)},"+ 代码块")):e.createCommentVNode("",!0),!x.value&&!_.value?(e.openBlock(),e.createElementBlock("button",{key:3,class:"zm-note-add-chip",onClick:z[4]||(z[4]=se=>_.value=!0)},"+ 表格")):e.createCommentVNode("",!0)])),N.value||R.value?(e.openBlock(),e.createElementBlock("section",Of,[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]=se=>b.value=se),class:"zm-note-input",type:"url",placeholder:"https://…",disabled:t.readonly,onBlur:O,onKeydown:z[6]||(z[6]=e.withKeys(e.withModifiers(se=>se.target.blur(),["prevent"]),["enter"]))},null,40,vf),[[e.vModelText,b.value]]),N.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:(re=t.selectedNode.link)==null?void 0:re.url},e.toDisplayString((D=t.selectedNode.link)==null?void 0:D.url),9,Lf)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),E.value||S.value?(e.openBlock(),e.createElementBlock("section",Df,[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]=se=>W.value=se),class:"zm-note-input",type:"url",placeholder:"data:image/… 或 https://…",disabled:t.readonly,onBlur:ne,onKeydown:z[8]||(z[8]=e.withKeys(e.withModifiers(se=>se.target.blur(),["prevent"]),["enter"]))},null,40,Vf),[[e.vModelText,W.value]]),E.value?(e.openBlock(),e.createElementBlock("img",{key:0,class:"zm-note-image",src:(T=t.selectedNode.image)==null?void 0:T.src,alt:t.selectedNode.text,onError:pe,onLoad:K},null,40,$f)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),C.value||g.value?(e.openBlock(),e.createElementBlock("section",Pf,[e.createElementVNode("header",Ff,[z[17]||(z[17]=e.createElementVNode("span",{class:"zm-note-section-title"},"代码块",-1)),e.unref(on)(ie.value)?(e.openBlock(),e.createElementBlock("span",Uf,e.toDisplayString(e.unref(on)(ie.value)),1)):e.createCommentVNode("",!0)]),e.withDirectives(e.createElementVNode("textarea",{ref_key:"codeRef",ref:F,"onUpdate:modelValue":z[9]||(z[9]=se=>ie.value=se),class:"zm-note-input zm-note-input-code",placeholder:"```ts\nconsole.log(123)\n```",spellcheck:"false",disabled:t.readonly,onBlur:U},null,40,Hf),[[e.vModelText,ie.value]]),ie.value.trim()?(e.openBlock(),e.createElementBlock("pre",Wf,[e.createElementVNode("code",{innerHTML:q.value},null,8,Gf)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),x.value||_.value?(e.openBlock(),e.createElementBlock("section",jf,[z[18]||(z[18]=e.createElementVNode("header",{class:"zm-note-section-head"},[e.createElementVNode("span",{class:"zm-note-section-title"},"表格"),e.createElementVNode("span",{class:"zm-note-section-hint"},"点击表头排序")],-1)),e.withDirectives(e.createElementVNode("textarea",{ref_key:"tableRef",ref:P,"onUpdate:modelValue":z[10]||(z[10]=se=>w.value=se),class:"zm-note-input zm-note-input-code",placeholder:`| 列1 | 列2 |
124
+ `}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${jt(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:o,tokens:n}){let r=this.parser.parseInline(n),l=yl(t);if(l===null)return r;t=l;let s='<a href="'+t+'"';return o&&(s+=' title="'+jt(o)+'"'),s+=">"+r+"</a>",s}image({href:t,title:o,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let l=yl(t);if(l===null)return jt(n);t=l;let s=`<img src="${t}" alt="${jt(n)}"`;return o&&(s+=` title="${jt(o)}"`),s+=">",s}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:jt(t.text)}},Lr=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}checkbox({raw:t}){return t}},Vt=class oi{constructor(o){ve(this,"options");ve(this,"renderer");ve(this,"textRenderer");this.options=o||Sn,this.options.renderer=this.options.renderer||new so,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Lr}static parse(o,n){return new oi(n).parse(o)}static parseInline(o,n){return new oi(n).parseInline(o)}parse(o){var r,l;this.renderer.parser=this;let n="";for(let s=0;s<o.length;s++){let c=o[s];if((l=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&l[c.type]){let d=c,g=this.options.extensions.renderers[d.type].call({parser:this},d);if(g!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(d.type)){n+=g||"";continue}}let u=c;switch(u.type){case"space":{n+=this.renderer.space(u);break}case"hr":{n+=this.renderer.hr(u);break}case"heading":{n+=this.renderer.heading(u);break}case"code":{n+=this.renderer.code(u);break}case"table":{n+=this.renderer.table(u);break}case"blockquote":{n+=this.renderer.blockquote(u);break}case"list":{n+=this.renderer.list(u);break}case"checkbox":{n+=this.renderer.checkbox(u);break}case"html":{n+=this.renderer.html(u);break}case"def":{n+=this.renderer.def(u);break}case"paragraph":{n+=this.renderer.paragraph(u);break}case"text":{n+=this.renderer.text(u);break}default:{let d='Token with "'+u.type+'" type was not found.';if(this.options.silent)return console.error(d),"";throw new Error(d)}}}return n}parseInline(o,n=this.renderer){var l,s;this.renderer.parser=this;let r="";for(let c=0;c<o.length;c++){let u=o[c];if((s=(l=this.options.extensions)==null?void 0:l.renderers)!=null&&s[u.type]){let g=this.options.extensions.renderers[u.type].call({parser:this},u);if(g!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(u.type)){r+=g||"";continue}}let d=u;switch(d.type){case"escape":{r+=n.text(d);break}case"html":{r+=n.html(d);break}case"link":{r+=n.link(d);break}case"image":{r+=n.image(d);break}case"checkbox":{r+=n.checkbox(d);break}case"strong":{r+=n.strong(d);break}case"em":{r+=n.em(d);break}case"codespan":{r+=n.codespan(d);break}case"br":{r+=n.br(d);break}case"del":{r+=n.del(d);break}case"text":{r+=n.text(d);break}default:{let g='Token with "'+d.type+'" type was not found.';if(this.options.silent)return console.error(g),"";throw new Error(g)}}}return r}},co=(Qo=class{constructor(t){ve(this,"options");ve(this,"block");this.options=t||Sn}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?Dt.lex:Dt.lexInline}provideParser(t=this.block){return t?Vt.parse:Vt.parseInline}},ve(Qo,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),ve(Qo,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Qo),Nl=class{constructor(...t){ve(this,"defaults",Ar());ve(this,"options",this.setOptions);ve(this,"parse",this.parseMarkdown(!0));ve(this,"parseInline",this.parseMarkdown(!1));ve(this,"Parser",Vt);ve(this,"Renderer",so);ve(this,"TextRenderer",Lr);ve(this,"Lexer",Dt);ve(this,"Tokenizer",qo);ve(this,"Hooks",co);this.use(...t)}walkTokens(t,o){var r,l;let n=[];for(let s of t)switch(n=n.concat(o.call(this,s)),s.type){case"table":{let c=s;for(let u of c.header)n=n.concat(this.walkTokens(u.tokens,o));for(let u of c.rows)for(let d of u)n=n.concat(this.walkTokens(d.tokens,o));break}case"list":{let c=s;n=n.concat(this.walkTokens(c.items,o));break}default:{let c=s;(l=(r=this.defaults.extensions)==null?void 0:r.childTokens)!=null&&l[c.type]?this.defaults.extensions.childTokens[c.type].forEach(u=>{let d=c[u].flat(1/0);n=n.concat(this.walkTokens(d,o))}):c.tokens&&(n=n.concat(this.walkTokens(c.tokens,o)))}}return n}use(...t){let o=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(l=>{if(!l.name)throw new Error("extension name required");if("renderer"in l){let s=o.renderers[l.name];s?o.renderers[l.name]=function(...c){let u=l.renderer.apply(this,c);return u===!1&&(u=s.apply(this,c)),u}:o.renderers[l.name]=l.renderer}if("tokenizer"in l){if(!l.level||l.level!=="block"&&l.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=o[l.level];s?s.unshift(l.tokenizer):o[l.level]=[l.tokenizer],l.start&&(l.level==="block"?o.startBlock?o.startBlock.push(l.start):o.startBlock=[l.start]:l.level==="inline"&&(o.startInline?o.startInline.push(l.start):o.startInline=[l.start]))}"childTokens"in l&&l.childTokens&&(o.childTokens[l.name]=l.childTokens)}),r.extensions=o),n.renderer){let l=this.defaults.renderer||new so(this.defaults);for(let s in n.renderer){if(!(s in l))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let c=s,u=n.renderer[c],d=l[c];l[c]=(...g)=>{let b=u.apply(l,g);return b===!1&&(b=d.apply(l,g)),b||""}}r.renderer=l}if(n.tokenizer){let l=this.defaults.tokenizer||new qo(this.defaults);for(let s in n.tokenizer){if(!(s in l))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let c=s,u=n.tokenizer[c],d=l[c];l[c]=(...g)=>{let b=u.apply(l,g);return b===!1&&(b=d.apply(l,g)),b}}r.tokenizer=l}if(n.hooks){let l=this.defaults.hooks||new co;for(let s in n.hooks){if(!(s in l))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let c=s,u=n.hooks[c],d=l[c];co.passThroughHooks.has(s)?l[c]=g=>{if(this.defaults.async&&co.passThroughHooksRespectAsync.has(s))return(async()=>{let w=await u.call(l,g);return d.call(l,w)})();let b=u.call(l,g);return d.call(l,b)}:l[c]=(...g)=>{if(this.defaults.async)return(async()=>{let w=await u.apply(l,g);return w===!1&&(w=await d.apply(l,g)),w})();let b=u.apply(l,g);return b===!1&&(b=d.apply(l,g)),b}}r.hooks=l}if(n.walkTokens){let l=this.defaults.walkTokens,s=n.walkTokens;r.walkTokens=function(c){let u=[];return u.push(s.call(this,c)),l&&(u=u.concat(l.call(this,c))),u}}this.defaults={...this.defaults,...r}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,o){return Dt.lex(t,o??this.defaults)}parser(t,o){return Vt.parse(t,o??this.defaults)}parseMarkdown(t){return(o,n)=>{let r={...n},l={...this.defaults,...r},s=this.onError(!!l.silent,!!l.async);if(this.defaults.async===!0&&r.async===!1)return s(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof o>"u"||o===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof o!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(o)+", string expected"));if(l.hooks&&(l.hooks.options=l,l.hooks.block=t),l.async)return(async()=>{let c=l.hooks?await l.hooks.preprocess(o):o,u=await(l.hooks?await l.hooks.provideLexer(t):t?Dt.lex:Dt.lexInline)(c,l),d=l.hooks?await l.hooks.processAllTokens(u):u;l.walkTokens&&await Promise.all(this.walkTokens(d,l.walkTokens));let g=await(l.hooks?await l.hooks.provideParser(t):t?Vt.parse:Vt.parseInline)(d,l);return l.hooks?await l.hooks.postprocess(g):g})().catch(s);try{l.hooks&&(o=l.hooks.preprocess(o));let c=(l.hooks?l.hooks.provideLexer(t):t?Dt.lex:Dt.lexInline)(o,l);l.hooks&&(c=l.hooks.processAllTokens(c)),l.walkTokens&&this.walkTokens(c,l.walkTokens);let u=(l.hooks?l.hooks.provideParser(t):t?Vt.parse:Vt.parseInline)(c,l);return l.hooks&&(u=l.hooks.postprocess(u)),u}catch(c){return s(c)}}}onError(t,o){return n=>{if(n.message+=`
125
+ Please report this to https://github.com/markedjs/marked.`,t){let r="<p>An error occurred:</p><pre>"+jt(n.message+"",!0)+"</pre>";return o?Promise.resolve(r):r}if(o)return Promise.reject(n);throw n}}},Cn=new Nl;function Ae(t,o){return Cn.parse(t,o)}Ae.options=Ae.setOptions=function(t){return Cn.setOptions(t),Ae.defaults=Cn.defaults,ll(Ae.defaults),Ae},Ae.getDefaults=Ar,Ae.defaults=Sn,Ae.use=function(...t){return Cn.use(...t),Ae.defaults=Cn.defaults,ll(Ae.defaults),Ae},Ae.walkTokens=function(t,o){return Cn.walkTokens(t,o)},Ae.parseInline=Cn.parseInline,Ae.Parser=Vt,Ae.parser=Vt.parse,Ae.Renderer=so,Ae.TextRenderer=Lr,Ae.Lexer=Dt,Ae.lexer=Dt.lex,Ae.Tokenizer=qo,Ae.Hooks=co,Ae.parse=Ae,Ae.options,Ae.setOptions,Ae.use,Ae.walkTokens,Ae.parseInline,Vt.parse,Dt.lex;/*! @license DOMPurify 3.4.8 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.8/LICENSE */function Sl(t,o){(o==null||o>t.length)&&(o=t.length);for(var n=0,r=Array(o);n<o;n++)r[n]=t[n];return r}function Df(t){if(Array.isArray(t))return t}function Vf(t,o){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,l,s,c,u=[],d=!0,g=!1;try{if(s=(n=n.call(t)).next,o!==0)for(;!(d=(r=s.call(n)).done)&&(u.push(r.value),u.length!==o);d=!0);}catch(b){g=!0,l=b}finally{try{if(!d&&n.return!=null&&(c=n.return(),Object(c)!==c))return}finally{if(g)throw l}}return u}}function $f(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
126
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Pf(t,o){return Df(t)||Vf(t,o)||Uf(t,o)||$f()}function Uf(t,o){if(t){if(typeof t=="string")return Sl(t,o);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Sl(t,o):void 0}}const Tl=Object.entries,Cl=Object.setPrototypeOf,Ff=Object.isFrozen,Hf=Object.getPrototypeOf,Wf=Object.getOwnPropertyDescriptor;let st=Object.freeze,vt=Object.seal,Un=Object.create,Al=typeof Reflect<"u"&&Reflect,Dr=Al.apply,Vr=Al.construct;st||(st=function(o){return o}),vt||(vt=function(o){return o}),Dr||(Dr=function(o,n){for(var r=arguments.length,l=new Array(r>2?r-2:0),s=2;s<r;s++)l[s-2]=arguments[s];return o.apply(n,l)}),Vr||(Vr=function(o){for(var n=arguments.length,r=new Array(n>1?n-1:0),l=1;l<n;l++)r[l-1]=arguments[l];return new o(...r)});const An=We(Array.prototype.forEach),Gf=We(Array.prototype.lastIndexOf),_l=We(Array.prototype.pop),Fn=We(Array.prototype.push),jf=We(Array.prototype.splice),ct=Array.isArray,uo=We(String.prototype.toLowerCase),$r=We(String.prototype.toString),Ml=We(String.prototype.match),Hn=We(String.prototype.replace),vl=We(String.prototype.indexOf),Kf=We(String.prototype.trim),Yf=We(Number.prototype.toString),qf=We(Boolean.prototype.toString),Rl=typeof BigInt>"u"?null:We(BigInt.prototype.toString),Bl=typeof Symbol>"u"?null:We(Symbol.prototype.toString),$e=We(Object.prototype.hasOwnProperty),fo=We(Object.prototype.toString),et=We(RegExp.prototype.test),Wn=Xf(TypeError);function We(t){return function(o){o instanceof RegExp&&(o.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),l=1;l<n;l++)r[l-1]=arguments[l];return Dr(t,o,r)}}function Xf(t){return function(){for(var o=arguments.length,n=new Array(o),r=0;r<o;r++)n[r]=arguments[r];return Vr(t,n)}}function ue(t,o){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:uo;if(Cl&&Cl(t,null),!ct(o))return t;let r=o.length;for(;r--;){let l=o[r];if(typeof l=="string"){const s=n(l);s!==l&&(Ff(o)||(o[r]=s),l=s)}t[l]=!0}return t}function Zf(t){for(let o=0;o<t.length;o++)$e(t,o)||(t[o]=null);return t}function rt(t){const o=Un(null);for(const r of Tl(t)){var n=Pf(r,2);const l=n[0],s=n[1];$e(t,l)&&(ct(s)?o[l]=Zf(s):s&&typeof s=="object"&&s.constructor===Object?o[l]=rt(s):o[l]=s)}return o}function Jf(t){switch(typeof t){case"string":return t;case"number":return Yf(t);case"boolean":return qf(t);case"bigint":return Rl?Rl(t):"0";case"symbol":return Bl?Bl(t):"Symbol()";case"undefined":return fo(t);case"function":case"object":{if(t===null)return fo(t);const o=t,n=Kt(o,"toString");if(typeof n=="function"){const r=n(o);return typeof r=="string"?r:fo(r)}return fo(t)}default:return fo(t)}}function Kt(t,o){for(;t!==null;){const r=Wf(t,o);if(r){if(r.get)return We(r.get);if(typeof r.value=="function")return We(r.value)}t=Hf(t)}function n(){return null}return n}function Qf(t){try{return et(t,""),!0}catch{return!1}}const Il=st(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Pr=st(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Ur=st(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),em=st(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Fr=st(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),tm=st(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),zl=st(["#text"]),Ol=st(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Hr=st(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Ll=st(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Xo=st(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),nm=vt(/{{[\w\W]*|^[\w\W]*}}/g),om=vt(/<%[\w\W]*|^[\w\W]*%>/g),rm=vt(/\${[\w\W]*/g),im=vt(/^data-[\-\w.\u00B7-\uFFFF]+$/),lm=vt(/^aria-[\-\w]+$/),Dl=vt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),am=vt(/^(?:\w+script|data):/i),sm=vt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),cm=vt(/^html$/i),dm=vt(/^[a-z][.\w]*(-[.\w]+)+$/i),Yt={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},um=function(){return typeof window>"u"?null:window},fm=function(o,n){if(typeof o!="object"||typeof o.createPolicy!="function")return null;let r=null;const l="data-tt-policy-suffix";n&&n.hasAttribute(l)&&(r=n.getAttribute(l));const s="dompurify"+(r?"#"+r:"");try{return o.createPolicy(s,{createHTML(c){return c},createScriptURL(c){return c}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},Vl=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function $l(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:um();const o=R=>$l(R);if(o.version="3.4.8",o.removed=[],!t||!t.document||t.document.nodeType!==Yt.document||!t.Element)return o.isSupported=!1,o;let n=t.document;const r=n,l=r.currentScript;t.DocumentFragment;const s=t.HTMLTemplateElement,c=t.Node,u=t.Element,d=t.NodeFilter,g=t.NamedNodeMap;g===void 0&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const b=t.DOMParser,w=t.trustedTypes,N=u.prototype,$=Kt(N,"cloneNode"),M=Kt(N,"remove"),P=Kt(N,"nextSibling"),I=Kt(N,"childNodes"),C=Kt(N,"parentNode"),E=Kt(N,"shadowRoot"),k=Kt(N,"attributes"),m=c&&c.prototype?Kt(c.prototype,"nodeType"):null,B=c&&c.prototype?Kt(c.prototype,"nodeName"):null;if(typeof s=="function"){const R=n.createElement("template");R.content&&R.content.ownerDocument&&(n=R.content.ownerDocument)}let x,K="",Y=0;const ee=function(h){if(Y>0)throw Wn('The configured TRUSTED_TYPES_POLICY.createHTML must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose createHTML wraps DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.');Y++;try{return x.createHTML(h)}finally{Y--}},ae=n,re=ae.implementation,q=ae.createNodeIterator,Q=ae.createDocumentFragment,ie=ae.getElementsByTagName,z=r.importNode;let A=Vl();o.isSupported=typeof Tl=="function"&&typeof C=="function"&&re&&re.createHTMLDocument!==void 0;const F=nm,U=om,G=rm,le=im,Ne=lm,_e=am,Re=sm,xe=dm;let y=Dl,p=null;const L=ue({},[...Il,...Pr,...Ur,...Fr,...zl]);let V=null;const X=ue({},[...Ol,...Hr,...Ll,...Xo]);let se=Object.seal(Un(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ge=null,Ge=null;const Pe=Object.seal(Un(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Ze=!0,je=!0,tn=!1,Rt=!0,J=!1,it=!0,Te=!1,Se=!1,Bt=!1,Je=!1,gt=!1,dt=!1,H=!0,Z=!1;const ce="user-content-";let ke=!0,ze=!1,Qe={},ht=null;const Mn=ue({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let er=null;const tr=ue({},["audio","video","img","source","image","track"]);let mo=null;const nr=ue({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),jn="http://www.w3.org/1998/Math/MathML",Kn="http://www.w3.org/2000/svg",It="http://www.w3.org/1999/xhtml";let mn=It,po=!1,go=null;const Wr=ue({},[jn,Kn,It],$r);let ho=ue({},["mi","mo","mn","ms","mtext"]),bo=ue({},["annotation-xml"]);const Gr=ue({},["title","style","font","a","script"]);let vn=null;const or=["application/xhtml+xml","text/html"],jr="text/html";let Oe=null,pn=null;const rr=n.createElement("form"),ir=function(h){return h instanceof RegExp||h instanceof Function},Yn=function(){let h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(pn&&pn===h)return;(!h||typeof h!="object")&&(h={}),h=rt(h),vn=or.indexOf(h.PARSER_MEDIA_TYPE)===-1?jr:h.PARSER_MEDIA_TYPE,Oe=vn==="application/xhtml+xml"?$r:uo,p=$e(h,"ALLOWED_TAGS")&&ct(h.ALLOWED_TAGS)?ue({},h.ALLOWED_TAGS,Oe):L,V=$e(h,"ALLOWED_ATTR")&&ct(h.ALLOWED_ATTR)?ue({},h.ALLOWED_ATTR,Oe):X,go=$e(h,"ALLOWED_NAMESPACES")&&ct(h.ALLOWED_NAMESPACES)?ue({},h.ALLOWED_NAMESPACES,$r):Wr,mo=$e(h,"ADD_URI_SAFE_ATTR")&&ct(h.ADD_URI_SAFE_ATTR)?ue(rt(nr),h.ADD_URI_SAFE_ATTR,Oe):nr,er=$e(h,"ADD_DATA_URI_TAGS")&&ct(h.ADD_DATA_URI_TAGS)?ue(rt(tr),h.ADD_DATA_URI_TAGS,Oe):tr,ht=$e(h,"FORBID_CONTENTS")&&ct(h.FORBID_CONTENTS)?ue({},h.FORBID_CONTENTS,Oe):Mn,ge=$e(h,"FORBID_TAGS")&&ct(h.FORBID_TAGS)?ue({},h.FORBID_TAGS,Oe):rt({}),Ge=$e(h,"FORBID_ATTR")&&ct(h.FORBID_ATTR)?ue({},h.FORBID_ATTR,Oe):rt({}),Qe=$e(h,"USE_PROFILES")?h.USE_PROFILES&&typeof h.USE_PROFILES=="object"?rt(h.USE_PROFILES):h.USE_PROFILES:!1,Ze=h.ALLOW_ARIA_ATTR!==!1,je=h.ALLOW_DATA_ATTR!==!1,tn=h.ALLOW_UNKNOWN_PROTOCOLS||!1,Rt=h.ALLOW_SELF_CLOSE_IN_ATTR!==!1,J=h.SAFE_FOR_TEMPLATES||!1,it=h.SAFE_FOR_XML!==!1,Te=h.WHOLE_DOCUMENT||!1,Je=h.RETURN_DOM||!1,gt=h.RETURN_DOM_FRAGMENT||!1,dt=h.RETURN_TRUSTED_TYPE||!1,Bt=h.FORCE_BODY||!1,H=h.SANITIZE_DOM!==!1,Z=h.SANITIZE_NAMED_PROPS||!1,ke=h.KEEP_CONTENT!==!1,ze=h.IN_PLACE||!1,y=Qf(h.ALLOWED_URI_REGEXP)?h.ALLOWED_URI_REGEXP:Dl,mn=typeof h.NAMESPACE=="string"?h.NAMESPACE:It,ho=$e(h,"MATHML_TEXT_INTEGRATION_POINTS")&&h.MATHML_TEXT_INTEGRATION_POINTS&&typeof h.MATHML_TEXT_INTEGRATION_POINTS=="object"?rt(h.MATHML_TEXT_INTEGRATION_POINTS):ue({},["mi","mo","mn","ms","mtext"]),bo=$e(h,"HTML_INTEGRATION_POINTS")&&h.HTML_INTEGRATION_POINTS&&typeof h.HTML_INTEGRATION_POINTS=="object"?rt(h.HTML_INTEGRATION_POINTS):ue({},["annotation-xml"]);const O=$e(h,"CUSTOM_ELEMENT_HANDLING")&&h.CUSTOM_ELEMENT_HANDLING&&typeof h.CUSTOM_ELEMENT_HANDLING=="object"?rt(h.CUSTOM_ELEMENT_HANDLING):Un(null);if(se=Un(null),$e(O,"tagNameCheck")&&ir(O.tagNameCheck)&&(se.tagNameCheck=O.tagNameCheck),$e(O,"attributeNameCheck")&&ir(O.attributeNameCheck)&&(se.attributeNameCheck=O.attributeNameCheck),$e(O,"allowCustomizedBuiltInElements")&&typeof O.allowCustomizedBuiltInElements=="boolean"&&(se.allowCustomizedBuiltInElements=O.allowCustomizedBuiltInElements),J&&(je=!1),gt&&(Je=!0),Qe&&(p=ue({},zl),V=Un(null),Qe.html===!0&&(ue(p,Il),ue(V,Ol)),Qe.svg===!0&&(ue(p,Pr),ue(V,Hr),ue(V,Xo)),Qe.svgFilters===!0&&(ue(p,Ur),ue(V,Hr),ue(V,Xo)),Qe.mathMl===!0&&(ue(p,Fr),ue(V,Ll),ue(V,Xo))),Pe.tagCheck=null,Pe.attributeCheck=null,$e(h,"ADD_TAGS")&&(typeof h.ADD_TAGS=="function"?Pe.tagCheck=h.ADD_TAGS:ct(h.ADD_TAGS)&&(p===L&&(p=rt(p)),ue(p,h.ADD_TAGS,Oe))),$e(h,"ADD_ATTR")&&(typeof h.ADD_ATTR=="function"?Pe.attributeCheck=h.ADD_ATTR:ct(h.ADD_ATTR)&&(V===X&&(V=rt(V)),ue(V,h.ADD_ATTR,Oe))),$e(h,"ADD_URI_SAFE_ATTR")&&ct(h.ADD_URI_SAFE_ATTR)&&ue(mo,h.ADD_URI_SAFE_ATTR,Oe),$e(h,"FORBID_CONTENTS")&&ct(h.FORBID_CONTENTS)&&(ht===Mn&&(ht=rt(ht)),ue(ht,h.FORBID_CONTENTS,Oe)),$e(h,"ADD_FORBID_CONTENTS")&&ct(h.ADD_FORBID_CONTENTS)&&(ht===Mn&&(ht=rt(ht)),ue(ht,h.ADD_FORBID_CONTENTS,Oe)),ke&&(p["#text"]=!0),Te&&ue(p,["html","head","body"]),p.table&&(ue(p,["tbody"]),delete ge.tbody),h.TRUSTED_TYPES_POLICY){if(typeof h.TRUSTED_TYPES_POLICY.createHTML!="function")throw Wn('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof h.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Wn('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const W=x;x=h.TRUSTED_TYPES_POLICY;try{K=ee("")}catch(we){throw x=W,we}}else x===void 0&&h.TRUSTED_TYPES_POLICY!==null&&(x=fm(w,l)),x&&typeof K=="string"&&(K=ee(""));(A.uponSanitizeElement.length>0||A.uponSanitizeAttribute.length>0)&&p===L&&(p=rt(p)),A.uponSanitizeAttribute.length>0&&V===X&&(V=rt(V)),st&&st(h),pn=h},ko=ue({},[...Pr,...Ur,...em]),gn=ue({},[...Fr,...tm]),Kr=function(h){let O=C(h);(!O||!O.tagName)&&(O={namespaceURI:mn,tagName:"template"});const W=uo(h.tagName),we=uo(O.tagName);return go[h.namespaceURI]?h.namespaceURI===Kn?O.namespaceURI===It?W==="svg":O.namespaceURI===jn?W==="svg"&&(we==="annotation-xml"||ho[we]):!!ko[W]:h.namespaceURI===jn?O.namespaceURI===It?W==="math":O.namespaceURI===Kn?W==="math"&&bo[we]:!!gn[W]:h.namespaceURI===It?O.namespaceURI===Kn&&!bo[we]||O.namespaceURI===jn&&!ho[we]?!1:!gn[W]&&(Gr[W]||!ko[W]):!!(vn==="application/xhtml+xml"&&go[h.namespaceURI]):!1},Et=function(h){Fn(o.removed,{element:h});try{C(h).removeChild(h)}catch{M(h)}},qt=function(h,O){try{Fn(o.removed,{attribute:O.getAttributeNode(h),from:O})}catch{Fn(o.removed,{attribute:null,from:O})}if(O.removeAttribute(h),h==="is")if(Je||gt)try{Et(O)}catch{}else try{O.setAttribute(h,"")}catch{}},yo=function(h){let O=null,W=null;if(Bt)h="<remove></remove>"+h;else{const Ce=Ml(h,/^[\r\n\t ]+/);W=Ce&&Ce[0]}vn==="application/xhtml+xml"&&mn===It&&(h='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+h+"</body></html>");const we=x?ee(h):h;if(mn===It)try{O=new b().parseFromString(we,vn)}catch{}if(!O||!O.documentElement){O=re.createDocument(mn,"template",null);try{O.documentElement.innerHTML=po?K:we}catch{}}const fe=O.body||O.documentElement;return h&&W&&fe.insertBefore(n.createTextNode(W),fe.childNodes[0]||null),mn===It?ie.call(O,Te?"html":"body")[0]:Te?O.documentElement:fe},qn=function(h){return q.call(h.ownerDocument||h,h,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},Rn=function(h){var O,W;h.normalize();const we=q.call(h.ownerDocument||h,h,d.SHOW_TEXT|d.SHOW_COMMENT|d.SHOW_CDATA_SECTION|d.SHOW_PROCESSING_INSTRUCTION,null);let fe=we.nextNode();for(;fe;){let Le=fe.data;An([F,U,G],bt=>{Le=Hn(Le,bt," ")}),fe.data=Le,fe=we.nextNode()}const Ce=(O=(W=h.querySelectorAll)===null||W===void 0?void 0:W.call(h,"template"))!==null&&O!==void 0?O:[];An(Array.from(Ce),Le=>{hn(Le.content)&&Rn(Le.content)})},Xn=function(h){const O=B?B(h):null;return typeof O!="string"||Oe(O)!=="form"?!1:typeof h.nodeName!="string"||typeof h.textContent!="string"||typeof h.removeChild!="function"||h.attributes!==k(h)||typeof h.removeAttribute!="function"||typeof h.setAttribute!="function"||typeof h.namespaceURI!="string"||typeof h.insertBefore!="function"||typeof h.hasChildNodes!="function"||h.nodeType!==m(h)||h.childNodes!==I(h)},hn=function(h){if(!m||typeof h!="object"||h===null)return!1;try{return m(h)===Yt.documentFragment}catch{return!1}},Zn=function(h){if(!m||typeof h!="object"||h===null)return!1;try{return typeof m(h)=="number"}catch{return!1}};function xt(R,h,O){An(R,W=>{W.call(o,h,O,pn)})}const Jn=function(h){let O=null;if(xt(A.beforeSanitizeElements,h,null),Xn(h))return Et(h),!0;const W=Oe(B?B(h):h.nodeName);if(xt(A.uponSanitizeElement,h,{tagName:W,allowedTags:p}),it&&h.hasChildNodes()&&!Zn(h.firstElementChild)&&et(/<[/\w!]/g,h.innerHTML)&&et(/<[/\w!]/g,h.textContent)||it&&h.namespaceURI===It&&W==="style"&&Zn(h.firstElementChild)||h.nodeType===Yt.progressingInstruction||it&&h.nodeType===Yt.comment&&et(/<[/\w]/g,h.data))return Et(h),!0;if(ge[W]||!(Pe.tagCheck instanceof Function&&Pe.tagCheck(W))&&!p[W]){if(!ge[W]&&pe(W)&&(se.tagNameCheck instanceof RegExp&&et(se.tagNameCheck,W)||se.tagNameCheck instanceof Function&&se.tagNameCheck(W)))return!1;if(ke&&!ht[W]){const fe=C(h),Ce=I(h);if(Ce&&fe){const Le=Ce.length;for(let bt=Le-1;bt>=0;--bt){const kt=$(Ce[bt],!0);fe.insertBefore(kt,P(h))}}}return Et(h),!0}return(m?m(h):h.nodeType)===Yt.element&&!Kr(h)||(W==="noscript"||W==="noembed"||W==="noframes")&&et(/<\/no(script|embed|frames)/i,h.innerHTML)?(Et(h),!0):(J&&h.nodeType===Yt.text&&(O=h.textContent,An([F,U,G],fe=>{O=Hn(O,fe," ")}),h.textContent!==O&&(Fn(o.removed,{element:h.cloneNode()}),h.textContent=O)),xt(A.afterSanitizeElements,h,null),!1)},$t=function(h,O,W){if(Ge[O]||H&&(O==="id"||O==="name")&&(W in n||W in rr))return!1;const we=V[O]||Pe.attributeCheck instanceof Function&&Pe.attributeCheck(O,h);if(!(je&&!Ge[O]&&et(le,O))){if(!(Ze&&et(Ne,O))){if(!we||Ge[O]){if(!(pe(h)&&(se.tagNameCheck instanceof RegExp&&et(se.tagNameCheck,h)||se.tagNameCheck instanceof Function&&se.tagNameCheck(h))&&(se.attributeNameCheck instanceof RegExp&&et(se.attributeNameCheck,O)||se.attributeNameCheck instanceof Function&&se.attributeNameCheck(O,h))||O==="is"&&se.allowCustomizedBuiltInElements&&(se.tagNameCheck instanceof RegExp&&et(se.tagNameCheck,W)||se.tagNameCheck instanceof Function&&se.tagNameCheck(W))))return!1}else if(!mo[O]){if(!et(y,Hn(W,Re,""))){if(!((O==="src"||O==="xlink:href"||O==="href")&&h!=="script"&&vl(W,"data:")===0&&er[h])){if(!(tn&&!et(_e,Hn(W,Re,"")))){if(W)return!1}}}}}}return!0},Me=ue({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),pe=function(h){return!Me[uo(h)]&&et(xe,h)},lr=function(h){xt(A.beforeSanitizeAttributes,h,null);const O=h.attributes;if(!O||Xn(h))return;const W={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:V,forceKeepAttr:void 0};let we=O.length;for(;we--;){const fe=O[we],Ce=fe.name,Le=fe.namespaceURI,bt=fe.value,kt=Oe(Ce),Pt=bt;let He=Ce==="value"?Pt:Kf(Pt);if(W.attrName=kt,W.attrValue=He,W.keepAttr=!0,W.forceKeepAttr=void 0,xt(A.uponSanitizeAttribute,h,W),He=W.attrValue,Z&&(kt==="id"||kt==="name")&&vl(He,ce)!==0&&(qt(Ce,h),He=ce+He),it&&et(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,He)){qt(Ce,h);continue}if(kt==="attributename"&&Ml(He,"href")){qt(Ce,h);continue}if(W.forceKeepAttr)continue;if(!W.keepAttr){qt(Ce,h);continue}if(!Rt&&et(/\/>/i,He)){qt(Ce,h);continue}J&&An([F,U,G],nn=>{He=Hn(He,nn," ")});const Eo=Oe(h.nodeName);if(!$t(Eo,kt,He)){qt(Ce,h);continue}if(x&&typeof w=="object"&&typeof w.getAttributeType=="function"&&!Le)switch(w.getAttributeType(Eo,kt)){case"TrustedHTML":{He=ee(He);break}case"TrustedScriptURL":{He=x.createScriptURL(He);break}}if(He!==Pt)try{Le?h.setAttributeNS(Le,Ce,He):h.setAttribute(Ce,He),Xn(h)?Et(h):_l(o.removed)}catch{qt(Ce,h)}}xt(A.afterSanitizeAttributes,h,null)},tt=function(h){let O=null;const W=qn(h);for(xt(A.beforeSanitizeShadowDOM,h,null);O=W.nextNode();)if(xt(A.uponSanitizeShadowNode,O,null),Jn(O),lr(O),hn(O.content)&&tt(O.content),(m?m(O):O.nodeType)===Yt.element){const fe=E?E(O):O.shadowRoot;hn(fe)&&(Xt(fe),tt(fe))}xt(A.afterSanitizeShadowDOM,h,null)},Xt=function(h){const O=m?m(h):h.nodeType;if(O===Yt.element){const fe=E?E(h):h.shadowRoot;hn(fe)&&(Xt(fe),tt(fe))}const W=I?I(h):h.childNodes;if(!W)return;const we=[];An(W,fe=>{Fn(we,fe)});for(const fe of we)Xt(fe);if(O===Yt.element){const fe=B?B(h):null;if(typeof fe=="string"&&Oe(fe)==="template"){const Ce=h.content;hn(Ce)&&Xt(Ce)}}};return o.sanitize=function(R){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},O=null,W=null,we=null,fe=null;if(po=!R,po&&(R="<!-->"),typeof R!="string"&&!Zn(R)&&(R=Jf(R),typeof R!="string"))throw Wn("dirty is not a string, aborting");if(!o.isSupported)return R;if(Se||Yn(h),o.removed=[],typeof R=="string"&&(ze=!1),ze){const bt=B?B(R):R.nodeName;if(typeof bt=="string"){const kt=Oe(bt);if(!p[kt]||ge[kt])throw Wn("root node is forbidden and cannot be sanitized in-place")}if(Xn(R))throw Wn("root node is clobbered and cannot be sanitized in-place");Xt(R)}else if(Zn(R))O=yo("<!---->"),W=O.ownerDocument.importNode(R,!0),W.nodeType===Yt.element&&W.nodeName==="BODY"||W.nodeName==="HTML"?O=W:O.appendChild(W),Xt(W);else{if(!Je&&!J&&!Te&&R.indexOf("<")===-1)return x&&dt?ee(R):R;if(O=yo(R),!O)return Je?null:dt?K:""}O&&Bt&&Et(O.firstChild);const Ce=qn(ze?R:O);for(;we=Ce.nextNode();)Jn(we),lr(we),hn(we.content)&&tt(we.content);if(ze)return J&&Rn(R),R;if(Je){if(J&&Rn(O),gt)for(fe=Q.call(O.ownerDocument);O.firstChild;)fe.appendChild(O.firstChild);else fe=O;return(V.shadowroot||V.shadowrootmode)&&(fe=z.call(r,fe,!0)),fe}let Le=Te?O.outerHTML:O.innerHTML;return Te&&p["!doctype"]&&O.ownerDocument&&O.ownerDocument.doctype&&O.ownerDocument.doctype.name&&et(cm,O.ownerDocument.doctype.name)&&(Le="<!DOCTYPE "+O.ownerDocument.doctype.name+`>
127
+ `+Le),J&&An([F,U,G],bt=>{Le=Hn(Le,bt," ")}),x&&dt?ee(Le):Le},o.setConfig=function(){let R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Yn(R),Se=!0},o.clearConfig=function(){pn=null,Se=!1},o.isValidAttribute=function(R,h,O){pn||Yn({});const W=Oe(R),we=Oe(h);return $t(W,we,O)},o.addHook=function(R,h){typeof h=="function"&&Fn(A[R],h)},o.removeHook=function(R,h){if(h!==void 0){const O=Gf(A[R],h);return O===-1?void 0:jf(A[R],O,1)[0]}return _l(A[R])},o.removeHooks=function(R){A[R]=[]},o.removeAllHooks=function(){A=Vl()},o}var mm=$l();const pm=new Nl({gfm:!0,breaks:!0,pedantic:!1,renderer:(()=>{const t=new so;return t.code=({text:o,lang:n})=>{const r=(n??"").toLowerCase(),l=Tr(o,r);return`<pre><code${r?` class="language-${r}"`:""}>${l}</code></pre>`},t})()}),gm=["p","br","strong","em","del","s","u","a","ul","ol","li","h1","h2","h3","h4","h5","h6","blockquote","code","pre","hr","table","thead","tbody","tr","th","td","img","span","input"],hm=["href","title","target","rel","src","alt","class","checked","type","disabled"],bm=/^(?:(?:https?|mailto|tel|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i;function km(t){if(!t)return"";const o=pm.parse(t,{async:!1});return mm.sanitize(o,{ALLOWED_TAGS:gm,ALLOWED_ATTR:hm,ALLOWED_URI_REGEXP:bm})}const ym={class:"zm-note-panel"},Em={key:0,class:"zm-note-empty"},xm={class:"zm-note-header"},wm={class:"zm-note-title-row"},Nm={class:"zm-note-name"},Sm={class:"zm-note-meta"},Tm={class:"zm-note-scroll"},Cm={class:"zm-note-section"},Am={class:"zm-note-section-head"},_m={class:"zm-note-split"},Mm=["disabled"],vm={key:0,class:"zm-note-preview"},Rm=["innerHTML"],Bm={key:1,class:"zm-note-preview-hint"},Im={key:0,class:"zm-note-section-actions"},zm={key:0,class:"zm-note-add-row"},Om={key:1,class:"zm-note-section"},Lm=["disabled"],Dm=["href","title"],Vm={key:2,class:"zm-note-section"},$m=["disabled"],Pm=["src","alt"],Um={key:3,class:"zm-note-section"},Fm={class:"zm-note-section-head"},Hm={key:0,class:"zm-note-section-tag"},Wm=["disabled"],Gm={key:0,class:"zm-note-code"},jm=["innerHTML"],Km={key:4,class:"zm-note-section"},Ym=["disabled"],qm={key:0,class:"zm-note-table"},Xm=["onClick"],Zm={class:"zm-note-table-sort-mark","aria-hidden":"true"},Zo=e.defineComponent({__name:"NotePanel",props:{selectedNode:{},readonly:{type:Boolean},focusTick:{}},emits:["apply","remove","set-link","set-image","set-rich"],setup(t,{emit:o}){const n=t,r=o,l=e.ref(""),s=e.ref(null);hr(s,{minRows:4,maxRows:10});const c=e.computed(()=>!l.value||l.value.trim()===""),u=e.computed(()=>km(l.value)),d=e.ref(!0);function g(){d.value=!d.value}e.watch(()=>{var y,p,L;return[(y=n.selectedNode)==null?void 0:y.id,(L=(p=n.selectedNode)==null?void 0:p.note)==null?void 0:L.text]},()=>{var y,p;l.value=((p=(y=n.selectedNode)==null?void 0:y.note)==null?void 0:p.text)??""},{immediate:!0}),e.watch(()=>n.focusTick,async()=>{if(n.readonly)return;await e.nextTick();const y=document.querySelector(".zm-note-panel textarea.zm-note-textarea");if(y){y.focus();const p=y.value.length;y.setSelectionRange(p,p)}});function b(){var L,V;if(n.readonly)return;const y=l.value,p=((V=(L=n.selectedNode)==null?void 0:L.note)==null?void 0:V.text)??"";y!==p&&r("apply",y)}function w(y){var p,L;n.readonly||(y.key==="Escape"?(y.preventDefault(),l.value=((L=(p=n.selectedNode)==null?void 0:p.note)==null?void 0:L.text)??"",y.target.blur()):y.key==="Enter"&&(y.ctrlKey||y.metaKey)&&(y.preventDefault(),b(),y.target.blur()))}function N(){n.readonly||confirm("移除该节点的笔记?")&&(l.value="",r("remove"))}const $=e.computed(()=>{var y,p;return!!((p=(y=n.selectedNode)==null?void 0:y.link)!=null&&p.url)}),M=e.computed(()=>{var y,p;return!!((p=(y=n.selectedNode)==null?void 0:y.image)!=null&&p.src)}),P=e.computed(()=>{var y,p;return(p=(y=n.selectedNode)==null?void 0:y.richContent)==null?void 0:p.kind}),I=e.computed(()=>P.value==="code"),C=e.computed(()=>P.value==="table"),E=e.ref(!1),k=e.ref(!1),m=e.ref(!1),B=e.ref(!1);e.watch(()=>{var y;return(y=n.selectedNode)==null?void 0:y.id},()=>{E.value=!1,k.value=!1,m.value=!1,B.value=!1});const x=e.ref("");e.watch(()=>{var y,p,L;return[(y=n.selectedNode)==null?void 0:y.id,(L=(p=n.selectedNode)==null?void 0:p.link)==null?void 0:L.url]},()=>{var y,p;x.value=((p=(y=n.selectedNode)==null?void 0:y.link)==null?void 0:p.url)??""},{immediate:!0});function K(){var L,V;if(n.readonly)return;const y=x.value.trim(),p=((V=(L=n.selectedNode)==null?void 0:L.link)==null?void 0:V.url)??"";y!==p&&r("set-link",y)}const Y=e.ref("");e.watch(()=>{var y,p,L;return[(y=n.selectedNode)==null?void 0:y.id,(L=(p=n.selectedNode)==null?void 0:p.image)==null?void 0:L.src]},()=>{var y,p;Y.value=((p=(y=n.selectedNode)==null?void 0:y.image)==null?void 0:p.src)??""},{immediate:!0});function ee(){var L,V;if(n.readonly)return;const y=Y.value.trim(),p=((V=(L=n.selectedNode)==null?void 0:L.image)==null?void 0:V.src)??"";y!==p&&r("set-image",y)}function ae(y){const p=y.target;p.style.display="none"}function re(y){const p=y.target;p.style.display=""}const q=e.ref(""),Q=e.ref(null);hr(Q,{minRows:4,maxRows:18}),e.watch(()=>{var y,p,L;return[(y=n.selectedNode)==null?void 0:y.id,(L=(p=n.selectedNode)==null?void 0:p.richContent)==null?void 0:L.raw]},()=>{var y,p;q.value=((p=(y=n.selectedNode)==null?void 0:y.richContent)==null?void 0:p.raw)??""},{immediate:!0});const ie=e.computed(()=>Tr(Wo(q.value),Nn(q.value)));function z(){var V,X;if(n.readonly)return;const y=q.value,p=((X=(V=n.selectedNode)==null?void 0:V.richContent)==null?void 0:X.raw)??"";if(y===p)return;const L=Nn(y)||void 0;r("set-rich",y?{kind:"code",raw:y,lang:L}:null)}const A=e.ref(""),F=e.ref(null);hr(F,{minRows:4,maxRows:14});const U=e.ref(-1),G=e.ref("asc");e.watch(()=>{var y,p,L;return[(y=n.selectedNode)==null?void 0:y.id,(L=(p=n.selectedNode)==null?void 0:p.richContent)==null?void 0:L.raw]},()=>{var y,p;A.value=((p=(y=n.selectedNode)==null?void 0:y.richContent)==null?void 0:p.raw)??"",U.value=-1,G.value="asc"},{immediate:!0});function le(){var L,V;if(n.readonly)return;const y=A.value,p=((V=(L=n.selectedNode)==null?void 0:L.richContent)==null?void 0:V.raw)??"";y!==p&&r("set-rich",y?{kind:"table",raw:y}:null)}const Ne=e.computed(()=>Cr(A.value)),_e=e.computed(()=>{const y=Ne.value;return U.value<0||y.length<=1?y:il(y,U.value,G.value)});function Re(y){U.value!==y?(U.value=y,G.value="asc"):G.value==="asc"?G.value="desc":U.value=-1}const xe=e.computed(()=>{const y=[];return c.value||y.push(`${l.value.length} 字`),$.value&&y.push("1 链接"),M.value&&y.push("1 图片"),I.value&&y.push("代码块"),C.value&&y.push("表格"),y.length===0?"节点没有额外内容":y.join(" · ")});return(y,p)=>{var L,V,X,se;return e.openBlock(),e.createElementBlock("div",ym,[t.selectedNode?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",xm,[e.createElementVNode("div",wm,[p[12]||(p[12]=e.createElementVNode("span",{class:"zm-note-label"},"节点",-1)),e.createElementVNode("span",Nm,e.toDisplayString(t.selectedNode.text||"(无标题)"),1)]),e.createElementVNode("div",Sm,e.toDisplayString(xe.value),1)]),e.createElementVNode("div",Tm,[e.createElementVNode("section",Cm,[e.createElementVNode("header",Am,[p[13]||(p[13]=e.createElementVNode("span",{class:"zm-note-section-title"},"笔记",-1)),p[14]||(p[14]=e.createElementVNode("span",{class:"zm-note-section-hint"},"Ctrl+Enter 提交, Esc 取消",-1)),t.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"zm-note-preview-toggle",onClick:g},e.toDisplayString(d.value?"隐藏预览":"显示预览"),1))]),e.createElementVNode("div",_m,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"noteRef",ref:s,"onUpdate:modelValue":p[0]||(p[0]=ge=>l.value=ge),class:"zm-note-textarea",placeholder:"写点什么吧… 支持 Markdown",spellcheck:"false",disabled:t.readonly,onBlur:b,onKeydown:w},null,40,Mm),[[e.vModelText,l.value]]),d.value?(e.openBlock(),e.createElementBlock("div",vm,[c.value?(e.openBlock(),e.createElementBlock("div",Bm," 渲染后的 Markdown 仅在此面板显示,不会撑大节点框。 ")):(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-note-preview-body",innerHTML:u.value},null,8,Rm))])):e.createCommentVNode("",!0)]),!t.readonly&&!c.value?(e.openBlock(),e.createElementBlock("div",Im,[e.createElementVNode("button",{class:"zm-note-action-btn is-danger",onClick:N},"移除笔记")])):e.createCommentVNode("",!0)]),t.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",zm,[!$.value&&!E.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-note-add-chip",onClick:p[1]||(p[1]=ge=>E.value=!0)},"+ 链接")):e.createCommentVNode("",!0),!M.value&&!k.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-note-add-chip",onClick:p[2]||(p[2]=ge=>k.value=!0)},"+ 图片")):e.createCommentVNode("",!0),!I.value&&!m.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-note-add-chip",onClick:p[3]||(p[3]=ge=>m.value=!0)},"+ 代码块")):e.createCommentVNode("",!0),!C.value&&!B.value?(e.openBlock(),e.createElementBlock("button",{key:3,class:"zm-note-add-chip",onClick:p[4]||(p[4]=ge=>B.value=!0)},"+ 表格")):e.createCommentVNode("",!0)])),$.value||E.value?(e.openBlock(),e.createElementBlock("section",Om,[p[15]||(p[15]=e.createElementVNode("header",{class:"zm-note-section-head"},[e.createElementVNode("span",{class:"zm-note-section-title"},"链接")],-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":p[5]||(p[5]=ge=>x.value=ge),class:"zm-note-input",type:"url",placeholder:"https://…",disabled:t.readonly,onBlur:K,onKeydown:p[6]||(p[6]=e.withKeys(e.withModifiers(ge=>ge.target.blur(),["prevent"]),["enter"]))},null,40,Lm),[[e.vModelText,x.value]]),$.value?(e.openBlock(),e.createElementBlock("a",{key:0,class:"zm-note-link-chip",href:(L=t.selectedNode.link)==null?void 0:L.url,target:"_blank",rel:"noopener noreferrer",title:(V=t.selectedNode.link)==null?void 0:V.url},e.toDisplayString((X=t.selectedNode.link)==null?void 0:X.url),9,Dm)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),M.value||k.value?(e.openBlock(),e.createElementBlock("section",Vm,[p[16]||(p[16]=e.createElementVNode("header",{class:"zm-note-section-head"},[e.createElementVNode("span",{class:"zm-note-section-title"},"图片")],-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":p[7]||(p[7]=ge=>Y.value=ge),class:"zm-note-input",type:"url",placeholder:"data:image/… 或 https://…",disabled:t.readonly,onBlur:ee,onKeydown:p[8]||(p[8]=e.withKeys(e.withModifiers(ge=>ge.target.blur(),["prevent"]),["enter"]))},null,40,$m),[[e.vModelText,Y.value]]),M.value?(e.openBlock(),e.createElementBlock("img",{key:0,class:"zm-note-image",src:(se=t.selectedNode.image)==null?void 0:se.src,alt:t.selectedNode.text,onError:ae,onLoad:re},null,40,Pm)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),I.value||m.value?(e.openBlock(),e.createElementBlock("section",Um,[e.createElementVNode("header",Fm,[p[17]||(p[17]=e.createElementVNode("span",{class:"zm-note-section-title"},"代码块",-1)),e.unref(Nn)(q.value)?(e.openBlock(),e.createElementBlock("span",Hm,e.toDisplayString(e.unref(Nn)(q.value)),1)):e.createCommentVNode("",!0)]),e.withDirectives(e.createElementVNode("textarea",{ref_key:"codeRef",ref:Q,"onUpdate:modelValue":p[9]||(p[9]=ge=>q.value=ge),class:"zm-note-input zm-note-input-code",placeholder:"```ts\nconsole.log(123)\n```",spellcheck:"false",disabled:t.readonly,onBlur:z},null,40,Wm),[[e.vModelText,q.value]]),q.value.trim()?(e.openBlock(),e.createElementBlock("pre",Gm,[e.createElementVNode("code",{innerHTML:ie.value},null,8,jm)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),C.value||B.value?(e.openBlock(),e.createElementBlock("section",Km,[p[18]||(p[18]=e.createElementVNode("header",{class:"zm-note-section-head"},[e.createElementVNode("span",{class:"zm-note-section-title"},"表格"),e.createElementVNode("span",{class:"zm-note-section-hint"},"点击表头排序")],-1)),e.withDirectives(e.createElementVNode("textarea",{ref_key:"tableRef",ref:F,"onUpdate:modelValue":p[10]||(p[10]=ge=>A.value=ge),class:"zm-note-input zm-note-input-code",placeholder:`| 列1 | 列2 |
131
128
  | --- | --- |
132
- | a | b |`,spellcheck:"false",disabled:t.readonly,onBlur:ae},null,40,Kf),[[e.vModelText,w.value]]),ke.value.length?(e.openBlock(),e.createElementBlock("table",qf,[e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Re.value,(se,ce)=>(e.openBlock(),e.createElementBlock("tr",{key:ce},[ce===0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(se,(De,Ke)=>(e.openBlock(),e.createElementBlock("th",{key:`h${Ke}`,class:e.normalizeClass(["zm-note-table-sort",{"is-sorted":V.value===Ke,"is-asc":V.value===Ke&&Y.value==="asc","is-desc":V.value===Ke&&Y.value==="desc"}]),onClick:We=>Pe(Ke)},[e.createElementVNode("span",null,e.toDisplayString(De),1),e.createElementVNode("span",Xf,e.toDisplayString(V.value===Ke?Y.value==="asc"?"▲":"▼":"↕"),1)],10,Yf))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(se,(De,Ke)=>(e.openBlock(),e.createElementBlock("td",{key:`c${Ke}`},e.toDisplayString(De),1))),128))]))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])],64)):(e.openBlock(),e.createElementBlock("div",yf,[...z[11]||(z[11]=[e.createElementVNode("p",null,"请先在画布上选中一个节点。",-1),e.createElementVNode("p",{class:"zm-note-hint"}," 选中节点后,会在这里展示并可编辑节点的笔记、链接、图片、代码块、表格。 ",-1)])]))])}}}),Zf={class:"zm-app"},Jf={class:"zm-app-main"},Qf={key:0,class:"zm-app-toolbar"},em={class:"zm-app-tip"},tm={class:"zm-app-canvas"},nm={class:"zm-settings-popover-header"},qr=e.defineComponent({__name:"App",props:{showOutlineBtn:{type:Boolean,default:!0},showDataBtn:{type:Boolean,default:!0},showMarkdownBtn:{type:Boolean,default:!1},showSettingsBtn:{type:Boolean,default:!0},showPreviewModeBtn:{type:Boolean,default:!0}},setup(t){const o={id:"r_root",text:"flow-mindmap 节点能力一览",link:{url:"https://github.com/xz333221/flow-mindmap"},note:{text:`本导图用于演示节点的全部可渲染字段。
129
+ | a | b |`,spellcheck:"false",disabled:t.readonly,onBlur:le},null,40,Ym),[[e.vModelText,A.value]]),Ne.value.length?(e.openBlock(),e.createElementBlock("table",qm,[e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_e.value,(ge,Ge)=>(e.openBlock(),e.createElementBlock("tr",{key:Ge},[Ge===0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(ge,(Pe,Ze)=>(e.openBlock(),e.createElementBlock("th",{key:`h${Ze}`,class:e.normalizeClass(["zm-note-table-sort",{"is-sorted":U.value===Ze,"is-asc":U.value===Ze&&G.value==="asc","is-desc":U.value===Ze&&G.value==="desc"}]),onClick:je=>Re(Ze)},[e.createElementVNode("span",null,e.toDisplayString(Pe),1),e.createElementVNode("span",Zm,e.toDisplayString(U.value===Ze?G.value==="asc"?"▲":"▼":"↕"),1)],10,Xm))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(ge,(Pe,Ze)=>(e.openBlock(),e.createElementBlock("td",{key:`c${Ze}`},e.toDisplayString(Pe),1))),128))]))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])],64)):(e.openBlock(),e.createElementBlock("div",Em,[...p[11]||(p[11]=[e.createElementVNode("p",null,"请先在画布上选中一个节点。",-1),e.createElementVNode("p",{class:"zm-note-hint"}," 选中节点后,会在这里展示并可编辑节点的笔记、链接、图片、代码块、表格。 ",-1)])]))])}}}),Jm=["viewBox","width","height"],Qm={class:"zm-edges"},ep=["d","fill"],tp=["data-node-id","onClick","onPointerdown","onDblclick","onContextmenu","onMouseenter","onMouseleave"],np=["src","width","height","alt"],op=["onDblclick"],rp={key:0,class:"zm-rich-code"},ip=["innerHTML"],lp={key:1,class:"zm-rich-table"},ap=["onClick"],sp={class:"zm-rich-sort-mark","aria-hidden":"true"},cp={key:2,class:"zm-text"},dp={key:0,class:"zm-node-markers"},up=["title","innerHTML"],fp={class:"zm-text-label"},mp=["href","title"],pp=["title","onClick"],gp={key:4,class:"zm-node-tags"},hp=["title"],bp=["title","onClick"],kp=["onClick"],yp=["onMousedown"],Ep=["onClick"],xp=["title"],wp={class:"zm-tb-tip zm-tb-zoom"},Np=["src"],Sp=["src"],_n=24,Gn=400,fn=160,Pl=4,Jo=e.defineComponent({__name:"MindMap",props:{data:{},theme:{},previewMode:{type:Boolean,default:!1},markdown:{},lineColors:{},hideCanvasActions:{type:Boolean,default:!1},builtInDrawers:{type:Boolean,default:!0}},emits:["change","select","edit-note","markdownChange","canvas-toggle-preview","canvas-outline","canvas-settings","canvas-data","canvas-import"],setup(t,{expose:o,emit:n}){const r=t,l=n,s=e.ref(null),c=e.ref(null),u=e.ref(""),d=e.ref(new Set),g=e.computed(()=>d.value.values().next().value??null),b=e.ref(new Set),w=e.ref(!1),N=e.ref(null),$=e.ref(0),M=e.ref(0),P=e.ref(null),I=e.ref(null),C=e.ref(null),E=e.ref(""),k=e.ref(new Map),m=e.ref(_t(r.data)),B=e.ref({}),x=e.ref({}),K=e.ref(r.markdown!==void 0);let Y=!1;e.watch(()=>r.markdown,i=>{if(i===void 0){K.value=!1;return}K.value=!0;const a=zn(i||"");Y=!0,m.value=_t(a),d.value=new Set,b.value=new Set,pe(),e.nextTick(()=>{Y=!1,on()})}),e.watch(m,()=>{K.value&&!Y&&l("markdownChange",On(m.value))},{deep:!0});const ee=e.computed(()=>R.showOrderBadge===!0),ae=e.ref(new Map),re=ae.value;function q(i,a){const f={};a.bg&&(f.bg=a.bg),a.textColor&&(f.textColor=a.textColor),a.borderColor&&(f.borderColor=a.borderColor),a.fontWeight&&(f.fontWeight=a.fontWeight),a.fontSize&&(f.fontSize=a.fontSize),Object.keys(f).length===0?re.delete(i):re.set(i,f),ae.value=new Map(re)}function Q(i){return re.get(i)??{}}function ie(i,a){const f=oe(m.value,i);f&&(f.image={src:a.src,naturalW:a.naturalW,naturalH:a.naturalH,width:F(a.width,_n,Gn),height:F(a.height,_n,Gn)},Me(),pe(),l("change",m.value))}function z(i){const a=oe(m.value,i);!a||!a.image||(delete a.image,Me(),pe(),l("change",m.value))}function A(i,a){const f=a.trim();if(!oe(m.value,i))return;if(!f){z(i);return}const S=new Image;S.onload=()=>{const D=oe(m.value,i);if(!D)return;const v=S.naturalWidth&&S.naturalHeight?S.naturalWidth/S.naturalHeight:1,j=F(S.naturalWidth||fn,_n,Gn),te=Math.round(j/v);D.image={src:f,naturalW:S.naturalWidth||j,naturalH:S.naturalHeight||te,width:j,height:te},Me(),pe(),l("change",m.value)},S.onerror=()=>{},S.src=f}function F(i,a,f){return Math.min(f,Math.max(a,i))}function U(i,a){const f=new FileReader;f.onload=()=>{if(typeof f.result!="string")return;const _=f.result,S=new window.Image;S.onload=()=>{const D=S.naturalWidth||fn,v=S.naturalHeight||fn,j=F(D,_n,fn),te=F(Math.round(v*j/D),_n,Gn);a({src:_,naturalW:D,naturalH:v,width:j,height:te})},S.onerror=()=>{a({src:_,naturalW:fn,naturalH:fn,width:fn,height:fn})},S.src=_},f.readAsDataURL(i)}function G(i){const a=document.createElement("input");a.type="file",a.accept="image/*",a.style.display="none",a.onchange=()=>{var _;const f=(_=a.files)==null?void 0:_[0];f&&(U(f,S=>ie(i,S)),document.body.removeChild(a))},document.body.appendChild(a),a.click()}function le(i,a){const f=a.trim(),_=oe(m.value,i);_&&(f?_.link={url:f}:delete _.link,Me(),pe(),l("change",m.value))}function Ne(i){le(i,"")}function _e(i,a){const f=oe(m.value,i);f&&(a?f.note={text:a}:delete f.note,Me(),pe(),l("change",m.value))}function Re(i){_e(i,"")}function xe(i,a){const f=oe(m.value,i);f&&(a?f.richContent=a:delete f.richContent,Me(),pe(),l("change",m.value))}const y=e.ref(null),p=e.ref(null),L=e.computed(()=>["zm-canvas-fab","zm-canvas-fab-preview",!r.hideCanvasActions&&(!r.previewMode||w.value)?"is-visible":""].filter(Boolean).join(" ")),V=e.computed(()=>["zm-canvas-fab","zm-canvas-fab-outline",!r.hideCanvasActions&&(!r.previewMode||w.value)?"is-visible":""].filter(Boolean).join(" "));function X(i,a){r.previewMode||(i.preventDefault(),i.stopPropagation(),p.value=null,d.value=new Set([a.id]),ft(),y.value={nodeId:a.id,x:i.clientX,y:i.clientY})}function se(){y.value=null}function ge(i){const a=i.target;if(!(a!=null&&a.closest(".zm-toolbar, button, input, textarea, .zm-canvas-fab-preview, .zm-canvas-fab-outline"))){if(cr&&ne.panMoved.value){cr=!1,i.preventDefault();return}i.preventDefault(),y.value&&(y.value=null),p.value={x:i.clientX,y:i.clientY}}}function Ge(){p.value=null}function Pe(){Ge(),r.builtInDrawers&&(gt(),Te.value=!0),l("canvas-settings")}function Ze(){Ge(),r.builtInDrawers&&(gt(),Rt.value=!0),l("canvas-data")}function je(i){Ge(),r.builtInDrawers&&(gt(),Bt.value=i,Rt.value=!0),l("canvas-import",i)}const tn=e.ref(!1),Rt=e.ref(!1),J=e.ref(!1),it=e.ref(!1),Te=e.ref(!1),Se=e.ref(0),Bt=e.ref(null),Je=e.ref(new Set);function gt(){Rt.value=!1,J.value=!1,it.value=!1,Te.value=!1}const dt=e.computed(()=>{const i=g.value;return i?oe(m.value,i)??null:null}),H=e.computed(()=>dt.value?Q(dt.value.id):{});function Z(i){i.autoBalanceOnChange!==void 0&&(R.autoBalanceOnChange=i.autoBalanceOnChange),i.lineWidthStart!==void 0&&(R.lineWidthStart=Math.max(.5,Math.min(20,i.lineWidthStart))),i.lineWidthEnd!==void 0&&(R.lineWidthEnd=Math.max(.3,Math.min(10,i.lineWidthEnd))),i.rainbowBranch!==void 0&&(R.rainbowBranch=i.rainbowBranch),i.branchPaletteId!==void 0&&(R.branchPaletteId=i.branchPaletteId),i.customPalettes!==void 0&&(R.customPalettes=i.customPalettes),i.lineStyle!==void 0&&(R.lineStyle=i.lineStyle),i.taperedEdge!==void 0&&(R.taperedEdge=i.taperedEdge),i.showOrderBadge!==void 0&&(R.showOrderBadge=i.showOrderBadge),i.canvasBg!==void 0&&(R.canvasBg=i.canvasBg)}function ce(i){dt.value&&q(dt.value.id,i)}function ke(){const i={autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"curve",layoutMode:"mindmap",taperedEdge:!0,showOrderBadge:!1,canvasBg:void 0};R.autoBalanceOnChange=i.autoBalanceOnChange,R.lineWidthStart=i.lineWidthStart,R.lineWidthEnd=i.lineWidthEnd,R.rainbowBranch=i.rainbowBranch,R.branchPaletteId=i.branchPaletteId,R.customPalettes=i.customPalettes,R.lineStyle=i.lineStyle,R.layoutMode=i.layoutMode,R.taperedEdge=i.taperedEdge,R.showOrderBadge=i.showOrderBadge,R.canvasBg=i.canvasBg}function ze(){Bt.value=null}function Qe(i){const a=g.value;a&&_e(a,i)}function ht(){const i=g.value;i&&Re(i)}function Mn(i){const a=g.value;a&&le(a,i)}function er(i){const a=g.value;a&&A(a,i)}function tr(i){const a=g.value;a&&xe(a,i)}function mo(i){const a=document.querySelector(`[data-node-id="${i.id}"]`);a&&a.click()}function nr(i){ia(i.id,i.text)}function jn(i){to(i)}function Kn(i){ar(i)}function It(i){Zr(i.srcId,i.targetId,i.position)}function mn(i){const a=new Set(Je.value);a.has(i)?a.delete(i):a.add(i),Je.value=a}function po(){r.builtInDrawers&&(tn.value=!tn.value),l("canvas-outline")}function go(){var a;const i=(a=y.value)==null?void 0:a.nodeId;i&&G(i)}function Wr(){var _,S,D;const i=(_=y.value)==null?void 0:_.nodeId;if(!i)return;const a=((D=(S=oe(m.value,i))==null?void 0:S.link)==null?void 0:D.url)??"",f=window.prompt("输入链接 URL(留空取消)",a);f!==null&&le(i,f)}function ho(){var a;const i=(a=y.value)==null?void 0:a.nodeId;i&&Ne(i)}function bo(){var a;const i=(a=y.value)==null?void 0:a.nodeId;i&&rr(i)}function Gr(){var a;const i=(a=y.value)==null?void 0:a.nodeId;i&&Re(i)}function vn(){var a;const i=(a=y.value)==null?void 0:a.nodeId;i&&z(i)}function or(){var Ve,T;const i=(Ve=y.value)==null?void 0:Ve.nodeId;if(!i)return;const a=(T=oe(m.value,i))==null?void 0:T.richContent,f=(a==null?void 0:a.kind)==="code"?Wo(a.raw):"",_=(a==null?void 0:a.kind)==="code"&&a.lang||"",S=_?"```"+_+`
130
+ `:"```\n",v=window.prompt("输入代码块内容(用 ```lang 包裹;留空取消)",f?S+f+(f.endsWith("```")?"":"\n```"):S+"// 你的代码"+"\n```");if(v===null)return;const j=v.trim();if(!j){xe(i,null);return}const te=/^```([^\s`]*)/.exec(j),me=te?te[1]:void 0;xe(i,{kind:"code",raw:j,lang:me})}function jr(){var a;const i=(a=y.value)==null?void 0:a.nodeId;i&&xe(i,null)}function Oe(){var v,j;const i=(v=y.value)==null?void 0:v.nodeId;if(!i)return;const a=(j=oe(m.value,i))==null?void 0:j.richContent,f=(a==null?void 0:a.kind)==="table"?a.raw:"",S=window.prompt("输入 markdown 表格(每行以 | 分隔;留空取消)",f||`| 列1 | 列2 | 列3 |
131
+ | --- | --- | --- |
132
+ | a | b | c |`);if(S===null)return;const D=S.trim();if(!D){xe(i,null);return}xe(i,{kind:"table",raw:D})}function pn(){var a;const i=(a=y.value)==null?void 0:a.nodeId;i&&xe(i,null)}function rr(i){r.previewMode||(r.builtInDrawers&&(gt(),it.value=!0,Se.value++),l("edit-note",i))}function ir(i,a=60){const f=i.replace(/\s+/g," ").trim();return f.length<=a?f||"点击编辑笔记":f.slice(0,a)+"…"}function Yn(i){var S;if(r.previewMode||c.value)return;const a=i.target;if(a&&(a.tagName==="INPUT"||a.tagName==="TEXTAREA"||a.isContentEditable))return;const f=g.value;if(!f)return;const _=(S=i.clipboardData)==null?void 0:S.items;if(_)for(let D=0;D<_.length;D++){const v=_[D];if(v.kind==="file"&&v.type.startsWith("image/")){const j=v.getAsFile();if(!j)continue;i.preventDefault();const te=oe(m.value,f);if(te!=null&&te.image&&!window.confirm("该节点已有图片,要用剪贴板里的图片替换吗?"))return;U(j,me=>ie(f,me));return}}}e.onMounted(()=>{window.addEventListener("paste",Yn),window.addEventListener("keydown",ko),pe()}),e.onBeforeUnmount(()=>{window.removeEventListener("paste",Yn),window.removeEventListener("keydown",ko)});function ko(i){if((i.metaKey||i.ctrlKey)&&(i.key==="f"||i.key==="F")){const f=i.target;if(f&&(f.tagName==="INPUT"||f.tagName==="TEXTAREA"||f.isContentEditable))return;i.preventDefault(),l("canvas-outline")}}const gn=e.ref(null),Kr=e.computed(()=>{var i;return((i=gn.value)==null?void 0:i.nodeId)??null});function Et(i,a){if(!a.image)return;i.preventDefault(),i.stopPropagation();const f=a.image.naturalW||a.image.width,_=a.image.naturalH||a.image.height,S=_>0?_/f:1;gn.value={nodeId:a.id,startX:i.clientX,startY:i.clientY,startW:a.image.width,startH:a.image.height,naturalW:f,naturalH:_,ratio:S,pendingW:a.image.width,pendingH:a.image.height},window.addEventListener("mousemove",qt),window.addEventListener("mouseup",yo)}function qt(i){var te,me;const a=gn.value;if(!a)return;const f=ne.scale.value||1,_=i.clientX-a.startX,S=F(a.startW+_/f,_n,Gn),D=F(S*a.ratio,_n,Gn);a.pendingW=S,a.pendingH=D;const v=(te=s.value)==null?void 0:te.querySelector(`[data-node-id="${a.nodeId}"] .zm-node-img`);v&&(v.style.width=`${S}px`,v.style.height=`${D}px`);const j=(me=s.value)==null?void 0:me.querySelector(`[data-node-id="${a.nodeId}"]`);j&&(j.style.minWidth=`${Math.max(80,Math.ceil(S+28))}px`,j.style.height=`${Math.ceil(D+8+30)}px`)}function yo(){const i=gn.value;if(window.removeEventListener("mousemove",qt),window.removeEventListener("mouseup",yo),gn.value=null,!i)return;const a=oe(m.value,i.nodeId);!a||!a.image||(ie(i.nodeId,{src:a.image.src,naturalW:a.image.naturalW,naturalH:a.image.naturalH,width:i.pendingW,height:i.pendingH}),d.value=new Set([i.nodeId]),ft(),Rn=!0)}const qn=e.ref(null);let Rn=!1;function Xn(i){qn.value=i}function hn(i){qn.value===i&&(qn.value=null),I.value&&(I.value=null)}function Zn(i,a){var wt;if(!a.text||a.text.length<14)return;const _=i.currentTarget.getBoundingClientRect(),S=(wt=s.value)==null?void 0:wt.getBoundingClientRect();if(!S)return;const D=10,v=240,j=_.top-S.top>60,te=_.left-S.left+_.width/2,me=D+v/2,Ve=S.width-v/2-D,T=Math.max(me,Math.min(te,Ve)),Ke=j?_.top-S.top-8:_.bottom-S.top+8;I.value={text:a.text,x:T,y:Ke,above:j}}const xt=e.ref(0),Jn=e.ref(!1),$t=Ja(100);function Me(){$t.record({data:m.value,selectedIds:[...d.value]})}function pe(){b.value=new Set(b.value),xt.value++,e.nextTick().then(()=>e.nextTick()).then(()=>lr()).then(()=>{xt.value++})}function lr(){const i=document.querySelectorAll(".zm-rich"),a={},f={};i.forEach(_=>{let S=_,D=null;for(;S&&!D;)D=S.getAttribute("data-node-id"),S=S.parentElement;if(!D)return;const v=_.offsetHeight,j=_.scrollWidth,te=Math.round(v*2)/2,me=Math.round(j*2)/2;a[D]=te,f[D]=me,B.value[D],x.value[D]}),B.value=a,x.value=f}const tt=e.computed(()=>{var i,a,f,_,S,D,v,j,te,me;return{rootBg:((i=r.theme)==null?void 0:i.rootBg)??"#1f2937",rootText:((a=r.theme)==null?void 0:a.rootText)??"#ffffff",branchBg:((f=r.theme)==null?void 0:f.branchBg)??"#ffffff",branchText:((_=r.theme)==null?void 0:_.branchText)??"#1f2937",lineColor:((S=r.theme)==null?void 0:S.lineColor)??"#94a3b8",bgColor:((D=r.theme)==null?void 0:D.bgColor)??"#f8fafc",fontSize:((v=r.theme)==null?void 0:v.fontSize)??14,lineWidthStart:((j=r.theme)==null?void 0:j.lineWidthStart)??2.2,lineWidthEnd:((te=r.theme)==null?void 0:te.lineWidthEnd)??.8,rainbowBranch:((me=r.theme)==null?void 0:me.rainbowBranch)??!1}}),Xt=e.computed(()=>R.canvasBg||tt.value.bgColor),R=e.reactive({autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:3.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"curve",layoutMode:"mindmap",taperedEdge:!0,showOrderBadge:!1,canvasBg:void 0});function h(i){return R.taperedEdge?W(i):we(i)}function O(i){return R.taperedEdge?R.lineWidthEnd:we(i)}function W(i){return i<=0?R.lineWidthStart:i===1?Math.max(1.5,R.lineWidthStart*.67):i===2?Math.max(.8,R.lineWidthStart*.42):R.lineWidthEnd}function we(i){if(i<=0)return R.lineWidthStart;if(i>=3)return R.lineWidthEnd;const a=i/3;return R.lineWidthStart+(R.lineWidthEnd-R.lineWidthStart)*a}function fe(i,a,f,_){const S=1-i,D=S*S*S*a.x+3*S*S*i*f.x1+3*S*i*i*f.x2+i*i*i*_.x,v=S*S*S*a.y+3*S*S*i*f.y1+3*S*i*i*f.y2+i*i*i*_.y;return{x:D,y:v}}function Ce(i,a,f,_,S=32,D="curve",v="right"){if(D==="curve"){let yt;if(v==="right"||v==="left"){const Ie=Math.abs(a.x-i.x)*.45,Wt=v==="right"?1:-1;yt={x1:i.x+Wt*Ie,y1:i.y,x2:a.x-Wt*Ie,y2:a.y}}else{const Ie=Math.abs(a.y-i.y)*.45;yt={x1:i.x,y1:i.y+Ie,x2:a.x,y2:a.y-Ie}}const Zt=ye=>{const Ie=1-ye,Wt=-3*Ie*Ie*i.x+3*(Ie*Ie-2*Ie*ye)*yt.x1+3*(2*Ie*ye-ye*ye)*yt.x2+3*ye*ye*a.x,an=-3*Ie*Ie*i.y+3*(Ie*Ie-2*Ie*ye)*yt.y1+3*(2*Ie*ye-ye*ye)*yt.y2+3*ye*ye*a.y;return{dx:Wt,dy:an}},Ft=[],bn=[];for(let ye=0;ye<=S;ye++){const Ie=ye/S,Wt=ye===0?i:ye===S?a:fe(Ie,i,yt,a),an=Zt(Ie);let no=Math.hypot(an.dx,an.dy);no<1e-6&&(no=1);const Nt=-an.dy/no,Ye=an.dx/no,qe=(f+(_-f)*Ie)/2;Ft.push({x:Wt.x+Nt*qe,y:Wt.y+Ye*qe}),bn.push({x:Wt.x-Nt*qe,y:Wt.y-Ye*qe})}let Ht=`M ${Ft[0].x.toFixed(2)} ${Ft[0].y.toFixed(2)}`;for(let ye=1;ye<=S;ye++)Ht+=` L ${Ft[ye].x.toFixed(2)} ${Ft[ye].y.toFixed(2)}`;for(let ye=S;ye>=0;ye--)Ht+=` L ${bn[ye].x.toFixed(2)} ${bn[ye].y.toFixed(2)}`;return Ht+=" Z",Ht}const j=a.x-i.x,te=a.y-i.y;let me=Math.hypot(j,te);me<1e-6&&(me=1);const Ve=-te/me,T=j/me,Ke=f/2,wt=_/2,de={x:i.x+Ve*Ke,y:i.y+T*Ke},mt={x:i.x-Ve*Ke,y:i.y-T*Ke},ln={x:a.x-Ve*wt,y:a.y-T*wt},lt={x:a.x+Ve*wt,y:a.y+T*wt};return`M ${de.x.toFixed(2)} ${de.y.toFixed(2)} L ${lt.x.toFixed(2)} ${lt.y.toFixed(2)} L ${ln.x.toFixed(2)} ${ln.y.toFixed(2)} L ${mt.x.toFixed(2)} ${mt.y.toFixed(2)} Z`}const Le=e.computed(()=>ut.value.root.children),bt=en[0].colors,kt=e.computed(()=>Da(R.branchPaletteId,R.customPalettes)),Pt=e.computed(()=>{const i=new Map;if(!R.rainbowBranch)return i;const a=r.lineColors,f=a&&a.length>0?a:kt.value.colors.length>0?kt.value.colors:bt;for(let S=0;S<Le.value.length;S++){const D=Le.value[S];i.set(D.id,f[S%f.length])}const _=(S,D)=>{i.set(S.id,D);for(const v of S.children)_(v,D)};for(let S=0;S<Le.value.length;S++){const D=Le.value[S];_(D,f[S%f.length])}return i});function He(i,a){return R.rainbowBranch?Pt.value.get(a.id)??tt.value.lineColor:tt.value.lineColor}function Eo(i){const a=Q(i.id);if(a.bg)return a.bg;if(i.isRoot)return tt.value.rootBg;if(R.rainbowBranch){const f=Pt.value.get(i.id);if(f)return vp(f,.18)}return tt.value.branchBg}function nn(i){const a=Q(i.id);if(a.textColor)return a.textColor;if(i.isRoot)return tt.value.rootText;if(R.rainbowBranch){const f=Pt.value.get(i.id);if(f)return Wl(f,.55)}return tt.value.branchText}function Qn(i){const a=Q(i.id);if(a.borderColor)return a.borderColor;if(i.isRoot)return tt.value.rootBg;if(R.rainbowBranch){const f=Pt.value.get(i.id);if(f)return Wl(f,.3)}return tt.value.lineColor}function Fl(i){const a=Q(i.id);return a.fontWeight?a.fontWeight:i.isRoot?700:i.depth<=1?600:i.depth===2?500:400}function Hl(i){return Q(i.id).fontSize??i.fontSize??tt.value.fontSize}function vp(i,a){const f=i.replace("#",""),_=f.length===6?f:f.split("").map(j=>j+j).join(""),S=parseInt(_.slice(0,2),16),D=parseInt(_.slice(2,4),16),v=parseInt(_.slice(4,6),16);return`rgba(${S}, ${D}, ${v}, ${a})`}function Wl(i,a){const f=i.replace("#",""),_=f.length===6?f:f.split("").map(j=>j+j).join(""),S=Math.round(parseInt(_.slice(0,2),16)*(1-a)),D=Math.round(parseInt(_.slice(2,4),16)*(1-a)),v=Math.round(parseInt(_.slice(4,6),16)*(1-a));return`rgb(${S}, ${D}, ${v})`}const ne=qa({getContainer:()=>s.value});ne.setOnMarqueeEnd(qp),Za({isEditing:()=>c.value!==null,isReadonly:()=>r.previewMode,getSelectedId:()=>g.value,getSelectedIds:()=>[...d.value],defaultTargetId:()=>m.value.id,onAddChild:to,onAddSibling:ar,onAddSiblingBefore:Pp,onRemove:ta,onStartEdit:xo,onClearSelection:()=>{d.value=new Set,ft()},onDuplicate:ql,onCopy:Jl,onCut:Ql,onPaste:ea,hasClipboard:()=>!!P.value&&P.value.nodes.length>0,onUndo:qr,onRedo:Xr,onNavigate:Up,onSelectRoot:()=>{d.value=new Set([m.value.id]),ft()}});const ut=e.computed(()=>{const i=_t(m.value);return Kl(i),Ia(i,{mode:R.layoutMode,baseFontSize:tt.value.fontSize,richHeights:B.value,richWidths:x.value})}),Gl=e.ref([]),eo=e.computed(()=>(xt.value,Gl.value));e.watch(ut,i=>{const a=[],f=_=>{a.push(_);for(const S of _.children)f(S)};f(i.root),Gl.value=a},{immediate:!0});const jl=e.computed(()=>{const i=[];for(const a of eo.value)for(const f of a.children)i.push({from:a,to:f,key:`${a.id}->${f.id}`});return i}),Rp=e.computed(()=>`${ut.value.vbX} ${ut.value.vbY} ${ut.value.vbW} ${ut.value.vbH}`);function Kl(i){if(b.value.has(i.id)){i.children=[],i.collapsed=!0;return}i.collapsed=!1;for(const a of i.children)Kl(a)}function xo(i){const a=oe(m.value,i);a&&(c.value=i,u.value=a.text,e.nextTick(()=>{const f=document.querySelector(".zm-input");f==null||f.focus(),f==null||f.select()}))}function Yr(){if(!c.value)return;const i=oe(m.value,c.value);i&&i.text!==(u.value.trim()||" ")&&(i.text=u.value.trim()||" ",Me(),l("change",m.value)),c.value=null}function Bp(){c.value=null}function Ip(i){if(r.previewMode)return;const a=oe(m.value,i);a!=null&&a.richContent&&(C.value=i,E.value=a.richContent.raw,e.nextTick(()=>{const f=document.querySelector(".zm-node .zm-rich textarea");f==null||f.focus()}))}function Yl(){if(!C.value)return;const i=C.value,a=oe(m.value,i),f=E.value;if(a&&a.richContent&&a.richContent.raw!==f)if(a.richContent.kind==="code"){const _=Nn(f)||void 0;xe(i,{kind:"code",raw:f,lang:_})}else xe(i,{kind:"table",raw:f});C.value=null}function zp(){C.value=null}function Op(i){i.key==="Escape"?(i.preventDefault(),zp()):i.key==="Enter"&&(i.ctrlKey||i.metaKey)&&(i.preventDefault(),Yl())}function Lp(i,a){const f=k.value.get(i);!f||f.col!==a?k.value.set(i,{col:a,dir:"asc"}):f.dir==="asc"?k.value.set(i,{col:a,dir:"desc"}):k.value.delete(i)}function Dp(i,a){const f=k.value.get(i);return!f||a.length<=1?a:il(a,f.col,f.dir)}function Vp(i,a){const f=k.value.get(i);return!f||f.col!==a?"↕":f.dir==="asc"?"▲":"▼"}function $p(i){const a=i.metaKey||i.ctrlKey;a&&(i.key==="z"||i.key==="Z")&&!i.shiftKey?(i.preventDefault(),qr()):(a&&i.shiftKey&&(i.key==="z"||i.key==="Z")||a&&(i.key==="y"||i.key==="Y")&&!i.shiftKey)&&(i.preventDefault(),Xr())}function to(i){const a=mi(m.value,i,Ro);a&&(Me(),pe(),l("change",m.value),e.nextTick(()=>xo(a.id)))}function ar(i){if(i===m.value.id){to(i);return}const a=pi(m.value,i,Ro);a&&(Me(),pe(),l("change",m.value),e.nextTick(()=>xo(a.id)))}function Pp(i){if(i===m.value.id){to(i);return}const a=Wa(m.value,i,Ro);a&&(Me(),pe(),l("change",m.value),e.nextTick(()=>xo(a.id)))}function ql(i){if(i===m.value.id)return;const a=Ga(m.value,i);a&&(Me(),d.value=new Set([a.id]),ft(),l("change",m.value),pe())}function Xl(i){const a=[],f=new Set;for(const _ of i)_!==m.value.id&&(f.has(_)||oe(m.value,_)&&(f.add(_),a.push(_)));return a}function Zl(i){const a=new Set(i),f=[],_=S=>{a.has(S.id)&&f.push(S.id);for(const D of S.children)_(D)};return _(m.value),f}function Jl(i){const a=Zl(Xl(i));if(a.length===0)return;const f=[];for(const _ of a){const S=gi(m.value,_);S&&f.push(S)}f.length!==0&&(P.value={nodes:f,originalIds:new Set(a)},pe())}function Ql(i){const a=Zl(Xl(i));if(a.length===0)return;const f=[];for(const _ of a){const S=gi(m.value,_);S&&f.push(S)}if(f.length!==0){Me();for(const _ of a)Mo(m.value,_);d.value=new Set,ft(),P.value={nodes:f,originalIds:new Set(a)},pe(),l("change",m.value)}}function ea(i){const a=P.value;if(!a||a.nodes.length===0)return;const f=i??m.value.id,_=oe(m.value,f);if(_){for(const S of a.originalIds){const D=oe(m.value,S);if(D&&oe(D,f))return}Me();for(const S of a.nodes){const D=_t(S);vo(D),_.children.push(D)}P.value=null,pe(),l("change",m.value)}}function qr(){const i=$t.undo();i&&(m.value=i.data,d.value=new Set(i.selectedIds??[]),ft(),pe(),l("change",m.value))}function Xr(){const i=$t.redo();i&&(m.value=i.data,d.value=new Set(i.selectedIds??[]),ft(),pe(),l("change",m.value))}function ft(){const i=[];for(const a of d.value){const f=oe(m.value,a);f&&i.push(f)}if(r.builtInDrawers&&!r.previewMode&&i.length>0){const a=i[0];!it.value&&da(a.id)&&(gt(),it.value=!0)}else r.builtInDrawers&&i.length===0&&(it.value=!1);l("select",i.length>0?i:null)}function Up(i,a){const f=g.value??m.value.id,_=oe(m.value,f);if(!_)return;let S=null;if(a===1){const D=Lt(m.value,_.id);if(D){const v=D.children.findIndex(j=>j.id===_.id);v>=0&&v<D.children.length-1&&(S=D.children[v+1].id)}}else if(a===-1){const D=Lt(m.value,_.id);if(D){const v=D.children.findIndex(j=>j.id===_.id);v>0&&(S=D.children[v-1].id)}}else if(i===1){const D=Lt(m.value,_.id);D&&(S=D.id)}else i===-1&&_.children.length>0&&(S=_.children[0].id);S&&(d.value=new Set([S]),ft())}function ta(i){if(i!==m.value.id&&Mo(m.value,i)){if(Me(),d.value.has(i)){const a=new Set(d.value);a.delete(i),d.value=a,ft()}pe(),l("change",m.value)}}function na(i){b.value.has(i)?b.value.delete(i):b.value.add(i),pe()}function oa(i){const a=[{n:m.value,depth:1}];for(;a.length;){const{n:f,depth:_}=a.pop();i(f,_);for(let S=f.children.length-1;S>=0;S--)a.push({n:f.children[S],depth:_+1})}}function Fp(){b.value=new Set,oa(i=>{i.children.length>0&&b.value.add(i.id)}),pe()}function ra(i){b.value=new Set,oa((a,f)=>{f>i&&a.children.length>0&&b.value.add(a.id)}),pe()}function Hp(){b.value=new Set,pe()}function ia(i,a){Fa(m.value,i,a)&&(Me(),pe(),l("change",m.value))}function Zr(i,a,f){return Ha(m.value,i,a,f)?(Me(),pe(),l("change",m.value),!0):!1}function Wp(i,a){if(i.stopPropagation(),i.shiftKey){const f=new Set(d.value);f.has(a.id)?f.delete(a.id):f.add(a.id),d.value=f}else d.value=new Set([a.id]);ft()}function Gp(i,a,f){let _=null;for(const S of eo.value){if(S.id===f)continue;const D=S.width/2,v=S.height/2;i>=S.x-D&&i<=S.x+D&&a>=S.y-v&&a<=S.y+v&&(_=S)}return _}let Ut=null;function jp(i,a){if(r.previewMode||a.isRoot||i.button!==0)return;const f=i.target;if(f!=null&&f.closest(".zm-img-resize-handle"))return;i.stopPropagation();const _=s.value.getBoundingClientRect(),S=a.x*ne.scale.value+ne.offsetX.value,D=a.y*ne.scale.value+ne.offsetY.value,v=i.clientX-_.left-S,j=i.clientY-_.top-D;Ut={srcId:a.id,srcText:a.text,pointerOffsetX:v,pointerOffsetY:j,startX:i.clientX,startY:i.clientY},window.addEventListener("pointermove",la),window.addEventListener("pointerup",sr),window.addEventListener("pointercancel",sr)}function la(i){if(Ut){const v=i.clientX-Ut.startX,j=i.clientY-Ut.startY;if(Math.abs(v)<=Pl&&Math.abs(j)<=Pl)return;N.value={srcId:Ut.srcId,srcText:Ut.srcText,pointerOffsetX:Ut.pointerOffsetX,pointerOffsetY:Ut.pointerOffsetY,currentTargetId:null},document.body.classList.add("is-dragging"),Ut=null}const a=N.value;if(!a)return;const f=s.value.getBoundingClientRect();$.value=i.clientX-f.left-a.pointerOffsetX,M.value=i.clientY-f.top-a.pointerOffsetY;const _=(i.clientX-f.left-ne.offsetX.value)/ne.scale.value,S=(i.clientY-f.top-ne.offsetY.value)/ne.scale.value,D=Gp(_,S,a.srcId);a.currentTargetId=(D==null?void 0:D.id)??null}function sr(i){if(window.removeEventListener("pointermove",la),window.removeEventListener("pointerup",sr),window.removeEventListener("pointercancel",sr),Ut){Ut=null;return}const a=N.value;a&&(a.currentTargetId&&(Zr(a.srcId,a.currentTargetId,"child"),d.value=new Set([a.srcId]),ft()),N.value=null,$.value=0,M.value=0,document.body.classList.remove("is-dragging"))}let cr=!1;function Kp(i){const a=i.target;if(!a||a.closest(".zm-node, .zm-toolbar, button, input, textarea"))return;if(i.button===2){cr=!0,ne.startPan(i);return}if(cr=!1,i.button!==0)return;const f=s.value.getBoundingClientRect(),_=(i.clientX-f.left-ne.offsetX.value)/ne.scale.value,S=(i.clientY-f.top-ne.offsetY.value)/ne.scale.value;ne.startMarquee(_,S,{shift:i.shiftKey})}function Yp(i){if(Rn){Rn=!1;return}const a=i.target;if(!a||a.closest(".zm-node"))return;const f=ne.marquee;f.width>=4||f.height>=4||d.value.size>0&&(d.value=new Set,ft())}function qp(){const i=ne.marquee;if(i.width<4&&i.height<4)return;const a=i.x,f=i.y,_=i.x+i.width,S=i.y+i.height,D=[];for(const v of eo.value){const j=v.width/2,te=v.height/2,me=v.x-j,Ve=v.x+j,T=v.y-te,Ke=v.y+te;me<=_&&Ve>=a&&T<=S&&Ke>=f&&D.push(v.id)}d.value=i.shiftKey?new Set([...d.value,...D]):new Set(D),ft()}function aa(i){return b.value.has(i)}function Xp(i){const a=oe(m.value,i.id);return!!a&&a.children.length>0}function Jr(i){const a=oe(m.value,i);return a?a.children.length:0}function sa(i){if(!oe(m.value,i))return 0;const _=[m.value];for(;_.length;){const S=_.pop(),D=S.children.findIndex(v=>v.id===i);if(D>=0)return D;for(const v of S.children)_.push(v)}return 0}function dr(i,a,f,_){if(((_==null?void 0:_._dir)??i._dir)==="down")return a==="out"?{x:i.x,y:i.y+i.height/2}:{x:i.x,y:i.y-i.height/2};let D;a==="in"?D=-i.side:f!==void 0?D=f:D=i.side;const v=a==="in"?i._richInsetX??0:0;return{x:i.x+D*(i.width/2-v),y:i.y}}function on(){const i=ut.value;ne.resetView(i.width,i.height,i.root.y)}function Zp(){Jn.value=!0,Me(),pe(),e.nextTick(()=>on())}function Qr(i){R.layoutMode!==i&&(R.layoutMode=i,pe(),e.nextTick(()=>on()))}function ca(){return JSON.stringify(m.value,null,2)}function da(i){const a=oe(m.value,i);return a?!!(a.note&&a.note.text||a.link&&a.link.url||a.image&&a.image.src||a.richContent&&a.richContent.raw||a.markers&&a.markers.length>0||a.tags&&a.tags.length>0):!1}function ua(i){try{const a=JSON.parse(i);return!a.id||!Array.isArray(a.children)?!1:($t.reset(),m.value=_t(a),d.value=new Set,b.value=new Set,pe(),e.nextTick(()=>on()),l("change",m.value),!0)}catch{return!1}}function Jp(){const i=document.createElement("input");i.type="file",i.accept="application/json",i.onchange=()=>{var _;const a=(_=i.files)==null?void 0:_[0];if(!a)return;const f=new FileReader;f.onload=()=>{typeof f.result=="string"&&(ua(f.result)||alert("导入失败:JSON 格式无效"))},f.readAsText(a)},i.click()}function Qp(){const i=new Blob([ca()],{type:"application/json"}),a=URL.createObjectURL(i),f=document.createElement("a");f.href=a,f.download=`${m.value.text||"mindmap"}.json`,f.click(),URL.revokeObjectURL(a)}const fa=e.ref(""),rn=e.ref([]),wo=e.ref(-1);function eg(i){fa.value=i;const a=i.trim();if(!a){rn.value=[],wo.value=-1;return}const f=a.toLowerCase(),_=[],S=D=>{var v;(D.text.toLowerCase().includes(f)||(v=D.note)!=null&&v.text&&D.note.text.toLowerCase().includes(f))&&_.push(D.id);for(const j of D.children)S(j)};S(m.value),rn.value=_,wo.value=_.length>0?0:-1,_.length>0&&(rg(_),e.nextTick(()=>ig(0)))}function tg(i){return rn.value.includes(i)}function ng(i){return wo.value>=0&&rn.value[wo.value]===i}function og(i){return fa.value.trim().length>0&&rn.value.length>0&&!rn.value.includes(i)}function rg(i){if(i.length===0)return;const a=new Set(i),f=new Set,_=S=>{let D=a.has(S.id);for(const v of S.children)_(v)&&(D=!0);return D&&S.children.length>0&&b.value.has(S.id)&&f.add(S.id),D};if(_(m.value),f.size>0){for(const S of f)b.value.delete(S);pe()}}function ig(i){const a=rn.value[i];if(!a)return;const f=eo.value.find(_=>_.id===a);f&&(d.value=new Set([a]),ft(),ne.centerOn(f.x,f.y,f.width,f.height))}function lg(i,a){const f=oe(m.value,i);f&&(f.markers||(f.markers=[]),!f.markers.includes(a)&&(f.markers.push(a),Me(),pe(),l("change",m.value)))}function ag(i,a){const f=oe(m.value,i);if(!f||!f.markers)return;const _=f.markers.indexOf(a);_<0||(f.markers.splice(_,1),f.markers.length===0&&delete f.markers,Me(),pe(),l("change",m.value))}function ma(i,a){const f=oe(m.value,i);if(!f)return!1;f.markers||(f.markers=[]);const _=f.markers.indexOf(a);return _>=0?(f.markers.splice(_,1),f.markers.length===0&&delete f.markers,Me(),pe(),l("change",m.value),!1):(f.markers.push(a),Me(),pe(),l("change",m.value),!0)}function sg(i){const a=oe(m.value,i);return a!=null&&a.markers?[...a.markers]:[]}function cg(i){var f;const a=(f=y.value)==null?void 0:f.nodeId;a&&ma(a,i)}function dg(){var f;const i=(f=y.value)==null?void 0:f.nodeId;if(!i)return;const a=oe(m.value,i);!a||!a.markers||(delete a.markers,Me(),pe(),l("change",m.value),se())}function ei(i,a){const f=oe(m.value,i);f&&(a.length===0?f.tags&&delete f.tags:f.tags=[...a],Me(),pe(),l("change",m.value))}function ug(i){const a=oe(m.value,i);return a!=null&&a.tags?[...a.tags]:[]}function fg(){var D,v;const i=(D=y.value)==null?void 0:D.nodeId;if(!i)return;const a=oe(m.value,i),f=((v=a==null?void 0:a.tags)==null?void 0:v.join(", "))??"",_=window.prompt("输入标签(多个用逗号分隔)",f);if(_===null)return;const S=_.split(/[,,]/).map(j=>j.trim()).filter(j=>j.length>0);ei(i,S),se()}function mg(){var a;const i=(a=y.value)==null?void 0:a.nodeId;i&&(ei(i,[]),se())}function pa(){const i=ut.value,a="http://www.w3.org/2000/svg",f=document.createElementNS(a,"svg");f.setAttribute("xmlns",a),f.setAttribute("viewBox",`${i.vbX} ${i.vbY} ${i.vbW} ${i.vbH}`),f.setAttribute("width",String(i.vbW)),f.setAttribute("height",String(i.vbH));const _=document.createElementNS(a,"rect");_.setAttribute("x",String(i.vbX)),_.setAttribute("y",String(i.vbY)),_.setAttribute("width",String(i.vbW)),_.setAttribute("height",String(i.vbH)),_.setAttribute("fill",Xt.value),f.appendChild(_);for(const v of jl.value){const j=document.createElementNS(a,"path");j.setAttribute("d",Ce(dr(v.from,"out",v.to.side,v.to),dr(v.to,"in"),h(v.from.depth),O(v.to.depth),32,R.lineStyle,v.to._dir)),j.setAttribute("fill",He(v.from,v.to)),j.setAttribute("stroke","none"),f.appendChild(j)}const S="-apple-system,BlinkMacSystemFont,'Segoe UI','PingFang SC','Microsoft YaHei',sans-serif";function D(v,j){let te=0;for(const me of v)/[\u4e00-\u9fff\u3000-\u30ff\uff00-\uffef]/.test(me)?te+=j:te+=j*.55;return te}for(const v of eo.value){const j=v.x-v.width/2,te=v.y-v.height/2,me=document.createElementNS(a,"rect");me.setAttribute("x",String(j)),me.setAttribute("y",String(te)),me.setAttribute("width",String(v.width)),me.setAttribute("height",String(v.height)),me.setAttribute("rx","8"),me.setAttribute("fill",Eo(v)),me.setAttribute("stroke",Qn(v)),me.setAttribute("stroke-width","1"),f.appendChild(me);const Ve=!!(v.tags&&v.tags.length>0),T=!!(v.markers&&v.markers.length>0),Ke=!!v.image,wt=!!(v.richContent&&(v.richContent.kind==="code"||v.richContent.kind==="table"));let de=0,mt=0;if(wt){const Ye=v.richContent,qe=v.fontSize*.78*.92,Jt=6,De=4,kn=2,yn=6;if(Ye.kind==="code"){const St=Wo(Ye.raw),pt=Nn(Ye.raw),Tt=St.split(`
133
+ `),Qt=qe*1.35;let zt=0;for(const Be of Tt)zt=Math.max(zt,D(Be,qe));mt=Math.min(zt+Jt*2+4,v.width-4),de=Tt.length*Qt+De*2+kn;const Xe=v.x-mt/2;let at=te+4;Ke&&(at=te+v.image.height+yn);const Ct=document.createElementNS(a,"rect");if(Ct.setAttribute("x",String(Xe)),Ct.setAttribute("y",String(at)),Ct.setAttribute("width",String(mt)),Ct.setAttribute("height",String(de-kn)),Ct.setAttribute("rx","6"),Ct.setAttribute("fill","rgba(255,255,255,0.55)"),Ct.setAttribute("stroke",Qn(v)),Ct.setAttribute("stroke-width","1"),f.appendChild(Ct),pt){const Be=document.createElementNS(a,"text");Be.setAttribute("x",String(Xe+mt-Jt)),Be.setAttribute("y",String(at+De+4)),Be.setAttribute("text-anchor","end"),Be.setAttribute("fill",nn(v)),Be.setAttribute("font-size",String(qe*.8)),Be.setAttribute("font-family",S),Be.setAttribute("opacity","0.5"),Be.textContent=pt,f.appendChild(Be)}const So="'JetBrains Mono','Fira Code',Consolas,monospace";for(let Be=0;Be<Tt.length;Be++){const nt=document.createElementNS(a,"text");nt.setAttribute("x",String(Xe+Jt)),nt.setAttribute("y",String(at+De+(Be+.5)*Qt+2)),nt.setAttribute("dominant-baseline","central"),nt.setAttribute("fill",nn(v)),nt.setAttribute("font-size",String(qe)),nt.setAttribute("font-family",So);let Ot=Tt[Be];const Ue=Math.floor((mt-Jt*2)/(qe*.6));Ot.length>Ue&&(Ot=Ot.substring(0,Ue-1)+"…"),nt.textContent=Ot,f.appendChild(nt)}}else if(Ye.kind==="table"){const St=Cr(Ye.raw);if(St.length>0){const pt=qe*1.35,Tt=6,Qt=3,zt=St[0].length,Xe=[];for(let Ue=0;Ue<zt;Ue++){let sn=0;for(const En of St)Ue<En.length&&(sn=Math.max(sn,D(En[Ue],qe)));Xe.push(sn+Tt*2)}mt=Math.min(Xe.reduce((Ue,sn)=>Ue+sn,0),v.width-4);const at=mt/Xe.reduce((Ue,sn)=>Ue+sn,0);for(let Ue=0;Ue<zt;Ue++)Xe[Ue]*=at;de=St.length*(pt+Qt*2)+kn;const Ct=v.x-mt/2;let So=te+4;Ke&&(So=te+v.image.height+yn);const Be=document.createElementNS(a,"rect");Be.setAttribute("x",String(Ct)),Be.setAttribute("y",String(So)),Be.setAttribute("width",String(mt)),Be.setAttribute("height",String(de-kn)),Be.setAttribute("rx","6"),Be.setAttribute("fill","rgba(255,255,255,0.55)"),Be.setAttribute("stroke",Qn(v)),Be.setAttribute("stroke-width","1"),f.appendChild(Be);let nt=Ct,Ot=So;for(let Ue=0;Ue<St.length;Ue++){const sn=St[Ue],En=pt+Qt*2;nt=Ct;for(let To=0;To<zt;To++){const oo=Xe[To],pg=sn[To]||"";if(To<zt-1){const Fe=document.createElementNS(a,"line");Fe.setAttribute("x1",String(nt+oo)),Fe.setAttribute("y1",String(Ot)),Fe.setAttribute("x2",String(nt+oo)),Fe.setAttribute("y2",String(Ot+En)),Fe.setAttribute("stroke",Qn(v)),Fe.setAttribute("stroke-width","1"),f.appendChild(Fe)}if(Ue<St.length-1){const Fe=document.createElementNS(a,"line");Fe.setAttribute("x1",String(nt)),Fe.setAttribute("y1",String(Ot+En)),Fe.setAttribute("x2",String(nt+oo)),Fe.setAttribute("y2",String(Ot+En)),Fe.setAttribute("stroke",Qn(v)),Fe.setAttribute("stroke-width","1"),f.appendChild(Fe)}if(Ue===0){const Fe=document.createElementNS(a,"rect");Fe.setAttribute("x",String(nt)),Fe.setAttribute("y",String(Ot)),Fe.setAttribute("width",String(oo)),Fe.setAttribute("height",String(En)),Fe.setAttribute("fill","rgba(255,255,255,0.4)"),f.appendChild(Fe)}const cn=document.createElementNS(a,"text");cn.setAttribute("x",String(nt+Tt)),cn.setAttribute("y",String(Ot+Qt+pt/2+2)),cn.setAttribute("dominant-baseline","central"),cn.setAttribute("fill",nn(v)),cn.setAttribute("font-size",String(qe)),cn.setAttribute("font-family",S),Ue===0&&cn.setAttribute("font-weight","600");let ur=pg;const ti=Math.floor((oo-Tt*2)/(qe*.55));ur.length>ti&&ti>2&&(ur=ur.substring(0,ti-1)+"…"),cn.textContent=ur,f.appendChild(cn),nt+=oo}Ot+=En}}}}let ln=0;if(Ke){const Ye=v.image,qe=te+4,Jt=v.x-Ye.width/2,De=document.createElementNS(a,"image");De.setAttribute("x",String(Jt)),De.setAttribute("y",String(qe)),De.setAttribute("width",String(Ye.width)),De.setAttribute("height",String(Ye.height)),De.setAttribute("href",Ye.src),De.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",Ye.src),De.setAttribute("preserveAspectRatio","xMidYMid meet"),f.appendChild(De),ln=Ye.height+6}let lt=v.y;const yt=ln+de;yt>0?lt=te+yt+(v.height-yt)/2:Ve&&(lt=v.y-8);const Zt=14,Ft=2,bn=4,Ht=T?v.markers.length:0,ye=Ht>0?Ht*Zt+(Ht-1)*Ft+bn:0,Ie=D(v.text,v.fontSize),Wt=ye+Ie,an=v.x-Wt/2;if(T){let Ye=an;for(const qe of v.markers){const Jt=Io(qe);if(Jt){const De=document.createElementNS(a,"svg");De.setAttribute("x",String(Ye)),De.setAttribute("y",String(lt-Zt/2)),De.setAttribute("width",String(Zt)),De.setAttribute("height",String(Zt)),De.setAttribute("viewBox","0 0 24 24"),De.setAttribute("color",nn(v));const yn=new DOMParser().parseFromString(`<svg xmlns="${a}">${Jt}</svg>`,"image/svg+xml");if(!yn.querySelector("parsererror"))for(;yn.documentElement.firstChild;)De.appendChild(yn.documentElement.firstChild);f.appendChild(De)}Ye+=Zt+Ft}}const no=T?an+ye+Ie/2:v.x,Nt=document.createElementNS(a,"text");if(Nt.setAttribute("x",String(no)),Nt.setAttribute("y",String(lt)),Nt.setAttribute("text-anchor","middle"),Nt.setAttribute("dominant-baseline","central"),Nt.setAttribute("fill",nn(v)),Nt.setAttribute("font-size",String(Hl(v))),Nt.setAttribute("font-weight",String(Fl(v))),Nt.setAttribute("font-family",S),Nt.textContent=v.text,f.appendChild(Nt),Ve){const De=v.y+10,kn=v.tags.map(pt=>D(pt,10)+12),yn=kn.reduce((pt,Tt)=>pt+Tt+3,-3);let St=v.x-yn/2;for(let pt=0;pt<v.tags.length;pt++){const Tt=v.tags[pt],Qt=gr(Tt),zt=kn[pt],Xe=document.createElementNS(a,"rect");Xe.setAttribute("x",String(St)),Xe.setAttribute("y",String(De-16/2)),Xe.setAttribute("width",String(zt)),Xe.setAttribute("height",String(16)),Xe.setAttribute("rx",String(16/2)),Xe.setAttribute("fill",Qt.background),Xe.setAttribute("stroke",Qt.borderColor),Xe.setAttribute("stroke-width","1"),f.appendChild(Xe);const at=document.createElementNS(a,"text");at.setAttribute("x",String(St+zt/2)),at.setAttribute("y",String(De)),at.setAttribute("text-anchor","middle"),at.setAttribute("dominant-baseline","central"),at.setAttribute("fill",Qt.color),at.setAttribute("font-size",String(10)),at.setAttribute("font-family",S),at.textContent=Tt,f.appendChild(at),St+=zt+3}}}return f}function No(){const i=pa();let f=new XMLSerializer().serializeToString(i);f.startsWith("<?xml")||(f=`<?xml version="1.0" encoding="UTF-8"?>
134
+ `+f);const _=new Blob([f],{type:"image/svg+xml;charset=utf-8"}),S=URL.createObjectURL(_),D=document.createElement("a");D.href=S,D.download=`${m.value.text||"mindmap"}.svg`,D.click(),URL.revokeObjectURL(S)}function ga(i=2){const a=pa(),f=ut.value;let S=new XMLSerializer().serializeToString(a);S.startsWith("<?xml")||(S=`<?xml version="1.0" encoding="UTF-8"?>
135
+ `+S);const D=new Blob([S],{type:"image/svg+xml;charset=utf-8"}),v=URL.createObjectURL(D),j=new window.Image;j.onload=()=>{const te=document.createElement("canvas");te.width=Math.ceil(f.vbW*i),te.height=Math.ceil(f.vbH*i);const me=te.getContext("2d");if(!me){URL.revokeObjectURL(v);return}me.fillStyle=Xt.value,me.fillRect(0,0,te.width,te.height),me.drawImage(j,0,0,te.width,te.height),URL.revokeObjectURL(v);try{te.toBlob(Ve=>{if(!Ve){No();return}const T=URL.createObjectURL(Ve),Ke=document.createElement("a");Ke.href=T,Ke.download=`${m.value.text||"mindmap"}.png`,Ke.click(),URL.revokeObjectURL(T)},"image/png")}catch(Ve){console.warn("PNG export failed, falling back to SVG:",Ve),No()}},j.onerror=()=>{URL.revokeObjectURL(v),No()},j.src=v}return o({addChild:i=>to(i),addSibling:i=>ar(i),removeNode:i=>ta(i),duplicateNode:i=>ql(i),setNodeText:(i,a)=>ia(i,a),moveNode:(i,a,f)=>Zr(i,a,f),lineWidthForDepth:h,endWidthForDepth:O,getData:()=>m.value,nodeHasContent:i=>da(i),getSelectedIds:()=>[...d.value],copyNodes:i=>Jl(i),cutNodes:i=>Ql(i),pasteNodes:i=>ea(i),setData:i=>{$t.reset(),m.value=_t(i),d.value=new Set,b.value=new Set,pe(),Me(),e.nextTick(()=>on())},resetView:()=>on(),exportData:ca,importData:ua,getMarkdown:()=>On(m.value),setMarkdown:(i,a=!0)=>{const f=zn(i||"");a&&(K.value=!0),Y=!a,$t.reset(),m.value=_t(f),d.value=new Set,b.value=new Set,pe(),Me(),e.nextTick(()=>{Y=!1,on()}),l("change",m.value)},setBalanced:i=>{Jn.value=i},isBalanced:()=>Jn.value,balance:()=>Zp(),applyNodeStyle:(i,a)=>q(i,a),getNodeStyle:i=>Q(i),applyNodeImage:(i,a)=>ie(i,a),applyNodeImageByUrl:(i,a)=>A(i,a),removeNodeImage:i=>z(i),applyNodeLink:(i,a)=>le(i,a),removeNodeLink:i=>Ne(i),applyNodeNote:(i,a)=>_e(i,a),removeNodeNote:i=>Re(i),applyNodeRichContent:(i,a)=>xe(i,a),addNodeMarker:(i,a)=>lg(i,a),removeNodeMarker:(i,a)=>ag(i,a),toggleNodeMarker:(i,a)=>ma(i,a),getNodeMarkers:i=>sg(i),setNodeTags:(i,a)=>ei(i,a),getNodeTags:i=>ug(i),exportPNG:i=>ga(i),exportSVG:()=>No(),searchNodes:i=>(eg(i),[...rn.value]),undo:()=>qr(),redo:()=>Xr(),canUndo:()=>$t.canUndo(),canRedo:()=>$t.canRedo(),applySettings:i=>{i.autoBalanceOnChange!==void 0&&(R.autoBalanceOnChange=i.autoBalanceOnChange),i.lineWidthStart!==void 0&&(R.lineWidthStart=Math.max(.5,Math.min(20,i.lineWidthStart))),i.lineWidthEnd!==void 0&&(R.lineWidthEnd=Math.max(.3,Math.min(10,i.lineWidthEnd))),i.rainbowBranch!==void 0&&(R.rainbowBranch=i.rainbowBranch),i.branchPaletteId!==void 0&&(R.branchPaletteId=i.branchPaletteId),i.customPalettes!==void 0&&(R.customPalettes=i.customPalettes),i.lineStyle!==void 0&&(R.lineStyle=i.lineStyle),i.taperedEdge!==void 0&&(R.taperedEdge=i.taperedEdge),i.showOrderBadge!==void 0&&(R.showOrderBadge=i.showOrderBadge),i.canvasBg!==void 0&&(R.canvasBg=i.canvasBg)},getSettings:()=>({autoBalanceOnChange:R.autoBalanceOnChange,lineWidthStart:R.lineWidthStart,lineWidthEnd:R.lineWidthEnd,rainbowBranch:R.rainbowBranch,branchPaletteId:R.branchPaletteId,customPalettes:R.customPalettes,lineStyle:R.lineStyle,layoutMode:R.layoutMode,taperedEdge:R.taperedEdge,showOrderBadge:R.showOrderBadge,canvasBg:R.canvasBg}),setBranchPalette:i=>{if(!i)return;[...en,...R.customPalettes].find(f=>f.id===i)&&(R.branchPaletteId=i)},getBranchPalette:()=>R.branchPaletteId,getBranchPalettes:()=>[...en,...R.customPalettes],getSearchResults:()=>[...rn.value],getSearchIndex:()=>wo.value}),e.watch(()=>r.data,i=>{m.value=_t(i),pe()},{deep:!1}),e.onMounted(()=>{Me(),e.nextTick(()=>on())}),(i,a)=>{var f,_,S,D,v,j,te,me,Ve;return e.openBlock(),e.createElementBlock("div",{class:"zm-mindmap",style:e.normalizeStyle({background:Xt.value,fontSize:tt.value.fontSize+"px"})},[e.createElementVNode("div",{ref_key:"wrapperRef",ref:s,class:"zm-canvas",onMousedown:Kp,onContextmenu:ge,onWheel:a[25]||(a[25]=(...T)=>e.unref(ne).onWheel&&e.unref(ne).onWheel(...T)),onMouseenter:a[26]||(a[26]=T=>w.value=!0),onMouseleave:a[27]||(a[27]=T=>w.value=!1),onClick:Yp},[e.createElementVNode("div",{class:"zm-svg-layer",style:e.normalizeStyle({left:ut.value.vbX*e.unref(ne).scale.value+e.unref(ne).offsetX.value+"px",top:ut.value.vbY*e.unref(ne).scale.value+e.unref(ne).offsetY.value+"px",width:ut.value.vbW*e.unref(ne).scale.value+"px",height:ut.value.vbH*e.unref(ne).scale.value+"px"})},[(e.openBlock(),e.createElementBlock("svg",{class:"zm-svg",viewBox:Rp.value,preserveAspectRatio:"xMinYMin meet",width:ut.value.vbW*e.unref(ne).scale.value,height:ut.value.vbH*e.unref(ne).scale.value},[e.createElementVNode("g",Qm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(jl.value,T=>(e.openBlock(),e.createElementBlock("path",{key:T.key,d:Ce(dr(T.from,"out",T.to.side,T.to),dr(T.to,"in"),h(T.from.depth),O(T.to.depth),32,R.lineStyle,T.to._dir),fill:He(T.from,T.to),stroke:"none"},null,8,ep))),128))])],8,Jm))],4),e.unref(ne).isMarquee.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-marquee",style:e.normalizeStyle({left:e.unref(ne).marquee.x*e.unref(ne).scale.value+e.unref(ne).offsetX.value+"px",top:e.unref(ne).marquee.y*e.unref(ne).scale.value+e.unref(ne).offsetY.value+"px",width:e.unref(ne).marquee.width*e.unref(ne).scale.value+"px",height:e.unref(ne).marquee.height*e.unref(ne).scale.value+"px"})},null,4)):e.createCommentVNode("",!0),N.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"zm-drag-ghost",style:e.normalizeStyle({left:$.value+"px",top:M.value+"px",transform:`scale(${e.unref(ne).scale.value})`,transformOrigin:"top left"})},e.toDisplayString(N.value.srcText),5)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"zm-world",style:e.normalizeStyle({transform:`translate(${e.unref(ne).offsetX.value}px, ${e.unref(ne).offsetY.value}px) scale(${e.unref(ne).scale.value})`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(eo.value,T=>{var Ke,wt;return e.openBlock(),e.createElementBlock("div",{key:T.id,class:e.normalizeClass(["zm-node",{"is-root":T.isRoot,"is-selected":g.value===T.id,"is-selected-secondary":g.value!==T.id&&d.value.has(T.id),"is-editing":c.value===T.id,"has-image":!!T.image,"is-resizing":Kr.value===T.id,"is-dragging-source":((Ke=N.value)==null?void 0:Ke.srcId)===T.id,"is-drop-target":((wt=N.value)==null?void 0:wt.currentTargetId)===T.id,"is-search-hit":tg(T.id),"is-search-current":ng(T.id),"is-search-dimmed":og(T.id)}]),"data-node-id":T.id,style:e.normalizeStyle({left:T.x+"px",top:T.y+"px",width:T.width+"px",minWidth:T.width+"px",height:T.height+"px",fontSize:Hl(T)+"px",background:Eo(T),color:nn(T),borderColor:Qn(T),fontWeight:Fl(T),transform:"translate(-50%, -50%)"}),onClick:de=>Wp(de,T),onPointerdown:de=>jp(de,T),onDblclick:de=>{de.stopPropagation(),t.previewMode||xo(T.id)},onContextmenu:de=>X(de,T),onMouseenter:de=>{Xn(T.id),Zn(de,T)},onMouseleave:de=>hn(T.id)},[T.image?(e.openBlock(),e.createElementBlock("img",{key:0,class:"zm-node-img",src:T.image.src,width:T.image.width,height:T.image.height,alt:T.text,draggable:"false"},null,8,np)):e.createCommentVNode("",!0),T.richContent&&(T.richContent.kind==="code"||T.richContent.kind==="table")&&c.value!==T.id?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["zm-rich zm-rich-above",{"zm-rich-no-overflow":T.richContent.kind==="table"||T.richContent.kind==="code"}]),onClick:a[1]||(a[1]=e.withModifiers(()=>{},["stop"])),onDblclick:e.withModifiers(de=>Ip(T.id),["stop"]),onMousedown:a[2]||(a[2]=e.withModifiers(()=>{},["stop"]))},[C.value===T.id?e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:0,"onUpdate:modelValue":a[0]||(a[0]=de=>E.value=de),class:"zm-rich-edit",spellcheck:"false",onBlur:Yl,onKeydown:Op},null,544)),[[e.vModelText,E.value]]):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[T.richContent.kind==="code"?(e.openBlock(),e.createElementBlock("pre",rp,[e.createElementVNode("code",{innerHTML:e.unref(Tr)(e.unref(Wo)(T.richContent.raw),e.unref(Nn)(T.richContent.raw))},null,8,ip)])):T.richContent.kind==="table"?(e.openBlock(),e.createElementBlock("table",lp,[e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Dp(T.id,e.unref(Cr)(T.richContent.raw)),(de,mt)=>(e.openBlock(),e.createElementBlock("tr",{key:mt},[mt===0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(de,(ln,lt)=>{var yt,Zt,Ft,bn,Ht;return e.openBlock(),e.createElementBlock("th",{key:`h${lt}`,class:e.normalizeClass(["zm-rich-table-sort",{"is-sorted":((yt=k.value.get(T.id))==null?void 0:yt.col)===lt,"is-asc":((Zt=k.value.get(T.id))==null?void 0:Zt.col)===lt&&((Ft=k.value.get(T.id))==null?void 0:Ft.dir)==="asc","is-desc":((bn=k.value.get(T.id))==null?void 0:bn.col)===lt&&((Ht=k.value.get(T.id))==null?void 0:Ht.dir)==="desc"}]),onClick:e.withModifiers(ye=>Lp(T.id,lt),["stop"])},[e.createElementVNode("span",null,e.toDisplayString(ln),1),e.createElementVNode("span",sp,e.toDisplayString(Vp(T.id,lt)),1)],10,ap)}),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(de,(ln,lt)=>(e.openBlock(),e.createElementBlock("td",{key:`c${lt}`},e.toDisplayString(ln),1))),128))]))),128))])])):e.createCommentVNode("",!0)],64))],42,op)):e.createCommentVNode("",!0),c.value!==T.id?(e.openBlock(),e.createElementBlock("span",cp,[T.markers&&T.markers.length>0?(e.openBlock(),e.createElementBlock("span",dp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.markers,de=>(e.openBlock(),e.createElementBlock("span",{key:de,class:"zm-node-marker",title:e.unref(bi)(de),innerHTML:'<svg viewBox="0 0 24 24" width="14" height="14">'+e.unref(Io)(de)+"</svg>"},null,8,up))),128))])):e.createCommentVNode("",!0),e.createElementVNode("span",fp,e.toDisplayString(T.text),1),T.link&&!c.value?(e.openBlock(),e.createElementBlock("a",{key:1,class:"zm-node-link",href:T.link.url,target:"_blank",rel:"noopener noreferrer",title:`打开链接:${T.link.url}`,onClick:a[3]||(a[3]=e.withModifiers(()=>{},["stop"])),onMousedown:a[4]||(a[4]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(be,{name:"link",size:11,stroke:2})],40,mp)):e.createCommentVNode("",!0),T.note&&!c.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-node-note-btn",type:"button",title:ir(T.note.text),onClick:e.withModifiers(de=>rr(T.id),["stop"]),onMousedown:a[5]||(a[5]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(be,{name:"note",size:11,stroke:2})],40,pp)):e.createCommentVNode("",!0)])):e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:3,class:"zm-input","onUpdate:modelValue":a[6]||(a[6]=de=>u.value=de),autofocus:"",onBlur:a[7]||(a[7]=de=>Yr()),onKeydown:[a[8]||(a[8]=e.withKeys(e.withModifiers(de=>Yr(),["exact"]),["enter"])),a[9]||(a[9]=e.withKeys(e.withModifiers(de=>Yr(),["prevent"]),["tab"])),e.withKeys(Bp,["esc"]),$p],onMousedown:a[10]||(a[10]=e.withModifiers(()=>{},["stop"])),onClick:a[11]||(a[11]=e.withModifiers(()=>{},["stop"]))},null,544)),[[e.vModelText,u.value]]),T.tags&&T.tags.length>0&&c.value!==T.id?(e.openBlock(),e.createElementBlock("div",gp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.tags,de=>(e.openBlock(),e.createElementBlock("span",{key:de,class:"zm-node-tag",style:e.normalizeStyle(e.unref(gr)(de))},e.toDisplayString(de),5))),128))])):e.createCommentVNode("",!0),ee.value?(e.openBlock(),e.createElementBlock("span",{key:5,class:"zm-order-badge",title:`数据顺序:第 ${sa(T.id)+1} 个`},e.toDisplayString(sa(T.id)+1),9,hp)):e.createCommentVNode("",!0),aa(T.id)&&Jr(T.id)>0?(e.openBlock(),e.createElementBlock("span",{key:6,class:e.normalizeClass(["zm-collapse-badge",{"is-on-left":T.side===-1}]),style:e.normalizeStyle({background:Pt.value.get(T.id)??"#64748b"}),title:`展开 ${Jr(T.id)} 个子节点`,onMousedown:a[12]||(a[12]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(de=>na(T.id),["stop"])},e.toDisplayString(Jr(T.id)),47,bp)):e.createCommentVNode("",!0),Xp(T)&&!aa(T.id)?(e.openBlock(),e.createElementBlock("button",{key:7,class:e.normalizeClass(["zm-btn zm-collapse",{"is-on-left":T.side===-1}]),style:e.normalizeStyle({color:Pt.value.get(T.id)??"#64748b",borderColor:Pt.value.get(T.id)??"#64748b"}),title:"折叠",onMousedown:a[13]||(a[13]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(de=>na(T.id),["stop"])},[e.createVNode(be,{name:"minus",size:10,stroke:2.4})],46,kp)):e.createCommentVNode("",!0),T.image&&g.value===T.id&&c.value!==T.id?(e.openBlock(),e.createElementBlock("span",{key:8,class:"zm-img-resize-handle",title:"拖动调整图片大小",onMousedown:e.withModifiers(de=>Et(de,T),["stop"])},null,40,yp)):e.createCommentVNode("",!0),T.image&&g.value===T.id&&c.value!==T.id?(e.openBlock(),e.createElementBlock("button",{key:9,class:"zm-img-remove-btn",title:"移除图片",onMousedown:a[14]||(a[14]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(de=>z(T.id),["stop"])},[e.createVNode(be,{name:"x",size:9,stroke:2.2})],40,Ep)):e.createCommentVNode("",!0)],46,tp)}),128))],4),I.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["zm-tooltip",{"is-below":!I.value.above}]),style:e.normalizeStyle({left:I.value.x+"px",top:I.value.y+"px"})},e.toDisplayString(I.value.text),7)):e.createCommentVNode("",!0),y.value?(e.openBlock(),e.createBlock(cs,{key:3,x:y.value.x,y:y.value.y,container:s.value,"has-image":!!((f=e.unref(oe)(m.value,y.value.nodeId))!=null&&f.image),"has-link":!!((_=e.unref(oe)(m.value,y.value.nodeId))!=null&&_.link),"has-note":!!((S=e.unref(oe)(m.value,y.value.nodeId))!=null&&S.note),"has-code":((v=(D=e.unref(oe)(m.value,y.value.nodeId))==null?void 0:D.richContent)==null?void 0:v.kind)==="code","has-table":((te=(j=e.unref(oe)(m.value,y.value.nodeId))==null?void 0:j.richContent)==null?void 0:te.kind)==="table","node-markers":((me=e.unref(oe)(m.value,y.value.nodeId))==null?void 0:me.markers)??[],"node-tags":((Ve=e.unref(oe)(m.value,y.value.nodeId))==null?void 0:Ve.tags)??[],onPickImage:go,onRemoveImage:vn,onSetLink:Wr,onRemoveLink:ho,onEditNote:bo,onRemoveNote:Gr,onAddCode:or,onEditCode:or,onRemoveCode:jr,onAddTable:Oe,onEditTable:Oe,onRemoveTable:pn,onToggleMarker:cg,onClearMarkers:dg,onAddTag:fg,onRemoveTags:mg,onClose:se},null,8,["x","y","container","has-image","has-link","has-note","has-code","has-table","node-markers","node-tags"])):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createBlock(ds,{key:4,x:p.value.x,y:p.value.y,container:s.value,onOpenSettings:Pe,onOpenData:Ze,onOpenImport:je,onExportPng:ga,onExportSvg:No,onClose:Ge},null,8,["x","y","container"])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(L.value),title:r.previewMode?"退出预览模式":"进入预览模式",onClick:a[15]||(a[15]=T=>l("canvas-toggle-preview"))},[e.createVNode(be,{name:r.previewMode?"eye-off":"eye",size:16},null,8,["name"])],10,xp),e.createElementVNode("button",{class:e.normalizeClass(V.value),title:"显示大纲视图",onClick:po},[e.createVNode(be,{name:"outline",size:16})],2),e.createElementVNode("div",{class:e.normalizeClass(["zm-toolbar",{"is-preview-only":r.previewMode,"is-hovered":w.value}])},[e.createElementVNode("span",wp,e.toDisplayString(Math.round(e.unref(ne).scale.value*100))+"%",1),e.createElementVNode("button",{class:"zm-tb-btn",title:"放大",onClick:a[16]||(a[16]=(...T)=>e.unref(ne).zoomIn&&e.unref(ne).zoomIn(...T))},[e.createVNode(be,{name:"zoom-in"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"缩小",onClick:a[17]||(a[17]=(...T)=>e.unref(ne).zoomOut&&e.unref(ne).zoomOut(...T))},[e.createVNode(be,{name:"zoom-out"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"重置视图",onClick:on},[e.createVNode(be,{name:"reset"})]),a[38]||(a[38]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"全部收起",onClick:Fp},[e.createVNode(be,{name:"collapse-all"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"展开一级",onClick:a[18]||(a[18]=T=>ra(1))},[e.createVNode(be,{name:"expand-level-1"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"展开二级",onClick:a[19]||(a[19]=T=>ra(2))},[e.createVNode(be,{name:"expand-level-2"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"全部展开",onClick:Hp},[e.createVNode(be,{name:"expand-all"})]),a[39]||(a[39]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"导出 JSON",onClick:Qp},[e.createVNode(be,{name:"export"})]),r.previewMode?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[a[35]||(a[35]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"添加子节点 (Tab)",onClick:a[20]||(a[20]=T=>g.value&&to(g.value))},[e.createElementVNode("img",{src:e.unref(ii),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,Np)]),e.createElementVNode("button",{class:"zm-tb-btn",title:"添加同级 (Enter)",onClick:a[21]||(a[21]=T=>g.value&&ar(g.value))},[e.createElementVNode("img",{src:e.unref(ri),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,Sp)]),a[36]||(a[36]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:R.layoutMode==="mindmap"}]),title:"思维导图布局 (中心辐射)",onClick:a[22]||(a[22]=T=>Qr("mindmap"))},[e.createVNode(be,{name:"mindmap"})],2),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:R.layoutMode==="tree"}]),title:"树形布局 (向右展开)",onClick:a[23]||(a[23]=T=>Qr("tree"))},[e.createVNode(be,{name:"tree"})],2),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:R.layoutMode==="org"}]),title:"组织结构布局 (向下展开)",onClick:a[24]||(a[24]=T=>Qr("org"))},[e.createVNode(be,{name:"org"})],2),a[37]||(a[37]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"导入 JSON",onClick:Jp},[e.createVNode(be,{name:"import"})])],64))],2)],544),r.builtInDrawers?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(Mt,{side:"left",scope:"canvas",width:300,open:tn.value&&!t.previewMode,title:"大纲","onUpdate:open":a[28]||(a[28]=T=>tn.value=T)},{default:e.withCtx(()=>[e.createVNode(zo,{data:m.value,"selected-id":g.value,"collapsed-ids":Je.value,onSelect:mo,onToggleCollapse:mn,onEdit:nr,onAddChild:jn,onAddSibling:Kn,onMove:It},null,8,["data","selected-id","collapsed-ids"])]),_:1},8,["open"]),e.createVNode(Mt,{side:"right",scope:"canvas",width:360,open:Rt.value&&!t.previewMode,title:"数据","onUpdate:open":a[30]||(a[30]=T=>Rt.value=T)},{default:e.withCtx(()=>[e.createVNode(Oo,{data:m.value,"pending-mode":Bt.value,onImport:a[29]||(a[29]=T=>m.value=T),onConsumedMode:ze},null,8,["data","pending-mode"])]),_:1},8,["open"]),e.createVNode(Mt,{side:"right",scope:"canvas",width:420,open:J.value&&!t.previewMode,title:"Markdown","onUpdate:open":a[32]||(a[32]=T=>J.value=T)},{default:e.withCtx(()=>[e.createVNode(Lo,{data:m.value,onImport:a[31]||(a[31]=T=>m.value=T)},null,8,["data"])]),_:1},8,["open"]),e.createVNode(Mt,{side:"right",scope:"canvas",width:360,open:it.value&&!t.previewMode,title:"节点内容","onUpdate:open":a[33]||(a[33]=T=>it.value=T)},{default:e.withCtx(()=>[e.createVNode(Zo,{"selected-node":dt.value,"focus-tick":Se.value,onApply:Qe,onRemove:ht,onSetLink:Mn,onSetImage:er,onSetRich:tr},null,8,["selected-node","focus-tick"])]),_:1},8,["open"]),e.createVNode(Mt,{side:"right",scope:"canvas",width:340,open:Te.value&&!t.previewMode,title:"设置","onUpdate:open":a[34]||(a[34]=T=>Te.value=T)},{default:e.withCtx(()=>{var T;return[e.createVNode(Do,{settings:R,"has-selection":g.value!==null,"selected-node-text":(T=dt.value)==null?void 0:T.text,"node-style":H.value,"onUpdate:settings":Z,"onUpdate:nodeStyle":ce,onReset:ke},null,8,["settings","has-selection","selected-node-text","node-style"])]}),_:1},8,["open"])],64)):e.createCommentVNode("",!0)],4)}}}),Tp={class:"zm-app"},Cp={class:"zm-app-main"},Ap={class:"zm-app-canvas"},Ul=e.defineComponent({__name:"App",setup(t){const o={id:"r_root",text:"flow-mindmap 节点能力一览",link:{url:"https://github.com/xz333221/flow-mindmap"},note:{text:`本导图用于演示节点的全部可渲染字段。
133
136
  所有代码块 / 表格在节点标题上方显示,不会撑大节点框。`},children:[{id:"r_image",text:"嵌入图片",image:{src:"data:image/svg+xml;utf8,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 40" width="80" height="40"><rect width="80" height="40" rx="6" fill="#6366f1"/><text x="40" y="24" text-anchor="middle" fill="#fff" font-family="sans-serif" font-size="12" font-weight="600">LOGO</text></svg>'),naturalW:80,naturalH:40,width:80,height:40},children:[{id:"r_image_a",text:"节点上方的图标 / logo",children:[]},{id:"r_image_b",text:"remote URL 或 data: URL",children:[]},{id:"r_image_c",text:"可拖拽改尺寸",children:[]}]},{id:"r_code",text:"代码块",richContent:{kind:"code",lang:"ts",raw:'```ts\nimport { MindMap } from "flow-mindmap"\nconst tree = MindMap.parse(md)\n```'},note:{text:`代码块以 richContent 形式携带,
134
137
  渲染在节点标题上方,自动支持语言 tag。`},link:{url:"https://flow-mindmap.example/docs/api"},children:[{id:"r_code_a",text:"等宽字体,自动换行",richContent:{kind:"code",lang:"js",raw:"```js\nconst sum = (a, b) => a + b\nconsole.log(sum(1, 2)) // 3\n```"},children:[]},{id:"r_code_b",text:"保留原始 ```lang 标签",richContent:{kind:"code",lang:"bash",raw:"```bash\nnpm install flow-mindmap\nnpm run dev\n```"},children:[]},{id:"r_code_c",text:"max-height 截断,框内可滚",richContent:{kind:"code",lang:"ts",raw:`\`\`\`ts
135
138
  interface Node {
@@ -160,4 +163,4 @@ function walk(n: Node) {
160
163
  | --- | --- | --- | --- | --- |
161
164
  | 1 | 2 | 3 | 4 | 5 |
162
165
  | 6 | 7 | 8 | 9 | 10 |`},children:[]}]},{id:"r_note",text:"笔记 (note)",note:{text:`节点右上角的便签图标。
163
- 鼠标悬浮预览前 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"?r:(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:[]}]},r=(()=>{const D=(ce,De)=>({id:ce,text:De,children:[]}),T=[D("s_l1","左一"),D("s_l2","左二"),D("s_l3","左三"),D("s_l4","左四"),D("s_l5","左五"),D("s_l6","左六"),D("s_l7","左七")],se=[D("s_r1","右一"),D("s_r2","右二"),D("s_r3","右三"),D("s_r4","右四"),D("s_r5","右五"),D("s_r6","右六"),D("s_r7","右七")];return{id:"root",text:"flow-mindmap 思维导图",children:[...T,...se]}})(),s=e.ref(o),c=t,u=e.ref(null),d=e.ref(new Set),f=e.ref(!1),p=e.ref(!1),k=e.ref(!1),y=e.ref(!1),N=e.ref(0),E=e.ref(!1),L=e.ref(!1),C=e.ref(null);function x(){s.value=n(),R.value=typeof location<"u"&&location.hash==="#rich"}const R=e.ref(!0);function S(){p.value=!0,k.value=!1,y.value=!1}function g(D){S()}const _=e.reactive({autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:3.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"curve",layoutMode:"mindmap",taperedEdge:!0,showOrderBadge:!1});function b(D){var T;Object.assign(_,D),(T=C.value)==null||T.applySettings(D)}function O(D){var T;u.value&&((T=C.value)==null||T.applyNodeStyle(u.value.id,D))}function W(){var T;const D={autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"curve",layoutMode:"mindmap",taperedEdge:!0,showOrderBadge:!1};Object.assign(_,D),(T=C.value)==null||T.applySettings(D)}function ne(D){if(!E.value)return;const T=D.target;T&&T.closest(".zm-settings-popover")||T&&T.closest('.zm-app-icon-btn[title="显示设置"]')||(E.value=!1)}function pe(D){if(D.key==="Escape"){if(E.value){E.value=!1,D.stopPropagation();return}L.value&&(L.value=!1,D.stopPropagation())}}e.onMounted(()=>{var D;document.addEventListener("click",ne),document.addEventListener("keydown",pe),window.addEventListener("hashchange",x),(D=C.value)==null||D.applySettings({rainbowBranch:_.rainbowBranch,branchPaletteId:_.branchPaletteId,customPalettes:_.customPalettes,lineWidthStart:_.lineWidthStart,lineWidthEnd:_.lineWidthEnd,lineStyle:_.lineStyle})}),e.onBeforeUnmount(()=>{document.removeEventListener("click",ne),document.removeEventListener("keydown",pe),window.removeEventListener("hashchange",x)});function K(D){s.value=D}function ie(D){var se;const T=D&&D.length>0?D[0]:null;u.value=T,T?!y.value&&((se=C.value)!=null&&se.nodeHasContent(T.id))&&(p.value=!1,k.value=!1,y.value=!0):y.value=!1}e.watch(s,D=>{if(!u.value)return;const T=q(D,u.value.id);T?T!==u.value&&(u.value=T):u.value=null},{deep:!1});function F(D){if(!u.value||u.value.id!==D){const T=q(s.value,D);T&&(u.value=T)}p.value=!1,k.value=!1,y.value=!0,N.value++}function q(D,T){if(D.id===T)return D;for(const se of D.children){const ce=q(se,T);if(ce)return ce}return null}function U(D){var T;u.value&&((T=C.value)==null||T.applyNodeNote(u.value.id,D))}function w(){var D;u.value&&((D=C.value)==null||D.removeNodeNote(u.value.id))}function P(D){var T;u.value&&((T=C.value)==null||T.applyNodeLink(u.value.id,D))}function V(D){var T;u.value&&((T=C.value)==null||T.applyNodeImageByUrl(u.value.id,D))}function Y(D){var T;u.value&&((T=C.value)==null||T.applyNodeRichContent(u.value.id,D))}function ae(D){const T=document.querySelector(`[data-node-id="${D.id}"]`);T&&T.click()}function ke(D){const T=new Set(d.value);T.has(D)?T.delete(D):T.add(D),d.value=T}function Re(D){var T;(T=C.value)==null||T.setNodeText(D.id,D.text)}function Pe(D){var T;(T=C.value)==null||T.addChild(D)}function Te(D){var T;(T=C.value)==null||T.addSibling(D)}function B(D){var T;(T=C.value)==null||T.moveNode(D.srcId,D.targetId,D.position)}const z=e.computed(()=>{var D;return((D=u.value)==null?void 0:D.id)??null});function oe(D){return 1+D.children.reduce((T,se)=>T+oe(se),0)}const re=e.computed(()=>oe(s.value));return(D,T)=>{var se;return e.openBlock(),e.createElementBlock("div",Zf,[e.createVNode(ln,{side:"left",width:300,open:f.value,title:"大纲","onUpdate:open":T[0]||(T[0]=ce=>f.value=ce)},{default:e.withCtx(()=>[e.createVNode(Oo,{data:s.value,"selected-id":z.value,"collapsed-ids":d.value,onSelect:ae,onToggleCollapse:ke,onEdit:Re,onAddChild:Pe,onAddSibling:Te,onMove:B},null,8,["data","selected-id","collapsed-ids"])]),_:1},8,["open"]),e.createElementVNode("main",Jf,[L.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Qf,[c.showOutlineBtn&&!f.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-app-icon-btn",title:"显示大纲",onClick:T[1]||(T[1]=ce=>f.value=!0)},[...T[18]||(T[18]=[e.createStaticVNode('<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="8" y1="6" x2="21" y2="6"></line><line x1="8" y1="12" x2="21" y2="12"></line><line x1="8" y1="18" x2="21" y2="18"></line><line x1="3" y1="6" x2="3.01" y2="6"></line><line x1="3" y1="12" x2="3.01" y2="12"></line><line x1="3" y1="18" x2="3.01" y2="18"></line></svg>',1)])])):e.createCommentVNode("",!0),c.showDataBtn&&!p.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-app-icon-btn",title:"显示数据",onClick:T[2]||(T[2]=ce=>{p.value=!0,k.value=!1,y.value=!1})},[...T[19]||(T[19]=[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("polyline",{points:"16 18 22 12 16 6"}),e.createElementVNode("polyline",{points:"8 6 2 12 8 18"})],-1)])])):e.createCommentVNode("",!0),c.showMarkdownBtn&&!k.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-app-icon-btn",title:"显示 Markdown",onClick:T[3]||(T[3]=ce=>{k.value=!0,p.value=!1,y.value=!1})},[...T[20]||(T[20]=[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:"M4 7 V4 H20 V7"}),e.createElementVNode("path",{d:"M9 20 H15"}),e.createElementVNode("path",{d:"M12 4 V20"})],-1)])])):e.createCommentVNode("",!0),c.showSettingsBtn&&!E.value?(e.openBlock(),e.createElementBlock("button",{key:3,class:"zm-app-icon-btn",title:"显示设置",onClick:T[4]||(T[4]=ce=>E.value=!0)},[...T[21]||(T[21]=[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("circle",{cx:"12",cy:"12",r:"3"}),e.createElementVNode("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"})],-1)])])):e.createCommentVNode("",!0),T[24]||(T[24]=e.createElementVNode("span",{class:"zm-app-spacer"},null,-1)),e.createElementVNode("span",em,e.toDisplayString(s.value.text||"未命名")+" · "+e.toDisplayString(re.value)+" 节点",1),e.createCommentVNode("",!0),c.showPreviewModeBtn?(e.openBlock(),e.createElementBlock("button",{key:5,class:e.normalizeClass(["zm-app-icon-btn",{"is-on":L.value}]),title:"进入预览模式",onClick:T[5]||(T[5]=ce=>L.value=!0)},[...T[23]||(T[23]=[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("circle",{cx:"12",cy:"12",r:"3"})],-1)])],2)):e.createCommentVNode("",!0)])),L.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-app-preview-exit",title:"退出预览 (Esc)",onClick:T[6]||(T[6]=ce=>L.value=!1)},[...T[25]||(T[25]=[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",tm,[e.createVNode(Xn,{ref_key:"mindMapRef",ref:C,data:s.value,"preview-mode":L.value,onChange:K,onSelect:ie,onEditNote:F,onCanvasSettings:T[7]||(T[7]=ce=>E.value=!0),onCanvasData:S,onCanvasImport:g,onCanvasTogglePreview:T[8]||(T[8]=ce=>L.value=!L.value),onCanvasOutline:T[9]||(T[9]=ce=>f.value=!0)},null,8,["data","preview-mode"])])]),e.createVNode(ln,{side:"right",width:360,open:p.value&&!L.value,title:"数据","onUpdate:open":T[11]||(T[11]=ce=>p.value=ce)},{default:e.withCtx(()=>[e.createVNode(vo,{data:s.value,onImport:T[10]||(T[10]=ce=>s.value=ce)},null,8,["data"])]),_:1},8,["open"]),e.createVNode(ln,{side:"right",width:420,open:k.value&&!L.value,title:"Markdown","onUpdate:open":T[13]||(T[13]=ce=>k.value=ce)},{default:e.withCtx(()=>[e.createVNode(Lo,{data:s.value,onImport:T[12]||(T[12]=ce=>s.value=ce)},null,8,["data"])]),_:1},8,["open"]),e.createVNode(ln,{side:"right",width:360,open:y.value&&!L.value,title:"节点内容","onUpdate:open":T[14]||(T[14]=ce=>y.value=ce)},{default:e.withCtx(()=>[e.createVNode(ni,{"selected-node":u.value,readonly:!1,"focus-tick":N.value,onApply:U,onRemove:w,onSetLink:P,onSetImage:V,onSetRich:Y},null,8,["selected-node","focus-tick"])]),_:1},8,["open"]),E.value&&!L.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-settings-backdrop",onClick:T[15]||(T[15]=ce=>E.value=!1)})):e.createCommentVNode("",!0),E.value&&!L.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"zm-settings-popover",onClick:T[17]||(T[17]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",nm,[T[27]||(T[27]=e.createElementVNode("span",{class:"zm-settings-popover-title"},"设置",-1)),e.createElementVNode("button",{class:"zm-settings-close",onClick:T[16]||(T[16]=ce=>E.value=!1),title:"关闭"},[...T[26]||(T[26]=[e.createElementVNode("svg",{width:"12",height:"12",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.createVNode(Do,{settings:_,"has-selection":u.value!==null,"selected-node-text":(se=u.value)==null?void 0:se.text,"onUpdate:settings":b,"onUpdate:nodeStyle":O,onReset:W},null,8,["settings","has-selection","selected-node-text"])])):e.createCommentVNode("",!0)])}}}),om={install(t){t.component("FlowMindMap",Xn),t.component("FlowMindMapOutline",Oo),t.component("FlowMindMapDrawer",ln),t.component("FlowMindMapDataPanel",vo),t.component("FlowMindMapMarkdownPanel",Lo),t.component("FlowMindMapSettingsPanel",Do),t.component("FlowMindMapNotePanel",ni),t.component("FlowMindMapApp",qr)}};Ee.DataPanel=vo,Ee.Drawer=ln,Ee.MarkdownPanel=Lo,Ee.MindMap=Xn,Ee.MindMapApp=qr,Ee.NotePanel=ni,Ee.Outline=Oo,Ee.SettingsPanel=Do,Ee.addChild=Ei,Ee.addSibling=xi,Ee.clone=ct,Ee.default=om,Ee.findNode=fe,Ee.findParent=ut,Ee.markdownToMindMap=Jt,Ee.markdownToRichMindMap=Ul,Ee.mindMapToMarkdown=Qt,Ee.removeNode=Fn,Ee.richBlockToMarkdown=Hl,Ee.uid=yt,Object.defineProperties(Ee,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
166
+ 鼠标悬浮预览前 60 字,点击打开完整笔记编辑器。`},children:[{id:"r_note_a",text:"悬浮预览",children:[]},{id:"r_note_b",text:"点击展开编辑",children:[]},{id:"r_note_c",text:"export → ```note 围栏",children:[]}]},{id:"r_link",text:"链接 (link)",link:{url:"https://github.com/xz333221/flow-mindmap"},children:[{id:"r_link_a",text:"节点右侧的小图标",children:[]},{id:"r_link_b",text:"点击在新 tab 打开",children:[]},{id:"r_link_c",text:"export → [label](url)",children:[]}]},{id:"r_para",text:"段落 / 列表 (子节点)",children:[{id:"r_para_a",text:"段落不再是父节点框内文字",children:[]},{id:"r_para_b",text:"列表每项一个子节点",children:[]},{id:"r_para_c",text:"节点框大小保持一致,边线对齐",children:[]}]}]};function n(){return typeof location<"u"&&location.hash==="#fan"?r:typeof location<"u"&&location.hash==="#stress"?l:(typeof location<"u"&&location.hash==="#rich",o)}const r={id:"root",text:"flow-mindmap 思维导图",children:[{id:"n_a",text:"主题一",children:[]},{id:"n_b",text:"主题二",children:[]},{id:"n_c",text:"主题三",children:[]},{id:"n_d",text:"主题四",children:[]},{id:"n_e",text:"主题五",children:[]},{id:"n_f",text:"主题六",children:[]},{id:"n_g",text:"主题七",children:[]},{id:"n_h",text:"主题八",children:[]},{id:"n_i",text:"主题九",children:[]}]},l=(()=>{const y=(V,X)=>({id:V,text:X,children:[]}),p=[y("s_l1","左一"),y("s_l2","左二"),y("s_l3","左三"),y("s_l4","左四"),y("s_l5","左五"),y("s_l6","左六"),y("s_l7","左七")],L=[y("s_r1","右一"),y("s_r2","右二"),y("s_r3","右三"),y("s_r4","右四"),y("s_r5","右五"),y("s_r6","右六"),y("s_r7","右七")];return{id:"root",text:"flow-mindmap 思维导图",children:[...p,...L]}})(),s=e.ref(o),c=e.ref(null),u=e.ref(new Set),d=e.ref(!1),g=e.ref(!1),b=e.ref(!1),w=e.ref(!1),N=e.ref(0),$=e.ref(!1),M=e.ref(!1),P=e.ref(null);function I(){s.value=n()}function C(){g.value=!0,b.value=!1,w.value=!1}function E(y){C()}const k=e.reactive({autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:3.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"curve",layoutMode:"mindmap",taperedEdge:!0,showOrderBadge:!1,canvasBg:void 0}),m=e.computed(()=>{var y;return c.value?((y=P.value)==null?void 0:y.getNodeStyle(c.value.id))??{}:{}});function B(y){var p;Object.assign(k,y),(p=P.value)==null||p.applySettings(y)}function x(y){var p;c.value&&((p=P.value)==null||p.applyNodeStyle(c.value.id,y))}function K(){var p;const y={autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"curve",layoutMode:"mindmap",taperedEdge:!0,showOrderBadge:!1,canvasBg:void 0};Object.assign(k,y),(p=P.value)==null||p.applySettings(y)}function Y(y){if(y.key==="Escape"){if($.value){$.value=!1,y.stopPropagation();return}M.value&&(M.value=!1,y.stopPropagation())}}e.onMounted(()=>{var y;document.addEventListener("keydown",Y),window.addEventListener("hashchange",I),(y=P.value)==null||y.applySettings({rainbowBranch:k.rainbowBranch,branchPaletteId:k.branchPaletteId,customPalettes:k.customPalettes,lineWidthStart:k.lineWidthStart,lineWidthEnd:k.lineWidthEnd,lineStyle:k.lineStyle})}),e.onBeforeUnmount(()=>{document.removeEventListener("keydown",Y),window.removeEventListener("hashchange",I)});function ee(y){s.value=y}function ae(y){var L;const p=y&&y.length>0?y[0]:null;c.value=p,p?!w.value&&((L=P.value)!=null&&L.nodeHasContent(p.id))&&(g.value=!1,b.value=!1,w.value=!0):w.value=!1}e.watch(s,y=>{if(!c.value)return;const p=q(y,c.value.id);p?p!==c.value&&(c.value=p):c.value=null},{deep:!1});function re(y){if(!c.value||c.value.id!==y){const p=q(s.value,y);p&&(c.value=p)}g.value=!1,b.value=!1,w.value=!0,N.value++}function q(y,p){if(y.id===p)return y;for(const L of y.children){const V=q(L,p);if(V)return V}return null}function Q(y){var p;c.value&&((p=P.value)==null||p.applyNodeNote(c.value.id,y))}function ie(){var y;c.value&&((y=P.value)==null||y.removeNodeNote(c.value.id))}function z(y){var p;c.value&&((p=P.value)==null||p.applyNodeLink(c.value.id,y))}function A(y){var p;c.value&&((p=P.value)==null||p.applyNodeImageByUrl(c.value.id,y))}function F(y){var p;c.value&&((p=P.value)==null||p.applyNodeRichContent(c.value.id,y))}function U(y){const p=document.querySelector(`[data-node-id="${y.id}"]`);p&&p.click()}function G(y){const p=new Set(u.value);p.has(y)?p.delete(y):p.add(y),u.value=p}function le(y){var p;(p=P.value)==null||p.setNodeText(y.id,y.text)}function Ne(y){var p;(p=P.value)==null||p.addChild(y)}function _e(y){var p;(p=P.value)==null||p.addSibling(y)}function Re(y){var p;(p=P.value)==null||p.moveNode(y.srcId,y.targetId,y.position)}const xe=e.computed(()=>{var y;return((y=c.value)==null?void 0:y.id)??null});return(y,p)=>(e.openBlock(),e.createElementBlock("div",Tp,[e.createVNode(Mt,{side:"left",width:300,open:d.value,title:"大纲","onUpdate:open":p[0]||(p[0]=L=>d.value=L)},{default:e.withCtx(()=>[e.createVNode(zo,{data:s.value,"selected-id":xe.value,"collapsed-ids":u.value,onSelect:U,onToggleCollapse:G,onEdit:le,onAddChild:Ne,onAddSibling:_e,onMove:Re},null,8,["data","selected-id","collapsed-ids"])]),_:1},8,["open"]),e.createElementVNode("main",Cp,[M.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-app-preview-exit",title:"退出预览 (Esc)",onClick:p[1]||(p[1]=L=>M.value=!1)},[...p[11]||(p[11]=[e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),e.createElementVNode("line",{x1:"2",y1:"2",x2:"22",y2:"22"})],-1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",Ap,[e.createVNode(Jo,{ref_key:"mindMapRef",ref:P,data:s.value,"preview-mode":M.value,"built-in-drawers":!1,onChange:ee,onSelect:ae,onEditNote:re,onCanvasSettings:p[2]||(p[2]=L=>$.value=!0),onCanvasData:C,onCanvasImport:E,onCanvasTogglePreview:p[3]||(p[3]=L=>M.value=!M.value),onCanvasOutline:p[4]||(p[4]=L=>d.value=!0)},null,8,["data","preview-mode"])])]),e.createVNode(Mt,{side:"right",width:360,open:g.value&&!M.value,title:"数据","onUpdate:open":p[6]||(p[6]=L=>g.value=L)},{default:e.withCtx(()=>[e.createVNode(Oo,{data:s.value,onImport:p[5]||(p[5]=L=>s.value=L)},null,8,["data"])]),_:1},8,["open"]),e.createVNode(Mt,{side:"right",width:420,open:b.value&&!M.value,title:"Markdown","onUpdate:open":p[8]||(p[8]=L=>b.value=L)},{default:e.withCtx(()=>[e.createVNode(Lo,{data:s.value,onImport:p[7]||(p[7]=L=>s.value=L)},null,8,["data"])]),_:1},8,["open"]),e.createVNode(Mt,{side:"right",width:360,open:w.value&&!M.value,title:"节点内容","onUpdate:open":p[9]||(p[9]=L=>w.value=L)},{default:e.withCtx(()=>[e.createVNode(Zo,{"selected-node":c.value,readonly:!1,"focus-tick":N.value,onApply:Q,onRemove:ie,onSetLink:z,onSetImage:A,onSetRich:F},null,8,["selected-node","focus-tick"])]),_:1},8,["open"]),e.createVNode(Mt,{side:"right",width:340,open:$.value&&!M.value,title:"设置","onUpdate:open":p[10]||(p[10]=L=>$.value=L)},{default:e.withCtx(()=>{var L;return[e.createVNode(Do,{settings:k,"has-selection":c.value!==null,"selected-node-text":(L=c.value)==null?void 0:L.text,"node-style":m.value,"onUpdate:settings":B,"onUpdate:nodeStyle":x,onReset:K},null,8,["settings","has-selection","selected-node-text","node-style"])]}),_:1},8,["open"])]))}}),_p="0.5.1",Mp={install(t){t.component("FlowMindMap",Jo),t.component("FlowMindMapOutline",zo),t.component("FlowMindMapDrawer",Mt),t.component("FlowMindMapDataPanel",Oo),t.component("FlowMindMapMarkdownPanel",Lo),t.component("FlowMindMapSettingsPanel",Do),t.component("FlowMindMapNotePanel",Zo),t.component("FlowMindMapApp",Ul)}};he.DataPanel=Oo,he.Drawer=Mt,he.MARKER_LIB=pr,he.MarkdownPanel=Lo,he.MindMap=Jo,he.MindMapApp=Ul,he.NotePanel=Zo,he.Outline=zo,he.SettingsPanel=Do,he.VERSION=_p,he.addChild=mi,he.addSibling=pi,he.clone=_t,he.default=Mp,he.findNode=oe,he.findParent=Lt,he.markdownToMindMap=zn,he.markdownToRichMindMap=Ka,he.markerDef=rs,he.markerLabel=bi,he.markerSvg=Io,he.mindMapToMarkdown=On,he.removeNode=Mo,he.richBlockToMarkdown=Ya,he.tagColor=gr,he.uid=Gt,Object.defineProperties(he,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});