zen-gitsync 2.15.10 → 2.15.12

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.
Files changed (77) hide show
  1. package/package.json +4 -3
  2. package/src/gitCommit.js +475 -475
  3. package/src/ui/public/assets/AppVersionBadge-BaXEI9Aq.js +2 -0
  4. package/src/ui/public/assets/BranchSelector-DJhEF0y9.js +1 -0
  5. package/src/ui/public/assets/CommitForm-BfpcK-bz.js +6 -0
  6. package/src/ui/public/assets/ConsoleView-D838O0O6.js +17 -0
  7. package/src/ui/public/assets/CustomCommandManager-BcCK46df.js +1 -0
  8. package/src/ui/public/assets/EditorView-DnnqYNGF.js +0 -0
  9. package/src/ui/public/assets/{FlowExecutionViewer-Dvv2-pUp.js → FlowExecutionViewer-CSlMmcDS.js} +1 -1
  10. package/src/ui/public/assets/FlowOrchestrationWorkspace-UgHpZ3FR.js +21 -0
  11. package/src/ui/public/assets/LogList-uUgskwwp.js +7 -0
  12. package/src/ui/public/assets/MindmapView-CCmFMiHR.js +1 -0
  13. package/src/ui/public/assets/{MindmapView-Bt2VdyoX.css → MindmapView-KFcJx-i-.css} +1 -1
  14. package/src/ui/public/assets/MonitorView-BxoqeX70.js +1 -0
  15. package/src/ui/public/assets/ProjectStartupButton-C3AwivIB.js +1 -0
  16. package/src/ui/public/assets/{RemoteRepoCard-BbKpAzPj.js → RemoteRepoCard-BbxeVpje.js} +1 -1
  17. package/src/ui/public/assets/SourceMapView-DKv-Y6t_.js +3 -0
  18. package/src/ui/public/assets/{SvgIcon-BoP8CWdO.js → SvgIcon-sMM8XFgm.js} +1 -1
  19. package/src/ui/public/assets/TemplateManager-Dzj8rXVw.js +1 -0
  20. package/src/ui/public/assets/UserInputNode-BU7Trzq-.js +1 -0
  21. package/src/ui/public/assets/WorkbenchView-DMoulJCG.css +1 -0
  22. package/src/ui/public/assets/WorkbenchView-DTgRoOkv.js +12 -0
  23. package/src/ui/public/assets/{_plugin-vue_export-helper-D9aIxbUC.js → _plugin-vue_export-helper-8ryIYVvs.js} +1 -1
  24. package/src/ui/public/assets/{configStore-CiAM1jWr.js → configStore-D77uNk8X.js} +1 -1
  25. package/src/ui/public/assets/element-plus-D8SQiesr.js +17 -0
  26. package/src/ui/public/assets/element-plus-DB_sOyH_.css +1 -0
  27. package/src/ui/public/assets/flow-mindmap-BLa-kSA7.js +90 -0
  28. package/src/ui/public/assets/flow-mindmap-C_aN-n3H.css +1 -0
  29. package/src/ui/public/assets/index-CpFreGqX.js +23 -0
  30. package/src/ui/public/assets/index-CytKCnOp.css +1 -0
  31. package/src/ui/public/assets/{socket-io-z4n873W1.js → socket-io-B1foIbJS.js} +1 -1
  32. package/src/ui/public/assets/{vendor-SOsdHF7M.js → vendor-B9orL8iU.js} +37 -37
  33. package/src/ui/public/assets/vendor-Dm_yd-By.css +1 -0
  34. package/src/ui/public/assets/{vue-flow-D5lw7RxP.js → vue-flow-BY7LODit.js} +1 -1
  35. package/src/ui/public/favicon.svg +75 -75
  36. package/src/ui/public/index.html +28 -28
  37. package/src/ui/public/logo.svg +74 -74
  38. package/src/ui/server/middleware/requestLogger.js +53 -53
  39. package/src/ui/server/routes/branchStatus.js +105 -105
  40. package/src/ui/server/routes/fileOpen.js +309 -309
  41. package/src/ui/server/routes/fs.js +791 -791
  42. package/src/ui/server/routes/git/diff.js +426 -426
  43. package/src/ui/server/routes/git/diffUtils.js +149 -149
  44. package/src/ui/server/routes/git/stash.js +550 -550
  45. package/src/ui/server/routes/git/tags.js +176 -176
  46. package/src/ui/server/routes/git.js +181 -181
  47. package/src/ui/server/routes/gitOps.js +1211 -1211
  48. package/src/ui/server/routes/process.js +86 -86
  49. package/src/ui/server/routes/status.js +67 -67
  50. package/src/ui/server/utils/createSavePortToFile.js +48 -48
  51. package/src/ui/server/utils/instanceRegistry.js +282 -282
  52. package/src/ui/server/utils/startServerOnAvailablePort.js +116 -116
  53. package/src/utils/index.js +1168 -1168
  54. package/src/ui/public/assets/AppVersionBadge-ZginY_T5.js +0 -2
  55. package/src/ui/public/assets/BranchSelector-BD8y_UMH.js +0 -1
  56. package/src/ui/public/assets/CommitForm-B1DJxyib.js +0 -6
  57. package/src/ui/public/assets/ConsoleView-EJa9vjMa.js +0 -17
  58. package/src/ui/public/assets/CustomCommandManager-BRxKf9jl.js +0 -1
  59. package/src/ui/public/assets/EditorView-DR2O8qKP.js +0 -0
  60. package/src/ui/public/assets/FlowOrchestrationWorkspace-DzSgBTmq.js +0 -21
  61. package/src/ui/public/assets/LogList-BEnd3kcT.js +0 -7
  62. package/src/ui/public/assets/MindmapView-Ds2Qd2ZL.js +0 -1
  63. package/src/ui/public/assets/MonitorView-B9t-8uJB.js +0 -1
  64. package/src/ui/public/assets/ProjectStartupButton-CHh6z5Pn.js +0 -1
  65. package/src/ui/public/assets/SourceMapView-Deai1zNG.js +0 -3
  66. package/src/ui/public/assets/TemplateManager-Eu4YhYCk.js +0 -1
  67. package/src/ui/public/assets/UserInputNode-C0GJHtef.js +0 -1
  68. package/src/ui/public/assets/WorkbenchView-C2xSxJfg.css +0 -1
  69. package/src/ui/public/assets/WorkbenchView-DUS0hiHf.js +0 -12
  70. package/src/ui/public/assets/element-plus-DB-NeCl9.js +0 -24
  71. package/src/ui/public/assets/element-plus-R1nMzM9j.css +0 -1
  72. package/src/ui/public/assets/flow-mindmap-CI2OSS19.css +0 -1
  73. package/src/ui/public/assets/flow-mindmap-DrcjupFb.js +0 -90
  74. package/src/ui/public/assets/index-Dleiy2zi.js +0 -23
  75. package/src/ui/public/assets/index-DltbTqIJ.css +0 -1
  76. package/src/ui/public/assets/vendor-CT8e9rs3.css +0 -1
  77. package/src/ui/server/.claude/codediff.txt +0 -8
