@thxgg/steward 0.1.24 → 0.1.26

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 (203) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/_nuxt/{Bc2V3wPK.js → B2ow85x_.js} +2 -2
  3. package/.output/public/_nuxt/{U78rMDmo.js → B6CbIr08.js} +1 -1
  4. package/.output/public/_nuxt/{BknRrWsw.js → BLQAF8wp.js} +1 -1
  5. package/.output/public/_nuxt/BXuwtOqb.js +1 -0
  6. package/.output/public/_nuxt/CAMiEhze.js +1 -0
  7. package/.output/public/_nuxt/{BRQ9Cxaw.js → CIBCqZF5.js} +1 -1
  8. package/.output/public/_nuxt/Ce0-nlm9.js +1 -0
  9. package/.output/public/_nuxt/{T11EuTtn.js → ConzneVY.js} +1 -1
  10. package/.output/public/_nuxt/D0qxz_Pn.js +1310 -0
  11. package/.output/public/_nuxt/D3PDtLSF.js +3 -0
  12. package/.output/public/_nuxt/{C73kduX-.js → DdKC0UAK.js} +1 -1
  13. package/.output/public/_nuxt/Detail.BGdvrJGh.css +1 -0
  14. package/.output/public/_nuxt/{C53_p0K1.js → Dkh9ic1y.js} +1 -1
  15. package/.output/public/_nuxt/LEjJTR7-.js +1 -0
  16. package/.output/public/_nuxt/{BTmXUZ_s.js → UqZfMfrZ.js} +1 -1
  17. package/.output/public/_nuxt/builds/latest.json +1 -1
  18. package/.output/public/_nuxt/builds/meta/25438e34-19a2-421d-aede-53fd18f1ccd4.json +1 -0
  19. package/.output/public/_nuxt/dckrK0oj.js +1 -0
  20. package/.output/public/_nuxt/entry.DT4p6_uW.css +1 -0
  21. package/.output/public/_nuxt/pIWeVmPw.js +1 -0
  22. package/.output/public/_nuxt/xrHaPo1U.js +60 -0
  23. package/.output/server/chunks/_/prd-service.mjs.map +1 -1
  24. package/.output/server/chunks/build/{Detail-DMMUwTWr.mjs → Detail-rpcemNXe.mjs} +674 -481
  25. package/.output/server/chunks/build/Detail-rpcemNXe.mjs.map +1 -0
  26. package/.output/server/chunks/build/DiffViewer-styles.B1FB5NJj.mjs +8 -0
  27. package/.output/server/chunks/build/DiffViewer-styles.B1FB5NJj.mjs.map +1 -0
  28. package/.output/server/chunks/build/{_prd_-ByugK4Yi.mjs → _prd_-CeibvZOH.mjs} +67 -233
  29. package/.output/server/chunks/build/_prd_-CeibvZOH.mjs.map +1 -0
  30. package/.output/server/chunks/build/client.precomputed.mjs +1 -1
  31. package/.output/server/chunks/build/{default-BKKgG7HJ.mjs → default-iq8SaDDN.mjs} +3 -3
  32. package/.output/server/chunks/build/default-iq8SaDDN.mjs.map +1 -0
  33. package/.output/server/chunks/build/{error-404-Bf6kdO80.mjs → error-404-DFale9A5.mjs} +2 -2
  34. package/.output/server/chunks/build/error-404-DFale9A5.mjs.map +1 -0
  35. package/.output/server/chunks/build/{index-DE1tjHAd.mjs → index-Po00RvHm.mjs} +2 -2
  36. package/.output/server/chunks/build/index-Po00RvHm.mjs.map +1 -0
  37. package/.output/server/chunks/build/{nuxt-link-SvT1nf8Z.mjs → nuxt-link-B4oWFn7n.mjs} +2 -2
  38. package/.output/server/chunks/build/nuxt-link-B4oWFn7n.mjs.map +1 -0
  39. package/.output/server/chunks/build/{repo-graph-DzT45gSB.mjs → repo-graph-BQVFpA-w.mjs} +5 -4
  40. package/.output/server/chunks/build/repo-graph-BQVFpA-w.mjs.map +1 -0
  41. package/.output/server/chunks/build/server.mjs +7 -7
  42. package/.output/server/chunks/build/styles.mjs +4 -5
  43. package/.output/server/chunks/build/{usePrd-hXZOmvAv.mjs → usePrd-Bb6jlnNZ.mjs} +2 -2
  44. package/.output/server/chunks/build/usePrd-Bb6jlnNZ.mjs.map +1 -0
  45. package/.output/server/chunks/nitro/nitro.mjs +983 -678
  46. package/.output/server/chunks/nitro/nitro.mjs.map +1 -1
  47. package/.output/server/node_modules/@pierre/diffs/dist/components/File.js +324 -0
  48. package/.output/server/node_modules/@pierre/diffs/dist/components/FileDiff.js +395 -0
  49. package/.output/server/node_modules/@pierre/diffs/dist/components/FileStream.js +161 -0
  50. package/.output/server/node_modules/@pierre/diffs/dist/components/web-components.js +25 -0
  51. package/.output/server/node_modules/@pierre/diffs/dist/constants.js +23 -0
  52. package/.output/server/node_modules/@pierre/diffs/dist/highlighter/languages/areLanguagesAttached.js +11 -0
  53. package/.output/server/node_modules/@pierre/diffs/dist/highlighter/languages/attachResolvedLanguages.js +20 -0
  54. package/.output/server/node_modules/@pierre/diffs/dist/highlighter/languages/cleanUpResolvedLanguages.js +11 -0
  55. package/.output/server/node_modules/@pierre/diffs/dist/highlighter/languages/constants.js +8 -0
  56. package/.output/server/node_modules/@pierre/diffs/dist/highlighter/languages/getResolvedLanguages.js +16 -0
  57. package/.output/server/node_modules/@pierre/diffs/dist/highlighter/languages/getResolvedOrResolveLanguage.js +11 -0
  58. package/.output/server/node_modules/@pierre/diffs/dist/highlighter/languages/hasResolvedLanguages.js +11 -0
  59. package/.output/server/node_modules/@pierre/diffs/dist/highlighter/languages/resolveLanguage.js +30 -0
  60. package/.output/server/node_modules/@pierre/diffs/dist/highlighter/languages/resolveLanguages.js +25 -0
  61. package/.output/server/node_modules/@pierre/diffs/dist/highlighter/shared_highlighter.js +71 -0
  62. package/.output/server/node_modules/@pierre/diffs/dist/highlighter/themes/areThemesAttached.js +12 -0
  63. package/.output/server/node_modules/@pierre/diffs/dist/highlighter/themes/attachResolvedThemes.js +24 -0
  64. package/.output/server/node_modules/@pierre/diffs/dist/highlighter/themes/cleanUpResolvedThemes.js +11 -0
  65. package/.output/server/node_modules/@pierre/diffs/dist/highlighter/themes/constants.js +9 -0
  66. package/.output/server/node_modules/@pierre/diffs/dist/highlighter/themes/getResolvedOrResolveTheme.js +11 -0
  67. package/.output/server/node_modules/@pierre/diffs/dist/highlighter/themes/getResolvedThemes.js +16 -0
  68. package/.output/server/node_modules/@pierre/diffs/dist/highlighter/themes/hasResolvedThemes.js +11 -0
  69. package/.output/server/node_modules/@pierre/diffs/dist/highlighter/themes/registerCustomCSSVariableTheme.js +18 -0
  70. package/.output/server/node_modules/@pierre/diffs/dist/highlighter/themes/registerCustomTheme.js +14 -0
  71. package/.output/server/node_modules/@pierre/diffs/dist/highlighter/themes/resolveTheme.js +35 -0
  72. package/.output/server/node_modules/@pierre/diffs/dist/highlighter/themes/resolveThemes.js +21 -0
  73. package/.output/server/node_modules/@pierre/diffs/dist/index.js +84 -0
  74. package/.output/server/node_modules/@pierre/diffs/dist/managers/LineSelectionManager.js +282 -0
  75. package/.output/server/node_modules/@pierre/diffs/dist/managers/MouseEventManager.js +244 -0
  76. package/.output/server/node_modules/@pierre/diffs/dist/managers/ResizeManager.js +132 -0
  77. package/.output/server/node_modules/@pierre/diffs/dist/managers/ScrollSyncManager.js +62 -0
  78. package/.output/server/node_modules/@pierre/diffs/dist/managers/UniversalRenderingManager.js +32 -0
  79. package/.output/server/node_modules/@pierre/diffs/dist/renderers/DiffHunksRenderer.js +655 -0
  80. package/.output/server/node_modules/@pierre/diffs/dist/renderers/FileRenderer.js +243 -0
  81. package/.output/server/node_modules/@pierre/diffs/dist/shiki-stream/stream.js +32 -0
  82. package/.output/server/node_modules/@pierre/diffs/dist/shiki-stream/tokenizer.js +71 -0
  83. package/.output/server/node_modules/@pierre/diffs/dist/sprite.js +55 -0
  84. package/.output/server/node_modules/@pierre/diffs/dist/style.js +6 -0
  85. package/.output/server/node_modules/@pierre/diffs/dist/themes/pierre-dark.js +1328 -0
  86. package/.output/server/node_modules/@pierre/diffs/dist/themes/pierre-light.js +1328 -0
  87. package/.output/server/node_modules/@pierre/diffs/dist/utils/areFilesEqual.js +8 -0
  88. package/.output/server/node_modules/@pierre/diffs/dist/utils/areObjectsEqual.js +18 -0
  89. package/.output/server/node_modules/@pierre/diffs/dist/utils/areOptionsEqual.js +12 -0
  90. package/.output/server/node_modules/@pierre/diffs/dist/utils/areSelectionsEqual.js +8 -0
  91. package/.output/server/node_modules/@pierre/diffs/dist/utils/areThemesEqual.js +9 -0
  92. package/.output/server/node_modules/@pierre/diffs/dist/utils/cleanLastNewline.js +8 -0
  93. package/.output/server/node_modules/@pierre/diffs/dist/utils/createAnnotationElement.js +21 -0
  94. package/.output/server/node_modules/@pierre/diffs/dist/utils/createAnnotationWrapperNode.js +12 -0
  95. package/.output/server/node_modules/@pierre/diffs/dist/utils/createCodeNode.js +12 -0
  96. package/.output/server/node_modules/@pierre/diffs/dist/utils/createEmptyRowBuffer.js +16 -0
  97. package/.output/server/node_modules/@pierre/diffs/dist/utils/createFileHeaderElement.js +84 -0
  98. package/.output/server/node_modules/@pierre/diffs/dist/utils/createHoverContentNode.js +15 -0
  99. package/.output/server/node_modules/@pierre/diffs/dist/utils/createNoNewlineElement.js +24 -0
  100. package/.output/server/node_modules/@pierre/diffs/dist/utils/createPreElement.js +28 -0
  101. package/.output/server/node_modules/@pierre/diffs/dist/utils/createRowNodes.js +20 -0
  102. package/.output/server/node_modules/@pierre/diffs/dist/utils/createSeparator.js +69 -0
  103. package/.output/server/node_modules/@pierre/diffs/dist/utils/createSpanNodeFromToken.js +13 -0
  104. package/.output/server/node_modules/@pierre/diffs/dist/utils/createStyleElement.js +19 -0
  105. package/.output/server/node_modules/@pierre/diffs/dist/utils/createTransformerWithState.js +56 -0
  106. package/.output/server/node_modules/@pierre/diffs/dist/utils/createUnsafeCSSStyleNode.js +12 -0
  107. package/.output/server/node_modules/@pierre/diffs/dist/utils/cssWrappers.js +21 -0
  108. package/.output/server/node_modules/@pierre/diffs/dist/utils/diffAcceptRejectHunk.js +82 -0
  109. package/.output/server/node_modules/@pierre/diffs/dist/utils/formatCSSVariablePrefix.js +8 -0
  110. package/.output/server/node_modules/@pierre/diffs/dist/utils/getFiletypeFromFileName.js +343 -0
  111. package/.output/server/node_modules/@pierre/diffs/dist/utils/getHighlighterOptions.js +13 -0
  112. package/.output/server/node_modules/@pierre/diffs/dist/utils/getHighlighterThemeStyles.js +40 -0
  113. package/.output/server/node_modules/@pierre/diffs/dist/utils/getHunkSeparatorSlotName.js +8 -0
  114. package/.output/server/node_modules/@pierre/diffs/dist/utils/getIconForType.js +15 -0
  115. package/.output/server/node_modules/@pierre/diffs/dist/utils/getLineAnnotationName.js +8 -0
  116. package/.output/server/node_modules/@pierre/diffs/dist/utils/getLineEndingType.js +11 -0
  117. package/.output/server/node_modules/@pierre/diffs/dist/utils/getLineNodes.js +15 -0
  118. package/.output/server/node_modules/@pierre/diffs/dist/utils/getSingularPatch.js +20 -0
  119. package/.output/server/node_modules/@pierre/diffs/dist/utils/getThemes.js +16 -0
  120. package/.output/server/node_modules/@pierre/diffs/dist/utils/getTotalLineCountFromHunks.js +10 -0
  121. package/.output/server/node_modules/@pierre/diffs/dist/utils/hast_utils.js +42 -0
  122. package/.output/server/node_modules/@pierre/diffs/dist/utils/isWorkerContext.js +8 -0
  123. package/.output/server/node_modules/@pierre/diffs/dist/utils/parseDiffDecorations.js +34 -0
  124. package/.output/server/node_modules/@pierre/diffs/dist/utils/parseDiffFromFile.js +23 -0
  125. package/.output/server/node_modules/@pierre/diffs/dist/utils/parseLineType.js +17 -0
  126. package/.output/server/node_modules/@pierre/diffs/dist/utils/parsePatchFiles.js +211 -0
  127. package/.output/server/node_modules/@pierre/diffs/dist/utils/prerenderHTMLIfNecessary.js +10 -0
  128. package/.output/server/node_modules/@pierre/diffs/dist/utils/processLine.js +42 -0
  129. package/.output/server/node_modules/@pierre/diffs/dist/utils/renderDiffWithHighlighter.js +339 -0
  130. package/.output/server/node_modules/@pierre/diffs/dist/utils/renderFileWithHighlighter.js +52 -0
  131. package/.output/server/node_modules/@pierre/diffs/dist/utils/setLanguageOverride.js +11 -0
  132. package/.output/server/node_modules/@pierre/diffs/dist/utils/setWrapperNodeProps.js +29 -0
  133. package/.output/server/node_modules/@pierre/diffs/package.json +89 -0
  134. package/.output/server/node_modules/@shikijs/transformers/dist/index.mjs +831 -0
  135. package/.output/server/node_modules/@shikijs/transformers/package.json +37 -0
  136. package/.output/server/node_modules/diff/libesm/convert/dmp.js +21 -0
  137. package/.output/server/node_modules/diff/libesm/convert/xml.js +31 -0
  138. package/.output/server/node_modules/diff/libesm/diff/array.js +16 -0
  139. package/.output/server/node_modules/diff/libesm/diff/base.js +253 -0
  140. package/.output/server/node_modules/diff/libesm/diff/character.js +7 -0
  141. package/.output/server/node_modules/diff/libesm/diff/css.js +10 -0
  142. package/.output/server/node_modules/diff/libesm/diff/json.js +78 -0
  143. package/.output/server/node_modules/diff/libesm/diff/line.js +65 -0
  144. package/.output/server/node_modules/diff/libesm/diff/sentence.js +43 -0
  145. package/.output/server/node_modules/diff/libesm/diff/word.js +296 -0
  146. package/.output/server/node_modules/diff/libesm/index.js +30 -0
  147. package/.output/server/node_modules/diff/libesm/package.json +1 -0
  148. package/.output/server/node_modules/diff/libesm/patch/apply.js +257 -0
  149. package/.output/server/node_modules/diff/libesm/patch/create.js +228 -0
  150. package/.output/server/node_modules/diff/libesm/patch/line-endings.js +44 -0
  151. package/.output/server/node_modules/diff/libesm/patch/parse.js +147 -0
  152. package/.output/server/node_modules/diff/libesm/patch/reverse.js +23 -0
  153. package/.output/server/node_modules/diff/libesm/util/distance-iterator.js +37 -0
  154. package/.output/server/node_modules/diff/libesm/util/params.js +14 -0
  155. package/.output/server/node_modules/diff/libesm/util/string.js +128 -0
  156. package/.output/server/node_modules/diff/package.json +132 -0
  157. package/.output/server/package.json +4 -1
  158. package/README.md +41 -0
  159. package/bin/prd +1 -1
  160. package/dist/host/src/index.js +10 -0
  161. package/dist/host/src/sync.js +201 -0
  162. package/dist/server/utils/db.js +64 -0
  163. package/dist/server/utils/git.js +8 -6
  164. package/dist/server/utils/prd-state.js +24 -2
  165. package/dist/server/utils/repos.js +12 -2
  166. package/dist/server/utils/state-migration.js +4 -3
  167. package/dist/server/utils/sync-apply.js +380 -0
  168. package/dist/server/utils/sync-export.js +183 -0
  169. package/dist/server/utils/sync-identity.js +231 -0
  170. package/dist/server/utils/sync-inspect.js +103 -0
  171. package/dist/server/utils/sync-merge.js +579 -0
  172. package/dist/server/utils/sync-schema.js +100 -0
  173. package/package.json +2 -1
  174. package/.output/public/_nuxt/6tINjQEd.js +0 -141
  175. package/.output/public/_nuxt/B2mIQf5X.js +0 -3
  176. package/.output/public/_nuxt/C0BBSDJ7.js +0 -1
  177. package/.output/public/_nuxt/CN46Bgts.js +0 -1
  178. package/.output/public/_nuxt/CTJgb0zb.js +0 -1
  179. package/.output/public/_nuxt/Cce168lk.js +0 -30
  180. package/.output/public/_nuxt/CyVSeLw5.js +0 -1
  181. package/.output/public/_nuxt/Detail.CYc96mGf.css +0 -1
  182. package/.output/public/_nuxt/ZNypZshD.js +0 -13
  183. package/.output/public/_nuxt/builds/meta/8c342d49-fe70-4f67-a987-821c16f86125.json +0 -1
  184. package/.output/public/_nuxt/entry.Bw0CE6Iz.css +0 -1
  185. package/.output/public/_nuxt/pYJYAY-W.js +0 -60
  186. package/.output/server/chunks/build/Detail-DMMUwTWr.mjs.map +0 -1
  187. package/.output/server/chunks/build/DiffViewer-styles-1.mjs-d2dQvARr.mjs +0 -4
  188. package/.output/server/chunks/build/DiffViewer-styles-1.mjs-d2dQvARr.mjs.map +0 -1
  189. package/.output/server/chunks/build/DiffViewer-styles-2.mjs-X6QKNjM0.mjs +0 -4
  190. package/.output/server/chunks/build/DiffViewer-styles-2.mjs-X6QKNjM0.mjs.map +0 -1
  191. package/.output/server/chunks/build/DiffViewer-styles.0AbHFl6N.mjs +0 -8
  192. package/.output/server/chunks/build/DiffViewer-styles.0AbHFl6N.mjs.map +0 -1
  193. package/.output/server/chunks/build/DiffViewer-styles.BDwAqkTk.mjs +0 -8
  194. package/.output/server/chunks/build/DiffViewer-styles.BDwAqkTk.mjs.map +0 -1
  195. package/.output/server/chunks/build/DiffViewer-styles.DRJh5Ui4.mjs +0 -10
  196. package/.output/server/chunks/build/DiffViewer-styles.DRJh5Ui4.mjs.map +0 -1
  197. package/.output/server/chunks/build/_prd_-ByugK4Yi.mjs.map +0 -1
  198. package/.output/server/chunks/build/default-BKKgG7HJ.mjs.map +0 -1
  199. package/.output/server/chunks/build/error-404-Bf6kdO80.mjs.map +0 -1
  200. package/.output/server/chunks/build/index-DE1tjHAd.mjs.map +0 -1
  201. package/.output/server/chunks/build/nuxt-link-SvT1nf8Z.mjs.map +0 -1
  202. package/.output/server/chunks/build/repo-graph-DzT45gSB.mjs.map +0 -1
  203. package/.output/server/chunks/build/usePrd-hXZOmvAv.mjs.map +0 -1
@@ -0,0 +1,1310 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./DxNHbxmM.js","./CnnebwVN.js","./wDzz0qaB.js","./DPfMkruS.js","./Cl0AqbOI.js","./2EtD6e53.js","./Cn7AkR1O.js","./BGJmEYvX.js","./CylS5w8V.js","./Cp-IABpG.js","./DxSwrfjg.js","./BPQ3VLAy.js","./CXtECtnM.js","./COt5Ahok.js","./5X7smno1.js","./DGP4VlC8.js","./BLtJtn59.js","./CquLrc37.js","./DVxCFoDh.js","./CO1LY3CK.js","./B6aJPvgy.js","./BYV0-3_D.js","./CxbxFI8M.js","./Bp3cYrEr.js","./CDVJQ6XC.js","./DZxFcAj9.js","./BIGW1oBm.js","./fKv21gyL.js","./Yzrsuije.js","./DZu-aV2c.js","./CpOuai2O.js","./CeZK1NFH.js","./CGscLIrv.js","./Bhrxn6JZ.js","./CmIQRyeF.js","./C9oPPf7i.js","./g9-lgVsj.js","./CnsnAmq5.js","./Buea-lGh.js","./CuPHTKiy.js","./Cvjx9yec.js","./B7c-h3xW.js","./BxgE0vQu.js","./BTifaqeh.js","./CenWIFCC.js","./DkwncUOv.js","./C5YyOfLZ.js","./CxGSJlkm.js","./D97Zzqfu.js","./CSXwinHm.js","./YqXBG_HV.js","./BR5kRUq4.js","./CLZrNe3w.js","./m17aaUwq.js","./CufHLc7y.js","./CYsAdtH9.js","./fuZLfV_i.js","./DWrx1Km3.js","./CzTSHFRz.js","./CXZktZb0.js","./Br6cN0cg.js","./W9tJ9s81.js","./Dspwwk_N.js","./DMwsHuHA.js","./CQ8jqdy-.js","./mjskCLCv.js","./83L43bj1.js","./B1dDrJ26.js","./TsXTqZ29.js","./Dph4kLrZ.js","./DhmSosst.js","./BzTr9Aqm.js","./DJjDtW9f.js","./BLmx8bSh.js","./BVQ-GDCI.js","./DsumFeuD.js","./COcwbKMJ.js","./DQwYQDb2.js","./D1j8_8rp.js","./CG8Ifv2g.js","./BqTXFGrv.js","./D3lLCCz7.js","./Cq5zzVJU.js","./Dzze3sRP.js","./BRZ36xJF.js","./BsS91CYL.js","./DM8c43g1.js","./BH7IYjvW.js","./DYoxhk2S.js","./CZhp0h8q.js","./CxLEBnE3.js","./Cm3UrAx6.js","./RNghxpo_.js","./DEthMvLe.js","./DqQDbK_p.js","./CW8IKDeL.js","./BEDo0Tqx.js","./yv6CvBhz.js"])))=>i.map(i=>d[i]);
2
+ import{c as We,r as $h,t as Vh,e as Bh,f as Fh,g as ya,P as Dt,h as zh,i as gc,j as ll,k as Hh,B as on,l as sr,d as ar,b as Gh,F as jh}from"./CAMiEhze.js";import{D as xs,q as fe,B as nt,s as te,g as me,E as Yr,o as X,v as ye,w as le,b as ie,l as k,x as be,C as Xr,G as yt,H as vc,c as re,I as Ze,k as xe,J as _a,K as kr,L as Mn,M as Pt,N as tt,O as Uh,P as ba,n as we,Q as Wh,p as yc,R as Kr,S as Zr,d as Le,t as _e,z as Lt,T as qh,_ as T,U as Yh,i as lr,V as _c,y as et,W as Xh,a as ee,F as De,r as Wt,X as Kh,Y as Re,Z as ur,$ as Qn,a0 as Pe,a1 as Te,a2 as Zh,m as wa,a3 as Qh,a4 as Jh,a5 as Un,a6 as ep,a7 as bc,a8 as tp,a9 as np,aa as rp,ab as op,ac as ip}from"./B2ow85x_.js";import{u as wc,a as Ec,f as xc,c as cr,E as sp,b as ap,d as Ea,g as lp,w as up,e as rt,P as kc,V as cp,D as dp,h as Cc,i as pi,T as fp,j as En,L as ks,C as Do,G as hp,k as pp,R as ul,K as mp,S as gp,l as vp,B as Co,m as yp,n as _p,o as bp,p as wp,q as Ep,r as xp,s as kp,t as Cp,v as Sp}from"./D3PDtLSF.js";import{A as cl}from"./Dkh9ic1y.js";import{_ as Tp}from"./DlAUqK2U.js";import{_ as Ap}from"./LEjJTR7-.js";const Lp=We("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);const Ip=We("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);const $o=We("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const Cr=We("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const Sc=We("clock-3",[["path",{d:"M12 6v6h4",key:"135r8i"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const Pp=We("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const Np=We("diff",[["path",{d:"M12 3v14",key:"7cf3v8"}],["path",{d:"M5 10h14",key:"elsbfy"}],["path",{d:"M5 21h14",key:"11awu3"}]]);const Rp=We("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);const Mp=We("file-exclamation-point",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const Op=We("file-pen",[["path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",key:"o6klzx"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",key:"zhnas1"}]]);const Dp=We("file-plus",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]);const $p=We("file-x",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m14.5 12.5-5 5",key:"b62r18"}],["path",{d:"m9.5 12.5 5 5",key:"1rk7el"}]]);const Vp=We("folder-git-2",[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]]);const Bp=We("git-commit-horizontal",[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]]);const Fp=We("link-2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);const zp=We("list-ordered",[["path",{d:"M11 5h10",key:"1cz7ny"}],["path",{d:"M11 12h10",key:"1438ji"}],["path",{d:"M11 19h10",key:"11t30w"}],["path",{d:"M4 4h1v5",key:"10yrso"}],["path",{d:"M4 9h2",key:"r1h2o0"}],["path",{d:"M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02",key:"xtkcd5"}]]);const Hp=We("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);const Gp=We("square-check-big",[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const jp=We("tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);function Up(e,t){const n=$h(!1,300);Vh(()=>{n.value=!1});const r=fe(null),o=Bh();function i(){r.value=null,n.value=!1}function s(a,l){const u=a.currentTarget,c={x:a.clientX,y:a.clientY},d=Wp(c,u.getBoundingClientRect()),f=qp(c,d,1),h=Yp(l.getBoundingClientRect()),p=Kp([...f,...h]);r.value=p,n.value=!0}return xs(a=>{if(e.value&&t.value){const l=c=>s(c,t.value),u=c=>s(c,e.value);e.value.addEventListener("pointerleave",l),t.value.addEventListener("pointerleave",u),a(()=>{e.value?.removeEventListener("pointerleave",l),t.value?.removeEventListener("pointerleave",u)})}}),xs(a=>{if(r.value){const l=u=>{if(!r.value||!(u.target instanceof Element))return;const c=u.target,d={x:u.clientX,y:u.clientY},f=e.value?.contains(c)||t.value?.contains(c),h=!Xp(d,r.value),p=!!c.closest("[data-grace-area-trigger]");f?i():(h||p)&&(i(),o.trigger())};e.value?.ownerDocument.addEventListener("pointermove",l),a(()=>e.value?.ownerDocument.removeEventListener("pointermove",l))}}),{isPointerInTransit:n,onPointerExit:o.on}}function Wp(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function qp(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Yp(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function Xp(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const a=t[i].x,l=t[i].y,u=t[s].x,c=t[s].y;l>r!=c>r&&n<(u-a)*(r-l)/(c-l)+a&&(o=!o)}return o}function Kp(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),Zp(t)}function Zp(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const i=n[n.length-1],s=n[n.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}function Qp(e){const t=fe(),n=te(()=>t.value?.width??0),r=te(()=>t.value?.height??0);return nt(()=>{const o=Fh(e);if(o){t.value={width:o.offsetWidth,height:o.offsetHeight};const i=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const a=s[0];let l,u;if("borderBoxSize"in a){const c=a.borderBoxSize,d=Array.isArray(c)?c[0]:c;l=d.inlineSize,u=d.blockSize}else l=o.offsetWidth,u=o.offsetHeight;t.value={width:l,height:u}});return i.observe(o,{box:"border-box"}),()=>i.unobserve(o)}else t.value=void 0}),{width:n,height:r}}const[Jp,em]=cr("RovingFocusGroup");var tm=me({__name:"RovingFocusGroup",props:{orientation:{type:String,required:!1,default:void 0},dir:{type:String,required:!1},loop:{type:Boolean,required:!1,default:!1},currentTabStopId:{type:[String,null],required:!1},defaultCurrentTabStopId:{type:String,required:!1},preventScrollOnEntryFocus:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["entryFocus","update:currentTabStopId"],setup(e,{expose:t,emit:n}){const r=e,o=n,{loop:i,orientation:s,dir:a}=Yr(r),l=wc(a),u=ya(r,"currentTabStopId",o,{defaultValue:r.defaultCurrentTabStopId,passive:r.currentTabStopId===void 0}),c=fe(!1),d=fe(!1),f=fe(0),{getItems:h,CollectionSlot:p}=Ec({isProvider:!0});function b(y){const g=!d.value;if(y.currentTarget&&y.target===y.currentTarget&&g&&!c.value){const m=new CustomEvent(sp,ap);if(y.currentTarget.dispatchEvent(m),o("entryFocus",m),!m.defaultPrevented){const v=h().map(W=>W.ref).filter(W=>W.dataset.disabled!==""),x=v.find(W=>W.getAttribute("data-active")===""),L=v.find(W=>W.getAttribute("data-highlighted")===""),P=v.find(W=>W.id===u.value),O=[x,L,P,...v].filter(Boolean);xc(O,r.preventScrollOnEntryFocus)}}d.value=!1}function _(){setTimeout(()=>{d.value=!1},1)}return t({getItems:h}),em({loop:i,dir:l,orientation:s,currentTabStopId:u,onItemFocus:y=>{u.value=y},onItemShiftTab:()=>{c.value=!0},onFocusableItemAdd:()=>{f.value++},onFocusableItemRemove:()=>{f.value--}}),(y,g)=>(X(),ye(k(p),null,{default:le(()=>[ie(k(Dt),{tabindex:c.value||f.value===0?-1:0,"data-orientation":k(s),as:y.as,"as-child":y.asChild,dir:k(l),style:{outline:"none"},onMousedown:g[0]||(g[0]=m=>d.value=!0),onMouseup:_,onFocus:b,onBlur:g[1]||(g[1]=m=>c.value=!1)},{default:le(()=>[be(y.$slots,"default")]),_:3},8,["tabindex","data-orientation","as","as-child","dir"])]),_:3}))}}),nm=tm,rm=me({__name:"RovingFocusItem",props:{tabStopId:{type:String,required:!1},focusable:{type:Boolean,required:!1,default:!0},active:{type:Boolean,required:!1},allowShiftKey:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(e){const t=e,n=Jp(),r=Ea(),o=te(()=>t.tabStopId||r),i=te(()=>n.currentTabStopId.value===o.value),{getItems:s,CollectionItem:a}=Ec();nt(()=>{t.focusable&&n.onFocusableItemAdd()}),Xr(()=>{t.focusable&&n.onFocusableItemRemove()});function l(u){if(u.key==="Tab"&&u.shiftKey){n.onItemShiftTab();return}if(u.target!==u.currentTarget)return;const c=lp(u,n.orientation.value,n.dir.value);if(c!==void 0){if(u.metaKey||u.ctrlKey||u.altKey||!t.allowShiftKey&&u.shiftKey)return;u.preventDefault();let d=[...s().map(f=>f.ref).filter(f=>f.dataset.disabled!=="")];if(c==="last")d.reverse();else if(c==="prev"||c==="next"){c==="prev"&&d.reverse();const f=d.indexOf(u.currentTarget);d=n.loop.value?up(d,f+1):d.slice(f+1)}yt(()=>xc(d))}}return(u,c)=>(X(),ye(k(a),null,{default:le(()=>[ie(k(Dt),{tabindex:i.value?0:-1,"data-orientation":k(n).orientation.value,"data-active":u.active?"":void 0,"data-disabled":u.focusable?void 0:"",as:u.as,"as-child":u.asChild,onMousedown:c[0]||(c[0]=d=>{u.focusable?k(n).onItemFocus(o.value):d.preventDefault()}),onFocus:c[1]||(c[1]=d=>k(n).onItemFocus(o.value)),onKeydown:l},{default:le(()=>[be(u.$slots,"default")]),_:3},8,["tabindex","data-orientation","data-active","data-disabled","as","as-child"])]),_:3}))}}),om=rm;const[Tc,im]=cr("PopperRoot");var sm=me({inheritAttrs:!1,__name:"PopperRoot",setup(e){const t=fe();return im({anchor:t,onAnchorChange:n=>t.value=n}),(n,r)=>be(n.$slots,"default")}}),am=sm,lm=me({__name:"PopperAnchor",props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e,{forwardRef:n,currentElement:r}=rt(),o=Tc();return vc(()=>{o.onAnchorChange(t.reference??r.value)}),(i,s)=>(X(),ye(k(Dt),{ref:k(n),as:i.as,"as-child":i.asChild},{default:le(()=>[be(i.$slots,"default")]),_:3},8,["as","as-child"]))}}),um=lm;const cm={key:0,d:"M0 0L6 6L12 0"},dm={key:1,d:"M0 0L4.58579 4.58579C5.36683 5.36683 6.63316 5.36684 7.41421 4.58579L12 0"};var fm=me({__name:"Arrow",props:{width:{type:Number,required:!1,default:10},height:{type:Number,required:!1,default:5},rounded:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"svg"}},setup(e){const t=e;return rt(),(n,r)=>(X(),ye(k(Dt),Ze(t,{width:n.width,height:n.height,viewBox:n.asChild?void 0:"0 0 12 6",preserveAspectRatio:n.asChild?void 0:"none"}),{default:le(()=>[be(n.$slots,"default",{},()=>[n.rounded?(X(),re("path",dm)):(X(),re("path",cm))])]),_:3},16,["width","height","viewBox","preserveAspectRatio"]))}}),hm=fm;function pm(e){return e!==null}function mm(e){return{name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,s=o.arrow?.centerOffset!==0,a=s?0:e.arrowWidth,l=s?0:e.arrowHeight,[u,c]=Cs(n),d={start:"0%",center:"50%",end:"100%"}[c],f=(o.arrow?.x??0)+a/2,h=(o.arrow?.y??0)+l/2;let p="",b="";return u==="bottom"?(p=s?d:`${f}px`,b=`${-l}px`):u==="top"?(p=s?d:`${f}px`,b=`${r.floating.height+l}px`):u==="right"?(p=`${-l}px`,b=s?d:`${h}px`):u==="left"&&(p=`${r.floating.width+l}px`,b=s?d:`${h}px`),{data:{x:p,y:b}}}}}function Cs(e){const[t,n="center"]=e.split("-");return[t,n]}const gm=["top","right","bottom","left"],ln=Math.min,lt=Math.max,Vo=Math.round,io=Math.floor,Rt=e=>({x:e,y:e}),vm={left:"right",right:"left",bottom:"top",top:"bottom"},ym={start:"end",end:"start"};function Ss(e,t,n){return lt(e,ln(t,n))}function Xt(e,t){return typeof e=="function"?e(t):e}function Kt(e){return e.split("-")[0]}function dr(e){return e.split("-")[1]}function xa(e){return e==="x"?"y":"x"}function ka(e){return e==="y"?"height":"width"}const _m=new Set(["top","bottom"]);function Nt(e){return _m.has(Kt(e))?"y":"x"}function Ca(e){return xa(Nt(e))}function bm(e,t,n){n===void 0&&(n=!1);const r=dr(e),o=Ca(e),i=ka(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Bo(s)),[s,Bo(s)]}function wm(e){const t=Bo(e);return[Ts(e),t,Ts(t)]}function Ts(e){return e.replace(/start|end/g,t=>ym[t])}const dl=["left","right"],fl=["right","left"],Em=["top","bottom"],xm=["bottom","top"];function km(e,t,n){switch(e){case"top":case"bottom":return n?t?fl:dl:t?dl:fl;case"left":case"right":return t?Em:xm;default:return[]}}function Cm(e,t,n,r){const o=dr(e);let i=km(Kt(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(Ts)))),i}function Bo(e){return e.replace(/left|right|bottom|top/g,t=>vm[t])}function Sm(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ac(e){return typeof e!="number"?Sm(e):{top:e,right:e,bottom:e,left:e}}function Fo(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function hl(e,t,n){let{reference:r,floating:o}=e;const i=Nt(t),s=Ca(t),a=ka(s),l=Kt(t),u=i==="y",c=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[a]/2-o[a]/2;let h;switch(l){case"top":h={x:c,y:r.y-o.height};break;case"bottom":h={x:c,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-o.width,y:d};break;default:h={x:r.x,y:r.y}}switch(dr(t)){case"start":h[s]-=f*(n&&u?-1:1);break;case"end":h[s]+=f*(n&&u?-1:1);break}return h}async function Tm(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=Xt(t,e),p=Ac(h),_=a[f?d==="floating"?"reference":"floating":d],y=Fo(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(_)))==null||n?_:_.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:u,rootBoundary:c,strategy:l})),g=d==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,m=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),v=await(i.isElement==null?void 0:i.isElement(m))?await(i.getScale==null?void 0:i.getScale(m))||{x:1,y:1}:{x:1,y:1},x=Fo(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:g,offsetParent:m,strategy:l}):g);return{top:(y.top-x.top+p.top)/v.y,bottom:(x.bottom-y.bottom+p.bottom)/v.y,left:(y.left-x.left+p.left)/v.x,right:(x.right-y.right+p.right)/v.x}}const Am=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let u=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:d}=hl(u,r,l),f=r,h={},p=0;for(let _=0;_<a.length;_++){var b;const{name:y,fn:g}=a[_],{x:m,y:v,data:x,reset:L}=await g({x:c,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:h,rects:u,platform:{...s,detectOverflow:(b=s.detectOverflow)!=null?b:Tm},elements:{reference:e,floating:t}});c=m??c,d=v??d,h={...h,[y]:{...h[y],...x}},L&&p<=50&&(p++,typeof L=="object"&&(L.placement&&(f=L.placement),L.rects&&(u=L.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):L.rects),{x:c,y:d}=hl(u,f,l)),_=-1)}return{x:c,y:d,placement:f,strategy:o,middlewareData:h}},Lm=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:u,padding:c=0}=Xt(e,t)||{};if(u==null)return{};const d=Ac(c),f={x:n,y:r},h=Ca(o),p=ka(h),b=await s.getDimensions(u),_=h==="y",y=_?"top":"left",g=_?"bottom":"right",m=_?"clientHeight":"clientWidth",v=i.reference[p]+i.reference[h]-f[h]-i.floating[p],x=f[h]-i.reference[h],L=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u));let P=L?L[m]:0;(!P||!await(s.isElement==null?void 0:s.isElement(L)))&&(P=a.floating[m]||i.floating[p]);const O=v/2-x/2,W=P/2-b[p]/2-1,N=ln(d[y],W),M=ln(d[g],W),C=N,F=P-b[p]-M,E=P/2-b[p]/2+O,$=Ss(C,E,F),A=!l.arrow&&dr(o)!=null&&E!==$&&i.reference[p]/2-(E<C?N:M)-b[p]/2<0,V=A?E<C?E-C:E-F:0;return{[h]:f[h]+V,data:{[h]:$,centerOffset:E-$-V,...A&&{alignmentOffset:V}},reset:A}}}),Im=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:u}=t,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:b=!0,..._}=Xt(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const y=Kt(o),g=Nt(a),m=Kt(a)===a,v=await(l.isRTL==null?void 0:l.isRTL(u.floating)),x=f||(m||!b?[Bo(a)]:wm(a)),L=p!=="none";!f&&L&&x.push(...Cm(a,b,p,v));const P=[a,...x],O=await l.detectOverflow(t,_),W=[];let N=((r=i.flip)==null?void 0:r.overflows)||[];if(c&&W.push(O[y]),d){const E=bm(o,s,v);W.push(O[E[0]],O[E[1]])}if(N=[...N,{placement:o,overflows:W}],!W.every(E=>E<=0)){var M,C;const E=(((M=i.flip)==null?void 0:M.index)||0)+1,$=P[E];if($&&(!(d==="alignment"?g!==Nt($):!1)||N.every(z=>Nt(z.placement)===g?z.overflows[0]>0:!0)))return{data:{index:E,overflows:N},reset:{placement:$}};let A=(C=N.filter(V=>V.overflows[0]<=0).sort((V,z)=>V.overflows[1]-z.overflows[1])[0])==null?void 0:C.placement;if(!A)switch(h){case"bestFit":{var F;const V=(F=N.filter(z=>{if(L){const G=Nt(z.placement);return G===g||G==="y"}return!0}).map(z=>[z.placement,z.overflows.filter(G=>G>0).reduce((G,U)=>G+U,0)]).sort((z,G)=>z[1]-G[1])[0])==null?void 0:F[0];V&&(A=V);break}case"initialPlacement":A=a;break}if(o!==A)return{reset:{placement:A}}}return{}}}};function pl(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ml(e){return gm.some(t=>e[t]>=0)}const Pm=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...i}=Xt(e,t);switch(o){case"referenceHidden":{const s=await r.detectOverflow(t,{...i,elementContext:"reference"}),a=pl(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:ml(a)}}}case"escaped":{const s=await r.detectOverflow(t,{...i,altBoundary:!0}),a=pl(s,n.floating);return{data:{escapedOffsets:a,escaped:ml(a)}}}default:return{}}}}},Lc=new Set(["left","top"]);async function Nm(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Kt(n),a=dr(n),l=Nt(n)==="y",u=Lc.has(s)?-1:1,c=i&&l?-1:1,d=Xt(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:p}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof p=="number"&&(h=a==="end"?p*-1:p),l?{x:h*c,y:f*u}:{x:f*u,y:h*c}}const Rm=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await Nm(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},Mm=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:i}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:l={fn:y=>{let{x:g,y:m}=y;return{x:g,y:m}}},...u}=Xt(e,t),c={x:n,y:r},d=await i.detectOverflow(t,u),f=Nt(Kt(o)),h=xa(f);let p=c[h],b=c[f];if(s){const y=h==="y"?"top":"left",g=h==="y"?"bottom":"right",m=p+d[y],v=p-d[g];p=Ss(m,p,v)}if(a){const y=f==="y"?"top":"left",g=f==="y"?"bottom":"right",m=b+d[y],v=b-d[g];b=Ss(m,b,v)}const _=l.fn({...t,[h]:p,[f]:b});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[h]:s,[f]:a}}}}}},Om=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:u=!0}=Xt(e,t),c={x:n,y:r},d=Nt(o),f=xa(d);let h=c[f],p=c[d];const b=Xt(a,t),_=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(l){const m=f==="y"?"height":"width",v=i.reference[f]-i.floating[m]+_.mainAxis,x=i.reference[f]+i.reference[m]-_.mainAxis;h<v?h=v:h>x&&(h=x)}if(u){var y,g;const m=f==="y"?"width":"height",v=Lc.has(Kt(o)),x=i.reference[d]-i.floating[m]+(v&&((y=s.offset)==null?void 0:y[d])||0)+(v?0:_.crossAxis),L=i.reference[d]+i.reference[m]+(v?0:((g=s.offset)==null?void 0:g[d])||0)-(v?_.crossAxis:0);p<x?p=x:p>L&&(p=L)}return{[f]:h,[d]:p}}}},Dm=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...u}=Xt(e,t),c=await s.detectOverflow(t,u),d=Kt(o),f=dr(o),h=Nt(o)==="y",{width:p,height:b}=i.floating;let _,y;d==="top"||d==="bottom"?(_=d,y=f===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(y=d,_=f==="end"?"top":"bottom");const g=b-c.top-c.bottom,m=p-c.left-c.right,v=ln(b-c[_],g),x=ln(p-c[y],m),L=!t.middlewareData.shift;let P=v,O=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(O=m),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(P=g),L&&!f){const N=lt(c.left,0),M=lt(c.right,0),C=lt(c.top,0),F=lt(c.bottom,0);h?O=p-2*(N!==0||M!==0?N+M:lt(c.left,c.right)):P=b-2*(C!==0||F!==0?C+F:lt(c.top,c.bottom))}await l({...t,availableWidth:O,availableHeight:P});const W=await s.getDimensions(a.floating);return p!==W.width||b!==W.height?{reset:{rects:!0}}:{}}}};function mi(){return typeof window<"u"}function Nn(e){return Sa(e)?(e.nodeName||"").toLowerCase():"#document"}function ct(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function $t(e){var t;return(t=(Sa(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Sa(e){return mi()?e instanceof Node||e instanceof ct(e).Node:!1}function _t(e){return mi()?e instanceof Element||e instanceof ct(e).Element:!1}function Ot(e){return mi()?e instanceof HTMLElement||e instanceof ct(e).HTMLElement:!1}function gl(e){return!mi()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ct(e).ShadowRoot}const $m=new Set(["inline","contents"]);function Qr(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=bt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!$m.has(o)}const Vm=new Set(["table","td","th"]);function Bm(e){return Vm.has(Nn(e))}const Fm=[":popover-open",":modal"];function gi(e){return Fm.some(t=>{try{return e.matches(t)}catch{return!1}})}const zm=["transform","translate","scale","rotate","perspective"],Hm=["transform","translate","scale","rotate","perspective","filter"],Gm=["paint","layout","strict","content"];function Ta(e){const t=Aa(),n=_t(e)?bt(e):e;return zm.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Hm.some(r=>(n.willChange||"").includes(r))||Gm.some(r=>(n.contain||"").includes(r))}function jm(e){let t=un(e);for(;Ot(t)&&!Jn(t);){if(Ta(t))return t;if(gi(t))return null;t=un(t)}return null}function Aa(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Um=new Set(["html","body","#document"]);function Jn(e){return Um.has(Nn(e))}function bt(e){return ct(e).getComputedStyle(e)}function vi(e){return _t(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function un(e){if(Nn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||gl(e)&&e.host||$t(e);return gl(t)?t.host:t}function Ic(e){const t=un(e);return Jn(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ot(t)&&Qr(t)?t:Ic(t)}function Nr(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Ic(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=ct(o);if(i){const a=As(s);return t.concat(s,s.visualViewport||[],Qr(o)?o:[],a&&n?Nr(a):[])}return t.concat(o,Nr(o,[],n))}function As(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Pc(e){const t=bt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Ot(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Vo(n)!==i||Vo(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function La(e){return _t(e)?e:e.contextElement}function Wn(e){const t=La(e);if(!Ot(t))return Rt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Pc(t);let s=(i?Vo(n.width):n.width)/r,a=(i?Vo(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const Wm=Rt(0);function Nc(e){const t=ct(e);return!Aa()||!t.visualViewport?Wm:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function qm(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ct(e)?!1:t}function Cn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=La(e);let s=Rt(1);t&&(r?_t(r)&&(s=Wn(r)):s=Wn(e));const a=qm(i,n,r)?Nc(i):Rt(0);let l=(o.left+a.x)/s.x,u=(o.top+a.y)/s.y,c=o.width/s.x,d=o.height/s.y;if(i){const f=ct(i),h=r&&_t(r)?ct(r):r;let p=f,b=As(p);for(;b&&r&&h!==p;){const _=Wn(b),y=b.getBoundingClientRect(),g=bt(b),m=y.left+(b.clientLeft+parseFloat(g.paddingLeft))*_.x,v=y.top+(b.clientTop+parseFloat(g.paddingTop))*_.y;l*=_.x,u*=_.y,c*=_.x,d*=_.y,l+=m,u+=v,p=ct(b),b=As(p)}}return Fo({width:c,height:d,x:l,y:u})}function yi(e,t){const n=vi(e).scrollLeft;return t?t.left+n:Cn($t(e)).left+n}function Rc(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-yi(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function Ym(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=$t(r),a=t?gi(t.floating):!1;if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},u=Rt(1);const c=Rt(0),d=Ot(r);if((d||!d&&!i)&&((Nn(r)!=="body"||Qr(s))&&(l=vi(r)),Ot(r))){const h=Cn(r);u=Wn(r),c.x=h.x+r.clientLeft,c.y=h.y+r.clientTop}const f=s&&!d&&!i?Rc(s,l):Rt(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x+f.x,y:n.y*u.y-l.scrollTop*u.y+c.y+f.y}}function Xm(e){return Array.from(e.getClientRects())}function Km(e){const t=$t(e),n=vi(e),r=e.ownerDocument.body,o=lt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=lt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+yi(e);const a=-n.scrollTop;return bt(r).direction==="rtl"&&(s+=lt(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}const vl=25;function Zm(e,t){const n=ct(e),r=$t(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const c=Aa();(!c||c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}const u=yi(r);if(u<=0){const c=r.ownerDocument,d=c.body,f=getComputedStyle(d),h=c.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,p=Math.abs(r.clientWidth-d.clientWidth-h);p<=vl&&(i-=p)}else u<=vl&&(i+=u);return{width:i,height:s,x:a,y:l}}const Qm=new Set(["absolute","fixed"]);function Jm(e,t){const n=Cn(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Ot(e)?Wn(e):Rt(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,u=r*i.y;return{width:s,height:a,x:l,y:u}}function yl(e,t,n){let r;if(t==="viewport")r=Zm(e,n);else if(t==="document")r=Km($t(e));else if(_t(t))r=Jm(t,n);else{const o=Nc(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Fo(r)}function Mc(e,t){const n=un(e);return n===t||!_t(n)||Jn(n)?!1:bt(n).position==="fixed"||Mc(n,t)}function eg(e,t){const n=t.get(e);if(n)return n;let r=Nr(e,[],!1).filter(a=>_t(a)&&Nn(a)!=="body"),o=null;const i=bt(e).position==="fixed";let s=i?un(e):e;for(;_t(s)&&!Jn(s);){const a=bt(s),l=Ta(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&Qm.has(o.position)||Qr(s)&&!l&&Mc(e,s))?r=r.filter(c=>c!==s):o=a,s=un(s)}return t.set(e,r),r}function tg(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?gi(t)?[]:eg(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((u,c)=>{const d=yl(t,c,o);return u.top=lt(d.top,u.top),u.right=ln(d.right,u.right),u.bottom=ln(d.bottom,u.bottom),u.left=lt(d.left,u.left),u},yl(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function ng(e){const{width:t,height:n}=Pc(e);return{width:t,height:n}}function rg(e,t,n){const r=Ot(t),o=$t(t),i=n==="fixed",s=Cn(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=Rt(0);function u(){l.x=yi(o)}if(r||!r&&!i)if((Nn(t)!=="body"||Qr(o))&&(a=vi(t)),r){const h=Cn(t,!0,i,t);l.x=h.x+t.clientLeft,l.y=h.y+t.clientTop}else o&&u();i&&!r&&o&&u();const c=o&&!r&&!i?Rc(o,a):Rt(0),d=s.left+a.scrollLeft-l.x-c.x,f=s.top+a.scrollTop-l.y-c.y;return{x:d,y:f,width:s.width,height:s.height}}function Bi(e){return bt(e).position==="static"}function _l(e,t){if(!Ot(e)||bt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return $t(e)===n&&(n=n.ownerDocument.body),n}function Oc(e,t){const n=ct(e);if(gi(e))return n;if(!Ot(e)){let o=un(e);for(;o&&!Jn(o);){if(_t(o)&&!Bi(o))return o;o=un(o)}return n}let r=_l(e,t);for(;r&&Bm(r)&&Bi(r);)r=_l(r,t);return r&&Jn(r)&&Bi(r)&&!Ta(r)?n:r||jm(e)||n}const og=async function(e){const t=this.getOffsetParent||Oc,n=this.getDimensions,r=await n(e.floating);return{reference:rg(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function ig(e){return bt(e).direction==="rtl"}const sg={convertOffsetParentRelativeRectToViewportRelativeRect:Ym,getDocumentElement:$t,getClippingRect:tg,getOffsetParent:Oc,getElementRects:og,getClientRects:Xm,getDimensions:ng,getScale:Wn,isElement:_t,isRTL:ig};function Dc(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ag(e,t){let n=null,r;const o=$t(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const u=e.getBoundingClientRect(),{left:c,top:d,width:f,height:h}=u;if(a||t(),!f||!h)return;const p=io(d),b=io(o.clientWidth-(c+f)),_=io(o.clientHeight-(d+h)),y=io(c),m={rootMargin:-p+"px "+-b+"px "+-_+"px "+-y+"px",threshold:lt(0,ln(1,l))||1};let v=!0;function x(L){const P=L[0].intersectionRatio;if(P!==l){if(!v)return s();P?s(!1,P):r=setTimeout(()=>{s(!1,1e-7)},1e3)}P===1&&!Dc(u,e.getBoundingClientRect())&&s(),v=!1}try{n=new IntersectionObserver(x,{...m,root:o.ownerDocument})}catch{n=new IntersectionObserver(x,m)}n.observe(e)}return s(!0),i}function lg(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=La(e),c=o||i?[...u?Nr(u):[],...Nr(t)]:[];c.forEach(y=>{o&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const d=u&&a?ag(u,n):null;let f=-1,h=null;s&&(h=new ResizeObserver(y=>{let[g]=y;g&&g.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var m;(m=h)==null||m.observe(t)})),n()}),u&&!l&&h.observe(u),h.observe(t));let p,b=l?Cn(e):null;l&&_();function _(){const y=Cn(e);b&&!Dc(b,y)&&n(),b=y,p=requestAnimationFrame(_)}return n(),()=>{var y;c.forEach(g=>{o&&g.removeEventListener("scroll",n),i&&g.removeEventListener("resize",n)}),d?.(),(y=h)==null||y.disconnect(),h=null,l&&cancelAnimationFrame(p)}}const ug=Rm,cg=Mm,bl=Im,dg=Dm,fg=Pm,hg=Lm,pg=Om,mg=(e,t,n)=>{const r=new Map,o={platform:sg,...n},i={...o.platform,_c:r};return Am(e,t,{...o,platform:i})};function gg(e){return e!=null&&typeof e=="object"&&"$el"in e}function Ls(e){if(gg(e)){const t=e.$el;return Sa(t)&&Nn(t)==="#comment"?null:t}return e}function zn(e){return typeof e=="function"?e():k(e)}function vg(e){return{name:"arrow",options:e,fn(t){const n=Ls(zn(e.element));return n==null?{}:hg({element:n,padding:e.padding}).fn(t)}}}function $c(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function wl(e,t){const n=$c(e);return Math.round(t*n)/n}function yg(e,t,n){n===void 0&&(n={});const r=n.whileElementsMounted,o=te(()=>{var P;return(P=zn(n.open))!=null?P:!0}),i=te(()=>zn(n.middleware)),s=te(()=>{var P;return(P=zn(n.placement))!=null?P:"bottom"}),a=te(()=>{var P;return(P=zn(n.strategy))!=null?P:"absolute"}),l=te(()=>{var P;return(P=zn(n.transform))!=null?P:!0}),u=te(()=>Ls(e.value)),c=te(()=>Ls(t.value)),d=fe(0),f=fe(0),h=fe(a.value),p=fe(s.value),b=Pt({}),_=fe(!1),y=te(()=>{const P={position:h.value,left:"0",top:"0"};if(!c.value)return P;const O=wl(c.value,d.value),W=wl(c.value,f.value);return l.value?{...P,transform:"translate("+O+"px, "+W+"px)",...$c(c.value)>=1.5&&{willChange:"transform"}}:{position:h.value,left:O+"px",top:W+"px"}});let g;function m(){if(u.value==null||c.value==null)return;const P=o.value;mg(u.value,c.value,{middleware:i.value,placement:s.value,strategy:a.value}).then(O=>{d.value=O.x,f.value=O.y,h.value=O.strategy,p.value=O.placement,b.value=O.middlewareData,_.value=P!==!1})}function v(){typeof g=="function"&&(g(),g=void 0)}function x(){if(v(),r===void 0){m();return}if(u.value!=null&&c.value!=null){g=r(u.value,c.value,m);return}}function L(){o.value||(_.value=!1)}return xe([i,s,a,o],m,{flush:"sync"}),xe([u,c],x,{flush:"sync"}),xe(o,L,{flush:"sync"}),_a()&&kr(v),{x:Mn(d),y:Mn(f),strategy:Mn(h),placement:Mn(p),middlewareData:Mn(b),isPositioned:Mn(_),floatingStyles:y,update:m}}const _g={side:"bottom",sideOffset:0,sideFlip:!0,align:"center",alignOffset:0,alignFlip:!0,arrowPadding:0,hideShiftedArrow:!0,avoidCollisions:!0,collisionBoundary:()=>[],collisionPadding:0,sticky:"partial",hideWhenDetached:!1,positionStrategy:"fixed",updatePositionStrategy:"optimized",prioritizePosition:!1},[bg,wg]=cr("PopperContent");var Eg=me({inheritAttrs:!1,__name:"PopperContent",props:Uh({side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},{..._g}),emits:["placed"],setup(e,{emit:t}){const n=e,r=t,o=Tc(),{forwardRef:i,currentElement:s}=rt(),a=fe(),l=fe(),{width:u,height:c}=Qp(l),d=te(()=>n.side+(n.align!=="center"?`-${n.align}`:"")),f=te(()=>typeof n.collisionPadding=="number"?n.collisionPadding:{top:0,right:0,bottom:0,left:0,...n.collisionPadding}),h=te(()=>Array.isArray(n.collisionBoundary)?n.collisionBoundary:[n.collisionBoundary]),p=te(()=>({padding:f.value,boundary:h.value.filter(pm),altBoundary:h.value.length>0})),b=te(()=>({mainAxis:n.sideFlip,crossAxis:n.alignFlip})),_=zh(()=>[ug({mainAxis:n.sideOffset+c.value,alignmentAxis:n.alignOffset}),n.prioritizePosition&&n.avoidCollisions&&bl({...p.value,...b.value}),n.avoidCollisions&&cg({mainAxis:!0,crossAxis:!!n.prioritizePosition,limiter:n.sticky==="partial"?pg():void 0,...p.value}),!n.prioritizePosition&&n.avoidCollisions&&bl({...p.value,...b.value}),dg({...p.value,apply:({elements:C,rects:F,availableWidth:E,availableHeight:$})=>{const{width:A,height:V}=F.reference,z=C.floating.style;z.setProperty("--reka-popper-available-width",`${E}px`),z.setProperty("--reka-popper-available-height",`${$}px`),z.setProperty("--reka-popper-anchor-width",`${A}px`),z.setProperty("--reka-popper-anchor-height",`${V}px`)}}),l.value&&vg({element:l.value,padding:n.arrowPadding}),mm({arrowWidth:u.value,arrowHeight:c.value}),n.hideWhenDetached&&fg({strategy:"referenceHidden",...p.value})]),y=te(()=>n.reference??o.anchor.value),{floatingStyles:g,placement:m,isPositioned:v,middlewareData:x}=yg(y,a,{strategy:n.positionStrategy,placement:d,whileElementsMounted:(...C)=>lg(...C,{layoutShift:!n.disableUpdateOnLayoutShift,animationFrame:n.updatePositionStrategy==="always"}),middleware:_}),L=te(()=>Cs(m.value)[0]),P=te(()=>Cs(m.value)[1]);vc(()=>{v.value&&r("placed")});const O=te(()=>{const C=x.value.arrow?.centerOffset!==0;return n.hideShiftedArrow&&C}),W=fe("");xs(()=>{s.value&&(W.value=window.getComputedStyle(s.value).zIndex)});const N=te(()=>x.value.arrow?.x??0),M=te(()=>x.value.arrow?.y??0);return wg({placedSide:L,onArrowChange:C=>l.value=C,arrowX:N,arrowY:M,shouldHideArrow:O}),(C,F)=>(X(),re("div",{ref_key:"floatingRef",ref:a,"data-reka-popper-content-wrapper":"",style:tt({...k(g),transform:k(v)?k(g).transform:"translate(0, -200%)",minWidth:"max-content",zIndex:W.value,"--reka-popper-transform-origin":[k(x).transformOrigin?.x,k(x).transformOrigin?.y].join(" "),...k(x).hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}})},[ie(k(Dt),Ze({ref:k(i)},C.$attrs,{"as-child":n.asChild,as:C.as,"data-side":L.value,"data-align":P.value,style:{animation:k(v)?void 0:"none"}}),{default:le(()=>[be(C.$slots,"default")]),_:3},16,["as-child","as","data-side","data-align","style"])],4))}}),xg=Eg;const kg={top:"bottom",right:"left",bottom:"top",left:"right"};var Cg=me({inheritAttrs:!1,__name:"PopperArrow",props:{width:{type:Number,required:!1},height:{type:Number,required:!1},rounded:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"svg"}},setup(e){const{forwardRef:t}=rt(),n=bg(),r=te(()=>kg[n.placedSide.value]);return(o,i)=>(X(),re("span",{ref:s=>{k(n).onArrowChange(s)},style:tt({position:"absolute",left:k(n).arrowX?.value?`${k(n).arrowX?.value}px`:void 0,top:k(n).arrowY?.value?`${k(n).arrowY?.value}px`:void 0,[r.value]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[k(n).placedSide.value],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[k(n).placedSide.value],visibility:k(n).shouldHideArrow.value?"hidden":void 0})},[ie(hm,Ze(o.$attrs,{ref:k(t),style:{display:"block"},as:o.as,"as-child":o.asChild,rounded:o.rounded,width:o.width,height:o.height}),{default:le(()=>[be(o.$slots,"default")]),_:3},16,["as","as-child","rounded","width","height"])],4))}}),Sg=Cg;const[Ia,Tg]=cr("TabsRoot");var Ag=me({__name:"TabsRoot",props:{defaultValue:{type:null,required:!1},orientation:{type:String,required:!1,default:"horizontal"},dir:{type:String,required:!1},activationMode:{type:String,required:!1,default:"automatic"},modelValue:{type:null,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,r=t,{orientation:o,unmountOnHide:i,dir:s}=Yr(n),a=wc(s);rt();const l=ya(n,"modelValue",r,{defaultValue:n.defaultValue,passive:n.modelValue===void 0}),u=fe(),c=Pt(new Set);return Tg({modelValue:l,changeModelValue:d=>{l.value=d},orientation:o,dir:a,unmountOnHide:i,activationMode:n.activationMode,baseId:Ea(void 0,"reka-tabs"),tabsList:u,contentIds:c,registerContent:d=>{c.value=new Set([...c.value,d])},unregisterContent:d=>{const f=new Set(c.value);f.delete(d),c.value=f}}),(d,f)=>(X(),ye(k(Dt),{dir:k(a),"data-orientation":k(o),"as-child":d.asChild,as:d.as},{default:le(()=>[be(d.$slots,"default",{modelValue:k(l)})]),_:3},8,["dir","data-orientation","as-child","as"]))}}),Lg=Ag;function Vc(e,t){return`${e}-trigger-${t}`}function Bc(e,t){return`${e}-content-${t}`}var Ig=me({__name:"TabsContent",props:{value:{type:[String,Number],required:!0},forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e,{forwardRef:n}=rt(),r=Ia(),o=te(()=>Vc(r.baseId,t.value)),i=te(()=>Bc(r.baseId,t.value)),s=te(()=>t.value===r.modelValue.value),a=fe(s.value);return nt(()=>{r.registerContent(t.value),requestAnimationFrame(()=>{a.value=!1})}),ba(()=>{r.unregisterContent(t.value)}),(l,u)=>(X(),ye(k(kc),{present:l.forceMount||s.value,"force-mount":""},{default:le(({present:c})=>[ie(k(Dt),{id:i.value,ref:k(n),"as-child":l.asChild,as:l.as,role:"tabpanel","data-state":s.value?"active":"inactive","data-orientation":k(r).orientation.value,"aria-labelledby":o.value,hidden:!c,tabindex:"0",style:tt({animationDuration:a.value?"0s":void 0})},{default:le(()=>[!k(r).unmountOnHide.value||c?be(l.$slots,"default",{key:0}):we("v-if",!0)]),_:2},1032,["id","as-child","as","data-state","data-orientation","aria-labelledby","hidden","style"])]),_:3},8,["present"]))}}),Pg=Ig,Ng=me({__name:"TabsList",props:{loop:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e,{loop:n}=Yr(t),{forwardRef:r,currentElement:o}=rt(),i=Ia();return i.tabsList=o,(s,a)=>(X(),ye(k(nm),{"as-child":"",orientation:k(i).orientation.value,dir:k(i).dir.value,loop:k(n)},{default:le(()=>[ie(k(Dt),{ref:k(r),role:"tablist","as-child":s.asChild,as:s.as,"aria-orientation":k(i).orientation.value},{default:le(()=>[be(s.$slots,"default")]),_:3},8,["as-child","as","aria-orientation"])]),_:3},8,["orientation","dir","loop"]))}}),Rg=Ng,Mg=me({__name:"TabsTrigger",props:{value:{type:[String,Number],required:!0},disabled:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(e){const t=e,{forwardRef:n}=rt(),r=Ia(),o=te(()=>Vc(r.baseId,t.value)),i=te(()=>r.contentIds.value.has(t.value)?Bc(r.baseId,t.value):void 0),s=te(()=>t.value===r.modelValue.value);return(a,l)=>(X(),ye(k(om),{"as-child":"",focusable:!a.disabled,active:s.value},{default:le(()=>[ie(k(Dt),{id:o.value,ref:k(n),role:"tab",type:a.as==="button"?"button":void 0,as:a.as,"as-child":a.asChild,"aria-selected":s.value?"true":"false","aria-controls":i.value,"data-state":s.value?"active":"inactive",disabled:a.disabled,"data-disabled":a.disabled?"":void 0,"data-orientation":k(r).orientation.value,onMousedown:l[0]||(l[0]=yc(u=>{!a.disabled&&u.ctrlKey===!1?k(r).changeModelValue(a.value):u.preventDefault()},["left"])),onKeydown:l[1]||(l[1]=Wh(u=>k(r).changeModelValue(a.value),["enter","space"])),onFocus:l[2]||(l[2]=()=>{const u=k(r).activationMode!=="manual";!s.value&&!a.disabled&&u&&k(r).changeModelValue(a.value)})},{default:le(()=>[be(a.$slots,"default")]),_:3},8,["id","type","as","as-child","aria-selected","aria-controls","data-state","disabled","data-disabled","data-orientation"])]),_:3},8,["focusable","active"]))}}),Og=Mg,Dg=me({__name:"TooltipArrow",props:{width:{type:Number,required:!1,default:10},height:{type:Number,required:!1,default:5},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"svg"}},setup(e){const t=e;return rt(),(n,r)=>(X(),ye(k(Sg),Kr(Zr(t)),{default:le(()=>[be(n.$slots,"default")]),_:3},16))}}),$g=Dg;const[Pa,Vg]=cr("TooltipProvider");var Bg=me({inheritAttrs:!1,__name:"TooltipProvider",props:{delayDuration:{type:Number,required:!1,default:700},skipDelayDuration:{type:Number,required:!1,default:300},disableHoverableContent:{type:Boolean,required:!1,default:!1},disableClosingTrigger:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},ignoreNonKeyboardFocus:{type:Boolean,required:!1,default:!1}},setup(e){const t=e,{delayDuration:n,skipDelayDuration:r,disableHoverableContent:o,disableClosingTrigger:i,ignoreNonKeyboardFocus:s,disabled:a}=Yr(t);rt();const l=fe(!0),u=fe(!1),{start:c,stop:d}=gc(()=>{l.value=!0},r,{immediate:!1});return Vg({isOpenDelayed:l,delayDuration:n,onOpen(){d(),l.value=!1},onClose(){c()},isPointerInTransitRef:u,disableHoverableContent:o,disableClosingTrigger:i,disabled:a,ignoreNonKeyboardFocus:s}),(f,h)=>be(f.$slots,"default")}}),Fg=Bg;const Fc="tooltip.open",[_i,zg]=cr("TooltipRoot");var Hg=me({__name:"TooltipRoot",props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},delayDuration:{type:Number,required:!1,default:void 0},disableHoverableContent:{type:Boolean,required:!1,default:void 0},disableClosingTrigger:{type:Boolean,required:!1,default:void 0},disabled:{type:Boolean,required:!1,default:void 0},ignoreNonKeyboardFocus:{type:Boolean,required:!1,default:void 0}},emits:["update:open"],setup(e,{emit:t}){const n=e,r=t;rt();const o=Pa(),i=te(()=>n.disableHoverableContent??o.disableHoverableContent.value),s=te(()=>n.disableClosingTrigger??o.disableClosingTrigger.value),a=te(()=>n.disabled??o.disabled.value),l=te(()=>n.delayDuration??o.delayDuration.value),u=te(()=>n.ignoreNonKeyboardFocus??o.ignoreNonKeyboardFocus.value),c=ya(n,"open",r,{defaultValue:n.defaultOpen,passive:n.open===void 0});xe(c,m=>{o.onClose&&(m?(o.onOpen(),document.dispatchEvent(new CustomEvent(Fc))):o.onClose())});const d=fe(!1),f=fe(),h=te(()=>c.value?d.value?"delayed-open":"instant-open":"closed"),{start:p,stop:b}=gc(()=>{d.value=!0,c.value=!0},l,{immediate:!1});function _(){b(),d.value=!1,c.value=!0}function y(){b(),c.value=!1}function g(){p()}return zg({contentId:"",open:c,stateAttribute:h,trigger:f,onTriggerChange(m){f.value=m},onTriggerEnter(){o.isOpenDelayed.value?g():_()},onTriggerLeave(){i.value?y():b()},onOpen:_,onClose:y,disableHoverableContent:i,disableClosingTrigger:s,disabled:a,ignoreNonKeyboardFocus:u}),(m,v)=>(X(),ye(k(am),null,{default:le(()=>[be(m.$slots,"default",{open:k(c)})]),_:3}))}}),Gg=Hg,jg=me({__name:"TooltipContentImpl",props:{ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1,default:"top"},sideOffset:{type:Number,required:!1,default:0},align:{type:null,required:!1,default:"center"},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1,default:!0},collisionBoundary:{type:null,required:!1,default:()=>[]},collisionPadding:{type:[Number,Object],required:!1,default:0},arrowPadding:{type:Number,required:!1,default:0},sticky:{type:String,required:!1,default:"partial"},hideWhenDetached:{type:Boolean,required:!1,default:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},emits:["escapeKeyDown","pointerDownOutside"],setup(e,{emit:t}){const n=e,r=t,o=_i(),{forwardRef:i,currentElement:s}=rt(),a=te(()=>n.ariaLabel||s.value?.textContent),l=te(()=>{const{ariaLabel:u,...c}=n;return c});return nt(()=>{ll(window,"scroll",u=>{u.target?.contains(o.trigger.value)&&o.onClose()}),ll(window,Fc,o.onClose)}),(u,c)=>(X(),ye(k(dp),{"as-child":"","disable-outside-pointer-events":!1,onEscapeKeyDown:c[0]||(c[0]=d=>r("escapeKeyDown",d)),onPointerDownOutside:c[1]||(c[1]=d=>{k(o).disableClosingTrigger.value&&k(o).trigger.value?.contains(d.target)&&d.preventDefault(),r("pointerDownOutside",d)}),onFocusOutside:c[2]||(c[2]=yc(()=>{},["prevent"])),onDismiss:c[3]||(c[3]=d=>k(o).onClose())},{default:le(()=>[ie(k(xg),Ze({ref:k(i),"data-state":k(o).stateAttribute.value},{...u.$attrs,...l.value},{style:{"--reka-tooltip-content-transform-origin":"var(--reka-popper-transform-origin)","--reka-tooltip-content-available-width":"var(--reka-popper-available-width)","--reka-tooltip-content-available-height":"var(--reka-popper-available-height)","--reka-tooltip-trigger-width":"var(--reka-popper-anchor-width)","--reka-tooltip-trigger-height":"var(--reka-popper-anchor-height)"}}),{default:le(()=>[be(u.$slots,"default"),ie(k(cp),{id:k(o).contentId,role:"tooltip"},{default:le(()=>[Le(_e(a.value),1)]),_:1},8,["id"])]),_:3},16,["data-state"])]),_:3}))}}),zc=jg,Ug=me({__name:"TooltipContentHoverable",props:{ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},setup(e){const n=Cc(e),{forwardRef:r,currentElement:o}=rt(),{trigger:i,onClose:s}=_i(),a=Pa(),{isPointerInTransit:l,onPointerExit:u}=Up(i,o);return a.isPointerInTransitRef=l,u(()=>{s()}),(c,d)=>(X(),ye(zc,Ze({ref:k(r)},k(n)),{default:le(()=>[be(c.$slots,"default")]),_:3},16))}}),Wg=Ug,qg=me({__name:"TooltipContent",props:{forceMount:{type:Boolean,required:!1},ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1,default:"top"},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},emits:["escapeKeyDown","pointerDownOutside"],setup(e,{emit:t}){const n=e,r=t,o=_i(),i=pi(n,r),{forwardRef:s}=rt();return(a,l)=>(X(),ye(k(kc),{present:a.forceMount||k(o).open.value},{default:le(()=>[(X(),ye(Lt(k(o).disableHoverableContent.value?zc:Wg),Ze({ref:k(s)},k(i)),{default:le(()=>[be(a.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),Yg=qg,Xg=me({__name:"TooltipPortal",props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){const t=e;return(n,r)=>(X(),ye(k(fp),Kr(Zr(t)),{default:le(()=>[be(n.$slots,"default")]),_:3},16))}}),Kg=Xg,Zg=me({__name:"TooltipTrigger",props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(e){const t=e,n=_i(),r=Pa();n.contentId||=Ea(void 0,"reka-tooltip-content");const{forwardRef:o,currentElement:i}=rt(),s=fe(!1),a=fe(!1),l=te(()=>n.disabled.value?{}:{click:b,focus:h,pointermove:d,pointerleave:f,pointerdown:c,blur:p});nt(()=>{n.onTriggerChange(i.value)});function u(){setTimeout(()=>{s.value=!1},1)}function c(){n.open&&!n.disableClosingTrigger.value&&n.onClose(),s.value=!0,document.addEventListener("pointerup",u,{once:!0})}function d(_){_.pointerType!=="touch"&&!a.value&&!r.isPointerInTransitRef.value&&(n.onTriggerEnter(),a.value=!0)}function f(){n.onTriggerLeave(),a.value=!1}function h(_){s.value||n.ignoreNonKeyboardFocus.value&&!_.target.matches?.(":focus-visible")||n.onOpen()}function p(){n.onClose()}function b(){n.disableClosingTrigger.value||n.onClose()}return(_,y)=>(X(),ye(k(um),{"as-child":"",reference:_.reference},{default:le(()=>[ie(k(Dt),Ze({ref:k(o),"aria-describedby":k(n).open.value?k(n).contentId:void 0,"data-state":k(n).stateAttribute.value,as:_.as,"as-child":t.asChild,"data-grace-area-trigger":""},qh(l.value)),{default:le(()=>[be(_.$slots,"default")]),_:3},16,["aria-describedby","data-state","as","as-child"])]),_:3},8,["reference"]))}}),Qg=Zg;let Fe=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function Jg(e){return Na(e)}function Na(e){return Array.isArray(e)?ev(e):e instanceof RegExp?e:typeof e=="object"?tv(e):e}function ev(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=Na(e[n]);return t}function tv(e){let t={};for(let n in e)t[n]=Na(e[n]);return t}function Hc(e,...t){return t.forEach(n=>{for(let r in n)e[r]=n[r]}),e}function Gc(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?Gc(e.substring(0,e.length-1)):e.substr(~t+1)}var Fi=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,so=class{static hasCaptures(e){return e===null?!1:(Fi.lastIndex=0,Fi.test(e))}static replaceCaptures(e,t,n){return e.replace(Fi,(r,o,i,s)=>{let a=n[parseInt(o||i,10)];if(a){let l=t.substring(a.start,a.end);for(;l[0]===".";)l=l.substring(1);switch(s){case"downcase":return l.toLowerCase();case"upcase":return l.toUpperCase();default:return l}}else return r})}};function jc(e,t){return e<t?-1:e>t?1:0}function Uc(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let o=0;o<n;o++){let i=jc(e[o],t[o]);if(i!==0)return i}return 0}return n-r}function El(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function Wc(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var qc=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);const t=this.fn(e);return this.cache.set(e,t),t}},zo=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(ov(e),t)}static createFromParsedTheme(e,t){return sv(e,t)}_cachedMatchRoot=new qc(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;const t=e.scopeName,r=this._cachedMatchRoot.get(t).find(o=>nv(e.parent,o.parentScopes));return r?new Yc(r.fontStyle,r.foreground,r.background):null}},zi=class So{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(const r of n)t=new So(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new So(n,t[r]);return n}push(t){return new So(this,t)}getSegments(){let t=this;const n=[];for(;t;)n.push(t.scopeName),t=t.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(t){return this===t?!0:this.parent===null?!1:this.parent.extends(t)}getExtensionIfDefined(t){const n=[];let r=this;for(;r&&r!==t;)n.push(r.scopeName),r=r.parent;return r===t?n.reverse():void 0}};function nv(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],o=!1;if(r===">"){if(n===t.length-1)return!1;r=t[++n],o=!0}for(;e&&!rv(e.scopeName,r);){if(o)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function rv(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var Yc=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function ov(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let o=0,i=t.length;o<i;o++){let s=t[o];if(!s.settings)continue;let a;if(typeof s.scope=="string"){let d=s.scope;d=d.replace(/^[,]+/,""),d=d.replace(/[,]+$/,""),a=d.split(",")}else Array.isArray(s.scope)?a=s.scope:a=[""];let l=-1;if(typeof s.settings.fontStyle=="string"){l=0;let d=s.settings.fontStyle.split(" ");for(let f=0,h=d.length;f<h;f++)switch(d[f]){case"italic":l=l|1;break;case"bold":l=l|2;break;case"underline":l=l|4;break;case"strikethrough":l=l|8;break}}let u=null;typeof s.settings.foreground=="string"&&El(s.settings.foreground)&&(u=s.settings.foreground);let c=null;typeof s.settings.background=="string"&&El(s.settings.background)&&(c=s.settings.background);for(let d=0,f=a.length;d<f;d++){let p=a[d].trim().split(" "),b=p[p.length-1],_=null;p.length>1&&(_=p.slice(0,p.length-1),_.reverse()),n[r++]=new iv(b,_,o,l,u,c)}}return n}var iv=class{constructor(e,t,n,r,o,i){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=o,this.background=i}},Je=(e=>(e[e.NotSet=-1]="NotSet",e[e.None=0]="None",e[e.Italic=1]="Italic",e[e.Bold=2]="Bold",e[e.Underline=4]="Underline",e[e.Strikethrough=8]="Strikethrough",e))(Je||{});function sv(e,t){e.sort((l,u)=>{let c=jc(l.scope,u.scope);return c!==0||(c=Uc(l.parentScopes,u.parentScopes),c!==0)?c:l.index-u.index});let n=0,r="#000000",o="#ffffff";for(;e.length>=1&&e[0].scope==="";){let l=e.shift();l.fontStyle!==-1&&(n=l.fontStyle),l.foreground!==null&&(r=l.foreground),l.background!==null&&(o=l.background)}let i=new av(t),s=new Yc(n,i.getId(r),i.getId(o)),a=new uv(new Is(0,null,-1,0,0),[]);for(let l=0,u=e.length;l<u;l++){let c=e[l];a.insert(0,c.scope,c.parentScopes,c.fontStyle,i.getId(c.foreground),i.getId(c.background))}return new zo(i,s,a)}var av=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw new Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},lv=Object.freeze([]),Is=class Xc{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(t,n,r,o,i){this.scopeDepth=t,this.parentScopes=n||lv,this.fontStyle=r,this.foreground=o,this.background=i}clone(){return new Xc(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(t){let n=[];for(let r=0,o=t.length;r<o;r++)n[r]=t[r].clone();return n}acceptOverwrite(t,n,r,o){this.scopeDepth>t?console.log("how did this happen?"):this.scopeDepth=t,n!==-1&&(this.fontStyle=n),r!==0&&(this.foreground=r),o!==0&&(this.background=o)}},uv=class Ps{constructor(t,n=[],r={}){this._mainRule=t,this._children=r,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(t,n){if(t.scopeDepth!==n.scopeDepth)return n.scopeDepth-t.scopeDepth;let r=0,o=0;for(;t.parentScopes[r]===">"&&r++,n.parentScopes[o]===">"&&o++,!(r>=t.parentScopes.length||o>=n.parentScopes.length);){const i=n.parentScopes[o].length-t.parentScopes[r].length;if(i!==0)return i;r++,o++}return n.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let r=t.indexOf("."),o,i;if(r===-1?(o=t,i=""):(o=t.substring(0,r),i=t.substring(r+1)),this._children.hasOwnProperty(o))return this._children[o].match(i)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(Ps._cmpBySpecificity),n}insert(t,n,r,o,i,s){if(n===""){this._doInsertHere(t,r,o,i,s);return}let a=n.indexOf("."),l,u;a===-1?(l=n,u=""):(l=n.substring(0,a),u=n.substring(a+1));let c;this._children.hasOwnProperty(l)?c=this._children[l]:(c=new Ps(this._mainRule.clone(),Is.cloneArr(this._rulesWithParentScopes)),this._children[l]=c),c.insert(t+1,u,r,o,i,s)}_doInsertHere(t,n,r,o,i){if(n===null){this._mainRule.acceptOverwrite(t,r,o,i);return}for(let s=0,a=this._rulesWithParentScopes.length;s<a;s++){let l=this._rulesWithParentScopes[s];if(Uc(l.parentScopes,n)===0){l.acceptOverwrite(t,r,o,i);return}}r===-1&&(r=this._mainRule.fontStyle),o===0&&(o=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new Is(t,n,r,o,i))}},er=class ft{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){const n=ft.getLanguageId(t),r=ft.getTokenType(t),o=ft.getFontStyle(t),i=ft.getForeground(t),s=ft.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:o,foreground:i,background:s})}static getLanguageId(t){return(t&255)>>>0}static getTokenType(t){return(t&768)>>>8}static containsBalancedBrackets(t){return(t&1024)!==0}static getFontStyle(t){return(t&30720)>>>11}static getForeground(t){return(t&16744448)>>>15}static getBackground(t){return(t&4278190080)>>>24}static set(t,n,r,o,i,s,a){let l=ft.getLanguageId(t),u=ft.getTokenType(t),c=ft.containsBalancedBrackets(t)?1:0,d=ft.getFontStyle(t),f=ft.getForeground(t),h=ft.getBackground(t);return n!==0&&(l=n),r!==8&&(u=r),o!==null&&(c=o?1:0),i!==-1&&(d=i),s!==0&&(f=s),a!==0&&(h=a),(l<<0|u<<8|c<<10|d<<11|f<<15|h<<24)>>>0}};function Ho(e,t){const n=[],r=cv(e);let o=r.next();for(;o!==null;){let l=0;if(o.length===2&&o.charAt(1)===":"){switch(o.charAt(0)){case"R":l=1;break;case"L":l=-1;break;default:console.log(`Unknown priority ${o} in scope selector`)}o=r.next()}let u=s();if(n.push({matcher:u,priority:l}),o!==",")break;o=r.next()}return n;function i(){if(o==="-"){o=r.next();const l=i();return u=>!!l&&!l(u)}if(o==="("){o=r.next();const l=a();return o===")"&&(o=r.next()),l}if(xl(o)){const l=[];do l.push(o),o=r.next();while(xl(o));return u=>t(l,u)}return null}function s(){const l=[];let u=i();for(;u;)l.push(u),u=i();return c=>l.every(d=>d(c))}function a(){const l=[];let u=s();for(;u&&(l.push(u),o==="|"||o===",");){do o=r.next();while(o==="|"||o===",");u=s()}return c=>l.some(d=>d(c))}}function xl(e){return!!e&&!!e.match(/[\w\.:]+/)}function cv(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;const r=n[0];return n=t.exec(e),r}}}function Kc(e){typeof e.dispose=="function"&&e.dispose()}var Rr=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},dv=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},fv=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){const t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},hv=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Rr(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const e=this.Q;this.Q=[];const t=new fv;for(const n of e)pv(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof Rr){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function pv(e,t,n,r){const o=n.lookup(e.scopeName);if(!o){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const i=n.lookup(t);e instanceof Rr?To({baseGrammar:i,selfGrammar:o},r):Ns(e.ruleName,{baseGrammar:i,selfGrammar:o,repository:o.repository},r);const s=n.injections(e.scopeName);if(s)for(const a of s)r.add(new Rr(a))}function Ns(e,t,n){if(t.repository&&t.repository[e]){const r=t.repository[e];Go([r],t,n)}}function To(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&Go(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&Go(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function Go(e,t,n){for(const r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);const o=r.repository?Hc({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&Go(r.patterns,{...t,repository:o},n);const i=r.include;if(!i)continue;const s=Zc(i);switch(s.kind){case 0:To({...t,selfGrammar:t.baseGrammar},n);break;case 1:To(t,n);break;case 2:Ns(s.ruleName,{...t,repository:o},n);break;case 3:case 4:const a=s.scopeName===t.selfGrammar.scopeName?t.selfGrammar:s.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(a){const l={baseGrammar:t.baseGrammar,selfGrammar:a,repository:o};s.kind===4?Ns(s.ruleName,l,n):To(l,n)}else s.kind===4?n.add(new dv(s.scopeName,s.ruleName)):n.add(new Rr(s.scopeName));break}}}var mv=class{kind=0},gv=class{kind=1},vv=class{constructor(e){this.ruleName=e}kind=2},yv=class{constructor(e){this.scopeName=e}kind=3},_v=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function Zc(e){if(e==="$base")return new mv;if(e==="$self")return new gv;const t=e.indexOf("#");if(t===-1)return new yv(e);if(t===0)return new vv(e.substring(1));{const n=e.substring(0,t),r=e.substring(t+1);return new _v(n,r)}}var bv=/\\(\d+)/,kl=/\\(\d+)/g,wv=-1,Qc=-2;var Jr=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=so.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=so.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${Gc(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:so.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:so.replaceCaptures(this._contentName,e,t)}},Ev=class extends Jr{retokenizeCapturedWithRuleId;constructor(e,t,n,r,o){super(e,t,n,r),this.retokenizeCapturedWithRuleId=o}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,n,r){throw new Error("Not supported!")}},xv=class extends Jr{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,o){super(e,t,n,null),this._match=new Mr(r,this.id),this.captures=o,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Or,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Cl=class extends Jr{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,o){super(e,t,n,r),this.patterns=o.patterns,this.hasMissingPatterns=o.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(const n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Or,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Rs=class extends Jr{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,o,i,s,a,l,u){super(e,t,n,r),this._begin=new Mr(o,this.id),this.beginCaptures=i,this._end=new Mr(s||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=a,this.applyEndPatternLast=l||!1,this.patterns=u.patterns,this.hasMissingPatterns=u.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Or;for(const n of this.patterns)e.getRule(n).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},jo=class extends Jr{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,o,i,s,a,l){super(e,t,n,r),this._begin=new Mr(o,this.id),this.beginCaptures=i,this.whileCaptures=a,this._while=new Mr(s,Qc),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Or;for(const t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Or,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||"￿"),this._cachedCompiledWhilePatterns}},Jc=class Qe{static createCaptureRule(t,n,r,o,i){return t.registerRule(s=>new Ev(n,s,r,o,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(o=>{if(t.id=o,t.match)return new xv(t.$vscodeTextmateLocation,t.id,t.name,t.match,Qe._compileCaptures(t.captures,n,r));if(typeof t.begin>"u"){t.repository&&(r=Hc({},r,t.repository));let i=t.patterns;return typeof i>"u"&&t.include&&(i=[{include:t.include}]),new Cl(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,Qe._compilePatterns(i,n,r))}return t.while?new jo(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,Qe._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,Qe._compileCaptures(t.whileCaptures||t.captures,n,r),Qe._compilePatterns(t.patterns,n,r)):new Rs(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,Qe._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,Qe._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,Qe._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let o=[];if(t){let i=0;for(const s in t){if(s==="$vscodeTextmateLocation")continue;const a=parseInt(s,10);a>i&&(i=a)}for(let s=0;s<=i;s++)o[s]=null;for(const s in t){if(s==="$vscodeTextmateLocation")continue;const a=parseInt(s,10);let l=0;t[s].patterns&&(l=Qe.getCompiledRuleId(t[s],n,r)),o[a]=Qe.createCaptureRule(n,t[s].$vscodeTextmateLocation,t[s].name,t[s].contentName,l)}}return o}static _compilePatterns(t,n,r){let o=[];if(t)for(let i=0,s=t.length;i<s;i++){const a=t[i];let l=-1;if(a.include){const u=Zc(a.include);switch(u.kind){case 0:case 1:l=Qe.getCompiledRuleId(r[a.include],n,r);break;case 2:let c=r[u.ruleName];c&&(l=Qe.getCompiledRuleId(c,n,r));break;case 3:case 4:const d=u.scopeName,f=u.kind===4?u.ruleName:null,h=n.getExternalGrammar(d,r);if(h)if(f){let p=h.repository[f];p&&(l=Qe.getCompiledRuleId(p,n,h.repository))}else l=Qe.getCompiledRuleId(h.repository.$self,n,h.repository);break}}else l=Qe.getCompiledRuleId(a,n,r);if(l!==-1){const u=n.getRule(l);let c=!1;if((u instanceof Cl||u instanceof Rs||u instanceof jo)&&u.hasMissingPatterns&&u.patterns.length===0&&(c=!0),c)continue;o.push(l)}}return{patterns:o,hasMissingPatterns:(t?t.length:0)!==o.length}}},Mr=class ed{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(t,n){if(t&&typeof t=="string"){const r=t.length;let o=0,i=[],s=!1;for(let a=0;a<r;a++)if(t.charAt(a)==="\\"&&a+1<r){const u=t.charAt(a+1);u==="z"?(i.push(t.substring(o,a)),i.push("$(?!\\n)(?<!\\n)"),o=a+2):(u==="A"||u==="G")&&(s=!0),a++}this.hasAnchor=s,o===0?this.source=t:(i.push(t.substring(o,r)),this.source=i.join(""))}else this.hasAnchor=!1,this.source=t;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=bv.test(this.source):this.hasBackReferences=!1}clone(){return new ed(this.source,this.ruleId)}setSource(t){this.source!==t&&(this.source=t,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(t,n){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let r=n.map(o=>t.substring(o.start,o.end));return kl.lastIndex=0,this.source.replace(kl,(o,i)=>Wc(r[parseInt(i,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let t=[],n=[],r=[],o=[],i,s,a,l;for(i=0,s=this.source.length;i<s;i++)a=this.source.charAt(i),t[i]=a,n[i]=a,r[i]=a,o[i]=a,a==="\\"&&i+1<s&&(l=this.source.charAt(i+1),l==="A"?(t[i+1]="￿",n[i+1]="￿",r[i+1]="A",o[i+1]="A"):l==="G"?(t[i+1]="￿",n[i+1]="G",r[i+1]="￿",o[i+1]="G"):(t[i+1]=l,n[i+1]=l,r[i+1]=l,o[i+1]=l),i++);return{A0_G0:t.join(""),A0_G1:n.join(""),A1_G0:r.join(""),A1_G1:o.join("")}}resolveAnchors(t,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:t?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},Or=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(n=>n.source);this._cached=new Sl(e,t,this._items.map(n=>n.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){let r=this._items.map(o=>o.resolveAnchors(t,n));return new Sl(e,r,this._items.map(o=>o.ruleId))}},Sl=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(" - "+this.rules[t]+": "+this.regExps[t]);return e.join(`
3
+ `)}findNextMatchSync(e,t,n){const r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},Hi=class{constructor(e,t){this.languageId=e,this.tokenType=t}},kv=class Ms{_defaultAttributes;_embeddedLanguagesMatcher;constructor(t,n){this._defaultAttributes=new Hi(t,8),this._embeddedLanguagesMatcher=new Cv(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?Ms._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new Hi(0,0);_getBasicScopeAttributes=new qc(t=>{const n=this._scopeToLanguage(t),r=this._toStandardTokenType(t);return new Hi(n,r)});_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const n=t.match(Ms.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},Cv=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);const t=e.map(([n,r])=>Wc(n));t.sort(),t.reverse(),this.scopesRegExp=new RegExp(`^((${t.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;const t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}},Tl=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function td(e,t,n,r,o,i,s,a){const l=t.content.length;let u=!1,c=-1;if(s){const h=Sv(e,t,n,r,o,i);o=h.stack,r=h.linePos,n=h.isFirstLine,c=h.anchorPosition}const d=Date.now();for(;!u;){if(a!==0&&Date.now()-d>a)return new Tl(o,!0);f()}return new Tl(o,!1);function f(){const h=Tv(e,t,n,r,o,c);if(!h){i.produce(o,l),u=!0;return}const p=h.captureIndices,b=h.matchedRuleId,_=p&&p.length>0?p[0].end>r:!1;if(b===wv){const y=o.getRule(e);i.produce(o,p[0].start),o=o.withContentNameScopesList(o.nameScopesList),br(e,t,n,o,i,y.endCaptures,p),i.produce(o,p[0].end);const g=o;if(o=o.parent,c=g.getAnchorPos(),!_&&g.getEnterPos()===r){o=g,i.produce(o,l),u=!0;return}}else{const y=e.getRule(b);i.produce(o,p[0].start);const g=o,m=y.getName(t.content,p),v=o.contentNameScopesList.pushAttributed(m,e);if(o=o.push(b,r,c,p[0].end===l,null,v,v),y instanceof Rs){const x=y;br(e,t,n,o,i,x.beginCaptures,p),i.produce(o,p[0].end),c=p[0].end;const L=x.getContentName(t.content,p),P=v.pushAttributed(L,e);if(o=o.withContentNameScopesList(P),x.endHasBackReferences&&(o=o.withEndRule(x.getEndWithResolvedBackReferences(t.content,p))),!_&&g.hasSameRuleAs(o)){o=o.pop(),i.produce(o,l),u=!0;return}}else if(y instanceof jo){const x=y;br(e,t,n,o,i,x.beginCaptures,p),i.produce(o,p[0].end),c=p[0].end;const L=x.getContentName(t.content,p),P=v.pushAttributed(L,e);if(o=o.withContentNameScopesList(P),x.whileHasBackReferences&&(o=o.withEndRule(x.getWhileWithResolvedBackReferences(t.content,p))),!_&&g.hasSameRuleAs(o)){o=o.pop(),i.produce(o,l),u=!0;return}}else if(br(e,t,n,o,i,y.captures,p),i.produce(o,p[0].end),o=o.pop(),!_){o=o.safePop(),i.produce(o,l),u=!0;return}}p[0].end>r&&(r=p[0].end,n=!1)}}function Sv(e,t,n,r,o,i){let s=o.beginRuleCapturedEOL?0:-1;const a=[];for(let l=o;l;l=l.pop()){const u=l.getRule(e);u instanceof jo&&a.push({rule:u,stack:l})}for(let l=a.pop();l;l=a.pop()){const{ruleScanner:u,findOptions:c}=Iv(l.rule,e,l.stack.endRule,n,r===s),d=u.findNextMatchSync(t,r,c);if(d){if(d.ruleId!==Qc){o=l.stack.pop();break}d.captureIndices&&d.captureIndices.length&&(i.produce(l.stack,d.captureIndices[0].start),br(e,t,n,l.stack,i,l.rule.whileCaptures,d.captureIndices),i.produce(l.stack,d.captureIndices[0].end),s=d.captureIndices[0].end,d.captureIndices[0].end>r&&(r=d.captureIndices[0].end,n=!1))}else{o=l.stack.pop();break}}return{stack:o,linePos:r,anchorPosition:s,isFirstLine:n}}function Tv(e,t,n,r,o,i){const s=Av(e,t,n,r,o,i),a=e.getInjections();if(a.length===0)return s;const l=Lv(a,e,t,n,r,o,i);if(!l)return s;if(!s)return l;const u=s.captureIndices[0].start,c=l.captureIndices[0].start;return c<u||l.priorityMatch&&c===u?l:s}function Av(e,t,n,r,o,i){const s=o.getRule(e),{ruleScanner:a,findOptions:l}=nd(s,e,o.endRule,n,r===i),u=a.findNextMatchSync(t,r,l);return u?{captureIndices:u.captureIndices,matchedRuleId:u.ruleId}:null}function Lv(e,t,n,r,o,i,s){let a=Number.MAX_VALUE,l=null,u,c=0;const d=i.contentNameScopesList.getScopeNames();for(let f=0,h=e.length;f<h;f++){const p=e[f];if(!p.matcher(d))continue;const b=t.getRule(p.ruleId),{ruleScanner:_,findOptions:y}=nd(b,t,null,r,o===s),g=_.findNextMatchSync(n,o,y);if(!g)continue;const m=g.captureIndices[0].start;if(!(m>=a)&&(a=m,l=g.captureIndices,u=g.ruleId,c=p.priority,a===o))break}return l?{priorityMatch:c===-1,captureIndices:l,matchedRuleId:u}:null}function nd(e,t,n,r,o){return{ruleScanner:e.compileAG(t,n,r,o),findOptions:0}}function Iv(e,t,n,r,o){return{ruleScanner:e.compileWhileAG(t,n,r,o),findOptions:0}}function br(e,t,n,r,o,i,s){if(i.length===0)return;const a=t.content,l=Math.min(i.length,s.length),u=[],c=s[0].end;for(let d=0;d<l;d++){const f=i[d];if(f===null)continue;const h=s[d];if(h.length===0)continue;if(h.start>c)break;for(;u.length>0&&u[u.length-1].endPos<=h.start;)o.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop();if(u.length>0?o.produceFromScopes(u[u.length-1].scopes,h.start):o.produce(r,h.start),f.retokenizeCapturedWithRuleId){const b=f.getName(a,s),_=r.contentNameScopesList.pushAttributed(b,e),y=f.getContentName(a,s),g=_.pushAttributed(y,e),m=r.push(f.retokenizeCapturedWithRuleId,h.start,-1,!1,null,_,g),v=e.createOnigString(a.substring(0,h.end));td(e,v,n&&h.start===0,h.start,m,o,!1,0),Kc(v);continue}const p=f.getName(a,s);if(p!==null){const _=(u.length>0?u[u.length-1].scopes:r.contentNameScopesList).pushAttributed(p,e);u.push(new Pv(_,h.end))}}for(;u.length>0;)o.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop()}var Pv=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function Nv(e,t,n,r,o,i,s,a){return new Mv(e,t,n,r,o,i,s,a)}function Al(e,t,n,r,o){const i=Ho(t,Uo),s=Jc.getCompiledRuleId(n,r,o.repository);for(const a of i)e.push({debugSelector:t,matcher:a.matcher,ruleId:s,grammar:o,priority:a.priority})}function Uo(e,t){if(t.length<e.length)return!1;let n=0;return e.every(r=>{for(let o=n;o<t.length;o++)if(Rv(t[o],r))return n=o+1,!0;return!1})}function Rv(e,t){if(!e)return!1;if(e===t)return!0;const n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]==="."}var Mv=class{constructor(e,t,n,r,o,i,s,a){if(this._rootScopeName=e,this.balancedBracketSelectors=i,this._onigLib=a,this._basicScopeAttributesProvider=new kv(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=s,this._grammar=Ll(t,null),this._injections=null,this._tokenTypeMatchers=[],o)for(const l of Object.keys(o)){const u=Ho(l,Uo);for(const c of u)this._tokenTypeMatchers.push({matcher:c.matcher,type:o[l]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(const e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){const e={lookup:o=>o===this._rootScopeName?this._grammar:this.getExternalGrammar(o),injections:o=>this._grammarRepository.injections(o)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){const o=r.injections;if(o)for(let s in o)Al(t,s,o[s],this,r);const i=this._grammarRepository.injections(n);i&&i.forEach(s=>{const a=this.getExternalGrammar(s);if(a){const l=a.injectionSelector;l&&Al(t,l,a,this,a)}})}return t.sort((o,i)=>o.priority-i.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){const t=++this._lastRuleId,n=e(t);return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){const n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=Ll(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){const r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){const r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){this._rootId===-1&&(this._rootId=Jc.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let o;if(!t||t===Os.NULL){o=!0;const u=this._basicScopeAttributesProvider.getDefaultAttributes(),c=this.themeProvider.getDefaults(),d=er.set(0,u.languageId,u.tokenType,null,c.fontStyle,c.foregroundId,c.backgroundId),f=this.getRule(this._rootId).getName(null,null);let h;f?h=Sr.createRootAndLookUpScopeName(f,d,this):h=Sr.createRoot("unknown",d),t=new Os(null,this._rootId,-1,-1,!1,null,h,h)}else o=!1,t.reset();e=e+`
4
+ `;const i=this.createOnigString(e),s=i.content.length,a=new Dv(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),l=td(this,i,o,0,t,a,!0,r);return Kc(i),{lineLength:s,lineTokens:a,ruleStack:l.stack,stoppedEarly:l.stoppedEarly}}};function Ll(e,t){return e=Jg(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var Sr=class kt{constructor(t,n,r){this.parent=t,this.scopePath=n,this.tokenAttributes=r}static fromExtension(t,n){let r=t,o=t?.scopePath??null;for(const i of n)o=zi.push(o,i.scopeNames),r=new kt(r,o,i.encodedTokenAttributes);return r}static createRoot(t,n){return new kt(null,new zi(null,t),n)}static createRootAndLookUpScopeName(t,n,r){const o=r.getMetadataForScope(t),i=new zi(null,t),s=r.themeProvider.themeMatch(i),a=kt.mergeAttributes(n,o,s);return new kt(null,i,a)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return kt.equals(this,t)}static equals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.scopeName!==n.scopeName||t.tokenAttributes!==n.tokenAttributes)return!1;t=t.parent,n=n.parent}while(!0)}static mergeAttributes(t,n,r){let o=-1,i=0,s=0;return r!==null&&(o=r.fontStyle,i=r.foregroundId,s=r.backgroundId),er.set(t,n.languageId,n.tokenType,null,o,i,s)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return kt._pushAttributed(this,t,n);const r=t.split(/ /g);let o=this;for(const i of r)o=kt._pushAttributed(o,i,n);return o}static _pushAttributed(t,n,r){const o=r.getMetadataForScope(n),i=t.scopePath.push(n),s=r.themeProvider.themeMatch(i),a=kt.mergeAttributes(t.tokenAttributes,o,s);return new kt(t,i,a)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){const n=[];let r=this;for(;r&&r!==t;)n.push({encodedTokenAttributes:r.tokenAttributes,scopeNames:r.scopePath.getExtensionIfDefined(r.parent?.scopePath??null)}),r=r.parent;return r===t?n.reverse():void 0}},Os=class pn{constructor(t,n,r,o,i,s,a,l){this.parent=t,this.ruleId=n,this.beginRuleCapturedEOL=i,this.endRule=s,this.nameScopesList=a,this.contentNameScopesList=l,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=r,this._anchorPos=o}_stackElementBrand=void 0;static NULL=new pn(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t===null?!1:pn._equals(this,t)}static _equals(t,n){return t===n?!0:this._structuralEquals(t,n)?Sr.equals(t.contentNameScopesList,n.contentNameScopesList):!1}static _structuralEquals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.depth!==n.depth||t.ruleId!==n.ruleId||t.endRule!==n.endRule)return!1;t=t.parent,n=n.parent}while(!0)}clone(){return this}static _reset(t){for(;t;)t._enterPos=-1,t._anchorPos=-1,t=t.parent}reset(){pn._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,o,i,s,a){return new pn(this,t,n,r,o,i,s,a)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(t){return t.getRule(this.ruleId)}toString(){const t=[];return this._writeString(t,0),"["+t.join(",")+"]"}_writeString(t,n){return this.parent&&(n=this.parent._writeString(t,n)),t[n++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,n}withContentNameScopesList(t){return this.contentNameScopesList===t?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,t)}withEndRule(t){return this.endRule===t?this:new pn(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(t){let n=this;for(;n&&n._enterPos===t._enterPos;){if(n.ruleId===t.ruleId)return!0;n=n.parent}return!1}toStateStackFrame(){return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){const r=Sr.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new pn(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,Sr.fromExtension(r,n.contentNameScopesList))}},Ov=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):Ho(n,Uo).map(r=>r.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>Ho(n,Uo).map(r=>r.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(const t of this.unbalancedBracketScopes)if(t(e))return!1;for(const t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},Dv=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let r=e?.tokenAttributes??0,o=!1;if(this.balancedBracketSelectors?.matchesAlways&&(o=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const i=e?.getScopeNames()??[];for(const s of this._tokenTypeOverrides)s.matcher(i)&&(r=er.set(r,0,s.type,null,-1,0,0));this.balancedBracketSelectors&&(o=this.balancedBracketSelectors.match(i))}if(o&&(r=er.set(r,0,8,o,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===r){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(r),this._lastTokenEndIndex=t;return}const n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);const n=new Uint32Array(this._binaryTokens.length);for(let r=0,o=this._binaryTokens.length;r<o;r++)n[r]=this._binaryTokens[r];return n}},$v=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(const e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,r,o){if(!this._grammars.has(e)){let i=this._rawGrammars.get(e);if(!i)return null;this._grammars.set(e,Nv(e,i,t,n,r,o,this,this._onigLib))}return this._grammars.get(e)}},Vv=class{_options;_syncRegistry;_ensureGrammarCache;constructor(t){this._options=t,this._syncRegistry=new $v(zo.createFromRawTheme(t.theme,t.colorMap),t.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(t,n){this._syncRegistry.setTheme(zo.createFromRawTheme(t,n))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(t,n,r){return this.loadGrammarWithConfiguration(t,n,{embeddedLanguages:r})}loadGrammarWithConfiguration(t,n,r){return this._loadGrammar(t,n,r.embeddedLanguages,r.tokenTypes,new Ov(r.balancedBracketSelectors||[],r.unbalancedBracketSelectors||[]))}loadGrammar(t){return this._loadGrammar(t,0,null,null,null)}_loadGrammar(t,n,r,o,i){const s=new hv(this._syncRegistry,t);for(;s.Q.length>0;)s.Q.map(a=>this._loadSingleGrammar(a.scopeName)),s.processQueue();return this._grammarForScopeName(t,n,r,o,i)}_loadSingleGrammar(t){this._ensureGrammarCache.has(t)||(this._doLoadSingleGrammar(t),this._ensureGrammarCache.set(t,!0))}_doLoadSingleGrammar(t){const n=this._options.loadGrammar(t);if(n){const r=typeof this._options.getInjections=="function"?this._options.getInjections(t):void 0;this._syncRegistry.addGrammar(n,r)}}addGrammar(t,n=[],r=0,o=null){return this._syncRegistry.addGrammar(t,n),this._grammarForScopeName(t.scopeName,r,o)}_grammarForScopeName(t,n=0,r=null,o=null,i=null){return this._syncRegistry.grammarForScopeName(t,n,r,o,i)}},Ds=Os.NULL;const Bv=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class eo{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}eo.prototype.normal={};eo.prototype.property={};eo.prototype.space=void 0;function rd(e,t){const n={},r={};for(const o of e)Object.assign(n,o.property),Object.assign(r,o.normal);return new eo(n,r,t)}function $s(e){return e.toLowerCase()}class st{constructor(t,n){this.attribute=n,this.property=t}}st.prototype.attribute="";st.prototype.booleanish=!1;st.prototype.boolean=!1;st.prototype.commaOrSpaceSeparated=!1;st.prototype.commaSeparated=!1;st.prototype.defined=!1;st.prototype.mustUseProperty=!1;st.prototype.number=!1;st.prototype.overloadedBoolean=!1;st.prototype.property="";st.prototype.spaceSeparated=!1;st.prototype.space=void 0;let Fv=0;const Ce=Rn(),Ve=Rn(),Vs=Rn(),se=Rn(),Me=Rn(),qn=Rn(),at=Rn();function Rn(){return 2**++Fv}const Bs=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ce,booleanish:Ve,commaOrSpaceSeparated:at,commaSeparated:qn,number:se,overloadedBoolean:Vs,spaceSeparated:Me},Symbol.toStringTag,{value:"Module"})),Gi=Object.keys(Bs);class Ra extends st{constructor(t,n,r,o){let i=-1;if(super(t,n),Il(this,"space",o),typeof r=="number")for(;++i<Gi.length;){const s=Gi[i];Il(this,Gi[i],(r&Bs[s])===Bs[s])}}}Ra.prototype.defined=!0;function Il(e,t,n){n&&(e[t]=n)}function fr(e){const t={},n={};for(const[r,o]of Object.entries(e.properties)){const i=new Ra(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[$s(r)]=r,n[$s(i.attribute)]=r}return new eo(t,n,e.space)}const od=fr({properties:{ariaActiveDescendant:null,ariaAtomic:Ve,ariaAutoComplete:null,ariaBusy:Ve,ariaChecked:Ve,ariaColCount:se,ariaColIndex:se,ariaColSpan:se,ariaControls:Me,ariaCurrent:null,ariaDescribedBy:Me,ariaDetails:null,ariaDisabled:Ve,ariaDropEffect:Me,ariaErrorMessage:null,ariaExpanded:Ve,ariaFlowTo:Me,ariaGrabbed:Ve,ariaHasPopup:null,ariaHidden:Ve,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Me,ariaLevel:se,ariaLive:null,ariaModal:Ve,ariaMultiLine:Ve,ariaMultiSelectable:Ve,ariaOrientation:null,ariaOwns:Me,ariaPlaceholder:null,ariaPosInSet:se,ariaPressed:Ve,ariaReadOnly:Ve,ariaRelevant:null,ariaRequired:Ve,ariaRoleDescription:Me,ariaRowCount:se,ariaRowIndex:se,ariaRowSpan:se,ariaSelected:Ve,ariaSetSize:se,ariaSort:null,ariaValueMax:se,ariaValueMin:se,ariaValueNow:se,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function id(e,t){return t in e?e[t]:t}function sd(e,t){return id(e,t.toLowerCase())}const zv=fr({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:qn,acceptCharset:Me,accessKey:Me,action:null,allow:null,allowFullScreen:Ce,allowPaymentRequest:Ce,allowUserMedia:Ce,alt:null,as:null,async:Ce,autoCapitalize:null,autoComplete:Me,autoFocus:Ce,autoPlay:Ce,blocking:Me,capture:null,charSet:null,checked:Ce,cite:null,className:Me,cols:se,colSpan:null,content:null,contentEditable:Ve,controls:Ce,controlsList:Me,coords:se|qn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ce,defer:Ce,dir:null,dirName:null,disabled:Ce,download:Vs,draggable:Ve,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ce,formTarget:null,headers:Me,height:se,hidden:Vs,high:se,href:null,hrefLang:null,htmlFor:Me,httpEquiv:Me,id:null,imageSizes:null,imageSrcSet:null,inert:Ce,inputMode:null,integrity:null,is:null,isMap:Ce,itemId:null,itemProp:Me,itemRef:Me,itemScope:Ce,itemType:Me,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ce,low:se,manifest:null,max:null,maxLength:se,media:null,method:null,min:null,minLength:se,multiple:Ce,muted:Ce,name:null,nonce:null,noModule:Ce,noValidate:Ce,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Ce,optimum:se,pattern:null,ping:Me,placeholder:null,playsInline:Ce,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ce,referrerPolicy:null,rel:Me,required:Ce,reversed:Ce,rows:se,rowSpan:se,sandbox:Me,scope:null,scoped:Ce,seamless:Ce,selected:Ce,shadowRootClonable:Ce,shadowRootDelegatesFocus:Ce,shadowRootMode:null,shape:null,size:se,sizes:null,slot:null,span:se,spellCheck:Ve,src:null,srcDoc:null,srcLang:null,srcSet:null,start:se,step:null,style:null,tabIndex:se,target:null,title:null,translate:null,type:null,typeMustMatch:Ce,useMap:null,value:Ve,width:se,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Me,axis:null,background:null,bgColor:null,border:se,borderColor:null,bottomMargin:se,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ce,declare:Ce,event:null,face:null,frame:null,frameBorder:null,hSpace:se,leftMargin:se,link:null,longDesc:null,lowSrc:null,marginHeight:se,marginWidth:se,noResize:Ce,noHref:Ce,noShade:Ce,noWrap:Ce,object:null,profile:null,prompt:null,rev:null,rightMargin:se,rules:null,scheme:null,scrolling:Ve,standby:null,summary:null,text:null,topMargin:se,valueType:null,version:null,vAlign:null,vLink:null,vSpace:se,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ce,disableRemotePlayback:Ce,prefix:null,property:null,results:se,security:null,unselectable:null},space:"html",transform:sd}),Hv=fr({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:at,accentHeight:se,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:se,amplitude:se,arabicForm:null,ascent:se,attributeName:null,attributeType:null,azimuth:se,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:se,by:null,calcMode:null,capHeight:se,className:Me,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:se,diffuseConstant:se,direction:null,display:null,dur:null,divisor:se,dominantBaseline:null,download:Ce,dx:null,dy:null,edgeMode:null,editable:null,elevation:se,enableBackground:null,end:null,event:null,exponent:se,externalResourcesRequired:null,fill:null,fillOpacity:se,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:qn,g2:qn,glyphName:qn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:se,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:se,horizOriginX:se,horizOriginY:se,id:null,ideographic:se,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:se,k:se,k1:se,k2:se,k3:se,k4:se,kernelMatrix:at,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:se,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:se,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:se,overlineThickness:se,paintOrder:null,panose1:null,path:null,pathLength:se,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Me,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:se,pointsAtY:se,pointsAtZ:se,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:at,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:at,rev:at,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:at,requiredFeatures:at,requiredFonts:at,requiredFormats:at,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:se,specularExponent:se,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:se,strikethroughThickness:se,string:null,stroke:null,strokeDashArray:at,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:se,strokeOpacity:se,strokeWidth:null,style:null,surfaceScale:se,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:at,tabIndex:se,tableValues:null,target:null,targetX:se,targetY:se,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:at,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:se,underlineThickness:se,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:se,values:null,vAlphabetic:se,vMathematical:se,vectorEffect:null,vHanging:se,vIdeographic:se,version:null,vertAdvY:se,vertOriginX:se,vertOriginY:se,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:se,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:id}),ad=fr({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),ld=fr({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:sd}),ud=fr({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Gv=/[A-Z]/g,Pl=/-[a-z]/g,jv=/^data[-\w.:]+$/i;function Uv(e,t){const n=$s(t);let r=t,o=st;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&jv.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(Pl,qv);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!Pl.test(i)){let s=i.replace(Gv,Wv);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}o=Ra}return new o(r,t)}function Wv(e){return"-"+e.toLowerCase()}function qv(e){return e.charAt(1).toUpperCase()}const Yv=rd([od,zv,ad,ld,ud],"html"),cd=rd([od,Hv,ad,ld,ud],"svg"),Nl={}.hasOwnProperty;function Xv(e,t){const n=t||{};function r(o,...i){let s=r.invalid;const a=r.handlers;if(o&&Nl.call(o,e)){const l=String(o[e]);s=Nl.call(a,l)?a[l]:r.unknown}if(s)return s.call(this,o,...i)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const Kv=/["&'<>`]/g,Zv=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Qv=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Jv=/[|\\{}()[\]^$+*?.]/g,Rl=new WeakMap;function ey(e,t){if(e=e.replace(t.subset?ty(t.subset):Kv,r),t.subset||t.escapeOnly)return e;return e.replace(Zv,n).replace(Qv,r);function n(o,i,s){return t.format((o.charCodeAt(0)-55296)*1024+o.charCodeAt(1)-56320+65536,s.charCodeAt(i+2),t)}function r(o,i,s){return t.format(o.charCodeAt(0),s.charCodeAt(i+1),t)}}function ty(e){let t=Rl.get(e);return t||(t=ny(e),Rl.set(e,t)),t}function ny(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(Jv,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const ry=/[\dA-Fa-f]/;function oy(e,t,n){const r="&#x"+e.toString(16).toUpperCase();return n&&t&&!ry.test(String.fromCharCode(t))?r:r+";"}const iy=/\d/;function sy(e,t,n){const r="&#"+String(e);return n&&t&&!iy.test(String.fromCharCode(t))?r:r+";"}const ay=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],ji={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},ly=["cent","copy","divide","gt","lt","not","para","times"],dd={}.hasOwnProperty,Fs={};let ao;for(ao in ji)dd.call(ji,ao)&&(Fs[ji[ao]]=ao);const uy=/[^\dA-Za-z]/;function cy(e,t,n,r){const o=String.fromCharCode(e);if(dd.call(Fs,o)){const i=Fs[o],s="&"+i;return n&&ay.includes(i)&&!ly.includes(i)&&(!r||t&&t!==61&&uy.test(String.fromCharCode(t)))?s:s+";"}return""}function dy(e,t,n){let r=oy(e,t,n.omitOptionalSemicolons),o;if((n.useNamedReferences||n.useShortestReferences)&&(o=cy(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!o)&&n.useShortestReferences){const i=sy(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return o&&(!n.useShortestReferences||o.length<r.length)?o:r}function Yn(e,t){return ey(e,Object.assign({format:dy},t))}const fy=/^>|^->|<!--|-->|--!>|<!-$/g,hy=[">"],py=["<",">"];function my(e,t,n,r){return r.settings.bogusComments?"<?"+Yn(e.value,Object.assign({},r.settings.characterReferences,{subset:hy}))+">":"<!--"+e.value.replace(fy,o)+"-->";function o(i){return Yn(i,Object.assign({},r.settings.characterReferences,{subset:py}))}}function gy(e,t,n,r){return"<!"+(r.settings.upperDoctype?"DOCTYPE":"doctype")+(r.settings.tightDoctype?"":" ")+"html>"}function Ml(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,o=n.indexOf(t);for(;o!==-1;)r++,o=n.indexOf(t,o+t.length);return r}function vy(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function yy(e){return e.join(" ").trim()}const _y=/[ \t\n\f\r]/g;function Ma(e){return typeof e=="object"?e.type==="text"?Ol(e.value):!1:Ol(e)}function Ol(e){return e.replace(_y,"")===""}const qe=hd(1),fd=hd(-1),by=[];function hd(e){return t;function t(n,r,o){const i=n?n.children:by;let s=(r||0)+e,a=i[s];if(!o)for(;a&&Ma(a);)s+=e,a=i[s];return a}}const wy={}.hasOwnProperty;function pd(e){return t;function t(n,r,o){return wy.call(e,n.tagName)&&e[n.tagName](n,r,o)}}const Oa=pd({body:xy,caption:Ui,colgroup:Ui,dd:Ty,dt:Sy,head:Ui,html:Ey,li:Cy,optgroup:Ay,option:Ly,p:ky,rp:Dl,rt:Dl,tbody:Py,td:$l,tfoot:Ny,th:$l,thead:Iy,tr:Ry});function Ui(e,t,n){const r=qe(n,t,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&Ma(r.value.charAt(0)))}function Ey(e,t,n){const r=qe(n,t);return!r||r.type!=="comment"}function xy(e,t,n){const r=qe(n,t);return!r||r.type!=="comment"}function ky(e,t,n){const r=qe(n,t);return r?r.type==="element"&&(r.tagName==="address"||r.tagName==="article"||r.tagName==="aside"||r.tagName==="blockquote"||r.tagName==="details"||r.tagName==="div"||r.tagName==="dl"||r.tagName==="fieldset"||r.tagName==="figcaption"||r.tagName==="figure"||r.tagName==="footer"||r.tagName==="form"||r.tagName==="h1"||r.tagName==="h2"||r.tagName==="h3"||r.tagName==="h4"||r.tagName==="h5"||r.tagName==="h6"||r.tagName==="header"||r.tagName==="hgroup"||r.tagName==="hr"||r.tagName==="main"||r.tagName==="menu"||r.tagName==="nav"||r.tagName==="ol"||r.tagName==="p"||r.tagName==="pre"||r.tagName==="section"||r.tagName==="table"||r.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function Cy(e,t,n){const r=qe(n,t);return!r||r.type==="element"&&r.tagName==="li"}function Sy(e,t,n){const r=qe(n,t);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function Ty(e,t,n){const r=qe(n,t);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function Dl(e,t,n){const r=qe(n,t);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function Ay(e,t,n){const r=qe(n,t);return!r||r.type==="element"&&r.tagName==="optgroup"}function Ly(e,t,n){const r=qe(n,t);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function Iy(e,t,n){const r=qe(n,t);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function Py(e,t,n){const r=qe(n,t);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function Ny(e,t,n){return!qe(n,t)}function Ry(e,t,n){const r=qe(n,t);return!r||r.type==="element"&&r.tagName==="tr"}function $l(e,t,n){const r=qe(n,t);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const My=pd({body:$y,colgroup:Vy,head:Dy,html:Oy,tbody:By});function Oy(e){const t=qe(e,-1);return!t||t.type!=="comment"}function Dy(e){const t=new Set;for(const r of e.children)if(r.type==="element"&&(r.tagName==="base"||r.tagName==="title")){if(t.has(r.tagName))return!1;t.add(r.tagName)}const n=e.children[0];return!n||n.type==="element"}function $y(e){const t=qe(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&Ma(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function Vy(e,t,n){const r=fd(n,t),o=qe(e,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&Oa(r,n.children.indexOf(r),n)?!1:!!(o&&o.type==="element"&&o.tagName==="col")}function By(e,t,n){const r=fd(n,t),o=qe(e,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&Oa(r,n.children.indexOf(r),n)?!1:!!(o&&o.type==="element"&&o.tagName==="tr")}const lo={name:[[`
5
+ \f\r &/=>`.split(""),`
6
+ \f\r "&'/=>\``.split("")],[`\0
7
+ \f\r "&'/<=>`.split(""),`\0
8
+ \f\r "&'/<=>\``.split("")]],unquoted:[[`
9
+ \f\r &>`.split(""),`\0
10
+ \f\r "&'<=>\``.split("")],[`\0
11
+ \f\r "&'<=>\``.split(""),`\0
12
+ \f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function Fy(e,t,n,r){const o=r.schema,i=o.space==="svg"?!1:r.settings.omitOptionalTags;let s=o.space==="svg"?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase());const a=[];let l;o.space==="html"&&e.tagName==="svg"&&(r.schema=cd);const u=zy(r,e.properties),c=r.all(o.space==="html"&&e.tagName==="template"?e.content:e);return r.schema=o,c&&(s=!1),(u||!i||!My(e,t,n))&&(a.push("<",e.tagName,u?" "+u:""),s&&(o.space==="svg"||r.settings.closeSelfClosing)&&(l=u.charAt(u.length-1),(!r.settings.tightSelfClosing||l==="/"||l&&l!=='"'&&l!=="'")&&a.push(" "),a.push("/")),a.push(">")),a.push(c),!s&&(!i||!Oa(e,t,n))&&a.push("</"+e.tagName+">"),a.join("")}function zy(e,t){const n=[];let r=-1,o;if(t){for(o in t)if(t[o]!==null&&t[o]!==void 0){const i=Hy(e,o,t[o]);i&&n.push(i)}}for(;++r<n.length;){const i=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&i!=='"'&&i!=="'"&&(n[r]+=" ")}return n.join("")}function Hy(e,t,n){const r=Uv(e.schema,t),o=e.settings.allowParseErrors&&e.schema.space==="html"?0:1,i=e.settings.allowDangerousCharacters?0:1;let s=e.quote,a;if(r.overloadedBoolean&&(n===r.attribute||n==="")?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!="string"||n===r.attribute||n==="")&&(n=!!n),n==null||n===!1||typeof n=="number"&&Number.isNaN(n))return"";const l=Yn(r.attribute,Object.assign({},e.settings.characterReferences,{subset:lo.name[o][i]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?vy:yy)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?l:(e.settings.preferUnquoted&&(a=Yn(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:lo.unquoted[o][i]}))),a!==n&&(e.settings.quoteSmart&&Ml(n,s)>Ml(n,e.alternative)&&(s=e.alternative),a=s+Yn(n,Object.assign({},e.settings.characterReferences,{subset:(s==="'"?lo.single:lo.double)[o][i],attribute:!0}))+s),l+(a&&"="+a))}const Gy=["<","&"];function md(e,t,n,r){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:Yn(e.value,Object.assign({},r.settings.characterReferences,{subset:Gy}))}function jy(e,t,n,r){return r.settings.allowDangerousHtml?e.value:md(e,t,n,r)}function Uy(e,t,n,r){return r.all(e)}const Wy=Xv("type",{invalid:qy,unknown:Yy,handlers:{comment:my,doctype:gy,element:Fy,raw:jy,root:Uy,text:md}});function qy(e){throw new Error("Expected node, not `"+e+"`")}function Yy(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const Xy={},Ky={},Zy=[];function qt(e,t){const n=t||Xy,r=n.quote||'"',o=r==='"'?"'":'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:Qy,all:Jy,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||Bv,characterReferences:n.characterReferences||Ky,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?cd:Yv,quote:r,alternative:o}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function Qy(e,t,n){return Wy(e,t,n,this)}function Jy(e){const t=[],n=e&&e.children||Zy;let r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join("")}function Wo(e,t){const n=typeof e=="string"?{}:{...e.colorReplacements},r=typeof e=="string"?e:e.name;for(const[o,i]of Object.entries(t?.colorReplacements||{}))typeof i=="string"?n[o]=i:o===r&&Object.assign(n,i);return n}function sn(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function e0(e){return Array.isArray(e)?e:[e]}async function gd(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function Da(e){return!e||["plaintext","txt","text","plain"].includes(e)}function vd(e){return e==="ansi"||Da(e)}function $a(e){return e==="none"}function yd(e){return $a(e)}function _d(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class=="string"&&(e.properties.class=e.properties.class.split(/\s+/g)),Array.isArray(e.properties.class)||(e.properties.class=[]);const n=Array.isArray(t)?t:t.split(/\s+/g);for(const r of n)r&&!e.properties.class.includes(r)&&e.properties.class.push(r);return e}function bi(e,t=!1){if(e.length===0)return[["",0]];const n=e.split(/(\r?\n)/g);let r=0;const o=[];for(let i=0;i<n.length;i+=2){const s=t?n[i]+(n[i+1]||""):n[i];o.push([s,r]),r+=n[i].length,r+=n[i+1]?.length||0}return o}function t0(e){const t=bi(e,!0).map(([o])=>o);function n(o){if(o===e.length)return{line:t.length-1,character:t[t.length-1].length};let i=o,s=0;for(const a of t){if(i<a.length)break;i-=a.length,s++}return{line:s,character:i}}function r(o,i){let s=0;for(let a=0;a<o;a++)s+=t[a].length;return s+=i,s}return{lines:t,indexToPos:n,posToIndex:r}}function n0(e,t,n){const r=new Set;for(const i of e.matchAll(/:?lang=["']([^"']+)["']/g)){const s=i[1].toLowerCase().trim();s&&r.add(s)}for(const i of e.matchAll(/(?:```|~~~)([\w-]+)/g)){const s=i[1].toLowerCase().trim();s&&r.add(s)}for(const i of e.matchAll(/\\begin\{([\w-]+)\}/g)){const s=i[1].toLowerCase().trim();s&&r.add(s)}for(const i of e.matchAll(/<script\s+(?:type|lang)=["']([^"']+)["']/gi)){const s=i[1].toLowerCase().trim(),a=s.includes("/")?s.split("/").pop():s;a&&r.add(a)}if(!n)return Array.from(r);const o=n.getBundledLanguages();return Array.from(r).filter(i=>i&&o[i])}const Va="light-dark()",r0=["color","background-color"];function o0(e,t){let n=0;const r=[];for(const o of t)o>n&&r.push({...e,content:e.content.slice(n,o),offset:e.offset+n}),n=o;return n<e.content.length&&r.push({...e,content:e.content.slice(n),offset:e.offset+n}),r}function i0(e,t){const n=Array.from(t instanceof Set?t:new Set(t)).sort((r,o)=>r-o);return n.length?e.map(r=>r.flatMap(o=>{const i=n.filter(s=>o.offset<s&&s<o.offset+o.content.length).map(s=>s-o.offset).sort((s,a)=>s-a);return i.length?o0(o,i):o})):e}function s0(e,t,n,r,o="css-vars"){const i={content:e.content,explanation:e.explanation,offset:e.offset},s=t.map(c=>qo(e.variants[c])),a=new Set(s.flatMap(c=>Object.keys(c))),l={},u=(c,d)=>{const f=d==="color"?"":d==="background-color"?"-bg":`-${d}`;return n+t[c]+(d==="color"?"":f)};return s.forEach((c,d)=>{for(const f of a){const h=c[f]||"inherit";if(d===0&&r&&r0.includes(f))if(r===Va&&s.length>1){const p=t.findIndex(g=>g==="light"),b=t.findIndex(g=>g==="dark");if(p===-1||b===-1)throw new Fe('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const _=s[p][f]||"inherit",y=s[b][f]||"inherit";l[f]=`light-dark(${_}, ${y})`,o==="css-vars"&&(l[u(d,f)]=h)}else l[f]=h;else o==="css-vars"&&(l[u(d,f)]=h)}}),i.htmlStyle=l,i}function qo(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&Je.Italic&&(t["font-style"]="italic"),e.fontStyle&Je.Bold&&(t["font-weight"]="bold");const n=[];e.fontStyle&Je.Underline&&n.push("underline"),e.fontStyle&Je.Strikethrough&&n.push("line-through"),n.length&&(t["text-decoration"]=n.join(" "))}return t}function zs(e){return typeof e=="string"?e:Object.entries(e).map(([t,n])=>`${t}:${n}`).join(";")}const bd=new WeakMap;function wi(e,t){bd.set(e,t)}function Dr(e){return bd.get(e)}class hr{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new hr(Object.fromEntries(e0(n).map(r=>[r,Ds])),t)}constructor(...t){if(t.length===2){const[n,r]=t;this.lang=r,this._stacks=n}else{const[n,r,o]=t;this.lang=r,this._stacks={[o]:n}}}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return a0(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}}function a0(e){const t=[],n=new Set;function r(o){if(n.has(o))return;n.add(o);const i=o?.nameScopesList?.scopeName;i&&t.push(i),o.parent&&r(o.parent)}return r(e),t}function l0(e,t){if(!(e instanceof hr))throw new Fe("Invalid grammar state");return e.getInternalStack(t)}function u0(){const e=new WeakMap;function t(n){if(!e.has(n.meta)){let r=function(s){if(typeof s=="number"){if(s<0||s>n.source.length)throw new Fe(`Invalid decoration offset: ${s}. Code length: ${n.source.length}`);return{...o.indexToPos(s),offset:s}}else{const a=o.lines[s.line];if(a===void 0)throw new Fe(`Invalid decoration position ${JSON.stringify(s)}. Lines length: ${o.lines.length}`);let l=s.character;if(l<0&&(l=a.length+l),l<0||l>a.length)throw new Fe(`Invalid decoration position ${JSON.stringify(s)}. Line ${s.line} length: ${a.length}`);return{...s,character:l,offset:o.posToIndex(s.line,l)}}};const o=t0(n.source),i=(n.options.decorations||[]).map(s=>({...s,start:r(s.start),end:r(s.end)}));c0(i),e.set(n.meta,{decorations:i,converter:o,source:n.source})}return e.get(n.meta)}return{name:"shiki:decorations",tokens(n){if(!this.options.decorations?.length)return;const o=t(this).decorations.flatMap(s=>[s.start.offset,s.end.offset]);return i0(n,o)},code(n){if(!this.options.decorations?.length)return;const r=t(this),o=Array.from(n.children).filter(c=>c.type==="element"&&c.tagName==="span");if(o.length!==r.converter.lines.length)throw new Fe(`Number of lines in code element (${o.length}) does not match the number of lines in the source (${r.converter.lines.length}). Failed to apply decorations.`);function i(c,d,f,h){const p=o[c];let b="",_=-1,y=-1;if(d===0&&(_=0),f===0&&(y=0),f===Number.POSITIVE_INFINITY&&(y=p.children.length),_===-1||y===-1)for(let m=0;m<p.children.length;m++)b+=wd(p.children[m]),_===-1&&b.length===d&&(_=m+1),y===-1&&b.length===f&&(y=m+1);if(_===-1)throw new Fe(`Failed to find start index for decoration ${JSON.stringify(h.start)}`);if(y===-1)throw new Fe(`Failed to find end index for decoration ${JSON.stringify(h.end)}`);const g=p.children.slice(_,y);if(!h.alwaysWrap&&g.length===p.children.length)a(p,h,"line");else if(!h.alwaysWrap&&g.length===1&&g[0].type==="element")a(g[0],h,"token");else{const m={type:"element",tagName:"span",properties:{},children:g};a(m,h,"wrapper"),p.children.splice(_,g.length,m)}}function s(c,d){o[c]=a(o[c],d,"line")}function a(c,d,f){const h=d.properties||{},p=d.transform||(b=>b);return c.tagName=d.tagName||"span",c.properties={...c.properties,...h,class:c.properties.class},d.properties?.class&&_d(c,d.properties.class),c=p(c,f)||c,c}const l=[],u=r.decorations.sort((c,d)=>d.start.offset-c.start.offset||c.end.offset-d.end.offset);for(const c of u){const{start:d,end:f}=c;if(d.line===f.line)i(d.line,d.character,f.character,c);else if(d.line<f.line){i(d.line,d.character,Number.POSITIVE_INFINITY,c);for(let h=d.line+1;h<f.line;h++)l.unshift(()=>s(h,c));i(f.line,0,f.character,c)}}l.forEach(c=>c())}}}function c0(e){for(let t=0;t<e.length;t++){const n=e[t];if(n.start.offset>n.end.offset)throw new Fe(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;r<e.length;r++){const o=e[r],i=n.start.offset<=o.start.offset&&o.start.offset<n.end.offset,s=n.start.offset<o.end.offset&&o.end.offset<=n.end.offset,a=o.start.offset<=n.start.offset&&n.start.offset<o.end.offset,l=o.start.offset<n.end.offset&&n.end.offset<=o.end.offset;if(i||s||a||l){if(i&&s||a&&l||a&&n.start.offset===n.end.offset||s&&o.start.offset===o.end.offset)continue;throw new Fe(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(o.start)} intersect.`)}}}}function wd(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(wd).join(""):""}const d0=[u0()];function Yo(e){const t=f0(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...d0]}function f0(e){const t=[],n=[],r=[];for(const o of e)switch(o.enforce){case"pre":t.push(o);break;case"post":n.push(o);break;default:r.push(o)}return{pre:t,post:n,normal:r}}var yn=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],Wi={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function h0(e,t){const n=e.indexOf("\x1B",t);if(n!==-1&&e[n+1]==="["){const r=e.indexOf("m",n);if(r!==-1)return{sequence:e.substring(n+2,r).split(";"),startPosition:n,position:r+1}}return{position:e.length}}function Vl(e){const t=e.shift();if(t==="2"){const n=e.splice(0,3).map(r=>Number.parseInt(r));return n.length!==3||n.some(r=>Number.isNaN(r))?void 0:{type:"rgb",rgb:n}}else if(t==="5"){const n=e.shift();if(n)return{type:"table",index:Number(n)}}}function p0(e){const t=[];for(;e.length>0;){const n=e.shift();if(!n)continue;const r=Number.parseInt(n);if(!Number.isNaN(r))if(r===0)t.push({type:"resetAll"});else if(r<=9)Wi[r]&&t.push({type:"setDecoration",value:Wi[r]});else if(r<=29){const o=Wi[r-20];o&&(t.push({type:"resetDecoration",value:o}),o==="dim"&&t.push({type:"resetDecoration",value:"bold"}))}else if(r<=37)t.push({type:"setForegroundColor",value:{type:"named",name:yn[r-30]}});else if(r===38){const o=Vl(e);o&&t.push({type:"setForegroundColor",value:o})}else if(r===39)t.push({type:"resetForegroundColor"});else if(r<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:yn[r-40]}});else if(r===48){const o=Vl(e);o&&t.push({type:"setBackgroundColor",value:o})}else r===49?t.push({type:"resetBackgroundColor"}):r===53?t.push({type:"setDecoration",value:"overline"}):r===55?t.push({type:"resetDecoration",value:"overline"}):r>=90&&r<=97?t.push({type:"setForegroundColor",value:{type:"named",name:yn[r-90+8]}}):r>=100&&r<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:yn[r-100+8]}})}return t}function m0(){let e=null,t=null,n=new Set;return{parse(r){const o=[];let i=0;do{const s=h0(r,i),a=s.sequence?r.substring(i,s.startPosition):r.substring(i);if(a.length>0&&o.push({value:a,foreground:e,background:t,decorations:new Set(n)}),s.sequence){const l=p0(s.sequence);for(const u of l)u.type==="resetAll"?(e=null,t=null,n.clear()):u.type==="resetForegroundColor"?e=null:u.type==="resetBackgroundColor"?t=null:u.type==="resetDecoration"&&n.delete(u.value);for(const u of l)u.type==="setForegroundColor"?e=u.value:u.type==="setBackgroundColor"?t=u.value:u.type==="setDecoration"&&n.add(u.value)}i=s.position}while(i<r.length);return o}}}var g0={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};function v0(e=g0){function t(a){return e[a]}function n(a){return`#${a.map(l=>Math.max(0,Math.min(l,255)).toString(16).padStart(2,"0")).join("")}`}let r;function o(){if(r)return r;r=[];for(let u=0;u<yn.length;u++)r.push(t(yn[u]));let a=[0,95,135,175,215,255];for(let u=0;u<6;u++)for(let c=0;c<6;c++)for(let d=0;d<6;d++)r.push(n([a[u],a[c],a[d]]));let l=8;for(let u=0;u<24;u++,l+=10)r.push(n([l,l,l]));return r}function i(a){return o()[a]}function s(a){switch(a.type){case"named":return t(a.name);case"rgb":return n(a.rgb);case"table":return i(a.index)}}return{value:s}}const y0={black:"#000000",red:"#cd3131",green:"#0DBC79",yellow:"#E5E510",blue:"#2472C8",magenta:"#BC3FBC",cyan:"#11A8CD",white:"#E5E5E5",brightBlack:"#666666",brightRed:"#F14C4C",brightGreen:"#23D18B",brightYellow:"#F5F543",brightBlue:"#3B8EEA",brightMagenta:"#D670D6",brightCyan:"#29B8DB",brightWhite:"#FFFFFF"};function _0(e,t,n){const r=Wo(e,n),o=bi(t),i=Object.fromEntries(yn.map(l=>{const u=`terminal.ansi${l[0].toUpperCase()}${l.substring(1)}`,c=e.colors?.[u];return[l,c||y0[l]]})),s=v0(i),a=m0();return o.map(l=>a.parse(l[0]).map(u=>{let c,d;u.decorations.has("reverse")?(c=u.background?s.value(u.background):e.bg,d=u.foreground?s.value(u.foreground):e.fg):(c=u.foreground?s.value(u.foreground):e.fg,d=u.background?s.value(u.background):void 0),c=sn(c,r),d=sn(d,r),u.decorations.has("dim")&&(c=b0(c));let f=Je.None;return u.decorations.has("bold")&&(f|=Je.Bold),u.decorations.has("italic")&&(f|=Je.Italic),u.decorations.has("underline")&&(f|=Je.Underline),u.decorations.has("strikethrough")&&(f|=Je.Strikethrough),{content:u.value,offset:l[1],color:c,bgColor:d,fontStyle:f}}))}function b0(e){const t=e.match(/#([0-9a-f]{3,8})/i);if(t){const r=t[1];if(r.length===8){const o=Math.round(Number.parseInt(r.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${r.slice(0,6)}${o}`}else{if(r.length===6)return`#${r}80`;if(r.length===4){const o=r[0],i=r[1],s=r[2],a=r[3],l=Math.round(Number.parseInt(`${a}${a}`,16)/2).toString(16).padStart(2,"0");return`#${o}${o}${i}${i}${s}${s}${l}`}else if(r.length===3){const o=r[0],i=r[1],s=r[2];return`#${o}${o}${i}${i}${s}${s}80`}}}const n=e.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:e}function Ba(e,t,n={}){const{theme:r=e.getLoadedThemes()[0]}=n,o=e.resolveLangAlias(n.lang||"text");if(Da(o)||$a(r))return bi(t).map(l=>[{content:l[0],offset:l[1]}]);const{theme:i,colorMap:s}=e.setTheme(r);if(o==="ansi")return _0(i,t,n);const a=e.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==a.name)throw new Fe(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${a.name}"`);if(!n.grammarState.themes.includes(i.name))throw new Fe(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return E0(t,a,i,s,n)}function w0(...e){if(e.length===2)return Dr(e[1]);const[t,n,r={}]=e,{lang:o="text",theme:i=t.getLoadedThemes()[0]}=r;if(Da(o)||$a(i))throw new Fe("Plain language does not have grammar state");if(o==="ansi")throw new Fe("ANSI language does not have grammar state");const{theme:s,colorMap:a}=t.setTheme(i),l=t.getLanguage(o);return new hr(Fa(n,l,s,a,r).stateStack,l.name,s.name)}function E0(e,t,n,r,o){const i=Fa(e,t,n,r,o),s=new hr(i.stateStack,t.name,n.name);return wi(i.tokens,s),i.tokens}function Fa(e,t,n,r,o){const i=Wo(n,o),{tokenizeMaxLineLength:s=0,tokenizeTimeLimit:a=500}=o,l=bi(e);let u=o.grammarState?l0(o.grammarState,n.name)??Ds:o.grammarContextCode!=null?Fa(o.grammarContextCode,t,n,r,{...o,grammarState:void 0,grammarContextCode:void 0}).stateStack:Ds,c=[];const d=[];for(let f=0,h=l.length;f<h;f++){const[p,b]=l[f];if(p===""){c=[],d.push([]);continue}if(s>0&&p.length>=s){c=[],d.push([{content:p,offset:b,color:"",fontStyle:0}]);continue}let _,y,g;o.includeExplanation&&(_=t.tokenizeLine(p,u,a),y=_.tokens,g=0);const m=t.tokenizeLine2(p,u,a),v=m.tokens.length/2;for(let x=0;x<v;x++){const L=m.tokens[2*x],P=x+1<v?m.tokens[2*x+2]:p.length;if(L===P)continue;const O=m.tokens[2*x+1],W=sn(r[er.getForeground(O)],i),N=er.getFontStyle(O),M={content:p.substring(L,P),offset:b+L,color:W,fontStyle:N};if(o.includeExplanation){const C=[];if(o.includeExplanation!=="scopeName")for(const E of n.settings){let $;switch(typeof E.scope){case"string":$=E.scope.split(/,/).map(A=>A.trim());break;case"object":$=E.scope;break;default:continue}C.push({settings:E,selectors:$.map(A=>A.split(/ /))})}M.explanation=[];let F=0;for(;L+F<P;){const E=y[g],$=p.substring(E.startIndex,E.endIndex);F+=$.length,M.explanation.push({content:$,scopes:o.includeExplanation==="scopeName"?x0(E.scopes):k0(C,E.scopes)}),g+=1}}c.push(M)}d.push(c),c=[],u=m.ruleStack}return{tokens:d,stateStack:u}}function x0(e){return e.map(t=>({scopeName:t}))}function k0(e,t){const n=[];for(let r=0,o=t.length;r<o;r++){const i=t[r];n[r]={scopeName:i,themeMatches:S0(e,i,t.slice(0,r))}}return n}function Bl(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function C0(e,t,n){if(!Bl(e[e.length-1],t))return!1;let r=e.length-2,o=n.length-1;for(;r>=0&&o>=0;)Bl(e[r],n[o])&&(r-=1),o-=1;return r===-1}function S0(e,t,n){const r=[];for(const{selectors:o,settings:i}of e)for(const s of o)if(C0(s,t,n)){r.push(i);break}return r}function Ed(e,t,n){const r=Object.entries(n.themes).filter(l=>l[1]).map(l=>({color:l[0],theme:l[1]})),o=r.map(l=>{const u=Ba(e,t,{...n,theme:l.theme}),c=Dr(u),d=typeof l.theme=="string"?l.theme:l.theme.name;return{tokens:u,state:c,theme:d}}),i=T0(...o.map(l=>l.tokens)),s=i[0].map((l,u)=>l.map((c,d)=>{const f={content:c.content,variants:{},offset:c.offset};return"includeExplanation"in n&&n.includeExplanation&&(f.explanation=c.explanation),i.forEach((h,p)=>{const{content:b,explanation:_,offset:y,...g}=h[u][d];f.variants[r[p].color]=g}),f})),a=o[0].state?new hr(Object.fromEntries(o.map(l=>[l.theme,l.state?.getInternalStack(l.theme)])),o[0].state.lang):void 0;return a&&wi(s,a),s}function T0(...e){const t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){const o=e.map(l=>l[r]),i=t.map(()=>[]);t.forEach((l,u)=>l.push(i[u]));const s=o.map(()=>0),a=o.map(l=>l[0]);for(;a.every(l=>l);){const l=Math.min(...a.map(u=>u.content.length));for(let u=0;u<n;u++){const c=a[u];c.content.length===l?(i[u].push(c),s[u]+=1,a[u]=o[u][s[u]]):(i[u].push({...c,content:c.content.slice(0,l)}),a[u]={...c,content:c.content.slice(l),offset:c.offset+l})}}}return t}function Xo(e,t,n){let r,o,i,s,a,l;if("themes"in n){const{defaultColor:u="light",cssVariablePrefix:c="--shiki-",colorsRendering:d="css-vars"}=n,f=Object.entries(n.themes).filter(y=>y[1]).map(y=>({color:y[0],theme:y[1]})).sort((y,g)=>y.color===u?-1:g.color===u?1:0);if(f.length===0)throw new Fe("`themes` option must not be empty");const h=Ed(e,t,n);if(l=Dr(h),u&&Va!==u&&!f.find(y=>y.color===u))throw new Fe(`\`themes\` option must contain the defaultColor key \`${u}\``);const p=f.map(y=>e.getTheme(y.theme)),b=f.map(y=>y.color);i=h.map(y=>y.map(g=>s0(g,b,c,u,d))),l&&wi(i,l);const _=f.map(y=>Wo(y.theme,n));o=Fl(f,p,_,c,u,"fg",d),r=Fl(f,p,_,c,u,"bg",d),s=`shiki-themes ${p.map(y=>y.name).join(" ")}`,a=u?void 0:[o,r].join(";")}else if("theme"in n){const u=Wo(n.theme,n);i=Ba(e,t,n);const c=e.getTheme(n.theme);r=sn(c.bg,u),o=sn(c.fg,u),s=c.name,l=Dr(i)}else throw new Fe("Invalid options, either `theme` or `themes` must be provided");return{tokens:i,fg:o,bg:r,themeName:s,rootStyle:a,grammarState:l}}function Fl(e,t,n,r,o,i,s){return e.map((a,l)=>{const u=sn(t[l][i],n[l])||"inherit",c=`${r+a.color}${i==="bg"?"-bg":""}:${u}`;if(l===0&&o){if(o===Va&&e.length>1){const d=e.findIndex(b=>b.color==="light"),f=e.findIndex(b=>b.color==="dark");if(d===-1||f===-1)throw new Fe('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const h=sn(t[d][i],n[d])||"inherit",p=sn(t[f][i],n[f])||"inherit";return`light-dark(${h}, ${p});${c}`}return u}return s==="css-vars"?c:null}).filter(a=>!!a).join(";")}function Ko(e,t,n,r={meta:{},options:n,codeToHast:(o,i)=>Ko(e,o,i),codeToTokens:(o,i)=>Xo(e,o,i)}){let o=t;for(const p of Yo(n))o=p.preprocess?.call(r,o,n)||o;let{tokens:i,fg:s,bg:a,themeName:l,rootStyle:u,grammarState:c}=Xo(e,o,n);const{mergeWhitespaces:d=!0,mergeSameStyleTokens:f=!1}=n;d===!0?i=L0(i):d==="never"&&(i=I0(i)),f&&(i=P0(i));const h={...r,get source(){return o}};for(const p of Yo(n))i=p.tokens?.call(h,i)||i;return A0(i,{...n,fg:s,bg:a,themeName:l,rootStyle:n.rootStyle===!1?!1:n.rootStyle??u},h,c)}function A0(e,t,n,r=Dr(e)){const o=Yo(t),i=[],s={type:"root",children:[]},{structure:a="classic",tabindex:l="0"}=t,u={class:`shiki ${t.themeName||""}`};t.rootStyle!==!1&&(t.rootStyle!=null?u.style=t.rootStyle:u.style=`background-color:${t.bg};color:${t.fg}`),l!==!1&&l!=null&&(u.tabindex=l.toString());for(const[b,_]of Object.entries(t.meta||{}))b.startsWith("_")||(u[b]=_);let c={type:"element",tagName:"pre",properties:u,children:[],data:t.data},d={type:"element",tagName:"code",properties:{},children:i};const f=[],h={...n,structure:a,addClassToHast:_d,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return s},get pre(){return c},get code(){return d},get lines(){return f}};if(e.forEach((b,_)=>{_&&(a==="inline"?s.children.push({type:"element",tagName:"br",properties:{},children:[]}):a==="classic"&&i.push({type:"text",value:`
13
+ `}));let y={type:"element",tagName:"span",properties:{class:"line"},children:[]},g=0;for(const m of b){let v={type:"element",tagName:"span",properties:{...m.htmlAttrs},children:[{type:"text",value:m.content}]};const x=zs(m.htmlStyle||qo(m));x&&(v.properties.style=x);for(const L of o)v=L?.span?.call(h,v,_+1,g,y,m)||v;a==="inline"?s.children.push(v):a==="classic"&&y.children.push(v),g+=m.content.length}if(a==="classic"){for(const m of o)y=m?.line?.call(h,y,_+1)||y;f.push(y),i.push(y)}else a==="inline"&&f.push(y)}),a==="classic"){for(const b of o)d=b?.code?.call(h,d)||d;c.children.push(d);for(const b of o)c=b?.pre?.call(h,c)||c;s.children.push(c)}else if(a==="inline"){const b=[];let _={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const m of s.children)m.type==="element"&&m.tagName==="br"?(b.push(_),_={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(m.type==="element"||m.type==="text")&&_.children.push(m);b.push(_);let g={type:"element",tagName:"code",properties:{},children:b};for(const m of o)g=m?.code?.call(h,g)||g;s.children=[];for(let m=0;m<g.children.length;m++){m>0&&s.children.push({type:"element",tagName:"br",properties:{},children:[]});const v=g.children[m];v.type==="element"&&s.children.push(...v.children)}}let p=s;for(const b of o)p=b?.root?.call(h,p)||p;return r&&wi(p,r),p}function L0(e){return e.map(t=>{const n=[];let r="",o;return t.forEach((i,s)=>{const l=!(i.fontStyle&&(i.fontStyle&Je.Underline||i.fontStyle&Je.Strikethrough));l&&i.content.match(/^\s+$/)&&t[s+1]?(o===void 0&&(o=i.offset),r+=i.content):r?(l?n.push({...i,offset:o,content:r+i.content}):n.push({content:r,offset:o},i),o=void 0,r=""):n.push(i)}),n})}function I0(e){return e.map(t=>t.flatMap(n=>{if(n.content.match(/^\s+$/))return n;const r=n.content.match(/^(\s*)(.*?)(\s*)$/);if(!r)return n;const[,o,i,s]=r;if(!o&&!s)return n;const a=[{...n,offset:n.offset+o.length,content:i}];return o&&a.unshift({content:o,offset:n.offset}),s&&a.push({content:s,offset:n.offset+o.length+i.length}),a}))}function P0(e){return e.map(t=>{const n=[];for(const r of t){if(n.length===0){n.push({...r});continue}const o=n[n.length-1],i=zs(o.htmlStyle||qo(o)),s=zs(r.htmlStyle||qo(r)),a=o.fontStyle&&(o.fontStyle&Je.Underline||o.fontStyle&Je.Strikethrough),l=r.fontStyle&&(r.fontStyle&Je.Underline||r.fontStyle&Je.Strikethrough);!a&&!l&&i===s?o.content+=r.content:n.push({...r})}return n})}const N0=qt;function R0(e,t,n){const r={meta:{},options:n,codeToHast:(i,s)=>Ko(e,i,s),codeToTokens:(i,s)=>Xo(e,i,s)};let o=N0(Ko(e,t,n,r));for(const i of Yo(n))o=i.postprocess?.call(r,o,n)||o;return o}const zl={light:"#333333",dark:"#bbbbbb"},Hl={light:"#fffffe",dark:"#1e1e1e"},Gl="__shiki_resolved";function Ei(e){if(e?.[Gl])return e;const t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||="dark",t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:r}=t;if(!n||!r){const a=t.settings?t.settings.find(l=>!l.name&&!l.scope):void 0;a?.settings?.foreground&&(r=a.settings.foreground),a?.settings?.background&&(n=a.settings.background),!r&&t?.colors?.["editor.foreground"]&&(r=t.colors["editor.foreground"]),!n&&t?.colors?.["editor.background"]&&(n=t.colors["editor.background"]),r||(r=t.type==="light"?zl.light:zl.dark),n||(n=t.type==="light"?Hl.light:Hl.dark),t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let o=0;const i=new Map;function s(a){if(i.has(a))return i.get(a);o+=1;const l=`#${o.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${l}`]?s(a):(i.set(a,l),l)}t.settings=t.settings.map(a=>{const l=a.settings?.foreground&&!a.settings.foreground.startsWith("#"),u=a.settings?.background&&!a.settings.background.startsWith("#");if(!l&&!u)return a;const c={...a,settings:{...a.settings}};if(l){const d=s(a.settings.foreground);t.colorReplacements[d]=a.settings.foreground,c.settings.foreground=d}if(u){const d=s(a.settings.background);t.colorReplacements[d]=a.settings.background,c.settings.background=d}return c});for(const a of Object.keys(t.colors||{}))if((a==="editor.foreground"||a==="editor.background"||a.startsWith("terminal.ansi"))&&!t.colors[a]?.startsWith("#")){const l=s(t.colors[a]);t.colorReplacements[l]=t.colors[a],t.colors[a]=l}return Object.defineProperty(t,Gl,{enumerable:!1,writable:!1,value:!0}),t}async function xd(e){return Array.from(new Set((await Promise.all(e.filter(t=>!vd(t)).map(async t=>await gd(t).then(n=>Array.isArray(n)?n:[n])))).flat()))}async function kd(e){return(await Promise.all(e.map(async n=>yd(n)?null:Ei(await gd(n))))).filter(n=>!!n)}let M0=3;function O0(e,t=3){t>M0||console.trace(`[SHIKI DEPRECATE]: ${e}`)}let jn=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function Cd(e,t){if(!t)return e;if(t[e]){const n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new jn(`Circular alias \`${Array.from(n).join(" -> ")} -> ${e}\``);n.add(e)}}return e}class D0 extends Vv{constructor(t,n,r,o={}){super(t),this._resolver=t,this._themes=n,this._langs=r,this._alias=o,this._themes.map(i=>this.loadTheme(i)),this.loadLanguages(this._langs)}_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;getTheme(t){return typeof t=="string"?this._resolvedThemes.get(t):this.loadTheme(t)}loadTheme(t){const n=Ei(t);return n.name&&(this._resolvedThemes.set(n.name,n),this._loadedThemesCache=null),n}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(t){let n=this._textmateThemeCache.get(t);n||(n=zo.createFromRawTheme(t),this._textmateThemeCache.set(t,n)),this._syncRegistry.setTheme(n)}getGrammar(t){return t=Cd(t,this._alias),this._resolvedGrammars.get(t)}loadLanguage(t){if(this.getGrammar(t.name))return;const n=new Set([...this._langMap.values()].filter(i=>i.embeddedLangsLazy?.includes(t.name)));this._resolver.addLanguage(t);const r={balancedBracketSelectors:t.balancedBracketSelectors||["*"],unbalancedBracketSelectors:t.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(t.scopeName,t);const o=this.loadGrammarWithConfiguration(t.scopeName,1,r);if(o.name=t.name,this._resolvedGrammars.set(t.name,o),t.aliases&&t.aliases.forEach(i=>{this._alias[i]=t.name}),this._loadedLanguagesCache=null,n.size)for(const i of n)this._resolvedGrammars.delete(i.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(i.scopeName),this._syncRegistry?._grammars?.delete(i.scopeName),this.loadLanguage(this._langMap.get(i.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(t){for(const o of t)this.resolveEmbeddedLanguages(o);const n=Array.from(this._langGraph.entries()),r=n.filter(([o,i])=>!i);if(r.length){const o=n.filter(([i,s])=>s?(s.embeddedLanguages||s.embeddedLangs)?.some(l=>r.map(([u])=>u).includes(l)):!1).filter(i=>!r.includes(i));throw new jn(`Missing languages ${r.map(([i])=>`\`${i}\``).join(", ")}, required by ${o.map(([i])=>`\`${i}\``).join(", ")}`)}for(const[o,i]of n)this._resolver.addLanguage(i);for(const[o,i]of n)this.loadLanguage(i)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(t){this._langMap.set(t.name,t),this._langGraph.set(t.name,t);const n=t.embeddedLanguages??t.embeddedLangs;if(n)for(const r of n)this._langGraph.set(r,this._langMap.get(r))}}class $0{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(t,n){this._onigLib={createOnigScanner:r=>t.createScanner(r),createOnigString:r=>t.createString(r)},n.forEach(r=>this.addLanguage(r))}get onigLib(){return this._onigLib}getLangRegistration(t){return this._langs.get(t)}loadGrammar(t){return this._scopeToLang.get(t)}addLanguage(t){this._langs.set(t.name,t),t.aliases&&t.aliases.forEach(n=>{this._langs.set(n,t)}),this._scopeToLang.set(t.scopeName,t),t.injectTo&&t.injectTo.forEach(n=>{this._injections.get(n)||this._injections.set(n,[]),this._injections.get(n).push(t.scopeName)})}getInjections(t){const n=t.split(".");let r=[];for(let o=1;o<=n.length;o++){const i=n.slice(0,o).join(".");r=[...r,...this._injections.get(i)||[]]}return r}}let gr=0;function V0(e){gr+=1,e.warnings!==!1&&gr>=10&&gr%10===0&&console.warn(`[Shiki] ${gr} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new jn("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(Ei),o=new $0(e.engine,n),i=new D0(o,r,n,e.langAlias);let s;function a(m){return Cd(m,e.langAlias)}function l(m){y();const v=i.getGrammar(typeof m=="string"?m:m.name);if(!v)throw new jn(`Language \`${m}\` not found, you may need to load it first`);return v}function u(m){if(m==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};y();const v=i.getTheme(m);if(!v)throw new jn(`Theme \`${m}\` not found, you may need to load it first`);return v}function c(m){y();const v=u(m);s!==m&&(i.setTheme(v),s=m);const x=i.getColorMap();return{theme:v,colorMap:x}}function d(){return y(),i.getLoadedThemes()}function f(){return y(),i.getLoadedLanguages()}function h(...m){y(),i.loadLanguages(m.flat(1))}async function p(...m){return h(await xd(m))}function b(...m){y();for(const v of m.flat(1))i.loadTheme(v)}async function _(...m){return y(),b(await kd(m))}function y(){if(t)throw new jn("Shiki instance has been disposed")}function g(){t||(t=!0,i.dispose(),gr-=1)}return{setTheme:c,getTheme:u,getLanguage:l,getLoadedThemes:d,getLoadedLanguages:f,resolveLangAlias:a,loadLanguage:p,loadLanguageSync:h,loadTheme:_,loadThemeSync:b,dispose:g,[Symbol.dispose]:g}}async function B0(e){e.engine||O0("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,n,r]=await Promise.all([kd(e.themes||[]),xd(e.langs||[]),e.engine]);return V0({...e,themes:t,langs:n,engine:r})}async function F0(e){const t=await B0(e);return{getLastGrammarState:(...n)=>w0(t,...n),codeToTokensBase:(n,r)=>Ba(t,n,r),codeToTokensWithThemes:(n,r)=>Ed(t,n,r),codeToTokens:(n,r)=>Xo(t,n,r),codeToHast:(n,r)=>Ko(t,n,r),codeToHtml:(n,r)=>R0(t,n,r),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function z0(e){const t=e.langs,n=e.themes,r=e.engine;async function o(i){function s(d){if(typeof d=="string"){if(d=i.langAlias?.[d]||d,vd(d))return[];const f=t[d];if(!f)throw new Fe(`Language \`${d}\` is not included in this bundle. You may want to load it from external source.`);return f}return d}function a(d){if(yd(d))return"none";if(typeof d=="string"){const f=n[d];if(!f)throw new Fe(`Theme \`${d}\` is not included in this bundle. You may want to load it from external source.`);return f}return d}const l=(i.themes??[]).map(d=>a(d)),u=(i.langs??[]).map(d=>s(d)),c=await F0({engine:i.engine??r(),...i,themes:l,langs:u});return{...c,loadLanguage(...d){return c.loadLanguage(...d.map(s))},loadTheme(...d){return c.loadTheme(...d.map(a))},getBundledLanguages(){return t},getBundledThemes(){return n}}}return o}function H0(e){let t;async function n(r={}){if(t){const o=await t;return await Promise.all([o.loadTheme(...r.themes||[]),o.loadLanguage(...r.langs||[])]),o}else{t=e({...r,themes:[],langs:[]});const o=await t;return await Promise.all([o.loadTheme(...r.themes||[]),o.loadLanguage(...r.langs||[])]),o}}return n}function G0(e,t){const n=H0(e);async function r(o,i){const s=await n({langs:[i.lang],themes:"theme"in i?[i.theme]:Object.values(i.themes)}),a=await t?.guessEmbeddedLanguages?.(o,i.lang,s);return a&&await s.loadLanguage(...a),s}return{getSingletonHighlighter(o){return n(o)},async codeToHtml(o,i){return(await r(o,i)).codeToHtml(o,i)},async codeToHast(o,i){return(await r(o,i)).codeToHast(o,i)},async codeToTokens(o,i){return(await r(o,i)).codeToTokens(o,i)},async codeToTokensBase(o,i){return(await r(o,i)).codeToTokensBase(o,i)},async codeToTokensWithThemes(o,i){return(await r(o,i)).codeToTokensWithThemes(o,i)},async getLastGrammarState(o,i){return(await n({langs:[i.lang],themes:[i.theme]})).getLastGrammarState(o,i)}}}const Sd=[{id:"abap",name:"ABAP",import:(()=>T(()=>import("./BdImnpbu.js"),[],import.meta.url))},{id:"actionscript-3",name:"ActionScript",import:(()=>T(()=>import("./CoDkCxhg.js"),[],import.meta.url))},{id:"ada",name:"Ada",import:(()=>T(()=>import("./bCR0ucgS.js"),[],import.meta.url))},{id:"angular-html",name:"Angular HTML",import:(()=>T(()=>import("./DxNHbxmM.js").then(e=>e.f),__vite__mapDeps([0,1,2,3]),import.meta.url))},{id:"angular-ts",name:"Angular TypeScript",import:(()=>T(()=>import("./Cl0AqbOI.js"),__vite__mapDeps([4,0,1,2,3,5]),import.meta.url))},{id:"apache",name:"Apache Conf",import:(()=>T(()=>import("./Pmp26Uib.js"),[],import.meta.url))},{id:"apex",name:"Apex",import:(()=>T(()=>import("./D8_7TLub.js"),[],import.meta.url))},{id:"apl",name:"APL",import:(()=>T(()=>import("./Cn7AkR1O.js"),__vite__mapDeps([6,1,2,3,7,8,9]),import.meta.url))},{id:"applescript",name:"AppleScript",import:(()=>T(()=>import("./Co6uUVPk.js"),[],import.meta.url))},{id:"ara",name:"Ara",import:(()=>T(()=>import("./BRHolxvo.js"),[],import.meta.url))},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:(()=>T(()=>import("./Dv7Oe6Be.js"),[],import.meta.url))},{id:"asm",name:"Assembly",import:(()=>T(()=>import("./D_Q5rh1f.js"),[],import.meta.url))},{id:"astro",name:"Astro",import:(()=>T(()=>import("./DxSwrfjg.js"),__vite__mapDeps([10,9,2,11,3,12,13]),import.meta.url))},{id:"awk",name:"AWK",import:(()=>T(()=>import("./DMzUqQB5.js"),[],import.meta.url))},{id:"ballerina",name:"Ballerina",import:(()=>T(()=>import("./BFfxhgS-.js"),[],import.meta.url))},{id:"bat",name:"Batch File",aliases:["batch"],import:(()=>T(()=>import("./BkioyH1T.js"),[],import.meta.url))},{id:"beancount",name:"Beancount",import:(()=>T(()=>import("./k_qm7-4y.js"),[],import.meta.url))},{id:"berry",name:"Berry",aliases:["be"],import:(()=>T(()=>import("./uYugtg8r.js"),[],import.meta.url))},{id:"bibtex",name:"BibTeX",import:(()=>T(()=>import("./CHM0blh-.js"),[],import.meta.url))},{id:"bicep",name:"Bicep",import:(()=>T(()=>import("./Bmn6On1c.js"),[],import.meta.url))},{id:"blade",name:"Blade",import:(()=>T(()=>import("./5X7smno1.js"),__vite__mapDeps([14,15,1,2,3,7,8,16,9]),import.meta.url))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:(()=>T(()=>import("./CquLrc37.js"),__vite__mapDeps([17,18]),import.meta.url))},{id:"c",name:"C",import:(()=>T(()=>import("./BIGW1oBm.js"),[],import.meta.url))},{id:"c3",name:"C3",import:(()=>T(()=>import("./VCDPK7BO.js"),[],import.meta.url))},{id:"cadence",name:"Cadence",aliases:["cdc"],import:(()=>T(()=>import("./Bv_4Rxtq.js"),[],import.meta.url))},{id:"cairo",name:"Cairo",import:(()=>T(()=>import("./CO1LY3CK.js"),__vite__mapDeps([19,20]),import.meta.url))},{id:"clarity",name:"Clarity",import:(()=>T(()=>import("./D53aC0YG.js"),[],import.meta.url))},{id:"clojure",name:"Clojure",aliases:["clj"],import:(()=>T(()=>import("./P80f7IUj.js"),[],import.meta.url))},{id:"cmake",name:"CMake",import:(()=>T(()=>import("./D1j8_8rp.js"),[],import.meta.url))},{id:"cobol",name:"COBOL",import:(()=>T(()=>import("./BYV0-3_D.js"),__vite__mapDeps([21,1,2,3,8]),import.meta.url))},{id:"codeowners",name:"CODEOWNERS",import:(()=>T(()=>import("./Bp6g37R7.js"),[],import.meta.url))},{id:"codeql",name:"CodeQL",aliases:["ql"],import:(()=>T(()=>import("./DsOJ9woJ.js"),[],import.meta.url))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:(()=>T(()=>import("./CxbxFI8M.js"),__vite__mapDeps([22,2]),import.meta.url))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:(()=>T(()=>import("./Cg-RD9OK.js"),[],import.meta.url))},{id:"coq",name:"Coq",import:(()=>T(()=>import("./DkFqJrB1.js"),[],import.meta.url))},{id:"cpp",name:"C++",aliases:["c++"],import:(()=>T(()=>import("./Bp3cYrEr.js"),__vite__mapDeps([23,24,25,26,16]),import.meta.url))},{id:"crystal",name:"Crystal",import:(()=>T(()=>import("./fKv21gyL.js"),__vite__mapDeps([27,1,2,3,16,26,28]),import.meta.url))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:(()=>T(()=>import("./COcwbKMJ.js"),[],import.meta.url))},{id:"css",name:"CSS",import:(()=>T(()=>import("./DPfMkruS.js"),[],import.meta.url))},{id:"csv",name:"CSV",import:(()=>T(()=>import("./fuZLfV_i.js"),[],import.meta.url))},{id:"cue",name:"CUE",import:(()=>T(()=>import("./D82EKSYY.js"),[],import.meta.url))},{id:"cypher",name:"Cypher",aliases:["cql"],import:(()=>T(()=>import("./COkxafJQ.js"),[],import.meta.url))},{id:"d",name:"D",import:(()=>T(()=>import("./85-TOEBH.js"),[],import.meta.url))},{id:"dart",name:"Dart",import:(()=>T(()=>import("./CF10PKvl.js"),[],import.meta.url))},{id:"dax",name:"DAX",import:(()=>T(()=>import("./CEL-wOlO.js"),[],import.meta.url))},{id:"desktop",name:"Desktop",import:(()=>T(()=>import("./BmXAJ9_W.js"),[],import.meta.url))},{id:"diff",name:"Diff",import:(()=>T(()=>import("./D97Zzqfu.js"),[],import.meta.url))},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:(()=>T(()=>import("./BcOcwvcX.js"),[],import.meta.url))},{id:"dotenv",name:"dotEnv",import:(()=>T(()=>import("./Da5cRb03.js"),[],import.meta.url))},{id:"dream-maker",name:"Dream Maker",import:(()=>T(()=>import("./BtqSS_iP.js"),[],import.meta.url))},{id:"edge",name:"Edge",import:(()=>T(()=>import("./DZu-aV2c.js"),__vite__mapDeps([29,11,1,2,3,15]),import.meta.url))},{id:"elixir",name:"Elixir",import:(()=>T(()=>import("./CpOuai2O.js"),__vite__mapDeps([30,1,2,3]),import.meta.url))},{id:"elm",name:"Elm",import:(()=>T(()=>import("./CeZK1NFH.js"),__vite__mapDeps([31,25,26]),import.meta.url))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:(()=>T(()=>import("./C9XAeP06.js"),[],import.meta.url))},{id:"erb",name:"ERB",import:(()=>T(()=>import("./CGscLIrv.js"),__vite__mapDeps([32,1,2,3,33,34,7,8,16,35,11,36,13,23,24,25,26,28,37,38]),import.meta.url))},{id:"erlang",name:"Erlang",aliases:["erl"],import:(()=>T(()=>import("./CuPHTKiy.js"),__vite__mapDeps([39,40]),import.meta.url))},{id:"fennel",name:"Fennel",import:(()=>T(()=>import("./BYunw83y.js"),[],import.meta.url))},{id:"fish",name:"Fish",import:(()=>T(()=>import("./BvzEVeQv.js"),[],import.meta.url))},{id:"fluent",name:"Fluent",aliases:["ftl"],import:(()=>T(()=>import("./C4IJs8-o.js"),[],import.meta.url))},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:(()=>T(()=>import("./B7c-h3xW.js"),__vite__mapDeps([41,42]),import.meta.url))},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:(()=>T(()=>import("./BxgE0vQu.js"),[],import.meta.url))},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:(()=>T(()=>import("./BTifaqeh.js"),__vite__mapDeps([43,40]),import.meta.url))},{id:"gdresource",name:"GDResource",aliases:["tscn","tres"],import:(()=>T(()=>import("./CenWIFCC.js"),__vite__mapDeps([44,45,46]),import.meta.url))},{id:"gdscript",name:"GDScript",aliases:["gd"],import:(()=>T(()=>import("./C5YyOfLZ.js"),[],import.meta.url))},{id:"gdshader",name:"GDShader",import:(()=>T(()=>import("./DkwncUOv.js"),[],import.meta.url))},{id:"genie",name:"Genie",import:(()=>T(()=>import("./D0YGMca9.js"),[],import.meta.url))},{id:"gherkin",name:"Gherkin",import:(()=>T(()=>import("./DyxjwDmM.js"),[],import.meta.url))},{id:"git-commit",name:"Git Commit Message",import:(()=>T(()=>import("./CxGSJlkm.js"),__vite__mapDeps([47,48]),import.meta.url))},{id:"git-rebase",name:"Git Rebase Message",import:(()=>T(()=>import("./CSXwinHm.js"),__vite__mapDeps([49,28]),import.meta.url))},{id:"gleam",name:"Gleam",import:(()=>T(()=>import("./BspZqrRM.js"),[],import.meta.url))},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:(()=>T(()=>import("./YqXBG_HV.js"),__vite__mapDeps([50,2,11,3,1]),import.meta.url))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:(()=>T(()=>import("./BR5kRUq4.js"),__vite__mapDeps([51,11,3,2,1]),import.meta.url))},{id:"glsl",name:"GLSL",import:(()=>T(()=>import("./DZxFcAj9.js"),__vite__mapDeps([25,26]),import.meta.url))},{id:"gn",name:"GN",import:(()=>T(()=>import("./n2N0HUVH.js"),[],import.meta.url))},{id:"gnuplot",name:"Gnuplot",import:(()=>T(()=>import("./DdkO51Og.js"),[],import.meta.url))},{id:"go",name:"Go",import:(()=>T(()=>import("./CxLEBnE3.js"),[],import.meta.url))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:(()=>T(()=>import("./C9oPPf7i.js"),__vite__mapDeps([35,2,11,36,13]),import.meta.url))},{id:"groovy",name:"Groovy",import:(()=>T(()=>import("./gcz8RCvz.js"),[],import.meta.url))},{id:"hack",name:"Hack",import:(()=>T(()=>import("./CLZrNe3w.js"),__vite__mapDeps([52,1,2,3,16]),import.meta.url))},{id:"haml",name:"Ruby Haml",import:(()=>T(()=>import("./CmIQRyeF.js"),__vite__mapDeps([34,2,3]),import.meta.url))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:(()=>T(()=>import("./m17aaUwq.js"),__vite__mapDeps([53,1,2,3,38]),import.meta.url))},{id:"haskell",name:"Haskell",aliases:["hs"],import:(()=>T(()=>import("./Df6bDoY_.js"),[],import.meta.url))},{id:"haxe",name:"Haxe",import:(()=>T(()=>import("./CzTSHFRz.js"),[],import.meta.url))},{id:"hcl",name:"HashiCorp HCL",import:(()=>T(()=>import("./BWvSN4gD.js"),[],import.meta.url))},{id:"hjson",name:"Hjson",import:(()=>T(()=>import("./D5-asLiD.js"),[],import.meta.url))},{id:"hlsl",name:"HLSL",import:(()=>T(()=>import("./D3lLCCz7.js"),[],import.meta.url))},{id:"html",name:"HTML",import:(()=>T(()=>import("./CnnebwVN.js"),__vite__mapDeps([1,2,3]),import.meta.url))},{id:"html-derivative",name:"HTML (Derivative)",import:(()=>T(()=>import("./DGP4VlC8.js"),__vite__mapDeps([15,1,2,3]),import.meta.url))},{id:"http",name:"HTTP",import:(()=>T(()=>import("./CufHLc7y.js"),__vite__mapDeps([54,28,9,7,8,35,2,11,36,13]),import.meta.url))},{id:"hurl",name:"Hurl",import:(()=>T(()=>import("./CYsAdtH9.js"),__vite__mapDeps([55,35,2,11,36,13,7,8,56]),import.meta.url))},{id:"hxml",name:"HXML",import:(()=>T(()=>import("./DWrx1Km3.js"),__vite__mapDeps([57,58]),import.meta.url))},{id:"hy",name:"Hy",import:(()=>T(()=>import("./DFXneXwc.js"),[],import.meta.url))},{id:"imba",name:"Imba",import:(()=>T(()=>import("./DGztddWO.js"),[],import.meta.url))},{id:"ini",name:"INI",aliases:["properties"],import:(()=>T(()=>import("./BEwlwnbL.js"),[],import.meta.url))},{id:"java",name:"Java",import:(()=>T(()=>import("./CylS5w8V.js"),[],import.meta.url))},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:(()=>T(()=>import("./wDzz0qaB.js"),[],import.meta.url))},{id:"jinja",name:"Jinja",import:(()=>T(()=>import("./CXZktZb0.js"),__vite__mapDeps([59,1,2,3]),import.meta.url))},{id:"jison",name:"Jison",import:(()=>T(()=>import("./Br6cN0cg.js"),__vite__mapDeps([60,2]),import.meta.url))},{id:"json",name:"JSON",import:(()=>T(()=>import("./Cp-IABpG.js"),[],import.meta.url))},{id:"json5",name:"JSON5",import:(()=>T(()=>import("./C9tS-k6U.js"),[],import.meta.url))},{id:"jsonc",name:"JSON with Comments",import:(()=>T(()=>import("./Des-eS-w.js"),[],import.meta.url))},{id:"jsonl",name:"JSON Lines",import:(()=>T(()=>import("./DcaNXYhu.js"),[],import.meta.url))},{id:"jsonnet",name:"Jsonnet",import:(()=>T(()=>import("./DFQXde-d.js"),[],import.meta.url))},{id:"jssm",name:"JSSM",aliases:["fsl"],import:(()=>T(()=>import("./C2t-YnRu.js"),[],import.meta.url))},{id:"jsx",name:"JSX",import:(()=>T(()=>import("./g9-lgVsj.js"),[],import.meta.url))},{id:"julia",name:"Julia",aliases:["jl"],import:(()=>T(()=>import("./W9tJ9s81.js"),__vite__mapDeps([61,23,24,25,26,16,20,2,62]),import.meta.url))},{id:"kdl",name:"KDL",import:(()=>T(()=>import("./DV7GczEv.js"),[],import.meta.url))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:(()=>T(()=>import("./BdnUsdx6.js"),[],import.meta.url))},{id:"kusto",name:"Kusto",aliases:["kql"],import:(()=>T(()=>import("./DZf3V79B.js"),[],import.meta.url))},{id:"latex",name:"LaTeX",import:(()=>T(()=>import("./DMwsHuHA.js"),__vite__mapDeps([63,64,62]),import.meta.url))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:(()=>T(()=>import("./BZvkOJ9d.js"),[],import.meta.url))},{id:"less",name:"Less",import:(()=>T(()=>import("./B1dDrJ26.js"),[],import.meta.url))},{id:"liquid",name:"Liquid",import:(()=>T(()=>import("./mjskCLCv.js"),__vite__mapDeps([65,1,2,3,9]),import.meta.url))},{id:"llvm",name:"LLVM IR",import:(()=>T(()=>import("./BtvRca6l.js"),[],import.meta.url))},{id:"log",name:"Log file",import:(()=>T(()=>import("./2UxHyX5q.js"),[],import.meta.url))},{id:"logo",name:"Logo",import:(()=>T(()=>import("./BtOb2qkB.js"),[],import.meta.url))},{id:"lua",name:"Lua",import:(()=>T(()=>import("./CnsnAmq5.js"),__vite__mapDeps([37,26]),import.meta.url))},{id:"luau",name:"Luau",import:(()=>T(()=>import("./C-HG3fhB.js"),[],import.meta.url))},{id:"make",name:"Makefile",aliases:["makefile"],import:(()=>T(()=>import("./CHLpvVh8.js"),[],import.meta.url))},{id:"markdown",name:"Markdown",aliases:["md"],import:(()=>T(()=>import("./Cvjx9yec.js"),[],import.meta.url))},{id:"marko",name:"Marko",import:(()=>T(()=>import("./83L43bj1.js"),__vite__mapDeps([66,3,67,5,11]),import.meta.url))},{id:"matlab",name:"MATLAB",import:(()=>T(()=>import("./D7o27uSR.js"),[],import.meta.url))},{id:"mdc",name:"MDC",import:(()=>T(()=>import("./TsXTqZ29.js"),__vite__mapDeps([68,40,38,15,1,2,3]),import.meta.url))},{id:"mdx",name:"MDX",import:(()=>T(()=>import("./Cmh6b_Ma.js"),[],import.meta.url))},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:(()=>T(()=>import("./mWjccvbQ.js"),[],import.meta.url))},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:(()=>T(()=>import("./CKIfxQSi.js"),[],import.meta.url))},{id:"mojo",name:"Mojo",import:(()=>T(()=>import("./B93PlW-d.js"),[],import.meta.url))},{id:"moonbit",name:"MoonBit",aliases:["mbt","mbti"],import:(()=>T(()=>import("./Ba13S78F.js"),[],import.meta.url))},{id:"move",name:"Move",import:(()=>T(()=>import("./IF9eRakj.js"),[],import.meta.url))},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:(()=>T(()=>import("./DRg8JJMk.js"),[],import.meta.url))},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:(()=>T(()=>import("./BrzmwbiE.js"),[],import.meta.url))},{id:"nginx",name:"Nginx",import:(()=>T(()=>import("./Dph4kLrZ.js"),__vite__mapDeps([69,37,26]),import.meta.url))},{id:"nim",name:"Nim",import:(()=>T(()=>import("./DhmSosst.js"),__vite__mapDeps([70,26,1,2,3,7,8,25,40]),import.meta.url))},{id:"nix",name:"Nix",import:(()=>T(()=>import("./CwoSXNpI.js"),[],import.meta.url))},{id:"nushell",name:"nushell",aliases:["nu"],import:(()=>T(()=>import("./C-sUppwS.js"),[],import.meta.url))},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:(()=>T(()=>import("./DXmwc3jG.js"),[],import.meta.url))},{id:"objective-cpp",name:"Objective-C++",import:(()=>T(()=>import("./CLxacb5B.js"),[],import.meta.url))},{id:"ocaml",name:"OCaml",import:(()=>T(()=>import("./C0hk2d4L.js"),[],import.meta.url))},{id:"odin",name:"Odin",import:(()=>T(()=>import("./BBf5iR-q.js"),[],import.meta.url))},{id:"openscad",name:"OpenSCAD",aliases:["scad"],import:(()=>T(()=>import("./C4EeE6gA.js"),[],import.meta.url))},{id:"pascal",name:"Pascal",import:(()=>T(()=>import("./D93ZcfNL.js"),[],import.meta.url))},{id:"perl",name:"Perl",import:(()=>T(()=>import("./BzTr9Aqm.js"),__vite__mapDeps([71,1,2,3,7,8,16]),import.meta.url))},{id:"php",name:"PHP",import:(()=>T(()=>import("./DJjDtW9f.js"),__vite__mapDeps([72,1,2,3,7,8,16,9]),import.meta.url))},{id:"pkl",name:"Pkl",import:(()=>T(()=>import("./u5AG7uiY.js"),[],import.meta.url))},{id:"plsql",name:"PL/SQL",import:(()=>T(()=>import("./ChMvpjG-.js"),[],import.meta.url))},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:(()=>T(()=>import("./BTJTHyun.js"),[],import.meta.url))},{id:"polar",name:"Polar",import:(()=>T(()=>import("./C0HS_06l.js"),[],import.meta.url))},{id:"postcss",name:"PostCSS",import:(()=>T(()=>import("./CXtECtnM.js"),[],import.meta.url))},{id:"powerquery",name:"PowerQuery",import:(()=>T(()=>import("./CEu0bR-o.js"),[],import.meta.url))},{id:"powershell",name:"PowerShell",aliases:["ps","ps1"],import:(()=>T(()=>import("./Dpen1YoG.js"),[],import.meta.url))},{id:"prisma",name:"Prisma",import:(()=>T(()=>import("./Dd19v3D-.js"),[],import.meta.url))},{id:"prolog",name:"Prolog",import:(()=>T(()=>import("./CbFg5uaA.js"),[],import.meta.url))},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:(()=>T(()=>import("./C7zT0LnQ.js"),[],import.meta.url))},{id:"pug",name:"Pug",aliases:["jade"],import:(()=>T(()=>import("./BLmx8bSh.js"),__vite__mapDeps([73,2,3,1]),import.meta.url))},{id:"puppet",name:"Puppet",import:(()=>T(()=>import("./BMWR74SV.js"),[],import.meta.url))},{id:"purescript",name:"PureScript",import:(()=>T(()=>import("./CklMAg4u.js"),[],import.meta.url))},{id:"python",name:"Python",aliases:["py"],import:(()=>T(()=>import("./B6aJPvgy.js"),[],import.meta.url))},{id:"qml",name:"QML",import:(()=>T(()=>import("./BVQ-GDCI.js"),__vite__mapDeps([74,2]),import.meta.url))},{id:"qmldir",name:"QML Directory",import:(()=>T(()=>import("./C8lEn-DE.js"),[],import.meta.url))},{id:"qss",name:"Qt Style Sheets",import:(()=>T(()=>import("./IeuSbFQv.js"),[],import.meta.url))},{id:"r",name:"R",import:(()=>T(()=>import("./Dspwwk_N.js"),[],import.meta.url))},{id:"racket",name:"Racket",import:(()=>T(()=>import("./BqYA7rlc.js"),[],import.meta.url))},{id:"raku",name:"Raku",aliases:["perl6"],import:(()=>T(()=>import("./DXvB9xmW.js"),[],import.meta.url))},{id:"razor",name:"ASP.NET Razor",import:(()=>T(()=>import("./DsumFeuD.js"),__vite__mapDeps([75,1,2,3,76]),import.meta.url))},{id:"reg",name:"Windows Registry Script",import:(()=>T(()=>import("./C-SQnVFl.js"),[],import.meta.url))},{id:"regexp",name:"RegExp",aliases:["regex"],import:(()=>T(()=>import("./CDVJQ6XC.js"),[],import.meta.url))},{id:"rel",name:"Rel",import:(()=>T(()=>import("./C3B-1QV4.js"),[],import.meta.url))},{id:"riscv",name:"RISC-V",import:(()=>T(()=>import("./BM1_JUlF.js"),[],import.meta.url))},{id:"ron",name:"RON",import:(()=>T(()=>import("./BhRPY-oY.js"),[],import.meta.url))},{id:"rosmsg",name:"ROS Interface",import:(()=>T(()=>import("./BJDFO7_C.js"),[],import.meta.url))},{id:"rst",name:"reStructuredText",import:(()=>T(()=>import("./DQwYQDb2.js"),__vite__mapDeps([77,15,1,2,3,23,24,25,26,16,20,28,38,78,33,34,7,8,35,11,36,13,37]),import.meta.url))},{id:"ruby",name:"Ruby",aliases:["rb"],import:(()=>T(()=>import("./Bhrxn6JZ.js"),__vite__mapDeps([33,1,2,3,34,7,8,16,35,11,36,13,23,24,25,26,28,37,38]),import.meta.url))},{id:"rust",name:"Rust",aliases:["rs"],import:(()=>T(()=>import("./B1yitclQ.js"),[],import.meta.url))},{id:"sas",name:"SAS",import:(()=>T(()=>import("./CG8Ifv2g.js"),__vite__mapDeps([79,16]),import.meta.url))},{id:"sass",name:"Sass",import:(()=>T(()=>import("./Cj5Yp3dK.js"),[],import.meta.url))},{id:"scala",name:"Scala",import:(()=>T(()=>import("./C151Ov-r.js"),[],import.meta.url))},{id:"scheme",name:"Scheme",import:(()=>T(()=>import("./C98Dy4si.js"),[],import.meta.url))},{id:"scss",name:"SCSS",import:(()=>T(()=>import("./2EtD6e53.js"),__vite__mapDeps([5,3]),import.meta.url))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:(()=>T(()=>import("./DVxCFoDh.js"),[],import.meta.url))},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:(()=>T(()=>import("./BqTXFGrv.js"),__vite__mapDeps([80,81]),import.meta.url))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:(()=>T(()=>import("./Yzrsuije.js"),[],import.meta.url))},{id:"shellsession",name:"Shell Session",aliases:["console"],import:(()=>T(()=>import("./Cq5zzVJU.js"),__vite__mapDeps([82,28]),import.meta.url))},{id:"smalltalk",name:"Smalltalk",import:(()=>T(()=>import("./BERRCDM3.js"),[],import.meta.url))},{id:"solidity",name:"Solidity",import:(()=>T(()=>import("./rGO070M0.js"),[],import.meta.url))},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:(()=>T(()=>import("./Dzze3sRP.js"),__vite__mapDeps([83,1,2,3]),import.meta.url))},{id:"sparql",name:"SPARQL",import:(()=>T(()=>import("./BRZ36xJF.js"),__vite__mapDeps([84,85]),import.meta.url))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:(()=>T(()=>import("./BtCnVYZw.js"),[],import.meta.url))},{id:"sql",name:"SQL",import:(()=>T(()=>import("./BLtJtn59.js"),[],import.meta.url))},{id:"ssh-config",name:"SSH Config",import:(()=>T(()=>import("./_ykCGR6B.js"),[],import.meta.url))},{id:"stata",name:"Stata",import:(()=>T(()=>import("./DM8c43g1.js"),__vite__mapDeps([86,16]),import.meta.url))},{id:"stylus",name:"Stylus",aliases:["styl"],import:(()=>T(()=>import("./BEDo0Tqx.js"),[],import.meta.url))},{id:"surrealql",name:"SurrealQL",aliases:["surql"],import:(()=>T(()=>import("./BH7IYjvW.js"),__vite__mapDeps([87,2]),import.meta.url))},{id:"svelte",name:"Svelte",import:(()=>T(()=>import("./DYoxhk2S.js"),__vite__mapDeps([88,2,11,3,12]),import.meta.url))},{id:"swift",name:"Swift",import:(()=>T(()=>import("./Dg5xB15N.js"),[],import.meta.url))},{id:"system-verilog",name:"SystemVerilog",import:(()=>T(()=>import("./CnnmHF94.js"),[],import.meta.url))},{id:"systemd",name:"Systemd Units",import:(()=>T(()=>import("./4A_iFExJ.js"),[],import.meta.url))},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:(()=>T(()=>import("./CkByrt1z.js"),[],import.meta.url))},{id:"tasl",name:"Tasl",import:(()=>T(()=>import("./QIJgUcNo.js"),[],import.meta.url))},{id:"tcl",name:"Tcl",import:(()=>T(()=>import("./dwOrl1Do.js"),[],import.meta.url))},{id:"templ",name:"Templ",import:(()=>T(()=>import("./CZhp0h8q.js"),__vite__mapDeps([89,90,2,3]),import.meta.url))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:(()=>T(()=>import("./BETggiCN.js"),[],import.meta.url))},{id:"tex",name:"TeX",import:(()=>T(()=>import("./CQ8jqdy-.js"),__vite__mapDeps([64,62]),import.meta.url))},{id:"toml",name:"TOML",import:(()=>T(()=>import("./vGWfd6FD.js"),[],import.meta.url))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:(()=>T(()=>import("./Cm3UrAx6.js"),__vite__mapDeps([91,11,3,2,25,26,1,16,7,8]),import.meta.url))},{id:"tsv",name:"TSV",import:(()=>T(()=>import("./B_m7g4N7.js"),[],import.meta.url))},{id:"tsx",name:"TSX",import:(()=>T(()=>import("./COt5Ahok.js"),[],import.meta.url))},{id:"turtle",name:"Turtle",import:(()=>T(()=>import("./BsS91CYL.js"),[],import.meta.url))},{id:"twig",name:"Twig",import:(()=>T(()=>import("./RNghxpo_.js"),__vite__mapDeps([92,3,2,5,72,1,7,8,16,9,20,33,34,35,11,36,13,23,24,25,26,28,37,38]),import.meta.url))},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:(()=>T(()=>import("./BPQ3VLAy.js"),[],import.meta.url))},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:(()=>T(()=>import("./BGHnOYBU.js"),[],import.meta.url))},{id:"typst",name:"Typst",aliases:["typ"],import:(()=>T(()=>import("./DHCkPAjA.js"),[],import.meta.url))},{id:"v",name:"V",import:(()=>T(()=>import("./BcVCzyr7.js"),[],import.meta.url))},{id:"vala",name:"Vala",import:(()=>T(()=>import("./CsfeWuGM.js"),[],import.meta.url))},{id:"vb",name:"Visual Basic",aliases:["cmd"],import:(()=>T(()=>import("./D17OF-Vu.js"),[],import.meta.url))},{id:"verilog",name:"Verilog",import:(()=>T(()=>import("./BQ8w6xss.js"),[],import.meta.url))},{id:"vhdl",name:"VHDL",import:(()=>T(()=>import("./CeAyd5Ju.js"),[],import.meta.url))},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:(()=>T(()=>import("./CJc9bBzg.js"),[],import.meta.url))},{id:"vue",name:"Vue",import:(()=>T(()=>import("./DEthMvLe.js"),__vite__mapDeps([93,3,2,11,9,1,15]),import.meta.url))},{id:"vue-html",name:"Vue HTML",import:(()=>T(()=>import("./DqQDbK_p.js"),__vite__mapDeps([94,2]),import.meta.url))},{id:"vue-vine",name:"Vue Vine",import:(()=>T(()=>import("./CW8IKDeL.js"),__vite__mapDeps([95,3,5,67,96,12,2]),import.meta.url))},{id:"vyper",name:"Vyper",aliases:["vy"],import:(()=>T(()=>import("./CDx5xZoG.js"),[],import.meta.url))},{id:"wasm",name:"WebAssembly",import:(()=>T(()=>import("./MzD3tlZU.js"),[],import.meta.url))},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:(()=>T(()=>import("./BV7otONQ.js"),[],import.meta.url))},{id:"wgsl",name:"WGSL",import:(()=>T(()=>import("./Dx-B1_4e.js"),[],import.meta.url))},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:(()=>T(()=>import("./BhOHFoWU.js"),[],import.meta.url))},{id:"wit",name:"WebAssembly Interface Types",import:(()=>T(()=>import("./5i3qLPDT.js"),[],import.meta.url))},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:(()=>T(()=>import("./lXgVvXCa.js"),[],import.meta.url))},{id:"xml",name:"XML",import:(()=>T(()=>import("./BGJmEYvX.js"),__vite__mapDeps([7,8]),import.meta.url))},{id:"xsl",name:"XSL",import:(()=>T(()=>import("./yv6CvBhz.js"),__vite__mapDeps([97,7,8]),import.meta.url))},{id:"yaml",name:"YAML",aliases:["yml"],import:(()=>T(()=>import("./Buea-lGh.js"),[],import.meta.url))},{id:"zenscript",name:"ZenScript",import:(()=>T(()=>import("./DVFEvuxE.js"),[],import.meta.url))},{id:"zig",name:"Zig",import:(()=>T(()=>import("./VOosw3JB.js"),[],import.meta.url))}],j0=Object.fromEntries(Sd.map(e=>[e.id,e.import])),U0=Object.fromEntries(Sd.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),Td={...j0,...U0},W0=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:(()=>T(()=>import("./C4gqWexZ.js"),[],import.meta.url))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:(()=>T(()=>import("./D-2ljcwZ.js"),[],import.meta.url))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:(()=>T(()=>import("./CMjwMIkn.js"),[],import.meta.url))},{id:"ayu-light",displayName:"Ayu Light",type:"light",import:(()=>T(()=>import("./C47S-Tmv.js"),[],import.meta.url))},{id:"ayu-mirage",displayName:"Ayu Mirage",type:"dark",import:(()=>T(()=>import("./CjoLj4QM.js"),[],import.meta.url))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:(()=>T(()=>import("./DFWUc33u.js"),[],import.meta.url))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>T(()=>import("./C9dUb6Cb.js"),[],import.meta.url))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>T(()=>import("./DQyhUUbL.js"),[],import.meta.url))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>T(()=>import("./D87Tk5Gz.js"),[],import.meta.url))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:(()=>T(()=>import("./C3mMm8J8.js"),[],import.meta.url))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:(()=>T(()=>import("./BzJJZx-M.js"),[],import.meta.url))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:(()=>T(()=>import("./BXkSAIEj.js"),[],import.meta.url))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:(()=>T(()=>import("./BgDCqdQA.js"),[],import.meta.url))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:(()=>T(()=>import("./C8M2exoo.js"),[],import.meta.url))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:(()=>T(()=>import("./DHJKELXO.js"),[],import.meta.url))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:(()=>T(()=>import("./Cuk6v7N8.js"),[],import.meta.url))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:(()=>T(()=>import("./DH5Ifo-i.js"),[],import.meta.url))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:(()=>T(()=>import("./E3gJ1_iC.js"),[],import.meta.url))},{id:"github-light",displayName:"GitHub Light",type:"light",import:(()=>T(()=>import("./DAi9KRSo.js"),[],import.meta.url))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:(()=>T(()=>import("./D7oLnXFd.js"),[],import.meta.url))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:(()=>T(()=>import("./BfjtVDDH.js"),[],import.meta.url))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:(()=>T(()=>import("./CFHQjOhq.js"),[],import.meta.url))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:(()=>T(()=>import("./GsRaNv29.js"),[],import.meta.url))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:(()=>T(()=>import("./CVdnzihN.js"),[],import.meta.url))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:(()=>T(()=>import("./CH1njM8p.js"),[],import.meta.url))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:(()=>T(()=>import("./DRw_LuNl.js"),[],import.meta.url))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:(()=>T(()=>import("./hJgmCMqR.js"),[],import.meta.url))},{id:"horizon",displayName:"Horizon",type:"dark",import:(()=>T(()=>import("./BUw7H-hv.js"),[],import.meta.url))},{id:"houston",displayName:"Houston",type:"dark",import:(()=>T(()=>import("./DnULxvSX.js"),[],import.meta.url))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:(()=>T(()=>import("./CkXjmgJE.js"),[],import.meta.url))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>T(()=>import("./CfQXZHmo.js"),[],import.meta.url))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>T(()=>import("./DWedfzmr.js"),[],import.meta.url))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:(()=>T(()=>import("./DUszq2jm.js"),[],import.meta.url))},{id:"light-plus",displayName:"Light Plus",type:"light",import:(()=>T(()=>import("./B7mTdjB0.js"),[],import.meta.url))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:(()=>T(()=>import("./D5KoaKCx.js"),[],import.meta.url))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:(()=>T(()=>import("./BfHTSMKl.js"),[],import.meta.url))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:(()=>T(()=>import("./B0m2ddpp.js"),[],import.meta.url))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:(()=>T(()=>import("./CyktbL80.js"),[],import.meta.url))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:(()=>T(()=>import("./Csfq5Kiy.js"),[],import.meta.url))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:(()=>T(()=>import("./CafNBF8u.js"),[],import.meta.url))},{id:"min-light",displayName:"Min Light",type:"light",import:(()=>T(()=>import("./CTRr51gU.js"),[],import.meta.url))},{id:"monokai",displayName:"Monokai",type:"dark",import:(()=>T(()=>import("./D4h5O-jR.js"),[],import.meta.url))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:(()=>T(()=>import("./C39BiMTA.js"),[],import.meta.url))},{id:"night-owl-light",displayName:"Night Owl Light",type:"light",import:(()=>T(()=>import("./CMTm3GFP.js"),[],import.meta.url))},{id:"nord",displayName:"Nord",type:"dark",import:(()=>T(()=>import("./Ddv68eIx.js"),[],import.meta.url))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:(()=>T(()=>import("./DVMEJ2y_.js"),[],import.meta.url))},{id:"one-light",displayName:"One Light",type:"light",import:(()=>T(()=>import("./C3Wv6jpd.js"),[],import.meta.url))},{id:"plastic",displayName:"Plastic",type:"dark",import:(()=>T(()=>import("./3e1v2bzS.js"),[],import.meta.url))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:(()=>T(()=>import("./CS3Unz2-.js"),[],import.meta.url))},{id:"red",displayName:"Red",type:"dark",import:(()=>T(()=>import("./bN70gL4F.js"),[],import.meta.url))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:(()=>T(()=>import("./qdsjHGoJ.js"),[],import.meta.url))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:(()=>T(()=>import("./DHQR4-dF.js"),[],import.meta.url))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:(()=>T(()=>import("./D4_iv3hh.js"),[],import.meta.url))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:(()=>T(()=>import("./BthQWCQV.js"),[],import.meta.url))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:(()=>T(()=>import("./DqwNpetd.js"),[],import.meta.url))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:(()=>T(()=>import("./Bw305WKR.js"),[],import.meta.url))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:(()=>T(()=>import("./DXbdFlpD.js"),[],import.meta.url))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>T(()=>import("./L9t79GZl.js"),[],import.meta.url))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:(()=>T(()=>import("./CbfX1IO0.js"),[],import.meta.url))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:(()=>T(()=>import("./hegEt444.js"),[],import.meta.url))},{id:"vesper",displayName:"Vesper",type:"dark",import:(()=>T(()=>import("./DU1UobuO.js"),[],import.meta.url))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:(()=>T(()=>import("./Bkuqu6BP.js"),[],import.meta.url))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:(()=>T(()=>import("./D0r3Knsf.js"),[],import.meta.url))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:(()=>T(()=>import("./CVO1_9PV.js"),[],import.meta.url))}],Ad=Object.fromEntries(W0.map(e=>[e.id,e.import]));class za extends Error{constructor(t){super(t),this.name="ShikiError"}}function q0(){return 2147483648}function Y0(){return typeof performance<"u"?performance.now():Date.now()}const X0=(e,t)=>e+(t-e%t)%t;async function K0(e){let t,n;const r={};function o(h){n=h,r.HEAPU8=new Uint8Array(h),r.HEAPU32=new Uint32Array(h)}function i(h,p,b){r.HEAPU8.copyWithin(h,p,p+b)}function s(h){try{return t.grow(h-n.byteLength+65535>>>16),o(t.buffer),1}catch{}}function a(h){const p=r.HEAPU8.length;h=h>>>0;const b=q0();if(h>b)return!1;for(let _=1;_<=4;_*=2){let y=p*(1+.2/_);y=Math.min(y,h+100663296);const g=Math.min(b,X0(Math.max(h,y),65536));if(s(g))return!0}return!1}const l=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function u(h,p,b=1024){const _=p+b;let y=p;for(;h[y]&&!(y>=_);)++y;if(y-p>16&&h.buffer&&l)return l.decode(h.subarray(p,y));let g="";for(;p<y;){let m=h[p++];if(!(m&128)){g+=String.fromCharCode(m);continue}const v=h[p++]&63;if((m&224)===192){g+=String.fromCharCode((m&31)<<6|v);continue}const x=h[p++]&63;if((m&240)===224?m=(m&15)<<12|v<<6|x:m=(m&7)<<18|v<<12|x<<6|h[p++]&63,m<65536)g+=String.fromCharCode(m);else{const L=m-65536;g+=String.fromCharCode(55296|L>>10,56320|L&1023)}}return g}function c(h,p){return h?u(r.HEAPU8,h,p):""}const d={emscripten_get_now:Y0,emscripten_memcpy_big:i,emscripten_resize_heap:a,fd_write:()=>0};async function f(){const p=await e({env:d,wasi_snapshot_preview1:d});t=p.memory,o(t.buffer),Object.assign(r,p),r.UTF8ToString=c}return await f(),r}var Z0=Object.defineProperty,Q0=(e,t,n)=>t in e?Z0(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ge=(e,t,n)=>Q0(e,typeof t!="symbol"?t+"":t,n);let Ye=null;function J0(e){throw new za(e.UTF8ToString(e.getLastOnigError()))}class xi{constructor(t){Ge(this,"utf16Length"),Ge(this,"utf8Length"),Ge(this,"utf16Value"),Ge(this,"utf8Value"),Ge(this,"utf16OffsetToUtf8"),Ge(this,"utf8OffsetToUtf16");const n=t.length,r=xi._utf8ByteLength(t),o=r!==n,i=o?new Uint32Array(n+1):null;o&&(i[n]=r);const s=o?new Uint32Array(r+1):null;o&&(s[r]=n);const a=new Uint8Array(r);let l=0;for(let u=0;u<n;u++){const c=t.charCodeAt(u);let d=c,f=!1;if(c>=55296&&c<=56319&&u+1<n){const h=t.charCodeAt(u+1);h>=56320&&h<=57343&&(d=(c-55296<<10)+65536|h-56320,f=!0)}o&&(i[u]=l,f&&(i[u+1]=l),d<=127?s[l+0]=u:d<=2047?(s[l+0]=u,s[l+1]=u):d<=65535?(s[l+0]=u,s[l+1]=u,s[l+2]=u):(s[l+0]=u,s[l+1]=u,s[l+2]=u,s[l+3]=u)),d<=127?a[l++]=d:d<=2047?(a[l++]=192|(d&1984)>>>6,a[l++]=128|(d&63)>>>0):d<=65535?(a[l++]=224|(d&61440)>>>12,a[l++]=128|(d&4032)>>>6,a[l++]=128|(d&63)>>>0):(a[l++]=240|(d&1835008)>>>18,a[l++]=128|(d&258048)>>>12,a[l++]=128|(d&4032)>>>6,a[l++]=128|(d&63)>>>0),f&&u++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=a,this.utf16OffsetToUtf8=i,this.utf8OffsetToUtf16=s}static _utf8ByteLength(t){let n=0;for(let r=0,o=t.length;r<o;r++){const i=t.charCodeAt(r);let s=i,a=!1;if(i>=55296&&i<=56319&&r+1<o){const l=t.charCodeAt(r+1);l>=56320&&l<=57343&&(s=(i-55296<<10)+65536|l-56320,a=!0)}s<=127?n+=1:s<=2047?n+=2:s<=65535?n+=3:n+=4,a&&r++}return n}createString(t){const n=t.omalloc(this.utf8Length);return t.HEAPU8.set(this.utf8Value,n),n}}const ki=class Ct{constructor(t){if(Ge(this,"id",++Ct.LAST_ID),Ge(this,"_onigBinding"),Ge(this,"content"),Ge(this,"utf16Length"),Ge(this,"utf8Length"),Ge(this,"utf16OffsetToUtf8"),Ge(this,"utf8OffsetToUtf16"),Ge(this,"ptr"),!Ye)throw new za("Must invoke loadWasm first.");this._onigBinding=Ye,this.content=t;const n=new xi(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!Ct._sharedPtrInUse?(Ct._sharedPtr||(Ct._sharedPtr=Ye.omalloc(1e4)),Ct._sharedPtrInUse=!0,Ye.HEAPU8.set(n.utf8Value,Ct._sharedPtr),this.ptr=Ct._sharedPtr):this.ptr=n.createString(Ye)}convertUtf8OffsetToUtf16(t){return this.utf8OffsetToUtf16?t<0?0:t>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[t]:t}convertUtf16OffsetToUtf8(t){return this.utf16OffsetToUtf8?t<0?0:t>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[t]:t}dispose(){this.ptr===Ct._sharedPtr?Ct._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};Ge(ki,"LAST_ID",0);Ge(ki,"_sharedPtr",0);Ge(ki,"_sharedPtrInUse",!1);let Ld=ki;class e_{constructor(t){if(Ge(this,"_onigBinding"),Ge(this,"_ptr"),!Ye)throw new za("Must invoke loadWasm first.");const n=[],r=[];for(let a=0,l=t.length;a<l;a++){const u=new xi(t[a]);n[a]=u.createString(Ye),r[a]=u.utf8Length}const o=Ye.omalloc(4*t.length);Ye.HEAPU32.set(n,o/4);const i=Ye.omalloc(4*t.length);Ye.HEAPU32.set(r,i/4);const s=Ye.createOnigScanner(o,i,t.length);for(let a=0,l=t.length;a<l;a++)Ye.ofree(n[a]);Ye.ofree(i),Ye.ofree(o),s===0&&J0(Ye),this._onigBinding=Ye,this._ptr=s}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(t,n,r){let o=0;if(typeof r=="number"&&(o=r),typeof t=="string"){t=new Ld(t);const i=this._findNextMatchSync(t,n,!1,o);return t.dispose(),i}return this._findNextMatchSync(t,n,!1,o)}_findNextMatchSync(t,n,r,o){const i=this._onigBinding,s=i.findNextOnigScannerMatch(this._ptr,t.id,t.ptr,t.utf8Length,t.convertUtf16OffsetToUtf8(n),o);if(s===0)return null;const a=i.HEAPU32;let l=s/4;const u=a[l++],c=a[l++],d=[];for(let f=0;f<c;f++){const h=t.convertUtf8OffsetToUtf16(a[l++]),p=t.convertUtf8OffsetToUtf16(a[l++]);d[f]={start:h,end:p,length:p-h}}return{index:u,captureIndices:d}}}function t_(e){return typeof e.instantiator=="function"}function n_(e){return typeof e.default=="function"}function r_(e){return typeof e.data<"u"}function o_(e){return typeof Response<"u"&&e instanceof Response}function i_(e){return typeof ArrayBuffer<"u"&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<"u"&&Buffer.isBuffer?.(e)||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer||typeof Uint32Array<"u"&&e instanceof Uint32Array}let uo;function s_(e){if(uo)return uo;async function t(){Ye=await K0(async n=>{let r=e;return r=await r,typeof r=="function"&&(r=await r(n)),typeof r=="function"&&(r=await r(n)),t_(r)?r=await r.instantiator(n):n_(r)?r=await r.default(n):(r_(r)&&(r=r.data),o_(r)?typeof WebAssembly.instantiateStreaming=="function"?r=await a_(r)(n):r=await l_(r)(n):i_(r)?r=await qi(r)(n):r instanceof WebAssembly.Module?r=await qi(r)(n):"default"in r&&r.default instanceof WebAssembly.Module&&(r=await qi(r.default)(n))),"instance"in r&&(r=r.instance),"exports"in r&&(r=r.exports),r})}return uo=t(),uo}function qi(e){return t=>WebAssembly.instantiate(e,t)}function a_(e){return t=>WebAssembly.instantiateStreaming(e,t)}function l_(e){return async t=>{const n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}async function u_(e){return e&&await s_(e),{createScanner(t){return new e_(t.map(n=>typeof n=="string"?n:n.source))},createString(t){return new Ld(t)}}}const Id=z0({langs:Td,themes:Ad,engine:()=>u_(T(()=>import("./CG6Dc4jp.js"),[],import.meta.url))}),{codeToHtml:iI}=G0(Id,{guessEmbeddedLanguages:n0});function pr(e){if([...e].length!==1)throw new Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function c_(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}const Ha=new Set(["alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit"]),Xe=String.raw;function mr(e,t){if(e==null)throw new Error(t??"Value expected");return e}const Pd=Xe`\[\^?`,Nd=`c.? | C(?:-.?)?|${Xe`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${Xe`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${Xe`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${Xe`o\{[^\}]*\}?`}|${Xe`\d{1,3}`}`,Ga=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,co=new RegExp(Xe`
14
+ \\ (?:
15
+ ${Nd}
16
+ | [gk]<[^>]*>?
17
+ | [gk]'[^']*'?
18
+ | .
19
+ )
20
+ | \( (?:
21
+ \? (?:
22
+ [:=!>({]
23
+ | <[=!]
24
+ | <[^>]*>
25
+ | '[^']*'
26
+ | ~\|?
27
+ | #(?:[^)\\]|\\.?)*
28
+ | [^:)]*[:)]
29
+ )?
30
+ | \*[^\)]*\)?
31
+ )?
32
+ | (?:${Ga.source})+
33
+ | ${Pd}
34
+ | .
35
+ `.replace(/\s+/g,""),"gsu"),Yi=new RegExp(Xe`
36
+ \\ (?:
37
+ ${Nd}
38
+ | .
39
+ )
40
+ | \[:(?:\^?\p{Alpha}+|\^):\]
41
+ | ${Pd}
42
+ | &&
43
+ | .
44
+ `.replace(/\s+/g,""),"gsu");function d_(e,t={}){const n={flags:"",...t,rules:{captureGroup:!1,singleline:!1,...t.rules}};if(typeof e!="string")throw new Error("String expected as pattern");const r=I_(n.flags),o=[r.extended],i={captureGroup:n.rules.captureGroup,getCurrentModX(){return o.at(-1)},numOpenGroups:0,popModX(){o.pop()},pushModX(d){o.push(d)},replaceCurrentModX(d){o[o.length-1]=d},singleline:n.rules.singleline};let s=[],a;for(co.lastIndex=0;a=co.exec(e);){const d=f_(i,e,a[0],co.lastIndex);d.tokens?s.push(...d.tokens):d.token&&s.push(d.token),d.lastIndex!==void 0&&(co.lastIndex=d.lastIndex)}const l=[];let u=0;s.filter(d=>d.type==="GroupOpen").forEach(d=>{d.kind==="capturing"?d.number=++u:d.raw==="("&&l.push(d)}),u||l.forEach((d,f)=>{d.kind="capturing",d.number=f+1});const c=u||l.length;return{tokens:s.map(d=>d.type==="EscapedNumber"?N_(d,c):d).flat(),flags:r}}function f_(e,t,n,r){const[o,i]=n;if(n==="["||n==="[^"){const s=h_(t,n,r);return{tokens:s.tokens,lastIndex:s.lastIndex}}if(o==="\\"){if("AbBGyYzZ".includes(i))return{token:jl(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:x_(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:Md(n)}}if(i==="K")return{token:Od("keep",n)};if(i==="N"||i==="R")return{token:_n("newline",n,{negate:i==="N"})};if(i==="O")return{token:_n("any",n)};if(i==="X")return{token:_n("text_segment",n)};const s=Rd(n,{inCharClass:!1});return Array.isArray(s)?{tokens:s}:{token:s}}if(o==="("){if(i==="*")return{token:T_(n)};if(n==="(?{")throw new Error(`Unsupported callout "${n}"`);if(n.startsWith("(?#")){if(t[r]!==")")throw new Error('Unclosed comment group "(?#"');return{lastIndex:r+1}}if(/^\(\?[-imx]+[:)]$/.test(n))return{token:S_(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n==="("&&!e.captureGroup||n==="(?:")return{token:Hn("group",n)};if(n==="(?>")return{token:Hn("atomic",n)};if(n==="(?="||n==="(?!"||n==="(?<="||n==="(?<!")return{token:Hn(n[2]==="<"?"lookbehind":"lookahead",n,{negate:n.endsWith("!")})};if(n==="("&&e.captureGroup||n.startsWith("(?<")&&n.endsWith(">")||n.startsWith("(?'")&&n.endsWith("'"))return{token:Hn("capturing",n,{...n!=="("&&{name:n.slice(3,-1)}})};if(n.startsWith("(?~")){if(n==="(?~|")throw new Error(`Unsupported absence function kind "${n}"`);return{token:Hn("absence_repeater",n)}}throw n==="(?("?new Error(`Unsupported conditional "${n}"`):new Error(`Invalid or unsupported group option "${n}"`)}if(n===")"){if(e.popModX(),e.numOpenGroups--,e.numOpenGroups<0)throw new Error('Unmatched ")"');return{token:b_(n)}}if(e.getCurrentModX()){if(n==="#"){const s=t.indexOf(`
45
+ `,r);return{lastIndex:s===-1?t.length:s}}if(/^\s$/.test(n)){const s=/\s+/y;return s.lastIndex=r,{lastIndex:s.exec(t)?s.lastIndex:r}}}if(n===".")return{token:_n("dot",n)};if(n==="^"||n==="$"){const s=e.singleline?{"^":Xe`\A`,$:Xe`\Z`}[n]:n;return{token:jl(s,n)}}return n==="|"?{token:m_(n)}:Ga.test(n)?{tokens:R_(n)}:{token:Gt(pr(n),n)}}function h_(e,t,n){const r=[Ul(t[1]==="^",t)];let o=1,i;for(Yi.lastIndex=n;i=Yi.exec(e);){const s=i[0];if(s[0]==="["&&s[1]!==":")o++,r.push(Ul(s[1]==="^",s));else if(s==="]"){if(r.at(-1).type==="CharacterClassOpen")r.push(Gt(93,s));else if(o--,r.push(g_(s)),!o)break}else{const a=p_(s);Array.isArray(a)?r.push(...a):r.push(a)}}return{tokens:r,lastIndex:Yi.lastIndex||e.length}}function p_(e){if(e[0]==="\\")return Rd(e,{inCharClass:!0});if(e[0]==="["){const t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!Ha.has(t.groups.name))throw new Error(`Invalid POSIX class "${e}"`);return _n("posix",e,{value:t.groups.name,negate:!!t.groups.negate})}return e==="-"?v_(e):e==="&&"?y_(e):Gt(pr(e),e)}function Rd(e,{inCharClass:t}){const n=e[1];if(n==="c"||n==="C")return C_(e);if("dDhHsSwW".includes(n))return A_(e);if(e.startsWith(Xe`\o{`))throw new Error(`Incomplete, invalid, or unsupported octal code point "${e}"`);if(/^\\[pP]\{/.test(e)){if(e.length===3)throw new Error(`Incomplete or invalid Unicode property "${e}"`);return L_(e)}if(new RegExp("^\\\\x[89A-Fa-f]\\p{AHex}","u").test(e))try{const r=e.split(/\\x/).slice(1).map(s=>parseInt(s,16)),o=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(r)),i=new TextEncoder;return[...o].map(s=>{const a=[...i.encode(s)].map(l=>`\\x${l.toString(16)}`).join("");return Gt(pr(s),a)})}catch{throw new Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n==="u"||n==="x")return Gt(P_(e),e);if(Wl.has(n))return Gt(Wl.get(n),e);if(/\d/.test(n))return __(t,e);if(e==="\\")throw new Error(Xe`Incomplete escape "\"`);if(n==="M")throw new Error(`Unsupported meta "${e}"`);if([...e].length===2)return Gt(e.codePointAt(1),e);throw new Error(`Unexpected escape "${e}"`)}function m_(e){return{type:"Alternator",raw:e}}function jl(e,t){return{type:"Assertion",kind:e,raw:t}}function Md(e){return{type:"Backreference",raw:e}}function Gt(e,t){return{type:"Character",value:e,raw:t}}function g_(e){return{type:"CharacterClassClose",raw:e}}function v_(e){return{type:"CharacterClassHyphen",raw:e}}function y_(e){return{type:"CharacterClassIntersector",raw:e}}function Ul(e,t){return{type:"CharacterClassOpen",negate:e,raw:t}}function _n(e,t,n={}){return{type:"CharacterSet",kind:e,...n,raw:t}}function Od(e,t,n={}){return e==="keep"?{type:"Directive",kind:e,raw:t}:{type:"Directive",kind:e,flags:mr(n.flags),raw:t}}function __(e,t){return{type:"EscapedNumber",inCharClass:e,raw:t}}function b_(e){return{type:"GroupClose",raw:e}}function Hn(e,t,n={}){return{type:"GroupOpen",kind:e,...n,raw:t}}function w_(e,t,n,r){return{type:"NamedCallout",kind:e,tag:t,arguments:n,raw:r}}function E_(e,t,n,r){return{type:"Quantifier",kind:e,min:t,max:n,raw:r}}function x_(e){return{type:"Subroutine",raw:e}}const k_=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),Wl=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function C_(e){const t=e[1]==="c"?e[2]:e[3];if(!t||!/[A-Za-z]/.test(t))throw new Error(`Unsupported control character "${e}"`);return Gt(pr(t.toUpperCase())-64,e)}function S_(e,t){let{on:n,off:r}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;r??="";const o=(t.getCurrentModX()||n.includes("x"))&&!r.includes("x"),i=Yl(n),s=Yl(r),a={};if(i&&(a.enable=i),s&&(a.disable=s),e.endsWith(")"))return t.replaceCurrentModX(o),Od("flags",e,{flags:a});if(e.endsWith(":"))return t.pushModX(o),t.numOpenGroups++,Hn("group",e,{...(i||s)&&{flags:a}});throw new Error(`Unexpected flag modifier "${e}"`)}function T_(e){const t=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(e);if(!t)throw new Error(`Incomplete or invalid named callout "${e}"`);const{name:n,tag:r,args:o}=t.groups;if(!n)throw new Error(`Invalid named callout "${e}"`);if(r==="")throw new Error(`Named callout tag with empty value not allowed "${e}"`);const i=o?o.split(",").filter(c=>c!=="").map(c=>/^[+-]?\d+$/.test(c)?+c:c):[],[s,a,l]=i,u=k_.has(n)?n.toLowerCase():"custom";switch(u){case"fail":case"mismatch":case"skip":if(i.length>0)throw new Error(`Named callout arguments not allowed "${i}"`);break;case"error":if(i.length>1)throw new Error(`Named callout allows only one argument "${i}"`);if(typeof s=="string")throw new Error(`Named callout argument must be a number "${s}"`);break;case"max":if(!i.length||i.length>2)throw new Error(`Named callout must have one or two arguments "${i}"`);if(typeof s=="string"&&!/^[A-Za-z_]\w*$/.test(s))throw new Error(`Named callout argument one must be a tag or number "${s}"`);if(i.length===2&&(typeof a=="number"||!/^[<>X]$/.test(a)))throw new Error(`Named callout optional argument two must be '<', '>', or 'X' "${a}"`);break;case"count":case"total_count":if(i.length>1)throw new Error(`Named callout allows only one argument "${i}"`);if(i.length===1&&(typeof s=="number"||!/^[<>X]$/.test(s)))throw new Error(`Named callout optional argument must be '<', '>', or 'X' "${s}"`);break;case"cmp":if(i.length!==3)throw new Error(`Named callout must have three arguments "${i}"`);if(typeof s=="string"&&!/^[A-Za-z_]\w*$/.test(s))throw new Error(`Named callout argument one must be a tag or number "${s}"`);if(typeof a=="number"||!/^(?:[<>!=]=|[<>])$/.test(a))throw new Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${a}"`);if(typeof l=="string"&&!/^[A-Za-z_]\w*$/.test(l))throw new Error(`Named callout argument three must be a tag or number "${l}"`);break;case"custom":throw new Error(`Undefined callout name "${n}"`);default:throw new Error(`Unexpected named callout kind "${u}"`)}return w_(u,r??null,o?.split(",")??null,e)}function ql(e){let t=null,n,r;if(e[0]==="{"){const{minStr:o,maxStr:i}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups,s=1e5;if(+o>s||i&&+i>s)throw new Error("Quantifier value unsupported in Oniguruma");if(n=+o,r=i===void 0?+o:i===""?1/0:+i,n>r&&(t="possessive",[n,r]=[r,n]),e.endsWith("?")){if(t==="possessive")throw new Error('Unsupported possessive interval quantifier chain with "?"');t="lazy"}else t||(t="greedy")}else n=e[0]==="+"?1:0,r=e[0]==="?"?1:1/0,t=e[1]==="+"?"possessive":e[1]==="?"?"lazy":"greedy";return E_(t,n,r,e)}function A_(e){const t=e[1].toLowerCase();return _n({d:"digit",h:"hex",s:"space",w:"word"}[t],e,{negate:e[1]!==t})}function L_(e){const{p:t,neg:n,value:r}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return _n("property",e,{value:r,negate:t==="P"&&!n||t==="p"&&!!n})}function Yl(e){const t={};return e.includes("i")&&(t.ignoreCase=!0),e.includes("m")&&(t.dotAll=!0),e.includes("x")&&(t.extended=!0),Object.keys(t).length?t:null}function I_(e){const t={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let n=0;n<e.length;n++){const r=e[n];if(!"imxDPSWy".includes(r))throw new Error(`Invalid flag "${r}"`);if(r==="y"){if(!/^y{[gw]}/.test(e.slice(n)))throw new Error('Invalid or unspecified flag "y" mode');t.textSegmentMode=e[n+2]==="g"?"grapheme":"word",n+=3;continue}t[{i:"ignoreCase",m:"dotAll",x:"extended",D:"digitIsAscii",P:"posixIsAscii",S:"spaceIsAscii",W:"wordIsAscii"}[r]]=!0}return t}function P_(e){if(new RegExp("^(?:\\\\u(?!\\p{AHex}{4})|\\\\x(?!\\p{AHex}{1,2}|\\{\\p{AHex}{1,8}\\}))","u").test(e))throw new Error(`Incomplete or invalid escape "${e}"`);const t=e[2]==="{"?new RegExp("^\\\\x\\{\\s*(?<hex>\\p{AHex}+)","u").exec(e).groups.hex:e.slice(2);return parseInt(t,16)}function N_(e,t){const{raw:n,inCharClass:r}=e,o=n.slice(1);if(!r&&(o!=="0"&&o.length===1||o[0]!=="0"&&+o<=t))return[Md(n)];const i=[],s=o.match(/^[0-7]+|\d/g);for(let a=0;a<s.length;a++){const l=s[a];let u;if(a===0&&l!=="8"&&l!=="9"){if(u=parseInt(l,8),u>127)throw new Error(Xe`Octal encoded byte above 177 unsupported "${n}"`)}else u=pr(l);i.push(Gt(u,(a===0?"\\":"")+l))}return i}function R_(e){const t=[],n=new RegExp(Ga,"gy");let r;for(;r=n.exec(e);){const o=r[0];if(o[0]==="{"){const i=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(o);if(i){const{min:s,max:a}=i.groups;if(+s>+a&&o.endsWith("?")){n.lastIndex--,t.push(ql(o.slice(0,-1)));continue}}}t.push(ql(o))}return t}function Dd(e,t){if(!Array.isArray(e.body))throw new Error("Expected node with body array");if(e.body.length!==1)return!1;const n=e.body[0];return!t||Object.keys(t).every(r=>t[r]===n[r])}function M_(e){return O_.has(e.type)}const O_=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function $d(e,t={}){const n={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},r=d_(e,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),o=(f,h)=>{const p=r.tokens[i.nextIndex];switch(i.parent=f,i.nextIndex++,p.type){case"Alternator":return Sn();case"Assertion":return D_(p);case"Backreference":return $_(p,i);case"Character":return Ci(p.value,{useLastValid:!!h.isCheckingRangeEnd});case"CharacterClassHyphen":return V_(p,i,h);case"CharacterClassOpen":return B_(p,i,h);case"CharacterSet":return F_(p,i);case"Directive":return W_(p.kind,{flags:p.flags});case"GroupOpen":return z_(p,i,h);case"NamedCallout":return Y_(p.kind,p.tag,p.arguments);case"Quantifier":return H_(p,i);case"Subroutine":return G_(p,i);default:throw new Error(`Unexpected token type "${p.type}"`)}},i={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:n.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:n.skipBackrefValidation,skipLookbehindValidation:n.skipLookbehindValidation,skipPropertyNameValidation:n.skipPropertyNameValidation,subroutines:[],tokens:r.tokens,unicodePropertyMap:n.unicodePropertyMap,walk:o},s=K_(q_(r.flags));let a=s.body[0];for(;i.nextIndex<r.tokens.length;){const f=o(a,{});f.type==="Alternative"?(s.body.push(f),a=f):a.body.push(f)}const{capturingGroups:l,hasNumberedRef:u,namedGroupsByName:c,subroutines:d}=i;if(u&&c.size&&!n.rules.captureGroup)throw new Error("Numbered backref/subroutine not allowed when using named capture");for(const{ref:f}of d)if(typeof f=="number"){if(f>l.length)throw new Error("Subroutine uses a group number that's not defined");f&&(l[f-1].isSubroutined=!0)}else if(c.has(f)){if(c.get(f).length>1)throw new Error(Xe`Subroutine uses a duplicate group name "\g<${f}>"`);c.get(f)[0].isSubroutined=!0}else throw new Error(Xe`Subroutine uses a group name that's not defined "\g<${f}>"`);return s}function D_({kind:e}){return Hs(mr({"^":"line_start",$:"line_end","\\A":"string_start","\\b":"word_boundary","\\B":"word_boundary","\\G":"search_start","\\y":"text_segment_boundary","\\Y":"text_segment_boundary","\\z":"string_end","\\Z":"string_end_newline"}[e],`Unexpected assertion kind "${e}"`),{negate:e===Xe`\B`||e===Xe`\Y`})}function $_({raw:e},t){const n=/^\\k[<']/.test(e),r=n?e.slice(3,-1):e.slice(1),o=(i,s=!1)=>{const a=t.capturingGroups.length;let l=!1;if(i>a)if(t.skipBackrefValidation)l=!0;else throw new Error(`Not enough capturing groups defined to the left "${e}"`);return t.hasNumberedRef=!0,Gs(s?a+1-i:i,{orphan:l})};if(n){const i=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(r);if(i)return o(+i.groups.num,!!i.groups.sign);if(/[-+]/.test(r))throw new Error(`Invalid backref name "${e}"`);if(!t.namedGroupsByName.has(r))throw new Error(`Group name not defined to the left "${e}"`);return Gs(r)}return o(+r)}function V_(e,t,n){const{tokens:r,walk:o}=t,i=t.parent,s=i.body.at(-1),a=r[t.nextIndex];if(!n.isCheckingRangeEnd&&s&&s.type!=="CharacterClass"&&s.type!=="CharacterClassRange"&&a&&a.type!=="CharacterClassOpen"&&a.type!=="CharacterClassClose"&&a.type!=="CharacterClassIntersector"){const l=o(i,{...n,isCheckingRangeEnd:!0});if(s.type==="Character"&&l.type==="Character")return i.body.pop(),U_(s,l);throw new Error("Invalid character class range")}return Ci(pr("-"))}function B_({negate:e},t,n){const{tokens:r,walk:o}=t,i=r[t.nextIndex],s=[Ao()];let a=Zl(i);for(;a.type!=="CharacterClassClose";){if(a.type==="CharacterClassIntersector")s.push(Ao()),t.nextIndex++;else{const u=s.at(-1);u.body.push(o(u,n))}a=Zl(r[t.nextIndex],i)}const l=Ao({negate:e});return s.length===1?l.body=s[0].body:(l.kind="intersection",l.body=s.map(u=>u.body.length===1?u.body[0]:u)),t.nextIndex++,l}function F_({kind:e,negate:t,value:n},r){const{normalizeUnknownPropertyNames:o,skipPropertyNameValidation:i,unicodePropertyMap:s}=r;if(e==="property"){const a=Si(n);if(Ha.has(a)&&!s?.has(a))e="posix",n=a;else return Gn(n,{negate:t,normalizeUnknownPropertyNames:o,skipPropertyNameValidation:i,unicodePropertyMap:s})}return e==="posix"?X_(n,{negate:t}):js(e,{negate:t})}function z_(e,t,n){const{tokens:r,capturingGroups:o,namedGroupsByName:i,skipLookbehindValidation:s,walk:a}=t,l=Z_(e),u=l.type==="AbsenceFunction",c=Kl(l),d=c&&l.negate;if(l.type==="CapturingGroup"&&(o.push(l),l.name&&c_(i,l.name,[]).push(l)),u&&n.isInAbsenceFunction)throw new Error("Nested absence function not supported by Oniguruma");let f=Ql(r[t.nextIndex]);for(;f.type!=="GroupClose";){if(f.type==="Alternator")l.body.push(Sn()),t.nextIndex++;else{const h=l.body.at(-1),p=a(h,{...n,isInAbsenceFunction:n.isInAbsenceFunction||u,isInLookbehind:n.isInLookbehind||c,isInNegLookbehind:n.isInNegLookbehind||d});if(h.body.push(p),(c||n.isInLookbehind)&&!s){const b="Lookbehind includes a pattern not allowed by Oniguruma";if(d||n.isInNegLookbehind){if(Xl(p)||p.type==="CapturingGroup")throw new Error(b)}else if(Xl(p)||Kl(p)&&p.negate)throw new Error(b)}}f=Ql(r[t.nextIndex])}return t.nextIndex++,l}function H_({kind:e,min:t,max:n},r){const o=r.parent,i=o.body.at(-1);if(!i||!M_(i))throw new Error("Quantifier requires a repeatable token");const s=Bd(e,t,n,i);return o.body.pop(),s}function G_({raw:e},t){const{capturingGroups:n,subroutines:r}=t;let o=e.slice(3,-1);const i=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(o);if(i){const a=+i.groups.num,l=n.length;if(t.hasNumberedRef=!0,o={"":a,"+":l+a,"-":l+1-a}[i.groups.sign],o<1)throw new Error("Invalid subroutine number")}else o==="0"&&(o=0);const s=Fd(o);return r.push(s),s}function j_(e,t){return{type:"AbsenceFunction",kind:e,body:to(t?.body)}}function Sn(e){return{type:"Alternative",body:zd(e?.body)}}function Hs(e,t){const n={type:"Assertion",kind:e};return(e==="word_boundary"||e==="text_segment_boundary")&&(n.negate=!!t?.negate),n}function Gs(e,t){const n=!!t?.orphan;return{type:"Backreference",ref:e,...n&&{orphan:n}}}function Vd(e,t){const n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!Q_(n.name))throw new Error(`Group name "${n.name}" invalid in Oniguruma`);return{type:"CapturingGroup",number:e,...n.name&&{name:n.name},...n.isSubroutined&&{isSubroutined:n.isSubroutined},body:to(t?.body)}}function Ci(e,t){const n={useLastValid:!1,...t};if(e>1114111){const r=e.toString(16);if(n.useLastValid)e=1114111;else throw e>1310719?new Error(`Invalid code point out of range "\\x{${r}}"`):new Error(`Invalid code point out of range in JS "\\x{${r}}"`)}return{type:"Character",value:e}}function Ao(e){const t={kind:"union",negate:!1,...e};return{type:"CharacterClass",kind:t.kind,negate:t.negate,body:zd(e?.body)}}function U_(e,t){if(t.value<e.value)throw new Error("Character class range out of order");return{type:"CharacterClassRange",min:e,max:t}}function js(e,t){const n=!!t?.negate,r={type:"CharacterSet",kind:e};return(e==="digit"||e==="hex"||e==="newline"||e==="space"||e==="word")&&(r.negate=n),(e==="text_segment"||e==="newline"&&!n)&&(r.variableLength=!0),r}function W_(e,t={}){if(e==="keep")return{type:"Directive",kind:e};if(e==="flags")return{type:"Directive",kind:e,flags:mr(t.flags)};throw new Error(`Unexpected directive kind "${e}"`)}function q_(e){return{type:"Flags",...e}}function mt(e){const t=e?.atomic,n=e?.flags;if(t&&n)throw new Error("Atomic group cannot have flags");return{type:"Group",...t&&{atomic:t},...n&&{flags:n},body:to(e?.body)}}function mn(e){const t={behind:!1,negate:!1,...e};return{type:"LookaroundAssertion",kind:t.behind?"lookbehind":"lookahead",negate:t.negate,body:to(e?.body)}}function Y_(e,t,n){return{type:"NamedCallout",kind:e,tag:t,arguments:n}}function X_(e,t){const n=!!t?.negate;if(!Ha.has(e))throw new Error(`Invalid POSIX class "${e}"`);return{type:"CharacterSet",kind:"posix",value:e,negate:n}}function Bd(e,t,n,r){if(t>n)throw new Error("Invalid reversed quantifier range");return{type:"Quantifier",kind:e,min:t,max:n,body:r}}function K_(e,t){return{type:"Regex",body:to(t?.body),flags:e}}function Fd(e){return{type:"Subroutine",ref:e}}function Gn(e,t){const n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t};let r=n.unicodePropertyMap?.get(Si(e));if(!r){if(n.normalizeUnknownPropertyNames)r=J_(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw new Error(Xe`Invalid Unicode property "\p{${e}}"`)}return{type:"CharacterSet",kind:"property",value:r??e,negate:n.negate}}function Z_({flags:e,kind:t,name:n,negate:r,number:o}){switch(t){case"absence_repeater":return j_("repeater");case"atomic":return mt({atomic:!0});case"capturing":return Vd(o,{name:n});case"group":return mt({flags:e});case"lookahead":case"lookbehind":return mn({behind:t==="lookbehind",negate:r});default:throw new Error(`Unexpected group kind "${t}"`)}}function to(e){if(e===void 0)e=[Sn()];else if(!Array.isArray(e)||!e.length||!e.every(t=>t.type==="Alternative"))throw new Error("Invalid body; expected array of one or more Alternative nodes");return e}function zd(e){if(e===void 0)e=[];else if(!Array.isArray(e)||!e.every(t=>!!t.type))throw new Error("Invalid body; expected array of nodes");return e}function Xl(e){return e.type==="LookaroundAssertion"&&e.kind==="lookahead"}function Kl(e){return e.type==="LookaroundAssertion"&&e.kind==="lookbehind"}function Q_(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function J_(e){return e.trim().replace(/[- _]+/g,"_").replace(/[A-Z][a-z]+(?=[A-Z])/g,"$&_").replace(/[A-Za-z]+/g,t=>t[0].toUpperCase()+t.slice(1).toLowerCase())}function Si(e){return e.replace(/[- _]+/g,"").toLowerCase()}function Zl(e,t){return mr(e,`${t?.type==="Character"&&t.value===93?"Empty":"Unclosed"} character class`)}function Ql(e){return mr(e,"Unclosed group")}function Tr(e,t,n=null){function r(i,s){for(let a=0;a<i.length;a++){const l=o(i[a],s,a,i);a=Math.max(-1,a+l)}}function o(i,s=null,a=null,l=null){let u=0,c=!1;const d={node:i,parent:s,key:a,container:l,root:e,remove(){fo(l).splice(Math.max(0,On(a)+u),1),u--,c=!0},removeAllNextSiblings(){return fo(l).splice(On(a)+1)},removeAllPrevSiblings(){const y=On(a)+u;return u-=y,fo(l).splice(0,Math.max(0,y))},replaceWith(y,g={}){const m=!!g.traverse;l?l[Math.max(0,On(a)+u)]=y:mr(s,"Can't replace root node")[a]=y,m&&o(y,s,a,l),c=!0},replaceWithMultiple(y,g={}){const m=!!g.traverse;if(fo(l).splice(Math.max(0,On(a)+u),1,...y),u+=y.length-1,m){let v=0;for(let x=0;x<y.length;x++)v+=o(y[x],s,On(a)+x+v,l)}c=!0},skip(){c=!0}},{type:f}=i,h=t["*"],p=t[f],b=typeof h=="function"?h:h?.enter,_=typeof p=="function"?p:p?.enter;if(b?.(d,n),_?.(d,n),!c)switch(f){case"AbsenceFunction":case"CapturingGroup":case"Group":r(i.body,i);break;case"Alternative":case"CharacterClass":r(i.body,i);break;case"Assertion":case"Backreference":case"Character":case"CharacterSet":case"Directive":case"Flags":case"NamedCallout":case"Subroutine":break;case"CharacterClassRange":o(i.min,i,"min"),o(i.max,i,"max");break;case"LookaroundAssertion":r(i.body,i);break;case"Quantifier":o(i.body,i,"body");break;case"Regex":r(i.body,i),o(i.flags,i,"flags");break;default:throw new Error(`Unexpected node type "${f}"`)}return p?.exit?.(d,n),h?.exit?.(d,n),u}return o(e),e}function fo(e){if(!Array.isArray(e))throw new Error("Container expected");return e}function On(e){if(typeof e!="number")throw new Error("Numeric key expected");return e}const eb=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function tb(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function nb(e,t,n,r){return e.slice(0,t)+r+e.slice(t+n.length)}const pt=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function ja(e,t,n,r){const o=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,"gsu"),i=[!1];let s=0,a="";for(const l of e.matchAll(o)){const{0:u,groups:{$skip:c}}=l;if(!c&&(!r||r===pt.DEFAULT==!s)){n instanceof Function?a+=n(l,{context:s?pt.CHAR_CLASS:pt.DEFAULT,negated:i[i.length-1]}):a+=n;continue}u[0]==="["?(s++,i.push(u[1]==="^")):u==="]"&&s&&(s--,i.pop()),a+=u}return a}function Hd(e,t,n,r){ja(e,t,n,r)}function rb(e,t,n=0,r){if(!new RegExp(t,"su").test(e))return null;const o=new RegExp(`${t}|(?<$skip>\\\\?.)`,"gsu");o.lastIndex=n;let i=0,s;for(;s=o.exec(e);){const{0:a,groups:{$skip:l}}=s;if(!l&&(!r||r===pt.DEFAULT==!i))return s;a==="["?i++:a==="]"&&i&&i--,o.lastIndex==s.index&&o.lastIndex++}return null}function ho(e,t,n){return!!rb(e,t,0,n)}function ob(e,t){const n=/\\?./gsu;n.lastIndex=t;let r=e.length,o=0,i=1,s;for(;s=n.exec(e);){const[a]=s;if(a==="[")o++;else if(o)a==="]"&&o--;else if(a==="(")i++;else if(a===")"&&(i--,!i)){r=s.index;break}}return e.slice(t,r)}const Jl=new RegExp(String.raw`(?<noncapturingStart>${eb})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu");function ib(e,t){const n=t?.hiddenCaptures??[];let r=t?.captureTransfers??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:r,hiddenCaptures:n};const o="(?>",i="(?:(?=(",s=[0],a=[];let l=0,u=0,c=NaN,d;do{d=!1;let f=0,h=0,p=!1,b;for(Jl.lastIndex=Number.isNaN(c)?0:c+i.length;b=Jl.exec(e);){const{0:_,index:y,groups:{capturingStart:g,noncapturingStart:m}}=b;if(_==="[")f++;else if(f)_==="]"&&f--;else if(_===o&&!p)c=y,p=!0;else if(p&&m)h++;else if(g)p?h++:(l++,s.push(l+u));else if(_===")"&&p){if(!h){u++;const v=l+u;if(e=`${e.slice(0,c)}${i}${e.slice(c+o.length,y)}))<$$${v}>)${e.slice(y+1)}`,d=!0,a.push(v),tb(n,v),r.size){const x=new Map;r.forEach((L,P)=>{x.set(P>=v?P+1:P,L.map(O=>O>=v?O+1:O))}),r=x}break}h--}}}while(d);return n.push(...a),e=ja(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:f,groups:{backrefNum:h,wrappedBackrefNum:p}})=>{if(h){const b=+h;if(b>s.length-1)throw new Error(`Backref "${f}" greater than number of captures`);return`\\${s[b]}`}return`\\${p}`},pt.DEFAULT),{pattern:e,captureTransfers:r,hiddenCaptures:n}}const Gd=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,Xi=new RegExp(String.raw`
46
+ \\(?: \d+
47
+ | c[A-Za-z]
48
+ | [gk]<[^>]+>
49
+ | [pPu]\{[^\}]+\}
50
+ | u[A-Fa-f\d]{4}
51
+ | x[A-Fa-f\d]{2}
52
+ )
53
+ | \((?: \? (?: [:=!>]
54
+ | <(?:[=!]|[^>]+>)
55
+ | [A-Za-z\-]+:
56
+ | \(DEFINE\)
57
+ ))?
58
+ | (?<qBase>${Gd})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
59
+ | \\?.
60
+ `.replace(/\s+/g,""),"gsu");function sb(e){if(!new RegExp(`${Gd}\\+`).test(e))return{pattern:e};const t=[];let n=null,r=null,o="",i=0,s;for(Xi.lastIndex=0;s=Xi.exec(e);){const{0:a,index:l,groups:{qBase:u,qMod:c,invalidQ:d}}=s;if(a==="[")i||(r=l),i++;else if(a==="]")i?i--:r=null;else if(!i)if(c==="+"&&o&&!o.startsWith("(")){if(d)throw new Error(`Invalid quantifier "${a}"`);let f=-1;if(/^\{\d+\}$/.test(u))e=nb(e,l+u.length,c,"");else{if(o===")"||o==="]"){const h=o===")"?n:r;if(h===null)throw new Error(`Invalid unmatched "${o}"`);e=`${e.slice(0,h)}(?>${e.slice(h,l)}${u})${e.slice(l+a.length)}`}else e=`${e.slice(0,l-o.length)}(?>${o}${u})${e.slice(l+a.length)}`;f+=4}Xi.lastIndex+=f}else a[0]==="("?t.push(l):a===")"&&(n=t.length?t.pop():null);o=a}return{pattern:e}}const ht=String.raw,ab=ht`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`,Us=ht`\(\?R=(?<rDepth>[^\)]+)\)|${ab}`,Ti=ht`\(\?<(?![=!])(?<captureName>[^>]+)>`,jd=ht`${Ti}|(?<unnamed>\()(?!\?)`,hn=new RegExp(ht`${Ti}|${Us}|\(\?|\\?.`,"gsu"),Ki="Cannot use multiple overlapping recursions";function lb(e,t){const{hiddenCaptures:n,mode:r}={hiddenCaptures:[],mode:"plugin",...t};let o=t?.captureTransfers??new Map;if(!new RegExp(Us,"su").test(e))return{pattern:e,captureTransfers:o,hiddenCaptures:n};if(r==="plugin"&&ho(e,ht`\(\?\(DEFINE\)`,pt.DEFAULT))throw new Error("DEFINE groups cannot be used with recursion");const i=[],s=ho(e,ht`\\[1-9]`,pt.DEFAULT),a=new Map,l=[];let u=!1,c=0,d=0,f;for(hn.lastIndex=0;f=hn.exec(e);){const{0:h,groups:{captureName:p,rDepth:b,gRNameOrNum:_,gRDepth:y}}=f;if(h==="[")c++;else if(c)h==="]"&&c--;else if(b){if(eu(b),u)throw new Error(Ki);if(s)throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with global recursion`);const g=e.slice(0,f.index),m=e.slice(hn.lastIndex);if(ho(m,Us,pt.DEFAULT))throw new Error(Ki);const v=+b-1;e=tu(g,m,v,!1,n,i,d),o=ru(o,g,v,i.length,0,d);break}else if(_){eu(y);let g=!1;for(const C of l)if(C.name===_||C.num===+_){if(g=!0,C.hasRecursedWithin)throw new Error(Ki);break}if(!g)throw new Error(ht`Recursive \g cannot be used outside the referenced group "${r==="external"?_:ht`\g<${_}&R=${y}>`}"`);const m=a.get(_),v=ob(e,m);if(s&&ho(v,ht`${Ti}|\((?!\?)`,pt.DEFAULT))throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with recursion of capturing groups`);const x=e.slice(m,f.index),L=v.slice(x.length+h.length),P=i.length,O=+y-1,W=tu(x,L,O,!0,n,i,d);o=ru(o,x,O,i.length-P,P,d);const N=e.slice(0,m),M=e.slice(m+v.length);e=`${N}${W}${M}`,hn.lastIndex+=W.length-h.length-x.length-L.length,l.forEach(C=>C.hasRecursedWithin=!0),u=!0}else if(p)d++,a.set(String(d),hn.lastIndex),a.set(p,hn.lastIndex),l.push({num:d,name:p});else if(h[0]==="("){const g=h==="(";g&&(d++,a.set(String(d),hn.lastIndex)),l.push(g?{num:d}:{})}else h===")"&&l.pop()}return n.push(...i),{pattern:e,captureTransfers:o,hiddenCaptures:n}}function eu(e){const t=`Max depth must be integer between 2 and 100; used ${e}`;if(!/^[1-9]\d*$/.test(e))throw new Error(t);if(e=+e,e<2||e>100)throw new Error(t)}function tu(e,t,n,r,o,i,s){const a=new Set;r&&Hd(e+t,Ti,({groups:{captureName:u}})=>{a.add(u)},pt.DEFAULT);const l=[n,r?a:null,o,i,s];return`${e}${nu(`(?:${e}`,"forward",...l)}(?:)${nu(`${t})`,"backward",...l)}${t}`}function nu(e,t,n,r,o,i,s){const l=c=>t==="forward"?c+2:n-c+2-1;let u="";for(let c=0;c<n;c++){const d=l(c);u+=ja(e,ht`${jd}|\\k<(?<backref>[^>]+)>`,({0:f,groups:{captureName:h,unnamed:p,backref:b}})=>{if(b&&r&&!r.has(b))return f;const _=`_$${d}`;if(p||h){const y=s+i.length+1;return i.push(y),ub(o,y),p?f:`(?<${h}${_}>`}return ht`\k<${b}${_}>`},pt.DEFAULT)}return u}function ub(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function ru(e,t,n,r,o,i){if(e.size&&r){let s=0;Hd(t,jd,()=>s++,pt.DEFAULT);const a=i-s+o,l=new Map;return e.forEach((u,c)=>{const d=(r-s*n)/n,f=s*n,h=c>a+s?c+r:c,p=[];for(const b of u)if(b<=a)p.push(b);else if(b>a+s+d)p.push(b+r);else if(b<=a+s)for(let _=0;_<=n;_++)p.push(b+s*_);else for(let _=0;_<=n;_++)p.push(b+f+d*_);l.set(h,p)}),l}return e}var je=String.fromCodePoint,ke=String.raw,Yt={flagGroups:(()=>{try{new RegExp("(?i:)")}catch{return!1}return!0})(),unicodeSets:(()=>{try{new RegExp("[[]]","v")}catch{return!1}return!0})()};Yt.bugFlagVLiteralHyphenIsRange=Yt.unicodeSets?(()=>{try{new RegExp(ke`[\d\-a]`,"v")}catch{return!0}return!1})():!1;Yt.bugNestedClassIgnoresNegation=Yt.unicodeSets&&new RegExp("[[^a]]","v").test("a");function Zo(e,{enable:t,disable:n}){return{dotAll:!n?.dotAll&&!!(t?.dotAll||e.dotAll),ignoreCase:!n?.ignoreCase&&!!(t?.ignoreCase||e.ignoreCase)}}function $r(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function Ws(e,t){return ou[e]>=ou[t]}function cb(e,t){if(e==null)throw new Error(t??"Value expected");return e}var ou={ES2025:2025,ES2024:2024,ES2018:2018},db={auto:"auto",ES2025:"ES2025",ES2024:"ES2024",ES2018:"ES2018"};function Ud(e={}){if({}.toString.call(e)!=="[object Object]")throw new Error("Unexpected options");if(e.target!==void 0&&!db[e.target])throw new Error(`Unexpected target "${e.target}"`);const t={accuracy:"default",avoidSubclass:!1,flags:"",global:!1,hasIndices:!1,lazyCompileLength:1/0,target:"auto",verbose:!1,...e,rules:{allowOrphanBackrefs:!1,asciiWordBoundaries:!1,captureGroup:!1,recursionLimit:20,singleline:!1,...e.rules}};return t.target==="auto"&&(t.target=Yt.flagGroups?"ES2025":Yt.unicodeSets?"ES2024":"ES2018"),t}var fb="[ -\r ]",hb=new Set([je(304),je(305)]),Bt=ke`[\p{L}\p{M}\p{N}\p{Pc}]`;function Wd(e){if(hb.has(e))return[e];const t=new Set,n=e.toLowerCase(),r=n.toUpperCase(),o=gb.get(n),i=pb.get(n),s=mb.get(n);return[...r].length===1&&t.add(r),s&&t.add(s),o&&t.add(o),t.add(n),i&&t.add(i),[...t]}var Ua=new Map(`C Other
61
+ Cc Control cntrl
62
+ Cf Format
63
+ Cn Unassigned
64
+ Co Private_Use
65
+ Cs Surrogate
66
+ L Letter
67
+ LC Cased_Letter
68
+ Ll Lowercase_Letter
69
+ Lm Modifier_Letter
70
+ Lo Other_Letter
71
+ Lt Titlecase_Letter
72
+ Lu Uppercase_Letter
73
+ M Mark Combining_Mark
74
+ Mc Spacing_Mark
75
+ Me Enclosing_Mark
76
+ Mn Nonspacing_Mark
77
+ N Number
78
+ Nd Decimal_Number digit
79
+ Nl Letter_Number
80
+ No Other_Number
81
+ P Punctuation punct
82
+ Pc Connector_Punctuation
83
+ Pd Dash_Punctuation
84
+ Pe Close_Punctuation
85
+ Pf Final_Punctuation
86
+ Pi Initial_Punctuation
87
+ Po Other_Punctuation
88
+ Ps Open_Punctuation
89
+ S Symbol
90
+ Sc Currency_Symbol
91
+ Sk Modifier_Symbol
92
+ Sm Math_Symbol
93
+ So Other_Symbol
94
+ Z Separator
95
+ Zl Line_Separator
96
+ Zp Paragraph_Separator
97
+ Zs Space_Separator
98
+ ASCII
99
+ ASCII_Hex_Digit AHex
100
+ Alphabetic Alpha
101
+ Any
102
+ Assigned
103
+ Bidi_Control Bidi_C
104
+ Bidi_Mirrored Bidi_M
105
+ Case_Ignorable CI
106
+ Cased
107
+ Changes_When_Casefolded CWCF
108
+ Changes_When_Casemapped CWCM
109
+ Changes_When_Lowercased CWL
110
+ Changes_When_NFKC_Casefolded CWKCF
111
+ Changes_When_Titlecased CWT
112
+ Changes_When_Uppercased CWU
113
+ Dash
114
+ Default_Ignorable_Code_Point DI
115
+ Deprecated Dep
116
+ Diacritic Dia
117
+ Emoji
118
+ Emoji_Component EComp
119
+ Emoji_Modifier EMod
120
+ Emoji_Modifier_Base EBase
121
+ Emoji_Presentation EPres
122
+ Extended_Pictographic ExtPict
123
+ Extender Ext
124
+ Grapheme_Base Gr_Base
125
+ Grapheme_Extend Gr_Ext
126
+ Hex_Digit Hex
127
+ IDS_Binary_Operator IDSB
128
+ IDS_Trinary_Operator IDST
129
+ ID_Continue IDC
130
+ ID_Start IDS
131
+ Ideographic Ideo
132
+ Join_Control Join_C
133
+ Logical_Order_Exception LOE
134
+ Lowercase Lower
135
+ Math
136
+ Noncharacter_Code_Point NChar
137
+ Pattern_Syntax Pat_Syn
138
+ Pattern_White_Space Pat_WS
139
+ Quotation_Mark QMark
140
+ Radical
141
+ Regional_Indicator RI
142
+ Sentence_Terminal STerm
143
+ Soft_Dotted SD
144
+ Terminal_Punctuation Term
145
+ Unified_Ideograph UIdeo
146
+ Uppercase Upper
147
+ Variation_Selector VS
148
+ White_Space space
149
+ XID_Continue XIDC
150
+ XID_Start XIDS`.split(/\s/).map(e=>[Si(e),e])),pb=new Map([["s",je(383)],[je(383),"s"]]),mb=new Map([[je(223),je(7838)],[je(107),je(8490)],[je(229),je(8491)],[je(969),je(8486)]]),gb=new Map([en(453),en(456),en(459),en(498),...Zi(8072,8079),...Zi(8088,8095),...Zi(8104,8111),en(8124),en(8140),en(8188)]),vb=new Map([["alnum",ke`[\p{Alpha}\p{Nd}]`],["alpha",ke`\p{Alpha}`],["ascii",ke`\p{ASCII}`],["blank",ke`[\p{Zs}\t]`],["cntrl",ke`\p{Cc}`],["digit",ke`\p{Nd}`],["graph",ke`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],["lower",ke`\p{Lower}`],["print",ke`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",ke`[\p{P}\p{S}]`],["space",ke`\p{space}`],["upper",ke`\p{Upper}`],["word",ke`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",ke`\p{AHex}`]]);function yb(e,t){const n=[];for(let r=e;r<=t;r++)n.push(r);return n}function en(e){const t=je(e);return[t.toLowerCase(),t]}function Zi(e,t){return yb(e,t).map(n=>en(n))}var qd=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]);function _b(e,t){const n={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...t};Yd(e);const r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:Ws(n.bestEffortTarget,"ES2024"),passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:e.flags.digitIsAscii,spaceIsAscii:e.flags.spaceIsAscii,wordIsAscii:e.flags.wordIsAscii};Tr(e,bb,r);const o={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},i={currentFlags:o,prevFlags:null,globalFlags:o,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:r.subroutineRefMap};Tr(e,wb,i);const s={groupsByName:i.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:i.reffedNodesByReferencer};return Tr(e,Eb,s),e._originMap=i.groupOriginByCopy,e._strategy=r.strategy,e}var bb={AbsenceFunction({node:e,parent:t,replaceWith:n}){const{body:r,kind:o}=e;if(o==="repeater"){const i=mt();i.body[0].body.push(mn({negate:!0,body:r}),Gn("Any"));const s=mt();s.body[0].body.push(Bd("greedy",0,1/0,i)),n($e(s,t),{traverse:!0})}else throw new Error('Unsupported absence function "(?~|"')},Alternative:{enter({node:e,parent:t,key:n},{flagDirectivesByAlt:r}){const o=e.body.filter(i=>i.kind==="flags");for(let i=n+1;i<t.body.length;i++){const s=t.body[i];$r(r,s,[]).push(...o)}},exit({node:e},{flagDirectivesByAlt:t}){if(t.get(e)?.length){const n=Kd(t.get(e));if(n){const r=mt({flags:n});r.body[0].body=e.body,e.body=[$e(r,e)]}}}},Assertion({node:e,parent:t,key:n,container:r,root:o,remove:i,replaceWith:s},a){const{kind:l,negate:u}=e,{asciiWordBoundaries:c,avoidSubclass:d,supportedGNodes:f,wordIsAscii:h}=a;if(l==="text_segment_boundary")throw new Error(`Unsupported text segment boundary "\\${u?"Y":"y"}"`);if(l==="line_end")s($e(mn({body:[Sn({body:[Hs("string_end")]}),Sn({body:[Ci(10)]})]}),t));else if(l==="line_start")s($e(Ft(ke`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if(l==="search_start")if(f.has(e))o.flags.sticky=!0,i();else{const p=r[n-1];if(p&&Ab(p))s($e(mn({negate:!0}),t));else{if(d)throw new Error(ke`Uses "\G" in a way that requires a subclass`);s(tn(Hs("string_start"),t)),a.strategy="clip_search"}}else if(!(l==="string_end"||l==="string_start"))if(l==="string_end_newline")s($e(Ft(ke`(?=\n?\z)`),t));else if(l==="word_boundary"){if(!h&&!c){const p=`(?:(?<=${Bt})(?!${Bt})|(?<!${Bt})(?=${Bt}))`,b=`(?:(?<=${Bt})(?=${Bt})|(?<!${Bt})(?!${Bt}))`;s($e(Ft(u?b:p),t))}}else throw new Error(`Unexpected assertion kind "${l}"`)},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!Ji(n)&&(n=Qi(n,t),e.ref=n)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:r}=e;r&&!Ji(r)&&(r=Qi(r,t),e.name=r),n.set(e.number,e),r&&n.set(r,e)},CharacterClassRange({node:e,parent:t,replaceWith:n}){if(t.kind==="intersection"){const r=Ao({body:[e]});n($e(r,t),{traverse:!0})}},CharacterSet({node:e,parent:t,replaceWith:n},{accuracy:r,minTargetEs2024:o,digitIsAscii:i,spaceIsAscii:s,wordIsAscii:a}){const{kind:l,negate:u,value:c}=e;if(i&&(l==="digit"||c==="digit")){n(tn(js("digit",{negate:u}),t));return}if(s&&(l==="space"||c==="space")){n($e(es(Ft(fb),u),t));return}if(a&&(l==="word"||c==="word")){n(tn(js("word",{negate:u}),t));return}if(l==="any")n(tn(Gn("Any"),t));else if(l==="digit")n(tn(Gn("Nd",{negate:u}),t));else if(l!=="dot")if(l==="text_segment"){if(r==="strict")throw new Error(ke`Use of "\X" requires non-strict accuracy`);const d="\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?",f=ke`\p{RI}{2}|${d}(?:\u200D${d})*`;n($e(Ft(ke`(?>\r\n|${o?ke`\p{RGI_Emoji}`:f}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(l==="hex")n(tn(Gn("AHex",{negate:u}),t));else if(l==="newline")n($e(Ft(u?`[^
151
+ ]`:`(?>\r
152
+ ?|[
153
+ \v\f…\u2028\u2029])`),t));else if(l==="posix")if(!o&&(c==="graph"||c==="print")){if(r==="strict")throw new Error(`POSIX class "${c}" requires min target ES2024 or non-strict accuracy`);let d={graph:"!-~",print:" -~"}[c];u&&(d=`\0-${je(d.codePointAt(0)-1)}${je(d.codePointAt(2)+1)}-􏿿`),n($e(Ft(`[${d}]`),t))}else n($e(es(Ft(vb.get(c)),u),t));else if(l==="property")Ua.has(Si(c))||(e.key="sc");else if(l==="space")n(tn(Gn("space",{negate:u}),t));else if(l==="word")n($e(es(Ft(Bt),u),t));else throw new Error(`Unexpected character set kind "${l}"`)},Directive({node:e,parent:t,root:n,remove:r,replaceWith:o,removeAllPrevSiblings:i,removeAllNextSiblings:s}){const{kind:a,flags:l}=e;if(a==="flags")if(!l.enable&&!l.disable)r();else{const u=mt({flags:l});u.body[0].body=s(),o($e(u,t),{traverse:!0})}else if(a==="keep"){const u=n.body[0],d=n.body.length===1&&Dd(u,{type:"Group"})&&u.body[0].body.length===1?u.body[0]:n;if(t.parent!==d||d.body.length>1)throw new Error(ke`Uses "\K" in a way that's unsupported`);const f=mn({behind:!0});f.body[0].body=i(),o($e(f,t))}else throw new Error(`Unexpected directive kind "${a}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw new Error('Unsupported flag "P"');if(e.textSegmentMode==="word")throw new Error('Unsupported flag "y{w}"');["digitIsAscii","extended","posixIsAscii","spaceIsAscii","wordIsAscii","textSegmentMode"].forEach(n=>delete e[n]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),t.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;const{enable:t,disable:n}=e.flags;t?.extended&&delete t.extended,n?.extended&&delete n.extended,t?.dotAll&&n?.dotAll&&delete t.dotAll,t?.ignoreCase&&n?.ignoreCase&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,n&&!Object.keys(n).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},t){const{kind:n}=e;n==="lookbehind"&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:n}){const{kind:r}=e;if(r==="fail")n($e(mn({negate:!0}),t));else throw new Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type==="Quantifier"){const t=mt();t.body[0].body.push(e.body),e.body=$e(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){const n=[];let r=!1,o=!1;for(const i of e.body)if(i.body.length===1&&i.body[0].kind==="search_start")i.body.pop();else{const s=Qd(i.body);s?(r=!0,Array.isArray(s)?n.push(...s):n.push(s)):o=!0}r&&!o&&n.forEach(i=>t.add(i))},exit(e,{accuracy:t,passedLookbehind:n,strategy:r}){if(t==="strict"&&n&&r)throw new Error(ke`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!Ji(n)&&(n=Qi(n,t),e.ref=n)}},wb={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){const{orphan:r,ref:o}=e;r||n.set(e,[...t.get(o).map(({node:i})=>i)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:r},{groupOriginByCopy:o,groupsByName:i,multiplexCapturesToLeftByRef:s,openRefs:a,reffedNodesByReferencer:l}){const u=o.get(e);if(u&&a.has(e.number)){const d=tn(iu(e.number),t);l.set(d,a.get(e.number)),n(d);return}a.set(e.number,e),s.set(e.number,[]),e.name&&$r(s,e.name,[]);const c=s.get(e.name??e.number);for(let d=0;d<c.length;d++){const f=c[d];if(u===f.node||u&&u===f.origin||e===f.origin){c.splice(d,1);break}}if(s.get(e.number).push({node:e,origin:u}),e.name&&s.get(e.name).push({node:e,origin:u}),e.name){const d=$r(i,e.name,new Map);let f=!1;if(u)f=!0;else for(const h of d.values())if(!h.hasDuplicateNameToRemove){f=!0;break}i.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:f})}},exit({node:e},{openRefs:t}){t.delete(e.number)}},Group:{enter({node:e},t){t.prevFlags=t.currentFlags,e.flags&&(t.currentFlags=Zo(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:n},r){const{isRecursive:o,ref:i}=e;if(o){let c=t;for(;(c=c.parent)&&!(c.type==="CapturingGroup"&&(c.name===i||c.number===i)););r.reffedNodesByReferencer.set(e,c);return}const s=r.subroutineRefMap.get(i),a=i===0,l=a?iu(0):Xd(s,r.groupOriginByCopy,null);let u=l;if(!a){const c=Kd(Cb(s,f=>f.type==="Group"&&!!f.flags)),d=c?Zo(r.globalFlags,c):r.globalFlags;xb(d,r.currentFlags)||(u=mt({flags:Sb(d)}),u.body[0].body.push(l))}n($e(u,t),{traverse:!a})}},Eb={Backreference({node:e,parent:t,replaceWith:n},r){if(e.orphan){r.highestOrphanBackref=Math.max(r.highestOrphanBackref,e.ref);return}const i=r.reffedNodesByReferencer.get(e).filter(s=>kb(s,e));if(!i.length)n($e(mn({negate:!0}),t));else if(i.length>1){const s=mt({atomic:!0,body:i.reverse().map(a=>Sn({body:[Gs(a.number)]}))});n($e(s,t))}else e.ref=i[0].number},CapturingGroup({node:e},t){e.number=++t.numCapturesToLeft,e.name&&t.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove&&delete e.name},Regex:{exit({node:e},t){const n=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let r=0;r<n;r++){const o=Vd();e.body.at(-1).body.push(o)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function Yd(e){Tr(e,{"*"({node:t,parent:n}){t.parent=n}})}function xb(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function kb(e,t){let n=t;do{if(n.type==="Regex")return!1;if(n.type==="Alternative")continue;if(n===e)return!1;const r=Zd(n.parent);for(const o of r){if(o===n)break;if(o===e||Jd(o,e))return!0}}while(n=n.parent);throw new Error("Unexpected path")}function Xd(e,t,n,r){const o=Array.isArray(e)?[]:{};for(const[i,s]of Object.entries(e))i==="parent"?o.parent=Array.isArray(n)?r:n:s&&typeof s=="object"?o[i]=Xd(s,t,o,n):(i==="type"&&s==="CapturingGroup"&&t.set(o,t.get(e)??e),o[i]=s);return o}function iu(e){const t=Fd(e);return t.isRecursive=!0,t}function Cb(e,t){const n=[];for(;e=e.parent;)(!t||t(e))&&n.push(e);return n}function Qi(e,t){if(t.has(e))return t.get(e);const n=`$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/ug,"_")}`;return t.set(e,n),n}function Kd(e){const t=["dotAll","ignoreCase"],n={enable:{},disable:{}};return e.forEach(({flags:r})=>{t.forEach(o=>{r.enable?.[o]&&(delete n.disable[o],n.enable[o]=!0),r.disable?.[o]&&(n.disable[o]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function Sb({dotAll:e,ignoreCase:t}){const n={};return(e||t)&&(n.enable={},e&&(n.enable.dotAll=!0),t&&(n.enable.ignoreCase=!0)),(!e||!t)&&(n.disable={},!e&&(n.disable.dotAll=!0),!t&&(n.disable.ignoreCase=!0)),n}function Zd(e){if(!e)throw new Error("Node expected");const{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function Qd(e){const t=e.find(n=>n.kind==="search_start"||Lb(n,{negate:!1})||!Tb(n));if(!t)return null;if(t.kind==="search_start")return t;if(t.type==="LookaroundAssertion")return t.body[0].body[0];if(t.type==="CapturingGroup"||t.type==="Group"){const n=[];for(const r of t.body){const o=Qd(r.body);if(!o)return null;Array.isArray(o)?n.push(...o):n.push(o)}return n}return null}function Jd(e,t){const n=Zd(e)??[];for(const r of n)if(r===t||Jd(r,t))return!0;return!1}function Tb({type:e}){return e==="Assertion"||e==="Directive"||e==="LookaroundAssertion"}function Ab(e){const t=["Character","CharacterClass","CharacterSet"];return t.includes(e.type)||e.type==="Quantifier"&&e.min&&t.includes(e.body.type)}function Lb(e,t){const n={negate:null,...t};return e.type==="LookaroundAssertion"&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&Dd(e.body[0],{type:"Assertion",kind:"search_start"})}function Ji(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function Ft(e,t){const r=$d(e,{...t,unicodePropertyMap:Ua}).body;return r.length>1||r[0].body.length>1?mt({body:r}):r[0].body[0]}function es(e,t){return e.negate=t,e}function tn(e,t){return e.parent=t,e}function $e(e,t){return Yd(e),e.parent=t,e}function Ib(e,t){const n=Ud(t),r=Ws(n.target,"ES2024"),o=Ws(n.target,"ES2025"),i=n.rules.recursionLimit;if(!Number.isInteger(i)||i<2||i>20)throw new Error("Invalid recursionLimit; use 2-20");let s=null,a=null;if(!o){const h=[e.flags.ignoreCase];Tr(e,Pb,{getCurrentModI:()=>h.at(-1),popModI(){h.pop()},pushModI(p){h.push(p)},setHasCasedChar(){h.at(-1)?s=!0:a=!0}})}const l={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||s)&&!a)};let u=e;const c={accuracy:n.accuracy,appliedGlobalFlags:l,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:u,originMap:e._originMap,recursionLimit:i,useAppliedIgnoreCase:!!(!o&&s&&a),useFlagMods:o,useFlagV:r,verbose:n.verbose};function d(h){return c.lastNode=u,u=h,cb(Nb[h.type],`Unexpected node type "${h.type}"`)(h,c,d)}const f={pattern:e.body.map(d).join("|"),flags:d(e.flags),options:{...e.options}};return r||(delete f.options.force.v,f.options.disable.v=!0,f.options.unicodeSetsPlugin=null),f._captureTransfers=new Map,f._hiddenCaptures=[],c.captureMap.forEach((h,p)=>{h.hidden&&f._hiddenCaptures.push(p),h.transferTo&&$r(f._captureTransfers,h.transferTo,[]).push(p)}),f}var Pb={"*":{enter({node:e},t){if(au(e)){const n=t.getCurrentModI();t.pushModI(e.flags?Zo({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){au(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){Wa(je(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),ef(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind==="property"&&qd.has(e.value)&&t.setHasCasedChar()}},Nb={Alternative({body:e},t,n){return e.map(n).join("")},Assertion({kind:e,negate:t}){if(e==="string_end")return"$";if(e==="string_start")return"^";if(e==="word_boundary")return t?ke`\B`:ke`\b`;throw new Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},t){if(typeof e!="number")throw new Error("Unexpected named backref in transformed AST");if(!t.useFlagMods&&t.accuracy==="strict"&&t.currentFlags.ignoreCase&&!t.captureMap.get(e).ignoreCase)throw new Error("Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy");return"\\"+e},CapturingGroup(e,t,n){const{body:r,name:o,number:i}=e,s={ignoreCase:t.currentFlags.ignoreCase},a=t.originMap.get(e);return a&&(s.hidden=!0,i>a.number&&(s.transferTo=a.number)),t.captureMap.set(i,s),`(${o?`?<${o}>`:""}${r.map(n).join("|")})`},Character({value:e},t){const n=je(e),r=Dn(e,{escDigit:t.lastNode.type==="Backreference",inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(r!==n)return r;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&Wa(n)){const o=Wd(n);return t.inCharClass?o.join(""):o.length>1?`[${o.join("")}]`:o[0]}return n},CharacterClass(e,t,n){const{kind:r,negate:o,parent:i}=e;let{body:s}=e;if(r==="intersection"&&!t.useFlagV)throw new Error("Use of character class intersection requires min target ES2024");Yt.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&s.some(lu)&&(s=[Ci(45),...s.filter(u=>!lu(u))]);const a=()=>`[${o?"^":""}${s.map(n).join(r==="intersection"?"&&":"")}]`;if(!t.inCharClass){if((!t.useFlagV||Yt.bugNestedClassIgnoresNegation)&&!o){const c=s.filter(d=>d.type==="CharacterClass"&&d.kind==="union"&&d.negate);if(c.length){const d=mt(),f=d.body[0];return d.parent=i,f.parent=d,s=s.filter(h=>!c.includes(h)),e.body=s,s.length?(e.parent=f,f.body.push(e)):d.body.pop(),c.forEach(h=>{const p=Sn({body:[h]});h.parent=p,p.parent=d,d.body.push(p)}),n(d)}}t.inCharClass=!0;const u=a();return t.inCharClass=!1,u}const l=s[0];if(r==="union"&&!o&&l&&((!t.useFlagV||!t.verbose)&&i.kind==="union"&&!(Yt.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&i.kind==="intersection"&&s.length===1&&l.type!=="CharacterClassRange"))return s.map(n).join("");if(!t.useFlagV&&i.type==="CharacterClass")throw new Error("Uses nested character class in a way that requires min target ES2024");return a()},CharacterClassRange(e,t){const n=e.min.value,r=e.max.value,o={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},i=Dn(n,o),s=Dn(r,o),a=new Set;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase){const l=ef(e);$b(l).forEach(c=>{a.add(Array.isArray(c)?`${Dn(c[0],o)}-${Dn(c[1],o)}`:Dn(c,o))})}return`${i}-${s}${[...a].join("")}`},CharacterSet({kind:e,negate:t,value:n,key:r},o){if(e==="dot")return o.currentFlags.dotAll?o.appliedGlobalFlags.dotAll||o.useFlagMods?".":"[^]":ke`[^\n]`;if(e==="digit")return t?ke`\D`:ke`\d`;if(e==="property"){if(o.useAppliedIgnoreCase&&o.currentFlags.ignoreCase&&qd.has(n))throw new Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?ke`\P`:ke`\p`}{${r?`${r}=`:""}${n}}`}if(e==="word")return t?ke`\W`:ke`\w`;throw new Error(`Unexpected character set kind "${e}"`)},Flags(e,t){return(t.appliedGlobalFlags.ignoreCase?"i":"")+(e.dotAll?"s":"")+(e.sticky?"y":"")},Group({atomic:e,body:t,flags:n,parent:r},o,i){const s=o.currentFlags;n&&(o.currentFlags=Zo(s,n));const a=t.map(i).join("|"),l=!o.verbose&&t.length===1&&r.type!=="Quantifier"&&!e&&(!o.useFlagMods||!n)?a:`(?${Vb(e,n,o.useFlagMods)}${a})`;return o.currentFlags=s,l},LookaroundAssertion({body:e,kind:t,negate:n},r,o){return`(?${`${t==="lookahead"?"":"<"}${n?"!":"="}`}${e.map(o).join("|")})`},Quantifier(e,t,n){return n(e.body)+Bb(e)},Subroutine({isRecursive:e,ref:t},n){if(!e)throw new Error("Unexpected non-recursive subroutine in transformed AST");const r=n.recursionLimit;return t===0?`(?R=${r})`:ke`\g<${t}&R=${r}>`}},Rb=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),Mb=new Set(["-","\\","]","^","["]),Ob=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),su=new Map([[9,ke`\t`],[10,ke`\n`],[11,ke`\v`],[12,ke`\f`],[13,ke`\r`],[8232,ke`\u2028`],[8233,ke`\u2029`],[65279,ke`\uFEFF`]]),Db=new RegExp("^\\p{Cased}$","u");function Wa(e){return Db.test(e)}function ef(e,t){const n=!!t?.firstOnly,r=e.min.value,o=e.max.value,i=[];if(r<65&&(o===65535||o>=131071)||r===65536&&o>=131071)return i;for(let s=r;s<=o;s++){const a=je(s);if(!Wa(a))continue;const l=Wd(a).filter(u=>{const c=u.codePointAt(0);return c<r||c>o});if(l.length&&(i.push(...l),n))break}return i}function Dn(e,{escDigit:t,inCharClass:n,useFlagV:r}){if(su.has(e))return su.get(e);if(e<32||e>126&&e<160||e>262143||t&&Fb(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,"0")}`;const o=n?r?Ob:Mb:Rb,i=je(e);return(o.has(i)?"\\":"")+i}function $b(e){const t=e.map(o=>o.codePointAt(0)).sort((o,i)=>o-i),n=[];let r=null;for(let o=0;o<t.length;o++)t[o+1]===t[o]+1?r??=t[o]:r===null?n.push(t[o]):(n.push([r,t[o]]),r=null);return n}function Vb(e,t,n){if(e)return">";let r="";if(t&&n){const{enable:o,disable:i}=t;r=(o?.ignoreCase?"i":"")+(o?.dotAll?"s":"")+(i?"-":"")+(i?.ignoreCase?"i":"")+(i?.dotAll?"s":"")}return`${r}:`}function Bb({kind:e,max:t,min:n}){let r;return!n&&t===1?r="?":!n&&t===1/0?r="*":n===1&&t===1/0?r="+":n===t?r=`{${n}}`:r=`{${n},${t===1/0?"":t}}`,r+{greedy:"",lazy:"?",possessive:"+"}[e]}function au({type:e}){return e==="CapturingGroup"||e==="Group"||e==="LookaroundAssertion"}function Fb(e){return e>47&&e<58}function lu({type:e,value:t}){return e==="Character"&&t===45}var zb=class qs extends RegExp{#t=new Map;#e=null;#r;#n=null;#o=null;rawOptions={};get source(){return this.#r||"(?:)"}constructor(t,n,r){const o=!!r?.lazyCompile;if(t instanceof RegExp){if(r)throw new Error("Cannot provide options when copying a regexp");const i=t;super(i,n),this.#r=i.source,i instanceof qs&&(this.#t=i.#t,this.#n=i.#n,this.#o=i.#o,this.rawOptions=i.rawOptions)}else{const i={hiddenCaptures:[],strategy:null,transfers:[],...r};super(o?"":t,n),this.#r=t,this.#t=Gb(i.hiddenCaptures,i.transfers),this.#o=i.strategy,this.rawOptions=r??{}}o||(this.#e=this)}exec(t){if(!this.#e){const{lazyCompile:o,...i}=this.rawOptions;this.#e=new qs(this.#r,this.flags,i)}const n=this.global||this.sticky,r=this.lastIndex;if(this.#o==="clip_search"&&n&&r){this.lastIndex=0;const o=this.#i(t.slice(r));return o&&(Hb(o,r,t,this.hasIndices),this.lastIndex+=r),o}return this.#i(t)}#i(t){this.#e.lastIndex=this.lastIndex;const n=super.exec.call(this.#e,t);if(this.lastIndex=this.#e.lastIndex,!n||!this.#t.size)return n;const r=[...n];n.length=1;let o;this.hasIndices&&(o=[...n.indices],n.indices.length=1);const i=[0];for(let s=1;s<r.length;s++){const{hidden:a,transferTo:l}=this.#t.get(s)??{};if(a?i.push(null):(i.push(n.length),n.push(r[s]),this.hasIndices&&n.indices.push(o[s])),l&&r[s]!==void 0){const u=i[l];if(!u)throw new Error(`Invalid capture transfer to "${u}"`);if(n[u]=r[s],this.hasIndices&&(n.indices[u]=o[s]),n.groups){this.#n||(this.#n=jb(this.source));const c=this.#n.get(l);c&&(n.groups[c]=r[s],this.hasIndices&&(n.indices.groups[c]=o[s]))}}}return n}};function Hb(e,t,n,r){if(e.index+=t,e.input=n,r){const o=e.indices;for(let s=0;s<o.length;s++){const a=o[s];a&&(o[s]=[a[0]+t,a[1]+t])}const i=o.groups;i&&Object.keys(i).forEach(s=>{const a=i[s];a&&(i[s]=[a[0]+t,a[1]+t])})}}function Gb(e,t){const n=new Map;for(const r of e)n.set(r,{hidden:!0});for(const[r,o]of t)for(const i of o)$r(n,i,{}).transferTo=r;return n}function jb(e){const t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,n=new Map;let r=0,o=0,i;for(;i=t.exec(e);){const{0:s,groups:{capture:a,name:l}}=i;s==="["?r++:r?s==="]"&&r--:a&&(o++,l&&n.set(o,l))}return n}function Ub(e,t){const n=Wb(e,t);return n.options?new zb(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function Wb(e,t){const n=Ud(t),r=$d(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:Ua}),o=_b(r,{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),i=Ib(o,n),s=lb(i.pattern,{captureTransfers:i._captureTransfers,hiddenCaptures:i._hiddenCaptures,mode:"external"}),a=sb(s.pattern),l=ib(a.pattern,{captureTransfers:s.captureTransfers,hiddenCaptures:s.hiddenCaptures}),u={pattern:l.pattern,flags:`${n.hasIndices?"d":""}${n.global?"g":""}${i.flags}${i.options.disable.v?"u":"v"}`};if(n.avoidSubclass){if(n.lazyCompileLength!==1/0)throw new Error("Lazy compilation requires subclass")}else{const c=l.hiddenCaptures.sort((p,b)=>p-b),d=Array.from(l.captureTransfers),f=o._strategy,h=u.pattern.length>=n.lazyCompileLength;(c.length||d.length||f||h)&&(u.options={...c.length&&{hiddenCaptures:c},...d.length&&{transfers:d},...f&&{strategy:f},...h&&{lazyCompile:h}})}return u}const uu=4294967295;class qb{constructor(t,n={}){this.patterns=t,this.options=n;const{forgiving:r=!1,cache:o,regexConstructor:i}=n;if(!i)throw new Error("Option `regexConstructor` is not provided");this.regexps=t.map(s=>{if(typeof s!="string")return s;const a=o?.get(s);if(a){if(a instanceof RegExp)return a;if(r)return null;throw a}try{const l=i(s);return o?.set(s,l),l}catch(l){if(o?.set(s,l),r)return null;throw l}})}regexps;findNextMatchSync(t,n,r){const o=typeof t=="string"?t:t.content,i=[];function s(a,l,u=0){return{index:a,captureIndices:l.indices.map(c=>c==null?{start:uu,end:uu,length:0}:{start:c[0]+u,end:c[1]+u,length:c[1]-c[0]})}}for(let a=0;a<this.regexps.length;a++){const l=this.regexps[a];if(l)try{l.lastIndex=n;const u=l.exec(o);if(!u)continue;if(u.index===n)return s(a,u,0);i.push([a,u,0])}catch(u){if(this.options.forgiving)continue;throw u}}if(i.length){const a=Math.min(...i.map(l=>l[1].index));for(const[l,u,c]of i)if(u.index===a)return s(l,u,c)}return null}}function Yb(e,t){return Ub(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function Xb(e={}){const t=Object.assign({target:"auto",cache:new Map},e);return t.regexConstructor||=n=>Yb(n,{target:t.target}),{createScanner(n){return new qb(n,t)},createString(n){return{content:n}}}}var Ne=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),wt=Ne((e,t)=>{var n=Object.defineProperty,r=(F,E,$)=>E in F?n(F,E,{enumerable:!0,configurable:!0,writable:!0,value:$}):F[E]=$,o=(F,E)=>()=>(E||F((E={exports:{}}).exports,E),E.exports),i=(F,E,$)=>r(F,typeof E!="symbol"?E+"":E,$),s=o((F,E)=>{var $="\0",A="\0",V="",z=class{constructor(S){i(this,"_isDirected",!0),i(this,"_isMultigraph",!1),i(this,"_isCompound",!1),i(this,"_label"),i(this,"_defaultNodeLabelFn",()=>{}),i(this,"_defaultEdgeLabelFn",()=>{}),i(this,"_nodes",{}),i(this,"_in",{}),i(this,"_preds",{}),i(this,"_out",{}),i(this,"_sucs",{}),i(this,"_edgeObjs",{}),i(this,"_edgeLabels",{}),i(this,"_nodeCount",0),i(this,"_edgeCount",0),i(this,"_parent"),i(this,"_children"),S&&(this._isDirected=Object.hasOwn(S,"directed")?S.directed:!0,this._isMultigraph=Object.hasOwn(S,"multigraph")?S.multigraph:!1,this._isCompound=Object.hasOwn(S,"compound")?S.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children[A]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(S){return this._label=S,this}graph(){return this._label}setDefaultNodeLabel(S){return this._defaultNodeLabelFn=S,typeof S!="function"&&(this._defaultNodeLabelFn=()=>S),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var S=this;return this.nodes().filter(w=>Object.keys(S._in[w]).length===0)}sinks(){var S=this;return this.nodes().filter(w=>Object.keys(S._out[w]).length===0)}setNodes(S,w){var I=arguments,D=this;return S.forEach(function(j){I.length>1?D.setNode(j,w):D.setNode(j)}),this}setNode(S,w){return Object.hasOwn(this._nodes,S)?(arguments.length>1&&(this._nodes[S]=w),this):(this._nodes[S]=arguments.length>1?w:this._defaultNodeLabelFn(S),this._isCompound&&(this._parent[S]=A,this._children[S]={},this._children[A][S]=!0),this._in[S]={},this._preds[S]={},this._out[S]={},this._sucs[S]={},++this._nodeCount,this)}node(S){return this._nodes[S]}hasNode(S){return Object.hasOwn(this._nodes,S)}removeNode(S){var w=this;if(Object.hasOwn(this._nodes,S)){var I=D=>w.removeEdge(w._edgeObjs[D]);delete this._nodes[S],this._isCompound&&(this._removeFromParentsChildList(S),delete this._parent[S],this.children(S).forEach(function(D){w.setParent(D)}),delete this._children[S]),Object.keys(this._in[S]).forEach(I),delete this._in[S],delete this._preds[S],Object.keys(this._out[S]).forEach(I),delete this._out[S],delete this._sucs[S],--this._nodeCount}return this}setParent(S,w){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(w===void 0)w=A;else{w+="";for(var I=w;I!==void 0;I=this.parent(I))if(I===S)throw new Error("Setting "+w+" as parent of "+S+" would create a cycle");this.setNode(w)}return this.setNode(S),this._removeFromParentsChildList(S),this._parent[S]=w,this._children[w][S]=!0,this}_removeFromParentsChildList(S){delete this._children[this._parent[S]][S]}parent(S){if(this._isCompound){var w=this._parent[S];if(w!==A)return w}}children(S=A){if(this._isCompound){var w=this._children[S];if(w)return Object.keys(w)}else{if(S===A)return this.nodes();if(this.hasNode(S))return[]}}predecessors(S){var w=this._preds[S];if(w)return Object.keys(w)}successors(S){var w=this._sucs[S];if(w)return Object.keys(w)}neighbors(S){var w=this.predecessors(S);if(w){let D=new Set(w);for(var I of this.successors(S))D.add(I);return Array.from(D.values())}}isLeaf(S){var w;return this.isDirected()?w=this.successors(S):w=this.neighbors(S),w.length===0}filterNodes(S){var w=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});w.setGraph(this.graph());var I=this;Object.entries(this._nodes).forEach(function([Q,ne]){S(Q)&&w.setNode(Q,ne)}),Object.values(this._edgeObjs).forEach(function(Q){w.hasNode(Q.v)&&w.hasNode(Q.w)&&w.setEdge(Q,I.edge(Q))});var D={};function j(Q){var ne=I.parent(Q);return ne===void 0||w.hasNode(ne)?(D[Q]=ne,ne):ne in D?D[ne]:j(ne)}return this._isCompound&&w.nodes().forEach(Q=>w.setParent(Q,j(Q))),w}setDefaultEdgeLabel(S){return this._defaultEdgeLabelFn=S,typeof S!="function"&&(this._defaultEdgeLabelFn=()=>S),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(S,w){var I=this,D=arguments;return S.reduce(function(j,Q){return D.length>1?I.setEdge(j,Q,w):I.setEdge(j,Q),Q}),this}setEdge(){var S,w,I,D,j=!1,Q=arguments[0];typeof Q=="object"&&Q!==null&&"v"in Q?(S=Q.v,w=Q.w,I=Q.name,arguments.length===2&&(D=arguments[1],j=!0)):(S=Q,w=arguments[1],I=arguments[3],arguments.length>2&&(D=arguments[2],j=!0)),S=""+S,w=""+w,I!==void 0&&(I=""+I);var ne=K(this._isDirected,S,w,I);if(Object.hasOwn(this._edgeLabels,ne))return j&&(this._edgeLabels[ne]=D),this;if(I!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(S),this.setNode(w),this._edgeLabels[ne]=j?D:this._defaultEdgeLabelFn(S,w,I);var oe=J(this._isDirected,S,w,I);return S=oe.v,w=oe.w,Object.freeze(oe),this._edgeObjs[ne]=oe,G(this._preds[w],S),G(this._sucs[S],w),this._in[w][ne]=oe,this._out[S][ne]=oe,this._edgeCount++,this}edge(S,w,I){var D=arguments.length===1?q(this._isDirected,arguments[0]):K(this._isDirected,S,w,I);return this._edgeLabels[D]}edgeAsObj(){let S=this.edge(...arguments);return typeof S!="object"?{label:S}:S}hasEdge(S,w,I){var D=arguments.length===1?q(this._isDirected,arguments[0]):K(this._isDirected,S,w,I);return Object.hasOwn(this._edgeLabels,D)}removeEdge(S,w,I){var D=arguments.length===1?q(this._isDirected,arguments[0]):K(this._isDirected,S,w,I),j=this._edgeObjs[D];return j&&(S=j.v,w=j.w,delete this._edgeLabels[D],delete this._edgeObjs[D],U(this._preds[w],S),U(this._sucs[S],w),delete this._in[w][D],delete this._out[S][D],this._edgeCount--),this}inEdges(S,w){return this.isDirected()?this.filterEdges(this._in[S],S,w):this.nodeEdges(S,w)}outEdges(S,w){return this.isDirected()?this.filterEdges(this._out[S],S,w):this.nodeEdges(S,w)}nodeEdges(S,w){if(S in this._nodes)return this.filterEdges({...this._in[S],...this._out[S]},S,w)}filterEdges(S,w,I){if(S){var D=Object.values(S);return I?D.filter(function(j){return j.v===w&&j.w===I||j.v===I&&j.w===w}):D}}};function G(S,w){S[w]?S[w]++:S[w]=1}function U(S,w){--S[w]||delete S[w]}function K(S,w,I,D){var j=""+w,Q=""+I;if(!S&&j>Q){var ne=j;j=Q,Q=ne}return j+V+Q+V+(D===void 0?$:D)}function J(S,w,I,D){var j=""+w,Q=""+I;if(!S&&j>Q){var ne=j;j=Q,Q=ne}var oe={v:j,w:Q};return D&&(oe.name=D),oe}function q(S,w){return K(S,w.v,w.w,w.name)}E.exports=z}),a=o((F,E)=>{E.exports="3.0.2"}),l=o((F,E)=>{E.exports={Graph:s(),version:a()}}),u=o((F,E)=>{var $=s();E.exports={write:A,read:G};function A(U){var K={options:{directed:U.isDirected(),multigraph:U.isMultigraph(),compound:U.isCompound()},nodes:V(U),edges:z(U)};return U.graph()!==void 0&&(K.value=structuredClone(U.graph())),K}function V(U){return U.nodes().map(function(K){var J=U.node(K),q=U.parent(K),S={v:K};return J!==void 0&&(S.value=J),q!==void 0&&(S.parent=q),S})}function z(U){return U.edges().map(function(K){var J=U.edge(K),q={v:K.v,w:K.w};return K.name!==void 0&&(q.name=K.name),J!==void 0&&(q.value=J),q})}function G(U){var K=new $(U.options).setGraph(U.value);return U.nodes.forEach(function(J){K.setNode(J.v,J.value),J.parent&&K.setParent(J.v,J.parent)}),U.edges.forEach(function(J){K.setEdge({v:J.v,w:J.w,name:J.name},J.value)}),K}}),c=o((F,E)=>{E.exports=A;var $=()=>1;function A(z,G,U,K){return V(z,String(G),U||$,K||function(J){return z.outEdges(J)})}function V(z,G,U,K){var J={},q=!0,S=0,w=z.nodes(),I=function(ne){var oe=U(ne);J[ne.v].distance+oe<J[ne.w].distance&&(J[ne.w]={distance:J[ne.v].distance+oe,predecessor:ne.v},q=!0)},D=function(){w.forEach(function(ne){K(ne).forEach(function(oe){var ae=oe.v===ne?oe.v:oe.w,ge=ae===oe.v?oe.w:oe.v;I({v:ae,w:ge})})})};w.forEach(function(ne){var oe=ne===G?0:Number.POSITIVE_INFINITY;J[ne]={distance:oe}});for(var j=w.length,Q=1;Q<j&&(q=!1,S++,D(),!!q);Q++);if(S===j-1&&(q=!1,D(),q))throw new Error("The graph contains a negative weight cycle");return J}}),d=o((F,E)=>{E.exports=$;function $(A){var V={},z=[],G;function U(K){Object.hasOwn(V,K)||(V[K]=!0,G.push(K),A.successors(K).forEach(U),A.predecessors(K).forEach(U))}return A.nodes().forEach(function(K){G=[],U(K),G.length&&z.push(G)}),z}}),f=o((F,E)=>{var $=class{constructor(){i(this,"_arr",[]),i(this,"_keyIndices",{})}size(){return this._arr.length}keys(){return this._arr.map(function(A){return A.key})}has(A){return Object.hasOwn(this._keyIndices,A)}priority(A){var V=this._keyIndices[A];if(V!==void 0)return this._arr[V].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(A,V){var z=this._keyIndices;if(A=String(A),!Object.hasOwn(z,A)){var G=this._arr,U=G.length;return z[A]=U,G.push({key:A,priority:V}),this._decrease(U),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var A=this._arr.pop();return delete this._keyIndices[A.key],this._heapify(0),A.key}decrease(A,V){var z=this._keyIndices[A];if(V>this._arr[z].priority)throw new Error("New priority is greater than current priority. Key: "+A+" Old: "+this._arr[z].priority+" New: "+V);this._arr[z].priority=V,this._decrease(z)}_heapify(A){var V=this._arr,z=2*A,G=z+1,U=A;z<V.length&&(U=V[z].priority<V[U].priority?z:U,G<V.length&&(U=V[G].priority<V[U].priority?G:U),U!==A&&(this._swap(A,U),this._heapify(U)))}_decrease(A){for(var V=this._arr,z=V[A].priority,G;A!==0&&(G=A>>1,!(V[G].priority<z));)this._swap(A,G),A=G}_swap(A,V){var z=this._arr,G=this._keyIndices,U=z[A],K=z[V];z[A]=K,z[V]=U,G[K.key]=A,G[U.key]=V}};E.exports=$}),h=o((F,E)=>{var $=f();E.exports=V;var A=()=>1;function V(G,U,K,J){var q=function(S){return G.outEdges(S)};return z(G,String(U),K||A,J||q)}function z(G,U,K,J){var q={},S=new $,w,I,D=function(j){var Q=j.v!==w?j.v:j.w,ne=q[Q],oe=K(j),ae=I.distance+oe;if(oe<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+j+" Weight: "+oe);ae<ne.distance&&(ne.distance=ae,ne.predecessor=w,S.decrease(Q,ae))};for(G.nodes().forEach(function(j){var Q=j===U?0:Number.POSITIVE_INFINITY;q[j]={distance:Q},S.add(j,Q)});S.size()>0&&(w=S.removeMin(),I=q[w],I.distance!==Number.POSITIVE_INFINITY);)J(w).forEach(D);return q}}),p=o((F,E)=>{var $=h();E.exports=A;function A(V,z,G){return V.nodes().reduce(function(U,K){return U[K]=$(V,K,z,G),U},{})}}),b=o((F,E)=>{E.exports=$;function $(V,z,G){if(V[z].predecessor!==void 0)throw new Error("Invalid source vertex");if(V[G].predecessor===void 0&&G!==z)throw new Error("Invalid destination vertex");return{weight:V[G].distance,path:A(V,z,G)}}function A(V,z,G){for(var U=[],K=G;K!==z;)U.push(K),K=V[K].predecessor;return U.push(z),U.reverse()}}),_=o((F,E)=>{E.exports=$;function $(A){var V=0,z=[],G={},U=[];function K(J){var q=G[J]={onStack:!0,lowlink:V,index:V++};if(z.push(J),A.successors(J).forEach(function(I){Object.hasOwn(G,I)?G[I].onStack&&(q.lowlink=Math.min(q.lowlink,G[I].index)):(K(I),q.lowlink=Math.min(q.lowlink,G[I].lowlink))}),q.lowlink===q.index){var S=[],w;do w=z.pop(),G[w].onStack=!1,S.push(w);while(J!==w);U.push(S)}}return A.nodes().forEach(function(J){Object.hasOwn(G,J)||K(J)}),U}}),y=o((F,E)=>{var $=_();E.exports=A;function A(V){return $(V).filter(function(z){return z.length>1||z.length===1&&V.hasEdge(z[0],z[0])})}}),g=o((F,E)=>{E.exports=A;var $=()=>1;function A(z,G,U){return V(z,G||$,U||function(K){return z.outEdges(K)})}function V(z,G,U){var K={},J=z.nodes();return J.forEach(function(q){K[q]={},K[q][q]={distance:0},J.forEach(function(S){q!==S&&(K[q][S]={distance:Number.POSITIVE_INFINITY})}),U(q).forEach(function(S){var w=S.v===q?S.w:S.v,I=G(S);K[q][w]={distance:I,predecessor:q}})}),J.forEach(function(q){var S=K[q];J.forEach(function(w){var I=K[w];J.forEach(function(D){var j=I[q],Q=S[D],ne=I[D],oe=j.distance+Q.distance;oe<ne.distance&&(ne.distance=oe,ne.predecessor=Q.predecessor)})})}),K}}),m=o((F,E)=>{function $(V){var z={},G={},U=[];function K(J){if(Object.hasOwn(G,J))throw new A;Object.hasOwn(z,J)||(G[J]=!0,z[J]=!0,V.predecessors(J).forEach(K),delete G[J],U.push(J))}if(V.sinks().forEach(K),Object.keys(z).length!==V.nodeCount())throw new A;return U}var A=class extends Error{constructor(){super(...arguments)}};E.exports=$,$.CycleException=A}),v=o((F,E)=>{var $=m();E.exports=A;function A(V){try{$(V)}catch(z){if(z instanceof $.CycleException)return!1;throw z}return!0}}),x=o((F,E)=>{E.exports=$;function $(V,z,G,U,K){Array.isArray(z)||(z=[z]);var J=(V.isDirected()?V.successors:V.neighbors).bind(V),q={};return z.forEach(function(S){if(!V.hasNode(S))throw new Error("Graph does not have node: "+S);K=A(V,S,G==="post",q,J,U,K)}),K}function A(V,z,G,U,K,J,q){return Object.hasOwn(U,z)||(U[z]=!0,G||(q=J(q,z)),K(z).forEach(function(S){q=A(V,S,G,U,K,J,q)}),G&&(q=J(q,z))),q}}),L=o((F,E)=>{var $=x();E.exports=A;function A(V,z,G){return $(V,z,G,function(U,K){return U.push(K),U},[])}}),P=o((F,E)=>{var $=L();E.exports=A;function A(V,z){return $(V,z,"post")}}),O=o((F,E)=>{var $=L();E.exports=A;function A(V,z){return $(V,z,"pre")}}),W=o((F,E)=>{var $=s(),A=f();E.exports=V;function V(z,G){var U=new $,K={},J=new A,q;function S(I){var D=I.v===q?I.w:I.v,j=J.priority(D);if(j!==void 0){var Q=G(I);Q<j&&(K[D]=q,J.decrease(D,Q))}}if(z.nodeCount()===0)return U;z.nodes().forEach(function(I){J.add(I,Number.POSITIVE_INFINITY),U.setNode(I)}),J.decrease(z.nodes()[0],0);for(var w=!1;J.size()>0;){if(q=J.removeMin(),Object.hasOwn(K,q))U.setEdge(q,K[q]);else{if(w)throw new Error("Input graph is not connected: "+z);w=!0}z.nodeEdges(q).forEach(S)}return U}}),N=o((F,E)=>{var $=h(),A=c();E.exports=V;function V(G,U,K,J){return z(G,U,K,J||function(q){return G.outEdges(q)})}function z(G,U,K,J){if(K===void 0)return $(G,U,K,J);for(var q=!1,S=G.nodes(),w=0;w<S.length;w++){for(var I=J(S[w]),D=0;D<I.length;D++){var j=I[D],Q=j.v===S[w]?j.v:j.w,ne=Q===j.v?j.w:j.v;K({v:Q,w:ne})<0&&(q=!0)}if(q)return A(G,U,K,J)}return $(G,U,K,J)}}),M=o((F,E)=>{E.exports={bellmanFord:c(),components:d(),dijkstra:h(),dijkstraAll:p(),extractPath:b(),findCycles:y(),floydWarshall:g(),isAcyclic:v(),postorder:P(),preorder:O(),prim:W(),shortestPaths:N(),reduce:x(),tarjan:_(),topsort:m()}}),C=l();t.exports={Graph:C.Graph,json:u(),alg:M(),version:C.version}}),Kb=Ne((e,t)=>{var n=class{constructor(){let i={};i._next=i._prev=i,this._sentinel=i}dequeue(){let i=this._sentinel,s=i._prev;if(s!==i)return r(s),s}enqueue(i){let s=this._sentinel;i._prev&&i._next&&r(i),i._next=s._next,s._next._prev=i,s._next=i,i._prev=s}toString(){let i=[],s=this._sentinel,a=s._prev;for(;a!==s;)i.push(JSON.stringify(a,o)),a=a._prev;return"["+i.join(", ")+"]"}};function r(i){i._prev._next=i._next,i._next._prev=i._prev,delete i._next,delete i._prev}function o(i,s){if(i!=="_next"&&i!=="_prev")return s}t.exports=n}),Zb=Ne((e,t)=>{var n=wt().Graph,r=Kb();t.exports=i;var o=()=>1;function i(d,f){if(d.nodeCount()<=1)return[];let h=l(d,f||o);return s(h.graph,h.buckets,h.zeroIdx).flatMap(p=>d.outEdges(p.v,p.w))}function s(d,f,h){let p=[],b=f[f.length-1],_=f[0],y;for(;d.nodeCount();){for(;y=_.dequeue();)a(d,f,h,y);for(;y=b.dequeue();)a(d,f,h,y);if(d.nodeCount()){for(let g=f.length-2;g>0;--g)if(y=f[g].dequeue(),y){p=p.concat(a(d,f,h,y,!0));break}}}return p}function a(d,f,h,p,b){let _=b?[]:void 0;return d.inEdges(p.v).forEach(y=>{let g=d.edge(y),m=d.node(y.v);b&&_.push({v:y.v,w:y.w}),m.out-=g,u(f,h,m)}),d.outEdges(p.v).forEach(y=>{let g=d.edge(y),m=y.w,v=d.node(m);v.in-=g,u(f,h,v)}),d.removeNode(p.v),_}function l(d,f){let h=new n,p=0,b=0;d.nodes().forEach(g=>{h.setNode(g,{v:g,in:0,out:0})}),d.edges().forEach(g=>{let m=h.edge(g.v,g.w)||0,v=f(g),x=m+v;h.setEdge(g.v,g.w,x),b=Math.max(b,h.node(g.v).out+=v),p=Math.max(p,h.node(g.w).in+=v)});let _=c(b+p+3).map(()=>new r),y=p+1;return h.nodes().forEach(g=>{u(_,y,h.node(g))}),{graph:h,buckets:_,zeroIdx:y}}function u(d,f,h){h.out?h.in?d[h.out-h.in+f].enqueue(h):d[d.length-1].enqueue(h):d[0].enqueue(h)}function c(d){let f=[];for(let h=0;h<d;h++)f.push(h);return f}}),He=Ne((e,t)=>{var n=wt().Graph;t.exports={addBorderNode:f,addDummyNode:r,applyWithChunking:b,asNonCompoundGraph:i,buildLayerMatrix:u,intersectRect:l,mapValues:O,maxRank:_,normalizeRanks:c,notime:m,partition:y,pick:P,predecessorWeights:a,range:L,removeEmptyRanks:d,simplify:o,successorWeights:s,time:g,uniqueId:x,zipObject:W};function r(N,M,C,F){for(var E=F;N.hasNode(E);)E=x(F);return C.dummy=M,N.setNode(E,C),E}function o(N){let M=new n().setGraph(N.graph());return N.nodes().forEach(C=>M.setNode(C,N.node(C))),N.edges().forEach(C=>{let F=M.edge(C.v,C.w)||{weight:0,minlen:1},E=N.edge(C);M.setEdge(C.v,C.w,{weight:F.weight+E.weight,minlen:Math.max(F.minlen,E.minlen)})}),M}function i(N){let M=new n({multigraph:N.isMultigraph()}).setGraph(N.graph());return N.nodes().forEach(C=>{N.children(C).length||M.setNode(C,N.node(C))}),N.edges().forEach(C=>{M.setEdge(C,N.edge(C))}),M}function s(N){let M=N.nodes().map(C=>{let F={};return N.outEdges(C).forEach(E=>{F[E.w]=(F[E.w]||0)+N.edge(E).weight}),F});return W(N.nodes(),M)}function a(N){let M=N.nodes().map(C=>{let F={};return N.inEdges(C).forEach(E=>{F[E.v]=(F[E.v]||0)+N.edge(E).weight}),F});return W(N.nodes(),M)}function l(N,M){let C=N.x,F=N.y,E=M.x-C,$=M.y-F,A=N.width/2,V=N.height/2;if(!E&&!$)throw new Error("Not possible to find intersection inside of the rectangle");let z,G;return Math.abs($)*A>Math.abs(E)*V?($<0&&(V=-V),z=V*E/$,G=V):(E<0&&(A=-A),z=A,G=A*$/E),{x:C+z,y:F+G}}function u(N){let M=L(_(N)+1).map(()=>[]);return N.nodes().forEach(C=>{let F=N.node(C),E=F.rank;E!==void 0&&(M[E][F.order]=C)}),M}function c(N){let M=N.nodes().map(F=>{let E=N.node(F).rank;return E===void 0?Number.MAX_VALUE:E}),C=b(Math.min,M);N.nodes().forEach(F=>{let E=N.node(F);Object.hasOwn(E,"rank")&&(E.rank-=C)})}function d(N){let M=N.nodes().map(A=>N.node(A).rank).filter(A=>A!==void 0),C=b(Math.min,M),F=[];N.nodes().forEach(A=>{let V=N.node(A).rank-C;F[V]||(F[V]=[]),F[V].push(A)});let E=0,$=N.graph().nodeRankFactor;Array.from(F).forEach((A,V)=>{A===void 0&&V%$!==0?--E:A!==void 0&&E&&A.forEach(z=>N.node(z).rank+=E)})}function f(N,M,C,F){let E={width:0,height:0};return arguments.length>=4&&(E.rank=C,E.order=F),r(N,"border",E,M)}function h(N,M=p){let C=[];for(let F=0;F<N.length;F+=M){let E=N.slice(F,F+M);C.push(E)}return C}var p=65535;function b(N,M){if(M.length>p){let C=h(M);return N.apply(null,C.map(F=>N.apply(null,F)))}else return N.apply(null,M)}function _(N){let M=N.nodes().map(C=>{let F=N.node(C).rank;return F===void 0?Number.MIN_VALUE:F});return b(Math.max,M)}function y(N,M){let C={lhs:[],rhs:[]};return N.forEach(F=>{M(F)?C.lhs.push(F):C.rhs.push(F)}),C}function g(N,M){let C=Date.now();try{return M()}finally{console.log(N+" time: "+(Date.now()-C)+"ms")}}function m(N,M){return M()}var v=0;function x(N){var M=++v;return N+(""+M)}function L(N,M,C=1){M==null&&(M=N,N=0);let F=$=>$<M;C<0&&(F=$=>M<$);let E=[];for(let $=N;F($);$+=C)E.push($);return E}function P(N,M){let C={};for(let F of M)N[F]!==void 0&&(C[F]=N[F]);return C}function O(N,M){let C=M;return typeof M=="string"&&(C=F=>F[M]),Object.entries(N).reduce((F,[E,$])=>(F[E]=C($,E),F),{})}function W(N,M){return N.reduce((C,F,E)=>(C[F]=M[E],C),{})}}),Qb=Ne((e,t)=>{var n=Zb(),r=He().uniqueId;t.exports={run:o,undo:s};function o(a){(a.graph().acyclicer==="greedy"?n(a,l(a)):i(a)).forEach(u=>{let c=a.edge(u);a.removeEdge(u),c.forwardName=u.name,c.reversed=!0,a.setEdge(u.w,u.v,c,r("rev"))});function l(u){return c=>u.edge(c).weight}}function i(a){let l=[],u={},c={};function d(f){Object.hasOwn(c,f)||(c[f]=!0,u[f]=!0,a.outEdges(f).forEach(h=>{Object.hasOwn(u,h.w)?l.push(h):d(h.w)}),delete u[f])}return a.nodes().forEach(d),l}function s(a){a.edges().forEach(l=>{let u=a.edge(l);if(u.reversed){a.removeEdge(l);let c=u.forwardName;delete u.reversed,delete u.forwardName,a.setEdge(l.w,l.v,u,c)}})}}),Jb=Ne((e,t)=>{var n=He();t.exports={run:r,undo:i};function r(s){s.graph().dummyChains=[],s.edges().forEach(a=>o(s,a))}function o(s,a){let l=a.v,u=s.node(l).rank,c=a.w,d=s.node(c).rank,f=a.name,h=s.edge(a),p=h.labelRank;if(d===u+1)return;s.removeEdge(a);let b,_,y;for(y=0,++u;u<d;++y,++u)h.points=[],_={width:0,height:0,edgeLabel:h,edgeObj:a,rank:u},b=n.addDummyNode(s,"edge",_,"_d"),u===p&&(_.width=h.width,_.height=h.height,_.dummy="edge-label",_.labelpos=h.labelpos),s.setEdge(l,b,{weight:h.weight},f),y===0&&s.graph().dummyChains.push(b),l=b;s.setEdge(l,c,{weight:h.weight},f)}function i(s){s.graph().dummyChains.forEach(a=>{let l=s.node(a),u=l.edgeLabel,c;for(s.setEdge(l.edgeObj,u);l.dummy;)c=s.successors(a)[0],s.removeNode(a),u.points.push({x:l.x,y:l.y}),l.dummy==="edge-label"&&(u.x=l.x,u.y=l.y,u.width=l.width,u.height=l.height),a=c,l=s.node(a)})}}),Qo=Ne((e,t)=>{var{applyWithChunking:n}=He();t.exports={longestPath:r,slack:o};function r(i){var s={};function a(l){var u=i.node(l);if(Object.hasOwn(s,l))return u.rank;s[l]=!0;let c=i.outEdges(l).map(f=>f==null?Number.POSITIVE_INFINITY:a(f.w)-i.edge(f).minlen);var d=n(Math.min,c);return d===Number.POSITIVE_INFINITY&&(d=0),u.rank=d}i.sources().forEach(a)}function o(i,s){return i.node(s.w).rank-i.node(s.v).rank-i.edge(s).minlen}}),tf=Ne((e,t)=>{var n=wt().Graph,r=Qo().slack;t.exports=o;function o(l){var u=new n({directed:!1}),c=l.nodes()[0],d=l.nodeCount();u.setNode(c,{});for(var f,h;i(u,l)<d;)f=s(u,l),h=u.hasNode(f.v)?r(l,f):-r(l,f),a(u,l,h);return u}function i(l,u){function c(d){u.nodeEdges(d).forEach(f=>{var h=f.v,p=d===h?f.w:h;!l.hasNode(p)&&!r(u,f)&&(l.setNode(p,{}),l.setEdge(d,p,{}),c(p))})}return l.nodes().forEach(c),l.nodeCount()}function s(l,u){return u.edges().reduce((c,d)=>{let f=Number.POSITIVE_INFINITY;return l.hasNode(d.v)!==l.hasNode(d.w)&&(f=r(u,d)),f<c[0]?[f,d]:c},[Number.POSITIVE_INFINITY,null])[1]}function a(l,u,c){l.nodes().forEach(d=>u.node(d).rank+=c)}}),ew=Ne((e,t)=>{var n=tf(),r=Qo().slack,o=Qo().longestPath,i=wt().alg.preorder,s=wt().alg.postorder,a=He().simplify;t.exports=l,l.initLowLimValues=f,l.initCutValues=u,l.calcCutValue=d,l.leaveEdge=p,l.enterEdge=b,l.exchangeEdges=_;function l(v){v=a(v),o(v);var x=n(v);f(x),u(x,v);for(var L,P;L=p(x);)P=b(x,v,L),_(x,v,L,P)}function u(v,x){var L=s(v,v.nodes());L=L.slice(0,L.length-1),L.forEach(P=>c(v,x,P))}function c(v,x,L){var P=v.node(L),O=P.parent;v.edge(L,O).cutvalue=d(v,x,L)}function d(v,x,L){var P=v.node(L),O=P.parent,W=!0,N=x.edge(L,O),M=0;return N||(W=!1,N=x.edge(O,L)),M=N.weight,x.nodeEdges(L).forEach(C=>{var F=C.v===L,E=F?C.w:C.v;if(E!==O){var $=F===W,A=x.edge(C).weight;if(M+=$?A:-A,g(v,L,E)){var V=v.edge(L,E).cutvalue;M+=$?-V:V}}}),M}function f(v,x){arguments.length<2&&(x=v.nodes()[0]),h(v,{},1,x)}function h(v,x,L,P,O){var W=L,N=v.node(P);return x[P]=!0,v.neighbors(P).forEach(M=>{Object.hasOwn(x,M)||(L=h(v,x,L,M,P))}),N.low=W,N.lim=L++,O?N.parent=O:delete N.parent,L}function p(v){return v.edges().find(x=>v.edge(x).cutvalue<0)}function b(v,x,L){var P=L.v,O=L.w;x.hasEdge(P,O)||(P=L.w,O=L.v);var W=v.node(P),N=v.node(O),M=W,C=!1;W.lim>N.lim&&(M=N,C=!0);var F=x.edges().filter(E=>C===m(v,v.node(E.v),M)&&C!==m(v,v.node(E.w),M));return F.reduce((E,$)=>r(x,$)<r(x,E)?$:E)}function _(v,x,L,P){var O=L.v,W=L.w;v.removeEdge(O,W),v.setEdge(P.v,P.w,{}),f(v),u(v,x),y(v,x)}function y(v,x){var L=v.nodes().find(O=>!x.node(O).parent),P=i(v,L);P=P.slice(1),P.forEach(O=>{var W=v.node(O).parent,N=x.edge(O,W),M=!1;N||(N=x.edge(W,O),M=!0),x.node(O).rank=x.node(W).rank+(M?N.minlen:-N.minlen)})}function g(v,x,L){return v.hasEdge(x,L)}function m(v,x,L){return L.low<=x.lim&&x.lim<=L.lim}}),tw=Ne((e,t)=>{var n=Qo(),r=n.longestPath,o=tf(),i=ew();t.exports=s;function s(c){var d=c.graph().ranker;if(d instanceof Function)return d(c);switch(c.graph().ranker){case"network-simplex":u(c);break;case"tight-tree":l(c);break;case"longest-path":a(c);break;case"none":break;default:u(c)}}var a=r;function l(c){r(c),o(c)}function u(c){i(c)}}),nw=Ne((e,t)=>{t.exports=n;function n(i){let s=o(i);i.graph().dummyChains.forEach(a=>{let l=i.node(a),u=l.edgeObj,c=r(i,s,u.v,u.w),d=c.path,f=c.lca,h=0,p=d[h],b=!0;for(;a!==u.w;){if(l=i.node(a),b){for(;(p=d[h])!==f&&i.node(p).maxRank<l.rank;)h++;p===f&&(b=!1)}if(!b){for(;h<d.length-1&&i.node(p=d[h+1]).minRank<=l.rank;)h++;p=d[h]}i.setParent(a,p),a=i.successors(a)[0]}})}function r(i,s,a,l){let u=[],c=[],d=Math.min(s[a].low,s[l].low),f=Math.max(s[a].lim,s[l].lim),h,p;h=a;do h=i.parent(h),u.push(h);while(h&&(s[h].low>d||f>s[h].lim));for(p=h,h=l;(h=i.parent(h))!==p;)c.push(h);return{path:u.concat(c.reverse()),lca:p}}function o(i){let s={},a=0;function l(u){let c=a;i.children(u).forEach(l),s[u]={low:c,lim:a++}}return i.children().forEach(l),s}}),rw=Ne((e,t)=>{var n=He();t.exports={run:r,cleanup:a};function r(l){let u=n.addDummyNode(l,"root",{},"_root"),c=i(l),d=Object.values(c),f=n.applyWithChunking(Math.max,d)-1,h=2*f+1;l.graph().nestingRoot=u,l.edges().forEach(b=>l.edge(b).minlen*=h);let p=s(l)+1;l.children().forEach(b=>o(l,u,h,p,f,c,b)),l.graph().nodeRankFactor=h}function o(l,u,c,d,f,h,p){let b=l.children(p);if(!b.length){p!==u&&l.setEdge(u,p,{weight:0,minlen:c});return}let _=n.addBorderNode(l,"_bt"),y=n.addBorderNode(l,"_bb"),g=l.node(p);l.setParent(_,p),g.borderTop=_,l.setParent(y,p),g.borderBottom=y,b.forEach(m=>{o(l,u,c,d,f,h,m);let v=l.node(m),x=v.borderTop?v.borderTop:m,L=v.borderBottom?v.borderBottom:m,P=v.borderTop?d:2*d,O=x!==L?1:f-h[p]+1;l.setEdge(_,x,{weight:P,minlen:O,nestingEdge:!0}),l.setEdge(L,y,{weight:P,minlen:O,nestingEdge:!0})}),l.parent(p)||l.setEdge(u,_,{weight:0,minlen:f+h[p]})}function i(l){var u={};function c(d,f){var h=l.children(d);h&&h.length&&h.forEach(p=>c(p,f+1)),u[d]=f}return l.children().forEach(d=>c(d,1)),u}function s(l){return l.edges().reduce((u,c)=>u+l.edge(c).weight,0)}function a(l){var u=l.graph();l.removeNode(u.nestingRoot),delete u.nestingRoot,l.edges().forEach(c=>{var d=l.edge(c);d.nestingEdge&&l.removeEdge(c)})}}),ow=Ne((e,t)=>{var n=He();t.exports=r;function r(i){function s(a){let l=i.children(a),u=i.node(a);if(l.length&&l.forEach(s),Object.hasOwn(u,"minRank")){u.borderLeft=[],u.borderRight=[];for(let c=u.minRank,d=u.maxRank+1;c<d;++c)o(i,"borderLeft","_bl",a,u,c),o(i,"borderRight","_br",a,u,c)}}i.children().forEach(s)}function o(i,s,a,l,u,c){let d={width:0,height:0,rank:c,borderType:s},f=u[s][c-1],h=n.addDummyNode(i,"border",d,a);u[s][c]=h,i.setParent(h,l),f&&i.setEdge(f,h,{weight:1})}}),iw=Ne((e,t)=>{t.exports={adjust:n,undo:r};function n(c){let d=c.graph().rankdir.toLowerCase();(d==="lr"||d==="rl")&&o(c)}function r(c){let d=c.graph().rankdir.toLowerCase();(d==="bt"||d==="rl")&&s(c),(d==="lr"||d==="rl")&&(l(c),o(c))}function o(c){c.nodes().forEach(d=>i(c.node(d))),c.edges().forEach(d=>i(c.edge(d)))}function i(c){let d=c.width;c.width=c.height,c.height=d}function s(c){c.nodes().forEach(d=>a(c.node(d))),c.edges().forEach(d=>{let f=c.edge(d);f.points.forEach(a),Object.hasOwn(f,"y")&&a(f)})}function a(c){c.y=-c.y}function l(c){c.nodes().forEach(d=>u(c.node(d))),c.edges().forEach(d=>{let f=c.edge(d);f.points.forEach(u),Object.hasOwn(f,"x")&&u(f)})}function u(c){let d=c.x;c.x=c.y,c.y=d}}),sw=Ne((e,t)=>{var n=He();t.exports=r;function r(o){let i={},s=o.nodes().filter(d=>!o.children(d).length),a=s.map(d=>o.node(d).rank),l=n.applyWithChunking(Math.max,a),u=n.range(l+1).map(()=>[]);function c(d){if(i[d])return;i[d]=!0;let f=o.node(d);u[f.rank].push(d),o.successors(d).forEach(c)}return s.sort((d,f)=>o.node(d).rank-o.node(f).rank).forEach(c),u}}),aw=Ne((e,t)=>{var n=He().zipObject;t.exports=r;function r(i,s){let a=0;for(let l=1;l<s.length;++l)a+=o(i,s[l-1],s[l]);return a}function o(i,s,a){let l=n(a,a.map((p,b)=>b)),u=s.flatMap(p=>i.outEdges(p).map(b=>({pos:l[b.w],weight:i.edge(b).weight})).sort((b,_)=>b.pos-_.pos)),c=1;for(;c<a.length;)c<<=1;let d=2*c-1;c-=1;let f=new Array(d).fill(0),h=0;return u.forEach(p=>{let b=p.pos+c;f[b]+=p.weight;let _=0;for(;b>0;)b%2&&(_+=f[b+1]),b=b-1>>1,f[b]+=p.weight;h+=p.weight*_}),h}}),lw=Ne((e,t)=>{t.exports=n;function n(r,o=[]){return o.map(i=>{let s=r.inEdges(i);if(s.length){let a=s.reduce((l,u)=>{let c=r.edge(u),d=r.node(u.v);return{sum:l.sum+c.weight*d.order,weight:l.weight+c.weight}},{sum:0,weight:0});return{v:i,barycenter:a.sum/a.weight,weight:a.weight}}else return{v:i}})}}),uw=Ne((e,t)=>{var n=He();t.exports=r;function r(s,a){let l={};s.forEach((c,d)=>{let f=l[c.v]={indegree:0,in:[],out:[],vs:[c.v],i:d};c.barycenter!==void 0&&(f.barycenter=c.barycenter,f.weight=c.weight)}),a.edges().forEach(c=>{let d=l[c.v],f=l[c.w];d!==void 0&&f!==void 0&&(f.indegree++,d.out.push(l[c.w]))});let u=Object.values(l).filter(c=>!c.indegree);return o(u)}function o(s){let a=[];function l(c){return d=>{d.merged||(d.barycenter===void 0||c.barycenter===void 0||d.barycenter>=c.barycenter)&&i(c,d)}}function u(c){return d=>{d.in.push(c),--d.indegree===0&&s.push(d)}}for(;s.length;){let c=s.pop();a.push(c),c.in.reverse().forEach(l(c)),c.out.forEach(u(c))}return a.filter(c=>!c.merged).map(c=>n.pick(c,["vs","i","barycenter","weight"]))}function i(s,a){let l=0,u=0;s.weight&&(l+=s.barycenter*s.weight,u+=s.weight),a.weight&&(l+=a.barycenter*a.weight,u+=a.weight),s.vs=a.vs.concat(s.vs),s.barycenter=l/u,s.weight=u,s.i=Math.min(a.i,s.i),a.merged=!0}}),cw=Ne((e,t)=>{var n=He();t.exports=r;function r(s,a){let l=n.partition(s,_=>Object.hasOwn(_,"barycenter")),u=l.lhs,c=l.rhs.sort((_,y)=>y.i-_.i),d=[],f=0,h=0,p=0;u.sort(i(!!a)),p=o(d,c,p),u.forEach(_=>{p+=_.vs.length,d.push(_.vs),f+=_.barycenter*_.weight,h+=_.weight,p=o(d,c,p)});let b={vs:d.flat(!0)};return h&&(b.barycenter=f/h,b.weight=h),b}function o(s,a,l){let u;for(;a.length&&(u=a[a.length-1]).i<=l;)a.pop(),s.push(u.vs),l++;return l}function i(s){return(a,l)=>a.barycenter<l.barycenter?-1:a.barycenter>l.barycenter?1:s?l.i-a.i:a.i-l.i}}),dw=Ne((e,t)=>{var n=lw(),r=uw(),o=cw();t.exports=i;function i(l,u,c,d){let f=l.children(u),h=l.node(u),p=h?h.borderLeft:void 0,b=h?h.borderRight:void 0,_={};p&&(f=f.filter(v=>v!==p&&v!==b));let y=n(l,f);y.forEach(v=>{if(l.children(v.v).length){let x=i(l,v.v,c,d);_[v.v]=x,Object.hasOwn(x,"barycenter")&&a(v,x)}});let g=r(y,c);s(g,_);let m=o(g,d);if(p&&(m.vs=[p,m.vs,b].flat(!0),l.predecessors(p).length)){let v=l.node(l.predecessors(p)[0]),x=l.node(l.predecessors(b)[0]);Object.hasOwn(m,"barycenter")||(m.barycenter=0,m.weight=0),m.barycenter=(m.barycenter*m.weight+v.order+x.order)/(m.weight+2),m.weight+=2}return m}function s(l,u){l.forEach(c=>{c.vs=c.vs.flatMap(d=>u[d]?u[d].vs:d)})}function a(l,u){l.barycenter!==void 0?(l.barycenter=(l.barycenter*l.weight+u.barycenter*u.weight)/(l.weight+u.weight),l.weight+=u.weight):(l.barycenter=u.barycenter,l.weight=u.weight)}}),fw=Ne((e,t)=>{var n=wt().Graph,r=He();t.exports=o;function o(s,a,l,u){u||(u=s.nodes());let c=i(s),d=new n({compound:!0}).setGraph({root:c}).setDefaultNodeLabel(f=>s.node(f));return u.forEach(f=>{let h=s.node(f),p=s.parent(f);(h.rank===a||h.minRank<=a&&a<=h.maxRank)&&(d.setNode(f),d.setParent(f,p||c),s[l](f).forEach(b=>{let _=b.v===f?b.w:b.v,y=d.edge(_,f),g=y!==void 0?y.weight:0;d.setEdge(_,f,{weight:s.edge(b).weight+g})}),Object.hasOwn(h,"minRank")&&d.setNode(f,{borderLeft:h.borderLeft[a],borderRight:h.borderRight[a]}))}),d}function i(s){for(var a;s.hasNode(a=r.uniqueId("_root")););return a}}),hw=Ne((e,t)=>{t.exports=n;function n(r,o,i){let s={},a;i.forEach(l=>{let u=r.parent(l),c,d;for(;u;){if(c=r.parent(u),c?(d=s[c],s[c]=u):(d=a,a=u),d&&d!==u){o.setEdge(d,u);return}u=c}})}}),pw=Ne((e,t)=>{var n=sw(),r=aw(),o=dw(),i=fw(),s=hw(),a=wt().Graph,l=He();t.exports=u;function u(h,p={}){if(typeof p.customOrder=="function"){p.customOrder(h,u);return}let b=l.maxRank(h),_=c(h,l.range(1,b+1),"inEdges"),y=c(h,l.range(b-1,-1,-1),"outEdges"),g=n(h);if(f(h,g),p.disableOptimalOrderHeuristic)return;let m=Number.POSITIVE_INFINITY,v,x=p.constraints||[];for(let L=0,P=0;P<4;++L,++P){d(L%2?_:y,L%4>=2,x),g=l.buildLayerMatrix(h);let O=r(h,g);O<m?(P=0,v=Object.assign({},g),m=O):O===m&&(v=structuredClone(g))}f(h,v)}function c(h,p,b){let _=new Map,y=(g,m)=>{_.has(g)||_.set(g,[]),_.get(g).push(m)};for(let g of h.nodes()){let m=h.node(g);if(typeof m.rank=="number"&&y(m.rank,g),typeof m.minRank=="number"&&typeof m.maxRank=="number")for(let v=m.minRank;v<=m.maxRank;v++)v!==m.rank&&y(v,g)}return p.map(function(g){return i(h,g,b,_.get(g)||[])})}function d(h,p,b){let _=new a;h.forEach(function(y){b.forEach(v=>_.setEdge(v.left,v.right));let g=y.graph().root,m=o(y,g,_,p);m.vs.forEach((v,x)=>y.node(v).order=x),s(y,_,m.vs)})}function f(h,p){Object.values(p).forEach(b=>b.forEach((_,y)=>h.node(_).order=y))}}),mw=Ne((e,t)=>{var n=wt().Graph,r=He();t.exports={positionX:b,findType1Conflicts:o,findType2Conflicts:i,addConflict:a,hasConflict:l,verticalAlignment:u,horizontalCompaction:c,alignCoordinates:h,findSmallestWidthAlignment:f,balance:p};function o(g,m){let v={};function x(L,P){let O=0,W=0,N=L.length,M=P[P.length-1];return P.forEach((C,F)=>{let E=s(g,C),$=E?g.node(E).order:N;(E||C===M)&&(P.slice(W,F+1).forEach(A=>{g.predecessors(A).forEach(V=>{let z=g.node(V),G=z.order;(G<O||$<G)&&!(z.dummy&&g.node(A).dummy)&&a(v,V,A)})}),W=F+1,O=$)}),P}return m.length&&m.reduce(x),v}function i(g,m){let v={};function x(P,O,W,N,M){let C;r.range(O,W).forEach(F=>{C=P[F],g.node(C).dummy&&g.predecessors(C).forEach(E=>{let $=g.node(E);$.dummy&&($.order<N||$.order>M)&&a(v,E,C)})})}function L(P,O){let W=-1,N,M=0;return O.forEach((C,F)=>{if(g.node(C).dummy==="border"){let E=g.predecessors(C);E.length&&(N=g.node(E[0]).order,x(O,M,F,W,N),M=F,W=N)}x(O,M,O.length,N,P.length)}),O}return m.length&&m.reduce(L),v}function s(g,m){if(g.node(m).dummy)return g.predecessors(m).find(v=>g.node(v).dummy)}function a(g,m,v){if(m>v){let L=m;m=v,v=L}let x=g[m];x||(g[m]=x={}),x[v]=!0}function l(g,m,v){if(m>v){let x=m;m=v,v=x}return!!g[m]&&Object.hasOwn(g[m],v)}function u(g,m,v,x){let L={},P={},O={};return m.forEach(W=>{W.forEach((N,M)=>{L[N]=N,P[N]=N,O[N]=M})}),m.forEach(W=>{let N=-1;W.forEach(M=>{let C=x(M);if(C.length){C=C.sort((E,$)=>O[E]-O[$]);let F=(C.length-1)/2;for(let E=Math.floor(F),$=Math.ceil(F);E<=$;++E){let A=C[E];P[M]===M&&N<O[A]&&!l(v,M,A)&&(P[A]=M,P[M]=L[M]=L[A],N=O[A])}}})}),{root:L,align:P}}function c(g,m,v,x,L){let P={},O=d(g,m,v,L),W=L?"borderLeft":"borderRight";function N(F,E){let $=O.nodes().slice(),A={},V=$.pop();for(;V;){if(A[V])F(V);else{A[V]=!0,$.push(V);for(let z of E(V))$.push(z)}V=$.pop()}}function M(F){P[F]=O.inEdges(F).reduce((E,$)=>Math.max(E,P[$.v]+O.edge($)),0)}function C(F){let E=O.outEdges(F).reduce((A,V)=>Math.min(A,P[V.w]-O.edge(V)),Number.POSITIVE_INFINITY),$=g.node(F);E!==Number.POSITIVE_INFINITY&&$.borderType!==W&&(P[F]=Math.max(P[F],E))}return N(M,O.predecessors.bind(O)),N(C,O.successors.bind(O)),Object.keys(x).forEach(F=>P[F]=P[v[F]]),P}function d(g,m,v,x){let L=new n,P=g.graph(),O=_(P.nodesep,P.edgesep,x);return m.forEach(W=>{let N;W.forEach(M=>{let C=v[M];if(L.setNode(C),N){var F=v[N],E=L.edge(F,C);L.setEdge(F,C,Math.max(O(g,M,N),E||0))}N=M})}),L}function f(g,m){return Object.values(m).reduce((v,x)=>{let L=Number.NEGATIVE_INFINITY,P=Number.POSITIVE_INFINITY;Object.entries(x).forEach(([W,N])=>{let M=y(g,W)/2;L=Math.max(N+M,L),P=Math.min(N-M,P)});let O=L-P;return O<v[0]&&(v=[O,x]),v},[Number.POSITIVE_INFINITY,null])[1]}function h(g,m){let v=Object.values(m),x=r.applyWithChunking(Math.min,v),L=r.applyWithChunking(Math.max,v);["u","d"].forEach(P=>{["l","r"].forEach(O=>{let W=P+O,N=g[W];if(N===m)return;let M=Object.values(N),C=x-r.applyWithChunking(Math.min,M);O!=="l"&&(C=L-r.applyWithChunking(Math.max,M)),C&&(g[W]=r.mapValues(N,F=>F+C))})})}function p(g,m){return r.mapValues(g.ul,(v,x)=>{if(m)return g[m.toLowerCase()][x];{let L=Object.values(g).map(P=>P[x]).sort((P,O)=>P-O);return(L[1]+L[2])/2}})}function b(g){let m=r.buildLayerMatrix(g),v=Object.assign(o(g,m),i(g,m)),x={},L;["u","d"].forEach(O=>{L=O==="u"?m:Object.values(m).reverse(),["l","r"].forEach(W=>{W==="r"&&(L=L.map(F=>Object.values(F).reverse()));let N=(O==="u"?g.predecessors:g.successors).bind(g),M=u(g,L,v,N),C=c(g,L,M.root,M.align,W==="r");W==="r"&&(C=r.mapValues(C,F=>-F)),x[O+W]=C})});let P=f(g,x);return h(x,P),p(x,g.graph().align)}function _(g,m,v){return(x,L,P)=>{let O=x.node(L),W=x.node(P),N=0,M;if(N+=O.width/2,Object.hasOwn(O,"labelpos"))switch(O.labelpos.toLowerCase()){case"l":M=-O.width/2;break;case"r":M=O.width/2;break}if(M&&(N+=v?M:-M),M=0,N+=(O.dummy?m:g)/2,N+=(W.dummy?m:g)/2,N+=W.width/2,Object.hasOwn(W,"labelpos"))switch(W.labelpos.toLowerCase()){case"l":M=W.width/2;break;case"r":M=-W.width/2;break}return M&&(N+=v?M:-M),M=0,N}}function y(g,m){return g.node(m).width}}),gw=Ne((e,t)=>{var n=He(),r=mw().positionX;t.exports=o;function o(s){s=n.asNonCompoundGraph(s),i(s),Object.entries(r(s)).forEach(([a,l])=>s.node(a).x=l)}function i(s){let a=n.buildLayerMatrix(s),l=s.graph().ranksep,u=s.graph().rankalign,c=0;a.forEach(d=>{let f=d.reduce((h,p)=>{let b=s.node(p).height;return h>b?h:b},0);d.forEach(h=>{let p=s.node(h);u==="top"?p.y=c+p.height/2:u==="bottom"?p.y=c+f-p.height/2:p.y=c+f/2}),c+=f+l})}}),vw=Ne((e,t)=>{var n=Qb(),r=Jb(),o=tw(),i=He().normalizeRanks,s=nw(),a=He().removeEmptyRanks,l=rw(),u=ow(),c=iw(),d=pw(),f=gw(),h=He(),p=wt().Graph;t.exports=b;function b(w,I={}){let D=I.debugTiming?h.time:h.notime;return D("layout",()=>{let j=D(" buildLayoutGraph",()=>N(w));return D(" runLayout",()=>_(j,D,I)),D(" updateInputGraph",()=>y(w,j)),j})}function _(w,I,D){I(" makeSpaceForEdgeLabels",()=>M(w)),I(" removeSelfEdges",()=>U(w)),I(" acyclic",()=>n.run(w)),I(" nestingGraph.run",()=>l.run(w)),I(" rank",()=>o(h.asNonCompoundGraph(w))),I(" injectEdgeLabelProxies",()=>C(w)),I(" removeEmptyRanks",()=>a(w)),I(" nestingGraph.cleanup",()=>l.cleanup(w)),I(" normalizeRanks",()=>i(w)),I(" assignRankMinMax",()=>F(w)),I(" removeEdgeLabelProxies",()=>E(w)),I(" normalize.run",()=>r.run(w)),I(" parentDummyChains",()=>s(w)),I(" addBorderSegments",()=>u(w)),I(" order",()=>d(w,D)),I(" insertSelfEdges",()=>K(w)),I(" adjustCoordinateSystem",()=>c.adjust(w)),I(" position",()=>f(w)),I(" positionSelfEdges",()=>J(w)),I(" removeBorderNodes",()=>G(w)),I(" normalize.undo",()=>r.undo(w)),I(" fixupEdgeLabelCoords",()=>V(w)),I(" undoCoordinateSystem",()=>c.undo(w)),I(" translateGraph",()=>$(w)),I(" assignNodeIntersects",()=>A(w)),I(" reversePoints",()=>z(w)),I(" acyclic.undo",()=>n.undo(w))}function y(w,I){w.nodes().forEach(D=>{let j=w.node(D),Q=I.node(D);j&&(j.x=Q.x,j.y=Q.y,j.order=Q.order,j.rank=Q.rank,I.children(D).length&&(j.width=Q.width,j.height=Q.height))}),w.edges().forEach(D=>{let j=w.edge(D),Q=I.edge(D);j.points=Q.points,Object.hasOwn(Q,"x")&&(j.x=Q.x,j.y=Q.y)}),w.graph().width=I.graph().width,w.graph().height=I.graph().height}var g=["nodesep","edgesep","ranksep","marginx","marginy"],m={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb",rankalign:"center"},v=["acyclicer","ranker","rankdir","align","rankalign"],x=["width","height","rank"],L={width:0,height:0},P=["minlen","weight","width","height","labeloffset"],O={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},W=["labelpos"];function N(w){let I=new p({multigraph:!0,compound:!0}),D=S(w.graph());return I.setGraph(Object.assign({},m,q(D,g),h.pick(D,v))),w.nodes().forEach(j=>{let Q=S(w.node(j)),ne=q(Q,x);Object.keys(L).forEach(oe=>{ne[oe]===void 0&&(ne[oe]=L[oe])}),I.setNode(j,ne),I.setParent(j,w.parent(j))}),w.edges().forEach(j=>{let Q=S(w.edge(j));I.setEdge(j,Object.assign({},O,q(Q,P),h.pick(Q,W)))}),I}function M(w){let I=w.graph();I.ranksep/=2,w.edges().forEach(D=>{let j=w.edge(D);j.minlen*=2,j.labelpos.toLowerCase()!=="c"&&(I.rankdir==="TB"||I.rankdir==="BT"?j.width+=j.labeloffset:j.height+=j.labeloffset)})}function C(w){w.edges().forEach(I=>{let D=w.edge(I);if(D.width&&D.height){let j=w.node(I.v),Q={rank:(w.node(I.w).rank-j.rank)/2+j.rank,e:I};h.addDummyNode(w,"edge-proxy",Q,"_ep")}})}function F(w){let I=0;w.nodes().forEach(D=>{let j=w.node(D);j.borderTop&&(j.minRank=w.node(j.borderTop).rank,j.maxRank=w.node(j.borderBottom).rank,I=Math.max(I,j.maxRank))}),w.graph().maxRank=I}function E(w){w.nodes().forEach(I=>{let D=w.node(I);D.dummy==="edge-proxy"&&(w.edge(D.e).labelRank=D.rank,w.removeNode(I))})}function $(w){let I=Number.POSITIVE_INFINITY,D=0,j=Number.POSITIVE_INFINITY,Q=0,ne=w.graph(),oe=ne.marginx||0,ae=ne.marginy||0;function ge(B){let R=B.x,H=B.y,Z=B.width,Y=B.height;I=Math.min(I,R-Z/2),D=Math.max(D,R+Z/2),j=Math.min(j,H-Y/2),Q=Math.max(Q,H+Y/2)}w.nodes().forEach(B=>ge(w.node(B))),w.edges().forEach(B=>{let R=w.edge(B);Object.hasOwn(R,"x")&&ge(R)}),I-=oe,j-=ae,w.nodes().forEach(B=>{let R=w.node(B);R.x-=I,R.y-=j}),w.edges().forEach(B=>{let R=w.edge(B);R.points.forEach(H=>{H.x-=I,H.y-=j}),Object.hasOwn(R,"x")&&(R.x-=I),Object.hasOwn(R,"y")&&(R.y-=j)}),ne.width=D-I+oe,ne.height=Q-j+ae}function A(w){w.edges().forEach(I=>{let D=w.edge(I),j=w.node(I.v),Q=w.node(I.w),ne,oe;D.points?(ne=D.points[0],oe=D.points[D.points.length-1]):(D.points=[],ne=Q,oe=j),D.points.unshift(h.intersectRect(j,ne)),D.points.push(h.intersectRect(Q,oe))})}function V(w){w.edges().forEach(I=>{let D=w.edge(I);if(Object.hasOwn(D,"x"))switch((D.labelpos==="l"||D.labelpos==="r")&&(D.width-=D.labeloffset),D.labelpos){case"l":D.x-=D.width/2+D.labeloffset;break;case"r":D.x+=D.width/2+D.labeloffset;break}})}function z(w){w.edges().forEach(I=>{let D=w.edge(I);D.reversed&&D.points.reverse()})}function G(w){w.nodes().forEach(I=>{if(w.children(I).length){let D=w.node(I),j=w.node(D.borderTop),Q=w.node(D.borderBottom),ne=w.node(D.borderLeft[D.borderLeft.length-1]),oe=w.node(D.borderRight[D.borderRight.length-1]);D.width=Math.abs(oe.x-ne.x),D.height=Math.abs(Q.y-j.y),D.x=ne.x+D.width/2,D.y=j.y+D.height/2}}),w.nodes().forEach(I=>{w.node(I).dummy==="border"&&w.removeNode(I)})}function U(w){w.edges().forEach(I=>{if(I.v===I.w){var D=w.node(I.v);D.selfEdges||(D.selfEdges=[]),D.selfEdges.push({e:I,label:w.edge(I)}),w.removeEdge(I)}})}function K(w){var I=h.buildLayerMatrix(w);I.forEach(D=>{var j=0;D.forEach((Q,ne)=>{var oe=w.node(Q);oe.order=ne+j,(oe.selfEdges||[]).forEach(ae=>{h.addDummyNode(w,"selfedge",{width:ae.label.width,height:ae.label.height,rank:oe.rank,order:ne+ ++j,e:ae.e,label:ae.label},"_se")}),delete oe.selfEdges})})}function J(w){w.nodes().forEach(I=>{var D=w.node(I);if(D.dummy==="selfedge"){var j=w.node(D.e.v),Q=j.x+j.width/2,ne=j.y,oe=D.x-Q,ae=j.height/2;w.setEdge(D.e,D.label),w.removeNode(I),D.label.points=[{x:Q+2*oe/3,y:ne-ae},{x:Q+5*oe/6,y:ne-ae},{x:Q+oe,y:ne},{x:Q+5*oe/6,y:ne+ae},{x:Q+2*oe/3,y:ne+ae}],D.label.x=D.x,D.label.y=D.y}})}function q(w,I){return h.mapValues(h.pick(w,I),Number)}function S(w){var I={};return w&&Object.entries(w).forEach(([D,j])=>{typeof D=="string"&&(D=D.toLowerCase()),I[D]=j}),I}}),yw=Ne((e,t)=>{var n=He(),r=wt().Graph;t.exports={debugOrdering:o};function o(i){let s=n.buildLayerMatrix(i),a=new r({compound:!0,multigraph:!0}).setGraph({});return i.nodes().forEach(l=>{a.setNode(l,{label:l}),a.setParent(l,"layer"+i.node(l).rank)}),i.edges().forEach(l=>a.setEdge(l.v,l.w,{},l.name)),s.forEach((l,u)=>{let c="layer"+u;a.setNode(c,{rank:"same"}),l.reduce((d,f)=>(a.setEdge(d,f,{style:"invis"}),f))}),a}}),_w=Ne((e,t)=>{t.exports="2.0.4"}),bw=Ne((e,t)=>{t.exports={graphlib:wt(),layout:vw(),debug:yw(),util:{time:He().time,notime:He().notime},version:_w()}});const cu=bw();function Vr(e){return _a()?(kr(e),!0):!1}function Ht(e){return typeof e=="function"?e():k(e)}const ww=typeof window<"u"&&typeof document<"u",Ew=e=>typeof e<"u",xw=Object.prototype.toString,kw=e=>xw.call(e)==="[object Object]",Cw=()=>{};function Sw(e,t){function n(...r){return new Promise((o,i)=>{Promise.resolve(e(()=>t.apply(this,r),{fn:t,thisArg:this,args:r})).then(o).catch(i)})}return n}const nf=e=>e();function Tw(e=nf){const t=fe(!0);function n(){t.value=!1}function r(){t.value=!0}const o=(...i)=>{t.value&&e(...i)};return{isActive:Jh(t),pause:n,resume:r,eventFilter:o}}function du(e,t=!1,n="Timeout"){return new Promise((r,o)=>{setTimeout(t?()=>o(n):r,e)})}function Aw(e,t,n={}){const{eventFilter:r=nf,...o}=n;return xe(e,Sw(r,t),o)}function $n(e,t,n={}){const{eventFilter:r,...o}=n,{eventFilter:i,pause:s,resume:a,isActive:l}=Tw(r);return{stop:Aw(e,t,{...o,eventFilter:i}),pause:s,resume:a,isActive:l}}function Lw(e,t={}){if(!wa(e))return Yr(e);const n=Array.isArray(e.value)?Array.from({length:e.value.length}):{};for(const r in e.value)n[r]=Qh(()=>({get(){return e.value[r]},set(o){var i;if((i=Ht(t.replaceRef))!=null?i:!0)if(Array.isArray(e.value)){const a=[...e.value];a[r]=o,e.value=a}else{const a={...e.value,[r]:o};Object.setPrototypeOf(a,Object.getPrototypeOf(e.value)),e.value=a}else e.value[r]=o}}));return n}function Ys(e,t=!1){function n(d,{flush:f="sync",deep:h=!1,timeout:p,throwOnTimeout:b}={}){let _=null;const g=[new Promise(m=>{_=xe(e,v=>{d(v)!==t&&(_?.(),m(v))},{flush:f,deep:h,immediate:!0})})];return p!=null&&g.push(du(p,b).then(()=>Ht(e)).finally(()=>_?.())),Promise.race(g)}function r(d,f){if(!wa(d))return n(v=>v===d,f);const{flush:h="sync",deep:p=!1,timeout:b,throwOnTimeout:_}=f??{};let y=null;const m=[new Promise(v=>{y=xe([e,d],([x,L])=>{t!==(x===L)&&(y?.(),v(x))},{flush:h,deep:p,immediate:!0})})];return b!=null&&m.push(du(b,_).then(()=>Ht(e)).finally(()=>(y?.(),Ht(e)))),Promise.race(m)}function o(d){return n(f=>!!f,d)}function i(d){return r(null,d)}function s(d){return r(void 0,d)}function a(d){return n(Number.isNaN,d)}function l(d,f){return n(h=>{const p=Array.from(h);return p.includes(d)||p.includes(Ht(d))},f)}function u(d){return c(1,d)}function c(d=1,f){let h=-1;return n(()=>(h+=1,h>=d),f)}return Array.isArray(Ht(e))?{toMatch:n,toContains:l,changed:u,changedTimes:c,get not(){return Ys(e,!t)}}:{toMatch:n,toBe:r,toBeTruthy:o,toBeNull:i,toBeNaN:a,toBeUndefined:s,changed:u,changedTimes:c,get not(){return Ys(e,!t)}}}function Xs(e){return Ys(e)}function Iw(e){var t;const n=Ht(e);return(t=n?.$el)!=null?t:n}const rf=ww?window:void 0;function of(...e){let t,n,r,o;if(typeof e[0]=="string"||Array.isArray(e[0])?([n,r,o]=e,t=rf):[t,n,r,o]=e,!t)return Cw;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);const i=[],s=()=>{i.forEach(c=>c()),i.length=0},a=(c,d,f,h)=>(c.addEventListener(d,f,h),()=>c.removeEventListener(d,f,h)),l=xe(()=>[Iw(t),Ht(o)],([c,d])=>{if(s(),!c)return;const f=kw(d)?{...d}:d;i.push(...n.flatMap(h=>r.map(p=>a(c,h,p,f))))},{immediate:!0,flush:"post"}),u=()=>{l(),s()};return Vr(u),u}function Pw(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function fu(...e){let t,n,r={};e.length===3?(t=e[0],n=e[1],r=e[2]):e.length===2?typeof e[1]=="object"?(t=!0,n=e[0],r=e[1]):(t=e[0],n=e[1]):(t=!0,n=e[0]);const{target:o=rf,eventName:i="keydown",passive:s=!1,dedupe:a=!1}=r,l=Pw(t);return of(o,i,c=>{c.repeat&&Ht(a)||l(c)&&n(c)},s)}function Nw(e){return JSON.parse(JSON.stringify(e))}function ts(e,t,n,r={}){var o,i,s;const{clone:a=!1,passive:l=!1,eventName:u,deep:c=!1,defaultValue:d,shouldEmit:f}=r,h=ur(),p=n||h?.emit||((o=h?.$emit)==null?void 0:o.bind(h))||((s=(i=h?.proxy)==null?void 0:i.$emit)==null?void 0:s.bind(h?.proxy));let b=u;t||(t="modelValue"),b=b||`update:${t.toString()}`;const _=m=>a?typeof a=="function"?a(m):Nw(m):m,y=()=>Ew(e[t])?_(e[t]):d,g=m=>{f?f(m)&&p(b,m):p(b,m)};if(l){const m=y(),v=fe(m);let x=!1;return xe(()=>e[t],L=>{x||(x=!0,v.value=_(L),yt(()=>x=!1))}),xe(v,L=>{!x&&(L!==e[t]||c)&&g(L)},{deep:c}),v}else return te({get(){return y()},set(m){g(m)}})}var Rw={value:()=>{}};function Ai(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Lo(n)}function Lo(e){this._=e}function Mw(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",o=n.indexOf(".");if(o>=0&&(r=n.slice(o+1),n=n.slice(0,o)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Lo.prototype=Ai.prototype={constructor:Lo,on:function(e,t){var n=this._,r=Mw(e+"",n),o,i=-1,s=r.length;if(arguments.length<2){for(;++i<s;)if((o=(e=r[i]).type)&&(o=Ow(n[o],e.name)))return o;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<s;)if(o=(e=r[i]).type)n[o]=hu(n[o],e.name,t);else if(t==null)for(o in n)n[o]=hu(n[o],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Lo(e)},call:function(e,t){if((o=arguments.length-2)>0)for(var n=new Array(o),r=0,o,i;r<o;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],r=0,o=i.length;r<o;++r)i[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],o=0,i=r.length;o<i;++o)r[o].value.apply(t,n)}};function Ow(e,t){for(var n=0,r=e.length,o;n<r;++n)if((o=e[n]).name===t)return o.value}function hu(e,t,n){for(var r=0,o=e.length;r<o;++r)if(e[r].name===t){e[r]=Rw,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Ks="http://www.w3.org/1999/xhtml";const pu={svg:"http://www.w3.org/2000/svg",xhtml:Ks,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Li(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),pu.hasOwnProperty(t)?{space:pu[t],local:e}:e}function Dw(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Ks&&t.documentElement.namespaceURI===Ks?t.createElement(e):t.createElementNS(n,e)}}function $w(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function sf(e){var t=Li(e);return(t.local?$w:Dw)(t)}function Vw(){}function qa(e){return e==null?Vw:function(){return this.querySelector(e)}}function Bw(e){typeof e!="function"&&(e=qa(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,a=r[o]=new Array(s),l,u,c=0;c<s;++c)(l=i[c])&&(u=e.call(l,l.__data__,c,i))&&("__data__"in l&&(u.__data__=l.__data__),a[c]=u);return new dt(r,this._parents)}function Fw(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function zw(){return[]}function af(e){return e==null?zw:function(){return this.querySelectorAll(e)}}function Hw(e){return function(){return Fw(e.apply(this,arguments))}}function Gw(e){typeof e=="function"?e=Hw(e):e=af(e);for(var t=this._groups,n=t.length,r=[],o=[],i=0;i<n;++i)for(var s=t[i],a=s.length,l,u=0;u<a;++u)(l=s[u])&&(r.push(e.call(l,l.__data__,u,s)),o.push(l));return new dt(r,o)}function lf(e){return function(){return this.matches(e)}}function uf(e){return function(t){return t.matches(e)}}var jw=Array.prototype.find;function Uw(e){return function(){return jw.call(this.children,e)}}function Ww(){return this.firstElementChild}function qw(e){return this.select(e==null?Ww:Uw(typeof e=="function"?e:uf(e)))}var Yw=Array.prototype.filter;function Xw(){return Array.from(this.children)}function Kw(e){return function(){return Yw.call(this.children,e)}}function Zw(e){return this.selectAll(e==null?Xw:Kw(typeof e=="function"?e:uf(e)))}function Qw(e){typeof e!="function"&&(e=lf(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,a=r[o]=[],l,u=0;u<s;++u)(l=i[u])&&e.call(l,l.__data__,u,i)&&a.push(l);return new dt(r,this._parents)}function cf(e){return new Array(e.length)}function Jw(){return new dt(this._enter||this._groups.map(cf),this._parents)}function Jo(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Jo.prototype={constructor:Jo,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function e1(e){return function(){return e}}function t1(e,t,n,r,o,i){for(var s=0,a,l=t.length,u=i.length;s<u;++s)(a=t[s])?(a.__data__=i[s],r[s]=a):n[s]=new Jo(e,i[s]);for(;s<l;++s)(a=t[s])&&(o[s]=a)}function n1(e,t,n,r,o,i,s){var a,l,u=new Map,c=t.length,d=i.length,f=new Array(c),h;for(a=0;a<c;++a)(l=t[a])&&(f[a]=h=s.call(l,l.__data__,a,t)+"",u.has(h)?o[a]=l:u.set(h,l));for(a=0;a<d;++a)h=s.call(e,i[a],a,i)+"",(l=u.get(h))?(r[a]=l,l.__data__=i[a],u.delete(h)):n[a]=new Jo(e,i[a]);for(a=0;a<c;++a)(l=t[a])&&u.get(f[a])===l&&(o[a]=l)}function r1(e){return e.__data__}function o1(e,t){if(!arguments.length)return Array.from(this,r1);var n=t?n1:t1,r=this._parents,o=this._groups;typeof e!="function"&&(e=e1(e));for(var i=o.length,s=new Array(i),a=new Array(i),l=new Array(i),u=0;u<i;++u){var c=r[u],d=o[u],f=d.length,h=i1(e.call(c,c&&c.__data__,u,r)),p=h.length,b=a[u]=new Array(p),_=s[u]=new Array(p),y=l[u]=new Array(f);n(c,d,b,_,y,h,t);for(var g=0,m=0,v,x;g<p;++g)if(v=b[g]){for(g>=m&&(m=g+1);!(x=_[m])&&++m<p;);v._next=x||null}}return s=new dt(s,r),s._enter=a,s._exit=l,s}function i1(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function s1(){return new dt(this._exit||this._groups.map(cf),this._parents)}function a1(e,t,n){var r=this.enter(),o=this,i=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(o=t(o),o&&(o=o.selection())),n==null?i.remove():n(i),r&&o?r.merge(o).order():o}function l1(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,o=n.length,i=r.length,s=Math.min(o,i),a=new Array(o),l=0;l<s;++l)for(var u=n[l],c=r[l],d=u.length,f=a[l]=new Array(d),h,p=0;p<d;++p)(h=u[p]||c[p])&&(f[p]=h);for(;l<o;++l)a[l]=n[l];return new dt(a,this._parents)}function u1(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],o=r.length-1,i=r[o],s;--o>=0;)(s=r[o])&&(i&&s.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(s,i),i=s);return this}function c1(e){e||(e=d1);function t(d,f){return d&&f?e(d.__data__,f.__data__):!d-!f}for(var n=this._groups,r=n.length,o=new Array(r),i=0;i<r;++i){for(var s=n[i],a=s.length,l=o[i]=new Array(a),u,c=0;c<a;++c)(u=s[c])&&(l[c]=u);l.sort(t)}return new dt(o,this._parents).order()}function d1(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function f1(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function h1(){return Array.from(this)}function p1(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,i=r.length;o<i;++o){var s=r[o];if(s)return s}return null}function m1(){let e=0;for(const t of this)++e;return e}function g1(){return!this.node()}function v1(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var o=t[n],i=0,s=o.length,a;i<s;++i)(a=o[i])&&e.call(a,a.__data__,i,o);return this}function y1(e){return function(){this.removeAttribute(e)}}function _1(e){return function(){this.removeAttributeNS(e.space,e.local)}}function b1(e,t){return function(){this.setAttribute(e,t)}}function w1(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function E1(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function x1(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function k1(e,t){var n=Li(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?_1:y1:typeof t=="function"?n.local?x1:E1:n.local?w1:b1)(n,t))}function df(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function C1(e){return function(){this.style.removeProperty(e)}}function S1(e,t,n){return function(){this.style.setProperty(e,t,n)}}function T1(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function A1(e,t,n){return arguments.length>1?this.each((t==null?C1:typeof t=="function"?T1:S1)(e,t,n??"")):tr(this.node(),e)}function tr(e,t){return e.style.getPropertyValue(t)||df(e).getComputedStyle(e,null).getPropertyValue(t)}function L1(e){return function(){delete this[e]}}function I1(e,t){return function(){this[e]=t}}function P1(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function N1(e,t){return arguments.length>1?this.each((t==null?L1:typeof t=="function"?P1:I1)(e,t)):this.node()[e]}function ff(e){return e.trim().split(/^|\s+/)}function Ya(e){return e.classList||new hf(e)}function hf(e){this._node=e,this._names=ff(e.getAttribute("class")||"")}hf.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function pf(e,t){for(var n=Ya(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function mf(e,t){for(var n=Ya(e),r=-1,o=t.length;++r<o;)n.remove(t[r])}function R1(e){return function(){pf(this,e)}}function M1(e){return function(){mf(this,e)}}function O1(e,t){return function(){(t.apply(this,arguments)?pf:mf)(this,e)}}function D1(e,t){var n=ff(e+"");if(arguments.length<2){for(var r=Ya(this.node()),o=-1,i=n.length;++o<i;)if(!r.contains(n[o]))return!1;return!0}return this.each((typeof t=="function"?O1:t?R1:M1)(n,t))}function $1(){this.textContent=""}function V1(e){return function(){this.textContent=e}}function B1(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function F1(e){return arguments.length?this.each(e==null?$1:(typeof e=="function"?B1:V1)(e)):this.node().textContent}function z1(){this.innerHTML=""}function H1(e){return function(){this.innerHTML=e}}function G1(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function j1(e){return arguments.length?this.each(e==null?z1:(typeof e=="function"?G1:H1)(e)):this.node().innerHTML}function U1(){this.nextSibling&&this.parentNode.appendChild(this)}function W1(){return this.each(U1)}function q1(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Y1(){return this.each(q1)}function X1(e){var t=typeof e=="function"?e:sf(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function K1(){return null}function Z1(e,t){var n=typeof e=="function"?e:sf(e),r=t==null?K1:typeof t=="function"?t:qa(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Q1(){var e=this.parentNode;e&&e.removeChild(this)}function J1(){return this.each(Q1)}function eE(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function tE(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function nE(e){return this.select(e?tE:eE)}function rE(e){return arguments.length?this.property("__data__",e):this.node().__data__}function oE(e){return function(t){e.call(this,t,this.__data__)}}function iE(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function sE(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,o=t.length,i;n<o;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++r]=i;++r?t.length=r:delete this.__on}}}function aE(e,t,n){return function(){var r=this.__on,o,i=oE(t);if(r){for(var s=0,a=r.length;s<a;++s)if((o=r[s]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=i,o.options=n),o.value=t;return}}this.addEventListener(e.type,i,n),o={type:e.type,name:e.name,value:t,listener:i,options:n},r?r.push(o):this.__on=[o]}}function lE(e,t,n){var r=iE(e+""),o,i=r.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var l=0,u=a.length,c;l<u;++l)for(o=0,c=a[l];o<i;++o)if((s=r[o]).type===c.type&&s.name===c.name)return c.value}return}for(a=t?aE:sE,o=0;o<i;++o)this.each(a(r[o],t,n));return this}function gf(e,t,n){var r=df(e),o=r.CustomEvent;typeof o=="function"?o=new o(t,n):(o=r.document.createEvent("Event"),n?(o.initEvent(t,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function uE(e,t){return function(){return gf(this,e,t)}}function cE(e,t){return function(){return gf(this,e,t.apply(this,arguments))}}function dE(e,t){return this.each((typeof t=="function"?cE:uE)(e,t))}function*fE(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,i=r.length,s;o<i;++o)(s=r[o])&&(yield s)}var vf=[null];function dt(e,t){this._groups=e,this._parents=t}function no(){return new dt([[document.documentElement]],vf)}function hE(){return this}dt.prototype=no.prototype={constructor:dt,select:Bw,selectAll:Gw,selectChild:qw,selectChildren:Zw,filter:Qw,data:o1,enter:Jw,exit:s1,join:a1,merge:l1,selection:hE,order:u1,sort:c1,call:f1,nodes:h1,node:p1,size:m1,empty:g1,each:v1,attr:k1,style:A1,property:N1,classed:D1,text:F1,html:j1,raise:W1,lower:Y1,append:X1,insert:Z1,remove:J1,clone:nE,datum:rE,on:lE,dispatch:dE,[Symbol.iterator]:fE};function gt(e){return typeof e=="string"?new dt([[document.querySelector(e)]],[document.documentElement]):new dt([[e]],vf)}function pE(e){let t;for(;t=e.sourceEvent;)e=t;return e}function St(e,t){if(e=pE(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}const mE={passive:!1},Br={capture:!0,passive:!1};function ns(e){e.stopImmediatePropagation()}function Xn(e){e.preventDefault(),e.stopImmediatePropagation()}function yf(e){var t=e.document.documentElement,n=gt(e).on("dragstart.drag",Xn,Br);"onselectstart"in t?n.on("selectstart.drag",Xn,Br):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function _f(e,t){var n=e.document.documentElement,r=gt(e).on("dragstart.drag",null);t&&(r.on("click.drag",Xn,Br),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const po=e=>()=>e;function Zs(e,{sourceEvent:t,subject:n,target:r,identifier:o,active:i,x:s,y:a,dx:l,dy:u,dispatch:c}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:c}})}Zs.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function gE(e){return!e.ctrlKey&&!e.button}function vE(){return this.parentNode}function yE(e,t){return t??{x:e.x,y:e.y}}function _E(){return navigator.maxTouchPoints||"ontouchstart"in this}function bE(){var e=gE,t=vE,n=yE,r=_E,o={},i=Ai("start","drag","end"),s=0,a,l,u,c,d=0;function f(v){v.on("mousedown.drag",h).filter(r).on("touchstart.drag",_).on("touchmove.drag",y,mE).on("touchend.drag touchcancel.drag",g).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(v,x){if(!(c||!e.call(this,v,x))){var L=m(this,t.call(this,v,x),v,x,"mouse");L&&(gt(v.view).on("mousemove.drag",p,Br).on("mouseup.drag",b,Br),yf(v.view),ns(v),u=!1,a=v.clientX,l=v.clientY,L("start",v))}}function p(v){if(Xn(v),!u){var x=v.clientX-a,L=v.clientY-l;u=x*x+L*L>d}o.mouse("drag",v)}function b(v){gt(v.view).on("mousemove.drag mouseup.drag",null),_f(v.view,u),Xn(v),o.mouse("end",v)}function _(v,x){if(e.call(this,v,x)){var L=v.changedTouches,P=t.call(this,v,x),O=L.length,W,N;for(W=0;W<O;++W)(N=m(this,P,v,x,L[W].identifier,L[W]))&&(ns(v),N("start",v,L[W]))}}function y(v){var x=v.changedTouches,L=x.length,P,O;for(P=0;P<L;++P)(O=o[x[P].identifier])&&(Xn(v),O("drag",v,x[P]))}function g(v){var x=v.changedTouches,L=x.length,P,O;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),P=0;P<L;++P)(O=o[x[P].identifier])&&(ns(v),O("end",v,x[P]))}function m(v,x,L,P,O,W){var N=i.copy(),M=St(W||L,x),C,F,E;if((E=n.call(v,new Zs("beforestart",{sourceEvent:L,target:f,identifier:O,active:s,x:M[0],y:M[1],dx:0,dy:0,dispatch:N}),P))!=null)return C=E.x-M[0]||0,F=E.y-M[1]||0,function $(A,V,z){var G=M,U;switch(A){case"start":o[O]=$,U=s++;break;case"end":delete o[O],--s;case"drag":M=St(z||V,x),U=s;break}N.call(A,v,new Zs(A,{sourceEvent:V,subject:E,target:f,identifier:O,active:U,x:M[0]+C,y:M[1]+F,dx:M[0]-G[0],dy:M[1]-G[1],dispatch:N}),P)}}return f.filter=function(v){return arguments.length?(e=typeof v=="function"?v:po(!!v),f):e},f.container=function(v){return arguments.length?(t=typeof v=="function"?v:po(v),f):t},f.subject=function(v){return arguments.length?(n=typeof v=="function"?v:po(v),f):n},f.touchable=function(v){return arguments.length?(r=typeof v=="function"?v:po(!!v),f):r},f.on=function(){var v=i.on.apply(i,arguments);return v===i?f:v},f.clickDistance=function(v){return arguments.length?(d=(v=+v)*v,f):Math.sqrt(d)},f}function Xa(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function bf(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function ro(){}var Fr=.7,ei=1/Fr,Kn="\\s*([+-]?\\d+)\\s*",zr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Mt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",wE=/^#([0-9a-f]{3,8})$/,EE=new RegExp(`^rgb\\(${Kn},${Kn},${Kn}\\)$`),xE=new RegExp(`^rgb\\(${Mt},${Mt},${Mt}\\)$`),kE=new RegExp(`^rgba\\(${Kn},${Kn},${Kn},${zr}\\)$`),CE=new RegExp(`^rgba\\(${Mt},${Mt},${Mt},${zr}\\)$`),SE=new RegExp(`^hsl\\(${zr},${Mt},${Mt}\\)$`),TE=new RegExp(`^hsla\\(${zr},${Mt},${Mt},${zr}\\)$`),mu={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Xa(ro,Tn,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:gu,formatHex:gu,formatHex8:AE,formatHsl:LE,formatRgb:vu,toString:vu});function gu(){return this.rgb().formatHex()}function AE(){return this.rgb().formatHex8()}function LE(){return wf(this).formatHsl()}function vu(){return this.rgb().formatRgb()}function Tn(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=wE.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?yu(t):n===3?new ot(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?mo(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?mo(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=EE.exec(e))?new ot(t[1],t[2],t[3],1):(t=xE.exec(e))?new ot(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=kE.exec(e))?mo(t[1],t[2],t[3],t[4]):(t=CE.exec(e))?mo(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=SE.exec(e))?wu(t[1],t[2]/100,t[3]/100,1):(t=TE.exec(e))?wu(t[1],t[2]/100,t[3]/100,t[4]):mu.hasOwnProperty(e)?yu(mu[e]):e==="transparent"?new ot(NaN,NaN,NaN,0):null}function yu(e){return new ot(e>>16&255,e>>8&255,e&255,1)}function mo(e,t,n,r){return r<=0&&(e=t=n=NaN),new ot(e,t,n,r)}function IE(e){return e instanceof ro||(e=Tn(e)),e?(e=e.rgb(),new ot(e.r,e.g,e.b,e.opacity)):new ot}function Qs(e,t,n,r){return arguments.length===1?IE(e):new ot(e,t,n,r??1)}function ot(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Xa(ot,Qs,bf(ro,{brighter(e){return e=e==null?ei:Math.pow(ei,e),new ot(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Fr:Math.pow(Fr,e),new ot(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ot(xn(this.r),xn(this.g),xn(this.b),ti(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:_u,formatHex:_u,formatHex8:PE,formatRgb:bu,toString:bu}));function _u(){return`#${bn(this.r)}${bn(this.g)}${bn(this.b)}`}function PE(){return`#${bn(this.r)}${bn(this.g)}${bn(this.b)}${bn((isNaN(this.opacity)?1:this.opacity)*255)}`}function bu(){const e=ti(this.opacity);return`${e===1?"rgb(":"rgba("}${xn(this.r)}, ${xn(this.g)}, ${xn(this.b)}${e===1?")":`, ${e})`}`}function ti(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function xn(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function bn(e){return e=xn(e),(e<16?"0":"")+e.toString(16)}function wu(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new vt(e,t,n,r)}function wf(e){if(e instanceof vt)return new vt(e.h,e.s,e.l,e.opacity);if(e instanceof ro||(e=Tn(e)),!e)return new vt;if(e instanceof vt)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),i=Math.max(t,n,r),s=NaN,a=i-o,l=(i+o)/2;return a?(t===i?s=(n-r)/a+(n<r)*6:n===i?s=(r-t)/a+2:s=(t-n)/a+4,a/=l<.5?i+o:2-i-o,s*=60):a=l>0&&l<1?0:s,new vt(s,a,l,e.opacity)}function NE(e,t,n,r){return arguments.length===1?wf(e):new vt(e,t,n,r??1)}function vt(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Xa(vt,NE,bf(ro,{brighter(e){return e=e==null?ei:Math.pow(ei,e),new vt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Fr:Math.pow(Fr,e),new vt(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,o=2*n-r;return new ot(rs(e>=240?e-240:e+120,o,r),rs(e,o,r),rs(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new vt(Eu(this.h),go(this.s),go(this.l),ti(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=ti(this.opacity);return`${e===1?"hsl(":"hsla("}${Eu(this.h)}, ${go(this.s)*100}%, ${go(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Eu(e){return e=(e||0)%360,e<0?e+360:e}function go(e){return Math.max(0,Math.min(1,e||0))}function rs(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Ka=e=>()=>e;function RE(e,t){return function(n){return e+n*t}}function ME(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function OE(e){return(e=+e)==1?Ef:function(t,n){return n-t?ME(t,n,e):Ka(isNaN(t)?n:t)}}function Ef(e,t){var n=t-e;return n?RE(e,n):Ka(isNaN(e)?t:e)}const ni=(function e(t){var n=OE(t);function r(o,i){var s=n((o=Qs(o)).r,(i=Qs(i)).r),a=n(o.g,i.g),l=n(o.b,i.b),u=Ef(o.opacity,i.opacity);return function(c){return o.r=s(c),o.g=a(c),o.b=l(c),o.opacity=u(c),o+""}}return r.gamma=e,r})(1);function DE(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),o;return function(i){for(o=0;o<n;++o)r[o]=e[o]*(1-i)+t[o]*i;return r}}function $E(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function VE(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,o=new Array(r),i=new Array(n),s;for(s=0;s<r;++s)o[s]=Ar(e[s],t[s]);for(;s<n;++s)i[s]=t[s];return function(a){for(s=0;s<r;++s)i[s]=o[s](a);return i}}function BE(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Tt(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function FE(e,t){var n={},r={},o;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(o in t)o in e?n[o]=Ar(e[o],t[o]):r[o]=t[o];return function(i){for(o in n)r[o]=n[o](i);return r}}var Js=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,os=new RegExp(Js.source,"g");function zE(e){return function(){return e}}function HE(e){return function(t){return e(t)+""}}function xf(e,t){var n=Js.lastIndex=os.lastIndex=0,r,o,i,s=-1,a=[],l=[];for(e=e+"",t=t+"";(r=Js.exec(e))&&(o=os.exec(t));)(i=o.index)>n&&(i=t.slice(n,i),a[s]?a[s]+=i:a[++s]=i),(r=r[0])===(o=o[0])?a[s]?a[s]+=o:a[++s]=o:(a[++s]=null,l.push({i:s,x:Tt(r,o)})),n=os.lastIndex;return n<t.length&&(i=t.slice(n),a[s]?a[s]+=i:a[++s]=i),a.length<2?l[0]?HE(l[0].x):zE(t):(t=l.length,function(u){for(var c=0,d;c<t;++c)a[(d=l[c]).i]=d.x(u);return a.join("")})}function Ar(e,t){var n=typeof t,r;return t==null||n==="boolean"?Ka(t):(n==="number"?Tt:n==="string"?(r=Tn(t))?(t=r,ni):xf:t instanceof Tn?ni:t instanceof Date?BE:$E(t)?DE:Array.isArray(t)?VE:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?FE:Tt)(e,t)}var xu=180/Math.PI,ea={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function kf(e,t,n,r,o,i){var s,a,l;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(l=e*n+t*r)&&(n-=e*l,r-=t*l),(a=Math.sqrt(n*n+r*r))&&(n/=a,r/=a,l/=a),e*r<t*n&&(e=-e,t=-t,l=-l,s=-s),{translateX:o,translateY:i,rotate:Math.atan2(t,e)*xu,skewX:Math.atan(l)*xu,scaleX:s,scaleY:a}}var vo;function GE(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?ea:kf(t.a,t.b,t.c,t.d,t.e,t.f)}function jE(e){return e==null||(vo||(vo=document.createElementNS("http://www.w3.org/2000/svg","g")),vo.setAttribute("transform",e),!(e=vo.transform.baseVal.consolidate()))?ea:(e=e.matrix,kf(e.a,e.b,e.c,e.d,e.e,e.f))}function Cf(e,t,n,r){function o(u){return u.length?u.pop()+" ":""}function i(u,c,d,f,h,p){if(u!==d||c!==f){var b=h.push("translate(",null,t,null,n);p.push({i:b-4,x:Tt(u,d)},{i:b-2,x:Tt(c,f)})}else(d||f)&&h.push("translate("+d+t+f+n)}function s(u,c,d,f){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),f.push({i:d.push(o(d)+"rotate(",null,r)-2,x:Tt(u,c)})):c&&d.push(o(d)+"rotate("+c+r)}function a(u,c,d,f){u!==c?f.push({i:d.push(o(d)+"skewX(",null,r)-2,x:Tt(u,c)}):c&&d.push(o(d)+"skewX("+c+r)}function l(u,c,d,f,h,p){if(u!==d||c!==f){var b=h.push(o(h)+"scale(",null,",",null,")");p.push({i:b-4,x:Tt(u,d)},{i:b-2,x:Tt(c,f)})}else(d!==1||f!==1)&&h.push(o(h)+"scale("+d+","+f+")")}return function(u,c){var d=[],f=[];return u=e(u),c=e(c),i(u.translateX,u.translateY,c.translateX,c.translateY,d,f),s(u.rotate,c.rotate,d,f),a(u.skewX,c.skewX,d,f),l(u.scaleX,u.scaleY,c.scaleX,c.scaleY,d,f),u=c=null,function(h){for(var p=-1,b=f.length,_;++p<b;)d[(_=f[p]).i]=_.x(h);return d.join("")}}}var UE=Cf(GE,"px, ","px)","deg)"),WE=Cf(jE,", ",")",")"),qE=1e-12;function ku(e){return((e=Math.exp(e))+1/e)/2}function YE(e){return((e=Math.exp(e))-1/e)/2}function XE(e){return((e=Math.exp(2*e))-1)/(e+1)}const Io=(function e(t,n,r){function o(i,s){var a=i[0],l=i[1],u=i[2],c=s[0],d=s[1],f=s[2],h=c-a,p=d-l,b=h*h+p*p,_,y;if(b<qE)y=Math.log(f/u)/t,_=function(P){return[a+P*h,l+P*p,u*Math.exp(t*P*y)]};else{var g=Math.sqrt(b),m=(f*f-u*u+r*b)/(2*u*n*g),v=(f*f-u*u-r*b)/(2*f*n*g),x=Math.log(Math.sqrt(m*m+1)-m),L=Math.log(Math.sqrt(v*v+1)-v);y=(L-x)/t,_=function(P){var O=P*y,W=ku(x),N=u/(n*g)*(W*XE(t*O+x)-YE(x));return[a+N*h,l+N*p,u*W/ku(t*O+x)]}}return _.duration=y*1e3*t/Math.SQRT2,_}return o.rho=function(i){var s=Math.max(.001,+i),a=s*s,l=a*a;return e(s,a,l)},o})(Math.SQRT2,2,4);var nr=0,wr=0,vr=0,Sf=1e3,ri,Er,oi=0,An=0,Ii=0,Hr=typeof performance=="object"&&performance.now?performance:Date,Tf=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Za(){return An||(Tf(KE),An=Hr.now()+Ii)}function KE(){An=0}function ii(){this._call=this._time=this._next=null}ii.prototype=Af.prototype={constructor:ii,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Za():+n)+(t==null?0:+t),!this._next&&Er!==this&&(Er?Er._next=this:ri=this,Er=this),this._call=e,this._time=n,ta()},stop:function(){this._call&&(this._call=null,this._time=1/0,ta())}};function Af(e,t,n){var r=new ii;return r.restart(e,t,n),r}function ZE(){Za(),++nr;for(var e=ri,t;e;)(t=An-e._time)>=0&&e._call.call(void 0,t),e=e._next;--nr}function Cu(){An=(oi=Hr.now())+Ii,nr=wr=0;try{ZE()}finally{nr=0,JE(),An=0}}function QE(){var e=Hr.now(),t=e-oi;t>Sf&&(Ii-=t,oi=e)}function JE(){for(var e,t=ri,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:ri=n);Er=e,ta(r)}function ta(e){if(!nr){wr&&(wr=clearTimeout(wr));var t=e-An;t>24?(e<1/0&&(wr=setTimeout(Cu,e-Hr.now()-Ii)),vr&&(vr=clearInterval(vr))):(vr||(oi=Hr.now(),vr=setInterval(QE,Sf)),nr=1,Tf(Cu))}}function Su(e,t,n){var r=new ii;return t=t==null?0:+t,r.restart(o=>{r.stop(),e(o+t)},t,n),r}var ex=Ai("start","end","cancel","interrupt"),tx=[],Lf=0,Tu=1,na=2,Po=3,Au=4,ra=5,No=6;function Pi(e,t,n,r,o,i){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;nx(e,n,{name:t,index:r,group:o,on:ex,tween:tx,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:Lf})}function Qa(e,t){var n=Et(e,t);if(n.state>Lf)throw new Error("too late; already scheduled");return n}function Vt(e,t){var n=Et(e,t);if(n.state>Po)throw new Error("too late; already running");return n}function Et(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function nx(e,t,n){var r=e.__transition,o;r[t]=n,n.timer=Af(i,0,n.time);function i(u){n.state=Tu,n.timer.restart(s,n.delay,n.time),n.delay<=u&&s(u-n.delay)}function s(u){var c,d,f,h;if(n.state!==Tu)return l();for(c in r)if(h=r[c],h.name===n.name){if(h.state===Po)return Su(s);h.state===Au?(h.state=No,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete r[c]):+c<t&&(h.state=No,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete r[c])}if(Su(function(){n.state===Po&&(n.state=Au,n.timer.restart(a,n.delay,n.time),a(u))}),n.state=na,n.on.call("start",e,e.__data__,n.index,n.group),n.state===na){for(n.state=Po,o=new Array(f=n.tween.length),c=0,d=-1;c<f;++c)(h=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(o[++d]=h);o.length=d+1}}function a(u){for(var c=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(l),n.state=ra,1),d=-1,f=o.length;++d<f;)o[d].call(e,c);n.state===ra&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=No,n.timer.stop(),delete r[t];for(var u in r)return;delete e.__transition}}function Ro(e,t){var n=e.__transition,r,o,i=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((r=n[s]).name!==t){i=!1;continue}o=r.state>na&&r.state<ra,r.state=No,r.timer.stop(),r.on.call(o?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[s]}i&&delete e.__transition}}function rx(e){return this.each(function(){Ro(this,e)})}function ox(e,t){var n,r;return function(){var o=Vt(this,e),i=o.tween;if(i!==n){r=n=i;for(var s=0,a=r.length;s<a;++s)if(r[s].name===t){r=r.slice(),r.splice(s,1);break}}o.tween=r}}function ix(e,t,n){var r,o;if(typeof n!="function")throw new Error;return function(){var i=Vt(this,e),s=i.tween;if(s!==r){o=(r=s).slice();for(var a={name:t,value:n},l=0,u=o.length;l<u;++l)if(o[l].name===t){o[l]=a;break}l===u&&o.push(a)}i.tween=o}}function sx(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Et(this.node(),n).tween,o=0,i=r.length,s;o<i;++o)if((s=r[o]).name===e)return s.value;return null}return this.each((t==null?ox:ix)(n,e,t))}function Ja(e,t,n){var r=e._id;return e.each(function(){var o=Vt(this,r);(o.value||(o.value={}))[t]=n.apply(this,arguments)}),function(o){return Et(o,r).value[t]}}function If(e,t){var n;return(typeof t=="number"?Tt:t instanceof Tn?ni:(n=Tn(t))?(t=n,ni):xf)(e,t)}function ax(e){return function(){this.removeAttribute(e)}}function lx(e){return function(){this.removeAttributeNS(e.space,e.local)}}function ux(e,t,n){var r,o=n+"",i;return function(){var s=this.getAttribute(e);return s===o?null:s===r?i:i=t(r=s,n)}}function cx(e,t,n){var r,o=n+"",i;return function(){var s=this.getAttributeNS(e.space,e.local);return s===o?null:s===r?i:i=t(r=s,n)}}function dx(e,t,n){var r,o,i;return function(){var s,a=n(this),l;return a==null?void this.removeAttribute(e):(s=this.getAttribute(e),l=a+"",s===l?null:s===r&&l===o?i:(o=l,i=t(r=s,a)))}}function fx(e,t,n){var r,o,i;return function(){var s,a=n(this),l;return a==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),l=a+"",s===l?null:s===r&&l===o?i:(o=l,i=t(r=s,a)))}}function hx(e,t){var n=Li(e),r=n==="transform"?WE:If;return this.attrTween(e,typeof t=="function"?(n.local?fx:dx)(n,r,Ja(this,"attr."+e,t)):t==null?(n.local?lx:ax)(n):(n.local?cx:ux)(n,r,t))}function px(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function mx(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function gx(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&mx(e,i)),n}return o._value=t,o}function vx(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&px(e,i)),n}return o._value=t,o}function yx(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=Li(e);return this.tween(n,(r.local?gx:vx)(r,t))}function _x(e,t){return function(){Qa(this,e).delay=+t.apply(this,arguments)}}function bx(e,t){return t=+t,function(){Qa(this,e).delay=t}}function wx(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?_x:bx)(t,e)):Et(this.node(),t).delay}function Ex(e,t){return function(){Vt(this,e).duration=+t.apply(this,arguments)}}function xx(e,t){return t=+t,function(){Vt(this,e).duration=t}}function kx(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Ex:xx)(t,e)):Et(this.node(),t).duration}function Cx(e,t){if(typeof t!="function")throw new Error;return function(){Vt(this,e).ease=t}}function Sx(e){var t=this._id;return arguments.length?this.each(Cx(t,e)):Et(this.node(),t).ease}function Tx(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Vt(this,e).ease=n}}function Ax(e){if(typeof e!="function")throw new Error;return this.each(Tx(this._id,e))}function Lx(e){typeof e!="function"&&(e=lf(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,a=r[o]=[],l,u=0;u<s;++u)(l=i[u])&&e.call(l,l.__data__,u,i)&&a.push(l);return new Zt(r,this._parents,this._name,this._id)}function Ix(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,o=n.length,i=Math.min(r,o),s=new Array(r),a=0;a<i;++a)for(var l=t[a],u=n[a],c=l.length,d=s[a]=new Array(c),f,h=0;h<c;++h)(f=l[h]||u[h])&&(d[h]=f);for(;a<r;++a)s[a]=t[a];return new Zt(s,this._parents,this._name,this._id)}function Px(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function Nx(e,t,n){var r,o,i=Px(t)?Qa:Vt;return function(){var s=i(this,e),a=s.on;a!==r&&(o=(r=a).copy()).on(t,n),s.on=o}}function Rx(e,t){var n=this._id;return arguments.length<2?Et(this.node(),n).on.on(e):this.each(Nx(n,e,t))}function Mx(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Ox(){return this.on("end.remove",Mx(this._id))}function Dx(e){var t=this._name,n=this._id;typeof e!="function"&&(e=qa(e));for(var r=this._groups,o=r.length,i=new Array(o),s=0;s<o;++s)for(var a=r[s],l=a.length,u=i[s]=new Array(l),c,d,f=0;f<l;++f)(c=a[f])&&(d=e.call(c,c.__data__,f,a))&&("__data__"in c&&(d.__data__=c.__data__),u[f]=d,Pi(u[f],t,n,f,u,Et(c,n)));return new Zt(i,this._parents,t,n)}function $x(e){var t=this._name,n=this._id;typeof e!="function"&&(e=af(e));for(var r=this._groups,o=r.length,i=[],s=[],a=0;a<o;++a)for(var l=r[a],u=l.length,c,d=0;d<u;++d)if(c=l[d]){for(var f=e.call(c,c.__data__,d,l),h,p=Et(c,n),b=0,_=f.length;b<_;++b)(h=f[b])&&Pi(h,t,n,b,f,p);i.push(f),s.push(c)}return new Zt(i,s,t,n)}var Vx=no.prototype.constructor;function Bx(){return new Vx(this._groups,this._parents)}function Fx(e,t){var n,r,o;return function(){var i=tr(this,e),s=(this.style.removeProperty(e),tr(this,e));return i===s?null:i===n&&s===r?o:o=t(n=i,r=s)}}function Pf(e){return function(){this.style.removeProperty(e)}}function zx(e,t,n){var r,o=n+"",i;return function(){var s=tr(this,e);return s===o?null:s===r?i:i=t(r=s,n)}}function Hx(e,t,n){var r,o,i;return function(){var s=tr(this,e),a=n(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(e),tr(this,e))),s===l?null:s===r&&l===o?i:(o=l,i=t(r=s,a))}}function Gx(e,t){var n,r,o,i="style."+t,s="end."+i,a;return function(){var l=Vt(this,e),u=l.on,c=l.value[i]==null?a||(a=Pf(t)):void 0;(u!==n||o!==c)&&(r=(n=u).copy()).on(s,o=c),l.on=r}}function jx(e,t,n){var r=(e+="")=="transform"?UE:If;return t==null?this.styleTween(e,Fx(e,r)).on("end.style."+e,Pf(e)):typeof t=="function"?this.styleTween(e,Hx(e,r,Ja(this,"style."+e,t))).each(Gx(this._id,e)):this.styleTween(e,zx(e,r,t),n).on("end.style."+e,null)}function Ux(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function Wx(e,t,n){var r,o;function i(){var s=t.apply(this,arguments);return s!==o&&(r=(o=s)&&Ux(e,s,n)),r}return i._value=t,i}function qx(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,Wx(e,t,n??""))}function Yx(e){return function(){this.textContent=e}}function Xx(e){return function(){var t=e(this);this.textContent=t??""}}function Kx(e){return this.tween("text",typeof e=="function"?Xx(Ja(this,"text",e)):Yx(e==null?"":e+""))}function Zx(e){return function(t){this.textContent=e.call(this,t)}}function Qx(e){var t,n;function r(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&Zx(o)),t}return r._value=e,r}function Jx(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,Qx(e))}function ek(){for(var e=this._name,t=this._id,n=Nf(),r=this._groups,o=r.length,i=0;i<o;++i)for(var s=r[i],a=s.length,l,u=0;u<a;++u)if(l=s[u]){var c=Et(l,t);Pi(l,e,n,u,s,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new Zt(r,this._parents,e,n)}function tk(){var e,t,n=this,r=n._id,o=n.size();return new Promise(function(i,s){var a={value:s},l={value:function(){--o===0&&i()}};n.each(function(){var u=Vt(this,r),c=u.on;c!==e&&(t=(e=c).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(l)),u.on=t}),o===0&&i()})}var nk=0;function Zt(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Nf(){return++nk}var zt=no.prototype;Zt.prototype={constructor:Zt,select:Dx,selectAll:$x,selectChild:zt.selectChild,selectChildren:zt.selectChildren,filter:Lx,merge:Ix,selection:Bx,transition:ek,call:zt.call,nodes:zt.nodes,node:zt.node,size:zt.size,empty:zt.empty,each:zt.each,on:Rx,attr:hx,attrTween:yx,style:jx,styleTween:qx,text:Kx,textTween:Jx,remove:Ox,tween:sx,delay:wx,duration:kx,ease:Sx,easeVarying:Ax,end:tk,[Symbol.iterator]:zt[Symbol.iterator]};function rk(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var ok={time:null,delay:0,duration:250,ease:rk};function ik(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function sk(e){var t,n;e instanceof Zt?(t=e._id,e=e._name):(t=Nf(),(n=ok).time=Za(),e=e==null?null:e+"");for(var r=this._groups,o=r.length,i=0;i<o;++i)for(var s=r[i],a=s.length,l,u=0;u<a;++u)(l=s[u])&&Pi(l,e,t,u,s,n||ik(l,t));return new Zt(r,this._parents,e,t)}no.prototype.interrupt=rx;no.prototype.transition=sk;const yo=e=>()=>e;function ak(e,{sourceEvent:t,target:n,transform:r,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:o}})}function jt(e,t,n){this.k=e,this.x=t,this.y=n}jt.prototype={constructor:jt,scale:function(e){return e===1?this:new jt(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new jt(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var rr=new jt(1,0,0);jt.prototype;function is(e){e.stopImmediatePropagation()}function yr(e){e.preventDefault(),e.stopImmediatePropagation()}function lk(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function uk(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function Lu(){return this.__zoom||rr}function ck(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function dk(){return navigator.maxTouchPoints||"ontouchstart"in this}function fk(e,t,n){var r=e.invertX(t[0][0])-n[0][0],o=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s))}function hk(){var e=lk,t=uk,n=fk,r=ck,o=dk,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,l=Io,u=Ai("start","zoom","end"),c,d,f,h=500,p=150,b=0,_=10;function y(E){E.property("__zoom",Lu).on("wheel.zoom",O,{passive:!1}).on("mousedown.zoom",W).on("dblclick.zoom",N).filter(o).on("touchstart.zoom",M).on("touchmove.zoom",C).on("touchend.zoom touchcancel.zoom",F).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(E,$,A,V){var z=E.selection?E.selection():E;z.property("__zoom",Lu),E!==z?x(E,$,A,V):z.interrupt().each(function(){L(this,arguments).event(V).start().zoom(null,typeof $=="function"?$.apply(this,arguments):$).end()})},y.scaleBy=function(E,$,A,V){y.scaleTo(E,function(){var z=this.__zoom.k,G=typeof $=="function"?$.apply(this,arguments):$;return z*G},A,V)},y.scaleTo=function(E,$,A,V){y.transform(E,function(){var z=t.apply(this,arguments),G=this.__zoom,U=A==null?v(z):typeof A=="function"?A.apply(this,arguments):A,K=G.invert(U),J=typeof $=="function"?$.apply(this,arguments):$;return n(m(g(G,J),U,K),z,s)},A,V)},y.translateBy=function(E,$,A,V){y.transform(E,function(){return n(this.__zoom.translate(typeof $=="function"?$.apply(this,arguments):$,typeof A=="function"?A.apply(this,arguments):A),t.apply(this,arguments),s)},null,V)},y.translateTo=function(E,$,A,V,z){y.transform(E,function(){var G=t.apply(this,arguments),U=this.__zoom,K=V==null?v(G):typeof V=="function"?V.apply(this,arguments):V;return n(rr.translate(K[0],K[1]).scale(U.k).translate(typeof $=="function"?-$.apply(this,arguments):-$,typeof A=="function"?-A.apply(this,arguments):-A),G,s)},V,z)};function g(E,$){return $=Math.max(i[0],Math.min(i[1],$)),$===E.k?E:new jt($,E.x,E.y)}function m(E,$,A){var V=$[0]-A[0]*E.k,z=$[1]-A[1]*E.k;return V===E.x&&z===E.y?E:new jt(E.k,V,z)}function v(E){return[(+E[0][0]+ +E[1][0])/2,(+E[0][1]+ +E[1][1])/2]}function x(E,$,A,V){E.on("start.zoom",function(){L(this,arguments).event(V).start()}).on("interrupt.zoom end.zoom",function(){L(this,arguments).event(V).end()}).tween("zoom",function(){var z=this,G=arguments,U=L(z,G).event(V),K=t.apply(z,G),J=A==null?v(K):typeof A=="function"?A.apply(z,G):A,q=Math.max(K[1][0]-K[0][0],K[1][1]-K[0][1]),S=z.__zoom,w=typeof $=="function"?$.apply(z,G):$,I=l(S.invert(J).concat(q/S.k),w.invert(J).concat(q/w.k));return function(D){if(D===1)D=w;else{var j=I(D),Q=q/j[2];D=new jt(Q,J[0]-j[0]*Q,J[1]-j[1]*Q)}U.zoom(null,D)}})}function L(E,$,A){return!A&&E.__zooming||new P(E,$)}function P(E,$){this.that=E,this.args=$,this.active=0,this.sourceEvent=null,this.extent=t.apply(E,$),this.taps=0}P.prototype={event:function(E){return E&&(this.sourceEvent=E),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(E,$){return this.mouse&&E!=="mouse"&&(this.mouse[1]=$.invert(this.mouse[0])),this.touch0&&E!=="touch"&&(this.touch0[1]=$.invert(this.touch0[0])),this.touch1&&E!=="touch"&&(this.touch1[1]=$.invert(this.touch1[0])),this.that.__zoom=$,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(E){var $=gt(this.that).datum();u.call(E,this.that,new ak(E,{sourceEvent:this.sourceEvent,target:y,transform:this.that.__zoom,dispatch:u}),$)}};function O(E,...$){if(!e.apply(this,arguments))return;var A=L(this,$).event(E),V=this.__zoom,z=Math.max(i[0],Math.min(i[1],V.k*Math.pow(2,r.apply(this,arguments)))),G=St(E);if(A.wheel)(A.mouse[0][0]!==G[0]||A.mouse[0][1]!==G[1])&&(A.mouse[1]=V.invert(A.mouse[0]=G)),clearTimeout(A.wheel);else{if(V.k===z)return;A.mouse=[G,V.invert(G)],Ro(this),A.start()}yr(E),A.wheel=setTimeout(U,p),A.zoom("mouse",n(m(g(V,z),A.mouse[0],A.mouse[1]),A.extent,s));function U(){A.wheel=null,A.end()}}function W(E,...$){if(f||!e.apply(this,arguments))return;var A=E.currentTarget,V=L(this,$,!0).event(E),z=gt(E.view).on("mousemove.zoom",J,!0).on("mouseup.zoom",q,!0),G=St(E,A),U=E.clientX,K=E.clientY;yf(E.view),is(E),V.mouse=[G,this.__zoom.invert(G)],Ro(this),V.start();function J(S){if(yr(S),!V.moved){var w=S.clientX-U,I=S.clientY-K;V.moved=w*w+I*I>b}V.event(S).zoom("mouse",n(m(V.that.__zoom,V.mouse[0]=St(S,A),V.mouse[1]),V.extent,s))}function q(S){z.on("mousemove.zoom mouseup.zoom",null),_f(S.view,V.moved),yr(S),V.event(S).end()}}function N(E,...$){if(e.apply(this,arguments)){var A=this.__zoom,V=St(E.changedTouches?E.changedTouches[0]:E,this),z=A.invert(V),G=A.k*(E.shiftKey?.5:2),U=n(m(g(A,G),V,z),t.apply(this,$),s);yr(E),a>0?gt(this).transition().duration(a).call(x,U,V,E):gt(this).call(y.transform,U,V,E)}}function M(E,...$){if(e.apply(this,arguments)){var A=E.touches,V=A.length,z=L(this,$,E.changedTouches.length===V).event(E),G,U,K,J;for(is(E),U=0;U<V;++U)K=A[U],J=St(K,this),J=[J,this.__zoom.invert(J),K.identifier],z.touch0?!z.touch1&&z.touch0[2]!==J[2]&&(z.touch1=J,z.taps=0):(z.touch0=J,G=!0,z.taps=1+!!c);c&&(c=clearTimeout(c)),G&&(z.taps<2&&(d=J[0],c=setTimeout(function(){c=null},h)),Ro(this),z.start())}}function C(E,...$){if(this.__zooming){var A=L(this,$).event(E),V=E.changedTouches,z=V.length,G,U,K,J;for(yr(E),G=0;G<z;++G)U=V[G],K=St(U,this),A.touch0&&A.touch0[2]===U.identifier?A.touch0[0]=K:A.touch1&&A.touch1[2]===U.identifier&&(A.touch1[0]=K);if(U=A.that.__zoom,A.touch1){var q=A.touch0[0],S=A.touch0[1],w=A.touch1[0],I=A.touch1[1],D=(D=w[0]-q[0])*D+(D=w[1]-q[1])*D,j=(j=I[0]-S[0])*j+(j=I[1]-S[1])*j;U=g(U,Math.sqrt(D/j)),K=[(q[0]+w[0])/2,(q[1]+w[1])/2],J=[(S[0]+I[0])/2,(S[1]+I[1])/2]}else if(A.touch0)K=A.touch0[0],J=A.touch0[1];else return;A.zoom("touch",n(m(U,K,J),A.extent,s))}}function F(E,...$){if(this.__zooming){var A=L(this,$).event(E),V=E.changedTouches,z=V.length,G,U;for(is(E),f&&clearTimeout(f),f=setTimeout(function(){f=null},h),G=0;G<z;++G)U=V[G],A.touch0&&A.touch0[2]===U.identifier?delete A.touch0:A.touch1&&A.touch1[2]===U.identifier&&delete A.touch1;if(A.touch1&&!A.touch0&&(A.touch0=A.touch1,delete A.touch1),A.touch0)A.touch0[1]=this.__zoom.invert(A.touch0[0]);else if(A.end(),A.taps===2&&(U=St(U,this),Math.hypot(d[0]-U[0],d[1]-U[1])<_)){var K=gt(this).on("dblclick.zoom");K&&K.apply(this,arguments)}}}return y.wheelDelta=function(E){return arguments.length?(r=typeof E=="function"?E:yo(+E),y):r},y.filter=function(E){return arguments.length?(e=typeof E=="function"?E:yo(!!E),y):e},y.touchable=function(E){return arguments.length?(o=typeof E=="function"?E:yo(!!E),y):o},y.extent=function(E){return arguments.length?(t=typeof E=="function"?E:yo([[+E[0][0],+E[0][1]],[+E[1][0],+E[1][1]]]),y):t},y.scaleExtent=function(E){return arguments.length?(i[0]=+E[0],i[1]=+E[1],y):[i[0],i[1]]},y.translateExtent=function(E){return arguments.length?(s[0][0]=+E[0][0],s[1][0]=+E[1][0],s[0][1]=+E[0][1],s[1][1]=+E[1][1],y):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},y.constrain=function(E){return arguments.length?(n=E,y):n},y.duration=function(E){return arguments.length?(a=+E,y):a},y.interpolate=function(E){return arguments.length?(l=E,y):l},y.on=function(){var E=u.on.apply(u,arguments);return E===u?y:E},y.clickDistance=function(E){return arguments.length?(b=(E=+E)*E,y):Math.sqrt(b)},y.tapDistance=function(E){return arguments.length?(_=+E,y):_},y}var he=(e=>(e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom",e))(he||{}),el=(e=>(e.Partial="partial",e.Full="full",e))(el||{}),gn=(e=>(e.Bezier="default",e.SimpleBezier="simple-bezier",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e))(gn||{}),cn=(e=>(e.Strict="strict",e.Loose="loose",e))(cn||{}),si=(e=>(e.Arrow="arrow",e.ArrowClosed="arrowclosed",e))(si||{}),Lr=(e=>(e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal",e))(Lr||{}),Rf=(e=>(e.TopLeft="top-left",e.TopCenter="top-center",e.TopRight="top-right",e.BottomLeft="bottom-left",e.BottomCenter="bottom-center",e.BottomRight="bottom-right",e))(Rf||{});const pk=["INPUT","SELECT","TEXTAREA"],mk=typeof document<"u"?document:null;function oa(e){var t,n;const r=((n=(t=e.composedPath)==null?void 0:t.call(e))==null?void 0:n[0])||e.target,o=typeof r?.hasAttribute=="function"?r.hasAttribute("contenteditable"):!1,i=typeof r?.closest=="function"?r.closest(".nokey"):null;return pk.includes(r?.nodeName)||o||!!i}function gk(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey}function Iu(e,t,n,r){const o=t.replace("+",`
154
+ `).replace(`
155
+
156
+ `,`
157
+ +`).split(`
158
+ `).map(s=>s.trim().toLowerCase());if(o.length===1)return e.toLowerCase()===t.toLowerCase();r||n.add(e.toLowerCase());const i=o.every((s,a)=>n.has(s)&&Array.from(n.values())[a]===o[a]);return r&&n.delete(e.toLowerCase()),i}function vk(e,t){return n=>{if(!n.code&&!n.key)return!1;const r=yk(n.code,e);return Array.isArray(e)?e.some(o=>Iu(n[r],o,t,n.type==="keyup")):Iu(n[r],e,t,n.type==="keyup")}}function yk(e,t){return t.includes(e)?"code":"key"}function Ir(e,t){const n=te(()=>Te(t?.target)??mk),r=Pt(Te(e)===!0);let o=!1;const i=new Set;let s=l(Te(e));xe(()=>Te(e),(u,c)=>{typeof c=="boolean"&&typeof u!="boolean"&&a(),s=l(u)},{immediate:!0}),of(["blur","contextmenu"],a),fu((...u)=>s(...u),u=>{var c,d;const f=Te(t?.actInsideInputWithModifier)??!0,h=Te(t?.preventDefault)??!1;if(o=gk(u),(!o||o&&!f)&&oa(u))return;const b=((d=(c=u.composedPath)==null?void 0:c.call(u))==null?void 0:d[0])||u.target,_=b?.nodeName==="BUTTON"||b?.nodeName==="A";!h&&(o||!_)&&u.preventDefault(),r.value=!0},{eventName:"keydown",target:n}),fu((...u)=>s(...u),u=>{const c=Te(t?.actInsideInputWithModifier)??!0;if(r.value){if((!o||o&&!c)&&oa(u))return;o=!1,r.value=!1}},{eventName:"keyup",target:n});function a(){o=!1,i.clear(),r.value=Te(e)===!0}function l(u){return u===null?(a(),()=>!1):typeof u=="boolean"?(a(),r.value=u,()=>!1):Array.isArray(u)||typeof u=="string"?vk(u,i):u}return r}const Mf="vue-flow__node-desc",Of="vue-flow__edge-desc",_k="vue-flow__aria-live",Df=["Enter"," ","Escape"],Zn={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function ai(e){return{...e.computedPosition||{x:0,y:0},width:e.dimensions.width||0,height:e.dimensions.height||0}}function li(e,t){const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)}function Ni(e){return{width:e.offsetWidth,height:e.offsetHeight}}function Ln(e,t=0,n=1){return Math.min(Math.max(e,t),n)}function $f(e,t){return{x:Ln(e.x,t[0][0],t[1][0]),y:Ln(e.y,t[0][1],t[1][1])}}function Pu(e){const t=e.getRootNode();return"elementFromPoint"in t?t:window.document}function dn(e){return e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e}function kn(e){return e&&typeof e=="object"&&"id"in e&&"position"in e&&!dn(e)}function xr(e){return kn(e)&&"computedPosition"in e}function _o(e){return!Number.isNaN(e)&&Number.isFinite(e)}function bk(e){return _o(e.width)&&_o(e.height)&&_o(e.x)&&_o(e.y)}function wk(e,t,n){const r={id:e.id.toString(),type:e.type??"default",dimensions:Un({width:0,height:0}),computedPosition:Un({z:0,...e.position}),handleBounds:{source:[],target:[]},draggable:void 0,selectable:void 0,connectable:void 0,focusable:void 0,selected:!1,dragging:!1,resizing:!1,initialized:!1,isParent:!1,position:{x:0,y:0},data:Be(e.data)?e.data:{},events:Un(Be(e.events)?e.events:{})};return Object.assign(t??r,e,{id:e.id.toString(),parentNode:n})}function Vf(e,t,n){var r,o;const i={id:e.id.toString(),type:e.type??t?.type??"default",source:e.source.toString(),target:e.target.toString(),sourceHandle:(r=e.sourceHandle)==null?void 0:r.toString(),targetHandle:(o=e.targetHandle)==null?void 0:o.toString(),updatable:e.updatable??n?.updatable,selectable:e.selectable??n?.selectable,focusable:e.focusable??n?.focusable,data:Be(e.data)?e.data:{},events:Un(Be(e.events)?e.events:{}),label:e.label??"",interactionWidth:e.interactionWidth??n?.interactionWidth,...n??{}};return Object.assign(t??i,e,{id:e.id.toString()})}function Bf(e,t,n,r){const o=typeof e=="string"?e:e.id,i=new Set,s=r==="source"?"target":"source";for(const a of n)a[s]===o&&i.add(a[r]);return t.filter(a=>i.has(a.id))}function Ek(...e){if(e.length===3){const[i,s,a]=e;return Bf(i,s,a,"target")}const[t,n]=e,r=typeof t=="string"?t:t.id;return n.filter(i=>dn(i)&&i.source===r).map(i=>n.find(s=>kn(s)&&s.id===i.target))}function xk(...e){if(e.length===3){const[i,s,a]=e;return Bf(i,s,a,"source")}const[t,n]=e,r=typeof t=="string"?t:t.id;return n.filter(i=>dn(i)&&i.target===r).map(i=>n.find(s=>kn(s)&&s.id===i.source))}function Ff({source:e,sourceHandle:t,target:n,targetHandle:r}){return`vueflow__edge-${e}${t??""}-${n}${r??""}`}function kk(e,t){return t.some(n=>dn(n)&&n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle))}function Gr({x:e,y:t},{x:n,y:r,zoom:o}){return{x:e*o+n,y:t*o+r}}function jr({x:e,y:t},{x:n,y:r,zoom:o},i=!1,s=[1,1]){const a={x:(e-n)/o,y:(t-r)/o};return i?Ri(a,s):a}function Ck(e,t){return{x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}}function zf({x:e,y:t,width:n,height:r}){return{x:e,y:t,x2:e+n,y2:t+r}}function Sk({x:e,y:t,x2:n,y2:r}){return{x:e,y:t,width:n-e,height:r-t}}function Hf(e){let t={x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY,x2:Number.NEGATIVE_INFINITY,y2:Number.NEGATIVE_INFINITY};for(let n=0;n<e.length;n++){const r=e[n];t=Ck(t,zf({...r.computedPosition,...r.dimensions}))}return Sk(t)}function Gf(e,t,n={x:0,y:0,zoom:1},r=!1,o=!1){const i={...jr(t,n),width:t.width/n.zoom,height:t.height/n.zoom},s=[];for(const a of e){const{dimensions:l,selectable:u=!0,hidden:c=!1}=a,d=l.width??a.width??null,f=l.height??a.height??null;if(o&&!u||c)continue;const h=li(i,ai(a)),p=d===null||f===null,b=r&&h>0,_=(d??0)*(f??0);(p||b||h>=_||a.dragging)&&s.push(a)}return s}function jf(e,t){const n=new Set;if(typeof e=="string")n.add(e);else if(e.length>=1)for(const r of e)n.add(r.id);return t.filter(r=>n.has(r.source)||n.has(r.target))}function Vn(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=Number.parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=Number.parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return oo(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Tk(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=Vn(e,n),o=Vn(e,t);return{top:r,right:o,bottom:r,left:o,x:o*2,y:r*2}}if(typeof e=="object"){const r=Vn(e.top??e.y??0,n),o=Vn(e.bottom??e.y??0,n),i=Vn(e.left??e.x??0,t),s=Vn(e.right??e.x??0,t);return{top:r,right:s,bottom:o,left:i,x:i+s,y:r+o}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Ak(e,t,n,r,o,i){const{x:s,y:a}=Gr(e,{x:t,y:n,zoom:r}),{x:l,y:u}=Gr({x:e.x+e.width,y:e.y+e.height},{x:t,y:n,zoom:r}),c=o-l,d=i-u;return{left:Math.floor(s),top:Math.floor(a),right:Math.floor(c),bottom:Math.floor(d)}}function Nu(e,t,n,r,o,i=.1){const s=Tk(i,t,n),a=(t-s.x)/e.width,l=(n-s.y)/e.height,u=Math.min(a,l),c=Ln(u,r,o),d=e.x+e.width/2,f=e.y+e.height/2,h=t/2-d*c,p=n/2-f*c,b=Ak(e,h,p,c,t,n),_={left:Math.min(b.left-s.left,0),top:Math.min(b.top-s.top,0),right:Math.min(b.right-s.right,0),bottom:Math.min(b.bottom-s.bottom,0)};return{x:h-_.left+_.right,y:p-_.top+_.bottom,zoom:c}}function Lk(e,t){return{x:t.x+e.x,y:t.y+e.y,z:(e.z>t.z?e.z:t.z)+1}}function Uf(e,t){if(!e.parentNode)return!1;const n=t.get(e.parentNode);return n?n.selected?!0:Uf(n,t):!1}function Ur(e,t){return typeof e>"u"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`}function Ru(e){const t=e.ctrlKey&&ui()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t}function Mu(e,t,n){return e<t?Ln(Math.abs(e-t),1,t)/t:e>n?-Ln(Math.abs(e-n),1,t)/t:0}function Wf(e,t,n=15,r=40){const o=Mu(e.x,r,t.width-r)*n,i=Mu(e.y,r,t.height-r)*n;return[o,i]}function ss(e,t){if(t){const n=e.position.x+e.dimensions.width-t.dimensions.width,r=e.position.y+e.dimensions.height-t.dimensions.height;if(n>0||r>0||e.position.x<0||e.position.y<0){let o={};if(typeof t.style=="function"?o={...t.style(t)}:t.style&&(o={...t.style}),o.width=o.width??`${t.dimensions.width}px`,o.height=o.height??`${t.dimensions.height}px`,n>0)if(typeof o.width=="string"){const i=Number(o.width.replace("px",""));o.width=`${i+n}px`}else o.width+=n;if(r>0)if(typeof o.height=="string"){const i=Number(o.height.replace("px",""));o.height=`${i+r}px`}else o.height+=r;if(e.position.x<0){const i=Math.abs(e.position.x);if(t.position.x=t.position.x-i,typeof o.width=="string"){const s=Number(o.width.replace("px",""));o.width=`${s+i}px`}else o.width+=i;e.position.x=0}if(e.position.y<0){const i=Math.abs(e.position.y);if(t.position.y=t.position.y-i,typeof o.height=="string"){const s=Number(o.height.replace("px",""));o.height=`${s+i}px`}else o.height+=i;e.position.y=0}t.dimensions.width=Number(o.width.toString().replace("px","")),t.dimensions.height=Number(o.height.toString().replace("px","")),typeof t.style=="function"?t.style=i=>{const s=t.style;return{...s(i),...o}}:t.style={...t.style,...o}}}}function Ou(e,t){var n,r;const o=e.filter(s=>s.type==="add"||s.type==="remove");for(const s of o)if(s.type==="add")t.findIndex(l=>l.id===s.item.id)===-1&&t.push(s.item);else if(s.type==="remove"){const a=t.findIndex(l=>l.id===s.id);a!==-1&&t.splice(a,1)}const i=t.map(s=>s.id);for(const s of t)for(const a of e)if(a.id===s.id)switch(a.type){case"select":s.selected=a.selected;break;case"position":if(xr(s)&&(typeof a.position<"u"&&(s.position=a.position),typeof a.dragging<"u"&&(s.dragging=a.dragging),s.expandParent&&s.parentNode)){const l=t[i.indexOf(s.parentNode)];l&&xr(l)&&ss(s,l)}break;case"dimensions":if(xr(s)&&(typeof a.dimensions<"u"&&(s.dimensions=a.dimensions),typeof a.updateStyle<"u"&&a.updateStyle&&(s.style={...s.style||{},width:`${(n=a.dimensions)==null?void 0:n.width}px`,height:`${(r=a.dimensions)==null?void 0:r.height}px`}),typeof a.resizing<"u"&&(s.resizing=a.resizing),s.expandParent&&s.parentNode)){const l=t[i.indexOf(s.parentNode)];l&&xr(l)&&(!!l.dimensions.width&&!!l.dimensions.height?ss(s,l):yt(()=>{ss(s,l)}))}break}return t}function nn(e,t){return{id:e,type:"select",selected:t}}function Du(e){return{item:e,type:"add"}}function $u(e){return{id:e,type:"remove"}}function Vu(e,t,n,r,o){return{id:e,source:t,target:n,sourceHandle:r||null,targetHandle:o||null,type:"remove"}}function rn(e,t=new Set,n=!1){const r=[];for(const[o,i]of e){const s=t.has(o);!(i.selected===void 0&&!s)&&i.selected!==s&&(n&&(i.selected=s),r.push(nn(i.id,s)))}return r}const Bu=()=>{};function de(e){const t=new Set;let n=Bu,r=()=>!1;const o=()=>t.size>0||r(),i=f=>{n=f},s=()=>{n=Bu},a=f=>{r=f},l=()=>{r=()=>!1},u=f=>{t.delete(f)};return{on:f=>{t.add(f);const h=()=>u(f);return Vr(h),{off:h}},off:u,trigger:f=>{const h=[n];return o()?h.push(...t):e&&h.push(e),Promise.allSettled(h.map(p=>p(f)))},hasListeners:o,listeners:t,setEmitter:i,removeEmitter:s,setHasEmitListeners:a,removeHasEmitListeners:l}}function Fu(e,t,n){let r=e;do{if(r&&r.matches(t))return!0;if(r===n)return!1;r=r.parentElement}while(r);return!1}function Ik(e,t,n,r){var o,i;const s=new Map;for(const[a,l]of e)(l.selected||l.id===r)&&(!l.parentNode||!Uf(l,e))&&(l.draggable||t&&typeof l.draggable>"u")&&e.get(a)&&s.set(a,{id:l.id,position:l.position||{x:0,y:0},distance:{x:n.x-((o=l.computedPosition)==null?void 0:o.x)||0,y:n.y-((i=l.computedPosition)==null?void 0:i.y)||0},from:{x:l.computedPosition.x,y:l.computedPosition.y},extent:l.extent,parentNode:l.parentNode,dimensions:{...l.dimensions},expandParent:l.expandParent});return Array.from(s.values())}function as({id:e,dragItems:t,findNode:n}){const r=[];for(const o of t){const i=n(o.id);i&&r.push(i)}return[e?r.find(o=>o.id===e):r[0],r]}function qf(e){if(Array.isArray(e))switch(e.length){case 1:return[e[0],e[0],e[0],e[0]];case 2:return[e[0],e[1],e[0],e[1]];case 3:return[e[0],e[1],e[2],e[1]];case 4:return e;default:return[0,0,0,0]}return[e,e,e,e]}function Pk(e,t,n){const[r,o,i,s]=typeof e!="string"?qf(e.padding):[0,0,0,0];return n&&typeof n.computedPosition.x<"u"&&typeof n.computedPosition.y<"u"&&typeof n.dimensions.width<"u"&&typeof n.dimensions.height<"u"?[[n.computedPosition.x+s,n.computedPosition.y+r],[n.computedPosition.x+n.dimensions.width-o,n.computedPosition.y+n.dimensions.height-i]]:!1}function Nk(e,t,n,r){let o=e.extent||n;if((o==="parent"||!Array.isArray(o)&&o?.range==="parent")&&!e.expandParent)if(e.parentNode&&r&&e.dimensions.width&&e.dimensions.height){const i=Pk(o,e,r);i&&(o=i)}else t(new Ue(ze.NODE_EXTENT_INVALID,e.id)),o=n;else if(Array.isArray(o)){const i=r?.computedPosition.x||0,s=r?.computedPosition.y||0;o=[[o[0][0]+i,o[0][1]+s],[o[1][0]+i,o[1][1]+s]]}else if(o!=="parent"&&o?.range&&Array.isArray(o.range)){const[i,s,a,l]=qf(o.padding),u=r?.computedPosition.x||0,c=r?.computedPosition.y||0;o=[[o.range[0][0]+u+l,o.range[0][1]+c+i],[o.range[1][0]+u-s,o.range[1][1]+c-a]]}return o==="parent"?[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]]:o}function Rk({width:e,height:t},n){return[n[0],[n[1][0]-(e||0),n[1][1]-(t||0)]]}function tl(e,t,n,r,o){const i=Rk(e.dimensions,Nk(e,n,r,o)),s=$f(t,i);return{position:{x:s.x-(o?.computedPosition.x||0),y:s.y-(o?.computedPosition.y||0)},computedPosition:s}}function or(e,t,n=he.Left,r=!1){const o=(t?.x??0)+e.computedPosition.x,i=(t?.y??0)+e.computedPosition.y,{width:s,height:a}=t??$k(e);if(r)return{x:o+s/2,y:i+a/2};switch(t?.position??n){case he.Top:return{x:o+s/2,y:i};case he.Right:return{x:o+s,y:i+a/2};case he.Bottom:return{x:o+s/2,y:i+a};case he.Left:return{x:o,y:i+a/2}}}function zu(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Mk({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:r,targetWidth:o,targetHeight:i,width:s,height:a,viewport:l}){const u={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+n,t.x+o),y2:Math.max(e.y+r,t.y+i)};u.x===u.x2&&(u.x2+=1),u.y===u.y2&&(u.y2+=1);const c=zf({x:(0-l.x)/l.zoom,y:(0-l.y)/l.zoom,width:s/l.zoom,height:a/l.zoom}),d=Math.max(0,Math.min(c.x2,u.x2)-Math.max(c.x,u.x)),f=Math.max(0,Math.min(c.y2,u.y2)-Math.max(c.y,u.y));return Math.ceil(d*f)>0}function Ok(e,t,n=!1){const r=typeof e.zIndex=="number";let o=r?e.zIndex:0;const i=t(e.source),s=t(e.target);return!i||!s?0:(n&&(o=r?e.zIndex:Math.max(i.computedPosition.z||0,s.computedPosition.z||0)),o)}var ze=(e=>(e.MISSING_STYLES="MISSING_STYLES",e.MISSING_VIEWPORT_DIMENSIONS="MISSING_VIEWPORT_DIMENSIONS",e.NODE_INVALID="NODE_INVALID",e.NODE_NOT_FOUND="NODE_NOT_FOUND",e.NODE_MISSING_PARENT="NODE_MISSING_PARENT",e.NODE_TYPE_MISSING="NODE_TYPE_MISSING",e.NODE_EXTENT_INVALID="NODE_EXTENT_INVALID",e.EDGE_INVALID="EDGE_INVALID",e.EDGE_NOT_FOUND="EDGE_NOT_FOUND",e.EDGE_SOURCE_MISSING="EDGE_SOURCE_MISSING",e.EDGE_TARGET_MISSING="EDGE_TARGET_MISSING",e.EDGE_TYPE_MISSING="EDGE_TYPE_MISSING",e.EDGE_SOURCE_TARGET_SAME="EDGE_SOURCE_TARGET_SAME",e.EDGE_SOURCE_TARGET_MISSING="EDGE_SOURCE_TARGET_MISSING",e.EDGE_ORPHANED="EDGE_ORPHANED",e.USEVUEFLOW_OPTIONS="USEVUEFLOW_OPTIONS",e))(ze||{});const Hu={MISSING_STYLES:()=>"It seems that you haven't loaded the necessary styles. Please import '@vue-flow/core/dist/style.css' to ensure that the graph is rendered correctly",MISSING_VIEWPORT_DIMENSIONS:()=>"The Vue Flow parent container needs a width and a height to render the graph",NODE_INVALID:e=>`Node is invalid
159
+ Node: ${e}`,NODE_NOT_FOUND:e=>`Node not found
160
+ Node: ${e}`,NODE_MISSING_PARENT:(e,t)=>`Node is missing a parent
161
+ Node: ${e}
162
+ Parent: ${t}`,NODE_TYPE_MISSING:e=>`Node type is missing
163
+ Type: ${e}`,NODE_EXTENT_INVALID:e=>`Only child nodes can use a parent extent
164
+ Node: ${e}`,EDGE_INVALID:e=>`An edge needs a source and a target
165
+ Edge: ${e}`,EDGE_SOURCE_MISSING:(e,t)=>`Edge source is missing
166
+ Edge: ${e}
167
+ Source: ${t}`,EDGE_TARGET_MISSING:(e,t)=>`Edge target is missing
168
+ Edge: ${e}
169
+ Target: ${t}`,EDGE_TYPE_MISSING:e=>`Edge type is missing
170
+ Type: ${e}`,EDGE_SOURCE_TARGET_SAME:(e,t,n)=>`Edge source and target are the same
171
+ Edge: ${e}
172
+ Source: ${t}
173
+ Target: ${n}`,EDGE_SOURCE_TARGET_MISSING:(e,t,n)=>`Edge source or target is missing
174
+ Edge: ${e}
175
+ Source: ${t}
176
+ Target: ${n}`,EDGE_ORPHANED:e=>`Edge was orphaned (suddenly missing source or target) and has been removed
177
+ Edge: ${e}`,EDGE_NOT_FOUND:e=>`Edge not found
178
+ Edge: ${e}`,USEVUEFLOW_OPTIONS:()=>"The options parameter is deprecated and will be removed in the next major version. Please use the id parameter instead"};class Ue extends Error{constructor(t,...n){var r;super((r=Hu[t])==null?void 0:r.call(Hu,...n)),this.name="VueFlowError",this.code=t,this.args=n}}function nl(e){return"clientX"in e}function Dk(e){return"sourceEvent"in e}function It(e,t){const n=nl(e);let r,o;return n?(r=e.clientX,o=e.clientY):"touches"in e&&e.touches.length>0?(r=e.touches[0].clientX,o=e.touches[0].clientY):"changedTouches"in e&&e.changedTouches.length>0?(r=e.changedTouches[0].clientX,o=e.changedTouches[0].clientY):(r=0,o=0),{x:r-(t?.left??0),y:o-(t?.top??0)}}const ui=()=>{var e;return typeof navigator<"u"&&((e=navigator?.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function $k(e){var t,n;return{width:((t=e.dimensions)==null?void 0:t.width)??e.width??0,height:((n=e.dimensions)==null?void 0:n.height)??e.height??0}}function Ri(e,t=[1,1]){return{x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}}const Vk=()=>!0;function ls(e){e?.classList.remove("valid","connecting","vue-flow__handle-valid","vue-flow__handle-connecting")}function Bk(e,t,n){const r=[],o={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())li(o,ai(i))>0&&r.push(i);return r}const Fk=250;function zk(e,t,n,r){var o,i;let s=[],a=Number.POSITIVE_INFINITY;const l=Bk(e,n,t+Fk);for(const u of l){const c=[...((o=u.handleBounds)==null?void 0:o.source)??[],...((i=u.handleBounds)==null?void 0:i.target)??[]];for(const d of c){if(r.nodeId===d.nodeId&&r.type===d.type&&r.id===d.id)continue;const{x:f,y:h}=or(u,d,d.position,!0),p=Math.sqrt((f-e.x)**2+(h-e.y)**2);p>t||(p<a?(s=[{...d,x:f,y:h}],a=p):p===a&&s.push({...d,x:f,y:h}))}}if(!s.length)return null;if(s.length>1){const u=r.type==="source"?"target":"source";return s.find(c=>c.type===u)??s[0]}return s[0]}function Gu(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:o,fromType:i,doc:s,lib:a,flowId:l,isValidConnection:u=Vk},c,d,f,h){const p=i==="target",b=t?s.querySelector(`.${a}-flow__handle[data-id="${l}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:_,y}=It(e),g=s.elementFromPoint(_,y),m=g?.classList.contains(`${a}-flow__handle`)?g:b,v={handleDomNode:m,isValid:!1,connection:null,toHandle:null};if(m){const x=Yf(void 0,m),L=m.getAttribute("data-nodeid"),P=m.getAttribute("data-handleid"),O=m.classList.contains("connectable"),W=m.classList.contains("connectableend");if(!L||!x)return v;const N={source:p?L:r,sourceHandle:p?P:o,target:p?r:L,targetHandle:p?o:P};v.connection=N;const C=O&&W&&(n===cn.Strict?p&&x==="source"||!p&&x==="target":L!==r||P!==o);v.isValid=C&&u(N,{nodes:d,edges:c,sourceNode:f(N.source),targetNode:f(N.target)}),v.toHandle=Xf(L,x,P,h,n,!0)}return v}function Yf(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function Hk(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function Gk(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}function Xf(e,t,n,r,o,i=!1){var s,a,l;const u=r.get(e);if(!u)return null;const c=o===cn.Strict?(s=u.handleBounds)==null?void 0:s[t]:[...((a=u.handleBounds)==null?void 0:a.source)??[],...((l=u.handleBounds)==null?void 0:l.target)??[]],d=(n?c?.find(f=>f.id===n):c?.[0])??null;return d&&i?{...d,...or(u,d,d.position,!0)}:d}const ia={[he.Left]:he.Right,[he.Right]:he.Left,[he.Top]:he.Bottom,[he.Bottom]:he.Top},jk=["production","prod"];function oo(e,...t){Kf()&&console.warn(`[Vue Flow]: ${e}`,...t)}function Kf(){return!jk.includes("production")}function ju(e,t,n,r,o){const i=t.querySelectorAll(`.vue-flow__handle.${e}`);return i?.length?Array.from(i).map(s=>{const a=s.getBoundingClientRect();return{id:s.getAttribute("data-handleid"),type:e,nodeId:o,position:s.getAttribute("data-handlepos"),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...Ni(s)}}):null}function sa(e,t,n,r,o,i=!1,s){o.value=!1,e.selected?(i||e.selected&&t)&&(r([e]),yt(()=>{s.blur()})):n([e])}function Be(e){return typeof k(e)<"u"}function Uk(e,t,n,r){if(!e||!e.source||!e.target)return n(new Ue(ze.EDGE_INVALID,e?.id??"[ID UNKNOWN]")),!1;let o;return dn(e)?o=e:o={...e,id:Ff(e)},o=Vf(o,void 0,r),kk(o,t)?!1:o}function Wk(e,t,n,r,o){if(!t.source||!t.target)return o(new Ue(ze.EDGE_INVALID,e.id)),!1;if(!n)return o(new Ue(ze.EDGE_NOT_FOUND,e.id)),!1;const{id:i,...s}=e;return{...s,id:r?Ff(t):i,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle}}function Uu(e,t,n){const r={},o=[];for(let i=0;i<e.length;++i){const s=e[i];if(!kn(s)){n(new Ue(ze.NODE_INVALID,s?.id)||`[ID UNKNOWN|INDEX ${i}]`);continue}const a=wk(s,t(s.id),s.parentNode);s.parentNode&&(r[s.parentNode]=!0),o[i]=a}for(const i of o){const s=t(i.parentNode)||o.find(a=>a.id===i.parentNode);i.parentNode&&!s&&n(new Ue(ze.NODE_MISSING_PARENT,i.id,i.parentNode)),(i.parentNode||r[i.id])&&(r[i.id]&&(i.isParent=!0),s&&(s.isParent=!0))}return o}function Wu(e,t,n,r,o,i){let s=o;const a=r.get(s)||new Map;r.set(s,a.set(n,t)),s=`${o}-${e}`;const l=r.get(s)||new Map;if(r.set(s,l.set(n,t)),i){s=`${o}-${e}-${i}`;const u=r.get(s)||new Map;r.set(s,u.set(n,t))}}function us(e,t,n){e.clear();for(const r of n){const{source:o,target:i,sourceHandle:s=null,targetHandle:a=null}=r,l={edgeId:r.id,source:o,target:i,sourceHandle:s,targetHandle:a},u=`${o}-${s}--${i}-${a}`,c=`${i}-${a}--${o}-${s}`;Wu("source",l,c,e,o,s),Wu("target",l,u,e,i,a)}}function qu(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function cs(e,t,n,r,o,i,s,a){const l=[];for(const u of e){const c=dn(u)?u:Uk(u,a,o,i);if(!c)continue;const d=n(c.source),f=n(c.target);if(!d||!f){o(new Ue(ze.EDGE_SOURCE_TARGET_MISSING,c.id,c.source,c.target));continue}if(!d){o(new Ue(ze.EDGE_SOURCE_MISSING,c.id,c.source));continue}if(!f){o(new Ue(ze.EDGE_TARGET_MISSING,c.id,c.target));continue}if(t&&!t(c,{edges:a,nodes:s,sourceNode:d,targetNode:f})){o(new Ue(ze.EDGE_INVALID,c.id));continue}const h=r(c.id);l.push({...Vf(c,h,i),sourceNode:d,targetNode:f})}return l}const Yu=Symbol("vueFlow"),Zf=Symbol("nodeId"),Qf=Symbol("nodeRef"),qk=Symbol("edgeId"),Yk=Symbol("edgeRef"),Mi=Symbol("slots");function Jf(e){const{vueFlowRef:t,snapToGrid:n,snapGrid:r,noDragClassName:o,nodeLookup:i,nodeExtent:s,nodeDragThreshold:a,viewport:l,autoPanOnNodeDrag:u,autoPanSpeed:c,nodesDraggable:d,panBy:f,findNode:h,multiSelectionActive:p,nodesSelectionActive:b,selectNodesOnDrag:_,removeSelectedElements:y,addSelectedNodes:g,updateNodePositions:m,emits:v}=Oe(),{onStart:x,onDrag:L,onStop:P,onClick:O,el:W,disabled:N,id:M,selectable:C,dragHandle:F}=e,E=Pt(!1);let $=[],A,V=null,z={x:void 0,y:void 0},G={x:0,y:0},U=null,K=!1,J=!1,q=0,S=!1;const w=Zk(),I=({x:ae,y:ge})=>{z={x:ae,y:ge};let B=!1;if($=$.map(R=>{const H={x:ae-R.distance.x,y:ge-R.distance.y},{computedPosition:Z}=tl(R,n.value?Ri(H,r.value):H,v.error,s.value,R.parentNode?h(R.parentNode):void 0);return B=B||R.position.x!==Z.x||R.position.y!==Z.y,R.position=Z,R}),J=J||B,!!B&&(m($,!0,!0),E.value=!0,U)){const[R,H]=as({id:M,dragItems:$,findNode:h});L({event:U,node:R,nodes:H})}},D=()=>{if(!V)return;const[ae,ge]=Wf(G,V,c.value);if(ae!==0||ge!==0){const B={x:(z.x??0)-ae/l.value.zoom,y:(z.y??0)-ge/l.value.zoom};f({x:ae,y:ge})&&I(B)}q=requestAnimationFrame(D)},j=(ae,ge)=>{K=!0;const B=h(M);!_.value&&!p.value&&B&&(B.selected||y()),B&&Te(C)&&_.value&&sa(B,p.value,g,y,b,!1,ge);const R=w(ae.sourceEvent);if(z=R,$=Ik(i.value,d.value,R,M),$.length){const[H,Z]=as({id:M,dragItems:$,findNode:h});x({event:ae.sourceEvent,node:H,nodes:Z})}},Q=(ae,ge)=>{var B;ae.sourceEvent.type==="touchmove"&&ae.sourceEvent.touches.length>1||(J=!1,a.value===0&&j(ae,ge),z=w(ae.sourceEvent),V=((B=t.value)==null?void 0:B.getBoundingClientRect())||null,G=It(ae.sourceEvent,V))},ne=(ae,ge)=>{const B=w(ae.sourceEvent);if(!S&&K&&u.value&&(S=!0,D()),!K){const R=B.xSnapped-(z.x??0),H=B.ySnapped-(z.y??0);Math.sqrt(R*R+H*H)>a.value&&j(ae,ge)}(z.x!==B.xSnapped||z.y!==B.ySnapped)&&$.length&&K&&(U=ae.sourceEvent,G=It(ae.sourceEvent,V),I(B))},oe=ae=>{let ge=!1;if(!K&&!E.value&&!p.value){const B=ae.sourceEvent,R=w(B),H=R.xSnapped-(z.x??0),Z=R.ySnapped-(z.y??0),Y=Math.sqrt(H*H+Z*Z);Y!==0&&Y<=a.value&&(O?.(B),ge=!0)}if($.length&&!ge){J&&(m($,!1,!1),J=!1);const[B,R]=as({id:M,dragItems:$,findNode:h});P({event:ae.sourceEvent,node:B,nodes:R})}$=[],E.value=!1,S=!1,K=!1,z={x:void 0,y:void 0},cancelAnimationFrame(q)};return xe([()=>Te(N),W],([ae,ge],B,R)=>{if(ge){const H=gt(ge);ae||(A=bE().on("start",Z=>Q(Z,ge)).on("drag",Z=>ne(Z,ge)).on("end",Z=>oe(Z)).filter(Z=>{const Y=Z.target,ue=Te(F);return!Z.button&&(!o.value||!Fu(Y,`.${o.value}`,ge)&&(!ue||Fu(Y,ue,ge)))}),H.call(A)),R(()=>{H.on(".drag",null),A&&(A.on("start",null),A.on("drag",null),A.on("end",null))})}}),E}function Xk(){return{doubleClick:de(),click:de(),mouseEnter:de(),mouseMove:de(),mouseLeave:de(),contextMenu:de(),updateStart:de(),update:de(),updateEnd:de()}}function Kk(e,t){const n=Xk();return n.doubleClick.on(r=>{var o,i;t.edgeDoubleClick(r),(i=(o=e.events)==null?void 0:o.doubleClick)==null||i.call(o,r)}),n.click.on(r=>{var o,i;t.edgeClick(r),(i=(o=e.events)==null?void 0:o.click)==null||i.call(o,r)}),n.mouseEnter.on(r=>{var o,i;t.edgeMouseEnter(r),(i=(o=e.events)==null?void 0:o.mouseEnter)==null||i.call(o,r)}),n.mouseMove.on(r=>{var o,i;t.edgeMouseMove(r),(i=(o=e.events)==null?void 0:o.mouseMove)==null||i.call(o,r)}),n.mouseLeave.on(r=>{var o,i;t.edgeMouseLeave(r),(i=(o=e.events)==null?void 0:o.mouseLeave)==null||i.call(o,r)}),n.contextMenu.on(r=>{var o,i;t.edgeContextMenu(r),(i=(o=e.events)==null?void 0:o.contextMenu)==null||i.call(o,r)}),n.updateStart.on(r=>{var o,i;t.edgeUpdateStart(r),(i=(o=e.events)==null?void 0:o.updateStart)==null||i.call(o,r)}),n.update.on(r=>{var o,i;t.edgeUpdate(r),(i=(o=e.events)==null?void 0:o.update)==null||i.call(o,r)}),n.updateEnd.on(r=>{var o,i;t.edgeUpdateEnd(r),(i=(o=e.events)==null?void 0:o.updateEnd)==null||i.call(o,r)}),Object.entries(n).reduce((r,[o,i])=>(r.emit[o]=i.trigger,r.on[o]=i.on,r),{emit:{},on:{}})}function Zk(){const{viewport:e,snapGrid:t,snapToGrid:n,vueFlowRef:r}=Oe();return o=>{var i;const s=((i=r.value)==null?void 0:i.getBoundingClientRect())??{left:0,top:0},a=Dk(o)?o.sourceEvent:o,{x:l,y:u}=It(a,s),c=jr({x:l,y:u},e.value),{x:d,y:f}=n.value?Ri(c,t.value):c;return{xSnapped:d,ySnapped:f,...c}}}function bo(){return!0}function eh({handleId:e,nodeId:t,type:n,isValidConnection:r,edgeUpdaterType:o,onEdgeUpdate:i,onEdgeUpdateEnd:s}){const{id:a,vueFlowRef:l,connectionMode:u,connectionRadius:c,connectOnClick:d,connectionClickStartHandle:f,nodesConnectable:h,autoPanOnConnect:p,autoPanSpeed:b,findNode:_,panBy:y,startConnection:g,updateConnection:m,endConnection:v,emits:x,viewport:L,edges:P,nodes:O,isValidConnection:W,nodeLookup:N}=Oe();let M=null,C=!1,F=null;function E(A){var V;const z=Te(n)==="target",G=nl(A),U=Pu(A.target),K=A.currentTarget;if(K&&(G&&A.button===0||!G)){let J=function(pe){B=It(pe,oe),I=zk(jr(B,L.value,!1,[1,1]),c.value,N.value,Z),R||(H(),R=!0);const Ee=Gu(pe,{handle:I,connectionMode:u.value,fromNodeId:Te(t),fromHandleId:Te(e),fromType:z?"target":"source",isValidConnection:w,doc:U,lib:"vue",flowId:a,nodeLookup:N.value},P.value,O.value,_,N.value);F=Ee.handleDomNode,M=Ee.connection,C=Gk(!!I,Ee.isValid);const Se={...ve,isValid:C,to:Ee.toHandle&&C?Gr({x:Ee.toHandle.x,y:Ee.toHandle.y},L.value):B,toHandle:Ee.toHandle,toPosition:C&&Ee.toHandle?Ee.toHandle.position:ia[Z.position],toNode:Ee.toHandle?N.value.get(Ee.toHandle.nodeId):null};if(C&&I&&ve?.toHandle&&Se.toHandle&&ve.toHandle.type===Se.toHandle.type&&ve.toHandle.nodeId===Se.toHandle.nodeId&&ve.toHandle.id===Se.toHandle.id&&ve.to.x===Se.to.x&&ve.to.y===Se.to.y)return;const Ie=I??Ee.toHandle;if(m(Ie&&C?Gr({x:Ie.x,y:Ie.y},L.value):B,Ie,Hk(!!Ie,C)),ve=Se,!I&&!C&&!F)return ls(ge);M&&M.source!==M.target&&F&&(ls(ge),ge=F,F.classList.add("connecting","vue-flow__handle-connecting"),F.classList.toggle("valid",!!C),F.classList.toggle("vue-flow__handle-valid",!!C))},q=function(pe){"touches"in pe&&pe.touches.length>0||((I||F)&&M&&C&&(i?i(pe,M):x.connect(M)),x.connectEnd(pe),o&&s?.(pe),ls(ge),cancelAnimationFrame(D),v(pe),R=!1,C=!1,M=null,F=null,U.removeEventListener("mousemove",J),U.removeEventListener("mouseup",q),U.removeEventListener("touchmove",J),U.removeEventListener("touchend",q))};const S=_(Te(t));let w=Te(r)||W.value||bo;!w&&S&&(w=(z?S.isValidSourcePos:S.isValidTargetPos)||bo);let I,D=0;const{x:j,y:Q}=It(A),ne=Yf(Te(o),K),oe=(V=l.value)==null?void 0:V.getBoundingClientRect();if(!oe||!ne)return;const ae=Xf(Te(t),ne,Te(e),N.value,u.value);if(!ae)return;let ge,B=It(A,oe),R=!1;const H=()=>{if(!p.value)return;const[pe,Ee]=Wf(B,oe,b.value);y({x:pe,y:Ee}),D=requestAnimationFrame(H)},Z={...ae,nodeId:Te(t),type:ne,position:ae.position},Y=N.value.get(Te(t)),ce={inProgress:!0,isValid:null,from:or(Y,Z,he.Left,!0),fromHandle:Z,fromPosition:Z.position,fromNode:Y,to:B,toHandle:null,toPosition:ia[Z.position],toNode:null};g({nodeId:Te(t),id:Te(e),type:ne,position:K?.getAttribute("data-handlepos")||he.Top,...B},{x:j-oe.left,y:Q-oe.top}),x.connectStart({event:A,nodeId:Te(t),handleId:Te(e),handleType:ne});let ve=ce;U.addEventListener("mousemove",J),U.addEventListener("mouseup",q),U.addEventListener("touchmove",J),U.addEventListener("touchend",q)}}function $(A){var V,z;if(!d.value)return;const G=Te(n)==="target";if(!f.value){x.clickConnectStart({event:A,nodeId:Te(t),handleId:Te(e)}),g({nodeId:Te(t),type:Te(n),id:Te(e),position:he.Top,...It(A)},void 0,!0);return}let U=Te(r)||W.value||bo;const K=_(Te(t));if(!U&&K&&(U=(G?K.isValidSourcePos:K.isValidTargetPos)||bo),K&&(typeof K.connectable>"u"?h.value:K.connectable)===!1)return;const J=Pu(A.target),q=Gu(A,{handle:{nodeId:Te(t),id:Te(e),type:Te(n),position:he.Top,...It(A)},connectionMode:u.value,fromNodeId:f.value.nodeId,fromHandleId:f.value.id??null,fromType:f.value.type,isValidConnection:U,doc:J,lib:"vue",flowId:a,nodeLookup:N.value},P.value,O.value,_,N.value),S=((V=q.connection)==null?void 0:V.source)===((z=q.connection)==null?void 0:z.target);q.isValid&&q.connection&&!S&&x.connect(q.connection),x.clickConnectEnd(A),v(A,!0)}return{handlePointerDown:E,handleClick:$}}function Qk(){return lr(Zf,"")}function th(e){const t=e??Qk()??"",n=lr(Qf,fe(null)),{findNode:r,edges:o,emits:i}=Oe(),s=r(t);return s||i.error(new Ue(ze.NODE_NOT_FOUND,t)),{id:t,nodeEl:n,node:s,parentNode:te(()=>r(s.parentNode)),connectedEdges:te(()=>jf([s],o.value))}}function Jk(){return{doubleClick:de(),click:de(),mouseEnter:de(),mouseMove:de(),mouseLeave:de(),contextMenu:de(),dragStart:de(),drag:de(),dragStop:de()}}function eC(e,t){const n=Jk();return n.doubleClick.on(r=>{var o,i;t.nodeDoubleClick(r),(i=(o=e.events)==null?void 0:o.doubleClick)==null||i.call(o,r)}),n.click.on(r=>{var o,i;t.nodeClick(r),(i=(o=e.events)==null?void 0:o.click)==null||i.call(o,r)}),n.mouseEnter.on(r=>{var o,i;t.nodeMouseEnter(r),(i=(o=e.events)==null?void 0:o.mouseEnter)==null||i.call(o,r)}),n.mouseMove.on(r=>{var o,i;t.nodeMouseMove(r),(i=(o=e.events)==null?void 0:o.mouseMove)==null||i.call(o,r)}),n.mouseLeave.on(r=>{var o,i;t.nodeMouseLeave(r),(i=(o=e.events)==null?void 0:o.mouseLeave)==null||i.call(o,r)}),n.contextMenu.on(r=>{var o,i;t.nodeContextMenu(r),(i=(o=e.events)==null?void 0:o.contextMenu)==null||i.call(o,r)}),n.dragStart.on(r=>{var o,i;t.nodeDragStart(r),(i=(o=e.events)==null?void 0:o.dragStart)==null||i.call(o,r)}),n.drag.on(r=>{var o,i;t.nodeDrag(r),(i=(o=e.events)==null?void 0:o.drag)==null||i.call(o,r)}),n.dragStop.on(r=>{var o,i;t.nodeDragStop(r),(i=(o=e.events)==null?void 0:o.dragStop)==null||i.call(o,r)}),Object.entries(n).reduce((r,[o,i])=>(r.emit[o]=i.trigger,r.on[o]=i.on,r),{emit:{},on:{}})}function nh(){const{getSelectedNodes:e,nodeExtent:t,updateNodePositions:n,findNode:r,snapGrid:o,snapToGrid:i,nodesDraggable:s,emits:a}=Oe();return(l,u=!1)=>{const c=i.value?o.value[0]:5,d=i.value?o.value[1]:5,f=u?4:1,h=l.x*c*f,p=l.y*d*f,b=[];for(const _ of e.value)if(_.draggable||s&&typeof _.draggable>"u"){const y={x:_.computedPosition.x+h,y:_.computedPosition.y+p},{position:g}=tl(_,y,a.error,t.value,_.parentNode?r(_.parentNode):void 0);b.push({id:_.id,position:g,from:_.position,distance:{x:l.x,y:l.y},dimensions:_.dimensions})}n(b,!0,!1)}}const wo=.1,tC=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2;function Jt(){return oo("Viewport not initialized yet."),Promise.resolve(!1)}const nC={zoomIn:Jt,zoomOut:Jt,zoomTo:Jt,fitView:Jt,setCenter:Jt,fitBounds:Jt,project:e=>e,screenToFlowCoordinate:e=>e,flowToScreenCoordinate:e=>e,setViewport:Jt,setTransform:Jt,getViewport:()=>({x:0,y:0,zoom:1}),getTransform:()=>({x:0,y:0,zoom:1}),viewportInitialized:!1};function rC(e){function t(r,o){return new Promise(i=>{e.d3Selection&&e.d3Zoom?e.d3Zoom.interpolate(o?.interpolate==="linear"?Ar:Io).scaleBy(ds(e.d3Selection,o?.duration,o?.ease,()=>{i(!0)}),r):i(!1)})}function n(r,o,i,s){return new Promise(a=>{var l;const{x:u,y:c}=$f({x:-r,y:-o},e.translateExtent),d=rr.translate(-u,-c).scale(i);e.d3Selection&&e.d3Zoom?(l=e.d3Zoom)==null||l.interpolate(s?.interpolate==="linear"?Ar:Io).transform(ds(e.d3Selection,s?.duration,s?.ease,()=>{a(!0)}),d):a(!1)})}return te(()=>e.d3Zoom&&e.d3Selection&&e.dimensions.width&&e.dimensions.height?{viewportInitialized:!0,zoomIn:o=>t(1.2,o),zoomOut:o=>t(1/1.2,o),zoomTo:(o,i)=>new Promise(s=>{e.d3Selection&&e.d3Zoom?e.d3Zoom.interpolate(i?.interpolate==="linear"?Ar:Io).scaleTo(ds(e.d3Selection,i?.duration,i?.ease,()=>{s(!0)}),o):s(!1)}),setViewport:(o,i)=>n(o.x,o.y,o.zoom,i),setTransform:(o,i)=>n(o.x,o.y,o.zoom,i),getViewport:()=>({x:e.viewport.x,y:e.viewport.y,zoom:e.viewport.zoom}),getTransform:()=>({x:e.viewport.x,y:e.viewport.y,zoom:e.viewport.zoom}),fitView:(o={padding:wo,includeHiddenNodes:!1,duration:0})=>{var i,s;const a=[];for(const f of e.nodes)f.dimensions.width&&f.dimensions.height&&(o?.includeHiddenNodes||!f.hidden)&&(!((i=o.nodes)!=null&&i.length)||(s=o.nodes)!=null&&s.length&&o.nodes.includes(f.id))&&a.push(f);if(!a.length)return Promise.resolve(!1);const l=Hf(a),{x:u,y:c,zoom:d}=Nu(l,e.dimensions.width,e.dimensions.height,o.minZoom??e.minZoom,o.maxZoom??e.maxZoom,o.padding??wo);return n(u,c,d,o)},setCenter:(o,i,s)=>{const a=typeof s?.zoom<"u"?s.zoom:e.maxZoom,l=e.dimensions.width/2-o*a,u=e.dimensions.height/2-i*a;return n(l,u,a,s)},fitBounds:(o,i={padding:wo})=>{const{x:s,y:a,zoom:l}=Nu(o,e.dimensions.width,e.dimensions.height,e.minZoom,e.maxZoom,i.padding??wo);return n(s,a,l,i)},project:o=>jr(o,e.viewport,e.snapToGrid,e.snapGrid),screenToFlowCoordinate:o=>{if(e.vueFlowRef){const{x:i,y:s}=e.vueFlowRef.getBoundingClientRect(),a={x:o.x-i,y:o.y-s};return jr(a,e.viewport,e.snapToGrid,e.snapGrid)}return{x:0,y:0}},flowToScreenCoordinate:o=>{if(e.vueFlowRef){const{x:i,y:s}=e.vueFlowRef.getBoundingClientRect(),a={x:o.x+i,y:o.y+s};return Gr(a,e.viewport)}return{x:0,y:0}}}:nC)}function ds(e,t=0,n=tC,r=()=>{}){const o=typeof t=="number"&&t>0;return o||r(),o?e.transition().duration(t).ease(n).on("end",r):e}function oC(e,t,n){const r=_c(!0);return r.run(()=>{const o=()=>{r.run(()=>{let b,_,y=!!(n.nodes.value.length||n.edges.value.length);b=$n([e.modelValue,()=>{var g,m;return(m=(g=e.modelValue)==null?void 0:g.value)==null?void 0:m.length}],([g])=>{g&&Array.isArray(g)&&(_?.pause(),n.setElements(g),!_&&!y&&g.length?y=!0:_?.resume())}),_=$n([n.nodes,n.edges,()=>n.edges.value.length,()=>n.nodes.value.length],([g,m])=>{var v;(v=e.modelValue)!=null&&v.value&&Array.isArray(e.modelValue.value)&&(b?.pause(),e.modelValue.value=[...g,...m],yt(()=>{b?.resume()}))},{immediate:y}),kr(()=>{b?.stop(),_?.stop()})})},i=()=>{r.run(()=>{let b,_,y=!!n.nodes.value.length;b=$n([e.nodes,()=>{var g,m;return(m=(g=e.nodes)==null?void 0:g.value)==null?void 0:m.length}],([g])=>{g&&Array.isArray(g)&&(_?.pause(),n.setNodes(g),!_&&!y&&g.length?y=!0:_?.resume())}),_=$n([n.nodes,()=>n.nodes.value.length],([g])=>{var m;(m=e.nodes)!=null&&m.value&&Array.isArray(e.nodes.value)&&(b?.pause(),e.nodes.value=[...g],yt(()=>{b?.resume()}))},{immediate:y}),kr(()=>{b?.stop(),_?.stop()})})},s=()=>{r.run(()=>{let b,_,y=!!n.edges.value.length;b=$n([e.edges,()=>{var g,m;return(m=(g=e.edges)==null?void 0:g.value)==null?void 0:m.length}],([g])=>{g&&Array.isArray(g)&&(_?.pause(),n.setEdges(g),!_&&!y&&g.length?y=!0:_?.resume())}),_=$n([n.edges,()=>n.edges.value.length],([g])=>{var m;(m=e.edges)!=null&&m.value&&Array.isArray(e.edges.value)&&(b?.pause(),e.edges.value=[...g],yt(()=>{b?.resume()}))},{immediate:y}),kr(()=>{b?.stop(),_?.stop()})})},a=()=>{r.run(()=>{xe(()=>t.maxZoom,()=>{t.maxZoom&&Be(t.maxZoom)&&n.setMaxZoom(t.maxZoom)},{immediate:!0})})},l=()=>{r.run(()=>{xe(()=>t.minZoom,()=>{t.minZoom&&Be(t.minZoom)&&n.setMinZoom(t.minZoom)},{immediate:!0})})},u=()=>{r.run(()=>{xe(()=>t.translateExtent,()=>{t.translateExtent&&Be(t.translateExtent)&&n.setTranslateExtent(t.translateExtent)},{immediate:!0})})},c=()=>{r.run(()=>{xe(()=>t.nodeExtent,()=>{t.nodeExtent&&Be(t.nodeExtent)&&n.setNodeExtent(t.nodeExtent)},{immediate:!0})})},d=()=>{r.run(()=>{xe(()=>t.applyDefault,()=>{Be(t.applyDefault)&&(n.applyDefault.value=t.applyDefault)},{immediate:!0})})},f=()=>{r.run(()=>{const b=async _=>{let y=_;typeof t.autoConnect=="function"&&(y=await t.autoConnect(_)),y!==!1&&n.addEdges([y])};xe(()=>t.autoConnect,()=>{Be(t.autoConnect)&&(n.autoConnect.value=t.autoConnect)},{immediate:!0}),xe(n.autoConnect,(_,y,g)=>{_?n.onConnect(b):n.hooks.value.connect.off(b),g(()=>{n.hooks.value.connect.off(b)})},{immediate:!0})})},h=()=>{const b=["id","modelValue","translateExtent","nodeExtent","edges","nodes","maxZoom","minZoom","applyDefault","autoConnect"];for(const _ of Object.keys(t)){const y=_;if(!b.includes(y)){const g=Re(()=>t[y]),m=n[y];wa(m)&&r.run(()=>{xe(g,v=>{Be(v)&&(m.value=v)},{immediate:!0})})}}};o(),i(),s(),l(),a(),u(),c(),d(),f(),h()}),()=>r.stop()}function iC(){return{edgesChange:de(),nodesChange:de(),nodeDoubleClick:de(),nodeClick:de(),nodeMouseEnter:de(),nodeMouseMove:de(),nodeMouseLeave:de(),nodeContextMenu:de(),nodeDragStart:de(),nodeDrag:de(),nodeDragStop:de(),nodesInitialized:de(),miniMapNodeClick:de(),miniMapNodeDoubleClick:de(),miniMapNodeMouseEnter:de(),miniMapNodeMouseMove:de(),miniMapNodeMouseLeave:de(),connect:de(),connectStart:de(),connectEnd:de(),clickConnectStart:de(),clickConnectEnd:de(),paneReady:de(),init:de(),move:de(),moveStart:de(),moveEnd:de(),selectionDragStart:de(),selectionDrag:de(),selectionDragStop:de(),selectionContextMenu:de(),selectionStart:de(),selectionEnd:de(),viewportChangeStart:de(),viewportChange:de(),viewportChangeEnd:de(),paneScroll:de(),paneClick:de(),paneContextMenu:de(),paneMouseEnter:de(),paneMouseMove:de(),paneMouseLeave:de(),edgeContextMenu:de(),edgeMouseEnter:de(),edgeMouseMove:de(),edgeMouseLeave:de(),edgeDoubleClick:de(),edgeClick:de(),edgeUpdateStart:de(),edgeUpdate:de(),edgeUpdateEnd:de(),updateNodeInternals:de(),error:de(e=>oo(e.message))}}function sC(e,t){const n=ur();Xh(()=>{for(const[o,i]of Object.entries(t.value)){const s=a=>{e(o,a)};i.setEmitter(s),Vr(i.removeEmitter),i.setHasEmitListeners(()=>r(o)),Vr(i.removeHasEmitListeners)}});function r(o){var i;const s=aC(o);return!!((i=n?.vnode.props)==null?void 0:i[s])}}function aC(e){const[t,...n]=e.split(":");return`on${t.replace(/(?:^|-)(\w)/g,(o,i)=>i.toUpperCase())}${n.length?`:${n.join(":")}`:""}`}function rh(){return{vueFlowRef:null,viewportRef:null,nodes:[],edges:[],connectionLookup:new Map,nodeTypes:{},edgeTypes:{},initialized:!1,dimensions:{width:0,height:0},viewport:{x:0,y:0,zoom:1},d3Zoom:null,d3Selection:null,d3ZoomHandler:null,minZoom:.5,maxZoom:2,translateExtent:[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],nodeExtent:[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],selectionMode:el.Full,paneDragging:!1,preventScrolling:!0,zoomOnScroll:!0,zoomOnPinch:!0,zoomOnDoubleClick:!0,panOnScroll:!1,panOnScrollSpeed:.5,panOnScrollMode:Lr.Free,paneClickDistance:0,panOnDrag:!0,edgeUpdaterRadius:10,onlyRenderVisibleElements:!1,defaultViewport:{x:0,y:0,zoom:1},nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,defaultMarkerColor:"#b1b1b7",connectionLineStyle:{},connectionLineType:null,connectionLineOptions:{type:gn.Bezier,style:{}},connectionMode:cn.Loose,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectionPosition:{x:Number.NaN,y:Number.NaN},connectionRadius:20,connectOnClick:!0,connectionStatus:null,isValidConnection:null,snapGrid:[15,15],snapToGrid:!1,edgesUpdatable:!1,edgesFocusable:!0,nodesFocusable:!0,nodesConnectable:!0,nodesDraggable:!0,nodeDragThreshold:1,elementsSelectable:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,selectionKeyCode:"Shift",multiSelectionKeyCode:ui()?"Meta":"Control",zoomActivationKeyCode:ui()?"Meta":"Control",deleteKeyCode:"Backspace",panActivationKeyCode:"Space",hooks:iC(),applyDefault:!0,autoConnect:!1,fitViewOnInit:!1,fitViewOnInitDone:!1,noDragClassName:"nodrag",noWheelClassName:"nowheel",noPanClassName:"nopan",defaultEdgeOptions:void 0,elevateEdgesOnSelect:!1,elevateNodesOnSelect:!0,autoPanOnNodeDrag:!0,autoPanOnConnect:!0,autoPanSpeed:15,disableKeyboardA11y:!1,ariaLiveMessage:""}}const lC=["id","vueFlowRef","viewportRef","initialized","modelValue","nodes","edges","maxZoom","minZoom","translateExtent","hooks","defaultEdgeOptions"];function uC(e,t,n){const r=rC(e),o=B=>{const R=B??[];e.hooks.updateNodeInternals.trigger(R)},i=B=>xk(B,e.nodes,e.edges),s=B=>Ek(B,e.nodes,e.edges),a=B=>jf(B,e.edges),l=({id:B,type:R,nodeId:H})=>{var Z;const Y=B?`-${R}-${B}`:`-${R}`;return Array.from(((Z=e.connectionLookup.get(`${H}${Y}`))==null?void 0:Z.values())??[])},u=B=>{if(B)return t.value.get(B)},c=B=>{if(B)return n.value.get(B)},d=(B,R,H)=>{var Z,Y;const ue=[];for(const ce of B){const ve={id:ce.id,type:"position",dragging:H,from:ce.from};if(R&&(ve.position=ce.position,ce.parentNode)){const pe=u(ce.parentNode);ve.position={x:ve.position.x-(((Z=pe?.computedPosition)==null?void 0:Z.x)??0),y:ve.position.y-(((Y=pe?.computedPosition)==null?void 0:Y.y)??0)}}ue.push(ve)}ue?.length&&e.hooks.nodesChange.trigger(ue)},f=B=>{if(!e.vueFlowRef)return;const R=e.vueFlowRef.querySelector(".vue-flow__transformationpane");if(!R)return;const H=window.getComputedStyle(R),{m22:Z}=new window.DOMMatrixReadOnly(H.transform),Y=[];for(const ue of B){const ce=ue,ve=u(ce.id);if(ve){const pe=Ni(ce.nodeElement);if(!!(pe.width&&pe.height&&(ve.dimensions.width!==pe.width||ve.dimensions.height!==pe.height||ce.forceUpdate))){const Se=ce.nodeElement.getBoundingClientRect();ve.dimensions=pe,ve.handleBounds.source=ju("source",ce.nodeElement,Se,Z,ve.id),ve.handleBounds.target=ju("target",ce.nodeElement,Se,Z,ve.id),Y.push({id:ve.id,type:"dimensions",dimensions:pe})}}}!e.fitViewOnInitDone&&e.fitViewOnInit&&r.value.fitView().then(()=>{e.fitViewOnInitDone=!0}),Y.length&&e.hooks.nodesChange.trigger(Y)},h=(B,R)=>{const H=new Set,Z=new Set;for(const ce of B)kn(ce)?H.add(ce.id):dn(ce)&&Z.add(ce.id);const Y=rn(t.value,H,!0),ue=rn(n.value,Z);if(e.multiSelectionActive){for(const ce of H)Y.push(nn(ce,R));for(const ce of Z)ue.push(nn(ce,R))}Y.length&&e.hooks.nodesChange.trigger(Y),ue.length&&e.hooks.edgesChange.trigger(ue)},p=B=>{if(e.multiSelectionActive){const R=B.map(H=>nn(H.id,!0));e.hooks.nodesChange.trigger(R);return}e.hooks.nodesChange.trigger(rn(t.value,new Set(B.map(R=>R.id)),!0)),e.hooks.edgesChange.trigger(rn(n.value))},b=B=>{if(e.multiSelectionActive){const R=B.map(H=>nn(H.id,!0));e.hooks.edgesChange.trigger(R);return}e.hooks.edgesChange.trigger(rn(n.value,new Set(B.map(R=>R.id)))),e.hooks.nodesChange.trigger(rn(t.value,new Set,!0))},_=B=>{h(B,!0)},y=B=>{const H=(B||e.nodes).map(Z=>(Z.selected=!1,nn(Z.id,!1)));e.hooks.nodesChange.trigger(H)},g=B=>{const H=(B||e.edges).map(Z=>(Z.selected=!1,nn(Z.id,!1)));e.hooks.edgesChange.trigger(H)},m=B=>{if(!B||!B.length)return h([],!1);const R=B.reduce((H,Z)=>{const Y=nn(Z.id,!1);return kn(Z)?H.nodes.push(Y):H.edges.push(Y),H},{nodes:[],edges:[]});R.nodes.length&&e.hooks.nodesChange.trigger(R.nodes),R.edges.length&&e.hooks.edgesChange.trigger(R.edges)},v=B=>{var R;(R=e.d3Zoom)==null||R.scaleExtent([B,e.maxZoom]),e.minZoom=B},x=B=>{var R;(R=e.d3Zoom)==null||R.scaleExtent([e.minZoom,B]),e.maxZoom=B},L=B=>{var R;(R=e.d3Zoom)==null||R.translateExtent(B),e.translateExtent=B},P=B=>{e.nodeExtent=B,o()},O=B=>{var R;(R=e.d3Zoom)==null||R.clickDistance(B)},W=B=>{e.nodesDraggable=B,e.nodesConnectable=B,e.elementsSelectable=B},N=B=>{const R=B instanceof Function?B(e.nodes):B;!e.initialized&&!R.length||(e.nodes=Uu(R,u,e.hooks.error.trigger))},M=B=>{const R=B instanceof Function?B(e.edges):B;if(!e.initialized&&!R.length)return;const H=cs(R,e.isValidConnection,u,c,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges);us(e.connectionLookup,n.value,H),e.edges=H},C=B=>{const R=B instanceof Function?B([...e.nodes,...e.edges]):B;!e.initialized&&!R.length||(N(R.filter(kn)),M(R.filter(dn)))},F=B=>{let R=B instanceof Function?B(e.nodes):B;R=Array.isArray(R)?R:[R];const H=Uu(R,u,e.hooks.error.trigger),Z=[];for(const Y of H)Z.push(Du(Y));Z.length&&e.hooks.nodesChange.trigger(Z)},E=B=>{let R=B instanceof Function?B(e.edges):B;R=Array.isArray(R)?R:[R];const H=cs(R,e.isValidConnection,u,c,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges),Z=[];for(const Y of H)Z.push(Du(Y));Z.length&&e.hooks.edgesChange.trigger(Z)},$=(B,R=!0,H=!1)=>{const Z=B instanceof Function?B(e.nodes):B,Y=Array.isArray(Z)?Z:[Z],ue=[],ce=[];function ve(Ee){const Se=a(Ee);for(const Ie of Se)(!Be(Ie.deletable)||Ie.deletable)&&ce.push(Vu(Ie.id,Ie.source,Ie.target,Ie.sourceHandle,Ie.targetHandle))}function pe(Ee){const Se=[];for(const Ie of e.nodes)Ie.parentNode===Ee&&Se.push(Ie);if(Se.length){for(const Ie of Se)ue.push($u(Ie.id));R&&ve(Se);for(const Ie of Se)pe(Ie.id)}}for(const Ee of Y){const Se=typeof Ee=="string"?u(Ee):Ee;Se&&(Be(Se.deletable)&&!Se.deletable||(ue.push($u(Se.id)),R&&ve([Se]),H&&pe(Se.id)))}ce.length&&e.hooks.edgesChange.trigger(ce),ue.length&&e.hooks.nodesChange.trigger(ue)},A=B=>{const R=B instanceof Function?B(e.edges):B,H=Array.isArray(R)?R:[R],Z=[];for(const Y of H){const ue=typeof Y=="string"?c(Y):Y;ue&&(Be(ue.deletable)&&!ue.deletable||Z.push(Vu(typeof Y=="string"?Y:Y.id,ue.source,ue.target,ue.sourceHandle,ue.targetHandle)))}e.hooks.edgesChange.trigger(Z)},V=(B,R,H=!0)=>{const Z=c(B.id);if(!Z)return!1;const Y=e.edges.indexOf(Z),ue=Wk(B,R,Z,H,e.hooks.error.trigger);if(ue){const[ce]=cs([ue],e.isValidConnection,u,c,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges);return e.edges=e.edges.map((ve,pe)=>pe===Y?ce:ve),us(e.connectionLookup,n.value,[ce]),ce}return!1},z=(B,R,H={replace:!1})=>{const Z=c(B);if(!Z)return;const Y=typeof R=="function"?R(Z):R;Z.data=H.replace?Y:{...Z.data,...Y}},G=B=>Ou(B,e.nodes),U=B=>{const R=Ou(B,e.edges);return us(e.connectionLookup,n.value,R),R},K=(B,R,H={replace:!1})=>{const Z=u(B);if(!Z)return;const Y=typeof R=="function"?R(Z):R;H.replace?e.nodes.splice(e.nodes.indexOf(Z),1,Y):Object.assign(Z,Y)},J=(B,R,H={replace:!1})=>{const Z=u(B);if(!Z)return;const Y=typeof R=="function"?R(Z):R;Z.data=H.replace?Y:{...Z.data,...Y}},q=(B,R,H=!1)=>{H?e.connectionClickStartHandle=B:e.connectionStartHandle=B,e.connectionEndHandle=null,e.connectionStatus=null,R&&(e.connectionPosition=R)},S=(B,R=null,H=null)=>{e.connectionStartHandle&&(e.connectionPosition=B,e.connectionEndHandle=R,e.connectionStatus=H)},w=(B,R)=>{e.connectionPosition={x:Number.NaN,y:Number.NaN},e.connectionEndHandle=null,e.connectionStatus=null,R?e.connectionClickStartHandle=null:e.connectionStartHandle=null},I=B=>{const R=bk(B),H=R?null:xr(B)?B:u(B.id);return!R&&!H?[null,null,R]:[R?B:ai(H),H,R]},D=(B,R=!0,H=e.nodes)=>{const[Z,Y,ue]=I(B);if(!Z)return[];const ce=[];for(const ve of H||e.nodes){if(!ue&&(ve.id===Y.id||!ve.computedPosition))continue;const pe=ai(ve),Ee=li(pe,Z);(R&&Ee>0||Ee>=pe.width*pe.height||Ee>=Number(Z.width)*Number(Z.height))&&ce.push(ve)}return ce},j=(B,R,H=!0)=>{const[Z]=I(B);if(!Z)return!1;const Y=li(Z,R);return H&&Y>0||Y>=Number(Z.width)*Number(Z.height)},Q=B=>{const{viewport:R,dimensions:H,d3Zoom:Z,d3Selection:Y,translateExtent:ue}=e;if(!Z||!Y||!B.x&&!B.y)return!1;const ce=rr.translate(R.x+B.x,R.y+B.y).scale(R.zoom),ve=[[0,0],[H.width,H.height]],pe=Z.constrain()(ce,ve,ue),Ee=e.viewport.x!==pe.x||e.viewport.y!==pe.y||e.viewport.zoom!==pe.k;return Z.transform(Y,pe),Ee},ne=B=>{const R=B instanceof Function?B(e):B,H=["d3Zoom","d3Selection","d3ZoomHandler","viewportRef","vueFlowRef","dimensions","hooks"];Be(R.defaultEdgeOptions)&&(e.defaultEdgeOptions=R.defaultEdgeOptions);const Z=R.modelValue||R.nodes||R.edges?[]:void 0;Z&&(R.modelValue&&Z.push(...R.modelValue),R.nodes&&Z.push(...R.nodes),R.edges&&Z.push(...R.edges),C(Z));const Y=()=>{Be(R.maxZoom)&&x(R.maxZoom),Be(R.minZoom)&&v(R.minZoom),Be(R.translateExtent)&&L(R.translateExtent)};for(const ue of Object.keys(R)){const ce=ue,ve=R[ce];![...lC,...H].includes(ce)&&Be(ve)&&(e[ce]=ve)}Xs(()=>e.d3Zoom).not.toBeNull().then(Y),e.initialized||(e.initialized=!0)};return{updateNodePositions:d,updateNodeDimensions:f,setElements:C,setNodes:N,setEdges:M,addNodes:F,addEdges:E,removeNodes:$,removeEdges:A,findNode:u,findEdge:c,updateEdge:V,updateEdgeData:z,updateNode:K,updateNodeData:J,applyEdgeChanges:U,applyNodeChanges:G,addSelectedElements:_,addSelectedNodes:p,addSelectedEdges:b,setMinZoom:v,setMaxZoom:x,setTranslateExtent:L,setNodeExtent:P,setPaneClickDistance:O,removeSelectedElements:m,removeSelectedNodes:y,removeSelectedEdges:g,startConnection:q,updateConnection:S,endConnection:w,setInteractive:W,setState:ne,getIntersectingNodes:D,getIncomers:i,getOutgoers:s,getConnectedEdges:a,getHandleConnections:l,isNodeIntersecting:j,panBy:Q,fitView:B=>r.value.fitView(B),zoomIn:B=>r.value.zoomIn(B),zoomOut:B=>r.value.zoomOut(B),zoomTo:(B,R)=>r.value.zoomTo(B,R),setViewport:(B,R)=>r.value.setViewport(B,R),setTransform:(B,R)=>r.value.setTransform(B,R),getViewport:()=>r.value.getViewport(),getTransform:()=>r.value.getTransform(),setCenter:(B,R,H)=>r.value.setCenter(B,R,H),fitBounds:(B,R)=>r.value.fitBounds(B,R),project:B=>r.value.project(B),screenToFlowCoordinate:B=>r.value.screenToFlowCoordinate(B),flowToScreenCoordinate:B=>r.value.flowToScreenCoordinate(B),toObject:()=>{const B=[],R=[];for(const H of e.nodes){const{computedPosition:Z,handleBounds:Y,selected:ue,dimensions:ce,isParent:ve,resizing:pe,dragging:Ee,events:Se,...Ie}=H;B.push(Ie)}for(const H of e.edges){const{selected:Z,sourceNode:Y,targetNode:ue,events:ce,...ve}=H;R.push(ve)}return JSON.parse(JSON.stringify({nodes:B,edges:R,position:[e.viewport.x,e.viewport.y],zoom:e.viewport.zoom,viewport:e.viewport}))},fromObject:B=>new Promise(R=>{const{nodes:H,edges:Z,position:Y,zoom:ue,viewport:ce}=B;H&&N(H),Z&&M(Z);const[ve,pe]=ce?.x&&ce?.y?[ce.x,ce.y]:Y??[null,null];if(ve&&pe){const Ee=ce?.zoom||ue||e.viewport.zoom;return Xs(()=>r.value.viewportInitialized).toBe(!0).then(()=>{r.value.setViewport({x:ve,y:pe,zoom:Ee}).then(()=>{R(!0)})})}else R(!0)}),updateNodeInternals:o,viewportHelper:r,$reset:()=>{const B=rh();if(e.edges=[],e.nodes=[],e.d3Zoom&&e.d3Selection){const R=rr.translate(B.defaultViewport.x??0,B.defaultViewport.y??0).scale(Ln(B.defaultViewport.zoom??1,B.minZoom,B.maxZoom)),H=e.viewportRef.getBoundingClientRect(),Z=[[0,0],[H.width,H.height]],Y=e.d3Zoom.constrain()(R,Z,B.translateExtent);e.d3Zoom.transform(e.d3Selection,Y)}ne(B)},$destroy:()=>{}}}const cC=["data-id","data-handleid","data-nodeid","data-handlepos"],dC={name:"Handle",compatConfig:{MODE:3}},ir=me({...dC,props:{id:{default:null},type:{},position:{default:()=>he.Top},isValidConnection:{type:Function},connectable:{type:[Boolean,Number,String,Function],default:void 0},connectableStart:{type:Boolean,default:!0},connectableEnd:{type:Boolean,default:!0}},setup(e,{expose:t}){const n=ep(e,["position","connectable","connectableStart","connectableEnd","id"]),r=Re(()=>n.type??"source"),o=Re(()=>n.isValidConnection??null),{id:i,connectionStartHandle:s,connectionClickStartHandle:a,connectionEndHandle:l,vueFlowRef:u,nodesConnectable:c,noDragClassName:d,noPanClassName:f}=Oe(),{id:h,node:p,nodeEl:b,connectedEdges:_}=th(),y=fe(),g=Re(()=>typeof e.connectableStart<"u"?e.connectableStart:!0),m=Re(()=>typeof e.connectableEnd<"u"?e.connectableEnd:!0),v=Re(()=>{var M,C,F,E,$,A;return((M=s.value)==null?void 0:M.nodeId)===h&&((C=s.value)==null?void 0:C.id)===e.id&&((F=s.value)==null?void 0:F.type)===r.value||((E=l.value)==null?void 0:E.nodeId)===h&&(($=l.value)==null?void 0:$.id)===e.id&&((A=l.value)==null?void 0:A.type)===r.value}),x=Re(()=>{var M,C,F;return((M=a.value)==null?void 0:M.nodeId)===h&&((C=a.value)==null?void 0:C.id)===e.id&&((F=a.value)==null?void 0:F.type)===r.value}),{handlePointerDown:L,handleClick:P}=eh({nodeId:h,handleId:e.id,isValidConnection:o,type:r}),O=te(()=>typeof e.connectable=="string"&&e.connectable==="single"?!_.value.some(M=>{const C=M[`${r.value}Handle`];return M[r.value]!==h?!1:C?C===e.id:!0}):typeof e.connectable=="number"?_.value.filter(M=>{const C=M[`${r.value}Handle`];return M[r.value]!==h?!1:C?C===e.id:!0}).length<e.connectable:typeof e.connectable=="function"?e.connectable(p,_.value):Be(e.connectable)?e.connectable:c.value);nt(()=>{var M;if(!p.dimensions.width||!p.dimensions.height)return;const C=(M=p.handleBounds[r.value])==null?void 0:M.find(G=>G.id===e.id);if(!u.value||C)return;const F=u.value.querySelector(".vue-flow__transformationpane");if(!b.value||!y.value||!F||!e.id)return;const E=b.value.getBoundingClientRect(),$=y.value.getBoundingClientRect(),A=window.getComputedStyle(F),{m22:V}=new window.DOMMatrixReadOnly(A.transform),z={id:e.id,position:e.position,x:($.left-E.left)/V,y:($.top-E.top)/V,type:r.value,nodeId:h,...Ni(y.value)};p.handleBounds[r.value]=[...p.handleBounds[r.value]??[],z]});function W(M){const C=nl(M);O.value&&g.value&&(C&&M.button===0||!C)&&L(M)}function N(M){!h||!a.value&&!g.value||O.value&&P(M)}return t({handleClick:P,handlePointerDown:L,onClick:N,onPointerDown:W}),(M,C)=>(X(),re("div",{ref_key:"handle",ref:y,"data-id":`${k(i)}-${k(h)}-${e.id}-${r.value}`,"data-handleid":e.id,"data-nodeid":k(h),"data-handlepos":M.position,class:et(["vue-flow__handle",[`vue-flow__handle-${M.position}`,`vue-flow__handle-${e.id}`,k(d),k(f),r.value,{connectable:O.value,connecting:x.value,connectablestart:g.value,connectableend:m.value,connectionindicator:O.value&&(g.value&&!v.value||m.value&&v.value)}]]),onMousedown:W,onTouchstartPassive:W,onClick:N},[be(M.$slots,"default",{id:M.id})],42,cC))}}),Oi=function({sourcePosition:e=he.Bottom,targetPosition:t=he.Top,label:n,connectable:r=!0,isValidTargetPos:o,isValidSourcePos:i,data:s}){const a=s.label??n;return[Pe(ir,{type:"target",position:t,connectable:r,isValidConnection:o}),typeof a!="string"&&a?Pe(a):Pe(De,[a]),Pe(ir,{type:"source",position:e,connectable:r,isValidConnection:i})]};Oi.props=["sourcePosition","targetPosition","label","isValidTargetPos","isValidSourcePos","connectable","data"];Oi.inheritAttrs=!1;Oi.compatConfig={MODE:3};const fC=Oi,Di=function({targetPosition:e=he.Top,label:t,connectable:n=!0,isValidTargetPos:r,data:o}){const i=o.label??t;return[Pe(ir,{type:"target",position:e,connectable:n,isValidConnection:r}),typeof i!="string"&&i?Pe(i):Pe(De,[i])]};Di.props=["targetPosition","label","isValidTargetPos","connectable","data"];Di.inheritAttrs=!1;Di.compatConfig={MODE:3};const hC=Di,$i=function({sourcePosition:e=he.Bottom,label:t,connectable:n=!0,isValidSourcePos:r,data:o}){const i=o.label??t;return[typeof i!="string"&&i?Pe(i):Pe(De,[i]),Pe(ir,{type:"source",position:e,connectable:n,isValidConnection:r})]};$i.props=["sourcePosition","label","isValidSourcePos","connectable","data"];$i.inheritAttrs=!1;$i.compatConfig={MODE:3};const pC=$i,mC=["transform"],gC=["width","height","x","y","rx","ry"],vC=["y"],yC={name:"EdgeText",compatConfig:{MODE:3}},_C=me({...yC,props:{x:{},y:{},label:{},labelStyle:{default:()=>({})},labelShowBg:{type:Boolean,default:!0},labelBgStyle:{default:()=>({})},labelBgPadding:{default:()=>[2,4]},labelBgBorderRadius:{default:2}},setup(e){const t=fe({x:0,y:0,width:0,height:0}),n=fe(null),r=te(()=>`translate(${e.x-t.value.width/2} ${e.y-t.value.height/2})`);nt(o),xe([()=>e.x,()=>e.y,n,()=>e.label],o);function o(){if(!n.value)return;const i=n.value.getBBox();(i.width!==t.value.width||i.height!==t.value.height)&&(t.value=i)}return(i,s)=>(X(),re("g",{transform:r.value,class:"vue-flow__edge-textwrapper"},[i.labelShowBg?(X(),re("rect",{key:0,class:"vue-flow__edge-textbg",width:`${t.value.width+2*i.labelBgPadding[0]}px`,height:`${t.value.height+2*i.labelBgPadding[1]}px`,x:-i.labelBgPadding[0],y:-i.labelBgPadding[1],style:tt(i.labelBgStyle),rx:i.labelBgBorderRadius,ry:i.labelBgBorderRadius},null,12,gC)):we("",!0),ee("text",Ze(i.$attrs,{ref_key:"el",ref:n,class:"vue-flow__edge-text",y:t.value.height/2,dy:"0.3em",style:i.labelStyle}),[be(i.$slots,"default",{},()=>[typeof i.label!="string"?(X(),ye(Lt(i.label),{key:0})):(X(),re(De,{key:1},[Le(_e(i.label),1)],64))])],16,vC)],8,mC))}}),bC=["id","d","marker-end","marker-start"],wC=["d","stroke-width"],EC={name:"BaseEdge",inheritAttrs:!1,compatConfig:{MODE:3}},Vi=me({...EC,props:{id:{},labelX:{},labelY:{},path:{},label:{},markerStart:{},markerEnd:{},interactionWidth:{default:20},labelStyle:{},labelShowBg:{type:Boolean},labelBgStyle:{},labelBgPadding:{},labelBgBorderRadius:{}},setup(e,{expose:t}){const n=fe(null),r=fe(null),o=fe(null),i=tp();return t({pathEl:n,interactionEl:r,labelEl:o}),(s,a)=>(X(),re(De,null,[ee("path",Ze(k(i),{id:s.id,ref_key:"pathEl",ref:n,d:s.path,class:"vue-flow__edge-path","marker-end":s.markerEnd,"marker-start":s.markerStart}),null,16,bC),s.interactionWidth?(X(),re("path",{key:0,ref_key:"interactionEl",ref:r,fill:"none",d:s.path,"stroke-width":s.interactionWidth,"stroke-opacity":0,class:"vue-flow__edge-interaction"},null,8,wC)):we("",!0),s.label&&s.labelX&&s.labelY?(X(),ye(_C,{key:1,ref_key:"labelEl",ref:o,x:s.labelX,y:s.labelY,label:s.label,"label-show-bg":s.labelShowBg,"label-bg-style":s.labelBgStyle,"label-bg-padding":s.labelBgPadding,"label-bg-border-radius":s.labelBgBorderRadius,"label-style":s.labelStyle},null,8,["x","y","label","label-show-bg","label-bg-style","label-bg-padding","label-bg-border-radius","label-style"])):we("",!0)],64))}});function oh({sourceX:e,sourceY:t,targetX:n,targetY:r}){const o=Math.abs(n-e)/2,i=n<e?n+o:n-o,s=Math.abs(r-t)/2,a=r<t?r+s:r-s;return[i,a,o,s]}function ih({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:o,sourceControlY:i,targetControlX:s,targetControlY:a}){const l=e*.125+o*.375+s*.375+n*.125,u=t*.125+i*.375+a*.375+r*.125,c=Math.abs(l-e),d=Math.abs(u-t);return[l,u,c,d]}function Eo(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Xu({pos:e,x1:t,y1:n,x2:r,y2:o,c:i}){let s,a;switch(e){case he.Left:s=t-Eo(t-r,i),a=n;break;case he.Right:s=t+Eo(r-t,i),a=n;break;case he.Top:s=t,a=n-Eo(n-o,i);break;case he.Bottom:s=t,a=n+Eo(o-n,i);break}return[s,a]}function sh(e){const{sourceX:t,sourceY:n,sourcePosition:r=he.Bottom,targetX:o,targetY:i,targetPosition:s=he.Top,curvature:a=.25}=e,[l,u]=Xu({pos:r,x1:t,y1:n,x2:o,y2:i,c:a}),[c,d]=Xu({pos:s,x1:o,y1:i,x2:t,y2:n,c:a}),[f,h,p,b]=ih({sourceX:t,sourceY:n,targetX:o,targetY:i,sourceControlX:l,sourceControlY:u,targetControlX:c,targetControlY:d});return[`M${t},${n} C${l},${u} ${c},${d} ${o},${i}`,f,h,p,b]}function Ku({pos:e,x1:t,y1:n,x2:r,y2:o}){let i,s;switch(e){case he.Left:case he.Right:i=.5*(t+r),s=n;break;case he.Top:case he.Bottom:i=t,s=.5*(n+o);break}return[i,s]}function ah(e){const{sourceX:t,sourceY:n,sourcePosition:r=he.Bottom,targetX:o,targetY:i,targetPosition:s=he.Top}=e,[a,l]=Ku({pos:r,x1:t,y1:n,x2:o,y2:i}),[u,c]=Ku({pos:s,x1:o,y1:i,x2:t,y2:n}),[d,f,h,p]=ih({sourceX:t,sourceY:n,targetX:o,targetY:i,sourceControlX:a,sourceControlY:l,targetControlX:u,targetControlY:c});return[`M${t},${n} C${a},${l} ${u},${c} ${o},${i}`,d,f,h,p]}const Zu={[he.Left]:{x:-1,y:0},[he.Right]:{x:1,y:0},[he.Top]:{x:0,y:-1},[he.Bottom]:{x:0,y:1}};function xC({source:e,sourcePosition:t=he.Bottom,target:n}){return t===he.Left||t===he.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1}}function Qu(e,t){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)}function kC({source:e,sourcePosition:t=he.Bottom,target:n,targetPosition:r=he.Top,center:o,offset:i}){const s=Zu[t],a=Zu[r],l={x:e.x+s.x*i,y:e.y+s.y*i},u={x:n.x+a.x*i,y:n.y+a.y*i},c=xC({source:l,sourcePosition:t,target:u}),d=c.x!==0?"x":"y",f=c[d];let h,p,b;const _={x:0,y:0},y={x:0,y:0},[g,m,v,x]=oh({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[d]*a[d]===-1){p=o.x??g,b=o.y??m;const P=[{x:p,y:l.y},{x:p,y:u.y}],O=[{x:l.x,y:b},{x:u.x,y:b}];s[d]===f?h=d==="x"?P:O:h=d==="x"?O:P}else{const P=[{x:l.x,y:u.y}],O=[{x:u.x,y:l.y}];if(d==="x"?h=s.x===f?O:P:h=s.y===f?P:O,t===r){const F=Math.abs(e[d]-n[d]);if(F<=i){const E=Math.min(i-1,i-F);s[d]===f?_[d]=(l[d]>e[d]?-1:1)*E:y[d]=(u[d]>n[d]?-1:1)*E}}if(t!==r){const F=d==="x"?"y":"x",E=s[d]===a[F],$=l[F]>u[F],A=l[F]<u[F];(s[d]===1&&(!E&&$||E&&A)||s[d]!==1&&(!E&&A||E&&$))&&(h=d==="x"?P:O)}const W={x:l.x+_.x,y:l.y+_.y},N={x:u.x+y.x,y:u.y+y.y},M=Math.max(Math.abs(W.x-h[0].x),Math.abs(N.x-h[0].x)),C=Math.max(Math.abs(W.y-h[0].y),Math.abs(N.y-h[0].y));M>=C?(p=(W.x+N.x)/2,b=h[0].y):(p=h[0].x,b=(W.y+N.y)/2)}return[[e,{x:l.x+_.x,y:l.y+_.y},...h,{x:u.x+y.x,y:u.y+y.y},n],p,b,v,x]}function CC(e,t,n,r){const o=Math.min(Qu(e,t)/2,Qu(t,n)/2,r),{x:i,y:s}=t;if(e.x===i&&i===n.x||e.y===s&&s===n.y)return`L${i} ${s}`;if(e.y===s){const u=e.x<n.x?-1:1,c=e.y<n.y?1:-1;return`L ${i+o*u},${s}Q ${i},${s} ${i},${s+o*c}`}const a=e.x<n.x?1:-1,l=e.y<n.y?-1:1;return`L ${i},${s+o*l}Q ${i},${s} ${i+o*a},${s}`}function aa(e){const{sourceX:t,sourceY:n,sourcePosition:r=he.Bottom,targetX:o,targetY:i,targetPosition:s=he.Top,borderRadius:a=5,centerX:l,centerY:u,offset:c=20}=e,[d,f,h,p,b]=kC({source:{x:t,y:n},sourcePosition:r,target:{x:o,y:i},targetPosition:s,center:{x:l,y:u},offset:c});return[d.reduce((y,g,m)=>{let v;return m>0&&m<d.length-1?v=CC(d[m-1],g,d[m+1],a):v=`${m===0?"M":"L"}${g.x} ${g.y}`,y+=v,y},""),f,h,p,b]}function SC(e){const{sourceX:t,sourceY:n,targetX:r,targetY:o}=e,[i,s,a,l]=oh({sourceX:t,sourceY:n,targetX:r,targetY:o});return[`M ${t},${n}L ${r},${o}`,i,s,a,l]}const TC=me({name:"StraightEdge",props:["label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{const[n,r,o]=SC(e);return Pe(Vi,{path:n,labelX:r,labelY:o,...t,...e})}}}),AC=TC,LC=me({name:"SmoothStepEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","borderRadius","markerEnd","markerStart","interactionWidth","offset"],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{const[n,r,o]=aa({...e,sourcePosition:e.sourcePosition??he.Bottom,targetPosition:e.targetPosition??he.Top});return Pe(Vi,{path:n,labelX:r,labelY:o,...t,...e})}}}),lh=LC,IC=me({name:"StepEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],setup(e,{attrs:t}){return()=>Pe(lh,{...e,...t,borderRadius:0})}}),PC=IC,NC=me({name:"BezierEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","curvature","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{const[n,r,o]=sh({...e,sourcePosition:e.sourcePosition??he.Bottom,targetPosition:e.targetPosition??he.Top});return Pe(Vi,{path:n,labelX:r,labelY:o,...t,...e})}}}),RC=NC,MC=me({name:"SimpleBezierEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{const[n,r,o]=ah({...e,sourcePosition:e.sourcePosition??he.Bottom,targetPosition:e.targetPosition??he.Top});return Pe(Vi,{path:n,labelX:r,labelY:o,...t,...e})}}}),OC=MC,DC={input:pC,default:fC,output:hC},$C={default:RC,straight:AC,step:PC,smoothstep:lh,simplebezier:OC};function VC(e,t,n){const r=te(()=>b=>t.value.get(b)),o=te(()=>b=>n.value.get(b)),i=te(()=>{const b={...$C,...e.edgeTypes},_=Object.keys(b);for(const y of e.edges)y.type&&!_.includes(y.type)&&(b[y.type]=y.type);return b}),s=te(()=>{const b={...DC,...e.nodeTypes},_=Object.keys(b);for(const y of e.nodes)y.type&&!_.includes(y.type)&&(b[y.type]=y.type);return b}),a=te(()=>e.onlyRenderVisibleElements?Gf(e.nodes,{x:0,y:0,width:e.dimensions.width,height:e.dimensions.height},e.viewport,!0):e.nodes),l=te(()=>{if(e.onlyRenderVisibleElements){const b=[];for(const _ of e.edges){const y=t.value.get(_.source),g=t.value.get(_.target);Mk({sourcePos:y.computedPosition||{x:0,y:0},targetPos:g.computedPosition||{x:0,y:0},sourceWidth:y.dimensions.width,sourceHeight:y.dimensions.height,targetWidth:g.dimensions.width,targetHeight:g.dimensions.height,width:e.dimensions.width,height:e.dimensions.height,viewport:e.viewport})&&b.push(_)}return b}return e.edges}),u=te(()=>[...a.value,...l.value]),c=te(()=>{const b=[];for(const _ of e.nodes)_.selected&&b.push(_);return b}),d=te(()=>{const b=[];for(const _ of e.edges)_.selected&&b.push(_);return b}),f=te(()=>[...c.value,...d.value]),h=te(()=>{const b=[];for(const _ of e.nodes)_.dimensions.width&&_.dimensions.height&&_.handleBounds!==void 0&&b.push(_);return b}),p=te(()=>a.value.length>0&&h.value.length===a.value.length);return{getNode:r,getEdge:o,getElements:u,getEdgeTypes:i,getNodeTypes:s,getEdges:l,getNodes:a,getSelectedElements:f,getSelectedNodes:c,getSelectedEdges:d,getNodesInitialized:h,areNodesInitialized:p}}class vn{constructor(){this.currentId=0,this.flows=new Map}static getInstance(){var t;const n=(t=ur())==null?void 0:t.appContext.app,r=n?.config.globalProperties.$vueFlowStorage??vn.instance;return vn.instance=r??new vn,n&&(n.config.globalProperties.$vueFlowStorage=vn.instance),vn.instance}set(t,n){return this.flows.set(t,n)}get(t){return this.flows.get(t)}remove(t){return this.flows.delete(t)}create(t,n){const r=rh(),o=Zh(r),i={};for(const[f,h]of Object.entries(o.hooks)){const p=`on${f.charAt(0).toUpperCase()+f.slice(1)}`;i[p]=h.on}const s={};for(const[f,h]of Object.entries(o.hooks))s[f]=h.trigger;const a=te(()=>{const f=new Map;for(const h of o.nodes)f.set(h.id,h);return f}),l=te(()=>{const f=new Map;for(const h of o.edges)f.set(h.id,h);return f}),u=VC(o,a,l),c=uC(o,a,l);c.setState({...o,...n});const d={...i,...u,...c,...Lw(o),nodeLookup:a,edgeLookup:l,emits:s,id:t,vueFlowVersion:"1.48.2",$destroy:()=>{this.remove(t)}};return this.set(t,d),d}getId(){return`vue-flow-${this.currentId++}`}}function Oe(e){const t=vn.getInstance(),n=_a(),r=typeof e=="object",o=r?e:{id:e},i=o.id,s=i??n?.vueFlowId;let a;if(n){const l=lr(Yu,null);typeof l<"u"&&l!==null&&(!s||l.id===s)&&(a=l)}if(a||s&&(a=t.get(s)),!a||s&&a.id!==s){const l=i??t.getId(),u=t.create(l,o);a=u,(n??_c(!0)).run(()=>{xe(u.applyDefault,(d,f,h)=>{const p=_=>{u.applyNodeChanges(_)},b=_=>{u.applyEdgeChanges(_)};d?(u.onNodesChange(p),u.onEdgesChange(b)):(u.hooks.value.nodesChange.off(p),u.hooks.value.edgesChange.off(b)),h(()=>{u.hooks.value.nodesChange.off(p),u.hooks.value.edgesChange.off(b)})},{immediate:!0}),Vr(()=>{if(a){const d=t.get(a.id);d?d.$destroy():oo(`No store instance found for id ${a.id} in storage.`)}})})}else r&&a.setState(o);if(n&&(Qn(Yu,a),n.vueFlowId=a.id),r){const l=ur();l?.type.name!=="VueFlow"&&a.emits.error(new Ue(ze.USEVUEFLOW_OPTIONS))}return a}function BC(e){const{emits:t,dimensions:n}=Oe();let r;nt(()=>{const o=()=>{var i,s;if(!e.value||!(((s=(i=e.value).checkVisibility)==null?void 0:s.call(i))??!0))return;const a=Ni(e.value);(a.width===0||a.height===0)&&t.error(new Ue(ze.MISSING_VIEWPORT_DIMENSIONS)),n.value={width:a.width||500,height:a.height||500}};o(),window.addEventListener("resize",o),e.value&&(r=new ResizeObserver(()=>o()),r.observe(e.value)),ba(()=>{window.removeEventListener("resize",o),r&&e.value&&r.unobserve(e.value)})})}const FC={name:"UserSelection",compatConfig:{MODE:3}},zC=me({...FC,props:{userSelectionRect:{}},setup(e){return(t,n)=>(X(),re("div",{class:"vue-flow__selection vue-flow__container",style:tt({width:`${t.userSelectionRect.width}px`,height:`${t.userSelectionRect.height}px`,transform:`translate(${t.userSelectionRect.x}px, ${t.userSelectionRect.y}px)`})},null,4))}}),HC=["tabIndex"],GC={name:"NodesSelection",compatConfig:{MODE:3}},jC=me({...GC,setup(e){const{emits:t,viewport:n,getSelectedNodes:r,noPanClassName:o,disableKeyboardA11y:i,userSelectionActive:s}=Oe(),a=nh(),l=fe(null),u=Jf({el:l,onStart(p){t.selectionDragStart(p),t.nodeDragStart(p)},onDrag(p){t.selectionDrag(p),t.nodeDrag(p)},onStop(p){t.selectionDragStop(p),t.nodeDragStop(p)}});nt(()=>{var p;i.value||(p=l.value)==null||p.focus({preventScroll:!0})});const c=te(()=>Hf(r.value)),d=te(()=>({width:`${c.value.width}px`,height:`${c.value.height}px`,top:`${c.value.y}px`,left:`${c.value.x}px`}));function f(p){t.selectionContextMenu({event:p,nodes:r.value})}function h(p){i.value||Zn[p.key]&&(p.preventDefault(),a({x:Zn[p.key].x,y:Zn[p.key].y},p.shiftKey))}return(p,b)=>!k(s)&&c.value.width&&c.value.height?(X(),re("div",{key:0,class:et(["vue-flow__nodesselection vue-flow__container",k(o)]),style:tt({transform:`translate(${k(n).x}px,${k(n).y}px) scale(${k(n).zoom})`})},[ee("div",{ref_key:"el",ref:l,class:et([{dragging:k(u)},"vue-flow__nodesselection-rect"]),style:tt(d.value),tabIndex:k(i)?void 0:-1,onContextmenu:f,onKeydown:h},null,46,HC)],6)):we("",!0)}});function UC(e,t){return{x:e.clientX-t.left,y:e.clientY-t.top}}const WC={name:"Pane",compatConfig:{MODE:3}},qC=me({...WC,props:{isSelecting:{type:Boolean},selectionKeyPressed:{type:Boolean}},setup(e){const{vueFlowRef:t,nodes:n,viewport:r,emits:o,userSelectionActive:i,removeSelectedElements:s,userSelectionRect:a,elementsSelectable:l,nodesSelectionActive:u,getSelectedEdges:c,getSelectedNodes:d,removeNodes:f,removeEdges:h,selectionMode:p,deleteKeyCode:b,multiSelectionKeyCode:_,multiSelectionActive:y,edgeLookup:g,nodeLookup:m,connectionLookup:v,defaultEdgeOptions:x,connectionStartHandle:L,panOnDrag:P}=Oe(),O=Pt(null),W=Pt(new Set),N=Pt(new Set),M=Pt(null),C=Re(()=>l.value&&(e.isSelecting||i.value)),F=Re(()=>L.value!==null);let E=!1,$=!1;const A=Ir(b,{actInsideInputWithModifier:!1}),V=Ir(_);xe(A,w=>{w&&(f(d.value),h(c.value),u.value=!1)}),xe(V,w=>{y.value=w});function z(w,I){return D=>{D.target===I&&w?.(D)}}function G(w){if(E||F.value){E=!1;return}o.paneClick(w),s(),u.value=!1}function U(w){var I;if(Array.isArray(P.value)&&((I=P.value)!=null&&I.includes(2))){w.preventDefault();return}o.paneContextMenu(w)}function K(w){o.paneScroll(w)}function J(w){var I,D,j;if(M.value=((I=t.value)==null?void 0:I.getBoundingClientRect())??null,!l.value||!e.isSelecting||w.button!==0||w.target!==O.value||!M.value)return;(j=(D=w.target)==null?void 0:D.setPointerCapture)==null||j.call(D,w.pointerId);const{x:Q,y:ne}=UC(w,M.value);$=!0,E=!1,s(),a.value={width:0,height:0,startX:Q,startY:ne,x:Q,y:ne},o.selectionStart(w)}function q(w){var I;if(!M.value||!a.value)return;E=!0;const{x:D,y:j}=It(w,M.value),{startX:Q=0,startY:ne=0}=a.value,oe={startX:Q,startY:ne,x:D<Q?D:Q,y:j<ne?j:ne,width:Math.abs(D-Q),height:Math.abs(j-ne)},ae=W.value,ge=N.value;W.value=new Set(Gf(n.value,oe,r.value,p.value===el.Partial,!0).map(R=>R.id)),N.value=new Set;const B=((I=x.value)==null?void 0:I.selectable)??!0;for(const R of W.value){const H=v.value.get(R);if(H)for(const{edgeId:Z}of H.values()){const Y=g.value.get(Z);Y&&(Y.selectable??B)&&N.value.add(Z)}}if(!qu(ae,W.value)){const R=rn(m.value,W.value,!0);o.nodesChange(R)}if(!qu(ge,N.value)){const R=rn(g.value,N.value);o.edgesChange(R)}a.value=oe,i.value=!0,u.value=!1}function S(w){var I;w.button!==0||!$||((I=w.target)==null||I.releasePointerCapture(w.pointerId),!i.value&&a.value&&w.target===O.value&&G(w),i.value=!1,a.value=null,u.value=W.value.size>0,o.selectionEnd(w),e.selectionKeyPressed&&(E=!1),$=!1)}return(w,I)=>(X(),re("div",{ref_key:"container",ref:O,class:et(["vue-flow__pane vue-flow__container",{selection:w.isSelecting}]),onClick:I[0]||(I[0]=D=>C.value?void 0:z(G,O.value)(D)),onContextmenu:I[1]||(I[1]=D=>z(U,O.value)(D)),onWheelPassive:I[2]||(I[2]=D=>z(K,O.value)(D)),onPointerenter:I[3]||(I[3]=D=>C.value?void 0:k(o).paneMouseEnter(D)),onPointerdown:I[4]||(I[4]=D=>C.value?J(D):k(o).paneMouseMove(D)),onPointermove:I[5]||(I[5]=D=>C.value?q(D):k(o).paneMouseMove(D)),onPointerup:I[6]||(I[6]=D=>C.value?S(D):void 0),onPointerleave:I[7]||(I[7]=D=>k(o).paneMouseLeave(D))},[be(w.$slots,"default"),k(i)&&k(a)?(X(),ye(zC,{key:0,"user-selection-rect":k(a)},null,8,["user-selection-rect"])):we("",!0),k(u)&&k(d).length?(X(),ye(jC,{key:1})):we("",!0)],34))}}),YC={name:"Transform",compatConfig:{MODE:3}},XC=me({...YC,setup(e){const{viewport:t,fitViewOnInit:n,fitViewOnInitDone:r}=Oe(),o=te(()=>n.value?!r.value:!1),i=te(()=>`translate(${t.value.x}px,${t.value.y}px) scale(${t.value.zoom})`);return(s,a)=>(X(),re("div",{class:"vue-flow__transformationpane vue-flow__container",style:tt({transform:i.value,opacity:o.value?0:void 0})},[be(s.$slots,"default")],4))}}),KC={name:"Viewport",compatConfig:{MODE:3}},ZC=me({...KC,setup(e){const{minZoom:t,maxZoom:n,defaultViewport:r,translateExtent:o,zoomActivationKeyCode:i,selectionKeyCode:s,panActivationKeyCode:a,panOnScroll:l,panOnScrollMode:u,panOnScrollSpeed:c,panOnDrag:d,zoomOnDoubleClick:f,zoomOnPinch:h,zoomOnScroll:p,preventScrolling:b,noWheelClassName:_,noPanClassName:y,emits:g,connectionStartHandle:m,userSelectionActive:v,paneDragging:x,d3Zoom:L,d3Selection:P,d3ZoomHandler:O,viewport:W,viewportRef:N,paneClickDistance:M}=Oe();BC(N);const C=Pt(!1),F=Pt(!1);let E=null,$=!1,A=0,V={x:0,y:0,zoom:0};const z=Ir(a),G=Ir(s),U=Ir(i),K=Re(()=>(!G.value||G.value&&s.value===!0)&&(z.value||d.value)),J=Re(()=>z.value||l.value),q=Re(()=>s.value===!0&&K.value!==!0),S=Re(()=>G.value&&s.value!==!0||v.value||q.value),w=Re(()=>m.value!==null);nt(()=>{if(!N.value){oo("Viewport element is missing");return}const ne=N.value,oe=ne.getBoundingClientRect(),ae=hk().clickDistance(M.value).scaleExtent([t.value,n.value]).translateExtent(o.value),ge=gt(ne).call(ae),B=ge.on("wheel.zoom"),R=rr.translate(r.value.x??0,r.value.y??0).scale(Ln(r.value.zoom??1,t.value,n.value)),H=[[0,0],[oe.width,oe.height]],Z=ae.constrain()(R,H,o.value);ae.transform(ge,Z),ae.wheelDelta(Ru),L.value=ae,P.value=ge,O.value=B,W.value={x:Z.x,y:Z.y,zoom:Z.k},ae.on("start",Y=>{var ue;if(!Y.sourceEvent)return null;A=Y.sourceEvent.button,C.value=!0;const ce=j(Y.transform);((ue=Y.sourceEvent)==null?void 0:ue.type)==="mousedown"&&(x.value=!0),V=ce,g.viewportChangeStart(ce),g.moveStart({event:Y,flowTransform:ce})}),ae.on("end",Y=>{if(!Y.sourceEvent)return null;if(C.value=!1,x.value=!1,I(K.value,A??0)&&!$&&g.paneContextMenu(Y.sourceEvent),$=!1,D(V,Y.transform)){const ue=j(Y.transform);V=ue,g.viewportChangeEnd(ue),g.moveEnd({event:Y,flowTransform:ue})}}),ae.filter(Y=>{var ue;const ce=U.value||p.value,ve=h.value&&Y.ctrlKey,pe=Y.button,Ee=Y.type==="wheel";if(pe===1&&Y.type==="mousedown"&&(Q(Y,"vue-flow__node")||Q(Y,"vue-flow__edge")))return!0;if(!K.value&&!ce&&!J.value&&!f.value&&!h.value||v.value||w.value&&!Ee||!f.value&&Y.type==="dblclick"||Q(Y,_.value)&&Ee||Q(Y,y.value)&&(!Ee||J.value&&Ee&&!U.value)||!h.value&&Y.ctrlKey&&Ee||!ce&&!J.value&&!ve&&Ee)return!1;if(!h&&Y.type==="touchstart"&&((ue=Y.touches)==null?void 0:ue.length)>1)return Y.preventDefault(),!1;if(!K.value&&(Y.type==="mousedown"||Y.type==="touchstart")||q.value&&Array.isArray(d.value)&&d.value.includes(0)&&pe===0||Array.isArray(d.value)&&!d.value.includes(pe)&&(Y.type==="mousedown"||Y.type==="touchstart"))return!1;const Se=Array.isArray(d.value)&&d.value.includes(pe)||s.value===!0&&Array.isArray(d.value)&&!d.value.includes(0)||!pe||pe<=1;return(!Y.ctrlKey||z.value||Ee)&&Se}),xe([v,K],()=>{v.value&&!C.value?ae.on("zoom",null):v.value||ae.on("zoom",Y=>{W.value={x:Y.transform.x,y:Y.transform.y,zoom:Y.transform.k};const ue=j(Y.transform);$=I(K.value,A??0),g.viewportChange(ue),g.move({event:Y,flowTransform:ue})})},{immediate:!0}),xe([v,J,u,U,h,b,_],()=>{J.value&&!U.value&&!v.value?ge.on("wheel.zoom",Y=>{if(Q(Y,_.value))return!1;const ue=U.value||p.value,ce=h.value&&Y.ctrlKey;if(!(!b.value||J.value||ue||ce))return!1;Y.preventDefault(),Y.stopImmediatePropagation();const pe=ge.property("__zoom").k||1,Ee=ui();if(!z.value&&Y.ctrlKey&&h.value&&Ee){const Mh=St(Y),Oh=Ru(Y),Dh=pe*2**Oh;ae.scaleTo(ge,Dh,Mh,Y);return}const Se=Y.deltaMode===1?20:1;let Ie=u.value===Lr.Vertical?0:Y.deltaX*Se,Qt=u.value===Lr.Horizontal?0:Y.deltaY*Se;!Ee&&Y.shiftKey&&u.value!==Lr.Vertical&&!Ie&&Qt&&(Ie=Qt,Qt=0),ae.translateBy(ge,-(Ie/pe)*c.value,-(Qt/pe)*c.value);const xt=j(ge.property("__zoom"));E&&clearTimeout(E),F.value?(g.move({event:Y,flowTransform:xt}),g.viewportChange(xt),E=setTimeout(()=>{g.moveEnd({event:Y,flowTransform:xt}),g.viewportChangeEnd(xt),F.value=!1},150)):(F.value=!0,g.moveStart({event:Y,flowTransform:xt}),g.viewportChangeStart(xt))},{passive:!1}):typeof B<"u"&&ge.on("wheel.zoom",function(Y,ue){const ce=!b.value&&Y.type==="wheel"&&!Y.ctrlKey,ve=U.value||p.value,pe=h.value&&Y.ctrlKey;if(!ve&&!l.value&&!pe&&Y.type==="wheel"||ce||Q(Y,_.value))return null;Y.preventDefault(),B.call(this,Y,ue)},{passive:!1})},{immediate:!0})});function I(ne,oe){return oe===2&&Array.isArray(ne)&&ne.includes(2)}function D(ne,oe){return ne.x!==oe.x&&!Number.isNaN(oe.x)||ne.y!==oe.y&&!Number.isNaN(oe.y)||ne.zoom!==oe.k&&!Number.isNaN(oe.k)}function j(ne){return{x:ne.x,y:ne.y,zoom:ne.k}}function Q(ne,oe){return ne.target.closest(`.${oe}`)}return(ne,oe)=>(X(),re("div",{ref_key:"viewportRef",ref:N,class:"vue-flow__viewport vue-flow__container"},[ie(qC,{"is-selecting":S.value,"selection-key-pressed":k(G),class:et({connecting:w.value,dragging:k(x),draggable:k(d)===!0||Array.isArray(k(d))&&k(d).includes(0)})},{default:le(()=>[ie(XC,null,{default:le(()=>[be(ne.$slots,"default")]),_:3})]),_:3},8,["is-selecting","selection-key-pressed","class"])],512))}}),QC=["id"],JC=["id"],eS=["id"],tS={name:"A11yDescriptions",compatConfig:{MODE:3}},nS=me({...tS,setup(e){const{id:t,disableKeyboardA11y:n,ariaLiveMessage:r}=Oe();return(o,i)=>(X(),re(De,null,[ee("div",{id:`${k(Mf)}-${k(t)}`,style:{display:"none"}}," Press enter or space to select a node. "+_e(k(n)?"":"You can then use the arrow keys to move the node around.")+" You can then use the arrow keys to move the node around, press delete to remove it and press escape to cancel. ",9,QC),ee("div",{id:`${k(Of)}-${k(t)}`,style:{display:"none"}}," Press enter or space to select an edge. You can then press delete to remove it or press escape to cancel. ",8,JC),k(n)?we("",!0):(X(),re("div",{key:0,id:`${k(_k)}-${k(t)}`,"aria-live":"assertive","aria-atomic":"true",style:{position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)","clip-path":"inset(100%)"}},_e(k(r)),9,eS))],64))}});function rS(){const e=Oe();xe(()=>e.viewportHelper.value.viewportInitialized,t=>{t&&setTimeout(()=>{e.emits.init(e),e.emits.paneReady(e)},1)})}function oS(e,t,n){return n===he.Left?e-t:n===he.Right?e+t:e}function iS(e,t,n){return n===he.Top?e-t:n===he.Bottom?e+t:e}const rl=function({radius:e=10,centerX:t=0,centerY:n=0,position:r=he.Top,type:o}){return Pe("circle",{class:`vue-flow__edgeupdater vue-flow__edgeupdater-${o}`,cx:oS(t,e,r),cy:iS(n,e,r),r:e,stroke:"transparent",fill:"transparent"})};rl.props=["radius","centerX","centerY","position","type"];rl.compatConfig={MODE:3};const Ju=rl,sS=me({name:"Edge",compatConfig:{MODE:3},props:["id"],setup(e){const{id:t,addSelectedEdges:n,connectionMode:r,edgeUpdaterRadius:o,emits:i,nodesSelectionActive:s,noPanClassName:a,getEdgeTypes:l,removeSelectedEdges:u,findEdge:c,findNode:d,isValidConnection:f,multiSelectionActive:h,disableKeyboardA11y:p,elementsSelectable:b,edgesUpdatable:_,edgesFocusable:y,hooks:g}=Oe(),m=te(()=>c(e.id)),{emit:v,on:x}=Kk(m.value,i),L=lr(Mi),P=ur(),O=fe(!1),W=fe(!1),N=fe(""),M=fe(null),C=fe("source"),F=fe(null),E=Re(()=>typeof m.value.selectable>"u"?b.value:m.value.selectable),$=Re(()=>typeof m.value.updatable>"u"?_.value:m.value.updatable),A=Re(()=>typeof m.value.focusable>"u"?y.value:m.value.focusable);Qn(qk,e.id),Qn(Yk,F);const V=te(()=>m.value.class instanceof Function?m.value.class(m.value):m.value.class),z=te(()=>m.value.style instanceof Function?m.value.style(m.value):m.value.style),G=te(()=>{const R=m.value.type||"default",H=L?.[`edge-${R}`];if(H)return H;let Z=m.value.template??l.value[R];if(typeof Z=="string"&&P){const Y=Object.keys(P.appContext.components);Y&&Y.includes(R)&&(Z=bc(R,!1))}return Z&&typeof Z!="string"?Z:(i.error(new Ue(ze.EDGE_TYPE_MISSING,Z)),!1)}),{handlePointerDown:U}=eh({nodeId:N,handleId:M,type:C,isValidConnection:f,edgeUpdaterType:C,onEdgeUpdate:q,onEdgeUpdateEnd:S});return()=>{const R=d(m.value.source),H=d(m.value.target),Z="pathOptions"in m.value?m.value.pathOptions:{};if(!R&&!H)return i.error(new Ue(ze.EDGE_SOURCE_TARGET_MISSING,m.value.id,m.value.source,m.value.target)),null;if(!R)return i.error(new Ue(ze.EDGE_SOURCE_MISSING,m.value.id,m.value.source)),null;if(!H)return i.error(new Ue(ze.EDGE_TARGET_MISSING,m.value.id,m.value.target)),null;if(!m.value||m.value.hidden||R.hidden||H.hidden)return null;let Y;r.value===cn.Strict?Y=R.handleBounds.source:Y=[...R.handleBounds.source||[],...R.handleBounds.target||[]];const ue=zu(Y,m.value.sourceHandle);let ce;r.value===cn.Strict?ce=H.handleBounds.target:ce=[...H.handleBounds.target||[],...H.handleBounds.source||[]];const ve=zu(ce,m.value.targetHandle),pe=ue?.position||he.Bottom,Ee=ve?.position||he.Top,{x:Se,y:Ie}=or(R,ue,pe),{x:Qt,y:xt}=or(H,ve,Ee);return m.value.sourceX=Se,m.value.sourceY=Ie,m.value.targetX=Qt,m.value.targetY=xt,Pe("g",{ref:F,key:e.id,"data-id":e.id,class:["vue-flow__edge",`vue-flow__edge-${G.value===!1?"default":m.value.type||"default"}`,a.value,V.value,{updating:O.value,selected:m.value.selected,animated:m.value.animated,inactive:!E.value&&!g.value.edgeClick.hasListeners()}],tabIndex:A.value?0:void 0,"aria-label":m.value.ariaLabel===null?void 0:m.value.ariaLabel??`Edge from ${m.value.source} to ${m.value.target}`,"aria-describedby":A.value?`${Of}-${t}`:void 0,"aria-roledescription":"edge",role:A.value?"group":"img",...m.value.domAttributes,onClick:I,onContextmenu:D,onDblclick:j,onMouseenter:Q,onMousemove:ne,onMouseleave:oe,onKeyDown:A.value?B:void 0},[W.value?null:Pe(G.value===!1?l.value.default:G.value,{id:e.id,sourceNode:R,targetNode:H,source:m.value.source,target:m.value.target,type:m.value.type,updatable:$.value,selected:m.value.selected,animated:m.value.animated,label:m.value.label,labelStyle:m.value.labelStyle,labelShowBg:m.value.labelShowBg,labelBgStyle:m.value.labelBgStyle,labelBgPadding:m.value.labelBgPadding,labelBgBorderRadius:m.value.labelBgBorderRadius,data:m.value.data,events:{...m.value.events,...x},style:z.value,markerStart:`url('#${Ur(m.value.markerStart,t)}')`,markerEnd:`url('#${Ur(m.value.markerEnd,t)}')`,sourcePosition:pe,targetPosition:Ee,sourceX:Se,sourceY:Ie,targetX:Qt,targetY:xt,sourceHandleId:m.value.sourceHandle,targetHandleId:m.value.targetHandle,interactionWidth:m.value.interactionWidth,...Z}),[$.value==="source"||$.value===!0?[Pe("g",{onMousedown:ae,onMouseenter:K,onMouseout:J},Pe(Ju,{position:pe,centerX:Se,centerY:Ie,radius:o.value,type:"source","data-type":"source"}))]:null,$.value==="target"||$.value===!0?[Pe("g",{onMousedown:ge,onMouseenter:K,onMouseout:J},Pe(Ju,{position:Ee,centerX:Qt,centerY:xt,radius:o.value,type:"target","data-type":"target"}))]:null]])};function K(){O.value=!0}function J(){O.value=!1}function q(R,H){v.update({event:R,edge:m.value,connection:H})}function S(R){v.updateEnd({event:R,edge:m.value}),W.value=!1}function w(R,H){R.button===0&&(W.value=!0,N.value=H?m.value.target:m.value.source,M.value=(H?m.value.targetHandle:m.value.sourceHandle)??null,C.value=H?"target":"source",v.updateStart({event:R,edge:m.value}),U(R))}function I(R){var H;const Z={event:R,edge:m.value};E.value&&(s.value=!1,m.value.selected&&h.value?(u([m.value]),(H=F.value)==null||H.blur()):n([m.value])),v.click(Z)}function D(R){v.contextMenu({event:R,edge:m.value})}function j(R){v.doubleClick({event:R,edge:m.value})}function Q(R){v.mouseEnter({event:R,edge:m.value})}function ne(R){v.mouseMove({event:R,edge:m.value})}function oe(R){v.mouseLeave({event:R,edge:m.value})}function ae(R){w(R,!0)}function ge(R){w(R,!1)}function B(R){var H;!p.value&&Df.includes(R.key)&&E.value&&(R.key==="Escape"?((H=F.value)==null||H.blur(),u([c(e.id)])):n([c(e.id)]))}}}),aS=sS,lS=me({name:"ConnectionLine",compatConfig:{MODE:3},setup(){var e;const{id:t,connectionMode:n,connectionStartHandle:r,connectionEndHandle:o,connectionPosition:i,connectionLineType:s,connectionLineStyle:a,connectionLineOptions:l,connectionStatus:u,viewport:c,findNode:d}=Oe(),f=(e=lr(Mi))==null?void 0:e["connection-line"],h=te(()=>{var g;return d((g=r.value)==null?void 0:g.nodeId)}),p=te(()=>{var g;return d((g=o.value)==null?void 0:g.nodeId)??null}),b=te(()=>({x:(i.value.x-c.value.x)/c.value.zoom,y:(i.value.y-c.value.y)/c.value.zoom})),_=te(()=>l.value.markerStart?`url(#${Ur(l.value.markerStart,t)})`:""),y=te(()=>l.value.markerEnd?`url(#${Ur(l.value.markerEnd,t)})`:"");return()=>{var g,m,v;if(!h.value||!r.value)return null;const x=r.value.id,L=r.value.type,P=h.value.handleBounds;let O=P?.[L]??[];if(n.value===cn.Loose){const z=P?.[L==="source"?"target":"source"]??[];O=[...O,...z]}if(!O)return null;const W=(x?O.find(z=>z.id===x):O[0])??null,N=W?.position??he.Top,{x:M,y:C}=or(h.value,W,N);let F=null;p.value&&(n.value===cn.Strict?F=((g=p.value.handleBounds[L==="source"?"target":"source"])==null?void 0:g.find(z=>{var G;return z.id===((G=o.value)==null?void 0:G.id)}))||null:F=((m=[...p.value.handleBounds.source??[],...p.value.handleBounds.target??[]])==null?void 0:m.find(z=>{var G;return z.id===((G=o.value)==null?void 0:G.id)}))||null);const E=((v=o.value)==null?void 0:v.position)??(N?ia[N]:null);if(!N||!E)return null;const $=s.value??l.value.type??gn.Bezier;let A="";const V={sourceX:M,sourceY:C,sourcePosition:N,targetX:b.value.x,targetY:b.value.y,targetPosition:E};return $===gn.Bezier?[A]=sh(V):$===gn.Step?[A]=aa({...V,borderRadius:0}):$===gn.SmoothStep?[A]=aa(V):$===gn.SimpleBezier?[A]=ah(V):A=`M${M},${C} ${b.value.x},${b.value.y}`,Pe("svg",{class:"vue-flow__edges vue-flow__connectionline vue-flow__container"},Pe("g",{class:"vue-flow__connection"},f?Pe(f,{sourceX:M,sourceY:C,sourcePosition:N,targetX:b.value.x,targetY:b.value.y,targetPosition:E,sourceNode:h.value,sourceHandle:W,targetNode:p.value,targetHandle:F,markerEnd:y.value,markerStart:_.value,connectionStatus:u.value}):Pe("path",{d:A,class:[l.value.class,u.value,"vue-flow__connection-path"],style:{...a.value,...l.value.style},"marker-end":y.value,"marker-start":_.value})))}}}),uS=lS,cS=["id","markerWidth","markerHeight","markerUnits","orient"],dS={name:"MarkerType",compatConfig:{MODE:3}},fS=me({...dS,props:{id:{},type:{},color:{default:"none"},width:{default:12.5},height:{default:12.5},markerUnits:{default:"strokeWidth"},orient:{default:"auto-start-reverse"},strokeWidth:{default:1}},setup(e){return(t,n)=>(X(),re("marker",{id:t.id,class:"vue-flow__arrowhead",viewBox:"-10 -10 20 20",refX:"0",refY:"0",markerWidth:`${t.width}`,markerHeight:`${t.height}`,markerUnits:t.markerUnits,orient:t.orient},[t.type===k(si).ArrowClosed?(X(),re("polyline",{key:0,style:tt({stroke:t.color,fill:t.color,strokeWidth:t.strokeWidth}),"stroke-linecap":"round","stroke-linejoin":"round",points:"-5,-4 0,0 -5,4 -5,-4"},null,4)):we("",!0),t.type===k(si).Arrow?(X(),re("polyline",{key:1,style:tt({stroke:t.color,strokeWidth:t.strokeWidth}),"stroke-linecap":"round","stroke-linejoin":"round",fill:"none",points:"-5,-4 0,0 -5,4"},null,4)):we("",!0)],8,cS))}}),hS={class:"vue-flow__marker vue-flow__container","aria-hidden":"true"},pS={name:"MarkerDefinitions",compatConfig:{MODE:3}},mS=me({...pS,setup(e){const{id:t,edges:n,connectionLineOptions:r,defaultMarkerColor:o}=Oe(),i=te(()=>{const s=new Set,a=[],l=u=>{if(u){const c=Ur(u,t);s.has(c)||(typeof u=="object"?a.push({...u,id:c,color:u.color||o.value}):a.push({id:c,color:o.value,type:u}),s.add(c))}};for(const u of[r.value.markerEnd,r.value.markerStart])l(u);for(const u of n.value)for(const c of[u.markerStart,u.markerEnd])l(c);return a.sort((u,c)=>u.id.localeCompare(c.id))});return(s,a)=>(X(),re("svg",hS,[ee("defs",null,[(X(!0),re(De,null,Wt(i.value,l=>(X(),ye(fS,{id:l.id,key:l.id,type:l.type,color:l.color,width:l.width,height:l.height,markerUnits:l.markerUnits,"stroke-width":l.strokeWidth,orient:l.orient},null,8,["id","type","color","width","height","markerUnits","stroke-width","orient"]))),128))])]))}}),gS={name:"Edges",compatConfig:{MODE:3}},vS=me({...gS,setup(e){const{findNode:t,getEdges:n,elevateEdgesOnSelect:r}=Oe();return(o,i)=>(X(),re(De,null,[ie(mS),(X(!0),re(De,null,Wt(k(n),s=>(X(),re("svg",{key:s.id,class:"vue-flow__edges vue-flow__container",style:tt({zIndex:k(Ok)(s,k(t),k(r))})},[ie(k(aS),{id:s.id},null,8,["id"])],4))),128)),ie(k(uS))],64))}}),yS=me({name:"Node",compatConfig:{MODE:3},props:["id","resizeObserver"],setup(e){const{id:t,noPanClassName:n,selectNodesOnDrag:r,nodesSelectionActive:o,multiSelectionActive:i,emits:s,removeSelectedNodes:a,addSelectedNodes:l,updateNodeDimensions:u,onUpdateNodeInternals:c,getNodeTypes:d,nodeExtent:f,elevateNodesOnSelect:h,disableKeyboardA11y:p,ariaLiveMessage:b,snapToGrid:_,snapGrid:y,nodeDragThreshold:g,nodesDraggable:m,elementsSelectable:v,nodesConnectable:x,nodesFocusable:L,hooks:P}=Oe(),O=fe(null);Qn(Qf,O),Qn(Zf,e.id);const W=lr(Mi),N=ur(),M=nh(),{node:C,parentNode:F}=th(e.id),{emit:E,on:$}=eC(C,s),A=Re(()=>typeof C.draggable>"u"?m.value:C.draggable),V=Re(()=>typeof C.selectable>"u"?v.value:C.selectable),z=Re(()=>typeof C.connectable>"u"?x.value:C.connectable),G=Re(()=>typeof C.focusable>"u"?L.value:C.focusable),U=te(()=>V.value||A.value||P.value.nodeClick.hasListeners()||P.value.nodeDoubleClick.hasListeners()||P.value.nodeMouseEnter.hasListeners()||P.value.nodeMouseMove.hasListeners()||P.value.nodeMouseLeave.hasListeners()),K=Re(()=>!!C.dimensions.width&&!!C.dimensions.height),J=te(()=>{const H=C.type||"default",Z=W?.[`node-${H}`];if(Z)return Z;let Y=C.template||d.value[H];if(typeof Y=="string"&&N){const ue=Object.keys(N.appContext.components);ue&&ue.includes(H)&&(Y=bc(H,!1))}return Y&&typeof Y!="string"?Y:(s.error(new Ue(ze.NODE_TYPE_MISSING,Y)),!1)}),q=Jf({id:e.id,el:O,disabled:()=>!A.value,selectable:V,dragHandle:()=>C.dragHandle,onStart(H){E.dragStart(H)},onDrag(H){E.drag(H)},onStop(H){E.dragStop(H)},onClick(H){B(H)}}),S=te(()=>C.class instanceof Function?C.class(C):C.class),w=te(()=>{const H=(C.style instanceof Function?C.style(C):C.style)||{},Z=C.width instanceof Function?C.width(C):C.width,Y=C.height instanceof Function?C.height(C):C.height;return!H.width&&Z&&(H.width=typeof Z=="string"?Z:`${Z}px`),!H.height&&Y&&(H.height=typeof Y=="string"?Y:`${Y}px`),H}),I=Re(()=>Number(C.zIndex??w.value.zIndex??0));return c(H=>{(H.includes(e.id)||!H.length)&&j()}),nt(()=>{xe(()=>C.hidden,(H=!1,Z,Y)=>{!H&&O.value&&(e.resizeObserver.observe(O.value),Y(()=>{O.value&&e.resizeObserver.unobserve(O.value)}))},{immediate:!0,flush:"post"})}),xe([()=>C.type,()=>C.sourcePosition,()=>C.targetPosition],()=>{yt(()=>{u([{id:e.id,nodeElement:O.value,forceUpdate:!0}])})}),xe([()=>C.position.x,()=>C.position.y,()=>{var H;return(H=F.value)==null?void 0:H.computedPosition.x},()=>{var H;return(H=F.value)==null?void 0:H.computedPosition.y},()=>{var H;return(H=F.value)==null?void 0:H.computedPosition.z},I,()=>C.selected,()=>C.dimensions.height,()=>C.dimensions.width,()=>{var H;return(H=F.value)==null?void 0:H.dimensions.height},()=>{var H;return(H=F.value)==null?void 0:H.dimensions.width}],([H,Z,Y,ue,ce,ve])=>{const pe={x:H,y:Z,z:ve+(h.value&&C.selected?1e3:0)};typeof Y<"u"&&typeof ue<"u"?C.computedPosition=Lk({x:Y,y:ue,z:ce},pe):C.computedPosition=pe},{flush:"post",immediate:!0}),xe([()=>C.extent,f],([H,Z],[Y,ue])=>{(H!==Y||Z!==ue)&&D()}),C.extent==="parent"||typeof C.extent=="object"&&"range"in C.extent&&C.extent.range==="parent"?Xs(()=>K).toBe(!0).then(D):D(),()=>C.hidden?null:Pe("div",{ref:O,"data-id":C.id,class:["vue-flow__node",`vue-flow__node-${J.value===!1?"default":C.type||"default"}`,{[n.value]:A.value,dragging:q?.value,draggable:A.value,selected:C.selected,selectable:V.value,parent:C.isParent},S.value],style:{visibility:K.value?"visible":"hidden",zIndex:C.computedPosition.z??I.value,transform:`translate(${C.computedPosition.x}px,${C.computedPosition.y}px)`,pointerEvents:U.value?"all":"none",...w.value},tabIndex:G.value?0:void 0,role:G.value?"group":void 0,"aria-describedby":p.value?void 0:`${Mf}-${t}`,"aria-label":C.ariaLabel,"aria-roledescription":"node",...C.domAttributes,onMouseenter:Q,onMousemove:ne,onMouseleave:oe,onContextmenu:ae,onClick:B,onDblclick:ge,onKeydown:R},[Pe(J.value===!1?d.value.default:J.value,{id:C.id,type:C.type,data:C.data,events:{...C.events,...$},selected:C.selected,resizing:C.resizing,dragging:q.value,connectable:z.value,position:C.computedPosition,dimensions:C.dimensions,isValidTargetPos:C.isValidTargetPos,isValidSourcePos:C.isValidSourcePos,parent:C.parentNode,parentNodeId:C.parentNode,zIndex:C.computedPosition.z??I.value,targetPosition:C.targetPosition,sourcePosition:C.sourcePosition,label:C.label,dragHandle:C.dragHandle,onUpdateNodeInternals:j})]);function D(){const H=C.computedPosition,{computedPosition:Z,position:Y}=tl(C,_.value?Ri(H,y.value):H,s.error,f.value,F.value);(C.computedPosition.x!==Z.x||C.computedPosition.y!==Z.y)&&(C.computedPosition={...C.computedPosition,...Z}),(C.position.x!==Y.x||C.position.y!==Y.y)&&(C.position=Y)}function j(){O.value&&u([{id:e.id,nodeElement:O.value,forceUpdate:!0}])}function Q(H){q?.value||E.mouseEnter({event:H,node:C})}function ne(H){q?.value||E.mouseMove({event:H,node:C})}function oe(H){q?.value||E.mouseLeave({event:H,node:C})}function ae(H){return E.contextMenu({event:H,node:C})}function ge(H){return E.doubleClick({event:H,node:C})}function B(H){V.value&&(!r.value||!A.value||g.value>0)&&sa(C,i.value,l,a,o,!1,O.value),E.click({event:H,node:C})}function R(H){if(!(oa(H)||p.value))if(Df.includes(H.key)&&V.value){const Z=H.key==="Escape";sa(C,i.value,l,a,o,Z,O.value)}else A.value&&C.selected&&Zn[H.key]&&(H.preventDefault(),b.value=`Moved selected node ${H.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~C.position.x}, y: ${~~C.position.y}`,M({x:Zn[H.key].x,y:Zn[H.key].y},H.shiftKey))}}}),_S=yS;function bS(e={includeHiddenNodes:!1}){const{nodes:t}=Oe();return te(()=>{if(t.value.length===0)return!1;for(const n of t.value)if((e.includeHiddenNodes||!n.hidden)&&(n?.handleBounds===void 0||n.dimensions.width===0||n.dimensions.height===0))return!1;return!0})}const wS={class:"vue-flow__nodes vue-flow__container"},ES={name:"Nodes",compatConfig:{MODE:3}},xS=me({...ES,setup(e){const{getNodes:t,updateNodeDimensions:n,emits:r}=Oe(),o=bS(),i=fe();return xe(o,s=>{s&&yt(()=>{r.nodesInitialized(t.value)})},{immediate:!0}),nt(()=>{i.value=new ResizeObserver(s=>{const a=s.map(l=>({id:l.target.getAttribute("data-id"),nodeElement:l.target,forceUpdate:!0}));yt(()=>n(a))})}),ba(()=>{var s;return(s=i.value)==null?void 0:s.disconnect()}),(s,a)=>(X(),re("div",wS,[i.value?(X(!0),re(De,{key:0},Wt(k(t),(l,u,c,d)=>{const f=[l.id];if(d&&d.key===l.id&&Kh(d,f))return d;const h=(X(),ye(k(_S),{id:l.id,key:l.id,"resize-observer":i.value},null,8,["id","resize-observer"]));return h.memo=f,h},a,0),128)):we("",!0)]))}});function kS(){const{emits:e}=Oe();nt(()=>{if(Kf()){const t=document.querySelector(".vue-flow__pane");t&&window.getComputedStyle(t).zIndex!=="1"&&e.error(new Ue(ze.MISSING_STYLES))}})}const CS=ee("div",{class:"vue-flow__edge-labels"},null,-1),SS={name:"VueFlow",compatConfig:{MODE:3}},TS=me({...SS,props:{id:{},modelValue:{},nodes:{},edges:{},edgeTypes:{},nodeTypes:{},connectionMode:{},connectionLineType:{},connectionLineStyle:{default:void 0},connectionLineOptions:{default:void 0},connectionRadius:{},isValidConnection:{type:[Function,null],default:void 0},deleteKeyCode:{default:void 0},selectionKeyCode:{type:[Boolean,null],default:void 0},multiSelectionKeyCode:{default:void 0},zoomActivationKeyCode:{default:void 0},panActivationKeyCode:{default:void 0},snapToGrid:{type:Boolean,default:void 0},snapGrid:{},onlyRenderVisibleElements:{type:Boolean,default:void 0},edgesUpdatable:{type:[Boolean,String],default:void 0},nodesDraggable:{type:Boolean,default:void 0},nodesConnectable:{type:Boolean,default:void 0},nodeDragThreshold:{},elementsSelectable:{type:Boolean,default:void 0},selectNodesOnDrag:{type:Boolean,default:void 0},panOnDrag:{type:[Boolean,Array],default:void 0},minZoom:{},maxZoom:{},defaultViewport:{},translateExtent:{},nodeExtent:{},defaultMarkerColor:{},zoomOnScroll:{type:Boolean,default:void 0},zoomOnPinch:{type:Boolean,default:void 0},panOnScroll:{type:Boolean,default:void 0},panOnScrollSpeed:{},panOnScrollMode:{},paneClickDistance:{},zoomOnDoubleClick:{type:Boolean,default:void 0},preventScrolling:{type:Boolean,default:void 0},selectionMode:{},edgeUpdaterRadius:{},fitViewOnInit:{type:Boolean,default:void 0},connectOnClick:{type:Boolean,default:void 0},applyDefault:{type:Boolean,default:void 0},autoConnect:{type:[Boolean,Function],default:void 0},noDragClassName:{},noWheelClassName:{},noPanClassName:{},defaultEdgeOptions:{},elevateEdgesOnSelect:{type:Boolean,default:void 0},elevateNodesOnSelect:{type:Boolean,default:void 0},disableKeyboardA11y:{type:Boolean,default:void 0},edgesFocusable:{type:Boolean,default:void 0},nodesFocusable:{type:Boolean,default:void 0},autoPanOnConnect:{type:Boolean,default:void 0},autoPanOnNodeDrag:{type:Boolean,default:void 0},autoPanSpeed:{}},emits:["nodesChange","edgesChange","nodesInitialized","paneReady","init","updateNodeInternals","error","connect","connectStart","connectEnd","clickConnectStart","clickConnectEnd","moveStart","move","moveEnd","selectionDragStart","selectionDrag","selectionDragStop","selectionContextMenu","selectionStart","selectionEnd","viewportChangeStart","viewportChange","viewportChangeEnd","paneScroll","paneClick","paneContextMenu","paneMouseEnter","paneMouseMove","paneMouseLeave","edgeUpdate","edgeContextMenu","edgeMouseEnter","edgeMouseMove","edgeMouseLeave","edgeDoubleClick","edgeClick","edgeUpdateStart","edgeUpdateEnd","nodeContextMenu","nodeMouseEnter","nodeMouseMove","nodeMouseLeave","nodeDoubleClick","nodeClick","nodeDragStart","nodeDrag","nodeDragStop","miniMapNodeClick","miniMapNodeDoubleClick","miniMapNodeMouseEnter","miniMapNodeMouseMove","miniMapNodeMouseLeave","update:modelValue","update:nodes","update:edges"],setup(e,{expose:t,emit:n}){const r=e,o=Yh(),i=ts(r,"modelValue",n),s=ts(r,"nodes",n),a=ts(r,"edges",n),l=Oe(r),u=oC({modelValue:i,nodes:s,edges:a},r,l);return sC(n,l.hooks),rS(),kS(),Qn(Mi,o),Xr(u),t(l),(c,d)=>(X(),re("div",{ref:k(l).vueFlowRef,class:"vue-flow"},[ie(ZC,null,{default:le(()=>[ie(vS),CS,ie(xS),be(c.$slots,"zoom-pane")]),_:3}),be(c.$slots,"default"),ie(nS)],512))}}),AS={name:"Panel",compatConfig:{MODE:3}},LS=me({...AS,props:{position:{}},setup(e){const t=e,{userSelectionActive:n}=Oe(),r=te(()=>`${t.position}`.split("-"));return(o,i)=>(X(),re("div",{class:et(["vue-flow__panel",r.value]),style:tt({pointerEvents:k(n)?"none":"all"})},[be(o.$slots,"default")],6))}});var Ut=(e=>(e.Lines="lines",e.Dots="dots",e))(Ut||{});const uh=function({dimensions:e,size:t,color:n}){return Pe("path",{stroke:n,"stroke-width":t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`})},ch=function({radius:e,color:t}){return Pe("circle",{cx:e,cy:e,r:e,fill:t})};Ut.Lines+"",Ut.Dots+"";const IS={[Ut.Dots]:"#81818a",[Ut.Lines]:"#eee"},PS=["id","x","y","width","height","patternTransform"],NS={key:2,height:"100",width:"100"},RS=["fill"],MS=["x","y","fill"],OS={name:"Background",compatConfig:{MODE:3}},DS=me({...OS,props:{id:{},variant:{default:()=>Ut.Dots},gap:{default:20},size:{default:1},lineWidth:{default:1},patternColor:{},color:{},bgColor:{},height:{default:100},width:{default:100},x:{default:0},y:{default:0},offset:{default:0}},setup(e){const{id:t,viewport:n}=Oe(),r=te(()=>{const s=n.value.zoom,[a,l]=Array.isArray(e.gap)?e.gap:[e.gap,e.gap],u=[a*s||1,l*s||1],c=e.size*s,[d,f]=Array.isArray(e.offset)?e.offset:[e.offset,e.offset],h=[d*s||1+u[0]/2,f*s||1+u[1]/2];return{scaledGap:u,offset:h,size:c}}),o=Re(()=>`pattern-${t}${e.id?`-${e.id}`:""}`),i=Re(()=>e.color||e.patternColor||IS[e.variant||Ut.Dots]);return(s,a)=>(X(),re("svg",{class:"vue-flow__background vue-flow__container",style:tt({height:`${s.height>100?100:s.height}%`,width:`${s.width>100?100:s.width}%`})},[be(s.$slots,"pattern-container",{id:o.value},()=>[ee("pattern",{id:o.value,x:k(n).x%r.value.scaledGap[0],y:k(n).y%r.value.scaledGap[1],width:r.value.scaledGap[0],height:r.value.scaledGap[1],patternTransform:`translate(-${r.value.offset[0]},-${r.value.offset[1]})`,patternUnits:"userSpaceOnUse"},[be(s.$slots,"pattern",{},()=>[s.variant===k(Ut).Lines?(X(),ye(k(uh),{key:0,size:s.lineWidth,color:i.value,dimensions:r.value.scaledGap},null,8,["size","color","dimensions"])):s.variant===k(Ut).Dots?(X(),ye(k(ch),{key:1,color:i.value,radius:r.value.size/2},null,8,["color","radius"])):we("",!0),s.bgColor?(X(),re("svg",NS,[ee("rect",{width:"100%",height:"100%",fill:s.bgColor},null,8,RS)])):we("",!0)])],8,PS)]),ee("rect",{x:s.x,y:s.y,width:"100%",height:"100%",fill:`url(#${o.value})`},null,8,MS),be(s.$slots,"default",{id:o.value})],4))}}),$S={name:"ControlButton",compatConfig:{MODE:3}},VS=(e,t)=>{const n=e.__vccOpts||e;for(const[r,o]of t)n[r]=o;return n},BS={type:"button",class:"vue-flow__controls-button"};function FS(e,t,n,r,o,i){return X(),re("button",BS,[be(e.$slots,"default")])}const xo=VS($S,[["render",FS]]),zS={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},HS=ee("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"},null,-1),GS=[HS];function jS(e,t){return X(),re("svg",zS,GS)}const US={render:jS},WS={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},qS=ee("path",{d:"M0 0h32v4.2H0z"},null,-1),YS=[qS];function XS(e,t){return X(),re("svg",WS,YS)}const KS={render:XS},ZS={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},QS=ee("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0 0 27.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94a.919.919 0 0 1-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"},null,-1),JS=[QS];function eT(e,t){return X(),re("svg",ZS,JS)}const tT={render:eT},nT={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},rT=ee("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 0 0 0 13.714v15.238A3.056 3.056 0 0 0 3.048 32h18.285a3.056 3.056 0 0 0 3.048-3.048V13.714a3.056 3.056 0 0 0-3.048-3.047zM12.19 24.533a3.056 3.056 0 0 1-3.047-3.047 3.056 3.056 0 0 1 3.047-3.048 3.056 3.056 0 0 1 3.048 3.048 3.056 3.056 0 0 1-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"},null,-1),oT=[rT];function iT(e,t){return X(),re("svg",nT,oT)}const sT={render:iT},aT={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},lT=ee("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 0 0 0 13.714v15.238A3.056 3.056 0 0 0 3.048 32h18.285a3.056 3.056 0 0 0 3.048-3.048V13.714a3.056 3.056 0 0 0-3.048-3.047zM12.19 24.533a3.056 3.056 0 0 1-3.047-3.047 3.056 3.056 0 0 1 3.047-3.048 3.056 3.056 0 0 1 3.048 3.048 3.056 3.056 0 0 1-3.048 3.047z"},null,-1),uT=[lT];function cT(e,t){return X(),re("svg",aT,uT)}const dT={render:cT},fT={name:"Controls",compatConfig:{MODE:3}},hT=me({...fT,props:{showZoom:{type:Boolean,default:!0},showFitView:{type:Boolean,default:!0},showInteractive:{type:Boolean,default:!0},fitViewParams:{},position:{default:()=>Rf.BottomLeft}},emits:["zoomIn","zoomOut","fitView","interactionChange"],setup(e,{emit:t}){const{nodesDraggable:n,nodesConnectable:r,elementsSelectable:o,setInteractive:i,zoomIn:s,zoomOut:a,fitView:l,viewport:u,minZoom:c,maxZoom:d}=Oe(),f=Re(()=>n.value||r.value||o.value),h=Re(()=>u.value.zoom<=c.value),p=Re(()=>u.value.zoom>=d.value);function b(){s(),t("zoomIn")}function _(){a(),t("zoomOut")}function y(){l(e.fitViewParams),t("fitView")}function g(){i(!f.value),t("interactionChange",!f.value)}return(m,v)=>(X(),ye(k(LS),{class:"vue-flow__controls",position:m.position},{default:le(()=>[be(m.$slots,"top"),m.showZoom?(X(),re(De,{key:0},[be(m.$slots,"control-zoom-in",{},()=>[ie(xo,{class:"vue-flow__controls-zoomin",disabled:p.value,onClick:b},{default:le(()=>[be(m.$slots,"icon-zoom-in",{},()=>[(X(),ye(Lt(k(US))))])]),_:3},8,["disabled"])]),be(m.$slots,"control-zoom-out",{},()=>[ie(xo,{class:"vue-flow__controls-zoomout",disabled:h.value,onClick:_},{default:le(()=>[be(m.$slots,"icon-zoom-out",{},()=>[(X(),ye(Lt(k(KS))))])]),_:3},8,["disabled"])])],64)):we("",!0),m.showFitView?be(m.$slots,"control-fit-view",{key:1},()=>[ie(xo,{class:"vue-flow__controls-fitview",onClick:y},{default:le(()=>[be(m.$slots,"icon-fit-view",{},()=>[(X(),ye(Lt(k(tT))))])]),_:3})]):we("",!0),m.showInteractive?be(m.$slots,"control-interactive",{key:2},()=>[m.showInteractive?(X(),ye(xo,{key:0,class:"vue-flow__controls-interactive",onClick:g},{default:le(()=>[f.value?be(m.$slots,"icon-unlock",{key:0},()=>[(X(),ye(Lt(k(dT))))]):we("",!0),f.value?we("",!0):be(m.$slots,"icon-lock",{key:1},()=>[(X(),ye(Lt(k(sT))))])]),_:3})):we("",!0)]):we("",!0),be(m.$slots,"default")]),_:3},8,["position"]))}}),pT={key:0,class:"space-y-2"},mT={class:"flex items-center justify-between gap-2 text-[11px] text-muted-foreground"},gT={class:"shrink-0 font-mono"},vT=["title"],yT={class:"line-clamp-2 text-sm font-medium leading-snug"},_T={class:"flex items-center justify-between gap-2 text-[11px] text-muted-foreground"},bT={class:"flex items-center gap-1.5 text-[10px] uppercase tracking-wide"},wT={class:"rounded bg-background/60 px-1.5 py-0.5"},ET={class:"rounded bg-background/60 px-1.5 py-0.5"},xT={key:1,class:"space-y-1.5"},kT={class:"flex items-center gap-2 text-sm font-medium"},CT={class:"font-mono text-[11px] text-muted-foreground"},ST=me({__name:"Node",props:{id:{},type:{},selected:{type:Boolean},connectable:{type:[Boolean,Number,String,Function]},position:{},dimensions:{},label:{},isValidTargetPos:{type:Function},isValidSourcePos:{type:Function},parent:{},parentNodeId:{},dragging:{type:Boolean},resizing:{type:Boolean},zIndex:{},targetPosition:{},sourcePosition:{},dragHandle:{},data:{},events:{}},setup(e){const t=e,n=te(()=>t.data),r=te(()=>n.value.kind==="task"?n.value:null),o=te(()=>n.value.kind==="external"?n.value:null),i=te(()=>{if(n.value.kind!=="task")return{label:"Missing dependency",icon:En,class:"text-amber-600 dark:text-amber-400"};switch(n.value.status){case"completed":return{label:"Completed",icon:$o,class:"text-emerald-600 dark:text-emerald-400"};case"in_progress":return{label:"In Progress",icon:Sc,class:"text-blue-600 dark:text-blue-400"};default:return{label:"Pending",icon:Cr,class:"text-muted-foreground"}}}),s=te(()=>n.value.kind!=="task"?null:n.value.priority.replace("_"," ")),a=te(()=>n.value.kind!=="task"?null:n.value.category),l=te(()=>n.value.kind==="external"?["border-amber-500/60 bg-amber-50/70 text-amber-900 dark:border-amber-500/40 dark:bg-amber-500/10 dark:text-amber-100","border-dashed"]:n.value.status==="completed"?["border-emerald-500/40 bg-emerald-50/70 text-emerald-950 dark:border-emerald-500/40 dark:bg-emerald-500/10 dark:text-emerald-100","border-solid"]:n.value.status==="in_progress"?["border-blue-500/40 bg-blue-50/80 text-blue-950 dark:border-blue-500/40 dark:bg-blue-500/10 dark:text-blue-100","border-solid"]:["border-border bg-card text-card-foreground","border-solid"]),u=te(()=>n.value.kind!=="task"||!n.value.showPrdLabel?null:n.value.prdName?.trim()||n.value.prdSlug);return(c,d)=>(X(),re("div",{class:et(["w-[17rem] rounded-xl border px-3 py-2 shadow-sm transition-[transform,box-shadow,border-color] duration-150 ease-[var(--ease-out-cubic)] motion-reduce:transition-none",[k(l),e.selected?"ring-2 ring-primary/30 shadow-md":"hover:shadow-md hover:border-primary/40"]])},[ie(k(ir),{type:"target",position:k(he).Top,class:"!h-2 !w-2 !border-0 !bg-transparent !opacity-0 !pointer-events-none"},null,8,["position"]),k(r)?(X(),re("div",pT,[ee("div",mT,[ee("span",gT,_e(k(r).taskId),1),k(u)?(X(),re("span",{key:0,title:`${k(r).prdName} (${k(r).prdSlug})`,class:"max-w-[11rem] truncate rounded border border-border bg-background/60 px-1.5 py-0.5 text-[10px]"},_e(k(u)),9,vT)):we("",!0)]),ee("p",yT,_e(k(r).title),1),ee("div",_T,[ee("div",{class:et(["flex items-center gap-1.5",k(i).class])},[(X(),ye(Lt(k(i).icon),{class:"size-3.5"})),ee("span",null,_e(k(i).label),1)],2),ee("div",bT,[ee("span",wT,_e(k(a)),1),ee("span",ET,_e(k(s)),1)])])])):k(o)?(X(),re("div",xT,[ee("div",kT,[ie(k(En),{class:"size-4"}),ee("span",null,_e(k(o).title),1)]),ee("p",CT,_e(k(o).dependencyRef),1)])):we("",!0),ie(k(ir),{type:"source",position:k(he).Bottom,class:"!h-2 !w-2 !border-0 !bg-transparent !opacity-0 !pointer-events-none"},null,8,["position"])],2))}}),ec=Object.assign(ST,{__name:"GraphNode"}),TT={class:"relative h-full overflow-hidden rounded-lg border border-border bg-card"},AT={key:0,class:"flex h-full items-center justify-center"},LT={class:"flex flex-col items-center gap-2 text-sm text-muted-foreground"},IT={key:1,class:"flex h-full items-center justify-center p-6"},PT={class:"max-w-sm text-center"},NT={class:"mt-1 text-sm text-muted-foreground"},RT={key:2,class:"flex h-full items-center justify-center p-6"},MT={class:"max-w-sm text-center"},OT={class:"mt-1 text-sm text-muted-foreground"},DT={key:4,class:"pointer-events-none absolute top-3 left-3 z-10 rounded-md border border-border bg-background/95 p-2.5 shadow-sm"},$T={class:"space-y-1 text-xs"},VT={class:"flex items-center gap-1.5 text-muted-foreground"},BT={class:"flex items-center gap-1.5 text-blue-600 dark:text-blue-400"},FT={class:"flex items-center gap-1.5 text-emerald-600 dark:text-emerald-400"},zT={class:"flex items-center gap-1.5 text-amber-600 dark:text-amber-400"},HT={key:5,class:"pointer-events-none absolute top-3 right-3 z-10 rounded-md border border-border bg-background/95 p-2.5 shadow-sm"},GT={class:"flex flex-wrap items-center gap-1.5 text-[11px] text-muted-foreground"},jT={class:"rounded bg-muted px-1.5 py-0.5"},UT={class:"rounded bg-blue-500/10 px-1.5 py-0.5 text-blue-700 dark:text-blue-300"},WT={class:"rounded bg-emerald-500/10 px-1.5 py-0.5 text-emerald-700 dark:text-emerald-300"},qT={class:"rounded bg-amber-500/10 px-1.5 py-0.5 text-amber-700 dark:text-amber-300"},YT=me({__name:"Explorer",props:{payload:{},scope:{},loading:{type:Boolean,default:!1},error:{default:null}},emits:["taskClick"],setup(e,{emit:t}){const n=e,r=t,o={task:Un(ec),external:Un(ec)},i=Hh("(prefers-reduced-motion: reduce)"),s=fe(0);xe(()=>[n.scope,n.payload?.scope,n.payload?.nodes.length,n.payload?.edges.length],()=>{s.value+=1},{deep:!1});const a=te(()=>`${n.scope}-${s.value}`),l=te(()=>n.payload?n.payload.nodes.some(_=>_.kind==="task"):!1),u=te(()=>n.payload?.stats);function c(_,y){return _.kind==="external"?{width:272,height:80}:y==="repo"?{width:272,height:116}:{width:272,height:96}}function d(_){return _==="repo"?{ranksep:136,nodesep:88,edgesep:34,marginx:36,marginy:28}:{ranksep:102,nodesep:56,edgesep:20,marginx:24,marginy:22}}function f(_,y){const g=new cu.graphlib.Graph,m=d(n.scope);g.setDefaultEdgeLabel(()=>({})),g.setGraph({rankdir:"TB",ranker:"network-simplex",...m});for(const v of _){const x=c(v.data,n.scope);g.setNode(v.id,x)}for(const v of y)g.setEdge(v.source,v.target);return cu.layout(g),_.map(v=>{const x=c(v.data,n.scope),L=g.node(v.id);return L?{...v,targetPosition:he.Top,sourcePosition:he.Bottom,position:{x:L.x-x.width/2,y:L.y-x.height/2}}:v})}const h=te(()=>n.payload?n.payload.edges.map(_=>({id:_.id,source:_.source,target:_.target,type:"step",animated:_.unresolved&&!i.value,markerEnd:{type:si.ArrowClosed,width:16,height:16},style:{strokeWidth:_.unresolved?1.4:1.7,stroke:_.unresolved?"var(--muted-foreground)":"var(--border)",strokeOpacity:_.unresolved?.62:.95,strokeDasharray:_.unresolved?"5 4":void 0}})):[]),p=te(()=>{if(!n.payload)return[];const _=n.payload.nodes.map(y=>({id:y.id,type:y.kind,data:{...y,showPrdLabel:y.kind==="task"?n.scope==="repo":void 0},draggable:!1,selectable:y.kind==="task",connectable:!1,position:{x:0,y:0}}));return f(_,h.value)});function b(_){const g=_.node.data;!g||g.kind!=="task"||r("taskClick",{prdSlug:g.prdSlug,taskId:g.taskId})}return(_,y)=>(X(),re("div",TT,[e.loading?(X(),re("div",AT,[ee("div",LT,[ie(k(ks),{class:"size-5 animate-spin"}),y[0]||(y[0]=ee("span",null,"Building graph...",-1))])])):e.error?(X(),re("div",IT,[ee("div",PT,[ie(k(Do),{class:"mx-auto mb-3 size-8 text-destructive"}),y[1]||(y[1]=ee("p",{class:"text-sm font-medium"},"Graph unavailable",-1)),ee("p",NT,_e(e.error),1)])])):!e.payload||!k(l)?(X(),re("div",RT,[ee("div",MT,[ie(k(hp),{class:"mx-auto mb-3 size-8 text-muted-foreground/60"}),y[2]||(y[2]=ee("p",{class:"text-sm font-medium"},"No graphable tasks yet",-1)),ee("p",OT,_e(e.scope==="repo"?"No PRDs with task state were found in this repository.":"This PRD does not have generated tasks yet."),1)])])):(X(),ye(k(TS),{key:k(a),nodes:k(p),edges:k(h),"node-types":o,"fit-view-on-init":!0,"fit-view-on-init-options":{padding:.2},"nodes-draggable":!1,"nodes-connectable":!1,"elements-selectable":!0,"zoom-on-scroll":!0,"pan-on-drag":!0,"min-zoom":.2,"max-zoom":1.8,class:"h-full",onNodeClick:b},{default:le(()=>[ie(k(DS),{gap:20,size:1.2,variant:"dots",color:"var(--border)"}),ie(k(hT),{position:"bottom-left","show-interactive":!1})]),_:1},8,["nodes","edges"])),e.payload&&k(l)?(X(),re("div",DT,[y[7]||(y[7]=ee("p",{class:"mb-1 text-[11px] font-medium uppercase tracking-wide text-muted-foreground"},"Legend",-1)),ee("div",$T,[ee("div",VT,[ie(k(Cr),{class:"size-3.5"}),y[3]||(y[3]=Le(" Pending ",-1))]),ee("div",BT,[ie(k(Sc),{class:"size-3.5"}),y[4]||(y[4]=Le(" In Progress ",-1))]),ee("div",FT,[ie(k($o),{class:"size-3.5"}),y[5]||(y[5]=Le(" Completed ",-1))]),ee("div",zT,[ie(k(En),{class:"size-3.5"}),y[6]||(y[6]=Le(" Missing dependency ",-1))])])])):we("",!0),k(u)&&k(l)?(X(),re("div",HT,[ee("div",GT,[ee("span",jT,"Total "+_e(k(u).total),1),ee("span",UT,"WIP "+_e(k(u).inProgress),1),ee("span",WT,"Done "+_e(k(u).completed),1),ee("span",qT,"Missing "+_e(k(u).unresolved),1)])])):we("",!0)]))}}),sI=Object.assign(YT,{__name:"GraphExplorer"}),XT={class:"space-y-0.5 p-2"},KT=["onClick"],ZT={class:"min-w-0 flex-1"},QT=["title"],JT={class:"text-muted-foreground"},e2={class:"mt-1 flex h-1.5 w-full overflow-hidden rounded-full bg-muted"},t2={class:"flex shrink-0 items-center gap-1 text-xs"},n2={key:0,class:"text-green-600 dark:text-green-400"},r2={key:1,class:"text-red-600 dark:text-red-400"},o2={key:0,class:"py-4 text-center text-sm text-muted-foreground"},i2=me({__name:"ChangesMinimap",props:{files:{},selectedFile:{}},emits:["select"],setup(e,{emit:t}){const n=e,r=t,o=te(()=>n.files.length===0?1:Math.max(...n.files.map(c=>c.additions+c.deletions),1));function i(c){switch(c){case"added":return{icon:Dp,class:"text-green-600 dark:text-green-400"};case"deleted":return{icon:$p,class:"text-red-600 dark:text-red-400"};case"renamed":return{icon:cl,class:"text-blue-600 dark:text-blue-400"};default:return{icon:Op,class:"text-yellow-600 dark:text-yellow-400"}}}function s(c){const d=c.additions+c.deletions;if(d===0)return{additions:0,deletions:0,total:0};const f=d/o.value*100,h=c.additions/d*f,p=c.deletions/d*f;return{additions:h,deletions:p,total:f}}function a(c){return c.status==="renamed"&&c.oldPath?`${c.oldPath} → ${c.path}`:c.path}function l(c){return c.split("/").pop()||c}function u(c){r("select",c)}return(c,d)=>(X(),re("div",XT,[(X(!0),re(De,null,Wt(e.files,f=>(X(),re("button",{key:f.path,class:et(["group flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-sm transition-colors hover:bg-muted/50",{"bg-muted":e.selectedFile===f.path}]),onClick:h=>u(f.path)},[(X(),ye(Lt(i(f.status).icon),{class:et(["size-4 shrink-0",i(f.status).class])},null,8,["class"])),ee("div",ZT,[ee("div",{class:et(["truncate text-xs",{"font-medium":e.selectedFile===f.path}]),title:a(f)},[f.status==="renamed"&&f.oldPath?(X(),re(De,{key:0},[ee("span",JT,_e(l(f.oldPath)),1),ie(k(cl),{class:"mx-1 inline size-3 text-muted-foreground"}),ee("span",null,_e(l(f.path)),1)],64)):(X(),re(De,{key:1},[Le(_e(f.path),1)],64))],10,QT),ee("div",e2,[s(f).additions>0?(X(),re("div",{key:0,class:"bg-green-500 dark:bg-green-400",style:tt({width:`${s(f).additions}%`})},null,4)):we("",!0),s(f).deletions>0?(X(),re("div",{key:1,class:"bg-red-500 dark:bg-red-400",style:tt({width:`${s(f).deletions}%`})},null,4)):we("",!0)])]),ee("div",t2,[f.additions>0?(X(),re("span",n2," +"+_e(f.additions),1)):we("",!0),f.deletions>0?(X(),re("span",r2," -"+_e(f.deletions),1)):we("",!0)])],10,KT))),128)),e.files.length===0?(X(),re("div",o2," No files changed ")):we("",!0)]))}}),s2=Object.assign(i2,{__name:"GitChangesMinimap"}),ci="diffs-container",a2=/(?=^From [a-f0-9]+ .+$)/m,fs=/(?=^diff --git)/gm,tc=/(?=^---\s+\S)/gm,l2=/(?=^@@ )/gm,u2=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@(?: (.*))?/m,la=new RegExp("(?<=\\n)"),c2=/^(---|\+\+\+)\s+([^\t\r\n]+)/,d2=/^(---|\+\+\+)\s+[ab]\/([^\t\r\n]+)/,f2=/^diff --git (?:"a\/(.+?)"|a\/(.+?)) (?:"b\/(.+?)"|b\/(.+?))$/,h2=/^index (?:[0-9a-f]+)\.\.(?:[0-9a-f]+)(?: (\d+))?/,ol="header-metadata",it={dark:"pierre-dark",light:"pierre-light"},il="data-unsafe-css";function p2(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}var dh=class{pre;selectedRange=null;renderedSelectionRange;anchor;_queuedRender;constructor(e={}){this.options=e}setOptions(e){this.options={...this.options,...e},this.removeEventListeners(),this.options.enableLineSelection===!0&&this.attachEventListeners()}cleanUp(){this.removeEventListeners(),this._queuedRender!=null&&(cancelAnimationFrame(this._queuedRender),this._queuedRender=void 0),this.pre!=null&&delete this.pre.dataset.interactiveLineNumbers,this.pre=void 0}setup(e){this.setDirty(),this.pre!==e&&this.cleanUp(),this.pre=e;const{enableLineSelection:t=!1}=this.options;t?(this.pre.dataset.interactiveLineNumbers="",this.attachEventListeners()):(this.removeEventListeners(),delete this.pre.dataset.interactiveLineNumbers),this.setSelection(this.selectedRange)}setDirty(){this.renderedSelectionRange=void 0}isDirty(){return this.renderedSelectionRange===void 0}setSelection(e){const t=!(e===this.selectedRange||p2(e??void 0,this.selectedRange??void 0));!this.isDirty()&&!t||(this.selectedRange=e,this.renderSelection(),t&&this.notifySelectionChange())}getSelection(){return this.selectedRange}attachEventListeners(){this.pre!=null&&(this.removeEventListeners(),this.pre.addEventListener("pointerdown",this.handleMouseDown))}removeEventListeners(){this.pre!=null&&(this.pre.removeEventListener("pointerdown",this.handleMouseDown),document.removeEventListener("pointermove",this.handleMouseMove),document.removeEventListener("pointerup",this.handleMouseUp))}handleMouseDown=e=>{const t=e.button===0?this.getMouseEventDataForPath(e.composedPath(),"click"):void 0;if(t==null)return;e.preventDefault();const{lineNumber:n,eventSide:r,lineIndex:o}=t;if(e.shiftKey&&this.selectedRange!=null){const i=this.deriveRowRangeFromDOM(this.selectedRange,this.pre?.dataset.type==="split");if(i==null)return;const s=i.start<=i.end?o>=i.start:o<=i.end;this.anchor={line:s?this.selectedRange.start:this.selectedRange.end,side:(s?this.selectedRange.side:this.selectedRange.endSide??this.selectedRange.side)??"additions"},this.updateSelection(n,r),this.notifySelectionStart(this.selectedRange)}else{if(this.selectedRange?.start===n&&this.selectedRange?.end===n){this.updateSelection(null),this.notifySelectionEnd(null),this.notifySelectionChange();return}this.selectedRange=null,this.anchor={line:n,side:r},this.updateSelection(n,r),this.notifySelectionStart(this.selectedRange)}document.addEventListener("pointermove",this.handleMouseMove),document.addEventListener("pointerup",this.handleMouseUp)};handleMouseMove=e=>{const t=this.getMouseEventDataForPath(e.composedPath(),"move");if(t==null||this.anchor==null)return;const{lineNumber:n,eventSide:r}=t;this.updateSelection(n,r)};handleMouseUp=()=>{this.anchor=void 0,document.removeEventListener("pointermove",this.handleMouseMove),document.removeEventListener("pointerup",this.handleMouseUp),this.notifySelectionEnd(this.selectedRange),this.notifySelectionChange()};updateSelection(e,t){if(e==null)this.selectedRange=null;else{const n=this.anchor?.side??t;this.selectedRange={start:this.anchor?.line??e,end:e,side:n,endSide:n!==t?t:void 0}}this._queuedRender??=requestAnimationFrame(this.renderSelection)}renderSelection=()=>{if(this._queuedRender!=null&&(cancelAnimationFrame(this._queuedRender),this._queuedRender=void 0),this.pre==null||this.renderedSelectionRange===this.selectedRange)return;const e=this.pre.querySelectorAll("[data-selected-line]");for(const a of e)a.removeAttribute("data-selected-line");if(this.renderedSelectionRange=this.selectedRange,this.selectedRange==null)return;const t=this.pre.querySelectorAll("[data-code]");if(t.length===0)return;if(t.length>2)throw console.error(t),new Error("LineSelectionManager.applySelectionToDOM: Somehow there are more than 2 code elements...");const n=this.pre.dataset.type==="split",r=this.deriveRowRangeFromDOM(this.selectedRange,n);if(r==null)throw console.error({rowRange:r,selectedRange:this.selectedRange}),new Error("LineSelectionManager.renderSelection: No valid rowRange");const o=r.start===r.end,i=Math.min(r.start,r.end),s=Math.max(r.start,r.end);for(const a of t)for(const l of a.children){if(!(l instanceof HTMLElement))continue;const u=this.getLineIndex(l,n);if((u??0)>s)break;if(u==null||u<i)continue;let c=o?"single":u===i?"first":u===s?"last":"";l.setAttribute("data-selected-line",c),l.nextSibling instanceof HTMLElement&&l.nextSibling.hasAttribute("data-line-annotation")&&(o?(c="last",l.setAttribute("data-selected-line","first")):u===i?c="":u===s&&l.setAttribute("data-selected-line",""),l.nextSibling.setAttribute("data-selected-line",c))}};deriveRowRangeFromDOM(e,t){if(e==null)return;const n=this.findRowIndexForLineNumber(e.start,e.side,t),r=e.end===e.start&&(e.endSide==null||e.endSide===e.side)?n:this.findRowIndexForLineNumber(e.end,e.endSide??e.side,t);return n!=null&&r!=null?{start:n,end:r}:void 0}findRowIndexForLineNumber(e,t="additions",n){if(this.pre==null)return;const r=Array.from(this.pre.querySelectorAll(`[data-line="${e}"]`));if(r.push(...Array.from(this.pre.querySelectorAll(`[data-alt-line="${e}"]`))),r.length!==0){for(const o of r)if(o instanceof HTMLElement){if(this.getLineSideFromElement(o)===t)return this.getLineIndex(o,n);if(parseInt(o.dataset.altLine??"")===e)return this.getLineIndex(o,n)}console.error("LineSelectionManager.findRowIndexForLineNumber: Invalid selection",e,t)}}notifySelectionChange(){const{onLineSelected:e}=this.options;e?.(this.selectedRange??null)}notifySelectionStart(e){const{onLineSelectionStart:t}=this.options;t?.(e)}notifySelectionEnd(e){const{onLineSelectionEnd:t}=this.options;t?.(e)}getMouseEventDataForPath(e,t){let n,r,o=!1,i;for(const s of e)if(s instanceof HTMLElement){if(s.hasAttribute("data-column-number")){o=!0;continue}if(s.hasAttribute("data-line")){if(n=this.getLineNumber(s),r=this.getLineIndex(s,this.pre?.dataset.type==="split"),s.dataset.lineType==="change-deletion"?i="deletions":s.dataset.lineType==="change-additions"&&(i="additions"),r==null||n==null){r=void 0,n=void 0;break}if(i!=null)break;continue}if(s.hasAttribute("data-code")){i??=s.hasAttribute("data-deletions")?"deletions":"additions";break}}if(!(t==="click"&&!o||r==null||n==null))return{lineIndex:r,lineNumber:n,eventSide:i??"additions"}}getLineNumber(e){const t=parseInt(e.dataset.line??"",10);return Number.isNaN(t)?void 0:t}getLineIndex(e,t){const n=(e.dataset.lineIndex??"").split(",").map(r=>parseInt(r)).filter(r=>!Number.isNaN(r));if(t&&n.length===2)return n[1];if(!t)return n[0]}getLineSideFromElement(e){if(e.dataset.lineType==="change-deletion")return"deletions";if(e.dataset.lineType==="change-addition")return"additions";const t=e.closest("[data-code]");return t instanceof HTMLElement&&t.hasAttribute("data-deletions")?"deletions":"additions"}};function di({enableLineSelection:e,onLineSelected:t,onLineSelectionStart:n,onLineSelectionEnd:r}){return{enableLineSelection:e,onLineSelected:t,onLineSelectionStart:n,onLineSelectionEnd:r}}function hs(e,t){return e==null?!1:t==="file"?e.type==="line":e.type==="diff-line"}function m2(e){return e?.type==="line-info"}var fh=class{hoveredLine;pre;hoverSlot;constructor(e,t){this.mode=e,this.options=t}setOptions(e){this.options=e}cleanUp(){this.pre?.removeEventListener("click",this.handleMouseClick),this.pre?.removeEventListener("pointermove",this.handleMouseMove),this.pre?.removeEventListener("pointerout",this.handleMouseLeave),delete this.pre?.dataset.interactiveLines,delete this.pre?.dataset.interactiveLineNumbers,this.pre=void 0}setup(e){const{__debugMouseEvents:t,onLineClick:n,onLineNumberClick:r,onLineEnter:o,onLineLeave:i,onHunkExpand:s,enableHoverUtility:a=!1}=this.options;if(this.cleanUp(),this.pre=e,a&&this.hoverSlot==null){this.hoverSlot=document.createElement("div"),this.hoverSlot.dataset.hoverSlot="";const l=document.createElement("slot");l.name="hover-slot",this.hoverSlot.appendChild(l)}else!a&&this.hoverSlot!=null&&(this.hoverSlot.parentNode?.removeChild(this.hoverSlot),this.hoverSlot=void 0);(n!=null||r!=null||s!=null)&&(e.addEventListener("click",this.handleMouseClick),n!=null?e.dataset.interactiveLines="":r!=null&&(e.dataset.interactiveLineNumbers=""),Ke(t,"click","FileDiff.DEBUG.attachEventListeners: Attaching click events for:",(()=>{const l=[];return(t==="both"||t==="click")&&(n!=null&&l.push("onLineClick"),r!=null&&l.push("onLineNumberClick"),s!=null&&l.push("expandable hunk separators")),l})())),(o!=null||i!=null||a)&&(e.addEventListener("pointermove",this.handleMouseMove),Ke(t,"move","FileDiff.DEBUG.attachEventListeners: Attaching pointer move event"),e.addEventListener("pointerleave",this.handleMouseLeave),Ke(t,"move","FileDiff.DEBUG.attachEventListeners: Attaching pointer leave event"))}getHoveredLine=()=>{if(this.hoveredLine!=null){if(this.mode==="diff"&&this.hoveredLine.type==="diff-line")return{lineNumber:this.hoveredLine.lineNumber,side:this.hoveredLine.annotationSide};if(this.mode==="file"&&this.hoveredLine.type==="line")return{lineNumber:this.hoveredLine.lineNumber}}};handleMouseClick=e=>{Ke(this.options.__debugMouseEvents,"click","FileDiff.DEBUG.handleMouseClick:",e),this.handleMouseEvent({eventType:"click",event:e})};handleMouseMove=e=>{Ke(this.options.__debugMouseEvents,"move","FileDiff.DEBUG.handleMouseMove:",e),this.handleMouseEvent({eventType:"move",event:e})};handleMouseLeave=e=>{const{__debugMouseEvents:t}=this.options;if(Ke(t,"move","FileDiff.DEBUG.handleMouseLeave: no event"),this.hoveredLine==null){Ke(t,"move","FileDiff.DEBUG.handleMouseLeave: returned early, no .hoveredLine");return}this.hoverSlot?.parentElement?.removeChild(this.hoverSlot),this.options.onLineLeave?.({...this.hoveredLine,event:e}),this.hoveredLine=void 0};handleMouseEvent({eventType:e,event:t}){const{__debugMouseEvents:n}=this.options,r=t.composedPath();Ke(n,e,"FileDiff.DEBUG.handleMouseEvent:",{eventType:e,composedPath:r});const o=this.getLineData(r);Ke(n,e,"FileDiff.DEBUG.handleMouseEvent: getLineData result:",o);const{onLineClick:i,onLineNumberClick:s,onLineEnter:a,onLineLeave:l,onHunkExpand:u}=this.options;switch(e){case"move":if(hs(o,this.mode)&&this.hoveredLine?.lineElement===o.lineElement){Ke(n,"move","FileDiff.DEBUG.handleMouseEvent: switch, 'move', returned early because same line");break}this.hoveredLine!=null&&(Ke(n,"move","FileDiff.DEBUG.handleMouseEvent: switch, 'move', clearing an existing hovered line and firing onLineLeave"),this.hoverSlot?.parentElement?.removeChild(this.hoverSlot),l?.({...this.hoveredLine,event:t}),this.hoveredLine=void 0),hs(o,this.mode)&&(Ke(n,"move","FileDiff.DEBUG.handleMouseEvent: switch, 'move', setting up a new hoveredLine and firing onLineEnter"),this.hoveredLine=o,this.hoverSlot!=null&&o.numberElement?.appendChild(this.hoverSlot),a?.({...this.hoveredLine,event:t}));break;case"click":if(Ke(n,"click","FileDiff.DEBUG.handleMouseEvent: switch, 'click', with data:",o),o==null)break;if(m2(o)&&u!=null){Ke(n,"click","FileDiff.DEBUG.handleMouseEvent: switch, 'click', expanding a hunk"),u(o.hunkIndex,o.direction);break}hs(o,this.mode)&&(s!=null&&o.numberColumn?(Ke(n,"click","FileDiff.DEBUG.handleMouseEvent: switch, 'click', firing 'onLineNumberClick'"),s({...o,event:t})):i!=null?(Ke(n,"click","FileDiff.DEBUG.handleMouseEvent: switch, 'click', firing 'onLineClick'"),i({...o,event:t})):Ke(n,"click","FileDiff.DEBUG.handleMouseEvent: switch, 'click', fell through, no event to fire"));break}}getLineData(e){let t=!1;const n=e.find(s=>s instanceof HTMLElement?(t=t||"columnNumber"in s.dataset,"line"in s.dataset||"expandIndex"in s.dataset):!1);if(!(n instanceof HTMLElement))return;if(n.dataset.expandIndex!=null){const s=parseInt(n.dataset.expandIndex);if(isNaN(s))return;let a;for(const l of e)if(l===n||l instanceof HTMLElement&&(a=a??("expandUp"in l.dataset?"up":void 0)??("expandDown"in l.dataset?"down":void 0)??("expandBoth"in l.dataset?"both":void 0),a!=null))break;return a!=null?{type:"line-info",hunkIndex:s,direction:a}:void 0}const r=parseInt(n.dataset.line??"");if(isNaN(r))return;const o=n.dataset.lineType;if(o!=="context"&&o!=="context-expanded"&&o!=="change-deletion"&&o!=="change-addition")return;const i=(()=>{const s=n.children[0];return s instanceof HTMLElement&&s.dataset.columnNumber!=null?s:void 0})();return this.mode==="file"?{type:"line",lineElement:n,lineNumber:r,numberElement:i,numberColumn:t}:{type:"diff-line",annotationSide:(()=>{if(o==="change-deletion")return"deletions";if(o==="change-addition")return"additions";const s=n.closest("[data-code]");return s instanceof HTMLElement&&"deletions"in s.dataset?"deletions":"additions"})(),lineType:o,lineElement:n,numberElement:i,lineNumber:r,numberColumn:t}}};function Ke(e="none",t,...n){switch(e){case"none":return;case"both":break;case"click":if(t!=="click")return;break;case"move":if(t!=="move")return;break}console.log(...n)}function fi({onLineClick:e,onLineNumberClick:t,onLineEnter:n,onLineLeave:r,enableHoverUtility:o,__debugMouseEvents:i},s){return{onLineClick:e,onLineNumberClick:t,onLineEnter:n,onLineLeave:r,enableHoverUtility:o,__debugMouseEvents:i,onHunkExpand:s}}var hh=class{observedNodes=new Map;cleanUp(){this.resizeObserver?.disconnect(),this.observedNodes.clear()}resizeObserver;setup(e){this.cleanUp();const t=e.querySelectorAll('[data-line-annotation*=","]');this.resizeObserver??=new ResizeObserver(this.handleResizeObserver);const n=e.querySelectorAll("code");for(const o of n){let i=o.querySelector("[data-column-number]");i instanceof HTMLElement||(i=null);const s={type:"code",codeElement:o,numberElement:i,codeWidth:"auto",numberWidth:0};this.observedNodes.set(o,s),this.resizeObserver.observe(o),i!=null&&(this.observedNodes.set(i,s),this.resizeObserver.observe(i))}if(n.length<=1)return;const r=new Map;for(const o of t){if(!(o instanceof HTMLElement))continue;const{lineAnnotation:i=""}=o.dataset;if(!/^\d+,\d+$/.test(i)){console.error("DiffFileRenderer.setupResizeObserver: Invalid element or annotation",{lineAnnotation:i,element:o});continue}let s=r.get(i);s==null&&(s=[],r.set(i,s)),s.push(o)}for(const[o,i]of r){if(i.length!==2){console.error("DiffFileRenderer.setupResizeObserver: Bad Pair",o,i);continue}const[s,a]=i,l=s.firstElementChild,u=a.firstElementChild;if(!(s instanceof HTMLElement)||!(a instanceof HTMLElement)||!(l instanceof HTMLElement)||!(u instanceof HTMLElement))continue;const c={type:"annotations",column1:{container:s,child:l,childHeight:0},column2:{container:a,child:u,childHeight:0},currentHeight:"auto"};this.observedNodes.set(l,c),this.observedNodes.set(u,c),this.resizeObserver.observe(l),this.resizeObserver.observe(u)}}handleResizeObserver=e=>{for(const t of e){const{target:n,borderBoxSize:r}=t;if(!(n instanceof HTMLElement)){console.error("FileDiff.handleResizeObserver: Invalid element for ResizeObserver",t);continue}const o=this.observedNodes.get(n);if(o==null){console.error("FileDiff.handleResizeObserver: Not a valid observed node",t);continue}const i=r[0];if(o.type==="annotations"){const s=(()=>{if(n===o.column1.child)return o.column1;if(n===o.column2.child)return o.column2})();if(s==null){console.error("FileDiff.handleResizeObserver: Couldn't find a column for",{item:o,target:n});continue}s.childHeight=i.blockSize;const a=Math.max(o.column1.childHeight,o.column2.childHeight);a!==o.currentHeight&&(o.currentHeight=Math.max(a,0),o.column1.container.style.setProperty("--diffs-annotation-min-height",`${o.currentHeight}px`),o.column2.container.style.setProperty("--diffs-annotation-min-height",`${o.currentHeight}px`))}else o.type==="code"&&(n===o.codeElement?i.inlineSize!==o.codeWidth&&(o.codeWidth=i.inlineSize,o.codeElement.style.setProperty("--diffs-column-content-width",`${Math.max(o.codeWidth-o.numberWidth,0)}px`),o.codeElement.style.setProperty("--diffs-column-width",`${o.codeWidth}px`)):n===o.numberElement&&i.inlineSize!==o.numberWidth&&(o.numberWidth=i.inlineSize,o.codeElement.style.setProperty("--diffs-column-number-width",`${o.numberWidth}px`),o.codeWidth!=="auto"&&o.codeElement.style.setProperty("--diffs-column-content-width",`${Math.max(o.codeWidth-o.numberWidth,0)}px`)))}}};const Wr=new Map,ps=new Map,ua=new Set;function hi(e){for(const t of Array.isArray(e)?e:[e])if(!ua.has(t))return!1;return!0}function nc(e,t){e=Array.isArray(e)?e:[e];for(const n of e){if(ua.has(n.name))continue;let r=Wr.get(n.name);r==null&&(r=n,Wr.set(n.name,r)),ua.add(r.name),t.loadLanguageSync(r.data)}}function ph(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}async function g2(e){if(ph())throw new Error(`resolveLanguage("${e}") cannot be called from a worker context. Languages must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);const t=ps.get(e);if(t!=null)return t;try{const n=Td[e];if(n==null)throw new Error(`resolveLanguage: "${e}" not found in bundled languages`);const r=n().then(({default:o})=>{const i={name:e,data:o};return Wr.has(e)||Wr.set(e,i),i});return ps.set(e,r),await r}finally{ps.delete(e)}}function v2(e){return Wr.get(e)??g2(e)}const an=new Map,ms=new Map,ca=new Map,da=new Set;function rc(e,t){e=Array.isArray(e)?e:[e];for(let n of e){let r;if(typeof n=="string"){if(r=an.get(n),r==null)throw new Error(`loadResolvedThemes: ${n} is not resolved, you must resolve it before calling loadResolvedThemes`)}else r=n,n=n.name,an.has(n)||an.set(n,r);da.has(n)||(da.add(n),t.loadThemeSync(r))}}async function y2(e){if(ph())throw new Error(`resolveTheme("${e}") cannot be called from a worker context. Themes must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);const t=ms.get(e);if(t!=null)return t;try{const n=ca.get(e)??Ad[e];if(n==null)throw new Error(`resolveTheme: No valid loader for ${e}`);const r=n().then(i=>_2(e,"default"in i?i.default:i));ms.set(e,r);const o=await r;if(o.name!==e)throw new Error(`resolvedTheme: themeName: ${e} does not match theme.name: ${o.name}`);return an.set(o.name,o),o}finally{ms.delete(e)}}function _2(e,t){const n=an.get(e);return n??(t=Ei(t),an.set(e,t),t)}function b2(e){return an.get(e)??y2(e)}function mh(e,t){if(ca.has(e)){console.error("SharedHighlight.registerCustomTheme: theme name already registered",e);return}ca.set(e,t)}let At;async function gh({themes:e,langs:t}){At??=Id({themes:[],langs:["text"],engine:Xb()});const n=w2(At)?await At:At;At=n;const r=[];for(const i of t){if(i==="text"||i==="ansi")continue;const s=v2(i);"then"in s?r.push(s):nc(s,n)}const o=[];for(const i of e){const s=b2(i);"then"in s?o.push(s):rc(s,At)}return(r.length>0||o.length>0)&&await Promise.all([Promise.all(r).then(i=>{nc(i,n)}),Promise.all(o).then(i=>{rc(i,n)})]),n}function vh(){if(At!=null&&!("then"in At))return At}function w2(e=At){return e!=null&&"then"in e}mh("pierre-dark",()=>T(()=>import("./BXuwtOqb.js"),[],import.meta.url));mh("pierre-light",()=>T(()=>import("./dckrK0oj.js"),[],import.meta.url));function sl(e=it){const t=[];return typeof e=="string"?t.push(e):(t.push(e.dark),t.push(e.light)),t}function Pr(e){for(const t of sl(e))if(!da.has(t))return!1;return!0}function E2(e){for(const t of e)if(!an.has(t))return!1;return!0}function yh(e,t){return e==null||t==null||typeof e=="string"||typeof t=="string"?e===t:e.dark===t.dark&&e.light===t.light}function fn(e){return{type:"text",value:e}}function Ae({tagName:e,children:t=[],properties:n={}}){return{type:"element",tagName:e,properties:n,children:t}}function fa({name:e,width:t=16,height:n=16,properties:r}){return Ae({tagName:"svg",properties:{width:t,height:n,viewBox:"0 0 16 16",...r},children:[Ae({tagName:"use",properties:{href:`#${e.replace(/^#/,"")}`}})]})}function x2(e){let t=e.children[0];for(;t!=null;){if(t.type==="element"&&t.tagName==="code")return t;"children"in t?t=t.children[0]:t=null}}function Mo(e){return Ae({tagName:"div",children:[Ae({tagName:"div",children:e.annotations?.map(t=>Ae({tagName:"slot",properties:{name:t}})),properties:{"data-annotation-content":""}})],properties:{"data-line-annotation":`${e.hunkIndex},${e.lineIndex}`}})}function k2(e){switch(e){case"file":return"diffs-icon-file-code";case"change":return"diffs-icon-symbol-modified";case"new":return"diffs-icon-symbol-added";case"deleted":return"diffs-icon-symbol-deleted";case"rename-pure":case"rename-changed":return"diffs-icon-symbol-moved"}}function _h({fileOrDiff:e,themeStyles:t,themeType:n}){const r="type"in e?e:void 0,o={"data-diffs-header":"","data-change-type":r?.type,"data-theme-type":n!=="system"?n:void 0,style:t};return Ae({tagName:"div",children:[C2({name:e.name,prevName:"prevName"in e?e.prevName:void 0,iconType:r?.type??"file"}),S2(r)],properties:o})}function C2({name:e,prevName:t,iconType:n}){const r=[fa({name:k2(n),properties:{"data-change-icon":n}})];return t!=null&&(r.push(Ae({tagName:"div",children:[fn(t)],properties:{"data-prev-name":""}})),r.push(fa({name:"diffs-icon-arrow-right-short",properties:{"data-rename-icon":""}}))),r.push(Ae({tagName:"div",children:[fn(e)],properties:{"data-title":""}})),Ae({tagName:"div",children:r,properties:{"data-header-content":""}})}function S2(e){const t=[];if(e!=null){let n=0,r=0;for(const o of e.hunks)n+=o.additionLines,r+=o.deletionLines;(r>0||n===0)&&t.push(Ae({tagName:"span",children:[fn(`-${r}`)],properties:{"data-deletions-count":""}})),(n>0||r===0)&&t.push(Ae({tagName:"span",children:[fn(`+${n}`)],properties:{"data-additions-count":""}}))}return t.push(Ae({tagName:"slot",properties:{name:ol}})),Ae({tagName:"div",children:t,properties:{"data-metadata":""}})}function bh(e){return Ae({tagName:"pre",properties:T2(e)})}function T2({diffIndicators:e,disableBackground:t,disableLineNumbers:n,overflow:r,split:o,themeType:i,themeStyles:s,totalLines:a}){const l={"data-diffs":"","data-type":o?"split":"file","data-overflow":r,"data-disable-line-numbers":n?"":void 0,"data-background":t?void 0:"","data-indicators":e==="bars"||e==="classic"?e:void 0,"data-theme-type":i!=="system"?i:void 0,style:s,tabIndex:0};return l.style+=`--diffs-min-number-column-width-default:${`${a}`.length}ch;`,l}const _r={"1c":"1c",abap:"abap",as:"actionscript-3",ada:"ada",adb:"ada",ads:"ada",adoc:"asciidoc",asciidoc:"asciidoc","component.html":"angular-html","component.ts":"angular-ts",conf:"nginx",htaccess:"apache",cls:"tex",trigger:"apex",apl:"apl",applescript:"applescript",scpt:"applescript",ara:"ara",asm:"asm",s:"riscv",astro:"astro",awk:"awk",bal:"ballerina",sh:"zsh",bash:"zsh",bat:"cmd",cmd:"cmd",be:"berry",beancount:"beancount",bib:"bibtex",bicep:"bicep","blade.php":"blade",bsl:"bsl",c:"c",h:"objective-cpp",cs:"csharp",cpp:"cpp",hpp:"cpp",cc:"cpp",cxx:"cpp",hh:"cpp",cdc:"cdc",cairo:"cairo",clar:"clarity",clj:"clojure",cljs:"clojure",cljc:"clojure",soy:"soy",cmake:"cmake","CMakeLists.txt":"cmake",cob:"cobol",cbl:"cobol",cobol:"cobol",CODEOWNERS:"codeowners",ql:"ql",coffee:"coffeescript",lisp:"lisp",cl:"lisp",lsp:"lisp",log:"log",v:"verilog",cql:"cql",cr:"crystal",css:"css",csv:"csv",cue:"cue",cypher:"cypher",cyp:"cypher",d:"d",dart:"dart",dax:"dax",desktop:"desktop",diff:"diff",patch:"diff",Dockerfile:"dockerfile",dockerfile:"dockerfile",env:"dotenv",dm:"dream-maker",edge:"edge",el:"emacs-lisp",ex:"elixir",exs:"elixir",elm:"elm",erb:"erb",erl:"erlang",hrl:"erlang",f:"fortran-fixed-form",for:"fortran-fixed-form",fs:"fsharp",fsi:"fsharp",fsx:"fsharp",f03:"f03",f08:"f08",f18:"f18",f77:"f77",f90:"fortran-free-form",f95:"fortran-free-form",fnl:"fennel",fish:"fish",ftl:"ftl",tres:"gdresource",res:"gdresource",gd:"gdscript",gdshader:"gdshader",gs:"genie",feature:"gherkin",COMMIT_EDITMSG:"git-commit","git-rebase-todo":"git-rebase",gjs:"glimmer-js",gleam:"gleam",gts:"glimmer-ts",glsl:"glsl",vert:"glsl",frag:"glsl",shader:"shaderlab",gp:"gnuplot",plt:"gnuplot",gnuplot:"gnuplot",go:"go",graphql:"graphql",gql:"graphql",groovy:"groovy",gvy:"groovy",hack:"hack",haml:"haml",hbs:"handlebars",handlebars:"handlebars",hs:"haskell",lhs:"haskell",hx:"haxe",hcl:"hcl",hjson:"hjson",hlsl:"hlsl",fx:"hlsl",html:"html",htm:"html",http:"http",rest:"http",hxml:"hxml",hy:"hy",imba:"imba",ini:"ini",cfg:"ini",jade:"pug",pug:"pug",java:"java",js:"javascript",mjs:"javascript",cjs:"javascript",jinja:"jinja",jinja2:"jinja",j2:"jinja",jison:"jison",jl:"julia",json:"json",json5:"json5",jsonc:"jsonc",jsonl:"jsonl",jsonnet:"jsonnet",libsonnet:"jsonnet",jssm:"jssm",jsx:"jsx",kt:"kotlin",kts:"kts",kql:"kusto",tex:"tex",ltx:"tex",lean:"lean4",less:"less",liquid:"liquid",lit:"lit",ll:"llvm",logo:"logo",lua:"lua",luau:"luau",Makefile:"makefile",mk:"makefile",makefile:"makefile",md:"markdown",markdown:"markdown",marko:"marko",m:"wolfram",mat:"matlab",mdc:"mdc",mdx:"mdx",wiki:"wikitext",mediawiki:"wikitext",mmd:"mermaid",mermaid:"mermaid",mips:"mipsasm",mojo:"mojo","🔥":"mojo",move:"move",nar:"narrat",nf:"nextflow",nim:"nim",nims:"nim",nimble:"nim",nix:"nix",nu:"nushell",mm:"objective-cpp",ml:"ocaml",mli:"ocaml",mll:"ocaml",mly:"ocaml",pas:"pascal",p:"pascal",pl:"prolog",pm:"perl",t:"perl",raku:"raku",p6:"raku",pl6:"raku",php:"php",phtml:"php",pls:"plsql",sql:"sql",po:"po",polar:"polar",pcss:"postcss",pot:"pot",potx:"potx",pq:"powerquery",pqm:"powerquery",ps1:"powershell",psm1:"powershell",psd1:"powershell",prisma:"prisma",pro:"prolog",P:"prolog",properties:"properties",proto:"protobuf",pp:"puppet",purs:"purescript",py:"python",pyw:"python",pyi:"python",qml:"qml",qmldir:"qmldir",qss:"qss",r:"r",R:"r",rkt:"racket",rktl:"racket",razor:"razor",cshtml:"razor",rb:"ruby",rbw:"ruby",reg:"reg",regex:"regexp",rel:"rel",rs:"rust",rst:"rst",rake:"ruby",gemspec:"ruby",sas:"sas",sass:"sass",scala:"scala",sc:"scala",scm:"scheme",ss:"scheme",sld:"scheme",scss:"scss",sdbl:"sdbl",shadergraph:"shader",st:"smalltalk",sol:"solidity",sparql:"sparql",rq:"sparql",spl:"splunk",config:"ssh-config",do:"stata",ado:"stata",dta:"stata",styl:"stylus",stylus:"stylus",svelte:"svelte",swift:"swift",sv:"system-verilog",svh:"system-verilog",service:"systemd",socket:"systemd",device:"systemd",timer:"systemd",talon:"talonscript",tasl:"tasl",tcl:"tcl",templ:"templ",tf:"tf",tfvars:"tfvars",toml:"toml",ts:"typescript",tsp:"typespec",tsv:"tsv",tsx:"tsx",ttl:"turtle",twig:"twig",typ:"typst",vv:"v",vala:"vala",vapi:"vala",vb:"vb",vbs:"vb",bas:"vb",vh:"verilog",vhd:"vhdl",vhdl:"vhdl",vim:"vimscript",vue:"vue","vine.ts":"vue-vine",vy:"vyper",wasm:"wasm",wat:"wasm",wy:"文言",wgsl:"wgsl",wit:"wit",wl:"wolfram",nb:"wolfram",xml:"xml",xsl:"xsl",xslt:"xsl",yaml:"yaml",yml:"yml",zs:"zenscript",zig:"zig",zsh:"zsh",sty:"tex"};function In(e){if(_r[e]!=null)return _r[e];const t=e.match(/\.([^/\\]+\.[^/\\]+)$/);return t!=null&&_r[t[1]]!=null?_r[t[1]]??"text":_r[e.match(/\.([^.]+)$/)?.[1]??""]??"text"}function wh(e,t){return{langs:[e??"text"],themes:sl(t.theme)}}function qr(e){return`annotation-${"side"in e?`${e.side}-`:""}${e.lineNumber}`}function Pn(e){return e.replace(/\n$|\r\n$/,"")}function A2(e,t,n){const r=typeof n.lineInfo=="function"?n.lineInfo(t):n.lineInfo[t];if(r==null)throw console.error({node:e,line:t,state:n}),new Error(`processLine: line ${t}, contains no state.lineInfo`);return e.tagName="span",e.properties["data-column-content"]="",e.children.length===0&&e.children.push(fn(`
179
+ `)),Ae({tagName:"div",children:[Ae({tagName:"span",children:[Ae({tagName:"span",children:[{type:"text",value:`${r.lineNumber}`}],properties:{"data-line-number-content":""}})],properties:{"data-column-number":""}}),e],properties:{"data-line":r.lineNumber,"data-alt-line":r.altLineNumber,"data-line-type":r.type,"data-line-index":r.lineIndex}})}function L2(e={}){const{classPrefix:t="__shiki_",classSuffix:n="",classReplacer:r=a=>a}=e,o=new Map;function i(a){return Object.entries(a).map(([l,u])=>`${l}:${u}`).join(";")}function s(a){const l=typeof a=="string"?a:i(a);let u=t+I2(l)+n;return u=r(u),o.has(u)||o.set(u,typeof a=="string"?a:{...a}),u}return{name:"@shikijs/transformers:style-to-class",pre(a){if(!a.properties.style)return;const l=s(a.properties.style);delete a.properties.style,this.addClassToHast(a,l)},tokens(a){for(const l of a)for(const u of l){if(!u.htmlStyle)continue;const c=s(u.htmlStyle);u.htmlStyle={},u.htmlAttrs||={},u.htmlAttrs.class?u.htmlAttrs.class+=` ${c}`:u.htmlAttrs.class=c}},getClassRegistry(){return o},getCSS(){let a="";for(const[l,u]of o.entries())a+=`.${l}{${typeof u=="string"?u:i(u)}}`;return a},clearRegistry(){o.clear()}}}function I2(e,t=0){let n=3735928559^t,r=1103547991^t;for(let o=0,i;o<e.length;o++)i=e.charCodeAt(o),n=Math.imul(n^i,2654435761),r=Math.imul(r^i,1597334677);return n=Math.imul(n^n>>>16,2246822507),n^=Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507),r^=Math.imul(n^n>>>13,3266489909),(4294967296*(2097151&r)+(n>>>0)).toString(36).slice(0,6)}function Eh(e=!1){const t={lineInfo:{}},n=[{line(r){return delete r.properties.class,r},pre(r){const o=x2(r),i=[];if(o!=null){let s=1;for(const a of o.children)a.type==="element"&&(i.push(A2(a,s,t)),s++);o.children=i}return r}}];return e&&n.push(P2,oc),{state:t,transformers:n,toClass:oc}}const oc=L2({classPrefix:"hl-"}),P2={name:"token-style-normalizer",tokens(e){for(const t of e)for(const n of t){if(n.htmlStyle!=null)continue;const r={};n.color!=null&&(r.color=n.color),n.bgColor!=null&&(r["background-color"]=n.bgColor),n.fontStyle!=null&&n.fontStyle!==0&&((n.fontStyle&1)!==0&&(r["font-style"]="italic"),(n.fontStyle&2)!==0&&(r["font-weight"]="bold"),(n.fontStyle&4)!==0&&(r["text-decoration"]="underline")),Object.keys(r).length>0&&(n.htmlStyle=r)}}};function ut(e){return`--${e==="token"?"diffs-token":"diffs"}-`}function xh({theme:e=it,highlighter:t,prefix:n}){let r="";if(typeof e=="string"){const o=t.getTheme(e);r+=`color:${o.fg};`,r+=`background-color:${o.bg};`,r+=`${ut("global")}fg:${o.fg};`,r+=`${ut("global")}bg:${o.bg};`,r+=gs(o,n)}else{let o=t.getTheme(e.dark);r+=`${ut("global")}dark:${o.fg};`,r+=`${ut("global")}dark-bg:${o.bg};`,r+=gs(o,"dark"),o=t.getTheme(e.light),r+=`${ut("global")}light:${o.fg};`,r+=`${ut("global")}light-bg:${o.bg};`,r+=gs(o,"light")}return r}function gs(e,t){t=t!=null?`${t}-`:"";let n="";const r=e.colors?.["gitDecoration.addedResourceForeground"]??e.colors?.["terminal.ansiGreen"];r!=null&&(n+=`${ut("global")}${t}addition-color:${r};`);const o=e.colors?.["gitDecoration.deletedResourceForeground"]??e.colors?.["terminal.ansiRed"];o!=null&&(n+=`${ut("global")}${t}deletion-color:${o};`);const i=e.colors?.["gitDecoration.modifiedResourceForeground"]??e.colors?.["terminal.ansiBlue"];return i!=null&&(n+=`${ut("global")}${t}modified-color:${i};`),n}function ha(e){let t=e.children[0];for(;t!=null;){if(t.type==="element"&&t.tagName==="code")return t.children;"children"in t?t=t.children[0]:t=null}throw console.error(e),new Error("getLineNodes: Unable to find children")}function N2(e,t,{theme:n=it,tokenizeMaxLineLength:r},o=!1){const{state:i,transformers:s}=Eh(),a=o?"text":e.lang??In(e.name),l=(()=>{if(typeof n=="string")return t.getTheme(n).type})(),u=xh({theme:n,highlighter:t});i.lineInfo=d=>({type:"context",lineIndex:d-1,lineNumber:d});const c=typeof n=="string"?{lang:a,theme:n,transformers:s,defaultColor:!1,cssVariablePrefix:ut("token"),tokenizeMaxLineLength:r}:{lang:a,themes:n,transformers:s,defaultColor:!1,cssVariablePrefix:ut("token"),tokenizeMaxLineLength:r};return{code:ha(t.codeToHast(Pn(e.contents),c)),themeStyles:u,baseThemeType:l}}var R2=class{highlighter;renderCache;computedLang="text";lineAnnotations={};constructor(e={theme:it},t,n){this.options=e,this.onRenderUpdate=t,this.workerManager=n,n?.isWorkingPool()!==!0&&(this.highlighter=Pr(e.theme??it)?vh():void 0)}setOptions(e){this.options=e}mergeOptions(e){this.options={...this.options,...e}}setThemeType(e){(this.options.themeType??"system")!==e&&this.mergeOptions({themeType:e})}setLineAnnotations(e){this.lineAnnotations={};for(const t of e){const n=this.lineAnnotations[t.lineNumber]??[];this.lineAnnotations[t.lineNumber]=n,n.push(t)}}cleanUp(){this.renderCache=void 0,this.highlighter=void 0,this.workerManager=void 0,this.onRenderUpdate=void 0}hydrate(e){const{options:t}=this.getRenderOptions(e);let n=this.workerManager?.getFileResultCache(e);n!=null&&!vs(t,n.options)&&(n=void 0),this.renderCache??={file:e,options:t,highlighted:!0,result:n?.result},this.workerManager?.isWorkingPool()===!0&&this.renderCache.result==null?this.workerManager.highlightFileAST(this,e):this.asyncHighlight(e).then(({result:r,options:o})=>{this.onHighlightSuccess(e,r,o)})}getRenderOptions(e){const t=(()=>{if(this.workerManager?.isWorkingPool()===!0)return this.workerManager.getFileRenderOptions();const{theme:r=it,tokenizeMaxLineLength:o=1e3}=this.options;return{theme:r,tokenizeMaxLineLength:o}})(),{renderCache:n}=this;return n?.result==null?{options:t,forceRender:!0}:e!==n.file||!vs(t,n.options)?{options:t,forceRender:!0}:{options:t,forceRender:!1}}renderFile(e=this.renderCache?.file){if(e==null)return;const t=this.workerManager?.getFileResultCache(e);t!=null&&this.renderCache==null&&(this.renderCache={file:e,highlighted:!0,...t});const{options:n,forceRender:r}=this.getRenderOptions(e);if(this.renderCache??={file:e,highlighted:!1,options:n,result:void 0},this.workerManager?.isWorkingPool()===!0)this.renderCache.result??=this.workerManager.getPlainFileAST(e),(!this.renderCache.highlighted||r)&&this.workerManager.highlightFileAST(this,e);else{this.computedLang=e.lang??In(e.name);const o=this.highlighter!=null&&Pr(n.theme),i=this.highlighter!=null&&hi(this.computedLang);if(this.highlighter!=null&&o&&(r||!this.renderCache.highlighted&&i||this.renderCache.result==null)){const{result:s,options:a}=this.renderFileWithHighlighter(e,this.highlighter,!i);this.renderCache={file:e,options:a,highlighted:i,result:s}}(!o||!i)&&this.asyncHighlight(e).then(({result:s,options:a})=>{this.onHighlightSuccess(e,s,a)})}return this.renderCache.result!=null?this.processFileResult(this.renderCache.file,this.renderCache.result):void 0}async asyncRender(e){const{result:t}=await this.asyncHighlight(e);return this.processFileResult(e,t)}async asyncHighlight(e){this.computedLang=e.lang??In(e.name);const t=this.highlighter!=null&&E2(sl(this.options.theme)),n=this.highlighter!=null&&hi(this.computedLang);return(this.highlighter==null||!t||!n)&&(this.highlighter=await this.initializeHighlighter()),this.renderFileWithHighlighter(e,this.highlighter)}renderFileWithHighlighter(e,t,n=!1){const{options:r}=this.getRenderOptions(e);return{result:N2(e,t,r,n),options:r}}processFileResult(e,t){const{disableFileHeader:n=!1}=this.options,r=[];let o=1;for(const i of t.code){r.push(i);const s=this.lineAnnotations[o];s!=null&&r.push(Mo({hunkIndex:0,lineIndex:o,annotations:s.map(a=>qr(a))})),o++}return{codeAST:r,preAST:this.createPreElement(t.code.length,t.themeStyles,t.baseThemeType),headerAST:n?void 0:this.renderHeader(e,t.themeStyles,t.baseThemeType),totalLines:t.code.length,themeStyles:t.themeStyles,baseThemeType:t.baseThemeType,css:""}}renderHeader(e,t,n){const{themeType:r="system"}=this.options;return _h({fileOrDiff:e,themeStyles:t,themeType:n??r})}renderFullHTML(e){return qt(this.renderFullAST(e))}renderFullAST(e,t=[]){return t.push(Ae({tagName:"code",children:e.codeAST,properties:{"data-code":""}})),{...e.preAST,children:t}}renderPartialHTML(e,t=!1){return qt(t?Ae({tagName:"code",children:e,properties:{"data-code":""}}):e)}async initializeHighlighter(){return this.highlighter=await gh(wh(this.computedLang,this.options)),this.highlighter}onHighlightSuccess(e,t,n){if(this.renderCache==null)return;const r=this.renderCache.file!==e||!this.renderCache.highlighted||!vs(n,this.renderCache.options);this.renderCache={file:e,options:n,highlighted:!0,result:t},r&&this.onRenderUpdate?.()}onHighlightError(e){console.error(e)}createPreElement(e,t,n){const{disableLineNumbers:r=!1,overflow:o="scroll",themeType:i="system"}=this.options;return bh({diffIndicators:"none",disableBackground:!0,disableLineNumbers:r,overflow:o,themeStyles:t,themeType:n??i,split:!1,totalLines:e})}};function vs(e,t){return yh(e.theme,t.theme)&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength}const kh=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
180
+ <symbol id="diffs-icon-arrow-right-short" viewBox="0 0 16 16">
181
+ <path d="M8.47 4.22a.75.75 0 0 0 0 1.06l1.97 1.97H3.75a.75.75 0 0 0 0 1.5h6.69l-1.97 1.97a.75.75 0 1 0 1.06 1.06l3.25-3.25a.75.75 0 0 0 0-1.06L9.53 4.22a.75.75 0 0 0-1.06 0"/>
182
+ </symbol>
183
+ <symbol id="diffs-icon-brand-github" viewBox="0 0 16 16">
184
+ <path d="M8 0c4.42 0 8 3.58 8 8a8.01 8.01 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27s-1.36.09-2 .27c-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8"/>
185
+ </symbol>
186
+ <symbol id="diffs-icon-chevron" viewBox="0 0 16 16">
187
+ <path d="M1.47 4.47a.75.75 0 0 1 1.06 0L8 9.94l5.47-5.47a.75.75 0 1 1 1.06 1.06l-6 6a.75.75 0 0 1-1.06 0l-6-6a.75.75 0 0 1 0-1.06"/>
188
+ </symbol>
189
+ <symbol id="diffs-icon-chevrons-narrow" viewBox="0 0 10 16">
190
+ <path d="M4.47 2.22a.75.75 0 0 1 1.06 0l3.25 3.25a.75.75 0 0 1-1.06 1.06L5 3.81 2.28 6.53a.75.75 0 0 1-1.06-1.06zM1.22 9.47a.75.75 0 0 1 1.06 0L5 12.19l2.72-2.72a.75.75 0 0 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0l-3.25-3.25a.75.75 0 0 1 0-1.06"/>
191
+ </symbol>
192
+ <symbol id="diffs-icon-diff-split" viewBox="0 0 16 16">
193
+ <path d="M14 0H8.5v16H14a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2m-1.5 6.5v1h1a.5.5 0 0 1 0 1h-1v1a.5.5 0 0 1-1 0v-1h-1a.5.5 0 0 1 0-1h1v-1a.5.5 0 0 1 1 0"/><path d="M2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h5.5V0zm.5 7.5h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1 0-1" opacity=".3"/>
194
+ </symbol>
195
+ <symbol id="diffs-icon-diff-unified" viewBox="0 0 16 16">
196
+ <path fill-rule="evenodd" d="M16 14a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V8.5h16zm-8-4a.5.5 0 0 0-.5.5v1h-1a.5.5 0 0 0 0 1h1v1a.5.5 0 0 0 1 0v-1h1a.5.5 0 0 0 0-1h-1v-1A.5.5 0 0 0 8 10" clip-rule="evenodd"/><path fill-rule="evenodd" d="M14 0a2 2 0 0 1 2 2v5.5H0V2a2 2 0 0 1 2-2zM6.5 3.5a.5.5 0 0 0 0 1h3a.5.5 0 0 0 0-1z" clip-rule="evenodd" opacity=".4"/>
197
+ </symbol>
198
+ <symbol id="diffs-icon-expand" viewBox="0 0 16 16">
199
+ <path d="M3.47 5.47a.75.75 0 0 1 1.06 0L8 8.94l3.47-3.47a.75.75 0 1 1 1.06 1.06l-4 4a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 0 1 0-1.06"/>
200
+ </symbol>
201
+ <symbol id="diffs-icon-expand-all" viewBox="0 0 16 16">
202
+ <path d="M11.47 9.47a.75.75 0 1 1 1.06 1.06l-4 4a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 1 1 1.06-1.06L8 12.94zM7.526 1.418a.75.75 0 0 1 1.004.052l4 4a.75.75 0 1 1-1.06 1.06L8 3.06 4.53 6.53a.75.75 0 1 1-1.06-1.06l4-4z"/>
203
+ </symbol>
204
+ <symbol id="diffs-icon-file-code" viewBox="0 0 16 16">
205
+ <path d="M10.75 0c.199 0 .39.08.53.22l3.5 3.5c.14.14.22.331.22.53v9A2.75 2.75 0 0 1 12.25 16h-8.5A2.75 2.75 0 0 1 1 13.25V2.75A2.75 2.75 0 0 1 3.75 0zm-7 1.5c-.69 0-1.25.56-1.25 1.25v10.5c0 .69.56 1.25 1.25 1.25h8.5c.69 0 1.25-.56 1.25-1.25V5h-1.25A2.25 2.25 0 0 1 10 2.75V1.5z"/><path d="M7.248 6.19a.75.75 0 0 1 .063 1.058L5.753 9l1.558 1.752a.75.75 0 0 1-1.122.996l-2-2.25a.75.75 0 0 1 0-.996l2-2.25a.75.75 0 0 1 1.06-.063M8.69 7.248a.75.75 0 1 1 1.12-.996l2 2.25a.75.75 0 0 1 0 .996l-2 2.25a.75.75 0 1 1-1.12-.996L10.245 9z"/>
206
+ </symbol>
207
+ <symbol id="diffs-icon-symbol-added" viewBox="0 0 16 16">
208
+ <path d="M8 4a.75.75 0 0 1 .75.75v2.5h2.5a.75.75 0 0 1 0 1.5h-2.5v2.5a.75.75 0 0 1-1.5 0v-2.5h-2.5a.75.75 0 0 1 0-1.5h2.5v-2.5A.75.75 0 0 1 8 4"/><path d="M1.788 4.296c.196-.88.478-1.381.802-1.706s.826-.606 1.706-.802C5.194 1.588 6.387 1.5 8 1.5s2.806.088 3.704.288c.88.196 1.381.478 1.706.802s.607.826.802 1.706c.2.898.288 2.091.288 3.704s-.088 2.806-.288 3.704c-.195.88-.478 1.381-.802 1.706s-.826.607-1.706.802c-.898.2-2.091.288-3.704.288s-2.806-.088-3.704-.288c-.88-.195-1.381-.478-1.706-.802s-.606-.826-.802-1.706C1.588 10.806 1.5 9.613 1.5 8s.088-2.806.288-3.704M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8"/>
209
+ </symbol>
210
+ <symbol id="diffs-icon-symbol-deleted" viewBox="0 0 16 16">
211
+ <path d="M4 8a.75.75 0 0 1 .75-.75h6.5a.75.75 0 0 1 0 1.5h-6.5A.75.75 0 0 1 4 8"/><path d="M1.788 4.296c.196-.88.478-1.381.802-1.706s.826-.606 1.706-.802C5.194 1.588 6.387 1.5 8 1.5s2.806.088 3.704.288c.88.196 1.381.478 1.706.802s.607.826.802 1.706c.2.898.288 2.091.288 3.704s-.088 2.806-.288 3.704c-.195.88-.478 1.381-.802 1.706s-.826.607-1.706.802c-.898.2-2.091.288-3.704.288s-2.806-.088-3.704-.288c-.88-.195-1.381-.478-1.706-.802s-.606-.826-.802-1.706C1.588 10.806 1.5 9.613 1.5 8s.088-2.806.288-3.704M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8"/>
212
+ </symbol>
213
+ <symbol id="diffs-icon-symbol-diffstat" viewBox="0 0 16 16">
214
+ <path d="M1.788 4.296c.196-.88.478-1.381.802-1.706s.826-.606 1.706-.802C5.194 1.588 6.387 1.5 8 1.5s2.806.088 3.704.288c.88.196 1.381.478 1.706.802s.607.826.802 1.706c.2.898.288 2.091.288 3.704s-.088 2.806-.288 3.704c-.195.88-.478 1.381-.802 1.706s-.826.607-1.706.802c-.898.2-2.091.288-3.704.288s-2.806-.088-3.704-.288c-.88-.195-1.381-.478-1.706-.802s-.606-.826-.802-1.706C1.588 10.806 1.5 9.613 1.5 8s.088-2.806.288-3.704M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8"/><path d="M8.75 4.296a.75.75 0 0 0-1.5 0V6.25h-2a.75.75 0 0 0 0 1.5h2v1.5h1.5v-1.5h2a.75.75 0 0 0 0-1.5h-2zM5.25 10a.75.75 0 0 0 0 1.5h5.5a.75.75 0 0 0 0-1.5z"/>
215
+ </symbol>
216
+ <symbol id="diffs-icon-symbol-ignored" viewBox="0 0 16 16">
217
+ <path d="M1.5 8c0 1.613.088 2.806.288 3.704.196.88.478 1.381.802 1.706s.826.607 1.706.802c.898.2 2.091.288 3.704.288s2.806-.088 3.704-.288c.88-.195 1.381-.478 1.706-.802s.607-.826.802-1.706c.2-.898.288-2.091.288-3.704s-.088-2.806-.288-3.704c-.195-.88-.478-1.381-.802-1.706s-.826-.606-1.706-.802C10.806 1.588 9.613 1.5 8 1.5s-2.806.088-3.704.288c-.88.196-1.381.478-1.706.802s-.606.826-.802 1.706C1.588 5.194 1.5 6.387 1.5 8M0 8c0-6.588 1.412-8 8-8s8 1.412 8 8-1.412 8-8 8-8-1.412-8-8m11.53-2.47a.75.75 0 0 0-1.06-1.06l-6 6a.75.75 0 1 0 1.06 1.06z"/>
218
+ </symbol>
219
+ <symbol id="diffs-icon-symbol-modified" viewBox="0 0 16 16">
220
+ <path d="M1.5 8c0 1.613.088 2.806.288 3.704.196.88.478 1.381.802 1.706s.826.607 1.706.802c.898.2 2.091.288 3.704.288s2.806-.088 3.704-.288c.88-.195 1.381-.478 1.706-.802s.607-.826.802-1.706c.2-.898.288-2.091.288-3.704s-.088-2.806-.288-3.704c-.195-.88-.478-1.381-.802-1.706s-.826-.606-1.706-.802C10.806 1.588 9.613 1.5 8 1.5s-2.806.088-3.704.288c-.88.196-1.381.478-1.706.802s-.606.826-.802 1.706C1.588 5.194 1.5 6.387 1.5 8M0 8c0-6.588 1.412-8 8-8s8 1.412 8 8-1.412 8-8 8-8-1.412-8-8m8 3a3 3 0 1 0 0-6 3 3 0 0 0 0 6"/>
221
+ </symbol>
222
+ <symbol id="diffs-icon-symbol-moved" viewBox="0 0 16 16">
223
+ <path d="M1.788 4.296c.196-.88.478-1.381.802-1.706s.826-.606 1.706-.802C5.194 1.588 6.387 1.5 8 1.5s2.806.088 3.704.288c.88.196 1.381.478 1.706.802s.607.826.802 1.706c.2.898.288 2.091.288 3.704s-.088 2.806-.288 3.704c-.195.88-.478 1.381-.802 1.706s-.826.607-1.706.802c-.898.2-2.091.288-3.704.288s-2.806-.088-3.704-.288c-.88-.195-1.381-.478-1.706-.802s-.606-.826-.802-1.706C1.588 10.806 1.5 9.613 1.5 8s.088-2.806.288-3.704M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8"/><path d="M8.495 4.695a.75.75 0 0 0-.05 1.06L10.486 8l-2.041 2.246a.75.75 0 0 0 1.11 1.008l2.5-2.75a.75.75 0 0 0 0-1.008l-2.5-2.75a.75.75 0 0 0-1.06-.051m-4 0a.75.75 0 0 0-.05 1.06l2.044 2.248-1.796 1.995a.75.75 0 0 0 1.114 1.004l2.25-2.5a.75.75 0 0 0-.002-1.007l-2.5-2.75a.75.75 0 0 0-1.06-.05"/>
224
+ </symbol>
225
+ <symbol id="diffs-icon-symbol-ref" viewBox="0 0 16 16">
226
+ <path d="M1.5 8c0 1.613.088 2.806.288 3.704.196.88.478 1.381.802 1.706.286.286.71.54 1.41.73V1.86c-.7.19-1.124.444-1.41.73-.324.325-.606.826-.802 1.706C1.588 5.194 1.5 6.387 1.5 8m4 6.397c.697.07 1.522.103 2.5.103 1.613 0 2.806-.088 3.704-.288.88-.195 1.381-.478 1.706-.802s.607-.826.802-1.706c.2-.898.288-2.091.288-3.704s-.088-2.806-.288-3.704c-.195-.88-.478-1.381-.802-1.706s-.826-.606-1.706-.802C10.806 1.588 9.613 1.5 8 1.5c-.978 0-1.803.033-2.5.103zM0 8c0-6.588 1.412-8 8-8s8 1.412 8 8-1.412 8-8 8-8-1.412-8-8m7-2a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1z"/>
227
+ </symbol>
228
+ </svg>`;function pa(e,t){return e?.cacheKey===t?.cacheKey&&e?.contents===t?.contents&&e?.name===t?.name&&e?.lang===t?.lang}function Ch(e){const t=document.createElement("div");return t.dataset.annotationSlot="",t.slot=e,t.style.whiteSpace="normal",t}function Oo({pre:e,columnType:t}={}){const n=document.createElement("code");return n.dataset.code="",t!=null&&(n.dataset[t]=""),e?.appendChild(n),n}function Sh(){const e=document.createElement("div");return e.slot="hover-slot",e.style.position="absolute",e.style.top="0",e.style.bottom="0",e.style.textAlign="center",e.style.whiteSpace="normal",e}function Th(){const e=document.createElement("style");return e.setAttribute(il,""),e}var M2=`@layer base, theme, unsafe;
229
+
230
+ @layer base {
231
+ :host {
232
+ --diffs-bg: #fff;
233
+ --diffs-fg: #000;
234
+ --diffs-font-fallback:
235
+ 'SF Mono', Monaco, Consolas, 'Ubuntu Mono', 'Liberation Mono',
236
+ 'Courier New', monospace;
237
+ --diffs-header-font-fallback:
238
+ system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue',
239
+ 'Noto Sans', 'Liberation Sans', Arial, sans-serif;
240
+
241
+ --diffs-mixer: light-dark(black, white);
242
+ --diffs-gap-fallback: 8px;
243
+
244
+ /*
245
+ // Available CSS Color Overrides
246
+ --diffs-bg-buffer-override
247
+ --diffs-bg-hover-override
248
+ --diffs-bg-context-override
249
+ --diffs-bg-separator-override
250
+
251
+ --diffs-fg-number-override
252
+ --diffs-fg-number-addition-override
253
+ --diffs-fg-number-deletion-override
254
+
255
+ --diffs-deletion-color-override
256
+ --diffs-addition-color-override
257
+ --diffs-modified-color-override
258
+
259
+ --diffs-bg-deletion-override
260
+ --diffs-bg-deletion-number-override
261
+ --diffs-bg-deletion-hover-override
262
+ --diffs-bg-deletion-emphasis-override
263
+
264
+ --diffs-bg-addition-override
265
+ --diffs-bg-addition-number-override
266
+ --diffs-bg-addition-hover-override
267
+ --diffs-bg-addition-emphasis-override
268
+
269
+ // Line Selection Color Overrides (for enableLineSelection)
270
+ --diffs-selection-color-override
271
+ --diffs-bg-selection-override
272
+ --diffs-bg-selection-number-override
273
+ --diffs-bg-selection-background-override
274
+ --diffs-bg-selection-number-background-override
275
+
276
+ // Available CSS Layout Overrides
277
+ --diffs-gap-inline
278
+ --diffs-gap-block
279
+ --diffs-gap-style
280
+ --diffs-tab-size
281
+ */
282
+
283
+ color-scheme: light dark;
284
+ display: block;
285
+ font-family: var(
286
+ --diffs-header-font-family,
287
+ var(--diffs-header-font-fallback)
288
+ );
289
+ font-size: var(--diffs-font-size, 13px);
290
+ line-height: var(--diffs-line-height, 20px);
291
+ font-feature-settings: var(--diffs-font-features);
292
+ }
293
+
294
+ /* NOTE(mdo): Some semantic HTML elements (e.g. \`pre\`, \`code\`) have default
295
+ * user-agent styles. These must be overridden to use our custom styles. */
296
+ pre,
297
+ code,
298
+ [data-error-wrapper] {
299
+ margin: 0;
300
+ padding: 0;
301
+ display: block;
302
+ outline: none;
303
+ font-family: var(--diffs-font-family, var(--diffs-font-fallback));
304
+ }
305
+
306
+ *,
307
+ *::before,
308
+ *::after {
309
+ box-sizing: border-box;
310
+ }
311
+
312
+ [data-icon-sprite] {
313
+ display: none;
314
+ }
315
+
316
+ /* NOTE(mdo): Headers and separators are within pre/code, so we need to reset
317
+ * their font-family explicitly. */
318
+ [data-diffs-header],
319
+ [data-separator] {
320
+ font-family: var(
321
+ --diffs-header-font-family,
322
+ var(--diffs-header-font-fallback)
323
+ );
324
+ }
325
+
326
+ [data-file-info] {
327
+ padding: 10px;
328
+ font-weight: 700;
329
+ color: var(--fg);
330
+ /* NOTE(amadeus): we cannot use 'in oklch' because current versions of cursor
331
+ * and vscode use an older build of chrome that appears to have a bug with
332
+ * color-mix and 'in oklch', so use 'in lab' instead */
333
+ background-color: color-mix(in lab, var(--bg) 98%, var(--fg));
334
+ border-block: 1px solid color-mix(in lab, var(--bg) 95%, var(--fg));
335
+ }
336
+
337
+ [data-diffs-header],
338
+ [data-diffs],
339
+ [data-error-wrapper] {
340
+ --diffs-bg: light-dark(var(--diffs-light-bg), var(--diffs-dark-bg));
341
+ /* NOTE(amadeus): we cannot use 'in oklch' because current versions of cursor
342
+ * and vscode use an older build of chrome that appears to have a bug with
343
+ * color-mix and 'in oklch', so use 'in lab' instead */
344
+ --diffs-bg-buffer: var(
345
+ --diffs-bg-buffer-override,
346
+ light-dark(
347
+ color-mix(in lab, var(--diffs-bg) 92%, var(--diffs-mixer)),
348
+ color-mix(in lab, var(--diffs-bg) 92%, var(--diffs-mixer))
349
+ )
350
+ );
351
+ --diffs-bg-hover: var(
352
+ --diffs-bg-hover-override,
353
+ light-dark(
354
+ color-mix(in lab, var(--diffs-bg) 97%, var(--diffs-mixer)),
355
+ color-mix(in lab, var(--diffs-bg) 91%, var(--diffs-mixer))
356
+ )
357
+ );
358
+ --diffs-bg-context: var(
359
+ --diffs-bg-context-override,
360
+ light-dark(
361
+ color-mix(in lab, var(--diffs-bg) 98.5%, var(--diffs-mixer)),
362
+ color-mix(in lab, var(--diffs-bg) 92.5%, var(--diffs-mixer))
363
+ )
364
+ );
365
+ --diffs-bg-separator: var(
366
+ --diffs-bg-separator-override,
367
+ light-dark(
368
+ color-mix(in lab, var(--diffs-bg) 96%, var(--diffs-mixer)),
369
+ color-mix(in lab, var(--diffs-bg) 85%, var(--diffs-mixer))
370
+ )
371
+ );
372
+
373
+ --diffs-fg: light-dark(var(--diffs-light), var(--diffs-dark));
374
+ --diffs-fg-number: var(
375
+ --diffs-fg-number-override,
376
+ light-dark(
377
+ color-mix(in lab, var(--diffs-fg) 65%, var(--diffs-bg)),
378
+ color-mix(in lab, var(--diffs-fg) 65%, var(--diffs-bg))
379
+ )
380
+ );
381
+
382
+ --diffs-deletion-base: var(
383
+ --diffs-deletion-color-override,
384
+ light-dark(
385
+ var(
386
+ --diffs-light-deletion-color,
387
+ var(--diffs-deletion-color, rgb(255, 0, 0))
388
+ ),
389
+ var(
390
+ --diffs-dark-deletion-color,
391
+ var(--diffs-deletion-color, rgb(255, 0, 0))
392
+ )
393
+ )
394
+ );
395
+ --diffs-addition-base: var(
396
+ --diffs-addition-color-override,
397
+ light-dark(
398
+ var(
399
+ --diffs-light-addition-color,
400
+ var(--diffs-addition-color, rgb(0, 255, 0))
401
+ ),
402
+ var(
403
+ --diffs-dark-addition-color,
404
+ var(--diffs-addition-color, rgb(0, 255, 0))
405
+ )
406
+ )
407
+ );
408
+ --diffs-modified-base: var(
409
+ --diffs-modified-color-override,
410
+ light-dark(
411
+ var(
412
+ --diffs-light-modified-color,
413
+ var(--diffs-modified-color, rgb(0, 0, 255))
414
+ ),
415
+ var(
416
+ --diffs-dark-modified-color,
417
+ var(--diffs-modified-color, rgb(0, 0, 255))
418
+ )
419
+ )
420
+ );
421
+
422
+ /* NOTE(amadeus): we cannot use 'in oklch' because current versions of cursor
423
+ * and vscode use an older build of chrome that appears to have a bug with
424
+ * color-mix and 'in oklch', so use 'in lab' instead */
425
+ --diffs-bg-deletion: var(
426
+ --diffs-bg-deletion-override,
427
+ light-dark(
428
+ color-mix(in lab, var(--diffs-bg) 88%, var(--diffs-deletion-base)),
429
+ color-mix(in lab, var(--diffs-bg) 80%, var(--diffs-deletion-base))
430
+ )
431
+ );
432
+ --diffs-bg-deletion-number: var(
433
+ --diffs-bg-deletion-number-override,
434
+ light-dark(
435
+ color-mix(in lab, var(--diffs-bg) 91%, var(--diffs-deletion-base)),
436
+ color-mix(in lab, var(--diffs-bg) 85%, var(--diffs-deletion-base))
437
+ )
438
+ );
439
+ --diffs-bg-deletion-hover: var(
440
+ --diffs-bg-deletion-hover-override,
441
+ light-dark(
442
+ color-mix(in lab, var(--diffs-bg) 80%, var(--diffs-deletion-base)),
443
+ color-mix(in lab, var(--diffs-bg) 75%, var(--diffs-deletion-base))
444
+ )
445
+ );
446
+ --diffs-bg-deletion-emphasis: var(
447
+ --diffs-bg-deletion-emphasis-override,
448
+ light-dark(
449
+ rgb(from var(--diffs-deletion-base) r g b / 0.15),
450
+ rgb(from var(--diffs-deletion-base) r g b / 0.2)
451
+ )
452
+ );
453
+
454
+ --diffs-bg-addition: var(
455
+ --diffs-bg-addition-override,
456
+ light-dark(
457
+ color-mix(in lab, var(--diffs-bg) 88%, var(--diffs-addition-base)),
458
+ color-mix(in lab, var(--diffs-bg) 80%, var(--diffs-addition-base))
459
+ )
460
+ );
461
+ --diffs-bg-addition-number: var(
462
+ --diffs-bg-addition-number-override,
463
+ light-dark(
464
+ color-mix(in lab, var(--diffs-bg) 91%, var(--diffs-addition-base)),
465
+ color-mix(in lab, var(--diffs-bg) 85%, var(--diffs-addition-base))
466
+ )
467
+ );
468
+ --diffs-bg-addition-hover: var(
469
+ --diffs-bg-addition-hover-override,
470
+ light-dark(
471
+ color-mix(in lab, var(--diffs-bg) 80%, var(--diffs-addition-base)),
472
+ color-mix(in lab, var(--diffs-bg) 70%, var(--diffs-addition-base))
473
+ )
474
+ );
475
+ --diffs-bg-addition-emphasis: var(
476
+ --diffs-bg-addition-emphasis-override,
477
+ light-dark(
478
+ rgb(from var(--diffs-addition-base) r g b / 0.15),
479
+ rgb(from var(--diffs-addition-base) r g b / 0.2)
480
+ )
481
+ );
482
+
483
+ --diffs-selection-base: var(--diffs-modified-base);
484
+ --diffs-selection-number-fg: light-dark(
485
+ color-mix(in lab, var(--diffs-selection-base) 65%, var(--diffs-mixer)),
486
+ color-mix(in lab, var(--diffs-selection-base) 75%, var(--diffs-mixer))
487
+ );
488
+ --diffs-bg-selection: var(
489
+ --diffs-bg-selection-override,
490
+ light-dark(
491
+ color-mix(in lab, var(--diffs-bg) 82%, var(--diffs-selection-base)),
492
+ color-mix(in lab, var(--diffs-bg) 75%, var(--diffs-selection-base))
493
+ )
494
+ );
495
+ --diffs-bg-selection-number: var(
496
+ --diffs-bg-selection-number-override,
497
+ light-dark(
498
+ color-mix(in lab, var(--diffs-bg) 75%, var(--diffs-selection-base)),
499
+ color-mix(in lab, var(--diffs-bg) 60%, var(--diffs-selection-base))
500
+ )
501
+ );
502
+
503
+ background-color: var(--diffs-bg);
504
+ color: var(--diffs-fg);
505
+ }
506
+
507
+ [data-diffs] {
508
+ --diffs-code-grid: minmax(min-content, max-content) 1fr;
509
+
510
+ [data-column-content] span {
511
+ color: light-dark(
512
+ var(--diffs-token-light, var(--diffs-light)),
513
+ var(--diffs-token-dark, var(--diffs-dark))
514
+ );
515
+ font-weight: var(--diffs-token-light-font-weight, inherit);
516
+ font-style: var(--diffs-token-light-font-style, inherit);
517
+ -webkit-text-decoration: var(--diffs-token-light-text-decoration, inherit);
518
+ text-decoration: var(--diffs-token-light-text-decoration, inherit);
519
+ }
520
+ }
521
+
522
+ /* Since span is a pretty innocuous selector, we need to make sure we don't
523
+ * apply tokenized BG colors to diff-spans */
524
+ [data-column-content] span:not([data-diff-span]) {
525
+ background-color: light-dark(
526
+ var(--diffs-token-light-bg, inherit),
527
+ var(--diffs-token-dark-bg, inherit)
528
+ );
529
+ }
530
+
531
+ [data-column-content] {
532
+ background-color: var(--diffs-line-bg, 'transparent');
533
+ grid-column: 2 / 3;
534
+ }
535
+
536
+ [data-diffs][data-dehydrated] {
537
+ --diffs-code-grid: minmax(min-content, max-content) minmax(0, 1fr);
538
+ }
539
+
540
+ @media (prefers-color-scheme: dark) {
541
+ [data-diffs-header],
542
+ [data-diffs] {
543
+ color-scheme: dark;
544
+ }
545
+
546
+ [data-diffs] [data-column-content] span {
547
+ font-weight: var(--diffs-token-dark-font-weight, inherit);
548
+ font-style: var(--diffs-token-dark-font-style, inherit);
549
+ -webkit-text-decoration: var(--diffs-token-dark-text-decoration, inherit);
550
+ text-decoration: var(--diffs-token-dark-text-decoration, inherit);
551
+ }
552
+ }
553
+
554
+ [data-diffs-header][data-theme-type='light'],
555
+ [data-diffs][data-theme-type='light'] {
556
+ color-scheme: light;
557
+ }
558
+
559
+ [data-diffs][data-theme-type='light'] [data-column-content] span {
560
+ font-weight: var(--diffs-token-light-font-weight, inherit);
561
+ font-style: var(--diffs-token-light-font-style, inherit);
562
+ -webkit-text-decoration: var(--diffs-token-light-text-decoration, inherit);
563
+ text-decoration: var(--diffs-token-light-text-decoration, inherit);
564
+ }
565
+
566
+ [data-diffs-header][data-theme-type='dark'],
567
+ [data-diffs][data-theme-type='dark'] {
568
+ color-scheme: dark;
569
+ }
570
+
571
+ [data-diffs][data-theme-type='dark'] [data-column-content] span {
572
+ font-weight: var(--diffs-token-dark-font-weight, inherit);
573
+ font-style: var(--diffs-token-dark-font-style, inherit);
574
+ -webkit-text-decoration: var(--diffs-token-dark-text-decoration, inherit);
575
+ text-decoration: var(--diffs-token-dark-text-decoration, inherit);
576
+ }
577
+
578
+ [data-type='split'][data-overflow='wrap'] {
579
+ display: grid;
580
+ grid-auto-flow: dense;
581
+ grid-template-columns: repeat(2, var(--diffs-code-grid));
582
+ }
583
+
584
+ [data-type='split'][data-overflow='scroll'] {
585
+ display: grid;
586
+ grid-template-columns: 1fr 1fr;
587
+ gap: 2px;
588
+ }
589
+
590
+ [data-code] {
591
+ display: block;
592
+ display: grid;
593
+ grid-auto-flow: dense;
594
+ grid-template-columns: var(--diffs-code-grid);
595
+ overflow: scroll clip;
596
+ overscroll-behavior-x: none;
597
+ tab-size: var(--diffs-tab-size, 2);
598
+ align-self: flex-start;
599
+ padding-top: var(--diffs-gap-block, var(--diffs-gap-fallback));
600
+ padding-bottom: max(
601
+ 0px,
602
+ calc(var(--diffs-gap-block, var(--diffs-gap-fallback)) - 6px)
603
+ );
604
+ }
605
+
606
+ [data-code]::-webkit-scrollbar {
607
+ width: 0;
608
+ height: 6px;
609
+ }
610
+
611
+ [data-code]::-webkit-scrollbar-track {
612
+ background: transparent;
613
+ }
614
+
615
+ [data-code]::-webkit-scrollbar-thumb {
616
+ background-color: transparent;
617
+ border: 1px solid transparent;
618
+ background-clip: content-box;
619
+ border-radius: 3px;
620
+ }
621
+
622
+ [data-diffs]:hover [data-code]::-webkit-scrollbar-thumb {
623
+ background-color: var(--diffs-bg-context);
624
+ }
625
+
626
+ [data-code]::-webkit-scrollbar-corner {
627
+ background-color: transparent;
628
+ }
629
+
630
+ /*
631
+ * If we apply these rules globally it will mean that webkit will opt into the
632
+ * standards compliant version of custom css scrollbars, which we do not want
633
+ * because the custom stuff will look better
634
+ */
635
+ @supports (-moz-appearance: none) {
636
+ [data-code] {
637
+ scrollbar-width: thin;
638
+ scrollbar-color: var(--diffs-bg-context) transparent;
639
+ padding-bottom: var(--diffs-gap-block, var(--diffs-gap-fallback));
640
+ }
641
+ }
642
+
643
+ [data-diffs][data-type='split'][data-overflow='wrap'] {
644
+ padding-block: var(--diffs-gap-block, var(--diffs-gap-fallback));
645
+ }
646
+
647
+ [data-diffs-header] ~ [data-diffs] [data-code],
648
+ [data-diffs-header] ~ [data-diffs][data-overflow='wrap'] {
649
+ padding-top: 0;
650
+ }
651
+
652
+ [data-type='split'][data-overflow='wrap'] [data-code] {
653
+ display: contents;
654
+ }
655
+
656
+ [data-line-annotation],
657
+ [data-no-newline],
658
+ [data-line] {
659
+ position: relative;
660
+ display: grid;
661
+ grid-template-columns: subgrid;
662
+ grid-column: 1 / 3;
663
+ }
664
+
665
+ [data-line-annotation][data-selected-line] {
666
+ background-color: unset;
667
+
668
+ &::before {
669
+ content: '';
670
+ position: sticky;
671
+ top: 0;
672
+ left: 0;
673
+ display: block;
674
+ border-right: var(--diffs-gap-style, 1px solid var(--diffs-bg));
675
+ background-color: var(--diffs-bg-selection-number);
676
+ }
677
+
678
+ [data-annotation-content] {
679
+ background-color: var(--diffs-bg-selection);
680
+ }
681
+ }
682
+
683
+ [data-interactive-lines] [data-line] {
684
+ cursor: pointer;
685
+ }
686
+
687
+ [data-buffer] {
688
+ position: sticky;
689
+ left: 0;
690
+ grid-column: 1 / 3;
691
+ -webkit-user-select: none;
692
+ user-select: none;
693
+ /* We multiply by 1.414 (√2) to better approximate the diagonal repeat distance */
694
+ background-image: repeating-linear-gradient(
695
+ -45deg,
696
+ transparent,
697
+ transparent calc(3px * 1.414),
698
+ var(--diffs-bg-buffer) calc(3px * 1.414),
699
+ var(--diffs-bg-buffer) calc(4px * 1.414)
700
+ );
701
+ min-height: 1lh;
702
+ width: var(--diffs-column-width, auto);
703
+ }
704
+
705
+ [data-separator] {
706
+ grid-column: span 2;
707
+ }
708
+
709
+ [data-separator='metadata'],
710
+ [data-separator]:empty {
711
+ min-height: 4px;
712
+ background-color: var(--diffs-bg-separator);
713
+ display: grid;
714
+ grid-template-columns: subgrid;
715
+ }
716
+
717
+ [data-separator-wrapper] {
718
+ -webkit-user-select: none;
719
+ user-select: none;
720
+ fill: currentColor;
721
+ overflow: hidden;
722
+ }
723
+
724
+ [data-separator='metadata'] [data-separator-wrapper] {
725
+ grid-column: 2 / 3;
726
+ width: var(--diffs-column-content-width);
727
+ position: sticky;
728
+ left: var(--diffs-column-number-width);
729
+ padding: 4px 1ch;
730
+ }
731
+
732
+ [data-separator='line-info'] {
733
+ margin-block: var(--diffs-gap-block, var(--diffs-gap-fallback));
734
+ }
735
+
736
+ [data-separator='line-info'][data-separator-first] {
737
+ margin-top: 0;
738
+ }
739
+
740
+ [data-separator='line-info'][data-separator-last] {
741
+ margin-bottom: 0;
742
+ }
743
+
744
+ [data-separator='line-info'] [data-separator-wrapper] {
745
+ position: sticky;
746
+ display: flex;
747
+ align-items: center;
748
+ gap: 2px;
749
+ width: auto;
750
+ width: calc(var(--diffs-column-width) - var(--diffs-gap-fallback));
751
+ border-radius: 6px;
752
+ }
753
+
754
+ @media (pointer: fine) {
755
+ [data-separator-wrapper][data-separator-multi-button] {
756
+ display: grid;
757
+ grid-template-columns: auto minmax(0, 1fr);
758
+ grid-template-rows: 15px 15px;
759
+
760
+ [data-expand-button] {
761
+ height: 15px;
762
+ }
763
+ }
764
+
765
+ [data-type='split']
766
+ [data-additions]
767
+ [data-separator-wrapper][data-separator-multi-button] {
768
+ grid-template-columns: minmax(0, 1fr) auto;
769
+ }
770
+
771
+ [data-type='split'] [data-additions] [data-expand-button] {
772
+ grid-column: 2;
773
+ }
774
+
775
+ [data-type='split'] [data-additions] [data-separator-content] {
776
+ grid-column: 1;
777
+ }
778
+ }
779
+
780
+ [data-expand-button],
781
+ [data-separator-content] {
782
+ display: flex;
783
+ align-items: center;
784
+ background-color: var(--diffs-bg-separator);
785
+ }
786
+
787
+ [data-expand-button] {
788
+ justify-content: center;
789
+ flex-shrink: 0;
790
+ cursor: pointer;
791
+ width: 32px;
792
+ height: 32px;
793
+ opacity: 0.65;
794
+ }
795
+
796
+ [data-hover-slot] {
797
+ position: absolute;
798
+ top: 0;
799
+ bottom: 0;
800
+ right: 0;
801
+ display: flex;
802
+ justify-content: flex-end;
803
+ }
804
+
805
+ @media (pointer: fine) {
806
+ [data-expand-button]:hover {
807
+ opacity: 1;
808
+ }
809
+
810
+ [data-line]:hover {
811
+ z-index: 2;
812
+ }
813
+ }
814
+
815
+ [data-expand-down] [data-icon] {
816
+ transform: scaleY(-1);
817
+ }
818
+
819
+ [data-separator-content] {
820
+ flex: 1 1 auto;
821
+ padding: 0 1ch;
822
+ height: 32px;
823
+ opacity: 0.65;
824
+ overflow: hidden;
825
+ justify-content: flex-start;
826
+
827
+ grid-column: 2;
828
+ grid-row: 1 / -1;
829
+ }
830
+
831
+ [data-unmodified-lines] {
832
+ display: block;
833
+ overflow: hidden;
834
+ min-width: 0;
835
+ text-overflow: ellipsis;
836
+ white-space: nowrap;
837
+ flex: 0 1 auto;
838
+ }
839
+
840
+ [data-type='split'] [data-additions] [data-separator-content] {
841
+ justify-content: flex-end;
842
+ }
843
+
844
+ [data-type='file']
845
+ [data-code]
846
+ [data-separator='line-info']
847
+ [data-separator-wrapper] {
848
+ left: var(--diffs-gap-inline, var(--diffs-gap-fallback));
849
+ margin-left: var(--diffs-gap-inline, var(--diffs-gap-fallback));
850
+ margin-right: var(--diffs-gap-inline, var(--diffs-gap-fallback));
851
+ width: calc(
852
+ var(--diffs-column-width) -
853
+ (var(--diffs-gap-inline, var(--diffs-gap-fallback)) * 2)
854
+ );
855
+ }
856
+
857
+ [data-type='split']
858
+ [data-deletions]
859
+ [data-separator='line-info']
860
+ [data-separator-wrapper] {
861
+ left: var(--diffs-gap-fallback);
862
+ margin-left: var(--diffs-gap-fallback);
863
+ border-top-right-radius: 0;
864
+ border-bottom-right-radius: 0;
865
+ }
866
+
867
+ [data-type='split']
868
+ [data-additions]
869
+ [data-separator='line-info']
870
+ [data-separator-wrapper] {
871
+ left: 0;
872
+ margin-right: var(--diffs-gap-inline, var(--diffs-gap-fallback));
873
+ border-top-left-radius: 0;
874
+ border-bottom-left-radius: 0;
875
+ flex-direction: row-reverse;
876
+ }
877
+
878
+ [data-line] {
879
+ background-color: var(--diffs-bg);
880
+ color: var(--diffs-fg);
881
+ }
882
+
883
+ [data-type='split'][data-overflow='wrap'] [data-deletions] {
884
+ [data-line-annotation],
885
+ [data-buffer],
886
+ [data-line],
887
+ [data-separator] {
888
+ grid-column: 1 / 3;
889
+ }
890
+ }
891
+
892
+ [data-line-annotation] {
893
+ min-height: var(--diffs-annotation-min-height, 0);
894
+ background-color: var(--diffs-bg-context);
895
+ z-index: 3;
896
+ }
897
+
898
+ [data-type='split'][data-overflow='wrap'] [data-additions] {
899
+ [data-line-annotation],
900
+ [data-buffer],
901
+ [data-line],
902
+ [data-separator] {
903
+ margin-left: 2px;
904
+ grid-column: 3 / 5;
905
+ }
906
+ }
907
+
908
+ [data-separator='custom'] {
909
+ display: grid;
910
+ grid-template-columns: subgrid;
911
+ }
912
+
913
+ [data-column-content],
914
+ [data-column-number] {
915
+ position: relative;
916
+ padding-inline: 1ch;
917
+ }
918
+
919
+ [data-indicators='classic'] [data-column-content] {
920
+ padding-inline-start: 2ch;
921
+ }
922
+
923
+ [data-indicators='classic'] {
924
+ [data-line-type='change-addition'] [data-column-content]::before,
925
+ [data-line-type='change-deletion'] [data-column-content]::before {
926
+ display: inline-block;
927
+ width: 1ch;
928
+ height: 1lh;
929
+ position: absolute;
930
+ top: 0;
931
+ left: 0;
932
+ -webkit-user-select: none;
933
+ user-select: none;
934
+ }
935
+
936
+ [data-line-type='change-addition'] [data-column-content]::before {
937
+ content: '+';
938
+ color: var(--diffs-addition-base);
939
+ }
940
+
941
+ [data-line-type='change-deletion'] [data-column-content]::before {
942
+ content: '-';
943
+ color: var(--diffs-deletion-base);
944
+ }
945
+ }
946
+
947
+ [data-indicators='bars'] {
948
+ [data-line-type='change-deletion'] [data-column-number]::before,
949
+ [data-line-type='change-addition'] [data-column-number]::before {
950
+ content: '';
951
+ display: block;
952
+ width: 4px;
953
+ height: 100%;
954
+ position: absolute;
955
+ top: 0;
956
+ left: 0;
957
+ -webkit-user-select: none;
958
+ user-select: none;
959
+ }
960
+
961
+ [data-line-type='change-deletion'] [data-column-number]::before {
962
+ background-image: linear-gradient(
963
+ 0deg,
964
+ var(--diffs-bg-deletion) 50%,
965
+ var(--diffs-deletion-base) 50%
966
+ );
967
+ background-repeat: repeat;
968
+ background-size: 2px 2px;
969
+ background-size: calc(1lh / round(1lh / 2px)) calc(1lh / round(1lh / 2px));
970
+ }
971
+
972
+ [data-line-type='change-addition'] [data-column-number]::before {
973
+ background-color: var(--diffs-addition-base);
974
+ }
975
+ }
976
+
977
+ [data-overflow='wrap'] [data-column-content],
978
+ [data-overflow='wrap'] [data-annotation-content] {
979
+ white-space: pre-wrap;
980
+ word-break: break-word;
981
+ }
982
+
983
+ [data-overflow='scroll'] [data-column-content] {
984
+ white-space: pre;
985
+ min-height: 1lh;
986
+ }
987
+
988
+ [data-column-number] {
989
+ grid-column: 1 / 2;
990
+ box-sizing: content-box;
991
+ text-align: right;
992
+ position: sticky;
993
+ left: 0;
994
+ -webkit-user-select: none;
995
+ user-select: none;
996
+ background-color: var(--diffs-bg);
997
+ color: var(--diffs-fg-number);
998
+ z-index: 1;
999
+ min-width: var(
1000
+ --diffs-min-number-column-width,
1001
+ var(--diffs-min-number-column-width-default, 3ch)
1002
+ );
1003
+ padding-left: 2ch;
1004
+ border-right: var(--diffs-gap-style, 1px solid var(--diffs-bg));
1005
+ }
1006
+
1007
+ [data-disable-line-numbers] {
1008
+ &[data-indicators='bars'] [data-column-number] {
1009
+ min-width: 4px;
1010
+ border-right: var(--diffs-gap-style, 1px solid var(--diffs-bg));
1011
+ }
1012
+
1013
+ [data-column-number] {
1014
+ border-right: none;
1015
+ min-width: 0;
1016
+ padding: 0;
1017
+ }
1018
+
1019
+ [data-line-number-content] {
1020
+ display: none;
1021
+ }
1022
+
1023
+ [data-hover-slot] {
1024
+ right: unset;
1025
+ left: 0;
1026
+ justify-content: flex-start;
1027
+ }
1028
+
1029
+ &[data-indicators='bars'] [data-hover-slot] {
1030
+ /* Using 5px here because theres a 1px separator after the bar */
1031
+ left: 5px;
1032
+ }
1033
+ }
1034
+
1035
+ [data-interactive-line-numbers] [data-column-number] {
1036
+ cursor: pointer;
1037
+ }
1038
+
1039
+ [data-diff-span] {
1040
+ border-radius: 3px;
1041
+ -webkit-box-decoration-break: clone;
1042
+ box-decoration-break: clone;
1043
+ }
1044
+
1045
+ [data-line-type='change-addition'] {
1046
+ [data-column-number] {
1047
+ color: var(
1048
+ --diffs-fg-number-addition-override,
1049
+ var(--diffs-addition-base)
1050
+ );
1051
+ }
1052
+
1053
+ [data-diff-span] {
1054
+ background-color: var(--diffs-bg-addition-emphasis);
1055
+ }
1056
+ }
1057
+
1058
+ [data-line-type='change-deletion'] {
1059
+ [data-column-number] {
1060
+ color: var(
1061
+ --diffs-fg-number-deletion-override,
1062
+ var(--diffs-deletion-base)
1063
+ );
1064
+ }
1065
+
1066
+ [data-diff-span] {
1067
+ background-color: var(--diffs-bg-deletion-emphasis);
1068
+ }
1069
+ }
1070
+
1071
+ [data-background] [data-line-type='change-addition'] {
1072
+ --diffs-line-bg: var(--diffs-bg-addition);
1073
+
1074
+ [data-column-number] {
1075
+ background-color: var(--diffs-bg-addition-number);
1076
+ }
1077
+ }
1078
+
1079
+ [data-background] [data-line-type='change-deletion'] {
1080
+ --diffs-line-bg: var(--diffs-bg-deletion);
1081
+
1082
+ [data-column-number] {
1083
+ background-color: var(--diffs-bg-deletion-number);
1084
+ }
1085
+ }
1086
+
1087
+ [data-line-type='context-expanded'] {
1088
+ --diffs-line-bg: var(--diffs-bg-context);
1089
+
1090
+ [data-column-number] {
1091
+ background-color: var(--diffs-bg-context);
1092
+ }
1093
+ }
1094
+
1095
+ /* By wrapping hovers in a pointer: fine, we ensure that mobile devices don't
1096
+ * require a double click */
1097
+ @media (pointer: fine) {
1098
+ [data-line]:hover:not([data-selected-line]) {
1099
+ [data-column-number],
1100
+ [data-column-content] {
1101
+ background-color: var(--diffs-bg-hover);
1102
+ }
1103
+ }
1104
+
1105
+ [data-background] [data-line]:hover:not([data-selected-line]) {
1106
+ &[data-line-type='change-deletion'] [data-column-number],
1107
+ &[data-line-type='change-deletion'] [data-column-content] {
1108
+ background-color: var(--diffs-bg-deletion-hover);
1109
+ }
1110
+
1111
+ &[data-line-type='change-addition'] [data-column-number],
1112
+ &[data-line-type='change-addition'] [data-column-content] {
1113
+ background-color: var(--diffs-bg-addition-hover);
1114
+ }
1115
+ }
1116
+ }
1117
+
1118
+ [data-diffs-header] {
1119
+ display: flex;
1120
+ flex-direction: row;
1121
+ justify-content: space-between;
1122
+ align-items: center;
1123
+ gap: var(--diffs-gap-inline, var(--diffs-gap-fallback));
1124
+ min-height: calc(
1125
+ 1lh + (var(--diffs-gap-block, var(--diffs-gap-fallback)) * 3)
1126
+ );
1127
+ padding-inline: 16px;
1128
+ }
1129
+
1130
+ [data-header-content] {
1131
+ display: flex;
1132
+ flex-direction: row;
1133
+ align-items: center;
1134
+ gap: var(--diffs-gap-inline, var(--diffs-gap-fallback));
1135
+ min-width: 0;
1136
+ white-space: nowrap;
1137
+ }
1138
+
1139
+ [data-header-content] [data-prev-name],
1140
+ [data-header-content] [data-title] {
1141
+ direction: rtl;
1142
+ overflow: hidden;
1143
+ text-overflow: ellipsis;
1144
+ min-width: 0;
1145
+ white-space: nowrap;
1146
+ }
1147
+
1148
+ [data-prev-name] {
1149
+ opacity: 0.7;
1150
+ }
1151
+
1152
+ [data-rename-icon] {
1153
+ fill: currentColor;
1154
+ flex-shrink: 0;
1155
+ flex-grow: 0;
1156
+ }
1157
+
1158
+ [data-diffs-header] [data-metadata] {
1159
+ display: flex;
1160
+ align-items: center;
1161
+ gap: 1ch;
1162
+ white-space: nowrap;
1163
+ }
1164
+
1165
+ [data-diffs-header] [data-additions-count] {
1166
+ font-family: var(--diffs-font-family, var(--diffs-font-fallback));
1167
+ color: var(--diffs-addition-base);
1168
+ }
1169
+
1170
+ [data-diffs-header] [data-deletions-count] {
1171
+ font-family: var(--diffs-font-family, var(--diffs-font-fallback));
1172
+ color: var(--diffs-deletion-base);
1173
+ }
1174
+
1175
+ [data-no-newline] {
1176
+ -webkit-user-select: none;
1177
+ user-select: none;
1178
+
1179
+ [data-column-content] {
1180
+ opacity: 0.6;
1181
+ }
1182
+ }
1183
+
1184
+ [data-annotation-content] {
1185
+ position: sticky;
1186
+ left: var(--diffs-column-number-width, 0);
1187
+ grid-column: 2 / -1;
1188
+ width: var(--diffs-column-content-width, auto);
1189
+ align-self: flex-start;
1190
+ z-index: 2;
1191
+ height: 100%;
1192
+ }
1193
+
1194
+ /* Undo some of the stuff that the 'pre' tag does */
1195
+ [data-annotation-slot] {
1196
+ text-wrap-mode: wrap;
1197
+ word-break: normal;
1198
+ white-space-collapse: collapse;
1199
+ }
1200
+
1201
+ [data-change-icon] {
1202
+ fill: currentColor;
1203
+ flex-shrink: 0;
1204
+ }
1205
+
1206
+ [data-change-icon='change'],
1207
+ [data-change-icon='rename-pure'],
1208
+ [data-change-icon='rename-changed'] {
1209
+ color: var(--diffs-modified-base);
1210
+ }
1211
+
1212
+ [data-change-icon='new'] {
1213
+ color: var(--diffs-addition-base);
1214
+ }
1215
+
1216
+ [data-change-icon='deleted'] {
1217
+ color: var(--diffs-deletion-base);
1218
+ }
1219
+
1220
+ [data-change-icon='file'] {
1221
+ opacity: 0.6;
1222
+ }
1223
+
1224
+ /* Line selection highlighting */
1225
+ [data-line-type='context'][data-selected-line] {
1226
+ [data-column-number] {
1227
+ color: var(--diffs-selection-number-fg);
1228
+ background-color: var(--diffs-bg-selection-number);
1229
+ }
1230
+
1231
+ [data-column-content] {
1232
+ background-color: var(--diffs-bg-selection);
1233
+ }
1234
+ }
1235
+
1236
+ [data-line-type='context-expanded'],
1237
+ [data-line-type='change-addition'],
1238
+ [data-line-type='change-deletion'] {
1239
+ &[data-selected-line] {
1240
+ [data-column-content] {
1241
+ background-color: light-dark(
1242
+ color-mix(
1243
+ in lab,
1244
+ var(--diffs-line-bg, var(--diffs-bg)) 82%,
1245
+ var(--diffs-selection-base)
1246
+ ),
1247
+ color-mix(
1248
+ in lab,
1249
+ var(--diffs-line-bg, var(--diffs-bg)) 75%,
1250
+ var(--diffs-selection-base)
1251
+ )
1252
+ );
1253
+ }
1254
+
1255
+ [data-column-number] {
1256
+ color: var(--diffs-selection-number-fg);
1257
+ background-color: light-dark(
1258
+ color-mix(
1259
+ in lab,
1260
+ var(--diffs-line-bg, var(--diffs-bg)) 75%,
1261
+ var(--diffs-selection-base)
1262
+ ),
1263
+ color-mix(
1264
+ in lab,
1265
+ var(--diffs-line-bg, var(--diffs-bg)) 60%,
1266
+ var(--diffs-selection-base)
1267
+ )
1268
+ );
1269
+ }
1270
+ }
1271
+ }
1272
+
1273
+ [data-error-wrapper] {
1274
+ overflow: auto;
1275
+ padding: var(--diffs-gap-block, var(--diffs-gap-fallback))
1276
+ var(--diffs-gap-inline, var(--diffs-gap-fallback));
1277
+ max-height: 400px;
1278
+ scrollbar-width: none;
1279
+
1280
+ [data-error-message] {
1281
+ font-weight: bold;
1282
+ font-size: 18px;
1283
+ color: var(--diffs-deletion-base);
1284
+ }
1285
+
1286
+ [data-error-stack] {
1287
+ color: var(--diffs-fg-number);
1288
+ }
1289
+ }
1290
+ }
1291
+ `;const O2="@layer base, theme, unsafe;";function Ah(e){return`${O2}
1292
+ @layer unsafe {
1293
+ ${e}
1294
+ }`}function Lh(e,t){if(t==null)return;const n=e.shadowRoot??e.attachShadow({mode:"open"});n.innerHTML===""&&(n.innerHTML=t)}function Ih({diffIndicators:e,disableBackground:t,disableLineNumbers:n,overflow:r,pre:o,split:i,themeStyles:s,themeType:a,totalLines:l}){switch(a==="system"?delete o.dataset.themeType:o.dataset.themeType=a,e){case"bars":case"classic":o.dataset.indicators=e;break;case"none":delete o.dataset.indicators;break}return n?o.dataset.disableLineNumbers="":delete o.dataset.disableLineNumbers,t?delete o.dataset.background:o.dataset.background="",o.dataset.type=i?"split":"file",o.dataset.overflow=r,o.dataset.diffs="",o.tabIndex=0,o.style=s,o.style.setProperty("--diffs-min-number-column-width-default",`${`${l}`.length}ch`),o}if(typeof HTMLElement<"u"&&customElements.get(ci)==null){let e;class t extends HTMLElement{constructor(){if(super(),this.shadowRoot!=null)return;const r=this.attachShadow({mode:"open"});e==null&&(e=new CSSStyleSheet,e.replaceSync(M2)),r.adoptedStyleSheets=[e]}}customElements.define(ci,t)}const Ph=!0;let D2=-1;var $2=class{static LoadedCustomComponent=Ph;__id=++D2;fileContainer;spriteSVG;pre;code;unsafeCSSStyle;hoverContent;errorWrapper;headerElement;headerMetadata;fileRenderer;resizeManager;mouseEventManager;lineSelectionManager;annotationElements=[];lineAnnotations=[];file;constructor(e={theme:it},t,n=!1){this.options=e,this.workerManager=t,this.isContainerManaged=n,this.fileRenderer=new R2(e,this.handleHighlightRender,this.workerManager),this.resizeManager=new hh,this.mouseEventManager=new fh("file",fi(e)),this.lineSelectionManager=new dh(di(e)),this.workerManager?.subscribeToThemeChanges(this)}handleHighlightRender=()=>{this.rerender()};rerender(){this.file!=null&&this.render({file:this.file,forceRender:!0})}setOptions(e){e!=null&&(this.options=e,this.mouseEventManager.setOptions(fi(e)),this.lineSelectionManager.setOptions(di(e)))}mergeOptions(e){this.options={...this.options,...e}}setThemeType(e){if((this.options.themeType??"system")!==e&&(this.mergeOptions({themeType:e}),this.fileRenderer.setThemeType(e),this.headerElement!=null&&(e==="system"?delete this.headerElement.dataset.themeType:this.headerElement.dataset.themeType=e),this.pre!=null))switch(e){case"system":delete this.pre.dataset.themeType;break;case"light":case"dark":this.pre.dataset.themeType=e;break}}getHoveredLine=()=>this.mouseEventManager.getHoveredLine();setLineAnnotations(e){this.lineAnnotations=e}setSelectedLines(e){this.lineSelectionManager.setSelection(e)}cleanUp(){this.fileRenderer.cleanUp(),this.resizeManager.cleanUp(),this.mouseEventManager.cleanUp(),this.lineSelectionManager.cleanUp(),this.workerManager?.unsubscribeToThemeChanges(this),this.workerManager=void 0,this.file=void 0,this.isContainerManaged||this.fileContainer?.parentNode?.removeChild(this.fileContainer),this.fileContainer?.shadowRoot!=null&&(this.fileContainer.shadowRoot.innerHTML=""),this.fileContainer=void 0,this.pre=void 0,this.headerElement=void 0,this.errorWrapper=void 0,this.unsafeCSSStyle=void 0}hydrate(e){const{fileContainer:t,prerenderedHTML:n}=e;Lh(t,n);for(const r of Array.from(t.shadowRoot?.children??[])){if(r instanceof SVGElement){this.spriteSVG=r;continue}if(r instanceof HTMLElement){if(r instanceof HTMLPreElement){this.pre=r;continue}if(r instanceof HTMLStyleElement&&r.hasAttribute(il)){this.unsafeCSSStyle=r;continue}if("diffsHeader"in r.dataset){this.headerElement=r;continue}}}if(this.pre==null)this.render(e);else{const{file:r,lineAnnotations:o}=e;this.fileContainer=t,delete this.pre.dataset.dehydrated,this.lineAnnotations=o??this.lineAnnotations,this.file=r,this.fileRenderer.hydrate(r),this.renderAnnotations(),this.renderHoverUtility(),this.injectUnsafeCSS(),this.mouseEventManager.setup(this.pre),this.lineSelectionManager.setup(this.pre),(this.options.overflow??"scroll")==="scroll"&&this.resizeManager.setup(this.pre)}}render({file:e,fileContainer:t,forceRender:n=!1,containerWrapper:r,lineAnnotations:o}){const i=o!=null&&(o.length>0||this.lineAnnotations.length>0)?o!==this.lineAnnotations:!1;if(!n&&pa(this.file,e)&&!i)return;this.file=e,this.fileRenderer.setOptions(this.options),o!=null&&this.setLineAnnotations(o),this.fileRenderer.setLineAnnotations(this.lineAnnotations);const{disableFileHeader:s=!1,disableErrorHandling:a=!1}=this.options;s&&this.headerElement!=null&&(this.headerElement.parentNode?.removeChild(this.headerElement),this.headerElement=void 0),t=this.getOrCreateFileContainerNode(t,r);try{const l=this.fileRenderer.renderFile(e);if(l==null){this.workerManager!=null&&!this.workerManager.isInitialized()&&this.workerManager.initialize().then(()=>this.rerender());return}l.headerAST!=null&&this.applyHeaderToDOM(l.headerAST,t);const u=this.getOrCreatePreNode(t);this.applyHunksToDOM(l,u),this.renderAnnotations(),this.renderHoverUtility()}catch(l){if(a)throw l;console.error(l),l instanceof Error&&this.applyErrorToDOM(l,t)}}renderAnnotations(){if(this.isContainerManaged||this.fileContainer==null)return;for(const t of this.annotationElements)t.parentNode?.removeChild(t);this.annotationElements.length=0;const{renderAnnotation:e}=this.options;if(e!=null&&this.lineAnnotations.length>0)for(const t of this.lineAnnotations){const n=e(t);if(n==null)continue;const r=Ch(qr(t));r.appendChild(n),this.annotationElements.push(r),this.fileContainer.appendChild(r)}}renderHoverUtility(){const{renderHoverUtility:e}=this.options;if(this.fileContainer==null||e==null)return;this.hoverContent==null&&(this.hoverContent=Sh(),this.fileContainer.appendChild(this.hoverContent));const t=e(this.mouseEventManager.getHoveredLine);this.hoverContent.innerHTML="",t!=null&&this.hoverContent.appendChild(t)}injectUnsafeCSS(){if(this.fileContainer?.shadowRoot==null)return;const{unsafeCSS:e}=this.options;if(e==null||e===""){this.unsafeCSSStyle!=null&&(this.unsafeCSSStyle.parentNode?.removeChild(this.unsafeCSSStyle),this.unsafeCSSStyle=void 0);return}this.unsafeCSSStyle==null&&(this.unsafeCSSStyle=Th(),this.fileContainer.shadowRoot.appendChild(this.unsafeCSSStyle)),this.unsafeCSSStyle.innerText=Ah(e)}applyHunksToDOM(e,t){this.cleanupErrorWrapper(),this.applyPreNodeAttributes(t,e),t.innerHTML="",this.code=Oo(),this.code.innerHTML=this.fileRenderer.renderPartialHTML(e.codeAST),t.appendChild(this.code),this.injectUnsafeCSS(),this.mouseEventManager.setup(t),this.lineSelectionManager.setup(t),this.lineSelectionManager.setDirty(),(this.options.overflow??"scroll")==="scroll"?this.resizeManager.setup(t):this.resizeManager.cleanUp()}applyHeaderToDOM(e,t){const{file:n}=this;if(n==null)return;this.cleanupErrorWrapper();const r=document.createElement("div");r.innerHTML=qt(e);const o=r.firstElementChild;if(!(o instanceof HTMLElement)||(this.headerElement!=null?t.shadowRoot?.replaceChild(o,this.headerElement):t.shadowRoot?.prepend(o),this.headerElement=o,this.isContainerManaged))return;const{renderCustomMetadata:i}=this.options;this.headerMetadata!=null&&this.headerMetadata.parentNode?.removeChild(this.headerMetadata);const s=i?.(n)??void 0;s!=null&&(this.headerMetadata=document.createElement("div"),this.headerMetadata.slot=ol,s instanceof Element?this.headerMetadata.appendChild(s):this.headerMetadata.innerText=`${s}`,t.appendChild(this.headerMetadata))}getOrCreateFileContainerNode(e,t){if(this.fileContainer=e??this.fileContainer??document.createElement(ci),t!=null&&this.fileContainer.parentNode!==t&&t.appendChild(this.fileContainer),this.spriteSVG==null){const n=document.createElement("div");n.innerHTML=kh;const r=n.firstChild;r instanceof SVGElement&&(this.spriteSVG=r,this.fileContainer.shadowRoot?.appendChild(this.spriteSVG))}return this.fileContainer}getOrCreatePreNode(e){return this.pre==null?(this.pre=document.createElement("pre"),e.shadowRoot?.appendChild(this.pre)):this.pre.parentNode!==e&&e.shadowRoot?.appendChild(this.pre),this.pre}applyPreNodeAttributes(e,{totalLines:t,themeStyles:n,baseThemeType:r}){const{overflow:o="scroll",themeType:i="system",disableLineNumbers:s=!1}=this.options;Ih({pre:e,split:!1,themeStyles:n,overflow:o,disableLineNumbers:s,themeType:r??i,diffIndicators:"none",disableBackground:!0,totalLines:t})}applyErrorToDOM(e,t){this.cleanupErrorWrapper();const n=this.getOrCreatePreNode(t);n.innerHTML="",n.parentNode?.removeChild(n),this.pre=void 0;const r=t.shadowRoot??t.attachShadow({mode:"open"});this.errorWrapper??=document.createElement("div"),this.errorWrapper.dataset.errorWrapper="",this.errorWrapper.innerHTML="",r.appendChild(this.errorWrapper);const o=document.createElement("div");o.dataset.errorMessage="",o.innerText=e.message,this.errorWrapper.appendChild(o);const i=document.createElement("pre");i.dataset.errorStack="",i.innerText=e.stack??"No Error Stack",this.errorWrapper.appendChild(i)}cleanupErrorWrapper(){this.errorWrapper?.parentNode?.removeChild(this.errorWrapper),this.errorWrapper=void 0}},V2=class{isDeletionsScrolling=!1;isAdditionsScrolling=!1;timeoutId=-1;codeDeletions;codeAdditions;enabled=!1;cleanUp(){this.enabled&&(this.codeDeletions?.removeEventListener("scroll",this.handleDeletionsScroll),this.codeAdditions?.removeEventListener("scroll",this.handleAdditionsScroll),clearTimeout(this.timeoutId),this.codeDeletions=void 0,this.codeAdditions=void 0,this.enabled=!1)}setup(e,t,n){if(t==null||n==null)for(const r of e.children??[])r instanceof HTMLElement&&("deletions"in r.dataset?t=r:"additions"in r.dataset&&(n=r));if(n==null||t==null){this.cleanUp();return}this.codeDeletions!==t&&(this.codeDeletions?.removeEventListener("scroll",this.handleDeletionsScroll),this.codeDeletions=t,t.addEventListener("scroll",this.handleDeletionsScroll,{passive:!0})),this.codeAdditions!==n&&(this.codeAdditions?.removeEventListener("scroll",this.handleAdditionsScroll),this.codeAdditions=n,n.addEventListener("scroll",this.handleAdditionsScroll,{passive:!0})),this.enabled=!0}handleDeletionsScroll=()=>{this.isAdditionsScrolling||(this.isDeletionsScrolling=!0,clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{this.isDeletionsScrolling=!1},300),this.codeAdditions?.scrollTo({left:this.codeDeletions?.scrollLeft}))};handleAdditionsScroll=()=>{this.isDeletionsScrolling||(this.isAdditionsScrolling=!0,clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{this.isAdditionsScrolling=!1},300),this.codeDeletions?.scrollTo({left:this.codeAdditions?.scrollLeft}))}};function Bn(e){return Ae({tagName:"div",properties:{"data-buffer":"",style:`grid-row: span ${e};min-height:calc(${e} * 1lh)`}})}function ys(e){return Ae({tagName:"div",children:[Ae({tagName:"span",properties:{"data-column-number":""}}),Ae({tagName:"span",children:[fn("No newline at end of file")],properties:{"data-column-content":""}})],properties:{"data-no-newline":"","data-line-type":e}})}function _s(e){return Ae({tagName:"div",children:[fa({name:e==="both"?"diffs-icon-expand-all":"diffs-icon-expand",properties:{"data-icon":""}})],properties:{"data-expand-button":"","data-expand-both":e==="both"?"":void 0,"data-expand-up":e==="up"?"":void 0,"data-expand-down":e==="down"?"":void 0}})}function bs({type:e,content:t,expandIndex:n,chunked:r=!1,slotName:o,isFirstHunk:i,isLastHunk:s}){const a=[];if(e==="metadata"&&t!=null&&a.push(Ae({tagName:"div",children:[fn(t)],properties:{"data-separator-wrapper":""}})),e==="line-info"&&t!=null){const l=[];n!=null&&(r?(i||l.push(_s("up")),s||l.push(_s("down"))):l.push(_s(!i&&!s?"both":i?"down":"up"))),l.push(Ae({tagName:"div",children:[Ae({tagName:"span",children:[fn(t)],properties:{"data-unmodified-lines":""}})],properties:{"data-separator-content":""}})),a.push(Ae({tagName:"div",children:l,properties:{"data-separator-wrapper":"","data-separator-multi-button":l.length>2?"":void 0}}))}return e==="custom"&&o!=null&&a.push(Ae({tagName:"slot",properties:{name:o}})),Ae({tagName:"div",children:a,properties:{"data-separator":a.length===0?"":e,"data-expand-index":n,"data-separator-first":i?"":void 0,"data-separator-last":s?"":void 0}})}function B2(e,t){return`hunk-separator-${e}-${t}`}function F2(e){const t=e[e.length-1];return t==null?0:Math.max(t.additionStart+t.additionCount,t.deletionStart+t.deletionCount)}class al{diff(t,n,r={}){let o;typeof r=="function"?(o=r,r={}):"callback"in r&&(o=r.callback);const i=this.castInput(t,r),s=this.castInput(n,r),a=this.removeEmpty(this.tokenize(i,r)),l=this.removeEmpty(this.tokenize(s,r));return this.diffWithOptionsObj(a,l,r,o)}diffWithOptionsObj(t,n,r,o){var i;const s=g=>{if(g=this.postProcess(g,r),o){setTimeout(function(){o(g)},0);return}else return g},a=n.length,l=t.length;let u=1,c=a+l;r.maxEditLength!=null&&(c=Math.min(c,r.maxEditLength));const d=(i=r.timeout)!==null&&i!==void 0?i:1/0,f=Date.now()+d,h=[{oldPos:-1,lastComponent:void 0}];let p=this.extractCommon(h[0],n,t,0,r);if(h[0].oldPos+1>=l&&p+1>=a)return s(this.buildValues(h[0].lastComponent,n,t));let b=-1/0,_=1/0;const y=()=>{for(let g=Math.max(b,-u);g<=Math.min(_,u);g+=2){let m;const v=h[g-1],x=h[g+1];v&&(h[g-1]=void 0);let L=!1;if(x){const O=x.oldPos-g;L=x&&0<=O&&O<a}const P=v&&v.oldPos+1<l;if(!L&&!P){h[g]=void 0;continue}if(!P||L&&v.oldPos<x.oldPos?m=this.addToPath(x,!0,!1,0,r):m=this.addToPath(v,!1,!0,1,r),p=this.extractCommon(m,n,t,g,r),m.oldPos+1>=l&&p+1>=a)return s(this.buildValues(m.lastComponent,n,t))||!0;h[g]=m,m.oldPos+1>=l&&(_=Math.min(_,g-1)),p+1>=a&&(b=Math.max(b,g+1))}u++};if(o)(function g(){setTimeout(function(){if(u>c||Date.now()>f)return o(void 0);y()||g()},0)})();else for(;u<=c&&Date.now()<=f;){const g=y();if(g)return g}}addToPath(t,n,r,o,i){const s=t.lastComponent;return s&&!i.oneChangePerToken&&s.added===n&&s.removed===r?{oldPos:t.oldPos+o,lastComponent:{count:s.count+1,added:n,removed:r,previousComponent:s.previousComponent}}:{oldPos:t.oldPos+o,lastComponent:{count:1,added:n,removed:r,previousComponent:s}}}extractCommon(t,n,r,o,i){const s=n.length,a=r.length;let l=t.oldPos,u=l-o,c=0;for(;u+1<s&&l+1<a&&this.equals(r[l+1],n[u+1],i);)u++,l++,c++,i.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return c&&!i.oneChangePerToken&&(t.lastComponent={count:c,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=l,u}equals(t,n,r){return r.comparator?r.comparator(t,n):t===n||!!r.ignoreCase&&t.toLowerCase()===n.toLowerCase()}removeEmpty(t){const n=[];for(let r=0;r<t.length;r++)t[r]&&n.push(t[r]);return n}castInput(t,n){return t}tokenize(t,n){return Array.from(t)}join(t){return t.join("")}postProcess(t,n){return t}get useLongestToken(){return!1}buildValues(t,n,r){const o=[];let i;for(;t;)o.push(t),i=t.previousComponent,delete t.previousComponent,t=i;o.reverse();const s=o.length;let a=0,l=0,u=0;for(;a<s;a++){const c=o[a];if(c.removed)c.value=this.join(r.slice(u,u+c.count)),u+=c.count;else{if(!c.added&&this.useLongestToken){let d=n.slice(l,l+c.count);d=d.map(function(f,h){const p=r[u+h];return p.length>f.length?p:f}),c.value=this.join(d)}else c.value=this.join(n.slice(l,l+c.count));l+=c.count,c.added||(u+=c.count)}}return o}}class z2 extends al{}const H2=new z2;function G2(e,t,n){return H2.diff(e,t,n)}const ic="a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}";class j2 extends al{tokenize(t){const n=new RegExp(`(\\r?\\n)|[${ic}]+|[^\\S\\n\\r]+|[^${ic}]`,"ug");return t.match(n)||[]}}const U2=new j2;function W2(e,t,n){return U2.diff(e,t,n)}class q2 extends al{constructor(){super(...arguments),this.tokenize=X2}equals(t,n,r){return r.ignoreWhitespace?((!r.newlineIsToken||!t.includes(`
1295
+ `))&&(t=t.trim()),(!r.newlineIsToken||!n.includes(`
1296
+ `))&&(n=n.trim())):r.ignoreNewlineAtEof&&!r.newlineIsToken&&(t.endsWith(`
1297
+ `)&&(t=t.slice(0,-1)),n.endsWith(`
1298
+ `)&&(n=n.slice(0,-1))),super.equals(t,n,r)}}const Y2=new q2;function sc(e,t,n){return Y2.diff(e,t,n)}function X2(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
1299
+ `));const n=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let o=0;o<r.length;o++){const i=r[o];o%2&&!t.newlineIsToken?n[n.length-1]+=i:n.push(i)}return n}const K2={includeIndex:!0,includeUnderline:!0,includeFileHeaders:!0};function ac(e,t,n,r,o,i,s){let a;s?typeof s=="function"?a={callback:s}:a=s:a={},typeof a.context>"u"&&(a.context=4);const l=a.context;if(a.newlineIsToken)throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(a.callback){const{callback:c}=a;sc(n,r,Object.assign(Object.assign({},a),{callback:d=>{const f=u(d);c(f)}}))}else return u(sc(n,r,a));function u(c){if(!c)return;c.push({value:"",lines:[]});function d(g){return g.map(function(m){return" "+m})}const f=[];let h=0,p=0,b=[],_=1,y=1;for(let g=0;g<c.length;g++){const m=c[g],v=m.lines||Q2(m.value);if(m.lines=v,m.added||m.removed){if(!h){const x=c[g-1];h=_,p=y,x&&(b=l>0?d(x.lines.slice(-l)):[],h-=b.length,p-=b.length)}for(const x of v)b.push((m.added?"+":"-")+x);m.added?y+=v.length:_+=v.length}else{if(h)if(v.length<=l*2&&g<c.length-2)for(const x of d(v))b.push(x);else{const x=Math.min(v.length,l);for(const P of d(v.slice(0,x)))b.push(P);const L={oldStart:h,oldLines:_-h+x,newStart:p,newLines:y-p+x,lines:b};f.push(L),h=0,p=0,b=[]}_+=v.length,y+=v.length}}for(const g of f)for(let m=0;m<g.lines.length;m++)g.lines[m].endsWith(`
1300
+ `)?g.lines[m]=g.lines[m].slice(0,-1):(g.lines.splice(m+1,0,"\"),m++);return{oldFileName:e,newFileName:t,oldHeader:o,newHeader:i,hunks:f}}}function ma(e,t){if(t||(t=K2),Array.isArray(e)){if(e.length>1&&!t.includeFileHeaders)throw new Error("Cannot omit file headers on a multi-file patch. (The result would be unparseable; how would a tool trying to apply the patch know which changes are to which file?)");return e.map(r=>ma(r,t)).join(`
1301
+ `)}const n=[];t.includeIndex&&e.oldFileName==e.newFileName&&n.push("Index: "+e.oldFileName),t.includeUnderline&&n.push("==================================================================="),t.includeFileHeaders&&(n.push("--- "+e.oldFileName+(typeof e.oldHeader>"u"?"":" "+e.oldHeader)),n.push("+++ "+e.newFileName+(typeof e.newHeader>"u"?"":" "+e.newHeader)));for(let r=0;r<e.hunks.length;r++){const o=e.hunks[r];o.oldLines===0&&(o.oldStart-=1),o.newLines===0&&(o.newStart-=1),n.push("@@ -"+o.oldStart+","+o.oldLines+" +"+o.newStart+","+o.newLines+" @@");for(const i of o.lines)n.push(i)}return n.join(`
1302
+ `)+`
1303
+ `}function Z2(e,t,n,r,o,i,s){if(typeof s=="function"&&(s={callback:s}),s?.callback){const{callback:a}=s;ac(e,t,n,r,o,i,Object.assign(Object.assign({},s),{callback:l=>{a(l?ma(l,s.headerOptions):void 0)}}))}else{const a=ac(e,t,n,r,o,i,s);return a?ma(a,s?.headerOptions):void 0}}function Q2(e){const t=e.endsWith(`
1304
+ `),n=e.split(`
1305
+ `).map(r=>r+`
1306
+ `);return t?n.pop():n.push(n.pop().slice(0,-1)),n}function lc({line:e,spanStart:t,spanLength:n}){return{start:{line:e,character:t},end:{line:e,character:t+n},properties:{"data-diff-span":""},alwaysWrap:!0}}function ko({item:e,arr:t,enableJoin:n,isNeutral:r=!1,isLastItem:o=!1}){const i=t[t.length-1];if(i==null||o||!n){t.push([r?0:1,e.value]);return}const s=i[0]===0;if(r===s||r&&e.value.length===1&&!s){i[1]+=e.value;return}t.push([r?0:1,e.value])}function J2(e,t,n,r=!1){const o=(()=>{const u=n.theme??it;if(typeof u=="string")return t.getTheme(u).type})(),i=xh({theme:n.theme,highlighter:t});if(e.newLines!=null&&e.oldLines!=null){const{oldContent:u,newContent:c,oldInfo:d,newInfo:f,oldDecorations:h,newDecorations:p}=uc({hunks:e.hunks,oldLines:e.oldLines,newLines:e.newLines,lineDiffType:n.lineDiffType});return{code:cc({oldFile:{name:e.prevName??e.name,contents:u},oldInfo:d,oldDecorations:h,newFile:{name:e.name,contents:c},newInfo:f,newDecorations:p,highlighter:t,options:n,languageOverride:r?"text":e.lang}),themeStyles:i,baseThemeType:o}}const s=[];let a=0,l=0;for(const u of e.hunks){const{oldContent:c,newContent:d,oldInfo:f,newInfo:h,oldDecorations:p,newDecorations:b,splitLineIndex:_,unifiedLineIndex:y}=uc({hunks:[u],splitLineIndex:a,unifiedLineIndex:l,lineDiffType:n.lineDiffType}),g={name:e.prevName??e.name,contents:c},m={name:e.name,contents:d};s.push(cc({oldFile:g,oldInfo:f,oldDecorations:p,newFile:m,newInfo:h,newDecorations:b,highlighter:t,options:n,languageOverride:r?"text":e.lang})),a=_,l=y}return{code:(()=>{if(s.length<=1){const u=s[0]??{oldLines:[],newLines:[]};if(u.newLines.length===0||u.oldLines.length===0)return u}return{hunks:s}})(),themeStyles:i,baseThemeType:o}}function eA({oldLine:e,newLine:t,oldLineIndex:n,newLineIndex:r,oldDecorations:o,newDecorations:i,lineDiffType:s}){if(e==null||t==null||s==="none")return;e=Pn(e),t=Pn(t);const a=s==="char"?G2(e,t):W2(e,t),l=[],u=[],c=s==="word-alt";for(const f of a){const h=f===a[a.length-1];!f.added&&!f.removed?(ko({item:f,arr:l,enableJoin:c,isNeutral:!0,isLastItem:h}),ko({item:f,arr:u,enableJoin:c,isNeutral:!0,isLastItem:h})):f.removed?ko({item:f,arr:l,enableJoin:c,isLastItem:h}):ko({item:f,arr:u,enableJoin:c,isLastItem:h})}let d=0;for(const f of l)f[0]===1&&o.push(lc({line:n-1,spanStart:d,spanLength:f[1].length})),d+=f[1].length;d=0;for(const f of u)f[0]===1&&i.push(lc({line:r-1,spanStart:d,spanLength:f[1].length})),d+=f[1].length}function uc({hunks:e,oldLines:t,newLines:n,splitLineIndex:r=0,unifiedLineIndex:o=0,lineDiffType:i}){const s={},a={},l=[],u=[];let c=1,d=1,f=1,h=1,p="",b="";for(const _ of e){for(;t!=null&&n!=null&&c<_.additionStart&&d<_.deletionStart;)s[d]={type:"context-expanded",lineNumber:h,altLineNumber:f,lineIndex:`${o},${r}`},a[c]={type:"context-expanded",lineNumber:f,altLineNumber:h,lineIndex:`${o},${r}`},p+=t[d-1],b+=n[c-1],d++,c++,h++,f++,r++,o++;h=_.deletionStart,f=_.additionStart;for(const y of _.hunkContent)if(y.type==="context")for(const g of y.lines)s[d]={type:"context",lineNumber:h,altLineNumber:f,lineIndex:`${o},${r}`},a[c]={type:"context",lineNumber:f,altLineNumber:h,lineIndex:`${o},${r}`},p+=g,b+=g,d++,c++,f++,h++,r++,o++;else{const g=Math.max(y.additions.length,y.deletions.length);let m=0,v=o;for(;m<g;){const x=y.deletions[m],L=y.additions[m];eA({newLine:L,oldLine:x,oldLineIndex:d,newLineIndex:c,oldDecorations:l,newDecorations:u,lineDiffType:i}),x!=null&&(s[d]={type:"change-deletion",lineNumber:h,lineIndex:`${v},${r}`},p+=x,d++,h++),L!=null&&(a[c]={type:"change-addition",lineNumber:f,lineIndex:`${v+y.deletions.length},${r}`},b+=L,c++,f++),r++,v++,m++}o+=y.additions.length+y.deletions.length}if(!(t==null||n==null||_!==e[e.length-1]))for(;d<=t.length||c<=t.length;){const y=t[d-1],g=n[c-1];if(y==null&&g==null)break;y!=null&&(s[d]={type:"context-expanded",lineNumber:h,altLineNumber:f,lineIndex:`${o},${r}`},p+=y,d++,h++),g!=null&&(a[c]={type:"context-expanded",lineNumber:f,altLineNumber:h,lineIndex:`${o},${r}`},b+=g,c++,f++),r++,o++}}return{oldContent:p,newContent:b,oldInfo:s,newInfo:a,oldDecorations:l,newDecorations:u,splitLineIndex:r,unifiedLineIndex:o}}function cc({oldFile:e,newFile:t,oldInfo:n,newInfo:r,highlighter:o,oldDecorations:i,newDecorations:s,languageOverride:a,options:{theme:l=it,...u}}){const c=a??In(e.name),d=a??In(t.name),{state:f,transformers:h}=Eh(),p=typeof l=="string"?{...u,lang:"text",theme:l,transformers:h,decorations:void 0,defaultColor:!1,cssVariablePrefix:ut("token")}:{...u,lang:"text",themes:l,transformers:h,decorations:void 0,defaultColor:!1,cssVariablePrefix:ut("token")};return{oldLines:e.contents===""?[]:(p.lang=c,f.lineInfo=n,p.decorations=i,ha(o.codeToHast(Pn(e.contents),p))),newLines:t.contents===""?[]:(p.lang=d,p.decorations=s,f.lineInfo=r,ha(o.codeToHast(Pn(t.contents),p)))}}const tA={fromStart:0,fromEnd:0};var nA=class{highlighter;diff;expandedHunks=new Map;deletionAnnotations={};additionAnnotations={};computedLang="text";renderCache;constructor(e={theme:it},t,n){this.options=e,this.onRenderUpdate=t,this.workerManager=n,n?.isWorkingPool()!==!0&&(this.highlighter=Pr(e.theme??it)?vh():void 0)}cleanUp(){this.highlighter=void 0,this.diff=void 0,this.renderCache=void 0,this.workerManager=void 0,this.onRenderUpdate=void 0}setOptions(e){this.options=e}mergeOptions(e){this.options={...this.options,...e}}setThemeType(e){this.getOptionsWithDefaults().themeType!==e&&this.mergeOptions({themeType:e})}expandHunk(e,t){const{expansionLineCount:n}=this.getOptionsWithDefaults(),r=this.expandedHunks.get(e)??{fromStart:0,fromEnd:0};(t==="up"||t==="both")&&(r.fromStart+=n),(t==="down"||t==="both")&&(r.fromEnd+=n),this.expandedHunks.set(e,r)}setLineAnnotations(e){this.additionAnnotations={},this.deletionAnnotations={};for(const t of e){const n=(()=>{switch(t.side){case"deletions":return this.deletionAnnotations;case"additions":return this.additionAnnotations}})(),r=n[t.lineNumber]??[];n[t.lineNumber]=r,r.push(t)}}getOptionsWithDefaults(){const{diffIndicators:e="bars",diffStyle:t="split",disableBackground:n=!1,disableFileHeader:r=!1,disableLineNumbers:o=!1,expandUnchanged:i=!1,expansionLineCount:s=100,hunkSeparators:a="line-info",lineDiffType:l="word-alt",maxLineDiffLength:u=1e3,overflow:c="scroll",theme:d=it,themeType:f="system",tokenizeMaxLineLength:h=1e3,useCSSClasses:p=!1}=this.options;return{diffIndicators:e,diffStyle:t,disableBackground:n,disableFileHeader:r,disableLineNumbers:o,expandUnchanged:i,expansionLineCount:s,hunkSeparators:a,lineDiffType:l,maxLineDiffLength:u,overflow:c,theme:this.workerManager?.getDiffRenderOptions().theme??d,themeType:f,tokenizeMaxLineLength:h,useCSSClasses:p}}async initializeHighlighter(){return this.highlighter=await gh(wh(this.computedLang,this.options)),this.highlighter}hydrate(e){if(e==null)return;this.diff=e;const{options:t}=this.getRenderOptions(e);let n=this.workerManager?.getDiffResultCache(e);n!=null&&!ws(t,n.options)&&(n=void 0),this.renderCache??={diff:e,highlighted:!0,options:t,result:n?.result},this.workerManager?.isWorkingPool()===!0&&this.renderCache.result==null?this.workerManager.highlightDiffAST(this,this.diff):this.asyncHighlight(e).then(({result:r,options:o})=>{this.onHighlightSuccess(e,r,o)})}getRenderOptions(e){const t=(()=>{if(this.workerManager?.isWorkingPool()===!0)return this.workerManager.getDiffRenderOptions();const{theme:r,tokenizeMaxLineLength:o,lineDiffType:i}=this.getOptionsWithDefaults();return{theme:r,tokenizeMaxLineLength:o,lineDiffType:i}})();this.getOptionsWithDefaults();const{renderCache:n}=this;return n?.result==null?{options:t,forceRender:!0}:e!==n.diff||!ws(t,n.options)?{options:t,forceRender:!0}:{options:t,forceRender:!1}}renderDiff(e=this.renderCache?.diff){if(e==null)return;const t=this.workerManager?.getDiffResultCache(e);t!=null&&this.renderCache==null&&(this.renderCache={diff:e,highlighted:!0,...t});const{options:n,forceRender:r}=this.getRenderOptions(e);if(this.renderCache??={diff:e,highlighted:!1,options:n,result:void 0},this.workerManager?.isWorkingPool()===!0)this.renderCache.result??=this.workerManager.getPlainDiffAST(e),(!this.renderCache.highlighted||r)&&this.workerManager.highlightDiffAST(this,e);else{this.computedLang=e.lang??In(e.name);const o=this.highlighter!=null&&Pr(n.theme),i=this.highlighter!=null&&hi(this.computedLang);if(this.highlighter!=null&&o&&(r||!this.renderCache.highlighted&&i||this.renderCache.result==null)){const{result:s,options:a}=this.renderDiffWithHighlighter(e,this.highlighter,!i);this.renderCache={diff:e,options:a,highlighted:i,result:s}}(!o||!i)&&this.asyncHighlight(e).then(({result:s,options:a})=>{this.onHighlightSuccess(e,s,a)})}return this.renderCache.result!=null?this.processDiffResult(this.renderCache.diff,this.renderCache.result):void 0}async asyncRender(e){const{result:t}=await this.asyncHighlight(e);return this.processDiffResult(e,t)}createPreElement(e,t,n,r){const{diffIndicators:o,disableBackground:i,disableLineNumbers:s,overflow:a,themeType:l}=this.getOptionsWithDefaults();return bh({diffIndicators:o,disableBackground:i,disableLineNumbers:s,overflow:a,themeStyles:n,split:e,themeType:r??l,totalLines:t})}async asyncHighlight(e){this.computedLang=e.lang??In(e.name);const t=this.highlighter!=null&&Pr(this.options.theme??it),n=this.highlighter!=null&&hi(this.computedLang);return(this.highlighter==null||!t||!n)&&(this.highlighter=await this.initializeHighlighter()),this.renderDiffWithHighlighter(e,this.highlighter)}renderDiffWithHighlighter(e,t,n=!1){const{options:r}=this.getRenderOptions(e);return{result:J2(e,t,r,n),options:r}}onHighlightSuccess(e,t,n){if(this.renderCache==null)return;const r=this.renderCache.diff!==e||!this.renderCache.highlighted||!ws(this.renderCache.options,n);this.renderCache={diff:e,options:n,highlighted:!0,result:t},r&&this.onRenderUpdate?.()}onHighlightError(e){console.error(e)}processDiffResult(e,{code:t,themeStyles:n,baseThemeType:r}){const{diffStyle:o,disableFileHeader:i}=this.getOptionsWithDefaults();this.diff=e;const s=o==="unified";let a=[],l=[],u=[],c=0;const d=[];let f,h=0;for(const _ of e.hunks)h+=_.collapsedBefore,h=this.renderHunks({ast:t,hunk:_,prevHunk:f,hunkIndex:c,isLastHunk:c===e.hunks.length-1,additionsAST:a,deletionsAST:l,unifiedAST:u,hunkData:d,lineIndex:h}),c++,f=_;const p=Math.max(F2(e.hunks),e.newLines?.length??0,e.oldLines?.length??0);a=!s&&(t.hunks!=null||t.newLines.length>0)?a:void 0,l=!s&&(t.hunks!=null||t.oldLines.length>0)?l:void 0,u=u.length>0?u:void 0;const b=this.createPreElement(l!=null&&a!=null,p,n,r);return{additionsAST:a,deletionsAST:l,unifiedAST:u,hunkData:d,preNode:b,themeStyles:n,baseThemeType:r,headerElement:i?void 0:this.renderHeader(this.diff,n,r),totalLines:p,css:""}}renderFullAST(e,t=[]){return e.unifiedAST!=null&&t.push(Ae({tagName:"code",children:e.unifiedAST,properties:{"data-code":"","data-unified":""}})),e.deletionsAST!=null&&t.push(Ae({tagName:"code",children:e.deletionsAST,properties:{"data-code":"","data-deletions":""}})),e.additionsAST!=null&&t.push(Ae({tagName:"code",children:e.additionsAST,properties:{"data-code":"","data-additions":""}})),{...e.preNode,children:t}}renderFullHTML(e,t=[]){return qt(this.renderFullAST(e,t))}renderPartialHTML(e,t){return t==null?qt(e):qt(Ae({tagName:"code",children:e,properties:{"data-code":"",[`data-${t}`]:""}}))}renderCollapsedHunks({ast:e,hunkData:t,hunkIndex:n,hunkSpecs:r,isFirstHunk:o,isLastHunk:i,rangeSize:s,lineIndex:a,additionLineNumber:l,deletionLineNumber:u,unifiedAST:c,deletionsAST:d,additionsAST:f}){if(s<=0)return;const{hunkSeparators:h,expandUnchanged:p,diffStyle:b,expansionLineCount:_}=this.getOptionsWithDefaults(),y=e.hunks==null&&e.newLines.length>0&&e.oldLines.length>0,g=this.expandedHunks.get(n)??tA,m=s>_,v=Math.max(p?0:s-(g.fromEnd+g.fromStart),0),x=({type:P,linesAST:O})=>{if(h==="line-info"||h==="custom"){const W=B2(P,n);O.push(bs({type:h,content:rA(v),expandIndex:y?n:void 0,chunked:m,slotName:W,isFirstHunk:o,isLastHunk:i})),t.push({slotName:W,hunkIndex:n,lines:v,type:P,expandable:y?{up:y&&!o,down:y,chunked:m}:void 0})}else h==="metadata"&&r!=null?O.push(bs({type:"metadata",content:r,isFirstHunk:o,isLastHunk:i})):h==="simple"&&n>0&&O.push(bs({type:"simple",isFirstHunk:o,isLastHunk:!1}))},L=({rangeLen:P,fromStart:O})=>{if(e.newLines==null||e.oldLines==null)return;const W=i?0:O?s:P;let N=u-W,M=l-W,C=a-W;for(let F=0;F<P;F++){const E=e.oldLines[N],$=e.newLines[M];if(E==null||$==null)throw console.error({aLineNumber:M,dLineNumber:N,ast:e}),new Error("DiffHunksRenderer.renderHunks prefill context invalid. Must include data for old and new lines");N++,M++,b==="unified"?this.pushLineWithAnnotation({newLine:$,unifiedAST:c,unifiedSpan:this.getAnnotations("unified",N,M,n,C)}):this.pushLineWithAnnotation({newLine:$,oldLine:E,additionsAST:f,deletionsAST:d,...this.getAnnotations("split",N,M,n,C)}),C++}};y&&L({rangeLen:Math.min(v===0||p?s:g.fromStart,s),fromStart:!0}),v>0&&(b==="unified"?x({type:"unified",linesAST:c}):(x({type:"deletions",linesAST:d}),x({type:"additions",linesAST:f}))),v>0&&g.fromEnd>0&&!i&&L({rangeLen:Math.min(g.fromEnd,s),fromStart:!1})}renderHunks({hunk:e,hunkData:t,hunkIndex:n,lineIndex:r,isLastHunk:o,prevHunk:i,ast:s,deletionsAST:a,additionsAST:l,unifiedAST:u}){const{diffStyle:c}=this.getOptionsWithDefaults(),d=c==="unified";let f=e.additionStart-1,h=e.deletionStart-1;this.renderCollapsedHunks({additionLineNumber:f,additionsAST:l,ast:s,deletionLineNumber:h,deletionsAST:a,hunkData:t,hunkIndex:n,hunkSpecs:e.hunkSpecs,isFirstHunk:i==null,isLastHunk:!1,lineIndex:r,rangeSize:Math.max(e.collapsedBefore,0),unifiedAST:u});let{oldLines:p,newLines:b,oldIndex:_,newIndex:y}=(()=>{if(s.hunks!=null){const g=s.hunks[n];if(g==null)throw console.error({ast:s,hunkIndex:n}),new Error("DiffHunksRenderer.renderHunks: lineHunk doesn't exist");return{oldLines:g.oldLines,newLines:g.newLines,oldIndex:0,newIndex:0}}return{oldLines:s.oldLines,newLines:s.newLines,oldIndex:h,newIndex:f}})();for(const g of e.hunkContent)if(g.type==="context"){const{length:m}=g.lines;for(let v=0;v<m;v++){const x=p[_],L=b[y];if(_++,y++,f++,h++,d){if(L==null)throw new Error("DiffHunksRenderer.renderHunks: newLine doesnt exist for context...");this.pushLineWithAnnotation({newLine:L,unifiedAST:u,unifiedSpan:this.getAnnotations("unified",h,f,n,r)})}else{if(L==null||x==null)throw new Error("DiffHunksRenderer.renderHunks: newLine or oldLine doesnt exist for context...");this.pushLineWithAnnotation({oldLine:x,newLine:L,deletionsAST:a,additionsAST:l,...this.getAnnotations("split",h,f,n,r)})}r++}if(g.noEOFCR){const v=ys("context");d?u.push(v):(a.push(v),l.push(v))}}else{const{length:m}=g.deletions,{length:v}=g.additions,x=d?m+v:Math.max(m,v);let L=0;for(let P=0;P<x;P++){const{oldLine:O,newLine:W}=(()=>{let N=p[_],M=b[y];if(d?P<m?M=void 0:N=void 0:(P>=m&&(N=void 0),P>=v&&(M=void 0)),N==null&&M==null)throw console.error({i:P,len:x,ast:s,hunkContent:g}),new Error("renderHunks: oldLine and newLine are null, something is wrong");return{oldLine:N,newLine:M}})();if(O!=null&&(_++,h++),W!=null&&(y++,f++),d)this.pushLineWithAnnotation({oldLine:O,newLine:W,unifiedAST:u,unifiedSpan:this.getAnnotations("unified",O!=null?h:void 0,W!=null?f:void 0,n,r)}),r++;else{(O==null||W==null)&&L++;const N=this.getAnnotations("split",O!=null?h:void 0,W!=null?f:void 0,n,r);N!=null&&L>0&&(v>m?a.push(Bn(L)):l.push(Bn(L)),L=0),this.pushLineWithAnnotation({newLine:W,oldLine:O,deletionsAST:a,additionsAST:l,...N}),r++}}d||(L>0&&(v>m?a.push(Bn(L)):l.push(Bn(L)),L=0),g.noEOFCRDeletions&&(a.push(ys("change-deletion")),g.noEOFCRAdditions||l.push(Bn(1))),g.noEOFCRAdditions&&(l.push(ys("change-addition")),g.noEOFCRDeletions||a.push(Bn(1))))}return o&&s.newLines!=null&&s.newLines.length>0&&this.renderCollapsedHunks({additionLineNumber:f,additionsAST:l,ast:s,deletionLineNumber:h,deletionsAST:a,hunkData:t,hunkIndex:n+1,hunkSpecs:void 0,isFirstHunk:!1,isLastHunk:!0,lineIndex:r,rangeSize:Math.max(s.newLines.length-Math.max(e.additionStart+e.additionCount-1,0),0),unifiedAST:u}),r}pushLineWithAnnotation({newLine:e,oldLine:t,unifiedAST:n,additionsAST:r,deletionsAST:o,unifiedSpan:i,deletionSpan:s,additionSpan:a}){n!=null?(t!=null?n.push(t):e!=null&&n.push(e),i!=null&&n.push(Mo(i))):o!=null&&r!=null&&(t!=null&&o.push(t),e!=null&&r.push(e),s!=null&&o.push(Mo(s)),a!=null&&r.push(Mo(a)))}getAnnotations(e,t,n,r,o){const i={type:"annotation",hunkIndex:r,lineIndex:o,annotations:[]};if(t!=null)for(const a of this.deletionAnnotations[t]??[])i.annotations.push(qr(a));const s={type:"annotation",hunkIndex:r,lineIndex:o,annotations:[]};if(n!=null)for(const a of this.additionAnnotations[n]??[])(e==="unified"?i:s).annotations.push(qr(a));if(e==="unified")return i.annotations.length>0?i:void 0;if(!(s.annotations.length===0&&i.annotations.length===0))return{deletionSpan:i,additionSpan:s}}renderHeader(e,t,n){const{themeType:r}=this.getOptionsWithDefaults();return _h({fileOrDiff:e,themeStyles:t,themeType:n??r})}};function ws(e,t){return yh(e.theme,t.theme)&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength&&e.lineDiffType===t.lineDiffType}function rA(e){return`${e} unmodified line${e>1?"s":""}`}function oA(e){const t=e[0];if(t!=="+"&&t!=="-"&&t!==" "&&t!=="\\"){console.error(`parseLineType: Invalid firstChar: "${t}", full line: "${e}"`);return}const n=e.substring(1);return{line:n===""?`
1307
+ `:n,type:t===" "?"context":t==="\\"?"metadata":t==="+"?"addition":"deletion"}}function iA(e,t){const n=fs.test(e),r=e.split(n?fs:tc);let o;const i=[];let s;for(const a of r){if(n&&!fs.test(a)){o==null?o=a:console.error("parsePatchContent: unknown file blob:",a);continue}else if(!n&&!tc.test(a)){o==null?o=a:console.error("parsePatchContent: unknown file blob:",a);continue}let l=0;const u=a.split(l2);s=void 0;for(const c of u){const d=c.split(la),f=d.shift();if(f==null){console.error("parsePatchContent: invalid hunk",c);continue}const h=f.match(u2),p=[];let b=0,_=0;if(h==null||s==null){if(s!=null){console.error("parsePatchContent: Invalid hunk",c);continue}s={name:"",prevName:void 0,type:"change",hunks:[],splitLineCount:0,unifiedLineCount:0,cacheKey:t!=null?`${t}-${i.length}`:void 0},d.unshift(f);for(const g of d){const m=g.match(n?d2:c2);if(g.startsWith("diff --git")){const[,,v,,x]=g.trim().match(f2)??[];s.name=x.trim(),v!==x&&(s.prevName=v.trim())}else if(m!=null){const[,v,x]=m;v==="---"&&x!=="/dev/null"?(s.prevName=x.trim(),s.name=x.trim()):v==="+++"&&x!=="/dev/null"&&(s.name=x.trim())}else if(n){if(g.startsWith("new mode ")&&(s.mode=g.replace("new mode","").trim()),g.startsWith("old mode ")&&(s.oldMode=g.replace("old mode","").trim()),g.startsWith("new file mode")&&(s.type="new",s.mode=g.replace("new file mode","").trim()),g.startsWith("deleted file mode")&&(s.type="deleted",s.mode=g.replace("deleted file mode","").trim()),g.startsWith("similarity index")&&(g.startsWith("similarity index 100%")?s.type="rename-pure":s.type="rename-changed"),g.startsWith("index ")){const[,v]=g.trim().match(h2)??[];v!=null&&(s.mode=v)}g.startsWith("rename from ")&&(s.prevName=g.replace("rename from ","")),g.startsWith("rename to ")&&(s.name=g.replace("rename to ","").trim())}}continue}else{let g,m;for(;d.length>0&&(d[d.length-1]===`
1308
+ `||d[d.length-1]==="");)d.pop();for(const v of d){const x=oA(v);if(x==null)continue;const{type:L,line:P}=x;if(L==="addition")(g==null||g.type!=="change")&&(g=Es("change"),p.push(g)),g.additions.push(P),b++,m="addition";else if(L==="deletion")(g==null||g.type!=="change")&&(g=Es("change"),p.push(g)),g.deletions.push(P),_++,m="deletion";else if(L==="context")(g==null||g.type!=="context")&&(g=Es("context"),p.push(g)),g.lines.push(P),m="context";else if(L==="metadata"&&g!=null){if(g.type==="context")g.noEOFCR=!0;else if(m==="deletion"){g.noEOFCRDeletions=!0;const O=g.deletions.length-1;O>=0&&(g.deletions[O]=Pn(g.deletions[O]))}else if(m==="addition"){g.noEOFCRAdditions=!0;const O=g.additions.length-1;O>=0&&(g.additions[O]=Pn(g.additions[O]))}}}}const y={collapsedBefore:0,splitLineCount:0,splitLineStart:0,unifiedLineCount:0,unifiedLineStart:0,additionCount:parseInt(h[4]??"1"),additionStart:parseInt(h[3]),additionLines:b,deletionCount:parseInt(h[2]??"1"),deletionStart:parseInt(h[1]),deletionLines:_,hunkContent:p,hunkContext:h[5],hunkSpecs:f};if(isNaN(y.additionCount)||isNaN(y.deletionCount)||isNaN(y.additionStart)||isNaN(y.deletionStart)){console.error("parsePatchContent: invalid hunk metadata",y);continue}y.collapsedBefore=Math.max(y.additionStart-1-l,0),s.hunks.push(y),l=y.additionStart+y.additionCount-1;for(const g of p)g.type==="context"?(y.splitLineCount+=g.lines.length,y.unifiedLineCount+=g.lines.length):(y.splitLineCount+=Math.max(g.additions.length,g.deletions.length),y.unifiedLineCount+=g.deletions.length+g.additions.length);y.splitLineStart=s.splitLineCount,y.unifiedLineStart=s.unifiedLineCount,s.splitLineCount+=y.splitLineCount,s.unifiedLineCount+=y.unifiedLineCount}s!=null&&(!n&&s.prevName!=null&&s.name!==s.prevName&&(s.hunks.length>0?s.type="rename-changed":s.type="rename-pure"),s.type!=="rename-pure"&&s.type!=="rename-changed"&&(s.prevName=void 0),i.push(s))}return{patchMetadata:o,files:i}}function Nh(e,t){const n=[];for(const r of e.split(a2))try{n.push(iA(r,t!=null?`${t}-${n.length}`:void 0))}catch(o){console.error(o)}return n}function Es(e){return e==="change"?{type:"change",additions:[],deletions:[],noEOFCRAdditions:!1,noEOFCRDeletions:!1}:{type:"context",lines:[],noEOFCR:!1}}function ga(e,t,n){const r=Nh(Z2(e.name,t.name,e.contents,t.contents,e.header,t.header,n))[0]?.files[0];if(r==null)throw new Error("parseDiffFrom: FileInvalid diff -- probably need to fix something -- if the files are the same maybe?");return r.oldLines=e.contents.split(la),r.newLines=t.contents.split(la),e.cacheKey!=null&&t.cacheKey!=null&&(r.cacheKey=`${e.cacheKey}:${t.cacheKey}`),r}let sA=-1;var dc=class{static LoadedCustomComponent=Ph;__id=++sA;fileContainer;spriteSVG;pre;unsafeCSSStyle;hoverContent;headerElement;headerMetadata;customHunkElements=[];errorWrapper;hunksRenderer;resizeManager;scrollSyncManager;mouseEventManager;lineSelectionManager;annotationElements=[];lineAnnotations=[];oldFile;newFile;fileDiff;constructor(e={theme:it},t,n=!1){this.options=e,this.workerManager=t,this.isContainerManaged=n,this.hunksRenderer=new nA({...e,hunkSeparators:typeof e.hunkSeparators=="function"?"custom":e.hunkSeparators},this.handleHighlightRender,this.workerManager),this.resizeManager=new hh,this.scrollSyncManager=new V2,this.mouseEventManager=new fh("diff",fi(e,typeof e.hunkSeparators=="function"||(e.hunkSeparators??"line-info")==="line-info"?this.handleExpandHunk:void 0)),this.lineSelectionManager=new dh(di(e)),this.workerManager?.subscribeToThemeChanges(this)}handleHighlightRender=()=>{this.rerender()};setOptions(e){e!=null&&(this.options=e,this.hunksRenderer.setOptions({...this.options,hunkSeparators:typeof e.hunkSeparators=="function"?"custom":e.hunkSeparators}),this.mouseEventManager.setOptions(fi(e,typeof e.hunkSeparators=="function"||(e.hunkSeparators??"line-info")==="line-info"?this.handleExpandHunk:void 0)),this.lineSelectionManager.setOptions(di(e)))}mergeOptions(e){this.options={...this.options,...e}}setThemeType(e){if((this.options.themeType??"system")!==e&&(this.mergeOptions({themeType:e}),this.hunksRenderer.setThemeType(e),this.headerElement!=null&&(e==="system"?delete this.headerElement.dataset.themeType:this.headerElement.dataset.themeType=e),this.pre!=null))switch(e){case"system":delete this.pre.dataset.themeType;break;case"light":case"dark":this.pre.dataset.themeType=e;break}}getHoveredLine=()=>this.mouseEventManager.getHoveredLine();setLineAnnotations(e){this.lineAnnotations=e}setSelectedLines(e){this.lineSelectionManager.setSelection(e)}cleanUp(){this.hunksRenderer.cleanUp(),this.resizeManager.cleanUp(),this.mouseEventManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.lineSelectionManager.cleanUp(),this.workerManager?.unsubscribeToThemeChanges(this),this.workerManager=void 0,this.fileDiff=void 0,this.oldFile=void 0,this.newFile=void 0,this.isContainerManaged||this.fileContainer?.parentNode?.removeChild(this.fileContainer),this.fileContainer?.shadowRoot!=null&&(this.fileContainer.shadowRoot.innerHTML=""),this.fileContainer=void 0,this.pre=void 0,this.headerElement=void 0,this.errorWrapper=void 0}hydrate(e){const{fileContainer:t,prerenderedHTML:n}=e;Lh(t,n);for(const r of Array.from(t.shadowRoot?.children??[])){if(r instanceof SVGElement){this.spriteSVG=r;continue}if(r instanceof HTMLElement){if(r instanceof HTMLPreElement){this.pre=r;continue}if("diffsHeader"in r.dataset){this.headerElement=r;continue}if(r instanceof HTMLStyleElement&&r.hasAttribute(il)){this.unsafeCSSStyle=r;continue}}}if(this.pre==null)this.render(e);else{const{lineAnnotations:r,oldFile:o,newFile:i,fileDiff:s}=e;this.fileContainer=t,delete this.pre.dataset.dehydrated,this.lineAnnotations=r??this.lineAnnotations,this.newFile=i,this.oldFile=o,this.fileDiff=s??(o!=null&&i!=null?ga(o,i):void 0),this.hunksRenderer.hydrate(this.fileDiff),this.renderAnnotations(),this.renderHoverUtility(),this.injectUnsafeCSS(),this.mouseEventManager.setup(this.pre),this.lineSelectionManager.setup(this.pre),(this.options.overflow??"scroll")==="scroll"&&(this.resizeManager.setup(this.pre),(this.options.diffStyle??"split")==="split"&&this.scrollSyncManager.setup(this.pre))}}rerender(){this.fileDiff==null&&this.newFile==null&&this.oldFile==null||this.render({oldFile:this.oldFile,newFile:this.newFile,fileDiff:this.fileDiff,forceRender:!0})}handleExpandHunk=(e,t)=>{this.expandHunk(e,t)};expandHunk(e,t){this.hunksRenderer.expandHunk(e,t),this.rerender()}render({oldFile:e,newFile:t,fileDiff:n,forceRender:r=!1,lineAnnotations:o,fileContainer:i,containerWrapper:s}){const a=e!=null&&t!=null&&(!pa(e,this.oldFile)||!pa(t,this.newFile)),l=o!=null&&(o.length>0||this.lineAnnotations.length>0)?o!==this.lineAnnotations:!1;if(!r&&!l&&(n!=null&&n===this.fileDiff||n==null&&!a)||(this.oldFile=e,this.newFile=t,n!=null?this.fileDiff=n:e!=null&&t!=null&&a&&(this.fileDiff=ga(e,t)),o!=null&&this.setLineAnnotations(o),this.fileDiff==null))return;this.hunksRenderer.setOptions({...this.options,hunkSeparators:typeof this.options.hunkSeparators=="function"?"custom":this.options.hunkSeparators}),this.hunksRenderer.setLineAnnotations(this.lineAnnotations);const{disableFileHeader:u=!1,disableErrorHandling:c=!1}=this.options;u&&this.headerElement!=null&&(this.headerElement.parentNode?.removeChild(this.headerElement),this.headerElement=void 0),i=this.getOrCreateFileContainer(i,s);try{const d=this.hunksRenderer.renderDiff(this.fileDiff);if(d==null){this.workerManager!=null&&!this.workerManager.isInitialized()&&this.workerManager.initialize().then(()=>this.rerender());return}d.headerElement!=null&&this.applyHeaderToDOM(d.headerElement,i);const f=this.getOrCreatePreNode(i);this.applyHunksToDOM(f,d),this.renderSeparators(d.hunkData),this.renderAnnotations(),this.renderHoverUtility()}catch(d){if(c)throw d;console.error(d),d instanceof Error&&this.applyErrorToDOM(d,i)}}renderSeparators(e){const{hunkSeparators:t}=this.options;if(!(this.isContainerManaged||this.fileContainer==null||typeof t!="function")){for(const n of this.customHunkElements)n.parentNode?.removeChild(n);this.customHunkElements.length=0;for(const n of e){const r=document.createElement("div");r.style.display="contents",r.slot=n.slotName,r.appendChild(t(n,this)),this.fileContainer.appendChild(r),this.customHunkElements.push(r)}}}renderAnnotations(){if(this.isContainerManaged||this.fileContainer==null)return;for(const t of this.annotationElements)t.parentNode?.removeChild(t);this.annotationElements.length=0;const{renderAnnotation:e}=this.options;if(e!=null&&this.lineAnnotations.length>0)for(const t of this.lineAnnotations){const n=e(t);if(n==null)continue;const r=Ch(qr(t));r.appendChild(n),this.annotationElements.push(r),this.fileContainer.appendChild(r)}}renderHoverUtility(){const{renderHoverUtility:e}=this.options;if(this.fileContainer==null||e==null)return;this.hoverContent==null&&(this.hoverContent=Sh(),this.fileContainer.appendChild(this.hoverContent));const t=e(this.mouseEventManager.getHoveredLine);this.hoverContent.innerHTML="",t!=null&&this.hoverContent.appendChild(t)}getOrCreateFileContainer(e,t){if(this.fileContainer=e??this.fileContainer??document.createElement(ci),t!=null&&this.fileContainer.parentNode!==t&&t.appendChild(this.fileContainer),this.spriteSVG==null){const n=document.createElement("div");n.innerHTML=kh;const r=n.firstChild;r instanceof SVGElement&&(this.spriteSVG=r,this.fileContainer.shadowRoot?.appendChild(this.spriteSVG))}return this.fileContainer}getFileContainer(){return this.fileContainer}getOrCreatePreNode(e){return this.pre==null?(this.pre=document.createElement("pre"),e.shadowRoot?.appendChild(this.pre)):this.pre.parentNode!==e&&e.shadowRoot?.appendChild(this.pre),this.pre}applyHeaderToDOM(e,t){this.cleanupErrorWrapper();const n=document.createElement("div");n.innerHTML=qt(e);const r=n.firstElementChild;if(!(r instanceof HTMLElement)||(this.headerElement!=null?t.shadowRoot?.replaceChild(r,this.headerElement):t.shadowRoot?.prepend(r),this.headerElement=r,this.isContainerManaged))return;const{renderHeaderMetadata:o}=this.options;this.headerMetadata!=null&&this.headerMetadata.parentNode?.removeChild(this.headerMetadata);const i=o?.({oldFile:this.oldFile,newFile:this.newFile,fileDiff:this.fileDiff})??void 0;i!=null&&(this.headerMetadata=document.createElement("div"),this.headerMetadata.slot=ol,i instanceof Element?this.headerMetadata.appendChild(i):this.headerMetadata.innerText=`${i}`,t.appendChild(this.headerMetadata))}injectUnsafeCSS(){if(this.fileContainer?.shadowRoot==null)return;const{unsafeCSS:e}=this.options;e==null||e===""||(this.unsafeCSSStyle==null&&(this.unsafeCSSStyle=Th(),this.fileContainer.shadowRoot.appendChild(this.unsafeCSSStyle)),this.unsafeCSSStyle.innerText=Ah(e))}applyHunksToDOM(e,t){this.cleanupErrorWrapper(),this.applyPreNodeAttributes(e,t),e.innerHTML="";let n,r;if(t.unifiedAST!=null){const o=Oo({columnType:"unified"});o.innerHTML=this.hunksRenderer.renderPartialHTML(t.unifiedAST),e.appendChild(o)}else t.deletionsAST!=null&&(n=Oo({columnType:"deletions"}),n.innerHTML=this.hunksRenderer.renderPartialHTML(t.deletionsAST),e.appendChild(n)),t.additionsAST!=null&&(r=Oo({columnType:"additions"}),r.innerHTML=this.hunksRenderer.renderPartialHTML(t.additionsAST),e.appendChild(r));this.injectUnsafeCSS(),this.mouseEventManager.setup(e),this.lineSelectionManager.setup(e),(this.options.overflow??"scroll")==="scroll"?(this.resizeManager.setup(e),(this.options.diffStyle??"split")==="split"?this.scrollSyncManager.setup(e,n,r):this.scrollSyncManager.cleanUp()):(this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp())}applyPreNodeAttributes(e,{themeStyles:t,baseThemeType:n,additionsAST:r,deletionsAST:o,totalLines:i}){const{diffIndicators:s="bars",disableBackground:a=!1,disableLineNumbers:l=!1,overflow:u="scroll",themeType:c="system",diffStyle:d="split"}=this.options;Ih({pre:e,diffIndicators:s,disableBackground:a,disableLineNumbers:l,overflow:u,split:d==="unified"?!1:r!=null&&o!=null,themeStyles:t,themeType:n??c,totalLines:i})}applyErrorToDOM(e,t){this.cleanupErrorWrapper();const n=this.getOrCreatePreNode(t);n.innerHTML="",n.parentNode?.removeChild(n),this.pre=void 0;const r=t.shadowRoot??t.attachShadow({mode:"open"});this.errorWrapper??=document.createElement("div"),this.errorWrapper.dataset.errorWrapper="",this.errorWrapper.innerHTML="",r.appendChild(this.errorWrapper);const o=document.createElement("div");o.dataset.errorMessage="",o.innerText=e.message,this.errorWrapper.appendChild(o);const i=document.createElement("pre");i.dataset.errorStack="",i.innerText=e.stack??"No Error Stack",this.errorWrapper.appendChild(i)}cleanupErrorWrapper(){this.errorWrapper?.parentNode?.removeChild(this.errorWrapper),this.errorWrapper=void 0}};const aA={class:"diff-viewer"},lA={key:0,class:"flex items-center justify-center py-8"},uA={key:1,class:"flex flex-col items-center justify-center gap-3 py-12 text-muted-foreground"},cA={key:2,class:"flex flex-col items-center justify-center gap-3 py-12 text-muted-foreground"},dA={key:3,class:"diff-container"},fA={class:"flex flex-col items-center justify-center gap-3 border-b border-border bg-muted/30 py-6"},hA={class:"text-center"},pA={class:"text-sm text-muted-foreground"},mA={key:4,class:"flex flex-col items-center justify-center gap-3 py-12 text-muted-foreground"},gA={class:"text-center"},vA={class:"text-sm"},yA={key:5,class:"diff-container"},_A={key:0,class:"diff-toolbar"},fc=1e4,hc="steward-git-diff-layout",bA=me({__name:"DiffViewer",props:{hunks:{},filePath:{},binary:{type:Boolean},oldPath:{},fileStatus:{},fileContent:{},oldFileContent:{},showFullFile:{type:Boolean},isLoadingContent:{type:Boolean}},setup(e){const t=e,{resolvedTheme:n}=np(),r=fe(!1),o=fe("split"),i=fe(null),s=fe(null),a=fe(null),l=fe(null),u=fe(null);let c=null,d=null;xe(()=>t.filePath,()=>{r.value=!1});const f=te(()=>{let S=0;for(const w of t.hunks)S+=w.lines.length;return S}),h=te(()=>f.value>fc),p=te(()=>t.hunks.length===0&&!t.binary),b=te(()=>t.fileContent!==null&&t.fileContent!==void 0),_=te(()=>!!(t.showFullFile&&!b.value)),y=te(()=>!!(t.showFullFile&&b.value));function g(S){const w=S.split(".").pop()?.toLowerCase()||"";return{ts:"typescript",tsx:"tsx",js:"javascript",jsx:"jsx",vue:"vue",svelte:"svelte",py:"python",rb:"ruby",rs:"rust",go:"go",java:"java",kt:"kotlin",swift:"swift",dart:"dart",c:"c",cpp:"cpp",h:"c",hpp:"cpp",cs:"csharp",php:"php",html:"html",css:"css",scss:"scss",sass:"sass",less:"less",json:"json",yaml:"yaml",yml:"yaml",toml:"toml",xml:"xml",md:"markdown",mdx:"mdx",sh:"bash",bash:"bash",zsh:"bash",fish:"fish",ps1:"powershell",sql:"sql",graphql:"graphql",gql:"graphql",dockerfile:"dockerfile",makefile:"makefile"}[w]||"text"}const m=te(()=>g(t.filePath));function v(){c&&(c.cleanUp(),c=null)}function x(){d&&(d.cleanUp(),d=null)}function L(){v(),x()}function P(S){o.value=S}function O(){const S=localStorage.getItem(hc);(S==="split"||S==="unified")&&(o.value=S)}function W(S){return S?S.replace(/\r?\n/g,""):"/dev/null"}function N(S,w,I){switch(I){case"added":return{oldPath:"/dev/null",newPath:S};case"deleted":return{oldPath:w||S,newPath:"/dev/null"};default:return{oldPath:w||S,newPath:S}}}function M(S,w,I,D){const j=N(w,I,D),Q=[`--- ${W(j.oldPath)}`,`+++ ${W(j.newPath)}`];for(const ne of S){Q.push(`@@ -${ne.oldStart},${ne.oldLines} +${ne.newStart},${ne.newLines} @@`);for(const oe of ne.lines)oe.type==="add"?Q.push(`+${oe.content}`):oe.type==="remove"?Q.push(`-${oe.content}`):Q.push(` ${oe.content}`)}return`${Q.join(`
1309
+ `)}
1310
+ `}function C(S){return S instanceof Error&&S.message?S.message:"Could not parse diff data."}xe(()=>[t.hunks,t.filePath,t.oldPath,t.fileStatus],([S,w,I,D])=>{if(s.value=null,S.length===0){a.value=null;return}try{const j=M(S,w,I,D),ne=Nh(j,`steward-${w}`)[0]?.files[0]||null;if(!ne){a.value=null,s.value="Could not parse patch into a renderable diff.";return}a.value=ne}catch(j){a.value=null,s.value=C(j)}},{immediate:!0});const F=te(()=>!y.value||t.fileContent===null||t.fileContent===void 0?null:{name:t.filePath,contents:t.fileContent,lang:m.value}),E=te(()=>y.value?t.fileStatus==="added"?{name:t.oldPath||t.filePath,contents:"",lang:m.value}:t.oldFileContent===null||t.oldFileContent===void 0?null:{name:t.oldPath||t.filePath,contents:t.oldFileContent,lang:m.value}:null);xe(()=>[E.value,F.value],([S,w])=>{if(l.value=null,u.value=null,!(!S||!w))try{u.value=ga(S,w,{context:Number.MAX_SAFE_INTEGER})}catch(I){l.value=C(I),u.value=null}},{immediate:!0});const $=te(()=>y.value||t.binary||p.value||h.value&&!r.value?!1:a.value!==null),A=te(()=>!!(y.value&&!t.binary&&u.value)),V=te(()=>!!(y.value&&!t.binary&&F.value&&!u.value)),z=te(()=>{const S=n.value;return{diffStyle:o.value,hunkSeparators:"line-info",diffIndicators:"bars",lineDiffType:"word-alt",overflow:"scroll",themeType:S,disableFileHeader:!0}}),G=te(()=>({diffStyle:"unified",hunkSeparators:"line-info",diffIndicators:"bars",lineDiffType:"word-alt",overflow:"scroll",themeType:n.value,disableFileHeader:!0})),U=te(()=>({overflow:"scroll",themeType:n.value,disableFileHeader:!0}));function K(){const S=i.value,w=a.value;if(!S||!$.value||!w){v();return}x(),c?c.setOptions(z.value):c=new dc(z.value),c.render({fileDiff:w,containerWrapper:S,forceRender:!0})}function J(){const S=i.value,w=u.value;if(!S||!A.value||!w){v();return}x(),c?c.setOptions(G.value):c=new dc(G.value),c.render({fileDiff:w,containerWrapper:S,forceRender:!0})}function q(){const S=i.value,w=F.value;if(!S||!V.value||!w){x();return}v(),d?d.setOptions(U.value):d=new $2(U.value),d.render({file:w,containerWrapper:S,forceRender:!0})}return xe(()=>[$.value,A.value,V.value,a.value,u.value,F.value,o.value,n.value,l.value,i.value],async()=>{if(await yt(),A.value){J();return}if(V.value){q();return}if($.value){K();return}L()},{immediate:!0}),Xr(()=>{L()}),nt(()=>{O()}),xe(o,S=>{localStorage.setItem(hc,S)}),(S,w)=>(X(),re("div",aA,[k(_)&&!e.binary?(X(),re("div",lA,[...w[3]||(w[3]=[ee("div",{class:"size-6 animate-spin rounded-full border-2 border-primary border-t-transparent"},null,-1)])])):e.binary?(X(),re("div",uA,[ie(k(Mp),{class:"size-10 opacity-50"}),w[4]||(w[4]=ee("div",{class:"text-center"},[ee("p",{class:"font-medium"},"Binary file"),ee("p",{class:"text-sm"},"This file cannot be displayed as a diff")],-1))])):k(p)&&!e.showFullFile?(X(),re("div",cA,[ie(k(En),{class:"size-10 opacity-50"}),w[5]||(w[5]=ee("div",{class:"text-center"},[ee("p",{class:"font-medium"},"No changes"),ee("p",{class:"text-sm"},"This file was touched but has no content changes")],-1))])):k(h)&&!k(r)&&!e.showFullFile?(X(),re("div",dA,[ee("div",fA,[ie(k(En),{class:"size-8 text-yellow-500"}),ee("div",hA,[w[6]||(w[6]=ee("p",{class:"font-medium"},"Large file",-1)),ee("p",pA," This file has "+_e(k(f).toLocaleString())+" lines (threshold: "+_e(fc.toLocaleString())+") ",1)]),ie(k(on),{variant:"outline",size:"sm",onClick:w[0]||(w[0]=I=>r.value=!0)},{default:le(()=>[ie(k(pp),{class:"mr-2 size-4"}),w[7]||(w[7]=Le(" Show full diff ",-1))]),_:1})])])):k(s)&&!e.showFullFile?(X(),re("div",mA,[ie(k(En),{class:"size-10 opacity-50"}),ee("div",gA,[w[8]||(w[8]=ee("p",{class:"font-medium"},"Failed to render diff",-1)),ee("p",vA,_e(k(s)),1)])])):(X(),re("div",yA,[e.showFullFile?we("",!0):(X(),re("div",_A,[ie(k(on),{size:"sm",variant:k(o)==="split"?"secondary":"ghost",class:"h-7 px-2.5 text-xs",onClick:w[1]||(w[1]=I=>P("split"))},{default:le(()=>[...w[9]||(w[9]=[Le(" Split ",-1)])]),_:1},8,["variant"]),ie(k(on),{size:"sm",variant:k(o)==="unified"?"secondary":"ghost",class:"h-7 px-2.5 text-xs",onClick:w[2]||(w[2]=I=>P("unified"))},{default:le(()=>[...w[10]||(w[10]=[Le(" Unified ",-1)])]),_:1},8,["variant"])])),ee("div",{ref_key:"diffMountRef",ref:i,class:"pierre-diff-host"},null,512)]))]))}}),wA=Object.assign(Tp(bA,[["__scopeId","data-v-1520f40e"]]),{__name:"GitDiffViewer"}),EA=me({__name:"Tabs",props:{defaultValue:{},orientation:{},dir:{},activationMode:{},modelValue:{},unmountOnHide:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,r=t,o=sr(n,"class"),i=pi(o,r);return(s,a)=>(X(),ye(k(Lg),Ze({"data-slot":"tabs"},k(i),{class:k(ar)("flex flex-col gap-2",n.class)}),{default:le(l=>[be(s.$slots,"default",Kr(Zr(l)))]),_:3},16,["class"]))}}),xA=Object.assign(EA,{__name:"UiTabs"}),kA=me({__name:"TabsContent",props:{value:{},forceMount:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},setup(e){const t=e,n=sr(t,"class");return(r,o)=>(X(),ye(k(Pg),Ze({"data-slot":"tabs-content",class:k(ar)("flex-1 outline-none",t.class)},k(n)),{default:le(()=>[be(r.$slots,"default")]),_:3},16,["class"]))}}),aI=Object.assign(kA,{__name:"UiTabsContent"}),CA=me({__name:"TabsList",props:{loop:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},setup(e){const t=e,n=sr(t,"class");return(r,o)=>(X(),ye(k(Rg),Ze({"data-slot":"tabs-list"},k(n),{class:k(ar)("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",t.class)}),{default:le(()=>[be(r.$slots,"default")]),_:3},16,["class"]))}}),SA=Object.assign(CA,{__name:"UiTabsList"}),TA=me({__name:"TabsTrigger",props:{value:{},disabled:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},setup(e){const t=e,n=sr(t,"class"),r=Cc(n);return(o,i)=>(X(),ye(k(Og),Ze({"data-slot":"tabs-trigger",class:k(ar)("data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t.class)},k(r)),{default:le(()=>[be(o.$slots,"default")]),_:3},16,["class"]))}}),pc=Object.assign(TA,{__name:"UiTabsTrigger"}),AA=me({__name:"Tooltip",props:{defaultOpen:{type:Boolean},open:{type:Boolean},delayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean}},emits:["update:open"],setup(e,{emit:t}){const o=pi(e,t);return(i,s)=>(X(),ye(k(Gg),Ze({"data-slot":"tooltip"},k(o)),{default:le(a=>[be(i.$slots,"default",Kr(Zr(a)))]),_:3},16))}}),LA=Object.assign(AA,{__name:"UiTooltip"}),IA=me({inheritAttrs:!1,__name:"TooltipContent",props:{forceMount:{type:Boolean},ariaLabel:{},asChild:{type:Boolean},as:{},side:{},sideOffset:{default:4},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},class:{}},emits:["escapeKeyDown","pointerDownOutside"],setup(e,{emit:t}){const n=e,r=t,o=sr(n,"class"),i=pi(o,r);return(s,a)=>(X(),ye(k(Kg),null,{default:le(()=>[ie(k(Yg),Ze({"data-slot":"tooltip-content"},{...k(i),...s.$attrs},{class:k(ar)("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit rounded-md px-3 py-1.5 text-xs text-balance",n.class)}),{default:le(()=>[be(s.$slots,"default"),ie(k($g),{class:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]),_:3},16,["class"])]),_:3}))}}),PA=Object.assign(IA,{__name:"UiTooltipContent"}),NA=me({__name:"TooltipProvider",props:{delayDuration:{default:0},skipDelayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean}},setup(e){const t=e;return(n,r)=>(X(),ye(k(Fg),Kr(Zr(t)),{default:le(()=>[be(n.$slots,"default")]),_:3},16))}}),RA=Object.assign(NA,{__name:"UiTooltipProvider"}),MA=me({__name:"TooltipTrigger",props:{reference:{},asChild:{type:Boolean},as:{}},setup(e){const t=e;return(n,r)=>(X(),ye(k(Qg),Ze({"data-slot":"tooltip-trigger"},t),{default:le(()=>[be(n.$slots,"default")]),_:3},16))}}),OA=Object.assign(MA,{__name:"UiTooltipTrigger"});function va(){let e=null;function t(){e?.controller.abort();const o=new AbortController,i={controller:o,signal:o.signal,isCurrent:()=>e===i&&!o.signal.aborted};return e=i,i}function n(o){e===o&&(e=null)}function r(){e?.controller.abort(),e=null}return{begin:t,clear:n,cancel:r}}function wn(e){if(!e||typeof e!="object")return!1;const t=e;if(t.name==="AbortError"||t.cause?.name==="AbortError")return!0;const n=t.message||t.cause?.message;return typeof n=="string"&&n.toLowerCase().includes("aborted")}function Rh(){const{showError:e}=Gh();function t(_){if(_&&typeof _=="object"){const y=_;return y.data?.message||y.data?.statusMessage||y.message||"Unknown error"}return"Unknown error"}const n=fe(0),r=fe(0),o=fe(0),i=fe(0),s=te(()=>n.value>0),a=te(()=>r.value>0),l=te(()=>o.value>0),u=te(()=>i.value>0);function c(_){_.value+=1}function d(_){_.value=Math.max(0,_.value-1)}async function f(_,y,g){if(!_||y.length===0)return{commits:[],failedShas:[]};c(n);try{const m={shas:y.join(",")};g?.repoPath&&(m.repo=g.repoPath);const v=await $fetch(`/api/repos/${_}/git/commits`,{query:m,signal:g?.signal}),x=v.map(P=>P.shortSha),L=y.filter(P=>!x.some(O=>O.startsWith(P)||P.startsWith(O)));return{commits:v,failedShas:L}}catch(m){return wn(m)?{commits:[],failedShas:[]}:(g?.suppressError||e("Failed to fetch commits",t(m)),{commits:[],failedShas:y})}finally{d(n)}}async function h(_,y,g){if(!_||!y)return[];c(r);try{const m={commit:y};return g?.repoPath&&(m.repo=g.repoPath),await $fetch(`/api/repos/${_}/git/diff`,{query:m,signal:g?.signal})}catch(m){throw!wn(m)&&!g?.suppressError&&e("Failed to fetch diff",t(m)),m}finally{d(r)}}async function p(_,y,g,m){if(!_||!y||!g)return[];c(o);try{const v={commit:y,file:g};return m?.repoPath&&(v.repo=m.repoPath),await $fetch(`/api/repos/${_}/git/file-diff`,{query:v,signal:m?.signal})}catch(v){throw!wn(v)&&!m?.suppressError&&e("Failed to fetch file diff",t(v)),v}finally{d(o)}}async function b(_,y,g,m){if(!_||!y||!g)return null;c(i);try{const v={commit:y,file:g};return m?.repoPath&&(v.repo=m.repoPath),(await $fetch(`/api/repos/${_}/git/file-content`,{query:v,signal:m?.signal})).content}catch(v){throw!wn(v)&&!m?.suppressError&&e("Failed to fetch file content",t(v)),v}finally{d(i)}}return{fetchCommits:f,fetchDiff:h,fetchFileDiff:p,fetchFileContent:b,isLoadingCommits:s,isLoadingDiff:a,isLoadingFileDiff:l,isLoadingFileContent:u}}const DA={key:0,class:"flex flex-1 flex-col items-center justify-center gap-4 p-8"},$A={class:"text-center"},VA={class:"text-sm text-muted-foreground"},BA={key:1,class:"flex flex-1 items-center justify-center"},FA={key:2,class:"flex flex-1 flex-col items-center justify-center gap-2 p-8 text-center text-muted-foreground"},zA={key:3,class:"flex min-h-0 flex-1 overflow-hidden"},HA={class:"flex w-56 shrink-0 flex-col border-r border-border"},GA={class:"flex items-center justify-between border-b border-border px-3 py-2"},jA={class:"text-xs font-medium text-muted-foreground"},UA={class:"text-muted-foreground/50 transition-colors hover:text-muted-foreground"},WA={class:"min-h-0 flex-1 overflow-y-auto"},qA={class:"flex min-h-0 flex-1 flex-col overflow-hidden"},YA={key:0,class:"flex items-center gap-2 border-b border-border px-4 py-2"},XA={key:0,class:"min-w-0 flex-1 truncate font-mono text-sm"},KA={class:"text-muted-foreground"},ZA={key:1,class:"min-w-0 flex-1 truncate font-mono text-sm"},QA={key:2,class:"rounded bg-yellow-500/10 px-1.5 py-0.5 text-xs text-yellow-600 dark:text-yellow-400"},JA={key:1,class:"flex flex-1 items-center justify-center"},eL={key:2,class:"flex flex-1 flex-col items-center justify-center gap-4 p-8"},tL={class:"text-center"},nL={class:"text-xs text-muted-foreground"},rL={key:4,class:"flex flex-1 items-center justify-center text-sm text-muted-foreground"},mc="steward-git-view-mode",oL=me({__name:"DiffPanel",props:{repoId:{},commitSha:{},repoPath:{}},emits:["close"],setup(e,{emit:t}){const n=e,r=t,{fetchCommits:o,fetchDiff:i,fetchFileDiff:s,fetchFileContent:a,isLoadingDiff:l,isLoadingFileDiff:u,isLoadingFileContent:c}=Rh(),d=fe([]),f=fe(),h=fe([]),p=fe(null),b=fe(null),_=fe(null),y=fe(null),g=fe(null),m=fe("changes"),v=va(),x=va();function L(q,S){if(q&&typeof q=="object"){const w=q;return w.data?.message||w.data?.statusMessage||w.statusMessage||w.message||S}return S}const P=te(()=>d.value.find(q=>q.path===f.value)),O=te(()=>{const q=P.value;return q?q.binary?!1:q.status!=="deleted":!0}),W=te(()=>`${n.repoPath||""}:${n.commitSha}:${f.value||""}`);function N(){y.value=null,d.value=[],f.value=void 0,h.value=[],p.value=null,b.value=null,_.value=null,g.value=null}async function M(){const q=n.repoId,S=n.commitSha,w=n.repoPath,I=v.begin();x.cancel(),N();try{const[D,j]=await Promise.all([i(q,S,{repoPath:w,signal:I.signal,suppressError:!0}),o(q,[S],{repoPath:w,signal:I.signal,suppressError:!0})]);if(!(I.isCurrent()&&n.repoId===q&&n.commitSha===S&&n.repoPath===w))return;d.value=D,_.value=j.commits[0]?.parentSha||null,D.length>0&&(f.value=D[0].path)}catch(D){if(wn(D)||!I.isCurrent())return;y.value=L(D,"Could not load commit diff.")}finally{v.clear(I)}}async function C(){const q=f.value;if(!q){g.value=null,h.value=[],p.value=null;return}const S=n.repoId,w=n.commitSha,I=n.repoPath,D=m.value,j=q,Q=_.value,ne=P.value?.status,oe=P.value?.oldPath,ae=x.begin();g.value=null,h.value=[],p.value=null,b.value=null;const ge=()=>ae.isCurrent()&&n.repoId===S&&n.commitSha===w&&n.repoPath===I&&m.value===D&&f.value===j&&_.value===Q;try{const B=s(S,w,j,{repoPath:I,signal:ae.signal,suppressError:!0});if(D==="full"){const R=ne==="added"?Promise.resolve(""):Q?a(S,Q,oe||j,{repoPath:I,signal:ae.signal,suppressError:!0}).catch(ce=>{if(wn(ce))throw ce;return null}):Promise.resolve(null),[H,Z,Y]=await Promise.all([B,a(S,w,j,{repoPath:I,signal:ae.signal,suppressError:!0}),R]);if(!ge())return;h.value=H,p.value=Z,b.value=Y}else{const R=await B;if(!ge())return;h.value=R,p.value=null,b.value=null}}catch(B){if(!ge()||wn(B))return;g.value=L(B,"Could not load file diff.")}finally{x.clear(ae)}}function F(q){if(!(q!=="changes"&&q!=="full")){if(q==="full"&&!O.value){m.value="changes";return}m.value=q}}function E(){const q=localStorage.getItem(mc);(q==="changes"||q==="full")&&(m.value=q)}function $(q){f.value=q}function A(){M()}function V(){C()}xe(()=>[f.value,m.value],()=>{C()}),xe(()=>O.value,q=>{!q&&m.value==="full"&&(m.value="changes")},{immediate:!0}),xe(()=>[n.repoId,n.commitSha,n.repoPath],()=>{M()},{immediate:!0});const z=fe(null),G=fe(null);function U(q){if(d.value.length===0)return;const S=f.value?d.value.findIndex(D=>D.path===f.value):-1;let w;q==="next"?w=S<d.value.length-1?S+1:0:w=S>0?S-1:d.value.length-1;const I=d.value[w];I&&(f.value=I.path)}function K(q){if(!G.value)return;const S=Array.from(G.value.querySelectorAll(".diff-separator")),w=[],I=G.value.querySelectorAll("diffs-container");for(const ae of I)ae instanceof HTMLElement&&ae.shadowRoot&&w.push(...Array.from(ae.shadowRoot.querySelectorAll("[data-separator]")));const D=[...S,...w].sort((ae,ge)=>ae.getBoundingClientRect().top-ge.getBoundingClientRect().top);if(D.length===0)return;const j=G.value.closest(".overflow-y-auto, [data-radix-scroll-area-viewport]");if(!j)return;const Q=j.scrollTop,ne=j.getBoundingClientRect();let oe=null;if(q==="next"){for(const ae of D)if(ae.getBoundingClientRect().top-ne.top+Q>Q+50){oe=ae;break}!oe&&D.length>0&&(oe=D[0])}else{for(let ae=D.length-1;ae>=0;ae--){const ge=D[ae];if(ge.getBoundingClientRect().top-ne.top+Q<Q-10){oe=ge;break}}!oe&&D.length>0&&(oe=D[D.length-1])}oe&&oe.scrollIntoView({behavior:"smooth",block:"start"})}function J(q){if(!(q.target instanceof HTMLInputElement||q.target instanceof HTMLTextAreaElement))switch(q.key){case"j":case"ArrowDown":!q.ctrlKey&&!q.metaKey&&(q.preventDefault(),U("next"));break;case"k":case"ArrowUp":!q.ctrlKey&&!q.metaKey&&(q.preventDefault(),U("prev"));break;case"[":q.preventDefault(),K("prev");break;case"]":q.preventDefault(),K("next");break;case"Escape":q.preventDefault(),r("close");break}}return nt(()=>{E(),document.addEventListener("keydown",J)}),xe(m,q=>{localStorage.setItem(mc,q)}),Xr(()=>{v.cancel(),x.cancel(),document.removeEventListener("keydown",J)}),(q,S)=>{const w=s2,I=wA;return X(),re("div",{ref_key:"panelRef",ref:z,class:"flex h-full flex-col overflow-hidden",tabindex:"-1"},[k(y)?(X(),re("div",DA,[ie(k(Do),{class:"size-12 text-destructive"}),ee("div",$A,[S[0]||(S[0]=ee("p",{class:"font-medium"},"Failed to load diff",-1)),ee("p",VA,_e(k(y)),1)]),ie(k(on),{variant:"outline",size:"sm",onClick:A},{default:le(()=>[ie(k(ul),{class:"mr-2 size-4"}),S[1]||(S[1]=Le(" Retry ",-1))]),_:1})])):k(l)&&k(d).length===0?(X(),re("div",BA,[ie(k(ks),{class:"size-8 animate-spin text-muted-foreground"})])):k(d).length===0?(X(),re("div",FA,[...S[2]||(S[2]=[ee("p",null,"No files changed in this commit",-1)])])):(X(),re("div",zA,[ee("div",HA,[ee("div",GA,[ee("span",jA,_e(k(d).length)+" file"+_e(k(d).length!==1?"s":"")+" changed ",1),ie(k(RA),null,{default:le(()=>[ie(k(LA),null,{default:le(()=>[ie(k(OA),{"as-child":""},{default:le(()=>[ee("button",UA,[ie(k(mp),{class:"size-3.5"})])]),_:1}),ie(k(PA),{side:"bottom",align:"end",class:"max-w-xs"},{default:le(()=>[...S[3]||(S[3]=[ee("div",{class:"space-y-1 text-xs"},[ee("div",{class:"flex justify-between gap-4"},[ee("span",{class:"text-muted-foreground"},"Navigate files"),ee("span",{class:"font-mono"},"j/k or ↑/↓")]),ee("div",{class:"flex justify-between gap-4"},[ee("span",{class:"text-muted-foreground"},"Jump to hunk"),ee("span",{class:"font-mono"},"[ / ]")]),ee("div",{class:"flex justify-between gap-4"},[ee("span",{class:"text-muted-foreground"},"Close"),ee("span",{class:"font-mono"},"Esc")])],-1)])]),_:1})]),_:1})]),_:1})]),ee("div",WA,[ie(w,{files:k(d),"selected-file":k(f),onSelect:$},null,8,["files","selected-file"])])]),ee("div",qA,[k(f)?(X(),re("div",YA,[k(P)?.oldPath?(X(),re("span",XA,[ee("span",KA,_e(k(P).oldPath),1),S[4]||(S[4]=ee("span",{class:"mx-2 text-muted-foreground"},"→",-1)),ee("span",null,_e(k(f)),1)])):(X(),re("span",ZA,_e(k(f)),1)),k(P)?.binary?(X(),re("span",QA," binary ")):we("",!0),k(P)?.binary?we("",!0):(X(),ye(k(xA),{key:3,"model-value":k(m),class:"shrink-0 gap-0","onUpdate:modelValue":F},{default:le(()=>[ie(k(SA),{class:"h-7 p-[2px]"},{default:le(()=>[ie(k(pc),{value:"changes",class:"h-[calc(100%-1px)] px-2 text-xs"},{default:le(()=>[...S[5]||(S[5]=[Le(" Changes ",-1)])]),_:1}),ie(k(pc),{value:"full",class:"h-[calc(100%-1px)] px-2 text-xs",disabled:!k(O),title:k(P)?.status==="deleted"?"Full file view is unavailable for deleted files.":void 0},{default:le(()=>[...S[6]||(S[6]=[Le(" Full file ",-1)])]),_:1},8,["disabled","title"])]),_:1})]),_:1},8,["model-value"]))])):we("",!0),k(u)?(X(),re("div",JA,[ie(k(ks),{class:"size-6 animate-spin text-muted-foreground"})])):k(g)?(X(),re("div",eL,[ie(k(Do),{class:"size-8 text-destructive"}),ee("div",tL,[S[7]||(S[7]=ee("p",{class:"text-sm font-medium"},"Failed to load file diff",-1)),ee("p",nL,_e(k(g)),1)]),ie(k(on),{variant:"outline",size:"sm",onClick:V},{default:le(()=>[ie(k(ul),{class:"mr-2 size-4"}),S[8]||(S[8]=Le(" Retry ",-1))]),_:1})])):k(f)?(X(),ye(k(gp),{key:3,class:"h-0 flex-1 overflow-hidden"},{default:le(()=>[ee("div",{ref_key:"diffViewerRef",ref:G},[(X(),ye(I,{key:k(W),hunks:k(h),"file-path":k(f),binary:k(P)?.binary,"file-status":k(P)?.status,"old-path":k(P)?.oldPath,"file-content":k(p),"old-file-content":k(b),"show-full-file":k(m)==="full","is-loading-content":k(c)},null,8,["hunks","file-path","binary","file-status","old-path","file-content","old-file-content","show-full-file","is-loading-content"]))],512)]),_:1})):(X(),re("div",rL," Select a file to view changes "))])]))],512)}}}),iL=Object.assign(oL,{__name:"GitDiffPanel"}),sL={class:"space-y-2"},aL={key:1,class:"rounded-lg border border-dashed p-4 text-center text-sm text-muted-foreground"},lL=["onClick"],uL={class:"flex items-start gap-3"},cL={class:"min-w-0 flex-1"},dL={class:"flex flex-wrap items-center gap-2"},fL={class:"font-mono text-xs font-medium text-primary"},hL={class:"flex items-center gap-1 text-xs text-muted-foreground"},pL={class:"flex items-center gap-0.5 text-xs text-green-600 dark:text-green-400"},mL={class:"flex items-center gap-0.5 text-xs text-red-600 dark:text-red-400"},gL={class:"mt-1 truncate text-sm"},vL={key:1,class:"flex items-center gap-1 text-muted-foreground"},yL={key:2,class:"text-muted-foreground"},_L={key:0,class:"mt-1 text-xs text-muted-foreground"},bL=me({__name:"CommitList",props:{commits:{},repoId:{}},emits:["select"],setup(e,{emit:t}){const n=e,r=t,{fetchCommits:o,isLoadingCommits:i}=Rh(),s=fe(new Map),a=fe(new Set);function l(g){return g.trim().toLowerCase()}function u(g){return(g||"").trim()}function c(g,m){return`${u(m)}::${l(g)}`}function d(g,m){const v=l(g),x=l(m.sha),L=l(m.shortSha);return x===v||L===v||x.startsWith(v)||v.startsWith(x)||L.startsWith(v)||v.startsWith(L)}const f=te(()=>new Set(n.commits.map(m=>m.repo).filter(Boolean)).size>1),h=va();xe(()=>({commits:n.commits,repoId:n.repoId}),async({commits:g,repoId:m},v,x)=>{const L=h.begin();if(x(()=>{h.clear(L)}),g.length===0||!m){s.value=new Map,a.value=new Set;return}const P=new Map;for(const M of g){const C=M.repo||"";P.has(C)||P.set(C,[]),P.get(C).push(M.sha)}const O=await Promise.all(Array.from(P.entries()).map(async([M,C])=>{const F=await o(m,C,{repoPath:M||void 0,signal:L.signal});return{repoPath:M,requestedShas:[...C],commits:F.commits,failedShas:F.failedShas}})),W=new Map,N=new Set;for(const{repoPath:M,requestedShas:C,commits:F,failedShas:E}of O){const $=[...F];for(const A of C){const V=c(A,M),z=$.findIndex(G=>d(A,G));if(z>=0){const[G]=$.splice(z,1);if(G){W.set(V,{...G,repoPath:M});continue}}N.add(V)}for(const A of E)N.add(c(A,M))}L.isCurrent()&&(s.value=W,a.value=N)},{immediate:!0}),Xr(()=>{h.cancel()});function p(g){const m=new Date(g),x=new Date().getTime()-m.getTime(),L=Math.floor(x/1e3),P=Math.floor(L/60),O=Math.floor(P/60),W=Math.floor(O/24);return L<60?"just now":P<60?`${P} minute${P===1?"":"s"} ago`:O<24?`${O} hour${O===1?"":"s"} ago`:W<7?`${W} day${W===1?"":"s"} ago`:m.toLocaleDateString()}function b(g){r("select",g.sha,g.repo)}function _(g){const m=s.value.get(c(g.sha,g.repo));if(m)return m;const v=l(g.sha),x=`${u(g.repo)}::`;for(const[L,P]of s.value){if(!L.startsWith(x))continue;const O=L.slice(x.length);if(O.startsWith(v)||v.startsWith(O))return P}}function y(g){const m=c(g.sha,g.repo);if(a.value.has(m))return!0;const v=l(g.sha),x=`${u(g.repo)}::`;for(const L of a.value){if(!L.startsWith(x))continue;const P=L.slice(x.length);if(P.startsWith(v)||v.startsWith(P))return!0}return!1}return(g,m)=>(X(),re("div",sL,[k(i)?(X(!0),re(De,{key:0},Wt(Math.min(e.commits.length,3),v=>(X(),re("div",{key:v,class:"animate-pulse rounded-lg border bg-muted/50 p-3"},[...m[0]||(m[0]=[rp('<div class="flex items-start gap-3"><div class="h-5 w-5 rounded bg-muted"></div><div class="flex-1 space-y-2"><div class="h-4 w-20 rounded bg-muted"></div><div class="h-4 w-3/4 rounded bg-muted"></div><div class="h-3 w-1/2 rounded bg-muted"></div></div></div>',1)])]))),128)):e.commits.length===0?(X(),re("div",aL," No commits recorded for this task ")):(X(!0),re(De,{key:2},Wt(e.commits,v=>(X(),re("button",{key:`${v.repo||""}:${v.sha}`,class:"w-full rounded-lg border bg-card p-3 text-left transition-colors hover:bg-muted/50 focus:outline-none focus:ring-2 focus:ring-ring",onClick:x=>b(v)},[ee("div",uL,[ie(k(Bp),{class:"mt-0.5 size-5 shrink-0 text-muted-foreground"}),ee("div",cL,[ee("div",dL,[ee("code",fL,_e(_(v)?.shortSha||v.sha.substring(0,7)),1),_(v)?(X(),re(De,{key:0},[ee("span",hL,[ie(k(jh),{class:"size-3"}),Le(" "+_e(_(v).filesChanged),1)]),ee("span",pL,[ie(k(vp),{class:"size-3"}),Le(_e(_(v).additions),1)]),ee("span",mL,[ie(k(Hp),{class:"size-3"}),Le(_e(_(v).deletions),1)])],64)):we("",!0),v.repo&&k(f)?(X(),ye(k(Co),{key:1,variant:"secondary",class:"gap-1 text-xs"},{default:le(()=>[ie(k(Vp),{class:"size-3"}),Le(" "+_e(v.repo),1)]),_:2},1024)):we("",!0)]),ee("p",gL,[_(v)?(X(),re(De,{key:0},[Le(_e(_(v).message),1)],64)):y(v)?(X(),re("span",vL,[ie(k(Do),{class:"size-3"}),m[1]||(m[1]=Le(" Commit unavailable ",-1))])):(X(),re("span",yL,"Loading..."))]),_(v)?(X(),re("p",_L,_e(_(v).author)+" · "+_e(p(_(v).date)),1)):we("",!0)])])],8,lL))),128))]))}}),wL=Object.assign(bL,{__name:"GitCommitList"}),EL=me({__name:"Separator",props:{orientation:{default:"horizontal"},decorative:{type:Boolean,default:!0},asChild:{type:Boolean},as:{},class:{}},setup(e){const t=e,n=sr(t,"class");return(r,o)=>(X(),ye(k(yp),Ze({"data-slot":"separator"},k(n),{class:k(ar)("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t.class)}),null,16,["class"]))}}),Fn=Object.assign(EL,{__name:"UiSeparator"}),xL={class:"flex items-center gap-2"},kL={key:1,class:"min-h-0 flex-1 overflow-hidden"},CL={key:2,class:"min-h-0 flex-1 space-y-4 overflow-y-auto px-6"},SL={class:"flex flex-wrap items-center gap-2"},TL={class:"space-y-2"},AL={class:"text-sm text-muted-foreground leading-relaxed"},LL={key:0,class:"space-y-2"},IL={class:"flex items-center gap-2 text-sm font-medium"},PL={class:"ml-4 list-decimal space-y-1 text-sm text-muted-foreground"},NL={key:2,class:"space-y-2"},RL={class:"flex items-center gap-2 text-sm font-medium"},ML={class:"space-y-1.5 text-sm text-muted-foreground"},OL={key:4,class:"space-y-2"},DL={class:"flex items-center gap-2 text-sm font-medium"},$L={class:"space-y-1.5"},VL={class:"mt-0.5 whitespace-nowrap rounded bg-background px-1.5 py-0.5 font-mono text-[11px] leading-none text-foreground/75"},BL={class:"min-w-0 text-sm leading-snug text-muted-foreground"},FL={class:"space-y-2"},zL={class:"flex items-center gap-2 text-sm font-medium"},HL={key:6,class:"space-y-2"},GL={class:"flex flex-col gap-1 text-xs text-muted-foreground"},jL={key:0,class:"flex items-center gap-2"},UL={key:1,class:"flex items-center gap-2"},WL={key:7,class:"space-y-2"},qL={class:"flex items-center justify-between rounded-md border border-border bg-muted/30 px-3 py-2 text-sm"},YL={class:"text-muted-foreground"},XL=me({__name:"Detail",props:ip({task:{},taskTitles:{},commits:{},repoId:{},taskPrdSlug:{},currentPrdSlug:{}},{open:{type:Boolean,default:!1},openModifiers:{}}),emits:["update:open"],setup(e){const t=e,n=op(e,"open"),r=te(()=>{if(!t.task)return{label:"",variant:"secondary"};switch(t.task.category){case"setup":return{label:"Setup",variant:"secondary"};case"feature":return{label:"Feature",variant:"default"};case"integration":return{label:"Integration",variant:"outline"};case"testing":return{label:"Testing",variant:"secondary"};case"documentation":return{label:"Docs",variant:"secondary"};default:return{label:t.task.category,variant:"secondary"}}}),o=te(()=>{if(!t.task)return{label:"",class:""};switch(t.task.priority){case"critical":return{label:"Critical",class:"text-destructive"};case"high":return{label:"High",class:"text-orange-500"};case"medium":return{label:"Medium",class:"text-muted-foreground"};case"low":return{label:"Low",class:"text-muted-foreground"};default:return{label:t.task.priority,class:"text-muted-foreground"}}}),i=te(()=>{if(!t.task)return{label:"",icon:Cr,class:""};switch(t.task.status){case"pending":return{label:"Pending",icon:Cr,class:"text-muted-foreground"};case"in_progress":return{label:"In Progress",icon:Pp,class:"text-blue-500"};case"completed":return{label:"Completed",icon:$o,class:"text-green-500"};default:return{label:t.task.status,icon:Cr,class:"text-muted-foreground"}}});function s(_){if(!_)return"";try{return new Date(_).toLocaleString()}catch{return _}}function a(_){return t.taskTitles?.get(_)??_}const l=te(()=>t.commits&&t.commits.length>0&&t.repoId),u=te(()=>!t.repoId||!t.taskPrdSlug?!1:t.currentPrdSlug?t.taskPrdSlug!==t.currentPrdSlug:!0),c=te(()=>{if(!u.value||!t.repoId||!t.taskPrdSlug||!t.task)return"";const _=new URLSearchParams({task:t.task.id,taskPrd:t.taskPrdSlug});return`/${t.repoId}/${t.taskPrdSlug}?${_.toString()}`}),d=fe("details"),f=fe(null),h=fe(null);function p(_,y){f.value=_,h.value=y||null,d.value="diff"}function b(){d.value="details",f.value=null,h.value=null}return xe(()=>t.task,()=>{d.value="details",f.value=null,h.value=null}),xe(n,_=>{_||(d.value="details",f.value=null,h.value=null)}),(_,y)=>{const g=iL,m=wL,v=Ap;return X(),ye(k(Cp),{open:n.value,"onUpdate:open":y[0]||(y[0]=x=>n.value=x)},{default:le(()=>[ie(k(kp),{class:et(["flex h-full w-full flex-col overflow-hidden sm:max-w-lg",k(d)==="diff"?"sm:!max-w-[94vw] xl:!max-w-[88vw]":""])},{default:le(()=>[e.task?(X(),ye(k(_p),{key:0,class:"px-6 pr-12"},{default:le(()=>[ee("div",xL,[k(d)==="diff"?(X(),ye(k(on),{key:0,variant:"ghost",size:"icon",class:"size-8 shrink-0",onClick:b},{default:le(()=>[ie(k(Lp),{class:"size-4"})]),_:1})):we("",!0),ie(k(bp),{class:"text-left text-lg"},{default:le(()=>[Le(_e(k(d)==="diff"?"Commit Changes":e.task.title),1)]),_:1})]),ie(k(wp),{class:"sr-only"},{default:le(()=>[...y[1]||(y[1]=[Le("Task details",-1)])]),_:1})]),_:1})):we("",!0),e.task&&k(d)==="diff"&&k(f)&&e.repoId?(X(),re("div",kL,[ie(g,{"repo-id":e.repoId,"commit-sha":k(f),"repo-path":k(h)||void 0,class:"h-full",onClose:b},null,8,["repo-id","commit-sha","repo-path"])])):e.task?(X(),re("div",CL,[ee("div",SL,[ie(k(Co),{variant:k(r).variant},{default:le(()=>[ie(k(jp),{class:"mr-1 size-3"}),Le(" "+_e(k(r).label),1)]),_:1},8,["variant"]),ie(k(Co),{variant:"outline",class:et(k(o).class)},{default:le(()=>[ie(k(En),{class:"mr-1 size-3"}),Le(" "+_e(k(o).label),1)]),_:1},8,["class"]),ie(k(Co),{variant:"outline",class:et(k(i).class)},{default:le(()=>[(X(),ye(Lt(k(i).icon),{class:"mr-1 size-3"})),Le(" "+_e(k(i).label),1)]),_:1},8,["class"])]),ee("div",TL,[y[2]||(y[2]=ee("h4",{class:"text-sm font-medium"},"Description",-1)),ee("p",AL,_e(e.task.description),1)]),ie(k(Fn)),e.task.steps.length>0?(X(),re("div",LL,[ee("h4",IL,[ie(k(zp),{class:"size-4"}),y[3]||(y[3]=Le(" Steps ",-1))]),ee("ol",PL,[(X(!0),re(De,null,Wt(e.task.steps,(x,L)=>(X(),re("li",{key:L,class:"pl-1"},_e(x),1))),128))])])):we("",!0),e.task.steps.length>0&&e.task.passes.length>0?(X(),ye(k(Fn),{key:1})):we("",!0),e.task.passes.length>0?(X(),re("div",NL,[ee("h4",RL,[ie(k(Gp),{class:"size-4"}),y[4]||(y[4]=Le(" Pass Criteria ",-1))]),ee("ul",ML,[(X(!0),re(De,null,Wt(e.task.passes,(x,L)=>(X(),re("li",{key:L,class:"flex items-start gap-2"},[ee("div",{class:et(["mt-0.5 flex size-4 shrink-0 items-center justify-center rounded border",e.task.status==="completed"?"border-primary bg-primary text-primary-foreground":"border-muted-foreground/50"])},[e.task.status==="completed"?(X(),ye(k(Sp),{key:0,class:"size-3"})):we("",!0)],2),ee("span",null,_e(x),1)]))),128))])])):we("",!0),e.task.dependencies.length>0?(X(),ye(k(Fn),{key:3})):we("",!0),e.task.dependencies.length>0?(X(),re("div",OL,[ee("h4",DL,[ie(k(Fp),{class:"size-4"}),y[5]||(y[5]=Le(" Dependencies ",-1))]),ee("ul",$L,[(X(!0),re(De,null,Wt(e.task.dependencies,x=>(X(),re("li",{key:x,class:"grid grid-cols-[auto_minmax(0,1fr)] items-start gap-2.5 rounded-md border border-border/60 bg-muted/25 px-3 py-2"},[ee("span",VL,_e(x),1),ee("span",BL,_e(a(x)),1)]))),128))])])):we("",!0),k(l)?(X(),re(De,{key:5},[ie(k(Fn)),ee("div",FL,[ee("h4",zL,[ie(k(Np),{class:"size-4"}),y[6]||(y[6]=Le(" Changes ",-1))]),ie(m,{commits:e.commits,"repo-id":e.repoId,onSelect:p},null,8,["commits","repo-id"])])],64)):we("",!0),e.task.startedAt||e.task.completedAt?(X(),re("div",HL,[ie(k(Fn)),ee("div",GL,[e.task.startedAt?(X(),re("div",jL,[ie(k(Ip),{class:"size-3"}),ee("span",null,"Started: "+_e(s(e.task.startedAt)),1)])):we("",!0),e.task.completedAt?(X(),re("div",UL,[ie(k($o),{class:"size-3"}),ee("span",null,"Completed: "+_e(s(e.task.completedAt)),1)])):we("",!0)])])):we("",!0),k(u)?(X(),re("div",WL,[ie(k(Fn)),ee("div",qL,[ee("span",YL,"This task belongs to "+_e(e.taskPrdSlug)+".",1),ie(v,{to:k(c)},{default:le(()=>[ie(k(on),{variant:"outline",size:"sm",class:"h-8"},{default:le(()=>[ie(k(Rp),{class:"mr-1.5 size-3.5"}),y[7]||(y[7]=Le(" Open PRD ",-1))]),_:1})]),_:1},8,["to"])])])):we("",!0)])):we("",!0),ie(k(Ep),{class:"px-6 pb-6"},{default:le(()=>[ie(k(xp),{"as-child":""},{default:le(()=>[ie(k(on),{variant:"outline",class:"w-full"},{default:le(()=>[...y[8]||(y[8]=[Le("Close",-1)])]),_:1})]),_:1})]),_:1})]),_:1},8,["class"])]),_:1},8,["open"])}}}),lI=Object.assign(XL,{__name:"TasksDetail"});export{Ip as C,Rp as E,Hp as M,SA as T,lI as _,Cr as a,$o as b,iI as c,pc as d,aI as e,sI as f,xA as g};