flow-mindmap 0.5.4 → 0.5.5
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.
- package/dist/flow-mindmap.js +4699 -4523
- package/dist/flow-mindmap.umd.cjs +57 -53
- package/dist/style.css +2 -2
- package/dist/types.d.ts +12 -1
- package/package.json +2 -2
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
(function(xe,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(xe=typeof globalThis<"u"?globalThis:xe||self,e(xe.FlowMind={},xe.Vue))})(this,function(xe,e){"use strict";var Mg=Object.defineProperty;var Rg=(xe,e,vn)=>e in xe?Mg(xe,e,{enumerable:!0,configurable:!0,writable:!0,value:vn}):xe[e]=vn;var Le=(xe,e,vn)=>Rg(xe,typeof e!="symbol"?e+"":e,vn);var ei;const vn=["width","height","stroke-width"],ka={key:4,points:"6 9 12 15 18 9"},ya={key:5,points:"9 6 15 12 9 18"},Ne=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",ka)):t.name==="expand"?(e.openBlock(),e.createElementBlock("polyline",ya)):t.name==="collapse-all"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:6},[n[8]||(n[8]=e.createStaticVNode('<line x1="4" y1="4" x2="10" y2="10"></line><polyline points="6 10 10 10 10 6"></polyline><line x1="20" y1="4" x2="14" y2="10"></line><polyline points="14 6 14 10 18 10"></polyline><line x1="20" y1="20" x2="14" y2="14"></line><polyline points="14 18 14 14 18 14"></polyline><line x1="4" y1="20" x2="10" y2="14"></line><polyline points="6 14 10 14 10 18"></polyline>',8))],64)):t.name==="expand-all"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:7},[n[9]||(n[9]=e.createStaticVNode('<line x1="10" y1="10" x2="4" y2="4"></line><polyline points="4 6 4 4 6 4"></polyline><line x1="14" y1="10" x2="20" y2="4"></line><polyline points="20 6 20 4 18 4"></polyline><line x1="14" y1="14" x2="20" y2="20"></line><polyline points="20 18 20 20 18 20"></polyline><line x1="10" y1="14" x2="4" y2="20"></line><polyline points="4 18 4 20 6 20"></polyline>',8))],64)):t.name==="expand-level-1"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:8},[n[10]||(n[10]=e.createStaticVNode('<circle cx="12" cy="5" r="1.8" fill="currentColor" stroke="none"></circle><line x1="12" y1="7" x2="12" y2="11"></line><line x1="12" y1="11" x2="5" y2="17"></line><line x1="12" y1="11" x2="12" y2="17"></line><line x1="12" y1="11" x2="19" y2="17"></line><circle cx="5" cy="19" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="12" cy="19" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="19" cy="19" r="1.8" fill="currentColor" stroke="none"></circle>',8))],64)):t.name==="expand-level-2"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:9},[n[11]||(n[11]=e.createStaticVNode('<circle cx="12" cy="3" r="1.4" fill="currentColor" stroke="none"></circle><line x1="12" y1="4.5" x2="12" y2="7"></line><line x1="12" y1="7" x2="5" y2="11"></line><line x1="12" y1="7" x2="12" y2="11"></line><line x1="12" y1="7" x2="19" y2="11"></line><line x1="5" y1="11" x2="3" y2="16"></line><line x1="5" y1="11" x2="7" y2="16"></line><line x1="12" y1="11" x2="10" y2="16"></line><line x1="12" y1="11" x2="14" y2="16"></line><line x1="19" y1="11" x2="17" y2="16"></line><line x1="19" y1="11" x2="21" y2="16"></line><circle cx="5" cy="11" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="12" cy="11" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="19" cy="11" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="3" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="7" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="10" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="14" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="17" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="21" cy="18" r="1.4" fill="currentColor" stroke="none"></circle>',20))],64)):t.name==="zoom-in"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:10},[n[12]||(n[12]=e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"},null,-1)),n[13]||(n[13]=e.createElementVNode("line",{x1:"11",y1:"8",x2:"11",y2:"14"},null,-1)),n[14]||(n[14]=e.createElementVNode("line",{x1:"8",y1:"11",x2:"14",y2:"11"},null,-1)),n[15]||(n[15]=e.createElementVNode("line",{x1:"16",y1:"16",x2:"21",y2:"21"},null,-1))],64)):t.name==="zoom-out"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:11},[n[16]||(n[16]=e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"},null,-1)),n[17]||(n[17]=e.createElementVNode("line",{x1:"8",y1:"11",x2:"14",y2:"11"},null,-1)),n[18]||(n[18]=e.createElementVNode("line",{x1:"16",y1:"16",x2:"21",y2:"21"},null,-1))],64)):t.name==="reset"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:12},[n[19]||(n[19]=e.createElementVNode("polyline",{points:"4 9 4 4 9 4"},null,-1)),n[20]||(n[20]=e.createElementVNode("polyline",{points:"15 4 20 4 20 9"},null,-1)),n[21]||(n[21]=e.createElementVNode("polyline",{points:"20 15 20 20 15 20"},null,-1)),n[22]||(n[22]=e.createElementVNode("polyline",{points:"9 20 4 20 4 15"},null,-1))],64)):t.name==="database"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:13},[n[23]||(n[23]=e.createElementVNode("ellipse",{cx:"12",cy:"6",rx:"7",ry:"2.5"},null,-1)),n[24]||(n[24]=e.createElementVNode("path",{d:"M5 6 V18 C5 19.4 8 20.5 12 20.5 C16 20.5 19 19.4 19 18 V6"},null,-1)),n[25]||(n[25]=e.createElementVNode("path",{d:"M5 12 C5 13.4 8 14.5 12 14.5 C16 14.5 19 13.4 19 12"},null,-1))],64)):t.name==="settings"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:14},[n[26]||(n[26]=e.createElementVNode("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"},null,-1)),n[27]||(n[27]=e.createElementVNode("circle",{cx:"12",cy:"12",r:"3"},null,-1))],64)):t.name==="markdown"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:15},[n[28]||(n[28]=e.createElementVNode("rect",{x:"2",y:"5",width:"20",height:"14",rx:"2"},null,-1)),n[29]||(n[29]=e.createElementVNode("path",{d:"M6 15 V9 L9 12 L12 9 V15"},null,-1)),n[30]||(n[30]=e.createElementVNode("path",{d:"M15 15 V9 L18 12 V9 M15 12 L18 15"},null,-1))],64)):t.name==="txt"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:16},[n[31]||(n[31]=e.createElementVNode("rect",{x:"5",y:"3",width:"14",height:"18",rx:"1.5"},null,-1)),n[32]||(n[32]=e.createElementVNode("line",{x1:"8",y1:"8",x2:"16",y2:"8"},null,-1)),n[33]||(n[33]=e.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1)),n[34]||(n[34]=e.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):t.name==="eye"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:17},[n[35]||(n[35]=e.createElementVNode("path",{d:"M2 12 C4 6 8 3 12 3 C16 3 20 6 22 12 C20 18 16 21 12 21 C8 21 4 18 2 12 Z"},null,-1)),n[36]||(n[36]=e.createElementVNode("circle",{cx:"12",cy:"12",r:"3.2"},null,-1))],64)):t.name==="eye-off"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:18},[n[37]||(n[37]=e.createElementVNode("path",{d:"M3 3 L21 21"},null,-1)),n[38]||(n[38]=e.createElementVNode("path",{d:"M10.5 6.2 C11 6.1 11.5 6 12 6 C16 6 19.5 8.5 21 12 C20.4 13.2 19.6 14.3 18.7 15.2"},null,-1)),n[39]||(n[39]=e.createElementVNode("path",{d:"M6.6 6.6 C4 8.2 2.7 10.2 2 12 C3 14.5 5.2 16.8 8 18.3 C9.2 19 10.6 19.4 12 19.4 C13.5 19.4 14.9 19 16.2 18.3"},null,-1)),n[40]||(n[40]=e.createElementVNode("path",{d:"M9.5 9.5 C9.1 10.2 9 11.1 9 12 C9 13.7 9.8 15.2 11 16.1"},null,-1))],64)):t.name==="outline"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:19},[n[41]||(n[41]=e.createElementVNode("rect",{x:"4",y:"3",width:"16",height:"18",rx:"2"},null,-1)),n[42]||(n[42]=e.createElementVNode("line",{x1:"8",y1:"8",x2:"16",y2:"8"},null,-1)),n[43]||(n[43]=e.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1)),n[44]||(n[44]=e.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):t.name==="logo"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:20},[n[45]||(n[45]=e.createStaticVNode('<circle cx="12" cy="12" r="2.2"></circle><circle cx="4" cy="5" r="1.6"></circle><circle cx="20" cy="5" r="1.6"></circle><circle cx="4" cy="19" r="1.6"></circle><circle cx="20" cy="19" r="1.6"></circle><line x1="10.5" y1="10.8" x2="5.2" y2="6.4"></line><line x1="13.5" y1="10.8" x2="18.8" y2="6.4"></line><line x1="10.5" y1="13.2" x2="5.2" y2="17.6"></line><line x1="13.5" y1="13.2" x2="18.8" y2="17.6"></line>',9))],64)):t.name==="import"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:21},[n[46]||(n[46]=e.createElementVNode("path",{d:"M12 4 V15"},null,-1)),n[47]||(n[47]=e.createElementVNode("polyline",{points:"7 10 12 15 17 10"},null,-1)),n[48]||(n[48]=e.createElementVNode("path",{d:"M4 19 H20"},null,-1))],64)):t.name==="export"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:22},[n[49]||(n[49]=e.createElementVNode("path",{d:"M12 15 V4"},null,-1)),n[50]||(n[50]=e.createElementVNode("polyline",{points:"7 9 12 4 17 9"},null,-1)),n[51]||(n[51]=e.createElementVNode("path",{d:"M4 19 H20"},null,-1))],64)):t.name==="balance"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:23},[n[52]||(n[52]=e.createStaticVNode('<line x1="3" y1="6" x2="21" y2="6"></line><line x1="3" y1="12" x2="21" y2="12"></line><line x1="3" y1="18" x2="21" y2="18"></line><polyline points="9 4 5 6 9 8"></polyline><polyline points="15 4 19 6 15 8"></polyline><polyline points="9 10 5 12 9 14"></polyline><polyline points="15 10 19 12 15 14"></polyline><polyline points="9 16 5 18 9 20"></polyline><polyline points="15 16 19 18 15 20"></polyline>',9))],64)):t.name==="mindmap"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:24},[n[53]||(n[53]=e.createStaticVNode('<circle cx="12" cy="12" r="2.4" fill="currentColor" stroke="none"></circle><line x1="13.4" y1="10.6" x2="18.5" y2="5.5"></line><line x1="13.4" y1="13.4" x2="18.5" y2="18.5"></line><line x1="10.6" y1="10.6" x2="5.5" y2="5.5"></line><line x1="10.6" y1="13.4" x2="5.5" y2="18.5"></line><circle cx="19.5" cy="4.5" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="19.5" cy="19.5" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="4.5" cy="4.5" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="4.5" cy="19.5" r="1.8" fill="currentColor" stroke="none"></circle>',9))],64)):t.name==="tree"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:25},[n[54]||(n[54]=e.createStaticVNode('<circle cx="5" cy="12" r="2" fill="currentColor" stroke="none"></circle><circle cx="19" cy="5" r="2" fill="currentColor" stroke="none"></circle><circle cx="19" cy="12" r="2" fill="currentColor" stroke="none"></circle><circle cx="19" cy="19" r="2" fill="currentColor" stroke="none"></circle><line x1="7" y1="12" x2="12" y2="12"></line><line x1="12" y1="12" x2="12" y2="5"></line><line x1="12" y1="12" x2="12" y2="19"></line><line x1="12" y1="5" x2="17" y2="5"></line><line x1="12" y1="19" x2="17" y2="19"></line>',9))],64)):t.name==="org"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:26},[n[55]||(n[55]=e.createStaticVNode('<circle cx="12" cy="5" r="2" fill="currentColor" stroke="none"></circle><circle cx="6" cy="19" r="2" fill="currentColor" stroke="none"></circle><circle cx="12" cy="19" r="2" fill="currentColor" stroke="none"></circle><circle cx="18" cy="19" r="2" fill="currentColor" stroke="none"></circle><line x1="12" y1="7" x2="12" y2="13"></line><line x1="6" y1="13" x2="18" y2="13"></line><line x1="6" y1="13" x2="6" y2="17"></line><line x1="12" y1="13" x2="12" y2="17"></line><line x1="18" y1="13" x2="18" y2="17"></line>',9))],64)):t.name==="image"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:27},[n[56]||(n[56]=e.createElementVNode("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"},null,-1)),n[57]||(n[57]=e.createElementVNode("circle",{cx:"9",cy:"11",r:"1.6"},null,-1)),n[58]||(n[58]=e.createElementVNode("polyline",{points:"3 17 9 12 13 15 16 13 21 17"},null,-1))],64)):t.name==="x"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:28},[n[59]||(n[59]=e.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"},null,-1)),n[60]||(n[60]=e.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"},null,-1))],64)):t.name==="link"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:29},[n[61]||(n[61]=e.createElementVNode("path",{d:"M10 13 a4 4 0 0 0 5.66 0 l3 -3 a4 4 0 1 0 -5.66 -5.66 l-1 1"},null,-1)),n[62]||(n[62]=e.createElementVNode("path",{d:"M14 11 a4 4 0 0 0 -5.66 0 l-3 3 a4 4 0 1 0 5.66 5.66 l1 -1"},null,-1))],64)):t.name==="note"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:30},[n[63]||(n[63]=e.createElementVNode("path",{d:"M6 4 h9 l3 3 v13 a1 1 0 0 1 -1 1 h-11 a1 1 0 0 1 -1 -1 v-15 a1 1 0 0 1 1 -1 z"},null,-1)),n[64]||(n[64]=e.createElementVNode("line",{x1:"8",y1:"10",x2:"16",y2:"10"},null,-1)),n[65]||(n[65]=e.createElementVNode("line",{x1:"8",y1:"13",x2:"16",y2:"13"},null,-1)),n[66]||(n[66]=e.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):t.name==="search"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:31},[n[67]||(n[67]=e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"},null,-1)),n[68]||(n[68]=e.createElementVNode("line",{x1:"16",y1:"16",x2:"21",y2:"21"},null,-1))],64)):t.name==="json"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:32},[n[69]||(n[69]=e.createElementVNode("path",{d:"M8 4 C6 4 6 6 6 7 C6 8 5 8 5 9 C5 10 6 10 6 11 C6 12 6 14 8 14"},null,-1)),n[70]||(n[70]=e.createElementVNode("path",{d:"M16 4 C18 4 18 6 18 7 C18 8 19 8 19 9 C19 10 18 10 18 11 C18 12 18 14 16 14"},null,-1))],64)):t.name==="svg-export"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:33},[n[71]||(n[71]=e.createElementVNode("path",{d:"M6 3 h8 l4 4 v14 a1 1 0 0 1 -1 1 h-11 a1 1 0 0 1 -1 -1 v-15 a1 1 0 0 1 1 -1 z"},null,-1)),n[72]||(n[72]=e.createElementVNode("polyline",{points:"14 3 14 7 18 7"},null,-1)),n[73]||(n[73]=e.createElementVNode("polyline",{points:"8 14 6 16 8 18"},null,-1)),n[74]||(n[74]=e.createElementVNode("polyline",{points:"14 14 16 16 14 18"},null,-1))],64)):e.createCommentVNode("",!0)],8,vn))}}),rr="data:image/svg+xml,%3csvg%20t='1780822312364'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='7459'%20width='200'%20height='200'%3e%3cpath%20d='M329.16%20292.571h658.286V512H329.16zM329.16%200h658.286v219.429H329.16z'%20fill='%239AA1A2'%20p-id='7460'%3e%3c/path%3e%3cpath%20d='M44.927%20146.286a46.519%2046.519%200%200%201%2038.107-73.143h319.269v73.143H109.73V791.99l-48.713%205.705-24.43-651.41h8.339z'%20fill='%239AA1A2'%20p-id='7461'%3e%3c/path%3e%3cpath%20d='M363.83%20877.714H179.51c-78.775%200-142.921-66.12-142.921-147.31V112.787c0-21.943%2017.188-39.643%2038.473-39.643%2021.211%200%2033.5%2017.774%2033.5%2039.643v617.619c0%2037.522%2028.013%2076.58%2064.438%2076.58h190.903c21.211%200%2038.766%2013.97%2038.766%2035.84%200%2021.943-17.555%2034.89-38.766%2034.89z'%20fill='%239AA1A2'%20p-id='7462'%3e%3c/path%3e%3cpath%20d='M432.95%20438.857H179.51c-78.775%200-81.043-18.578-81.043-62.903l10.094-90.624c0%2020.48%2013.458%2080.677%2049.884%2080.677h210.139c21.211%200%20120.613%204.023%20120.613%2016.018%200%2011.922-35.036%2056.832-56.32%2056.832zM640.017%20749.714V640a54.857%2054.857%200%200%201%20109.714%200v109.714h109.715a54.857%2054.857%200%200%201%200%20109.715H749.73v109.714a54.857%2054.857%200%200%201-109.714%200V859.429H530.303a54.857%2054.857%200%200%201%200-109.715h109.714z'%20fill='%239AA1A2'%20p-id='7463'%3e%3c/path%3e%3c/svg%3e",lr="data:image/svg+xml,%3csvg%20t='1780822464335'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='8457'%20width='200'%20height='200'%3e%3cpath%20d='M512%20804.571h512V1024H512V804.571zM0%200h658.286v219.429H0V0z'%20fill='%239AA1A2'%20p-id='8458'%3e%3c/path%3e%3cpath%20d='M619.813%20950.857h-184.32c-78.775%200-142.922-66.121-142.922-147.31V185.93c0-21.943%2017.189-39.643%2038.474-39.643%2021.211%200%2033.353%2017.773%2033.353%2039.643v617.618c0%2037.523%2034.743%2073.728%2071.095%2073.728h184.32c21.211%200%2038.473%2012.069%2038.473%2033.939%200%2021.943-17.189%2039.643-38.473%2039.643z'%20fill='%239AA1A2'%20p-id='8459'%3e%3c/path%3e%3cpath%20d='M676.571%20457.143V347.429a54.857%2054.857%200%200%201%20109.715%200v109.714H896a54.857%2054.857%200%200%201%200%20109.714H786.286v109.714a54.857%2054.857%200%200%201-109.715%200V566.857H566.857a54.857%2054.857%200%200%201%200-109.714h109.714z'%20fill='%239AA1A2'%20p-id='8460'%3e%3c/path%3e%3c/svg%3e",ar=[22,15,13,12],Ea=[700,600,500,400],xa=[52,40,32,28],wa=[120,80,60,44],Na=[.8,.8,.8,.8],Sa=ar.length-1;function Ca(t,o){return Math.round(mi(t,o)*Na[_o(t)])}function _o(t){return Math.min(Sa,Math.max(0,t))}function mi(t,o=14){return Math.round(ar[_o(t)]*o/14*10)/10}function Ta(t,o=14){return Math.round(xa[_o(t)]*o/14)}const io=60,Aa=30,_a=.75,Bn=14,Ot=24;function sr(t){return Math.max(Aa,Math.round(io*Math.pow(_a,t)))}let pi=null;function Ma(){if(pi)return pi;const t=typeof document<"u"?document.createElement("canvas").getContext("2d"):null;return t?(pi=t,t):{font:"",measureText:()=>({width:0})}}const cr=new Map;function Ra(t,o,n){const i=`${n}|${o}|${t}`,a=cr.get(i);if(a!==void 0)return a;const c=Ma();c.font=`${n} ${o}px "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif`;const s=c.measureText(t).width;return cr.set(i,s),s}const va=24,Ba=400,Ia=8,dr=16,ur=4,za=200;function Oa(t,o,n){return Math.min(n,Math.max(o,t))}function La(t,o,n,i,a){const c=_o(o),s=mi(o,n),u=Math.min(Ra(t.text||"",s,Ea[c]),za),d=Ca(o,n),g=Math.ceil(u+d*2),N=!!(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table"))?Math.ceil(s*1.2)+6:Ta(o,n);let C=0;if(t.link&&(C+=dr),t.note&&(C+=dr),C>0){const Y=(t.link?1:0)+(t.note?1:0);C+=ur*Y}const $=14,R=2;let F=0;t.markers&&t.markers.length>0&&(F=t.markers.length*$+(t.markers.length-1)*R+ur);const B=18,_=4,x=t.tags&&t.tags.length>0?B:0,k=g+C+F,m=(()=>{const Y=Math.round(wa[c]*n/14);if(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table")){const oe=a==null?void 0:a[t.id];return Math.max(Y,oe??240)}return Y})(),P=!!(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table")),L=i==null?void 0:i[t.id],S=P?Math.max(24,L??Math.max(70,Math.ceil(s*5))):0,K=S>0?10:0;if(!t.image){const Y=Math.max(m,k),oe=Math.ceil(N+K+S+(x>0?_+x:0));return{w:Y,h:oe}}const J=Oa(t.image.width,va,Ba),de=Math.max(m,k,Math.ceil(J+d*2)),ee=Math.ceil(t.image.height+Ia+N+K+S+(x>0?_+x:0));return{w:de,h:ee}}function Da(t,o={}){const n=o.mode??"mindmap",i=o.preservePositions===!0,a=o.baseFontSize??14,c=mr(t,0,null,1,"right",a,o.richHeights,o.richWidths);return $a(c),Va(c,n,i),c.x=0,c.y=0,Pa(c,i)}function Va(t,o,n=!1){if(o==="mindmap"){const i=t.children;if(i.length!==0)if(i.length===1)i[0]._dir="right",i[0].side=1,i[0]._dirRight=1;else{const u=i.reduce((N,C)=>N+C._subtreeH,0);let d=1,g=Math.abs(i[0]._subtreeH-(u-i[0]._subtreeH)),h=0;for(let N=0;N<i.length-1;N++){h+=i[N]._subtreeH;const C=Math.abs(h-(u-h));C<g&&(g=C,d=N+1)}for(let N=0;N<d;N++)i[N]._dir="right",i[N].side=1,i[N]._dirRight=1;for(let N=d;N<i.length;N++)i[N]._dir="left",i[N].side=-1,i[N]._dirRight=-1}const a=t.children.filter(u=>u.side===1),c=t.children.filter(u=>u.side===-1),s=(u,d)=>{const g=d==="right"?1:-1;u._dir=d,u.side=g,u._dirRight=g;for(const h of u.children)s(h,d)};for(const u of a)s(u,"right");for(const u of c)s(u,"left");if(a.length>0){const u={...t,children:a};Mo(u,"right",io,!0,n)}if(c.length>0){const u={...t,children:c};Mo(u,"left",io,!0,n)}}else if(o==="tree"){const i=a=>{a.side=1,a._dir="right";for(const c of a.children)i(c)};for(const a of t.children)a._dir="right";Mo(t,"right",io,!0,n),i(t)}else{for(const i of t.children)i._dir="down";fr(t,io,n)}}function Mo(t,o,n,i,a=!1){if(t.children.length===0)return;const c=t.children.reduce((h,N,C)=>h+N._subtreeH+(C>0?Bn:0),0),s=o==="right"?1:-1,u=i?s:1;let d=t.y-u*c/2;const g=sr(t.depth);t.children.forEach(h=>{a||(h.x=t.x+s*(t.width/2+g+h.width/2),h.y=d+u*h._subtreeH/2),h._dir=o,d+=u*(h._subtreeH+Bn),Mo(h,o,n,!1,a)})}function fr(t,o,n=!1){if(t.children.length===0)return;const i=t.children.reduce((s,u,d)=>s+u._subtreeW+(d>0?Bn*2:0),0);let a=t.x-i/2;const c=sr(t.depth);t.children.forEach(s=>{n||(s.x=a+s._subtreeW/2,s.y=t.y+t.height/2+c+s.height/2),s._dir="down",a+=s._subtreeW+Bn*2,fr(s,o,n)})}function mr(t,o,n,i,a,c,s,u){const d=La(t,o,c,s,u),g={id:t.id,text:t.text,depth:o,x:t._x??0,y:t._y??0,width:d.w,height:d.h,fontSize:mi(o,c),isRoot:o===0,collapsed:t.collapsed,side:i,_dir:a,_dirRight:i,_subtreeH:d.h,_subtreeW:d.w,image:t.image?{...t.image}:void 0,link:t.link?{url:t.link.url}:void 0,note:t.note?{text:t.note.text}:void 0,richContent:t.richContent?{kind:t.richContent.kind,raw:t.richContent.raw,lang:t.richContent.lang}:void 0,markers:t.markers?[...t.markers]:void 0,tags:t.tags?[...t.tags]:void 0,children:[],parent:n};if(t.collapsed)return g;const h=t.children.length,N=Math.ceil(h/2);return g.children=t.children.map((C,$)=>{const R=o===0?$<N?1:-1:i;return mr(C,o+1,g,R,a,c,s,u)}),g}function $a(t){const o=[t];for(let n=0;n<o.length;n++){const i=o[n];for(const a of i.children)o.push(a)}for(let n=o.length-1;n>=0;n--){const i=o[n];if(i.collapsed||i.children.length===0){i._subtreeH=i.height,i._subtreeW=i.width;continue}let a=0,c=0;for(const s of i.children)a+=s._subtreeH,c+=s._subtreeW;i.children.length>1&&(a+=Bn*(i.children.length-1),c+=Bn*2*(i.children.length-1)),i._subtreeH=Math.max(i.height,a),i._subtreeW=Math.max(i.width,c)}}function Pa(t,o=!1){const n=[t];let i=1/0,a=-1/0,c=1/0,s=-1/0;for(;n.length;){const g=n.pop(),h=g.width/2,N=g.height/2;g.x-h<i&&(i=g.x-h),g.x+h>a&&(a=g.x+h),g.y-N<c&&(c=g.y-N),g.y+N>s&&(s=g.y+N),n.push(...g.children)}if(o)return{root:t,width:a-i+Ot*2,height:s-c+Ot*2,vbX:i-Ot,vbY:c-Ot,vbW:a-i+Ot*2,vbH:s-c+Ot*2};const u=Ot-c,d=[t];for(;d.length;){const g=d.pop();g.y+=u,d.push(...g.children)}return c+=u,s+=u,{root:t,width:a-i+Ot*2,height:s+Ot,vbX:i-Ot,vbY:0,vbW:a-i+Ot*2,vbH:s+Ot}}const on=[{id:"default",name:"默认",colors:["#f87171","#fb923c","#fbbf24","#a3e635","#34d399","#22d3ee","#818cf8","#c084fc"]},{id:"classic",name:"经典",colors:["#ef4444","#f59e0b","#10b981","#3b82f6","#6366f1","#8b5cf6","#ec4899","#14b8a6"]},{id:"vivid",name:"活力",colors:["#dc2626","#ea580c","#ca8a04","#16a34a","#0891b2","#2563eb","#7c3aed","#db2777"]},{id:"dev",name:"代码",colors:["#f472b6","#a78bfa","#60a5fa","#38bdf8","#22d3ee","#34d399","#facc15","#fb923c"]},{id:"mint",name:"薄荷",colors:["#5eead4","#67e8f9","#93c5fd","#c4b5fd","#fbcfe8","#fde68a","#a7f3d0","#bae6fd"]}];function Fa(t,o=[]){return[...on,...o].find(i=>i.id===t)??on[0]}function Ua(t,o=8){const n=[],i=new Set,a=/#[0-9a-fA-F]{3,8}\b|rgba?\([^)]+\)|[A-Za-z][A-Za-z0-9_-]{2,30}/g;let c;for(;(c=a.exec(t))!==null;){const s=c[0];let u=null;if(s.startsWith("#")?u=Ha(s):s.startsWith("rgb")?u=Wa(s):u=Ga[s.toLowerCase()]??null,!u)continue;const d=u.toLowerCase();if(!i.has(d)&&(i.add(d),n.push(d),n.length>=o))break}return n}function Ha(t){const o=t.startsWith("#")?t.slice(1):t;if(!/^[0-9a-fA-F]+$/.test(o))return null;let n;if(o.length===3)n=o.split("").map(i=>i+i).join("");else if(o.length===4)n=o.slice(0,3).split("").map(i=>i+i).join("");else if(o.length===6)n=o;else if(o.length===8)n=o.slice(0,6);else return null;return"#"+n.toLowerCase()}function Wa(t){const o=t.match(/^rgba?\(\s*([^)]+?)\s*\)$/i);if(!o)return null;const n=o[1].split(/\s*,\s*/);if(n.length<3)return null;const i=[];for(let a=0;a<3;a++){const c=n[a];if(c.endsWith("%")){const s=parseFloat(c);if(!isFinite(s))return null;i.push(Math.round(s/100*255))}else{const s=parseInt(c,10);if(!isFinite(s)||s<0||s>255)return null;i.push(s)}}return"#"+i.map(a=>a.toString(16).padStart(2,"0")).join("").toLowerCase()}const Ga={black:"#000000",white:"#ffffff",red:"#ff0000",green:"#008000",blue:"#0000ff",yellow:"#ffff00",cyan:"#00ffff",magenta:"#ff00ff",gray:"#808080",grey:"#808080",silver:"#c0c0c0",maroon:"#800000",olive:"#808000",lime:"#00ff00",aqua:"#00ffff",teal:"#008080",navy:"#000080",fuchsia:"#ff00ff",purple:"#800080",orange:"#ffa500",pink:"#ffc0cb",brown:"#a52a2a",gold:"#ffd700",coral:"#ff7f50",tomato:"#ff6347",salmon:"#fa8072",khaki:"#f0e68c",violet:"#ee82ee",indigo:"#4b0082",turquoise:"#40e0d0",chocolate:"#d2691e",crimson:"#dc143c",darkred:"#8b0000",darkblue:"#00008b",darkgreen:"#006400",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightblue:"#add8e6",lightgreen:"#90ee90",lightyellow:"#ffffe0",lightpink:"#ffb6c1",skyblue:"#87ceeb",forestgreen:"#228b22",royalblue:"#4169e1",steelblue:"#4682b4",hotpink:"#ff69b4",deeppink:"#ff1493",orangered:"#ff4500",goldenrod:"#daa520",mediumpurple:"#9370db"};function Xt(){return"n_"+Math.random().toString(36).slice(2,10)+Date.now().toString(36).slice(-4)}function Lt(t){return JSON.parse(JSON.stringify(t))}function le(t,o){if(t.id===o)return t;for(const n of t.children){const i=le(n,o);if(i)return i}return null}function Wt(t,o,n=null){if(t.id===o)return n;for(const i of t.children){const a=Wt(i,o,t);if(a!==null)return a}return null}function Ro(t,o){const n=t.children.findIndex(i=>i.id===o);if(n>=0)return t.children.splice(n,1),!0;for(const i of t.children)if(Ro(i,o))return!0;return!1}function ja(t,o,n){const i=le(t,o);return!i||i.text===n?!1:(i.text=n,!0)}function Ka(t,o,n,i){if(!Wt(t,o)||o===n||le(le(t,o),n))return!1;const a=Wt(t,o),c=a.children.findIndex(g=>g.id===o);if(c<0)return!1;const[s]=a.children.splice(c,1);if(i==="child"){const g=le(t,n);return g?(g.children.push(s),!0):(a.children.splice(c,0,s),!1)}const u=Wt(t,n);if(!u)return a.children.splice(c,0,s),!1;let d=u.children.findIndex(g=>g.id===n);return d<0?(a.children.splice(c,0,s),!1):(i==="after"&&(d+=1),u.children.splice(d,0,s),!0)}function pr(t){const o=/^新节点(?:\s+(\d+))?$/;let n=0,i=!1;for(const a of t.children){const c=a.text.match(o);if(c)if(c[1]){const s=parseInt(c[1],10);s>n&&(n=s)}else i=!0}return n===0&&!i?Bo:n>0?`新节点 ${n+1}`:"新节点 2"}function gr(t,o,n){const i=le(t,o);if(!i)return null;const a={id:Xt(),text:n??pr(i),children:[]};return i.children.push(a),a}function hr(t,o,n){const i=Wt(t,o);if(!i)return null;const a=i.children.findIndex(s=>s.id===o);if(a<0)return null;const c={id:Xt(),text:n??pr(i),children:[]};return i.children.splice(a+1,0,c),c}function Ya(t,o,n){const i=Wt(t,o);if(!i)return null;const a=i.children.findIndex(s=>s.id===o);if(a<0)return null;const c={id:Xt(),text:n,children:[]};return i.children.splice(a,0,c),c}function qa(t,o){const n=Wt(t,o);if(!n)return null;const i=n.children.findIndex(s=>s.id===o);if(i<0)return null;const a=n.children[i],c=Lt(a);return vo(c),n.children.splice(i+1,0,c),c}function vo(t){t.id=Xt();for(const o of t.children)vo(o)}function br(t,o){const n=le(t,o);if(!n||n.id===t.id)return null;const i=Lt(n);return vo(i),i}const Bo="新节点";function In(t,o="导入的导图"){const n=t.split(/\r?\n/),i={id:Xt(),text:o,children:[]},a=[i],c=[-1/0],s=[],u=/^(#{1,6})\s+(.+?)\s*#*\s*$/,d=/^!\[([^\]]*)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,g=/^\[([^\]]+)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,h=/^(`{3,}|~{3,})\s*(\S+)?\s*$/;let N=!1,C=[],$=null;function R(_){C.push(_)}function F(){if($&&C.length>0){for(;C.length>0&&C[0].trim()==="";)C.shift();for(;C.length>0&&C[C.length-1].trim()==="";)C.pop();const _=C.join(`
|
|
2
|
-
`);
|
|
3
|
-
|
|
1
|
+
(function(Ne,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(Ne=typeof globalThis<"u"?globalThis:Ne||self,e(Ne.FlowMind={},Ne.Vue))})(this,function(Ne,e){"use strict";var qg=Object.defineProperty;var Xg=(Ne,e,vn)=>e in Ne?qg(Ne,e,{enumerable:!0,configurable:!0,writable:!0,value:vn}):Ne[e]=vn;var Ve=(Ne,e,vn)=>Xg(Ne,typeof e!="symbol"?e+"":e,vn);var ei;const vn=["width","height","stroke-width"],wa={key:4,points:"6 9 12 15 18 9"},Na={key:5,points:"9 6 15 12 9 18"},Te=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",wa)):t.name==="expand"?(e.openBlock(),e.createElementBlock("polyline",Na)):t.name==="collapse-all"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:6},[n[8]||(n[8]=e.createStaticVNode('<line x1="4" y1="4" x2="10" y2="10"></line><polyline points="6 10 10 10 10 6"></polyline><line x1="20" y1="4" x2="14" y2="10"></line><polyline points="14 6 14 10 18 10"></polyline><line x1="20" y1="20" x2="14" y2="14"></line><polyline points="14 18 14 14 18 14"></polyline><line x1="4" y1="20" x2="10" y2="14"></line><polyline points="6 14 10 14 10 18"></polyline>',8))],64)):t.name==="expand-all"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:7},[n[9]||(n[9]=e.createStaticVNode('<line x1="10" y1="10" x2="4" y2="4"></line><polyline points="4 6 4 4 6 4"></polyline><line x1="14" y1="10" x2="20" y2="4"></line><polyline points="20 6 20 4 18 4"></polyline><line x1="14" y1="14" x2="20" y2="20"></line><polyline points="20 18 20 20 18 20"></polyline><line x1="10" y1="14" x2="4" y2="20"></line><polyline points="4 18 4 20 6 20"></polyline>',8))],64)):t.name==="expand-level-1"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:8},[n[10]||(n[10]=e.createStaticVNode('<circle cx="12" cy="5" r="1.8" fill="currentColor" stroke="none"></circle><line x1="12" y1="7" x2="12" y2="11"></line><line x1="12" y1="11" x2="5" y2="17"></line><line x1="12" y1="11" x2="12" y2="17"></line><line x1="12" y1="11" x2="19" y2="17"></line><circle cx="5" cy="19" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="12" cy="19" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="19" cy="19" r="1.8" fill="currentColor" stroke="none"></circle>',8))],64)):t.name==="expand-level-2"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:9},[n[11]||(n[11]=e.createStaticVNode('<circle cx="12" cy="3" r="1.4" fill="currentColor" stroke="none"></circle><line x1="12" y1="4.5" x2="12" y2="7"></line><line x1="12" y1="7" x2="5" y2="11"></line><line x1="12" y1="7" x2="12" y2="11"></line><line x1="12" y1="7" x2="19" y2="11"></line><line x1="5" y1="11" x2="3" y2="16"></line><line x1="5" y1="11" x2="7" y2="16"></line><line x1="12" y1="11" x2="10" y2="16"></line><line x1="12" y1="11" x2="14" y2="16"></line><line x1="19" y1="11" x2="17" y2="16"></line><line x1="19" y1="11" x2="21" y2="16"></line><circle cx="5" cy="11" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="12" cy="11" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="19" cy="11" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="3" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="7" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="10" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="14" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="17" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="21" cy="18" r="1.4" fill="currentColor" stroke="none"></circle>',20))],64)):t.name==="zoom-in"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:10},[n[12]||(n[12]=e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"},null,-1)),n[13]||(n[13]=e.createElementVNode("line",{x1:"11",y1:"8",x2:"11",y2:"14"},null,-1)),n[14]||(n[14]=e.createElementVNode("line",{x1:"8",y1:"11",x2:"14",y2:"11"},null,-1)),n[15]||(n[15]=e.createElementVNode("line",{x1:"16",y1:"16",x2:"21",y2:"21"},null,-1))],64)):t.name==="zoom-out"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:11},[n[16]||(n[16]=e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"},null,-1)),n[17]||(n[17]=e.createElementVNode("line",{x1:"8",y1:"11",x2:"14",y2:"11"},null,-1)),n[18]||(n[18]=e.createElementVNode("line",{x1:"16",y1:"16",x2:"21",y2:"21"},null,-1))],64)):t.name==="reset"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:12},[n[19]||(n[19]=e.createElementVNode("polyline",{points:"4 9 4 4 9 4"},null,-1)),n[20]||(n[20]=e.createElementVNode("polyline",{points:"15 4 20 4 20 9"},null,-1)),n[21]||(n[21]=e.createElementVNode("polyline",{points:"20 15 20 20 15 20"},null,-1)),n[22]||(n[22]=e.createElementVNode("polyline",{points:"9 20 4 20 4 15"},null,-1))],64)):t.name==="database"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:13},[n[23]||(n[23]=e.createElementVNode("ellipse",{cx:"12",cy:"6",rx:"7",ry:"2.5"},null,-1)),n[24]||(n[24]=e.createElementVNode("path",{d:"M5 6 V18 C5 19.4 8 20.5 12 20.5 C16 20.5 19 19.4 19 18 V6"},null,-1)),n[25]||(n[25]=e.createElementVNode("path",{d:"M5 12 C5 13.4 8 14.5 12 14.5 C16 14.5 19 13.4 19 12"},null,-1))],64)):t.name==="settings"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:14},[n[26]||(n[26]=e.createElementVNode("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"},null,-1)),n[27]||(n[27]=e.createElementVNode("circle",{cx:"12",cy:"12",r:"3"},null,-1))],64)):t.name==="markdown"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:15},[n[28]||(n[28]=e.createElementVNode("rect",{x:"2",y:"5",width:"20",height:"14",rx:"2"},null,-1)),n[29]||(n[29]=e.createElementVNode("path",{d:"M6 15 V9 L9 12 L12 9 V15"},null,-1)),n[30]||(n[30]=e.createElementVNode("path",{d:"M15 15 V9 L18 12 V9 M15 12 L18 15"},null,-1))],64)):t.name==="txt"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:16},[n[31]||(n[31]=e.createElementVNode("rect",{x:"5",y:"3",width:"14",height:"18",rx:"1.5"},null,-1)),n[32]||(n[32]=e.createElementVNode("line",{x1:"8",y1:"8",x2:"16",y2:"8"},null,-1)),n[33]||(n[33]=e.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1)),n[34]||(n[34]=e.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):t.name==="eye"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:17},[n[35]||(n[35]=e.createElementVNode("path",{d:"M2 12 C4 6 8 3 12 3 C16 3 20 6 22 12 C20 18 16 21 12 21 C8 21 4 18 2 12 Z"},null,-1)),n[36]||(n[36]=e.createElementVNode("circle",{cx:"12",cy:"12",r:"3.2"},null,-1))],64)):t.name==="eye-off"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:18},[n[37]||(n[37]=e.createElementVNode("path",{d:"M3 3 L21 21"},null,-1)),n[38]||(n[38]=e.createElementVNode("path",{d:"M10.5 6.2 C11 6.1 11.5 6 12 6 C16 6 19.5 8.5 21 12 C20.4 13.2 19.6 14.3 18.7 15.2"},null,-1)),n[39]||(n[39]=e.createElementVNode("path",{d:"M6.6 6.6 C4 8.2 2.7 10.2 2 12 C3 14.5 5.2 16.8 8 18.3 C9.2 19 10.6 19.4 12 19.4 C13.5 19.4 14.9 19 16.2 18.3"},null,-1)),n[40]||(n[40]=e.createElementVNode("path",{d:"M9.5 9.5 C9.1 10.2 9 11.1 9 12 C9 13.7 9.8 15.2 11 16.1"},null,-1))],64)):t.name==="outline"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:19},[n[41]||(n[41]=e.createElementVNode("rect",{x:"4",y:"3",width:"16",height:"18",rx:"2"},null,-1)),n[42]||(n[42]=e.createElementVNode("line",{x1:"8",y1:"8",x2:"16",y2:"8"},null,-1)),n[43]||(n[43]=e.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1)),n[44]||(n[44]=e.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):t.name==="logo"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:20},[n[45]||(n[45]=e.createStaticVNode('<circle cx="12" cy="12" r="2.2"></circle><circle cx="4" cy="5" r="1.6"></circle><circle cx="20" cy="5" r="1.6"></circle><circle cx="4" cy="19" r="1.6"></circle><circle cx="20" cy="19" r="1.6"></circle><line x1="10.5" y1="10.8" x2="5.2" y2="6.4"></line><line x1="13.5" y1="10.8" x2="18.8" y2="6.4"></line><line x1="10.5" y1="13.2" x2="5.2" y2="17.6"></line><line x1="13.5" y1="13.2" x2="18.8" y2="17.6"></line>',9))],64)):t.name==="import"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:21},[n[46]||(n[46]=e.createElementVNode("path",{d:"M12 4 V15"},null,-1)),n[47]||(n[47]=e.createElementVNode("polyline",{points:"7 10 12 15 17 10"},null,-1)),n[48]||(n[48]=e.createElementVNode("path",{d:"M4 19 H20"},null,-1))],64)):t.name==="export"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:22},[n[49]||(n[49]=e.createElementVNode("path",{d:"M12 15 V4"},null,-1)),n[50]||(n[50]=e.createElementVNode("polyline",{points:"7 9 12 4 17 9"},null,-1)),n[51]||(n[51]=e.createElementVNode("path",{d:"M4 19 H20"},null,-1))],64)):t.name==="balance"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:23},[n[52]||(n[52]=e.createStaticVNode('<line x1="3" y1="6" x2="21" y2="6"></line><line x1="3" y1="12" x2="21" y2="12"></line><line x1="3" y1="18" x2="21" y2="18"></line><polyline points="9 4 5 6 9 8"></polyline><polyline points="15 4 19 6 15 8"></polyline><polyline points="9 10 5 12 9 14"></polyline><polyline points="15 10 19 12 15 14"></polyline><polyline points="9 16 5 18 9 20"></polyline><polyline points="15 16 19 18 15 20"></polyline>',9))],64)):t.name==="mindmap"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:24},[n[53]||(n[53]=e.createStaticVNode('<circle cx="12" cy="12" r="2.4" fill="currentColor" stroke="none"></circle><line x1="13.4" y1="10.6" x2="18.5" y2="5.5"></line><line x1="13.4" y1="13.4" x2="18.5" y2="18.5"></line><line x1="10.6" y1="10.6" x2="5.5" y2="5.5"></line><line x1="10.6" y1="13.4" x2="5.5" y2="18.5"></line><circle cx="19.5" cy="4.5" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="19.5" cy="19.5" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="4.5" cy="4.5" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="4.5" cy="19.5" r="1.8" fill="currentColor" stroke="none"></circle>',9))],64)):t.name==="tree"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:25},[n[54]||(n[54]=e.createStaticVNode('<circle cx="5" cy="12" r="2" fill="currentColor" stroke="none"></circle><circle cx="19" cy="5" r="2" fill="currentColor" stroke="none"></circle><circle cx="19" cy="12" r="2" fill="currentColor" stroke="none"></circle><circle cx="19" cy="19" r="2" fill="currentColor" stroke="none"></circle><line x1="7" y1="12" x2="12" y2="12"></line><line x1="12" y1="12" x2="12" y2="5"></line><line x1="12" y1="12" x2="12" y2="19"></line><line x1="12" y1="5" x2="17" y2="5"></line><line x1="12" y1="19" x2="17" y2="19"></line>',9))],64)):t.name==="org"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:26},[n[55]||(n[55]=e.createStaticVNode('<circle cx="12" cy="5" r="2" fill="currentColor" stroke="none"></circle><circle cx="6" cy="19" r="2" fill="currentColor" stroke="none"></circle><circle cx="12" cy="19" r="2" fill="currentColor" stroke="none"></circle><circle cx="18" cy="19" r="2" fill="currentColor" stroke="none"></circle><line x1="12" y1="7" x2="12" y2="13"></line><line x1="6" y1="13" x2="18" y2="13"></line><line x1="6" y1="13" x2="6" y2="17"></line><line x1="12" y1="13" x2="12" y2="17"></line><line x1="18" y1="13" x2="18" y2="17"></line>',9))],64)):t.name==="image"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:27},[n[56]||(n[56]=e.createElementVNode("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"},null,-1)),n[57]||(n[57]=e.createElementVNode("circle",{cx:"9",cy:"11",r:"1.6"},null,-1)),n[58]||(n[58]=e.createElementVNode("polyline",{points:"3 17 9 12 13 15 16 13 21 17"},null,-1))],64)):t.name==="x"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:28},[n[59]||(n[59]=e.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"},null,-1)),n[60]||(n[60]=e.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"},null,-1))],64)):t.name==="link"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:29},[n[61]||(n[61]=e.createElementVNode("path",{d:"M10 13 a4 4 0 0 0 5.66 0 l3 -3 a4 4 0 1 0 -5.66 -5.66 l-1 1"},null,-1)),n[62]||(n[62]=e.createElementVNode("path",{d:"M14 11 a4 4 0 0 0 -5.66 0 l-3 3 a4 4 0 1 0 5.66 5.66 l1 -1"},null,-1))],64)):t.name==="note"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:30},[n[63]||(n[63]=e.createElementVNode("path",{d:"M6 4 h9 l3 3 v13 a1 1 0 0 1 -1 1 h-11 a1 1 0 0 1 -1 -1 v-15 a1 1 0 0 1 1 -1 z"},null,-1)),n[64]||(n[64]=e.createElementVNode("line",{x1:"8",y1:"10",x2:"16",y2:"10"},null,-1)),n[65]||(n[65]=e.createElementVNode("line",{x1:"8",y1:"13",x2:"16",y2:"13"},null,-1)),n[66]||(n[66]=e.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):t.name==="search"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:31},[n[67]||(n[67]=e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"},null,-1)),n[68]||(n[68]=e.createElementVNode("line",{x1:"16",y1:"16",x2:"21",y2:"21"},null,-1))],64)):t.name==="json"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:32},[n[69]||(n[69]=e.createElementVNode("path",{d:"M8 4 C6 4 6 6 6 7 C6 8 5 8 5 9 C5 10 6 10 6 11 C6 12 6 14 8 14"},null,-1)),n[70]||(n[70]=e.createElementVNode("path",{d:"M16 4 C18 4 18 6 18 7 C18 8 19 8 19 9 C19 10 18 10 18 11 C18 12 18 14 16 14"},null,-1))],64)):t.name==="svg-export"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:33},[n[71]||(n[71]=e.createElementVNode("path",{d:"M6 3 h8 l4 4 v14 a1 1 0 0 1 -1 1 h-11 a1 1 0 0 1 -1 -1 v-15 a1 1 0 0 1 1 -1 z"},null,-1)),n[72]||(n[72]=e.createElementVNode("polyline",{points:"14 3 14 7 18 7"},null,-1)),n[73]||(n[73]=e.createElementVNode("polyline",{points:"8 14 6 16 8 18"},null,-1)),n[74]||(n[74]=e.createElementVNode("polyline",{points:"14 14 16 16 14 18"},null,-1))],64)):e.createCommentVNode("",!0)],8,vn))}}),rr="data:image/svg+xml,%3csvg%20t='1780822312364'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='7459'%20width='200'%20height='200'%3e%3cpath%20d='M329.16%20292.571h658.286V512H329.16zM329.16%200h658.286v219.429H329.16z'%20fill='%239AA1A2'%20p-id='7460'%3e%3c/path%3e%3cpath%20d='M44.927%20146.286a46.519%2046.519%200%200%201%2038.107-73.143h319.269v73.143H109.73V791.99l-48.713%205.705-24.43-651.41h8.339z'%20fill='%239AA1A2'%20p-id='7461'%3e%3c/path%3e%3cpath%20d='M363.83%20877.714H179.51c-78.775%200-142.921-66.12-142.921-147.31V112.787c0-21.943%2017.188-39.643%2038.473-39.643%2021.211%200%2033.5%2017.774%2033.5%2039.643v617.619c0%2037.522%2028.013%2076.58%2064.438%2076.58h190.903c21.211%200%2038.766%2013.97%2038.766%2035.84%200%2021.943-17.555%2034.89-38.766%2034.89z'%20fill='%239AA1A2'%20p-id='7462'%3e%3c/path%3e%3cpath%20d='M432.95%20438.857H179.51c-78.775%200-81.043-18.578-81.043-62.903l10.094-90.624c0%2020.48%2013.458%2080.677%2049.884%2080.677h210.139c21.211%200%20120.613%204.023%20120.613%2016.018%200%2011.922-35.036%2056.832-56.32%2056.832zM640.017%20749.714V640a54.857%2054.857%200%200%201%20109.714%200v109.714h109.715a54.857%2054.857%200%200%201%200%20109.715H749.73v109.714a54.857%2054.857%200%200%201-109.714%200V859.429H530.303a54.857%2054.857%200%200%201%200-109.715h109.714z'%20fill='%239AA1A2'%20p-id='7463'%3e%3c/path%3e%3c/svg%3e",lr="data:image/svg+xml,%3csvg%20t='1780822464335'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='8457'%20width='200'%20height='200'%3e%3cpath%20d='M512%20804.571h512V1024H512V804.571zM0%200h658.286v219.429H0V0z'%20fill='%239AA1A2'%20p-id='8458'%3e%3c/path%3e%3cpath%20d='M619.813%20950.857h-184.32c-78.775%200-142.922-66.121-142.922-147.31V185.93c0-21.943%2017.189-39.643%2038.474-39.643%2021.211%200%2033.353%2017.773%2033.353%2039.643v617.618c0%2037.523%2034.743%2073.728%2071.095%2073.728h184.32c21.211%200%2038.473%2012.069%2038.473%2033.939%200%2021.943-17.189%2039.643-38.473%2039.643z'%20fill='%239AA1A2'%20p-id='8459'%3e%3c/path%3e%3cpath%20d='M676.571%20457.143V347.429a54.857%2054.857%200%200%201%20109.715%200v109.714H896a54.857%2054.857%200%200%201%200%20109.714H786.286v109.714a54.857%2054.857%200%200%201-109.715%200V566.857H566.857a54.857%2054.857%200%200%201%200-109.714h109.714z'%20fill='%239AA1A2'%20p-id='8460'%3e%3c/path%3e%3c/svg%3e",ar=[22,15,13,12],sr=[700,600,500,400],Sa=[46,36,30,26],Ta=[120,80,60,44],Ca=[.8,.8,.8,.8],Ma=1,Aa=ar.length-1;function _a(t,o){return Math.round(mi(t,o)*Ca[Ao(t)])}function Ao(t){return Math.min(Aa,Math.max(0,t))}function mi(t,o=14){return Math.round(ar[Ao(t)]*o/14*10)/10}function Ra(t,o=14){return Math.round(Sa[Ao(t)]*o/14)}const io=60,Ba=30,va=.75,In=14,zt=24;function cr(t){return Math.max(Ba,Math.round(io*Math.pow(va,t)))}let pi=null;function Ia(){if(pi)return pi;const t=typeof document<"u"?document.createElement("canvas").getContext("2d"):null;return t?(pi=t,t):{font:"",measureText:()=>({width:0})}}const dr=new Map;function ur(t,o,n){const i=`${n}|${o}|${t}`,a=dr.get(i);if(a!==void 0)return a;const c=Ia();c.font=`${n} ${o}px "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif`;const s=t.split(`
|
|
2
|
+
`);let u=0;for(const d of s){const g=c.measureText(d).width;g>u&&(u=g)}return dr.set(i,u),u}const za=24,Oa=400,La=8,fr=16,mr=4,pr=200;function Da(t,o,n){return Math.min(n,Math.max(o,t))}function $a(t,o,n,i,a){const c=Ao(o),s=mi(o,n),u=Math.min(ur(t.text||"",s,sr[c]),pr),d=_a(o,n),g=Math.ceil(u+d*2+Ma*2),h=(t.text||"").split(`
|
|
3
|
+
`);let w=0;for(const ie of h){const me=ur(ie,s,sr[c]);w+=Math.max(1,Math.ceil(me/pr))}w=Math.max(1,w);const P=!!(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table"))?Math.ceil(s*1.2)+6+Math.ceil(s*1.2*(w-1)):Ra(o,n)+Math.ceil(s*1.2*(w-1));let R=0;if(t.link&&(R+=fr),t.note&&(R+=fr),R>0){const ie=(t.link?1:0)+(t.note?1:0);R+=mr*ie}const U=14,I=2;let A=0;t.markers&&t.markers.length>0&&(A=t.markers.length*U+(t.markers.length-1)*I+mr);const x=18,k=4,m=t.tags&&t.tags.length>0?x:0,F=g+R+A,W=(()=>{const ie=Math.round(Ta[c]*n/14);if(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table")){const me=a==null?void 0:a[t.id];return Math.max(ie,me??240)}return ie})(),K=!!(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table")),S=i==null?void 0:i[t.id],ne=K?Math.max(24,S??Math.max(70,Math.ceil(s*5))):0,se=ne>0?10:0;if(!t.image){const ie=Math.max(W,F),me=Math.ceil(P+se+ne+(m>0?k+m:0));return{w:ie,h:me}}const re=Da(t.image.width,za,Oa),Z=Math.max(W,F,Math.ceil(re+d*2)),ce=Math.ceil(t.image.height+La+P+se+ne+(m>0?k+m:0));return{w:Z,h:ce}}function Va(t,o={}){const n=o.mode??"mindmap",i=o.preservePositions===!0,a=o.baseFontSize??14,c=hr(t,0,null,1,"right",a,o.richHeights,o.richWidths);return Fa(c),Pa(c,n,i),c.x=0,c.y=0,Ua(c,i)}function Pa(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((w,C)=>w+C._subtreeH,0);let d=1,g=Math.abs(i[0]._subtreeH-(u-i[0]._subtreeH)),h=0;for(let w=0;w<i.length-1;w++){h+=i[w]._subtreeH;const C=Math.abs(h-(u-h));C<g&&(g=C,d=w+1)}for(let w=0;w<d;w++)i[w]._dir="right",i[w].side=1,i[w]._dirRight=1;for(let w=d;w<i.length;w++)i[w]._dir="left",i[w].side=-1,i[w]._dirRight=-1}const a=t.children.filter(u=>u.side===1),c=t.children.filter(u=>u.side===-1),s=(u,d)=>{const g=d==="right"?1:-1;u._dir=d,u.side=g,u._dirRight=g;for(const h of u.children)s(h,d)};for(const u of a)s(u,"right");for(const u of c)s(u,"left");if(a.length>0){const u={...t,children:a};_o(u,"right",io,!0,n)}if(c.length>0){const u={...t,children:c};_o(u,"left",io,!0,n)}}else if(o==="tree"){const i=a=>{a.side=1,a._dir="right";for(const c of a.children)i(c)};for(const a of t.children)a._dir="right";_o(t,"right",io,!0,n),i(t)}else{for(const i of t.children)i._dir="down";gr(t,io,n)}}function _o(t,o,n,i,a=!1){if(t.children.length===0)return;const c=t.children.reduce((h,w,C)=>h+w._subtreeH+(C>0?In:0),0),s=o==="right"?1:-1,u=i?s:1;let d=t.y-u*c/2;const g=cr(t.depth);t.children.forEach(h=>{a||(h.x=t.x+s*(t.width/2+g+h.width/2),h.y=d+u*h._subtreeH/2),h._dir=o,d+=u*(h._subtreeH+In),_o(h,o,n,!1,a)})}function gr(t,o,n=!1){if(t.children.length===0)return;const i=t.children.reduce((s,u,d)=>s+u._subtreeW+(d>0?In*2:0),0);let a=t.x-i/2;const c=cr(t.depth);t.children.forEach(s=>{n||(s.x=a+s._subtreeW/2,s.y=t.y+t.height/2+c+s.height/2),s._dir="down",a+=s._subtreeW+In*2,gr(s,o,n)})}function hr(t,o,n,i,a,c,s,u){const d=$a(t,o,c,s,u),g={id:t.id,text:t.text,depth:o,x:t._x??0,y:t._y??0,width:d.w,height:d.h,fontSize:mi(o,c),isRoot:o===0,collapsed:t.collapsed,side:i,_dir:a,_dirRight:i,_subtreeH:d.h,_subtreeW:d.w,image:t.image?{...t.image}:void 0,link:t.link?{url:t.link.url}:void 0,note:t.note?{text:t.note.text}:void 0,richContent:t.richContent?{kind:t.richContent.kind,raw:t.richContent.raw,lang:t.richContent.lang}:void 0,markers:t.markers?[...t.markers]:void 0,tags:t.tags?[...t.tags]:void 0,children:[],parent:n};if(t.collapsed)return g;const h=t.children.length,w=Math.ceil(h/2);return g.children=t.children.map((C,P)=>{const R=o===0?P<w?1:-1:i;return hr(C,o+1,g,R,a,c,s,u)}),g}function Fa(t){const o=[t];for(let n=0;n<o.length;n++){const i=o[n];for(const a of i.children)o.push(a)}for(let n=o.length-1;n>=0;n--){const i=o[n];if(i.collapsed||i.children.length===0){i._subtreeH=i.height,i._subtreeW=i.width;continue}let a=0,c=0;for(const s of i.children)a+=s._subtreeH,c+=s._subtreeW;i.children.length>1&&(a+=In*(i.children.length-1),c+=In*2*(i.children.length-1)),i._subtreeH=Math.max(i.height,a),i._subtreeW=Math.max(i.width,c)}}function Ua(t,o=!1){const n=[t];let i=1/0,a=-1/0,c=1/0,s=-1/0;for(;n.length;){const g=n.pop(),h=g.width/2,w=g.height/2;g.x-h<i&&(i=g.x-h),g.x+h>a&&(a=g.x+h),g.y-w<c&&(c=g.y-w),g.y+w>s&&(s=g.y+w),n.push(...g.children)}if(o)return{root:t,width:a-i+zt*2,height:s-c+zt*2,vbX:i-zt,vbY:c-zt,vbW:a-i+zt*2,vbH:s-c+zt*2};const u=zt-c,d=[t];for(;d.length;){const g=d.pop();g.y+=u,d.push(...g.children)}return c+=u,s+=u,{root:t,width:a-i+zt*2,height:s+zt,vbX:i-zt,vbY:0,vbW:a-i+zt*2,vbH:s+zt}}const ln=[{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 Ha(t,o=[]){return[...ln,...o].find(i=>i.id===t)??ln[0]}function Wa(t,o=8){const n=[],i=new Set,a=/#[0-9a-fA-F]{3,8}\b|rgba?\([^)]+\)|[A-Za-z][A-Za-z0-9_-]{2,30}/g;let c;for(;(c=a.exec(t))!==null;){const s=c[0];let u=null;if(s.startsWith("#")?u=Ga(s):s.startsWith("rgb")?u=ja(s):u=Ka[s.toLowerCase()]??null,!u)continue;const d=u.toLowerCase();if(!i.has(d)&&(i.add(d),n.push(d),n.length>=o))break}return n}function Ga(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 ja(t){const o=t.match(/^rgba?\(\s*([^)]+?)\s*\)$/i);if(!o)return null;const n=o[1].split(/\s*,\s*/);if(n.length<3)return null;const i=[];for(let a=0;a<3;a++){const c=n[a];if(c.endsWith("%")){const s=parseFloat(c);if(!isFinite(s))return null;i.push(Math.round(s/100*255))}else{const s=parseInt(c,10);if(!isFinite(s)||s<0||s>255)return null;i.push(s)}}return"#"+i.map(a=>a.toString(16).padStart(2,"0")).join("").toLowerCase()}const Ka={black:"#000000",white:"#ffffff",red:"#ff0000",green:"#008000",blue:"#0000ff",yellow:"#ffff00",cyan:"#00ffff",magenta:"#ff00ff",gray:"#808080",grey:"#808080",silver:"#c0c0c0",maroon:"#800000",olive:"#808000",lime:"#00ff00",aqua:"#00ffff",teal:"#008080",navy:"#000080",fuchsia:"#ff00ff",purple:"#800080",orange:"#ffa500",pink:"#ffc0cb",brown:"#a52a2a",gold:"#ffd700",coral:"#ff7f50",tomato:"#ff6347",salmon:"#fa8072",khaki:"#f0e68c",violet:"#ee82ee",indigo:"#4b0082",turquoise:"#40e0d0",chocolate:"#d2691e",crimson:"#dc143c",darkred:"#8b0000",darkblue:"#00008b",darkgreen:"#006400",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightblue:"#add8e6",lightgreen:"#90ee90",lightyellow:"#ffffe0",lightpink:"#ffb6c1",skyblue:"#87ceeb",forestgreen:"#228b22",royalblue:"#4169e1",steelblue:"#4682b4",hotpink:"#ff69b4",deeppink:"#ff1493",orangered:"#ff4500",goldenrod:"#daa520",mediumpurple:"#9370db"};function Xt(){return"n_"+Math.random().toString(36).slice(2,10)+Date.now().toString(36).slice(-4)}function Ot(t){return JSON.parse(JSON.stringify(t))}function ue(t,o){if(t.id===o)return t;for(const n of t.children){const i=ue(n,o);if(i)return i}return null}function Gt(t,o,n=null){if(t.id===o)return n;for(const i of t.children){const a=Gt(i,o,t);if(a!==null)return a}return null}function Ro(t,o){const n=t.children.findIndex(i=>i.id===o);if(n>=0)return t.children.splice(n,1),!0;for(const i of t.children)if(Ro(i,o))return!0;return!1}function Ya(t,o,n){const i=ue(t,o);return!i||i.text===n?!1:(i.text=n,!0)}function qa(t,o,n,i){if(!Gt(t,o)||o===n||ue(ue(t,o),n))return!1;const a=Gt(t,o),c=a.children.findIndex(g=>g.id===o);if(c<0)return!1;const[s]=a.children.splice(c,1);if(i==="child"){const g=ue(t,n);return g?(g.children.push(s),!0):(a.children.splice(c,0,s),!1)}const u=Gt(t,n);if(!u)return a.children.splice(c,0,s),!1;let d=u.children.findIndex(g=>g.id===n);return d<0?(a.children.splice(c,0,s),!1):(i==="after"&&(d+=1),u.children.splice(d,0,s),!0)}function br(t){const o=/^新节点(?:\s+(\d+))?$/;let n=0,i=!1;for(const a of t.children){const c=a.text.match(o);if(c)if(c[1]){const s=parseInt(c[1],10);s>n&&(n=s)}else i=!0}return n===0&&!i?vo:n>0?`新节点 ${n+1}`:"新节点 2"}function kr(t,o,n){const i=ue(t,o);if(!i)return null;const a={id:Xt(),text:n??br(i),children:[]};return i.children.push(a),a}function yr(t,o,n){const i=Gt(t,o);if(!i)return null;const a=i.children.findIndex(s=>s.id===o);if(a<0)return null;const c={id:Xt(),text:n??br(i),children:[]};return i.children.splice(a+1,0,c),c}function Xa(t,o,n){const i=Gt(t,o);if(!i)return null;const a=i.children.findIndex(s=>s.id===o);if(a<0)return null;const c={id:Xt(),text:n,children:[]};return i.children.splice(a,0,c),c}function Za(t,o){const n=Gt(t,o);if(!n)return null;const i=n.children.findIndex(s=>s.id===o);if(i<0)return null;const a=n.children[i],c=Ot(a);return Bo(c),n.children.splice(i+1,0,c),c}function Bo(t){t.id=Xt();for(const o of t.children)Bo(o)}function Er(t,o){const n=ue(t,o);if(!n||n.id===t.id)return null;const i=Ot(n);return Bo(i),i}const vo="新节点";function zn(t,o="导入的导图"){const n=t.split(/\r?\n/),i={id:Xt(),text:o,children:[]},a=[i],c=[-1/0],s=[],u=/^(#{1,6})\s+(.+?)\s*#*\s*$/,d=/^!\[([^\]]*)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,g=/^\[([^\]]+)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,h=/^(`{3,}|~{3,})\s*(\S+)?\s*$/;let w=!1,C=[],P=null;function R(A){C.push(A)}function U(){if(P&&C.length>0){for(;C.length>0&&C[0].trim()==="";)C.shift();for(;C.length>0&&C[C.length-1].trim()==="";)C.pop();const A=C.join(`
|
|
4
|
+
`);A&&(P.note={text:A})}w=!1,C=[]}for(const A of n){if(w){const W=A.match(h);if(W&&W[1][0]==="`"){U();continue}R(A);continue}const x=A.match(u);if(x){const W=x[1].length,K=x[2].trim();s.push({level:W,text:K,body:""}),P=s[s.length-1];continue}const k=A.match(h);if(k&&k[2]==="note"){w=!0,C=[];continue}const m=A.match(d);if(m&&P){const W=m[2],K=160,S=120;P.image={src:W,naturalW:K,naturalH:S,width:K,height:S};continue}const F=A.match(g);if(F&&P){P.link={url:F[2]},P.text=F[1];continue}if(A.trim().length>0&&P){const W=A.trim();P.body=P.body?P.body+`
|
|
5
|
+
`+W:W}}w&&U();function I(A){for(;a.length>1;){const F=a.length-1,W=c[F];if(W!==void 0&&W<A.level)break;a.pop(),c.pop()}const x=a[a.length-1],k=A.text,m={id:Xt(),text:k,children:[]};A.image&&(m.image={...A.image}),A.link&&(m.link={url:A.link.url}),A.note&&(m.note={text:A.note.text}),A.body&&(m.note={text:A.body}),x.children.push(m),a.push(m),c.push(A.level)}for(const A of s)I(A);if(s.length>0&&s[0].level===1){const A=i.children[0];A&&(i.text=A.text,i.id=A.id,A.image&&(i.image={...A.image}),A.link&&(i.link={url:A.link.url}),A.note&&(i.note={text:A.note.text}),i.children=A.children)}return i}function On(t,o=1){let n="#".repeat(o)+" "+(t.text||"")+`
|
|
4
6
|
`;t.link&&(n+=`[${t.text||"link"}](${t.link.url})
|
|
5
7
|
`),t.image&&(n+=`
|
|
6
8
|
`),t.note&&(n+="```note\n"+t.note.text+"\n```\n"),t.richContent&&(n+=t.richContent.raw+`
|
|
7
|
-
`);for(const i of t.children)n+=
|
|
8
|
-
`).trim();n.push({kind:"code",text:((g=
|
|
9
|
-
`)[0])==null?void 0:g.slice(0,80))||"(空代码块)",raw:
|
|
10
|
-
`),lang:m});continue}const
|
|
11
|
-
`)}),i=m;continue}}const R=
|
|
12
|
-
`)}),i=
|
|
13
|
-
`:""}function Qa(t){const o=t.minScale??.2,n=t.maxScale??1/0,i=t.step??1.2,a=e.ref(1),c=e.ref(0),s=e.ref(0),u=e.ref(!1),d=e.ref(!1),g=e.reactive({x:0,y:0,ox:0,oy:0}),h=e.ref(!1),N=e.reactive({x:0,y:0}),C=e.reactive({x:0,y:0,width:0,height:0}),$=e.ref(0);let R=null;function F(Y){R=Y}function B(Y){Y.preventDefault();const oe=t.getContainer();if(!oe)return;const ie=-Y.deltaY*.001,ye=Math.min(n,Math.max(o,a.value*(1+ie))),y=oe.getBoundingClientRect(),V=Y.clientX-y.left,U=Y.clientY-y.top,j=(V-c.value)/a.value,ae=(U-s.value)/a.value;a.value=ye,c.value=V-j*ye,s.value=U-ae*ye}function _(){a.value=Math.min(n,a.value*i)}function x(){a.value=Math.max(o,a.value/i)}function k(Y){var ie;Y.target.closest(".zm-node, .zm-toolbar, button, input, textarea")||(u.value=!0,d.value=!1,g.x=Y.clientX,g.y=Y.clientY,g.ox=c.value,g.oy=s.value,window.addEventListener("mousemove",m),window.addEventListener("mouseup",P),(ie=Y.preventDefault)==null||ie.call(Y))}function m(Y){if(!u.value)return;const oe=Y.clientX-g.x,ie=Y.clientY-g.y;(Math.abs(oe)>3||Math.abs(ie)>3)&&(d.value=!0),c.value=g.ox+oe,s.value=g.oy+ie}function P(){u.value=!1,window.removeEventListener("mousemove",m),window.removeEventListener("mouseup",P)}function L(Y,oe,ie){h.value=!0,N.x=Y,N.y=oe,C.x=Y,C.y=oe,C.width=0,C.height=0,C.shiftKey=!!(ie!=null&&ie.shift),$.value++,window.addEventListener("mousemove",J),window.addEventListener("mouseup",K)}function S(Y,oe){if(!h.value)return;const ie=Math.min(N.x,Y),ye=Math.min(N.y,oe),y=Math.max(N.x,Y),V=Math.max(N.y,oe);C.x=ie,C.y=ye,C.width=y-ie,C.height=V-ye,$.value++}function K(){h.value=!1,window.removeEventListener("mousemove",J),window.removeEventListener("mouseup",K),R&&R()}function J(Y){if(!h.value)return;const oe=t.getContainer();if(!oe)return;const ie=oe.getBoundingClientRect(),ye=(Y.clientX-ie.left-c.value)/a.value,y=(Y.clientY-ie.top-s.value)/a.value;S(ye,y)}function de(Y,oe,ie,ye=60){const y=t.getContainer();if(!y)return;const V=y.getBoundingClientRect(),U=(V.width-ye*2)/Y,j=(V.height-ye*2)/oe,ae=Math.min(1,Math.max(.3,Math.min(U,j)));a.value=ae,c.value=V.width/2,s.value=V.height/2-ie*ae}function ee(Y,oe,ie,ye,y=80){const V=t.getContainer();if(!V)return;const U=V.getBoundingClientRect();let j=a.value;(ie*j<40||ye*j<40)&&(j=Math.min(n,Math.max(1,60/Math.min(ie,ye)))),a.value=j,c.value=U.width/2-Y*j,s.value=U.height/2-oe*j}return{scale:a,offsetX:c,offsetY:s,isPanning:u,panMoved:d,onWheel:B,zoomIn:_,zoomOut:x,startPan:k,startMarquee:L,updateMarquee:S,isMarquee:h,marquee:C,marqueeVersion:$,setOnMarqueeEnd:F,resetView:de,centerOn:ee}}const es=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform);function kr(t){return es?t.metaKey:t.ctrlKey}function ts(t){function o(){const i=t.getSelectedId();if(i)return i;if(t.defaultTargetId)return t.defaultTargetId();const a=t.getSelectedIds();return a.length>0?a[0]:null}function n(i){var u,d,g;const a=i.target;if(a&&(a.tagName==="INPUT"||a.tagName==="TEXTAREA"||a.isContentEditable)||t.isReadonly()||t.isEditing())return;const c=t.getSelectedId(),s=o();if(s){if(kr(i)&&!i.shiftKey){if(i.key==="d"||i.key==="D"){const h=(u=t.defaultTargetId)==null?void 0:u.call(t);c&&c!==h&&(i.preventDefault(),t.onDuplicate(c));return}if(i.key==="c"||i.key==="C"){const h=t.getSelectedIds();h.length>0&&(i.preventDefault(),t.onCopy(h));return}if(i.key==="x"||i.key==="X"){const h=t.getSelectedIds();h.length>0&&(i.preventDefault(),t.onCut(h));return}if(i.key==="v"||i.key==="V"){if(!t.hasClipboard())return;i.preventDefault();const h=t.getSelectedIds();t.onPaste(h.length>0?h[0]:null);return}if(i.key==="z"||i.key==="Z"){i.preventDefault(),t.onUndo();return}if(i.key==="y"||i.key==="Y"){i.preventDefault(),t.onRedo();return}if(i.key==="Home"){i.preventDefault(),t.onSelectRoot();return}}if(kr(i)&&i.shiftKey&&(i.key==="Z"||i.key==="z")){i.preventDefault(),t.onRedo();return}if(i.key==="Tab")i.preventDefault(),t.onAddChild(s);else if(i.key==="Enter")if(i.preventDefault(),i.shiftKey){const h=(d=t.defaultTargetId)==null?void 0:d.call(t);c&&c!==h&&t.onAddSiblingBefore(c)}else t.onAddSibling(s);else(i.key==="Delete"||i.key==="Backspace")&&c&&c!==((g=t.defaultTargetId)==null?void 0:g.call(t))?(i.preventDefault(),t.onRemove(c)):i.key==="F2"&&c?(i.preventDefault(),t.onStartEdit(c)):i.key==="Escape"?(i.preventDefault(),t.onClearSelection()):i.key==="ArrowDown"?(i.preventDefault(),t.onNavigate(0,1)):i.key==="ArrowUp"?(i.preventDefault(),t.onNavigate(0,-1)):i.key==="ArrowRight"?(i.preventDefault(),t.onNavigate(1,0)):i.key==="ArrowLeft"&&(i.preventDefault(),t.onNavigate(-1,0))}}e.onMounted(()=>{window.addEventListener("keydown",n)}),e.onBeforeUnmount(()=>{window.removeEventListener("keydown",n)})}function ns(t=100){const o=e.ref([]);let n=-1;function i(){return n>0}function a(){return n<o.value.length-1}function c(g){const h=JSON.stringify(g);for(n<o.value.length-1&&(o.value=o.value.slice(0,n+1)),o.value.push(h),n=o.value.length-1;o.value.length>t;)o.value.shift(),n--}function s(){return i()?(n--,JSON.parse(o.value[n])):null}function u(){return a()?(n++,JSON.parse(o.value[n])):null}function d(){o.value=[],n=-1}return{canUndo:i,canRedo:a,record:c,undo:s,redo:u,reset:d}}const os={1:"#ef4444",2:"#f97316",3:"#f59e0b",4:"#eab308",5:"#84cc16",6:"#22c55e",7:"#14b8a6",8:"#3b82f6",9:"#6366f1"},is={label:"优先级",markers:Array.from({length:9},(t,o)=>{const n=o+1,i=os[n];return{id:`priority-${n}`,label:`优先级 ${n}`,svg:`<circle cx="12" cy="12" r="10" fill="${i}"/><text x="12" y="16" text-anchor="middle" font-size="12" font-weight="700" fill="#fff" font-family="sans-serif">${n}</text>`}})};function rs(t){if(t===0)return'<circle cx="12" cy="12" r="10" fill="none" stroke="#94a3b8" stroke-width="2"/>';if(t===100)return'<circle cx="12" cy="12" r="10" fill="#22c55e"/>';const o=t/100*2*Math.PI,n=12+10*Math.sin(o),i=12-10*Math.cos(o);return`<circle cx="12" cy="12" r="10" fill="none" stroke="#e2e8f0" stroke-width="2"/><path d="M 12 12 L 12 2 A 10 10 0 ${t>50?1:0} 1 ${n.toFixed(2)} ${i.toFixed(2)} Z" fill="#3b82f6"/><circle cx="12" cy="12" r="10" fill="none" stroke="#cbd5e1" stroke-width="1"/>`}const ls={label:"进度",markers:[0,25,50,75,100].map(t=>({id:`progress-${t}`,label:`进度 ${t}%`,svg:rs(t)}))},as={label:"旗帜",markers:[{id:"flag-red",label:"红旗",color:"#ef4444"},{id:"flag-orange",label:"橙旗",color:"#f97316"},{id:"flag-yellow",label:"黄旗",color:"#eab308"},{id:"flag-green",label:"绿旗",color:"#22c55e"},{id:"flag-blue",label:"蓝旗",color:"#3b82f6"},{id:"flag-gray",label:"灰旗",color:"#94a3b8"}].map(t=>({id:t.id,label:t.label,svg:`<path d="M6 3 V21" stroke="#475569" stroke-width="2" stroke-linecap="round"/><path d="M6 4 H18 L15 7 L18 10 H6 Z" fill="${t.color}" stroke="${t.color}" stroke-width="1" stroke-linejoin="round"/>`}))},gi=[is,ls,as,{label:"星标",markers:[{id:"star",label:"星标",svg:'<path d="M12 2 L14.5 8.5 L21 9 L16 13.5 L17.5 20 L12 16.5 L6.5 20 L8 13.5 L3 9 L9.5 8.5 Z" fill="#f59e0b" stroke="#f59e0b" stroke-width="1" stroke-linejoin="round"/>'},{id:"star-half",label:"半星",svg:'<path d="M12 2 L14.5 8.5 L21 9 L16 13.5 L17.5 20 L12 16.5 L6.5 20 L8 13.5 L3 9 L9.5 8.5 Z" fill="#e2e8f0" stroke="#f59e0b" stroke-width="1.5" stroke-linejoin="round"/><path d="M12 2 L12 16.5 L6.5 20 L8 13.5 L3 9 L9.5 8.5 Z" fill="#f59e0b" stroke="none"/>'}]},{label:"其他",markers:[{id:"smile",label:"微笑",svg:'<circle cx="12" cy="12" r="10" fill="#fef3c7" stroke="#f59e0b" stroke-width="1.5"/><circle cx="9" cy="10" r="1.2" fill="#92400e"/><circle cx="15" cy="10" r="1.2" fill="#92400e"/><path d="M8 14 Q12 17 16 14" stroke="#92400e" stroke-width="1.5" fill="none" stroke-linecap="round"/>'},{id:"people",label:"人员",svg:'<circle cx="9" cy="8" r="2.5" fill="#3b82f6"/><circle cx="16" cy="8" r="2.5" fill="#3b82f6"/><path d="M4 19 C4 15 6 13 9 13 C12 13 14 15 14 19" fill="#3b82f6"/><path d="M14 19 C14 15.5 15.5 13.5 17.5 13.5 C19.5 13.5 21 15.5 21 19" fill="#3b82f6"/>'},{id:"arrow-up",label:"上箭头",svg:'<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M12 17 V7 M8 11 L12 7 L16 11" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>'},{id:"arrow-down",label:"下箭头",svg:'<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M12 7 V17 M8 13 L12 17 L16 13" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>'},{id:"arrow-right",label:"右箭头",svg:'<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M7 12 H17 M13 8 L17 12 L13 16" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>'},{id:"arrow-left",label:"左箭头",svg:'<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M17 12 H7 M11 8 L7 12 L11 16" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>'}]}],Io={};for(const t of gi)for(const o of t.markers)Io[o.id]=o;function ss(t){return Io[t]}function zo(t){var o;return((o=Io[t])==null?void 0:o.svg)??""}function yr(t){var o;return((o=Io[t])==null?void 0:o.label)??t}function hi(t){let o=0;for(let i=0;i<t.length;i++)o=(o<<5)-o+t.charCodeAt(i),o|=0;const n=Math.abs(o)%360;return{background:`hsl(${n}, 85%, 92%)`,borderColor:`hsl(${n}, 60%, 70%)`,color:`hsl(${n}, 55%, 30%)`}}const cs={key:5,class:"zm-marker-picker"},ds={class:"zm-marker-group-label"},us={class:"zm-marker-grid"},fs=["title","onClick","innerHTML"],ms=e.defineComponent({__name:"NodeContextMenu",props:{x:{},y:{},container:{},hasImage:{type:Boolean,default:!1},hasLink:{type:Boolean,default:!1},hasNote:{type:Boolean,default:!1},hasCode:{type:Boolean,default:!1},hasTable:{type:Boolean,default:!1},nodeMarkers:{default:()=>[]},nodeTags:{default:()=>[]}},emits:["pickImage","setLink","removeLink","editNote","removeNote","removeImage","addCode","editCode","removeCode","addTable","editTable","removeTable","toggleMarker","clearMarkers","addTag","removeTags","close"],setup(t,{emit:o}){const n=t,i=o,a=e.computed(()=>{let x=n.x+2,k=n.y+2;if(n.container){const m=n.container.getBoundingClientRect(),P=180,S=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;x+P>m.right&&(x=Math.max(m.left+4,n.x-P-2)),k+S>m.bottom&&(k=Math.max(m.top+4,n.y-S-2)),x<m.left+2&&(x=m.left+2),k<m.top+2&&(k=m.top+2)}return{left:x,top:k}}),c=e.computed(()=>n.hasImage),s=e.computed(()=>n.hasLink),u=e.computed(()=>n.hasNote),d=e.computed(()=>n.nodeMarkers.length>0),g=e.computed(()=>n.nodeTags.length>0),h=e.ref(!1);function N(){h.value=!h.value}function C(x){return n.nodeMarkers.includes(x)}function $(x){i("toggleMarker",x)}function R(x){const k=x.target;k&&k.closest(".zm-node-menu")||i("close")}function F(x){x.key==="Escape"&&i("close")}function B(){i("close")}window.addEventListener("mousedown",R,!0),window.addEventListener("keydown",F,!0),window.addEventListener("wheel",B,!0),window.addEventListener("scroll",B,!0),e.onBeforeUnmount(()=>{window.removeEventListener("mousedown",R,!0),window.removeEventListener("keydown",F,!0),window.removeEventListener("wheel",B,!0),window.removeEventListener("scroll",B,!0)});function _(x){x(),i("close")}return(x,k)=>(e.openBlock(),e.createElementBlock("div",{class:"zm-node-menu",style:e.normalizeStyle({left:a.value.left+"px",top:a.value.top+"px"}),onContextmenu:k[13]||(k[13]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[0]||(k[0]=e.withModifiers(m=>_(()=>i("pickImage")),["stop"]))},[e.createVNode(Ne,{name:"image",size:13}),e.createElementVNode("span",null,e.toDisplayString(c.value?"替换图片":"添加图片"),1)]),c.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-node-menu-item",onClick:k[1]||(k[1]=e.withModifiers(m=>_(()=>i("removeImage")),["stop"]))},[e.createVNode(Ne,{name:"x",size:13}),k[14]||(k[14]=e.createElementVNode("span",null,"移除图片",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[2]||(k[2]=e.withModifiers(m=>_(()=>i("setLink")),["stop"]))},[e.createVNode(Ne,{name:"link",size:13}),e.createElementVNode("span",null,e.toDisplayString(s.value?"编辑链接":"添加链接"),1)]),s.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-node-menu-item",onClick:k[3]||(k[3]=e.withModifiers(m=>_(()=>i("removeLink")),["stop"]))},[e.createVNode(Ne,{name:"x",size:13}),k[15]||(k[15]=e.createElementVNode("span",null,"移除链接",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[4]||(k[4]=e.withModifiers(m=>_(()=>i("addCode")),["stop"]))},[k[16]||(k[16]=e.createElementVNode("span",{class:"zm-node-menu-icon zm-node-menu-icon-code","aria-hidden":"true"},"{ }",-1)),e.createElementVNode("span",null,e.toDisplayString(t.hasCode?"编辑代码块":"添加代码块"),1)]),t.hasCode?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-node-menu-item",onClick:k[5]||(k[5]=e.withModifiers(m=>_(()=>i("removeCode")),["stop"]))},[e.createVNode(Ne,{name:"x",size:13}),k[17]||(k[17]=e.createElementVNode("span",null,"移除代码块",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[6]||(k[6]=e.withModifiers(m=>_(()=>i("addTable")),["stop"]))},[k[18]||(k[18]=e.createElementVNode("span",{class:"zm-node-menu-icon zm-node-menu-icon-table","aria-hidden":"true"},"▦",-1)),e.createElementVNode("span",null,e.toDisplayString(t.hasTable?"编辑表格":"添加表格"),1)]),t.hasTable?(e.openBlock(),e.createElementBlock("button",{key:3,class:"zm-node-menu-item",onClick:k[7]||(k[7]=e.withModifiers(m=>_(()=>i("removeTable")),["stop"]))},[e.createVNode(Ne,{name:"x",size:13}),k[19]||(k[19]=e.createElementVNode("span",null,"移除表格",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[8]||(k[8]=e.withModifiers(m=>_(()=>i("editNote")),["stop"]))},[e.createVNode(Ne,{name:"note",size:13}),e.createElementVNode("span",null,e.toDisplayString(u.value?"编辑笔记":"添加笔记"),1)]),u.value?(e.openBlock(),e.createElementBlock("button",{key:4,class:"zm-node-menu-item",onClick:k[9]||(k[9]=e.withModifiers(m=>_(()=>i("removeNote")),["stop"]))},[e.createVNode(Ne,{name:"x",size:13}),k[20]||(k[20]=e.createElementVNode("span",null,"移除笔记",-1))])):e.createCommentVNode("",!0),k[25]||(k[25]=e.createElementVNode("div",{class:"zm-node-menu-divider"},null,-1)),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:e.withModifiers(N,["stop"])},[k[21]||(k[21]=e.createElementVNode("span",{class:"zm-node-menu-icon","aria-hidden":"true"},"⚑",-1)),k[22]||(k[22]=e.createElementVNode("span",null,"标记图标",-1)),e.createElementVNode("span",{class:e.normalizeClass(["zm-node-menu-arrow",{"is-open":h.value}])},"›",2)]),h.value?(e.openBlock(),e.createElementBlock("div",cs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(gi),m=>(e.openBlock(),e.createElementBlock("div",{key:m.label,class:"zm-marker-group"},[e.createElementVNode("div",ds,e.toDisplayString(m.label),1),e.createElementVNode("div",us,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.markers,P=>(e.openBlock(),e.createElementBlock("button",{key:P.id,class:e.normalizeClass(["zm-marker-cell",{"is-active":C(P.id)}]),title:P.label,onClick:e.withModifiers(L=>$(P.id),["stop"]),innerHTML:'<svg viewBox="0 0 24 24" width="20" height="20">'+e.unref(zo)(P.id)+"</svg>"},null,10,fs))),128))])]))),128)),d.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-marker-clear",onClick:k[10]||(k[10]=e.withModifiers(m=>i("clearMarkers"),["stop"]))}," 清除所有标记 ")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[11]||(k[11]=e.withModifiers(m=>_(()=>i("addTag")),["stop"]))},[k[23]||(k[23]=e.createElementVNode("span",{class:"zm-node-menu-icon","aria-hidden":"true"},"#",-1)),e.createElementVNode("span",null,e.toDisplayString(g.value?"编辑标签":"添加标签"),1)]),g.value?(e.openBlock(),e.createElementBlock("button",{key:6,class:"zm-node-menu-item",onClick:k[12]||(k[12]=e.withModifiers(m=>_(()=>i("removeTags")),["stop"]))},[e.createVNode(Ne,{name:"x",size:13}),k[24]||(k[24]=e.createElementVNode("span",null,"移除标签",-1))])):e.createCommentVNode("",!0)],36))}}),ps=e.defineComponent({__name:"CanvasContextMenu",props:{x:{},y:{},container:{}},emits:["openSettings","openData","openImport","exportPng","exportSvg","close"],setup(t,{emit:o}){const n=t,i=o,a=e.computed(()=>{let _=n.x+2,x=n.y+2;if(n.container){const k=n.container.getBoundingClientRect(),m=160,P=4+4*28+5;_+m>k.right&&(_=Math.max(k.left+4,n.x-m-2)),x+P>k.bottom&&(x=Math.max(k.top+4,n.y-P-2)),_<k.left+2&&(_=k.left+2),x<k.top+2&&(x=k.top+2)}return{left:_,top:x}}),c=e.ref(null),s=e.ref(null),u=e.ref(null),d=e.computed(()=>{const _=c.value==="import"?s.value:c.value==="export"?u.value:null;if(!_)return{left:"-9999px",top:"-9999px",display:"none"};const x=_.getBoundingClientRect(),k=window.innerWidth,m=window.innerHeight,P=176,L=4+3*28;let S=x.right;S+P>k-4&&(S=Math.max(4,x.left-P));let K=x.top-4;return K+L>m-4&&(K=Math.max(4,m-L-4)),{left:S+"px",top:K+"px",display:"block"}});let g=null,h=null;function N(_){h&&(clearTimeout(h),h=null),g=setTimeout(()=>{c.value=_},60)}function C(){g&&(clearTimeout(g),g=null),h=setTimeout(()=>{c.value=null},120)}e.onBeforeUnmount(()=>{g&&clearTimeout(g),h&&clearTimeout(h)});function $(_){const x=_.target;x&&x.closest(".zm-canvas-menu")||i("close")}function R(_){_.key==="Escape"&&i("close")}function F(){i("close")}window.addEventListener("mousedown",$,!0),window.addEventListener("keydown",R,!0),window.addEventListener("wheel",F,!0),window.addEventListener("scroll",F,!0),e.onBeforeUnmount(()=>{window.removeEventListener("mousedown",$,!0),window.removeEventListener("keydown",R,!0),window.removeEventListener("wheel",F,!0),window.removeEventListener("scroll",F,!0)});function B(_){_(),i("close")}return(_,x)=>(e.openBlock(),e.createElementBlock("div",{class:"zm-canvas-menu",style:e.normalizeStyle({left:a.value.left+"px",top:a.value.top+"px"}),onContextmenu:x[11]||(x[11]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[0]||(x[0]=e.withModifiers(k=>B(()=>i("openData")),["stop"]))},[e.createVNode(Ne,{name:"database",size:13,stroke:1.6}),x[12]||(x[12]=e.createElementVNode("span",null,"查看数据",-1))]),e.createElementVNode("div",{ref_key:"importItemRef",ref:s,class:e.normalizeClass(["zm-canvas-menu-item zm-canvas-menu-item-has-submenu",{"is-open":c.value==="import"}]),onMouseenter:x[5]||(x[5]=k=>N("import")),onMouseleave:C},[e.createVNode(Ne,{name:"import",size:13,stroke:1.6}),x[16]||(x[16]=e.createElementVNode("span",null,"导入",-1)),x[17]||(x[17]=e.createElementVNode("svg",{class:"zm-canvas-menu-caret",width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[e.createElementVNode("polyline",{points:"2.5 1.8 5.2 4 2.5 6.2"})],-1)),c.value==="import"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-canvas-submenu",style:e.normalizeStyle(d.value),onMouseenter:x[4]||(x[4]=k=>N("import")),onMouseleave:C},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[1]||(x[1]=e.withModifiers(k=>B(()=>i("openImport","markdown")),["stop"]))},[e.createVNode(Ne,{name:"markdown",size:13,stroke:1.6}),x[13]||(x[13]=e.createElementVNode("span",null,"Markdown 导入",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[2]||(x[2]=e.withModifiers(k=>B(()=>i("openImport","json")),["stop"]))},[e.createVNode(Ne,{name:"json",size:13,stroke:1.6}),x[14]||(x[14]=e.createElementVNode("span",null,"JSON 文件导入",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[3]||(x[3]=e.withModifiers(k=>B(()=>i("openImport","txt")),["stop"]))},[e.createVNode(Ne,{name:"txt",size:13,stroke:1.6}),x[15]||(x[15]=e.createElementVNode("span",null,"TXT 文件导入",-1))])],36)):e.createCommentVNode("",!0)],34),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[6]||(x[6]=e.withModifiers(k=>B(()=>i("openSettings")),["stop"]))},[e.createVNode(Ne,{name:"settings",size:13,stroke:1.6}),x[18]||(x[18]=e.createElementVNode("span",null,"设置",-1))]),x[23]||(x[23]=e.createElementVNode("div",{class:"zm-canvas-menu-divider"},null,-1)),e.createElementVNode("div",{ref_key:"exportItemRef",ref:u,class:e.normalizeClass(["zm-canvas-menu-item zm-canvas-menu-item-has-submenu",{"is-open":c.value==="export"}]),onMouseenter:x[10]||(x[10]=k=>N("export")),onMouseleave:C},[e.createVNode(Ne,{name:"export",size:13,stroke:1.6}),x[21]||(x[21]=e.createElementVNode("span",null,"导出",-1)),x[22]||(x[22]=e.createElementVNode("svg",{class:"zm-canvas-menu-caret",width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[e.createElementVNode("polyline",{points:"2.5 1.8 5.2 4 2.5 6.2"})],-1)),c.value==="export"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-canvas-submenu",style:e.normalizeStyle(d.value),onMouseenter:x[9]||(x[9]=k=>N("export")),onMouseleave:C},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[7]||(x[7]=e.withModifiers(k=>B(()=>i("exportPng")),["stop"]))},[e.createVNode(Ne,{name:"image",size:13,stroke:1.6}),x[19]||(x[19]=e.createElementVNode("span",null,"导出 PNG",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[8]||(x[8]=e.withModifiers(k=>B(()=>i("exportSvg")),["stop"]))},[e.createVNode(Ne,{name:"svg-export",size:13,stroke:1.6}),x[20]||(x[20]=e.createElementVNode("span",null,"导出 SVG",-1))])],36)):e.createCommentVNode("",!0)],34)],36))}}),gs=["aria-hidden"],hs=["aria-hidden"],bs={key:0,class:"zm-drawer-header"},ks={key:0,class:"zm-drawer-title"},ys={class:"zm-drawer-body"},Es=["aria-hidden"],xs={key:0,class:"zm-drawer-header"},ws={key:0,class:"zm-drawer-title"},Ns={class:"zm-drawer-body"},Dt=e.defineComponent({__name:"Drawer",props:{side:{default:"left"},width:{default:320},open:{type:Boolean,default:!0},title:{default:""},scope:{default:"page"},closable:{type:Boolean,default:!0},closeOnBackdrop:{type:Boolean,default:!0}},emits:["update:open"],setup(t,{emit:o}){const n=o;function i(){n("update:open",!1)}function a(){n("update:open",!1)}return(c,s)=>t.scope==="canvas"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.Transition,{name:"zm-fade"},{default:e.withCtx(()=>[t.open?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-drawer-canvas-backdrop","aria-hidden":!t.open,onClick:s[0]||(s[0]=u=>t.closeOnBackdrop&&a())},null,8,gs)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:t.side==="left"?"zm-slide-left":"zm-slide-right"},{default:e.withCtx(()=>[t.open?(e.openBlock(),e.createElementBlock("aside",{key:0,class:e.normalizeClass(["zm-drawer zm-drawer--canvas",["zm-drawer--"+t.side]]),style:e.normalizeStyle({width:t.width+"px"}),"aria-hidden":!t.open},[t.title||c.$slots.header?(e.openBlock(),e.createElementBlock("div",bs,[t.title?(e.openBlock(),e.createElementBlock("h3",ks,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.renderSlot(c.$slots,"header"),t.closable?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-drawer-close",title:"关闭",onClick:i},[...s[1]||(s[1]=[e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},[e.createElementVNode("path",{d:"M6 6 L18 18 M18 6 L6 18"})],-1)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",ys,[e.renderSlot(c.$slots,"default")])],14,hs)):e.createCommentVNode("",!0)]),_:3},8,["name"])],64)):(e.openBlock(),e.createBlock(e.Transition,{key:1,name:"zm-drawer"},{default:e.withCtx(()=>[t.open?(e.openBlock(),e.createElementBlock("aside",{key:0,class:e.normalizeClass(["zm-drawer",["zm-drawer--"+t.side,{"is-open":t.open}]]),style:e.normalizeStyle({width:t.width+"px"}),"aria-hidden":!t.open},[t.title||c.$slots.header?(e.openBlock(),e.createElementBlock("div",xs,[t.title?(e.openBlock(),e.createElementBlock("h3",ws,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.renderSlot(c.$slots,"header"),t.closable?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-drawer-close",title:"关闭",onClick:i},[...s[2]||(s[2]=[e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},[e.createElementVNode("path",{d:"M6 6 L18 18 M18 6 L6 18"})],-1)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Ns,[e.renderSlot(c.$slots,"default")])],14,Es)):e.createCommentVNode("",!0)]),_:3}))}}),Ss={class:"zm-outline-root"},Cs={class:"zm-outline-search"},Ts={key:0,class:"zm-outline-search-count"},As={key:1,class:"zm-outline-search-count zm-outline-search-empty"},_s={class:"zm-outline-actions"},Ms={width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Rs={key:0,x:"9",y:"9",width:"13",height:"13",rx:"2"},vs={key:1,d:"M5 12 L10 17 L19 7"},Bs={class:"zm-outline"},Is=["data-outline-id","onClick","onDblclick","onDragstart","onDragover","onDragleave","onDrop"],zs=["title","onClick"],Os={width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round"},Ls={key:0,points:"6 9 12 15 18 9"},Ds={key:1,points:"9 6 15 12 9 18"},Vs={key:1,class:"zm-outline-dot"},$s={class:"zm-outline-index"},Ps={key:3,class:"zm-outline-text"},Fs=["onClick"],Us=["src"],Hs=["onClick"],Ws=["src"],Gs=["title","onClick"],js={width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Ks={key:0,x:"9",y:"9",width:"13",height:"13",rx:"2"},Ys={key:1,d:"M5 12 L10 17 L19 7"},Oo=e.defineComponent({__name:"Outline",props:{data:{},selectedId:{default:null},collapsedIds:{default:()=>new Set},readonly:{type:Boolean,default:!1}},emits:["select","toggleCollapse","edit","addChild","addSibling","move"],setup(t,{emit:o}){const n=t,i=o,a=e.ref(""),c=e.ref(null),s=e.ref(-1),u=e.computed(()=>{const p=a.value.trim().toLowerCase();if(!p)return new Set;const O=new Set,D=X=>{var ue;(X.text.toLowerCase().includes(p)||(ue=X.note)!=null&&ue.text&&X.note.text.toLowerCase().includes(p))&&O.add(X.id);for(const Ee of X.children)D(Ee)};return D(n.data),O}),d=e.computed(()=>{if(u.value.size===0)return new Set;const p=new Set,O=D=>{let X=u.value.has(D.id);for(const ue of D.children)O(ue)&&(X=!0);return X&&p.add(D.id),X};return O(n.data),p}),g=e.computed(()=>{const p=[],O=D=>{u.value.has(D.id)&&p.push(D.id);for(const X of D.children)O(X)};return O(n.data),p}),h=e.computed(()=>a.value.trim().length>0),N=e.computed(()=>{const p=[],O=d.value,D=(X,ue,Ee)=>{if(h.value&&!O.has(X.id))return;const tt=X.children.length>0,Ke=h.value?!1:n.collapsedIds.has(X.id);p.push({id:X.id,text:X.text||"(无标题)",depth:ue,siblingIndex:Ee,hasChildren:tt,collapsed:Ke,node:X}),tt&&!Ke&&X.children.forEach((it,nt)=>D(it,ue+1,nt))};return D(n.data,0,0),p});function C(){s.value=g.value.length>0?0:-1}function $(){const p=g.value;p.length!==0&&(s.value=(s.value+1)%p.length,B(s.value))}function R(){const p=g.value;p.length!==0&&(s.value=(s.value-1+p.length)%p.length,B(s.value))}function F(p){p.key==="Enter"?(p.preventDefault(),p.shiftKey?R():$()):p.key==="Escape"&&(p.preventDefault(),a.value="",s.value=-1)}function B(p){const O=g.value[p];if(!O)return;const D=N.value.find(X=>X.id===O);D&&i("select",D.node),e.nextTick(()=>{const X=document.querySelector(`[data-outline-id="${O}"]`);X==null||X.scrollIntoView({block:"nearest",behavior:"smooth"})})}function _(){a.value="",s.value=-1}e.onMounted(()=>{e.nextTick(()=>{var p;return(p=c.value)==null?void 0:p.focus()})});const x=e.ref(null),k=e.ref("");let m=null;function P(p){n.readonly||(x.value=p.id,k.value=p.text,e.nextTick(()=>{m=document.querySelector(".zm-outline-input"),m==null||m.focus(),m==null||m.select()}))}function L(){x.value!=null&&(i("edit",{id:x.value,text:k.value.trim()||"(无标题)"}),S())}function S(){x.value=null,k.value="",m=null}function K(p){p.key==="Enter"?(p.preventDefault(),L()):p.key==="Escape"&&(p.preventDefault(),S())}e.onBeforeUnmount(S);const J=e.ref(null),de=e.ref(null),ee=e.ref(null);function Y(p,O){if(n.readonly){p.preventDefault();return}J.value={id:O.id,text:O.text},p.dataTransfer&&(p.dataTransfer.effectAllowed="move",p.dataTransfer.setData("text/plain",O.id))}function oe(){J.value=null,de.value=null,ee.value=null}function ie(p,O){if(!J.value)return;p.preventDefault(),p.dataTransfer&&(p.dataTransfer.dropEffect="move");const D=V(p);de.value=O.id,ee.value=D}function ye(p){de.value===p.id&&(de.value=null,ee.value=null)}function y(p,O){p.preventDefault();const D=J.value;if(!D)return;const X=V(p);D.id!==O.id&&i("move",{srcId:D.id,targetId:O.id,position:X}),oe()}function V(p,O){const X=p.currentTarget.getBoundingClientRect(),ue=p.clientY-X.top,Ee=X.height;return ue<Ee*.3?"before":ue>Ee*.7?"after":"child"}const U=e.ref(null);let j=null;async function ae(p){try{return await navigator.clipboard.writeText(p),!0}catch{const O=document.createElement("textarea");O.value=p,document.body.appendChild(O),O.select();let D=!1;try{D=document.execCommand("copy")}finally{document.body.removeChild(O)}return D}}async function Me(p,O,D){p.stopPropagation(),await ae(O)&&(U.value=D,j&&clearTimeout(j),j=setTimeout(()=>U.value=null,1200))}const ze=e.computed(()=>{const p=[],O=(D,X)=>{const ue=" ".repeat(X),Ee=X===0?"":"- ";p.push(ue+Ee+(D.text||""));for(const tt of D.children)O(tt,X+1)};return O(n.data,0),p.join(`
|
|
14
|
-
`)}),De=e.ref(!1);let Ae=null;async function E(){await ae(ze.value)&&(De.value=!0,Ae&&clearTimeout(Ae),Ae=setTimeout(()=>De.value=!1,1200))}return(p,O)=>(e.openBlock(),e.createElementBlock("div",Ss,[e.createElementVNode("div",Cs,[O[3]||(O[3]=e.createElementVNode("svg",{class:"zm-outline-search-icon",width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"}),e.createElementVNode("line",{x1:"20",y1:"20",x2:"16",y2:"16"})],-1)),e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:c,"onUpdate:modelValue":O[0]||(O[0]=D=>a.value=D),type:"text",class:"zm-outline-search-input",placeholder:"搜索节点… (Enter 下一个, Shift+Enter 上一个)",onInput:C,onKeydown:F},null,544),[[e.vModelText,a.value]]),g.value.length>0?(e.openBlock(),e.createElementBlock("span",Ts,e.toDisplayString(s.value+1)+"/"+e.toDisplayString(g.value.length),1)):h.value?(e.openBlock(),e.createElementBlock("span",As,"无结果")):e.createCommentVNode("",!0),a.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-outline-search-clear",title:"清除搜索",onClick:_},"×")):e.createCommentVNode("",!0)]),e.createElementVNode("div",_s,[e.createElementVNode("button",{class:e.normalizeClass(["zm-outline-action-btn",{"is-success":De.value}]),title:"复制完整大纲为纯文本",onClick:E},[(e.openBlock(),e.createElementBlock("svg",Ms,[De.value?(e.openBlock(),e.createElementBlock("path",vs)):(e.openBlock(),e.createElementBlock("rect",Rs)),O[4]||(O[4]=e.createElementVNode("path",{d:"M5 15 H4 a2 2 0 0 1 -2 -2 V4 a2 2 0 0 1 2 -2 h9 a2 2 0 0 1 2 2 v1"},null,-1))])),e.createElementVNode("span",null,e.toDisplayString(De.value?"已复制":"复制大纲"),1)],2)]),e.createElementVNode("ul",Bs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.value,D=>(e.openBlock(),e.createElementBlock("li",{key:D.id,"data-outline-id":D.id,class:e.normalizeClass(["zm-outline-row",{"is-selected":D.id===t.selectedId,"is-root":D.depth===0,"is-editing":x.value===D.id,"is-search-hit":u.value.has(D.id),"is-search-current":g.value[s.value]===D.id,"is-drag-over-before":de.value===D.id&&ee.value==="before","is-drag-over-after":de.value===D.id&&ee.value==="after","is-drag-over-child":de.value===D.id&&ee.value==="child"}]),style:e.normalizeStyle({paddingLeft:12+D.depth*16+"px"}),draggable:"true",onClick:X=>i("select",D.node),onDblclick:X=>P(D),onDragstart:X=>Y(X,D),onDragend:oe,onDragover:X=>ie(X,D),onDragleave:()=>ye(D),onDrop:X=>y(X,D)},[D.hasChildren?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-outline-toggle",title:D.collapsed?"展开":"折叠",onClick:e.withModifiers(X=>i("toggleCollapse",D.id),["stop"])},[(e.openBlock(),e.createElementBlock("svg",Os,[D.collapsed?(e.openBlock(),e.createElementBlock("polyline",Ds)):(e.openBlock(),e.createElementBlock("polyline",Ls))]))],8,zs)):(e.openBlock(),e.createElementBlock("span",Vs)),e.createElementVNode("span",$s,e.toDisplayString(D.siblingIndex+1)+".",1),x.value===D.id?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,"onUpdate:modelValue":O[1]||(O[1]=X=>k.value=X),class:"zm-outline-input",onBlur:L,onKeydown:K,onClick:O[2]||(O[2]=e.withModifiers(()=>{},["stop"]))},null,544)),[[e.vModelText,k.value]]):(e.openBlock(),e.createElementBlock("span",Ps,e.toDisplayString(D.text),1)),n.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:4,class:"zm-outline-row-action",title:"添加同级",onClick:e.withModifiers(X=>i("addSibling",D.id),["stop"])},[e.createElementVNode("img",{src:e.unref(rr),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,Us)],8,Fs)),n.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:5,class:"zm-outline-row-action",title:"添加子节点",onClick:e.withModifiers(X=>i("addChild",D.id),["stop"])},[e.createElementVNode("img",{src:e.unref(lr),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,Ws)],8,Hs)),e.createElementVNode("button",{class:e.normalizeClass(["zm-outline-row-copy",{"is-success":U.value===D.id}]),title:U.value===D.id?"已复制":"复制节点文本",onClick:X=>Me(X,D.text,D.id)},[(e.openBlock(),e.createElementBlock("svg",js,[U.value!==D.id?(e.openBlock(),e.createElementBlock("rect",Ks)):(e.openBlock(),e.createElementBlock("path",Ys)),O[5]||(O[5]=e.createElementVNode("path",{d:"M5 15 H4 a2 2 0 0 1 -2 -2 V4 a2 2 0 0 1 2 -2 h9 a2 2 0 0 1 2 2 v1"},null,-1))]))],10,Gs)],46,Is))),128))])]))}}),qs={key:0,class:"zm-jtv-root"},Xs={key:0,class:"zm-jtv-key"},Zs={key:1,class:"zm-jtv-colon"},Js={key:2,class:"zm-jtv-key zm-jtv-bracket"},Qs={key:3,class:"zm-jtv-size"},ec={key:4,class:"zm-jtv-bracket"},tc={key:5,class:"zm-jtv-brace"},nc={key:0,class:"zm-jtv-children"},oc={class:"zm-jtv-key"},ic={key:0,class:"zm-jtv-key"},rc=["src","alt"],lc=["href"],ac=e.defineComponent({__name:"JsonTreeViewer",props:{value:{},keyName:{default:""},isRoot:{type:Boolean,default:!0},path:{default:""},depth:{default:0},query:{default:""},collapsedPaths:{default:()=>new Set}},setup(t){const o=t,n=e.computed(()=>o.value===null?"null":Array.isArray(o.value)?"array":typeof o.value),i=e.computed(()=>n.value==="object"),a=e.computed(()=>n.value==="array");e.computed(()=>!i.value&&!a.value);const c=e.computed(()=>{if(a.value)return`Array(${o.value.length})`;if(i.value){const x=o.value,k=Object.keys(x);return`Object(${k.length} ${k.length===1?"key":"keys"})`}return""}),s=e.computed(()=>a.value?o.value.map((x,k)=>({key:String(k),value:x})):i.value?Object.entries(o.value).map(([x,k])=>({key:x,value:k})):[]),u=e.computed(()=>o.isRoot?"<root>":o.path),d=e.computed(()=>o.collapsedPaths.has(u.value));function g(x,k,m){x!=="<root>"&&(m<2||k===null||typeof k!="object"||o.collapsedPaths.has(x)||o.collapsedPaths.add(x))}o.isRoot||g(u.value,o.value,o.depth);function h(){d.value?o.collapsedPaths.delete(u.value):o.collapsedPaths.add(u.value)}function N(x){return u.value===""?x:`${u.value}.${x}`}function C(x){if(!o.query)return!0;const k=o.query.toLowerCase();return typeof x=="string"?x.toLowerCase().includes(k):x===null?"null".includes(k):String(x).toLowerCase().includes(k)}function $(x){return o.query?x.toLowerCase().includes(o.query.toLowerCase()):!0}function R(x,k){return!o.query||$(x)?!0:k===null||typeof k!="object"?C(k):!0}function F(x){return x===null?"null":typeof x=="string"?x.length>80?`"${x.slice(0,80)}..."`:`"${x}"`:typeof x=="boolean"?x?"true":"false":typeof x=="number"?String(x):typeof x>"u"?"undefined":JSON.stringify(x)}function B(x){if(typeof x!="string")return!1;const k=x.trim();return!!(k.startsWith("data:image/")||/^https?:\/\/.+\.(png|jpe?g|gif|webp|svg|bmp|ico)(\?.*)?$/i.test(k)||/^https?:\/\/.+/i.test(k)&&/\/[^/]+\.(png|jpe?g|gif|webp|svg|bmp|ico)(\?.*)?$/i.test(k))}function _(x){if(!o.query)return null;const k=x.toLowerCase().indexOf(o.query.toLowerCase());return k<0?null:{before:x.slice(0,k),match:x.slice(k,k+o.query.length),after:x.slice(k+o.query.length)}}return(x,k)=>{var P,L,S,K,J,de;const m=e.resolveComponent("JsonTreeViewer",!0);return t.isRoot?(e.openBlock(),e.createElementBlock("div",qs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,ee=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:ee.key,class:"zm-jtv-row"},[e.createVNode(m,{"key-name":ee.key,value:ee.value,path:N(ee.key),depth:t.depth+1,query:t.query,"collapsed-paths":t.collapsedPaths,"is-root":!1},null,8,["key-name","value","path","depth","query","collapsed-paths"])])),[[e.vShow,R(ee.key,ee.value)]])),128))])):i.value||a.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["zm-jtv-branch",{"is-collapsed":d.value}])},[e.createElementVNode("div",{class:"zm-jtv-header",style:e.normalizeStyle({paddingLeft:6+t.depth*12+"px"}),onClick:h},[e.createElementVNode("span",{class:e.normalizeClass(["zm-jtv-toggle",{"is-leaf":!1}])},e.toDisplayString(d.value?"▶":"▼"),1),a.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",Xs,e.toDisplayString(t.keyName),1)),a.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",Zs,":")),a.value?(e.openBlock(),e.createElementBlock("span",Js,"[")):e.createCommentVNode("",!0),d.value?(e.openBlock(),e.createElementBlock("span",Qs,e.toDisplayString(c.value),1)):e.createCommentVNode("",!0),d.value&&a.value?(e.openBlock(),e.createElementBlock("span",ec,"]")):e.createCommentVNode("",!0),d.value&&i.value?(e.openBlock(),e.createElementBlock("span",tc,"}")):e.createCommentVNode("",!0)],4),d.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",nc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,ee=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:ee.key,class:"zm-jtv-row"},[e.createVNode(m,{"key-name":ee.key,value:ee.value,path:N(ee.key),depth:t.depth+1,query:t.query,"collapsed-paths":t.collapsedPaths,"is-root":!1},null,8,["key-name","value","path","depth","query","collapsed-paths"])])),[[e.vShow,R(ee.key,ee.value)]])),128))])),!d.value&&a.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"zm-jtv-footer",style:e.normalizeStyle({paddingLeft:6+t.depth*12+"px"})},"]",4)):e.createCommentVNode("",!0),!d.value&&i.value&&!a.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"zm-jtv-footer",style:e.normalizeStyle({paddingLeft:6+t.depth*12+"px"})},"}",4)):e.createCommentVNode("",!0)],2)):(e.openBlock(),e.createElementBlock("div",{key:2,class:"zm-jtv-leaf",style:e.normalizeStyle({paddingLeft:6+t.depth*12+"px"})},[k[2]||(k[2]=e.createElementVNode("span",{class:"zm-jtv-toggle is-leaf"},"·",-1)),e.createElementVNode("span",oc,e.toDisplayString(t.keyName),1),k[3]||(k[3]=e.createElementVNode("span",{class:"zm-jtv-colon"},":",-1)),$(t.keyName)&&_(t.keyName)?(e.openBlock(),e.createElementBlock("span",ic,[e.createElementVNode("span",null,e.toDisplayString((P=_(t.keyName))==null?void 0:P.before),1),e.createElementVNode("mark",null,e.toDisplayString((L=_(t.keyName))==null?void 0:L.match),1),e.createElementVNode("span",null,e.toDisplayString((S=_(t.keyName))==null?void 0:S.after),1)])):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(["zm-jtv-value",`zm-jtv-${n.value}`])},[_(F(t.value))?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("span",null,e.toDisplayString((K=_(F(t.value)))==null?void 0:K.before),1),e.createElementVNode("mark",null,e.toDisplayString((J=_(F(t.value)))==null?void 0:J.match),1),e.createElementVNode("span",null,e.toDisplayString((de=_(F(t.value)))==null?void 0:de.after),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(F(t.value)),1)],64))],2),B(t.value)?(e.openBlock(),e.createElementBlock("span",{key:1,class:"zm-jtv-thumb-wrap",onClick:k[1]||(k[1]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("img",{class:"zm-jtv-thumb",src:String(t.value),alt:t.keyName,loading:"lazy",referrerpolicy:"no-referrer"},null,8,rc),e.createElementVNode("a",{class:"zm-jtv-thumb-link",href:String(t.value),target:"_blank",rel:"noopener noreferrer",onClick:k[0]||(k[0]=e.withModifiers(()=>{},["stop"]))},"open",8,lc)])):e.createCommentVNode("",!0)],4))}}}),sc={class:"zm-data-panel"},cc={class:"zm-data-header"},dc={class:"zm-data-title"},uc={class:"zm-data-title-meta"},fc={class:"zm-data-toolbar"},mc=["title"],pc={key:0,width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},gc={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"},hc={key:0,class:"zm-data-paste"},bc={class:"zm-data-tabs"},kc=["placeholder"],yc={key:0,class:"zm-data-error"},Ec={class:"zm-data-paste-actions"},xc=["disabled"],wc={class:"zm-data-tree"},Lo=e.defineComponent({__name:"DataPanel",props:{data:{},pendingMode:{default:null}},emits:["import","consumed-mode"],setup(t,{emit:o}){const n=t,i=o,a=e.computed(()=>JSON.stringify(n.data,null,2)),c=e.ref(""),s=e.ref(null),u=e.ref(!1),d=e.ref("json"),g=e.ref("idle"),h=e.ref(new Set),N=e.ref("");e.watch(()=>n.pendingMode,k=>{k&&(u.value=!0,d.value=k,i("consumed-mode"))},{immediate:!0});async function C(){try{await navigator.clipboard.writeText(a.value),g.value="copied",setTimeout(()=>g.value="idle",1500)}catch{const k=document.createElement("textarea");k.value=a.value,document.body.appendChild(k),k.select();try{document.execCommand("copy"),g.value="copied",setTimeout(()=>g.value="idle",1500)}finally{document.body.removeChild(k)}}}function $(){const k=new Blob([a.value],{type:"application/json"}),m=URL.createObjectURL(k),P=document.createElement("a");P.href=m,P.download=`${n.data.text||"mindmap"}.json`,P.click(),URL.revokeObjectURL(m)}function R(){s.value=null;const k=c.value.trim();if(k){if(d.value==="markdown"||d.value==="txt"){try{const m=In(k);i("import",m),c.value="",u.value=!1}catch(m){s.value=(d.value==="txt"?"TXT 解析失败:":"Markdown 解析失败:")+m.message}return}try{const m=JSON.parse(k);if(!m.id||!Array.isArray(m.children)){s.value="JSON 缺少 id 或 children 字段";return}i("import",m),c.value="",u.value=!1}catch(m){s.value="JSON 解析失败:"+m.message}}}function F(k){return 1+k.children.reduce((m,P)=>m+F(P),0)}const B=e.computed(()=>F(n.data)),_=e.computed(()=>a.value.length);function x(){const k=document.createElement("input");k.type="file",k.accept="application/json",k.onchange=()=>{var L;const m=(L=k.files)==null?void 0:L[0];if(!m)return;const P=new FileReader;P.onload=()=>{typeof P.result=="string"&&(c.value=P.result,R())},P.readAsText(m)},k.click()}return(k,m)=>(e.openBlock(),e.createElementBlock("div",sc,[e.createElementVNode("div",cc,[e.createElementVNode("div",dc,[m[8]||(m[8]=e.createElementVNode("span",{class:"zm-data-title-text"},"数据 JSON",-1)),e.createElementVNode("span",uc,e.toDisplayString(B.value)+" 节点 · "+e.toDisplayString(_.value)+" chars",1)])]),e.createElementVNode("div",fc,[e.createElementVNode("button",{class:e.normalizeClass(["zm-data-btn is-icon",{"is-success":g.value==="copied"}]),title:g.value==="copied"?"已复制":"复制 JSON 到剪贴板",onClick:C},[g.value==="idle"?(e.openBlock(),e.createElementBlock("svg",pc,[...m[9]||(m[9]=[e.createElementVNode("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"},null,-1),e.createElementVNode("path",{d:"M5 15 H4 a2 2 0 0 1 -2 -2 V4 a2 2 0 0 1 2 -2 h9 a2 2 0 0 1 2 2 v1"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",gc,[...m[10]||(m[10]=[e.createElementVNode("polyline",{points:"5 12 10 17 19 7"},null,-1)])])),m[11]||(m[11]=e.createElementVNode("span",{class:"zm-data-btn-label"},"复制",-1))],10,mc),e.createElementVNode("button",{class:"zm-data-btn is-icon",title:"导出为 JSON 文件",onClick:$},[...m[12]||(m[12]=[e.createStaticVNode('<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 4 V15"></path><polyline points="7 9 12 4 17 9"></polyline><path d="M4 19 H20"></path></svg><span class="zm-data-btn-label">导出</span>',2)])]),e.createElementVNode("button",{class:"zm-data-btn is-icon",title:"从 JSON 文件导入",onClick:x},[...m[13]||(m[13]=[e.createStaticVNode('<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 15 V4"></path><polyline points="7 9 12 4 17 9"></polyline><path d="M4 19 H20"></path></svg><span class="zm-data-btn-label">导入</span>',2)])]),e.createElementVNode("button",{class:e.normalizeClass(["zm-data-btn is-icon",{"is-active":u.value}]),title:"粘贴 JSON 或 Markdown 替换当前数据",onClick:m[0]||(m[0]=P=>u.value=!u.value)},[...m[14]||(m[14]=[e.createStaticVNode('<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 4 H15 V8 H9 Z"></path><path d="M9 8 H4 V20 H9"></path><path d="M15 8 H20 V20 H15"></path></svg><span class="zm-data-btn-label">粘贴</span>',2)])],2),m[16]||(m[16]=e.createElementVNode("div",{class:"zm-data-toolbar-spacer"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["zm-data-search",{"is-active":N.value.length>0}])},[m[15]||(m[15]=e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"}),e.createElementVNode("line",{x1:"20",y1:"20",x2:"16",y2:"16"})],-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":m[1]||(m[1]=P=>N.value=P),type:"text",placeholder:"过滤 (键 / 值)",spellcheck:"false"},null,512),[[e.vModelText,N.value]]),N.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-data-search-clear",title:"清空过滤",onClick:m[2]||(m[2]=P=>N.value="")},"×")):e.createCommentVNode("",!0)],2)]),u.value?(e.openBlock(),e.createElementBlock("div",hc,[e.createElementVNode("div",bc,[e.createElementVNode("button",{class:e.normalizeClass(["zm-data-tab",{"is-active":d.value==="json"}]),onClick:m[3]||(m[3]=P=>d.value="json")},"JSON",2),e.createElementVNode("button",{class:e.normalizeClass(["zm-data-tab",{"is-active":d.value==="markdown"}]),onClick:m[4]||(m[4]=P=>d.value="markdown")},"Markdown",2)]),e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":m[5]||(m[5]=P=>c.value=P),placeholder:d.value==="json"?"paste a JSON tree to replace current data":"paste markdown - # / ## / ### become nodes",spellcheck:"false"},null,8,kc),[[e.vModelText,c.value]]),s.value?(e.openBlock(),e.createElementBlock("div",yc,e.toDisplayString(s.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Ec,[e.createElementVNode("button",{class:"zm-data-btn is-primary",disabled:!c.value,onClick:R},"应用",8,xc),e.createElementVNode("button",{class:"zm-data-btn",onClick:m[6]||(m[6]=P=>{c.value="",s.value=null})},"清空"),e.createElementVNode("button",{class:"zm-data-btn",onClick:m[7]||(m[7]=P=>u.value=!1)},"关闭")])])):e.createCommentVNode("",!0),e.createElementVNode("div",wc,[e.createVNode(ac,{value:t.data,query:N.value,"collapsed-paths":h.value},null,8,["value","query","collapsed-paths"])]),m[17]||(m[17]=e.createElementVNode("div",{class:"zm-data-footer"},[e.createElementVNode("span",{class:"zm-data-footer-hint"},[e.createTextVNode(" 图片支持 "),e.createElementVNode("code",null,"data:image/..."),e.createTextVNode(" / "),e.createElementVNode("code",null,"https://..."),e.createTextVNode(" / "),e.createElementVNode("code",null,"/imgs/foo.png"),e.createTextVNode(" (同源)。本地 "),e.createElementVNode("code",null,"file://"),e.createTextVNode(" 路径被浏览器拒绝。 ")])],-1))]))}}),Nc={class:"zm-md-panel"},Sc={key:0,class:"zm-md-error"},Cc={class:"zm-md-split"},Tc={class:"zm-md-edit"},Ac={class:"zm-md-preview"},_c={class:"zm-md-preview-body"},Mc={class:"zm-md-footer"},Rc=["disabled"],vc=`# flow-mindmap 思维导图
|
|
9
|
+
`);for(const i of t.children)n+=On(i,o+1);return n}function Ja(t){var g,h;const o=t.split(/\r?\n/),n=[];let i=0;const a=/^(#{1,6})\s+(.+?)\s*#*\s*$/,c=/^(`{3,}|~{3,})\s*(\S+)?\s*$/,s=/^\s*\|?\s*(:?-+:?\s*\|\s*)+(:?-+:?)(\s*\|)?\s*$/,u=/^(\s*)[-*+]\s+(.*)$/,d=/^(\s*)\d+\.\s+(.*)$/;for(;i<o.length;){const w=o[i],C=w.match(c);if(C){const k=C[1][0],m=C[2]||"",F=[w];for(i++;i<o.length;){const K=o[i].match(c);if(K&&K[1][0]===k){F.push(o[i]),i++;break}F.push(o[i]),i++}const W=F.slice(1,-1).join(`
|
|
10
|
+
`).trim();n.push({kind:"code",text:((g=W.split(`
|
|
11
|
+
`)[0])==null?void 0:g.slice(0,80))||"(空代码块)",raw:F.join(`
|
|
12
|
+
`),lang:m});continue}const P=w.match(a);if(P){n.push({kind:"heading",level:P[1].length,text:P[2].trim(),raw:w}),i++;continue}if(/^\s*\|/.test(w)){const k=[];let m=i,F=!1;for(;m<o.length&&/^\s*\|/.test(o[m]);)k.push(o[m]),s.test(o[m])&&(F=!0),m++;if(F&&k.length>=2){n.push({kind:"table",text:((h=k[0].replace(/^\s*\|/,"").replace(/\|\s*$/,"").split("|")[0])==null?void 0:h.trim())||"表格",raw:k.join(`
|
|
13
|
+
`)}),i=m;continue}}const R=w.match(u),U=w.match(d);if(R||U){let k=i;for(;k<o.length;){const m=o[k].match(u),F=o[k].match(d);if(!(m||F))break;const W=o[k].replace(/^\s*[-*+]\s+/,"").replace(/^\s*\d+\.\s+/,"").trim();W.length>0&&n.push({kind:"list",text:W.slice(0,80)||"(列表项)",raw:o[k]}),k++}i=k;continue}if(w.trim()===""){i++;continue}const I=[w];let A=i+1;for(;A<o.length;){const k=o[A];if(k.trim()===""||a.test(k)||c.test(k)||u.test(k)||d.test(k)||/^\s*\|/.test(k))break;I.push(k),A++}const x=I.join(" ").trim();n.push({kind:"paragraph",text:x.slice(0,80)||"(空段落)",raw:I.join(`
|
|
14
|
+
`)}),i=A}return n}function Qa(t,o="导入的导图"){const n=Ja(t||""),i={id:Xt(),text:o,children:[]},a=[i],c=[0];let s=!1;function u(d){if(d.kind==="heading"){const h=d.level;for(;a.length>1&&c[c.length-1]>=h;)a.pop(),c.pop();if(!s&&h===1){s=!0,i.text=d.text,c[0]=1;return}const w={id:Xt(),text:d.text,children:[]};a[a.length-1].children.push(w),a.push(w),c.push(h);return}const g={id:Xt(),text:d.text,children:[],richContent:{kind:d.kind,raw:d.raw,lang:d.lang}};a[a.length-1].children.push(g)}for(const d of n)u(d);return i}function es(t){return t.richContent?t.richContent.raw+`
|
|
15
|
+
`:""}function ts(t){const o=t.minScale??.2,n=t.maxScale??1/0,i=t.step??1.2,a=e.ref(1),c=e.ref(0),s=e.ref(0),u=e.ref(!1),d=e.ref(!1),g=e.reactive({x:0,y:0,ox:0,oy:0}),h=e.ref(!1),w=e.reactive({x:0,y:0}),C=e.reactive({x:0,y:0,width:0,height:0}),P=e.ref(0);let R=null;function U(Z){R=Z}function I(Z){Z.preventDefault();const ce=t.getContainer();if(!ce)return;const ie=-Z.deltaY*.001,me=Math.min(n,Math.max(o,a.value*(1+ie))),v=ce.getBoundingClientRect(),E=Z.clientX-v.left,$=Z.clientY-v.top,X=(E-c.value)/a.value,fe=($-s.value)/a.value;a.value=me,c.value=E-X*me,s.value=$-fe*me}function A(){a.value=Math.min(n,a.value*i)}function x(){a.value=Math.max(o,a.value/i)}function k(Z){var ie;Z.target.closest(".zm-node, .zm-toolbar, button, input, textarea")||(u.value=!0,d.value=!1,g.x=Z.clientX,g.y=Z.clientY,g.ox=c.value,g.oy=s.value,window.addEventListener("mousemove",m),window.addEventListener("mouseup",F),(ie=Z.preventDefault)==null||ie.call(Z))}function m(Z){if(!u.value)return;const ce=Z.clientX-g.x,ie=Z.clientY-g.y;(Math.abs(ce)>3||Math.abs(ie)>3)&&(d.value=!0),c.value=g.ox+ce,s.value=g.oy+ie}function F(){u.value=!1,window.removeEventListener("mousemove",m),window.removeEventListener("mouseup",F)}function W(Z,ce,ie){h.value=!0,w.x=Z,w.y=ce,C.x=Z,C.y=ce,C.width=0,C.height=0,C.shiftKey=!!(ie!=null&&ie.shift),P.value++,window.addEventListener("mousemove",ne),window.addEventListener("mouseup",S)}function K(Z,ce){if(!h.value)return;const ie=Math.min(w.x,Z),me=Math.min(w.y,ce),v=Math.max(w.x,Z),E=Math.max(w.y,ce);C.x=ie,C.y=me,C.width=v-ie,C.height=E-me,P.value++}function S(){h.value=!1,window.removeEventListener("mousemove",ne),window.removeEventListener("mouseup",S),R&&R()}function ne(Z){if(!h.value)return;const ce=t.getContainer();if(!ce)return;const ie=ce.getBoundingClientRect(),me=(Z.clientX-ie.left-c.value)/a.value,v=(Z.clientY-ie.top-s.value)/a.value;K(me,v)}function se(Z,ce,ie,me=60){const v=t.getContainer();if(!v)return;const E=v.getBoundingClientRect(),$=(E.width-me*2)/Z,X=(E.height-me*2)/ce,fe=Math.min(1,Math.max(.3,Math.min($,X)));a.value=fe,c.value=E.width/2,s.value=E.height/2-ie*fe}function re(Z,ce,ie,me,v=80){const E=t.getContainer();if(!E)return;const $=E.getBoundingClientRect();let X=a.value;(ie*X<40||me*X<40)&&(X=Math.min(n,Math.max(1,60/Math.min(ie,me)))),a.value=X,c.value=$.width/2-Z*X,s.value=$.height/2-ce*X}return{scale:a,offsetX:c,offsetY:s,isPanning:u,panMoved:d,onWheel:I,zoomIn:A,zoomOut:x,startPan:k,startMarquee:W,updateMarquee:K,isMarquee:h,marquee:C,marqueeVersion:P,setOnMarqueeEnd:U,resetView:se,centerOn:re}}const ns=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform);function xr(t){return ns?t.metaKey:t.ctrlKey}function os(t){function o(){const i=t.getSelectedId();if(i)return i;if(t.defaultTargetId)return t.defaultTargetId();const a=t.getSelectedIds();return a.length>0?a[0]:null}function n(i){var u,d,g;const a=i.target;if(a&&(a.tagName==="INPUT"||a.tagName==="TEXTAREA"||a.isContentEditable)||t.isReadonly()||t.isEditing())return;const c=t.getSelectedId(),s=o();if(s){if(xr(i)&&!i.shiftKey){if(i.key==="d"||i.key==="D"){const h=(u=t.defaultTargetId)==null?void 0:u.call(t);c&&c!==h&&(i.preventDefault(),t.onDuplicate(c));return}if(i.key==="c"||i.key==="C"){const h=t.getSelectedIds();h.length>0&&(i.preventDefault(),t.onCopy(h));return}if(i.key==="x"||i.key==="X"){const h=t.getSelectedIds();h.length>0&&(i.preventDefault(),t.onCut(h));return}if(i.key==="v"||i.key==="V"){if(!t.hasClipboard())return;i.preventDefault();const h=t.getSelectedIds();t.onPaste(h.length>0?h[0]:null);return}if(i.key==="z"||i.key==="Z"){i.preventDefault(),t.onUndo();return}if(i.key==="y"||i.key==="Y"){i.preventDefault(),t.onRedo();return}if(i.key==="Home"){i.preventDefault(),t.onSelectRoot();return}}if(xr(i)&&i.shiftKey&&(i.key==="Z"||i.key==="z")){i.preventDefault(),t.onRedo();return}if(i.key==="Tab")i.preventDefault(),t.onAddChild(s);else if(i.key==="Enter")if(i.preventDefault(),i.shiftKey){const h=(d=t.defaultTargetId)==null?void 0:d.call(t);c&&c!==h&&t.onAddSiblingBefore(c)}else t.onAddSibling(s);else(i.key==="Delete"||i.key==="Backspace")&&c&&c!==((g=t.defaultTargetId)==null?void 0:g.call(t))?(i.preventDefault(),t.onRemove(c)):i.key==="F2"&&c?(i.preventDefault(),t.onStartEdit(c)):i.key==="Escape"?(i.preventDefault(),t.onClearSelection()):i.key==="ArrowDown"?(i.preventDefault(),t.onNavigate(0,1)):i.key==="ArrowUp"?(i.preventDefault(),t.onNavigate(0,-1)):i.key==="ArrowRight"?(i.preventDefault(),t.onNavigate(1,0)):i.key==="ArrowLeft"&&(i.preventDefault(),t.onNavigate(-1,0))}}e.onMounted(()=>{window.addEventListener("keydown",n)}),e.onBeforeUnmount(()=>{window.removeEventListener("keydown",n)})}function is(t=100){const o=e.ref([]);let n=-1;function i(){return n>0}function a(){return n<o.value.length-1}function c(g){const h=JSON.stringify(g);for(n<o.value.length-1&&(o.value=o.value.slice(0,n+1)),o.value.push(h),n=o.value.length-1;o.value.length>t;)o.value.shift(),n--}function s(){return i()?(n--,JSON.parse(o.value[n])):null}function u(){return a()?(n++,JSON.parse(o.value[n])):null}function d(){o.value=[],n=-1}return{canUndo:i,canRedo:a,record:c,undo:s,redo:u,reset:d}}const rs={1:"#ef4444",2:"#f97316",3:"#f59e0b",4:"#eab308",5:"#84cc16",6:"#22c55e",7:"#14b8a6",8:"#3b82f6",9:"#6366f1"},ls={label:"优先级",markers:Array.from({length:9},(t,o)=>{const n=o+1,i=rs[n];return{id:`priority-${n}`,label:`优先级 ${n}`,svg:`<circle cx="12" cy="12" r="10" fill="${i}"/><text x="12" y="16" text-anchor="middle" font-size="12" font-weight="700" fill="#fff" font-family="sans-serif">${n}</text>`}})};function as(t){if(t===0)return'<circle cx="12" cy="12" r="10" fill="none" stroke="#94a3b8" stroke-width="2"/>';if(t===100)return'<circle cx="12" cy="12" r="10" fill="#22c55e"/>';const o=t/100*2*Math.PI,n=12+10*Math.sin(o),i=12-10*Math.cos(o);return`<circle cx="12" cy="12" r="10" fill="none" stroke="#e2e8f0" stroke-width="2"/><path d="M 12 12 L 12 2 A 10 10 0 ${t>50?1:0} 1 ${n.toFixed(2)} ${i.toFixed(2)} Z" fill="#3b82f6"/><circle cx="12" cy="12" r="10" fill="none" stroke="#cbd5e1" stroke-width="1"/>`}const ss={label:"进度",markers:[0,25,50,75,100].map(t=>({id:`progress-${t}`,label:`进度 ${t}%`,svg:as(t)}))},cs={label:"旗帜",markers:[{id:"flag-red",label:"红旗",color:"#ef4444"},{id:"flag-orange",label:"橙旗",color:"#f97316"},{id:"flag-yellow",label:"黄旗",color:"#eab308"},{id:"flag-green",label:"绿旗",color:"#22c55e"},{id:"flag-blue",label:"蓝旗",color:"#3b82f6"},{id:"flag-gray",label:"灰旗",color:"#94a3b8"}].map(t=>({id:t.id,label:t.label,svg:`<path d="M6 3 V21" stroke="#475569" stroke-width="2" stroke-linecap="round"/><path d="M6 4 H18 L15 7 L18 10 H6 Z" fill="${t.color}" stroke="${t.color}" stroke-width="1" stroke-linejoin="round"/>`}))},gi=[ls,ss,cs,{label:"星标",markers:[{id:"star",label:"星标",svg:'<path d="M12 2 L14.5 8.5 L21 9 L16 13.5 L17.5 20 L12 16.5 L6.5 20 L8 13.5 L3 9 L9.5 8.5 Z" fill="#f59e0b" stroke="#f59e0b" stroke-width="1" stroke-linejoin="round"/>'},{id:"star-half",label:"半星",svg:'<path d="M12 2 L14.5 8.5 L21 9 L16 13.5 L17.5 20 L12 16.5 L6.5 20 L8 13.5 L3 9 L9.5 8.5 Z" fill="#e2e8f0" stroke="#f59e0b" stroke-width="1.5" stroke-linejoin="round"/><path d="M12 2 L12 16.5 L6.5 20 L8 13.5 L3 9 L9.5 8.5 Z" fill="#f59e0b" stroke="none"/>'}]},{label:"其他",markers:[{id:"smile",label:"微笑",svg:'<circle cx="12" cy="12" r="10" fill="#fef3c7" stroke="#f59e0b" stroke-width="1.5"/><circle cx="9" cy="10" r="1.2" fill="#92400e"/><circle cx="15" cy="10" r="1.2" fill="#92400e"/><path d="M8 14 Q12 17 16 14" stroke="#92400e" stroke-width="1.5" fill="none" stroke-linecap="round"/>'},{id:"people",label:"人员",svg:'<circle cx="9" cy="8" r="2.5" fill="#3b82f6"/><circle cx="16" cy="8" r="2.5" fill="#3b82f6"/><path d="M4 19 C4 15 6 13 9 13 C12 13 14 15 14 19" fill="#3b82f6"/><path d="M14 19 C14 15.5 15.5 13.5 17.5 13.5 C19.5 13.5 21 15.5 21 19" fill="#3b82f6"/>'},{id:"arrow-up",label:"上箭头",svg:'<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M12 17 V7 M8 11 L12 7 L16 11" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>'},{id:"arrow-down",label:"下箭头",svg:'<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M12 7 V17 M8 13 L12 17 L16 13" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>'},{id:"arrow-right",label:"右箭头",svg:'<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M7 12 H17 M13 8 L17 12 L13 16" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>'},{id:"arrow-left",label:"左箭头",svg:'<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M17 12 H7 M11 8 L7 12 L11 16" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>'}]}],Io={};for(const t of gi)for(const o of t.markers)Io[o.id]=o;function ds(t){return Io[t]}function zo(t){var o;return((o=Io[t])==null?void 0:o.svg)??""}function wr(t){var o;return((o=Io[t])==null?void 0:o.label)??t}function hi(t){let o=0;for(let i=0;i<t.length;i++)o=(o<<5)-o+t.charCodeAt(i),o|=0;const n=Math.abs(o)%360;return{background:`hsl(${n}, 85%, 92%)`,borderColor:`hsl(${n}, 60%, 70%)`,color:`hsl(${n}, 55%, 30%)`}}const us={key:5,class:"zm-marker-picker"},fs={class:"zm-marker-group-label"},ms={class:"zm-marker-grid"},ps=["title","onClick","innerHTML"],gs=e.defineComponent({__name:"NodeContextMenu",props:{x:{},y:{},container:{},hasImage:{type:Boolean,default:!1},hasLink:{type:Boolean,default:!1},hasNote:{type:Boolean,default:!1},hasCode:{type:Boolean,default:!1},hasTable:{type:Boolean,default:!1},nodeMarkers:{default:()=>[]},nodeTags:{default:()=>[]}},emits:["pickImage","setLink","removeLink","editNote","removeNote","removeImage","addCode","editCode","removeCode","addTable","editTable","removeTable","toggleMarker","clearMarkers","addTag","removeTags","close"],setup(t,{emit:o}){const n=t,i=o,a=e.computed(()=>{let x=n.x+2,k=n.y+2;if(n.container){const m=n.container.getBoundingClientRect(),F=180,K=4+(3+(n.hasImage?1:0)+(n.hasLink?1:0)+(n.hasNote?1:0)+1+(n.hasCode?1:0)+1+(n.hasTable?1:0))*28;x+F>m.right&&(x=Math.max(m.left+4,n.x-F-2)),k+K>m.bottom&&(k=Math.max(m.top+4,n.y-K-2)),x<m.left+2&&(x=m.left+2),k<m.top+2&&(k=m.top+2)}return{left:x,top:k}}),c=e.computed(()=>n.hasImage),s=e.computed(()=>n.hasLink),u=e.computed(()=>n.hasNote),d=e.computed(()=>n.nodeMarkers.length>0),g=e.computed(()=>n.nodeTags.length>0),h=e.ref(!1);function w(){h.value=!h.value}function C(x){return n.nodeMarkers.includes(x)}function P(x){i("toggleMarker",x)}function R(x){const k=x.target;k&&k.closest(".zm-node-menu")||i("close")}function U(x){x.key==="Escape"&&i("close")}function I(){i("close")}window.addEventListener("mousedown",R,!0),window.addEventListener("keydown",U,!0),window.addEventListener("wheel",I,!0),window.addEventListener("scroll",I,!0),e.onBeforeUnmount(()=>{window.removeEventListener("mousedown",R,!0),window.removeEventListener("keydown",U,!0),window.removeEventListener("wheel",I,!0),window.removeEventListener("scroll",I,!0)});function A(x){x(),i("close")}return(x,k)=>(e.openBlock(),e.createElementBlock("div",{class:"zm-node-menu",style:e.normalizeStyle({left:a.value.left+"px",top:a.value.top+"px"}),onContextmenu:k[13]||(k[13]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[0]||(k[0]=e.withModifiers(m=>A(()=>i("pickImage")),["stop"]))},[e.createVNode(Te,{name:"image",size:13}),e.createElementVNode("span",null,e.toDisplayString(c.value?"替换图片":"添加图片"),1)]),c.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-node-menu-item",onClick:k[1]||(k[1]=e.withModifiers(m=>A(()=>i("removeImage")),["stop"]))},[e.createVNode(Te,{name:"x",size:13}),k[14]||(k[14]=e.createElementVNode("span",null,"移除图片",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[2]||(k[2]=e.withModifiers(m=>A(()=>i("setLink")),["stop"]))},[e.createVNode(Te,{name:"link",size:13}),e.createElementVNode("span",null,e.toDisplayString(s.value?"编辑链接":"添加链接"),1)]),s.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-node-menu-item",onClick:k[3]||(k[3]=e.withModifiers(m=>A(()=>i("removeLink")),["stop"]))},[e.createVNode(Te,{name:"x",size:13}),k[15]||(k[15]=e.createElementVNode("span",null,"移除链接",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[4]||(k[4]=e.withModifiers(m=>A(()=>i("addCode")),["stop"]))},[k[16]||(k[16]=e.createElementVNode("span",{class:"zm-node-menu-icon zm-node-menu-icon-code","aria-hidden":"true"},"{ }",-1)),e.createElementVNode("span",null,e.toDisplayString(t.hasCode?"编辑代码块":"添加代码块"),1)]),t.hasCode?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-node-menu-item",onClick:k[5]||(k[5]=e.withModifiers(m=>A(()=>i("removeCode")),["stop"]))},[e.createVNode(Te,{name:"x",size:13}),k[17]||(k[17]=e.createElementVNode("span",null,"移除代码块",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[6]||(k[6]=e.withModifiers(m=>A(()=>i("addTable")),["stop"]))},[k[18]||(k[18]=e.createElementVNode("span",{class:"zm-node-menu-icon zm-node-menu-icon-table","aria-hidden":"true"},"▦",-1)),e.createElementVNode("span",null,e.toDisplayString(t.hasTable?"编辑表格":"添加表格"),1)]),t.hasTable?(e.openBlock(),e.createElementBlock("button",{key:3,class:"zm-node-menu-item",onClick:k[7]||(k[7]=e.withModifiers(m=>A(()=>i("removeTable")),["stop"]))},[e.createVNode(Te,{name:"x",size:13}),k[19]||(k[19]=e.createElementVNode("span",null,"移除表格",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[8]||(k[8]=e.withModifiers(m=>A(()=>i("editNote")),["stop"]))},[e.createVNode(Te,{name:"note",size:13}),e.createElementVNode("span",null,e.toDisplayString(u.value?"编辑笔记":"添加笔记"),1)]),u.value?(e.openBlock(),e.createElementBlock("button",{key:4,class:"zm-node-menu-item",onClick:k[9]||(k[9]=e.withModifiers(m=>A(()=>i("removeNote")),["stop"]))},[e.createVNode(Te,{name:"x",size:13}),k[20]||(k[20]=e.createElementVNode("span",null,"移除笔记",-1))])):e.createCommentVNode("",!0),k[25]||(k[25]=e.createElementVNode("div",{class:"zm-node-menu-divider"},null,-1)),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:e.withModifiers(w,["stop"])},[k[21]||(k[21]=e.createElementVNode("span",{class:"zm-node-menu-icon","aria-hidden":"true"},"⚑",-1)),k[22]||(k[22]=e.createElementVNode("span",null,"标记图标",-1)),e.createElementVNode("span",{class:e.normalizeClass(["zm-node-menu-arrow",{"is-open":h.value}])},"›",2)]),h.value?(e.openBlock(),e.createElementBlock("div",us,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(gi),m=>(e.openBlock(),e.createElementBlock("div",{key:m.label,class:"zm-marker-group"},[e.createElementVNode("div",fs,e.toDisplayString(m.label),1),e.createElementVNode("div",ms,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.markers,F=>(e.openBlock(),e.createElementBlock("button",{key:F.id,class:e.normalizeClass(["zm-marker-cell",{"is-active":C(F.id)}]),title:F.label,onClick:e.withModifiers(W=>P(F.id),["stop"]),innerHTML:'<svg viewBox="0 0 24 24" width="20" height="20">'+e.unref(zo)(F.id)+"</svg>"},null,10,ps))),128))])]))),128)),d.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-marker-clear",onClick:k[10]||(k[10]=e.withModifiers(m=>i("clearMarkers"),["stop"]))}," 清除所有标记 ")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[11]||(k[11]=e.withModifiers(m=>A(()=>i("addTag")),["stop"]))},[k[23]||(k[23]=e.createElementVNode("span",{class:"zm-node-menu-icon","aria-hidden":"true"},"#",-1)),e.createElementVNode("span",null,e.toDisplayString(g.value?"编辑标签":"添加标签"),1)]),g.value?(e.openBlock(),e.createElementBlock("button",{key:6,class:"zm-node-menu-item",onClick:k[12]||(k[12]=e.withModifiers(m=>A(()=>i("removeTags")),["stop"]))},[e.createVNode(Te,{name:"x",size:13}),k[24]||(k[24]=e.createElementVNode("span",null,"移除标签",-1))])):e.createCommentVNode("",!0)],36))}}),hs=e.defineComponent({__name:"CanvasContextMenu",props:{x:{},y:{},container:{}},emits:["openSettings","openData","openImport","exportPng","exportSvg","close"],setup(t,{emit:o}){const n=t,i=o,a=e.computed(()=>{let A=n.x+2,x=n.y+2;if(n.container){const k=n.container.getBoundingClientRect(),m=160,F=4+4*28+5;A+m>k.right&&(A=Math.max(k.left+4,n.x-m-2)),x+F>k.bottom&&(x=Math.max(k.top+4,n.y-F-2)),A<k.left+2&&(A=k.left+2),x<k.top+2&&(x=k.top+2)}return{left:A,top:x}}),c=e.ref(null),s=e.ref(null),u=e.ref(null),d=e.computed(()=>{const A=c.value==="import"?s.value:c.value==="export"?u.value:null;if(!A)return{left:"-9999px",top:"-9999px",display:"none"};const x=A.getBoundingClientRect(),k=window.innerWidth,m=window.innerHeight,F=176,W=4+3*28;let K=x.right;K+F>k-4&&(K=Math.max(4,x.left-F));let S=x.top-4;return S+W>m-4&&(S=Math.max(4,m-W-4)),{left:K+"px",top:S+"px",display:"block"}});let g=null,h=null;function w(A){h&&(clearTimeout(h),h=null),g=setTimeout(()=>{c.value=A},60)}function C(){g&&(clearTimeout(g),g=null),h=setTimeout(()=>{c.value=null},120)}e.onBeforeUnmount(()=>{g&&clearTimeout(g),h&&clearTimeout(h)});function P(A){const x=A.target;x&&x.closest(".zm-canvas-menu")||i("close")}function R(A){A.key==="Escape"&&i("close")}function U(){i("close")}window.addEventListener("mousedown",P,!0),window.addEventListener("keydown",R,!0),window.addEventListener("wheel",U,!0),window.addEventListener("scroll",U,!0),e.onBeforeUnmount(()=>{window.removeEventListener("mousedown",P,!0),window.removeEventListener("keydown",R,!0),window.removeEventListener("wheel",U,!0),window.removeEventListener("scroll",U,!0)});function I(A){A(),i("close")}return(A,x)=>(e.openBlock(),e.createElementBlock("div",{class:"zm-canvas-menu",style:e.normalizeStyle({left:a.value.left+"px",top:a.value.top+"px"}),onContextmenu:x[11]||(x[11]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[0]||(x[0]=e.withModifiers(k=>I(()=>i("openData")),["stop"]))},[e.createVNode(Te,{name:"database",size:13,stroke:1.6}),x[12]||(x[12]=e.createElementVNode("span",null,"查看数据",-1))]),e.createElementVNode("div",{ref_key:"importItemRef",ref:s,class:e.normalizeClass(["zm-canvas-menu-item zm-canvas-menu-item-has-submenu",{"is-open":c.value==="import"}]),onMouseenter:x[5]||(x[5]=k=>w("import")),onMouseleave:C},[e.createVNode(Te,{name:"import",size:13,stroke:1.6}),x[16]||(x[16]=e.createElementVNode("span",null,"导入",-1)),x[17]||(x[17]=e.createElementVNode("svg",{class:"zm-canvas-menu-caret",width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[e.createElementVNode("polyline",{points:"2.5 1.8 5.2 4 2.5 6.2"})],-1)),c.value==="import"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-canvas-submenu",style:e.normalizeStyle(d.value),onMouseenter:x[4]||(x[4]=k=>w("import")),onMouseleave:C},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[1]||(x[1]=e.withModifiers(k=>I(()=>i("openImport","markdown")),["stop"]))},[e.createVNode(Te,{name:"markdown",size:13,stroke:1.6}),x[13]||(x[13]=e.createElementVNode("span",null,"Markdown 导入",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[2]||(x[2]=e.withModifiers(k=>I(()=>i("openImport","json")),["stop"]))},[e.createVNode(Te,{name:"json",size:13,stroke:1.6}),x[14]||(x[14]=e.createElementVNode("span",null,"JSON 文件导入",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[3]||(x[3]=e.withModifiers(k=>I(()=>i("openImport","txt")),["stop"]))},[e.createVNode(Te,{name:"txt",size:13,stroke:1.6}),x[15]||(x[15]=e.createElementVNode("span",null,"TXT 文件导入",-1))])],36)):e.createCommentVNode("",!0)],34),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[6]||(x[6]=e.withModifiers(k=>I(()=>i("openSettings")),["stop"]))},[e.createVNode(Te,{name:"settings",size:13,stroke:1.6}),x[18]||(x[18]=e.createElementVNode("span",null,"设置",-1))]),x[23]||(x[23]=e.createElementVNode("div",{class:"zm-canvas-menu-divider"},null,-1)),e.createElementVNode("div",{ref_key:"exportItemRef",ref:u,class:e.normalizeClass(["zm-canvas-menu-item zm-canvas-menu-item-has-submenu",{"is-open":c.value==="export"}]),onMouseenter:x[10]||(x[10]=k=>w("export")),onMouseleave:C},[e.createVNode(Te,{name:"export",size:13,stroke:1.6}),x[21]||(x[21]=e.createElementVNode("span",null,"导出",-1)),x[22]||(x[22]=e.createElementVNode("svg",{class:"zm-canvas-menu-caret",width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[e.createElementVNode("polyline",{points:"2.5 1.8 5.2 4 2.5 6.2"})],-1)),c.value==="export"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-canvas-submenu",style:e.normalizeStyle(d.value),onMouseenter:x[9]||(x[9]=k=>w("export")),onMouseleave:C},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[7]||(x[7]=e.withModifiers(k=>I(()=>i("exportPng")),["stop"]))},[e.createVNode(Te,{name:"image",size:13,stroke:1.6}),x[19]||(x[19]=e.createElementVNode("span",null,"导出 PNG",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[8]||(x[8]=e.withModifiers(k=>I(()=>i("exportSvg")),["stop"]))},[e.createVNode(Te,{name:"svg-export",size:13,stroke:1.6}),x[20]||(x[20]=e.createElementVNode("span",null,"导出 SVG",-1))])],36)):e.createCommentVNode("",!0)],34)],36))}}),bs=["aria-hidden"],ks=["aria-hidden"],ys={key:0,class:"zm-drawer-header"},Es={key:0,class:"zm-drawer-title"},xs={class:"zm-drawer-body"},ws=["aria-hidden"],Ns={key:0,class:"zm-drawer-header"},Ss={key:0,class:"zm-drawer-title"},Ts={class:"zm-drawer-body"},Lt=e.defineComponent({__name:"Drawer",props:{side:{default:"left"},width:{default:320},open:{type:Boolean,default:!0},title:{default:""},scope:{default:"page"},closable:{type:Boolean,default:!0},closeOnBackdrop:{type:Boolean,default:!0}},emits:["update:open"],setup(t,{emit:o}){const n=o;function i(){n("update:open",!1)}function a(){n("update:open",!1)}return(c,s)=>t.scope==="canvas"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.Transition,{name:"zm-fade"},{default:e.withCtx(()=>[t.open?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-drawer-canvas-backdrop","aria-hidden":!t.open,onClick:s[0]||(s[0]=u=>t.closeOnBackdrop&&a())},null,8,bs)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:t.side==="left"?"zm-slide-left":"zm-slide-right"},{default:e.withCtx(()=>[t.open?(e.openBlock(),e.createElementBlock("aside",{key:0,class:e.normalizeClass(["zm-drawer zm-drawer--canvas",["zm-drawer--"+t.side]]),style:e.normalizeStyle({width:t.width+"px"}),"aria-hidden":!t.open},[t.title||c.$slots.header?(e.openBlock(),e.createElementBlock("div",ys,[t.title?(e.openBlock(),e.createElementBlock("h3",Es,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.renderSlot(c.$slots,"header"),t.closable?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-drawer-close",title:"关闭",onClick:i},[...s[1]||(s[1]=[e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},[e.createElementVNode("path",{d:"M6 6 L18 18 M18 6 L6 18"})],-1)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",xs,[e.renderSlot(c.$slots,"default")])],14,ks)):e.createCommentVNode("",!0)]),_:3},8,["name"])],64)):(e.openBlock(),e.createBlock(e.Transition,{key:1,name:"zm-drawer"},{default:e.withCtx(()=>[t.open?(e.openBlock(),e.createElementBlock("aside",{key:0,class:e.normalizeClass(["zm-drawer",["zm-drawer--"+t.side,{"is-open":t.open}]]),style:e.normalizeStyle({width:t.width+"px"}),"aria-hidden":!t.open},[t.title||c.$slots.header?(e.openBlock(),e.createElementBlock("div",Ns,[t.title?(e.openBlock(),e.createElementBlock("h3",Ss,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.renderSlot(c.$slots,"header"),t.closable?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-drawer-close",title:"关闭",onClick:i},[...s[2]||(s[2]=[e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},[e.createElementVNode("path",{d:"M6 6 L18 18 M18 6 L6 18"})],-1)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Ts,[e.renderSlot(c.$slots,"default")])],14,ws)):e.createCommentVNode("",!0)]),_:3}))}}),Cs={class:"zm-outline-root"},Ms={class:"zm-outline-search"},As={key:0,class:"zm-outline-search-count"},_s={key:1,class:"zm-outline-search-count zm-outline-search-empty"},Rs={class:"zm-outline-actions"},Bs={width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},vs={key:0,x:"9",y:"9",width:"13",height:"13",rx:"2"},Is={key:1,d:"M5 12 L10 17 L19 7"},zs={class:"zm-outline"},Os=["data-outline-id","onClick","onDblclick","onDragstart","onDragover","onDragleave","onDrop"],Ls=["title","onClick"],Ds={width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round"},$s={key:0,points:"6 9 12 15 18 9"},Vs={key:1,points:"9 6 15 12 9 18"},Ps={key:1,class:"zm-outline-dot"},Fs={class:"zm-outline-index"},Us={key:3,class:"zm-outline-text"},Hs=["onClick"],Ws=["src"],Gs=["onClick"],js=["src"],Ks=["title","onClick"],Ys={width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},qs={key:0,x:"9",y:"9",width:"13",height:"13",rx:"2"},Xs={key:1,d:"M5 12 L10 17 L19 7"},Oo=e.defineComponent({__name:"Outline",props:{data:{},selectedId:{default:null},collapsedIds:{default:()=>new Set},readonly:{type:Boolean,default:!1}},emits:["select","toggleCollapse","edit","addChild","addSibling","move"],setup(t,{emit:o}){const n=t,i=o,a=e.ref(""),c=e.ref(null),s=e.ref(-1),u=e.computed(()=>{const p=a.value.trim().toLowerCase();if(!p)return new Set;const D=new Set,V=ee=>{var ge;(ee.text.toLowerCase().includes(p)||(ge=ee.note)!=null&&ge.text&&ee.note.text.toLowerCase().includes(p))&&D.add(ee.id);for(const we of ee.children)V(we)};return V(n.data),D}),d=e.computed(()=>{if(u.value.size===0)return new Set;const p=new Set,D=V=>{let ee=u.value.has(V.id);for(const ge of V.children)D(ge)&&(ee=!0);return ee&&p.add(V.id),ee};return D(n.data),p}),g=e.computed(()=>{const p=[],D=V=>{u.value.has(V.id)&&p.push(V.id);for(const ee of V.children)D(ee)};return D(n.data),p}),h=e.computed(()=>a.value.trim().length>0),w=e.computed(()=>{const p=[],D=d.value,V=(ee,ge,we)=>{if(h.value&&!D.has(ee.id))return;const tt=ee.children.length>0,je=h.value?!1:n.collapsedIds.has(ee.id);p.push({id:ee.id,text:ee.text||"(无标题)",depth:ge,siblingIndex:we,hasChildren:tt,collapsed:je,node:ee}),tt&&!je&&ee.children.forEach((rt,nt)=>V(rt,ge+1,nt))};return V(n.data,0,0),p});function C(){s.value=g.value.length>0?0:-1}function P(){const p=g.value;p.length!==0&&(s.value=(s.value+1)%p.length,I(s.value))}function R(){const p=g.value;p.length!==0&&(s.value=(s.value-1+p.length)%p.length,I(s.value))}function U(p){p.key==="Enter"?(p.preventDefault(),p.shiftKey?R():P()):p.key==="Escape"&&(p.preventDefault(),a.value="",s.value=-1)}function I(p){const D=g.value[p];if(!D)return;const V=w.value.find(ee=>ee.id===D);V&&i("select",V.node),e.nextTick(()=>{const ee=document.querySelector(`[data-outline-id="${D}"]`);ee==null||ee.scrollIntoView({block:"nearest",behavior:"smooth"})})}function A(){a.value="",s.value=-1}e.onMounted(()=>{e.nextTick(()=>{var p;return(p=c.value)==null?void 0:p.focus()})});const x=e.ref(null),k=e.ref("");let m=null;function F(p){n.readonly||(x.value=p.id,k.value=p.text,e.nextTick(()=>{m=document.querySelector(".zm-outline-input"),m==null||m.focus(),m==null||m.select()}))}function W(){x.value!=null&&(i("edit",{id:x.value,text:k.value.trim()||"(无标题)"}),K())}function K(){x.value=null,k.value="",m=null}function S(p){p.key==="Enter"?(p.preventDefault(),W()):p.key==="Escape"&&(p.preventDefault(),K())}e.onBeforeUnmount(K);const ne=e.ref(null),se=e.ref(null),re=e.ref(null);function Z(p,D){if(n.readonly){p.preventDefault();return}ne.value={id:D.id,text:D.text},p.dataTransfer&&(p.dataTransfer.effectAllowed="move",p.dataTransfer.setData("text/plain",D.id))}function ce(){ne.value=null,se.value=null,re.value=null}function ie(p,D){if(!ne.value)return;p.preventDefault(),p.dataTransfer&&(p.dataTransfer.dropEffect="move");const V=E(p);se.value=D.id,re.value=V}function me(p){se.value===p.id&&(se.value=null,re.value=null)}function v(p,D){p.preventDefault();const V=ne.value;if(!V)return;const ee=E(p);V.id!==D.id&&i("move",{srcId:V.id,targetId:D.id,position:ee}),ce()}function E(p,D){const ee=p.currentTarget.getBoundingClientRect(),ge=p.clientY-ee.top,we=ee.height;return ge<we*.3?"before":ge>we*.7?"after":"child"}const $=e.ref(null);let X=null;async function fe(p){try{return await navigator.clipboard.writeText(p),!0}catch{const D=document.createElement("textarea");D.value=p,document.body.appendChild(D),D.select();let V=!1;try{V=document.execCommand("copy")}finally{document.body.removeChild(D)}return V}}async function Ae(p,D,V){p.stopPropagation(),await fe(D)&&($.value=V,X&&clearTimeout(X),X=setTimeout(()=>$.value=null,1200))}const De=e.computed(()=>{const p=[],D=(V,ee)=>{const ge=" ".repeat(ee),we=ee===0?"":"- ";p.push(ge+we+(V.text||""));for(const tt of V.children)D(tt,ee+1)};return D(n.data,0),p.join(`
|
|
16
|
+
`)}),Pe=e.ref(!1);let Me=null;async function y(){await fe(De.value)&&(Pe.value=!0,Me&&clearTimeout(Me),Me=setTimeout(()=>Pe.value=!1,1200))}return(p,D)=>(e.openBlock(),e.createElementBlock("div",Cs,[e.createElementVNode("div",Ms,[D[3]||(D[3]=e.createElementVNode("svg",{class:"zm-outline-search-icon",width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"}),e.createElementVNode("line",{x1:"20",y1:"20",x2:"16",y2:"16"})],-1)),e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:c,"onUpdate:modelValue":D[0]||(D[0]=V=>a.value=V),type:"text",class:"zm-outline-search-input",placeholder:"搜索节点… (Enter 下一个, Shift+Enter 上一个)",onInput:C,onKeydown:U},null,544),[[e.vModelText,a.value]]),g.value.length>0?(e.openBlock(),e.createElementBlock("span",As,e.toDisplayString(s.value+1)+"/"+e.toDisplayString(g.value.length),1)):h.value?(e.openBlock(),e.createElementBlock("span",_s,"无结果")):e.createCommentVNode("",!0),a.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-outline-search-clear",title:"清除搜索",onClick:A},"×")):e.createCommentVNode("",!0)]),e.createElementVNode("div",Rs,[e.createElementVNode("button",{class:e.normalizeClass(["zm-outline-action-btn",{"is-success":Pe.value}]),title:"复制完整大纲为纯文本",onClick:y},[(e.openBlock(),e.createElementBlock("svg",Bs,[Pe.value?(e.openBlock(),e.createElementBlock("path",Is)):(e.openBlock(),e.createElementBlock("rect",vs)),D[4]||(D[4]=e.createElementVNode("path",{d:"M5 15 H4 a2 2 0 0 1 -2 -2 V4 a2 2 0 0 1 2 -2 h9 a2 2 0 0 1 2 2 v1"},null,-1))])),e.createElementVNode("span",null,e.toDisplayString(Pe.value?"已复制":"复制大纲"),1)],2)]),e.createElementVNode("ul",zs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.id,"data-outline-id":V.id,class:e.normalizeClass(["zm-outline-row",{"is-selected":V.id===t.selectedId,"is-root":V.depth===0,"is-editing":x.value===V.id,"is-search-hit":u.value.has(V.id),"is-search-current":g.value[s.value]===V.id,"is-drag-over-before":se.value===V.id&&re.value==="before","is-drag-over-after":se.value===V.id&&re.value==="after","is-drag-over-child":se.value===V.id&&re.value==="child"}]),style:e.normalizeStyle({paddingLeft:12+V.depth*16+"px"}),draggable:"true",onClick:ee=>i("select",V.node),onDblclick:ee=>F(V),onDragstart:ee=>Z(ee,V),onDragend:ce,onDragover:ee=>ie(ee,V),onDragleave:()=>me(V),onDrop:ee=>v(ee,V)},[V.hasChildren?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-outline-toggle",title:V.collapsed?"展开":"折叠",onClick:e.withModifiers(ee=>i("toggleCollapse",V.id),["stop"])},[(e.openBlock(),e.createElementBlock("svg",Ds,[V.collapsed?(e.openBlock(),e.createElementBlock("polyline",Vs)):(e.openBlock(),e.createElementBlock("polyline",$s))]))],8,Ls)):(e.openBlock(),e.createElementBlock("span",Ps)),e.createElementVNode("span",Fs,e.toDisplayString(V.siblingIndex+1)+".",1),x.value===V.id?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,"onUpdate:modelValue":D[1]||(D[1]=ee=>k.value=ee),class:"zm-outline-input",onBlur:W,onKeydown:S,onClick:D[2]||(D[2]=e.withModifiers(()=>{},["stop"]))},null,544)),[[e.vModelText,k.value]]):(e.openBlock(),e.createElementBlock("span",Us,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(ee=>i("addSibling",V.id),["stop"])},[e.createElementVNode("img",{src:e.unref(rr),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,Ws)],8,Hs)),n.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:5,class:"zm-outline-row-action",title:"添加子节点",onClick:e.withModifiers(ee=>i("addChild",V.id),["stop"])},[e.createElementVNode("img",{src:e.unref(lr),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,js)],8,Gs)),e.createElementVNode("button",{class:e.normalizeClass(["zm-outline-row-copy",{"is-success":$.value===V.id}]),title:$.value===V.id?"已复制":"复制节点文本",onClick:ee=>Ae(ee,V.text,V.id)},[(e.openBlock(),e.createElementBlock("svg",Ys,[$.value!==V.id?(e.openBlock(),e.createElementBlock("rect",qs)):(e.openBlock(),e.createElementBlock("path",Xs)),D[5]||(D[5]=e.createElementVNode("path",{d:"M5 15 H4 a2 2 0 0 1 -2 -2 V4 a2 2 0 0 1 2 -2 h9 a2 2 0 0 1 2 2 v1"},null,-1))]))],10,Ks)],46,Os))),128))])]))}}),Zs={key:0,class:"zm-jtv-root"},Js={key:0,class:"zm-jtv-key"},Qs={key:1,class:"zm-jtv-colon"},ec={key:2,class:"zm-jtv-key zm-jtv-bracket"},tc={key:3,class:"zm-jtv-size"},nc={key:4,class:"zm-jtv-bracket"},oc={key:5,class:"zm-jtv-brace"},ic={key:0,class:"zm-jtv-children"},rc={class:"zm-jtv-key"},lc={key:0,class:"zm-jtv-key"},ac=["src","alt"],sc=["href"],cc=e.defineComponent({__name:"JsonTreeViewer",props:{value:{},keyName:{default:""},isRoot:{type:Boolean,default:!0},path:{default:""},depth:{default:0},query:{default:""},collapsedPaths:{default:()=>new Set}},setup(t){const o=t,n=e.computed(()=>o.value===null?"null":Array.isArray(o.value)?"array":typeof o.value),i=e.computed(()=>n.value==="object"),a=e.computed(()=>n.value==="array");e.computed(()=>!i.value&&!a.value);const c=e.computed(()=>{if(a.value)return`Array(${o.value.length})`;if(i.value){const x=o.value,k=Object.keys(x);return`Object(${k.length} ${k.length===1?"key":"keys"})`}return""}),s=e.computed(()=>a.value?o.value.map((x,k)=>({key:String(k),value:x})):i.value?Object.entries(o.value).map(([x,k])=>({key:x,value:k})):[]),u=e.computed(()=>o.isRoot?"<root>":o.path),d=e.computed(()=>o.collapsedPaths.has(u.value));function g(x,k,m){x!=="<root>"&&(m<2||k===null||typeof k!="object"||o.collapsedPaths.has(x)||o.collapsedPaths.add(x))}o.isRoot||g(u.value,o.value,o.depth);function h(){d.value?o.collapsedPaths.delete(u.value):o.collapsedPaths.add(u.value)}function w(x){return u.value===""?x:`${u.value}.${x}`}function C(x){if(!o.query)return!0;const k=o.query.toLowerCase();return typeof x=="string"?x.toLowerCase().includes(k):x===null?"null".includes(k):String(x).toLowerCase().includes(k)}function P(x){return o.query?x.toLowerCase().includes(o.query.toLowerCase()):!0}function R(x,k){return!o.query||P(x)?!0:k===null||typeof k!="object"?C(k):!0}function U(x){return x===null?"null":typeof x=="string"?x.length>80?`"${x.slice(0,80)}..."`:`"${x}"`:typeof x=="boolean"?x?"true":"false":typeof x=="number"?String(x):typeof x>"u"?"undefined":JSON.stringify(x)}function I(x){if(typeof x!="string")return!1;const k=x.trim();return!!(k.startsWith("data:image/")||/^https?:\/\/.+\.(png|jpe?g|gif|webp|svg|bmp|ico)(\?.*)?$/i.test(k)||/^https?:\/\/.+/i.test(k)&&/\/[^/]+\.(png|jpe?g|gif|webp|svg|bmp|ico)(\?.*)?$/i.test(k))}function A(x){if(!o.query)return null;const k=x.toLowerCase().indexOf(o.query.toLowerCase());return k<0?null:{before:x.slice(0,k),match:x.slice(k,k+o.query.length),after:x.slice(k+o.query.length)}}return(x,k)=>{var F,W,K,S,ne,se;const m=e.resolveComponent("JsonTreeViewer",!0);return t.isRoot?(e.openBlock(),e.createElementBlock("div",Zs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,re=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:re.key,class:"zm-jtv-row"},[e.createVNode(m,{"key-name":re.key,value:re.value,path:w(re.key),depth:t.depth+1,query:t.query,"collapsed-paths":t.collapsedPaths,"is-root":!1},null,8,["key-name","value","path","depth","query","collapsed-paths"])])),[[e.vShow,R(re.key,re.value)]])),128))])):i.value||a.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["zm-jtv-branch",{"is-collapsed":d.value}])},[e.createElementVNode("div",{class:"zm-jtv-header",style:e.normalizeStyle({paddingLeft:6+t.depth*12+"px"}),onClick:h},[e.createElementVNode("span",{class:e.normalizeClass(["zm-jtv-toggle",{"is-leaf":!1}])},e.toDisplayString(d.value?"▶":"▼"),1),a.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",Js,e.toDisplayString(t.keyName),1)),a.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",Qs,":")),a.value?(e.openBlock(),e.createElementBlock("span",ec,"[")):e.createCommentVNode("",!0),d.value?(e.openBlock(),e.createElementBlock("span",tc,e.toDisplayString(c.value),1)):e.createCommentVNode("",!0),d.value&&a.value?(e.openBlock(),e.createElementBlock("span",nc,"]")):e.createCommentVNode("",!0),d.value&&i.value?(e.openBlock(),e.createElementBlock("span",oc,"}")):e.createCommentVNode("",!0)],4),d.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ic,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,re=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:re.key,class:"zm-jtv-row"},[e.createVNode(m,{"key-name":re.key,value:re.value,path:w(re.key),depth:t.depth+1,query:t.query,"collapsed-paths":t.collapsedPaths,"is-root":!1},null,8,["key-name","value","path","depth","query","collapsed-paths"])])),[[e.vShow,R(re.key,re.value)]])),128))])),!d.value&&a.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"zm-jtv-footer",style:e.normalizeStyle({paddingLeft:6+t.depth*12+"px"})},"]",4)):e.createCommentVNode("",!0),!d.value&&i.value&&!a.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"zm-jtv-footer",style:e.normalizeStyle({paddingLeft:6+t.depth*12+"px"})},"}",4)):e.createCommentVNode("",!0)],2)):(e.openBlock(),e.createElementBlock("div",{key:2,class:"zm-jtv-leaf",style:e.normalizeStyle({paddingLeft:6+t.depth*12+"px"})},[k[2]||(k[2]=e.createElementVNode("span",{class:"zm-jtv-toggle is-leaf"},"·",-1)),e.createElementVNode("span",rc,e.toDisplayString(t.keyName),1),k[3]||(k[3]=e.createElementVNode("span",{class:"zm-jtv-colon"},":",-1)),P(t.keyName)&&A(t.keyName)?(e.openBlock(),e.createElementBlock("span",lc,[e.createElementVNode("span",null,e.toDisplayString((F=A(t.keyName))==null?void 0:F.before),1),e.createElementVNode("mark",null,e.toDisplayString((W=A(t.keyName))==null?void 0:W.match),1),e.createElementVNode("span",null,e.toDisplayString((K=A(t.keyName))==null?void 0:K.after),1)])):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(["zm-jtv-value",`zm-jtv-${n.value}`])},[A(U(t.value))?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("span",null,e.toDisplayString((S=A(U(t.value)))==null?void 0:S.before),1),e.createElementVNode("mark",null,e.toDisplayString((ne=A(U(t.value)))==null?void 0:ne.match),1),e.createElementVNode("span",null,e.toDisplayString((se=A(U(t.value)))==null?void 0:se.after),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(U(t.value)),1)],64))],2),I(t.value)?(e.openBlock(),e.createElementBlock("span",{key:1,class:"zm-jtv-thumb-wrap",onClick:k[1]||(k[1]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("img",{class:"zm-jtv-thumb",src:String(t.value),alt:t.keyName,loading:"lazy",referrerpolicy:"no-referrer"},null,8,ac),e.createElementVNode("a",{class:"zm-jtv-thumb-link",href:String(t.value),target:"_blank",rel:"noopener noreferrer",onClick:k[0]||(k[0]=e.withModifiers(()=>{},["stop"]))},"open",8,sc)])):e.createCommentVNode("",!0)],4))}}}),dc={class:"zm-data-panel"},uc={class:"zm-data-header"},fc={class:"zm-data-title"},mc={class:"zm-data-title-meta"},pc={class:"zm-data-toolbar"},gc=["title"],hc={key:0,width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},bc={key:1,width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.4","stroke-linecap":"round","stroke-linejoin":"round"},kc={key:0,class:"zm-data-paste"},yc={class:"zm-data-tabs"},Ec=["placeholder"],xc={key:0,class:"zm-data-error"},wc={class:"zm-data-paste-actions"},Nc=["disabled"],Sc={class:"zm-data-tree"},Lo=e.defineComponent({__name:"DataPanel",props:{data:{},pendingMode:{default:null}},emits:["import","consumed-mode"],setup(t,{emit:o}){const n=t,i=o,a=e.computed(()=>JSON.stringify(n.data,null,2)),c=e.ref(""),s=e.ref(null),u=e.ref(!1),d=e.ref("json"),g=e.ref("idle"),h=e.ref(new Set),w=e.ref("");e.watch(()=>n.pendingMode,k=>{k&&(u.value=!0,d.value=k,i("consumed-mode"))},{immediate:!0});async function C(){try{await navigator.clipboard.writeText(a.value),g.value="copied",setTimeout(()=>g.value="idle",1500)}catch{const k=document.createElement("textarea");k.value=a.value,document.body.appendChild(k),k.select();try{document.execCommand("copy"),g.value="copied",setTimeout(()=>g.value="idle",1500)}finally{document.body.removeChild(k)}}}function P(){const k=new Blob([a.value],{type:"application/json"}),m=URL.createObjectURL(k),F=document.createElement("a");F.href=m,F.download=`${n.data.text||"mindmap"}.json`,F.click(),URL.revokeObjectURL(m)}function R(){s.value=null;const k=c.value.trim();if(k){if(d.value==="markdown"||d.value==="txt"){try{const m=zn(k);i("import",m),c.value="",u.value=!1}catch(m){s.value=(d.value==="txt"?"TXT 解析失败:":"Markdown 解析失败:")+m.message}return}try{const m=JSON.parse(k);if(!m.id||!Array.isArray(m.children)){s.value="JSON 缺少 id 或 children 字段";return}i("import",m),c.value="",u.value=!1}catch(m){s.value="JSON 解析失败:"+m.message}}}function U(k){return 1+k.children.reduce((m,F)=>m+U(F),0)}const I=e.computed(()=>U(n.data)),A=e.computed(()=>a.value.length);function x(){const k=document.createElement("input");k.type="file",k.accept="application/json",k.onchange=()=>{var W;const m=(W=k.files)==null?void 0:W[0];if(!m)return;const F=new FileReader;F.onload=()=>{typeof F.result=="string"&&(c.value=F.result,R())},F.readAsText(m)},k.click()}return(k,m)=>(e.openBlock(),e.createElementBlock("div",dc,[e.createElementVNode("div",uc,[e.createElementVNode("div",fc,[m[8]||(m[8]=e.createElementVNode("span",{class:"zm-data-title-text"},"数据 JSON",-1)),e.createElementVNode("span",mc,e.toDisplayString(I.value)+" 节点 · "+e.toDisplayString(A.value)+" chars",1)])]),e.createElementVNode("div",pc,[e.createElementVNode("button",{class:e.normalizeClass(["zm-data-btn is-icon",{"is-success":g.value==="copied"}]),title:g.value==="copied"?"已复制":"复制 JSON 到剪贴板",onClick:C},[g.value==="idle"?(e.openBlock(),e.createElementBlock("svg",hc,[...m[9]||(m[9]=[e.createElementVNode("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"},null,-1),e.createElementVNode("path",{d:"M5 15 H4 a2 2 0 0 1 -2 -2 V4 a2 2 0 0 1 2 -2 h9 a2 2 0 0 1 2 2 v1"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",bc,[...m[10]||(m[10]=[e.createElementVNode("polyline",{points:"5 12 10 17 19 7"},null,-1)])])),m[11]||(m[11]=e.createElementVNode("span",{class:"zm-data-btn-label"},"复制",-1))],10,gc),e.createElementVNode("button",{class:"zm-data-btn is-icon",title:"导出为 JSON 文件",onClick:P},[...m[12]||(m[12]=[e.createStaticVNode('<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 4 V15"></path><polyline points="7 9 12 4 17 9"></polyline><path d="M4 19 H20"></path></svg><span class="zm-data-btn-label">导出</span>',2)])]),e.createElementVNode("button",{class:"zm-data-btn is-icon",title:"从 JSON 文件导入",onClick:x},[...m[13]||(m[13]=[e.createStaticVNode('<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 15 V4"></path><polyline points="7 9 12 4 17 9"></polyline><path d="M4 19 H20"></path></svg><span class="zm-data-btn-label">导入</span>',2)])]),e.createElementVNode("button",{class:e.normalizeClass(["zm-data-btn is-icon",{"is-active":u.value}]),title:"粘贴 JSON 或 Markdown 替换当前数据",onClick:m[0]||(m[0]=F=>u.value=!u.value)},[...m[14]||(m[14]=[e.createStaticVNode('<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 4 H15 V8 H9 Z"></path><path d="M9 8 H4 V20 H9"></path><path d="M15 8 H20 V20 H15"></path></svg><span class="zm-data-btn-label">粘贴</span>',2)])],2),m[16]||(m[16]=e.createElementVNode("div",{class:"zm-data-toolbar-spacer"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["zm-data-search",{"is-active":w.value.length>0}])},[m[15]||(m[15]=e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"}),e.createElementVNode("line",{x1:"20",y1:"20",x2:"16",y2:"16"})],-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":m[1]||(m[1]=F=>w.value=F),type:"text",placeholder:"过滤 (键 / 值)",spellcheck:"false"},null,512),[[e.vModelText,w.value]]),w.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-data-search-clear",title:"清空过滤",onClick:m[2]||(m[2]=F=>w.value="")},"×")):e.createCommentVNode("",!0)],2)]),u.value?(e.openBlock(),e.createElementBlock("div",kc,[e.createElementVNode("div",yc,[e.createElementVNode("button",{class:e.normalizeClass(["zm-data-tab",{"is-active":d.value==="json"}]),onClick:m[3]||(m[3]=F=>d.value="json")},"JSON",2),e.createElementVNode("button",{class:e.normalizeClass(["zm-data-tab",{"is-active":d.value==="markdown"}]),onClick:m[4]||(m[4]=F=>d.value="markdown")},"Markdown",2)]),e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":m[5]||(m[5]=F=>c.value=F),placeholder:d.value==="json"?"paste a JSON tree to replace current data":"paste markdown - # / ## / ### become nodes",spellcheck:"false"},null,8,Ec),[[e.vModelText,c.value]]),s.value?(e.openBlock(),e.createElementBlock("div",xc,e.toDisplayString(s.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",wc,[e.createElementVNode("button",{class:"zm-data-btn is-primary",disabled:!c.value,onClick:R},"应用",8,Nc),e.createElementVNode("button",{class:"zm-data-btn",onClick:m[6]||(m[6]=F=>{c.value="",s.value=null})},"清空"),e.createElementVNode("button",{class:"zm-data-btn",onClick:m[7]||(m[7]=F=>u.value=!1)},"关闭")])])):e.createCommentVNode("",!0),e.createElementVNode("div",Sc,[e.createVNode(cc,{value:t.data,query:w.value,"collapsed-paths":h.value},null,8,["value","query","collapsed-paths"])]),m[17]||(m[17]=e.createElementVNode("div",{class:"zm-data-footer"},[e.createElementVNode("span",{class:"zm-data-footer-hint"},[e.createTextVNode(" 图片支持 "),e.createElementVNode("code",null,"data:image/..."),e.createTextVNode(" / "),e.createElementVNode("code",null,"https://..."),e.createTextVNode(" / "),e.createElementVNode("code",null,"/imgs/foo.png"),e.createTextVNode(" (同源)。本地 "),e.createElementVNode("code",null,"file://"),e.createTextVNode(" 路径被浏览器拒绝。 ")])],-1))]))}}),Tc={class:"zm-md-panel"},Cc={key:0,class:"zm-md-error"},Mc={class:"zm-md-split"},Ac={class:"zm-md-edit"},_c={class:"zm-md-preview"},Rc={class:"zm-md-preview-body"},Bc={class:"zm-md-footer"},vc=["disabled"],Ic=`# flow-mindmap 思维导图
|
|
15
17
|
|
|
16
18
|
[GitHub 仓库](https://github.com/xz333221/flow-mindmap)
|
|
17
19
|
|
|
@@ -50,60 +52,60 @@
|
|
|
50
52
|
|
|
51
53
|
## 开源协议
|
|
52
54
|
[Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0)
|
|
53
|
-
`,Do=e.defineComponent({__name:"MarkdownPanel",props:{data:{}},emits:["import"],setup(t,{emit:o}){const n=t,i=o,a=e.ref(
|
|
54
|
-
`)),
|
|
55
|
-
`);return}const
|
|
56
|
-
`)}function R(L){const S=n.settings.customPalettes.filter(J=>J.id!==L.id),K=n.settings.branchPaletteId===L.id?"default":n.settings.branchPaletteId;i("update:settings",{customPalettes:S,...K!==n.settings.branchPaletteId?{branchPaletteId:K}:{}}),delete h[L.id]}const F=["#f87171","#fb923c","#fbbf24","#a3e635","#34d399","#22d3ee","#818cf8","#c084fc","#1e2937","#f8fafc","#94a3b8"],B=["#f8fafc","#ffffff","#e2e8f0","#1e2937","#0f172a","#fef3c7","#dbeafe","#dcfce7","#fce7f3","#f1f5f9"],_=[0,1,2,3],x=["#f87171","#fb923c","#34d399","#818cf8"];function k(L,S,K,J){if(S<=1)return K;const de=L/(S-1);return K+(J-K)*de}function m(L,S,K){return L<=0?S:L===1?Math.max(1.5,S*.67):L===2?Math.max(.8,S*.42):K}const P=e.computed(()=>{const L=n.settings.lineWidthStart,S=n.settings.lineWidthEnd,K=n.settings.taperedEdge,J=_.length,de=8,ee=192,Y=g.value.find(ie=>ie.id===n.settings.branchPaletteId),oe=Y&&Y.colors.length?Y.colors:x;return _.map((ie,ye)=>{const y=10+ye*60/(J-1);return{x1:de,y1:y,x2:ee,y2:y,w:K?m(ie,L,S):k(ie,J,L,S),color:n.settings.rainbowBranch?oe[ye%oe.length]:"#94a3b8"}})});return(L,S)=>{var K,J,de,ee,Y,oe,ie,ye;return e.openBlock(),e.createElementBlock("div",Bc,[e.createElementVNode("section",Ic,[S[37]||(S[37]=e.createElementVNode("h4",{class:"zm-settings-section-title"},"画布",-1)),e.createElementVNode("div",zc,[S[21]||(S[21]=e.createElementVNode("span",{class:"zm-settings-label"},"画布背景色",-1)),e.createElementVNode("div",Oc,[e.createElementVNode("label",Lc,[e.createElementVNode("input",{type:"color",class:"zm-color-input",value:t.settings.canvasBg||"#f8fafc",onInput:S[0]||(S[0]=y=>a("canvasBg",y.target.value))},null,40,Dc),e.createElementVNode("span",Vc,e.toDisplayString(t.settings.canvasBg||"默认"),1)])])]),e.createElementVNode("div",$c,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(B,y=>e.createElementVNode("button",{key:"cbg-"+y,class:e.normalizeClass(["zm-swatch",{"is-active":(t.settings.canvasBg||"#f8fafc")===y}]),style:e.normalizeStyle({background:y}),title:y,onClick:V=>a("canvasBg",y)},null,14,Pc)),64)),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"恢复默认",onClick:S[1]||(S[1]=y=>a("canvasBg",void 0))},"∅")]),S[38]||(S[38]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",Fc,[S[22]||(S[22]=e.createElementVNode("span",{class:"zm-settings-label"},"线条粗端 (根部)",-1)),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"0.2",value:t.settings.lineWidthStart,onChange:S[2]||(S[2]=y=>a("lineWidthStart",parseFloat(y.target.value)||0))},null,40,Uc)]),e.createElementVNode("div",Hc,[S[23]||(S[23]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"0.4",max:"20",step:"0.2",value:t.settings.lineWidthStart,onInput:S[3]||(S[3]=y=>a("lineWidthStart",parseFloat(y.target.value)))},null,40,Wc)]),e.createElementVNode("div",Gc,[S[24]||(S[24]=e.createElementVNode("span",{class:"zm-settings-label"},"线条细端 (子端)",-1)),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"0.2",value:t.settings.lineWidthEnd,onChange:S[4]||(S[4]=y=>a("lineWidthEnd",parseFloat(y.target.value)||0))},null,40,jc)]),e.createElementVNode("div",Kc,[S[25]||(S[25]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"0.2",max:"6",step:"0.1",value:t.settings.lineWidthEnd,onInput:S[5]||(S[5]=y=>a("lineWidthEnd",parseFloat(y.target.value)))},null,40,Yc)]),S[39]||(S[39]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",qc,[S[26]||(S[26]=e.createElementVNode("span",{class:"zm-settings-label"},"线条类型",-1)),e.createElementVNode("div",Xc,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(c,y=>e.createElementVNode("button",{key:y.value,class:e.normalizeClass(["zm-line-style-btn",{"is-on":t.settings.lineStyle===y.value}]),title:y.label,onClick:V=>a("lineStyle",y.value)},[(e.openBlock(),e.createElementBlock("svg",{viewBox:y.viewBox,width:"28",height:"14",preserveAspectRatio:"none"},[y.value==="arc"?(e.openBlock(),e.createElementBlock("path",Qc)):y.value==="elbow"?(e.openBlock(),e.createElementBlock("path",ed)):y.value==="curve"?(e.openBlock(),e.createElementBlock("path",td)):(e.openBlock(),e.createElementBlock("line",nd))],8,Jc)),e.createElementVNode("span",od,e.toDisplayString(y.label),1)],10,Zc)),64))])]),e.createElementVNode("div",id,[S[28]||(S[28]=e.createElementVNode("span",{class:"zm-settings-label"},"线条起点",-1)),e.createElementVNode("div",rd,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(s,y=>e.createElementVNode("button",{key:y.value,class:e.normalizeClass(["zm-line-style-btn",{"is-on":t.settings.lineOrigin===y.value}]),title:y.label,onClick:V=>a("lineOrigin",y.value)},[(e.openBlock(),e.createElementBlock("svg",ad,[S[27]||(S[27]=e.createElementVNode("rect",{x:"8",y:"6",width:"12",height:"6",rx:"2",fill:"none",stroke:"currentColor","stroke-width":"1.2",opacity:"0.5"},null,-1)),y.value==="edge"?(e.openBlock(),e.createElementBlock("path",sd)):y.value==="center"?(e.openBlock(),e.createElementBlock("path",cd)):(e.openBlock(),e.createElementBlock("path",dd))])),e.createElementVNode("span",ud,e.toDisplayString(y.label),1)],10,ld)),64))])]),e.createElementVNode("div",fd,[S[30]||(S[30]=e.createElementVNode("span",{class:"zm-settings-label"},"一级分支彩虹色",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.rainbowBranch}]),onClick:S[6]||(S[6]=y=>a("rainbowBranch",!t.settings.rainbowBranch))},[...S[29]||(S[29]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),t.settings.rainbowBranch?(e.openBlock(),e.createElementBlock("div",md,[e.createElementVNode("div",pd,[S[31]||(S[31]=e.createElementVNode("span",{class:"zm-settings-label"},"配色方案",-1)),e.createElementVNode("select",{class:"zm-select",value:t.settings.branchPaletteId,onChange:S[7]||(S[7]=y=>a("branchPaletteId",y.target.value))},[e.createElementVNode("optgroup",hd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(on),y=>(e.openBlock(),e.createElementBlock("option",{key:y.id,value:y.id},e.toDisplayString(y.name),9,bd))),128))]),t.settings.customPalettes.length?(e.openBlock(),e.createElementBlock("optgroup",kd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.settings.customPalettes,y=>(e.openBlock(),e.createElementBlock("option",{key:y.id,value:y.id},e.toDisplayString(y.name),9,yd))),128))])):e.createCommentVNode("",!0)],40,gd)]),g.value.find(y=>y.id===t.settings.branchPaletteId)?(e.openBlock(),e.createElementBlock("div",Ed,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((K=g.value.find(y=>y.id===t.settings.branchPaletteId))==null?void 0:K.colors,(y,V)=>(e.openBlock(),e.createElementBlock("span",{key:V,class:"zm-palette-preview-swatch",style:e.normalizeStyle({background:y})},null,4))),128))])):e.createCommentVNode("",!0),t.settings.customPalettes.find(y=>y.id===t.settings.branchPaletteId)?(e.openBlock(),e.createElementBlock("div",xd,[e.createElementVNode("textarea",{class:"zm-palette-textarea",rows:"3",spellcheck:"false",placeholder:"一行一个 hex,例如 #f87171",value:N(t.settings.customPalettes.find(y=>y.id===t.settings.branchPaletteId)),onInput:S[8]||(S[8]=y=>h[t.settings.customPalettes.find(V=>V.id===t.settings.branchPaletteId).id]=y.target.value)},null,40,wd),e.createElementVNode("div",Nd,[e.createElementVNode("button",{type:"button",class:"zm-data-btn is-primary",onClick:S[9]||(S[9]=y=>C(t.settings.customPalettes.find(V=>V.id===t.settings.branchPaletteId)))},"保存"),e.createElementVNode("button",{type:"button",class:"zm-data-btn",onClick:S[10]||(S[10]=y=>R(t.settings.customPalettes.find(V=>V.id===t.settings.branchPaletteId)))},"删除")])])):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"zm-palette-add",onClick:$},"+ 新建配色")])):e.createCommentVNode("",!0),S[40]||(S[40]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",Sd,[S[33]||(S[33]=e.createElementVNode("span",{class:"zm-settings-label"},"每条连线独立渐变",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.taperedEdge}]),onClick:S[11]||(S[11]=y=>a("taperedEdge",!t.settings.taperedEdge))},[...S[32]||(S[32]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),e.createElementVNode("div",Cd,[S[35]||(S[35]=e.createElementVNode("span",{class:"zm-settings-label"},"显示节点序号",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.showOrderBadge}]),onClick:S[12]||(S[12]=y=>a("showOrderBadge",!t.settings.showOrderBadge))},[...S[34]||(S[34]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),e.createElementVNode("div",Td,[(e.openBlock(),e.createElementBlock("svg",Ad,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(P.value,(y,V)=>(e.openBlock(),e.createElementBlock("line",{key:V,x1:y.x1,y1:y.y1,x2:y.x2,y2:y.y2,stroke:t.settings.rainbowBranch?y.color:"#94a3b8","stroke-width":y.w,"stroke-linecap":"butt"},null,8,_d))),128))])),S[36]||(S[36]=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",Md,[e.createElementVNode("h4",Rd,[S[41]||(S[41]=e.createTextVNode(" 节点 ",-1)),t.selectedNodeText?(e.openBlock(),e.createElementBlock("span",vd,'"'+e.toDisplayString(t.selectedNodeText)+'"',1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Bd,[S[42]||(S[42]=e.createElementVNode("span",{class:"zm-settings-label"},"背景颜色",-1)),e.createElementVNode("span",Id,e.toDisplayString(((J=t.nodeStyle)==null?void 0:J.bg)||"默认"),1)]),e.createElementVNode("div",zd,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(F,y=>{var V;return e.createElementVNode("button",{key:"bg-"+y,class:e.normalizeClass(["zm-swatch",{"is-active":((V=t.nodeStyle)==null?void 0:V.bg)===y}]),style:e.normalizeStyle({background:y}),title:y,onClick:U=>d({bg:y})},null,14,Od)}),64)),e.createElementVNode("label",Ld,[e.createElementVNode("input",{type:"color",value:((de=t.nodeStyle)==null?void 0:de.bg)||"#ffffff",onInput:S[13]||(S[13]=y=>d({bg:y.target.value}))},null,40,Dd)]),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"清除",onClick:S[14]||(S[14]=y=>d({bg:void 0}))},"∅")]),e.createElementVNode("div",Vd,[S[43]||(S[43]=e.createElementVNode("span",{class:"zm-settings-label"},"文字颜色",-1)),e.createElementVNode("span",$d,e.toDisplayString(((ee=t.nodeStyle)==null?void 0:ee.textColor)||"默认"),1)]),e.createElementVNode("div",Pd,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(F,y=>{var V;return e.createElementVNode("button",{key:"fg-"+y,class:e.normalizeClass(["zm-swatch",{"is-active":((V=t.nodeStyle)==null?void 0:V.textColor)===y}]),style:e.normalizeStyle({background:y}),title:y,onClick:U=>d({textColor:y})},null,14,Fd)}),64)),e.createElementVNode("label",Ud,[e.createElementVNode("input",{type:"color",value:((Y=t.nodeStyle)==null?void 0:Y.textColor)||"#1e2937",onInput:S[15]||(S[15]=y=>d({textColor:y.target.value}))},null,40,Hd)]),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"清除",onClick:S[16]||(S[16]=y=>d({textColor:void 0}))},"∅")]),S[47]||(S[47]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",Wd,[S[44]||(S[44]=e.createElementVNode("span",{class:"zm-settings-label"},"字重",-1)),e.createElementVNode("select",{class:"zm-select",value:((oe=t.nodeStyle)==null?void 0:oe.fontWeight)??400,onChange:S[17]||(S[17]=y=>d({fontWeight:parseInt(y.target.value)}))},[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(u,y=>e.createElementVNode("option",{key:y.value,value:y.value},e.toDisplayString(y.label),9,jd)),64))],40,Gd)]),e.createElementVNode("div",Kd,[S[45]||(S[45]=e.createElementVNode("span",{class:"zm-settings-label"},"文字大小",-1)),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"1",min:"8",max:"48",value:((ie=t.nodeStyle)==null?void 0:ie.fontSize)??14,onChange:S[18]||(S[18]=y=>d({fontSize:parseInt(y.target.value)||14}))},null,40,Yd)]),e.createElementVNode("div",qd,[S[46]||(S[46]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"8",max:"48",step:"1",value:((ye=t.nodeStyle)==null?void 0:ye.fontSize)??14,onInput:S[19]||(S[19]=y=>d({fontSize:parseInt(y.target.value)}))},null,40,Xd)]),S[48]||(S[48]=e.createElementVNode("p",{class:"zm-settings-hint"},"仅作用于当前节点,不影响子节点。",-1))])):e.createCommentVNode("",!0),e.createElementVNode("section",Zd,[e.createElementVNode("button",{class:"zm-settings-reset",onClick:S[20]||(S[20]=y=>i("reset"))},"恢复默认设置")])])}}}),[["__scopeId","data-v-ef1c774d"]]),Er=20;function Jd(t,o){t.style.height="auto";const n=o.minRows*Er,i=o.maxRows>0?o.maxRows*Er:1/0,a=Math.max(n,Math.min(i,t.scrollHeight));t.style.height=a+"px",t.style.overflowY=t.scrollHeight>i?"auto":"hidden"}function bi(t,o={}){const n={minRows:o.minRows??3,maxRows:o.maxRows??12};function i(){const c=t.value;c&&Jd(c,n)}function a(){i()}e.onMounted(async()=>{await e.nextTick();const c=t.value;c&&(c.addEventListener("input",a),i())}),e.watch(()=>{var c;return(c=t.value)==null?void 0:c.value},()=>i()),e.onBeforeUnmount(()=>{const c=t.value;c&&c.removeEventListener("input",a)})}function Qd(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function xr(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)&&xr(n)}),t}class wr{constructor(o){o.data===void 0&&(o.data={}),this.data=o.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function Nr(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function dn(t,...o){const n=Object.create(null);for(const i in t)n[i]=t[i];return o.forEach(function(i){for(const a in i)n[a]=i[a]}),n}const eu="</span>",Sr=t=>!!t.scope,tu=(t,{prefix:o})=>{if(t.startsWith("language:"))return t.replace("language:","language-");if(t.includes(".")){const n=t.split(".");return[`${o}${n.shift()}`,...n.map((i,a)=>`${i}${"_".repeat(a+1)}`)].join(" ")}return`${o}${t}`};class nu{constructor(o,n){this.buffer="",this.classPrefix=n.classPrefix,o.walk(this)}addText(o){this.buffer+=Nr(o)}openNode(o){if(!Sr(o))return;const n=tu(o.scope,{prefix:this.classPrefix});this.span(n)}closeNode(o){Sr(o)&&(this.buffer+=eu)}value(){return this.buffer}span(o){this.buffer+=`<span class="${o}">`}}const Cr=(t={})=>{const o={children:[]};return Object.assign(o,t),o};class ki{constructor(){this.rootNode=Cr(),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=Cr({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=>{ki._collapse(n)}))}}class ou extends ki{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 nu(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function ro(t){return t?typeof t=="string"?t:t.source:null}function Tr(t){return En("(?=",t,")")}function iu(t){return En("(?:",t,")*")}function ru(t){return En("(?:",t,")?")}function En(...t){return t.map(n=>ro(n)).join("")}function lu(t){const o=t[t.length-1];return typeof o=="object"&&o.constructor===Object?(t.splice(t.length-1,1),o):{}}function yi(...t){return"("+(lu(t).capture?"":"?:")+t.map(i=>ro(i)).join("|")+")"}function Ar(t){return new RegExp(t.toString()+"|").exec("").length-1}function au(t,o){const n=t&&t.exec(o);return n&&n.index===0}const su=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Ei(t,{joinWith:o}){let n=0;return t.map(i=>{n+=1;const a=n;let c=ro(i),s="";for(;c.length>0;){const u=su.exec(c);if(!u){s+=c;break}s+=c.substring(0,u.index),c=c.substring(u.index+u[0].length),u[0][0]==="\\"&&u[1]?s+="\\"+String(Number(u[1])+a):(s+=u[0],u[0]==="("&&n++)}return s}).map(i=>`(${i})`).join(o)}const cu=/\b\B/,_r="[a-zA-Z]\\w*",xi="[a-zA-Z_]\\w*",Mr="\\b\\d+(\\.\\d+)?",Rr="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",vr="\\b(0b[01]+)",du="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",uu=(t={})=>{const o=/^#![ ]*\//;return t.binary&&(t.begin=En(o,/.*\b/,t.binary,/\b.*/)),dn({scope:"meta",begin:o,end:/$/,relevance:0,"on:begin":(n,i)=>{n.index!==0&&i.ignoreMatch()}},t)},lo={begin:"\\\\[\\s\\S]",relevance:0},fu={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[lo]},mu={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[lo]},pu={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},$o=function(t,o,n={}){const i=dn({scope:"comment",begin:t,end:o,contains:[]},n);i.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const a=yi("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return i.contains.push({begin:En(/[ ]+/,"(",a,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),i},gu=$o("//","$"),hu=$o("/\\*","\\*/"),bu=$o("#","$"),ku={scope:"number",begin:Mr,relevance:0},yu={scope:"number",begin:Rr,relevance:0},Eu={scope:"number",begin:vr,relevance:0},xu={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[lo,{begin:/\[/,end:/\]/,relevance:0,contains:[lo]}]},wu={scope:"title",begin:_r,relevance:0},Nu={scope:"title",begin:xi,relevance:0},Su={begin:"\\.\\s*"+xi,relevance:0};var Po=Object.freeze({__proto__:null,APOS_STRING_MODE:fu,BACKSLASH_ESCAPE:lo,BINARY_NUMBER_MODE:Eu,BINARY_NUMBER_RE:vr,COMMENT:$o,C_BLOCK_COMMENT_MODE:hu,C_LINE_COMMENT_MODE:gu,C_NUMBER_MODE:yu,C_NUMBER_RE:Rr,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:bu,IDENT_RE:_r,MATCH_NOTHING_RE:cu,METHOD_GUARD:Su,NUMBER_MODE:ku,NUMBER_RE:Mr,PHRASAL_WORDS_MODE:pu,QUOTE_STRING_MODE:mu,REGEXP_MODE:xu,RE_STARTERS_RE:du,SHEBANG:uu,TITLE_MODE:wu,UNDERSCORE_IDENT_RE:xi,UNDERSCORE_TITLE_MODE:Nu});function Cu(t,o){t.input[t.index-1]==="."&&o.ignoreMatch()}function Tu(t,o){t.className!==void 0&&(t.scope=t.className,delete t.className)}function Au(t,o){o&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=Cu,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function _u(t,o){Array.isArray(t.illegal)&&(t.illegal=yi(...t.illegal))}function Mu(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 Ru(t,o){t.relevance===void 0&&(t.relevance=1)}const vu=(t,o)=>{if(!t.beforeMatch)return;if(t.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},t);Object.keys(t).forEach(i=>{delete t[i]}),t.keywords=n.keywords,t.begin=En(n.beforeMatch,Tr(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},Bu=["of","and","for","in","not","or","if","then","parent","list","value"],Iu="keyword";function Br(t,o,n=Iu){const i=Object.create(null);return typeof t=="string"?a(n,t.split(" ")):Array.isArray(t)?a(n,t):Object.keys(t).forEach(function(c){Object.assign(i,Br(t[c],o,c))}),i;function a(c,s){o&&(s=s.map(u=>u.toLowerCase())),s.forEach(function(u){const d=u.split("|");i[d[0]]=[c,zu(d[0],d[1])]})}}function zu(t,o){return o?Number(o):Ou(t)?0:1}function Ou(t){return Bu.includes(t.toLowerCase())}const Ir={},xn=t=>{console.error(t)},zr=(t,...o)=>{console.log(`WARN: ${t}`,...o)},On=(t,o)=>{Ir[`${t}/${o}`]||(console.log(`Deprecated as of ${t}. ${o}`),Ir[`${t}/${o}`]=!0)},Fo=new Error;function Or(t,o,{key:n}){let i=0;const a=t[n],c={},s={};for(let u=1;u<=o.length;u++)s[u+i]=a[u],c[u+i]=!0,i+=Ar(o[u-1]);t[n]=s,t[n]._emit=c,t[n]._multi=!0}function Lu(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw xn("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Fo;if(typeof t.beginScope!="object"||t.beginScope===null)throw xn("beginScope must be object"),Fo;Or(t,t.begin,{key:"beginScope"}),t.begin=Ei(t.begin,{joinWith:""})}}function Du(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw xn("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Fo;if(typeof t.endScope!="object"||t.endScope===null)throw xn("endScope must be object"),Fo;Or(t,t.end,{key:"endScope"}),t.end=Ei(t.end,{joinWith:""})}}function Vu(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function $u(t){Vu(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),Lu(t),Du(t)}function Pu(t){function o(s,u){return new RegExp(ro(s),"m"+(t.case_insensitive?"i":"")+(t.unicodeRegex?"u":"")+(u?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(u,d){d.position=this.position++,this.matchIndexes[this.matchAt]=d,this.regexes.push([d,u]),this.matchAt+=Ar(u)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const u=this.regexes.map(d=>d[1]);this.matcherRe=o(Ei(u,{joinWith:"|"}),!0),this.lastIndex=0}exec(u){this.matcherRe.lastIndex=this.lastIndex;const d=this.matcherRe.exec(u);if(!d)return null;const g=d.findIndex((N,C)=>C>0&&N!==void 0),h=this.matchIndexes[g];return d.splice(0,g),Object.assign(d,h)}}class i{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(u){if(this.multiRegexes[u])return this.multiRegexes[u];const d=new n;return this.rules.slice(u).forEach(([g,h])=>d.addRule(g,h)),d.compile(),this.multiRegexes[u]=d,d}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(u,d){this.rules.push([u,d]),d.type==="begin"&&this.count++}exec(u){const d=this.getMatcher(this.regexIndex);d.lastIndex=this.lastIndex;let g=d.exec(u);if(this.resumingScanAtSamePosition()&&!(g&&g.index===this.lastIndex)){const h=this.getMatcher(0);h.lastIndex=this.lastIndex+1,g=h.exec(u)}return g&&(this.regexIndex+=g.position+1,this.regexIndex===this.count&&this.considerAll()),g}}function a(s){const u=new i;return s.contains.forEach(d=>u.addRule(d.begin,{rule:d,type:"begin"})),s.terminatorEnd&&u.addRule(s.terminatorEnd,{type:"end"}),s.illegal&&u.addRule(s.illegal,{type:"illegal"}),u}function c(s,u){const d=s;if(s.isCompiled)return d;[Tu,Mu,$u,vu].forEach(h=>h(s,u)),t.compilerExtensions.forEach(h=>h(s,u)),s.__beforeBegin=null,[Au,_u,Ru].forEach(h=>h(s,u)),s.isCompiled=!0;let g=null;return typeof s.keywords=="object"&&s.keywords.$pattern&&(s.keywords=Object.assign({},s.keywords),g=s.keywords.$pattern,delete s.keywords.$pattern),g=g||/\w+/,s.keywords&&(s.keywords=Br(s.keywords,t.case_insensitive)),d.keywordPatternRe=o(g,!0),u&&(s.begin||(s.begin=/\B|\b/),d.beginRe=o(d.begin),!s.end&&!s.endsWithParent&&(s.end=/\B|\b/),s.end&&(d.endRe=o(d.end)),d.terminatorEnd=ro(d.end)||"",s.endsWithParent&&u.terminatorEnd&&(d.terminatorEnd+=(s.end?"|":"")+u.terminatorEnd)),s.illegal&&(d.illegalRe=o(s.illegal)),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map(function(h){return Fu(h==="self"?s:h)})),s.contains.forEach(function(h){c(h,d)}),s.starts&&c(s.starts,u),d.matcher=a(d),d}if(t.compilerExtensions||(t.compilerExtensions=[]),t.contains&&t.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return t.classNameAliases=dn(t.classNameAliases||{}),c(t)}function Lr(t){return t?t.endsWithParent||Lr(t.starts):!1}function Fu(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(o){return dn(t,{variants:null},o)})),t.cachedVariants?t.cachedVariants:Lr(t)?dn(t,{starts:t.starts?dn(t.starts):null}):Object.isFrozen(t)?dn(t):t}var Uu="11.11.1";class Hu extends Error{constructor(o,n){super(o),this.name="HTMLInjectionError",this.html=n}}const wi=Nr,Dr=dn,Vr=Symbol("nomatch"),Wu=7,$r=function(t){const o=Object.create(null),n=Object.create(null),i=[];let a=!0;const c="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]};let u={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:ou};function d(y){return u.noHighlightRe.test(y)}function g(y){let V=y.className+" ";V+=y.parentNode?y.parentNode.className:"";const U=u.languageDetectRe.exec(V);if(U){const j=K(U[1]);return j||(zr(c.replace("{}",U[1])),zr("Falling back to no-highlight mode for this block.",y)),j?U[1]:"no-highlight"}return V.split(/\s+/).find(j=>d(j)||K(j))}function h(y,V,U){let j="",ae="";typeof V=="object"?(j=y,U=V.ignoreIllegals,ae=V.language):(On("10.7.0","highlight(lang, code, ...args) has been deprecated."),On("10.7.0",`Please use highlight(code, options) instead.
|
|
57
|
-
https://github.com/highlightjs/highlight.js/issues/2277`),
|
|
58
|
-
`,1;if(At>1e5&&At>Z.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Re+=fe,fe.length}const nt=K(y);if(!nt)throw xn(c.replace("{}",y)),new Error('Unknown language: "'+y+'"');const rn=Pu(nt);let $t="",Q=j||rn;const kt={},ve=new u.__emitter(u);tt();let Re="",Pt=0,rt=0,At=0,Ct=!1;try{if(nt.__emitTokens)nt.__emitTokens(V,ve);else{for(Q.matcher.considerAll();;){At++,Ct?Ct=!1:Q.matcher.considerAll(),Q.matcher.lastIndex=rt;const H=Q.matcher.exec(V);if(!H)break;const Z=V.substring(rt,H.index),fe=it(Z,H);rt=H.index+fe}it(V.substring(rt))}return ve.finalize(),$t=ve.toHTML(),{language:y,value:$t,relevance:Pt,illegal:!1,_emitter:ve,_top:Q}}catch(H){if(H.message&&H.message.includes("Illegal"))return{language:y,value:wi(V),illegal:!0,relevance:0,_illegalBy:{message:H.message,index:rt,context:V.slice(rt-100,rt+100),mode:H.mode,resultSoFar:$t},_emitter:ve};if(a)return{language:y,value:wi(V),illegal:!1,relevance:0,errorRaised:H,_emitter:ve,_top:Q};throw H}}function C(y){const V={value:wi(y),illegal:!1,relevance:0,_top:s,_emitter:new u.__emitter(u)};return V._emitter.addText(y),V}function $(y,V){V=V||u.languages||Object.keys(o);const U=C(y),j=V.filter(K).filter(de).map(Ae=>N(Ae,y,!1));j.unshift(U);const ae=j.sort((Ae,E)=>{if(Ae.relevance!==E.relevance)return E.relevance-Ae.relevance;if(Ae.language&&E.language){if(K(Ae.language).supersetOf===E.language)return 1;if(K(E.language).supersetOf===Ae.language)return-1}return 0}),[Me,ze]=ae,De=Me;return De.secondBest=ze,De}function R(y,V,U){const j=V&&n[V]||U;y.classList.add("hljs"),y.classList.add(`language-${j}`)}function F(y){let V=null;const U=g(y);if(d(U))return;if(ie("before:highlightElement",{el:y,language:U}),y.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",y);return}if(y.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(y)),u.throwUnescapedHTML))throw new Hu("One of your code blocks includes unescaped HTML.",y.innerHTML);V=y;const j=V.textContent,ae=U?h(j,{language:U,ignoreIllegals:!0}):$(j);y.innerHTML=ae.value,y.dataset.highlighted="yes",R(y,U,ae.language),y.result={language:ae.language,re:ae.relevance,relevance:ae.relevance},ae.secondBest&&(y.secondBest={language:ae.secondBest.language,relevance:ae.secondBest.relevance}),ie("after:highlightElement",{el:y,result:ae,text:j})}function B(y){u=Dr(u,y)}const _=()=>{m(),On("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function x(){m(),On("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let k=!1;function m(){function y(){m()}if(document.readyState==="loading"){k||window.addEventListener("DOMContentLoaded",y,!1),k=!0;return}document.querySelectorAll(u.cssSelector).forEach(F)}function P(y,V){let U=null;try{U=V(t)}catch(j){if(xn("Language definition for '{}' could not be registered.".replace("{}",y)),a)xn(j);else throw j;U=s}U.name||(U.name=y),o[y]=U,U.rawDefinition=V.bind(null,t),U.aliases&&J(U.aliases,{languageName:y})}function L(y){delete o[y];for(const V of Object.keys(n))n[V]===y&&delete n[V]}function S(){return Object.keys(o)}function K(y){return y=(y||"").toLowerCase(),o[y]||o[n[y]]}function J(y,{languageName:V}){typeof y=="string"&&(y=[y]),y.forEach(U=>{n[U.toLowerCase()]=V})}function de(y){const V=K(y);return V&&!V.disableAutodetect}function ee(y){y["before:highlightBlock"]&&!y["before:highlightElement"]&&(y["before:highlightElement"]=V=>{y["before:highlightBlock"](Object.assign({block:V.el},V))}),y["after:highlightBlock"]&&!y["after:highlightElement"]&&(y["after:highlightElement"]=V=>{y["after:highlightBlock"](Object.assign({block:V.el},V))})}function Y(y){ee(y),i.push(y)}function oe(y){const V=i.indexOf(y);V!==-1&&i.splice(V,1)}function ie(y,V){const U=y;i.forEach(function(j){j[U]&&j[U](V)})}function ye(y){return On("10.7.0","highlightBlock will be removed entirely in v12.0"),On("10.7.0","Please use highlightElement now."),F(y)}Object.assign(t,{highlight:h,highlightAuto:$,highlightAll:m,highlightElement:F,highlightBlock:ye,configure:B,initHighlighting:_,initHighlightingOnLoad:x,registerLanguage:P,unregisterLanguage:L,listLanguages:S,getLanguage:K,registerAliases:J,autoDetection:de,inherit:Dr,addPlugin:Y,removePlugin:oe}),t.debugMode=function(){a=!1},t.safeMode=function(){a=!0},t.versionString=Uu,t.regex={concat:En,lookahead:Tr,either:yi,optional:ru,anyNumberOfTimes:iu};for(const y in Po)typeof Po[y]=="object"&&xr(Po[y]);return Object.assign(t,Po),t},Ln=$r({});Ln.newInstance=()=>$r({});var Gu=Ln;Ln.HighlightJS=Ln,Ln.default=Ln;const Ni=Qd(Gu);function Si(t){const o=t.regex,n={},i={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:o.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},i]});const a={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},c=t.inherit(t.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),s={begin:/<<-?\s*(?=\w+)/,starts:{contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},u={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,n,a]};a.contains.push(u);const d={match:/\\"/},g={className:"string",begin:/'/,end:/'/},h={match:/\\'/},N={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,n]},C=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],$=t.SHEBANG({binary:`(${C.join("|")})`,relevance:10}),R={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},F=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],B=["true","false"],_={match:/(\/[a-z._-]+)+/},x=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],k=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],m=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],P=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:F,literal:B,built_in:[...x,...k,"set","shopt",...m,...P]},contains:[$,t.SHEBANG(),R,N,c,s,_,u,d,g,h,n]}}const ju=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_-]*/}}),Ku=["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"],Yu=["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"],qu=[...Ku,...Yu],Xu=["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(),Zu=["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(),Ju=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Qu=["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 ef(t){const o=t.regex,n=ju(t),i={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},a="and or not only",c=/@-?\w[\w]*(-\w+)*/,s="[a-zA-Z-][a-zA-Z0-9_-]*",u=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,i,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+s,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+Zu.join("|")+")"},{begin:":(:)?("+Ju.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Qu.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...u,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...u,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:o.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:c},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:a,attribute:Xu.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...u,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+qu.join("|")+")\\b"}]}}function Pr(t){const c={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:c,illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"string",variants:[t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[t.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:c,illegal:/["']/}]}]}}var Dn="[0-9](_*[0-9])*",Uo=`\\.(${Dn})`,Ho="[0-9a-fA-F](_*[0-9a-fA-F])*",Fr={className:"number",variants:[{begin:`(\\b(${Dn})((${Uo})|\\.)?|(${Uo}))[eE][+-]?(${Dn})[fFdD]?\\b`},{begin:`\\b(${Dn})((${Uo})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Uo})[fFdD]?\\b`},{begin:`\\b(${Dn})[fFdD]\\b`},{begin:`\\b0[xX]((${Ho})\\.?|(${Ho})?\\.(${Ho}))[pP][+-]?(${Dn})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Ho})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Ur(t,o,n){return n===-1?"":t.replace(o,i=>Ur(t,o,n-1))}function tf(t){const o=t.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",i=n+Ur("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),d={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},g={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},h={className:"params",begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[t.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:d,illegal:/<\/|#/,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[t.BACKSLASH_ESCAPE]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[o.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[h,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+i+"\\s+)",t.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:d,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[g,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,Fr,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},Fr,g]}}const Hr="[A-Za-z$_][0-9A-Za-z$_]*",nf=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],of=["true","false","null","undefined","NaN","Infinity"],Wr=["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"],Gr=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],jr=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],rf=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],lf=[].concat(jr,Wr,Gr);function Kr(t){const o=t.regex,n=(U,{after:j})=>{const ae="</"+U[0].slice(1);return U.input.indexOf(ae,j)!==-1},i=Hr,a={begin:"<>",end:"</>"},c=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(U,j)=>{const ae=U[0].length+U.index,Me=U.input[ae];if(Me==="<"||Me===","){j.ignoreMatch();return}Me===">"&&(n(U,{after:ae})||j.ignoreMatch());let ze;const De=U.input.substring(ae);if(ze=De.match(/^\s*=/)){j.ignoreMatch();return}if((ze=De.match(/^\s+extends\s+/))&&ze.index===0){j.ignoreMatch();return}}},u={$pattern:Hr,keyword:nf,literal:of,built_in:lf,"variable.language":rf},d="[0-9](_?[0-9])*",g=`\\.(${d})`,h="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",N={className:"number",variants:[{begin:`(\\b(${h})((${g})|\\.)?|(${g}))[eE][+-]?(${d})\\b`},{begin:`\\b(${h})\\b((${g})\\b|\\.)?|(${g})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},C={className:"subst",begin:"\\$\\{",end:"\\}",keywords:u,contains:[]},$={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"xml"}},R={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"css"}},F={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"graphql"}},B={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,C]},x={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},k=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,$,R,F,B,{match:/\$\d+/},N];C.contains=k.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(k)});const m=[].concat(x,C.contains),P=m.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(m)}]),L={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:P},S={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"}}]},K={relevance:0,match:o.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Wr,...Gr]}},J={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},de={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[L],illegal:/%/},ee={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Y(U){return o.concat("(?!",U.join("|"),")")}const oe={match:o.concat(/\b/,Y([...jr,"super","import"].map(U=>`${U}\\s*\\(`)),i,o.lookahead(/\s*\(/)),className:"title.function",relevance:0},ie={begin:o.concat(/\./,o.lookahead(o.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ye={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},L]},y="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",V={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,o.lookahead(y)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[L]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:P,CLASS_REFERENCE:K},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),J,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,$,R,F,B,x,{match:/\$\d+/},N,K,{scope:"attr",match:i+o.lookahead(":"),relevance:0},V,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[x,t.REGEXP_MODE,{className:"function",begin:y,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:P}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:a.begin,end:a.end},{match:c},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},de,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[L,t.inherit(t.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},ie,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[L]},oe,ee,S,ye,{match:/\$[(.]/}]}}function af(t){const o={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},i=["true","false","null"],a={scope:"literal",beginKeywords:i.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:i},contains:[o,n,t.QUOTE_STRING_MODE,a,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function Yr(t){const o=t.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},i={begin:"^[-\\*]{3,}",end:"$"},a={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},c={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},s={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},u=/[A-Za-z][A-Za-z0-9+.-]*/,d={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:o.concat(/\[.+?\]\(/,u,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},g={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},h={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},N=t.inherit(g,{contains:[]}),C=t.inherit(h,{contains:[]});g.contains.push(C),h.contains.push(N);let $=[n,d];return[g,h,N,C].forEach(_=>{_.contains=_.contains.concat($)}),$=$.concat(g,h),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:$},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:$}]}]},n,c,g,h,{className:"quote",begin:"^>\\s+",contains:$,end:"$"},a,i,d,s,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function qr(t){const o=t.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),i=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],u={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:i,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},d={className:"meta",begin:/^(>>>|\.\.\.) /},g={className:"subst",begin:/\{/,end:/\}/,keywords:u,illegal:/#/},h={begin:/\{\{/,relevance:0},N={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,d],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,d],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,d,h,g]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,d,h,g]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[t.BACKSLASH_ESCAPE,h,g]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,h,g]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},C="[0-9](_?[0-9])*",$=`(\\b(${C}))?\\.(${C})|\\b(${C})\\.`,R=`\\b|${i.join("|")}`,F={className:"number",relevance:0,variants:[{begin:`(\\b(${C})|(${$}))[eE][+-]?(${C})[jJ]?(?=${R})`},{begin:`(${$})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${R})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${R})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${R})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${R})`},{begin:`\\b(${C})[jJ](?=${R})`}]},B={className:"comment",begin:o.lookahead(/# type:/),end:/$/,keywords:u,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},_={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:["self",d,F,N,t.HASH_COMMENT_MODE]}]};return g.contains=[N,F,d],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:u,illegal:/(<\/|\?)|=>/,contains:[d,F,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},N,B,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[_]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[F,_,N]}]}}function Xr(t){const o=t.regex,n=/(r#)?/,i=o.concat(n,t.UNDERSCORE_IDENT_RE),a=o.concat(n,t.IDENT_RE),c={className:"title.function.invoke",relevance:0,begin:o.concat(/\b/,/(?!let|for|while|if|else|match\b)/,a,o.lookahead(/\s*\(/))},s="([ui](8|16|32|64|128|size)|f(32|64))?",u=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],d=["true","false","Some","None","Ok","Err"],g=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],h=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:t.IDENT_RE+"!?",type:h,keyword:u,literal:d,built_in:g},illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.COMMENT("/\\*","\\*/",{contains:["self"]}),t.inherit(t.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+s},{begin:"\\b0o([0-7_]+)"+s},{begin:"\\b0x([A-Fa-f0-9_]+)"+s},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+s}],relevance:0},{begin:[/fn/,/\s+/,i],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,i],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,i,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,i],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,i],className:{1:"keyword",3:"title.class"}},{begin:t.IDENT_RE+"::",keywords:{keyword:"Self",built_in:g,type:h}},{className:"punctuation",begin:"->"},c]}}function sf(t){const o=t.regex,n=t.COMMENT("--","$"),i={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},a={begin:/"/,end:/"/,contains:[{match:/""/}]},c=["true","false","unknown"],s=["double precision","large object","with timezone","without timezone"],u=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],d=["add","asc","collation","desc","final","first","last","view"],g=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],h=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],N=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],C=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],$=h,R=[...g,...d].filter(P=>!h.includes(P)),F={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},B={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},_={match:o.concat(/\b/,o.either(...$),/\s*\(/),relevance:0,keywords:{built_in:$}};function x(P){return o.concat(/\b/,o.either(...P.map(L=>L.replace(/\s+/,"\\s+"))),/\b/)}const k={scope:"keyword",match:x(C),relevance:0};function m(P,{exceptions:L,when:S}={}){const K=S;return L=L||[],P.map(J=>J.match(/\|\d+$/)||L.includes(J)?J:K(J)?`${J}|0`:J)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:m(R,{when:P=>P.length<3}),literal:c,type:u,built_in:N},contains:[{scope:"type",match:x(s)},k,_,F,i,a,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,n,B]}}const Wo="[A-Za-z$_][0-9A-Za-z$_]*",Zr=["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"],Jr=["true","false","null","undefined","NaN","Infinity"],Qr=["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"],el=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],tl=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],nl=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],ol=[].concat(tl,Qr,el);function cf(t){const o=t.regex,n=(U,{after:j})=>{const ae="</"+U[0].slice(1);return U.input.indexOf(ae,j)!==-1},i=Wo,a={begin:"<>",end:"</>"},c=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(U,j)=>{const ae=U[0].length+U.index,Me=U.input[ae];if(Me==="<"||Me===","){j.ignoreMatch();return}Me===">"&&(n(U,{after:ae})||j.ignoreMatch());let ze;const De=U.input.substring(ae);if(ze=De.match(/^\s*=/)){j.ignoreMatch();return}if((ze=De.match(/^\s+extends\s+/))&&ze.index===0){j.ignoreMatch();return}}},u={$pattern:Wo,keyword:Zr,literal:Jr,built_in:ol,"variable.language":nl},d="[0-9](_?[0-9])*",g=`\\.(${d})`,h="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",N={className:"number",variants:[{begin:`(\\b(${h})((${g})|\\.)?|(${g}))[eE][+-]?(${d})\\b`},{begin:`\\b(${h})\\b((${g})\\b|\\.)?|(${g})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},C={className:"subst",begin:"\\$\\{",end:"\\}",keywords:u,contains:[]},$={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"xml"}},R={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"css"}},F={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"graphql"}},B={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,C]},x={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},k=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,$,R,F,B,{match:/\$\d+/},N];C.contains=k.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(k)});const m=[].concat(x,C.contains),P=m.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(m)}]),L={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:P},S={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"}}]},K={relevance:0,match:o.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Qr,...el]}},J={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},de={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[L],illegal:/%/},ee={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Y(U){return o.concat("(?!",U.join("|"),")")}const oe={match:o.concat(/\b/,Y([...tl,"super","import"].map(U=>`${U}\\s*\\(`)),i,o.lookahead(/\s*\(/)),className:"title.function",relevance:0},ie={begin:o.concat(/\./,o.lookahead(o.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ye={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},L]},y="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",V={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,o.lookahead(y)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[L]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:P,CLASS_REFERENCE:K},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),J,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,$,R,F,B,x,{match:/\$\d+/},N,K,{scope:"attr",match:i+o.lookahead(":"),relevance:0},V,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[x,t.REGEXP_MODE,{className:"function",begin:y,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:P}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:a.begin,end:a.end},{match:c},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},de,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[L,t.inherit(t.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},ie,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[L]},oe,ee,S,ye,{match:/\$[(.]/}]}}function il(t){const o=t.regex,n=cf(t),i=Wo,a=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],c={begin:[/namespace/,/\s+/,t.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},s={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:a},contains:[n.exports.CLASS_REFERENCE]},u={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},d=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],g={$pattern:Wo,keyword:Zr.concat(d),literal:Jr,built_in:ol.concat(a),"variable.language":nl},h={className:"meta",begin:"@"+i},N=(F,B,_)=>{const x=F.contains.findIndex(k=>k.label===B);if(x===-1)throw new Error("can not find mode to replace");F.contains.splice(x,1,_)};Object.assign(n.keywords,g),n.exports.PARAMS_CONTAINS.push(h);const C=n.contains.find(F=>F.scope==="attr"),$=Object.assign({},C,{match:o.concat(i,o.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,C,$]),n.contains=n.contains.concat([h,c,s,$]),N(n,"shebang",t.SHEBANG()),N(n,"use_strict",u);const R=n.contains.find(F=>F.label==="func.def");return R.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function rl(t){const o=t.regex,n=o.concat(/[\p{L}_]/u,o.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),i=/[\p{L}0-9._:-]+/u,a={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},c={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},s=t.inherit(c,{begin:/\(/,end:/\)/}),u=t.inherit(t.APOS_STRING_MODE,{className:"string"}),d=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),g={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:i,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[a]},{begin:/'/,end:/'/,contains:[a]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[c,d,u,s,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[c,s,d,u]}]}]},t.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},a,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[d]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[g],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[g],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:o.concat(/</,o.lookahead(o.concat(n,o.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:g}]},{className:"tag",begin:o.concat(/<\//,o.lookahead(o.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function ll(t){const o="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",i={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},a={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},c={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},s={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,a]},u=t.inherit(s,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),C={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},$={end:",",endsWithParent:!0,excludeEnd:!0,keywords:o,relevance:0},R={begin:/\{/,end:/\}/,contains:[$],illegal:"\\n",relevance:0},F={begin:"\\[",end:"\\]",contains:[$],illegal:"\\n",relevance:0},B=[i,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:o,keywords:{literal:o}},C,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},R,F,c,s],_=[...B];return _.pop(),_.push(u),$.contains=_,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:B}}const Ci={bash:Si,sh:Si,shell:Si,css:ef,go:Pr,golang:Pr,java:tf,javascript:Kr,js:Kr,json:af,markdown:Yr,md:Yr,python:qr,py:qr,rust:Xr,rs:Xr,sql:sf,typescript:il,ts:il,xml:rl,html:rl,yaml:ll,yml:ll};for(const[t,o]of Object.entries(Ci))Ni.registerLanguage(t,o);function Go(t){const o=t.split(`
|
|
55
|
+
`,Do=e.defineComponent({__name:"MarkdownPanel",props:{data:{}},emits:["import"],setup(t,{emit:o}){const n=t,i=o,a=e.ref(On(n.data)),c=e.ref(null),s=e.ref(null),u=e.computed(()=>{try{const I=zn(a.value||"");return c.value=null,I}catch(I){return c.value=I.message,{id:"preview_fallback",text:a.value||"(空)",children:[]}}}),d=e.computed(()=>Ot(u.value));let g=null;e.watch(a,()=>{g&&clearTimeout(g),g=setTimeout(()=>{var I;return(I=s.value)==null?void 0:I.resetView()},250)});function h(){try{const I=zn(a.value||"");c.value=null,i("import",I)}catch(I){c.value=I.message}}function w(){a.value=On(n.data),c.value=null,e.nextTick(()=>{var I;return(I=s.value)==null?void 0:I.resetView()})}function C(){a.value="",c.value=null,e.nextTick(()=>{var I;return(I=s.value)==null?void 0:I.resetView()})}function P(){const I=document.createElement("input");I.type="file",I.accept=".md,text/markdown,text/plain",I.onchange=()=>{var k;const A=(k=I.files)==null?void 0:k[0];if(!A)return;const x=new FileReader;x.onload=()=>{typeof x.result=="string"&&(a.value=x.result,c.value=null,e.nextTick(()=>{var m;return(m=s.value)==null?void 0:m.resetView()}))},x.readAsText(A)},I.click()}function R(){const I=new Blob([a.value],{type:"text/markdown;charset=utf-8"}),A=URL.createObjectURL(I),x=document.createElement("a");x.href=A;const k=(n.data.text||"mindmap").trim()||"mindmap";x.download=`${k}.md`,x.click(),URL.revokeObjectURL(A)}function U(){a.value=Ic,c.value=null,e.nextTick(()=>{var I;return(I=s.value)==null?void 0:I.resetView()})}return(I,A)=>(e.openBlock(),e.createElementBlock("div",Tc,[e.createElementVNode("div",{class:"zm-md-toolbar"},[e.createElementVNode("button",{class:"zm-md-btn",title:"从 .md 文件加载",onClick:P},[...A[1]||(A[1]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M12 4 V15"}),e.createElementVNode("polyline",{points:"7 9 12 4 17 9"}),e.createElementVNode("path",{d:"M4 19 H20"})],-1),e.createElementVNode("span",null,"加载 .md",-1)])]),e.createElementVNode("button",{class:"zm-md-btn",title:"把当前导图导出为 .md",onClick:R},[...A[2]||(A[2]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M12 15 V4"}),e.createElementVNode("polyline",{points:"7 9 12 4 17 9"}),e.createElementVNode("path",{d:"M4 19 H20"})],-1),e.createElementVNode("span",null,"导出 .md",-1)])]),A[3]||(A[3]=e.createElementVNode("span",{class:"zm-md-spacer"},null,-1)),e.createElementVNode("button",{class:"zm-md-btn",title:"用示例内容填充",onClick:U},"示例"),e.createElementVNode("button",{class:"zm-md-btn",title:"覆盖为当前导图",onClick:w},"同步"),e.createElementVNode("button",{class:"zm-md-btn",title:"清空",onClick:C},"清空")]),c.value?(e.openBlock(),e.createElementBlock("div",Cc,e.toDisplayString(c.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Mc,[e.createElementVNode("div",Ac,[A[4]||(A[4]=e.createElementVNode("div",{class:"zm-md-pane-header"},[e.createElementVNode("span",null,"Markdown"),e.createElementVNode("span",{class:"zm-md-hint"},"# 根 · ## 一级 · ### 二级 …")],-1)),e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":A[0]||(A[0]=x=>a.value=x),class:"zm-md-textarea",spellcheck:"false",placeholder:"# 标题…"},null,512),[[e.vModelText,a.value]])]),e.createElementVNode("div",_c,[A[5]||(A[5]=e.createElementVNode("div",{class:"zm-md-pane-header"},[e.createElementVNode("span",null,"导图预览"),e.createElementVNode("span",{class:"zm-md-hint"},"只读")],-1)),e.createElementVNode("div",Rc,[e.createVNode(Qo,{ref_key:"previewRef",ref:s,data:d.value,readonly:"","preview-mode":""},null,8,["data"])])])]),e.createElementVNode("div",Bc,[e.createElementVNode("button",{class:"zm-md-btn is-primary",disabled:!a.value.trim(),onClick:h},"应用到导图",8,vc)])]))}}),zc={class:"zm-settings-panel"},Oc={class:"zm-settings-section"},Lc={class:"zm-settings-field"},Dc={class:"zm-settings-control"},$c={class:"zm-color-input-wrap"},Vc=["value"],Pc={class:"zm-color-input-text"},Fc={class:"zm-swatch-row zm-swatch-row--compact"},Uc=["title","onClick"],Hc={class:"zm-settings-field"},Wc=["value"],Gc={class:"zm-slider"},jc=["value"],Kc={class:"zm-settings-field"},Yc=["value"],qc={class:"zm-slider"},Xc=["value"],Zc={class:"zm-settings-field"},Jc={class:"zm-line-style-group"},Qc=["title","onClick"],ed=["viewBox"],td={key:0,d:"M 0 12 Q 14 2, 28 12",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},nd={key:1,d:"M 0 10 L 12 10 Q 16 10 16 6 L 16 4 L 28 4",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round","stroke-linejoin":"round"},od={key:2,d:"M 0 10 L 16 10 L 16 4 L 28 4",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round","stroke-linejoin":"round"},id={key:3,d:"M 0 12 C 8 0, 20 0, 28 12",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},rd={key:4,x1:"0",y1:"12",x2:"28",y2:"12",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},ld={class:"zm-line-style-label"},ad={class:"zm-settings-field"},sd={class:"zm-line-style-group"},cd=["title","onClick"],dd=["viewBox"],ud={key:0,d:"M 0 12 Q 14 2, 28 12",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},fd={key:1,d:"M 0 10 L 12 10 Q 16 10 16 6 L 16 4 L 28 4",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round","stroke-linejoin":"round"},md={key:2,d:"M 0 10 L 16 10 L 16 4 L 28 4",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round","stroke-linejoin":"round"},pd={key:3,d:"M 0 12 C 8 0, 20 0, 28 12",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},gd={key:4,x1:"0",y1:"12",x2:"28",y2:"12",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},hd={class:"zm-line-style-label"},bd={class:"zm-settings-field"},kd={class:"zm-line-style-group"},yd=["title","onClick"],Ed={viewBox:"0 0 28 18",width:"28",height:"18",preserveAspectRatio:"none"},xd={key:0,d:"M 8 9 L 0 9 M 20 9 L 28 9",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},wd={key:1,d:"M 14 9 L 0 9 M 14 9 L 28 9",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},Nd={key:2,d:"M 8 7 L 0 4 M 8 9 L 0 9 M 8 11 L 0 14 M 20 7 L 28 4 M 20 9 L 28 9 M 20 11 L 28 14",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},Sd={class:"zm-line-style-label"},Td={class:"zm-settings-field"},Cd={key:0,class:"zm-palette-dropdown"},Md={class:"zm-settings-field"},Ad=["value"],_d={label:"内置配色"},Rd=["value"],Bd={key:0,label:"自定义"},vd=["value"],Id={key:0,class:"zm-palette-preview-bar"},zd={key:1,class:"zm-palette-custom-editor"},Od=["value"],Ld={class:"zm-palette-custom-actions"},Dd={class:"zm-settings-field"},$d={key:1,class:"zm-settings-field"},Vd={class:"zm-settings-label"},Pd={class:"zm-settings-sub"},Fd=["value"],Ud={key:2,class:"zm-slider"},Hd=["value"],Wd={class:"zm-settings-field"},Gd={class:"zm-settings-preview"},jd={viewBox:"0 0 200 70",width:"100%",height:"70",preserveAspectRatio:"none"},Kd=["x1","y1","x2","y2","stroke","stroke-width"],Yd={key:0,class:"zm-settings-section"},qd={class:"zm-settings-section-title"},Xd={key:0,class:"zm-settings-section-sub"},Zd={class:"zm-settings-field"},Jd={class:"zm-settings-value-tag"},Qd={class:"zm-swatch-row"},eu=["title","onClick"],tu={class:"zm-swatch zm-swatch--custom",title:"自定义颜色"},nu=["value"],ou={class:"zm-settings-field"},iu={class:"zm-settings-value-tag"},ru={class:"zm-swatch-row"},lu=["title","onClick"],au={class:"zm-swatch zm-swatch--custom",title:"自定义颜色"},su=["value"],cu={class:"zm-settings-field"},du=["value"],uu=["value"],fu={class:"zm-settings-field"},mu=["value"],pu={class:"zm-slider"},gu=["value"],hu={class:"zm-settings-section zm-settings-section--actions"},$o=((t,o)=>{const n=t.__vccOpts||t;for(const[i,a]of o)n[i]=a;return n})(e.defineComponent({__name:"SettingsPanel",props:{settings:{},hasSelection:{type:Boolean},selectedNodeText:{},nodeStyle:{}},emits:["update:settings","update:nodeStyle","reset"],setup(t,{emit:o}){const n=t,i=o;function a(K,S){i("update:settings",{[K]:S})}const c=[{value:"arc",label:"圆弧",viewBox:"0 0 28 14"},{value:"rounded-elbow",label:"圆角折线",viewBox:"0 0 28 14"},{value:"elbow",label:"折线",viewBox:"0 0 28 14"},{value:"straight",label:"直线",viewBox:"0 0 28 14"},{value:"curve",label:"S曲线",viewBox:"0 0 28 14"}],s=c,u=[{value:"edge",label:"左右中点"},{value:"center",label:"节点正中心"},{value:"proportional",label:"按比例计算"}],d=[{value:100,label:"100"},{value:200,label:"200"},{value:300,label:"300"},{value:400,label:"400 (常规)"},{value:500,label:"500"},{value:600,label:"600 (半粗)"},{value:700,label:"700 (粗体)"},{value:800,label:"800"},{value:900,label:"900"}];function g(K){i("update:nodeStyle",K)}const h=e.computed(()=>[...ln,...n.settings.customPalettes]),w=e.reactive({});function C(K){return w[K.id]===void 0&&(w[K.id]=K.colors.join(`
|
|
56
|
+
`)),w[K.id]}function P(K){const S=w[K.id]??"",ne=Wa(S);if(ne.length===0){w[K.id]=K.colors.join(`
|
|
57
|
+
`);return}const se=n.settings.customPalettes.map(re=>re.id===K.id?{...re,colors:ne}:re);i("update:settings",{customPalettes:se})}function R(){const K=h.value.find(Z=>Z.id===n.settings.branchPaletteId),S=K?[...K.colors]:[...ln[0].colors],ne="custom-";let se=ne+(n.settings.customPalettes.length+1);for(;ln.some(Z=>Z.id===se)||n.settings.customPalettes.some(Z=>Z.id===se);)se=ne+Math.random().toString(36).slice(2,7);const re={id:se,name:`我的配色 ${n.settings.customPalettes.length+1}`,colors:S};i("update:settings",{customPalettes:[...n.settings.customPalettes,re],branchPaletteId:se}),w[se]=S.join(`
|
|
58
|
+
`)}function U(K){const S=n.settings.customPalettes.filter(se=>se.id!==K.id),ne=n.settings.branchPaletteId===K.id?"default":n.settings.branchPaletteId;i("update:settings",{customPalettes:S,...ne!==n.settings.branchPaletteId?{branchPaletteId:ne}:{}}),delete w[K.id]}const I=["#f87171","#fb923c","#fbbf24","#a3e635","#34d399","#22d3ee","#818cf8","#c084fc","#1e2937","#f8fafc","#94a3b8"],A=["#f8fafc","#ffffff","#e2e8f0","#1e2937","#0f172a","#fef3c7","#dbeafe","#dcfce7","#fce7f3","#f1f5f9"],x=[0,1,2,3],k=["#f87171","#fb923c","#34d399","#818cf8"];function m(K,S,ne,se){if(S<=1)return ne;const re=K/(S-1);return ne+(se-ne)*re}function F(K,S,ne,se){const re=S*Math.pow(se,K);return Math.max(ne,re)}const W=e.computed(()=>{const K=n.settings.lineWidthStart,S=n.settings.lineWidthEnd,ne=n.settings.taperedEdge,se=x.length,re=8,Z=192,ce=h.value.find(me=>me.id===n.settings.branchPaletteId),ie=ce&&ce.colors.length?ce.colors:k;return x.map((me,v)=>{const E=10+v*60/(se-1);return{x1:re,y1:E,x2:Z,y2:E,w:ne?F(me,K,S,n.settings.lineWidthTaper):m(me,se,K,S),color:n.settings.rainbowBranch?ie[v%ie.length]:"#94a3b8"}})});return(K,S)=>{var ne,se,re,Z,ce,ie,me,v;return e.openBlock(),e.createElementBlock("div",zc,[e.createElementVNode("section",Oc,[S[42]||(S[42]=e.createElementVNode("h4",{class:"zm-settings-section-title"},"画布",-1)),e.createElementVNode("div",Lc,[S[23]||(S[23]=e.createElementVNode("span",{class:"zm-settings-label"},"画布背景色",-1)),e.createElementVNode("div",Dc,[e.createElementVNode("label",$c,[e.createElementVNode("input",{type:"color",class:"zm-color-input",value:t.settings.canvasBg||"#f8fafc",onInput:S[0]||(S[0]=E=>a("canvasBg",E.target.value))},null,40,Vc),e.createElementVNode("span",Pc,e.toDisplayString(t.settings.canvasBg||"默认"),1)])])]),e.createElementVNode("div",Fc,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(A,E=>e.createElementVNode("button",{key:"cbg-"+E,class:e.normalizeClass(["zm-swatch",{"is-active":(t.settings.canvasBg||"#f8fafc")===E}]),style:e.normalizeStyle({background:E}),title:E,onClick:$=>a("canvasBg",E)},null,14,Uc)),64)),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"恢复默认",onClick:S[1]||(S[1]=E=>a("canvasBg",void 0))},"∅")]),S[43]||(S[43]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",Hc,[S[24]||(S[24]=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:S[2]||(S[2]=E=>a("lineWidthStart",parseFloat(E.target.value)||0))},null,40,Wc)]),e.createElementVNode("div",Gc,[S[25]||(S[25]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"0.4",max:"20",step:"0.2",value:t.settings.lineWidthStart,onInput:S[3]||(S[3]=E=>a("lineWidthStart",parseFloat(E.target.value)))},null,40,jc)]),e.createElementVNode("div",Kc,[S[26]||(S[26]=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:S[4]||(S[4]=E=>a("lineWidthEnd",parseFloat(E.target.value)||0))},null,40,Yc)]),e.createElementVNode("div",qc,[S[27]||(S[27]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"0.2",max:"6",step:"0.1",value:t.settings.lineWidthEnd,onInput:S[5]||(S[5]=E=>a("lineWidthEnd",parseFloat(E.target.value)))},null,40,Xc)]),S[44]||(S[44]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",Zc,[S[28]||(S[28]=e.createElementVNode("span",{class:"zm-settings-label"},"其他节点线条",-1)),e.createElementVNode("div",Jc,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(c,E=>e.createElementVNode("button",{key:E.value,class:e.normalizeClass(["zm-line-style-btn",{"is-on":t.settings.lineStyle===E.value}]),title:E.label,onClick:$=>a("lineStyle",E.value)},[(e.openBlock(),e.createElementBlock("svg",{viewBox:E.viewBox,width:"28",height:"14",preserveAspectRatio:"none"},[E.value==="arc"?(e.openBlock(),e.createElementBlock("path",td)):E.value==="rounded-elbow"?(e.openBlock(),e.createElementBlock("path",nd)):E.value==="elbow"?(e.openBlock(),e.createElementBlock("path",od)):E.value==="curve"?(e.openBlock(),e.createElementBlock("path",id)):(e.openBlock(),e.createElementBlock("line",rd))],8,ed)),e.createElementVNode("span",ld,e.toDisplayString(E.label),1)],10,Qc)),64))])]),e.createElementVNode("div",ad,[S[29]||(S[29]=e.createElementVNode("span",{class:"zm-settings-label"},"根节点线条",-1)),e.createElementVNode("div",sd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(s),E=>(e.openBlock(),e.createElementBlock("button",{key:E.value,class:e.normalizeClass(["zm-line-style-btn",{"is-on":t.settings.rootLineStyle===E.value}]),title:E.label,onClick:$=>a("rootLineStyle",E.value)},[(e.openBlock(),e.createElementBlock("svg",{viewBox:E.viewBox,width:"28",height:"14",preserveAspectRatio:"none"},[E.value==="arc"?(e.openBlock(),e.createElementBlock("path",ud)):E.value==="rounded-elbow"?(e.openBlock(),e.createElementBlock("path",fd)):E.value==="elbow"?(e.openBlock(),e.createElementBlock("path",md)):E.value==="curve"?(e.openBlock(),e.createElementBlock("path",pd)):(e.openBlock(),e.createElementBlock("line",gd))],8,dd)),e.createElementVNode("span",hd,e.toDisplayString(E.label),1)],10,cd))),128))])]),e.createElementVNode("div",bd,[S[31]||(S[31]=e.createElementVNode("span",{class:"zm-settings-label"},"线条起点",-1)),e.createElementVNode("div",kd,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(u,E=>e.createElementVNode("button",{key:E.value,class:e.normalizeClass(["zm-line-style-btn",{"is-on":t.settings.lineOrigin===E.value}]),title:E.label,onClick:$=>a("lineOrigin",E.value)},[(e.openBlock(),e.createElementBlock("svg",Ed,[S[30]||(S[30]=e.createElementVNode("rect",{x:"8",y:"6",width:"12",height:"6",rx:"2",fill:"none",stroke:"currentColor","stroke-width":"1.2",opacity:"0.5"},null,-1)),E.value==="edge"?(e.openBlock(),e.createElementBlock("path",xd)):E.value==="center"?(e.openBlock(),e.createElementBlock("path",wd)):(e.openBlock(),e.createElementBlock("path",Nd))])),e.createElementVNode("span",Sd,e.toDisplayString(E.label),1)],10,yd)),64))])]),e.createElementVNode("div",Td,[S[33]||(S[33]=e.createElementVNode("span",{class:"zm-settings-label"},"一级分支彩虹色",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.rainbowBranch}]),onClick:S[6]||(S[6]=E=>a("rainbowBranch",!t.settings.rainbowBranch))},[...S[32]||(S[32]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),t.settings.rainbowBranch?(e.openBlock(),e.createElementBlock("div",Cd,[e.createElementVNode("div",Md,[S[34]||(S[34]=e.createElementVNode("span",{class:"zm-settings-label"},"配色方案",-1)),e.createElementVNode("select",{class:"zm-select",value:t.settings.branchPaletteId,onChange:S[7]||(S[7]=E=>a("branchPaletteId",E.target.value))},[e.createElementVNode("optgroup",_d,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(ln),E=>(e.openBlock(),e.createElementBlock("option",{key:E.id,value:E.id},e.toDisplayString(E.name),9,Rd))),128))]),t.settings.customPalettes.length?(e.openBlock(),e.createElementBlock("optgroup",Bd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.settings.customPalettes,E=>(e.openBlock(),e.createElementBlock("option",{key:E.id,value:E.id},e.toDisplayString(E.name),9,vd))),128))])):e.createCommentVNode("",!0)],40,Ad)]),h.value.find(E=>E.id===t.settings.branchPaletteId)?(e.openBlock(),e.createElementBlock("div",Id,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((ne=h.value.find(E=>E.id===t.settings.branchPaletteId))==null?void 0:ne.colors,(E,$)=>(e.openBlock(),e.createElementBlock("span",{key:$,class:"zm-palette-preview-swatch",style:e.normalizeStyle({background:E})},null,4))),128))])):e.createCommentVNode("",!0),t.settings.customPalettes.find(E=>E.id===t.settings.branchPaletteId)?(e.openBlock(),e.createElementBlock("div",zd,[e.createElementVNode("textarea",{class:"zm-palette-textarea",rows:"3",spellcheck:"false",placeholder:"一行一个 hex,例如 #f87171",value:C(t.settings.customPalettes.find(E=>E.id===t.settings.branchPaletteId)),onInput:S[8]||(S[8]=E=>w[t.settings.customPalettes.find($=>$.id===t.settings.branchPaletteId).id]=E.target.value)},null,40,Od),e.createElementVNode("div",Ld,[e.createElementVNode("button",{type:"button",class:"zm-data-btn is-primary",onClick:S[9]||(S[9]=E=>P(t.settings.customPalettes.find($=>$.id===t.settings.branchPaletteId)))},"保存"),e.createElementVNode("button",{type:"button",class:"zm-data-btn",onClick:S[10]||(S[10]=E=>U(t.settings.customPalettes.find($=>$.id===t.settings.branchPaletteId)))},"删除")])])):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"zm-palette-add",onClick:R},"+ 新建配色")])):e.createCommentVNode("",!0),S[45]||(S[45]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",Dd,[S[36]||(S[36]=e.createElementVNode("span",{class:"zm-settings-label"},"每条连线独立渐变",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.taperedEdge}]),onClick:S[11]||(S[11]=E=>a("taperedEdge",!t.settings.taperedEdge))},[...S[35]||(S[35]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),t.settings.taperedEdge?(e.openBlock(),e.createElementBlock("div",$d,[e.createElementVNode("span",Vd,[S[37]||(S[37]=e.createTextVNode("层级衰减 ",-1)),e.createElementVNode("span",Pd,e.toDisplayString(Math.round(t.settings.lineWidthTaper*100))+"%",1)]),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"0.05",min:"0.3",max:"1",value:t.settings.lineWidthTaper,onChange:S[12]||(S[12]=E=>a("lineWidthTaper",parseFloat(E.target.value)||.67))},null,40,Fd)])):e.createCommentVNode("",!0),t.settings.taperedEdge?(e.openBlock(),e.createElementBlock("div",Ud,[S[38]||(S[38]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"0.3",max:"1",step:"0.01",value:t.settings.lineWidthTaper,onInput:S[13]||(S[13]=E=>a("lineWidthTaper",parseFloat(E.target.value)))},null,40,Hd)])):e.createCommentVNode("",!0),e.createElementVNode("div",Wd,[S[40]||(S[40]=e.createElementVNode("span",{class:"zm-settings-label"},"显示节点序号",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.showOrderBadge}]),onClick:S[14]||(S[14]=E=>a("showOrderBadge",!t.settings.showOrderBadge))},[...S[39]||(S[39]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),e.createElementVNode("div",Gd,[(e.openBlock(),e.createElementBlock("svg",jd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(W.value,(E,$)=>(e.openBlock(),e.createElementBlock("line",{key:$,x1:E.x1,y1:E.y1,x2:E.x2,y2:E.y2,stroke:t.settings.rainbowBranch?E.color:"#94a3b8","stroke-width":E.w,"stroke-linecap":"butt"},null,8,Kd))),128))])),S[41]||(S[41]=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",Yd,[e.createElementVNode("h4",qd,[S[46]||(S[46]=e.createTextVNode(" 节点 ",-1)),t.selectedNodeText?(e.openBlock(),e.createElementBlock("span",Xd,'"'+e.toDisplayString(t.selectedNodeText)+'"',1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Zd,[S[47]||(S[47]=e.createElementVNode("span",{class:"zm-settings-label"},"背景颜色",-1)),e.createElementVNode("span",Jd,e.toDisplayString(((se=t.nodeStyle)==null?void 0:se.bg)||"默认"),1)]),e.createElementVNode("div",Qd,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(I,E=>{var $;return e.createElementVNode("button",{key:"bg-"+E,class:e.normalizeClass(["zm-swatch",{"is-active":(($=t.nodeStyle)==null?void 0:$.bg)===E}]),style:e.normalizeStyle({background:E}),title:E,onClick:X=>g({bg:E})},null,14,eu)}),64)),e.createElementVNode("label",tu,[e.createElementVNode("input",{type:"color",value:((re=t.nodeStyle)==null?void 0:re.bg)||"#ffffff",onInput:S[15]||(S[15]=E=>g({bg:E.target.value}))},null,40,nu)]),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"清除",onClick:S[16]||(S[16]=E=>g({bg:void 0}))},"∅")]),e.createElementVNode("div",ou,[S[48]||(S[48]=e.createElementVNode("span",{class:"zm-settings-label"},"文字颜色",-1)),e.createElementVNode("span",iu,e.toDisplayString(((Z=t.nodeStyle)==null?void 0:Z.textColor)||"默认"),1)]),e.createElementVNode("div",ru,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(I,E=>{var $;return e.createElementVNode("button",{key:"fg-"+E,class:e.normalizeClass(["zm-swatch",{"is-active":(($=t.nodeStyle)==null?void 0:$.textColor)===E}]),style:e.normalizeStyle({background:E}),title:E,onClick:X=>g({textColor:E})},null,14,lu)}),64)),e.createElementVNode("label",au,[e.createElementVNode("input",{type:"color",value:((ce=t.nodeStyle)==null?void 0:ce.textColor)||"#1e2937",onInput:S[17]||(S[17]=E=>g({textColor:E.target.value}))},null,40,su)]),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"清除",onClick:S[18]||(S[18]=E=>g({textColor:void 0}))},"∅")]),S[52]||(S[52]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",cu,[S[49]||(S[49]=e.createElementVNode("span",{class:"zm-settings-label"},"字重",-1)),e.createElementVNode("select",{class:"zm-select",value:((ie=t.nodeStyle)==null?void 0:ie.fontWeight)??400,onChange:S[19]||(S[19]=E=>g({fontWeight:parseInt(E.target.value)}))},[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(d,E=>e.createElementVNode("option",{key:E.value,value:E.value},e.toDisplayString(E.label),9,uu)),64))],40,du)]),e.createElementVNode("div",fu,[S[50]||(S[50]=e.createElementVNode("span",{class:"zm-settings-label"},"文字大小",-1)),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"1",min:"8",max:"48",value:((me=t.nodeStyle)==null?void 0:me.fontSize)??14,onChange:S[20]||(S[20]=E=>g({fontSize:parseInt(E.target.value)||14}))},null,40,mu)]),e.createElementVNode("div",pu,[S[51]||(S[51]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"8",max:"48",step:"1",value:((v=t.nodeStyle)==null?void 0:v.fontSize)??14,onInput:S[21]||(S[21]=E=>g({fontSize:parseInt(E.target.value)}))},null,40,gu)]),S[53]||(S[53]=e.createElementVNode("p",{class:"zm-settings-hint"},"仅作用于当前节点,不影响子节点。",-1))])):e.createCommentVNode("",!0),e.createElementVNode("section",hu,[e.createElementVNode("button",{class:"zm-settings-reset",onClick:S[22]||(S[22]=E=>i("reset"))},"恢复默认设置")])])}}}),[["__scopeId","data-v-2fd1eea8"]]),Nr=20;function bu(t,o){t.style.height="auto";const n=o.minRows*Nr,i=o.maxRows>0?o.maxRows*Nr:1/0,a=Math.max(n,Math.min(i,t.scrollHeight));t.style.height=a+"px",t.style.overflowY=t.scrollHeight>i?"auto":"hidden"}function bi(t,o={}){const n={minRows:o.minRows??3,maxRows:o.maxRows??12};function i(){const c=t.value;c&&bu(c,n)}function a(){i()}e.onMounted(async()=>{await e.nextTick();const c=t.value;c&&(c.addEventListener("input",a),i())}),e.watch(()=>{var c;return(c=t.value)==null?void 0:c.value},()=>i()),e.onBeforeUnmount(()=>{const c=t.value;c&&c.removeEventListener("input",a)})}function ku(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Sr(t){return t instanceof Map?t.clear=t.delete=t.set=function(){throw new Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=function(){throw new Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach(o=>{const n=t[o],i=typeof n;(i==="object"||i==="function")&&!Object.isFrozen(n)&&Sr(n)}),t}class Tr{constructor(o){o.data===void 0&&(o.data={}),this.data=o.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function Cr(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function fn(t,...o){const n=Object.create(null);for(const i in t)n[i]=t[i];return o.forEach(function(i){for(const a in i)n[a]=i[a]}),n}const yu="</span>",Mr=t=>!!t.scope,Eu=(t,{prefix:o})=>{if(t.startsWith("language:"))return t.replace("language:","language-");if(t.includes(".")){const n=t.split(".");return[`${o}${n.shift()}`,...n.map((i,a)=>`${i}${"_".repeat(a+1)}`)].join(" ")}return`${o}${t}`};class xu{constructor(o,n){this.buffer="",this.classPrefix=n.classPrefix,o.walk(this)}addText(o){this.buffer+=Cr(o)}openNode(o){if(!Mr(o))return;const n=Eu(o.scope,{prefix:this.classPrefix});this.span(n)}closeNode(o){Mr(o)&&(this.buffer+=yu)}value(){return this.buffer}span(o){this.buffer+=`<span class="${o}">`}}const Ar=(t={})=>{const o={children:[]};return Object.assign(o,t),o};class ki{constructor(){this.rootNode=Ar(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(o){this.top.children.push(o)}openNode(o){const n=Ar({scope:o});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(o){return this.constructor._walk(o,this.rootNode)}static _walk(o,n){return typeof n=="string"?o.addText(n):n.children&&(o.openNode(n),n.children.forEach(i=>this._walk(o,i)),o.closeNode(n)),o}static _collapse(o){typeof o!="string"&&o.children&&(o.children.every(n=>typeof n=="string")?o.children=[o.children.join("")]:o.children.forEach(n=>{ki._collapse(n)}))}}class wu extends ki{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 xu(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function ro(t){return t?typeof t=="string"?t:t.source:null}function _r(t){return En("(?=",t,")")}function Nu(t){return En("(?:",t,")*")}function Su(t){return En("(?:",t,")?")}function En(...t){return t.map(n=>ro(n)).join("")}function Tu(t){const o=t[t.length-1];return typeof o=="object"&&o.constructor===Object?(t.splice(t.length-1,1),o):{}}function yi(...t){return"("+(Tu(t).capture?"":"?:")+t.map(i=>ro(i)).join("|")+")"}function Rr(t){return new RegExp(t.toString()+"|").exec("").length-1}function Cu(t,o){const n=t&&t.exec(o);return n&&n.index===0}const Mu=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Ei(t,{joinWith:o}){let n=0;return t.map(i=>{n+=1;const a=n;let c=ro(i),s="";for(;c.length>0;){const u=Mu.exec(c);if(!u){s+=c;break}s+=c.substring(0,u.index),c=c.substring(u.index+u[0].length),u[0][0]==="\\"&&u[1]?s+="\\"+String(Number(u[1])+a):(s+=u[0],u[0]==="("&&n++)}return s}).map(i=>`(${i})`).join(o)}const Au=/\b\B/,Br="[a-zA-Z]\\w*",xi="[a-zA-Z_]\\w*",vr="\\b\\d+(\\.\\d+)?",Ir="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",zr="\\b(0b[01]+)",_u="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",Ru=(t={})=>{const o=/^#![ ]*\//;return t.binary&&(t.begin=En(o,/.*\b/,t.binary,/\b.*/)),fn({scope:"meta",begin:o,end:/$/,relevance:0,"on:begin":(n,i)=>{n.index!==0&&i.ignoreMatch()}},t)},lo={begin:"\\\\[\\s\\S]",relevance:0},Bu={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[lo]},vu={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[lo]},Iu={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Vo=function(t,o,n={}){const i=fn({scope:"comment",begin:t,end:o,contains:[]},n);i.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const a=yi("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return i.contains.push({begin:En(/[ ]+/,"(",a,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),i},zu=Vo("//","$"),Ou=Vo("/\\*","\\*/"),Lu=Vo("#","$"),Du={scope:"number",begin:vr,relevance:0},$u={scope:"number",begin:Ir,relevance:0},Vu={scope:"number",begin:zr,relevance:0},Pu={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[lo,{begin:/\[/,end:/\]/,relevance:0,contains:[lo]}]},Fu={scope:"title",begin:Br,relevance:0},Uu={scope:"title",begin:xi,relevance:0},Hu={begin:"\\.\\s*"+xi,relevance:0};var Po=Object.freeze({__proto__:null,APOS_STRING_MODE:Bu,BACKSLASH_ESCAPE:lo,BINARY_NUMBER_MODE:Vu,BINARY_NUMBER_RE:zr,COMMENT:Vo,C_BLOCK_COMMENT_MODE:Ou,C_LINE_COMMENT_MODE:zu,C_NUMBER_MODE:$u,C_NUMBER_RE:Ir,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:Lu,IDENT_RE:Br,MATCH_NOTHING_RE:Au,METHOD_GUARD:Hu,NUMBER_MODE:Du,NUMBER_RE:vr,PHRASAL_WORDS_MODE:Iu,QUOTE_STRING_MODE:vu,REGEXP_MODE:Pu,RE_STARTERS_RE:_u,SHEBANG:Ru,TITLE_MODE:Fu,UNDERSCORE_IDENT_RE:xi,UNDERSCORE_TITLE_MODE:Uu});function Wu(t,o){t.input[t.index-1]==="."&&o.ignoreMatch()}function Gu(t,o){t.className!==void 0&&(t.scope=t.className,delete t.className)}function ju(t,o){o&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=Wu,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function Ku(t,o){Array.isArray(t.illegal)&&(t.illegal=yi(...t.illegal))}function Yu(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 qu(t,o){t.relevance===void 0&&(t.relevance=1)}const Xu=(t,o)=>{if(!t.beforeMatch)return;if(t.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},t);Object.keys(t).forEach(i=>{delete t[i]}),t.keywords=n.keywords,t.begin=En(n.beforeMatch,_r(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},Zu=["of","and","for","in","not","or","if","then","parent","list","value"],Ju="keyword";function Or(t,o,n=Ju){const i=Object.create(null);return typeof t=="string"?a(n,t.split(" ")):Array.isArray(t)?a(n,t):Object.keys(t).forEach(function(c){Object.assign(i,Or(t[c],o,c))}),i;function a(c,s){o&&(s=s.map(u=>u.toLowerCase())),s.forEach(function(u){const d=u.split("|");i[d[0]]=[c,Qu(d[0],d[1])]})}}function Qu(t,o){return o?Number(o):ef(t)?0:1}function ef(t){return Zu.includes(t.toLowerCase())}const Lr={},xn=t=>{console.error(t)},Dr=(t,...o)=>{console.log(`WARN: ${t}`,...o)},Ln=(t,o)=>{Lr[`${t}/${o}`]||(console.log(`Deprecated as of ${t}. ${o}`),Lr[`${t}/${o}`]=!0)},Fo=new Error;function $r(t,o,{key:n}){let i=0;const a=t[n],c={},s={};for(let u=1;u<=o.length;u++)s[u+i]=a[u],c[u+i]=!0,i+=Rr(o[u-1]);t[n]=s,t[n]._emit=c,t[n]._multi=!0}function tf(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw xn("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Fo;if(typeof t.beginScope!="object"||t.beginScope===null)throw xn("beginScope must be object"),Fo;$r(t,t.begin,{key:"beginScope"}),t.begin=Ei(t.begin,{joinWith:""})}}function nf(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw xn("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Fo;if(typeof t.endScope!="object"||t.endScope===null)throw xn("endScope must be object"),Fo;$r(t,t.end,{key:"endScope"}),t.end=Ei(t.end,{joinWith:""})}}function of(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function rf(t){of(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),tf(t),nf(t)}function lf(t){function o(s,u){return new RegExp(ro(s),"m"+(t.case_insensitive?"i":"")+(t.unicodeRegex?"u":"")+(u?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(u,d){d.position=this.position++,this.matchIndexes[this.matchAt]=d,this.regexes.push([d,u]),this.matchAt+=Rr(u)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const u=this.regexes.map(d=>d[1]);this.matcherRe=o(Ei(u,{joinWith:"|"}),!0),this.lastIndex=0}exec(u){this.matcherRe.lastIndex=this.lastIndex;const d=this.matcherRe.exec(u);if(!d)return null;const g=d.findIndex((w,C)=>C>0&&w!==void 0),h=this.matchIndexes[g];return d.splice(0,g),Object.assign(d,h)}}class i{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(u){if(this.multiRegexes[u])return this.multiRegexes[u];const d=new n;return this.rules.slice(u).forEach(([g,h])=>d.addRule(g,h)),d.compile(),this.multiRegexes[u]=d,d}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(u,d){this.rules.push([u,d]),d.type==="begin"&&this.count++}exec(u){const d=this.getMatcher(this.regexIndex);d.lastIndex=this.lastIndex;let g=d.exec(u);if(this.resumingScanAtSamePosition()&&!(g&&g.index===this.lastIndex)){const h=this.getMatcher(0);h.lastIndex=this.lastIndex+1,g=h.exec(u)}return g&&(this.regexIndex+=g.position+1,this.regexIndex===this.count&&this.considerAll()),g}}function a(s){const u=new i;return s.contains.forEach(d=>u.addRule(d.begin,{rule:d,type:"begin"})),s.terminatorEnd&&u.addRule(s.terminatorEnd,{type:"end"}),s.illegal&&u.addRule(s.illegal,{type:"illegal"}),u}function c(s,u){const d=s;if(s.isCompiled)return d;[Gu,Yu,rf,Xu].forEach(h=>h(s,u)),t.compilerExtensions.forEach(h=>h(s,u)),s.__beforeBegin=null,[ju,Ku,qu].forEach(h=>h(s,u)),s.isCompiled=!0;let g=null;return typeof s.keywords=="object"&&s.keywords.$pattern&&(s.keywords=Object.assign({},s.keywords),g=s.keywords.$pattern,delete s.keywords.$pattern),g=g||/\w+/,s.keywords&&(s.keywords=Or(s.keywords,t.case_insensitive)),d.keywordPatternRe=o(g,!0),u&&(s.begin||(s.begin=/\B|\b/),d.beginRe=o(d.begin),!s.end&&!s.endsWithParent&&(s.end=/\B|\b/),s.end&&(d.endRe=o(d.end)),d.terminatorEnd=ro(d.end)||"",s.endsWithParent&&u.terminatorEnd&&(d.terminatorEnd+=(s.end?"|":"")+u.terminatorEnd)),s.illegal&&(d.illegalRe=o(s.illegal)),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map(function(h){return af(h==="self"?s:h)})),s.contains.forEach(function(h){c(h,d)}),s.starts&&c(s.starts,u),d.matcher=a(d),d}if(t.compilerExtensions||(t.compilerExtensions=[]),t.contains&&t.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return t.classNameAliases=fn(t.classNameAliases||{}),c(t)}function Vr(t){return t?t.endsWithParent||Vr(t.starts):!1}function af(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(o){return fn(t,{variants:null},o)})),t.cachedVariants?t.cachedVariants:Vr(t)?fn(t,{starts:t.starts?fn(t.starts):null}):Object.isFrozen(t)?fn(t):t}var sf="11.11.1";class cf extends Error{constructor(o,n){super(o),this.name="HTMLInjectionError",this.html=n}}const wi=Cr,Pr=fn,Fr=Symbol("nomatch"),df=7,Ur=function(t){const o=Object.create(null),n=Object.create(null),i=[];let a=!0;const c="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]};let u={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:wu};function d(v){return u.noHighlightRe.test(v)}function g(v){let E=v.className+" ";E+=v.parentNode?v.parentNode.className:"";const $=u.languageDetectRe.exec(E);if($){const X=S($[1]);return X||(Dr(c.replace("{}",$[1])),Dr("Falling back to no-highlight mode for this block.",v)),X?$[1]:"no-highlight"}return E.split(/\s+/).find(X=>d(X)||S(X))}function h(v,E,$){let X="",fe="";typeof E=="object"?(X=v,$=E.ignoreIllegals,fe=E.language):(Ln("10.7.0","highlight(lang, code, ...args) has been deprecated."),Ln("10.7.0",`Please use highlight(code, options) instead.
|
|
59
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),fe=v,X=E),$===void 0&&($=!0);const Ae={code:X,language:fe};ie("before:highlight",Ae);const De=Ae.result?Ae.result:w(Ae.language,Ae.code,$);return De.code=Ae.code,ie("after:highlight",De),De}function w(v,E,$,X){const fe=Object.create(null);function Ae(Y,te){return Y.keywords[te]}function De(){if(!ae.keywords){ze.addText(_e);return}let Y=0;ae.keywordPatternRe.lastIndex=0;let te=ae.keywordPatternRe.exec(_e),he="";for(;te;){he+=_e.substring(Y,te.index);const Se=nt.case_insensitive?te[0].toLowerCase():te[0],He=Ae(ae,Se);if(He){const[at,Mt]=He;if(ze.addText(he),he="",fe[Se]=(fe[Se]||0)+1,fe[Se]<=df&&(Vt+=Mt),at.startsWith("_"))he+=te[0];else{const An=nt.classNameAliases[at]||at;y(te[0],An)}}else he+=te[0];Y=ae.keywordPatternRe.lastIndex,te=ae.keywordPatternRe.exec(_e)}he+=_e.substring(Y),ze.addText(he)}function Pe(){if(_e==="")return;let Y=null;if(typeof ae.subLanguage=="string"){if(!o[ae.subLanguage]){ze.addText(_e);return}Y=w(ae.subLanguage,_e,!0,gt[ae.subLanguage]),gt[ae.subLanguage]=Y._top}else Y=P(_e,ae.subLanguage.length?ae.subLanguage:null);ae.relevance>0&&(Vt+=Y.relevance),ze.__addSublanguage(Y._emitter,Y.language)}function Me(){ae.subLanguage!=null?Pe():De(),_e=""}function y(Y,te){Y!==""&&(ze.startScope(te),ze.addText(Y),ze.endScope())}function p(Y,te){let he=1;const Se=te.length-1;for(;he<=Se;){if(!Y._emit[he]){he++;continue}const He=nt.classNameAliases[Y[he]]||Y[he],at=te[he];He?y(at,He):(_e=at,De(),_e=""),he++}}function D(Y,te){return Y.scope&&typeof Y.scope=="string"&&ze.openNode(nt.classNameAliases[Y.scope]||Y.scope),Y.beginScope&&(Y.beginScope._wrap?(y(_e,nt.classNameAliases[Y.beginScope._wrap]||Y.beginScope._wrap),_e=""):Y.beginScope._multi&&(p(Y.beginScope,te),_e="")),ae=Object.create(Y,{parent:{value:ae}}),ae}function V(Y,te,he){let Se=Cu(Y.endRe,he);if(Se){if(Y["on:end"]){const He=new Tr(Y);Y["on:end"](te,He),He.isMatchIgnored&&(Se=!1)}if(Se){for(;Y.endsParent&&Y.parent;)Y=Y.parent;return Y}}if(Y.endsWithParent)return V(Y.parent,te,he)}function ee(Y){return ae.matcher.regexIndex===0?(_e+=Y[0],1):(Nt=!0,0)}function ge(Y){const te=Y[0],he=Y.rule,Se=new Tr(he),He=[he.__beforeBegin,he["on:begin"]];for(const at of He)if(at&&(at(Y,Se),Se.isMatchIgnored))return ee(te);return he.skip?_e+=te:(he.excludeBegin&&(_e+=te),Me(),!he.returnBegin&&!he.excludeBegin&&(_e=te)),D(he,Y),he.returnBegin?0:te.length}function we(Y){const te=Y[0],he=E.substring(Y.index),Se=V(ae,Y,he);if(!Se)return Fr;const He=ae;ae.endScope&&ae.endScope._wrap?(Me(),y(te,ae.endScope._wrap)):ae.endScope&&ae.endScope._multi?(Me(),p(ae.endScope,Y)):He.skip?_e+=te:(He.returnEnd||He.excludeEnd||(_e+=te),Me(),He.excludeEnd&&(_e=te));do ae.scope&&ze.closeNode(),!ae.skip&&!ae.subLanguage&&(Vt+=ae.relevance),ae=ae.parent;while(ae!==Se.parent);return Se.starts&&D(Se.starts,Y),He.returnEnd?0:te.length}function tt(){const Y=[];for(let te=ae;te!==nt;te=te.parent)te.scope&&Y.unshift(te.scope);Y.forEach(te=>ze.openNode(te))}let je={};function rt(Y,te){const he=te&&te[0];if(_e+=Y,he==null)return Me(),0;if(je.type==="begin"&&te.type==="end"&&je.index===te.index&&he===""){if(_e+=E.slice(te.index,te.index+1),!a){const Se=new Error(`0 width match regex (${v})`);throw Se.languageName=v,Se.badRule=je.rule,Se}return 1}if(je=te,te.type==="begin")return ge(te);if(te.type==="illegal"&&!$){const Se=new Error('Illegal lexeme "'+he+'" for mode "'+(ae.scope||"<unnamed>")+'"');throw Se.mode=ae,Se}else if(te.type==="end"){const Se=we(te);if(Se!==Fr)return Se}if(te.type==="illegal"&&he==="")return _e+=`
|
|
60
|
+
`,1;if(Ct>1e5&&Ct>te.index*3)throw new Error("potential infinite loop, way more iterations than matches");return _e+=he,he.length}const nt=S(v);if(!nt)throw xn(c.replace("{}",v)),new Error('Unknown language: "'+v+'"');const an=lf(nt);let $t="",ae=X||an;const gt={},ze=new u.__emitter(u);tt();let _e="",Vt=0,lt=0,Ct=0,Nt=!1;try{if(nt.__emitTokens)nt.__emitTokens(E,ze);else{for(ae.matcher.considerAll();;){Ct++,Nt?Nt=!1:ae.matcher.considerAll(),ae.matcher.lastIndex=lt;const Y=ae.matcher.exec(E);if(!Y)break;const te=E.substring(lt,Y.index),he=rt(te,Y);lt=Y.index+he}rt(E.substring(lt))}return ze.finalize(),$t=ze.toHTML(),{language:v,value:$t,relevance:Vt,illegal:!1,_emitter:ze,_top:ae}}catch(Y){if(Y.message&&Y.message.includes("Illegal"))return{language:v,value:wi(E),illegal:!0,relevance:0,_illegalBy:{message:Y.message,index:lt,context:E.slice(lt-100,lt+100),mode:Y.mode,resultSoFar:$t},_emitter:ze};if(a)return{language:v,value:wi(E),illegal:!1,relevance:0,errorRaised:Y,_emitter:ze,_top:ae};throw Y}}function C(v){const E={value:wi(v),illegal:!1,relevance:0,_top:s,_emitter:new u.__emitter(u)};return E._emitter.addText(v),E}function P(v,E){E=E||u.languages||Object.keys(o);const $=C(v),X=E.filter(S).filter(se).map(Me=>w(Me,v,!1));X.unshift($);const fe=X.sort((Me,y)=>{if(Me.relevance!==y.relevance)return y.relevance-Me.relevance;if(Me.language&&y.language){if(S(Me.language).supersetOf===y.language)return 1;if(S(y.language).supersetOf===Me.language)return-1}return 0}),[Ae,De]=fe,Pe=Ae;return Pe.secondBest=De,Pe}function R(v,E,$){const X=E&&n[E]||$;v.classList.add("hljs"),v.classList.add(`language-${X}`)}function U(v){let E=null;const $=g(v);if(d($))return;if(ie("before:highlightElement",{el:v,language:$}),v.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",v);return}if(v.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(v)),u.throwUnescapedHTML))throw new cf("One of your code blocks includes unescaped HTML.",v.innerHTML);E=v;const X=E.textContent,fe=$?h(X,{language:$,ignoreIllegals:!0}):P(X);v.innerHTML=fe.value,v.dataset.highlighted="yes",R(v,$,fe.language),v.result={language:fe.language,re:fe.relevance,relevance:fe.relevance},fe.secondBest&&(v.secondBest={language:fe.secondBest.language,relevance:fe.secondBest.relevance}),ie("after:highlightElement",{el:v,result:fe,text:X})}function I(v){u=Pr(u,v)}const A=()=>{m(),Ln("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function x(){m(),Ln("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let k=!1;function m(){function v(){m()}if(document.readyState==="loading"){k||window.addEventListener("DOMContentLoaded",v,!1),k=!0;return}document.querySelectorAll(u.cssSelector).forEach(U)}function F(v,E){let $=null;try{$=E(t)}catch(X){if(xn("Language definition for '{}' could not be registered.".replace("{}",v)),a)xn(X);else throw X;$=s}$.name||($.name=v),o[v]=$,$.rawDefinition=E.bind(null,t),$.aliases&&ne($.aliases,{languageName:v})}function W(v){delete o[v];for(const E of Object.keys(n))n[E]===v&&delete n[E]}function K(){return Object.keys(o)}function S(v){return v=(v||"").toLowerCase(),o[v]||o[n[v]]}function ne(v,{languageName:E}){typeof v=="string"&&(v=[v]),v.forEach($=>{n[$.toLowerCase()]=E})}function se(v){const E=S(v);return E&&!E.disableAutodetect}function re(v){v["before:highlightBlock"]&&!v["before:highlightElement"]&&(v["before:highlightElement"]=E=>{v["before:highlightBlock"](Object.assign({block:E.el},E))}),v["after:highlightBlock"]&&!v["after:highlightElement"]&&(v["after:highlightElement"]=E=>{v["after:highlightBlock"](Object.assign({block:E.el},E))})}function Z(v){re(v),i.push(v)}function ce(v){const E=i.indexOf(v);E!==-1&&i.splice(E,1)}function ie(v,E){const $=v;i.forEach(function(X){X[$]&&X[$](E)})}function me(v){return Ln("10.7.0","highlightBlock will be removed entirely in v12.0"),Ln("10.7.0","Please use highlightElement now."),U(v)}Object.assign(t,{highlight:h,highlightAuto:P,highlightAll:m,highlightElement:U,highlightBlock:me,configure:I,initHighlighting:A,initHighlightingOnLoad:x,registerLanguage:F,unregisterLanguage:W,listLanguages:K,getLanguage:S,registerAliases:ne,autoDetection:se,inherit:Pr,addPlugin:Z,removePlugin:ce}),t.debugMode=function(){a=!1},t.safeMode=function(){a=!0},t.versionString=sf,t.regex={concat:En,lookahead:_r,either:yi,optional:Su,anyNumberOfTimes:Nu};for(const v in Po)typeof Po[v]=="object"&&Sr(Po[v]);return Object.assign(t,Po),t},Dn=Ur({});Dn.newInstance=()=>Ur({});var uf=Dn;Dn.HighlightJS=Dn,Dn.default=Dn;const Ni=ku(uf);function Si(t){const o=t.regex,n={},i={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:o.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},i]});const a={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},c=t.inherit(t.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),s={begin:/<<-?\s*(?=\w+)/,starts:{contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},u={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,n,a]};a.contains.push(u);const d={match:/\\"/},g={className:"string",begin:/'/,end:/'/},h={match:/\\'/},w={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,n]},C=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],P=t.SHEBANG({binary:`(${C.join("|")})`,relevance:10}),R={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},U=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],I=["true","false"],A={match:/(\/[a-z._-]+)+/},x=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],k=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],m=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],F=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:U,literal:I,built_in:[...x,...k,"set","shopt",...m,...F]},contains:[P,t.SHEBANG(),R,w,c,s,A,u,d,g,h,n]}}const ff=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_-]*/}}),mf=["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"],pf=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],gf=[...mf,...pf],hf=["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(),bf=["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(),kf=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),yf=["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 Ef(t){const o=t.regex,n=ff(t),i={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},a="and or not only",c=/@-?\w[\w]*(-\w+)*/,s="[a-zA-Z-][a-zA-Z0-9_-]*",u=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,i,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+s,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+bf.join("|")+")"},{begin:":(:)?("+kf.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+yf.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...u,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...u,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:o.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:c},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:a,attribute:hf.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...u,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+gf.join("|")+")\\b"}]}}function Hr(t){const c={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:c,illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"string",variants:[t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[t.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:c,illegal:/["']/}]}]}}var $n="[0-9](_*[0-9])*",Uo=`\\.(${$n})`,Ho="[0-9a-fA-F](_*[0-9a-fA-F])*",Wr={className:"number",variants:[{begin:`(\\b(${$n})((${Uo})|\\.)?|(${Uo}))[eE][+-]?(${$n})[fFdD]?\\b`},{begin:`\\b(${$n})((${Uo})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Uo})[fFdD]?\\b`},{begin:`\\b(${$n})[fFdD]\\b`},{begin:`\\b0[xX]((${Ho})\\.?|(${Ho})?\\.(${Ho}))[pP][+-]?(${$n})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Ho})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Gr(t,o,n){return n===-1?"":t.replace(o,i=>Gr(t,o,n-1))}function xf(t){const o=t.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",i=n+Gr("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),d={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},g={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},h={className:"params",begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[t.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:d,illegal:/<\/|#/,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[t.BACKSLASH_ESCAPE]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[o.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[h,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+i+"\\s+)",t.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:d,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[g,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,Wr,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},Wr,g]}}const jr="[A-Za-z$_][0-9A-Za-z$_]*",wf=["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"],Nf=["true","false","null","undefined","NaN","Infinity"],Kr=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Yr=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],qr=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Sf=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Tf=[].concat(qr,Kr,Yr);function Xr(t){const o=t.regex,n=($,{after:X})=>{const fe="</"+$[0].slice(1);return $.input.indexOf(fe,X)!==-1},i=jr,a={begin:"<>",end:"</>"},c=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:($,X)=>{const fe=$[0].length+$.index,Ae=$.input[fe];if(Ae==="<"||Ae===","){X.ignoreMatch();return}Ae===">"&&(n($,{after:fe})||X.ignoreMatch());let De;const Pe=$.input.substring(fe);if(De=Pe.match(/^\s*=/)){X.ignoreMatch();return}if((De=Pe.match(/^\s+extends\s+/))&&De.index===0){X.ignoreMatch();return}}},u={$pattern:jr,keyword:wf,literal:Nf,built_in:Tf,"variable.language":Sf},d="[0-9](_?[0-9])*",g=`\\.(${d})`,h="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",w={className:"number",variants:[{begin:`(\\b(${h})((${g})|\\.)?|(${g}))[eE][+-]?(${d})\\b`},{begin:`\\b(${h})\\b((${g})\\b|\\.)?|(${g})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},C={className:"subst",begin:"\\$\\{",end:"\\}",keywords:u,contains:[]},P={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"xml"}},R={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"css"}},U={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"graphql"}},I={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,C]},x={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},k=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,P,R,U,I,{match:/\$\d+/},w];C.contains=k.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(k)});const m=[].concat(x,C.contains),F=m.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(m)}]),W={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:F},K={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"}}]},S={relevance:0,match:o.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Kr,...Yr]}},ne={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},se={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[W],illegal:/%/},re={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Z($){return o.concat("(?!",$.join("|"),")")}const ce={match:o.concat(/\b/,Z([...qr,"super","import"].map($=>`${$}\\s*\\(`)),i,o.lookahead(/\s*\(/)),className:"title.function",relevance:0},ie={begin:o.concat(/\./,o.lookahead(o.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},me={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},W]},v="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",E={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,o.lookahead(v)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[W]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:F,CLASS_REFERENCE:S},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),ne,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,P,R,U,I,x,{match:/\$\d+/},w,S,{scope:"attr",match:i+o.lookahead(":"),relevance:0},E,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[x,t.REGEXP_MODE,{className:"function",begin:v,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:F}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:a.begin,end:a.end},{match:c},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},se,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[W,t.inherit(t.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},ie,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[W]},ce,re,K,me,{match:/\$[(.]/}]}}function Cf(t){const o={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},i=["true","false","null"],a={scope:"literal",beginKeywords:i.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:i},contains:[o,n,t.QUOTE_STRING_MODE,a,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function Zr(t){const o=t.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},i={begin:"^[-\\*]{3,}",end:"$"},a={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},c={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},s={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},u=/[A-Za-z][A-Za-z0-9+.-]*/,d={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:o.concat(/\[.+?\]\(/,u,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},g={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},h={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},w=t.inherit(g,{contains:[]}),C=t.inherit(h,{contains:[]});g.contains.push(C),h.contains.push(w);let P=[n,d];return[g,h,w,C].forEach(A=>{A.contains=A.contains.concat(P)}),P=P.concat(g,h),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:P},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:P}]}]},n,c,g,h,{className:"quote",begin:"^>\\s+",contains:P,end:"$"},a,i,d,s,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function Jr(t){const o=t.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),i=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],u={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:i,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},d={className:"meta",begin:/^(>>>|\.\.\.) /},g={className:"subst",begin:/\{/,end:/\}/,keywords:u,illegal:/#/},h={begin:/\{\{/,relevance:0},w={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,d],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,d],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,d,h,g]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,d,h,g]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[t.BACKSLASH_ESCAPE,h,g]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,h,g]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},C="[0-9](_?[0-9])*",P=`(\\b(${C}))?\\.(${C})|\\b(${C})\\.`,R=`\\b|${i.join("|")}`,U={className:"number",relevance:0,variants:[{begin:`(\\b(${C})|(${P}))[eE][+-]?(${C})[jJ]?(?=${R})`},{begin:`(${P})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${R})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${R})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${R})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${R})`},{begin:`\\b(${C})[jJ](?=${R})`}]},I={className:"comment",begin:o.lookahead(/# type:/),end:/$/,keywords:u,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},A={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:["self",d,U,w,t.HASH_COMMENT_MODE]}]};return g.contains=[w,U,d],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:u,illegal:/(<\/|\?)|=>/,contains:[d,U,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},w,I,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[A]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[U,A,w]}]}}function Qr(t){const o=t.regex,n=/(r#)?/,i=o.concat(n,t.UNDERSCORE_IDENT_RE),a=o.concat(n,t.IDENT_RE),c={className:"title.function.invoke",relevance:0,begin:o.concat(/\b/,/(?!let|for|while|if|else|match\b)/,a,o.lookahead(/\s*\(/))},s="([ui](8|16|32|64|128|size)|f(32|64))?",u=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],d=["true","false","Some","None","Ok","Err"],g=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],h=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:t.IDENT_RE+"!?",type:h,keyword:u,literal:d,built_in:g},illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.COMMENT("/\\*","\\*/",{contains:["self"]}),t.inherit(t.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+s},{begin:"\\b0o([0-7_]+)"+s},{begin:"\\b0x([A-Fa-f0-9_]+)"+s},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+s}],relevance:0},{begin:[/fn/,/\s+/,i],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,i],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,i,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,i],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,i],className:{1:"keyword",3:"title.class"}},{begin:t.IDENT_RE+"::",keywords:{keyword:"Self",built_in:g,type:h}},{className:"punctuation",begin:"->"},c]}}function Mf(t){const o=t.regex,n=t.COMMENT("--","$"),i={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},a={begin:/"/,end:/"/,contains:[{match:/""/}]},c=["true","false","unknown"],s=["double precision","large object","with timezone","without timezone"],u=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],d=["add","asc","collation","desc","final","first","last","view"],g=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],h=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],w=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],C=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],P=h,R=[...g,...d].filter(F=>!h.includes(F)),U={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},I={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},A={match:o.concat(/\b/,o.either(...P),/\s*\(/),relevance:0,keywords:{built_in:P}};function x(F){return o.concat(/\b/,o.either(...F.map(W=>W.replace(/\s+/,"\\s+"))),/\b/)}const k={scope:"keyword",match:x(C),relevance:0};function m(F,{exceptions:W,when:K}={}){const S=K;return W=W||[],F.map(ne=>ne.match(/\|\d+$/)||W.includes(ne)?ne:S(ne)?`${ne}|0`:ne)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:m(R,{when:F=>F.length<3}),literal:c,type:u,built_in:w},contains:[{scope:"type",match:x(s)},k,A,U,i,a,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,n,I]}}const Wo="[A-Za-z$_][0-9A-Za-z$_]*",el=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],tl=["true","false","null","undefined","NaN","Infinity"],nl=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],ol=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],il=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],rl=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],ll=[].concat(il,nl,ol);function Af(t){const o=t.regex,n=($,{after:X})=>{const fe="</"+$[0].slice(1);return $.input.indexOf(fe,X)!==-1},i=Wo,a={begin:"<>",end:"</>"},c=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:($,X)=>{const fe=$[0].length+$.index,Ae=$.input[fe];if(Ae==="<"||Ae===","){X.ignoreMatch();return}Ae===">"&&(n($,{after:fe})||X.ignoreMatch());let De;const Pe=$.input.substring(fe);if(De=Pe.match(/^\s*=/)){X.ignoreMatch();return}if((De=Pe.match(/^\s+extends\s+/))&&De.index===0){X.ignoreMatch();return}}},u={$pattern:Wo,keyword:el,literal:tl,built_in:ll,"variable.language":rl},d="[0-9](_?[0-9])*",g=`\\.(${d})`,h="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",w={className:"number",variants:[{begin:`(\\b(${h})((${g})|\\.)?|(${g}))[eE][+-]?(${d})\\b`},{begin:`\\b(${h})\\b((${g})\\b|\\.)?|(${g})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},C={className:"subst",begin:"\\$\\{",end:"\\}",keywords:u,contains:[]},P={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"xml"}},R={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"css"}},U={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"graphql"}},I={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,C]},x={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},k=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,P,R,U,I,{match:/\$\d+/},w];C.contains=k.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(k)});const m=[].concat(x,C.contains),F=m.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(m)}]),W={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:F},K={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"}}]},S={relevance:0,match:o.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...nl,...ol]}},ne={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},se={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[W],illegal:/%/},re={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Z($){return o.concat("(?!",$.join("|"),")")}const ce={match:o.concat(/\b/,Z([...il,"super","import"].map($=>`${$}\\s*\\(`)),i,o.lookahead(/\s*\(/)),className:"title.function",relevance:0},ie={begin:o.concat(/\./,o.lookahead(o.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},me={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},W]},v="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",E={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,o.lookahead(v)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[W]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:F,CLASS_REFERENCE:S},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),ne,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,P,R,U,I,x,{match:/\$\d+/},w,S,{scope:"attr",match:i+o.lookahead(":"),relevance:0},E,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[x,t.REGEXP_MODE,{className:"function",begin:v,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:F}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:a.begin,end:a.end},{match:c},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},se,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[W,t.inherit(t.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},ie,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[W]},ce,re,K,me,{match:/\$[(.]/}]}}function al(t){const o=t.regex,n=Af(t),i=Wo,a=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],c={begin:[/namespace/,/\s+/,t.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},s={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:a},contains:[n.exports.CLASS_REFERENCE]},u={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},d=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],g={$pattern:Wo,keyword:el.concat(d),literal:tl,built_in:ll.concat(a),"variable.language":rl},h={className:"meta",begin:"@"+i},w=(U,I,A)=>{const x=U.contains.findIndex(k=>k.label===I);if(x===-1)throw new Error("can not find mode to replace");U.contains.splice(x,1,A)};Object.assign(n.keywords,g),n.exports.PARAMS_CONTAINS.push(h);const C=n.contains.find(U=>U.scope==="attr"),P=Object.assign({},C,{match:o.concat(i,o.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,C,P]),n.contains=n.contains.concat([h,c,s,P]),w(n,"shebang",t.SHEBANG()),w(n,"use_strict",u);const R=n.contains.find(U=>U.label==="func.def");return R.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function sl(t){const o=t.regex,n=o.concat(/[\p{L}_]/u,o.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),i=/[\p{L}0-9._:-]+/u,a={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},c={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},s=t.inherit(c,{begin:/\(/,end:/\)/}),u=t.inherit(t.APOS_STRING_MODE,{className:"string"}),d=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),g={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:i,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[a]},{begin:/'/,end:/'/,contains:[a]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[c,d,u,s,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[c,s,d,u]}]}]},t.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},a,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[d]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[g],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[g],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:o.concat(/</,o.lookahead(o.concat(n,o.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:g}]},{className:"tag",begin:o.concat(/<\//,o.lookahead(o.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function cl(t){const o="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",i={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},a={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},c={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},s={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,a]},u=t.inherit(s,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),C={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},P={end:",",endsWithParent:!0,excludeEnd:!0,keywords:o,relevance:0},R={begin:/\{/,end:/\}/,contains:[P],illegal:"\\n",relevance:0},U={begin:"\\[",end:"\\]",contains:[P],illegal:"\\n",relevance:0},I=[i,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:o,keywords:{literal:o}},C,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},R,U,c,s],A=[...I];return A.pop(),A.push(u),P.contains=A,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:I}}const Ti={bash:Si,sh:Si,shell:Si,css:Ef,go:Hr,golang:Hr,java:xf,javascript:Xr,js:Xr,json:Cf,markdown:Zr,md:Zr,python:Jr,py:Jr,rust:Qr,rs:Qr,sql:Mf,typescript:al,ts:al,xml:sl,html:sl,yaml:cl,yml:cl};for(const[t,o]of Object.entries(Ti))Ni.registerLanguage(t,o);function Go(t){const o=t.split(`
|
|
59
61
|
`);return/^(`{3,}|~{3,})/.test(o[0]??"")&&o.shift(),/^(`{3,}|~{3,})\s*$/.test(o[o.length-1]??"")&&o.pop(),o.join(`
|
|
60
62
|
`).replace(/\n+$/,"")}function wn(t){const o=/^(`{3,}|~{3,})([^\s`~]*)/.exec(t.split(`
|
|
61
|
-
`)[0]??""),n=((o==null?void 0:o[2])??"").toLowerCase();return n&&
|
|
62
|
-
`).filter(o=>o.trim().length>0).filter(o=>!/^\s*\|?\s*(:?-+:?\s*\|\s*)+(:?-+:?)(\s*\|)?\s*$/.test(o)).map(o=>o.replace(/^\s*\|/,"").replace(/\|\s*$/,"").split("|").map(n=>n.trim()))}function
|
|
63
|
-
]`).replace("lheading",
|
|
64
|
-
`),n=o.length-1;for(;n>=0&&
|
|
65
|
-
`)}function
|
|
63
|
+
`)[0]??""),n=((o==null?void 0:o[2])??"").toLowerCase();return n&&Ti[n]?n:""}function Ci(t,o){const n=o&&Ti[o]?o:"";try{return n?Ni.highlight(t,{language:n,ignoreIllegals:!0}).value:Ni.highlightAuto(t).value}catch{return _f(t)}}function Mi(t){return t.split(`
|
|
64
|
+
`).filter(o=>o.trim().length>0).filter(o=>!/^\s*\|?\s*(:?-+:?\s*\|\s*)+(:?-+:?)(\s*\|)?\s*$/.test(o)).map(o=>o.replace(/^\s*\|/,"").replace(/\|\s*$/,"").split("|").map(n=>n.trim()))}function _f(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function dl(t,o,n){if(t.length<=1)return t.slice();const[i,...a]=t,c=a.map(g=>g[o]??""),s=c.length>0&&c.every(g=>g.trim()!==""&&!Number.isNaN(Number(g))),u=n==="asc"?1:-1,d=a.slice().sort((g,h)=>{const w=g[o]??"",C=h[o]??"";return s?(Number(w)-Number(C))*u:w.localeCompare(C,"zh-Hans-CN",{numeric:!0})*u});return[i,...d]}function Ai(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Nn=Ai();function ul(t){Nn=t}var Sn={exec:()=>null};function Vn(t){let o=[];return n=>{let i=Math.max(0,Math.min(3,n-1)),a=o[i];return a||(a=t(i),o[i]=a),a}}function Ce(t,o=""){let n=typeof t=="string"?t:t.source,i={replace:(a,c)=>{let s=typeof c=="string"?c:c.source;return s=s.replace(mt.caret,"$1"),n=n.replace(a,s),i},getRegex:()=>new RegExp(n,o)};return i}var Rf=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),mt={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:Vn(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Vn(t=>new RegExp(`^ {0,${t}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:Vn(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:Vn(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:Vn(t=>new RegExp(`^ {0,${t}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:Vn(t=>new RegExp(`^ {0,${t}}>`))},Bf=/^(?:[ \t]*(?:\n|$))+/,vf=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,If=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ao=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,zf=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,_i=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,fl=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ml=Ce(fl).replace(/bull/g,_i).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(),Of=Ce(fl).replace(/bull/g,_i).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(),Ri=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Lf=/^[^\n]+/,Bi=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Df=Ce(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Bi).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),$f=Ce(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,_i).getRegex(),jo="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",vi=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Vf=Ce("^ {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",vi).replace("tag",jo).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),pl=Ce(Ri).replace("hr",ao).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",jo).getRegex(),Pf=Ce(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",pl).getRegex(),Ii={blockquote:Pf,code:vf,def:Df,fences:If,heading:zf,hr:ao,html:Vf,lheading:ml,list:$f,newline:Bf,paragraph:pl,table:Sn,text:Lf},gl=Ce("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ao).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",jo).getRegex(),Ff={...Ii,lheading:Of,table:gl,paragraph:Ce(Ri).replace("hr",ao).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",gl).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",jo).getRegex()},Uf={...Ii,html:Ce(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",vi).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Sn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Ce(Ri).replace("hr",ao).replace("heading",` *#{1,6} *[^
|
|
65
|
+
]`).replace("lheading",ml).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Hf=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Wf=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,hl=/^( {2,}|\\)\n(?!\s*$)/,Gf=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Pn=/[\p{P}\p{S}]/u,Ko=/[\s\p{P}\p{S}]/u,zi=/[^\s\p{P}\p{S}]/u,jf=Ce(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Ko).getRegex(),bl=/(?!~)[\p{P}\p{S}]/u,Kf=/(?!~)[\s\p{P}\p{S}]/u,Yf=/(?:[^\s\p{P}\p{S}]|~)/u,qf=Ce(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Rf?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),kl=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Xf=Ce(kl,"u").replace(/punct/g,Pn).getRegex(),Zf=Ce(kl,"u").replace(/punct/g,bl).getRegex(),yl="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Jf=Ce(yl,"gu").replace(/notPunctSpace/g,zi).replace(/punctSpace/g,Ko).replace(/punct/g,Pn).getRegex(),Qf=Ce(yl,"gu").replace(/notPunctSpace/g,Yf).replace(/punctSpace/g,Kf).replace(/punct/g,bl).getRegex(),em=Ce("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,zi).replace(/punctSpace/g,Ko).replace(/punct/g,Pn).getRegex(),tm=Ce(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Pn).getRegex(),nm="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",om=Ce(nm,"gu").replace(/notPunctSpace/g,zi).replace(/punctSpace/g,Ko).replace(/punct/g,Pn).getRegex(),im=Ce(/\\(punct)/,"gu").replace(/punct/g,Pn).getRegex(),rm=Ce(/^<(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(),lm=Ce(vi).replace("(?:-->|$)","-->").getRegex(),am=Ce("^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",lm).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Yo=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,sm=Ce(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Yo).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),El=Ce(/^!?\[(label)\]\[(ref)\]/).replace("label",Yo).replace("ref",Bi).getRegex(),xl=Ce(/^!?\[(ref)\](?:\[\])?/).replace("ref",Bi).getRegex(),cm=Ce("reflink|nolink(?!\\()","g").replace("reflink",El).replace("nolink",xl).getRegex(),wl=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Oi={_backpedal:Sn,anyPunctuation:im,autolink:rm,blockSkip:qf,br:hl,code:Wf,del:Sn,delLDelim:Sn,delRDelim:Sn,emStrongLDelim:Xf,emStrongRDelimAst:Jf,emStrongRDelimUnd:em,escape:Hf,link:sm,nolink:xl,punctuation:jf,reflink:El,reflinkSearch:cm,tag:am,text:Gf,url:Sn},dm={...Oi,link:Ce(/^!?\[(label)\]\((.*?)\)/).replace("label",Yo).getRegex(),reflink:Ce(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Yo).getRegex()},Li={...Oi,emStrongRDelimAst:Qf,emStrongLDelim:Zf,delLDelim:tm,delRDelim:om,url:Ce(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",wl).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Ce(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",wl).getRegex()},um={...Li,br:Ce(hl).replace("{2,}","*").getRegex(),text:Ce(Li.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},qo={normal:Ii,gfm:Ff,pedantic:Uf},so={normal:Oi,gfm:Li,breaks:um,pedantic:dm},fm={"&":"&","<":"<",">":">",'"':""","'":"'"},Nl=t=>fm[t];function Zt(t,o){if(o){if(mt.escapeTest.test(t))return t.replace(mt.escapeReplace,Nl)}else if(mt.escapeTestNoEncode.test(t))return t.replace(mt.escapeReplaceNoEncode,Nl);return t}function Sl(t){try{t=encodeURI(t).replace(mt.percentDecode,"%")}catch{return null}return t}function Tl(t,o){var c;let n=t.replace(mt.findPipe,(s,u,d)=>{let g=!1,h=u;for(;--h>=0&&d[h]==="\\";)g=!g;return g?"|":" |"}),i=n.split(mt.splitPipe),a=0;if(i[0].trim()||i.shift(),i.length>0&&!((c=i.at(-1))!=null&&c.trim())&&i.pop(),o)if(i.length>o)i.splice(o);else for(;i.length<o;)i.push("");for(;a<i.length;a++)i[a]=i[a].trim().replace(mt.slashPipe,"|");return i}function mn(t,o,n){let i=t.length;if(i===0)return"";let a=0;for(;a<i&&t.charAt(i-a-1)===o;)a++;return t.slice(0,i-a)}function Cl(t){let o=t.split(`
|
|
66
|
+
`),n=o.length-1;for(;n>=0&&mt.blankLine.test(o[n]);)n--;return o.length-n<=2?t:o.slice(0,n+1).join(`
|
|
67
|
+
`)}function mm(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 pm(t,o=0){let n=o,i="";for(let a of t)if(a===" "){let c=4-n%4;i+=" ".repeat(c),n+=c}else i+=a,n++;return i}function Ml(t,o,n,i,a){let c=o.href,s=o.title||null,u=t[1].replace(a.other.outputLinkReplace,"$1");i.state.inLink=!0;let d={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:c,title:s,text:u,tokens:i.inlineTokens(u)};return i.state.inLink=!1,d}function gm(t,o,n){let i=t.match(n.other.indentCodeCompensation);if(i===null)return o;let a=i[1];return o.split(`
|
|
66
68
|
`).map(c=>{let s=c.match(n.other.beginningSpace);if(s===null)return c;let[u]=s;return u.length>=a.length?c.slice(a.length):c}).join(`
|
|
67
|
-
`)}var Xo=class{constructor(t){
|
|
68
|
-
`),depth:o[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){let o=this.rules.block.hr.exec(t);if(o)return{type:"hr",raw:
|
|
69
|
-
`)}}blockquote(t){let o=this.rules.block.blockquote.exec(t);if(o){let n=
|
|
69
|
+
`)}var Xo=class{constructor(t){Ve(this,"options");Ve(this,"rules");Ve(this,"lexer");this.options=t||Nn}space(t){let o=this.rules.block.newline.exec(t);if(o&&o[0].length>0)return{type:"space",raw:o[0]}}code(t){let o=this.rules.block.code.exec(t);if(o){let n=this.options.pedantic?o[0]:Cl(o[0]),i=n.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n,codeBlockStyle:"indented",text:i}}}fences(t){let o=this.rules.block.fences.exec(t);if(o){let n=o[0],i=gm(n,o[3]||"",this.rules);return{type:"code",raw:n,lang:o[2]?o[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):o[2],text:i}}}heading(t){let o=this.rules.block.heading.exec(t);if(o){let n=o[2].trim();if(this.rules.other.endingHash.test(n)){let i=mn(n,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(n=i.trim())}return{type:"heading",raw:mn(o[0],`
|
|
70
|
+
`),depth:o[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){let o=this.rules.block.hr.exec(t);if(o)return{type:"hr",raw:mn(o[0],`
|
|
71
|
+
`)}}blockquote(t){let o=this.rules.block.blockquote.exec(t);if(o){let n=mn(o[0],`
|
|
70
72
|
`).split(`
|
|
71
73
|
`),i="",a="",c=[];for(;n.length>0;){let s=!1,u=[],d;for(d=0;d<n.length;d++)if(this.rules.other.blockquoteStart.test(n[d]))u.push(n[d]),s=!0;else if(!s)u.push(n[d]);else break;n=n.slice(d);let g=u.join(`
|
|
72
74
|
`),h=g.replace(this.rules.other.blockquoteSetextReplace,`
|
|
73
75
|
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");i=i?`${i}
|
|
74
76
|
${g}`:g,a=a?`${a}
|
|
75
|
-
${h}`:h;let
|
|
77
|
+
${h}`:h;let w=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(h,c,!0),this.lexer.state.top=w,n.length===0)break;let C=c.at(-1);if((C==null?void 0:C.type)==="code")break;if((C==null?void 0:C.type)==="blockquote"){let P=C,R=P.raw+`
|
|
76
78
|
`+n.join(`
|
|
77
|
-
`),
|
|
79
|
+
`),U=this.blockquote(R);c[c.length-1]=U,i=i.substring(0,i.length-P.raw.length)+U.raw,a=a.substring(0,a.length-P.text.length)+U.text;break}else if((C==null?void 0:C.type)==="list"){let P=C,R=P.raw+`
|
|
78
80
|
`+n.join(`
|
|
79
|
-
`),
|
|
80
|
-
`);continue}}return{type:"blockquote",raw:i,tokens:c,text:a}}}list(t){let o=this.rules.block.list.exec(t);if(o){let n=o[1].trim(),i=n.length>1,a={type:"list",raw:"",ordered:i,start:i?+n.slice(0,-1):"",loose:!1,items:[]};n=i?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=i?n:"[*+-]");let c=this.rules.other.listItemRegex(n),s=!1;for(;t;){let d=!1,g="",h="";if(!(o=c.exec(t))||this.rules.block.hr.test(t))break;g=o[0],t=t.substring(g.length);let
|
|
81
|
+
`),U=this.list(R);c[c.length-1]=U,i=i.substring(0,i.length-C.raw.length)+U.raw,a=a.substring(0,a.length-P.raw.length)+U.raw,n=R.substring(c.at(-1).raw.length).split(`
|
|
82
|
+
`);continue}}return{type:"blockquote",raw:i,tokens:c,text:a}}}list(t){let o=this.rules.block.list.exec(t);if(o){let n=o[1].trim(),i=n.length>1,a={type:"list",raw:"",ordered:i,start:i?+n.slice(0,-1):"",loose:!1,items:[]};n=i?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=i?n:"[*+-]");let c=this.rules.other.listItemRegex(n),s=!1;for(;t;){let d=!1,g="",h="";if(!(o=c.exec(t))||this.rules.block.hr.test(t))break;g=o[0],t=t.substring(g.length);let w=pm(o[2].split(`
|
|
81
83
|
`,1)[0],o[1].length),C=t.split(`
|
|
82
|
-
`,1)[0]
|
|
83
|
-
`,t=t.substring(C.length+1),d=!0),!d){let
|
|
84
|
-
`,1)[0],
|
|
85
|
-
`+
|
|
86
|
-
`+C}
|
|
87
|
-
`,t=t.substring(
|
|
88
|
-
`),href:i,title:a}}}table(t){var s;let o=this.rules.block.table.exec(t);if(!o||!this.rules.other.tableDelimiter.test(o[2]))return;let n=
|
|
89
|
-
`):[],c={type:"table",raw:
|
|
90
|
-
`),header:[],align:[],rows:[]};if(n.length===i.length){for(let u of i)this.rules.other.tableAlignRight.test(u)?c.align.push("right"):this.rules.other.tableAlignCenter.test(u)?c.align.push("center"):this.rules.other.tableAlignLeft.test(u)?c.align.push("left"):c.align.push(null);for(let u=0;u<n.length;u++)c.header.push({text:n[u],tokens:this.lexer.inline(n[u]),header:!0,align:c.align[u]});for(let u of a)c.rows.push(
|
|
84
|
+
`,1)[0],P=!w.trim(),R=0;if(this.options.pedantic?(R=2,h=w.trimStart()):P?R=o[1].length+1:(R=w.search(this.rules.other.nonSpaceChar),R=R>4?1:R,h=w.slice(R),R+=o[1].length),P&&this.rules.other.blankLine.test(C)&&(g+=C+`
|
|
85
|
+
`,t=t.substring(C.length+1),d=!0),!d){let U=this.rules.other.nextBulletRegex(R),I=this.rules.other.hrRegex(R),A=this.rules.other.fencesBeginRegex(R),x=this.rules.other.headingBeginRegex(R),k=this.rules.other.htmlBeginRegex(R),m=this.rules.other.blockquoteBeginRegex(R);for(;t;){let F=t.split(`
|
|
86
|
+
`,1)[0],W;if(C=F,this.options.pedantic?(C=C.replace(this.rules.other.listReplaceNesting," "),W=C):W=C.replace(this.rules.other.tabCharGlobal," "),A.test(C)||x.test(C)||k.test(C)||m.test(C)||U.test(C)||I.test(C))break;if(W.search(this.rules.other.nonSpaceChar)>=R||!C.trim())h+=`
|
|
87
|
+
`+W.slice(R);else{if(P||w.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||A.test(w)||x.test(w)||I.test(w))break;h+=`
|
|
88
|
+
`+C}P=!C.trim(),g+=F+`
|
|
89
|
+
`,t=t.substring(F.length+1),w=W.slice(R)}}a.loose||(s?a.loose=!0:this.rules.other.doubleBlankLine.test(g)&&(s=!0)),a.items.push({type:"list_item",raw:g,task:!!this.options.gfm&&this.rules.other.listIsTask.test(h),loose:!1,text:h,tokens:[]}),a.raw+=g}let u=a.items.at(-1);if(u)u.raw=u.raw.trimEnd(),u.text=u.text.trimEnd();else return;a.raw=a.raw.trimEnd();for(let d of a.items){this.lexer.state.top=!1,d.tokens=this.lexer.blockTokens(d.text,[]);let g=d.tokens[0];if(d.task&&((g==null?void 0:g.type)==="text"||(g==null?void 0:g.type)==="paragraph")){d.text=d.text.replace(this.rules.other.listReplaceTask,""),g.raw=g.raw.replace(this.rules.other.listReplaceTask,""),g.text=g.text.replace(this.rules.other.listReplaceTask,"");for(let w=this.lexer.inlineQueue.length-1;w>=0;w--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[w].src)){this.lexer.inlineQueue[w].src=this.lexer.inlineQueue[w].src.replace(this.rules.other.listReplaceTask,"");break}let h=this.rules.other.listTaskCheckbox.exec(d.raw);if(h){let w={type:"checkbox",raw:h[0]+" ",checked:h[0]!=="[ ]"};d.checked=w.checked,a.loose?d.tokens[0]&&["paragraph","text"].includes(d.tokens[0].type)&&"tokens"in d.tokens[0]&&d.tokens[0].tokens?(d.tokens[0].raw=w.raw+d.tokens[0].raw,d.tokens[0].text=w.raw+d.tokens[0].text,d.tokens[0].tokens.unshift(w)):d.tokens.unshift({type:"paragraph",raw:w.raw,text:w.raw,tokens:[w]}):d.tokens.unshift(w)}}else d.task&&(d.task=!1);if(!a.loose){let h=d.tokens.filter(C=>C.type==="space"),w=h.length>0&&h.some(C=>this.rules.other.anyLine.test(C.raw));a.loose=w}}if(a.loose)for(let d of a.items){d.loose=!0;for(let g of d.tokens)g.type==="text"&&(g.type="paragraph")}return a}}html(t){let o=this.rules.block.html.exec(t);if(o){let n=Cl(o[0]);return{type:"html",block:!0,raw:n,pre:o[1]==="pre"||o[1]==="script"||o[1]==="style",text:n}}}def(t){let o=this.rules.block.def.exec(t);if(o){let n=o[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),i=o[2]?o[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",a=o[3]?o[3].substring(1,o[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):o[3];return{type:"def",tag:n,raw:mn(o[0],`
|
|
90
|
+
`),href:i,title:a}}}table(t){var s;let o=this.rules.block.table.exec(t);if(!o||!this.rules.other.tableDelimiter.test(o[2]))return;let n=Tl(o[1]),i=o[2].replace(this.rules.other.tableAlignChars,"").split("|"),a=(s=o[3])!=null&&s.trim()?o[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
91
|
+
`):[],c={type:"table",raw:mn(o[0],`
|
|
92
|
+
`),header:[],align:[],rows:[]};if(n.length===i.length){for(let u of i)this.rules.other.tableAlignRight.test(u)?c.align.push("right"):this.rules.other.tableAlignCenter.test(u)?c.align.push("center"):this.rules.other.tableAlignLeft.test(u)?c.align.push("left"):c.align.push(null);for(let u=0;u<n.length;u++)c.header.push({text:n[u],tokens:this.lexer.inline(n[u]),header:!0,align:c.align[u]});for(let u of a)c.rows.push(Tl(u,c.header.length).map((d,g)=>({text:d,tokens:this.lexer.inline(d),header:!1,align:c.align[g]})));return c}}lheading(t){let o=this.rules.block.lheading.exec(t);if(o){let n=o[1].trim();return{type:"heading",raw:mn(o[0],`
|
|
91
93
|
`),depth:o[2].charAt(0)==="="?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(t){let o=this.rules.block.paragraph.exec(t);if(o){let n=o[1].charAt(o[1].length-1)===`
|
|
92
|
-
`?o[1].slice(0,-1):o[1];return{type:"paragraph",raw:o[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let o=this.rules.block.text.exec(t);if(o)return{type:"text",raw:o[0],text:o[0],tokens:this.lexer.inline(o[0])}}escape(t){let o=this.rules.inline.escape.exec(t);if(o)return{type:"escape",raw:o[0],text:o[1]}}tag(t){let o=this.rules.inline.tag.exec(t);if(o)return!this.lexer.state.inLink&&this.rules.other.startATag.test(o[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(o[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(o[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(o[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:o[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:o[0]}}link(t){let o=this.rules.inline.link.exec(t);if(o){let n=o[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let c=
|
|
93
|
-
`),this.blockTokens(o,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let i=this.inlineQueue[n];this.inlineTokens(i.src,i.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(o,n=[],i=!1){var c,s,u;this.tokenizer.lexer=this,this.options.pedantic&&(o=o.replace(
|
|
94
|
+
`?o[1].slice(0,-1):o[1];return{type:"paragraph",raw:o[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let o=this.rules.block.text.exec(t);if(o)return{type:"text",raw:o[0],text:o[0],tokens:this.lexer.inline(o[0])}}escape(t){let o=this.rules.inline.escape.exec(t);if(o)return{type:"escape",raw:o[0],text:o[1]}}tag(t){let o=this.rules.inline.tag.exec(t);if(o)return!this.lexer.state.inLink&&this.rules.other.startATag.test(o[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(o[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(o[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(o[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:o[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:o[0]}}link(t){let o=this.rules.inline.link.exec(t);if(o){let n=o[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let c=mn(n.slice(0,-1),"\\");if((n.length-c.length)%2===0)return}else{let c=mm(o[2],"()");if(c===-2)return;if(c>-1){let s=(o[0].indexOf("!")===0?5:4)+o[1].length+c;o[2]=o[2].substring(0,c),o[0]=o[0].substring(0,s).trim(),o[3]=""}}let i=o[2],a="";if(this.options.pedantic){let c=this.rules.other.pedanticHrefTitle.exec(i);c&&(i=c[1],a=c[3])}else a=o[3]?o[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?i=i.slice(1):i=i.slice(1,-1)),Ml(o,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},o[0],this.lexer,this.rules)}}reflink(t,o){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let i=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),a=o[i.toLowerCase()];if(!a){let c=n[0].charAt(0);return{type:"text",raw:c,text:c}}return Ml(n,a,n[0],this.lexer,this.rules)}}emStrong(t,o,n=""){let i=this.rules.inline.emStrongLDelim.exec(t);if(!(!i||!i[1]&&!i[2]&&!i[3]&&!i[4]||i[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(i[1]||i[3])||!n||this.rules.inline.punctuation.exec(n))){let a=[...i[0]].length-1,c,s,u=a,d=0,g=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(g.lastIndex=0,o=o.slice(-1*t.length+a);(i=g.exec(o))!==null;){if(c=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!c)continue;if(s=[...c].length,i[3]||i[4]){u+=s;continue}else if((i[5]||i[6])&&a%3&&!((a+s)%3)){d+=s;continue}if(u-=s,u>0)continue;s=Math.min(s,s+u+d);let h=[...i[0]][0].length,w=t.slice(0,a+i.index+h+s);if(Math.min(a,s)%2){let P=w.slice(1,-1);return{type:"em",raw:w,text:P,tokens:this.lexer.inlineTokens(P)}}let C=w.slice(2,-2);return{type:"strong",raw:w,text:C,tokens:this.lexer.inlineTokens(C)}}}}codespan(t){let o=this.rules.inline.code.exec(t);if(o){let n=o[2].replace(this.rules.other.newLineCharGlobal," "),i=this.rules.other.nonSpaceChar.test(n),a=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return i&&a&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:o[0],text:n}}}br(t){let o=this.rules.inline.br.exec(t);if(o)return{type:"br",raw:o[0]}}del(t,o,n=""){let i=this.rules.inline.delLDelim.exec(t);if(i&&(!i[1]||!n||this.rules.inline.punctuation.exec(n))){let a=[...i[0]].length-1,c,s,u=a,d=this.rules.inline.delRDelim;for(d.lastIndex=0,o=o.slice(-1*t.length+a);(i=d.exec(o))!==null;){if(c=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!c||(s=[...c].length,s!==a))continue;if(i[3]||i[4]){u+=s;continue}if(u-=s,u>0)continue;s=Math.min(s,s+u);let g=[...i[0]][0].length,h=t.slice(0,a+i.index+g+s),w=h.slice(a,-a);return{type:"del",raw:h,text:w,tokens:this.lexer.inlineTokens(w)}}}}autolink(t){let o=this.rules.inline.autolink.exec(t);if(o){let n,i;return o[2]==="@"?(n=o[1],i="mailto:"+n):(n=o[1],i=n),{type:"link",raw:o[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}url(t){var n;let o;if(o=this.rules.inline.url.exec(t)){let i,a;if(o[2]==="@")i=o[0],a="mailto:"+i;else{let c;do c=o[0],o[0]=((n=this.rules.inline._backpedal.exec(o[0]))==null?void 0:n[0])??"";while(c!==o[0]);i=o[0],o[1]==="www."?a="http://"+o[0]:a=o[0]}return{type:"link",raw:o[0],text:i,href:a,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(t){let o=this.rules.inline.text.exec(t);if(o){let n=this.lexer.state.inRawBlock;return{type:"text",raw:o[0],text:o[0],escaped:n}}}},jt=class or{constructor(o){Ve(this,"tokens");Ve(this,"options");Ve(this,"state");Ve(this,"inlineQueue");Ve(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=o||Nn,this.options.tokenizer=this.options.tokenizer||new Xo,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:mt,block:qo.normal,inline:so.normal};this.options.pedantic?(n.block=qo.pedantic,n.inline=so.pedantic):this.options.gfm&&(n.block=qo.gfm,this.options.breaks?n.inline=so.breaks:n.inline=so.gfm),this.tokenizer.rules=n}static get rules(){return{block:qo,inline:so}}static lex(o,n){return new or(n).lex(o)}static lexInline(o,n){return new or(n).inlineTokens(o)}lex(o){o=o.replace(mt.carriageReturn,`
|
|
95
|
+
`),this.blockTokens(o,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let i=this.inlineQueue[n];this.inlineTokens(i.src,i.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(o,n=[],i=!1){var c,s,u;this.tokenizer.lexer=this,this.options.pedantic&&(o=o.replace(mt.tabCharGlobal," ").replace(mt.spaceLine,""));let a=1/0;for(;o;){if(o.length<a)a=o.length;else{this.infiniteLoopError(o.charCodeAt(0));break}let d;if((s=(c=this.options.extensions)==null?void 0:c.block)!=null&&s.some(h=>(d=h.call({lexer:this},o,n))?(o=o.substring(d.raw.length),n.push(d),!0):!1))continue;if(d=this.tokenizer.space(o)){o=o.substring(d.raw.length);let h=n.at(-1);d.raw.length===1&&h!==void 0?h.raw+=`
|
|
94
96
|
`:n.push(d);continue}if(d=this.tokenizer.code(o)){o=o.substring(d.raw.length);let h=n.at(-1);(h==null?void 0:h.type)==="paragraph"||(h==null?void 0:h.type)==="text"?(h.raw+=(h.raw.endsWith(`
|
|
95
97
|
`)?"":`
|
|
96
98
|
`)+d.raw,h.text+=`
|
|
97
99
|
`+d.text,this.inlineQueue.at(-1).src=h.text):n.push(d);continue}if(d=this.tokenizer.fences(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.heading(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.hr(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.blockquote(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.list(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.html(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.def(o)){o=o.substring(d.raw.length);let h=n.at(-1);(h==null?void 0:h.type)==="paragraph"||(h==null?void 0:h.type)==="text"?(h.raw+=(h.raw.endsWith(`
|
|
98
100
|
`)?"":`
|
|
99
101
|
`)+d.raw,h.text+=`
|
|
100
|
-
`+d.raw,this.inlineQueue.at(-1).src=h.text):this.tokens.links[d.tag]||(this.tokens.links[d.tag]={href:d.href,title:d.title},n.push(d));continue}if(d=this.tokenizer.table(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.lheading(o)){o=o.substring(d.raw.length),n.push(d);continue}let g=o;if((u=this.options.extensions)!=null&&u.startBlock){let h=1/0,
|
|
102
|
+
`+d.raw,this.inlineQueue.at(-1).src=h.text):this.tokens.links[d.tag]||(this.tokens.links[d.tag]={href:d.href,title:d.title},n.push(d));continue}if(d=this.tokenizer.table(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.lheading(o)){o=o.substring(d.raw.length),n.push(d);continue}let g=o;if((u=this.options.extensions)!=null&&u.startBlock){let h=1/0,w=o.slice(1),C;this.options.extensions.startBlock.forEach(P=>{C=P.call({lexer:this},w),typeof C=="number"&&C>=0&&(h=Math.min(h,C))}),h<1/0&&h>=0&&(g=o.substring(0,h+1))}if(this.state.top&&(d=this.tokenizer.paragraph(g))){let h=n.at(-1);i&&(h==null?void 0:h.type)==="paragraph"?(h.raw+=(h.raw.endsWith(`
|
|
101
103
|
`)?"":`
|
|
102
104
|
`)+d.raw,h.text+=`
|
|
103
105
|
`+d.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=h.text):n.push(d),i=g.length!==o.length,o=o.substring(d.raw.length);continue}if(d=this.tokenizer.text(o)){o=o.substring(d.raw.length);let h=n.at(-1);(h==null?void 0:h.type)==="text"?(h.raw+=(h.raw.endsWith(`
|
|
104
106
|
`)?"":`
|
|
105
107
|
`)+d.raw,h.text+=`
|
|
106
|
-
`+d.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=h.text):n.push(d);continue}if(o){this.infiniteLoopError(o.charCodeAt(0));break}}return this.state.top=!0,n}inline(o,n=[]){return this.inlineQueue.push({src:o,tokens:n}),n}inlineTokens(o,n=[]){var g,h,
|
|
108
|
+
`+d.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=h.text):n.push(d);continue}if(o){this.infiniteLoopError(o.charCodeAt(0));break}}return this.state.top=!0,n}inline(o,n=[]){return this.inlineQueue.push({src:o,tokens:n}),n}inlineTokens(o,n=[]){var g,h,w,C,P;this.tokenizer.lexer=this;let i=o,a=null;if(this.tokens.links){let R=Object.keys(this.tokens.links);if(R.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(i))!==null;)R.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.anyPunctuation.exec(i))!==null;)i=i.slice(0,a.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let c;for(;(a=this.tokenizer.rules.inline.blockSkip.exec(i))!==null;)c=a[2]?a[2].length:0,i=i.slice(0,a.index+c)+"["+"a".repeat(a[0].length-c-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);i=((h=(g=this.options.hooks)==null?void 0:g.emStrongMask)==null?void 0:h.call({lexer:this},i))??i;let s=!1,u="",d=1/0;for(;o;){if(o.length<d)d=o.length;else{this.infiniteLoopError(o.charCodeAt(0));break}s||(u=""),s=!1;let R;if((C=(w=this.options.extensions)==null?void 0:w.inline)!=null&&C.some(I=>(R=I.call({lexer:this},o,n))?(o=o.substring(R.raw.length),n.push(R),!0):!1))continue;if(R=this.tokenizer.escape(o)){o=o.substring(R.raw.length),n.push(R);continue}if(R=this.tokenizer.tag(o)){o=o.substring(R.raw.length),n.push(R);continue}if(R=this.tokenizer.link(o)){o=o.substring(R.raw.length),n.push(R);continue}if(R=this.tokenizer.reflink(o,this.tokens.links)){o=o.substring(R.raw.length);let I=n.at(-1);R.type==="text"&&(I==null?void 0:I.type)==="text"?(I.raw+=R.raw,I.text+=R.text):n.push(R);continue}if(R=this.tokenizer.emStrong(o,i,u)){o=o.substring(R.raw.length),n.push(R);continue}if(R=this.tokenizer.codespan(o)){o=o.substring(R.raw.length),n.push(R);continue}if(R=this.tokenizer.br(o)){o=o.substring(R.raw.length),n.push(R);continue}if(R=this.tokenizer.del(o,i,u)){o=o.substring(R.raw.length),n.push(R);continue}if(R=this.tokenizer.autolink(o)){o=o.substring(R.raw.length),n.push(R);continue}if(!this.state.inLink&&(R=this.tokenizer.url(o))){o=o.substring(R.raw.length),n.push(R);continue}let U=o;if((P=this.options.extensions)!=null&&P.startInline){let I=1/0,A=o.slice(1),x;this.options.extensions.startInline.forEach(k=>{x=k.call({lexer:this},A),typeof x=="number"&&x>=0&&(I=Math.min(I,x))}),I<1/0&&I>=0&&(U=o.substring(0,I+1))}if(R=this.tokenizer.inlineText(U)){o=o.substring(R.raw.length),R.raw.slice(-1)!=="_"&&(u=R.raw.slice(-1)),s=!0;let I=n.at(-1);(I==null?void 0:I.type)==="text"?(I.raw+=R.raw,I.text+=R.text):n.push(R);continue}if(o){this.infiniteLoopError(o.charCodeAt(0));break}}return n}infiniteLoopError(o){let n="Infinite loop on byte: "+o;if(this.options.silent)console.error(n);else throw new Error(n)}},co=class{constructor(t){Ve(this,"options");Ve(this,"parser");this.options=t||Nn}space(t){return""}code({text:t,lang:o,escaped:n}){var c;let i=(c=(o||"").match(mt.notSpaceStart))==null?void 0:c[0],a=t.replace(mt.endingNewline,"")+`
|
|
107
109
|
`;return i?'<pre><code class="language-'+Zt(i)+'">'+(n?a:Zt(a,!0))+`</code></pre>
|
|
108
110
|
`:"<pre><code>"+(n?a:Zt(a,!0))+`</code></pre>
|
|
109
111
|
`}blockquote({tokens:t}){return`<blockquote>
|
|
@@ -121,18 +123,20 @@ ${this.parser.parse(t)}</blockquote>
|
|
|
121
123
|
`}tablerow({text:t}){return`<tr>
|
|
122
124
|
${t}</tr>
|
|
123
125
|
`}tablecell(t){let o=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+o+`</${n}>
|
|
124
|
-
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${Zt(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:o,tokens:n}){let i=this.parser.parseInline(n),a=
|
|
125
|
-
Please report this to https://github.com/markedjs/marked.`,t){let i="<p>An error occurred:</p><pre>"+Zt(n.message+"",!0)+"</pre>";return o?Promise.resolve(i):i}if(o)return Promise.reject(n);throw n}}},
|
|
126
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function em(t,o){return Zf(t)||Jf(t,o)||tm(t,o)||Qf()}function tm(t,o){if(t){if(typeof t=="string")return Tl(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)?Tl(t,o):void 0}}const Al=Object.entries,_l=Object.setPrototypeOf,nm=Object.isFrozen,om=Object.getPrototypeOf,im=Object.getOwnPropertyDescriptor;let Nt=Object.freeze,Vt=Object.seal,Pn=Object.create,Ml=typeof Reflect<"u"&&Reflect,Vi=Ml.apply,$i=Ml.construct;Nt||(Nt=function(o){return o}),Vt||(Vt=function(o){return o}),Vi||(Vi=function(o,n){for(var i=arguments.length,a=new Array(i>2?i-2:0),c=2;c<i;c++)a[c-2]=arguments[c];return o.apply(n,a)}),$i||($i=function(o){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];return new o(...i)});const Tn=et(Array.prototype.forEach),rm=et(Array.prototype.lastIndexOf),Rl=et(Array.prototype.pop),Fn=et(Array.prototype.push),lm=et(Array.prototype.splice),St=Array.isArray,fo=et(String.prototype.toLowerCase),Pi=et(String.prototype.toString),vl=et(String.prototype.match),Un=et(String.prototype.replace),Bl=et(String.prototype.indexOf),am=et(String.prototype.trim),sm=et(Number.prototype.toString),cm=et(Boolean.prototype.toString),Il=typeof BigInt>"u"?null:et(BigInt.prototype.toString),zl=typeof Symbol>"u"?null:et(Symbol.prototype.toString),je=et(Object.prototype.hasOwnProperty),mo=et(Object.prototype.toString),dt=et(RegExp.prototype.test),Hn=dm(TypeError);function et(t){return function(o){o instanceof RegExp&&(o.lastIndex=0);for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];return Vi(t,o,i)}}function dm(t){return function(){for(var o=arguments.length,n=new Array(o),i=0;i<o;i++)n[i]=arguments[i];return $i(t,n)}}function ge(t,o){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:fo;if(_l&&_l(t,null),!St(o))return t;let i=o.length;for(;i--;){let a=o[i];if(typeof a=="string"){const c=n(a);c!==a&&(nm(o)||(o[i]=c),a=c)}t[a]=!0}return t}function um(t){for(let o=0;o<t.length;o++)je(t,o)||(t[o]=null);return t}function bt(t){const o=Pn(null);for(const i of Al(t)){var n=em(i,2);const a=n[0],c=n[1];je(t,a)&&(St(c)?o[a]=um(c):c&&typeof c=="object"&&c.constructor===Object?o[a]=bt(c):o[a]=c)}return o}function fm(t){switch(typeof t){case"string":return t;case"number":return sm(t);case"boolean":return cm(t);case"bigint":return Il?Il(t):"0";case"symbol":return zl?zl(t):"Symbol()";case"undefined":return mo(t);case"function":case"object":{if(t===null)return mo(t);const o=t,n=Jt(o,"toString");if(typeof n=="function"){const i=n(o);return typeof i=="string"?i:mo(i)}return mo(t)}default:return mo(t)}}function Jt(t,o){for(;t!==null;){const i=im(t,o);if(i){if(i.get)return et(i.get);if(typeof i.value=="function")return et(i.value)}t=om(t)}function n(){return null}return n}function mm(t){try{return dt(t,""),!0}catch{return!1}}const Ol=Nt(["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"]),Fi=Nt(["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"]),Ui=Nt(["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"]),pm=Nt(["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"]),Hi=Nt(["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"]),gm=Nt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Ll=Nt(["#text"]),Dl=Nt(["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"]),Wi=Nt(["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"]),Vl=Nt(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Zo=Nt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),hm=Vt(/{{[\w\W]*|^[\w\W]*}}/g),bm=Vt(/<%[\w\W]*|^[\w\W]*%>/g),km=Vt(/\${[\w\W]*/g),ym=Vt(/^data-[\-\w.\u00B7-\uFFFF]+$/),Em=Vt(/^aria-[\-\w]+$/),$l=Vt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),xm=Vt(/^(?:\w+script|data):/i),wm=Vt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Nm=Vt(/^html$/i),Sm=Vt(/^[a-z][.\w]*(-[.\w]+)+$/i),Qt={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Cm=function(){return typeof window>"u"?null:window},Tm=function(o,n){if(typeof o!="object"||typeof o.createPolicy!="function")return null;let i=null;const a="data-tt-policy-suffix";n&&n.hasAttribute(a)&&(i=n.getAttribute(a));const c="dompurify"+(i?"#"+i:"");try{return o.createPolicy(c,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+c+" could not be created."),null}},Pl=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Fl(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Cm();const o=v=>Fl(v);if(o.version="3.4.8",o.removed=[],!t||!t.document||t.document.nodeType!==Qt.document||!t.Element)return o.isSupported=!1,o;let n=t.document;const i=n,a=i.currentScript;t.DocumentFragment;const c=t.HTMLTemplateElement,s=t.Node,u=t.Element,d=t.NodeFilter,g=t.NamedNodeMap;g===void 0&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const h=t.DOMParser,N=t.trustedTypes,C=u.prototype,$=Jt(C,"cloneNode"),R=Jt(C,"remove"),F=Jt(C,"nextSibling"),B=Jt(C,"childNodes"),_=Jt(C,"parentNode"),x=Jt(C,"shadowRoot"),k=Jt(C,"attributes"),m=s&&s.prototype?Jt(s.prototype,"nodeType"):null,P=s&&s.prototype?Jt(s.prototype,"nodeName"):null;if(typeof c=="function"){const v=n.createElement("template");v.content&&v.content.ownerDocument&&(n=v.content.ownerDocument)}let L,S="",K=0;const J=function(b){if(K>0)throw Hn('The configured TRUSTED_TYPES_POLICY.createHTML must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose createHTML wraps DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.');K++;try{return L.createHTML(b)}finally{K--}},de=n,ee=de.implementation,Y=de.createNodeIterator,oe=de.createDocumentFragment,ie=de.getElementsByTagName,ye=i.importNode;let y=Pl();o.isSupported=typeof Al=="function"&&typeof _=="function"&&ee&&ee.createHTMLDocument!==void 0;const V=hm,U=bm,j=km,ae=ym,Me=Em,ze=xm,De=wm,Ae=Sm;let E=$l,p=null;const O=ge({},[...Ol,...Fi,...Ui,...Hi,...Ll]);let D=null;const X=ge({},[...Dl,...Wi,...Vl,...Zo]);let ue=Object.seal(Pn(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}})),Ee=null,tt=null;const Ke=Object.seal(Pn(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let it=!0,nt=!0,rn=!1,$t=!0,Q=!1,kt=!0,ve=!1,Re=!1,Pt=!1,rt=!1,At=!1,Ct=!1,H=!0,Z=!1;const fe="user-content-";let Se=!0,Ue=!1,lt={},_t=null;const _n=ge({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let ti=null;const ni=ge({},["audio","video","img","source","image","track"]);let po=null;const oi=ge({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Gn="http://www.w3.org/1998/Math/MathML",jn="http://www.w3.org/2000/svg",Ft="http://www.w3.org/1999/xhtml";let mn=Ft,go=!1,ho=null;const Gi=ge({},[Gn,jn,Ft],Pi);let bo=ge({},["mi","mo","mn","ms","mtext"]),ko=ge({},["annotation-xml"]);const ji=ge({},["title","style","font","a","script"]);let Mn=null;const ii=["application/xhtml+xml","text/html"],Ki="text/html";let He=null,pn=null;const ri=n.createElement("form"),li=function(b){return b instanceof RegExp||b instanceof Function},Kn=function(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(pn&&pn===b)return;(!b||typeof b!="object")&&(b={}),b=bt(b),Mn=ii.indexOf(b.PARSER_MEDIA_TYPE)===-1?Ki:b.PARSER_MEDIA_TYPE,He=Mn==="application/xhtml+xml"?Pi:fo,p=je(b,"ALLOWED_TAGS")&&St(b.ALLOWED_TAGS)?ge({},b.ALLOWED_TAGS,He):O,D=je(b,"ALLOWED_ATTR")&&St(b.ALLOWED_ATTR)?ge({},b.ALLOWED_ATTR,He):X,ho=je(b,"ALLOWED_NAMESPACES")&&St(b.ALLOWED_NAMESPACES)?ge({},b.ALLOWED_NAMESPACES,Pi):Gi,po=je(b,"ADD_URI_SAFE_ATTR")&&St(b.ADD_URI_SAFE_ATTR)?ge(bt(oi),b.ADD_URI_SAFE_ATTR,He):oi,ti=je(b,"ADD_DATA_URI_TAGS")&&St(b.ADD_DATA_URI_TAGS)?ge(bt(ni),b.ADD_DATA_URI_TAGS,He):ni,_t=je(b,"FORBID_CONTENTS")&&St(b.FORBID_CONTENTS)?ge({},b.FORBID_CONTENTS,He):_n,Ee=je(b,"FORBID_TAGS")&&St(b.FORBID_TAGS)?ge({},b.FORBID_TAGS,He):bt({}),tt=je(b,"FORBID_ATTR")&&St(b.FORBID_ATTR)?ge({},b.FORBID_ATTR,He):bt({}),lt=je(b,"USE_PROFILES")?b.USE_PROFILES&&typeof b.USE_PROFILES=="object"?bt(b.USE_PROFILES):b.USE_PROFILES:!1,it=b.ALLOW_ARIA_ATTR!==!1,nt=b.ALLOW_DATA_ATTR!==!1,rn=b.ALLOW_UNKNOWN_PROTOCOLS||!1,$t=b.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Q=b.SAFE_FOR_TEMPLATES||!1,kt=b.SAFE_FOR_XML!==!1,ve=b.WHOLE_DOCUMENT||!1,rt=b.RETURN_DOM||!1,At=b.RETURN_DOM_FRAGMENT||!1,Ct=b.RETURN_TRUSTED_TYPE||!1,Pt=b.FORCE_BODY||!1,H=b.SANITIZE_DOM!==!1,Z=b.SANITIZE_NAMED_PROPS||!1,Se=b.KEEP_CONTENT!==!1,Ue=b.IN_PLACE||!1,E=mm(b.ALLOWED_URI_REGEXP)?b.ALLOWED_URI_REGEXP:$l,mn=typeof b.NAMESPACE=="string"?b.NAMESPACE:Ft,bo=je(b,"MATHML_TEXT_INTEGRATION_POINTS")&&b.MATHML_TEXT_INTEGRATION_POINTS&&typeof b.MATHML_TEXT_INTEGRATION_POINTS=="object"?bt(b.MATHML_TEXT_INTEGRATION_POINTS):ge({},["mi","mo","mn","ms","mtext"]),ko=je(b,"HTML_INTEGRATION_POINTS")&&b.HTML_INTEGRATION_POINTS&&typeof b.HTML_INTEGRATION_POINTS=="object"?bt(b.HTML_INTEGRATION_POINTS):ge({},["annotation-xml"]);const I=je(b,"CUSTOM_ELEMENT_HANDLING")&&b.CUSTOM_ELEMENT_HANDLING&&typeof b.CUSTOM_ELEMENT_HANDLING=="object"?bt(b.CUSTOM_ELEMENT_HANDLING):Pn(null);if(ue=Pn(null),je(I,"tagNameCheck")&&li(I.tagNameCheck)&&(ue.tagNameCheck=I.tagNameCheck),je(I,"attributeNameCheck")&&li(I.attributeNameCheck)&&(ue.attributeNameCheck=I.attributeNameCheck),je(I,"allowCustomizedBuiltInElements")&&typeof I.allowCustomizedBuiltInElements=="boolean"&&(ue.allowCustomizedBuiltInElements=I.allowCustomizedBuiltInElements),Q&&(nt=!1),At&&(rt=!0),lt&&(p=ge({},Ll),D=Pn(null),lt.html===!0&&(ge(p,Ol),ge(D,Dl)),lt.svg===!0&&(ge(p,Fi),ge(D,Wi),ge(D,Zo)),lt.svgFilters===!0&&(ge(p,Ui),ge(D,Wi),ge(D,Zo)),lt.mathMl===!0&&(ge(p,Hi),ge(D,Vl),ge(D,Zo))),Ke.tagCheck=null,Ke.attributeCheck=null,je(b,"ADD_TAGS")&&(typeof b.ADD_TAGS=="function"?Ke.tagCheck=b.ADD_TAGS:St(b.ADD_TAGS)&&(p===O&&(p=bt(p)),ge(p,b.ADD_TAGS,He))),je(b,"ADD_ATTR")&&(typeof b.ADD_ATTR=="function"?Ke.attributeCheck=b.ADD_ATTR:St(b.ADD_ATTR)&&(D===X&&(D=bt(D)),ge(D,b.ADD_ATTR,He))),je(b,"ADD_URI_SAFE_ATTR")&&St(b.ADD_URI_SAFE_ATTR)&&ge(po,b.ADD_URI_SAFE_ATTR,He),je(b,"FORBID_CONTENTS")&&St(b.FORBID_CONTENTS)&&(_t===_n&&(_t=bt(_t)),ge(_t,b.FORBID_CONTENTS,He)),je(b,"ADD_FORBID_CONTENTS")&&St(b.ADD_FORBID_CONTENTS)&&(_t===_n&&(_t=bt(_t)),ge(_t,b.ADD_FORBID_CONTENTS,He)),Se&&(p["#text"]=!0),ve&&ge(p,["html","head","body"]),p.table&&(ge(p,["tbody"]),delete Ee.tbody),b.TRUSTED_TYPES_POLICY){if(typeof b.TRUSTED_TYPES_POLICY.createHTML!="function")throw Hn('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof b.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Hn('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const G=L;L=b.TRUSTED_TYPES_POLICY;try{S=J("")}catch(_e){throw L=G,_e}}else L===void 0&&b.TRUSTED_TYPES_POLICY!==null&&(L=Tm(N,a)),L&&typeof S=="string"&&(S=J(""));(y.uponSanitizeElement.length>0||y.uponSanitizeAttribute.length>0)&&p===O&&(p=bt(p)),y.uponSanitizeAttribute.length>0&&D===X&&(D=bt(D)),Nt&&Nt(b),pn=b},yo=ge({},[...Fi,...Ui,...pm]),gn=ge({},[...Hi,...gm]),Yi=function(b){let I=_(b);(!I||!I.tagName)&&(I={namespaceURI:mn,tagName:"template"});const G=fo(b.tagName),_e=fo(I.tagName);return ho[b.namespaceURI]?b.namespaceURI===jn?I.namespaceURI===Ft?G==="svg":I.namespaceURI===Gn?G==="svg"&&(_e==="annotation-xml"||bo[_e]):!!yo[G]:b.namespaceURI===Gn?I.namespaceURI===Ft?G==="math":I.namespaceURI===jn?G==="math"&&ko[_e]:!!gn[G]:b.namespaceURI===Ft?I.namespaceURI===jn&&!ko[_e]||I.namespaceURI===Gn&&!bo[_e]?!1:!gn[G]&&(ji[G]||!yo[G]):!!(Mn==="application/xhtml+xml"&&ho[b.namespaceURI]):!1},Mt=function(b){Fn(o.removed,{element:b});try{_(b).removeChild(b)}catch{R(b)}},en=function(b,I){try{Fn(o.removed,{attribute:I.getAttributeNode(b),from:I})}catch{Fn(o.removed,{attribute:null,from:I})}if(I.removeAttribute(b),b==="is")if(rt||At)try{Mt(I)}catch{}else try{I.setAttribute(b,"")}catch{}},Eo=function(b){let I=null,G=null;if(Pt)b="<remove></remove>"+b;else{const Be=vl(b,/^[\r\n\t ]+/);G=Be&&Be[0]}Mn==="application/xhtml+xml"&&mn===Ft&&(b='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+b+"</body></html>");const _e=L?J(b):b;if(mn===Ft)try{I=new h().parseFromString(_e,Mn)}catch{}if(!I||!I.documentElement){I=ee.createDocument(mn,"template",null);try{I.documentElement.innerHTML=go?S:_e}catch{}}const he=I.body||I.documentElement;return b&&G&&he.insertBefore(n.createTextNode(G),he.childNodes[0]||null),mn===Ft?ie.call(I,ve?"html":"body")[0]:ve?I.documentElement:he},Yn=function(b){return Y.call(b.ownerDocument||b,b,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},Rn=function(b){var I,G;b.normalize();const _e=Y.call(b.ownerDocument||b,b,d.SHOW_TEXT|d.SHOW_COMMENT|d.SHOW_CDATA_SECTION|d.SHOW_PROCESSING_INSTRUCTION,null);let he=_e.nextNode();for(;he;){let Ye=he.data;Tn([V,U,j],ft=>{Ye=Un(Ye,ft," ")}),he.data=Ye,he=_e.nextNode()}const Be=(I=(G=b.querySelectorAll)===null||G===void 0?void 0:G.call(b,"template"))!==null&&I!==void 0?I:[];Tn(Array.from(Be),Ye=>{hn(Ye.content)&&Rn(Ye.content)})},qn=function(b){const I=P?P(b):null;return typeof I!="string"||He(I)!=="form"?!1:typeof b.nodeName!="string"||typeof b.textContent!="string"||typeof b.removeChild!="function"||b.attributes!==k(b)||typeof b.removeAttribute!="function"||typeof b.setAttribute!="function"||typeof b.namespaceURI!="string"||typeof b.insertBefore!="function"||typeof b.hasChildNodes!="function"||b.nodeType!==m(b)||b.childNodes!==B(b)},hn=function(b){if(!m||typeof b!="object"||b===null)return!1;try{return m(b)===Qt.documentFragment}catch{return!1}},Xn=function(b){if(!m||typeof b!="object"||b===null)return!1;try{return typeof m(b)=="number"}catch{return!1}};function Rt(v,b,I){Tn(v,G=>{G.call(o,b,I,pn)})}const Zn=function(b){let I=null;if(Rt(y.beforeSanitizeElements,b,null),qn(b))return Mt(b),!0;const G=He(P?P(b):b.nodeName);if(Rt(y.uponSanitizeElement,b,{tagName:G,allowedTags:p}),kt&&b.hasChildNodes()&&!Xn(b.firstElementChild)&&dt(/<[/\w!]/g,b.innerHTML)&&dt(/<[/\w!]/g,b.textContent)||kt&&b.namespaceURI===Ft&&G==="style"&&Xn(b.firstElementChild)||b.nodeType===Qt.progressingInstruction||kt&&b.nodeType===Qt.comment&&dt(/<[/\w]/g,b.data))return Mt(b),!0;if(Ee[G]||!(Ke.tagCheck instanceof Function&&Ke.tagCheck(G))&&!p[G]){if(!Ee[G]&&ke(G)&&(ue.tagNameCheck instanceof RegExp&&dt(ue.tagNameCheck,G)||ue.tagNameCheck instanceof Function&&ue.tagNameCheck(G)))return!1;if(Se&&!_t[G]){const he=_(b),Be=B(b);if(Be&&he){const Ye=Be.length;for(let ft=Ye-1;ft>=0;--ft){const vt=$(Be[ft],!0);he.insertBefore(vt,F(b))}}}return Mt(b),!0}return(m?m(b):b.nodeType)===Qt.element&&!Yi(b)||(G==="noscript"||G==="noembed"||G==="noframes")&&dt(/<\/no(script|embed|frames)/i,b.innerHTML)?(Mt(b),!0):(Q&&b.nodeType===Qt.text&&(I=b.textContent,Tn([V,U,j],he=>{I=Un(I,he," ")}),b.textContent!==I&&(Fn(o.removed,{element:b.cloneNode()}),b.textContent=I)),Rt(y.afterSanitizeElements,b,null),!1)},Kt=function(b,I,G){if(tt[I]||H&&(I==="id"||I==="name")&&(G in n||G in ri))return!1;const _e=D[I]||Ke.attributeCheck instanceof Function&&Ke.attributeCheck(I,b);if(!(nt&&!tt[I]&&dt(ae,I))){if(!(it&&dt(Me,I))){if(!_e||tt[I]){if(!(ke(b)&&(ue.tagNameCheck instanceof RegExp&&dt(ue.tagNameCheck,b)||ue.tagNameCheck instanceof Function&&ue.tagNameCheck(b))&&(ue.attributeNameCheck instanceof RegExp&&dt(ue.attributeNameCheck,I)||ue.attributeNameCheck instanceof Function&&ue.attributeNameCheck(I,b))||I==="is"&&ue.allowCustomizedBuiltInElements&&(ue.tagNameCheck instanceof RegExp&&dt(ue.tagNameCheck,G)||ue.tagNameCheck instanceof Function&&ue.tagNameCheck(G))))return!1}else if(!po[I]){if(!dt(E,Un(G,De,""))){if(!((I==="src"||I==="xlink:href"||I==="href")&&b!=="script"&&Bl(G,"data:")===0&&ti[b])){if(!(rn&&!dt(ze,Un(G,De,"")))){if(G)return!1}}}}}}return!0},Oe=ge({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),ke=function(b){return!Oe[fo(b)]&&dt(Ae,b)},ai=function(b){Rt(y.beforeSanitizeAttributes,b,null);const I=b.attributes;if(!I||qn(b))return;const G={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:D,forceKeepAttr:void 0};let _e=I.length;for(;_e--;){const he=I[_e],Be=he.name,Ye=he.namespaceURI,ft=he.value,vt=He(Be),Jn=ft;let Ve=Be==="value"?Jn:am(Jn);if(G.attrName=vt,G.attrValue=Ve,G.keepAttr=!0,G.forceKeepAttr=void 0,Rt(y.uponSanitizeAttribute,b,G),Ve=G.attrValue,Z&&(vt==="id"||vt==="name")&&Bl(Ve,fe)!==0&&(en(Be,b),Ve=fe+Ve),kt&&dt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Ve)){en(Be,b);continue}if(vt==="attributename"&&vl(Ve,"href")){en(Be,b);continue}if(G.forceKeepAttr)continue;if(!G.keepAttr){en(Be,b);continue}if(!$t&&dt(/\/>/i,Ve)){en(Be,b);continue}Q&&Tn([V,U,j],wo=>{Ve=Un(Ve,wo," ")});const xo=He(b.nodeName);if(!Kt(xo,vt,Ve)){en(Be,b);continue}if(L&&typeof N=="object"&&typeof N.getAttributeType=="function"&&!Ye)switch(N.getAttributeType(xo,vt)){case"TrustedHTML":{Ve=J(Ve);break}case"TrustedScriptURL":{Ve=L.createScriptURL(Ve);break}}if(Ve!==Jn)try{Ye?b.setAttributeNS(Ye,Be,Ve):b.setAttribute(Be,Ve),qn(b)?Mt(b):Rl(o.removed)}catch{en(Be,b)}}Rt(y.afterSanitizeAttributes,b,null)},ut=function(b){let I=null;const G=Yn(b);for(Rt(y.beforeSanitizeShadowDOM,b,null);I=G.nextNode();)if(Rt(y.uponSanitizeShadowNode,I,null),Zn(I),ai(I),hn(I.content)&&ut(I.content),(m?m(I):I.nodeType)===Qt.element){const he=x?x(I):I.shadowRoot;hn(he)&&(tn(he),ut(he))}Rt(y.afterSanitizeShadowDOM,b,null)},tn=function(b){const I=m?m(b):b.nodeType;if(I===Qt.element){const he=x?x(b):b.shadowRoot;hn(he)&&(tn(he),ut(he))}const G=B?B(b):b.childNodes;if(!G)return;const _e=[];Tn(G,he=>{Fn(_e,he)});for(const he of _e)tn(he);if(I===Qt.element){const he=P?P(b):null;if(typeof he=="string"&&He(he)==="template"){const Be=b.content;hn(Be)&&tn(Be)}}};return o.sanitize=function(v){let b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},I=null,G=null,_e=null,he=null;if(go=!v,go&&(v="<!-->"),typeof v!="string"&&!Xn(v)&&(v=fm(v),typeof v!="string"))throw Hn("dirty is not a string, aborting");if(!o.isSupported)return v;if(Re||Kn(b),o.removed=[],typeof v=="string"&&(Ue=!1),Ue){const ft=P?P(v):v.nodeName;if(typeof ft=="string"){const vt=He(ft);if(!p[vt]||Ee[vt])throw Hn("root node is forbidden and cannot be sanitized in-place")}if(qn(v))throw Hn("root node is clobbered and cannot be sanitized in-place");tn(v)}else if(Xn(v))I=Eo("<!---->"),G=I.ownerDocument.importNode(v,!0),G.nodeType===Qt.element&&G.nodeName==="BODY"||G.nodeName==="HTML"?I=G:I.appendChild(G),tn(G);else{if(!rt&&!Q&&!ve&&v.indexOf("<")===-1)return L&&Ct?J(v):v;if(I=Eo(v),!I)return rt?null:Ct?S:""}I&&Pt&&Mt(I.firstChild);const Be=Yn(Ue?v:I);for(;_e=Be.nextNode();)Zn(_e),ai(_e),hn(_e.content)&&ut(_e.content);if(Ue)return Q&&Rn(v),v;if(rt){if(Q&&Rn(I),At)for(he=oe.call(I.ownerDocument);I.firstChild;)he.appendChild(I.firstChild);else he=I;return(D.shadowroot||D.shadowrootmode)&&(he=ye.call(i,he,!0)),he}let Ye=ve?I.outerHTML:I.innerHTML;return ve&&p["!doctype"]&&I.ownerDocument&&I.ownerDocument.doctype&&I.ownerDocument.doctype.name&&dt(Nm,I.ownerDocument.doctype.name)&&(Ye="<!DOCTYPE "+I.ownerDocument.doctype.name+`>
|
|
127
|
-
`+Ye),Q&&Tn([V,U,j],ft=>{Ye=Un(Ye,ft," ")}),L&&Ct?J(Ye):Ye},o.setConfig=function(){let v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Kn(v),Re=!0},o.clearConfig=function(){pn=null,Re=!1},o.isValidAttribute=function(v,b,I){pn||Kn({});const G=He(v),_e=He(b);return Kt(G,_e,I)},o.addHook=function(v,b){typeof b=="function"&&Fn(y[v],b)},o.removeHook=function(v,b){if(b!==void 0){const I=rm(y[v],b);return I===-1?void 0:lm(y[v],I,1)[0]}return Rl(y[v])},o.removeHooks=function(v){y[v]=[]},o.removeAllHooks=function(){y=Pl()},o}var Am=Fl();const _m=new Cl({gfm:!0,breaks:!0,pedantic:!1,renderer:(()=>{const t=new co;return t.code=({text:o,lang:n})=>{const i=(n??"").toLowerCase(),a=Ti(o,i);return`<pre><code${i?` class="language-${i}"`:""}>${a}</code></pre>`},t})()}),Mm=["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"],Rm=["href","title","target","rel","src","alt","class","checked","type","disabled"],vm=/^(?:(?:https?|mailto|tel|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i;function Bm(t){if(!t)return"";const o=_m.parse(t,{async:!1});return Am.sanitize(o,{ALLOWED_TAGS:Mm,ALLOWED_ATTR:Rm,ALLOWED_URI_REGEXP:vm})}const Im={class:"zm-note-panel"},zm={key:0,class:"zm-note-empty"},Om={class:"zm-note-header"},Lm={class:"zm-note-title-row"},Dm={class:"zm-note-name"},Vm={class:"zm-note-meta"},$m={class:"zm-note-scroll"},Pm={class:"zm-note-section"},Fm={class:"zm-note-section-head"},Um={class:"zm-note-split"},Hm=["disabled"],Wm={key:0,class:"zm-note-preview"},Gm=["innerHTML"],jm={key:1,class:"zm-note-preview-hint"},Km={key:0,class:"zm-note-section-actions"},Ym={key:0,class:"zm-note-add-row"},qm={key:1,class:"zm-note-section"},Xm=["disabled"],Zm=["href","title"],Jm={key:2,class:"zm-note-section"},Qm=["disabled"],ep=["src","alt"],tp={key:3,class:"zm-note-section"},np={class:"zm-note-section-head"},op={key:0,class:"zm-note-section-tag"},ip=["disabled"],rp={key:0,class:"zm-note-code"},lp=["innerHTML"],ap={key:4,class:"zm-note-section"},sp=["disabled"],cp={key:0,class:"zm-note-table"},dp=["onClick"],up={class:"zm-note-table-sort-mark","aria-hidden":"true"},Jo=e.defineComponent({__name:"NotePanel",props:{selectedNode:{},readonly:{type:Boolean},focusTick:{}},emits:["apply","remove","set-link","set-image","set-rich"],setup(t,{emit:o}){const n=t,i=o,a=e.ref(""),c=e.ref(null);bi(c,{minRows:4,maxRows:10});const s=e.computed(()=>!a.value||a.value.trim()===""),u=e.computed(()=>Bm(a.value)),d=e.ref(!0);function g(){d.value=!d.value}e.watch(()=>{var E,p,O;return[(E=n.selectedNode)==null?void 0:E.id,(O=(p=n.selectedNode)==null?void 0:p.note)==null?void 0:O.text]},()=>{var E,p;a.value=((p=(E=n.selectedNode)==null?void 0:E.note)==null?void 0:p.text)??""},{immediate:!0}),e.watch(()=>n.focusTick,async()=>{if(n.readonly)return;await e.nextTick();const E=document.querySelector(".zm-note-panel textarea.zm-note-textarea");if(E){E.focus();const p=E.value.length;E.setSelectionRange(p,p)}});function h(){var O,D;if(n.readonly)return;const E=a.value,p=((D=(O=n.selectedNode)==null?void 0:O.note)==null?void 0:D.text)??"";E!==p&&i("apply",E)}function N(E){var p,O;n.readonly||(E.key==="Escape"?(E.preventDefault(),a.value=((O=(p=n.selectedNode)==null?void 0:p.note)==null?void 0:O.text)??"",E.target.blur()):E.key==="Enter"&&(E.ctrlKey||E.metaKey)&&(E.preventDefault(),h(),E.target.blur()))}function C(){n.readonly||confirm("移除该节点的笔记?")&&(a.value="",i("remove"))}const $=e.computed(()=>{var E,p;return!!((p=(E=n.selectedNode)==null?void 0:E.link)!=null&&p.url)}),R=e.computed(()=>{var E,p;return!!((p=(E=n.selectedNode)==null?void 0:E.image)!=null&&p.src)}),F=e.computed(()=>{var E,p;return(p=(E=n.selectedNode)==null?void 0:E.richContent)==null?void 0:p.kind}),B=e.computed(()=>F.value==="code"),_=e.computed(()=>F.value==="table"),x=e.ref(!1),k=e.ref(!1),m=e.ref(!1),P=e.ref(!1);e.watch(()=>{var E;return(E=n.selectedNode)==null?void 0:E.id},()=>{x.value=!1,k.value=!1,m.value=!1,P.value=!1});const L=e.ref("");e.watch(()=>{var E,p,O;return[(E=n.selectedNode)==null?void 0:E.id,(O=(p=n.selectedNode)==null?void 0:p.link)==null?void 0:O.url]},()=>{var E,p;L.value=((p=(E=n.selectedNode)==null?void 0:E.link)==null?void 0:p.url)??""},{immediate:!0});function S(){var O,D;if(n.readonly)return;const E=L.value.trim(),p=((D=(O=n.selectedNode)==null?void 0:O.link)==null?void 0:D.url)??"";E!==p&&i("set-link",E)}const K=e.ref("");e.watch(()=>{var E,p,O;return[(E=n.selectedNode)==null?void 0:E.id,(O=(p=n.selectedNode)==null?void 0:p.image)==null?void 0:O.src]},()=>{var E,p;K.value=((p=(E=n.selectedNode)==null?void 0:E.image)==null?void 0:p.src)??""},{immediate:!0});function J(){var O,D;if(n.readonly)return;const E=K.value.trim(),p=((D=(O=n.selectedNode)==null?void 0:O.image)==null?void 0:D.src)??"";E!==p&&i("set-image",E)}function de(E){const p=E.target;p.style.display="none"}function ee(E){const p=E.target;p.style.display=""}const Y=e.ref(""),oe=e.ref(null);bi(oe,{minRows:4,maxRows:18}),e.watch(()=>{var E,p,O;return[(E=n.selectedNode)==null?void 0:E.id,(O=(p=n.selectedNode)==null?void 0:p.richContent)==null?void 0:O.raw]},()=>{var E,p;Y.value=((p=(E=n.selectedNode)==null?void 0:E.richContent)==null?void 0:p.raw)??""},{immediate:!0});const ie=e.computed(()=>Ti(Go(Y.value),wn(Y.value)));function ye(){var D,X;if(n.readonly)return;const E=Y.value,p=((X=(D=n.selectedNode)==null?void 0:D.richContent)==null?void 0:X.raw)??"";if(E===p)return;const O=wn(E)||void 0;i("set-rich",E?{kind:"code",raw:E,lang:O}:null)}const y=e.ref(""),V=e.ref(null);bi(V,{minRows:4,maxRows:14});const U=e.ref(-1),j=e.ref("asc");e.watch(()=>{var E,p,O;return[(E=n.selectedNode)==null?void 0:E.id,(O=(p=n.selectedNode)==null?void 0:p.richContent)==null?void 0:O.raw]},()=>{var E,p;y.value=((p=(E=n.selectedNode)==null?void 0:E.richContent)==null?void 0:p.raw)??"",U.value=-1,j.value="asc"},{immediate:!0});function ae(){var O,D;if(n.readonly)return;const E=y.value,p=((D=(O=n.selectedNode)==null?void 0:O.richContent)==null?void 0:D.raw)??"";E!==p&&i("set-rich",E?{kind:"table",raw:E}:null)}const Me=e.computed(()=>Ai(y.value)),ze=e.computed(()=>{const E=Me.value;return U.value<0||E.length<=1?E:al(E,U.value,j.value)});function De(E){U.value!==E?(U.value=E,j.value="asc"):j.value==="asc"?j.value="desc":U.value=-1}const Ae=e.computed(()=>{const E=[];return s.value||E.push(`${a.value.length} 字`),$.value&&E.push("1 链接"),R.value&&E.push("1 图片"),B.value&&E.push("代码块"),_.value&&E.push("表格"),E.length===0?"节点没有额外内容":E.join(" · ")});return(E,p)=>{var O,D,X,ue;return e.openBlock(),e.createElementBlock("div",Im,[t.selectedNode?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",Om,[e.createElementVNode("div",Lm,[p[12]||(p[12]=e.createElementVNode("span",{class:"zm-note-label"},"节点",-1)),e.createElementVNode("span",Dm,e.toDisplayString(t.selectedNode.text||"(无标题)"),1)]),e.createElementVNode("div",Vm,e.toDisplayString(Ae.value),1)]),e.createElementVNode("div",$m,[e.createElementVNode("section",Pm,[e.createElementVNode("header",Fm,[p[13]||(p[13]=e.createElementVNode("span",{class:"zm-note-section-title"},"笔记",-1)),p[14]||(p[14]=e.createElementVNode("span",{class:"zm-note-section-hint"},"Ctrl+Enter 提交, Esc 取消",-1)),t.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"zm-note-preview-toggle",onClick:g},e.toDisplayString(d.value?"隐藏预览":"显示预览"),1))]),e.createElementVNode("div",Um,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"noteRef",ref:c,"onUpdate:modelValue":p[0]||(p[0]=Ee=>a.value=Ee),class:"zm-note-textarea",placeholder:"写点什么吧… 支持 Markdown",spellcheck:"false",disabled:t.readonly,onBlur:h,onKeydown:N},null,40,Hm),[[e.vModelText,a.value]]),d.value?(e.openBlock(),e.createElementBlock("div",Wm,[s.value?(e.openBlock(),e.createElementBlock("div",jm," 渲染后的 Markdown 仅在此面板显示,不会撑大节点框。 ")):(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-note-preview-body",innerHTML:u.value},null,8,Gm))])):e.createCommentVNode("",!0)]),!t.readonly&&!s.value?(e.openBlock(),e.createElementBlock("div",Km,[e.createElementVNode("button",{class:"zm-note-action-btn is-danger",onClick:C},"移除笔记")])):e.createCommentVNode("",!0)]),t.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Ym,[!$.value&&!x.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-note-add-chip",onClick:p[1]||(p[1]=Ee=>x.value=!0)},"+ 链接")):e.createCommentVNode("",!0),!R.value&&!k.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-note-add-chip",onClick:p[2]||(p[2]=Ee=>k.value=!0)},"+ 图片")):e.createCommentVNode("",!0),!B.value&&!m.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-note-add-chip",onClick:p[3]||(p[3]=Ee=>m.value=!0)},"+ 代码块")):e.createCommentVNode("",!0),!_.value&&!P.value?(e.openBlock(),e.createElementBlock("button",{key:3,class:"zm-note-add-chip",onClick:p[4]||(p[4]=Ee=>P.value=!0)},"+ 表格")):e.createCommentVNode("",!0)])),$.value||x.value?(e.openBlock(),e.createElementBlock("section",qm,[p[15]||(p[15]=e.createElementVNode("header",{class:"zm-note-section-head"},[e.createElementVNode("span",{class:"zm-note-section-title"},"链接")],-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":p[5]||(p[5]=Ee=>L.value=Ee),class:"zm-note-input",type:"url",placeholder:"https://…",disabled:t.readonly,onBlur:S,onKeydown:p[6]||(p[6]=e.withKeys(e.withModifiers(Ee=>Ee.target.blur(),["prevent"]),["enter"]))},null,40,Xm),[[e.vModelText,L.value]]),$.value?(e.openBlock(),e.createElementBlock("a",{key:0,class:"zm-note-link-chip",href:(O=t.selectedNode.link)==null?void 0:O.url,target:"_blank",rel:"noopener noreferrer",title:(D=t.selectedNode.link)==null?void 0:D.url},e.toDisplayString((X=t.selectedNode.link)==null?void 0:X.url),9,Zm)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),R.value||k.value?(e.openBlock(),e.createElementBlock("section",Jm,[p[16]||(p[16]=e.createElementVNode("header",{class:"zm-note-section-head"},[e.createElementVNode("span",{class:"zm-note-section-title"},"图片")],-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":p[7]||(p[7]=Ee=>K.value=Ee),class:"zm-note-input",type:"url",placeholder:"data:image/… 或 https://…",disabled:t.readonly,onBlur:J,onKeydown:p[8]||(p[8]=e.withKeys(e.withModifiers(Ee=>Ee.target.blur(),["prevent"]),["enter"]))},null,40,Qm),[[e.vModelText,K.value]]),R.value?(e.openBlock(),e.createElementBlock("img",{key:0,class:"zm-note-image",src:(ue=t.selectedNode.image)==null?void 0:ue.src,alt:t.selectedNode.text,onError:de,onLoad:ee},null,40,ep)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),B.value||m.value?(e.openBlock(),e.createElementBlock("section",tp,[e.createElementVNode("header",np,[p[17]||(p[17]=e.createElementVNode("span",{class:"zm-note-section-title"},"代码块",-1)),e.unref(wn)(Y.value)?(e.openBlock(),e.createElementBlock("span",op,e.toDisplayString(e.unref(wn)(Y.value)),1)):e.createCommentVNode("",!0)]),e.withDirectives(e.createElementVNode("textarea",{ref_key:"codeRef",ref:oe,"onUpdate:modelValue":p[9]||(p[9]=Ee=>Y.value=Ee),class:"zm-note-input zm-note-input-code",placeholder:"```ts\nconsole.log(123)\n```",spellcheck:"false",disabled:t.readonly,onBlur:ye},null,40,ip),[[e.vModelText,Y.value]]),Y.value.trim()?(e.openBlock(),e.createElementBlock("pre",rp,[e.createElementVNode("code",{innerHTML:ie.value},null,8,lp)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),_.value||P.value?(e.openBlock(),e.createElementBlock("section",ap,[p[18]||(p[18]=e.createElementVNode("header",{class:"zm-note-section-head"},[e.createElementVNode("span",{class:"zm-note-section-title"},"表格"),e.createElementVNode("span",{class:"zm-note-section-hint"},"点击表头排序")],-1)),e.withDirectives(e.createElementVNode("textarea",{ref_key:"tableRef",ref:V,"onUpdate:modelValue":p[10]||(p[10]=Ee=>y.value=Ee),class:"zm-note-input zm-note-input-code",placeholder:`| 列1 | 列2 |
|
|
126
|
+
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${Zt(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:o,tokens:n}){let i=this.parser.parseInline(n),a=Sl(t);if(a===null)return i;t=a;let c='<a href="'+t+'"';return o&&(c+=' title="'+Zt(o)+'"'),c+=">"+i+"</a>",c}image({href:t,title:o,text:n,tokens:i}){i&&(n=this.parser.parseInline(i,this.parser.textRenderer));let a=Sl(t);if(a===null)return Zt(n);t=a;let c=`<img src="${t}" alt="${Zt(n)}"`;return o&&(c+=` title="${Zt(o)}"`),c+=">",c}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Zt(t.text)}},Di=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}},Kt=class ir{constructor(o){Ve(this,"options");Ve(this,"renderer");Ve(this,"textRenderer");this.options=o||Nn,this.options.renderer=this.options.renderer||new co,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Di}static parse(o,n){return new ir(n).parse(o)}static parseInline(o,n){return new ir(n).parseInline(o)}parse(o){var i,a;this.renderer.parser=this;let n="";for(let c=0;c<o.length;c++){let s=o[c];if((a=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&a[s.type]){let d=s,g=this.options.extensions.renderers[d.type].call({parser:this},d);if(g!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(d.type)){n+=g||"";continue}}let u=s;switch(u.type){case"space":{n+=this.renderer.space(u);break}case"hr":{n+=this.renderer.hr(u);break}case"heading":{n+=this.renderer.heading(u);break}case"code":{n+=this.renderer.code(u);break}case"table":{n+=this.renderer.table(u);break}case"blockquote":{n+=this.renderer.blockquote(u);break}case"list":{n+=this.renderer.list(u);break}case"checkbox":{n+=this.renderer.checkbox(u);break}case"html":{n+=this.renderer.html(u);break}case"def":{n+=this.renderer.def(u);break}case"paragraph":{n+=this.renderer.paragraph(u);break}case"text":{n+=this.renderer.text(u);break}default:{let d='Token with "'+u.type+'" type was not found.';if(this.options.silent)return console.error(d),"";throw new Error(d)}}}return n}parseInline(o,n=this.renderer){var a,c;this.renderer.parser=this;let i="";for(let s=0;s<o.length;s++){let u=o[s];if((c=(a=this.options.extensions)==null?void 0:a.renderers)!=null&&c[u.type]){let g=this.options.extensions.renderers[u.type].call({parser:this},u);if(g!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(u.type)){i+=g||"";continue}}let d=u;switch(d.type){case"escape":{i+=n.text(d);break}case"html":{i+=n.html(d);break}case"link":{i+=n.link(d);break}case"image":{i+=n.image(d);break}case"checkbox":{i+=n.checkbox(d);break}case"strong":{i+=n.strong(d);break}case"em":{i+=n.em(d);break}case"codespan":{i+=n.codespan(d);break}case"br":{i+=n.br(d);break}case"del":{i+=n.del(d);break}case"text":{i+=n.text(d);break}default:{let g='Token with "'+d.type+'" type was not found.';if(this.options.silent)return console.error(g),"";throw new Error(g)}}}return i}},uo=(ei=class{constructor(t){Ve(this,"options");Ve(this,"block");this.options=t||Nn}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?jt.lex:jt.lexInline}provideParser(t=this.block){return t?Kt.parse:Kt.parseInline}},Ve(ei,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),Ve(ei,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),ei),Al=class{constructor(...t){Ve(this,"defaults",Ai());Ve(this,"options",this.setOptions);Ve(this,"parse",this.parseMarkdown(!0));Ve(this,"parseInline",this.parseMarkdown(!1));Ve(this,"Parser",Kt);Ve(this,"Renderer",co);Ve(this,"TextRenderer",Di);Ve(this,"Lexer",jt);Ve(this,"Tokenizer",Xo);Ve(this,"Hooks",uo);this.use(...t)}walkTokens(t,o){var i,a;let n=[];for(let c of t)switch(n=n.concat(o.call(this,c)),c.type){case"table":{let s=c;for(let u of s.header)n=n.concat(this.walkTokens(u.tokens,o));for(let u of s.rows)for(let d of u)n=n.concat(this.walkTokens(d.tokens,o));break}case"list":{let s=c;n=n.concat(this.walkTokens(s.items,o));break}default:{let s=c;(a=(i=this.defaults.extensions)==null?void 0:i.childTokens)!=null&&a[s.type]?this.defaults.extensions.childTokens[s.type].forEach(u=>{let d=s[u].flat(1/0);n=n.concat(this.walkTokens(d,o))}):s.tokens&&(n=n.concat(this.walkTokens(s.tokens,o)))}}return n}use(...t){let o=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let i={...n};if(i.async=this.defaults.async||i.async||!1,n.extensions&&(n.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){let c=o.renderers[a.name];c?o.renderers[a.name]=function(...s){let u=a.renderer.apply(this,s);return u===!1&&(u=c.apply(this,s)),u}:o.renderers[a.name]=a.renderer}if("tokenizer"in a){if(!a.level||a.level!=="block"&&a.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let c=o[a.level];c?c.unshift(a.tokenizer):o[a.level]=[a.tokenizer],a.start&&(a.level==="block"?o.startBlock?o.startBlock.push(a.start):o.startBlock=[a.start]:a.level==="inline"&&(o.startInline?o.startInline.push(a.start):o.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(o.childTokens[a.name]=a.childTokens)}),i.extensions=o),n.renderer){let a=this.defaults.renderer||new co(this.defaults);for(let c in n.renderer){if(!(c in a))throw new Error(`renderer '${c}' does not exist`);if(["options","parser"].includes(c))continue;let s=c,u=n.renderer[s],d=a[s];a[s]=(...g)=>{let h=u.apply(a,g);return h===!1&&(h=d.apply(a,g)),h||""}}i.renderer=a}if(n.tokenizer){let a=this.defaults.tokenizer||new Xo(this.defaults);for(let c in n.tokenizer){if(!(c in a))throw new Error(`tokenizer '${c}' does not exist`);if(["options","rules","lexer"].includes(c))continue;let s=c,u=n.tokenizer[s],d=a[s];a[s]=(...g)=>{let h=u.apply(a,g);return h===!1&&(h=d.apply(a,g)),h}}i.tokenizer=a}if(n.hooks){let a=this.defaults.hooks||new uo;for(let c in n.hooks){if(!(c in a))throw new Error(`hook '${c}' does not exist`);if(["options","block"].includes(c))continue;let s=c,u=n.hooks[s],d=a[s];uo.passThroughHooks.has(c)?a[s]=g=>{if(this.defaults.async&&uo.passThroughHooksRespectAsync.has(c))return(async()=>{let w=await u.call(a,g);return d.call(a,w)})();let h=u.call(a,g);return d.call(a,h)}:a[s]=(...g)=>{if(this.defaults.async)return(async()=>{let w=await u.apply(a,g);return w===!1&&(w=await d.apply(a,g)),w})();let h=u.apply(a,g);return h===!1&&(h=d.apply(a,g)),h}}i.hooks=a}if(n.walkTokens){let a=this.defaults.walkTokens,c=n.walkTokens;i.walkTokens=function(s){let u=[];return u.push(c.call(this,s)),a&&(u=u.concat(a.call(this,s))),u}}this.defaults={...this.defaults,...i}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,o){return jt.lex(t,o??this.defaults)}parser(t,o){return Kt.parse(t,o??this.defaults)}parseMarkdown(t){return(o,n)=>{let i={...n},a={...this.defaults,...i},c=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&i.async===!1)return c(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof o>"u"||o===null)return c(new Error("marked(): input parameter is undefined or null"));if(typeof o!="string")return c(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(o)+", string expected"));if(a.hooks&&(a.hooks.options=a,a.hooks.block=t),a.async)return(async()=>{let s=a.hooks?await a.hooks.preprocess(o):o,u=await(a.hooks?await a.hooks.provideLexer(t):t?jt.lex:jt.lexInline)(s,a),d=a.hooks?await a.hooks.processAllTokens(u):u;a.walkTokens&&await Promise.all(this.walkTokens(d,a.walkTokens));let g=await(a.hooks?await a.hooks.provideParser(t):t?Kt.parse:Kt.parseInline)(d,a);return a.hooks?await a.hooks.postprocess(g):g})().catch(c);try{a.hooks&&(o=a.hooks.preprocess(o));let s=(a.hooks?a.hooks.provideLexer(t):t?jt.lex:jt.lexInline)(o,a);a.hooks&&(s=a.hooks.processAllTokens(s)),a.walkTokens&&this.walkTokens(s,a.walkTokens);let u=(a.hooks?a.hooks.provideParser(t):t?Kt.parse:Kt.parseInline)(s,a);return a.hooks&&(u=a.hooks.postprocess(u)),u}catch(s){return c(s)}}}onError(t,o){return n=>{if(n.message+=`
|
|
127
|
+
Please report this to https://github.com/markedjs/marked.`,t){let i="<p>An error occurred:</p><pre>"+Zt(n.message+"",!0)+"</pre>";return o?Promise.resolve(i):i}if(o)return Promise.reject(n);throw n}}},Tn=new Al;function Le(t,o){return Tn.parse(t,o)}Le.options=Le.setOptions=function(t){return Tn.setOptions(t),Le.defaults=Tn.defaults,ul(Le.defaults),Le},Le.getDefaults=Ai,Le.defaults=Nn,Le.use=function(...t){return Tn.use(...t),Le.defaults=Tn.defaults,ul(Le.defaults),Le},Le.walkTokens=function(t,o){return Tn.walkTokens(t,o)},Le.parseInline=Tn.parseInline,Le.Parser=Kt,Le.parser=Kt.parse,Le.Renderer=co,Le.TextRenderer=Di,Le.Lexer=jt,Le.lexer=jt.lex,Le.Tokenizer=Xo,Le.Hooks=uo,Le.parse=Le,Le.options,Le.setOptions,Le.use,Le.walkTokens,Le.parseInline,Kt.parse,jt.lex;/*! @license DOMPurify 3.4.8 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.8/LICENSE */function _l(t,o){(o==null||o>t.length)&&(o=t.length);for(var n=0,i=Array(o);n<o;n++)i[n]=t[n];return i}function hm(t){if(Array.isArray(t))return t}function bm(t,o){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var i,a,c,s,u=[],d=!0,g=!1;try{if(c=(n=n.call(t)).next,o!==0)for(;!(d=(i=c.call(n)).done)&&(u.push(i.value),u.length!==o);d=!0);}catch(h){g=!0,a=h}finally{try{if(!d&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(g)throw a}}return u}}function km(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
128
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ym(t,o){return hm(t)||bm(t,o)||Em(t,o)||km()}function Em(t,o){if(t){if(typeof t=="string")return _l(t,o);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_l(t,o):void 0}}const Rl=Object.entries,Bl=Object.setPrototypeOf,xm=Object.isFrozen,wm=Object.getPrototypeOf,Nm=Object.getOwnPropertyDescriptor;let xt=Object.freeze,Dt=Object.seal,Fn=Object.create,vl=typeof Reflect<"u"&&Reflect,$i=vl.apply,Vi=vl.construct;xt||(xt=function(o){return o}),Dt||(Dt=function(o){return o}),$i||($i=function(o,n){for(var i=arguments.length,a=new Array(i>2?i-2:0),c=2;c<i;c++)a[c-2]=arguments[c];return o.apply(n,a)}),Vi||(Vi=function(o){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];return new o(...i)});const Cn=et(Array.prototype.forEach),Sm=et(Array.prototype.lastIndexOf),Il=et(Array.prototype.pop),Un=et(Array.prototype.push),Tm=et(Array.prototype.splice),wt=Array.isArray,fo=et(String.prototype.toLowerCase),Pi=et(String.prototype.toString),zl=et(String.prototype.match),Hn=et(String.prototype.replace),Ol=et(String.prototype.indexOf),Cm=et(String.prototype.trim),Mm=et(Number.prototype.toString),Am=et(Boolean.prototype.toString),Ll=typeof BigInt>"u"?null:et(BigInt.prototype.toString),Dl=typeof Symbol>"u"?null:et(Symbol.prototype.toString),Ge=et(Object.prototype.hasOwnProperty),mo=et(Object.prototype.toString),dt=et(RegExp.prototype.test),Wn=_m(TypeError);function et(t){return function(o){o instanceof RegExp&&(o.lastIndex=0);for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];return $i(t,o,i)}}function _m(t){return function(){for(var o=arguments.length,n=new Array(o),i=0;i<o;i++)n[i]=arguments[i];return Vi(t,n)}}function ye(t,o){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:fo;if(Bl&&Bl(t,null),!wt(o))return t;let i=o.length;for(;i--;){let a=o[i];if(typeof a=="string"){const c=n(a);c!==a&&(xm(o)||(o[i]=c),a=c)}t[a]=!0}return t}function Rm(t){for(let o=0;o<t.length;o++)Ge(t,o)||(t[o]=null);return t}function pt(t){const o=Fn(null);for(const i of Rl(t)){var n=ym(i,2);const a=n[0],c=n[1];Ge(t,a)&&(wt(c)?o[a]=Rm(c):c&&typeof c=="object"&&c.constructor===Object?o[a]=pt(c):o[a]=c)}return o}function Bm(t){switch(typeof t){case"string":return t;case"number":return Mm(t);case"boolean":return Am(t);case"bigint":return Ll?Ll(t):"0";case"symbol":return Dl?Dl(t):"Symbol()";case"undefined":return mo(t);case"function":case"object":{if(t===null)return mo(t);const o=t,n=Jt(o,"toString");if(typeof n=="function"){const i=n(o);return typeof i=="string"?i:mo(i)}return mo(t)}default:return mo(t)}}function Jt(t,o){for(;t!==null;){const i=Nm(t,o);if(i){if(i.get)return et(i.get);if(typeof i.value=="function")return et(i.value)}t=wm(t)}function n(){return null}return n}function vm(t){try{return dt(t,""),!0}catch{return!1}}const $l=xt(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Fi=xt(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Ui=xt(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Im=xt(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Hi=xt(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),zm=xt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Vl=xt(["#text"]),Pl=xt(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Wi=xt(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Fl=xt(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Zo=xt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Om=Dt(/{{[\w\W]*|^[\w\W]*}}/g),Lm=Dt(/<%[\w\W]*|^[\w\W]*%>/g),Dm=Dt(/\${[\w\W]*/g),$m=Dt(/^data-[\-\w.\u00B7-\uFFFF]+$/),Vm=Dt(/^aria-[\-\w]+$/),Ul=Dt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Pm=Dt(/^(?:\w+script|data):/i),Fm=Dt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Um=Dt(/^html$/i),Hm=Dt(/^[a-z][.\w]*(-[.\w]+)+$/i),Qt={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Wm=function(){return typeof window>"u"?null:window},Gm=function(o,n){if(typeof o!="object"||typeof o.createPolicy!="function")return null;let i=null;const a="data-tt-policy-suffix";n&&n.hasAttribute(a)&&(i=n.getAttribute(a));const c="dompurify"+(i?"#"+i:"");try{return o.createPolicy(c,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+c+" could not be created."),null}},Hl=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Wl(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Wm();const o=B=>Wl(B);if(o.version="3.4.8",o.removed=[],!t||!t.document||t.document.nodeType!==Qt.document||!t.Element)return o.isSupported=!1,o;let n=t.document;const i=n,a=i.currentScript;t.DocumentFragment;const c=t.HTMLTemplateElement,s=t.Node,u=t.Element,d=t.NodeFilter,g=t.NamedNodeMap;g===void 0&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const h=t.DOMParser,w=t.trustedTypes,C=u.prototype,P=Jt(C,"cloneNode"),R=Jt(C,"remove"),U=Jt(C,"nextSibling"),I=Jt(C,"childNodes"),A=Jt(C,"parentNode"),x=Jt(C,"shadowRoot"),k=Jt(C,"attributes"),m=s&&s.prototype?Jt(s.prototype,"nodeType"):null,F=s&&s.prototype?Jt(s.prototype,"nodeName"):null;if(typeof c=="function"){const B=n.createElement("template");B.content&&B.content.ownerDocument&&(n=B.content.ownerDocument)}let W,K="",S=0;const ne=function(b){if(S>0)throw Wn('The configured TRUSTED_TYPES_POLICY.createHTML must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose createHTML wraps DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.');S++;try{return W.createHTML(b)}finally{S--}},se=n,re=se.implementation,Z=se.createNodeIterator,ce=se.createDocumentFragment,ie=se.getElementsByTagName,me=i.importNode;let v=Hl();o.isSupported=typeof Rl=="function"&&typeof A=="function"&&re&&re.createHTMLDocument!==void 0;const E=Om,$=Lm,X=Dm,fe=$m,Ae=Vm,De=Pm,Pe=Fm,Me=Hm;let y=Ul,p=null;const D=ye({},[...$l,...Fi,...Ui,...Hi,...Vl]);let V=null;const ee=ye({},[...Pl,...Wi,...Fl,...Zo]);let ge=Object.seal(Fn(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),we=null,tt=null;const je=Object.seal(Fn(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let rt=!0,nt=!0,an=!1,$t=!0,ae=!1,gt=!0,ze=!1,_e=!1,Vt=!1,lt=!1,Ct=!1,Nt=!1,Y=!0,te=!1;const he="user-content-";let Se=!0,He=!1,at={},Mt=null;const An=ye({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let ti=null;const ni=ye({},["audio","video","img","source","image","track"]);let po=null;const oi=ye({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),jn="http://www.w3.org/1998/Math/MathML",Kn="http://www.w3.org/2000/svg",Pt="http://www.w3.org/1999/xhtml";let gn=Pt,go=!1,ho=null;const Gi=ye({},[jn,Kn,Pt],Pi);let bo=ye({},["mi","mo","mn","ms","mtext"]),ko=ye({},["annotation-xml"]);const ji=ye({},["title","style","font","a","script"]);let _n=null;const ii=["application/xhtml+xml","text/html"],Ki="text/html";let We=null,hn=null;const ri=n.createElement("form"),li=function(b){return b instanceof RegExp||b instanceof Function},Yn=function(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(hn&&hn===b)return;(!b||typeof b!="object")&&(b={}),b=pt(b),_n=ii.indexOf(b.PARSER_MEDIA_TYPE)===-1?Ki:b.PARSER_MEDIA_TYPE,We=_n==="application/xhtml+xml"?Pi:fo,p=Ge(b,"ALLOWED_TAGS")&&wt(b.ALLOWED_TAGS)?ye({},b.ALLOWED_TAGS,We):D,V=Ge(b,"ALLOWED_ATTR")&&wt(b.ALLOWED_ATTR)?ye({},b.ALLOWED_ATTR,We):ee,ho=Ge(b,"ALLOWED_NAMESPACES")&&wt(b.ALLOWED_NAMESPACES)?ye({},b.ALLOWED_NAMESPACES,Pi):Gi,po=Ge(b,"ADD_URI_SAFE_ATTR")&&wt(b.ADD_URI_SAFE_ATTR)?ye(pt(oi),b.ADD_URI_SAFE_ATTR,We):oi,ti=Ge(b,"ADD_DATA_URI_TAGS")&&wt(b.ADD_DATA_URI_TAGS)?ye(pt(ni),b.ADD_DATA_URI_TAGS,We):ni,Mt=Ge(b,"FORBID_CONTENTS")&&wt(b.FORBID_CONTENTS)?ye({},b.FORBID_CONTENTS,We):An,we=Ge(b,"FORBID_TAGS")&&wt(b.FORBID_TAGS)?ye({},b.FORBID_TAGS,We):pt({}),tt=Ge(b,"FORBID_ATTR")&&wt(b.FORBID_ATTR)?ye({},b.FORBID_ATTR,We):pt({}),at=Ge(b,"USE_PROFILES")?b.USE_PROFILES&&typeof b.USE_PROFILES=="object"?pt(b.USE_PROFILES):b.USE_PROFILES:!1,rt=b.ALLOW_ARIA_ATTR!==!1,nt=b.ALLOW_DATA_ATTR!==!1,an=b.ALLOW_UNKNOWN_PROTOCOLS||!1,$t=b.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ae=b.SAFE_FOR_TEMPLATES||!1,gt=b.SAFE_FOR_XML!==!1,ze=b.WHOLE_DOCUMENT||!1,lt=b.RETURN_DOM||!1,Ct=b.RETURN_DOM_FRAGMENT||!1,Nt=b.RETURN_TRUSTED_TYPE||!1,Vt=b.FORCE_BODY||!1,Y=b.SANITIZE_DOM!==!1,te=b.SANITIZE_NAMED_PROPS||!1,Se=b.KEEP_CONTENT!==!1,He=b.IN_PLACE||!1,y=vm(b.ALLOWED_URI_REGEXP)?b.ALLOWED_URI_REGEXP:Ul,gn=typeof b.NAMESPACE=="string"?b.NAMESPACE:Pt,bo=Ge(b,"MATHML_TEXT_INTEGRATION_POINTS")&&b.MATHML_TEXT_INTEGRATION_POINTS&&typeof b.MATHML_TEXT_INTEGRATION_POINTS=="object"?pt(b.MATHML_TEXT_INTEGRATION_POINTS):ye({},["mi","mo","mn","ms","mtext"]),ko=Ge(b,"HTML_INTEGRATION_POINTS")&&b.HTML_INTEGRATION_POINTS&&typeof b.HTML_INTEGRATION_POINTS=="object"?pt(b.HTML_INTEGRATION_POINTS):ye({},["annotation-xml"]);const L=Ge(b,"CUSTOM_ELEMENT_HANDLING")&&b.CUSTOM_ELEMENT_HANDLING&&typeof b.CUSTOM_ELEMENT_HANDLING=="object"?pt(b.CUSTOM_ELEMENT_HANDLING):Fn(null);if(ge=Fn(null),Ge(L,"tagNameCheck")&&li(L.tagNameCheck)&&(ge.tagNameCheck=L.tagNameCheck),Ge(L,"attributeNameCheck")&&li(L.attributeNameCheck)&&(ge.attributeNameCheck=L.attributeNameCheck),Ge(L,"allowCustomizedBuiltInElements")&&typeof L.allowCustomizedBuiltInElements=="boolean"&&(ge.allowCustomizedBuiltInElements=L.allowCustomizedBuiltInElements),ae&&(nt=!1),Ct&&(lt=!0),at&&(p=ye({},Vl),V=Fn(null),at.html===!0&&(ye(p,$l),ye(V,Pl)),at.svg===!0&&(ye(p,Fi),ye(V,Wi),ye(V,Zo)),at.svgFilters===!0&&(ye(p,Ui),ye(V,Wi),ye(V,Zo)),at.mathMl===!0&&(ye(p,Hi),ye(V,Fl),ye(V,Zo))),je.tagCheck=null,je.attributeCheck=null,Ge(b,"ADD_TAGS")&&(typeof b.ADD_TAGS=="function"?je.tagCheck=b.ADD_TAGS:wt(b.ADD_TAGS)&&(p===D&&(p=pt(p)),ye(p,b.ADD_TAGS,We))),Ge(b,"ADD_ATTR")&&(typeof b.ADD_ATTR=="function"?je.attributeCheck=b.ADD_ATTR:wt(b.ADD_ATTR)&&(V===ee&&(V=pt(V)),ye(V,b.ADD_ATTR,We))),Ge(b,"ADD_URI_SAFE_ATTR")&&wt(b.ADD_URI_SAFE_ATTR)&&ye(po,b.ADD_URI_SAFE_ATTR,We),Ge(b,"FORBID_CONTENTS")&&wt(b.FORBID_CONTENTS)&&(Mt===An&&(Mt=pt(Mt)),ye(Mt,b.FORBID_CONTENTS,We)),Ge(b,"ADD_FORBID_CONTENTS")&&wt(b.ADD_FORBID_CONTENTS)&&(Mt===An&&(Mt=pt(Mt)),ye(Mt,b.ADD_FORBID_CONTENTS,We)),Se&&(p["#text"]=!0),ze&&ye(p,["html","head","body"]),p.table&&(ye(p,["tbody"]),delete we.tbody),b.TRUSTED_TYPES_POLICY){if(typeof b.TRUSTED_TYPES_POLICY.createHTML!="function")throw Wn('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof b.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Wn('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const q=W;W=b.TRUSTED_TYPES_POLICY;try{K=ne("")}catch(Re){throw W=q,Re}}else W===void 0&&b.TRUSTED_TYPES_POLICY!==null&&(W=Gm(w,a)),W&&typeof K=="string"&&(K=ne(""));(v.uponSanitizeElement.length>0||v.uponSanitizeAttribute.length>0)&&p===D&&(p=pt(p)),v.uponSanitizeAttribute.length>0&&V===ee&&(V=pt(V)),xt&&xt(b),hn=b},yo=ye({},[...Fi,...Ui,...Im]),bn=ye({},[...Hi,...zm]),Yi=function(b){let L=A(b);(!L||!L.tagName)&&(L={namespaceURI:gn,tagName:"template"});const q=fo(b.tagName),Re=fo(L.tagName);return ho[b.namespaceURI]?b.namespaceURI===Kn?L.namespaceURI===Pt?q==="svg":L.namespaceURI===jn?q==="svg"&&(Re==="annotation-xml"||bo[Re]):!!yo[q]:b.namespaceURI===jn?L.namespaceURI===Pt?q==="math":L.namespaceURI===Kn?q==="math"&&ko[Re]:!!bn[q]:b.namespaceURI===Pt?L.namespaceURI===Kn&&!ko[Re]||L.namespaceURI===jn&&!bo[Re]?!1:!bn[q]&&(ji[q]||!yo[q]):!!(_n==="application/xhtml+xml"&&ho[b.namespaceURI]):!1},At=function(b){Un(o.removed,{element:b});try{A(b).removeChild(b)}catch{R(b)}},en=function(b,L){try{Un(o.removed,{attribute:L.getAttributeNode(b),from:L})}catch{Un(o.removed,{attribute:null,from:L})}if(L.removeAttribute(b),b==="is")if(lt||Ct)try{At(L)}catch{}else try{L.setAttribute(b,"")}catch{}},Eo=function(b){let L=null,q=null;if(Vt)b="<remove></remove>"+b;else{const Oe=zl(b,/^[\r\n\t ]+/);q=Oe&&Oe[0]}_n==="application/xhtml+xml"&&gn===Pt&&(b='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+b+"</body></html>");const Re=W?ne(b):b;if(gn===Pt)try{L=new h().parseFromString(Re,_n)}catch{}if(!L||!L.documentElement){L=re.createDocument(gn,"template",null);try{L.documentElement.innerHTML=go?K:Re}catch{}}const ke=L.body||L.documentElement;return b&&q&&ke.insertBefore(n.createTextNode(q),ke.childNodes[0]||null),gn===Pt?ie.call(L,ze?"html":"body")[0]:ze?L.documentElement:ke},qn=function(b){return Z.call(b.ownerDocument||b,b,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},Rn=function(b){var L,q;b.normalize();const Re=Z.call(b.ownerDocument||b,b,d.SHOW_TEXT|d.SHOW_COMMENT|d.SHOW_CDATA_SECTION|d.SHOW_PROCESSING_INSTRUCTION,null);let ke=Re.nextNode();for(;ke;){let Ze=ke.data;Cn([E,$,X],St=>{Ze=Hn(Ze,St," ")}),ke.data=Ze,ke=Re.nextNode()}const Oe=(L=(q=b.querySelectorAll)===null||q===void 0?void 0:q.call(b,"template"))!==null&&L!==void 0?L:[];Cn(Array.from(Oe),Ze=>{kn(Ze.content)&&Rn(Ze.content)})},Xn=function(b){const L=F?F(b):null;return typeof L!="string"||We(L)!=="form"?!1:typeof b.nodeName!="string"||typeof b.textContent!="string"||typeof b.removeChild!="function"||b.attributes!==k(b)||typeof b.removeAttribute!="function"||typeof b.setAttribute!="function"||typeof b.namespaceURI!="string"||typeof b.insertBefore!="function"||typeof b.hasChildNodes!="function"||b.nodeType!==m(b)||b.childNodes!==I(b)},kn=function(b){if(!m||typeof b!="object"||b===null)return!1;try{return m(b)===Qt.documentFragment}catch{return!1}},Zn=function(b){if(!m||typeof b!="object"||b===null)return!1;try{return typeof m(b)=="number"}catch{return!1}};function _t(B,b,L){Cn(B,q=>{q.call(o,b,L,hn)})}const Jn=function(b){let L=null;if(_t(v.beforeSanitizeElements,b,null),Xn(b))return At(b),!0;const q=We(F?F(b):b.nodeName);if(_t(v.uponSanitizeElement,b,{tagName:q,allowedTags:p}),gt&&b.hasChildNodes()&&!Zn(b.firstElementChild)&&dt(/<[/\w!]/g,b.innerHTML)&&dt(/<[/\w!]/g,b.textContent)||gt&&b.namespaceURI===Pt&&q==="style"&&Zn(b.firstElementChild)||b.nodeType===Qt.progressingInstruction||gt&&b.nodeType===Qt.comment&&dt(/<[/\w]/g,b.data))return At(b),!0;if(we[q]||!(je.tagCheck instanceof Function&&je.tagCheck(q))&&!p[q]){if(!we[q]&&Ee(q)&&(ge.tagNameCheck instanceof RegExp&&dt(ge.tagNameCheck,q)||ge.tagNameCheck instanceof Function&&ge.tagNameCheck(q)))return!1;if(Se&&!Mt[q]){const ke=A(b),Oe=I(b);if(Oe&&ke){const Ze=Oe.length;for(let St=Ze-1;St>=0;--St){const ht=P(Oe[St],!0);ke.insertBefore(ht,U(b))}}}return At(b),!0}return(m?m(b):b.nodeType)===Qt.element&&!Yi(b)||(q==="noscript"||q==="noembed"||q==="noframes")&&dt(/<\/no(script|embed|frames)/i,b.innerHTML)?(At(b),!0):(ae&&b.nodeType===Qt.text&&(L=b.textContent,Cn([E,$,X],ke=>{L=Hn(L,ke," ")}),b.textContent!==L&&(Un(o.removed,{element:b.cloneNode()}),b.textContent=L)),_t(v.afterSanitizeElements,b,null),!1)},Yt=function(b,L,q){if(tt[L]||Y&&(L==="id"||L==="name")&&(q in n||q in ri))return!1;const Re=V[L]||je.attributeCheck instanceof Function&&je.attributeCheck(L,b);if(!(nt&&!tt[L]&&dt(fe,L))){if(!(rt&&dt(Ae,L))){if(!Re||tt[L]){if(!(Ee(b)&&(ge.tagNameCheck instanceof RegExp&&dt(ge.tagNameCheck,b)||ge.tagNameCheck instanceof Function&&ge.tagNameCheck(b))&&(ge.attributeNameCheck instanceof RegExp&&dt(ge.attributeNameCheck,L)||ge.attributeNameCheck instanceof Function&&ge.attributeNameCheck(L,b))||L==="is"&&ge.allowCustomizedBuiltInElements&&(ge.tagNameCheck instanceof RegExp&&dt(ge.tagNameCheck,q)||ge.tagNameCheck instanceof Function&&ge.tagNameCheck(q))))return!1}else if(!po[L]){if(!dt(y,Hn(q,Pe,""))){if(!((L==="src"||L==="xlink:href"||L==="href")&&b!=="script"&&Ol(q,"data:")===0&&ti[b])){if(!(an&&!dt(De,Hn(q,Pe,"")))){if(q)return!1}}}}}}return!0},$e=ye({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Ee=function(b){return!$e[fo(b)]&&dt(Me,b)},ai=function(b){_t(v.beforeSanitizeAttributes,b,null);const L=b.attributes;if(!L||Xn(b))return;const q={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:V,forceKeepAttr:void 0};let Re=L.length;for(;Re--;){const ke=L[Re],Oe=ke.name,Ze=ke.namespaceURI,St=ke.value,ht=We(Oe),xo=St;let Je=Oe==="value"?xo:Cm(xo);if(q.attrName=ht,q.attrValue=Je,q.keepAttr=!0,q.forceKeepAttr=void 0,_t(v.uponSanitizeAttribute,b,q),Je=q.attrValue,te&&(ht==="id"||ht==="name")&&Ol(Je,he)!==0&&(en(Oe,b),Je=he+Je),gt&&dt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Je)){en(Oe,b);continue}if(ht==="attributename"&&zl(Je,"href")){en(Oe,b);continue}if(q.forceKeepAttr)continue;if(!q.keepAttr){en(Oe,b);continue}if(!$t&&dt(/\/>/i,Je)){en(Oe,b);continue}ae&&Cn([E,$,X],wo=>{Je=Hn(Je,wo," ")});const nn=We(b.nodeName);if(!Yt(nn,ht,Je)){en(Oe,b);continue}if(W&&typeof w=="object"&&typeof w.getAttributeType=="function"&&!Ze)switch(w.getAttributeType(nn,ht)){case"TrustedHTML":{Je=ne(Je);break}case"TrustedScriptURL":{Je=W.createScriptURL(Je);break}}if(Je!==xo)try{Ze?b.setAttributeNS(Ze,Oe,Je):b.setAttribute(Oe,Je),Xn(b)?At(b):Il(o.removed)}catch{en(Oe,b)}}_t(v.afterSanitizeAttributes,b,null)},ut=function(b){let L=null;const q=qn(b);for(_t(v.beforeSanitizeShadowDOM,b,null);L=q.nextNode();)if(_t(v.uponSanitizeShadowNode,L,null),Jn(L),ai(L),kn(L.content)&&ut(L.content),(m?m(L):L.nodeType)===Qt.element){const ke=x?x(L):L.shadowRoot;kn(ke)&&(tn(ke),ut(ke))}_t(v.afterSanitizeShadowDOM,b,null)},tn=function(b){const L=m?m(b):b.nodeType;if(L===Qt.element){const ke=x?x(b):b.shadowRoot;kn(ke)&&(tn(ke),ut(ke))}const q=I?I(b):b.childNodes;if(!q)return;const Re=[];Cn(q,ke=>{Un(Re,ke)});for(const ke of Re)tn(ke);if(L===Qt.element){const ke=F?F(b):null;if(typeof ke=="string"&&We(ke)==="template"){const Oe=b.content;kn(Oe)&&tn(Oe)}}};return o.sanitize=function(B){let b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},L=null,q=null,Re=null,ke=null;if(go=!B,go&&(B="<!-->"),typeof B!="string"&&!Zn(B)&&(B=Bm(B),typeof B!="string"))throw Wn("dirty is not a string, aborting");if(!o.isSupported)return B;if(_e||Yn(b),o.removed=[],typeof B=="string"&&(He=!1),He){const St=F?F(B):B.nodeName;if(typeof St=="string"){const ht=We(St);if(!p[ht]||we[ht])throw Wn("root node is forbidden and cannot be sanitized in-place")}if(Xn(B))throw Wn("root node is clobbered and cannot be sanitized in-place");tn(B)}else if(Zn(B))L=Eo("<!---->"),q=L.ownerDocument.importNode(B,!0),q.nodeType===Qt.element&&q.nodeName==="BODY"||q.nodeName==="HTML"?L=q:L.appendChild(q),tn(q);else{if(!lt&&!ae&&!ze&&B.indexOf("<")===-1)return W&&Nt?ne(B):B;if(L=Eo(B),!L)return lt?null:Nt?K:""}L&&Vt&&At(L.firstChild);const Oe=qn(He?B:L);for(;Re=Oe.nextNode();)Jn(Re),ai(Re),kn(Re.content)&&ut(Re.content);if(He)return ae&&Rn(B),B;if(lt){if(ae&&Rn(L),Ct)for(ke=ce.call(L.ownerDocument);L.firstChild;)ke.appendChild(L.firstChild);else ke=L;return(V.shadowroot||V.shadowrootmode)&&(ke=me.call(i,ke,!0)),ke}let Ze=ze?L.outerHTML:L.innerHTML;return ze&&p["!doctype"]&&L.ownerDocument&&L.ownerDocument.doctype&&L.ownerDocument.doctype.name&&dt(Um,L.ownerDocument.doctype.name)&&(Ze="<!DOCTYPE "+L.ownerDocument.doctype.name+`>
|
|
129
|
+
`+Ze),ae&&Cn([E,$,X],St=>{Ze=Hn(Ze,St," ")}),W&&Nt?ne(Ze):Ze},o.setConfig=function(){let B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Yn(B),_e=!0},o.clearConfig=function(){hn=null,_e=!1},o.isValidAttribute=function(B,b,L){hn||Yn({});const q=We(B),Re=We(b);return Yt(q,Re,L)},o.addHook=function(B,b){typeof b=="function"&&Un(v[B],b)},o.removeHook=function(B,b){if(b!==void 0){const L=Sm(v[B],b);return L===-1?void 0:Tm(v[B],L,1)[0]}return Il(v[B])},o.removeHooks=function(B){v[B]=[]},o.removeAllHooks=function(){v=Hl()},o}var jm=Wl();const Km=new Al({gfm:!0,breaks:!0,pedantic:!1,renderer:(()=>{const t=new co;return t.code=({text:o,lang:n})=>{const i=(n??"").toLowerCase(),a=Ci(o,i);return`<pre><code${i?` class="language-${i}"`:""}>${a}</code></pre>`},t})()}),Ym=["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"],qm=["href","title","target","rel","src","alt","class","checked","type","disabled"],Xm=/^(?:(?:https?|mailto|tel|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i;function Zm(t){if(!t)return"";const o=Km.parse(t,{async:!1});return jm.sanitize(o,{ALLOWED_TAGS:Ym,ALLOWED_ATTR:qm,ALLOWED_URI_REGEXP:Xm})}const Jm={class:"zm-note-panel"},Qm={key:0,class:"zm-note-empty"},ep={class:"zm-note-header"},tp={class:"zm-note-title-row"},np={class:"zm-note-name"},op={class:"zm-note-meta"},ip={class:"zm-note-scroll"},rp={class:"zm-note-section"},lp={class:"zm-note-section-head"},ap={class:"zm-note-split"},sp=["disabled"],cp={key:0,class:"zm-note-preview"},dp=["innerHTML"],up={key:1,class:"zm-note-preview-hint"},fp={key:0,class:"zm-note-section-actions"},mp={key:0,class:"zm-note-add-row"},pp={key:1,class:"zm-note-section"},gp=["disabled"],hp=["href","title"],bp={key:2,class:"zm-note-section"},kp=["disabled"],yp=["src","alt"],Ep={key:3,class:"zm-note-section"},xp={class:"zm-note-section-head"},wp={key:0,class:"zm-note-section-tag"},Np=["disabled"],Sp={key:0,class:"zm-note-code"},Tp=["innerHTML"],Cp={key:4,class:"zm-note-section"},Mp=["disabled"],Ap={key:0,class:"zm-note-table"},_p=["onClick"],Rp={class:"zm-note-table-sort-mark","aria-hidden":"true"},Jo=e.defineComponent({__name:"NotePanel",props:{selectedNode:{},readonly:{type:Boolean},focusTick:{}},emits:["apply","remove","set-link","set-image","set-rich"],setup(t,{emit:o}){const n=t,i=o,a=e.ref(""),c=e.ref(null);bi(c,{minRows:4,maxRows:10});const s=e.computed(()=>!a.value||a.value.trim()===""),u=e.computed(()=>Zm(a.value)),d=e.ref(!0);function g(){d.value=!d.value}e.watch(()=>{var y,p,D;return[(y=n.selectedNode)==null?void 0:y.id,(D=(p=n.selectedNode)==null?void 0:p.note)==null?void 0:D.text]},()=>{var y,p;a.value=((p=(y=n.selectedNode)==null?void 0:y.note)==null?void 0:p.text)??""},{immediate:!0}),e.watch(()=>n.focusTick,async()=>{if(n.readonly)return;await e.nextTick();const y=document.querySelector(".zm-note-panel textarea.zm-note-textarea");if(y){y.focus();const p=y.value.length;y.setSelectionRange(p,p)}});function h(){var D,V;if(n.readonly)return;const y=a.value,p=((V=(D=n.selectedNode)==null?void 0:D.note)==null?void 0:V.text)??"";y!==p&&i("apply",y)}function w(y){var p,D;n.readonly||(y.key==="Escape"?(y.preventDefault(),a.value=((D=(p=n.selectedNode)==null?void 0:p.note)==null?void 0:D.text)??"",y.target.blur()):y.key==="Enter"&&(y.ctrlKey||y.metaKey)&&(y.preventDefault(),h(),y.target.blur()))}function C(){n.readonly||confirm("移除该节点的笔记?")&&(a.value="",i("remove"))}const P=e.computed(()=>{var y,p;return!!((p=(y=n.selectedNode)==null?void 0:y.link)!=null&&p.url)}),R=e.computed(()=>{var y,p;return!!((p=(y=n.selectedNode)==null?void 0:y.image)!=null&&p.src)}),U=e.computed(()=>{var y,p;return(p=(y=n.selectedNode)==null?void 0:y.richContent)==null?void 0:p.kind}),I=e.computed(()=>U.value==="code"),A=e.computed(()=>U.value==="table"),x=e.ref(!1),k=e.ref(!1),m=e.ref(!1),F=e.ref(!1);e.watch(()=>{var y;return(y=n.selectedNode)==null?void 0:y.id},()=>{x.value=!1,k.value=!1,m.value=!1,F.value=!1});const W=e.ref("");e.watch(()=>{var y,p,D;return[(y=n.selectedNode)==null?void 0:y.id,(D=(p=n.selectedNode)==null?void 0:p.link)==null?void 0:D.url]},()=>{var y,p;W.value=((p=(y=n.selectedNode)==null?void 0:y.link)==null?void 0:p.url)??""},{immediate:!0});function K(){var D,V;if(n.readonly)return;const y=W.value.trim(),p=((V=(D=n.selectedNode)==null?void 0:D.link)==null?void 0:V.url)??"";y!==p&&i("set-link",y)}const S=e.ref("");e.watch(()=>{var y,p,D;return[(y=n.selectedNode)==null?void 0:y.id,(D=(p=n.selectedNode)==null?void 0:p.image)==null?void 0:D.src]},()=>{var y,p;S.value=((p=(y=n.selectedNode)==null?void 0:y.image)==null?void 0:p.src)??""},{immediate:!0});function ne(){var D,V;if(n.readonly)return;const y=S.value.trim(),p=((V=(D=n.selectedNode)==null?void 0:D.image)==null?void 0:V.src)??"";y!==p&&i("set-image",y)}function se(y){const p=y.target;p.style.display="none"}function re(y){const p=y.target;p.style.display=""}const Z=e.ref(""),ce=e.ref(null);bi(ce,{minRows:4,maxRows:18}),e.watch(()=>{var y,p,D;return[(y=n.selectedNode)==null?void 0:y.id,(D=(p=n.selectedNode)==null?void 0:p.richContent)==null?void 0:D.raw]},()=>{var y,p;Z.value=((p=(y=n.selectedNode)==null?void 0:y.richContent)==null?void 0:p.raw)??""},{immediate:!0});const ie=e.computed(()=>Ci(Go(Z.value),wn(Z.value)));function me(){var V,ee;if(n.readonly)return;const y=Z.value,p=((ee=(V=n.selectedNode)==null?void 0:V.richContent)==null?void 0:ee.raw)??"";if(y===p)return;const D=wn(y)||void 0;i("set-rich",y?{kind:"code",raw:y,lang:D}:null)}const v=e.ref(""),E=e.ref(null);bi(E,{minRows:4,maxRows:14});const $=e.ref(-1),X=e.ref("asc");e.watch(()=>{var y,p,D;return[(y=n.selectedNode)==null?void 0:y.id,(D=(p=n.selectedNode)==null?void 0:p.richContent)==null?void 0:D.raw]},()=>{var y,p;v.value=((p=(y=n.selectedNode)==null?void 0:y.richContent)==null?void 0:p.raw)??"",$.value=-1,X.value="asc"},{immediate:!0});function fe(){var D,V;if(n.readonly)return;const y=v.value,p=((V=(D=n.selectedNode)==null?void 0:D.richContent)==null?void 0:V.raw)??"";y!==p&&i("set-rich",y?{kind:"table",raw:y}:null)}const Ae=e.computed(()=>Mi(v.value)),De=e.computed(()=>{const y=Ae.value;return $.value<0||y.length<=1?y:dl(y,$.value,X.value)});function Pe(y){$.value!==y?($.value=y,X.value="asc"):X.value==="asc"?X.value="desc":$.value=-1}const Me=e.computed(()=>{const y=[];return s.value||y.push(`${a.value.length} 字`),P.value&&y.push("1 链接"),R.value&&y.push("1 图片"),I.value&&y.push("代码块"),A.value&&y.push("表格"),y.length===0?"节点没有额外内容":y.join(" · ")});return(y,p)=>{var D,V,ee,ge;return e.openBlock(),e.createElementBlock("div",Jm,[t.selectedNode?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",ep,[e.createElementVNode("div",tp,[p[12]||(p[12]=e.createElementVNode("span",{class:"zm-note-label"},"节点",-1)),e.createElementVNode("span",np,e.toDisplayString(t.selectedNode.text||"(无标题)"),1)]),e.createElementVNode("div",op,e.toDisplayString(Me.value),1)]),e.createElementVNode("div",ip,[e.createElementVNode("section",rp,[e.createElementVNode("header",lp,[p[13]||(p[13]=e.createElementVNode("span",{class:"zm-note-section-title"},"笔记",-1)),p[14]||(p[14]=e.createElementVNode("span",{class:"zm-note-section-hint"},"Ctrl+Enter 提交, Esc 取消",-1)),t.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"zm-note-preview-toggle",onClick:g},e.toDisplayString(d.value?"隐藏预览":"显示预览"),1))]),e.createElementVNode("div",ap,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"noteRef",ref:c,"onUpdate:modelValue":p[0]||(p[0]=we=>a.value=we),class:"zm-note-textarea",placeholder:"写点什么吧… 支持 Markdown",spellcheck:"false",disabled:t.readonly,onBlur:h,onKeydown:w},null,40,sp),[[e.vModelText,a.value]]),d.value?(e.openBlock(),e.createElementBlock("div",cp,[s.value?(e.openBlock(),e.createElementBlock("div",up," 渲染后的 Markdown 仅在此面板显示,不会撑大节点框。 ")):(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-note-preview-body",innerHTML:u.value},null,8,dp))])):e.createCommentVNode("",!0)]),!t.readonly&&!s.value?(e.openBlock(),e.createElementBlock("div",fp,[e.createElementVNode("button",{class:"zm-note-action-btn is-danger",onClick:C},"移除笔记")])):e.createCommentVNode("",!0)]),t.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",mp,[!P.value&&!x.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-note-add-chip",onClick:p[1]||(p[1]=we=>x.value=!0)},"+ 链接")):e.createCommentVNode("",!0),!R.value&&!k.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-note-add-chip",onClick:p[2]||(p[2]=we=>k.value=!0)},"+ 图片")):e.createCommentVNode("",!0),!I.value&&!m.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-note-add-chip",onClick:p[3]||(p[3]=we=>m.value=!0)},"+ 代码块")):e.createCommentVNode("",!0),!A.value&&!F.value?(e.openBlock(),e.createElementBlock("button",{key:3,class:"zm-note-add-chip",onClick:p[4]||(p[4]=we=>F.value=!0)},"+ 表格")):e.createCommentVNode("",!0)])),P.value||x.value?(e.openBlock(),e.createElementBlock("section",pp,[p[15]||(p[15]=e.createElementVNode("header",{class:"zm-note-section-head"},[e.createElementVNode("span",{class:"zm-note-section-title"},"链接")],-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":p[5]||(p[5]=we=>W.value=we),class:"zm-note-input",type:"url",placeholder:"https://…",disabled:t.readonly,onBlur:K,onKeydown:p[6]||(p[6]=e.withKeys(e.withModifiers(we=>we.target.blur(),["prevent"]),["enter"]))},null,40,gp),[[e.vModelText,W.value]]),P.value?(e.openBlock(),e.createElementBlock("a",{key:0,class:"zm-note-link-chip",href:(D=t.selectedNode.link)==null?void 0:D.url,target:"_blank",rel:"noopener noreferrer",title:(V=t.selectedNode.link)==null?void 0:V.url},e.toDisplayString((ee=t.selectedNode.link)==null?void 0:ee.url),9,hp)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),R.value||k.value?(e.openBlock(),e.createElementBlock("section",bp,[p[16]||(p[16]=e.createElementVNode("header",{class:"zm-note-section-head"},[e.createElementVNode("span",{class:"zm-note-section-title"},"图片")],-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":p[7]||(p[7]=we=>S.value=we),class:"zm-note-input",type:"url",placeholder:"data:image/… 或 https://…",disabled:t.readonly,onBlur:ne,onKeydown:p[8]||(p[8]=e.withKeys(e.withModifiers(we=>we.target.blur(),["prevent"]),["enter"]))},null,40,kp),[[e.vModelText,S.value]]),R.value?(e.openBlock(),e.createElementBlock("img",{key:0,class:"zm-note-image",src:(ge=t.selectedNode.image)==null?void 0:ge.src,alt:t.selectedNode.text,onError:se,onLoad:re},null,40,yp)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),I.value||m.value?(e.openBlock(),e.createElementBlock("section",Ep,[e.createElementVNode("header",xp,[p[17]||(p[17]=e.createElementVNode("span",{class:"zm-note-section-title"},"代码块",-1)),e.unref(wn)(Z.value)?(e.openBlock(),e.createElementBlock("span",wp,e.toDisplayString(e.unref(wn)(Z.value)),1)):e.createCommentVNode("",!0)]),e.withDirectives(e.createElementVNode("textarea",{ref_key:"codeRef",ref:ce,"onUpdate:modelValue":p[9]||(p[9]=we=>Z.value=we),class:"zm-note-input zm-note-input-code",placeholder:"```ts\nconsole.log(123)\n```",spellcheck:"false",disabled:t.readonly,onBlur:me},null,40,Np),[[e.vModelText,Z.value]]),Z.value.trim()?(e.openBlock(),e.createElementBlock("pre",Sp,[e.createElementVNode("code",{innerHTML:ie.value},null,8,Tp)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),A.value||F.value?(e.openBlock(),e.createElementBlock("section",Cp,[p[18]||(p[18]=e.createElementVNode("header",{class:"zm-note-section-head"},[e.createElementVNode("span",{class:"zm-note-section-title"},"表格"),e.createElementVNode("span",{class:"zm-note-section-hint"},"点击表头排序")],-1)),e.withDirectives(e.createElementVNode("textarea",{ref_key:"tableRef",ref:E,"onUpdate:modelValue":p[10]||(p[10]=we=>v.value=we),class:"zm-note-input zm-note-input-code",placeholder:`| 列1 | 列2 |
|
|
128
130
|
| --- | --- |
|
|
129
|
-
| a | b |`,spellcheck:"false",disabled:t.readonly,onBlur:
|
|
130
|
-
`:"```\n",
|
|
131
|
+
| a | b |`,spellcheck:"false",disabled:t.readonly,onBlur:fe},null,40,Mp),[[e.vModelText,v.value]]),Ae.value.length?(e.openBlock(),e.createElementBlock("table",Ap,[e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(De.value,(we,tt)=>(e.openBlock(),e.createElementBlock("tr",{key:tt},[tt===0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(we,(je,rt)=>(e.openBlock(),e.createElementBlock("th",{key:`h${rt}`,class:e.normalizeClass(["zm-note-table-sort",{"is-sorted":$.value===rt,"is-asc":$.value===rt&&X.value==="asc","is-desc":$.value===rt&&X.value==="desc"}]),onClick:nt=>Pe(rt)},[e.createElementVNode("span",null,e.toDisplayString(je),1),e.createElementVNode("span",Rp,e.toDisplayString($.value===rt?X.value==="asc"?"▲":"▼":"↕"),1)],10,_p))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(we,(je,rt)=>(e.openBlock(),e.createElementBlock("td",{key:`c${rt}`},e.toDisplayString(je),1))),128))]))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])],64)):(e.openBlock(),e.createElementBlock("div",Qm,[...p[11]||(p[11]=[e.createElementVNode("p",null,"请先在画布上选中一个节点。",-1),e.createElementVNode("p",{class:"zm-note-hint"}," 选中节点后,会在这里展示并可编辑节点的笔记、链接、图片、代码块、表格。 ",-1)])]))])}}}),Bp=["viewBox","width","height"],vp={class:"zm-edges"},Ip=["d","fill"],zp=["data-node-id","onClick","onPointerdown","onDblclick","onContextmenu","onMouseenter","onMouseleave"],Op=["src","width","height","alt"],Lp=["onDblclick"],Dp={key:0,class:"zm-rich-code"},$p=["innerHTML"],Vp={key:1,class:"zm-rich-table"},Pp=["onClick"],Fp={class:"zm-rich-sort-mark","aria-hidden":"true"},Up={key:2,class:"zm-text"},Hp={key:0,class:"zm-node-markers"},Wp=["title","innerHTML"],Gp={class:"zm-text-label"},jp=["href","title"],Kp=["title","onClick"],Yp={key:4,class:"zm-node-tags"},qp=["title"],Xp=["title","onClick"],Zp=["onClick"],Jp=["onMousedown"],Qp=["onClick"],eg=["title"],tg={class:"zm-tb-tip zm-tb-zoom"},ng=["src"],og=["src"],Mn=24,Gn=400,pn=160,Gl=4,Qo=e.defineComponent({__name:"MindMap",props:{data:{},theme:{},previewMode:{type:Boolean,default:!1},markdown:{},lineColors:{},hideCanvasActions:{type:Boolean,default:!1},builtInDrawers:{type:Boolean,default:!0}},emits:["change","select","edit-note","markdownChange","canvas-toggle-preview","canvas-outline","canvas-settings","canvas-data","canvas-import"],setup(t,{expose:o,emit:n}){const i=t,a=n,c=e.ref(null),s=e.ref(null),u=e.ref(""),d=e.ref(new Set),g=e.computed(()=>d.value.values().next().value??null),h=e.ref(new Set),w=e.ref(!1),C=e.ref(null),P=e.ref(0),R=e.ref(0),U=e.ref(null),I=e.ref(null),A=e.ref(null),x=e.ref(""),k=e.ref(new Map),m=e.ref(Ot(i.data)),F=e.ref({}),W=e.ref({}),K=e.ref(i.markdown!==void 0);let S=!1;e.watch(()=>i.markdown,r=>{if(r===void 0){K.value=!1;return}K.value=!0;const l=zn(r||"");S=!0,m.value=Ot(l),d.value=new Set,h.value=new Set,Ee(),e.nextTick(()=>{S=!1,sn()})}),e.watch(m,()=>{K.value&&!S&&a("markdownChange",On(m.value))},{deep:!0});const ne=e.computed(()=>B.showOrderBadge===!0),se=e.ref(new Map),re=se.value;function Z(r,l){const f={};l.bg&&(f.bg=l.bg),l.textColor&&(f.textColor=l.textColor),l.borderColor&&(f.borderColor=l.borderColor),l.fontWeight&&(f.fontWeight=l.fontWeight),l.fontSize&&(f.fontSize=l.fontSize),Object.keys(f).length===0?re.delete(r):re.set(r,f),se.value=new Map(re)}function ce(r){return re.get(r)??{}}function ie(r,l){const f=ue(m.value,r);f&&(f.image={src:l.src,naturalW:l.naturalW,naturalH:l.naturalH,width:E(l.width,Mn,Gn),height:E(l.height,Mn,Gn)},$e(),Ee(),a("change",m.value))}function me(r){const l=ue(m.value,r);!l||!l.image||(delete l.image,$e(),Ee(),a("change",m.value))}function v(r,l){const f=l.trim();if(!ue(m.value,r))return;if(!f){me(r);return}const N=new Image;N.onload=()=>{const O=ue(m.value,r);if(!O)return;const _=N.naturalWidth&&N.naturalHeight?N.naturalWidth/N.naturalHeight:1,z=E(N.naturalWidth||pn,Mn,Gn),G=Math.round(z/_);O.image={src:f,naturalW:N.naturalWidth||z,naturalH:N.naturalHeight||G,width:z,height:G},$e(),Ee(),a("change",m.value)},N.onerror=()=>{},N.src=f}function E(r,l,f){return Math.min(f,Math.max(l,r))}function $(r,l){const f=new FileReader;f.onload=()=>{if(typeof f.result!="string")return;const M=f.result,N=new window.Image;N.onload=()=>{const O=N.naturalWidth||pn,_=N.naturalHeight||pn,z=E(O,Mn,pn),G=E(Math.round(_*z/O),Mn,Gn);l({src:M,naturalW:O,naturalH:_,width:z,height:G})},N.onerror=()=>{l({src:M,naturalW:pn,naturalH:pn,width:pn,height:pn})},N.src=M},f.readAsDataURL(r)}function X(r){const l=document.createElement("input");l.type="file",l.accept="image/*",l.style.display="none",l.onchange=()=>{var M;const f=(M=l.files)==null?void 0:M[0];f&&($(f,N=>ie(r,N)),document.body.removeChild(l))},document.body.appendChild(l),l.click()}function fe(r,l){const f=l.trim(),M=ue(m.value,r);M&&(f?M.link={url:f}:delete M.link,$e(),Ee(),a("change",m.value))}function Ae(r){fe(r,"")}function De(r,l){const f=ue(m.value,r);f&&(l?f.note={text:l}:delete f.note,$e(),Ee(),a("change",m.value))}function Pe(r){De(r,"")}function Me(r,l){const f=ue(m.value,r);f&&(l?f.richContent=l:delete f.richContent,$e(),Ee(),a("change",m.value))}const y=e.ref(null),p=e.ref(null),D=e.computed(()=>["zm-canvas-fab","zm-canvas-fab-preview",!i.hideCanvasActions&&(!i.previewMode||w.value)?"is-visible":""].filter(Boolean).join(" ")),V=e.computed(()=>["zm-canvas-fab","zm-canvas-fab-outline",!i.hideCanvasActions&&(!i.previewMode||w.value)?"is-visible":""].filter(Boolean).join(" "));function ee(r,l){i.previewMode||(r.preventDefault(),r.stopPropagation(),p.value=null,d.value=new Set([l.id]),kt(),y.value={nodeId:l.id,x:r.clientX,y:r.clientY})}function ge(){y.value=null}function we(r){const l=r.target;if(!(l!=null&&l.closest(".zm-toolbar, button, input, textarea, .zm-canvas-fab-preview, .zm-canvas-fab-outline"))){if(di&&de.panMoved.value){di=!1,r.preventDefault();return}r.preventDefault(),y.value&&(y.value=null),p.value={x:r.clientX,y:r.clientY}}}function tt(){p.value=null}function je(){tt(),i.builtInDrawers&&(Ct(),ze.value=!0),a("canvas-settings")}function rt(){tt(),i.builtInDrawers&&(Ct(),$t.value=!0),a("canvas-data")}function nt(r){tt(),i.builtInDrawers&&(Ct(),Vt.value=r,$t.value=!0),a("canvas-import",r)}const an=e.ref(!1),$t=e.ref(!1),ae=e.ref(!1),gt=e.ref(!1),ze=e.ref(!1),_e=e.ref(0),Vt=e.ref(null),lt=e.ref(new Set);function Ct(){$t.value=!1,ae.value=!1,gt.value=!1,ze.value=!1}const Nt=e.computed(()=>{const r=g.value;return r?ue(m.value,r)??null:null}),Y=e.computed(()=>Nt.value?ce(Nt.value.id):{});function te(r){r.autoBalanceOnChange!==void 0&&(B.autoBalanceOnChange=r.autoBalanceOnChange),r.lineWidthStart!==void 0&&(B.lineWidthStart=Math.max(.5,Math.min(20,r.lineWidthStart))),r.lineWidthEnd!==void 0&&(B.lineWidthEnd=Math.max(.3,Math.min(10,r.lineWidthEnd))),r.rainbowBranch!==void 0&&(B.rainbowBranch=r.rainbowBranch),r.branchPaletteId!==void 0&&(B.branchPaletteId=r.branchPaletteId),r.customPalettes!==void 0&&(B.customPalettes=r.customPalettes),r.lineStyle!==void 0&&(B.lineStyle=r.lineStyle),r.rootLineStyle!==void 0&&(B.rootLineStyle=r.rootLineStyle),r.lineOrigin!==void 0&&(B.lineOrigin=r.lineOrigin),r.taperedEdge!==void 0&&(B.taperedEdge=r.taperedEdge),r.lineWidthTaper!==void 0&&(B.lineWidthTaper=Math.max(.3,Math.min(1,r.lineWidthTaper))),r.showOrderBadge!==void 0&&(B.showOrderBadge=r.showOrderBadge),r.canvasBg!==void 0&&(B.canvasBg=r.canvasBg)}function he(r){Nt.value&&Z(Nt.value.id,r)}function Se(){const r={autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"rounded-elbow",rootLineStyle:"arc",lineOrigin:"proportional",layoutMode:"mindmap",taperedEdge:!0,lineWidthTaper:.67,showOrderBadge:!1,canvasBg:void 0};B.autoBalanceOnChange=r.autoBalanceOnChange,B.lineWidthStart=r.lineWidthStart,B.lineWidthEnd=r.lineWidthEnd,B.rainbowBranch=r.rainbowBranch,B.branchPaletteId=r.branchPaletteId,B.customPalettes=r.customPalettes,B.lineStyle=r.lineStyle,B.rootLineStyle=r.rootLineStyle,B.lineOrigin=r.lineOrigin,B.layoutMode=r.layoutMode,B.taperedEdge=r.taperedEdge,B.lineWidthTaper=r.lineWidthTaper,B.showOrderBadge=r.showOrderBadge,B.canvasBg=r.canvasBg}function He(){Vt.value=null}function at(r){const l=g.value;l&&De(l,r)}function Mt(){const r=g.value;r&&Pe(r)}function An(r){const l=g.value;l&&fe(l,r)}function ti(r){const l=g.value;l&&v(l,r)}function ni(r){const l=g.value;l&&Me(l,r)}function po(r){const l=document.querySelector(`[data-node-id="${r.id}"]`);l&&l.click()}function oi(r){ma(r.id,r.text)}function jn(r){no(r)}function Kn(r){si(r)}function Pt(r){Ji(r.srcId,r.targetId,r.position)}function gn(r){const l=new Set(lt.value);l.has(r)?l.delete(r):l.add(r),lt.value=l}function go(){i.builtInDrawers&&(an.value=!an.value),a("canvas-outline")}function ho(){var l;const r=(l=y.value)==null?void 0:l.nodeId;r&&X(r)}function Gi(){var M,N,O;const r=(M=y.value)==null?void 0:M.nodeId;if(!r)return;const l=((O=(N=ue(m.value,r))==null?void 0:N.link)==null?void 0:O.url)??"",f=window.prompt("输入链接 URL(留空取消)",l);f!==null&&fe(r,f)}function bo(){var l;const r=(l=y.value)==null?void 0:l.nodeId;r&&Ae(r)}function ko(){var l;const r=(l=y.value)==null?void 0:l.nodeId;r&&ri(r)}function ji(){var l;const r=(l=y.value)==null?void 0:l.nodeId;r&&Pe(r)}function _n(){var l;const r=(l=y.value)==null?void 0:l.nodeId;r&&me(r)}function ii(){var pe,T;const r=(pe=y.value)==null?void 0:pe.nodeId;if(!r)return;const l=(T=ue(m.value,r))==null?void 0:T.richContent,f=(l==null?void 0:l.kind)==="code"?Go(l.raw):"",M=(l==null?void 0:l.kind)==="code"&&l.lang||"",N=M?"```"+M+`
|
|
132
|
+
`:"```\n",_=window.prompt("输入代码块内容(用 ```lang 包裹;留空取消)",f?N+f+(f.endsWith("```")?"":"\n```"):N+"// 你的代码"+"\n```");if(_===null)return;const z=_.trim();if(!z){Me(r,null);return}const G=/^```([^\s`]*)/.exec(z),j=G?G[1]:void 0;Me(r,{kind:"code",raw:z,lang:j})}function Ki(){var l;const r=(l=y.value)==null?void 0:l.nodeId;r&&Me(r,null)}function We(){var _,z;const r=(_=y.value)==null?void 0:_.nodeId;if(!r)return;const l=(z=ue(m.value,r))==null?void 0:z.richContent,f=(l==null?void 0:l.kind)==="table"?l.raw:"",N=window.prompt("输入 markdown 表格(每行以 | 分隔;留空取消)",f||`| 列1 | 列2 | 列3 |
|
|
131
133
|
| --- | --- | --- |
|
|
132
|
-
| a | b | c |`);if(w===null)return;const z=w.trim();if(!z){Ae(r,null);return}Ae(r,{kind:"table",raw:z})}function pn(){var l;const r=(l=E.value)==null?void 0:l.nodeId;r&&Ae(r,null)}function ri(r){i.previewMode||(i.builtInDrawers&&(At(),kt.value=!0,Re.value++),a("edit-note",r))}function li(r,l=60){const f=r.replace(/\s+/g," ").trim();return f.length<=l?f||"点击编辑笔记":f.slice(0,l)+"…"}function Kn(r){var w;if(i.previewMode||s.value)return;const l=r.target;if(l&&(l.tagName==="INPUT"||l.tagName==="TEXTAREA"||l.isContentEditable))return;const f=g.value;if(!f)return;const A=(w=r.clipboardData)==null?void 0:w.items;if(A)for(let z=0;z<A.length;z++){const M=A[z];if(M.kind==="file"&&M.type.startsWith("image/")){const W=M.getAsFile();if(!W)continue;r.preventDefault();const te=le(m.value,f);if(te!=null&&te.image&&!window.confirm("该节点已有图片,要用剪贴板里的图片替换吗?"))return;U(W,me=>ie(f,me));return}}}e.onMounted(()=>{window.addEventListener("paste",Kn),window.addEventListener("keydown",yo),ke()}),e.onBeforeUnmount(()=>{window.removeEventListener("paste",Kn),window.removeEventListener("keydown",yo)});function yo(r){if((r.metaKey||r.ctrlKey)&&(r.key==="f"||r.key==="F")){const f=r.target;if(f&&(f.tagName==="INPUT"||f.tagName==="TEXTAREA"||f.isContentEditable))return;r.preventDefault(),a("canvas-outline")}}const gn=e.ref(null),Yi=e.computed(()=>{var r;return((r=gn.value)==null?void 0:r.nodeId)??null});function Mt(r,l){if(!l.image)return;r.preventDefault(),r.stopPropagation();const f=l.image.naturalW||l.image.width,A=l.image.naturalH||l.image.height,w=A>0?A/f:1;gn.value={nodeId:l.id,startX:r.clientX,startY:r.clientY,startW:l.image.width,startH:l.image.height,naturalW:f,naturalH:A,ratio:w,pendingW:l.image.width,pendingH:l.image.height},window.addEventListener("mousemove",en),window.addEventListener("mouseup",Eo)}function en(r){var te,me;const l=gn.value;if(!l)return;const f=re.scale.value||1,A=r.clientX-l.startX,w=V(l.startW+A/f,An,Wn),z=V(w*l.ratio,An,Wn);l.pendingW=w,l.pendingH=z;const M=(te=c.value)==null?void 0:te.querySelector(`[data-node-id="${l.nodeId}"] .zm-node-img`);M&&(M.style.width=`${w}px`,M.style.height=`${z}px`);const W=(me=c.value)==null?void 0:me.querySelector(`[data-node-id="${l.nodeId}"]`);W&&(W.style.minWidth=`${Math.max(80,Math.ceil(w+28))}px`,W.style.height=`${Math.ceil(z+8+30)}px`)}function Eo(){const r=gn.value;if(window.removeEventListener("mousemove",en),window.removeEventListener("mouseup",Eo),gn.value=null,!r)return;const l=le(m.value,r.nodeId);!l||!l.image||(ie(r.nodeId,{src:l.image.src,naturalW:l.image.naturalW,naturalH:l.image.naturalH,width:r.pendingW,height:r.pendingH}),d.value=new Set([r.nodeId]),Et(),Rn=!0)}const Yn=e.ref(null);let Rn=!1;function qn(r){Yn.value=r}function hn(r){Yn.value===r&&(Yn.value=null),B.value&&(B.value=null)}function Xn(r,l){var mt;if(!l.text||l.text.length<14)return;const A=r.currentTarget.getBoundingClientRect(),w=(mt=c.value)==null?void 0:mt.getBoundingClientRect();if(!w)return;const z=10,M=240,W=A.top-w.top>60,te=A.left-w.left+A.width/2,me=z+M/2,Pe=w.width-M/2-z,T=Math.max(me,Math.min(te,Pe)),Ze=W?A.top-w.top-8:A.bottom-w.top+8;B.value={text:l.text,x:T,y:Ze,above:W}}const Rt=e.ref(0),Zn=e.ref(!1),Kt=ns(100);function Oe(){Kt.record({data:m.value,selectedIds:[...d.value]})}function ke(){h.value=new Set(h.value),Rt.value++,e.nextTick().then(()=>e.nextTick()).then(()=>ai()).then(()=>{Rt.value++})}function ai(){const r=document.querySelectorAll(".zm-rich"),l={},f={};r.forEach(A=>{let w=A,z=null;for(;w&&!z;)z=w.getAttribute("data-node-id"),w=w.parentElement;if(!z)return;const M=A.offsetHeight,W=A.scrollWidth,te=Math.round(M*2)/2,me=Math.round(W*2)/2;l[z]=te,f[z]=me,P.value[z],L.value[z]}),P.value=l,L.value=f}const ut=e.computed(()=>{var r,l,f,A,w,z,M,W,te,me;return{rootBg:((r=i.theme)==null?void 0:r.rootBg)??"#1f2937",rootText:((l=i.theme)==null?void 0:l.rootText)??"#ffffff",branchBg:((f=i.theme)==null?void 0:f.branchBg)??"#ffffff",branchText:((A=i.theme)==null?void 0:A.branchText)??"#1f2937",lineColor:((w=i.theme)==null?void 0:w.lineColor)??"#94a3b8",bgColor:((z=i.theme)==null?void 0:z.bgColor)??"#f8fafc",fontSize:((M=i.theme)==null?void 0:M.fontSize)??14,lineWidthStart:((W=i.theme)==null?void 0:W.lineWidthStart)??2.2,lineWidthEnd:((te=i.theme)==null?void 0:te.lineWidthEnd)??.8,rainbowBranch:((me=i.theme)==null?void 0:me.rainbowBranch)??!1}}),tn=e.computed(()=>v.canvasBg||ut.value.bgColor),v=e.reactive({autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:3.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"curve",lineOrigin:"edge",layoutMode:"mindmap",taperedEdge:!0,showOrderBadge:!1,canvasBg:void 0});function b(r){return v.taperedEdge?G(r):_e(r)}function I(r){return v.taperedEdge?v.lineWidthEnd:_e(r)}function G(r){return r<=0?v.lineWidthStart:r===1?Math.max(1.5,v.lineWidthStart*.67):r===2?Math.max(.8,v.lineWidthStart*.42):v.lineWidthEnd}function _e(r){if(r<=0)return v.lineWidthStart;if(r>=3)return v.lineWidthEnd;const l=r/3;return v.lineWidthStart+(v.lineWidthEnd-v.lineWidthStart)*l}function he(r,l,f,A){const w=1-r,z=w*w*w*l.x+3*w*w*r*f.x1+3*w*r*r*f.x2+r*r*r*A.x,M=w*w*w*l.y+3*w*w*r*f.y1+3*w*r*r*f.y2+r*r*r*A.y;return{x:z,y:M}}function Be(r,l,f,A){const w=1-r,z=w*w*l.x+2*w*r*f.x+r*r*A.x,M=w*w*l.y+2*w*r*f.y+r*r*A.y;return{x:z,y:M}}function Ye(r,l,f,A,w=32,z="curve",M="right"){if(z==="curve"){let ne;if(M==="right"||M==="left"){const be=Math.abs(l.x-r.x)*.45,we=M==="right"?1:-1;ne={x1:r.x+we*be,y1:r.y,x2:l.x-we*be,y2:l.y}}else{const be=Math.abs(l.y-r.y)*.45;ne={x1:r.x,y1:r.y+be,x2:l.x,y2:l.y-be}}const xt=ce=>{const be=1-ce,we=-3*be*be*r.x+3*(be*be-2*be*ce)*ne.x1+3*(2*be*ce-ce*ce)*ne.x2+3*ce*ce*l.x,Je=-3*be*be*r.y+3*(be*be-2*be*ce)*ne.y1+3*(2*be*ce-ce*ce)*ne.y2+3*ce*ce*l.y;return{dx:we,dy:Je}},Ge=[],We=[];for(let ce=0;ce<=w;ce++){const be=ce/w,we=ce===0?r:ce===w?l:he(be,r,ne,l),Je=xt(be);let ct=Math.hypot(Je.dx,Je.dy);ct<1e-6&&(ct=1);const Fe=-Je.dy/ct,q=Je.dx/ct,Ce=(f+(A-f)*be)/2;Ge.push({x:we.x+Fe*Ce,y:we.y+q*Ce}),We.push({x:we.x-Fe*Ce,y:we.y-q*Ce})}let pt=`M ${Ge[0].x.toFixed(2)} ${Ge[0].y.toFixed(2)}`;for(let ce=1;ce<=w;ce++)pt+=` L ${Ge[ce].x.toFixed(2)} ${Ge[ce].y.toFixed(2)}`;for(let ce=w;ce>=0;ce--)pt+=` L ${We[ce].x.toFixed(2)} ${We[ce].y.toFixed(2)}`;return pt+=" Z",pt}if(z==="arc"){let ne;M==="right"||M==="left"?ne={x:(r.x+l.x)/2,y:l.y}:ne={x:l.x,y:(r.y+l.y)/2};const xt=we=>{const Je=1-we,ct=2*Je*(ne.x-r.x)+2*we*(l.x-ne.x),Fe=2*Je*(ne.y-r.y)+2*we*(l.y-ne.y);return{dx:ct,dy:Fe}},Ge=[],We=[];for(let we=0;we<=w;we++){const Je=we/w,ct=we===0?r:we===w?l:Be(Je,r,ne,l),Fe=xt(Je);let q=Math.hypot(Fe.dx,Fe.dy);q<1e-6&&(q=1);const Ce=-Fe.dy/q,Qe=Fe.dx/q,pe=(f+(A-f)*Je)/2;Ge.push({x:ct.x+Ce*pe,y:ct.y+Qe*pe}),We.push({x:ct.x-Ce*pe,y:ct.y-Qe*pe})}const pt=f/2,ce=A/2;let be=`M ${Ge[0].x.toFixed(2)} ${Ge[0].y.toFixed(2)}`;for(let we=1;we<=w;we++)be+=` L ${Ge[we].x.toFixed(2)} ${Ge[we].y.toFixed(2)}`;be+=` A ${ce.toFixed(2)} ${ce.toFixed(2)} 0 0 0 ${We[w].x.toFixed(2)} ${We[w].y.toFixed(2)}`;for(let we=w-1;we>=0;we--)be+=` L ${We[we].x.toFixed(2)} ${We[we].y.toFixed(2)}`;return be+=` A ${pt.toFixed(2)} ${pt.toFixed(2)} 0 0 0 ${Ge[0].x.toFixed(2)} ${Ge[0].y.toFixed(2)}`,be+=" Z",be}if(z==="elbow"){const ne=[];if(M==="down"){const q=(r.y+l.y)/2;ne.push(r,{x:r.x,y:q},{x:l.x,y:q},l)}else{const q=(r.x+l.x)/2;ne.push(r,{x:q,y:r.y},{x:q,y:l.y},l)}const xt=[];let Ge=0;for(let q=0;q<ne.length-1;q++){const Ce=Math.hypot(ne[q+1].x-ne[q].x,ne[q+1].y-ne[q].y);xt.push(Ce),Ge+=Ce}const We=[f/2];let pt=0;for(let q=0;q<xt.length-1;q++){pt+=xt[q];const Ce=Ge>0?pt/Ge:0;We.push((f+(A-f)*Ce)/2)}We.push(A/2);const ce=[];for(let q=0;q<ne.length-1;q++){const Ce=ne[q+1].x-ne[q].x,Qe=ne[q+1].y-ne[q].y;let pe=Math.hypot(Ce,Qe);pe<1e-6&&(pe=1),ce.push({x:-Qe/pe,y:Ce/pe})}const be=[],we=[];be.push({x:ne[0].x+ce[0].x*We[0],y:ne[0].y+ce[0].y*We[0]}),we.push({x:ne[0].x-ce[0].x*We[0],y:ne[0].y-ce[0].y*We[0]});for(let q=1;q<ne.length-1;q++){const Ce=ce[q-1],Qe=ce[q],pe=We[q];be.push({x:ne[q].x+Ce.x*pe+Qe.x*pe,y:ne[q].y+Ce.y*pe+Qe.y*pe}),we.push({x:ne[q].x-Ce.x*pe-Qe.x*pe,y:ne[q].y-Ce.y*pe-Qe.y*pe})}const Je=ce[ce.length-1],ct=We[We.length-1];be.push({x:ne[ne.length-1].x+Je.x*ct,y:ne[ne.length-1].y+Je.y*ct}),we.push({x:ne[ne.length-1].x-Je.x*ct,y:ne[ne.length-1].y-Je.y*ct});let Fe=`M ${be[0].x.toFixed(2)} ${be[0].y.toFixed(2)}`;for(let q=1;q<be.length;q++)Fe+=` L ${be[q].x.toFixed(2)} ${be[q].y.toFixed(2)}`;for(let q=we.length-1;q>=0;q--)Fe+=` L ${we[q].x.toFixed(2)} ${we[q].y.toFixed(2)}`;return Fe+=" Z",Fe}const W=l.x-r.x,te=l.y-r.y;let me=Math.hypot(W,te);me<1e-6&&(me=1);const Pe=-te/me,T=W/me,Ze=f/2,mt=A/2,se={x:r.x+Pe*Ze,y:r.y+T*Ze},at={x:r.x-Pe*Ze,y:r.y-T*Ze},qt={x:l.x-Pe*mt,y:l.y-T*mt},st={x:l.x+Pe*mt,y:l.y+T*mt};return`M ${se.x.toFixed(2)} ${se.y.toFixed(2)} L ${st.x.toFixed(2)} ${st.y.toFixed(2)} L ${qt.x.toFixed(2)} ${qt.y.toFixed(2)} L ${at.x.toFixed(2)} ${at.y.toFixed(2)} Z`}const ft=e.computed(()=>yt.value.root.children),vt=on[0].colors,Jn=e.computed(()=>Fa(v.branchPaletteId,v.customPalettes)),Ve=e.computed(()=>{const r=new Map;if(!v.rainbowBranch)return r;const l=i.lineColors,f=l&&l.length>0?l:Jn.value.colors.length>0?Jn.value.colors:vt;for(let w=0;w<ft.value.length;w++){const z=ft.value[w];r.set(z.id,f[w%f.length])}const A=(w,z)=>{r.set(w.id,z);for(const M of w.children)A(M,z)};for(let w=0;w<ft.value.length;w++){const z=ft.value[w];A(z,f[w%f.length])}return r});function xo(r,l){return v.rainbowBranch?Ve.value.get(l.id)??ut.value.lineColor:ut.value.lineColor}function wo(r){const l=oe(r.id);if(l.bg)return l.bg;if(r.isRoot)return ut.value.rootBg;if(v.rainbowBranch){const f=Ve.value.get(r.id);if(f)return Wp(f,.18)}return ut.value.branchBg}function Qn(r){const l=oe(r.id);if(l.textColor)return l.textColor;if(r.isRoot)return ut.value.rootText;if(v.rainbowBranch){const f=Ve.value.get(r.id);if(f)return jl(f,.55)}return ut.value.branchText}function eo(r){const l=oe(r.id);if(l.borderColor)return l.borderColor;if(r.isRoot)return ut.value.rootBg;if(v.rainbowBranch){const f=Ve.value.get(r.id);if(f)return jl(f,.3)}return ut.value.lineColor}function Wl(r){const l=oe(r.id);return l.fontWeight?l.fontWeight:r.isRoot?700:r.depth<=1?600:r.depth===2?500:400}function Gl(r){return oe(r.id).fontSize??r.fontSize??ut.value.fontSize}function Wp(r,l){const f=r.replace("#",""),A=f.length===6?f:f.split("").map(W=>W+W).join(""),w=parseInt(A.slice(0,2),16),z=parseInt(A.slice(2,4),16),M=parseInt(A.slice(4,6),16);return`rgba(${w}, ${z}, ${M}, ${l})`}function jl(r,l){const f=r.replace("#",""),A=f.length===6?f:f.split("").map(W=>W+W).join(""),w=Math.round(parseInt(A.slice(0,2),16)*(1-l)),z=Math.round(parseInt(A.slice(2,4),16)*(1-l)),M=Math.round(parseInt(A.slice(4,6),16)*(1-l));return`rgb(${w}, ${z}, ${M})`}const re=Qa({getContainer:()=>c.value});re.setOnMarqueeEnd(cg),ts({isEditing:()=>s.value!==null,isReadonly:()=>i.previewMode,getSelectedId:()=>g.value,getSelectedIds:()=>[...d.value],defaultTargetId:()=>m.value.id,onAddChild:no,onAddSibling:si,onAddSiblingBefore:eg,onRemove:oa,onStartEdit:No,onClearSelection:()=>{d.value=new Set,Et()},onDuplicate:Zl,onCopy:ea,onCut:ta,onPaste:na,hasClipboard:()=>!!F.value&&F.value.nodes.length>0,onUndo:Xi,onRedo:Zi,onNavigate:tg,onSelectRoot:()=>{d.value=new Set([m.value.id]),Et()}});const yt=e.computed(()=>{const r=Lt(m.value);return ql(r),Da(r,{mode:v.layoutMode,baseFontSize:ut.value.fontSize,richHeights:P.value,richWidths:L.value})}),Kl=e.ref([]),to=e.computed(()=>(Rt.value,Kl.value));e.watch(yt,r=>{const l=[],f=A=>{l.push(A);for(const w of A.children)f(w)};f(r.root),Kl.value=l},{immediate:!0});const Yl=e.computed(()=>{const r=[];for(const l of to.value)for(const f of l.children)r.push({from:l,to:f,key:`${l.id}->${f.id}`});return r}),Gp=e.computed(()=>`${yt.value.vbX} ${yt.value.vbY} ${yt.value.vbW} ${yt.value.vbH}`);function ql(r){if(h.value.has(r.id)){r.children=[],r.collapsed=!0;return}r.collapsed=!1;for(const l of r.children)ql(l)}function No(r){const l=le(m.value,r);l&&(s.value=r,u.value=l.text,d.value=new Set([r]),Et(),e.nextTick(()=>{const f=document.querySelector(".zm-input");f==null||f.focus(),f==null||f.select()}))}function qi(){if(!s.value)return;const r=le(m.value,s.value);r&&r.text!==(u.value.trim()||" ")&&(r.text=u.value.trim()||" ",Oe(),a("change",m.value)),s.value=null}function jp(){s.value=null}function Kp(r){if(i.previewMode)return;const l=le(m.value,r);l!=null&&l.richContent&&(_.value=r,x.value=l.richContent.raw,e.nextTick(()=>{const f=document.querySelector(".zm-node .zm-rich textarea");f==null||f.focus()}))}function Xl(){if(!_.value)return;const r=_.value,l=le(m.value,r),f=x.value;if(l&&l.richContent&&l.richContent.raw!==f)if(l.richContent.kind==="code"){const A=wn(f)||void 0;Ae(r,{kind:"code",raw:f,lang:A})}else Ae(r,{kind:"table",raw:f});_.value=null}function Yp(){_.value=null}function qp(r){r.key==="Escape"?(r.preventDefault(),Yp()):r.key==="Enter"&&(r.ctrlKey||r.metaKey)&&(r.preventDefault(),Xl())}function Xp(r,l){const f=k.value.get(r);!f||f.col!==l?k.value.set(r,{col:l,dir:"asc"}):f.dir==="asc"?k.value.set(r,{col:l,dir:"desc"}):k.value.delete(r)}function Zp(r,l){const f=k.value.get(r);return!f||l.length<=1?l:al(l,f.col,f.dir)}function Jp(r,l){const f=k.value.get(r);return!f||f.col!==l?"↕":f.dir==="asc"?"▲":"▼"}function Qp(r){const l=r.metaKey||r.ctrlKey;l&&(r.key==="z"||r.key==="Z")&&!r.shiftKey?(r.preventDefault(),Xi()):(l&&r.shiftKey&&(r.key==="z"||r.key==="Z")||l&&(r.key==="y"||r.key==="Y")&&!r.shiftKey)&&(r.preventDefault(),Zi())}function no(r){const l=gr(m.value,r,Bo);l&&(Oe(),ke(),a("change",m.value),e.nextTick(()=>No(l.id)))}function si(r){if(r===m.value.id){no(r);return}const l=hr(m.value,r,Bo);l&&(Oe(),ke(),a("change",m.value),e.nextTick(()=>No(l.id)))}function eg(r){if(r===m.value.id){no(r);return}const l=Ya(m.value,r,Bo);l&&(Oe(),ke(),a("change",m.value),e.nextTick(()=>No(l.id)))}function Zl(r){if(r===m.value.id)return;const l=qa(m.value,r);l&&(Oe(),d.value=new Set([l.id]),Et(),a("change",m.value),ke())}function Jl(r){const l=[],f=new Set;for(const A of r)A!==m.value.id&&(f.has(A)||le(m.value,A)&&(f.add(A),l.push(A)));return l}function Ql(r){const l=new Set(r),f=[],A=w=>{l.has(w.id)&&f.push(w.id);for(const z of w.children)A(z)};return A(m.value),f}function ea(r){const l=Ql(Jl(r));if(l.length===0)return;const f=[];for(const A of l){const w=br(m.value,A);w&&f.push(w)}f.length!==0&&(F.value={nodes:f,originalIds:new Set(l)},ke())}function ta(r){const l=Ql(Jl(r));if(l.length===0)return;const f=[];for(const A of l){const w=br(m.value,A);w&&f.push(w)}if(f.length!==0){Oe();for(const A of l)Ro(m.value,A);d.value=new Set,Et(),F.value={nodes:f,originalIds:new Set(l)},ke(),a("change",m.value)}}function na(r){const l=F.value;if(!l||l.nodes.length===0)return;const f=r??m.value.id,A=le(m.value,f);if(A){for(const w of l.originalIds){const z=le(m.value,w);if(z&&le(z,f))return}Oe();for(const w of l.nodes){const z=Lt(w);vo(z),A.children.push(z)}F.value=null,ke(),a("change",m.value)}}function Xi(){const r=Kt.undo();r&&(m.value=r.data,d.value=new Set(r.selectedIds??[]),Et(),ke(),a("change",m.value))}function Zi(){const r=Kt.redo();r&&(m.value=r.data,d.value=new Set(r.selectedIds??[]),Et(),ke(),a("change",m.value))}function Et(){const r=[];for(const l of d.value){const f=le(m.value,l);f&&r.push(f)}if(i.builtInDrawers&&!i.previewMode&&r.length>0){const l=r[0];!kt.value&&fa(l.id)&&(At(),kt.value=!0)}else i.builtInDrawers&&r.length===0&&(kt.value=!1);a("select",r.length>0?r:null)}function tg(r,l){const f=g.value??m.value.id,A=le(m.value,f);if(!A)return;let w=null;if(l===1){const z=Wt(m.value,A.id);if(z){const M=z.children.findIndex(W=>W.id===A.id);M>=0&&M<z.children.length-1&&(w=z.children[M+1].id)}}else if(l===-1){const z=Wt(m.value,A.id);if(z){const M=z.children.findIndex(W=>W.id===A.id);M>0&&(w=z.children[M-1].id)}}else if(r===1){const z=Wt(m.value,A.id);z&&(w=z.id)}else r===-1&&A.children.length>0&&(w=A.children[0].id);w&&(d.value=new Set([w]),Et())}function oa(r){if(r!==m.value.id&&Ro(m.value,r)){if(Oe(),d.value.has(r)){const l=new Set(d.value);l.delete(r),d.value=l,Et()}ke(),a("change",m.value)}}function ia(r){h.value.has(r)?h.value.delete(r):h.value.add(r),ke()}function ra(r){const l=[{n:m.value,depth:1}];for(;l.length;){const{n:f,depth:A}=l.pop();r(f,A);for(let w=f.children.length-1;w>=0;w--)l.push({n:f.children[w],depth:A+1})}}function ng(){h.value=new Set,ra(r=>{r.children.length>0&&h.value.add(r.id)}),ke()}function la(r){h.value=new Set,ra((l,f)=>{f>r&&l.children.length>0&&h.value.add(l.id)}),ke()}function og(){h.value=new Set,ke()}function aa(r,l){ja(m.value,r,l)&&(Oe(),ke(),a("change",m.value))}function Ji(r,l,f){return Ka(m.value,r,l,f)?(Oe(),ke(),a("change",m.value),!0):!1}function ig(r,l){if(r.stopPropagation(),r.shiftKey){const f=new Set(d.value);f.has(l.id)?f.delete(l.id):f.add(l.id),d.value=f}else d.value=new Set([l.id]);Et()}function rg(r,l,f){let A=null;for(const w of to.value){if(w.id===f)continue;const z=w.width/2,M=w.height/2;r>=w.x-z&&r<=w.x+z&&l>=w.y-M&&l<=w.y+M&&(A=w)}return A}let Yt=null;function lg(r,l){if(i.previewMode||l.isRoot||r.button!==0)return;const f=r.target;if(f!=null&&f.closest(".zm-img-resize-handle"))return;r.stopPropagation();const A=c.value.getBoundingClientRect(),w=l.x*re.scale.value+re.offsetX.value,z=l.y*re.scale.value+re.offsetY.value,M=r.clientX-A.left-w,W=r.clientY-A.top-z;Yt={srcId:l.id,srcText:l.text,pointerOffsetX:M,pointerOffsetY:W,startX:r.clientX,startY:r.clientY},window.addEventListener("pointermove",sa),window.addEventListener("pointerup",ci),window.addEventListener("pointercancel",ci)}function sa(r){if(Yt){const M=r.clientX-Yt.startX,W=r.clientY-Yt.startY;if(Math.abs(M)<=Ul&&Math.abs(W)<=Ul)return;C.value={srcId:Yt.srcId,srcText:Yt.srcText,pointerOffsetX:Yt.pointerOffsetX,pointerOffsetY:Yt.pointerOffsetY,currentTargetId:null},document.body.classList.add("is-dragging"),Yt=null}const l=C.value;if(!l)return;const f=c.value.getBoundingClientRect();$.value=r.clientX-f.left-l.pointerOffsetX,R.value=r.clientY-f.top-l.pointerOffsetY;const A=(r.clientX-f.left-re.offsetX.value)/re.scale.value,w=(r.clientY-f.top-re.offsetY.value)/re.scale.value,z=rg(A,w,l.srcId);l.currentTargetId=(z==null?void 0:z.id)??null}function ci(r){if(window.removeEventListener("pointermove",sa),window.removeEventListener("pointerup",ci),window.removeEventListener("pointercancel",ci),Yt){Yt=null;return}const l=C.value;l&&(l.currentTargetId&&(Ji(l.srcId,l.currentTargetId,"child"),d.value=new Set([l.srcId]),Et()),C.value=null,$.value=0,R.value=0,document.body.classList.remove("is-dragging"))}let di=!1;function ag(r){const l=r.target;if(!l||l.closest(".zm-node, .zm-toolbar, button, input, textarea"))return;if(r.button===2){di=!0,re.startPan(r);return}if(di=!1,r.button!==0)return;const f=c.value.getBoundingClientRect(),A=(r.clientX-f.left-re.offsetX.value)/re.scale.value,w=(r.clientY-f.top-re.offsetY.value)/re.scale.value;re.startMarquee(A,w,{shift:r.shiftKey})}function sg(r){if(Rn){Rn=!1;return}const l=r.target;if(!l||l.closest(".zm-node"))return;const f=re.marquee;f.width>=4||f.height>=4||d.value.size>0&&(d.value=new Set,Et())}function cg(){const r=re.marquee;if(r.width<4&&r.height<4)return;const l=r.x,f=r.y,A=r.x+r.width,w=r.y+r.height,z=[];for(const M of to.value){const W=M.width/2,te=M.height/2,me=M.x-W,Pe=M.x+W,T=M.y-te,Ze=M.y+te;me<=A&&Pe>=l&&T<=w&&Ze>=f&&z.push(M.id)}d.value=r.shiftKey?new Set([...d.value,...z]):new Set(z),Et()}function ca(r){return h.value.has(r)}function dg(r){const l=le(m.value,r.id);return!!l&&l.children.length>0}function Qi(r){const l=le(m.value,r);return l?l.children.length:0}function da(r){if(!le(m.value,r))return 0;const A=[m.value];for(;A.length;){const w=A.pop(),z=w.children.findIndex(M=>M.id===r);if(z>=0)return z;for(const M of w.children)A.push(M)}return 0}function ui(r,l,f,A){const w=(A==null?void 0:A._dir)??r._dir;if(l==="out"&&r.isRoot&&v.lineOrigin==="center")return{x:r.x,y:r.y};if(l==="out"&&r.isRoot&&v.lineOrigin==="proportional"&&A){const W=yt.value.root.children;if(w==="down"){const mt=W.reduce((st,ne)=>Math.max(st,Math.abs(ne.x-r.x)),1),se=Math.min(1,Math.abs(A.x-r.x)/mt),at=r.y+r.height/2,qt=r.y;return{x:r.x,y:at+(qt-at)*se}}const te=W.reduce((mt,se)=>Math.max(mt,Math.abs(se.y-r.y)),1),me=Math.min(1,Math.abs(A.y-r.y)/te),Pe=f!==void 0?f:r.side,T=r.x+Pe*(r.width/2),Ze=r.x;return{x:T+(Ze-T)*me,y:r.y}}if(w==="down")return l==="out"?{x:r.x,y:r.y+r.height/2}:{x:r.x,y:r.y-r.height/2};let z;l==="in"?z=-r.side:f!==void 0?z=f:z=r.side;const M=l==="in"?r._richInsetX??0:0;return{x:r.x+z*(r.width/2-M),y:r.y}}function ln(){const r=yt.value;re.resetView(r.width,r.height,r.root.y)}function ug(){Zn.value=!0,Oe(),ke(),e.nextTick(()=>ln())}function er(r){v.layoutMode!==r&&(v.layoutMode=r,ke(),e.nextTick(()=>ln()))}function ua(){return JSON.stringify(m.value,null,2)}function fa(r){const l=le(m.value,r);return l?!!(l.note&&l.note.text||l.link&&l.link.url||l.image&&l.image.src||l.richContent&&l.richContent.raw||l.markers&&l.markers.length>0||l.tags&&l.tags.length>0):!1}function ma(r){try{const l=JSON.parse(r);return!l.id||!Array.isArray(l.children)?!1:(Kt.reset(),m.value=Lt(l),d.value=new Set,h.value=new Set,ke(),e.nextTick(()=>ln()),a("change",m.value),!0)}catch{return!1}}function fg(){const r=document.createElement("input");r.type="file",r.accept="application/json",r.onchange=()=>{var A;const l=(A=r.files)==null?void 0:A[0];if(!l)return;const f=new FileReader;f.onload=()=>{typeof f.result=="string"&&(ma(f.result)||alert("导入失败:JSON 格式无效"))},f.readAsText(l)},r.click()}function mg(){const r=new Blob([ua()],{type:"application/json"}),l=URL.createObjectURL(r),f=document.createElement("a");f.href=l,f.download=`${m.value.text||"mindmap"}.json`,f.click(),URL.revokeObjectURL(l)}const pa=e.ref(""),an=e.ref([]),So=e.ref(-1);function pg(r){pa.value=r;const l=r.trim();if(!l){an.value=[],So.value=-1;return}const f=l.toLowerCase(),A=[],w=z=>{var M;(z.text.toLowerCase().includes(f)||(M=z.note)!=null&&M.text&&z.note.text.toLowerCase().includes(f))&&A.push(z.id);for(const W of z.children)w(W)};w(m.value),an.value=A,So.value=A.length>0?0:-1,A.length>0&&(kg(A),e.nextTick(()=>yg(0)))}function gg(r){return an.value.includes(r)}function hg(r){return So.value>=0&&an.value[So.value]===r}function bg(r){return pa.value.trim().length>0&&an.value.length>0&&!an.value.includes(r)}function kg(r){if(r.length===0)return;const l=new Set(r),f=new Set,A=w=>{let z=l.has(w.id);for(const M of w.children)A(M)&&(z=!0);return z&&w.children.length>0&&h.value.has(w.id)&&f.add(w.id),z};if(A(m.value),f.size>0){for(const w of f)h.value.delete(w);ke()}}function yg(r){const l=an.value[r];if(!l)return;const f=to.value.find(A=>A.id===l);f&&(d.value=new Set([l]),Et(),re.centerOn(f.x,f.y,f.width,f.height))}function Eg(r,l){const f=le(m.value,r);f&&(f.markers||(f.markers=[]),!f.markers.includes(l)&&(f.markers.push(l),Oe(),ke(),a("change",m.value)))}function xg(r,l){const f=le(m.value,r);if(!f||!f.markers)return;const A=f.markers.indexOf(l);A<0||(f.markers.splice(A,1),f.markers.length===0&&delete f.markers,Oe(),ke(),a("change",m.value))}function ga(r,l){const f=le(m.value,r);if(!f)return!1;f.markers||(f.markers=[]);const A=f.markers.indexOf(l);return A>=0?(f.markers.splice(A,1),f.markers.length===0&&delete f.markers,Oe(),ke(),a("change",m.value),!1):(f.markers.push(l),Oe(),ke(),a("change",m.value),!0)}function wg(r){const l=le(m.value,r);return l!=null&&l.markers?[...l.markers]:[]}function Ng(r){var f;const l=(f=E.value)==null?void 0:f.nodeId;l&&ga(l,r)}function Sg(){var f;const r=(f=E.value)==null?void 0:f.nodeId;if(!r)return;const l=le(m.value,r);!l||!l.markers||(delete l.markers,Oe(),ke(),a("change",m.value),ue())}function tr(r,l){const f=le(m.value,r);f&&(l.length===0?f.tags&&delete f.tags:f.tags=[...l],Oe(),ke(),a("change",m.value))}function Cg(r){const l=le(m.value,r);return l!=null&&l.tags?[...l.tags]:[]}function Tg(){var z,M;const r=(z=E.value)==null?void 0:z.nodeId;if(!r)return;const l=le(m.value,r),f=((M=l==null?void 0:l.tags)==null?void 0:M.join(", "))??"",A=window.prompt("输入标签(多个用逗号分隔)",f);if(A===null)return;const w=A.split(/[,,]/).map(W=>W.trim()).filter(W=>W.length>0);tr(r,w),ue()}function Ag(){var l;const r=(l=E.value)==null?void 0:l.nodeId;r&&(tr(r,[]),ue())}function ha(){const r=yt.value,l="http://www.w3.org/2000/svg",f=document.createElementNS(l,"svg");f.setAttribute("xmlns",l),f.setAttribute("viewBox",`${r.vbX} ${r.vbY} ${r.vbW} ${r.vbH}`),f.setAttribute("width",String(r.vbW)),f.setAttribute("height",String(r.vbH));const A=document.createElementNS(l,"rect");A.setAttribute("x",String(r.vbX)),A.setAttribute("y",String(r.vbY)),A.setAttribute("width",String(r.vbW)),A.setAttribute("height",String(r.vbH)),A.setAttribute("fill",tn.value),f.appendChild(A);for(const M of Yl.value){const W=document.createElementNS(l,"path");W.setAttribute("d",Ye(ui(M.from,"out",M.to.side,M.to),ui(M.to,"in"),b(M.from.depth),I(M.to.depth),32,v.lineStyle,M.to._dir)),W.setAttribute("fill",xo(M.from,M.to)),W.setAttribute("stroke","none"),f.appendChild(W)}const w="-apple-system,BlinkMacSystemFont,'Segoe UI','PingFang SC','Microsoft YaHei',sans-serif";function z(M,W){let te=0;for(const me of M)/[\u4e00-\u9fff\u3000-\u30ff\uff00-\uffef]/.test(me)?te+=W:te+=W*.55;return te}for(const M of to.value){const W=M.x-M.width/2,te=M.y-M.height/2,me=document.createElementNS(l,"rect");me.setAttribute("x",String(W)),me.setAttribute("y",String(te)),me.setAttribute("width",String(M.width)),me.setAttribute("height",String(M.height)),me.setAttribute("rx","8"),me.setAttribute("fill",wo(M)),me.setAttribute("stroke",eo(M)),me.setAttribute("stroke-width","1"),f.appendChild(me);const Pe=!!(M.tags&&M.tags.length>0),T=!!(M.markers&&M.markers.length>0),Ze=!!M.image,mt=!!(M.richContent&&(M.richContent.kind==="code"||M.richContent.kind==="table"));let se=0,at=0;if(mt){const q=M.richContent,Ce=M.fontSize*.78*.92,Qe=6,pe=4,bn=2,kn=6;if(q.kind==="code"){const Bt=Go(q.raw),Tt=wn(q.raw),It=Bt.split(`
|
|
133
|
-
`)
|
|
134
|
-
`+f);const A=new Blob([f],{type:"image/svg+xml;charset=utf-8"}),w=URL.createObjectURL(A),z=document.createElement("a");z.href=w,z.download=`${m.value.text||"mindmap"}.svg`,z.click(),URL.revokeObjectURL(w)}function ba(r=2){const l=ha(),f=yt.value;let w=new XMLSerializer().serializeToString(l);w.startsWith("<?xml")||(w=`<?xml version="1.0" encoding="UTF-8"?>
|
|
135
|
-
`+w);const z=new Blob([w],{type:"image/svg+xml;charset=utf-8"}),M=URL.createObjectURL(z),W=new window.Image;W.onload=()=>{const te=document.createElement("canvas");te.width=Math.ceil(f.vbW*r),te.height=Math.ceil(f.vbH*r);const me=te.getContext("2d");if(!me){URL.revokeObjectURL(M);return}me.fillStyle=tn.value,me.fillRect(0,0,te.width,te.height),me.drawImage(W,0,0,te.width,te.height),URL.revokeObjectURL(M);try{te.toBlob(Pe=>{if(!Pe){Co();return}const T=URL.createObjectURL(Pe),Ze=document.createElement("a");Ze.href=T,Ze.download=`${m.value.text||"mindmap"}.png`,Ze.click(),URL.revokeObjectURL(T)},"image/png")}catch(Pe){console.warn("PNG export failed, falling back to SVG:",Pe),Co()}},W.onerror=()=>{URL.revokeObjectURL(M),Co()},W.src=M}return o({addChild:r=>no(r),addSibling:r=>si(r),removeNode:r=>oa(r),duplicateNode:r=>Zl(r),setNodeText:(r,l)=>aa(r,l),moveNode:(r,l,f)=>Ji(r,l,f),lineWidthForDepth:b,endWidthForDepth:I,getData:()=>m.value,nodeHasContent:r=>fa(r),getSelectedIds:()=>[...d.value],copyNodes:r=>ea(r),cutNodes:r=>ta(r),pasteNodes:r=>na(r),setData:r=>{Kt.reset(),m.value=Lt(r),d.value=new Set,h.value=new Set,ke(),Oe(),e.nextTick(()=>ln())},resetView:()=>ln(),exportData:ua,importData:ma,getMarkdown:()=>zn(m.value),setMarkdown:(r,l=!0)=>{const f=In(r||"");l&&(S.value=!0),K=!l,Kt.reset(),m.value=Lt(f),d.value=new Set,h.value=new Set,ke(),Oe(),e.nextTick(()=>{K=!1,ln()}),a("change",m.value)},setBalanced:r=>{Zn.value=r},isBalanced:()=>Zn.value,balance:()=>ug(),applyNodeStyle:(r,l)=>Y(r,l),getNodeStyle:r=>oe(r),applyNodeImage:(r,l)=>ie(r,l),applyNodeImageByUrl:(r,l)=>y(r,l),removeNodeImage:r=>ye(r),applyNodeLink:(r,l)=>ae(r,l),removeNodeLink:r=>Me(r),applyNodeNote:(r,l)=>ze(r,l),removeNodeNote:r=>De(r),applyNodeRichContent:(r,l)=>Ae(r,l),addNodeMarker:(r,l)=>Eg(r,l),removeNodeMarker:(r,l)=>xg(r,l),toggleNodeMarker:(r,l)=>ga(r,l),getNodeMarkers:r=>wg(r),setNodeTags:(r,l)=>tr(r,l),getNodeTags:r=>Cg(r),exportPNG:r=>ba(r),exportSVG:()=>Co(),searchNodes:r=>(pg(r),[...an.value]),undo:()=>Xi(),redo:()=>Zi(),canUndo:()=>Kt.canUndo(),canRedo:()=>Kt.canRedo(),applySettings:r=>{r.autoBalanceOnChange!==void 0&&(v.autoBalanceOnChange=r.autoBalanceOnChange),r.lineWidthStart!==void 0&&(v.lineWidthStart=Math.max(.5,Math.min(20,r.lineWidthStart))),r.lineWidthEnd!==void 0&&(v.lineWidthEnd=Math.max(.3,Math.min(10,r.lineWidthEnd))),r.rainbowBranch!==void 0&&(v.rainbowBranch=r.rainbowBranch),r.branchPaletteId!==void 0&&(v.branchPaletteId=r.branchPaletteId),r.customPalettes!==void 0&&(v.customPalettes=r.customPalettes),r.lineStyle!==void 0&&(v.lineStyle=r.lineStyle),r.lineOrigin!==void 0&&(v.lineOrigin=r.lineOrigin),r.taperedEdge!==void 0&&(v.taperedEdge=r.taperedEdge),r.showOrderBadge!==void 0&&(v.showOrderBadge=r.showOrderBadge),r.canvasBg!==void 0&&(v.canvasBg=r.canvasBg)},getSettings:()=>({autoBalanceOnChange:v.autoBalanceOnChange,lineWidthStart:v.lineWidthStart,lineWidthEnd:v.lineWidthEnd,rainbowBranch:v.rainbowBranch,branchPaletteId:v.branchPaletteId,customPalettes:v.customPalettes,lineStyle:v.lineStyle,lineOrigin:v.lineOrigin,layoutMode:v.layoutMode,taperedEdge:v.taperedEdge,showOrderBadge:v.showOrderBadge,canvasBg:v.canvasBg}),setBranchPalette:r=>{if(!r)return;[...on,...v.customPalettes].find(f=>f.id===r)&&(v.branchPaletteId=r)},getBranchPalette:()=>v.branchPaletteId,getBranchPalettes:()=>[...on,...v.customPalettes],getSearchResults:()=>[...an.value],getSearchIndex:()=>So.value}),e.watch(()=>i.data,r=>{m.value=Lt(r),ke()},{deep:!1}),e.onMounted(()=>{Oe(),e.nextTick(()=>ln())}),(r,l)=>{var f,A,w,z,M,W,te,me,Pe;return e.openBlock(),e.createElementBlock("div",{class:"zm-mindmap",style:e.normalizeStyle({background:tn.value,fontSize:ut.value.fontSize+"px"})},[e.createElementVNode("div",{ref_key:"wrapperRef",ref:c,class:"zm-canvas",onMousedown:ag,onContextmenu:Ee,onWheel:l[25]||(l[25]=(...T)=>e.unref(re).onWheel&&e.unref(re).onWheel(...T)),onMouseenter:l[26]||(l[26]=T=>N.value=!0),onMouseleave:l[27]||(l[27]=T=>N.value=!1),onClick:sg},[e.createElementVNode("div",{class:"zm-svg-layer",style:e.normalizeStyle({left:yt.value.vbX*e.unref(re).scale.value+e.unref(re).offsetX.value+"px",top:yt.value.vbY*e.unref(re).scale.value+e.unref(re).offsetY.value+"px",width:yt.value.vbW*e.unref(re).scale.value+"px",height:yt.value.vbH*e.unref(re).scale.value+"px"})},[(e.openBlock(),e.createElementBlock("svg",{class:"zm-svg",viewBox:Gp.value,preserveAspectRatio:"xMinYMin meet",width:yt.value.vbW*e.unref(re).scale.value,height:yt.value.vbH*e.unref(re).scale.value},[e.createElementVNode("g",mp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Yl.value,T=>(e.openBlock(),e.createElementBlock("path",{key:T.key,d:Ye(ui(T.from,"out",T.to.side,T.to),ui(T.to,"in"),b(T.from.depth),I(T.to.depth),32,v.lineStyle,T.to._dir),fill:xo(T.from,T.to),stroke:"none"},null,8,pp))),128))])],8,fp))],4),e.unref(re).isMarquee.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-marquee",style:e.normalizeStyle({left:e.unref(re).marquee.x*e.unref(re).scale.value+e.unref(re).offsetX.value+"px",top:e.unref(re).marquee.y*e.unref(re).scale.value+e.unref(re).offsetY.value+"px",width:e.unref(re).marquee.width*e.unref(re).scale.value+"px",height:e.unref(re).marquee.height*e.unref(re).scale.value+"px"})},null,4)):e.createCommentVNode("",!0),C.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"zm-drag-ghost",style:e.normalizeStyle({left:$.value+"px",top:R.value+"px",transform:`scale(${e.unref(re).scale.value})`,transformOrigin:"top left"})},e.toDisplayString(C.value.srcText),5)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"zm-world",style:e.normalizeStyle({transform:`translate(${e.unref(re).offsetX.value}px, ${e.unref(re).offsetY.value}px) scale(${e.unref(re).scale.value})`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(to.value,T=>{var Ze,mt;return e.openBlock(),e.createElementBlock("div",{key:T.id,class:e.normalizeClass(["zm-node",{"is-root":T.isRoot,"is-selected":g.value===T.id,"is-selected-secondary":g.value!==T.id&&d.value.has(T.id),"is-editing":s.value===T.id,"has-image":!!T.image,"is-resizing":Yi.value===T.id,"is-dragging-source":((Ze=C.value)==null?void 0:Ze.srcId)===T.id,"is-drop-target":((mt=C.value)==null?void 0:mt.currentTargetId)===T.id,"is-search-hit":gg(T.id),"is-search-current":hg(T.id),"is-search-dimmed":bg(T.id)}]),"data-node-id":T.id,style:e.normalizeStyle({left:T.x+"px",top:T.y+"px",width:T.width+"px",minWidth:T.width+"px",height:T.height+"px",fontSize:Gl(T)+"px",background:wo(T),color:Qn(T),borderColor:eo(T),fontWeight:Wl(T),transform:"translate(-50%, -50%)"}),onClick:se=>ig(se,T),onPointerdown:se=>lg(se,T),onDblclick:se=>{se.stopPropagation(),t.previewMode||No(T.id)},onContextmenu:se=>X(se,T),onMouseenter:se=>{qn(T.id),Xn(se,T)},onMouseleave:se=>hn(T.id)},[T.image?(e.openBlock(),e.createElementBlock("img",{key:0,class:"zm-node-img",src:T.image.src,width:T.image.width,height:T.image.height,alt:T.text,draggable:"false"},null,8,hp)):e.createCommentVNode("",!0),T.richContent&&(T.richContent.kind==="code"||T.richContent.kind==="table")&&s.value!==T.id?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["zm-rich zm-rich-above",{"zm-rich-no-overflow":T.richContent.kind==="table"||T.richContent.kind==="code"}]),onClick:l[1]||(l[1]=e.withModifiers(()=>{},["stop"])),onDblclick:e.withModifiers(se=>Kp(T.id),["stop"]),onMousedown:l[2]||(l[2]=e.withModifiers(()=>{},["stop"]))},[_.value===T.id?e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:0,"onUpdate:modelValue":l[0]||(l[0]=se=>x.value=se),class:"zm-rich-edit",spellcheck:"false",onBlur:Xl,onKeydown:qp},null,544)),[[e.vModelText,x.value]]):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[T.richContent.kind==="code"?(e.openBlock(),e.createElementBlock("pre",kp,[e.createElementVNode("code",{innerHTML:e.unref(Ti)(e.unref(Go)(T.richContent.raw),e.unref(wn)(T.richContent.raw))},null,8,yp)])):T.richContent.kind==="table"?(e.openBlock(),e.createElementBlock("table",Ep,[e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Zp(T.id,e.unref(Ai)(T.richContent.raw)),(se,at)=>(e.openBlock(),e.createElementBlock("tr",{key:at},[at===0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(se,(qt,st)=>{var ne,xt,Ge,We,pt;return e.openBlock(),e.createElementBlock("th",{key:`h${st}`,class:e.normalizeClass(["zm-rich-table-sort",{"is-sorted":((ne=k.value.get(T.id))==null?void 0:ne.col)===st,"is-asc":((xt=k.value.get(T.id))==null?void 0:xt.col)===st&&((Ge=k.value.get(T.id))==null?void 0:Ge.dir)==="asc","is-desc":((We=k.value.get(T.id))==null?void 0:We.col)===st&&((pt=k.value.get(T.id))==null?void 0:pt.dir)==="desc"}]),onClick:e.withModifiers(ce=>Xp(T.id,st),["stop"])},[e.createElementVNode("span",null,e.toDisplayString(qt),1),e.createElementVNode("span",wp,e.toDisplayString(Jp(T.id,st)),1)],10,xp)}),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(se,(qt,st)=>(e.openBlock(),e.createElementBlock("td",{key:`c${st}`},e.toDisplayString(qt),1))),128))]))),128))])])):e.createCommentVNode("",!0)],64))],42,bp)):e.createCommentVNode("",!0),s.value!==T.id?(e.openBlock(),e.createElementBlock("span",Np,[T.markers&&T.markers.length>0?(e.openBlock(),e.createElementBlock("span",Sp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.markers,se=>(e.openBlock(),e.createElementBlock("span",{key:se,class:"zm-node-marker",title:e.unref(yr)(se),innerHTML:'<svg viewBox="0 0 24 24" width="14" height="14">'+e.unref(zo)(se)+"</svg>"},null,8,Cp))),128))])):e.createCommentVNode("",!0),e.createElementVNode("span",Tp,e.toDisplayString(T.text),1),T.link&&s.value!==T.id?(e.openBlock(),e.createElementBlock("a",{key:1,class:"zm-node-link",href:T.link.url,target:"_blank",rel:"noopener noreferrer",title:`打开链接:${T.link.url}`,onClick:l[3]||(l[3]=e.withModifiers(()=>{},["stop"])),onMousedown:l[4]||(l[4]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(Ne,{name:"link",size:11,stroke:2})],40,Ap)):e.createCommentVNode("",!0),T.note&&s.value!==T.id?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-node-note-btn",type:"button",title:li(T.note.text),onClick:e.withModifiers(se=>ri(T.id),["stop"]),onMousedown:l[5]||(l[5]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(Ne,{name:"note",size:11,stroke:2})],40,_p)):e.createCommentVNode("",!0)])):e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:3,class:"zm-input","onUpdate:modelValue":l[6]||(l[6]=se=>u.value=se),autofocus:"",onBlur:l[7]||(l[7]=se=>qi()),onKeydown:[l[8]||(l[8]=e.withKeys(e.withModifiers(se=>qi(),["exact"]),["enter"])),l[9]||(l[9]=e.withKeys(e.withModifiers(se=>qi(),["prevent"]),["tab"])),e.withKeys(jp,["esc"]),Qp],onMousedown:l[10]||(l[10]=e.withModifiers(()=>{},["stop"])),onClick:l[11]||(l[11]=e.withModifiers(()=>{},["stop"]))},null,544)),[[e.vModelText,u.value]]),T.tags&&T.tags.length>0&&s.value!==T.id?(e.openBlock(),e.createElementBlock("div",Mp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.tags,se=>(e.openBlock(),e.createElementBlock("span",{key:se,class:"zm-node-tag",style:e.normalizeStyle(e.unref(hi)(se))},e.toDisplayString(se),5))),128))])):e.createCommentVNode("",!0),J.value?(e.openBlock(),e.createElementBlock("span",{key:5,class:"zm-order-badge",title:`数据顺序:第 ${da(T.id)+1} 个`},e.toDisplayString(da(T.id)+1),9,Rp)):e.createCommentVNode("",!0),ca(T.id)&&Qi(T.id)>0?(e.openBlock(),e.createElementBlock("span",{key:6,class:e.normalizeClass(["zm-collapse-badge",{"is-on-left":T.side===-1}]),style:e.normalizeStyle({background:Ve.value.get(T.id)??"#64748b"}),title:`展开 ${Qi(T.id)} 个子节点`,onMousedown:l[12]||(l[12]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(se=>ia(T.id),["stop"])},e.toDisplayString(Qi(T.id)),47,vp)):e.createCommentVNode("",!0),dg(T)&&!ca(T.id)?(e.openBlock(),e.createElementBlock("button",{key:7,class:e.normalizeClass(["zm-btn zm-collapse",{"is-on-left":T.side===-1}]),style:e.normalizeStyle({color:Ve.value.get(T.id)??"#64748b",borderColor:Ve.value.get(T.id)??"#64748b"}),title:"折叠",onMousedown:l[13]||(l[13]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(se=>ia(T.id),["stop"])},[e.createVNode(Ne,{name:"minus",size:10,stroke:2.4})],46,Bp)):e.createCommentVNode("",!0),T.image&&g.value===T.id&&s.value!==T.id?(e.openBlock(),e.createElementBlock("span",{key:8,class:"zm-img-resize-handle",title:"拖动调整图片大小",onMousedown:e.withModifiers(se=>Mt(se,T),["stop"])},null,40,Ip)):e.createCommentVNode("",!0),T.image&&g.value===T.id&&s.value!==T.id?(e.openBlock(),e.createElementBlock("button",{key:9,class:"zm-img-remove-btn",title:"移除图片",onMousedown:l[14]||(l[14]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(se=>ye(T.id),["stop"])},[e.createVNode(Ne,{name:"x",size:9,stroke:2.2})],40,zp)):e.createCommentVNode("",!0)],46,gp)}),128))],4),B.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["zm-tooltip",{"is-below":!B.value.above}]),style:e.normalizeStyle({left:B.value.x+"px",top:B.value.y+"px"})},e.toDisplayString(B.value.text),7)):e.createCommentVNode("",!0),E.value?(e.openBlock(),e.createBlock(ms,{key:3,x:E.value.x,y:E.value.y,container:c.value,"has-image":!!((f=e.unref(le)(m.value,E.value.nodeId))!=null&&f.image),"has-link":!!((A=e.unref(le)(m.value,E.value.nodeId))!=null&&A.link),"has-note":!!((w=e.unref(le)(m.value,E.value.nodeId))!=null&&w.note),"has-code":((M=(z=e.unref(le)(m.value,E.value.nodeId))==null?void 0:z.richContent)==null?void 0:M.kind)==="code","has-table":((te=(W=e.unref(le)(m.value,E.value.nodeId))==null?void 0:W.richContent)==null?void 0:te.kind)==="table","node-markers":((me=e.unref(le)(m.value,E.value.nodeId))==null?void 0:me.markers)??[],"node-tags":((Pe=e.unref(le)(m.value,E.value.nodeId))==null?void 0:Pe.tags)??[],onPickImage:ho,onRemoveImage:Mn,onSetLink:Gi,onRemoveLink:bo,onEditNote:ko,onRemoveNote:ji,onAddCode:ii,onEditCode:ii,onRemoveCode:Ki,onAddTable:He,onEditTable:He,onRemoveTable:pn,onToggleMarker:Ng,onClearMarkers:Sg,onAddTag:Tg,onRemoveTags:Ag,onClose:ue},null,8,["x","y","container","has-image","has-link","has-note","has-code","has-table","node-markers","node-tags"])):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createBlock(ps,{key:4,x:p.value.x,y:p.value.y,container:c.value,onOpenSettings:Ke,onOpenData:it,onOpenImport:nt,onExportPng:ba,onExportSvg:Co,onClose:tt},null,8,["x","y","container"])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(O.value),title:i.previewMode?"退出预览模式":"进入预览模式",onClick:l[15]||(l[15]=T=>a("canvas-toggle-preview"))},[e.createVNode(Ne,{name:i.previewMode?"eye-off":"eye",size:16},null,8,["name"])],10,Op),e.createElementVNode("button",{class:e.normalizeClass(D.value),title:"显示大纲视图",onClick:go},[e.createVNode(Ne,{name:"outline",size:16})],2),e.createElementVNode("div",{class:e.normalizeClass(["zm-toolbar",{"is-preview-only":i.previewMode,"is-hovered":N.value}])},[e.createElementVNode("span",Lp,e.toDisplayString(Math.round(e.unref(re).scale.value*100))+"%",1),e.createElementVNode("button",{class:"zm-tb-btn",title:"放大",onClick:l[16]||(l[16]=(...T)=>e.unref(re).zoomIn&&e.unref(re).zoomIn(...T))},[e.createVNode(Ne,{name:"zoom-in"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"缩小",onClick:l[17]||(l[17]=(...T)=>e.unref(re).zoomOut&&e.unref(re).zoomOut(...T))},[e.createVNode(Ne,{name:"zoom-out"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"重置视图",onClick:ln},[e.createVNode(Ne,{name:"reset"})]),l[38]||(l[38]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"全部收起",onClick:ng},[e.createVNode(Ne,{name:"collapse-all"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"展开一级",onClick:l[18]||(l[18]=T=>la(1))},[e.createVNode(Ne,{name:"expand-level-1"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"展开二级",onClick:l[19]||(l[19]=T=>la(2))},[e.createVNode(Ne,{name:"expand-level-2"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"全部展开",onClick:og},[e.createVNode(Ne,{name:"expand-all"})]),l[39]||(l[39]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"导出 JSON",onClick:mg},[e.createVNode(Ne,{name:"export"})]),i.previewMode?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[l[35]||(l[35]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"添加子节点 (Tab)",onClick:l[20]||(l[20]=T=>g.value&&no(g.value))},[e.createElementVNode("img",{src:e.unref(lr),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,Dp)]),e.createElementVNode("button",{class:"zm-tb-btn",title:"添加同级 (Enter)",onClick:l[21]||(l[21]=T=>g.value&&si(g.value))},[e.createElementVNode("img",{src:e.unref(rr),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,Vp)]),l[36]||(l[36]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:v.layoutMode==="mindmap"}]),title:"思维导图布局 (中心辐射)",onClick:l[22]||(l[22]=T=>er("mindmap"))},[e.createVNode(Ne,{name:"mindmap"})],2),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:v.layoutMode==="tree"}]),title:"树形布局 (向右展开)",onClick:l[23]||(l[23]=T=>er("tree"))},[e.createVNode(Ne,{name:"tree"})],2),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:v.layoutMode==="org"}]),title:"组织结构布局 (向下展开)",onClick:l[24]||(l[24]=T=>er("org"))},[e.createVNode(Ne,{name:"org"})],2),l[37]||(l[37]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"导入 JSON",onClick:fg},[e.createVNode(Ne,{name:"import"})])],64))],2)],544),i.builtInDrawers?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(Dt,{side:"left",scope:"canvas",width:300,open:rn.value&&!t.previewMode,title:"大纲","onUpdate:open":l[28]||(l[28]=T=>rn.value=T)},{default:e.withCtx(()=>[e.createVNode(Oo,{data:m.value,"selected-id":g.value,"collapsed-ids":rt.value,onSelect:po,onToggleCollapse:mn,onEdit:oi,onAddChild:Gn,onAddSibling:jn,onMove:Ft},null,8,["data","selected-id","collapsed-ids"])]),_:1},8,["open"]),e.createVNode(Dt,{side:"right",scope:"canvas",width:360,open:$t.value&&!t.previewMode,title:"数据","onUpdate:open":l[30]||(l[30]=T=>$t.value=T)},{default:e.withCtx(()=>[e.createVNode(Lo,{data:m.value,"pending-mode":Pt.value,onImport:l[29]||(l[29]=T=>m.value=T),onConsumedMode:Ue},null,8,["data","pending-mode"])]),_:1},8,["open"]),e.createVNode(Dt,{side:"right",scope:"canvas",width:420,open:Q.value&&!t.previewMode,title:"Markdown","onUpdate:open":l[32]||(l[32]=T=>Q.value=T)},{default:e.withCtx(()=>[e.createVNode(Do,{data:m.value,onImport:l[31]||(l[31]=T=>m.value=T)},null,8,["data"])]),_:1},8,["open"]),e.createVNode(Dt,{side:"right",scope:"canvas",width:360,open:kt.value&&!t.previewMode,title:"节点内容","onUpdate:open":l[33]||(l[33]=T=>kt.value=T)},{default:e.withCtx(()=>[e.createVNode(Jo,{"selected-node":Ct.value,"focus-tick":Re.value,onApply:lt,onRemove:_t,onSetLink:_n,onSetImage:ti,onSetRich:ni},null,8,["selected-node","focus-tick"])]),_:1},8,["open"]),e.createVNode(Dt,{side:"right",scope:"canvas",width:340,open:ve.value&&!t.previewMode,title:"设置","onUpdate:open":l[34]||(l[34]=T=>ve.value=T)},{default:e.withCtx(()=>{var T;return[e.createVNode(Vo,{settings:v,"has-selection":g.value!==null,"selected-node-text":(T=Ct.value)==null?void 0:T.text,"node-style":H.value,"onUpdate:settings":Z,"onUpdate:nodeStyle":fe,onReset:Se},null,8,["settings","has-selection","selected-node-text","node-style"])]}),_:1},8,["open"])],64)):e.createCommentVNode("",!0)],4)}}}),$p={class:"zm-app"},Pp={class:"zm-app-main"},Fp={class:"zm-app-canvas"},Hl=e.defineComponent({__name:"App",setup(t){const o={id:"r_root",text:"flow-mindmap 节点能力一览",link:{url:"https://github.com/xz333221/flow-mindmap"},note:{text:`本导图用于演示节点的全部可渲染字段。
|
|
134
|
+
| a | b | c |`);if(N===null)return;const O=N.trim();if(!O){Me(r,null);return}Me(r,{kind:"table",raw:O})}function hn(){var l;const r=(l=y.value)==null?void 0:l.nodeId;r&&Me(r,null)}function ri(r){i.previewMode||(i.builtInDrawers&&(Ct(),gt.value=!0,_e.value++),a("edit-note",r))}function li(r,l=60){const f=r.replace(/\s+/g," ").trim();return f.length<=l?f||"点击编辑笔记":f.slice(0,l)+"…"}function Yn(r){var N;if(i.previewMode||s.value)return;const l=r.target;if(l&&(l.tagName==="INPUT"||l.tagName==="TEXTAREA"||l.isContentEditable))return;const f=g.value;if(!f)return;const M=(N=r.clipboardData)==null?void 0:N.items;if(M)for(let O=0;O<M.length;O++){const _=M[O];if(_.kind==="file"&&_.type.startsWith("image/")){const z=_.getAsFile();if(!z)continue;r.preventDefault();const G=ue(m.value,f);if(G!=null&&G.image&&!window.confirm("该节点已有图片,要用剪贴板里的图片替换吗?"))return;$(z,j=>ie(f,j));return}}}e.onMounted(()=>{window.addEventListener("paste",Yn),window.addEventListener("keydown",yo),Ee()}),e.onBeforeUnmount(()=>{window.removeEventListener("paste",Yn),window.removeEventListener("keydown",yo)});function yo(r){if((r.metaKey||r.ctrlKey)&&(r.key==="f"||r.key==="F")){const f=r.target;if(f&&(f.tagName==="INPUT"||f.tagName==="TEXTAREA"||f.isContentEditable))return;r.preventDefault(),a("canvas-outline")}}const bn=e.ref(null),Yi=e.computed(()=>{var r;return((r=bn.value)==null?void 0:r.nodeId)??null});function At(r,l){if(!l.image)return;r.preventDefault(),r.stopPropagation();const f=l.image.naturalW||l.image.width,M=l.image.naturalH||l.image.height,N=M>0?M/f:1;bn.value={nodeId:l.id,startX:r.clientX,startY:r.clientY,startW:l.image.width,startH:l.image.height,naturalW:f,naturalH:M,ratio:N,pendingW:l.image.width,pendingH:l.image.height},window.addEventListener("mousemove",en),window.addEventListener("mouseup",Eo)}function en(r){var G,j;const l=bn.value;if(!l)return;const f=de.scale.value||1,M=r.clientX-l.startX,N=E(l.startW+M/f,Mn,Gn),O=E(N*l.ratio,Mn,Gn);l.pendingW=N,l.pendingH=O;const _=(G=c.value)==null?void 0:G.querySelector(`[data-node-id="${l.nodeId}"] .zm-node-img`);_&&(_.style.width=`${N}px`,_.style.height=`${O}px`);const z=(j=c.value)==null?void 0:j.querySelector(`[data-node-id="${l.nodeId}"]`);z&&(z.style.minWidth=`${Math.max(80,Math.ceil(N+28))}px`,z.style.height=`${Math.ceil(O+8+30)}px`)}function Eo(){const r=bn.value;if(window.removeEventListener("mousemove",en),window.removeEventListener("mouseup",Eo),bn.value=null,!r)return;const l=ue(m.value,r.nodeId);!l||!l.image||(ie(r.nodeId,{src:l.image.src,naturalW:l.image.naturalW,naturalH:l.image.naturalH,width:r.pendingW,height:r.pendingH}),d.value=new Set([r.nodeId]),kt(),Rn=!0)}const qn=e.ref(null);let Rn=!1;function Xn(r){qn.value=r}function kn(r){qn.value===r&&(qn.value=null),I.value&&(I.value=null)}function Zn(r,l){var le;if(!l.text||l.text.length<14)return;const M=r.currentTarget.getBoundingClientRect(),N=(le=c.value)==null?void 0:le.getBoundingClientRect();if(!N)return;const O=10,_=240,z=M.top-N.top>60,G=M.left-N.left+M.width/2,j=O+_/2,pe=N.width-_/2-O,T=Math.max(j,Math.min(G,pe)),J=z?M.top-N.top-8:M.bottom-N.top+8;I.value={text:l.text,x:T,y:J,above:z}}const _t=e.ref(0),Jn=e.ref(!1),Yt=is(100);function $e(){Yt.record({data:m.value,selectedIds:[...d.value]})}function Ee(){h.value=new Set(h.value),_t.value++,e.nextTick().then(()=>e.nextTick()).then(()=>ai()).then(()=>{_t.value++})}function ai(){const r=document.querySelectorAll(".zm-rich"),l={},f={};r.forEach(M=>{let N=M,O=null;for(;N&&!O;)O=N.getAttribute("data-node-id"),N=N.parentElement;if(!O)return;const _=M.offsetHeight,z=M.scrollWidth,G=Math.round(_*2)/2,j=Math.round(z*2)/2;l[O]=G,f[O]=j,F.value[O],W.value[O]}),F.value=l,W.value=f}const ut=e.computed(()=>{var r,l,f,M,N,O,_,z,G,j;return{rootBg:((r=i.theme)==null?void 0:r.rootBg)??"#1f2937",rootText:((l=i.theme)==null?void 0:l.rootText)??"#ffffff",branchBg:((f=i.theme)==null?void 0:f.branchBg)??"#ffffff",branchText:((M=i.theme)==null?void 0:M.branchText)??"#1f2937",lineColor:((N=i.theme)==null?void 0:N.lineColor)??"#94a3b8",bgColor:((O=i.theme)==null?void 0:O.bgColor)??"#f8fafc",fontSize:((_=i.theme)==null?void 0:_.fontSize)??14,lineWidthStart:((z=i.theme)==null?void 0:z.lineWidthStart)??2.2,lineWidthEnd:((G=i.theme)==null?void 0:G.lineWidthEnd)??.8,rainbowBranch:((j=i.theme)==null?void 0:j.rainbowBranch)??!1}}),tn=e.computed(()=>B.canvasBg||ut.value.bgColor),B=e.reactive({autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:3.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"rounded-elbow",rootLineStyle:"arc",lineOrigin:"proportional",layoutMode:"mindmap",taperedEdge:!0,lineWidthTaper:.67,showOrderBadge:!1,canvasBg:void 0});function b(r){return r?B.rootLineStyle:B.lineStyle}function L(r){return B.taperedEdge?Re(r):ke(r)}function q(r){return B.taperedEdge?B.lineWidthEnd:ke(r)}function Re(r){const l=B.lineWidthTaper,f=B.lineWidthStart*Math.pow(l,r);return Math.max(B.lineWidthEnd,f)}function ke(r){if(r<=0)return B.lineWidthStart;if(r>=3)return B.lineWidthEnd;const l=r/3;return B.lineWidthStart+(B.lineWidthEnd-B.lineWidthStart)*l}function Oe(r,l,f,M){const N=1-r,O=N*N*N*l.x+3*N*N*r*f.x1+3*N*r*r*f.x2+r*r*r*M.x,_=N*N*N*l.y+3*N*N*r*f.y1+3*N*r*r*f.y2+r*r*r*M.y;return{x:O,y:_}}function Ze(r,l,f,M){const N=1-r,O=N*N*l.x+2*N*r*f.x+r*r*M.x,_=N*N*l.y+2*N*r*f.y+r*r*M.y;return{x:O,y:_}}function St(r,l,f,M,N=32,O="curve",_="right"){if(O==="curve"){let z;if(_==="right"||_==="left"){const le=Math.abs(l.x-r.x)*.45,H=_==="right"?1:-1;z={x1:r.x+H*le,y1:r.y,x2:l.x-H*le,y2:l.y}}else{const le=Math.abs(l.y-r.y)*.45;z={x1:r.x,y1:r.y+le,x2:l.x,y2:l.y-le}}const G=J=>{const le=1-J,H=-3*le*le*r.x+3*(le*le-2*le*J)*z.x1+3*(2*le*J-J*J)*z.x2+3*J*J*l.x,xe=-3*le*le*r.y+3*(le*le-2*le*J)*z.y1+3*(2*le*J-J*J)*z.y2+3*J*J*l.y;return{dx:H,dy:xe}},j=[],pe=[];for(let J=0;J<=N;J++){const le=J/N,H=J===0?r:J===N?l:Oe(le,r,z,l),xe=G(le);let Be=Math.hypot(xe.dx,xe.dy);Be<1e-6&&(Be=1);const be=-xe.dy/Be,Q=xe.dx/Be,ve=(f+(M-f)*le)/2;j.push({x:H.x+be*ve,y:H.y+Q*ve}),pe.push({x:H.x-be*ve,y:H.y-Q*ve})}let T=`M ${j[0].x.toFixed(2)} ${j[0].y.toFixed(2)}`;for(let J=1;J<=N;J++)T+=` L ${j[J].x.toFixed(2)} ${j[J].y.toFixed(2)}`;for(let J=N;J>=0;J--)T+=` L ${pe[J].x.toFixed(2)} ${pe[J].y.toFixed(2)}`;return T+=" Z",T}if(O==="arc"){let z;_==="right"||_==="left"?z={x:(r.x+l.x)/2,y:l.y}:z={x:l.x,y:(r.y+l.y)/2};const G=H=>{const xe=1-H,Be=2*xe*(z.x-r.x)+2*H*(l.x-z.x),be=2*xe*(z.y-r.y)+2*H*(l.y-z.y);return{dx:Be,dy:be}},j=[],pe=[];for(let H=0;H<=N;H++){const xe=H/N,Be=H===0?r:H===N?l:Ze(xe,r,z,l),be=G(xe);let Q=Math.hypot(be.dx,be.dy);Q<1e-6&&(Q=1);const ve=-be.dy/Q,ot=be.dx/Q,Fe=(f+(M-f)*xe)/2;j.push({x:Be.x+ve*Fe,y:Be.y+ot*Fe}),pe.push({x:Be.x-ve*Fe,y:Be.y-ot*Fe})}const T=f/2,J=M/2;let le=`M ${j[0].x.toFixed(2)} ${j[0].y.toFixed(2)}`;for(let H=1;H<=N;H++)le+=` L ${j[H].x.toFixed(2)} ${j[H].y.toFixed(2)}`;le+=` A ${J.toFixed(2)} ${J.toFixed(2)} 0 0 0 ${pe[N].x.toFixed(2)} ${pe[N].y.toFixed(2)}`;for(let H=N-1;H>=0;H--)le+=` L ${pe[H].x.toFixed(2)} ${pe[H].y.toFixed(2)}`;return le+=` A ${T.toFixed(2)} ${T.toFixed(2)} 0 0 0 ${j[0].x.toFixed(2)} ${j[0].y.toFixed(2)}`,le+=" Z",le}if(O==="elbow"){const z=[];if(_==="down"){const Q=(r.y+l.y)/2;z.push(r,{x:r.x,y:Q},{x:l.x,y:Q},l)}else{const Q=(r.x+l.x)/2;z.push(r,{x:Q,y:r.y},{x:Q,y:l.y},l)}const G=[];let j=0;for(let Q=0;Q<z.length-1;Q++){const ve=Math.hypot(z[Q+1].x-z[Q].x,z[Q+1].y-z[Q].y);G.push(ve),j+=ve}const pe=[f/2];let T=0;for(let Q=0;Q<G.length-1;Q++){T+=G[Q];const ve=j>0?T/j:0;pe.push((f+(M-f)*ve)/2)}pe.push(M/2);const J=[];for(let Q=0;Q<z.length-1;Q++){const ve=z[Q+1].x-z[Q].x,ot=z[Q+1].y-z[Q].y;let Fe=Math.hypot(ve,ot);Fe<1e-6&&(Fe=1),J.push({x:-ot/Fe,y:ve/Fe})}const le=[],H=[];le.push({x:z[0].x+J[0].x*pe[0],y:z[0].y+J[0].y*pe[0]}),H.push({x:z[0].x-J[0].x*pe[0],y:z[0].y-J[0].y*pe[0]});for(let Q=1;Q<z.length-1;Q++){const ve=J[Q-1],ot=J[Q],Fe=pe[Q];le.push({x:z[Q].x+ve.x*Fe+ot.x*Fe,y:z[Q].y+ve.y*Fe+ot.y*Fe}),H.push({x:z[Q].x-ve.x*Fe-ot.x*Fe,y:z[Q].y-ve.y*Fe-ot.y*Fe})}const xe=J[J.length-1],Be=pe[pe.length-1];le.push({x:z[z.length-1].x+xe.x*Be,y:z[z.length-1].y+xe.y*Be}),H.push({x:z[z.length-1].x-xe.x*Be,y:z[z.length-1].y-xe.y*Be});let be=`M ${le[0].x.toFixed(2)} ${le[0].y.toFixed(2)}`;for(let Q=1;Q<le.length;Q++)be+=` L ${le[Q].x.toFixed(2)} ${le[Q].y.toFixed(2)}`;for(let Q=H.length-1;Q>=0;Q--)be+=` L ${H[Q].x.toFixed(2)} ${H[Q].y.toFixed(2)}`;return be+=" Z",be}if(O==="rounded-elbow"){let z=function(oe,Qe,Bt){const Ft={x:oe.pos.x-Qe*oe.d1.x,y:oe.pos.y-Qe*oe.d1.y},Bn={x:oe.pos.x+Qe*oe.d2.x,y:oe.pos.y+Qe*oe.d2.y},Ke={x:oe.pos.x+Qe*(oe.d2.x-oe.d1.x),y:oe.pos.y+Qe*(oe.d2.y-oe.d1.y)},Ye=Math.atan2(Ft.y-Ke.y,Ft.x-Ke.x);let ct=Math.atan2(Bn.y-Ke.y,Bn.x-Ke.x)-Ye;for(;ct>Math.PI;)ct-=2*Math.PI;for(;ct<-Math.PI;)ct+=2*Math.PI;const Ie=[];for(let Ut=1;Ut<Bt;Ut++){const on=Ut/Bt,yt=Ye+ct*on;Ie.push({x:Ke.x+Qe*Math.cos(yt),y:Ke.y+Qe*Math.sin(yt)})}return Ie};const G=[];let j;if(_==="down"){const oe=(r.y+l.y)/2,Qe=Math.sign(oe-r.y)||1,Bt=Math.sign(l.x-r.x)||1,Ft=Math.sign(l.y-oe)||1;j=[{pos:{x:r.x,y:oe},d1:{x:0,y:Qe},d2:{x:Bt,y:0}},{pos:{x:l.x,y:oe},d1:{x:Bt,y:0},d2:{x:0,y:Ft}}]}else{const oe=(r.x+l.x)/2,Qe=Math.sign(oe-r.x)||1,Bt=Math.sign(l.y-r.y)||1,Ft=Math.sign(l.x-oe)||1;j=[{pos:{x:oe,y:r.y},d1:{x:Qe,y:0},d2:{x:0,y:Bt}},{pos:{x:oe,y:l.y},d1:{x:0,y:Bt},d2:{x:Ft,y:0}}]}const pe=Math.hypot(j[0].pos.x-r.x,j[0].pos.y-r.y),T=Math.hypot(j[1].pos.x-j[0].pos.x,j[1].pos.y-j[0].pos.y),J=Math.hypot(l.x-j[1].pos.x,l.y-j[1].pos.y),le=Math.min(pe,T,J,14)*.45,H=Math.max(2,le);G.push(r),G.push({x:j[0].pos.x-H*j[0].d1.x,y:j[0].pos.y-H*j[0].d1.y});for(const oe of z(j[0],H,7))G.push(oe);G.push({x:j[1].pos.x-H*j[1].d1.x,y:j[1].pos.y-H*j[1].d1.y});for(const oe of z(j[1],H,7))G.push(oe);G.push(l);const xe=[];let Be=0;for(let oe=0;oe<G.length-1;oe++){const Qe=Math.hypot(G[oe+1].x-G[oe].x,G[oe+1].y-G[oe].y);xe.push(Qe),Be+=Qe}const be=[],Q=[];let ve=0;for(let oe=0;oe<G.length;oe++){const Qe=G[Math.max(0,oe-1)],Bt=G[Math.min(G.length-1,oe+1)],Ft=Bt.x-Qe.x,Bn=Bt.y-Qe.y;let Ke=Math.hypot(Ft,Bn);Ke<1e-6&&(Ke=1);const Ye=-Bn/Ke,st=Ft/Ke;oe>0&&(ve+=xe[oe-1]);const ct=Be>0?ve/Be:0,Ie=(f+(M-f)*ct)/2;be.push({x:G[oe].x+Ye*Ie,y:G[oe].y+st*Ie}),Q.push({x:G[oe].x-Ye*Ie,y:G[oe].y-st*Ie})}const ot=f/2,Fe=M/2;let Rt=`M ${be[0].x.toFixed(2)} ${be[0].y.toFixed(2)}`;for(let oe=1;oe<be.length;oe++)Rt+=` L ${be[oe].x.toFixed(2)} ${be[oe].y.toFixed(2)}`;Rt+=` A ${Fe.toFixed(2)} ${Fe.toFixed(2)} 0 0 0 ${Q[be.length-1].x.toFixed(2)} ${Q[be.length-1].y.toFixed(2)}`;for(let oe=Q.length-2;oe>=0;oe--)Rt+=` L ${Q[oe].x.toFixed(2)} ${Q[oe].y.toFixed(2)}`;return Rt+=` A ${ot.toFixed(2)} ${ot.toFixed(2)} 0 0 0 ${be[0].x.toFixed(2)} ${be[0].y.toFixed(2)}`,Rt+=" Z",Rt}{const z=l.x-r.x,G=l.y-r.y;let j=Math.hypot(z,G);j<1e-6&&(j=1);const pe=-G/j,T=z/j,J=f/2,le=M/2,H={x:r.x+pe*J,y:r.y+T*J},xe={x:r.x-pe*J,y:r.y-T*J},Be={x:l.x-pe*le,y:l.y-T*le},be={x:l.x+pe*le,y:l.y+T*le};return`M ${H.x.toFixed(2)} ${H.y.toFixed(2)} L ${be.x.toFixed(2)} ${be.y.toFixed(2)} L ${Be.x.toFixed(2)} ${Be.y.toFixed(2)} L ${xe.x.toFixed(2)} ${xe.y.toFixed(2)} Z`}}const ht=e.computed(()=>bt.value.root.children),xo=ln[0].colors,Je=e.computed(()=>Ha(B.branchPaletteId,B.customPalettes)),nn=e.computed(()=>{const r=new Map;if(!B.rainbowBranch)return r;const l=i.lineColors,f=l&&l.length>0?l:Je.value.colors.length>0?Je.value.colors:xo;for(let N=0;N<ht.value.length;N++){const O=ht.value[N];r.set(O.id,f[N%f.length])}const M=(N,O)=>{r.set(N.id,O);for(const _ of N.children)M(_,O)};for(let N=0;N<ht.value.length;N++){const O=ht.value[N];M(O,f[N%f.length])}return r});function wo(r,l){return B.rainbowBranch?nn.value.get(l.id)??ut.value.lineColor:ut.value.lineColor}function Kl(r){const l=ce(r.id);if(l.bg)return l.bg;if(r.isRoot)return ut.value.rootBg;if(B.rainbowBranch){const f=nn.value.get(r.id);if(f)return cg(f,.18)}return ut.value.branchBg}function Qn(r){const l=ce(r.id);if(l.textColor)return l.textColor;if(r.isRoot)return ut.value.rootText;if(B.rainbowBranch){const f=nn.value.get(r.id);if(f)return Xl(f,.55)}return ut.value.branchText}function eo(r){const l=ce(r.id);if(l.borderColor)return l.borderColor;if(r.isRoot)return ut.value.rootBg;if(B.rainbowBranch){const f=nn.value.get(r.id);if(f)return Xl(f,.3)}return ut.value.lineColor}function Yl(r){const l=ce(r.id);return l.fontWeight?l.fontWeight:r.isRoot?700:r.depth<=1?600:r.depth===2?500:400}function ql(r){return ce(r.id).fontSize??r.fontSize??ut.value.fontSize}function cg(r,l){const f=r.replace("#",""),M=f.length===6?f:f.split("").map(z=>z+z).join(""),N=parseInt(M.slice(0,2),16),O=parseInt(M.slice(2,4),16),_=parseInt(M.slice(4,6),16);return`rgba(${N}, ${O}, ${_}, ${l})`}function Xl(r,l){const f=r.replace("#",""),M=f.length===6?f:f.split("").map(z=>z+z).join(""),N=Math.round(parseInt(M.slice(0,2),16)*(1-l)),O=Math.round(parseInt(M.slice(2,4),16)*(1-l)),_=Math.round(parseInt(M.slice(4,6),16)*(1-l));return`rgb(${N}, ${O}, ${_})`}const de=ts({getContainer:()=>c.value});de.setOnMarqueeEnd(_g),os({isEditing:()=>s.value!==null,isReadonly:()=>i.previewMode,getSelectedId:()=>g.value,getSelectedIds:()=>[...d.value],defaultTargetId:()=>m.value.id,onAddChild:no,onAddSibling:si,onAddSiblingBefore:Eg,onRemove:ca,onStartEdit:No,onClearSelection:()=>{d.value=new Set,kt()},onDuplicate:na,onCopy:la,onCut:aa,onPaste:sa,hasClipboard:()=>!!U.value&&U.value.nodes.length>0,onUndo:Xi,onRedo:Zi,onNavigate:xg,onSelectRoot:()=>{d.value=new Set([m.value.id]),kt()}});const bt=e.computed(()=>{const r=Ot(m.value);return Ql(r),Va(r,{mode:B.layoutMode,baseFontSize:ut.value.fontSize,richHeights:F.value,richWidths:W.value})}),Zl=e.ref([]),to=e.computed(()=>(_t.value,Zl.value));e.watch(bt,r=>{const l=[],f=M=>{l.push(M);for(const N of M.children)f(N)};f(r.root),Zl.value=l},{immediate:!0});const Jl=e.computed(()=>{const r=[];for(const l of to.value)for(const f of l.children)r.push({from:l,to:f,key:`${l.id}->${f.id}`});return r}),dg=e.computed(()=>`${bt.value.vbX} ${bt.value.vbY} ${bt.value.vbW} ${bt.value.vbH}`);function Ql(r){if(h.value.has(r.id)){r.children=[],r.collapsed=!0;return}r.collapsed=!1;for(const l of r.children)Ql(l)}function No(r){const l=ue(m.value,r);l&&(s.value=r,u.value=l.text,d.value=new Set([r]),kt(),e.nextTick(()=>{const f=document.querySelector(".zm-input");f==null||f.focus(),f==null||f.select(),ea(f)}))}function qi(){if(!s.value)return;const r=ue(m.value,s.value);r&&r.text!==(u.value.trim()||" ")&&(r.text=u.value.trim()||" ",$e(),a("change",m.value)),s.value=null}function ug(){s.value=null}function ea(r){r&&(r.style.height="auto",r.style.height=r.scrollHeight+"px")}function fg(r){ea(r.target)}function mg(r){if(i.previewMode)return;const l=ue(m.value,r);l!=null&&l.richContent&&(A.value=r,x.value=l.richContent.raw,e.nextTick(()=>{const f=document.querySelector(".zm-node .zm-rich textarea");f==null||f.focus()}))}function ta(){if(!A.value)return;const r=A.value,l=ue(m.value,r),f=x.value;if(l&&l.richContent&&l.richContent.raw!==f)if(l.richContent.kind==="code"){const M=wn(f)||void 0;Me(r,{kind:"code",raw:f,lang:M})}else Me(r,{kind:"table",raw:f});A.value=null}function pg(){A.value=null}function gg(r){r.key==="Escape"?(r.preventDefault(),pg()):r.key==="Enter"&&(r.ctrlKey||r.metaKey)&&(r.preventDefault(),ta())}function hg(r,l){const f=k.value.get(r);!f||f.col!==l?k.value.set(r,{col:l,dir:"asc"}):f.dir==="asc"?k.value.set(r,{col:l,dir:"desc"}):k.value.delete(r)}function bg(r,l){const f=k.value.get(r);return!f||l.length<=1?l:dl(l,f.col,f.dir)}function kg(r,l){const f=k.value.get(r);return!f||f.col!==l?"↕":f.dir==="asc"?"▲":"▼"}function yg(r){const l=r.metaKey||r.ctrlKey;l&&(r.key==="z"||r.key==="Z")&&!r.shiftKey?(r.preventDefault(),Xi()):(l&&r.shiftKey&&(r.key==="z"||r.key==="Z")||l&&(r.key==="y"||r.key==="Y")&&!r.shiftKey)&&(r.preventDefault(),Zi())}function no(r){const l=kr(m.value,r,vo);l&&($e(),Ee(),a("change",m.value),e.nextTick(()=>No(l.id)))}function si(r){if(r===m.value.id){no(r);return}const l=yr(m.value,r,vo);l&&($e(),Ee(),a("change",m.value),e.nextTick(()=>No(l.id)))}function Eg(r){if(r===m.value.id){no(r);return}const l=Xa(m.value,r,vo);l&&($e(),Ee(),a("change",m.value),e.nextTick(()=>No(l.id)))}function na(r){if(r===m.value.id)return;const l=Za(m.value,r);l&&($e(),d.value=new Set([l.id]),kt(),a("change",m.value),Ee())}function oa(r){const l=[],f=new Set;for(const M of r)M!==m.value.id&&(f.has(M)||ue(m.value,M)&&(f.add(M),l.push(M)));return l}function ia(r){const l=new Set(r),f=[],M=N=>{l.has(N.id)&&f.push(N.id);for(const O of N.children)M(O)};return M(m.value),f}function ra(r){var l;try{(l=navigator.clipboard)==null||l.writeText(r)}catch{}}function la(r){const l=ia(oa(r));if(l.length===0)return;const f=[];for(const M of l){const N=Er(m.value,M);N&&f.push(N)}f.length!==0&&(U.value={nodes:f,originalIds:new Set(l)},ra(f.map(M=>M.text).join(`
|
|
135
|
+
`)),Ee())}function aa(r){const l=ia(oa(r));if(l.length===0)return;const f=[];for(const M of l){const N=Er(m.value,M);N&&f.push(N)}if(f.length!==0){$e();for(const M of l)Ro(m.value,M);d.value=new Set,kt(),U.value={nodes:f,originalIds:new Set(l)},ra(f.map(M=>M.text).join(`
|
|
136
|
+
`)),Ee(),a("change",m.value)}}function sa(r){const l=U.value;if(!l||l.nodes.length===0)return;const f=r??m.value.id,M=ue(m.value,f);if(M){for(const N of l.originalIds){const O=ue(m.value,N);if(O&&ue(O,f))return}$e();for(const N of l.nodes){const O=Ot(N);Bo(O),M.children.push(O)}U.value=null,Ee(),a("change",m.value)}}function Xi(){const r=Yt.undo();r&&(m.value=r.data,d.value=new Set(r.selectedIds??[]),kt(),Ee(),a("change",m.value))}function Zi(){const r=Yt.redo();r&&(m.value=r.data,d.value=new Set(r.selectedIds??[]),kt(),Ee(),a("change",m.value))}function kt(){const r=[];for(const l of d.value){const f=ue(m.value,l);f&&r.push(f)}if(i.builtInDrawers&&!i.previewMode&&r.length>0){const l=r[0];!gt.value&&ba(l.id)&&(Ct(),gt.value=!0)}else i.builtInDrawers&&r.length===0&&(gt.value=!1);a("select",r.length>0?r:null)}function xg(r,l){const f=g.value??m.value.id,M=ue(m.value,f);if(!M)return;let N=null;if(l===1){const O=Gt(m.value,M.id);if(O){const _=O.children.findIndex(z=>z.id===M.id);_>=0&&_<O.children.length-1&&(N=O.children[_+1].id)}}else if(l===-1){const O=Gt(m.value,M.id);if(O){const _=O.children.findIndex(z=>z.id===M.id);_>0&&(N=O.children[_-1].id)}}else if(r===1){const O=Gt(m.value,M.id);O&&(N=O.id)}else r===-1&&M.children.length>0&&(N=M.children[0].id);N&&(d.value=new Set([N]),kt())}function ca(r){if(r!==m.value.id&&Ro(m.value,r)){if($e(),d.value.has(r)){const l=new Set(d.value);l.delete(r),d.value=l,kt()}Ee(),a("change",m.value)}}function da(r){h.value.has(r)?h.value.delete(r):h.value.add(r),Ee()}function ua(r){const l=[{n:m.value,depth:1}];for(;l.length;){const{n:f,depth:M}=l.pop();r(f,M);for(let N=f.children.length-1;N>=0;N--)l.push({n:f.children[N],depth:M+1})}}function wg(){h.value=new Set,ua(r=>{r.children.length>0&&h.value.add(r.id)}),Ee()}function fa(r){h.value=new Set,ua((l,f)=>{f>r&&l.children.length>0&&h.value.add(l.id)}),Ee()}function Ng(){h.value=new Set,Ee()}function ma(r,l){Ya(m.value,r,l)&&($e(),Ee(),a("change",m.value))}function Ji(r,l,f){return qa(m.value,r,l,f)?($e(),Ee(),a("change",m.value),!0):!1}function Sg(r,l){if(r.stopPropagation(),r.shiftKey){const f=new Set(d.value);f.has(l.id)?f.delete(l.id):f.add(l.id),d.value=f}else d.value=new Set([l.id]);kt()}function Tg(r,l,f){let M=null;for(const N of to.value){if(N.id===f)continue;const O=N.width/2,_=N.height/2;r>=N.x-O&&r<=N.x+O&&l>=N.y-_&&l<=N.y+_&&(M=N)}return M}let qt=null;function Cg(r,l){if(i.previewMode||l.isRoot||r.button!==0)return;const f=r.target;if(f!=null&&f.closest(".zm-img-resize-handle"))return;r.stopPropagation();const M=c.value.getBoundingClientRect(),N=l.x*de.scale.value+de.offsetX.value,O=l.y*de.scale.value+de.offsetY.value,_=r.clientX-M.left-N,z=r.clientY-M.top-O;qt={srcId:l.id,srcText:l.text,pointerOffsetX:_,pointerOffsetY:z,startX:r.clientX,startY:r.clientY},window.addEventListener("pointermove",pa),window.addEventListener("pointerup",ci),window.addEventListener("pointercancel",ci)}function pa(r){if(qt){const _=r.clientX-qt.startX,z=r.clientY-qt.startY;if(Math.abs(_)<=Gl&&Math.abs(z)<=Gl)return;C.value={srcId:qt.srcId,srcText:qt.srcText,pointerOffsetX:qt.pointerOffsetX,pointerOffsetY:qt.pointerOffsetY,currentTargetId:null},document.body.classList.add("is-dragging"),qt=null}const l=C.value;if(!l)return;const f=c.value.getBoundingClientRect();P.value=r.clientX-f.left-l.pointerOffsetX,R.value=r.clientY-f.top-l.pointerOffsetY;const M=(r.clientX-f.left-de.offsetX.value)/de.scale.value,N=(r.clientY-f.top-de.offsetY.value)/de.scale.value,O=Tg(M,N,l.srcId);l.currentTargetId=(O==null?void 0:O.id)??null}function ci(r){if(window.removeEventListener("pointermove",pa),window.removeEventListener("pointerup",ci),window.removeEventListener("pointercancel",ci),qt){qt=null;return}const l=C.value;l&&(l.currentTargetId&&(Ji(l.srcId,l.currentTargetId,"child"),d.value=new Set([l.srcId]),kt()),C.value=null,P.value=0,R.value=0,document.body.classList.remove("is-dragging"))}let di=!1;function Mg(r){const l=r.target;if(!l||l.closest(".zm-node, .zm-toolbar, button, input, textarea"))return;if(r.button===2){di=!0,de.startPan(r);return}if(di=!1,r.button!==0)return;const f=c.value.getBoundingClientRect(),M=(r.clientX-f.left-de.offsetX.value)/de.scale.value,N=(r.clientY-f.top-de.offsetY.value)/de.scale.value;de.startMarquee(M,N,{shift:r.shiftKey})}function Ag(r){if(Rn){Rn=!1;return}const l=r.target;if(!l||l.closest(".zm-node"))return;const f=de.marquee;f.width>=4||f.height>=4||d.value.size>0&&(d.value=new Set,kt())}function _g(){const r=de.marquee;if(r.width<4&&r.height<4)return;const l=r.x,f=r.y,M=r.x+r.width,N=r.y+r.height,O=[];for(const _ of to.value){const z=_.width/2,G=_.height/2,j=_.x-z,pe=_.x+z,T=_.y-G,J=_.y+G;j<=M&&pe>=l&&T<=N&&J>=f&&O.push(_.id)}d.value=r.shiftKey?new Set([...d.value,...O]):new Set(O),kt()}function ga(r){return h.value.has(r)}function Rg(r){const l=ue(m.value,r.id);return!!l&&l.children.length>0}function Qi(r){const l=ue(m.value,r);return l?l.children.length:0}function ha(r){if(!ue(m.value,r))return 0;const M=[m.value];for(;M.length;){const N=M.pop(),O=N.children.findIndex(_=>_.id===r);if(O>=0)return O;for(const _ of N.children)M.push(_)}return 0}function ui(r,l,f,M){const N=(M==null?void 0:M._dir)??r._dir;if(l==="out"&&r.isRoot&&B.lineOrigin==="center")return{x:r.x,y:r.y};if(l==="out"&&r.isRoot&&B.lineOrigin==="proportional"&&M){const z=bt.value.root.children;if(N==="down"){const le=z.reduce((be,Q)=>Math.max(be,Math.abs(Q.x-r.x)),1),H=Math.min(1,Math.abs(M.x-r.x)/le),xe=r.y+r.height/2,Be=r.y;return{x:r.x,y:xe+(Be-xe)*H}}const G=z.reduce((le,H)=>Math.max(le,Math.abs(H.y-r.y)),1),j=Math.min(1,Math.abs(M.y-r.y)/G),pe=f!==void 0?f:r.side,T=r.x+pe*(r.width/2),J=r.x;return{x:T+(J-T)*j,y:r.y}}if(N==="down")return l==="out"?{x:r.x,y:r.y+r.height/2}:{x:r.x,y:r.y-r.height/2};let O;l==="in"?O=-r.side:f!==void 0?O=f:O=r.side;const _=l==="in"?r._richInsetX??0:0;return{x:r.x+O*(r.width/2-_),y:r.y}}function sn(){const r=bt.value;de.resetView(r.width,r.height,r.root.y)}function Bg(){Jn.value=!0,$e(),Ee(),e.nextTick(()=>sn())}function er(r){B.layoutMode!==r&&(B.layoutMode=r,Ee(),e.nextTick(()=>sn()))}function vg(){return JSON.stringify(m.value,null,2)}function ba(r){const l=ue(m.value,r);return l?!!(l.note&&l.note.text||l.link&&l.link.url||l.image&&l.image.src||l.richContent&&l.richContent.raw||l.markers&&l.markers.length>0||l.tags&&l.tags.length>0):!1}function Ig(r){try{const l=JSON.parse(r);return!l.id||!Array.isArray(l.children)?!1:(Yt.reset(),m.value=Ot(l),d.value=new Set,h.value=new Set,Ee(),e.nextTick(()=>sn()),a("change",m.value),!0)}catch{return!1}}const ka=e.ref(""),cn=e.ref([]),So=e.ref(-1);function zg(r){ka.value=r;const l=r.trim();if(!l){cn.value=[],So.value=-1;return}const f=l.toLowerCase(),M=[],N=O=>{var _;(O.text.toLowerCase().includes(f)||(_=O.note)!=null&&_.text&&O.note.text.toLowerCase().includes(f))&&M.push(O.id);for(const z of O.children)N(z)};N(m.value),cn.value=M,So.value=M.length>0?0:-1,M.length>0&&($g(M),e.nextTick(()=>Vg(0)))}function Og(r){return cn.value.includes(r)}function Lg(r){return So.value>=0&&cn.value[So.value]===r}function Dg(r){return ka.value.trim().length>0&&cn.value.length>0&&!cn.value.includes(r)}function $g(r){if(r.length===0)return;const l=new Set(r),f=new Set,M=N=>{let O=l.has(N.id);for(const _ of N.children)M(_)&&(O=!0);return O&&N.children.length>0&&h.value.has(N.id)&&f.add(N.id),O};if(M(m.value),f.size>0){for(const N of f)h.value.delete(N);Ee()}}function Vg(r){const l=cn.value[r];if(!l)return;const f=to.value.find(M=>M.id===l);f&&(d.value=new Set([l]),kt(),de.centerOn(f.x,f.y,f.width,f.height))}function Pg(r,l){const f=ue(m.value,r);f&&(f.markers||(f.markers=[]),!f.markers.includes(l)&&(f.markers.push(l),$e(),Ee(),a("change",m.value)))}function Fg(r,l){const f=ue(m.value,r);if(!f||!f.markers)return;const M=f.markers.indexOf(l);M<0||(f.markers.splice(M,1),f.markers.length===0&&delete f.markers,$e(),Ee(),a("change",m.value))}function ya(r,l){const f=ue(m.value,r);if(!f)return!1;f.markers||(f.markers=[]);const M=f.markers.indexOf(l);return M>=0?(f.markers.splice(M,1),f.markers.length===0&&delete f.markers,$e(),Ee(),a("change",m.value),!1):(f.markers.push(l),$e(),Ee(),a("change",m.value),!0)}function Ug(r){const l=ue(m.value,r);return l!=null&&l.markers?[...l.markers]:[]}function Hg(r){var f;const l=(f=y.value)==null?void 0:f.nodeId;l&&ya(l,r)}function Wg(){var f;const r=(f=y.value)==null?void 0:f.nodeId;if(!r)return;const l=ue(m.value,r);!l||!l.markers||(delete l.markers,$e(),Ee(),a("change",m.value),ge())}function tr(r,l){const f=ue(m.value,r);f&&(l.length===0?f.tags&&delete f.tags:f.tags=[...l],$e(),Ee(),a("change",m.value))}function Gg(r){const l=ue(m.value,r);return l!=null&&l.tags?[...l.tags]:[]}function jg(){var O,_;const r=(O=y.value)==null?void 0:O.nodeId;if(!r)return;const l=ue(m.value,r),f=((_=l==null?void 0:l.tags)==null?void 0:_.join(", "))??"",M=window.prompt("输入标签(多个用逗号分隔)",f);if(M===null)return;const N=M.split(/[,,]/).map(z=>z.trim()).filter(z=>z.length>0);tr(r,N),ge()}function Kg(){var l;const r=(l=y.value)==null?void 0:l.nodeId;r&&(tr(r,[]),ge())}function Ea(){const r=bt.value,l="http://www.w3.org/2000/svg",f=document.createElementNS(l,"svg");f.setAttribute("xmlns",l),f.setAttribute("viewBox",`${r.vbX} ${r.vbY} ${r.vbW} ${r.vbH}`),f.setAttribute("width",String(r.vbW)),f.setAttribute("height",String(r.vbH));const M=document.createElementNS(l,"rect");M.setAttribute("x",String(r.vbX)),M.setAttribute("y",String(r.vbY)),M.setAttribute("width",String(r.vbW)),M.setAttribute("height",String(r.vbH)),M.setAttribute("fill",tn.value),f.appendChild(M);for(const _ of Jl.value){const z=document.createElementNS(l,"path");z.setAttribute("d",St(ui(_.from,"out",_.to.side,_.to),ui(_.to,"in"),L(_.from.depth),q(_.to.depth),32,b(_.from.isRoot),_.to._dir)),z.setAttribute("fill",wo(_.from,_.to)),z.setAttribute("stroke","none"),f.appendChild(z)}const N="-apple-system,BlinkMacSystemFont,'Segoe UI','PingFang SC','Microsoft YaHei',sans-serif";function O(_,z){let G=0;for(const j of _)/[\u4e00-\u9fff\u3000-\u30ff\uff00-\uffef]/.test(j)?G+=z:G+=z*.55;return G}for(const _ of to.value){const z=_.x-_.width/2,G=_.y-_.height/2,j=document.createElementNS(l,"rect");j.setAttribute("x",String(z)),j.setAttribute("y",String(G)),j.setAttribute("width",String(_.width)),j.setAttribute("height",String(_.height)),j.setAttribute("rx","8"),j.setAttribute("fill",Kl(_)),j.setAttribute("stroke",eo(_)),j.setAttribute("stroke-width","1"),f.appendChild(j);const pe=!!(_.tags&&_.tags.length>0),T=!!(_.markers&&_.markers.length>0),J=!!_.image,le=!!(_.richContent&&(_.richContent.kind==="code"||_.richContent.kind==="table"));let H=0,xe=0;if(le){const Ye=_.richContent,st=_.fontSize*.78*.92,ct=6,Ie=4,Ut=2,on=6;if(Ye.kind==="code"){const yt=Go(Ye.raw),Tt=wn(Ye.raw),vt=yt.split(`
|
|
137
|
+
`),rn=st*1.35;let Ht=0;for(const Ue of vt)Ht=Math.max(Ht,O(Ue,st));xe=Math.min(Ht+ct*2+4,_.width-4),H=vt.length*rn+Ie*2+Ut;const it=_.x-xe/2;let Et=G+4;J&&(Et=G+_.image.height+on);const It=document.createElementNS(l,"rect");if(It.setAttribute("x",String(it)),It.setAttribute("y",String(Et)),It.setAttribute("width",String(xe)),It.setAttribute("height",String(H-Ut)),It.setAttribute("rx","6"),It.setAttribute("fill","rgba(255,255,255,0.55)"),It.setAttribute("stroke",eo(_)),It.setAttribute("stroke-width","1"),f.appendChild(It),Tt){const Ue=document.createElementNS(l,"text");Ue.setAttribute("x",String(it+xe-ct)),Ue.setAttribute("y",String(Et+Ie+4)),Ue.setAttribute("text-anchor","end"),Ue.setAttribute("fill",Qn(_)),Ue.setAttribute("font-size",String(st*.8)),Ue.setAttribute("font-family",N),Ue.setAttribute("opacity","0.5"),Ue.textContent=Tt,f.appendChild(Ue)}const Co="'JetBrains Mono','Fira Code',Consolas,monospace";for(let Ue=0;Ue<vt.length;Ue++){const ft=document.createElementNS(l,"text");ft.setAttribute("x",String(it+ct)),ft.setAttribute("y",String(Et+Ie+(Ue+.5)*rn+2)),ft.setAttribute("dominant-baseline","central"),ft.setAttribute("fill",Qn(_)),ft.setAttribute("font-size",String(st)),ft.setAttribute("font-family",Co);let Wt=vt[Ue];const qe=Math.floor((xe-ct*2)/(st*.6));Wt.length>qe&&(Wt=Wt.substring(0,qe-1)+"…"),ft.textContent=Wt,f.appendChild(ft)}}else if(Ye.kind==="table"){const yt=Mi(Ye.raw);if(yt.length>0){const Tt=st*1.35,vt=6,rn=3,Ht=yt[0].length,it=[];for(let qe=0;qe<Ht;qe++){let dn=0;for(const yn of yt)qe<yn.length&&(dn=Math.max(dn,O(yn[qe],st)));it.push(dn+vt*2)}xe=Math.min(it.reduce((qe,dn)=>qe+dn,0),_.width-4);const Et=xe/it.reduce((qe,dn)=>qe+dn,0);for(let qe=0;qe<Ht;qe++)it[qe]*=Et;H=yt.length*(Tt+rn*2)+Ut;const It=_.x-xe/2;let Co=G+4;J&&(Co=G+_.image.height+on);const Ue=document.createElementNS(l,"rect");Ue.setAttribute("x",String(It)),Ue.setAttribute("y",String(Co)),Ue.setAttribute("width",String(xe)),Ue.setAttribute("height",String(H-Ut)),Ue.setAttribute("rx","6"),Ue.setAttribute("fill","rgba(255,255,255,0.55)"),Ue.setAttribute("stroke",eo(_)),Ue.setAttribute("stroke-width","1"),f.appendChild(Ue);let ft=It,Wt=Co;for(let qe=0;qe<yt.length;qe++){const dn=yt[qe],yn=Tt+rn*2;ft=It;for(let Mo=0;Mo<Ht;Mo++){const oo=it[Mo],Yg=dn[Mo]||"";if(Mo<Ht-1){const Xe=document.createElementNS(l,"line");Xe.setAttribute("x1",String(ft+oo)),Xe.setAttribute("y1",String(Wt)),Xe.setAttribute("x2",String(ft+oo)),Xe.setAttribute("y2",String(Wt+yn)),Xe.setAttribute("stroke",eo(_)),Xe.setAttribute("stroke-width","1"),f.appendChild(Xe)}if(qe<yt.length-1){const Xe=document.createElementNS(l,"line");Xe.setAttribute("x1",String(ft)),Xe.setAttribute("y1",String(Wt+yn)),Xe.setAttribute("x2",String(ft+oo)),Xe.setAttribute("y2",String(Wt+yn)),Xe.setAttribute("stroke",eo(_)),Xe.setAttribute("stroke-width","1"),f.appendChild(Xe)}if(qe===0){const Xe=document.createElementNS(l,"rect");Xe.setAttribute("x",String(ft)),Xe.setAttribute("y",String(Wt)),Xe.setAttribute("width",String(oo)),Xe.setAttribute("height",String(yn)),Xe.setAttribute("fill","rgba(255,255,255,0.4)"),f.appendChild(Xe)}const un=document.createElementNS(l,"text");un.setAttribute("x",String(ft+vt)),un.setAttribute("y",String(Wt+rn+Tt/2+2)),un.setAttribute("dominant-baseline","central"),un.setAttribute("fill",Qn(_)),un.setAttribute("font-size",String(st)),un.setAttribute("font-family",N),qe===0&&un.setAttribute("font-weight","600");let fi=Yg;const nr=Math.floor((oo-vt*2)/(st*.55));fi.length>nr&&nr>2&&(fi=fi.substring(0,nr-1)+"…"),un.textContent=fi,f.appendChild(un),ft+=oo}Wt+=yn}}}}let Be=0;if(J){const Ye=_.image,st=G+4,ct=_.x-Ye.width/2,Ie=document.createElementNS(l,"image");Ie.setAttribute("x",String(ct)),Ie.setAttribute("y",String(st)),Ie.setAttribute("width",String(Ye.width)),Ie.setAttribute("height",String(Ye.height)),Ie.setAttribute("href",Ye.src),Ie.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",Ye.src),Ie.setAttribute("preserveAspectRatio","xMidYMid meet"),f.appendChild(Ie),Be=Ye.height+6}let be=_.y;const Q=Be+H;Q>0?be=G+Q+(_.height-Q)/2:pe&&(be=_.y-8);const ve=14,ot=2,Fe=4,Rt=T?_.markers.length:0,oe=Rt>0?Rt*ve+(Rt-1)*ot+Fe:0,Qe=O(_.text,_.fontSize),Bt=oe+Qe,Ft=_.x-Bt/2;if(T){let Ye=Ft;for(const st of _.markers){const ct=zo(st);if(ct){const Ie=document.createElementNS(l,"svg");Ie.setAttribute("x",String(Ye)),Ie.setAttribute("y",String(be-ve/2)),Ie.setAttribute("width",String(ve)),Ie.setAttribute("height",String(ve)),Ie.setAttribute("viewBox","0 0 24 24"),Ie.setAttribute("color",Qn(_));const on=new DOMParser().parseFromString(`<svg xmlns="${l}">${ct}</svg>`,"image/svg+xml");if(!on.querySelector("parsererror"))for(;on.documentElement.firstChild;)Ie.appendChild(on.documentElement.firstChild);f.appendChild(Ie)}Ye+=ve+ot}}const Bn=T?Ft+oe+Qe/2:_.x,Ke=document.createElementNS(l,"text");if(Ke.setAttribute("x",String(Bn)),Ke.setAttribute("y",String(be)),Ke.setAttribute("text-anchor","middle"),Ke.setAttribute("dominant-baseline","central"),Ke.setAttribute("fill",Qn(_)),Ke.setAttribute("font-size",String(ql(_))),Ke.setAttribute("font-weight",String(Yl(_))),Ke.setAttribute("font-family",N),Ke.textContent=_.text,f.appendChild(Ke),pe){const Ie=_.y+10,Ut=_.tags.map(Tt=>O(Tt,10)+12),on=Ut.reduce((Tt,vt)=>Tt+vt+3,-3);let yt=_.x-on/2;for(let Tt=0;Tt<_.tags.length;Tt++){const vt=_.tags[Tt],rn=hi(vt),Ht=Ut[Tt],it=document.createElementNS(l,"rect");it.setAttribute("x",String(yt)),it.setAttribute("y",String(Ie-16/2)),it.setAttribute("width",String(Ht)),it.setAttribute("height",String(16)),it.setAttribute("rx",String(16/2)),it.setAttribute("fill",rn.background),it.setAttribute("stroke",rn.borderColor),it.setAttribute("stroke-width","1"),f.appendChild(it);const Et=document.createElementNS(l,"text");Et.setAttribute("x",String(yt+Ht/2)),Et.setAttribute("y",String(Ie)),Et.setAttribute("text-anchor","middle"),Et.setAttribute("dominant-baseline","central"),Et.setAttribute("fill",rn.color),Et.setAttribute("font-size",String(10)),Et.setAttribute("font-family",N),Et.textContent=vt,f.appendChild(Et),yt+=Ht+3}}}return f}function To(){const r=Ea();let f=new XMLSerializer().serializeToString(r);f.startsWith("<?xml")||(f=`<?xml version="1.0" encoding="UTF-8"?>
|
|
138
|
+
`+f);const M=new Blob([f],{type:"image/svg+xml;charset=utf-8"}),N=URL.createObjectURL(M),O=document.createElement("a");O.href=N,O.download=`${m.value.text||"mindmap"}.svg`,O.click(),URL.revokeObjectURL(N)}function xa(r=2){const l=Ea(),f=bt.value;let N=new XMLSerializer().serializeToString(l);N.startsWith("<?xml")||(N=`<?xml version="1.0" encoding="UTF-8"?>
|
|
139
|
+
`+N);const O=new Blob([N],{type:"image/svg+xml;charset=utf-8"}),_=URL.createObjectURL(O),z=new window.Image;z.onload=()=>{const G=document.createElement("canvas");G.width=Math.ceil(f.vbW*r),G.height=Math.ceil(f.vbH*r);const j=G.getContext("2d");if(!j){URL.revokeObjectURL(_);return}j.fillStyle=tn.value,j.fillRect(0,0,G.width,G.height),j.drawImage(z,0,0,G.width,G.height),URL.revokeObjectURL(_);try{G.toBlob(pe=>{if(!pe){To();return}const T=URL.createObjectURL(pe),J=document.createElement("a");J.href=T,J.download=`${m.value.text||"mindmap"}.png`,J.click(),URL.revokeObjectURL(T)},"image/png")}catch(pe){console.warn("PNG export failed, falling back to SVG:",pe),To()}},z.onerror=()=>{URL.revokeObjectURL(_),To()},z.src=_}return o({addChild:r=>no(r),addSibling:r=>si(r),removeNode:r=>ca(r),duplicateNode:r=>na(r),setNodeText:(r,l)=>ma(r,l),moveNode:(r,l,f)=>Ji(r,l,f),lineWidthForDepth:L,endWidthForDepth:q,getData:()=>m.value,nodeHasContent:r=>ba(r),getSelectedIds:()=>[...d.value],copyNodes:r=>la(r),cutNodes:r=>aa(r),pasteNodes:r=>sa(r),setData:r=>{Yt.reset(),m.value=Ot(r),d.value=new Set,h.value=new Set,Ee(),$e(),e.nextTick(()=>sn())},resetView:()=>sn(),exportData:vg,importData:Ig,getMarkdown:()=>On(m.value),setMarkdown:(r,l=!0)=>{const f=zn(r||"");l&&(K.value=!0),S=!l,Yt.reset(),m.value=Ot(f),d.value=new Set,h.value=new Set,Ee(),$e(),e.nextTick(()=>{S=!1,sn()}),a("change",m.value)},setBalanced:r=>{Jn.value=r},isBalanced:()=>Jn.value,balance:()=>Bg(),applyNodeStyle:(r,l)=>Z(r,l),getNodeStyle:r=>ce(r),applyNodeImage:(r,l)=>ie(r,l),applyNodeImageByUrl:(r,l)=>v(r,l),removeNodeImage:r=>me(r),applyNodeLink:(r,l)=>fe(r,l),removeNodeLink:r=>Ae(r),applyNodeNote:(r,l)=>De(r,l),removeNodeNote:r=>Pe(r),applyNodeRichContent:(r,l)=>Me(r,l),addNodeMarker:(r,l)=>Pg(r,l),removeNodeMarker:(r,l)=>Fg(r,l),toggleNodeMarker:(r,l)=>ya(r,l),getNodeMarkers:r=>Ug(r),setNodeTags:(r,l)=>tr(r,l),getNodeTags:r=>Gg(r),exportPNG:r=>xa(r),exportSVG:()=>To(),searchNodes:r=>(zg(r),[...cn.value]),undo:()=>Xi(),redo:()=>Zi(),canUndo:()=>Yt.canUndo(),canRedo:()=>Yt.canRedo(),applySettings:r=>{r.autoBalanceOnChange!==void 0&&(B.autoBalanceOnChange=r.autoBalanceOnChange),r.lineWidthStart!==void 0&&(B.lineWidthStart=Math.max(.5,Math.min(20,r.lineWidthStart))),r.lineWidthEnd!==void 0&&(B.lineWidthEnd=Math.max(.3,Math.min(10,r.lineWidthEnd))),r.rainbowBranch!==void 0&&(B.rainbowBranch=r.rainbowBranch),r.branchPaletteId!==void 0&&(B.branchPaletteId=r.branchPaletteId),r.customPalettes!==void 0&&(B.customPalettes=r.customPalettes),r.lineStyle!==void 0&&(B.lineStyle=r.lineStyle),r.rootLineStyle!==void 0&&(B.rootLineStyle=r.rootLineStyle),r.lineOrigin!==void 0&&(B.lineOrigin=r.lineOrigin),r.taperedEdge!==void 0&&(B.taperedEdge=r.taperedEdge),r.lineWidthTaper!==void 0&&(B.lineWidthTaper=Math.max(.3,Math.min(1,r.lineWidthTaper))),r.showOrderBadge!==void 0&&(B.showOrderBadge=r.showOrderBadge),r.canvasBg!==void 0&&(B.canvasBg=r.canvasBg)},getSettings:()=>({autoBalanceOnChange:B.autoBalanceOnChange,lineWidthStart:B.lineWidthStart,lineWidthEnd:B.lineWidthEnd,rainbowBranch:B.rainbowBranch,branchPaletteId:B.branchPaletteId,customPalettes:B.customPalettes,lineStyle:B.lineStyle,rootLineStyle:B.rootLineStyle,lineOrigin:B.lineOrigin,layoutMode:B.layoutMode,taperedEdge:B.taperedEdge,lineWidthTaper:B.lineWidthTaper,showOrderBadge:B.showOrderBadge,canvasBg:B.canvasBg}),setBranchPalette:r=>{if(!r)return;[...ln,...B.customPalettes].find(f=>f.id===r)&&(B.branchPaletteId=r)},getBranchPalette:()=>B.branchPaletteId,getBranchPalettes:()=>[...ln,...B.customPalettes],getSearchResults:()=>[...cn.value],getSearchIndex:()=>So.value}),e.watch(()=>i.data,r=>{m.value=Ot(r),Ee()},{deep:!1}),e.onMounted(()=>{$e(),e.nextTick(()=>sn())}),(r,l)=>{var f,M,N,O,_,z,G,j,pe;return e.openBlock(),e.createElementBlock("div",{class:"zm-mindmap",style:e.normalizeStyle({background:tn.value,fontSize:ut.value.fontSize+"px"})},[e.createElementVNode("div",{ref_key:"wrapperRef",ref:c,class:"zm-canvas",onMousedown:Mg,onContextmenu:we,onWheel:l[25]||(l[25]=(...T)=>e.unref(de).onWheel&&e.unref(de).onWheel(...T)),onMouseenter:l[26]||(l[26]=T=>w.value=!0),onMouseleave:l[27]||(l[27]=T=>w.value=!1),onClick:Ag},[e.createElementVNode("div",{class:"zm-svg-layer",style:e.normalizeStyle({left:bt.value.vbX*e.unref(de).scale.value+e.unref(de).offsetX.value+"px",top:bt.value.vbY*e.unref(de).scale.value+e.unref(de).offsetY.value+"px",width:bt.value.vbW*e.unref(de).scale.value+"px",height:bt.value.vbH*e.unref(de).scale.value+"px"})},[(e.openBlock(),e.createElementBlock("svg",{class:"zm-svg",viewBox:dg.value,preserveAspectRatio:"xMinYMin meet",width:bt.value.vbW*e.unref(de).scale.value,height:bt.value.vbH*e.unref(de).scale.value},[e.createElementVNode("g",vp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Jl.value,T=>(e.openBlock(),e.createElementBlock("path",{key:T.key,d:St(ui(T.from,"out",T.to.side,T.to),ui(T.to,"in"),L(T.from.depth),q(T.to.depth),32,b(T.from.isRoot),T.to._dir),fill:wo(T.from,T.to),stroke:"none"},null,8,Ip))),128))])],8,Bp))],4),e.unref(de).isMarquee.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-marquee",style:e.normalizeStyle({left:e.unref(de).marquee.x*e.unref(de).scale.value+e.unref(de).offsetX.value+"px",top:e.unref(de).marquee.y*e.unref(de).scale.value+e.unref(de).offsetY.value+"px",width:e.unref(de).marquee.width*e.unref(de).scale.value+"px",height:e.unref(de).marquee.height*e.unref(de).scale.value+"px"})},null,4)):e.createCommentVNode("",!0),C.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"zm-drag-ghost",style:e.normalizeStyle({left:P.value+"px",top:R.value+"px",transform:`scale(${e.unref(de).scale.value})`,transformOrigin:"top left"})},e.toDisplayString(C.value.srcText),5)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"zm-world",style:e.normalizeStyle({transform:`translate(${e.unref(de).offsetX.value}px, ${e.unref(de).offsetY.value}px) scale(${e.unref(de).scale.value})`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(to.value,T=>{var J,le;return e.openBlock(),e.createElementBlock("div",{key:T.id,class:e.normalizeClass(["zm-node",{"is-root":T.isRoot,"is-selected":g.value===T.id,"is-selected-secondary":g.value!==T.id&&d.value.has(T.id),"is-editing":s.value===T.id,"has-image":!!T.image,"is-resizing":Yi.value===T.id,"is-dragging-source":((J=C.value)==null?void 0:J.srcId)===T.id,"is-drop-target":((le=C.value)==null?void 0:le.currentTargetId)===T.id,"is-search-hit":Og(T.id),"is-search-current":Lg(T.id),"is-search-dimmed":Dg(T.id)}]),"data-node-id":T.id,style:e.normalizeStyle({left:T.x+"px",top:T.y+"px",width:T.width+"px",minWidth:T.width+"px",height:T.height+"px",fontSize:ql(T)+"px",background:Kl(T),color:Qn(T),borderColor:eo(T),fontWeight:Yl(T),transform:"translate(-50%, -50%)"}),onClick:H=>Sg(H,T),onPointerdown:H=>Cg(H,T),onDblclick:H=>{H.stopPropagation(),t.previewMode||No(T.id)},onContextmenu:H=>ee(H,T),onMouseenter:H=>{Xn(T.id),Zn(H,T)},onMouseleave:H=>kn(T.id)},[T.image?(e.openBlock(),e.createElementBlock("img",{key:0,class:"zm-node-img",src:T.image.src,width:T.image.width,height:T.image.height,alt:T.text,draggable:"false"},null,8,Op)):e.createCommentVNode("",!0),T.richContent&&(T.richContent.kind==="code"||T.richContent.kind==="table")&&s.value!==T.id?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["zm-rich zm-rich-above",{"zm-rich-no-overflow":T.richContent.kind==="table"||T.richContent.kind==="code"}]),onClick:l[1]||(l[1]=e.withModifiers(()=>{},["stop"])),onDblclick:e.withModifiers(H=>mg(T.id),["stop"]),onMousedown:l[2]||(l[2]=e.withModifiers(()=>{},["stop"]))},[A.value===T.id?e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:0,"onUpdate:modelValue":l[0]||(l[0]=H=>x.value=H),class:"zm-rich-edit",spellcheck:"false",onBlur:ta,onKeydown:gg},null,544)),[[e.vModelText,x.value]]):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[T.richContent.kind==="code"?(e.openBlock(),e.createElementBlock("pre",Dp,[e.createElementVNode("code",{innerHTML:e.unref(Ci)(e.unref(Go)(T.richContent.raw),e.unref(wn)(T.richContent.raw))},null,8,$p)])):T.richContent.kind==="table"?(e.openBlock(),e.createElementBlock("table",Vp,[e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(bg(T.id,e.unref(Mi)(T.richContent.raw)),(H,xe)=>(e.openBlock(),e.createElementBlock("tr",{key:xe},[xe===0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(H,(Be,be)=>{var Q,ve,ot,Fe,Rt;return e.openBlock(),e.createElementBlock("th",{key:`h${be}`,class:e.normalizeClass(["zm-rich-table-sort",{"is-sorted":((Q=k.value.get(T.id))==null?void 0:Q.col)===be,"is-asc":((ve=k.value.get(T.id))==null?void 0:ve.col)===be&&((ot=k.value.get(T.id))==null?void 0:ot.dir)==="asc","is-desc":((Fe=k.value.get(T.id))==null?void 0:Fe.col)===be&&((Rt=k.value.get(T.id))==null?void 0:Rt.dir)==="desc"}]),onClick:e.withModifiers(oe=>hg(T.id,be),["stop"])},[e.createElementVNode("span",null,e.toDisplayString(Be),1),e.createElementVNode("span",Fp,e.toDisplayString(kg(T.id,be)),1)],10,Pp)}),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(H,(Be,be)=>(e.openBlock(),e.createElementBlock("td",{key:`c${be}`},e.toDisplayString(Be),1))),128))]))),128))])])):e.createCommentVNode("",!0)],64))],42,Lp)):e.createCommentVNode("",!0),s.value!==T.id?(e.openBlock(),e.createElementBlock("span",Up,[T.markers&&T.markers.length>0?(e.openBlock(),e.createElementBlock("span",Hp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.markers,H=>(e.openBlock(),e.createElementBlock("span",{key:H,class:"zm-node-marker",title:e.unref(wr)(H),innerHTML:'<svg viewBox="0 0 24 24" width="14" height="14">'+e.unref(zo)(H)+"</svg>"},null,8,Wp))),128))])):e.createCommentVNode("",!0),e.createElementVNode("span",Gp,e.toDisplayString(T.text),1),T.link&&s.value!==T.id?(e.openBlock(),e.createElementBlock("a",{key:1,class:"zm-node-link",href:T.link.url,target:"_blank",rel:"noopener noreferrer",title:`打开链接:${T.link.url}`,onClick:l[3]||(l[3]=e.withModifiers(()=>{},["stop"])),onMousedown:l[4]||(l[4]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(Te,{name:"link",size:11,stroke:2})],40,jp)):e.createCommentVNode("",!0),T.note&&s.value!==T.id?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-node-note-btn",type:"button",title:li(T.note.text),onClick:e.withModifiers(H=>ri(T.id),["stop"]),onMousedown:l[5]||(l[5]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(Te,{name:"note",size:11,stroke:2})],40,Kp)):e.createCommentVNode("",!0)])):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:3,class:"zm-input","onUpdate:modelValue":l[6]||(l[6]=H=>u.value=H),autofocus:"",rows:"1",onBlur:l[7]||(l[7]=H=>qi()),onKeydown:[l[8]||(l[8]=e.withKeys(e.withModifiers(H=>qi(),["exact","prevent"]),["enter"])),l[9]||(l[9]=e.withKeys(e.withModifiers(H=>qi(),["prevent"]),["tab"])),e.withKeys(ug,["esc"]),yg],onInput:fg,onMousedown:l[10]||(l[10]=e.withModifiers(()=>{},["stop"])),onClick:l[11]||(l[11]=e.withModifiers(()=>{},["stop"]))},null,544)),[[e.vModelText,u.value]]),T.tags&&T.tags.length>0&&s.value!==T.id?(e.openBlock(),e.createElementBlock("div",Yp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.tags,H=>(e.openBlock(),e.createElementBlock("span",{key:H,class:"zm-node-tag",style:e.normalizeStyle(e.unref(hi)(H))},e.toDisplayString(H),5))),128))])):e.createCommentVNode("",!0),ne.value?(e.openBlock(),e.createElementBlock("span",{key:5,class:"zm-order-badge",title:`数据顺序:第 ${ha(T.id)+1} 个`},e.toDisplayString(ha(T.id)+1),9,qp)):e.createCommentVNode("",!0),ga(T.id)&&Qi(T.id)>0?(e.openBlock(),e.createElementBlock("span",{key:6,class:e.normalizeClass(["zm-collapse-badge",{"is-on-left":T.side===-1}]),style:e.normalizeStyle({background:nn.value.get(T.id)??"#64748b"}),title:`展开 ${Qi(T.id)} 个子节点`,onMousedown:l[12]||(l[12]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(H=>da(T.id),["stop"])},e.toDisplayString(Qi(T.id)),47,Xp)):e.createCommentVNode("",!0),Rg(T)&&!ga(T.id)?(e.openBlock(),e.createElementBlock("button",{key:7,class:e.normalizeClass(["zm-btn zm-collapse",{"is-on-left":T.side===-1}]),style:e.normalizeStyle({color:nn.value.get(T.id)??"#64748b",borderColor:nn.value.get(T.id)??"#64748b"}),title:"折叠",onMousedown:l[13]||(l[13]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(H=>da(T.id),["stop"])},[e.createVNode(Te,{name:"minus",size:10,stroke:2.4})],46,Zp)):e.createCommentVNode("",!0),T.image&&g.value===T.id&&s.value!==T.id?(e.openBlock(),e.createElementBlock("span",{key:8,class:"zm-img-resize-handle",title:"拖动调整图片大小",onMousedown:e.withModifiers(H=>At(H,T),["stop"])},null,40,Jp)):e.createCommentVNode("",!0),T.image&&g.value===T.id&&s.value!==T.id?(e.openBlock(),e.createElementBlock("button",{key:9,class:"zm-img-remove-btn",title:"移除图片",onMousedown:l[14]||(l[14]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(H=>me(T.id),["stop"])},[e.createVNode(Te,{name:"x",size:9,stroke:2.2})],40,Qp)):e.createCommentVNode("",!0)],46,zp)}),128))],4),I.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["zm-tooltip",{"is-below":!I.value.above}]),style:e.normalizeStyle({left:I.value.x+"px",top:I.value.y+"px"})},e.toDisplayString(I.value.text),7)):e.createCommentVNode("",!0),y.value?(e.openBlock(),e.createBlock(gs,{key:3,x:y.value.x,y:y.value.y,container:c.value,"has-image":!!((f=e.unref(ue)(m.value,y.value.nodeId))!=null&&f.image),"has-link":!!((M=e.unref(ue)(m.value,y.value.nodeId))!=null&&M.link),"has-note":!!((N=e.unref(ue)(m.value,y.value.nodeId))!=null&&N.note),"has-code":((_=(O=e.unref(ue)(m.value,y.value.nodeId))==null?void 0:O.richContent)==null?void 0:_.kind)==="code","has-table":((G=(z=e.unref(ue)(m.value,y.value.nodeId))==null?void 0:z.richContent)==null?void 0:G.kind)==="table","node-markers":((j=e.unref(ue)(m.value,y.value.nodeId))==null?void 0:j.markers)??[],"node-tags":((pe=e.unref(ue)(m.value,y.value.nodeId))==null?void 0:pe.tags)??[],onPickImage:ho,onRemoveImage:_n,onSetLink:Gi,onRemoveLink:bo,onEditNote:ko,onRemoveNote:ji,onAddCode:ii,onEditCode:ii,onRemoveCode:Ki,onAddTable:We,onEditTable:We,onRemoveTable:hn,onToggleMarker:Hg,onClearMarkers:Wg,onAddTag:jg,onRemoveTags:Kg,onClose:ge},null,8,["x","y","container","has-image","has-link","has-note","has-code","has-table","node-markers","node-tags"])):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createBlock(hs,{key:4,x:p.value.x,y:p.value.y,container:c.value,onOpenSettings:je,onOpenData:rt,onOpenImport:nt,onExportPng:xa,onExportSvg:To,onClose:tt},null,8,["x","y","container"])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(D.value),title:i.previewMode?"退出预览模式":"进入预览模式",onClick:l[15]||(l[15]=T=>a("canvas-toggle-preview"))},[e.createVNode(Te,{name:i.previewMode?"eye-off":"eye",size:16},null,8,["name"])],10,eg),e.createElementVNode("button",{class:e.normalizeClass(V.value),title:"显示大纲视图",onClick:go},[e.createVNode(Te,{name:"outline",size:16})],2),e.createElementVNode("div",{class:e.normalizeClass(["zm-toolbar",{"is-preview-only":i.previewMode,"is-hovered":w.value}])},[e.createElementVNode("span",tg,e.toDisplayString(Math.round(e.unref(de).scale.value*100))+"%",1),e.createElementVNode("button",{class:"zm-tb-btn",title:"放大",onClick:l[16]||(l[16]=(...T)=>e.unref(de).zoomIn&&e.unref(de).zoomIn(...T))},[e.createVNode(Te,{name:"zoom-in"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"缩小",onClick:l[17]||(l[17]=(...T)=>e.unref(de).zoomOut&&e.unref(de).zoomOut(...T))},[e.createVNode(Te,{name:"zoom-out"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"重置视图",onClick:sn},[e.createVNode(Te,{name:"reset"})]),l[37]||(l[37]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"全部收起",onClick:wg},[e.createVNode(Te,{name:"collapse-all"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"展开一级",onClick:l[18]||(l[18]=T=>fa(1))},[e.createVNode(Te,{name:"expand-level-1"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"展开二级",onClick:l[19]||(l[19]=T=>fa(2))},[e.createVNode(Te,{name:"expand-level-2"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"全部展开",onClick:Ng},[e.createVNode(Te,{name:"expand-all"})]),i.previewMode?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[l[35]||(l[35]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"添加子节点 (Tab)",onClick:l[20]||(l[20]=T=>g.value&&no(g.value))},[e.createElementVNode("img",{src:e.unref(lr),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,ng)]),e.createElementVNode("button",{class:"zm-tb-btn",title:"添加同级 (Enter)",onClick:l[21]||(l[21]=T=>g.value&&si(g.value))},[e.createElementVNode("img",{src:e.unref(rr),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,og)]),l[36]||(l[36]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:B.layoutMode==="mindmap"}]),title:"思维导图布局 (中心辐射)",onClick:l[22]||(l[22]=T=>er("mindmap"))},[e.createVNode(Te,{name:"mindmap"})],2),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:B.layoutMode==="tree"}]),title:"树形布局 (向右展开)",onClick:l[23]||(l[23]=T=>er("tree"))},[e.createVNode(Te,{name:"tree"})],2),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:B.layoutMode==="org"}]),title:"组织结构布局 (向下展开)",onClick:l[24]||(l[24]=T=>er("org"))},[e.createVNode(Te,{name:"org"})],2)],64))],2)],544),i.builtInDrawers?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(Lt,{side:"left",scope:"canvas",width:300,open:an.value&&!t.previewMode,title:"大纲","onUpdate:open":l[28]||(l[28]=T=>an.value=T)},{default:e.withCtx(()=>[e.createVNode(Oo,{data:m.value,"selected-id":g.value,"collapsed-ids":lt.value,onSelect:po,onToggleCollapse:gn,onEdit:oi,onAddChild:jn,onAddSibling:Kn,onMove:Pt},null,8,["data","selected-id","collapsed-ids"])]),_:1},8,["open"]),e.createVNode(Lt,{side:"right",scope:"canvas",width:360,open:$t.value&&!t.previewMode,title:"数据","onUpdate:open":l[30]||(l[30]=T=>$t.value=T)},{default:e.withCtx(()=>[e.createVNode(Lo,{data:m.value,"pending-mode":Vt.value,onImport:l[29]||(l[29]=T=>m.value=T),onConsumedMode:He},null,8,["data","pending-mode"])]),_:1},8,["open"]),e.createVNode(Lt,{side:"right",scope:"canvas",width:420,open:ae.value&&!t.previewMode,title:"Markdown","onUpdate:open":l[32]||(l[32]=T=>ae.value=T)},{default:e.withCtx(()=>[e.createVNode(Do,{data:m.value,onImport:l[31]||(l[31]=T=>m.value=T)},null,8,["data"])]),_:1},8,["open"]),e.createVNode(Lt,{side:"right",scope:"canvas",width:360,open:gt.value&&!t.previewMode,title:"节点内容","onUpdate:open":l[33]||(l[33]=T=>gt.value=T)},{default:e.withCtx(()=>[e.createVNode(Jo,{"selected-node":Nt.value,"focus-tick":_e.value,onApply:at,onRemove:Mt,onSetLink:An,onSetImage:ti,onSetRich:ni},null,8,["selected-node","focus-tick"])]),_:1},8,["open"]),e.createVNode(Lt,{side:"right",scope:"canvas",width:340,open:ze.value&&!t.previewMode,title:"设置","onUpdate:open":l[34]||(l[34]=T=>ze.value=T)},{default:e.withCtx(()=>{var T;return[e.createVNode($o,{settings:B,"has-selection":g.value!==null,"selected-node-text":(T=Nt.value)==null?void 0:T.text,"node-style":Y.value,"onUpdate:settings":te,"onUpdate:nodeStyle":he,onReset:Se},null,8,["settings","has-selection","selected-node-text","node-style"])]}),_:1},8,["open"])],64)):e.createCommentVNode("",!0)],4)}}}),ig={class:"zm-app"},rg={class:"zm-app-main"},lg={class:"zm-app-canvas"},jl=e.defineComponent({__name:"App",setup(t){const o={id:"r_root",text:"flow-mindmap 节点能力一览",link:{url:"https://github.com/xz333221/flow-mindmap"},note:{text:`本导图用于演示节点的全部可渲染字段。
|
|
136
140
|
所有代码块 / 表格在节点标题上方显示,不会撑大节点框。`},children:[{id:"r_image",text:"嵌入图片",image:{src:"data:image/svg+xml;utf8,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 40" width="80" height="40"><rect width="80" height="40" rx="6" fill="#6366f1"/><text x="40" y="24" text-anchor="middle" fill="#fff" font-family="sans-serif" font-size="12" font-weight="600">LOGO</text></svg>'),naturalW:80,naturalH:40,width:80,height:40},children:[{id:"r_image_a",text:"节点上方的图标 / logo",children:[]},{id:"r_image_b",text:"remote URL 或 data: URL",children:[]},{id:"r_image_c",text:"可拖拽改尺寸",children:[]}]},{id:"r_code",text:"代码块",richContent:{kind:"code",lang:"ts",raw:'```ts\nimport { MindMap } from "flow-mindmap"\nconst tree = MindMap.parse(md)\n```'},note:{text:`代码块以 richContent 形式携带,
|
|
137
141
|
渲染在节点标题上方,自动支持语言 tag。`},link:{url:"https://flow-mindmap.example/docs/api"},children:[{id:"r_code_a",text:"等宽字体,自动换行",richContent:{kind:"code",lang:"js",raw:"```js\nconst sum = (a, b) => a + b\nconsole.log(sum(1, 2)) // 3\n```"},children:[]},{id:"r_code_b",text:"保留原始 ```lang 标签",richContent:{kind:"code",lang:"bash",raw:"```bash\nnpm install flow-mindmap\nnpm run dev\n```"},children:[]},{id:"r_code_c",text:"max-height 截断,框内可滚",richContent:{kind:"code",lang:"ts",raw:`\`\`\`ts
|
|
138
142
|
interface Node {
|
|
@@ -163,4 +167,4 @@ function walk(n: Node) {
|
|
|
163
167
|
| --- | --- | --- | --- | --- |
|
|
164
168
|
| 1 | 2 | 3 | 4 | 5 |
|
|
165
169
|
| 6 | 7 | 8 | 9 | 10 |`},children:[]}]},{id:"r_note",text:"笔记 (note)",note:{text:`节点右上角的便签图标。
|
|
166
|
-
鼠标悬浮预览前 60 字,点击打开完整笔记编辑器。`},children:[{id:"r_note_a",text:"悬浮预览",children:[]},{id:"r_note_b",text:"点击展开编辑",children:[]},{id:"r_note_c",text:"export → ```note 围栏",children:[]}]},{id:"r_link",text:"链接 (link)",link:{url:"https://github.com/xz333221/flow-mindmap"},children:[{id:"r_link_a",text:"节点右侧的小图标",children:[]},{id:"r_link_b",text:"点击在新 tab 打开",children:[]},{id:"r_link_c",text:"export → [label](url)",children:[]}]},{id:"r_para",text:"段落 / 列表 (子节点)",children:[{id:"r_para_a",text:"段落不再是父节点框内文字",children:[]},{id:"r_para_b",text:"列表每项一个子节点",children:[]},{id:"r_para_c",text:"节点框大小保持一致,边线对齐",children:[]}]}]};function n(){return typeof location<"u"&&location.hash==="#fan"?i:typeof location<"u"&&location.hash==="#stress"?a:(typeof location<"u"&&location.hash==="#rich",o)}const i={id:"root",text:"flow-mindmap 思维导图",children:[{id:"n_a",text:"主题一",children:[]},{id:"n_b",text:"主题二",children:[]},{id:"n_c",text:"主题三",children:[]},{id:"n_d",text:"主题四",children:[]},{id:"n_e",text:"主题五",children:[]},{id:"n_f",text:"主题六",children:[]},{id:"n_g",text:"主题七",children:[]},{id:"n_h",text:"主题八",children:[]},{id:"n_i",text:"主题九",children:[]}]},a=(()=>{const
|
|
170
|
+
鼠标悬浮预览前 60 字,点击打开完整笔记编辑器。`},children:[{id:"r_note_a",text:"悬浮预览",children:[]},{id:"r_note_b",text:"点击展开编辑",children:[]},{id:"r_note_c",text:"export → ```note 围栏",children:[]}]},{id:"r_link",text:"链接 (link)",link:{url:"https://github.com/xz333221/flow-mindmap"},children:[{id:"r_link_a",text:"节点右侧的小图标",children:[]},{id:"r_link_b",text:"点击在新 tab 打开",children:[]},{id:"r_link_c",text:"export → [label](url)",children:[]}]},{id:"r_para",text:"段落 / 列表 (子节点)",children:[{id:"r_para_a",text:"段落不再是父节点框内文字",children:[]},{id:"r_para_b",text:"列表每项一个子节点",children:[]},{id:"r_para_c",text:"节点框大小保持一致,边线对齐",children:[]}]}]};function n(){return typeof location<"u"&&location.hash==="#fan"?i:typeof location<"u"&&location.hash==="#stress"?a:(typeof location<"u"&&location.hash==="#rich",o)}const i={id:"root",text:"flow-mindmap 思维导图",children:[{id:"n_a",text:"主题一",children:[]},{id:"n_b",text:"主题二",children:[]},{id:"n_c",text:"主题三",children:[]},{id:"n_d",text:"主题四",children:[]},{id:"n_e",text:"主题五",children:[]},{id:"n_f",text:"主题六",children:[]},{id:"n_g",text:"主题七",children:[]},{id:"n_h",text:"主题八",children:[]},{id:"n_i",text:"主题九",children:[]}]},a=(()=>{const y=(V,ee)=>({id:V,text:ee,children:[]}),p=[y("s_l1","左一"),y("s_l2","左二"),y("s_l3","左三"),y("s_l4","左四"),y("s_l5","左五"),y("s_l6","左六"),y("s_l7","左七")],D=[y("s_r1","右一"),y("s_r2","右二"),y("s_r3","右三"),y("s_r4","右四"),y("s_r5","右五"),y("s_r6","右六"),y("s_r7","右七")];return{id:"root",text:"flow-mindmap 思维导图",children:[...p,...D]}})(),c=e.ref(o),s=e.ref(null),u=e.ref(new Set),d=e.ref(!1),g=e.ref(!1),h=e.ref(!1),w=e.ref(!1),C=e.ref(0),P=e.ref(!1),R=e.ref(!1),U=e.ref(null);function I(){c.value=n()}function A(){g.value=!0,h.value=!1,w.value=!1}function x(y){A()}const k=e.reactive({autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:3.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"rounded-elbow",rootLineStyle:"arc",lineOrigin:"proportional",layoutMode:"mindmap",taperedEdge:!0,lineWidthTaper:.67,showOrderBadge:!1,canvasBg:void 0}),m=e.computed(()=>{var y;return s.value?((y=U.value)==null?void 0:y.getNodeStyle(s.value.id))??{}:{}});function F(y){var p;Object.assign(k,y),(p=U.value)==null||p.applySettings(y)}function W(y){var p;s.value&&((p=U.value)==null||p.applyNodeStyle(s.value.id,y))}function K(){var p;const y={autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"rounded-elbow",rootLineStyle:"arc",lineOrigin:"proportional",layoutMode:"mindmap",taperedEdge:!0,lineWidthTaper:.67,showOrderBadge:!1,canvasBg:void 0};Object.assign(k,y),(p=U.value)==null||p.applySettings(y)}function S(y){if(y.key==="Escape"){if(P.value){P.value=!1,y.stopPropagation();return}R.value&&(R.value=!1,y.stopPropagation())}}e.onMounted(()=>{var y;document.addEventListener("keydown",S),window.addEventListener("hashchange",I),(y=U.value)==null||y.applySettings({rainbowBranch:k.rainbowBranch,branchPaletteId:k.branchPaletteId,customPalettes:k.customPalettes,lineWidthStart:k.lineWidthStart,lineWidthEnd:k.lineWidthEnd,lineStyle:k.lineStyle,rootLineStyle:k.rootLineStyle,lineOrigin:k.lineOrigin})}),e.onBeforeUnmount(()=>{document.removeEventListener("keydown",S),window.removeEventListener("hashchange",I)});function ne(y){c.value=y}function se(y){var D;const p=y&&y.length>0?y[0]:null;s.value=p,p?!w.value&&((D=U.value)!=null&&D.nodeHasContent(p.id))&&(g.value=!1,h.value=!1,w.value=!0):w.value=!1}e.watch(c,y=>{if(!s.value)return;const p=Z(y,s.value.id);p?p!==s.value&&(s.value=p):s.value=null},{deep:!1});function re(y){if(!s.value||s.value.id!==y){const p=Z(c.value,y);p&&(s.value=p)}g.value=!1,h.value=!1,w.value=!0,C.value++}function Z(y,p){if(y.id===p)return y;for(const D of y.children){const V=Z(D,p);if(V)return V}return null}function ce(y){var p;s.value&&((p=U.value)==null||p.applyNodeNote(s.value.id,y))}function ie(){var y;s.value&&((y=U.value)==null||y.removeNodeNote(s.value.id))}function me(y){var p;s.value&&((p=U.value)==null||p.applyNodeLink(s.value.id,y))}function v(y){var p;s.value&&((p=U.value)==null||p.applyNodeImageByUrl(s.value.id,y))}function E(y){var p;s.value&&((p=U.value)==null||p.applyNodeRichContent(s.value.id,y))}function $(y){const p=document.querySelector(`[data-node-id="${y.id}"]`);p&&p.click()}function X(y){const p=new Set(u.value);p.has(y)?p.delete(y):p.add(y),u.value=p}function fe(y){var p;(p=U.value)==null||p.setNodeText(y.id,y.text)}function Ae(y){var p;(p=U.value)==null||p.addChild(y)}function De(y){var p;(p=U.value)==null||p.addSibling(y)}function Pe(y){var p;(p=U.value)==null||p.moveNode(y.srcId,y.targetId,y.position)}const Me=e.computed(()=>{var y;return((y=s.value)==null?void 0:y.id)??null});return(y,p)=>(e.openBlock(),e.createElementBlock("div",ig,[e.createVNode(Lt,{side:"left",width:300,open:d.value,title:"大纲","onUpdate:open":p[0]||(p[0]=D=>d.value=D)},{default:e.withCtx(()=>[e.createVNode(Oo,{data:c.value,"selected-id":Me.value,"collapsed-ids":u.value,onSelect:$,onToggleCollapse:X,onEdit:fe,onAddChild:Ae,onAddSibling:De,onMove:Pe},null,8,["data","selected-id","collapsed-ids"])]),_:1},8,["open"]),e.createElementVNode("main",rg,[R.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-app-preview-exit",title:"退出预览 (Esc)",onClick:p[1]||(p[1]=D=>R.value=!1)},[...p[11]||(p[11]=[e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),e.createElementVNode("line",{x1:"2",y1:"2",x2:"22",y2:"22"})],-1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",lg,[e.createVNode(Qo,{ref_key:"mindMapRef",ref:U,data:c.value,"preview-mode":R.value,"built-in-drawers":!1,onChange:ne,onSelect:se,onEditNote:re,onCanvasSettings:p[2]||(p[2]=D=>P.value=!0),onCanvasData:A,onCanvasImport:x,onCanvasTogglePreview:p[3]||(p[3]=D=>R.value=!R.value),onCanvasOutline:p[4]||(p[4]=D=>d.value=!0)},null,8,["data","preview-mode"])])]),e.createVNode(Lt,{side:"right",width:360,open:g.value&&!R.value,title:"数据","onUpdate:open":p[6]||(p[6]=D=>g.value=D)},{default:e.withCtx(()=>[e.createVNode(Lo,{data:c.value,onImport:p[5]||(p[5]=D=>c.value=D)},null,8,["data"])]),_:1},8,["open"]),e.createVNode(Lt,{side:"right",width:420,open:h.value&&!R.value,title:"Markdown","onUpdate:open":p[8]||(p[8]=D=>h.value=D)},{default:e.withCtx(()=>[e.createVNode(Do,{data:c.value,onImport:p[7]||(p[7]=D=>c.value=D)},null,8,["data"])]),_:1},8,["open"]),e.createVNode(Lt,{side:"right",width:360,open:w.value&&!R.value,title:"节点内容","onUpdate:open":p[9]||(p[9]=D=>w.value=D)},{default:e.withCtx(()=>[e.createVNode(Jo,{"selected-node":s.value,readonly:!1,"focus-tick":C.value,onApply:ce,onRemove:ie,onSetLink:me,onSetImage:v,onSetRich:E},null,8,["selected-node","focus-tick"])]),_:1},8,["open"]),e.createVNode(Lt,{side:"right",width:340,open:P.value&&!R.value,title:"设置","onUpdate:open":p[10]||(p[10]=D=>P.value=D)},{default:e.withCtx(()=>{var D;return[e.createVNode($o,{settings:k,"has-selection":s.value!==null,"selected-node-text":(D=s.value)==null?void 0:D.text,"node-style":m.value,"onUpdate:settings":F,"onUpdate:nodeStyle":W,onReset:K},null,8,["settings","has-selection","selected-node-text","node-style"])]}),_:1},8,["open"])]))}}),ag="0.5.5",sg={install(t){t.component("FlowMindMap",Qo),t.component("FlowMindMapOutline",Oo),t.component("FlowMindMapDrawer",Lt),t.component("FlowMindMapDataPanel",Lo),t.component("FlowMindMapMarkdownPanel",Do),t.component("FlowMindMapSettingsPanel",$o),t.component("FlowMindMapNotePanel",Jo),t.component("FlowMindMapApp",jl)}};Ne.DataPanel=Lo,Ne.Drawer=Lt,Ne.MARKER_LIB=gi,Ne.MarkdownPanel=Do,Ne.MindMap=Qo,Ne.MindMapApp=jl,Ne.NotePanel=Jo,Ne.Outline=Oo,Ne.SettingsPanel=$o,Ne.VERSION=ag,Ne.addChild=kr,Ne.addSibling=yr,Ne.clone=Ot,Ne.default=sg,Ne.findNode=ue,Ne.findParent=Gt,Ne.markdownToMindMap=zn,Ne.markdownToRichMindMap=Qa,Ne.markerDef=ds,Ne.markerLabel=wr,Ne.markerSvg=zo,Ne.mindMapToMarkdown=On,Ne.removeNode=Ro,Ne.richBlockToMarkdown=es,Ne.tagColor=hi,Ne.uid=Xt,Object.defineProperties(Ne,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|