flow-mindmap 0.4.0 → 0.4.2

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,23 +1,163 @@
1
- (function(ce,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(ce=typeof globalThis<"u"?globalThis:ce||self,e(ce.FlowMind={},ce.Vue))})(this,function(ce,e){"use strict";const wi=["width","height","stroke-width"],_i={key:4,points:"6 9 12 15 18 9"},Si={key:5,points:"9 6 15 12 9 18"},j=e.defineComponent({__name:"Icon",props:{name:{},size:{},stroke:{}},setup(t){return(a,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",_i)):t.name==="expand"?(e.openBlock(),e.createElementBlock("polyline",Si)):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==="settings"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:13},[n[23]||(n[23]=e.createStaticVNode('<circle cx="12" cy="12" r="3"></circle><line x1="12" y1="2.5" x2="12" y2="4.5"></line><line x1="12" y1="19.5" x2="12" y2="21.5"></line><line x1="2.5" y1="12" x2="4.5" y2="12"></line><line x1="19.5" y1="12" x2="21.5" y2="12"></line><line x1="5.6" y1="5.6" x2="7" y2="7"></line><line x1="17" y1="17" x2="18.4" y2="18.4"></line><line x1="5.6" y1="18.4" x2="7" y2="17"></line><line x1="17" y1="7" x2="18.4" y2="5.6"></line>',9))],64)):t.name==="data"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:14},[n[24]||(n[24]=e.createElementVNode("path",{d:"M9 5 C7 5 7 7 7 9 C7 11 7 12 5 12 C7 12 7 13 7 15 C7 17 7 19 9 19"},null,-1)),n[25]||(n[25]=e.createElementVNode("path",{d:"M15 5 C17 5 17 7 17 9 C17 11 17 12 19 12 C17 12 17 13 17 15 C17 17 17 19 15 19"},null,-1)),n[26]||(n[26]=e.createElementVNode("line",{x1:"10.5",y1:"12",x2:"13.5",y2:"12"},null,-1))],64)):t.name==="settings"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:15},[n[27]||(n[27]=e.createStaticVNode('<circle cx="12" cy="12" r="3"></circle><line x1="12" y1="2.5" x2="12" y2="4.5"></line><line x1="12" y1="19.5" x2="12" y2="21.5"></line><line x1="2.5" y1="12" x2="4.5" y2="12"></line><line x1="19.5" y1="12" x2="21.5" y2="12"></line><line x1="5.6" y1="5.6" x2="7" y2="7"></line><line x1="17" y1="17" x2="18.4" y2="18.4"></line><line x1="5.6" y1="18.4" x2="7" y2="17"></line><line x1="17" y1="7" x2="18.4" y2="5.6"></line>',9))],64)):t.name==="data"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:16},[n[28]||(n[28]=e.createElementVNode("path",{d:"M9 5 C7 5 7 7 7 9 C7 11 7 12 5 12 C7 12 7 13 7 15 C7 17 7 19 9 19"},null,-1)),n[29]||(n[29]=e.createElementVNode("path",{d:"M15 5 C17 5 17 7 17 9 C17 11 17 12 19 12 C17 12 17 13 17 15 C17 17 17 19 15 19"},null,-1)),n[30]||(n[30]=e.createElementVNode("line",{x1:"10.5",y1:"12",x2:"13.5",y2:"12"},null,-1))],64)):t.name==="markdown"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:17},[n[31]||(n[31]=e.createElementVNode("path",{d:"M3 17 V7 L7 13 L11 7 V17"},null,-1)),n[32]||(n[32]=e.createElementVNode("path",{d:"M14 7 V17"},null,-1)),n[33]||(n[33]=e.createElementVNode("path",{d:"M14 7 L18 12 L22 7"},null,-1)),n[34]||(n[34]=e.createElementVNode("line",{x1:"14",y1:"17",x2:"22",y2:"17"},null,-1))],64)):t.name==="txt"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:18},[n[35]||(n[35]=e.createElementVNode("rect",{x:"5",y:"3",width:"14",height:"18",rx:"1.5"},null,-1)),n[36]||(n[36]=e.createElementVNode("line",{x1:"8",y1:"8",x2:"16",y2:"8"},null,-1)),n[37]||(n[37]=e.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1)),n[38]||(n[38]=e.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):t.name==="eye"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:19},[n[39]||(n[39]=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[40]||(n[40]=e.createElementVNode("circle",{cx:"12",cy:"12",r:"3.2"},null,-1))],64)):t.name==="eye-off"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:20},[n[41]||(n[41]=e.createElementVNode("path",{d:"M3 3 L21 21"},null,-1)),n[42]||(n[42]=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[43]||(n[43]=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[44]||(n[44]=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:21},[n[45]||(n[45]=e.createElementVNode("rect",{x:"4",y:"3",width:"16",height:"18",rx:"2"},null,-1)),n[46]||(n[46]=e.createElementVNode("line",{x1:"8",y1:"8",x2:"16",y2:"8"},null,-1)),n[47]||(n[47]=e.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1)),n[48]||(n[48]=e.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):t.name==="logo"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:22},[n[49]||(n[49]=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:23},[n[50]||(n[50]=e.createElementVNode("path",{d:"M12 4 V15"},null,-1)),n[51]||(n[51]=e.createElementVNode("polyline",{points:"7 10 12 15 17 10"},null,-1)),n[52]||(n[52]=e.createElementVNode("path",{d:"M4 19 H20"},null,-1))],64)):t.name==="export"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:24},[n[53]||(n[53]=e.createElementVNode("path",{d:"M12 15 V4"},null,-1)),n[54]||(n[54]=e.createElementVNode("polyline",{points:"7 9 12 4 17 9"},null,-1)),n[55]||(n[55]=e.createElementVNode("path",{d:"M4 19 H20"},null,-1))],64)):t.name==="balance"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:25},[n[56]||(n[56]=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:26},[n[57]||(n[57]=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:27},[n[58]||(n[58]=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:28},[n[59]||(n[59]=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:29},[n[60]||(n[60]=e.createElementVNode("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"},null,-1)),n[61]||(n[61]=e.createElementVNode("circle",{cx:"9",cy:"11",r:"1.6"},null,-1)),n[62]||(n[62]=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:30},[n[63]||(n[63]=e.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"},null,-1)),n[64]||(n[64]=e.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"},null,-1))],64)):t.name==="link"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:31},[n[65]||(n[65]=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[66]||(n[66]=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:32},[n[67]||(n[67]=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[68]||(n[68]=e.createElementVNode("line",{x1:"8",y1:"10",x2:"16",y2:"10"},null,-1)),n[69]||(n[69]=e.createElementVNode("line",{x1:"8",y1:"13",x2:"16",y2:"13"},null,-1)),n[70]||(n[70]=e.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):e.createCommentVNode("",!0)],8,wi))}}),Qt="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",en="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",tn=[18,15,13,12],Mi=[700,600,500,400],Ci=[52,40,32,28],vi=[120,80,60,44],Ti=[.8,.8,.8,.8],Ai=tn.length-1;function Ri(t,a){return Math.round(Rt(t,a)*Ti[ct(t)])}function ct(t){return Math.min(Ai,Math.max(0,t))}function Rt(t,a=14){return Math.round(tn[ct(t)]*a/14*10)/10}function Bi(t,a=14){return Math.round(Ci[ct(t)]*a/14)}const dt=60,Ue=14,ye=24;let Bt=null;function Oi(){if(Bt)return Bt;const t=typeof document<"u"?document.createElement("canvas").getContext("2d"):null;return t?(Bt=t,t):{font:"",measureText:()=>({width:0})}}const nn=new Map;function Ii(t,a,n){const r=`${n}|${a}|${t}`,l=nn.get(r);if(l!==void 0)return l;const u=Oi();u.font=`${n} ${a}px "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif`;const s=u.measureText(t).width;return nn.set(r,s),s}const Li=24,Di=400,zi=8,on=16,$i=4,Vi=200;function Pi(t,a,n){return Math.min(n,Math.max(a,t))}function Ui(t,a,n,r,l){const u=ct(a),s=Rt(a,n),c=Math.min(Ii(t.text||"",s,Mi[u]),Vi),d=Ri(a,n),m=Math.ceil(c+d*2),E=!!(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table"))?Math.ceil(s*1.2)+6:Bi(a,n);let N=0;if(t.link&&(N+=on),t.note&&(N+=on),N>0){const I=(t.link?1:0)+(t.note?1:0);N+=$i*I}const b=m+N,g=(()=>{const I=Math.round(vi[u]*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(I,Q??240)}return I})(),V=!!(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table")),D=r==null?void 0:r[t.id],y=V?Math.max(24,D??Math.max(70,Math.ceil(s*5))):0,L=y>0?10:0;if(!t.image){const I=Math.max(g,b),Q=Math.ceil(E+L+y);return{w:I,h:Q}}const O=Pi(t.image.width,Li,Di),P=Math.max(g,b,Math.ceil(O+d*2)),z=Math.ceil(t.image.height+zi+E+L+y);return{w:P,h:z}}function Hi(t,a={}){const n=a.mode??"mindmap",r=a.preservePositions===!0,l=a.baseFontSize??14,u=an(t,0,null,1,"right",l,a.richHeights,a.richWidths);return Wi(u),Fi(u,n,r),u.x=0,u.y=0,Ki(u,r)}function Fi(t,a,n=!1){if(a==="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 c=r.reduce((E,N)=>E+N._subtreeH,0);let d=1,m=Math.abs(r[0]._subtreeH-(c-r[0]._subtreeH)),x=0;for(let E=0;E<r.length-1;E++){x+=r[E]._subtreeH;const N=Math.abs(x-(c-x));N<m&&(m=N,d=E+1)}for(let E=0;E<d;E++)r[E]._dir="right",r[E].side=1,r[E]._dirRight=1;for(let E=d;E<r.length;E++)r[E]._dir="left",r[E].side=-1,r[E]._dirRight=-1}const l=t.children.filter(c=>c.side===1),u=t.children.filter(c=>c.side===-1),s=(c,d)=>{const m=d==="right"?1:-1;c._dir=d,c.side=m,c._dirRight=m;for(const x of c.children)s(x,d)};for(const c of l)s(c,"right");for(const c of u)s(c,"left");if(l.length>0){const c={...t,children:l};ut(c,"right",dt,!0,n)}if(u.length>0){const c={...t,children:u};ut(c,"left",dt,!0,n)}}else if(a==="tree"){const r=l=>{l.side=1,l._dir="right";for(const u of l.children)r(u)};for(const l of t.children)l._dir="right";ut(t,"right",dt,!0,n),r(t)}else{for(const r of t.children)r._dir="down";rn(t,dt,n)}}function ut(t,a,n,r,l=!1){if(t.children.length===0)return;const u=t.children.reduce((m,x,E)=>m+x._subtreeH+(E>0?Ue:0),0),s=a==="right"?1:-1,c=r?s:1;let d=t.y-c*u/2;t.children.forEach(m=>{l||(m.x=t.x+s*(t.width/2+n+m.width/2),m.y=d+c*m._subtreeH/2),m._dir=a,d+=c*(m._subtreeH+Ue),ut(m,a,n,!1,l)})}function rn(t,a,n=!1){if(t.children.length===0)return;const r=t.children.reduce((u,s,c)=>u+s._subtreeW+(c>0?Ue*2:0),0);let l=t.x-r/2;t.children.forEach(u=>{n||(u.x=l+u._subtreeW/2,u.y=t.y+t.height/2+a+u.height/2),u._dir="down",l+=u._subtreeW+Ue*2,rn(u,a,n)})}function an(t,a,n,r,l,u,s,c){const d=Ui(t,a,u,s,c),m={id:t.id,text:t.text,depth:a,x:t._x??0,y:t._y??0,width:d.w,height:d.h,fontSize:Rt(a,u),isRoot:a===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,children:[],parent:n};if(t.collapsed)return m;const x=t.children.length,E=Math.ceil(x/2);return m.children=t.children.map((N,b)=>{const g=a===0?b<E?1:-1:r;return an(N,a+1,m,g,l,u,s,c)}),m}function Wi(t){const a=[t];for(let n=0;n<a.length;n++){const r=a[n];for(const l of r.children)a.push(l)}for(let n=a.length-1;n>=0;n--){const r=a[n];if(r.collapsed||r.children.length===0){r._subtreeH=r.height,r._subtreeW=r.width;continue}let l=0,u=0;for(const s of r.children)l+=s._subtreeH,u+=s._subtreeW;r.children.length>1&&(l+=Ue*(r.children.length-1),u+=Ue*2*(r.children.length-1)),r._subtreeH=Math.max(r.height,l),r._subtreeW=Math.max(r.width,u)}}function Ki(t,a=!1){const n=[t];let r=1/0,l=-1/0,u=1/0,s=-1/0;for(;n.length;){const m=n.pop(),x=m.width/2,E=m.height/2;m.x-x<r&&(r=m.x-x),m.x+x>l&&(l=m.x+x),m.y-E<u&&(u=m.y-E),m.y+E>s&&(s=m.y+E),n.push(...m.children)}if(a)return{root:t,width:l-r+ye*2,height:s-u+ye*2,vbX:r-ye,vbY:u-ye,vbW:l-r+ye*2,vbH:s-u+ye*2};const c=ye-u,d=[t];for(;d.length;){const m=d.pop();m.y+=c,d.push(...m.children)}return u+=c,s+=c,{root:t,width:l-r+ye*2,height:s+ye,vbX:r-ye,vbY:0,vbW:l-r+ye*2,vbH:s+ye}}const Xe=[{id:"default",name:"默认",colors:["#f87171","#fb923c","#fbbf24","#a3e635","#34d399","#22d3ee","#818cf8","#c084fc"]},{id:"classic",name:"经典",colors:["#ef4444","#f59e0b","#10b981","#3b82f6","#6366f1","#8b5cf6","#ec4899","#14b8a6"]},{id:"vivid",name:"活力",colors:["#dc2626","#ea580c","#ca8a04","#16a34a","#0891b2","#2563eb","#7c3aed","#db2777"]},{id:"dev",name:"代码",colors:["#f472b6","#a78bfa","#60a5fa","#38bdf8","#22d3ee","#34d399","#facc15","#fb923c"]},{id:"mint",name:"薄荷",colors:["#5eead4","#67e8f9","#93c5fd","#c4b5fd","#fbcfe8","#fde68a","#a7f3d0","#bae6fd"]}];function Gi(t,a=[]){return[...Xe,...a].find(r=>r.id===t)??Xe[0]}function Me(){return"n_"+Math.random().toString(36).slice(2,10)+Date.now().toString(36).slice(-4)}function Te(t){return JSON.parse(JSON.stringify(t))}function Z(t,a){if(t.id===a)return t;for(const n of t.children){const r=Z(n,a);if(r)return r}return null}function we(t,a,n=null){if(t.id===a)return n;for(const r of t.children){const l=we(r,a,t);if(l!==null)return l}return null}function Ot(t,a){const n=t.children.findIndex(r=>r.id===a);if(n>=0)return t.children.splice(n,1),!0;for(const r of t.children)if(Ot(r,a))return!0;return!1}function Yi(t,a,n){const r=Z(t,a);return!r||r.text===n?!1:(r.text=n,!0)}function Zi(t,a,n,r){if(!we(t,a)||a===n||Z(Z(t,a),n))return!1;const l=we(t,a),u=l.children.findIndex(m=>m.id===a);if(u<0)return!1;const[s]=l.children.splice(u,1);if(r==="child"){const m=Z(t,n);return m?(m.children.push(s),!0):(l.children.splice(u,0,s),!1)}const c=we(t,n);if(!c)return l.children.splice(u,0,s),!1;let d=c.children.findIndex(m=>m.id===n);return d<0?(l.children.splice(u,0,s),!1):(r==="after"&&(d+=1),c.children.splice(d,0,s),!0)}function ln(t){const a=/^新节点(?:\s+(\d+))?$/;let n=0,r=!1;for(const l of t.children){const u=l.text.match(a);if(u)if(u[1]){const s=parseInt(u[1],10);s>n&&(n=s)}else r=!0}return n===0&&!r?ft:n>0?`新节点 ${n+1}`:"新节点 2"}function sn(t,a,n){const r=Z(t,a);if(!r)return null;const l={id:Me(),text:n??ln(r),children:[]};return r.children.push(l),l}function cn(t,a,n){const r=we(t,a);if(!r)return null;const l=r.children.findIndex(s=>s.id===a);if(l<0)return null;const u={id:Me(),text:n??ln(r),children:[]};return r.children.splice(l+1,0,u),u}function Xi(t,a,n){const r=we(t,a);if(!r)return null;const l=r.children.findIndex(s=>s.id===a);if(l<0)return null;const u={id:Me(),text:n,children:[]};return r.children.splice(l,0,u),u}function qi(t,a){const n=we(t,a);if(!n)return null;const r=n.children.findIndex(s=>s.id===a);if(r<0)return null;const l=n.children[r],u=Te(l);return dn(u),n.children.splice(r+1,0,u),u}function dn(t){t.id=Me();for(const a of t.children)dn(a)}const ft="新节点";function It(t,a="导入的导图"){const n=t.split(/\r?\n/),r={id:Me(),text:a,children:[]},l=[r],u=[-1/0],s=[],c=/^(#{1,6})\s+(.+?)\s*#*\s*$/,d=/^!\[([^\]]*)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,m=/^\[([^\]]+)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,x=/^(`{3,}|~{3,})\s*(\S+)?\s*$/;let E=!1,N=[],b=null;function g(y){N.push(y)}function V(){if(b&&N.length>0){for(;N.length>0&&N[0].trim()==="";)N.shift();for(;N.length>0&&N[N.length-1].trim()==="";)N.pop();const y=N.join(`
2
- `);y&&(b.note={text:y})}E=!1,N=[]}for(const y of n){if(E){const I=y.match(x);if(I&&I[1][0]==="`"){V();continue}g(y);continue}const L=y.match(c);if(L){const I=L[1].length,Q=L[2].trim();s.push({level:I,text:Q,body:""}),b=s[s.length-1];continue}const O=y.match(x);if(O&&O[2]==="note"){E=!0,N=[];continue}const P=y.match(d);if(P&&b){const I=P[2],Q=160,te=120;b.image={src:I,naturalW:Q,naturalH:te,width:Q,height:te};continue}const z=y.match(m);if(z&&b){b.link={url:z[2]},b.text=z[1];continue}if(y.trim().length>0&&b){const I=y.trim();b.body=b.body?b.body+`
3
- `+I:I}}E&&V();function D(y){for(;l.length>1;){const z=l.length-1,I=u[z];if(I!==void 0&&I<y.level)break;l.pop(),u.pop()}const L=l[l.length-1],O=y.text,P={id:Me(),text:O,children:[]};y.image&&(P.image={...y.image}),y.link&&(P.link={url:y.link.url}),y.note&&(P.note={text:y.note.text}),y.body&&(P.note={text:y.body}),L.children.push(P),l.push(P),u.push(y.level)}for(const y of s)D(y);if(s.length>0&&s[0].level===1){const y=r.children[0];y&&(r.text=y.text,r.id=y.id,y.image&&(r.image={...y.image}),y.link&&(r.link={url:y.link.url}),y.note&&(r.note={text:y.note.text}),r.children=y.children)}return r}function mt(t,a=1){let n="#".repeat(a)+" "+(t.text||"")+`
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 Km=Object.defineProperty;var qm=(Ee,e,Ft)=>e in Ee?Km(Ee,e,{enumerable:!0,configurable:!0,writable:!0,value:Ft}):Ee[e]=Ft;var Ae=(Ee,e,Ft)=>qm(Ee,typeof e!="symbol"?e+"":e,Ft);var Xn;const Ft=["width","height","stroke-width"],qr={key:4,points:"6 9 12 15 18 9"},Yr={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",qr)):t.name==="expand"?(e.openBlock(),e.createElementBlock("polyline",Yr)):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==="settings"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:13},[n[23]||(n[23]=e.createStaticVNode('<circle cx="12" cy="12" r="3"></circle><line x1="12" y1="2.5" x2="12" y2="4.5"></line><line x1="12" y1="19.5" x2="12" y2="21.5"></line><line x1="2.5" y1="12" x2="4.5" y2="12"></line><line x1="19.5" y1="12" x2="21.5" y2="12"></line><line x1="5.6" y1="5.6" x2="7" y2="7"></line><line x1="17" y1="17" x2="18.4" y2="18.4"></line><line x1="5.6" y1="18.4" x2="7" y2="17"></line><line x1="17" y1="7" x2="18.4" y2="5.6"></line>',9))],64)):t.name==="data"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:14},[n[24]||(n[24]=e.createElementVNode("path",{d:"M9 5 C7 5 7 7 7 9 C7 11 7 12 5 12 C7 12 7 13 7 15 C7 17 7 19 9 19"},null,-1)),n[25]||(n[25]=e.createElementVNode("path",{d:"M15 5 C17 5 17 7 17 9 C17 11 17 12 19 12 C17 12 17 13 17 15 C17 17 17 19 15 19"},null,-1)),n[26]||(n[26]=e.createElementVNode("line",{x1:"10.5",y1:"12",x2:"13.5",y2:"12"},null,-1))],64)):t.name==="settings"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:15},[n[27]||(n[27]=e.createStaticVNode('<circle cx="12" cy="12" r="3"></circle><line x1="12" y1="2.5" x2="12" y2="4.5"></line><line x1="12" y1="19.5" x2="12" y2="21.5"></line><line x1="2.5" y1="12" x2="4.5" y2="12"></line><line x1="19.5" y1="12" x2="21.5" y2="12"></line><line x1="5.6" y1="5.6" x2="7" y2="7"></line><line x1="17" y1="17" x2="18.4" y2="18.4"></line><line x1="5.6" y1="18.4" x2="7" y2="17"></line><line x1="17" y1="7" x2="18.4" y2="5.6"></line>',9))],64)):t.name==="data"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:16},[n[28]||(n[28]=e.createElementVNode("path",{d:"M9 5 C7 5 7 7 7 9 C7 11 7 12 5 12 C7 12 7 13 7 15 C7 17 7 19 9 19"},null,-1)),n[29]||(n[29]=e.createElementVNode("path",{d:"M15 5 C17 5 17 7 17 9 C17 11 17 12 19 12 C17 12 17 13 17 15 C17 17 17 19 15 19"},null,-1)),n[30]||(n[30]=e.createElementVNode("line",{x1:"10.5",y1:"12",x2:"13.5",y2:"12"},null,-1))],64)):t.name==="markdown"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:17},[n[31]||(n[31]=e.createElementVNode("path",{d:"M3 17 V7 L7 13 L11 7 V17"},null,-1)),n[32]||(n[32]=e.createElementVNode("path",{d:"M14 7 V17"},null,-1)),n[33]||(n[33]=e.createElementVNode("path",{d:"M14 7 L18 12 L22 7"},null,-1)),n[34]||(n[34]=e.createElementVNode("line",{x1:"14",y1:"17",x2:"22",y2:"17"},null,-1))],64)):t.name==="txt"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:18},[n[35]||(n[35]=e.createElementVNode("rect",{x:"5",y:"3",width:"14",height:"18",rx:"1.5"},null,-1)),n[36]||(n[36]=e.createElementVNode("line",{x1:"8",y1:"8",x2:"16",y2:"8"},null,-1)),n[37]||(n[37]=e.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1)),n[38]||(n[38]=e.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):t.name==="eye"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:19},[n[39]||(n[39]=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[40]||(n[40]=e.createElementVNode("circle",{cx:"12",cy:"12",r:"3.2"},null,-1))],64)):t.name==="eye-off"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:20},[n[41]||(n[41]=e.createElementVNode("path",{d:"M3 3 L21 21"},null,-1)),n[42]||(n[42]=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[43]||(n[43]=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[44]||(n[44]=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:21},[n[45]||(n[45]=e.createElementVNode("rect",{x:"4",y:"3",width:"16",height:"18",rx:"2"},null,-1)),n[46]||(n[46]=e.createElementVNode("line",{x1:"8",y1:"8",x2:"16",y2:"8"},null,-1)),n[47]||(n[47]=e.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1)),n[48]||(n[48]=e.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):t.name==="logo"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:22},[n[49]||(n[49]=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:23},[n[50]||(n[50]=e.createElementVNode("path",{d:"M12 4 V15"},null,-1)),n[51]||(n[51]=e.createElementVNode("polyline",{points:"7 10 12 15 17 10"},null,-1)),n[52]||(n[52]=e.createElementVNode("path",{d:"M4 19 H20"},null,-1))],64)):t.name==="export"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:24},[n[53]||(n[53]=e.createElementVNode("path",{d:"M12 15 V4"},null,-1)),n[54]||(n[54]=e.createElementVNode("polyline",{points:"7 9 12 4 17 9"},null,-1)),n[55]||(n[55]=e.createElementVNode("path",{d:"M4 19 H20"},null,-1))],64)):t.name==="balance"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:25},[n[56]||(n[56]=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:26},[n[57]||(n[57]=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:27},[n[58]||(n[58]=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:28},[n[59]||(n[59]=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:29},[n[60]||(n[60]=e.createElementVNode("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"},null,-1)),n[61]||(n[61]=e.createElementVNode("circle",{cx:"9",cy:"11",r:"1.6"},null,-1)),n[62]||(n[62]=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:30},[n[63]||(n[63]=e.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"},null,-1)),n[64]||(n[64]=e.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"},null,-1))],64)):t.name==="link"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:31},[n[65]||(n[65]=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[66]||(n[66]=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:32},[n[67]||(n[67]=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[68]||(n[68]=e.createElementVNode("line",{x1:"8",y1:"10",x2:"16",y2:"10"},null,-1)),n[69]||(n[69]=e.createElementVNode("line",{x1:"8",y1:"13",x2:"16",y2:"13"},null,-1)),n[70]||(n[70]=e.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):e.createCommentVNode("",!0)],8,Ft))}}),ii="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",ri="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=[18,15,13,12],Zr=[700,600,500,400],Xr=[52,40,32,28],Jr=[120,80,60,44],Qr=[.8,.8,.8,.8],el=li.length-1;function tl(t,o){return Math.round(fo(t,o)*Qr[In(t)])}function In(t){return Math.min(el,Math.max(0,t))}function fo(t,o=14){return Math.round(li[In(t)]*o/14*10)/10}function nl(t,o=14){return Math.round(Xr[In(t)]*o/14)}const vn=60,Ut=14,rt=24;let po=null;function ol(){if(po)return po;const t=typeof document<"u"?document.createElement("canvas").getContext("2d"):null;return t?(po=t,t):{font:"",measureText:()=>({width:0})}}const ai=new Map;function il(t,o,n){const i=`${n}|${o}|${t}`,r=ai.get(i);if(r!==void 0)return r;const a=ol();a.font=`${n} ${o}px "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif`;const c=a.measureText(t).width;return ai.set(i,c),c}const rl=24,ll=400,al=8,si=16,sl=4,cl=200;function dl(t,o,n){return Math.min(n,Math.max(o,t))}function ul(t,o,n,i,r){const a=In(o),c=fo(o,n),u=Math.min(il(t.text||"",c,Zr[a]),cl),s=tl(o,n),m=Math.ceil(u+s*2),g=!!(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table"))?Math.ceil(c*1.2)+6:nl(o,n);let y=0;if(t.link&&(y+=si),t.note&&(y+=si),y>0){const h=(t.link?1:0)+(t.note?1:0);y+=sl*h}const w=m+y,k=(()=>{const h=Math.round(Jr[a]*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(h,O??240)}return h})(),b=!!(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table")),_=i==null?void 0:i[t.id],x=b?Math.max(24,_??Math.max(70,Math.ceil(c*5))):0,M=x>0?10:0;if(!t.image){const h=Math.max(k,w),O=Math.ceil(g+M+x);return{w:h,h:O}}const S=dl(t.image.width,rl,ll),A=Math.max(k,w,Math.ceil(S+s*2)),C=Math.ceil(t.image.height+al+g+M+x);return{w:A,h:C}}function ml(t,o={}){const n=o.mode??"mindmap",i=o.preservePositions===!0,r=o.baseFontSize??14,a=di(t,0,null,1,"right",r,o.richHeights,o.richWidths);return pl(a),fl(a,n,i),a.x=0,a.y=0,gl(a,i)}function fl(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((g,y)=>g+y._subtreeH,0);let s=1,m=Math.abs(i[0]._subtreeH-(u-i[0]._subtreeH)),p=0;for(let g=0;g<i.length-1;g++){p+=i[g]._subtreeH;const y=Math.abs(p-(u-p));y<m&&(m=y,s=g+1)}for(let g=0;g<s;g++)i[g]._dir="right",i[g].side=1,i[g]._dirRight=1;for(let g=s;g<i.length;g++)i[g]._dir="left",i[g].side=-1,i[g]._dirRight=-1}const r=t.children.filter(u=>u.side===1),a=t.children.filter(u=>u.side===-1),c=(u,s)=>{const m=s==="right"?1:-1;u._dir=s,u.side=m,u._dirRight=m;for(const p of u.children)c(p,s)};for(const u of r)c(u,"right");for(const u of a)c(u,"left");if(r.length>0){const u={...t,children:r};Ln(u,"right",vn,!0,n)}if(a.length>0){const u={...t,children:a};Ln(u,"left",vn,!0,n)}}else if(o==="tree"){const i=r=>{r.side=1,r._dir="right";for(const a of r.children)i(a)};for(const r of t.children)r._dir="right";Ln(t,"right",vn,!0,n),i(t)}else{for(const i of t.children)i._dir="down";ci(t,vn,n)}}function Ln(t,o,n,i,r=!1){if(t.children.length===0)return;const a=t.children.reduce((m,p,g)=>m+p._subtreeH+(g>0?Ut:0),0),c=o==="right"?1:-1,u=i?c:1;let s=t.y-u*a/2;t.children.forEach(m=>{r||(m.x=t.x+c*(t.width/2+n+m.width/2),m.y=s+u*m._subtreeH/2),m._dir=o,s+=u*(m._subtreeH+Ut),Ln(m,o,n,!1,r)})}function ci(t,o,n=!1){if(t.children.length===0)return;const i=t.children.reduce((a,c,u)=>a+c._subtreeW+(u>0?Ut*2:0),0);let r=t.x-i/2;t.children.forEach(a=>{n||(a.x=r+a._subtreeW/2,a.y=t.y+t.height/2+o+a.height/2),a._dir="down",r+=a._subtreeW+Ut*2,ci(a,o,n)})}function di(t,o,n,i,r,a,c,u){const s=ul(t,o,a,c,u),m={id:t.id,text:t.text,depth:o,x:t._x??0,y:t._y??0,width:s.w,height:s.h,fontSize:fo(o,a),isRoot:o===0,collapsed:t.collapsed,side:i,_dir:r,_dirRight:i,_subtreeH:s.h,_subtreeW:s.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 m;const p=t.children.length,g=Math.ceil(p/2);return m.children=t.children.map((y,w)=>{const k=o===0?w<g?1:-1:i;return di(y,o+1,m,k,r,a,c,u)}),m}function pl(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,a=0;for(const c of i.children)r+=c._subtreeH,a+=c._subtreeW;i.children.length>1&&(r+=Ut*(i.children.length-1),a+=Ut*2*(i.children.length-1)),i._subtreeH=Math.max(i.height,r),i._subtreeW=Math.max(i.width,a)}}function gl(t,o=!1){const n=[t];let i=1/0,r=-1/0,a=1/0,c=-1/0;for(;n.length;){const m=n.pop(),p=m.width/2,g=m.height/2;m.x-p<i&&(i=m.x-p),m.x+p>r&&(r=m.x+p),m.y-g<a&&(a=m.y-g),m.y+g>c&&(c=m.y+g),n.push(...m.children)}if(o)return{root:t,width:r-i+rt*2,height:c-a+rt*2,vbX:i-rt,vbY:a-rt,vbW:r-i+rt*2,vbH:c-a+rt*2};const u=rt-a,s=[t];for(;s.length;){const m=s.pop();m.y+=u,s.push(...m.children)}return a+=u,c+=u,{root:t,width:r-i+rt*2,height:c+rt,vbX:i-rt,vbY:0,vbW:r-i+rt*2,vbH:c+rt}}const Nt=[{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 hl(t,o=[]){return[...Nt,...o].find(i=>i.id===t)??Nt[0]}function bl(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 a;for(;(a=r.exec(t))!==null;){const c=a[0];let u=null;if(c.startsWith("#")?u=kl(c):c.startsWith("rgb")?u=yl(c):u=El[c.toLowerCase()]??null,!u)continue;const s=u.toLowerCase();if(!i.has(s)&&(i.add(s),n.push(s),n.length>=o))break}return n}function kl(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 yl(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 a=n[r];if(a.endsWith("%")){const c=parseFloat(a);if(!isFinite(c))return null;i.push(Math.round(c/100*255))}else{const c=parseInt(a,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 El={black:"#000000",white:"#ffffff",red:"#ff0000",green:"#008000",blue:"#0000ff",yellow:"#ffff00",cyan:"#00ffff",magenta:"#ff00ff",gray:"#808080",grey:"#808080",silver:"#c0c0c0",maroon:"#800000",olive:"#808000",lime:"#00ff00",aqua:"#00ffff",teal:"#008080",navy:"#000080",fuchsia:"#ff00ff",purple:"#800080",orange:"#ffa500",pink:"#ffc0cb",brown:"#a52a2a",gold:"#ffd700",coral:"#ff7f50",tomato:"#ff6347",salmon:"#fa8072",khaki:"#f0e68c",violet:"#ee82ee",indigo:"#4b0082",turquoise:"#40e0d0",chocolate:"#d2691e",crimson:"#dc143c",darkred:"#8b0000",darkblue:"#00008b",darkgreen:"#006400",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightblue:"#add8e6",lightgreen:"#90ee90",lightyellow:"#ffffe0",lightpink:"#ffb6c1",skyblue:"#87ceeb",forestgreen:"#228b22",royalblue:"#4169e1",steelblue:"#4682b4",hotpink:"#ff69b4",deeppink:"#ff1493",orangered:"#ff4500",goldenrod:"#daa520",mediumpurple:"#9370db"};function ft(){return"n_"+Math.random().toString(36).slice(2,10)+Date.now().toString(36).slice(-4)}function pt(t){return JSON.parse(JSON.stringify(t))}function pe(t,o){if(t.id===o)return t;for(const n of t.children){const i=pe(n,o);if(i)return i}return null}function ct(t,o,n=null){if(t.id===o)return n;for(const i of t.children){const r=ct(i,o,t);if(r!==null)return r}return null}function go(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(go(i,o))return!0;return!1}function xl(t,o,n){const i=pe(t,o);return!i||i.text===n?!1:(i.text=n,!0)}function wl(t,o,n,i){if(!ct(t,o)||o===n||pe(pe(t,o),n))return!1;const r=ct(t,o),a=r.children.findIndex(m=>m.id===o);if(a<0)return!1;const[c]=r.children.splice(a,1);if(i==="child"){const m=pe(t,n);return m?(m.children.push(c),!0):(r.children.splice(a,0,c),!1)}const u=ct(t,n);if(!u)return r.children.splice(a,0,c),!1;let s=u.children.findIndex(m=>m.id===n);return s<0?(r.children.splice(a,0,c),!1):(i==="after"&&(s+=1),u.children.splice(s,0,c),!0)}function ui(t){const o=/^新节点(?:\s+(\d+))?$/;let n=0,i=!1;for(const r of t.children){const a=r.text.match(o);if(a)if(a[1]){const c=parseInt(a[1],10);c>n&&(n=c)}else i=!0}return n===0&&!i?Dn:n>0?`新节点 ${n+1}`:"新节点 2"}function mi(t,o,n){const i=pe(t,o);if(!i)return null;const r={id:ft(),text:n??ui(i),children:[]};return i.children.push(r),r}function fi(t,o,n){const i=ct(t,o);if(!i)return null;const r=i.children.findIndex(c=>c.id===o);if(r<0)return null;const a={id:ft(),text:n??ui(i),children:[]};return i.children.splice(r+1,0,a),a}function Nl(t,o,n){const i=ct(t,o);if(!i)return null;const r=i.children.findIndex(c=>c.id===o);if(r<0)return null;const a={id:ft(),text:n,children:[]};return i.children.splice(r,0,a),a}function Sl(t,o){const n=ct(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],a=pt(r);return pi(a),n.children.splice(i+1,0,a),a}function pi(t){t.id=ft();for(const o of t.children)pi(o)}const Dn="新节点";function Ht(t,o="导入的导图"){const n=t.split(/\r?\n/),i={id:ft(),text:o,children:[]},r=[i],a=[-1/0],c=[],u=/^(#{1,6})\s+(.+?)\s*#*\s*$/,s=/^!\[([^\]]*)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,m=/^\[([^\]]+)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,p=/^(`{3,}|~{3,})\s*(\S+)?\s*$/;let g=!1,y=[],w=null;function k(x){y.push(x)}function b(){if(w&&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&&(w.note={text:x})}g=!1,y=[]}for(const x of n){if(g){const h=x.match(p);if(h&&h[1][0]==="`"){b();continue}k(x);continue}const M=x.match(u);if(M){const h=M[1].length,O=M[2].trim();c.push({level:h,text:O,body:""}),w=c[c.length-1];continue}const S=x.match(p);if(S&&S[2]==="note"){g=!0,y=[];continue}const A=x.match(s);if(A&&w){const h=A[2],O=160,W=120;w.image={src:h,naturalW:O,naturalH:W,width:O,height:W};continue}const C=x.match(m);if(C&&w){w.link={url:C[2]},w.text=C[1];continue}if(x.trim().length>0&&w){const h=x.trim();w.body=w.body?w.body+`
3
+ `+h:h}}g&&b();function _(x){for(;r.length>1;){const C=r.length-1,h=a[C];if(h!==void 0&&h<x.level)break;r.pop(),a.pop()}const M=r[r.length-1],S=x.text,A={id:ft(),text:S,children:[]};x.image&&(A.image={...x.image}),x.link&&(A.link={url:x.link.url}),x.note&&(A.note={text:x.note.text}),x.body&&(A.note={text:x.body}),M.children.push(A),r.push(A),a.push(x.level)}for(const x of 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 Wt(t,o=1){let n="#".repeat(o)+" "+(t.text||"")+`
4
4
  `;t.link&&(n+=`[${t.text||"link"}](${t.link.url})
5
5
  `),t.image&&(n+=`![image](${t.image.src})
6
6
  `),t.note&&(n+="```note\n"+t.note.text+"\n```\n"),t.richContent&&(n+=t.richContent.raw+`
7
- `);for(const r of t.children)n+=mt(r,a+1);return n}function ji(t){var m,x;const a=t.split(/\r?\n/),n=[];let r=0;const l=/^(#{1,6})\s+(.+?)\s*#*\s*$/,u=/^(`{3,}|~{3,})\s*(\S+)?\s*$/,s=/^\s*\|?\s*(:?-+:?\s*\|\s*)+(:?-+:?)(\s*\|)?\s*$/,c=/^(\s*)[-*+]\s+(.*)$/,d=/^(\s*)\d+\.\s+(.*)$/;for(;r<a.length;){const E=a[r],N=E.match(u);if(N){const O=N[1][0],P=N[2]||"",z=[E];for(r++;r<a.length;){const Q=a[r].match(u);if(Q&&Q[1][0]===O){z.push(a[r]),r++;break}z.push(a[r]),r++}const I=z.slice(1,-1).join(`
8
- `).trim();n.push({kind:"code",text:((m=I.split(`
9
- `)[0])==null?void 0:m.slice(0,80))||"(空代码块)",raw:z.join(`
10
- `),lang:P});continue}const b=E.match(l);if(b){n.push({kind:"heading",level:b[1].length,text:b[2].trim(),raw:E}),r++;continue}if(/^\s*\|/.test(E)){const O=[];let P=r,z=!1;for(;P<a.length&&/^\s*\|/.test(a[P]);)O.push(a[P]),s.test(a[P])&&(z=!0),P++;if(z&&O.length>=2){n.push({kind:"table",text:((x=O[0].replace(/^\s*\|/,"").replace(/\|\s*$/,"").split("|")[0])==null?void 0:x.trim())||"表格",raw:O.join(`
11
- `)}),r=P;continue}}const g=E.match(c),V=E.match(d);if(g||V){let O=r;for(;O<a.length;){const P=a[O].match(c),z=a[O].match(d);if(!(P||z))break;const I=a[O].replace(/^\s*[-*+]\s+/,"").replace(/^\s*\d+\.\s+/,"").trim();I.length>0&&n.push({kind:"list",text:I.slice(0,80)||"(列表项)",raw:a[O]}),O++}r=O;continue}if(E.trim()===""){r++;continue}const D=[E];let y=r+1;for(;y<a.length;){const O=a[y];if(O.trim()===""||l.test(O)||u.test(O)||c.test(O)||d.test(O)||/^\s*\|/.test(O))break;D.push(O),y++}const L=D.join(" ").trim();n.push({kind:"paragraph",text:L.slice(0,80)||"(空段落)",raw:D.join(`
12
- `)}),r=y}return n}function Ji(t,a="导入的导图"){const n=ji(t||""),r={id:Me(),text:a,children:[]},l=[r],u=[0];let s=!1;function c(d){if(d.kind==="heading"){const x=d.level;for(;l.length>1&&u[u.length-1]>=x;)l.pop(),u.pop();if(!s&&x===1){s=!0,r.text=d.text,u[0]=1;return}const E={id:Me(),text:d.text,children:[]};l[l.length-1].children.push(E),l.push(E),u.push(x);return}const m={id:Me(),text:d.text,children:[],richContent:{kind:d.kind,raw:d.raw,lang:d.lang}};l[l.length-1].children.push(m)}for(const d of n)c(d);return r}function Qi(t){return t.richContent?t.richContent.raw+`
13
- `:""}function eo(t){const a=t.minScale??.2,n=t.maxScale??1/0,r=t.step??1.2,l=e.ref(1),u=e.ref(0),s=e.ref(0),c=e.ref(!1),d=e.reactive({x:0,y:0,ox:0,oy:0}),m=e.ref(!1),x=e.reactive({x:0,y:0}),E=e.reactive({x:0,y:0,width:0,height:0}),N=e.ref(0);let b=null;function g(K){b=K}function V(K){K.preventDefault();const J=t.getContainer();if(!J)return;const ae=-K.deltaY*.001,B=Math.min(n,Math.max(a,l.value*(1+ae))),$=J.getBoundingClientRect(),v=K.clientX-$.left,p=K.clientY-$.top,C=(v-u.value)/l.value,_=(p-s.value)/l.value;l.value=B,u.value=v-C*B,s.value=p-_*B}function D(){l.value=Math.min(n,l.value*r)}function y(){l.value=Math.max(a,l.value/r)}function L(K){var ae;K.target.closest(".zm-node, .zm-toolbar, button, input, textarea")||(c.value=!0,d.x=K.clientX,d.y=K.clientY,d.ox=u.value,d.oy=s.value,window.addEventListener("mousemove",O),window.addEventListener("mouseup",P),(ae=K.preventDefault)==null||ae.call(K))}function O(K){c.value&&(u.value=d.ox+(K.clientX-d.x),s.value=d.oy+(K.clientY-d.y))}function P(){c.value=!1,window.removeEventListener("mousemove",O),window.removeEventListener("mouseup",P)}function z(K,J){m.value=!0,x.x=K,x.y=J,E.x=K,E.y=J,E.width=0,E.height=0,N.value++,window.addEventListener("mousemove",te),window.addEventListener("mouseup",Q)}function I(K,J){if(!m.value)return;const ae=Math.min(x.x,K),B=Math.min(x.y,J),$=Math.max(x.x,K),v=Math.max(x.y,J);E.x=ae,E.y=B,E.width=$-ae,E.height=v-B,N.value++}function Q(){m.value=!1,window.removeEventListener("mousemove",te),window.removeEventListener("mouseup",Q),b&&b()}function te(K){if(!m.value)return;const J=t.getContainer();if(!J)return;const ae=J.getBoundingClientRect(),B=(K.clientX-ae.left-u.value)/l.value,$=(K.clientY-ae.top-s.value)/l.value;I(B,$)}function le(K,J,ae,B=60){const $=t.getContainer();if(!$)return;const v=$.getBoundingClientRect(),p=(v.width-B*2)/K,C=(v.height-B*2)/J,_=Math.min(1,Math.max(.3,Math.min(p,C)));l.value=_,u.value=v.width/2,s.value=v.height/2-ae*_}return{scale:l,offsetX:u,offsetY:s,isPanning:c,onWheel:V,zoomIn:D,zoomOut:y,startPan:L,startMarquee:z,updateMarquee:I,isMarquee:m,marquee:E,marqueeVersion:N,setOnMarqueeEnd:g,resetView:le}}const to=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform);function un(t){return to?t.metaKey:t.ctrlKey}function no(t){function a(){const r=t.getSelectedId();return r||(t.defaultTargetId?t.defaultTargetId():t.getRootId())}function n(r){const l=r.target;if(l&&(l.tagName==="INPUT"||l.tagName==="TEXTAREA"||l.isContentEditable)||t.isReadonly()||t.isEditing())return;const u=t.getSelectedId(),s=a();if(s){if(un(r)&&!r.shiftKey){if(r.key==="d"||r.key==="D"){u&&u!==t.getRootId()&&(r.preventDefault(),t.onDuplicate(u));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(un(r)&&r.shiftKey&&(r.key==="Z"||r.key==="z")){r.preventDefault(),t.onRedo();return}r.key==="Tab"?(r.preventDefault(),t.onAddChild(s)):r.key==="Enter"?(r.preventDefault(),r.shiftKey?u&&u!==t.getRootId()&&t.onAddSiblingBefore(u):t.onAddSibling(s)):(r.key==="Delete"||r.key==="Backspace")&&u&&u!==t.getRootId()?(r.preventDefault(),t.onRemove(u)):r.key==="F2"&&u?(r.preventDefault(),t.onStartEdit(u)):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 io(t=100){const a=e.ref([]);let n=-1;function r(){return n>0}function l(){return n<a.value.length-1}function u(m){const x=JSON.stringify(m);for(n<a.value.length-1&&(a.value=a.value.slice(0,n+1)),a.value.push(x),n=a.value.length-1;a.value.length>t;)a.value.shift(),n--}function s(){return r()?(n--,JSON.parse(a.value[n])):null}function c(){return l()?(n++,JSON.parse(a.value[n])):null}function d(){a.value=[],n=-1}return{canUndo:r,canRedo:l,record:u,undo:s,redo:c,reset:d}}const oo=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:a}){const n=t,r=a,l=e.computed(()=>{let N=n.x+2,b=n.y+2;if(n.container){const g=n.container.getBoundingClientRect(),V=180,y=4+(3+(n.hasImage?1:0)+(n.hasLink?1:0)+(n.hasNote?1:0)+1+(n.hasCode?1:0)+1+(n.hasTable?1:0))*28;N+V>g.right&&(N=Math.max(g.left+4,n.x-V-2)),b+y>g.bottom&&(b=Math.max(g.top+4,n.y-y-2)),N<g.left+2&&(N=g.left+2),b<g.top+2&&(b=g.top+2)}return{left:N,top:b}}),u=e.computed(()=>n.hasImage),s=e.computed(()=>n.hasLink),c=e.computed(()=>n.hasNote);function d(N){const b=N.target;b&&b.closest(".zm-node-menu")||r("close")}function m(N){N.key==="Escape"&&r("close")}function x(){r("close")}window.addEventListener("mousedown",d,!0),window.addEventListener("keydown",m,!0),window.addEventListener("wheel",x,!0),window.addEventListener("scroll",x,!0),e.onBeforeUnmount(()=>{window.removeEventListener("mousedown",d,!0),window.removeEventListener("keydown",m,!0),window.removeEventListener("wheel",x,!0),window.removeEventListener("scroll",x,!0)});function E(N){N(),r("close")}return(N,b)=>(e.openBlock(),e.createElementBlock("div",{class:"zm-node-menu",style:e.normalizeStyle({left:l.value.left+"px",top:l.value.top+"px"}),onContextmenu:b[10]||(b[10]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("button",{class:"zm-node-menu-item",onClick:b[0]||(b[0]=e.withModifiers(g=>E(()=>r("pickImage")),["stop"]))},[e.createVNode(j,{name:"image",size:13}),e.createElementVNode("span",null,e.toDisplayString(u.value?"替换图片":"添加图片"),1)]),u.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-node-menu-item",onClick:b[1]||(b[1]=e.withModifiers(g=>E(()=>r("removeImage")),["stop"]))},[e.createVNode(j,{name:"x",size:13}),b[11]||(b[11]=e.createElementVNode("span",null,"移除图片",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:b[2]||(b[2]=e.withModifiers(g=>E(()=>r("setLink")),["stop"]))},[e.createVNode(j,{name:"link",size:13}),e.createElementVNode("span",null,e.toDisplayString(s.value?"编辑链接":"添加链接"),1)]),s.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-node-menu-item",onClick:b[3]||(b[3]=e.withModifiers(g=>E(()=>r("removeLink")),["stop"]))},[e.createVNode(j,{name:"x",size:13}),b[12]||(b[12]=e.createElementVNode("span",null,"移除链接",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:b[4]||(b[4]=e.withModifiers(g=>E(()=>r("addCode")),["stop"]))},[b[13]||(b[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:b[5]||(b[5]=e.withModifiers(g=>E(()=>r("removeCode")),["stop"]))},[e.createVNode(j,{name:"x",size:13}),b[14]||(b[14]=e.createElementVNode("span",null,"移除代码块",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:b[6]||(b[6]=e.withModifiers(g=>E(()=>r("addTable")),["stop"]))},[b[15]||(b[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:b[7]||(b[7]=e.withModifiers(g=>E(()=>r("removeTable")),["stop"]))},[e.createVNode(j,{name:"x",size:13}),b[16]||(b[16]=e.createElementVNode("span",null,"移除表格",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:b[8]||(b[8]=e.withModifiers(g=>E(()=>r("editNote")),["stop"]))},[e.createVNode(j,{name:"note",size:13}),e.createElementVNode("span",null,e.toDisplayString(c.value?"编辑笔记":"添加笔记"),1)]),c.value?(e.openBlock(),e.createElementBlock("button",{key:4,class:"zm-node-menu-item",onClick:b[9]||(b[9]=e.withModifiers(g=>E(()=>r("removeNote")),["stop"]))},[e.createVNode(j,{name:"x",size:13}),b[17]||(b[17]=e.createElementVNode("span",null,"移除笔记",-1))])):e.createCommentVNode("",!0)],36))}}),ro=e.defineComponent({__name:"CanvasContextMenu",props:{x:{},y:{},container:{}},emits:["openSettings","openData","openImport","close"],setup(t,{emit:a}){const n=t,r=a,l=e.computed(()=>{let D=n.x+2,y=n.y+2;if(n.container){const L=n.container.getBoundingClientRect(),O=160,P=4+3*28;D+O>L.right&&(D=Math.max(L.left+4,n.x-O-2)),y+P>L.bottom&&(y=Math.max(L.top+4,n.y-P-2)),D<L.left+2&&(D=L.left+2),y<L.top+2&&(y=L.top+2)}return{left:D,top:y}}),u=e.ref(!1),s=e.ref(null),c=e.computed(()=>{if(!s.value)return{left:"-9999px",top:"-9999px",display:"none"};const D=s.value.getBoundingClientRect(),y=window.innerWidth,L=window.innerHeight,O=176,P=4+3*28;let z=D.right;z+O>y-4&&(z=Math.max(4,D.left-O));let I=D.top-4;return I+P>L-4&&(I=Math.max(4,L-P-4)),{left:z+"px",top:I+"px",display:"block"}});let d=null,m=null;function x(){m&&(clearTimeout(m),m=null),d=setTimeout(()=>{u.value=!0},60)}function E(){d&&(clearTimeout(d),d=null),m=setTimeout(()=>{u.value=!1},120)}e.onBeforeUnmount(()=>{d&&clearTimeout(d),m&&clearTimeout(m)});function N(D){const y=D.target;y&&y.closest(".zm-canvas-menu")||r("close")}function b(D){D.key==="Escape"&&r("close")}function g(){r("close")}window.addEventListener("mousedown",N,!0),window.addEventListener("keydown",b,!0),window.addEventListener("wheel",g,!0),window.addEventListener("scroll",g,!0),e.onBeforeUnmount(()=>{window.removeEventListener("mousedown",N,!0),window.removeEventListener("keydown",b,!0),window.removeEventListener("wheel",g,!0),window.removeEventListener("scroll",g,!0)});function V(D){D(),r("close")}return(D,y)=>(e.openBlock(),e.createElementBlock("div",{class:"zm-canvas-menu",style:e.normalizeStyle({left:l.value.left+"px",top:l.value.top+"px"}),onContextmenu:y[5]||(y[5]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:y[0]||(y[0]=e.withModifiers(L=>V(()=>r("openData")),["stop"]))},[e.createVNode(j,{name:"data",size:13}),y[6]||(y[6]=e.createElementVNode("span",null,"查看数据",-1))]),e.createElementVNode("div",{ref_key:"importItemRef",ref:s,class:e.normalizeClass(["zm-canvas-menu-item zm-canvas-menu-item-has-submenu",{"is-open":u.value}]),onMouseenter:x,onMouseleave:E},[e.createVNode(j,{name:"import",size:13}),y[10]||(y[10]=e.createElementVNode("span",null,"导入",-1)),y[11]||(y[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)),u.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-canvas-submenu",style:e.normalizeStyle(c.value),onMouseenter:x,onMouseleave:E},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:y[1]||(y[1]=e.withModifiers(L=>V(()=>r("openImport","markdown")),["stop"]))},[e.createVNode(j,{name:"markdown",size:13}),y[7]||(y[7]=e.createElementVNode("span",null,"Markdown 导入",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:y[2]||(y[2]=e.withModifiers(L=>V(()=>r("openImport","json")),["stop"]))},[e.createVNode(j,{name:"data",size:13}),y[8]||(y[8]=e.createElementVNode("span",null,"JSON 文件导入",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:y[3]||(y[3]=e.withModifiers(L=>V(()=>r("openImport","txt")),["stop"]))},[e.createVNode(j,{name:"note",size:13}),y[9]||(y[9]=e.createElementVNode("span",null,"TXT 文件导入",-1))])],36)):e.createCommentVNode("",!0)],34),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:y[4]||(y[4]=e.withModifiers(L=>V(()=>r("openSettings")),["stop"]))},[e.createVNode(j,{name:"settings",size:13}),y[12]||(y[12]=e.createElementVNode("span",null,"设置",-1))])],36))}});function ao(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function fn(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(a=>{const n=t[a],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&fn(n)}),t}class mn{constructor(a){a.data===void 0&&(a.data={}),this.data=a.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function gn(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function Be(t,...a){const n=Object.create(null);for(const r in t)n[r]=t[r];return a.forEach(function(r){for(const l in r)n[l]=r[l]}),n}const lo="</span>",pn=t=>!!t.scope,so=(t,{prefix:a})=>{if(t.startsWith("language:"))return t.replace("language:","language-");if(t.includes(".")){const n=t.split(".");return[`${a}${n.shift()}`,...n.map((r,l)=>`${r}${"_".repeat(l+1)}`)].join(" ")}return`${a}${t}`};class co{constructor(a,n){this.buffer="",this.classPrefix=n.classPrefix,a.walk(this)}addText(a){this.buffer+=gn(a)}openNode(a){if(!pn(a))return;const n=so(a.scope,{prefix:this.classPrefix});this.span(n)}closeNode(a){pn(a)&&(this.buffer+=lo)}value(){return this.buffer}span(a){this.buffer+=`<span class="${a}">`}}const hn=(t={})=>{const a={children:[]};return Object.assign(a,t),a};class Lt{constructor(){this.rootNode=hn(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(a){this.top.children.push(a)}openNode(a){const n=hn({scope:a});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(a){return this.constructor._walk(a,this.rootNode)}static _walk(a,n){return typeof n=="string"?a.addText(n):n.children&&(a.openNode(n),n.children.forEach(r=>this._walk(a,r)),a.closeNode(n)),a}static _collapse(a){typeof a!="string"&&a.children&&(a.children.every(n=>typeof n=="string")?a.children=[a.children.join("")]:a.children.forEach(n=>{Lt._collapse(n)}))}}class uo extends Lt{constructor(a){super(),this.options=a}addText(a){a!==""&&this.add(a)}startScope(a){this.openNode(a)}endScope(){this.closeNode()}__addSublanguage(a,n){const r=a.root;n&&(r.scope=`language:${n}`),this.add(r)}toHTML(){return new co(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function qe(t){return t?typeof t=="string"?t:t.source:null}function bn(t){return Le("(?=",t,")")}function fo(t){return Le("(?:",t,")*")}function mo(t){return Le("(?:",t,")?")}function Le(...t){return t.map(n=>qe(n)).join("")}function go(t){const a=t[t.length-1];return typeof a=="object"&&a.constructor===Object?(t.splice(t.length-1,1),a):{}}function Dt(...t){return"("+(go(t).capture?"":"?:")+t.map(r=>qe(r)).join("|")+")"}function yn(t){return new RegExp(t.toString()+"|").exec("").length-1}function po(t,a){const n=t&&t.exec(a);return n&&n.index===0}const ho=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function zt(t,{joinWith:a}){let n=0;return t.map(r=>{n+=1;const l=n;let u=qe(r),s="";for(;u.length>0;){const c=ho.exec(u);if(!c){s+=u;break}s+=u.substring(0,c.index),u=u.substring(c.index+c[0].length),c[0][0]==="\\"&&c[1]?s+="\\"+String(Number(c[1])+l):(s+=c[0],c[0]==="("&&n++)}return s}).map(r=>`(${r})`).join(a)}const bo=/\b\B/,En="[a-zA-Z]\\w*",$t="[a-zA-Z_]\\w*",xn="\\b\\d+(\\.\\d+)?",kn="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Nn="\\b(0b[01]+)",yo="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",Eo=(t={})=>{const a=/^#![ ]*\//;return t.binary&&(t.begin=Le(a,/.*\b/,t.binary,/\b.*/)),Be({scope:"meta",begin:a,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},t)},je={begin:"\\\\[\\s\\S]",relevance:0},xo={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[je]},ko={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[je]},No={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/},gt=function(t,a,n={}){const r=Be({scope:"comment",begin:t,end:a,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=Dt("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:Le(/[ ]+/,"(",l,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},wo=gt("//","$"),_o=gt("/\\*","\\*/"),So=gt("#","$"),Mo={scope:"number",begin:xn,relevance:0},Co={scope:"number",begin:kn,relevance:0},vo={scope:"number",begin:Nn,relevance:0},To={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[je,{begin:/\[/,end:/\]/,relevance:0,contains:[je]}]},Ao={scope:"title",begin:En,relevance:0},Ro={scope:"title",begin:$t,relevance:0},Bo={begin:"\\.\\s*"+$t,relevance:0};var pt=Object.freeze({__proto__:null,APOS_STRING_MODE:xo,BACKSLASH_ESCAPE:je,BINARY_NUMBER_MODE:vo,BINARY_NUMBER_RE:Nn,COMMENT:gt,C_BLOCK_COMMENT_MODE:_o,C_LINE_COMMENT_MODE:wo,C_NUMBER_MODE:Co,C_NUMBER_RE:kn,END_SAME_AS_BEGIN:function(t){return Object.assign(t,{"on:begin":(a,n)=>{n.data._beginMatch=a[1]},"on:end":(a,n)=>{n.data._beginMatch!==a[1]&&n.ignoreMatch()}})},HASH_COMMENT_MODE:So,IDENT_RE:En,MATCH_NOTHING_RE:bo,METHOD_GUARD:Bo,NUMBER_MODE:Mo,NUMBER_RE:xn,PHRASAL_WORDS_MODE:No,QUOTE_STRING_MODE:ko,REGEXP_MODE:To,RE_STARTERS_RE:yo,SHEBANG:Eo,TITLE_MODE:Ao,UNDERSCORE_IDENT_RE:$t,UNDERSCORE_TITLE_MODE:Ro});function Oo(t,a){t.input[t.index-1]==="."&&a.ignoreMatch()}function Io(t,a){t.className!==void 0&&(t.scope=t.className,delete t.className)}function Lo(t,a){a&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=Oo,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function Do(t,a){Array.isArray(t.illegal)&&(t.illegal=Dt(...t.illegal))}function zo(t,a){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 $o(t,a){t.relevance===void 0&&(t.relevance=1)}const Vo=(t,a)=>{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=Le(n.beforeMatch,bn(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},Po=["of","and","for","in","not","or","if","then","parent","list","value"],Uo="keyword";function wn(t,a,n=Uo){const r=Object.create(null);return typeof t=="string"?l(n,t.split(" ")):Array.isArray(t)?l(n,t):Object.keys(t).forEach(function(u){Object.assign(r,wn(t[u],a,u))}),r;function l(u,s){a&&(s=s.map(c=>c.toLowerCase())),s.forEach(function(c){const d=c.split("|");r[d[0]]=[u,Ho(d[0],d[1])]})}}function Ho(t,a){return a?Number(a):Fo(t)?0:1}function Fo(t){return Po.includes(t.toLowerCase())}const _n={},De=t=>{console.error(t)},Sn=(t,...a)=>{console.log(`WARN: ${t}`,...a)},He=(t,a)=>{_n[`${t}/${a}`]||(console.log(`Deprecated as of ${t}. ${a}`),_n[`${t}/${a}`]=!0)},ht=new Error;function Mn(t,a,{key:n}){let r=0;const l=t[n],u={},s={};for(let c=1;c<=a.length;c++)s[c+r]=l[c],u[c+r]=!0,r+=yn(a[c-1]);t[n]=s,t[n]._emit=u,t[n]._multi=!0}function Wo(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw De("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),ht;if(typeof t.beginScope!="object"||t.beginScope===null)throw De("beginScope must be object"),ht;Mn(t,t.begin,{key:"beginScope"}),t.begin=zt(t.begin,{joinWith:""})}}function Ko(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw De("skip, excludeEnd, returnEnd not compatible with endScope: {}"),ht;if(typeof t.endScope!="object"||t.endScope===null)throw De("endScope must be object"),ht;Mn(t,t.end,{key:"endScope"}),t.end=zt(t.end,{joinWith:""})}}function Go(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function Yo(t){Go(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),Wo(t),Ko(t)}function Zo(t){function a(s,c){return new RegExp(qe(s),"m"+(t.case_insensitive?"i":"")+(t.unicodeRegex?"u":"")+(c?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(c,d){d.position=this.position++,this.matchIndexes[this.matchAt]=d,this.regexes.push([d,c]),this.matchAt+=yn(c)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const c=this.regexes.map(d=>d[1]);this.matcherRe=a(zt(c,{joinWith:"|"}),!0),this.lastIndex=0}exec(c){this.matcherRe.lastIndex=this.lastIndex;const d=this.matcherRe.exec(c);if(!d)return null;const m=d.findIndex((E,N)=>N>0&&E!==void 0),x=this.matchIndexes[m];return d.splice(0,m),Object.assign(d,x)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(c){if(this.multiRegexes[c])return this.multiRegexes[c];const d=new n;return this.rules.slice(c).forEach(([m,x])=>d.addRule(m,x)),d.compile(),this.multiRegexes[c]=d,d}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(c,d){this.rules.push([c,d]),d.type==="begin"&&this.count++}exec(c){const d=this.getMatcher(this.regexIndex);d.lastIndex=this.lastIndex;let m=d.exec(c);if(this.resumingScanAtSamePosition()&&!(m&&m.index===this.lastIndex)){const x=this.getMatcher(0);x.lastIndex=this.lastIndex+1,m=x.exec(c)}return m&&(this.regexIndex+=m.position+1,this.regexIndex===this.count&&this.considerAll()),m}}function l(s){const c=new r;return s.contains.forEach(d=>c.addRule(d.begin,{rule:d,type:"begin"})),s.terminatorEnd&&c.addRule(s.terminatorEnd,{type:"end"}),s.illegal&&c.addRule(s.illegal,{type:"illegal"}),c}function u(s,c){const d=s;if(s.isCompiled)return d;[Io,zo,Yo,Vo].forEach(x=>x(s,c)),t.compilerExtensions.forEach(x=>x(s,c)),s.__beforeBegin=null,[Lo,Do,$o].forEach(x=>x(s,c)),s.isCompiled=!0;let m=null;return typeof s.keywords=="object"&&s.keywords.$pattern&&(s.keywords=Object.assign({},s.keywords),m=s.keywords.$pattern,delete s.keywords.$pattern),m=m||/\w+/,s.keywords&&(s.keywords=wn(s.keywords,t.case_insensitive)),d.keywordPatternRe=a(m,!0),c&&(s.begin||(s.begin=/\B|\b/),d.beginRe=a(d.begin),!s.end&&!s.endsWithParent&&(s.end=/\B|\b/),s.end&&(d.endRe=a(d.end)),d.terminatorEnd=qe(d.end)||"",s.endsWithParent&&c.terminatorEnd&&(d.terminatorEnd+=(s.end?"|":"")+c.terminatorEnd)),s.illegal&&(d.illegalRe=a(s.illegal)),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map(function(x){return Xo(x==="self"?s:x)})),s.contains.forEach(function(x){u(x,d)}),s.starts&&u(s.starts,c),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=Be(t.classNameAliases||{}),u(t)}function Cn(t){return t?t.endsWithParent||Cn(t.starts):!1}function Xo(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(a){return Be(t,{variants:null},a)})),t.cachedVariants?t.cachedVariants:Cn(t)?Be(t,{starts:t.starts?Be(t.starts):null}):Object.isFrozen(t)?Be(t):t}var qo="11.11.1";class jo extends Error{constructor(a,n){super(a),this.name="HTMLInjectionError",this.html=n}}const Vt=gn,vn=Be,Tn=Symbol("nomatch"),Jo=7,An=function(t){const a=Object.create(null),n=Object.create(null),r=[];let l=!0;const u="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]};let c={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:uo};function d(p){return c.noHighlightRe.test(p)}function m(p){let C=p.className+" ";C+=p.parentNode?p.parentNode.className:"";const _=c.languageDetectRe.exec(C);if(_){const T=te(_[1]);return T||(Sn(u.replace("{}",_[1])),Sn("Falling back to no-highlight mode for this block.",p)),T?_[1]:"no-highlight"}return C.split(/\s+/).find(T=>d(T)||te(T))}function x(p,C,_){let T="",G="";typeof C=="object"?(T=p,_=C.ignoreIllegals,G=C.language):(He("10.7.0","highlight(lang, code, ...args) has been deprecated."),He("10.7.0",`Please use highlight(code, options) instead.
14
- https://github.com/highlightjs/highlight.js/issues/2277`),G=p,T=C),_===void 0&&(_=!0);const re={code:T,language:G};$("before:highlight",re);const ue=re.result?re.result:E(re.language,re.code,_);return ue.code=re.code,$("after:highlight",ue),ue}function E(p,C,_,T){const G=Object.create(null);function re(M,R){return M.keywords[R]}function ue(){if(!H.keywords){de.addText(ie);return}let M=0;H.keywordPatternRe.lastIndex=0;let R=H.keywordPatternRe.exec(ie),W="";for(;R;){W+=ie.substring(M,R.index);const q=ke.case_insensitive?R[0].toLowerCase():R[0],fe=re(H,q);if(fe){const[_e,tt]=fe;if(de.addText(W),W="",G[q]=(G[q]||0)+1,G[q]<=Jo&&(Ve+=tt),_e.startsWith("_"))W+=R[0];else{const nt=ke.classNameAliases[_e]||_e;xe(R[0],nt)}}else W+=R[0];M=H.keywordPatternRe.lastIndex,R=H.keywordPatternRe.exec(ie)}W+=ie.substring(M),de.addText(W)}function Ee(){if(ie==="")return;let M=null;if(typeof H.subLanguage=="string"){if(!a[H.subLanguage]){de.addText(ie);return}M=E(H.subLanguage,ie,!0,_t[H.subLanguage]),_t[H.subLanguage]=M._top}else M=b(ie,H.subLanguage.length?H.subLanguage:null);H.relevance>0&&(Ve+=M.relevance),de.__addSublanguage(M._emitter,M.language)}function ge(){H.subLanguage!=null?Ee():ue(),ie=""}function xe(M,R){M!==""&&(de.startScope(R),de.addText(M),de.endScope())}function $e(M,R){let W=1;const q=R.length-1;for(;W<=q;){if(!M._emit[W]){W++;continue}const fe=ke.classNameAliases[M[W]]||M[W],_e=R[W];fe?xe(_e,fe):(ie=_e,ue(),ie=""),W++}}function xt(M,R){return M.scope&&typeof M.scope=="string"&&de.openNode(ke.classNameAliases[M.scope]||M.scope),M.beginScope&&(M.beginScope._wrap?(xe(ie,ke.classNameAliases[M.beginScope._wrap]||M.beginScope._wrap),ie=""):M.beginScope._multi&&($e(M.beginScope,R),ie="")),H=Object.create(M,{parent:{value:H}}),H}function kt(M,R,W){let q=po(M.endRe,W);if(q){if(M["on:end"]){const fe=new mn(M);M["on:end"](R,fe),fe.isMatchIgnored&&(q=!1)}if(q){for(;M.endsParent&&M.parent;)M=M.parent;return M}}if(M.endsWithParent)return kt(M.parent,R,W)}function Ft(M){return H.matcher.regexIndex===0?(ie+=M[0],1):(et=!0,0)}function Wt(M){const R=M[0],W=M.rule,q=new mn(W),fe=[W.__beforeBegin,W["on:begin"]];for(const _e of fe)if(_e&&(_e(M,q),q.isMatchIgnored))return Ft(R);return W.skip?ie+=R:(W.excludeBegin&&(ie+=R),ge(),!W.returnBegin&&!W.excludeBegin&&(ie=R)),xt(W,M),W.returnBegin?0:R.length}function Kt(M){const R=M[0],W=C.substring(M.index),q=kt(H,M,W);if(!q)return Tn;const fe=H;H.endScope&&H.endScope._wrap?(ge(),xe(R,H.endScope._wrap)):H.endScope&&H.endScope._multi?(ge(),$e(H.endScope,M)):fe.skip?ie+=R:(fe.returnEnd||fe.excludeEnd||(ie+=R),ge(),fe.excludeEnd&&(ie=R));do H.scope&&de.closeNode(),!H.skip&&!H.subLanguage&&(Ve+=H.relevance),H=H.parent;while(H!==q.parent);return q.starts&&xt(q.starts,M),fe.returnEnd?0:R.length}function Gt(){const M=[];for(let R=H;R!==ke;R=R.parent)R.scope&&M.unshift(R.scope);M.forEach(R=>de.openNode(R))}let Ge={};function Nt(M,R){const W=R&&R[0];if(ie+=M,W==null)return ge(),0;if(Ge.type==="begin"&&R.type==="end"&&Ge.index===R.index&&W===""){if(ie+=C.slice(R.index,R.index+1),!l){const q=new Error(`0 width match regex (${p})`);throw q.languageName=p,q.badRule=Ge.rule,q}return 1}if(Ge=R,R.type==="begin")return Wt(R);if(R.type==="illegal"&&!_){const q=new Error('Illegal lexeme "'+W+'" for mode "'+(H.scope||"<unnamed>")+'"');throw q.mode=H,q}else if(R.type==="end"){const q=Kt(R);if(q!==Tn)return q}if(R.type==="illegal"&&W==="")return ie+=`
15
- `,1;if(Qe>1e5&&Qe>R.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ie+=W,W.length}const ke=te(p);if(!ke)throw De(u.replace("{}",p)),new Error('Unknown language: "'+p+'"');const wt=Zo(ke);let Je="",H=T||wt;const _t={},de=new c.__emitter(c);Gt();let ie="",Ve=0,he=0,Qe=0,et=!1;try{if(ke.__emitTokens)ke.__emitTokens(C,de);else{for(H.matcher.considerAll();;){Qe++,et?et=!1:H.matcher.considerAll(),H.matcher.lastIndex=he;const M=H.matcher.exec(C);if(!M)break;const R=C.substring(he,M.index),W=Nt(R,M);he=M.index+W}Nt(C.substring(he))}return de.finalize(),Je=de.toHTML(),{language:p,value:Je,relevance:Ve,illegal:!1,_emitter:de,_top:H}}catch(M){if(M.message&&M.message.includes("Illegal"))return{language:p,value:Vt(C),illegal:!0,relevance:0,_illegalBy:{message:M.message,index:he,context:C.slice(he-100,he+100),mode:M.mode,resultSoFar:Je},_emitter:de};if(l)return{language:p,value:Vt(C),illegal:!1,relevance:0,errorRaised:M,_emitter:de,_top:H};throw M}}function N(p){const C={value:Vt(p),illegal:!1,relevance:0,_top:s,_emitter:new c.__emitter(c)};return C._emitter.addText(p),C}function b(p,C){C=C||c.languages||Object.keys(a);const _=N(p),T=C.filter(te).filter(K).map(ge=>E(ge,p,!1));T.unshift(_);const G=T.sort((ge,xe)=>{if(ge.relevance!==xe.relevance)return xe.relevance-ge.relevance;if(ge.language&&xe.language){if(te(ge.language).supersetOf===xe.language)return 1;if(te(xe.language).supersetOf===ge.language)return-1}return 0}),[re,ue]=G,Ee=re;return Ee.secondBest=ue,Ee}function g(p,C,_){const T=C&&n[C]||_;p.classList.add("hljs"),p.classList.add(`language-${T}`)}function V(p){let C=null;const _=m(p);if(d(_))return;if($("before:highlightElement",{el:p,language:_}),p.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",p);return}if(p.children.length>0&&(c.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(p)),c.throwUnescapedHTML))throw new jo("One of your code blocks includes unescaped HTML.",p.innerHTML);C=p;const T=C.textContent,G=_?x(T,{language:_,ignoreIllegals:!0}):b(T);p.innerHTML=G.value,p.dataset.highlighted="yes",g(p,_,G.language),p.result={language:G.language,re:G.relevance,relevance:G.relevance},G.secondBest&&(p.secondBest={language:G.secondBest.language,relevance:G.secondBest.relevance}),$("after:highlightElement",{el:p,result:G,text:T})}function D(p){c=vn(c,p)}const y=()=>{P(),He("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function L(){P(),He("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let O=!1;function P(){function p(){P()}if(document.readyState==="loading"){O||window.addEventListener("DOMContentLoaded",p,!1),O=!0;return}document.querySelectorAll(c.cssSelector).forEach(V)}function z(p,C){let _=null;try{_=C(t)}catch(T){if(De("Language definition for '{}' could not be registered.".replace("{}",p)),l)De(T);else throw T;_=s}_.name||(_.name=p),a[p]=_,_.rawDefinition=C.bind(null,t),_.aliases&&le(_.aliases,{languageName:p})}function I(p){delete a[p];for(const C of Object.keys(n))n[C]===p&&delete n[C]}function Q(){return Object.keys(a)}function te(p){return p=(p||"").toLowerCase(),a[p]||a[n[p]]}function le(p,{languageName:C}){typeof p=="string"&&(p=[p]),p.forEach(_=>{n[_.toLowerCase()]=C})}function K(p){const C=te(p);return C&&!C.disableAutodetect}function J(p){p["before:highlightBlock"]&&!p["before:highlightElement"]&&(p["before:highlightElement"]=C=>{p["before:highlightBlock"](Object.assign({block:C.el},C))}),p["after:highlightBlock"]&&!p["after:highlightElement"]&&(p["after:highlightElement"]=C=>{p["after:highlightBlock"](Object.assign({block:C.el},C))})}function ae(p){J(p),r.push(p)}function B(p){const C=r.indexOf(p);C!==-1&&r.splice(C,1)}function $(p,C){const _=p;r.forEach(function(T){T[_]&&T[_](C)})}function v(p){return He("10.7.0","highlightBlock will be removed entirely in v12.0"),He("10.7.0","Please use highlightElement now."),V(p)}Object.assign(t,{highlight:x,highlightAuto:b,highlightAll:P,highlightElement:V,highlightBlock:v,configure:D,initHighlighting:y,initHighlightingOnLoad:L,registerLanguage:z,unregisterLanguage:I,listLanguages:Q,getLanguage:te,registerAliases:le,autoDetection:K,inherit:vn,addPlugin:ae,removePlugin:B}),t.debugMode=function(){l=!1},t.safeMode=function(){l=!0},t.versionString=qo,t.regex={concat:Le,lookahead:bn,either:Dt,optional:mo,anyNumberOfTimes:fo};for(const p in pt)typeof pt[p]=="object"&&fn(pt[p]);return Object.assign(t,pt),t},Fe=An({});Fe.newInstance=()=>An({});var Qo=Fe;Fe.HighlightJS=Fe,Fe.default=Fe;const Pt=ao(Qo);function Ut(t){const a=t.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:a.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const l={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},u=t.inherit(t.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),s={begin:/<<-?\s*(?=\w+)/,starts:{contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},c={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,n,l]};l.contains.push(c);const d={match:/\\"/},m={className:"string",begin:/'/,end:/'/},x={match:/\\'/},E={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,n]},N=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],b=t.SHEBANG({binary:`(${N.join("|")})`,relevance:10}),g={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},V=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],D=["true","false"],y={match:/(\/[a-z._-]+)+/},L=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],O=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],P=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],z=["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:V,literal:D,built_in:[...L,...O,"set","shopt",...P,...z]},contains:[b,t.SHEBANG(),g,E,u,s,y,c,d,m,x,n]}}const er=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_-]*/}}),tr=["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"],nr=["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"],ir=[...tr,...nr],or=["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(),rr=["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(),ar=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),lr=["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 sr(t){const a=t.regex,n=er(t),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},l="and or not only",u=/@-?\w[\w]*(-\w+)*/,s="[a-zA-Z-][a-zA-Z0-9_-]*",c=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+s,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+rr.join("|")+")"},{begin:":(:)?("+ar.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+lr.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...c,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...c,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:a.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:u},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:l,attribute:or.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...c,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+ir.join("|")+")\\b"}]}}function Rn(t){const u={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:u,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:u,illegal:/["']/}]}]}}var We="[0-9](_*[0-9])*",bt=`\\.(${We})`,yt="[0-9a-fA-F](_*[0-9a-fA-F])*",Bn={className:"number",variants:[{begin:`(\\b(${We})((${bt})|\\.)?|(${bt}))[eE][+-]?(${We})[fFdD]?\\b`},{begin:`\\b(${We})((${bt})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${bt})[fFdD]?\\b`},{begin:`\\b(${We})[fFdD]\\b`},{begin:`\\b0[xX]((${yt})\\.?|(${yt})?\\.(${yt}))[pP][+-]?(${We})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${yt})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function On(t,a,n){return n===-1?"":t.replace(a,r=>On(t,a,n-1))}function cr(t){const a=t.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=n+On("(?:<"+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"]},m={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},x={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:[a.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[x,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:[m,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,Bn,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},Bn,m]}}const In="[A-Za-z$_][0-9A-Za-z$_]*",dr=["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"],ur=["true","false","null","undefined","NaN","Infinity"],Ln=["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"],Dn=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],zn=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],fr=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],mr=[].concat(zn,Ln,Dn);function $n(t){const a=t.regex,n=(_,{after:T})=>{const G="</"+_[0].slice(1);return _.input.indexOf(G,T)!==-1},r=In,l={begin:"<>",end:"</>"},u=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(_,T)=>{const G=_[0].length+_.index,re=_.input[G];if(re==="<"||re===","){T.ignoreMatch();return}re===">"&&(n(_,{after:G})||T.ignoreMatch());let ue;const Ee=_.input.substring(G);if(ue=Ee.match(/^\s*=/)){T.ignoreMatch();return}if((ue=Ee.match(/^\s+extends\s+/))&&ue.index===0){T.ignoreMatch();return}}},c={$pattern:In,keyword:dr,literal:ur,built_in:mr,"variable.language":fr},d="[0-9](_?[0-9])*",m=`\\.(${d})`,x="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",E={className:"number",variants:[{begin:`(\\b(${x})((${m})|\\.)?|(${m}))[eE][+-]?(${d})\\b`},{begin:`\\b(${x})\\b((${m})\\b|\\.)?|(${m})\\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:c,contains:[]},b={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,N],subLanguage:"xml"}},g={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,N],subLanguage:"css"}},V={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,N],subLanguage:"graphql"}},D={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,N]},L={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]},O=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,b,g,V,D,{match:/\$\d+/},E];N.contains=O.concat({begin:/\{/,end:/\}/,keywords:c,contains:["self"].concat(O)});const P=[].concat(L,N.contains),z=P.concat([{begin:/(\s*)\(/,end:/\)/,keywords:c,contains:["self"].concat(P)}]),I={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:z},Q={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,a.concat(r,"(",a.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},te={relevance:0,match:a.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Ln,...Dn]}},le={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},K={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[I],illegal:/%/},J={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function ae(_){return a.concat("(?!",_.join("|"),")")}const B={match:a.concat(/\b/,ae([...zn,"super","import"].map(_=>`${_}\\s*\\(`)),r,a.lookahead(/\s*\(/)),className:"title.function",relevance:0},$={begin:a.concat(/\./,a.lookahead(a.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},v={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},I]},p="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",C={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,a.lookahead(p)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[I]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:c,exports:{PARAMS_CONTAINS:z,CLASS_REFERENCE:te},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),le,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,b,g,V,D,L,{match:/\$\d+/},E,te,{scope:"attr",match:r+a.lookahead(":"),relevance:0},C,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[L,t.REGEXP_MODE,{className:"function",begin:p,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:c,contains:z}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:l.begin,end:l.end},{match:u},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},K,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[I,t.inherit(t.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},$,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[I]},B,J,Q,v,{match:/\$[(.]/}]}}function gr(t){const a={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:[a,n,t.QUOTE_STRING_MODE,l,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function Vn(t){const a=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}]},u={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},s={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},c=/[A-Za-z][A-Za-z0-9+.-]*/,d={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:a.concat(/\[.+?\]\(/,c,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},m={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},x={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},E=t.inherit(m,{contains:[]}),N=t.inherit(x,{contains:[]});m.contains.push(N),x.contains.push(E);let b=[n,d];return[m,x,E,N].forEach(y=>{y.contains=y.contains.concat(b)}),b=b.concat(m,x),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:b},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:b}]}]},n,u,m,x,{className:"quote",begin:"^>\\s+",contains:b,end:"$"},l,r,d,s,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function Pn(t){const a=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"],c={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},d={className:"meta",begin:/^(>>>|\.\.\.) /},m={className:"subst",begin:/\{/,end:/\}/,keywords:c,illegal:/#/},x={begin:/\{\{/,relevance:0},E={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,x,m]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,d,x,m]},{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,x,m]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,x,m]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},N="[0-9](_?[0-9])*",b=`(\\b(${N}))?\\.(${N})|\\b(${N})\\.`,g=`\\b|${r.join("|")}`,V={className:"number",relevance:0,variants:[{begin:`(\\b(${N})|(${b}))[eE][+-]?(${N})[jJ]?(?=${g})`},{begin:`(${b})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${g})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${g})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${g})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${g})`},{begin:`\\b(${N})[jJ](?=${g})`}]},D={className:"comment",begin:a.lookahead(/# type:/),end:/$/,keywords:c,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},y={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:["self",d,V,E,t.HASH_COMMENT_MODE]}]};return m.contains=[E,V,d],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:c,illegal:/(<\/|\?)|=>/,contains:[d,V,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},E,D,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[y]},{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:[V,y,E]}]}}function Un(t){const a=t.regex,n=/(r#)?/,r=a.concat(n,t.UNDERSCORE_IDENT_RE),l=a.concat(n,t.IDENT_RE),u={className:"title.function.invoke",relevance:0,begin:a.concat(/\b/,/(?!let|for|while|if|else|match\b)/,l,a.lookahead(/\s*\(/))},s="([ui](8|16|32|64|128|size)|f(32|64))?",c=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],d=["true","false","Some","None","Ok","Err"],m=["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!"],x=["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:x,keyword:c,literal:d,built_in:m},illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.COMMENT("/\\*","\\*/",{contains:["self"]}),t.inherit(t.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+s},{begin:"\\b0o([0-7_]+)"+s},{begin:"\\b0x([A-Fa-f0-9_]+)"+s},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+s}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,r,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:t.IDENT_RE+"::",keywords:{keyword:"Self",built_in:m,type:x}},{className:"punctuation",begin:"->"},u]}}function pr(t){const a=t.regex,n=t.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},l={begin:/"/,end:/"/,contains:[{match:/""/}]},u=["true","false","unknown"],s=["double precision","large object","with timezone","without timezone"],c=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],d=["add","asc","collation","desc","final","first","last","view"],m=["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"],x=["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"],E=["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=x,g=[...m,...d].filter(z=>!x.includes(z)),V={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},D={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},y={match:a.concat(/\b/,a.either(...b),/\s*\(/),relevance:0,keywords:{built_in:b}};function L(z){return a.concat(/\b/,a.either(...z.map(I=>I.replace(/\s+/,"\\s+"))),/\b/)}const O={scope:"keyword",match:L(N),relevance:0};function P(z,{exceptions:I,when:Q}={}){const te=Q;return I=I||[],z.map(le=>le.match(/\|\d+$/)||I.includes(le)?le:te(le)?`${le}|0`:le)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:P(g,{when:z=>z.length<3}),literal:u,type:c,built_in:E},contains:[{scope:"type",match:L(s)},O,y,V,r,l,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,n,D]}}const Et="[A-Za-z$_][0-9A-Za-z$_]*",Hn=["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"],Fn=["true","false","null","undefined","NaN","Infinity"],Wn=["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"],Kn=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Gn=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Yn=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Zn=[].concat(Gn,Wn,Kn);function hr(t){const a=t.regex,n=(_,{after:T})=>{const G="</"+_[0].slice(1);return _.input.indexOf(G,T)!==-1},r=Et,l={begin:"<>",end:"</>"},u=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(_,T)=>{const G=_[0].length+_.index,re=_.input[G];if(re==="<"||re===","){T.ignoreMatch();return}re===">"&&(n(_,{after:G})||T.ignoreMatch());let ue;const Ee=_.input.substring(G);if(ue=Ee.match(/^\s*=/)){T.ignoreMatch();return}if((ue=Ee.match(/^\s+extends\s+/))&&ue.index===0){T.ignoreMatch();return}}},c={$pattern:Et,keyword:Hn,literal:Fn,built_in:Zn,"variable.language":Yn},d="[0-9](_?[0-9])*",m=`\\.(${d})`,x="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",E={className:"number",variants:[{begin:`(\\b(${x})((${m})|\\.)?|(${m}))[eE][+-]?(${d})\\b`},{begin:`\\b(${x})\\b((${m})\\b|\\.)?|(${m})\\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:c,contains:[]},b={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,N],subLanguage:"xml"}},g={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,N],subLanguage:"css"}},V={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,N],subLanguage:"graphql"}},D={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,N]},L={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]},O=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,b,g,V,D,{match:/\$\d+/},E];N.contains=O.concat({begin:/\{/,end:/\}/,keywords:c,contains:["self"].concat(O)});const P=[].concat(L,N.contains),z=P.concat([{begin:/(\s*)\(/,end:/\)/,keywords:c,contains:["self"].concat(P)}]),I={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:z},Q={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,a.concat(r,"(",a.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},te={relevance:0,match:a.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Wn,...Kn]}},le={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},K={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[I],illegal:/%/},J={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function ae(_){return a.concat("(?!",_.join("|"),")")}const B={match:a.concat(/\b/,ae([...Gn,"super","import"].map(_=>`${_}\\s*\\(`)),r,a.lookahead(/\s*\(/)),className:"title.function",relevance:0},$={begin:a.concat(/\./,a.lookahead(a.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},v={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},I]},p="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",C={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,a.lookahead(p)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[I]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:c,exports:{PARAMS_CONTAINS:z,CLASS_REFERENCE:te},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),le,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,b,g,V,D,L,{match:/\$\d+/},E,te,{scope:"attr",match:r+a.lookahead(":"),relevance:0},C,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[L,t.REGEXP_MODE,{className:"function",begin:p,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:c,contains:z}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:l.begin,end:l.end},{match:u},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},K,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[I,t.inherit(t.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},$,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[I]},B,J,Q,v,{match:/\$[(.]/}]}}function Xn(t){const a=t.regex,n=hr(t),r=Et,l=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],u={begin:[/namespace/,/\s+/,t.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},s={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:l},contains:[n.exports.CLASS_REFERENCE]},c={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},d=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],m={$pattern:Et,keyword:Hn.concat(d),literal:Fn,built_in:Zn.concat(l),"variable.language":Yn},x={className:"meta",begin:"@"+r},E=(V,D,y)=>{const L=V.contains.findIndex(O=>O.label===D);if(L===-1)throw new Error("can not find mode to replace");V.contains.splice(L,1,y)};Object.assign(n.keywords,m),n.exports.PARAMS_CONTAINS.push(x);const N=n.contains.find(V=>V.scope==="attr"),b=Object.assign({},N,{match:a.concat(r,a.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,N,b]),n.contains=n.contains.concat([x,u,s,b]),E(n,"shebang",t.SHEBANG()),E(n,"use_strict",c);const g=n.contains.find(V=>V.label==="func.def");return g.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function qn(t){const a=t.regex,n=a.concat(/[\p{L}_]/u,a.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,l={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},u={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},s=t.inherit(u,{begin:/\(/,end:/\)/}),c=t.inherit(t.APOS_STRING_MODE,{className:"string"}),d=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),m={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:[u,d,c,s,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[u,s,d,c]}]}]},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:[m],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[m],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:a.concat(/</,a.lookahead(a.concat(n,a.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:m}]},{className:"tag",begin:a.concat(/<\//,a.lookahead(a.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function jn(t){const a="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:/\}/}]},u={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},s={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,l]},c=t.inherit(s,{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"},b={end:",",endsWithParent:!0,excludeEnd:!0,keywords:a,relevance:0},g={begin:/\{/,end:/\}/,contains:[b],illegal:"\\n",relevance:0},V={begin:"\\[",end:"\\]",contains:[b],illegal:"\\n",relevance:0},D=[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:a,keywords:{literal:a}},N,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},g,V,u,s],y=[...D];return y.pop(),y.push(c),b.contains=y,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:D}}const Ht={bash:Ut,sh:Ut,shell:Ut,css:sr,go:Rn,golang:Rn,java:cr,javascript:$n,js:$n,json:gr,markdown:Vn,md:Vn,python:Pn,py:Pn,rust:Un,rs:Un,sql:pr,typescript:Xn,ts:Xn,xml:qn,html:qn,yaml:jn,yml:jn};for(const[t,a]of Object.entries(Ht))Pt.registerLanguage(t,a);function Jn(t){const a=t.split(`
16
- `);return/^(`{3,}|~{3,})/.test(a[0]??"")&&a.shift(),/^(`{3,}|~{3,})\s*$/.test(a[a.length-1]??"")&&a.pop(),a.join(`
17
- `).replace(/\n+$/,"")}function Qn(t){const a=/^(`{3,}|~{3,})([^\s`~]*)/.exec(t.split(`
18
- `)[0]??""),n=((a==null?void 0:a[2])??"").toLowerCase();return n&&Ht[n]?n:""}function br(t,a){const n=a&&Ht[a]?a:"";try{return n?Pt.highlight(t,{language:n,ignoreIllegals:!0}).value:Pt.highlightAuto(t).value}catch{return Er(t)}}function yr(t){return t.split(`
19
- `).filter(a=>a.trim().length>0).filter(a=>!/^\s*\|?\s*(:?-+:?\s*\|\s*)+(:?-+:?)(\s*\|)?\s*$/.test(a)).map(a=>a.replace(/^\s*\|/,"").replace(/\|\s*$/,"").split("|").map(n=>n.trim()))}function Er(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function xr(t,a,n){if(t.length<=1)return t.slice();const[r,...l]=t,u=l.map(m=>m[a]??""),s=u.length>0&&u.every(m=>m.trim()!==""&&!Number.isNaN(Number(m))),c=n==="asc"?1:-1,d=l.slice().sort((m,x)=>{const E=m[a]??"",N=x[a]??"";return s?(Number(E)-Number(N))*c:E.localeCompare(N,"zh-Hans-CN",{numeric:!0})*c});return[r,...d]}const kr=["viewBox","width","height"],Nr={class:"zm-edges"},wr=["d","fill"],_r=["data-node-id","onClick","onDblclick","onContextmenu","onMouseenter","onMouseleave"],Sr=["src","width","height","alt"],Mr=["onDblclick"],Cr={key:0,class:"zm-rich-code"},vr=["innerHTML"],Tr={key:1,class:"zm-rich-table"},Ar=["onClick"],Rr={class:"zm-rich-sort-mark","aria-hidden":"true"},Br={key:2,class:"zm-text"},Or={class:"zm-text-label"},Ir=["href","title"],Lr=["title","onClick"],Dr=["title"],zr=["title","onClick"],$r=["onClick"],Vr=["onMousedown"],Pr=["onClick"],Ur=["title"],Hr={class:"zm-tb-tip zm-tb-zoom"},Fr=["src"],Wr=["src"],ze=24,Ke=400,Oe=160,ei=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"],setup(t,{expose:a,emit:n}){const r=t,l=n,u=e.ref(null),s=e.ref(null),c=e.ref(""),d=e.ref(null),m=e.ref(new Set),x=e.ref(!1),E=e.ref(null),N=e.ref(""),b=e.ref(new Map),g=e.ref(Te(r.data)),V=e.ref({}),D=e.ref({}),y=e.ref(r.markdown!==void 0);let L=!1;e.watch(()=>r.markdown,i=>{if(i===void 0){y.value=!1;return}y.value=!0;const o=It(i||"");L=!0,g.value=Te(o),d.value=null,m.value=new Set,oe(),e.nextTick(()=>{L=!1,Ae()})}),e.watch(g,()=>{y.value&&!L&&l("markdownChange",mt(g.value))},{deep:!0});const O=e.computed(()=>U.showOrderBadge===!0),P=e.ref(new Map),z=P.value;function I(i,o){const f={};o.bg&&(f.bg=o.bg),o.textColor&&(f.textColor=o.textColor),o.borderColor&&(f.borderColor=o.borderColor),o.fontWeight&&(f.fontWeight=o.fontWeight),Object.keys(f).length===0?z.delete(i):z.set(i,f),P.value=new Map(z)}function Q(i){return z.get(i)??{}}function te(i,o){const f=Z(g.value,i);f&&(f.image={src:o.src,naturalW:o.naturalW,naturalH:o.naturalH,width:J(o.width,ze,Ke),height:J(o.height,ze,Ke)},me(),oe(),l("change",g.value))}function le(i){const o=Z(g.value,i);!o||!o.image||(delete o.image,me(),oe(),l("change",g.value))}function K(i,o){const f=o.trim();if(!Z(g.value,i))return;if(!f){le(i);return}const k=new Image;k.onload=()=>{const S=Z(g.value,i);if(!S)return;const A=k.naturalWidth&&k.naturalHeight?k.naturalWidth/k.naturalHeight:1,F=J(k.naturalWidth||Oe,ze,Ke),ne=Math.round(F/A);S.image={src:f,naturalW:k.naturalWidth||F,naturalH:k.naturalHeight||ne,width:F,height:ne},me(),oe(),l("change",g.value)},k.onerror=()=>{},k.src=f}function J(i,o,f){return Math.min(f,Math.max(o,i))}function ae(i,o){const f=new FileReader;f.onload=()=>{if(typeof f.result!="string")return;const w=f.result,k=new window.Image;k.onload=()=>{const S=k.naturalWidth||Oe,A=k.naturalHeight||Oe,F=J(S,ze,Oe),ne=J(Math.round(A*F/S),ze,Ke);o({src:w,naturalW:S,naturalH:A,width:F,height:ne})},k.onerror=()=>{o({src:w,naturalW:Oe,naturalH:Oe,width:Oe,height:Oe})},k.src=w},f.readAsDataURL(i)}function B(i){const o=document.createElement("input");o.type="file",o.accept="image/*",o.style.display="none",o.onchange=()=>{var w;const f=(w=o.files)==null?void 0:w[0];f&&(ae(f,k=>te(i,k)),document.body.removeChild(o))},document.body.appendChild(o),o.click()}function $(i,o){const f=o.trim(),w=Z(g.value,i);w&&(f?w.link={url:f}:delete w.link,me(),oe(),l("change",g.value))}function v(i){$(i,"")}function p(i,o){const f=Z(g.value,i);f&&(o?f.note={text:o}:delete f.note,me(),oe(),l("change",g.value))}function C(i){p(i,"")}function _(i,o){const f=Z(g.value,i);f&&(o?f.richContent=o:delete f.richContent,me(),oe(),l("change",g.value))}const T=e.ref(null),G=e.ref(null),re=e.computed(()=>["zm-canvas-fab","zm-canvas-fab-preview",!r.hideCanvasActions&&(!r.previewMode||x.value)?"is-visible":""].filter(Boolean).join(" ")),ue=e.computed(()=>["zm-canvas-fab","zm-canvas-fab-outline",!r.hideCanvasActions&&(!r.previewMode||x.value)?"is-visible":""].filter(Boolean).join(" "));function Ee(i,o){r.previewMode||(i.preventDefault(),i.stopPropagation(),G.value=null,d.value=o.id,l("select",Z(g.value,o.id)),T.value={nodeId:o.id,x:i.clientX,y:i.clientY})}function ge(){T.value=null}function xe(i){const o=i.target;o!=null&&o.closest(".zm-toolbar, button, input, textarea, .zm-canvas-fab-preview, .zm-canvas-fab-outline")||(i.preventDefault(),T.value&&(T.value=null),G.value={x:i.clientX,y:i.clientY})}function $e(){G.value=null}function xt(){$e(),l("canvas-settings")}function kt(){$e(),l("canvas-data")}function Ft(i){$e(),l("canvas-import",i)}function Wt(){var o;const i=(o=T.value)==null?void 0:o.nodeId;i&&B(i)}function Kt(){var w,k,S;const i=(w=T.value)==null?void 0:w.nodeId;if(!i)return;const o=((S=(k=Z(g.value,i))==null?void 0:k.link)==null?void 0:S.url)??"",f=window.prompt("输入链接 URL(留空取消)",o);f!==null&&$(i,f)}function Gt(){var o;const i=(o=T.value)==null?void 0:o.nodeId;i&&v(i)}function Ge(){var o;const i=(o=T.value)==null?void 0:o.nodeId;i&&de(i)}function Nt(){var o;const i=(o=T.value)==null?void 0:o.nodeId;i&&C(i)}function ke(){var o;const i=(o=T.value)==null?void 0:o.nodeId;i&&le(i)}function wt(){var X,Ne;const i=(X=T.value)==null?void 0:X.nodeId;if(!i)return;const o=(Ne=Z(g.value,i))==null?void 0:Ne.richContent,f=(o==null?void 0:o.kind)==="code"?Jn(o.raw):"",w=(o==null?void 0:o.kind)==="code"&&o.lang||"",k=w?"```"+w+`
20
- `:"```\n",A=window.prompt("输入代码块内容(用 ```lang 包裹;留空取消)",f?k+f+(f.endsWith("```")?"":"\n```"):k+"// 你的代码"+"\n```");if(A===null)return;const F=A.trim();if(!F){_(i,null);return}const ne=/^```([^\s`]*)/.exec(F),h=ne?ne[1]:void 0;_(i,{kind:"code",raw:F,lang:h})}function Je(){var o;const i=(o=T.value)==null?void 0:o.nodeId;i&&_(i,null)}function H(){var A,F;const i=(A=T.value)==null?void 0:A.nodeId;if(!i)return;const o=(F=Z(g.value,i))==null?void 0:F.richContent,f=(o==null?void 0:o.kind)==="table"?o.raw:"",k=window.prompt("输入 markdown 表格(每行以 | 分隔;留空取消)",f||`| 列1 | 列2 | 列3 |
7
+ `);for(const i of t.children)n+=Wt(i,o+1);return n}function Tl(t){var m,p;const o=t.split(/\r?\n/),n=[];let i=0;const r=/^(#{1,6})\s+(.+?)\s*#*\s*$/,a=/^(`{3,}|~{3,})\s*(\S+)?\s*$/,c=/^\s*\|?\s*(:?-+:?\s*\|\s*)+(:?-+:?)(\s*\|)?\s*$/,u=/^(\s*)[-*+]\s+(.*)$/,s=/^(\s*)\d+\.\s+(.*)$/;for(;i<o.length;){const g=o[i],y=g.match(a);if(y){const S=y[1][0],A=y[2]||"",C=[g];for(i++;i<o.length;){const O=o[i].match(a);if(O&&O[1][0]===S){C.push(o[i]),i++;break}C.push(o[i]),i++}const h=C.slice(1,-1).join(`
8
+ `).trim();n.push({kind:"code",text:((m=h.split(`
9
+ `)[0])==null?void 0:m.slice(0,80))||"(空代码块)",raw:C.join(`
10
+ `),lang:A});continue}const w=g.match(r);if(w){n.push({kind:"heading",level:w[1].length,text:w[2].trim(),raw:g}),i++;continue}if(/^\s*\|/.test(g)){const S=[];let A=i,C=!1;for(;A<o.length&&/^\s*\|/.test(o[A]);)S.push(o[A]),c.test(o[A])&&(C=!0),A++;if(C&&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=A;continue}}const k=g.match(u),b=g.match(s);if(k||b){let S=i;for(;S<o.length;){const A=o[S].match(u),C=o[S].match(s);if(!(A||C))break;const h=o[S].replace(/^\s*[-*+]\s+/,"").replace(/^\s*\d+\.\s+/,"").trim();h.length>0&&n.push({kind:"list",text:h.slice(0,80)||"(列表项)",raw:o[S]}),S++}i=S;continue}if(g.trim()===""){i++;continue}const _=[g];let x=i+1;for(;x<o.length;){const S=o[x];if(S.trim()===""||r.test(S)||a.test(S)||u.test(S)||s.test(S)||/^\s*\|/.test(S))break;_.push(S),x++}const M=_.join(" ").trim();n.push({kind:"paragraph",text:M.slice(0,80)||"(空段落)",raw:_.join(`
12
+ `)}),i=x}return n}function Cl(t,o="导入的导图"){const n=Tl(t||""),i={id:ft(),text:o,children:[]},r=[i],a=[0];let c=!1;function u(s){if(s.kind==="heading"){const p=s.level;for(;r.length>1&&a[a.length-1]>=p;)r.pop(),a.pop();if(!c&&p===1){c=!0,i.text=s.text,a[0]=1;return}const g={id:ft(),text:s.text,children:[]};r[r.length-1].children.push(g),r.push(g),a.push(p);return}const m={id:ft(),text:s.text,children:[],richContent:{kind:s.kind,raw:s.raw,lang:s.lang}};r[r.length-1].children.push(m)}for(const s of n)u(s);return i}function _l(t){return t.richContent?t.richContent.raw+`
13
+ `:""}function Al(t){const o=t.minScale??.2,n=t.maxScale??1/0,i=t.step??1.2,r=e.ref(1),a=e.ref(0),c=e.ref(0),u=e.ref(!1),s=e.reactive({x:0,y:0,ox:0,oy:0}),m=e.ref(!1),p=e.reactive({x:0,y:0}),g=e.reactive({x:0,y:0,width:0,height:0}),y=e.ref(0);let w=null;function k(K){w=K}function b(K){K.preventDefault();const te=t.getContainer();if(!te)return;const le=-K.deltaY*.001,G=Math.min(n,Math.max(o,r.value*(1+le))),Y=te.getBoundingClientRect(),F=K.clientX-Y.left,N=K.clientY-Y.top,$=(F-a.value)/r.value,L=(N-c.value)/r.value;r.value=G,a.value=F-$*G,c.value=N-L*G}function _(){r.value=Math.min(n,r.value*i)}function x(){r.value=Math.max(o,r.value/i)}function M(K){var le;K.target.closest(".zm-node, .zm-toolbar, button, input, textarea")||(u.value=!0,s.x=K.clientX,s.y=K.clientY,s.ox=a.value,s.oy=c.value,window.addEventListener("mousemove",S),window.addEventListener("mouseup",A),(le=K.preventDefault)==null||le.call(K))}function S(K){u.value&&(a.value=s.ox+(K.clientX-s.x),c.value=s.oy+(K.clientY-s.y))}function A(){u.value=!1,window.removeEventListener("mousemove",S),window.removeEventListener("mouseup",A)}function C(K,te){m.value=!0,p.x=K,p.y=te,g.x=K,g.y=te,g.width=0,g.height=0,y.value++,window.addEventListener("mousemove",W),window.addEventListener("mouseup",O)}function h(K,te){if(!m.value)return;const le=Math.min(p.x,K),G=Math.min(p.y,te),Y=Math.max(p.x,K),F=Math.max(p.y,te);g.x=le,g.y=G,g.width=Y-le,g.height=F-G,y.value++}function O(){m.value=!1,window.removeEventListener("mousemove",W),window.removeEventListener("mouseup",O),w&&w()}function W(K){if(!m.value)return;const te=t.getContainer();if(!te)return;const le=te.getBoundingClientRect(),G=(K.clientX-le.left-a.value)/r.value,Y=(K.clientY-le.top-c.value)/r.value;h(G,Y)}function oe(K,te,le,G=60){const Y=t.getContainer();if(!Y)return;const F=Y.getBoundingClientRect(),N=(F.width-G*2)/K,$=(F.height-G*2)/te,L=Math.min(1,Math.max(.3,Math.min(N,$)));r.value=L,a.value=F.width/2,c.value=F.height/2-le*L}return{scale:r,offsetX:a,offsetY:c,isPanning:u,onWheel:b,zoomIn:_,zoomOut:x,startPan:M,startMarquee:C,updateMarquee:h,isMarquee:m,marquee:g,marqueeVersion:y,setOnMarqueeEnd:k,resetView:oe}}const Ml=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform);function gi(t){return Ml?t.metaKey:t.ctrlKey}function Rl(t){function o(){const i=t.getSelectedId();return i||(t.defaultTargetId?t.defaultTargetId():t.getRootId())}function n(i){const r=i.target;if(r&&(r.tagName==="INPUT"||r.tagName==="TEXTAREA"||r.isContentEditable)||t.isReadonly()||t.isEditing())return;const a=t.getSelectedId(),c=o();if(c){if(gi(i)&&!i.shiftKey){if(i.key==="d"||i.key==="D"){a&&a!==t.getRootId()&&(i.preventDefault(),t.onDuplicate(a));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(gi(i)&&i.shiftKey&&(i.key==="Z"||i.key==="z")){i.preventDefault(),t.onRedo();return}i.key==="Tab"?(i.preventDefault(),t.onAddChild(c)):i.key==="Enter"?(i.preventDefault(),i.shiftKey?a&&a!==t.getRootId()&&t.onAddSiblingBefore(a):t.onAddSibling(c)):(i.key==="Delete"||i.key==="Backspace")&&a&&a!==t.getRootId()?(i.preventDefault(),t.onRemove(a)):i.key==="F2"&&a?(i.preventDefault(),t.onStartEdit(a)):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 Bl(t=100){const o=e.ref([]);let n=-1;function i(){return n>0}function r(){return n<o.value.length-1}function a(m){const p=JSON.stringify(m);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 s(){o.value=[],n=-1}return{canUndo:i,canRedo:r,record:a,undo:c,redo:u,reset:s}}const zl=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,w=n.y+2;if(n.container){const k=n.container.getBoundingClientRect(),b=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+b>k.right&&(y=Math.max(k.left+4,n.x-b-2)),w+x>k.bottom&&(w=Math.max(k.top+4,n.y-x-2)),y<k.left+2&&(y=k.left+2),w<k.top+2&&(w=k.top+2)}return{left:y,top:w}}),a=e.computed(()=>n.hasImage),c=e.computed(()=>n.hasLink),u=e.computed(()=>n.hasNote);function s(y){const w=y.target;w&&w.closest(".zm-node-menu")||i("close")}function m(y){y.key==="Escape"&&i("close")}function p(){i("close")}window.addEventListener("mousedown",s,!0),window.addEventListener("keydown",m,!0),window.addEventListener("wheel",p,!0),window.addEventListener("scroll",p,!0),e.onBeforeUnmount(()=>{window.removeEventListener("mousedown",s,!0),window.removeEventListener("keydown",m,!0),window.removeEventListener("wheel",p,!0),window.removeEventListener("scroll",p,!0)});function g(y){y(),i("close")}return(y,w)=>(e.openBlock(),e.createElementBlock("div",{class:"zm-node-menu",style:e.normalizeStyle({left:r.value.left+"px",top:r.value.top+"px"}),onContextmenu:w[10]||(w[10]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("button",{class:"zm-node-menu-item",onClick:w[0]||(w[0]=e.withModifiers(k=>g(()=>i("pickImage")),["stop"]))},[e.createVNode(xe,{name:"image",size:13}),e.createElementVNode("span",null,e.toDisplayString(a.value?"替换图片":"添加图片"),1)]),a.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-node-menu-item",onClick:w[1]||(w[1]=e.withModifiers(k=>g(()=>i("removeImage")),["stop"]))},[e.createVNode(xe,{name:"x",size:13}),w[11]||(w[11]=e.createElementVNode("span",null,"移除图片",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:w[2]||(w[2]=e.withModifiers(k=>g(()=>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:w[3]||(w[3]=e.withModifiers(k=>g(()=>i("removeLink")),["stop"]))},[e.createVNode(xe,{name:"x",size:13}),w[12]||(w[12]=e.createElementVNode("span",null,"移除链接",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:w[4]||(w[4]=e.withModifiers(k=>g(()=>i("addCode")),["stop"]))},[w[13]||(w[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:w[5]||(w[5]=e.withModifiers(k=>g(()=>i("removeCode")),["stop"]))},[e.createVNode(xe,{name:"x",size:13}),w[14]||(w[14]=e.createElementVNode("span",null,"移除代码块",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:w[6]||(w[6]=e.withModifiers(k=>g(()=>i("addTable")),["stop"]))},[w[15]||(w[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:w[7]||(w[7]=e.withModifiers(k=>g(()=>i("removeTable")),["stop"]))},[e.createVNode(xe,{name:"x",size:13}),w[16]||(w[16]=e.createElementVNode("span",null,"移除表格",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:w[8]||(w[8]=e.withModifiers(k=>g(()=>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:w[9]||(w[9]=e.withModifiers(k=>g(()=>i("removeNote")),["stop"]))},[e.createVNode(xe,{name:"x",size:13}),w[17]||(w[17]=e.createElementVNode("span",null,"移除笔记",-1))])):e.createCommentVNode("",!0)],36))}}),Ol=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 _=n.x+2,x=n.y+2;if(n.container){const M=n.container.getBoundingClientRect(),S=160,A=4+3*28;_+S>M.right&&(_=Math.max(M.left+4,n.x-S-2)),x+A>M.bottom&&(x=Math.max(M.top+4,n.y-A-2)),_<M.left+2&&(_=M.left+2),x<M.top+2&&(x=M.top+2)}return{left:_,top:x}}),a=e.ref(!1),c=e.ref(null),u=e.computed(()=>{if(!c.value)return{left:"-9999px",top:"-9999px",display:"none"};const _=c.value.getBoundingClientRect(),x=window.innerWidth,M=window.innerHeight,S=176,A=4+3*28;let C=_.right;C+S>x-4&&(C=Math.max(4,_.left-S));let h=_.top-4;return h+A>M-4&&(h=Math.max(4,M-A-4)),{left:C+"px",top:h+"px",display:"block"}});let s=null,m=null;function p(){m&&(clearTimeout(m),m=null),s=setTimeout(()=>{a.value=!0},60)}function g(){s&&(clearTimeout(s),s=null),m=setTimeout(()=>{a.value=!1},120)}e.onBeforeUnmount(()=>{s&&clearTimeout(s),m&&clearTimeout(m)});function y(_){const x=_.target;x&&x.closest(".zm-canvas-menu")||i("close")}function w(_){_.key==="Escape"&&i("close")}function k(){i("close")}window.addEventListener("mousedown",y,!0),window.addEventListener("keydown",w,!0),window.addEventListener("wheel",k,!0),window.addEventListener("scroll",k,!0),e.onBeforeUnmount(()=>{window.removeEventListener("mousedown",y,!0),window.removeEventListener("keydown",w,!0),window.removeEventListener("wheel",k,!0),window.removeEventListener("scroll",k,!0)});function b(_){_(),i("close")}return(_,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(M=>b(()=>i("openData")),["stop"]))},[e.createVNode(xe,{name:"data",size:13}),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":a.value}]),onMouseenter:p,onMouseleave:g},[e.createVNode(xe,{name:"import",size:13}),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)),a.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-canvas-submenu",style:e.normalizeStyle(u.value),onMouseenter:p,onMouseleave:g},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[1]||(x[1]=e.withModifiers(M=>b(()=>i("openImport","markdown")),["stop"]))},[e.createVNode(xe,{name:"markdown",size:13}),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(M=>b(()=>i("openImport","json")),["stop"]))},[e.createVNode(xe,{name:"data",size:13}),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(M=>b(()=>i("openImport","txt")),["stop"]))},[e.createVNode(xe,{name:"note",size:13}),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(M=>b(()=>i("openSettings")),["stop"]))},[e.createVNode(xe,{name:"settings",size:13}),x[12]||(x[12]=e.createElementVNode("span",null,"设置",-1))])],36))}});function Il(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function hi(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)&&hi(n)}),t}class bi{constructor(o){o.data===void 0&&(o.data={}),this.data=o.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function ki(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function At(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 vl="</span>",yi=t=>!!t.scope,Ll=(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 Dl{constructor(o,n){this.buffer="",this.classPrefix=n.classPrefix,o.walk(this)}addText(o){this.buffer+=ki(o)}openNode(o){if(!yi(o))return;const n=Ll(o.scope,{prefix:this.classPrefix});this.span(n)}closeNode(o){yi(o)&&(this.buffer+=vl)}value(){return this.buffer}span(o){this.buffer+=`<span class="${o}">`}}const Ei=(t={})=>{const o={children:[]};return Object.assign(o,t),o};class ho{constructor(){this.rootNode=Ei(),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=Ei({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=>{ho._collapse(n)}))}}class Vl extends ho{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 Dl(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function hn(t){return t?typeof t=="string"?t:t.source:null}function xi(t){return Ot("(?=",t,")")}function $l(t){return Ot("(?:",t,")*")}function Pl(t){return Ot("(?:",t,")?")}function Ot(...t){return t.map(n=>hn(n)).join("")}function Fl(t){const o=t[t.length-1];return typeof o=="object"&&o.constructor===Object?(t.splice(t.length-1,1),o):{}}function bo(...t){return"("+(Fl(t).capture?"":"?:")+t.map(i=>hn(i)).join("|")+")"}function wi(t){return new RegExp(t.toString()+"|").exec("").length-1}function Ul(t,o){const n=t&&t.exec(o);return n&&n.index===0}const Hl=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function ko(t,{joinWith:o}){let n=0;return t.map(i=>{n+=1;const r=n;let a=hn(i),c="";for(;a.length>0;){const u=Hl.exec(a);if(!u){c+=a;break}c+=a.substring(0,u.index),a=a.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 Wl=/\b\B/,Ni="[a-zA-Z]\\w*",yo="[a-zA-Z_]\\w*",Si="\\b\\d+(\\.\\d+)?",Ti="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Ci="\\b(0b[01]+)",Gl="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",jl=(t={})=>{const o=/^#![ ]*\//;return t.binary&&(t.begin=Ot(o,/.*\b/,t.binary,/\b.*/)),At({scope:"meta",begin:o,end:/$/,relevance:0,"on:begin":(n,i)=>{n.index!==0&&i.ignoreMatch()}},t)},bn={begin:"\\\\[\\s\\S]",relevance:0},Kl={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[bn]},ql={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[bn]},Yl={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/},Vn=function(t,o,n={}){const i=At({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=bo("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:Ot(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),i},Zl=Vn("//","$"),Xl=Vn("/\\*","\\*/"),Jl=Vn("#","$"),Ql={scope:"number",begin:Si,relevance:0},ea={scope:"number",begin:Ti,relevance:0},ta={scope:"number",begin:Ci,relevance:0},na={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[bn,{begin:/\[/,end:/\]/,relevance:0,contains:[bn]}]},oa={scope:"title",begin:Ni,relevance:0},ia={scope:"title",begin:yo,relevance:0},ra={begin:"\\.\\s*"+yo,relevance:0};var $n=Object.freeze({__proto__:null,APOS_STRING_MODE:Kl,BACKSLASH_ESCAPE:bn,BINARY_NUMBER_MODE:ta,BINARY_NUMBER_RE:Ci,COMMENT:Vn,C_BLOCK_COMMENT_MODE:Xl,C_LINE_COMMENT_MODE:Zl,C_NUMBER_MODE:ea,C_NUMBER_RE:Ti,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:Jl,IDENT_RE:Ni,MATCH_NOTHING_RE:Wl,METHOD_GUARD:ra,NUMBER_MODE:Ql,NUMBER_RE:Si,PHRASAL_WORDS_MODE:Yl,QUOTE_STRING_MODE:ql,REGEXP_MODE:na,RE_STARTERS_RE:Gl,SHEBANG:jl,TITLE_MODE:oa,UNDERSCORE_IDENT_RE:yo,UNDERSCORE_TITLE_MODE:ia});function la(t,o){t.input[t.index-1]==="."&&o.ignoreMatch()}function aa(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=la,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function ca(t,o){Array.isArray(t.illegal)&&(t.illegal=bo(...t.illegal))}function da(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 ua(t,o){t.relevance===void 0&&(t.relevance=1)}const ma=(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=Ot(n.beforeMatch,xi(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},fa=["of","and","for","in","not","or","if","then","parent","list","value"],pa="keyword";function _i(t,o,n=pa){const i=Object.create(null);return typeof t=="string"?r(n,t.split(" ")):Array.isArray(t)?r(n,t):Object.keys(t).forEach(function(a){Object.assign(i,_i(t[a],o,a))}),i;function r(a,c){o&&(c=c.map(u=>u.toLowerCase())),c.forEach(function(u){const s=u.split("|");i[s[0]]=[a,ga(s[0],s[1])]})}}function ga(t,o){return o?Number(o):ha(t)?0:1}function ha(t){return fa.includes(t.toLowerCase())}const Ai={},It=t=>{console.error(t)},Mi=(t,...o)=>{console.log(`WARN: ${t}`,...o)},Gt=(t,o)=>{Ai[`${t}/${o}`]||(console.log(`Deprecated as of ${t}. ${o}`),Ai[`${t}/${o}`]=!0)},Pn=new Error;function Ri(t,o,{key:n}){let i=0;const r=t[n],a={},c={};for(let u=1;u<=o.length;u++)c[u+i]=r[u],a[u+i]=!0,i+=wi(o[u-1]);t[n]=c,t[n]._emit=a,t[n]._multi=!0}function ba(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw It("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Pn;if(typeof t.beginScope!="object"||t.beginScope===null)throw It("beginScope must be object"),Pn;Ri(t,t.begin,{key:"beginScope"}),t.begin=ko(t.begin,{joinWith:""})}}function ka(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw It("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Pn;if(typeof t.endScope!="object"||t.endScope===null)throw It("endScope must be object"),Pn;Ri(t,t.end,{key:"endScope"}),t.end=ko(t.end,{joinWith:""})}}function ya(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function Ea(t){ya(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),ba(t),ka(t)}function xa(t){function o(c,u){return new RegExp(hn(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,s){s.position=this.position++,this.matchIndexes[this.matchAt]=s,this.regexes.push([s,u]),this.matchAt+=wi(u)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const u=this.regexes.map(s=>s[1]);this.matcherRe=o(ko(u,{joinWith:"|"}),!0),this.lastIndex=0}exec(u){this.matcherRe.lastIndex=this.lastIndex;const s=this.matcherRe.exec(u);if(!s)return null;const m=s.findIndex((g,y)=>y>0&&g!==void 0),p=this.matchIndexes[m];return s.splice(0,m),Object.assign(s,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 s=new n;return this.rules.slice(u).forEach(([m,p])=>s.addRule(m,p)),s.compile(),this.multiRegexes[u]=s,s}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(u,s){this.rules.push([u,s]),s.type==="begin"&&this.count++}exec(u){const s=this.getMatcher(this.regexIndex);s.lastIndex=this.lastIndex;let m=s.exec(u);if(this.resumingScanAtSamePosition()&&!(m&&m.index===this.lastIndex)){const p=this.getMatcher(0);p.lastIndex=this.lastIndex+1,m=p.exec(u)}return m&&(this.regexIndex+=m.position+1,this.regexIndex===this.count&&this.considerAll()),m}}function r(c){const u=new i;return c.contains.forEach(s=>u.addRule(s.begin,{rule:s,type:"begin"})),c.terminatorEnd&&u.addRule(c.terminatorEnd,{type:"end"}),c.illegal&&u.addRule(c.illegal,{type:"illegal"}),u}function a(c,u){const s=c;if(c.isCompiled)return s;[aa,da,Ea,ma].forEach(p=>p(c,u)),t.compilerExtensions.forEach(p=>p(c,u)),c.__beforeBegin=null,[sa,ca,ua].forEach(p=>p(c,u)),c.isCompiled=!0;let m=null;return typeof c.keywords=="object"&&c.keywords.$pattern&&(c.keywords=Object.assign({},c.keywords),m=c.keywords.$pattern,delete c.keywords.$pattern),m=m||/\w+/,c.keywords&&(c.keywords=_i(c.keywords,t.case_insensitive)),s.keywordPatternRe=o(m,!0),u&&(c.begin||(c.begin=/\B|\b/),s.beginRe=o(s.begin),!c.end&&!c.endsWithParent&&(c.end=/\B|\b/),c.end&&(s.endRe=o(s.end)),s.terminatorEnd=hn(s.end)||"",c.endsWithParent&&u.terminatorEnd&&(s.terminatorEnd+=(c.end?"|":"")+u.terminatorEnd)),c.illegal&&(s.illegalRe=o(c.illegal)),c.contains||(c.contains=[]),c.contains=[].concat(...c.contains.map(function(p){return wa(p==="self"?c:p)})),c.contains.forEach(function(p){a(p,s)}),c.starts&&a(c.starts,u),s.matcher=r(s),s}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=At(t.classNameAliases||{}),a(t)}function Bi(t){return t?t.endsWithParent||Bi(t.starts):!1}function wa(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(o){return At(t,{variants:null},o)})),t.cachedVariants?t.cachedVariants:Bi(t)?At(t,{starts:t.starts?At(t.starts):null}):Object.isFrozen(t)?At(t):t}var Na="11.11.1";class Sa extends Error{constructor(o,n){super(o),this.name="HTMLInjectionError",this.html=n}}const Eo=ki,zi=At,Oi=Symbol("nomatch"),Ta=7,Ii=function(t){const o=Object.create(null),n=Object.create(null),i=[];let r=!0;const a="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:Vl};function s(N){return u.noHighlightRe.test(N)}function m(N){let $=N.className+" ";$+=N.parentNode?N.parentNode.className:"";const L=u.languageDetectRe.exec($);if(L){const j=W(L[1]);return j||(Mi(a.replace("{}",L[1])),Mi("Falling back to no-highlight mode for this block.",N)),j?L[1]:"no-highlight"}return $.split(/\s+/).find(j=>s(j)||W(j))}function p(N,$,L){let j="",X="";typeof $=="object"?(j=N,L=$.ignoreIllegals,X=$.language):(Gt("10.7.0","highlight(lang, code, ...args) has been deprecated."),Gt("10.7.0",`Please use highlight(code, options) instead.
14
+ https://github.com/highlightjs/highlight.js/issues/2277`),X=N,j=$),L===void 0&&(L=!0);const ge={code:j,language:X};Y("before:highlight",ge);const Be=ge.result?ge.result:g(ge.language,ge.code,L);return Be.code=ge.code,Y("after:highlight",Be),Be}function g(N,$,L,j){const X=Object.create(null);function ge(U,Z){return U.keywords[Z]}function Be(){if(!ee.keywords){Me.addText(ye);return}let U=0;ee.keywordPatternRe.lastIndex=0;let Z=ee.keywordPatternRe.exec(ye),se="";for(;Z;){se+=ye.substring(U,Z.index);const he=Ge.case_insensitive?Z[0].toLowerCase():Z[0],Re=ge(ee,he);if(Re){const[He,et]=Re;if(Me.addText(se),se="",X[he]=(X[he]||0)+1,X[he]<=Ta&&(kt+=et),He.startsWith("_"))se+=Z[0];else{const Pt=Ge.classNameAliases[He]||He;v(Z[0],Pt)}}else se+=Z[0];U=ee.keywordPatternRe.lastIndex,Z=ee.keywordPatternRe.exec(ye)}se+=ye.substring(U),Me.addText(se)}function Ue(){if(ye==="")return;let U=null;if(typeof ee.subLanguage=="string"){if(!o[ee.subLanguage]){Me.addText(ye);return}U=g(ee.subLanguage,ye,!0,mt[ee.subLanguage]),mt[ee.subLanguage]=U._top}else U=w(ye,ee.subLanguage.length?ee.subLanguage:null);ee.relevance>0&&(kt+=U.relevance),Me.__addSublanguage(U._emitter,U.language)}function Le(){ee.subLanguage!=null?Ue():Be(),ye=""}function v(U,Z){U!==""&&(Me.startScope(Z),Me.addText(U),Me.endScope())}function B(U,Z){let se=1;const he=Z.length-1;for(;se<=he;){if(!U._emit[se]){se++;continue}const Re=Ge.classNameAliases[U[se]]||U[se],He=Z[se];Re?v(He,Re):(ye=He,Be(),ye=""),se++}}function ie(U,Z){return U.scope&&typeof U.scope=="string"&&Me.openNode(Ge.classNameAliases[U.scope]||U.scope),U.beginScope&&(U.beginScope._wrap?(v(ye,Ge.classNameAliases[U.beginScope._wrap]||U.beginScope._wrap),ye=""):U.beginScope._multi&&(B(U.beginScope,Z),ye="")),ee=Object.create(U,{parent:{value:ee}}),ee}function ae(U,Z,se){let he=Ul(U.endRe,se);if(he){if(U["on:end"]){const Re=new bi(U);U["on:end"](Z,Re),Re.isMatchIgnored&&(he=!1)}if(he){for(;U.endsParent&&U.parent;)U=U.parent;return U}}if(U.endsWithParent)return ae(U.parent,Z,se)}function D(U){return ee.matcher.regexIndex===0?(ye+=U[0],1):(yt=!0,0)}function T(U){const Z=U[0],se=U.rule,he=new bi(se),Re=[se.__beforeBegin,se["on:begin"]];for(const He of Re)if(He&&(He(U,he),he.isMatchIgnored))return D(Z);return se.skip?ye+=Z:(se.excludeBegin&&(ye+=Z),Le(),!se.returnBegin&&!se.excludeBegin&&(ye=Z)),ie(se,U),se.returnBegin?0:Z.length}function ue(U){const Z=U[0],se=$.substring(U.index),he=ae(ee,U,se);if(!he)return Oi;const Re=ee;ee.endScope&&ee.endScope._wrap?(Le(),v(Z,ee.endScope._wrap)):ee.endScope&&ee.endScope._multi?(Le(),B(ee.endScope,U)):Re.skip?ye+=Z:(Re.returnEnd||Re.excludeEnd||(ye+=Z),Le(),Re.excludeEnd&&(ye=Z));do ee.scope&&Me.closeNode(),!ee.skip&&!ee.subLanguage&&(kt+=ee.relevance),ee=ee.parent;while(ee!==he.parent);return he.starts&&ie(he.starts,U),Re.returnEnd?0:Z.length}function me(){const U=[];for(let Z=ee;Z!==Ge;Z=Z.parent)Z.scope&&U.unshift(Z.scope);U.forEach(Z=>Me.openNode(Z))}let De={};function Ze(U,Z){const se=Z&&Z[0];if(ye+=U,se==null)return Le(),0;if(De.type==="begin"&&Z.type==="end"&&De.index===Z.index&&se===""){if(ye+=$.slice(Z.index,Z.index+1),!r){const he=new Error(`0 width match regex (${N})`);throw he.languageName=N,he.badRule=De.rule,he}return 1}if(De=Z,Z.type==="begin")return T(Z);if(Z.type==="illegal"&&!L){const he=new Error('Illegal lexeme "'+se+'" for mode "'+(ee.scope||"<unnamed>")+'"');throw he.mode=ee,he}else if(Z.type==="end"){const he=ue(Z);if(he!==Oi)return he}if(Z.type==="illegal"&&se==="")return ye+=`
15
+ `,1;if(Qe>1e5&&Qe>Z.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ye+=se,se.length}const Ge=W(N);if(!Ge)throw It(a.replace("{}",N)),new Error('Unknown language: "'+N+'"');const on=xa(Ge);let St="",ee=j||on;const mt={},Me=new u.__emitter(u);me();let ye="",kt=0,je=0,Qe=0,yt=!1;try{if(Ge.__emitTokens)Ge.__emitTokens($,Me);else{for(ee.matcher.considerAll();;){Qe++,yt?yt=!1:ee.matcher.considerAll(),ee.matcher.lastIndex=je;const U=ee.matcher.exec($);if(!U)break;const Z=$.substring(je,U.index),se=Ze(Z,U);je=U.index+se}Ze($.substring(je))}return Me.finalize(),St=Me.toHTML(),{language:N,value:St,relevance:kt,illegal:!1,_emitter:Me,_top:ee}}catch(U){if(U.message&&U.message.includes("Illegal"))return{language:N,value:Eo($),illegal:!0,relevance:0,_illegalBy:{message:U.message,index:je,context:$.slice(je-100,je+100),mode:U.mode,resultSoFar:St},_emitter:Me};if(r)return{language:N,value:Eo($),illegal:!1,relevance:0,errorRaised:U,_emitter:Me,_top:ee};throw U}}function y(N){const $={value:Eo(N),illegal:!1,relevance:0,_top:c,_emitter:new u.__emitter(u)};return $._emitter.addText(N),$}function w(N,$){$=$||u.languages||Object.keys(o);const L=y(N),j=$.filter(W).filter(K).map(Le=>g(Le,N,!1));j.unshift(L);const X=j.sort((Le,v)=>{if(Le.relevance!==v.relevance)return v.relevance-Le.relevance;if(Le.language&&v.language){if(W(Le.language).supersetOf===v.language)return 1;if(W(v.language).supersetOf===Le.language)return-1}return 0}),[ge,Be]=X,Ue=ge;return Ue.secondBest=Be,Ue}function k(N,$,L){const j=$&&n[$]||L;N.classList.add("hljs"),N.classList.add(`language-${j}`)}function b(N){let $=null;const L=m(N);if(s(L))return;if(Y("before:highlightElement",{el:N,language:L}),N.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",N);return}if(N.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(N)),u.throwUnescapedHTML))throw new Sa("One of your code blocks includes unescaped HTML.",N.innerHTML);$=N;const j=$.textContent,X=L?p(j,{language:L,ignoreIllegals:!0}):w(j);N.innerHTML=X.value,N.dataset.highlighted="yes",k(N,L,X.language),N.result={language:X.language,re:X.relevance,relevance:X.relevance},X.secondBest&&(N.secondBest={language:X.secondBest.language,relevance:X.secondBest.relevance}),Y("after:highlightElement",{el:N,result:X,text:j})}function _(N){u=zi(u,N)}const x=()=>{A(),Gt("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function M(){A(),Gt("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let S=!1;function A(){function N(){A()}if(document.readyState==="loading"){S||window.addEventListener("DOMContentLoaded",N,!1),S=!0;return}document.querySelectorAll(u.cssSelector).forEach(b)}function C(N,$){let L=null;try{L=$(t)}catch(j){if(It("Language definition for '{}' could not be registered.".replace("{}",N)),r)It(j);else throw j;L=c}L.name||(L.name=N),o[N]=L,L.rawDefinition=$.bind(null,t),L.aliases&&oe(L.aliases,{languageName:N})}function h(N){delete o[N];for(const $ of Object.keys(n))n[$]===N&&delete n[$]}function O(){return Object.keys(o)}function W(N){return N=(N||"").toLowerCase(),o[N]||o[n[N]]}function oe(N,{languageName:$}){typeof N=="string"&&(N=[N]),N.forEach(L=>{n[L.toLowerCase()]=$})}function K(N){const $=W(N);return $&&!$.disableAutodetect}function te(N){N["before:highlightBlock"]&&!N["before:highlightElement"]&&(N["before:highlightElement"]=$=>{N["before:highlightBlock"](Object.assign({block:$.el},$))}),N["after:highlightBlock"]&&!N["after:highlightElement"]&&(N["after:highlightElement"]=$=>{N["after:highlightBlock"](Object.assign({block:$.el},$))})}function le(N){te(N),i.push(N)}function G(N){const $=i.indexOf(N);$!==-1&&i.splice($,1)}function Y(N,$){const L=N;i.forEach(function(j){j[L]&&j[L]($)})}function F(N){return Gt("10.7.0","highlightBlock will be removed entirely in v12.0"),Gt("10.7.0","Please use highlightElement now."),b(N)}Object.assign(t,{highlight:p,highlightAuto:w,highlightAll:A,highlightElement:b,highlightBlock:F,configure:_,initHighlighting:x,initHighlightingOnLoad:M,registerLanguage:C,unregisterLanguage:h,listLanguages:O,getLanguage:W,registerAliases:oe,autoDetection:K,inherit:zi,addPlugin:le,removePlugin:G}),t.debugMode=function(){r=!1},t.safeMode=function(){r=!0},t.versionString=Na,t.regex={concat:Ot,lookahead:xi,either:bo,optional:Pl,anyNumberOfTimes:$l};for(const N in $n)typeof $n[N]=="object"&&hi($n[N]);return Object.assign(t,$n),t},jt=Ii({});jt.newInstance=()=>Ii({});var Ca=jt;jt.HighlightJS=jt,jt.default=jt;const xo=Il(Ca);function wo(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]},a=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 s={match:/\\"/},m={className:"string",begin:/'/,end:/'/},p={match:/\\'/},g={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,n]},y=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],w=t.SHEBANG({binary:`(${y.join("|")})`,relevance:10}),k={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},b=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],_=["true","false"],x={match:/(\/[a-z._-]+)+/},M=["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"],A=["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"],C=["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:b,literal:_,built_in:[...M,...S,"set","shopt",...A,...C]},contains:[w,t.SHEBANG(),k,g,a,c,x,u,s,m,p,n]}}const _a=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_-]*/}}),Aa=["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"],Ma=["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"],Ra=[...Aa,...Ma],Ba=["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(),za=["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(),Oa=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Ia=["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 va(t){const o=t.regex,n=_a(t),i={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},r="and or not only",a=/@-?\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:":("+za.join("|")+")"},{begin:":(:)?("+Oa.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Ia.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:a},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:r,attribute:Ba.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...u,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Ra.join("|")+")\\b"}]}}function vi(t){const a={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:a,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:a,illegal:/["']/}]}]}}var Kt="[0-9](_*[0-9])*",Fn=`\\.(${Kt})`,Un="[0-9a-fA-F](_*[0-9a-fA-F])*",Li={className:"number",variants:[{begin:`(\\b(${Kt})((${Fn})|\\.)?|(${Fn}))[eE][+-]?(${Kt})[fFdD]?\\b`},{begin:`\\b(${Kt})((${Fn})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Fn})[fFdD]?\\b`},{begin:`\\b(${Kt})[fFdD]\\b`},{begin:`\\b0[xX]((${Un})\\.?|(${Un})?\\.(${Un}))[pP][+-]?(${Kt})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Un})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Di(t,o,n){return n===-1?"":t.replace(o,i=>Di(t,o,n-1))}function La(t){const o=t.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",i=n+Di("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),s={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"]},m={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},p={className:"params",begin:/\(/,end:/\)/,keywords:s,relevance:0,contains:[t.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:s,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:s,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:s,relevance:0,contains:[m,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,Li,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},Li,m]}}const Vi="[A-Za-z$_][0-9A-Za-z$_]*",Da=["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"],Va=["true","false","null","undefined","NaN","Infinity"],$i=["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"],Pi=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Fi=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],$a=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Pa=[].concat(Fi,$i,Pi);function Ui(t){const o=t.regex,n=(L,{after:j})=>{const X="</"+L[0].slice(1);return L.input.indexOf(X,j)!==-1},i=Vi,r={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,c={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(L,j)=>{const X=L[0].length+L.index,ge=L.input[X];if(ge==="<"||ge===","){j.ignoreMatch();return}ge===">"&&(n(L,{after:X})||j.ignoreMatch());let Be;const Ue=L.input.substring(X);if(Be=Ue.match(/^\s*=/)){j.ignoreMatch();return}if((Be=Ue.match(/^\s+extends\s+/))&&Be.index===0){j.ignoreMatch();return}}},u={$pattern:Vi,keyword:Da,literal:Va,built_in:Pa,"variable.language":$a},s="[0-9](_?[0-9])*",m=`\\.(${s})`,p="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",g={className:"number",variants:[{begin:`(\\b(${p})((${m})|\\.)?|(${m}))[eE][+-]?(${s})\\b`},{begin:`\\b(${p})\\b((${m})\\b|\\.)?|(${m})\\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:[]},w={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,y],subLanguage:"xml"}},k={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,y],subLanguage:"css"}},b={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,y],subLanguage:"graphql"}},_={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,y]},M={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,w,k,b,_,{match:/\$\d+/},g];y.contains=S.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(S)});const A=[].concat(M,y.contains),C=A.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(A)}]),h={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:C},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:{_:[...$i,...Pi]}},oe={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},K={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[h],illegal:/%/},te={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function le(L){return o.concat("(?!",L.join("|"),")")}const G={match:o.concat(/\b/,le([...Fi,"super","import"].map(L=>`${L}\\s*\\(`)),i,o.lookahead(/\s*\(/)),className:"title.function",relevance:0},Y={begin:o.concat(/\./,o.lookahead(o.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},F={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},h]},N="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",$={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,o.lookahead(N)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[h]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:C,CLASS_REFERENCE:W},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),oe,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,w,k,b,_,M,{match:/\$\d+/},g,W,{scope:"attr",match:i+o.lookahead(":"),relevance:0},$,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[M,t.REGEXP_MODE,{className:"function",begin:N,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:C}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:a},{begin:c.begin,"on:begin":c.isTrulyOpeningTag,end:c.end}],subLanguage:"xml",contains:[{begin:c.begin,end:c.end,skip:!0,contains:["self"]}]}]},K,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[h,t.inherit(t.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},Y,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[h]},G,te,O,F,{match:/\$[(.]/}]}}function Fa(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 Hi(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}]},a={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+.-]*/,s={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}]},m={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}]},g=t.inherit(m,{contains:[]}),y=t.inherit(p,{contains:[]});m.contains.push(y),p.contains.push(g);let w=[n,s];return[m,p,g,y].forEach(x=>{x.contains=x.contains.concat(w)}),w=w.concat(m,p),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:w},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:w}]}]},n,a,m,p,{className:"quote",begin:"^>\\s+",contains:w,end:"$"},r,i,s,c,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function Wi(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"]},s={className:"meta",begin:/^(>>>|\.\.\.) /},m={className:"subst",begin:/\{/,end:/\}/,keywords:u,illegal:/#/},p={begin:/\{\{/,relevance:0},g={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,s],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,s],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,s,p,m]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,s,p,m]},{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,m]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,p,m]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},y="[0-9](_?[0-9])*",w=`(\\b(${y}))?\\.(${y})|\\b(${y})\\.`,k=`\\b|${i.join("|")}`,b={className:"number",relevance:0,variants:[{begin:`(\\b(${y})|(${w}))[eE][+-]?(${y})[jJ]?(?=${k})`},{begin:`(${w})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${k})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${k})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${k})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${k})`},{begin:`\\b(${y})[jJ](?=${k})`}]},_={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",s,b,g,t.HASH_COMMENT_MODE]}]};return m.contains=[g,b,s],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:u,illegal:/(<\/|\?)|=>/,contains:[s,b,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},g,_,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:[b,x,g]}]}}function Gi(t){const o=t.regex,n=/(r#)?/,i=o.concat(n,t.UNDERSCORE_IDENT_RE),r=o.concat(n,t.IDENT_RE),a={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"],s=["true","false","Some","None","Ok","Err"],m=["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:s,built_in:m},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:m,type:p}},{className:"punctuation",begin:"->"},a]}}function Ua(t){const o=t.regex,n=t.COMMENT("--","$"),i={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},r={begin:/"/,end:/"/,contains:[{match:/""/}]},a=["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"],s=["add","asc","collation","desc","final","first","last","view"],m=["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"],g=["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"],w=p,k=[...m,...s].filter(C=>!p.includes(C)),b={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},_={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},x={match:o.concat(/\b/,o.either(...w),/\s*\(/),relevance:0,keywords:{built_in:w}};function M(C){return o.concat(/\b/,o.either(...C.map(h=>h.replace(/\s+/,"\\s+"))),/\b/)}const S={scope:"keyword",match:M(y),relevance:0};function A(C,{exceptions:h,when:O}={}){const W=O;return h=h||[],C.map(oe=>oe.match(/\|\d+$/)||h.includes(oe)?oe:W(oe)?`${oe}|0`:oe)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:A(k,{when:C=>C.length<3}),literal:a,type:u,built_in:g},contains:[{scope:"type",match:M(c)},S,x,b,i,r,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,n,_]}}const Hn="[A-Za-z$_][0-9A-Za-z$_]*",ji=["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"],Ki=["true","false","null","undefined","NaN","Infinity"],qi=["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"],Yi=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Zi=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Xi=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Ji=[].concat(Zi,qi,Yi);function Ha(t){const o=t.regex,n=(L,{after:j})=>{const X="</"+L[0].slice(1);return L.input.indexOf(X,j)!==-1},i=Hn,r={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,c={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(L,j)=>{const X=L[0].length+L.index,ge=L.input[X];if(ge==="<"||ge===","){j.ignoreMatch();return}ge===">"&&(n(L,{after:X})||j.ignoreMatch());let Be;const Ue=L.input.substring(X);if(Be=Ue.match(/^\s*=/)){j.ignoreMatch();return}if((Be=Ue.match(/^\s+extends\s+/))&&Be.index===0){j.ignoreMatch();return}}},u={$pattern:Hn,keyword:ji,literal:Ki,built_in:Ji,"variable.language":Xi},s="[0-9](_?[0-9])*",m=`\\.(${s})`,p="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",g={className:"number",variants:[{begin:`(\\b(${p})((${m})|\\.)?|(${m}))[eE][+-]?(${s})\\b`},{begin:`\\b(${p})\\b((${m})\\b|\\.)?|(${m})\\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:[]},w={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,y],subLanguage:"xml"}},k={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,y],subLanguage:"css"}},b={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,y],subLanguage:"graphql"}},_={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,y]},M={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,w,k,b,_,{match:/\$\d+/},g];y.contains=S.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(S)});const A=[].concat(M,y.contains),C=A.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(A)}]),h={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:C},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:{_:[...qi,...Yi]}},oe={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},K={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[h],illegal:/%/},te={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function le(L){return o.concat("(?!",L.join("|"),")")}const G={match:o.concat(/\b/,le([...Zi,"super","import"].map(L=>`${L}\\s*\\(`)),i,o.lookahead(/\s*\(/)),className:"title.function",relevance:0},Y={begin:o.concat(/\./,o.lookahead(o.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},F={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},h]},N="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",$={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,o.lookahead(N)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[h]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:C,CLASS_REFERENCE:W},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),oe,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,w,k,b,_,M,{match:/\$\d+/},g,W,{scope:"attr",match:i+o.lookahead(":"),relevance:0},$,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[M,t.REGEXP_MODE,{className:"function",begin:N,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:C}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:a},{begin:c.begin,"on:begin":c.isTrulyOpeningTag,end:c.end}],subLanguage:"xml",contains:[{begin:c.begin,end:c.end,skip:!0,contains:["self"]}]}]},K,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[h,t.inherit(t.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},Y,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[h]},G,te,O,F,{match:/\$[(.]/}]}}function Qi(t){const o=t.regex,n=Ha(t),i=Hn,r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],a={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['"]/},s=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],m={$pattern:Hn,keyword:ji.concat(s),literal:Ki,built_in:Ji.concat(r),"variable.language":Xi},p={className:"meta",begin:"@"+i},g=(b,_,x)=>{const M=b.contains.findIndex(S=>S.label===_);if(M===-1)throw new Error("can not find mode to replace");b.contains.splice(M,1,x)};Object.assign(n.keywords,m),n.exports.PARAMS_CONTAINS.push(p);const y=n.contains.find(b=>b.scope==="attr"),w=Object.assign({},y,{match:o.concat(i,o.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,y,w]),n.contains=n.contains.concat([p,a,c,w]),g(n,"shebang",t.SHEBANG()),g(n,"use_strict",u);const k=n.contains.find(b=>b.label==="func.def");return k.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function er(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]+;/},a={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},c=t.inherit(a,{begin:/\(/,end:/\)/}),u=t.inherit(t.APOS_STRING_MODE,{className:"string"}),s=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),m={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:[a,s,u,c,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[a,c,s,u]}]}]},t.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},r,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[s]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[m],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[m],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:m}]},{className:"tag",begin:o.concat(/<\//,o.lookahead(o.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function tr(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:/\}/}]},a={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"},w={end:",",endsWithParent:!0,excludeEnd:!0,keywords:o,relevance:0},k={begin:/\{/,end:/\}/,contains:[w],illegal:"\\n",relevance:0},b={begin:"\\[",end:"\\]",contains:[w],illegal:"\\n",relevance:0},_=[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},k,b,a,c],x=[..._];return x.pop(),x.push(u),w.contains=x,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:_}}const No={bash:wo,sh:wo,shell:wo,css:va,go:vi,golang:vi,java:La,javascript:Ui,js:Ui,json:Fa,markdown:Hi,md:Hi,python:Wi,py:Wi,rust:Gi,rs:Gi,sql:Ua,typescript:Qi,ts:Qi,xml:er,html:er,yaml:tr,yml:tr};for(const[t,o]of Object.entries(No))xo.registerLanguage(t,o);function So(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 qt(t){const o=/^(`{3,}|~{3,})([^\s`~]*)/.exec(t.split(`
18
+ `)[0]??""),n=((o==null?void 0:o[2])??"").toLowerCase();return n&&No[n]?n:""}function To(t,o){const n=o&&No[o]?o:"";try{return n?xo.highlight(t,{language:n,ignoreIllegals:!0}).value:xo.highlightAuto(t).value}catch{return Wa(t)}}function nr(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 Wa(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function or(t,o,n){if(t.length<=1)return t.slice();const[i,...r]=t,a=r.map(m=>m[o]??""),c=a.length>0&&a.every(m=>m.trim()!==""&&!Number.isNaN(Number(m))),u=n==="asc"?1:-1,s=r.slice().sort((m,p)=>{const g=m[o]??"",y=p[o]??"";return c?(Number(g)-Number(y))*u:g.localeCompare(y,"zh-Hans-CN",{numeric:!0})*u});return[i,...s]}const Ga=["viewBox","width","height"],ja={class:"zm-edges"},Ka=["d","fill"],qa=["data-node-id","onClick","onDblclick","onContextmenu","onMouseenter","onMouseleave"],Ya=["src","width","height","alt"],Za=["onDblclick"],Xa={key:0,class:"zm-rich-code"},Ja=["innerHTML"],Qa={key:1,class:"zm-rich-table"},es=["onClick"],ts={class:"zm-rich-sort-mark","aria-hidden":"true"},ns={key:2,class:"zm-text"},os={class:"zm-text-label"},is=["href","title"],rs=["title","onClick"],ls=["title"],as=["title","onClick"],ss=["onClick"],cs=["onMousedown"],ds=["onClick"],us=["title"],ms={class:"zm-tb-tip zm-tb-zoom"},fs=["src"],ps=["src"],vt=24,Yt=400,Mt=160,Wn=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,a=e.ref(null),c=e.ref(null),u=e.ref(""),s=e.ref(null),m=e.ref(new Set),p=e.ref(!1),g=e.ref(null),y=e.ref(null),w=e.ref(""),k=e.ref(new Map),b=e.ref(pt(i.data)),_=e.ref({}),x=e.ref({}),M=e.ref(i.markdown!==void 0);let S=!1;e.watch(()=>i.markdown,l=>{if(l===void 0){M.value=!1;return}M.value=!0;const d=Ht(l||"");S=!0,b.value=pt(d),s.value=null,m.value=new Set,we(),e.nextTick(()=>{S=!1,Ct()})}),e.watch(b,()=>{M.value&&!S&&r("markdownChange",Wt(b.value))},{deep:!0});const A=e.computed(()=>Q.showOrderBadge===!0),C=e.ref(new Map),h=C.value;function O(l,d){const E={};d.bg&&(E.bg=d.bg),d.textColor&&(E.textColor=d.textColor),d.borderColor&&(E.borderColor=d.borderColor),d.fontWeight&&(E.fontWeight=d.fontWeight),Object.keys(E).length===0?h.delete(l):h.set(l,E),C.value=new Map(h)}function W(l){return h.get(l)??{}}function oe(l,d){const E=pe(b.value,l);E&&(E.image={src:d.src,naturalW:d.naturalW,naturalH:d.naturalH,width:le(d.width,vt,Yt),height:le(d.height,vt,Yt)},Ve(),we(),r("change",b.value))}function K(l){const d=pe(b.value,l);!d||!d.image||(delete d.image,Ve(),we(),r("change",b.value))}function te(l,d){const E=d.trim();if(!pe(b.value,l))return;if(!E){K(l);return}const I=new Image;I.onload=()=>{const P=pe(b.value,l);if(!P)return;const q=I.naturalWidth&&I.naturalHeight?I.naturalWidth/I.naturalHeight:1,re=le(I.naturalWidth||Mt,vt,Yt),Se=Math.round(re/q);P.image={src:E,naturalW:I.naturalWidth||re,naturalH:I.naturalHeight||Se,width:re,height:Se},Ve(),we(),r("change",b.value)},I.onerror=()=>{},I.src=E}function le(l,d,E){return Math.min(E,Math.max(d,l))}function G(l,d){const E=new FileReader;E.onload=()=>{if(typeof E.result!="string")return;const V=E.result,I=new window.Image;I.onload=()=>{const P=I.naturalWidth||Mt,q=I.naturalHeight||Mt,re=le(P,vt,Mt),Se=le(Math.round(q*re/P),vt,Yt);d({src:V,naturalW:P,naturalH:q,width:re,height:Se})},I.onerror=()=>{d({src:V,naturalW:Mt,naturalH:Mt,width:Mt,height:Mt})},I.src=V},E.readAsDataURL(l)}function Y(l){const d=document.createElement("input");d.type="file",d.accept="image/*",d.style.display="none",d.onchange=()=>{var V;const E=(V=d.files)==null?void 0:V[0];E&&(G(E,I=>oe(l,I)),document.body.removeChild(d))},document.body.appendChild(d),d.click()}function F(l,d){const E=d.trim(),V=pe(b.value,l);V&&(E?V.link={url:E}:delete V.link,Ve(),we(),r("change",b.value))}function N(l){F(l,"")}function $(l,d){const E=pe(b.value,l);E&&(d?E.note={text:d}:delete E.note,Ve(),we(),r("change",b.value))}function L(l){$(l,"")}function j(l,d){const E=pe(b.value,l);E&&(d?E.richContent=d:delete E.richContent,Ve(),we(),r("change",b.value))}const X=e.ref(null),ge=e.ref(null),Be=e.computed(()=>["zm-canvas-fab","zm-canvas-fab-preview",!i.hideCanvasActions&&(!i.previewMode||p.value)?"is-visible":""].filter(Boolean).join(" ")),Ue=e.computed(()=>["zm-canvas-fab","zm-canvas-fab-outline",!i.hideCanvasActions&&(!i.previewMode||p.value)?"is-visible":""].filter(Boolean).join(" "));function Le(l,d){i.previewMode||(l.preventDefault(),l.stopPropagation(),ge.value=null,s.value=d.id,r("select",pe(b.value,d.id)),X.value={nodeId:d.id,x:l.clientX,y:l.clientY})}function v(){X.value=null}function B(l){const d=l.target;d!=null&&d.closest(".zm-toolbar, button, input, textarea, .zm-canvas-fab-preview, .zm-canvas-fab-outline")||(l.preventDefault(),X.value&&(X.value=null),ge.value={x:l.clientX,y:l.clientY})}function ie(){ge.value=null}function ae(){ie(),r("canvas-settings")}function D(){ie(),r("canvas-data")}function T(l){ie(),r("canvas-import",l)}function ue(){var d;const l=(d=X.value)==null?void 0:d.nodeId;l&&Y(l)}function me(){var V,I,P;const l=(V=X.value)==null?void 0:V.nodeId;if(!l)return;const d=((P=(I=pe(b.value,l))==null?void 0:I.link)==null?void 0:P.url)??"",E=window.prompt("输入链接 URL(留空取消)",d);E!==null&&F(l,E)}function De(){var d;const l=(d=X.value)==null?void 0:d.nodeId;l&&N(l)}function Ze(){var d;const l=(d=X.value)==null?void 0:d.nodeId;l&&ye(l)}function Ge(){var d;const l=(d=X.value)==null?void 0:d.nodeId;l&&L(l)}function on(){var d;const l=(d=X.value)==null?void 0:d.nodeId;l&&K(l)}function St(){var fe,it;const l=(fe=X.value)==null?void 0:fe.nodeId;if(!l)return;const d=(it=pe(b.value,l))==null?void 0:it.richContent,E=(d==null?void 0:d.kind)==="code"?So(d.raw):"",V=(d==null?void 0:d.kind)==="code"&&d.lang||"",I=V?"```"+V+`
20
+ `:"```\n",q=window.prompt("输入代码块内容(用 ```lang 包裹;留空取消)",E?I+E+(E.endsWith("```")?"":"\n```"):I+"// 你的代码"+"\n```");if(q===null)return;const re=q.trim();if(!re){j(l,null);return}const Se=/^```([^\s`]*)/.exec(re),R=Se?Se[1]:void 0;j(l,{kind:"code",raw:re,lang:R})}function ee(){var d;const l=(d=X.value)==null?void 0:d.nodeId;l&&j(l,null)}function mt(){var q,re;const l=(q=X.value)==null?void 0:q.nodeId;if(!l)return;const d=(re=pe(b.value,l))==null?void 0:re.richContent,E=(d==null?void 0:d.kind)==="table"?d.raw:"",I=window.prompt("输入 markdown 表格(每行以 | 分隔;留空取消)",E||`| 列1 | 列2 | 列3 |
21
21
  | --- | --- | --- |
22
- | a | b | c |`);if(k===null)return;const S=k.trim();if(!S){_(i,null);return}_(i,{kind:"table",raw:S})}function _t(){var o;const i=(o=T.value)==null?void 0:o.nodeId;i&&_(i,null)}function de(i){r.previewMode||l("edit-note",i)}function ie(i,o=60){const f=i.replace(/\s+/g," ").trim();return f.length<=o?f||"点击编辑笔记":f.slice(0,o)+"…"}function Ve(i){var k;if(r.previewMode||s.value)return;const o=i.target;if(o&&(o.tagName==="INPUT"||o.tagName==="TEXTAREA"||o.isContentEditable))return;const f=d.value;if(!f)return;const w=(k=i.clipboardData)==null?void 0:k.items;if(w)for(let S=0;S<w.length;S++){const A=w[S];if(A.kind==="file"&&A.type.startsWith("image/")){const F=A.getAsFile();if(!F)continue;i.preventDefault();const ne=Z(g.value,f);if(ne!=null&&ne.image&&!window.confirm("该节点已有图片,要用剪贴板里的图片替换吗?"))return;ae(F,h=>te(f,h));return}}}e.onMounted(()=>{window.addEventListener("paste",Ve),oe()}),e.onBeforeUnmount(()=>{window.removeEventListener("paste",Ve)});const he=e.ref(null),Qe=e.computed(()=>{var i;return((i=he.value)==null?void 0:i.nodeId)??null});function et(i,o){if(!o.image)return;i.preventDefault(),i.stopPropagation();const f=o.image.naturalW||o.image.width,w=o.image.naturalH||o.image.height,k=w>0?w/f:1;he.value={nodeId:o.id,startX:i.clientX,startY:i.clientY,startW:o.image.width,startH:o.image.height,naturalW:f,naturalH:w,ratio:k,pendingW:o.image.width,pendingH:o.image.height},window.addEventListener("mousemove",M),window.addEventListener("mouseup",R)}function M(i){var ne,h;const o=he.value;if(!o)return;const f=Y.scale.value||1,w=i.clientX-o.startX,k=J(o.startW+w/f,ze,Ke),S=J(k*o.ratio,ze,Ke);o.pendingW=k,o.pendingH=S;const A=(ne=u.value)==null?void 0:ne.querySelector(`[data-node-id="${o.nodeId}"] .zm-node-img`);A&&(A.style.width=`${k}px`,A.style.height=`${S}px`);const F=(h=u.value)==null?void 0:h.querySelector(`[data-node-id="${o.nodeId}"]`);F&&(F.style.minWidth=`${Math.max(80,Math.ceil(k+28))}px`,F.style.height=`${Math.ceil(S+8+30)}px`)}function R(){const i=he.value;if(window.removeEventListener("mousemove",M),window.removeEventListener("mouseup",R),he.value=null,!i)return;const o=Z(g.value,i.nodeId);!o||!o.image||(te(i.nodeId,{src:o.image.src,naturalW:o.image.naturalW,naturalH:o.image.naturalH,width:i.pendingW,height:i.pendingH}),d.value=i.nodeId,l("select",o),q=!0)}const W=e.ref(null);let q=!1;function fe(i){W.value=i}function _e(i){W.value===i&&(W.value=null)}const tt=e.ref(0),nt=e.ref(!1),Ie=io(100);function me(){Ie.record({data:g.value})}function oe(){m.value=new Set(m.value),tt.value++,e.nextTick().then(()=>e.nextTick()).then(()=>pa()).then(()=>{tt.value++})}function pa(){const i=document.querySelectorAll(".zm-rich"),o={},f={};i.forEach(w=>{let k=w,S=null;for(;k&&!S;)S=k.getAttribute("data-node-id"),k=k.parentElement;if(!S)return;const A=w.offsetHeight,F=w.scrollWidth,ne=Math.round(A*2)/2,h=Math.round(F*2)/2;o[S]=ne,f[S]=h,V.value[S],D.value[S]}),V.value=o,D.value=f}const Se=e.computed(()=>{var i,o,f,w,k,S,A,F,ne,h;return{rootBg:((i=r.theme)==null?void 0:i.rootBg)??"#1f2937",rootText:((o=r.theme)==null?void 0:o.rootText)??"#ffffff",branchBg:((f=r.theme)==null?void 0:f.branchBg)??"#ffffff",branchText:((w=r.theme)==null?void 0:w.branchText)??"#1f2937",lineColor:((k=r.theme)==null?void 0:k.lineColor)??"#94a3b8",bgColor:((S=r.theme)==null?void 0:S.bgColor)??"#f8fafc",fontSize:((A=r.theme)==null?void 0:A.fontSize)??14,lineWidthStart:((F=r.theme)==null?void 0:F.lineWidthStart)??2.2,lineWidthEnd:((ne=r.theme)==null?void 0:ne.lineWidthEnd)??.8,rainbowBranch:((h=r.theme)==null?void 0:h.rainbowBranch)??!1}}),U=e.reactive({autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:3.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"curve",layoutMode:"mindmap",taperedEdge:!0,showOrderBadge:!1});function ti(i){return U.taperedEdge?ha(i):ii(i)}function ni(i){return U.taperedEdge?U.lineWidthEnd:ii(i)}function ha(i){return i<=0?U.lineWidthStart:i===1?Math.max(1.5,U.lineWidthStart*.67):i===2?Math.max(.8,U.lineWidthStart*.42):U.lineWidthEnd}function ii(i){if(i<=0)return U.lineWidthStart;if(i>=3)return U.lineWidthEnd;const o=i/3;return U.lineWidthStart+(U.lineWidthEnd-U.lineWidthStart)*o}function ba(i,o,f,w){const k=1-i,S=k*k*k*o.x+3*k*k*i*f.x1+3*k*i*i*f.x2+i*i*i*w.x,A=k*k*k*o.y+3*k*k*i*f.y1+3*k*i*i*f.y2+i*i*i*w.y;return{x:S,y:A}}function ya(i,o,f,w,k=32,S="curve",A="right"){if(S==="curve"){let ve;if(A==="right"||A==="left"){const se=Math.abs(o.x-i.x)*.45,Re=A==="right"?1:-1;ve={x1:i.x+Re*se,y1:i.y,x2:o.x-Re*se,y2:o.y}}else{const se=Math.abs(o.y-i.y)*.45;ve={x1:i.x,y1:i.y+se,x2:o.x,y2:o.y-se}}const xi=ee=>{const se=1-ee,Re=-3*se*se*i.x+3*(se*se-2*se*ee)*ve.x1+3*(2*se*ee-ee*ee)*ve.x2+3*ee*ee*o.x,Ze=-3*se*se*i.y+3*(se*se-2*se*ee)*ve.y1+3*(2*se*ee-ee*ee)*ve.y2+3*ee*ee*o.y;return{dx:Re,dy:Ze}},st=[],Jt=[];for(let ee=0;ee<=k;ee++){const se=ee/k,Re=ee===0?i:ee===k?o:ba(se,i,ve,o),Ze=xi(se);let Tt=Math.hypot(Ze.dx,Ze.dy);Tt<1e-6&&(Tt=1);const ki=-Ze.dy/Tt,Ni=Ze.dx/Tt,At=(f+(w-f)*se)/2;st.push({x:Re.x+ki*At,y:Re.y+Ni*At}),Jt.push({x:Re.x-ki*At,y:Re.y-Ni*At})}let vt=`M ${st[0].x.toFixed(2)} ${st[0].y.toFixed(2)}`;for(let ee=1;ee<=k;ee++)vt+=` L ${st[ee].x.toFixed(2)} ${st[ee].y.toFixed(2)}`;for(let ee=k;ee>=0;ee--)vt+=` L ${Jt[ee].x.toFixed(2)} ${Jt[ee].y.toFixed(2)}`;return vt+=" Z",vt}const F=o.x-i.x,ne=o.y-i.y;let h=Math.hypot(F,ne);h<1e-6&&(h=1);const X=-ne/h,Ne=F/h,Ce=f/2,pe=w/2,ot={x:i.x+X*Ce,y:i.y+Ne*Ce},rt={x:i.x-X*Ce,y:i.y-Ne*Ce},at={x:o.x-X*pe,y:o.y-Ne*pe},lt={x:o.x+X*pe,y:o.y+Ne*pe};return`M ${ot.x.toFixed(2)} ${ot.y.toFixed(2)} L ${lt.x.toFixed(2)} ${lt.y.toFixed(2)} L ${at.x.toFixed(2)} ${at.y.toFixed(2)} L ${rt.x.toFixed(2)} ${rt.y.toFixed(2)} Z`}const St=e.computed(()=>be.value.root.children),Ea=Xe[0].colors,oi=e.computed(()=>Gi(U.branchPaletteId,U.customPalettes)),Pe=e.computed(()=>{const i=new Map;if(!U.rainbowBranch)return i;const o=r.lineColors,f=o&&o.length>0?o:oi.value.colors.length>0?oi.value.colors:Ea;for(let k=0;k<St.value.length;k++){const S=St.value[k];i.set(S.id,f[k%f.length])}const w=(k,S)=>{i.set(k.id,S);for(const A of k.children)w(A,S)};for(let k=0;k<St.value.length;k++){const S=St.value[k];w(S,f[k%f.length])}return i});function xa(i,o){return U.rainbowBranch?Pe.value.get(o.id)??Se.value.lineColor:Se.value.lineColor}function ka(i){const o=Q(i.id);if(o.bg)return o.bg;if(i.isRoot)return Se.value.rootBg;if(U.rainbowBranch){const f=Pe.value.get(i.id);if(f)return Sa(f,.18)}return Se.value.branchBg}function Na(i){const o=Q(i.id);if(o.textColor)return o.textColor;if(i.isRoot)return Se.value.rootText;if(U.rainbowBranch){const f=Pe.value.get(i.id);if(f)return ri(f,.55)}return Se.value.branchText}function wa(i){const o=Q(i.id);if(o.borderColor)return o.borderColor;if(i.isRoot)return Se.value.rootBg;if(U.rainbowBranch){const f=Pe.value.get(i.id);if(f)return ri(f,.3)}return Se.value.lineColor}function _a(i){return Q(i.id).fontWeight??(i.isRoot?600:400)}function Sa(i,o){const f=i.replace("#",""),w=f.length===6?f:f.split("").map(F=>F+F).join(""),k=parseInt(w.slice(0,2),16),S=parseInt(w.slice(2,4),16),A=parseInt(w.slice(4,6),16);return`rgba(${k}, ${S}, ${A}, ${o})`}function ri(i,o){const f=i.replace("#",""),w=f.length===6?f:f.split("").map(F=>F+F).join(""),k=Math.round(parseInt(w.slice(0,2),16)*(1-o)),S=Math.round(parseInt(w.slice(2,4),16)*(1-o)),A=Math.round(parseInt(w.slice(4,6),16)*(1-o));return`rgb(${k}, ${S}, ${A})`}const Y=eo({getContainer:()=>u.value});Y.setOnMarqueeEnd(Wa),no({isEditing:()=>s.value!==null,isReadonly:()=>r.previewMode,getSelectedId:()=>d.value,getRootId:()=>g.value.id,defaultTargetId:()=>g.value.id,onAddChild:Ye,onAddSibling:Ct,onAddSiblingBefore:ci,onRemove:ui,onStartEdit:it,onClearSelection:()=>{d.value=null,l("select",null)},onDuplicate:di,onUndo:Zt,onRedo:Xt,onNavigate:Da,onSelectRoot:()=>{d.value=g.value.id;const i=Z(g.value,g.value.id);i&&l("select",i)}});const be=e.computed(()=>{const i=Te(g.value);return li(i),Hi(i,{mode:U.layoutMode,baseFontSize:Se.value.fontSize,richHeights:V.value,richWidths:D.value})}),ai=e.ref([]),Yt=e.computed(()=>(tt.value,ai.value));e.watch(be,i=>{const o=[],f=w=>{o.push(w);for(const k of w.children)f(k)};f(i.root),ai.value=o},{immediate:!0});const Ma=e.computed(()=>{const i=[];for(const o of Yt.value)for(const f of o.children)i.push({from:o,to:f,key:`${o.id}->${f.id}`});return i}),Ca=e.computed(()=>`${be.value.vbX} ${be.value.vbY} ${be.value.vbW} ${be.value.vbH}`);function li(i){if(m.value.has(i.id)){i.children=[],i.collapsed=!0;return}i.collapsed=!1;for(const o of i.children)li(o)}function it(i){const o=Z(g.value,i);o&&(s.value=i,c.value=o.text,e.nextTick(()=>{const f=document.querySelector(".zm-input");f==null||f.focus(),f==null||f.select()}))}function Mt(i={}){if(!s.value)return;const o=Z(g.value,s.value);o&&o.text!==(c.value.trim()||" ")&&(o.text=c.value.trim()||" ",me(),l("change",g.value));const f=s.value;s.value=null,i.addChild?e.nextTick(()=>Ye(f)):i.addSibling==="after"?e.nextTick(()=>Ct(f)):i.addSibling==="before"&&e.nextTick(()=>ci(f))}function va(){s.value=null}function Ta(i){if(r.previewMode)return;const o=Z(g.value,i);o!=null&&o.richContent&&(E.value=i,N.value=o.richContent.raw,e.nextTick(()=>{const f=document.querySelector(".zm-node .zm-rich textarea");f==null||f.focus()}))}function si(){if(!E.value)return;const i=E.value,o=Z(g.value,i),f=N.value;if(o&&o.richContent&&o.richContent.raw!==f)if(o.richContent.kind==="code"){const w=Qn(f)||void 0;_(i,{kind:"code",raw:f,lang:w})}else _(i,{kind:"table",raw:f});E.value=null}function Aa(){E.value=null}function Ra(i){i.key==="Escape"?(i.preventDefault(),Aa()):i.key==="Enter"&&(i.ctrlKey||i.metaKey)&&(i.preventDefault(),si())}function Ba(i,o){const f=b.value.get(i);!f||f.col!==o?b.value.set(i,{col:o,dir:"asc"}):f.dir==="asc"?b.value.set(i,{col:o,dir:"desc"}):b.value.delete(i)}function Oa(i,o){const f=b.value.get(i);return!f||o.length<=1?o:xr(o,f.col,f.dir)}function Ia(i,o){const f=b.value.get(i);return!f||f.col!==o?"↕":f.dir==="asc"?"▲":"▼"}function La(i){const o=i.metaKey||i.ctrlKey;o&&(i.key==="z"||i.key==="Z")&&!i.shiftKey?(i.preventDefault(),Zt()):(o&&i.shiftKey&&(i.key==="z"||i.key==="Z")||o&&(i.key==="y"||i.key==="Y")&&!i.shiftKey)&&(i.preventDefault(),Xt())}function Ye(i){const o=sn(g.value,i,ft);o&&(me(),oe(),l("change",g.value),e.nextTick(()=>it(o.id)))}function Ct(i){if(i===g.value.id){Ye(i);return}const o=cn(g.value,i,ft);o&&(me(),oe(),l("change",g.value),e.nextTick(()=>it(o.id)))}function ci(i){if(i===g.value.id){Ye(i);return}const o=Xi(g.value,i,ft);o&&(me(),oe(),l("change",g.value),e.nextTick(()=>it(o.id)))}function di(i){if(i===g.value.id)return;const o=qi(g.value,i);o&&(me(),d.value=o.id,l("change",g.value),oe())}function Zt(){const i=Ie.undo();i&&(g.value=i.data,d.value=null,l("select",null),oe(),l("change",g.value))}function Xt(){const i=Ie.redo();i&&(g.value=i.data,d.value=null,l("select",null),oe(),l("change",g.value))}function Da(i,o){const f=d.value??g.value.id,w=Z(g.value,f);if(!w)return;let k=null;if(o===1){const S=we(g.value,w.id);if(S){const A=S.children.findIndex(F=>F.id===w.id);A>=0&&A<S.children.length-1&&(k=S.children[A+1].id)}}else if(o===-1){const S=we(g.value,w.id);if(S){const A=S.children.findIndex(F=>F.id===w.id);A>0&&(k=S.children[A-1].id)}}else if(i===1){const S=we(g.value,w.id);S&&(k=S.id)}else i===-1&&w.children.length>0&&(k=w.children[0].id);if(k){d.value=k;const S=Z(g.value,k);S&&l("select",S)}}function ui(i){i!==g.value.id&&Ot(g.value,i)&&(me(),d.value===i&&(d.value=null),oe(),l("change",g.value))}function fi(i){m.value.has(i)?m.value.delete(i):m.value.add(i),oe()}function mi(i){const o=[{n:g.value,depth:1}];for(;o.length;){const{n:f,depth:w}=o.pop();i(f,w);for(let k=f.children.length-1;k>=0;k--)o.push({n:f.children[k],depth:w+1})}}function za(){m.value=new Set,mi(i=>{i.children.length>0&&m.value.add(i.id)}),oe()}function gi(i){m.value=new Set,mi((o,f)=>{f>i&&o.children.length>0&&m.value.add(o.id)}),oe()}function $a(){m.value=new Set,oe()}function Va(i,o){Yi(g.value,i,o)&&(me(),oe(),l("change",g.value))}function Pa(i,o,f){return Zi(g.value,i,o,f)?(me(),oe(),l("change",g.value),!0):!1}function Ua(i,o){i.stopPropagation(),d.value=o.id;const f=Z(g.value,o.id);l("select",f)}function Ha(i){const o=i.target;if(!o||o.closest(".zm-node, .zm-toolbar, button, input, textarea"))return;if(i.button===2){Y.startPan(i);return}if(i.button!==0)return;const f=u.value.getBoundingClientRect(),w=(i.clientX-f.left-Y.offsetX.value)/Y.scale.value,k=(i.clientY-f.top-Y.offsetY.value)/Y.scale.value;Y.startMarquee(w,k)}function Fa(i){if(q){q=!1;return}const o=i.target;if(!o||o.closest(".zm-node"))return;const f=Y.marquee;f.width>=4||f.height>=4||d.value!==null&&(d.value=null,l("select",null))}function Wa(){const i=Y.marquee;if(i.width<4&&i.height<4)return;const o=i.x,f=i.y,w=i.x+i.width,k=i.y+i.height,S=[];for(const A of Yt.value){const F=A.width/2,ne=A.height/2,h=A.x-F,X=A.x+F,Ne=A.y-ne,Ce=A.y+ne;h<=w&&X>=o&&Ne<=k&&Ce>=f&&S.push(A.id)}if(S.length>0){d.value=S[0];const A=Z(g.value,S[0]);A&&l("select",A)}}function pi(i){return m.value.has(i)}function Ka(i){const o=Z(g.value,i.id);return!!o&&o.children.length>0}function qt(i){const o=Z(g.value,i);return o?o.children.length:0}function hi(i){if(!Z(g.value,i))return 0;const w=[g.value];for(;w.length;){const k=w.pop(),S=k.children.findIndex(A=>A.id===i);if(S>=0)return S;for(const A of k.children)w.push(A)}return 0}function bi(i,o,f,w){if(((w==null?void 0:w._dir)??i._dir)==="down")return o==="out"?{x:i.x,y:i.y+i.height/2}:{x:i.x,y:i.y-i.height/2};let S;o==="in"?S=-i.side:f!==void 0?S=f:S=i.side;const A=o==="in"?i._richInsetX??0:0;return{x:i.x+S*(i.width/2-A),y:i.y}}function Ae(){const i=be.value;Y.resetView(i.width,i.height,i.root.y)}function Ga(){nt.value=!0,me(),oe(),e.nextTick(()=>Ae())}function jt(i){U.layoutMode!==i&&(U.layoutMode=i,oe(),e.nextTick(()=>Ae()))}function yi(){return JSON.stringify(g.value,null,2)}function Ei(i){try{const o=JSON.parse(i);return!o.id||!Array.isArray(o.children)?!1:(Ie.reset(),g.value=Te(o),d.value=null,m.value=new Set,oe(),e.nextTick(()=>Ae()),l("change",g.value),!0)}catch{return!1}}function Ya(){const i=document.createElement("input");i.type="file",i.accept="application/json",i.onchange=()=>{var w;const o=(w=i.files)==null?void 0:w[0];if(!o)return;const f=new FileReader;f.onload=()=>{typeof f.result=="string"&&(Ei(f.result)||alert("导入失败:JSON 格式无效"))},f.readAsText(o)},i.click()}function Za(){const i=new Blob([yi()],{type:"application/json"}),o=URL.createObjectURL(i),f=document.createElement("a");f.href=o,f.download=`${g.value.text||"mindmap"}.json`,f.click(),URL.revokeObjectURL(o)}return a({addChild:i=>Ye(i),addSibling:i=>Ct(i),removeNode:i=>ui(i),duplicateNode:i=>di(i),setNodeText:(i,o)=>Va(i,o),moveNode:(i,o,f)=>Pa(i,o,f),lineWidthForDepth:ti,endWidthForDepth:ni,getData:()=>g.value,setData:i=>{Ie.reset(),g.value=Te(i),d.value=null,m.value=new Set,oe(),me(),e.nextTick(()=>Ae())},resetView:()=>Ae(),exportData:yi,importData:Ei,getMarkdown:()=>mt(g.value),setMarkdown:(i,o=!0)=>{const f=It(i||"");o&&(y.value=!0),L=!o,Ie.reset(),g.value=Te(f),d.value=null,m.value=new Set,oe(),me(),e.nextTick(()=>{L=!1,Ae()}),l("change",g.value)},setBalanced:i=>{nt.value=i},isBalanced:()=>nt.value,balance:()=>Ga(),applyNodeStyle:(i,o)=>I(i,o),getNodeStyle:i=>Q(i),applyNodeImage:(i,o)=>te(i,o),applyNodeImageByUrl:(i,o)=>K(i,o),removeNodeImage:i=>le(i),applyNodeLink:(i,o)=>$(i,o),removeNodeLink:i=>v(i),applyNodeNote:(i,o)=>p(i,o),removeNodeNote:i=>C(i),applyNodeRichContent:(i,o)=>_(i,o),undo:()=>Zt(),redo:()=>Xt(),canUndo:()=>Ie.canUndo(),canRedo:()=>Ie.canRedo(),applySettings:i=>{i.autoBalanceOnChange!==void 0&&(U.autoBalanceOnChange=i.autoBalanceOnChange),i.lineWidthStart!==void 0&&(U.lineWidthStart=Math.max(.5,Math.min(20,i.lineWidthStart))),i.lineWidthEnd!==void 0&&(U.lineWidthEnd=Math.max(.3,Math.min(10,i.lineWidthEnd))),i.rainbowBranch!==void 0&&(U.rainbowBranch=i.rainbowBranch),i.branchPaletteId!==void 0&&(U.branchPaletteId=i.branchPaletteId),i.customPalettes!==void 0&&(U.customPalettes=i.customPalettes),i.lineStyle!==void 0&&(U.lineStyle=i.lineStyle),i.taperedEdge!==void 0&&(U.taperedEdge=i.taperedEdge),i.showOrderBadge!==void 0&&(U.showOrderBadge=i.showOrderBadge)},getSettings:()=>({autoBalanceOnChange:U.autoBalanceOnChange,lineWidthStart:U.lineWidthStart,lineWidthEnd:U.lineWidthEnd,rainbowBranch:U.rainbowBranch,branchPaletteId:U.branchPaletteId,customPalettes:U.customPalettes,lineStyle:U.lineStyle,layoutMode:U.layoutMode,taperedEdge:U.taperedEdge,showOrderBadge:U.showOrderBadge}),setBranchPalette:i=>{if(!i)return;[...Xe,...U.customPalettes].find(f=>f.id===i)&&(U.branchPaletteId=i)},getBranchPalette:()=>U.branchPaletteId,getBranchPalettes:()=>[...Xe,...U.customPalettes]}),e.watch(()=>r.data,i=>{g.value=Te(i),oe()},{deep:!1}),e.onMounted(()=>{me(),e.nextTick(()=>Ae())}),(i,o)=>{var f,w,k,S,A,F,ne;return e.openBlock(),e.createElementBlock("div",{class:"zm-mindmap",style:e.normalizeStyle({background:Se.value.bgColor,fontSize:Se.value.fontSize+"px"})},[e.createElementVNode("div",{ref_key:"wrapperRef",ref:u,class:"zm-canvas",onMousedown:Ha,onContextmenu:xe,onWheel:o[27]||(o[27]=(...h)=>e.unref(Y).onWheel&&e.unref(Y).onWheel(...h)),onMouseenter:o[28]||(o[28]=h=>x.value=!0),onMouseleave:o[29]||(o[29]=h=>x.value=!1),onClick:Fa},[e.createElementVNode("div",{class:"zm-svg-layer",style:e.normalizeStyle({left:be.value.vbX*e.unref(Y).scale.value+e.unref(Y).offsetX.value+"px",top:be.value.vbY*e.unref(Y).scale.value+e.unref(Y).offsetY.value+"px",width:be.value.vbW*e.unref(Y).scale.value+"px",height:be.value.vbH*e.unref(Y).scale.value+"px"})},[(e.openBlock(),e.createElementBlock("svg",{class:"zm-svg",viewBox:Ca.value,preserveAspectRatio:"xMinYMin meet",width:be.value.vbW*e.unref(Y).scale.value,height:be.value.vbH*e.unref(Y).scale.value},[e.createElementVNode("g",Nr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ma.value,h=>(e.openBlock(),e.createElementBlock("path",{key:h.key,d:ya(bi(h.from,"out",h.to.side,h.to),bi(h.to,"in"),ti(h.from.depth),ni(h.to.depth),32,U.lineStyle,h.to._dir),fill:xa(h.from,h.to),stroke:"none"},null,8,wr))),128))])],8,kr))],4),e.unref(Y).isMarquee.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-marquee",style:e.normalizeStyle({left:e.unref(Y).marquee.x*e.unref(Y).scale.value+e.unref(Y).offsetX.value+"px",top:e.unref(Y).marquee.y*e.unref(Y).scale.value+e.unref(Y).offsetY.value+"px",width:e.unref(Y).marquee.width*e.unref(Y).scale.value+"px",height:e.unref(Y).marquee.height*e.unref(Y).scale.value+"px"})},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"zm-world",style:e.normalizeStyle({transform:`translate(${e.unref(Y).offsetX.value}px, ${e.unref(Y).offsetY.value}px) scale(${e.unref(Y).scale.value})`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Yt.value,h=>(e.openBlock(),e.createElementBlock("div",{key:h.id,class:e.normalizeClass(["zm-node",{"is-root":h.isRoot,"is-selected":d.value===h.id,"is-editing":s.value===h.id,"has-image":!!h.image,"is-resizing":Qe.value===h.id}]),"data-node-id":h.id,style:e.normalizeStyle({left:h.x+"px",top:h.y+"px",width:h.width+"px",minWidth:h.width+"px",height:h.height+"px",fontSize:h.fontSize+"px",background:ka(h),color:Na(h),borderColor:wa(h),fontWeight:_a(h),transform:"translate(-50%, -50%)"}),onClick:X=>Ua(X,h),onDblclick:X=>{X.stopPropagation(),t.previewMode||it(h.id)},onContextmenu:X=>Ee(X,h),onMouseenter:X=>fe(h.id),onMouseleave:X=>_e(h.id)},[h.image?(e.openBlock(),e.createElementBlock("img",{key:0,class:"zm-node-img",src:h.image.src,width:h.image.width,height:h.image.height,alt:h.text,draggable:"false"},null,8,Sr)):e.createCommentVNode("",!0),h.richContent&&(h.richContent.kind==="code"||h.richContent.kind==="table")&&s.value!==h.id?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["zm-rich zm-rich-above",{"zm-rich-no-overflow":h.richContent.kind==="table"||h.richContent.kind==="code"}]),onClick:o[1]||(o[1]=e.withModifiers(()=>{},["stop"])),onDblclick:e.withModifiers(X=>Ta(h.id),["stop"]),onMousedown:o[2]||(o[2]=e.withModifiers(()=>{},["stop"]))},[E.value===h.id?e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:0,"onUpdate:modelValue":o[0]||(o[0]=X=>N.value=X),class:"zm-rich-edit",spellcheck:"false",onBlur:si,onKeydown:Ra},null,544)),[[e.vModelText,N.value]]):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[h.richContent.kind==="code"?(e.openBlock(),e.createElementBlock("pre",Cr,[e.createElementVNode("code",{innerHTML:e.unref(br)(e.unref(Jn)(h.richContent.raw),e.unref(Qn)(h.richContent.raw))},null,8,vr)])):h.richContent.kind==="table"?(e.openBlock(),e.createElementBlock("table",Tr,[e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Oa(h.id,e.unref(yr)(h.richContent.raw)),(X,Ne)=>(e.openBlock(),e.createElementBlock("tr",{key:Ne},[Ne===0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(X,(Ce,pe)=>{var ot,rt,at,lt,ve;return e.openBlock(),e.createElementBlock("th",{key:`h${pe}`,class:e.normalizeClass(["zm-rich-table-sort",{"is-sorted":((ot=b.value.get(h.id))==null?void 0:ot.col)===pe,"is-asc":((rt=b.value.get(h.id))==null?void 0:rt.col)===pe&&((at=b.value.get(h.id))==null?void 0:at.dir)==="asc","is-desc":((lt=b.value.get(h.id))==null?void 0:lt.col)===pe&&((ve=b.value.get(h.id))==null?void 0:ve.dir)==="desc"}]),onClick:e.withModifiers(xi=>Ba(h.id,pe),["stop"])},[e.createElementVNode("span",null,e.toDisplayString(Ce),1),e.createElementVNode("span",Rr,e.toDisplayString(Ia(h.id,pe)),1)],10,Ar)}),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(X,(Ce,pe)=>(e.openBlock(),e.createElementBlock("td",{key:`c${pe}`},e.toDisplayString(Ce),1))),128))]))),128))])])):e.createCommentVNode("",!0)],64))],42,Mr)):e.createCommentVNode("",!0),s.value!==h.id?(e.openBlock(),e.createElementBlock("span",Br,[e.createElementVNode("span",Or,e.toDisplayString(h.text),1),h.link&&!s.value?(e.openBlock(),e.createElementBlock("a",{key:0,class:"zm-node-link",href:h.link.url,target:"_blank",rel:"noopener noreferrer",title:`打开链接:${h.link.url}`,onClick:o[3]||(o[3]=e.withModifiers(()=>{},["stop"])),onMousedown:o[4]||(o[4]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(j,{name:"link",size:11,stroke:2})],40,Ir)):e.createCommentVNode("",!0),h.note&&!s.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-node-note-btn",type:"button",title:ie(h.note.text),onClick:e.withModifiers(X=>de(h.id),["stop"]),onMousedown:o[5]||(o[5]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(j,{name:"note",size:11,stroke:2})],40,Lr)):e.createCommentVNode("",!0)])):e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:3,class:"zm-input","onUpdate:modelValue":o[6]||(o[6]=X=>c.value=X),autofocus:"",onBlur:o[7]||(o[7]=X=>Mt()),onKeydown:[o[8]||(o[8]=e.withKeys(e.withModifiers(X=>Mt({addSibling:"after"}),["exact"]),["enter"])),o[9]||(o[9]=e.withKeys(e.withModifiers(X=>Mt({addSibling:"before"}),["shift","prevent","exact"]),["enter"])),o[10]||(o[10]=e.withKeys(e.withModifiers(X=>Mt({addChild:!0}),["prevent"]),["tab"])),e.withKeys(va,["esc"]),La],onMousedown:o[11]||(o[11]=e.withModifiers(()=>{},["stop"])),onClick:o[12]||(o[12]=e.withModifiers(()=>{},["stop"]))},null,544)),[[e.vModelText,c.value]]),O.value?(e.openBlock(),e.createElementBlock("span",{key:4,class:"zm-order-badge",title:`数据顺序:第 ${hi(h.id)+1} 个`},e.toDisplayString(hi(h.id)+1),9,Dr)):e.createCommentVNode("",!0),pi(h.id)&&qt(h.id)>0?(e.openBlock(),e.createElementBlock("span",{key:5,class:e.normalizeClass(["zm-collapse-badge",{"is-on-left":h.side===-1}]),style:e.normalizeStyle({background:Pe.value.get(h.id)??"#64748b"}),title:`展开 ${qt(h.id)} 个子节点`,onMousedown:o[13]||(o[13]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(X=>fi(h.id),["stop"])},e.toDisplayString(qt(h.id)),47,zr)):e.createCommentVNode("",!0),Ka(h)&&!pi(h.id)?(e.openBlock(),e.createElementBlock("button",{key:6,class:e.normalizeClass(["zm-btn zm-collapse",{"is-on-left":h.side===-1}]),style:e.normalizeStyle({color:Pe.value.get(h.id)??"#64748b",borderColor:Pe.value.get(h.id)??"#64748b"}),title:"折叠",onMousedown:o[14]||(o[14]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(X=>fi(h.id),["stop"])},[e.createVNode(j,{name:"minus",size:10,stroke:2.4})],46,$r)):e.createCommentVNode("",!0),h.image&&d.value===h.id&&s.value!==h.id?(e.openBlock(),e.createElementBlock("span",{key:7,class:"zm-img-resize-handle",title:"拖动调整图片大小",onMousedown:e.withModifiers(X=>et(X,h),["stop"])},null,40,Vr)):e.createCommentVNode("",!0),h.image&&d.value===h.id&&s.value!==h.id?(e.openBlock(),e.createElementBlock("button",{key:8,class:"zm-img-remove-btn",title:"移除图片",onMousedown:o[15]||(o[15]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(X=>le(h.id),["stop"])},[e.createVNode(j,{name:"x",size:9,stroke:2.2})],40,Pr)):e.createCommentVNode("",!0)],46,_r))),128))],4),T.value?(e.openBlock(),e.createBlock(oo,{key:1,x:T.value.x,y:T.value.y,container:u.value,"has-image":!!((f=e.unref(Z)(g.value,T.value.nodeId))!=null&&f.image),"has-link":!!((w=e.unref(Z)(g.value,T.value.nodeId))!=null&&w.link),"has-note":!!((k=e.unref(Z)(g.value,T.value.nodeId))!=null&&k.note),"has-code":((A=(S=e.unref(Z)(g.value,T.value.nodeId))==null?void 0:S.richContent)==null?void 0:A.kind)==="code","has-table":((ne=(F=e.unref(Z)(g.value,T.value.nodeId))==null?void 0:F.richContent)==null?void 0:ne.kind)==="table",onPickImage:Wt,onRemoveImage:ke,onSetLink:Kt,onRemoveLink:Gt,onEditNote:Ge,onRemoveNote:Nt,onAddCode:wt,onEditCode:wt,onRemoveCode:Je,onAddTable:H,onEditTable:H,onRemoveTable:_t,onClose:ge},null,8,["x","y","container","has-image","has-link","has-note","has-code","has-table"])):e.createCommentVNode("",!0),G.value?(e.openBlock(),e.createBlock(ro,{key:2,x:G.value.x,y:G.value.y,container:u.value,onOpenSettings:xt,onOpenData:kt,onOpenImport:Ft,onClose:$e},null,8,["x","y","container"])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(re.value),title:r.previewMode?"退出预览模式":"进入预览模式",onClick:o[16]||(o[16]=h=>l("canvas-toggle-preview"))},[e.createVNode(j,{name:r.previewMode?"eye-off":"eye",size:16},null,8,["name"])],10,Ur),e.createElementVNode("button",{class:e.normalizeClass(ue.value),title:"显示大纲视图",onClick:o[17]||(o[17]=h=>l("canvas-outline"))},[e.createVNode(j,{name:"outline",size:16})],2),e.createElementVNode("div",{class:e.normalizeClass(["zm-toolbar",{"is-preview-only":r.previewMode,"is-hovered":x.value}])},[e.createElementVNode("span",Hr,e.toDisplayString(Math.round(e.unref(Y).scale.value*100))+"%",1),e.createElementVNode("button",{class:"zm-tb-btn",title:"放大",onClick:o[18]||(o[18]=(...h)=>e.unref(Y).zoomIn&&e.unref(Y).zoomIn(...h))},[e.createVNode(j,{name:"zoom-in"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"缩小",onClick:o[19]||(o[19]=(...h)=>e.unref(Y).zoomOut&&e.unref(Y).zoomOut(...h))},[e.createVNode(j,{name:"zoom-out"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"重置视图",onClick:Ae},[e.createVNode(j,{name:"reset"})]),o[33]||(o[33]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"全部收起",onClick:za},[e.createVNode(j,{name:"collapse-all"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"展开一级",onClick:o[20]||(o[20]=h=>gi(1))},[e.createVNode(j,{name:"expand-level-1"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"展开二级",onClick:o[21]||(o[21]=h=>gi(2))},[e.createVNode(j,{name:"expand-level-2"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"全部展开",onClick:$a},[e.createVNode(j,{name:"expand-all"})]),o[34]||(o[34]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"导出 JSON",onClick:Za},[e.createVNode(j,{name:"export"})]),r.previewMode?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[o[30]||(o[30]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"添加子节点 (Tab)",onClick:o[22]||(o[22]=h=>d.value&&Ye(d.value))},[e.createElementVNode("img",{src:e.unref(en),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,Fr)]),e.createElementVNode("button",{class:"zm-tb-btn",title:"添加同级 (Enter)",onClick:o[23]||(o[23]=h=>d.value&&Ct(d.value))},[e.createElementVNode("img",{src:e.unref(Qt),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,Wr)]),o[31]||(o[31]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:U.layoutMode==="mindmap"}]),title:"思维导图布局 (中心辐射)",onClick:o[24]||(o[24]=h=>jt("mindmap"))},[e.createVNode(j,{name:"mindmap"})],2),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:U.layoutMode==="tree"}]),title:"树形布局 (向右展开)",onClick:o[25]||(o[25]=h=>jt("tree"))},[e.createVNode(j,{name:"tree"})],2),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:U.layoutMode==="org"}]),title:"组织结构布局 (向下展开)",onClick:o[26]||(o[26]=h=>jt("org"))},[e.createVNode(j,{name:"org"})],2),o[32]||(o[32]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"导入 JSON",onClick:Ya},[e.createVNode(j,{name:"import"})])],64))],2)],544)],4)}}}),Kr={class:"zm-outline-root"},Gr={class:"zm-outline-actions"},Yr={width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Zr={key:0,x:"9",y:"9",width:"13",height:"13",rx:"2"},Xr={key:1,d:"M5 12 L10 17 L19 7"},qr={class:"zm-outline"},jr=["onClick","onDblclick","onDragstart","onDragover","onDragleave","onDrop"],Jr=["title","onClick"],Qr={width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round"},ea={key:0,points:"6 9 12 15 18 9"},ta={key:1,points:"9 6 15 12 9 18"},na={key:1,class:"zm-outline-dot"},ia={class:"zm-outline-index"},oa={key:3,class:"zm-outline-text"},ra=["onClick"],aa=["src"],la=["onClick"],sa=["src"],ca=["title","onClick"],da={width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},ua={key:0,x:"9",y:"9",width:"13",height:"13",rx:"2"},fa={key:1,d:"M5 12 L10 17 L19 7"},ma=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:a}){const n=t,r=a,l=e.computed(()=>{const B=[],$=(v,p,C)=>{const _=v.children.length>0,T=n.collapsedIds.has(v.id);B.push({id:v.id,text:v.text||"(无标题)",depth:p,siblingIndex:C,hasChildren:_,collapsed:T,node:v}),_&&!T&&v.children.forEach((G,re)=>$(G,p+1,re))};return $(n.data,0,0),B}),u=e.ref(null),s=e.ref("");let c=null;function d(B){n.readonly||(u.value=B.id,s.value=B.text,e.nextTick(()=>{c=document.querySelector(".zm-outline-input"),c==null||c.focus(),c==null||c.select()}))}function m(){u.value!=null&&(r("edit",{id:u.value,text:s.value.trim()||"(无标题)"}),x())}function x(){u.value=null,s.value="",c=null}function E(B){B.key==="Enter"?(B.preventDefault(),m()):B.key==="Escape"&&(B.preventDefault(),x())}e.onBeforeUnmount(x);const N=e.ref(null),b=e.ref(null),g=e.ref(null);function V(B,$){if(n.readonly){B.preventDefault();return}N.value={id:$.id,text:$.text},B.dataTransfer&&(B.dataTransfer.effectAllowed="move",B.dataTransfer.setData("text/plain",$.id))}function D(){N.value=null,b.value=null,g.value=null}function y(B,$){if(!N.value)return;B.preventDefault(),B.dataTransfer&&(B.dataTransfer.dropEffect="move");const v=P(B);b.value=$.id,g.value=v}function L(B){b.value===B.id&&(b.value=null,g.value=null)}function O(B,$){B.preventDefault();const v=N.value;if(!v)return;const p=P(B);v.id!==$.id&&r("move",{srcId:v.id,targetId:$.id,position:p}),D()}function P(B,$){const p=B.currentTarget.getBoundingClientRect(),C=B.clientY-p.top,_=p.height;return C<_*.3?"before":C>_*.7?"after":"child"}const z=e.ref(null);let I=null;async function Q(B){try{return await navigator.clipboard.writeText(B),!0}catch{const $=document.createElement("textarea");$.value=B,document.body.appendChild($),$.select();let v=!1;try{v=document.execCommand("copy")}finally{document.body.removeChild($)}return v}}async function te(B,$,v){B.stopPropagation(),await Q($)&&(z.value=v,I&&clearTimeout(I),I=setTimeout(()=>z.value=null,1200))}const le=e.computed(()=>{const B=[],$=(v,p)=>{const C=" ".repeat(p),_=p===0?"":"- ";B.push(C+_+(v.text||""));for(const T of v.children)$(T,p+1)};return $(n.data,0),B.join(`
23
- `)}),K=e.ref(!1);let J=null;async function ae(){await Q(le.value)&&(K.value=!0,J&&clearTimeout(J),J=setTimeout(()=>K.value=!1,1200))}return(B,$)=>(e.openBlock(),e.createElementBlock("div",Kr,[e.createElementVNode("div",Gr,[e.createElementVNode("button",{class:e.normalizeClass(["zm-outline-action-btn",{"is-success":K.value}]),title:"复制完整大纲为纯文本",onClick:ae},[(e.openBlock(),e.createElementBlock("svg",Yr,[K.value?(e.openBlock(),e.createElementBlock("path",Xr)):(e.openBlock(),e.createElementBlock("rect",Zr)),$[2]||($[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(K.value?"已复制":"复制大纲"),1)],2)]),e.createElementVNode("ul",qr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,v=>(e.openBlock(),e.createElementBlock("li",{key:v.id,class:e.normalizeClass(["zm-outline-row",{"is-selected":v.id===t.selectedId,"is-root":v.depth===0,"is-editing":u.value===v.id,"is-drag-over-before":b.value===v.id&&g.value==="before","is-drag-over-after":b.value===v.id&&g.value==="after","is-drag-over-child":b.value===v.id&&g.value==="child"}]),style:e.normalizeStyle({paddingLeft:12+v.depth*16+"px"}),draggable:"true",onClick:p=>r("select",v.node),onDblclick:p=>d(v),onDragstart:p=>V(p,v),onDragend:D,onDragover:p=>y(p,v),onDragleave:()=>L(v),onDrop:p=>O(p,v)},[v.hasChildren?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-outline-toggle",title:v.collapsed?"展开":"折叠",onClick:e.withModifiers(p=>r("toggleCollapse",v.id),["stop"])},[(e.openBlock(),e.createElementBlock("svg",Qr,[v.collapsed?(e.openBlock(),e.createElementBlock("polyline",ta)):(e.openBlock(),e.createElementBlock("polyline",ea))]))],8,Jr)):(e.openBlock(),e.createElementBlock("span",na)),e.createElementVNode("span",ia,e.toDisplayString(v.siblingIndex+1)+".",1),u.value===v.id?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,"onUpdate:modelValue":$[0]||($[0]=p=>s.value=p),class:"zm-outline-input",onBlur:m,onKeydown:E,onClick:$[1]||($[1]=e.withModifiers(()=>{},["stop"]))},null,544)),[[e.vModelText,s.value]]):(e.openBlock(),e.createElementBlock("span",oa,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(p=>r("addSibling",v.id),["stop"])},[e.createElementVNode("img",{src:e.unref(Qt),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,aa)],8,ra)),n.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:5,class:"zm-outline-row-action",title:"添加子节点",onClick:e.withModifiers(p=>r("addChild",v.id),["stop"])},[e.createElementVNode("img",{src:e.unref(en),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,sa)],8,la)),e.createElementVNode("button",{class:e.normalizeClass(["zm-outline-row-copy",{"is-success":z.value===v.id}]),title:z.value===v.id?"已复制":"复制节点文本",onClick:p=>te(p,v.text,v.id)},[(e.openBlock(),e.createElementBlock("svg",da,[z.value!==v.id?(e.openBlock(),e.createElementBlock("rect",ua)):(e.openBlock(),e.createElementBlock("path",fa)),$[3]||($[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,ca)],46,jr))),128))])]))}}),ga={install(t){t.component("FlowMindMap",ei)}};ce.MindMap=ei,ce.Outline=ma,ce.addChild=sn,ce.addSibling=cn,ce.clone=Te,ce.default=ga,ce.findNode=Z,ce.findParent=we,ce.markdownToMindMap=It,ce.markdownToRichMindMap=Ji,ce.mindMapToMarkdown=mt,ce.removeNode=Ot,ce.richBlockToMarkdown=Qi,ce.uid=Me,Object.defineProperties(ce,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
22
+ | a | b | c |`);if(I===null)return;const P=I.trim();if(!P){j(l,null);return}j(l,{kind:"table",raw:P})}function Me(){var d;const l=(d=X.value)==null?void 0:d.nodeId;l&&j(l,null)}function ye(l){i.previewMode||r("edit-note",l)}function kt(l,d=60){const E=l.replace(/\s+/g," ").trim();return E.length<=d?E||"点击编辑笔记":E.slice(0,d)+"…"}function je(l){var I;if(i.previewMode||c.value)return;const d=l.target;if(d&&(d.tagName==="INPUT"||d.tagName==="TEXTAREA"||d.isContentEditable))return;const E=s.value;if(!E)return;const V=(I=l.clipboardData)==null?void 0:I.items;if(V)for(let P=0;P<V.length;P++){const q=V[P];if(q.kind==="file"&&q.type.startsWith("image/")){const re=q.getAsFile();if(!re)continue;l.preventDefault();const Se=pe(b.value,E);if(Se!=null&&Se.image&&!window.confirm("该节点已有图片,要用剪贴板里的图片替换吗?"))return;G(re,R=>oe(E,R));return}}}e.onMounted(()=>{window.addEventListener("paste",je),we()}),e.onBeforeUnmount(()=>{window.removeEventListener("paste",je)});const Qe=e.ref(null),yt=e.computed(()=>{var l;return((l=Qe.value)==null?void 0:l.nodeId)??null});function U(l,d){if(!d.image)return;l.preventDefault(),l.stopPropagation();const E=d.image.naturalW||d.image.width,V=d.image.naturalH||d.image.height,I=V>0?V/E:1;Qe.value={nodeId:d.id,startX:l.clientX,startY:l.clientY,startW:d.image.width,startH:d.image.height,naturalW:E,naturalH:V,ratio:I,pendingW:d.image.width,pendingH:d.image.height},window.addEventListener("mousemove",Z),window.addEventListener("mouseup",se)}function Z(l){var Se,R;const d=Qe.value;if(!d)return;const E=ne.scale.value||1,V=l.clientX-d.startX,I=le(d.startW+V/E,vt,Yt),P=le(I*d.ratio,vt,Yt);d.pendingW=I,d.pendingH=P;const q=(Se=a.value)==null?void 0:Se.querySelector(`[data-node-id="${d.nodeId}"] .zm-node-img`);q&&(q.style.width=`${I}px`,q.style.height=`${P}px`);const re=(R=a.value)==null?void 0:R.querySelector(`[data-node-id="${d.nodeId}"]`);re&&(re.style.minWidth=`${Math.max(80,Math.ceil(I+28))}px`,re.style.height=`${Math.ceil(P+8+30)}px`)}function se(){const l=Qe.value;if(window.removeEventListener("mousemove",Z),window.removeEventListener("mouseup",se),Qe.value=null,!l)return;const d=pe(b.value,l.nodeId);!d||!d.image||(oe(l.nodeId,{src:d.image.src,naturalW:d.image.naturalW,naturalH:d.image.naturalH,width:l.pendingW,height:l.pendingH}),s.value=l.nodeId,r("select",d),Re=!0)}const he=e.ref(null);let Re=!1;function He(l){he.value=l}function et(l){he.value===l&&(he.value=null),g.value&&(g.value=null)}function Pt(l,d){var Ke;if(!d.text||d.text.length<14)return;const V=l.currentTarget.getBoundingClientRect(),I=(Ke=a.value)==null?void 0:Ke.getBoundingClientRect();if(!I)return;const P=10,q=240,re=V.top-I.top>60,Se=V.left-I.left+V.width/2,R=P+q/2,fe=I.width-q/2-P,it=Math.max(R,Math.min(Se,fe)),st=re?V.top-I.top-8:V.bottom-I.top+8;g.value={text:d.text,x:it,y:st,above:re}}const rn=e.ref(0),ln=e.ref(!1),at=Bl(100);function Ve(){at.record({data:b.value})}function we(){m.value=new Set(m.value),rn.value++,e.nextTick().then(()=>e.nextTick()).then(()=>an()).then(()=>{rn.value++})}function an(){const l=document.querySelectorAll(".zm-rich"),d={},E={};l.forEach(V=>{let I=V,P=null;for(;I&&!P;)P=I.getAttribute("data-node-id"),I=I.parentElement;if(!P)return;const q=V.offsetHeight,re=V.scrollWidth,Se=Math.round(q*2)/2,R=Math.round(re*2)/2;d[P]=Se,E[P]=R,_.value[P],x.value[P]}),_.value=d,x.value=E}const Ie=e.computed(()=>{var l,d,E,V,I,P,q,re,Se,R;return{rootBg:((l=i.theme)==null?void 0:l.rootBg)??"#1f2937",rootText:((d=i.theme)==null?void 0:d.rootText)??"#ffffff",branchBg:((E=i.theme)==null?void 0:E.branchBg)??"#ffffff",branchText:((V=i.theme)==null?void 0:V.branchText)??"#1f2937",lineColor:((I=i.theme)==null?void 0:I.lineColor)??"#94a3b8",bgColor:((P=i.theme)==null?void 0:P.bgColor)??"#f8fafc",fontSize:((q=i.theme)==null?void 0:q.fontSize)??14,lineWidthStart:((re=i.theme)==null?void 0:re.lineWidthStart)??2.2,lineWidthEnd:((Se=i.theme)==null?void 0:Se.lineWidthEnd)??.8,rainbowBranch:((R=i.theme)==null?void 0:R.rainbowBranch)??!1}}),Q=e.reactive({autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:3.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"curve",layoutMode:"mindmap",taperedEdge:!0,showOrderBadge:!1});function sn(l){return Q.taperedEdge?Yo(l):dn(l)}function cn(l){return Q.taperedEdge?Q.lineWidthEnd:dn(l)}function Yo(l){return l<=0?Q.lineWidthStart:l===1?Math.max(1.5,Q.lineWidthStart*.67):l===2?Math.max(.8,Q.lineWidthStart*.42):Q.lineWidthEnd}function dn(l){if(l<=0)return Q.lineWidthStart;if(l>=3)return Q.lineWidthEnd;const d=l/3;return Q.lineWidthStart+(Q.lineWidthEnd-Q.lineWidthStart)*d}function Sn(l,d,E,V){const I=1-l,P=I*I*I*d.x+3*I*I*l*E.x1+3*I*l*l*E.x2+l*l*l*V.x,q=I*I*I*d.y+3*I*I*l*E.y1+3*I*l*l*E.y2+l*l*l*V.y;return{x:P,y:q}}function Zo(l,d,E,V,I=32,P="curve",q="right"){if(P==="curve"){let wt;if(q==="right"||q==="left"){const ve=Math.abs(d.x-l.x)*.45,_t=q==="right"?1:-1;wt={x1:l.x+_t*ve,y1:l.y,x2:d.x-_t*ve,y2:d.y}}else{const ve=Math.abs(d.y-l.y)*.45;wt={x1:l.x,y1:l.y+ve,x2:d.x,y2:d.y-ve}}const Gr=Te=>{const ve=1-Te,_t=-3*ve*ve*l.x+3*(ve*ve-2*ve*Te)*wt.x1+3*(2*ve*Te-Te*Te)*wt.x2+3*Te*Te*d.x,gn=-3*ve*ve*l.y+3*(ve*ve-2*ve*Te)*wt.y1+3*(2*ve*Te-Te*Te)*wt.y2+3*Te*Te*d.y;return{dx:_t,dy:gn}},On=[],ti=[];for(let Te=0;Te<=I;Te++){const ve=Te/I,_t=Te===0?l:Te===I?d:Sn(ve,l,wt,d),gn=Gr(ve);let uo=Math.hypot(gn.dx,gn.dy);uo<1e-6&&(uo=1);const jr=-gn.dy/uo,Kr=gn.dx/uo,mo=(E+(V-E)*ve)/2;On.push({x:_t.x+jr*mo,y:_t.y+Kr*mo}),ti.push({x:_t.x-jr*mo,y:_t.y-Kr*mo})}let co=`M ${On[0].x.toFixed(2)} ${On[0].y.toFixed(2)}`;for(let Te=1;Te<=I;Te++)co+=` L ${On[Te].x.toFixed(2)} ${On[Te].y.toFixed(2)}`;for(let Te=I;Te>=0;Te--)co+=` L ${ti[Te].x.toFixed(2)} ${ti[Te].y.toFixed(2)}`;return co+=" Z",co}const re=d.x-l.x,Se=d.y-l.y;let R=Math.hypot(re,Se);R<1e-6&&(R=1);const fe=-Se/R,it=re/R,st=E/2,Ke=V/2,Mn={x:l.x+fe*st,y:l.y+it*st},Rn={x:l.x-fe*st,y:l.y-it*st},Bn={x:d.x-fe*Ke,y:d.y-it*Ke},zn={x:d.x+fe*Ke,y:d.y+it*Ke};return`M ${Mn.x.toFixed(2)} ${Mn.y.toFixed(2)} L ${zn.x.toFixed(2)} ${zn.y.toFixed(2)} L ${Bn.x.toFixed(2)} ${Bn.y.toFixed(2)} L ${Rn.x.toFixed(2)} ${Rn.y.toFixed(2)} Z`}const Et=e.computed(()=>$e.value.root.children),Xo=Nt[0].colors,Jn=e.computed(()=>hl(Q.branchPaletteId,Q.customPalettes)),Ce=e.computed(()=>{const l=new Map;if(!Q.rainbowBranch)return l;const d=i.lineColors,E=d&&d.length>0?d:Jn.value.colors.length>0?Jn.value.colors:Xo;for(let I=0;I<Et.value.length;I++){const P=Et.value[I];l.set(P.id,E[I%E.length])}const V=(I,P)=>{l.set(I.id,P);for(const q of I.children)V(q,P)};for(let I=0;I<Et.value.length;I++){const P=Et.value[I];V(P,E[I%E.length])}return l});function Bt(l,d){return Q.rainbowBranch?Ce.value.get(d.id)??Ie.value.lineColor:Ie.value.lineColor}function Jo(l){const d=W(l.id);if(d.bg)return d.bg;if(l.isRoot)return Ie.value.rootBg;if(Q.rainbowBranch){const E=Ce.value.get(l.id);if(E)return to(E,.18)}return Ie.value.branchBg}function Qn(l){const d=W(l.id);if(d.textColor)return d.textColor;if(l.isRoot)return Ie.value.rootText;if(Q.rainbowBranch){const E=Ce.value.get(l.id);if(E)return no(E,.55)}return Ie.value.branchText}function Tn(l){const d=W(l.id);if(d.borderColor)return d.borderColor;if(l.isRoot)return Ie.value.rootBg;if(Q.rainbowBranch){const E=Ce.value.get(l.id);if(E)return no(E,.3)}return Ie.value.lineColor}function eo(l){return W(l.id).fontWeight??(l.isRoot?600:400)}function to(l,d){const E=l.replace("#",""),V=E.length===6?E:E.split("").map(re=>re+re).join(""),I=parseInt(V.slice(0,2),16),P=parseInt(V.slice(2,4),16),q=parseInt(V.slice(4,6),16);return`rgba(${I}, ${P}, ${q}, ${d})`}function no(l,d){const E=l.replace("#",""),V=E.length===6?E:E.split("").map(re=>re+re).join(""),I=Math.round(parseInt(V.slice(0,2),16)*(1-d)),P=Math.round(parseInt(V.slice(2,4),16)*(1-d)),q=Math.round(parseInt(V.slice(4,6),16)*(1-d));return`rgb(${I}, ${P}, ${q})`}const ne=Al({getContainer:()=>a.value});ne.setOnMarqueeEnd(Um),Rl({isEditing:()=>c.value!==null,isReadonly:()=>i.previewMode,getSelectedId:()=>s.value,getRootId:()=>b.value.id,defaultTargetId:()=>b.value.id,onAddChild:z,onAddSibling:H,onAddSiblingBefore:ke,onRemove:ot,onStartEdit:xt,onClearSelection:()=>{s.value=null,r("select",null)},onDuplicate:ce,onUndo:Ne,onRedo:ze,onNavigate:nt,onSelectRoot:()=>{s.value=b.value.id;const l=pe(b.value,b.value.id);l&&r("select",l)}});const $e=e.computed(()=>{const l=pt(b.value);return Tt(l),ml(l,{mode:Q.layoutMode,baseFontSize:Ie.value.fontSize,richHeights:_.value,richWidths:x.value})}),Cn=e.ref([]),un=e.computed(()=>(rn.value,Cn.value));e.watch($e,l=>{const d=[],E=V=>{d.push(V);for(const I of V.children)E(I)};E(l.root),Cn.value=d},{immediate:!0});const _n=e.computed(()=>{const l=[];for(const d of un.value)for(const E of d.children)l.push({from:d,to:E,key:`${d.id}->${E.id}`});return l}),mn=e.computed(()=>`${$e.value.vbX} ${$e.value.vbY} ${$e.value.vbW} ${$e.value.vbH}`);function Tt(l){if(m.value.has(l.id)){l.children=[],l.collapsed=!0;return}l.collapsed=!1;for(const d of l.children)Tt(d)}function xt(l){const d=pe(b.value,l);d&&(c.value=l,u.value=d.text,e.nextTick(()=>{const E=document.querySelector(".zm-input");E==null||E.focus(),E==null||E.select()}))}function tt(l={}){if(!c.value)return;const d=pe(b.value,c.value);d&&d.text!==(u.value.trim()||" ")&&(d.text=u.value.trim()||" ",Ve(),r("change",b.value));const E=c.value;c.value=null,l.addChild?e.nextTick(()=>z(E)):l.addSibling==="after"?e.nextTick(()=>H(E)):l.addSibling==="before"&&e.nextTick(()=>ke(E))}function oo(){c.value=null}function io(l){if(i.previewMode)return;const d=pe(b.value,l);d!=null&&d.richContent&&(y.value=l,w.value=d.richContent.raw,e.nextTick(()=>{const E=document.querySelector(".zm-node .zm-rich textarea");E==null||E.focus()}))}function ro(){if(!y.value)return;const l=y.value,d=pe(b.value,l),E=w.value;if(d&&d.richContent&&d.richContent.raw!==E)if(d.richContent.kind==="code"){const V=qt(E)||void 0;j(l,{kind:"code",raw:E,lang:V})}else j(l,{kind:"table",raw:E});y.value=null}function lo(){y.value=null}function ao(l){l.key==="Escape"?(l.preventDefault(),lo()):l.key==="Enter"&&(l.ctrlKey||l.metaKey)&&(l.preventDefault(),ro())}function fn(l,d){const E=k.value.get(l);!E||E.col!==d?k.value.set(l,{col:d,dir:"asc"}):E.dir==="asc"?k.value.set(l,{col:d,dir:"desc"}):k.value.delete(l)}function zt(l,d){const E=k.value.get(l);return!E||d.length<=1?d:or(d,E.col,E.dir)}function J(l,d){const E=k.value.get(l);return!E||E.col!==d?"↕":E.dir==="asc"?"▲":"▼"}function f(l){const d=l.metaKey||l.ctrlKey;d&&(l.key==="z"||l.key==="Z")&&!l.shiftKey?(l.preventDefault(),Ne()):(d&&l.shiftKey&&(l.key==="z"||l.key==="Z")||d&&(l.key==="y"||l.key==="Y")&&!l.shiftKey)&&(l.preventDefault(),ze())}function z(l){const d=mi(b.value,l,Dn);d&&(Ve(),we(),r("change",b.value),e.nextTick(()=>xt(d.id)))}function H(l){if(l===b.value.id){z(l);return}const d=fi(b.value,l,Dn);d&&(Ve(),we(),r("change",b.value),e.nextTick(()=>xt(d.id)))}function ke(l){if(l===b.value.id){z(l);return}const d=Nl(b.value,l,Dn);d&&(Ve(),we(),r("change",b.value),e.nextTick(()=>xt(d.id)))}function ce(l){if(l===b.value.id)return;const d=Sl(b.value,l);d&&(Ve(),s.value=d.id,r("change",b.value),we())}function Ne(){const l=at.undo();l&&(b.value=l.data,s.value=null,r("select",null),we(),r("change",b.value))}function ze(){const l=at.redo();l&&(b.value=l.data,s.value=null,r("select",null),we(),r("change",b.value))}function nt(l,d){const E=s.value??b.value.id,V=pe(b.value,E);if(!V)return;let I=null;if(d===1){const P=ct(b.value,V.id);if(P){const q=P.children.findIndex(re=>re.id===V.id);q>=0&&q<P.children.length-1&&(I=P.children[q+1].id)}}else if(d===-1){const P=ct(b.value,V.id);if(P){const q=P.children.findIndex(re=>re.id===V.id);q>0&&(I=P.children[q-1].id)}}else if(l===1){const P=ct(b.value,V.id);P&&(I=P.id)}else l===-1&&V.children.length>0&&(I=V.children[0].id);if(I){s.value=I;const P=pe(b.value,I);P&&r("select",P)}}function ot(l){l!==b.value.id&&go(b.value,l)&&(Ve(),s.value===l&&(s.value=null),we(),r("change",b.value))}function pn(l){m.value.has(l)?m.value.delete(l):m.value.add(l),we()}function Pe(l){const d=[{n:b.value,depth:1}];for(;d.length;){const{n:E,depth:V}=d.pop();l(E,V);for(let I=E.children.length-1;I>=0;I--)d.push({n:E.children[I],depth:V+1})}}function so(){m.value=new Set,Pe(l=>{l.children.length>0&&m.value.add(l.id)}),we()}function An(l){m.value=new Set,Pe((d,E)=>{E>l&&d.children.length>0&&m.value.add(d.id)}),we()}function Lm(){m.value=new Set,we()}function Dm(l,d){xl(b.value,l,d)&&(Ve(),we(),r("change",b.value))}function Vm(l,d,E){return wl(b.value,l,d,E)?(Ve(),we(),r("change",b.value),!0):!1}function $m(l,d){l.stopPropagation(),s.value=d.id;const E=pe(b.value,d.id);r("select",E)}function Pm(l){const d=l.target;if(!d||d.closest(".zm-node, .zm-toolbar, button, input, textarea"))return;if(l.button===2){ne.startPan(l);return}if(l.button!==0)return;const E=a.value.getBoundingClientRect(),V=(l.clientX-E.left-ne.offsetX.value)/ne.scale.value,I=(l.clientY-E.top-ne.offsetY.value)/ne.scale.value;ne.startMarquee(V,I)}function Fm(l){if(Re){Re=!1;return}const d=l.target;if(!d||d.closest(".zm-node"))return;const E=ne.marquee;E.width>=4||E.height>=4||s.value!==null&&(s.value=null,r("select",null))}function Um(){const l=ne.marquee;if(l.width<4&&l.height<4)return;const d=l.x,E=l.y,V=l.x+l.width,I=l.y+l.height,P=[];for(const q of un.value){const re=q.width/2,Se=q.height/2,R=q.x-re,fe=q.x+re,it=q.y-Se,st=q.y+Se;R<=V&&fe>=d&&it<=I&&st>=E&&P.push(q.id)}if(P.length>0){s.value=P[0];const q=pe(b.value,P[0]);q&&r("select",q)}}function Pr(l){return m.value.has(l)}function Hm(l){const d=pe(b.value,l.id);return!!d&&d.children.length>0}function Qo(l){const d=pe(b.value,l);return d?d.children.length:0}function Fr(l){if(!pe(b.value,l))return 0;const V=[b.value];for(;V.length;){const I=V.pop(),P=I.children.findIndex(q=>q.id===l);if(P>=0)return P;for(const q of I.children)V.push(q)}return 0}function Ur(l,d,E,V){if(((V==null?void 0:V._dir)??l._dir)==="down")return d==="out"?{x:l.x,y:l.y+l.height/2}:{x:l.x,y:l.y-l.height/2};let P;d==="in"?P=-l.side:E!==void 0?P=E:P=l.side;const q=d==="in"?l._richInsetX??0:0;return{x:l.x+P*(l.width/2-q),y:l.y}}function Ct(){const l=$e.value;ne.resetView(l.width,l.height,l.root.y)}function Wm(){ln.value=!0,Ve(),we(),e.nextTick(()=>Ct())}function ei(l){Q.layoutMode!==l&&(Q.layoutMode=l,we(),e.nextTick(()=>Ct()))}function Hr(){return JSON.stringify(b.value,null,2)}function Wr(l){try{const d=JSON.parse(l);return!d.id||!Array.isArray(d.children)?!1:(at.reset(),b.value=pt(d),s.value=null,m.value=new Set,we(),e.nextTick(()=>Ct()),r("change",b.value),!0)}catch{return!1}}function Gm(){const l=document.createElement("input");l.type="file",l.accept="application/json",l.onchange=()=>{var V;const d=(V=l.files)==null?void 0:V[0];if(!d)return;const E=new FileReader;E.onload=()=>{typeof E.result=="string"&&(Wr(E.result)||alert("导入失败:JSON 格式无效"))},E.readAsText(d)},l.click()}function jm(){const l=new Blob([Hr()],{type:"application/json"}),d=URL.createObjectURL(l),E=document.createElement("a");E.href=d,E.download=`${b.value.text||"mindmap"}.json`,E.click(),URL.revokeObjectURL(d)}return o({addChild:l=>z(l),addSibling:l=>H(l),removeNode:l=>ot(l),duplicateNode:l=>ce(l),setNodeText:(l,d)=>Dm(l,d),moveNode:(l,d,E)=>Vm(l,d,E),lineWidthForDepth:sn,endWidthForDepth:cn,getData:()=>b.value,setData:l=>{at.reset(),b.value=pt(l),s.value=null,m.value=new Set,we(),Ve(),e.nextTick(()=>Ct())},resetView:()=>Ct(),exportData:Hr,importData:Wr,getMarkdown:()=>Wt(b.value),setMarkdown:(l,d=!0)=>{const E=Ht(l||"");d&&(M.value=!0),S=!d,at.reset(),b.value=pt(E),s.value=null,m.value=new Set,we(),Ve(),e.nextTick(()=>{S=!1,Ct()}),r("change",b.value)},setBalanced:l=>{ln.value=l},isBalanced:()=>ln.value,balance:()=>Wm(),applyNodeStyle:(l,d)=>O(l,d),getNodeStyle:l=>W(l),applyNodeImage:(l,d)=>oe(l,d),applyNodeImageByUrl:(l,d)=>te(l,d),removeNodeImage:l=>K(l),applyNodeLink:(l,d)=>F(l,d),removeNodeLink:l=>N(l),applyNodeNote:(l,d)=>$(l,d),removeNodeNote:l=>L(l),applyNodeRichContent:(l,d)=>j(l,d),undo:()=>Ne(),redo:()=>ze(),canUndo:()=>at.canUndo(),canRedo:()=>at.canRedo(),applySettings:l=>{l.autoBalanceOnChange!==void 0&&(Q.autoBalanceOnChange=l.autoBalanceOnChange),l.lineWidthStart!==void 0&&(Q.lineWidthStart=Math.max(.5,Math.min(20,l.lineWidthStart))),l.lineWidthEnd!==void 0&&(Q.lineWidthEnd=Math.max(.3,Math.min(10,l.lineWidthEnd))),l.rainbowBranch!==void 0&&(Q.rainbowBranch=l.rainbowBranch),l.branchPaletteId!==void 0&&(Q.branchPaletteId=l.branchPaletteId),l.customPalettes!==void 0&&(Q.customPalettes=l.customPalettes),l.lineStyle!==void 0&&(Q.lineStyle=l.lineStyle),l.taperedEdge!==void 0&&(Q.taperedEdge=l.taperedEdge),l.showOrderBadge!==void 0&&(Q.showOrderBadge=l.showOrderBadge)},getSettings:()=>({autoBalanceOnChange:Q.autoBalanceOnChange,lineWidthStart:Q.lineWidthStart,lineWidthEnd:Q.lineWidthEnd,rainbowBranch:Q.rainbowBranch,branchPaletteId:Q.branchPaletteId,customPalettes:Q.customPalettes,lineStyle:Q.lineStyle,layoutMode:Q.layoutMode,taperedEdge:Q.taperedEdge,showOrderBadge:Q.showOrderBadge}),setBranchPalette:l=>{if(!l)return;[...Nt,...Q.customPalettes].find(E=>E.id===l)&&(Q.branchPaletteId=l)},getBranchPalette:()=>Q.branchPaletteId,getBranchPalettes:()=>[...Nt,...Q.customPalettes]}),e.watch(()=>i.data,l=>{b.value=pt(l),we()},{deep:!1}),e.onMounted(()=>{Ve(),e.nextTick(()=>Ct())}),(l,d)=>{var E,V,I,P,q,re,Se;return e.openBlock(),e.createElementBlock("div",{class:"zm-mindmap",style:e.normalizeStyle({background:Ie.value.bgColor,fontSize:Ie.value.fontSize+"px"})},[e.createElementVNode("div",{ref_key:"wrapperRef",ref:a,class:"zm-canvas",onMousedown:Pm,onContextmenu:B,onWheel:d[27]||(d[27]=(...R)=>e.unref(ne).onWheel&&e.unref(ne).onWheel(...R)),onMouseenter:d[28]||(d[28]=R=>p.value=!0),onMouseleave:d[29]||(d[29]=R=>p.value=!1),onClick:Fm},[e.createElementVNode("div",{class:"zm-svg-layer",style:e.normalizeStyle({left:$e.value.vbX*e.unref(ne).scale.value+e.unref(ne).offsetX.value+"px",top:$e.value.vbY*e.unref(ne).scale.value+e.unref(ne).offsetY.value+"px",width:$e.value.vbW*e.unref(ne).scale.value+"px",height:$e.value.vbH*e.unref(ne).scale.value+"px"})},[(e.openBlock(),e.createElementBlock("svg",{class:"zm-svg",viewBox:mn.value,preserveAspectRatio:"xMinYMin meet",width:$e.value.vbW*e.unref(ne).scale.value,height:$e.value.vbH*e.unref(ne).scale.value},[e.createElementVNode("g",ja,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_n.value,R=>(e.openBlock(),e.createElementBlock("path",{key:R.key,d:Zo(Ur(R.from,"out",R.to.side,R.to),Ur(R.to,"in"),sn(R.from.depth),cn(R.to.depth),32,Q.lineStyle,R.to._dir),fill:Bt(R.from,R.to),stroke:"none"},null,8,Ka))),128))])],8,Ga))],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),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(un.value,R=>(e.openBlock(),e.createElementBlock("div",{key:R.id,class:e.normalizeClass(["zm-node",{"is-root":R.isRoot,"is-selected":s.value===R.id,"is-editing":c.value===R.id,"has-image":!!R.image,"is-resizing":yt.value===R.id}]),"data-node-id":R.id,style:e.normalizeStyle({left:R.x+"px",top:R.y+"px",width:R.width+"px",minWidth:R.width+"px",height:R.height+"px",fontSize:R.fontSize+"px",background:Jo(R),color:Qn(R),borderColor:Tn(R),fontWeight:eo(R),transform:"translate(-50%, -50%)"}),onClick:fe=>$m(fe,R),onDblclick:fe=>{fe.stopPropagation(),t.previewMode||xt(R.id)},onContextmenu:fe=>Le(fe,R),onMouseenter:fe=>{He(R.id),Pt(fe,R)},onMouseleave:fe=>et(R.id)},[R.image?(e.openBlock(),e.createElementBlock("img",{key:0,class:"zm-node-img",src:R.image.src,width:R.image.width,height:R.image.height,alt:R.text,draggable:"false"},null,8,Ya)):e.createCommentVNode("",!0),R.richContent&&(R.richContent.kind==="code"||R.richContent.kind==="table")&&c.value!==R.id?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["zm-rich zm-rich-above",{"zm-rich-no-overflow":R.richContent.kind==="table"||R.richContent.kind==="code"}]),onClick:d[1]||(d[1]=e.withModifiers(()=>{},["stop"])),onDblclick:e.withModifiers(fe=>io(R.id),["stop"]),onMousedown:d[2]||(d[2]=e.withModifiers(()=>{},["stop"]))},[y.value===R.id?e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:0,"onUpdate:modelValue":d[0]||(d[0]=fe=>w.value=fe),class:"zm-rich-edit",spellcheck:"false",onBlur:ro,onKeydown:ao},null,544)),[[e.vModelText,w.value]]):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[R.richContent.kind==="code"?(e.openBlock(),e.createElementBlock("pre",Xa,[e.createElementVNode("code",{innerHTML:e.unref(To)(e.unref(So)(R.richContent.raw),e.unref(qt)(R.richContent.raw))},null,8,Ja)])):R.richContent.kind==="table"?(e.openBlock(),e.createElementBlock("table",Qa,[e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(zt(R.id,e.unref(nr)(R.richContent.raw)),(fe,it)=>(e.openBlock(),e.createElementBlock("tr",{key:it},[it===0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(fe,(st,Ke)=>{var Mn,Rn,Bn,zn,wt;return e.openBlock(),e.createElementBlock("th",{key:`h${Ke}`,class:e.normalizeClass(["zm-rich-table-sort",{"is-sorted":((Mn=k.value.get(R.id))==null?void 0:Mn.col)===Ke,"is-asc":((Rn=k.value.get(R.id))==null?void 0:Rn.col)===Ke&&((Bn=k.value.get(R.id))==null?void 0:Bn.dir)==="asc","is-desc":((zn=k.value.get(R.id))==null?void 0:zn.col)===Ke&&((wt=k.value.get(R.id))==null?void 0:wt.dir)==="desc"}]),onClick:e.withModifiers(Gr=>fn(R.id,Ke),["stop"])},[e.createElementVNode("span",null,e.toDisplayString(st),1),e.createElementVNode("span",ts,e.toDisplayString(J(R.id,Ke)),1)],10,es)}),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(fe,(st,Ke)=>(e.openBlock(),e.createElementBlock("td",{key:`c${Ke}`},e.toDisplayString(st),1))),128))]))),128))])])):e.createCommentVNode("",!0)],64))],42,Za)):e.createCommentVNode("",!0),c.value!==R.id?(e.openBlock(),e.createElementBlock("span",ns,[e.createElementVNode("span",os,e.toDisplayString(R.text),1),R.link&&!c.value?(e.openBlock(),e.createElementBlock("a",{key:0,class:"zm-node-link",href:R.link.url,target:"_blank",rel:"noopener noreferrer",title:`打开链接:${R.link.url}`,onClick:d[3]||(d[3]=e.withModifiers(()=>{},["stop"])),onMousedown:d[4]||(d[4]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(xe,{name:"link",size:11,stroke:2})],40,is)):e.createCommentVNode("",!0),R.note&&!c.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-node-note-btn",type:"button",title:kt(R.note.text),onClick:e.withModifiers(fe=>ye(R.id),["stop"]),onMousedown:d[5]||(d[5]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(xe,{name:"note",size:11,stroke:2})],40,rs)):e.createCommentVNode("",!0)])):e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:3,class:"zm-input","onUpdate:modelValue":d[6]||(d[6]=fe=>u.value=fe),autofocus:"",onBlur:d[7]||(d[7]=fe=>tt()),onKeydown:[d[8]||(d[8]=e.withKeys(e.withModifiers(fe=>tt({addSibling:"after"}),["exact"]),["enter"])),d[9]||(d[9]=e.withKeys(e.withModifiers(fe=>tt({addSibling:"before"}),["shift","prevent","exact"]),["enter"])),d[10]||(d[10]=e.withKeys(e.withModifiers(fe=>tt({addChild:!0}),["prevent"]),["tab"])),e.withKeys(oo,["esc"]),f],onMousedown:d[11]||(d[11]=e.withModifiers(()=>{},["stop"])),onClick:d[12]||(d[12]=e.withModifiers(()=>{},["stop"]))},null,544)),[[e.vModelText,u.value]]),A.value?(e.openBlock(),e.createElementBlock("span",{key:4,class:"zm-order-badge",title:`数据顺序:第 ${Fr(R.id)+1} 个`},e.toDisplayString(Fr(R.id)+1),9,ls)):e.createCommentVNode("",!0),Pr(R.id)&&Qo(R.id)>0?(e.openBlock(),e.createElementBlock("span",{key:5,class:e.normalizeClass(["zm-collapse-badge",{"is-on-left":R.side===-1}]),style:e.normalizeStyle({background:Ce.value.get(R.id)??"#64748b"}),title:`展开 ${Qo(R.id)} 个子节点`,onMousedown:d[13]||(d[13]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(fe=>pn(R.id),["stop"])},e.toDisplayString(Qo(R.id)),47,as)):e.createCommentVNode("",!0),Hm(R)&&!Pr(R.id)?(e.openBlock(),e.createElementBlock("button",{key:6,class:e.normalizeClass(["zm-btn zm-collapse",{"is-on-left":R.side===-1}]),style:e.normalizeStyle({color:Ce.value.get(R.id)??"#64748b",borderColor:Ce.value.get(R.id)??"#64748b"}),title:"折叠",onMousedown:d[14]||(d[14]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(fe=>pn(R.id),["stop"])},[e.createVNode(xe,{name:"minus",size:10,stroke:2.4})],46,ss)):e.createCommentVNode("",!0),R.image&&s.value===R.id&&c.value!==R.id?(e.openBlock(),e.createElementBlock("span",{key:7,class:"zm-img-resize-handle",title:"拖动调整图片大小",onMousedown:e.withModifiers(fe=>U(fe,R),["stop"])},null,40,cs)):e.createCommentVNode("",!0),R.image&&s.value===R.id&&c.value!==R.id?(e.openBlock(),e.createElementBlock("button",{key:8,class:"zm-img-remove-btn",title:"移除图片",onMousedown:d[15]||(d[15]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(fe=>K(R.id),["stop"])},[e.createVNode(xe,{name:"x",size:9,stroke:2.2})],40,ds)):e.createCommentVNode("",!0)],46,qa))),128))],4),g.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["zm-tooltip",{"is-below":!g.value.above}]),style:e.normalizeStyle({left:g.value.x+"px",top:g.value.y+"px"})},e.toDisplayString(g.value.text),7)):e.createCommentVNode("",!0),X.value?(e.openBlock(),e.createBlock(zl,{key:2,x:X.value.x,y:X.value.y,container:a.value,"has-image":!!((E=e.unref(pe)(b.value,X.value.nodeId))!=null&&E.image),"has-link":!!((V=e.unref(pe)(b.value,X.value.nodeId))!=null&&V.link),"has-note":!!((I=e.unref(pe)(b.value,X.value.nodeId))!=null&&I.note),"has-code":((q=(P=e.unref(pe)(b.value,X.value.nodeId))==null?void 0:P.richContent)==null?void 0:q.kind)==="code","has-table":((Se=(re=e.unref(pe)(b.value,X.value.nodeId))==null?void 0:re.richContent)==null?void 0:Se.kind)==="table",onPickImage:ue,onRemoveImage:on,onSetLink:me,onRemoveLink:De,onEditNote:Ze,onRemoveNote:Ge,onAddCode:St,onEditCode:St,onRemoveCode:ee,onAddTable:mt,onEditTable:mt,onRemoveTable:Me,onClose:v},null,8,["x","y","container","has-image","has-link","has-note","has-code","has-table"])):e.createCommentVNode("",!0),ge.value?(e.openBlock(),e.createBlock(Ol,{key:3,x:ge.value.x,y:ge.value.y,container:a.value,onOpenSettings:ae,onOpenData:D,onOpenImport:T,onClose:ie},null,8,["x","y","container"])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(Be.value),title:i.previewMode?"退出预览模式":"进入预览模式",onClick:d[16]||(d[16]=R=>r("canvas-toggle-preview"))},[e.createVNode(xe,{name:i.previewMode?"eye-off":"eye",size:16},null,8,["name"])],10,us),e.createElementVNode("button",{class:e.normalizeClass(Ue.value),title:"显示大纲视图",onClick:d[17]||(d[17]=R=>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":p.value}])},[e.createElementVNode("span",ms,e.toDisplayString(Math.round(e.unref(ne).scale.value*100))+"%",1),e.createElementVNode("button",{class:"zm-tb-btn",title:"放大",onClick:d[18]||(d[18]=(...R)=>e.unref(ne).zoomIn&&e.unref(ne).zoomIn(...R))},[e.createVNode(xe,{name:"zoom-in"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"缩小",onClick:d[19]||(d[19]=(...R)=>e.unref(ne).zoomOut&&e.unref(ne).zoomOut(...R))},[e.createVNode(xe,{name:"zoom-out"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"重置视图",onClick:Ct},[e.createVNode(xe,{name:"reset"})]),d[33]||(d[33]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"全部收起",onClick:so},[e.createVNode(xe,{name:"collapse-all"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"展开一级",onClick:d[20]||(d[20]=R=>An(1))},[e.createVNode(xe,{name:"expand-level-1"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"展开二级",onClick:d[21]||(d[21]=R=>An(2))},[e.createVNode(xe,{name:"expand-level-2"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"全部展开",onClick:Lm},[e.createVNode(xe,{name:"expand-all"})]),d[34]||(d[34]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"导出 JSON",onClick:jm},[e.createVNode(xe,{name:"export"})]),i.previewMode?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[d[30]||(d[30]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"添加子节点 (Tab)",onClick:d[22]||(d[22]=R=>s.value&&z(s.value))},[e.createElementVNode("img",{src:e.unref(ri),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,fs)]),e.createElementVNode("button",{class:"zm-tb-btn",title:"添加同级 (Enter)",onClick:d[23]||(d[23]=R=>s.value&&H(s.value))},[e.createElementVNode("img",{src:e.unref(ii),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,ps)]),d[31]||(d[31]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:Q.layoutMode==="mindmap"}]),title:"思维导图布局 (中心辐射)",onClick:d[24]||(d[24]=R=>ei("mindmap"))},[e.createVNode(xe,{name:"mindmap"})],2),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:Q.layoutMode==="tree"}]),title:"树形布局 (向右展开)",onClick:d[25]||(d[25]=R=>ei("tree"))},[e.createVNode(xe,{name:"tree"})],2),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:Q.layoutMode==="org"}]),title:"组织结构布局 (向下展开)",onClick:d[26]||(d[26]=R=>ei("org"))},[e.createVNode(xe,{name:"org"})],2),d[32]||(d[32]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"导入 JSON",onClick:Gm},[e.createVNode(xe,{name:"import"})])],64))],2)],544)],4)}}}),gs={class:"zm-outline-root"},hs={class:"zm-outline-actions"},bs={width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},ks={key:0,x:"9",y:"9",width:"13",height:"13",rx:"2"},ys={key:1,d:"M5 12 L10 17 L19 7"},Es={class:"zm-outline"},xs=["onClick","onDblclick","onDragstart","onDragover","onDragleave","onDrop"],ws=["title","onClick"],Ns={width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round"},Ss={key:0,points:"6 9 12 15 18 9"},Ts={key:1,points:"9 6 15 12 9 18"},Cs={key:1,class:"zm-outline-dot"},_s={class:"zm-outline-index"},As={key:3,class:"zm-outline-text"},Ms=["onClick"],Rs=["src"],Bs=["onClick"],zs=["src"],Os=["title","onClick"],Is={width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},vs={key:0,x:"9",y:"9",width:"13",height:"13",rx:"2"},Ls={key:1,d:"M5 12 L10 17 L19 7"},Co=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 G=[],Y=(F,N,$)=>{const L=F.children.length>0,j=n.collapsedIds.has(F.id);G.push({id:F.id,text:F.text||"(无标题)",depth:N,siblingIndex:$,hasChildren:L,collapsed:j,node:F}),L&&!j&&F.children.forEach((X,ge)=>Y(X,N+1,ge))};return Y(n.data,0,0),G}),a=e.ref(null),c=e.ref("");let u=null;function s(G){n.readonly||(a.value=G.id,c.value=G.text,e.nextTick(()=>{u=document.querySelector(".zm-outline-input"),u==null||u.focus(),u==null||u.select()}))}function m(){a.value!=null&&(i("edit",{id:a.value,text:c.value.trim()||"(无标题)"}),p())}function p(){a.value=null,c.value="",u=null}function g(G){G.key==="Enter"?(G.preventDefault(),m()):G.key==="Escape"&&(G.preventDefault(),p())}e.onBeforeUnmount(p);const y=e.ref(null),w=e.ref(null),k=e.ref(null);function b(G,Y){if(n.readonly){G.preventDefault();return}y.value={id:Y.id,text:Y.text},G.dataTransfer&&(G.dataTransfer.effectAllowed="move",G.dataTransfer.setData("text/plain",Y.id))}function _(){y.value=null,w.value=null,k.value=null}function x(G,Y){if(!y.value)return;G.preventDefault(),G.dataTransfer&&(G.dataTransfer.dropEffect="move");const F=A(G);w.value=Y.id,k.value=F}function M(G){w.value===G.id&&(w.value=null,k.value=null)}function S(G,Y){G.preventDefault();const F=y.value;if(!F)return;const N=A(G);F.id!==Y.id&&i("move",{srcId:F.id,targetId:Y.id,position:N}),_()}function A(G,Y){const N=G.currentTarget.getBoundingClientRect(),$=G.clientY-N.top,L=N.height;return $<L*.3?"before":$>L*.7?"after":"child"}const C=e.ref(null);let h=null;async function O(G){try{return await navigator.clipboard.writeText(G),!0}catch{const Y=document.createElement("textarea");Y.value=G,document.body.appendChild(Y),Y.select();let F=!1;try{F=document.execCommand("copy")}finally{document.body.removeChild(Y)}return F}}async function W(G,Y,F){G.stopPropagation(),await O(Y)&&(C.value=F,h&&clearTimeout(h),h=setTimeout(()=>C.value=null,1200))}const oe=e.computed(()=>{const G=[],Y=(F,N)=>{const $=" ".repeat(N),L=N===0?"":"- ";G.push($+L+(F.text||""));for(const j of F.children)Y(j,N+1)};return Y(n.data,0),G.join(`
23
+ `)}),K=e.ref(!1);let te=null;async function le(){await O(oe.value)&&(K.value=!0,te&&clearTimeout(te),te=setTimeout(()=>K.value=!1,1200))}return(G,Y)=>(e.openBlock(),e.createElementBlock("div",gs,[e.createElementVNode("div",hs,[e.createElementVNode("button",{class:e.normalizeClass(["zm-outline-action-btn",{"is-success":K.value}]),title:"复制完整大纲为纯文本",onClick:le},[(e.openBlock(),e.createElementBlock("svg",bs,[K.value?(e.openBlock(),e.createElementBlock("path",ys)):(e.openBlock(),e.createElementBlock("rect",ks)),Y[2]||(Y[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(K.value?"已复制":"复制大纲"),1)],2)]),e.createElementVNode("ul",Es,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,F=>(e.openBlock(),e.createElementBlock("li",{key:F.id,class:e.normalizeClass(["zm-outline-row",{"is-selected":F.id===t.selectedId,"is-root":F.depth===0,"is-editing":a.value===F.id,"is-drag-over-before":w.value===F.id&&k.value==="before","is-drag-over-after":w.value===F.id&&k.value==="after","is-drag-over-child":w.value===F.id&&k.value==="child"}]),style:e.normalizeStyle({paddingLeft:12+F.depth*16+"px"}),draggable:"true",onClick:N=>i("select",F.node),onDblclick:N=>s(F),onDragstart:N=>b(N,F),onDragend:_,onDragover:N=>x(N,F),onDragleave:()=>M(F),onDrop:N=>S(N,F)},[F.hasChildren?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-outline-toggle",title:F.collapsed?"展开":"折叠",onClick:e.withModifiers(N=>i("toggleCollapse",F.id),["stop"])},[(e.openBlock(),e.createElementBlock("svg",Ns,[F.collapsed?(e.openBlock(),e.createElementBlock("polyline",Ts)):(e.openBlock(),e.createElementBlock("polyline",Ss))]))],8,ws)):(e.openBlock(),e.createElementBlock("span",Cs)),e.createElementVNode("span",_s,e.toDisplayString(F.siblingIndex+1)+".",1),a.value===F.id?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,"onUpdate:modelValue":Y[0]||(Y[0]=N=>c.value=N),class:"zm-outline-input",onBlur:m,onKeydown:g,onClick:Y[1]||(Y[1]=e.withModifiers(()=>{},["stop"]))},null,544)),[[e.vModelText,c.value]]):(e.openBlock(),e.createElementBlock("span",As,e.toDisplayString(F.text),1)),n.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:4,class:"zm-outline-row-action",title:"添加同级",onClick:e.withModifiers(N=>i("addSibling",F.id),["stop"])},[e.createElementVNode("img",{src:e.unref(ii),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,Rs)],8,Ms)),n.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:5,class:"zm-outline-row-action",title:"添加子节点",onClick:e.withModifiers(N=>i("addChild",F.id),["stop"])},[e.createElementVNode("img",{src:e.unref(ri),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,zs)],8,Bs)),e.createElementVNode("button",{class:e.normalizeClass(["zm-outline-row-copy",{"is-success":C.value===F.id}]),title:C.value===F.id?"已复制":"复制节点文本",onClick:N=>W(N,F.text,F.id)},[(e.openBlock(),e.createElementBlock("svg",Is,[C.value!==F.id?(e.openBlock(),e.createElementBlock("rect",vs)):(e.openBlock(),e.createElementBlock("path",Ls)),Y[3]||(Y[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,Os)],46,xs))),128))])]))}}),Ds=["aria-hidden"],Vs={key:0,class:"zm-drawer-header"},$s={key:0,class:"zm-drawer-title"},Ps={class:"zm-drawer-body"},Zt=e.defineComponent({__name:"Drawer",props:{side:{default:"left"},width:{default:320},open:{type:Boolean,default:!0},title:{default:""}},emits:["update:open"],setup(t,{emit:o}){const n=o;function i(){n("update:open",!1)}return(r,a)=>(e.openBlock(),e.createBlock(e.Transition,{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||r.$slots.header?(e.openBlock(),e.createElementBlock("div",Vs,[t.title?(e.openBlock(),e.createElementBlock("h3",$s,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.renderSlot(r.$slots,"header"),e.createElementVNode("button",{class:"zm-drawer-close",title:"关闭",onClick:i},[...a[0]||(a[0]=[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.createElementVNode("div",Ps,[e.renderSlot(r.$slots,"default")])],14,Ds)):e.createCommentVNode("",!0)]),_:3}))}}),Fs={key:0,class:"zm-jtv-root"},Us={key:0,class:"zm-jtv-key"},Hs={key:1,class:"zm-jtv-colon"},Ws={key:2,class:"zm-jtv-key zm-jtv-bracket"},Gs={key:3,class:"zm-jtv-size"},js={key:4,class:"zm-jtv-bracket"},Ks={key:5,class:"zm-jtv-brace"},qs={key:0,class:"zm-jtv-children"},Ys={class:"zm-jtv-key"},Zs={key:0,class:"zm-jtv-key"},Xs=["src","alt"],Js=["href"],Qs=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 a=e.computed(()=>{if(r.value)return`Array(${o.value.length})`;if(i.value){const M=o.value,S=Object.keys(M);return`Object(${S.length} ${S.length===1?"key":"keys"})`}return""}),c=e.computed(()=>r.value?o.value.map((M,S)=>({key:String(S),value:M})):i.value?Object.entries(o.value).map(([M,S])=>({key:M,value:S})):[]),u=e.computed(()=>o.isRoot?"<root>":o.path),s=e.computed(()=>o.collapsedPaths.has(u.value));function m(M,S,A){M!=="<root>"&&(A<2||S===null||typeof S!="object"||o.collapsedPaths.has(M)||o.collapsedPaths.add(M))}o.isRoot||m(u.value,o.value,o.depth);function p(){s.value?o.collapsedPaths.delete(u.value):o.collapsedPaths.add(u.value)}function g(M){return u.value===""?M:`${u.value}.${M}`}function y(M){if(!o.query)return!0;const S=o.query.toLowerCase();return typeof M=="string"?M.toLowerCase().includes(S):M===null?"null".includes(S):String(M).toLowerCase().includes(S)}function w(M){return o.query?M.toLowerCase().includes(o.query.toLowerCase()):!0}function k(M,S){return!o.query||w(M)?!0:S===null||typeof S!="object"?y(S):!0}function b(M){return M===null?"null":typeof M=="string"?M.length>80?`"${M.slice(0,80)}..."`:`"${M}"`:typeof M=="boolean"?M?"true":"false":typeof M=="number"?String(M):typeof M>"u"?"undefined":JSON.stringify(M)}function _(M){if(typeof M!="string")return!1;const S=M.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(M){if(!o.query)return null;const S=M.toLowerCase().indexOf(o.query.toLowerCase());return S<0?null:{before:M.slice(0,S),match:M.slice(S,S+o.query.length),after:M.slice(S+o.query.length)}}return(M,S)=>{var C,h,O,W,oe,K;const A=e.resolveComponent("JsonTreeViewer",!0);return t.isRoot?(e.openBlock(),e.createElementBlock("div",Fs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,te=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:te.key,class:"zm-jtv-row"},[e.createVNode(A,{"key-name":te.key,value:te.value,path:g(te.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,k(te.key,te.value)]])),128))])):i.value||r.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["zm-jtv-branch",{"is-collapsed":s.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(s.value?"▶":"▼"),1),r.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",Us,e.toDisplayString(t.keyName),1)),r.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",Hs,":")),r.value?(e.openBlock(),e.createElementBlock("span",Ws,"[")):e.createCommentVNode("",!0),s.value?(e.openBlock(),e.createElementBlock("span",Gs,e.toDisplayString(a.value),1)):e.createCommentVNode("",!0),s.value&&r.value?(e.openBlock(),e.createElementBlock("span",js,"]")):e.createCommentVNode("",!0),s.value&&i.value?(e.openBlock(),e.createElementBlock("span",Ks,"}")):e.createCommentVNode("",!0)],4),s.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",qs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,te=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:te.key,class:"zm-jtv-row"},[e.createVNode(A,{"key-name":te.key,value:te.value,path:g(te.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,k(te.key,te.value)]])),128))])),!s.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),!s.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",Ys,e.toDisplayString(t.keyName),1),S[3]||(S[3]=e.createElementVNode("span",{class:"zm-jtv-colon"},":",-1)),w(t.keyName)&&x(t.keyName)?(e.openBlock(),e.createElementBlock("span",Zs,[e.createElementVNode("span",null,e.toDisplayString((C=x(t.keyName))==null?void 0:C.before),1),e.createElementVNode("mark",null,e.toDisplayString((h=x(t.keyName))==null?void 0:h.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(b(t.value))?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("span",null,e.toDisplayString((W=x(b(t.value)))==null?void 0:W.before),1),e.createElementVNode("mark",null,e.toDisplayString((oe=x(b(t.value)))==null?void 0:oe.match),1),e.createElementVNode("span",null,e.toDisplayString((K=x(b(t.value)))==null?void 0:K.after),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(b(t.value)),1)],64))],2),_(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,Xs),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,Js)])):e.createCommentVNode("",!0)],4))}}}),ec={class:"zm-data-panel"},tc={class:"zm-data-header"},nc={class:"zm-data-title"},oc={class:"zm-data-title-meta"},ic={class:"zm-data-toolbar"},rc=["title"],lc={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"},sc={key:0,class:"zm-data-paste"},cc={class:"zm-data-tabs"},dc=["placeholder"],uc={key:0,class:"zm-data-error"},mc={class:"zm-data-paste-actions"},fc=["disabled"],pc={class:"zm-data-tree"},_o=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)),a=e.ref(""),c=e.ref(null),u=e.ref(!1),s=e.ref("json"),m=e.ref("idle"),p=e.ref(new Set),g=e.ref("");e.watch(()=>n.pendingMode,S=>{S&&(u.value=!0,s.value=S,i("consumed-mode"))},{immediate:!0});async function y(){try{await navigator.clipboard.writeText(r.value),m.value="copied",setTimeout(()=>m.value="idle",1500)}catch{const S=document.createElement("textarea");S.value=r.value,document.body.appendChild(S),S.select();try{document.execCommand("copy"),m.value="copied",setTimeout(()=>m.value="idle",1500)}finally{document.body.removeChild(S)}}}function w(){const S=new Blob([r.value],{type:"application/json"}),A=URL.createObjectURL(S),C=document.createElement("a");C.href=A,C.download=`${n.data.text||"mindmap"}.json`,C.click(),URL.revokeObjectURL(A)}function k(){c.value=null;const S=a.value.trim();if(S){if(s.value==="markdown"||s.value==="txt"){try{const A=Ht(S);i("import",A),a.value="",u.value=!1}catch(A){c.value=(s.value==="txt"?"TXT 解析失败:":"Markdown 解析失败:")+A.message}return}try{const A=JSON.parse(S);if(!A.id||!Array.isArray(A.children)){c.value="JSON 缺少 id 或 children 字段";return}i("import",A),a.value="",u.value=!1}catch(A){c.value="JSON 解析失败:"+A.message}}}function b(S){return 1+S.children.reduce((A,C)=>A+b(C),0)}const _=e.computed(()=>b(n.data)),x=e.computed(()=>r.value.length);function M(){const S=document.createElement("input");S.type="file",S.accept="application/json",S.onchange=()=>{var h;const A=(h=S.files)==null?void 0:h[0];if(!A)return;const C=new FileReader;C.onload=()=>{typeof C.result=="string"&&(a.value=C.result,k())},C.readAsText(A)},S.click()}return(S,A)=>(e.openBlock(),e.createElementBlock("div",ec,[e.createElementVNode("div",tc,[e.createElementVNode("div",nc,[A[8]||(A[8]=e.createElementVNode("span",{class:"zm-data-title-text"},"数据 JSON",-1)),e.createElementVNode("span",oc,e.toDisplayString(_.value)+" 节点 · "+e.toDisplayString(x.value)+" chars",1)])]),e.createElementVNode("div",ic,[e.createElementVNode("button",{class:e.normalizeClass(["zm-data-btn is-icon",{"is-success":m.value==="copied"}]),title:m.value==="copied"?"已复制":"复制 JSON 到剪贴板",onClick:y},[m.value==="idle"?(e.openBlock(),e.createElementBlock("svg",lc,[...A[9]||(A[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,[...A[10]||(A[10]=[e.createElementVNode("polyline",{points:"5 12 10 17 19 7"},null,-1)])])),A[11]||(A[11]=e.createElementVNode("span",{class:"zm-data-btn-label"},"复制",-1))],10,rc),e.createElementVNode("button",{class:"zm-data-btn is-icon",title:"导出为 JSON 文件",onClick:w},[...A[12]||(A[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:M},[...A[13]||(A[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:A[0]||(A[0]=C=>u.value=!u.value)},[...A[14]||(A[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),A[16]||(A[16]=e.createElementVNode("div",{class:"zm-data-toolbar-spacer"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["zm-data-search",{"is-active":g.value.length>0}])},[A[15]||(A[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":A[1]||(A[1]=C=>g.value=C),type:"text",placeholder:"过滤 (键 / 值)",spellcheck:"false"},null,512),[[e.vModelText,g.value]]),g.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-data-search-clear",title:"清空过滤",onClick:A[2]||(A[2]=C=>g.value="")},"×")):e.createCommentVNode("",!0)],2)]),u.value?(e.openBlock(),e.createElementBlock("div",sc,[e.createElementVNode("div",cc,[e.createElementVNode("button",{class:e.normalizeClass(["zm-data-tab",{"is-active":s.value==="json"}]),onClick:A[3]||(A[3]=C=>s.value="json")},"JSON",2),e.createElementVNode("button",{class:e.normalizeClass(["zm-data-tab",{"is-active":s.value==="markdown"}]),onClick:A[4]||(A[4]=C=>s.value="markdown")},"Markdown",2)]),e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":A[5]||(A[5]=C=>a.value=C),placeholder:s.value==="json"?"paste a JSON tree to replace current data":"paste markdown - # / ## / ### become nodes",spellcheck:"false"},null,8,dc),[[e.vModelText,a.value]]),c.value?(e.openBlock(),e.createElementBlock("div",uc,e.toDisplayString(c.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",mc,[e.createElementVNode("button",{class:"zm-data-btn is-primary",disabled:!a.value,onClick:k},"应用",8,fc),e.createElementVNode("button",{class:"zm-data-btn",onClick:A[6]||(A[6]=C=>{a.value="",c.value=null})},"清空"),e.createElementVNode("button",{class:"zm-data-btn",onClick:A[7]||(A[7]=C=>u.value=!1)},"关闭")])])):e.createCommentVNode("",!0),e.createElementVNode("div",pc,[e.createVNode(Qs,{value:t.data,query:g.value,"collapsed-paths":p.value},null,8,["value","query","collapsed-paths"])]),A[17]||(A[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))]))}}),gc={class:"zm-md-panel"},hc={key:0,class:"zm-md-error"},bc={class:"zm-md-split"},kc={class:"zm-md-edit"},yc={class:"zm-md-preview"},Ec={class:"zm-md-preview-body"},xc={class:"zm-md-footer"},wc=["disabled"],Nc=`# flow-mindmap 思维导图
24
+
25
+ [GitHub 仓库](https://github.com/xz333221/flow-mindmap)
26
+
27
+ ![cover](https://placehold.co/600x300/3b82f6/ffffff?text=flow-mindmap+demo)
28
+
29
+ ## 项目概览
30
+ 一个现代、极简的思维导图工具 — xmind 风格,可作为 Vue 组件嵌入。
31
+
32
+ \`\`\`note
33
+ 这个 note 节点演示了多行笔记:
34
+ - 节点旁的笔记图标
35
+ - hover 显示 tooltip 预览
36
+ - 点击图标进入内联编辑
37
+ - 支持任意多行文本
38
+ \`\`\`
39
+
40
+ ## 核心功能
41
+
42
+ ### 节点编辑
43
+ - 增、删、改
44
+ - 拖拽布局
45
+
46
+ ### 视图
47
+ - 缩放与平移
48
+ - 多种布局模式
49
+
50
+ ### 数据
51
+ - 导入 / 导出 JSON
52
+ - 撤销 / 重做
53
+
54
+ ## 技术栈
55
+ - Vue 3 + Vite
56
+ - TypeScript
57
+ - 纯 SVG 渲染
58
+ - 零第三方运行时依赖
59
+
60
+ ## 开源协议
61
+ [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0)
62
+ `,Ao=e.defineComponent({__name:"MarkdownPanel",props:{data:{}},emits:["import"],setup(t,{emit:o}){const n=t,i=o,r=e.ref(Wt(n.data)),a=e.ref(null),c=e.ref(null),u=e.computed(()=>{try{const _=Ht(r.value||"");return a.value=null,_}catch(_){return a.value=_.message,{id:"preview_fallback",text:r.value||"(空)",children:[]}}}),s=e.computed(()=>pt(u.value));let m=null;e.watch(r,()=>{m&&clearTimeout(m),m=setTimeout(()=>{var _;return(_=c.value)==null?void 0:_.resetView()},250)});function p(){try{const _=Ht(r.value||"");a.value=null,i("import",_)}catch(_){a.value=_.message}}function g(){r.value=Wt(n.data),a.value=null,e.nextTick(()=>{var _;return(_=c.value)==null?void 0:_.resetView()})}function y(){r.value="",a.value=null,e.nextTick(()=>{var _;return(_=c.value)==null?void 0:_.resetView()})}function w(){const _=document.createElement("input");_.type="file",_.accept=".md,text/markdown,text/plain",_.onchange=()=>{var S;const x=(S=_.files)==null?void 0:S[0];if(!x)return;const M=new FileReader;M.onload=()=>{typeof M.result=="string"&&(r.value=M.result,a.value=null,e.nextTick(()=>{var A;return(A=c.value)==null?void 0:A.resetView()}))},M.readAsText(x)},_.click()}function k(){const _=new Blob([r.value],{type:"text/markdown;charset=utf-8"}),x=URL.createObjectURL(_),M=document.createElement("a");M.href=x;const S=(n.data.text||"mindmap").trim()||"mindmap";M.download=`${S}.md`,M.click(),URL.revokeObjectURL(x)}function b(){r.value=Nc,a.value=null,e.nextTick(()=>{var _;return(_=c.value)==null?void 0:_.resetView()})}return(_,x)=>(e.openBlock(),e.createElementBlock("div",gc,[e.createElementVNode("div",{class:"zm-md-toolbar"},[e.createElementVNode("button",{class:"zm-md-btn",title:"从 .md 文件加载",onClick:w},[...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:k},[...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:b},"示例"),e.createElementVNode("button",{class:"zm-md-btn",title:"覆盖为当前导图",onClick:g},"同步"),e.createElementVNode("button",{class:"zm-md-btn",title:"清空",onClick:y},"清空")]),a.value?(e.openBlock(),e.createElementBlock("div",hc,e.toDisplayString(a.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",bc,[e.createElementVNode("div",kc,[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]=M=>r.value=M),class:"zm-md-textarea",spellcheck:"false",placeholder:"# 标题…"},null,512),[[e.vModelText,r.value]])]),e.createElementVNode("div",yc,[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",Ec,[e.createVNode(Wn,{ref_key:"previewRef",ref:c,data:s.value,readonly:"","preview-mode":""},null,8,["data"])])])]),e.createElementVNode("div",xc,[e.createElementVNode("button",{class:"zm-md-btn is-primary",disabled:!r.value.trim(),onClick:p},"应用到导图",8,wc)])]))}}),Sc={class:"zm-settings-panel"},Tc={key:0,class:"zm-settings-section"},Cc={class:"zm-settings-row"},_c=["value"],Ac={class:"zm-slider"},Mc=["value"],Rc={class:"zm-settings-row"},Bc=["value"],zc={class:"zm-slider"},Oc=["value"],Ic={class:"zm-settings-row"},vc={class:"zm-line-style-group"},Lc=["title","onClick"],Dc=["viewBox"],Vc={key:0,d:"M 0 12 C 8 0, 20 0, 28 12",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},$c={key:1,x1:"0",y1:"12",x2:"28",y2:"12",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},Pc={class:"zm-line-style-label"},Fc={class:"zm-settings-row"},Uc={key:0,class:"zm-palette-picker"},Hc={class:"zm-palette-grid"},Wc=["title","onClick"],Gc={class:"zm-palette-card-name"},jc={class:"zm-palette-card-swatches"},Kc={key:0,class:"zm-palette-customs"},qc=["title","onClick"],Yc={class:"zm-palette-card-name"},Zc={class:"zm-palette-card-swatches"},Xc=["value","onInput"],Jc={class:"zm-palette-custom-actions"},Qc=["onClick"],ed=["onClick"],td={class:"zm-settings-row"},nd={class:"zm-settings-row"},od={class:"zm-settings-preview"},id={viewBox:"0 0 200 70",width:"100%",height:"70",preserveAspectRatio:"none"},rd=["x1","y1","x2","y2","stroke","stroke-width"],ld={key:1,class:"zm-settings-section"},ad={class:"zm-settings-row"},sd={class:"zm-settings-value-tag"},cd={class:"zm-settings-row"},dd={class:"zm-settings-value-tag"},ud={class:"zm-settings-row"},md={class:"zm-settings-value-tag"},fd={class:"zm-settings-row"},pd={key:2,class:"zm-settings-section"},gd={class:"zm-settings-section-title"},hd={key:0,class:"zm-settings-section-sub"},bd={class:"zm-settings-row"},kd={class:"zm-settings-value-tag"},yd={class:"zm-swatch-row"},Ed=["title","onClick"],xd={class:"zm-settings-row"},wd={class:"zm-settings-value-tag"},Nd={class:"zm-swatch-row"},Sd=["title","onClick"],Td={class:"zm-settings-row"},Cd={class:"zm-settings-section"},Mo=((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(C,h){i("update:settings",{[C]:h})}e.computed(()=>{const C=n.settings.lineWidthStart;return C<1.2?"细":C<2.5?"中":C<4?"粗":"极粗"}),e.computed(()=>{const C=n.settings.lineWidthEnd;return C<.6?"极细":C<1.2?"细":C<2?"中":"粗"});const a=[{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 s(){c.bg=void 0,c.textColor=void 0,c.borderColor=void 0,c.fontWeight=400,i("update:nodeStyle",{...c})}const m=e.reactive({});function p(C){return m[C.id]===void 0&&(m[C.id]=C.colors.join(`
63
+ `)),m[C.id]}function g(C){const h=m[C.id]??"",O=bl(h);if(O.length===0){m[C.id]=C.colors.join(`
64
+ `);return}const W=n.settings.customPalettes.map(oe=>oe.id===C.id?{...oe,colors:O}:oe);i("update:settings",{customPalettes:W})}function y(){const C=k.value.find(K=>K.id===n.settings.branchPaletteId),h=C?[...C.colors]:[...Nt[0].colors],O="custom-";let W=O+(n.settings.customPalettes.length+1);for(;Nt.some(K=>K.id===W)||n.settings.customPalettes.some(K=>K.id===W);)W=O+Math.random().toString(36).slice(2,7);const oe={id:W,name:`我的配色 ${n.settings.customPalettes.length+1}`,colors:h};i("update:settings",{customPalettes:[...n.settings.customPalettes,oe],branchPaletteId:W}),m[W]=h.join(`
65
+ `)}function w(C){const h=n.settings.customPalettes.filter(W=>W.id!==C.id),O=n.settings.branchPaletteId===C.id?"default":n.settings.branchPaletteId;i("update:settings",{customPalettes:h,...O!==n.settings.branchPaletteId?{branchPaletteId:O}:{}}),delete m[C.id]}const k=e.computed(()=>[...Nt,...n.settings.customPalettes]),b=["#f87171","#fb923c","#fbbf24","#a3e635","#34d399","#22d3ee","#818cf8","#c084fc","#1e2937","#f8fafc","#94a3b8"],_=[0,1,2,3],x=["#f87171","#fb923c","#34d399","#818cf8"];function M(C,h,O,W){if(h<=1)return O;const oe=C/(h-1);return O+(W-O)*oe}function S(C,h,O){return C<=0?h:C===1?Math.max(1.5,h*.67):C===2?Math.max(.8,h*.42):O}const A=e.computed(()=>{const C=n.settings.lineWidthStart,h=n.settings.lineWidthEnd,O=n.settings.taperedEdge,W=_.length,oe=8,K=192,te=k.value.find(G=>G.id===n.settings.branchPaletteId),le=te&&te.colors.length?te.colors:x;return _.map((G,Y)=>{const F=10+Y*60/(W-1);return{x1:oe,y1:F,x2:K,y2:F,w:O?S(G,C,h):M(G,W,C,h),color:n.settings.rainbowBranch?le[Y%le.length]:"#94a3b8"}})});return(C,h)=>(e.openBlock(),e.createElementBlock("div",Sc,[t.hasSelection?(e.openBlock(),e.createElementBlock("section",ld,[h[32]||(h[32]=e.createElementVNode("h4",{class:"zm-settings-section-title"},"画布",-1)),e.createElementVNode("div",ad,[h[27]||(h[27]=e.createElementVNode("span",{class:"zm-settings-label"},"线条粗端",-1)),e.createElementVNode("span",sd,e.toDisplayString(t.settings.lineWidthStart.toFixed(1)),1)]),e.createElementVNode("div",cd,[h[28]||(h[28]=e.createElementVNode("span",{class:"zm-settings-label"},"线条细端",-1)),e.createElementVNode("span",dd,e.toDisplayString(t.settings.lineWidthEnd.toFixed(1)),1)]),e.createElementVNode("div",ud,[h[29]||(h[29]=e.createElementVNode("span",{class:"zm-settings-label"},"线条类型",-1)),e.createElementVNode("span",md,e.toDisplayString(t.settings.lineStyle==="curve"?"圆弧":"直线"),1)]),e.createElementVNode("label",fd,[h[31]||(h[31]=e.createElementVNode("span",{class:"zm-settings-label"},"一级分支彩虹色",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.rainbowBranch}]),onClick:h[7]||(h[7]=O=>r("rainbowBranch",!t.settings.rainbowBranch))},[...h[30]||(h[30]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),h[33]||(h[33]=e.createElementVNode("p",{class:"zm-settings-hint"},"画布级别的设置会影响整张图。",-1))])):(e.openBlock(),e.createElementBlock("section",Tc,[h[23]||(h[23]=e.createElementVNode("h4",{class:"zm-settings-section-title"},"画布",-1)),e.createElementVNode("div",Cc,[h[12]||(h[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:h[0]||(h[0]=O=>r("lineWidthStart",parseFloat(O.target.value)||0))},null,40,_c)]),e.createElementVNode("div",Ac,[e.createElementVNode("input",{type:"range",min:"0.4",max:"20",step:"0.2",value:t.settings.lineWidthStart,onInput:h[1]||(h[1]=O=>r("lineWidthStart",parseFloat(O.target.value)))},null,40,Mc)]),e.createElementVNode("div",Rc,[h[13]||(h[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:h[2]||(h[2]=O=>r("lineWidthEnd",parseFloat(O.target.value)||0))},null,40,Bc)]),e.createElementVNode("div",zc,[e.createElementVNode("input",{type:"range",min:"0.2",max:"6",step:"0.1",value:t.settings.lineWidthEnd,onInput:h[3]||(h[3]=O=>r("lineWidthEnd",parseFloat(O.target.value)))},null,40,Oc)]),e.createElementVNode("div",Ic,[h[14]||(h[14]=e.createElementVNode("span",{class:"zm-settings-label"},"线条类型",-1)),e.createElementVNode("div",vc,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(a,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",Vc)):(e.openBlock(),e.createElementBlock("line",$c))],8,Dc)),e.createElementVNode("span",Pc,e.toDisplayString(O.label),1)],10,Lc)),64))])]),e.createElementVNode("label",Fc,[h[16]||(h[16]=e.createElementVNode("span",{class:"zm-settings-label"},"一级分支彩虹色",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.rainbowBranch}]),onClick:h[4]||(h[4]=O=>r("rainbowBranch",!t.settings.rainbowBranch))},[...h[15]||(h[15]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),h[24]||(h[24]=e.createElementVNode("p",{class:"zm-settings-hint"},"关闭时所有线条使用统一的 lineColor。",-1)),t.settings.rainbowBranch?(e.openBlock(),e.createElementBlock("div",Uc,[h[17]||(h[17]=e.createElementVNode("h5",{class:"zm-palette-picker-title"},"配色方案",-1)),e.createElementVNode("div",Hc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(Nt),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",Gc,e.toDisplayString(O.name),1),e.createElementVNode("span",jc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(O.colors,(W,oe)=>(e.openBlock(),e.createElementBlock("span",{key:oe,class:"zm-palette-card-swatch",style:e.normalizeStyle({background:W})},null,4))),128))])],10,Wc))),128))]),t.settings.customPalettes.length?(e.openBlock(),e.createElementBlock("div",Kc,[(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",Yc,e.toDisplayString(O.name),1),e.createElementVNode("span",Zc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(O.colors,(W,oe)=>(e.openBlock(),e.createElementBlock("span",{key:oe,class:"zm-palette-card-swatch",style:e.normalizeStyle({background:W})},null,4))),128))])],10,qc),e.createElementVNode("textarea",{class:"zm-palette-textarea",rows:"2",spellcheck:"false",placeholder:"一行一个 hex,例如 #f87171",value:p(O),onInput:W=>m[O.id]=W.target.value},null,40,Xc),e.createElementVNode("div",Jc,[e.createElementVNode("button",{type:"button",class:"zm-data-btn is-primary",onClick:W=>g(O)},"保存",8,Qc),e.createElementVNode("button",{type:"button",class:"zm-data-btn",onClick:W=>w(O)},"删除",8,ed)])]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"zm-palette-add",onClick:y},"+ 新建配色")])):e.createCommentVNode("",!0),e.createElementVNode("label",td,[h[19]||(h[19]=e.createElementVNode("span",{class:"zm-settings-label"},"每条连线独立渐变",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.taperedEdge}]),onClick:h[5]||(h[5]=O=>r("taperedEdge",!t.settings.taperedEdge))},[...h[18]||(h[18]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),h[25]||(h[25]=e.createElementVNode("p",{class:"zm-settings-hint"}," 开启时每条边都从根部粗端收回到细端子端,父子边之间可能形成粗细跳变; 关闭时整棵树从最粗平滑过渡到最细,所有边连成一条带子。 ",-1)),e.createElementVNode("label",nd,[h[21]||(h[21]=e.createElementVNode("span",{class:"zm-settings-label"},"显示节点序号",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.showOrderBadge}]),onClick:h[6]||(h[6]=O=>r("showOrderBadge",!t.settings.showOrderBadge))},[...h[20]||(h[20]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),h[26]||(h[26]=e.createElementVNode("p",{class:"zm-settings-hint"}," 在每个节点右上角标注它是同级中的第几个 (1, 2, 3, ...), 方便对比画布位置与数据顺序。 ",-1)),e.createElementVNode("div",od,[(e.openBlock(),e.createElementBlock("svg",id,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(A.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,rd))),128))])),h[22]||(h[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",pd,[e.createElementVNode("h4",gd,[h[34]||(h[34]=e.createTextVNode(" 节点 ",-1)),t.selectedNodeText?(e.openBlock(),e.createElementBlock("span",hd,"“"+e.toDisplayString(t.selectedNodeText)+"”",1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",bd,[h[35]||(h[35]=e.createElementVNode("span",{class:"zm-settings-label"},"背景颜色",-1)),e.createElementVNode("span",kd,e.toDisplayString(c.bg||"默认"),1)]),e.createElementVNode("div",yd,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(b,O=>e.createElementVNode("button",{key:"bg-"+O,class:"zm-swatch",style:e.normalizeStyle({background:O}),title:O,onClick:W=>c.bg=O},null,12,Ed)),64)),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"清除",onClick:h[8]||(h[8]=O=>c.bg=void 0)},"∅")]),e.createElementVNode("div",xd,[h[36]||(h[36]=e.createElementVNode("span",{class:"zm-settings-label"},"文字颜色",-1)),e.createElementVNode("span",wd,e.toDisplayString(c.textColor||"默认"),1)]),e.createElementVNode("div",Nd,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(b,O=>e.createElementVNode("button",{key:"fg-"+O,class:"zm-swatch",style:e.normalizeStyle({background:O}),title:O,onClick:W=>c.textColor=O},null,12,Sd)),64)),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"清除",onClick:h[9]||(h[9]=O=>c.textColor=void 0)},"∅")]),e.createElementVNode("div",Td,[h[38]||(h[38]=e.createElementVNode("span",{class:"zm-settings-label"},"字重",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":c.fontWeight===600}]),onClick:h[10]||(h[10]=O=>c.fontWeight=c.fontWeight===600?400:600)},[...h[37]||(h[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:s},"清除该节点样式")]),h[39]||(h[39]=e.createElementVNode("p",{class:"zm-settings-hint"},"仅作用于当前节点,不影响子节点。",-1))])):e.createCommentVNode("",!0),e.createElementVNode("section",Cd,[e.createElementVNode("button",{class:"zm-settings-reset",onClick:h[11]||(h[11]=O=>i("reset"))},"恢复默认设置")])]))}}),[["__scopeId","data-v-17ef65d1"]]),ir=20;function _d(t,o){t.style.height="auto";const n=o.minRows*ir,i=o.maxRows>0?o.maxRows*ir: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 Ro(t,o={}){const n={minRows:o.minRows??3,maxRows:o.maxRows??12};function i(){const a=t.value;a&&_d(a,n)}function r(){i()}e.onMounted(async()=>{await e.nextTick();const a=t.value;a&&(a.addEventListener("input",r),i())}),e.watch(()=>{var a;return(a=t.value)==null?void 0:a.value},()=>i()),e.onBeforeUnmount(()=>{const a=t.value;a&&a.removeEventListener("input",r)})}function Bo(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Lt=Bo();function rr(t){Lt=t}var Dt={exec:()=>null};function Xt(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 be(t,o=""){let n=typeof t=="string"?t:t.source,i={replace:(r,a)=>{let c=typeof a=="string"?a:a.source;return c=c.replace(qe.caret,"$1"),n=n.replace(r,c),i},getRegex:()=>new RegExp(n,o)};return i}var Ad=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),qe={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:Xt(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Xt(t=>new RegExp(`^ {0,${t}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:Xt(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:Xt(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:Xt(t=>new RegExp(`^ {0,${t}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:Xt(t=>new RegExp(`^ {0,${t}}>`))},Md=/^(?:[ \t]*(?:\n|$))+/,Rd=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Bd=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,kn=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,zd=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,zo=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,lr=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ar=be(lr).replace(/bull/g,zo).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(),Od=be(lr).replace(/bull/g,zo).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(),Oo=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Id=/^[^\n]+/,Io=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,vd=be(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Io).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ld=be(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,zo).getRegex(),Gn="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",vo=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Dd=be("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",vo).replace("tag",Gn).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),sr=be(Oo).replace("hr",kn).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",Gn).getRegex(),Vd=be(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",sr).getRegex(),Lo={blockquote:Vd,code:Rd,def:vd,fences:Bd,heading:zd,hr:kn,html:Dd,lheading:ar,list:Ld,newline:Md,paragraph:sr,table:Dt,text:Id},cr=be("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",kn).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",Gn).getRegex(),$d={...Lo,lheading:Od,table:cr,paragraph:be(Oo).replace("hr",kn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",cr).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",Gn).getRegex()},Pd={...Lo,html:be(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",vo).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:Dt,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:be(Oo).replace("hr",kn).replace("heading",` *#{1,6} *[^
66
+ ]`).replace("lheading",ar).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Fd=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Ud=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,dr=/^( {2,}|\\)\n(?!\s*$)/,Hd=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Jt=/[\p{P}\p{S}]/u,jn=/[\s\p{P}\p{S}]/u,Do=/[^\s\p{P}\p{S}]/u,Wd=be(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,jn).getRegex(),ur=/(?!~)[\p{P}\p{S}]/u,Gd=/(?!~)[\s\p{P}\p{S}]/u,jd=/(?:[^\s\p{P}\p{S}]|~)/u,Kd=be(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Ad?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),mr=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,qd=be(mr,"u").replace(/punct/g,Jt).getRegex(),Yd=be(mr,"u").replace(/punct/g,ur).getRegex(),fr="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Zd=be(fr,"gu").replace(/notPunctSpace/g,Do).replace(/punctSpace/g,jn).replace(/punct/g,Jt).getRegex(),Xd=be(fr,"gu").replace(/notPunctSpace/g,jd).replace(/punctSpace/g,Gd).replace(/punct/g,ur).getRegex(),Jd=be("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Do).replace(/punctSpace/g,jn).replace(/punct/g,Jt).getRegex(),Qd=be(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Jt).getRegex(),eu="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",tu=be(eu,"gu").replace(/notPunctSpace/g,Do).replace(/punctSpace/g,jn).replace(/punct/g,Jt).getRegex(),nu=be(/\\(punct)/,"gu").replace(/punct/g,Jt).getRegex(),ou=be(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),iu=be(vo).replace("(?:-->|$)","-->").getRegex(),ru=be("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",iu).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Kn=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,lu=be(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Kn).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),pr=be(/^!?\[(label)\]\[(ref)\]/).replace("label",Kn).replace("ref",Io).getRegex(),gr=be(/^!?\[(ref)\](?:\[\])?/).replace("ref",Io).getRegex(),au=be("reflink|nolink(?!\\()","g").replace("reflink",pr).replace("nolink",gr).getRegex(),hr=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Vo={_backpedal:Dt,anyPunctuation:nu,autolink:ou,blockSkip:Kd,br:dr,code:Ud,del:Dt,delLDelim:Dt,delRDelim:Dt,emStrongLDelim:qd,emStrongRDelimAst:Zd,emStrongRDelimUnd:Jd,escape:Fd,link:lu,nolink:gr,punctuation:Wd,reflink:pr,reflinkSearch:au,tag:ru,text:Hd,url:Dt},su={...Vo,link:be(/^!?\[(label)\]\((.*?)\)/).replace("label",Kn).getRegex(),reflink:be(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Kn).getRegex()},$o={...Vo,emStrongRDelimAst:Xd,emStrongLDelim:Yd,delLDelim:Qd,delRDelim:tu,url:be(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",hr).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:be(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",hr).getRegex()},cu={...$o,br:be(dr).replace("{2,}","*").getRegex(),text:be($o.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},qn={normal:Lo,gfm:$d,pedantic:Pd},yn={normal:Vo,gfm:$o,breaks:cu,pedantic:su},du={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},br=t=>du[t];function gt(t,o){if(o){if(qe.escapeTest.test(t))return t.replace(qe.escapeReplace,br)}else if(qe.escapeTestNoEncode.test(t))return t.replace(qe.escapeReplaceNoEncode,br);return t}function kr(t){try{t=encodeURI(t).replace(qe.percentDecode,"%")}catch{return null}return t}function yr(t,o){var a;let n=t.replace(qe.findPipe,(c,u,s)=>{let m=!1,p=u;for(;--p>=0&&s[p]==="\\";)m=!m;return m?"|":" |"}),i=n.split(qe.splitPipe),r=0;if(i[0].trim()||i.shift(),i.length>0&&!((a=i.at(-1))!=null&&a.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(qe.slashPipe,"|");return i}function Rt(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 Er(t){let o=t.split(`
67
+ `),n=o.length-1;for(;n>=0&&qe.blankLine.test(o[n]);)n--;return o.length-n<=2?t:o.slice(0,n+1).join(`
68
+ `)}function uu(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 mu(t,o=0){let n=o,i="";for(let r of t)if(r===" "){let a=4-n%4;i+=" ".repeat(a),n+=a}else i+=r,n++;return i}function xr(t,o,n,i,r){let a=o.href,c=o.title||null,u=t[1].replace(r.other.outputLinkReplace,"$1");i.state.inLink=!0;let s={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:a,title:c,text:u,tokens:i.inlineTokens(u)};return i.state.inLink=!1,s}function fu(t,o,n){let i=t.match(n.other.indentCodeCompensation);if(i===null)return o;let r=i[1];return o.split(`
69
+ `).map(a=>{let c=a.match(n.other.beginningSpace);if(c===null)return a;let[u]=c;return u.length>=r.length?a.slice(r.length):a}).join(`
70
+ `)}var Yn=class{constructor(t){Ae(this,"options");Ae(this,"rules");Ae(this,"lexer");this.options=t||Lt}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]:Er(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=fu(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=Rt(n,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(n=i.trim())}return{type:"heading",raw:Rt(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:Rt(o[0],`
72
+ `)}}blockquote(t){let o=this.rules.block.blockquote.exec(t);if(o){let n=Rt(o[0],`
73
+ `).split(`
74
+ `),i="",r="",a=[];for(;n.length>0;){let c=!1,u=[],s;for(s=0;s<n.length;s++)if(this.rules.other.blockquoteStart.test(n[s]))u.push(n[s]),c=!0;else if(!c)u.push(n[s]);else break;n=n.slice(s);let m=u.join(`
75
+ `),p=m.replace(this.rules.other.blockquoteSetextReplace,`
76
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");i=i?`${i}
77
+ ${m}`:m,r=r?`${r}
78
+ ${p}`:p;let g=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,a,!0),this.lexer.state.top=g,n.length===0)break;let y=a.at(-1);if((y==null?void 0:y.type)==="code")break;if((y==null?void 0:y.type)==="blockquote"){let w=y,k=w.raw+`
79
+ `+n.join(`
80
+ `),b=this.blockquote(k);a[a.length-1]=b,i=i.substring(0,i.length-w.raw.length)+b.raw,r=r.substring(0,r.length-w.text.length)+b.text;break}else if((y==null?void 0:y.type)==="list"){let w=y,k=w.raw+`
81
+ `+n.join(`
82
+ `),b=this.list(k);a[a.length-1]=b,i=i.substring(0,i.length-y.raw.length)+b.raw,r=r.substring(0,r.length-w.raw.length)+b.raw,n=k.substring(a.at(-1).raw.length).split(`
83
+ `);continue}}return{type:"blockquote",raw:i,tokens:a,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 a=this.rules.other.listItemRegex(n),c=!1;for(;t;){let s=!1,m="",p="";if(!(o=a.exec(t))||this.rules.block.hr.test(t))break;m=o[0],t=t.substring(m.length);let g=mu(o[2].split(`
84
+ `,1)[0],o[1].length),y=t.split(`
85
+ `,1)[0],w=!g.trim(),k=0;if(this.options.pedantic?(k=2,p=g.trimStart()):w?k=o[1].length+1:(k=g.search(this.rules.other.nonSpaceChar),k=k>4?1:k,p=g.slice(k),k+=o[1].length),w&&this.rules.other.blankLine.test(y)&&(m+=y+`
86
+ `,t=t.substring(y.length+1),s=!0),!s){let b=this.rules.other.nextBulletRegex(k),_=this.rules.other.hrRegex(k),x=this.rules.other.fencesBeginRegex(k),M=this.rules.other.headingBeginRegex(k),S=this.rules.other.htmlBeginRegex(k),A=this.rules.other.blockquoteBeginRegex(k);for(;t;){let C=t.split(`
87
+ `,1)[0],h;if(y=C,this.options.pedantic?(y=y.replace(this.rules.other.listReplaceNesting," "),h=y):h=y.replace(this.rules.other.tabCharGlobal," "),x.test(y)||M.test(y)||S.test(y)||A.test(y)||b.test(y)||_.test(y))break;if(h.search(this.rules.other.nonSpaceChar)>=k||!y.trim())p+=`
88
+ `+h.slice(k);else{if(w||g.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||x.test(g)||M.test(g)||_.test(g))break;p+=`
89
+ `+y}w=!y.trim(),m+=C+`
90
+ `,t=t.substring(C.length+1),g=h.slice(k)}}r.loose||(c?r.loose=!0:this.rules.other.doubleBlankLine.test(m)&&(c=!0)),r.items.push({type:"list_item",raw:m,task:!!this.options.gfm&&this.rules.other.listIsTask.test(p),loose:!1,text:p,tokens:[]}),r.raw+=m}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 s of r.items){this.lexer.state.top=!1,s.tokens=this.lexer.blockTokens(s.text,[]);let m=s.tokens[0];if(s.task&&((m==null?void 0:m.type)==="text"||(m==null?void 0:m.type)==="paragraph")){s.text=s.text.replace(this.rules.other.listReplaceTask,""),m.raw=m.raw.replace(this.rules.other.listReplaceTask,""),m.text=m.text.replace(this.rules.other.listReplaceTask,"");for(let g=this.lexer.inlineQueue.length-1;g>=0;g--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[g].src)){this.lexer.inlineQueue[g].src=this.lexer.inlineQueue[g].src.replace(this.rules.other.listReplaceTask,"");break}let p=this.rules.other.listTaskCheckbox.exec(s.raw);if(p){let g={type:"checkbox",raw:p[0]+" ",checked:p[0]!=="[ ]"};s.checked=g.checked,r.loose?s.tokens[0]&&["paragraph","text"].includes(s.tokens[0].type)&&"tokens"in s.tokens[0]&&s.tokens[0].tokens?(s.tokens[0].raw=g.raw+s.tokens[0].raw,s.tokens[0].text=g.raw+s.tokens[0].text,s.tokens[0].tokens.unshift(g)):s.tokens.unshift({type:"paragraph",raw:g.raw,text:g.raw,tokens:[g]}):s.tokens.unshift(g)}}else s.task&&(s.task=!1);if(!r.loose){let p=s.tokens.filter(y=>y.type==="space"),g=p.length>0&&p.some(y=>this.rules.other.anyLine.test(y.raw));r.loose=g}}if(r.loose)for(let s of r.items){s.loose=!0;for(let m of s.tokens)m.type==="text"&&(m.type="paragraph")}return r}}html(t){let o=this.rules.block.html.exec(t);if(o){let n=Er(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:Rt(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=yr(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
+ `):[],a={type:"table",raw:Rt(o[0],`
93
+ `),header:[],align:[],rows:[]};if(n.length===i.length){for(let u of i)this.rules.other.tableAlignRight.test(u)?a.align.push("right"):this.rules.other.tableAlignCenter.test(u)?a.align.push("center"):this.rules.other.tableAlignLeft.test(u)?a.align.push("left"):a.align.push(null);for(let u=0;u<n.length;u++)a.header.push({text:n[u],tokens:this.lexer.inline(n[u]),header:!0,align:a.align[u]});for(let u of r)a.rows.push(yr(u,a.header.length).map((s,m)=>({text:s,tokens:this.lexer.inline(s),header:!1,align:a.align[m]})));return a}}lheading(t){let o=this.rules.block.lheading.exec(t);if(o){let n=o[1].trim();return{type:"heading",raw:Rt(o[0],`
94
+ `),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 a=Rt(n.slice(0,-1),"\\");if((n.length-a.length)%2===0)return}else{let a=uu(o[2],"()");if(a===-2)return;if(a>-1){let c=(o[0].indexOf("!")===0?5:4)+o[1].length+a;o[2]=o[2].substring(0,a),o[0]=o[0].substring(0,c).trim(),o[3]=""}}let i=o[2],r="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(i);a&&(i=a[1],r=a[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)),xr(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 a=n[0].charAt(0);return{type:"text",raw:a,text:a}}return xr(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,a,c,u=r,s=0,m=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(m.lastIndex=0,o=o.slice(-1*t.length+r);(i=m.exec(o))!==null;){if(a=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!a)continue;if(c=[...a].length,i[3]||i[4]){u+=c;continue}else if((i[5]||i[6])&&r%3&&!((r+c)%3)){s+=c;continue}if(u-=c,u>0)continue;c=Math.min(c,c+u+s);let p=[...i[0]][0].length,g=t.slice(0,r+i.index+p+c);if(Math.min(r,c)%2){let w=g.slice(1,-1);return{type:"em",raw:g,text:w,tokens:this.lexer.inlineTokens(w)}}let y=g.slice(2,-2);return{type:"strong",raw:g,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,a,c,u=r,s=this.rules.inline.delRDelim;for(s.lastIndex=0,o=o.slice(-1*t.length+r);(i=s.exec(o))!==null;){if(a=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!a||(c=[...a].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 m=[...i[0]][0].length,p=t.slice(0,r+i.index+m+c),g=p.slice(r,-r);return{type:"del",raw:p,text:g,tokens:this.lexer.inlineTokens(g)}}}}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 a;do a=o[0],o[0]=((n=this.rules.inline._backpedal.exec(o[0]))==null?void 0:n[0])??"";while(a!==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}}}},dt=class ni{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||Lt,this.options.tokenizer=this.options.tokenizer||new Yn,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:qe,block:qn.normal,inline:yn.normal};this.options.pedantic?(n.block=qn.pedantic,n.inline=yn.pedantic):this.options.gfm&&(n.block=qn.gfm,this.options.breaks?n.inline=yn.breaks:n.inline=yn.gfm),this.tokenizer.rules=n}static get rules(){return{block:qn,inline:yn}}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(qe.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 a,c,u;this.tokenizer.lexer=this,this.options.pedantic&&(o=o.replace(qe.tabCharGlobal," ").replace(qe.spaceLine,""));let r=1/0;for(;o;){if(o.length<r)r=o.length;else{this.infiniteLoopError(o.charCodeAt(0));break}let s;if((c=(a=this.options.extensions)==null?void 0:a.block)!=null&&c.some(p=>(s=p.call({lexer:this},o,n))?(o=o.substring(s.raw.length),n.push(s),!0):!1))continue;if(s=this.tokenizer.space(o)){o=o.substring(s.raw.length);let p=n.at(-1);s.raw.length===1&&p!==void 0?p.raw+=`
97
+ `:n.push(s);continue}if(s=this.tokenizer.code(o)){o=o.substring(s.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(`
98
+ `)?"":`
99
+ `)+s.raw,p.text+=`
100
+ `+s.text,this.inlineQueue.at(-1).src=p.text):n.push(s);continue}if(s=this.tokenizer.fences(o)){o=o.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.heading(o)){o=o.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.hr(o)){o=o.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.blockquote(o)){o=o.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.list(o)){o=o.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.html(o)){o=o.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.def(o)){o=o.substring(s.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(`
101
+ `)?"":`
102
+ `)+s.raw,p.text+=`
103
+ `+s.raw,this.inlineQueue.at(-1).src=p.text):this.tokens.links[s.tag]||(this.tokens.links[s.tag]={href:s.href,title:s.title},n.push(s));continue}if(s=this.tokenizer.table(o)){o=o.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.lheading(o)){o=o.substring(s.raw.length),n.push(s);continue}let m=o;if((u=this.options.extensions)!=null&&u.startBlock){let p=1/0,g=o.slice(1),y;this.options.extensions.startBlock.forEach(w=>{y=w.call({lexer:this},g),typeof y=="number"&&y>=0&&(p=Math.min(p,y))}),p<1/0&&p>=0&&(m=o.substring(0,p+1))}if(this.state.top&&(s=this.tokenizer.paragraph(m))){let p=n.at(-1);i&&(p==null?void 0:p.type)==="paragraph"?(p.raw+=(p.raw.endsWith(`
104
+ `)?"":`
105
+ `)+s.raw,p.text+=`
106
+ `+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=p.text):n.push(s),i=m.length!==o.length,o=o.substring(s.raw.length);continue}if(s=this.tokenizer.text(o)){o=o.substring(s.raw.length);let p=n.at(-1);(p==null?void 0:p.type)==="text"?(p.raw+=(p.raw.endsWith(`
107
+ `)?"":`
108
+ `)+s.raw,p.text+=`
109
+ `+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=p.text):n.push(s);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 m,p,g,y,w;this.tokenizer.lexer=this;let i=o,r=null;if(this.tokens.links){let k=Object.keys(this.tokens.links);if(k.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(i))!==null;)k.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 a;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(i))!==null;)a=r[2]?r[2].length:0,i=i.slice(0,r.index+a)+"["+"a".repeat(r[0].length-a-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);i=((p=(m=this.options.hooks)==null?void 0:m.emStrongMask)==null?void 0:p.call({lexer:this},i))??i;let c=!1,u="",s=1/0;for(;o;){if(o.length<s)s=o.length;else{this.infiniteLoopError(o.charCodeAt(0));break}c||(u=""),c=!1;let k;if((y=(g=this.options.extensions)==null?void 0:g.inline)!=null&&y.some(_=>(k=_.call({lexer:this},o,n))?(o=o.substring(k.raw.length),n.push(k),!0):!1))continue;if(k=this.tokenizer.escape(o)){o=o.substring(k.raw.length),n.push(k);continue}if(k=this.tokenizer.tag(o)){o=o.substring(k.raw.length),n.push(k);continue}if(k=this.tokenizer.link(o)){o=o.substring(k.raw.length),n.push(k);continue}if(k=this.tokenizer.reflink(o,this.tokens.links)){o=o.substring(k.raw.length);let _=n.at(-1);k.type==="text"&&(_==null?void 0:_.type)==="text"?(_.raw+=k.raw,_.text+=k.text):n.push(k);continue}if(k=this.tokenizer.emStrong(o,i,u)){o=o.substring(k.raw.length),n.push(k);continue}if(k=this.tokenizer.codespan(o)){o=o.substring(k.raw.length),n.push(k);continue}if(k=this.tokenizer.br(o)){o=o.substring(k.raw.length),n.push(k);continue}if(k=this.tokenizer.del(o,i,u)){o=o.substring(k.raw.length),n.push(k);continue}if(k=this.tokenizer.autolink(o)){o=o.substring(k.raw.length),n.push(k);continue}if(!this.state.inLink&&(k=this.tokenizer.url(o))){o=o.substring(k.raw.length),n.push(k);continue}let b=o;if((w=this.options.extensions)!=null&&w.startInline){let _=1/0,x=o.slice(1),M;this.options.extensions.startInline.forEach(S=>{M=S.call({lexer:this},x),typeof M=="number"&&M>=0&&(_=Math.min(_,M))}),_<1/0&&_>=0&&(b=o.substring(0,_+1))}if(k=this.tokenizer.inlineText(b)){o=o.substring(k.raw.length),k.raw.slice(-1)!=="_"&&(u=k.raw.slice(-1)),c=!0;let _=n.at(-1);(_==null?void 0:_.type)==="text"?(_.raw+=k.raw,_.text+=k.text):n.push(k);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)}},En=class{constructor(t){Ae(this,"options");Ae(this,"parser");this.options=t||Lt}space(t){return""}code({text:t,lang:o,escaped:n}){var a;let i=(a=(o||"").match(qe.notSpaceStart))==null?void 0:a[0],r=t.replace(qe.endingNewline,"")+`
110
+ `;return i?'<pre><code class="language-'+gt(i)+'">'+(n?r:gt(r,!0))+`</code></pre>
111
+ `:"<pre><code>"+(n?r:gt(r,!0))+`</code></pre>
112
+ `}blockquote({tokens:t}){return`<blockquote>
113
+ ${this.parser.parse(t)}</blockquote>
114
+ `}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:o}){return`<h${o}>${this.parser.parseInline(t)}</h${o}>
115
+ `}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",a=o&&n!==1?' start="'+n+'"':"";return"<"+r+a+`>
117
+ `+i+"</"+r+`>
118
+ `}listitem(t){return`<li>${this.parser.parse(t.tokens)}</li>
119
+ `}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 a=t.rows[r];n="";for(let c=0;c<a.length;c++)n+=this.tablecell(a[c]);i+=this.tablerow({text:n})}return i&&(i=`<tbody>${i}</tbody>`),`<table>
121
+ <thead>
122
+ `+o+`</thead>
123
+ `+i+`</table>
124
+ `}tablerow({text:t}){return`<tr>
125
+ ${t}</tr>
126
+ `}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>${gt(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=kr(t);if(r===null)return i;t=r;let a='<a href="'+t+'"';return o&&(a+=' title="'+gt(o)+'"'),a+=">"+i+"</a>",a}image({href:t,title:o,text:n,tokens:i}){i&&(n=this.parser.parseInline(i,this.parser.textRenderer));let r=kr(t);if(r===null)return gt(n);t=r;let a=`<img src="${t}" alt="${gt(n)}"`;return o&&(a+=` title="${gt(o)}"`),a+=">",a}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:gt(t.text)}},Po=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}},ut=class oi{constructor(o){Ae(this,"options");Ae(this,"renderer");Ae(this,"textRenderer");this.options=o||Lt,this.options.renderer=this.options.renderer||new En,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Po}static parse(o,n){return new oi(n).parse(o)}static parseInline(o,n){return new oi(n).parseInline(o)}parse(o){var i,r;this.renderer.parser=this;let n="";for(let a=0;a<o.length;a++){let c=o[a];if((r=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&r[c.type]){let s=c,m=this.options.extensions.renderers[s.type].call({parser:this},s);if(m!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(s.type)){n+=m||"";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 s='Token with "'+u.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}}return n}parseInline(o,n=this.renderer){var r,a;this.renderer.parser=this;let i="";for(let c=0;c<o.length;c++){let u=o[c];if((a=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&a[u.type]){let m=this.options.extensions.renderers[u.type].call({parser:this},u);if(m!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(u.type)){i+=m||"";continue}}let s=u;switch(s.type){case"escape":{i+=n.text(s);break}case"html":{i+=n.html(s);break}case"link":{i+=n.link(s);break}case"image":{i+=n.image(s);break}case"checkbox":{i+=n.checkbox(s);break}case"strong":{i+=n.strong(s);break}case"em":{i+=n.em(s);break}case"codespan":{i+=n.codespan(s);break}case"br":{i+=n.br(s);break}case"del":{i+=n.del(s);break}case"text":{i+=n.text(s);break}default:{let m='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(m),"";throw new Error(m)}}}return i}},xn=(Xn=class{constructor(t){Ae(this,"options");Ae(this,"block");this.options=t||Lt}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?ut.parse:ut.parseInline}},Ae(Xn,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),Ae(Xn,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Xn),wr=class{constructor(...t){Ae(this,"defaults",Bo());Ae(this,"options",this.setOptions);Ae(this,"parse",this.parseMarkdown(!0));Ae(this,"parseInline",this.parseMarkdown(!1));Ae(this,"Parser",ut);Ae(this,"Renderer",En);Ae(this,"TextRenderer",Po);Ae(this,"Lexer",dt);Ae(this,"Tokenizer",Yn);Ae(this,"Hooks",xn);this.use(...t)}walkTokens(t,o){var i,r;let n=[];for(let a of t)switch(n=n.concat(o.call(this,a)),a.type){case"table":{let c=a;for(let u of c.header)n=n.concat(this.walkTokens(u.tokens,o));for(let u of c.rows)for(let s of u)n=n.concat(this.walkTokens(s.tokens,o));break}case"list":{let c=a;n=n.concat(this.walkTokens(c.items,o));break}default:{let c=a;(r=(i=this.defaults.extensions)==null?void 0:i.childTokens)!=null&&r[c.type]?this.defaults.extensions.childTokens[c.type].forEach(u=>{let s=c[u].flat(1/0);n=n.concat(this.walkTokens(s,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 a=o.renderers[r.name];a?o.renderers[r.name]=function(...c){let u=r.renderer.apply(this,c);return u===!1&&(u=a.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 a=o[r.level];a?a.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 En(this.defaults);for(let a in n.renderer){if(!(a in r))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let c=a,u=n.renderer[c],s=r[c];r[c]=(...m)=>{let p=u.apply(r,m);return p===!1&&(p=s.apply(r,m)),p||""}}i.renderer=r}if(n.tokenizer){let r=this.defaults.tokenizer||new Yn(this.defaults);for(let a in n.tokenizer){if(!(a in r))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let c=a,u=n.tokenizer[c],s=r[c];r[c]=(...m)=>{let p=u.apply(r,m);return p===!1&&(p=s.apply(r,m)),p}}i.tokenizer=r}if(n.hooks){let r=this.defaults.hooks||new xn;for(let a in n.hooks){if(!(a in r))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let c=a,u=n.hooks[c],s=r[c];xn.passThroughHooks.has(a)?r[c]=m=>{if(this.defaults.async&&xn.passThroughHooksRespectAsync.has(a))return(async()=>{let g=await u.call(r,m);return s.call(r,g)})();let p=u.call(r,m);return s.call(r,p)}:r[c]=(...m)=>{if(this.defaults.async)return(async()=>{let g=await u.apply(r,m);return g===!1&&(g=await s.apply(r,m)),g})();let p=u.apply(r,m);return p===!1&&(p=s.apply(r,m)),p}}i.hooks=r}if(n.walkTokens){let r=this.defaults.walkTokens,a=n.walkTokens;i.walkTokens=function(c){let u=[];return u.push(a.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 dt.lex(t,o??this.defaults)}parser(t,o){return ut.parse(t,o??this.defaults)}parseMarkdown(t){return(o,n)=>{let i={...n},r={...this.defaults,...i},a=this.onError(!!r.silent,!!r.async);if(this.defaults.async===!0&&i.async===!1)return a(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 a(new Error("marked(): input parameter is undefined or null"));if(typeof o!="string")return a(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?dt.lex:dt.lexInline)(c,r),s=r.hooks?await r.hooks.processAllTokens(u):u;r.walkTokens&&await Promise.all(this.walkTokens(s,r.walkTokens));let m=await(r.hooks?await r.hooks.provideParser(t):t?ut.parse:ut.parseInline)(s,r);return r.hooks?await r.hooks.postprocess(m):m})().catch(a);try{r.hooks&&(o=r.hooks.preprocess(o));let c=(r.hooks?r.hooks.provideLexer(t):t?dt.lex:dt.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?ut.parse:ut.parseInline)(c,r);return r.hooks&&(u=r.hooks.postprocess(u)),u}catch(c){return a(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>"+gt(n.message+"",!0)+"</pre>";return o?Promise.resolve(i):i}if(o)return Promise.reject(n);throw n}}},Vt=new wr;function _e(t,o){return Vt.parse(t,o)}_e.options=_e.setOptions=function(t){return Vt.setOptions(t),_e.defaults=Vt.defaults,rr(_e.defaults),_e},_e.getDefaults=Bo,_e.defaults=Lt,_e.use=function(...t){return Vt.use(...t),_e.defaults=Vt.defaults,rr(_e.defaults),_e},_e.walkTokens=function(t,o){return Vt.walkTokens(t,o)},_e.parseInline=Vt.parseInline,_e.Parser=ut,_e.parser=ut.parse,_e.Renderer=En,_e.TextRenderer=Po,_e.Lexer=dt,_e.lexer=dt.lex,_e.Tokenizer=Yn,_e.Hooks=xn,_e.parse=_e,_e.options,_e.setOptions,_e.use,_e.walkTokens,_e.parseInline,ut.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 Nr(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 pu(t){if(Array.isArray(t))return t}function gu(t,o){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var i,r,a,c,u=[],s=!0,m=!1;try{if(a=(n=n.call(t)).next,o!==0)for(;!(s=(i=a.call(n)).done)&&(u.push(i.value),u.length!==o);s=!0);}catch(p){m=!0,r=p}finally{try{if(!s&&n.return!=null&&(c=n.return(),Object(c)!==c))return}finally{if(m)throw r}}return u}}function hu(){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 bu(t,o){return pu(t)||gu(t,o)||ku(t,o)||hu()}function ku(t,o){if(t){if(typeof t=="string")return Nr(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)?Nr(t,o):void 0}}const Sr=Object.entries,Tr=Object.setPrototypeOf,yu=Object.isFrozen,Eu=Object.getPrototypeOf,xu=Object.getOwnPropertyDescriptor;let Xe=Object.freeze,lt=Object.seal,Qt=Object.create,Cr=typeof Reflect<"u"&&Reflect,Fo=Cr.apply,Uo=Cr.construct;Xe||(Xe=function(o){return o}),lt||(lt=function(o){return o}),Fo||(Fo=function(o,n){for(var i=arguments.length,r=new Array(i>2?i-2:0),a=2;a<i;a++)r[a-2]=arguments[a];return o.apply(n,r)}),Uo||(Uo=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 $t=Fe(Array.prototype.forEach),wu=Fe(Array.prototype.lastIndexOf),_r=Fe(Array.prototype.pop),en=Fe(Array.prototype.push),Nu=Fe(Array.prototype.splice),Je=Array.isArray,wn=Fe(String.prototype.toLowerCase),Ho=Fe(String.prototype.toString),Ar=Fe(String.prototype.match),tn=Fe(String.prototype.replace),Mr=Fe(String.prototype.indexOf),Su=Fe(String.prototype.trim),Tu=Fe(Number.prototype.toString),Cu=Fe(Boolean.prototype.toString),Rr=typeof BigInt>"u"?null:Fe(BigInt.prototype.toString),Br=typeof Symbol>"u"?null:Fe(Symbol.prototype.toString),Oe=Fe(Object.prototype.hasOwnProperty),Nn=Fe(Object.prototype.toString),We=Fe(RegExp.prototype.test),nn=_u(TypeError);function Fe(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 Fo(t,o,i)}}function _u(t){return function(){for(var o=arguments.length,n=new Array(o),i=0;i<o;i++)n[i]=arguments[i];return Uo(t,n)}}function de(t,o){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:wn;if(Tr&&Tr(t,null),!Je(o))return t;let i=o.length;for(;i--;){let r=o[i];if(typeof r=="string"){const a=n(r);a!==r&&(yu(o)||(o[i]=a),r=a)}t[r]=!0}return t}function Au(t){for(let o=0;o<t.length;o++)Oe(t,o)||(t[o]=null);return t}function Ye(t){const o=Qt(null);for(const i of Sr(t)){var n=bu(i,2);const r=n[0],a=n[1];Oe(t,r)&&(Je(a)?o[r]=Au(a):a&&typeof a=="object"&&a.constructor===Object?o[r]=Ye(a):o[r]=a)}return o}function Mu(t){switch(typeof t){case"string":return t;case"number":return Tu(t);case"boolean":return Cu(t);case"bigint":return Rr?Rr(t):"0";case"symbol":return Br?Br(t):"Symbol()";case"undefined":return Nn(t);case"function":case"object":{if(t===null)return Nn(t);const o=t,n=ht(o,"toString");if(typeof n=="function"){const i=n(o);return typeof i=="string"?i:Nn(i)}return Nn(t)}default:return Nn(t)}}function ht(t,o){for(;t!==null;){const i=xu(t,o);if(i){if(i.get)return Fe(i.get);if(typeof i.value=="function")return Fe(i.value)}t=Eu(t)}function n(){return null}return n}function Ru(t){try{return We(t,""),!0}catch{return!1}}const zr=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"]),Wo=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"]),Go=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"]),Bu=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"]),jo=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"]),zu=Xe(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Or=Xe(["#text"]),Ir=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"]),Ko=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"]),vr=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"]),Zn=Xe(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Ou=lt(/{{[\w\W]*|^[\w\W]*}}/g),Iu=lt(/<%[\w\W]*|^[\w\W]*%>/g),vu=lt(/\${[\w\W]*/g),Lu=lt(/^data-[\-\w.\u00B7-\uFFFF]+$/),Du=lt(/^aria-[\-\w]+$/),Lr=lt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Vu=lt(/^(?:\w+script|data):/i),$u=lt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Pu=lt(/^html$/i),Fu=lt(/^[a-z][.\w]*(-[.\w]+)+$/i),bt={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Uu=function(){return typeof window>"u"?null:window},Hu=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 a="dompurify"+(i?"#"+i:"");try{return o.createPolicy(a,{createHTML(c){return c},createScriptURL(c){return c}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}},Dr=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Vr(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Uu();const o=J=>Vr(J);if(o.version="3.4.8",o.removed=[],!t||!t.document||t.document.nodeType!==bt.document||!t.Element)return o.isSupported=!1,o;let n=t.document;const i=n,r=i.currentScript;t.DocumentFragment;const a=t.HTMLTemplateElement,c=t.Node,u=t.Element,s=t.NodeFilter,m=t.NamedNodeMap;m===void 0&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const p=t.DOMParser,g=t.trustedTypes,y=u.prototype,w=ht(y,"cloneNode"),k=ht(y,"remove"),b=ht(y,"nextSibling"),_=ht(y,"childNodes"),x=ht(y,"parentNode"),M=ht(y,"shadowRoot"),S=ht(y,"attributes"),A=c&&c.prototype?ht(c.prototype,"nodeType"):null,C=c&&c.prototype?ht(c.prototype,"nodeName"):null;if(typeof a=="function"){const J=n.createElement("template");J.content&&J.content.ownerDocument&&(n=J.content.ownerDocument)}let h,O="",W=0;const oe=function(f){if(W>0)throw nn('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 h.createHTML(f)}finally{W--}},K=n,te=K.implementation,le=K.createNodeIterator,G=K.createDocumentFragment,Y=K.getElementsByTagName,F=i.importNode;let N=Dr();o.isSupported=typeof Sr=="function"&&typeof x=="function"&&te&&te.createHTMLDocument!==void 0;const $=Ou,L=Iu,j=vu,X=Lu,ge=Du,Be=Vu,Ue=$u,Le=Fu;let v=Lr,B=null;const ie=de({},[...zr,...Wo,...Go,...jo,...Or]);let ae=null;const D=de({},[...Ir,...Ko,...vr,...Zn]);let T=Object.seal(Qt(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}})),ue=null,me=null;const De=Object.seal(Qt(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Ze=!0,Ge=!0,on=!1,St=!0,ee=!1,mt=!0,Me=!1,ye=!1,kt=!1,je=!1,Qe=!1,yt=!1,U=!0,Z=!1;const se="user-content-";let he=!0,Re=!1,He={},et=null;const Pt=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 rn=null;const ln=de({},["audio","video","img","source","image","track"]);let at=null;const Ve=de({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),we="http://www.w3.org/1998/Math/MathML",an="http://www.w3.org/2000/svg",Ie="http://www.w3.org/1999/xhtml";let Q=Ie,sn=!1,cn=null;const Yo=de({},[we,an,Ie],Ho);let dn=de({},["mi","mo","mn","ms","mtext"]),Sn=de({},["annotation-xml"]);const Zo=de({},["title","style","font","a","script"]);let Et=null;const Xo=["application/xhtml+xml","text/html"],Jn="text/html";let Ce=null,Bt=null;const Jo=n.createElement("form"),Qn=function(f){return f instanceof RegExp||f instanceof Function},Tn=function(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Bt&&Bt===f)return;(!f||typeof f!="object")&&(f={}),f=Ye(f),Et=Xo.indexOf(f.PARSER_MEDIA_TYPE)===-1?Jn:f.PARSER_MEDIA_TYPE,Ce=Et==="application/xhtml+xml"?Ho:wn,B=Oe(f,"ALLOWED_TAGS")&&Je(f.ALLOWED_TAGS)?de({},f.ALLOWED_TAGS,Ce):ie,ae=Oe(f,"ALLOWED_ATTR")&&Je(f.ALLOWED_ATTR)?de({},f.ALLOWED_ATTR,Ce):D,cn=Oe(f,"ALLOWED_NAMESPACES")&&Je(f.ALLOWED_NAMESPACES)?de({},f.ALLOWED_NAMESPACES,Ho):Yo,at=Oe(f,"ADD_URI_SAFE_ATTR")&&Je(f.ADD_URI_SAFE_ATTR)?de(Ye(Ve),f.ADD_URI_SAFE_ATTR,Ce):Ve,rn=Oe(f,"ADD_DATA_URI_TAGS")&&Je(f.ADD_DATA_URI_TAGS)?de(Ye(ln),f.ADD_DATA_URI_TAGS,Ce):ln,et=Oe(f,"FORBID_CONTENTS")&&Je(f.FORBID_CONTENTS)?de({},f.FORBID_CONTENTS,Ce):Pt,ue=Oe(f,"FORBID_TAGS")&&Je(f.FORBID_TAGS)?de({},f.FORBID_TAGS,Ce):Ye({}),me=Oe(f,"FORBID_ATTR")&&Je(f.FORBID_ATTR)?de({},f.FORBID_ATTR,Ce):Ye({}),He=Oe(f,"USE_PROFILES")?f.USE_PROFILES&&typeof f.USE_PROFILES=="object"?Ye(f.USE_PROFILES):f.USE_PROFILES:!1,Ze=f.ALLOW_ARIA_ATTR!==!1,Ge=f.ALLOW_DATA_ATTR!==!1,on=f.ALLOW_UNKNOWN_PROTOCOLS||!1,St=f.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ee=f.SAFE_FOR_TEMPLATES||!1,mt=f.SAFE_FOR_XML!==!1,Me=f.WHOLE_DOCUMENT||!1,je=f.RETURN_DOM||!1,Qe=f.RETURN_DOM_FRAGMENT||!1,yt=f.RETURN_TRUSTED_TYPE||!1,kt=f.FORCE_BODY||!1,U=f.SANITIZE_DOM!==!1,Z=f.SANITIZE_NAMED_PROPS||!1,he=f.KEEP_CONTENT!==!1,Re=f.IN_PLACE||!1,v=Ru(f.ALLOWED_URI_REGEXP)?f.ALLOWED_URI_REGEXP:Lr,Q=typeof f.NAMESPACE=="string"?f.NAMESPACE:Ie,dn=Oe(f,"MATHML_TEXT_INTEGRATION_POINTS")&&f.MATHML_TEXT_INTEGRATION_POINTS&&typeof f.MATHML_TEXT_INTEGRATION_POINTS=="object"?Ye(f.MATHML_TEXT_INTEGRATION_POINTS):de({},["mi","mo","mn","ms","mtext"]),Sn=Oe(f,"HTML_INTEGRATION_POINTS")&&f.HTML_INTEGRATION_POINTS&&typeof f.HTML_INTEGRATION_POINTS=="object"?Ye(f.HTML_INTEGRATION_POINTS):de({},["annotation-xml"]);const z=Oe(f,"CUSTOM_ELEMENT_HANDLING")&&f.CUSTOM_ELEMENT_HANDLING&&typeof f.CUSTOM_ELEMENT_HANDLING=="object"?Ye(f.CUSTOM_ELEMENT_HANDLING):Qt(null);if(T=Qt(null),Oe(z,"tagNameCheck")&&Qn(z.tagNameCheck)&&(T.tagNameCheck=z.tagNameCheck),Oe(z,"attributeNameCheck")&&Qn(z.attributeNameCheck)&&(T.attributeNameCheck=z.attributeNameCheck),Oe(z,"allowCustomizedBuiltInElements")&&typeof z.allowCustomizedBuiltInElements=="boolean"&&(T.allowCustomizedBuiltInElements=z.allowCustomizedBuiltInElements),ee&&(Ge=!1),Qe&&(je=!0),He&&(B=de({},Or),ae=Qt(null),He.html===!0&&(de(B,zr),de(ae,Ir)),He.svg===!0&&(de(B,Wo),de(ae,Ko),de(ae,Zn)),He.svgFilters===!0&&(de(B,Go),de(ae,Ko),de(ae,Zn)),He.mathMl===!0&&(de(B,jo),de(ae,vr),de(ae,Zn))),De.tagCheck=null,De.attributeCheck=null,Oe(f,"ADD_TAGS")&&(typeof f.ADD_TAGS=="function"?De.tagCheck=f.ADD_TAGS:Je(f.ADD_TAGS)&&(B===ie&&(B=Ye(B)),de(B,f.ADD_TAGS,Ce))),Oe(f,"ADD_ATTR")&&(typeof f.ADD_ATTR=="function"?De.attributeCheck=f.ADD_ATTR:Je(f.ADD_ATTR)&&(ae===D&&(ae=Ye(ae)),de(ae,f.ADD_ATTR,Ce))),Oe(f,"ADD_URI_SAFE_ATTR")&&Je(f.ADD_URI_SAFE_ATTR)&&de(at,f.ADD_URI_SAFE_ATTR,Ce),Oe(f,"FORBID_CONTENTS")&&Je(f.FORBID_CONTENTS)&&(et===Pt&&(et=Ye(et)),de(et,f.FORBID_CONTENTS,Ce)),Oe(f,"ADD_FORBID_CONTENTS")&&Je(f.ADD_FORBID_CONTENTS)&&(et===Pt&&(et=Ye(et)),de(et,f.ADD_FORBID_CONTENTS,Ce)),he&&(B["#text"]=!0),Me&&de(B,["html","head","body"]),B.table&&(de(B,["tbody"]),delete ue.tbody),f.TRUSTED_TYPES_POLICY){if(typeof f.TRUSTED_TYPES_POLICY.createHTML!="function")throw nn('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof f.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw nn('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const H=h;h=f.TRUSTED_TYPES_POLICY;try{O=oe("")}catch(ke){throw h=H,ke}}else h===void 0&&f.TRUSTED_TYPES_POLICY!==null&&(h=Hu(g,r)),h&&typeof O=="string"&&(O=oe(""));(N.uponSanitizeElement.length>0||N.uponSanitizeAttribute.length>0)&&B===ie&&(B=Ye(B)),N.uponSanitizeAttribute.length>0&&ae===D&&(ae=Ye(ae)),Xe&&Xe(f),Bt=f},eo=de({},[...Wo,...Go,...Bu]),to=de({},[...jo,...zu]),no=function(f){let z=x(f);(!z||!z.tagName)&&(z={namespaceURI:Q,tagName:"template"});const H=wn(f.tagName),ke=wn(z.tagName);return cn[f.namespaceURI]?f.namespaceURI===an?z.namespaceURI===Ie?H==="svg":z.namespaceURI===we?H==="svg"&&(ke==="annotation-xml"||dn[ke]):!!eo[H]:f.namespaceURI===we?z.namespaceURI===Ie?H==="math":z.namespaceURI===an?H==="math"&&Sn[ke]:!!to[H]:f.namespaceURI===Ie?z.namespaceURI===an&&!Sn[ke]||z.namespaceURI===we&&!dn[ke]?!1:!to[H]&&(Zo[H]||!eo[H]):!!(Et==="application/xhtml+xml"&&cn[f.namespaceURI]):!1},ne=function(f){en(o.removed,{element:f});try{x(f).removeChild(f)}catch{k(f)}},$e=function(f,z){try{en(o.removed,{attribute:z.getAttributeNode(f),from:z})}catch{en(o.removed,{attribute:null,from:z})}if(z.removeAttribute(f),f==="is")if(je||Qe)try{ne(z)}catch{}else try{z.setAttribute(f,"")}catch{}},Cn=function(f){let z=null,H=null;if(kt)f="<remove></remove>"+f;else{const Ne=Ar(f,/^[\r\n\t ]+/);H=Ne&&Ne[0]}Et==="application/xhtml+xml"&&Q===Ie&&(f='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+f+"</body></html>");const ke=h?oe(f):f;if(Q===Ie)try{z=new p().parseFromString(ke,Et)}catch{}if(!z||!z.documentElement){z=te.createDocument(Q,"template",null);try{z.documentElement.innerHTML=sn?O:ke}catch{}}const ce=z.body||z.documentElement;return f&&H&&ce.insertBefore(n.createTextNode(H),ce.childNodes[0]||null),Q===Ie?Y.call(z,Me?"html":"body")[0]:Me?z.documentElement:ce},un=function(f){return le.call(f.ownerDocument||f,f,s.SHOW_ELEMENT|s.SHOW_COMMENT|s.SHOW_TEXT|s.SHOW_PROCESSING_INSTRUCTION|s.SHOW_CDATA_SECTION,null)},_n=function(f){var z,H;f.normalize();const ke=le.call(f.ownerDocument||f,f,s.SHOW_TEXT|s.SHOW_COMMENT|s.SHOW_CDATA_SECTION|s.SHOW_PROCESSING_INSTRUCTION,null);let ce=ke.nextNode();for(;ce;){let ze=ce.data;$t([$,L,j],nt=>{ze=tn(ze,nt," ")}),ce.data=ze,ce=ke.nextNode()}const Ne=(z=(H=f.querySelectorAll)===null||H===void 0?void 0:H.call(f,"template"))!==null&&z!==void 0?z:[];$t(Array.from(Ne),ze=>{Tt(ze.content)&&_n(ze.content)})},mn=function(f){const z=C?C(f):null;return typeof z!="string"||Ce(z)!=="form"?!1:typeof f.nodeName!="string"||typeof f.textContent!="string"||typeof f.removeChild!="function"||f.attributes!==S(f)||typeof f.removeAttribute!="function"||typeof f.setAttribute!="function"||typeof f.namespaceURI!="string"||typeof f.insertBefore!="function"||typeof f.hasChildNodes!="function"||f.nodeType!==A(f)||f.childNodes!==_(f)},Tt=function(f){if(!A||typeof f!="object"||f===null)return!1;try{return A(f)===bt.documentFragment}catch{return!1}},xt=function(f){if(!A||typeof f!="object"||f===null)return!1;try{return typeof A(f)=="number"}catch{return!1}};function tt(J,f,z){$t(J,H=>{H.call(o,f,z,Bt)})}const oo=function(f){let z=null;if(tt(N.beforeSanitizeElements,f,null),mn(f))return ne(f),!0;const H=Ce(C?C(f):f.nodeName);if(tt(N.uponSanitizeElement,f,{tagName:H,allowedTags:B}),mt&&f.hasChildNodes()&&!xt(f.firstElementChild)&&We(/<[/\w!]/g,f.innerHTML)&&We(/<[/\w!]/g,f.textContent)||mt&&f.namespaceURI===Ie&&H==="style"&&xt(f.firstElementChild)||f.nodeType===bt.progressingInstruction||mt&&f.nodeType===bt.comment&&We(/<[/\w]/g,f.data))return ne(f),!0;if(ue[H]||!(De.tagCheck instanceof Function&&De.tagCheck(H))&&!B[H]){if(!ue[H]&&lo(H)&&(T.tagNameCheck instanceof RegExp&&We(T.tagNameCheck,H)||T.tagNameCheck instanceof Function&&T.tagNameCheck(H)))return!1;if(he&&!et[H]){const ce=x(f),Ne=_(f);if(Ne&&ce){const ze=Ne.length;for(let nt=ze-1;nt>=0;--nt){const ot=w(Ne[nt],!0);ce.insertBefore(ot,b(f))}}}return ne(f),!0}return(A?A(f):f.nodeType)===bt.element&&!no(f)||(H==="noscript"||H==="noembed"||H==="noframes")&&We(/<\/no(script|embed|frames)/i,f.innerHTML)?(ne(f),!0):(ee&&f.nodeType===bt.text&&(z=f.textContent,$t([$,L,j],ce=>{z=tn(z,ce," ")}),f.textContent!==z&&(en(o.removed,{element:f.cloneNode()}),f.textContent=z)),tt(N.afterSanitizeElements,f,null),!1)},io=function(f,z,H){if(me[z]||U&&(z==="id"||z==="name")&&(H in n||H in Jo))return!1;const ke=ae[z]||De.attributeCheck instanceof Function&&De.attributeCheck(z,f);if(!(Ge&&!me[z]&&We(X,z))){if(!(Ze&&We(ge,z))){if(!ke||me[z]){if(!(lo(f)&&(T.tagNameCheck instanceof RegExp&&We(T.tagNameCheck,f)||T.tagNameCheck instanceof Function&&T.tagNameCheck(f))&&(T.attributeNameCheck instanceof RegExp&&We(T.attributeNameCheck,z)||T.attributeNameCheck instanceof Function&&T.attributeNameCheck(z,f))||z==="is"&&T.allowCustomizedBuiltInElements&&(T.tagNameCheck instanceof RegExp&&We(T.tagNameCheck,H)||T.tagNameCheck instanceof Function&&T.tagNameCheck(H))))return!1}else if(!at[z]){if(!We(v,tn(H,Ue,""))){if(!((z==="src"||z==="xlink:href"||z==="href")&&f!=="script"&&Mr(H,"data:")===0&&rn[f])){if(!(on&&!We(Be,tn(H,Ue,"")))){if(H)return!1}}}}}}return!0},ro=de({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),lo=function(f){return!ro[wn(f)]&&We(Le,f)},ao=function(f){tt(N.beforeSanitizeAttributes,f,null);const z=f.attributes;if(!z||mn(f))return;const H={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ae,forceKeepAttr:void 0};let ke=z.length;for(;ke--;){const ce=z[ke],Ne=ce.name,ze=ce.namespaceURI,nt=ce.value,ot=Ce(Ne),pn=nt;let Pe=Ne==="value"?pn:Su(pn);if(H.attrName=ot,H.attrValue=Pe,H.keepAttr=!0,H.forceKeepAttr=void 0,tt(N.uponSanitizeAttribute,f,H),Pe=H.attrValue,Z&&(ot==="id"||ot==="name")&&Mr(Pe,se)!==0&&($e(Ne,f),Pe=se+Pe),mt&&We(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Pe)){$e(Ne,f);continue}if(ot==="attributename"&&Ar(Pe,"href")){$e(Ne,f);continue}if(H.forceKeepAttr)continue;if(!H.keepAttr){$e(Ne,f);continue}if(!St&&We(/\/>/i,Pe)){$e(Ne,f);continue}ee&&$t([$,L,j],An=>{Pe=tn(Pe,An," ")});const so=Ce(f.nodeName);if(!io(so,ot,Pe)){$e(Ne,f);continue}if(h&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!ze)switch(g.getAttributeType(so,ot)){case"TrustedHTML":{Pe=oe(Pe);break}case"TrustedScriptURL":{Pe=h.createScriptURL(Pe);break}}if(Pe!==pn)try{ze?f.setAttributeNS(ze,Ne,Pe):f.setAttribute(Ne,Pe),mn(f)?ne(f):_r(o.removed)}catch{$e(Ne,f)}}tt(N.afterSanitizeAttributes,f,null)},fn=function(f){let z=null;const H=un(f);for(tt(N.beforeSanitizeShadowDOM,f,null);z=H.nextNode();)if(tt(N.uponSanitizeShadowNode,z,null),oo(z),ao(z),Tt(z.content)&&fn(z.content),(A?A(z):z.nodeType)===bt.element){const ce=M?M(z):z.shadowRoot;Tt(ce)&&(zt(ce),fn(ce))}tt(N.afterSanitizeShadowDOM,f,null)},zt=function(f){const z=A?A(f):f.nodeType;if(z===bt.element){const ce=M?M(f):f.shadowRoot;Tt(ce)&&(zt(ce),fn(ce))}const H=_?_(f):f.childNodes;if(!H)return;const ke=[];$t(H,ce=>{en(ke,ce)});for(const ce of ke)zt(ce);if(z===bt.element){const ce=C?C(f):null;if(typeof ce=="string"&&Ce(ce)==="template"){const Ne=f.content;Tt(Ne)&&zt(Ne)}}};return o.sanitize=function(J){let f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},z=null,H=null,ke=null,ce=null;if(sn=!J,sn&&(J="<!-->"),typeof J!="string"&&!xt(J)&&(J=Mu(J),typeof J!="string"))throw nn("dirty is not a string, aborting");if(!o.isSupported)return J;if(ye||Tn(f),o.removed=[],typeof J=="string"&&(Re=!1),Re){const nt=C?C(J):J.nodeName;if(typeof nt=="string"){const ot=Ce(nt);if(!B[ot]||ue[ot])throw nn("root node is forbidden and cannot be sanitized in-place")}if(mn(J))throw nn("root node is clobbered and cannot be sanitized in-place");zt(J)}else if(xt(J))z=Cn("<!---->"),H=z.ownerDocument.importNode(J,!0),H.nodeType===bt.element&&H.nodeName==="BODY"||H.nodeName==="HTML"?z=H:z.appendChild(H),zt(H);else{if(!je&&!ee&&!Me&&J.indexOf("<")===-1)return h&&yt?oe(J):J;if(z=Cn(J),!z)return je?null:yt?O:""}z&&kt&&ne(z.firstChild);const Ne=un(Re?J:z);for(;ke=Ne.nextNode();)oo(ke),ao(ke),Tt(ke.content)&&fn(ke.content);if(Re)return ee&&_n(J),J;if(je){if(ee&&_n(z),Qe)for(ce=G.call(z.ownerDocument);z.firstChild;)ce.appendChild(z.firstChild);else ce=z;return(ae.shadowroot||ae.shadowrootmode)&&(ce=F.call(i,ce,!0)),ce}let ze=Me?z.outerHTML:z.innerHTML;return Me&&B["!doctype"]&&z.ownerDocument&&z.ownerDocument.doctype&&z.ownerDocument.doctype.name&&We(Pu,z.ownerDocument.doctype.name)&&(ze="<!DOCTYPE "+z.ownerDocument.doctype.name+`>
130
+ `+ze),ee&&$t([$,L,j],nt=>{ze=tn(ze,nt," ")}),h&&yt?oe(ze):ze},o.setConfig=function(){let J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Tn(J),ye=!0},o.clearConfig=function(){Bt=null,ye=!1},o.isValidAttribute=function(J,f,z){Bt||Tn({});const H=Ce(J),ke=Ce(f);return io(H,ke,z)},o.addHook=function(J,f){typeof f=="function"&&en(N[J],f)},o.removeHook=function(J,f){if(f!==void 0){const z=wu(N[J],f);return z===-1?void 0:Nu(N[J],z,1)[0]}return _r(N[J])},o.removeHooks=function(J){N[J]=[]},o.removeAllHooks=function(){N=Dr()},o}var Wu=Vr();const Gu=new wr({gfm:!0,breaks:!0,pedantic:!1,renderer:(()=>{const t=new En;return t.code=({text:o,lang:n})=>{const i=(n??"").toLowerCase(),r=To(o,i);return`<pre><code${i?` class="language-${i}"`:""}>${r}</code></pre>`},t})()}),ju=["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"],Ku=["href","title","target","rel","src","alt","class","checked","type","disabled"],qu=/^(?:(?:https?|mailto|tel|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i;function Yu(t){if(!t)return"";const o=Gu.parse(t,{async:!1});return Wu.sanitize(o,{ALLOWED_TAGS:ju,ALLOWED_ATTR:Ku,ALLOWED_URI_REGEXP:qu})}const Zu={class:"zm-note-panel"},Xu={key:0,class:"zm-note-empty"},Ju={class:"zm-note-header"},Qu={class:"zm-note-title-row"},em={class:"zm-note-name"},tm={class:"zm-note-meta"},nm={class:"zm-note-scroll"},om={class:"zm-note-section"},im={class:"zm-note-section-head"},rm={class:"zm-note-split"},lm=["disabled"],am={key:0,class:"zm-note-preview"},sm=["innerHTML"],cm={key:1,class:"zm-note-preview-hint"},dm={key:0,class:"zm-note-section-actions"},um={key:0,class:"zm-note-add-row"},mm={key:1,class:"zm-note-section"},fm=["disabled"],pm=["href","title"],gm={key:2,class:"zm-note-section"},hm=["disabled"],bm=["src","alt"],km={key:3,class:"zm-note-section"},ym={class:"zm-note-section-head"},Em={key:0,class:"zm-note-section-tag"},xm=["disabled"],wm={key:0,class:"zm-note-code"},Nm=["innerHTML"],Sm={key:4,class:"zm-note-section"},Tm=["disabled"],Cm={key:0,class:"zm-note-table"},_m=["onClick"],Am={class:"zm-note-table-sort-mark","aria-hidden":"true"},qo=e.defineComponent({__name:"NotePanel",props:{selectedNode:{},readonly:{type:Boolean},focusTick:{}},emits:["apply","remove","set-link","set-image","set-rich"],setup(t,{emit:o}){const n=t,i=o,r=e.ref(""),a=e.ref(null);Ro(a,{minRows:4,maxRows:10});const c=e.computed(()=>!r.value||r.value.trim()===""),u=e.computed(()=>Yu(r.value)),s=e.ref(!0);function m(){s.value=!s.value}e.watch(()=>{var v,B,ie;return[(v=n.selectedNode)==null?void 0:v.id,(ie=(B=n.selectedNode)==null?void 0:B.note)==null?void 0:ie.text]},()=>{var v,B;r.value=((B=(v=n.selectedNode)==null?void 0:v.note)==null?void 0:B.text)??""},{immediate:!0}),e.watch(()=>n.focusTick,async()=>{if(n.readonly)return;await e.nextTick();const v=document.querySelector(".zm-note-panel textarea.zm-note-textarea");if(v){v.focus();const B=v.value.length;v.setSelectionRange(B,B)}});function p(){var ie,ae;if(n.readonly)return;const v=r.value,B=((ae=(ie=n.selectedNode)==null?void 0:ie.note)==null?void 0:ae.text)??"";v!==B&&i("apply",v)}function g(v){var B,ie;n.readonly||(v.key==="Escape"?(v.preventDefault(),r.value=((ie=(B=n.selectedNode)==null?void 0:B.note)==null?void 0:ie.text)??"",v.target.blur()):v.key==="Enter"&&(v.ctrlKey||v.metaKey)&&(v.preventDefault(),p(),v.target.blur()))}function y(){n.readonly||confirm("移除该节点的笔记?")&&(r.value="",i("remove"))}const w=e.computed(()=>{var v,B;return!!((B=(v=n.selectedNode)==null?void 0:v.link)!=null&&B.url)}),k=e.computed(()=>{var v,B;return!!((B=(v=n.selectedNode)==null?void 0:v.image)!=null&&B.src)}),b=e.computed(()=>{var v,B;return(B=(v=n.selectedNode)==null?void 0:v.richContent)==null?void 0:B.kind}),_=e.computed(()=>b.value==="code"),x=e.computed(()=>b.value==="table"),M=e.ref(!1),S=e.ref(!1),A=e.ref(!1),C=e.ref(!1);e.watch(()=>{var v;return(v=n.selectedNode)==null?void 0:v.id},()=>{M.value=!1,S.value=!1,A.value=!1,C.value=!1});const h=e.ref("");e.watch(()=>{var v,B,ie;return[(v=n.selectedNode)==null?void 0:v.id,(ie=(B=n.selectedNode)==null?void 0:B.link)==null?void 0:ie.url]},()=>{var v,B;h.value=((B=(v=n.selectedNode)==null?void 0:v.link)==null?void 0:B.url)??""},{immediate:!0});function O(){var ie,ae;if(n.readonly)return;const v=h.value.trim(),B=((ae=(ie=n.selectedNode)==null?void 0:ie.link)==null?void 0:ae.url)??"";v!==B&&i("set-link",v)}const W=e.ref("");e.watch(()=>{var v,B,ie;return[(v=n.selectedNode)==null?void 0:v.id,(ie=(B=n.selectedNode)==null?void 0:B.image)==null?void 0:ie.src]},()=>{var v,B;W.value=((B=(v=n.selectedNode)==null?void 0:v.image)==null?void 0:B.src)??""},{immediate:!0});function oe(){var ie,ae;if(n.readonly)return;const v=W.value.trim(),B=((ae=(ie=n.selectedNode)==null?void 0:ie.image)==null?void 0:ae.src)??"";v!==B&&i("set-image",v)}function K(v){const B=v.target;B.style.display="none"}function te(v){const B=v.target;B.style.display=""}const le=e.ref(""),G=e.ref(null);Ro(G,{minRows:4,maxRows:18}),e.watch(()=>{var v,B,ie;return[(v=n.selectedNode)==null?void 0:v.id,(ie=(B=n.selectedNode)==null?void 0:B.richContent)==null?void 0:ie.raw]},()=>{var v,B;le.value=((B=(v=n.selectedNode)==null?void 0:v.richContent)==null?void 0:B.raw)??""},{immediate:!0});const Y=e.computed(()=>To(So(le.value),qt(le.value)));function F(){var ae,D;if(n.readonly)return;const v=le.value,B=((D=(ae=n.selectedNode)==null?void 0:ae.richContent)==null?void 0:D.raw)??"";if(v===B)return;const ie=qt(v)||void 0;i("set-rich",v?{kind:"code",raw:v,lang:ie}:null)}const N=e.ref(""),$=e.ref(null);Ro($,{minRows:4,maxRows:14});const L=e.ref(-1),j=e.ref("asc");e.watch(()=>{var v,B,ie;return[(v=n.selectedNode)==null?void 0:v.id,(ie=(B=n.selectedNode)==null?void 0:B.richContent)==null?void 0:ie.raw]},()=>{var v,B;N.value=((B=(v=n.selectedNode)==null?void 0:v.richContent)==null?void 0:B.raw)??"",L.value=-1,j.value="asc"},{immediate:!0});function X(){var ie,ae;if(n.readonly)return;const v=N.value,B=((ae=(ie=n.selectedNode)==null?void 0:ie.richContent)==null?void 0:ae.raw)??"";v!==B&&i("set-rich",v?{kind:"table",raw:v}:null)}const ge=e.computed(()=>nr(N.value)),Be=e.computed(()=>{const v=ge.value;return L.value<0||v.length<=1?v:or(v,L.value,j.value)});function Ue(v){L.value!==v?(L.value=v,j.value="asc"):j.value==="asc"?j.value="desc":L.value=-1}const Le=e.computed(()=>{const v=[];return c.value||v.push(`${r.value.length} 字`),w.value&&v.push("1 链接"),k.value&&v.push("1 图片"),_.value&&v.push("代码块"),x.value&&v.push("表格"),v.length===0?"节点没有额外内容":v.join(" · ")});return(v,B)=>{var ie,ae,D,T;return e.openBlock(),e.createElementBlock("div",Zu,[t.selectedNode?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",Ju,[e.createElementVNode("div",Qu,[B[12]||(B[12]=e.createElementVNode("span",{class:"zm-note-label"},"节点",-1)),e.createElementVNode("span",em,e.toDisplayString(t.selectedNode.text||"(无标题)"),1)]),e.createElementVNode("div",tm,e.toDisplayString(Le.value),1)]),e.createElementVNode("div",nm,[e.createElementVNode("section",om,[e.createElementVNode("header",im,[B[13]||(B[13]=e.createElementVNode("span",{class:"zm-note-section-title"},"笔记",-1)),B[14]||(B[14]=e.createElementVNode("span",{class:"zm-note-section-hint"},"Ctrl+Enter 提交, Esc 取消",-1)),t.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"zm-note-preview-toggle",onClick:m},e.toDisplayString(s.value?"隐藏预览":"显示预览"),1))]),e.createElementVNode("div",rm,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"noteRef",ref:a,"onUpdate:modelValue":B[0]||(B[0]=ue=>r.value=ue),class:"zm-note-textarea",placeholder:"写点什么吧… 支持 Markdown",spellcheck:"false",disabled:t.readonly,onBlur:p,onKeydown:g},null,40,lm),[[e.vModelText,r.value]]),s.value?(e.openBlock(),e.createElementBlock("div",am,[c.value?(e.openBlock(),e.createElementBlock("div",cm," 渲染后的 Markdown 仅在此面板显示,不会撑大节点框。 ")):(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-note-preview-body",innerHTML:u.value},null,8,sm))])):e.createCommentVNode("",!0)]),!t.readonly&&!c.value?(e.openBlock(),e.createElementBlock("div",dm,[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",um,[!w.value&&!M.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-note-add-chip",onClick:B[1]||(B[1]=ue=>M.value=!0)},"+ 链接")):e.createCommentVNode("",!0),!k.value&&!S.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-note-add-chip",onClick:B[2]||(B[2]=ue=>S.value=!0)},"+ 图片")):e.createCommentVNode("",!0),!_.value&&!A.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-note-add-chip",onClick:B[3]||(B[3]=ue=>A.value=!0)},"+ 代码块")):e.createCommentVNode("",!0),!x.value&&!C.value?(e.openBlock(),e.createElementBlock("button",{key:3,class:"zm-note-add-chip",onClick:B[4]||(B[4]=ue=>C.value=!0)},"+ 表格")):e.createCommentVNode("",!0)])),w.value||M.value?(e.openBlock(),e.createElementBlock("section",mm,[B[15]||(B[15]=e.createElementVNode("header",{class:"zm-note-section-head"},[e.createElementVNode("span",{class:"zm-note-section-title"},"链接")],-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":B[5]||(B[5]=ue=>h.value=ue),class:"zm-note-input",type:"url",placeholder:"https://…",disabled:t.readonly,onBlur:O,onKeydown:B[6]||(B[6]=e.withKeys(e.withModifiers(ue=>ue.target.blur(),["prevent"]),["enter"]))},null,40,fm),[[e.vModelText,h.value]]),w.value?(e.openBlock(),e.createElementBlock("a",{key:0,class:"zm-note-link-chip",href:(ie=t.selectedNode.link)==null?void 0:ie.url,target:"_blank",rel:"noopener noreferrer",title:(ae=t.selectedNode.link)==null?void 0:ae.url},e.toDisplayString((D=t.selectedNode.link)==null?void 0:D.url),9,pm)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),k.value||S.value?(e.openBlock(),e.createElementBlock("section",gm,[B[16]||(B[16]=e.createElementVNode("header",{class:"zm-note-section-head"},[e.createElementVNode("span",{class:"zm-note-section-title"},"图片")],-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":B[7]||(B[7]=ue=>W.value=ue),class:"zm-note-input",type:"url",placeholder:"data:image/… 或 https://…",disabled:t.readonly,onBlur:oe,onKeydown:B[8]||(B[8]=e.withKeys(e.withModifiers(ue=>ue.target.blur(),["prevent"]),["enter"]))},null,40,hm),[[e.vModelText,W.value]]),k.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:K,onLoad:te},null,40,bm)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),_.value||A.value?(e.openBlock(),e.createElementBlock("section",km,[e.createElementVNode("header",ym,[B[17]||(B[17]=e.createElementVNode("span",{class:"zm-note-section-title"},"代码块",-1)),e.unref(qt)(le.value)?(e.openBlock(),e.createElementBlock("span",Em,e.toDisplayString(e.unref(qt)(le.value)),1)):e.createCommentVNode("",!0)]),e.withDirectives(e.createElementVNode("textarea",{ref_key:"codeRef",ref:G,"onUpdate:modelValue":B[9]||(B[9]=ue=>le.value=ue),class:"zm-note-input zm-note-input-code",placeholder:"```ts\nconsole.log(123)\n```",spellcheck:"false",disabled:t.readonly,onBlur:F},null,40,xm),[[e.vModelText,le.value]]),le.value.trim()?(e.openBlock(),e.createElementBlock("pre",wm,[e.createElementVNode("code",{innerHTML:Y.value},null,8,Nm)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),x.value||C.value?(e.openBlock(),e.createElementBlock("section",Sm,[B[18]||(B[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:$,"onUpdate:modelValue":B[10]||(B[10]=ue=>N.value=ue),class:"zm-note-input zm-note-input-code",placeholder:`| 列1 | 列2 |
131
+ | --- | --- |
132
+ | a | b |`,spellcheck:"false",disabled:t.readonly,onBlur:X},null,40,Tm),[[e.vModelText,N.value]]),ge.value.length?(e.openBlock(),e.createElementBlock("table",Cm,[e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Be.value,(ue,me)=>(e.openBlock(),e.createElementBlock("tr",{key:me},[me===0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(ue,(De,Ze)=>(e.openBlock(),e.createElementBlock("th",{key:`h${Ze}`,class:e.normalizeClass(["zm-note-table-sort",{"is-sorted":L.value===Ze,"is-asc":L.value===Ze&&j.value==="asc","is-desc":L.value===Ze&&j.value==="desc"}]),onClick:Ge=>Ue(Ze)},[e.createElementVNode("span",null,e.toDisplayString(De),1),e.createElementVNode("span",Am,e.toDisplayString(L.value===Ze?j.value==="asc"?"▲":"▼":"↕"),1)],10,_m))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(ue,(De,Ze)=>(e.openBlock(),e.createElementBlock("td",{key:`c${Ze}`},e.toDisplayString(De),1))),128))]))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])],64)):(e.openBlock(),e.createElementBlock("div",Xu,[...B[11]||(B[11]=[e.createElementVNode("p",null,"请先在画布上选中一个节点。",-1),e.createElementVNode("p",{class:"zm-note-hint"}," 选中节点后,会在这里展示并可编辑节点的笔记、链接、图片、代码块、表格。 ",-1)])]))])}}}),Mm={class:"zm-app"},Rm={class:"zm-app-main"},Bm={key:0,class:"zm-app-toolbar"},zm={class:"zm-app-tip"},Om={class:"zm-app-canvas"},Im={class:"zm-settings-popover-header"},$r=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:`本导图用于演示节点的全部可渲染字段。
133
+ 所有代码块 / 表格在节点标题上方显示,不会撑大节点框。`},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
+ 渲染在节点标题上方,自动支持语言 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
+ interface Node {
136
+ id: string
137
+ text: string
138
+ children: Node[]
139
+ collapsed?: boolean
140
+ image?: { src: string }
141
+ link?: { url: string }
142
+ note?: { text: string }
143
+ richContent?: RichContent
144
+ }
145
+ function walk(n: Node) {
146
+ console.log(n.id)
147
+ n.children.forEach(walk)
148
+ }
149
+ \`\`\``},children:[]}]},{id:"r_table",text:"表格",richContent:{kind:"table",raw:`| 字段 | 类型 | 说明 |
150
+ | --- | --- | --- |
151
+ | id | string | 节点唯一 id |
152
+ | text | string | 节点标题 |
153
+ | children | MindMapNode[] | 子节点数组 |`},children:[{id:"r_table_a",text:"自动识别 markdown 表格",richContent:{kind:"table",raw:`| key | value |
154
+ | --- | --- |
155
+ | name | flow-mindmap |
156
+ | version | 0.x |`},children:[]},{id:"r_table_b",text:"忽略对齐分隔行",richContent:{kind:"table",raw:`| 左对齐 | 居中 | 右对齐 |
157
+ | :--- | :---: | ---: |
158
+ | L1 | C1 | R1 |
159
+ | L2 | C2 | R2 |`},children:[]},{id:"r_table_c",text:"保留所有行 / 所有列",richContent:{kind:"table",raw:`| a | b | c | d | e |
160
+ | --- | --- | --- | --- | --- |
161
+ | 1 | 2 | 3 | 4 | 5 |
162
+ | 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=(me,De)=>({id:me,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","左七")],ue=[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,...ue]}})(),a=e.ref(o),c=t,u=e.ref(null),s=e.ref(new Set),m=e.ref(!1),p=e.ref(!1),g=e.ref(!1),y=e.ref(!1),w=e.ref(0),k=e.ref(!1),b=e.ref(!1),_=e.ref(null);function x(){a.value=n(),M.value=typeof location<"u"&&location.hash==="#rich"}const M=e.ref(!0);function S(){p.value=!0,g.value=!1,y.value=!1}function A(D){S()}const C=e.reactive({autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:3.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"curve",layoutMode:"mindmap",taperedEdge:!0,showOrderBadge:!1});function h(D){var T;Object.assign(C,D),(T=_.value)==null||T.applySettings(D)}function O(D){var T;u.value&&((T=_.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(C,D),(T=_.value)==null||T.applySettings(D)}function oe(D){if(!k.value)return;const T=D.target;T&&T.closest(".zm-settings-popover")||T&&T.closest('.zm-app-icon-btn[title="显示设置"]')||(k.value=!1)}function K(D){if(D.key==="Escape"){if(k.value){k.value=!1,D.stopPropagation();return}b.value&&(b.value=!1,D.stopPropagation())}}e.onMounted(()=>{var D;document.addEventListener("click",oe),document.addEventListener("keydown",K),window.addEventListener("hashchange",x),(D=_.value)==null||D.applySettings({rainbowBranch:C.rainbowBranch,branchPaletteId:C.branchPaletteId,customPalettes:C.customPalettes,lineWidthStart:C.lineWidthStart,lineWidthEnd:C.lineWidthEnd,lineStyle:C.lineStyle})}),e.onBeforeUnmount(()=>{document.removeEventListener("click",oe),document.removeEventListener("keydown",K),window.removeEventListener("hashchange",x)});function te(D){a.value=D}function le(D){u.value=D,D?y.value||(p.value=!1,g.value=!1,y.value=!0):y.value=!1}e.watch(a,D=>{if(!u.value)return;const T=Y(D,u.value.id);T?T!==u.value&&(u.value=T):u.value=null},{deep:!1});function G(D){if(!u.value||u.value.id!==D){const T=Y(a.value,D);T&&(u.value=T)}p.value=!1,g.value=!1,y.value=!0,w.value++}function Y(D,T){if(D.id===T)return D;for(const ue of D.children){const me=Y(ue,T);if(me)return me}return null}function F(D){var T;u.value&&((T=_.value)==null||T.applyNodeNote(u.value.id,D))}function N(){var D;u.value&&((D=_.value)==null||D.removeNodeNote(u.value.id))}function $(D){var T;u.value&&((T=_.value)==null||T.applyNodeLink(u.value.id,D))}function L(D){var T;u.value&&((T=_.value)==null||T.applyNodeImageByUrl(u.value.id,D))}function j(D){var T;u.value&&((T=_.value)==null||T.applyNodeRichContent(u.value.id,D))}function X(D){const T=document.querySelector(`[data-node-id="${D.id}"]`);T&&T.click()}function ge(D){const T=new Set(s.value);T.has(D)?T.delete(D):T.add(D),s.value=T}function Be(D){var T;(T=_.value)==null||T.setNodeText(D.id,D.text)}function Ue(D){var T;(T=_.value)==null||T.addChild(D)}function Le(D){var T;(T=_.value)==null||T.addSibling(D)}function v(D){var T;(T=_.value)==null||T.moveNode(D.srcId,D.targetId,D.position)}const B=e.computed(()=>{var D;return((D=u.value)==null?void 0:D.id)??null});function ie(D){return 1+D.children.reduce((T,ue)=>T+ie(ue),0)}const ae=e.computed(()=>ie(a.value));return(D,T)=>{var ue;return e.openBlock(),e.createElementBlock("div",Mm,[e.createVNode(Zt,{side:"left",width:300,open:m.value,title:"大纲","onUpdate:open":T[0]||(T[0]=me=>m.value=me)},{default:e.withCtx(()=>[e.createVNode(Co,{data:a.value,"selected-id":B.value,"collapsed-ids":s.value,onSelect:X,onToggleCollapse:ge,onEdit:Be,onAddChild:Ue,onAddSibling:Le,onMove:v},null,8,["data","selected-id","collapsed-ids"])]),_:1},8,["open"]),e.createElementVNode("main",Rm,[b.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Bm,[c.showOutlineBtn&&!m.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-app-icon-btn",title:"显示大纲",onClick:T[1]||(T[1]=me=>m.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]=me=>{p.value=!0,g.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&&!g.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-app-icon-btn",title:"显示 Markdown",onClick:T[3]||(T[3]=me=>{g.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&&!k.value?(e.openBlock(),e.createElementBlock("button",{key:3,class:"zm-app-icon-btn",title:"显示设置",onClick:T[4]||(T[4]=me=>k.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",zm,e.toDisplayString(a.value.text||"未命名")+" · "+e.toDisplayString(ae.value)+" 节点",1),e.createCommentVNode("",!0),c.showPreviewModeBtn?(e.openBlock(),e.createElementBlock("button",{key:5,class:e.normalizeClass(["zm-app-icon-btn",{"is-on":b.value}]),title:"进入预览模式",onClick:T[5]||(T[5]=me=>b.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)])),b.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-app-preview-exit",title:"退出预览 (Esc)",onClick:T[6]||(T[6]=me=>b.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",Om,[e.createVNode(Wn,{ref_key:"mindMapRef",ref:_,data:a.value,"preview-mode":b.value,onChange:te,onSelect:le,onEditNote:G,onCanvasSettings:T[7]||(T[7]=me=>k.value=!0),onCanvasData:S,onCanvasImport:A,onCanvasTogglePreview:T[8]||(T[8]=me=>b.value=!b.value),onCanvasOutline:T[9]||(T[9]=me=>m.value=!0)},null,8,["data","preview-mode"])])]),e.createVNode(Zt,{side:"right",width:360,open:p.value&&!b.value,title:"数据","onUpdate:open":T[11]||(T[11]=me=>p.value=me)},{default:e.withCtx(()=>[e.createVNode(_o,{data:a.value,onImport:T[10]||(T[10]=me=>a.value=me)},null,8,["data"])]),_:1},8,["open"]),e.createVNode(Zt,{side:"right",width:420,open:g.value&&!b.value,title:"Markdown","onUpdate:open":T[13]||(T[13]=me=>g.value=me)},{default:e.withCtx(()=>[e.createVNode(Ao,{data:a.value,onImport:T[12]||(T[12]=me=>a.value=me)},null,8,["data"])]),_:1},8,["open"]),e.createVNode(Zt,{side:"right",width:360,open:y.value&&!b.value,title:"节点内容","onUpdate:open":T[14]||(T[14]=me=>y.value=me)},{default:e.withCtx(()=>[e.createVNode(qo,{"selected-node":u.value,readonly:!1,"focus-tick":w.value,onApply:F,onRemove:N,onSetLink:$,onSetImage:L,onSetRich:j},null,8,["selected-node","focus-tick"])]),_:1},8,["open"]),k.value&&!b.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-settings-backdrop",onClick:T[15]||(T[15]=me=>k.value=!1)})):e.createCommentVNode("",!0),k.value&&!b.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"zm-settings-popover",onClick:T[17]||(T[17]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Im,[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]=me=>k.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(Mo,{settings:C,"has-selection":u.value!==null,"selected-node-text":(ue=u.value)==null?void 0:ue.text,"onUpdate:settings":h,"onUpdate:nodeStyle":O,onReset:W},null,8,["settings","has-selection","selected-node-text"])])):e.createCommentVNode("",!0)])}}}),vm={install(t){t.component("FlowMindMap",Wn),t.component("FlowMindMapOutline",Co),t.component("FlowMindMapDrawer",Zt),t.component("FlowMindMapDataPanel",_o),t.component("FlowMindMapMarkdownPanel",Ao),t.component("FlowMindMapSettingsPanel",Mo),t.component("FlowMindMapNotePanel",qo),t.component("FlowMindMapApp",$r)}};Ee.DataPanel=_o,Ee.Drawer=Zt,Ee.MarkdownPanel=Ao,Ee.MindMap=Wn,Ee.MindMapApp=$r,Ee.NotePanel=qo,Ee.Outline=Co,Ee.SettingsPanel=Mo,Ee.addChild=mi,Ee.addSibling=fi,Ee.clone=pt,Ee.default=vm,Ee.findNode=pe,Ee.findParent=ct,Ee.markdownToMindMap=Ht,Ee.markdownToRichMindMap=Cl,Ee.mindMapToMarkdown=Wt,Ee.removeNode=go,Ee.richBlockToMarkdown=_l,Ee.uid=ft,Object.defineProperties(Ee,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});