@@ -0,0 +1,90 @@
1
+ import{Cn as e,Fn as t,Hn as n,Jn as r,Ln as i,Mn as a,Sn as o,Tn as s,Un as c,Vn as l,Xn as u,Zn as d,_n as f,_r as p,ar as m,cn as h,gn as g,gr as _,hn as v,ln as y,mn as b,mr as x,on as S,pr as C,sn as w,sr as T,tn as E,un as D,vn as O,xn as k,zn as A}from"./element-plus-D8SQiesr.js";var j=Object.defineProperty,M=(e,t,n)=>t in e?j(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,N=(e,t,n)=>M(e,typeof t==`symbol`?t:t+``,n),P=[`width`,`height`,`stroke-width`],ee={key:4,points:`6 9 12 15 18 9`},te={key:5,points:`9 6 15 12 9 18`},F=s({__name:`Icon`,props:{name:{},size:{},stroke:{}},setup(e){return(t,n)=>(A(),O(`svg`,{width:e.size??16,height:e.size??16,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":e.stroke??1.8,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[e.name===`add`?(A(),O(D,{key:0},[n[0]||=v(`circle`,{cx:`12`,cy:`12`,r:`9`},null,-1),n[1]||=v(`line`,{x1:`12`,y1:`8`,x2:`12`,y2:`16`},null,-1),n[2]||=v(`line`,{x1:`8`,y1:`12`,x2:`16`,y2:`12`},null,-1)],64)):e.name===`minus`?(A(),O(D,{key:1},[n[3]||=v(`circle`,{cx:`12`,cy:`12`,r:`9`},null,-1),n[4]||=v(`line`,{x1:`8`,y1:`12`,x2:`16`,y2:`12`},null,-1)],64)):e.name===`delete`?(A(),O(D,{key:2},[n[5]||=k(`<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)):e.name===`edit`?(A(),O(D,{key:3},[n[6]||=v(`path`,{d:`M4 20 l4 -1 11 -11 -3 -3 -11 11 z`},null,-1),n[7]||=v(`line`,{x1:`14`,y1:`6`,x2:`18`,y2:`10`},null,-1)],64)):e.name===`collapse`?(A(),O(`polyline`,ee)):e.name===`expand`?(A(),O(`polyline`,te)):e.name===`collapse-all`?(A(),O(D,{key:6},[n[8]||=k(`<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)):e.name===`expand-all`?(A(),O(D,{key:7},[n[9]||=k(`<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)):e.name===`expand-level-1`?(A(),O(D,{key:8},[n[10]||=k(`<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)):e.name===`expand-level-2`?(A(),O(D,{key:9},[n[11]||=k(`<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)):e.name===`zoom-in`?(A(),O(D,{key:10},[n[12]||=v(`circle`,{cx:`11`,cy:`11`,r:`7`},null,-1),n[13]||=v(`line`,{x1:`11`,y1:`8`,x2:`11`,y2:`14`},null,-1),n[14]||=v(`line`,{x1:`8`,y1:`11`,x2:`14`,y2:`11`},null,-1),n[15]||=v(`line`,{x1:`16`,y1:`16`,x2:`21`,y2:`21`},null,-1)],64)):e.name===`zoom-out`?(A(),O(D,{key:11},[n[16]||=v(`circle`,{cx:`11`,cy:`11`,r:`7`},null,-1),n[17]||=v(`line`,{x1:`8`,y1:`11`,x2:`14`,y2:`11`},null,-1),n[18]||=v(`line`,{x1:`16`,y1:`16`,x2:`21`,y2:`21`},null,-1)],64)):e.name===`reset`?(A(),O(D,{key:12},[n[19]||=v(`polyline`,{points:`4 9 4 4 9 4`},null,-1),n[20]||=v(`polyline`,{points:`15 4 20 4 20 9`},null,-1),n[21]||=v(`polyline`,{points:`20 15 20 20 15 20`},null,-1),n[22]||=v(`polyline`,{points:`9 20 4 20 4 15`},null,-1)],64)):e.name===`database`?(A(),O(D,{key:13},[n[23]||=v(`ellipse`,{cx:`12`,cy:`6`,rx:`7`,ry:`2.5`},null,-1),n[24]||=v(`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]||=v(`path`,{d:`M5 12 C5 13.4 8 14.5 12 14.5 C16 14.5 19 13.4 19 12`},null,-1)],64)):e.name===`settings`?(A(),O(D,{key:14},[n[26]||=v(`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]||=v(`circle`,{cx:`12`,cy:`12`,r:`3`},null,-1)],64)):e.name===`markdown`?(A(),O(D,{key:15},[n[28]||=v(`rect`,{x:`2`,y:`5`,width:`20`,height:`14`,rx:`2`},null,-1),n[29]||=v(`path`,{d:`M6 15 V9 L9 12 L12 9 V15`},null,-1),n[30]||=v(`path`,{d:`M15 15 V9 L18 12 V9 M15 12 L18 15`},null,-1)],64)):e.name===`txt`?(A(),O(D,{key:16},[n[31]||=v(`rect`,{x:`5`,y:`3`,width:`14`,height:`18`,rx:`1.5`},null,-1),n[32]||=v(`line`,{x1:`8`,y1:`8`,x2:`16`,y2:`8`},null,-1),n[33]||=v(`line`,{x1:`8`,y1:`12`,x2:`16`,y2:`12`},null,-1),n[34]||=v(`line`,{x1:`8`,y1:`16`,x2:`13`,y2:`16`},null,-1)],64)):e.name===`eye`?(A(),O(D,{key:17},[n[35]||=v(`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]||=v(`circle`,{cx:`12`,cy:`12`,r:`3.2`},null,-1)],64)):e.name===`eye-off`?(A(),O(D,{key:18},[n[37]||=v(`path`,{d:`M3 3 L21 21`},null,-1),n[38]||=v(`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]||=v(`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]||=v(`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)):e.name===`outline`?(A(),O(D,{key:19},[n[41]||=v(`rect`,{x:`4`,y:`3`,width:`16`,height:`18`,rx:`2`},null,-1),n[42]||=v(`line`,{x1:`8`,y1:`8`,x2:`16`,y2:`8`},null,-1),n[43]||=v(`line`,{x1:`8`,y1:`12`,x2:`16`,y2:`12`},null,-1),n[44]||=v(`line`,{x1:`8`,y1:`16`,x2:`13`,y2:`16`},null,-1)],64)):e.name===`logo`?(A(),O(D,{key:20},[n[45]||=k(`<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)):e.name===`import`?(A(),O(D,{key:21},[n[46]||=v(`path`,{d:`M12 4 V15`},null,-1),n[47]||=v(`polyline`,{points:`7 10 12 15 17 10`},null,-1),n[48]||=v(`path`,{d:`M4 19 H20`},null,-1)],64)):e.name===`export`?(A(),O(D,{key:22},[n[49]||=v(`path`,{d:`M12 15 V4`},null,-1),n[50]||=v(`polyline`,{points:`7 9 12 4 17 9`},null,-1),n[51]||=v(`path`,{d:`M4 19 H20`},null,-1)],64)):e.name===`balance`?(A(),O(D,{key:23},[n[52]||=k(`<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)):e.name===`mindmap`?(A(),O(D,{key:24},[n[53]||=k(`<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)):e.name===`tree`?(A(),O(D,{key:25},[n[54]||=k(`<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)):e.name===`org`?(A(),O(D,{key:26},[n[55]||=k(`<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)):e.name===`image`?(A(),O(D,{key:27},[n[56]||=v(`rect`,{x:`3`,y:`5`,width:`18`,height:`14`,rx:`2`},null,-1),n[57]||=v(`circle`,{cx:`9`,cy:`11`,r:`1.6`},null,-1),n[58]||=v(`polyline`,{points:`3 17 9 12 13 15 16 13 21 17`},null,-1)],64)):e.name===`x`?(A(),O(D,{key:28},[n[59]||=v(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`},null,-1),n[60]||=v(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`},null,-1)],64)):e.name===`link`?(A(),O(D,{key:29},[n[61]||=v(`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]||=v(`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)):e.name===`note`?(A(),O(D,{key:30},[n[63]||=v(`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]||=v(`line`,{x1:`8`,y1:`10`,x2:`16`,y2:`10`},null,-1),n[65]||=v(`line`,{x1:`8`,y1:`13`,x2:`16`,y2:`13`},null,-1),n[66]||=v(`line`,{x1:`8`,y1:`16`,x2:`13`,y2:`16`},null,-1)],64)):f(``,!0)],8,P))}}),ne=`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`,re=`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`,ie=[18,15,13,12],I=[700,600,500,400],ae=[52,40,32,28],L=[120,80,60,44],oe=[.8,.8,.8,.8],R=ie.length-1;function z(e,t){return Math.round(ce(e,t)*oe[se(e)])}function se(e){return Math.min(R,Math.max(0,e))}function ce(e,t=14){return Math.round(ie[se(e)]*t/14*10)/10}function le(e,t=14){return Math.round(ae[se(e)]*t/14)}var ue=60,de=14,fe=24,pe=null;function me(){if(pe)return pe;let e=typeof document<`u`?document.createElement(`canvas`).getContext(`2d`):null;return e?(pe=e,e):{font:``,measureText:()=>({width:0})}}var he=new Map;function ge(e,t,n){let r=`${n}|${t}|${e}`,i=he.get(r);if(i!==void 0)return i;let a=me();a.font=`${n} ${t}px "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif`;let o=a.measureText(e).width;return he.set(r,o),o}var _e=24,ve=400,ye=8,be=16,xe=4,Se=200;function Ce(e,t,n){return Math.min(n,Math.max(t,e))}function we(e,t,n,r,i){let a=se(t),o=ce(t,n),s=Math.min(ge(e.text||``,o,I[a]),Se),c=z(t,n),l=Math.ceil(s+c*2),u=e.richContent&&(e.richContent.kind===`code`||e.richContent.kind===`table`)?Math.ceil(o*1.2)+6:le(t,n),d=0;if(e.link&&(d+=be),e.note&&(d+=be),d>0){let t=+!!e.link+ +!!e.note;d+=xe*t}let f=l+d,p=(()=>{let t=Math.round(L[a]*n/14);if(e.richContent&&(e.richContent.kind===`code`||e.richContent.kind===`table`)){let n=i?.[e.id];return Math.max(t,n??240)}return t})(),m=!!(e.richContent&&(e.richContent.kind===`code`||e.richContent.kind===`table`)),h=r?.[e.id],g=m?Math.max(24,h??Math.max(70,Math.ceil(o*5))):0,_=g>0?10:0;if(!e.image)return{w:Math.max(p,f),h:Math.ceil(u+_+g)};let v=Ce(e.image.width,_e,ve);return{w:Math.max(p,f,Math.ceil(v+c*2)),h:Math.ceil(e.image.height+ye+u+_+g)}}function Te(e,t={}){let n=t.mode??`mindmap`,r=t.preservePositions===!0,i=De(e,0,null,1,`right`,t.baseFontSize??14,t.richHeights,t.richWidths);return Oe(i),Ee(i,n,r),i.x=0,i.y=0,ke(i,r)}function Ee(e,t,n=!1){if(t===`mindmap`){let t=e.children;if(t.length!==0)if(t.length===1)t[0]._dir=`right`,t[0].side=1,t[0]._dirRight=1;else{let e=t.reduce((e,t)=>e+t._subtreeH,0),n=1,r=Math.abs(t[0]._subtreeH-(e-t[0]._subtreeH)),i=0;for(let a=0;a<t.length-1;a++){i+=t[a]._subtreeH;let o=Math.abs(i-(e-i));o<r&&(r=o,n=a+1)}for(let e=0;e<n;e++)t[e]._dir=`right`,t[e].side=1,t[e]._dirRight=1;for(let e=n;e<t.length;e++)t[e]._dir=`left`,t[e].side=-1,t[e]._dirRight=-1}let r=e.children.filter(e=>e.side===1),i=e.children.filter(e=>e.side===-1),a=(e,t)=>{let n=t===`right`?1:-1;e._dir=t,e.side=n,e._dirRight=n;for(let n of e.children)a(n,t)};for(let e of r)a(e,`right`);for(let e of i)a(e,`left`);r.length>0&&B({...e,children:r},`right`,ue,!0,n),i.length>0&&B({...e,children:i},`left`,ue,!0,n)}else if(t===`tree`){let t=e=>{e.side=1,e._dir=`right`;for(let n of e.children)t(n)};for(let t of e.children)t._dir=`right`;B(e,`right`,ue,!0,n),t(e)}else{for(let t of e.children)t._dir=`down`;V(e,ue,n)}}function B(e,t,n,r,i=!1){if(e.children.length===0)return;let a=e.children.reduce((e,t,n)=>e+t._subtreeH+(n>0?de:0),0),o=t===`right`?1:-1,s=r?o:1,c=e.y-s*a/2;e.children.forEach(r=>{i||(r.x=e.x+o*(e.width/2+n+r.width/2),r.y=c+s*r._subtreeH/2),r._dir=t,c+=s*(r._subtreeH+de),B(r,t,n,!1,i)})}function V(e,t,n=!1){if(e.children.length===0)return;let r=e.children.reduce((e,t,n)=>e+t._subtreeW+(n>0?de*2:0),0),i=e.x-r/2;e.children.forEach(r=>{n||(r.x=i+r._subtreeW/2,r.y=e.y+e.height/2+t+r.height/2),r._dir=`down`,i+=r._subtreeW+de*2,V(r,t,n)})}function De(e,t,n,r,i,a,o,s){let c=we(e,t,a,o,s),l={id:e.id,text:e.text,depth:t,x:e._x??0,y:e._y??0,width:c.w,height:c.h,fontSize:ce(t,a),isRoot:t===0,collapsed:e.collapsed,side:r,_dir:i,_dirRight:r,_subtreeH:c.h,_subtreeW:c.w,image:e.image?{...e.image}:void 0,link:e.link?{url:e.link.url}:void 0,note:e.note?{text:e.note.text}:void 0,richContent:e.richContent?{kind:e.richContent.kind,raw:e.richContent.raw,lang:e.richContent.lang}:void 0,children:[],parent:n};if(e.collapsed)return l;let u=e.children.length,d=Math.ceil(u/2);return l.children=e.children.map((e,n)=>{let c=t===0?n<d?1:-1:r;return De(e,t+1,l,c,i,a,o,s)}),l}function Oe(e){let t=[e];for(let e=0;e<t.length;e++){let n=t[e];for(let e of n.children)t.push(e)}for(let e=t.length-1;e>=0;e--){let n=t[e];if(n.collapsed||n.children.length===0){n._subtreeH=n.height,n._subtreeW=n.width;continue}let r=0,i=0;for(let e of n.children)r+=e._subtreeH,i+=e._subtreeW;n.children.length>1&&(r+=de*(n.children.length-1),i+=de*2*(n.children.length-1)),n._subtreeH=Math.max(n.height,r),n._subtreeW=Math.max(n.width,i)}}function ke(e,t=!1){let n=[e],r=1/0,i=-1/0,a=1/0,o=-1/0;for(;n.length;){let e=n.pop(),t=e.width/2,s=e.height/2;e.x-t<r&&(r=e.x-t),e.x+t>i&&(i=e.x+t),e.y-s<a&&(a=e.y-s),e.y+s>o&&(o=e.y+s),n.push(...e.children)}if(t)return{root:e,width:i-r+fe*2,height:o-a+fe*2,vbX:r-fe,vbY:a-fe,vbW:i-r+fe*2,vbH:o-a+fe*2};let s=fe-a,c=[e];for(;c.length;){let e=c.pop();e.y+=s,c.push(...e.children)}return a+=s,o+=s,{root:e,width:i-r+fe*2,height:o+fe,vbX:r-fe,vbY:0,vbW:i-r+fe*2,vbH:o+fe}}var Ae=[{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 je(e,t=[]){return[...Ae,...t].find(t=>t.id===e)??Ae[0]}function Me(e,t=8){let n=[],r=new Set,i=/#[0-9a-fA-F]{3,8}\b|rgba?\([^)]+\)|[A-Za-z][A-Za-z0-9_-]{2,30}/g,a;for(;(a=i.exec(e))!==null;){let e=a[0],i=null;if(i=e.startsWith(`#`)?Ne(e):e.startsWith(`rgb`)?Pe(e):Fe[e.toLowerCase()]??null,!i)continue;let o=i.toLowerCase();if(!r.has(o)&&(r.add(o),n.push(o),n.length>=t))break}return n}function Ne(e){let t=e.startsWith(`#`)?e.slice(1):e;if(!/^[0-9a-fA-F]+$/.test(t))return null;let n;if(t.length===3)n=t.split(``).map(e=>e+e).join(``);else if(t.length===4)n=t.slice(0,3).split(``).map(e=>e+e).join(``);else if(t.length===6)n=t;else if(t.length===8)n=t.slice(0,6);else return null;return`#`+n.toLowerCase()}function Pe(e){let t=e.match(/^rgba?\(\s*([^)]+?)\s*\)$/i);if(!t)return null;let n=t[1].split(/\s*,\s*/);if(n.length<3)return null;let r=[];for(let e=0;e<3;e++){let t=n[e];if(t.endsWith(`%`)){let e=parseFloat(t);if(!isFinite(e))return null;r.push(Math.round(e/100*255))}else{let e=parseInt(t,10);if(!isFinite(e)||e<0||e>255)return null;r.push(e)}}return`#`+r.map(e=>e.toString(16).padStart(2,`0`)).join(``).toLowerCase()}var Fe={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 Ie(){return`n_`+Math.random().toString(36).slice(2,10)+Date.now().toString(36).slice(-4)}function Le(e){return JSON.parse(JSON.stringify(e))}function H(e,t){if(e.id===t)return e;for(let n of e.children){let e=H(n,t);if(e)return e}return null}function Re(e,t,n=null){if(e.id===t)return n;for(let n of e.children){let r=Re(n,t,e);if(r!==null)return r}return null}function ze(e,t){let n=e.children.findIndex(e=>e.id===t);if(n>=0)return e.children.splice(n,1),!0;for(let n of e.children)if(ze(n,t))return!0;return!1}function Be(e,t,n){let r=H(e,t);return!r||r.text===n?!1:(r.text=n,!0)}function Ve(e,t,n,r){if(!Re(e,t)||t===n||H(H(e,t),n))return!1;let i=Re(e,t),a=i.children.findIndex(e=>e.id===t);if(a<0)return!1;let[o]=i.children.splice(a,1);if(r===`child`){let t=H(e,n);return t?(t.children.push(o),!0):(i.children.splice(a,0,o),!1)}let s=Re(e,n);if(!s)return i.children.splice(a,0,o),!1;let c=s.children.findIndex(e=>e.id===n);return c<0?(i.children.splice(a,0,o),!1):(r===`after`&&(c+=1),s.children.splice(c,0,o),!0)}function U(e){let t=/^新节点(?:\s+(\d+))?$/,n=0,r=!1;for(let i of e.children){let e=i.text.match(t);if(e)if(e[1]){let t=parseInt(e[1],10);t>n&&(n=t)}else r=!0}return n===0&&!r?Je:n>0?`新节点 ${n+1}`:`新节点 2`}function He(e,t,n){let r=H(e,t);if(!r)return null;let i={id:Ie(),text:n??U(r),children:[]};return r.children.push(i),i}function Ue(e,t,n){let r=Re(e,t);if(!r)return null;let i=r.children.findIndex(e=>e.id===t);if(i<0)return null;let a={id:Ie(),text:n??U(r),children:[]};return r.children.splice(i+1,0,a),a}function We(e,t,n){let r=Re(e,t);if(!r)return null;let i=r.children.findIndex(e=>e.id===t);if(i<0)return null;let a={id:Ie(),text:n,children:[]};return r.children.splice(i,0,a),a}function Ge(e,t){let n=Re(e,t);if(!n)return null;let r=n.children.findIndex(e=>e.id===t);if(r<0)return null;let i=n.children[r],a=Le(i);return Ke(a),n.children.splice(r+1,0,a),a}function Ke(e){e.id=Ie();for(let t of e.children)Ke(t)}function qe(e,t){let n=H(e,t);if(!n||n.id===e.id)return null;let r=Le(n);return Ke(r),r}var Je=`新节点`;function Ye(e,t=`导入的导图`){let n=e.split(/\r?\n/),r={id:Ie(),text:t,children:[]},i=[r],a=[-1/0],o=[],s=/^(#{1,6})\s+(.+?)\s*#*\s*$/,c=/^!\[([^\]]*)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,l=/^\[([^\]]+)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,u=/^(`{3,}|~{3,})\s*(\S+)?\s*$/,d=!1,f=[],p=null;function m(e){f.push(e)}function h(){if(p&&f.length>0){for(;f.length>0&&f[0].trim()===``;)f.shift();for(;f.length>0&&f[f.length-1].trim()===``;)f.pop();let e=f.join(`
2
+ `);e&&(p.note={text:e})}d=!1,f=[]}for(let e of n){if(d){let t=e.match(u);if(t&&t[1][0]==="`"){h();continue}m(e);continue}let t=e.match(s);if(t){let e=t[1].length,n=t[2].trim();o.push({level:e,text:n,body:``}),p=o[o.length-1];continue}let n=e.match(u);if(n&&n[2]===`note`){d=!0,f=[];continue}let r=e.match(c);if(r&&p){let e=r[2];p.image={src:e,naturalW:160,naturalH:120,width:160,height:120};continue}let i=e.match(l);if(i&&p){p.link={url:i[2]},p.text=i[1];continue}if(e.trim().length>0&&p){let t=e.trim();p.body=p.body?p.body+`
3
+ `+t:t}}d&&h();function g(e){for(;i.length>1;){let t=a[i.length-1];if(t!==void 0&&t<e.level)break;i.pop(),a.pop()}let t=i[i.length-1],n=e.text,r={id:Ie(),text:n,children:[]};e.image&&(r.image={...e.image}),e.link&&(r.link={url:e.link.url}),e.note&&(r.note={text:e.note.text}),e.body&&(r.note={text:e.body}),t.children.push(r),i.push(r),a.push(e.level)}for(let e of o)g(e);if(o.length>0&&o[0].level===1){let e=r.children[0];e&&(r.text=e.text,r.id=e.id,e.image&&(r.image={...e.image}),e.link&&(r.link={url:e.link.url}),e.note&&(r.note={text:e.note.text}),r.children=e.children)}return r}function Xe(e,t=1){let n=`#`.repeat(t)+` `+(e.text||``)+`
4
+ `;e.link&&(n+=`[${e.text||`link`}](${e.link.url})
5
+ `),e.image&&(n+=`![image](${e.image.src})
6
+ `),e.note&&(n+="```note\n"+e.note.text+"\n```\n"),e.richContent&&(n+=e.richContent.raw+`
7
+ `);for(let r of e.children)n+=Xe(r,t+1);return n}function Ze(e){let t=e.split(/\r?\n/),n=[],r=0,i=/^(#{1,6})\s+(.+?)\s*#*\s*$/,a=/^(`{3,}|~{3,})\s*(\S+)?\s*$/,o=/^\s*\|?\s*(:?-+:?\s*\|\s*)+(:?-+:?)(\s*\|)?\s*$/,s=/^(\s*)[-*+]\s+(.*)$/,c=/^(\s*)\d+\.\s+(.*)$/;for(;r<t.length;){let e=t[r],l=e.match(a);if(l){let i=l[1][0],o=l[2]||``,s=[e];for(r++;r<t.length;){let e=t[r].match(a);if(e&&e[1][0]===i){s.push(t[r]),r++;break}s.push(t[r]),r++}let c=s.slice(1,-1).join(`
8
+ `).trim();n.push({kind:`code`,text:c.split(`
9
+ `)[0]?.slice(0,80)||`(空代码块)`,raw:s.join(`
10
+ `),lang:o});continue}let u=e.match(i);if(u){n.push({kind:`heading`,level:u[1].length,text:u[2].trim(),raw:e}),r++;continue}if(/^\s*\|/.test(e)){let e=[],i=r,a=!1;for(;i<t.length&&/^\s*\|/.test(t[i]);)e.push(t[i]),o.test(t[i])&&(a=!0),i++;if(a&&e.length>=2){n.push({kind:`table`,text:e[0].replace(/^\s*\|/,``).replace(/\|\s*$/,``).split(`|`)[0]?.trim()||`表格`,raw:e.join(`
11
+ `)}),r=i;continue}}let d=e.match(s),f=e.match(c);if(d||f){let e=r;for(;e<t.length;){let r=t[e].match(s),i=t[e].match(c);if(!(r||i))break;let a=t[e].replace(/^\s*[-*+]\s+/,``).replace(/^\s*\d+\.\s+/,``).trim();a.length>0&&n.push({kind:`list`,text:a.slice(0,80)||`(列表项)`,raw:t[e]}),e++}r=e;continue}if(e.trim()===``){r++;continue}let p=[e],m=r+1;for(;m<t.length;){let e=t[m];if(e.trim()===``||i.test(e)||a.test(e)||s.test(e)||c.test(e)||/^\s*\|/.test(e))break;p.push(e),m++}let h=p.join(` `).trim();n.push({kind:`paragraph`,text:h.slice(0,80)||`(空段落)`,raw:p.join(`
12
+ `)}),r=m}return n}function Qe(e,t=`导入的导图`){let n=Ze(e||``),r={id:Ie(),text:t,children:[]},i=[r],a=[0],o=!1;function s(e){if(e.kind===`heading`){let t=e.level;for(;i.length>1&&a[a.length-1]>=t;)i.pop(),a.pop();if(!o&&t===1){o=!0,r.text=e.text,a[0]=1;return}let n={id:Ie(),text:e.text,children:[]};i[i.length-1].children.push(n),i.push(n),a.push(t);return}let t={id:Ie(),text:e.text,children:[],richContent:{kind:e.kind,raw:e.raw,lang:e.lang}};i[i.length-1].children.push(t)}for(let e of n)s(e);return r}function $e(e){let t=e.minScale??.2,n=e.maxScale??1/0,r=e.step??1.2,i=T(1),a=T(0),o=T(0),s=T(!1),c=T(!1),l=m({x:0,y:0,ox:0,oy:0}),u=T(!1),d=m({x:0,y:0}),f=m({x:0,y:0,width:0,height:0}),p=T(0),h=null;function g(e){h=e}function _(r){r.preventDefault();let s=e.getContainer();if(!s)return;let c=-r.deltaY*.001,l=Math.min(n,Math.max(t,i.value*(1+c))),u=s.getBoundingClientRect(),d=r.clientX-u.left,f=r.clientY-u.top,p=(d-a.value)/i.value,m=(f-o.value)/i.value;i.value=l,a.value=d-p*l,o.value=f-m*l}function v(){i.value=Math.min(n,i.value*r)}function y(){i.value=Math.max(t,i.value/r)}function b(e){var t;e.target.closest(`.zm-node, .zm-toolbar, button, input, textarea`)||(s.value=!0,c.value=!1,l.x=e.clientX,l.y=e.clientY,l.ox=a.value,l.oy=o.value,window.addEventListener(`mousemove`,x),window.addEventListener(`mouseup`,S),(t=e.preventDefault)==null||t.call(e))}function x(e){if(!s.value)return;let t=e.clientX-l.x,n=e.clientY-l.y;(Math.abs(t)>3||Math.abs(n)>3)&&(c.value=!0),a.value=l.ox+t,o.value=l.oy+n}function S(){s.value=!1,window.removeEventListener(`mousemove`,x),window.removeEventListener(`mouseup`,S)}function C(e,t,n){u.value=!0,d.x=e,d.y=t,f.x=e,f.y=t,f.width=0,f.height=0,f.shiftKey=!!(n!=null&&n.shift),p.value++,window.addEventListener(`mousemove`,D),window.addEventListener(`mouseup`,E)}function w(e,t){if(!u.value)return;let n=Math.min(d.x,e),r=Math.min(d.y,t),i=Math.max(d.x,e),a=Math.max(d.y,t);f.x=n,f.y=r,f.width=i-n,f.height=a-r,p.value++}function E(){u.value=!1,window.removeEventListener(`mousemove`,D),window.removeEventListener(`mouseup`,E),h&&h()}function D(t){if(!u.value)return;let n=e.getContainer();if(!n)return;let r=n.getBoundingClientRect();w((t.clientX-r.left-a.value)/i.value,(t.clientY-r.top-o.value)/i.value)}function O(t,n,r,s=60){let c=e.getContainer();if(!c)return;let l=c.getBoundingClientRect(),u=(l.width-s*2)/t,d=(l.height-s*2)/n,f=Math.min(1,Math.max(.3,Math.min(u,d)));i.value=f,a.value=l.width/2,o.value=l.height/2-r*f}return{scale:i,offsetX:a,offsetY:o,isPanning:s,panMoved:c,onWheel:_,zoomIn:v,zoomOut:y,startPan:b,startMarquee:C,updateMarquee:w,isMarquee:u,marquee:f,marqueeVersion:p,setOnMarqueeEnd:g,resetView:O}}var et=typeof navigator<`u`&&/Mac|iPhone|iPad/.test(navigator.platform);function tt(e){return et?e.metaKey:e.ctrlKey}function nt(e){function n(){let t=e.getSelectedId();if(t)return t;if(e.defaultTargetId)return e.defaultTargetId();let n=e.getSelectedIds();return n.length>0?n[0]:null}function r(t){let r=t.target;if(r&&(r.tagName===`INPUT`||r.tagName===`TEXTAREA`||r.isContentEditable)||e.isReadonly()||e.isEditing())return;let i=e.getSelectedId(),a=n();if(a){if(tt(t)&&!t.shiftKey){if(t.key===`d`||t.key===`D`){let n=e.defaultTargetId?.call(e);i&&i!==n&&(t.preventDefault(),e.onDuplicate(i));return}if(t.key===`c`||t.key===`C`){let n=e.getSelectedIds();n.length>0&&(t.preventDefault(),e.onCopy(n));return}if(t.key===`x`||t.key===`X`){let n=e.getSelectedIds();n.length>0&&(t.preventDefault(),e.onCut(n));return}if(t.key===`v`||t.key===`V`){if(!e.hasClipboard())return;t.preventDefault();let n=e.getSelectedIds();e.onPaste(n.length>0?n[0]:null);return}if(t.key===`z`||t.key===`Z`){t.preventDefault(),e.onUndo();return}if(t.key===`y`||t.key===`Y`){t.preventDefault(),e.onRedo();return}if(t.key===`Home`){t.preventDefault(),e.onSelectRoot();return}}if(tt(t)&&t.shiftKey&&(t.key===`Z`||t.key===`z`)){t.preventDefault(),e.onRedo();return}if(t.key===`Tab`)t.preventDefault(),e.onAddChild(a);else if(t.key===`Enter`)if(t.preventDefault(),t.shiftKey){let t=e.defaultTargetId?.call(e);i&&i!==t&&e.onAddSiblingBefore(i)}else e.onAddSibling(a);else (t.key===`Delete`||t.key===`Backspace`)&&i&&i!==e.defaultTargetId?.call(e)?(t.preventDefault(),e.onRemove(i)):t.key===`F2`&&i?(t.preventDefault(),e.onStartEdit(i)):t.key===`Escape`?(t.preventDefault(),e.onClearSelection()):t.key===`ArrowDown`?(t.preventDefault(),e.onNavigate(0,1)):t.key===`ArrowUp`?(t.preventDefault(),e.onNavigate(0,-1)):t.key===`ArrowRight`?(t.preventDefault(),e.onNavigate(1,0)):t.key===`ArrowLeft`&&(t.preventDefault(),e.onNavigate(-1,0))}}i(()=>{window.addEventListener(`keydown`,r)}),t(()=>{window.removeEventListener(`keydown`,r)})}function rt(e=100){let t=T([]),n=-1;function r(){return n>0}function i(){return n<t.value.length-1}function a(r){let i=JSON.stringify(r);for(n<t.value.length-1&&(t.value=t.value.slice(0,n+1)),t.value.push(i),n=t.value.length-1;t.value.length>e;)t.value.shift(),n--}function o(){return r()?(n--,JSON.parse(t.value[n])):null}function s(){return i()?(n++,JSON.parse(t.value[n])):null}function c(){t.value=[],n=-1}return{canUndo:r,canRedo:i,record:a,undo:o,redo:s,reset:c}}var it=s({__name:`NodeContextMenu`,props:{x:{},y:{},container:{},hasImage:{type:Boolean,default:!1},hasLink:{type:Boolean,default:!1},hasNote:{type:Boolean,default:!1},hasCode:{type:Boolean,default:!1},hasTable:{type:Boolean,default:!1}},emits:[`pickImage`,`setLink`,`removeLink`,`editNote`,`removeNote`,`removeImage`,`addCode`,`editCode`,`removeCode`,`addTable`,`editTable`,`removeTable`,`close`],setup(n,{emit:r}){let i=n,a=r,o=b(()=>{let e=i.x+2,t=i.y+2;if(i.container){let n=i.container.getBoundingClientRect(),r=4+(3+ +!!i.hasImage+ +!!i.hasLink+ +!!i.hasNote+1+ +!!i.hasCode+1+ +!!i.hasTable)*28;e+180>n.right&&(e=Math.max(n.left+4,i.x-180-2)),t+r>n.bottom&&(t=Math.max(n.top+4,i.y-r-2)),e<n.left+2&&(e=n.left+2),t<n.top+2&&(t=n.top+2)}return{left:e,top:t}}),s=b(()=>i.hasImage),c=b(()=>i.hasLink),l=b(()=>i.hasNote);function u(e){let t=e.target;t&&t.closest(`.zm-node-menu`)||a(`close`)}function d(e){e.key===`Escape`&&a(`close`)}function m(){a(`close`)}window.addEventListener(`mousedown`,u,!0),window.addEventListener(`keydown`,d,!0),window.addEventListener(`wheel`,m,!0),window.addEventListener(`scroll`,m,!0),t(()=>{window.removeEventListener(`mousedown`,u,!0),window.removeEventListener(`keydown`,d,!0),window.removeEventListener(`wheel`,m,!0),window.removeEventListener(`scroll`,m,!0)});function h(e){e(),a(`close`)}return(t,r)=>(A(),O(`div`,{class:`zm-node-menu`,style:_({left:o.value.left+`px`,top:o.value.top+`px`}),onContextmenu:r[10]||=y(()=>{},[`prevent`])},[v(`button`,{class:`zm-node-menu-item`,onClick:r[0]||=y(e=>h(()=>a(`pickImage`)),[`stop`])},[e(F,{name:`image`,size:13}),v(`span`,null,p(s.value?`替换图片`:`添加图片`),1)]),s.value?(A(),O(`button`,{key:0,class:`zm-node-menu-item`,onClick:r[1]||=y(e=>h(()=>a(`removeImage`)),[`stop`])},[e(F,{name:`x`,size:13}),r[11]||=v(`span`,null,`移除图片`,-1)])):f(``,!0),v(`button`,{class:`zm-node-menu-item`,onClick:r[2]||=y(e=>h(()=>a(`setLink`)),[`stop`])},[e(F,{name:`link`,size:13}),v(`span`,null,p(c.value?`编辑链接`:`添加链接`),1)]),c.value?(A(),O(`button`,{key:1,class:`zm-node-menu-item`,onClick:r[3]||=y(e=>h(()=>a(`removeLink`)),[`stop`])},[e(F,{name:`x`,size:13}),r[12]||=v(`span`,null,`移除链接`,-1)])):f(``,!0),v(`button`,{class:`zm-node-menu-item`,onClick:r[4]||=y(e=>h(()=>a(`addCode`)),[`stop`])},[r[13]||=v(`span`,{class:`zm-node-menu-icon zm-node-menu-icon-code`,"aria-hidden":`true`},`{ }`,-1),v(`span`,null,p(n.hasCode?`编辑代码块`:`添加代码块`),1)]),n.hasCode?(A(),O(`button`,{key:2,class:`zm-node-menu-item`,onClick:r[5]||=y(e=>h(()=>a(`removeCode`)),[`stop`])},[e(F,{name:`x`,size:13}),r[14]||=v(`span`,null,`移除代码块`,-1)])):f(``,!0),v(`button`,{class:`zm-node-menu-item`,onClick:r[6]||=y(e=>h(()=>a(`addTable`)),[`stop`])},[r[15]||=v(`span`,{class:`zm-node-menu-icon zm-node-menu-icon-table`,"aria-hidden":`true`},`▦`,-1),v(`span`,null,p(n.hasTable?`编辑表格`:`添加表格`),1)]),n.hasTable?(A(),O(`button`,{key:3,class:`zm-node-menu-item`,onClick:r[7]||=y(e=>h(()=>a(`removeTable`)),[`stop`])},[e(F,{name:`x`,size:13}),r[16]||=v(`span`,null,`移除表格`,-1)])):f(``,!0),v(`button`,{class:`zm-node-menu-item`,onClick:r[8]||=y(e=>h(()=>a(`editNote`)),[`stop`])},[e(F,{name:`note`,size:13}),v(`span`,null,p(l.value?`编辑笔记`:`添加笔记`),1)]),l.value?(A(),O(`button`,{key:4,class:`zm-node-menu-item`,onClick:r[9]||=y(e=>h(()=>a(`removeNote`)),[`stop`])},[e(F,{name:`x`,size:13}),r[17]||=v(`span`,null,`移除笔记`,-1)])):f(``,!0)],36))}}),at=s({__name:`CanvasContextMenu`,props:{x:{},y:{},container:{}},emits:[`openSettings`,`openData`,`openImport`,`close`],setup(n,{emit:r}){let i=n,a=r,o=b(()=>{let e=i.x+2,t=i.y+2;if(i.container){let n=i.container.getBoundingClientRect();e+160>n.right&&(e=Math.max(n.left+4,i.x-160-2)),t+88>n.bottom&&(t=Math.max(n.top+4,i.y-88-2)),e<n.left+2&&(e=n.left+2),t<n.top+2&&(t=n.top+2)}return{left:e,top:t}}),s=T(!1),c=T(null),l=b(()=>{if(!c.value)return{left:`-9999px`,top:`-9999px`,display:`none`};let e=c.value.getBoundingClientRect(),t=window.innerWidth,n=window.innerHeight,r=e.right;r+176>t-4&&(r=Math.max(4,e.left-176));let i=e.top-4;return i+88>n-4&&(i=Math.max(4,n-88-4)),{left:r+`px`,top:i+`px`,display:`block`}}),u=null,d=null;function p(){d&&=(clearTimeout(d),null),u=setTimeout(()=>{s.value=!0},60)}function m(){u&&=(clearTimeout(u),null),d=setTimeout(()=>{s.value=!1},120)}t(()=>{u&&clearTimeout(u),d&&clearTimeout(d)});function h(e){let t=e.target;t&&t.closest(`.zm-canvas-menu`)||a(`close`)}function g(e){e.key===`Escape`&&a(`close`)}function S(){a(`close`)}window.addEventListener(`mousedown`,h,!0),window.addEventListener(`keydown`,g,!0),window.addEventListener(`wheel`,S,!0),window.addEventListener(`scroll`,S,!0),t(()=>{window.removeEventListener(`mousedown`,h,!0),window.removeEventListener(`keydown`,g,!0),window.removeEventListener(`wheel`,S,!0),window.removeEventListener(`scroll`,S,!0)});function C(e){e(),a(`close`)}return(t,n)=>(A(),O(`div`,{class:`zm-canvas-menu`,style:_({left:o.value.left+`px`,top:o.value.top+`px`}),onContextmenu:n[5]||=y(()=>{},[`prevent`])},[v(`button`,{class:`zm-canvas-menu-item`,onClick:n[0]||=y(e=>C(()=>a(`openData`)),[`stop`])},[e(F,{name:`database`,size:13,stroke:1.6}),n[6]||=v(`span`,null,`查看数据`,-1)]),v(`div`,{ref_key:`importItemRef`,ref:c,class:x([`zm-canvas-menu-item zm-canvas-menu-item-has-submenu`,{"is-open":s.value}]),onMouseenter:p,onMouseleave:m},[e(F,{name:`import`,size:13,stroke:1.6}),n[10]||=v(`span`,null,`导入`,-1),n[11]||=v(`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`},[v(`polyline`,{points:`2.5 1.8 5.2 4 2.5 6.2`})],-1),s.value?(A(),O(`div`,{key:0,class:`zm-canvas-submenu`,style:_(l.value),onMouseenter:p,onMouseleave:m},[v(`button`,{class:`zm-canvas-menu-item`,onClick:n[1]||=y(e=>C(()=>a(`openImport`,`markdown`)),[`stop`])},[e(F,{name:`markdown`,size:13,stroke:1.6}),n[7]||=v(`span`,null,`Markdown 导入`,-1)]),v(`button`,{class:`zm-canvas-menu-item`,onClick:n[2]||=y(e=>C(()=>a(`openImport`,`json`)),[`stop`])},[e(F,{name:`data`,size:13,stroke:1.6}),n[8]||=v(`span`,null,`JSON 文件导入`,-1)]),v(`button`,{class:`zm-canvas-menu-item`,onClick:n[3]||=y(e=>C(()=>a(`openImport`,`txt`)),[`stop`])},[e(F,{name:`txt`,size:13,stroke:1.6}),n[9]||=v(`span`,null,`TXT 文件导入`,-1)])],36)):f(``,!0)],34),v(`button`,{class:`zm-canvas-menu-item`,onClick:n[4]||=y(e=>C(()=>a(`openSettings`)),[`stop`])},[e(F,{name:`settings`,size:13,stroke:1.6}),n[12]||=v(`span`,null,`设置`,-1)])],36))}});function ot(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}function st(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw Error(`map is read-only`)}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw Error(`set is read-only`)}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{let n=e[t],r=typeof n;(r===`object`||r===`function`)&&!Object.isFrozen(n)&&st(n)}),e}var ct=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function lt(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#x27;`)}function ut(e,...t){let n=Object.create(null);for(let t in e)n[t]=e[t];return t.forEach(function(e){for(let t in e)n[t]=e[t]}),n}var dt=`</span>`,ft=e=>!!e.scope,pt=(e,{prefix:t})=>{if(e.startsWith(`language:`))return e.replace(`language:`,`language-`);if(e.includes(`.`)){let n=e.split(`.`);return[`${t}${n.shift()}`,...n.map((e,t)=>`${e}${`_`.repeat(t+1)}`)].join(` `)}return`${t}${e}`},mt=class{constructor(e,t){this.buffer=``,this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=lt(e)}openNode(e){if(!ft(e))return;let t=pt(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){ft(e)&&(this.buffer+=dt)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}},ht=(e={})=>{let t={children:[]};return Object.assign(t,e),t},gt=class e{constructor(){this.rootNode=ht(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let t=ht({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return typeof t==`string`?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(t=>this._walk(e,t)),e.closeNode(t)),e}static _collapse(t){typeof t!=`string`&&t.children&&(t.children.every(e=>typeof e==`string`)?t.children=[t.children.join(``)]:t.children.forEach(t=>{e._collapse(t)}))}},_t=class extends gt{constructor(e){super(),this.options=e}addText(e){e!==``&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){let n=e.root;t&&(n.scope=`language:${t}`),this.add(n)}toHTML(){return new mt(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function vt(e){return e?typeof e==`string`?e:e.source:null}function yt(e){return St(`(?=`,e,`)`)}function bt(e){return St(`(?:`,e,`)*`)}function xt(e){return St(`(?:`,e,`)?`)}function St(...e){return e.map(e=>vt(e)).join(``)}function Ct(e){let t=e[e.length-1];return typeof t==`object`&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function wt(...e){return`(`+(Ct(e).capture?``:`?:`)+e.map(e=>vt(e)).join(`|`)+`)`}function Tt(e){return RegExp(e.toString()+`|`).exec(``).length-1}function Et(e,t){let n=e&&e.exec(t);return n&&n.index===0}var Dt=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Ot(e,{joinWith:t}){let n=0;return e.map(e=>{n+=1;let t=n,r=vt(e),i=``;for(;r.length>0;){let e=Dt.exec(r);if(!e){i+=r;break}i+=r.substring(0,e.index),r=r.substring(e.index+e[0].length),e[0][0]===`\\`&&e[1]?i+=`\\`+String(Number(e[1])+t):(i+=e[0],e[0]===`(`&&n++)}return i}).map(e=>`(${e})`).join(t)}var W=/\b\B/,G=`[a-zA-Z]\\w*`,kt=`[a-zA-Z_]\\w*`,At=`\\b\\d+(\\.\\d+)?`,K=`(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)`,jt=`\\b(0b[01]+)`,Mt=`!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~`,Nt=(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=St(t,/.*\b/,e.binary,/\b.*/)),ut({scope:`meta`,begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{e.index!==0&&t.ignoreMatch()}},e)},Pt={begin:`\\\\[\\s\\S]`,relevance:0},Ft={scope:`string`,begin:`'`,end:`'`,illegal:`\\n`,contains:[Pt]},It={scope:`string`,begin:`"`,end:`"`,illegal:`\\n`,contains:[Pt]},Lt={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/},Rt=function(e,t,n={}){let r=ut({scope:`comment`,begin:e,end:t,contains:[]},n);r.contains.push({scope:`doctag`,begin:`[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)`,end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let i=wt(`I`,`a`,`is`,`so`,`us`,`to`,`at`,`if`,`in`,`it`,`on`,/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:St(/[ ]+/,`(`,i,/[.]?[:]?([.][ ]|[ ])/,`){3}`)}),r},zt=Rt(`//`,`$`),Bt=Rt(`/\\*`,`\\*/`),Vt=Rt(`#`,`$`),Ht=Object.freeze({__proto__:null,APOS_STRING_MODE:Ft,BACKSLASH_ESCAPE:Pt,BINARY_NUMBER_MODE:{scope:`number`,begin:jt,relevance:0},BINARY_NUMBER_RE:jt,COMMENT:Rt,C_BLOCK_COMMENT_MODE:Bt,C_LINE_COMMENT_MODE:zt,C_NUMBER_MODE:{scope:`number`,begin:K,relevance:0},C_NUMBER_RE:K,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})},HASH_COMMENT_MODE:Vt,IDENT_RE:G,MATCH_NOTHING_RE:W,METHOD_GUARD:{begin:`\\.\\s*[a-zA-Z_]\\w*`,relevance:0},NUMBER_MODE:{scope:`number`,begin:At,relevance:0},NUMBER_RE:At,PHRASAL_WORDS_MODE:Lt,QUOTE_STRING_MODE:It,REGEXP_MODE:{scope:`regexp`,begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Pt,{begin:/\[/,end:/\]/,relevance:0,contains:[Pt]}]},RE_STARTERS_RE:Mt,SHEBANG:Nt,TITLE_MODE:{scope:`title`,begin:G,relevance:0},UNDERSCORE_IDENT_RE:kt,UNDERSCORE_TITLE_MODE:{scope:`title`,begin:kt,relevance:0}});function Ut(e,t){e.input[e.index-1]===`.`&&t.ignoreMatch()}function Wt(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function Gt(e,t){t&&e.beginKeywords&&(e.begin=`\\b(`+e.beginKeywords.split(` `).join(`|`)+`)(?!\\.)(?=\\b|\\s)`,e.__beforeBegin=Ut,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function Kt(e,t){Array.isArray(e.illegal)&&(e.illegal=wt(...e.illegal))}function qt(e,t){if(e.match){if(e.begin||e.end)throw Error(`begin & end are not supported with match`);e.begin=e.match,delete e.match}}function q(e,t){e.relevance===void 0&&(e.relevance=1)}var Jt=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw Error(`beforeMatch cannot be used with starts`);let n=Object.assign({},e);Object.keys(e).forEach(t=>{delete e[t]}),e.keywords=n.keywords,e.begin=St(n.beforeMatch,yt(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},Yt=[`of`,`and`,`for`,`in`,`not`,`or`,`if`,`then`,`parent`,`list`,`value`],Xt=`keyword`;function Zt(e,t,n=Xt){let r=Object.create(null);return typeof e==`string`?i(n,e.split(` `)):Array.isArray(e)?i(n,e):Object.keys(e).forEach(function(n){Object.assign(r,Zt(e[n],t,n))}),r;function i(e,n){t&&(n=n.map(e=>e.toLowerCase())),n.forEach(function(t){let n=t.split(`|`);r[n[0]]=[e,Qt(n[0],n[1])]})}}function Qt(e,t){return t?Number(t):+!$t(e)}function $t(e){return Yt.includes(e.toLowerCase())}var en={},tn=e=>{console.error(e)},nn=(e,...t)=>{console.log(`WARN: ${e}`,...t)},rn=(e,t)=>{en[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),en[`${e}/${t}`]=!0)},an=Error();function on(e,t,{key:n}){let r=0,i=e[n],a={},o={};for(let e=1;e<=t.length;e++)o[e+r]=i[e],a[e+r]=!0,r+=Tt(t[e-1]);e[n]=o,e[n]._emit=a,e[n]._multi=!0}function sn(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw tn(`skip, excludeBegin, returnBegin not compatible with beginScope: {}`),an;if(typeof e.beginScope!=`object`||e.beginScope===null)throw tn(`beginScope must be object`),an;on(e,e.begin,{key:`beginScope`}),e.begin=Ot(e.begin,{joinWith:``})}}function cn(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw tn(`skip, excludeEnd, returnEnd not compatible with endScope: {}`),an;if(typeof e.endScope!=`object`||e.endScope===null)throw tn(`endScope must be object`),an;on(e,e.end,{key:`endScope`}),e.end=Ot(e.end,{joinWith:``})}}function ln(e){e.scope&&typeof e.scope==`object`&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function un(e){ln(e),typeof e.beginScope==`string`&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope==`string`&&(e.endScope={_wrap:e.endScope}),sn(e),cn(e)}function dn(e){function t(t,n){return new RegExp(vt(t),`m`+(e.case_insensitive?`i`:``)+(e.unicodeRegex?`u`:``)+(n?`g`:``))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=Tt(e)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let e=this.regexes.map(e=>e[1]);this.matcherRe=t(Ot(e,{joinWith:`|`}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;let t=this.matcherRe.exec(e);if(!t)return null;let n=t.findIndex((e,t)=>t>0&&e!==void 0),r=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,r)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];let t=new n;return this.rules.slice(e).forEach(([e,n])=>t.addRule(e,n)),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),t.type===`begin`&&this.count++}exec(e){let t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let n=t.exec(e);if(this.resumingScanAtSamePosition()&&!(n&&n.index===this.lastIndex)){let t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}function i(e){let t=new r;return e.contains.forEach(e=>t.addRule(e.begin,{rule:e,type:`begin`})),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:`end`}),e.illegal&&t.addRule(e.illegal,{type:`illegal`}),t}function a(n,r){let o=n;if(n.isCompiled)return o;[Wt,qt,un,Jt].forEach(e=>e(n,r)),e.compilerExtensions.forEach(e=>e(n,r)),n.__beforeBegin=null,[Gt,Kt,q].forEach(e=>e(n,r)),n.isCompiled=!0;let s=null;return typeof n.keywords==`object`&&n.keywords.$pattern&&(n.keywords=Object.assign({},n.keywords),s=n.keywords.$pattern,delete n.keywords.$pattern),s||=/\w+/,n.keywords&&=Zt(n.keywords,e.case_insensitive),o.keywordPatternRe=t(s,!0),r&&(n.begin||=/\B|\b/,o.beginRe=t(o.begin),!n.end&&!n.endsWithParent&&(n.end=/\B|\b/),n.end&&(o.endRe=t(o.end)),o.terminatorEnd=vt(o.end)||``,n.endsWithParent&&r.terminatorEnd&&(o.terminatorEnd+=(n.end?`|`:``)+r.terminatorEnd)),n.illegal&&(o.illegalRe=t(n.illegal)),n.contains||=[],n.contains=[].concat(...n.contains.map(function(e){return pn(e===`self`?n:e)})),n.contains.forEach(function(e){a(e,o)}),n.starts&&a(n.starts,r),o.matcher=i(o),o}if(e.compilerExtensions||=[],e.contains&&e.contains.includes(`self`))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=ut(e.classNameAliases||{}),a(e)}function fn(e){return e?e.endsWithParent||fn(e.starts):!1}function pn(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return ut(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:fn(e)?ut(e,{starts:e.starts?ut(e.starts):null}):Object.isFrozen(e)?ut(e):e}var mn=`11.11.1`,hn=class extends Error{constructor(e,t){super(e),this.name=`HTMLInjectionError`,this.html=t}},gn=lt,_n=ut,vn=Symbol(`nomatch`),yn=7,bn=function(e){let t=Object.create(null),n=Object.create(null),r=[],i=!0,a=`Could not find the language '{}', did you forget to load/include a language module?`,o={disableAutodetect:!0,name:`Plain text`,contains:[]},s={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:`hljs-`,cssSelector:`pre code`,languages:null,__emitter:_t};function c(e){return s.noHighlightRe.test(e)}function l(e){let t=e.className+` `;t+=e.parentNode?e.parentNode.className:``;let n=s.languageDetectRe.exec(t);if(n){let t=w(n[1]);return t||(nn(a.replace(`{}`,n[1])),nn(`Falling back to no-highlight mode for this block.`,e)),t?n[1]:`no-highlight`}return t.split(/\s+/).find(e=>c(e)||w(e))}function u(e,t,n){let r=``,i=``;typeof t==`object`?(r=e,n=t.ignoreIllegals,i=t.language):(rn(`10.7.0`,`highlight(lang, code, ...args) has been deprecated.`),rn(`10.7.0`,`Please use highlight(code, options) instead.
13
+ https://github.com/highlightjs/highlight.js/issues/2277`),i=e,r=t),n===void 0&&(n=!0);let a={code:r,language:i};A(`before:highlight`,a);let o=a.result?a.result:d(a.language,a.code,n);return o.code=a.code,A(`after:highlight`,o),o}function d(e,n,r,o){let c=Object.create(null);function l(e,t){return e.keywords[t]}function u(){if(!k.keywords){j.addText(M);return}let e=0;k.keywordPatternRe.lastIndex=0;let t=k.keywordPatternRe.exec(M),n=``;for(;t;){n+=M.substring(e,t.index);let r=E.case_insensitive?t[0].toLowerCase():t[0],i=l(k,r);if(i){let[e,a]=i;if(j.addText(n),n=``,c[r]=(c[r]||0)+1,c[r]<=yn&&(N+=a),e.startsWith(`_`))n+=t[0];else{let n=E.classNameAliases[e]||e;h(t[0],n)}}else n+=t[0];e=k.keywordPatternRe.lastIndex,t=k.keywordPatternRe.exec(M)}n+=M.substring(e),j.addText(n)}function f(){if(M===``)return;let e=null;if(typeof k.subLanguage==`string`){if(!t[k.subLanguage]){j.addText(M);return}e=d(k.subLanguage,M,!0,A[k.subLanguage]),A[k.subLanguage]=e._top}else e=p(M,k.subLanguage.length?k.subLanguage:null);k.relevance>0&&(N+=e.relevance),j.__addSublanguage(e._emitter,e.language)}function m(){k.subLanguage==null?u():f(),M=``}function h(e,t){e!==``&&(j.startScope(t),j.addText(e),j.endScope())}function g(e,t){let n=1,r=t.length-1;for(;n<=r;){if(!e._emit[n]){n++;continue}let r=E.classNameAliases[e[n]]||e[n],i=t[n];r?h(i,r):(M=i,u(),M=``),n++}}function _(e,t){return e.scope&&typeof e.scope==`string`&&j.openNode(E.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(h(M,E.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),M=``):e.beginScope._multi&&(g(e.beginScope,t),M=``)),k=Object.create(e,{parent:{value:k}}),k}function v(e,t,n){let r=Et(e.endRe,n);if(r){if(e[`on:end`]){let n=new ct(e);e[`on:end`](t,n),n.isMatchIgnored&&(r=!1)}if(r){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return v(e.parent,t,n)}function y(e){return k.matcher.regexIndex===0?(M+=e[0],1):(te=!0,0)}function b(e){let t=e[0],n=e.rule,r=new ct(n),i=[n.__beforeBegin,n[`on:begin`]];for(let n of i)if(n&&(n(e,r),r.isMatchIgnored))return y(t);return n.skip?M+=t:(n.excludeBegin&&(M+=t),m(),!n.returnBegin&&!n.excludeBegin&&(M=t)),_(n,e),n.returnBegin?0:t.length}function x(e){let t=e[0],r=n.substring(e.index),i=v(k,e,r);if(!i)return vn;let a=k;k.endScope&&k.endScope._wrap?(m(),h(t,k.endScope._wrap)):k.endScope&&k.endScope._multi?(m(),g(k.endScope,e)):a.skip?M+=t:(a.returnEnd||a.excludeEnd||(M+=t),m(),a.excludeEnd&&(M=t));do k.scope&&j.closeNode(),!k.skip&&!k.subLanguage&&(N+=k.relevance),k=k.parent;while(k!==i.parent);return i.starts&&_(i.starts,e),a.returnEnd?0:t.length}function S(){let e=[];for(let t=k;t!==E;t=t.parent)t.scope&&e.unshift(t.scope);e.forEach(e=>j.openNode(e))}let C={};function T(t,a){let o=a&&a[0];if(M+=t,o==null)return m(),0;if(C.type===`begin`&&a.type===`end`&&C.index===a.index&&o===``){if(M+=n.slice(a.index,a.index+1),!i){let t=Error(`0 width match regex (${e})`);throw t.languageName=e,t.badRule=C.rule,t}return 1}if(C=a,a.type===`begin`)return b(a);if(a.type===`illegal`&&!r){let e=Error(`Illegal lexeme "`+o+`" for mode "`+(k.scope||`<unnamed>`)+`"`);throw e.mode=k,e}else if(a.type===`end`){let e=x(a);if(e!==vn)return e}if(a.type===`illegal`&&o===``)return M+=`
14
+ `,1;if(ee>1e5&&ee>a.index*3)throw Error(`potential infinite loop, way more iterations than matches`);return M+=o,o.length}let E=w(e);if(!E)throw tn(a.replace(`{}`,e)),Error(`Unknown language: "`+e+`"`);let D=dn(E),O=``,k=o||D,A={},j=new s.__emitter(s);S();let M=``,N=0,P=0,ee=0,te=!1;try{if(E.__emitTokens)E.__emitTokens(n,j);else{for(k.matcher.considerAll();;){ee++,te?te=!1:k.matcher.considerAll(),k.matcher.lastIndex=P;let e=k.matcher.exec(n);if(!e)break;let t=T(n.substring(P,e.index),e);P=e.index+t}T(n.substring(P))}return j.finalize(),O=j.toHTML(),{language:e,value:O,relevance:N,illegal:!1,_emitter:j,_top:k}}catch(t){if(t.message&&t.message.includes(`Illegal`))return{language:e,value:gn(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:P,context:n.slice(P-100,P+100),mode:t.mode,resultSoFar:O},_emitter:j};if(i)return{language:e,value:gn(n),illegal:!1,relevance:0,errorRaised:t,_emitter:j,_top:k};throw t}}function f(e){let t={value:gn(e),illegal:!1,relevance:0,_top:o,_emitter:new s.__emitter(s)};return t._emitter.addText(e),t}function p(e,n){n=n||s.languages||Object.keys(t);let r=f(e),i=n.filter(w).filter(E).map(t=>d(t,e,!1));i.unshift(r);let[a,o]=i.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(w(e.language).supersetOf===t.language)return 1;if(w(t.language).supersetOf===e.language)return-1}return 0}),c=a;return c.secondBest=o,c}function m(e,t,r){let i=t&&n[t]||r;e.classList.add(`hljs`),e.classList.add(`language-${i}`)}function h(e){let t=null,n=l(e);if(c(n))return;if(A(`before:highlightElement`,{el:e,language:n}),e.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e);return}if(e.children.length>0&&(s.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(e)),s.throwUnescapedHTML))throw new hn(`One of your code blocks includes unescaped HTML.`,e.innerHTML);t=e;let r=t.textContent,i=n?u(r,{language:n,ignoreIllegals:!0}):p(r);e.innerHTML=i.value,e.dataset.highlighted=`yes`,m(e,n,i.language),e.result={language:i.language,re:i.relevance,relevance:i.relevance},i.secondBest&&(e.secondBest={language:i.secondBest.language,relevance:i.secondBest.relevance}),A(`after:highlightElement`,{el:e,result:i,text:r})}function g(e){s=_n(s,e)}let _=()=>{b(),rn(`10.6.0`,`initHighlighting() deprecated. Use highlightAll() now.`)};function v(){b(),rn(`10.6.0`,`initHighlightingOnLoad() deprecated. Use highlightAll() now.`)}let y=!1;function b(){function e(){b()}if(document.readyState===`loading`){y||window.addEventListener(`DOMContentLoaded`,e,!1),y=!0;return}document.querySelectorAll(s.cssSelector).forEach(h)}function x(n,r){let a=null;try{a=r(e)}catch(e){if(tn(`Language definition for '{}' could not be registered.`.replace(`{}`,n)),i)tn(e);else throw e;a=o}a.name||=n,t[n]=a,a.rawDefinition=r.bind(null,e),a.aliases&&T(a.aliases,{languageName:n})}function S(e){delete t[e];for(let t of Object.keys(n))n[t]===e&&delete n[t]}function C(){return Object.keys(t)}function w(e){return e=(e||``).toLowerCase(),t[e]||t[n[e]]}function T(e,{languageName:t}){typeof e==`string`&&(e=[e]),e.forEach(e=>{n[e.toLowerCase()]=t})}function E(e){let t=w(e);return t&&!t.disableAutodetect}function D(e){e[`before:highlightBlock`]&&!e[`before:highlightElement`]&&(e[`before:highlightElement`]=t=>{e[`before:highlightBlock`](Object.assign({block:t.el},t))}),e[`after:highlightBlock`]&&!e[`after:highlightElement`]&&(e[`after:highlightElement`]=t=>{e[`after:highlightBlock`](Object.assign({block:t.el},t))})}function O(e){D(e),r.push(e)}function k(e){let t=r.indexOf(e);t!==-1&&r.splice(t,1)}function A(e,t){let n=e;r.forEach(function(e){e[n]&&e[n](t)})}function j(e){return rn(`10.7.0`,`highlightBlock will be removed entirely in v12.0`),rn(`10.7.0`,`Please use highlightElement now.`),h(e)}Object.assign(e,{highlight:u,highlightAuto:p,highlightAll:b,highlightElement:h,highlightBlock:j,configure:g,initHighlighting:_,initHighlightingOnLoad:v,registerLanguage:x,unregisterLanguage:S,listLanguages:C,getLanguage:w,registerAliases:T,autoDetection:E,inherit:_n,addPlugin:O,removePlugin:k}),e.debugMode=function(){i=!1},e.safeMode=function(){i=!0},e.versionString=mn,e.regex={concat:St,lookahead:yt,either:wt,optional:xt,anyNumberOfTimes:bt};for(let e in Ht)typeof Ht[e]==`object`&&st(Ht[e]);return Object.assign(e,Ht),e},xn=bn({});xn.newInstance=()=>bn({});var Sn=xn;xn.HighlightJS=xn,xn.default=xn;var J=ot(Sn);function Cn(e){let t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:[`self`,{begin:/:-/,contains:[n]}]};Object.assign(n,{className:`variable`,variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,`(?![\\w\\d])(?![$])`)},r]});let i={className:`subst`,begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},a=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:`comment`}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:`string`})]}},s={className:`string`,begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,i]};i.contains.push(s);let c={match:/\\"/},l={className:`string`,begin:/'/,end:/'/},u={match:/\\'/},d={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:`number`},e.NUMBER_MODE,n]},f=e.SHEBANG({binary:`(${[`fish`,`bash`,`zsh`,`sh`,`csh`,`ksh`,`tcsh`,`dash`,`scsh`].join(`|`)})`,relevance:10}),p={className:`function`,begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},m=[`if`,`then`,`else`,`elif`,`fi`,`time`,`for`,`while`,`until`,`in`,`do`,`done`,`case`,`esac`,`coproc`,`function`,`select`],h=[`true`,`false`],g={match:/(\/[a-z._-]+)+/},_=[`break`,`cd`,`continue`,`eval`,`exec`,`exit`,`export`,`getopts`,`hash`,`pwd`,`readonly`,`return`,`shift`,`test`,`times`,`trap`,`umask`,`unset`],v=[`alias`,`bind`,`builtin`,`caller`,`command`,`declare`,`echo`,`enable`,`help`,`let`,`local`,`logout`,`mapfile`,`printf`,`read`,`readarray`,`source`,`sudo`,`type`,`typeset`,`ulimit`,`unalias`],y=`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`.split(`.`),b=`chcon.chgrp.chown.chmod.cp.dd.df.dir.dircolors.ln.ls.mkdir.mkfifo.mknod.mktemp.mv.realpath.rm.rmdir.shred.sync.touch.truncate.vdir.b2sum.base32.base64.cat.cksum.comm.csplit.cut.expand.fmt.fold.head.join.md5sum.nl.numfmt.od.paste.ptx.pr.sha1sum.sha224sum.sha256sum.sha384sum.sha512sum.shuf.sort.split.sum.tac.tail.tr.tsort.unexpand.uniq.wc.arch.basename.chroot.date.dirname.du.echo.env.expr.factor.groups.hostid.id.link.logname.nice.nohup.nproc.pathchk.pinky.printenv.printf.pwd.readlink.runcon.seq.sleep.stat.stdbuf.stty.tee.test.timeout.tty.uname.unlink.uptime.users.who.whoami.yes`.split(`.`);return{name:`Bash`,aliases:[`sh`,`zsh`],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:m,literal:h,built_in:[..._,...v,`set`,`shopt`,...y,...b]},contains:[f,e.SHEBANG(),p,d,a,o,g,s,c,l,u,n]}}var wn=e=>({IMPORTANT:{scope:`meta`,begin:`!important`},BLOCK_COMMENT:e.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:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:`number`,begin:e.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_-]*/}}),Tn=`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`.split(`.`),En=`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`.split(`.`),Dn=[...Tn,...En],On=`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`.split(`.`).sort().reverse(),kn=`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`.split(`.`).sort().reverse(),An=[`after`,`backdrop`,`before`,`cue`,`cue-region`,`first-letter`,`first-line`,`grammar-error`,`marker`,`part`,`placeholder`,`selection`,`slotted`,`spelling-error`].sort().reverse(),jn=`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`.split(`.`).sort().reverse();function Mn(e){let t=e.regex,n=wn(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i=/@-?\w[\w]*(-\w+)*/,a=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:`CSS`,case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:`from to`},classNameAliases:{keyframePosition:`selector-tag`},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:`selector-id`,begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:`selector-class`,begin:`\\.[a-zA-Z-][a-zA-Z0-9_-]*`,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:`selector-pseudo`,variants:[{begin:`:(`+kn.join(`|`)+`)`},{begin:`:(:)?(`+An.join(`|`)+`)`}]},n.CSS_VARIABLE,{className:`attribute`,begin:`\\b(`+jn.join(`|`)+`)\\b`},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...a,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:`url data-uri`},contains:[...a,{className:`string`,begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:`[{;]`,relevance:0,illegal:/:/,contains:[{className:`keyword`,begin:i},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:`and or not only`,attribute:On.join(` `)},contains:[{begin:/[a-z-]+(?=:)/,className:`attribute`},...a,n.CSS_NUMBER_MODE]}]},{className:`selector-tag`,begin:`\\b(`+Dn.join(`|`)+`)\\b`}]}}function Nn(e){let t={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:t,illegal:`</`,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:`string`,variants:[e.QUOTE_STRING_MODE,e.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:[e.TITLE_MODE,{className:`params`,begin:/\(/,end:/\)/,endsParent:!0,keywords:t,illegal:/["']/}]}]}}var Pn=`[0-9](_*[0-9])*`,Fn=`\\.(${Pn})`,In=`[0-9a-fA-F](_*[0-9a-fA-F])*`,Ln={className:`number`,variants:[{begin:`(\\b(${Pn})((${Fn})|\\.)?|(${Fn}))[eE][+-]?(${Pn})[fFdD]?\\b`},{begin:`\\b(${Pn})((${Fn})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Fn})[fFdD]?\\b`},{begin:`\\b(${Pn})[fFdD]\\b`},{begin:`\\b0[xX]((${In})\\.?|(${In})?\\.(${In}))[pP][+-]?(${Pn})[fFdD]?\\b`},{begin:`\\b(0|[1-9](_*[0-9])*)[lL]?\\b`},{begin:`\\b0[xX](${In})[lL]?\\b`},{begin:`\\b0(_*[0-7])*[lL]?\\b`},{begin:`\\b0[bB][01](_*[01])*[lL]?\\b`}],relevance:0};function Rn(e,t,n){return n===-1?``:e.replace(t,r=>Rn(e,t,n-1))}function zn(e){let t=e.regex,n=`[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*`,r=n+Rn(`(?:<[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*~~~(?:\\s*,\\s*[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*~~~)*>)?`,/~~~/g,2),i={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`.split(`.`),literal:[`false`,`true`,`null`],type:[`char`,`boolean`,`long`,`float`,`int`,`byte`,`short`,`double`],built_in:[`super`,`this`]},a={className:`meta`,begin:`@[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*`,contains:[{begin:/\(/,end:/\)/,contains:[`self`]}]},o={className:`params`,begin:/\(/,end:/\)/,keywords:i,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:`Java`,aliases:[`jsp`],keywords:i,illegal:/<\/|#/,contains:[e.COMMENT(`/\\*\\*`,`\\*/`,{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:`doctag`,begin:`@[A-Za-z]+`}]}),{begin:/import java\.[a-z]+\./,keywords:`import`,relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:`string`,contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.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:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:`type`,3:`variable`,5:`operator`}},{begin:[/record/,/\s+/,n],className:{1:`keyword`,3:`title.class`},contains:[o,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:`new throw return else`,relevance:0},{begin:[`(?:`+r+`\\s+)`,e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:`title.function`},keywords:i,contains:[{className:`params`,begin:/\(/,end:/\)/,keywords:i,relevance:0,contains:[a,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,Ln,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},Ln,a]}}var Bn=`[A-Za-z$_][0-9A-Za-z$_]*`,Vn=`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`.split(`.`),Hn=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],Un=`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`.split(`.`),Wn=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],Gn=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],Kn=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`global`],qn=[].concat(Gn,Un,Wn);function Jn(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=Bn,i={begin:`<>`,end:`</>`},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let r=e[0].length+e.index,i=e.input[r];if(i===`<`||i===`,`){t.ignoreMatch();return}i===`>`&&(n(e,{after:r})||t.ignoreMatch());let a,o=e.input.substring(r);if(a=o.match(/^\s*=/)){t.ignoreMatch();return}if((a=o.match(/^\s+extends\s+/))&&a.index===0){t.ignoreMatch();return}}},s={$pattern:Bn,keyword:Vn,literal:Hn,built_in:qn,"variable.language":Kn},c=`[0-9](_?[0-9])*`,l=`\\.(${c})`,u=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,d={className:`number`,variants:[{begin:`(\\b(${u})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${l})\\b|\\.)?|(${l})\\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},f={className:`subst`,begin:`\\$\\{`,end:`\\}`,keywords:s,contains:[]},p={begin:".?html`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`xml`}},m={begin:".?css`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`css`}},h={begin:".?gql`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`graphql`}},g={className:`string`,begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},_={className:`comment`,variants:[e.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:`[A-Za-z$_][0-9A-Za-z$_]*(?=\\s*(-)|$)`,endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,{match:/\$\d+/},d];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:s,contains:[`self`].concat(v)});let y=[].concat(_,f.contains),b=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:[`self`].concat(y)}]),x={className:`params`,begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b},S={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,`(`,t.concat(/\./,r),`)*`)],scope:{1:`keyword`,3:`title.class`,5:`keyword`,7:`title.class.inherited`}},{match:[/class/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}}]},C={relevance:0,match:t.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:{_:[...Un,...Wn]}},w={label:`use_strict`,className:`meta`,relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:`keyword`,3:`title.function`},label:`func.def`,contains:[x],illegal:/%/},E={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`};function D(e){return t.concat(`(?!`,e.join(`|`),`)`)}let O={match:t.concat(/\b/,D([...Gn,`super`,`import`].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},k={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},A={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:`keyword`,3:`title.function`},contains:[{begin:/\(\)/},x]},j=`(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|`+e.UNDERSCORE_IDENT_RE+`)\\s*=>`,M={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(j)],keywords:`async`,className:{1:`keyword`,3:`title.function`},contains:[x]};return{name:`JavaScript`,aliases:[`js`,`jsx`,`mjs`,`cjs`],keywords:s,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:`shebang`,binary:`node`,relevance:5}),w,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,_,{match:/\$\d+/},d,C,{scope:`attr`,match:r+t.lookahead(`:`),relevance:0},M,{begin:`(`+e.RE_STARTERS_RE+`|\\b(case|return|throw)\\b)\\s*`,keywords:`return throw case`,relevance:0,contains:[_,e.REGEXP_MODE,{className:`function`,begin:j,returnBegin:!0,end:`\\s*=>`,contains:[{className:`params`,variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:`xml`,contains:[{begin:o.begin,end:o.end,skip:!0,contains:[`self`]}]}]},T,{beginKeywords:`while if switch catch for`},{begin:`\\b(?!function)`+e.UNDERSCORE_IDENT_RE+`\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{`,returnBegin:!0,label:`func.def`,contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:`title.function`})]},{match:/\.\.\./,relevance:0},k,{match:`\\$[A-Za-z$_][0-9A-Za-z$_]*`,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[x]},O,E,S,A,{match:/\$[(.]/}]}}function Yn(e){let t={className:`attr`,begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:`punctuation`,relevance:0},r=[`true`,`false`,`null`],i={scope:`literal`,beginKeywords:r.join(` `)};return{name:`JSON`,aliases:[`jsonc`],keywords:{literal:r},contains:[t,n,e.QUOTE_STRING_MODE,i,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:`\\S`}}function Xn(e){let t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:`>`,subLanguage:`xml`,relevance:0},r={begin:`^[-\\*]{3,}`,end:`$`},i={className:`code`,variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:`(~{3,})[^~](.|\\n)*?\\1~*[ ]*`},{begin:"```",end:"```+[ ]*$"},{begin:`~~~`,end:`~~~+[ ]*$`},{begin:"`.+?`"},{begin:`(?=^( {4}|\\t))`,contains:[{begin:`^( {4}|\\t)`,end:`(\\n)$`}],relevance:0}]},a={className:`bullet`,begin:`^[ ]*([*+-]|(\\d+\\.))(?=\\s+)`,end:`\\s+`,excludeEnd:!0},o={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:`symbol`,begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:`link`,begin:/:\s*/,end:/$/,excludeBegin:!0}]},s={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/),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}]},c={className:`strong`,contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},l={className:`emphasis`,contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},u=e.inherit(c,{contains:[]}),d=e.inherit(l,{contains:[]});c.contains.push(d),l.contains.push(u);let f=[n,s];return[c,l,u,d].forEach(e=>{e.contains=e.contains.concat(f)}),f=f.concat(c,l),{name:`Markdown`,aliases:[`md`,`mkdown`,`mkd`],contains:[{className:`section`,variants:[{begin:`^#{1,6}`,end:`$`,contains:f},{begin:`(?=^.+?\\n[=-]{2,}$)`,contains:[{begin:`^[=-]*$`},{begin:`^`,end:`\\n`,contains:f}]}]},n,a,c,l,{className:`quote`,begin:`^>\\s+`,contains:f,end:`$`},i,r,s,o,{scope:`literal`,match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function Zn(e){let t=e.regex,n=RegExp(`[\\p{XID_Start}_]\\p{XID_Continue}*`,`u`),r=`and.as.assert.async.await.break.case.class.continue.def.del.elif.else.except.finally.for.from.global.if.import.in.is.lambda.match.nonlocal|10.not.or.pass.raise.return.try.while.with.yield`.split(`.`),i={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:`__import__.abs.all.any.ascii.bin.bool.breakpoint.bytearray.bytes.callable.chr.classmethod.compile.complex.delattr.dict.dir.divmod.enumerate.eval.exec.filter.float.format.frozenset.getattr.globals.hasattr.hash.help.hex.id.input.int.isinstance.issubclass.iter.len.list.locals.map.max.memoryview.min.next.object.oct.open.ord.pow.print.property.range.repr.reversed.round.set.setattr.slice.sorted.staticmethod.str.sum.super.tuple.type.vars.zip`.split(`.`),literal:[`__debug__`,`Ellipsis`,`False`,`None`,`NotImplemented`,`True`],type:[`Any`,`Callable`,`Coroutine`,`Dict`,`List`,`Literal`,`Generic`,`Optional`,`Sequence`,`Set`,`Tuple`,`Type`,`Union`]},a={className:`meta`,begin:/^(>>>|\.\.\.) /},o={className:`subst`,begin:/\{/,end:/\}/,keywords:i,illegal:/#/},s={begin:/\{\{/,relevance:0},c={className:`string`,contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{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:[e.BACKSLASH_ESCAPE,s,o]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,s,o]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},l=`[0-9](_?[0-9])*`,u=`(\\b(${l}))?\\.(${l})|\\b(${l})\\.`,d=`\\b|${r.join(`|`)}`,f={className:`number`,relevance:0,variants:[{begin:`(\\b(${l})|(${u}))[eE][+-]?(${l})[jJ]?(?=${d})`},{begin:`(${u})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${d})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${d})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${d})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${d})`},{begin:`\\b(${l})[jJ](?=${d})`}]},p={className:`comment`,begin:t.lookahead(/# type:/),end:/$/,keywords:i,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},m={className:`params`,variants:[{className:``,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:i,contains:[`self`,a,f,c,e.HASH_COMMENT_MODE]}]};return o.contains=[c,f,a],{name:`Python`,aliases:[`py`,`gyp`,`ipython`],unicodeRegex:!0,keywords:i,illegal:/(<\/|\?)|=>/,contains:[a,f,{scope:`variable.language`,match:/\bself\b/},{beginKeywords:`if`,relevance:0},{match:/\bor\b/,scope:`keyword`},c,p,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:`keyword`,3:`title.function`},contains:[m]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:`keyword`,3:`title.class`,6:`title.class.inherited`}},{className:`meta`,begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[f,m,c]}]}}function Qn(e){let t=e.regex,n=/(r#)?/,r=t.concat(n,e.UNDERSCORE_IDENT_RE),i=t.concat(n,e.IDENT_RE),a={className:`title.function.invoke`,relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,i,t.lookahead(/\s*\(/))},o=`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`.split(`.`),s=[`true`,`false`,`Some`,`None`,`Ok`,`Err`],c=`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!`.split(`.`),l=[`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:e.IDENT_RE+`!?`,type:l,keyword:o,literal:s,built_in:c},illegal:`</`,contains:[e.C_LINE_COMMENT_MODE,e.COMMENT(`/\\*`,`\\*/`,{contains:[`self`]}),e.inherit(e.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_]+)([ui](8|16|32|64|128|size)|f(32|64))?`},{begin:`\\b0o([0-7_]+)([ui](8|16|32|64|128|size)|f(32|64))?`},{begin:`\\b0x([A-Fa-f0-9_]+)([ui](8|16|32|64|128|size)|f(32|64))?`},{begin:`\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)([ui](8|16|32|64|128|size)|f(32|64))?`}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:`keyword`,3:`title.function`}},{className:`meta`,begin:`#!?\\[`,end:`\\]`,contains:[{className:`string`,begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],className:{1:`keyword`,3:`keyword`,4:`variable`}},{begin:[/for/,/\s+/,r,/\s+/,/in/],className:{1:`keyword`,3:`variable`,5:`keyword`}},{begin:[/type/,/\s+/,r],className:{1:`keyword`,3:`title.class`}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],className:{1:`keyword`,3:`title.class`}},{begin:e.IDENT_RE+`::`,keywords:{keyword:`Self`,built_in:c,type:l}},{className:`punctuation`,begin:`->`},a]}}function $n(e){let t=e.regex,n=e.COMMENT(`--`,`$`),r={scope:`string`,variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},a=[`true`,`false`,`unknown`],o=[`double precision`,`large object`,`with timezone`,`without timezone`],s=`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`.split(`.`),c=[`add`,`asc`,`collation`,`desc`,`final`,`first`,`last`,`view`],l=`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`.split(`.`),u=`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`.split(`.`),d=[`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`],f=[`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=u,m=[...l,...c].filter(e=>!u.includes(e)),h={scope:`variable`,match:/@[a-z0-9][a-z0-9_]*/},g={scope:`operator`,match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},_={match:t.concat(/\b/,t.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function v(e){return t.concat(/\b/,t.either(...e.map(e=>e.replace(/\s+/,`\\s+`))),/\b/)}let y={scope:`keyword`,match:v(f),relevance:0};function b(e,{exceptions:t,when:n}={}){let r=n;return t||=[],e.map(e=>e.match(/\|\d+$/)||t.includes(e)?e:r(e)?`${e}|0`:e)}return{name:`SQL`,case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:b(m,{when:e=>e.length<3}),literal:a,type:s,built_in:d},contains:[{scope:`type`,match:v(o)},y,_,h,r,i,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,g]}}var er=`[A-Za-z$_][0-9A-Za-z$_]*`,tr=`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`.split(`.`),nr=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],rr=`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`.split(`.`),ir=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],ar=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],or=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`global`],sr=[].concat(ar,rr,ir);function cr(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=er,i={begin:`<>`,end:`</>`},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let r=e[0].length+e.index,i=e.input[r];if(i===`<`||i===`,`){t.ignoreMatch();return}i===`>`&&(n(e,{after:r})||t.ignoreMatch());let a,o=e.input.substring(r);if(a=o.match(/^\s*=/)){t.ignoreMatch();return}if((a=o.match(/^\s+extends\s+/))&&a.index===0){t.ignoreMatch();return}}},s={$pattern:er,keyword:tr,literal:nr,built_in:sr,"variable.language":or},c=`[0-9](_?[0-9])*`,l=`\\.(${c})`,u=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,d={className:`number`,variants:[{begin:`(\\b(${u})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${l})\\b|\\.)?|(${l})\\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},f={className:`subst`,begin:`\\$\\{`,end:`\\}`,keywords:s,contains:[]},p={begin:".?html`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`xml`}},m={begin:".?css`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`css`}},h={begin:".?gql`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`graphql`}},g={className:`string`,begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},_={className:`comment`,variants:[e.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:`[A-Za-z$_][0-9A-Za-z$_]*(?=\\s*(-)|$)`,endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,{match:/\$\d+/},d];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:s,contains:[`self`].concat(v)});let y=[].concat(_,f.contains),b=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:[`self`].concat(y)}]),x={className:`params`,begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b},S={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,`(`,t.concat(/\./,r),`)*`)],scope:{1:`keyword`,3:`title.class`,5:`keyword`,7:`title.class.inherited`}},{match:[/class/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}}]},C={relevance:0,match:t.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:{_:[...rr,...ir]}},w={label:`use_strict`,className:`meta`,relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:`keyword`,3:`title.function`},label:`func.def`,contains:[x],illegal:/%/},E={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`};function D(e){return t.concat(`(?!`,e.join(`|`),`)`)}let O={match:t.concat(/\b/,D([...ar,`super`,`import`].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},k={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},A={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:`keyword`,3:`title.function`},contains:[{begin:/\(\)/},x]},j=`(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|`+e.UNDERSCORE_IDENT_RE+`)\\s*=>`,M={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(j)],keywords:`async`,className:{1:`keyword`,3:`title.function`},contains:[x]};return{name:`JavaScript`,aliases:[`js`,`jsx`,`mjs`,`cjs`],keywords:s,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:`shebang`,binary:`node`,relevance:5}),w,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,_,{match:/\$\d+/},d,C,{scope:`attr`,match:r+t.lookahead(`:`),relevance:0},M,{begin:`(`+e.RE_STARTERS_RE+`|\\b(case|return|throw)\\b)\\s*`,keywords:`return throw case`,relevance:0,contains:[_,e.REGEXP_MODE,{className:`function`,begin:j,returnBegin:!0,end:`\\s*=>`,contains:[{className:`params`,variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:`xml`,contains:[{begin:o.begin,end:o.end,skip:!0,contains:[`self`]}]}]},T,{beginKeywords:`while if switch catch for`},{begin:`\\b(?!function)`+e.UNDERSCORE_IDENT_RE+`\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{`,returnBegin:!0,label:`func.def`,contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:`title.function`})]},{match:/\.\.\./,relevance:0},k,{match:`\\$[A-Za-z$_][0-9A-Za-z$_]*`,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[x]},O,E,S,A,{match:/\$[(.]/}]}}function lr(e){let t=e.regex,n=cr(e),r=er,i=[`any`,`void`,`number`,`boolean`,`string`,`object`,`never`,`symbol`,`bigint`,`unknown`],a={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:`keyword`,3:`title.class`}},o={beginKeywords:`interface`,end:/\{/,excludeEnd:!0,keywords:{keyword:`interface extends`,built_in:i},contains:[n.exports.CLASS_REFERENCE]},s={className:`meta`,relevance:10,begin:/^\s*['"]use strict['"]/},c={$pattern:er,keyword:tr.concat([`type`,`interface`,`public`,`private`,`protected`,`implements`,`declare`,`abstract`,`readonly`,`enum`,`override`,`satisfies`]),literal:nr,built_in:sr.concat(i),"variable.language":or},l={className:`meta`,begin:`@[A-Za-z$_][0-9A-Za-z$_]*`},u=(e,t,n)=>{let r=e.contains.findIndex(e=>e.label===t);if(r===-1)throw Error(`can not find mode to replace`);e.contains.splice(r,1,n)};Object.assign(n.keywords,c),n.exports.PARAMS_CONTAINS.push(l);let d=n.contains.find(e=>e.scope===`attr`),f=Object.assign({},d,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,d,f]),n.contains=n.contains.concat([l,a,o,f]),u(n,`shebang`,e.SHEBANG()),u(n,`use_strict`,s);let p=n.contains.find(e=>e.label===`func.def`);return p.relevance=0,Object.assign(n,{name:`TypeScript`,aliases:[`ts`,`tsx`,`mts`,`cts`]}),n}function ur(e){let t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:`symbol`,begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{className:`keyword`,begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(a,{begin:/\(/,end:/\)/}),s=e.inherit(e.APOS_STRING_MODE,{className:`string`}),c=e.inherit(e.QUOTE_STRING_MODE,{className:`string`}),l={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:`attr`,begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:`string`,endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:`HTML, XML`,aliases:[`html`,`xhtml`,`rss`,`atom`,`xjb`,`xsd`,`xsl`,`plist`,`wsf`,`svg`],case_insensitive:!0,unicodeRegex:!0,contains:[{className:`meta`,begin:/<![a-z]/,end:/>/,relevance:10,contains:[a,c,s,o,{begin:/\[/,end:/\]/,contains:[{className:`meta`,begin:/<![a-z]/,end:/>/,contains:[a,o,c,s]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:`meta`,end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:`tag`,begin:/<style(?=\s|>)/,end:/>/,keywords:{name:`style`},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:[`css`,`xml`]}},{className:`tag`,begin:/<script(?=\s|>)/,end:/>/,keywords:{name:`script`},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:[`javascript`,`handlebars`,`xml`]}},{className:`tag`,begin:/<>|<\/>/},{className:`tag`,begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:`name`,begin:n,relevance:0,starts:l}]},{className:`tag`,begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:`name`,begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function dr(e){let t=`true false yes no null`,n={className:`attr`,variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},r={className:`template-variable`,variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},i={className:`string`,relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:`char.escape`,relevance:0}]},a={className:`string`,relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,r]},o=e.inherit(a,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),s={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`},c={end:`,`,endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},l={begin:/\{/,end:/\}/,contains:[c],illegal:`\\n`,relevance:0},u={begin:`\\[`,end:`\\]`,contains:[c],illegal:`\\n`,relevance:0},d=[n,{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+![\\w#;/?:@&=+$,.~*'()[\\]]+`},{className:`type`,begin:`!<[\\w#;/?:@&=+$,.~*'()[\\]]+>`},{className:`type`,begin:`![\\w#;/?:@&=+$,.~*'()[\\]]+`},{className:`type`,begin:`!![\\w#;/?:@&=+$,.~*'()[\\]]+`},{className:`meta`,begin:`&`+e.UNDERSCORE_IDENT_RE+`$`},{className:`meta`,begin:`\\*`+e.UNDERSCORE_IDENT_RE+`$`},{className:`bullet`,begin:`-(?=[ ]|$)`,relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},s,{className:`number`,begin:e.C_NUMBER_RE+`\\b`,relevance:0},l,u,i,a],f=[...d];return f.pop(),f.push(o),c.contains=f,{name:`YAML`,case_insensitive:!0,aliases:[`yml`],contains:d}}var fr={bash:Cn,sh:Cn,shell:Cn,css:Mn,go:Nn,golang:Nn,java:zn,javascript:Jn,js:Jn,json:Yn,markdown:Xn,md:Xn,python:Zn,py:Zn,rust:Qn,rs:Qn,sql:$n,typescript:lr,ts:lr,xml:ur,html:ur,yaml:dr,yml:dr};for(let[e,t]of Object.entries(fr))J.registerLanguage(e,t);function pr(e){let t=e.split(`
15
+ `);return/^(`{3,}|~{3,})/.test(t[0]??``)&&t.shift(),/^(`{3,}|~{3,})\s*$/.test(t[t.length-1]??``)&&t.pop(),t.join(`
16
+ `).replace(/\n+$/,``)}function mr(e){let t=(/^(`{3,}|~{3,})([^\s`~]*)/.exec(e.split(`
17
+ `)[0]??``)?.[2]??``).toLowerCase();return t&&fr[t]?t:``}function hr(e,t){let n=t&&fr[t]?t:``;try{return n?J.highlight(e,{language:n,ignoreIllegals:!0}).value:J.highlightAuto(e).value}catch{return _r(e)}}function gr(e){return e.split(`
18
+ `).filter(e=>e.trim().length>0).filter(e=>!/^\s*\|?\s*(:?-+:?\s*\|\s*)+(:?-+:?)(\s*\|)?\s*$/.test(e)).map(e=>e.replace(/^\s*\|/,``).replace(/\|\s*$/,``).split(`|`).map(e=>e.trim()))}function _r(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`)}function vr(e,t,n){if(e.length<=1)return e.slice();let[r,...i]=e,a=i.map(e=>e[t]??``),o=a.length>0&&a.every(e=>e.trim()!==``&&!Number.isNaN(Number(e))),s=n===`asc`?1:-1;return[r,...i.slice().sort((e,n)=>{let r=e[t]??``,i=n[t]??``;return o?(Number(r)-Number(i))*s:r.localeCompare(i,`zh-Hans-CN`,{numeric:!0})*s})]}var yr=[`viewBox`,`width`,`height`],br={class:`zm-edges`},xr=[`d`,`fill`],Sr=[`data-node-id`,`onClick`,`onPointerdown`,`onDblclick`,`onContextmenu`,`onMouseenter`,`onMouseleave`],Cr=[`src`,`width`,`height`,`alt`],wr=[`onDblclick`],Tr={key:0,class:`zm-rich-code`},Er=[`innerHTML`],Dr={key:1,class:`zm-rich-table`},Or=[`onClick`],kr={class:`zm-rich-sort-mark`,"aria-hidden":`true`},Ar={key:2,class:`zm-text`},jr={class:`zm-text-label`},Mr=[`href`,`title`],Nr=[`title`,`onClick`],Pr=[`title`],Fr=[`title`,`onClick`],Ir=[`onClick`],Lr=[`onMousedown`],Rr=[`onClick`],zr=[`title`],Br={class:`zm-tb-tip zm-tb-zoom`},Vr=[`src`],Hr=[`src`],Ur=24,Wr=400,Gr=160,Kr=4,qr=s({__name:`MindMap`,props:{data:{},theme:{},previewMode:{type:Boolean,default:!1},markdown:{},lineColors:{},hideCanvasActions:{type:Boolean,default:!1}},emits:[`change`,`select`,`edit-note`,`markdownChange`,`canvas-toggle-preview`,`canvas-outline`,`canvas-settings`,`canvas-data`,`canvas-import`],setup(n,{expose:o,emit:s}){let c=n,u=s,w=T(null),E=T(null),k=T(``),j=T(new Set),M=b(()=>j.value.values().next().value??null),N=T(new Set),P=T(!1),ee=T(null),te=T(0),ie=T(0),I=T(null),ae=T(null),L=T(null),oe=T(``),R=T(new Map),z=T(Le(c.data)),se=T({}),ce=T({}),le=T(c.markdown!==void 0),ue=!1;r(()=>c.markdown,e=>{if(e===void 0){le.value=!1;return}le.value=!0;let t=Ye(e||``);ue=!0,z.value=Le(t),j.value=new Set,N.value=new Set,G(),a(()=>{ue=!1,qn()})}),r(z,()=>{le.value&&!ue&&u(`markdownChange`,Xe(z.value))},{deep:!0});let de=b(()=>K.showOrderBadge===!0),fe=T(new Map),pe=fe.value;function me(e,t){let n={};t.bg&&(n.bg=t.bg),t.textColor&&(n.textColor=t.textColor),t.borderColor&&(n.borderColor=t.borderColor),t.fontWeight&&(n.fontWeight=t.fontWeight),Object.keys(n).length===0?pe.delete(e):pe.set(e,n),fe.value=new Map(pe)}function he(e){return pe.get(e)??{}}function ge(e,t){let n=H(z.value,e);n&&(n.image={src:t.src,naturalW:t.naturalW,naturalH:t.naturalH,width:ye(t.width,Ur,Wr),height:ye(t.height,Ur,Wr)},W(),G(),u(`change`,z.value))}function _e(e){let t=H(z.value,e);!t||!t.image||(delete t.image,W(),G(),u(`change`,z.value))}function ve(e,t){let n=t.trim();if(!H(z.value,e))return;if(!n){_e(e);return}let r=new Image;r.onload=()=>{let t=H(z.value,e);if(!t)return;let i=r.naturalWidth&&r.naturalHeight?r.naturalWidth/r.naturalHeight:1,a=ye(r.naturalWidth||Gr,Ur,Wr),o=Math.round(a/i);t.image={src:n,naturalW:r.naturalWidth||a,naturalH:r.naturalHeight||o,width:a,height:o},W(),G(),u(`change`,z.value)},r.onerror=()=>{},r.src=n}function ye(e,t,n){return Math.min(n,Math.max(t,e))}function be(e,t){let n=new FileReader;n.onload=()=>{if(typeof n.result!=`string`)return;let e=n.result,r=new window.Image;r.onload=()=>{let n=r.naturalWidth||Gr,i=r.naturalHeight||Gr,a=ye(n,Ur,Gr);t({src:e,naturalW:n,naturalH:i,width:a,height:ye(Math.round(i*a/n),Ur,Wr)})},r.onerror=()=>{t({src:e,naturalW:Gr,naturalH:Gr,width:Gr,height:Gr})},r.src=e},n.readAsDataURL(e)}function xe(e){let t=document.createElement(`input`);t.type=`file`,t.accept=`image/*`,t.style.display=`none`,t.onchange=()=>{let n=t.files?.[0];n&&(be(n,t=>ge(e,t)),document.body.removeChild(t))},document.body.appendChild(t),t.click()}function Se(e,t){let n=t.trim(),r=H(z.value,e);r&&(n?r.link={url:n}:delete r.link,W(),G(),u(`change`,z.value))}function Ce(e){Se(e,``)}function we(e,t){let n=H(z.value,e);n&&(t?n.note={text:t}:delete n.note,W(),G(),u(`change`,z.value))}function Ee(e){we(e,``)}function B(e,t){let n=H(z.value,e);n&&(t?n.richContent=t:delete n.richContent,W(),G(),u(`change`,z.value))}let V=T(null),De=T(null),Oe=b(()=>[`zm-canvas-fab`,`zm-canvas-fab-preview`,!c.hideCanvasActions&&(!c.previewMode||P.value)?`is-visible`:``].filter(Boolean).join(` `)),ke=b(()=>[`zm-canvas-fab`,`zm-canvas-fab-outline`,!c.hideCanvasActions&&(!c.previewMode||P.value)?`is-visible`:``].filter(Boolean).join(` `));function Me(e,t){c.previewMode||(e.preventDefault(),e.stopPropagation(),De.value=null,j.value=new Set([t.id]),J(),V.value={nodeId:t.id,x:e.clientX,y:e.clientY})}function Ne(){V.value=null}function Pe(e){let t=e.target;if(!(t!=null&&t.closest(`.zm-toolbar, button, input, textarea, .zm-canvas-fab-preview, .zm-canvas-fab-outline`))){if(Rn&&q.panMoved.value){Rn=!1,e.preventDefault();return}e.preventDefault(),V.value&&=null,De.value={x:e.clientX,y:e.clientY}}}function Fe(){De.value=null}function Ie(){Fe(),u(`canvas-settings`)}function U(){Fe(),u(`canvas-data`)}function Ze(e){Fe(),u(`canvas-import`,e)}function Qe(){let e=V.value?.nodeId;e&&xe(e)}function et(){let e=V.value?.nodeId;if(!e)return;let t=H(z.value,e)?.link?.url??``,n=window.prompt(`输入链接 URL(留空取消)`,t);n!==null&&Se(e,n)}function tt(){let e=V.value?.nodeId;e&&Ce(e)}function ot(){let e=V.value?.nodeId;e&&pt(e)}function st(){let e=V.value?.nodeId;e&&Ee(e)}function ct(){let e=V.value?.nodeId;e&&_e(e)}function lt(){let e=V.value?.nodeId;if(!e)return;let t=H(z.value,e)?.richContent,n=t?.kind===`code`?pr(t.raw):``,r=t?.kind===`code`&&t.lang||``,i=r?"```"+r+`
19
+ `:"```\n",a=window.prompt("输入代码块内容(用 ```lang 包裹;留空取消)",n?i+n+(n.endsWith("```")?``:"\n```"):i+"// 你的代码\n```");if(a===null)return;let o=a.trim();if(!o){B(e,null);return}let s=/^```([^\s`]*)/.exec(o);B(e,{kind:`code`,raw:o,lang:s?s[1]:void 0})}function ut(){let e=V.value?.nodeId;e&&B(e,null)}function dt(){let e=V.value?.nodeId;if(!e)return;let t=H(z.value,e)?.richContent,n=t?.kind===`table`?t.raw:``,r=window.prompt(`输入 markdown 表格(每行以 | 分隔;留空取消)`,n||`| 列1 | 列2 | 列3 |
20
+ | --- | --- | --- |
21
+ | a | b | c |`);if(r===null)return;let i=r.trim();if(!i){B(e,null);return}B(e,{kind:`table`,raw:i})}function ft(){let e=V.value?.nodeId;e&&B(e,null)}function pt(e){c.previewMode||u(`edit-note`,e)}function mt(e,t=60){let n=e.replace(/\s+/g,` `).trim();return n.length<=t?n||`点击编辑笔记`:n.slice(0,t)+`…`}function ht(e){if(c.previewMode||E.value)return;let t=e.target;if(t&&(t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.isContentEditable))return;let n=M.value;if(!n)return;let r=e.clipboardData?.items;if(r)for(let t=0;t<r.length;t++){let i=r[t];if(i.kind===`file`&&i.type.startsWith(`image/`)){let t=i.getAsFile();if(!t)continue;e.preventDefault();let r=H(z.value,n);if(r!=null&&r.image&&!window.confirm(`该节点已有图片,要用剪贴板里的图片替换吗?`))return;be(t,e=>ge(n,e));return}}}i(()=>{window.addEventListener(`paste`,ht),G()}),t(()=>{window.removeEventListener(`paste`,ht)});let gt=T(null),_t=b(()=>gt.value?.nodeId??null);function vt(e,t){if(!t.image)return;e.preventDefault(),e.stopPropagation();let n=t.image.naturalW||t.image.width,r=t.image.naturalH||t.image.height,i=r>0?r/n:1;gt.value={nodeId:t.id,startX:e.clientX,startY:e.clientY,startW:t.image.width,startH:t.image.height,naturalW:n,naturalH:r,ratio:i,pendingW:t.image.width,pendingH:t.image.height},window.addEventListener(`mousemove`,yt),window.addEventListener(`mouseup`,bt)}function yt(e){let t=gt.value;if(!t)return;let n=q.scale.value||1,r=e.clientX-t.startX,i=ye(t.startW+r/n,Ur,Wr),a=ye(i*t.ratio,Ur,Wr);t.pendingW=i,t.pendingH=a;let o=w.value?.querySelector(`[data-node-id="${t.nodeId}"] .zm-node-img`);o&&(o.style.width=`${i}px`,o.style.height=`${a}px`);let s=w.value?.querySelector(`[data-node-id="${t.nodeId}"]`);s&&(s.style.minWidth=`${Math.max(80,Math.ceil(i+28))}px`,s.style.height=`${Math.ceil(a+8+30)}px`)}function bt(){let e=gt.value;if(window.removeEventListener(`mousemove`,yt),window.removeEventListener(`mouseup`,bt),gt.value=null,!e)return;let t=H(z.value,e.nodeId);!t||!t.image||(ge(e.nodeId,{src:t.image.src,naturalW:t.image.naturalW,naturalH:t.image.naturalH,width:e.pendingW,height:e.pendingH}),j.value=new Set([e.nodeId]),J(),St=!0)}let xt=T(null),St=!1;function Ct(e){xt.value=e}function wt(e){xt.value===e&&(xt.value=null),ae.value&&=null}function Tt(e,t){if(!t.text||t.text.length<14)return;let n=e.currentTarget.getBoundingClientRect(),r=w.value?.getBoundingClientRect();if(!r)return;let i=n.top-r.top>60,a=n.left-r.left+n.width/2,o=r.width-240/2-10,s=Math.max(130,Math.min(a,o)),c=i?n.top-r.top-8:n.bottom-r.top+8;ae.value={text:t.text,x:s,y:c,above:i}}let Et=T(0),Dt=T(!1),Ot=rt(100);function W(){Ot.record({data:z.value,selectedIds:[...j.value]})}function G(){N.value=new Set(N.value),Et.value++,a().then(()=>a()).then(()=>kt()).then(()=>{Et.value++})}function kt(){let e=document.querySelectorAll(`.zm-rich`),t={},n={};e.forEach(e=>{let r=e,i=null;for(;r&&!i;)i=r.getAttribute(`data-node-id`),r=r.parentElement;if(!i)return;let a=e.offsetHeight,o=e.scrollWidth,s=Math.round(a*2)/2,c=Math.round(o*2)/2;t[i]=s,n[i]=c,se.value[i],ce.value[i]}),se.value=t,ce.value=n}let At=b(()=>({rootBg:c.theme?.rootBg??`#1f2937`,rootText:c.theme?.rootText??`#ffffff`,branchBg:c.theme?.branchBg??`#ffffff`,branchText:c.theme?.branchText??`#1f2937`,lineColor:c.theme?.lineColor??`#94a3b8`,bgColor:c.theme?.bgColor??`#f8fafc`,fontSize:c.theme?.fontSize??14,lineWidthStart:c.theme?.lineWidthStart??2.2,lineWidthEnd:c.theme?.lineWidthEnd??.8,rainbowBranch:c.theme?.rainbowBranch??!1})),K=m({autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:3.6,rainbowBranch:!0,branchPaletteId:`default`,customPalettes:[],lineStyle:`curve`,layoutMode:`mindmap`,taperedEdge:!0,showOrderBadge:!1});function jt(e){return K.taperedEdge?Nt(e):Pt(e)}function Mt(e){return K.taperedEdge?K.lineWidthEnd:Pt(e)}function Nt(e){return e<=0?K.lineWidthStart:e===1?Math.max(1.5,K.lineWidthStart*.67):e===2?Math.max(.8,K.lineWidthStart*.42):K.lineWidthEnd}function Pt(e){if(e<=0)return K.lineWidthStart;if(e>=3)return K.lineWidthEnd;let t=e/3;return K.lineWidthStart+(K.lineWidthEnd-K.lineWidthStart)*t}function Ft(e,t,n,r){let i=1-e;return{x:i*i*i*t.x+3*i*i*e*n.x1+3*i*e*e*n.x2+e*e*e*r.x,y:i*i*i*t.y+3*i*i*e*n.y1+3*i*e*e*n.y2+e*e*e*r.y}}function It(e,t,n,r,i=32,a=`curve`,o=`right`){if(a===`curve`){let a;if(o===`right`||o===`left`){let n=Math.abs(t.x-e.x)*.45,r=o===`right`?1:-1;a={x1:e.x+r*n,y1:e.y,x2:t.x-r*n,y2:t.y}}else{let n=Math.abs(t.y-e.y)*.45;a={x1:e.x,y1:e.y+n,x2:t.x,y2:t.y-n}}let s=n=>{let r=1-n;return{dx:-3*r*r*e.x+3*(r*r-2*r*n)*a.x1+3*(2*r*n-n*n)*a.x2+3*n*n*t.x,dy:-3*r*r*e.y+3*(r*r-2*r*n)*a.y1+3*(2*r*n-n*n)*a.y2+3*n*n*t.y}},c=[],l=[];for(let o=0;o<=i;o++){let u=o/i,d=o===0?e:o===i?t:Ft(u,e,a,t),f=s(u),p=Math.hypot(f.dx,f.dy);p<1e-6&&(p=1);let m=-f.dy/p,h=f.dx/p,g=(n+(r-n)*u)/2;c.push({x:d.x+m*g,y:d.y+h*g}),l.push({x:d.x-m*g,y:d.y-h*g})}let u=`M ${c[0].x.toFixed(2)} ${c[0].y.toFixed(2)}`;for(let e=1;e<=i;e++)u+=` L ${c[e].x.toFixed(2)} ${c[e].y.toFixed(2)}`;for(let e=i;e>=0;e--)u+=` L ${l[e].x.toFixed(2)} ${l[e].y.toFixed(2)}`;return u+=` Z`,u}let s=t.x-e.x,c=t.y-e.y,l=Math.hypot(s,c);l<1e-6&&(l=1);let u=-c/l,d=s/l,f=n/2,p=r/2,m={x:e.x+u*f,y:e.y+d*f},h={x:e.x-u*f,y:e.y-d*f},g={x:t.x-u*p,y:t.y-d*p},_={x:t.x+u*p,y:t.y+d*p};return`M ${m.x.toFixed(2)} ${m.y.toFixed(2)} L ${_.x.toFixed(2)} ${_.y.toFixed(2)} L ${g.x.toFixed(2)} ${g.y.toFixed(2)} L ${h.x.toFixed(2)} ${h.y.toFixed(2)} Z`}let Lt=b(()=>Jt.value.root.children),Rt=Ae[0].colors,zt=b(()=>je(K.branchPaletteId,K.customPalettes)),Bt=b(()=>{let e=new Map;if(!K.rainbowBranch)return e;let t=c.lineColors,n=t&&t.length>0?t:zt.value.colors.length>0?zt.value.colors:Rt;for(let t=0;t<Lt.value.length;t++){let r=Lt.value[t];e.set(r.id,n[t%n.length])}let r=(t,n)=>{e.set(t.id,n);for(let e of t.children)r(e,n)};for(let e=0;e<Lt.value.length;e++){let t=Lt.value[e];r(t,n[e%n.length])}return e});function Vt(e,t){return K.rainbowBranch?Bt.value.get(t.id)??At.value.lineColor:At.value.lineColor}function Ht(e){let t=he(e.id);if(t.bg)return t.bg;if(e.isRoot)return At.value.rootBg;if(K.rainbowBranch){let t=Bt.value.get(e.id);if(t)return Kt(t,.18)}return At.value.branchBg}function Ut(e){let t=he(e.id);if(t.textColor)return t.textColor;if(e.isRoot)return At.value.rootText;if(K.rainbowBranch){let t=Bt.value.get(e.id);if(t)return qt(t,.55)}return At.value.branchText}function Wt(e){let t=he(e.id);if(t.borderColor)return t.borderColor;if(e.isRoot)return At.value.rootBg;if(K.rainbowBranch){let t=Bt.value.get(e.id);if(t)return qt(t,.3)}return At.value.lineColor}function Gt(e){return he(e.id).fontWeight??(e.isRoot?600:400)}function Kt(e,t){let n=e.replace(`#`,``),r=n.length===6?n:n.split(``).map(e=>e+e).join(``);return`rgba(${parseInt(r.slice(0,2),16)}, ${parseInt(r.slice(2,4),16)}, ${parseInt(r.slice(4,6),16)}, ${t})`}function qt(e,t){let n=e.replace(`#`,``),r=n.length===6?n:n.split(``).map(e=>e+e).join(``);return`rgb(${Math.round(parseInt(r.slice(0,2),16)*(1-t))}, ${Math.round(parseInt(r.slice(2,4),16)*(1-t))}, ${Math.round(parseInt(r.slice(4,6),16)*(1-t))})`}let q=$e({getContainer:()=>w.value});q.setOnMarqueeEnd(Vn),nt({isEditing:()=>E.value!==null,isReadonly:()=>c.previewMode,getSelectedId:()=>M.value,getSelectedIds:()=>[...j.value],defaultTargetId:()=>z.value.id,onAddChild:fn,onAddSibling:pn,onAddSiblingBefore:mn,onRemove:wn,onStartEdit:en,onClearSelection:()=>{j.value=new Set,J()},onDuplicate:hn,onCopy:vn,onCut:yn,onPaste:bn,hasClipboard:()=>!!I.value&&I.value.nodes.length>0,onUndo:xn,onRedo:Sn,onNavigate:Cn,onSelectRoot:()=>{j.value=new Set([z.value.id]),J()}});let Jt=b(()=>{let e=Le(z.value);return $t(e),Te(e,{mode:K.layoutMode,baseFontSize:At.value.fontSize,richHeights:se.value,richWidths:ce.value})}),Yt=T([]),Xt=b(()=>(Et.value,Yt.value));r(Jt,e=>{let t=[],n=e=>{t.push(e);for(let t of e.children)n(t)};n(e.root),Yt.value=t},{immediate:!0});let Zt=b(()=>{let e=[];for(let t of Xt.value)for(let n of t.children)e.push({from:t,to:n,key:`${t.id}->${n.id}`});return e}),Qt=b(()=>`${Jt.value.vbX} ${Jt.value.vbY} ${Jt.value.vbW} ${Jt.value.vbH}`);function $t(e){if(N.value.has(e.id)){e.children=[],e.collapsed=!0;return}e.collapsed=!1;for(let t of e.children)$t(t)}function en(e){let t=H(z.value,e);t&&(E.value=e,k.value=t.text,a(()=>{let e=document.querySelector(`.zm-input`);e?.focus(),e?.select()}))}function tn(){if(!E.value)return;let e=H(z.value,E.value);e&&e.text!==(k.value.trim()||` `)&&(e.text=k.value.trim()||` `,W(),u(`change`,z.value)),E.value=null}function nn(){E.value=null}function rn(e){if(c.previewMode)return;let t=H(z.value,e);t!=null&&t.richContent&&(L.value=e,oe.value=t.richContent.raw,a(()=>{document.querySelector(`.zm-node .zm-rich textarea`)?.focus()}))}function an(){if(!L.value)return;let e=L.value,t=H(z.value,e),n=oe.value;t&&t.richContent&&t.richContent.raw!==n&&(t.richContent.kind===`code`?B(e,{kind:`code`,raw:n,lang:mr(n)||void 0}):B(e,{kind:`table`,raw:n})),L.value=null}function on(){L.value=null}function sn(e){e.key===`Escape`?(e.preventDefault(),on()):e.key===`Enter`&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),an())}function cn(e,t){let n=R.value.get(e);!n||n.col!==t?R.value.set(e,{col:t,dir:`asc`}):n.dir===`asc`?R.value.set(e,{col:t,dir:`desc`}):R.value.delete(e)}function ln(e,t){let n=R.value.get(e);return!n||t.length<=1?t:vr(t,n.col,n.dir)}function un(e,t){let n=R.value.get(e);return!n||n.col!==t?`↕`:n.dir===`asc`?`▲`:`▼`}function dn(e){let t=e.metaKey||e.ctrlKey;t&&(e.key===`z`||e.key===`Z`)&&!e.shiftKey?(e.preventDefault(),xn()):(t&&e.shiftKey&&(e.key===`z`||e.key===`Z`)||t&&(e.key===`y`||e.key===`Y`)&&!e.shiftKey)&&(e.preventDefault(),Sn())}function fn(e){let t=He(z.value,e,Je);t&&(W(),G(),u(`change`,z.value),a(()=>en(t.id)))}function pn(e){if(e===z.value.id){fn(e);return}let t=Ue(z.value,e,Je);t&&(W(),G(),u(`change`,z.value),a(()=>en(t.id)))}function mn(e){if(e===z.value.id){fn(e);return}let t=We(z.value,e,Je);t&&(W(),G(),u(`change`,z.value),a(()=>en(t.id)))}function hn(e){if(e===z.value.id)return;let t=Ge(z.value,e);t&&(W(),j.value=new Set([t.id]),J(),u(`change`,z.value),G())}function gn(e){let t=[],n=new Set;for(let r of e)r!==z.value.id&&(n.has(r)||H(z.value,r)&&(n.add(r),t.push(r)));return t}function _n(e){let t=new Set(e),n=[],r=e=>{t.has(e.id)&&n.push(e.id);for(let t of e.children)r(t)};return r(z.value),n}function vn(e){let t=_n(gn(e));if(t.length===0)return;let n=[];for(let e of t){let t=qe(z.value,e);t&&n.push(t)}n.length!==0&&(I.value={nodes:n,originalIds:new Set(t)},G())}function yn(e){let t=_n(gn(e));if(t.length===0)return;let n=[];for(let e of t){let t=qe(z.value,e);t&&n.push(t)}if(n.length!==0){W();for(let e of t)ze(z.value,e);j.value=new Set,J(),I.value={nodes:n,originalIds:new Set(t)},G(),u(`change`,z.value)}}function bn(e){let t=I.value;if(!t||t.nodes.length===0)return;let n=e??z.value.id,r=H(z.value,n);if(r){for(let e of t.originalIds){let t=H(z.value,e);if(t&&H(t,n))return}W();for(let e of t.nodes){let t=Le(e);Ke(t),r.children.push(t)}I.value=null,G(),u(`change`,z.value)}}function xn(){let e=Ot.undo();e&&(z.value=e.data,j.value=new Set(e.selectedIds??[]),J(),G(),u(`change`,z.value))}function Sn(){let e=Ot.redo();e&&(z.value=e.data,j.value=new Set(e.selectedIds??[]),J(),G(),u(`change`,z.value))}function J(){let e=[];for(let t of j.value){let n=H(z.value,t);n&&e.push(n)}u(`select`,e.length>0?e:null)}function Cn(e,t){let n=M.value??z.value.id,r=H(z.value,n);if(!r)return;let i=null;if(t===1){let e=Re(z.value,r.id);if(e){let t=e.children.findIndex(e=>e.id===r.id);t>=0&&t<e.children.length-1&&(i=e.children[t+1].id)}}else if(t===-1){let e=Re(z.value,r.id);if(e){let t=e.children.findIndex(e=>e.id===r.id);t>0&&(i=e.children[t-1].id)}}else if(e===1){let e=Re(z.value,r.id);e&&(i=e.id)}else e===-1&&r.children.length>0&&(i=r.children[0].id);i&&(j.value=new Set([i]),J())}function wn(e){if(e!==z.value.id&&ze(z.value,e)){if(W(),j.value.has(e)){let t=new Set(j.value);t.delete(e),j.value=t,J()}G(),u(`change`,z.value)}}function Tn(e){N.value.has(e)?N.value.delete(e):N.value.add(e),G()}function En(e){let t=[{n:z.value,depth:1}];for(;t.length;){let{n,depth:r}=t.pop();e(n,r);for(let e=n.children.length-1;e>=0;e--)t.push({n:n.children[e],depth:r+1})}}function Dn(){N.value=new Set,En(e=>{e.children.length>0&&N.value.add(e.id)}),G()}function On(e){N.value=new Set,En((t,n)=>{n>e&&t.children.length>0&&N.value.add(t.id)}),G()}function kn(){N.value=new Set,G()}function An(e,t){Be(z.value,e,t)&&(W(),G(),u(`change`,z.value))}function jn(e,t,n){return Ve(z.value,e,t,n)?(W(),G(),u(`change`,z.value),!0):!1}function Mn(e,t){if(e.stopPropagation(),e.shiftKey){let e=new Set(j.value);e.has(t.id)?e.delete(t.id):e.add(t.id),j.value=e}else j.value=new Set([t.id]);J()}function Nn(e,t,n){let r=null;for(let i of Xt.value){if(i.id===n)continue;let a=i.width/2,o=i.height/2;e>=i.x-a&&e<=i.x+a&&t>=i.y-o&&t<=i.y+o&&(r=i)}return r}let Pn=null;function Fn(e,t){if(c.previewMode||t.isRoot||e.button!==0)return;let n=e.target;if(n!=null&&n.closest(`.zm-img-resize-handle`))return;e.stopPropagation();let r=w.value.getBoundingClientRect(),i=t.x*q.scale.value+q.offsetX.value,a=t.y*q.scale.value+q.offsetY.value,o=e.clientX-r.left-i,s=e.clientY-r.top-a;Pn={srcId:t.id,srcText:t.text,pointerOffsetX:o,pointerOffsetY:s,startX:e.clientX,startY:e.clientY},window.addEventListener(`pointermove`,In),window.addEventListener(`pointerup`,Ln),window.addEventListener(`pointercancel`,Ln)}function In(e){if(Pn){let t=e.clientX-Pn.startX,n=e.clientY-Pn.startY;if(Math.abs(t)<=Kr&&Math.abs(n)<=Kr)return;ee.value={srcId:Pn.srcId,srcText:Pn.srcText,pointerOffsetX:Pn.pointerOffsetX,pointerOffsetY:Pn.pointerOffsetY,currentTargetId:null},document.body.classList.add(`is-dragging`),Pn=null}let t=ee.value;if(!t)return;let n=w.value.getBoundingClientRect();te.value=e.clientX-n.left-t.pointerOffsetX,ie.value=e.clientY-n.top-t.pointerOffsetY,t.currentTargetId=Nn((e.clientX-n.left-q.offsetX.value)/q.scale.value,(e.clientY-n.top-q.offsetY.value)/q.scale.value,t.srcId)?.id??null}function Ln(e){if(window.removeEventListener(`pointermove`,In),window.removeEventListener(`pointerup`,Ln),window.removeEventListener(`pointercancel`,Ln),Pn){Pn=null;return}let t=ee.value;t&&(t.currentTargetId&&(jn(t.srcId,t.currentTargetId,`child`),j.value=new Set([t.srcId]),J()),ee.value=null,te.value=0,ie.value=0,document.body.classList.remove(`is-dragging`))}let Rn=!1;function zn(e){let t=e.target;if(!t||t.closest(`.zm-node, .zm-toolbar, button, input, textarea`))return;if(e.button===2){Rn=!0,q.startPan(e);return}if(Rn=!1,e.button!==0)return;let n=w.value.getBoundingClientRect(),r=(e.clientX-n.left-q.offsetX.value)/q.scale.value,i=(e.clientY-n.top-q.offsetY.value)/q.scale.value;q.startMarquee(r,i,{shift:e.shiftKey})}function Bn(e){if(St){St=!1;return}let t=e.target;if(!t||t.closest(`.zm-node`))return;let n=q.marquee;n.width>=4||n.height>=4||j.value.size>0&&(j.value=new Set,J())}function Vn(){let e=q.marquee;if(e.width<4&&e.height<4)return;let t=e.x,n=e.y,r=e.x+e.width,i=e.y+e.height,a=[];for(let e of Xt.value){let o=e.width/2,s=e.height/2,c=e.x-o,l=e.x+o,u=e.y-s,d=e.y+s;c<=r&&l>=t&&u<=i&&d>=n&&a.push(e.id)}j.value=e.shiftKey?new Set([...j.value,...a]):new Set(a),J()}function Hn(e){return N.value.has(e)}function Un(e){let t=H(z.value,e.id);return!!t&&t.children.length>0}function Wn(e){let t=H(z.value,e);return t?t.children.length:0}function Gn(e){if(!H(z.value,e))return 0;let t=[z.value];for(;t.length;){let n=t.pop(),r=n.children.findIndex(t=>t.id===e);if(r>=0)return r;for(let e of n.children)t.push(e)}return 0}function Kn(e,t,n,r){if((r?._dir??e._dir)===`down`)return t===`out`?{x:e.x,y:e.y+e.height/2}:{x:e.x,y:e.y-e.height/2};let i;i=t===`in`?-e.side:n===void 0?e.side:n;let a=t===`in`?e._richInsetX??0:0;return{x:e.x+i*(e.width/2-a),y:e.y}}function qn(){let e=Jt.value;q.resetView(e.width,e.height,e.root.y)}function Jn(){Dt.value=!0,W(),G(),a(()=>qn())}function Yn(e){K.layoutMode!==e&&(K.layoutMode=e,G(),a(()=>qn()))}function Xn(){return JSON.stringify(z.value,null,2)}function Zn(e){let t=H(z.value,e);return t?!!(t.note&&t.note.text||t.link&&t.link.url||t.image&&t.image.src||t.richContent&&t.richContent.raw):!1}function Qn(e){try{let t=JSON.parse(e);return!t.id||!Array.isArray(t.children)?!1:(Ot.reset(),z.value=Le(t),j.value=new Set,N.value=new Set,G(),a(()=>qn()),u(`change`,z.value),!0)}catch{return!1}}function $n(){let e=document.createElement(`input`);e.type=`file`,e.accept=`application/json`,e.onchange=()=>{let t=e.files?.[0];if(!t)return;let n=new FileReader;n.onload=()=>{typeof n.result==`string`&&(Qn(n.result)||alert(`导入失败:JSON 格式无效`))},n.readAsText(t)},e.click()}function er(){let e=new Blob([Xn()],{type:`application/json`}),t=URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=`${z.value.text||`mindmap`}.json`,n.click(),URL.revokeObjectURL(t)}return o({addChild:e=>fn(e),addSibling:e=>pn(e),removeNode:e=>wn(e),duplicateNode:e=>hn(e),setNodeText:(e,t)=>An(e,t),moveNode:(e,t,n)=>jn(e,t,n),lineWidthForDepth:jt,endWidthForDepth:Mt,getData:()=>z.value,nodeHasContent:e=>Zn(e),getSelectedIds:()=>[...j.value],copyNodes:e=>vn(e),cutNodes:e=>yn(e),pasteNodes:e=>bn(e),setData:e=>{Ot.reset(),z.value=Le(e),j.value=new Set,N.value=new Set,G(),W(),a(()=>qn())},resetView:()=>qn(),exportData:Xn,importData:Qn,getMarkdown:()=>Xe(z.value),setMarkdown:(e,t=!0)=>{let n=Ye(e||``);t&&(le.value=!0),ue=!t,Ot.reset(),z.value=Le(n),j.value=new Set,N.value=new Set,G(),W(),a(()=>{ue=!1,qn()}),u(`change`,z.value)},setBalanced:e=>{Dt.value=e},isBalanced:()=>Dt.value,balance:()=>Jn(),applyNodeStyle:(e,t)=>me(e,t),getNodeStyle:e=>he(e),applyNodeImage:(e,t)=>ge(e,t),applyNodeImageByUrl:(e,t)=>ve(e,t),removeNodeImage:e=>_e(e),applyNodeLink:(e,t)=>Se(e,t),removeNodeLink:e=>Ce(e),applyNodeNote:(e,t)=>we(e,t),removeNodeNote:e=>Ee(e),applyNodeRichContent:(e,t)=>B(e,t),undo:()=>xn(),redo:()=>Sn(),canUndo:()=>Ot.canUndo(),canRedo:()=>Ot.canRedo(),applySettings:e=>{e.autoBalanceOnChange!==void 0&&(K.autoBalanceOnChange=e.autoBalanceOnChange),e.lineWidthStart!==void 0&&(K.lineWidthStart=Math.max(.5,Math.min(20,e.lineWidthStart))),e.lineWidthEnd!==void 0&&(K.lineWidthEnd=Math.max(.3,Math.min(10,e.lineWidthEnd))),e.rainbowBranch!==void 0&&(K.rainbowBranch=e.rainbowBranch),e.branchPaletteId!==void 0&&(K.branchPaletteId=e.branchPaletteId),e.customPalettes!==void 0&&(K.customPalettes=e.customPalettes),e.lineStyle!==void 0&&(K.lineStyle=e.lineStyle),e.taperedEdge!==void 0&&(K.taperedEdge=e.taperedEdge),e.showOrderBadge!==void 0&&(K.showOrderBadge=e.showOrderBadge)},getSettings:()=>({autoBalanceOnChange:K.autoBalanceOnChange,lineWidthStart:K.lineWidthStart,lineWidthEnd:K.lineWidthEnd,rainbowBranch:K.rainbowBranch,branchPaletteId:K.branchPaletteId,customPalettes:K.customPalettes,lineStyle:K.lineStyle,layoutMode:K.layoutMode,taperedEdge:K.taperedEdge,showOrderBadge:K.showOrderBadge}),setBranchPalette:e=>{e&&[...Ae,...K.customPalettes].find(t=>t.id===e)&&(K.branchPaletteId=e)},getBranchPalette:()=>K.branchPaletteId,getBranchPalettes:()=>[...Ae,...K.customPalettes]}),r(()=>c.data,e=>{z.value=Le(e),G()},{deep:!1}),i(()=>{W(),a(()=>qn())}),(t,r)=>{var i,a,o;return A(),O(`div`,{class:`zm-mindmap`,style:_({background:At.value.bgColor,fontSize:At.value.fontSize+`px`})},[v(`div`,{ref_key:`wrapperRef`,ref:w,class:`zm-canvas`,onMousedown:zn,onContextmenu:Pe,onWheel:r[26]||=(...e)=>C(q).onWheel&&C(q).onWheel(...e),onMouseenter:r[27]||=e=>P.value=!0,onMouseleave:r[28]||=e=>P.value=!1,onClick:Bn},[v(`div`,{class:`zm-svg-layer`,style:_({left:Jt.value.vbX*C(q).scale.value+C(q).offsetX.value+`px`,top:Jt.value.vbY*C(q).scale.value+C(q).offsetY.value+`px`,width:Jt.value.vbW*C(q).scale.value+`px`,height:Jt.value.vbH*C(q).scale.value+`px`})},[(A(),O(`svg`,{class:`zm-svg`,viewBox:Qt.value,preserveAspectRatio:`xMinYMin meet`,width:Jt.value.vbW*C(q).scale.value,height:Jt.value.vbH*C(q).scale.value},[v(`g`,br,[(A(!0),O(D,null,l(Zt.value,e=>(A(),O(`path`,{key:e.key,d:It(Kn(e.from,`out`,e.to.side,e.to),Kn(e.to,`in`),jt(e.from.depth),Mt(e.to.depth),32,K.lineStyle,e.to._dir),fill:Vt(e.from,e.to),stroke:`none`},null,8,xr))),128))])],8,yr))],4),C(q).isMarquee.value?(A(),O(`div`,{key:0,class:`zm-marquee`,style:_({left:C(q).marquee.x*C(q).scale.value+C(q).offsetX.value+`px`,top:C(q).marquee.y*C(q).scale.value+C(q).offsetY.value+`px`,width:C(q).marquee.width*C(q).scale.value+`px`,height:C(q).marquee.height*C(q).scale.value+`px`})},null,4)):f(``,!0),ee.value?(A(),O(`div`,{key:1,class:`zm-drag-ghost`,style:_({left:te.value+`px`,top:ie.value+`px`,transform:`scale(${C(q).scale.value})`,transformOrigin:`top left`})},p(ee.value.srcText),5)):f(``,!0),v(`div`,{class:`zm-world`,style:_({transform:`translate(${C(q).offsetX.value}px, ${C(q).offsetY.value}px) scale(${C(q).scale.value})`})},[(A(!0),O(D,null,l(Xt.value,t=>(A(),O(`div`,{key:t.id,class:x([`zm-node`,{"is-root":t.isRoot,"is-selected":M.value===t.id,"is-selected-secondary":M.value!==t.id&&j.value.has(t.id),"is-editing":E.value===t.id,"has-image":!!t.image,"is-resizing":_t.value===t.id,"is-dragging-source":ee.value?.srcId===t.id,"is-drop-target":ee.value?.currentTargetId===t.id}]),"data-node-id":t.id,style:_({left:t.x+`px`,top:t.y+`px`,width:t.width+`px`,minWidth:t.width+`px`,height:t.height+`px`,fontSize:t.fontSize+`px`,background:Ht(t),color:Ut(t),borderColor:Wt(t),fontWeight:Gt(t),transform:`translate(-50%, -50%)`}),onClick:e=>Mn(e,t),onPointerdown:e=>Fn(e,t),onDblclick:e=>{e.stopPropagation(),n.previewMode||en(t.id)},onContextmenu:e=>Me(e,t),onMouseenter:e=>{Ct(t.id),Tt(e,t)},onMouseleave:e=>wt(t.id)},[t.image?(A(),O(`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,Cr)):f(``,!0),t.richContent&&(t.richContent.kind===`code`||t.richContent.kind===`table`)&&E.value!==t.id?(A(),O(`div`,{key:1,class:x([`zm-rich zm-rich-above`,{"zm-rich-no-overflow":t.richContent.kind===`table`||t.richContent.kind===`code`}]),onClick:r[1]||=y(()=>{},[`stop`]),onDblclick:y(e=>rn(t.id),[`stop`]),onMousedown:r[2]||=y(()=>{},[`stop`])},[L.value===t.id?d((A(),O(`textarea`,{key:0,"onUpdate:modelValue":r[0]||=e=>oe.value=e,class:`zm-rich-edit`,spellcheck:`false`,onBlur:an,onKeydown:sn},null,544)),[[S,oe.value]]):(A(),O(D,{key:1},[t.richContent.kind===`code`?(A(),O(`pre`,Tr,[v(`code`,{innerHTML:C(hr)(C(pr)(t.richContent.raw),C(mr)(t.richContent.raw))},null,8,Er)])):t.richContent.kind===`table`?(A(),O(`table`,Dr,[v(`tbody`,null,[(A(!0),O(D,null,l(ln(t.id,C(gr)(t.richContent.raw)),(e,n)=>(A(),O(`tr`,{key:n},[n===0?(A(!0),O(D,{key:0},l(e,(e,n)=>(A(),O(`th`,{key:`h${n}`,class:x([`zm-rich-table-sort`,{"is-sorted":R.value.get(t.id)?.col===n,"is-asc":R.value.get(t.id)?.col===n&&R.value.get(t.id)?.dir===`asc`,"is-desc":R.value.get(t.id)?.col===n&&R.value.get(t.id)?.dir===`desc`}]),onClick:y(e=>cn(t.id,n),[`stop`])},[v(`span`,null,p(e),1),v(`span`,kr,p(un(t.id,n)),1)],10,Or))),128)):(A(!0),O(D,{key:1},l(e,(e,t)=>(A(),O(`td`,{key:`c${t}`},p(e),1))),128))]))),128))])])):f(``,!0)],64))],42,wr)):f(``,!0),E.value===t.id?d((A(),O(`input`,{key:3,class:`zm-input`,"onUpdate:modelValue":r[6]||=e=>k.value=e,autofocus:``,onBlur:r[7]||=e=>tn(),onKeydown:[r[8]||=h(y(e=>tn(),[`exact`]),[`enter`]),r[9]||=h(y(e=>tn(),[`prevent`]),[`tab`]),h(nn,[`esc`]),dn],onMousedown:r[10]||=y(()=>{},[`stop`]),onClick:r[11]||=y(()=>{},[`stop`])},null,544)),[[S,k.value]]):(A(),O(`span`,Ar,[v(`span`,jr,p(t.text),1),t.link&&!E.value?(A(),O(`a`,{key:0,class:`zm-node-link`,href:t.link.url,target:`_blank`,rel:`noopener noreferrer`,title:`打开链接:${t.link.url}`,onClick:r[3]||=y(()=>{},[`stop`]),onMousedown:r[4]||=y(()=>{},[`stop`])},[e(F,{name:`link`,size:11,stroke:2})],40,Mr)):f(``,!0),t.note&&!E.value?(A(),O(`button`,{key:1,class:`zm-node-note-btn`,type:`button`,title:mt(t.note.text),onClick:y(e=>pt(t.id),[`stop`]),onMousedown:r[5]||=y(()=>{},[`stop`])},[e(F,{name:`note`,size:11,stroke:2})],40,Nr)):f(``,!0)])),de.value?(A(),O(`span`,{key:4,class:`zm-order-badge`,title:`数据顺序:第 ${Gn(t.id)+1} 个`},p(Gn(t.id)+1),9,Pr)):f(``,!0),Hn(t.id)&&Wn(t.id)>0?(A(),O(`span`,{key:5,class:x([`zm-collapse-badge`,{"is-on-left":t.side===-1}]),style:_({background:Bt.value.get(t.id)??`#64748b`}),title:`展开 ${Wn(t.id)} 个子节点`,onMousedown:r[12]||=y(()=>{},[`stop`]),onClick:y(e=>Tn(t.id),[`stop`])},p(Wn(t.id)),47,Fr)):f(``,!0),Un(t)&&!Hn(t.id)?(A(),O(`button`,{key:6,class:x([`zm-btn zm-collapse`,{"is-on-left":t.side===-1}]),style:_({color:Bt.value.get(t.id)??`#64748b`,borderColor:Bt.value.get(t.id)??`#64748b`}),title:`折叠`,onMousedown:r[13]||=y(()=>{},[`stop`]),onClick:y(e=>Tn(t.id),[`stop`])},[e(F,{name:`minus`,size:10,stroke:2.4})],46,Ir)):f(``,!0),t.image&&M.value===t.id&&E.value!==t.id?(A(),O(`span`,{key:7,class:`zm-img-resize-handle`,title:`拖动调整图片大小`,onMousedown:y(e=>vt(e,t),[`stop`])},null,40,Lr)):f(``,!0),t.image&&M.value===t.id&&E.value!==t.id?(A(),O(`button`,{key:8,class:`zm-img-remove-btn`,title:`移除图片`,onMousedown:r[14]||=y(()=>{},[`stop`]),onClick:y(e=>_e(t.id),[`stop`])},[e(F,{name:`x`,size:9,stroke:2.2})],40,Rr)):f(``,!0)],46,Sr))),128))],4),ae.value?(A(),O(`div`,{key:2,class:x([`zm-tooltip`,{"is-below":!ae.value.above}]),style:_({left:ae.value.x+`px`,top:ae.value.y+`px`})},p(ae.value.text),7)):f(``,!0),V.value?(A(),g(it,{key:3,x:V.value.x,y:V.value.y,container:w.value,"has-image":!!((i=C(H)(z.value,V.value.nodeId))!=null&&i.image),"has-link":!!((a=C(H)(z.value,V.value.nodeId))!=null&&a.link),"has-note":!!((o=C(H)(z.value,V.value.nodeId))!=null&&o.note),"has-code":C(H)(z.value,V.value.nodeId)?.richContent?.kind===`code`,"has-table":C(H)(z.value,V.value.nodeId)?.richContent?.kind===`table`,onPickImage:Qe,onRemoveImage:ct,onSetLink:et,onRemoveLink:tt,onEditNote:ot,onRemoveNote:st,onAddCode:lt,onEditCode:lt,onRemoveCode:ut,onAddTable:dt,onEditTable:dt,onRemoveTable:ft,onClose:Ne},null,8,[`x`,`y`,`container`,`has-image`,`has-link`,`has-note`,`has-code`,`has-table`])):f(``,!0),De.value?(A(),g(at,{key:4,x:De.value.x,y:De.value.y,container:w.value,onOpenSettings:Ie,onOpenData:U,onOpenImport:Ze,onClose:Fe},null,8,[`x`,`y`,`container`])):f(``,!0),v(`button`,{class:x(Oe.value),title:c.previewMode?`退出预览模式`:`进入预览模式`,onClick:r[15]||=e=>u(`canvas-toggle-preview`)},[e(F,{name:c.previewMode?`eye-off`:`eye`,size:16},null,8,[`name`])],10,zr),v(`button`,{class:x(ke.value),title:`显示大纲视图`,onClick:r[16]||=e=>u(`canvas-outline`)},[e(F,{name:`outline`,size:16})],2),v(`div`,{class:x([`zm-toolbar`,{"is-preview-only":c.previewMode,"is-hovered":P.value}])},[v(`span`,Br,p(Math.round(C(q).scale.value*100))+`%`,1),v(`button`,{class:`zm-tb-btn`,title:`放大`,onClick:r[17]||=(...e)=>C(q).zoomIn&&C(q).zoomIn(...e)},[e(F,{name:`zoom-in`})]),v(`button`,{class:`zm-tb-btn`,title:`缩小`,onClick:r[18]||=(...e)=>C(q).zoomOut&&C(q).zoomOut(...e)},[e(F,{name:`zoom-out`})]),v(`button`,{class:`zm-tb-btn`,title:`重置视图`,onClick:qn},[e(F,{name:`reset`})]),r[32]||=v(`span`,{class:`zm-tb-divider`},null,-1),v(`button`,{class:`zm-tb-btn`,title:`全部收起`,onClick:Dn},[e(F,{name:`collapse-all`})]),v(`button`,{class:`zm-tb-btn`,title:`展开一级`,onClick:r[19]||=e=>On(1)},[e(F,{name:`expand-level-1`})]),v(`button`,{class:`zm-tb-btn`,title:`展开二级`,onClick:r[20]||=e=>On(2)},[e(F,{name:`expand-level-2`})]),v(`button`,{class:`zm-tb-btn`,title:`全部展开`,onClick:kn},[e(F,{name:`expand-all`})]),r[33]||=v(`span`,{class:`zm-tb-divider`},null,-1),v(`button`,{class:`zm-tb-btn`,title:`导出 JSON`,onClick:er},[e(F,{name:`export`})]),c.previewMode?f(``,!0):(A(),O(D,{key:0},[r[29]||=v(`span`,{class:`zm-tb-divider`},null,-1),v(`button`,{class:`zm-tb-btn`,title:`添加子节点 (Tab)`,onClick:r[21]||=e=>M.value&&fn(M.value)},[v(`img`,{src:C(re),width:`14`,height:`14`,alt:`添加子节点`,draggable:`false`},null,8,Vr)]),v(`button`,{class:`zm-tb-btn`,title:`添加同级 (Enter)`,onClick:r[22]||=e=>M.value&&pn(M.value)},[v(`img`,{src:C(ne),width:`14`,height:`14`,alt:`添加同级`,draggable:`false`},null,8,Hr)]),r[30]||=v(`span`,{class:`zm-tb-divider`},null,-1),v(`button`,{class:x([`zm-tb-btn`,{active:K.layoutMode===`mindmap`}]),title:`思维导图布局 (中心辐射)`,onClick:r[23]||=e=>Yn(`mindmap`)},[e(F,{name:`mindmap`})],2),v(`button`,{class:x([`zm-tb-btn`,{active:K.layoutMode===`tree`}]),title:`树形布局 (向右展开)`,onClick:r[24]||=e=>Yn(`tree`)},[e(F,{name:`tree`})],2),v(`button`,{class:x([`zm-tb-btn`,{active:K.layoutMode===`org`}]),title:`组织结构布局 (向下展开)`,onClick:r[25]||=e=>Yn(`org`)},[e(F,{name:`org`})],2),r[31]||=v(`span`,{class:`zm-tb-divider`},null,-1),v(`button`,{class:`zm-tb-btn`,title:`导入 JSON`,onClick:$n},[e(F,{name:`import`})])],64))],2)],544)],4)}}}),Jr={class:`zm-outline-root`},Yr={class:`zm-outline-actions`},Xr={width:`11`,height:`11`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},Zr={key:0,x:`9`,y:`9`,width:`13`,height:`13`,rx:`2`},Qr={key:1,d:`M5 12 L10 17 L19 7`},$r={class:`zm-outline`},ei=[`onClick`,`onDblclick`,`onDragstart`,`onDragover`,`onDragleave`,`onDrop`],ti=[`title`,`onClick`],ni={width:`10`,height:`10`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`3`,"stroke-linecap":`round`,"stroke-linejoin":`round`},ri={key:0,points:`6 9 12 15 18 9`},ii={key:1,points:`9 6 15 12 9 18`},ai={key:1,class:`zm-outline-dot`},oi={class:`zm-outline-index`},si={key:3,class:`zm-outline-text`},ci=[`onClick`],li=[`src`],ui=[`onClick`],di=[`src`],fi=[`title`,`onClick`],pi={width:`11`,height:`11`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},mi={key:0,x:`9`,y:`9`,width:`13`,height:`13`,rx:`2`},hi={key:1,d:`M5 12 L10 17 L19 7`},gi=s({__name:`Outline`,props:{data:{},selectedId:{default:null},collapsedIds:{default:()=>new Set},readonly:{type:Boolean,default:!1}},emits:[`select`,`toggleCollapse`,`edit`,`addChild`,`addSibling`,`move`],setup(e,{emit:n}){let r=e,i=n,o=b(()=>{let e=[],t=(n,i,a)=>{let o=n.children.length>0,s=r.collapsedIds.has(n.id);e.push({id:n.id,text:n.text||`(无标题)`,depth:i,siblingIndex:a,hasChildren:o,collapsed:s,node:n}),o&&!s&&n.children.forEach((e,n)=>t(e,i+1,n))};return t(r.data,0,0),e}),s=T(null),c=T(``),u=null;function m(e){r.readonly||(s.value=e.id,c.value=e.text,a(()=>{u=document.querySelector(`.zm-outline-input`),u?.focus(),u?.select()}))}function h(){s.value!=null&&(i(`edit`,{id:s.value,text:c.value.trim()||`(无标题)`}),g())}function g(){s.value=null,c.value=``,u=null}function w(e){e.key===`Enter`?(e.preventDefault(),h()):e.key===`Escape`&&(e.preventDefault(),g())}t(g);let E=T(null),k=T(null),j=T(null);function M(e,t){if(r.readonly){e.preventDefault();return}E.value={id:t.id,text:t.text},e.dataTransfer&&(e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`text/plain`,t.id))}function N(){E.value=null,k.value=null,j.value=null}function P(e,t){if(!E.value)return;e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=`move`);let n=F(e);k.value=t.id,j.value=n}function ee(e){k.value===e.id&&(k.value=null,j.value=null)}function te(e,t){e.preventDefault();let n=E.value;if(!n)return;let r=F(e);n.id!==t.id&&i(`move`,{srcId:n.id,targetId:t.id,position:r}),N()}function F(e,t){let n=e.currentTarget.getBoundingClientRect(),r=e.clientY-n.top,i=n.height;return r<i*.3?`before`:r>i*.7?`after`:`child`}let ie=T(null),I=null;async function ae(e){try{return await navigator.clipboard.writeText(e),!0}catch{let t=document.createElement(`textarea`);t.value=e,document.body.appendChild(t),t.select();let n=!1;try{n=document.execCommand(`copy`)}finally{document.body.removeChild(t)}return n}}async function L(e,t,n){e.stopPropagation(),await ae(t)&&(ie.value=n,I&&clearTimeout(I),I=setTimeout(()=>ie.value=null,1200))}let oe=b(()=>{let e=[],t=(n,r)=>{let i=` `.repeat(r),a=r===0?``:`- `;e.push(i+a+(n.text||``));for(let e of n.children)t(e,r+1)};return t(r.data,0),e.join(`
22
+ `)}),R=T(!1),z=null;async function se(){await ae(oe.value)&&(R.value=!0,z&&clearTimeout(z),z=setTimeout(()=>R.value=!1,1200))}return(t,n)=>(A(),O(`div`,Jr,[v(`div`,Yr,[v(`button`,{class:x([`zm-outline-action-btn`,{"is-success":R.value}]),title:`复制完整大纲为纯文本`,onClick:se},[(A(),O(`svg`,Xr,[R.value?(A(),O(`path`,Qr)):(A(),O(`rect`,Zr)),n[2]||=v(`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)])),v(`span`,null,p(R.value?`已复制`:`复制大纲`),1)],2)]),v(`ul`,$r,[(A(!0),O(D,null,l(o.value,t=>(A(),O(`li`,{key:t.id,class:x([`zm-outline-row`,{"is-selected":t.id===e.selectedId,"is-root":t.depth===0,"is-editing":s.value===t.id,"is-drag-over-before":k.value===t.id&&j.value===`before`,"is-drag-over-after":k.value===t.id&&j.value===`after`,"is-drag-over-child":k.value===t.id&&j.value===`child`}]),style:_({paddingLeft:12+t.depth*16+`px`}),draggable:`true`,onClick:e=>i(`select`,t.node),onDblclick:e=>m(t),onDragstart:e=>M(e,t),onDragend:N,onDragover:e=>P(e,t),onDragleave:()=>ee(t),onDrop:e=>te(e,t)},[t.hasChildren?(A(),O(`button`,{key:0,class:`zm-outline-toggle`,title:t.collapsed?`展开`:`折叠`,onClick:y(e=>i(`toggleCollapse`,t.id),[`stop`])},[(A(),O(`svg`,ni,[t.collapsed?(A(),O(`polyline`,ii)):(A(),O(`polyline`,ri))]))],8,ti)):(A(),O(`span`,ai)),v(`span`,oi,p(t.siblingIndex+1)+`.`,1),s.value===t.id?d((A(),O(`input`,{key:2,"onUpdate:modelValue":n[0]||=e=>c.value=e,class:`zm-outline-input`,onBlur:h,onKeydown:w,onClick:n[1]||=y(()=>{},[`stop`])},null,544)),[[S,c.value]]):(A(),O(`span`,si,p(t.text),1)),r.readonly?f(``,!0):(A(),O(`button`,{key:4,class:`zm-outline-row-action`,title:`添加同级`,onClick:y(e=>i(`addSibling`,t.id),[`stop`])},[v(`img`,{src:C(ne),width:`14`,height:`14`,alt:`添加同级`,draggable:`false`},null,8,li)],8,ci)),r.readonly?f(``,!0):(A(),O(`button`,{key:5,class:`zm-outline-row-action`,title:`添加子节点`,onClick:y(e=>i(`addChild`,t.id),[`stop`])},[v(`img`,{src:C(re),width:`14`,height:`14`,alt:`添加子节点`,draggable:`false`},null,8,di)],8,ui)),v(`button`,{class:x([`zm-outline-row-copy`,{"is-success":ie.value===t.id}]),title:ie.value===t.id?`已复制`:`复制节点文本`,onClick:e=>L(e,t.text,t.id)},[(A(),O(`svg`,pi,[ie.value===t.id?(A(),O(`path`,hi)):(A(),O(`rect`,mi)),n[3]||=v(`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,fi)],46,ei))),128))])]))}}),_i=[`aria-hidden`],vi=[`aria-hidden`],yi={key:0,class:`zm-drawer-header`},bi={key:0,class:`zm-drawer-title`},xi={class:`zm-drawer-body`},Si=[`aria-hidden`],Ci={key:0,class:`zm-drawer-header`},wi={key:0,class:`zm-drawer-title`},Ti={class:`zm-drawer-body`},Ei=s({__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:r}){let i=r;function a(){i(`update:open`,!1)}function o(){i(`update:open`,!1)}return(r,i)=>t.scope===`canvas`?(A(),O(D,{key:0},[e(E,{name:`zm-fade`},{default:u(()=>[t.open?(A(),O(`div`,{key:0,class:`zm-drawer-canvas-backdrop`,"aria-hidden":!t.open,onClick:i[0]||=e=>t.closeOnBackdrop&&o()},null,8,_i)):f(``,!0)]),_:1}),e(E,{name:t.side===`left`?`zm-slide-left`:`zm-slide-right`},{default:u(()=>[t.open?(A(),O(`aside`,{key:0,class:x([`zm-drawer zm-drawer--canvas`,[`zm-drawer--`+t.side]]),style:_({width:t.width+`px`}),"aria-hidden":!t.open},[t.title||r.$slots.header?(A(),O(`div`,yi,[t.title?(A(),O(`h3`,bi,p(t.title),1)):f(``,!0),n(r.$slots,`header`),t.closable?(A(),O(`button`,{key:1,class:`zm-drawer-close`,title:`关闭`,onClick:a},[...i[1]||=[v(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`},[v(`path`,{d:`M6 6 L18 18 M18 6 L6 18`})],-1)]])):f(``,!0)])):f(``,!0),v(`div`,xi,[n(r.$slots,`default`)])],14,vi)):f(``,!0)]),_:3},8,[`name`])],64)):(A(),g(E,{key:1,name:`zm-drawer`},{default:u(()=>[t.open?(A(),O(`aside`,{key:0,class:x([`zm-drawer`,[`zm-drawer--`+t.side,{"is-open":t.open}]]),style:_({width:t.width+`px`}),"aria-hidden":!t.open},[t.title||r.$slots.header?(A(),O(`div`,Ci,[t.title?(A(),O(`h3`,wi,p(t.title),1)):f(``,!0),n(r.$slots,`header`),t.closable?(A(),O(`button`,{key:1,class:`zm-drawer-close`,title:`关闭`,onClick:a},[...i[2]||=[v(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`},[v(`path`,{d:`M6 6 L18 18 M18 6 L6 18`})],-1)]])):f(``,!0)])):f(``,!0),v(`div`,Ti,[n(r.$slots,`default`)])],14,Si)):f(``,!0)]),_:3}))}}),Di={key:0,class:`zm-jtv-root`},Oi={key:0,class:`zm-jtv-key`},ki={key:1,class:`zm-jtv-colon`},Ai={key:2,class:`zm-jtv-key zm-jtv-bracket`},ji={key:3,class:`zm-jtv-size`},Mi={key:4,class:`zm-jtv-bracket`},Ni={key:5,class:`zm-jtv-brace`},Pi={key:0,class:`zm-jtv-children`},Fi={class:`zm-jtv-key`},Ii={key:0,class:`zm-jtv-key`},Li=[`src`,`alt`],Ri=[`href`],zi=s({__name:`JsonTreeViewer`,props:{value:{},keyName:{default:``},isRoot:{type:Boolean,default:!0},path:{default:``},depth:{default:0},query:{default:``},collapsedPaths:{default:()=>new Set}},setup(t){let n=t,r=b(()=>n.value===null?`null`:Array.isArray(n.value)?`array`:typeof n.value),i=b(()=>r.value===`object`),a=b(()=>r.value===`array`);b(()=>!i.value&&!a.value);let s=b(()=>{if(a.value)return`Array(${n.value.length})`;if(i.value){let e=n.value,t=Object.keys(e);return`Object(${t.length} ${t.length===1?`key`:`keys`})`}return``}),u=b(()=>a.value?n.value.map((e,t)=>({key:String(t),value:e})):i.value?Object.entries(n.value).map(([e,t])=>({key:e,value:t})):[]),m=b(()=>n.isRoot?`<root>`:n.path),h=b(()=>n.collapsedPaths.has(m.value));function g(e,t,r){e!==`<root>`&&(r<2||typeof t!=`object`||!t||n.collapsedPaths.has(e)||n.collapsedPaths.add(e))}n.isRoot||g(m.value,n.value,n.depth);function S(){h.value?n.collapsedPaths.delete(m.value):n.collapsedPaths.add(m.value)}function C(e){return m.value===``?e:`${m.value}.${e}`}function T(e){if(!n.query)return!0;let t=n.query.toLowerCase();return typeof e==`string`?e.toLowerCase().includes(t):e===null?`null`.includes(t):String(e).toLowerCase().includes(t)}function E(e){return n.query?e.toLowerCase().includes(n.query.toLowerCase()):!0}function k(e,t){return!n.query||E(e)?!0:typeof t!=`object`||!t?T(t):!0}function j(e){return e===null?`null`:typeof e==`string`?e.length>80?`"${e.slice(0,80)}..."`:`"${e}"`:typeof e==`boolean`?e?`true`:`false`:typeof e==`number`?String(e):typeof e>`u`?`undefined`:JSON.stringify(e)}function M(e){if(typeof e!=`string`)return!1;let t=e.trim();return!!(t.startsWith(`data:image/`)||/^https?:\/\/.+\.(png|jpe?g|gif|webp|svg|bmp|ico)(\?.*)?$/i.test(t)||/^https?:\/\/.+/i.test(t)&&/\/[^/]+\.(png|jpe?g|gif|webp|svg|bmp|ico)(\?.*)?$/i.test(t))}function N(e){if(!n.query)return null;let t=e.toLowerCase().indexOf(n.query.toLowerCase());return t<0?null:{before:e.slice(0,t),match:e.slice(t,t+n.query.length),after:e.slice(t+n.query.length)}}return(n,m)=>{let g=c(`JsonTreeViewer`,!0);return t.isRoot?(A(),O(`div`,Di,[(A(!0),O(D,null,l(u.value,n=>d((A(),O(`div`,{key:n.key,class:`zm-jtv-row`},[e(g,{"key-name":n.key,value:n.value,path:C(n.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`])])),[[w,k(n.key,n.value)]])),128))])):i.value||a.value?(A(),O(`div`,{key:1,class:x([`zm-jtv-branch`,{"is-collapsed":h.value}])},[v(`div`,{class:`zm-jtv-header`,style:_({paddingLeft:6+t.depth*12+`px`}),onClick:S},[v(`span`,{class:x([`zm-jtv-toggle`,{"is-leaf":!1}])},p(h.value?`▶`:`▼`),1),a.value?f(``,!0):(A(),O(`span`,Oi,p(t.keyName),1)),a.value?f(``,!0):(A(),O(`span`,ki,`:`)),a.value?(A(),O(`span`,Ai,`[`)):f(``,!0),h.value?(A(),O(`span`,ji,p(s.value),1)):f(``,!0),h.value&&a.value?(A(),O(`span`,Mi,`]`)):f(``,!0),h.value&&i.value?(A(),O(`span`,Ni,`}`)):f(``,!0)],4),h.value?f(``,!0):(A(),O(`div`,Pi,[(A(!0),O(D,null,l(u.value,n=>d((A(),O(`div`,{key:n.key,class:`zm-jtv-row`},[e(g,{"key-name":n.key,value:n.value,path:C(n.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`])])),[[w,k(n.key,n.value)]])),128))])),!h.value&&a.value?(A(),O(`div`,{key:1,class:`zm-jtv-footer`,style:_({paddingLeft:6+t.depth*12+`px`})},`]`,4)):f(``,!0),!h.value&&i.value&&!a.value?(A(),O(`div`,{key:2,class:`zm-jtv-footer`,style:_({paddingLeft:6+t.depth*12+`px`})},`}`,4)):f(``,!0)],2)):(A(),O(`div`,{key:2,class:`zm-jtv-leaf`,style:_({paddingLeft:6+t.depth*12+`px`})},[m[2]||=v(`span`,{class:`zm-jtv-toggle is-leaf`},`·`,-1),v(`span`,Fi,p(t.keyName),1),m[3]||=v(`span`,{class:`zm-jtv-colon`},`:`,-1),E(t.keyName)&&N(t.keyName)?(A(),O(`span`,Ii,[v(`span`,null,p(N(t.keyName)?.before),1),v(`mark`,null,p(N(t.keyName)?.match),1),v(`span`,null,p(N(t.keyName)?.after),1)])):f(``,!0),v(`span`,{class:x([`zm-jtv-value`,`zm-jtv-${r.value}`])},[N(j(t.value))?(A(),O(D,{key:0},[v(`span`,null,p(N(j(t.value))?.before),1),v(`mark`,null,p(N(j(t.value))?.match),1),v(`span`,null,p(N(j(t.value))?.after),1)],64)):(A(),O(D,{key:1},[o(p(j(t.value)),1)],64))],2),M(t.value)?(A(),O(`span`,{key:1,class:`zm-jtv-thumb-wrap`,onClick:m[1]||=y(()=>{},[`stop`])},[v(`img`,{class:`zm-jtv-thumb`,src:String(t.value),alt:t.keyName,loading:`lazy`,referrerpolicy:`no-referrer`},null,8,Li),v(`a`,{class:`zm-jtv-thumb-link`,href:String(t.value),target:`_blank`,rel:`noopener noreferrer`,onClick:m[0]||=y(()=>{},[`stop`])},`open`,8,Ri)])):f(``,!0)],4))}}}),Bi={class:`zm-data-panel`},Vi={class:`zm-data-header`},Hi={class:`zm-data-title`},Ui={class:`zm-data-title-meta`},Wi={class:`zm-data-toolbar`},Gi=[`title`],Ki={key:0,width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},qi={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`},Ji={key:0,class:`zm-data-paste`},Yi={class:`zm-data-tabs`},Xi=[`placeholder`],Zi={key:0,class:`zm-data-error`},Qi={class:`zm-data-paste-actions`},$i=[`disabled`],ea={class:`zm-data-tree`},ta=s({__name:`DataPanel`,props:{data:{},pendingMode:{default:null}},emits:[`import`,`consumed-mode`],setup(t,{emit:n}){let i=t,a=n,s=b(()=>JSON.stringify(i.data,null,2)),c=T(``),l=T(null),u=T(!1),m=T(`json`),h=T(`idle`),g=T(new Set),_=T(``);r(()=>i.pendingMode,e=>{e&&(u.value=!0,m.value=e,a(`consumed-mode`))},{immediate:!0});async function y(){try{await navigator.clipboard.writeText(s.value),h.value=`copied`,setTimeout(()=>h.value=`idle`,1500)}catch{let e=document.createElement(`textarea`);e.value=s.value,document.body.appendChild(e),e.select();try{document.execCommand(`copy`),h.value=`copied`,setTimeout(()=>h.value=`idle`,1500)}finally{document.body.removeChild(e)}}}function C(){let e=new Blob([s.value],{type:`application/json`}),t=URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=`${i.data.text||`mindmap`}.json`,n.click(),URL.revokeObjectURL(t)}function w(){l.value=null;let e=c.value.trim();if(e){if(m.value===`markdown`||m.value===`txt`){try{a(`import`,Ye(e)),c.value=``,u.value=!1}catch(e){l.value=(m.value===`txt`?`TXT 解析失败:`:`Markdown 解析失败:`)+e.message}return}try{let t=JSON.parse(e);if(!t.id||!Array.isArray(t.children)){l.value=`JSON 缺少 id 或 children 字段`;return}a(`import`,t),c.value=``,u.value=!1}catch(e){l.value=`JSON 解析失败:`+e.message}}}function E(e){return 1+e.children.reduce((e,t)=>e+E(t),0)}let D=b(()=>E(i.data)),j=b(()=>s.value.length);function M(){let e=document.createElement(`input`);e.type=`file`,e.accept=`application/json`,e.onchange=()=>{let t=e.files?.[0];if(!t)return;let n=new FileReader;n.onload=()=>{typeof n.result==`string`&&(c.value=n.result,w())},n.readAsText(t)},e.click()}return(n,r)=>(A(),O(`div`,Bi,[v(`div`,Vi,[v(`div`,Hi,[r[8]||=v(`span`,{class:`zm-data-title-text`},`数据 JSON`,-1),v(`span`,Ui,p(D.value)+` 节点 · `+p(j.value)+` chars`,1)])]),v(`div`,Wi,[v(`button`,{class:x([`zm-data-btn is-icon`,{"is-success":h.value===`copied`}]),title:h.value===`copied`?`已复制`:`复制 JSON 到剪贴板`,onClick:y},[h.value===`idle`?(A(),O(`svg`,Ki,[...r[9]||=[v(`rect`,{x:`9`,y:`9`,width:`13`,height:`13`,rx:`2`},null,-1),v(`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)]])):(A(),O(`svg`,qi,[...r[10]||=[v(`polyline`,{points:`5 12 10 17 19 7`},null,-1)]])),r[11]||=v(`span`,{class:`zm-data-btn-label`},`复制`,-1)],10,Gi),v(`button`,{class:`zm-data-btn is-icon`,title:`导出为 JSON 文件`,onClick:C},[...r[12]||=[k(`<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)]]),v(`button`,{class:`zm-data-btn is-icon`,title:`从 JSON 文件导入`,onClick:M},[...r[13]||=[k(`<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)]]),v(`button`,{class:x([`zm-data-btn is-icon`,{"is-active":u.value}]),title:`粘贴 JSON 或 Markdown 替换当前数据`,onClick:r[0]||=e=>u.value=!u.value},[...r[14]||=[k(`<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),r[16]||=v(`div`,{class:`zm-data-toolbar-spacer`},null,-1),v(`div`,{class:x([`zm-data-search`,{"is-active":_.value.length>0}])},[r[15]||=v(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[v(`circle`,{cx:`11`,cy:`11`,r:`7`}),v(`line`,{x1:`20`,y1:`20`,x2:`16`,y2:`16`})],-1),d(v(`input`,{"onUpdate:modelValue":r[1]||=e=>_.value=e,type:`text`,placeholder:`过滤 (键 / 值)`,spellcheck:`false`},null,512),[[S,_.value]]),_.value?(A(),O(`button`,{key:0,class:`zm-data-search-clear`,title:`清空过滤`,onClick:r[2]||=e=>_.value=``},`×`)):f(``,!0)],2)]),u.value?(A(),O(`div`,Ji,[v(`div`,Yi,[v(`button`,{class:x([`zm-data-tab`,{"is-active":m.value===`json`}]),onClick:r[3]||=e=>m.value=`json`},`JSON`,2),v(`button`,{class:x([`zm-data-tab`,{"is-active":m.value===`markdown`}]),onClick:r[4]||=e=>m.value=`markdown`},`Markdown`,2)]),d(v(`textarea`,{"onUpdate:modelValue":r[5]||=e=>c.value=e,placeholder:m.value===`json`?`paste a JSON tree to replace current data`:`paste markdown - # / ## / ### become nodes`,spellcheck:`false`},null,8,Xi),[[S,c.value]]),l.value?(A(),O(`div`,Zi,p(l.value),1)):f(``,!0),v(`div`,Qi,[v(`button`,{class:`zm-data-btn is-primary`,disabled:!c.value,onClick:w},`应用`,8,$i),v(`button`,{class:`zm-data-btn`,onClick:r[6]||=e=>{c.value=``,l.value=null}},`清空`),v(`button`,{class:`zm-data-btn`,onClick:r[7]||=e=>u.value=!1},`关闭`)])])):f(``,!0),v(`div`,ea,[e(zi,{value:t.data,query:_.value,"collapsed-paths":g.value},null,8,[`value`,`query`,`collapsed-paths`])]),r[17]||=v(`div`,{class:`zm-data-footer`},[v(`span`,{class:`zm-data-footer-hint`},[o(` 图片支持 `),v(`code`,null,`data:image/...`),o(` / `),v(`code`,null,`https://...`),o(` / `),v(`code`,null,`/imgs/foo.png`),o(` (同源)。本地 `),v(`code`,null,`file://`),o(` 路径被浏览器拒绝。 `)])],-1)]))}}),na={class:`zm-settings-panel`},ra={key:0,class:`zm-settings-section`},ia={class:`zm-settings-row`},aa=[`value`],oa={class:`zm-slider`},sa=[`value`],ca={class:`zm-settings-row`},la=[`value`],ua={class:`zm-slider`},da=[`value`],fa={class:`zm-settings-row`},pa={class:`zm-line-style-group`},ma=[`title`,`onClick`],ha=[`viewBox`],ga={key:0,d:`M 0 12 C 8 0, 20 0, 28 12`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.2`,"stroke-linecap":`round`},_a={key:1,x1:`0`,y1:`12`,x2:`28`,y2:`12`,stroke:`currentColor`,"stroke-width":`2.2`,"stroke-linecap":`round`},va={class:`zm-line-style-label`},ya={class:`zm-settings-row`},ba={key:0,class:`zm-palette-picker`},xa={class:`zm-palette-grid`},Sa=[`title`,`onClick`],Ca={class:`zm-palette-card-name`},wa={class:`zm-palette-card-swatches`},Ta={key:0,class:`zm-palette-customs`},Ea=[`title`,`onClick`],Da={class:`zm-palette-card-name`},Oa={class:`zm-palette-card-swatches`},ka=[`value`,`onInput`],Aa={class:`zm-palette-custom-actions`},ja=[`onClick`],Ma=[`onClick`],Na={class:`zm-settings-row`},Pa={class:`zm-settings-row`},Fa={class:`zm-settings-preview`},Ia={viewBox:`0 0 200 70`,width:`100%`,height:`70`,preserveAspectRatio:`none`},La=[`x1`,`y1`,`x2`,`y2`,`stroke`,`stroke-width`],Ra={key:1,class:`zm-settings-section`},za={class:`zm-settings-row`},Ba={class:`zm-settings-value-tag`},Va={class:`zm-settings-row`},Ha={class:`zm-settings-value-tag`},Ua={class:`zm-settings-row`},Wa={class:`zm-settings-value-tag`},Ga={class:`zm-settings-row`},Ka={key:2,class:`zm-settings-section`},qa={class:`zm-settings-section-title`},Ja={key:0,class:`zm-settings-section-sub`},Ya={class:`zm-settings-row`},Xa={class:`zm-settings-value-tag`},Za={class:`zm-swatch-row`},Qa=[`title`,`onClick`],$a={class:`zm-settings-row`},eo={class:`zm-settings-value-tag`},to={class:`zm-swatch-row`},no=[`title`,`onClick`],ro={class:`zm-settings-row`},io={class:`zm-settings-section`},ao=((e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n})(s({__name:`SettingsPanel`,props:{settings:{},hasSelection:{type:Boolean},selectedNodeText:{}},emits:[`update:settings`,`update:nodeStyle`,`reset`],setup(e,{emit:t}){let n=e,r=t;function i(e,t){r(`update:settings`,{[e]:t})}b(()=>{let e=n.settings.lineWidthStart;return e<1.2?`细`:e<2.5?`中`:e<4?`粗`:`极粗`}),b(()=>{let e=n.settings.lineWidthEnd;return e<.6?`极细`:e<1.2?`细`:e<2?`中`:`粗`});let a=[{value:`curve`,label:`圆弧`,viewBox:`0 0 28 14`},{value:`straight`,label:`直线`,viewBox:`0 0 28 14`}],s=m({fontWeight:400});function c(){r(`update:nodeStyle`,{...s})}function u(){s.bg=void 0,s.textColor=void 0,s.borderColor=void 0,s.fontWeight=400,r(`update:nodeStyle`,{...s})}let d=m({});function h(e){return d[e.id]===void 0&&(d[e.id]=e.colors.join(`
23
+ `)),d[e.id]}function g(e){let t=Me(d[e.id]??``);if(t.length===0){d[e.id]=e.colors.join(`
24
+ `);return}r(`update:settings`,{customPalettes:n.settings.customPalettes.map(n=>n.id===e.id?{...n,colors:t}:n)})}function y(){let e=w.value.find(e=>e.id===n.settings.branchPaletteId),t=e?[...e.colors]:[...Ae[0].colors],i=`custom-`,a=i+(n.settings.customPalettes.length+1);for(;Ae.some(e=>e.id===a)||n.settings.customPalettes.some(e=>e.id===a);)a=i+Math.random().toString(36).slice(2,7);let o={id:a,name:`我的配色 ${n.settings.customPalettes.length+1}`,colors:t};r(`update:settings`,{customPalettes:[...n.settings.customPalettes,o],branchPaletteId:a}),d[a]=t.join(`
25
+ `)}function S(e){let t=n.settings.customPalettes.filter(t=>t.id!==e.id),i=n.settings.branchPaletteId===e.id?`default`:n.settings.branchPaletteId;r(`update:settings`,{customPalettes:t,...i===n.settings.branchPaletteId?{}:{branchPaletteId:i}}),delete d[e.id]}let w=b(()=>[...Ae,...n.settings.customPalettes]),T=[`#f87171`,`#fb923c`,`#fbbf24`,`#a3e635`,`#34d399`,`#22d3ee`,`#818cf8`,`#c084fc`,`#1e2937`,`#f8fafc`,`#94a3b8`],E=[0,1,2,3],k=[`#f87171`,`#fb923c`,`#34d399`,`#818cf8`];function j(e,t,n,r){if(t<=1)return n;let i=e/(t-1);return n+(r-n)*i}function M(e,t,n){return e<=0?t:e===1?Math.max(1.5,t*.67):e===2?Math.max(.8,t*.42):n}let N=b(()=>{let e=n.settings.lineWidthStart,t=n.settings.lineWidthEnd,r=n.settings.taperedEdge,i=E.length,a=w.value.find(e=>e.id===n.settings.branchPaletteId),o=a&&a.colors.length?a.colors:k;return E.map((a,s)=>{let c=10+s*60/(i-1);return{x1:8,y1:c,x2:192,y2:c,w:r?M(a,e,t):j(a,i,e,t),color:n.settings.rainbowBranch?o[s%o.length]:`#94a3b8`}})});return(t,n)=>(A(),O(`div`,na,[e.hasSelection?(A(),O(`section`,Ra,[n[32]||=v(`h4`,{class:`zm-settings-section-title`},`画布`,-1),v(`div`,za,[n[27]||=v(`span`,{class:`zm-settings-label`},`线条粗端`,-1),v(`span`,Ba,p(e.settings.lineWidthStart.toFixed(1)),1)]),v(`div`,Va,[n[28]||=v(`span`,{class:`zm-settings-label`},`线条细端`,-1),v(`span`,Ha,p(e.settings.lineWidthEnd.toFixed(1)),1)]),v(`div`,Ua,[n[29]||=v(`span`,{class:`zm-settings-label`},`线条类型`,-1),v(`span`,Wa,p(e.settings.lineStyle===`curve`?`圆弧`:`直线`),1)]),v(`label`,Ga,[n[31]||=v(`span`,{class:`zm-settings-label`},`一级分支彩虹色`,-1),v(`button`,{class:x([`zm-toggle`,{"is-on":e.settings.rainbowBranch}]),onClick:n[7]||=t=>i(`rainbowBranch`,!e.settings.rainbowBranch)},[...n[30]||=[v(`span`,{class:`zm-toggle-knob`},null,-1)]],2)]),n[33]||=v(`p`,{class:`zm-settings-hint`},`画布级别的设置会影响整张图。`,-1)])):(A(),O(`section`,ra,[n[23]||=v(`h4`,{class:`zm-settings-section-title`},`画布`,-1),v(`div`,ia,[n[12]||=v(`span`,{class:`zm-settings-label`},`线条粗端(根部)`,-1),v(`input`,{class:`zm-settings-number`,type:`number`,step:`0.2`,value:e.settings.lineWidthStart,onChange:n[0]||=e=>i(`lineWidthStart`,parseFloat(e.target.value)||0)},null,40,aa)]),v(`div`,oa,[v(`input`,{type:`range`,min:`0.4`,max:`20`,step:`0.2`,value:e.settings.lineWidthStart,onInput:n[1]||=e=>i(`lineWidthStart`,parseFloat(e.target.value))},null,40,sa)]),v(`div`,ca,[n[13]||=v(`span`,{class:`zm-settings-label`},`线条细端(子端)`,-1),v(`input`,{class:`zm-settings-number`,type:`number`,step:`0.2`,value:e.settings.lineWidthEnd,onChange:n[2]||=e=>i(`lineWidthEnd`,parseFloat(e.target.value)||0)},null,40,la)]),v(`div`,ua,[v(`input`,{type:`range`,min:`0.2`,max:`6`,step:`0.1`,value:e.settings.lineWidthEnd,onInput:n[3]||=e=>i(`lineWidthEnd`,parseFloat(e.target.value))},null,40,da)]),v(`div`,fa,[n[14]||=v(`span`,{class:`zm-settings-label`},`线条类型`,-1),v(`div`,pa,[(A(),O(D,null,l(a,t=>v(`button`,{key:t.value,class:x([`zm-line-style-btn`,{"is-on":e.settings.lineStyle===t.value}]),title:t.label,onClick:e=>i(`lineStyle`,t.value)},[(A(),O(`svg`,{viewBox:t.viewBox,width:`28`,height:`14`,preserveAspectRatio:`none`},[t.value===`curve`?(A(),O(`path`,ga)):(A(),O(`line`,_a))],8,ha)),v(`span`,va,p(t.label),1)],10,ma)),64))])]),v(`label`,ya,[n[16]||=v(`span`,{class:`zm-settings-label`},`一级分支彩虹色`,-1),v(`button`,{class:x([`zm-toggle`,{"is-on":e.settings.rainbowBranch}]),onClick:n[4]||=t=>i(`rainbowBranch`,!e.settings.rainbowBranch)},[...n[15]||=[v(`span`,{class:`zm-toggle-knob`},null,-1)]],2)]),n[24]||=v(`p`,{class:`zm-settings-hint`},`关闭时所有线条使用统一的 lineColor。`,-1),e.settings.rainbowBranch?(A(),O(`div`,ba,[n[17]||=v(`h5`,{class:`zm-palette-picker-title`},`配色方案`,-1),v(`div`,xa,[(A(!0),O(D,null,l(C(Ae),t=>(A(),O(`button`,{key:t.id,type:`button`,class:x([`zm-palette-card`,{"is-active":e.settings.branchPaletteId===t.id}]),title:t.name,onClick:e=>i(`branchPaletteId`,t.id)},[v(`span`,Ca,p(t.name),1),v(`span`,wa,[(A(!0),O(D,null,l(t.colors,(e,t)=>(A(),O(`span`,{key:t,class:`zm-palette-card-swatch`,style:_({background:e})},null,4))),128))])],10,Sa))),128))]),e.settings.customPalettes.length?(A(),O(`div`,Ta,[(A(!0),O(D,null,l(e.settings.customPalettes,t=>(A(),O(`div`,{key:t.id,class:`zm-palette-custom`},[v(`button`,{type:`button`,class:x([`zm-palette-card`,{"is-active":e.settings.branchPaletteId===t.id}]),title:t.name,onClick:e=>i(`branchPaletteId`,t.id)},[v(`span`,Da,p(t.name),1),v(`span`,Oa,[(A(!0),O(D,null,l(t.colors,(e,t)=>(A(),O(`span`,{key:t,class:`zm-palette-card-swatch`,style:_({background:e})},null,4))),128))])],10,Ea),v(`textarea`,{class:`zm-palette-textarea`,rows:`2`,spellcheck:`false`,placeholder:`一行一个 hex,例如 #f87171`,value:h(t),onInput:e=>d[t.id]=e.target.value},null,40,ka),v(`div`,Aa,[v(`button`,{type:`button`,class:`zm-data-btn is-primary`,onClick:e=>g(t)},`保存`,8,ja),v(`button`,{type:`button`,class:`zm-data-btn`,onClick:e=>S(t)},`删除`,8,Ma)])]))),128))])):f(``,!0),v(`button`,{type:`button`,class:`zm-palette-add`,onClick:y},`+ 新建配色`)])):f(``,!0),v(`label`,Na,[n[19]||=v(`span`,{class:`zm-settings-label`},`每条连线独立渐变`,-1),v(`button`,{class:x([`zm-toggle`,{"is-on":e.settings.taperedEdge}]),onClick:n[5]||=t=>i(`taperedEdge`,!e.settings.taperedEdge)},[...n[18]||=[v(`span`,{class:`zm-toggle-knob`},null,-1)]],2)]),n[25]||=v(`p`,{class:`zm-settings-hint`},` 开启时每条边都从根部粗端收回到细端子端,父子边之间可能形成粗细跳变; 关闭时整棵树从最粗平滑过渡到最细,所有边连成一条带子。 `,-1),v(`label`,Pa,[n[21]||=v(`span`,{class:`zm-settings-label`},`显示节点序号`,-1),v(`button`,{class:x([`zm-toggle`,{"is-on":e.settings.showOrderBadge}]),onClick:n[6]||=t=>i(`showOrderBadge`,!e.settings.showOrderBadge)},[...n[20]||=[v(`span`,{class:`zm-toggle-knob`},null,-1)]],2)]),n[26]||=v(`p`,{class:`zm-settings-hint`},` 在每个节点右上角标注它是同级中的第几个 (1, 2, 3, ...), 方便对比画布位置与数据顺序。 `,-1),v(`div`,Fa,[(A(),O(`svg`,Ia,[(A(!0),O(D,null,l(N.value,(t,n)=>(A(),O(`line`,{key:n,x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,stroke:e.settings.rainbowBranch?t.color:`#94a3b8`,"stroke-width":t.w,"stroke-linecap":`butt`},null,8,La))),128))])),n[22]||=v(`div`,{class:`zm-settings-preview-labels`},[v(`span`,null,`根`),v(`span`,null,`1级`),v(`span`,null,`2级`),v(`span`,null,`3级`)],-1)])])),e.hasSelection?(A(),O(`section`,Ka,[v(`h4`,qa,[n[34]||=o(` 节点 `,-1),e.selectedNodeText?(A(),O(`span`,Ja,`“`+p(e.selectedNodeText)+`”`,1)):f(``,!0)]),v(`div`,Ya,[n[35]||=v(`span`,{class:`zm-settings-label`},`背景颜色`,-1),v(`span`,Xa,p(s.bg||`默认`),1)]),v(`div`,Za,[(A(),O(D,null,l(T,e=>v(`button`,{key:`bg-`+e,class:`zm-swatch`,style:_({background:e}),title:e,onClick:t=>s.bg=e},null,12,Qa)),64)),v(`button`,{class:`zm-swatch is-reset`,title:`清除`,onClick:n[8]||=e=>s.bg=void 0},`∅`)]),v(`div`,$a,[n[36]||=v(`span`,{class:`zm-settings-label`},`文字颜色`,-1),v(`span`,eo,p(s.textColor||`默认`),1)]),v(`div`,to,[(A(),O(D,null,l(T,e=>v(`button`,{key:`fg-`+e,class:`zm-swatch`,style:_({background:e}),title:e,onClick:t=>s.textColor=e},null,12,no)),64)),v(`button`,{class:`zm-swatch is-reset`,title:`清除`,onClick:n[9]||=e=>s.textColor=void 0},`∅`)]),v(`div`,ro,[n[38]||=v(`span`,{class:`zm-settings-label`},`字重`,-1),v(`button`,{class:x([`zm-toggle`,{"is-on":s.fontWeight===600}]),onClick:n[10]||=e=>s.fontWeight=s.fontWeight===600?400:600},[...n[37]||=[v(`span`,{class:`zm-toggle-knob`},null,-1)]],2)]),v(`div`,{class:`zm-data-paste-actions`},[v(`button`,{class:`zm-data-btn is-primary`,onClick:c},`应用到该节点`),v(`button`,{class:`zm-data-btn`,onClick:u},`清除该节点样式`)]),n[39]||=v(`p`,{class:`zm-settings-hint`},`仅作用于当前节点,不影响子节点。`,-1)])):f(``,!0),v(`section`,io,[v(`button`,{class:`zm-settings-reset`,onClick:n[11]||=e=>r(`reset`)},`恢复默认设置`)])]))}}),[[`__scopeId`,`data-v-17ef65d1`]]);function oo(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var so=oo();function co(e){so=e}var lo={exec:()=>null};function uo(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function Y(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(po.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var fo=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),po={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:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:uo(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:uo(e=>RegExp(`^ {0,${e}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:uo(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:uo(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:uo(e=>RegExp(`^ {0,${e}}<(?:[a-z].*>|!--)`,`i`)),blockquoteBeginRegex:uo(e=>RegExp(`^ {0,${e}}>`))},mo=/^(?:[ \t]*(?:\n|$))+/,ho=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,go=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,_o=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,vo=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,yo=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,bo=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,xo=Y(bo).replace(/bull/g,yo).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(),So=Y(bo).replace(/bull/g,yo).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(),Co=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,wo=/^[^\n]+/,To=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Eo=Y(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,To).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Do=Y(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,yo).getRegex(),Oo=`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`,ko=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Ao=Y(`^ {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`,ko).replace(`tag`,Oo).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),jo=Y(Co).replace(`hr`,_o).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`,Oo).getRegex(),Mo={blockquote:Y(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,jo).getRegex(),code:ho,def:Eo,fences:go,heading:vo,hr:_o,html:Ao,lheading:xo,list:Do,newline:mo,paragraph:jo,table:lo,text:wo},No=Y(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,_o).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`,Oo).getRegex(),Po={...Mo,lheading:So,table:No,paragraph:Y(Co).replace(`hr`,_o).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,No).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`,Oo).getRegex()},Fo={...Mo,html:Y(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,ko).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:lo,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Y(Co).replace(`hr`,_o).replace(`heading`,` *#{1,6} *[^
26
+ ]`).replace(`lheading`,xo).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},Io=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Lo=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Ro=/^( {2,}|\\)\n(?!\s*$)/,zo=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Bo=/[\p{P}\p{S}]/u,Vo=/[\s\p{P}\p{S}]/u,Ho=/[^\s\p{P}\p{S}]/u,Uo=Y(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,Vo).getRegex(),Wo=/(?!~)[\p{P}\p{S}]/u,Go=/(?!~)[\s\p{P}\p{S}]/u,Ko=/(?:[^\s\p{P}\p{S}]|~)/u,qo=Y(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,fo?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),Jo=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Yo=Y(Jo,`u`).replace(/punct/g,Bo).getRegex(),Xo=Y(Jo,`u`).replace(/punct/g,Wo).getRegex(),Zo=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,Qo=Y(Zo,`gu`).replace(/notPunctSpace/g,Ho).replace(/punctSpace/g,Vo).replace(/punct/g,Bo).getRegex(),$o=Y(Zo,`gu`).replace(/notPunctSpace/g,Ko).replace(/punctSpace/g,Go).replace(/punct/g,Wo).getRegex(),es=Y(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,Ho).replace(/punctSpace/g,Vo).replace(/punct/g,Bo).getRegex(),ts=Y(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,Bo).getRegex(),ns=Y(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,Ho).replace(/punctSpace/g,Vo).replace(/punct/g,Bo).getRegex(),rs=Y(/\\(punct)/,`gu`).replace(/punct/g,Bo).getRegex(),is=Y(/^<(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(),as=Y(ko).replace(`(?:-->|$)`,`-->`).getRegex(),os=Y(`^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`,as).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ss=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,cs=Y(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,ss).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ls=Y(/^!?\[(label)\]\[(ref)\]/).replace(`label`,ss).replace(`ref`,To).getRegex(),us=Y(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,To).getRegex(),ds=Y(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,ls).replace(`nolink`,us).getRegex(),fs=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,ps={_backpedal:lo,anyPunctuation:rs,autolink:is,blockSkip:qo,br:Ro,code:Lo,del:lo,delLDelim:lo,delRDelim:lo,emStrongLDelim:Yo,emStrongRDelimAst:Qo,emStrongRDelimUnd:es,escape:Io,link:cs,nolink:us,punctuation:Uo,reflink:ls,reflinkSearch:ds,tag:os,text:zo,url:lo},ms={...ps,link:Y(/^!?\[(label)\]\((.*?)\)/).replace(`label`,ss).getRegex(),reflink:Y(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,ss).getRegex()},hs={...ps,emStrongRDelimAst:$o,emStrongLDelim:Xo,delLDelim:ts,delRDelim:ns,url:Y(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,fs).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:Y(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace(`protocol`,fs).getRegex()},gs={...hs,br:Y(Ro).replace(`{2,}`,`*`).getRegex(),text:Y(hs.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},_s={normal:Mo,gfm:Po,pedantic:Fo},vs={normal:ps,gfm:hs,breaks:gs,pedantic:ms},ys={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},bs=e=>ys[e];function xs(e,t){if(t){if(po.escapeTest.test(e))return e.replace(po.escapeReplace,bs)}else if(po.escapeTestNoEncode.test(e))return e.replace(po.escapeReplaceNoEncode,bs);return e}function Ss(e){try{e=encodeURI(e).replace(po.percentDecode,`%`)}catch{return null}return e}function Cs(e,t){var n;let r=e.replace(po.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(po.splitPipe),i=0;if(r[0].trim()||r.shift(),r.length>0&&!((n=r.at(-1))!=null&&n.trim())&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push(``);for(;i<r.length;i++)r[i]=r[i].trim().replace(po.slashPipe,`|`);return r}function ws(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r&&e.charAt(r-i-1)===t;)i++;return e.slice(0,r-i)}function Ts(e){let t=e.split(`
27
+ `),n=t.length-1;for(;n>=0&&po.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
28
+ `)}function Es(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function Ds(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function Os(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`);r.state.inLink=!0;let c={type:e[0].charAt(0)===`!`?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,c}function ks(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
29
+ `).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return r.length>=i.length?e.slice(i.length):e}).join(`
30
+ `)}var As=class{constructor(e){N(this,`options`),N(this,`rules`),N(this,`lexer`),this.options=e||so}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:Ts(t[0]);return{type:`code`,raw:e,codeBlockStyle:`indented`,text:e.replace(this.rules.other.codeRemoveIndent,``)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=ks(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=ws(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:ws(t[0],`
31
+ `),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:ws(t[0],`
32
+ `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=ws(t[0],`
33
+ `).split(`
34
+ `),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o;for(o=0;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
35
+ `),c=s.replace(this.rules.other.blockquoteSetextReplace,`
36
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
37
+ ${s}`:s,r=r?`${r}
38
+ ${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`)break;if(u?.type===`blockquote`){let t=u,a=t.raw+`
39
+ `+e.join(`
40
+ `),o=this.blockquote(a);i[i.length-1]=o,n=n.substring(0,n.length-t.raw.length)+o.raw,r=r.substring(0,r.length-t.text.length)+o.text;break}else if(u?.type===`list`){let t=u,a=t.raw+`
41
+ `+e.join(`
42
+ `),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
43
+ `);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=Ds(t[2].split(`
44
+ `,1)[0],t[1].length),l=e.split(`
45
+ `,1)[0],u=!c.trim(),d=0;if(this.options.pedantic?(d=2,s=c.trimStart()):u?d=t[1].length+1:(d=c.search(this.rules.other.nonSpaceChar),d=d>4?1:d,s=c.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(l)&&(r+=l+`
46
+ `,e=e.substring(l.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),i=this.rules.other.fencesBeginRegex(d),a=this.rules.other.headingBeginRegex(d),o=this.rules.other.htmlBeginRegex(d),f=this.rules.other.blockquoteBeginRegex(d);for(;e;){let p=e.split(`
47
+ `,1)[0],m;if(l=p,this.options.pedantic?(l=l.replace(this.rules.other.listReplaceNesting,` `),m=l):m=l.replace(this.rules.other.tabCharGlobal,` `),i.test(l)||a.test(l)||o.test(l)||f.test(l)||t.test(l)||n.test(l))break;if(m.search(this.rules.other.nonSpaceChar)>=d||!l.trim())s+=`
48
+ `+m.slice(d);else{if(u||c.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(c)||a.test(c)||n.test(c))break;s+=`
49
+ `+l}u=!l.trim(),r+=p+`
50
+ `,e=e.substring(p.length+1),c=m.slice(d)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items){this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]);let t=e.tokens[0];if(e.task&&(t?.type===`text`||t?.type===`paragraph`)){e.text=e.text.replace(this.rules.other.listReplaceTask,``),t.raw=t.raw.replace(this.rules.other.listReplaceTask,``),t.text=t.text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}let n=this.rules.other.listTaskCheckbox.exec(e.raw);if(n){let t={type:`checkbox`,raw:n[0]+` `,checked:n[0]!==`[ ]`};e.checked=t.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=t.raw+e.tokens[0].raw,e.tokens[0].text=t.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(t)):e.tokens.unshift({type:`paragraph`,raw:t.raw,text:t.raw,tokens:[t]}):e.tokens.unshift(t)}}else e.task&&=!1;if(!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=Ts(t[0]);return{type:`html`,block:!0,raw:e,pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:e}}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:ws(t[0],`
51
+ `),href:n,title:r}}}table(e){var t;let n=this.rules.block.table.exec(e);if(!n||!this.rules.other.tableDelimiter.test(n[2]))return;let r=Cs(n[1]),i=n[2].replace(this.rules.other.tableAlignChars,``).split(`|`),a=(t=n[3])!=null&&t.trim()?n[3].replace(this.rules.other.tableRowBlankLine,``).split(`
52
+ `):[],o={type:`table`,raw:ws(n[0],`
53
+ `),header:[],align:[],rows:[]};if(r.length===i.length){for(let e of i)this.rules.other.tableAlignRight.test(e)?o.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?o.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?o.align.push(`left`):o.align.push(null);for(let e=0;e<r.length;e++)o.header.push({text:r[e],tokens:this.lexer.inline(r[e]),header:!0,align:o.align[e]});for(let e of a)o.rows.push(Cs(e,o.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:o.align[t]})));return o}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:ws(t[0],`
54
+ `),depth:t[2].charAt(0)===`=`?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
55
+ `?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=ws(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=Es(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let n=t[2],r=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):``;return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),Os(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,`$1`),title:r&&r.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `).toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return Os(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=0,c=r[0][0]===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);(r=c.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=[...i].length,r[3]||r[4]){o+=a;continue}else if((r[5]||r[6])&&n%3&&!((n+a)%3)){s+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+s);let t=[...r[0]][0].length,c=e.slice(0,n+r.index+t+a);if(Math.min(n,a)%2){let e=c.slice(1,-1);return{type:`em`,raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}let l=c.slice(2,-2);return{type:`strong`,raw:c,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:t[0],escaped:e}}}},js=class e{constructor(e){N(this,`tokens`),N(this,`options`),N(this,`state`),N(this,`inlineQueue`),N(this,`tokenizer`),this.tokens=[],this.tokens.links=Object.create(null),this.options=e||so,this.options.tokenizer=this.options.tokenizer||new As,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 t={other:po,block:_s.normal,inline:vs.normal};this.options.pedantic?(t.block=_s.pedantic,t.inline=vs.pedantic):this.options.gfm&&(t.block=_s.gfm,this.options.breaks?t.inline=vs.breaks:t.inline=vs.gfm),this.tokenizer.rules=t}static get rules(){return{block:_s,inline:vs}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(po.carriageReturn,`
56
+ `),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){var r,i;this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(po.tabCharGlobal,` `).replace(po.spaceLine,``));let a=1/0;for(;e;){if(e.length<a)a=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let o;if((r=this.options.extensions?.block)!=null&&r.some(n=>(o=n.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))continue;if(o=this.tokenizer.space(e)){e=e.substring(o.raw.length);let n=t.at(-1);o.raw.length===1&&n!==void 0?n.raw+=`
57
+ `:t.push(o);continue}if(o=this.tokenizer.code(e)){e=e.substring(o.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
58
+ `)?``:`
59
+ `)+o.raw,n.text+=`
60
+ `+o.text,this.inlineQueue.at(-1).src=n.text):t.push(o);continue}if(o=this.tokenizer.fences(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.heading(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.hr(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.blockquote(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.list(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.html(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.def(e)){e=e.substring(o.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
61
+ `)?``:`
62
+ `)+o.raw,n.text+=`
63
+ `+o.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[o.tag]||(this.tokens.links[o.tag]={href:o.href,title:o.title},t.push(o));continue}if(o=this.tokenizer.table(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.lheading(e)){e=e.substring(o.raw.length),t.push(o);continue}let s=e;if((i=this.options.extensions)!=null&&i.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(this.state.top&&(o=this.tokenizer.paragraph(s))){let r=t.at(-1);n&&r?.type===`paragraph`?(r.raw+=(r.raw.endsWith(`
64
+ `)?``:`
65
+ `)+o.raw,r.text+=`
66
+ `+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(o),n=s.length!==e.length,e=e.substring(o.raw.length);continue}if(o=this.tokenizer.text(e)){e=e.substring(o.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
67
+ `)?``:`
68
+ `)+o.raw,n.text+=`
69
+ `+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(o);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){var n,r;this.tokenizer.lexer=this;let i=e,a=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(i))!==null;)e.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 o;for(;(a=this.tokenizer.rules.inline.blockSkip.exec(i))!==null;)o=a[2]?a[2].length:0,i=i.slice(0,a.index+o)+`[`+`a`.repeat(a[0].length-o-2)+`]`+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);i=(this.options.hooks?.emStrongMask)?.call({lexer:this},i)??i;let s=!1,c=``,l=1/0;for(;e;){if(e.length<l)l=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}s||(c=``),s=!1;let a;if((n=this.options.extensions?.inline)!=null&&n.some(n=>(a=n.call({lexer:this},e,t))?(e=e.substring(a.raw.length),t.push(a),!0):!1))continue;if(a=this.tokenizer.escape(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.tag(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.link(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(a.raw.length);let n=t.at(-1);a.type===`text`&&n?.type===`text`?(n.raw+=a.raw,n.text+=a.text):t.push(a);continue}if(a=this.tokenizer.emStrong(e,i,c)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.codespan(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.br(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.del(e,i,c)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.autolink(e)){e=e.substring(a.raw.length),t.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(e))){e=e.substring(a.raw.length),t.push(a);continue}let o=e;if((r=this.options.extensions)!=null&&r.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(a=this.tokenizer.inlineText(o)){e=e.substring(a.raw.length),a.raw.slice(-1)!==`_`&&(c=a.raw.slice(-1)),s=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=a.raw,n.text+=a.text):t.push(a);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t=`Infinite loop on byte: `+e;if(this.options.silent)console.error(t);else throw Error(t)}},Ms=class{constructor(e){N(this,`options`),N(this,`parser`),this.options=e||so}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(po.notSpaceStart)?.[0],i=e.replace(po.endingNewline,``)+`
70
+ `;return r?`<pre><code class="language-`+xs(r)+`">`+(n?i:xs(i,!0))+`</code></pre>
71
+ `:`<pre><code>`+(n?i:xs(i,!0))+`</code></pre>
72
+ `}blockquote({tokens:e}){return`<blockquote>
73
+ ${this.parser.parse(e)}</blockquote>
74
+ `}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
75
+ `}hr(e){return`<hr>
76
+ `}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
77
+ `+r+`</`+i+`>
78
+ `}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
79
+ `}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox"> `}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
80
+ `}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>
81
+ <thead>
82
+ `+t+`</thead>
83
+ `+r+`</table>
84
+ `}tablerow({text:e}){return`<tr>
85
+ ${e}</tr>
86
+ `}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
87
+ `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${xs(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=Ss(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+xs(t)+`"`),a+=`>`+r+`</a>`,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=Ss(e);if(i===null)return xs(n);e=i;let a=`<img src="${e}" alt="${xs(n)}"`;return t&&(a+=` title="${xs(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:xs(e.text)}},Ns=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},Ps=class e{constructor(e){N(this,`options`),N(this,`renderer`),N(this,`textRenderer`),this.options=e||so,this.options.renderer=this.options.renderer||new Ms,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Ns}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){var t;this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if((t=this.options.extensions?.renderers)!=null&&t[i.type]){let e=i,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(t!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`def`,`paragraph`,`text`].includes(e.type)){n+=t||``;continue}}let a=i;switch(a.type){case`space`:n+=this.renderer.space(a);break;case`hr`:n+=this.renderer.hr(a);break;case`heading`:n+=this.renderer.heading(a);break;case`code`:n+=this.renderer.code(a);break;case`table`:n+=this.renderer.table(a);break;case`blockquote`:n+=this.renderer.blockquote(a);break;case`list`:n+=this.renderer.list(a);break;case`checkbox`:n+=this.renderer.checkbox(a);break;case`html`:n+=this.renderer.html(a);break;case`def`:n+=this.renderer.def(a);break;case`paragraph`:n+=this.renderer.paragraph(a);break;case`text`:n+=this.renderer.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}parseInline(e,t=this.renderer){var n;this.renderer.parser=this;let r=``;for(let i=0;i<e.length;i++){let a=e[i];if((n=this.options.extensions?.renderers)!=null&&n[a.type]){let e=this.options.extensions.renderers[a.type].call({parser:this},a);if(e!==!1||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(a.type)){r+=e||``;continue}}let o=a;switch(o.type){case`escape`:r+=t.text(o);break;case`html`:r+=t.html(o);break;case`link`:r+=t.link(o);break;case`image`:r+=t.image(o);break;case`checkbox`:r+=t.checkbox(o);break;case`strong`:r+=t.strong(o);break;case`em`:r+=t.em(o);break;case`codespan`:r+=t.codespan(o);break;case`br`:r+=t.br(o);break;case`del`:r+=t.del(o);break;case`text`:r+=t.text(o);break;default:{let e=`Token with "`+o.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return r}},Fs,Is=(Fs=class{constructor(e){N(this,`options`),N(this,`block`),this.options=e||so}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?js.lex:js.lexInline}provideParser(e=this.block){return e?Ps.parse:Ps.parseInline}},N(Fs,`passThroughHooks`,new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`])),N(Fs,`passThroughHooksRespectAsync`,new Set([`preprocess`,`postprocess`,`processAllTokens`])),Fs),Ls=class{constructor(...e){N(this,`defaults`,oo()),N(this,`options`,this.setOptions),N(this,`parse`,this.parseMarkdown(!0)),N(this,`parseInline`,this.parseMarkdown(!1)),N(this,`Parser`,Ps),N(this,`Renderer`,Ms),N(this,`TextRenderer`,Ns),N(this,`Lexer`,js),N(this,`Tokenizer`,As),N(this,`Hooks`,Is),this.use(...e)}walkTokens(e,t){var n;let r=[];for(let i of e)switch(r=r.concat(t.call(this,i)),i.type){case`table`:{let e=i;for(let n of e.header)r=r.concat(this.walkTokens(n.tokens,t));for(let n of e.rows)for(let e of n)r=r.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=i;r=r.concat(this.walkTokens(e.items,t));break}default:{let e=i;(n=this.defaults.extensions?.childTokens)!=null&&n[e.type]?this.defaults.extensions.childTokens[e.type].forEach(n=>{let i=e[n].flat(1/0);r=r.concat(this.walkTokens(i,t))}):e.tokens&&(r=r.concat(this.walkTokens(e.tokens,t)))}}return r}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new Ms(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new As(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new Is;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];Is.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async&&Is.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:t[r]=(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return js.lex(e,t??this.defaults)}parser(e,t){return Ps.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(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 t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?js.lex:js.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?Ps.parse:Ps.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?js.lex:js.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?Ps.parse:Ps.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
88
+ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+xs(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}},Rs=new Ls;function X(e,t){return Rs.parse(e,t)}X.options=X.setOptions=function(e){return Rs.setOptions(e),X.defaults=Rs.defaults,co(X.defaults),X},X.getDefaults=oo,X.defaults=so,X.use=function(...e){return Rs.use(...e),X.defaults=Rs.defaults,co(X.defaults),X},X.walkTokens=function(e,t){return Rs.walkTokens(e,t)},X.parseInline=Rs.parseInline,X.Parser=Ps,X.parser=Ps.parse,X.Renderer=Ms,X.TextRenderer=Ns,X.Lexer=js,X.lexer=js.lex,X.Tokenizer=As,X.Hooks=Is,X.parse=X,X.options,X.setOptions,X.use,X.walkTokens,X.parseInline,Ps.parse,js.lex;function zs(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Bs(e){if(Array.isArray(e))return e}function Vs(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function Hs(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
89
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Us(e,t){return Bs(e)||Vs(e,t)||Ws(e,t)||Hs()}function Ws(e,t){if(e){if(typeof e==`string`)return zs(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?zs(e,t):void 0}}var Gs=Object.entries,Ks=Object.setPrototypeOf,qs=Object.isFrozen,Js=Object.getPrototypeOf,Ys=Object.getOwnPropertyDescriptor,Xs=Object.freeze,Zs=Object.seal,Qs=Object.create,$s=typeof Reflect<`u`&&Reflect,ec=$s.apply,tc=$s.construct;Xs||=function(e){return e},Zs||=function(e){return e},ec||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},tc||=function(e){return new e(...[...arguments].slice(1))};var nc=Q(Array.prototype.forEach),rc=Q(Array.prototype.lastIndexOf),ic=Q(Array.prototype.pop),ac=Q(Array.prototype.push),oc=Q(Array.prototype.splice),sc=Array.isArray,cc=Q(String.prototype.toLowerCase),lc=Q(String.prototype.toString),uc=Q(String.prototype.match),dc=Q(String.prototype.replace),fc=Q(String.prototype.indexOf),pc=Q(String.prototype.trim),mc=Q(Number.prototype.toString),hc=Q(Boolean.prototype.toString),gc=typeof BigInt>`u`?null:Q(BigInt.prototype.toString),_c=typeof Symbol>`u`?null:Q(Symbol.prototype.toString),Z=Q(Object.prototype.hasOwnProperty),vc=Q(Object.prototype.toString),yc=Q(RegExp.prototype.test),bc=xc(TypeError);function Q(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return ec(e,t,n)}}function xc(e){return function(){return tc(e,[...arguments])}}function $(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:cc;if(Ks&&Ks(e,null),!sc(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(qs(t)||(t[r]=e),i=e)}e[i]=!0}return e}function Sc(e){for(let t=0;t<e.length;t++)Z(e,t)||(e[t]=null);return e}function Cc(e){let t=Qs(null);for(let r of Gs(e)){var n=Us(r,2);let i=n[0],a=n[1];Z(e,i)&&(sc(a)?t[i]=Sc(a):a&&typeof a==`object`&&a.constructor===Object?t[i]=Cc(a):t[i]=a)}return t}function wc(e){switch(typeof e){case`string`:return e;case`number`:return mc(e);case`boolean`:return hc(e);case`bigint`:return gc?gc(e):`0`;case`symbol`:return _c?_c(e):`Symbol()`;case`undefined`:return vc(e);case`function`:case`object`:{if(e===null)return vc(e);let t=e,n=Tc(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:vc(e)}return vc(e)}default:return vc(e)}}function Tc(e,t){for(;e!==null;){let n=Ys(e,t);if(n){if(n.get)return Q(n.get);if(typeof n.value==`function`)return Q(n.value)}e=Js(e)}function n(){return null}return n}function Ec(e){try{return yc(e,``),!0}catch{return!1}}var Dc=Xs(`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`.split(`.`)),Oc=Xs(`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`.split(`.`)),kc=Xs([`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`]),Ac=Xs([`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`]),jc=Xs(`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`.split(`.`)),Mc=Xs([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),Nc=Xs([`#text`]),Pc=Xs(`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`.split(`.`)),Fc=Xs(`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`.split(`.`)),Ic=Xs(`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`.split(`.`)),Lc=Xs([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),Rc=Zs(/{{[\w\W]*|^[\w\W]*}}/g),zc=Zs(/<%[\w\W]*|^[\w\W]*%>/g),Bc=Zs(/\${[\w\W]*/g),Vc=Zs(/^data-[\-\w.\u00B7-\uFFFF]+$/),Hc=Zs(/^aria-[\-\w]+$/),Uc=Zs(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Wc=Zs(/^(?:\w+script|data):/i),Gc=Zs(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Kc=Zs(/^html$/i),qc=Zs(/^[a-z][.\w]*(-[.\w]+)+$/i),Jc={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Yc=function(){return typeof window>`u`?null:window},Xc=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},Zc=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Qc(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Yc(),t=e=>Qc(e);if(t.version=`3.4.8`,t.removed=[],!e||!e.document||e.document.nodeType!==Jc.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=Tc(d,`cloneNode`),p=Tc(d,`remove`),m=Tc(d,`nextSibling`),h=Tc(d,`childNodes`),g=Tc(d,`parentNode`),_=Tc(d,`shadowRoot`),v=Tc(d,`attributes`),y=o&&o.prototype?Tc(o.prototype,`nodeType`):null,b=o&&o.prototype?Tc(o.prototype,`nodeName`):null;if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let x,S=``,C=0,w=function(e){if(C>0)throw bc(`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.`);C++;try{return x.createHTML(e)}finally{C--}},T=n,E=T.implementation,D=T.createNodeIterator,O=T.createDocumentFragment,k=T.getElementsByTagName,A=r.importNode,j=Zc();t.isSupported=typeof Gs==`function`&&typeof g==`function`&&E&&E.createHTMLDocument!==void 0;let M=Rc,N=zc,P=Bc,ee=Vc,te=Hc,F=Wc,ne=Gc,re=qc,ie=Uc,I=null,ae=$({},[...Dc,...Oc,...kc,...jc,...Nc]),L=null,oe=$({},[...Pc,...Fc,...Ic,...Lc]),R=Object.seal(Qs(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}})),z=null,se=null,ce=Object.seal(Qs(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),le=!0,ue=!0,de=!1,fe=!0,pe=!1,me=!0,he=!1,ge=!1,_e=!1,ve=!1,ye=!1,be=!1,xe=!0,Se=!1,Ce=`user-content-`,we=!0,Te=!1,Ee={},B=null,V=$({},[`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`]),De=null,Oe=$({},[`audio`,`video`,`img`,`source`,`image`,`track`]),ke=null,Ae=$({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),je=`http://www.w3.org/1998/Math/MathML`,Me=`http://www.w3.org/2000/svg`,Ne=`http://www.w3.org/1999/xhtml`,Pe=Ne,Fe=!1,Ie=null,Le=$({},[je,Me,Ne],lc),H=$({},[`mi`,`mo`,`mn`,`ms`,`mtext`]),Re=$({},[`annotation-xml`]),ze=$({},[`title`,`style`,`font`,`a`,`script`]),Be=null,Ve=[`application/xhtml+xml`,`text/html`],U=null,He=null,Ue=n.createElement(`form`),We=function(e){return e instanceof RegExp||e instanceof Function},Ge=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(He&&He===e)return;(!e||typeof e!=`object`)&&(e={}),e=Cc(e),Be=Ve.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,U=Be===`application/xhtml+xml`?lc:cc,I=Z(e,`ALLOWED_TAGS`)&&sc(e.ALLOWED_TAGS)?$({},e.ALLOWED_TAGS,U):ae,L=Z(e,`ALLOWED_ATTR`)&&sc(e.ALLOWED_ATTR)?$({},e.ALLOWED_ATTR,U):oe,Ie=Z(e,`ALLOWED_NAMESPACES`)&&sc(e.ALLOWED_NAMESPACES)?$({},e.ALLOWED_NAMESPACES,lc):Le,ke=Z(e,`ADD_URI_SAFE_ATTR`)&&sc(e.ADD_URI_SAFE_ATTR)?$(Cc(Ae),e.ADD_URI_SAFE_ATTR,U):Ae,De=Z(e,`ADD_DATA_URI_TAGS`)&&sc(e.ADD_DATA_URI_TAGS)?$(Cc(Oe),e.ADD_DATA_URI_TAGS,U):Oe,B=Z(e,`FORBID_CONTENTS`)&&sc(e.FORBID_CONTENTS)?$({},e.FORBID_CONTENTS,U):V,z=Z(e,`FORBID_TAGS`)&&sc(e.FORBID_TAGS)?$({},e.FORBID_TAGS,U):Cc({}),se=Z(e,`FORBID_ATTR`)&&sc(e.FORBID_ATTR)?$({},e.FORBID_ATTR,U):Cc({}),Ee=Z(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?Cc(e.USE_PROFILES):e.USE_PROFILES:!1,le=e.ALLOW_ARIA_ATTR!==!1,ue=e.ALLOW_DATA_ATTR!==!1,de=e.ALLOW_UNKNOWN_PROTOCOLS||!1,fe=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,pe=e.SAFE_FOR_TEMPLATES||!1,me=e.SAFE_FOR_XML!==!1,he=e.WHOLE_DOCUMENT||!1,ve=e.RETURN_DOM||!1,ye=e.RETURN_DOM_FRAGMENT||!1,be=e.RETURN_TRUSTED_TYPE||!1,_e=e.FORCE_BODY||!1,xe=e.SANITIZE_DOM!==!1,Se=e.SANITIZE_NAMED_PROPS||!1,we=e.KEEP_CONTENT!==!1,Te=e.IN_PLACE||!1,ie=Ec(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:Uc,Pe=typeof e.NAMESPACE==`string`?e.NAMESPACE:Ne,H=Z(e,`MATHML_TEXT_INTEGRATION_POINTS`)&&e.MATHML_TEXT_INTEGRATION_POINTS&&typeof e.MATHML_TEXT_INTEGRATION_POINTS==`object`?Cc(e.MATHML_TEXT_INTEGRATION_POINTS):$({},[`mi`,`mo`,`mn`,`ms`,`mtext`]),Re=Z(e,`HTML_INTEGRATION_POINTS`)&&e.HTML_INTEGRATION_POINTS&&typeof e.HTML_INTEGRATION_POINTS==`object`?Cc(e.HTML_INTEGRATION_POINTS):$({},[`annotation-xml`]);let t=Z(e,`CUSTOM_ELEMENT_HANDLING`)&&e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING==`object`?Cc(e.CUSTOM_ELEMENT_HANDLING):Qs(null);if(R=Qs(null),Z(t,`tagNameCheck`)&&We(t.tagNameCheck)&&(R.tagNameCheck=t.tagNameCheck),Z(t,`attributeNameCheck`)&&We(t.attributeNameCheck)&&(R.attributeNameCheck=t.attributeNameCheck),Z(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(R.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),pe&&(ue=!1),ye&&(ve=!0),Ee&&(I=$({},Nc),L=Qs(null),Ee.html===!0&&($(I,Dc),$(L,Pc)),Ee.svg===!0&&($(I,Oc),$(L,Fc),$(L,Lc)),Ee.svgFilters===!0&&($(I,kc),$(L,Fc),$(L,Lc)),Ee.mathMl===!0&&($(I,jc),$(L,Ic),$(L,Lc))),ce.tagCheck=null,ce.attributeCheck=null,Z(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?ce.tagCheck=e.ADD_TAGS:sc(e.ADD_TAGS)&&(I===ae&&(I=Cc(I)),$(I,e.ADD_TAGS,U))),Z(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?ce.attributeCheck=e.ADD_ATTR:sc(e.ADD_ATTR)&&(L===oe&&(L=Cc(L)),$(L,e.ADD_ATTR,U))),Z(e,`ADD_URI_SAFE_ATTR`)&&sc(e.ADD_URI_SAFE_ATTR)&&$(ke,e.ADD_URI_SAFE_ATTR,U),Z(e,`FORBID_CONTENTS`)&&sc(e.FORBID_CONTENTS)&&(B===V&&(B=Cc(B)),$(B,e.FORBID_CONTENTS,U)),Z(e,`ADD_FORBID_CONTENTS`)&&sc(e.ADD_FORBID_CONTENTS)&&(B===V&&(B=Cc(B)),$(B,e.ADD_FORBID_CONTENTS,U)),we&&(I[`#text`]=!0),he&&$(I,[`html`,`head`,`body`]),I.table&&($(I,[`tbody`]),delete z.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw bc(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw bc(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=x;x=e.TRUSTED_TYPES_POLICY;try{S=w(``)}catch(e){throw x=t,e}}else x===void 0&&e.TRUSTED_TYPES_POLICY!==null&&(x=Xc(u,i)),x&&typeof S==`string`&&(S=w(``));(j.uponSanitizeElement.length>0||j.uponSanitizeAttribute.length>0)&&I===ae&&(I=Cc(I)),j.uponSanitizeAttribute.length>0&&L===oe&&(L=Cc(L)),Xs&&Xs(e),He=e},Ke=$({},[...Oc,...kc,...Ac]),qe=$({},[...jc,...Mc]),Je=function(e){let t=g(e);(!t||!t.tagName)&&(t={namespaceURI:Pe,tagName:`template`});let n=cc(e.tagName),r=cc(t.tagName);return Ie[e.namespaceURI]?e.namespaceURI===Me?t.namespaceURI===Ne?n===`svg`:t.namespaceURI===je?n===`svg`&&(r===`annotation-xml`||H[r]):!!Ke[n]:e.namespaceURI===je?t.namespaceURI===Ne?n===`math`:t.namespaceURI===Me?n===`math`&&Re[r]:!!qe[n]:e.namespaceURI===Ne?t.namespaceURI===Me&&!Re[r]||t.namespaceURI===je&&!H[r]?!1:!qe[n]&&(ze[n]||!Ke[n]):!!(Be===`application/xhtml+xml`&&Ie[e.namespaceURI]):!1},Ye=function(e){ac(t.removed,{element:e});try{g(e).removeChild(e)}catch{p(e)}},Xe=function(e,n){try{ac(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch{ac(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),e===`is`)if(ve||ye)try{Ye(n)}catch{}else try{n.setAttribute(e,``)}catch{}},Ze=function(e){let t=null,r=null;if(_e)e=`<remove></remove>`+e;else{let t=uc(e,/^[\r\n\t ]+/);r=t&&t[0]}Be===`application/xhtml+xml`&&Pe===Ne&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=x?w(e):e;if(Pe===Ne)try{t=new l().parseFromString(i,Be)}catch{}if(!t||!t.documentElement){t=E.createDocument(Pe,`template`,null);try{t.documentElement.innerHTML=Fe?S:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Pe===Ne?k.call(t,he?`html`:`body`)[0]:he?t.documentElement:a},Qe=function(e){return D.call(e.ownerDocument||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},$e=function(e){e.normalize();let t=D.call(e.ownerDocument||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),n=t.nextNode();for(;n;){let e=n.data;nc([M,N,P],t=>{e=dc(e,t,` `)}),n.data=e,n=t.nextNode()}let r=e.querySelectorAll?.call(e,`template`)??[];nc(Array.from(r),e=>{tt(e.content)&&$e(e.content)})},et=function(e){let t=b?b(e):null;return typeof t!=`string`||U(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==v(e)||typeof e.removeAttribute!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==y(e)||e.childNodes!==h(e)},tt=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return y(e)===Jc.documentFragment}catch{return!1}},nt=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return typeof y(e)==`number`}catch{return!1}};function rt(e,n,r){nc(e,e=>{e.call(t,n,r,He)})}let it=function(e){let n=null;if(rt(j.beforeSanitizeElements,e,null),et(e))return Ye(e),!0;let r=U(b?b(e):e.nodeName);if(rt(j.uponSanitizeElement,e,{tagName:r,allowedTags:I}),me&&e.hasChildNodes()&&!nt(e.firstElementChild)&&yc(/<[/\w!]/g,e.innerHTML)&&yc(/<[/\w!]/g,e.textContent)||me&&e.namespaceURI===Ne&&r===`style`&&nt(e.firstElementChild)||e.nodeType===Jc.progressingInstruction||me&&e.nodeType===Jc.comment&&yc(/<[/\w]/g,e.data))return Ye(e),!0;if(z[r]||!(ce.tagCheck instanceof Function&&ce.tagCheck(r))&&!I[r]){if(!z[r]&&st(r)&&(R.tagNameCheck instanceof RegExp&&yc(R.tagNameCheck,r)||R.tagNameCheck instanceof Function&&R.tagNameCheck(r)))return!1;if(we&&!B[r]){let t=g(e),n=h(e);if(n&&t){let r=n.length;for(let i=r-1;i>=0;--i){let r=f(n[i],!0);t.insertBefore(r,m(e))}}}return Ye(e),!0}return(y?y(e):e.nodeType)===Jc.element&&!Je(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&yc(/<\/no(script|embed|frames)/i,e.innerHTML)?(Ye(e),!0):(pe&&e.nodeType===Jc.text&&(n=e.textContent,nc([M,N,P],e=>{n=dc(n,e,` `)}),e.textContent!==n&&(ac(t.removed,{element:e.cloneNode()}),e.textContent=n)),rt(j.afterSanitizeElements,e,null),!1)},at=function(e,t,r){if(se[t]||xe&&(t===`id`||t===`name`)&&(r in n||r in Ue))return!1;let i=L[t]||ce.attributeCheck instanceof Function&&ce.attributeCheck(t,e);if(!(ue&&!se[t]&&yc(ee,t))&&!(le&&yc(te,t))){if(!i||se[t]){if(!(st(e)&&(R.tagNameCheck instanceof RegExp&&yc(R.tagNameCheck,e)||R.tagNameCheck instanceof Function&&R.tagNameCheck(e))&&(R.attributeNameCheck instanceof RegExp&&yc(R.attributeNameCheck,t)||R.attributeNameCheck instanceof Function&&R.attributeNameCheck(t,e))||t===`is`&&R.allowCustomizedBuiltInElements&&(R.tagNameCheck instanceof RegExp&&yc(R.tagNameCheck,r)||R.tagNameCheck instanceof Function&&R.tagNameCheck(r))))return!1}else if(!ke[t]&&!yc(ie,dc(r,ne,``))&&!((t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&fc(r,`data:`)===0&&De[e])&&!(de&&!yc(F,dc(r,ne,``)))&&r)return!1}return!0},ot=$({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),st=function(e){return!ot[cc(e)]&&yc(re,e)},ct=function(e){rt(j.beforeSanitizeAttributes,e,null);let n=e.attributes;if(!n||et(e))return;let r={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:L,forceKeepAttr:void 0},i=n.length;for(;i--;){let a=n[i],o=a.name,s=a.namespaceURI,c=a.value,l=U(o),d=c,f=o===`value`?d:pc(d);if(r.attrName=l,r.attrValue=f,r.keepAttr=!0,r.forceKeepAttr=void 0,rt(j.uponSanitizeAttribute,e,r),f=r.attrValue,Se&&(l===`id`||l===`name`)&&fc(f,Ce)!==0&&(Xe(o,e),f=Ce+f),me&&yc(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,f)){Xe(o,e);continue}if(l===`attributename`&&uc(f,`href`)){Xe(o,e);continue}if(r.forceKeepAttr)continue;if(!r.keepAttr){Xe(o,e);continue}if(!fe&&yc(/\/>/i,f)){Xe(o,e);continue}pe&&nc([M,N,P],e=>{f=dc(f,e,` `)});let p=U(e.nodeName);if(!at(p,l,f)){Xe(o,e);continue}if(x&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!s)switch(u.getAttributeType(p,l)){case`TrustedHTML`:f=w(f);break;case`TrustedScriptURL`:f=x.createScriptURL(f);break}if(f!==d)try{s?e.setAttributeNS(s,o,f):e.setAttribute(o,f),et(e)?Ye(e):ic(t.removed)}catch{Xe(o,e)}}rt(j.afterSanitizeAttributes,e,null)},lt=function(e){let t=null,n=Qe(e);for(rt(j.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(rt(j.uponSanitizeShadowNode,t,null),it(t),ct(t),tt(t.content)&&lt(t.content),(y?y(t):t.nodeType)===Jc.element){let e=_?_(t):t.shadowRoot;tt(e)&&(ut(e),lt(e))}rt(j.afterSanitizeShadowDOM,e,null)},ut=function(e){let t=y?y(e):e.nodeType;if(t===Jc.element){let t=_?_(e):e.shadowRoot;tt(t)&&(ut(t),lt(t))}let n=h?h(e):e.childNodes;if(!n)return;let r=[];nc(n,e=>{ac(r,e)});for(let e of r)ut(e);if(t===Jc.element){let t=b?b(e):null;if(typeof t==`string`&&U(t)===`template`){let t=e.content;tt(t)&&ut(t)}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(Fe=!e,Fe&&(e=`<!-->`),typeof e!=`string`&&!nt(e)&&(e=wc(e),typeof e!=`string`))throw bc(`dirty is not a string, aborting`);if(!t.isSupported)return e;if(ge||Ge(n),t.removed=[],typeof e==`string`&&(Te=!1),Te){let t=b?b(e):e.nodeName;if(typeof t==`string`){let e=U(t);if(!I[e]||z[e])throw bc(`root node is forbidden and cannot be sanitized in-place`)}if(et(e))throw bc(`root node is clobbered and cannot be sanitized in-place`);ut(e)}else if(nt(e))i=Ze(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===Jc.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),ut(a);else{if(!ve&&!pe&&!he&&e.indexOf(`<`)===-1)return x&&be?w(e):e;if(i=Ze(e),!i)return ve?null:be?S:``}i&&_e&&Ye(i.firstChild);let c=Qe(Te?e:i);for(;o=c.nextNode();)it(o),ct(o),tt(o.content)&&lt(o.content);if(Te)return pe&&$e(e),e;if(ve){if(pe&&$e(i),ye)for(s=O.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(L.shadowroot||L.shadowrootmode)&&(s=A.call(r,s,!0)),s}let l=he?i.outerHTML:i.innerHTML;return he&&I[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&yc(Kc,i.ownerDocument.doctype.name)&&(l=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
90
+ `+l),pe&&nc([M,N,P],e=>{l=dc(l,e,` `)}),x&&be?w(l):l},t.setConfig=function(){Ge(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}),ge=!0},t.clearConfig=function(){He=null,ge=!1},t.isValidAttribute=function(e,t,n){return He||Ge({}),at(U(e),U(t),n)},t.addHook=function(e,t){typeof t==`function`&&ac(j[e],t)},t.removeHook=function(e,t){if(t!==void 0){let n=rc(j[e],t);return n===-1?void 0:oc(j[e],n,1)[0]}return ic(j[e])},t.removeHooks=function(e){j[e]=[]},t.removeAllHooks=function(){j=Zc()},t}Qc(),new Ls({gfm:!0,breaks:!0,pedantic:!1,renderer:(()=>{let e=new Ms;return e.code=({text:e,lang:t})=>{let n=(t??``).toLowerCase(),r=hr(e,n);return`<pre><code${n?` class="language-${n}"`:``}>${r}</code></pre>`},e})()});export{ta as a,gi as i,Qe as n,Ye as o,Ei as r,ao as s,qr as t};